diff --git a/src/components/Cart.vue b/src/components/Cart.vue index efa49f1..cdd9747 100644 --- a/src/components/Cart.vue +++ b/src/components/Cart.vue @@ -15,6 +15,7 @@ interface CardList { number: string; price: number; exchange: number; + discount_integral: number; } const show = ref(false); @@ -38,7 +39,11 @@ const openModal = async () => { show.value = !show.value; }; -const add_cart = async (item: CardList, num: number = 1) => { +const add_cart = async ( + item: CardList, + num: number = 1, + bid: string = props.merInfo.bid, +) => { try { const res = await addCart({ Bid: item.bid, @@ -49,7 +54,7 @@ const add_cart = async (item: CardList, num: number = 1) => { title: res.msg, icon: 'none', }); - await get_cart_list(); + await get_cart_list(bid); } catch (e) { Taro.showToast({ title: e.msg, @@ -73,12 +78,13 @@ const cartInfo = ref({ count: 0, price: 0, exchange: 0, + discount_integral: 0, }); -const get_cart_list = async () => { +const get_cart_list = async (bid: string = props.merInfo.bid) => { try { const res = await getCart({ - Bid: props.merInfo.bid, + Bid: bid, }); card_list.value = res.data.data || []; @@ -86,11 +92,13 @@ const get_cart_list = async () => { count: 0, price: 0, exchange: 0, + discount_integral: 0, }; card_list.value.forEach((item: CardList) => { cartInfo.value.count += Number(item.number); cartInfo.value.price += Number(item.price); cartInfo.value.exchange += Number(item.exchange); + cartInfo.value.discount_integral += Number(item.discount_integral); }); emit('updateCart', res.data.data || []); } catch (e) { @@ -142,11 +150,10 @@ const create_order = async () => { url: `/pages/admin/add_order/pending_order/pending_order_detail/index?oid=${res.data.oid}&bid=${props.merInfo.bid}`, }); } else { - const mer_info = Taro.getStorageSync('mer_info'); const user_info = Taro.getStorageSync('userInfo'); const data = await getUserPoint({ phone: user_info.data.phone, - bid: mer_info.bid, + bid: props.merInfo.bid, }); res = await createActiveOrder({ Bid: [props.merInfo.bid], @@ -159,7 +166,7 @@ const create_order = async () => { }; // isShowPay.value = true; Taro.navigateTo({ - url: `/pages/goods/pay/index?oid=${res.data.oid}&bid=${mer_info.bid}&OrderType=1`, + url: `/pages/goods/pay/index?oid=${res.data.oid}&bid=${props.merInfo.bid}&OrderType=1`, }); } } @@ -199,16 +206,16 @@ defineExpose({ {{ cartInfo.count }} - + 总金额: {{ cartInfo.price.toFixed(2) }}元 ,总积分: {{ cartInfo.exchange.toFixed(2) }} + >,积分抵扣: {{ cartInfo.discount_integral.toFixed(2) }} + 去结算 + >去结算 + { .icon { display: inline-block; font-size: 30px; + width: 25px; + height: 25px; + margin-right: 10px; } .desc { diff --git a/src/components/Popup.vue b/src/components/Popup.vue index 0df305b..a45ca61 100644 --- a/src/components/Popup.vue +++ b/src/components/Popup.vue @@ -9,10 +9,10 @@ defineExpose({ }); const props = defineProps({ - src: { + imgArr: { required: true, - type: String, - default: '', + type: Array, + default: () => [], }, type: Number, cb: { @@ -21,13 +21,21 @@ const props = defineProps({ }, }); +const imgs = ref(props.imgArr); + const clickFn = type => { if (props.cb) props.cb(type); else isShow.value = false; }; +const closeFn = () => { + isShow.value = false; + imgs.value.shift(0); + if (imgs.value.length !== 0) isShow.value = true; +}; + Taro.useLoad(() => { - if (Taro.getStorageSync('token')) isShow.value = true; + isShow.value = true; }); @@ -40,12 +48,13 @@ Taro.useLoad(() => { + :src="imgs[0]" /> - + diff --git a/src/pages/admin/withdrawal/index.config.ts b/src/pages/admin/withdrawal/index.config.ts index 4ff3cca..793e3a6 100644 --- a/src/pages/admin/withdrawal/index.config.ts +++ b/src/pages/admin/withdrawal/index.config.ts @@ -1,4 +1,4 @@ export default definePageConfig({ - navigationBarTitleText: '收益提现', + navigationBarTitleText: '余额提现', enablePullDownRefresh: true, }); diff --git a/src/pages/admin/withdrawal/index.vue b/src/pages/admin/withdrawal/index.vue index 4cda95e..a9bc674 100644 --- a/src/pages/admin/withdrawal/index.vue +++ b/src/pages/admin/withdrawal/index.vue @@ -1,5 +1,5 @@