fix:收银台充值修改

pull/8/head
kele 2023-03-16 17:56:35 +08:00
parent 7fae80c457
commit 5813f98ab1
3 changed files with 14 additions and 13 deletions

View File

@ -19,7 +19,7 @@
<button <button
class="history-btn ss-reset-button" class="history-btn ss-reset-button"
@tap="onSearch(item)" @tap="onSearch(item)"
v-for="(item, index) in state.historyTag" v-for="(item, index) in state.historyList"
:key="index" :key="index"
> >
{{ item }} {{ item }}
@ -34,7 +34,7 @@
import sheep from '@/sheep'; import sheep from '@/sheep';
import { onLoad } from '@dcloudio/uni-app'; import { onLoad } from '@dcloudio/uni-app';
const state = reactive({ const state = reactive({
historyTag: [], historyList: [],
}); });
// //

View File

@ -18,10 +18,7 @@
<view <view
class="pay-item ss-flex ss-col-center ss-row-between ss-p-x-30 border-bottom" class="pay-item ss-flex ss-col-center ss-row-between ss-p-x-30 border-bottom"
:class="{ 'disabled-pay-item': item.disabled }" :class="{ 'disabled-pay-item': item.disabled }"
v-if=" v-if="allowedPayment.includes(item.value)"
allowedPayment.includes(item.value) &&
!(state.orderType === 'recharge' && item.value === 'money')
"
> >
<view class="ss-flex ss-col-center"> <view class="ss-flex ss-col-center">
<image <image
@ -88,8 +85,8 @@
import { useDurationTime } from '@/sheep/hooks/useGoods'; import { useDurationTime } from '@/sheep/hooks/useGoods';
const userInfo = computed(() => sheep.$store('user').userInfo); const userInfo = computed(() => sheep.$store('user').userInfo);
// //
//
const state = reactive({ const state = reactive({
orderType: 'goods', orderType: 'goods',
payment: '', payment: '',
@ -97,7 +94,14 @@
payStatus: 0, // 0=, -2= -1= 1=2= payStatus: 0, // 0=, -2= -1= 1=2=
payMethods: [], payMethods: [],
}); });
const allowedPayment = computed(() => sheep.$store('app').platform.payment);
const allowedPayment = computed(() => {
if(state.orderType === 'recharge') {
return sheep.$store('app').platform.recharge_payment
}
return sheep.$store('app').platform.payment
});
const payMethods = [ const payMethods = [
{ {
icon: '/static/img/shop/pay/wechat.png', icon: '/static/img/shop/pay/wechat.png',
@ -200,11 +204,6 @@
const { data, error } = await sheep.$api.trade.order(id); const { data, error } = await sheep.$api.trade.order(id);
if (error === 0) { if (error === 0) {
state.orderInfo = data; state.orderInfo = data;
payMethods.forEach((item, index, array) => {
if (item.value === 'offline') {
array.splice(index, 1);
}
});
state.payMethods = payMethods; state.payMethods = payMethods;
checkPayStatus(); checkPayStatus();
} else { } else {
@ -257,6 +256,7 @@
// //
setRechargeOrder(id); setRechargeOrder(id);
} else { } else {
state.orderType = 'goods';
// //
setGoodsOrder(id); setGoodsOrder(id);
} }

View File

@ -23,6 +23,7 @@ const app = defineStore({
}, },
platform: { platform: {
payment: [], // 支持的支付方式 payment: [], // 支持的支付方式
recharge_payment: [], // 支持的充值支付方式
share: { share: {
methods: [], // 支持的分享方式 methods: [], // 支持的分享方式
forwardInfo: {}, // 默认转发信息 forwardInfo: {}, // 默认转发信息