Browse Source

商家中心新增退出登录,线下扫码付输入支付密码

master
邓平艺 4 years ago
parent
commit
ecda2ae5f0
  1. 32
      pages/aboutpay/confirmcash.vue
  2. 29
      pages/business/center/center.vue

32
pages/aboutpay/confirmcash.vue

@ -23,18 +23,21 @@
</countdown-timer> </countdown-timer>
</view> </view>
<view> <view>
<button class="confirmcash-btn" hover-class="lf-opacity" @click="offlinePay">确认</button>
<button class="confirmcash-btn" hover-class="lf-opacity" @click="confirm">确认</button>
</view> </view>
</view> </view>
</view> </view>
<lf-pay-password v-if="show_pay" @comfirm="payComfirm" title="请输入支付密码"></lf-pay-password>
</view> </view>
</template> </template>
<script> <script>
import countdownTimer from '@/components/countdown-timer/countdown-timer'; import countdownTimer from '@/components/countdown-timer/countdown-timer';
import lfPayPassword from '@/components/lf-payPassword/lf-payPassword.vue'
export default { export default {
components: { components: {
countdownTimer
countdownTimer,
lfPayPassword
}, },
data() { data() {
return { return {
@ -42,7 +45,9 @@
amount: 0, amount: 0,
clerk_id: 0, clerk_id: 0,
brand_id: 0, brand_id: 0,
is_date_end: false
is_date_end: false,
show_pay: false,
pay_pwd: '' //
} }
}, },
onLoad(options){ onLoad(options){
@ -55,7 +60,8 @@
console.log("倒计时结束"); console.log("倒计时结束");
this.is_date_end = true; this.is_date_end = true;
}, },
offlinePay(){
//
confirm(){
if(this.amount == 0){ if(this.amount == 0){
return this.$msg('支付金额不能为0'); return this.$msg('支付金额不能为0');
} }
@ -68,18 +74,32 @@
}); });
return; return;
}; };
this.show_pay = true;
},
//
payComfirm(event){
this.show_pay = false;
this.pay_pwd = event;
this.offlinePay();
},
offlinePay(){
uni.showLoading({
title: '正在支付中'
})
let token = this.$cookieStorage.get('user_token'); let token = this.$cookieStorage.get('user_token');
this.$http.post({ this.$http.post({
api: 'api/offline/pay', api: 'api/offline/pay',
data: { data: {
clerk_id: this.clerk_id, clerk_id: this.clerk_id,
brand_id: this.brand_id, brand_id: this.brand_id,
amount: this.amount
amount: this.amount,
pay_pwd: this.pay_pwd
}, },
header: { header: {
Authorization: token Authorization: token
} }
}).then(res => { }).then(res => {
uni.hideLoading();
if(res.data.code == 200){ if(res.data.code == 200){
this.$url('/pages/aboutpay/paystate?payState=1&amount='+ this.amount); this.$url('/pages/aboutpay/paystate?payState=1&amount='+ this.amount);
}else{ }else{
@ -87,7 +107,7 @@
this.$url('/pages/aboutpay/paystate?payState=0'); this.$url('/pages/aboutpay/paystate?payState=0');
}) })
} }
})
}).catch(err => uni.hideLoading())
} }
} }
} }

29
pages/business/center/center.vue

@ -111,6 +111,8 @@
</view> </view>
</view> </view>
</view> </view>
<button class="out-btn" hover-class="lf-opacity" @click="outLogin">退出登录</button>
<view style="height: 30rpx;"></view>
</block> </block>
</view> </view>
</template> </template>
@ -218,6 +220,21 @@
}).then(res => { }).then(res => {
this.$msg(res.data.message || '自提核销成功'); this.$msg(res.data.message || '自提核销成功');
}) })
},
// 退
outLogin(){
uni.showModal({
title: '温馨提示',
content: '您确定退出登录商家中心吗?',
success: result => {
if(result.confirm){
this.$cookieStorage.clear('store_token');
this.$msg('退出成功', {icon: 'success'}).then(() => {
this.$toBack();
})
}
}
})
} }
} }
} }
@ -336,4 +353,16 @@
} }
} }
} }
.out-btn{
width: 686rpx;
height: 90rpx;
background-color: #0D2E9A;
color: #FFFFFF;
font-size: 32rpx;
margin: 0 auto;
display: flex;
justify-content: center;
align-items: center;
margin-top: 60rpx;
}
</style> </style>
Loading…
Cancel
Save