From 4d7db88e3c417417c2c77bd859a7c0b78451859b Mon Sep 17 00:00:00 2001 From: lwh <2679599887@qq.com> Date: Thu, 20 Jul 2023 16:14:29 +0800 Subject: [PATCH] =?UTF-8?q?feat=20=E6=B7=BB=E5=8A=A0=E5=BA=97=E9=93=BA?= =?UTF-8?q?=E8=AF=A6=E6=83=85=E5=BC=B9=E7=AA=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/shop/all-goods/index.js | 30 +++++++++++++-- pages/shop/all-goods/index.json | 4 +- pages/shop/all-goods/index.wxml | 30 ++++++++++++--- pages/shop/all-goods/index.wxss | 67 +++++++++++++++++++++++++++++++++ services/shop/fetchShop.js | 22 +++++++++++ 5 files changed, 143 insertions(+), 10 deletions(-) create mode 100644 services/shop/fetchShop.js diff --git a/pages/shop/all-goods/index.js b/pages/shop/all-goods/index.js index a44bac6..45cda4b 100644 --- a/pages/shop/all-goods/index.js +++ b/pages/shop/all-goods/index.js @@ -1,6 +1,9 @@ import { fetchGoodsList -} from '../../../services/good/fetchGoodsList'; +} from '~/services/good/fetchGoodsList'; +import { + fetchShop +} from '~/services/shop/fetchShop'; import Toast from 'tdesign-miniprogram/toast/index'; const image = 'https://tdesign.gtimg.com/miniprogram/images/example2.png'; @@ -31,8 +34,11 @@ Page({ loadMoreStatus: 0, loading: true, shopGuid: 0, + shopDetails: {}, - value: 'category', + visible: false, + + value: 'all', list: [{ value: 'all', label: '全部', @@ -173,6 +179,12 @@ Page({ loading: true, }); try { + // 获取店铺详情 + const shopResult = await fetchShop(params); + this.setData({ + shopDetails: shopResult + }) + const result = await fetchGoodsList(params); const code = 'Success'; const data = result; @@ -241,7 +253,7 @@ Page({ .selectAll('.title') .boundingClientRect((rects) => { this.offsetTopList = rects.map((item) => item.top); - console.log(this.offsetTopList,'123123123'); + console.log(this.offsetTopList, '123123123'); this.setData({ scrollTop: rects[sideBarIndex].top }); @@ -405,4 +417,16 @@ Page({ } }, + handlePopup(e) { + this.setData({ + visible: true + }, ); + }, + onVisibleChange(e) { + this.setData({ + visible: e.detail.visible, + }); + }, + + }); \ No newline at end of file diff --git a/pages/shop/all-goods/index.json b/pages/shop/all-goods/index.json index cf69f20..b311b20 100644 --- a/pages/shop/all-goods/index.json +++ b/pages/shop/all-goods/index.json @@ -13,6 +13,8 @@ "t-side-bar": "tdesign-miniprogram/side-bar/side-bar", "t-side-bar-item": "tdesign-miniprogram/side-bar-item/side-bar-item", "t-grid": "tdesign-miniprogram/grid/grid", - "t-grid-item": "tdesign-miniprogram/grid-item/grid-item" + "t-grid-item": "tdesign-miniprogram/grid-item/grid-item", + "t-back-top": "tdesign-miniprogram/back-top/back-top", + "t-popup": "tdesign-miniprogram/popup/popup" } } \ No newline at end of file diff --git a/pages/shop/all-goods/index.wxml b/pages/shop/all-goods/index.wxml index ec37ef1..6901920 100644 --- a/pages/shop/all-goods/index.wxml +++ b/pages/shop/all-goods/index.wxml @@ -1,15 +1,15 @@ - + - + - 三星官方旗舰店 - 已售:244万 - 三星手机官方旗舰店 + {{shopDetails.shopName}} + 已售:{{shopDetails.shopSalesOrderCount}} + {{shopDetails.shopIntro}} @@ -75,4 +75,22 @@ - \ No newline at end of file + + + + + 店铺详情 + + + + + {{shopDetails.shopName}} + 已售:{{shopDetails.shopSalesOrderCount}} + + + 店铺简介 + {{shopDetails.shopIntro}} + + + + \ No newline at end of file diff --git a/pages/shop/all-goods/index.wxss b/pages/shop/all-goods/index.wxss index ca4b942..7d16965 100644 --- a/pages/shop/all-goods/index.wxss +++ b/pages/shop/all-goods/index.wxss @@ -112,4 +112,71 @@ page .round-image { .side-bar-wrapper .image { width: 96rpx; height: 96rpx; +} + +.back-top{ + bottom: 15% !important; +} + +/* 店铺详情弹出层 */ +.shop-popup-box{ + height: 800rpx; + padding: 50rpx; + display: flex; + align-items: center; + flex-direction: column; + background-color: #f6f6f6; +} + +.shop-popup-title{ + font-size: 40rpx; + font-weight: bold; + letter-spacing: 5rpx; + margin-bottom: 80rpx; +} + +.shop-popup-content-box{ + width: 90%; + background-color: white; + padding: 35rpx; + border-radius: 40rpx; + position: relative; + display: flex; + flex-direction: column; + margin-bottom: 30rpx; +} + +.center{ + align-items: center; +} + +.shop-popup-img-box{ + width: 160rpx; + height: 160rpx; + border-radius: 50%; + overflow: hidden; + margin-top: -80rpx; + background-color: #fff; +} + +.shop-popup-img{ + width: 100%; + height: 100%; +} + +.shop-popup-name{ + font-size: 35rpx; + font-weight: bold; + margin: 30rpx 0; +} + +.shop-popup-sold-num{ + font-size: 28rpx; +} + +.shop-popup-intro-title{ + font-size: 30rpx; + font-weight: bold; + letter-spacing: 2rpx; + margin-bottom: 10rpx; } \ No newline at end of file diff --git a/services/shop/fetchShop.js b/services/shop/fetchShop.js new file mode 100644 index 0000000..f8d2d82 --- /dev/null +++ b/services/shop/fetchShop.js @@ -0,0 +1,22 @@ +import { + request +} from '../_utils/request'; + +/** 获取店铺详情 */ +export function fetchShop(parm) { + return new Promise((resolve, reject) => { + request({ + url: `ShopApi/getShopDetails`, + data: parm, + method: 'GET', + success: function (res) { + let data = res.data; + + resolve(data); + }, + fail: function (error) { + reject(error); + } + }); + }); +} \ No newline at end of file