guhongwei 2 年之前
父節點
當前提交
a2317306e4
共有 7 個文件被更改,包括 123 次插入116 次删除
  1. 66 0
      config.js
  2. 13 12
      pages/home/index.vue
  3. 1 1
      pages/index/index.vue
  4. 6 6
      pages/market/index.vue
  5. 24 81
      pages/my/index.vue
  6. 6 7
      pages/store/index.vue
  7. 7 9
      pages/week/index.vue

+ 66 - 0
config.js

@@ -16,6 +16,72 @@ export default {
 	wx_dev: 'dev',
 	system: system,
 	share: {},
+	my_menu: [ //
+		{
+			title: '我的优惠劵',
+			route: 'pagesMy/discount/index'
+		},
+		{
+			title: '我的尊荣',
+			route: 'pagesMy/integral/index'
+		},
+		{
+			title: '我的资产',
+			route: 'pagesMy/assets/index'
+		},
+		{
+			title: '我的拼团',
+			route: 'pagesMy/dough/index'
+		},
+		{
+			title: '我的收货地址',
+			route: 'pagesMy/address/index'
+		},
+		{
+			title: '账号管理',
+			route: 'pagesMy/account/index'
+		},
+		{
+			title: '客服电话',
+			route: ''
+		},
+	],
+	my_orderList: [ //
+		{
+			icon: 'icon-daifukuan',
+			title: '待付款',
+			status: '0',
+			type: 'order',
+			route: "pagesMy/order/index",
+		},
+		{
+			icon: 'icon-daishouhuo',
+			title: '待发货',
+			status: '1',
+			type: 'order',
+			route: "pagesMy/order/index",
+		},
+		{
+			icon: 'icon-daipinglun',
+			title: '待收货',
+			status: '2',
+			type: 'order',
+			route: "pagesMy/order/index",
+		},
+		{
+			icon: 'icon-daipinglun',
+			title: '已收货',
+			status: '3',
+			type: 'order',
+			route: "pagesMy/order/index",
+		},
+		{
+			icon: 'icon-shouhoufuwuicon',
+			title: '售后',
+			type: 'after',
+			route: "pagesMy/order/after",
+		},
+	],
 	china: [
 		//全国地址
 		{

+ 13 - 12
pages/home/index.vue

@@ -221,17 +221,6 @@
 					url: `/pagesHome/order/detail?id=${id}`
 				})
 			},
-			toPath(e) {
-				if (e && e.route && e.type == '0') {
-					uni.redirectTo({
-						url: `/${e.route}`
-					})
-				} else {
-					uni.navigateTo({
-						url: `/${e.route}`
-					})
-				}
-			},
 			// 分页
 			toPage(e) {
 				const that = this;
@@ -273,7 +262,19 @@
 				that.$set(that, `skip`, 0)
 				that.$set(that, `limit`, 6)
 				that.$set(that, `page`, 0)
-			}
+			},
+			// 菜单跳转
+			toPath(e) {
+				let url = `/${e.route}`;
+				if (e.type == '0') uni.redirectTo({
+					url
+				})
+				else {
+					uni.navigateTo({
+						url
+					})
+				}
+			},
 		}
 	}
 </script>

+ 1 - 1
pages/index/index.vue

@@ -37,7 +37,7 @@
 								path: '/pages/index/index',
 								imageUrl: config.config.share[0].url
 							}
-							let url = `/pages/home/index`;
+							let url = `/pages/my/index`;
 							uni.redirectTo({
 								url
 							})

+ 6 - 6
pages/market/index.vue

