Commit 7a847c25 by 李嘉林

Merge branch 'nativehome_tst' of http://code.mayi888.com/chengmo/mayi-mp-shop into nativehome_tst

parents 65b96a15 51970295
...@@ -2,6 +2,17 @@ const app = getApp() ...@@ -2,6 +2,17 @@ const app = getApp()
console.log(app, 'apppppppppp') console.log(app, 'apppppppppp')
Component({ Component({
pageLifetimes: {
show() {
console.log('哈哈哈哈')
if (typeof this.getTabBar === 'function' &&
this.getTabBar()) {
this.getTabBar().setData({
selected: 1
})
}
}
},
data: { data: {
selected: 0, selected: 0,
color: "#7A7E83", color: "#7A7E83",
...@@ -65,7 +76,9 @@ Component({ ...@@ -65,7 +76,9 @@ Component({
} }
// ----------webview 变化 // ----------webview 变化
console.log('启动1111') console.log('启动1111',this.getTabBar())
app.webviewCallBack = function (state,params) { app.webviewCallBack = function (state,params) {
console.log('webview变化',state,params) console.log('webview变化',state,params)
} }
...@@ -75,27 +88,22 @@ Component({ ...@@ -75,27 +88,22 @@ Component({
}, },
switchTab(e) { switchTab(e) {
// mpApp.$themeToLink //
const { const {
index index
} = e.currentTarget.dataset } = e.currentTarget.dataset
console.log('755555555', this.data.list[index].link) console.log('755555555', this.data.list[index].link)
// if (index == this.data.selected) return
app.globalData.tabBarPageLink=this.data.list[index].link.link
console.log(app,'aaaa') app.$themeToLink(this.data.list[index]['link'],1)
this.toPage(this.data.list[index].link,index)
// return // this.toPage(this.data.list[index].link,index)
// app.$themeToLink(this.data.list[index].link)
// this.setData({ // this.setData({
// selected: index // selected: index
// }) // })
}, },
toPage(data,index){ toPage(data,index){
console.log('index98',index) console.log('index98',index,this)
// index=index==0?index+1:index
// 跳转 // 跳转
if (data.link=='/') { if (data.link=='/') {
wx.switchTab({ wx.switchTab({
......
<!--miniprogram/custom-tab-bar/index.wxml--> <!--miniprogram/custom-tab-bar/index.wxml-->
<cover-view class="tab-bar"> <cover-view class="tab-bar">
<cover-view class="antt ant-daipinglun"></cover-view>
<cover-view class="iconfont icon-fenzhi">3</cover-view>
<cover-view class="tab-bar-border"></cover-view> <cover-view class="tab-bar-border"></cover-view>
<cover-view wx:for="{{list}}" wx:key="index" class="tab-bar-item" data-path="{{item.link}}" data-index="{{index}}" <cover-view wx:for="{{list}}" wx:key="index" class="tab-bar-item" data-path="{{item.link}}" data-index="{{index}}"
bindtap="switchTab"> bindtap="switchTab">
......
@font-face {font-family: "iconfont";
src: url('//at.alicdn.com/t/font_1457682_3rf83d24buy.eot?t=1604541583326'); /* IE9 */
src: url('//at.alicdn.com/t/font_1457682_3rf83d24buy.eot?t=1604541583326#iefix') format('embedded-opentype'), /* IE6-IE8 */
url('data:application/x-font-woff2;charset=utf-8;base64,d09GMgABAAAAAB+8AAsAAAAAOPAAAB9sAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHEIGVgCKAArYJMYzATYCJAOBSAtmAAQgBYRtB4RVG84uZYYYbBwA8mZfQ1HUKMFIzf7/Y3IyhoAJunlfbDhYyE6hD5oW7eKw2VjpX7AvFUdu+qNkCq8yjvI06x3+PJwBk59pVTuPt6WtTlJGkW9Lw8qwsuf7rvK8mXcoQUJRy9/37l56KQVPSBaFUAiF8GiUREgcDiFBUUP6/zBnprGbA8lOdg+InwV+AwmWw90i+2N95S8o4bYXKvDCAYFj/44gAAiq295305SkFFBc+hRFYZoFFGUYWdrwtM1/x4ESwgESxlmIMhvBxk1oq0AXTp2BkXNrc1XfhfYcq3bGyvjGWl2lrsKFuv55FLKDUSSY3CfUGMDB5D4BAm7mbbM+XOG9PSWkYiOVMWu/mCAr6lzgSq6VUUFGBei6IIu6TVJPJ2aIPg8n3DTBgi1uguVdfRkHGiAlONXtT+39abbPSR8mhuUKTvpat1LXPIwF6D6WfCBd+z+dZSsdBkgBqlYvT8EfLpqDLmU1M/bdakbSrsdLGvtIy7IOPMsKIHVc51IBSb5LnnVoHdpBO0AVAJbUpU+Zqqjiy3C9vGR0YglSo6zH71GZda4/w/s+5Ltqcxhe0K5hQFzbkhnV4fHgNh55PgPMmq1PBbdlXbwFzYg6gs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0CuI1UQ8U7f38QxOArgmbz7HNzLfq8J/hGOFZ/6c5KFRBpmZER3tsaoL0jbdZcT2x9N9YjlhxzNCMhU8VVgekeMtViO6absEZqZVsSe5FTY6iT+pIdPmbaG0zOS5qn0iCGdbV0vOeRuooppWoTcpTfqe799ju30Ps/VMcdJH1pD5Bmyk+A9r7iWfokf4P6bkG2qQbTI7bmsTQxvxjo+N+clcKzMV5jydl5kbjCWgEe1qzVxMeZjTmZ6sG4Gvh/pg2I1Tg1hVBn2HVQgySSo+y0sjPWI7K/YU1KR4Klh5c8ayUh/B9DDyLiusl33TOl3Q/uFEfLEiiTXCUgT1rGTwhqSaN6JPrfnps+2APaTl3Bdm93L27CQAA') format('woff2'),
url('//at.alicdn.com/t/font_1457682_3rf83d24buy.woff?t=1604541583326') format('woff'),
url('//at.alicdn.com/t/font_1457682_3rf83d24buy.ttf?t=1604541583326') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+ */
url('//at.alicdn.com/t/font_1457682_3rf83d24buy.svg?t=1604541583326#iconfont') format('svg'); /* iOS 4.1- */
}
.iconfont {
font-family: "iconfont" !important;
font-size: 16px;
font-style: normal;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.icon-tuceng1:before {
content: "\e692";
}
.icon-tuceng2:before {
content: "\e706";
}
.icon-fenzhi:before {
content: "\e629";
}
.icon-tuceng:before {
content: "\e621";
}
.icon-mokuai:before {
content: "\e604";
}
.icon-fengge:before {
content: "\e607";
}
.icon-iconfontquestion:before {
content: "\e60b";
}
.icon-bianji:before {
content: "\e637";
}
.icon-shezhi:before {
content: "\e781";
}
.icon-lui-dot:before {
content: "\e66";
}
.icon-Notvisible:before {
content: "\e6fe";
}
.icon-browse:before {
content: "\e745";
}
.icon-qingkong1:before {
content: "\e624";
}
.icon-zhongxin:before {
content: "\e68b";
}
.icon-tianjia:before {
content: "\e602";
}
.icon-shangchuantupian11:before {
content: "\c652";
}
.icon-daoru1:before {
content: "\e63b";
}
.icon-theme-fenxiang:before {
content: "\e610";
}
.icon-tuijian:before {
content: "\e63f";
}
.icon-huodong:before {
content: "\e606";
}
.icon-huodong1:before {
content: "\e61f";
}
.icon-tuijian1:before {
content: "\e620";
}
.icon-wode:before {
content: "\e603";
}
.icon-gouwuche:before {
content: "\e605";
}
.icon-fenlei1:before {
content: "\e649";
}
.icon-home:before {
content: "\e64b";
}
.icon-in_gouxuan:before {
content: "\e601";
}
.icon-jiahao:before {
content: "\e61c";
}
.icon-tupian2:before {
content: "\e636";
}
.icon-gonggao:before {
content: "\e611";
}
.icon-dazhuanpan:before {
content: "\e616";
}
.icon-duoxingwenben:before {
content: "\e7e1";
}
.icon-xianshiqianggou:before {
content: "\e633";
}
.icon-icon-test:before {
content: "\e61d";
}
.icon-liebiao:before {
content: "\e627";
}
.icon-article:before {
content: "\e7e7";
}
.icon-fengexian:before {
content: "\e66e";
}
.icon-lunboxiaoguo:before {
content: "\e675";
}
.icon-youhuiquan:before {
content: "\e697";
}
.icon-zixun:before {
content: "\e66c";
}
.icon-lianjie:before {
content: "\e623";
}
.icon-guanggaolianmeng:before {
content: "\e7dd";
}
.icon-fabu:before {
content: "\e600";
}
.icon-pintu:before {
content: "\e61e";
}
.icon-fanhui:before {
content: "\e60a";
}
.icon-shanchuguanbicha:before {
content: "\e809";
}
.icon-shanchu1:before {
content: "\e6d0";
}
.icon-shanchu:before {
content: "\e609";
}
.icon-iconset0308:before {
content: "\e6cf";
}
page { page {
--main-color: #ffffff; --main-color: #ffffff;
--minor-color: #ffffff; --minor-color: #ffffff;
......
...@@ -53,6 +53,8 @@ export default { ...@@ -53,6 +53,8 @@ export default {
let defaultComponentModel = res.data.data.shopThemeData; let defaultComponentModel = res.data.data.shopThemeData;
this.mpApp.globalData.shopThemeData = res.data.data.shopThemeData; this.mpApp.globalData.shopThemeData = res.data.data.shopThemeData;
this.mpApp.globalData.shopInfo=res.data.data;
// 获取底部栏数据 // 获取底部栏数据
let val = JSON.parse(defaultComponentModel); let val = JSON.parse(defaultComponentModel);
if (val && val.defaultComponentModel) { if (val && val.defaultComponentModel) {
......
<template> <template>
<div class="domain"> <div class="domain">
<view class="ant-daipinglun">1</view>
<!-- <goods-list id="goodsList"></goods-list> --> <!-- <goods-list id="goodsList"></goods-list> -->
<scroll-view @scroll="scrolls" @scrolltolower="scrolltolower" style="height:100vh;" scroll-y="true"> <scroll-view @scroll="scrolls" @scrolltolower="scrolltolower" style="height:100vh;" scroll-y="true">
<div v-for="(item,index) in pageData" :key="index"> <div v-for="(item,index) in pageData" :key="index">
...@@ -24,7 +25,7 @@ ...@@ -24,7 +25,7 @@
src="http://cdn.mayi888.com/public/jpg/33ff0efc-96b5-4044-a65a-07799dfe98e1.jpg?x-oss-process=image/resize,limit_1,w_750" src="http://cdn.mayi888.com/public/jpg/33ff0efc-96b5-4044-a65a-07799dfe98e1.jpg?x-oss-process=image/resize,limit_1,w_750"
></image> ></image>
<van-button type="primary">按钮</van-button> <van-button type="primary">按钮</van-button>
<view class="ant-bofang">1</view> --> -->
<!-- ----瀑布流开始---- --> <!-- ----瀑布流开始---- -->
<!-- <waterfall-flow id="waterfallFlow"></waterfall-flow> --> <!-- <waterfall-flow id="waterfallFlow"></waterfall-flow> -->
<!-- ----瀑布流结束---- --> <!-- ----瀑布流结束---- -->
...@@ -37,6 +38,8 @@ ...@@ -37,6 +38,8 @@
</template> </template>
<script> <script>
import { setTabBarActive, checkTabbarPage } from "../../utils/mayi.js";
export default { export default {
data() { data() {
return { return {
...@@ -54,11 +57,16 @@ export default { ...@@ -54,11 +57,16 @@ export default {
}; };
} }
}, },
onShow() {
setTabBarActive.bind(this)(checkTabbarPage('/'));
},
methods: { methods: {
init(pageList) { init(pageList) {
setTabBarActive.bind(this)(checkTabbarPage('/'));
this.pageInfo = pageList.filter((item) => item.pageCode == 1)[0]; this.pageInfo = pageList.filter((item) => item.pageCode == 1)[0];
this.pageData = JSON.parse(this.pageInfo.pageData); this.pageData = JSON.parse(this.pageInfo.pageData);
console.log('36',this.pageData) console.log("36", this.pageData);
}, },
scrolls(el){ scrolls(el){
console.log('scroll') console.log('scroll')
...@@ -73,7 +81,7 @@ export default { ...@@ -73,7 +81,7 @@ export default {
<style> <style>
.domain { .domain {
text-align: center; /* text-align: center; */
/* padding-top: 50%; */ /* padding-top: 50%; */
} }
</style> </style>
\ No newline at end of file
...@@ -79,15 +79,6 @@ export default { ...@@ -79,15 +79,6 @@ export default {
this.options = options; this.options = options;
Object.assign(this.$data, this.$options.data()); Object.assign(this.$data, this.$options.data());
console.log(
wx.getStorageSync("sessionid"),
options,
"index------",
this.shopId,
"-----",
wx.getStorageSync("openid"),
this.shopId
);
//获取openId //获取openId
wx.login({ wx.login({
success: res => { success: res => {
...@@ -109,21 +100,7 @@ export default { ...@@ -109,21 +100,7 @@ export default {
//检测登录态 //检测登录态
this.checkLogin(); this.checkLogin();
console.log(this.params,6666666)
this.options = options; this.options = options;
console.log('-------1',options.scene)
console.log(this.options)
console.log('-------link',this.mpApp.globalData.tabBarPageLink)
// tabbar 跳转
// if (this.mpApp.globalData.tabBarPageLink) {
// this.page = this.mpApp.globalData.tabBarPageLink;
// this.mpApp.globalData.tabBarPageLink=''
// }
// if (options.from && options.from == "tabbar") {
// this.page = decodeURIComponent(options.backpath);
// }
// ---------
if (options.share) { if (options.share) {
//来自分享 //来自分享
this.link = decodeURIComponent(options.share); this.link = decodeURIComponent(options.share);
...@@ -330,6 +307,19 @@ export default { ...@@ -330,6 +307,19 @@ export default {
} }
this.init(); this.init();
}, },
onShow(){
let ss=wx.getStorageSync("sessionid");
if (ss && !this.params.includes("sessionid")) {
this.params +=`&sessionid=${ss}`
}
console.log(this.getTabBar,'312')
if (typeof this.getTabBar === 'function' &&
this.getTabBar()) {
this.getTabBar().setData({
selected: this.index
})
}
},
methods: { methods: {
init() { init() {
// 获取小程序开启的订阅消息配置 // 获取小程序开启的订阅消息配置
......
...@@ -27,12 +27,14 @@ ...@@ -27,12 +27,14 @@
<script> <script>
import { serialize } from "@/utils/index"; import { serialize } from "@/utils/index";
import { checkTabbarPage } from "@/utils/mayi";
import { wx_decode } from "@/utils/wxIndex.js"; import { wx_decode } from "@/utils/wxIndex.js";
import login from "@/api/login"; import login from "@/api/login";
import shop from "@/api/shop"; import shop from "@/api/shop";
import indexApi from "@/api/index.js"; import indexApi from "@/api/index.js";
var WXBizDataCrypt = require("@/utils/WXBizDataCrypt"); var WXBizDataCrypt = require("@/utils/WXBizDataCrypt");
export default { export default {
name:'login',
components: { components: {
// card // card
}, },
...@@ -315,12 +317,25 @@ export default { ...@@ -315,12 +317,25 @@ export default {
delta: 1 delta: 1
}); });
}else{ }else{
wx.reLaunch({ let parseLink=decodeURIComponent(this.backPath);
let isTabbarIndex =checkTabbarPage(parseLink)
console.log('32111',isTabbarIndex,parseLink)
wx.navigateBack()
return
if(isTabbarIndex>-1){
wx.navigateBack()
// wx.switchTab({
// url: parseLink == '/' ? '/pages/home/main' : `/pages/tabBar${isTabbarIndex}/main`,
// })
}else{
wx.redirectTo({
url: `../index/main?from=login&backpath=${ url: `../index/main?from=login&backpath=${
this.backPath this.backPath
}&params=${encodeURIComponent(this.backParams)}` }&params=${encodeURIComponent(this.backParams)}`
}); });
} }
}
}, },
getPhoneNumber(e) { getPhoneNumber(e) {
wx.checkSession({ wx.checkSession({
......
...@@ -3,28 +3,39 @@ ...@@ -3,28 +3,39 @@
--> -->
<template> <template>
<div> <div>
{{ pageUrl }}
<web-view :src="pageUrl" @error="handleError"></web-view> <web-view :src="pageUrl" @error="handleError"></web-view>
</div> </div>
</template> </template>
<script> <script>
import { getUrlofLink } from "../../utils/mayi.js"; import {
getUrlofLink,
setTabBarActive,
checkTabbarPage,
} from "../../utils/mayi.js";
export default { export default {
data() { data() {
return { return {
link: process.env.BASE_URL, link: process.env.BASE_URL,
page: "/", page: "/",
params: "?mixid=" + this.$store.state.mixid, params: "?mixid=" + this.$store.state.mixid,
index:1 index: 1,
ss: "",
}; };
}, },
computed: { computed: {
pageUrl() { pageUrl() {
return this.link + this.page + this.params; return this.link + this.page + this.params + this.ss;
}, },
}, },
onLoad(options) { onLoad(options) {
let ss = wx.getStorageSync("sessionid");
this.ss = ss ? `&sessionid=${ss}` : "";
// tabbar 跳转 // tabbar 跳转
let homeIndex = checkTabbarPage("/");
homeIndex != 0 && homeIndex==this.index && (this.index = 0);
if (this.mpApp.globalData.footerVal.componentData.list[this.index].link) { if (this.mpApp.globalData.footerVal.componentData.list[this.index].link) {
this.page = getUrlofLink( this.page = getUrlofLink(
this.mpApp.globalData.footerVal.componentData.list[this.index].link this.mpApp.globalData.footerVal.componentData.list[this.index].link
...@@ -32,20 +43,13 @@ export default { ...@@ -32,20 +43,13 @@ export default {
this.mpApp.globalData.tabBarPageLink = ""; this.mpApp.globalData.tabBarPageLink = "";
} }
}, },
onShow(){ onShow() {
console.log('show') let ss = wx.getStorageSync("sessionid");
if (this.mpApp.globalData.footerVal.componentData.list[this.index].link) { if (!this.ss && ss) {
this.page = getUrlofLink( this.ss = `&sessionid=${ss}`;
this.mpApp.globalData.footerVal.componentData.list[this.index].link
);
this.mpApp.globalData.tabBarPageLink = "";
} }
// if (typeof this.getTabBar === 'function' &&
// this.getTabBar()) { setTabBarActive.bind(this)(this.index);
// this.getTabBar().setData({
// selected: 0
// })
// }
}, },
methods: { methods: {
handleError(data) { handleError(data) {
......
...@@ -3,28 +3,39 @@ ...@@ -3,28 +3,39 @@
--> -->
<template> <template>
<div> <div>
{{ pageUrl }}
<web-view :src="pageUrl" @error="handleError"></web-view> <web-view :src="pageUrl" @error="handleError"></web-view>
</div> </div>
</template> </template>
<script> <script>
import { getUrlofLink } from "../../utils/mayi.js"; import {
getUrlofLink,
setTabBarActive,
checkTabbarPage,
} from "../../utils/mayi.js";
export default { export default {
data() { data() {
return { return {
link: process.env.BASE_URL, link: process.env.BASE_URL,
page: "/", page: "/",
params: "?mixid=" + this.$store.state.mixid, params: "?mixid=" + this.$store.state.mixid,
index:2 index: 2,
ss: "",
}; };
}, },
computed: { computed: {
pageUrl() { pageUrl() {
return this.link + this.page + this.params; return this.link + this.page + this.params + this.ss;
}, },
}, },
onLoad(options) { onLoad(options) {
let ss = wx.getStorageSync("sessionid");
this.ss = ss ? `&sessionid=${ss}` : "";
// tabbar 跳转 // tabbar 跳转
let homeIndex = checkTabbarPage("/");
homeIndex != 0 && homeIndex==this.index && (this.index = 0);
if (this.mpApp.globalData.footerVal.componentData.list[this.index].link) { if (this.mpApp.globalData.footerVal.componentData.list[this.index].link) {
this.page = getUrlofLink( this.page = getUrlofLink(
this.mpApp.globalData.footerVal.componentData.list[this.index].link this.mpApp.globalData.footerVal.componentData.list[this.index].link
...@@ -32,14 +43,14 @@ export default { ...@@ -32,14 +43,14 @@ export default {
this.mpApp.globalData.tabBarPageLink = ""; this.mpApp.globalData.tabBarPageLink = "";
} }
}, },
// onShow(){ onShow() {
// if (typeof this.getTabBar === 'function' && let ss = wx.getStorageSync("sessionid");
// this.getTabBar()) { if (!this.ss && ss) {
// this.getTabBar().setData({ this.ss = `&sessionid=${ss}`;
// selected: 0 }
// })
// } setTabBarActive.bind(this)(this.index);
// }, },
methods: { methods: {
handleError(data) { handleError(data) {
wx.showLoading({ wx.showLoading({
......
...@@ -3,28 +3,39 @@ ...@@ -3,28 +3,39 @@
--> -->
<template> <template>
<div> <div>
{{ pageUrl }}
<web-view :src="pageUrl" @error="handleError"></web-view> <web-view :src="pageUrl" @error="handleError"></web-view>
</div> </div>
</template> </template>
<script> <script>
import { getUrlofLink } from "../../utils/mayi.js"; import {
getUrlofLink,
setTabBarActive,
checkTabbarPage,
} from "../../utils/mayi.js";
export default { export default {
data() { data() {
return { return {
link: process.env.BASE_URL, link: process.env.BASE_URL,
page: "/", page: "/",
params: "?mixid=" + this.$store.state.mixid, params: "?mixid=" + this.$store.state.mixid,
index:3 index: 3,
ss: "",
}; };
}, },
computed: { computed: {
pageUrl() { pageUrl() {
return this.link + this.page + this.params; return this.link + this.page + this.params + this.ss;
}, },
}, },
onLoad(options) { onLoad(options) {
let ss = wx.getStorageSync("sessionid");
this.ss = ss ? `&sessionid=${ss}` : "";
// tabbar 跳转 // tabbar 跳转
let homeIndex = checkTabbarPage("/");
homeIndex != 0 && homeIndex==this.index && (this.index = 0);
if (this.mpApp.globalData.footerVal.componentData.list[this.index].link) { if (this.mpApp.globalData.footerVal.componentData.list[this.index].link) {
this.page = getUrlofLink( this.page = getUrlofLink(
this.mpApp.globalData.footerVal.componentData.list[this.index].link this.mpApp.globalData.footerVal.componentData.list[this.index].link
...@@ -32,14 +43,14 @@ export default { ...@@ -32,14 +43,14 @@ export default {
this.mpApp.globalData.tabBarPageLink = ""; this.mpApp.globalData.tabBarPageLink = "";
} }
}, },
// onShow(){ onShow() {
// if (typeof this.getTabBar === 'function' && let ss = wx.getStorageSync("sessionid");
// this.getTabBar()) { if (!this.ss && ss) {
// this.getTabBar().setData({ this.ss = `&sessionid=${ss}`;
// selected: 0 }
// })
// } setTabBarActive.bind(this)(this.index);
// }, },
methods: { methods: {
handleError(data) { handleError(data) {
wx.showLoading({ wx.showLoading({
......
...@@ -3,28 +3,39 @@ ...@@ -3,28 +3,39 @@
--> -->
<template> <template>
<div> <div>
{{ pageUrl }}
<web-view :src="pageUrl" @error="handleError"></web-view> <web-view :src="pageUrl" @error="handleError"></web-view>
</div> </div>
</template> </template>
<script> <script>
import { getUrlofLink } from "../../utils/mayi.js"; import {
getUrlofLink,
setTabBarActive,
checkTabbarPage,
} from "../../utils/mayi.js";
export default { export default {
data() { data() {
return { return {
link: process.env.BASE_URL, link: process.env.BASE_URL,
page: "/", page: "/",
params: "?mixid=" + this.$store.state.mixid, params: "?mixid=" + this.$store.state.mixid,
index:4 index: 4,
ss: "",
}; };
}, },
computed: { computed: {
pageUrl() { pageUrl() {
return this.link + this.page + this.params; return this.link + this.page + this.params + this.ss;
}, },
}, },
onLoad(options) { onLoad(options) {
let ss = wx.getStorageSync("sessionid");
this.ss = ss ? `&sessionid=${ss}` : "";
// tabbar 跳转 // tabbar 跳转
let homeIndex = checkTabbarPage("/");
homeIndex != 0 && homeIndex==this.index && (this.index = 0);
if (this.mpApp.globalData.footerVal.componentData.list[this.index].link) { if (this.mpApp.globalData.footerVal.componentData.list[this.index].link) {
this.page = getUrlofLink( this.page = getUrlofLink(
this.mpApp.globalData.footerVal.componentData.list[this.index].link this.mpApp.globalData.footerVal.componentData.list[this.index].link
...@@ -32,14 +43,14 @@ export default { ...@@ -32,14 +43,14 @@ export default {
this.mpApp.globalData.tabBarPageLink = ""; this.mpApp.globalData.tabBarPageLink = "";
} }
}, },
// onShow(){ onShow() {
// if (typeof this.getTabBar === 'function' && let ss = wx.getStorageSync("sessionid");
// this.getTabBar()) { if (!this.ss && ss) {
// this.getTabBar().setData({ this.ss = `&sessionid=${ss}`;
// selected: 0 }
// })
// } setTabBarActive.bind(this)(this.index);
// }, },
methods: { methods: {
handleError(data) { handleError(data) {
wx.showLoading({ wx.showLoading({
......
...@@ -3,13 +3,24 @@ export function getUrlofLink(data) { ...@@ -3,13 +3,24 @@ export function getUrlofLink(data) {
return data.link return data.link
} }
// 全局跳转 // 全局跳转 data:link数据 option:是否为底部栏触发
export function $themeToLink(data) { export function $themeToLink(data, option) {
let app = getApp()
let footerVal = app.globalData.footerVal.componentData.list;
console.log('393939', footerVal)
let type = data.type; let type = data.type;
// 点击底部栏
if (option) {
let parseLink = getUrlofLink(data);
let isTabbarIndex = checkTabbarPage(parseLink);
// 替换首页位置
isTabbarIndex = isTabbarIndex == 0 ? checkTabbarPage('/') : isTabbarIndex
wx.switchTab({
url: parseLink == '/' ? '/pages/home/main' : `/pages/tabBar${isTabbarIndex}/main`,
})
console.log(option, data)
return
}
// 历史数据 // 历史数据
if (type == undefined || type == 'undefined') { if (type == undefined || type == 'undefined') {
if (data.length > 0) { if (data.length > 0) {
...@@ -17,17 +28,16 @@ export function $themeToLink(data) { ...@@ -17,17 +28,16 @@ export function $themeToLink(data) {
} }
return return
} }
// 底部导航跳转 // 底部导航跳转
let parseLink = getUrlofLink(data) // let parseLink=getUrlofLink(data)
let isFooter = footerVal.findIndex(item => { // let isTabbarIndex =checkTabbarPage(parseLink )
return item.link.link == parseLink // if (isTabbarIndex>-1) {
}) // wx.switchTab({
if (isFooter > -1) { // url: parseLink == '/' ? '/pages/home/main' : `/pages/tabBar${isTabbarIndex}/main`,
wx.switchTab({ // })
url: parseLink == '/' ? '/pages/home/main' : `/pages/tabBar${isFooter}/main`, // return
}) // }
return
}
// ----------------- // -----------------
...@@ -83,4 +93,26 @@ function toPage(backPath, backParams = "") { ...@@ -83,4 +93,26 @@ function toPage(backPath, backParams = "") {
}); });
} }
// check url是否为底部栏配置项
\ No newline at end of file // check 链接是否为底部导航栏页面 返回索引
export function checkTabbarPage(link) {
let app = getApp()
if (!app.globalData.footerVal) return -1
let footerVal = app.globalData.footerVal.componentData.list;
let isFooter = footerVal.findIndex(item => {
return item.link.link == link
})
return isFooter
}
// 当前底部栏选中项
export function setTabBarActive(data) {
console.log(this, 'this', data)
if (data < 0 || !this.$mp.page) return
if (typeof this.$mp.page.getTabBar === 'function' &&
this.$mp.page.getTabBar()) {
this.$mp.page.getTabBar().setData({
selected: data
})
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment