diff --git a/app.js b/app.js index cc0050c..693ded8 100644 --- a/app.js +++ b/app.js @@ -1,5 +1,6 @@ const baseUrl = "http://localhost:8080" + App({ onLaunch: function () { console.log("App Launch") diff --git a/page/component/address/address.js b/page/component/address/address.js index a0d046d..8fc2029 100644 --- a/page/component/address/address.js +++ b/page/component/address/address.js @@ -16,7 +16,7 @@ Page({ url: baseUrl + "/user/getById", method: "GET", data: { - id: 1, + id: 3, }, success(res) { self.setData({ diff --git a/page/component/details/details.js b/page/component/details/details.js index 94b96c2..334d23f 100644 --- a/page/component/details/details.js +++ b/page/component/details/details.js @@ -3,10 +3,10 @@ Page({ onLoad: function (options) { const goods = { id: options.id, - title: options.title, - price: options.price, - detail: options.detail, - image: decodeURIComponent(options.image).split(','), + goodName: options.goodName, + goodPrice: options.goodPrice, + goodDetail: options.goodDetail, + goodImage: decodeURIComponent(options.goodImage).split(','), }; this.setData({ goods }); }, diff --git a/page/component/details/details.json b/page/component/details/details.json index 9e26dfe..1404602 100644 --- a/page/component/details/details.json +++ b/page/component/details/details.json @@ -1 +1,7 @@ -{} \ No newline at end of file +{ + "usingComponents": { + "t-button": "tdesign-miniprogram/button/button", + "t-tag": "tdesign-miniprogram/tag/tag", + "t-icon": "tdesign-miniprogram/icon/icon" + } +} \ No newline at end of file diff --git a/page/component/details/details.wxml b/page/component/details/details.wxml index 75b65d9..c926bba 100644 --- a/page/component/details/details.wxml +++ b/page/component/details/details.wxml @@ -2,7 +2,7 @@ --> - - - - 数量 {{num}} - + - - - - - + + + + ¥ {{goods.goodPrice}} + {{goods.goodName}} + + + + + + + + + + + + + 首页 + + 立即购买 + + + + + + + + + - {{goods.goodName}} - ¥ {{goods.goodPrice}} - + \ No newline at end of file diff --git a/page/component/details/details.wxss b/page/component/details/details.wxss index d973d9c..cb875dc 100644 --- a/page/component/details/details.wxss +++ b/page/component/details/details.wxss @@ -3,9 +3,8 @@ .goods-box { position: relative; padding: 40rpx 45rpx; - text-align: center; color: #454552; - border-bottom: 30rpx solid #ededed; + /* border-bottom: 30rpx solid #ededed; */ } .goods-box .goods-thumb { @@ -125,10 +124,13 @@ .goods-operation-num { width: 160rpx; } -.banner{ + +.banner { height: 240px; padding-bottom: 20px; + text-align: center; } + .goods-operation-add { font-weight: bold; width: 80rpx; @@ -156,14 +158,61 @@ margin-top: 50px; } +.goods-info { + display: flex; + justify-content: space-between; + align-items: center; +} + +.left-section { + display: flex; + flex-direction: column; +} + .goods-title { font-size: 40rpx; - margin-bottom: 30rpx; - margin-top: 50px; } .goods-price { - font-size: 40rpx; + font-size: 50rpx; + font-weight: bold; + color: red; +} + +.right-section { + display: flex; + align-items: center; +} + +.btn-icon { + font-size: 20rpx; +} + +.share-text { + padding-left: 8rpx; + padding-top: 8rpx; + font-size: 20rpx; + line-height: 24rpx; +} +.goods-buy { + position: fixed; /* 固定在页面底部 */ + bottom: 0; /* 距离底部为0 */ + left: 0; /* 左侧对齐 */ + width: 100%; /* 宽度占满屏幕 */ + display: flex; + justify-content: space-between; + padding: 10rpx 20rpx; /* 添加一些内边距 */ + background-color: #fff; /* 设置背景颜色 */ + box-shadow: 0 -2rpx 10rpx rgba(0, 0, 0, 0.1); /* 添加一个阴影 */ +} + +.left-return { + font-size: 32px; + flex-grow: 0; /* 防止按钮拉伸 */ +} + +.right-buy { + flex-grow: 0; /* 防止按钮拉伸 */ } .goods-tab-nav { diff --git a/page/component/index.js b/page/component/index.js index cfc3454..b63b6ab 100644 --- a/page/component/index.js +++ b/page/component/index.js @@ -6,13 +6,7 @@ Page({ autoplay: false, interval: 3000, duration: 800, - goods: { - id: 1, - image: ["/image/beizi1.jpg", "/image/beizi1.jpg"], - title: "床上用品六件套", - price: 220, - detail: "被子、褥子、枕头、三件套", - }, + goods: {}, }, onLoad() { var self = this @@ -26,7 +20,6 @@ Page({ self.setData({ goods: res.data.data, }) - console.log(res, "res", res.data.data) }, }) }, diff --git a/page/component/index.wxml b/page/component/index.wxml index 968fa04..6bb4604 100644 --- a/page/component/index.wxml +++ b/page/component/index.wxml @@ -38,16 +38,15 @@ 大雄出品 - - - + + + - {{item.goodName}} {{item.goodPrice}}¥ + {{item.goodName}} - - - - + + +