Browse Source

pc花材列表

shish 5 years ago
parent
commit
98255ade0c
4 changed files with 56 additions and 155 deletions
  1. 0 91
      ghs/src/mock/userInfo.js
  2. 19 28
      ghs/src/views/home.vue
  3. 11 16
      ghs/src/views/item-class/list.vue
  4. 26 20
      ghs/src/views/item/list.vue

+ 0 - 91
ghs/src/mock/userInfo.js

@@ -259,97 +259,6 @@ let menu = {
 			viewPath: 'views/item/list.vue',
 			viewPath: 'views/item/list.vue',
 			keepAlive: 1
 			keepAlive: 1
 		},
 		},
-		{
-			id: '404',
-			parentId: '4',
-			name: '商品分类',
-			type: 1,
-			icon: 'icon-user',
-			orderNum: 4,
-			router: '/goods/category',
-			viewPath: 'views/goods/category.vue',
-			keepAlive: 1
-		},
-		{
-			id: '402',
-			parentId: '4',
-			name: '商品列表',
-			type: 1,
-			icon: 'icon-user',
-			orderNum: 4,
-			router: '/goods/list',
-			viewPath: 'views/goods/goods-list.vue',
-			keepAlive: 1
-		},
-		{
-			id: '403',
-			parentId: '4',
-			name: '添加商品',
-			type: 1,
-			icon: 'icon-user',
-			orderNum: 4,
-			router: '/goods/add',
-			viewPath: 'views/goods/goods-add.vue',
-			keepAlive: 0
-		},
-		// 邀请有礼
-		{
-			id: '6',
-			parentId: null,
-			name: '老带新',
-			type: 0,
-			icon: 'iconyaoqingyouli',
-			orderNum: 6,
-			router: '/invite/list',
-			viewPath: 'views/invite/list.vue',
-			keepAlive: 1
-		},
-		{
-			id: '601',
-			parentId: '6',
-			name: '邀请列表',
-			type: 1,
-			icon: 'iconkehuguanli',
-			orderNum: 6,
-			router: '/invite/list',
-			viewPath: 'views/invite/list.vue',
-			keepAlive: 1
-		},
-		{
-			id: '602',
-			parentId: '6',
-			name: '奖励设置',
-			type: 1,
-			icon: 'iconkehuguanli',
-			orderNum: 6,
-			router: '/invite/reward-set',
-			viewPath: 'views/invite/reward-set.vue',
-			keepAlive: 1
-		},
-		// 优惠券
-		{
-			id: '7',
-			parentId: null,
-			name: '优惠券',
-			type: 1,
-			icon: 'iconyouhuiquan',
-			orderNum: 7,
-			router: '/coupon/list',
-			viewPath: 'views/coupon/list.vue',
-			keepAlive: 1
-		},
-        // 优惠券
-        {
-            id: '701',
-            parentId: 7,
-            name: '列表',
-            type: 1,
-            icon: 'iconyouhuiquan',
-            orderNum: 7,
-            router: '/coupon/list',
-            viewPath: 'views/coupon/list.vue',
-            keepAlive: 1
-        },
 		// 员工管理
 		// 员工管理
 		{
 		{
 			id: '9',
 			id: '9',

+ 19 - 28
ghs/src/views/home.vue

@@ -131,20 +131,20 @@ export default {
 			// 总数
 			// 总数
 			totalData: [
 			totalData: [
 				{
 				{
-					name: '访问',
+					name: '访问',
 					icon: 'el-icon-s-data',
 					icon: 'el-icon-s-data',
 					val: 0
 					val: 0
 				},
 				},
 				{
 				{
-					name: '新客',
+					name: '新客',
 					icon: 'el-icon-s-custom',
 					icon: 'el-icon-s-custom',
 					val: 0,
 					val: 0,
 					url: '/member/list'
 					url: '/member/list'
 				},
 				},
 				{
 				{
-					name: '新粉丝',
-					icon: 'el-icon-user',
-					val: 0,
+					name: '支出',
+					icon: 'el-icon-s-marketing',
+					val: '¥0.00',
 					url: '/member/list?type=1'
 					url: '/member/list?type=1'
 				},
 				},
 				{
 				{
@@ -154,9 +154,9 @@ export default {
 					url: '/assets/list'
 					url: '/assets/list'
 				},
 				},
 				{
 				{
-					name: '单',
+					name: '单',
 					icon: 'el-icon-s-order',
 					icon: 'el-icon-s-order',
-					val: 0,
+					val: '¥0.00',
 					url: '/order/list?status=-1'
 					url: '/order/list?status=-1'
 				}
 				}
 			],
 			],
@@ -190,11 +190,7 @@ export default {
 			],
 			],
 			// 快捷入口
 			// 快捷入口
 			entryData: [
 			entryData: [
-				{
-					name: '订单管理',
-					icon: 'icondingdanguanli',
-					url: '/order/list'
-				},
+
 				{
 				{
 					name: '客户管理',
 					name: '客户管理',
 					icon: 'iconkehuguanli',
 					icon: 'iconkehuguanli',
@@ -202,23 +198,18 @@ export default {
 				},
 				},
 				{
 				{
 					name: '开单',
 					name: '开单',
-					icon: 'icontupiantianjia',
+					icon: 'icondingdanguanli',
 					url: '/order/add'
 					url: '/order/add'
 				},
 				},
 				{
 				{
-					name: '商品管理',
+					name: '花材列表',
 					icon: 'iconshangpinguanli',
 					icon: 'iconshangpinguanli',
-					url: '/goods/list'
+					url: '/item/list'
 				},
 				},
 				{
 				{
-					name: '老带新',
+					name: '邀请开店',
 					icon: 'iconyaoqingyouli',
 					icon: 'iconyaoqingyouli',
-					url: '/invite/list'
-				},
-				{
-					name: '广告管理',
-					icon: 'iconguanggao',
-					url: '/ad/list'
+					url: '/pages/admin/my-invite'
 				}
 				}
 			],
 			],
 			// 总统计
 			// 总统计
@@ -228,11 +219,11 @@ export default {
 					val: 10
 					val: 10
 				},
 				},
 				{
 				{
-					name: '粉丝数',
+					name: '总访问',
 					val: 10
 					val: 10
 				},
 				},
 				{
 				{
-					name: '会员数',
+					name: '总订单',
 					val: 10
 					val: 10
 				},
 				},
 				{
 				{
@@ -244,17 +235,17 @@ export default {
 					val: 10
 					val: 10
 				},
 				},
 				{
 				{
-					name: '总访问量',
+					name: '总采购',
 					val: 10
 					val: 10
 				},
 				},
 				{
 				{
-					name: '剩余短信',
+					name: '花材数',
 					val: 10
 					val: 10
 				},
 				},
 				{
 				{
-					name: '商品总数',
+					name: '剩余短信',
 					val: 10
 					val: 10
-				}
+				},
 			],
 			],
 			// 收入统计
 			// 收入统计
 			incomeData: {
 			incomeData: {

+ 11 - 16
ghs/src/views/item-class/list.vue

@@ -18,22 +18,16 @@
 				</el-tabs>
 				</el-tabs>
 			</template>
 			</template>
 
 
-			<template #table-column-avatarUrl="{scope}">
-				<cl-avatar
-					shape="square"
-					:size="32"
-					:src="scope.row.smallImgList[0]"
-					:style="{ margin: 'auto' }"
-				></cl-avatar>
-			</template>
-
-			<template #table-column-goodsName="{scope}">
-				<span>{{ scope.row.goodsName }}</span>
+			<template #table-column-num="{scope}">
+				<el-link
+					:underline="true"
+					@click="getItemList(scope.row)"
+					style="font-size:12px;display:inline-block;color:#409EFF"
+				>{{ scope.row.num }}</el-link>
 			</template>
 			</template>
 
 
 			<template #table-column-inTurn="{scope}">
 			<template #table-column-inTurn="{scope}">
 				<span v-if="!sort.status">{{ scope.row.inTurn }}</span>
 				<span v-if="!sort.status">{{ scope.row.inTurn }}</span>
-
 				<el-input-number
 				<el-input-number
 					ref="sort-input"
 					ref="sort-input"
 					focus
 					focus
@@ -89,11 +83,11 @@ export default {
 			app: null,
 			app: null,
 			sortLink: '',
 			sortLink: '',
 			operateData: {},
 			operateData: {},
-			tabIndex: '-1',
+			tabIndex: '0',
 			tabsData: [
 			tabsData: [
 				{
 				{
-					text: '全部分类',
-					key: '-1'
+					text: '分类',
+					key: '0'
 				}
 				}
 			],
 			],
 			selects: {},
 			selects: {},
@@ -111,7 +105,8 @@ export default {
 		//添加花材
 		//添加花材
 		getItemList(data) {
 		getItemList(data) {
 			let query = {};
 			let query = {};
-			query.classId = data.id;
+			query.classId = data.id
+			query.name = data.name
 			this.$router.push({ path: '/item/list', query });
 			this.$router.push({ path: '/item/list', query });
 		},
 		},
 		// x-crud 组件
 		// x-crud 组件

+ 26 - 20
ghs/src/views/item/list.vue

@@ -6,7 +6,7 @@
 					class="liu-tabs"
 					class="liu-tabs"
 					type="border-card"
 					type="border-card"
 					v-model="tabIndex"
 					v-model="tabIndex"
-					@tab-click="handleClick"
+					@tab-click="tabClick"
 				>
 				>
 					<el-tab-pane
 					<el-tab-pane
 						v-for="(item, index) in tabsData"
 						v-for="(item, index) in tabsData"
@@ -65,9 +65,6 @@
 			<template #slot-add-goods-btn="{scope}">
 			<template #slot-add-goods-btn="{scope}">
 				<el-button type="primary" size="mini" @click="add()">添加</el-button>
 				<el-button type="primary" size="mini" @click="add()">添加</el-button>
 			</template>
 			</template>
-			<template #slot-modify="{scope}">
-				<el-button type="text" @click="modify(scope.row)">修改</el-button>
-			</template>
 		</x-crud>
 		</x-crud>
 	</div>
 	</div>
 </template>
 </template>
@@ -81,32 +78,41 @@ export default {
 			app: null,
 			app: null,
 			sortLink: '',
 			sortLink: '',
 			operateData: {},
 			operateData: {},
-			tabIndex: '-1',
+			tabIndex: '0',
 			tabsData: [
 			tabsData: [
 				{
 				{
-					text: '全部',
-					key: '-1'
+					text: '列表',
+					key: '0'
 				}
 				}
 			],
 			],
 			selects: {},
 			selects: {},
 			sort: {
 			sort: {
 				status: false
 				status: false
-			}
+			},
+			classId:0
 		};
 		};
 	},
 	},
 	computed: {
 	computed: {
 	},
 	},
-	created() {
-		console.log(88888888888888888888)
-		console.log(this.$route.query)
-	},
 	methods: {
 	methods: {
-		handleClick(tab, e) {
-			this.app.refresh({ type: this.tabIndex });
+		tabClick(tab, e) {
+			this.app.refresh({ classId: this.classId });
 		},
 		},
 		onLoad({ ctx, app }) {
 		onLoad({ ctx, app }) {
-			this.app = app;
-			ctx.service(this.$service.item)
+                this.app = app;
+				if (this.$route.query.classId) {
+					this.classId = this.$route.query.classId
+					if(this.$route.query.name != ''){
+						this.tabsData[0].text = this.$route.query.name
+						this.$forceUpdate()
+					}
+				}
+                let getItem = () => {
+                    return this.$service.item.list({classId:this.classId})
+                };
+                ctx.service({
+                    page: getItem
+                })
 				.set('table', {
 				.set('table', {
 					columns: [
 					columns: [
 						{
 						{
@@ -134,7 +140,7 @@ export default {
 						},
 						},
 						{
 						{
 							prop: 'addPrice',
 							prop: 'addPrice',
-							label: '单位加价',
+							label: '加价',
 							align: 'center',
 							align: 'center',
 							'min-width': 100
 							'min-width': 100
 						},
 						},
@@ -159,7 +165,7 @@ export default {
 							fixed: 'right',
 							fixed: 'right',
 							label: '操作'
 							label: '操作'
 						},
 						},
-						layout: ['slot-modify','delete',]
+						layout: ['delete',]
 					}
 					}
 				})
 				})
 				.set('dict', {
 				.set('dict', {
@@ -184,7 +190,7 @@ export default {
 					});
 					});
 				})
 				})
 				.done();
 				.done();
-			app.refresh({ status: this.tabIndex });
+			app.refresh({ classId: this.classId });
 		},
 		},
 
 
 		refresh(params) {
 		refresh(params) {
@@ -237,4 +243,4 @@ export default {
 		padding: 2px 5px;
 		padding: 2px 5px;
 	}
 	}
 }
 }
-</style>
+</style>