lalala 6 лет назад
Родитель
Сommit
b5ac5ea3fc

+ 48 - 0
admin-code/src/mock/userInfo.js

@@ -260,6 +260,54 @@ let menu = {
 			router: '/sass/order/list',
 			viewPath: 'sass/order/list',
 			keepAlive: 1
+		},
+		// 商家客户
+		{
+			id: '2',
+			parentId: null,
+			name: '客户列表',
+			type: 1,
+			icon: 'icongongzuotai',
+			orderNum: 1,
+			router: '/sass/member/list',
+			viewPath: 'sass/member/list',
+			keepAlive: 1
+		},
+		// 花卉宝商家客户
+		{
+			id: '3',
+			parentId: null,
+			name: '花卉宝客户',
+			type: 1,
+			icon: 'icongongzuotai',
+			orderNum: 1,
+			router: '/sass/pt-member/list',
+			viewPath: 'sass/pt-member/list',
+			keepAlive: 1
+		},
+		// 商家商品
+		{
+			id: '3',
+			parentId: null,
+			name: '商品列表',
+			type: 1,
+			icon: 'icongongzuotai',
+			orderNum: 1,
+			router: '/sass/goods/list',
+			viewPath: 'sass/goods/list',
+			keepAlive: 1
+		},
+		// 节日管理
+		{
+			id: '3',
+			parentId: null,
+			name: '节日列表',
+			type: 1,
+			icon: 'icongongzuotai',
+			orderNum: 1,
+			router: '/sass/fest/list',
+			viewPath: 'sass/fest/list',
+			keepAlive: 1
 		}
 	]
 };

+ 107 - 0
admin-code/src/sass/fest/list.vue

@@ -0,0 +1,107 @@
+<template>
+	<div class="app-list-content">
+		<cl-crud class="liu-crud-wrap" @load="onLoad">
+			<!-- 日期 -->
+			<template #table-column-month="{scope}">
+				<span>{{ scope.row.month + '.' + scope.row.day }}</span>
+			</template>
+		</cl-crud>
+	</div>
+</template>
+
+<script>
+export default {
+	data() {
+		return {
+			// cl-crud
+			app: null
+		};
+	},
+	mounted() {},
+	methods: {
+		// crud
+		onLoad({ ctx, app }) {
+			this.app = app;
+			ctx.service(this.$service.sassFest)
+				.set('table', {
+					columns: [
+						{
+							prop: 'id',
+							label: 'ID',
+							align: 'center'
+						},
+						{
+							prop: 'name',
+							label: '名称',
+							align: 'center'
+						},
+						{
+							prop: 'month',
+							label: '时间',
+							align: 'center'
+						}
+					],
+					// 操作列
+					op: {
+						visible: true, // 是否显示
+						// 同 element-ui Table-column Attributes
+						props: {
+							width: 150,
+							align: 'center',
+							fixed: 'right',
+							label: '操作'
+						},
+						// 布局,请移步 `layout`
+						layout: ['edit']
+					}
+				})
+				.set('upsert', {
+					props: {
+						width: '500px'
+					},
+					items: [
+						{
+							prop: 'name',
+							label: '名称',
+							span: 24,
+							component: {
+								name: 'el-input'
+							},
+							rules: {
+								required: true,
+								message: '名称不能为空'
+							}
+						},
+						{
+							prop: 'month',
+							label: '月份',
+							span: 24,
+							component: {
+								name: 'el-input'
+							},
+							rules: {
+								required: true,
+								message: '月份不能为空'
+							}
+						},
+						{
+							prop: 'day',
+							label: '日',
+							span: 24,
+							component: {
+								name: 'el-input'
+							},
+							rules: {
+								required: true,
+								message: '日不能为空'
+							}
+						}
+					]
+				})
+				.set('layout', [['slot-tabs'], ['flex1', 'refresh-btn', 'add-btn'], ['data-table']])
+				.done();
+			app.refresh();
+		}
+	}
+};
+</script>

+ 199 - 0
admin-code/src/sass/goods/list.vue

