Explorar el Código

零售 完善抵用券的功能 修改 零售 采购 支付成功后页面显示

wangn hace 5 años
padre
commit
79795c64ea

+ 17 - 7
hdApp/src/admin/billing/affirmGhs.vue

@@ -238,10 +238,10 @@
 						<!-- <appSendTime :placeholder="'默认30分钟内配送'" @alterTime="purchaseFreight(ghsMsg)" :sendDate.sync="form.sendDate" :sendTime.sync="sendTime" ></appSendTime> -->
             <appTimer :placeholder="'默认30分钟内配送'" @confirm="onConfirm" :sendTime="sendTime"></appTimer>
 					<tui-list-cell class="line-cell" :hover="false" :arrow="false" v-show="form.sendType == 1">
-						<view class="tui-title ">运费{{form.sendCost}}</view>
+						<view class="tui-title ">运费</view>
 						<input type="number" placeholder="留空表示免运费" @input="countAllPrices" v-model="form.sendCost" placeholder-class="tui-placeholder" disabled>
 					</tui-list-cell>
-          <tui-list-cell class="line-cell" :hover="false" :arrow="true" @click="pageTo({url: '/admin/coupon/selectCouponList'})">
+          <tui-list-cell class="line-cell" :hover="false" :arrow="true" @click="toCoupon">
 						<view class="tui-title ">红包/抵用券</view>
 						<view class="coupon_box">{{couponText}}</view>
 					</tui-list-cell>
@@ -269,8 +269,8 @@
 					<text class="large" v-else-if="form.sendType==1 && couponSumText">{{ allPrice + Number(form.sendCost) - Number(couponSumText)  }}</text>
 					<text class="large" v-else-if="form.sendType==2 && !couponSumText">{{ allPrice}}</text>
 					<text class="large" v-else-if="form.sendType==2 && couponSumText">{{ NumberSub(allPrice, Number(couponSumText))}}</text>
-					<text class="large" v-else-if="!form.sendType && !couponSumText">{{ allPrice }}</text>
-					<text class="large" v-else-if="!form.sendType && couponSumText">{{ NumberSub(allPrice, Number(couponSumText)) }}</text>
+					<!-- <text class="large" v-else-if="!form.sendType && !couponSumText">{{ allPrice }}</text> -->
+					<!-- <text class="large" v-else-if="!form.sendType && couponSumText">{{ NumberSub(allPrice, Number(couponSumText)) }}</text> -->
 				</text>
 			</view>
 			<button class="admin-button-com blue middle" @click="affirmFormSubmit">提交</button>
@@ -336,7 +336,8 @@ export default {
 				sendTime: "",
 				sendCost: "",
 				customId: "",
-				product: ""
+				product: "",
+        couponId: '0'
 			},
 			// 详细地址
 			// showRegion: false,
@@ -364,8 +365,10 @@ export default {
     if(uni.getStorageSync('selectCouponInfo').couponSum) {
       this.couponSumText = uni.getStorageSync('selectCouponInfo').couponSum
       this.couponText = '-¥' + this.couponSumText
+      this.form.couponId = uni.getStorageSync('selectCouponInfo').couponId
     } else {
       this.couponSumText = "0"
+      this.form.couponId = '0'
        this.hasCoupon()
     }
   },
@@ -381,13 +384,19 @@ export default {
       this.sendTime = val
     },
 		toPhone(phone){
+      let amount = this.form.sendType == 1 ? this.allPrice+Number(this.form.sendCost) : this.allPrice
 			uni.makePhoneCall({
 				phoneNumber: phone
 			});
 		},
