积分接口联调
This commit is contained in:
@@ -65,20 +65,25 @@ const changeCategory = async (index: number) => {
|
||||
};
|
||||
|
||||
const fetchGoodsList = async () => {
|
||||
const data = await getGoodsList({
|
||||
pageNum: 1,
|
||||
pageSize: 20,
|
||||
bean: {
|
||||
keyword: '',
|
||||
typeIds: [categoryList.value[categorySelectedIndex.value].typeId]
|
||||
const { rows } = await getGoodsList({
|
||||
page: {
|
||||
pageNum: 1,
|
||||
pageSize: 100,
|
||||
bean: {
|
||||
keyword: '',
|
||||
typeIds: [categoryList.value[categorySelectedIndex.value].typeId]
|
||||
}
|
||||
}
|
||||
});
|
||||
goodsList.value = data.rows;
|
||||
goodsList.value = rows;
|
||||
};
|
||||
|
||||
const addShoppingCart = (goodsBean: GoodsBean) => {
|
||||
shoppingCart.save({
|
||||
...goodsBean
|
||||
...goodsBean,
|
||||
name: goodsBean.goodsName,
|
||||
|
||||
count: 1
|
||||
});
|
||||
};
|
||||
</script>
|
||||
|
@@ -116,11 +116,13 @@ const swiperIndex = ref(0);
|
||||
onLoad(async (e: any) => {
|
||||
goodsBean.value = await getGoodsDetail(e.goodsId);
|
||||
const { rows } = await getGoodsList({
|
||||
page: 1,
|
||||
pageSize: 10,
|
||||
bean: {
|
||||
keyword: '',
|
||||
typeIds: ['1724629185362591745']
|
||||
page: {
|
||||
page: 1,
|
||||
pageSize: 20,
|
||||
bean: {
|
||||
keyword: '',
|
||||
typeIds: ['1724629185362591745']
|
||||
}
|
||||
}
|
||||
});
|
||||
recommendList.value = rows;
|
||||
@@ -146,7 +148,8 @@ const addShoppingCart = () => {
|
||||
shoppingCart.save(
|
||||
{
|
||||
...goodsBean.value,
|
||||
...skuBean.value
|
||||
...skuBean.value,
|
||||
count: 1
|
||||
}
|
||||
);
|
||||
showToast('加入购物车成功');
|
||||
|
@@ -11,12 +11,12 @@
|
||||
<image v-show='isEditMode' class='checkbox' :src='assetsUrl("ic_checkbox_active_red.png")' />
|
||||
<image class='goods-image' :src='item.images' />
|
||||
<view class='c-flex-column'>
|
||||
<text>{{item.name}}</text>
|
||||
<text>{{ item.name }}</text>
|
||||
<view class='sku-view'>
|
||||
<text>紫色,120cm x1</text>
|
||||
<text>{{ item?.colorName }},{{ item?.sizeName }} x{{ item?.count }}</text>
|
||||
<image :src='assetsUrl("ic_arrow_down_gray.png")' />
|
||||
</view>
|
||||
<text>¥{{item.price}}</text>
|
||||
<text style='margin-top: 50rpx'>¥{{ item.price }}</text>
|
||||
<view class='count-change-view c-flex-row'>
|
||||
<view class='count-image' @click.stop='countChange(false)'>
|
||||
<image :src='assetsUrl("ic_reduce.png")' />
|
||||
@@ -57,8 +57,6 @@ const checkedAll = ref(false);
|
||||
const shoppingCart = useShoppingCartStore();
|
||||
const { shoppingCartList } = storeToRefs(shoppingCart);
|
||||
|
||||
// const goodsCount = ref(1);
|
||||
|
||||
const countChange = (isPlus: Boolean) => {
|
||||
|
||||
};
|
||||
|
@@ -1,23 +1,25 @@
|
||||
<template>
|
||||
<view class='card-view'>
|
||||
<text class='category-title'>2023-02-12</text>
|
||||
<view class='item c-flex-column' v-for='(item,index) in 3' :key='index'>
|
||||
<!-- <text class='category-title'>2023-02-12</text>-->
|
||||
<!-- <view class='item c-flex-column' v-for='(item,index) in 3' :key='index'>-->
|
||||
<view class='c-flex-row'>
|
||||
<text class='primary-text-color' style='flex: 1'>消费</text>
|
||||
<text class='accent-text-color'>-30</text>
|
||||
<text class='primary-text-color' style='flex: 1'>{{item?.remark}}</text>
|
||||
<text class='accent-text-color'>{{item?.value}}</text>
|
||||
</view>
|
||||
<view class='c-flex-row'>
|
||||
<text class='secondary-text-color' style='flex: 1'>2023-06-27 15:02:11</text>
|
||||
<text class='secondary-text-color' style='flex: 1'>{{ item?.createtime }}</text>
|
||||
<text style='color: #999999'>会员积分:¥30.00</text>
|
||||
</view>
|
||||
<view class='divider' style='margin-top: 20rpx'/>
|
||||
</view>
|
||||
<!-- </view>-->
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script lang='ts' setup>
|
||||
import { IntegralBean } from '@/api/user/types';
|
||||
|
||||
defineProps({
|
||||
item: Object
|
||||
item: Object as PropType<IntegralBean>
|
||||
});
|
||||
</script>
|
||||
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<view class='content'>
|
||||
<view class='top-view c-flex-column'>
|
||||
<text>2520</text>
|
||||
<text>{{ userInfo.integration }}</text>
|
||||
<text>会员积分</text>
|
||||
</view>
|
||||
<text class='integral-detail-title'>积分明细</text>
|
||||
@@ -12,9 +12,23 @@
|
||||
</template>
|
||||
|
||||
<script lang='ts' setup>
|
||||
import IntegralItem from '@/pages/mine/subs/integral/components/integral-item.vue';
|
||||
import IntegralItem from './components/integral-item.vue';
|
||||
import { getIntegralList } from '@/api/user';
|
||||
import { useUserStore } from '@/store';
|
||||
|
||||
const userStore = useUserStore();
|
||||
const { userInfo } = storeToRefs(userStore);
|
||||
const tradeList = ref([]);
|
||||
|
||||
onLoad((e) => {
|
||||
fetchData();
|
||||
});
|
||||
|
||||
const fetchData = async () => {
|
||||
const { rows } = await getIntegralList({ 'pageNum': 1, 'pageSize': 10, 'bean': {} });
|
||||
tradeList.value = rows;
|
||||
};
|
||||
|
||||
const tradeList = ref([1, 2, 3, 4, 5]);
|
||||
</script>
|
||||
|
||||
<style lang='scss' scoped>
|
||||
@@ -47,7 +61,7 @@ const tradeList = ref([1, 2, 3, 4, 5]);
|
||||
position: relative;
|
||||
}
|
||||
|
||||
scroll-view{
|
||||
scroll-view {
|
||||
width: auto;
|
||||
}
|
||||
</style>
|
||||
|
Reference in New Issue
Block a user