|
@@ -1,23 +1,43 @@
|
|
|
<template>
|
|
<template>
|
|
|
- <view class="check-panel flex-direction">
|
|
|
|
|
- <image :src="shopDetail.cover" class="buyer-logo"></image>
|
|
|
|
|
- <view class="title center">{{shopDetail.name}}</view>
|
|
|
|
|
- <view class="input-content">
|
|
|
|
|
- <view class="tips">交易金额</view>
|
|
|
|
|
- <view class="input-bar center" @tap="show=true">
|
|
|
|
|
- <view class="icon center">¥</view>
|
|
|
|
|
- <view class="input center">
|
|
|
|
|
- <view>{{orderAmount}}</view>
|
|
|
|
|
- <view class="cusor"></view>
|
|
|
|
|
|
|
+ <view class="">
|
|
|
|
|
+ <!-- #ifdef MP-WEIXIN-->
|
|
|
|
|
+ <view class="">
|
|
|
|
|
+ <u-navbar title="收银台"></u-navbar>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <!-- #endif -->
|
|
|
|
|
+
|
|
|
|
|
+ <view class="check-panel flex-direction">
|
|
|
|
|
+ <image :src="shopDetail.cover" class="buyer-logo"></image>
|
|
|
|
|
+ <view class="title center">{{shopDetail.name}}</view>
|
|
|
|
|
+ <view class="input-content">
|
|
|
|
|
+ <view class="tips">交易金额</view>
|
|
|
|
|
+ <view class="input-bar center" @tap="show=true">
|
|
|
|
|
+ <view class="icon center">¥</view>
|
|
|
|
|
+ <view class="input center">
|
|
|
|
|
+ <view :style="!$isEmpty(orderAmount)?'margin-left: -15%;':''">{{orderAmount}}</view>
|
|
|
|
|
+ <view class="cusor" :style="$isEmpty(orderAmount)?'margin-left: -15%;':''"></view>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <view style="height: 50rpx;"></view>
|
|
|
|
|
+ <view class="" style="z-index: 99;">
|
|
|
|
|
+ <u-button throttle-time="1200" class="button" type="warning" @click="pay">付款</u-button>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
- <view style="height: 50rpx;"></view>
|
|
|
|
|
- <u-button class="button" type="warning" @click="pay">付款</u-button>
|
|
|
|
|
|
|
+
|
|
|
|
|
+ <view class="bottom-line center"> -- 联兑通提供技术支持 --</view>
|
|
|
|
|
+ <u-keyboard z-index="9" ref="uKeyboard" :show-tips="false" :safe-area-inset-bottom="true" :mask="false"
|
|
|
|
|
+ v-model="show" @change="handleInput" @confirm="pay" @backspace="handleDelete"></u-keyboard>
|
|
|
</view>
|
|
</view>
|
|
|
|
|
+
|
|
|
|
|
+ <u-modal v-model="payModalShow" :showCancelButton="true" confirm-color="#FF9447">
|
|
|
|
|
+ <view class="center flex-direction text-df" style="padding: 30rpx 40rpx;">
|
|
|
|
|
+ <view>您的积分可足额抵扣支付</view>
|
|
|
|
|
+ <view class="padding-top-10">本次支付不会扣除您的现金</view>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </u-modal>
|
|
|
|
|
|
|
|
- <view class="bottom-line center"> -- 联兑通提供技术支持 --</view>
|
|
|
|
|
- <u-keyboard ref="uKeyboard" :show-tips="false" :safe-area-inset-bottom="true" :mask="false" v-model="show"
|
|
|
|
|
- @change="handleInput" @backspace="handleDelete"></u-keyboard>
|
|
|
|
|
|
|
+ <u-modal v-model="modalShow" :showCancelButton="true" @cancel="payOfh5" @confirm="jumpLDT" cancel-text="直接付款" confirm-color="#FF9447"
|
|
|
|
|
+ confirmText="去联兑通支付" content="去联兑通小程序付款会有更多优惠哟~"></u-modal>
|
|
|
</view>
|
|
</view>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
@@ -26,34 +46,46 @@
|
|
|
onLoad(option) {},
|
|
onLoad(option) {},
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
|
- show: true,
|
|
|
|
|
|
|
+ payModalShow:false,
|
|
|
|
|
+ modalShow: false,
|
|
|
|
|
+ show: false,
|
|
|
logo: "/static/bank/CMBCHINA.png",
|
|
logo: "/static/bank/CMBCHINA.png",
|
|
|
buyer: "联兑通",
|
|
buyer: "联兑通",
|
|
|
orderAmount: '',
|
|
orderAmount: '',
|
|
|
- shopId:'',
|
|
|
|
|
- shopDetail:{}
|
|
|
|
|
|
|
+ shopId: '',
|
|
|
|
|
+ shopDetail: {}
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
onLoad(options) {
|
|
onLoad(options) {
|
|
|
- this.shopId=options.shopId || '-1'
|
|
|
|
|
|
|
+ this.shopId = options.id
|
|
|
|
|
+ if (this.$isEmpty(this.shopId)) {
|
|
|
|
|
+ this.$dialog.showModal('商户id不能为空', false).then(() => {
|
|
|
|
|
+ uni.navigateBack()
|
|
|
|
|
+ })
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
this.fetchShopDetail()
|
|
this.fetchShopDetail()
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
- fetchShopDetail(){
|
|
|
|
|
- this.$api.shop.detail({id:this.shopId}).then(res=>{
|
|
|
|
|
|
|
+ fetchShopDetail() {
|
|
|
|
|
+ this.$api.shop.detail({
|
|
|
|
|
+ id: this.shopId
|
|
|
|
|
+ }).then(res => {
|
|
|
if (this.$isEmpty(res.data)) {
|
|
if (this.$isEmpty(res.data)) {
|
|
|
- this.$dialog.showModal('获取不到商户信息',false).then(()=>{
|
|
|
|
|
|
|
+ this.$dialog.showModal('获取不到商户信息', false).then(() => {
|
|
|
|
|
+ this.show = false
|
|
|
uni.navigateBack({
|
|
uni.navigateBack({
|
|
|
- delta:1
|
|
|
|
|
|
|
+ delta: 1
|
|
|
})
|
|
})
|
|
|
})
|
|
})
|
|
|
- }else{
|
|
|
|
|
- this.shopDetail=res.data
|
|
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.show = true
|
|
|
|
|
+ this.shopDetail = res.data
|
|
|
}
|
|
}
|
|
|
- }).catch(err=>{
|
|
|
|
|
- this.$dialog.showModal('获取不到商户信息',false).then(()=>{
|
|
|
|
|
|
|
+ }).catch(err => {
|
|
|
|
|
+ this.$dialog.showModal('获取不到商户信息', false).then(() => {
|
|
|
uni.navigateBack({
|
|
uni.navigateBack({
|
|
|
- delta:1
|
|
|
|
|
|
|
+ delta: 1
|
|
|
})
|
|
})
|
|
|
})
|
|
})
|
|
|
})
|
|
})
|
|
@@ -70,31 +102,71 @@
|
|
|
}
|
|
}
|
|
|
this.orderAmount = this.orderAmount.substr(0, this.orderAmount.length - 1)
|
|
this.orderAmount = this.orderAmount.substr(0, this.orderAmount.length - 1)
|
|
|
},
|
|
},
|
|
|
- async pay(){
|
|
|
|
|
- let expireTime= this.$dateTime.getExpireTime(5)
|
|
|
|
|
-
|
|
|
|
|
|
|
+ jumpLDT() {
|
|
|
|
|
+ location.href = "weixin://dl/business/?t=X2CyIQDbgtm"
|
|
|
|
|
+ },
|
|
|
|
|
+ async payOfh5() {
|
|
|
|
|
+ let expireTime=this.$dateTime.getExpireTime(5)
|
|
|
let params={
|
|
let params={
|
|
|
- shopId:this.shopId,
|
|
|
|
|
- loginUserId:this.vuex_userId,
|
|
|
|
|
money:this.orderAmount,
|
|
money:this.orderAmount,
|
|
|
- billsTitle:'用户支付',
|
|
|
|
|
- expireTime,
|
|
|
|
|
- appId:this.$global.wxParams.APPID,
|
|
|
|
|
- openId:this.$cache.get('userInfo').openId,
|
|
|
|
|
- type:1 //type: 1-用户扫商户收款码支付 2-商户扫用户付款码支付
|
|
|
|
|
|
|
+ shopId:this.shopId,
|
|
|
|
|
+ billsTitle:'用户微信扫码支付',
|
|
|
|
|
+ expireTime
|
|
|
}
|
|
}
|
|
|
- let resp=await this.$api.loginUser.payBefore(params)
|
|
|
|
|
- let obj={
|
|
|
|
|
|
|
+ let resp=await this.$api.loginUser.payBeforeForNormal(params)
|
|
|
|
|
+ let payObj={
|
|
|
orderType:this.$global.orderType.USER_PAY,
|
|
orderType:this.$global.orderType.USER_PAY,
|
|
|
- orderId:resp.data.id,
|
|
|
|
|
- payStatus:this.$global.payStatus.IS_WAIT
|
|
|
|
|
|
|
+ orderId:resp.data.id
|
|
|
}
|
|
}
|
|
|
- let res=await this.$api.pay.payOrder(obj)
|
|
|
|
|
- let prePayTn= JSON.parse(res.data.prePayTn)
|
|
|
|
|
- this.$mpi.requestPayment(prePayTn).then(()=>{
|
|
|
|
|
- uni.navigateTo({
|
|
|
|
|
- url:"/pages/checkstand/order-res?orderId="+resp.data.id
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ let res=await this.$api.pay.payOrderOfscanCode(payObj)
|
|
|
|
|
+ if (!this.$isEmpty(res.data.qrCodeUrl)) {
|
|
|
|
|
+ location.href=res.data.qrCodeUrl
|
|
|
|
|
+ }
|
|
|
|
|
+ this.$u.toast('支付失败')
|
|
|
|
|
+ },
|
|
|
|
|
+ async pay() {
|
|
|
|
|
+ if (this.$isEmpty(this.orderAmount)) {
|
|
|
|
|
+ this.$u.toast('请输入交易金额')
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ // #ifdef H5
|
|
|
|
|
+ this.modalShow = true
|
|
|
|
|
+ // #endif
|
|
|
|
|
+
|
|
|
|
|
+ // #ifdef MP-WEIXIN
|
|
|
|
|
+ let flag=false
|
|
|
|
|
+ if (flag) {
|
|
|
|
|
+ //可以足额支付
|
|
|
|
|
+ this.payModalShow=true
|
|
|
|
|
+ }else{
|
|
|
|
|
+ //积分不足额支付,调易宝支付
|
|
|
|
|
+ this.toWXPay()
|
|
|
|
|
+ }
|
|
|
|
|
+ // #endif
|
|
|
|
|
+ },
|
|
|
|
|
+ async toWXPay(){
|
|
|
|
|
+ let expireTime = this.$dateTime.getExpireTime(5)
|
|
|
|
|
+ let params = {
|
|
|
|
|
+ shopId: this.shopId,
|
|
|
|
|
+ loginUserId: this.vuex_userId,
|
|
|
|
|
+ money: this.orderAmount,
|
|
|
|
|
+ billsTitle: '用户支付',
|
|
|
|
|
+ expireTime,
|
|
|
|
|
+ appId: this.$global.wxParams.APPID,
|
|
|
|
|
+ openId: this.$cache.get('userInfo').openId,
|
|
|
|
|
+ type: 1 //type: 1-用户扫商户收款码支付 2-商户扫用户付款码支付
|
|
|
|
|
+ }
|
|
|
|
|
+ let resp = await this.$api.loginUser.payBefore(params)
|
|
|
|
|
+ let obj = {
|
|
|
|
|
+ orderType: this.$global.orderType.USER_PAY,
|
|
|
|
|
+ orderId: resp.data.id,
|
|
|
|
|
+ payStatus: this.$global.payStatus.IS_WAIT
|
|
|
|
|
+ }
|
|
|
|
|
+ let res = await this.$api.pay.payOrder(obj)
|
|
|
|
|
+ let prePayTn = JSON.parse(res.data.prePayTn)
|
|
|
|
|
+ await this.$mpi.requestPayment(prePayTn)
|
|
|
|
|
+ uni.navigateTo({
|
|
|
|
|
+ url: "/pages/checkstand/order-res?orderId=" + resp.data.id
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -104,25 +176,23 @@
|
|
|
<style lang="scss" scoped>
|
|
<style lang="scss" scoped>
|
|
|
.check-panel {
|
|
.check-panel {
|
|
|
.buyer-logo {
|
|
.buyer-logo {
|
|
|
- width: 100rpx;
|
|
|
|
|
- height: 100rpx;
|
|
|
|
|
|
|
+ width: 130rpx;
|
|
|
|
|
+ height: 130rpx;
|
|
|
margin-top: 50rpx;
|
|
margin-top: 50rpx;
|
|
|
- margin-left: calc(50% - 50rpx);
|
|
|
|
|
|
|
+ margin-left: calc(50% - 65rpx);
|
|
|
|
|
+ border-radius: 50%;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
.title {
|
|
.title {
|
|
|
|
|
+ font-weight: 800;
|
|
|
height: 70rpx;
|
|
height: 70rpx;
|
|
|
letter-spacing: 3rpx;
|
|
letter-spacing: 3rpx;
|
|
|
color: #5D5D5D;
|
|
color: #5D5D5D;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
.input-content {
|
|
.input-content {
|
|
|
|
|
+ margin-top: 50rpx;
|
|
|
padding: 50rpx;
|
|
padding: 50rpx;
|
|
|
- position: absolute;
|
|
|
|
|
- top: 280rpx;
|
|
|
|
|
- bottom: 0;
|
|
|
|
|
- left: 0;
|
|
|
|
|
- right: 0;
|
|
|
|
|
background-color: #FFFFFF;
|
|
background-color: #FFFFFF;
|
|
|
width: 100%;
|
|
width: 100%;
|
|
|
border-radius: 25rpx 25rpx 0 0;
|
|
border-radius: 25rpx 25rpx 0 0;
|