会员,充值,明细,下单问题修复

This commit is contained in:
2025-09-28 17:41:19 +08:00
parent a8c2096096
commit 4245c2be0d
13 changed files with 508 additions and 151 deletions

View File

@@ -7,7 +7,7 @@
</view>
<scroll-view scroll-x="true" class="u-m-t-20">
<view class="list">
<view class="item color1" @click="itemClick" v-for="(item,index) in list" :key="index"
<view class="item color1" @click="itemClick(index)" v-for="(item,index) in list" :key="index"
:class="{active:sel==index}">
<view class="">
<text></text>
@@ -26,9 +26,9 @@
</view>
<view class="font-12 color-666" v-if="item.couponInfoList.length">
<text></text>
<text>{{item.couponInfoList.length}}</text>
<text>{{couponNum(item.couponInfoList)}}</text>
<text>张券</text>
<text class="color2 u-m-l-8" v-if="sel==index">查看</text>
<text class="color2 u-m-l-8" v-if="sel==index" @click="lookCoupon(item)">查看</text>
</view>
<view class="sel u-flex" v-if="sel==index">
@@ -40,21 +40,39 @@
</scroll-view>
</view>
<view class="" v-else></view>
<CouponList v-model="couponModel.show" :list="couponModel.couponInfoList"></CouponList>
</view>
</template>
<script setup>
import CouponList from '@/components/coupon/list.vue'
import * as rechargeApi from '@/common/api/market/recharge.js'
import {
useCartsStore
} from '@/stores/carts.js';
const cartStore = useCartsStore()
import {
onMounted,
onMounted,reactive,
ref,
watch
} from 'vue';
const couponModel = reactive({
show: false,
couponInfoList: []
})
function lookCoupon(item) {
couponModel.couponInfoList = item.couponInfoList
couponModel.show = true
}
function couponNum(list) {
return list.reduce((prve, cur) => {
return prve + cur.num
}, 0)
}
const cartStore = useCartsStore()
const list = ref([])
const sel = ref(-1)
const isShow = ref(false)
@@ -82,19 +100,25 @@
updateSel()
}
})
const emits=defineEmits(['updateChargeSel','updateRechargeId'])
function updateSel(){
const selItem=list.value[sel.value]
emits('updateChargeSel',selItem?selItem:{})
emits('updateRechargeId',data.id)
}
function itemClick(index){
console.log('itemClick',sel.value,index);
if(sel.value==-1){
sel.value=index
return
}
if(sel.value==index){
sel.value=-1
return
}
sel.value=index
}
const emits=defineEmits(['updateChargeSel'])
watch(()=>sel.value,(newval)=>{
updateSel()
})
@@ -104,8 +128,14 @@
</script>
<style lang="scss" scoped>
.color1{
color: #5F2E0F;
}
.color2{
color: #FF6300;
}
.box {
background: linear-gradient(179.4deg, #f8eadc 0%, #fdf9f6 82%, #ffffff 100%);
background-color: #fdf9f6;
padding: 30rpx;
margin-top: 32rpx;
border-radius: 22rpx;
@@ -125,7 +155,7 @@
.item {
padding: 36rpx 22rpx;
border-radius: 42rpx;
background: linear-gradient(180deg, #F5F5F5 58.54%, #FFF 140.47%);
background: linear-gradient(180deg, #F5F5F5 58.54%, #FFF 104.47%);
display: flex;
flex-direction: column;
justify-content: center;