优化
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
import { get } from '@/utils/request';
|
||||
import { post } from '@/utils/request';
|
||||
|
||||
export const getGroupBuyList = (data: {
|
||||
pageNum: string,
|
||||
pageSize: string,
|
||||
pageNum: number,
|
||||
pageSize: number,
|
||||
obj: {
|
||||
companyId: string,
|
||||
status: number,
|
||||
}
|
||||
}) => get({ url: '/wc/coupons/group/pageList', data });
|
||||
}) => post({ url: '/group/coupons/wx_query', data });
|
||||
|
||||
|
@@ -12,7 +12,10 @@ enum URL {
|
||||
register = '/wc/wechat/register',
|
||||
uploadAvatar = '/wc/wechat/uploadImage',
|
||||
logout = '/user/logout',
|
||||
profile = '/user/profile',
|
||||
// profile = '/user/profile',
|
||||
profile = 'wc/wechat/member_detail',
|
||||
|
||||
// wc/wechat/member_detail
|
||||
addressList = '/ext/addr/list',
|
||||
addressDetail = '/ext/addr/find',
|
||||
addressCreate = '/ext/addr/create',
|
||||
@@ -20,6 +23,7 @@ enum URL {
|
||||
addressDelete = '/ext/addr/delete',
|
||||
dynamicCode = '/member/dynccode',
|
||||
rechargeList = '/ext/recharge/rule_config',
|
||||
recharge = '/memberIncoming/wx_save',
|
||||
couponList = '/wechat/coupons/coupons/pageList',
|
||||
integralList = '/ext/member/integral_query'
|
||||
}
|
||||
@@ -43,6 +47,8 @@ export const getDynamicCode = () => post<any>({ url: URL.dynamicCode });
|
||||
|
||||
export const getRechargeList = () => get<any>({ url: URL.rechargeList });
|
||||
|
||||
export const recharge = (data: any) => post({ url: URL.recharge, data });
|
||||
|
||||
export const getCouponList = (data: any) => post<any>({ url: URL.couponList, data });
|
||||
|
||||
export const getIntegralList =(data:any)=>post({url:URL.integralList, data})
|
||||
export const getIntegralList = (data: any) => get({ url: URL.integralList, data });
|
||||
|
@@ -6,16 +6,16 @@
|
||||
</view>
|
||||
|
||||
<scroll-view class='scroll-view'>
|
||||
<view class='c-flex-column' v-for='(item, index) in 10' :key='index'>
|
||||
<view class='c-flex-column' v-for='(item, index) in groupbuyList' :key='index'>
|
||||
<view class='item c-flex-row' @click.stop='goPath("/pages/common/groupbuy/detail")'>
|
||||
<image class='goods-image' :src='assetsUrl("test_bg.png")' />
|
||||
<image class='goods-image' :src='JSON.parse(item.content)[0].images' />
|
||||
<view class='c-flex-column' style='flex: 1'>
|
||||
<view class='goods-name'>女童夏装套装洋气装短袖阔腿裤短…</view>
|
||||
<view class='goods-name'>{{ item.name }}</view>
|
||||
<view class='middle-view c-flex-row'>
|
||||
<text>原价:¥56</text>
|
||||
<text>原价:¥{{ item.payPrice }}</text>
|
||||
<view class='decline c-flex-row'>
|
||||
<image :src='assetsUrl("ic_decline.png")' />
|
||||
<text>直降¥15</text>
|
||||
<text>直降¥{{ item.offsetPrice }}</text>
|
||||
</view>
|
||||
<text>即将恢复</text>
|
||||
</view>
|
||||
@@ -38,10 +38,26 @@ import { getGroupBuyList } from '@/api/groupbuy';
|
||||
import { goPath } from '@/utils';
|
||||
|
||||
const tabIndex = ref(0);
|
||||
const groupbuyList = ref([]);
|
||||
|
||||
onLoad((e) => {
|
||||
getGroupBuyList();
|
||||
fetchData();
|
||||
});
|
||||
|
||||
watch(() => tabIndex.value, () => {
|
||||
fetchData();
|
||||
});
|
||||
|
||||
const fetchData = async () => {
|
||||
const { list } = await getGroupBuyList({
|
||||
pageNum: 1,
|
||||
pageSize: 100,
|
||||
obj: {
|
||||
status: tabIndex.value
|
||||
}
|
||||
});
|
||||
groupbuyList.value = list;
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang='scss' scoped>
|
||||
|
@@ -55,7 +55,8 @@ onLoad(() => {
|
||||
});
|
||||
|
||||
const fetchCategoryList = async () => {
|
||||
categoryList.value = await getCategoryList();
|
||||
const list = await getCategoryList();
|
||||
categoryList.value.push(list);
|
||||
await changeCategory(0);
|
||||
};
|
||||
|
||||
@@ -78,11 +79,15 @@ const fetchGoodsList = async () => {
|
||||
goodsList.value = rows;
|
||||
};
|
||||
|
||||
const randomImageHeight = () => {
|
||||
// return Math.random() * 100 + 'rpx';
|
||||
return '300rpx';
|
||||
};
|
||||
|
||||
const addShoppingCart = (goodsBean: GoodsBean) => {
|
||||
shoppingCart.save({
|
||||
...goodsBean,
|
||||
name: goodsBean.goodsName,
|
||||
|
||||
count: 1
|
||||
});
|
||||
};
|
||||
|
@@ -3,7 +3,7 @@
|
||||
<view class='search-view'>
|
||||
<view class='search-input'>
|
||||
<image :src='assetsUrl("ic_search.png")' />
|
||||
<input placeholder='输入名称、款号搜索' />
|
||||
<input placeholder='输入名称、款号搜索' @input='bindInput' />
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
<image class='goods-image' :src='item.images' />
|
||||
<text class='goods-name'>{{ item.goodsName }}</text>
|
||||
<text class='goods-price'>¥{{ item.price }}</text>
|
||||
<image class='add-image' :src='assetsUrl("ic_add_goods.png")' />
|
||||
<image class='add-image' :src='assetsUrl("ic_add_goods.png")' @click.stop='addShoppingCart' />
|
||||
</view>
|
||||
</grid-view>
|
||||
</scroll-view>
|
||||
@@ -22,13 +22,37 @@
|
||||
</template>
|
||||
|
||||
<script lang='ts' setup>
|
||||
|
||||
import { assetsUrl } from '@/utils/assets';
|
||||
import { goPath } from '@/utils';
|
||||
|
||||
import { getGoodsList } from '@/api/goods';
|
||||
import useShoppingCartStore from '@/store/modules/shoppingcart';
|
||||
import { GoodsBean } from '@/api/goods/types';
|
||||
|
||||
const goodsList = ref<GoodsBean[]>([1, 2, 3, 4, 1, 2, 2, 2]);
|
||||
const shoppingCartStore = useShoppingCartStore();
|
||||
|
||||
const goodsList = ref<GoodsBean[]>([]);
|
||||
|
||||
onLoad((e) => {
|
||||
|
||||
});
|
||||
|
||||
const bindInput = async (e: any) => {
|
||||
const { rows } = await getGoodsList({
|
||||
page: {
|
||||
pageNum: 1,
|
||||
pageSize: 100,
|
||||
bean: {
|
||||
keyword: e.detail.value,
|
||||
typeIds: ['1724629185362591745']
|
||||
}
|
||||
}
|
||||
});
|
||||
goodsList.value = rows;
|
||||
};
|
||||
|
||||
const addShoppingCart = (item: GoodsBean) => {
|
||||
shoppingCartStore.save(item);
|
||||
};
|
||||
|
||||
</script>
|
||||
|
||||
@@ -72,13 +96,12 @@ const goodsList = ref<GoodsBean[]>([1, 2, 3, 4, 1, 2, 2, 2]);
|
||||
flex-direction: column;
|
||||
position: relative;
|
||||
padding: 10rpx 10rpx;
|
||||
background: #333333;
|
||||
flex: 1;
|
||||
|
||||
.goods-image {
|
||||
border-radius: 10rpx;
|
||||
width: 100%;
|
||||
max-height: 200rpx;
|
||||
max-height: 400rpx;
|
||||
}
|
||||
|
||||
.goods-name {
|
||||
|
@@ -45,7 +45,7 @@
|
||||
<view v-for='(item,index) in orderActionList' :key='index' @click.stop='gotoPath(item.path)'>
|
||||
<image :src='item.icon' />
|
||||
<text>{{ item.title }}</text>
|
||||
<text v-if='item.amount>0'>{{ item.amount }}</text>
|
||||
<text v-if='index==0&&userInfo.orderNum>0'>{{ userInfo.orderNum }}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -75,18 +75,15 @@ const officialAccountDialogRef = ref();
|
||||
const orderActionList = ref([{
|
||||
title: '进行中',
|
||||
icon: assetsUrl('ic_order_progressing.png'),
|
||||
path: '/pages/mine/subs/order/index',
|
||||
amount: 10
|
||||
path: '/pages/mine/subs/order/index'
|
||||
}, {
|
||||
title: '已结束',
|
||||
icon: assetsUrl('ic_order_finish.png'),
|
||||
path: '/pages/mine/subs/order/index?index=1',
|
||||
amount: 0
|
||||
path: '/pages/mine/subs/order/index?index=1'
|
||||
}, {
|
||||
title: '全部订单',
|
||||
icon: assetsUrl('ic_order_all.png'),
|
||||
path: '/pages/mine/subs/order/index?index=2',
|
||||
amount: 0
|
||||
path: '/pages/mine/subs/order/index?index=2'
|
||||
}]);
|
||||
|
||||
const serviceList = [
|
||||
|
@@ -25,7 +25,9 @@ onLoad((e) => {
|
||||
});
|
||||
|
||||
const fetchData = async () => {
|
||||
const { rows } = await getIntegralList({ 'pageNum': 1, 'pageSize': 10, 'bean': {} });
|
||||
const { rows } = await getIntegralList({
|
||||
fbean: { 'pageNum': 1, 'pageSize': 10, 'bean': {} }
|
||||
});
|
||||
tradeList.value = rows;
|
||||
};
|
||||
|
||||
|
@@ -65,6 +65,10 @@ const { userInfo } = storeToRefs(store);
|
||||
|
||||
const currentGender = ref<number>(0);
|
||||
|
||||
onLoad(() => {
|
||||
store.getProfile();
|
||||
});
|
||||
|
||||
const chooseAvatar = (e: any) => {
|
||||
uni.showLoading();
|
||||
uni.uploadFile({
|
||||
|
@@ -18,15 +18,16 @@
|
||||
<view class='divider' />
|
||||
<view class='option-item'>
|
||||
<image :src='assetsUrl("bg_member_recharge_item.png")' />
|
||||
<text>充值{{ rechargeItems[currentIndex].rechargeamount }}送{{ rechargeItems[currentIndex].rewardamount }}元</text>
|
||||
<text>充值{{ rechargeItems[currentIndex]?.rechargeamount }}送{{ rechargeItems[currentIndex]?.rewardamount }}元
|
||||
</text>
|
||||
<text class='accent-text-color'>
|
||||
实得{{ rechargeItems[currentIndex].rechargeamount + (rechargeItems[currentIndex].rewardamount) }}元
|
||||
实得{{ rechargeItems[currentIndex]?.rechargeamount + (rechargeItems[currentIndex]?.rewardamount) }}元
|
||||
</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class='bottom-button-view'>
|
||||
<button class='primary-button'>充值</button>
|
||||
<button class='primary-button' @click.stop='goRecharge'>充值</button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
@@ -34,22 +35,34 @@
|
||||
<script lang='ts' setup>
|
||||
import { assetsUrl } from '@/utils/assets';
|
||||
import { useUserStore } from '@/store';
|
||||
import { getRechargeList } from '@/api/user';
|
||||
import { getRechargeList, recharge } from '@/api/user';
|
||||
|
||||
const store = useUserStore();
|
||||
const { userInfo } = storeToRefs(store);
|
||||
|
||||
const rechargeItems = ref([]);
|
||||
const rechargeItems = ref<{
|
||||
itemid: string
|
||||
rechargeamount: number
|
||||
rewardamount: number
|
||||
rewardcouponamount: number,
|
||||
rechargetype: number
|
||||
}[]>([]);
|
||||
const currentIndex = ref<number>(0);
|
||||
|
||||
onLoad(async () => {
|
||||
const { rechargetype, ruleitems } = await getRechargeList();
|
||||
const { ruleitems } = await getRechargeList();
|
||||
rechargeItems.value = ruleitems;
|
||||
});
|
||||
|
||||
const change = (index: number) => {
|
||||
currentIndex.value = index;
|
||||
};
|
||||
|
||||
const goRecharge = () => {
|
||||
recharge({
|
||||
itemid: rechargeItems.value[currentIndex.value].itemid
|
||||
});
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang='scss' scoped>
|
||||
|
@@ -58,7 +58,7 @@ const useUserStore = defineStore('user', {
|
||||
this.$reset();
|
||||
},
|
||||
// 获取用户信息
|
||||
async info() {
|
||||
async getProfile() {
|
||||
const result = await getUserProfile();
|
||||
this.setUserInfo(result);
|
||||
},
|
||||
|
Reference in New Issue
Block a user