From d626c479a920122963a56bcdd1577aab0a144186 Mon Sep 17 00:00:00 2001 From: weipengfei <2187978347@qq.com> Date: Mon, 29 Apr 2024 10:44:50 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E9=A1=B5=E9=9D=A2=E5=B8=83?= =?UTF-8?q?=E5=B1=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/user.js | 4 +- config/app.js | 2 +- pages.json | 156 +++++++++--------- pages/index/index.vue | 142 ++++++++++++---- pages/my/my.vue | 5 +- pagesOrder/addressEdit/addressEdit.vue | 13 +- pagesOrder/addressList/addressList.vue | 13 +- static/icon/cart.png | Bin 0 -> 2974 bytes unpackage/dist/dev/mp-weixin/app.json | 26 --- unpackage/dist/dev/mp-weixin/common/assets.js | 10 +- unpackage/dist/dev/mp-weixin/common/vendor.js | 2 + .../dev/mp-weixin/components/addressPopup.js | 4 +- .../dist/dev/mp-weixin/pages/cart/cart.js | 6 +- .../dist/dev/mp-weixin/pages/index/index.js | 84 ++++++---- .../dist/dev/mp-weixin/pages/index/index.json | 3 +- .../dist/dev/mp-weixin/pages/index/index.wxml | 2 +- .../dist/dev/mp-weixin/pages/index/index.wxss | 56 ++++++- .../dist/dev/mp-weixin/pages/login/login.js | 4 +- unpackage/dist/dev/mp-weixin/pages/my/my.js | 3 +- unpackage/dist/dev/mp-weixin/pages/my/my.wxml | 2 +- .../pagesOrder/addressEdit/addressEdit.js | 10 +- .../pagesOrder/addressList/addressList.js | 9 +- .../dev/mp-weixin/pagesOrder/detail/detail.js | 4 +- .../dist/dev/mp-weixin/project.config.json | 25 +-- 24 files changed, 367 insertions(+), 218 deletions(-) create mode 100644 static/icon/cart.png diff --git a/api/user.js b/api/user.js index 4e54b11..1789f21 100644 --- a/api/user.js +++ b/api/user.js @@ -23,10 +23,10 @@ export const addressDeleteApi = (data)=>{ // 地址列表 export const addressListsApi = (data)=>{ - return request.post('/user/address/lists', data); + return request.get('/user/address/lists', data); } // 地址详情 export const addressDetailApi = (data)=>{ - return request.post('/user/address/detail', data); + return request.get('/user/address/detail', data); } \ No newline at end of file diff --git a/config/app.js b/config/app.js index 8ec2177..f314d2a 100644 --- a/config/app.js +++ b/config/app.js @@ -6,7 +6,7 @@ let env = "dev" switch(env){ case 'prod': BASE_URL = '';break; - default: BASE_URL = 'http://192.168.1.9:8787'; + default: BASE_URL = 'http://192.168.1.21:8787'; } let HTTP_REQUEST_URL diff --git a/pages.json b/pages.json index 27b3e8b..515ed85 100644 --- a/pages.json +++ b/pages.json @@ -1,19 +1,19 @@ { "easycom": { - "autoscan": true, - // 注意一定要放在custom里,否则无效,https://ask.dcloud.net.cn/question/131175 - "custom": { - "^u--(.*)": "@/uni_modules/uview-plus/components/u-$1/u-$1.vue", - "^up-(.*)": "@/uni_modules/uview-plus/components/u-$1/u-$1.vue", - "^u-([^-].*)": "@/uni_modules/uview-plus/components/u-$1/u-$1.vue" - } - }, + "autoscan": true, + // 注意一定要放在custom里,否则无效,https://ask.dcloud.net.cn/question/131175 + "custom": { + "^u--(.*)": "@/uni_modules/uview-plus/components/u-$1/u-$1.vue", + "^up-(.*)": "@/uni_modules/uview-plus/components/u-$1/u-$1.vue", + "^u-([^-].*)": "@/uni_modules/uview-plus/components/u-$1/u-$1.vue" + } + }, "pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages { "path": "pages/index/index", "style": { "navigationBarTitleText": "购物", - "disableScroll": true , + "disableScroll": true, "navigationStyle": "custom" } }, @@ -22,7 +22,7 @@ "style": { "navigationBarTitleText": "登录", "enablePullDownRefresh": false, - + "navigationStyle": "custom" } }, @@ -42,87 +42,79 @@ "navigationStyle": "custom" } } - + ], - "subPackages": [ - { - "root": "pagesOrder", - "pages": [ - { - "path": "order/order", - "style": { - "navigationBarTitleText": "我的订单", - "enablePullDownRefresh": false - } - }, - { - "path" : "detail/detail", - "style" : - { - "navigationBarTitleText" : "", - "enablePullDownRefresh" : false - } - }, - { - "path" : "addressList/addressList", - "style" : - { - "navigationBarTitleText" : "地址管理", - "enablePullDownRefresh" : false - } - }, - { - "path" : "addressEdit/addressEdit", - "style" : - { - "navigationBarTitleText" : "", - "enablePullDownRefresh" : false - } - }, - { - "path" : "settle/settle", - "style" : - { - "navigationBarTitleText" : "确认订单", - "enablePullDownRefresh" : false - } + "subPackages": [{ + "root": "pagesOrder", + "pages": [{ + "path": "order/order", + "style": { + "navigationBarTitleText": "我的订单", + "enablePullDownRefresh": false } - ] - } - ], + }, + { + "path": "detail/detail", + "style": { + "navigationBarTitleText": "", + "enablePullDownRefresh": false + } + }, + { + "path": "addressList/addressList", + "style": { + "navigationBarTitleText": "地址管理", + "enablePullDownRefresh": false + } + }, + { + "path": "addressEdit/addressEdit", + "style": { + "navigationBarTitleText": "", + "enablePullDownRefresh": false + } + }, + { + "path": "settle/settle", + "style": { + "navigationBarTitleText": "确认订单", + "enablePullDownRefresh": false + } + } + ] + }], "globalStyle": { "navigationBarTextStyle": "black", "navigationBarTitleText": "", "navigationBarBackgroundColor": "#fff", "backgroundColor": "#fff" }, - "tabBar": { - "color": "#999999", - "selectedColor": "#20b128", - "borderStyle": "white", - "backgroundColor": "#FFFFFF", - // "iconWidth": "40px", - "list": [{ - "pagePath": "pages/index/index", - "text": "首页", - "iconPath": "static/tab/a.png", - "selectedIconPath": "static/tab/aa.png" - }, - { - "pagePath": "pages/cart/cart", - "text": "购物车", - "iconPath": "static/tab/b.png", - "selectedIconPath": "static/tab/ba.png" - }, + // "tabBar": { + // "color": "#999999", + // "selectedColor": "#20b128", + // "borderStyle": "white", + // "backgroundColor": "#FFFFFF", + // "list": [{ + // "pagePath": "pages/index/index", + // "text": "首页", + // "iconPath": "static/tab/a.png", + // "selectedIconPath": "static/tab/aa.png" + // }, + // { + // "pagePath": "pages/cart/cart", + // "text": "购物车", + // "iconPath": "static/tab/b.png", + // "selectedIconPath": "static/tab/ba.png" + // }, - { - "pagePath": "pages/my/my", - "text": "我的", - "iconPath": "static/tab/c.png", - "selectedIconPath": "static/tab/ca.png" - } + // { + // "pagePath": "pages/my/my", + // "text": "我的", + // "iconPath": "static/tab/c.png", + // "selectedIconPath": "static/tab/ca.png" + // } - ] - }, + // ] + // }, "uniIdRouter": {} } \ No newline at end of file diff --git a/pages/index/index.vue b/pages/index/index.vue index c1f4fad..11cd7b9 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -1,24 +1,23 @@ @@ -140,8 +156,8 @@ console.log('选择', item, index); topActive.value = item.id; show.value = 0; - goodClassTow.value = item?.children||[]; - goodClassThree.value = goodClassTow.value[0]?.children||[]; + goodClassTow.value = item?.children || []; + goodClassThree.value = goodClassTow.value[0]?.children || []; leftActive.value = goodClassTow.value[0]?.id; rightActive.value = goodClassThree.value[0]?.id; } @@ -151,7 +167,7 @@ console.log('选择', item, index); leftActive.value = item.id; show.value = 0; - goodClassThree.value = item?.children||[]; + goodClassThree.value = item?.children || []; rightActive.value = goodClassThree.value[0]?.id; } @@ -223,14 +239,20 @@ const goodClassThree = ref([]); // 三级分类 const getgoodClassList = () => { goodClassListApi().then(res => { - goodClassList.value = res.data?.lists||[]; - goodClassTow.value = goodClassList.value[0]?.children||[]; - goodClassThree.value = goodClassTow.value[0]?.children||[]; + goodClassList.value = res.data?.lists || []; + goodClassTow.value = goodClassList.value[0]?.children || []; + goodClassThree.value = goodClassTow.value[0]?.children || []; topActive.value = goodClassList.value[0]?.id; leftActive.value = goodClassTow.value[0]?.id; rightActive.value = goodClassThree.value[0]?.id; }) } + + const navTo = (url)=>{ + uni.navigateTo({ + url: url + }) + } onLoad(() => { getgoodClassList(); @@ -243,6 +265,27 @@ background-color: #fff; } + .navbar { + padding: 0 20rpx; + display: flex; + align-items: center; + justify-content: space-between; + font-size: 22rpx; + color: #777; + + .nav-item { + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + + image { + height: 40rpx; + width: 40rpx; + } + } + } + .head-view { background-color: #fff; height: 180rpx; @@ -399,9 +442,9 @@ display: flex; .left { - height: calc(100vh - var(--window-top) - var(--window-bottom) - 180rpx); + height: calc(100vh - var(--window-top) - var(--window-bottom) - 500rpx); /* #ifdef H5 */ - height: calc(100vh - 96px - 180rpx); + height: calc(100vh - 44px - 300rpx); /* #endif */ width: 170rpx; box-sizing: border-box; @@ -434,7 +477,7 @@ } .right { - height: calc(100vh - var(--window-top) - var(--window-bottom) - 180rpx); + height: calc(100vh - var(--window-top) - 500rpx); /* #ifdef H5 */ height: calc(100vh - 96px - 180rpx); /* #endif */ @@ -501,9 +544,9 @@ } .list { - height: calc(100vh - var(--window-top) - var(--window-bottom) - 180rpx - 150rpx); + height: calc(100vh - var(--window-top) - 600rpx); /* #ifdef H5 */ - height: calc(100vh - 96px - 180rpx); + height: calc(100vh - 44px - 400rpx); /* #endif */ .shop-item { @@ -563,4 +606,45 @@ } } } + + .fiexd-btn-box { + box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.1); + height: 140rpx; + height: calc(constant(safe-area-inset-bottom) + 140rpx); + /* 适用于iOS设备 */ + height: calc(env(safe-area-inset-bottom) + 140rpx); + /* 适用于Android设备 */ + padding-top: 40rpx; + + .price-info { + .row { + display: flex; + font-size: 26rpx; + align-items: center; + + &>view { + margin-right: 15rpx; + } + + .price { + color: #F55726; + } + } + } + + .btn { + width: 200rpx; + } + + .cart { + position: absolute; + top: -40rpx; + left: 40rpx; + + image { + width: 80rpx; + height: 80rpx; + } + } + } \ No newline at end of file diff --git a/pages/my/my.vue b/pages/my/my.vue index 3101cfd..d7041e3 100644 --- a/pages/my/my.vue +++ b/pages/my/my.vue @@ -1,9 +1,6 @@