|
@@ -14,20 +14,28 @@
|
|
|
<span class="app-size-36 app-bold">¥{{ parseFloat(actPrice)}}</span>
|
|
<span class="app-size-36 app-bold">¥{{ parseFloat(actPrice)}}</span>
|
|
|
</view>
|
|
</view>
|
|
|
</block>
|
|
</block>
|
|
|
- <block>
|
|
|
|
|
|
|
+ <view v-if="isCashier">
|
|
|
<view class="balance">请出示付款码</view>
|
|
<view class="balance">请出示付款码</view>
|
|
|
<view class="call-one-btn">
|
|
<view class="call-one-btn">
|
|
|
<button class="button-com default" @click="checkResult()">查询支付结果</button>
|
|
<button class="button-com default" @click="checkResult()">查询支付结果</button>
|
|
|
- <!-- <view class="mobile-scan" @click="mobileScan()">手机扫码</view> -->
|
|
|
|
|
- <!-- <view class="mobile-scan" @click="handPay()">手动</view> -->
|
|
|
|
|
</view>
|
|
</view>
|
|
|
- </block>
|
|
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <view v-else>
|
|
|
|
|
+ <view style="text-align:center;margin:20upx auto 10upx auto;">
|
|
|
|
|
+ <view class="balance" style="margin-bottom:30upx;">扫二维码付款</view>
|
|
|
|
|
+ <view style="margin-bottom:20upx;">
|
|
|
|
|
+ <button @click="changePayWay(0)" class="admin-button-com mini-btn" :class="payWay == 0 ? 'blue' : 'default'">微信</button>
|
|
|
|
|
+ <button @click="changePayWay(1)" style="margin-left:20upx;" class="admin-button-com mini-btn" :class="payWay == 1 ? 'blue' : 'default'">支付宝</button>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <image mode="widthFix" style="width:400upx;margin:0 auto;" :src="payQrCodeUrl"></image>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </view>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
</template>
|
|
</template>
|
|
|
<script>
|
|
<script>
|
|
|
-import { codePayCheck} from "@/api/order/index";
|
|
|
|
|
|
|
+import { codePayCheck,scanPay} from "@/api/order/index";
|
|
|
export default {
|
|
export default {
|
|
|
name: "toPay",
|
|
name: "toPay",
|
|
|
components: {
|
|
components: {
|
|
@@ -38,7 +46,11 @@ export default {
|
|
|
return {
|
|
return {
|
|
|
orderId:0,
|
|
orderId:0,
|
|
|
actPrice:0,
|
|
actPrice:0,
|
|
|
- orderSn:''
|
|
|
|
|
|
|
+ orderSn:'',
|
|
|
|
|
+ showQrCode:false,
|
|
|
|
|
+ payQrCodeUrl:'',
|
|
|
|
|
+ payWay:0,
|
|
|
|
|
+ isCashier:true
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
mounted() {
|
|
mounted() {
|
|
@@ -48,6 +60,19 @@ export default {
|
|
|
uni.setStorageSync('globalCodePayId',option.orderId)
|
|
uni.setStorageSync('globalCodePayId',option.orderId)
|
|
|
this.actPrice = option.actPrice
|
|
this.actPrice = option.actPrice
|
|
|
this.orderSn = option.orderSn
|
|
this.orderSn = option.orderSn
|
|
|
|
|
+
|
|
|
|
|
+ // #ifdef MP-WEIXIN
|
|
|
|
|
+ this.isCashier = false
|
|
|
|
|
+ // #endif
|
|
|
|
|
+ // #ifdef APP-PLUS
|
|
|
|
|
+ if(plus.device.vendor != 'SUNMI'){
|
|
|
|
|
+ this.isCashier = false
|
|
|
|
|
+ }
|
|
|
|
|
+ // #endif
|
|
|
|
|
+ if(this.isCashier == false){
|
|
|
|
|
+ this.toScanPay()
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
},
|
|
},
|
|
|
onShow() {
|
|
onShow() {
|
|
|
},
|
|
},
|
|
@@ -55,6 +80,20 @@ export default {
|
|
|
uni.removeStorageSync('globalCodePayId')
|
|
uni.removeStorageSync('globalCodePayId')
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
|
|
+ changePayWay(payWay){
|
|
|
|
|
+ this.payWay = payWay
|
|
|
|
|
+ this.toScanPay()
|
|
|
|
|
+ },
|
|
|
|
|
+ toScanPay(){
|
|
|
|
|
+ let that = this
|
|
|
|
|
+ scanPay({id:this.orderId,payWay:this.payWay}).then(res=>{
|
|
|
|
|
+ if(res.code == 1){
|
|
|
|
|
+ let url = res.data.url || ''
|
|
|
|
|
+ that.payQrCodeUrl = url
|
|
|
|
|
+ that.showQrCode = true
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
checkResult(){
|
|
checkResult(){
|
|
|
let that = this
|
|
let that = this
|
|
|
uni.showLoading({title: '查询中',mask:true})
|
|
uni.showLoading({title: '查询中',mask:true})
|
|
@@ -157,6 +196,7 @@ export default {
|
|
|
}
|
|
}
|
|
|
.balance{
|
|
.balance{
|
|
|
margin-top:40upx;
|
|
margin-top:40upx;
|
|
|
- font-size:38upx;
|
|
|
|
|
|
|
+ font-size:36upx;
|
|
|
|
|
+ font-weight: bold;
|
|
|
}
|
|
}
|
|
|
</style>
|
|
</style>
|