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

+ 88 - 0
admin-code/src/config/change.bat

@@ -0,0 +1,88 @@
+@echo off
+echo start......
+echo,
+set isMobile=business
+set sass=s-
+set business=b-
+set env=env.js
+set pages=pages.json
+set config=config.js
+set uni=uni.scss
+set /a sum=0
+
+for %%m in (*) do (
+	if "%%m"=="s-config.js" (
+		set isMobile=sass
+	)
+)
+
+echo %isMobile%
+
+if "%isMobile%"=="sass" (
+	echo %isMobile%
+	for %%z in (*) do (
+		echo %%z
+		if "%%z"=="config.js" (
+			ren %%z %business%%%z
+			set /a sum+=1
+		)
+		if "%%z"=="env.js" (
+			ren %%z %business%%%z
+			set /a sum+=1
+		)
+	)
+	echo,
+	for %%z in (*) do (
+		echo %%z
+		if "%%z"=="s-config.js" (
+			ren %%z %config%
+			set /a sum+=1
+		)
+		if "%%z"=="s-env.js" (
+			ren %%z %env%
+			set /a sum+=1
+		)
+	)
+) else (
+	echo %isMobile%
+	for %%z in (*) do (
+		echo %%z
+		if "%%z"=="config.js" (
+			ren %%z %sass%%%z
+			set /a sum+=1
+		)
+		if "%%z"=="env.js" (
+			ren %%z %sass%%%z
+			set /a sum+=1
+		)
+	)
+	echo,
+	for %%z in (*) do (
+		echo %%z
+		if "%%z"=="b-config.js" (
+			ren %%z %config%
+			set /a sum+=1
+		)
+		if "%%z"=="b-env.js" (
+			ren %%z %env%
+			set /a sum+=1
+		)
+	)
+)
+echo,
+echo file change success to *********    %isMobile%
+echo,
+echo ******************  ljd  ********************
+echo,
+echo end ******  %sum%  ****** file is change confirm
+echo,
+echo ******************  jmq  ********************
+echo,
+set isMobile=
+set mobile=
+set business=
+set manifest=
+set pages=
+set config=
+set sum=
+PAUSE

+ 5 - 0
admin-code/src/config/config.js

@@ -0,0 +1,5 @@
+import Vue from 'vue';
+// 项目配置--由bat脚本变更
+export const ProjectName = 'business';
+
+Vue.prototype.$projectName = ProjectName;

+ 5 - 0
admin-code/src/config/s-config.js

@@ -0,0 +1,5 @@
+import Vue from 'vue';
+// 项目配置--由bat脚本变更
+export const ProjectName = 'sass';
+
+Vue.prototype.$projectName = ProjectName;

+ 34 - 0
admin-code/src/config/s-env.js

@@ -0,0 +1,34 @@
+import { getUrlParam } from '@/utils/index';
+import store from 'store';
+
+const env = process.env;
+
+// 路由模式
+const routerMode = 'hash';
+
+// 请求地址
+const baseUrl = (() => {
+	let proxy = getUrlParam('proxy');
+	console.log('proxy', proxy);
+
+	if (proxy) {
+		store.set('proxy', proxy);
+	} else {
+		proxy = store.get('proxy') || 'dev';
+	}
+
+	switch (env.NODE_ENV) {
+		case 'development':
+			return `/${proxy}`;
+		case 'production':
+			// return `/api/admin`;
+			return `http://api.s.huaml.com`;
+		default:
+			return '';
+	}
+})();
+
+// 阿里字体图标库 https://at.alicdn.com/t/**.css
+const iconfontUrl = ``;
+
+export { env, routerMode, baseUrl, iconfontUrl };

+ 1 - 0
admin-code/src/main.js

@@ -9,6 +9,7 @@ import '@/service/index';
 import '@/mock/index';
 import '@/mock/index';
 import '@/icons/index';
 import '@/icons/index';
 import '@/filter/index';
 import '@/filter/index';
+import '@/config/config';
 
 
 import crud from 'cl-crud';
 import crud from 'cl-crud';
 
 

+ 3 - 2
admin-code/src/pages/layout/index.vue

@@ -18,11 +18,12 @@
 				<!-- <process></process> -->
 				<!-- <process></process> -->
 
 
 				<div class="content-view">
 				<div class="content-view">
-					<keep-alive>
+					<!-- <keep-alive>
 						<router-view v-if="$route.meta.keepAlive"></router-view>
 						<router-view v-if="$route.meta.keepAlive"></router-view>
 					</keep-alive>
 					</keep-alive>
 
 
