This commit is contained in:
2024-03-15 23:20:20 +08:00
parent 3ce85e2396
commit 351e20f0c0
19 changed files with 311 additions and 72 deletions

View File

@@ -25,7 +25,7 @@
<text>{{ userInfo.balance }}</text>
<text>余额</text>
</view>
<view @click.stop='gotoPath("/pages/mine/subs/coupon/coupon-list")'>
<view @click.stop='gotoPath("/pages/mine/subs/coupon/index")'>
<text>3</text>
<text>优惠券</text>
</view>
@@ -98,7 +98,7 @@ const serviceList = [
{
title: '消费记录',
icon: assetsUrl('ic_member_service_record.png'),
path: '/pages/mine/subs/trade/trade-list'
path: '/pages/mine/subs/trade/index'
},
{
title: '关注公众号',

View File

@@ -31,7 +31,7 @@
</view>
<view class='bottom-button-view'>
<button class='primary-button'>保存地址</button>
<button class='primary-button' @click.stop='save'>保存地址</button>
</view>
</view>
</template>
@@ -39,6 +39,26 @@
<script lang='ts' setup>
import { assetsUrl } from '@/utils/assets';
import { addressCreate } from '@/api/user';
const save = () => {
addressCreate(
{
bean: {
'name': '高昂',
'mobile': '15475655487',
'zonecode': '420101001001',
'addr': '肯德基挂',
'defaultstatus': 1
}
}
).then(() => {
uni.showToast({
title: '保存成功',
icon: 'none'
});
});
};
</script>
<style lang='scss' scoped>

View File

@@ -9,6 +9,10 @@
import CouponItem from './components/coupon-item.vue';
import { getCouponList } from '@/api/user';
import { useUserStore } from '@/store';
const store = useUserStore();
const { userInfo } = storeToRefs(store);
const coupons = ref([{
id: 1,
@@ -65,7 +69,7 @@ const coupons = ref([{
onLoad(async () => {
const { data } = await getCouponList({
obj: {
memberId: item?.id, status: 0
memberId: userInfo.value?.id, status: 0
}, pageNum: 1, pageSize: 1000
});
coupons.value = data.list;

View File

@@ -8,19 +8,19 @@
</view>
<view class='balance-content'>
<text>当前余额</text>
<text class='accent-text-color'>1</text>
<text class='accent-text-color'>{{ userInfo.balance }}</text>
</view>
</view>
<view class='recharge-option-card'>
<text>充值金额</text>
<tabbar :titles='rechargeItems?.map(res=>res.title)' @change='change' />
<tabbar :titles='rechargeItems?.map(res=>res.rechargeamount)' @change='change' />
<view class='divider' />
<view class='option-item'>
<image :src='assetsUrl("bg_member_recharge_item.png")' />
<text>充值{{ rechargeItems[currentIndex].title }}{{ rechargeItems[currentIndex].price / 10 }}</text>
<text>充值{{ rechargeItems[currentIndex].rechargeamount }}{{ rechargeItems[currentIndex].rewardamount }}</text>
<text class='accent-text-color'>
实得{{ rechargeItems[currentIndex].price + (rechargeItems[currentIndex].price / 10) }}
实得{{ rechargeItems[currentIndex].rechargeamount + (rechargeItems[currentIndex].rewardamount) }}
</text>
</view>
</view>
@@ -33,25 +33,20 @@
<script lang='ts' setup>
import { assetsUrl } from '@/utils/assets';
import { useUserStore } from '@/store';
import { getRechargeList } from '@/api/user';
const rechargeItems = ref([
{
title: '100元',
price: 100
},
{
title: '200元',
price: 200
},
{
title: '500元',
price: 500
}, {
title: '1000元',
price: 1000
}]);
const store = useUserStore();
const { userInfo } = storeToRefs(store);
const rechargeItems = ref([]);
const currentIndex = ref<number>(0);
onLoad(async () => {
const { rechargetype, ruleitems } = await getRechargeList();
rechargeItems.value = ruleitems;
});
const change = (index: number) => {
currentIndex.value = index;
};