@@ -0,0 +1,199 @@
+<template>
+	<div class="app-list-content">
+		<cl-crud class="liu-crud-wrap" @load="onLoad">
+			<template #slot-tabs="{ scope }">
+				<el-tabs
+					class="liu-tabs"
+					type="border-card"
+					v-model="tabIndex"
+					@tab-click="handleClick"
+				>
+					<el-tab-pane
+						v-for="(item, index) in tabsData"
+						:key="index"
+						:label="`${item.text}(${item.val})`"
+						:name="item.key"
+					>
+					</el-tab-pane>
+				</el-tabs>
+			</template>
+
+			<template #table-column-avatarUrl="{scope}">
+				<cl-avatar
+					shape="square"
+					:size="40"
+					:src="scope.row.imgList | default_avatar"
+					:style="{ margin: 'auto' }"
+				></cl-avatar>
+			</template>
+
+			<template #table-column-goodsName="{scope}">
+				<span>{{ scope.row.goodsName }}</span>
+				<!-- <span>二维码</span> -->
+				<span class="short-link" @click="openLinkFn(scope.row.shortUrl)">链接</span>
+			</template>
+
+			<!-- 添加商品 -->
+			<template #slot-add-goods-btn="{scope}">
+				<el-button type="primary" size="mini" @click="addFn">添加</el-button>
+			</template>
+
+			<!-- 状态 -->
+			<template #table-column-status="{scope}">
+				<span>{{ scope.row.status == 1 ? '上架' : '下架' }}</span>
+			</template>
+		</cl-crud>
+		<!-- 添加商品 -->
+		<el-dialog title="商品短链接:" :visible.sync="dialogFormVisible" width="40%">
+			<div>
+				<el-input v-model="sortLink" :disabled="true"></el-input>
+			</div>
+			<div slot="footer" class="dialog-footer">
+				<el-button @click="dialogFormVisible = false">取 消</el-button>
+				<el-button type="primary" @click="dialogFormVisible = false">发到手机</el-button>
+			</div>
+		</el-dialog>
+	</div>
+</template>
+
+<script>
+export default {
+	data() {
+		return {
+			app: null,
+			dialogFormVisible: false,
+			sortLink: '',
+			tabIndex: '-1',
+			tabsData: [
+				{
+					text: '全部',
+					key: '-1',
+					val: 0
+				},
+				{
+					text: '上架',
+					key: '1',
+					val: 0
+				},
+				{
+					text: '下架',
+					key: '0',
+					val: 0
+				}
+			]
+		};
+	},
+	methods: {
+		handleClick(tab, e) {
+			this.app.refresh({ type: this.tabIndex });
+		},
+		// 打开链接
+		openLinkFn(link) {
+			this.sortLink = link || '';
+			this.dialogFormVisible = true;
+		},
+		// cl-crud 组件
+		onLoad({ ctx, app }) {
+			this.app = app;
+			ctx.service(this.$service.goods)
+				.set('table', {
+					columns: [
+						{
+							prop: 'id',
+							label: 'ID',
+							align: 'center'
+						},
+						{
+							prop: 'avatarUrl',
+							label: '封面',
+							align: 'center'
+						},
+						{
+							prop: 'goodsName',
+							label: '标题',
+							align: 'center'
+						},
+						{
+							prop: 'price',
+							label: '价格',
+							align: 'center',
+							emptyText: '无',
+							'min-width': 150
+						},
+						{
+							prop: 'actualSold',
+							label: '销量',
+							align: 'center'
+						},
+						{
+							prop: 'viewNum',
+							label: '浏览量',
+							align: 'center'
+						},
+						{
+							prop: 'merchantName',
+							label: '商家',
+							align: 'center'
+						},
+						{
+							prop: 'status',
+							label: '状态',
+							align: 'center'
+						},
+						{
+							prop: 'createDate',
+							label: '创建时间',
+							align: 'center'
+						}
+					],
+					// 操作列
+					op: {
+						visible: false, // 是否显示
+						// 同 element-ui Table-column Attributes
+						props: {
+							width: 150,
+							align: 'center',
+							fixed: 'right',
+							label: '操作'
+						},
+						// 布局,请移步 `layout`
+						layout: []
+					}
+				})
+				.set('dict', {
+					search: {
+						keyWord: 'goodsName'
+					}
+				})
+				.set('search', {
+					key: {
+						placeholder: '商品名称'
+					}
+				})
+				.set('layout', [
+					['slot-tabs'],
+					['flex1', 'refresh-btn'],
+					['data-table'],
+					['flex1', 'pagination']
+				])
+				.on('refresh', async (params, { next }) => {
+					// 继续执行刷新
+					let { asset } = await next(params);
+					this.tabsData[0].val = asset.totalGoods;
+					this.tabsData[1].val = asset.onGoods;
+					this.tabsData[2].val = asset.offGoods;
+				})
+				.done();
+			app.refresh({ status: this.tabIndex });
+		}
+	}
+};
+</script>
+
+<style lang="scss" scoped>
+.short-link {
+	color: $mainColor;
+	margin-left: 10px;
+	cursor: pointer;
+}
+</style>

