Răsfoiți Sursa

收银台付款

shish 4 ani în urmă
părinte
comite
dd6b1789dd

+ 1 - 1
hdPad/src/pages/home/components/console.vue

@@ -1,7 +1,7 @@
 <template>
 <view class="button-area">
 	<view class="active" @click="calcFn">{{calc == 'add' ? '+' : '-'}}</view>
-	<view class="active" @click="resetCustomer">选客</view>
+	<!-- <view class="active" @click="resetCustomer">选客</view> -->
 	<view class="active" @click="gatheringFn()">收款</view>
 	<view class="active" @click="changeProperty">{{property==1 ? '花材' : '成品'}}</view>
 	<view class="active" @click="goSettleCommit">结算 </view>

+ 25 - 2
hdPad/src/pages/home/components/toPay.vue

@@ -5,7 +5,7 @@
                 <image class="img" :src="`${constant.imgUrl}/icon/scan/scan.png`" mode="scaleToFill" />
                 <view class="show-code">请出示付款码</view>
                 <view class="btn-default result" @click="checkPay()">查询结果</view>
-                <view @click="cancelPay" class="btn-default result">取消</view>
+                <view @click="cancelPayFn" class="btn-default result">取消</view>
             </view>
         </view>
         <view v-else>
@@ -17,6 +17,11 @@
 			</view>
 
         </view>
+
+        <uni-popup ref="cancelPayRef" type="dialog">
+            <uni-popup-dialog type="info" cancelText="取消" confirmText="确认" title="提示" content="确认取消?" @confirm="confirmToCancel"></uni-popup-dialog>
+        </uni-popup>
+
     </view>
 </template>
 <script>
@@ -81,7 +86,25 @@ export default {
         payFinish(){
             this.$emit('payFinish')
         },
-        cancelPay(){
+        cancelPayFn(){
+            let that = this
+            uni.showLoading({title: '确认中',mask:true})
+            codePayCheck({id:this.orderId}).then(res=>{
+                uni.hideLoading()
+                console.log(res)
+                if(res.code == 1){
+                    if(res.data.returnStatus == 'SUCCESS'){
+                        that.showSuccess = true
+                        setTimeout(function(){
+                            that.payFinish()
+                        },1500)
+                    }else{
+                        that.$refs.cancelPayRef.open('center')
+                    }
+                }
+            })
+        },
+        confirmToCancel(){
             this.$emit('cancelPay')
         }
     },