lalala 6 年之前
父节点
当前提交
ac0e651e8b

+ 42 - 0
admin-code/src/constant/constant.js

@@ -79,6 +79,48 @@ const _CONST_MAP = {
 			label: '已完成',
 			value: 4
 		}
+	],
+	// 后台审核账号
+	SASS_APPLY_STATUS: [
+		{
+			label: '审核中',
+			value: 0
+		},
+		{
+			label: '审核通过',
+			value: 1
+		},
+		{
+			label: '审核未通过',
+			value: 2
+		},
+		{
+			label: '已付费',
+			value: 3
+		},
+		{
+			label: '过期',
+			value: 4
+		}
+	],
+	// 后台小程序状态
+	SASS_MINIAPP_STATUS: [
+		{
+			label: '审核中',
+			value: 0
+		},
+		{
+			label: '待上线',
+			value: 1
+		},
+		{
+			label: '已上线',
+			value: 2
+		},
+		{
+			label: '审核未通过',
+			value: 3
+		}
 	]
 };
 

+ 3 - 0
admin-code/src/cool/request/service.js

@@ -46,6 +46,9 @@ export class BaseService {
 			path += '/' + this.namespace;
 		}
 
+		console.log('path', path);
+		console.log('options.url', options.url);
+
 		options.url = path + options.url;
 		// options.params.t = Date.parse(new Date());
 

+ 15 - 26
admin-code/src/mock/userInfo.js

