|
|
@@ -6,29 +6,25 @@
|
|
|
</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="shopInfo">
|
|
|
+ <image :src="shopDetail.cover" mode=""></image>
|
|
|
+ <text>{{shopDetail.name}}</text>
|
|
|
+ </view>
|
|
|
+ <view class="data">
|
|
|
+ <text style="color: #000;">付款金额</text>
|
|
|
+ <view class="price">
|
|
|
+ <view class="input-bar center" @tap="show">
|
|
|
<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 class="input" style="display: flex; align-items: center;">
|
|
|
+ <view style="font-size: 80rpx;">{{filterMoney(orderAmount)}}</view>
|
|
|
+ <view class="cusor"></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 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>
|
|
|
-
|
|
|
+ <amountInput ref="amountInput" confirmText="付款" btnColor="#ff9900" placeholder="请输入交易金额" @change="change"
|
|
|
+ @confirm="$u.debounce(pay, 1000)"></amountInput>
|
|
|
+
|
|
|
<u-modal v-model="payModalShow" :showCancelButton="true" confirm-color="#FF9447">
|
|
|
<view class="center flex-direction text-df" style="padding: 30rpx 40rpx;">
|
|
|
<view>您的积分可足额抵扣支付</view>
|
|
|
@@ -36,28 +32,42 @@
|
|
|
</view>
|
|
|
</u-modal>
|
|
|
|
|
|
- <u-modal v-model="modalShow" :showCancelButton="true" @cancel="payOfh5" @confirm="jumpLDT" cancel-text="直接付款" confirm-color="#FF9447"
|
|
|
- confirmText="去联兑通支付" content="去联兑通小程序付款会有更多优惠哟~"></u-modal>
|
|
|
+ <u-modal v-model="modalShow" :showCancelButton="true" @cancel="payOfh5" @confirm="jumpLDT" cancel-text="直接付款"
|
|
|
+ confirm-color="#FF9447" confirmText="去联兑通支付" content="去联兑通小程序付款会有更多优惠哟~"></u-modal>
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+ import amountInput from '@/components/amountInput/amountInput.vue';
|
|
|
export default {
|
|
|
- onLoad(option) {},
|
|
|
+ components: {
|
|
|
+ amountInput
|
|
|
+ },
|
|
|
data() {
|
|
|
return {
|
|
|
- payModalShow:false,
|
|
|
- modalShow: false,
|
|
|
- show: false,
|
|
|
- logo: "/static/bank/CMBCHINA.png",
|
|
|
- buyer: "联兑通",
|
|
|
orderAmount: '',
|
|
|
+ payModalShow: false,
|
|
|
+ modalShow: false,
|
|
|
shopId: '',
|
|
|
shopDetail: {}
|
|
|
}
|
|
|
},
|
|
|
onLoad(options) {
|
|
|
- this.shopId = options.id
|
|
|
+ if (!this.$isEmpty(options.query)) {
|
|
|
+ let params = options.query.split(";")
|
|
|
+ this.shopId = params[0]
|
|
|
+ this.orderAmount = params[1]
|
|
|
+ } else {
|
|
|
+ this.shopId = options.id
|
|
|
+ }
|
|
|
+ //如果是新用户通过微信支付扫码进入此页面,跳回首页
|
|
|
+ if (this.$isEmpty(this.vuex_userId)) {
|
|
|
+ uni.reLaunch({
|
|
|
+ url:"/pages/mine/mine?query="+ this.shopId + ";" + this.orderAmount
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
if (this.$isEmpty(this.shopId)) {
|
|
|
this.$dialog.showModal('商户id不能为空', false).then(() => {
|
|
|
uni.navigateBack()
|
|
|
@@ -73,13 +83,11 @@
|
|
|
}).then(res => {
|
|
|
if (this.$isEmpty(res.data)) {
|
|
|
this.$dialog.showModal('获取不到商户信息', false).then(() => {
|
|
|
- this.show = false
|
|
|
uni.navigateBack({
|
|
|
delta: 1
|
|
|
})
|
|
|
})
|
|
|
} else {
|
|
|
- this.show = true
|
|
|
this.shopDetail = res.data
|
|
|
}
|
|
|
}).catch(err => {
|
|
|
@@ -90,39 +98,57 @@
|
|
|
})
|
|
|
})
|
|
|
},
|
|
|
- handleInput(num) {
|
|
|
- if (this.orderAmount.length > 12) {
|
|
|
- return
|
|
|
+ show() {
|
|
|
+ this.$refs.amountInput.show()
|
|
|
+ },
|
|
|
+ change(e) {
|
|
|
+ if (!e) {
|
|
|
+ this.orderAmount = 0
|
|
|
+ } else {
|
|
|
+ this.orderAmount = e
|
|
|
}
|
|
|
- this.orderAmount = this.orderAmount + num
|
|
|
},
|
|
|
- handleDelete() {
|
|
|
- if (this.$isEmpty(this.orderAmount)) {
|
|
|
- return
|
|
|
+ filterMoney(value) {
|
|
|
+ if (!value) {
|
|
|
+ return ''
|
|
|
+ } else {
|
|
|
+ value = value.replace(/\$\s?|(,*)/g, '')
|
|
|
+ return value.replace(/\B(?=(\d{3})+(?!\d))/g, ',')
|
|
|
}
|
|
|
- this.orderAmount = this.orderAmount.substr(0, this.orderAmount.length - 1)
|
|
|
},
|
|
|
- jumpLDT() {
|
|
|
- location.href = "weixin://dl/business/?t=X2CyIQDbgtm"
|
|
|
+ async jumpLDT() {
|
|
|
+ this.$dialog.showLoading('打开中..')
|
|
|
+ let params = {
|
|
|
+ path: "/pages/checkstand/index",
|
|
|
+ query: "query=" + this.shopId + ";" + this.orderAmount
|
|
|
+ }
|
|
|
+ let res = await this.$api.wxApp.getGenerateScheme(params)
|
|
|
+ if (res.data.openlink) {
|
|
|
+ location.href = res.data.openlink
|
|
|
+ } else {
|
|
|
+ location.href = "weixin://dl/business/?t=X2CyIQDbgtm"
|
|
|
+ }
|
|
|
+ uni.hideLoading()
|
|
|
},
|
|
|
async payOfh5() {
|
|
|
- let expireTime=this.$dateTime.getExpireTime(5)
|
|
|
- let params={
|
|
|
- money:this.orderAmount,
|
|
|
- shopId:this.shopId,
|
|
|
- billsTitle:'用户微信扫码支付',
|
|
|
+ let expireTime = this.$dateTime.getExpireTime(5)
|
|
|
+ let params = {
|
|
|
+ money: this.orderAmount,
|
|
|
+ shopId: this.shopId,
|
|
|
+ billsTitle: '用户微信扫码支付',
|
|
|
expireTime
|
|
|
}
|
|
|
- let resp=await this.$api.loginUser.payBeforeForNormal(params)
|
|
|
- let payObj={
|
|
|
- orderType:this.$global.orderType.USER_PAY,
|
|
|
- orderId:resp.data.id
|
|
|
+ let resp = await this.$api.loginUser.payBeforeForNormal(params)
|
|
|
+ let payObj = {
|
|
|
+ orderType: this.$global.orderType.USER_PAY,
|
|
|
+ orderId: resp.data.id
|
|
|
}
|
|
|
- let res=await this.$api.pay.payOrderOfscanCode(payObj)
|
|
|
+ let res = await this.$api.pay.payOrderOfscanCode(payObj)
|
|
|
if (!this.$isEmpty(res.data.qrCodeUrl)) {
|
|
|
- location.href=res.data.qrCodeUrl
|
|
|
+ location.href = res.data.qrCodeUrl
|
|
|
+ }else{
|
|
|
+ this.$u.toast('支付失败')
|
|
|
}
|
|
|
- this.$u.toast('支付失败')
|
|
|
},
|
|
|
async pay() {
|
|
|
if (this.$isEmpty(this.orderAmount)) {
|
|
|
@@ -134,17 +160,17 @@
|
|
|
// #endif
|
|
|
|
|
|
// #ifdef MP-WEIXIN
|
|
|
- let flag=false
|
|
|
+ let flag = false
|
|
|
if (flag) {
|
|
|
//可以足额支付
|
|
|
- this.payModalShow=true
|
|
|
- }else{
|
|
|
+ this.payModalShow = true
|
|
|
+ } else {
|
|
|
//积分不足额支付,调易宝支付
|
|
|
this.toWXPay()
|
|
|
}
|
|
|
// #endif
|
|
|
},
|
|
|
- async toWXPay(){
|
|
|
+ async toWXPay() {
|
|
|
let expireTime = this.$dateTime.getExpireTime(5)
|
|
|
let params = {
|
|
|
shopId: this.shopId,
|
|
|
@@ -157,6 +183,18 @@
|
|
|
type: 1 //type: 1-用户扫商户收款码支付 2-商户扫用户付款码支付
|
|
|
}
|
|
|
let resp = await this.$api.loginUser.payBefore(params)
|
|
|
+ if (!resp.success) {
|
|
|
+ this.$u.toast(resp.msg)
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (resp.data.payAmount==0) {
|
|
|
+ this.$dialog.showModal('已使用积分抵扣成功',false).then(()=>{
|
|
|
+ uni.navigateBack({
|
|
|
+ delta:1
|
|
|
+ })
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
let obj = {
|
|
|
orderType: this.$global.orderType.USER_PAY,
|
|
|
orderId: resp.data.id,
|
|
|
@@ -173,72 +211,79 @@
|
|
|
}
|
|
|
</script>
|
|
|
|
|
|
+<style>
|
|
|
+ page{
|
|
|
+ background-color: #ffff;
|
|
|
+ }
|
|
|
+</style>
|
|
|
+
|
|
|
<style lang="scss" scoped>
|
|
|
- .check-panel {
|
|
|
- .buyer-logo {
|
|
|
- width: 130rpx;
|
|
|
- height: 130rpx;
|
|
|
- margin-top: 50rpx;
|
|
|
- margin-left: calc(50% - 65rpx);
|
|
|
+ .shopInfo {
|
|
|
+ margin: 60rpx 0 20rpx;
|
|
|
+ display: flex;
|
|
|
+ justify-content: center;
|
|
|
+ align-items: center;
|
|
|
+ flex-direction: column;
|
|
|
+
|
|
|
+ image {
|
|
|
border-radius: 50%;
|
|
|
+ width: 140rpx;
|
|
|
+ height: 140rpx;
|
|
|
}
|
|
|
|
|
|
- .title {
|
|
|
- font-weight: 800;
|
|
|
- height: 70rpx;
|
|
|
- letter-spacing: 3rpx;
|
|
|
- color: #5D5D5D;
|
|
|
+ text {
|
|
|
+ margin-top: 30rpx;
|
|
|
+ font-size: 32rpx;
|
|
|
}
|
|
|
+ }
|
|
|
|
|
|
- .input-content {
|
|
|
- margin-top: 50rpx;
|
|
|
- padding: 50rpx;
|
|
|
- background-color: #FFFFFF;
|
|
|
- width: 100%;
|
|
|
- border-radius: 25rpx 25rpx 0 0;
|
|
|
-
|
|
|
- .tips {
|
|
|
- height: 100rpx;
|
|
|
- font-size: 30rpx;
|
|
|
- display: flex;
|
|
|
- justify-content: left;
|
|
|
- align-items: center;
|
|
|
+ .data {
|
|
|
+ padding: 50rpx;
|
|
|
+ display: flex;
|
|
|
+ justify-content: flex-start;
|
|
|
+ flex-direction: column;
|
|
|
+
|
|
|
+ .price {
|
|
|
+
|
|
|
+ &-icon {
|
|
|
+ font-size: 40rpx;
|
|
|
+ font-weight: 800;
|
|
|
}
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
- .input-bar {
|
|
|
- height: 150rpx;
|
|
|
- border-bottom: 1rpx solid #DDDDDD;
|
|
|
+ .center {
|
|
|
+ display: flex;
|
|
|
+ justify-content: center;
|
|
|
+ align-items: center;
|
|
|
+ }
|
|
|
|
|
|
- .icon {
|
|
|
- width: 15%;
|
|
|
- font-size: 70rpx;
|
|
|
- font-weight: 900;
|
|
|
- height: 100%;
|
|
|
- }
|
|
|
+ .input-bar {
|
|
|
+ height: 150rpx;
|
|
|
+ border-bottom: 1rpx solid #DDDDDD;
|
|
|
|
|
|
- .input {
|
|
|
- width: 85%;
|
|
|
- height: 100%;
|
|
|
- overflow: hidden;
|
|
|
- font-size: 70rpx;
|
|
|
- }
|
|
|
+ .icon {
|
|
|
+ width: 15%;
|
|
|
+ font-size: 70rpx;
|
|
|
+ font-weight: 900;
|
|
|
+ height: 100%;
|
|
|
+ }
|
|
|
|
|
|
- .cusor {
|
|
|
- width: 2rpx;
|
|
|
- height: 80%;
|
|
|
- background-color: #FD711B;
|
|
|
- animation: blink 1500ms infinite ease-in-out;
|
|
|
- }
|
|
|
- }
|
|
|
+ .input {
|
|
|
+ width: 85%;
|
|
|
+ height: 100%;
|
|
|
+ overflow: hidden;
|
|
|
+ font-size: 70rpx;
|
|
|
}
|
|
|
- }
|
|
|
|
|
|
- .bottom-line {
|
|
|
- position: absolute;
|
|
|
- bottom: 50rpx;
|
|
|
- left: 0;
|
|
|
- width: 100%;
|
|
|
- color: #dddddd;
|
|
|
+ .cusor {
|
|
|
+ margin-left: 10rpx;
|
|
|
+ width: 6rpx;
|
|
|
+ border-radius: 20rpx;
|
|
|
+ height: 60%;
|
|
|
+ background-color: #ff9900;
|
|
|
+ animation: blink 1200ms infinite ease-in-out;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
@keyframes blink {
|