|
@@ -6,11 +6,13 @@
|
|
|
<view style="margin-top:20upx;font-weight:bold;font-size:35upx;color:black;">¥{{price}}</view>
|
|
<view style="margin-top:20upx;font-weight:bold;font-size:35upx;color:black;">¥{{price}}</view>
|
|
|
<view class="show-code" v-if="goPay == 0">请出示付款码</view>
|
|
<view class="show-code" v-if="goPay == 0">请出示付款码</view>
|
|
|
<view class="paying" v-if="goPay == 1">请求中</view>
|
|
<view class="paying" v-if="goPay == 1">请求中</view>
|
|
|
- <view style="font-size:19upx;margin:55upx auto 10upx auto;color:red;font-weight:bold;" v-if="goPay == 2">
|
|
|
|
|
|
|
+ <view style="font-size:18upx;margin:45upx auto 10upx auto;color:red;font-weight:bold;" v-if="goPay == 2">
|
|
|
{{ remindText }}
|
|
{{ remindText }}
|
|
|
- <text v-if="returnCode=='BBS11105' || returnCode=='BBS10000'" style="margin-left:10upx;color:green;" @click="checkPay">查询结果</text>
|
|
|
|
|
|
|
+ <text v-if="returnCode=='BBS11105' || returnCode=='BBS10000'" style="margin-left:10upx;color:green;border:1upx solid green;border-radius: 8upx;padding:6upx;font-size:18upx;" @click="checkOrder">
|
|
|
|
|
+ 查询结果
|
|
|
|
|
+ </text>
|
|
|
</view>
|
|
</view>
|
|
|
- <image style="width:40upx;height:40upx;position:absolute;top:200upx;left:165upx;" :src="`${constant.imgUrl}/icon/loading.gif`" v-if="goPay == 1" mode="scaleToFill" />
|
|
|
|
|
|
|
+ <image style="width:40upx;height:40upx;position:absolute;top:190upx;left:205upx;" :src="`${constant.imgUrl}/icon/loading.gif`" v-if="goPay == 1" mode="scaleToFill" />
|
|
|
<view style="margin-top:30upx;">
|
|
<view style="margin-top:30upx;">
|
|
|
<view @click="cancelPayFn" class="btn-default">取消</view>
|
|
<view @click="cancelPayFn" class="btn-default">取消</view>
|
|
|
<view @click="reScan()" style="margin-left:20upx;background-color:#1c7b20;color:white;width:150upx;" class="btn-default">重新出示付款码</view>
|
|
<view @click="reScan()" style="margin-left:20upx;background-color:#1c7b20;color:white;width:150upx;" class="btn-default">重新出示付款码</view>
|
|
@@ -25,18 +27,20 @@
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
|
|
|
|
|
- <uni-popup ref="cancelPayRef" type="dialog">
|
|
|
|
|
- <uni-popup-dialog type="info" cancelText="取消" confirmText="已提醒" title="提示" content="请提醒客户取消支付" @confirm="affirmCancel"></uni-popup-dialog>
|
|
|
|
|
- </uni-popup>
|
|
|
|
|
-
|
|
|
|
|
<uni-popup ref="cancelPaymentRef" type="dialog">
|
|
<uni-popup ref="cancelPaymentRef" type="dialog">
|
|
|
- <uni-popup-dialog type="info" cancelText="取消" confirmText="确认" title="提示" content="确认客户已取消支付???" @confirm="confirmToCancel"></uni-popup-dialog>
|
|
|
|
|
|
|
+ <view style="width:60vw;height:70vh;background-color: white;padding:70upx 20upx 0 20upx;">
|
|
|
|
|
+ <view style="margin-bottom:40upx;text-align: center;">{{ cancelText }}</view>
|
|
|
|
|
+ <view style="text-align:center;">
|
|
|
|
|
+ <button class="admin-button-com mini-btn default" @click="returnCancel">返回</button>
|
|
|
|
|
+ <button class="admin-button-com mini-btn" @click="confirmToCancel" style="margin-left:30upx;">确认取消</button>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </view>
|
|
|
</uni-popup>
|
|
</uni-popup>
|
|
|
|
|
|
|
|
</view>
|
|
</view>
|
|
|
</template>
|
|
</template>
|
|
|
<script>
|
|
<script>
|
|
|
-import { codePay,codePayCheck,cancelOrderFn} from "@/api/order";
|
|
|
|
|
|
|
+import { codePay,codePayCheck,cancelOrderFn,getDetail} from "@/api/order";
|
|
|
export default {
|
|
export default {
|
|
|
name:'toPayWay',
|
|
name:'toPayWay',
|
|
|
components:{
|
|
components:{
|
|
@@ -47,7 +51,8 @@ export default {
|
|
|
T:null,
|
|
T:null,
|
|
|
goPay:0,
|
|
goPay:0,
|
|
|
remindText:'',
|
|
remindText:'',
|
|
|
- returnCode:''
|
|
|
|
|
|
|
+ returnCode:'',
|
|
|
|
|
+ cancelText:'确认要取消?'
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
props: {
|
|
props: {
|
|
@@ -81,24 +86,23 @@ export default {
|
|
|
reScan(){
|
|
reScan(){
|
|
|
this.remindText = ''
|
|
this.remindText = ''
|
|
|
this.goPay = 0
|
|
this.goPay = 0
|
|
|
|
|
+ this.returnCode = ''
|
|
|
},
|
|
},
|
|
|
- //查询付款结果
|
|
|
|
|
- checkPay(){
|
|
|
|
|
|
|
+ checkOrder(){
|
|
|
let that = this
|
|
let that = this
|
|
|
- codePayCheck({id:this.orderId}).then(res=>{
|
|
|
|
|
|
|
+ getDetail({id:this.orderId}).then(res=>{
|
|
|
if(res.code == 1){
|
|
if(res.code == 1){
|
|
|
- if(res.data.returnStatus == 'SUCCESS'){
|
|
|
|
|
- uni.hideLoading()
|
|
|
|
|
|
|
+ if(res.data.payStatus == 1){
|
|
|
that.showSuccess = true
|
|
that.showSuccess = true
|
|
|
setTimeout(function(){
|
|
setTimeout(function(){
|
|
|
that.payFinish()
|
|
that.payFinish()
|
|
|
- },1500)
|
|
|
|
|
- return
|
|
|
|
|
|
|
+ },1000)
|
|
|
|
|
+ }else{
|
|
|
|
|
+ this.$msg('还没有付款成功')
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
- //付款
|
|
|
|
|
requestCodePay(authCode){
|
|
requestCodePay(authCode){
|
|
|
let that = this
|
|
let that = this
|
|
|
this.goPay = 1
|
|
this.goPay = 1
|
|
@@ -113,14 +117,7 @@ export default {
|
|
|
that.remindText = res.msg
|
|
that.remindText = res.msg
|
|
|
that.goPay = 2
|
|
that.goPay = 2
|
|
|
that.returnCode = res.data.returnCode ? res.data.returnCode : ''
|
|
that.returnCode = res.data.returnCode ? res.data.returnCode : ''
|
|
|
- // that.T = setInterval(function(){
|
|
|
|
|
- // that.checkPay()
|
|
|
|
|
- // }, 1000)
|
|
|
|
|
}
|
|
}
|
|
|
- }else{
|
|
|
|
|
- // that.T = setInterval(function(){
|
|
|
|
|
- // that.checkPay()
|
|
|
|
|
- // }, 1000)
|
|
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
@@ -128,32 +125,21 @@ export default {
|
|
|
this.$emit('payFinish')
|
|
this.$emit('payFinish')
|
|
|
},
|
|
},
|
|
|
cancelPayFn(){
|
|
cancelPayFn(){
|
|
|
- let that = this
|
|
|
|
|
- that.$refs.cancelPayRef.open('center')
|
|
|
|
|
|
|
+ if(this.returnCode=='BBS11105' || this.returnCode=='BBS10000'){
|
|
|
|
|
+ this.cancelText = '客户正在付款,提醒客户退出付款界面,再点确认取消'
|
|
|
|
|
+ }
|
|
|
|
|
+ this.$refs.cancelPaymentRef.open('center')
|
|
|
},
|
|
},
|
|
|
- affirmCancel(){
|
|
|
|
|
- let that = this
|
|
|
|
|
- that.$refs.cancelPaymentRef.open('center')
|
|
|
|
|
|
|
+ returnCancel(){
|
|
|
|
|
+ this.$refs.cancelPaymentRef.close()
|
|
|
},
|
|
},
|
|
|
confirmToCancel(){
|
|
confirmToCancel(){
|
|
|
let that = this
|
|
let that = this
|
|
|
- codePayCheck({id:this.orderId}).then(res=>{
|
|
|
|
|
|
|
+ cancelOrderFn({id:this.orderId}).then(res=>{
|
|
|
if(res.code == 1){
|
|
if(res.code == 1){
|
|
|
- if(res.data.returnStatus == 'SUCCESS'){
|
|
|
|
|
- uni.hideLoading()
|
|
|
|
|
- that.showSuccess = true
|
|
|
|
|
- setTimeout(function(){
|
|
|
|
|
- that.payFinish()
|
|
|
|
|
- },1500)
|
|
|
|
|
- return
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ that.$msg('已取消')
|
|
|
|
|
+ that.$emit('cancelPay')
|
|
|
}
|
|
}
|
|
|
- cancelOrderFn({id:this.orderId}).then(res=>{
|
|
|
|
|
- if(res.code == 1){
|
|
|
|
|
- that.$msg('已取消')
|
|
|
|
|
- }
|
|
|
|
|
- })
|
|
|
|
|
- that.$emit('cancelPay')
|
|
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -170,7 +156,7 @@ export default {
|
|
|
height: 99vh;
|
|
height: 99vh;
|
|
|
flex-direction: column;
|
|
flex-direction: column;
|
|
|
box-sizing: border-box;
|
|
box-sizing: border-box;
|
|
|
- width:50vw;
|
|
|
|
|
|
|
+ width:60vw;
|
|
|
& .price-box {
|
|
& .price-box {
|
|
|
min-height: 100upx;
|
|
min-height: 100upx;
|
|
|
& > .title {
|
|
& > .title {
|
|
@@ -202,12 +188,12 @@ export default {
|
|
|
}
|
|
}
|
|
|
& .show-code{
|
|
& .show-code{
|
|
|
font-size: 19upx;
|
|
font-size: 19upx;
|
|
|
- margin: 55upx 0 10upx 0;
|
|
|
|
|
|
|
+ margin: 45upx 0 10upx 0;
|
|
|
font-weight:bold;
|
|
font-weight:bold;
|
|
|
}
|
|
}
|
|
|
& .paying{
|
|
& .paying{
|
|
|
font-size: 19upx;
|
|
font-size: 19upx;
|
|
|
- margin: 55upx 0 10upx 0;
|
|
|
|
|
|
|
+ margin: 45upx 0 10upx 0;
|
|
|
font-weight:bold;
|
|
font-weight:bold;
|
|
|
}
|
|
}
|
|
|
& .btn-default {
|
|
& .btn-default {
|