Commit b02e37f41d5c74f4d72eaa434123bbadc00fa822
1 parent
9b073ad1
商品详情的顶部的风格的优化
Showing
28 changed files
with
536 additions
and
36 deletions
app.wxss
components/diy_top_nav/diy_top_nav.js
0 → 100644
| 1 | +// components/diy_top_nav/diy_top_nav.js | |
| 2 | +const app = getApp(); | |
| 3 | +var os = app.globalData.setting; | |
| 4 | +Component({ | |
| 5 | + /** | |
| 6 | + * 组件的属性列表 | |
| 7 | + */ | |
| 8 | + properties: { | |
| 9 | + nav_type:{ | |
| 10 | + type:Number, | |
| 11 | + value:0, | |
| 12 | + }, | |
| 13 | + istop:{ | |
| 14 | + type:Number, | |
| 15 | + value:0, | |
| 16 | + }, | |
| 17 | + nav_title:{ | |
| 18 | + type:String, | |
| 19 | + value:'首页', | |
| 20 | + }, | |
| 21 | + nav_frontColor:{ | |
| 22 | + type:String, | |
| 23 | + value:'#ffffff', | |
| 24 | + }, | |
| 25 | + nav_backgroundColor:{ | |
| 26 | + type:String, | |
| 27 | + value:'#ff7295', | |
| 28 | + }, | |
| 29 | + is_share:{ | |
| 30 | + type:Boolean, | |
| 31 | + value:true | |
| 32 | + } | |
| 33 | + }, | |
| 34 | + | |
| 35 | + /** | |
| 36 | + * 组件的初始数据 | |
| 37 | + */ | |
| 38 | + data: { | |
| 39 | + imghots: os.imghost, | |
| 40 | + nav_h:0, //导航胶囊上面状态栏的高度 | |
| 41 | + mentButt_h:0,//导航胶囊高度 | |
| 42 | + navleft_pb:0, //导航左边的自定义内容的左右内边距 | |
| 43 | + nav_left_w:281, // 导航左边自定义的内容宽度 | |
| 44 | + navleft_w:0, //左边胶囊宽度 | |
| 45 | + nav_pb:0, // 导航的下内边距 | |
| 46 | + show_menu:false,//详情页导航下拉菜单显示 | |
| 47 | + men_list:[ | |
| 48 | + { | |
| 49 | + name:'首页', | |
| 50 | + img:'miniapp/js_img/goods_info/home.png?v=3', | |
| 51 | + url:'/pages/index/index/index' | |
| 52 | + }, | |
| 53 | + { | |
| 54 | + name:'我的订单', | |
| 55 | + img:'miniapp/js_img/goods_info/order.png?v=3', | |
| 56 | + url:'/pages/user/order_list/order_list' | |
| 57 | + }, | |
| 58 | + { | |
| 59 | + name:'我的收藏', | |
| 60 | + img:'miniapp/js_img/goods_info/collect.png?v=3', | |
| 61 | + url:'/packageB/pages/user/collect_list/collect_list' | |
| 62 | + }, | |
| 63 | + // { | |
| 64 | + // name:'浏览足迹', | |
| 65 | + // img:'', | |
| 66 | + // url:'' | |
| 67 | + // }, | |
| 68 | + ] | |
| 69 | + }, | |
| 70 | + lifetimes:{ | |
| 71 | + attached:function(){ | |
| 72 | + //满屏顶部导航参数获取----------- | |
| 73 | + try { | |
| 74 | + let systemInfo = wx.getSystemInfoSync() | |
| 75 | + let mentButt = wx.getMenuButtonBoundingClientRect() | |
| 76 | + let nav_pb = mentButt.top - systemInfo.statusBarHeight | |
| 77 | + let navleft_pb = systemInfo.windowWidth - mentButt.right | |
| 78 | + | |
| 79 | + let user_no=''; | |
| 80 | + if(getApp().globalData.userInfo){ | |
| 81 | + user_no=getApp().globalData.userInfo.erpvipno | |
| 82 | + } | |
| 83 | + | |
| 84 | + this.setData({ | |
| 85 | + nav_h:mentButt.top, | |
| 86 | + mentButt_h:mentButt.height, | |
| 87 | + nav_left_w:mentButt.left, | |
| 88 | + navleft_pb, | |
| 89 | + nav_pb, | |
| 90 | + navleft_w:mentButt.width*0.9, | |
| 91 | + user_no | |
| 92 | + }) | |
| 93 | + } catch (e) { | |
| 94 | + console.error(e); | |
| 95 | + wx.showToast({ | |
| 96 | + title: '系统参数获取失败', | |
| 97 | + icon: 'none', | |
| 98 | + duration: 2000 | |
| 99 | + }) | |
| 100 | + // this.setData({ | |
| 101 | + // is_full_screen_navigation:false | |
| 102 | + // }) | |
| 103 | + // Do something when catch error | |
| 104 | + } | |
| 105 | + } | |
| 106 | + }, | |
| 107 | + /** | |
| 108 | + * 组件的方法列表 | |
| 109 | + */ | |
| 110 | + methods: { | |
| 111 | + nav_menu(e){ | |
| 112 | + let url=e.currentTarget.dataset.url | |
| 113 | + getApp().goto(url) | |
| 114 | + }, | |
| 115 | + show_menu_fn(){ | |
| 116 | + this.setData({ | |
| 117 | + show_menu:!this.data.show_menu | |
| 118 | + }) | |
| 119 | + }, | |
| 120 | + hide_menu_fn(){ | |
| 121 | + this.setData({ | |
| 122 | + show_menu:false | |
| 123 | + }) | |
| 124 | + }, | |
| 125 | + //分享 | |
| 126 | + fenx_fn(){ | |
| 127 | + this.triggerEvent('clickShare') | |
| 128 | + }, | |
| 129 | + call_back(){ | |
| 130 | + wx.navigateBack({ | |
| 131 | + delta:1, | |
| 132 | + fail:()=>{ | |
| 133 | + wx.reLaunch({ | |
| 134 | + url: '/pages/index/index/index', | |
| 135 | + }) | |
| 136 | + } | |
| 137 | + }) | |
| 138 | + }, | |
| 139 | + nav_search(){ | |
| 140 | + getApp().goto('/pages/goods/search/search') | |
| 141 | + } | |
| 142 | + } | |
| 143 | +}) | ... | ... |
components/diy_top_nav/diy_top_nav.json
0 → 100644
components/diy_top_nav/diy_top_nav.wxml
0 → 100644
| 1 | +<!--components/diy_top_nav/diy_top_nav.wxml--> | |
| 2 | +<!-- 支撑作用 --> | |
| 3 | +<view wx:if="{{nav_type==-1}}" style="padding-bottom:{{nav_pb}}px;color: {{nav_frontColor}};"> | |
| 4 | + <view style="height: {{nav_h}}px;width: 100%;"></view> | |
| 5 | + <view style="width: 100%;height:{{mentButt_h}}px;line-height:{{mentButt_h}}px;text-align: center;"></view> | |
| 6 | +</view> | |
| 7 | +<!-- 默认没有返回按钮 --> | |
| 8 | +<view wx:if="{{nav_type==0}}" style="padding-bottom:{{nav_pb}}px;background-color:{{nav_backgroundColor}};color: {{nav_frontColor}};"> | |
| 9 | + <view style="height: {{nav_h}}px;width: 100%;"></view> | |
| 10 | + <view style="width: 100%;height:{{mentButt_h}}px;line-height:{{mentButt_h}}px;text-align: center;">{{nav_title}}</view> | |
| 11 | +</view> | |
| 12 | +<!-- 默认有返回按钮 --> | |
| 13 | +<view wx:if="{{nav_type==5}}" style="padding-bottom:{{nav_pb}}px;background-color:{{nav_backgroundColor}};color: {{nav_frontColor}};"> | |
| 14 | + <view style="height: {{nav_h}}px;width: 100%;"></view> | |
| 15 | + <view style="width: 100%;height:{{mentButt_h}}px;line-height:{{mentButt_h}}px;text-align: center;position: relative;"> | |
| 16 | + <view catchtap="call_back" class="call_back_box"> | |
| 17 | + <text class="nav_fh" ></text> | |
| 18 | + </view> | |
| 19 | + {{nav_title}} | |
| 20 | + </view> | |
| 21 | +</view> | |
| 22 | + | |
| 23 | +<!-- 广告轮播时 --> | |
| 24 | +<view wx:if="{{nav_type==1}}" style="padding-bottom:{{nav_pb}}px;color: {{nav_frontColor}};"> | |
| 25 | + <view style="height: {{nav_h}}px;width: 100%;"></view> | |
| 26 | + <view style="width: 100%;height:{{mentButt_h}}px;line-height:{{mentButt_h}}px;text-align: left;padding-left: 20rpx;">{{nav_title}}</view> | |
| 27 | +</view> | |
| 28 | + | |
| 29 | +<!-- 详情页面 --> | |
| 30 | +<view wx:if="{{nav_type==2}}" style="padding-bottom:{{nav_pb}}px;{{ istop ? '' : ('background-color:'+nav_backgroundColor)}};color:{{nav_frontColor}};"> | |
| 31 | + <!-- 显示一下user_id --> | |
| 32 | + <view style="position:relative;height: {{nav_h}}px;width: 100%; "> | |
| 33 | + <view wx:if="{{user_no}}" class="tb_con" >ID:{{user_no}}</view> | |
| 34 | + </view> | |
| 35 | + <view style="width: 100%;height:{{mentButt_h}}px;line-height:{{mentButt_h}}px;display: flex;"> | |
| 36 | + <view class="nav_left" style="width: {{nav_left_w}}px;padding: 0 {{navleft_pb}}px;"> | |
| 37 | + <view class="navl_left flex" style="width:{{navleft_w}}px;padding: 0;"> | |
| 38 | + <!-- <text class="iconfont1 icon-line-homeshouye-01" style="color: #000;font-size: 20px;"></text> --> | |
| 39 | + <view catchtap="call_back" class="flex nav_left_box"> | |
| 40 | + <text class="nav_fh" ></text> | |
| 41 | + </view> | |
| 42 | + <text class="navl_left_b"></text> | |
| 43 | + <!-- <text class="iconfont icon-xingyungou" style="color:#898989;"></text> --> | |
| 44 | + <view catchtap="show_menu_fn" class="flex nav_left_box"> | |
| 45 | + <view class="iconfont icon-fenlei" style="color: #000;position: relative;" > | |
| 46 | + <view class="list_menu" wx:if="{{show_menu}}"> | |
| 47 | + <view class="list_menu_top"></view> | |
| 48 | + <view wx:for="{{men_list}}" class="menu_item" data-url="{{item.url}}" catchtap="nav_menu"> | |
| 49 | + <image src="{{imghots + item.img}}" class="logo" lazy-load></image> | |
| 50 | + <view>{{item.name}}</view> | |
| 51 | + </view> | |
| 52 | + </view> | |
| 53 | + </view> | |
| 54 | + </view> | |
| 55 | + </view> | |
| 56 | + <view wx:if="{{!istop}}" catchtap="nav_search" class="navl_minddle" style="margin: 0 {{navleft_pb}}px;"> | |
| 57 | + <icon type="search" size="28rpx" color="#898989" class="nav_search"/> | |
| 58 | + <text>搜索更多商品</text> | |
| 59 | + </view> | |
| 60 | + <view wx:else ></view> | |
| 61 | + <view wx:if="{{is_share}}" class="navl_right" catchtap="fenx_fn" style="height:{{mentButt_h}}px;width:{{mentButt_h}}px;"> | |
| 62 | + <text class="iconfont icon-weixin" style="color:rgb(4, 174, 15);size: 16rpx;"></text> | |
| 63 | + <!-- <image class="we_chat" src="{{imghots}}/miniapp/images/we_chat.png"></image> --> | |
| 64 | + </view> | |
| 65 | + <view wx:else></view> | |
| 66 | + </view> | |
| 67 | + <view class="nav_right">1212121</view> | |
| 68 | + </view> | |
| 69 | +</view> | ... | ... |
components/diy_top_nav/diy_top_nav.wxss
0 → 100644
| 1 | +/* components/diy_top_nav/diy_top_nav.wxss */ | |
| 2 | +@import '../../app.wxss'; | |
| 3 | +.nav_left{ | |
| 4 | + box-sizing: border-box; | |
| 5 | + display: flex; | |
| 6 | + align-items: center; | |
| 7 | + justify-content: space-between; | |
| 8 | +} | |
| 9 | +.nav_left_box{ | |
| 10 | + width: 48%; | |
| 11 | + align-items: center; | |
| 12 | + justify-content: center; | |
| 13 | + height: 100%; | |
| 14 | +} | |
| 15 | +.nav_right{ | |
| 16 | + flex: 1; | |
| 17 | +} | |
| 18 | +.navl_left{ | |
| 19 | + height: 100%; | |
| 20 | + background-color:rgba(255, 255, 255, .5); | |
| 21 | + border-radius:30rpx; | |
| 22 | + border: 1rpx solid rgba(227, 227, 227); | |
| 23 | + display: flex; | |
| 24 | + align-items: center; | |
| 25 | + justify-content: space-around; | |
| 26 | + padding: 0 4%; | |
| 27 | + box-sizing: border-box; | |
| 28 | +} | |
| 29 | + | |
| 30 | +.navl_minddle{ | |
| 31 | + height: 100%; | |
| 32 | + flex: 1; | |
| 33 | + background-color: bisque; | |
| 34 | + display: flex; | |
| 35 | + align-items: center; | |
| 36 | + vertical-align: middle; | |
| 37 | + /* justify-content: center; */ | |
| 38 | + border-radius: 30rpx; | |
| 39 | + background-color: rgb(242, 243, 245); | |
| 40 | + /* background-color: #898989; */ | |
| 41 | + font-size: 28rpx; | |
| 42 | + color: #898989; | |
| 43 | +} | |
| 44 | +.nav_search{ | |
| 45 | + display: flex; | |
| 46 | + align-items: center; | |
| 47 | + margin: 0 10rpx 0 20rpx; | |
| 48 | +} | |
| 49 | +.navl_right{ | |
| 50 | + background-color: #fff; | |
| 51 | + border-radius: 100%; | |
| 52 | + display: flex; | |
| 53 | + align-items: center; | |
| 54 | + justify-content: center; | |
| 55 | + border: 1rpx solid rgba(227, 227, 227); | |
| 56 | +} | |
| 57 | +.navl_left_b{ | |
| 58 | + width: 1rpx; | |
| 59 | + height: 65%; | |
| 60 | + background-color:rgb(227,227,227) ; | |
| 61 | +} | |
| 62 | +.we_chat{ | |
| 63 | + width: 45rpx; | |
| 64 | + height: 45rpx; | |
| 65 | +} | |
| 66 | +.nav_fh { | |
| 67 | + width: 18rpx; | |
| 68 | + height: 18rpx; | |
| 69 | + border-top: 2rpx solid #000; | |
| 70 | + border-right: 2rpx solid #000; | |
| 71 | + transform: rotateZ(-135deg); | |
| 72 | + display: inline-block; | |
| 73 | + margin-bottom: 3rpx; | |
| 74 | +} | |
| 75 | +.list_menu{ | |
| 76 | + position: absolute; | |
| 77 | + /* bottom: -10rpx; */ | |
| 78 | + /* top: -13rpx; */ | |
| 79 | + left: -35rpx; | |
| 80 | + /* width: 180rpx; */ | |
| 81 | + /* width: auto; */ | |
| 82 | + padding: 10rpx 26rpx; | |
| 83 | + /* height: 400rpx; */ | |
| 84 | + margin-top: 18rpx; | |
| 85 | + background-color: #fff; | |
| 86 | + /* background-color: rebeccapurple; */ | |
| 87 | + border-radius: 15rpx; | |
| 88 | + z-index: 9999999; | |
| 89 | +} | |
| 90 | +.list_menu_top{ | |
| 91 | + position: absolute; | |
| 92 | + top: -10rpx; | |
| 93 | + left: 50rpx; | |
| 94 | + width: 26rpx; | |
| 95 | + height: 26rpx; | |
| 96 | + /* background-color: rebeccapurple; */ | |
| 97 | + background-color: #fff; | |
| 98 | + transform: rotateZ(45deg); | |
| 99 | + display: inline-block; | |
| 100 | +} | |
| 101 | +.menu_item{ | |
| 102 | + display: flex; | |
| 103 | + align-items: center; | |
| 104 | + font-size: 26rpx; | |
| 105 | + white-space: nowrap; | |
| 106 | + /* padding: 20rpx; */ | |
| 107 | +} | |
| 108 | +.menu_item image{ | |
| 109 | + width: 36rpx; | |
| 110 | + height: 36rpx; | |
| 111 | + margin-right: 20rpx; | |
| 112 | +} | |
| 113 | +.call_back_box{ | |
| 114 | + width: 100rpx; | |
| 115 | + height: 100%; | |
| 116 | + display: flex; | |
| 117 | + align-items: center; | |
| 118 | + justify-content: center; | |
| 119 | + position: absolute; | |
| 120 | + /* background-color: blueviolet; */ | |
| 121 | + left: 0; | |
| 122 | + bottom: 0; | |
| 123 | +} | |
| 124 | +.call_back_box .nav_fh{ | |
| 125 | + width: 20rpx; | |
| 126 | + height: 20rpx; | |
| 127 | +} | |
| 128 | + | |
| 129 | +.tb_con{ | |
| 130 | + position: absolute; bottom: 0; right: 24rpx; font-size: 18rpx;color: #333; | |
| 131 | +} | |
| 0 | 132 | \ No newline at end of file | ... | ... |
packageA/pages/goodsInfo/goodsInfo.js
| ... | ... | @@ -212,9 +212,15 @@ Page({ |
| 212 | 212 | |
| 213 | 213 | hiddenCS: true, //控制客服操作菜单显示和控制 |
| 214 | 214 | |
| 215 | - openSpecModal_flash_normal: 0, | |
| 216 | - keyword:'', //门店搜索 | |
| 217 | - sec_i:-1,//选中分类门店 下标 | |
| 215 | + openSpecModal_flash_normal: 0, | |
| 216 | + keyword:'', //门店搜索 | |
| 217 | + sec_i:-1,//选中分类门店 下标 | |
| 218 | + | |
| 219 | + nav_frontColor: "#ffffff", | |
| 220 | + nav_backgroundColor: "#ffffff", | |
| 221 | + nav_type: 2, //导航类型 | |
| 222 | + istop: 0, //是否置顶风格为1 | |
| 223 | + searchbox_transparent: 1, | |
| 218 | 224 | }, |
| 219 | 225 | |
| 220 | 226 | //------初始化加载---------- | ... | ... |
packageA/pages/goodsInfo/goodsInfo.json
| ... | ... | @@ -6,7 +6,7 @@ |
| 6 | 6 | "warn": "/components/long_warn/long_warn", |
| 7 | 7 | "serviceCard_recommend": "/components/serviceCard_list/serviceCard_list", |
| 8 | 8 | "privacy_pop": "/components/privacy_pop/privacy_pop", |
| 9 | - "com_top_nav": "/components/com_top_nav/com_top_nav" | |
| 9 | + "top_nav": "/components/diy_top_nav/diy_top_nav" | |
| 10 | 10 | }, |
| 11 | 11 | "navigationStyle": "custom" |
| 12 | 12 | } |
| 13 | 13 | \ No newline at end of file | ... | ... |
packageA/pages/goodsInfo/goodsInfo.wxml
| ... | ... | @@ -2,16 +2,20 @@ |
| 2 | 2 | <wxs module="filters" src="../../../utils/filter.wxs"></wxs> |
| 3 | 3 | <wxs module="g_filters" src="g_filter.wxs"></wxs> |
| 4 | 4 | <wxs module="tool" src="filter.wxs"></wxs> |
| 5 | - | |
| 6 | -<com_top_nav title="{{data.goods_name}}"></com_top_nav> | |
| 7 | - | |
| 8 | 5 | <!-- 判断隐私是不是显示 --> |
| 9 | 6 | <privacy_pop id="privacy_pop" bind:agree_pri="agree_pri"></privacy_pop> |
| 10 | - | |
| 7 | +<!-- 顶开 --> | |
| 8 | +<top_nav wx:if="{{!istop || activeCategoryId>0}}" nav_type="{{-1}}" nav_frontColor="{{nav_frontColor}}" nav_backgroundColor="{{nav_backgroundColor}}" nav_title="{{gtitle}}"></top_nav> | |
| 11 | 9 | <!-- 商品内容区域,普通商品,秒杀,拼团 --> |
| 12 | 10 | <block wx:if="{{isshow}}"> |
| 13 | 11 | <view class="container"> |
| 14 | - <view class="type-navbar" style="top:{{top_nav}}px"> | |
| 12 | + | |
| 13 | + <view class="type-navbar_box"> | |
| 14 | + <top_nav id="my-nav" bindclickShare="clickShare" nav_type="{{nav_type}}" is_share="{{false}}" | |
| 15 | + nav_frontColor="{{nav_frontColor}}" istop="{{(istop && searchbox_transparent && activeCategoryId==0) ? 1 : 0 }}" nav_backgroundColor="{{nav_backgroundColor}}" nav_title="{{gtitle}}"></top_nav> | |
| 16 | + </view> | |
| 17 | + | |
| 18 | + <view class="type-navbar" style="top:{{top_nav-4}}px"> | |
| 15 | 19 | <view class="type-box" wx:for="{{categories}}" wx:key="categories"> |
| 16 | 20 | <view bindtap="tabClick" class="type-navbar-item {{activeCategoryId==item.id?'type-item-on':''}}" id="{{item.id}}"> |
| 17 | 21 | {{item.name}} | ... | ... |
packageA/pages/goodsInfo/goodsInfo.wxss
packageA/pages/serviceCard_pd/goodsInfo/goodsInfo.js
| ... | ... | @@ -197,6 +197,12 @@ Page({ |
| 197 | 197 | user_order_pt_state: 0, |
| 198 | 198 | |
| 199 | 199 | is_retail_price: 0, |
| 200 | + | |
| 201 | + nav_frontColor: "#ffffff", | |
| 202 | + nav_backgroundColor: "#ffffff", | |
| 203 | + nav_type: 2, //导航类型 | |
| 204 | + istop: 0, //是否置顶风格为1 | |
| 205 | + searchbox_transparent: 1, | |
| 200 | 206 | }, |
| 201 | 207 | |
| 202 | 208 | //------初始化加载---------- | ... | ... |
packageA/pages/serviceCard_pd/goodsInfo/goodsInfo.json
| ... | ... | @@ -7,7 +7,7 @@ |
| 7 | 7 | "serviceCard_recommend": "/components/serviceCard_list/serviceCard_list", |
| 8 | 8 | "share": "/components/share/share", |
| 9 | 9 | "privacy_pop": "/components/privacy_pop/privacy_pop", |
| 10 | - "com_top_nav": "/components/com_top_nav/com_top_nav" | |
| 10 | + "top_nav": "/components/diy_top_nav/diy_top_nav" | |
| 11 | 11 | }, |
| 12 | 12 | "navigationStyle": "custom" |
| 13 | 13 | } |
| 14 | 14 | \ No newline at end of file | ... | ... |
packageA/pages/serviceCard_pd/goodsInfo/goodsInfo.wxml
| ... | ... | @@ -3,15 +3,21 @@ |
| 3 | 3 | <wxs module="g_filters" src="g_filter.wxs"></wxs> |
| 4 | 4 | <wxs module="tool" src="filter.wxs"></wxs> |
| 5 | 5 | |
| 6 | -<com_top_nav title="{{data.goods_name}}"></com_top_nav> | |
| 7 | - | |
| 8 | 6 | <!-- 判断隐私是不是显示 --> |
| 9 | 7 | <privacy_pop id="privacy_pop" bind:agree_pri="agree_pri"></privacy_pop> |
| 8 | +<!-- 顶开 --> | |
| 9 | +<top_nav wx:if="{{!istop || activeCategoryId>0}}" nav_type="{{-1}}" nav_frontColor="{{nav_frontColor}}" nav_backgroundColor="{{nav_backgroundColor}}" nav_title="{{gtitle}}"></top_nav> | |
| 10 | 10 | |
| 11 | 11 | <!-- 商品内容区域,普通商品,秒杀,拼团 --> |
| 12 | 12 | <block wx:if="{{isshow}}"> |
| 13 | 13 | <view class="container"> |
| 14 | - <view class="type-navbar" style="top:{{top_nav}}px"> | |
| 14 | + | |
| 15 | + <view class="type-navbar_box"> | |
| 16 | + <top_nav id="my-nav" bindclickShare="clickShare" nav_type="{{nav_type}}" is_share="1" | |
| 17 | + nav_frontColor="{{nav_frontColor}}" istop="{{(istop && searchbox_transparent && activeCategoryId==0) ? 1 : 0 }}" nav_backgroundColor="{{nav_backgroundColor}}" nav_title="{{gtitle}}"></top_nav> | |
| 18 | + </view> | |
| 19 | + | |
| 20 | + <view class="type-navbar" style="top:{{top_nav-4}}px"> | |
| 15 | 21 | <view class="type-box" wx:for="{{categories}}" wx:key="categories"> |
| 16 | 22 | <view bindtap="tabClick" class="type-navbar-item {{activeCategoryId==item.id?'type-item-on':''}}" id="{{item.id}}"> |
| 17 | 23 | {{item.name}} | ... | ... |
packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.js
| ... | ... | @@ -286,12 +286,19 @@ Page({ |
| 286 | 286 | canBuy: false, |
| 287 | 287 | btnHidden: false, |
| 288 | 288 | |
| 289 | - hiddenCS: true, | |
| 289 | + hiddenCS: true, | |
| 290 | 290 | is_get_guide:0, |
| 291 | 291 | keyword:'', //门店搜索 |
| 292 | 292 | sec_i:-1,//选中分类门店 下标 |
| 293 | 293 | goodInfo_ad:"",//商品详情广告 |
| 294 | - adding:0 //避免重复点击 | |
| 294 | + adding:0, //避免重复点击 | |
| 295 | + | |
| 296 | + nav_frontColor: "#ffffff", | |
| 297 | + nav_backgroundColor: "#ffffff", | |
| 298 | + nav_type: 2, //导航类型 | |
| 299 | + istop: 0, //是否置顶风格为1 | |
| 300 | + searchbox_transparent: 1 | |
| 301 | + | |
| 295 | 302 | }, |
| 296 | 303 | |
| 297 | 304 | //------初始化加载---------- | ... | ... |
packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.json
| ... | ... | @@ -7,7 +7,7 @@ |
| 7 | 7 | "goods_recommend": "/components/goods_list/goods_list", |
| 8 | 8 | "share": "/components/share/share", |
| 9 | 9 | "privacy_pop": "/components/privacy_pop/privacy_pop", |
| 10 | - "com_top_nav": "/components/com_top_nav/com_top_nav" | |
| 10 | + "top_nav": "/components/diy_top_nav/diy_top_nav" | |
| 11 | 11 | }, |
| 12 | 12 | "navigationStyle": "custom" |
| 13 | 13 | } |
| 14 | 14 | \ No newline at end of file | ... | ... |
packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.wxml
| ... | ... | @@ -2,19 +2,25 @@ |
| 2 | 2 | <wxs module="filters" src="../../../../utils/filter.wxs"></wxs> |
| 3 | 3 | <wxs module="g_filters" src="g_filter.wxs"></wxs> |
| 4 | 4 | <wxs module="tool" src="filter.wxs"></wxs> |
| 5 | - | |
| 6 | -<com_top_nav title="{{gtitle}}"></com_top_nav> | |
| 7 | - | |
| 5 | +<!--<com_top_nav title="{{gtitle}}"></com_top_nav>--> | |
| 8 | 6 | <!-- 判断隐私是不是显示 --> |
| 9 | 7 | <privacy_pop id="privacy_pop" bind:agree_pri="agree_pri"></privacy_pop> |
| 10 | 8 | |
| 9 | +<top_nav wx:if="{{!istop || activeCategoryId>0}}" nav_type="{{-1}}" nav_frontColor="{{nav_frontColor}}" nav_backgroundColor="{{nav_backgroundColor}}" nav_title="{{gtitle}}"></top_nav> | |
| 10 | + | |
| 11 | 11 | <!-- 商品内容区域,普通商品,秒杀,拼团 --> |
| 12 | 12 | <block wx:if="{{isshow}}"> |
| 13 | 13 | <view class="container"> |
| 14 | 14 | <!-- 幸运购规则 --> |
| 15 | 15 | <view class="rules" bindtap="showRules">规则</view> |
| 16 | - <!-- tab选项卡 --> | |
| 17 | - <view class="type-navbar" style="top:{{top_nav}}px"> | |
| 16 | + | |
| 17 | + <view class="type-navbar_box"> | |
| 18 | + <top_nav id="my-nav" bindclickShare="clickShare" nav_type="{{nav_type}}" is_share="1" | |
| 19 | + nav_frontColor="{{nav_frontColor}}" istop="{{(istop && searchbox_transparent && activeCategoryId==0) ? 1 : 0 }}" nav_backgroundColor="{{nav_backgroundColor}}" nav_title="{{gtitle}}"></top_nav> | |
| 20 | + </view> | |
| 21 | + | |
| 22 | + <!-- tab选项卡 --> | |
| 23 | + <view class="type-navbar" style="top:{{top_nav-4}}px"> | |
| 18 | 24 | <view class="type-box" wx:for="{{categories}}" wx:key="categories"> |
| 19 | 25 | <view bindtap="tabClick" class="type-navbar-item {{activeCategoryId==item.id?'type-item-on':''}}" id="{{item.id}}">{{item.name}}</view> |
| 20 | 26 | </view> |
| ... | ... | @@ -22,7 +28,6 @@ |
| 22 | 28 | <!-- 商品详情 --> |
| 23 | 29 | <view class="goods-detail"> |
| 24 | 30 | |
| 25 | - | |
| 26 | 31 | <view class="goods-info" hidden="{{activeCategoryId==0?false:true}}"> |
| 27 | 32 | <!-- 幸运购中奖记录 --> |
| 28 | 33 | <view class="swiper-container"> | ... | ... |
packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.wxss
packageC/pages/presell/cardInfo/goodsInfo.js
| ... | ... | @@ -216,7 +216,15 @@ Page({ |
| 216 | 216 | keyword:'', //门店搜索 |
| 217 | 217 | sec_i:-1,//选中分类门店 下标 |
| 218 | 218 | |
| 219 | - c_curr_p:1 | |
| 219 | + c_curr_p:1, | |
| 220 | + | |
| 221 | + //-- 顶部导航的优化 -- | |
| 222 | + nav_frontColor: "#ffffff", | |
| 223 | + nav_backgroundColor: "#ffffff", | |
| 224 | + nav_type: 2, //导航类型 | |
| 225 | + istop: 0, //是否置顶风格为1 | |
| 226 | + searchbox_transparent: 1 | |
| 227 | + | |
| 220 | 228 | }, |
| 221 | 229 | |
| 222 | 230 | //------初始化加载---------- | ... | ... |
packageC/pages/presell/cardInfo/goodsInfo.json
| ... | ... | @@ -7,7 +7,7 @@ |
| 7 | 7 | "goods_recommend": "/components/goods_list/goods_list", |
| 8 | 8 | "share": "/components/share/share", |
| 9 | 9 | "privacy_pop": "/components/privacy_pop/privacy_pop", |
| 10 | - "com_top_nav": "/components/com_top_nav/com_top_nav" | |
| 10 | + "top_nav": "/components/diy_top_nav/diy_top_nav" | |
| 11 | 11 | }, |
| 12 | 12 | "navigationStyle": "custom" |
| 13 | 13 | } |
| 14 | 14 | \ No newline at end of file | ... | ... |
packageC/pages/presell/cardInfo/goodsInfo.wxml
| ... | ... | @@ -2,16 +2,21 @@ |
| 2 | 2 | <wxs module="filters" src="../../../../utils/filter.wxs"></wxs> |
| 3 | 3 | <wxs module="g_filters" src="g_filter.wxs"></wxs> |
| 4 | 4 | <wxs module="tool" src="filter.wxs"></wxs> |
| 5 | - | |
| 6 | -<com_top_nav title="{{data.goods_name}}"></com_top_nav> | |
| 7 | - | |
| 5 | +<!-- <com_top_nav title="{{data.goods_name}}"></com_top_nav> --> | |
| 8 | 6 | <!-- 判断隐私是不是显示 --> |
| 9 | 7 | <privacy_pop id="privacy_pop" bind:agree_pri="agree_pri"></privacy_pop> |
| 8 | +<!-- 顶开 --> | |
| 9 | +<top_nav wx:if="{{!istop || activeCategoryId>0}}" nav_type="{{-1}}" nav_frontColor="{{nav_frontColor}}" nav_backgroundColor="{{nav_backgroundColor}}" nav_title="{{gtitle}}"></top_nav> | |
| 10 | 10 | |
| 11 | 11 | <block wx:if="{{show}}"> |
| 12 | 12 | <!-- 商品内容区域,普通商品,秒杀,拼团 --> |
| 13 | 13 | <view class="container"> |
| 14 | - <view class="type-navbar" style="top:{{top_nav}}px"> | |
| 14 | + <!-- 自定义顶部的优化 --> | |
| 15 | + <view class="type-navbar_box"> | |
| 16 | + <top_nav id="my-nav" bindclickShare="clickShare" nav_type="{{nav_type}}" is_share="1" | |
| 17 | + nav_frontColor="{{nav_frontColor}}" istop="{{(istop && searchbox_transparent && activeCategoryId==0) ? 1 : 0 }}" nav_backgroundColor="{{nav_backgroundColor}}" nav_title="{{gtitle}}"></top_nav> | |
| 18 | + </view> | |
| 19 | + <view class="type-navbar" style="top:{{top_nav-4}}px"> | |
| 15 | 20 | <view class="type-box" wx:for="{{categories}}" wx:key="categories"> |
| 16 | 21 | <view bindtap="tabClick" class="type-navbar-item {{activeCategoryId==item.id?'type-item-on':''}}" id="{{item.id}}"> |
| 17 | 22 | {{item.name}} | ... | ... |
packageC/pages/presell/cardInfo/goodsInfo.wxss
packageC/pages/presell/goodsInfo/goodsInfo.js
| ... | ... | @@ -263,7 +263,14 @@ Page({ |
| 263 | 263 | sec_i:-1,//选中分类门店 下标 |
| 264 | 264 | goodInfo_ad:'',//商品详情广告 |
| 265 | 265 | |
| 266 | - c_curr_p:1 | |
| 266 | + c_curr_p:1, | |
| 267 | + | |
| 268 | + nav_frontColor: "#ffffff", | |
| 269 | + nav_backgroundColor: "#ffffff", | |
| 270 | + nav_type: 2, //导航类型 | |
| 271 | + istop: 0, //是否置顶风格为1 | |
| 272 | + searchbox_transparent: 1 | |
| 273 | + | |
| 267 | 274 | }, |
| 268 | 275 | |
| 269 | 276 | //------初始化加载---------- | ... | ... |
packageC/pages/presell/goodsInfo/goodsInfo.json
| ... | ... | @@ -7,7 +7,7 @@ |
| 7 | 7 | "goods_recommend": "/components/goods_list/goods_list", |
| 8 | 8 | "share": "/components/share/share", |
| 9 | 9 | "privacy_pop": "/components/privacy_pop/privacy_pop", |
| 10 | - "com_top_nav": "/components/com_top_nav/com_top_nav" | |
| 10 | + "top_nav": "/components/diy_top_nav/diy_top_nav" | |
| 11 | 11 | }, |
| 12 | 12 | "navigationStyle": "custom" |
| 13 | 13 | } |
| 14 | 14 | \ No newline at end of file | ... | ... |
packageC/pages/presell/goodsInfo/goodsInfo.wxml
| 1 | -<com_top_nav title="{{gtitle}}"></com_top_nav> | |
| 1 | +<!-- <com_top_nav title="{{gtitle}}"></com_top_nav> --> | |
| 2 | 2 | <import src="../../../../utils/wxParse/wxParse.wxml"></import> |
| 3 | 3 | <wxs module="filters" src="../../../../utils/filter.wxs"></wxs> |
| 4 | 4 | <wxs module="g_filters" src="g_filter.wxs"></wxs> |
| ... | ... | @@ -6,11 +6,20 @@ |
| 6 | 6 | |
| 7 | 7 | <!-- 判断隐私是不是显示 --> |
| 8 | 8 | <privacy_pop id="privacy_pop" bind:agree_pri="agree_pri"></privacy_pop> |
| 9 | +<!-- 顶开 --> | |
| 10 | +<top_nav wx:if="{{!istop || activeCategoryId>0}}" nav_type="{{-1}}" nav_frontColor="{{nav_frontColor}}" nav_backgroundColor="{{nav_backgroundColor}}" nav_title="{{gtitle}}"></top_nav> | |
| 11 | + | |
| 9 | 12 | |
| 10 | 13 | <block wx:if="{{show}}"> |
| 11 | 14 | <!-- 商品内容区域,普通商品,秒杀,拼团 --> |
| 12 | 15 | <view class="container"> |
| 13 | - <view class="type-navbar" style="top:{{top_nav}}px"> | |
| 16 | + <!-- 自定义顶部的优化 --> | |
| 17 | + <view class="type-navbar_box"> | |
| 18 | + <top_nav id="my-nav" bindclickShare="clickShare" nav_type="{{nav_type}}" is_share="1" | |
| 19 | + nav_frontColor="{{nav_frontColor}}" istop="{{(istop && searchbox_transparent && activeCategoryId==0) ? 1 : 0 }}" nav_backgroundColor="{{nav_backgroundColor}}" nav_title="{{gtitle}}"></top_nav> | |
| 20 | + </view> | |
| 21 | + | |
| 22 | + <view class="type-navbar" style="top:{{top_nav-4}}px"> | |
| 14 | 23 | <view class="type-box" wx:for="{{categories}}" wx:key="categories"> |
| 15 | 24 | <view bindtap="tabClick" class="type-navbar-item {{activeCategoryId==item.id?'type-item-on':''}}" id="{{item.id}}"> |
| 16 | 25 | {{item.name}} | ... | ... |
packageC/pages/presell/goodsInfo/goodsInfo.wxss
pages/goods/goodsInfo/goodsInfo.js
| ... | ... | @@ -278,6 +278,13 @@ Page({ |
| 278 | 278 | |
| 279 | 279 | adding:0 , //加入购物车的避免重复 |
| 280 | 280 | goodInfo_ad:"",//商品详情广告 |
| 281 | + | |
| 282 | + nav_frontColor: "#ffffff", | |
| 283 | + nav_backgroundColor: "#ffffff", | |
| 284 | + nav_type: 2, //导航类型 | |
| 285 | + istop: 0, //是否置顶风格为1 | |
| 286 | + searchbox_transparent: 1, | |
| 287 | + | |
| 281 | 288 | }, |
| 282 | 289 | |
| 283 | 290 | //------初始化加载---------- |
| ... | ... | @@ -1328,6 +1335,13 @@ Page({ |
| 1328 | 1335 | this.setData({ |
| 1329 | 1336 | activeCategoryId: e |
| 1330 | 1337 | }), 1 == e ? this.tabGoodsContent() : 2 == e && this.tabComment(); |
| 1338 | + | |
| 1339 | + if(e>0){ | |
| 1340 | + wx.pageScrollTo({ | |
| 1341 | + scrollTop:0 | |
| 1342 | + }) | |
| 1343 | + } | |
| 1344 | + | |
| 1331 | 1345 | }, |
| 1332 | 1346 | tabClick2: function (t) { |
| 1333 | 1347 | this.setData({ |
| ... | ... | @@ -1371,6 +1385,7 @@ Page({ |
| 1371 | 1385 | activeCategoryId: 1 |
| 1372 | 1386 | }); |
| 1373 | 1387 | |
| 1388 | + | |
| 1374 | 1389 | if (th.data.cat_name == '') { |
| 1375 | 1390 | //过去国别,分类,品牌的名称 |
| 1376 | 1391 | i.get("/api/weshop/goodscategory/get/" + o.stoid + "/" + th.data.data.cat_id, { |
| ... | ... | @@ -9054,4 +9069,31 @@ Page({ |
| 9054 | 9069 | }, |
| 9055 | 9070 | |
| 9056 | 9071 | |
| 9072 | + //滚动监听 | |
| 9073 | + onPageScroll(e) { | |
| 9074 | + this.on_menu_list() | |
| 9075 | + if (this.data.istop) { | |
| 9076 | + let num = e.scrollTop | |
| 9077 | + if (num >= 100) { | |
| 9078 | + this.setData({ | |
| 9079 | + searchbox_transparent: 0 | |
| 9080 | + }) | |
| 9081 | + } | |
| 9082 | + if (num < 100) { | |
| 9083 | + this.setData({ | |
| 9084 | + searchbox_transparent: 1 | |
| 9085 | + }) | |
| 9086 | + } | |
| 9087 | + } | |
| 9088 | + }, | |
| 9089 | + | |
| 9090 | + | |
| 9091 | + //隐藏导航下拉菜单 | |
| 9092 | + on_menu_list() { | |
| 9093 | + let child = this.selectComponent('#my-nav'); | |
| 9094 | + child.hide_menu_fn() | |
| 9095 | + }, | |
| 9096 | + | |
| 9097 | + | |
| 9098 | + | |
| 9057 | 9099 | }) |
| 9058 | 9100 | \ No newline at end of file | ... | ... |
pages/goods/goodsInfo/goodsInfo.json
| ... | ... | @@ -8,7 +8,7 @@ |
| 8 | 8 | "share": "/components/share/share", |
| 9 | 9 | "pro_pop": "/components/promate_pop/promate_pop", |
| 10 | 10 | "privacy_pop": "/components/privacy_pop/privacy_pop", |
| 11 | - "com_top_nav": "/components/com_top_nav/com_top_nav" | |
| 11 | + "top_nav": "/components/diy_top_nav/diy_top_nav" | |
| 12 | 12 | }, |
| 13 | 13 | "navigationStyle": "custom" |
| 14 | 14 | } |
| 15 | 15 | \ No newline at end of file | ... | ... |
pages/goods/goodsInfo/goodsInfo.wxml
| 1 | -<com_top_nav title="{{gtitle}}"></com_top_nav> | |
| 1 | +<!-- 顶部的优化 --> | |
| 2 | +<top_nav wx:if="{{!istop || activeCategoryId>0}}" nav_type="{{-1}}" nav_frontColor="{{nav_frontColor}}" nav_backgroundColor="{{nav_backgroundColor}}" nav_title="{{gtitle}}"></top_nav> | |
| 2 | 3 | |
| 3 | 4 | <!-- 判断隐私是不是显示 --> |
| 4 | 5 | <privacy_pop id="privacy_pop" bind:agree_pri="agree_pri"></privacy_pop> |
| ... | ... | @@ -15,11 +16,19 @@ |
| 15 | 16 | <view class="container"> |
| 16 | 17 | <!-- 拼单规则规则 --> |
| 17 | 18 | <view wx:if="{{prom_type== 6}}" class="rules" bindtap="showRules">规则</view> |
| 18 | - <view class="type-navbar" style="top:{{top_nav}}px"> | |
| 19 | + | |
| 20 | + <view class="type-navbar_box"> | |
| 21 | + <top_nav id="my-nav" bindclickShare="clickShare" nav_type="{{nav_type}}" is_share="1" | |
| 22 | + nav_frontColor="{{nav_frontColor}}" istop="{{(istop && searchbox_transparent && activeCategoryId==0) ? 1 : 0 }}" nav_backgroundColor="{{nav_backgroundColor}}" nav_title="{{gtitle}}"></top_nav> | |
| 23 | + </view> | |
| 24 | + | |
| 25 | + <view class="type-navbar" style="top:{{top_nav-4}}px" wx:if="{{activeCategoryId>0 || !istop || ( istop && !searchbox_transparent)}}" > | |
| 19 | 26 | <view class="type-box" wx:for="{{categories}}" wx:key="id"> |
| 20 | 27 | <view bindtap="tabClick" class="type-navbar-item {{activeCategoryId==item.id?'type-item-on':''}}" id="{{item.id}}">{{item.name}}</view> |
| 21 | 28 | </view> |
| 22 | 29 | </view> |
| 30 | + | |
| 31 | + | |
| 23 | 32 | <view class="goods-detail"> |
| 24 | 33 | <view class="goods-info" style="position: relative;" hidden="{{activeCategoryId==0?false:true}}"> |
| 25 | 34 | ... | ... |
pages/goods/goodsInfo/goodsInfo.wxss
| ... | ... | @@ -4043,4 +4043,11 @@ button.custom-service::after { |
| 4043 | 4043 | border-radius: 30rpx; |
| 4044 | 4044 | border: 2rpx solid rgb(238, 238, 238); |
| 4045 | 4045 | padding-left: 30rpx; |
| 4046 | +} | |
| 4047 | + | |
| 4048 | +.type-navbar_box{ | |
| 4049 | + position: fixed; | |
| 4050 | + top: 0; | |
| 4051 | + z-index: 9999; | |
| 4052 | + width: 100%; | |
| 4046 | 4053 | } |
| 4047 | 4054 | \ No newline at end of file | ... | ... |