diff --git a/.env b/.env deleted file mode 100644 index da303d9b861b5f7890bca4f3430116418f373a88..0000000000000000000000000000000000000000 --- a/.env +++ /dev/null @@ -1,20 +0,0 @@ -# 版本号 -SHOPRO_VERSION = v1.8.3 - -# 正式环境接口域名 -SHOPRO_BASE_URL = https://api.shopro.sheepjs.com - -# 开发环境接口域名 -SHOPRO_DEV_BASE_URL = https://api.shopro.sheepjs.com - -# 开发环境运行端口 -SHOPRO_DEV_PORT = 3000 - -# 接口地址前缀 -SHOPRO_API_PATH = /shop/api/ - -# 客户端静态资源地址 空=默认使用服务端指定的CDN资源地址前缀 | local=本地 | http(s)://xxx.xxx=自定义静态资源地址前缀 -SHOPRO_STATIC_URL = https://file.sheepjs.com - -# 是否开启直播 1 开启直播 | 0 关闭直播 (小程序官方后台未审核开通直播权限时请勿开启) -SHOPRO_MPLIVE_ON = 0 \ No newline at end of file diff --git a/LICENSE b/LICENSE index 4b611cc46a976fa3a18fc5f67c66375f09ac82e5..97996277b7dba2941afa877de9b29d926e8dbdbe 100644 --- a/LICENSE +++ b/LICENSE @@ -1,21 +1,21 @@ -MIT License - -Copyright (c) 2022 lidongtony - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. +MIT License + +Copyright (c) 2022 lidongtony + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/pages/coupon/list.vue b/pages/coupon/list.vue index 4bb02a0ea396a250a676c5693bd75af54de0c33a..6f13777abc596ff1b63610baa913317615ae4aca 100644 --- a/pages/coupon/list.vue +++ b/pages/coupon/list.vue @@ -148,11 +148,20 @@ }); if (res.code === 0) { // 拦截修改数据 + let obj2 = { + 2: '折扣', + 1: '满减' + } let obj = { 1: '可用', 2: '已用', 3: '过期' } + let obj3 = { + 1: '已领取', + 2: '已使用', + 3: '已过期' + } res.data.list = res.data.list.map(item => { return { ...item, @@ -160,7 +169,8 @@ amount: (item.discountPrice / 100).toFixed(2), use_start_time: sheep.$helper.timeFormat(item.validStartTime, 'yyyy-mm-dd hh:MM:ss'), use_end_time: sheep.$helper.timeFormat(item.validEndTime, 'yyyy-mm-dd hh:MM:ss'), - status_text: obj[item.status] + status_text: obj[item.status], + type_text: obj2[item.discountType] } }); if (page >= 2) { diff --git a/pages/goods/components/detail/detail-tabbar.vue b/pages/goods/components/detail/detail-tabbar.vue index aec21edeb6e8e8e8650e4908eec82b77c4a408df..dbd8dd18246d1956f281db4c820d0996de167422 100644 --- a/pages/goods/components/detail/detail-tabbar.vue +++ b/pages/goods/components/detail/detail-tabbar.vue @@ -1,171 +1,165 @@ + .item-icon { + width: 40rpx; + height: 40rpx; + } + + .item-title { + font-size: 20rpx; + font-weight: 500; + line-height: 20rpx; + margin-top: 12rpx; + } + } + } + \ No newline at end of file diff --git a/pages/goods/index.vue b/pages/goods/index.vue index 76f5a36970f1ad59ae07362d97f6498485c3e452..248028dc1eab8622c5d1309c4dc4d21c371904dc 100644 --- a/pages/goods/index.vue +++ b/pages/goods/index.vue @@ -12,9 +12,7 @@ - - + @@ -31,6 +29,8 @@ + +
@@ -39,8 +39,7 @@
- - + 领券 @@ -54,8 +53,8 @@ - + @tap="state.showSelectSku = true" /> + @@ -87,12 +86,13 @@ + + - - - - + + + + @@ -104,9 +104,16 @@ import { reactive, computed } from 'vue'; import { onLoad, onPageScroll } from '@dcloudio/uni-app'; import sheep from '@/sheep'; - import CouponApi from '@/sheep/api/promotion/coupon'; - import ActivityApi from '@/sheep/api/promotion/activity'; - import { formatSales, formatGoodsSwiper, fen2yuan, } from '@/sheep/hooks/useGoods'; + import CouponApi from '@/sheep/api/promotion/coupon'; + import ActivityApi from '@/sheep/api/promotion/activity'; + import { + formatSales, + formatGoodsSwiper, + fen2yuan, + } from '@/sheep/hooks/useGoods'; + import CouponApi from '@/sheep/api/promotion/coupon'; + import ActivityApi from '@/sheep/api/promotion/activity'; + import { formatSales, formatGoodsSwiper, fen2yuan, } from '@/sheep/hooks/useGoods'; import detailNavbar from './components/detail/detail-navbar.vue'; import detailCellSku from './components/detail/detail-cell-sku.vue'; import detailCellService from './components/detail/detail-cell-service.vue'; @@ -130,16 +137,17 @@ couponInfo: [], // 可领取的 Coupon 优惠劵的列表 showActivityModel: false, // 【满减送/限时折扣】是否展示 Activity 营销活动的弹窗 activityInfo: [], // 【满减送/限时折扣】可参与的 Activity 营销活动的列表 - activityList: [], // 【秒杀/拼团/砍价】可参与的 Activity 营销活动的列表 - }); + activityList: [], // 【秒杀/拼团/砍价】可参与的 Activity 营销活动的列表 + }); // 规格变更 function onSkuChange(e) { state.selectedSku = e; } - // 添加购物车 + // 添加购物车 TODO 芋艿:待测试 function onAddCart(e) { + console.log(e, '加入购物车'); sheep.$store('cart').add(e); } @@ -166,10 +174,10 @@ // 立即领取 TODO 芋艿:待测试 async function onGet(id) { const { - error, + code, msg } = await sheep.$api.coupon.get(id); - if (error === 0) { + if (code === 0) { uni.showToast({ title: msg, }); @@ -180,6 +188,7 @@ } // TODO 芋艿:待测试 + const shareInfo = computed(() => { if (isEmpty(state.goodsInfo)) return {}; return sheep.$platform.share.getShareInfo({ @@ -207,6 +216,75 @@ } state.goodsId = options.id; // 1. 加载商品信息 + sheep.$api.goods.detail(state.goodsId).then(async (res) => { + // 未找到商品 + if (res.code !== 0 || !res.data) { + state.goodsInfo = null; + return; + } + // 加载到商品 + state.skeletonLoading = false; + // 获取收藏信息 + let dasa = await sheep.$api.goods.exits(options.id); + res.data.favorite = dasa.data; + state.goodsInfo = res.data; + console.log(state.goodsInfo, '商品信息'); + + // 此处调试默认弹出可以修改为点击弹出 + // 2. 加载优惠劵信息 + CouponApi.getCouponTemplateList({ + price: state.goodsInfo.price, + spuIds: [state.goodsInfo.id], + skuIds: state.goodsInfo.skus.map(item => item.id), + // 先写死 + categoryIds: [52] + }).then((res) => { + console.log(res, '优惠券信息进行对接') + if (res.code !== 0) { + return; + } + // 拦截修改数据 + let obj2 = { + 2: '折扣', + 1: '满减' + } + let obj = { + 1: '可用', + 2: '已用', + 3: '过期' + } + let obj3 = { + 1: '已领取', + 2: '已使用', + 3: '已过期' + } + res.data = res.data.map(item => { + return { + ...item, + enough: (item.usePrice / 100).toFixed(2), + amount: (item.discountPrice / 100).toFixed(2), + use_start_time: sheep.$helper.timeFormat(item + .validStartTime, + 'yyyy-mm-dd hh:MM:ss'), + use_end_time: sheep.$helper.timeFormat(item.validEndTime, + 'yyyy-mm-dd hh:MM:ss'), + status_text: obj[item.status], + type_text: obj2[item.discountType], + get_status_text: obj3[item.status], + type_text: obj2[item.discountType] + } + }); + state.couponInfo = res.data; + }); + }); + // return; + // 3. 加载营销活动信息 + ActivityApi.getActivityListBySpuId(state.goodsId).then((res) => { + if (res.code !== 0) { + return; + } + state.activityList = res.data; + }); sheep.$api.goods.detail(state.goodsId).then((res) => { // 未找到商品 if (res.code !== 0 || !res.data) { diff --git a/pages/index/user.vue b/pages/index/user.vue index 37e6291be6889e167aa2b1f79577641a1782847c..fb194fc3f1e0ac2922989bf8a14b54e88b68f970 100644 --- a/pages/index/user.vue +++ b/pages/index/user.vue @@ -1,41 +1,42 @@ - + \ No newline at end of file diff --git a/sheep/api/cart.js b/sheep/api/cart.js index c89eadd9c6808b9d182627713c07748d1e6a4c28..d4421d0233965d5b91600a8798a01349c30293c7 100644 --- a/sheep/api/cart.js +++ b/sheep/api/cart.js @@ -1,10 +1,9 @@ import request from '@/sheep/request'; -import request2 from '@/sheep/request2'; export default { list: (data) => - request2({ - url: 'trade/cart/list', + request({ + url: '/app-api/trade/cart/list', method: 'GET', custom: { showLoading: false, @@ -13,7 +12,7 @@ export default { }), append: (data) => request({ - url: 'cart', + url: '/app-api/trade/cart/add', method: 'POST', // TODO 芋艿:这里没提示 custom: { @@ -22,18 +21,31 @@ export default { }, data: { ...data, - type: 'inc', + // type: 'inc', }, }), + // append: (data) => + // request({ + // url: 'cart', + // method: 'POST', + // custom: { + // showSuccess: true, + // successMsg: '已添加到购物车~', + // }, + // data: { + // ...data, + // type: 'inc', + // }, + // }), // 删除购物车 delete: (ids) => - request2({ - url: 'trade/cart/delete?ids=' + ids, + request({ + url: '/app-api/trade/cart/delete?ids=' + ids, method: 'DELETE', }), update: (data) => - request2({ - url: 'trade/cart/update-count', + request({ + url: '/app-api/trade/cart/update-count', method: 'PUT', data: { ...data, diff --git a/sheep/api/category.js b/sheep/api/category.js index 9c82506948fd4aa465030e41990e84e56cc4d2ef..f74c33274cb6908b39e6eba4449bf8f11436fae4 100644 --- a/sheep/api/category.js +++ b/sheep/api/category.js @@ -1,10 +1,8 @@ -import request2 from '@/sheep/request2'; - export default { - list: (params) => - request2({ - url: 'product/category/list', - method: 'GET', - params, - }), -}; + list: (params) => + request({ + url: '/app-api/product/category/list', + method: 'GET', + params, + }), +}; \ No newline at end of file diff --git a/sheep/api/coupon.js b/sheep/api/coupon.js index 3f5e8e6e2d6b9835dce5797ee516c99f058df177..a683df3abb7d4077c522443fca03315af388a141 100644 --- a/sheep/api/coupon.js +++ b/sheep/api/coupon.js @@ -1,5 +1,4 @@ import request from '@/sheep/request'; -import request2 from '@/sheep/request2'; export default { // 我的拼团 @@ -13,8 +12,8 @@ export default { }, }), userCoupon: (params) => - request2({ - url: 'promotion/coupon/page', + request({ + url: '/app-api/promotion/coupon/page', method: 'GET', params, }), @@ -34,9 +33,20 @@ export default { }), get: (id) => request({ - url: 'coupon/get/' + id, + url: '/app-api/promotion/coupon/take', method: 'POST', + data: { + templateId: id + }, + params: { + templateId: id + }, }), + // get: (id) => + // request({ + // url: 'coupon/get/' + id, + // method: 'POST', + // }), listByGoods: (id) => request({ url: 'coupon/listByGoods/' + id, diff --git a/sheep/api/data.js b/sheep/api/data.js index 6a5b08b1d918054730932eed1b9148933ad5a7f2..d1e38bb0ef5783c43311c5db7b888ad713bb43df 100644 --- a/sheep/api/data.js +++ b/sheep/api/data.js @@ -1,25 +1,24 @@ import request from '@/sheep/request'; -import request2 from '@/sheep/request2'; export default { - area: () => - request2({ - url: 'system/area/tree', - method: 'GET', - }), - // area: () => - // request({ - // url: 'data/area', - // method: 'GET', - // }), - faq: () => - request({ - url: 'data/faq', - method: 'GET', - }), - richtext: (id) => - request({ - url: 'data/richtext/' + id, - method: 'GET', - }), -}; + area: () => + request({ + url: '/app-api/system/area/tree', + method: 'GET', + }), + // area: () => + // request({ + // url: 'data/area', + // method: 'GET', + // }), + faq: () => + request({ + url: 'data/faq', + method: 'GET', + }), + richtext: (id) => + request({ + url: 'data/richtext/' + id, + method: 'GET', + }), +}; \ No newline at end of file diff --git a/sheep/api/goods.js b/sheep/api/goods.js index 61f422a6e5c28e4904f69b763acd466e8a8a6cfd..44cf714984cac2f0c03fe2966e43c0402be5dd87 100644 --- a/sheep/api/goods.js +++ b/sheep/api/goods.js @@ -1,80 +1,84 @@ import request from '@/sheep/request'; -import request2 from '@/sheep/request2'; export default { - // 商品详情 - detail: (id, params = {}) => - request2({ - url: 'product/spu/get-detail?id=' + id, - method: 'GET', - params, - custom: { - showLoading: false, - showError: false, - }, - }), + // 商品详情 + detail: (id, params = {}) => + request({ + url: '/app-api/product/spu/get-detail?id=' + id, + method: 'GET', + params, + custom: { + showLoading: false, + showError: false, + }, + }), - // 商品列表 - list: (params) => - request2({ - url: 'product/spu/page', - method: 'GET', - params, - custom: { - showLoading: false, - showError: false, - }, - }), + // 商品列表 + list: (params) => + request({ + url: '/app-api/product/spu/page', + method: 'GET', + params, + custom: { + showLoading: false, + showError: false, + }, + }), - // 商品查询 - ids: (params = {}) => - request({ - url: 'goods/goods/ids', - method: 'GET', - params, - custom: { - showLoading: false, - showError: false, - }, - }), - - // 商品评价列表 - comment: (id, params = {}) => - request2({ - url: 'product/comment/list?spuId=' + id, - method: 'GET', - params, - custom: { - showLoading: false, - showError: false, - }, - }), - // 商品评价类型 - getType: (id) => - request({ - url: 'goods/comment/getType/' + id, - method: 'GET', - custom: { - showLoading: false, - showError: false, - }, - }), - // 活动商品查询 - // 商品查询 - activity: (params = {}) => - request({ - url: 'goods/goods/activity', - method: 'GET', - params, - custom: { - showLoading: false, - showError: false, - }, - }), - activityList: (params = {}) => - request({ - url: 'goods/goods/activityList', - method: 'GET', - params, - }), -}; + // 商品查询 + ids: (params = {}) => + request({ + url: 'goods/goods/ids', + method: 'GET', + params, + custom: { + showLoading: false, + showError: false, + }, + }), + // 商品评价列表 + comment: (id, params = {}) => + request({ + url: '/app-api/product/comment/list?spuId=' + id, + method: 'GET', + params, + custom: { + showLoading: false, + showError: false, + }, + }), + // 商品评价类型 + getType: (id) => + request({ + url: 'goods/comment/getType/' + id, + method: 'GET', + custom: { + showLoading: false, + showError: false, + }, + }), + // 活动商品查询 + // 商品查询 + activity: (params = {}) => + request({ + url: 'goods/goods/activity', + method: 'GET', + params, + custom: { + showLoading: false, + showError: false, + }, + }), + activityList: (params = {}) => + request({ + url: 'goods/goods/activityList', + method: 'GET', + params, + }), + // 检查是否收藏商品 + exits: (id) => + request({ + url: '/app-api/product/favorite/exits?spuId=' + id, + method: 'GET', + }), +}; \ No newline at end of file diff --git a/sheep/api/index2.js b/sheep/api/index2.js index 1c068bf8b11e26ce42fc66738b131b94096407d0..7f6a12ef93c498525bd6ef8c981aa282c2f383fd 100644 --- a/sheep/api/index2.js +++ b/sheep/api/index2.js @@ -1,14 +1,14 @@ -import request2 from '@/sheep/request2'; +import request from '@/sheep/request'; export default { - decorate: () => - request2({ - url: 'promotion/decorate/list?page=1', - method: 'GET', - }), - spids: () => - request2({ - url: 'product/spu/page?recommendType=best&pageNo=1&pageSize=10', - method: 'GET', - }), -}; + decorate: () => + request({ + url: '/app-api/promotion/decorate/list?page=1', + method: 'GET', + }), + spids: () => + request({ + url: '/app-api/product/spu/page?recommendType=best&pageNo=1&pageSize=10', + method: 'GET', + }), +}; \ No newline at end of file diff --git a/sheep/api/order.js b/sheep/api/order.js index 6dd8b36292538375489fbc0f662403d3add93342..02441b4e2f8fac40c179a05a3f2b14fdc5726d0f 100644 --- a/sheep/api/order.js +++ b/sheep/api/order.js @@ -1,11 +1,10 @@ import request from '@/sheep/request'; -import request2 from '@/sheep/request2'; export default { // 订单详情 detail: (id, params) => - request2({ - url: 'trade/order/get-detail?id=' + id, + request({ + url: '/app-api/trade/order/get-detail?id=' + id, method: 'GET', params, }), @@ -40,8 +39,8 @@ export default { }), // 订单列表 list: (params) => - request2({ - url: 'trade/order/page', + request({ + url: '/app-api/trade/order/page', method: 'GET', params, custom: { @@ -65,16 +64,25 @@ export default { // 解决 SpringMVC 接受 List 参数的问题 delete data2.items for (let i = 0; i < data.items.length; i++) { + // 此处转码问题,待解决方案 data2[encodeURIComponent('items[' + i + '' + '].skuId')] = data.items[i].skuId + ''; data2[encodeURIComponent('items[' + i + '' + '].count')] = data.items[i].count + ''; - if (data.items[i].cartId) { - data2[encodeURIComponent('items[' + i + '' + '].cartId')] = data.items[i].cartId + ''; - } + data2[encodeURIComponent('items[' + i + '' + '].cartId')] = data.items[i].cartId + ''; + + // data2['items' + `[${i}]` + '.skuId'] = data.items[i].skuId + ''; + // data2['items' + `[${i}]` + '.count'] = data.items[i].count + ''; + // data2['items' + `[${i}]` + '.cartId'] = data.items[i].cartId + ''; + + // data2['items' + `%5B${i}%5D` + '.skuId'] = data.items[i].skuId + ''; + // data2['items' + `%5B${i}%5D` + '.count'] = data.items[i].count + ''; + // data2['items' + `%5B${i}%5D` + '.cartId'] = data.items[i].cartId + ''; } - const queryString= Object.keys(data2).map(key => key + '=' + data2[key]).join('&') - return request2({ - url: `trade/order/settlement?${queryString}`, - method: 'GET' + console.log(data2, '手动转码的参数') + return request({ + url: '/app-api/trade/order/settlement', + method: 'GET', + // data: data2, + params: data2 }) }, // 创建订单 @@ -99,8 +107,8 @@ export default { }), // 评价订单 comment: (data) => - request2({ - url: 'trade/order/item/create-comment', + request({ + url: '/app-api/trade/order/item/create-comment', method: 'POST', data, }), @@ -138,8 +146,8 @@ export default { data, }), list: (params) => - request2({ - url: 'trade/after-sale/page', + request({ + url: '/app-api/trade/after-sale/page', method: 'GET', params, custom: { @@ -169,8 +177,8 @@ export default { }), // 售后详情 detail: (id) => - request2({ - url: 'trade/after-sale/get?id=' + id, + request({ + url: '/app-api/trade/after-sale/get?id=' + id, method: 'GET', }), }, diff --git a/sheep/api/product/comment.js b/sheep/api/product/comment.js index 01ce25c2c24545ace84f84aa88eeacfe98dbe4c6..35d0d175a9353a98297e053b646a7accb2f3980f 100644 --- a/sheep/api/product/comment.js +++ b/sheep/api/product/comment.js @@ -1,18 +1,19 @@ import request from '@/sheep/request'; const CommentApi = { - // 获得商品评价分页 - getCommentPage: (spuId, pageNo, pageSize, type) => { - return request({ - url: '/app-api/product/comment/page', - method: 'GET', - params: { - spuId, - pageNo, - pageSize, - type - }, - }); - }, + + // 获得商品评价分页 + getCommentPage: (spuId, pageNo, pageSize, type) => { + return request({ + url: '/app-api/product/comment/page', + method: 'GET', + params: { + spuId, + pageNo, + pageSize, + type + }, + }); + }, }; -export default CommentApi; +export default CommentApi; \ No newline at end of file diff --git a/sheep/api/promotion/activity.js b/sheep/api/promotion/activity.js index efa0e1e97f84fdf69d0b82208c4ebdcc246af31c..b77b5bc273cbe5a6d5966266af35fca1c17d736a 100644 --- a/sheep/api/promotion/activity.js +++ b/sheep/api/promotion/activity.js @@ -1,16 +1,16 @@ -import request2 from '@/sheep/request2'; +import request from '@/sheep/request'; const ActivityApi = { - // 获得单个商品,近期参与的每个活动 - getActivityListBySpuId: (spuId) => { - return request2({ - url: '/app-api/promotion/activity/list-by-spu-id', - method: 'GET', - params: { - spuId, - }, - }); - }, + // 获得单个商品,近期参与的每个活动 + getActivityListBySpuId: (spuId) => { + return request({ + url: '/app-api/promotion/activity/list-by-spu-id', + method: 'GET', + params: { + spuId, + }, + }); + }, }; export default ActivityApi; diff --git a/sheep/api/promotion/combination.js b/sheep/api/promotion/combination.js index eeeb9a0aadce91790b8354be27c3a7552d926b9b..5d09373e7b2ec6f47e907c03cbd0471930307001 100644 --- a/sheep/api/promotion/combination.js +++ b/sheep/api/promotion/combination.js @@ -1,67 +1,69 @@ -import request2 from "@/sheep/request2"; +import request from "@/sheep/request"; // 拼团 API const CombinationApi = { - // 获得拼团活动列表 - getCombinationActivityList: (count) => { - return request2({ - url: "promotion/combination-activity/list", - method: 'GET', - params: {count} - }); - }, + // 获得拼团活动列表 + getCombinationActivityList: (count) => { + return request({ + url: "/app-api/promotion/combination-activity/list", + method: 'GET', + params: { + count + } + }); + }, - // 获得拼团活动分页 - getCombinationActivityPage: (params) => { - return request2({ - url: "promotion/combination-activity/page", - method: 'GET', - params - }); - }, + // 获得拼团活动分页 + getCombinationActivityPage: (params) => { + return request({ + url: "/app-api/promotion/combination-activity/page", + method: 'GET', + params + }); + }, - // 获得拼团活动明细 - getCombinationActivity: (id) => { - return request2({ - url: "promotion/combination-activity/get-detail", - method: 'GET', - params: { - id - } - }); - }, + // 获得拼团活动明细 + getCombinationActivity: (id) => { + return request({ + url: "/app-api/promotion/combination-activity/get-detail", + method: 'GET', + params: { + id + } + }); + }, - // 获得最近 n 条拼团记录(团长发起的) - getHeadCombinationRecordList: (activityId, status, count) => { - return request2({ - url: "promotion/combination-record/get-head-list", - method: 'GET', - params: { - activityId, - status, - count - } - }); - }, + // 获得最近 n 条拼团记录(团长发起的) + getHeadCombinationRecordList: (activityId, status, count) => { + return request({ + url: "/app-api/promotion/combination-record/get-head-list", + method: 'GET', + params: { + activityId, + status, + count + } + }); + }, - // 获得拼团记录明细 - getCombinationRecordDetail: (id) => { - return request2({ - url: "promotion/combination-record/get-detail", - method: 'GET', - params: { - id - } - }); - }, + // 获得拼团记录明细 + getCombinationRecordDetail: (id) => { + return request({ + url: "/app-api/promotion/combination-record/get-detail", + method: 'GET', + params: { + id + } + }); + }, - // 获得拼团记录的概要信息 - getCombinationRecordSummary: () => { - return request2({ - url: "promotion/combination-record/get-summary", - method: 'GET', - }); - } + // 获得拼团记录的概要信息 + getCombinationRecordSummary: () => { + return request({ + url: "/app-api/promotion/combination-record/get-summary", + method: 'GET', + }); + } } -export default CombinationApi +export default CombinationApi \ No newline at end of file diff --git a/sheep/api/promotion/seckill.js b/sheep/api/promotion/seckill.js index ecbb4c1fd12fe5d951ae0e4d048f3bc92c050de5..d16a0f7948cf71f2da7b2a700e72bfc409a9f11c 100644 --- a/sheep/api/promotion/seckill.js +++ b/sheep/api/promotion/seckill.js @@ -1,33 +1,44 @@ -import request2 from "@/sheep/request2"; +import request from "@/sheep/request"; const SeckillApi = { - // 获得秒杀时间段列表 - getSeckillConfigList: () => { - return request2({ url: 'promotion/seckill-config/list', method: 'GET' }); - }, + // 获得秒杀时间段列表 + getSeckillConfigList: () => { + return request({ + url: '/app-api/promotion/seckill-config/list', + method: 'GET' + }); + }, - // 获得当前秒杀活动 - getNowSeckillActivity: () => { - return request2({ url: 'promotion/seckill-activity/get-now', method: 'GET' }); - }, + // 获得当前秒杀活动 + getNowSeckillActivity: () => { + return request({ + url: '/app-api/promotion/seckill-activity/get-now', + method: 'GET' + }); + }, - // 获得秒杀活动分页 - getSeckillActivityPage: () => { - return request2({ url: 'promotion/seckill-activity/page', method: 'GET' }); - }, + // 获得秒杀活动分页 + getSeckillActivityPage: () => { + return request({ + url: '/app-api/promotion/seckill-activity/page', + method: 'GET' + }); + }, - /** - * 获得秒杀活动明细 - * @param {number} id 秒杀活动编号 - * @return {*} - */ - getSeckillActivity: (id) => { - return request2({ - url: 'promotion/seckill-activity/get-detail', - method: 'GET', - params: { id } - }); - } + /** + * 获得秒杀活动明细 + * @param {number} id 秒杀活动编号 + * @return {*} + */ + getSeckillActivity: (id) => { + return request({ + url: '/app-api/promotion/seckill-activity/get-detail', + method: 'GET', + params: { + id + } + }); + } } -export default SeckillApi; +export default SeckillApi; \ No newline at end of file diff --git a/sheep/api/user.js b/sheep/api/user.js index fb3e809cd40bde4839174ed59387fc64238f560e..10efc5aaa11e6f5799c75c64bbdd40727f081f90 100644 --- a/sheep/api/user.js +++ b/sheep/api/user.js @@ -1,11 +1,10 @@ import request from '@/sheep/request'; -import request2 from '@/sheep/request2'; import $platform from '@/sheep/platform'; export default { getUnused: () => - request2({ - url: 'promotion/coupon/get-unused-count', + request({ + url: '/app-api/promotion/coupon/get-unused-count', method: 'GET', custom: { showLoading: false, @@ -13,8 +12,8 @@ export default { }, }), profile: () => - request2({ - url: 'member/user/get', + request({ + url: '/app-api/member/user/get', method: 'GET', custom: { showLoading: false, @@ -22,7 +21,7 @@ export default { }, }), balance: () => - request2({ + request({ url: '/app-api/pay/wallet/get', method: 'GET', custom: { @@ -30,28 +29,9 @@ export default { 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', + request({ + url: '/app-api/member/user/update', method: 'PUT', custom: { showSuccess: true, @@ -196,90 +176,48 @@ export default { }), address: { - // default: () => - // request({ - // url: 'user/address/default', - // method: 'GET', - // custom: { - // showError: false, - // }, - // }), default: () => - request2({ - url: 'member/address/get-default', + request({ + url: '/app-api/member/address/get-default', method: 'GET', custom: { showError: false, }, }), list: () => - request2({ - url: 'member/address/list', + request({ + url: '/app-api/member/address/list', method: 'GET', custom: {}, }), - // list: () => - // request({ - // url: 'user/address', - // method: 'GET', - // custom: {}, - // }), create: (data) => - request2({ - url: 'member/address/create', + request({ + url: '/app-api/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', + request({ + url: '/app-api/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, + request({ + url: '/app-api/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, + request({ + url: '/app-api/member/address/delete?id=' + id, method: 'DELETE', }), - // delete: (id) => - // request({ - // url: 'user/address/' + id, - // method: 'DELETE', - // }), }, invoice: { list: () => @@ -319,17 +257,29 @@ export default { }, favorite: { list: (params) => - request2({ - url: 'product/favorite/page', + request({ + url: '/app-api/product/favorite/page', method: 'GET', params, }), do: (id) => request({ - url: 'user/goodsLog/favorite', + url: '/app-api/product/favorite/create', method: 'POST', data: { - goods_id: id, + spuId: id, + }, + custom: { + showSuccess: true, + auth: true, + }, + }), + dos: (id) => + request({ + url: '/app-api/product/favorite/delete', + method: 'DELETE', + data: { + spuId: id, }, custom: { showSuccess: true, @@ -338,8 +288,8 @@ export default { }), // 取消收藏 cancel: (id) => - request2({ - url: 'product/favorite/delete-list', + request({ + url: '/app-api/product/favorite/delete-list', method: 'DELETE', data: { spuIds: id.split(',').map(item => item * 1), @@ -350,18 +300,6 @@ export default { auth: true, }, }), - // cancel: (id) => - // request({ - // url: 'user/goodsLog/favorite', - // method: 'POST', - // data: { - // goods_ids: id, - // }, - // custom: { - // showSuccess: true, - // auth: true, - // }, - // }), }, view: { list: (params) => @@ -383,28 +321,21 @@ export default { }, wallet: { log: (params) => - request2({ + request({ // url: 'member/point/record/page', - url: 'pay/wallet-transaction/page', + url: '/app-api/pay/wallet-transaction/page', method: 'GET', params, custom: {}, }), log2: (params) => - request2({ - url: 'member/point/record/page', + request({ + url: '/app-api/member/point/record/page', // url: 'pay/wallet-transaction/page', method: 'GET', params, custom: {}, }), - // log: (params) => - // request({ - // url: '/user/api/walletLog', - // method: 'GET', - // params, - // custom: {}, - // }), }, account: { info: (params) => @@ -429,18 +360,9 @@ export default { }), }, //数量接口 - // data: () => - // request({ - // url: 'user/user/data', - // method: 'GET', - // custom: { - // showLoading: false, - // auth: true, - // }, - // }), data: () => - request2({ - url: 'trade/order/get-count', + request({ + url: '/app-api/trade/order/get-count', method: 'GET', custom: { showLoading: false, @@ -448,8 +370,8 @@ export default { }, }), data2: () => - request2({ - url: 'trade/after-sale/get-applying-count', + request({ + url: '/app-api/trade/after-sale/get-applying-count', method: 'GET', custom: { showLoading: false, diff --git a/sheep/components/s-coupon-get/s-coupon-get.vue b/sheep/components/s-coupon-get/s-coupon-get.vue index bfa9b9bb7215554e8cd76858f72ba43c4aa33c9a..7a346a8c5538a7b1f26e0ae14cba55b2d9600b9e 100644 --- a/sheep/components/s-coupon-get/s-coupon-get.vue +++ b/sheep/components/s-coupon-get/s-coupon-get.vue @@ -1,108 +1,104 @@ + .model-box { + height: 60vh; + + .title { + font-size: 36rpx; + height: 80rpx; + font-weight: bold; + color: #333333; + } + + .subtitle { + font-size: 26rpx; + font-weight: 500; + color: #333333; + } + } + + .model-content { + height: 54vh; + } + + .modal-footer { + width: 100%; + height: 120rpx; + background: #fff; + } + + .confirm-btn { + width: 710rpx; + margin-left: 20rpx; + height: 80rpx; + background: linear-gradient(90deg, var(--ui-BG-Main), var(--ui-BG-Main-gradient)); + border-radius: 40rpx; + color: #fff; + } + + // 优惠券按钮 + .card-btn { + // width: 144rpx; + padding: 0 16rpx; + height: 50rpx; + border-radius: 40rpx; + background: linear-gradient(90deg, var(--ui-BG-Main), var(--ui-BG-Main-gradient)); + color: #ffffff; + font-size: 24rpx; + font-weight: 400; + } + + .boder-btn { + background: linear-gradient(90deg, var(--ui-BG-Main-opacity-4), var(--ui-BG-Main-light)); + color: #fff !important; + } + \ No newline at end of file diff --git a/sheep/components/s-coupon-list/s-coupon-list.vue b/sheep/components/s-coupon-list/s-coupon-list.vue index 648b32daf718ebcf8967e9a92f800e06937fe170..35ba95636307a2529b374d68e7c85dc5353594d8 100644 --- a/sheep/components/s-coupon-list/s-coupon-list.vue +++ b/sheep/components/s-coupon-list/s-coupon-list.vue @@ -1,13 +1,9 @@