From 23107995469634e762501d3a15eb8ece710c1904 Mon Sep 17 00:00:00 2001 From: luo <17530855@qq.com> Date: Tue, 13 Sep 2022 09:34:29 +0800 Subject: [PATCH] OA 单 跳转视频号 --- app.js | 63 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ components/diy_advertising/diy_advertising.js | 11 ++++++++++- components/diy_advertising/diy_advertising.wxml | 115 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ components/diy_goodsGroup/diy_goodsGroup.js | 34 +++++++++++++++++++++++++--------- components/diy_nav/diy_nav.js | 12 ++++++++++++ components/diy_nav/diy_nav.wxml | 10 ++++++++++ components/diy_notice/diy_notice.js | 10 ++++++++++ components/diy_notice/diy_notice.wxml | 14 ++++++++++++++ components/diy_picMax/diy_picMax.js | 11 ++++++++++- components/diy_picMax/diy_picMax.wxml | 8 ++++++++ components/diy_title/diy_title.js | 12 +++++++++++- components/diy_title/diy_title.wxml | 11 +++++++++++ 12 files changed, 299 insertions(+), 12 deletions(-) diff --git a/app.js b/app.js index 59fa07e..ab59cec 100644 --- a/app.js +++ b/app.js @@ -52,6 +52,8 @@ App({ config2: null, //门店配置 code: null, user_id:null,// qa-6519858,// + // user_id:6520314,// qa-6519858,// + // user_id:14148118,// qa-6519858,// buy_now: null, picklist: null, //门店列表 wuliuprice: null, //物流价格表 @@ -1197,5 +1199,66 @@ App({ }; }, + //跳转视频号 + openChannelsActivity(obj){ + if (!obj.finderUserName) { + wx.showToast({ + title: '参数缺少,跳转失败', + duration: 2000, + }); + } + console.log('视频号参数:') + console.log(obj) + if (obj.video_type==1) { //1是直播 2 是 视频 + wx.getChannelsLiveInfo({ + finderUserName:obj.finderUserName, + success:(res)=>{ + let {feedId ,status,nonceId} = res + if (true || status == 2) { + wx.openChannelsLive({ + finderUserName:obj.finderUserName, + feedId, + nonceId, + success:()=>{ + console.log('进入直播间成功') + }, + fail:(error)=>{ + console.log('进入直播间失败') + console.log(error) + } + }) + } + }, + fail:(error)=>{ + console.log('跳转失败1') + console.log(error) + wx.showModal({ + title: '提示', + content: '获取直播失败:'+error.err_code, + showCancel:false, + success (res) { + if (res.confirm) { + console.log('用户点击确定') + } else if (res.cancel) { + console.log('用户点击取消') + } + } + }) + } + }) + }else{ + wx.openChannelsActivity({ + finderUserName:obj.finderUserName, + feedId:obj.feedId, + success:()=>{ + console.log('跳转成功') + }, + fail:(error)=>{ + console.log('跳转失败') + console.log(error) + } + }) + } + }, }); diff --git a/components/diy_advertising/diy_advertising.js b/components/diy_advertising/diy_advertising.js index 91c128d..a1f66ce 100644 --- a/components/diy_advertising/diy_advertising.js +++ b/components/diy_advertising/diy_advertising.js @@ -43,7 +43,16 @@ Component({ var url=e.currentTarget.dataset.url; getApp().goto(url); }, - + nv_void(e){ + var feedId=e.currentTarget.dataset.feedid; + var finderUserName=e.currentTarget.dataset.finderusername; + var video_type=e.currentTarget.dataset.video_type; + getApp().openChannelsActivity({ + feedId, + finderUserName, + video_type + }) + }, imageLoad:function(e){ var imgwidth = e.detail.width; var imgheight = e.detail.height; diff --git a/components/diy_advertising/diy_advertising.wxml b/components/diy_advertising/diy_advertising.wxml index 9ef022d..97f2898 100644 --- a/components/diy_advertising/diy_advertising.wxml +++ b/components/diy_advertising/diy_advertising.wxml @@ -19,6 +19,11 @@ + + + + + @@ -53,6 +58,11 @@ + + + + + @@ -97,6 +107,12 @@ + + + + + + @@ -140,6 +156,11 @@ + + + + + @@ -171,6 +192,12 @@ + + + + + + @@ -202,6 +229,11 @@ + + + + + @@ -234,6 +266,11 @@ + + + + + @@ -265,6 +302,11 @@ + + + + + @@ -304,6 +346,11 @@ + + + + + @@ -334,6 +381,11 @@ + + + + + @@ -367,6 +419,11 @@ + + + + + @@ -397,6 +454,11 @@ + + + + + @@ -434,6 +496,11 @@ + + + + + @@ -464,6 +531,11 @@ + + + + + @@ -498,6 +570,11 @@ + + + + + @@ -528,6 +605,11 @@ + + + + + @@ -567,6 +649,11 @@ + + + + + @@ -597,6 +684,11 @@ + + + + + @@ -631,6 +723,11 @@ + + + + + @@ -655,6 +752,11 @@ + + + + + @@ -683,6 +785,11 @@ + + + + + @@ -721,6 +828,14 @@ + + + + + {{item.title}} + + + diff --git a/components/diy_goodsGroup/diy_goodsGroup.js b/components/diy_goodsGroup/diy_goodsGroup.js index 980be53..1ee8e01 100644 --- a/components/diy_goodsGroup/diy_goodsGroup.js +++ b/components/diy_goodsGroup/diy_goodsGroup.js @@ -29,7 +29,8 @@ Component({ imghost: o.imghost, is_recommend: 0, is_hot: 0, - is_new: 0, + is_new: 0, + isyhgoods:0, baseUrl: "/api/weshop/goods/page", resourceUrl: t.globalData.setting.resourceUrl, url: t.globalData.setting.imghost, @@ -77,7 +78,7 @@ Component({ //最新的版本才有nav_list if (nav_list) { - nav_item = nav_list[0]; + nav_item = nav_list[0]; //要算一下商品goodsid for (var ij in nav_list) { var item = nav_list[ij]; @@ -134,6 +135,9 @@ Component({ if (nav_item && nav_item.goodsclass == 3) { this.data.is_new = 1 } + if (nav_item && nav_item.goodsclass == 4) { + this.data.isyhgoods = 1 + } this.data.requestData = new Array(); this.data.g_id = nav_item.data; @@ -225,6 +229,7 @@ Component({ if (th.data.is_recommend) r_data.is_recommend = th.data.is_recommend; if (th.data.is_hot) r_data.is_hot = th.data.is_hot; if (th.data.is_new) r_data.is_new = th.data.is_new; + if (th.data.isyhgoods) r_data.isyhgoods = th.data.isyhgoods; var user_id = getApp().globalData.user_id; if (!user_id) user_id = 0; @@ -239,7 +244,7 @@ Component({ th.setData({ goods_btn: res.data.data.pageData, total: res.data.data.total - }) + }) th.data.currentPage++; //设置商品熏染 th.set_good(goods); @@ -277,12 +282,20 @@ Component({ }, setLoading: function () { - var that = this; - if (this.data.loading) return false; - this.data.loading = 1; - that.init(that.data.classstyle_id, that.data.wgroup); + if(this.data.object.column==5){return} + if( this.data.goods_btn.length!=0 || this.data.object.goodscount*this.data.page ', url); getApp().goto(url); + }, + nv_void(e){ + console.log('导航') + console.log(e) + var feedId=e.currentTarget.dataset.feedid; + var finderUserName=e.currentTarget.dataset.finderusername; + var video_type=e.currentTarget.dataset.video_type; + getApp().openChannelsActivity({ + feedId, + finderUserName, + video_type + }) } } }) \ No newline at end of file diff --git a/components/diy_nav/diy_nav.wxml b/components/diy_nav/diy_nav.wxml index 4ab5090..ed60f50 100644 --- a/components/diy_nav/diy_nav.wxml +++ b/components/diy_nav/diy_nav.wxml @@ -13,6 +13,11 @@ + + + + + @@ -36,6 +41,11 @@ + + + + + diff --git a/components/diy_notice/diy_notice.js b/components/diy_notice/diy_notice.js index 16cb045..27c7776 100644 --- a/components/diy_notice/diy_notice.js +++ b/components/diy_notice/diy_notice.js @@ -26,5 +26,15 @@ Component({ var url=e.currentTarget.dataset.url; getApp().goto(url); }, + nv_void(e){ + var feedId=e.currentTarget.dataset.feedid; + var finderUserName=e.currentTarget.dataset.finderusername; + var video_type=e.currentTarget.dataset.video_type; + getApp().openChannelsActivity({ + feedId, + finderUserName, + video_type + }) + } } }) \ No newline at end of file diff --git a/components/diy_notice/diy_notice.wxml b/components/diy_notice/diy_notice.wxml index 6086942..2f45c6f 100644 --- a/components/diy_notice/diy_notice.wxml +++ b/components/diy_notice/diy_notice.wxml @@ -32,6 +32,20 @@ + + + + + + + {{object.noticetxt}} + {{object.noticetxt}} + {{object.noticetxt}} + + + + + diff --git a/components/diy_picMax/diy_picMax.js b/components/diy_picMax/diy_picMax.js index a293a74..fd3bb0e 100644 --- a/components/diy_picMax/diy_picMax.js +++ b/components/diy_picMax/diy_picMax.js @@ -32,7 +32,16 @@ Component({ var url = e.currentTarget.dataset.url; getApp().goto(url); }, - + nv_void(e){ + var feedId=e.currentTarget.dataset.feedid; + var finderUserName=e.currentTarget.dataset.finderusername; + var video_type=e.currentTarget.dataset.video_type; + getApp().openChannelsActivity({ + feedId, + finderUserName, + video_type + }) + }, previewImage(e){ let src =e.currentTarget.dataset.src; wx.previewImage({ diff --git a/components/diy_picMax/diy_picMax.wxml b/components/diy_picMax/diy_picMax.wxml index 77393e1..a6b21a2 100644 --- a/components/diy_picMax/diy_picMax.wxml +++ b/components/diy_picMax/diy_picMax.wxml @@ -14,6 +14,10 @@ + + + + @@ -34,6 +38,10 @@ + + + + diff --git a/components/diy_title/diy_title.js b/components/diy_title/diy_title.js index 20d76fc..cef6ad0 100644 --- a/components/diy_title/diy_title.js +++ b/components/diy_title/diy_title.js @@ -24,6 +24,16 @@ Component({ var txt="object.title_img"; ob[txt] = iurl +'/miniapp/images/logo.png?v=1'; this.setData(ob); - } + }, + nv_void(e){ + var feedId=e.currentTarget.dataset.feedid; + var finderUserName=e.currentTarget.dataset.finderusername; + var video_type=e.currentTarget.dataset.video_type; + getApp().openChannelsActivity({ + feedId, + finderUserName, + video_type + }) + } } }) diff --git a/components/diy_title/diy_title.wxml b/components/diy_title/diy_title.wxml index eba7b92..3e71532 100644 --- a/components/diy_title/diy_title.wxml +++ b/components/diy_title/diy_title.wxml @@ -13,6 +13,9 @@ {{object.title_name}} + + {{object.title_name}} + {{object.title_name}} @@ -38,6 +41,14 @@ + + + + {{object.title_right}} + + + + -- libgit2 0.21.4