@@ -171,17 +171,17 @@ let menu = {
 		// 	keepAlive: 1
 		// },
 		// 工作台
-		{
-			id: '1',
-			parentId: null,
-			name: '工作台',
-			type: 0,
-			icon: 'icongongzuotai',
-			orderNum: 1,
-			router: '/',
-			viewPath: null,
-			keepAlive: 1
-		},
+		// {
+		// 	id: '1',
+		// 	parentId: null,
+		// 	name: '工作台',
+		// 	type: 0,
+		// 	icon: 'icongongzuotai',
+		// 	orderNum: 1,
+		// 	router: '/',
+		// 	viewPath: null,
+		// 	keepAlive: 1
+		// },
 		// 商家管理
 		{
 			id: '1',
@@ -212,8 +212,8 @@ let menu = {
 			type: 1,
 			icon: 'icongongzuotai',
 			orderNum: 1,
-			router: '/',
-			viewPath: null,
+			router: '/sass/merchant/apply-list',
+			viewPath: 'sass/shop/apply',
 			keepAlive: 1
 		},
 		{
@@ -223,8 +223,8 @@ let menu = {
 			type: 1,
 			icon: 'icongongzuotai',
 			orderNum: 1,
-			router: '/',
-			viewPath: null,
+			router: '/sass/merchant/upgrade',
+			viewPath: 'sass/shop/upgrade',
 			keepAlive: 1
 		},
 		{
@@ -342,17 +342,6 @@ let menu = {
 			router: '/sass/manage/auth',
 			viewPath: 'sass/manage/auth',
 			keepAlive: 1
-		},
-		{
-			id: '8',
-			parentId: null,
-			name: '权限',
-			type: 1,
-			icon: null,
-			orderNum: 1,
-			router: null,
-			viewPath: null,
-			keepAlive: 0
 		}
 	]
 };

+ 1 - 0
admin-code/src/sass/manage/auth.vue

@@ -221,6 +221,7 @@ export default {
 							label: 'endId',
 							span: 24,
 							value: '1',
+							hidden: true,
 							component: {
 								name: 'el-input',
 								attrs: {

+ 2 - 3
admin-code/src/sass/order/list.vue

@@ -24,7 +24,6 @@
 						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>
@@ -103,13 +102,13 @@ export default {
 							prop: 'bookName',
 							label: '订花人',
 							align: 'center',
-							'min-width': '200px'
+							'min-width': '120px'
 						},
 						{
 							prop: 'receiveUserName',
 							label: '收花人',
 							align: 'center',
-							'min-width': '200px'
+							'min-width': '150px'
 						},
 						{
 							prop: 'prePrice',

+ 173 - 0
admin-code/src/sass/shop/apply.vue

@@ -0,0 +1,173 @@
+<template>
+	<div class="app-list-content">
+		<cl-crud class="liu-crud-wrap" @load="onLoad">
+			<template #table-column-addTime="{scope}">
+				<span>{{ scope.row.addTime | formatTime }}</span>
+			</template>
+
+			<template #table-column-status="{scope}">
+				<span>{{ scope.row.status | constantfilter('SASS_APPLY_STATUS') }}</span>
+			</template>
+
+			<!-- 审核 -->
+			<template #slot-apply="{scope}">
+				<template v-if="scope.row.status == 2">
+					<el-button type="text" @click="showModalFn(scope.row)">审核</el-button>
+				</template>
+			</template>
+		</cl-crud>
+		<!-- 审核弹窗 -->
+		<el-dialog
+			title="审核"
+			:visible.sync="applyDialog"
+			:close-on-click-modal="false"
+			width="500px"
+		>
+			<div class="ad-modal-content">
+				<el-form
+					:model="form"
+					:rules="rule"
+					ref="form"
+					label-width="100px"
+					class="demo-form"
+				>
+					<el-form-item label="状态" prop="status">
+						<el-radio-group v-model="form.status">
+							<el-radio label="1">通过</el-radio>
+							<el-radio label="2">拒绝</el-radio>
+						</el-radio-group>
+					</el-form-item>
+					<el-form-item label="备注" prop="remark">
+						<el-input type="textarea" v-model="form.remark"></el-input>
+					</el-form-item>
+				</el-form>
+			</div>
+			<div slot="footer" class="dialog-footer">
+				<el-button size="small" @click="resetForm">取 消</el-button>
+				<el-button type="primary" size="small" @click="applyFn">确认</el-button>
+			</div>
+		</el-dialog>
+	</div>
+</template>
+
+<script>
+export default {
+	data() {
+		return {
+			// cl-crud
+			app: null,
+			// 审核
+			applyDialog: false,
+			form: {
+				id: '',
+				status: '1',
+				remark: ''
+			},
+			rule: {}
+		};
+	},
+	mounted() {},
+	methods: {
+		showModalFn(item) {
+			this.form.id = item.id;
+			this.applyDialog = true;
+		},
+		applyFn() {
+			this.$service.sassShop.applyCheck(this.form).then(res => {
+				this.app.refresh();
+				this.$message.success('审核成功!');
+				this.resetForm();
+			});
+		},
+		resetForm() {
+			this.$refs['form'].resetFields();
+			this.applyDialog = false;
+		},
+		// crud
+		onLoad({ ctx, app }) {
+			this.app = app;
+			let applyHost = () => {
+				return this.$service.sassShop.applyList();
+			};
+			ctx.service({
+				page: applyHost
+			})
+				.set('table', {
+					columns: [
+						{
+							prop: 'id',
+							label: 'ID',
+							align: 'center'
+						},
+						{
+							prop: 'name',
+							label: '花店名称',
+							align: 'center'
+						},
+						{
+							prop: 'userName',
+							label: '店长昵称',
+							align: 'center'
+						},
+						{
+							prop: 'mobile',
+							label: '手机号',
+							align: 'center'
+						},
+						{
+							prop: 'province',
+							label: '省份',
+							align: 'center',
+							emptyText: '无'
+						},
+						{
+							prop: 'city',
+							label: '城市',
+							align: 'center',
+							emptyText: '无'
+						},
+						{
+							prop: 'oldName',
+							label: '介绍人',
+							align: 'center',
+							emptyText: '无'
+						},
+						{
+							prop: 'addTime',
+							label: '申请时间',
+							align: 'center',
+							emptyText: '无'
+						},
+						{
+							prop: 'status',
+							label: '状态',
+							align: 'center',
+							emptyText: '无'
+						}
+					],
+					// 操作列
+					op: {
+						visible: true, // 是否显示
+						// 同 element-ui Table-column Attributes
+						props: {
+							width: 100,
+							align: 'center',
+							fixed: 'right',
+							label: '操作'
+						},
+						// 布局,请移步 `layout`
+						layout: ['slot-apply']
+					}
+				})
+				.set('layout', [
+					['slot-tabs'],
+					['flex1', 'refresh-btn'],
+					['data-table'],
+					['flex1', 'pagination']
+				])
+				.done();
+			app.refresh();
+		}
+	}
+};
+</script>

+ 210 - 0
admin-code/src/sass/shop/upgrade.vue

@@ -0,0 +1,210 @@
+<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"
+						:name="item.key"
+					></el-tab-pane>
+				</el-tabs>
+			</template>
+
+			<template #table-column-submitTime="{scope}">
+				<span>{{ scope.row.submitTime | formatTime }}</span>
+			</template>
+
+			<template #table-column-status="{scope}">
+				<span>{{ scope.row.status | constantfilter('SASS_MINIAPP_STATUS') }}</span>
+			</template>
+
+			<!-- 升级 -->
+			<template #slot-upgrade="{scope}">
+				<div class="flex-center">
+					<div class="version-text">当前总版本{{ data.version }}</div>
+					<el-button type="primary" size="mini" @click="upgradeDialog = true"
+						>升级</el-button
+					>
+				</div>
+			</template>
+		</cl-crud>
+		<!-- 升级弹窗 -->
+		<el-dialog
+			title="升级"
+			:visible.sync="upgradeDialog"
+			:close-on-click-modal="false"
+			width="500px"
+		>
+			<div class="ad-modal-content">
+				<el-form
+					:model="form"
+					:rules="rule"
+					ref="form"
+					label-width="100px"
+					class="demo-form"
+				>
+					<el-form-item label="版本号" prop="status">
+						<el-input
+							v-model="form.version"
+							placeholder="请输入版本号"
+							size="small"
+						></el-input>
+					</el-form-item>
+					<el-form-item label="备注" prop="remark">
+						<el-input type="textarea" v-model="form.remark"></el-input>
+					</el-form-item>
+				</el-form>
+			</div>
+			<div slot="footer" class="dialog-footer">
+				<el-button size="small" @click="resetForm">取 消</el-button>
+				<el-button type="primary" size="small" @click="upgradeFn">确认</el-button>
+			</div>
+		</el-dialog>
+	</div>
+</template>
+
+<script>
+export default {
+	data() {
+		return {
+			// cl-crud
+			app: null,
+			tabIndex: '-1',
+			tabsData: [
+				{
+					text: '全部',
+					key: '-1'
+				},
+				{
+					text: '待审核',
+					key: '0'
+				},
+				{
+					text: '审核通过',
+					key: '1'
+				},
+				{
+					text: '审核失败',
+					key: '3'
+				}
+			],
+			// 审核
+			upgradeDialog: false,
+			form: {
+				version: '',
+				remark: ''
+			},
+			rule: {},
+			// data
+			data: {}
+		};
+	},
+	mounted() {},
+	methods: {
+		handleClick(tab, e) {
+			this.app.refresh({ status: this.tabIndex });
+		},
+		// 升级
+		showModalFn() {
+			this.upgradeDialog = true;
+		},
+		upgradeFn() {
+			this.$service.sassShop.upgradeUpdate(this.form).then(res => {
+				this.app.refresh({ status: this.tabIndex });
+				this.$message.success('升级成功!');
+				this.resetForm();
+			});
+		},
+		resetForm() {
+			this.$refs['form'].resetFields();
+			this.upgradeDialog = false;
+		},
+		// crud
+		onLoad({ ctx, app }) {
+			this.app = app;
+			let upgradeHost = () => {
+				return this.$service.sassShop.upgradeList();
+			};
+			ctx.service({
+				page: upgradeHost
+			})
+				.set('table', {
+					columns: [
+						{
+							prop: 'id',
+							label: 'ID',
+							align: 'center'
+						},
+						{
+							prop: 'miniName',
+							label: '名称',
+							align: 'center'
+						},
+						{
+							prop: 'version',
+							label: '版本号',
+							align: 'center'
+						},
+						{
+							prop: 'submitTime',
+							label: '提交时间',
+							align: 'center'
+						},
+						{
+							prop: 'status',
+							label: '状态',
+							align: 'center',
+							emptyText: '无'
+						},
+						{
+							prop: 'checkReturn',
+							label: '审核说明',
+							align: 'center',
+							emptyText: '无'
+						}
+					],
+					// 操作列
+					op: {
+						visible: false, // 是否显示
+						// 同 element-ui Table-column Attributes
+						props: {
+							width: 100,
+							align: 'center',
+							fixed: 'right',
+							label: '操作'
+						},
+						// 布局,请移步 `layout`
+						layout: []
+					}
+				})
+				.set('layout', [
+					['slot-tabs'],
+					['slot-upgrade', 'flex1', 'refresh-btn'],
+					['data-table'],
+					['flex1', 'pagination']
+				])
+				.on('refresh', async (params, { next, render }) => {
+					// 继续执行刷新
+					let res = await next(params);
+					this.data = res;
+				})
+				.done();
+			app.refresh({ status: this.tabIndex });
+		}
+	}
+};
+</script>
+
+<style lang="scss" scoped>
+.version-text {
+	margin-right: 20px;
+	color: $fontColor2;
+}
+</style>

+ 16 - 0
admin-code/src/service/sass/shop/index.js

@@ -41,6 +41,22 @@ export class ShopService extends BaseService {
 			params: data
 		});
 	}
+
+	// 小程序升级记录 s
+	upgradeList(data) {
+		return this.request({
+			url: '/mini-upgrade/list',
+			params: data
+		});
+	}
+
+	// 小程序更新版本 s
+	upgradeUpdate(data) {
+		return this.request({
+			url: '/mini-upgrade/update',
+			params: data
+		});
+	}
 }
 
 export default new ShopService();

+ 247 - 34
admin-code/src/store/modules/menu.js

@@ -14,43 +14,44 @@ export default {
 	actions: {
 		permMenu({ commit }) {
 			return new Promise((resolve, reject) => {
-				service.common
-					.permMenu()
-					.then(res => {
-						const routes = res.menus
-							.filter(e => e.type != 2)
-							.map(e => {
-								return {
-									id: e.id,
-									parentId: e.parentId,
-									path: revisePath(e.router || e.id),
-									viewPath: e.viewPath,
-									type: e.type,
-									name: e.name,
-									icon: e.icon,
-									orderNum: e.orderNum,
-									meta: {
-										keepAlive: e.keepAlive
-									},
-									children: []
-								};
-							});
+				// 	service.common
+				// 		.permMenu()
+				// 		.then(res => {
+				// const routes = res.menus
+				const routes = menu.menus
+					.filter(e => e.type != 2)
+					.map(e => {
+						return {
+							id: e.id,
+							parentId: e.parentId,
+							path: revisePath(e.router || e.id),
+							viewPath: e.viewPath,
+							type: e.type,
+							name: e.name,
+							icon: e.icon,
+							orderNum: e.orderNum,
+							meta: {
+								keepAlive: e.keepAlive
+							},
+							children: []
+						};
+					});
 
-						const menuGroup = deepTree(routes);
+				const menuGroup = deepTree(routes);
 
-						commit('SET_PERMIESSION', res.perms);
-						commit('SET_MENU_GROUP', menuGroup);
-						commit(
-							'SET_VIEW_ROUTES',
-							routes.filter(e => e.type == 1)
-						);
-						commit('SET_MENU_LIST', 0);
+				commit('SET_PERMIESSION', menu.perms);
+				commit('SET_MENU_GROUP', menuGroup);
+				commit(
+					'SET_VIEW_ROUTES',
+					routes.filter(e => e.type == 1)
+				);
+				commit('SET_MENU_LIST', 0);
 
-						resolve(menuGroup);
-					})
-					.catch(err => {
-						reject(err);
-					});
+				resolve(menuGroup);
+				// 		})
+				// 		.catch(err => {
+				// 			reject(err);
+				// 		});
 			});
 		}
 	},
@@ -82,3 +83,215 @@ export default {
 		}
 	}
 };
+
+let menu = {
+	perms: [
+		'sys:menu:add',
+		'sys:menu:delete',
+		'sys:menu:update',
+		'sys:menu:page',
+		'sys:menu:list',
+		'sys:menu:info',
+		'sys:user:add',
+		'sys:user:delete',
+		'sys:user:update',
+		'sys:user:page',
+		'sys:user:list',
+		'sys:user:info',
+		'sys:role:add',
+		'sys:role:delete',
+		'sys:role:update',
+		'sys:role:page',
+		'sys:role:list',
+		'sys:role:info',
+		'1',
+		'sys:log:page',
+		'sys:log:clear'
+	],
+	menus: [
+		// {
+		// 	id: '48',
+		// 	parentId: '47',
+		// 	name: '文档',
+		// 	type: 1,
+		// 	icon: 'icon-favorfill',
+		// 	orderNum: 0,
+		// 	router: '/tutorial/doc',
+		// 	viewPath: 'https://docs.cool-admin.com/#/',
+		// 	keepAlive: 1
+		// },
+		// 工作台
+		// {
+		// 	id: '1',
+		// 	parentId: null,
+		// 	name: '工作台',
+		// 	type: 0,
+		// 	icon: 'icongongzuotai',
+		// 	orderNum: 1,
+		// 	router: '/',
+		// 	viewPath: null,
+		// 	keepAlive: 1
+		// },
+		// 商家管理
+		{
+			id: '1',
+			parentId: null,
+			name: '商家管理',
+			type: 0,
+			icon: 'icongongzuotai',
+			orderNum: 1,
+			router: '/sass/shop-list',
+			viewPath: null,
+			keepAlive: 1
+		},
+		{
+			id: '11',
+			parentId: '1',
+			name: '商家列表',
+			type: 1,
+			icon: 'icongongzuotai',
+			orderNum: 1,
+			router: '/sass/merchant/merchant-list',
+			viewPath: 'sass/shop/list',
+			keepAlive: 1
+		},
+		{
+			id: '12',
+			parentId: '1',
+			name: '申请记录',
+			type: 1,
+			icon: 'icongongzuotai',
+			orderNum: 1,
+			router: '/sass/merchant/apply-list',
+			viewPath: 'sass/shop/apply',
+			keepAlive: 1
+		},
+		{
+			id: '13',
+			parentId: '1',
+			name: '小程序升级',
+			type: 1,
+			icon: 'icongongzuotai',
+			orderNum: 1,
+			router: '/sass/merchant/upgrade',
+			viewPath: 'sass/shop/upgrade',
+			keepAlive: 1
+		},
+		{
+			id: '14',
+			parentId: '1',
+			name: '门店',
+			type: 1,
+			icon: 'icongongzuotai',
+			orderNum: 1,
+			router: '/sass/merchant/shop-list',
+			viewPath: 'sass/shop/shop',
+			keepAlive: 1
+		},
+		{
+			id: '14',
+			parentId: '1',
+			name: '购买记录',
+			type: 1,
+			icon: 'icongongzuotai',
+			orderNum: 1,
+			router: '/sass/merchant/buy-list',
+			viewPath: 'sass/shop/buy',
+			keepAlive: 1
+		},
+		// 订单管理
+		{
+			id: '2',
+			parentId: null,
+			name: '订单管理',
+			type: 1,
+			icon: 'icongongzuotai',
+			orderNum: 1,
+			router: '/sass/order/list',
+			viewPath: 'sass/order/list',
+			keepAlive: 1
+		},
+		// 商家客户
+		{
+			id: '3',
+			parentId: null,
+			name: '客户列表',
+			type: 1,
+			icon: 'icongongzuotai',
+			orderNum: 1,
+			router: '/sass/member/list',
+			viewPath: 'sass/member/list',
+			keepAlive: 1
+		},
+		// 花卉宝商家客户
+		{
+			id: '4',
+			parentId: null,
+			name: '花卉宝客户',
+			type: 1,
+			icon: 'icongongzuotai',
+			orderNum: 1,
+			router: '/sass/pt-member/list',
+			viewPath: 'sass/pt-member/list',
+			keepAlive: 1
+		},
+		// 商家商品
+		{
+			id: '5',
+			parentId: null,
+			name: '商品列表',
+			type: 1,
+			icon: 'icongongzuotai',
+			orderNum: 1,
+			router: '/sass/goods/list',
+			viewPath: 'sass/goods/list',
+			keepAlive: 1
+		},
+		// 节日管理
+		{
+			id: '6',
+			parentId: null,
+			name: '节日列表',
+			type: 1,
+			icon: 'icongongzuotai',
+			orderNum: 1,
+			router: '/sass/fest/list',
+			viewPath: 'sass/fest/list',
+			keepAlive: 1
+		},
+		// 套餐管理
+		{
+			id: '7',
+			parentId: null,
+			name: '套餐管理',
+			type: 0,
+			icon: 'icongongzuotai',
+			orderNum: 1,
+			router: '/sass/manage/list',
+			viewPath: 'sass/manage/list',
+			keepAlive: 1
+		},
+		{
+			id: '701',
+			parentId: '7',
+			name: '套餐列表',
+			type: 1,
+			icon: 'icongongzuotai',
+			orderNum: 1,
+			router: '/sass/manage/package',
+			viewPath: 'sass/manage/package',
+			keepAlive: 1
+		},
+		{
+			id: '701',
+			parentId: '7',
+			name: '权限管理',
+			type: 1,
+			icon: 'icongongzuotai',
+			orderNum: 1,
+			router: '/sass/manage/auth',
+			viewPath: 'sass/manage/auth',
+			keepAlive: 1
+		}
+	]
+};