From 1e53287927fd618b7bf21b77eb8803ae8ec569ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?lemon=E6=A9=AA?= <17633066053@163.com> Date: Tue, 8 Jun 2021 09:22:00 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=95=86=E5=93=81=E8=AF=A6?= =?UTF-8?q?=E6=83=85=E9=A1=B5=E5=B0=8F=E7=A8=8B=E5=BA=8F=E5=BF=AB=E9=80=9F?= =?UTF-8?q?=E8=B7=B3=E8=BD=AC=EF=BC=8C=E4=BB=A5=E5=8F=8A=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E6=A5=BC=E5=B1=82=E8=A3=85=E4=BF=AE=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/popups/popups.vue | 343 ++++++++++++++++++ pages/product/goods.vue | 136 ++++--- pages/product/product/style.scss | 95 +++-- pages/tabbar/home/template/tpl.js | 15 +- pages/tabbar/home/template/tpl.scss | 2 +- .../home/template/tpl_left_two_right_one.vue | 2 +- 6 files changed, 514 insertions(+), 79 deletions(-) create mode 100644 components/popups/popups.vue diff --git a/components/popups/popups.vue b/components/popups/popups.vue new file mode 100644 index 0000000..a9ae593 --- /dev/null +++ b/components/popups/popups.vue @@ -0,0 +1,343 @@ + + + + + diff --git a/pages/product/goods.vue b/pages/product/goods.vue index b03fc67..cc4ddf2 100644 --- a/pages/product/goods.vue +++ b/pages/product/goods.vue @@ -9,42 +9,40 @@ + - + + +
-
- +
+ + +
-
+
-
+
-
- - - -
- -
-
- + +
+
+ + - - - +
+
+
+ - + @@ -54,9 +52,9 @@ - + - + {{ goodsDetail.goodsName || "" }} @@ -84,12 +82,17 @@ }} ¥0 .00 - + + + {{ favorite ? "已收藏" : "收藏" }} - + {{ goodsDetail.goodsName || "" }} @@ -143,7 +146,7 @@ - + @@ -232,7 +235,7 @@ import { import * as API_trade from "@/api/trade.js"; import * as API_Members from "@/api/members.js"; import * as API_store from "@/api/store.js"; - +import { modelNavigateTo } from "@/pages/tabbar/home/template/tpl.js"; /************请求存储***************/ import storage from "@/utils/storage.js"; @@ -250,8 +253,10 @@ import GoodsSwiper from "./product/goods/-goods-swiper"; //轮播图组件 import popupGoods from "./product/popup/goods"; //购物车商品的模块 import popupAddress from "./product/popup/address"; //地址选择模块 import shares from "@/components/m-share/index"; //分享 +import popups from "@/components/popups/popups"; //气泡框 export default { components: { + popups, shares, PromotionLayout, PromotionDetailsLayout, @@ -268,13 +273,51 @@ export default { }, data() { return { + // #ifdef H5 + navbarListX: 110, //导航栏列表栏x轴 + navbarListY: 80, //导航栏列表栏y轴 + // #endif + // #ifdef MP-WEIXIN + navbarListX: 100, //导航栏列表栏x轴 + navbarListY: 140, //导航栏列表栏y轴 + // #endif + // #ifdef APP-PLUS + navbarListX: 120, //导航栏列表栏x轴 + navbarListY: 170, //导航栏列表栏y轴 + // #endif + navbarListData: [ + //导航栏列表栏数据 + { + title: "首页", + icon: "home-fill", + ___type: "other", + }, + { + title: "购物车", + icon: "bag-fill", + ___type: "other", + }, + { + title: "搜索", + icon: "search", + ___type: "category", + }, + { + title: "个人中心", + icon: "account-fill", + ___type: "other", + }, + ], + popupsSwitch: false, //导航栏列表栏开关 shareFlage: false, selectedGoods: "", //选择的商品规格昵称 - is_promotion: true, //判断显示拼团活动文字 + isPromotion: true, //判断显示拼团活动文字 isGroup: false, // 是否是拼团活动 pointDetail: "", // 是否是积分商品 assemble: "", //拼团的sku - scroll_mask_height: 0, //促销活动的高度 + navbarOnlyBack: { + background: "transparent", + }, navbar: { background: "#fff", }, @@ -286,7 +329,7 @@ export default { }, headerFlag: false, //顶部导航显示与否 headerList: [ - //顶部导航文字 + //顶部导航文字按照规则来 详情全局搜索 { text: "商品", id: "1", @@ -359,15 +402,14 @@ export default { clearInterval(timer); }, 100); - this.is_promotion = false; + this.isPromotion = false; } else { - this.is_promotion = true; + this.isPromotion = true; this.$refs.popupGoods.buyType = ""; } }, }, mounted() { - const { windowHeight } = uni.getSystemInfoSync(); let bottomHeight = 0; let topHeight = 0; @@ -420,7 +462,16 @@ export default { } }, methods: { - // 循环出当前促销是否为空 + /** + * 导航栏列表栏 + */ + handleNavbarList(val) { + modelNavigateTo({ url: val }); + }, + + /** + * 循环出当前促销是否为空 + */ emptyPromotion() { if ( this.PromotionList == "" || @@ -430,7 +481,10 @@ export default { return true; } }, - /**初始化信息 */ + + /** + * 初始化信息 + */ async init(id, goodsId, distributionId) { this.isGroup = false; //初始化拼团 this.productId = id; // skuId @@ -487,11 +541,11 @@ export default { this.getGoodsCollectionFun(this.goodsDetail.id); } }, - linkMsgDetail () { - uni.navigateTo({ - url: '/pages/product/customerservice/index' - }) - }, + linkMsgDetail() { + uni.navigateTo({ + url: "/pages/product/customerservice/index", + }); + }, // 格式化金钱 1999 --> [1999,00] formatPrice(val) { if (typeof val == "undefined") { diff --git a/pages/product/product/style.scss b/pages/product/product/style.scss index 32dae22..86cab5e 100644 --- a/pages/product/product/style.scss +++ b/pages/product/product/style.scss @@ -1,7 +1,7 @@ .red { color: $jd-color; } -page{ +page { background: #fff; } .num-icon { @@ -48,7 +48,7 @@ page{ font-size: 22rpx; } } -.desc-blod { +.desc-bold { flex: 8; font-weight: 700; color: #262626; @@ -72,7 +72,7 @@ page{ justify-content: space-between; align-items: center; } -.favorite { +.icons,.favorite { flex: 1; font-size: 22rpx; color: #262626; @@ -127,45 +127,68 @@ page{ } .headerRow { + height: 44px; //默认uni navbar就是44px display: flex; + align-items: center; width: 100%; background: #fff !important; - > div { - flex: 1; - } + > .headerList { flex: 8; } justify-content: space-between; } -.scoll-hide { +.scroll-hide { opacity: 0; transition: all 0.5s; } .cur { - color: #333; - - border-bottom: 6rpx solid $main-color; + color: $main-color; } -.header { +.cur::after { + content: ""; + height: 6rpx; + + background: $main-color; + width: 100%; + position: absolute; + bottom: 0; + left: 0; +} + +.header-only-back { + background: transparent; +} +.header, +.header-only-back { + padding-left: 10rpx; position: fixed; top: var(--status-bar-height); width: 100%; - z-index: 8; height: 90rpx; - line-height: 90rpx; font-size: 30rpx; transition: all 0.5s; +} +/deep/ .u-navbar { + padding-left: 10rpx; +} +.nav-item { + flex: 2; + position: relative; + justify-content: center; + height: 100%; + display: flex; + align-items: center; +} +.header { color: #666666; background-color: #fff; - .tab-bar { width: 100%; color: #666; font-weight: 400; - view { padding: 0 3px; } @@ -214,14 +237,32 @@ page{ } .main-page { - height: calc(100% - var(--status-bar-height)) ; + height: calc(100% - var(--status-bar-height)); overflow: hidden; } +.icon-back { + padding-right: 10rpx; +} +.icon-list { + border-left: 2rpx solid rgb(194, 194, 194); + padding-left: 10rpx; +} +.backs, +.bg-back { + width: 150rpx; + border: 2rpx solid #e8e8e8; + border-radius: 100px; + display: flex; + align-items: center; + justify-content: center; + padding: 8rpx 0; +} +.bg-back { + background: rgba($color: #fff, $alpha: 0.8); +} .backs { - // width: 150rpx; text-align: center; font-size: 42rpx; - line-height: 90rpx; } .headerImg { @@ -253,8 +294,6 @@ page { } .product-container { - // background: #f0f0f0; - .header-line { height: 1px; background: #f2f2f2; @@ -265,12 +304,12 @@ page { z-index: 999; transition: all 0.5s; - &.scoll-hide { + &.scroll-hide { background: none; } } - .scoll-page { + .scroll-page { width: 100%; height: 100%; } @@ -328,7 +367,7 @@ page { height: 60rpx; line-height: 60rpx; position: fixed; - margin-top: calc( 10px); + margin-top: calc(10px); z-index: 8; width: 100%; @@ -337,12 +376,6 @@ page { } } -.u-mode-light-error { - background: #ffebec !important; - padding: 8rpx 16rpx; - font-size: 20rpx; -} - .showBox { width: 100%; height: 90rpx; @@ -363,7 +396,7 @@ page { } } -.status_bar{ +.status_bar { background: #fff; height: var(--status-bar-height); -} \ No newline at end of file +} diff --git a/pages/tabbar/home/template/tpl.js b/pages/tabbar/home/template/tpl.js index b3c31b6..0eda4d4 100644 --- a/pages/tabbar/home/template/tpl.js +++ b/pages/tabbar/home/template/tpl.js @@ -1,6 +1,5 @@ /** 配置楼层模块的跳转 */ export function modelNavigateTo(item) { - let val = item.url; switch (val.___type) { case "goods": @@ -9,9 +8,15 @@ export function modelNavigateTo(item) { }); break; case "category": - uni.navigateTo({ - url: `/pages/navigation/search/searchPage?category=${val.id}`, - }); + if (val.id) { + uni.navigateTo({ + url: `/pages/navigation/search/searchPage?category=${val.id}`, + }); + } else { + uni.navigateTo({ + url: `/pages/navigation/search/searchPage`, + }); + } break; case "stores": uni.navigateTo({ @@ -33,7 +38,7 @@ export function modelNavigateTo(item) { switch (val.title) { case "首页": uni.switchTab({ - url: `/`, + url: `/pages/tabbar/home/index`, }); break; case "购物车": diff --git a/pages/tabbar/home/template/tpl.scss b/pages/tabbar/home/template/tpl.scss index 101b846..cdad53a 100644 --- a/pages/tabbar/home/template/tpl.scss +++ b/pages/tabbar/home/template/tpl.scss @@ -2,7 +2,7 @@ max-width: 100%; height: auto; display: block; - padding: 2rpx; + } .layout { padding: 16rpx; diff --git a/pages/tabbar/home/template/tpl_left_two_right_one.vue b/pages/tabbar/home/template/tpl_left_two_right_one.vue index 6f491c4..a683c63 100644 --- a/pages/tabbar/home/template/tpl_left_two_right_one.vue +++ b/pages/tabbar/home/template/tpl_left_two_right_one.vue @@ -33,7 +33,7 @@ export default {