+ 45 - 24
admin-code/src/sass/member/list.vue

@@ -11,11 +11,36 @@
 					<el-tab-pane
 						v-for="(item, index) in tabsData"
 						:key="index"
-						:label="item.text"
+						:label="`${item.text}(${item.val})`"
 						:name="item.key"
 					></el-tab-pane>
 				</el-tabs>
 			</template>
+
+			<!-- 头像 -->
+			<template #table-column-smallAvatarUrl="{scope}">
+				<cl-avatar
+					shape="square"
+					:size="40"
+					:src="scope.row.smallAvatarUrl | default_avatar"
+					:style="{ margin: 'auto' }"
+				></cl-avatar>
+			</template>
+
+			<!-- 余额 -->
+			<template #table-column-balance="{scope}">
+				<span>{{ scope.row.userAsset.balance }}</span>
+			</template>
+
+			<!-- 成长值 -->
+			<template #table-column-growth="{scope}">
+				<span>{{ scope.row.userAsset.growth }}</span>
+			</template>
+
+			<!-- 关注公众号 -->
+			<template #table-column-subscribe="{scope}">
+				<span>{{ scope.row.subscribe == 1 ? '有' : '没有' }}</span>
+			</template>
 		</cl-crud>
 	</div>
 </template>
@@ -35,12 +60,12 @@ export default {
 				},
 				{
 					text: '粉丝',
-					key: '0',
+					key: '1',
 					val: 0
 				},
 				{
 					text: '会员',
-					key: '1',
+					key: '2',
 					val: 0
 				}
 			]
