浏览代码

商品详情,菜单跳转修改

guhongwei 2 年之前
父节点
当前提交
52f2555e95
共有 1 个文件被更改,包括 21 次插入23 次删除
  1. 21 23
      pagesHome/order/detail.vue

+ 21 - 23
pagesHome/order/detail.vue

@@ -83,8 +83,8 @@
 			<text @click="toMenu" class="iconfont icon-gengduo"></text>
 		</view>
 		<view class="menu_1" v-if="menu">
-			<view class="title" v-for="(item,index) in barList" :key="index" @click="toPath(item)">
-				<image class="image" :src="item.normal"></image>
+			<view class="title" v-for="(item,index) in barList" :key="index" @click="toPath(item)" v-if="item.is_use=='0'">
+				<image class="image" :src="item.normal&&item.normal.length>0?item.normal[0].url:''"></image>
 				<view class="name">{{item.name}}</view>
 			</view>
 		</view>
@@ -140,27 +140,7 @@
 		components: {},
 		data() {
 			return {
-				barList: [{
-						name: '首页',
-						route: 'pages/home/index',
-						normal: require('@/static/shouye.png'),
-					},
-					{
-						name: '微店',
-						route: 'pages/store/index',
-						normal: require('@/static/store.png'),
-					},
-					{
-						name: '购物车',
-						route: 'pages/market/index',
-						normal: require('@/static/market.png'),
-					},
-					{
-						name: '我的',
-						route: 'pages/my/index',
-						normal: require('@/static/my.png'),
-					},
-				],
+				barList: [],
 				options: [{
 						icon: 'shop',
 						text: '店铺',
@@ -228,10 +208,28 @@
 		},
 		onShow: async function() {
 			const that = this;
+			await that.searchConfig();
 			await that.search();
 			await that.configShare();
 		},
 		methods: {
+			// 查询基本信息
+			searchConfig() {
+				const that = this;
+				uni.getStorage({
+					key: 'config',
+					success: function(res) {
+						let data = res.data;
+						if (data.bottom_menu && data.bottom_menu.list.length > 0) {
+							let list = data.bottom_menu.list.sort((a, b) => {
+								return a.sort - b.sort
+							});
+							that.$set(that, `barList`, list)
+						}
+
+					}
+				})
+			},
 			//店铺,
 			// 购物车,客服跳转
 			onClick(e) {