|
@@ -30,46 +30,26 @@
|
|
<view class="row"><text>备注:</text>{{ detail.remark }}</view>
|
|
<view class="row"><text>备注:</text>{{ detail.remark }}</view>
|
|
<view class="row"><text>操作人:</text>{{ detail.workerName }}</view>
|
|
<view class="row"><text>操作人:</text>{{ detail.workerName }}</view>
|
|
</view>
|
|
</view>
|
|
-
|
|
|
|
- <!-- <view class="pay-container card mt30">
|
|
|
|
- <view class="top">请选择客户支付方式</view>
|
|
|
|
- <view class="item" @tap="payType = 1">
|
|
|
|
- <view class="left">
|
|
|
|
- <text class="iconfont icon-weixinzhifu" style="color: #43c93e"></text>
|
|
|
|
- <text class="text">微信支付</text>
|
|
|
|
- </view>
|
|
|
|
- <view class="right">
|
|
|
|
- <text class="iconfont" :class="payType === 1 ? 'icon-danxuan2 active' : 'icon-danxuan'"></text>
|
|
|
|
- </view>
|
|
|
|
- </view>
|
|
|
|
- <view class="item" @tap="payType = 2">
|
|
|
|
- <view class="left">
|
|
|
|
- <text class="iconfont icon-xianxiazhifu" style="color: #0379ff"></text>
|
|
|
|
- <text class="text">线下支付</text>
|
|
|
|
- </view>
|
|
|
|
- <view class="right">
|
|
|
|
- <text class="iconfont" :class="payType === 2 ? 'icon-danxuan2 active' : 'icon-danxuan'"></text>
|
|
|
|
- </view>
|
|
|
|
- </view>
|
|
|
|
- </view> -->
|
|
|
|
</view>
|
|
</view>
|
|
|
|
|
|
<template slot="footer">
|
|
<template slot="footer">
|
|
<view class="footer-btn-group">
|
|
<view class="footer-btn-group">
|
|
<u-button text="取消订单" @click="cancelOrder"></u-button>
|
|
<u-button text="取消订单" @click="cancelOrder"></u-button>
|
|
<u-button text="扫码支付" type="primary" @click="scanCode"></u-button>
|
|
<u-button text="扫码支付" type="primary" @click="scanCode"></u-button>
|
|
- <!-- <u-button text="扫码支付" type="primary" @click="scanCode" v-if="payType === 1"></u-button> -->
|
|
|
|
- <!-- <u-button text="确定支付" type="primary" @click="confirmPay" v-else></u-button> -->
|
|
|
|
</view>
|
|
</view>
|
|
</template>
|
|
</template>
|
|
</zj-page-layout>
|
|
</zj-page-layout>
|
|
|
|
+ <zhifutanchuan v-if="state > 0" :detail="detail" :orderId="orderId" :state="state" @scan="scan" @back="back" />
|
|
</view>
|
|
</view>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
import { wxScanCode } from '@/common/utils/util.js'
|
|
import { wxScanCode } from '@/common/utils/util.js'
|
|
-
|
|
|
|
|
|
+import zhifutanchuan from '@/components/zhifutanchuan.vue'
|
|
export default {
|
|
export default {
|
|
|
|
+ components: {
|
|
|
|
+ zhifutanchuan
|
|
|
|
+ },
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
orderId: null,
|
|
orderId: null,
|
|
@@ -81,8 +61,8 @@ export default {
|
|
canScanCode: 0,
|
|
canScanCode: 0,
|
|
timeout: null,
|
|
timeout: null,
|
|
timeoutNum: 0,
|
|
timeoutNum: 0,
|
|
-
|
|
|
|
- payType: 1
|
|
|
|
|
|
+ payType: 1,
|
|
|
|
+ state: 0
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
|
|
@@ -90,17 +70,35 @@ export default {
|
|
this.orderId = handleOrderId
|
|
this.orderId = handleOrderId
|
|
this.wbId = wbId
|
|
this.wbId = wbId
|
|
this.getDetail()
|
|
this.getDetail()
|
|
-
|
|
|
|
this.crossPage.$on('reScanCode', () => {
|
|
this.crossPage.$on('reScanCode', () => {
|
|
this.scanCode()
|
|
this.scanCode()
|
|
})
|
|
})
|
|
},
|
|
},
|
|
|
|
|
|
onUnload() {
|
|
onUnload() {
|
|
- clearTimeout(this.timeout)
|
|
|
|
|
|
+ if (this.timeout) {
|
|
|
|
+ clearTimeout(this.timeout)
|
|
|
|
+ }
|
|
},
|
|
},
|
|
|
|
|
|
methods: {
|
|
methods: {
|
|
|
|
+ scan() {
|
|
|
|
+ if (this.timeout) {
|
|
|
|
+ clearTimeout(this.timeout)
|
|
|
|
+ }
|
|
|
|
+ this.scanCode()
|
|
|
|
+ },
|
|
|
|
+ back() {
|
|
|
|
+ if (this.timeout) {
|
|
|
|
+ clearTimeout(this.timeout)
|
|
|
|
+ }
|
|
|
|
+ this.$navToPage(
|
|
|
|
+ {
|
|
|
|
+ url: `/packageMaterial/pages/index?type=M`
|
|
|
|
+ },
|
|
|
|
+ 'reLaunch'
|
|
|
|
+ )
|
|
|
|
+ },
|
|
getDetail() {
|
|
getDetail() {
|
|
let url = '',
|
|
let url = '',
|
|
params = {}
|
|
params = {}
|
|
@@ -171,45 +169,23 @@ export default {
|
|
payType: 'WECHAT'
|
|
payType: 'WECHAT'
|
|
})
|
|
})
|
|
.then(res => {
|
|
.then(res => {
|
|
|
|
+ if (this.state == 0) {
|
|
|
|
+ this.state = 1
|
|
|
|
+ }
|
|
// 返回true,则支付成功
|
|
// 返回true,则支付成功
|
|
if (res.data) {
|
|
if (res.data) {
|
|
- this.timeoutNum = 0
|
|
|
|
- clearTimeout(this.timeout)
|
|
|
|
- this.$navToPage({
|
|
|
|
- url: `/packageMaterial/pages/sale/result?handleOrderId=${this.orderId}&result=1&wbId=${this.wbId || ''}`
|
|
|
|
- })
|
|
|
|
|
|
+ this.state = 2
|
|
}
|
|
}
|
|
// 返回false,轮询3次
|
|
// 返回false,轮询3次
|
|
else {
|
|
else {
|
|
- if (this.timeoutNum < 4) {
|
|
|
|
- this.timeoutNum = this.timeoutNum + 1
|
|
|
|
- this.timeout = setTimeout(() => {
|
|
|
|
- this.submitData(code)
|
|
|
|
- }, 1000)
|
|
|
|
- } else {
|
|
|
|
- this.timeoutNum = 0
|
|
|
|
- clearTimeout(this.timeout)
|
|
|
|
- this.$navToPage({
|
|
|
|
- url: `/packageMaterial/pages/sale/result?handleOrderId=${this.orderId}&result=0&wbId=${this.wbId || ''}`
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
|
|
+ this.timeout = setTimeout(() => {
|
|
|
|
+ this.submitData(code)
|
|
|
|
+ }, 1000)
|
|
}
|
|
}
|
|
})
|
|
})
|
|
.catch(res => {
|
|
.catch(res => {
|
|
- this.timeoutNum = 0
|
|
|
|
- clearTimeout(this.timeout)
|
|
|
|
this.$tips(res.message)
|
|
this.$tips(res.message)
|
|
})
|
|
})
|
|
- .finally(() => {
|
|
|
|
- this.canScanCode = 15
|
|
|
|
- let time = setInterval(() => {
|
|
|
|
- if (this.canScanCode > 0) {
|
|
|
|
- this.canScanCode = this.canScanCode - 1
|
|
|
|
- } else {
|
|
|
|
- clearInterval(time)
|
|
|
|
- }
|
|
|
|
- }, 1000)
|
|
|
|
- })
|
|
|
|
},
|
|
},
|
|
|
|
|
|
confirmPay() {
|
|
confirmPay() {
|