zhengkaixin 3 vuotta sitten
vanhempi
commit
15f6ca3b02

+ 1 - 1
apis/chargeProcess.js

@@ -11,7 +11,7 @@ import request from '../utils/request.js';
  
  export function chargingDetail(data) {
  	return request({
- 		method: 'post',
+ 		method: 'get',
  		data: data,
  		url: '/mobile/chargingCar/chargingDetail'
  	})

+ 0 - 1
iconfont/iconfont.css

@@ -1,6 +1,5 @@
 @font-face {
   font-family: 'iconfont';  /* project id 3394761 */
-  src: url('');
   src: url('?#iefix') format('embedded-opentype'),
   url('https://at.alicdn.com/t/font_3394761_ya9wpfykipd.woff2') format('woff2'),
   url('https://at.alicdn.com/t/font_3394761_ya9wpfykipd.woff') format('woff'),

+ 10 - 78
pages/searchPile/chargeProcess/dcCharging.vue

@@ -1,5 +1,5 @@
 <template>
-	<view style="background-color: #fff; padding-bottom: 196px;">
+	<view style="background-color: #fff; padding-bottom: 40px;">
 		<u-navbar title="启动中">
 		</u-navbar>
 		<view class="iconfont tittle-font">
@@ -116,93 +116,25 @@
 		},
 		onLoad(op) {
 			if (op.id) {
-				this.submitForm.deviceNo = op.deviceNo;
-				this.submitForm.channelNo = op.gun;
-				this.submitForm.carNumber = op.carNumber;
-				
+				this.id = op.id;
+				this.getInfo()
 			}
 
 
 		},
-		onShow() {
-			this.getHomePage()
+		onReady() {
+			
 		},
 		methods: {
-			ckInput(text){
-				if(text.indexOf('.')>0){
-					
-					this.$nextTick(()=>{
-						this.otherNum=text.substring(0,text.indexOf('.'))
-						uni.showToast({
-							title:"请输入正整数"
-						})
-					})
-				}
-				var t	=Number(text);
-				if(t<1){
-					this.$nextTick(()=>{
-						this.otherNum='';
-					})
-						
-				}
-				if(t>500){
-					this.$nextTick(()=>{
-						this.otherNum=500;
-					})
-						
-				}
-				
-			},
-			moneyClick(index) {
-				this.moneyActiveClass = index;
-				
-			},
-			confirm() {
-			
-				//console.log(JSON.stringify(this.submitForm))
-				
-				
-				uni.showLoading({
-					title: "加载中",
-					mask: true,
-				})
-
-				//this.submitForm.deviceNo = this.detail.deviceNo;
-				API.startCarCharging(this.submitForm).then((res) => {
-					console.log(JSON.stringify(this.res))
-					this.gotoUrl("pages/searchPile/chargeProcess/dcCharging?id="+res.data.recordId);
-
-
-				}).catch(error => {
-					uni.hideLoading()
-					if (error == '用户账户余额不足!') {
-						uni.showModal({
-							title: '支付',
-							content: '用户账户余额不足,是否充值?',
-							success: res => {
-								if (res.confirm) {
-									//付钱  改为组件
-									this.gotoUrl("pages/user/finance/recharge");
-
-								} else if (res.cancel) {
-									console.log('用户点击取消');
-								}
-							}
-						});
-					} else {
-						uni.showToast({
-							title: error
-						})
-					}
-
-				})
-			},
-			getHomePage() {
+			
+			getInfo() {
 				uni.showLoading({
 					title: "加载中",
 					mask: true,
 				})
-				API.personalCenter().then((res) => {
+				API.chargingDetail({
+					id:this.id
+				}).then((res) => {
 					this.user = res.data
 					this.isReady = true;
 					uni.hideLoading()

+ 8 - 5
pages/user/finance/recharge.vue

@@ -8,7 +8,7 @@
 				<view class="recharge-item" :class="!otherNum&&moneyActiveClass == item.id ? 'active' : ''"
 					v-for="(item,index) in moneyList" :key="item.id" @click="moneyClick(item.id,item)">
 					{{item.rechargeAmount}}
-					<view class="amount">赠20元</view>
+					<view class="amount" v-if="item.giftAmount">{{item.giftAmount}}</view>
 					</view>
 				
 			</view>
@@ -76,6 +76,8 @@
 	export default {
 		data() {
 			return {
+				submitNum:0,
+				submitNumCk:1,
 				showModel:false,
 				selectItem:{},
 				userId: '',
@@ -235,10 +237,7 @@
 				})
 			},
 			wxpy(){
-				uni.showLoading({
-					title: "加载中",
-					mask: true,
-				})
+				
 				Pay.wxpay(this.submitForm).then((response) => {
 					
 					if(!response.result){		
@@ -261,6 +260,10 @@
 				})
 			},
 			rechargeNow() {
+				uni.showLoading({
+					title: "加载中",
+					mask: true,
+				})
 				this.submitForm={};
 				if(!this.otherNum){
 					this.submitForm.chargingMarketingId=this.selectItem.id;

+ 0 - 8
utils/wxpay.js

@@ -24,7 +24,6 @@ function onBridgeReady(params) {
 				//alert("支付取消") // 会执行
 				 uni.hideLoading();
 			} else {
-				alert("支付失败")
 				 uni.hideLoading();
 			}
 		}
@@ -34,13 +33,6 @@ function onBridgeReady(params) {
 export const wxPayJs = (params) => {
 	console.log("wxPayJs+"+new Date().getTime())
 	
-	uni.showLoading({
-		mask:true,title:'加载中...'
-	})
-	if (!params.url) {
-		params.url = window.location.href.split("#")[0] + "/#/";
-	}
-
 	if (typeof window.WeixinJSBridge === 'undefined') {
 		if (document.addEventListener) {
 			document.addEventListener('WeixinJSBridgeReady', function() {