+    toCoupon() {
+      let amount = this.form.sendType == 1 ? this.numberAdd(this.allPrice, Number(this.form.sendCost)) : this.allPrice
+      console.log(amount)
+      this.pageTo({url: '/admin/coupon/selectCouponList?price=' + amount})
+    },
     // 是否有可用优惠券
     hasCoupon() {
-      let amount = this.form.sendType == 1 ? this.allPrice+Number(this.form.sendCost) : this.allPrice
+      let amount = this.form.sendType == 1 ? this.numberAdd(this.allPrice, Number(this.form.sendCost)) : this.allPrice
       shopHouponHas({amount}).then(res => {
         console.log(377, res)
         this.couponText = res.data.has ? '有可用优惠券' : ''
@@ -461,6 +470,7 @@ export default {
 				remark:this.remark,
 				product:JSON.stringify(product),
 				ghsId:this.ghsMsg.id,
+        couponId: this.form.couponId
 			}
 			let self = this;
 			uni.showModal({
@@ -472,7 +482,7 @@ export default {
 						createOrder(parameter).then(res => {
 							self.resetSelectInfoByType(self.pageType);
 							const {data: { orderSn,actPrice }} = res;
-							uni.navigateTo({url: `/pagesPurchase/wechatPay?type=2&orderSn=${orderSn}&actPrice=${actPrice}`})
+							self.pageTo({url: `/pagesPurchase/wechatPay?type=2&orderSn=${orderSn}&actPrice=${actPrice}`, type: 2})
 						});
 					}
 				}

+ 2 - 2
hdApp/src/admin/coupon/selectCouponList.vue

@@ -65,10 +65,10 @@ export default {
   computed: {
     ...mapGetters({ shopUser: "getShopUser" }),
     usableList() {
-      return this.list.filter(item => {return Number(item.miniCost) <= 100})
+      return this.list.filter(item => {return Number(item.miniCost) <= Number(this.option.price)})
     },
     unusableList() {
-      return this.list.filter(item => {return Number(item.miniCost) > 100})
+      return this.list.filter(item => {return Number(item.miniCost) > Number(this.option.price)})
     }
   },
   mounted() {},

+ 11 - 6
hdApp/src/pagesPurchase/particulars.vue

@@ -5,10 +5,8 @@
       <view class="result-view">
         <view :class="['iconfont', 'iconchenggong']"></view>
         <view class="result-title">支付成功</view>
-        <view
-          class="close_btn"
-          @click="goClose"
-        >关闭</view>
+        <button class="admin-button-com blue big" @click="go_detail">订单详情</button>
+        <button class="admin-button-com big" @click="goClose">返回首页</button>
       </view>
     </view>
   </view>
@@ -19,9 +17,12 @@ export default {
   name: "AppResult",
   methods: {
     goClose () {
-      uni.reLaunch({ url: "/pagesPurchase/order", type: 2 });
+      this.pageTo({ url: "/admin/home/workbench", type: 3 });
+    },
+    go_detail() {
+      this.pageTo({url: '/pagesPurchase/purDetails?status=2&id=' + this.option.id, type: 2})
     }
-  }
+  },
 };
 </script>
 
@@ -70,5 +71,9 @@ export default {
       color: #666;
     }
   }
+  .admin-button-com {
+    margin-bottom: 20px;
+    width: 100%;
+  }
 }
 </style>

+ 4 - 10
hdApp/src/pagesPurchase/purDetails.vue

@@ -185,19 +185,10 @@ export default {
       detailInfo: {},
       loading: false,
       id: '',
-      status: ''
     };
   },
   onShow () {
 
-  },
-  onLoad (optoin) {
-    this.id = optoin.id
-    this.status = optoin.status
-    console.log(optoin)
-  },
-  mounted () {
-    this.initData()
   },
   methods: {
     copy (val) {
@@ -214,8 +205,11 @@ export default {
         phoneNumber: mobile
       });
     },
+    init() {
+      this.initData()
+    },
     async initData () {
-      const { data } = await purchaseDetail({ id: this.id });
+      const { data } = await purchaseDetail({ id: this.option.id });
       console.log('data==>', data)
       this.detailInfo = data;
     },

+ 17 - 10
hdApp/src/pagesPurchase/wechatPay.vue

@@ -50,6 +50,7 @@
       :type="_type"
       @closeKey="closeKeyFn"
     />
+    <alert-module>
       <div class="go-login-module">
         <div>请先设置支付密码!</div>
       </div>
@@ -78,7 +79,8 @@ export default {
       psdKey: '',
       orderSn: '',
       actPrice: '',
-      _type: '1'
+      _type: '1',
+      pageId: ''
     };
   },
   onLoad (options) {
@@ -104,8 +106,9 @@ export default {
             console.log(that.orderSn)
 						purchaseDebtPay({ orderSn: that.orderSn }).then(res => {
               console.log(res)
-              uni.navigateTo({
-                url: '/pagesPurchase/particulars'
+              that.pageTo({
+                url: '/pagesPurchase/particulars?id=' + res.data.id,
+                type: 2
               })
             }).catch(err => { console.log(err) })
 					}
@@ -122,13 +125,15 @@ export default {
     _wxPay () {
       let Fn = this.type === '1' ? purchaseClearWxPay({ orderSn: this.orderSn }) : this.type === '2' ? purchaseWxPay({ orderSn: this.orderSn }) : null
       Fn.then(res => {
-        console.log(res)
+        console.log(res, 128)
+        this.pageId = res.data.id
         wexinPay(res.data, this.getSuccess, this.getError)
       }).catch(err => { console.log(err) })
     },
     getSuccess () {
-      uni.navigateTo({
-        url: '/pagesPurchase/particulars'
+      this.pageTo({
+        url: '/pagesPurchase/particulars?id=' + this.pageId,
+        type: 2
       })
     },
     // 关闭键盘
@@ -149,8 +154,9 @@ export default {
           success: function (res) {
             if (res.confirm) {
               console.log('用户点击确定');
-              uni.navigateTo({
-                url: '/pagesPurchase/setPsd'
+              this.pageTo({
+                url: '/pagesPurchase/setPsd',
+                type: 2
               })
             } else if (res.cancel) {
               console.log('用户点击取消');
@@ -172,8 +178,9 @@ export default {
           password: this.psdKey
         }
         purchaseBalancePay(data).then(res => {
-          uni.navigateTo({
-            url: '/pagesPurchase/particulars'
+          this.pageTo({
+            url: '/pagesPurchase/particulars?id=' + res.data.id,
+            type: 2
           })
         }).catch(err => { console.log(err) })
       } else {