|
@@ -109,6 +109,37 @@
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
|
+ <!-- 支付键盘 -->
|
|
|
|
|
+ <u-keyboard
|
|
|
|
|
+ default=""
|
|
|
|
|
+ ref="uKeyboard"
|
|
|
|
|
+ mode="number"
|
|
|
|
|
+ :mask="true"
|
|
|
|
|
+ :mask-close-able="false"
|
|
|
|
|
+ :dot-enabled="true"
|
|
|
|
|
+ v-model="show"
|
|
|
|
|
+ :confirm-btn="true"
|
|
|
|
|
+ :safe-area-inset-bottom="true"
|
|
|
|
|
+ :tooltip="false"
|
|
|
|
|
+ @change="onChange"
|
|
|
|
|
+ @backspace="onBackspace">
|
|
|
|
|
+ <view>
|
|
|
|
|
+ <view class="u-text-center u-padding-20 money">
|
|
|
|
|
+ <view v-if="money=='0'" class="" style="position: absolute;left: 80rpx;bottom: 20rpx;">
|
|
|
|
|
+ <text style="color: #909399;font-size: 24rpx;">请输入付款金额</text>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <text>{{money}}</text>
|
|
|
|
|
+ <text class="u-font-20 u-padding-left-10">元</text>
|
|
|
|
|
+ <view class="u-padding-10 close" data-flag="false" @tap="close">
|
|
|
|
|
+ <u-icon name="close" color="#333333" size="28"></u-icon>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </view>
|
|
|
|
|
+
|
|
|
|
|
+ <u-button @click="inputConfirm" plain :ripple="true" ripple-bg-color="rgba(25, 190, 107,.4)">确认</u-button>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </u-keyboard>
|
|
|
|
|
+
|
|
|
<u-select @confirm="shopConfirm" v-model="shopShow" value-name="id" label-name="name" :list="shopList"></u-select>
|
|
<u-select @confirm="shopConfirm" v-model="shopShow" value-name="id" label-name="name" :list="shopList"></u-select>
|
|
|
</view>
|
|
</view>
|
|
|
</template>
|
|
</template>
|
|
@@ -117,6 +148,8 @@
|
|
|
export default {
|
|
export default {
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
|
|
|
+ show:false,
|
|
|
|
|
+ money:"0",
|
|
|
scanNotify:{scan: false,scanMessage:'扫描错误,请稍后重试!' },
|
|
scanNotify:{scan: false,scanMessage:'扫描错误,请稍后重试!' },
|
|
|
|
|
|
|
|
//下拉选择商铺
|
|
//下拉选择商铺
|
|
@@ -243,27 +276,73 @@
|
|
|
},
|
|
},
|
|
|
operate(index){
|
|
operate(index){
|
|
|
if (index==0) {
|
|
if (index==0) {
|
|
|
- this.scanCode()
|
|
|
|
|
|
|
+ this.show=true
|
|
|
}else if (index==1) {
|
|
}else if (index==1) {
|
|
|
this.$jump('/pages/checkstand/pay-qrcode')
|
|
this.$jump('/pages/checkstand/pay-qrcode')
|
|
|
|
|
+ }else if (index==2) {
|
|
|
|
|
+ this.$jump('/pages/card/card')
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
},
|
|
},
|
|
|
//扫描二维码
|
|
//扫描二维码
|
|
|
|
|
+ onChange(val){
|
|
|
|
|
+ if (this.money=='0' && val!='.') {
|
|
|
|
|
+ this.money=val
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ console.log(typeof this.money);
|
|
|
|
|
+ console.log(typeof val);
|
|
|
|
|
+ this.money += val.toString()
|
|
|
|
|
+ },
|
|
|
|
|
+ onBackspace(e){
|
|
|
|
|
+ if(this.money.length>0 &&this.money!='0'){
|
|
|
|
|
+ this.money = this.money.substring(0,this.money.length-1);
|
|
|
|
|
+ }else{
|
|
|
|
|
+ this.money='0'
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ inputConfirm(){
|
|
|
|
|
+ if (this.$isEmpty(this.money)) {
|
|
|
|
|
+ this.$u.toast('请输入收款金额')
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ if (!this.$verify.isMoney(this.money)) {
|
|
|
|
|
+ this.$u.toast('请输入正确的收款金额')
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ this.show=false
|
|
|
|
|
+ this.scanCode()
|
|
|
|
|
+ },
|
|
|
|
|
+ close(){
|
|
|
|
|
+ this.money='0'
|
|
|
|
|
+ this.show=false
|
|
|
|
|
+ },
|
|
|
scanCode(){
|
|
scanCode(){
|
|
|
const _this = this;
|
|
const _this = this;
|
|
|
uni.scanCode({
|
|
uni.scanCode({
|
|
|
success: function (res) {
|
|
success: function (res) {
|
|
|
- console.log(res,1236456);
|
|
|
|
|
- _this.jump('/pages/checkstand/index?shopId='+res.result)
|
|
|
|
|
|
|
+ _this.payBefore(res.result)
|
|
|
},
|
|
},
|
|
|
fail: (res) => {
|
|
fail: (res) => {
|
|
|
if(res.errMsg!='scanCode:fail cancel'){
|
|
if(res.errMsg!='scanCode:fail cancel'){
|
|
|
- this.scanNotify = {scan: true,scanMessage: res.errMsg};
|
|
|
|
|
|
|
+ _this.scanNotify = {scan: true,scanMessage: res.errMsg};
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
|
|
+ async payBefore(secret){
|
|
|
|
|
+ let expireTime=this.$dateTime.getExpireTime(5)
|
|
|
|
|
+ let params={
|
|
|
|
|
+ shopId:this.vuex_shopId,
|
|
|
|
|
+ money:this.money,
|
|
|
|
|
+ billsTitle:'用户支付',
|
|
|
|
|
+ expireTime,
|
|
|
|
|
+ appId:this.$global.wxParams.clientAppId,
|
|
|
|
|
+ secret,
|
|
|
|
|
+ type:2
|
|
|
|
|
+ }
|
|
|
|
|
+ let resp=await this.$api.shop.payBefore(params)
|
|
|
|
|
+ console.log(resp);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
</script>
|
|
</script>
|
|
@@ -419,4 +498,18 @@
|
|
|
padding:8rpx 10rpx 8rpx 35rpx;
|
|
padding:8rpx 10rpx 8rpx 35rpx;
|
|
|
background-image: linear-gradient(to right,#FFD67B,#F99200);
|
|
background-image: linear-gradient(to right,#FFD67B,#F99200);
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ .money{
|
|
|
|
|
+ font-size: 80rpx;
|
|
|
|
|
+ color: $u-type-warning;
|
|
|
|
|
+ position: relative;
|
|
|
|
|
+
|
|
|
|
|
+ .close{
|
|
|
|
|
+ position: absolute;
|
|
|
|
|
+ top: 20rpx;
|
|
|
|
|
+ right: 20rpx;
|
|
|
|
|
+ line-height: 28rpx;
|
|
|
|
|
+ font-size: 28rpx;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
</style>
|
|
</style>
|