You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
shop-app/components/BsPay.vue

61 lines
1.1 KiB

<!--
* @Author: ch
* @Date: 2022-04-19 11:37:50
* @LastEditors: ch
* @LastEditTime: 2022-04-29 15:29:47
* @Description: file content
-->
<template>
<UiRadioPicker title="请选择支付方式" :show="show" :options="options"
@close="close" @confirm="confirm" />
</template>
<script>
import UiRadioPicker from './UiRadioPicker.vue'
import { ApiPostWxPay } from '@/common/api/order';
import { Wxpay } from '@/common/utils';
export default {
components: { UiRadioPicker },
props : {
show : {
type : Boolean,
default : false
},
order:{
type : Object,
default : () => ({})
}
},
data(){
return {
options : [
{
label : '微信支付',
value : 'wxpay'
},
{
label : '支付宝支付',
value : 'alipay'
}
]
}
},
methods:{
confirm(val){
const orderId = this.order.orderId;
if(val.value === 'wxpay'){
Wxpay({orderId, openId: this.$store.state.openId});
this.close();
}else{
uni.$u.toast('暂不支持支付宝支付');
}
},
close(){
this.$emit('update:show',false);
}
}
}
</script>
<style lang="scss" scoped>
</style>