shish 4 лет назад
Родитель
Сommit
6906d971db

+ 1 - 1
ghsApp/src/admin/home/components/OrderItem.vue

@@ -2,7 +2,7 @@
     <view  @click="pageTo({url:'/pagesOrder/detail',query: {id: item.id}})">
     <view  @click="pageTo({url:'/pagesOrder/detail',query: {id: item.id}})">
         <view class="order-top_box" style="position:relative;">
         <view class="order-top_box" style="position:relative;">
 
 
-        <image style="width:105upx;position:absolute;top:80upx;right:12upx;" v-if="item.status == 1 && isScanEnv"
+        <image style="width:105upx;position:absolute;top:80upx;right:12upx;" v-if="item.status == 1"
         @click.stop="pageTo({url:'/admin/billing/toPay',query: {orderId:item.id,orderSn:item.orderSn,actPrice:item.actPrice}})"
         @click.stop="pageTo({url:'/admin/billing/toPay',query: {orderId:item.id,orderSn:item.orderSn,actPrice:item.actPrice}})"
          mode="widthFix" :src="`${constant.imgUrl}/icon/codePay8.png`"></image>
          mode="widthFix" :src="`${constant.imgUrl}/icon/codePay8.png`"></image>
 
 

+ 4 - 0
hdApp/src/api/purchase/index.js

@@ -1,5 +1,9 @@
 import https from "@/plugins/luch-request_0.0.7/request";
 import https from "@/plugins/luch-request_0.0.7/request";
 
 
+export const getDetail = data => {
+	return https.get("/purchase/detail", data);
+};
+
 /** *
 /** *
  * 采购订单详情
  * 采购订单详情
  */
  */

+ 3 - 8
hdApp/src/pagesPurchase/shopping.vue

@@ -3,7 +3,7 @@
     <app-tabs :tabs="tabs" :isFixed="true" :currentTab="tabIndex" @change="change" itemWidth="20%"/>
     <app-tabs :tabs="tabs" :isFixed="true" :currentTab="tabIndex" @change="change" itemWidth="20%"/>
     <view class="pay_list">
     <view class="pay_list">
       <block v-if="!$util.isEmpty(list.data)">
       <block v-if="!$util.isEmpty(list.data)">
-        <OrderItem v-for="(item, index) in list.data" :key="index" :info="item" @click="gotoDetails"></OrderItem>
+        <OrderItem v-for="(item, index) in list.data" :key="index" :info="item" @click="goToDetail"></OrderItem>
       </block>
       </block>
       <block v-else>
       <block v-else>
         <AppWrapperEmpty title="暂无数据" :is-empty="$util.isEmpty(list.data)"/>
         <AppWrapperEmpty title="暂无数据" :is-empty="$util.isEmpty(list.data)"/>
@@ -105,14 +105,9 @@ export default {
         this.tabs[4].value = res.data.shop.cgFinish // 已完成
         this.tabs[4].value = res.data.shop.cgFinish // 已完成
       })
       })
     },
     },
-    // 采购记录详情
-    gotoDetails (val) {
-      console.log(val)
-      uni.navigateTo({
-        url: '/pagesPurchase/purDetails?status=' + val.status + '&id=' + val.id
-      })
+    goToDetail (val) {
+      uni.navigateTo({ url: '/pagesPurchase/purDetails?id=' + val.id })
     },
     },
-    // 去往采购页面
     addEvent() {
     addEvent() {
       uni.navigateTo({url: '/pagesPurchase/order'})
       uni.navigateTo({url: '/pagesPurchase/order'})
     }
     }

+ 23 - 27
hdApp/src/pagesPurchase/wechatPay.vue

@@ -15,30 +15,22 @@
             <span class="app-size-36 app-bold">{{ realPrice || '0.00'}}</span>
             <span class="app-size-36 app-bold">{{ realPrice || '0.00'}}</span>
           </div>
           </div>
           <div class="order-num app-color-3">订单号: {{ orderSn || ''}}</div>
           <div class="order-num app-color-3">订单号: {{ orderSn || ''}}</div>
-          <div v-if="count > 0" class="order-num app-color-3" style="margin-top:18upx;font-size:26upx;"><span style="font-weight:bold;padding-right:8upx;">{{count}}</span>秒后失效</div>
+          <div v-if="remainPayTime > 0" class="order-num app-color-3" style="margin-top:18upx;font-size:26upx;"><span style="font-weight:bold;padding-right:8upx;">{{remainPayTime}}</span>秒后失效</div>
           <div v-else class="order-num app-color-3" style="margin-top:12upx;font-size:26upx;">订单已失效</div>
           <div v-else class="order-num app-color-3" style="margin-top:12upx;font-size:26upx;">订单已失效</div>
         </block>
         </block>
         <block>
         <block>
-          <!-- <view class="balance">余额:¥{{balance}}</view> -->
           <div class="call-one-btn">
           <div class="call-one-btn">
-
             <view v-if="Number(balance) >= Number(realPrice)">
             <view v-if="Number(balance) >= Number(realPrice)">
