Commit 91e7e5ae by 程默

f

parent 2f23da9a
......@@ -85,6 +85,7 @@
<bottomCont></bottomCont>
</div>
<share-popup></share-popup>
<custom-tab-bar></custom-tab-bar>
</div>
</template>
......
......@@ -3,6 +3,7 @@
"van-tabs": "/static/vant/tabs/index",
"van-tab": "/static/vant/tab/index",
"banner": "/static/nativeComponents/Banner/index",
"custom-tab-bar": "/static/nativeComponents/custom-tab-bar/index",
"goods-list": "/static/nativeComponents/GoodsList/index",
"time-limited-discount": "/static/nativeComponents/TimeLimitedDiscount/index",
"waterfall-flow": "/static/nativeComponents/module/WaterfallFlow/index",
......
......@@ -3,7 +3,7 @@
<div style="width:100%;height:90vh;display:flex;justify-content: center;align-items: center;">
<van-loading size="40px" type="spinner"></van-loading>
</div>
<web-view v-if="withoutScene" :src="pageUrl" @message="getMessage" @error="handleError" @load="handleLoad"></web-view>
<web-view v-if="withoutScene" :src="'https://test-m-shop.mayi888.cn/?mixid=antgood'" @message="getMessage" @error="handleError" @load="handleLoad"></web-view>
</div>
</template>
......
......@@ -48,7 +48,9 @@ export function $themeToLink(data, option) {
// wx.switchTab({
// url: parseLink == '/' ? '/pages/home/main' : `/pages/tabBar${isTabbarIndex}/main`,
// })
toPage(data.link);
wx.redirectTo({
url: `../index/main?from=home&backpath=${encodeURIComponent(parseLink)}`
})
return
}
// console.log(option, data,'---',parseLink == '/' ? '/pages/home/main' : `/pages/tabBar${isTabbarIndex}/main`)
......
const app = getApp();
console.log(app, "apppppppppp");
Component({
pageLifetimes: {
show() {
console.log("哈哈哈哈");
if (typeof this.getTabBar === "function" && this.getTabBar()) {
this.getTabBar().setData({
selected: 1
});
}
}
},
data: {
selected: 0,
color: "#7A7E83",
selectedColor: "#3cc51f",
list: [
{
pagePath: "/pages/home/main",
iconPath:
"https://cdn.mayi888.com/public/png/2d084453-2ca3-4d01-95f9-8bed8fc46dc6.png",
selectedIconPath:
"https://cdn.mayi888.com/public/png/2d084453-2ca3-4d01-95f9-8bed8fc46dc6.png",
text: "组件",
//--多主题
condition: "",
icon: "ant-daishouhuo",
iconType: 1, //0 iconfont 1 image
imgUrl:
"https://cdn.mayi888.com/public/png/2d084453-2ca3-4d01-95f9-8bed8fc46dc6.png",
selectImgUrl:
"https://cdn.mayi888.com/public/png/2d084453-2ca3-4d01-95f9-8bed8fc46dc6.png",
link: {
key: "1.1.1.7",
link: "/personalCenter/spokesmanCenter?distributionModel=1",
name: "分销商中心",
type: 1
},
show: true,
title: "分类页",
version: "1.0.0",
visible: 1
},
{
pagePath: "/pages/index/main",
iconPath: "/static/images/bofang.png",
selectedIconPath: "/static/images/bofang.png",
text: "接口",
//--多主题
condition: "",
icon: "ant-daishouhuo",
iconType: 0, //0 iconfont 1 image
imgUrl: "",
selectImgUrl: "",
link: {},
show: true,
title: "分类页",
version: "1.0.0",
visible: 1
}
],
mm: false,
componentData: {},
show: true,
mmm: false,
mainColor: "",
showFlag: "up",
cartNum: 0
},
ready() {
if (app.themeColor["--main-color"] != "#ffffff") {
this.setData({
mainColor: app.themeColor["--main-color"]
});
} else {
app.themeColorCallBack = res => {
this.setData({
mainColor: res["--main-color"]
});
};
}
console.log(this.data.themeColor, "themeColor");
if (typeof this.getTabBar === "function" && this.getTabBar()) {
this.getTabBar().setData({
selected: 1
});
}
this.setData({
mmm: Math.ceil(app.globalData.footerVal.componentData.list.length / 2 - 1)
});
console.log(
Math.ceil(app.globalData.footerVal.componentData.list.length / 2 - 1),
this.data.selected
);
console.log(this.data.mmm, "ready");
},
attached() {
let that = this;
if (app.globalData.footerVal) {
let mm =
Math.ceil(app.globalData.footerVal.componentData.list.length / 2 - 1) ==
that.data.selected &&
app.globalData.footerVal.componentData["styleSelectionNum"] == 1;
console.log(733333, mm);
that.setData({
componentData: app.globalData.footerVal.componentData,
list: app.globalData.footerVal.componentData.list,
mm: mm
});
console.log(
"777777",
Math.ceil(this.data.list.length / 2 - 1),
this.data.selected,
this.data.componentData["styleSelectionNum"]
);
} else {
console.log(73333381);
app.footerCallBack = function(params) {
console.log("back");
that.setData({
componentData: params.componentData,
list: params.componentData.list
// mm:(Math.ceil(params.componentData.list.length/2-1)==that.data.selected&&params.componentData['styleSelectionNum']==1)
});
let mm =
Math.ceil(params.componentData.list.length / 2 - 1) ==
that.data.selected &&
params.componentData["styleSelectionNum"] == 1;
console.log("87777777", mm);
};
}
// ----------webview 变化
console.log("启动1111", this.getTabBar());
app.webviewCallBack = function(state, params) {
console.log("webview变化", state, params);
};
//
this.setData({
mm:
Math.ceil(this.data.list.length / 2 - 1) == this.data.selected &&
this.data.componentData["styleSelectionNum"] == 1
});
},
methods: {
init() {},
switchTab(e) {
const { index } = e.currentTarget.dataset;
console.log("755555555", this.data.list[index].link);
app.$themeToLink(this.data.list[index]["link"], 1);
// this.toPage(this.data.list[index].link,index)
// this.setData({
// selected: index
// })
},
toPage(data, index) {
console.log("index98", index, this);
// index=index==0?index+1:index
// 跳转
if (data.link == "/") {
wx.switchTab({
url: "/pages/home/main"
});
} else {
wx.switchTab({
url: `/pages/tabBar${index}/main`
});
// ?from=tabbar&backpath=${
// data.link
// }
}
}
}
});
......@@ -1176,6 +1176,7 @@
left: 0;
background: #f5f5f4;
/* border-top: 1px solid #e2e2e2; */
z-index:999
}
/* .tab-bar-border {
......
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