liujd 6 سال پیش
والد
کامیت
0d93794f3f

+ 4 - 1
mobile-code/src/api/common/index.js

@@ -4,5 +4,8 @@ export const uploadPic = data => https.post('/upload/save-img', data)
 
 export const getOptions = param => https.get('/apihkds/api/option/getOptions', param)
 
-// 户信息
+// 户信息
 export const getUserApi = param => https.get('/merchant/detail', param)
+
+// 员工信息
+export const getSelfApi = param => https.get('/admin/login-detail', param)

+ 15 - 0
mobile-code/src/api/level/index.js

@@ -0,0 +1,15 @@
+import https from '@/plugins/luch-request_0.0.7/request'
+
+/** *
+ * 会员等级 b
+ */
+export const getList = data => {
+	return https.post('/merchant/member-level', data)
+}
+
+/** *
+ * 会员等级更新 b
+ */
+export const updateLevel = data => {
+	return https.post('/merchant/member-level-update', data)
+}

+ 2 - 2
mobile-code/src/api/login/index.js

@@ -4,12 +4,12 @@ import https from '@/plugins/luch-request_0.0.7/request'
  * 员工修改密码 b
  */
 export const updatePassword = data => {
-	return https.get('/admin/password', data)
+	return https.post('/admin/password', data)
 }
 
 /** *
  * 员工修改确认密码 b
  */
 export const updateConfirmPassword = data => {
-	return https.get('/admin/confirm-password', data)
+	return https.post('/admin/confirm-password', data)
 }

+ 1 - 2
mobile-code/src/pages/ad/add.vue

@@ -189,7 +189,6 @@ export default {
 				goodsData: this.goodsData
 			}
 			uni.setStorageSync('addAdData', data)
