|
@@ -8,7 +8,10 @@
|
|
|
</scroll-view>
|
|
|
</view>
|
|
|
<view class="foot" v-if="frameStyle&&frameStyle.useBar||false">
|
|
|
- 底部菜单
|
|
|
+ <view class="list" v-for="(item,index) in barList" :key="index" @tap="toPath(index,item)">
|
|
|
+ <image class="image" src="../../static/logo.png" mode=""></image>
|
|
|
+ <view class="name" :style="{color:active==index?frameStyle.barActive||'#FB1438':''}">{{item.name}}</view>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
</view>
|
|
|
</template>
|
|
@@ -18,10 +21,52 @@
|
|
|
props: {
|
|
|
frameStyle: {
|
|
|
type: Object,
|
|
|
- }
|
|
|
+ },
|
|
|
},
|
|
|
data() {
|
|
|
- return {};
|
|
|
+ return {
|
|
|
+ active: 0,
|
|
|
+ barList: [{
|
|
|
+ name: '首页',
|
|
|
+ route: 'pages/home/index'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: '微店',
|
|
|
+ route: 'pages/store/index'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: '周边',
|
|
|
+ route: 'pages/week/index'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: '购物车',
|
|
|
+ route: 'pages/market/index'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: '我的',
|
|
|
+ route: 'pages/my/index'
|
|
|
+ },
|
|
|
+ ]
|
|
|
+ };
|
|
|
+ },
|
|
|
+ created: function() {
|
|
|
+ const that = this;
|
|
|
+ that.search()
|
|
|
+ },
|
|
|
+ onShow: function() {},
|
|
|
+ methods: {
|
|
|
+ search() {
|
|
|
+ const that = this;
|
|
|
+ let pages = getCurrentPages();
|
|
|
+ let currentPage = pages[pages.length - 1];
|
|
|
+ let index = that.barList.findIndex((i) => i.route == currentPage.route);
|
|
|
+ if (index) that.$set(that, `active`, index);
|
|
|
+ },
|
|
|
+ toPath(index, item) {
|
|
|
+ const that = this;
|
|
|
+ that.$set(that, `active`, index);
|
|
|
+ that.$emit('toPath', item)
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
</script>
|
|
@@ -37,6 +82,23 @@
|
|
|
height: 8vh;
|
|
|
overflow: hidden;
|
|
|
background-color: var(--footColor);
|
|
|
+ display: flex;
|
|
|
+ flex-direction: row;
|
|
|
+ justify-content: space-around;
|
|
|
+
|
|
|
+ .list {
|
|
|
+ padding: 2vw 0;
|
|
|
+ text-align: center;
|
|
|
+
|
|
|
+ .image {
|
|
|
+ width: 7vw;
|
|
|
+ height: 5vw;
|
|
|
+ }
|
|
|
+
|
|
|
+ .name {
|
|
|
+ font-size: 12px;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|