Pārlūkot izejas kodu

feat uni 修改了bug

GaoRunQi 4 mēneši atpakaļ
vecāks
revīzija
66c6e59118

+ 22 - 15
yudao-ui-admin-uniapp/pages/restaurant/confirmOrder.vue

@@ -107,12 +107,17 @@ const handleOk= async () =>{
 		let data = JSON.stringify(res.data)
             console.log("res.data:"+JSON.stringify(res.data))
             console.log("data.appId:"+data.appId)
-            let appId = res.data.appId;
-            let timeStamp = res.data.timeStamp;
-            let nonceStr = res.data.nonceStr;
-            let packageX = res.data.packageX;
-            let signType = res.data.signType;
-            let paySign = res.data.paySign;
+			pay(res.data)
+          
+    })
+}
+const pay= (data) =>{
+	let appId = data.appId;
+            let timeStamp = data.timeStamp;
+            let nonceStr = data.nonceStr;
+            let packageX = data.packageX;
+            let signType = data.signType;
+            let paySign = data.paySign;
             console.log(appId, "appId")
             console.log(timeStamp, "timeStamp")
             console.log(nonceStr, "nonceStr")
@@ -126,21 +131,23 @@ const handleOk= async () =>{
               package: packageX, // 固定值
               signType: signType,
               paySign: paySign, // 签名,这里用的 MD5/RSA 签名
-              success(res) {
+              success : function (res) {
                 console.log("success" + JSON.stringify(res))
-                uni.reLaunch({
-                  url: 'pages/order/list'
-                });
+                // uni.navigateTo({url: '/pages/order/detail'});
+				sheep.$router.go('/pages/order/detail', {
+					id:data.orderId,
+					});
 				sheep.$helper.toast('支付成功')
               },
-              fail(res) {
+              fail: function (res) {
                 console.log("fail" + JSON.stringify(res))
 				sheep.$helper.toast('支付失败')
-              }
+				// pay(data)
+              },
+			  complete: function (res){
+				console.log("调用完成")
+			  }
             });
-    })
-    
-    
 }
 const tabSelect= (e) =>{
 	console.log(e.currentTarget.dataset.id)

+ 1 - 1
yudao-ui-admin-uniapp/pages/restaurant/order.vue

@@ -4,7 +4,7 @@
             <!-- <swiper class="screen-swiper round-dot" :indicator-dots="true" :circular="true" :autoplay="true" interval="5000"
 		 duration="500"> -->
 			<!-- <swiper-item v-for="(item,index) in 4" :key="index"> -->
-				<image src="./top.png" mode="aspectFit" style="height: 15vh; width: 100%;"></image>
+				<image src="https://www.rshunfandian.cn/prod-api/admin-api/infra/file/24/get/829355650921a542a491d6b901fce0a11b261e749778fb68688fed23d1b31fc5.png" mode="aspectFit" style="height: 15vh; width: 100%;"></image>
 			<!-- </swiper-item> -->
 		<!-- </swiper> -->
         <!-- </view> -->

BIN
yudao-ui-admin-uniapp/pages/restaurant/top.png


+ 5 - 14
yudao-ui-admin-uniapp/pages/user/address/edit.vue

@@ -14,16 +14,6 @@
 						placeholderStyle="color:#BBBBBB;font-size:30rpx;font-weight:400;line-height:normal">
 					</uni-easyinput>
 				</uni-forms-item>
-				<!-- <uni-forms-item name="areaName" label="省市区" @tap="state.showRegion = true" class="form-item">
-					<uni-easyinput v-model="state.model.areaName" disabled :inputBorder="false"
-						:styles="{ disableColor: '#fff', color: '#333' }"
-						placeholderStyle="color:#BBBBBB;font-size:30rpx;font-weight:400;line-height:normal"
-						placeholder="请选择省市区">
-						<template v-slot:right>
-							<uni-icons type="right" />
-						</template>
-					</uni-easyinput>
-				</uni-forms-item> -->
 				<uni-forms-item name="address" label="详细地址" :formItemStyle="{ alignItems: 'flex-start' }"
 					:labelStyle="{ lineHeight: '5em' }" class="textarea-item">
 					<uni-easyinput :inputBorder="false" type="textarea" v-model="state.model.address"
@@ -65,11 +55,12 @@
 	const state = reactive({
 		showRegion: false,
 		model: {
+			id:'',
 			name: '',
 			phone: '',
-     	 address: '',
+     	 	address: '',
 			defaultStatus: false,
-      areaName: '',
+      		areaName: '',
 		},
     rules: {},
 	});
@@ -160,13 +151,13 @@
     // 获得地区数据
 		getAreaData();
     // 情况一:基于 id 获得收件地址
-		// if (options.id) {
+		if (options.id) {
 			let { code, data} = await AddressApi.getAddress(options.id);
       if (code !== 0) {
         return;
       }
       state.model = data;
-		// }
+		}
      // 情况二:微信导入
     if (options.data) {
       let data = JSON.parse(options.data);