|
@@ -1,5 +1,5 @@
|
|
|
<template>
|
|
|
- <view class="container cashier">
|
|
|
+ <view class="container cashier" @touchmove.stop.prevent="discard" @tap="hideKeyboard">
|
|
|
<cu-custom :navbar-data='nvabarData' @navigateBack="hanldNavigateBack"></cu-custom>
|
|
|
<view class="container-cash clearfix" :style="{marginTop:CustomBar+'px'}">
|
|
|
<view class="container-wrapper">
|
|
@@ -18,18 +18,17 @@
|
|
|
<view class="bot-title"><text>本次支付金额</text></view>
|
|
|
<view class="bot-input">
|
|
|
<text>¥</text>
|
|
|
- <view class="input" @click.stop="focusInput">
|
|
|
+ <!-- <view class="input" @click.stop="focusInput">
|
|
|
<text class="text" v-if="payAmount>=0">{{payAmount}}</text>
|
|
|
<text class="none" v-else>输入金额不能大于待付金额</text>
|
|
|
- </view>
|
|
|
- <!-- <input class=""
|
|
|
- type="button"
|
|
|
- value=""
|
|
|
- @focus="focusInput"
|
|
|
- @input="inputMoney"
|
|
|
- @blur="blurInput"
|
|
|
- v-model=""
|
|
|
- placeholder="" maxlength="10"/> -->
|
|
|
+ </view> -->
|
|
|
+ <input class="input"
|
|
|
+ type="digit"
|
|
|
+ v-model="payAmount"
|
|
|
+ @focus="focusInput"
|
|
|
+ @blur="blurInput"
|
|
|
+ placeholder="输入金额不能大于待付金额"
|
|
|
+ placeholder-class="placeholder"/>
|
|
|
</view>
|
|
|
<view class="bot-resid">
|
|
|
<text>订单剩余¥{{balanceAmount.toFixed(2)}}</text>
|
|
@@ -51,7 +50,7 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="pay-button">
|
|
|
- <view class="btn" @click.stop="MiniWxPayFor">{{buttonText}}</view>
|
|
|
+ <view class="btn" @click.stop="buttonSubMit" :style="{'background':btnColor}">{{buttonText}}</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="alert spec" :class="specClass" v-if="isShowTip">
|
|
@@ -59,48 +58,50 @@
|
|
|
<view class="freight-alert" @tap="hideTips">
|
|
|
<view class="content">
|
|
|
<view class="title">
|
|
|
- <text>提示</text>
|
|
|
+ <text>生成链接</text>
|
|
|
<text class="iconfont icon-iconfontguanbi" @click.stop="hideTips"></text>
|
|
|
</view>
|
|
|
<view class="text-content">
|
|
|
- <view class="text">除了以下两种支付方式,您还可以通过线下直接转账的方式付款。获取转账信息请联系您的采美销售人员或直接拨打客服热线。</view>
|
|
|
- <view class="text-p">客服热线:</view>
|
|
|
- <view class="text-p">0755-22907771 / 15338851365</view>
|
|
|
- <view class="text-p">(周一至周五 09:00-18:00)</view>
|
|
|
+ <view class="text">请复制以下链接,并发送至电脑端,在浏览器访问该链接并选择银行尽快完成支付</view>
|
|
|
+ <view class="text-p">{{payHttpUrl}}</view>
|
|
|
+ <view class="text-b">链接有效期为24小时</view>
|
|
|
</view>
|
|
|
+ <view class="text-button" @click.stop="clipboard(payHttpUrl)">复制链接</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
<!-- 数字键盘 -->
|
|
|
- <keyboard v-if="showDigitKeyboard"
|
|
|
+<!-- <keyboard v-if="showDigitKeyboard"
|
|
|
@confirmEvent="confirmEvent"
|
|
|
:money.sync="payAmount"
|
|
|
btn-color='linear-gradient(135deg,rgba(242,143,49,1) 0%,rgba(225,86,22,1) 100%)'
|
|
|
title="完成">
|
|
|
- </keyboard>
|
|
|
+ </keyboard> -->
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import authorize from '@/common/config/authorize.js'
|
|
|
- import keyboard from "@/components/keyboard/keyboard.vue"
|
|
|
- import { PayOrderCheckoutCounter,WeChatMiniWxPay } from "@/api/order.js"
|
|
|
+ // import keyboard from "@/components/keyboard/keyboard.vue"
|
|
|
+ import thorui from "@/components/clipboard/clipboard.thorui.js"
|
|
|
+ import { PayOrderCheckoutCounter,WeChatMiniWxPay,PayOrderPayLink } from "@/api/order.js"
|
|
|
export default{
|
|
|
components: {
|
|
|
- keyboard
|
|
|
+ // keyboard
|
|
|
},
|
|
|
data(){
|
|
|
return{
|
|
|
orderID:'',
|
|
|
- payableAmount:2222,
|
|
|
+ payType:'',
|
|
|
+ payableAmount:0,
|
|
|
receiptAmount:0,
|
|
|
balanceAmount:0,
|
|
|
payAmount:0,
|
|
|
nvabarData: { //顶部自定义导航
|
|
|
- haveBack:true,
|
|
|
showCapsule:1, // 是否显示左上角图标 1表示显示 0表示不显示,
|
|
|
showSearch: 0,
|
|
|
title: '收银台', // 导航栏 中间的标题
|
|
|
+ haveBack:true,
|
|
|
textLeft:this.$store.state.isIphoneX
|
|
|
},
|
|
|
idCardList:[],
|
|
@@ -109,25 +110,33 @@
|
|
|
tabCurrentIndex:0,
|
|
|
isShowTip:false,
|
|
|
buttonText:'去支付',
|
|
|
+ btnColor:'#09BB07',
|
|
|
discernReceipt:[],
|
|
|
- showDigitKeyboard:false
|
|
|
+ showDigitKeyboard:false,
|
|
|
+ payHttpUrl:''
|
|
|
}
|
|
|
},
|
|
|
onLoad(option) {
|
|
|
- // this.initData(option)
|
|
|
- },
|
|
|
- computed:{
|
|
|
- passStr(){
|
|
|
- let str='';
|
|
|
- this.idCardList.forEach(item=>{
|
|
|
- str+=item.toString();
|
|
|
- })
|
|
|
- return str;
|
|
|
- }
|
|
|
+ this.initData(option)
|
|
|
},
|
|
|
methods:{
|
|
|
initData(e){
|
|
|
+ this.payType = e.type
|
|
|
+ console.log(this.payType)
|
|
|
this.orderID = e.orderID
|
|
|
+ switch(this.payType){
|
|
|
+ case '0':
|
|
|
+ this.btnColor="#09BB07"
|
|
|
+ this.buttonText = '去支付'
|
|
|
+ break;
|
|
|
+ case '1':
|
|
|
+ this.btnColor="#034582"
|
|
|
+ this.buttonText = '生成支付链接'
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ this.GetPayOrderInfo()
|
|
|
+ },
|
|
|
+ GetPayOrderInfo(){
|
|
|
PayOrderCheckoutCounter({orderId:this.orderID}).then(response =>{
|
|
|
console.log(response)
|
|
|
this.discernReceipt = response.data.discernReceipt //支付记录
|
|
@@ -139,6 +148,22 @@
|
|
|
this.$util.msg(error.msg,2000)
|
|
|
})
|
|
|
},
|
|
|
+ buttonSubMit(){
|
|
|
+ switch(this.payType){
|
|
|
+ case '0':
|
|
|
+ this.MiniWxPayFor()
|
|
|
+ break;
|
|
|
+ case '1':
|
|
|
+ this.isShowTip = true
|
|
|
+ this.BuildCatenate()
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ BuildCatenate(){
|
|
|
+ PayOrderPayLink({unpaidAmount:this.payAmount,orderId:this.orderID}).then(response =>{
|
|
|
+ this.payHttpUrl = response.data
|
|
|
+ })
|
|
|
+ },
|
|
|
MiniWxPayFor(){
|
|
|
let self = this
|
|
|
authorize.getCode('weixin').then(wechatcode =>{
|
|
@@ -179,37 +204,38 @@
|
|
|
})
|
|
|
})
|
|
|
},
|
|
|
- focusInput(){
|
|
|
- this.showDigitKeyboard = true
|
|
|
- },
|
|
|
- confirmEvent(value){
|
|
|
- //点击键盘完成的回调函数
|
|
|
+ confirmEvent(value){//点击自定义键盘完成的回调函数
|
|
|
console.log(value)
|
|
|
this.chechValue(value)
|
|
|
this.showDigitKeyboard = false
|
|
|
},
|
|
|
+ blurInput(e){
|
|
|
+ this.chechValue(e.detail.value)
|
|
|
+ },
|
|
|
+ focusInput(){
|
|
|
+ // this.showDigitKeyboard = true
|
|
|
+ },
|
|
|
+ hideKeyboard(){
|
|
|
+ this.showDigitKeyboard = false
|
|
|
+ },
|
|
|
chechValue(value){
|
|
|
- console.log(parseInt(value))
|
|
|
if(value == 0){
|
|
|
- console.log('1111',value)
|
|
|
- this.payAmount = 0
|
|
|
- this.balanceAmount = this.payableAmount
|
|
|
+ this.payAmount = this.payableAmount.toFixed(2)
|
|
|
+ this.balanceAmount = this.payableAmount-this.payAmount
|
|
|
}else if(parseInt(value)>this.payableAmount){
|
|
|
- console.log('2222',value)
|
|
|
- this.payAmount = this.payableAmount
|
|
|
+ this.payAmount = this.payableAmount.toFixed(2)
|
|
|
this.balanceAmount = this.payableAmount - this.payAmount
|
|
|
}else{
|
|
|
- console.log('33333',value)
|
|
|
- this.payAmount = value
|
|
|
+ this.payAmount =Number(value).toFixed(2)
|
|
|
this.balanceAmount = this.payableAmount - this.payAmount
|
|
|
}
|
|
|
},
|
|
|
- hanldNavigateBack(){
|
|
|
+ hanldNavigateBack(){//页面返回
|
|
|
uni.navigateBack({
|
|
|
delta: 1
|
|
|
});
|
|
|
},
|
|
|
- payTypeText (state){
|
|
|
+ payTypeText (state){//处理支付记录文字
|
|
|
let stateText = '',
|
|
|
stateTextObject={
|
|
|
12:'PC-B2B网银',
|
|
@@ -225,6 +251,23 @@
|
|
|
})
|
|
|
return stateText;
|
|
|
},
|
|
|
+ hideTips(){//隐藏弹窗
|
|
|
+ this.isShowTip = false
|
|
|
+ },
|
|
|
+ clipboard(data) {//复制链接
|
|
|
+ thorui.getClipboardData(data, (res) => {
|
|
|
+ // #ifdef H5
|
|
|
+ if (res) {
|
|
|
+ this.$util.msg("复制成功",2000);
|
|
|
+ } else {
|
|
|
+ this.$util.msg("复制失败",2000);
|
|
|
+ }
|
|
|
+ // #endif
|
|
|
+ })
|
|
|
+ },
|
|
|
+ discard(){
|
|
|
+ //丢弃
|
|
|
+ }
|
|
|
},
|
|
|
onShow() {
|
|
|
|
|
@@ -293,7 +336,7 @@
|
|
|
float: left;
|
|
|
}
|
|
|
.input{
|
|
|
- font-size: $font-size-28;
|
|
|
+ font-size: $font-size-40;
|
|
|
width: 500rpx;
|
|
|
height: 66rpx;
|
|
|
padding: 0 10rpx;
|
|
@@ -307,6 +350,9 @@
|
|
|
color:$text-color;
|
|
|
}
|
|
|
}
|
|
|
+ .placeholder{
|
|
|
+ font-size: $font-size-26;
|
|
|
+ }
|
|
|
}
|
|
|
.bot-resid{
|
|
|
line-height: 36rpx;
|
|
@@ -373,7 +419,7 @@
|
|
|
.pay-button{
|
|
|
width: 100%;
|
|
|
position: fixed;
|
|
|
- bottom: 40rpx;
|
|
|
+ bottom: 80rpx;
|
|
|
.btn{
|
|
|
width: 702rpx;
|
|
|
height: 88rpx;
|
|
@@ -438,18 +484,42 @@
|
|
|
width: 100%;
|
|
|
height: auto;
|
|
|
.text{
|
|
|
- padding: 20rpx 0;
|
|
|
+ padding: 20rpx 0 0 0;
|
|
|
line-height: 44rpx;
|
|
|
font-size: $font-size-26;
|
|
|
color:#666666;
|
|
|
text-align: justify;
|
|
|
}
|
|
|
.text-p{
|
|
|
+ width: 100%;
|
|
|
line-height: 44rpx;
|
|
|
font-size: $font-size-26;
|
|
|
color:$color-system;
|
|
|
text-align: left;
|
|
|
+ text-overflow:ellipsis;
|
|
|
+ display: -webkit-box;
|
|
|
+ word-break: break-all;
|
|
|
+ -webkit-box-orient: vertical;
|
|
|
+ -webkit-line-clamp: 1;
|
|
|
+ overflow: hidden;
|
|
|
}
|
|
|
+ .text-b{
|
|
|
+ line-height: 44rpx;
|
|
|
+ font-size: $font-size-24;
|
|
|
+ color:#999999;
|
|
|
+ text-align: left;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .text-button{
|
|
|
+ width: 100%;
|
|
|
+ height: 88rpx;
|
|
|
+ line-height: 88rpx;
|
|
|
+ background: $btn-confirm;
|
|
|
+ font-size: $font-size-28;
|
|
|
+ border-radius: 14rpx;
|
|
|
+ color:#FFFFFF;
|
|
|
+ text-align: center;
|
|
|
+ margin-top: 20rpx;
|
|
|
}
|
|
|
}
|
|
|
}
|