diff --git a/App.vue b/App.vue index a4374a1d..5b5b9866 100644 --- a/App.vue +++ b/App.vue @@ -21,7 +21,7 @@ if (args) { } - // 获取剪贴板 + // 获取剪贴板 uni.getClipboardData({ success: (res) => { }, }); diff --git a/pages/goods/list.vue b/pages/goods/list.vue index 19923d16..70584422 100644 --- a/pages/goods/list.vue +++ b/pages/goods/list.vue @@ -137,8 +137,8 @@ total: 1, last_page: 1, }, - currentSort: 'weigh', - currentOrder: 'desc', + // currentSort: 'weigh', + // currentOrder: 'desc', currentTab: 0, filterParams: {}, curFilter: 0, @@ -148,32 +148,32 @@ tabList: [ { name: '综合推荐', - value: 'weigh', + // value: '', list: [ { label: '综合推荐', - sort: 'weigh', - order: 'desc', + // sort: '', + // order: true, }, { label: '价格升序', sort: 'price', - order: 'asc', + order: true, }, { label: '价格降序', sort: 'price', - order: 'desc', + order: false, }, ], }, { name: '销量', - value: 'total_sales', + // value: 'salesCount', }, { name: '新品优先', - value: 'create_time', + // value: 'create_time', }, ], loadStatus: '', @@ -239,6 +239,7 @@ // 点击筛选项 const onFilterItem = (val) => { + console.log(val) if ( state.currentSort === state.tabList[0].list[val].sort && state.currentOrder === state.tabList[0].list[val].order @@ -258,8 +259,8 @@ async function getList(Sort, Order, categoryId, keyword, page = 1, list_rows = 6) { state.loadStatus = 'loading'; const res = await sheep.$api.goods.list({ - sort: Sort, - order: Order, + sortField: Sort, + sortAsc: Order, category_id: !keyword ? categoryId : '', pageSize:list_rows, keyword: keyword, diff --git a/pages/index/category.vue b/pages/index/category.vue index e6e049e9..4ed73b80 100644 --- a/pages/index/category.vue +++ b/pages/index/category.vue @@ -82,7 +82,8 @@ }); if (code === 0) { state.categoryList = { - children: data + children: data, + style: 'first_one' }; } } @@ -96,17 +97,18 @@ total: 1, last_page: 1, }; + getGoodsList(state.categoryList.children[val].id); } // 这段代码本来是在判断里的 - getGoodsList(state.categoryList.children[val].id); + // getGoodsList(state.categoryList.children[val].id); }; async function getGoodsList(id, page = 1, list_rows = 6) { state.loadStatus = 'loading'; const res = await sheep.$api.goods.list({ categoryId: id, - pageSize:list_rows, - pageNo:page, + pageSize: list_rows, + pageNo: page, }); if (res.code === 0) { let couponList = _.concat(state.pagination.data, res.data.list); diff --git a/pages/index/index.vue b/pages/index/index.vue index 41567d99..0384949f 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -27,11 +27,19 @@ uni.hideTabBar(); const template = computed(() => sheep.$store('app').template?.home); - // 在此处拦截改变一下首页轮播图 此处先写死后期复活 + + // 在此处拦截改变一下首页轮播图 此处先写死后期复活 放到启动函数里 (async function() { + console.log('原代码首页定制化数据',template) let { data } = await index2Api.decorate(); + console.log('首页导航配置化过高无法兼容',JSON.parse(data[1].value)) + // 改变首页底部数据 但是没有通过数组id获取商品数据接口 + // let { + // data: datas + // } = await index2Api.spids(); + // template.value.data[9].data.goodsIds = datas.list.map(item => item.id); template.value.data[0].data.list = JSON.parse(data[0].value).map(item => { return { src: item.picUrl, diff --git a/pages/user/goods-collect.vue b/pages/user/goods-collect.vue index 2af9b219..178d5d24 100644 --- a/pages/user/goods-collect.vue +++ b/pages/user/goods-collect.vue @@ -131,7 +131,7 @@ pageNo:page, }); if (res.code === 0) { - console.log(res) + console.log('yudao收藏列表',res) let orderList = _.concat(state.pagination.data, res.data.list); state.pagination = { ...res.data, diff --git a/pages/user/info.vue b/pages/user/info.vue index eb37bb6d..b6251178 100644 --- a/pages/user/info.vue +++ b/pages/user/info.vue @@ -36,7 +36,7 @@ - + - + - - - - - - 钱包余额(元) - - - - {{ state.showMoney ? userInfo.money : '*****' }} - - - - + + + + + + 钱包余额(元) + + + + {{ state.showMoney ? userInfo.money : '*****' }} + + + + - - - - - - + + + + - - 总收入¥{{ state.pagination.income.toFixed(2) }} - 总支出¥{{ (-state.pagination.expense).toFixed(2) }} - - - - - - - - - - - {{ item.event_text }}{{ item.memo ? '-' + item.memo : '' }} - - +{{ item.amount }} - {{ item.amount }} - - - {{ item.create_time }} - - - - + + 总收入¥{{ }} + 总支出¥{{ }} + + + + + + + + + + + + + {{ item.title }} + + +{{ item.amount||item.price }} + {{ item.price }} + + + {{ item.createTime }} + + + + - + }" /> + + .add { + color: var(--ui-BG-Main); + } + + .minus { + color: $dark-3; + } + } + } + \ No newline at end of file diff --git a/sheep/api/index2.js b/sheep/api/index2.js index 60fa605a..1c068bf8 100644 --- a/sheep/api/index2.js +++ b/sheep/api/index2.js @@ -6,4 +6,9 @@ export default { url: 'promotion/decorate/list?page=1', method: 'GET', }), + spids: () => + request2({ + url: 'product/spu/page?recommendType=best&pageNo=1&pageSize=10', + method: 'GET', + }), }; diff --git a/sheep/api/user.js b/sheep/api/user.js index 8a258b17..3f16f237 100644 --- a/sheep/api/user.js +++ b/sheep/api/user.js @@ -12,6 +12,15 @@ export default { auth: true, }, }), + balance: () => + request2({ + url: '/app-api/pay/wallet/get', + method: 'GET', + custom: { + showLoading: false, + auth: true, + }, + }), // profile: () => // request({ // url: '/user/api/user/profile', @@ -316,7 +325,8 @@ export default { url: 'product/favorite/delete-list', method: 'DELETE', data: { - spuIds: id.split(','), + spuIds: id.split(',').map(item=>item*1), + // spuIds: id.split(',').join(','), }, custom: { showSuccess: true, @@ -356,12 +366,19 @@ export default { }, wallet: { log: (params) => - request({ - url: '/user/api/walletLog', + request2({ + url: 'pay/wallet-transaction/page', method: 'GET', params, custom: {}, }), + // log: (params) => + // request({ + // url: '/user/api/walletLog', + // method: 'GET', + // params, + // custom: {}, + // }), }, account: { info: (params) => diff --git a/sheep/components/s-goods-column/s-goods-column.vue b/sheep/components/s-goods-column/s-goods-column.vue index 80f10c55..31559cb2 100644 --- a/sheep/components/s-goods-column/s-goods-column.vue +++ b/sheep/components/s-goods-column/s-goods-column.vue @@ -65,7 +65,7 @@ - + - {{ data.title }} + {{ data.title||data.name }} {{ priceUnit }} - {{ data.original_price }} + {{ data.original_price||data.marketPrice }} @@ -141,7 +141,7 @@ 拼团 - + - {{ data.title }} + {{ data.title||data.name }} {{ priceUnit }} - {{ data.original_price }} + {{ data.original_price||data.marketPrice }} @@ -204,7 +204,7 @@ - + @@ -213,7 +213,7 @@ class="sl-goods-title ss-line-1" :style="[{ color: titleColor }]" > - {{ data.title }} + {{ data.title||data.name }} {{ priceUnit }} - {{ data.original_price }} + {{ data.original_price||data.marketPrice }} @@ -313,6 +313,7 @@ original_price: { show: true }, sales: { show: true }, stock: { show: true }, + salesCount: { show: true }, }; }, }, @@ -396,8 +397,8 @@ // 格式化销量、库存信息 const salesAndStock = computed(() => { let text = []; - if (props.goodsFields.sales?.show) { - text.push(formatSales(props.data.sales_show_type, props.data.sales)); + if (props.goodsFields.salesCount?.show) { + text.push(formatSales(props.data.sales_show_type, props.data.salesCount)); } if (props.goodsFields.stock?.show) { text.push(formatStock(props.data.stock_show_type, props.data.stock)); diff --git a/sheep/components/s-order-card/s-order-card.vue b/sheep/components/s-order-card/s-order-card.vue index e49c7270..8ed36473 100644 --- a/sheep/components/s-order-card/s-order-card.vue +++ b/sheep/components/s-order-card/s-order-card.vue @@ -64,7 +64,7 @@ ]; const numData = computed(() => sheep.$store('user').numData); - console.log(numData) + console.log('更换后的yuda订单数量',numData)