فهرست منبع

完善微信支付

wangn 5 سال پیش
والد
کامیت
f15c3d70ac

+ 21 - 18
hdApp/src/admin/recharge/renew.vue

@@ -1,29 +1,32 @@
 <template>
 <template>
-	<div class="app-content">
-        免费续期
-	</div>
+  <div class="app-content">
+    免费续期
+  </div>
 </template>
 </template>
 
 
 <script>
 <script>
 export default {
 export default {
-	name: 'recharge-renew',
-	data() {
-		return {
-		}
-	},
-	onLoad() {
-	},
-	methods: {
-		init() {
-			this._getDet()
-		},
-		_getDet() {
+  name: 'recharge-renew',
+  data () {
+    return {
+    }
+  },
+  onLoad () {
+  },
+  methods: {
+    init () {
+      this._getDet()
+    },
+    _getDet () {
 
 
-		}
-	}
+    }
+  }
 }
 }
 </script>
 </script>
 
 
 <style lang="scss" scoped>
 <style lang="scss" scoped>
-
+.app-content {
+  width: 100vw;
+  height: 100vh;
+}
 </style>
 </style>

+ 8 - 1
hdApp/src/api/purchase/index.js

@@ -71,8 +71,15 @@ export const createPurchaseOrderApi = async data => {
 };
 };
 
 
 /** *
 /** *
- * 采购详情  
+ * 采购详情   /purchase/wx-pay
  */
  */
  export const purchaseDetail = async data => {
  export const purchaseDetail = async data => {
 	return https.get("/purchase/detail", data);
 	return https.get("/purchase/detail", data);
+};
+
+/** *
+ * 采购详情   
+ */
+ export const purchaseWxPay = async data => {
+	return https.post("/purchase/wx-pay", data);
 };
 };

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

@@ -35,21 +35,15 @@
                 class="btn_entrance"
                 class="btn_entrance"
                 v-if="Number(item.debtAmount) <= 0"
                 v-if="Number(item.debtAmount) <= 0"
                 @click="settleAccounts(item)"
                 @click="settleAccounts(item)"
-              >
-                结账
-              </view>
+              > 结账</view>
               <view
               <view
                 class="btn_entrance btn_forbid"
                 class="btn_entrance btn_forbid"
                 v-else
                 v-else
-              >
-                结账
-              </view>
+              > 结账</view>
               <view
               <view
                 class="btn_entrance"
                 class="btn_entrance"
                 @click="enter"
                 @click="enter"
-              >
-                进店
-              </view>
+              > 进店</view>
             </view>
             </view>
           </view>
           </view>
         </block>
         </block>
@@ -156,7 +150,7 @@ export default {
     gotoDetails (val) {
     gotoDetails (val) {
       console.log(val)
       console.log(val)
       uni.navigateTo({
       uni.navigateTo({
-        url: '/pagesPurchase/purDetails'
+        url: '/pagesPurchase/purDetails?status=' + val.status + '&id=' + val.id
       })
       })
     }
     }
   }
   }

+ 74 - 9
hdApp/src/pagesPurchase/purDetails.vue

@@ -43,6 +43,25 @@
           <view>进货日期:</view>
           <view>进货日期:</view>
           <view>{{ detailInfo.addTime }}</view>
           <view>{{ detailInfo.addTime }}</view>
         </view>
         </view>
+        <view class="order-info_box">
+          <view>状态:</view>
+          <view>{{ 
+						detailInfo.status==1?'待付款'
+						:detailInfo.status==2?'待配送'
+						:detailInfo.status==3?'配送中'
+						:detailInfo.status==4?'已签收'
+						:detailInfo.status==5?'已入库'
+						:detailInfo.status==6?'已取消'
+						:'已退款'
+						 }}</view>
+        </view>
+      </view>
+      <view
+        class="module-com content-box proInfo distribution"
+        v-if="detailInfo.sendProgress.title"
+      >
+        <text>配送进展</text>
+        <text class="evolve">{{detailInfo.sendProgress.title}}</text>
       </view>
       </view>
       <view class="module-com content-box proInfo">
       <view class="module-com content-box proInfo">
         <view class="commodity-view">
         <view class="commodity-view">
@@ -51,6 +70,7 @@
             <text
             <text
               class="editFlr"
               class="editFlr"
               @click="editFlr"
               @click="editFlr"
+              v-if="status === '1'"
             ><text class="iconfont icongouwuche"></text>修改花材</text>
             ><text class="iconfont icongouwuche"></text>修改花材</text>
           </view>
           </view>
           <view class="commodity-list">
           <view class="commodity-list">
@@ -128,18 +148,21 @@
         </div>
         </div>
       </view>
       </view>
     </view>
     </view>
-    <view class="footer_bar">
-      <view>延期付</view>
-      <view>支付</view>
+    <view
+      class="footer_bar"
+      v-if="status === '1'"
+    >
+      <view @click="postponePay">延期付</view>
+      <view @click="_weixinPay">支付</view>
     </view>
     </view>
   </view>
   </view>
 </template>
 </template>
 
 
 <script>
 <script>
 
 
