Commit 396f5baa authored by 罗超's avatar 罗超

适配支付宝小程序

parent 6d7df0a9
<template>
<div class="mynav" :style="{'background':bg}">
<swiper
:autoplay="false"
:style="{'height': height + 'rpx' }"
>
<div class="mynav" :style="{ background: bg }">
<swiper :autoplay="false" :style="{ height: height + 'rpx' }">
<swiper-item v-for="(item, index) in cols" :key="index">
<view :style="[formatStyle]">
<!-- #ifdef MP-WEIXIN -->
<u-grid :col="navs.columns" align="left" :border="false">
<u-grid-item
v-for="(c, i) in item"
......@@ -16,12 +14,38 @@
<image
:src="getIconLink(c.icon)"
mode="widthFix"
style="width: 90rpx; height: 90rpx;"
style="width: 90rpx; height: 90rpx"
/>
<text :style="{'color':navs.color}" style="font-size:26rpx;margin-top:10rpx;">{{ c.name }}</text>
<text
:style="{ color: navs.color }"
style="font-size: 26rpx; margin-top: 10rpx"
>{{ c.name }}</text
>
</u-grid-item>
</u-grid>
</view>
<!-- #endif -->
<!-- #ifdef MP-ALIPAY -->
<view class="gridnav-box">
<view
v-for="(c, i) in item"
:key="i"
class="grid-text"
@click="clickHandler(c.url)"
>
<image
:src="getIconLink(c.icon)"
mode="widthFix"
style="width: 90rpx; height: 90rpx"
/>
<view
:style="{ color: navs.color }"
style="font-size: 26rpx; margin-top: 10rpx; text-align: center"
>{{ c.name }}</view
>
</view>
</view>
<!-- #endif -->
</view>
</swiper-item>
</swiper>
</div>
......@@ -35,7 +59,7 @@ export default {
cols: [],
formatStyle: "",
height: 204,
bg:""
bg: "",
};
},
created() {
......@@ -65,7 +89,7 @@ export default {
}
this.formatStyle = { backgroundColor: this.navs.backgroundColor };
}
this.bg=this.formatStyle.backgroundColor
this.bg = this.formatStyle.backgroundColor;
},
methods: {
clickHandler(url) {
......@@ -83,7 +107,14 @@ export default {
margin-top: 4rpx;
color: "#330330";
}
.grid-text view{
background: transparent!important;
.grid-text view {
background: transparent !important;
}
.gridnav-box {
display: flex;
align-items: center;
justify-content: space-between;
box-sizing: border-box;
padding: 0 30rpx;
}
</style>
This diff is collapsed.
This diff is collapsed.
......@@ -9,7 +9,7 @@
right: 0;
z-index: 99999999;
border-top: 1upx solid #ddd;
padding-top:96rpx;
padding-top: 96rpx;
background: #fff;
}
.tabbarMainIphone {
......@@ -37,9 +37,9 @@
padding-bottom: 64upx;
}
.imgse {
/* width: 48upx; */
height: 48upx;
width: auto;
/* width: auto; */
width: 48upx;
}
.txtBtn {
font-size: 24upx;
......@@ -94,7 +94,6 @@
bottom: 10upx;
border-radius: 150upx;
}
</style>
<template>
<view
......@@ -117,14 +116,14 @@
class="imgse"
:fade-show="false"
v-if="active != i"
mode="heightFix"
:src="x.icon"
mode="aspectFit"
:src="x.icon"
></image>
<image
class="imgse"
:fade-show="false"
v-if="active === i"
mode="heightFix"
mode="aspectFit"
:src="x.active_icon"
></image>
<text
......@@ -150,10 +149,10 @@ export default {
};
},
created() {
console.log('A join...')
console.log("A join...");
},
mounted() {
console.log('B join...')
console.log("B join...");
this.flagTypeInfo = this.$uiConfig.is_bang;
let tempSystem = uni.getSystemInfoSync();
this.platforms = tempSystem.platform;
......@@ -166,13 +165,13 @@ export default {
}
// #endif
});
if(uni.getStorageSync("navs")){
this.navs = uni.getStorageSync("navs")??[];
}else{
setTimeout(()=>{
this.navs = uni.getStorageSync("navs")??[];
if (uni.getStorageSync("navs")) {
this.navs = uni.getStorageSync("navs") ?? [];
} else {
setTimeout(() => {
this.navs = uni.getStorageSync("navs") ?? [];
this.activeHandler();
},3000)
}, 3000);
}
this.activeHandler();
},
......@@ -190,16 +189,21 @@ export default {
methods: {
activeHandler() {
let t = getCurrentPages();
let query=t[t.length - 1].__displayReporter.query
let queryString=''
for(var k in query){
queryString+=`&${k}=${query[k]}`
// #ifdef MP-WEIXIN
let query = t[t.length - 1].__displayReporter.query;
let queryString = "";
for (var k in query) {
queryString += `&${k}=${query[k]}`;
}
if(queryString!=''){
queryString="?"+queryString.substring(1,queryString.length)
if (queryString != "") {
queryString = "?" + queryString.substring(1, queryString.length);
}
this.crtPath = "/" + t[t.length - 1].route+queryString;
console.log(this.crtPath)
this.crtPath = "/" + t[t.length - 1].route + queryString;
// #endif
// #ifdef MP-ALIPAY
this.crtPath = t[t.length - 1].$page.fullPath;
// #endif
this.navs.forEach((x, i) => {
if (x.url == this.crtPath) {
this.active = i;
......
......@@ -52,9 +52,7 @@
// 选项数据,如果传入了默认slot,此参数无效
options: {
type: Array,
default () {
return []
}
default: () =>[]
},
// 是否禁用此菜单项
disabled: {
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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