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 50ea8101..d9ece7bb 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -26,6 +26,28 @@ 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, + url: item.url, + title: item.name, + type: "image" + } + }) + }()) + onLoad((options) => { // #ifdef MP diff --git a/pages/order/list.vue b/pages/order/list.vue index 7e57bb1f..5cb1607d 100644 --- a/pages/order/list.vue +++ b/pages/order/list.vue @@ -1,121 +1,85 @@ + .add { + color: var(--ui-BG-Main); + } + + .minus { + color: $dark-3; + } + } + } + \ No newline at end of file diff --git a/sheep/api/app.js b/sheep/api/app.js index 7099047c..2bb92c6c 100644 --- a/sheep/api/app.js +++ b/sheep/api/app.js @@ -107,16 +107,20 @@ export default { title: '上传中', }); return new Promise((resolve, reject) => { + // 此处先换成yudao uni.uploadFile({ - url: baseUrl + '/file/api/upload', + url: 'http://api-dashboard.yudao.iocoder.cn' + '/app-api/infra/file/upload', filePath: file, name: 'file', formData: { group, }, header: { - Accept: 'text/json', - Authorization: token, + // Accept: 'text/json', + // Authorization: token, + Accept : '*/*', + 'tenant-id' :'1', + Authorization: 'Bearer test247', }, success: (uploadFileRes) => { let result = JSON.parse(uploadFileRes.data); diff --git a/sheep/api/data.js b/sheep/api/data.js index 0863a85d..6a5b08b1 100644 --- a/sheep/api/data.js +++ b/sheep/api/data.js @@ -1,11 +1,17 @@ import request from '@/sheep/request'; +import request2 from '@/sheep/request2'; export default { area: () => - request({ - url: 'data/area', + request2({ + url: 'system/area/tree', method: 'GET', }), + // area: () => + // request({ + // url: 'data/area', + // method: 'GET', + // }), faq: () => request({ url: 'data/faq', 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/order.js b/sheep/api/order.js index 48ba737d..acb16418 100644 --- a/sheep/api/order.js +++ b/sheep/api/order.js @@ -1,4 +1,5 @@ import request from '@/sheep/request'; +import request2 from '@/sheep/request2'; export default { // 订单详情 @@ -33,14 +34,23 @@ export default { }), // 订单列表 list: (params) => - request({ - url: 'order/order', + request2({ + url: 'trade/order/page', method: 'GET', params, custom: { showLoading: false, }, }), + // list: (params) => + // request({ + // url: 'order/order', + // method: 'GET', + // params, + // custom: { + // showLoading: false, + // }, + // }), // 计算订单信息 calc: (data) => request({ diff --git a/sheep/api/user.js b/sheep/api/user.js index 5cd9ae77..3f16f237 100644 --- a/sheep/api/user.js +++ b/sheep/api/user.js @@ -1,331 +1,433 @@ import request from '@/sheep/request'; +import request2 from '@/sheep/request2'; import $platform from '@/sheep/platform'; export default { - profile: () => - request({ - url: '/user/api/user/profile', - method: 'GET', - custom: { - showLoading: false, - auth: true, - }, - }), - update: (data) => - request({ - url: '/user/api/user/update', - method: 'POST', - custom: { - showSuccess: true, - auth: true, - }, - data, - }), - // 账号登录 - accountLogin: (data) => - request({ - url: '/user/api/user/accountLogin', - method: 'POST', - data, - custom: { - showSuccess: true, - loadingMsg: '登录中', - }, - }), - // 短信登录 - smsLogin: (data) => - request({ - url: '/user/api/user/smsLogin', - method: 'POST', - data, - custom: { - showSuccess: true, - loadingMsg: '登录中', - }, - }), - // 短信注册 - smsRegister: (data) => - request({ - url: '/user/api/user/smsRegister', - method: 'POST', - data, - custom: { - showSuccess: true, - loadingMsg: '正在注册', - }, - }), - // 重置密码 - resetPassword: (data) => - request({ - url: '/user/api/user/resetPassword', - method: 'POST', - data, - custom: { - showSuccess: true, - loadingMsg: '验证中', - }, - }), + profile: () => + request2({ + url: 'member/user/get', + method: 'GET', + custom: { + showLoading: false, + auth: true, + }, + }), + balance: () => + request2({ + url: '/app-api/pay/wallet/get', + method: 'GET', + custom: { + showLoading: false, + auth: true, + }, + }), + // profile: () => + // request({ + // url: '/user/api/user/profile', + // method: 'GET', + // custom: { + // showLoading: false, + // auth: true, + // }, + // }), + // update: (data) => + // request({ + // url: '/user/api/user/update', + // method: 'POST', + // custom: { + // showSuccess: true, + // auth: true, + // }, + // data, + // }), + update: (data) => + request2({ + url: 'member/user/update', + method: 'PUT', + custom: { + showSuccess: true, + auth: true, + }, + data, + }), + // 账号登录 + accountLogin: (data) => + request({ + url: '/user/api/user/accountLogin', + method: 'POST', + data, + custom: { + showSuccess: true, + loadingMsg: '登录中', + }, + }), + // 短信登录 + smsLogin: (data) => + request({ + url: '/user/api/user/smsLogin', + method: 'POST', + data, + custom: { + showSuccess: true, + loadingMsg: '登录中', + }, + }), + // 短信注册 + smsRegister: (data) => + request({ + url: '/user/api/user/smsRegister', + method: 'POST', + data, + custom: { + showSuccess: true, + loadingMsg: '正在注册', + }, + }), + // 重置密码 + resetPassword: (data) => + request({ + url: '/user/api/user/resetPassword', + method: 'POST', + data, + custom: { + showSuccess: true, + loadingMsg: '验证中', + }, + }), - // 修改密码 - changePassword: (data) => - request({ - url: '/user/api/user/changePassword', - method: 'POST', - data, - custom: { - showSuccess: true, - loadingMsg: '验证中', - }, - }), + // 修改密码 + changePassword: (data) => + request({ + url: '/user/api/user/changePassword', + method: 'POST', + data, + custom: { + showSuccess: true, + loadingMsg: '验证中', + }, + }), - // 绑定、更换手机号 - changeMobile: (data) => - request({ - url: '/user/api/user/changeMobile', - method: 'POST', - data, - custom: { - showSuccess: true, - loadingMsg: '验证中', - }, - }), + // 绑定、更换手机号 + changeMobile: (data) => + request({ + url: '/user/api/user/changeMobile', + method: 'POST', + data, + custom: { + showSuccess: true, + loadingMsg: '验证中', + }, + }), - // 修改用户名 - changeUsername: (data) => - request({ - url: '/user/api/user/changeUsername', - method: 'POST', - data, - custom: { - showSuccess: true, - loadingMsg: '验证中', - }, - }), + // 修改用户名 + changeUsername: (data) => + request({ + url: '/user/api/user/changeUsername', + method: 'POST', + data, + custom: { + showSuccess: true, + loadingMsg: '验证中', + }, + }), - // 更新小程序信息 - updateMpUserInfo: (data) => - request({ - url: '/user/api/user/updateMpUserInfo', - method: 'POST', - data, - }), + // 更新小程序信息 + updateMpUserInfo: (data) => + request({ + url: '/user/api/user/updateMpUserInfo', + method: 'POST', + data, + }), - // 第三方授权信息 - thirdOauthInfo: () => - request({ - url: '/user/api/user/thirdOauth', - method: 'GET', - params: { - provider: $platform.provider, - platform: $platform.platform, - }, - custom: { - showLoading: false, - }, - }), + // 第三方授权信息 + thirdOauthInfo: () => + request({ + url: '/user/api/user/thirdOauth', + method: 'GET', + params: { + provider: $platform.provider, + platform: $platform.platform, + }, + custom: { + showLoading: false, + }, + }), - // 添加分享记录 - addShareLog: (data) => - request({ - url: 'share/add', - method: 'POST', - data, - custom: { - showError: false, - }, - }), - share: { - list: (params) => - request({ - url: 'share/list', - method: 'GET', - params, - }), - }, - // 账号登出 - logout: (data) => - request({ - url: '/user/api/user/logout', - method: 'POST', - data, - }), - // 账号注销 - logoff: (data) => - request({ - url: '/user/api/user/logoff', - method: 'POST', - data, - }), + // 添加分享记录 + addShareLog: (data) => + request({ + url: 'share/add', + method: 'POST', + data, + custom: { + showError: false, + }, + }), + share: { + list: (params) => + request({ + url: 'share/list', + method: 'GET', + params, + }), + }, + // 账号登出 + logout: (data) => + request({ + url: '/user/api/user/logout', + method: 'POST', + data, + }), + // 账号注销 + logoff: (data) => + request({ + url: '/user/api/user/logoff', + method: 'POST', + data, + }), - address: { - default: () => - request({ - url: 'user/address/default', - method: 'GET', - custom: { - showError: false, - }, - }), - list: () => - request({ - url: 'user/address', - method: 'GET', - custom: {}, - }), - create: (data) => - request({ - url: 'user/address', - method: 'POST', - data, - custom: { - showSuccess: true, - }, - }), - update: (id, data) => - request({ - url: 'user/address/' + id, - method: 'PUT', - data, - custom: { - showSuccess: true, - }, - }), - detail: (id) => - request({ - url: 'user/address/' + id, - method: 'GET', - }), - delete: (id) => - request({ - url: 'user/address/' + id, - method: 'DELETE', - }), - }, - invoice: { - list: () => - request({ - url: 'user/invoice', - method: 'GET', - custom: {}, - }), - create: (data) => - request({ - url: 'user/invoice', - method: 'POST', - data, - custom: { - showSuccess: true, - }, - }), - update: (id, data) => - request({ - url: 'user/invoice/' + id, - method: 'PUT', - data, - custom: { - showSuccess: true, - }, - }), - detail: (id) => - request({ - url: 'user/invoice/' + id, - method: 'GET', - }), - delete: (id) => - request({ - url: 'user/invoice/' + id, - method: 'DELETE', - }), - }, - favorite: { - list: (params) => - request({ - url: 'user/goodsLog/favorite', - method: 'GET', - params, - }), - do: (id) => - request({ - url: 'user/goodsLog/favorite', - method: 'POST', - data: { - goods_id: id, - }, - custom: { - showSuccess: true, - auth: true, - }, - }), - cancel: (id) => - request({ - url: 'user/goodsLog/favorite', - method: 'POST', - data: { - goods_ids: id, - }, - custom: { - showSuccess: true, - auth: true, - }, - }), - }, - view: { - list: (params) => - request({ - url: 'user/goodsLog/views', - method: 'GET', - params, - custom: {}, - }), - delete: (data) => - request({ - url: 'user/goodsLog/viewDel', - method: 'DELETE', - data, - custom: { - showSuccess: true, - }, - }), - }, - wallet: { - log: (params) => - request({ - url: '/user/api/walletLog', - method: 'GET', - params, - custom: {}, - }), - }, - account: { - info: (params) => - request({ - url: 'user/account', - method: 'GET', - params, - custom: { - showError: false, - auth: true, - }, - }), - save: (data) => - request({ - url: 'user/account', - method: 'POST', - data, - custom: { - showSuccess: true, - auth: true, - }, - }), - }, - //数量接口 - data: () => - request({ - url: 'user/user/data', - method: 'GET', - custom: { - showLoading: false, - auth: true, - }, - }), -}; + address: { + default: () => + request({ + url: 'user/address/default', + method: 'GET', + custom: { + showError: false, + }, + }), + list: () => + request2({ + url: 'member/address/list', + method: 'GET', + custom: {}, + }), + // list: () => + // request({ + // url: 'user/address', + // method: 'GET', + // custom: {}, + // }), + create: (data) => + request2({ + url: 'member/address/create', + method: 'POST', + data, + custom: { + showSuccess: true, + }, + }), + // create: (data) => + // request({ + // url: 'user/address', + // method: 'POST', + // data, + // custom: { + // showSuccess: true, + // }, + // }), + update: ( data) => + request2({ + url: 'member/address/update', + method: 'PUT', + data, + custom: { + showSuccess: true, + }, + }), + // update: (id, data) => + // request({ + // url: 'user/address/' + id, + // method: 'PUT', + // data, + // custom: { + // showSuccess: true, + // }, + // }), + detail: (id) => + request2({ + url: 'member/address/get?id=' + id, + method: 'GET', + }), + // detail: (id) => + // request({ + // url: 'user/address/' + id, + // method: 'GET', + // }), + delete: (id) => + request2({ + url: 'member/address/delete?id=' + id, + method: 'DELETE', + }), + // delete: (id) => + // request({ + // url: 'user/address/' + id, + // method: 'DELETE', + // }), + }, + invoice: { + list: () => + request({ + url: 'user/invoice', + method: 'GET', + custom: {}, + }), + create: (data) => + request({ + url: 'user/invoice', + method: 'POST', + data, + custom: { + showSuccess: true, + }, + }), + update: (id, data) => + request({ + url: 'user/invoice/' + id, + method: 'PUT', + data, + custom: { + showSuccess: true, + }, + }), + detail: (id) => + request({ + url: 'user/invoice/' + id, + method: 'GET', + }), + delete: (id) => + request({ + url: 'user/invoice/' + id, + method: 'DELETE', + }), + }, + favorite: { + list: (params) => + request2({ + url: 'product/favorite/page', + method: 'GET', + params, + }), + do: (id) => + request({ + url: 'user/goodsLog/favorite', + method: 'POST', + data: { + goods_id: id, + }, + custom: { + showSuccess: true, + auth: true, + }, + }), + // 取消收藏 + cancel: (id) => + request2({ + url: 'product/favorite/delete-list', + method: 'DELETE', + data: { + spuIds: id.split(',').map(item=>item*1), + // spuIds: id.split(',').join(','), + }, + custom: { + showSuccess: true, + auth: true, + }, + }), + // cancel: (id) => + // request({ + // url: 'user/goodsLog/favorite', + // method: 'POST', + // data: { + // goods_ids: id, + // }, + // custom: { + // showSuccess: true, + // auth: true, + // }, + // }), + }, + view: { + list: (params) => + request({ + url: 'user/goodsLog/views', + method: 'GET', + params, + custom: {}, + }), + delete: (data) => + request({ + url: 'user/goodsLog/viewDel', + method: 'DELETE', + data, + custom: { + showSuccess: true, + }, + }), + }, + wallet: { + log: (params) => + request2({ + url: 'pay/wallet-transaction/page', + method: 'GET', + params, + custom: {}, + }), + // log: (params) => + // request({ + // url: '/user/api/walletLog', + // method: 'GET', + // params, + // custom: {}, + // }), + }, + account: { + info: (params) => + request({ + url: 'user/account', + method: 'GET', + params, + custom: { + showError: false, + auth: true, + }, + }), + save: (data) => + request({ + url: 'user/account', + method: 'POST', + data, + custom: { + showSuccess: true, + auth: true, + }, + }), + }, + //数量接口 + // data: () => + // request({ + // url: 'user/user/data', + // method: 'GET', + // custom: { + // showLoading: false, + // auth: true, + // }, + // }), + data: () => + request2({ + url: 'trade/order/get-count', + method: 'GET', + custom: { + showLoading: false, + auth: true, + }, + }), + data2: () => + request2({ + url: 'trade/after-sale/get-applying-count', + method: 'GET', + custom: { + showLoading: false, + auth: true, + }, + }), +}; \ No newline at end of file diff --git a/sheep/components/s-address-item/s-address-item.vue b/sheep/components/s-address-item/s-address-item.vue index cdb2d8c5..37c2a9aa 100644 --- a/sheep/components/s-address-item/s-address-item.vue +++ b/sheep/components/s-address-item/s-address-item.vue @@ -9,13 +9,14 @@ class="ss-m-r-10" size="small" custom-style="background-color: var(--ui-BG-Main); border-color: var(--ui-BG-Main); color: #fff;" - v-if="props.item.is_default" + v-if="props.item.defaultStatus" text="默认" > - {{ props.item.province_name }} {{ props.item.city_name }} {{ props.item.district_name }} + {{ props.item.areaName }} + - {{ props.item.address }} - {{ props.item.consignee }} {{ props.item.mobile }} + {{ props.item.detailAddress }} + {{ props.item.name }} {{ props.item.mobile }} 请选择收货地址 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 66f80722..8ed36473 100644 --- a/sheep/components/s-order-card/s-order-card.vue +++ b/sheep/components/s-order-card/s-order-card.vue @@ -64,6 +64,7 @@ ]; const numData = computed(() => sheep.$store('user').numData); + console.log('更换后的yuda订单数量',numData)