From c7287bc1f04249c1c355af9ec1c6a0e78d8efcc4 Mon Sep 17 00:00:00 2001 From: yvan.ni Date: Fri, 19 Jan 2024 10:34:08 +0800 Subject: [PATCH] OA单的优化 --- app.js | 16 ++++++++++++++-- components/com_top_nav/com_top_nav.js | 6 +++++- components/com_top_nav/com_top_nav.wxml | 6 +++++- components/diy_top_nav/diy_top_nav.js | 72 ++++++++++++++++++++++++++++++++++++++++-------------------------------- components/diy_top_nav/diy_top_nav.wxml | 6 ++++++ packageA/pages/goodsInfo/goodsInfo.wxml | 2 +- packageA/pages/serviceCard_pd/goodsInfo/goodsInfo.wxml | 2 +- packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.js | 9 ++++++++- packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.wxml | 13 ++++++++++++- packageC/pages/presell/cardInfo/goodsInfo.wxml | 2 +- packageC/pages/presell/goodsInfo/goodsInfo.js | 9 ++++++++- packageC/pages/presell/goodsInfo/goodsInfo.wxml | 18 ++++++++++++++++-- pages/giftpack/giftpacklist/giftpacklist.js | 3 ++- pages/goods/goodsInfo/goodsInfo.js | 9 ++++++++- pages/goods/goodsInfo/goodsInfo.wxml | 14 +++++++++++++- 15 files changed, 140 insertions(+), 47 deletions(-) diff --git a/app.js b/app.js index cc84722..bca94af 100644 --- a/app.js +++ b/app.js @@ -51,7 +51,7 @@ App({ config: null, //门店参数 config2: null, //门店配置 code: null, - user_id:null,//6520352 + user_id:null,//6520491,// 6519913,//6520352 // user_id:6520314,// qa-6519858,// // user_id:14148118,// qa-6519858,// buy_now: null, @@ -75,6 +75,7 @@ App({ sp_scene: null, navBarHeight:44, //默认高度44 + is_pc:0, //是不是在pc端打开小程序 }, auth: o, request: a, @@ -202,7 +203,16 @@ App({ if (modelmes && modelmes.indexOf('iPhone X') != -1) {  //XS,XR,XS MAX均可以适配,因为indexOf()会将包含'iPhone X'的字段都查出来 this.globalData.isIpx = true } - this.globalData.navBarHeight = 44 + res.statusBarHeight + + /*-- 判断是不是PC端打开的 */ + if (res && ["windows", "mac"].some((v) => v === res["platform"])) { + app.globalData.is_pc=1; + this.globalData.navBarHeight =0 + }else{ + this.globalData.navBarHeight = 44 + res.statusBarHeight + } + + }, }) this.globalData.menuInfo = wx.getMenuButtonBoundingClientRect() || {} @@ -1636,6 +1646,8 @@ App({ } a.wxParse(content, "html", ut.format_content(ob.text), th, 6); e.wxParseAddFullImageUrl(th, content); + + }, async deal_iframe_next(ob){ diff --git a/components/com_top_nav/com_top_nav.js b/components/com_top_nav/com_top_nav.js index 10f442e..cd12ba4 100644 --- a/components/com_top_nav/com_top_nav.js +++ b/components/com_top_nav/com_top_nav.js @@ -19,7 +19,8 @@ Component({ height:0, h1:0, h2:0, - user_id:0 + user_id:0, + is_pc:0 }, ready: function() { let height= getApp().globalData.navBarHeight; @@ -30,6 +31,9 @@ Component({ } //-- 胶囊的高度 -- this.setData({height,h1:menuInfo.top,h2:menuInfo.height,user_no}); + if(getApp().globalData.is_pc){ + this.setData({is_pc:1}) + } }, pageLifetimes: { //要处理一下,游客登录后的界面的变化,主要还该是改变会员 diff --git a/components/com_top_nav/com_top_nav.wxml b/components/com_top_nav/com_top_nav.wxml index 4f1b623..49ce91b 100644 --- a/components/com_top_nav/com_top_nav.wxml +++ b/components/com_top_nav/com_top_nav.wxml @@ -1,4 +1,6 @@ + + @@ -31,4 +33,6 @@ - \ No newline at end of file + + + \ No newline at end of file diff --git a/components/diy_top_nav/diy_top_nav.js b/components/diy_top_nav/diy_top_nav.js index 014ae36..7001086 100644 --- a/components/diy_top_nav/diy_top_nav.js +++ b/components/diy_top_nav/diy_top_nav.js @@ -65,43 +65,51 @@ Component({ // img:'', // url:'' // }, - ] + ], + is_pc:0 }, lifetimes:{ attached:function(){ - //满屏顶部导航参数获取----------- - try { - let systemInfo = wx.getSystemInfoSync() - let mentButt = wx.getMenuButtonBoundingClientRect() - let nav_pb = mentButt.top - systemInfo.statusBarHeight - let navleft_pb = systemInfo.windowWidth - mentButt.right - let user_no=''; - if(getApp().globalData.userInfo){ - user_no=getApp().globalData.userInfo.erpvipno - } + var is_pc=getApp().globalData.is_pc; + if(!is_pc) { + + //满屏顶部导航参数获取----------- + try { + let systemInfo = wx.getSystemInfoSync() + let mentButt = wx.getMenuButtonBoundingClientRect() + let nav_pb = mentButt.top - systemInfo.statusBarHeight + let navleft_pb = systemInfo.windowWidth - mentButt.right + + let user_no = ''; + if (getApp().globalData.userInfo) { + user_no = getApp().globalData.userInfo.erpvipno + } - this.setData({ - nav_h:mentButt.top, - mentButt_h:mentButt.height, - nav_left_w:mentButt.left, - navleft_pb, - nav_pb, - navleft_w:mentButt.width*0.9, - user_no - }) - } catch (e) { - console.error(e); - wx.showToast({ - title: '系统参数获取失败', - icon: 'none', - duration: 2000 - }) - // this.setData({ - // is_full_screen_navigation:false - // }) - // Do something when catch error - } + this.setData({ + nav_h: mentButt.top, + mentButt_h: mentButt.height, + nav_left_w: mentButt.left, + navleft_pb, + nav_pb, + navleft_w: mentButt.width * 0.9, + user_no + }) + } catch (e) { + console.error(e); + wx.showToast({ + title: '系统参数获取失败', + icon: 'none', + duration: 2000 + }) + // this.setData({ + // is_full_screen_navigation:false + // }) + // Do something when catch error + } + }else{ + this.setData({is_pc:1}); + } } }, /** diff --git a/components/diy_top_nav/diy_top_nav.wxml b/components/diy_top_nav/diy_top_nav.wxml index 618306b..f092e3d 100644 --- a/components/diy_top_nav/diy_top_nav.wxml +++ b/components/diy_top_nav/diy_top_nav.wxml @@ -1,9 +1,13 @@ + + + + @@ -67,3 +71,5 @@ 1212121 + + \ No newline at end of file diff --git a/packageA/pages/goodsInfo/goodsInfo.wxml b/packageA/pages/goodsInfo/goodsInfo.wxml index 23f13df..451107d 100644 --- a/packageA/pages/goodsInfo/goodsInfo.wxml +++ b/packageA/pages/goodsInfo/goodsInfo.wxml @@ -15,7 +15,7 @@ nav_frontColor="{{nav_frontColor}}" istop="{{(istop && searchbox_transparent && activeCategoryId==0) ? 1 : 0 }}" nav_backgroundColor="{{nav_backgroundColor}}" nav_title="{{gtitle}}"> - + {{item.name}} diff --git a/packageA/pages/serviceCard_pd/goodsInfo/goodsInfo.wxml b/packageA/pages/serviceCard_pd/goodsInfo/goodsInfo.wxml index 73be720..f042b28 100644 --- a/packageA/pages/serviceCard_pd/goodsInfo/goodsInfo.wxml +++ b/packageA/pages/serviceCard_pd/goodsInfo/goodsInfo.wxml @@ -17,7 +17,7 @@ nav_frontColor="{{nav_frontColor}}" istop="{{(istop && searchbox_transparent && activeCategoryId==0) ? 1 : 0 }}" nav_backgroundColor="{{nav_backgroundColor}}" nav_title="{{gtitle}}"> - + {{item.name}} diff --git a/packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.js b/packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.js index 1d48410..ca07bb0 100644 --- a/packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.js +++ b/packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.js @@ -495,7 +495,14 @@ Page({ //------几人评价------- //n.init(th, "", "comments"); - if(e && e.goods_bottomconent){ + if(e && e.goods_topconent && e.goods_ad_position.indexOf('1')>-1){ + //商品详情广告---- + a.wxParse("goodInfo_ad2", "html", ut.format_content(e.goods_topconent), ee, 6); + common.wxParseAddFullImageUrl(ee, "goodInfo_ad2"); + //------- + } + + if(e && e.goods_bottomconent && e.goods_ad_position.indexOf('2')>-1){ //商品详情广告---- a.wxParse("goodInfo_ad", "html", ut.format_content(e.goods_bottomconent), ee, 6); common.wxParseAddFullImageUrl(ee, "goodInfo_ad"); diff --git a/packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.wxml b/packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.wxml index efa5522..804df2b 100644 --- a/packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.wxml +++ b/packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.wxml @@ -20,7 +20,7 @@ - + {{item.name}} @@ -681,6 +681,10 @@ + + + + @@ -689,6 +693,7 @@ + @@ -768,6 +773,12 @@ + + + + + + diff --git a/packageC/pages/presell/cardInfo/goodsInfo.wxml b/packageC/pages/presell/cardInfo/goodsInfo.wxml index 4067a4e..c0e78b1 100644 --- a/packageC/pages/presell/cardInfo/goodsInfo.wxml +++ b/packageC/pages/presell/cardInfo/goodsInfo.wxml @@ -16,7 +16,7 @@ - + {{item.name}} diff --git a/packageC/pages/presell/goodsInfo/goodsInfo.js b/packageC/pages/presell/goodsInfo/goodsInfo.js index f3a9be6..d84461d 100644 --- a/packageC/pages/presell/goodsInfo/goodsInfo.js +++ b/packageC/pages/presell/goodsInfo/goodsInfo.js @@ -423,7 +423,14 @@ Page({ }); - if(e && e.goods_bottomconent){ + if(e && e.goods_topconent && e.goods_ad_position.indexOf('1')>-1){ + //商品详情广告---- + a.wxParse("goodInfo_ad2", "html", ut.format_content(e.goods_topconent), ee, 6); + common.wxParseAddFullImageUrl(ee, "goodInfo_ad2"); + //------- + } + + if(e && e.goods_bottomconent && e.goods_ad_position.indexOf('2')>-1){ //商品详情广告---- a.wxParse("goodInfo_ad", "html", ut.format_content(e.goods_bottomconent), ee, 6); common.wxParseAddFullImageUrl(ee, "goodInfo_ad"); diff --git a/packageC/pages/presell/goodsInfo/goodsInfo.wxml b/packageC/pages/presell/goodsInfo/goodsInfo.wxml index 4197a1d..edb17bb 100644 --- a/packageC/pages/presell/goodsInfo/goodsInfo.wxml +++ b/packageC/pages/presell/goodsInfo/goodsInfo.wxml @@ -19,7 +19,7 @@ nav_frontColor="{{nav_frontColor}}" istop="{{(istop && searchbox_transparent && activeCategoryId==0) ? 1 : 0 }}" nav_backgroundColor="{{nav_backgroundColor}}" nav_title="{{gtitle}}"> - + {{item.name}} @@ -346,14 +346,21 @@ + + + + + + - + + @@ -440,6 +447,13 @@ + + + + + + + diff --git a/pages/giftpack/giftpacklist/giftpacklist.js b/pages/giftpack/giftpacklist/giftpacklist.js index a41a257..55dbbf6 100644 --- a/pages/giftpack/giftpacklist/giftpacklist.js +++ b/pages/giftpack/giftpacklist/giftpacklist.js @@ -526,7 +526,8 @@ Page({ data: { "storeId": a.stoid, //商家ID "userId": d.user_id, //用户ID - "giftBagId": th.getGiftID + "giftBagId": th.getGiftID, + isnNewUserLb:1 }, success: function success(res) { if (res.data.code == 0) { diff --git a/pages/goods/goodsInfo/goodsInfo.js b/pages/goods/goodsInfo/goodsInfo.js index 7b396c3..9ba930a 100644 --- a/pages/goods/goodsInfo/goodsInfo.js +++ b/pages/goods/goodsInfo/goodsInfo.js @@ -517,8 +517,15 @@ Page({ // goods_bottomconent:e.goods_bottomconent }); + if(e && e.goods_topconent && e.goods_ad_position.indexOf('1')>-1){ + //商品详情广告---- + a.wxParse("goodInfo_ad2", "html", ut.format_content(e.goods_topconent), ee, 6); + common.wxParseAddFullImageUrl(ee, "goodInfo_ad2"); + //------- + } + //判断商品详情要有东西 - if(e && e.goods_bottomconent) { + if(e && e.goods_bottomconent && e.goods_ad_position.indexOf('2')>-1) { //商品详情广告---- a.wxParse("goodInfo_ad", "html", ut.format_content(e.goods_bottomconent), ee, 6); common.wxParseAddFullImageUrl(ee, "goodInfo_ad"); diff --git a/pages/goods/goodsInfo/goodsInfo.wxml b/pages/goods/goodsInfo/goodsInfo.wxml index 874237f..4c53f0f 100644 --- a/pages/goods/goodsInfo/goodsInfo.wxml +++ b/pages/goods/goodsInfo/goodsInfo.wxml @@ -22,7 +22,7 @@ nav_frontColor="{{nav_frontColor}}" istop="{{(istop && searchbox_transparent && activeCategoryId==0) ? 1 : 0 }}" nav_backgroundColor="{{nav_backgroundColor}}" nav_title="{{gtitle}}"> - + {{item.name}} @@ -878,6 +878,12 @@ + + + + + + @@ -965,6 +971,12 @@ + + + + + + -- libgit2 0.21.4