-					<router-view v-if="!$route.meta.keepAlive"></router-view>
+					<router-view v-if="!$route.meta.keepAlive"></router-view> -->
+					<router-view></router-view>
 				</div>
 				</div>
 			</div>
 			</div>
 			<!-- </div> -->
 			<!-- </div> -->

+ 9 - 3
admin-code/src/pages/layout/topbar/index.vue

@@ -1,7 +1,7 @@
 <template>
 <template>
 	<div class="scope-topbar">
 	<div class="scope-topbar">
 		<div class="collapse">
 		<div class="collapse">
-			<img class="avatar" :src="userInfo.headImg | default_avatar" alt="" />
+			<img class="avatar" :src="logoUrl | default_avatar" alt="" />
 			<div>后台业务管理系统</div>
 			<div>后台业务管理系统</div>
 			<!-- <icon-svg name="icon-menu"></icon-svg> -->
 			<!-- <icon-svg name="icon-menu"></icon-svg> -->
 		</div>
 		</div>
@@ -23,7 +23,7 @@
 			<el-dropdown trigger="click" :hide-on-click="false" @command="onCommand">
 			<el-dropdown trigger="click" :hide-on-click="false" @command="onCommand">
 				<span class="el-dropdown-link">
 				<span class="el-dropdown-link">
 					<span class="name">{{ userInfo.nickName | default_name }}</span>
 					<span class="name">{{ userInfo.nickName | default_name }}</span>
-					<img class="avatar" :src="userInfo.headImg | default_avatar" alt="" />
+					<img class="avatar" :src="userInfo.avatarUrl | default_avatar" alt="头像" />
 					<i class="el-icon-caret-bottom"></i>
 					<i class="el-icon-caret-bottom"></i>
 				</span>
 				</span>
 
 
@@ -62,7 +62,13 @@ export default {
 	},
 	},
 
 
 	computed: {
 	computed: {
-		...mapGetters(['menuGroup', 'userInfo'])
+		...mapGetters(['menuGroup', 'userInfo', 'shopInfo']),
+		logoUrl() {
+			if (!this.$util.isEmpty(this.shopInfo)) {
+				return this.shopInfo.smallLogoUrl;
+			}
+			return '';
+		}
 	},
 	},
 
 
 	methods: {
 	methods: {

+ 9 - 7
admin-code/src/pages/login/index.js

@@ -54,14 +54,16 @@ export default {
 				// 登录
 				// 登录
 				await this.$store.dispatch('userLogin', this.form);
 				await this.$store.dispatch('userLogin', this.form);
 
 
-				// 后台信息
-				// await this.$store.dispatch('adminInfo');
+				if (this.$projectName == 'business') {
+					// 用户信息
+					await this.$store.dispatch('userInfo');
 
 
-				// 用户信息
-				await this.$store.dispatch('userInfo');
-
-				// 商户信息
-				await this.$store.dispatch('shopInfo');
+					// 商户信息
+					await this.$store.dispatch('shopInfo');
+				} else {
+					// 后台信息
+					await this.$store.dispatch('adminInfo');
+				}
 
 
 				// 权限菜单
 				// 权限菜单
 				const [first] = await this.$store.dispatch('permMenu');
 				const [first] = await this.$store.dispatch('permMenu');

+ 31 - 1
admin-code/src/service/common/index.js

@@ -14,6 +14,24 @@ export class CommonService extends BaseService {
 		};
 		};
 	}
 	}
 
 
