diff --git a/dist.rar b/dist.rar index 1437be0..d1fd9e2 100644 Binary files a/dist.rar and b/dist.rar differ diff --git a/src/components/popup/popup-site-swiper.tsx b/src/components/popup/popup-site-swiper.tsx index 4bf4918..f5014ef 100644 --- a/src/components/popup/popup-site-swiper.tsx +++ b/src/components/popup/popup-site-swiper.tsx @@ -98,7 +98,6 @@ export default class PopupSiteSwiper extends Component { `video_no` : '视频号(导向视频号、导向视频号直播间)', `feed_id` : '视频号feedId(导向视频号)', */ - console.log("item", item); let { type } = item; if (type === 0) { return; @@ -170,14 +169,6 @@ export default class PopupSiteSwiper extends Component { }); break; } - // const { current } = this.state; - // const { siteData } = this.props; - // if (current < siteData.length - 1) { - // this.setState({ - // current: current + 1, - // isClick: true, - // }); - // } } onFinish(event) { const { current } = event.detail; diff --git a/src/pages/index/index.tsx b/src/pages/index/index.tsx index 112a35e..52f1124 100644 --- a/src/pages/index/index.tsx +++ b/src/pages/index/index.tsx @@ -305,8 +305,88 @@ class Index extends Component { bannerSwiperchange() {} gobanner(item) { - console.log("item", item); - this.GetSiteAddTag(item.id); + // 跳转类型:0无跳转、1跳转内部链接、3跳转外部链接、4跳转小程序、5导向视频号、6导向视频号直播间', + /** + * `link` : '跳转链接(跳转外部链接、跳转内部链接)', + `link_params` : '跳转链接参数(跳转内部链接)', + `redirect_appid` : '外链小程序appid(跳转小程序)', + `redirect_url` : '外链小程序url(跳转小程序)', + `video_no` : '视频号(导向视频号、导向视频号直播间)', + `feed_id` : '视频号feedId(导向视频号)', + */ + let { type, id } = item; + this.GetSiteAddTag(id); + + if (type === 0) { + return; + } + switch (type) { + case 1: // 跳转内部链接 + if (item.linkParams) { + Taro.reLaunch({ + url: item.link + "?" + item.linkParams, + }); + } else { + Taro.reLaunch({ + url: item.link, + }); + } + break; + case 3: // 跳转外部链接 + if (item.linkParams) { + Taro.navigateTo({ + url: + "/pages/webViewPage/webViewPage?url=" + + item.link + + "?" + + item.linkParams, + }); + } else { + Taro.navigateTo({ + url: "/pages/webViewPage/webViewPage?url=" + item.link, + }); + } + break; + case 4: // 跳转小程序 + Taro.navigateToMiniProgram({ + appId: item.redirectAppid, + path: item.redirectUrl, + success: (res) => { + // 打开成功 + console.log("跳转小程序success", res); + }, + fail: (res) => { + console.log("跳转小程序fail", res); + }, + }); + break; + case 5: // 跳转视频号 + Taro.openChannelsActivity({ + finderUserName: item.videoNo, + feedId: item.feedId, + success: (res) => { + // 打开成功 + console.log("跳转视频号success", res); + }, + fail: (res) => { + console.log("跳转视频号fail", res); + }, + }); + break; + case 6: // 跳转视频号直播间 + Taro.openChannelsLive({ + finderUserName: item.videoNo, + feedId: item.feedId, + success: (res) => { + // 打开成功 + console.log("视频号直播间success", res); + }, + fail: (res) => { + console.log("视频号直播间fail", res); + }, + }); + break; + } } render() {