Просмотр исходного кода

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	hdApp/src/pagesPurchase/order.vue
jf 5 лет назад
Родитель
Сommit
d7b041c36c

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

@@ -1,29 +1,83 @@
 <template>
-	<div class="app-content">
-        免费续期
-	</div>
+  <div class="app-content">
+    <div class="recharge_box">
+      <view class="renew">
+        续费3980/年<text class="toBuy">去购买</text>
+      </view>
+      <view class="voucher">
+        充值<text style="color: #FF3C00;"> 5980 元</text>,免费使用一年
+      </view>
+      <view class="immediately"></view>
+    </div>
+  </div>
 </template>
 
 <script>
 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>
 
 <style lang="scss" scoped>
-
+.app-content {
+  padding-top: 1px;
+  width: 100vw;
+  height: 100vh;
+  background: url(https://ss0.bdstatic.com/70cFuHSh_Q1YnxGkpoWK1HF6hhy/it/u=2687368603,3794114719&fm=26&gp=0.jpg);
+  background-size: 100% 100%;
+  position: relative;
+  .recharge_box {
+    position: absolute;
+    bottom: 8%;
+    left: 50%;
+    transform: translateX(-50%);
+    box-shadow: 0px 3px 13px 0px rgba(221, 0, 0, 0.36);
+    margin: 60% auto 0;
+    height: 617upx;
+    width: 640upx;
+    border-radius: 20px;
+    background: #fff;
+    & > .renew {
+      margin-top: 70upx;
+      text-align: center;
+      font-size: 28upx;
+      color: #333;
+      & > .toBuy {
+        color: #3385ff;
+        position: relative;
+        &::after {
+          position: absolute;
+          right: -15upx;
+          top: 50%;
+          content: "";
+          transform: translateY(-50%) rotate(225deg);
+          width: 10upx;
+          height: 10upx;
+          border-left: 1px solid #3385ff;
+          border-bottom: 1px solid #3385ff;
+        }
+      }
+    }
+    & > .voucher {
+      font-size: 32upx;
+      font-weight: 700;
+      margin-top: 70upx;
+      text-align: center;
+    }
+  }
+}
 </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 => {
 	return https.get("/purchase/detail", data);
+};
+
+/** *
+ * 采购详情   
+ */
+ export const purchaseWxPay = async data => {
+	return https.post("/purchase/wx-pay", data);
 };

+ 14 - 1
hdApp/src/pagesPurchase/order.vue

@@ -40,6 +40,19 @@
               <view class="btn_entrance" @click="enter(item)">
                 进店
               </view>
+              <view
+                class="btn_entrance"
+                v-if="Number(item.debtAmount) <= 0"
+                @click="settleAccounts(item)"
+              > 结账</view>
+              <view
+                class="btn_entrance btn_forbid"
+                v-else
+              > 结账</view>
+              <view
+                class="btn_entrance"
+                @click="enter"
+              > 进店</view>
             </view>
           </view>
         </block>
@@ -146,7 +159,7 @@ export default {
     gotoDetails (val) {
       console.log(val)
       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>{{ detailInfo.addTime }}</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 class="module-com content-box proInfo">
         <view class="commodity-view">
@@ -51,6 +70,7 @@
             <text
               class="editFlr"
               @click="editFlr"
+              v-if="status === '1'"
             ><text class="iconfont icongouwuche"></text>修改花材</text>
           </view>
           <view class="commodity-list">
@@ -128,18 +148,21 @@
         </div>
       </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>
 </template>
 
 <script>
 
-import { purchaseDetail } from "@/api/purchase/index";
+import { purchaseDetail, purchaseClearWxPay, purchaseDebtPay, purchaseWxPay } from "@/api/purchase/index";
 import TuiListCell from "@/components/plugin/list-cell";
-
+import wexinPay from "@/utils/pay/wxPay";
 export default {
   name: "info",
   components: {
@@ -155,14 +178,17 @@ export default {
       },
       detailInfo: {},
       loading: false,
-      orderSn: ''
+      id: '',
+      status: ''
     };
   },
   onShow () {
 
   },
   onLoad (optoin) {
-    this.orderSn = optoin.id
+    this.id = optoin.id
+    this.status = optoin.status
+    console.log(optoin)
   },
   mounted () {
     this.initData()
@@ -187,13 +213,32 @@ export default {
       // if (!orderSn) {
       //   return;
       // }
-      const { data } = await purchaseDetail({ id: this.orderSn });
+      const { data } = await purchaseDetail({ id: this.id });
       console.log('data==>', data)
       this.detailInfo = data;
     },
     // 修改花材
     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;
     height: 70upx;
     display: inline-block;
-    padding: 0 40upx;
+    padding: 0 50upx;
     background: #3385ff;
     margin-right: 20upx;
     border-radius: 8px;
@@ -461,4 +506,24 @@ export default {
     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>

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

@@ -66,7 +66,7 @@
 </template>
 
 <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 AlertModule from "@/components/plugin/alert";
 import { mapGetters } from "vuex";
@@ -115,11 +115,11 @@ export default {
       }).catch(err => { console.log(err) })
     },
     _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)
-        wexinPay(res.data, this.getSuccess)
+        wexinPay(res.data, this.getSuccess, this.getError)
       }).catch(err => { console.log(err) })
-
     },
     getSuccess () {
       uni.navigateTo({