+	/**
+	 * sass平台登录
+	 *
+	 * @param {*} { username, password, captchaId, verifyCode }
+	 * @returns
+	 * @memberof CommonService
+	 */
+	sassLogin({ mobile, password }) {
+		return this.request({
+			url: '/staff/login',
+			method: 'GET',
+			params: {
+				mobile,
+				password
+			}
+		});
+	}
+
 	/**
 	/**
 	 * 用户登录
 	 * 用户登录
 	 *
 	 *
@@ -43,7 +61,19 @@ export class CommonService extends BaseService {
 	}
 	}
 
 
 	/**
 	/**
-	 * 员工登录信息
+	 * sass登录信息
+	 *
+	 * @returns
+	 * @memberof CommonService
+	 */
+	sassInfo() {
+		return this.request({
+			url: '/staff/login-detail'
+		});
+	}
+
+	/**
+	 * 商户信息
 	 *
 	 *
 	 * @returns
 	 * @returns
 	 * @memberof CommonService
 	 * @memberof CommonService

+ 1 - 0
admin-code/src/store/getters.js

@@ -6,6 +6,7 @@ const getters = {
 	// menuCollapse: state => state.menu.collapse,
 	// menuCollapse: state => state.menu.collapse,
 	token: state => state.user.token,
 	token: state => state.user.token,
 	userInfo: state => state.user.info,
 	userInfo: state => state.user.info,
+	shopInfo: state => state.user.shopInfo,
 	permission: state => state.menu.permission,
 	permission: state => state.menu.permission,
 	// config
 	// config
 	level: state => state.config.level,
 	level: state => state.config.level,

+ 27 - 5
admin-code/src/store/modules/user.js

@@ -1,6 +1,7 @@
 import store from '@/utils/store';
 import store from '@/utils/store';
 import service from '@/service/index';
 import service from '@/service/index';
 import dayjs from 'dayjs';
 import dayjs from 'dayjs';
+import { ProjectName } from '@/config/config';
 
 
 export default {
 export default {
 	state: {
 	state: {
@@ -10,7 +11,17 @@ export default {
 	},
 	},
 	actions: {
 	actions: {
 		userLogin({ commit }, form) {
 		userLogin({ commit }, form) {
-			return service.common.userLogin(form).then(res => {
+			let host = null;
+			if (ProjectName == 'business') {
+				host = () => {
+					return service.common.userLogin(form);
+				};
+			} else {
+				host = () => {
+					return service.common.sassLogin(form);
+				};
+			}
+			return host(form).then(res => {
 				commit('SET_TOKEN', res);
 				commit('SET_TOKEN', res);
 				return res;
 				return res;
 			});
 			});
@@ -19,6 +30,7 @@ export default {
 		userLogout({ commit }) {
 		userLogout({ commit }) {
 			// return service.common.userLogout().done(() => {
 			// return service.common.userLogout().done(() => {
 			commit('CLEAR_USER');
 			commit('CLEAR_USER');
+			commit('CLEAR_SHOPINFO');
 			commit('CLEAR_TOKEN');
 			commit('CLEAR_TOKEN');
 			commit('RESET_PROCESS');
 			commit('RESET_PROCESS');
 			commit('SET_MENU_GROUP', []);
 			commit('SET_MENU_GROUP', []);
@@ -35,7 +47,17 @@ export default {
 		},
 		},
 
 
 		userInfo({ commit }) {
 		userInfo({ commit }) {
-			return service.common.userInfo().then(res => {
+			let host = null;
+			if (ProjectName == 'business') {
+				host = () => {
+					return service.common.userInfo();
+				};
+			} else {
+				host = () => {
+					return service.common.sassInfo();
+				};
+			}
+			return host().then(res => {
 				commit('SET_USERINFO', res);
 				commit('SET_USERINFO', res);
 				return res;
 				return res;
 			});
 			});
@@ -47,7 +69,7 @@ export default {
 	},
 	},
 	mutations: {
 	mutations: {
 		SET_SHOPINFO(state, val) {
 		SET_SHOPINFO(state, val) {
-			state.info = val;
+			state.shopInfo = val;
 			store.set('shopInfo', val);
 			store.set('shopInfo', val);
 		},
 		},
 
 
@@ -61,8 +83,8 @@ export default {
 			store.set('token', token, expire && dayjs().add(expire, 'second'));
 			store.set('token', token, expire && dayjs().add(expire, 'second'));
 		},
 		},
 
 
-		CLEAR_SHOPUSER(state) {
-			state.info = {};
+		CLEAR_SHOPINFO(state) {
+			state.shopInfo = {};
 			store.remove('shopInfo');
 			store.remove('shopInfo');
 		},
 		},
 
 

+ 140 - 50
admin-code/src/views/my-invite/index.vue

@@ -1,64 +1,112 @@
 <template>
 <template>
 	<div class="app-list-content">
 	<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-name="{scope}">
-				<div class="flex-center">
+		<div class="app-content-top flex-center">
+			<div class="avatar-wrap flex-center">
+				<div class="avatar-wrap-left">
 					<cl-avatar
 					<cl-avatar
-						shape="square"
-						:size="40"
-						:src="scope.row.userAvatar | default_avatar"
+						shape="circle"
+						:size="60"
+						:src="shopInfo.smallLogoUrl | default_avatar"
 					></cl-avatar>
 					></cl-avatar>
-					<div class="app-margin-left-10">{{ scope.row.name }}</div>
 				</div>
 				</div>
-			</template>
+				<div class="avatar-wrap-right">
+					<div class="app-size-32 avatar-name">{{ shopInfo.merchantName }}</div>
+					<div class="app-size-24">三级代理</div>
+				</div>
+			</div>
+			<div class="assets-list-wrap flex-center">
+				<div class="list" v-for="(item, index) in userData" :key="index">
+					<div class="assets-list-value">{{ item.value }}</div>
+					<div>{{ item.name }}</div>
+				</div>
+			</div>
+		</div>
+		<div class="app-content-bottom">
+			<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-address="{scope}">
-				<span>{{
-					scope.row.province +
-						scope.row.city +
-						scope.row.dist +
-						scope.row.address +
-						scope.row.floor
-				}}</span>
-			</template>
+				<template #table-column-name="{scope}">
+					<div class="flex-center">
+						<cl-avatar
+							shape="square"
+							:size="40"
+							:src="scope.row.userAvatar | default_avatar"
+						></cl-avatar>
+						<div class="app-margin-left-10">{{ scope.row.name }}</div>
+					</div>
+				</template>
 
 
-			<template #table-column-addTime="{scope}">
-				<span>{{ scope.row.addTime | formatTime }}</span>
-			</template>
+				<template #table-column-address="{scope}">
+					<span>
+						{{
+							scope.row.province +
+								scope.row.city +
+								scope.row.dist +
+								scope.row.address +
+								scope.row.floor
+						}}
+					</span>
+				</template>
 
 
-			<template #table-column-status="{scope}">
-				<span v-if="scope.row.status == 4">
-					<i class="iconfont icondagou"></i>
-				</span>
-				<span v-else>{{ scope.row.status | constantfilter('PROXY_STATUS') }}</span>
-			</template>
-		</cl-crud>
+				<template #table-column-addTime="{scope}">
+					<span>{{ scope.row.addTime | formatTime }}</span>
+				</template>
+
+				<template #table-column-status="{scope}">
+					<span v-if="scope.row.status == 4">
+						<i class="iconfont icondagou"></i>
+					</span>
+					<span v-else>{{ scope.row.status | constantfilter('PROXY_STATUS') }}</span>
+				</template>
+			</cl-crud>
+		</div>
 	</div>
 	</div>
 </template>
 </template>
 
 
 <script>
 <script>
+import { mapMutations, mapGetters } from 'vuex';
 export default {
 export default {
 	name: 'list-ad',
 	name: 'list-ad',
 	components: {},
 	components: {},
 	data() {
 	data() {
 		return {
 		return {
 			app: null,
 			app: null,
+			// top =-=========
+			// 用户数据
+			userData: [
+				{
+					name: '账号余额(¥)',
+					value: 0,
+					btn: '提现'
+				},
+				{
+					name: '邀请花店',
+					value: 0
+				},
+				{
+					name: '付费花店',
+					value: 0
+				},
+				{
+					name: '累计收益(¥)',
+					value: 0
+				}
+			],
+			// bottom =-=========
 			tabIndex: '-1',
 			tabIndex: '-1',
 			tabsData: [
 			tabsData: [
 				{
 				{
@@ -89,8 +137,25 @@ export default {
 			]
 			]
 		};
 		};
 	},
 	},
+	computed: {
+		...mapGetters(['shopInfo', 'userInfo'])
+	},
+	mounted() {
+		console.log(this.shopInfo);
+		this._getDet();
+	},
 	methods: {
 	methods: {
 		// api
 		// api
+		_getDet() {
+			this.$service.single.assetDet().then(res => {
+				if (this.$util.isEmpty(res)) return false;
+				this.data = res;
+				this.userData[0].value = res.balance;
+				this.userData[1].value = res.inviteNum;
+				this.userData[2].value = res.payNum;
+				this.userData[3].value = res.income;
+			});
+		},
 		handleClick(tab, e) {
 		handleClick(tab, e) {
 			this.app.refresh({ type: this.tabIndex });
 			this.app.refresh({ type: this.tabIndex });
 		},
 		},
@@ -189,15 +254,40 @@ export default {
 </script>
 </script>
 
 
 <style lang="scss" scoped>
 <style lang="scss" scoped>
-// module
-.ad-modal-content {
-	.member-wrap {
-		line-height: 1.4;
+.app-list-content {
+	width: 100%;
+	height: 100%;
+	.app-content-top {
+		width: 100%;
+		height: 80px;
+		background-color: #fff;
+		padding: 10px;
 		margin-bottom: 10px;
 		margin-bottom: 10px;
-		.member-det {
-			font-size: 12px;
-			margin-left: 10px;
+		color: $fontColor2;
+		font-size: 14px;
+		.avatar-wrap {
+			margin-right: 40px;
+			.avatar-wrap-left {
+				margin-right: 10px;
+			}
+			.avatar-wrap-right {
+				.avatar-name {
+					margin-bottom: 4px;
+				}
+			}
+		}
+		.assets-list-wrap {
+			text-align: center;
+			.list {
+				margin-left: 40px;
+				.assets-list-value {
+					margin-bottom: 10px;
+				}
+			}
 		}
 		}
 	}
 	}
+	.app-content-bottom {
+		height: calc(100% - 110px);
+	}
 }
 }
 </style>
 </style>