@@ -54,63 +79,61 @@ export default {
 		// crud
 		onLoad({ ctx, app }) {
 			this.app = app;
-			ctx.service(this.$service.sassOrder)
+			ctx.service(this.$service.sassMember)
 				.set('table', {
 					columns: [
 						{
-							prop: 'ID',
-							label: '单号',
+							prop: 'id',
+							label: 'ID',
 							align: 'center'
 						},
 						{
-							prop: 'bookName',
+							prop: 'smallAvatarUrl',
 							label: '头像',
-							align: 'center',
-							'min-width': '200px'
+							align: 'center'
 						},
 						{
-							prop: 'receiveUserName',
+							prop: 'userName',
 							label: '来源昵称',
-							align: 'center',
-							'min-width': '200px'
+							align: 'center'
 						},
 						{
-							prop: 'prePrice',
+							prop: 'mobile',
 							label: '手机号',
 							align: 'center'
 						},
 						{
-							prop: 'actPrice',
+							prop: 'merchantName',
 							label: '商家',
 							align: 'center',
 							emptyText: '无'
 						},
 						{
-							prop: 'sendTime',
+							prop: 'memberLevel',
 							label: '会员级别',
 							align: 'center',
 							emptyText: '无'
 						},
 						{
-							prop: 'status',
+							prop: 'balance',
 							label: '余额',
 							align: 'center',
 							emptyText: '无'
 						},
 						{
-							prop: 'sendNum',
+							prop: 'growth',
 							label: '成长值',
 							align: 'center',
 							emptyText: '无'
 						},
 						{
-							prop: 'sendNum',
+							prop: 'subscribe',
 							label: '关注公众号',
 							align: 'center',
 							emptyText: '无'
 						},
 						{
-							prop: 'sendNum',
+							prop: 'visitTimeFormat',
 							label: '最近访问',
 							align: 'center',
 							emptyText: '无'
@@ -139,11 +162,9 @@ export default {
 				.on('refresh', async (params, { next }) => {
 					// 继续执行刷新
 					let { asset } = await next(params);
-					this.tabsData[0].val = asset.totalOrder;
-					this.tabsData[1].val = asset.unPayOrder;
-					this.tabsData[2].val = asset.unSendOrder;
-					this.tabsData[3].val = asset.sendingOrder;
-					this.tabsData[4].val = asset.finishOrder;
+					this.tabsData[0].val = asset.totalUser;
+					this.tabsData[1].val = asset.totalFans;
+					this.tabsData[2].val = asset.totalMember;
 				})
 				.done();
 			app.refresh();

+ 22 - 0
admin-code/src/sass/order/list.vue

@@ -17,6 +17,28 @@
 				</el-tabs>
 			</template>
 
+			<!-- 订花人 -->
+			<template #table-column-bookName="{scope}">
+				<div class="flex-center">
+					<cl-avatar
+						shape="square"
+						:size="40"
+						:src="scope.row.bookAvatar | default_avatar"
+						:style="{ margin: 'auto' }"
+					></cl-avatar>
+					<div class="app-margin-left-10">{{ scope.row.bookName }}</div>
+					<div class="app-margin-left-10">{{ scope.row.bookMobile }}</div>
+				</div>
+			</template>
+
+			<!-- 收花人 -->
+			<template #table-column-receiveUserName="{scope}">
+				<div class="flex-center">
+					<div class="app-margin-left-10">{{ scope.row.receiveUserName }}</div>
+					<div class="app-margin-left-10">{{ scope.row.receiveMobile }}</div>
+				</div>
+			</template>
+
 			<!-- 状态 -->
 			<template #table-column-status="{scope}">
 				<span>{{ scope.row.status | constantfilter('ORDER_STATUS') }}</span>

+ 174 - 0
admin-code/src/sass/pt-member/list.vue

@@ -0,0 +1,174 @@
+<template>
+	<div class="app-list-content">
+		<cl-crud class="liu-crud-wrap" @load="onLoad">
+			<template #slot-tabs="{ scope }">
+				<el-tabs
+					class="liu-tabs"
+					type="border-card"
+					v-model="tabIndex"
+					@tab-click="handleClick"
+				>
+					<el-tab-pane
+						v-for="(item, index) in tabsData"
+						:key="index"
+						:label="`${item.text}(${item.val})`"
+						:name="item.key"
+					></el-tab-pane>
+				</el-tabs>
+			</template>
+
+			<!-- 头像 -->
+			<template #table-column-smallAvatarUrl="{scope}">
+				<cl-avatar
+					shape="square"
+					:size="40"
+					:src="scope.row.smallAvatarUrl | default_avatar"
+					:style="{ margin: 'auto' }"
+				></cl-avatar>
+			</template>
+
+			<!-- 余额 -->
+			<template #table-column-balance="{scope}">
+				<span>{{ scope.row.userAsset.balance }}</span>
+			</template>
+
+			<!-- 成长值 -->
+			<template #table-column-growth="{scope}">
+				<span>{{ scope.row.userAsset.growth }}</span>
+			</template>
+
+			<!-- 关注公众号 -->
+			<template #table-column-subscribe="{scope}">
+				<span>{{ scope.row.subscribe == 1 ? '有' : '没有' }}</span>
+			</template>
+		</cl-crud>
+	</div>
+</template>
+
+<script>
+export default {
+	data() {
+		return {
+			// cl-crud
+			app: null,
+			tabIndex: '-1',
+			tabsData: [
+				{
+					text: '全部',
+					key: '-1',
+					val: 0
+				},
+				{
+					text: '粉丝',
+					key: '1',
+					val: 0
+				},
+				{
+					text: '会员',
+					key: '2',
+					val: 0
+				}
+			]
+		};
+	},
+	mounted() {},
+	methods: {
+		handleClick() {
+			this.app.refresh({ status: this.tabIndex });
+		},
+		// crud
+		onLoad({ ctx, app }) {
+			this.app = app;
+			ctx.service(this.$service.sassPtMember)
+				.set('table', {
+					columns: [
+						{
+							prop: 'id',
+							label: 'ID',
+							align: 'center'
+						},
+						{
+							prop: 'smallAvatarUrl',
+							label: '头像',
+							align: 'center'
+						},
+						{
+							prop: 'userName',
+							label: '来源昵称',
+							align: 'center'
+						},
+						{
+							prop: 'mobile',
+							label: '手机号',
+							align: 'center'
+						},
+						{
+							prop: 'merchantName',
+							label: '商家',
+							align: 'center',
+							emptyText: '无'
+						},
+						{
+							prop: 'memberLevel',
+							label: '会员级别',
+							align: 'center',
+							emptyText: '无'
+						},
+						{
+							prop: 'balance',
+							label: '余额',
+							align: 'center',
+							emptyText: '无'
+						},
+						{
+							prop: 'growth',
+							label: '成长值',
+							align: 'center',
+							emptyText: '无'
+						},
+						{
+							prop: 'subscribe',
+							label: '关注公众号',
+							align: 'center',
+							emptyText: '无'
+						},
+						{
+							prop: 'visitTimeFormat',
+							label: '最近访问',
+							align: 'center',
+							emptyText: '无'
+						}
+					],
+					// 操作列
+					op: {
+						visible: false, // 是否显示
+						// 同 element-ui Table-column Attributes
+						props: {
+							width: 150,
+							align: 'center',
+							fixed: 'right',
+							label: '操作'
+						},
+						// 布局,请移步 `layout`
+						layout: []
+					}
+				})
+				.set('layout', [
+					['slot-tabs'],
+					['flex1', 'refresh-btn'],
+					['data-table'],
+					['flex1', 'pagination']
+				])
+				.on('refresh', async (params, { next }) => {
+					// 继续执行刷新
+					let { asset } = await next(params);
+					this.tabsData[0].val = asset.totalUser;
+					this.tabsData[1].val = asset.totalFans;
+					this.tabsData[2].val = asset.totalMember;
+				})
+				.done();
+			app.refresh();
+		}
+	}
+};
+</script>

+ 7 - 1
admin-code/src/service/index.js

@@ -17,6 +17,9 @@ import single from './single/index';
 // sass
 import sassShop from './sass/shop/index';
 import sassOrder from './sass/order/index';
+import sassMember from './sass/member/index';
+import sassPtMember from './sass/pt-member/index';
+import sassFest from './sass/fest/index';
 
 Vue.prototype.$service = {
 	common,
@@ -36,7 +39,10 @@ Vue.prototype.$service = {
 	single,
 	// sass
 	sassShop,
-	sassOrder
+	sassOrder,
+	sassMember,
+	sassPtMember,
+	sassFest
 };
 
 export default Vue.prototype.$service;

+ 18 - 0
admin-code/src/service/sass/fest/index.js

@@ -0,0 +1,18 @@
+import { BaseService, Service } from '@/cool/index';
+
+@Service('fest')
+export class FestService extends BaseService {
+	// 购买列表 b
+	page(data) {
+		return this.request({
+			url: '/list',
+			params: data
+		}).then(res => {
+			return {
+				list: res
+			};
+		});
+	}
+}
+
+export default new FestService();

+ 6 - 0
admin-code/src/service/sass/member/index.js

@@ -0,0 +1,6 @@
+import { BaseService, Service } from '@/cool/index';
+
+@Service('user')
+export class MemberService extends BaseService {}
+
+export default new MemberService();

+ 14 - 0
admin-code/src/service/sass/pt-member/index.js

@@ -0,0 +1,14 @@
+import { BaseService, Service } from '@/cool/index';
+
+@Service('user')
+export class PtMemberService extends BaseService {
+	// 购买列表 b
+	page(data) {
+		return this.request({
+			url: '/oa-list',
+			params: data
+		});
+	}
+}
+
+export default new PtMemberService();

+ 6 - 3
admin-code/src/views/goods/goods-list.vue

@@ -19,9 +19,12 @@
 			</template>
 
 			<template #table-column-avatarUrl="{scope}">
-				<div>
-					<img :src="scope.row.imgList" alt />
-				</div>
+				<cl-avatar
+					shape="square"
+					:size="40"
+					:src="scope.row.imgList | default_avatar"
+					:style="{ margin: 'auto' }"
+				></cl-avatar>
 			</template>
 
 			<template #table-column-goodsName="{scope}">