-			// this.form
 			this.$util.pageTo({
 				url: '/pages/ad/sel-goods',
 				query: {
@@ -205,7 +204,7 @@ export default {
 			this.form.endTime = e.detail.value
 		},
 		switchChangeFn(e) {
-			this.switch = e.target.value ? 1 : 0
+			this.form.status = e.target.value ? 1 : 0
 		},
 		radioChange(e) {
 			this.form.style = e.detail.value

+ 0 - 1
mobile-code/src/pages/ad/list.vue

@@ -44,7 +44,6 @@
 			})">添加</div>
 		</div>
 		<!-- 删除提示 -->
-		<!-- 充值弹窗 -->
 		<modal-module :show="delModal" @cancel="modalCancel" @click="delModalClick" content="确定删除该广告吗?" color="#333" :size="32" padding="30rpx 30rpx"></modal-module>
 	</div>
 </template>

+ 1 - 1
mobile-code/src/pages/common/redirect.vue

@@ -10,7 +10,7 @@ export default {
 		}
 	},
 	computed: {
-		...mapGetters({ userInfo: 'getBasicUser' })
+		...mapGetters({ userInfo: 'getSelfInfo' })
 	},
 	onLoad(options) {
 		uni.showLoading({

+ 2 - 2
mobile-code/src/pages/common/webview.vue

@@ -4,7 +4,7 @@
 
 <script>
 import { mapGetters } from 'vuex'
-import { getBasicUser } from '@/utils/auth'
+import { getSelfInfo } from '@/utils/auth'
 
 export default {
 	data() {
@@ -14,7 +14,7 @@ export default {
 		}
 	},
 	computed: {
-		...mapGetters({ userInfo: 'getBasicUser' })
+		...mapGetters({ userInfo: 'getSelfInfo' })
 	},
 	onLoad(option) {
 	},

+ 115 - 30
mobile-code/src/pages/setting/level.vue

@@ -8,55 +8,135 @@
 				<div :class="[isModify ? 'list-tit-inp' : '']">折扣</div>
 				<div v-if="isModify">操作</div>
 			</div>
-			<div class="list" v-for="(item, index) in list" :key="index">
-				<div class="list-vip">
-					<app-vip-module class="level-img" :text="`VIP ${item.level}`" />
+			<block v-if="!$util.isEmpty(list)">
+				<div class="list" v-for="(item, index) in list" :key="index">
+					<div class="list-vip">
+						<app-vip-module class="level-img" :text="`VIP${index + 1}`" />
+					</div>
+					<div class="list-growth">
+						<input v-if="isModify" type="text" class="setting-inp" v-model="item.growth" />
+						<span v-else class="setting-span">{{ item.growth }}</span>
+					</div>
+					<div class="list-discount">
+						<input v-if="isModify" type="text" class="setting-inp" v-model="item.discount" />
+						<span v-else class="setting-span">{{ item.discount }}</span>
+					</div>
+					<div class="list-option" v-if="isModify" @click="delFn(index)">
+						<i class="iconfont iconshanchu1"></i>
+					</div>
 				</div>
-				<div class="list-growth">
-					<input v-if="isModify" type="text" class="setting-inp" v-model="item.growth" />
-					<span v-else class="setting-span">{{ item.growth }}</span>
-				</div>
-				<div class="list-discount">
-					<input v-if="isModify" type="text" class="setting-inp" v-model="item.discount" />
-					<span v-else class="setting-span">{{ item.discount }}</span>
-				</div>
-				<div class="list-option" v-if="isModify">
-					<i class="iconfont iconshanchu1"></i>
-				</div>
-			</div>
+			</block>
+			<block v-else>
+				<app-wrapper-empty title="暂无数据" :is-empty="$util.isEmpty(list)" />
+			</block>
 		</div>
 		<!-- 提示 -->
 		<div v-if="isModify" class="prompt-text">提示:点此上方的数字即可直接进行修改。提交后不能再修改, 请 谨慎操作。</div>
 		<!-- 按钮 -->
 		<div v-if="isModify" class="btn-wrap">
-			<div class="admin-button-com big">添加</div>
-			<div class="admin-button-com blue big">提交</div>
+			<div class="admin-button-com big" @click="addFn">添加</div>
+			<div class="admin-button-com blue big" @click="showPromptFn">提交</div>
 		</div>
+		<!-- 删除提示 -->
+		<modal-module :show="showPrompt" @cancel="modalCancel" @click="promptModalClick" title="确认无误提交?" content="提交后将不能再次修改" color="#333" :size="32" padding="30rpx 30rpx"></modal-module>
 	</div>
 </template>
 
 <script>
+import { mapGetters } from 'vuex'
 import appVipModule from '@/components/module/app-vip'
+import AppWrapperEmpty from '@/components/app-wrapper-empty'
+import ModalModule from '@/components/plugin/modal'
+// api
+import { getList, updateLevel } from '@/api/level'
 export default {
 	name: 'level-setting',
 	components: {
-		appVipModule
+		appVipModule,
+		AppWrapperEmpty,
+		ModalModule
 	},
 	data() {
 		return {
-			isModify: true,
-			list: [
-				{
-					level: 3,
-					growth: 22,
-					discount: 350
-				},
-				{
-					level: 2,
-					growth: 55,
-					discount: 351
+			isModify: false,
+			list: [],
+			addList: {
+				level: 0,
+				growth: 0,
+				discount: 0
+			},
+			showPrompt: false
+		}
+	},
+	onLoad() {
+		this.init()
+	},
+	methods: {
+		init() {
+			this._getList()
+		},
+		_getList() {
+			return getList().then(res => {
+				let data = res.data
+				if (!data) return false
+				this.isModify = res.data.gradeSwitch != 0
+				data = this.bubbleSort(data.list)
+				this.list = data
+			})
+		},
+		delFn(index) {
+			this.list.splice(index, 1)
+			this.$msg('删除成功!')
+		},
+		addFn() {
+			let addList = JSON.parse(JSON.stringify(this.addList))
+			addList.level = this.list.length + 1
+			this.list.push(addList)
+		},
+		confirmFn() {
+			for (let i in this.list) {
+				this.list[i].level = parseInt(i) + 1
+			}
+			let arr = []
+			for (let i in this.list) {
+				let { level, growth, discount } = this.list[i]
+				arr.push([level, growth, discount])
+			}
+			updateLevel({ list: arr }).then(res => {
+				this.isModify = false
+				this.$msg('设置成功!')
+				this.showPrompt = false
+			})
+		},
+		showPromptFn() {
+			this.showPrompt = true
+		},
+		promptModalClick(e) {
+			let index = e.index
+			if (index === 0) {
+				this.showPrompt = false
+			} else {
+				this.confirmFn()
+			}
+		},
+		// 冒泡排序
+		bubbleSort(array) {
+			if (Object.prototype.toString.call(array).slice(8, -1) === 'Array') {
+				var len = array.length,
+					temp
+				for (var i = 0; i < len - 1; i++) {
+					for (var j = len - 1; j >= i; j--) {
+						if (array[j - 1] && array[j].level < array[j - 1].level) {
+							temp = array[j]
+							array[j] = array[j - 1]
+							array[j - 1] = temp
+						}
+					}
 				}
-			]
+				return array
+			} else {
+				return 'array is not an Array!'
+			}
 		}
 	}
 }
@@ -80,6 +160,11 @@ export default {
 			height: 100px;
 			padding: 0 30px;
 			border-bottom: 2px solid $borderColor;
+			.level-img {
+				/deep/.vip-text {
+					left: 42px;
+				}
+			}
 			.setting-inp {
 				width: 230px;
 				height: 70px;

+ 92 - 22
mobile-code/src/pages/setting/password.vue

@@ -2,32 +2,38 @@
 	<div class="app-content">
 		<!-- tabs -->
 		<div class="tabs-wrap">
-			<button class="admin-button-com blue">账户设置</button>
-			<button class="admin-button-com">确认密码设置</button>
+			<button class="admin-button-com" :class="[tabIndex == 1? 'blue' : '']" @click="changeTab(1)">密码设置</button>
+			<button class="admin-button-com" :class="[tabIndex == 2? 'blue' : '']" @click="changeTab(2)">确认密码设置</button>
 		</div>
 		<!-- 输入框 - block -->
-		<div class="input-line-wrap">
-			<tui-list-cell class="line-cell" :hover="false">
-				<div class="tui-title">旧密码</div>
-				<input placeholder-class="phcolor" class="tui-input" name="name" placeholder="首次设置不需要填写" maxlength="50" type="number" />
-			</tui-list-cell>
-			<tui-list-cell class="line-cell" :hover="false">
-				<div class="tui-title">密码</div>
-				<input placeholder-class="phcolor" class="tui-input" name="phone" placeholder="防止别人登录,密码设复杂点" maxlength="50" type="number" />
-			</tui-list-cell>
-			<tui-list-cell class="line-cell" :hover="false">
-				<div class="tui-title">确认密码</div>
-				<input placeholder-class="phcolor" class="tui-input" name="phone" placeholder="请输入确认密码" maxlength="50" type="number" />
-			</tui-list-cell>
-			<div class="btn-wrap">
-				<button class="admin-button-com blue big">提交</button>
+		<form @submit="formSubmit">
+			<div class="input-line-wrap">
+				<tui-list-cell class="line-cell" :hover="false" v-if="isOldPass">
+					<div class="tui-title">旧密码</div>
+					<input placeholder-class="phcolor" v-model="form.old" class="tui-input" name="old" placeholder="首次设置不需要填写" maxlength="50" type="password" />
+				</tui-list-cell>
+				<tui-list-cell class="line-cell" :hover="false">
+					<div class="tui-title">密码</div>
+					<input placeholder-class="phcolor" v-model="form.new" class="tui-input" name="new" placeholder="防止别人登录,密码设复杂点" maxlength="50" type="password" />
+				</tui-list-cell>
+				<tui-list-cell class="line-cell" :hover="false">
+					<div class="tui-title">确认密码</div>
+					<input placeholder-class="phcolor" v-model="form.confirm" class="tui-input" name="confirm" placeholder="请输入确认密码" maxlength="50" type="password" />
+				</tui-list-cell>
+				<div class="btn-wrap">
+					<button class="admin-button-com blue big" formType="submit">提交</button>
+				</div>
 			</div>
-		</div>
+		</form>
 	</div>
 </template>
 
 <script>
+import { mapGetters } from 'vuex'
 import TuiListCell from '@/components/plugin/list-cell'
+const form = require('@/utils/formValidation.js')
+// api
+import { updatePassword, updateConfirmPassword } from '@/api/login'
 export default {
 	name: 'password-setting',
 	components: {
@@ -35,16 +41,80 @@ export default {
 	},
 	data() {
 		return {
-			tabIndex: 0,
-			tabs: [
+			tabIndex: 1,
+			form: {
+				old: '',
+				new: '',
+				confirm: ''
+			},
+			old: [{
+				name: 'old',
+				rule: ['required'],
+				msg: ['请输入旧密码']
+			}],
+			rules: [
 				{
-					name: '账户设置'
+					name: 'new',
+					rule: ['required'],
+					msg: ['请输入新密码']
 				},
 				{
-					name: '确认密码设置'
+					name: 'confirm',
+					rule: ['required'],
+					msg: ['请输入确认密码']
 				}
 			]
 		}
+	},
+	computed: {
+		...mapGetters({ selfInfo: 'getSelfInfo' }),
+		isOldPass() {
+			let status = this.tabIndex == 1 ? this.selfInfo.password : this.selfInfo.confirmPassword
+			return !!status
+		}
+	},
+	onLoad() {
+		// getSelfInfo().then(res => {
+		// 	console.log(res)
+		// 	// if (res.) {}
+		// })
+	},
+	methods: {
+		changeTab(index) {
+			this.tabIndex = index
+			this.form = {
+				old: '',
+				new: '',
+				confirm: ''
+			}
+		},
+		confirmFn() {
+			if (!this.isOldPass) {
+				delete this.form[old]
+			}
+			let hostFn = this.tabIndex == 1 ? updatePassword : updateConfirmPassword
+			hostFn(this.form).then(res => {
+				this.$msg('修改成功!')
+				this.$util.pageTo({
+					url: '/pages/admin/workbench',
+					type: 4
+				})
+			})
+		},
+		// 表单验证
+		formSubmit(e) {
+			// 表单规则
+			let rules = this.isOldPass ? [...this.old, ...this.rules] : this.rules
+			// 进行表单检查
+			let formData = e.detail.value
+			let checkRes = form.validation(formData, rules)
+			// 验证通过!
+			if (!checkRes) {
+				this.confirmFn()
+			} else {
+				this.$msg(checkRes)
+			}
+		}
 	}
 }
 </script>

+ 59 - 22
mobile-code/src/pages/staff/add.vue

@@ -15,16 +15,16 @@
 						<div class="tui-placeholder" v-else>请选择</div>
 					</picker>
 				</tui-list-cell>
-				<tui-list-cell class="line-cell" :arrow="true" @click="$util.pageTo('/pages/staff/sel-member')">
+				<tui-list-cell class="line-cell" :arrow="true" @click="selMemberFn">
 					<div class="tui-title required">关联微信</div>
 					<div v-if="form.userId" class="member-wrap flex-center">
 						<input v-model="form.userId" name="userId" type="text" hidden />
 						<div class="member-img">
-							<app-avatar-module :width="60" />
+							<app-avatar-module :src="memberData.avatarUrl" :width="60" />
 						</div>
 						<div class="member-det">
-							<div class="app-size-28">冯宝宝</div>
-							<div>153928272822</div>
+							<div class="app-size-28">{{ memberData.realName }}</div>
+							<div>{{ memberData.mobile }}</div>
 						</div>
 					</div>
 					<div class="tui-placeholder" v-else>请选择</div>
@@ -36,7 +36,7 @@
 				<tui-list-cell class="line-cell between" padding="14rpx 30rpx" :hover="false">
 					<div class="tui-title">收款通知</div>
 					<div>
-						<switch :checked="form.remind ? true : false" @change="switchChangeFn" />
+						<switch :checked="form.remind == 0 ? false : true" @change="remindChangeFn" />
 					</div>
 				</tui-list-cell>
 			</div>
@@ -58,7 +58,7 @@
 				<tui-list-cell class="line-cell between" padding="14rpx 30rpx" :hover="false">
 					<div class="tui-title">马上启用</div>
 					<div>
-						<switch :checked="form.status ? true : false" @change="switchChangeFn" />
+						<switch :checked="form.status == 0 ? false : true" @change="statusChangeFn" />
 					</div>
 				</tui-list-cell>
 			</div>
@@ -76,6 +76,7 @@ import AppAvatarModule from '@/components/module/app-avatar'
 const form = require('@/utils/formValidation.js')
 // api
 import { getRoleList, getStaffDet as getDet, addStaff as add, updateStaff as update } from '@/api/staff'
+import { getDet as getMemberDet } from '@/api/member'
 export default {
 	name: 'staff-add',
 	components: {
@@ -89,7 +90,7 @@ export default {
 				roleId: '',
 				remind: 0,
 				password: '',
-				userId: '1',
+				userId: '',
 				status: 0,
 				remark: ''
 			},
@@ -103,30 +104,31 @@ export default {
 	},
 	methods: {
 		init() {
-		// 	this.type = this.option.type
-
 			let data = uni.getStorageSync('addStaffData')
 			if (data) {
 				uni.removeStorageSync('addStaffData')
 				this.form = data.form
-				this.imgList = data.imgList
-				this.goodsData = data.goodsData
+				this.roleList = data.roleList
+				this.roleSelData = data.roleSelData
 			}
-			let memberData = uni.getStorageSync('memberSelGoods')
+			let memberData = uni.getStorageSync('addSelMember')
 			if (memberData) {
-				uni.removeStorageSync('memberSelGoods')
+				uni.removeStorageSync('addSelMember')
 				this.memberData = memberData
-				this.userId = memberData.id
+				this.form.userId = memberData.id
 			}
 
-			if (this.option.id && !data) {
-				this._getDet()
-			}
-			this._getRoleList()
+			if (data) return false
+
+			this._getRoleList().then(res => {
+				if (this.option.id) {
+					this._getDet()
+				}
+			})
 		},
 		// api
-		_getRoleList() {
-			getRoleList().then(res => {
+		async _getRoleList() {
+			await getRoleList().then(res => {
 				if (this.$util.isEmpty(res.data)) return false
 				this.roleList = res.data.list
 			})
@@ -135,16 +137,50 @@ export default {
 			getDet({ id: this.option.id }).then(res => {
 				if (this.$util.isEmpty(res.data)) return
 				Object.keys(this.form).forEach((i, index) => {
-					this.form[i] = res.data[i]
+					if (i != 'password') {
+						this.form[i] = res.data[i]
+					}
 				})
+				this.roleSelData = this.roleList.filter(e => this.form.roleId == e.id)[0]
+
+				if (this.form.userId) {
+					this._getMemberDet()
+				}
+			})
+		},
+		// 获取客户详情
+		_getMemberDet() {
+			getMemberDet({ userId: this.form.userId }).then(res => {
+				if (this.$util.isEmpty(res.data)) return
+				this.memberData = res.data
 			})
 		},
 		// option
+		// 关联微信
+		selMemberFn() {
+			let data = {
+				form: this.form,
+				roleList: this.roleList,
+				roleSelData: this.roleSelData
+			}
+			uni.setStorageSync('addStaffData', data)
+			this.$util.pageTo({
+				url: '/pages/staff/sel-member',
+				query: {
+					...this.option
+				}
+			})
+		},
 		changeRoleFn(e) {
 			this.roleSelData = this.roleList[e.detail.value]
 			this.form.roleId = this.roleSelData.id
 		},
-		switchChangeFn() {},
+		remindChangeFn(e) {
+			this.form.remind = e.detail.value ? 1 : 0
+		},
+		statusChangeFn(e) {
+			this.form.status = e.detail.value ? 1 : 0
+		},
 		confirmFn() {
 			let hostFn = this.option.id ? update : add
 			if (this.option.id) {
@@ -153,6 +189,7 @@ export default {
 			hostFn(this.form).then(res => {
 				let promptText = this.option.id ? '修改成功!' : '添加成功!'
 				this.$msg(promptText)
+				this.$util.pageTo('/pages/staff/list')
 			})
 		},
 		// 表单验证

+ 1 - 1
mobile-code/src/pages/staff/sel-member.vue

@@ -60,7 +60,7 @@ export default {
 		},
 		// 选择员工
 		changeFn(e) {
-			uni.setStorageSync('addStaffData', e)
+			uni.setStorageSync('addSelMember', e)
 			this.$util.pageTo({
 				url: '/pages/staff/add',
 				query: {

+ 0 - 2
mobile-code/src/plugins/luch-request_0.0.7/request.js

@@ -157,10 +157,8 @@ class Request {
 							// 	})
 							// }, 2000)
 						} else {
-							console.log(config.hideError, 'asdfadsf')
 							if (!config.hideError) {
 								// this.$msg(response.data.msg)
-								console.log(response.data.msg, 'asdfadsf')
 								uni.showToast({
 									title: response.data.msg,
 									icon: 'none',

+ 1 - 1
mobile-code/src/store/modules/index.js

@@ -1,5 +1,5 @@
 import login from './login'
-import user from './basicUser'
+import user from './selfInfo'
 import authorization from './authorization'
 export default {
 	login,

+ 14 - 8
mobile-code/src/store/modules/basicUser.js → mobile-code/src/store/modules/selfInfo.js

@@ -1,16 +1,22 @@
 import { getState, setState } from '@/store/modules/vuexStorange'
+import { getSelfInfo } from '@/utils/auth'
 
 /** 基本用户信息 */
 const state = {
-	basicUser: null,
+	selfInfo: null,
 	user: null
 }
 
 const getters = {
 	// 基本用户信息
-	getBasicUser: (state) => {
-	 getState(state, 'basicUser', 'basicUser')
-		return state.basicUser
+	getSelfInfo: (state) => {
+		getState(state, 'selfInfo', 'selfInfo')
+		if (state.selfInfo) return state.selfInfo
+		let data = {}
+		getSelfInfo().then(res => {
+			data = res
+		})
+		return data
 	},
 	// 用户信息
 	getUser: (state) => {
@@ -21,7 +27,7 @@ const getters = {
 
 const actions = {
 	// 基本用户信息
-	setBasicUser({
+	setSelfInfo({
 		commit,
 		dispatch,
 		getters,
@@ -31,7 +37,7 @@ const actions = {
 	}, userInfo) {
 		commit('SET_BASIC_USER', userInfo)
 	},
-	delBasicUser({
+	delSelfInfo({
 		commit,
 		dispatch,
 		getters,
@@ -67,10 +73,10 @@ const actions = {
 const mutations = {
 	// 基本用户信息
 	SET_BASIC_USER(state, userInfo = {}) {
-		setState(state, userInfo, 'basicUser', 'basicUser')
+		setState(state, userInfo, 'selfInfo', 'selfInfo')
 	},
 	DEL_BASIC_USER(state) {
-		state.basicUser = ''
+		state.selfInfo = ''
 	},
 	// 后台管理用户信息
 	SET_USER(state, userInfo = {}) {

+ 22 - 31
mobile-code/src/utils/auth.js

@@ -7,41 +7,33 @@ import CONSTANT from '@/constant'
 import UTIL from '@/utils/util'
 
 import {
+	getSelfApi,
 	getUserApi
 	// checkLogin,
 	// getRoleRealApi
 } from '@/api/common'
 // import { postWxCode } from '@/api/login'
 
-// import util from './util'
+import util from './util'
 
-// /**
-//  * 获取用户基本信息
-//  * @parmas id为用户id
-//  * @parmas update为true时会重新触发请求,重置vuex的数据
-//  */
-// export async function getBasicUser(id, update) {
-// 	console.log('auth', id)
-// 	if (!id) {
-// 		return false
-// 	}
-// 	const params = {
-// 		owner_user_id: id
-// 	}
-
-// 	let userInfo = store.getters.getBasicUser
-// 	if (!util.isEmpty(userInfo) && !update) {
-// 		return userInfo
-// 	}
-// 	await getBasicUserApi(params).then(res => {
-// 		userInfo = res.data
-// 		store.dispatch('setBasicUser', userInfo)
-// 	}).catch(() => {
-// 		return false
-// 	})
+/**
+ * 获取登录员工的基本信息
+ * @parmas update为true时会重新触发请求,重置vuex的数据
+ */
+export async function getSelfInfo(update) {
+	let userInfo = store.getters.getSelfUser
+	if (!util.isEmpty(userInfo) && !update) {
+		return userInfo
+	}
+	await getSelfApi().then(res => {
+		userInfo = res.data
+		store.dispatch('setSelfInfo', userInfo)
+	}).catch(() => {
+		return false
+	})
 
-// 	return userInfo
-// }
+	return userInfo
+}
 
 /**
  * 获取后台用户信息
@@ -52,7 +44,6 @@ export async function getUser(update) {
 	if (!UTIL.isEmpty(userInfo) && !update) {
 	  return userInfo
 	}
-	console.log(getUserApi)
 	await getUserApi().then((res) => {
 		userInfo = res.data
 		store.dispatch('setUser', userInfo)
@@ -63,11 +54,11 @@ export async function getUser(update) {
 	return userInfo
 }
 // /**
-//  * 清除vuex的用户信息,目前包含(basicUser, user)
+//  * 清除vuex的用户信息,目前包含(selfInfo, user)
 //  * @parmas 暂无,可扩展
 //  */
 // export async function resetAllUser() {
-// 	await store.dispatch('delBasicUser')
+// 	await store.dispatch('delSelfInfo')
 // 	await store.dispatch('delUser')
 // 	return true
 // }
@@ -177,7 +168,7 @@ export async function getCheckLogin() {
 }
 
 // export default {
-// 	getBasicUser,
+// 	getSelfInfo,
 // 	getUser,
 // 	resetAllUser,
 // 	getRoleReal

+ 0 - 25
mobile-code/src/utils/common.js

@@ -29,31 +29,6 @@ export function getUrlHref() {
  * @parmas urlEndStr 跳转的页面url需要补充的参数 例'&aaa=111'
  */
 export function jumpShop(jumpUrl, attrUrl, titleName, urlEndStr) {
-	const basicUserInfo = store.state.user.basicUser
-	const adminUserInfo = store.state.user.user
-	const userInfo = basicUserInfo || adminUserInfo
-	let name = titleName || userInfo.nick_name + '的家居商城'
-	// let name = titleName || document.title + '的家居商城'
-	name = encodeURI(name)
-	attrUrl = attrUrl ? encodeURI(attrUrl) : ''
-
-	// let hostUrl = 'http://192.168.0.124:8081'
-	// let hostUrl = 'https://www.meijiabang.com'
-	const hostUrl = CONSTANT.formal
-
-	const idStr = `?owner_user_id=${userInfo.user_id}&parent_id=${userInfo.user_id}${urlEndStr || ''}`
-
-	const url = `${hostUrl}/mobile/#${jumpUrl}${idStr}&hkds_name=${name}&hkds_attr=${attrUrl}`
-
-	// 获取小程序地址完整路径
-	let getRoute = getMiniAppUrl()
-	const allUrl = url + '&returnUrl=' + getRoute
-	// location.href = allUrl
-
-	// console.log(`/pages/page/webview/index?returnUrl=${encodeURIComponent(allUrl)}`)
-	uni.navigateTo({
-		url: `/pages/page/webview/index?returnUrl=${encodeURIComponent(allUrl)}`
-	})
 }
 
 // 获取小程序地址完整路径