@@ -379,13 +379,13 @@
 				})
 			},
 			toPath(e) {
-				if (e && e.route && e.type == '0') {
-					uni.redirectTo({
-						url: `/${e.route}`
-					})
-				} else {
+				let url = `/${e.route}`;
+				if (e.type == '0') uni.redirectTo({
+					url
+				})
+				else {
 					uni.navigateTo({
-						url: `/${e.route}`
+						url
 					})
 				}
 			}

+ 24 - 81
pages/my/index.vue

@@ -45,8 +45,7 @@
 					<view class="title">{{item.title}}</view>
 					<view class="title">
 						<text v-if="user.id&&item.title=='我的尊荣'">{{integral||0}}分</text>
-						<text v-if="item.title=='客服电话'"
-							@tap="makePhone(serviceContactInfo.phone)">{{serviceContactInfo.phone||''}}</text>
+						<text v-if="item.title=='客服电话'" @tap="makePhone(serviceContactInfo.phone)">{{serviceContactInfo.phone||''}}</text>
 						<text class="iconfont icon-jiantouyou"></text>
 					</view>
 				</view>
@@ -66,73 +65,10 @@
 				user: {},
 				// 客服信息
 				serviceContactInfo: {},
-				// 图标菜单
-				orderList: [ //订单列表
-					{
-						icon: 'icon-daifukuan',
-						title: '待付款',
-						status: '0',
-						type: 'order',
-						route: "pagesMy/order/index",
-					},
-					{
-						icon: 'icon-daishouhuo',
-						title: '待发货',
-						status: '1',
-						type: 'order',
-						route: "pagesMy/order/index",
-					},
-					{
-						icon: 'icon-daipinglun',
-						title: '待收货',
-						status: '2',
-						type: 'order',
-						route: "pagesMy/order/index",
-					},
-					{
-						icon: 'icon-daipinglun',
-						title: '已收货',
-						status: '3',
-						type: 'order',
-						route: "pagesMy/order/index",
-					},
-					{
-						icon: 'icon-shouhoufuwuicon',
-						title: '售后',
-						type: 'after',
-						route: "pagesMy/order/after",
-					},
-				],
+				// 订单图标菜单
+				orderList: [],
 				// 菜单
-				menuList: [{
-						title: '我的优惠劵',
-						route: 'pagesMy/discount/index'
-					},
-					{
-						title: '我的尊荣',
-						route: 'pagesMy/integral/index'
-					},
-					// {
-					// 	title: '我的资产',
-					// 	route: 'pagesMy/assets/index'
-					// },
-					{
-						title: '我的拼团',
-						route: 'pagesMy/dough/index'
-					},
-					{
-						title: '我的收货地址',
-						route: 'pagesMy/address/index'
-					},
-					{
-						title: '账号管理',
-						route: 'pagesMy/account/index'
-					},
-					{
-						title: '客服电话',
-						route: ''
-					},
-				],
+				menuList: [],
 				// 收藏商品
 				market_num: '',
 				// 收藏店铺
@@ -183,24 +119,19 @@
 			// 查询其他信息
 			async searchOther() {
 				const that = this;
+				let config = that.$config;
+				if (config) {
+					// 订单图标菜单
+					that.$set(that, `orderList`, config.my_orderList);
+					// 菜单
+					that.$set(that, `menuList`, config.my_menu);
+				}
 				let res;
 				res = await that.$api(`/serviceContact`, 'GET');
 				if (res.errcode == '0' && res.total > 0) {
 					that.$set(that, `serviceContactInfo`, res.data[0])
 				}
 			},
-			// 底部菜单跳转
-			toPath(e) {
-				if (e && e.route && e.type == '0') {
-					uni.redirectTo({
-						url: `/${e.route}`
-					})
-				} else {
-					uni.navigateTo({
-						url: `/${e.route}`
-					})
-				}
-			},
 			// 公共跳转
 			toCommon(e) {
 				uni.getStorage({
@@ -247,7 +178,19 @@
 				uni.makePhoneCall({
 					phoneNumber: e
 				});
-			}
+			},
+			// 底部菜单跳转
+			toPath(e) {
+				let url = `/${e.route}`;
+				if (e.type == '0') uni.redirectTo({
+					url
+				})
+				else {
+					uni.navigateTo({
+						url
+					})
+				}
+			},
 		}
 	}
 </script>

+ 6 - 7
pages/store/index.vue

@@ -165,14 +165,13 @@
 				that.$set(that, `page`, 0)
 			},
 			toPath(e) {
-				const that = this;
-				if (e && e.route && e.type == '0') {
-					uni.redirectTo({
-						url: `/${e.route}`
-					})
-				} else {
+				let url = `/${e.route}`;
+				if (e.type == '0') uni.redirectTo({
+					url
+				})
+				else {
 					uni.navigateTo({
-						url: `/${e.route}`
+						url
 					})
 				}
 			}

+ 7 - 9
pages/week/index.vue

@@ -242,18 +242,16 @@
 			},
 			// 菜单跳转
 			toPath(e) {
-				const that = this;
-				that.clearPage();
-				if (e && e.route && e.type == '0') {
-					uni.redirectTo({
-						url: `/${e.route}`
-					})
-				} else {
+				let url = `/${e.route}`;
+				if (e.type == '0') uni.redirectTo({
+					url
+				})
+				else {
 					uni.navigateTo({
-						url: `/${e.route}`
+						url
 					})
 				}
-			}
+			},
 		},
 
 	}