diff --git a/app.json b/app.json index 148fc4b..9ad5d2d 100644 --- a/app.json +++ b/app.json @@ -1,34 +1,6 @@ { "pages": [ "pages/home/home", - "pages/usercenter/index", - "pages/usercenter/person-info/index", - "pages/usercenter/address/list/index", - "pages/usercenter/address/edit/index", - "pages/goods/list/index", - "pages/goods/details/index", - "pages/goods/category/index", - "pages/goods/search/index", - "pages/goods/result/index", - "pages/cart/index", - "pages/order/order-confirm/index", - "pages/order/receipt/index", - "pages/order/pay-result/index", - "pages/order/order-list/index", - "pages/order/order-detail/index", - "pages/goods/comments/index", - "pages/order/apply-service/index", - "pages/order/after-service-list/index", - "pages/order/after-service-detail/index", - "pages/goods/comments/create/index", - "pages/coupon/coupon-list/index", - "pages/coupon/coupon-detail/index", - "pages/coupon/coupon-activity-goods/index", - "pages/promotion-detail/index", - "pages/order/fill-tracking-no/index", - "pages/order/delivery-detail/index", - "pages/order/invoice/index", - "pages/usercenter/name-edit/index", "pages/home/session/session", "pages/home/additive/additive", "pages/home/chemical/chemical", @@ -36,7 +8,8 @@ "pages/standard/list/index", "pages/user/index", "pages/user/session-list/index", - "pages/user/edit/index" + "pages/user/edit/index", + "pages/info/content-page/index" ], "tabBar": { "custom": true, diff --git a/components/goods-card/index.js b/components/goods-card/index.js deleted file mode 100644 index eb75361..0000000 --- a/components/goods-card/index.js +++ /dev/null @@ -1,141 +0,0 @@ -Component({ - options: { - addGlobalClass: true, - }, - - properties: { - id: { - type: String, - value: '', - observer(id) { - this.genIndependentID(id); - if (this.properties.thresholds?.length) { - this.createIntersectionObserverHandle(); - } - }, - }, - data: { - type: Object, - observer(data) { - if (!data) { - return; - } - let isValidityLinePrice = true; - if (data.originPrice && data.price && data.originPrice < data.price) { - isValidityLinePrice = false; - } - this.setData({ goods: data, isValidityLinePrice }); - }, - }, - currency: { - type: String, - value: '¥', - }, - - thresholds: { - type: Array, - value: [], - observer(thresholds) { - if (thresholds && thresholds.length) { - this.createIntersectionObserverHandle(); - } else { - this.clearIntersectionObserverHandle(); - } - }, - }, - }, - - data: { - independentID: '', - goods: { id: '' }, - isValidityLinePrice: false, - }, - - lifetimes: { - ready() { - this.init(); - }, - detached() { - this.clear(); - }, - }, - - pageLifeTimes: {}, - - methods: { - clickHandle() { - this.triggerEvent('click', { goods: this.data.goods }); - }, - - clickThumbHandle() { - this.triggerEvent('thumb', { goods: this.data.goods }); - }, - - addCartHandle(e) { - const { id } = e.currentTarget; - const { id: cardID } = e.currentTarget.dataset; - this.triggerEvent('add-cart', { - ...e.detail, - id, - cardID, - goods: this.data.goods, - }); - }, - - genIndependentID(id) { - let independentID; - if (id) { - independentID = id; - } else { - independentID = `goods-card-${~~(Math.random() * 10 ** 8)}`; - } - this.setData({ independentID }); - }, - - init() { - const { thresholds, id } = this.properties; - this.genIndependentID(id); - if (thresholds && thresholds.length) { - this.createIntersectionObserverHandle(); - } - }, - - clear() { - this.clearIntersectionObserverHandle(); - }, - - intersectionObserverContext: null, - - createIntersectionObserverHandle() { - if (this.intersectionObserverContext || !this.data.independentID) { - return; - } - this.intersectionObserverContext = this.createIntersectionObserver({ - thresholds: this.properties.thresholds, - }).relativeToViewport(); - - this.intersectionObserverContext.observe( - `#${this.data.independentID}`, - (res) => { - this.intersectionObserverCB(res); - }, - ); - }, - - intersectionObserverCB() { - this.triggerEvent('ob', { - goods: this.data.goods, - context: this.intersectionObserverContext, - }); - }, - - clearIntersectionObserverHandle() { - if (this.intersectionObserverContext) { - try { - this.intersectionObserverContext.disconnect(); - } catch (e) {} - this.intersectionObserverContext = null; - } - }, - }, -}); diff --git a/components/goods-card/index.json b/components/goods-card/index.json deleted file mode 100644 index f199647..0000000 --- a/components/goods-card/index.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "component": true, - "usingComponents": { - "price": "/components/price/index", - "t-icon": "tdesign-miniprogram/icon/icon", - "t-image": "/components/webp-image/index" - } -} \ No newline at end of file diff --git a/components/goods-card/index.wxml b/components/goods-card/index.wxml deleted file mode 100644 index 1292f65..0000000 --- a/components/goods-card/index.wxml +++ /dev/null @@ -1,63 +0,0 @@ - - - - - - - - - {{ goods.title }} - - - - {{tag}} - - - - - - - - - - - - diff --git a/components/goods-card/index.wxss b/components/goods-card/index.wxss deleted file mode 100644 index 1326d59..0000000 --- a/components/goods-card/index.wxss +++ /dev/null @@ -1,133 +0,0 @@ -.goods-card { - box-sizing: border-box; - font-size: 24rpx; - border-radius: 0 0 16rpx 16rpx; - border-bottom: none; -} - -.goods-card__main { - position: relative; - display: flex; - line-height: 1; - padding: 0; - background: transparent; - width: 342rpx; - border-radius: 0 0 16rpx 16rpx; - align-items: center; - justify-content: center; - margin-bottom: 16rpx; - flex-direction: column; -} - -.goods-card__thumb { - flex-shrink: 0; - position: relative; - width: 340rpx; - height: 340rpx; -} - -.goods-card__thumb:empty { - display: none; - margin: 0; -} - -.goods-card__img { - display: block; - width: 100%; - height: 100%; - border-radius: 16rpx 16rpx 0 0; - overflow: hidden; -} - -.goods-card__body { - display: flex; - flex: 1 1 auto; - background: #fff; - border-radius: 0 0 16rpx 16rpx; - padding: 16rpx 24rpx 18rpx; - flex-direction: column; -} - -.goods-card__upper { - display: flex; - flex-direction: column; - overflow: hidden; - flex: 1 1 auto; -} - -.goods-card__title { - flex-shrink: 0; - font-size: 28rpx; - color: #333; - font-weight: 400; - display: -webkit-box; - height: 72rpx; - -webkit-box-orient: vertical; - -webkit-line-clamp: 2; - overflow: hidden; - word-break: break-word; - line-height: 36rpx; -} - -.goods-card__tags { - display: flex; - flex-direction: row; - flex-wrap: wrap; - margin: 8rpx 0 0 0; -} - -.goods-card__tag { - color: #fa4126; - background: transparent; - font-size: 20rpx; - border: 1rpx solid #fa4126; - padding: 0 8rpx; - border-radius: 16rpx; - line-height: 30rpx; - margin: 0 8rpx 8rpx 0; - display: block; - overflow: hidden; - white-space: nowrap; - word-break: keep-all; - text-overflow: ellipsis; -} - -.goods-card__down { - display: flex; - position: relative; - flex-direction: row; - justify-content: flex-start; - align-items: baseline; - line-height: 32rpx; - margin: 8rpx 0 0 0; -} - -.goods-card__origin-price { - white-space: nowrap; - font-weight: 700; - order: 2; - color: #bbbbbb; - font-size: 24rpx; - margin: 0 0 0 8rpx; -} - -.goods-card__add-cart { - order: 3; - margin: auto 0 0 auto; - position: absolute; - bottom: 0; - right: 0; -} - -.spec-for-price { - font-size: 36rpx; - white-space: nowrap; - font-weight: 700; - order: 1; - color: #fa4126; - margin: 0; -} - -.spec-for-symbol { - font-size: 24rpx; -} diff --git a/components/goods-list/index.js b/components/goods-list/index.js deleted file mode 100644 index 5184903..0000000 --- a/components/goods-list/index.js +++ /dev/null @@ -1,62 +0,0 @@ -Component({ - externalClasses: ['wr-class'], - - properties: { - goodsList: { - type: Array, - value: [], - }, - id: { - type: String, - value: '', - observer: (id) => { - this.genIndependentID(id); - }, - }, - thresholds: { - type: Array, - value: [], - }, - }, - - data: { - independentID: '', - }, - - lifetimes: { - ready() { - this.init(); - }, - }, - - methods: { - onClickGoods(e) { - const { index } = e.currentTarget.dataset; - this.triggerEvent('click', { ...e.detail, index }); - }, - - onAddCart(e) { - const { index } = e.currentTarget.dataset; - this.triggerEvent('addcart', { ...e.detail, index }); - }, - - onClickGoodsThumb(e) { - const { index } = e.currentTarget.dataset; - this.triggerEvent('thumb', { ...e.detail, index }); - }, - - init() { - this.genIndependentID(this.id || ''); - }, - - genIndependentID(id) { - if (id) { - this.setData({ independentID: id }); - } else { - this.setData({ - independentID: `goods-list-${~~(Math.random() * 10 ** 8)}`, - }); - } - }, - }, -}); diff --git a/components/goods-list/index.json b/components/goods-list/index.json deleted file mode 100644 index bdaa23d..0000000 --- a/components/goods-list/index.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "component": true, - "usingComponents": { - "goods-card": "/components/goods-card/index" - } -} \ No newline at end of file diff --git a/components/goods-list/index.wxml b/components/goods-list/index.wxml deleted file mode 100644 index 5a9a804..0000000 --- a/components/goods-list/index.wxml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - diff --git a/components/goods-list/index.wxss b/components/goods-list/index.wxss deleted file mode 100644 index 7262a4d..0000000 --- a/components/goods-list/index.wxss +++ /dev/null @@ -1,7 +0,0 @@ -.goods-list-wrap { - display: flex; - flex-flow: row wrap; - justify-content: space-between; - padding: 0; - background: #fff; -} diff --git a/components/loading-content/index.wxml b/components/loading-content/index.wxml index add589c..1f39412 100644 --- a/components/loading-content/index.wxml +++ b/components/loading-content/index.wxml @@ -1,11 +1,5 @@ - - - - - - + + + + + \ No newline at end of file diff --git a/components/price/index.js b/components/price/index.js deleted file mode 100644 index c0218f7..0000000 --- a/components/price/index.js +++ /dev/null @@ -1,71 +0,0 @@ -Component({ - externalClasses: ['wr-class', 'symbol-class', 'decimal-class'], - useStore: [], - properties: { - priceUnit: { - type: String, - value: 'fen', - }, // 价格单位,分 | 元, fen,yuan - price: { - type: null, - value: '', - observer(price) { - this.format(price); - }, - }, // 价格, 以分为单位 - type: { - type: String, - value: '', // - }, // main 粗体, lighter 细体, mini 黑色, del 中划线, delthrough 中划线,包括货币符号 - symbol: { - type: String, - value: '¥', // '¥', - }, // 货币符号,默认是人民币符号¥ - fill: Boolean, // 是否自动补齐两位小数 - decimalSmaller: Boolean, // 小数字号小一点 - lineThroughWidth: { - type: null, - value: '0.12em', - }, // 划线价线条高度 - }, - - data: { - pArr: [], - }, - - methods: { - format(price) { - price = parseFloat(`${price}`); - const pArr = []; - if (!isNaN(price)) { - const isMinus = price < 0; - if (isMinus) { - price = -price; - } - if (this.properties.priceUnit === 'yuan') { - const priceSplit = price.toString().split('.'); - pArr[0] = priceSplit[0]; - pArr[1] = !priceSplit[1] - ? '00' - : priceSplit[1].length === 1 - ? `${priceSplit[1]}0` - : priceSplit[1]; - } else { - price = Math.round(price * 10 ** 8) / 10 ** 8; // 恢复精度丢失 - price = Math.ceil(price); // 向上取整 - pArr[0] = price >= 100 ? `${price}`.slice(0, -2) : '0'; - pArr[1] = `${price + 100}`.slice(-2); - } - if (!this.properties.fill) { - // 如果 fill 为 false, 不显示小数末尾的0 - if (pArr[1] === '00') pArr[1] = ''; - else if (pArr[1][1] === '0') pArr[1] = pArr[1][0]; - } - if (isMinus) { - pArr[0] = `-${pArr[0]}`; - } - } - this.setData({ pArr }); - }, - }, -}); diff --git a/components/price/index.json b/components/price/index.json deleted file mode 100644 index a89ef4d..0000000 --- a/components/price/index.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "component": true, - "usingComponents": {} -} diff --git a/components/price/index.wxml b/components/price/index.wxml deleted file mode 100644 index 7f4f9d9..0000000 --- a/components/price/index.wxml +++ /dev/null @@ -1,21 +0,0 @@ - - var REGEXP = getRegExp('^\d+(\.\d+)?$'); - function addUnit(value) { - if (value == null) { - return ''; - } - return REGEXP.test('' + value) ? value + 'rpx' : value; - } - module.exports = { - addUnit: addUnit - }; - - - - {{symbol}} - - {{pArr[0]}} - .{{pArr[1]}} - - - diff --git a/components/price/index.wxss b/components/price/index.wxss deleted file mode 100644 index 45da266..0000000 --- a/components/price/index.wxss +++ /dev/null @@ -1,66 +0,0 @@ -:host { - display: inline-block; - display: inline-block; - font-weight: inherit; -} -.inline { - display: inline; - white-space: nowrap; -} -.price { - display: inline; - color: inherit; - font-size: inherit; - text-decoration: inherit; -} - -.lighter { - font-weight: 400; - font-size: 32rpx; -} -.mini { - font-size: 24rpx; - color: #5d5d5d; - font-weight: 400; -} -.del .pprice { - font-size: 32rpx; - color: #9b9b9b; - text-decoration: line-through; - font-weight: 400; -} -.delthrough { - position: relative; -} -.delthrough .line { - position: absolute; - top: 50%; - left: 0; - right: 0; - transform: translateY(-50%); - margin: 0; - background-color: currentColor; -} - -.symbol { - display: inline; - color: inherit; - font-size: inherit; - font-size: 0.8em; -} -.pprice { - display: inline; - margin: 0 0 0 4rpx; -} -.integer { - color: inherit; - font-size: inherit; -} -.decimal { - color: inherit; - font-size: inherit; -} -.decimal.smaller { - font-size: 0.8em; - vertical-align: baseline; -} diff --git a/components/swipeout/index.wxml b/components/swipeout/index.wxml index 353bf72..dc343d8 100644 --- a/components/swipeout/index.wxml +++ b/components/swipeout/index.wxml @@ -4,7 +4,7 @@ var owner; var state; - var getState = function(ownerInstance) { + var getState = function (ownerInstance) { owner = ownerInstance; state = owner.getState(); state.leftWidth = state.leftWidth || 0; @@ -13,7 +13,7 @@ state.startOffset = state.startOffset || 0; }; - var initRightWidth = function(newVal, oldVal, ownerInstance) { + var initRightWidth = function (newVal, oldVal, ownerInstance) { getState(ownerInstance); state.rightWidth = newVal; if (state.offset < 0) { @@ -21,7 +21,7 @@ } }; - var initLeftWidth = function(newVal, oldVal, ownerInstance) { + var initLeftWidth = function (newVal, oldVal, ownerInstance) { getState(ownerInstance); state.leftWidth = newVal; if (state.offset > 0) { @@ -29,7 +29,7 @@ } } - var resetTouchStatus = function() { + var resetTouchStatus = function () { state.direction = ''; state.deltaX = 0; state.deltaY = 0; @@ -37,7 +37,7 @@ state.offsetY = 0; }; - var touchMove = function(event) { + var touchMove = function (event) { var touchPoint = event.touches[0]; state.deltaX = touchPoint.clientX - state.startX; state.deltaY = touchPoint.clientY - state.startY; @@ -46,7 +46,7 @@ state.direction = state.direction || getDirection(state.offsetX, state.offsetY); }; - var getDirection = function(x, y) { + var getDirection = function (x, y) { if (x > y && x > MIN_DISTANCE) { return 'horizontal'; } @@ -56,11 +56,11 @@ return ''; }; - var range = function(num, min, max) { + var range = function (num, min, max) { return Math.min(Math.max(num, min), max); }; - var swipeMove = function(_offset = 0) { + var swipeMove = function (_offset = 0) { state.offset = range( _offset, -state.rightWidth, @@ -79,11 +79,11 @@ }); }; - var close = function() { + var close = function () { swipeMove(0); }; - var onCloseChange = function(newVal, oldVal, ownerInstance) { + var onCloseChange = function (newVal, oldVal, ownerInstance) { getState(ownerInstance); if (newVal === oldVal) return; if (newVal) { @@ -91,7 +91,7 @@ } }; - var touchStart = function(event) { + var touchStart = function (event) { resetTouchStatus(); state.startOffset = state.offset; var touchPoint = event.touches[0]; @@ -100,12 +100,12 @@ owner.callMethod('closeOther'); }; - var startDrag = function(event, ownerInstance) { + var startDrag = function (event, ownerInstance) { getState(ownerInstance); touchStart(event); }; - var onDrag = function(event, ownerInstance) { + var onDrag = function (event, ownerInstance) { getState(ownerInstance); touchMove(event); if (state.direction !== 'horizontal') { @@ -115,13 +115,13 @@ swipeMove(state.startOffset + state.deltaX); }; - var open = function(position) { + var open = function (position) { var _offset = position === 'left' ? +state.leftWidth : -state.rightWidth; owner.callMethod('open', { position: position }); swipeMove(_offset); }; - var endDrag = function(event, ownerInstance) { + var endDrag = function (event, ownerInstance) { getState(ownerInstance); state.dragging = false; // 左/右侧有可滑动区域,且当前不是已open状态,且滑动幅度超过阈值时open左/右侧(滚动到该侧的最边上) @@ -147,21 +147,7 @@ }; - + @@ -171,4 +157,4 @@ - + \ No newline at end of file diff --git a/components/tox-icon/index.js b/components/tox-icon/index.js new file mode 100644 index 0000000..803a347 --- /dev/null +++ b/components/tox-icon/index.js @@ -0,0 +1,31 @@ +// components/tox-icon/index.js +Component({ + /** + * 组件的属性列表 + */ + properties: { + ghsLevel: { + type: Number, + value: 99, + observer(ghsLevel) { + this.setData({ + ghsLevel, + }); + }, + }, + }, + + /** + * 组件的初始数据 + */ + data: { + iconUrl: 'https://webplus-cn-hangzhou-s-603871eef968dd14ced82ed5.oss-cn-hangzhou.aliyuncs.com/hextech/static/tox.svg', + }, + + /** + * 组件的方法列表 + */ + methods: { + + } +}) \ No newline at end of file diff --git a/pages/coupon/components/floating-button/index.json b/components/tox-icon/index.json similarity index 100% rename from pages/coupon/components/floating-button/index.json rename to components/tox-icon/index.json diff --git a/components/tox-icon/index.wxml b/components/tox-icon/index.wxml new file mode 100644 index 0000000..c0de1ea --- /dev/null +++ b/components/tox-icon/index.wxml @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/components/tox-icon/index.wxss b/components/tox-icon/index.wxss new file mode 100644 index 0000000..5768bcd --- /dev/null +++ b/components/tox-icon/index.wxss @@ -0,0 +1 @@ +/* components/tox-icon/index.wxss */ \ No newline at end of file diff --git a/components/tox-tag/index.js b/components/tox-tag/index.js new file mode 100644 index 0000000..c27c4d9 --- /dev/null +++ b/components/tox-tag/index.js @@ -0,0 +1,85 @@ +// components/tox-tag/index.js +Component({ + /** + * 组件的属性列表 + */ + properties: { + ghsLevel: { + type: Number, + value: 99, + observer(ghsLevel) { + this.setData({ + ghsLevel, + levelName: this.data.ghsMap[ghsLevel].text, + levelTheme: this.data.ghsMap[ghsLevel].theme, + }); + }, + }, + size: { + type: String, + value: 'medium', + observer(size) { + this.setData({ + size, + }); + }, + }, + variant: { + type: String, + value: 'dark', + observer(variant) { + this.setData({ + variant, + }); + }, + }, + }, + + /** + * 组件的初始数据 + */ + data: { + size: '', + variant: '', + levelName: '', + ghsLevel: 99, + levelTheme: 'success', + ghsMap: { + 0: { + theme: 'success', + text: '无毒', + }, + 5: { + theme: 'warning', + text: '可能有害', + }, + 4: { + theme: 'danger', + text: '有害', + }, + 3: { + theme: 'danger', + text: '有毒', + }, + 2: { + theme: 'danger', + text: '致命', + }, + 1: { + theme: 'danger', + text: '致命', + }, + 99: { + theme: 'success', + text: '', + }, + }, + }, + + /** + * 组件的方法列表 + */ + methods: { + + } +}) \ No newline at end of file diff --git a/pages/order/components/specs-goods-card/index.json b/components/tox-tag/index.json similarity index 54% rename from pages/order/components/specs-goods-card/index.json rename to components/tox-tag/index.json index ccbce72..eb6654d 100644 --- a/pages/order/components/specs-goods-card/index.json +++ b/components/tox-tag/index.json @@ -1,6 +1,6 @@ { "component": true, "usingComponents": { - "goods-card": "../goods-card/index" + "t-tag": "tdesign-miniprogram/tag/tag" } } \ No newline at end of file diff --git a/components/tox-tag/index.wxml b/components/tox-tag/index.wxml new file mode 100644 index 0000000..b846ac8 --- /dev/null +++ b/components/tox-tag/index.wxml @@ -0,0 +1,2 @@ + +{{levelName}} \ No newline at end of file diff --git a/components/tox-tag/index.wxss b/components/tox-tag/index.wxss new file mode 100644 index 0000000..37488a5 --- /dev/null +++ b/components/tox-tag/index.wxss @@ -0,0 +1 @@ +/* components/tox-tag/index.wxss */ \ No newline at end of file diff --git a/components/webp-image/index.js b/components/webp-image/index.js deleted file mode 100644 index 1706049..0000000 --- a/components/webp-image/index.js +++ /dev/null @@ -1,86 +0,0 @@ -/* - * @Author: rileycai - * @Date: 2022-03-14 14:21:26 - * @LastEditTime: 2022-03-14 15:23:04 - * @LastEditors: rileycai - * @Description: webp-image组件对t-image包裹了一层,主要实现图片裁剪、webp压缩功能 - * @FilePath: /tdesign-miniprogram-starter/components/webp-image/index.js - */ -const systemInfo = wx.getSystemInfoSync(); -Component({ - externalClasses: ['t-class', 't-class-load'], - properties: { - loadFailed: { - type: String, - value: 'default', - }, - loading: { - type: String, - value: 'default', - }, - src: { - type: String, - value: '', - }, - mode: { - type: String, - value: 'aspectFill', - }, - webp: { - type: Boolean, - value: true, - }, - lazyLoad: { - type: Boolean, - value: false, - }, - showMenuByLongpress: { - type: Boolean, - value: false, - }, - }, - data: { - thumbHeight: 375, - thumbWidth: 375, - systemInfo, - }, - lifetimes: { - ready() { - const { mode } = this.properties; - // 获取容器的真实宽高,设置图片的裁剪宽度 - this.getRect('.J-image').then((res) => { - if (res) { - const { width, height } = res; - this.setData( - mode === 'heightFix' - ? { - thumbHeight: this.px2rpx(height) || 375, - } - : { - thumbWidth: this.px2rpx(width) || 375, - }, - ); - } - }); - }, - }, - methods: { - px2rpx(px) { - return (750 / (systemInfo.screenWidth || 375)) * px; - }, - getRect(selector) { - return new Promise((resolve) => { - if (!this.selectorQuery) { - this.selectorQuery = this.createSelectorQuery(); - } - this.selectorQuery.select(selector).boundingClientRect(resolve).exec(); - }); - }, - onLoad(e) { - this.triggerEvent('load', e.detail); - }, - onError(e) { - this.triggerEvent('error', e.detail); - }, - }, -}); diff --git a/components/webp-image/index.json b/components/webp-image/index.json deleted file mode 100644 index 6ffda42..0000000 --- a/components/webp-image/index.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "component": true, - "usingComponents": { - "t-image": "tdesign-miniprogram/image/image" - } -} \ No newline at end of file diff --git a/components/webp-image/index.wxml b/components/webp-image/index.wxml deleted file mode 100644 index b32c199..0000000 --- a/components/webp-image/index.wxml +++ /dev/null @@ -1,14 +0,0 @@ - - diff --git a/components/webp-image/index.wxss b/components/webp-image/index.wxss deleted file mode 100644 index e69de29..0000000 diff --git a/components/webp-image/utils.wxs b/components/webp-image/utils.wxs deleted file mode 100644 index 4f6e5d1..0000000 --- a/components/webp-image/utils.wxs +++ /dev/null @@ -1,140 +0,0 @@ -var isString = function (value) { - return typeof value === 'string'; -}; - -var isNumber = function (value) { - return typeof value === 'number'; -}; - -var getFileExt = function (src) { - var fileUrl = src.split('?')[0]; - var splitUlr = fileUrl.split('/'); - var filepath = splitUlr[splitUlr.length - 1]; - return filepath.split('.')[1] || 'jpg'; -}; - -function isUrl(url) { - // NOCC:ToolNameCheck(非敏感词) - var urlReg = getRegExp( - '/[(http(s)?)://(www.)?a-zA-Z0-9@:%._+~#=]{2,256}.[a-z]{2,6}\b([-a-zA-Z0-9@:%_+.~#?&//=]*)/', - 'ig', - ); - - return urlReg.test(url); -} - -function rpx2px(rpx, screenWidth) { - // px / systemWidth = rpx / 750 - var result = (rpx * (screenWidth || 375)) / 750; - - return Math.round(result); -} - -function imageMogr(url, options) { - if (!isString(url) || !url) return ''; - - if ( - url.indexOf('qlogo.cn') !== -1 || - url.indexOf('wxfile://') === 0 || - url.indexOf('http://tmp/wx') === 0 || - url.indexOf('imageMogr2') !== -1 - ) { - //qlogo.cn域名或者本地图片不做转换 - return url; - } //强制转https - - if (url.indexOf('http://') === 0) { - url = url.replace('http://', 'https://'); - } else if (url.indexOf('//') === 0) { - url = 'https:' + url; - } - - if (!options) return url; - - var width = Math.ceil(options.width), - height = Math.ceil(options.height), - format = options.format, - _optionsQuality = options.quality, - quality = _optionsQuality === undefined ? 70 : _optionsQuality, - _optionsStrip = options.strip, - strip = _optionsStrip === undefined ? true : _optionsStrip, - crop = options.crop; - var isValidWidth = isNumber(width) && width > 0; - var isValidHeight = isNumber(height) && height > 0; - var imageMogrStr = ''; - var size = ''; - - if (isValidWidth && isValidHeight) { - size = ''.concat(width, 'x').concat(height); - } else if (isValidWidth) { - size = ''.concat(width, 'x'); - } else if (isValidHeight) { - size = 'x'.concat(height); - } - - if (size) { - //缩放或者裁剪 - imageMogrStr += '/'.concat(crop ? 'crop' : 'thumbnail', '/').concat(size); - - if (crop) { - //裁剪目前需求只有以图片中心为基准 - imageMogrStr += '/gravity/center'; - } - } - - if (isNumber(quality)) { - //质量变换 - imageMogrStr += '/quality/'.concat(quality); - } - - if (strip) { - //去除元信息 - imageMogrStr += '/strip'; - } - - var ext = getFileExt(url); - - // gif 图片不做格式转换,否则会损坏动图 - if (ext === 'gif') { - imageMogrStr += '/cgif/1'; - } else if (format) { - //格式转换 - imageMogrStr += '/format/'.concat(format); - } - - if (format === 'jpg' || (!format && (ext === 'jpg' || ext === 'jpeg'))) { - //渐进式 jpg 加载 - imageMogrStr += '/interlace/1'; - } - if (!imageMogrStr) return url; - return '' - .concat(url) - .concat(url.indexOf('?') !== -1 ? '&' : '?', 'imageMogr2') - .concat(imageMogrStr); -} -function getSrc(options) { - if (!options.src) return ''; - - if (options.thumbWidth || options.thumbHeight) { - return imageMogr(options.src, { - width: - options.mode !== 'heightFix' - ? rpx2px(options.thumbWidth, options.systemInfo.screenWidth) * - options.systemInfo.pixelRatio - : null, - height: - options.mode !== 'widthFix' - ? rpx2px(options.thumbHeight, options.systemInfo.screenWidth) * - options.systemInfo.pixelRatio - : null, - format: options.webp ? 'webp' : null, - }); - } - - return ''; -} - -module.exports = { - imageMogr: imageMogr, - getSrc: getSrc, -}; diff --git a/custom-tab-bar/index.js b/custom-tab-bar/index.js index 90c58df..47634b4 100644 --- a/custom-tab-bar/index.js +++ b/custom-tab-bar/index.js @@ -7,11 +7,12 @@ Component({ methods: { onChange(event) { - this.setData({ active: event.detail.value }); + this.setData({ + active: event.detail.value + }); wx.switchTab({ - url: this.data.list[event.detail.value].url.startsWith('/') - ? this.data.list[event.detail.value].url - : `/${this.data.list[event.detail.value].url}`, + url: this.data.list[event.detail.value].url.startsWith('/') ? + this.data.list[event.detail.value].url : `/${this.data.list[event.detail.value].url}`, }); }, @@ -20,10 +21,12 @@ Component({ const route = page ? page.route.split('?')[0] : ''; const active = this.data.list.findIndex( (item) => - (item.url.startsWith('/') ? item.url.substr(1) : item.url) === - `${route}`, + (item.url.startsWith('/') ? item.url.substr(1) : item.url) === + `${route}`, ); - this.setData({ active }); + this.setData({ + active + }); }, }, -}); +}); \ No newline at end of file diff --git a/custom-tab-bar/index.json b/custom-tab-bar/index.json index 917a4e1..c8ba0bd 100644 --- a/custom-tab-bar/index.json +++ b/custom-tab-bar/index.json @@ -2,7 +2,7 @@ "component": true, "usingComponents": { "t-tab-bar": "tdesign-miniprogram/tab-bar/tab-bar", - "t-tab-bar-item": "tdesign-miniprogram/tab-bar/tab-bar-item", + "t-tab-bar-item": "tdesign-miniprogram/tab-bar-item/tab-bar-item", "t-icon": "tdesign-miniprogram/icon/icon" } } \ No newline at end of file diff --git a/images/additive.jpg b/images/additive.jpg deleted file mode 100644 index d95a5a9..0000000 Binary files a/images/additive.jpg and /dev/null differ diff --git a/images/check.png b/images/check.png deleted file mode 100644 index db44445..0000000 Binary files a/images/check.png and /dev/null differ diff --git a/images/chemical.png b/images/chemical.png deleted file mode 100644 index e333885..0000000 Binary files a/images/chemical.png and /dev/null differ diff --git a/images/history.png b/images/history.png deleted file mode 100644 index b92d883..0000000 Binary files a/images/history.png and /dev/null differ diff --git a/images/no_additives.png b/images/no_additives.png deleted file mode 100644 index 1438000..0000000 Binary files a/images/no_additives.png and /dev/null differ diff --git a/images/no_data.jpg b/images/no_data.jpg deleted file mode 100644 index a3a419a..0000000 Binary files a/images/no_data.jpg and /dev/null differ diff --git a/images/question.png b/images/question.png deleted file mode 100644 index 4cad787..0000000 Binary files a/images/question.png and /dev/null differ diff --git a/images/search.jpg b/images/search.jpg deleted file mode 100644 index 2b495ec..0000000 Binary files a/images/search.jpg and /dev/null differ diff --git a/images/standard.jpg b/images/standard.jpg deleted file mode 100644 index 35f977c..0000000 Binary files a/images/standard.jpg and /dev/null differ diff --git a/images/use_bi.jpg b/images/use_bi.jpg deleted file mode 100644 index b144ada..0000000 Binary files a/images/use_bi.jpg and /dev/null differ diff --git a/images/use_btn.jpg b/images/use_btn.jpg deleted file mode 100644 index 6179d6a..0000000 Binary files a/images/use_btn.jpg and /dev/null differ diff --git a/images/weixin.png b/images/weixin.png deleted file mode 100644 index 1d953c2..0000000 Binary files a/images/weixin.png and /dev/null differ diff --git a/model/activities.js b/model/activities.js deleted file mode 100644 index 31bc3b8..0000000 --- a/model/activities.js +++ /dev/null @@ -1,7 +0,0 @@ -import { getActivity } from './activity'; - -export function getActivityList(baseID = 0, length = 10) { - return new Array(length).fill(0).map((_, idx) => getActivity(idx + baseID)); -} - -export const activityList = getActivityList(); diff --git a/model/activity.js b/model/activity.js deleted file mode 100644 index 34abb07..0000000 --- a/model/activity.js +++ /dev/null @@ -1,18 +0,0 @@ -/** - * @param {string|number} key 唯一值 - */ -export function getActivity(key) { - return { - promotionId: `${key}`, - title: `满减满折回归${key}`, - description: null, - promotionCode: 'MERCHANT', - promotionSubCode: key % 2 === 0 ? 'MYJ' : 'MYG', - tag: '满减', - timeType: 1, - startTime: '1588737710000', - endTime: '1601467070000', - teasingStartTime: null, - activityLadder: [{ label: '满100元减99.9元' }], - }; -} diff --git a/model/address.js b/model/address.js deleted file mode 100644 index c7ae8dc..0000000 --- a/model/address.js +++ /dev/null @@ -1,31 +0,0 @@ -/** 地址 */ -export function genAddress(id) { - return { - saasId: '88888888', - uid: `8888888820550${id}`, - authToken: null, - id: `${id}`, - addressId: `${id}`, - phone: '17612345678', - name: `测试用户${id}`, - countryName: '中国', - countryCode: 'chn', - provinceName: '甘肃省', - provinceCode: '620000', - cityName: '甘南藏族自治州', - cityCode: '623000', - districtName: '碌曲县', - districtCode: '623026', - detailAddress: `松日鼎盛大厦${id}层${id}号`, - isDefault: `${id}` === '0' ? 1 : 0, - addressTag: id === 0 ? '' : '公司', - latitude: '34.59103', - longitude: '102.48699', - storeId: null, - }; -} - -/** 地址列表 */ -export function genAddressList(len = 10) { - return new Array(len).fill(0).map((_, idx) => genAddress(idx)); -} diff --git a/model/cart.js b/model/cart.js deleted file mode 100644 index d0ad6c5..0000000 --- a/model/cart.js +++ /dev/null @@ -1,324 +0,0 @@ -import { mockIp, mockReqId } from '../utils/mock'; - -export function genCartGroupData() { - const resp = { - data: { - isNotEmpty: true, - storeGoods: [ - { - storeId: '1000', - storeName: '云Mall深圳旗舰店', - storeStatus: 1, - totalDiscountSalePrice: '9990', - promotionGoodsList: [ - { - title: '满减满折回归', - promotionCode: 'MERCHANT', - promotionSubCode: 'MYJ', - promotionId: '159174555838121985', - tagText: ['满100元减99.9元'], - promotionStatus: 3, - tag: '满减', - description: '满100元减99.9元,已减99.9元', - doorSillRemain: null, - isNeedAddOnShop: 0, - goodsPromotionList: [ - { - uid: '88888888205468', - saasId: '88888888', - storeId: '1000', - spuId: '12', - skuId: '135691622', - isSelected: 1, - thumb: - 'https://cdn-we-retail.ym.tencent.com/tsr/goods/dz-3a.png', - title: - '腾讯极光盒子4智能网络电视机顶盒6K千兆网络机顶盒4K高分辨率', - primaryImage: - 'https://cdn-we-retail.ym.tencent.com/tsr/goods/dz-3a.png', - quantity: 1, - stockStatus: true, - stockQuantity: 3, - price: '9900', - originPrice: '16900', - tagPrice: null, - titlePrefixTags: [{ text: '新品' }, { text: '火爆' }], - roomId: null, - specInfo: [ - { - specTitle: '颜色', - specValue: '经典白', - }, - { - specTitle: '类型', - specValue: '经典套装', - }, - ], - joinCartTime: '2020-06-29T07:55:40.000+0000', - available: 1, - putOnSale: 1, - etitle: null, - }, - { - uid: '88888888205468', - saasId: '88888888', - storeId: '1000', - spuId: '18', - skuId: '135681631', - isSelected: 1, - thumb: - 'https://cdn-we-retail.ym.tencent.com/tsr/goods/nz-09a.png', - title: - '白色短袖连衣裙荷叶边裙摆宽松韩版休闲纯白清爽优雅连衣裙', - primaryImage: - 'https://cdn-we-retail.ym.tencent.com/tsr/goods/nz-09a.png', - quantity: 1, - stockStatus: true, - stockQuantity: 177, - price: '29800', - originPrice: '40000', - tagPrice: null, - titlePrefixTags: null, - roomId: null, - specInfo: [ - { - specTitle: '颜色', - specValue: '米色荷叶边', - }, - { - specTitle: '尺码', - specValue: 'M', - }, - ], - joinCartTime: '2020-06-29T07:55:27.000+0000', - available: 1, - putOnSale: 1, - etitle: null, - }, - { - uid: '88888888205468', - saasId: '88888888', - storeId: '1000', - spuId: '13', - skuId: '135698362', - isSelected: 1, - thumb: - 'https://cdn-we-retail.ym.tencent.com/tsr/goods/muy-3a.png', - title: - '带帽午休毯虎年款多功能加厚加大加绒简约多功能午休毯连帽披肩', - primaryImage: - 'https://cdn-we-retail.ym.tencent.com/tsr/goods/muy-3a.png', - quantity: 13, - stockStatus: true, - stockQuantity: 9, - price: '29900', - originPrice: '0', - tagPrice: null, - titlePrefixTags: [{ text: '火爆' }], - roomId: null, - specInfo: [ - { - specTitle: '颜色', - specValue: '浅灰色', - }, - { - specTitle: '尺码', - specValue: 'M', - }, - ], - joinCartTime: '2020-06-29T07:54:43.000+0000', - available: 1, - putOnSale: 1, - etitle: null, - }, - { - uid: '88888888205468', - saasId: '88888888', - storeId: '1000', - spuId: '7', - skuId: '135681625', - isSelected: 1, - thumb: - 'https://cdn-we-retail.ym.tencent.com/tsr/goods/gh-2b.png', - title: - '不锈钢刀叉勺套装家用西餐餐具ins简约耐用不锈钢金色银色可选', - primaryImage: - 'https://cdn-we-retail.ym.tencent.com/tsr/goods/gh-2b.png', - quantity: 1, - stockStatus: true, - stockQuantity: 0, - price: '29900', - originPrice: '29900', - tagPrice: null, - titlePrefixTags: null, - roomId: null, - specInfo: [ - { - specTitle: '颜色', - specValue: '奶黄色', - }, - { - specTitle: '数量', - specValue: '六件套', - }, - ], - joinCartTime: '2020-06-29T07:55:00.000+0000', - available: 1, - putOnSale: 1, - etitle: null, - }, - ], - lastJoinTime: '2020-06-29T07:55:40.000+0000', - }, - { - title: null, - promotionCode: 'EMPTY_PROMOTION', - promotionSubCode: null, - promotionId: null, - tagText: null, - promotionStatus: null, - tag: null, - description: null, - doorSillRemain: null, - isNeedAddOnShop: 0, - goodsPromotionList: [ - { - uid: '88888888205468', - saasId: '88888888', - storeId: '1000', - spuId: '11', - skuId: '135691629', - isSelected: 0, - thumb: - 'https://cdn-we-retail.ym.tencent.com/tsr/goods/nz-17a.png', - title: '运动连帽拉链卫衣休闲开衫长袖多色运动细绒面料运动上衣', - primaryImage: - 'https://cdn-we-retail.ym.tencent.com/tsr/goods/nz-17a.png', - quantity: 1, - stockStatus: false, - stockQuantity: 0, - price: '25900', - originPrice: '39900', - tagPrice: null, - tagText: null, - roomId: null, - specInfo: [ - { - specTitle: '颜色', - specValue: '军绿色', - }, - { - specTitle: '尺码', - specValue: 'S', - }, - ], - joinCartTime: '2020-04-24T06:26:48.000+0000', - available: 1, - putOnSale: 1, - etitle: null, - }, - { - uid: '88888888205468', - saasId: '88888888', - storeId: '1000', - spuId: '5', - skuId: '135691635', - isSelected: 0, - thumb: - 'https://cdn-we-retail.ym.tencent.com/tsr/goods/dz-2a.png', - title: - '迷你便携高颜值蓝牙无线耳机立体声只能触控式操作简约立体声耳机', - primaryImage: - 'https://cdn-we-retail.ym.tencent.com/tsr/goods/dz-2a.png', - quantity: 1, - stockStatus: true, - stockQuantity: 96, - price: '29000', - originPrice: '29900', - tagPrice: null, - tagText: null, - roomId: null, - specInfo: [ - { - specTitle: '颜色', - specValue: '黑色', - }, - { - specTitle: '类型', - specValue: '简约款', - }, - ], - joinCartTime: '2020-06-29T07:55:17.000+0000', - available: 1, - putOnSale: 1, - etitle: null, - }, - ], - lastJoinTime: null, - }, - ], - lastJoinTime: '2020-06-29T07:55:40.000+0000', - postageFreePromotionVo: { - title: null, - promotionCode: null, - promotionSubCode: null, - promotionId: null, - tagText: null, - promotionStatus: null, - tag: null, - description: null, - doorSillRemain: null, - isNeedAddOnShop: 0, - }, - }, - ], - invalidGoodItems: [ - { - uid: '88888888205468', - saasId: '88888888', - storeId: '1000', - spuId: '1', - skuId: '135691631', - isSelected: 1, - thumb: 'https://cdn-we-retail.ym.tencent.com/tsr/goods/nz-08b.png', - title: '纯色纯棉休闲圆领短袖T恤纯白亲肤厚柔软细腻面料纯白短袖套头T恤', - primaryImage: - 'https://cdn-we-retail.ym.tencent.com/tsr/goods/nz-08b.png', - quantity: 8, - stockStatus: true, - stockQuantity: 177, - price: '26900', - originPrice: '31900', - tagPrice: null, - tagText: null, - roomId: null, - specInfo: [ - { - specTitle: '颜色', - specValue: '白色', - }, - { - specTitle: '尺码', - specValue: 'S', - }, - ], - joinCartTime: '2020-04-28T04:03:59.000+0000', - available: 1, - putOnSale: 1, - etitle: null, - }, - ], - isAllSelected: false, - selectedGoodsCount: 16, - totalAmount: '179997', - totalDiscountAmount: '110000', - }, - code: 'Success', - msg: null, - requestId: mockReqId(), - clientIp: mockIp(), - rt: 269, - success: true, - }; - return resp; -} diff --git a/model/category.js b/model/category.js deleted file mode 100644 index 81b7502..0000000 --- a/model/category.js +++ /dev/null @@ -1,206 +0,0 @@ -export function getCategoryList() { - return [ - { - groupId: '24948', - name: '女装', - thumbnail: - 'https://cdn-we-retail.ym.tencent.com/miniapp/category/category-default.png', - children: [ - { - groupId: '249481', - name: '女装', - thumbnail: - 'https://cdn-we-retail.ym.tencent.com/miniapp/category/category-default.png', - children: [ - { - groupId: '249480', - name: '卫衣', - thumbnail: - 'https://cdn-we-retail.ym.tencent.com/tsr/classify/img-1.png', - }, - { - groupId: '249480', - name: '毛呢外套', - thumbnail: - 'https://cdn-we-retail.ym.tencent.com/tsr/classify/img-2.png', - }, - { - groupId: '249480', - name: '雪纺衫', - thumbnail: - 'https://cdn-we-retail.ym.tencent.com/tsr/classify/img-3.png', - }, - { - groupId: '249480', - name: '羽绒服', - thumbnail: - 'https://cdn-we-retail.ym.tencent.com/tsr/classify/img-4.png', - }, - { - groupId: '249480', - name: '毛衣', - thumbnail: - 'https://cdn-we-retail.ym.tencent.com/tsr/classify/img-5.png', - }, - { - groupId: '249480', - name: '棉衣', - thumbnail: - 'https://cdn-we-retail.ym.tencent.com/tsr/classify/img-6.png', - }, - { - groupId: '249480', - name: '西装', - thumbnail: - 'https://cdn-we-retail.ym.tencent.com/tsr/classify/img-7.png', - }, - { - groupId: '249480', - name: '马甲', - thumbnail: - 'https://cdn-we-retail.ym.tencent.com/tsr/classify/img-8.png', - }, - { - groupId: '249480', - name: '连衣裙', - thumbnail: - 'https://cdn-we-retail.ym.tencent.com/tsr/classify/img-9.png', - }, - { - groupId: '249480', - name: '半身裙', - thumbnail: - 'https://cdn-we-retail.ym.tencent.com/tsr/classify/img-10.png', - }, - { - groupId: '249480', - name: '裤子', - thumbnail: - 'https://cdn-we-retail.ym.tencent.com/tsr/classify/img-11.png', - }, - ], - }, - ], - }, - { - groupId: '24948', - name: '男装', - thumbnail: - 'https://cdn-we-retail.ym.tencent.com/miniapp/category/category-default.png', - children: [ - { - groupId: '249481', - name: '男装', - thumbnail: - 'https://cdn-we-retail.ym.tencent.com/miniapp/category/category-default.png', - children: [ - { - groupId: '249480', - name: '卫衣', - thumbnail: - 'https://cdn-we-retail.ym.tencent.com/tsr/classify/img-1.png', - }, - { - groupId: '249480', - name: '裤子', - thumbnail: - 'https://cdn-we-retail.ym.tencent.com/tsr/classify/img-11.png', - }, - { - groupId: '249480', - name: '西装', - thumbnail: - 'https://cdn-we-retail.ym.tencent.com/tsr/classify/img-7.png', - }, - { - groupId: '249480', - name: '羽绒服', - thumbnail: - 'https://cdn-we-retail.ym.tencent.com/tsr/classify/img-4.png', - }, - { - groupId: '249480', - name: '马甲', - thumbnail: - 'https://cdn-we-retail.ym.tencent.com/tsr/classify/img-8.png', - }, - ], - }, - ], - }, - { - groupId: '24948', - name: '儿童装', - thumbnail: - 'https://cdn-we-retail.ym.tencent.com/miniapp/category/category-default.png', - children: [ - { - groupId: '249481', - name: '儿童装', - thumbnail: - 'https://cdn-we-retail.ym.tencent.com/miniapp/category/category-default.png', - children: [ - { - groupId: '249480', - name: '马甲', - thumbnail: - 'https://cdn-we-retail.ym.tencent.com/tsr/classify/img-8.png', - }, - { - groupId: '249480', - name: '裤子', - thumbnail: - 'https://cdn-we-retail.ym.tencent.com/tsr/classify/img-11.png', - }, - { - groupId: '249480', - name: '连衣裙', - thumbnail: - 'https://cdn-we-retail.ym.tencent.com/tsr/classify/img-9.png', - }, - { - groupId: '249480', - name: '其他', - thumbnail: - 'https://cdn-we-retail.ym.tencent.com/tsr/goods/muy-3b.png', - }, - ], - }, - ], - }, - { - groupId: '24948', - name: '美妆', - thumbnail: - 'https://cdn-we-retail.ym.tencent.com/miniapp/category/category-default.png', - children: [ - { - groupId: '249481', - name: '美妆', - thumbnail: - 'https://cdn-we-retail.ym.tencent.com/miniapp/category/category-default.png', - children: [ - { - groupId: '249480', - name: '唇釉', - thumbnail: - 'https://cdn-we-retail.ym.tencent.com/tsr/goods/mz-20a1.png', - }, - { - groupId: '249480', - name: '美妆蛋', - thumbnail: - 'https://cdn-we-retail.ym.tencent.com/tsr/goods/mz-11a1.png', - }, - { - groupId: '249480', - name: '眼影', - thumbnail: - 'https://cdn-we-retail.ym.tencent.com/tsr/goods/mz-12b.png', - }, - ], - }, - ], - }, - ]; -} diff --git a/model/comments.js b/model/comments.js deleted file mode 100644 index 78dd61d..0000000 --- a/model/comments.js +++ /dev/null @@ -1,338 +0,0 @@ -/** - * * @param {number} spuId - * @param {number} pageNum - * @param {number} pageSize - * @param {number} commentsLevel - * @param {boolean} hasImage - */ -export function getGoodsAllComments(params) { - const { hasImage } = params.queryParameter; - if (hasImage) { - return { - pageNum: 1, - pageSize: 10, - totalCount: '1', - pageList: [ - { - spuId: '1722045', - skuId: '0', - specInfo: '', - commentContent: - '收到货了,第一时间试了一下,很漂亮特别喜欢,大爱大爱,颜色也很好看。棒棒!', - commentResources: [ - { - src: 'https://cdn-we-retail.ym.tencent.com/tsr/goods/nz-08b.png', - type: 'image', - }, - { - src: 'https://cdn-we-retail.ym.tencent.com/tsr/goods/comment-video.mp4', - type: 'video', - coverSrc: - 'https://cdn-we-retail.ym.tencent.com/tsr/goods/nz-08b.png', - }, - { - src: 'https://cdn-we-retail.ym.tencent.com/tsr/goods/comment-video.mp4', - type: 'video', - coverSrc: - 'https://cdn-we-retail.ym.tencent.com/tsr/goods/nz-08b.png', - }, - { - src: 'https://cdn-we-retail.ym.tencent.com/tsr/goods/comment-video.mp4', - type: 'video', - coverSrc: - 'https://cdn-we-retail.ym.tencent.com/tsr/goods/nz-08b.png', - }, - ], - commentScore: 4, - uid: '88881048075', - userName: 'Dean', - userHeadUrl: - 'https://cdn-we-retail.ym.tencent.com/tsr/avatar/avatar1.png', - isAnonymity: false, - commentTime: '1591953561000', - isAutoComment: false, - sellerReply: - '亲,你好,我们会联系商家和厂商给您一个满意的答复请一定妥善保管好发票', - goodsDetailInfo: '颜色:纯净白 尺码:S码', - }, - { - spuId: '1722045', - skuId: '0', - specInfo: '', - commentContent: - '收到货了,第一时间试了一下,很漂亮特别喜欢,大爱大爱,颜色也很好看。棒棒!', - commentResources: [ - { - src: 'https://cdn-we-retail.ym.tencent.com/tsr/goods/nz-08b.png', - type: 'image', - }, - ], - commentScore: 4, - uid: '88881048075', - userName: 'Dean', - userHeadUrl: - 'https://cdn-we-retail.ym.tencent.com/tsr/avatar/avatar1.png', - isAnonymity: false, - commentTime: '1591953561000', - isAutoComment: false, - sellerReply: - '亲,你好,我们会联系商家和厂商给您一个满意的答复请一定妥善保管好发票', - goodsDetailInfo: '颜色:纯净白 尺码:S码', - }, - { - spuId: '1722045', - skuId: '0', - specInfo: '', - commentContent: - '收到货了,第一时间试了一下,很漂亮特别喜欢,大爱大爱,颜色也很好看。棒棒!', - commentResources: [ - { - src: 'https://cdn-we-retail.ym.tencent.com/tsr/goods/nz-08b.png', - type: 'image', - }, - { - src: 'https://cdn-we-retail.ym.tencent.com/tsr/goods/comment-video.mp4', - type: 'video', - coverSrc: - 'https://cdn-we-retail.ym.tencent.com/tsr/goods/nz-08b.png', - }, - ], - commentScore: 4, - uid: '88881048075', - userName: 'Dean', - userHeadUrl: - 'https://cdn-we-retail.ym.tencent.com/tsr/avatar/avatar1.png', - isAnonymity: false, - commentTime: '1591953561000', - isAutoComment: false, - sellerReply: - '亲,你好,我们会联系商家和厂商给您一个满意的答复请一定妥善保管好发票', - goodsDetailInfo: '颜色:纯净白 尺码:S码', - }, - { - spuId: '1722045', - skuId: '0', - specInfo: '', - commentContent: - '收到货了,第一时间试了一下,很漂亮特别喜欢,大爱大爱,颜色也很好看。棒棒!', - commentResources: [ - { - src: 'https://cdn-we-retail.ym.tencent.com/tsr/goods/nz-08b.png', - type: 'image', - }, - { - src: 'https://cdn-we-retail.ym.tencent.com/tsr/goods/comment-video.mp4', - type: 'video', - coverSrc: - 'https://cdn-we-retail.ym.tencent.com/tsr/goods/nz-08b.png', - }, - { - src: 'https://cdn-we-retail.ym.tencent.com/tsr/goods/comment-video.mp4', - type: 'video', - coverSrc: - 'https://cdn-we-retail.ym.tencent.com/tsr/goods/nz-08b.png', - }, - ], - commentScore: 4, - uid: '88881048075', - userName: 'Dean', - userHeadUrl: - 'https://cdn-we-retail.ym.tencent.com/tsr/avatar/avatar1.png', - isAnonymity: false, - commentTime: '1591953561000', - isAutoComment: false, - sellerReply: - '亲,你好,我们会联系商家和厂商给您一个满意的答复请一定妥善保管好发票', - goodsDetailInfo: '颜色:纯净白 尺码:S码', - }, - ], - }; - } - return { - pageNum: 1, - pageSize: 10, - totalCount: '47', - pageList: [ - { - spuId: '1722045', - skuId: '1697694', - specInfo: '很不错', - commentContent: - '收到货了,第一时间试了一下,很漂亮特别喜欢,大爱大爱,颜色也很好看。棒棒!', - commentImageUrls: null, - commentScore: 1, - uid: '88881048075', - userName: 'Dean', - userHeadUrl: - 'https://cdn-we-retail.ym.tencent.com/tsr/avatar/avatar1.png', - isAnonymity: false, - commentTime: '1592224320000', - isAutoComment: false, - sellerReply: - '亲,你好,我们会联系商家和厂商给您一个满意的答复请一定妥善保管好发票', - goodsDetailInfo: '颜色:纯净白 尺码:S码', - }, - { - spuId: '1722045', - skuId: '1697693', - specInfo: '很适合', - commentContent: - '收到货了,第一时间试了一下,很漂亮特别喜欢,大爱大爱,颜色也很好看。棒棒!', - commentImageUrls: null, - commentScore: 1, - uid: '88881048075', - userName: 'Dean', - userHeadUrl: - 'https://cdn-we-retail.ym.tencent.com/tsr/avatar/avatar1.png', - isAnonymity: false, - commentTime: '1592224320000', - isAutoComment: false, - sellerReply: - '亲,你好,我们会联系商家和厂商给您一个满意的答复请一定妥善保管好发票', - goodsDetailInfo: '颜色:纯净白 尺码:S码', - }, - { - spuId: '1722045', - skuId: '1697694', - specInfo: 'NICE', - commentContent: - '收到货了,第一时间试了一下,很漂亮特别喜欢,大爱大爱,颜色也很好看。棒棒!', - commentImageUrls: null, - commentScore: 5, - uid: '88881048075', - userName: 'Dean', - userHeadUrl: - 'https://cdn-we-retail.ym.tencent.com/tsr/avatar/avatar1.png', - isAnonymity: false, - commentTime: '1592218074000', - isAutoComment: true, - sellerReply: - '亲,你好,我们会联系商家和厂商给您一个满意的答复请一定妥善保管好发票', - }, - { - spuId: '1722045', - skuId: '0', - specInfo: '', - commentContent: - '收到货了,第一时间试了一下,很漂亮特别喜欢,大爱大爱,颜色也很好看。棒棒!', - commentImageUrls: null, - commentScore: 5, - uid: '88881048075', - userName: 'Dean', - userHeadUrl: - 'https://cdn-we-retail.ym.tencent.com/tsr/avatar/avatar1.png', - isAnonymity: false, - commentTime: '1592218074000', - isAutoComment: false, - goodsDetailInfo: '颜色:纯净白 尺码:S码', - }, - { - spuId: '1722045', - skuId: '1697694', - specInfo: '测试dr超长:dr专用超长;bwtgg01:fff', - commentContent: - '收到货了,第一时间试了一下,很漂亮特别喜欢,大爱大爱,颜色也很好看。棒棒!', - commentImageUrls: null, - commentScore: 5, - uid: '88881048075', - userName: 'Dean', - userHeadUrl: - 'https://cdn-we-retail.ym.tencent.com/tsr/avatar/avatar1.png', - isAnonymity: false, - commentTime: '1592217607000', - isAutoComment: false, - }, - { - spuId: '1722045', - skuId: '1697693', - specInfo: '测试dr超长:超长测试超长测试1;bwtgg01:bbb', - commentContent: - '收到货了,第一时间试了一下,很漂亮特别喜欢,大爱大爱,颜色也很好看。棒棒!', - commentImageUrls: null, - commentScore: 4, - uid: '88881048075', - userName: 'Dean', - userHeadUrl: - 'https://cdn-we-retail.ym.tencent.com/tsr/avatar/avatar1.png', - isAnonymity: false, - commentTime: '1592217607000', - isAutoComment: false, - }, - { - spuId: '1722045', - skuId: '1697694', - specInfo: '测试dr超长:dr专用超长;bwtgg01:fff', - commentContent: - '收到货了,第一时间试了一下,很漂亮特别喜欢,大爱大爱,颜色也很好看。棒棒!', - commentImageUrls: null, - commentScore: 5, - uid: '88881048075', - userName: 'Dean', - userHeadUrl: - 'https://cdn-we-retail.ym.tencent.com/tsr/avatar/avatar1.png', - isAnonymity: false, - commentTime: '1592205599000', - isAutoComment: false, - }, - { - spuId: '1722045', - skuId: '1697694', - specInfo: '测试dr超长:dr专用超长;bwtgg01:fff', - commentContent: - '收到货了,第一时间试了一下,很漂亮特别喜欢,大爱大爱,颜色也很好看。棒棒!', - commentImageUrls: null, - commentScore: 5, - uid: '88881048075', - userName: 'Dean', - userHeadUrl: - 'https://cdn-we-retail.ym.tencent.com/tsr/avatar/avatar1.png', - isAnonymity: false, - commentTime: '1592188822000', - isAutoComment: false, - }, - { - spuId: '1722045', - skuId: '1697694', - specInfo: '测试dr超长:dr专用超长;bwtgg01:fff', - commentContent: - '收到货了,第一时间试了一下,很漂亮特别喜欢,大爱大爱,颜色也很好看。棒棒!', - commentImageUrls: null, - commentScore: 5, - uid: '88881055835', - userName: 'Max', - userHeadUrl: - 'https://cdn-we-retail.ym.tencent.com/tsr/avatar/avatar1.png', - isAnonymity: false, - commentTime: '1593792002000', - isAutoComment: true, - }, - { - spuId: '1722045', - skuId: '1697694', - specInfo: '测试dr超长:dr专用超长;bwtgg01:fff', - commentContent: '', - commentImageUrls: null, - commentScore: 5, - uid: '88881055835', - userName: 'Max', - userHeadUrl: - 'https://cdn-we-retail.ym.tencent.com/tsr/avatar/avatar1.png', - isAnonymity: false, - commentTime: '1593792001000', - isAutoComment: true, - }, - ], - }; -} - -export function getGoodsCommentsCount() { - return { - commentCount: '47', - badCount: '0', - middleCount: '2', - goodCount: '45', - hasImageCount: '1', - goodRate: 95.7, - uidCount: '0', - }; -} diff --git a/model/comments/queryDetail.js b/model/comments/queryDetail.js deleted file mode 100644 index 9ce2eb8..0000000 --- a/model/comments/queryDetail.js +++ /dev/null @@ -1,50 +0,0 @@ -const queryDetail = { - commentInfos: [ - { - id: '647984992708380600', - uid: '', - userName: 'Dean Cheng', - userHeadUrl: - 'https://bizmid-material-qa-1302115263.cos.ap-guangzhou.myqcloud.com/comment/default_head.png', - commentId: '1937712', - commentIdName: '小鹿商品', - commentIdImageUrl: - 'https://bizmid-material-qa-1302115263.file.myqcloud.com/persist/4bf2ded7-1759-4821-919c-cc4960e14120/1078823925183295617/100000114727/material/1/cdbeb389be64427b8c165627895ff0bc-1610425563793-%E5%A4%B4%E5%83%8F.png', - commentStage: 1, - commentCheckStatus: 2, - commentIdType: 1, - content: '', - commentInfo: { - score: null, - content: '', - medias: [], - commentTime: '1617872404000', - }, - isAgainComment: 0, - commentHasAgainComment: 0, - isAnonymous: 0, - replyList: [], - specification: '颜色:白色 ', - specificationJson: '{"颜色":"白色"}', - commentExtendId: '1937713', - commentTime: '1617872404000', - score: 0, - goodsScore: null, - freightScore: null, - serviceScore: null, - medias: [], - againCommentList: null, - }, - ], - logisticsScore: null, - serviceScore: null, -}; - -/** - * @param {string} skuId - * @param {string} spuId - * @param {string} orderNo - */ -export function queryCommentDetail() { - return queryDetail; -} diff --git a/model/coupon.js b/model/coupon.js deleted file mode 100644 index a41ff8b..0000000 --- a/model/coupon.js +++ /dev/null @@ -1,39 +0,0 @@ -/** - * 优惠券 - * - * @typedef {'default'|'useless'|'disabled'} CouponCardStatus - * @typedef {'discount'|'price'} CouponCardType - * - * @param {number} [id] - * @param {CouponCardStatus} [status] - * @param {CouponCardType} [type] - */ -export function getCoupon(id = 0, status = 'default', type = (id % 2) + 1) { - return { - /** key */ - key: `${id}`, - /** 优惠券状态 */ - status, - /** 优惠券类型 */ - type, - /** 折扣或者满减值 */ - value: type === 2 ? 5.5 : 1800, - /** 标签 */ - tag: '', - /** 描述 */ - desc: parseInt(id) > 0 ? `满${parseInt(id) * 100}元可用` : '无门槛使用', - /** 订单底价,满n元 */ - base: 10000 * (parseInt(id) || 0), - /** 标题 */ - title: type === 2 ? `生鲜折扣券 - ${id}` : `生鲜满减券 - ${id}`, - /** 有效时间限制 */ - timeLimit: '2019.11.18-2023.12.18', - /** 货币符号 */ - currency: '¥', - }; -} - -/** 优惠券列表 */ -export function getCouponList(status = 'default', length = 10) { - return new Array(length).fill(0).map((_, idx) => getCoupon(idx, status)); -} diff --git a/model/detailsComments.js b/model/detailsComments.js deleted file mode 100644 index 82fc887..0000000 --- a/model/detailsComments.js +++ /dev/null @@ -1,30 +0,0 @@ -export function getGoodsDetailsComments() { - return { - homePageComments: [ - { - spuId: '1722045', - skuId: null, - specInfo: null, - commentContent: - '收到货了,第一时间试了一下,很漂亮特别喜欢,大爱大爱,颜色也很好看。棒棒!', - commentScore: 4, - uid: '88881048075', - userName: 'Dean', - userHeadUrl: - 'https://wx.qlogo.cn/mmopen/vi_32/5mKrvn3ibyDNaDZSZics3aoKlz1cv0icqn4EruVm6gKjsK0xvZZhC2hkUkRWGxlIzOEc4600JkzKn9icOLE6zjgsxw/132', - }, - ], - }; -} - -export function getGoodsDetailsCommentsCount() { - return { - commentCount: '47', - badCount: '0', - middleCount: '2', - goodCount: '45', - hasImageCount: '1', - goodRate: 95.7, - uidCount: '0', - }; -} diff --git a/model/good.js b/model/good.js deleted file mode 100644 index 9410d37..0000000 --- a/model/good.js +++ /dev/null @@ -1,1916 +0,0 @@ -import { cdnBase } from '../config/index'; -const imgPrefix = cdnBase; - -const defaultDesc = [`${imgPrefix}/goods/details-1.png`]; - -const allGoods = [ - { - saasId: '88888888', - storeId: '1000', - spuId: '0', - title: '白色短袖连衣裙荷叶边裙摆宽松韩版休闲纯白清爽优雅连衣裙', - primaryImage: 'https://cdn-we-retail.ym.tencent.com/tsr/goods/nz-09a.png', - images: [ - 'https://cdn-we-retail.ym.tencent.com/tsr/goods/nz-09a.png', - 'https://cdn-we-retail.ym.tencent.com/tsr/goods/nz-09b.png', - ], - video: null, - available: 1, - minSalePrice: 29800, - minLinePrice: 29800, - maxSalePrice: 29800, - maxLinePrice: 40000, - spuStockQuantity: 510, - soldNum: 1020, - isPutOnSale: 1, - categoryIds: [ - '127880527393854975', - '127880527393854976', - '127880537778953984', - ], - specList: [ - { - specId: '10011', - title: '颜色', - specValueList: [ - { - specValueId: '10012', - specId: null, - saasId: null, - specValue: '米色荷叶边', - image: null, - }, - ], - }, - { - specId: '10013', - title: '尺码', - specValueList: [ - { - specValueId: '11014', - specId: null, - saasId: null, - specValue: 'S', - image: null, - }, - { - specValueId: '10014', - specId: null, - saasId: null, - specValue: 'M', - image: null, - }, - { - specValueId: '11013', - specId: null, - saasId: null, - specValue: 'L', - image: null, - }, - ], - }, - ], - skuList: [ - { - skuId: '135676631', - skuImage: 'https://cdn-we-retail.ym.tencent.com/tsr/goods/nz-09a.png', - specInfo: [ - { - specId: '10011', - specTitle: null, - specValueId: '10012', - specValue: null, - }, - { - specId: '10013', - specTitle: null, - specValueId: '11014', - specValue: null, - }, - ], - priceInfo: [ - { priceType: 1, price: '29800', priceTypeName: null }, - { priceType: 2, price: '40000', priceTypeName: null }, - ], - stockInfo: { - stockQuantity: 175, - safeStockQuantity: 0, - soldQuantity: 0, - }, - weight: { value: null, unit: 'KG' }, - volume: null, - profitPrice: null, - }, - { - skuId: '135676632', - skuImage: 'https://cdn-we-retail.ym.tencent.com/tsr/goods/nz-09a.png', - specInfo: [ - { - specId: '10011', - specTitle: null, - specValueId: '10012', - specValue: null, - }, - { - specId: '10013', - specTitle: null, - specValueId: '11013', - specValue: null, - }, - ], - priceInfo: [ - { priceType: 1, price: '29800', priceTypeName: null }, - { priceType: 2, price: '40000', priceTypeName: null }, - ], - stockInfo: { - stockQuantity: 158, - safeStockQuantity: 0, - soldQuantity: 0, - }, - weight: { value: null, unit: 'KG' }, - volume: null, - profitPrice: null, - }, - { - skuId: '135681631', - skuImage: 'https://cdn-we-retail.ym.tencent.com/tsr/goods/nz-09a.png', - specInfo: [ - { - specId: '10011', - specTitle: null, - specValueId: '10012', - specValue: null, - }, - { - specId: '10013', - specTitle: null, - specValueId: '10014', - specValue: null, - }, - ], - priceInfo: [ - { priceType: 1, price: '29800', priceTypeName: null }, - { priceType: 2, price: '40000', priceTypeName: null }, - ], - stockInfo: { - stockQuantity: 177, - safeStockQuantity: 0, - soldQuantity: 0, - }, - weight: { value: null, unit: 'KG' }, - volume: null, - profitPrice: null, - }, - ], - spuTagList: [{ id: '13001', title: '限时抢购', image: null }], - limitInfo: [ - { - text: '限购5件', - }, - ], - desc: [ - 'https://cdn-we-retail.ym.tencent.com/tsr/goods/nz-09c.png', - 'https://cdn-we-retail.ym.tencent.com/tsr/goods/nz-09d.png', - ], - etitle: '', - }, - { - saasId: '88888888', - storeId: '1000', - spuId: '135686633', - title: '纯色纯棉休闲圆领短袖T恤纯白亲肤厚柔软细腻面料纯白短袖套头T恤', - primaryImage: 'https://cdn-we-retail.ym.tencent.com/tsr/goods/nz-08b.png', - minSalePrice: '25900', - minLinePrice: '31900', - maxSalePrice: '26900', - maxLinePrice: '31900', - isSoldOut: false, - images: [ - 'https://cdn-we-retail.ym.tencent.com/tsr/goods/nz-08a.png', - 'https://cdn-we-retail.ym.tencent.com/tsr/goods/nz-08a1.png', - 'https://cdn-we-retail.ym.tencent.com/tsr/goods/nz-08b.png', - ], - groupIdList: ['15029', '14023'], - spuTagList: [ - { - id: null, - title: '2020夏季新款', - image: null, - }, - ], - skuList: [ - { - skuId: '135686634', - skuImage: null, - specInfo: [ - { - specId: '10000', - specTitle: null, - specValueId: '10001', - specValue: '白色', - }, - { - specId: '10002', - specTitle: null, - specValueId: '10003', - specValue: 'M', - }, - ], - priceInfo: [ - { - priceType: 1, - price: '25900', - priceTypeName: '销售价格', - }, - { - priceType: 2, - price: '31900', - priceTypeName: '划线价格', - }, - ], - stockInfo: { - stockQuantity: -9, - safeStockQuantity: 0, - soldQuantity: 0, - }, - weight: null, - volume: null, - profitPrice: null, - }, - { - skuId: '135691631', - skuImage: null, - specInfo: [ - { - specId: '10000', - specTitle: null, - specValueId: '10001', - specValue: '白色', - }, - { - specId: '10002', - specTitle: null, - specValueId: '11003', - specValue: 'S', - }, - ], - priceInfo: [ - { - priceType: 1, - price: '26900', - priceTypeName: '销售价格', - }, - { - priceType: 2, - price: '31900', - priceTypeName: '划线价格', - }, - ], - stockInfo: { - stockQuantity: 177, - safeStockQuantity: 0, - soldQuantity: 0, - }, - weight: null, - volume: null, - profitPrice: null, - }, - { - skuId: '135691632', - skuImage: null, - specInfo: [ - { - specId: '10000', - specTitle: null, - specValueId: '10001', - specValue: '白色', - }, - { - specId: '10002', - specTitle: null, - specValueId: '11002', - specValue: 'L', - }, - ], - priceInfo: [ - { - priceType: 1, - price: '26900', - priceTypeName: '销售价格', - }, - { - priceType: 2, - price: '31900', - priceTypeName: '划线价格', - }, - ], - stockInfo: { - stockQuantity: 194, - safeStockQuantity: 0, - soldQuantity: 0, - }, - weight: null, - volume: null, - profitPrice: null, - }, - ], - isAvailable: 1, - spuStockQuantity: 371, - soldNum: 1032, - isPutOnSale: 1, - specList: [ - { - specId: '10000', - title: '颜色', - specValueList: [ - { - specValueId: '10001', - specId: '10000', - saasId: '88888888', - specValue: '白色', - image: '', - }, - ], - }, - { - specId: '10002', - title: '尺码', - specValueList: [ - { - specValueId: '11003', - specId: '10002', - saasId: '88888888', - specValue: 'S', - image: '', - }, - { - specValueId: '10003', - specId: '10002', - saasId: '88888888', - specValue: 'M', - image: '', - }, - { - specValueId: '11002', - specId: '10002', - saasId: '88888888', - specValue: 'L', - image: '', - }, - ], - }, - ], - promotionList: null, - minProfitPrice: null, - etitle: '', - desc: [ - 'https://cdn-we-retail.ym.tencent.com/tsr/goods/nz-08c.png', - 'https://cdn-we-retail.ym.tencent.com/tsr/goods/nz-08d.png', - ], - }, - { - saasId: '88888888', - storeId: '1000', - spuId: '135691628', - title: '运动连帽拉链卫衣休闲开衫长袖多色运动细绒面料运动上衣', - images: [ - 'https://cdn-we-retail.ym.tencent.com/tsr/goods/nz-17a.png', - 'https://cdn-we-retail.ym.tencent.com/tsr/goods/nz-17a1.png', - 'https://cdn-we-retail.ym.tencent.com/tsr/goods/nz-17b.png', - 'https://cdn-we-retail.ym.tencent.com/tsr/goods/nz-17b1.png', - ], - primaryImage: 'https://cdn-we-retail.ym.tencent.com/tsr/goods/nz-17a.png', - minSalePrice: '25900', - minLinePrice: '39900', - maxSalePrice: '25900', - maxLinePrice: '39900', - isSoldOut: true, - groupIdList: ['15029', '14023'], - spuTagList: [ - { - id: null, - title: '2020夏季新款', - image: null, - }, - ], - skuList: [ - { - skuId: '135686631', - skuImage: null, - specInfo: [ - { - specId: '127904180600844800', - specTitle: null, - specValueId: '127904180768617216', - specValue: '军绿色', - }, - { - specId: '127904861604820480', - specTitle: null, - specValueId: '127904862494014208', - specValue: 'XS', - }, - ], - priceInfo: [ - { - priceType: 1, - price: '25900', - priceTypeName: '销售价格', - }, - { - priceType: 2, - price: '39900', - priceTypeName: '划线价格', - }, - ], - stockInfo: { - stockQuantity: 0, - safeStockQuantity: 0, - soldQuantity: 0, - }, - weight: null, - volume: null, - profitPrice: null, - }, - { - skuId: '135686632', - skuImage: null, - specInfo: [ - { - specId: '127904180600844800', - specTitle: null, - specValueId: '127904180768617216', - specValue: '军绿色', - }, - { - specId: '127904861604820480', - specTitle: null, - specValueId: '127904862007474176', - specValue: 'M', - }, - ], - priceInfo: [ - { - priceType: 1, - price: '25900', - priceTypeName: '销售价格', - }, - { - priceType: 2, - price: '39900', - priceTypeName: '划线价格', - }, - ], - stockInfo: { - stockQuantity: 0, - safeStockQuantity: 0, - soldQuantity: 0, - }, - weight: null, - volume: null, - profitPrice: null, - }, - { - skuId: '135691629', - skuImage: null, - specInfo: [ - { - specId: '127904180600844800', - specTitle: null, - specValueId: '127904180768617216', - specValue: '军绿色', - }, - { - specId: '127904861604820480', - specTitle: null, - specValueId: '127904862175246592', - specValue: 'S', - }, - ], - priceInfo: [ - { - priceType: 1, - price: '25900', - priceTypeName: '销售价格', - }, - { - priceType: 2, - price: '39900', - priceTypeName: '划线价格', - }, - ], - stockInfo: { - stockQuantity: 0, - safeStockQuantity: 0, - soldQuantity: 0, - }, - weight: null, - volume: null, - profitPrice: null, - }, - { - skuId: '135691630', - skuImage: null, - specInfo: [ - { - specId: '127904180600844800', - specTitle: null, - specValueId: '127904180768617216', - specValue: '军绿色', - }, - { - specId: '127904861604820480', - specTitle: null, - specValueId: '127904861755815680', - specValue: 'L', - }, - ], - priceInfo: [ - { - priceType: 1, - price: '25900', - priceTypeName: '销售价格', - }, - { - priceType: 2, - price: '39900', - priceTypeName: '划线价格', - }, - ], - stockInfo: { - stockQuantity: 0, - safeStockQuantity: 0, - soldQuantity: 0, - }, - weight: null, - volume: null, - profitPrice: null, - }, - ], - isAvailable: 1, - spuStockQuantity: 0, - soldNum: 1022, - isPutOnSale: 1, - specList: [ - { - specId: '127904180600844800', - title: '颜色', - specValueList: [ - { - specValueId: '127904180768617216', - specId: '127904180600844800', - saasId: '88888888', - specValue: '军绿色', - image: '', - }, - ], - }, - { - specId: '127904861604820480', - title: '尺码', - specValueList: [ - { - specValueId: '127904862494014208', - specId: '127904861604820480', - saasId: '88888888', - specValue: 'XS', - image: '', - }, - { - specValueId: '127904862175246592', - specId: '127904861604820480', - saasId: '88888888', - specValue: 'S', - image: '', - }, - { - specValueId: '127904862007474176', - specId: '127904861604820480', - saasId: '88888888', - specValue: 'M', - image: '', - }, - { - specValueId: '127904861755815680', - specId: '127904861604820480', - saasId: '88888888', - specValue: 'L', - image: '', - }, - ], - }, - ], - promotionList: null, - minProfitPrice: null, - etitle: '', - desc: [ - 'https://cdn-we-retail.ym.tencent.com/tsr/goods/nz-17c.png', - 'https://cdn-we-retail.ym.tencent.com/tsr/goods/nz-17d.png', - ], - }, - { - saasId: '88888888', - storeId: '1000', - spuId: '135686623', - title: '腾讯极光盒子4智能网络电视机顶盒6K千兆网络机顶盒4K高分辨率', - primaryImage: 'https://cdn-we-retail.ym.tencent.com/tsr/goods/dz-3a.png', - images: [ - 'https://cdn-we-retail.ym.tencent.com/tsr/goods/dz-3a.png', - 'https://cdn-we-retail.ym.tencent.com/tsr/goods/dz-3b.png', - ], - minSalePrice: '9900', - minLinePrice: '16900', - maxSalePrice: '10900', - maxLinePrice: '16900', - isSoldOut: false, - groupIdList: [ - '15029', - '15030', - '14023', - '127886731843219200', - '127886732665303040', - '127886733101511680', - '127886733923595520', - '14025', - '127886726071855616', - '14026', - '127886727481142784', - '127886731440566784', - ], - spuTagList: [ - { - id: null, - title: '联名系列', - image: null, - }, - ], - skuList: [ - { - skuId: '135686624', - skuImage: null, - specInfo: [ - { - specId: '10000', - specTitle: null, - specValueId: '10001', - specValue: '经典白', - }, - { - specId: '10002', - specTitle: null, - specValueId: '10003', - specValue: '节能套装', - }, - ], - priceInfo: [ - { - priceType: 1, - price: '9900', - priceTypeName: '销售价格', - }, - { - priceType: 2, - price: '16900', - priceTypeName: '划线价格', - }, - ], - stockInfo: { - stockQuantity: 98, - safeStockQuantity: 0, - soldQuantity: 0, - }, - weight: null, - volume: null, - profitPrice: null, - }, - { - skuId: '135686625', - skuImage: null, - specInfo: [ - { - specId: '10000', - specTitle: null, - specValueId: '11000', - specValue: '贵族青', - }, - { - specId: '10002', - specTitle: null, - specValueId: '11003', - specValue: '经典套装', - }, - ], - priceInfo: [ - { - priceType: 1, - price: '9900', - priceTypeName: '销售价格', - }, - { - priceType: 2, - price: '16900', - priceTypeName: '划线价格', - }, - ], - stockInfo: { - stockQuantity: 100, - safeStockQuantity: 0, - soldQuantity: 0, - }, - weight: null, - volume: null, - profitPrice: null, - }, - { - skuId: '135686626', - skuImage: null, - specInfo: [ - { - specId: '10000', - specTitle: null, - specValueId: '11000', - specValue: '经典白', - }, - { - specId: '10002', - specTitle: null, - specValueId: '11002', - specValue: '尊享礼盒装', - }, - ], - priceInfo: [ - { - priceType: 1, - price: '9900', - priceTypeName: '销售价格', - }, - { - priceType: 2, - price: '16900', - priceTypeName: '划线价格', - }, - ], - stockInfo: { - stockQuantity: 100, - safeStockQuantity: 0, - soldQuantity: 0, - }, - weight: null, - volume: null, - profitPrice: null, - }, - { - skuId: '135691622', - skuImage: null, - specInfo: [ - { - specId: '10000', - specTitle: null, - specValueId: '10001', - specValue: '经典白', - }, - { - specId: '10002', - specTitle: null, - specValueId: '11003', - specValue: 'S', - }, - ], - priceInfo: [ - { - priceType: 1, - price: '9900', - priceTypeName: '销售价格', - }, - { - priceType: 2, - price: '16900', - priceTypeName: '划线价格', - }, - ], - stockInfo: { - stockQuantity: 100, - safeStockQuantity: 0, - soldQuantity: 0, - }, - weight: null, - volume: null, - profitPrice: null, - }, - { - skuId: '135691623', - skuImage: null, - specInfo: [ - { - specId: '10000', - specTitle: null, - specValueId: '10001', - specValue: '经典白', - }, - { - specId: '10002', - specTitle: null, - specValueId: '11002', - specValue: '尊享礼盒装', - }, - ], - priceInfo: [ - { - priceType: 1, - price: '10900', - priceTypeName: '销售价格', - }, - { - priceType: 2, - price: '16900', - priceTypeName: '划线价格', - }, - ], - stockInfo: { - stockQuantity: 100, - safeStockQuantity: 0, - soldQuantity: 0, - }, - weight: null, - volume: null, - profitPrice: null, - }, - { - skuId: '135691624', - skuImage: null, - specInfo: [ - { - specId: '10000', - specTitle: null, - specValueId: '11000', - specValue: '贵族青', - }, - { - specId: '10002', - specTitle: null, - specValueId: '10003', - specValue: '节能套装', - }, - ], - priceInfo: [ - { - priceType: 1, - price: '9900', - priceTypeName: '销售价格', - }, - { - priceType: 2, - price: '16900', - priceTypeName: '划线价格', - }, - ], - stockInfo: { - stockQuantity: 100, - safeStockQuantity: 0, - soldQuantity: 0, - }, - weight: null, - volume: null, - profitPrice: null, - }, - ], - isAvailable: 1, - spuStockQuantity: 598, - soldNum: 102, - isPutOnSale: 1, - desc: [ - 'https://cdn-we-retail.ym.tencent.com/tsr/goods/dz-3c.png', - 'https://cdn-we-retail.ym.tencent.com/tsr/goods/dz-3d.png', - ], - specList: [ - { - specId: '10000', - title: '颜色', - specValueList: [ - { - specValueId: '10001', - specId: '10000', - saasId: '88888888', - specValue: '经典白', - image: '', - }, - { - specValueId: '11000', - specId: '10000', - saasId: '88888888', - specValue: '贵族青', - image: '', - }, - ], - }, - { - specId: '10002', - title: '尺码', - specValueList: [ - { - specValueId: '11003', - specId: '10002', - saasId: '88888888', - specValue: '经典套装', - image: '', - }, - { - specValueId: '10003', - specId: '10002', - saasId: '88888888', - specValue: '节能套装', - image: '', - }, - { - specValueId: '11002', - specId: '10002', - saasId: '88888888', - specValue: '尊享礼盒装', - image: '', - }, - ], - }, - ], - promotionList: null, - minProfitPrice: null, - etitle: '', - }, - { - saasId: '88888888', - storeId: '1000', - spuId: '135681628', - title: '带帽午休毯虎年款多功能加厚加大加绒简约多功能午休毯连帽披肩', - primaryImage: 'https://cdn-we-retail.ym.tencent.com/tsr/goods/muy-3a.png', - images: [ - 'https://cdn-we-retail.ym.tencent.com/tsr/goods/muy-3a.png', - 'https://cdn-we-retail.ym.tencent.com/tsr/goods/muy-3a1.png', - 'https://cdn-we-retail.ym.tencent.com/tsr/goods/muy-3b.png', - ], - minSalePrice: '29900', - minLinePrice: '39900', - maxSalePrice: '39900', - maxLinePrice: '39900', - isSoldOut: false, - groupIdList: [ - '14023', - '127886732245873408', - '127886733487386880', - '14025', - '127886726071855616', - '14026', - '127886728420666112', - '127886728957538048', - '127886729779621888', - '127886730165497088', - '127886730652037376', - '127886731037912576', - '127886731440566784', - '127886729360190464', - '15029', - '15030', - ], - spuTagList: [ - { - id: null, - title: '限时抢购', - image: null, - }, - ], - skuList: [ - { - skuId: '135676629', - skuImage: null, - specInfo: [ - { - specId: '127904180600844800', - specTitle: null, - specValueId: '127904181322265856', - specValue: '浅灰色', - }, - { - specId: '127904861604820480', - specTitle: null, - specValueId: '127904862175246592', - specValue: 'S', - }, - ], - priceInfo: [ - { - priceType: 1, - price: '29900', - priceTypeName: '销售价格', - }, - { - priceType: 2, - price: '39900', - priceTypeName: '划线价格', - }, - ], - stockInfo: { - stockQuantity: 80, - safeStockQuantity: 0, - soldQuantity: 0, - }, - weight: null, - volume: null, - profitPrice: null, - }, - { - skuId: '135676630', - skuImage: null, - specInfo: [ - { - specId: '127904180600844800', - specTitle: null, - specValueId: '127904181322265856', - specValue: '浅灰色', - }, - { - specId: '127904861604820480', - specTitle: null, - specValueId: '127904861755815680', - specValue: 'L', - }, - ], - priceInfo: [ - { - priceType: 1, - price: '39900', - priceTypeName: '销售价格', - }, - { - priceType: 2, - price: '39900', - priceTypeName: '划线价格', - }, - ], - stockInfo: { - stockQuantity: 122, - safeStockQuantity: 0, - soldQuantity: 0, - }, - weight: null, - volume: null, - profitPrice: null, - }, - { - skuId: '135681629', - skuImage: null, - specInfo: [ - { - specId: '127904180600844800', - specTitle: null, - specValueId: '127904181322265856', - specValue: '浅灰色', - }, - { - specId: '127904861604820480', - specTitle: null, - specValueId: '127904862007474176', - specValue: 'M', - }, - ], - priceInfo: [ - { - priceType: 1, - price: '39900', - priceTypeName: '销售价格', - }, - { - priceType: 2, - price: '39900', - priceTypeName: '划线价格', - }, - ], - stockInfo: { - stockQuantity: 119, - safeStockQuantity: 0, - soldQuantity: 0, - }, - weight: null, - volume: null, - profitPrice: null, - }, - ], - desc: [ - 'https://cdn-we-retail.ym.tencent.com/tsr/goods/muy-3c.png', - 'https://cdn-we-retail.ym.tencent.com/tsr/goods/muy-3d.png', - ], - isAvailable: 1, - spuStockQuantity: 321, - soldNum: 102, - isPutOnSale: 1, - specList: [ - { - specId: '127904180600844800', - title: '颜色', - specValueList: [ - { - specValueId: '127904181322265856', - specId: '127904180600844800', - saasId: '88888888', - specValue: '浅灰色', - image: '', - }, - ], - }, - { - specId: '127904861604820480', - title: '尺码', - specValueList: [ - { - specValueId: '127904862175246592', - specId: '127904861604820480', - saasId: '88888888', - specValue: 'S', - image: '', - }, - { - specValueId: '127904862007474176', - specId: '127904861604820480', - saasId: '88888888', - specValue: 'M', - image: '', - }, - { - specValueId: '127904861755815680', - specId: '127904861604820480', - saasId: '88888888', - specValue: 'L', - image: '', - }, - ], - }, - ], - promotionList: null, - minProfitPrice: null, - etitle: '', - }, - { - saasId: '88888888', - storeId: '1000', - spuId: '135681626', - title: '迷你便携高颜值蓝牙无线耳机立体声只能触控式操作简约立体声耳机', - primaryImage: 'https://cdn-we-retail.ym.tencent.com/tsr/goods/dz-2a.png', - images: [ - 'https://cdn-we-retail.ym.tencent.com/tsr/goods/dz-2a.png', - 'https://cdn-we-retail.ym.tencent.com/tsr/goods/dz-2a1.png', - 'https://cdn-we-retail.ym.tencent.com/tsr/goods/dz-2b.png', - ], - minSalePrice: '29000', - minLinePrice: '40000', - maxSalePrice: '39000', - maxLinePrice: '40000', - isSoldOut: false, - groupIdList: [ - '15029', - '15030', - '14023', - '127886732245873408', - '127886733487386880', - '14025', - '127886726071855616', - '14026', - '127886728420666112', - '127886728957538048', - '127886730652037376', - '127886731037912576', - ], - spuTagList: [ - { - id: null, - title: '限时抢购', - image: null, - }, - ], - skuList: [ - { - skuId: '135676627', - skuImage: null, - specInfo: [ - { - specId: '10006', - specTitle: null, - specValueId: '10007', - specValue: '黑色', - }, - { - specId: '11007', - specTitle: null, - specValueId: '10009', - specValue: '简约款', - }, - ], - priceInfo: [ - { - priceType: 1, - price: '29000', - priceTypeName: '销售价格', - }, - { - priceType: 2, - price: '40000', - priceTypeName: '划线价格', - }, - ], - stockInfo: { - stockQuantity: 123, - safeStockQuantity: 0, - soldQuantity: 0, - }, - weight: null, - volume: null, - profitPrice: null, - }, - { - skuId: '135676628', - skuImage: null, - specInfo: [ - { - specId: '10006', - specTitle: null, - specValueId: '10007', - specValue: '黑色', - }, - { - specId: '11007', - specTitle: null, - specValueId: '10008', - specValue: '礼盒装', - }, - ], - priceInfo: [ - { - priceType: 1, - price: '39000', - priceTypeName: '销售价格', - }, - { - priceType: 2, - price: '40000', - priceTypeName: '划线价格', - }, - ], - stockInfo: { - stockQuantity: 123, - safeStockQuantity: 0, - soldQuantity: 0, - }, - weight: null, - volume: null, - profitPrice: null, - }, - { - skuId: '135681627', - skuImage: null, - specInfo: [ - { - specId: '10006', - specTitle: null, - specValueId: '10007', - specValue: '黑色', - }, - { - specId: '11007', - specTitle: null, - specValueId: '11008', - specValue: '带充电线简约款', - }, - ], - priceInfo: [ - { - priceType: 1, - price: '39000', - priceTypeName: '销售价格', - }, - { - priceType: 2, - price: '40000', - priceTypeName: '划线价格', - }, - ], - stockInfo: { - stockQuantity: 120, - safeStockQuantity: 0, - soldQuantity: 0, - }, - weight: null, - volume: null, - profitPrice: null, - }, - ], - desc: [ - 'https://cdn-we-retail.ym.tencent.com/tsr/goods/dz-2c.png', - 'https://cdn-we-retail.ym.tencent.com/tsr/goods/dz-2d.png', - ], - isAvailable: 1, - spuStockQuantity: 366, - soldNum: 102, - isPutOnSale: 1, - specList: [ - { - specId: '10006', - title: '颜色', - specValueList: [ - { - specValueId: '10007', - specId: '10006', - saasId: '88888888', - specValue: '黑色', - image: '', - }, - ], - }, - { - specId: '11007', - title: '类型', - specValueList: [ - { - specValueId: '10009', - specId: '11007', - saasId: '88888888', - specValue: '简约款', - image: '', - }, - { - specValueId: '11008', - specId: '11007', - saasId: '88888888', - specValue: '带充电线简约款', - image: '', - }, - { - specValueId: '10008', - specId: '11007', - saasId: '88888888', - specValue: '礼盒款', - image: '', - }, - ], - }, - ], - promotionList: null, - minProfitPrice: null, - etitle: '', - }, - { - saasId: '88888888', - storeId: '1000', - spuId: '135681622', - title: '简约餐盘耐热家用盘子菜盘套装多颜色简约餐盘耐热家用盘子', - primaryImage: 'https://cdn-we-retail.ym.tencent.com/tsr/goods/gh-1a.png', - images: [ - 'https://cdn-we-retail.ym.tencent.com/tsr/goods/gh-1a.png', - 'https://cdn-we-retail.ym.tencent.com/tsr/goods/gh-1a2.png', - 'https://cdn-we-retail.ym.tencent.com/tsr/goods/gh-1b.png', - ], - minSalePrice: '129900', - minLinePrice: '218000', - maxSalePrice: '139900', - maxLinePrice: '218000', - isSoldOut: false, - desc: [ - 'https://cdn-we-retail.ym.tencent.com/tsr/goods/gh-1c.png', - 'https://cdn-we-retail.ym.tencent.com/tsr/goods/gh-1d.png', - ], - groupIdList: [ - '14023', - '127886732665303040', - '127886733101511680', - '127886733923595520', - '14025', - '127886726071855616', - '14026', - '127886728957538048', - '127886727481142784', - '127886729779621888', - '127886730165497088', - '127886730652037376', - '127886731440566784', - '127886729360190464', - '15029', - '15030', - ], - spuTagList: [ - { - id: null, - title: '掌柜热卖', - image: null, - }, - ], - skuList: [ - { - skuId: '135676623', - skuImage: null, - specInfo: [ - { - specId: '127904180600844800', - specTitle: null, - specValueId: '127904181506815488', - specValue: '奶黄色', - }, - { - specId: '127904861604820480', - specTitle: null, - specValueId: '127904862175246592', - specValue: '单盘', - }, - ], - priceInfo: [ - { - priceType: 1, - price: '129900', - priceTypeName: '销售价格', - }, - { - priceType: 2, - price: '218000', - priceTypeName: '划线价格', - }, - ], - stockInfo: { - stockQuantity: 119, - safeStockQuantity: 0, - soldQuantity: 0, - }, - weight: null, - volume: null, - profitPrice: null, - }, - { - skuId: '135676624', - skuImage: null, - specInfo: [ - { - specId: '127904180600844800', - specTitle: null, - specValueId: '127904181506815488', - specValue: '奶黄色', - }, - { - specId: '127904861604820480', - specTitle: null, - specValueId: '127904861755815680', - specValue: '盘+碗', - }, - ], - priceInfo: [ - { - priceType: 1, - price: '139900', - priceTypeName: '销售价格', - }, - { - priceType: 2, - price: '218000', - priceTypeName: '划线价格', - }, - ], - stockInfo: { - stockQuantity: 116, - safeStockQuantity: 0, - soldQuantity: 0, - }, - weight: null, - volume: null, - profitPrice: null, - }, - { - skuId: '135681623', - skuImage: null, - specInfo: [ - { - specId: '127904180600844800', - specTitle: null, - specValueId: '127904181506815488', - specValue: '奶黄色', - }, - { - specId: '127904861604820480', - specTitle: null, - specValueId: '127904862007474176', - specValue: '单盘', - }, - ], - priceInfo: [ - { - priceType: 1, - price: '139900', - priceTypeName: '销售价格', - }, - { - priceType: 2, - price: '218000', - priceTypeName: '划线价格', - }, - ], - stockInfo: { - stockQuantity: 122, - safeStockQuantity: 0, - soldQuantity: 0, - }, - weight: null, - volume: null, - profitPrice: null, - }, - ], - isAvailable: 1, - spuStockQuantity: 357, - soldNum: 23102, - isPutOnSale: 1, - specList: [ - { - specId: '127904180600844800', - title: '颜色', - specValueList: [ - { - specValueId: '127904181506815488', - specId: '127904180600844800', - saasId: '88888888', - specValue: '奶黄色', - image: '', - }, - ], - }, - { - specId: '127904861604820480', - title: '类型', - specValueList: [ - { - specValueId: '127904862175246592', - specId: '127904861604820480', - saasId: '88888888', - specValue: '单盘', - image: '', - }, - { - specValueId: '127904862007474176', - specId: '127904861604820480', - saasId: '88888888', - specValue: '单碗', - image: '', - }, - { - specValueId: '127904861755815680', - specId: '127904861604820480', - saasId: '88888888', - specValue: '盘+碗', - image: '', - }, - ], - }, - ], - promotionList: null, - minProfitPrice: null, - etitle: '', - }, - { - saasId: '88888888', - storeId: '1000', - spuId: '135681624', - title: '不锈钢刀叉勺套装家用西餐餐具ins简约耐用不锈钢金色银色可选', - primaryImage: 'https://cdn-we-retail.ym.tencent.com/tsr/goods/gh-2b.png', - images: [ - 'https://cdn-we-retail.ym.tencent.com/tsr/goods/gh-2a.png', - 'https://cdn-we-retail.ym.tencent.com/tsr/goods/gh-2a1.png', - 'https://cdn-we-retail.ym.tencent.com/tsr/goods/gh-2b.png', - ], - video: null, - available: 1, - minSalePrice: '19900', - minLinePrice: '19900', - maxSalePrice: '29900', - maxLinePrice: '29900', - spuStockQuantity: 0, - soldNum: 102, - isPutOnSale: 1, - categoryIds: [ - '127880527393854975', - '127880527393854977', - '127880526789875961', - ], - specList: [ - { - specId: '127904180600844800', - title: '颜色', - specValueList: [ - { - specValueId: '127904180768617216', - specId: null, - saasId: null, - specValue: '奶黄色', - image: null, - }, - ], - }, - { - specId: '127904861604820480', - title: '数量', - specValueList: [ - { - specValueId: '127904862175246592', - specId: null, - saasId: null, - specValue: '三件套', - image: null, - }, - { - specValueId: '127904862007474176', - specId: null, - saasId: null, - specValue: '六件套', - image: null, - }, - { - specValueId: '127904861755815680', - specId: null, - saasId: null, - specValue: '八件套', - image: null, - }, - ], - }, - ], - skuList: [ - { - skuId: '135676625', - skuImage: null, - specInfo: [ - { - specId: '127904180600844800', - specTitle: null, - specValueId: '127904180768617216', - specValue: null, - }, - { - specId: '127904861604820480', - specTitle: null, - specValueId: '127904862175246592', - specValue: null, - }, - ], - priceInfo: [ - { priceType: 1, price: '19900', priceTypeName: null }, - { priceType: 2, price: '29900', priceTypeName: null }, - ], - stockInfo: { - stockQuantity: 0, - safeStockQuantity: 0, - soldQuantity: 0, - }, - weight: { value: null, unit: 'KG' }, - volume: null, - profitPrice: null, - }, - { - skuId: '135676626', - skuImage: null, - specInfo: [ - { - specId: '127904180600844800', - specTitle: null, - specValueId: '127904180768617216', - specValue: null, - }, - { - specId: '127904861604820480', - specTitle: null, - specValueId: '127904861755815680', - specValue: null, - }, - ], - priceInfo: [ - { priceType: 1, price: '29900', priceTypeName: null }, - { priceType: 2, price: '29900', priceTypeName: null }, - ], - stockInfo: { - stockQuantity: 0, - safeStockQuantity: 0, - soldQuantity: 0, - }, - weight: { value: null, unit: 'KG' }, - volume: null, - profitPrice: null, - }, - { - skuId: '135681625', - skuImage: null, - specInfo: [ - { - specId: '127904180600844800', - specTitle: null, - specValueId: '127904180768617216', - specValue: null, - }, - { - specId: '127904861604820480', - specTitle: null, - specValueId: '127904862007474176', - specValue: null, - }, - ], - priceInfo: [ - { priceType: 1, price: '29900', priceTypeName: null }, - { priceType: 2, price: '29900', priceTypeName: null }, - ], - stockInfo: { - stockQuantity: 0, - safeStockQuantity: 0, - soldQuantity: 0, - }, - weight: { value: null, unit: 'KG' }, - volume: null, - profitPrice: null, - }, - ], - spuTagList: [{ id: '19011', title: '2020秋季新款', image: null }], - spuLimitList: null, - desc: [ - 'https://cdn-we-retail.ym.tencent.com/tsr/goods/gh-2c.png', - 'https://cdn-we-retail.ym.tencent.com/tsr/goods/gh-2d.png', - ], - etitle: '', - }, - { - saasId: '88888888', - storeId: '1000', - spuId: '135681628', - title: '带帽午休毯虎年款多功能加厚加大加绒简约多功能午休毯连帽披肩', - primaryImage: 'https://cdn-we-retail.ym.tencent.com/tsr/goods/muy-3a.png', - images: ['https://cdn-we-retail.ym.tencent.com/tsr/goods/muy-3a.png'], - video: null, - available: 1, - minSalePrice: '29900', - minLinePrice: '29900', - maxSalePrice: '39900', - maxLinePrice: '39900', - spuStockQuantity: 321, - soldNum: 103, - isPutOnSale: 1, - categoryIds: [ - '127880527393854975', - '127880527393854977', - '127880526789875961', - ], - specList: [ - { - specId: '127904180600844800', - title: '颜色', - specValueList: [ - { - specValueId: '127904181322265856', - specId: null, - saasId: null, - specValue: '浅灰色', - image: null, - }, - ], - }, - { - specId: '127904861604820480', - title: '尺码', - specValueList: [ - { - specValueId: '127904862175246592', - specId: null, - saasId: null, - specValue: 'S', - image: null, - }, - { - specValueId: '127904862007474176', - specId: null, - saasId: null, - specValue: 'M', - image: null, - }, - { - specValueId: '127904861755815680', - specId: null, - saasId: null, - specValue: 'L', - image: null, - }, - ], - }, - ], - skuList: [ - { - skuId: '135676629', - skuImage: 'https://cdn-we-retail.ym.tencent.com/tsr/goods/muy-3a.png', - specInfo: [ - { - specId: '127904180600844800', - specTitle: null, - specValueId: '127904181322265856', - specValue: null, - }, - { - specId: '127904861604820480', - specTitle: null, - specValueId: '127904862175246592', - specValue: null, - }, - ], - priceInfo: [ - { priceType: 1, price: '29900', priceTypeName: null }, - { priceType: 2, price: '39900', priceTypeName: null }, - ], - stockInfo: { - stockQuantity: 80, - safeStockQuantity: 0, - soldQuantity: 0, - }, - weight: { value: null, unit: 'KG' }, - volume: null, - profitPrice: null, - }, - { - skuId: '135676630', - skuImage: 'https://cdn-we-retail.ym.tencent.com/tsr/goods/muy-3a.png', - specInfo: [ - { - specId: '127904180600844800', - specTitle: null, - specValueId: '127904181322265856', - specValue: null, - }, - { - specId: '127904861604820480', - specTitle: null, - specValueId: '127904861755815680', - specValue: null, - }, - ], - priceInfo: [ - { priceType: 1, price: '39900', priceTypeName: null }, - { priceType: 2, price: '39900', priceTypeName: null }, - ], - stockInfo: { - stockQuantity: 122, - safeStockQuantity: 0, - soldQuantity: 0, - }, - weight: { value: null, unit: 'KG' }, - volume: null, - profitPrice: null, - }, - { - skuId: '135681629', - skuImage: 'https://cdn-we-retail.ym.tencent.com/tsr/goods/muy-3a.png', - specInfo: [ - { - specId: '127904180600844800', - specTitle: null, - specValueId: '127904181322265856', - specValue: null, - }, - { - specId: '127904861604820480', - specTitle: null, - specValueId: '127904862007474176', - specValue: null, - }, - ], - priceInfo: [ - { priceType: 1, price: '39900', priceTypeName: null }, - { priceType: 2, price: '39900', priceTypeName: null }, - ], - stockInfo: { - stockQuantity: 119, - safeStockQuantity: 0, - soldQuantity: 0, - }, - weight: { value: null, unit: 'KG' }, - volume: null, - profitPrice: null, - }, - ], - spuTagList: [{ id: '13001', title: '限时抢购', image: null }], - spuLimitList: null, - desc: [ - 'https://cdn-we-retail.ym.tencent.com/tsr/goods/muy-3c.png', - 'https://cdn-we-retail.ym.tencent.com/tsr/goods/muy-3d.png', - ], - etitle: '', - }, -]; - -/** - * @param {string} id - * @param {number} [available] 库存, 默认1 - */ -export function genGood(id, available = 1) { - const specID = ['135681624', '135681628']; - if (specID.indexOf(id) > -1) { - return allGoods.filter((good) => good.spuId === id)[0]; - } - const item = allGoods[id % allGoods.length]; - return { - ...item, - spuId: `${id}`, - available: available, - desc: item?.desc || defaultDesc, - images: item?.images || [item?.primaryImage], - }; -} diff --git a/model/goods.js b/model/goods.js deleted file mode 100644 index 850e0ba..0000000 --- a/model/goods.js +++ /dev/null @@ -1,7 +0,0 @@ -import { genGood } from './good'; - -export function getGoodsList(baseID = 0, length = 10) { - return new Array(length).fill(0).map((_, idx) => genGood(idx + baseID)); -} - -export const goodsList = getGoodsList(); diff --git a/model/order/applyService.js b/model/order/applyService.js deleted file mode 100644 index e3a2fdf..0000000 --- a/model/order/applyService.js +++ /dev/null @@ -1,295 +0,0 @@ -import { mockIp, mockReqId } from '../../utils/mock'; - -const orderResps = [ - { - data: { - saasId: '88888888', - uid: '88888888205468', - storeId: '1000', - skuId: '135691625', - numOfSku: 1, - numOfSkuAvailable: 1, - refundableAmount: '26900', - refundableDiscountAmount: '0', - shippingFeeIncluded: '0', - paidAmountEach: '26900', - boughtQuantity: 1, - orderNo: '132222623132329291', - goodsInfo: { - goodsName: - '迷你便携高颜值蓝牙无线耳机立体声只能触控式操作简约立体声耳机', - skuImage: 'https://cdn-we-retail.ym.tencent.com/tsr/goods/dz-2a.png', - specInfo: [ - { - specId: '50456', - specTitle: '颜色', - specValue: '黑色', - }, - { - specId: '50459', - specTitle: '尺码', - specValue: '简约款', - }, - ], - }, - }, - code: 'Success', - msg: null, - requestId: mockReqId(), - clientIp: mockIp(), - rt: 36, - success: true, - }, - { - data: { - saasId: '88888888', - uid: '88888888205468', - storeId: '1000', - skuId: '135676631', - numOfSku: 1, - numOfSkuAvailable: 1, - refundableAmount: '26900', - refundableDiscountAmount: '0', - shippingFeeIncluded: '0', - paidAmountEach: '26900', - boughtQuantity: 1, - orderNo: '132222623132329291', - goodsInfo: { - goodsName: '白色短袖连衣裙荷叶边裙摆宽松韩版休闲纯白清爽优雅连衣裙', - skuImage: 'https://cdn-we-retail.ym.tencent.com/tsr/goods/nz-09a.png', - specInfo: [ - { - specId: '50456', - specTitle: '颜色', - specValue: '米色荷叶边', - }, - { - specId: '50459', - specTitle: '尺码', - specValue: 'S', - }, - ], - }, - }, - code: 'Success', - msg: null, - requestId: mockReqId(), - clientIp: mockIp(), - rt: 36, - success: true, - }, - { - data: { - saasId: '88888888', - uid: '88888888205468', - storeId: '1000', - skuId: '135691622', - numOfSku: 1, - numOfSkuAvailable: 1, - refundableAmount: '26900', - refundableDiscountAmount: '0', - shippingFeeIncluded: '0', - paidAmountEach: '26900', - boughtQuantity: 1, - orderNo: '132222623132329291', - goodsInfo: { - goodsName: '腾讯极光盒子4智能网络电视机顶盒6K千兆网络机顶盒4K高分辨率', - skuImage: 'https://cdn-we-retail.ym.tencent.com/tsr/goods/dz-3a.png', - specInfo: [ - { - specId: '50456', - specTitle: '颜色', - specValue: '经典白', - }, - { - specId: '50459', - specTitle: '类型', - specValue: '经典套装', - }, - ], - }, - }, - code: 'Success', - msg: null, - requestId: mockReqId(), - clientIp: mockIp(), - rt: 36, - success: true, - }, - { - data: { - saasId: '88888888', - uid: '88888888205468', - storeId: '1000', - skuId: '135676629', - numOfSku: 1, - numOfSkuAvailable: 1, - refundableAmount: '26900', - refundableDiscountAmount: '0', - shippingFeeIncluded: '0', - paidAmountEach: '26900', - boughtQuantity: 1, - orderNo: '132222623132329291', - goodsInfo: { - goodsName: '带帽午休毯虎年款多功能加厚加大加绒简约多功能午休毯连帽披肩', - skuImage: 'https://cdn-we-retail.ym.tencent.com/tsr/goods/muy-3a.png', - specInfo: [ - { - specId: '50456', - specTitle: '颜色', - specValue: '浅灰色', - }, - { - specId: '50459', - specTitle: '尺码', - specValue: 'S', - }, - ], - }, - }, - code: 'Success', - msg: null, - requestId: mockReqId(), - clientIp: mockIp(), - rt: 36, - success: true, - }, - { - data: { - saasId: '88888888', - uid: '88888888205468', - storeId: '1000', - skuId: '135686631', - numOfSku: 1, - numOfSkuAvailable: 1, - refundableAmount: '26900', - refundableDiscountAmount: '0', - shippingFeeIncluded: '0', - paidAmountEach: '26900', - boughtQuantity: 1, - orderNo: '132222623132329291', - goodsInfo: { - goodsName: '运动连帽拉链卫衣休闲开衫长袖多色运动细绒面料运动上衣', - skuImage: 'https://cdn-we-retail.ym.tencent.com/tsr/goods/nz-17a.png', - specInfo: [ - { - specId: '50456', - specTitle: '颜色', - specValue: '军绿色', - }, - { - specId: '50459', - specTitle: '尺码', - specValue: 'XS', - }, - ], - }, - }, - code: 'Success', - msg: null, - requestId: mockReqId(), - clientIp: mockIp(), - rt: 36, - success: true, - }, - { - data: { - saasId: '88888888', - uid: '88888888205468', - storeId: '1000', - skuId: '19384938948343', - numOfSku: 1, - numOfSkuAvailable: 1, - refundableAmount: '26900', - refundableDiscountAmount: '0', - shippingFeeIncluded: '0', - paidAmountEach: '26900', - boughtQuantity: 1, - orderNo: '130169571554503755', - goodsInfo: { - goodsName: - '纯色纯棉休闲圆领短袖T恤纯白亲肤厚柔软细腻面料纯白短袖套头T恤', - skuImage: 'https://cdn-we-retail.ym.tencent.com/tsr/goods/nz-08b.png', - specInfo: [ - { - specId: '50456', - specTitle: '颜色', - specValue: '军绿色', - }, - { - specId: '50459', - specTitle: '尺码', - specValue: 'XS', - }, - ], - }, - }, - code: 'Success', - msg: null, - requestId: mockReqId(), - clientIp: mockIp(), - rt: 36, - success: true, - }, -]; - -export function genRightsPreview(params) { - const { orderNo, skuId } = params; - const resp = orderResps.find( - (r) => r.data.orderNo === orderNo && r.data.skuId === skuId, - ); - return resp; -} - -export function genApplyReasonList(params) { - const resp = { - data: { - saasId: '70000001', - rightsReasonList: [ - { id: '1', desc: '实际商品与描述不符' }, - { id: '2', desc: '质量问题' }, - { id: '3', desc: '少件/漏发' }, - { id: '4', desc: '包装/商品/污迹/裂痕/变形' }, - { id: '5', desc: '发货太慢' }, - { id: '6', desc: '物流配送太慢' }, - { id: '7', desc: '商家发错货' }, - { id: '8', desc: '不喜欢' }, - ], - }, - code: 'Success', - msg: null, - requestId: mockReqId(), - clientIp: mockIp(), - rt: 6, - success: true, - }; - // 未收货对应的原因列表 - if (params.rightsReasonType === 'REFUND_MONEY') { - resp.data.rightsReasonList = [ - { id: '9', desc: '空包裹' }, - { id: '10', desc: '快递/物流一直未送到' }, - { id: '11', desc: '货物破损已拒签' }, - { id: '12', desc: '不喜欢' }, - ]; - } - return resp; -} - -export function applyService() { - const resp = { - data: { - rightsNo: '123123423', - saasId: '70000001', - uid: '700000011070005', - storeId: '542', - result: null, - }, - code: 'Success', - msg: null, - requestId: mockReqId(), - clientIp: mockIp(), - rt: 269, - success: true, - }; - return resp; -} diff --git a/model/order/orderConfirm.js b/model/order/orderConfirm.js deleted file mode 100644 index 7170492..0000000 --- a/model/order/orderConfirm.js +++ /dev/null @@ -1,147 +0,0 @@ -import { mockIp, mockReqId } from '../../utils/mock'; - -export const transformGoodsDataToConfirmData = (goodsDataList) => { - const list = []; - - goodsDataList.forEach((goodsData) => { - list.push({ - storeId: goodsData.storeId, - spuId: goodsData.spuId, - skuId: goodsData.skuId, - goodsName: goodsData.title, - image: goodsData.primaryImage, - reminderStock: 119, - quantity: goodsData.quantity, - payPrice: goodsData.price, - totalSkuPrice: goodsData.price, - discountSettlePrice: goodsData.price, - realSettlePrice: goodsData.price, - settlePrice: goodsData.price, - oriPrice: goodsData.originPrice, - tagPrice: null, - tagText: null, - skuSpecLst: goodsData.specInfo, - promotionIds: null, - weight: 0.0, - unit: 'KG', - volume: null, - masterGoodsType: 0, - viceGoodsType: 0, - roomId: goodsData.roomId, - egoodsName: null, - }); - }); - - return list; -}; - -/** 生成结算数据 */ -export function genSettleDetail(params) { - const { userAddressReq, couponList, goodsRequestList } = params; - - const resp = { - data: { - settleType: 0, - userAddress: null, - totalGoodsCount: 3, - packageCount: 1, - totalAmount: '289997', - totalPayAmount: '', - totalDiscountAmount: '110000', - totalPromotionAmount: '1100', - totalCouponAmount: '0', - totalSalePrice: '289997', - totalGoodsAmount: '289997', - totalDeliveryFee: '0', - invoiceRequest: null, - skuImages: null, - deliveryFeeList: null, - storeGoodsList: [ - { - storeId: '1000', - storeName: '云Mall深圳旗舰店', - remark: null, - goodsCount: 1, - deliveryFee: '0', - deliveryWords: null, - storeTotalAmount: '0', - storeTotalPayAmount: '179997', - storeTotalDiscountAmount: '110000', - storeTotalCouponAmount: '0', - skuDetailVos: [], - couponList: [ - { - couponId: 11, - storeId: '1000', - }, - ], - }, - ], - inValidGoodsList: null, - outOfStockGoodsList: null, - limitGoodsList: null, - abnormalDeliveryGoodsList: null, - invoiceSupport: 1, - }, - code: 'Success', - msg: null, - requestId: mockReqId(), - clientIp: mockIp(), - rt: 244, - success: true, - }; - - const list = transformGoodsDataToConfirmData(goodsRequestList); - - // 获取购物车传递的商品数据 - resp.data.storeGoodsList[0].skuDetailVos = list; - - // 判断是否携带优惠券数据 - const discountPrice = []; - - if (couponList && couponList.length > 0) { - couponList.forEach((coupon) => { - if (coupon.status === 'default') { - discountPrice.push({ - type: coupon.type, - value: coupon.value, - }); - } - }); - } - - // 模拟计算场景 - - // 计算总价 - const totalPrice = list.reduce((pre, cur) => { - return pre + cur.quantity * Number(cur.settlePrice); - }, 0); - - // 计算折扣 - const totalDiscountPrice = - discountPrice.length > 0 - ? discountPrice.reduce((pre, cur) => { - if (cur.type === 1) { - return pre + cur.value; - } - if (cur.type === 2) { - return pre + (Number(totalPrice) * cur.value) / 10; - } - - return pre + cur; - }, 0) - : 0; - - resp.data.totalSalePrice = totalPrice; - - resp.data.totalCouponAmount = totalDiscountPrice; - - resp.data.totalPayAmount = - totalPrice - totalDiscountPrice - Number(resp.data.totalPromotionAmount); - - if (userAddressReq) { - resp.data.settleType = 1; - resp.data.userAddress = userAddressReq; - } - return resp; -} diff --git a/model/order/orderDetail.js b/model/order/orderDetail.js deleted file mode 100644 index 032a08b..0000000 --- a/model/order/orderDetail.js +++ /dev/null @@ -1,1212 +0,0 @@ -import { mockIp, mockReqId } from '../../utils/mock'; - -const orderResps = [ - { - data: { - saasId: '88888888', - storeId: '1000', - storeName: '云Mall深圳旗舰店', - uid: '88888888205468', - parentOrderNo: '354021731671873099', - orderId: '354021735982432279', - orderNo: '354021731671873099', - orderType: 0, - orderSubType: 0, - orderStatus: 5, - orderSubStatus: null, - totalAmount: '10010', - goodsAmount: '10000', - goodsAmountApp: '10000', - paymentAmount: '20', - freightFee: '10', - packageFee: '0', - discountAmount: '9990', - channelType: 0, - channelSource: '', - channelIdentity: '', - remark: '买电风扇送电池吗', - cancelType: 0, - cancelReasonType: 0, - cancelReason: '', - rightsType: 0, - createTime: '1600350829288', - orderItemVOs: [ - { - id: '354021736133427225', - orderNo: null, - spuId: '3', - skuId: '135696670', - roomId: null, - goodsMainType: 0, - goodsViceType: 0, - goodsName: - '腾讯极光盒子4智能网络电视机顶盒6K千兆网络机顶盒4K高分辨率', - specifications: [ - { specTitle: '颜色', specValue: '贵族青' }, - { specTitle: '类型', specValue: '尊享礼盒装' }, - ], - goodsPictureUrl: - 'https://cdn-we-retail.ym.tencent.com/tsr/goods/dz-3b.png', - originPrice: '0', - actualPrice: '9999', - buyQuantity: 1, - itemTotalAmount: '9999', - itemDiscountAmount: '9990', - itemPaymentAmount: '10', - goodsPaymentPrice: '10', - tagPrice: null, - tagText: null, - outCode: null, - labelVOs: null, - buttonVOs: [{ primary: false }], - }, - ], - logisticsVO: { - logisticsType: 1, - logisticsNo: '', - logisticsStatus: null, - logisticsCompanyCode: '', - logisticsCompanyName: '', - receiverAddressId: '14', - provinceCode: '440000', - cityCode: '440300', - countryCode: '440306', - receiverProvince: '广东省', - receiverCity: '深圳市', - receiverCountry: '宝安区', - receiverArea: '', - receiverAddress: '沙井中心路28号丽沙花都xx栋xx号', - receiverPostCode: '', - receiverLongitude: '113.829127', - receiverLatitude: '22.713649', - receiverIdentity: '88888888205468', - receiverPhone: '17612345678', - receiverName: '测试用户', - expectArrivalTime: null, - senderName: '', - senderPhone: '', - senderAddress: '', - sendTime: null, - arrivalTime: null, - }, - paymentVO: { - payStatus: 1, - amount: '20', - currency: null, - payType: null, - payWay: null, - payWayName: null, - interactId: null, - traceNo: null, - channelTrxNo: null, - period: null, - payTime: null, - paySuccessTime: null, - }, - buttonVOs: [{ primary: true, type: 1, name: '付款' }], - labelVOs: null, - invoiceVO: null, - couponAmount: '0', - autoCancelTime: '1823652629288', - orderStatusName: '待付款', - orderSatusRemark: '需支付¥0.20', - logisticsLogVO: null, - invoiceStatus: 3, - invoiceDesc: '暂不开发票', - invoiceUrl: null, - }, - code: 'Success', - msg: null, - requestId: mockReqId(), - clientIp: mockIp(), - rt: 89, - success: true, - }, - { - data: { - saasId: '88888888', - storeId: '1000', - storeName: '云Mall深圳旗舰店', - uid: '88888888205468', - - parentOrderNo: '132381532610540875', - orderId: '132381537256650240', - orderNo: '132381532610540875', - orderType: 0, - orderSubType: 0, - orderStatus: 10, - orderSubStatus: null, - totalAmount: '76600', - goodsAmount: '76600', - goodsAmountApp: '76600', - paymentAmount: '36800', - freightFee: '0', - packageFee: '0', - discountAmount: '34800', - channelType: 0, - channelSource: '', - channelIdentity: '', - remark: '麻烦给个配饰', - cancelType: 0, - cancelReasonType: 0, - cancelReason: '', - rightsType: 0, - - createTime: '1587140043976', - - orderItemVOs: [ - { - id: '132381537407645696', - orderNo: null, - spuId: '0', - skuId: '135676631', - roomId: null, - goodsMainType: 0, - goodsViceType: 0, - goodsName: '白色短袖连衣裙荷叶边裙摆宽松韩版休闲纯白清爽优雅连衣裙', - goodsPictureUrl: - 'https://cdn-we-retail.ym.tencent.com/tsr/goods/nz-09a.png', - originPrice: '40000', - actualPrice: '29800', - specifications: [ - { - specTitle: '颜色', - specValue: '米色荷叶边', - }, - { - specTitle: '尺码', - specValue: 'S', - }, - ], - buyQuantity: 1, - itemTotalAmount: '29800', - itemDiscountAmount: '19813', - itemPaymentAmount: '9987', - goodsPaymentPrice: '9987', - tagPrice: null, - tagText: null, - outCode: null, - labelVOs: null, - buttonVOs: null, - }, - { - id: '132381537407645952', - orderNo: null, - spuId: '7', - skuId: '135691633', - roomId: null, - goodsMainType: 0, - goodsViceType: 0, - goodsName: - '不锈钢刀叉勺套装家用西餐餐具ins简约耐用不锈钢金色银色可选', - goodsPictureUrl: - 'https://cdn-we-retail.ym.tencent.com/tsr/goods/gh-2b.png', - originPrice: '29900', - actualPrice: '19900', - specifications: [ - { specTitle: '颜色', specValue: '奶黄色' }, - { specTitle: '类型', specValue: '三件套' }, - ], - buyQuantity: 1, - itemTotalAmount: '19900', - itemDiscountAmount: '13230', - itemPaymentAmount: '6670', - goodsPaymentPrice: '6670', - tagPrice: null, - tagText: null, - outCode: null, - labelVOs: null, - buttonVOs: null, - }, - { - id: '132381537407646208', - orderNo: null, - spuId: '1', - skuId: '135691631', - roomId: null, - goodsMainType: 0, - goodsViceType: 0, - goodsName: - '纯色纯棉休闲圆领短袖T恤纯白亲肤厚柔软细腻面料纯白短袖套头T恤', - goodsPictureUrl: - 'https://cdn-we-retail.ym.tencent.com/tsr/goods/nz-08a.png', - originPrice: '31900', - actualPrice: '26900', - specifications: [ - { - specTitle: '颜色', - specValue: '白色', - }, - { - specTitle: '尺码', - specValue: 'S', - }, - ], - buyQuantity: 1, - itemTotalAmount: '26900', - itemDiscountAmount: '6757', - itemPaymentAmount: '20143', - goodsPaymentPrice: '20143', - tagPrice: null, - tagText: null, - outCode: null, - labelVOs: null, - buttonVOs: null, - }, - ], - logisticsVO: { - logisticsType: 1, - logisticsNo: '', - logisticsStatus: null, - logisticsCompanyCode: '', - logisticsCompanyName: '', - - receiverAddressId: '2', - provinceCode: '440000', - cityCode: '440300', - countryCode: '440306', - receiverProvince: '广东省', - receiverCity: '广州市', - receiverCountry: '海珠区', - receiverArea: '', - receiverAddress: '新港中路397号', - receiverPostCode: '', - receiverLongitude: '113.829127', - receiverLatitude: '22.713649', - receiverIdentity: '88888888205468', - receiverPhone: '17612345678', - receiverName: '张三', - expectArrivalTime: null, - senderName: '', - senderPhone: '', - senderAddress: '', - sendTime: null, - arrivalTime: null, - }, - paymentVO: { - payStatus: 1, - amount: '36800', - currency: 'CNY', - payType: 0, - payWay: null, - payWayName: null, - interactId: '4923587', - traceNo: null, - channelTrxNo: null, - period: null, - payTime: '1600162877000', - paySuccessTime: '1600162877538', - }, - buttonVOs: [ - { - primary: false, - type: 2, - name: '取消订单', - }, - { - primary: true, - type: 9, - name: '再次购买', - }, - ], - labelVOs: null, - invoiceVO: { - buyerName: '腾讯计算机有限公司', //个人或公司名称 - buyerTaxNo: '9144 9808 0909 0293 XG', //税号 - buyerPhone: '18600008888', //手机 - email: '73900484@qq.com', //邮箱 - titleType: 2, //发票抬头 1-个人 2-公司 - ontentType: 1, //发票内容 1-明细 2类别 - invoiceType: 5, //是否开票 0-不开 5-电子发票 - money: '1.54', - }, - trajectoryVos: [ - { - title: '已下单', - icon: 'https://cdn-we-retail.ym.tencent.com/web/trajectoryIcons/ordered.svg', - code: '200002', - nodes: [ - { - status: '订单已经支付成功,支付方式为:微信支付', - timestamp: '1600162877506', - remark: null, - }, - ], - isShow: true, - }, - { - title: '', - icon: null, - code: '200001', - nodes: [ - { - status: '订单已提交', - timestamp: '1600162856204', - remark: null, - }, - ], - isShow: true, - }, - ], - - couponAmount: '5000', - autoCancelTime: null, - orderStatusName: '待发货', - orderSatusRemark: null, - logisticsLogVO: null, - invoiceStatus: 3, - invoiceDesc: '暂不开发票', - invoiceUrl: null, - }, - code: 'Success', - msg: null, - requestId: mockReqId(), - clientIp: mockIp(), - rt: 79, - success: true, - }, - { - data: { - saasId: '88888888', - storeId: '1000', - storeName: '云Mall深圳旗舰店', - uid: '88888888205468', - parentOrderNo: '132222623132329291', - orderId: '132222629674264064', - orderNo: '132222623132329291', - orderType: 0, - orderSubType: 0, - orderStatus: 40, - orderSubStatus: null, - totalAmount: '500400', - goodsAmount: '500400', - goodsAmountApp: '500400', - paymentAmount: '458600', - freightFee: '0', - packageFee: '0', - discountAmount: '36800', - channelType: 0, - channelSource: '', - channelIdentity: '', - remark: '我是买一送一的,记得送', - cancelType: 3, - cancelReasonType: 0, - cancelReason: '', - rightsType: 0, - createTime: '1587130572345', - orderItemVOs: [ - { - id: '132222629825259776', - orderNo: null, - spuId: '5', - skuId: '135691625', - roomId: null, - goodsMainType: 0, - goodsViceType: 0, - goodsName: - '迷你便携高颜值蓝牙无线耳机立体声只能触控式操作简约立体声耳机', - goodsPictureUrl: - 'https://cdn-we-retail.ym.tencent.com/tsr/goods/dz-2a.png', - originPrice: '15900', - actualPrice: '8900', - specifications: [ - { - specTitle: '颜色', - specValue: '黑色', - }, - { - specTitle: '尺码', - specValue: '简约款', - }, - ], - buyQuantity: 1, - itemTotalAmount: '8900', - itemDiscountAmount: '2134', - itemPaymentAmount: '6766', - goodsPaymentPrice: '6766', - tagPrice: null, - tagText: null, - outCode: null, - labelVOs: null, - buttonVOs: [{ primary: false, type: 4, name: '申请售后' }], - }, - { - id: '132222629825260032', - orderNo: null, - spuId: '0', - skuId: '135676631', - roomId: null, - goodsMainType: 0, - goodsViceType: 0, - goodsName: '白色短袖连衣裙荷叶边裙摆宽松韩版休闲纯白清爽优雅连衣裙', - goodsPictureUrl: - 'https://cdn-we-retail.ym.tencent.com/tsr/goods/nz-09a.png', - originPrice: '40000', - actualPrice: '29800', - specifications: [ - { - specTitle: '颜色', - specValue: '米色荷叶边', - }, - { - specTitle: '尺码', - specValue: 'S', - }, - ], - buyQuantity: 1, - itemTotalAmount: '29800', - itemDiscountAmount: '4026', - itemPaymentAmount: '25774', - goodsPaymentPrice: '25774', - tagPrice: null, - tagText: null, - outCode: null, - labelVOs: null, - buttonVOs: [{ primary: false, type: 4, name: '申请售后' }], - }, - { - id: '132222629825260288', - orderNo: null, - spuId: '3', - skuId: '135691622', - roomId: null, - goodsMainType: 0, - goodsViceType: 0, - goodsName: - '腾讯极光盒子4智能网络电视机顶盒6K千兆网络机顶盒4K高分辨率', - goodsPictureUrl: - 'https://cdn-we-retail.ym.tencent.com/tsr/goods/dz-3a.png', - originPrice: '16900', - actualPrice: '9900', - specifications: [ - { - specTitle: '颜色', - specValue: '经典白', - }, - { - specTitle: '类型', - specValue: '经典套装', - }, - ], - buyQuantity: 1, - itemTotalAmount: '9900', - itemDiscountAmount: '1337', - itemPaymentAmount: '8563', - goodsPaymentPrice: '8563', - tagPrice: null, - tagText: null, - outCode: null, - labelVOs: null, - buttonVOs: [{ primary: false, type: 4, name: '申请售后' }], - }, - { - id: '132222629825260544', - orderNo: null, - spuId: '135681628', - skuId: '135676629', - roomId: null, - goodsMainType: 0, - goodsViceType: 0, - goodsName: - '带帽午休毯虎年款多功能加厚加大加绒简约多功能午休毯连帽披肩', - goodsPictureUrl: - 'https://cdn-we-retail.ym.tencent.com/tsr/goods/muy-3a.png', - originPrice: '39900', - actualPrice: '29900', - specifications: [ - { - specTitle: '颜色', - specValue: '浅灰色', - }, - { - specTitle: '尺码', - specValue: 'S', - }, - ], - buyQuantity: 4, - itemTotalAmount: '119600', - itemDiscountAmount: '4040', - itemPaymentAmount: '115560', - goodsPaymentPrice: '28890', - tagPrice: null, - tagText: null, - outCode: null, - labelVOs: null, - buttonVOs: [{ primary: false, type: 4, name: '申请售后' }], - }, - { - id: '132222629825260800', - orderNo: null, - spuId: '2', - skuId: '135686631', - roomId: null, - goodsMainType: 0, - goodsViceType: 0, - goodsName: '运动连帽拉链卫衣休闲开衫长袖多色运动细绒面料运动上衣', - goodsPictureUrl: - 'https://cdn-we-retail.ym.tencent.com/tsr/goods/nz-17a.png', - originPrice: '39900', - actualPrice: '25900', - specifications: [ - { - specTitle: '颜色', - specValue: '军绿色', - }, - { - specTitle: '尺码', - specValue: 'XS', - }, - ], - buyQuantity: 1, - itemTotalAmount: '25900', - itemDiscountAmount: '392', - itemPaymentAmount: '25508', - goodsPaymentPrice: '25508', - tagPrice: null, - tagText: null, - outCode: null, - labelVOs: null, - buttonVOs: [{ primary: false, type: 4, name: '申请售后' }], - }, - ], - logisticsVO: { - logisticsType: 1, - logisticsNo: '111112', - logisticsStatus: null, - logisticsCompanyCode: 'yunda', - logisticsCompanyName: '韵达快递', - - receiverAddressId: '8', - provinceCode: '440000', - cityCode: '440300', - countryCode: '440306', - receiverProvince: '广东省', - receiverCity: '深圳市', - receiverCountry: '南山区', - receiverArea: '', - receiverAddress: '前海路333号阳光玫瑰园', - receiverPostCode: '', - receiverLongitude: '113.829127', - receiverLatitude: '22.713649', - receiverIdentity: '700000011070005', - receiverPhone: '17612345678', - receiverName: '平均线', - expectArrivalTime: null, - senderName: '', - senderPhone: '', - senderAddress: '', - sendTime: '1599795293089', - arrivalTime: null, - }, - paymentVO: { - payStatus: 1, - amount: '458600', - currency: 'CNY', - payType: 0, - payWay: null, - payWayName: null, - interactId: '66869', - traceNo: null, - channelTrxNo: null, - period: null, - payTime: '1594869391000', - paySuccessTime: '1594869391287', - }, - buttonVOs: [ - { - primary: true, - type: 3, - name: '确认收货', - }, - ], - labelVOs: null, - trajectoryVos: [ - { - title: '已发货', - icon: 'deliver', - code: '200003', - nodes: [ - { - status: '商家已发货,物流承运商:韵达快递', - timestamp: '1599795293089', - remark: null, - }, - ], - isShow: true, - }, - { - title: '已下单', - icon: 'https://cdn-we-retail.ym.tencent.com/web/trajectoryIcons/ordered.svg', - code: '200002', - nodes: [ - { - status: '订单已经支付成功,支付方式为:微信支付', - timestamp: '1594869391220', - remark: null, - }, - ], - isShow: true, - }, - { - title: '', - icon: null, - code: '200001', - nodes: [ - { - status: '订单已提交', - timestamp: '1594869381185', - remark: null, - }, - ], - isShow: true, - }, - ], - - couponAmount: '5000', - autoCancelTime: null, - orderStatusName: '待收货', - orderSatusRemark: null, - logisticsLogVO: null, - invoiceStatus: 1, - invoiceDesc: '已开发票', - invoiceUrl: null, - invoiceVO: { - buyerName: '公司名称XXXX', //个人或公司名称 - buyerTaxNo: 'R5647U7', //税号 - buyerPhone: '13534343434', //手机 - email: '123@qq.com', //邮箱 - titleType: 2, //发票抬头 1-个人 2-公司 - ontentType: 2, //发票内容 1-明细 2类别 - invoiceType: 5, //是否开票 0-不开 5-电子发票 - isInvoice: '已开票', - money: 10000, - }, - }, - code: 'Success', - msg: null, - requestId: mockReqId(), - clientIp: mockIp(), - rt: 74, - success: true, - }, - { - data: { - saasId: '88888888', - storeId: '1000', - storeName: '云Mall深圳旗舰店', - uid: '88888888205468', - parentOrderNo: '130862219672031307', - orderId: '130862224737571072', - orderNo: '130862219672031307', - orderType: 0, - orderSubType: 0, - orderStatus: 80, - orderSubStatus: null, - totalAmount: '298000', - goodsAmount: '298000', - goodsAmountApp: '298000', - paymentAmount: '263200', - freightFee: '0', - packageFee: '0', - discountAmount: '29800', - channelType: 0, - channelSource: '', - channelIdentity: '', - remark: '', - cancelType: 3, - cancelReasonType: 0, - cancelReason: '超时未支付', - rightsType: 0, - createTime: '1587049485895', - orderItemVOs: [ - { - id: '130862224922120960', - orderNo: null, - spuId: '0', - skuId: '135676631', - roomId: null, - goodsMainType: 0, - goodsViceType: 0, - goodsName: '白色短袖连衣裙荷叶边裙摆宽松韩版休闲纯白清爽优雅连衣裙', - goodsPictureUrl: - 'https://cdn-we-retail.ym.tencent.com/tsr/goods/nz-09a.png', - originPrice: '40000', - actualPrice: '29800', - specifications: [ - { specTitle: '颜色', specValue: '米色荷叶边' }, - { specTitle: '尺码', specValue: 'S' }, - ], - buyQuantity: 10, - itemTotalAmount: '298000', - itemDiscountAmount: '29800', - itemPaymentAmount: '268200', - goodsPaymentPrice: '26820', - tagPrice: null, - tagText: null, - outCode: null, - labelVOs: null, - buttonVOs: null, - }, - ], - logisticsVO: { - logisticsType: 1, - logisticsNo: '', - logisticsStatus: null, - logisticsCompanyCode: '', - logisticsCompanyName: '', - receiverAddressId: '2', - provinceCode: '440000', - cityCode: '440300', - countryCode: '440306', - receiverProvince: '广东省', - receiverCity: '深圳市', - receiverCountry: '宝安区', - receiverArea: '', - receiverAddress: '沙井中心路28号丽沙花都xx栋xx号', - receiverPostCode: '', - receiverLongitude: '113.829127', - receiverLatitude: '22.713649', - receiverIdentity: '88888888205468', - receiverPhone: '17612345678', - receiverName: '测试用户', - expectArrivalTime: null, - senderName: '', - senderPhone: '', - senderAddress: '', - sendTime: null, - arrivalTime: null, - }, - paymentVO: { - payStatus: 1, - amount: '263200', - currency: null, - payType: null, - payWay: null, - payWayName: null, - interactId: null, - traceNo: null, - channelTrxNo: null, - period: null, - payTime: null, - paySuccessTime: null, - }, - buttonVOs: null, - labelVOs: null, - invoiceVO: null, - couponAmount: '5000', - autoCancelTime: null, - orderStatusName: '已取消(未支付)', - orderSatusRemark: '超时未支付', - logisticsLogVO: null, - invoiceStatus: 2, - invoiceDesc: '暂不开发票', - invoiceUrl: null, - }, - code: 'Success', - msg: null, - requestId: mockReqId(), - clientIp: mockIp(), - rt: 70, - success: true, - }, - { - data: { - saasId: '88888888', - storeId: '1000', - storeName: '云Mall深圳旗舰店', - uid: '88888888205468', - parentOrderNo: '130494472895208267', - orderId: '130494482155052032', - orderNo: '130494472895208267', - orderType: 0, - orderSubType: 0, - orderStatus: 80, - orderSubStatus: null, - totalAmount: '59700', - goodsAmount: '59700', - goodsAmountApp: '59700', - paymentAmount: '24900', - freightFee: '0', - packageFee: '0', - discountAmount: '29800', - channelType: 0, - channelSource: '', - channelIdentity: '', - remark: '', - cancelType: 3, - cancelReasonType: 0, - cancelReason: '超时未支付', - rightsType: 0, - createTime: '1587027566726', - orderItemVOs: [ - { - id: '130494482322824704', - orderNo: null, - spuId: '7', - skuId: '135691633', - roomId: null, - goodsMainType: 0, - goodsViceType: 0, - goodsName: - '不锈钢刀叉勺套装家用西餐餐具ins简约耐用不锈钢金色银色可选', - goodsPictureUrl: - 'https://cdn-we-retail.ym.tencent.com/tsr/goods/gh-2b.png', - originPrice: '29900', - actualPrice: '19900', - specifications: [ - { specTitle: '颜色', specValue: '奶黄色' }, - { specTitle: '类型', specValue: '三件套' }, - ], - buyQuantity: 3, - itemTotalAmount: '59700', - itemDiscountAmount: '29800', - itemPaymentAmount: '29900', - goodsPaymentPrice: '9966', - tagPrice: null, - tagText: null, - outCode: null, - labelVOs: null, - buttonVOs: null, - }, - ], - logisticsVO: { - logisticsType: 1, - logisticsNo: '', - logisticsStatus: null, - logisticsCompanyCode: '', - logisticsCompanyName: '', - receiverAddressId: '2', - provinceCode: '440000', - cityCode: '440300', - countryCode: '440306', - receiverProvince: '广东省', - receiverCity: '深圳市', - receiverCountry: '宝安区', - receiverArea: '', - receiverAddress: '沙井中心路28号丽沙花都xx栋xx号', - receiverPostCode: '', - receiverLongitude: '113.829127', - receiverLatitude: '22.713649', - receiverIdentity: '88888888205468', - receiverPhone: '17612345678', - receiverName: '测试用户', - expectArrivalTime: null, - senderName: '', - senderPhone: '', - senderAddress: '', - sendTime: null, - arrivalTime: null, - }, - paymentVO: { - payStatus: 1, - amount: '24900', - currency: null, - payType: null, - payWay: null, - payWayName: null, - interactId: null, - traceNo: null, - channelTrxNo: null, - period: null, - payTime: null, - paySuccessTime: null, - }, - buttonVOs: null, - labelVOs: null, - invoiceVO: null, - couponAmount: '5000', - autoCancelTime: null, - orderStatusName: '已取消(未支付)', - orderSatusRemark: '超时未支付', - logisticsLogVO: null, - invoiceStatus: 3, - invoiceDesc: '暂不开发票', - invoiceUrl: null, - }, - code: 'Success', - msg: null, - requestId: mockReqId(), - clientIp: mockIp(), - rt: 81, - success: true, - }, - { - data: { - saasId: '88888888', - storeId: '1000', - storeName: '云Mall深圳旗舰店', - uid: '88888888205468', - parentOrderNo: '130169571554503755', - orderId: '130169572291521792', - orderNo: '130169571554503755', - orderType: 0, - orderSubType: 0, - orderStatus: 50, - orderSubStatus: null, - totalAmount: '538000', - goodsAmount: '538000', - goodsAmountApp: '538000', - paymentAmount: '508200', - freightFee: '0', - packageFee: '0', - discountAmount: '29800', - channelType: 0, - channelSource: '', - channelIdentity: '', - remark: '', - cancelType: 0, - cancelReasonType: 0, - cancelReason: '', - rightsType: 10, - createTime: '1587008200587', - orderItemVOs: [ - { - id: '130169572425740032', - orderNo: null, - spuId: '1', - skuId: '135691631', - roomId: null, - goodsMainType: 0, - goodsViceType: 0, - goodsName: - '纯色纯棉休闲圆领短袖T恤纯白亲肤厚柔软细腻面料纯白短袖套头T恤', - goodsPictureUrl: - 'https://cdn-we-retail.ym.tencent.com/tsr/goods/nz-08b.png', - originPrice: '31900', - actualPrice: '26900', - specifications: [ - { specTitle: '颜色', specValue: '橙色' }, - { specTitle: '尺码', specValue: 'M' }, - ], - buyQuantity: 20, - itemTotalAmount: '538000', - itemDiscountAmount: '29800', - itemPaymentAmount: '508200', - goodsPaymentPrice: '25410', - tagPrice: null, - tagText: null, - outCode: null, - labelVOs: null, - buttonVOs: null, - }, - ], - logisticsVO: { - logisticsType: 1, - logisticsNo: '123', - logisticsStatus: null, - logisticsCompanyCode: 'zhongtong', - logisticsCompanyName: '中通速递', - receiverAddressId: '2', - provinceCode: '440000', - cityCode: '440300', - countryCode: '440306', - receiverProvince: '广东省', - receiverCity: '深圳市', - receiverCountry: '宝安区', - receiverArea: '', - receiverAddress: '沙井中心路28号丽沙花都xx栋xx号', - receiverPostCode: '', - receiverLongitude: '113.829127', - receiverLatitude: '22.713649', - receiverIdentity: '88888888205468', - receiverPhone: '17612345678', - receiverName: '测试用户', - expectArrivalTime: null, - senderName: '', - senderPhone: '', - senderAddress: '', - sendTime: '1587008529453', - arrivalTime: '1587008623995', - }, - paymentVO: { - payStatus: 2, - amount: '508200', - currency: 'CNY', - payType: 0, - payWay: 0, - payWayName: '微信支付', - interactId: '121212', - traceNo: '121212', - channelTrxNo: '121212', - period: null, - payTime: '2020-03-23 00:00:00', - paySuccessTime: '2020-04-16 11:36:41', - }, - buttonVOs: [ - { primary: false, type: 4, name: '申请售后' }, - { primary: true, type: 6, name: '评价' }, - ], - labelVOs: null, - invoiceVO: { - buyerName: '腾讯计算机有限公司', //个人或公司名称 - buyerTaxNo: '9144 9808 0909 0293 XG', //税号 - buyerPhone: '18600008888', //手机 - email: '73900484@qq.com', //邮箱 - titleType: 2, //发票抬头 1-个人 2-公司 - ontentType: 1, //发票内容 1-明细 2类别 - invoiceType: 5, //是否开票 0-不开 5-电子发票 - money: '1.54', - }, - couponAmount: '0', - autoCancelTime: null, - orderStatusName: '交易完成', - orderSatusRemark: null, - logisticsLogVO: null, - invoiceStatus: 2, - invoiceDesc: '暂不开发票', - invoiceUrl: null, - }, - code: 'Success', - msg: null, - requestId: mockReqId(), - clientIp: mockIp(), - rt: 91, - success: true, - }, - { - data: { - saasId: '88888888', - storeId: '1000', - storeName: '云Mall深圳旗舰店', - uid: '88888888205468', - parentOrderNo: '130150835531421259', - orderId: '130150836385879808', - orderNo: '130150835531421259', - orderType: 0, - orderSubType: 0, - orderStatus: 50, - orderSubStatus: null, - totalAmount: '29800', - goodsAmount: '29800', - goodsAmountApp: '29800', - paymentAmount: '4000', - freightFee: '0', - packageFee: '0', - discountAmount: '25800', - channelType: 0, - channelSource: '', - channelIdentity: '', - remark: '', - cancelType: 0, - cancelReasonType: 0, - cancelReason: '', - rightsType: 0, - createTime: '1587007083839', - orderItemVOs: [ - { - id: '130150836520098048', - orderNo: null, - spuId: '0', - skuId: '135681631', - roomId: null, - goodsMainType: 0, - goodsViceType: 0, - goodsName: '白色短袖连衣裙荷叶边裙摆宽松韩版休闲纯白清爽优雅连衣裙', - goodsPictureUrl: - 'https://cdn-we-retail.ym.tencent.com/tsr/goods/nz-09a.png', - originPrice: '40000', - actualPrice: '29800', - specifications: [ - { specTitle: '颜色', specValue: '米色荷叶边' }, - { specTitle: '尺码', specValue: 'M' }, - ], - buyQuantity: 1, - itemTotalAmount: '29800', - itemDiscountAmount: '25800', - itemPaymentAmount: '4000', - goodsPaymentPrice: '4000', - tagPrice: null, - tagText: null, - outCode: null, - labelVOs: null, - buttonVOs: null, - }, - ], - logisticsVO: { - logisticsType: 1, - logisticsNo: '123', - logisticsStatus: null, - logisticsCompanyCode: 'yuantong', - logisticsCompanyName: '圆通速递', - receiverAddressId: '2', - provinceCode: '440000', - cityCode: '440300', - countryCode: '440306', - receiverProvince: '广东省', - receiverCity: '深圳市', - receiverCountry: '宝安区', - receiverArea: '', - receiverAddress: '沙井中心路28号丽沙花都xx栋xx号', - receiverPostCode: '', - receiverLongitude: '113.829127', - receiverLatitude: '22.713649', - receiverIdentity: '88888888205468', - receiverPhone: '17612345678', - receiverName: '测试用户', - expectArrivalTime: null, - senderName: '', - senderPhone: '', - senderAddress: '', - sendTime: '1587008539953', - arrivalTime: '1588291200508', - }, - paymentVO: { - payStatus: 2, - amount: '4000', - currency: 'RNB', - payType: 0, - payWay: 0, - payWayName: '微信支付', - interactId: '121212', - traceNo: '121212', - channelTrxNo: '121212', - period: null, - payTime: '2020-03-23 00:00:00', - paySuccessTime: '2020-04-16 11:18:09', - }, - buttonVOs: [ - { primary: false, type: 4, name: '申请售后' }, - { primary: true, type: 6, name: '评价' }, - ], - labelVOs: null, - invoiceVO: null, - couponAmount: '0', - autoCancelTime: null, - orderStatusName: '交易完成', - orderSatusRemark: null, - logisticsLogVO: null, - invoiceStatus: 2, - invoiceDesc: '暂不开发票', - invoiceUrl: null, - }, - code: 'Success', - msg: null, - requestId: mockReqId(), - clientIp: mockIp(), - rt: 95, - success: true, - }, -]; - -export function genOrderDetail(params) { - const { parameter } = params; - const resp = orderResps.find((r) => r.data.orderNo === parameter); - return resp; -} - -export function genBusinessTime() { - const resp = { - data: { - businessTime: ['周一,周二,周三,周四,周五:00:20:00-08:00:00'], - telphone: '18565372257', - saasId: '88888888', - }, - code: 'Success', - msg: null, - requestId: mockReqId(), - clientIp: mockIp(), - rt: 3, - success: true, - }; - return resp; -} diff --git a/model/order/orderList.js b/model/order/orderList.js deleted file mode 100644 index a581fbb..0000000 --- a/model/order/orderList.js +++ /dev/null @@ -1,1054 +0,0 @@ -import { mockIp, mockReqId } from '../../utils/mock'; - -export function genOrders(params) { - const resp = { - data: { - pageNum: 1, - pageSize: 10, - totalCount: 7, - orders: [ - { - saasId: '88888888', - storeId: '1000', - storeName: '云Mall深圳旗舰店', - uid: '88888888205468', - parentOrderNo: '354021731671873099', - orderId: '354021735982432279', - orderNo: '354021731671873099', - orderType: 0, - orderSubType: 0, - orderStatus: 5, - orderSubStatus: null, - totalAmount: '10010', - goodsAmount: '10000', - goodsAmountApp: '10000', - paymentAmount: '20', - freightFee: '10', - packageFee: '0', - discountAmount: '9990', - channelType: 0, - channelSource: '', - channelIdentity: '', - remark: '', - cancelType: null, - cancelReasonType: null, - cancelReason: null, - rightsType: null, - createTime: '1600350829291', - orderItemVOs: [ - { - id: '354021736133427225', - orderNo: null, - spuId: '3', - skuId: '135696670', - roomId: null, - goodsMainType: 0, - goodsViceType: 0, - goodsName: - '腾讯极光盒子4智能网络电视机顶盒6K千兆网络机顶盒4K高分辨率', - specifications: [ - { specTitle: '颜色', specValue: '贵族青' }, - { specTitle: '类型', specValue: '尊享礼盒装' }, - ], - goodsPictureUrl: - 'https://cdn-we-retail.ym.tencent.com/tsr/goods/dz-3b.png', - originPrice: '0', - actualPrice: '9999', - buyQuantity: 1, - itemTotalAmount: '9999', - itemDiscountAmount: '9990', - itemPaymentAmount: '10', - goodsPaymentPrice: '10', - tagPrice: null, - tagText: null, - outCode: null, - labelVOs: null, - buttonVOs: null, - }, - ], - logisticsVO: { - logisticsType: 1, - logisticsNo: '', - logisticsStatus: null, - logisticsCompanyCode: '', - logisticsCompanyName: '', - receiverAddressId: '14', - provinceCode: '440000', - cityCode: '440300', - countryCode: '440306', - receiverProvince: '广东省', - receiverCity: '深圳市', - receiverCountry: '宝安区', - receiverArea: '', - receiverAddress: '沙井中心路28号丽沙花都xx栋xx号', - receiverPostCode: '', - receiverLongitude: '113.829127', - receiverLatitude: '22.713649', - receiverIdentity: '88888888205468', - receiverPhone: '17612345678', - receiverName: '测试用户', - expectArrivalTime: null, - senderName: '', - senderPhone: '', - senderAddress: '', - sendTime: null, - arrivalTime: null, - }, - paymentVO: { - payStatus: 1, - amount: '20', - currency: null, - payType: null, - payWay: null, - payWayName: null, - interactId: null, - traceNo: null, - channelTrxNo: null, - period: null, - payTime: null, - paySuccessTime: null, - }, - buttonVOs: [ - { primary: false, type: 2, name: '取消订单' }, - { primary: true, type: 1, name: '付款' }, - ], - labelVOs: null, - invoiceVO: null, - couponAmount: null, - autoCancelTime: '1600352629291', - orderStatusName: '待付款', - orderSatusRemark: '需支付¥0.20', - logisticsLogVO: null, - invoiceStatus: null, - invoiceDesc: null, - invoiceUrl: null, - }, - { - saasId: '88888888', - storeId: '1000', - storeName: '云Mall深圳旗舰店', - uid: '88888888205468', - parentOrderNo: '132381532610540875', - orderId: '132381537256650240', - orderNo: '132381532610540875', - orderType: 0, - orderSubType: 0, - orderStatus: 10, - orderSubStatus: null, - totalAmount: '76600', - goodsAmount: '76600', - goodsAmountApp: '76600', - paymentAmount: '36800', - freightFee: '0', - packageFee: '0', - discountAmount: '39800', - channelType: 0, - channelSource: '', - channelIdentity: '', - remark: '', - cancelType: null, - cancelReasonType: null, - cancelReason: null, - rightsType: null, - createTime: '1587140043980', - orderItemVOs: [ - { - id: '132381537407645696', - orderNo: null, - spuId: '0', - skuId: '135676631', - roomId: null, - goodsMainType: 0, - goodsViceType: 0, - goodsName: - '白色短袖连衣裙荷叶边裙摆宽松韩版休闲纯白清爽优雅连衣裙', - goodsPictureUrl: - 'https://cdn-we-retail.ym.tencent.com/tsr/goods/nz-09a.png', - originPrice: '40000', - actualPrice: '29800', - specifications: [ - { specTitle: '颜色', specValue: '米色荷叶边' }, - { specTitle: '尺码', specValue: 'S' }, - ], - buyQuantity: 1, - itemTotalAmount: '29800', - itemDiscountAmount: '19813', - itemPaymentAmount: '9987', - goodsPaymentPrice: '9987', - tagPrice: null, - tagText: null, - outCode: null, - labelVOs: null, - buttonVOs: null, - }, - { - id: '132381537407645952', - orderNo: null, - spuId: '7', - skuId: '135691633', - roomId: null, - goodsMainType: 0, - goodsViceType: 0, - goodsName: - '不锈钢刀叉勺套装家用西餐餐具ins简约耐用不锈钢金色银色可选', - goodsPictureUrl: - 'https://cdn-we-retail.ym.tencent.com/tsr/goods/gh-2b.png', - originPrice: '29900', - actualPrice: '19900', - specifications: [ - { specTitle: '颜色', specValue: '奶黄色' }, - { specTitle: '类型', specValue: '三件套' }, - ], - buyQuantity: 1, - itemTotalAmount: '19900', - itemDiscountAmount: '13230', - itemPaymentAmount: '6670', - goodsPaymentPrice: '6670', - tagPrice: null, - tagText: null, - outCode: null, - labelVOs: null, - buttonVOs: null, - }, - { - id: '132381537407646208', - orderNo: null, - spuId: '1', - skuId: '135691631', - roomId: null, - goodsMainType: 0, - goodsViceType: 0, - goodsName: - '纯色纯棉休闲圆领短袖T恤纯白亲肤厚柔软细腻面料纯白短袖套头T恤', - goodsPictureUrl: - 'https://cdn-we-retail.ym.tencent.com/tsr/goods/nz-08a.png', - originPrice: '31900', - actualPrice: '26900', - specifications: [ - { specTitle: '颜色', specValue: '白色' }, - { specTitle: '尺码', specValue: 'S' }, - ], - buyQuantity: 1, - itemTotalAmount: '26900', - itemDiscountAmount: '6757', - itemPaymentAmount: '20143', - goodsPaymentPrice: '20143', - tagPrice: null, - tagText: null, - outCode: null, - labelVOs: null, - buttonVOs: null, - }, - ], - logisticsVO: { - logisticsType: 1, - logisticsNo: '', - logisticsStatus: null, - logisticsCompanyCode: '', - logisticsCompanyName: '', - receiverAddressId: '2', - provinceCode: '440000', - cityCode: '440300', - countryCode: '440306', - receiverProvince: '广东省', - receiverCity: '深圳市', - receiverCountry: '南山区', - receiverArea: '', - receiverAddress: '前海路333号阳光玫瑰园', - receiverPostCode: '', - receiverLongitude: '113.829127', - receiverLatitude: '22.713649', - receiverIdentity: '88888888205468', - receiverPhone: '17612345678', - receiverName: '平均线', - expectArrivalTime: null, - senderName: '', - senderPhone: '', - senderAddress: '', - sendTime: null, - arrivalTime: null, - }, - paymentVO: { - payStatus: 1, - amount: '36800', - currency: null, - payType: null, - payWay: null, - payWayName: null, - interactId: null, - traceNo: null, - channelTrxNo: null, - period: null, - payTime: null, - paySuccessTime: null, - }, - buttonVOs: [ - { - primary: false, - type: 2, - name: '取消订单', - }, - { - primary: true, - type: 9, - name: '再次购买', - }, - ], - labelVOs: null, - invoiceVO: null, - couponAmount: null, - autoCancelTime: null, - orderStatusName: '待发货', - orderSatusRemark: null, - logisticsLogVO: null, - invoiceStatus: null, - invoiceDesc: null, - invoiceUrl: null, - }, - { - saasId: '88888888', - storeId: '1000', - storeName: '云Mall深圳旗舰店', - uid: '88888888205468', - parentOrderNo: '132222623132329291', - orderId: '132222629674264064', - orderNo: '132222623132329291', - orderType: 0, - orderSubType: 0, - orderStatus: 40, - orderSubStatus: null, - totalAmount: '500400', - goodsAmount: '500400', - goodsAmountApp: '500400', - paymentAmount: '458600', - freightFee: '0', - packageFee: '0', - discountAmount: '41800', - channelType: 0, - channelSource: '', - channelIdentity: '', - remark: '', - cancelType: null, - cancelReasonType: null, - cancelReason: null, - rightsType: null, - createTime: '1587130572349', - orderItemVOs: [ - { - id: '132222629825259776', - orderNo: null, - spuId: '5', - skuId: '135691625', - roomId: null, - goodsMainType: 0, - goodsViceType: 0, - goodsName: - '迷你便携高颜值蓝牙无线耳机立体声只能触控式操作简约立体声耳机', - goodsPictureUrl: - 'https://cdn-we-retail.ym.tencent.com/tsr/goods/dz-2a.png', - originPrice: '15900', - actualPrice: '8900', - specifications: [ - { specTitle: '颜色', specValue: '黑色' }, - { specTitle: '尺码', specValue: '简约' }, - ], - buyQuantity: 1, - itemTotalAmount: '8900', - itemDiscountAmount: '2134', - itemPaymentAmount: '6766', - goodsPaymentPrice: '6766', - tagPrice: null, - tagText: null, - outCode: null, - labelVOs: null, - buttonVOs: null, - }, - { - id: '132222629825260032', - orderNo: null, - spuId: '0', - skuId: '135676631', - roomId: null, - goodsMainType: 0, - goodsViceType: 0, - goodsName: - '白色短袖连衣裙荷叶边裙摆宽松韩版休闲纯白清爽优雅连衣裙', - goodsPictureUrl: - 'https://cdn-we-retail.ym.tencent.com/tsr/goods/nz-09a.png', - originPrice: '40000', - actualPrice: '29800', - specifications: [ - { specTitle: '颜色', specValue: '米色荷叶边' }, - { specTitle: '尺码', specValue: 'S' }, - ], - buyQuantity: 1, - itemTotalAmount: '29800', - itemDiscountAmount: '4026', - itemPaymentAmount: '25774', - goodsPaymentPrice: '25774', - tagPrice: null, - tagText: null, - outCode: null, - labelVOs: null, - buttonVOs: null, - }, - { - id: '132222629825260288', - orderNo: null, - spuId: '3', - skuId: '135691622', - roomId: null, - goodsMainType: 0, - goodsViceType: 0, - goodsName: - '腾讯极光盒子4智能网络电视机顶盒6K千兆网络机顶盒4K高分辨率', - goodsPictureUrl: - 'https://cdn-we-retail.ym.tencent.com/tsr/goods/dz-3a.png', - originPrice: '16900', - actualPrice: '9900', - specifications: [ - { specTitle: '颜色', specValue: '经典白' }, - { specTitle: '类型', specValue: '经典套装' }, - ], - buyQuantity: 1, - itemTotalAmount: '9900', - itemDiscountAmount: '1337', - itemPaymentAmount: '8563', - goodsPaymentPrice: '8563', - tagPrice: null, - tagText: null, - outCode: null, - labelVOs: null, - buttonVOs: null, - }, - { - id: '132222629825260544', - orderNo: null, - spuId: '135681628', - skuId: '135676629', - roomId: null, - goodsMainType: 0, - goodsViceType: 0, - goodsName: - '带帽午休毯虎年款多功能加厚加大加绒简约多功能午休毯连帽披肩', - goodsPictureUrl: - 'https://cdn-we-retail.ym.tencent.com/tsr/goods/muy-3a.png', - originPrice: '39900', - actualPrice: '29900', - specifications: [ - { specTitle: '颜色', specValue: '浅灰色' }, - { specTitle: '尺码', specValue: 'S' }, - ], - buyQuantity: 4, - itemTotalAmount: '119600', - itemDiscountAmount: '4040', - itemPaymentAmount: '115560', - goodsPaymentPrice: '28890', - tagPrice: null, - tagText: null, - outCode: null, - labelVOs: null, - buttonVOs: null, - }, - { - id: '132222629825260800', - orderNo: null, - spuId: '2', - skuId: '135686631', - roomId: null, - goodsMainType: 0, - goodsViceType: 0, - goodsName: '运动连帽拉链卫衣休闲开衫长袖多色运动细绒面料运动上衣', - goodsPictureUrl: - 'https://cdn-we-retail.ym.tencent.com/tsr/goods/nz-17a.png', - originPrice: '39900', - actualPrice: '25900', - specifications: [ - { specTitle: '颜色', specValue: '军绿色' }, - { specTitle: '尺码', specValue: 'XS' }, - ], - buyQuantity: 1, - itemTotalAmount: '25900', - itemDiscountAmount: '392', - itemPaymentAmount: '25508', - goodsPaymentPrice: '25508', - tagPrice: null, - tagText: null, - outCode: null, - labelVOs: null, - buttonVOs: null, - }, - ], - logisticsVO: { - logisticsType: 1, - logisticsNo: '', - logisticsStatus: null, - logisticsCompanyCode: '', - logisticsCompanyName: '', - receiverAddressId: '2', - provinceCode: '440000', - cityCode: '440300', - countryCode: '440306', - receiverProvince: '广东省', - receiverCity: '深圳市', - receiverCountry: '南山区', - receiverArea: '', - receiverAddress: '前海路333号阳光玫瑰园', - receiverPostCode: '', - receiverLongitude: '113.829127', - receiverLatitude: '22.713649', - receiverIdentity: '88888888205468', - receiverPhone: '17612345678', - receiverName: '平均线', - expectArrivalTime: null, - senderName: '', - senderPhone: '', - senderAddress: '', - sendTime: null, - arrivalTime: null, - }, - paymentVO: { - payStatus: 1, - amount: '458600', - currency: null, - payType: null, - payWay: null, - payWayName: null, - interactId: null, - traceNo: null, - channelTrxNo: null, - period: null, - payTime: null, - paySuccessTime: null, - }, - buttonVOs: [ - { - primary: true, - type: 3, - name: '确认收货', - }, - ], - labelVOs: null, - invoiceVO: null, - couponAmount: null, - autoCancelTime: null, - orderStatusName: '待收货', - orderSatusRemark: null, - logisticsLogVO: null, - invoiceStatus: null, - invoiceDesc: null, - invoiceUrl: null, - }, - { - saasId: '88888888', - storeId: '1000', - storeName: '云Mall深圳旗舰店', - uid: '88888888205468', - parentOrderNo: '130862219672031307', - orderId: '130862224737571072', - orderNo: '130862219672031307', - orderType: 0, - orderSubType: 0, - orderStatus: 80, - orderSubStatus: null, - totalAmount: '298000', - goodsAmount: '298000', - goodsAmountApp: '298000', - paymentAmount: '263200', - freightFee: '0', - packageFee: '0', - discountAmount: '34800', - channelType: 0, - channelSource: '', - channelIdentity: '', - remark: '', - cancelType: null, - cancelReasonType: null, - cancelReason: null, - rightsType: null, - createTime: '1587049485899', - orderItemVOs: [ - { - id: '130862224922120960', - orderNo: null, - spuId: '0', - skuId: '135676631', - roomId: null, - goodsMainType: 0, - goodsViceType: 0, - goodsName: - '白色短袖连衣裙荷叶边裙摆宽松韩版休闲纯白清爽优雅连衣裙', - goodsPictureUrl: - 'https://cdn-we-retail.ym.tencent.com/tsr/goods/nz-09a.png', - originPrice: '40000', - actualPrice: '29800', - specifications: [ - { specTitle: '颜色', specValue: '米色荷叶边' }, - { specTitle: '尺码', specValue: 'S' }, - ], - buyQuantity: 10, - itemTotalAmount: '298000', - itemDiscountAmount: '29800', - itemPaymentAmount: '268200', - goodsPaymentPrice: '26820', - tagPrice: null, - tagText: null, - outCode: null, - labelVOs: null, - buttonVOs: null, - }, - ], - logisticsVO: { - logisticsType: 1, - logisticsNo: '', - logisticsStatus: null, - logisticsCompanyCode: '', - logisticsCompanyName: '', - receiverAddressId: '2', - provinceCode: '440000', - cityCode: '440300', - countryCode: '440306', - receiverProvince: '广东省', - receiverCity: '深圳市', - receiverCountry: '南山区', - receiverArea: '', - receiverAddress: '前海路333号阳光玫瑰园', - receiverPostCode: '', - receiverLongitude: '113.829127', - receiverLatitude: '22.713649', - receiverIdentity: '88888888205468', - receiverPhone: '17612345678', - receiverName: '平均线', - expectArrivalTime: null, - senderName: '', - senderPhone: '', - senderAddress: '', - sendTime: null, - arrivalTime: null, - }, - paymentVO: { - payStatus: 1, - amount: '263200', - currency: null, - payType: null, - payWay: null, - payWayName: null, - interactId: null, - traceNo: null, - channelTrxNo: null, - period: null, - payTime: null, - paySuccessTime: null, - }, - buttonVOs: null, - labelVOs: null, - invoiceVO: null, - couponAmount: null, - autoCancelTime: null, - orderStatusName: '已取消', - orderSatusRemark: null, - logisticsLogVO: null, - invoiceStatus: null, - invoiceDesc: null, - invoiceUrl: null, - }, - { - saasId: '88888888', - storeId: '1000', - storeName: '云Mall深圳旗舰店', - uid: '88888888205468', - parentOrderNo: '130494472895208267', - orderId: '130494482155052032', - orderNo: '130494472895208267', - orderType: 0, - orderSubType: 0, - orderStatus: 80, - orderSubStatus: null, - totalAmount: '59700', - goodsAmount: '59700', - goodsAmountApp: '59700', - paymentAmount: '24900', - freightFee: '0', - packageFee: '0', - discountAmount: '34800', - channelType: 0, - channelSource: '', - channelIdentity: '', - remark: '', - cancelType: null, - cancelReasonType: null, - cancelReason: null, - rightsType: null, - createTime: '1587027566730', - orderItemVOs: [ - { - id: '130494482322824704', - orderNo: null, - spuId: '7', - skuId: '135691633', - roomId: null, - goodsMainType: 0, - goodsViceType: 0, - goodsName: - '不锈钢刀叉勺套装家用西餐餐具ins简约耐用不锈钢金色银色可选', - goodsPictureUrl: - 'https://cdn-we-retail.ym.tencent.com/tsr/goods/gh-2b.png', - originPrice: '29900', - actualPrice: '19900', - specifications: [ - { specTitle: '颜色', specValue: '奶黄色' }, - { specTitle: '类型', specValue: '三件套' }, - ], - buyQuantity: 3, - itemTotalAmount: '59700', - itemDiscountAmount: '29800', - itemPaymentAmount: '29900', - goodsPaymentPrice: '9966', - tagPrice: null, - tagText: null, - outCode: null, - labelVOs: null, - buttonVOs: null, - }, - ], - logisticsVO: { - logisticsType: 1, - logisticsNo: '', - logisticsStatus: null, - logisticsCompanyCode: '', - logisticsCompanyName: '', - receiverAddressId: '2', - provinceCode: '440000', - cityCode: '440300', - countryCode: '440306', - receiverProvince: '广东省', - receiverCity: '深圳市', - receiverCountry: '南山区', - receiverArea: '', - receiverAddress: '前海路333号阳光玫瑰园', - receiverPostCode: '', - receiverLongitude: '113.829127', - receiverLatitude: '22.713649', - receiverIdentity: '88888888205468', - receiverPhone: '17612345678', - receiverName: '平均线', - expectArrivalTime: null, - senderName: '', - senderPhone: '', - senderAddress: '', - sendTime: null, - arrivalTime: null, - }, - paymentVO: { - payStatus: 1, - amount: '24900', - currency: null, - payType: null, - payWay: null, - payWayName: null, - interactId: null, - traceNo: null, - channelTrxNo: null, - period: null, - payTime: null, - paySuccessTime: null, - }, - buttonVOs: null, - labelVOs: null, - invoiceVO: null, - couponAmount: null, - autoCancelTime: null, - orderStatusName: '已取消', - orderSatusRemark: null, - logisticsLogVO: null, - invoiceStatus: null, - invoiceDesc: null, - invoiceUrl: null, - }, - { - saasId: '88888888', - storeId: '1000', - storeName: '云Mall深圳旗舰店', - uid: '88888888205468', - parentOrderNo: '130169571554503755', - orderId: '130169572291521792', - orderNo: '130169571554503755', - orderType: 0, - orderSubType: 0, - orderStatus: 50, - orderSubStatus: null, - totalAmount: '538000', - goodsAmount: '538000', - goodsAmountApp: '538000', - paymentAmount: '508200', - freightFee: '0', - packageFee: '0', - discountAmount: '29800', - channelType: 0, - channelSource: '', - channelIdentity: '', - remark: '', - cancelType: null, - cancelReasonType: null, - cancelReason: null, - rightsType: null, - createTime: '1587008200590', - orderItemVOs: [ - { - id: '130169572425740032', - orderNo: null, - spuId: '1', - skuId: '135691631', - roomId: null, - goodsMainType: 0, - goodsViceType: 0, - goodsName: - '纯色纯棉休闲圆领短袖T恤纯白亲肤厚柔软细腻面料纯白短袖套头T恤', - goodsPictureUrl: - 'https://cdn-we-retail.ym.tencent.com/tsr/goods/nz-08b.png', - originPrice: '31900', - actualPrice: '26900', - specifications: [ - { specTitle: '颜色', specValue: '橙色' }, - { specTitle: '尺码', specValue: 'M' }, - ], - buyQuantity: 20, - itemTotalAmount: '538000', - itemDiscountAmount: '29800', - itemPaymentAmount: '508200', - goodsPaymentPrice: '25410', - tagPrice: null, - tagText: null, - outCode: null, - labelVOs: null, - buttonVOs: [ - { - primary: true, - type: 4, - name: '', - }, - ], - }, - ], - logisticsVO: { - logisticsType: 1, - logisticsNo: '123', - logisticsStatus: null, - logisticsCompanyCode: 'zhongtong', - logisticsCompanyName: '中通速递', - receiverAddressId: '2', - provinceCode: '440000', - cityCode: '440300', - countryCode: '440306', - receiverProvince: '广东省', - receiverCity: '深圳市', - receiverCountry: '南山区', - receiverArea: '', - receiverAddress: '前海路333号阳光玫瑰园', - receiverPostCode: '', - receiverLongitude: '113.829127', - receiverLatitude: '22.713649', - receiverIdentity: '88888888205468', - receiverPhone: '17612345678', - receiverName: '平均线', - expectArrivalTime: null, - senderName: '', - senderPhone: '', - senderAddress: '', - sendTime: '1587008529453', - arrivalTime: '1587008623995', - }, - paymentVO: { - payStatus: 1, - amount: '508200', - currency: null, - payType: null, - payWay: null, - payWayName: null, - interactId: null, - traceNo: null, - channelTrxNo: null, - period: null, - payTime: null, - paySuccessTime: null, - }, - buttonVOs: [ - { primary: false, type: 4, name: '申请售后' }, - { primary: true, type: 6, name: '评价' }, - ], - labelVOs: null, - invoiceVO: { - buyerName: '腾讯计算机有限公司', //个人或公司名称 - buyerTaxNo: '9144 9808 0909 0293 XG', //税号 - buyerPhone: '18600008888', //手机 - email: '73900484@qq.com', //邮箱 - titleType: 2, //发票抬头 1-个人 2-公司 - ontentType: 1, //发票内容 1-明细 2类别 - invoiceType: 5, //是否开票 0-不开 5-电子发票 - money: '1.54', - }, - couponAmount: null, - autoCancelTime: null, - orderStatusName: '交易完成', - orderSatusRemark: null, - logisticsLogVO: null, - invoiceStatus: null, - invoiceDesc: null, - invoiceUrl: null, - }, - { - saasId: '88888888', - storeId: '1000', - storeName: '云Mall深圳旗舰店', - uid: '88888888205468', - parentOrderNo: '130150835531421259', - orderId: '130150836385879808', - orderNo: '130150835531421259', - orderType: 0, - orderSubType: 0, - orderStatus: 50, - orderSubStatus: null, - totalAmount: '29800', - goodsAmount: '29800', - goodsAmountApp: '29800', - paymentAmount: '4000', - freightFee: '0', - packageFee: '0', - discountAmount: '25800', - channelType: 0, - channelSource: '', - channelIdentity: '', - remark: '', - cancelType: null, - cancelReasonType: null, - cancelReason: null, - rightsType: null, - createTime: '1587007083842', - orderItemVOs: [ - { - id: '130150836520098048', - orderNo: null, - spuId: '0', - skuId: '135681631', - roomId: null, - goodsMainType: 0, - goodsViceType: 0, - goodsName: - '白色短袖连衣裙荷叶边裙摆宽松韩版休闲纯白清爽优雅连衣裙', - goodsPictureUrl: - 'https://cdn-we-retail.ym.tencent.com/tsr/goods/nz-09a.png', - originPrice: '40000', - actualPrice: '29800', - specifications: [ - { specTitle: '颜色', specValue: '米色荷叶边' }, - { specTitle: '尺码', specValue: 'M' }, - ], - buyQuantity: 1, - itemTotalAmount: '29800', - itemDiscountAmount: '25800', - itemPaymentAmount: '4000', - goodsPaymentPrice: '4000', - tagPrice: null, - tagText: null, - outCode: null, - labelVOs: null, - buttonVOs: null, - }, - ], - logisticsVO: { - logisticsType: 1, - logisticsNo: '123', - logisticsStatus: null, - logisticsCompanyCode: 'yuantong', - logisticsCompanyName: '圆通速递', - receiverAddressId: '2', - provinceCode: '440000', - cityCode: '440300', - countryCode: '440306', - receiverProvince: '广东省', - receiverCity: '深圳市', - receiverCountry: '南山区', - receiverArea: '', - receiverAddress: '前海路333号阳光玫瑰园', - receiverPostCode: '', - receiverLongitude: '113.829127', - receiverLatitude: '22.713649', - receiverIdentity: '88888888205468', - receiverPhone: '17612345678', - receiverName: '平均线', - expectArrivalTime: null, - senderName: '', - senderPhone: '', - senderAddress: '', - sendTime: '1587008539953', - arrivalTime: '1588291200508', - }, - paymentVO: { - payStatus: 1, - amount: '4000', - currency: null, - payType: null, - payWay: null, - payWayName: null, - interactId: null, - traceNo: null, - channelTrxNo: null, - period: null, - payTime: null, - paySuccessTime: null, - }, - buttonVOs: [{ primary: true, type: 6, name: '评价' }], - labelVOs: null, - invoiceVO: null, - couponAmount: null, - autoCancelTime: null, - orderStatusName: '交易完成', - orderSatusRemark: null, - logisticsLogVO: null, - invoiceStatus: null, - invoiceDesc: null, - invoiceUrl: null, - }, - ], - }, - code: 'Success', - msg: null, - requestId: mockReqId(), - clientIp: mockIp(), - rt: 113, - success: true, - }; - const { pageNum, pageSize, orderStatus } = params.parameter; - // 实现筛选 - if (orderStatus > -1) { - resp.data.orders = resp.data.orders.filter( - (order) => order.orderStatus === orderStatus, - ); - } - // 实现分页 - resp.data.pageNum = pageNum; - resp.data.pageSize = pageSize; - resp.data.orders = resp.data.orders.slice( - (pageNum - 1) * pageSize, - pageNum * pageSize, - ); - return resp; -} - -export function genOrdersCount() { - const resp = { - data: [ - { tabType: 5, orderNum: 1 }, - { tabType: 10, orderNum: 1 }, - { tabType: 40, orderNum: 1 }, - { tabType: 50, orderNum: 2 }, - ], - code: 'Success', - msg: null, - requestId: mockReqId(), - clientIp: mockIp(), - rt: 41, - success: true, - }; - return resp; -} diff --git a/model/promotion.js b/model/promotion.js deleted file mode 100644 index 0aaee61..0000000 --- a/model/promotion.js +++ /dev/null @@ -1,21 +0,0 @@ -import { getGoodsList } from './goods'; - -export function getPromotion(baseID = 0, length = 10) { - return { - list: getGoodsList(baseID, length).map((item) => { - return { - spuId: item.spuId, - thumb: item.primaryImage, - title: item.title, - price: item.minSalePrice, - originPrice: item.maxLinePrice, - tags: item.spuTagList.map((tag) => ({ title: tag.title })), - }; - }), - banner: - 'https://cdn-we-retail.ym.tencent.com/tsr/promotion/banner-promotion.png', - time: 1000 * 60 * 60 * 20, - showBannerDesc: true, - statusTag: 'running', - }; -} diff --git a/model/search.js b/model/search.js deleted file mode 100644 index 2d2e68d..0000000 --- a/model/search.js +++ /dev/null @@ -1,60 +0,0 @@ -import { getGoodsList } from './goods'; - -/** - * @param {number} sort - * @param {number} pageNum - * @param {number} pageSize - * @param {number} minPrice - * @param {number} maxPrice - * @param {string} keyword - */ - -export function getSearchHistory() { - return { - historyWords: [ - '鸡', - '电脑', - 'iPhone12', - '车载手机支架', - '自然堂', - '小米10', - '原浆古井贡酒', - '欧米伽', - '华为', - '针织半身裙', - '氢跑鞋', - '三盒处理器', - ], - }; -} - -export function getSearchPopular() { - return { - popularWords: [ - '鸡', - '电脑', - 'iPhone12', - '车载手机支架', - '自然堂', - '小米10', - '原浆古井贡酒', - '欧米伽', - '华为', - '针织半身裙', - '氢跑鞋', - '三盒处理器', - ], - }; -} - -export function getSearchResult() { - return { - saasId: null, - storeId: null, - pageNum: 1, - pageSize: 30, - totalCount: 1, - spuList: getGoodsList(7), - algId: 0, - }; -} diff --git a/model/submitComment.js b/model/submitComment.js deleted file mode 100644 index e620b4f..0000000 --- a/model/submitComment.js +++ /dev/null @@ -1,58 +0,0 @@ -export function getGoods() { - return { - goods: [ - { - squid: '1', - checkItems: [ - { - name: '匿名评价', - value: 'anonymous', - checked: false, - }, - ], - detail: { - image: - 'https://wx.qlogo.cn/mmopen/vi_32/51VSMNuy1CyHiaAhAjLJ00kMZVqqnCqXeZduCLXHUBr52zFHRGxwL7kGia3fHj8GSNzFcqFDInQmRGM1eWjtQgqA/132', - title: '', - }, - goodComment: { - /** 商品评价 */ - rate: 0, - /** 评价内容 */ - label: '123', - /** 上传图片 */ - images: [], - }, - }, - { - squid: '2', - checkItems: [ - { - name: '匿名评价', - value: 'anonymous', - checked: false, - }, - ], - detail: { - image: - 'https://wx.qlogo.cn/mmopen/vi_32/51VSMNuy1CyHiaAhAjLJ00kMZVqqnCqXeZduCLXHUBr52zFHRGxwL7kGia3fHj8GSNzFcqFDInQmRGM1eWjtQgqA/132', - title: '评价内容 山姆智利进口', - }, - goodComment: { - /** 商品评价 */ - rate: 0, - /** 评价内容 */ - label: '山姆智利进口', - /** 上传图片 */ - images: [], - }, - }, - ], - storeComment: { - /** 物流评价 */ - logisticsRate: 0, - /** 服务评价 */ - servicesRate: 0, - }, - }; -} diff --git a/model/swiper.js b/model/swiper.js index 3df27bb..1284c50 100644 --- a/model/swiper.js +++ b/model/swiper.js @@ -1,5 +1,5 @@ const images = [{ - img: '/images/use_btn.jpg', + img: 'https://webplus-cn-hangzhou-s-603871eef968dd14ced82ed5.oss-cn-hangzhou.aliyuncs.com/hextech/static/use_btn.jpg', text: '1', }, { diff --git a/model/usercenter.js b/model/usercenter.js deleted file mode 100644 index 8822f4f..0000000 --- a/model/usercenter.js +++ /dev/null @@ -1,52 +0,0 @@ -const userInfo = { - avatarUrl: - 'https://we-retail-static-1300977798.cos.ap-guangzhou.myqcloud.com/retail-ui/components-exp/avatar/avatar-1.jpg', - nickName: 'TDesign 🌟', - phoneNumber: '13438358888', - gender: 2, -}; -const countsData = [ - { - num: 2, - name: '积分', - type: 'point', - }, - { - num: 10, - name: '优惠券', - type: 'coupon', - }, -]; - -const orderTagInfos = [ - { - orderNum: 1, - tabType: 5, - }, - { - orderNum: 1, - tabType: 10, - }, - { - orderNum: 1, - tabType: 40, - }, - { - orderNum: 0, - tabType: 0, - }, -]; - -const customerServiceInfo = { - servicePhone: '4006336868', - serviceTimeDuration: '每周三至周五 9:00-12:00 13:00-15:00', -}; - -export const genSimpleUserInfo = () => ({ ...userInfo }); - -export const genUsercenter = () => ({ - userInfo, - countsData, - orderTagInfos, - customerServiceInfo, -}); diff --git a/pages/cart/components/cart-bar/index.js b/pages/cart/components/cart-bar/index.js deleted file mode 100644 index db7736c..0000000 --- a/pages/cart/components/cart-bar/index.js +++ /dev/null @@ -1,59 +0,0 @@ -Component({ - options: { - addGlobalClass: true, - }, - /** - * 组件的属性列表 - */ - properties: { - isAllSelected: { - type: Boolean, - value: false, - }, - totalAmount: { - type: Number, - value: 1, - }, - totalGoodsNum: { - type: Number, - value: 0, - observer(num) { - const isDisabled = num == 0; - setTimeout(() => { - this.setData({ - isDisabled, - }); - }); - }, - }, - totalDiscountAmount: { - type: Number, - value: 0, - }, - bottomHeight: { - type: Number, - value: 100, - }, - fixed: Boolean, - }, - data: { - isDisabled: false, - }, - - methods: { - handleSelectAll() { - const { isAllSelected } = this.data; - this.setData({ - isAllSelected: !isAllSelected, - }); - this.triggerEvent('handleSelectAll', { - isAllSelected: isAllSelected, - }); - }, - - handleToSettle() { - if (this.data.isDisabled) return; - this.triggerEvent('handleToSettle'); - }, - }, -}); diff --git a/pages/cart/components/cart-bar/index.json b/pages/cart/components/cart-bar/index.json deleted file mode 100644 index c6c4351..0000000 --- a/pages/cart/components/cart-bar/index.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "component": true, - "usingComponents": { - "price": "/components/price/index", - "t-icon": "tdesign-miniprogram/icon/icon" - } -} \ No newline at end of file diff --git a/pages/cart/components/cart-bar/index.wxml b/pages/cart/components/cart-bar/index.wxml deleted file mode 100644 index 486a0d5..0000000 --- a/pages/cart/components/cart-bar/index.wxml +++ /dev/null @@ -1,31 +0,0 @@ - - - - 全选 - - - 总计 - - (不含运费) - - - 已优惠 - - - - - - diff --git a/pages/cart/components/cart-bar/index.wxss b/pages/cart/components/cart-bar/index.wxss deleted file mode 100644 index 0e63f60..0000000 --- a/pages/cart/components/cart-bar/index.wxss +++ /dev/null @@ -1,80 +0,0 @@ -.cart-bar__placeholder { - height: 100rpx; -} -.flex { - display: flex; -} -.flex-v-center { - align-items: center; -} -.flex1 { - flex: 1; -} -.algin-bottom { - text-align: end; -} -.cart-bar--fixed { - position: fixed; - left: 0; - right: 0; - z-index: 99; - bottom: calc(100rpx + env(safe-area-inset-bottom)); -} - -.cart-bar { - height: 112rpx; - background-color: #fff; - border-top: 1rpx solid #e5e5e5; - padding: 16rpx 32rpx; - box-sizing: border-box; - font-size: 24rpx; - line-height: 36rpx; - color: #333; -} - -.cart-bar .cart-bar__check { - margin-right: 12rpx; -} - -.cart-bar .cart-bar__total { - margin-left: 24rpx; -} - -.cart-bar .account-btn { - width: 192rpx; - height: 80rpx; - border-radius: 40rpx; - background-color: #fa4126; - font-size: 28rpx; - font-weight: bold; - line-height: 80rpx; - color: #ffffff; - text-align: center; -} -.cart-bar .disabled-btn { - background-color: #cccccc !important; -} -.cart-bar .hover-btn { - opacity: 0.5; -} - -.cart-bar__total .cart-bar__total--bold { - font-size: 28rpx; - line-height: 40rpx; - color: #333; - font-weight: bold; -} -.cart-bar__total .cart-bar__total--normal { - font-size: 24rpx; - line-height: 32rpx; - color: #999; -} - -.cart-bar__total .cart-bar__total--price { - color: #fa4126; - font-weight: bold; -} - -.text-padding-right { - padding-right: 4rpx; -} diff --git a/pages/cart/components/cart-empty/index.js b/pages/cart/components/cart-empty/index.js deleted file mode 100644 index 01cf9c3..0000000 --- a/pages/cart/components/cart-empty/index.js +++ /dev/null @@ -1,23 +0,0 @@ -Component({ - properties: { - imgUrl: { - type: String, - value: - 'https://cdn-we-retail.ym.tencent.com/miniapp/template/empty-cart.png', - }, - tip: { - type: String, - value: '购物车是空的', - }, - btnText: { - type: String, - value: '去首页', - }, - }, - data: {}, - methods: { - handleClick() { - this.triggerEvent('handleClick'); - }, - }, -}); diff --git a/pages/cart/components/cart-empty/index.json b/pages/cart/components/cart-empty/index.json deleted file mode 100644 index b659310..0000000 --- a/pages/cart/components/cart-empty/index.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "component": true, - "usingComponents": { - "t-image": "/components/webp-image/index" - } -} \ No newline at end of file diff --git a/pages/cart/components/cart-empty/index.wxml b/pages/cart/components/cart-empty/index.wxml deleted file mode 100644 index d0cdd43..0000000 --- a/pages/cart/components/cart-empty/index.wxml +++ /dev/null @@ -1,6 +0,0 @@ - - - {{tip}} - {{btnText}} - - diff --git a/pages/cart/components/cart-empty/index.wxss b/pages/cart/components/cart-empty/index.wxss deleted file mode 100644 index d074bc3..0000000 --- a/pages/cart/components/cart-empty/index.wxss +++ /dev/null @@ -1,33 +0,0 @@ -.cart-empty { - padding: 64rpx 0rpx; - display: flex; - flex-direction: column; - align-items: center; - box-sizing: border-box; - height: calc(100vh - 100rpx); - background-color: #f5f5f5; -} -.cart-empty .cart-img { - width: 160rpx; - height: 160rpx; - margin-bottom: 24rpx; -} - -.cart-empty .tip { - font-size: 28rpx; - line-height: 40rpx; - color: #999; - margin-bottom: 24rpx; -} -.cart-empty .btn { - width: 240rpx; - height: 72rpx; - border-radius: 36rpx; - text-align: center; - line-height: 72rpx; - border: 2rpx solid #fa4126; - color: #fa4126; - background-color: transparent; - font-size: 28rpx; - font-weight: bold; -} diff --git a/pages/cart/components/cart-group/index.js b/pages/cart/components/cart-group/index.js deleted file mode 100644 index 99a908d..0000000 --- a/pages/cart/components/cart-group/index.js +++ /dev/null @@ -1,166 +0,0 @@ -import Toast from 'tdesign-miniprogram/toast/index'; - -const shortageImg = - 'https://cdn-we-retail.ym.tencent.com/miniapp/cart/shortage.png'; - -Component({ - isSpecsTap: false, // 标记本次点击事件是否因为点击specs触发(由于底层goods-card组件没有catch specs点击事件,只能在此处加状态来避免点击specs时触发跳转商品详情) - externalClasses: ['wr-class'], - properties: { - storeGoods: { - type: Array, - observer(storeGoods) { - for (const store of storeGoods) { - for (const activity of store.promotionGoodsList) { - for (const goods of activity.goodsPromotionList) { - goods.specs = goods.specInfo.map((item) => item.specValue); // 目前仅展示商品已选规格的值 - } - } - for (const goods of store.shortageGoodsList) { - goods.specs = goods.specInfo.map((item) => item.specValue); // 目前仅展示商品已选规格的值 - } - } - - this.setData({ _storeGoods: storeGoods }); - }, - }, - invalidGoodItems: { - type: Array, - observer(invalidGoodItems) { - invalidGoodItems.forEach((goods) => { - goods.specs = goods.specInfo.map((item) => item.specValue); // 目前仅展示商品已选规格的值 - }); - this.setData({ _invalidGoodItems: invalidGoodItems }); - }, - }, - thumbWidth: { type: null }, - thumbHeight: { type: null }, - }, - - data: { - shortageImg, - isShowSpecs: false, - currentGoods: {}, - isShowToggle: false, - _storeGoods: [], - _invalidGoodItems: [], - }, - - methods: { - // 删除商品 - deleteGoods(e) { - const { goods } = e.currentTarget.dataset; - this.triggerEvent('delete', { goods }); - }, - - // 清空失效商品 - clearInvalidGoods() { - this.triggerEvent('clearinvalidgoods'); - }, - - // 选中商品 - selectGoods(e) { - const { goods } = e.currentTarget.dataset; - this.triggerEvent('selectgoods', { - goods, - isSelected: !goods.isSelected, - }); - }, - - changeQuantity(num, goods) { - this.triggerEvent('changequantity', { - goods, - quantity: num, - }); - }, - changeStepper(e) { - const { value } = e.detail; - const { goods } = e.currentTarget.dataset; - let num = value; - if (value > goods.stack) { - num = goods.stack; - } - this.changeQuantity(num, goods); - }, - - input(e) { - const { value } = e.detail; - const { goods } = e.currentTarget.dataset; - const num = value; - this.changeQuantity(num, goods); - }, - - overlimit(e) { - const text = - e.detail.type === 'minus' - ? '该商品数量不能减少了哦' - : '同一商品最多购买999件'; - Toast({ - context: this, - selector: '#t-toast', - message: text, - }); - }, - - // 去凑单/再逛逛 - gotoBuyMore(e) { - const { promotion, storeId = '' } = e.currentTarget.dataset; - this.triggerEvent('gocollect', { promotion, storeId }); - }, - - // 选中门店 - selectStore(e) { - const { storeIndex } = e.currentTarget.dataset; - const store = this.data.storeGoods[storeIndex]; - const isSelected = !store.isSelected; - if (store.storeStockShortage && isSelected) { - Toast({ - context: this, - selector: '#t-toast', - message: '部分商品库存不足', - }); - return; - } - this.triggerEvent('selectstore', { - store, - isSelected, - }); - }, - - // 展开/收起切换 - showToggle() { - this.setData({ - isShowToggle: !this.data.isShowToggle, - }); - }, - - // 展示规格popup - specsTap(e) { - this.isSpecsTap = true; - const { goods } = e.currentTarget.dataset; - this.setData({ - isShowSpecs: true, - currentGoods: goods, - }); - }, - - hideSpecsPopup() { - this.setData({ - isShowSpecs: false, - }); - }, - - goGoodsDetail(e) { - if (this.isSpecsTap) { - this.isSpecsTap = false; - return; - } - const { goods } = e.currentTarget.dataset; - this.triggerEvent('goodsclick', { goods }); - }, - - gotoCoupons() { - wx.navigateTo({ url: '/pages/coupon/coupon-list/index' }); - }, - }, -}); diff --git a/pages/cart/components/cart-group/index.json b/pages/cart/components/cart-group/index.json deleted file mode 100644 index 9b8003d..0000000 --- a/pages/cart/components/cart-group/index.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "component": true, - "usingComponents": { - "t-toast": "tdesign-miniprogram/toast/toast", - "t-icon": "tdesign-miniprogram/icon/icon", - "t-stepper": "tdesign-miniprogram/stepper/stepper", - "swipeout": "/components/swipeout/index", - "goods-card": "../../components/goods-card/index", - "specs-popup": "../../components/specs-popup/index" - } -} \ No newline at end of file diff --git a/pages/cart/components/cart-group/index.wxml b/pages/cart/components/cart-group/index.wxml deleted file mode 100644 index 63fe3dd..0000000 --- a/pages/cart/components/cart-group/index.wxml +++ /dev/null @@ -1,185 +0,0 @@ - - var hasPromotion = function (code) { - return code && code !== 'EMPTY_PROMOTION'; - } - module.exports.hasPromotion = hasPromotion; - - - - - - - - - - - - {{store.storeName}} - - 优惠券 - - - - - - {{promotion.tag}} - {{promotion.description}} - - - - {{promotion.isNeedAddOnShop == 1 ? '去凑单' : '再逛逛'}} - - - - - - - - - - - - - - 仅剩{{goods.stockQuantity}}件 - - - 库存不足 - - - - - - - 删除 - - - - - - - - - - - - - - - - - - 无货 - - - - - - 删除 - - - - - - - - - - - - - diff --git a/pages/cart/components/cart-group/index.wxss b/pages/cart/components/cart-group/index.wxss deleted file mode 100644 index 641101f..0000000 --- a/pages/cart/components/cart-group/index.wxss +++ /dev/null @@ -1,335 +0,0 @@ -.cart-group { - border-radius: 8rpx; -} -.cart-group .goods-wrap { - margin-top: 40rpx; - background-color: #fff; - border-radius: 8rpx; - overflow: hidden; -} -.cart-group .goods-wrap:first-of-type { - margin-top: 0; -} -.cart-group .cart-store { - height: 96rpx; - background-color: #fff; - box-sizing: border-box; - display: flex; - align-items: center; - padding: 0rpx 24rpx 0rpx 36rpx; -} -.cart-group .cart-store .cart-store__check { - padding: 28rpx 32rpx 28rpx 0rpx; -} -.cart-group .cart-store__content { - box-sizing: border-box; - flex: auto; - display: flex; - align-items: center; - justify-content: space-between; -} -.cart-group .cart-store__content .store-title { - flex: auto; - font-size: 28rpx; - line-height: 40rpx; - color: #333333; - display: flex; - align-items: center; - font-weight: bold; - overflow: hidden; -} - -.cart-group .cart-store__content .store-title .wr-store { - font-size: 32rpx; -} -.cart-group .cart-store__content .store-title .store-name { - overflow: hidden; - white-space: nowrap; - text-overflow: ellipsis; - margin-left: 12rpx; -} -.cart-group .cart-store__content .get-coupon { - width: 112rpx; - height: 40rpx; - border-radius: 20rpx; - background-color: #ffecf9; - line-height: 40rpx; - text-align: center; - font-size: 26rpx; - color: #fa4126; -} - -.cart-group .promotion-wrap { - display: flex; - justify-content: space-between; - align-items: center; - padding: 0rpx 24rpx 32rpx 36rpx; - background-color: #ffffff; - font-size: 24rpx; - line-height: 36rpx; - color: #222427; -} -.cart-group .promotion-wrap .promotion-title { - font-weight: bold; - flex: auto; - overflow: hidden; - margin-right: 20rpx; - display: flex; - align-items: center; -} -.cart-group .promotion-wrap .promotion-title .promotion-icon { - flex: none; - font-weight: normal; - display: inline-block; - padding: 0 8rpx; - color: #ffffff; - background: #fa4126; - font-size: 20rpx; - height: 32rpx; - line-height: 32rpx; - margin-right: 16rpx; - border-radius: 16rpx; -} -.cart-group .promotion-wrap .promotion-title .promotion-text { - flex: auto; - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; -} -.cart-group .promotion-wrap .promotion-action { - flex: none; - color: #333333; -} -.cart-group .promotion-line-wrap { - background-color: #fff; - height: 2rpx; - display: flex; - justify-content: flex-end; -} -.cart-group .promotion-line-wrap .promotion-line { - width: 684rpx; - height: 2rpx; - background-color: #e6e6e6; -} -.cart-group .goods-item-info { - display: flex; - background-color: #fff; - align-items: flex-start; -} -.cart-group .goods-item-info .check-wrap { - margin-top: 56rpx; - padding: 20rpx 28rpx 20rpx 36rpx; -} - -.cart-group .goods-item-info .check-wrap .unCheck-icon { - box-sizing: border-box; - width: 36rpx; - height: 36rpx; - border-radius: 20rpx; - background: #f5f5f5; - border: 2rpx solid #bbbbbb; -} - -.cart-group .goods-item-info .goods-sku-info { - padding: 0rpx 32rpx 40rpx 0; - flex-grow: 1; -} -.cart-group .goods-item-info .goods-sku-info .stock-mask { - position: absolute; - color: #fff; - font-size: 24rpx; - bottom: 0rpx; - background-color: rgba(0, 0, 0, 0.5); - width: 100%; - height: 40rpx; - line-height: 40rpx; - text-align: center; -} -.cart-group .goods-item-info .goods-sku-info .goods-stepper { - position: absolute; - right: 0; - bottom: 8rpx; -} -.cart-group .goods-item-info .goods-sku-info .goods-stepper .stepper-tip { - position: absolute; - top: -36rpx; - right: 0; - height: 28rpx; - color: #ff2525; - font-size: 20rpx; - line-height: 28rpx; -} - -.cart-group .shortage-line { - width: 662rpx; - height: 2rpx; - background-color: #e6e6e6; - margin: 0 auto; -} -.cart-group .shortage-goods-wrap { - background-color: #fff; -} -.cart-group .shortage-goods-wrap .shortage-tip-title { - height: 72rpx; - line-height: 72rpx; - padding-left: 28rpx; - font-size: 24rpx; - color: #999; -} -.stepper-info { - margin-left: auto; -} -.invalid-goods-wrap { - background-color: #fff; - border-radius: 8rpx; - margin-top: 40rpx; -} -.invalid-goods-wrap .invalid-head { - display: flex; - justify-content: space-between; - padding: 30rpx 20rpx; - font-size: 24rpx; - border-bottom: 2rpx solid #f6f6f6; -} -.invalid-goods-wrap .invalid-head .invalid-title { - color: #333; - font-size: 28rpx; - font-weight: 600; -} -.invalid-goods-wrap .invalid-head .invalid-clear { - color: #fa4126; -} -.invalid-goods-wrap .toggle { - display: flex; - height: 80rpx; - justify-content: center; - align-items: center; - font-size: 24rpx; - color: #fa4126; -} -.invalid-goods-wrap .toggle .m-r-6 { - margin-right: 6rpx; -} -.invalid-goods-wrap .toggle .top-icon { - display: inline-block; - width: 0; - height: 0; - border-left: 10rpx solid transparent; - border-right: 10rpx solid transparent; - border-bottom: 10rpx solid #fa4126; -} -.invalid-goods-wrap .toggle .down-icon { - display: inline-block; - width: 0; - height: 0; - border-left: 10rpx solid transparent; - border-right: 10rpx solid transparent; - border-top: 10rpx solid #fa4126; -} -.action-btn { - display: flex; - align-items: center; -} -.action-btn .action-btn-arrow { - font-size: 20rpx; - margin-left: 8rpx; -} -.action-btn--active { - opacity: 0.5; -} - -.swiper-right-del { - height: calc(100% - 40rpx); - width: 144rpx; - background-color: #fa4126; - font-size: 28rpx; - color: white; - display: flex; - justify-content: center; - align-items: center; -} -.goods-stepper .stepper { - border: none; - border-radius: 0; - height: auto; - width: 168rpx; - overflow: visible; -} -.goods-stepper .stepper .stepper__minus, -.goods-stepper .stepper .stepper__plus { - width: 44rpx; - height: 44rpx; - background-color: #f5f5f5; -} -.goods-stepper .stepper .stepper__minus--hover, -.goods-stepper .stepper .stepper__plus--hover { - background-color: #f5f5f5; -} -.goods-stepper .stepper .stepper__minus .wr-icon, -.goods-stepper .stepper .stepper__plus .wr-icon { - font-size: 24rpx; -} -.goods-stepper .stepper .stepper__minus { - position: relative; -} -.goods-stepper .stepper .stepper__minus::after { - position: absolute; - display: block; - content: ' '; - left: -20rpx; - right: -5rpx; - top: -20rpx; - bottom: -20rpx; - background-color: transparent; -} -.goods-stepper .stepper .stepper__plus { - position: relative; -} -.goods-stepper .stepper .stepper__plus::after { - position: absolute; - display: block; - content: ' '; - left: -5rpx; - right: -20rpx; - top: -20rpx; - bottom: -20rpx; - background-color: transparent; -} -.goods-stepper .stepper .stepper__input { - width: 72rpx; - height: 44rpx; - background-color: #f5f5f5; - font-size: 24rpx; - color: #222427; - font-weight: 600; - border-left: none; - border-right: none; - min-height: 40rpx; - margin: 0 4rpx; - display: flex; - align-items: center; -} - -.goods-sku-info .no-storage-mask { - position: absolute; - color: #fff; - bottom: 0rpx; - left: 0rpx; - background-color: rgba(0, 0, 0, 0.1); - height: 192rpx; - width: 192rpx; - border-radius: 8rpx; - display: flex; - justify-content: center; - align-items: center; -} - -.no-storage-mask .no-storage-content { - width: 128rpx; - height: 128rpx; - border-radius: 64rpx; - background-color: rgba(0, 0, 0, 0.4); - text-align: center; - line-height: 128rpx; - font-size: 28rpx; -} diff --git a/pages/cart/components/cart-group/utils.wxs b/pages/cart/components/cart-group/utils.wxs deleted file mode 100644 index f887eba..0000000 --- a/pages/cart/components/cart-group/utils.wxs +++ /dev/null @@ -1,20 +0,0 @@ -module.exports.slice = function(arr) { - return arr.slice(0, 2); -}; -module.exports.imgCut = function(url, width, height) { - if (url && (url.slice(0, 5) === 'http:' || url.slice(0, 6) === 'https:' || url.slice(0, 2) === '//')) { - var argsStr = 'imageMogr2/thumbnail/!' + width + 'x' + height + 'r'; - if (url.indexOf('?') > -1) { - url = url + '&' + argsStr; - } else { - url = url + '?' + argsStr; - } - if (url.slice(0, 5) === 'http:') { - url = 'https://' + url.slice(5) - } - if (url.slice(0, 2) === '//') { - url = 'https:' + url - } - } - return url; -}; diff --git a/pages/cart/components/goods-card/index.js b/pages/cart/components/goods-card/index.js deleted file mode 100644 index c59658c..0000000 --- a/pages/cart/components/goods-card/index.js +++ /dev/null @@ -1,243 +0,0 @@ -Component({ - options: { - multipleSlots: true, // 在组件定义时的选项中启用多slot支持 - addGlobalClass: true, - }, - intersectionObserverContext: null, - - externalClasses: [ - 'card-class', - 'title-class', - 'desc-class', - 'num-class', - 'thumb-class', - 'specs-class', - 'price-class', - 'origin-price-class', - 'price-prefix-class', - ], - - properties: { - hidden: { - // 设置为null代表不做类型转换 - type: null, - value: false, - observer(hidden) { - // null就是代表没有设置,没有设置的话不setData,防止祖先组件触发的setHidden操作被覆盖 - if (hidden !== null) { - this.setHidden(!!hidden); - } - }, - }, - id: { - type: String, - // `goods-card-88888888` - // 不能在这里写生成逻辑,如果在这里写,那么假设有多个goods-list时,他们将共享这个值 - value: '', - observer: (id) => { - this.genIndependentID(id); - if (this.properties.thresholds?.length) { - this.createIntersectionObserverHandle(); - } - }, - }, - data: { - type: Object, - observer(goods) { - // 有ID的商品才渲染 - if (!goods) { - return; - } - - /** 划线价是否有效 */ - let isValidityLinePrice = true; - // 判断一次划线价格是否合理 - if ( - goods.originPrice && - goods.price && - goods.originPrice < goods.price - ) { - isValidityLinePrice = false; - } - - // 敲定换行数量默认值 - if (goods.lineClamp === undefined || goods.lineClamp <= 0) { - // tag数组长度 大于0 且 可见 - // 指定换行为1行 - if ((goods.tags?.length || 0) > 0 && !goods.hideKey?.tags) { - goods.lineClamp = 1; - } else { - goods.lineClamp = 2; - } - } - - this.setData({ goods, isValidityLinePrice }); - }, - }, - layout: { - type: String, - value: 'horizontal', - }, - thumbMode: { - type: String, - value: 'aspectFill', - }, - priceFill: { - type: Boolean, - value: true, - }, - currency: { - type: String, - value: '¥', - }, - lazyLoad: { - type: Boolean, - value: false, - }, - centered: { - type: Boolean, - value: false, - }, - pricePrefix: { - type: String, - value: '', - }, - /** 元素可见监控阈值, 数组长度大于0就创建 */ - thresholds: { - type: Array, - value: [], - observer(current) { - if (current && current.length) { - this.createIntersectionObserverHandle(); - } else { - this.clearIntersectionObserverHandle(); - } - }, - }, - specsIconClassPrefix: { - type: String, - value: 'wr', - }, - specsIcon: { - type: String, - value: 'expand_more', - }, - addCartIconClassPrefix: { - type: String, - value: 'wr', - }, - addCartIcon: { - type: String, - value: 'cart', - }, - }, - - data: { - hiddenInData: false, - independentID: '', - goods: { id: '' }, - /** 保证划线价格不小于原价,否则不渲染划线价 */ - isValidityLinePrice: false, - }, - - lifetimes: { - ready() { - this.init(); - }, - detached() { - this.clear(); - }, - }, - - methods: { - clickHandle() { - this.triggerEvent('click', { goods: this.data.goods }); - }, - clickThumbHandle() { - this.triggerEvent('thumb', { goods: this.data.goods }); - }, - clickSpecsHandle() { - this.triggerEvent('specs', { goods: this.data.goods }); - }, - clickTagHandle(evt) { - const { index } = evt.currentTarget.dataset; - this.triggerEvent('tag', { goods: this.data.goods, index }); - }, - // 加入购物车 - addCartHandle(e) { - const { id } = e.currentTarget; - const { id: cardID } = e.currentTarget.dataset; - this.triggerEvent('add-cart', { - ...e.detail, - id, - cardID, - goods: this.data.goods, - }); - }, - genIndependentID(id, cb) { - let independentID; - if (id) { - independentID = id; - } else { - independentID = `goods-card-${~~(Math.random() * 10 ** 8)}`; - } - this.setData({ independentID }, cb); - }, - - init() { - const { thresholds, id, hidden } = this.properties; - if (hidden !== null) { - this.setHidden(!!hidden); - } - - this.genIndependentID(id || '', () => { - if (thresholds && thresholds.length) { - this.createIntersectionObserverHandle(); - } - }); - }, - - clear() { - this.clearIntersectionObserverHandle(); - }, - - setHidden(hidden) { - this.setData({ hiddenInData: !!hidden }); - }, - - createIntersectionObserverHandle() { - if (this.intersectionObserverContext || !this.data.independentID) { - return; - } - - this.intersectionObserverContext = wx - .createIntersectionObserver(this, { - thresholds: this.properties.thresholds, - }) - .relativeToViewport(); - - this.intersectionObserverContext.observe( - `#${this.data.independentID}`, - (res) => { - this.intersectionObserverCB(res); - }, - ); - }, - intersectionObserverCB(ob) { - this.triggerEvent('ob', { - goods: this.data.goods, - context: this.intersectionObserverContext, - ob, - }); - }, - clearIntersectionObserverHandle() { - if (this.intersectionObserverContext) { - try { - this.intersectionObserverContext.disconnect(); - } catch (e) {} - - this.intersectionObserverContext = null; - } - }, - }, -}); diff --git a/pages/cart/components/goods-card/index.json b/pages/cart/components/goods-card/index.json deleted file mode 100644 index d76303b..0000000 --- a/pages/cart/components/goods-card/index.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "component": true, - "usingComponents": { - "price": "/components/price/index", - "t-tag": "tdesign-miniprogram/tag/tag", - "t-image": "/components/webp-image/index", - "t-icon": "tdesign-miniprogram/icon/icon" - } -} \ No newline at end of file diff --git a/pages/cart/components/goods-card/index.wxml b/pages/cart/components/goods-card/index.wxml deleted file mode 100644 index df4111f..0000000 --- a/pages/cart/components/goods-card/index.wxml +++ /dev/null @@ -1,75 +0,0 @@ - - diff --git a/pages/cart/components/goods-card/index.wxss b/pages/cart/components/goods-card/index.wxss deleted file mode 100644 index 6a7a4da..0000000 --- a/pages/cart/components/goods-card/index.wxss +++ /dev/null @@ -1,260 +0,0 @@ -.wr-goods-card { - box-sizing: border-box; - font-size: 24rpx; -} -/* */ -.wr-goods-card__main { - position: relative; - display: flex; - padding: 0; - background: transparent; -} - -.wr-goods-card.center .wr-goods-card__main { - align-items: flex-start; - justify-content: center; -} - -.wr-goods-card__thumb { - flex-shrink: 0; - position: relative; - width: 140rpx; - height: 140rpx; -} - -.wr-goods-card__thumb-com { - width: 192rpx; - height: 192rpx; - border-radius: 8rpx; - overflow: hidden; -} -.wr-goods-card__thumb:empty { - display: none; - margin: 0; -} - -.wr-goods-card__body { - display: flex; - margin: 0 0 0 20rpx; - flex-direction: row; - flex: 1 1 auto; - min-height: 192rpx; -} - -.wr-goods-card__long_content { - display: flex; - flex-direction: column; - overflow: hidden; - flex: 1 1 auto; -} -.wr-goods-card__long_content .goods_tips { - width: 100%; - margin-top: 16rpx; - text-align: right; - color: #fa4126; - font-size: 24rpx; - line-height: 32rpx; - font-weight: bold; -} -.wr-goods-card__title { - flex-shrink: 0; - font-size: 28rpx; - color: #333; - line-height: 40rpx; - font-weight: 400; - display: -webkit-box; - -webkit-box-orient: vertical; - overflow: hidden; - word-break: break-word; -} -.wr-goods-card__title__prefix-tags { - display: inline-flex; -} -.wr-goods-card__title__prefix-tags .prefix-tag { - margin: 0 8rpx 0 0; -} -.wr-goods-card__desc { - font-size: 24rpx; - color: #f5f5f5; - line-height: 40rpx; - display: -webkit-box; - -webkit-box-orient: vertical; - -webkit-line-clamp: 2; - overflow: hidden; -} -.wr-goods-card__specs__desc, -.wr-goods-card__specs__text { - font-size: 24rpx; - height: 32rpx; - line-height: 32rpx; - color: #999999; - margin: 8rpx 0; -} -.wr-goods-card__specs__desc { - display: flex; - align-self: flex-start; - flex-direction: row; - background: #f5f5f5; - border-radius: 8rpx; - padding: 4rpx 8rpx; -} -.wr-goods-card__specs__desc-text { - height: 100%; - max-width: 380rpx; - word-break: break-all; - overflow: hidden; - display: -webkit-box; - -webkit-box-orient: vertical; - -webkit-line-clamp: 1; -} -.wr-goods-card__specs__desc-icon { - line-height: inherit; - margin-left: 8rpx; - font-size: 24rpx; - color: #bbb; -} -.wr-goods-card__specs__text { - display: -webkit-box; - -webkit-box-orient: vertical; - -webkit-line-clamp: 1; - overflow: hidden; - text-overflow: ellipsis; - word-break: break-all; -} -.wr-goods-card__tags { - display: flex; - flex-direction: row; - flex-wrap: wrap; - margin: 16rpx 0 0 0; -} -.wr-goods-card__tag { - color: #fa550f; - background: transparent; - font-size: 20rpx; - border: 1rpx solid #fa550f; - padding: 0 8rpx; - height: 30rpx; - line-height: 30rpx; - margin: 0 8rpx 8rpx 0; - display: block; - overflow: hidden; - white-space: nowrap; - word-break: keep-all; - text-overflow: ellipsis; -} -.wr-goods-card__short_content { - display: flex; - flex-direction: column; - justify-content: flex-start; - align-items: flex-end; - margin: 0 0 0 46rpx; -} -.wr-goods-card__price__prefix { - order: 0; - color: #666; - margin: 0; -} -.wr-goods-card__price { - white-space: nowrap; - font-weight: bold; - order: 1; - color: #fa4126; - font-size: 36rpx; - margin: 0; - line-height: 48rpx; -} -.wr-goods-card__origin-price { - white-space: nowrap; - font-weight: normal; - order: 2; - color: #aaaaaa; - font-size: 24rpx; - margin: 0; -} -.wr-goods-card__num { - white-space: nowrap; - order: 4; - font-size: 24rpx; - color: #999; - margin: 20rpx 0 0 auto; -} -.wr-goods-card__num__prefix { - color: inherit; -} -.wr-goods-card__add-cart { - order: 3; - margin: auto 0 0 auto; -} -.wr-goods-card.horizontal-wrap .wr-goods-card__thumb { - width: 192rpx; - height: 192rpx; - border-radius: 8rpx; - overflow: hidden; -} -.wr-goods-card.horizontal-wrap .wr-goods-card__body { - flex-direction: column; -} -.wr-goods-card.horizontal-wrap .wr-goods-card__short_content { - flex-direction: row; - align-items: center; - margin: 16rpx 0 0 0; -} - -.wr-goods-card.horizontal-wrap .wr-goods-card__num { - margin: 0 0 0 auto; -} -.wr-goods-card.vertical .wr-goods-card__main { - padding: 0 0 22rpx 0; - flex-direction: column; -} -.wr-goods-card.vertical .wr-goods-card__thumb { - width: 340rpx; - height: 340rpx; -} -.wr-goods-card.vertical .wr-goods-card__body { - margin: 20rpx 20rpx 0 20rpx; - flex-direction: column; -} -.wr-goods-card.vertical .wr-goods-card__long_content { - overflow: hidden; -} -.wr-goods-card.vertical .wr-goods-card__title { - line-height: 36rpx; -} -.wr-goods-card.vertical .wr-goods-card__short_content { - margin: 20rpx 0 0 0; -} -.wr-goods-card.vertical .wr-goods-card__price { - order: 2; - color: #fa4126; - margin: 20rpx 0 0 0; -} -.wr-goods-card.vertical .wr-goods-card__origin-price { - order: 1; -} -.wr-goods-card.vertical .wr-goods-card__add-cart { - position: absolute; - bottom: 20rpx; - right: 20rpx; -} - -.wr-goods-card__short_content .no_storage { - display: flex; - align-items: center; - justify-content: space-between; - height: 40rpx; - color: #333; - font-size: 24rpx; - line-height: 32rpx; - width: 100%; -} - -.no_storage .no_storage__right { - width: 80rpx; - height: 40rpx; - border-radius: 20rpx; - border: 2rpx solid #fa4126; - line-height: 40rpx; - text-align: center; - color: #fa4126; -} diff --git a/pages/cart/components/specs-popup/index.js b/pages/cart/components/specs-popup/index.js deleted file mode 100644 index 650d2aa..0000000 --- a/pages/cart/components/specs-popup/index.js +++ /dev/null @@ -1,72 +0,0 @@ -Component({ - options: { - addGlobalClass: true, - multipleSlots: true, // 在组件定义时的选项中启用多slot支持 - }, - - properties: { - show: { - type: Boolean, - value: false, - }, - value: { - type: String, - value: '', - }, - title: { - type: String, - observer(newVal) { - this.setData({ 'goods.title': newVal }); - }, - }, - price: { - type: String, - value: '', - observer(newVal) { - this.setData({ 'goods.price': newVal }); - }, - }, - thumb: { - type: String, - value: '', - observer(newVal) { - this.setData({ 'goods.thumb': newVal }); - }, - }, - thumbMode: { - type: String, - value: 'aspectFit', - }, - zIndex: { - type: Number, - value: 99, - }, - specs: { - type: Array, - value: [], - }, - }, - - data: { - goods: { - title: '', - thumb: '', - price: '', - hideKey: { - originPrice: true, - tags: true, - specs: true, - num: true, - }, - }, - }, - methods: { - onClose() { - this.triggerEvent('close'); - }, - - onCloseOver() { - this.triggerEvent('closeover'); - }, - }, -}); diff --git a/pages/cart/components/specs-popup/index.json b/pages/cart/components/specs-popup/index.json deleted file mode 100644 index d59fc6d..0000000 --- a/pages/cart/components/specs-popup/index.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "component": true, - "usingComponents": { - "t-popup": "tdesign-miniprogram/popup/popup", - "goods-card": "../../components/goods-card/index" - } -} \ No newline at end of file diff --git a/pages/cart/components/specs-popup/index.wxml b/pages/cart/components/specs-popup/index.wxml deleted file mode 100644 index 4ddcb43..0000000 --- a/pages/cart/components/specs-popup/index.wxml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - 已选规格 - - {{spec}} - - - - - 我知道了 - - - diff --git a/pages/cart/components/specs-popup/index.wxss b/pages/cart/components/specs-popup/index.wxss deleted file mode 100644 index 359c185..0000000 --- a/pages/cart/components/specs-popup/index.wxss +++ /dev/null @@ -1,68 +0,0 @@ -.specs-popup { - width: 100vw; - box-sizing: border-box; - padding: 32rpx 32rpx calc(20rpx + env(safe-area-inset-bottom)) 32rpx; - max-height: 80vh; - display: flex; - flex-direction: column; - background-color: white; - border-radius: 20rpx 20rpx 0 0; -} -.specs-popup .section { - margin-top: 44rpx; - flex: auto; - overflow-y: scroll; - overflow-x: hidden; - -webkit-overflow-scrolling: touch; -} -.specs-popup .section .title { - font-size: 26rpx; - color: #4f5356; -} -.specs-popup .section .options { - color: #333333; - font-size: 24rpx; - margin-right: -26rpx; -} -.specs-popup .section .options .option { - display: inline-block; - margin-top: 24rpx; - height: 56rpx; - line-height: 56rpx; - padding: 0 16rpx; - border-radius: 8rpx; - background-color: #f5f5f5; - max-width: 100%; - box-sizing: border-box; - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; -} -.specs-popup .section .options .option:not(:last-child) { - margin-right: 26rpx; -} -.specs-popup .bottom-btn { - margin-top: 42rpx; - position: relative; - height: 80rpx; - line-height: 80rpx; - text-align: center; - background-color: white; - color: #fa4126; -} -.specs-popup .bottom-btn--active { - opacity: 0.5; -} -.specs-popup .bottom-btn::after { - display: block; - content: ' '; - position: absolute; - left: 0; - top: 0; - width: 200%; - height: 200%; - border: 1px solid #fa4126; - border-radius: 80rpx; - transform: scale(0.5); - transform-origin: left top; -} diff --git a/pages/cart/index.js b/pages/cart/index.js deleted file mode 100644 index 3fd6d61..0000000 --- a/pages/cart/index.js +++ /dev/null @@ -1,315 +0,0 @@ -import Dialog from 'tdesign-miniprogram/dialog/index'; -import Toast from 'tdesign-miniprogram/toast/index'; -import { fetchCartGroupData } from '../../services/cart/cart'; - -Page({ - data: { - cartGroupData: null, - }, - - // 调用自定义tabbar的init函数,使页面与tabbar激活状态保持一致 - onShow() { - this.getTabBar().init(); - }, - - onLoad() { - this.refreshData(); - }, - - refreshData() { - this.getCartGroupData().then((res) => { - let isEmpty = true; - const cartGroupData = res.data; - // 一些组件中需要的字段可能接口并没有返回,或者返回的数据结构与预期不一致,需要在此先对数据做一些处理 - // 统计门店下加购的商品是否全选、是否存在缺货/无货 - for (const store of cartGroupData.storeGoods) { - store.isSelected = true; // 该门店已加购商品是否全选 - store.storeStockShortage = false; // 该门店已加购商品是否存在库存不足 - if (!store.shortageGoodsList) { - store.shortageGoodsList = []; // 该门店已加购商品如果库存为0需单独分组 - } - for (const activity of store.promotionGoodsList) { - activity.goodsPromotionList = activity.goodsPromotionList.filter( - (goods) => { - goods.originPrice = undefined; - - // 统计是否有加购数大于库存数的商品 - if (goods.quantity > goods.stockQuantity) { - store.storeStockShortage = true; - } - // 统计是否全选 - if (!goods.isSelected) { - store.isSelected = false; - } - // 库存为0(无货)的商品单独分组 - if (goods.stockQuantity > 0) { - return true; - } - store.shortageGoodsList.push(goods); - return false; - }, - ); - - if (activity.goodsPromotionList.length > 0) { - isEmpty = false; - } - } - if (store.shortageGoodsList.length > 0) { - isEmpty = false; - } - } - cartGroupData.invalidGoodItems = cartGroupData.invalidGoodItems.map( - (goods) => { - goods.originPrice = undefined; - return goods; - }, - ); - cartGroupData.isNotEmpty = !isEmpty; - this.setData({ cartGroupData }); - }); - }, - - findGoods(spuId, skuId) { - let currentStore; - let currentActivity; - let currentGoods; - const { storeGoods } = this.data.cartGroupData; - for (const store of storeGoods) { - for (const activity of store.promotionGoodsList) { - for (const goods of activity.goodsPromotionList) { - if (goods.spuId === spuId && goods.skuId === skuId) { - currentStore = store; - currentActivity = currentActivity; - currentGoods = goods; - return { - currentStore, - currentActivity, - currentGoods, - }; - } - } - } - } - return { - currentStore, - currentActivity, - currentGoods, - }; - }, - - // 注:实际场景时应该调用接口获取购物车数据 - getCartGroupData() { - const { cartGroupData } = this.data; - if (!cartGroupData) { - return fetchCartGroupData(); - } - return Promise.resolve({ data: cartGroupData }); - }, - - // 选择单个商品 - // 注:实际场景时应该调用接口更改选中状态 - selectGoodsService({ spuId, skuId, isSelected }) { - this.findGoods(spuId, skuId).currentGoods.isSelected = isSelected; - return Promise.resolve(); - }, - - // 全选门店 - // 注:实际场景时应该调用接口更改选中状态 - selectStoreService({ storeId, isSelected }) { - const currentStore = this.data.cartGroupData.storeGoods.find( - (s) => s.storeId === storeId, - ); - currentStore.isSelected = isSelected; - currentStore.promotionGoodsList.forEach((activity) => { - activity.goodsPromotionList.forEach((goods) => { - goods.isSelected = isSelected; - }); - }); - return Promise.resolve(); - }, - - // 加购数量变更 - // 注:实际场景时应该调用接口 - changeQuantityService({ spuId, skuId, quantity }) { - this.findGoods(spuId, skuId).currentGoods.quantity = quantity; - return Promise.resolve(); - }, - - // 删除加购商品 - // 注:实际场景时应该调用接口 - deleteGoodsService({ spuId, skuId }) { - function deleteGoods(group) { - for (const gindex in group) { - const goods = group[gindex]; - if (goods.spuId === spuId && goods.skuId === skuId) { - group.splice(gindex, 1); - return gindex; - } - } - return -1; - } - const { storeGoods, invalidGoodItems } = this.data.cartGroupData; - for (const store of storeGoods) { - for (const activity of store.promotionGoodsList) { - if (deleteGoods(activity.goodsPromotionList) > -1) { - return Promise.resolve(); - } - } - if (deleteGoods(store.shortageGoodsList) > -1) { - return Promise.resolve(); - } - } - if (deleteGoods(invalidGoodItems) > -1) { - return Promise.resolve(); - } - return Promise.reject(); - }, - - // 清空失效商品 - // 注:实际场景时应该调用接口 - clearInvalidGoodsService() { - this.data.cartGroupData.invalidGoodItems = []; - return Promise.resolve(); - }, - - onGoodsSelect(e) { - const { - goods: { spuId, skuId }, - isSelected, - } = e.detail; - const { currentGoods } = this.findGoods(spuId, skuId); - Toast({ - context: this, - selector: '#t-toast', - message: `${isSelected ? '选择' : '取消'}"${ - currentGoods.title.length > 5 - ? `${currentGoods.title.slice(0, 5)}...` - : currentGoods.title - }"`, - icon: '', - }); - this.selectGoodsService({ spuId, skuId, isSelected }).then(() => - this.refreshData(), - ); - }, - - onStoreSelect(e) { - const { - store: { storeId }, - isSelected, - } = e.detail; - this.selectStoreService({ storeId, isSelected }).then(() => - this.refreshData(), - ); - }, - - onQuantityChange(e) { - const { - goods: { spuId, skuId }, - quantity, - } = e.detail; - const { currentGoods } = this.findGoods(spuId, skuId); - const stockQuantity = - currentGoods.stockQuantity > 0 ? currentGoods.stockQuantity : 0; // 避免后端返回的是-1 - // 加购数量超过库存数量 - if (quantity > stockQuantity) { - // 加购数量等于库存数量的情况下继续加购 - if ( - currentGoods.quantity === stockQuantity && - quantity - stockQuantity === 1 - ) { - Toast({ - context: this, - selector: '#t-toast', - message: '当前商品库存不足', - }); - return; - } - Dialog.confirm({ - title: '商品库存不足', - content: `当前商品库存不足,最大可购买数量为${stockQuantity}件`, - confirmBtn: '修改为最大可购买数量', - cancelBtn: '取消', - }) - .then(() => { - this.changeQuantityService({ - spuId, - skuId, - quantity: stockQuantity, - }).then(() => this.refreshData()); - }) - .catch(() => {}); - return; - } - this.changeQuantityService({ spuId, skuId, quantity }).then(() => - this.refreshData(), - ); - }, - - goCollect() { - /** 活动肯定有一个活动ID,用来获取活动banner,活动商品列表等 */ - const promotionID = '123'; - wx.navigateTo({ - url: `/pages/promotion-detail/index?promotion_id=${promotionID}`, - }); - }, - - goGoodsDetail(e) { - const { spuId, storeId } = e.detail.goods; - wx.navigateTo({ - url: `/pages/goods/details/index?spuId=${spuId}&storeId=${storeId}`, - }); - }, - - clearInvalidGoods() { - // 实际场景时应该调用接口清空失效商品 - this.clearInvalidGoodsService().then(() => this.refreshData()); - }, - - onGoodsDelete(e) { - const { - goods: { spuId, skuId }, - } = e.detail; - Dialog.confirm({ - content: '确认删除该商品吗?', - confirmBtn: '确定', - cancelBtn: '取消', - }).then(() => { - this.deleteGoodsService({ spuId, skuId }).then(() => { - Toast({ context: this, selector: '#t-toast', message: '商品删除成功' }); - this.refreshData(); - }); - }); - }, - - onSelectAll(event) { - const { isAllSelected } = event?.detail ?? {}; - Toast({ - context: this, - selector: '#t-toast', - message: `${isAllSelected ? '取消' : '点击'}了全选按钮`, - }); - // 调用接口改变全选 - }, - - onToSettle() { - const goodsRequestList = []; - this.data.cartGroupData.storeGoods.forEach((store) => { - store.promotionGoodsList.forEach((promotion) => { - promotion.goodsPromotionList.forEach((m) => { - if (m.isSelected == 1) { - goodsRequestList.push(m); - } - }); - }); - }); - wx.setStorageSync( - 'order.goodsRequestList', - JSON.stringify(goodsRequestList), - ); - wx.navigateTo({ url: '/pages/order/order-confirm/index?type=cart' }); - }, - onGotoHome() { - wx.switchTab({ url: '/pages/home/home' }); - }, -}); diff --git a/pages/cart/index.json b/pages/cart/index.json deleted file mode 100644 index 1d2e717..0000000 --- a/pages/cart/index.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "navigationBarTitleText": "购物车", - "usingComponents": { - "cart-group": "./components/cart-group/index", - "cart-empty": "./components/cart-empty/index", - "cart-bar": "./components/cart-bar/index", - "t-toast": "tdesign-miniprogram/toast/toast", - "t-dialog": "tdesign-miniprogram/dialog/dialog" - } -} \ No newline at end of file diff --git a/pages/cart/index.wxml b/pages/cart/index.wxml deleted file mode 100644 index aa1acec..0000000 --- a/pages/cart/index.wxml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - - - diff --git a/pages/cart/index.wxss b/pages/cart/index.wxss deleted file mode 100644 index 4eec899..0000000 --- a/pages/cart/index.wxss +++ /dev/null @@ -1,12 +0,0 @@ -:host { - padding-bottom: 100rpx; -} - -.gap { - height: 100rpx; - width: 100%; -} - -.add-notes__confirm { - color: #fa4126 !important; -} diff --git a/pages/coupon/components/coupon-card/index.js b/pages/coupon/components/coupon-card/index.js deleted file mode 100644 index 07785fe..0000000 --- a/pages/coupon/components/coupon-card/index.js +++ /dev/null @@ -1,57 +0,0 @@ -const statusMap = { - default: { text: '去使用', theme: 'primary' }, - useless: { text: '已使用', theme: 'default' }, - disabled: { text: '已过期', theme: 'default' }, -}; -Component({ - options: { - addGlobalClass: true, - multipleSlots: true, // 在组件定义时的选项中启用多slot支持 - }, - - externalClasses: ['coupon-class'], - - properties: { - couponDTO: { - type: Object, - value: {}, // 优惠券数据 - }, - }, - - data: { - btnText: '', - btnTheme: '', - }, - - observers: { - couponDTO: function (couponDTO) { - if (!couponDTO) { - return; - } - const statusInfo = statusMap[couponDTO.status]; - - this.setData({ - btnText: statusInfo.text, - btnTheme: statusInfo.theme, - }); - }, - }, - - attached() {}, - - methods: { - // 跳转到详情页 - gotoDetail() { - wx.navigateTo({ - url: `/pages/coupon/coupon-detail/index?id=${this.data.couponDTO.key}`, - }); - }, - - // 跳转到商品列表 - gotoGoodsList() { - wx.navigateTo({ - url: `/pages/coupon/coupon-activity-goods/index?id=${this.data.couponDTO.key}`, - }); - }, - }, -}); diff --git a/pages/coupon/components/coupon-card/index.json b/pages/coupon/components/coupon-card/index.json deleted file mode 100644 index 2d851d1..0000000 --- a/pages/coupon/components/coupon-card/index.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "component": true, - "usingComponents": { - "ui-coupon-card": "../ui-coupon-card/index", - "t-button": "tdesign-miniprogram/button/button" - } -} diff --git a/pages/coupon/components/coupon-card/index.wxml b/pages/coupon/components/coupon-card/index.wxml deleted file mode 100644 index 3c8315e..0000000 --- a/pages/coupon/components/coupon-card/index.wxml +++ /dev/null @@ -1,17 +0,0 @@ - - - {{btnText}} - - - - diff --git a/pages/coupon/components/coupon-card/index.wxss b/pages/coupon/components/coupon-card/index.wxss deleted file mode 100644 index 666e4b4..0000000 --- a/pages/coupon/components/coupon-card/index.wxss +++ /dev/null @@ -1,12 +0,0 @@ -.coupon-btn-slot .coupon-btn-primary { - width: 136rpx; - height: 56rpx; - border-radius: 28rpx; - background-color: transparent; - border-color: #fa4126; - color: #fa4126; -} - -.coupon-btn-default { - display: none; -} diff --git a/pages/coupon/components/floating-button/index.js b/pages/coupon/components/floating-button/index.js deleted file mode 100644 index f29bcad..0000000 --- a/pages/coupon/components/floating-button/index.js +++ /dev/null @@ -1,17 +0,0 @@ -Component({ - data: { icon: 'cart' }, - - properties: { - count: { - type: Number, - }, - }, - - methods: { - goToCart() { - wx.switchTab({ - url: '/pages/cart/index', - }); - }, - }, -}); diff --git a/pages/coupon/components/floating-button/index.wxml b/pages/coupon/components/floating-button/index.wxml deleted file mode 100644 index 7f1a9e7..0000000 --- a/pages/coupon/components/floating-button/index.wxml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - {{count}} - - - diff --git a/pages/coupon/components/floating-button/index.wxss b/pages/coupon/components/floating-button/index.wxss deleted file mode 100644 index faad943..0000000 --- a/pages/coupon/components/floating-button/index.wxss +++ /dev/null @@ -1,30 +0,0 @@ -.floating-button { - position: fixed; - right: 20rpx; - bottom: 108rpx; -} - -.floating-button .floating-inner-container { - display: flex; - align-items: center; - justify-content: center; - height: 96rpx; - width: 96rpx; - background-color: rgba(0, 0, 0, 0.8); - opacity: 0.7; - border-radius: 48rpx; -} - -.floating-button .floating-right-top { - position: absolute; - right: 0rpx; - top: 0rpx; - height: 28rpx; - background: #fa4126; - border-radius: 64rpx; - font-weight: bold; - font-size: 22rpx; - line-height: 28rpx; - color: #fff; - padding: 0 8rpx; -} diff --git a/pages/coupon/components/ui-coupon-card/index.js b/pages/coupon/components/ui-coupon-card/index.js deleted file mode 100644 index 9101be8..0000000 --- a/pages/coupon/components/ui-coupon-card/index.js +++ /dev/null @@ -1,87 +0,0 @@ -Component({ - options: { - addGlobalClass: true, - multipleSlots: true, - }, - - externalClasses: ['coupon-class'], - - properties: { - mask: { - type: Boolean, - value: false, // 是否添加遮罩 - }, - superposable: { - type: Boolean, - value: false, // 是否可叠加 - }, - type: { - type: String, - value: '', // 优惠券类型:CouponType - }, - value: { - type: String, - value: '', // 优惠金额 - }, - tag: { - type: String, - value: '', // 优惠标签,优惠券名字标签,img - }, - desc: { - type: String, - value: '', // 优惠金额描述,金额下方 - }, - title: { - type: String, // 优惠券名称 - value: '', - }, - timeLimit: { - type: String, // 优惠券时限 - value: '', - }, - ruleDesc: { - type: String, // 优惠券适用规则描述 - value: '', - }, - currency: { - type: String, - value: '¥', // 优惠货币 - }, - status: { - type: String, - value: 'default', - }, - image: { - type: String, - value: '', - }, - }, - - data: { - CouponType: { - MJ_COUPON: 1, - ZK_COUPON: 2, - MJF_COUPON: 3, - GIFT_COUPON: 4, - }, - theme: 'primary', - }, - - observers: { - status: function (value) { - let theme = 'primary'; - // 已过期或已使用的券 颜色置灰 - if (value === 'useless' || value === 'disabled') { - theme = 'weak'; - } - - this.setData({ theme }); - }, - }, - - attached() { - this.setData({ - color: `color${this.properties.colorStyle}`, - }); - }, -}); diff --git a/pages/coupon/components/ui-coupon-card/index.json b/pages/coupon/components/ui-coupon-card/index.json deleted file mode 100644 index dd874c8..0000000 --- a/pages/coupon/components/ui-coupon-card/index.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "component": true, - "usingComponents": { - "t-icon": "tdesign-miniprogram/icon/icon", - "t-image": "/components/webp-image/index" - } -} \ No newline at end of file diff --git a/pages/coupon/components/ui-coupon-card/index.wxml b/pages/coupon/components/ui-coupon-card/index.wxml deleted file mode 100644 index baf53d9..0000000 --- a/pages/coupon/components/ui-coupon-card/index.wxml +++ /dev/null @@ -1,54 +0,0 @@ - - function isBigValue(value) { - var values = (value + '').split('.'); - if (values[1] && values[0].length >= 3) return true; - else return false - } - - function getBigValues(value) { - return value.split('.'); - } - - module.exports = { isBigValue: isBigValue, getBigValues: getBigValues }; - - - - - {{value}} - - {{desc}} - - - - {{tools.getBigValues(value)[0]}} - .{{tools.getBigValues(value)[1]}} - - {{value / 100}} - - {{desc}} - - - 免邮 - {{desc}} - - - - - - - - {{title}} - {{timeLimit}} - - {{ruleDesc}} - - - - - - - - - 可叠加 - - diff --git a/pages/coupon/components/ui-coupon-card/index.wxss b/pages/coupon/components/ui-coupon-card/index.wxss deleted file mode 100644 index 0ef9648..0000000 --- a/pages/coupon/components/ui-coupon-card/index.wxss +++ /dev/null @@ -1,147 +0,0 @@ -.wr-coupon { - display: flex; - background-image: url('https://cdn-we-retail.ym.tencent.com/miniapp/coupon/coupon-bg-nocorners.png'); - background-size: 100% 100%; - background-repeat: no-repeat; - position: relative; - margin-bottom: 24rpx; - overflow: hidden; -} -.theme-weak.wr-coupon { - background-image: url('https://cdn-we-retail.ym.tencent.com/miniapp/coupon/coupon-bg-grey2.png'); -} - -.wr-coupon__left { - width: 200rpx; - height: 180rpx; - display: flex; - flex-direction: column; - justify-content: center; - text-align: center; - color: #fa4126; - overflow: hidden; - position: relative; -} -.theme-weak .wr-coupon__left { - color: #333; -} - -.wr-coupon__left--value { - font-size: 64rpx; - line-height: 88rpx; - font-weight: bold; - font-family: 'DIN Alternate', cursive; -} -.wr-coupon__left--value-int { - font-size: 48rpx; - line-height: 88rpx; -} -.wr-coupon__left--value-decimal { - font-size: 36rpx; - line-height: 48rpx; -} -.wr-coupon__left--image { - width: 128rpx; - height: 128rpx; - border-radius: 8px; - margin-top: 30rpx; -} -.wr-coupon__left--unit { - font-size: 24rpx; - line-height: 32rpx; -} -.wr-coupon__left--desc { - font-size: 24rpx; - line-height: 32rpx; - color: #fa4126; -} - -.theme-weak .wr-coupon__left--desc { - color: #333; -} - -.wr-coupon__right { - flex-grow: 1; - padding: 0 20rpx; - height: 180rpx; - box-sizing: border-box; - overflow: hidden; - display: flex; - align-items: center; -} -.wr-coupon__right--title { - display: flex; - -webkit-display: flex; - flex-direction: column; - align-items: flex-start; - color: #999999; - font-size: 24rpx; - flex: 1; -} -.wr-coupon__right--title .coupon-title { - max-width: 320rpx; - color: #333333; - font-size: 28rpx; - line-height: 40rpx; - font-weight: bold; - display: -webkit-box; - -webkit-line-clamp: 1; - -webkit-box-orient: vertical; - overflow: hidden; - white-space: normal; -} -.wr-coupon__right--title .coupon-time { - margin-top: 16rpx; - /* // letter-spacing: -0.05em; */ -} -.wr-coupon__right--title .coupon-desc { - margin-top: 8rpx; -} -.wr-coupon__right--title .coupon-arrow { - font-size: 22rpx; -} -.wr-coupon__right--oper { - display: flex; - justify-content: center; - align-items: center; -} -.wr-coupon__mask { - width: 702rpx; - height: 182rpx; - position: absolute; - top: 0; - left: 0; - background-color: #ffffff; - opacity: 0.5; -} -.wr-coupon__tag { - position: absolute; - top: 8px; - right: -24rpx; - text-align: center; - width: 106rpx; - height: 28rpx; - opacity: 0.9; - font-size: 20rpx; - line-height: 28rpx; - color: #fa4126; - border: 0.5px solid #fa4126; - box-sizing: border-box; - transform: rotate(45deg); -} -.wr-coupon__seal { - width: 128rpx; - height: 128rpx; - position: absolute; - top: 0; - right: 0; - background-size: 100% 100%; -} - -.wr-coupon__seal.seal-useless { - background-image: url('https://cdn-we-retail.ym.tencent.com/miniapp/coupon/seal-used.png'); -} - -.wr-coupon__seal.seal-disabled { - background-image: url('https://cdn-we-retail.ym.tencent.com/miniapp/coupon/coupon-expired.png'); -} diff --git a/pages/coupon/coupon-activity-goods/index.js b/pages/coupon/coupon-activity-goods/index.js deleted file mode 100644 index bf08d36..0000000 --- a/pages/coupon/coupon-activity-goods/index.js +++ /dev/null @@ -1,78 +0,0 @@ -import { fetchCouponDetail } from '../../../services/coupon/index'; -import { fetchGoodsList } from '../../../services/good/fetchGoods'; -import Toast from 'tdesign-miniprogram/toast/index'; - -Page({ - data: { - goods: [], - detail: {}, - couponTypeDesc: '', - showStoreInfoList: false, - cartNum: 2, - }, - - id: '', - - onLoad(query) { - const id = parseInt(query.id); - this.id = id; - - this.getCouponDetail(id); - this.getGoodsList(id); - }, - - getCouponDetail(id) { - fetchCouponDetail(id).then(({ detail }) => { - this.setData({ detail }); - if (detail.type === 2) { - if (detail.base > 0) { - this.setData({ - couponTypeDesc: `满${detail.base / 100}元${detail.value}折`, - }); - } else { - this.setData({ couponTypeDesc: `${detail.value}折` }); - } - } else if (detail.type === 1) { - if (detail.base > 0) { - this.setData({ - couponTypeDesc: `满${detail.base / 100}元减${detail.value / 100}元`, - }); - } else { - this.setData({ couponTypeDesc: `减${detail.value / 100}元` }); - } - } - }); - }, - - getGoodsList(id) { - fetchGoodsList(id).then((goods) => { - this.setData({ goods }); - }); - }, - - openStoreList() { - this.setData({ - showStoreInfoList: true, - }); - }, - - closeStoreList() { - this.setData({ - showStoreInfoList: false, - }); - }, - - goodClickHandle(e) { - const { index } = e.detail; - const { spuId } = this.data.goods[index]; - wx.navigateTo({ url: `/pages/goods/details/index?spuId=${spuId}` }); - }, - - cartClickHandle() { - Toast({ - context: this, - selector: '#t-toast', - message: '点击加入购物车', - }); - }, -}); diff --git a/pages/coupon/coupon-activity-goods/index.json b/pages/coupon/coupon-activity-goods/index.json deleted file mode 100644 index 31cf9c3..0000000 --- a/pages/coupon/coupon-activity-goods/index.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "navigationBarTitleText": "活动商品", - "usingComponents": { - "t-icon": "tdesign-miniprogram/icon/icon", - "t-popup": "tdesign-miniprogram/popup/popup", - "t-toast": "tdesign-miniprogram/toast/toast", - "goods-list": "/components/goods-list/index", - "floating-button": "../components/floating-button/index" - } -} \ No newline at end of file diff --git a/pages/coupon/coupon-activity-goods/index.wxml b/pages/coupon/coupon-activity-goods/index.wxml deleted file mode 100644 index a10ddd0..0000000 --- a/pages/coupon/coupon-activity-goods/index.wxml +++ /dev/null @@ -1,54 +0,0 @@ - - - - 以下商品可使用 - {{couponTypeDesc}} - 优惠券 - - - - - - - - - - - - 规则详情 - - - - 优惠券有效时间 - {{detail.timeLimit}} - - - 优惠券说明 - {{detail.desc}} - - - 使用须知 - {{detail.useNotes}} - - - - - - - diff --git a/pages/coupon/coupon-activity-goods/index.wxss b/pages/coupon/coupon-activity-goods/index.wxss deleted file mode 100644 index be5fdaf..0000000 --- a/pages/coupon/coupon-activity-goods/index.wxss +++ /dev/null @@ -1,74 +0,0 @@ -page { - background-color: #f5f5f5; -} - -.coupon-page-container .notice-bar-content { - display: flex; - flex-direction: row; - align-items: center; - padding: 8rpx 0; -} - -.coupon-page-container .notice-bar-text { - font-size: 26rpx; - line-height: 36rpx; - font-weight: 400; - color: #666666; - margin-left: 24rpx; -} - -.coupon-page-container .notice-bar-text .height-light { - color: #fa550f; -} - -.coupon-page-container .notice-bar-icon { - margin-left: 12rpx; - height: 68rpx; - line-height: 68rpx !important; -} - -.coupon-page-container .popup-content-wrap { - background-color: #fff; - border-top-left-radius: 20rpx; - border-top-right-radius: 20rpx; -} - -.coupon-page-container .popup-content-title { - font-size: 32rpx; - color: #333; - text-align: center; - height: 104rpx; - line-height: 104rpx; - position: relative; -} - -.coupon-page-container .desc-group-wrap { - padding-bottom: env(safe-area-inset-bottom); -} - -.coupon-page-container .desc-group-wrap .item-wrap { - margin: 0 30rpx 30rpx; -} - -.coupon-page-container .desc-group-wrap .item-title { - font-size: 26rpx; - color: #333; - font-weight: 500; -} - -.coupon-page-container .desc-group-wrap .item-label { - font-size: 24rpx; - color: #666; - margin-top: 12rpx; - white-space: pre-line; - word-break: break-all; - line-height: 34rpx; -} - -.coupon-page-container .goods-list-container { - margin: 0 24rpx 24rpx; -} - -.coupon-page-container .goods-list-wrap { - background: #f5f5f5 !important; -} diff --git a/pages/coupon/coupon-detail/index.js b/pages/coupon/coupon-detail/index.js deleted file mode 100644 index 71ff5d6..0000000 --- a/pages/coupon/coupon-detail/index.js +++ /dev/null @@ -1,32 +0,0 @@ -import { fetchCouponDetail } from '../../../services/coupon/index'; - -Page({ - data: { - detail: null, - storeInfoList: [], - storeInfoStr: '', - showStoreInfoList: false, - }, - - id: '', - - onLoad(query) { - const id = parseInt(query.id); - this.id = id; - this.getGoodsList(id); - }, - - getGoodsList(id) { - fetchCouponDetail(id).then(({ detail }) => { - this.setData({ - detail, - }); - }); - }, - - navGoodListHandle() { - wx.navigateTo({ - url: `/pages/coupon/coupon-activity-goods/index?id=${this.id}`, - }); - }, -}); diff --git a/pages/coupon/coupon-detail/index.json b/pages/coupon/coupon-detail/index.json deleted file mode 100644 index d419a0b..0000000 --- a/pages/coupon/coupon-detail/index.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "navigationBarTitleText": "优惠券详情", - "usingComponents": { - "coupon-card": "../components/coupon-card/index", - "t-cell": "tdesign-miniprogram/cell/cell", - "t-cell-group": "tdesign-miniprogram/cell-group/cell-group", - "t-button": "tdesign-miniprogram/button/button", - "t-icon": "tdesign-miniprogram/icon/icon" - } -} \ No newline at end of file diff --git a/pages/coupon/coupon-detail/index.wxml b/pages/coupon/coupon-detail/index.wxml deleted file mode 100644 index 5d1b906..0000000 --- a/pages/coupon/coupon-detail/index.wxml +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - - - - - - - - - - - 查看可用商品 - - - - diff --git a/pages/coupon/coupon-detail/index.wxss b/pages/coupon/coupon-detail/index.wxss deleted file mode 100644 index eddcf25..0000000 --- a/pages/coupon/coupon-detail/index.wxss +++ /dev/null @@ -1,100 +0,0 @@ -page { - background-color: #f5f5f5; -} - -.coupon-card-wrap { - background-color: #fff; - padding: 32rpx 32rpx 1rpx; -} -.desc-wrap { - margin-top: 24rpx; -} -.desc-wrap .button-wrap .view-good-list-btn { - width: 686rpx; - height: 88rpx; - margin-top: 50rpx; - background: #fa4126; - border-radius: 44rpx; - color: #fff; - font-size: 32rpx; - display: flex; - align-items: center; - justify-content: center; -} - -.desc-group-wrap .t-class-cell { - align-items: flex-start; -} - -.desc-group-wrap .t-class-title { - font-size: 26rpx; - width: 140rpx; - flex: none; - color: #888; -} - -.desc-group-wrap .t-class-note { - font-size: 26rpx; - word-break: break-all; - white-space: pre-line; - justify-content: flex-start; - color: #333; -} - -.desc-group-wrap { - border-radius: 8rpx; - overflow: hidden; - - --cell-label-font-size: 26rpx; - --cell-label-line-height: 36rpx; - --cell-label-color: #999; -} - -.desc-group-wrap.in-popup { - border-radius: 0; - overflow: auto; - max-height: 828rpx; -} - -.desc-group-wrap .wr-cell__title { - color: #333; - font-size: 28rpx; -} - -/* .desc-group-wrap .max-width-cell { - overflow: hidden; -} */ - -/* .desc-group-wrap .signal-line-label { - word-break: keep-all; - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; -} -.desc-group-wrap .multi-line-label { - word-break: break-all; - white-space: pre-line; -} */ - -.popup-content-wrap { - background-color: #fff; - border-top-left-radius: 20rpx; - border-top-right-radius: 20rpx; -} - -.popup-content-title { - font-size: 32rpx; - color: #333; - - text-align: center; - height: 104rpx; - line-height: 104rpx; - - position: relative; -} - -.popup-content-title .close-icon { - position: absolute; - top: 24rpx; - right: 24rpx; -} diff --git a/pages/coupon/coupon-list/index.js b/pages/coupon/coupon-list/index.js deleted file mode 100644 index f3b8675..0000000 --- a/pages/coupon/coupon-list/index.js +++ /dev/null @@ -1,77 +0,0 @@ -import { fetchCouponList } from '../../../services/coupon/index'; - -Page({ - data: { - status: 0, - list: [ - { - text: '可使用', - key: 0, - }, - { - text: '已使用', - key: 1, - }, - { - text: '已失效', - key: 2, - }, - ], - - couponList: [], - }, - - onLoad() { - this.init(); - }, - - init() { - this.fetchList(); - }, - - fetchList(status = this.data.status) { - let statusInFetch = ''; - switch (Number(status)) { - case 0: { - statusInFetch = 'default'; - break; - } - case 1: { - statusInFetch = 'useless'; - break; - } - case 2: { - statusInFetch = 'disabled'; - break; - } - default: { - throw new Error(`unknown fetchStatus: ${statusInFetch}`); - } - } - fetchCouponList(statusInFetch).then((couponList) => { - this.setData({ couponList }); - }); - }, - - tabChange(e) { - const { value } = e.detail; - - this.setData({ status: value }); - this.fetchList(value); - }, - - goCouponCenterHandle() { - wx.showToast({ title: '去领券中心', icon: 'none' }); - }, - - onPullDownRefresh_() { - this.setData( - { - couponList: [], - }, - () => { - this.fetchList(); - }, - ); - }, -}); diff --git a/pages/coupon/coupon-list/index.json b/pages/coupon/coupon-list/index.json deleted file mode 100644 index c09d584..0000000 --- a/pages/coupon/coupon-list/index.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "navigationBarTitleText": "优惠券", - "usingComponents": { - "t-pull-down-refresh": "tdesign-miniprogram/pull-down-refresh/pull-down-refresh", - "t-tabs": "tdesign-miniprogram/tabs/tabs", - "t-tab-panel": "tdesign-miniprogram/tabs/tab-panel", - "t-icon": "tdesign-miniprogram/icon/icon", - "coupon-card": "../components/coupon-card/index" - } -} \ No newline at end of file diff --git a/pages/coupon/coupon-list/index.wxml b/pages/coupon/coupon-list/index.wxml deleted file mode 100644 index 391fe7b..0000000 --- a/pages/coupon/coupon-list/index.wxml +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - - - - - - - 领券中心 - - - - - diff --git a/pages/coupon/coupon-list/index.wxss b/pages/coupon/coupon-list/index.wxss deleted file mode 100644 index 9ee2b9d..0000000 --- a/pages/coupon/coupon-list/index.wxss +++ /dev/null @@ -1,78 +0,0 @@ -page { - height: 100%; -} - -.tabs-external__inner { - height: 88rpx; - width: 100%; - line-height: 88rpx; - z-index: 100; -} -.tabs-external__inner { - font-size: 26rpx; - color: #333333; - position: fixed; - width: 100vw; - top: 0; - left: 0; -} - -.tabs-external__inner .tabs-external__track { - background: #fa4126 !important; -} - -.tabs-external__inner .tabs-external__item { - color: #666; -} - -.tabs-external__inner .tabs-external__active { - font-size: 28rpx; - color: #fa4126 !important; -} - -.tabs-external__inner.order-nav .order-nav-item .bottom-line { - bottom: 12rpx; -} - -.coupon-list-wrap { - margin-top: 108rpx; - margin-left: 24rpx; - margin-right: 24rpx; - overflow-y: auto; - padding-bottom: 100rpx; - padding-bottom: calc(constant(safe-area-inset-top) + 100rpx); - padding-bottom: calc(env(safe-area-inset-bottom) + 100rpx); - -webkit-overflow-scrolling: touch; -} - -.center-entry { - box-sizing: content-box; - border-top: 1rpx solid #dce0e4; - background-color: #fff; - position: fixed; - bottom: 0; - left: 0; - right: 0; - height: 100rpx; - padding-bottom: 0; - padding-bottom: constant(safe-area-inset-top); - padding-bottom: env(safe-area-inset-bottom); -} - -.center-entry-btn { - color: #fa4126; - font-size: 32rpx; - text-align: center; - line-height: 100rpx; - display: flex; - align-items: center; - justify-content: center; - height: 100rpx; -} - -.coupon-list-wrap .t-pull-down-refresh__bar { - background: #fff !important; -} -.t-class-indicator { - color: #b9b9b9 !important; -} diff --git a/pages/goods/category/components/goods-category/components/c-sidebar/README.md b/pages/goods/category/components/goods-category/components/c-sidebar/README.md deleted file mode 100644 index 88d7b0b..0000000 --- a/pages/goods/category/components/goods-category/components/c-sidebar/README.md +++ /dev/null @@ -1,95 +0,0 @@ -# Sidebar 侧边导航 - -### 引入 - -全局引入,在miniprogram根目录下的`app.json`中配置,局部引入,在需要引入的页面或组件的`index.json`中配置。 - -```json -// app.json 或 index.json -"usingComponents": { - "wr-sidebar": "path/to/components/goods-category/wr-sidebar/index", - "wr-sidebar-item": "path/to/component/goods-category/wr-sidebar/wr-sidebar-item/index" -} -``` - -## 代码演示 - -### 基础用法 - -通过在`wr-sidebar`上设置`activeKey`属性来控制选中项 - -```html - - - - - -``` - -``` javascript -Page({ - data: { - activeKey: 0 - }, - - onChange(event) { - wx.showToast({ - icon: 'none', - title: `切换至第${event.detail}项` - }); - } -}); -``` - -### 提示气泡(暂未实现) - -设置`dot`属性后,会在右上角展示一个小红点。设置`info`属性后,会在右上角展示相应的徽标 - -```html - - - - - -``` - -## API - -### Sidebar Props - -| 参数 | 说明 | 类型 | 默认值 | 版本 | -|-----------|-----------|-----------|-------------|-------------| -| activeKey | 选中项的索引 | *string \| number* | `0` | - | - -### Sidebar Event - -| 事件名 | 说明 | 参数 | -|------|------|------| -| change | 切换选项时触发 | 当前选中选项的索引 | - -### Sidebar 外部样式类 - -| 类名 | 说明 | -|-----------|-----------| -| custom-class | 根节点样式类 | - -### SidebarItem Props - -| 参数 | 说明 | 类型 | 默认值 | 版本 | -|-----------|-----------|-----------|-------------|-------------| -| title | 内容 | *string* | `''` | - | -| disabled | 是否禁用 | | *boolean* | `false` | - | -| dot | 是否显示右上角小红点 | *boolean* | `false` | - | -| info | 提示消息 | *string \| number* | `''` | - | - -### SidebarItem Event - -| 事件名 | 说明 | 参数 | -|------|------|------| -| click | 点击徽章时触发 | 当前徽章的索引 | - -### SidebarItem 外部样式类 - -| 类名 | 说明 | -|-----------|-----------| -| custom-class | 根节点样式类 | diff --git a/pages/goods/category/components/goods-category/components/c-sidebar/c-sidebar-item/index.js b/pages/goods/category/components/goods-category/components/c-sidebar/c-sidebar-item/index.js deleted file mode 100644 index 810d5e5..0000000 --- a/pages/goods/category/components/goods-category/components/c-sidebar/c-sidebar-item/index.js +++ /dev/null @@ -1,51 +0,0 @@ -Component({ - relations: { - '../../c-sidebar/index': { - type: 'ancestor', - linked(target) { - this.parent = target; - }, - }, - }, - - externalClasses: ['custom-class'], - properties: { - title: String, - disabled: Boolean, - }, - - data: { - topRightRadius: false, - bottomRightRadius: false, - }, - - methods: { - setActive(selected) { - return this.setData({ selected }); - }, - onClick() { - const { parent } = this; - - if (!parent || this.properties.disabled) { - return; - } - - const index = parent.children.indexOf(this); - - parent.setActive(index).then(() => { - this.triggerEvent('click', index); - parent.triggerEvent('change', { index }); - }); - }, - setTopRightRadius(val) { - return this.setData({ - topRightRadius: val, - }); - }, - setBottomRightRadius(val) { - return this.setData({ - bottomRightRadius: val, - }); - }, - }, -}); diff --git a/pages/goods/category/components/goods-category/components/c-sidebar/c-sidebar-item/index.json b/pages/goods/category/components/goods-category/components/c-sidebar/c-sidebar-item/index.json deleted file mode 100644 index e8cfaaf..0000000 --- a/pages/goods/category/components/goods-category/components/c-sidebar/c-sidebar-item/index.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "component": true, - "usingComponents": {} -} \ No newline at end of file diff --git a/pages/goods/category/components/goods-category/components/c-sidebar/c-sidebar-item/index.wxml b/pages/goods/category/components/goods-category/components/c-sidebar/c-sidebar-item/index.wxml deleted file mode 100644 index 435f1e9..0000000 --- a/pages/goods/category/components/goods-category/components/c-sidebar/c-sidebar-item/index.wxml +++ /dev/null @@ -1,10 +0,0 @@ - - - {{ title }} - - diff --git a/pages/goods/category/components/goods-category/components/c-sidebar/c-sidebar-item/index.wxss b/pages/goods/category/components/goods-category/components/c-sidebar/c-sidebar-item/index.wxss deleted file mode 100644 index 28d50dc..0000000 --- a/pages/goods/category/components/goods-category/components/c-sidebar/c-sidebar-item/index.wxss +++ /dev/null @@ -1,60 +0,0 @@ -.c-sidebar-item { - display: flex; - justify-content: center; - text-align: center; - background-color: #f5f5f5; - color: #222427; - padding: 20rpx 0; - font-size: 26rpx; -} - -.c-sidebar-item.active { - position: relative; - background: white; -} - -.c-sidebar-item.active::before { - content: ''; - position: absolute; - width: 6rpx; - height: 48rpx; - background-color: #fa4126; - left: 0; - top: 50%; - transform: translate(0, -50%); - border-radius: 64rpx; -} - -.c-sidebar-item__text { - width: 136rpx; - height: 36rpx; - padding: 8rpx 0; - line-height: 36rpx; - text-align: center; - font-size: 28rpx; - color: #666666; -} - -.c-sidebar-item.active .c-sidebar-item__text { - background-color: white; - border-radius: 36rpx; - color: #fa4126; -} - -.text-overflow { - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; -} - -.top-right-radius { - border-top-right-radius: 16rpx; -} - -.bottom-right-radius { - border-bottom-right-radius: 16rpx; -} - -.c-sidebar-item-container { - background-color: white; -} diff --git a/pages/goods/category/components/goods-category/components/c-sidebar/index.js b/pages/goods/category/components/goods-category/components/c-sidebar/index.js deleted file mode 100644 index b057ad1..0000000 --- a/pages/goods/category/components/goods-category/components/c-sidebar/index.js +++ /dev/null @@ -1,106 +0,0 @@ -Component({ - relations: { - './c-sidebar-item/index': { - type: 'descendant', - linked(target) { - this.children.push(target); - this.setActive(this.properties.activeKey, true); - }, - unlinked(target) { - this.children = this.children.filter((item) => item !== target); - this.setActive(this.properties.activeKey, true); - }, - }, - }, - - externalClasses: ['custom-class'], - - properties: { - activeKey: { - type: Number, - value: 0, - }, - }, - observers: { - activeKey(newVal) { - this.setActive(newVal); - }, - }, - - created() { - this.children = []; - this.currentActive = -1; - this.topRightRadiusItemIndexs = []; - this.bottomRightRadiusItemIndexs = []; - }, - - methods: { - setActive(activeKey, isChildrenChange) { - const { - children, - currentActive, - topRightRadiusItemIndexs: preTopRightRadiusItemIndexs, - bottomRightRadiusItemIndexs: preBottomRightRadiusItemIndexs, - } = this; - - if (!children.length) { - return Promise.resolve(); - } - - if (activeKey === currentActive && !isChildrenChange) { - return Promise.resolve(); - } - - this.currentActive = activeKey; - this.topRightRadiusItemIndexs = this.getTopRightRadiusItemIndexs( - activeKey, - children, - ); - this.bottomRightRadiusItemIndexs = this.getBottomRightRadiusItemIndexs( - activeKey, - children, - ); - - const stack = []; // 任务列表,存放调用子组件的setActive后返回的一堆promise - - // 将旧的选中项改为false - if (currentActive !== activeKey && children[currentActive]) { - stack.push(children[currentActive].setActive(false)); - } - - // 将新的选中项改为true - if (children[activeKey]) { - stack.push(children[activeKey].setActive(true)); - } - - preTopRightRadiusItemIndexs.forEach((item) => { - stack.push(children[item].setTopRightRadius(false)); - }); - - preBottomRightRadiusItemIndexs.forEach((item) => { - stack.push(children[item].setBottomRightRadius(false)); - }); - - this.topRightRadiusItemIndexs.forEach((item) => { - stack.push(children[item].setTopRightRadius(true)); - }); - - this.bottomRightRadiusItemIndexs.forEach((item) => { - stack.push(children[item].setBottomRightRadius(true)); - }); - - return Promise.all(stack); - }, - getTopRightRadiusItemIndexs(activeKey, children) { - const { length } = children; - if (activeKey !== 0 && activeKey < length - 1) return [0, activeKey + 1]; - if (activeKey !== 0) return [0]; - if (activeKey < length - 1) return [activeKey + 1]; - return []; - }, - getBottomRightRadiusItemIndexs(activeKey) { - if (activeKey !== 0) return [activeKey - 1]; - return []; - }, - }, -}); diff --git a/pages/goods/category/components/goods-category/components/c-sidebar/index.json b/pages/goods/category/components/goods-category/components/c-sidebar/index.json deleted file mode 100644 index 84ff738..0000000 --- a/pages/goods/category/components/goods-category/components/c-sidebar/index.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "component": true -} - \ No newline at end of file diff --git a/pages/goods/category/components/goods-category/components/c-sidebar/index.wxml b/pages/goods/category/components/goods-category/components/c-sidebar/index.wxml deleted file mode 100644 index a1fe026..0000000 --- a/pages/goods/category/components/goods-category/components/c-sidebar/index.wxml +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/pages/goods/category/components/goods-category/components/c-sidebar/index.wxss b/pages/goods/category/components/goods-category/components/c-sidebar/index.wxss deleted file mode 100644 index 95e59ff..0000000 --- a/pages/goods/category/components/goods-category/components/c-sidebar/index.wxss +++ /dev/null @@ -1,9 +0,0 @@ -.c-sidebar { - width: 176rpx; - height: 100vh; -} -.c-sidebar::-webkit-scrollbar { - width: 0; - height: 0; - color: transparent; -} diff --git a/pages/goods/category/components/goods-category/components/c-tabbar/c-tabbar-more/index.js b/pages/goods/category/components/goods-category/components/c-tabbar/c-tabbar-more/index.js deleted file mode 100644 index 2b6f95d..0000000 --- a/pages/goods/category/components/goods-category/components/c-tabbar/c-tabbar-more/index.js +++ /dev/null @@ -1,37 +0,0 @@ -Component({ - externalClasses: ['custom-class'], - - properties: { - tabList: Array, - }, - - data: { - unfolded: false, - boardMaxHeight: null, - }, - attached() { - wx.createSelectorQuery() - .in(this) - .select('.c-tabbar-more') - .boundingClientRect((rect) => { - this.setData({ boardMaxHeight: rect.height }); - }) - .exec(); - }, - - methods: { - changeFold() { - this.setData({ - unfolded: !this.data.unfolded, - }); - const { unfolded } = this.data; - this.triggerEvent('change', { unfolded }); - }, - - onSelect(event) { - const activeKey = event.currentTarget.dataset.index; - this.triggerEvent('select', activeKey); - this.changeFold(); - }, - }, -}); diff --git a/pages/goods/category/components/goods-category/components/c-tabbar/c-tabbar-more/index.json b/pages/goods/category/components/goods-category/components/c-tabbar/c-tabbar-more/index.json deleted file mode 100644 index a89ef4d..0000000 --- a/pages/goods/category/components/goods-category/components/c-tabbar/c-tabbar-more/index.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "component": true, - "usingComponents": {} -} diff --git a/pages/goods/category/components/goods-category/components/c-tabbar/c-tabbar-more/index.wxml b/pages/goods/category/components/goods-category/components/c-tabbar/c-tabbar-more/index.wxml deleted file mode 100644 index 0ea9ad4..0000000 --- a/pages/goods/category/components/goods-category/components/c-tabbar/c-tabbar-more/index.wxml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - {{ item.name }} - - - - - diff --git a/pages/goods/category/components/goods-category/components/c-tabbar/c-tabbar-more/index.wxss b/pages/goods/category/components/goods-category/components/c-tabbar/c-tabbar-more/index.wxss deleted file mode 100644 index d0d08b3..0000000 --- a/pages/goods/category/components/goods-category/components/c-tabbar/c-tabbar-more/index.wxss +++ /dev/null @@ -1,63 +0,0 @@ -.c-tabbar-more { - width: 100%; - height: calc(100% - var(--tabbar-height, 100rpx)); - position: absolute; - top: var(--tabbar-height, 100rpx); -} -.c-tabbar-more__btn { - position: absolute; - top: calc(0rpx - var(--tabbar-height, 100rpx)); - right: 0; - width: 80rpx; - height: var(--tabbar-height, 100rpx); - line-height: var(--tabbar-height, 100rpx); - background-color: var(--tabbar-background-color, white); - box-shadow: -20rpx 0 20rpx -10rpx var(--tabbar-background-color, white); - text-align: center; -} -.c-tabbar-more__btn .market { - font-size: 20rpx; -} -.t-tabbar-more__boardwrapper { - position: absolute; - top: 0; - left: 0; - width: 100%; - height: 100%; -} -.t-tabbar-more__mask { - width: 100%; - height: 100%; - background-color: rgba(0, 0, 0, 0.5); -} -.c-tabbar-more__board { - position: absolute; - top: 0; - left: 0; - width: 100%; - max-height: 100%; -} -.c-tabbar-more__boardinner { - padding: 20rpx 0 20rpx 20rpx; - background-color: var(--tabbar-background-color, white); - display: flex; - flex-flow: row wrap; -} -.c-tabbar-more__item { - margin: 0 20rpx 20rpx 0; - flex: 0 0 calc((100% - 60rpx) / 3); - box-sizing: border-box; - padding: 0 10rpx; - border-radius: 30rpx; - height: 60rpx; - line-height: 60rpx; - text-align: center; - font-size: 22rpx; - color: #5d5d5d; - background-color: #eee; -} -.text-overflow { - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; -} diff --git a/pages/goods/category/components/goods-category/components/c-tabbar/index.js b/pages/goods/category/components/goods-category/components/c-tabbar/index.js deleted file mode 100644 index ddf6367..0000000 --- a/pages/goods/category/components/goods-category/components/c-tabbar/index.js +++ /dev/null @@ -1,68 +0,0 @@ -Component({ - externalClasses: ['custom-class'], - - properties: { - activeKey: { - type: Number, - value: 0, - }, - tabList: { - type: Array, - value: [], - }, - showMore: Boolean, // 是否需要下拉功能 - }, - observers: { - activeKey(newVal) { - if (this.properties.tabList && newVal) { - this.setActive(newVal).catch((e) => { - console.error(e); - }); - } - }, - }, - - data: { - currentActive: -1, - }, - attached() { - this.setActive(this.properties.activeKey).catch((e) => { - console.error(e); - }); - }, - - methods: { - setActive(activeKey) { - if ( - !this.properties.tabList[activeKey] || - this.properties.tabList[activeKey].disabled - ) { - return Promise.reject('数据异常或不可操作'); - } - return new Promise((resolve) => { - this.setData( - { - currentActive: activeKey, - }, - () => resolve(), - ); - }); - }, - onClick(event) { - let activeKey; - if (event.type === 'select') { - activeKey = event.detail; - } else { - activeKey = event.currentTarget.dataset.index; - } - this.setActive(activeKey) - .then(() => { - const { currentActive } = this.data; - this.triggerEvent('change', { index: currentActive }); - }) - .catch((e) => { - console.error(e); - }); - }, - }, -}); diff --git a/pages/goods/category/components/goods-category/components/c-tabbar/index.json b/pages/goods/category/components/goods-category/components/c-tabbar/index.json deleted file mode 100644 index 644e632..0000000 --- a/pages/goods/category/components/goods-category/components/c-tabbar/index.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "component": true, - "usingComponents": { - "c-tabbar-more": "./c-tabbar-more/index" - } -} \ No newline at end of file diff --git a/pages/goods/category/components/goods-category/components/c-tabbar/index.wxml b/pages/goods/category/components/goods-category/components/c-tabbar/index.wxml deleted file mode 100644 index 1227f88..0000000 --- a/pages/goods/category/components/goods-category/components/c-tabbar/index.wxml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - {{ item.name }} - - - - - - diff --git a/pages/goods/category/components/goods-category/components/c-tabbar/index.wxss b/pages/goods/category/components/goods-category/components/c-tabbar/index.wxss deleted file mode 100644 index d89475f..0000000 --- a/pages/goods/category/components/goods-category/components/c-tabbar/index.wxss +++ /dev/null @@ -1,53 +0,0 @@ -.c-tabbar { - width: 100%; - height: 100%; - position: relative; - --tabbar-height: 100rpx; - --tabbar-fontsize: 28rpx; - --tabbar-background-color: white; -} -.c-tabbar__inner { - display: flex; - flex-flow: row nowrap; -} -.c-tabbar__scroll { - position: relative; -} -.c-tabbar__scroll::after { - content: ''; - display: block; - position: absolute; - width: 100%; - left: 0; - bottom: -1px; - height: 1px; - background-color: #eee; - z-index: 1; -} -.c-tabbar__inner.c-tabbar__inner_more::after { - content: ''; - display: block; - width: 100rpx; - height: 100rpx; - flex: none; -} -.c-tabbar-item { - flex: none; - height: 100rpx; - color: #282828; - font-size: 28rpx; - padding: 0 20rpx; -} -.c-tabbar-item.active:not(.disabled) { - color: #0071ce; - position: relative; -} -.c-tabbar-item.disabled { - color: #ccc; -} -.c-tabbar-item__text { - width: 100%; - text-align: center; - height: 100rpx; - line-height: 100rpx; -} diff --git a/pages/goods/category/components/goods-category/index.js b/pages/goods/category/components/goods-category/index.js deleted file mode 100644 index f622901..0000000 --- a/pages/goods/category/components/goods-category/index.js +++ /dev/null @@ -1,75 +0,0 @@ -Component({ - externalClasses: ['custom-class'], - - properties: { - category: { - type: Array, - }, - initActive: { - type: Array, - value: [], - observer(newVal, oldVal) { - if (newVal[0] !== oldVal[0]) { - this.setActiveKey(newVal[0], 0); - } - }, - }, - isSlotRight: { - type: Boolean, - value: false, - }, - level: { - type: Number, - value: 3, - }, - }, - data: { - activeKey: 0, - subActiveKey: 0, - }, - attached() { - if (this.properties.initActive && this.properties.initActive.length > 0) { - this.setData({ - activeKey: this.properties.initActive[0], - subActiveKey: this.properties.initActive[1] || 0, - }); - } - }, - methods: { - onParentChange(event) { - this.setActiveKey(event.detail.index, 0).then(() => { - this.triggerEvent('change', [ - this.data.activeKey, - this.data.subActiveKey, - ]); - }); - }, - onChildChange(event) { - this.setActiveKey(this.data.activeKey, event.detail.index).then(() => { - this.triggerEvent('change', [ - this.data.activeKey, - this.data.subActiveKey, - ]); - }); - }, - changCategory(event) { - const { item } = event.currentTarget.dataset; - this.triggerEvent('changeCategory', { - item, - }); - }, - setActiveKey(key, subKey) { - return new Promise((resolve) => { - this.setData( - { - activeKey: key, - subActiveKey: subKey, - }, - () => { - resolve(); - }, - ); - }); - }, - }, -}); diff --git a/pages/goods/category/components/goods-category/index.json b/pages/goods/category/components/goods-category/index.json deleted file mode 100644 index 8ca3d3c..0000000 --- a/pages/goods/category/components/goods-category/index.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "component": true, - "usingComponents": { - "c-tabbar": "./components/c-tabbar/index", - "c-sidebar": "./components/c-sidebar/index", - "c-sidebar-item": "./components/c-sidebar/c-sidebar-item/index", - "t-image": "/components/webp-image/index" - } -} \ No newline at end of file diff --git a/pages/goods/category/components/goods-category/index.wxml b/pages/goods/category/components/goods-category/index.wxml deleted file mode 100644 index 1b0b83f..0000000 --- a/pages/goods/category/components/goods-category/index.wxml +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - - - - - - - - {{item.name}} - - - - - - {{subItem.name}} - - - - - - - - - - {{item.name}} - - - - - - - - - diff --git a/pages/goods/category/components/goods-category/index.wxss b/pages/goods/category/components/goods-category/index.wxss deleted file mode 100644 index fbf4569..0000000 --- a/pages/goods/category/components/goods-category/index.wxss +++ /dev/null @@ -1,102 +0,0 @@ -.goods-category { - display: flex; -} - -.custom-sidebar { - height: 100%; -} - -.goods-category__right { - height: 100%; - flex: auto; - width: 0; - position: relative; - overflow: scroll; - -webkit-overflow-scrolling: touch; - background-color: white; -} - -.flex { - display: flex; -} - -.goods-category-normal { - margin: 28rpx 34rpx 0rpx 32rpx; -} - -.goods-category-normal-item-title { - font-size: 28rpx; - font-weight: 500; -} - -.goods-category-normal-item-container { - background-color: #fff; - border-radius: 8rpx; - padding-top: 28rpx; - margin-top: -24rpx; - margin-bottom: 30rpx; - display: flex; - flex-wrap: wrap; -} - -.goods-category-normal-item-container-item { - height: 196rpx; - display: flex; - flex-direction: column; - align-items: center; - margin-top: 24rpx; - width: 33.3%; -} - -.goods-category-normal-item-container-item .image { - width: 144rpx; - height: 144rpx; -} - -.goods-category-normal-item-container-item-title { - justify-content: center; - font-size: 24rpx; - color: #666666; - margin-top: 20rpx; -} - -.goods-category .custom-sidebar { - background-color: #f5f5f5; -} - -.custom-sidebar { - width: 180rpx; - height: 100vh; -} - -.custom-sidebar::-webkit-scrollbar { - width: 0; - height: 0; - color: transparent; -} - -.goods-category-normal-item-second-container { - background-color: #fff; - border-radius: 8rpx; - margin-top: 8rpx; - margin-bottom: 30rpx; - display: grid; - grid-template-columns: 33.33% 33.33% 33.33%; -} - -.goods-category-normal-item-second-container-item { - height: 200rpx; - text-align: center; - margin-top: 20rpx; -} - -.goods-category-normal-item-second-container-item .image { - width: 144rpx; - height: 144rpx; -} - -.goods-category-normal-item-second-container-item-title { - justify-content: center; - font-size: 24rpx; - color: #222427; -} diff --git a/pages/goods/category/data.js b/pages/goods/category/data.js deleted file mode 100644 index e625226..0000000 --- a/pages/goods/category/data.js +++ /dev/null @@ -1,135 +0,0 @@ -export const fullList = [ - { - groupId: '24948', - name: '数码', - thumbnail: - 'https://cdn-we-retail.ym.tencent.com/miniapp/category/category-default.png', - children: [ - { - groupId: '249481', - name: '手机', - thumbnail: - 'https://cdn-we-retail.ym.tencent.com/miniapp/category/category-default.png', - children: [ - { - groupId: '249480', - name: '华为', - thumbnail: - 'https://bl-material-qa-1300977798.cos.ap-guangzhou.myqcloud.com/persist/10001/8888/88881027711/material/1/5e40f0e5e450477781b0e3f8bd5b2fd8-1586832328290-手机1.jpg', - }, - { - groupId: '249480', - name: '华为', - thumbnail: - 'https://bl-material-qa-1300977798.cos.ap-guangzhou.myqcloud.com/persist/10001/8888/88881027711/material/1/5e40f0e5e450477781b0e3f8bd5b2fd8-1586832328290-手机1.jpg', - }, - { - groupId: '249480', - name: '华为', - thumbnail: - 'https://bl-material-qa-1300977798.cos.ap-guangzhou.myqcloud.com/persist/10001/8888/88881027711/material/1/5e40f0e5e450477781b0e3f8bd5b2fd8-1586832328290-手机1.jpg', - }, - { - groupId: '249480', - name: '华为', - thumbnail: - 'https://bl-material-qa-1300977798.cos.ap-guangzhou.myqcloud.com/persist/10001/8888/88881027711/material/1/5e40f0e5e450477781b0e3f8bd5b2fd8-1586832328290-手机1.jpg', - }, - { - groupId: '249480', - name: '华为', - thumbnail: - 'https://bl-material-qa-1300977798.cos.ap-guangzhou.myqcloud.com/persist/10001/8888/88881027711/material/1/5e40f0e5e450477781b0e3f8bd5b2fd8-1586832328290-手机1.jpg', - }, - ], - }, - { - groupId: '249481', - name: '电视', - thumbnail: - 'https://cdn-we-retail.ym.tencent.com/miniapp/category/category-default.png', - children: [ - { - groupId: '249480', - name: '华为', - thumbnail: - 'https://ss1.bdstatic.com/70cFvXSh_Q1YnxGkpoWK1HF6hhy/it/u=1135099865,3046620350&fm=26&gp=0.jpg', - }, - ], - }, - ], - }, - { - groupId: '24948', - name: '水果', - thumbnail: - 'https://cdn-we-retail.ym.tencent.com/miniapp/category/category-default.png', - children: [ - { - groupId: '249481', - name: '热带水果', - thumbnail: - 'https://cdn-we-retail.ym.tencent.com/miniapp/category/category-default.png', - children: [ - { - groupId: '249480', - name: '菠萝', - thumbnail: - 'https://dss3.baidu.com/-rVXeDTa2gU2pMbgoY3K/it/u=322209122,2354607046&fm=202&mola=new&crop=v1', - }, - ], - }, - ], - }, -]; - -export const goodsList = [ - { - thumb: '/static/images/apple.jpg', - title: - '智利 火龙果超级好吃,又大又甜 欢迎购买,限价五折优惠哦,智利 火龙果超级好吃,又大又甜 欢迎购买,限价五折优惠哦', - price: '99.99', - originPrice: '9.99', - tags: [{ title: '热卖' }], - }, - { - thumb: '/static/images/apple.jpg', - title: - '智利 火龙果超级好吃,又大又甜 欢迎购买,限价五折优惠哦,智利 火龙果超级好吃,又大又甜 欢迎购买,限价五折优惠哦', - price: '99.99', - originPrice: '9.99', - tags: [{ title: '热卖' }], - }, - { - thumb: '/static/images/apple.jpg', - title: - '智利 火龙果超级好吃,又大又甜 欢迎购买,限价五折优惠哦,智利 火龙果超级好吃,又大又甜 欢迎购买,限价五折优惠哦', - price: '99.99', - originPrice: '9.99', - tags: [{ title: '热卖' }], - }, - { - thumb: '/static/images/apple.jpg', - title: - '智利 火龙果超级好吃,又大又甜 欢迎购买,限价五折优惠哦,智利 火龙果超级好吃,又大又甜 欢迎购买,限价五折优惠哦', - price: '99.99', - originPrice: '9.99', - tags: [{ title: '热卖' }], - }, - { - thumb: '/static/images/apple.jpg', - title: - '智利 火龙果超级好吃,又大又甜 欢迎购买,限价五折优惠哦,智利 火龙果超级好吃,又大又甜 欢迎购买,限价五折优惠哦', - price: '99.99', - originPrice: '9.99', - tags: [{ title: '热卖' }], - }, - { - thumb: '/static/images/apple.jpg', - title: - '智利 火龙果超级好吃,又大又甜 欢迎购买,限价五折优惠哦,智利 火龙果超级好吃,又大又甜 欢迎购买,限价五折优惠哦', - price: '99.99', - originPrice: '9.99', - tags: [{ title: '热卖' }], - }, -]; diff --git a/pages/goods/category/index.js b/pages/goods/category/index.js deleted file mode 100644 index e8c56ac..0000000 --- a/pages/goods/category/index.js +++ /dev/null @@ -1,28 +0,0 @@ -import { getCategoryList } from '../../../services/good/fetchCategoryList'; -Page({ - data: { - list: [], - }, - async init() { - try { - const result = await getCategoryList(); - this.setData({ - list: result, - }); - } catch (error) { - console.error('err:', error); - } - }, - - onShow() { - this.getTabBar().init(); - }, - onChange() { - wx.navigateTo({ - url: '/pages/goods/list/index', - }); - }, - onLoad() { - this.init(true); - }, -}); diff --git a/pages/goods/category/index.json b/pages/goods/category/index.json deleted file mode 100644 index f989443..0000000 --- a/pages/goods/category/index.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "navigationBarTitleText": "分类", - "usingComponents": { - "goods-category": "./components/goods-category/index" - } -} diff --git a/pages/goods/category/index.wxml b/pages/goods/category/index.wxml deleted file mode 100644 index 2d8cab1..0000000 --- a/pages/goods/category/index.wxml +++ /dev/null @@ -1,8 +0,0 @@ - - - diff --git a/pages/goods/category/index.wxss b/pages/goods/category/index.wxss deleted file mode 100644 index ac2e0a7..0000000 --- a/pages/goods/category/index.wxss +++ /dev/null @@ -1,23 +0,0 @@ -.tabbar-position { - position: fixed !important; - bottom: 0; - left: 0; - width: 100%; -} - -.wrap { - height: 100vh; - overflow: hidden; -} -.goods-category-class { - background-color: #f6f6f6 !important; - height: 100%; -} -.goods-category-class .goods-category-normal-item-container-item { - margin-top: 20rpx; -} - -page { - min-height: none; - padding-bottom: 0; -} diff --git a/pages/goods/comments/components/comments-card/components/images-videos/assets/play.png b/pages/goods/comments/components/comments-card/components/images-videos/assets/play.png deleted file mode 100644 index d816ef7..0000000 Binary files a/pages/goods/comments/components/comments-card/components/images-videos/assets/play.png and /dev/null differ diff --git a/pages/goods/comments/components/comments-card/components/images-videos/index.js b/pages/goods/comments/components/comments-card/components/images-videos/index.js deleted file mode 100644 index a0a3c48..0000000 --- a/pages/goods/comments/components/comments-card/components/images-videos/index.js +++ /dev/null @@ -1,36 +0,0 @@ -// pages/goods/comments/components/comments-card/images-videos/index.js -Component({ - /** - * 组件的属性列表 - */ - properties: { - resources: { - type: Array, - value: [], - }, - }, - - /** - * 组件的初始数据 - */ - data: { - classType: 'single', - }, - - observers: { - resources: function (newVal) { - if (newVal.length <= 1) { - this.setData({ classType: 'single' }); - } else if (newVal.length === 2) { - this.setData({ classType: 'double' }); - } else { - this.setData({ classType: 'multiple' }); - } - }, - }, - - /** - * 组件的方法列表 - */ - methods: {}, -}); diff --git a/pages/goods/comments/components/comments-card/components/images-videos/index.json b/pages/goods/comments/components/comments-card/components/images-videos/index.json deleted file mode 100644 index 83597fd..0000000 --- a/pages/goods/comments/components/comments-card/components/images-videos/index.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "component": true, - "usingComponents": { - "my-video": "../my-video/index", - "t-image": "/components/webp-image/index" - } -} \ No newline at end of file diff --git a/pages/goods/comments/components/comments-card/components/images-videos/index.wxml b/pages/goods/comments/components/comments-card/components/images-videos/index.wxml deleted file mode 100644 index 2515909..0000000 --- a/pages/goods/comments/components/comments-card/components/images-videos/index.wxml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - diff --git a/pages/goods/comments/components/comments-card/components/images-videos/index.wxss b/pages/goods/comments/components/comments-card/components/images-videos/index.wxss deleted file mode 100644 index e7944be..0000000 --- a/pages/goods/comments/components/comments-card/components/images-videos/index.wxss +++ /dev/null @@ -1,68 +0,0 @@ -.resource-item-single { - width: 360rpx; - height: 360rpx; - border-radius: 8rpx; -} - -.resource-item-double { - width: 334rpx; - height: 334rpx; - border-radius: 8rpx; -} - -.resource-item-multiple { - width: 218rpx; - height: 218rpx; - border-radius: 8rpx; -} - -.resource-container-single { - padding-left: 0; - padding-top: 0; -} - -.resource-container-double { - padding-left: 18rpx; - padding-top: 18rpx; -} - -.resource-container-multiple { - padding-left: 16rpx; - padding-top: 16rpx; -} - -.container-single { - margin-left: 0; -} - -.container-double { - margin-left: -18rpx; - margin-top: -18rpx; -} - -.container-multiple { - margin-left: -16rpx; - margin-top: -16rpx; -} - -.resource-container { - display: flex; -} - -.play-icon { - width: 96rpx; - height: 96rpx; -} - -.images-videos-container { - display: flex; - flex-wrap: wrap; -} - -.image { - border-radius: 8rpx; -} - -.cover-img-container { - background-color: white; -} diff --git a/pages/goods/comments/components/comments-card/components/my-video/index.js b/pages/goods/comments/components/comments-card/components/my-video/index.js deleted file mode 100644 index 987cf18..0000000 --- a/pages/goods/comments/components/comments-card/components/my-video/index.js +++ /dev/null @@ -1,55 +0,0 @@ -Component({ - externalClasses: ['my-video', 'my-cover-img', 'my-play-icon'], - properties: { - videoSrc: { type: String }, - }, - data: { - isShow: true, - }, - - options: { - multipleSlots: true, // 在组件定义时的选项中启用多slot支持 - }, - - attached() { - this.videoContext = wx.createVideoContext('myVideo', this); - }, - - fullScreen: false, - - methods: { - // 点击封面自定义播放按钮时触发 - bindplay(e) { - this.setData({ - isShow: false, - }); - this.videoContext.play(); - this.triggerEvent('play', e); - }, - - bindplayByVideo(e) { - this.setData({ - isShow: false, - }); - this.triggerEvent('play', e); - }, - - // 监听播放到末尾时触发 - bindended(e) { - if (!this.fullScreen) { - this.setData({ - isShow: true, - }); - } - this.triggerEvent('ended', e); - }, - // 监听暂停播放时触发 - bindpause(e) { - this.triggerEvent('pause', e); - }, - bindfullscreenchange(e) { - const fullScreen = e?.detail?.fullScreen; - this.fullScreen = fullScreen; - }, - }, -}); diff --git a/pages/goods/comments/components/comments-card/components/my-video/index.json b/pages/goods/comments/components/comments-card/components/my-video/index.json deleted file mode 100644 index e8cfaaf..0000000 --- a/pages/goods/comments/components/comments-card/components/my-video/index.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "component": true, - "usingComponents": {} -} \ No newline at end of file diff --git a/pages/goods/comments/components/comments-card/components/my-video/index.wxml b/pages/goods/comments/components/comments-card/components/my-video/index.wxml deleted file mode 100644 index af38919..0000000 --- a/pages/goods/comments/components/comments-card/components/my-video/index.wxml +++ /dev/null @@ -1,26 +0,0 @@ - diff --git a/pages/goods/comments/components/comments-card/components/my-video/index.wxss b/pages/goods/comments/components/comments-card/components/my-video/index.wxss deleted file mode 100644 index 63b962b..0000000 --- a/pages/goods/comments/components/comments-card/components/my-video/index.wxss +++ /dev/null @@ -1,21 +0,0 @@ -.video .video_cover { - width: 100%; - height: 100%; - position: relative; -} - -.video .video_play_icon { - position: absolute; - left: 50%; - top: 50%; - transform: translate(-50%, -50%); - z-index: 5; -} - -.video .video_txt { - margin: 10rpx auto; -} - -.video { - display: flex; -} diff --git a/pages/goods/comments/components/comments-card/index.js b/pages/goods/comments/components/comments-card/index.js deleted file mode 100644 index 53f6103..0000000 --- a/pages/goods/comments/components/comments-card/index.js +++ /dev/null @@ -1,51 +0,0 @@ -Component({ - externalClasses: ['wr-class'], - options: { - multipleSlots: true, - }, - properties: { - goodsDetailInfo: { - type: String, - value: '', - }, - sellerReply: { - type: String, - value: '', - }, - userHeadUrl: { - type: String, - value: '', - }, - userName: { - type: String, - default: '', - }, - commentContent: { - type: String, - value: '', - }, - commentScore: { - type: Number, - value: 0, - }, - commentTime: { - type: String, - value: '', - }, - commentResources: { - type: Array, - value: [], - }, - }, - - data: { - showMoreStatus: false, - showContent: false, - hideText: false, - eleHeight: null, - overText: false, - isDisabled: true, - startColors: ['#FFC51C', '#DDDDDD'], - }, - methods: {}, -}); diff --git a/pages/goods/comments/components/comments-card/index.json b/pages/goods/comments/components/comments-card/index.json deleted file mode 100644 index 1130655..0000000 --- a/pages/goods/comments/components/comments-card/index.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "component": true, - "usingComponents": { - "t-rate": "tdesign-miniprogram/rate/rate", - "images-videos": "./components/images-videos", - "t-image": "/components/webp-image/index" - } -} \ No newline at end of file diff --git a/pages/goods/comments/components/comments-card/index.wxml b/pages/goods/comments/components/comments-card/index.wxml deleted file mode 100644 index a376cb2..0000000 --- a/pages/goods/comments/components/comments-card/index.wxml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - {{userName}} - {{commentTime}} - - - - {{goodsDetailInfo}} - - - - - - - - - 店家回复: - {{sellerReply}} - - - - diff --git a/pages/goods/comments/components/comments-card/index.wxss b/pages/goods/comments/components/comments-card/index.wxss deleted file mode 100644 index 30b4186..0000000 --- a/pages/goods/comments/components/comments-card/index.wxss +++ /dev/null @@ -1,170 +0,0 @@ -@import '../../../../../style/theme.wxss'; - -.comments-card-item { - padding: 32rpx; - display: flex; - background-color: #fff; - position: relative; -} - -.comments-card-item::after { - content: ''; - position: absolute; - bottom: 0rpx; - width: 686rpx; - height: 2rpx; - background-color: #f5f5f5; -} - -.comments-card-item-userImg { - display: flex; -} - -.comments-card-item-userImg .userImg { - width: 64rpx; - height: 64rpx; - border-radius: 50%; -} - -.comments-card-item-container { - width: 100%; -} - -.comments-card-item-container-name { - display: flex; - font-size: 28rpx; - color: #333; - font-weight: 600; - align-items: center; -} - -.comments-card-item-container-name .userName { - margin-right: 12rpx; -} - -.comments-card-item-container-date { - font-size: 22rpx; - color: #999; - margin-top: 4rpx; - display: flex; -} - -.comments-card-item-container-content { - margin-top: 16rpx; - position: relative; -} - -.comments-card-item-container-content .content-text { - font-size: 28rpx; - white-space: normal; - word-break: break-all; - font-weight: normal; -} - -.comments-card-item-container-content .hide-text { - overflow: hidden; - text-overflow: ellipsis; - -webkit-line-clamp: 5; - text-align: justify; - display: -webkit-box; - -webkit-box-orient: vertical; -} - -.comments-card-item-container-content .showMore { - position: absolute; - width: 112rpx; - height: 36rpx; - bottom: 0; - right: 0; - background: linear-gradient( - to right, - rgba(255, 255, 255, 0.2) 0, - rgba(255, 255, 255, 0.45) 20%, - rgba(255, 255, 255, 0.7) 25%, - rgba(255, 255, 255, 0.9) 30%, - rgba(255, 255, 255, 0.95) 35%, - #ffffff 50%, - #fff 100% - ); - font-size: 26rpx; - color: #fa550f; - line-height: 36rpx; - text-align: right; -} - -.comments-card-item-container-image { - margin-top: 24rpx; - display: flex; - justify-content: space-between; - flex-wrap: wrap; -} - -.comments-card-item-container-image .commentImg { - border-radius: 8rpx; - margin-top: 12rpx; -} - -.comments-card-item-container-image .commentImg3 { - width: 196rpx; - height: 196rpx; -} - -.comments-card-item-container-image .commentImg2 { - width: 300rpx; - height: 300rpx; -} - -.comments-card-item-container-image .commentImg1 { - width: 404rpx; - height: 404rpx; -} - -.comments-card-item-container .comments-title { - display: flex; - align-items: center; - position: relative; -} - -.comments-title .userName { - font-size: 26rpx; - color: #333333; - margin-left: 24rpx; -} - -.comments-title .commentTime { - font-size: 24rpx; - color: #999999; - position: absolute; - right: 0; -} - -.comments-info { - display: flex; - margin-top: 18rpx; -} - -.comments-info .rate { - margin-right: 24rpx; -} - -.comments-info .goods-info-text { - font-size: 24rpx; - color: #999999; -} - -.comments-card-item-container .comments-card-reply { - background-color: #f5f5f5; - padding: 24rpx 16rpx; - margin-top: 24rpx; -} - -.comments-card-item-container .comments-card-reply .prefix { - font-size: 26rpx; - font-weight: bold; - color: #666666; -} - -.comments-card-item-container .comments-card-reply .content { - font-size: 26rpx; - color: #666666; -} diff --git a/pages/goods/comments/create/index.js b/pages/goods/comments/create/index.js deleted file mode 100644 index be6d788..0000000 --- a/pages/goods/comments/create/index.js +++ /dev/null @@ -1,92 +0,0 @@ -// import { getCommentDetail } from '../../../../services/good/comments/fetchCommentDetail'; -import Toast from 'tdesign-miniprogram/toast/index'; -Page({ - data: { - serviceRateValue: 1, - goodRateValue: 1, - conveyRateValue: 1, - isAnonymous: false, - uploadFiles: [], - gridConfig: { - width: 218, - height: 218, - column: 3, - }, - isAllowedSubmit: false, - imgUrl: '', - title: '', - goodsDetail: '', - imageProps: { - mode: 'aspectFit', - }, - }, - - onLoad(options) { - this.setData({ - imgUrl: options.imgUrl, - title: options.title, - goodsDetail: options.specs, - }); - }, - - onRateChange(e) { - const { value } = e?.detail; - const item = e?.currentTarget?.dataset?.item; - this.setData({ [item]: value }, () => { - this.updateButtonStatus(); - }); - }, - - onAnonymousChange(e) { - const status = !!e?.detail?.checked; - this.setData({ isAnonymous: status }); - }, - - handleSuccess(e) { - const { files } = e.detail; - - this.setData({ - uploadFiles: files, - }); - }, - - handleRemove(e) { - const { index } = e.detail; - const { uploadFiles } = this.data; - uploadFiles.splice(index, 1); - this.setData({ - uploadFiles, - }); - }, - - onTextAreaChange(e) { - const value = e?.detail?.value; - this.textAreaValue = value; - this.updateButtonStatus(); - }, - - updateButtonStatus() { - const { - serviceRateValue, - goodRateValue, - conveyRateValue, - isAllowedSubmit, - } = this.data; - const { textAreaValue } = this; - const temp = - serviceRateValue && goodRateValue && conveyRateValue && textAreaValue; - if (temp !== isAllowedSubmit) this.setData({ isAllowedSubmit: temp }); - }, - - onSubmitBtnClick() { - const { isAllowedSubmit } = this.data; - if (!isAllowedSubmit) return; - Toast({ - context: this, - selector: '#t-toast', - message: '评价提交成功', - icon: 'check-circle', - }); - wx.navigateBack(); - }, -}); diff --git a/pages/goods/comments/create/index.json b/pages/goods/comments/create/index.json deleted file mode 100644 index 7c6d3eb..0000000 --- a/pages/goods/comments/create/index.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "navigationBarTitleText": "评价商品", - "usingComponents": { - "t-image": "/components/webp-image/index", - "t-rate": "tdesign-miniprogram/rate/rate", - "t-textarea": "tdesign-miniprogram/textarea/textarea", - "t-checkbox": "tdesign-miniprogram/checkbox/checkbox", - "t-button": "tdesign-miniprogram/button/button", - "t-upload": "tdesign-miniprogram/upload/upload", - "t-icon": "tdesign-miniprogram/icon/icon", - "t-toast": "tdesign-miniprogram/toast/toast" - } -} \ No newline at end of file diff --git a/pages/goods/comments/create/index.wxml b/pages/goods/comments/create/index.wxml deleted file mode 100644 index 254812d..0000000 --- a/pages/goods/comments/create/index.wxml +++ /dev/null @@ -1,85 +0,0 @@ - - - - - - - - {{title}} - {{goodsDetail}} - - - - 商品评价 - - - - - - - - - - 添加图片/视频 - - - - - - - 匿名评价 - - - - - 物流服务评价 - - 物流评价 - - - - 服务评价 - - - - - - - - diff --git a/pages/goods/comments/create/index.wxss b/pages/goods/comments/create/index.wxss deleted file mode 100644 index a63ef2e..0000000 --- a/pages/goods/comments/create/index.wxss +++ /dev/null @@ -1,171 +0,0 @@ -page { - background-color: #f5f5f5; -} - -.page-container .comment-card { - padding: 24rpx 32rpx 28rpx; - background-color: #ffffff; -} - -.comment-card .goods-info-container .goods-image { - width: 112rpx; - height: 112rpx; - border-radius: 8rpx; -} - -.comment-card .goods-info-container { - display: flex; -} - -.comment-card .goods-info-container .goods-title-container { - padding-left: 24rpx; -} - -.comment-card .goods-info-container .goods-title { - font-size: 28rpx; - font-weight: normal; - margin-top: 12rpx; -} - -.comment-card .goods-info-container .goods-detail { - font-size: 24rpx; - font-weight: normal; - color: #999999; - margin-top: 16rpx; -} - -.comment-card .rate-container { - display: flex; - align-items: center; - margin-top: 22rpx; -} - -.comment-card .rate-container .rate-title { - font-size: 28rpx; - font-weight: bold; -} - -.comment-card .rate-container .rate { - margin-left: 22rpx; -} - -.comment-card .textarea-container { - margin-top: 22rpx; -} - -.comment-card .textarea-container .textarea { - background-color: #f5f5f5; - border-radius: 16rpx; - font-size: 28rpx; - font-weight: normal; -} - -.page-container .t-checkbox__bordered { - display: none; -} - -.page-container .anonymous-box { - display: flex; - align-items: center; - padding-top: 52rpx; -} - -.page-container .anonymous-box .name { - font-size: 28rpx; - font-weight: normal; - color: #999999; - padding-left: 28rpx; -} - -.page-container .t-checkbox { - padding: 0rpx !important; -} - -.page-container .t-checkbox__content { - display: none; -} - -.comment-card .convey-comment-title { - font-size: 28rpx; - font-weight: bold; -} - -.convey-card { - background-color: #ffffff; - margin-top: 24rpx; - padding: 32rpx; - padding-bottom: calc(env(safe-area-inset-bottom) + 140rpx); -} - -.convey-card .rate-container .rate-title { - font-weight: normal; -} - -.page-container .t-checkbox__icon-left { - margin-right: 0rpx !important; -} - -.submit-button-container { - padding: 12rpx 0rpx; - display: flex; - width: 100vw; - justify-content: center; - position: fixed; - bottom: 0; - padding-bottom: calc(env(safe-area-inset-bottom) + 20rpx); - background-color: #ffffff; - z-index: 99; -} - -.submit-button-container .submit-button { - background-color: #fa4126; - border: 0; - border-radius: 48rpx; - width: 686rpx; - height: 88rpx; -} - -.submit-button-container .submit-button-disabled { - background-color: rgba(0, 0, 0, 0.4); - border: 0; - border-radius: 48rpx; - width: 686rpx; - height: 88rpx; -} - -.page-container .upload-container { - margin-top: 24rpx; -} - -.page-container .t-upload__wrapper { - border-radius: 8rpx; - overflow: hidden; -} - -.page-container .submmit-bar { - position: fixed; - left: 0; - right: 0; - bottom: 0; - z-index: 12; - padding: 12rpx 32rpx; - padding-bottom: env(safe-area-inset-bottom); - background-color: #fff; - height: 112rpx; -} - -.page-container .submmit-bar-button { - border-radius: 48rpx !important; - padding: 0 !important; -} - -.page-container .t-upload__close-btn { - background-color: rgba(0, 0, 0, 0.4); - border-bottom-left-radius: 8rpx; - width: 36rpx; - height: 36rpx; -} - -.upload-container .upload-addcontent-slot { - font-size: 26rpx; -} diff --git a/pages/goods/comments/index.js b/pages/goods/comments/index.js deleted file mode 100644 index ef3b361..0000000 --- a/pages/goods/comments/index.js +++ /dev/null @@ -1,227 +0,0 @@ -import { fetchComments } from '../../../services/comments/fetchComments'; -import { fetchCommentsCount } from '../../../services/comments/fetchCommentsCount'; -import dayjs from 'dayjs'; -const layoutMap = { - 0: 'vertical', -}; -Page({ - data: { - pageLoading: false, - commentList: [], - pageNum: 1, - myPageNum: 1, - pageSize: 10, - total: 0, - myTotal: 0, - hasLoaded: false, - layoutText: layoutMap[0], - loadMoreStatus: 0, - myLoadStatus: 0, - spuId: '1060004', - commentLevel: '', - hasImage: '', - commentType: '', - totalCount: 0, - countObj: { - badCount: '0', - commentCount: '0', - goodCount: '0', - middleCount: '0', - hasImageCount: '0', - uidCount: '0', - }, - }, - onLoad(options) { - this.getCount(options); - this.getComments(options); - }, - async getCount(options) { - try { - const result = await fetchCommentsCount( - { - spuId: options.spuId, - }, - { - method: 'POST', - }, - ); - this.setData({ - countObj: result, - }); - // const { data, code = '' } = result; - // if (code.toUpperCase() === 'SUCCESS') { - // wx.setNavigationBarTitle({ - // title: `全部评价(${data.commentCount})`, - // }); - // this.setData({ - // countObj: data, - // }); - // } else { - // wx.showToast({ - // title: '查询失败,请稍候重试', - // }); - // } - } catch (error) {} - }, - generalQueryData(reset) { - const { hasImage, pageNum, pageSize, spuId, commentLevel } = this.data; - const params = { - pageNum: 1, - pageSize: 30, - queryParameter: { - spuId, - }, - }; - if ( - Number(commentLevel) === 3 || - Number(commentLevel) === 2 || - Number(commentLevel) === 1 - ) { - params.queryParameter.commentLevel = Number(commentLevel); - } - if (hasImage && hasImage === '1') { - params.queryParameter.hasImage = true; - } else { - delete params.queryParameter.hasImage; - } - // 重置请求 - if (reset) return params; - - return { - ...params, - pageNum: pageNum + 1, - pageSize, - }; - }, - async init(reset = true) { - const { loadMoreStatus, commentList = [] } = this.data; - const params = this.generalQueryData(reset); - - // 在加载中或者无更多数据,直接返回 - if (loadMoreStatus !== 0) return; - - this.setData({ - loadMoreStatus: 1, - }); - - try { - const data = await fetchComments(params, { - method: 'POST', - }); - const code = 'SUCCESS'; - if (code.toUpperCase() === 'SUCCESS') { - const { pageList, totalCount = 0 } = data; - pageList.forEach((item) => { - // eslint-disable-next-line no-param-reassign - item.commentTime = dayjs(Number(item.commentTime)).format( - 'YYYY/MM/DD HH:mm', - ); - }); - - if (Number(totalCount) === 0 && reset) { - this.setData({ - commentList: [], - hasLoaded: true, - total: totalCount, - loadMoreStatus: 2, - }); - return; - } - const _commentList = reset ? pageList : commentList.concat(pageList); - const _loadMoreStatus = - _commentList.length === Number(totalCount) ? 2 : 0; - this.setData({ - commentList: _commentList, - pageNum: params.pageNum || 1, - totalCount: Number(totalCount), - loadMoreStatus: _loadMoreStatus, - }); - } else { - wx.showToast({ - title: '查询失败,请稍候重试', - }); - } - } catch (error) {} - this.setData({ - hasLoaded: true, - }); - }, - getScoreArray(score) { - var array = []; - for (let i = 0; i < 5; i++) { - if (i < score) { - array.push(2); - } else { - array.push(0); - } - } - return array; - }, - getComments(options) { - const { commentLevel = -1, spuId, hasImage = '' } = options; - if (commentLevel !== -1) { - this.setData({ - commentLevel: commentLevel, - }); - } - this.setData({ - hasImage: hasImage, - commentType: hasImage ? '4' : '', - spuId: spuId, - }); - this.init(true); - }, - changeTag(e) { - var { commenttype } = e.currentTarget.dataset; - var { commentType } = this.data; - if (commentType === commenttype) return; - this.setData({ - loadMoreStatus: 0, - commentList: [], - total: 0, - myTotal: 0, - myPageNum: 1, - pageNum: 1, - }); - if (commenttype === '' || commenttype === '5') { - this.setData({ - hasImage: '', - commentLevel: '', - }); - } else if (commenttype === '4') { - this.setData({ - hasImage: '1', - commentLevel: '', - }); - } else { - this.setData({ - hasImage: '', - commentLevel: commenttype, - }); - } - if (commenttype === '5') { - this.setData({ - myLoadStatus: 1, - commentType: commenttype, - }); - this.getMyCommentsList(); - } else { - this.setData({ - myLoadStatus: 0, - commentType: commenttype, - }); - this.init(true); - } - }, - onReachBottom() { - const { total = 0, commentList } = this.data; - if (commentList.length === total) { - this.setData({ - loadMoreStatus: 2, - }); - return; - } - - this.init(false); - }, -}); diff --git a/pages/goods/comments/index.json b/pages/goods/comments/index.json deleted file mode 100644 index a6418c9..0000000 --- a/pages/goods/comments/index.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "navigationBarTitleText": "全部评价", - "usingComponents": { - "t-tag": "tdesign-miniprogram/tag/tag", - "comments-card": "./components/comments-card/index", - "t-load-more": "/components/load-more/index" - } -} diff --git a/pages/goods/comments/index.wxml b/pages/goods/comments/index.wxml deleted file mode 100644 index 89d2b0f..0000000 --- a/pages/goods/comments/index.wxml +++ /dev/null @@ -1,50 +0,0 @@ - - - 全部({{countObj.commentCount}}) - - - 自己({{countObj.uidCount}}) - - - 带图({{countObj.hasImageCount}}) - - - 好评({{countObj.goodCount}}) - - - 中评({{countObj.middleCount}}) - - - 差评({{countObj.badCount}}) - - - - - - - - - diff --git a/pages/goods/comments/index.wxss b/pages/goods/comments/index.wxss deleted file mode 100644 index b98f36b..0000000 --- a/pages/goods/comments/index.wxss +++ /dev/null @@ -1,49 +0,0 @@ -/* 层级定义 -@z-index-0: 1; -@z-index-1: 100; -@z-index-2: 200; -@z-index-5: 500; -@z-index-component: 1000; // 通用组件级别 -@z-index-dropdown: @z-index-component; -@z-index-sticky: @z-index-component + 20; -@z-index-fixed: @z-index-component + 30; -@z-index-modal-backdrop:@z-index-component + 40; -@z-index-modal:@z-index-component + 50; -@z-index-popover:@z-index-component + 60; -@z-index-tooltip:@z-index-component + 70; -*/ -/* var() css变量适配*/ -page { - background-color: #FFFFFF; -} - -.comments-header { - display: flex; - flex-wrap: wrap; - padding: 32rpx 32rpx 0rpx; - background-color: #fff; - margin-top: -24rpx; - margin-left: -24rpx; -} - -.comments-header-tag { - margin-top: 24rpx; - margin-left: 24rpx; - height: 56rpx !important; - font-size: 24rpx !important; - justify-content: center; - background-color: #F5F5F5 !important; - border-radius: 8rpx !important; - border: 1px solid #F5F5F5 !important; -} - -.comments-header-active { - background-color: #FFECE9 !important; - color: #FA4126 !important; - border: 1px solid #FA4126 !important; -} - -.no-more { - padding-left: 20rpx; - padding-right: 20rpx; -} \ No newline at end of file diff --git a/pages/goods/details/components/buy-bar/index.js b/pages/goods/details/components/buy-bar/index.js deleted file mode 100644 index ae274e2..0000000 --- a/pages/goods/details/components/buy-bar/index.js +++ /dev/null @@ -1,66 +0,0 @@ -Component({ - externalClasses: ['wr-sold-out', 'wr-class'], - - options: { multipleSlots: true }, - - properties: { - soldout: { - // 商品是否下架 - type: Boolean, - value: false, - }, - jumpArray: { - type: Array, - value: [], - }, - isStock: { - type: Boolean, - value: true, - }, // 是否有库存 - isSlotButton: { - type: Boolean, - value: false, - }, // 是否开启按钮插槽 - shopCartNum: { - type: Number, // 购物车气泡数量 - }, - buttonType: { - type: Number, - value: 0, - }, - minDiscountPrice: { - type: String, - value: '', - }, - minSalePrice: { - type: String, - value: '', - }, - }, - - data: { - fillPrice: false, - }, - - methods: { - toAddCart() { - const { isStock } = this.properties; - if (!isStock) return; - this.triggerEvent('toAddCart'); - }, - - toBuyNow(e) { - const { isStock } = this.properties; - if (!isStock) return; - this.triggerEvent('toBuyNow', e); - }, - - toNav(e) { - const { url } = e.currentTarget.dataset; - return this.triggerEvent('toNav', { - e, - url, - }); - }, - }, -}); diff --git a/pages/goods/details/components/buy-bar/index.json b/pages/goods/details/components/buy-bar/index.json deleted file mode 100644 index 7464ae6..0000000 --- a/pages/goods/details/components/buy-bar/index.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "component": true, - "usingComponents": { - "t-icon": "tdesign-miniprogram/icon/icon" - } -} \ No newline at end of file diff --git a/pages/goods/details/components/buy-bar/index.wxml b/pages/goods/details/components/buy-bar/index.wxml deleted file mode 100644 index 604afb4..0000000 --- a/pages/goods/details/components/buy-bar/index.wxml +++ /dev/null @@ -1,38 +0,0 @@ - - {{soldout ? '商品已下架' : '商品已售馨'}} - - - - - - - {{shopCartNum > 99 ? '99+' : shopCartNum}} - - - {{item.title}} - - - - - - - 加入购物车 - - - 立即购买 - - - - - - - - diff --git a/pages/goods/details/components/buy-bar/index.wxss b/pages/goods/details/components/buy-bar/index.wxss deleted file mode 100644 index 44e8ad0..0000000 --- a/pages/goods/details/components/buy-bar/index.wxss +++ /dev/null @@ -1,107 +0,0 @@ -.footer-cont { - background-color: #fff; - padding: 16rpx; -} - -.icon-warp { - width: 110rpx; - display: flex; - justify-content: center; - align-items: center; - text-align: center; -} - -.operate-wrap { - position: relative; -} - -.bottom-operate-left { - width: 100%; -} - -.bottom-operate-left .icon-warp { - width: 50%; -} - -.tag-cart-num { - display: inline-block; - position: absolute; - left: 50rpx; - right: auto; - top: 6rpx; - color: #fff; - line-height: 24rpx; - text-align: center; - z-index: 99; - white-space: nowrap; - min-width: 28rpx; - border-radius: 14rpx; - background-color: #fa550f !important; - font-size: 20rpx; - font-weight: 400; - padding: 2rpx 6rpx; -} - -.operate-text { - color: #666; - font-size: 20rpx; -} - -.soldout { - height: 80rpx; - background: rgba(170, 170, 170, 1); - width: 100%; - color: #fff; -} - -.addCart-disabled, -.bar-addCart-disabled { - background: rgba(221, 221, 221, 1) !important; - color: #fff !important; - font-size: 28rpx; -} - -.buyNow-disabled, -.bar-buyNow-disabled { - background: rgba(198, 198, 198, 1) !important; - color: #fff !important; - font-size: 28rpx; -} - -.bar-separately, -.bar-buy { - width: 254rpx; - height: 80rpx; - color: #fff; - display: flex; - align-items: center; - justify-content: center; -} - -.bar-separately { - background: #ffece9; - color: #fa4126; - border-radius: 40rpx 0 0 40rpx; -} - -.bar-buy { - background-color: #fa4126; - border-radius: 0rpx 40rpx 40rpx 0rpx; -} - -.flex { - display: flex; - display: -webkit-flex; -} - -.flex-center { - justify-content: center; - -webkit-justify-content: center; - align-items: center; - -webkit-align-items: center; -} - -.flex-between { - justify-content: space-between; - -webkit-justify-content: space-between; -} diff --git a/pages/goods/details/components/goods-specs-popup/index.js b/pages/goods/details/components/goods-specs-popup/index.js deleted file mode 100644 index d6a4f74..0000000 --- a/pages/goods/details/components/goods-specs-popup/index.js +++ /dev/null @@ -1,389 +0,0 @@ -/* eslint-disable no-param-reassign */ -/* eslint-disable no-nested-ternary */ -import Toast from 'tdesign-miniprogram/toast/index'; - -Component({ - options: { - multipleSlots: true, - addGlobalClass: true, - }, - - properties: { - src: { - type: String, - }, - title: String, - show: { - type: Boolean, - value: false, - }, - limitBuyInfo: { - type: String, - value: '', - }, - isStock: { - type: Boolean, - value: true, - }, - limitMaxCount: { - type: Number, - value: 999, - }, - limitMinCount: { - type: Number, - value: 1, - }, - skuList: { - type: Array, - value: [], - observer(skuList) { - if (skuList && skuList.length > 0) { - if (this.initStatus) { - this.initData(); - } - } - }, - }, - specList: { - type: Array, - value: [], - observer(specList) { - if (specList && specList.length > 0) { - this.initData(); - } - }, - }, - outOperateStatus: { - type: Boolean, - value: false, - }, - hasAuth: { - type: Boolean, - value: false, - }, - count: { - type: Number, - value: 1, - observer(count) { - this.setData({ - buyNum: count, - }); - }, - }, - }, - - initStatus: false, - selectedSku: {}, - selectSpecObj: {}, - - data: { - buyNum: 1, - isAllSelectedSku: false, - }, - - methods: { - initData() { - const { skuList } = this.properties; - const { specList } = this.properties; - specList.forEach((item) => { - if (item.specValueList.length > 0) { - item.specValueList.forEach((subItem) => { - const obj = this.checkSkuStockQuantity( - subItem.specValueId, - skuList, - ); - subItem.hasStockObj = obj; - }); - } - }); - const selectedSku = {}; - specList.forEach((item) => { - selectedSku[item.specId] = ''; - }); - this.setData({ - specList, - }); - this.selectSpecObj = {}; - this.selectedSku = {}; - this.initStatus = true; - }, - - checkSkuStockQuantity(specValueId, skuList) { - let hasStock = false; - const array = []; - skuList.forEach((item) => { - (item.specInfo || []).forEach((subItem) => { - if (subItem.specValueId === specValueId && item.quantity > 0) { - const subArray = []; - (item.specInfo || []).forEach((specItem) => { - subArray.push(specItem.specValueId); - }); - array.push(subArray); - hasStock = true; - } - }); - }); - return { - hasStock, - specsArray: array, - }; - }, - - chooseSpecValueId(specValueId, specId) { - const { selectSpecObj } = this; - const { skuList, specList } = this.properties; - if (selectSpecObj[specId]) { - selectSpecObj[specId] = []; - this.selectSpecObj = selectSpecObj; - } else { - selectSpecObj[specId] = []; - } - - const itemAllSpecArray = []; - const itemUnSelectArray = []; - const itemSelectArray = []; - specList.forEach((item) => { - if (item.specId === specId) { - const subSpecValueItem = item.specValueList.find( - (subItem) => subItem.specValueId === specValueId, - ); - let specSelectStatus = false; - item.specValueList.forEach((n) => { - itemAllSpecArray.push(n.hasStockObj.specsArray); - if (n.isChoosed) { - specSelectStatus = true; - } - if (n.hasStockObj.hasStock) { - itemSelectArray.push(n.specValueId); - } else { - itemUnSelectArray.push(n.specValueId); - } - }); - if (specSelectStatus) { - selectSpecObj[specId] = this.flatten( - subSpecValueItem?.hasStockObj.specsArray.concat(itemSelectArray), - ); - } else { - const subSet = function (arr1, arr2) { - const set2 = new Set(arr2); - const subset = []; - arr1.forEach((val) => { - if (!set2.has(val)) { - subset.push(val); - } - }); - return subset; - }; - selectSpecObj[specId] = subSet( - this.flatten(itemAllSpecArray), - this.flatten(itemUnSelectArray), - ); - } - } else { - // 未点击规格的逻辑 - const itemSelectArray = []; - let specSelectStatus = false; - item.specValueList.map( - // 找到有库存的规格数组 - (n) => { - itemSelectArray.push(n.hasStockObj.specsArray); - if (n.isChoosed) { - specSelectStatus = true; - } - n.hasStockObj.hasStock = true; - return n; - }, - ); - if (specSelectStatus) { - selectSpecObj[item.specId] = this.flatten(itemSelectArray); - } else { - delete selectSpecObj[item.specId]; - } - } - this.selectSpecObj = selectSpecObj; - }); - const combatArray = Object.values(selectSpecObj); - if (combatArray.length > 0) { - const showArray = combatArray.reduce((x, y) => - this.getIntersection(x, y), - ); - const lastResult = Array.from(new Set(showArray)); - specList.forEach((item) => { - item.specValueList.forEach((subItem) => { - if (lastResult.includes(subItem.specValueId)) { - subItem.hasStockObj.hasStock = true; - } else { - subItem.hasStockObj.hasStock = false; - } - }); - }); - } else { - specList.forEach((item) => { - if (item.specValueList.length > 0) { - item.specValueList.forEach((subItem) => { - const obj = this.checkSkuStockQuantity( - subItem.specValueId, - skuList, - ); - subItem.hasStockObj = obj; - }); - } - }); - } - this.setData({ - specList, - }); - }, - - flatten(input) { - const stack = [...input]; - const res = []; - while (stack.length) { - const next = stack.pop(); - if (Array.isArray(next)) { - stack.push(...next); - } else { - res.push(next); - } - } - return res.reverse(); - }, - - getIntersection(array, nextArray) { - return array.filter((item) => nextArray.includes(item)); - }, - - toChooseItem(e) { - const { isStock } = this.properties; - if (!isStock) return; - const { id } = e.currentTarget.dataset; - const specId = e.currentTarget.dataset.specid; - const hasStock = e.currentTarget.dataset.hasstock; - if (!hasStock) { - Toast({ - context: this, - selector: '#t-toast', - message: '该规格已售罄', - icon: '', - duration: 1000, - }); - return; - } - - let { selectedSku } = this; - const { specList } = this.properties; - selectedSku = - selectedSku[specId] === id - ? { ...this.selectedSku, [specId]: '' } - : { ...this.selectedSku, [specId]: id }; - specList.forEach((item) => { - item.specValueList.forEach((valuesItem) => { - if (item.specId === specId) { - valuesItem.isChoosed = - valuesItem.specValueId === selectedSku[specId]; - } - }); - }); - this.chooseSpecValueId(id, specId); - const isAllSelectedSku = this.isAllSelected(specList, selectedSku); - if (!isAllSelectedSku) { - this.setData({ - selectSkuSellsPrice: 0, - selectSkuImg: '', - }); - } - this.setData({ - specList, - isAllSelectedSku, - }); - this.selectedSku = selectedSku; - this.triggerEvent('change', { - specList, - selectedSku, - isAllSelectedSku, - }); - }, - - // 判断是否所有的sku都已经选中 - isAllSelected(skuTree, selectedSku) { - const selected = Object.keys(selectedSku).filter( - (skuKeyStr) => selectedSku[skuKeyStr] !== '', - ); - return skuTree.length === selected.length; - }, - - handlePopupHide() { - this.triggerEvent('closeSpecsPopup', { - show: false, - }); - }, - - specsConfirm() { - const { isStock } = this.properties; - if (!isStock) return; - this.triggerEvent('specsConfirm'); - }, - - addCart() { - const { isStock } = this.properties; - if (!isStock) return; - this.triggerEvent('addCart'); - }, - - buyNow() { - const { isAllSelectedSku } = this.data; - const { isStock } = this.properties; - if (!isStock) return; - this.triggerEvent('buyNow', { - isAllSelectedSku, - }); - }, - - // 加 - handleBuyNumPlus() { - const { buyNum } = this.data; - const { isStock } = this.properties; - if (!isStock) return; - const nextBuyNum = Number(buyNum) + 1; - this.setBuyNum(nextBuyNum > 999 ? buyNum : nextBuyNum); - }, - - // 减 - handleBuyNumMinus() { - const { buyNum } = this.data; - const { limitMinCount } = this.properties; - const { isStock } = this.properties; - if (!isStock || buyNum < limitMinCount + 1) return; - const nextBuyNum = Number(buyNum) - 1; - this.setBuyNum(nextBuyNum < 1 ? buyNum : nextBuyNum); - }, - - // 总处理 - setBuyNum(buyNum) { - this.setData({ - buyNum, - }); - this.triggerEvent('changeNum', { - buyNum, - }); - }, - - // 输入框 - handleBuyNumChange(e) { - const { - detail: { value }, - } = e; - const valInNum = Number(value); - const { limitMaxCount, limitMinCount } = this.properties; - const nextData = { - buyNum: - valInNum < limitMinCount - ? limitMinCount - : valInNum > limitMaxCount - ? limitMaxCount - : valInNum, - }; - this.setData(nextData); - }, - }, -}); diff --git a/pages/goods/details/components/goods-specs-popup/index.json b/pages/goods/details/components/goods-specs-popup/index.json deleted file mode 100644 index e699a1c..0000000 --- a/pages/goods/details/components/goods-specs-popup/index.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "component": true, - "usingComponents": { - "t-popup": "tdesign-miniprogram/popup/popup", - "t-icon": "tdesign-miniprogram/icon/icon", - "t-image": "/components/webp-image/index", - "t-toast": "tdesign-miniprogram/toast/toast" - } -} \ No newline at end of file diff --git a/pages/goods/details/components/goods-specs-popup/index.wxml b/pages/goods/details/components/goods-specs-popup/index.wxml deleted file mode 100644 index bb5fd25..0000000 --- a/pages/goods/details/components/goods-specs-popup/index.wxml +++ /dev/null @@ -1,100 +0,0 @@ - - - - - - - - - {{title}} - - - - - - 选择: - - - {{selectedItem.specValue}} - - - - - - - - - {{item.title}} - - - {{valuesItem.specValue}} - - - - - - - - 购买数量 - - ({{limitBuyInfo}}) - - - - - - - - - - - - - - - - - - 确定 - - - - - 加入购物车 - - - - - 立即购买 - - - - - - - - diff --git a/pages/goods/details/components/goods-specs-popup/index.wxss b/pages/goods/details/components/goods-specs-popup/index.wxss deleted file mode 100644 index de0c749..0000000 --- a/pages/goods/details/components/goods-specs-popup/index.wxss +++ /dev/null @@ -1,300 +0,0 @@ -.popup-container { - background-color: #ffffff; - position: relative; - z-index: 100; - border-radius: 16rpx 16rpx 0 0; - padding-bottom: calc(env(safe-area-inset-bottom) + 20rpx); -} - -.popup-container .popup-close { - position: absolute; - right: 30rpx; - top: 30rpx; - z-index: 9; - color: #999999; -} - -.popup-sku-header { - display: flex; - padding: 30rpx 28rpx 0 30rpx; -} - -.popup-sku-header .popup-sku-header__img { - width: 176rpx; - height: 176rpx; - border-radius: 8rpx; - background: #d8d8d8; - margin-right: 24rpx; -} - -.popup-sku-header .popup-sku-header__goods-info { - position: relative; - width: 500rpx; -} - -.popup-sku-header .popup-sku-header__goods-info .popup-sku__goods-name { - font-size: 28rpx; - line-height: 40rpx; - display: -webkit-box; - -webkit-line-clamp: 2; - -webkit-box-orient: vertical; - white-space: normal; - overflow: hidden; - width: 430rpx; - text-overflow: ellipsis; -} - -.popup-sku-header .popup-sku-header__goods-info .popup-sku__selected-spec { - display: flex; - color: #333333; - font-size: 26rpx; - line-height: 36rpx; -} - -.popup-sku-header - .popup-sku-header__goods-info - .popup-sku__selected-spec - .popup-sku__selected-item { - margin-right: 10rpx; -} - -.popup-sku-body { - margin: 0 30rpx 40rpx; - max-height: 600rpx; - overflow-y: scroll; - -webkit-overflow-scrolling: touch; -} - -.popup-sku-body .popup-sku-group-container .popup-sku-row { - padding: 32rpx 0; - border-bottom: 1rpx solid #f5f5f5; -} - -.popup-sku-body - .popup-sku-group-container - .popup-sku-row - .popup-sku-row__title { - font-size: 26rpx; - color: #333; -} - -.popup-sku-body .popup-sku-group-container .popup-sku-row .popup-sku-row__item { - font-size: 24rpx; - color: #333; - min-width: 128rpx; - height: 56rpx; - background-color: #f5f5f5; - border-radius: 8rpx; - border: 2rpx solid #f5f5f5; - margin: 19rpx 26rpx 0 0; - padding: 0 16rpx; - display: inline-flex; - align-items: center; - justify-content: center; -} - -.popup-sku-body - .popup-sku-group-container - .popup-sku-row - .popup-sku-row__item.popup-sku-row__item--active { - border: 2rpx solid #fa4126; - color: #fa4126; - background: rgba(255, 95, 21, 0.04); -} - -.popup-sku-body - .popup-sku-group-container - .popup-sku-row - .disabled-sku-selected { - background: #f5f5f5 !important; - color: #cccccc; -} - -.popup-sku-body .popup-sku-stepper-stock .popup-sku-stepper-container { - display: flex; - align-items: center; - justify-content: space-between; - margin: 40rpx 0; -} - -.popup-sku-body - .popup-sku-stepper-stock - .popup-sku-stepper-container - .popup-sku__stepper-title { - display: flex; - font-size: 26rpx; - color: #333; -} - -.popup-sku-body - .popup-sku-stepper-stock - .popup-sku-stepper-container - .popup-sku__stepper-title - .limit-text { - margin-left: 10rpx; - color: #999999; -} - -.popup-sku-body - .popup-sku-stepper-stock - .popup-sku-stepper-container - .popup-stepper { - display: flex; - flex-flow: row nowrap; - align-items: center; - font-size: 28px; - height: 48rpx; - line-height: 62rpx; -} - -.popup-sku-body - .popup-sku-stepper-stock - .popup-sku-stepper-container - .popup-stepper - .input-btn, -.popup-sku-body - .popup-sku-stepper-stock - .popup-sku-stepper-container - .popup-stepper - .input-num-wrap { - position: relative; - height: 100%; - text-align: center; - background-color: #f5f5f5; - border-radius: 4rpx; -} - -.popup-sku-body - .popup-sku-stepper-stock - .popup-sku-stepper-container - .popup-stepper - .input-num-wrap { - color: #282828; - display: flex; - max-width: 76rpx; - align-items: center; - justify-content: space-between; -} - -.popup-sku-body - .popup-sku-stepper-stock - .popup-sku-stepper-container - .popup-stepper - .input-num-wrap - .input-num { - height: 100%; - width: auto; - font-weight: 600; - font-size: 30rpx; -} - -.popup-sku-body - .popup-sku-stepper-stock - .popup-sku-stepper-container - .popup-stepper - .input-btn { - width: 48rpx; -} - -.popup-sku-body - .popup-sku-stepper-stock - .popup-sku-stepper-container - .popup-stepper - .popup-stepper__minus { - margin-right: 4rpx; - border-radius: 4rpx; - color: #9a979b; - display: flex; - align-items: center; - justify-content: center; -} - -.popup-sku-body - .popup-sku-stepper-stock - .popup-sku-stepper-container - .popup-stepper - .popup-stepper__plus { - margin-left: 4rpx; - border-radius: 4rpx; - color: #9a979b; - display: flex; - align-items: center; - justify-content: center; -} - -.popup-sku-body - .popup-sku-stepper-stock - .popup-sku-stepper-container - .popup-stepper - .popup-stepper__plus::after { - width: 24rpx; - height: 3rpx; - background-color: #999999; -} - -.popup-sku-body - .popup-sku-stepper-stock - .popup-sku-stepper-container - .popup-stepper - .popup-stepper__plus::before { - width: 3rpx; - height: 24rpx; - background-color: #999999; -} - -.popup-sku-actions { - font-size: 32rpx; - height: 80rpx; - text-align: center; - line-height: 80rpx; - padding: 0 20rpx; -} - -.popup-sku-actions .sku-operate { - height: 80rpx; - width: 50%; - color: #fff; - border-radius: 48rpx; -} - -.popup-sku-actions .sku-operate .sku-operate-addCart { - background-color: #ffece9; - color: #fa4126; - border-radius: 48rpx 0 0 48rpx; -} - -.popup-sku-actions .sku-operate .sku-operate-addCart.disabled { - background: rgb(221, 221, 221); - color: #fff; -} - -.popup-sku-actions .sku-operate .sku-operate-buyNow { - background-color: #fa4126; - border-radius: 0 48rpx 48rpx 0; -} - -.popup-sku-actions .sku-operate .sku-operate-buyNow.disabled { - color: #fff; - background: rgb(198, 198, 198); -} - -.popup-sku-actions .sku-operate .selected-sku-btn { - width: 100%; -} - -.popup-container .single-confirm-btn { - border-radius: 48rpx; - color: #ffffff; - margin: 0 32rpx; - font-size: 32rpx; - height: 80rpx; - text-align: center; - line-height: 88rpx; - background-color: #fa4126; -} - -.popup-container .single-confirm-btn.disabled { - font-size: 32rpx; - color: #fff; - background-color: #dddddd; -} diff --git a/pages/goods/details/components/promotion-popup/index.js b/pages/goods/details/components/promotion-popup/index.js deleted file mode 100644 index 9743cc1..0000000 --- a/pages/goods/details/components/promotion-popup/index.js +++ /dev/null @@ -1,35 +0,0 @@ -Component({ - options: { - multipleSlots: true, - }, - - properties: { - list: Array, - title: { - type: String, - value: '促销说明', - }, - show: { - type: Boolean, - }, - }, - - // data: { - // list: [], - // }, - - methods: { - change(e) { - const { index } = e.currentTarget.dataset; - this.triggerEvent('promotionChange', { - index, - }); - }, - - closePromotionPopup() { - this.triggerEvent('closePromotionPopup', { - show: false, - }); - }, - }, -}); diff --git a/pages/goods/details/components/promotion-popup/index.json b/pages/goods/details/components/promotion-popup/index.json deleted file mode 100644 index a9de77d..0000000 --- a/pages/goods/details/components/promotion-popup/index.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "component": true, - "usingComponents": { - "t-popup": "tdesign-miniprogram/popup/popup", - "t-icon": "tdesign-miniprogram/icon/icon" - } -} \ No newline at end of file diff --git a/pages/goods/details/components/promotion-popup/index.wxml b/pages/goods/details/components/promotion-popup/index.wxml deleted file mode 100644 index c1cea9d..0000000 --- a/pages/goods/details/components/promotion-popup/index.wxml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - {{title}} - - - - - {{item.tag}} - - {{item.label ? item.label : ''}} - - - - - - - - - diff --git a/pages/goods/details/components/promotion-popup/index.wxss b/pages/goods/details/components/promotion-popup/index.wxss deleted file mode 100644 index 6e0e167..0000000 --- a/pages/goods/details/components/promotion-popup/index.wxss +++ /dev/null @@ -1,131 +0,0 @@ -.promotion-popup-container { - background-color: #ffffff; - position: relative; - z-index: 100; - border-radius: 16rpx 16rpx 0 0; -} - -.promotion-popup-container .promotion-popup-close { - position: absolute; - right: 30rpx; - top: 30rpx; - z-index: 9; - color: rgba(153, 153, 153, 1); -} - -.promotion-popup-container .promotion-popup-close .market { - font-size: 25rpx; - color: #999; -} - -.promotion-popup-container .promotion-popup-title { - height: 100rpx; - position: relative; - display: flex; - align-items: center; - justify-content: center; -} - -.promotion-popup-container .promotion-popup-title { - font-size: 32rpx; - color: #222427; - font-weight: 600; -} - -.promotion-popup-container .promotion-popup-content { - min-height: 400rpx; - max-height: 600rpx; - padding-bottom: calc(env(safe-area-inset-bottom) + 20rpx); - overflow-y: scroll; - -webkit-overflow-scrolling: touch; -} - -.promotion-popup-container .promotion-popup-content .promotion-detail-list { - margin: 0 30rpx; -} - -.promotion-popup-container - .promotion-popup-content - .promotion-detail-list - .list-item:last-child { - margin-bottom: env(safe-area-inset-bottom); - border-bottom: 0; - padding-bottom: calc(28rpx + env(safe-area-inset-bottom)); -} - -.promotion-popup-container - .promotion-popup-content - .promotion-detail-list - .list-item { - display: flex; - justify-content: space-between; - padding: 10rpx 0 28rpx; - position: relative; - font-size: 24rpx; - color: #222427; -} - -.promotion-popup-container - .promotion-popup-content - .promotion-detail-list - .list-item - .tag { - box-sizing: border-box; - font-size: 20rpx; - line-height: 32rpx; - padding: 2rpx 12rpx; - background-color: #ffece9; - margin-right: 16rpx; - display: inline-flex; - color: #fa4126; - border-radius: 54rpx; - flex-shrink: 0; - position: relative; - top: 2rpx; -} - -.promotion-popup-container - .promotion-popup-content - .promotion-detail-list - .list-item - .content { - font-size: 28rpx; - color: #222427; - flex: 1; - line-height: 40rpx; - display: flex; -} - -.promotion-popup-container - .promotion-popup-content - .promotion-detail-list - .list-item - .content - .list-content { - width: 440rpx; - white-space: nowrap; - text-overflow: ellipsis; - overflow: hidden; - display: inline-block; -} - -.promotion-popup-container - .promotion-popup-content - .promotion-detail-list - .list-item - .collect-btn { - font-size: 24rpx; - flex-shrink: 0; - margin-left: 20rpx; - display: flex; - align-items: center; -} - -.promotion-popup-container - .promotion-popup-content - .promotion-detail-list - .list-item - .collect-btn - .linkText { - margin-right: 8rpx; -} diff --git a/pages/goods/details/index.js b/pages/goods/details/index.js deleted file mode 100644 index b41f007..0000000 --- a/pages/goods/details/index.js +++ /dev/null @@ -1,443 +0,0 @@ -import Toast from 'tdesign-miniprogram/toast/index'; -import { fetchGood } from '../../../services/good/fetchGood'; -import { fetchActivityList } from '../../../services/activity/fetchActivityList'; -import { - getGoodsDetailsCommentList, - getGoodsDetailsCommentsCount, -} from '../../../services/good/fetchGoodsDetailsComments'; - -import { cdnBase } from '../../../config/index'; - -const imgPrefix = `${cdnBase}/`; - -const recLeftImg = `${imgPrefix}common/rec-left.png`; -const recRightImg = `${imgPrefix}common/rec-right.png`; -const obj2Params = (obj = {}, encode = false) => { - const result = []; - Object.keys(obj).forEach((key) => - result.push(`${key}=${encode ? encodeURIComponent(obj[key]) : obj[key]}`), - ); - - return result.join('&'); -}; - -Page({ - data: { - commentsList: [], - commentsStatistics: { - badCount: 0, - commentCount: 0, - goodCount: 0, - goodRate: 0, - hasImageCount: 0, - middleCount: 0, - }, - isShowPromotionPop: false, - activityList: [], - recLeftImg, - recRightImg, - details: {}, - goodsTabArray: [ - { - name: '商品', - value: '', // 空字符串代表置顶 - }, - { - name: '详情', - value: 'goods-page', - }, - ], - storeLogo: `${imgPrefix}common/store-logo.png`, - storeName: '云mall标准版旗舰店', - jumpArray: [ - { - title: '首页', - url: '/pages/home/home', - iconName: 'home', - }, - { - title: '购物车', - url: '/pages/cart/index', - iconName: 'cart', - showCartNum: true, - }, - ], - isStock: true, - cartNum: 0, - soldout: false, - buttonType: 1, - buyNum: 1, - selectedAttrStr: '', - skuArray: [], - primaryImage: '', - specImg: '', - isSpuSelectPopupShow: false, - isAllSelectedSku: false, - buyType: 0, - outOperateStatus: false, // 是否外层加入购物车 - operateType: 0, - selectSkuSellsPrice: 0, - maxLinePrice: 0, - minSalePrice: 0, - maxSalePrice: 0, - list: [], - spuId: '', - navigation: { type: 'fraction' }, - current: 0, - autoplay: true, - duration: 500, - interval: 5000, - soldNum: 0, // 已售数量 - }, - - handlePopupHide() { - this.setData({ - isSpuSelectPopupShow: false, - }); - }, - - showSkuSelectPopup(type) { - this.setData({ - buyType: type || 0, - outOperateStatus: type >= 1, - isSpuSelectPopupShow: true, - }); - }, - - buyItNow() { - this.showSkuSelectPopup(1); - }, - - toAddCart() { - this.showSkuSelectPopup(2); - }, - - toNav(e) { - const { url } = e.detail; - wx.switchTab({ - url: url, - }); - }, - - showCurImg(e) { - const { index } = e.detail; - const { images } = this.data.details; - wx.previewImage({ - current: images[index], - urls: images, // 需要预览的图片http链接列表 - }); - }, - - onPageScroll({ scrollTop }) { - const goodsTab = this.selectComponent('#goodsTab'); - goodsTab && goodsTab.onScroll(scrollTop); - }, - - chooseSpecItem(e) { - const { specList } = this.data.details; - const { selectedSku, isAllSelectedSku } = e.detail; - if (!isAllSelectedSku) { - this.setData({ - selectSkuSellsPrice: 0, - }); - } - this.setData({ - isAllSelectedSku, - }); - this.getSkuItem(specList, selectedSku); - }, - - getSkuItem(specList, selectedSku) { - const { skuArray, primaryImage } = this.data; - const selectedSkuValues = this.getSelectedSkuValues(specList, selectedSku); - let selectedAttrStr = ` 件 `; - selectedSkuValues.forEach((item) => { - selectedAttrStr += `,${item.specValue} `; - }); - // eslint-disable-next-line array-callback-return - const skuItem = skuArray.filter((item) => { - let status = true; - (item.specInfo || []).forEach((subItem) => { - if ( - !selectedSku[subItem.specId] || - selectedSku[subItem.specId] !== subItem.specValueId - ) { - status = false; - } - }); - if (status) return item; - }); - this.selectSpecsName(selectedSkuValues.length > 0 ? selectedAttrStr : ''); - if (skuItem) { - this.setData({ - selectItem: skuItem, - selectSkuSellsPrice: skuItem.price || 0, - }); - } else { - this.setData({ - selectItem: null, - selectSkuSellsPrice: 0, - }); - } - this.setData({ - specImg: skuItem && skuItem.skuImage ? skuItem.skuImage : primaryImage, - }); - }, - - // 获取已选择的sku名称 - getSelectedSkuValues(skuTree, selectedSku) { - const normalizedTree = this.normalizeSkuTree(skuTree); - return Object.keys(selectedSku).reduce((selectedValues, skuKeyStr) => { - const skuValues = normalizedTree[skuKeyStr]; - const skuValueId = selectedSku[skuKeyStr]; - if (skuValueId !== '') { - const skuValue = skuValues.filter((value) => { - return value.specValueId === skuValueId; - })[0]; - skuValue && selectedValues.push(skuValue); - } - return selectedValues; - }, []); - }, - - normalizeSkuTree(skuTree) { - const normalizedTree = {}; - skuTree.forEach((treeItem) => { - normalizedTree[treeItem.specId] = treeItem.specValueList; - }); - return normalizedTree; - }, - - selectSpecsName(selectSpecsName) { - if (selectSpecsName) { - this.setData({ - selectedAttrStr: selectSpecsName, - }); - } else { - this.setData({ - selectedAttrStr: '', - }); - } - }, - - addCart() { - const { isAllSelectedSku } = this.data; - Toast({ - context: this, - selector: '#t-toast', - message: isAllSelectedSku ? '点击加入购物车' : '请选择规格', - icon: '', - duration: 1000, - }); - }, - - gotoBuy(type) { - const { isAllSelectedSku, buyNum } = this.data; - if (!isAllSelectedSku) { - Toast({ - context: this, - selector: '#t-toast', - message: '请选择规格', - icon: '', - duration: 1000, - }); - return; - } - this.handlePopupHide(); - const query = { - quantity: buyNum, - storeId: '1', - spuId: this.data.spuId, - goodsName: this.data.details.title, - skuId: - type === 1 ? this.data.skuList[0].skuId : this.data.selectItem.skuId, - available: this.data.details.available, - price: this.data.details.minSalePrice, - specInfo: this.data.details.specList?.map((item) => ({ - specTitle: item.title, - specValue: item.specValueList[0].specValue, - })), - primaryImage: this.data.details.primaryImage, - spuId: this.data.details.spuId, - thumb: this.data.details.primaryImage, - title: this.data.details.title, - }; - let urlQueryStr = obj2Params({ - goodsRequestList: JSON.stringify([query]), - }); - urlQueryStr = urlQueryStr ? `?${urlQueryStr}` : ''; - const path = `/pages/order/order-confirm/index${urlQueryStr}`; - wx.navigateTo({ - url: path, - }); - }, - - specsConfirm() { - const { buyType } = this.data; - if (buyType === 1) { - this.gotoBuy(); - } else { - this.addCart(); - } - // this.handlePopupHide(); - }, - - changeNum(e) { - this.setData({ - buyNum: e.detail.buyNum, - }); - }, - - closePromotionPopup() { - this.setData({ - isShowPromotionPop: false, - }); - }, - - promotionChange(e) { - const { index } = e.detail; - wx.navigateTo({ - url: `/pages/promotion-detail/index?promotion_id=${index}`, - }); - }, - - showPromotionPopup() { - this.setData({ - isShowPromotionPop: true, - }); - }, - - getDetail(spuId) { - Promise.all([fetchGood(spuId), fetchActivityList()]).then((res) => { - const [details, activityList] = res; - const skuArray = []; - const { - skuList, - primaryImage, - isPutOnSale, - minSalePrice, - maxSalePrice, - maxLinePrice, - soldNum, - } = details; - skuList.forEach((item) => { - skuArray.push({ - skuId: item.skuId, - quantity: item.stockInfo ? item.stockInfo.stockQuantity : 0, - specInfo: item.specInfo, - }); - }); - const promotionArray = []; - activityList.forEach((item) => { - promotionArray.push({ - tag: item.promotionSubCode === 'MYJ' ? '满减' : '满折', - label: '满100元减99.9元', - }); - }); - this.setData({ - details, - activityList, - isStock: details.spuStockQuantity > 0, - maxSalePrice: maxSalePrice ? parseInt(maxSalePrice) : 0, - maxLinePrice: maxLinePrice ? parseInt(maxLinePrice) : 0, - minSalePrice: minSalePrice ? parseInt(minSalePrice) : 0, - list: promotionArray, - skuArray: skuArray, - primaryImage, - soldout: isPutOnSale === 0, - soldNum, - }); - }); - }, - - async getCommentsList() { - try { - const code = 'Success'; - const data = await getGoodsDetailsCommentList(); - const { homePageComments } = data; - if (code.toUpperCase() === 'SUCCESS') { - const nextState = { - commentsList: homePageComments.map((item) => { - return { - goodsSpu: item.spuId, - userName: item.userName || '', - commentScore: item.commentScore, - commentContent: item.commentContent || '用户未填写评价', - userHeadUrl: item.isAnonymity - ? this.anonymityAvatar - : item.userHeadUrl || this.anonymityAvatar, - }; - }), - }; - this.setData(nextState); - } - } catch (error) { - console.error('comments error:', error); - } - }, - - onShareAppMessage() { - // 自定义的返回信息 - const { selectedAttrStr } = this.data; - let shareSubTitle = ''; - if (selectedAttrStr.indexOf('件') > -1) { - const count = selectedAttrStr.indexOf('件'); - shareSubTitle = selectedAttrStr.slice(count + 1, selectedAttrStr.length); - } - const customInfo = { - imageUrl: this.data.details.primaryImage, - title: this.data.details.title + shareSubTitle, - path: `/pages/goods/details/index?spuId=${this.data.spuId}`, - }; - return customInfo; - }, - - /** 获取评价统计 */ - async getCommentsStatistics() { - try { - const code = 'Success'; - const data = await getGoodsDetailsCommentsCount(); - if (code.toUpperCase() === 'SUCCESS') { - const { - badCount, - commentCount, - goodCount, - goodRate, - hasImageCount, - middleCount, - } = data; - const nextState = { - commentsStatistics: { - badCount: parseInt(`${badCount}`), - commentCount: parseInt(`${commentCount}`), - goodCount: parseInt(`${goodCount}`), - /** 后端返回百分比后数据但没有限制位数 */ - goodRate: Math.floor(goodRate * 10) / 10, - hasImageCount: parseInt(`${hasImageCount}`), - middleCount: parseInt(`${middleCount}`), - }, - }; - this.setData(nextState); - } - } catch (error) { - console.error('comments statiistics error:', error); - } - }, - - /** 跳转到评价列表 */ - navToCommentsListPage() { - wx.navigateTo({ - url: `/pages/goods/comments/index?spuId=${this.data.spuId}`, - }); - }, - - onLoad(query) { - const { spuId } = query; - this.setData({ - spuId: spuId, - }); - this.getDetail(spuId); - this.getCommentsList(spuId); - this.getCommentsStatistics(spuId); - }, -}); diff --git a/pages/goods/details/index.json b/pages/goods/details/index.json deleted file mode 100644 index a5d8558..0000000 --- a/pages/goods/details/index.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "navigationBarTitleText": "商品详情", - "usingComponents": { - "t-image": "/components/webp-image/index", - "t-tag": "tdesign-miniprogram/tag/tag", - "t-toast": "tdesign-miniprogram/toast/toast", - "t-rate": "tdesign-miniprogram/rate/rate", - "t-swiper": "tdesign-miniprogram/swiper/swiper", - "t-swiper-item": "tdesign-miniprogram/swiper/swiper-item", - "t-button": "tdesign-miniprogram/button/button", - "t-icon": "tdesign-miniprogram/icon/icon", - "t-popup": "tdesign-miniprogram/popup/popup", - "price": "/components/price/index", - "buy-bar": "./components/buy-bar/index", - "promotion-popup": "./components/promotion-popup/index", - "goods-specs-popup": "./components/goods-specs-popup/index" - } -} \ No newline at end of file diff --git a/pages/goods/details/index.wxml b/pages/goods/details/index.wxml deleted file mode 100644 index 1a616f4..0000000 --- a/pages/goods/details/index.wxml +++ /dev/null @@ -1,176 +0,0 @@ - - - - - - - - - - - - - - - 已售{{soldNum}} - - - - - {{item.tag}} - - - - 领劵 - - - - - {{details.title}} - - - - - - - - - - {{intro}} - - - 已选 - - - {{selectedAttrStr ? buyNum : ''}}{{selectedAttrStr || '请选择'}} - - - - - - - - 商品评价 - - ({{ commentsStatistics.commentCount }}) - - - - {{commentsStatistics.goodRate}}% 好评 - - - - - - - - {{commentItem.userName}} - - - - - {{commentItem.commentContent}} - - - - - - - - 详情介绍 - - - - - - - - - - - - - - - - - - - - - diff --git a/pages/goods/details/index.wxss b/pages/goods/details/index.wxss deleted file mode 100644 index eb74549..0000000 --- a/pages/goods/details/index.wxss +++ /dev/null @@ -1,356 +0,0 @@ -@import '../../../style/global.wxss'; -page { - width: 100vw; -} - -.goods-detail-page .goods-info { - margin: 0 auto; - padding: 26rpx 0 28rpx 30rpx; - background-color: #fff; -} - -.goods-detail-page .swipe-img { - width: 100%; - height: 750rpx; -} - -.goods-detail-page .goods-info .goods-price { - display: flex; - align-items: baseline; -} - -.goods-detail-page .goods-info .goods-price-up { - color: #fa4126; - font-size: 28rpx; - position: relative; - bottom: 4rpx; - left: 8rpx; -} - -.goods-detail-page .goods-info .goods-price .class-goods-price { - font-size: 64rpx; - color: #fa4126; - font-weight: bold; - font-family: DIN Alternate; -} - -.goods-detail-page .goods-info .goods-price .class-goods-symbol { - font-size: 36rpx; - color: #fa4126; -} - -.goods-detail-page .goods-info .goods-price .class-goods-del { - position: relative; - font-weight: normal; - left: 16rpx; - bottom: 2rpx; - color: #999999; - font-size: 32rpx; -} - -.goods-detail-page .goods-info .goods-number { - display: flex; - align-items: center; - justify-content: space-between; -} - -.goods-detail-page .goods-info .goods-number .sold-num { - font-size: 24rpx; - color: #999999; - display: flex; - align-items: flex-end; - margin-right: 32rpx; -} - -.goods-detail-page .goods-info .goods-activity { - display: flex; - margin-top: 16rpx; - justify-content: space-between; -} - -.goods-detail-page .goods-info .goods-activity .tags-container { - display: flex; -} - -.goods-detail-page - .goods-info - .goods-activity - .tags-container - .goods-activity-tag { - background: #ffece9; - color: #fa4126; - font-size: 24rpx; - margin-right: 16rpx; - padding: 4rpx 8rpx; - border-radius: 4rpx; -} - -.goods-detail-page .goods-info .goods-activity .activity-show { - display: flex; - justify-content: center; - align-items: center; - color: #fa4126; - font-size: 24rpx; - padding-right: 32rpx; -} - -.goods-detail-page .goods-info .goods-activity .activity-show-text { - line-height: 42rpx; -} - -.goods-detail-page .goods-info .goods-title { - display: flex; - justify-content: space-between; - align-items: center; - margin-top: 20rpx; -} - -.goods-detail-page .goods-info .goods-title .goods-name { - width: 600rpx; - font-weight: 500; - display: -webkit-box; - -webkit-box-orient: vertical; - -webkit-line-clamp: 2; - overflow: hidden; - font-size: 32rpx; - word-break: break-all; - color: #333333; -} - -.goods-detail-page .goods-info .goods-title .goods-tag { - width: 104rpx; - margin-left: 26rpx; -} - -.goods-detail-page .goods-info .goods-title .goods-tag .shareBtn { - border-radius: 200rpx 0px 0px 200rpx; - width: 100rpx; - height: 96rpx; - border: none; - padding-right: 36rpx !important; -} - -.goods-detail-page .goods-info .goods-title .goods-tag .shareBtn::after { - border: none; -} - -.goods-detail-page .goods-info .goods-title .goods-tag .btn-icon { - font-size: 20rpx; - display: flex; - flex-direction: column; - align-items: center; - justify-content: center; - height: 96rpx; - color: #999; -} - -.goods-detail-page .goods-info .goods-title .goods-tag .btn-icon .share-text { - line-height: 32rpx; -} - -.goods-detail-page .goods-info .goods-intro { - font-size: 26rpx; - color: #888; - line-height: 36rpx; - word-break: break-all; - padding-right: 30rpx; - display: -webkit-box; - -webkit-line-clamp: 2; - -webkit-box-orient: vertical; - white-space: normal; - overflow: hidden; -} - -.spu-select { - height: 80rpx; - background-color: #fff; - margin-top: 20rpx; - display: flex; - align-items: center; - padding: 30rpx; - font-size: 28rpx; -} - -.spu-select .label { - margin-right: 30rpx; - text-align: center; - flex-shrink: 0; - color: #999999; - font-weight: normal; -} - -.spu-select .content { - display: flex; - flex: 1; - justify-content: space-between; - align-items: center; -} - -.spu-select .content .tintColor { - color: #aaa; -} - -.goods-detail-page .desc-content { - margin-top: 20rpx; - background-color: #fff; - padding-bottom: 120rpx; -} - -.goods-detail-page .desc-content__title { - font-size: 28rpx; - line-height: 36rpx; - text-align: center; - display: flex; - justify-content: center; - align-items: center; - padding: 30rpx 20rpx; -} - -.goods-detail-page .desc-content__title .img { - width: 206rpx; - height: 10rpx; -} - -.goods-detail-page .desc-content__title--text { - font-size: 26rpx; - margin: 0 32rpx; - font-weight: 600; -} - -.goods-detail-page .desc-content__img { - width: 100%; - height: auto; -} - -.goods-bottom-operation { - position: fixed; - left: 0; - bottom: 0; - width: 100%; - background-color: #fff; - padding-bottom: env(safe-area-inset-bottom); -} - -.popup-sku-header .popup-sku-header__goods-info .popup-sku__price { - display: flex; - align-items: baseline; - color: #fa4126; - margin-top: 48rpx; -} - -.popup-sku-header - .popup-sku-header__goods-info - .popup-sku__price - .popup-sku__price-num { - font-size: 64rpx; - color: #fa4126; - font-weight: bold; - font-family: DIN Alternate; -} - -.popup-sku-header - .popup-sku-header__goods-info - .popup-sku__price - .popup-sku__price-del { - position: relative; - font-weight: normal; - left: 12rpx; - bottom: 2rpx; - color: #999999; - font-size: 32rpx; -} - -.popup-sku-header - .popup-sku-header__goods-info - .popup-sku__price - .popup-sku__price-symbol { - font-size: 36rpx; - color: #fa4126; -} - -.popup-sku-header - .popup-sku-header__goods-info - .popup-sku__price - .popup-sku__price-max-num { - font-size: 48rpx; -} - -.goods-detail-page .goods-head .t-swiper { - height: 750rpx !important; -} - -.t-toast__content { - z-index: 12000 !important; -} - -.comments-wrap { - margin-top: 20rpx; - padding: 32rpx; - background-color: #fff; -} - -.comments-wrap .comments-head { - display: flex; - flex-direction: row; - align-items: center; - justify-content: space-between; -} - -.comments-wrap .comments-head .comments-title-wrap { - display: flex; -} - -.comments-title-label, -.comments-title-count { - color: #333333; - font-size: 32rpx; - font-weight: 500; - line-height: 48rpx; -} - -.comments-rate-wrap { - display: flex; - justify-content: center; - align-items: center; - font-size: 24rpx; -} - -.comments-rate-wrap .comments-good-rate { - color: #999999; - font-size: 26rpx; - font-weight: 400; - font-style: normal; - line-height: 36rpx; -} - -.comment-item-wrap .comment-item-head { - display: flex; - flex-direction: row; - align-items: center; - margin-top: 32rpx; -} - -.comment-item-wrap .comment-item-head .comment-item-avatar { - width: 64rpx; - height: 64rpx; - border-radius: 64rpx; -} - -.comment-item-wrap .comment-item-head .comment-head-right { - margin-left: 24rpx; -} - -.comment-head-right .comment-username { - font-size: 26rpx; - color: #333333; - line-height: 36rpx; - font-weight: 400; -} - -.comment-item-wrap .comment-item-content { - margin-top: 20rpx; - color: #333333; - line-height: 40rpx; - font-size: 28rpx; - font-weight: 400; -} diff --git a/pages/goods/list/index.js b/pages/goods/list/index.js deleted file mode 100644 index c16cd66..0000000 --- a/pages/goods/list/index.js +++ /dev/null @@ -1,226 +0,0 @@ -import { fetchGoodsList } from '../../../services/good/fetchGoodsList'; -import Toast from 'tdesign-miniprogram/toast/index'; - -const initFilters = { - overall: 1, - sorts: '', - layout: 0, -}; - -Page({ - data: { - goodsList: [], - layout: 0, - sorts: '', - overall: 1, - show: false, - minVal: '', - maxVal: '', - filter: initFilters, - hasLoaded: false, - loadMoreStatus: 0, - loading: true, - }, - - pageNum: 1, - pageSize: 30, - total: 0, - - handleFilterChange(e) { - const { layout, overall, sorts } = e.detail; - this.pageNum = 1; - this.setData({ - layout, - sorts, - overall, - loadMoreStatus: 0, - }); - this.init(true); - }, - - generalQueryData(reset = false) { - const { filter, keywords, minVal, maxVal } = this.data; - const { pageNum, pageSize } = this; - const { sorts, overall } = filter; - const params = { - sort: 0, // 0 综合,1 价格 - pageNum: 1, - pageSize: 30, - keyword: keywords, - }; - - if (sorts) { - params.sort = 1; - params.sortType = sorts === 'desc' ? 1 : 0; - } - - if (overall) { - params.sort = 0; - } else { - params.sort = 1; - } - params.minPrice = minVal ? minVal * 100 : 0; - params.maxPrice = maxVal ? maxVal * 100 : undefined; - if (reset) return params; - return { - ...params, - pageNum: pageNum + 1, - pageSize, - }; - }, - - async init(reset = true) { - const { loadMoreStatus, goodsList = [] } = this.data; - const params = this.generalQueryData(reset); - if (loadMoreStatus !== 0) return; - this.setData({ - loadMoreStatus: 1, - loading: true, - }); - try { - const result = await fetchGoodsList(params); - const code = 'Success'; - const data = result; - if (code.toUpperCase() === 'SUCCESS') { - const { spuList, totalCount = 0 } = data; - if (totalCount === 0 && reset) { - this.total = totalCount; - this.setData({ - emptyInfo: { - tip: '抱歉,未找到相关商品', - }, - hasLoaded: true, - loadMoreStatus: 0, - loading: false, - goodsList: [], - }); - return; - } - - const _goodsList = reset ? spuList : goodsList.concat(spuList); - const _loadMoreStatus = _goodsList.length === totalCount ? 2 : 0; - this.pageNum = params.pageNum || 1; - this.total = totalCount; - this.setData({ - goodsList: _goodsList, - loadMoreStatus: _loadMoreStatus, - }); - } else { - this.setData({ - loading: false, - }); - wx.showToast({ - title: '查询失败,请稍候重试', - }); - } - } catch (error) { - this.setData({ - loading: false, - }); - } - this.setData({ - hasLoaded: true, - loading: false, - }); - }, - - onLoad() { - this.init(true); - }, - - onReachBottom() { - const { goodsList } = this.data; - const { total = 0 } = this; - if (goodsList.length === total) { - this.setData({ - loadMoreStatus: 2, - }); - return; - } - this.init(false); - }, - - handleAddCart() { - Toast({ - context: this, - selector: '#t-toast', - message: '点击加购', - }); - }, - - tagClickHandle() { - Toast({ - context: this, - selector: '#t-toast', - message: '点击标签', - }); - }, - - gotoGoodsDetail(e) { - const { index } = e.detail; - const { spuId } = this.data.goodsList[index]; - wx.navigateTo({ - url: `/pages/goods/details/index?spuId=${spuId}`, - }); - }, - - showFilterPopup() { - this.setData({ - show: true, - }); - }, - - showFilterPopupClose() { - this.setData({ - show: false, - }); - }, - - onMinValAction(e) { - const { value } = e.detail; - this.setData({ minVal: value }); - }, - - onMaxValAction(e) { - const { value } = e.detail; - this.setData({ maxVal: value }); - }, - - reset() { - this.setData({ minVal: '', maxVal: '' }); - }, - - confirm() { - const { minVal, maxVal } = this.data; - let message = ''; - if (minVal && !maxVal) { - message = `价格最小是${minVal}`; - } else if (!minVal && maxVal) { - message = `价格范围是0-${minVal}`; - } else if (minVal && maxVal && minVal <= maxVal) { - message = `价格范围${minVal}-${this.data.maxVal}`; - } else { - message = '请输入正确范围'; - } - if (message) { - Toast({ - context: this, - selector: '#t-toast', - message, - }); - } - this.pageNum = 1; - this.setData( - { - show: false, - minVal: '', - goodsList: [], - loadMoreStatus: 0, - maxVal: '', - }, - () => { - this.init(); - }, - ); - }, -}); diff --git a/pages/goods/list/index.json b/pages/goods/list/index.json deleted file mode 100644 index 0811511..0000000 --- a/pages/goods/list/index.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "navigationBarTitleText": "商品列表", - "usingComponents": { - "t-input": "tdesign-miniprogram/input/input", - "t-empty": "tdesign-miniprogram/empty/empty", - "t-toast": "tdesign-miniprogram/toast/toast", - "goods-list": "/components/goods-list/index", - "filter": "/components/filter/index", - "filter-popup": "/components/filter-popup/index", - "load-more": "/components/load-more/index" - } -} \ No newline at end of file diff --git a/pages/goods/list/index.wxml b/pages/goods/list/index.wxml deleted file mode 100644 index 82d7bee..0000000 --- a/pages/goods/list/index.wxml +++ /dev/null @@ -1,55 +0,0 @@ - - - - - 价格区间 - - - - - - - - - - - - - - - - - - - diff --git a/pages/goods/list/index.wxss b/pages/goods/list/index.wxss deleted file mode 100644 index 4895167..0000000 --- a/pages/goods/list/index.wxss +++ /dev/null @@ -1,108 +0,0 @@ -page { - background-color: #fff; -} - -.goods-list-container { - display: block; -} - -.goods-list-container .t-search { - padding: 0 30rpx; - background-color: #fff; -} - -.goods-list-container .t-class__input-container { - height: 64rpx !important; - border-radius: 32rpx !important; -} - -.goods-list-container .t-search__left-icon { - display: flex; - align-items: center; -} - -.goods-list-container .t-search__input { - font-size: 28rpx !important; - color: rgb(116, 116, 116) !important; -} - -.goods-list-container .category-goods-list { - background-color: #f2f2f2; - overflow-y: scroll; - -webkit-overflow-scrolling: touch; - padding: 20rpx 24rpx; - -webkit-overflow-scrolling: touch; -} - -.goods-list-container .wr-goods-list { - background: #f2f2f2 !important; -} - -.goods-list-container .t-image__mask { - display: flex !important; -} - -.goods-list-container .empty-wrap { - margin-top: 184rpx; - margin-bottom: 120rpx; - height: 300rpx; -} - -.goods-list-container .empty-wrap .empty-tips .empty-content .content-text { - margin-top: 40rpx; -} - -.goods-list-container .price-container { - padding: 32rpx; - height: 100vh; - max-width: 632rpx; - background-color: #fff; - border-radius: 30rpx 0 0 30rpx; - box-sizing: border-box; -} - -.goods-list-container .price-between { - font-size: 26rpx; - font-weight: 500; - color: rgba(51, 51, 51, 1); -} - -.goods-list-container .price-ipts-wrap { - width: 100%; - display: flex; - flex-direction: row; - justify-content: space-around; - margin-top: 24rpx; -} - -.goods-list-container .price-ipts-wrap .price-divided { - position: relative; - width: 22rpx; - margin: 0 20rpx; - color: #222427; -} - -.goods-list-container .price-ipts-wrap .price-ipt { - box-sizing: border-box; - width: 246rpx; - font-size: 24rpx; - height: 56rpx; - padding: 0 24rpx; - text-align: center; - border-radius: 8rpx; - color: #333; - background: rgba(245, 245, 245, 1); -} - -.t-class-input { - font-size: 24rpx !important; -} - -.goods-list-container .price-ipts-wrap .price-ipt::after { - border: none !important; -} - -.goods-list-container .t-input__control { - font-size: 24rpx !important; - text-align: center; -} diff --git a/pages/goods/result/index.js b/pages/goods/result/index.js deleted file mode 100644 index 47ce19d..0000000 --- a/pages/goods/result/index.js +++ /dev/null @@ -1,262 +0,0 @@ -/* eslint-disable no-param-reassign */ -import { getSearchResult } from '../../../services/good/featchSearchResult'; -import Toast from 'tdesign-miniprogram/toast/index'; - -const initFilters = { - overall: 1, - sorts: '', -}; - -Page({ - data: { - goodsList: [], - sorts: '', - overall: 1, - show: false, - minVal: '', - maxVal: '', - minSalePriceFocus: false, - maxSalePriceFocus: false, - filter: initFilters, - hasLoaded: false, - keywords: '', - loadMoreStatus: 0, - loading: true, - }, - - total: 0, - pageNum: 1, - pageSize: 30, - - onLoad(options) { - const { searchValue = '' } = options || {}; - this.setData( - { - keywords: searchValue, - }, - () => { - this.init(true); - }, - ); - }, - - generalQueryData(reset = false) { - const { filter, keywords, minVal, maxVal } = this.data; - const { pageNum, pageSize } = this; - const { sorts, overall } = filter; - const params = { - sort: 0, // 0 综合,1 价格 - pageNum: 1, - pageSize: 30, - keyword: keywords, - }; - - if (sorts) { - params.sort = 1; - params.sortType = sorts === 'desc' ? 1 : 0; - } - if (overall) { - params.sort = 0; - } else { - params.sort = 1; - } - params.minPrice = minVal ? minVal * 100 : 0; - params.maxPrice = maxVal ? maxVal * 100 : undefined; - if (reset) return params; - return { - ...params, - pageNum: pageNum + 1, - pageSize, - }; - }, - - async init(reset = true) { - const { loadMoreStatus, goodsList = [] } = this.data; - const params = this.generalQueryData(reset); - if (loadMoreStatus !== 0) return; - this.setData({ - loadMoreStatus: 1, - loading: true, - }); - try { - const result = await getSearchResult(params); - const code = 'Success'; - const data = result; - if (code.toUpperCase() === 'SUCCESS') { - const { spuList, totalCount = 0 } = data; - if (totalCount === 0 && reset) { - this.total = totalCount; - this.setData({ - emptyInfo: { - tip: '抱歉,未找到相关商品', - }, - hasLoaded: true, - loadMoreStatus: 0, - loading: false, - goodsList: [], - }); - return; - } - - const _goodsList = reset ? spuList : goodsList.concat(spuList); - _goodsList.forEach((v) => { - v.tags = v.spuTagList.map((u) => u.title); - v.hideKey = { desc: true }; - }); - const _loadMoreStatus = _goodsList.length === totalCount ? 2 : 0; - this.pageNum = params.pageNum || 1; - this.total = totalCount; - this.setData({ - goodsList: _goodsList, - loadMoreStatus: _loadMoreStatus, - }); - } else { - this.setData({ - loading: false, - }); - wx.showToast({ - title: '查询失败,请稍候重试', - }); - } - } catch (error) { - this.setData({ - loading: false, - }); - } - this.setData({ - hasLoaded: true, - loading: false, - }); - }, - - handleCartTap() { - wx.switchTab({ - url: '/pages/cart/index', - }); - }, - - handleSubmit() { - this.setData( - { - goodsList: [], - loadMoreStatus: 0, - }, - () => { - this.init(true); - }, - ); - }, - - onReachBottom() { - const { goodsList } = this.data; - const { total = 0 } = this; - if (goodsList.length === total) { - this.setData({ - loadMoreStatus: 2, - }); - return; - } - this.init(false); - }, - - handleAddCart() { - Toast({ - context: this, - selector: '#t-toast', - message: '点击加购', - }); - }, - - gotoGoodsDetail(e) { - const { index } = e.detail; - const { spuId } = this.data.goodsList[index]; - wx.navigateTo({ - url: `/pages/goods/details/index?spuId=${spuId}`, - }); - }, - - handleFilterChange(e) { - const { overall, sorts } = e.detail; - const { total } = this; - const _filter = { - sorts, - overall, - }; - this.setData({ - filter: _filter, - sorts, - overall, - }); - - this.pageNum = 1; - this.setData( - { - goodsList: [], - loadMoreStatus: 0, - }, - () => { - total && this.init(true); - }, - ); - }, - - showFilterPopup() { - this.setData({ - show: true, - }); - }, - - showFilterPopupClose() { - this.setData({ - show: false, - }); - }, - - onMinValAction(e) { - const { value } = e.detail; - this.setData({ minVal: value }); - }, - - onMaxValAction(e) { - const { value } = e.detail; - this.setData({ maxVal: value }); - }, - - reset() { - this.setData({ minVal: '', maxVal: '' }); - }, - - confirm() { - const { minVal, maxVal } = this.data; - let message = ''; - if (minVal && !maxVal) { - message = `价格最小是${minVal}`; - } else if (!minVal && maxVal) { - message = `价格范围是0-${minVal}`; - } else if (minVal && maxVal && minVal <= maxVal) { - message = `价格范围${minVal}-${this.data.maxVal}`; - } else { - message = '请输入正确范围'; - } - if (message) { - Toast({ - context: this, - selector: '#t-toast', - message, - }); - } - this.pageNum = 1; - this.setData( - { - show: false, - minVal: '', - goodsList: [], - loadMoreStatus: 0, - maxVal: '', - }, - () => { - this.init(); - }, - ); - }, -}); diff --git a/pages/goods/result/index.json b/pages/goods/result/index.json deleted file mode 100644 index 130b48d..0000000 --- a/pages/goods/result/index.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "navigationBarTitleText": "搜索", - "usingComponents": { - "t-search": "tdesign-miniprogram/search/search", - "t-input": "tdesign-miniprogram/input/input", - "t-empty": "tdesign-miniprogram/empty/empty", - "t-toast": "tdesign-miniprogram/toast/toast", - "goods-list": "/components/goods-list/index", - "filter": "/components/filter/index", - "filter-popup": "/components/filter-popup/index", - "load-more": "/components/load-more/index", - "t-icon": "tdesign-miniprogram/icon/icon" - }, - "onReachBottomDistance": 50 -} \ No newline at end of file diff --git a/pages/goods/result/index.wxml b/pages/goods/result/index.wxml deleted file mode 100644 index 30591d7..0000000 --- a/pages/goods/result/index.wxml +++ /dev/null @@ -1,81 +0,0 @@ - - - - - - - - - 价格区间 - - - - - - - - - - - - - - - - - - - diff --git a/pages/goods/result/index.wxss b/pages/goods/result/index.wxss deleted file mode 100644 index 804ec53..0000000 --- a/pages/goods/result/index.wxss +++ /dev/null @@ -1,110 +0,0 @@ -page { - background-color: #fff; -} - -page view { - box-sizing: border-box; -} - -.result-container { - display: block; -} - -.result-container .t-search { - padding: 0 30rpx; - background-color: #fff; -} - -.result-container .t-class__input-container { - height: 64rpx !important; - border-radius: 32rpx !important; -} - -.result-container .t-search__left-icon { - display: flex; - align-items: center; -} - -.result-container .t-search__input { - font-size: 28rpx !important; - color: #333 !important; -} - -.result-container .category-goods-list { - background-color: #f2f2f2; - overflow-y: scroll; - padding: 20rpx 24rpx; - -webkit-overflow-scrolling: touch; -} - -.result-container .wr-goods-list { - background: #f2f2f2 !important; -} - -.result-container .t-image__mask { - display: flex !important; -} - -.result-container .empty-wrap { - margin-top: 184rpx; - margin-bottom: 120rpx; - height: 300rpx; -} - -.result-container .empty-wrap .empty-tips .empty-content .content-text { - margin-top: 40rpx; -} - -.result-container .price-container { - padding: 32rpx; - height: 100vh; - max-width: 632rpx; - background-color: #fff; - border-radius: 30rpx 0 0 30rpx; -} - -.result-container .price-between { - font-size: 26rpx; - font-weight: 500; - color: rgba(51, 51, 51, 1); -} - -.result-container .price-ipts-wrap { - width: 100%; - display: flex; - flex-direction: row; - justify-content: space-around; - margin-top: 24rpx; -} - -.result-container .price-ipts-wrap .price-divided { - position: relative; - width: 22rpx; - margin: 0 20rpx; - color: #222427; -} - -.result-container .price-ipts-wrap .price-ipt { - box-sizing: border-box; - width: 246rpx; - font-size: 24rpx; - height: 56rpx; - padding: 0 24rpx; - text-align: center; - border-radius: 8rpx; - color: #333; - background: rgba(245, 245, 245, 1); -} - -.t-class-input { - font-size: 24rpx !important; -} - -.result-container .price-ipts-wrap .price-ipt::after { - border: none !important; -} - -.result-container .t-input__control { - font-size: 24rpx !important; - text-align: center; -} diff --git a/pages/goods/search/index.js b/pages/goods/search/index.js deleted file mode 100644 index c726041..0000000 --- a/pages/goods/search/index.js +++ /dev/null @@ -1,119 +0,0 @@ -import { - getSearchHistory, - getSearchPopular, -} from '../../../services/good/fetchSearchHistory'; - -Page({ - data: { - historyWords: [], - popularWords: [], - searchValue: '', - dialog: { - title: '确认删除当前历史记录', - showCancelButton: true, - message: '', - }, - dialogShow: false, - }, - - deleteType: 0, - deleteIndex: '', - - onShow() { - this.queryHistory(); - this.queryPopular(); - }, - - async queryHistory() { - try { - const data = await getSearchHistory(); - const code = 'Success'; - if (String(code).toUpperCase() === 'SUCCESS') { - const { historyWords = [] } = data; - this.setData({ - historyWords, - }); - } - } catch (error) { - console.error(error); - } - }, - - async queryPopular() { - try { - const data = await getSearchPopular(); - const code = 'Success'; - if (String(code).toUpperCase() === 'SUCCESS') { - const { popularWords = [] } = data; - this.setData({ - popularWords, - }); - } - } catch (error) { - console.error(error); - } - }, - - confirm() { - const { historyWords } = this.data; - const { deleteType, deleteIndex } = this; - historyWords.splice(deleteIndex, 1); - if (deleteType === 0) { - this.setData({ - historyWords, - dialogShow: false, - }); - } else { - this.setData({ historyWords: [], dialogShow: false }); - } - }, - - close() { - this.setData({ dialogShow: false }); - }, - - handleClearHistory() { - const { dialog } = this.data; - this.deleteType = 1; - this.setData({ - dialog: { - ...dialog, - message: '确认删除所有历史记录', - }, - dialogShow: true, - }); - }, - - deleteCurr(e) { - const { index } = e.currentTarget.dataset; - const { dialog } = this.data; - this.deleteIndex = index; - this.setData({ - dialog: { - ...dialog, - message: '确认删除当前历史记录', - deleteType: 0, - }, - dialogShow: true, - }); - }, - - handleHistoryTap(e) { - const { historyWords } = this.data; - const { dataset } = e.currentTarget; - const _searchValue = historyWords[dataset.index || 0] || ''; - if (_searchValue) { - wx.navigateTo({ - url: `/pages/goods/result/index?searchValue=${_searchValue}`, - }); - } - }, - - handleSubmit(e) { - const { value } = e.detail.value; - if (value.length === 0) return; - wx.navigateTo({ - url: `/pages/goods/result/index?searchValue=${value}`, - }); - }, -}); diff --git a/pages/goods/search/index.json b/pages/goods/search/index.json deleted file mode 100644 index 74abdf7..0000000 --- a/pages/goods/search/index.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "navigationBarTitleText": "搜索", - "usingComponents": { - "t-search": "tdesign-miniprogram/search/search", - "t-icon": "tdesign-miniprogram/icon/icon", - "t-dialog": "tdesign-miniprogram/dialog/dialog" - } -} diff --git a/pages/goods/search/index.wxml b/pages/goods/search/index.wxml deleted file mode 100644 index 743f83c..0000000 --- a/pages/goods/search/index.wxml +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - - - 历史搜索 - 清除 - - - - {{item}} - - - - - - 热门搜索 - - - - {{item}} - - - - - - - diff --git a/pages/goods/search/index.wxss b/pages/goods/search/index.wxss deleted file mode 100644 index 676603e..0000000 --- a/pages/goods/search/index.wxss +++ /dev/null @@ -1,79 +0,0 @@ -.search-page { - box-sizing: border-box; - width: 100vw; - height: 100vh; - padding: 0 30rpx; -} - -.search-page .t-class__input-container { - height: 64rpx !important; - border-radius: 32rpx !important; -} - -.search-page .t-search__input { - font-size: 28rpx !important; - color: #333 !important; -} - -.search-page .search-wrap { - margin-top: 44rpx; -} - -.search-page .history-wrap { - margin-bottom: 20px; -} - -.search-page .search-header { - display: flex; - flex-flow: row nowrap; - justify-content: space-between; - align-items: center; -} - -.search-page .search-title { - font-size: 30rpx; - font-family: PingFangSC-Semibold, PingFang SC; - font-weight: 600; - color: rgba(51, 51, 51, 1); - line-height: 42rpx; -} - -.search-page .search-clear { - font-size: 24rpx; - font-family: PingFang SC; - line-height: 32rpx; - color: #999999; - font-weight: normal; -} - -.search-page .search-content { - overflow: hidden; - display: flex; - flex-flow: row wrap; - justify-content: flex-start; - align-items: flex-start; - margin-top: 24rpx; -} - -.search-page .search-item { - color: #333333; - font-size: 24rpx; - line-height: 32rpx; - font-weight: normal; - margin-right: 24rpx; - margin-bottom: 24rpx; - background: #f5f5f5; - border-radius: 38rpx; - padding: 12rpx 24rpx; -} - -.search-page .hover-history-item { - position: relative; - top: 3rpx; - left: 3rpx; - box-shadow: 0px 0px 8px rgba(0, 0, 0, 0.1) inset; -} - -.add-notes__confirm { - color: #fa4126 !important; -} diff --git a/pages/home/additive/additive.json b/pages/home/additive/additive.json index da66c1a..6055f4d 100644 --- a/pages/home/additive/additive.json +++ b/pages/home/additive/additive.json @@ -3,6 +3,7 @@ "onReachBottomDistance": 10, "backgroundTextStyle": "light", "usingComponents": { + "tox-tag": "../../../components/tox-tag", "t-icon": "tdesign-miniprogram/icon/icon", "t-tag": "tdesign-miniprogram/tag/tag", "t-tabs": "tdesign-miniprogram/tabs/tabs" diff --git a/pages/home/additive/additive.wxml b/pages/home/additive/additive.wxml index f3a20ff..dc6b3a6 100644 --- a/pages/home/additive/additive.wxml +++ b/pages/home/additive/additive.wxml @@ -2,7 +2,7 @@ - + {{additiveData.name ? additiveData.name : 'XXX'}} {{additiveData.enName ? additiveData.enName : 'xxx'}} @@ -24,7 +24,10 @@ 包含物质 - {{item.name}} + + {{item.name}} + + {{item.cas}} diff --git a/pages/home/additive/additive.wxss b/pages/home/additive/additive.wxss index f0abc85..95e2bd5 100644 --- a/pages/home/additive/additive.wxss +++ b/pages/home/additive/additive.wxss @@ -2,6 +2,7 @@ .main { width: 100%; + padding-bottom: 30px; } .main-item { diff --git a/pages/home/chemical/chemical.js b/pages/home/chemical/chemical.js index ef8efd4..b5eb98d 100644 --- a/pages/home/chemical/chemical.js +++ b/pages/home/chemical/chemical.js @@ -25,7 +25,8 @@ Page({ "name": "", "otherName": "", "toxicity": [] - } + }, + showToxInfo: false, }, /** @@ -41,13 +42,25 @@ Page({ if (respose.code == 10000) { // console.log(respose.content); this.setData({ - chemicalData: respose.content + chemicalData: respose.content, }) console.log(this.data.chemicalData); } }) }, + onOpenToxInfo() { + this.setData({ + showToxInfo: true, + }) + }, + + onCloseToxInfo() { + this.setData({ + showToxInfo: false + }) + }, + /** * 生命周期函数--监听页面初次渲染完成 */ diff --git a/pages/home/chemical/chemical.json b/pages/home/chemical/chemical.json index 78ed037..200306e 100644 --- a/pages/home/chemical/chemical.json +++ b/pages/home/chemical/chemical.json @@ -4,12 +4,14 @@ "backgroundTextStyle": "light", "usingComponents": { "no-data": "../components/no-data/no-data", + "tox-tag": "../../../components/tox-tag", "t-search": "tdesign-miniprogram/search/search", "t-icon": "tdesign-miniprogram/icon/icon", "t-grid": "tdesign-miniprogram/grid/grid", - "t-grid-item": "tdesign-miniprogram/grid/grid-item", + "t-grid-item": "tdesign-miniprogram/grid-item/grid-item", "t-tag": "tdesign-miniprogram/tag/tag", "t-tabs": "tdesign-miniprogram/tabs/tabs", - "t-tab-panel": "tdesign-miniprogram/tabs/tab-panel" + "t-tab-panel": "tdesign-miniprogram/tab-panel/tab-panel", + "t-dialog": "tdesign-miniprogram/dialog/dialog" } } \ No newline at end of file diff --git a/pages/home/chemical/chemical.wxml b/pages/home/chemical/chemical.wxml index 19b594b..b5324ee 100644 --- a/pages/home/chemical/chemical.wxml +++ b/pages/home/chemical/chemical.wxml @@ -2,9 +2,13 @@ - + - {{chemicalData.name ? chemicalData.name : 'XXX'}} + + {{chemicalData.name ? chemicalData.name : 'XXX'}} + + + {{chemicalData.enName ? chemicalData.enName : 'xxx'}} @@ -19,12 +23,12 @@ - + - + - {{item}} + {{chemicalData.description}} @@ -37,10 +41,10 @@ {{item}} - + - + @@ -55,7 +59,7 @@ - + @@ -63,7 +67,7 @@ {{item.diseasename}} - {{item.directevidence == 'therapeutic' ? '治疗' : '相关'}} + {{item.directevidence == 'therapeutic' ? '有疗效' : '标记/机制'}} 相关论文: @@ -75,4 +79,14 @@ - \ No newline at end of file + + + + + + LD50值指的是一次全部给予造成试验动物50%(一半)死亡的化学品数量; + LC50值(50%致死浓度)指的是化学品在空气中或水中造成一组试验动物50%(一半)死亡的浓度; + LDLo值指的是产生毒性效应的最低剂量; + + + \ No newline at end of file diff --git a/pages/home/chemical/chemical.wxss b/pages/home/chemical/chemical.wxss index 842fe25..9be7eea 100644 --- a/pages/home/chemical/chemical.wxss +++ b/pages/home/chemical/chemical.wxss @@ -17,8 +17,10 @@ } .logo-image { - width: 50px; - height: 50px; + min-width: 50px; + min-height: 50px; + max-width: 50px; + max-height: 50px; border-radius: 9999px; border-style: solid; border-width: 2px; @@ -46,6 +48,7 @@ .title-enname { color: rgb(150, 150, 150); + word-break: break-all; } .total { @@ -74,6 +77,8 @@ font-size: 0.75rem; line-height: 1.25rem; font-weight: 600; + margin-left: 10px; + margin-right: 10px; } .toxicity-item { @@ -132,4 +137,18 @@ padding: 5px; padding-left: 10px; padding-right: 10px; +} + +.long-content .content-container { + white-space: pre-line; +} + +.toxinfo-text { + margin-top: 10px; +} + +.main-tabs { + font-size: 1.125rem; + line-height: 1.75rem; + font-weight: 600; } \ No newline at end of file diff --git a/pages/home/components/no-data/no-data.wxml b/pages/home/components/no-data/no-data.wxml index 1341cfe..829e511 100644 --- a/pages/home/components/no-data/no-data.wxml +++ b/pages/home/components/no-data/no-data.wxml @@ -1,4 +1,4 @@ - + \ No newline at end of file diff --git a/pages/home/home.js b/pages/home/home.js index f9d38d2..81ad425 100644 --- a/pages/home/home.js +++ b/pages/home/home.js @@ -1,9 +1,6 @@ import { fetchHome } from '../../services/home/home'; -import { - fetchGoodsList -} from '../../services/good/fetchGoods'; import Toast from 'tdesign-miniprogram/toast/index'; import { isLogin @@ -11,6 +8,9 @@ import { import { sessionUpload } from '../../services/api/session' +import { + articleList +} from '../../services/api/article' Page({ data: { @@ -19,7 +19,7 @@ Page({ goodsList: [], goodsListLoadStatus: 0, pageLoading: false, - current: 1, + current: 0, autoplay: true, duration: 500, interval: 5000, @@ -27,6 +27,7 @@ Page({ type: 'dots' }, loadingDialog: false, + swiperList: [], }, @@ -47,127 +48,50 @@ Page({ this.init(); }, - onReachBottom() { - if (this.data.goodsListLoadStatus === 0) { - this.loadGoodsList(); - } - }, + onReachBottom() {}, onPullDownRefresh() { this.init(); }, init() { - this.loadHomePage(); isLogin() + this.loadHomePage() }, loadHomePage() { - wx.stopPullDownRefresh(); - - this.setData({ - pageLoading: true, - }); - fetchHome().then(({ - swiper, - tabList - }) => { - this.setData({ - tabList, - imgSrcs: swiper, - pageLoading: false, - }); - this.loadGoodsList(true); - }); + articleList({ + type: 2, + isPublic: 2, + pageNumber: 1, + pageSize: 10 + }).then(response => { + if (response.code == 10000) { + console.log(response.content); + if (response.content.contentList.length == 0) { + return + } + let tmp = [] + for (let index = 0; index < response.content.contentList.length; index++) { + const element = response.content.contentList[index]; + tmp.push(element.headerUrl) + } + this.setData({ + swiperList: response.content.contentList, + imgSrcs: tmp + }) + console.log(this.data.imgSrcs); + } + }) + // this.setData({ + // imgSrcs: [ + // 'https://webplus-cn-hangzhou-s-603871eef968dd14ced82ed5.oss-cn-hangzhou.aliyuncs.com/hextech/static/use_btn.jpg', + // 'https://cdn-we-retail.ym.tencent.com/tsr/home/v2/banner2.png' + // ], + // }); }, - tabChangeHandle(e) { - this.privateData.tabIndex = e.detail; - this.loadGoodsList(true); - }, - - onReTry() { - this.loadGoodsList(); - }, - - async loadGoodsList(fresh = false) { - if (fresh) { - wx.pageScrollTo({ - scrollTop: 0, - }); - } - - this.setData({ - goodsListLoadStatus: 1 - }); - - const pageSize = this.goodListPagination.num; - let pageIndex = - this.privateData.tabIndex * pageSize + this.goodListPagination.index + 1; - if (fresh) { - pageIndex = 0; - } - - try { - const nextList = await fetchGoodsList(pageIndex, pageSize); - this.setData({ - goodsList: fresh ? nextList : this.data.goodsList.concat(nextList), - goodsListLoadStatus: 0, - }); - - this.goodListPagination.index = pageIndex; - this.goodListPagination.num = pageSize; - } catch (err) { - this.setData({ - goodsListLoadStatus: 3 - }); - } - }, - - goodListClickHandle(e) { - const { - index - } = e.detail; - const { - spuId - } = this.data.goodsList[index]; - wx.navigateTo({ - url: `/pages/goods/details/index?spuId=${spuId}`, - }); - }, - - goodListAddCartHandle() { - Toast({ - context: this, - selector: '#t-toast', - message: '点击加入购物车', - }); - }, - - navToSearchPage() { - wx.navigateTo({ - url: '/pages/goods/search/index' - }); - }, - - navToActivityDetail(detail) { - console.log(detail); - const { - index: promotionID = 0 - } = detail || {}; - console.log(promotionID); - wx.navigateTo({ - url: `/pages/promotion-detail/index?promotion_id=${promotionID}`, - }); - }, - - showLoadingDialog() { - this.data.loadingDialog = true - }, - - closeLoadingDialog() { - this.data.loadingDialog = false - }, + onReTry() {}, // 上传图片 uploadPicture() { @@ -201,6 +125,14 @@ Page({ }) }, + onSwiperClick(e) { + const id = this.data.swiperList[e.detail.index].id + console.log(id); + wx.navigateTo({ + url: `/pages/info/content-page/index?id=${id}`, + }); + }, + textButton(e) { // this.goSession(76) this.setData({ diff --git a/pages/home/home.json b/pages/home/home.json index 2eccc26..97f2ce8 100644 --- a/pages/home/home.json +++ b/pages/home/home.json @@ -6,16 +6,12 @@ "t-search": "tdesign-miniprogram/search/search", "t-loading": "tdesign-miniprogram/loading/loading", "t-swiper": "tdesign-miniprogram/swiper/swiper", - "t-swiper-item": "tdesign-miniprogram/swiper/swiper-item", - "t-swiper-nav": "tdesign-miniprogram/swiper/swiper-nav", - "t-image": "/components/webp-image/index", + "t-swiper-nav": "tdesign-miniprogram/swiper-nav/swiper-nav", + "t-image": "tdesign-miniprogram/image/image", "t-icon": "tdesign-miniprogram/icon/icon", - "t-toast": "tdesign-miniprogram/toast/toast", "t-button": "tdesign-miniprogram/button/button", "t-tabs": "tdesign-miniprogram/tabs/tabs", - "t-tab-panel": "tdesign-miniprogram/tabs/tab-panel", - "goods-list": "/components/goods-list/index", - "load-more": "/components/load-more/index", + "t-tab-panel": "tdesign-miniprogram/tab-panel/tab-panel", "t-dialog": "tdesign-miniprogram/dialog/dialog" } } \ No newline at end of file diff --git a/pages/home/home.wxml b/pages/home/home.wxml index 059b173..1e01788 100644 --- a/pages/home/home.wxml +++ b/pages/home/home.wxml @@ -1,16 +1,13 @@ - - - - + - + - 取消 - - - \ No newline at end of file diff --git a/pages/usercenter/index.wxss b/pages/usercenter/index.wxss deleted file mode 100644 index 483e6f2..0000000 --- a/pages/usercenter/index.wxss +++ /dev/null @@ -1,146 +0,0 @@ -page { - background-color: #f5f5f5; -} - -.content-wrapper { - margin-top: 340rpx; - position: relative; - padding: 0 30rpx; -} - -.main-content { - height: 500rpx; -} - -.order-group-wrapper { - margin-bottom: 16rpx; -} - -.order-group-note { - font-size: 28rpx; -} - -.cell-box { - border-radius: 10rpx; - overflow: hidden; - margin-bottom: 20rpx; -} -.icon-color { - color: #aaa; -} -.cell-class { - height: 100rpx; - display: flex; - align-items: center; -} - -.order-content { - overflow: hidden; - width: 100%; - display: flex; - background-color: #fff; - border-radius: 16rpx; -} - -.order-item { - flex: 1; - height: 180rpx; - overflow: hidden; - position: relative; - text-align: center; -} - -.order-content-box { - margin: auto; - position: absolute; - width: 100%; - top: 50%; - left: 50%; - -webkit-transform: translate(-50%, -50%); - -ms-transform: translate(-50%, -50%); - transform: translate(-50%, -50%); -} -.order-content-t { - margin-top: 10rpx; - font-size: 24rpx; - color: #333; - letter-spacing: 0; - text-align: center; -} - -.popup-content { - background: #f5f5f5; - margin-bottom: env(safe-area-inset-bottom); - border-radius: 16rpx 16rpx 0 0; -} -.popup-content .popup-title { - background: #fff; - text-align: center; - font-size: 24rpx; - color: #999; - height: 112rpx; - text-align: center; - line-height: 112rpx; - border-radius: 16rpx 16rpx 0 0; -} - -.border-bottom-1px { - position: relative; -} - -.border-bottom-1px::after { - position: absolute; - display: block; - content: ''; - box-sizing: border-box; - top: 0; - left: 0; - width: 200%; - height: 200%; - transform: scale(0.5); - transform-origin: left top; - border-bottom: 2rpx solid #e5e5e5; -} -.popup-content .popup-phone, -.popup-content .popup-close { - background: #fff; - height: 100rpx; - display: flex; - justify-content: center; - align-items: center; - text-align: center; - font-size: 30rpx; - font-family: PingFangSC-Regular, PingFang SC; - font-weight: 400; - color: #333; -} -.popup-content .popup-phone.online { - margin-bottom: 20rpx; -} -.popup-content .popup-phone.online::after { - content: none; -} -.popup-content .popup-close { - color: #333; - border: 0; - margin-top: 16rpx; -} - -.my-order { - border-radius: 10rpx; -} - -.footer__version { - text-align: center; - margin-top: 50rpx; - color: #999; - margin-bottom: 4rpx; - font-size: 24rpx; - line-height: 32rpx; -} -.cell-box .order-group__left { - margin-right: 0; -} -.cell-box .t-cell-padding { - padding: 24rpx 18rpx 24rpx 32rpx; -} diff --git a/pages/usercenter/name-edit/index.js b/pages/usercenter/name-edit/index.js deleted file mode 100644 index 57e4e3d..0000000 --- a/pages/usercenter/name-edit/index.js +++ /dev/null @@ -1,19 +0,0 @@ -Page({ - data: { - nameValue: '', - }, - onLoad(options) { - const { name } = options; - this.setData({ - nameValue: name, - }); - }, - onSubmit() { - wx.navigateBack({ backRefresh: true }); - }, - clearContent() { - this.setData({ - nameValue: '', - }); - }, -}); diff --git a/pages/usercenter/name-edit/index.json b/pages/usercenter/name-edit/index.json deleted file mode 100644 index efc7e5f..0000000 --- a/pages/usercenter/name-edit/index.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "navigationBarTitleText": "昵称", - "usingComponents": { - "t-input": "tdesign-miniprogram/input/input", - "t-icon": "tdesign-miniprogram/icon/icon", - "t-button": "tdesign-miniprogram/button/button" - } -} diff --git a/pages/usercenter/name-edit/index.wxml b/pages/usercenter/name-edit/index.wxml deleted file mode 100644 index 0366a88..0000000 --- a/pages/usercenter/name-edit/index.wxml +++ /dev/null @@ -1,16 +0,0 @@ - - - - 最多可输入15个字 - - - 保存 - - - diff --git a/pages/usercenter/name-edit/index.wxss b/pages/usercenter/name-edit/index.wxss deleted file mode 100644 index ef4b048..0000000 --- a/pages/usercenter/name-edit/index.wxss +++ /dev/null @@ -1,26 +0,0 @@ -page { - background-color: #f5f5f5; -} -page view { - box-sizing: border-box; -} -.name-edit { - padding-top: 20rpx; -} -.name-edit .name-edit__input--desc { - font-size: 26rpx; - padding: 16rpx 32rpx; - color: #999; - margin-bottom: 200rpx; -} -.name-edit .name-edit__wrapper { - width: 100%; - padding: 0 32rpx; -} -.name-edit .name-edit__btn { - height: 88rpx; - width: 100%; - background: #fa4126; - color: #fff; - border-radius: 48rpx; -} diff --git a/pages/usercenter/person-info/index.js b/pages/usercenter/person-info/index.js deleted file mode 100644 index 48fed27..0000000 --- a/pages/usercenter/person-info/index.js +++ /dev/null @@ -1,122 +0,0 @@ -import { fetchPerson } from '../../../services/usercenter/fetchPerson'; -import { phoneEncryption } from '../../../utils/util'; -import Toast from 'tdesign-miniprogram/toast/index'; - -Page({ - data: { - personInfo: { - avatarUrl: '', - nickName: '', - gender: 0, - phoneNumber: '', - }, - showUnbindConfirm: false, - pickerOptions: [ - { - name: '男', - code: '1', - }, - { - name: '女', - code: '2', - }, - ], - typeVisible: false, - genderMap: ['', '男', '女'], - }, - onLoad() { - this.init(); - }, - init() { - this.fetchData(); - }, - fetchData() { - fetchPerson().then((personInfo) => { - this.setData({ - personInfo, - 'personInfo.phoneNumber': phoneEncryption(personInfo.phoneNumber), - }); - }); - }, - onClickCell({ currentTarget }) { - const { dataset } = currentTarget; - const { nickName } = this.data.personInfo; - - switch (dataset.type) { - case 'gender': - this.setData({ - typeVisible: true, - }); - break; - case 'name': - wx.navigateTo({ - url: `/pages/usercenter/name-edit/index?name=${nickName}`, - }); - break; - case 'avatarUrl': - this.toModifyAvatar(); - break; - default: { - break; - } - } - }, - onClose() { - this.setData({ - typeVisible: false, - }); - }, - onConfirm(e) { - const { value } = e.detail; - this.setData( - { - typeVisible: false, - 'personInfo.gender': value, - }, - () => { - Toast({ - context: this, - selector: '#t-toast', - message: '设置成功', - theme: 'success', - }); - }, - ); - }, - async toModifyAvatar() { - try { - const tempFilePath = await new Promise((resolve, reject) => { - wx.chooseImage({ - count: 1, - sizeType: ['compressed'], - sourceType: ['album', 'camera'], - success: (res) => { - const { path, size } = res.tempFiles[0]; - if (size <= 10485760) { - resolve(path); - } else { - reject({ errMsg: '图片大小超出限制,请重新上传' }); - } - }, - fail: (err) => reject(err), - }); - }); - const tempUrlArr = tempFilePath.split('/'); - const tempFileName = tempUrlArr[tempUrlArr.length - 1]; - Toast({ - context: this, - selector: '#t-toast', - message: `已选择图片-${tempFileName}`, - theme: 'success', - }); - } catch (error) { - if (error.errMsg === 'chooseImage:fail cancel') return; - Toast({ - context: this, - selector: '#t-toast', - message: error.errMsg || error.msg || '修改头像出错了', - theme: 'fail', - }); - } - }, -}); diff --git a/pages/usercenter/person-info/index.json b/pages/usercenter/person-info/index.json deleted file mode 100644 index e63dcc5..0000000 --- a/pages/usercenter/person-info/index.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "navigationBarTitleText": "个人资料", - "usingComponents": { - "t-cell-group": "tdesign-miniprogram/cell-group/cell-group", - "t-cell": "tdesign-miniprogram/cell/cell", - "t-button": "tdesign-miniprogram/button/button", - "t-image": "/components/webp-image/index", - "t-dialog": "tdesign-miniprogram/dialog/dialog", - "t-toast": "tdesign-miniprogram/toast/toast", - "t-select-picker": "../components/ui-select-picker/index" - } -} \ No newline at end of file diff --git a/pages/usercenter/person-info/index.wxml b/pages/usercenter/person-info/index.wxml deleted file mode 100644 index 2e460b1..0000000 --- a/pages/usercenter/person-info/index.wxml +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - - - - - - 切换账号登录 - - - - - diff --git a/pages/usercenter/person-info/index.wxss b/pages/usercenter/person-info/index.wxss deleted file mode 100644 index e1b5ea1..0000000 --- a/pages/usercenter/person-info/index.wxss +++ /dev/null @@ -1,41 +0,0 @@ -:host { - background-color: #f5f5f5; -} -page view { - box-sizing: border-box; -} -.person-info__btn { - width: 100%; - border: 2rpx solid #ddd; - border-radius: 48rpx; - padding: 18rpx 0; - display: flex; - align-self: center; - justify-content: center; -} -.person-info__wrapper { - width: 100%; - padding: 0 32rpx; - padding-bottom: calc(env(safe-area-inset-bottom) + 20rpx); - position: absolute; - bottom: 0; - left: 0; -} - -.avatarUrl { - width: 80rpx; - height: 80rpx; - border-radius: 50%; - overflow: hidden; -} - -.t-class-confirm { - color: #fa550f !important; -} - -.person-info .order-group__left { - margin-right: 0; -} -.person-info .t-cell-class { - height: 112rpx; -} diff --git a/services/_utils/pdf.js b/services/_utils/pdf.js new file mode 100644 index 0000000..13173fc --- /dev/null +++ b/services/_utils/pdf.js @@ -0,0 +1,32 @@ +export function openPDF(path) { + wx.downloadFile({ + url: path, //示例的url地址 + success: function (resinfo) { + console.log("pdf协议文件已下载") + let path = resinfo.tempFilePath; + console.log(path, resinfo) + wx.openDocument({ + filePath: path, + fileType: 'pdf', + success: function (rest) { + console.log('打开文件成功') + console.log(rest); + }, + fail: function (error) { + wx.showToast({ + icon: 'none', + title: '打开文件失败' + }); + }, + }) + }, + fail: function (err) { + console.log('fail') + console.log(err) + wx.showToast({ + icon: 'none', + title: '下载文件失败' + }); + } + }) +} \ No newline at end of file diff --git a/services/activity/fetchActivity.js b/services/activity/fetchActivity.js deleted file mode 100644 index e9aefa6..0000000 --- a/services/activity/fetchActivity.js +++ /dev/null @@ -1,20 +0,0 @@ -import { config } from '../../config/index'; - -/** 获取活动列表 */ -function mockFetchActivity(ID = 0) { - const { delay } = require('../_utils/delay'); - const { getActivity } = require('../../model/activity'); - - return delay().then(() => getActivity(ID)); -} - -/** 获取活动列表 */ -export function fetchActivity(ID = 0) { - if (config.useMock) { - return mockFetchActivity(ID); - } - - return new Promise((resolve) => { - resolve('real api'); - }); -} diff --git a/services/activity/fetchActivityList.js b/services/activity/fetchActivityList.js deleted file mode 100644 index 2522aff..0000000 --- a/services/activity/fetchActivityList.js +++ /dev/null @@ -1,20 +0,0 @@ -import { config } from '../../config/index'; - -/** 获取活动列表 */ -function mockFetchActivityList(pageIndex = 1, pageSize = 20) { - const { delay } = require('../_utils/delay'); - const { getActivityList } = require('../../model/activities'); - - return delay().then(() => getActivityList(pageIndex, pageSize)); -} - -/** 获取活动列表 */ -export function fetchActivityList(pageIndex = 1, pageSize = 20) { - if (config.useMock) { - return mockFetchActivityList(pageIndex, pageSize); - } - - return new Promise((resolve) => { - resolve('real api'); - }); -} diff --git a/services/address/fetchAddress.js b/services/address/fetchAddress.js deleted file mode 100644 index 9525ab0..0000000 --- a/services/address/fetchAddress.js +++ /dev/null @@ -1,48 +0,0 @@ -import { config } from '../../config/index'; - -/** 获取收货地址 */ -function mockFetchDeliveryAddress(id) { - const { delay } = require('../_utils/delay'); - const { genAddress } = require('../../model/address'); - - return delay().then(() => genAddress(id)); -} - -/** 获取收货地址 */ -export function fetchDeliveryAddress(id = 0) { - if (config.useMock) { - return mockFetchDeliveryAddress(id); - } - - return new Promise((resolve) => { - resolve('real api'); - }); -} - -/** 获取收货地址列表 */ -function mockFetchDeliveryAddressList(len = 0) { - const { delay } = require('../_utils/delay'); - const { genAddressList } = require('../../model/address'); - - return delay().then(() => - genAddressList(len).map((address) => { - return { - ...address, - phoneNumber: address.phone, - address: `${address.provinceName}${address.cityName}${address.districtName}${address.detailAddress}`, - tag: address.addressTag, - }; - }), - ); -} - -/** 获取收货地址列表 */ -export function fetchDeliveryAddressList(len = 10) { - if (config.useMock) { - return mockFetchDeliveryAddressList(len); - } - - return new Promise((resolve) => { - resolve('real api'); - }); -} diff --git a/services/api/article.js b/services/api/article.js new file mode 100644 index 0000000..fd8d43b --- /dev/null +++ b/services/api/article.js @@ -0,0 +1,19 @@ +import { + request +} from './request' + +export function articleList(params) { + return request({ + path: '/system/article/list', + params: params, + method: 'GET' + }); +} + +export function articleQuery(params) { + return request({ + path: '/system/article', + params: params, + method: 'GET' + }); +} \ No newline at end of file diff --git a/services/api/request.js b/services/api/request.js index a5b0277..cd87a63 100644 --- a/services/api/request.js +++ b/services/api/request.js @@ -5,13 +5,29 @@ import { getToken, isLogin } from '../permission/login' + +const unsaveInterface = [ + '/wx/login', + '/system/article/list' +] + +function unsaveCheck(path) { + for (let index = 0; index < unsaveInterface.length; index++) { + const element = unsaveInterface[index]; + if (element == path) { + return false + } + } + return true +} + export function request({ path, params, method }) { return new Promise((resolve, reject) => { - if (getToken() == '' && path != '/wx/login') { + if (getToken() == '' && unsaveCheck(path)) { wx.showToast({ title: '请登录后再次尝试。', icon: 'error', diff --git a/services/api/session.js b/services/api/session.js index 8e88014..1777508 100644 --- a/services/api/session.js +++ b/services/api/session.js @@ -82,4 +82,12 @@ export function sessionChangeStandard(params) { params: params, method: 'GET' }); +} + +export function sessionAdditiveAdd(params) { + return request({ + path: '/session/additive/add', + params: params, + method: 'POST' + }); } \ No newline at end of file diff --git a/services/cart/cart.js b/services/cart/cart.js deleted file mode 100644 index d42f959..0000000 --- a/services/cart/cart.js +++ /dev/null @@ -1,20 +0,0 @@ -import { config } from '../../config/index'; - -/** 获取购物车mock数据 */ -function mockFetchCartGroupData(params) { - const { delay } = require('../_utils/delay'); - const { genCartGroupData } = require('../../model/cart'); - - return delay().then(() => genCartGroupData(params)); -} - -/** 获取购物车数据 */ -export function fetchCartGroupData(params) { - if (config.useMock) { - return mockFetchCartGroupData(params); - } - - return new Promise((resolve) => { - resolve('real api'); - }); -} diff --git a/services/comments/fetchComments.js b/services/comments/fetchComments.js deleted file mode 100644 index 9bd1155..0000000 --- a/services/comments/fetchComments.js +++ /dev/null @@ -1,18 +0,0 @@ -import { config } from '../../config/index'; - -/** 获取商品评论 */ -function mockFetchComments(parmas) { - const { delay } = require('../_utils/delay'); - const { getGoodsAllComments } = require('../../model/comments'); - return delay().then(() => getGoodsAllComments(parmas)); -} - -/** 获取商品评论 */ -export function fetchComments(parmas) { - if (config.useMock) { - return mockFetchComments(parmas); - } - return new Promise((resolve) => { - resolve('real api'); - }); -} diff --git a/services/comments/fetchCommentsCount.js b/services/comments/fetchCommentsCount.js deleted file mode 100644 index cbb09d0..0000000 --- a/services/comments/fetchCommentsCount.js +++ /dev/null @@ -1,18 +0,0 @@ -import { config } from '../../config/index'; - -/** 获取商品评论数 */ -function mockFetchCommentsCount(ID = 0) { - const { delay } = require('../_utils/delay'); - const { getGoodsCommentsCount } = require('../../model/comments'); - return delay().then(() => getGoodsCommentsCount(ID)); -} - -/** 获取商品评论数 */ -export function fetchCommentsCount(ID = 0) { - if (config.useMock) { - return mockFetchCommentsCount(ID); - } - return new Promise((resolve) => { - resolve('real api'); - }); -} diff --git a/services/coupon/index.js b/services/coupon/index.js deleted file mode 100644 index a0010e0..0000000 --- a/services/coupon/index.js +++ /dev/null @@ -1,65 +0,0 @@ -import { config } from '../../config/index'; - -/** 获取优惠券列表 */ -function mockFetchCoupon(status) { - const { delay } = require('../_utils/delay'); - const { getCouponList } = require('../../model/coupon'); - return delay().then(() => getCouponList(status)); -} - -/** 获取优惠券列表 */ -export function fetchCouponList(status = 'default') { - if (config.useMock) { - return mockFetchCoupon(status); - } - return new Promise((resolve) => { - resolve('real api'); - }); -} - -/** 获取优惠券 详情 */ -function mockFetchCouponDetail(id, status) { - const { delay } = require('../_utils/delay'); - const { getCoupon } = require('../../model/coupon'); - const { genAddressList } = require('../../model/address'); - - return delay().then(() => { - const result = { - detail: getCoupon(id, status), - storeInfoList: genAddressList(), - }; - - result.detail.useNotes = `1个订单限用1张,除运费券外,不能与其它类型的优惠券叠加使用(运费券除外)\n2.仅适用于各区域正常售卖商品,不支持团购、抢购、预售类商品`; - result.detail.storeAdapt = `商城通用`; - - if (result.detail.type === 'price') { - result.detail.desc = `减免 ${result.detail.value / 100} 元`; - - if (result.detail.base) { - result.detail.desc += `,满${result.detail.base / 100}元可用`; - } - - result.detail.desc += '。'; - } else if (result.detail.type === 'discount') { - result.detail.desc = `${result.detail.value}折`; - - if (result.detail.base) { - result.detail.desc += `,满${result.detail.base / 100}元可用`; - } - - result.detail.desc += '。'; - } - - return result; - }); -} - -/** 获取优惠券 详情 */ -export function fetchCouponDetail(id, status = 'default') { - if (config.useMock) { - return mockFetchCouponDetail(id, status); - } - return new Promise((resolve) => { - resolve('real api'); - }); -} diff --git a/services/good/comments/fetchCommentDetail.js b/services/good/comments/fetchCommentDetail.js deleted file mode 100644 index fce338d..0000000 --- a/services/good/comments/fetchCommentDetail.js +++ /dev/null @@ -1,20 +0,0 @@ -import { config } from '../../../config/index'; -import { queryCommentDetail } from '../../../model/comments/queryDetail'; -/** 获取商品评价数据 */ -function mockQueryCommentDetail(params) { - const { delay } = require('../../_utils/delay'); - const data = queryCommentDetail(params); - return delay().then(() => { - return data; - }); -} - -/** 获取评价详情 */ -export function getCommentDetail(params) { - if (config.useMock) { - return mockQueryCommentDetail(params); - } - return new Promise((resolve) => { - resolve('real api'); - }); -} diff --git a/services/good/featchSearchResult.js b/services/good/featchSearchResult.js deleted file mode 100644 index 5b42851..0000000 --- a/services/good/featchSearchResult.js +++ /dev/null @@ -1,38 +0,0 @@ -/* eslint-disable no-param-reassign */ -import { config } from '../../config/index'; - -/** 获取搜索历史 */ -function mockSearchResult(params) { - const { delay } = require('../_utils/delay'); - const { getSearchResult } = require('../../model/search'); - - const data = getSearchResult(params); - - if (data.spuList.length) { - data.spuList.forEach((item) => { - item.spuId = item.spuId; - item.thumb = item.primaryImage; - item.title = item.title; - item.price = item.minSalePrice; - item.originPrice = item.maxLinePrice; - if (item.spuTagList) { - item.tags = item.spuTagList.map((tag) => ({ title: tag.title })); - } else { - item.tags = []; - } - }); - } - return delay().then(() => { - return data; - }); -} - -/** 获取搜索历史 */ -export function getSearchResult(params) { - if (config.useMock) { - return mockSearchResult(params); - } - return new Promise((resolve) => { - resolve('real api'); - }); -} diff --git a/services/good/fetchCategoryList.js b/services/good/fetchCategoryList.js deleted file mode 100644 index adf6ba4..0000000 --- a/services/good/fetchCategoryList.js +++ /dev/null @@ -1,18 +0,0 @@ -import { config } from '../../config/index'; - -/** 获取商品列表 */ -function mockFetchGoodCategory() { - const { delay } = require('../_utils/delay'); - const { getCategoryList } = require('../../model/category'); - return delay().then(() => getCategoryList()); -} - -/** 获取商品列表 */ -export function getCategoryList() { - if (config.useMock) { - return mockFetchGoodCategory(); - } - return new Promise((resolve) => { - resolve('real api'); - }); -} diff --git a/services/good/fetchGood.js b/services/good/fetchGood.js deleted file mode 100644 index 7a196d4..0000000 --- a/services/good/fetchGood.js +++ /dev/null @@ -1,18 +0,0 @@ -import { config } from '../../config/index'; - -/** 获取商品列表 */ -function mockFetchGood(ID = 0) { - const { delay } = require('../_utils/delay'); - const { genGood } = require('../../model/good'); - return delay().then(() => genGood(ID)); -} - -/** 获取商品列表 */ -export function fetchGood(ID = 0) { - if (config.useMock) { - return mockFetchGood(ID); - } - return new Promise((resolve) => { - resolve('real api'); - }); -} diff --git a/services/good/fetchGoods.js b/services/good/fetchGoods.js deleted file mode 100644 index 16618c8..0000000 --- a/services/good/fetchGoods.js +++ /dev/null @@ -1,29 +0,0 @@ -import { config } from '../../config/index'; - -/** 获取商品列表 */ -function mockFetchGoodsList(pageIndex = 1, pageSize = 20) { - const { delay } = require('../_utils/delay'); - const { getGoodsList } = require('../../model/goods'); - return delay().then(() => - getGoodsList(pageIndex, pageSize).map((item) => { - return { - spuId: item.spuId, - thumb: item.primaryImage, - title: item.title, - price: item.minSalePrice, - originPrice: item.maxLinePrice, - tags: item.spuTagList.map((tag) => tag.title), - }; - }), - ); -} - -/** 获取商品列表 */ -export function fetchGoodsList(pageIndex = 1, pageSize = 20) { - if (config.useMock) { - return mockFetchGoodsList(pageIndex, pageSize); - } - return new Promise((resolve) => { - resolve('real api'); - }); -} diff --git a/services/good/fetchGoodsDetailsComments.js b/services/good/fetchGoodsDetailsComments.js deleted file mode 100644 index 95a11c4..0000000 --- a/services/good/fetchGoodsDetailsComments.js +++ /dev/null @@ -1,37 +0,0 @@ -import { config } from '../../config/index'; - -/** 获取商品详情页评论数 */ -function mockFetchGoodDetailsCommentsCount(spuId = 0) { - const { delay } = require('../_utils/delay'); - const { - getGoodsDetailsCommentsCount, - } = require('../../model/detailsComments'); - return delay().then(() => getGoodsDetailsCommentsCount(spuId)); -} - -/** 获取商品详情页评论数 */ -export function getGoodsDetailsCommentsCount(spuId = 0) { - if (config.useMock) { - return mockFetchGoodDetailsCommentsCount(spuId); - } - return new Promise((resolve) => { - resolve('real api'); - }); -} - -/** 获取商品详情页评论 */ -function mockFetchGoodDetailsCommentList(spuId = 0) { - const { delay } = require('../_utils/delay'); - const { getGoodsDetailsComments } = require('../../model/detailsComments'); - return delay().then(() => getGoodsDetailsComments(spuId)); -} - -/** 获取商品详情页评论 */ -export function getGoodsDetailsCommentList(spuId = 0) { - if (config.useMock) { - return mockFetchGoodDetailsCommentList(spuId); - } - return new Promise((resolve) => { - resolve('real api'); - }); -} diff --git a/services/good/fetchGoodsList.js b/services/good/fetchGoodsList.js deleted file mode 100644 index 1650b9b..0000000 --- a/services/good/fetchGoodsList.js +++ /dev/null @@ -1,39 +0,0 @@ -/* eslint-disable no-param-reassign */ -import { config } from '../../config/index'; - -/** 获取商品列表 */ -function mockFetchGoodsList(params) { - const { delay } = require('../_utils/delay'); - const { getSearchResult } = require('../../model/search'); - - const data = getSearchResult(params); - - if (data.spuList.length) { - data.spuList.forEach((item) => { - item.spuId = item.spuId; - item.thumb = item.primaryImage; - item.title = item.title; - item.price = item.minSalePrice; - item.originPrice = item.maxLinePrice; - item.desc = ''; - if (item.spuTagList) { - item.tags = item.spuTagList.map((tag) => tag.title); - } else { - item.tags = []; - } - }); - } - return delay().then(() => { - return data; - }); -} - -/** 获取商品列表 */ -export function fetchGoodsList(params) { - if (config.useMock) { - return mockFetchGoodsList(params); - } - return new Promise((resolve) => { - resolve('real api'); - }); -} diff --git a/services/good/fetchSearchHistory.js b/services/good/fetchSearchHistory.js deleted file mode 100644 index 3a73963..0000000 --- a/services/good/fetchSearchHistory.js +++ /dev/null @@ -1,35 +0,0 @@ -import { config } from '../../config/index'; - -/** 获取搜索历史 */ -function mockSearchHistory() { - const { delay } = require('../_utils/delay'); - const { getSearchHistory } = require('../../model/search'); - return delay().then(() => getSearchHistory()); -} - -/** 获取搜索历史 */ -export function getSearchHistory() { - if (config.useMock) { - return mockSearchHistory(); - } - return new Promise((resolve) => { - resolve('real api'); - }); -} - -/** 获取搜索历史 */ -function mockSearchPopular() { - const { delay } = require('../_utils/delay'); - const { getSearchPopular } = require('../../model/search'); - return delay().then(() => getSearchPopular()); -} - -/** 获取搜索历史 */ -export function getSearchPopular() { - if (config.useMock) { - return mockSearchPopular(); - } - return new Promise((resolve) => { - resolve('real api'); - }); -} diff --git a/services/home/home.js b/services/home/home.js index 7d4469d..6e541c4 100644 --- a/services/home/home.js +++ b/services/home/home.js @@ -1,42 +1,19 @@ -import { config, cdnBase } from '../../config/index'; +import { + config, + cdnBase +} from '../../config/index'; /** 获取首页数据 */ function mockFetchHome() { - const { delay } = require('../_utils/delay'); - const { genSwiperImageList } = require('../../model/swiper'); + const { + delay + } = require('../_utils/delay'); + const { + genSwiperImageList + } = require('../../model/swiper'); return delay().then(() => { return { swiper: genSwiperImageList(), - tabList: [ - { - text: '精选推荐', - key: 0, - }, - { - text: '夏日防晒', - key: 1, - }, - { - text: '二胎大作战', - key: 2, - }, - { - text: '人气榜', - key: 3, - }, - { - text: '好评榜', - key: 4, - }, - { - text: 'RTX 30', - key: 5, - }, - { - text: '手机也疯狂', - key: 6, - }, - ], activityImg: `${cdnBase}/activity/banner.png`, }; }); @@ -50,4 +27,4 @@ export function fetchHome() { return new Promise((resolve) => { resolve('real api'); }); -} +} \ No newline at end of file diff --git a/services/order/applyService.js b/services/order/applyService.js deleted file mode 100644 index c66930a..0000000 --- a/services/order/applyService.js +++ /dev/null @@ -1,70 +0,0 @@ -import { config } from '../../config/index'; - -/** 获取售后单mock数据 */ -function mockFetchRightsPreview(params) { - const { delay } = require('../_utils/delay'); - const { genRightsPreview } = require('../../model/order/applyService'); - - return delay().then(() => genRightsPreview(params)); -} - -/** 获取售后单数据 */ -export function fetchRightsPreview(params) { - if (config.useMock) { - return mockFetchRightsPreview(params); - } - - return new Promise((resolve) => { - resolve('real api'); - }); -} - -/** 确认收货 */ -export function dispatchConfirmReceived() { - if (config.useMock) { - const { delay } = require('../_utils/delay'); - return delay(); - } - - return new Promise((resolve) => { - resolve('real api'); - }); -} - -/** 获取可选的mock售后原因列表 */ -function mockFetchApplyReasonList(params) { - const { delay } = require('../_utils/delay'); - const { genApplyReasonList } = require('../../model/order/applyService'); - - return delay().then(() => genApplyReasonList(params)); -} - -/** 获取可选的售后原因列表 */ -export function fetchApplyReasonList(params) { - if (config.useMock) { - return mockFetchApplyReasonList(params); - } - - return new Promise((resolve) => { - resolve('real api'); - }); -} - -/** 发起mock售后申请 */ -function mockDispatchApplyService(params) { - const { delay } = require('../_utils/delay'); - const { applyService } = require('../../model/order/applyService'); - - return delay().then(() => applyService(params)); -} - -/** 发起售后申请 */ -export function dispatchApplyService(params) { - if (config.useMock) { - return mockDispatchApplyService(params); - } - - return new Promise((resolve) => { - resolve('real api'); - }); -} diff --git a/services/order/orderConfirm.js b/services/order/orderConfirm.js deleted file mode 100644 index 4d34744..0000000 --- a/services/order/orderConfirm.js +++ /dev/null @@ -1,69 +0,0 @@ -import { config } from '../../config/index'; -import { mockIp, mockReqId } from '../../utils/mock'; - -/** 获取结算mock数据 */ -function mockFetchSettleDetail(params) { - const { delay } = require('../_utils/delay'); - const { genSettleDetail } = require('../../model/order/orderConfirm'); - - return delay().then(() => genSettleDetail(params)); -} - -/** 提交mock订单 */ -function mockDispatchCommitPay() { - const { delay } = require('../_utils/delay'); - - return delay().then(() => ({ - data: { - isSuccess: true, - tradeNo: '350930961469409099', - payInfo: '{}', - code: null, - transactionId: 'E-200915180100299000', - msg: null, - interactId: '15145', - channel: 'wechat', - limitGoodsList: null, - }, - code: 'Success', - msg: null, - requestId: mockReqId(), - clientIp: mockIp(), - rt: 891, - success: true, - })); -} - -/** 获取结算数据 */ -export function fetchSettleDetail(params) { - if (config.useMock) { - return mockFetchSettleDetail(params); - } - - return new Promise((resolve) => { - resolve('real api'); - }); -} - -/* 提交订单 */ -export function dispatchCommitPay(params) { - if (config.useMock) { - return mockDispatchCommitPay(params); - } - - return new Promise((resolve) => { - resolve('real api'); - }); -} - -/** 开发票 */ -export function dispatchSupplementInvoice() { - if (config.useMock) { - const { delay } = require('../_utils/delay'); - return delay(); - } - - return new Promise((resolve) => { - resolve('real api'); - }); -} diff --git a/services/order/orderDetail.js b/services/order/orderDetail.js deleted file mode 100644 index 3e7d797..0000000 --- a/services/order/orderDetail.js +++ /dev/null @@ -1,39 +0,0 @@ -import { config } from '../../config/index'; - -/** 获取订单详情mock数据 */ -function mockFetchOrderDetail(params) { - const { delay } = require('../_utils/delay'); - const { genOrderDetail } = require('../../model/order/orderDetail'); - - return delay().then(() => genOrderDetail(params)); -} - -/** 获取订单详情数据 */ -export function fetchOrderDetail(params) { - if (config.useMock) { - return mockFetchOrderDetail(params); - } - - return new Promise((resolve) => { - resolve('real api'); - }); -} - -/** 获取客服mock数据 */ -function mockFetchBusinessTime(params) { - const { delay } = require('../_utils/delay'); - const { genBusinessTime } = require('../../model/order/orderDetail'); - - return delay().then(() => genBusinessTime(params)); -} - -/** 获取客服数据 */ -export function fetchBusinessTime(params) { - if (config.useMock) { - return mockFetchBusinessTime(params); - } - - return new Promise((resolve) => { - resolve('real api'); - }); -} diff --git a/services/order/orderList.js b/services/order/orderList.js deleted file mode 100644 index f4a9e7a..0000000 --- a/services/order/orderList.js +++ /dev/null @@ -1,39 +0,0 @@ -import { config } from '../../config/index'; - -/** 获取订单列表mock数据 */ -function mockFetchOrders(params) { - const { delay } = require('../_utils/delay'); - const { genOrders } = require('../../model/order/orderList'); - - return delay(200).then(() => genOrders(params)); -} - -/** 获取订单列表数据 */ -export function fetchOrders(params) { - if (config.useMock) { - return mockFetchOrders(params); - } - - return new Promise((resolve) => { - resolve('real api'); - }); -} - -/** 获取订单列表mock数据 */ -function mockFetchOrdersCount(params) { - const { delay } = require('../_utils/delay'); - const { genOrdersCount } = require('../../model/order/orderList'); - - return delay().then(() => genOrdersCount(params)); -} - -/** 获取订单列表统计 */ -export function fetchOrdersCount(params) { - if (config.useMock) { - return mockFetchOrdersCount(params); - } - - return new Promise((resolve) => { - resolve('real api'); - }); -} diff --git a/services/order/orderSubmitComment.js b/services/order/orderSubmitComment.js deleted file mode 100644 index 5e3ea36..0000000 --- a/services/order/orderSubmitComment.js +++ /dev/null @@ -1,22 +0,0 @@ -import { config } from '../../config/index'; - -/** 获取评价商品 */ -function mockGetGoods(parameter) { - const { delay } = require('../_utils/delay'); - const { getGoods } = require('../../model/submitComment'); - const data = getGoods(parameter); - - return delay().then(() => { - return data; - }); -} - -/** 获取评价商品 */ -export function getGoods(parameter) { - if (config.useMock) { - return mockGetGoods(parameter); - } - return new Promise((resolve) => { - resolve('real api'); - }); -} diff --git a/services/promotion/detail.js b/services/promotion/detail.js deleted file mode 100644 index 841f723..0000000 --- a/services/promotion/detail.js +++ /dev/null @@ -1,18 +0,0 @@ -import { config } from '../../config/index'; - -/** 获取商品列表 */ -function mockFetchPromotion(ID = 0) { - const { delay } = require('../_utils/delay'); - const { getPromotion } = require('../../model/promotion'); - return delay().then(() => getPromotion(ID)); -} - -/** 获取商品列表 */ -export function fetchPromotion(ID = 0) { - if (config.useMock) { - return mockFetchPromotion(ID); - } - return new Promise((resolve) => { - resolve('real api'); - }); -} diff --git a/services/usercenter/fetchPerson.js b/services/usercenter/fetchPerson.js deleted file mode 100644 index bd31178..0000000 --- a/services/usercenter/fetchPerson.js +++ /dev/null @@ -1,28 +0,0 @@ -import { config } from '../../config/index'; - -/** 获取个人中心信息 */ -function mockFetchPerson() { - const { delay } = require('../_utils/delay'); - const { genSimpleUserInfo } = require('../../model/usercenter'); - const { genAddress } = require('../../model/address'); - const address = genAddress(); - return delay().then(() => ({ - ...genSimpleUserInfo(), - address: { - provinceName: address.provinceName, - provinceCode: address.provinceCode, - cityName: address.cityName, - cityCode: address.cityCode, - }, - })); -} - -/** 获取个人中心信息 */ -export function fetchPerson() { - if (config.useMock) { - return mockFetchPerson(); - } - return new Promise((resolve) => { - resolve('real api'); - }); -} diff --git a/services/usercenter/fetchUsercenter.js b/services/usercenter/fetchUsercenter.js deleted file mode 100644 index b187644..0000000 --- a/services/usercenter/fetchUsercenter.js +++ /dev/null @@ -1,18 +0,0 @@ -import { config } from '../../config/index'; - -/** 获取个人中心信息 */ -function mockFetchUserCenter() { - const { delay } = require('../_utils/delay'); - const { genUsercenter } = require('../../model/usercenter'); - return delay(200).then(() => genUsercenter()); -} - -/** 获取个人中心信息 */ -export function fetchUserCenter() { - if (config.useMock) { - return mockFetchUserCenter(); - } - return new Promise((resolve) => { - resolve('real api'); - }); -} diff --git a/utils/addressParse.js b/utils/addressParse.js deleted file mode 100644 index 23b6cd0..0000000 --- a/utils/addressParse.js +++ /dev/null @@ -1,25 +0,0 @@ -import { areaData } from '../config/index'; - -const addressParse = (provinceName, cityName, countryName) => { - return new Promise((resolve, reject) => { - try { - const province = areaData.find((v) => v.name === provinceName); - const { code: provinceCode } = province; - const city = province.children.find((v) => v.name === cityName); - const { code: cityCode } = city; - const country = city.children.find((v) => v.name === countryName); - const { code: districtCode } = country; - resolve({ - provinceCode, - cityCode, - districtCode, - }); - } catch (error) { - reject('地址解析失败'); - } - }); -}; - -module.exports = { - addressParse, -}; diff --git a/utils/getPermission.js b/utils/getPermission.js deleted file mode 100644 index e6a64cb..0000000 --- a/utils/getPermission.js +++ /dev/null @@ -1,45 +0,0 @@ -const getPermission = ({ code, name }) => { - return new Promise((resolve, reject) => { - wx.getSetting({ - success: (res) => { - if (res.authSetting[code] === false) { - wx.showModal({ - title: `获取${name}失败`, - content: `获取${name}失败,请在【右上角】-小程序【设置】项中,将【${name}】开启。`, - confirmText: '去设置', - confirmColor: '#FA550F', - cancelColor: '取消', - success(res) { - if (res.confirm) { - wx.openSetting({ - success(settinRes) { - if (settinRes.authSetting[code] === true) { - resolve(); - } else { - console.warn('用户未打开权限', name, code); - reject(); - } - }, - }); - } else { - reject(); - } - }, - fail() { - reject(); - }, - }); - } else { - resolve(); - } - }, - fail() { - reject(); - }, - }); - }); -}; - -module.exports = { - getPermission, -}; diff --git a/utils/mock.js b/utils/mock.js deleted file mode 100644 index 27f13e8..0000000 --- a/utils/mock.js +++ /dev/null @@ -1,51 +0,0 @@ -/** - * 随机打散字符串 - * @param {number} n 长度 - * @param {string} str 字符串 - * @returns - */ -function generateMixed(n, str) { - var res = ''; - for (var i = 0; i < n; i++) { - var id = Math.ceil(Math.random() * 35); - res += str[id]; - } - return res; -} - -/** - * 生成随机数 - * @param {number} min 最小值 - * @param {number} max 最大值 - * @returns - */ -function getRandomNum(min, max) { - var range = max - min; - var rand = Math.random(); - return min + Math.round(rand * range); -} - -/** - * 生成随机IP - * @returns - */ -function mockIp() { - return `10.${getRandomNum(1, 254)}.${getRandomNum(1, 254)}.${getRandomNum( - 1, - 254, - )}`; -} - -function mockReqId() { - return `${getRandomNum(100000, 999999)}.${new Date().valueOf()}${getRandomNum( - 1000, - 9999, - )}.${getRandomNum(10000000, 99999999)}`; -} - -module.exports = { - generateMixed, - mockIp, - mockReqId, - getRandomNum, -}; diff --git a/utils/util.js b/utils/util.js deleted file mode 100644 index 4f0ec66..0000000 --- a/utils/util.js +++ /dev/null @@ -1,133 +0,0 @@ -import dayjs from 'dayjs'; - -const formatTime = (date, template) => dayjs(date).format(template); - -/** - * 格式化价格数额为字符串 - * 可对小数部分进行填充,默认不填充 - * @param price 价格数额,以分为单位! - * @param fill 是否填充小数部分 0-不填充 1-填充第一位小数 2-填充两位小数 - */ -function priceFormat(price, fill = 0) { - if (isNaN(price) || price === null || price === Infinity) { - return price; - } - - let priceFormatValue = Math.round(parseFloat(`${price}`) * 10 ** 8) / 10 ** 8; // 恢复精度丢失 - priceFormatValue = `${Math.ceil(priceFormatValue) / 100}`; // 向上取整,单位转换为元,转换为字符串 - if (fill > 0) { - // 补充小数位数 - if (priceFormatValue.indexOf('.') === -1) { - priceFormatValue = `${priceFormatValue}.`; - } - const n = fill - priceFormatValue.split('.')[1]?.length; - for (let i = 0; i < n; i++) { - priceFormatValue = `${priceFormatValue}0`; - } - } - return priceFormatValue; -} - -/** - * 获取cdn裁剪后链接 - * - * @param {string} url 基础链接 - * @param {number} width 宽度,单位px - * @param {number} [height] 可选,高度,不填时与width同值 - */ -const cosThumb = (url, width, height = width) => { - if (url.indexOf('?') > -1) { - return url; - } - - if (url.indexOf('http://') === 0) { - url = url.replace('http://', 'https://'); - } - - return `${url}?imageMogr2/thumbnail/${~~width}x${~~height}`; -}; - -const get = (source, paths, defaultValue) => { - if (typeof paths === 'string') { - paths = paths - .replace(/\[/g, '.') - .replace(/\]/g, '') - .split('.') - .filter(Boolean); - } - const { length } = paths; - let index = 0; - while (source != null && index < length) { - source = source[paths[index++]]; - } - return source === undefined || index === 0 ? defaultValue : source; -}; -let systemWidth = 0; -/** 获取系统宽度,为了减少启动消耗所以在函数里边做初始化 */ -export const loadSystemWidth = () => { - if (systemWidth) { - return systemWidth; - } - - try { - ({ screenWidth: systemWidth, pixelRatio } = wx.getSystemInfoSync()); - } catch (e) { - systemWidth = 0; - } - return systemWidth; -}; - -/** - * 转换rpx为px - * - * @description - * 什么时候用? - * - 布局(width: 172rpx)已经写好, 某些组件只接受px作为style或者prop指定 - * - */ -const rpx2px = (rpx, round = false) => { - loadSystemWidth(); - - // px / systemWidth = rpx / 750 - const result = (rpx * systemWidth) / 750; - - if (round) { - return Math.floor(result); - } - - return result; -}; - -/** - * 手机号码*加密函数 - * @param {string} phone 电话号 - * @returns - */ -const phoneEncryption = (phone) => { - return phone.replace(/(\d{3})\d{4}(\d{4})/, '$1****$2'); -}; - -// 内置手机号正则字符串 -const innerPhoneReg = - '^1(?:3\\d|4[4-9]|5[0-35-9]|6[67]|7[0-8]|8\\d|9\\d)\\d{8}$'; - -/** - * 手机号正则校验 - * @param phone 手机号 - * @param phoneReg 正则字符串 - * @returns true - 校验通过 false - 校验失败 - */ -const phoneRegCheck = (phone) => { - const phoneRegExp = new RegExp(innerPhoneReg); - return phoneRegExp.test(phone); -}; - -module.exports = { - formatTime, - priceFormat, - cosThumb, - get, - rpx2px, - phoneEncryption, - phoneRegCheck, -};