-import { purchaseDetail } from "@/api/purchase/index";
+import { purchaseDetail, purchaseClearWxPay, purchaseDebtPay, purchaseWxPay } from "@/api/purchase/index";
 import TuiListCell from "@/components/plugin/list-cell";
 import TuiListCell from "@/components/plugin/list-cell";
-
+import wexinPay from "@/utils/pay/wxPay";
 export default {
 export default {
   name: "info",
   name: "info",
   components: {
   components: {
@@ -155,14 +178,17 @@ export default {
       },
       },
       detailInfo: {},
       detailInfo: {},
       loading: false,
       loading: false,
-      orderSn: ''
+      id: '',
+      status: ''
     };
     };
   },
   },
   onShow () {
   onShow () {
 
 
   },
   },
   onLoad (optoin) {
   onLoad (optoin) {
-    this.orderSn = optoin.id
+    this.id = optoin.id
+    this.status = optoin.status
+    console.log(optoin)
   },
   },
   mounted () {
   mounted () {
     this.initData()
     this.initData()
@@ -187,13 +213,32 @@ export default {
       // if (!orderSn) {
       // if (!orderSn) {
       //   return;
       //   return;
       // }
       // }
-      const { data } = await purchaseDetail({ id: this.orderSn });
+      const { data } = await purchaseDetail({ id: this.id });
       console.log('data==>', data)
       console.log('data==>', data)
       this.detailInfo = data;
       this.detailInfo = data;
     },
     },
     // 修改花材
     // 修改花材
     editFlr () {
     editFlr () {
 
 
+    },
+    _weixinPay () {
+      purchaseWxPay({ orderSn: this.detailInfo.orderSn }).then(res => {
+        console.log(res)
+        wexinPay(res.data, this.getSuccess, this.getError)
+      }).catch(err => { console.log(err) })
+    },
+    getError () {
+      this.$msg("支付失败!");
+    },
+    getSuccess () {
+      uni.navigateTo({
+        url: '/pagesPurchase/particulars'
+      })
+    },
+    postponePay () {
+      purchaseDebtPay({ orderSn: this.detailInfo.orderSn }).then(res => {
+        console.log(res)
+      }).catch(err => { console.log(err) })
     }
     }
   }
   }
 };
 };
@@ -451,7 +496,7 @@ export default {
     float: right;
     float: right;
     height: 70upx;
     height: 70upx;
     display: inline-block;
     display: inline-block;
-    padding: 0 40upx;
+    padding: 0 50upx;
     background: #3385ff;
     background: #3385ff;
     margin-right: 20upx;
     margin-right: 20upx;
     border-radius: 8px;
     border-radius: 8px;
@@ -461,4 +506,24 @@ export default {
     color: #fff;
     color: #fff;
   }
   }
 }
 }
+.distribution {
+  line-height: 80upx;
+  padding: 0 40upx 0 20upx;
+  display: flex;
+  justify-content: space-between;
+  .evolve {
+    position: relative;
+    &::after {
+      content: "";
+      position: absolute;
+      top: 50%;
+      right: -20upx;
+      transform: translateY(-50%) rotate(225deg);
+      width: 10upx;
+      height: 10upx;
+      border-left: 1px solid #ddd;
+      border-bottom: 1px solid #ddd;
+    }
+  }
+}
 </style>
 </style>

+ 4 - 4
hdApp/src/pagesPurchase/wechatPay.vue

@@ -66,7 +66,7 @@
 </template>
 </template>
 
 
 <script>
 <script>
-import { purchaseClearCreateOrder, purchaseClearWxPay, purchaseBalancePay, purchaseDebtPay } from "@/api/purchase/index";
+import { purchaseClearCreateOrder, purchaseClearWxPay, purchaseBalancePay, purchaseDebtPay, purchaseWxPay } from "@/api/purchase/index";
 import keyboardModule from './components/keyboard'
 import keyboardModule from './components/keyboard'
 import AlertModule from "@/components/plugin/alert";
 import AlertModule from "@/components/plugin/alert";
 import { mapGetters } from "vuex";
 import { mapGetters } from "vuex";
@@ -115,11 +115,11 @@ export default {
       }).catch(err => { console.log(err) })
       }).catch(err => { console.log(err) })
     },
     },
     _wxPay () {
     _wxPay () {
-      purchaseClearWxPay({ orderSn: this.orderSn }).then(res => {
+      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)
-        wexinPay(res.data, this.getSuccess)
+        wexinPay(res.data, this.getSuccess, this.getError)
       }).catch(err => { console.log(err) })
       }).catch(err => { console.log(err) })
-
     },
     },
     getSuccess () {
     getSuccess () {
       uni.navigateTo({
       uni.navigateTo({