-              <!-- <button class="button-com pay-wx" :class="[count >0 ? 'green':'default']" :disabled="count >0 ? false : true" v-if="Number(balance) >0" @click="balancePay">余额支付</button> -->
-              <button class="button-com pay-wx" :class="[count >0 ? 'green':'default']" :disabled="count >0 ? false : true" @click="_wxPay">微信支付</button>
+              <button class="button-com pay-wx" :class="[remainPayTime >0 ? 'green':'default']" :disabled="remainPayTime >0 ? false : true" @click="wxPayFn">微信支付</button>
             </view>
             </view>
             <view v-else>
             <view v-else>
-              <button class="button-com pay-wx" :class="[count >0 ? 'green':'default']" :disabled="count >0 ? false : true" @click="_wxPay">微信支付</button>
-              <!-- <button class="button-com pay-wx" :class="[count >0 ? 'green':'default']" :disabled="count >0 ? false : true" v-if="Number(balance) >0" @click="balancePay">余额支付</button> -->
+              <button class="button-com pay-wx" :class="[remainPayTime >0 ? 'green':'default']" :disabled="remainPayTime >0 ? false : true" @click="wxPayFn">微信支付</button>
             </view>
             </view>
-
-            <button class="button-com pay-wx" :class="[count >0 ? 'green':'default']" :disabled="count >0 ? false : true" @click="debtPay" v-if="hasDebtPay === '1'">记欠款</button>
-
+            <button class="button-com pay-wx" :class="[remainPayTime >0 ? 'green':'default']" :disabled="remainPayTime >0 ? false : true" @click="debtPay" v-if="hasDebtPay === '1'">记欠款</button>
           </div>
           </div>
-
         </block>
         </block>
       </div>
       </div>
     </div>
     </div>
-    <!-- 键盘 -->
     <keyboard-module :show="keyShow" @comfirm="hideKeyFn" @clickKey="clickKeyFn" :psdShow="true" :type="_type" @closeKey="closeKeyFn" />
     <keyboard-module :show="keyShow" @comfirm="hideKeyFn" @clickKey="clickKeyFn" :psdShow="true" :type="_type" @closeKey="closeKeyFn" />
     <alert-module>
     <alert-module>
       <div class="go-login-module">
       <div class="go-login-module">
@@ -49,7 +41,7 @@
 </template>
 </template>
 
 
 <script>
 <script>
-import { purchaseBalancePay, purchaseDebtPay, purchaseWxPay } from "@/api/purchase/index";
+import { purchaseBalancePay, purchaseDebtPay, purchaseWxPay,getDetail } from "@/api/purchase";
 import { getCgPayWay } from "@/api/shop/index";
 import { getCgPayWay } from "@/api/shop/index";
 import keyboardModule from './components/keyboard'
 import keyboardModule from './components/keyboard'
 import { mapGetters } from "vuex";
 import { mapGetters } from "vuex";
@@ -72,16 +64,13 @@ export default {
       realPrice: '',
       realPrice: '',
       _type: '1',
       _type: '1',
       pageId: '',
       pageId: '',
-      count:120,
+      remainPayTime:120,
       hasDebtPay:0,
       hasDebtPay:0,
       balance:0
       balance:0
     };
     };
   },
   },
   onLoad (options) {
   onLoad (options) {
     this.id = options.id
     this.id = options.id
-    this.orderSn = options.orderSn;
-    this.realPrice = options.realPrice;
-
   },
   },
   computed: {
   computed: {
     ...mapGetters(["getLoginInfo", 'getDictionariesInfo']),
     ...mapGetters(["getLoginInfo", 'getDictionariesInfo']),
@@ -91,22 +80,29 @@ export default {
   methods: {
   methods: {
     init(){
     init(){
       let that = this
       let that = this
-      getCgPayWay({id:this.option.id}).then(res=>{
+
+      getDetail({id:this.option.id}).then(res=>{
         if(res.code == 1){
         if(res.code == 1){
+          this.realPrice = res.data.realPrice ? parseFloat(res.data.realPrice) : ''
+          this.orderSn = res.data.orderSn
+
           that.hasDebtPay = res.data.hasDebtPay
           that.hasDebtPay = res.data.hasDebtPay
           that.balance = res.data.balance
           that.balance = res.data.balance
-          that.count = res.data.count
 
 
-          let t =setInterval(function(){
-            if(that.count > 0){
-              that.count--
-            }else{
-              clearInterval(t);
-            }
-          },1000);
+          that.remainPayTime = res.data.remainPayTime
+          if(that.remainPayTime > 0){
+            let t =setInterval(function(){
+              if(that.remainPayTime > 0){
+                that.remainPayTime--
+              }else{
+                clearInterval(t);
+              }
+            },1000);
+          }
 
 
         }
         }
       })
       })
+
     },
     },
     debtPay () {
     debtPay () {
       let that = this
       let that = this
@@ -135,7 +131,7 @@ export default {
 			});
 			});
       
       
     },
     },
-    _wxPay () {
+    wxPayFn () {
       uni.showLoading({title: '加载中',mask:true})
       uni.showLoading({title: '加载中',mask:true})
       purchaseWxPay({ orderSn: this.orderSn }).then(res => {
       purchaseWxPay({ orderSn: this.orderSn }).then(res => {
         uni.hideLoading()
         uni.hideLoading()