liujd %!s(int64=6) %!d(string=hai) anos
pai
achega
8216bcd61d

+ 53 - 3
mobile-code/src/api/member/index.js

@@ -1,5 +1,34 @@
 import https from '@/plugins/luch-request_0.0.7/request'
 
+/** *
+ * 只要登陆客户的优惠情况 m
+ */
+export const userDiscount = data => {
+	return https.post('/user/discount', data)
+}
+
+/** *
+ * 只要登陆客户的资产情况 m
+ */
+export const userAsset = data => {
+	return https.post('/user/asset', data)
+}
+
+/** *
+ * 我的页面 m
+ */
+export const myProfile = data => {
+	return https.post('/user/my-profile', data)
+}
+
+/** *
+ * 修改密码 m
+ */
+export const modifyPassword = data => {
+	return https.post('/user/password', data)
+}
+// =====================  B 端 ========================
+
 /** *
  * 客户列表 b
  */
@@ -7,6 +36,20 @@ export const getList = data => {
 	return https.get('/user/list', data)
 }
 
+/** *
+ * 商家端客户详情,包括资产、订单和备注 b
+ */
+export const getUserDet = data => {
+	return https.get('/user/user-detail', data)
+}
+
+/** *
+ * 获取客户详情,包括资产 b
+ */
+export const getDet = data => {
+	return https.get('/user/detail', data)
+}
+
 /** *
  * 添加客户 b
  */
@@ -15,8 +58,15 @@ export const add = data => {
 }
 
 /** *
- * 修改员工 b
+ * 给客户充值 b
+ */
+export const recharge = data => {
+	return https.post('/user/recharge', data)
+}
+
+/** *
+ * 给客户升级 b
  */
-export const update = data => {
-	return https.post('/user/update', data)
+export const upgrade = data => {
+	return https.post('/user/upgrade', data)
 }

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

@@ -107,7 +107,7 @@ export default {
 		return {
 			form: {
 				adName: '',
-				adImg: '11',
+				adImg: '',
 				status: 0,
 				inTurn: '',
 				type: 0,
@@ -188,7 +188,6 @@ export default {
 				imgList: this.imgList,
 				goodsData: this.goodsData
 			}
-			console.log(data)
 			uni.setStorageSync('addAdData', data)
 			// this.form
 			this.$util.pageTo({

+ 11 - 11
mobile-code/src/pages/admin/components/sel-search.vue

@@ -1,7 +1,7 @@
 <template>
 	<div class="sel-search-module">
 		<div class="input-wrap">
-			<app-search-module placeholder="请输入商品名称" :isBtn="true"  @search="searchFn" />
+			<app-search-module placeholder="请输入名称" :isBtn="true"  @search="searchFn" />
 		</div>
         <!-- 列表 -->
 		<div class="list-wrap">
@@ -25,16 +25,16 @@
                         <!-- 图片块 -->
                         <slot name="img" :item="item">
                             <div class="list-img">
-				                <app-avatar-module :width="120" />
+				                <app-avatar-module :src="item.avatarUrl" :width="120" />
                             </div>
                         </slot>
                         <!-- 列表详情块 -->
                         <slot name="detail" :item="item">
                             <div class="list-right">
-                                <div class="list-name">冯宝宝</div>
-                                <div>手机号: 153928272626</div>
-                                <div>会员等级: 普通会员</div>
-                                <div>最后访问: 2019-12-09  10:10</div>
+                                <div class="list-name">{{ item.userName }}</div>
+                                <div>手机号: {{ item.mobile }}</div>
+                                <div>会员等级: {{ item.userAsset.memberLevel }}</div>
+                                <div>最后访问: {{ item.visitTimeFormat }}</div>
                             </div>
                         </slot>
 					</label>
@@ -89,11 +89,11 @@ export default {
 		},
 		// 确认
 		confirmFn() {
-			if (this.multi) {
-				this.$emit('change', this.checkboxArr)
-			} else {
-				this.$emit('change', this.radioData)
-			}
+			// if (this.multi) {
+			// this.$emit('change', this.checkboxArr)
+			// } else {
+			this.$emit('change', this.radioData)
+			// }
 		}
 	}
 }

+ 33 - 2
mobile-code/src/pages/staff/add.vue

@@ -94,13 +94,36 @@ export default {
 				remark: ''
 			},
 			roleList: [],
-			roleSelData: {}
+			roleSelData: {},
+			memberData: {}
 		}
 	},
 	onLoad() {
-		this._getRoleList()
+		this.init()
 	},
 	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
+			}
+			let memberData = uni.getStorageSync('memberSelGoods')
+			if (memberData) {
+				uni.removeStorageSync('memberSelGoods')
+				this.memberData = memberData
+				this.userId = memberData.id
+			}
+
+			if (this.option.id && !data) {
+				this._getDet()
+			}
+			this._getRoleList()
+		},
 		// api
 		_getRoleList() {
 			getRoleList().then(res => {
@@ -108,6 +131,14 @@ export default {
 				this.roleList = res.data.list
 			})
 		},
+		_getDet() {
+			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]
+				})
+			})
+		},
 		// option
 		changeRoleFn(e) {
 			this.roleSelData = this.roleList[e.detail.value]

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

@@ -1,15 +1,74 @@
 <template>
 	<div class="app-content">
-		<sel-search-module></sel-search-module>
+		<sel-search-module :list="list.data" @search="searchFn" @change="changeFn"></sel-search-module>
 	</div>
 </template>
 
 <script>
 import SelSearchModule from '@/pages/admin/components/sel-search'
+import { list } from '@/mixins'
+// api
+import { getList } from '@/api/member'
 export default {
 	name: 'staff-sel-member',
 	components: {
 		SelSearchModule
+	},
+	mixins: [list],
+	data() {
+		return {
+			search: ''
+		}
+	},
+	onPullDownRefresh() {
+		this.resetList()
+		this._list().then(res => {
+			uni.stopPullDownRefresh()
+		})
+	},
+	onReachBottom() {
+		if (this.list.data.length < this.list.total) {
+			this._list().then(res => {
+				uni.stopPullDownRefresh()
+			})
+		} else {
+			uni.stopPullDownRefresh()
+		}
+	},
+	onLoad: function() {
+		this.init()
+	},
+	methods: {
+		async init() {
+			this._list()
+		},
+		_list() {
+			let params = {
+				page: this.list.page,
+				goodsName: this.search
+			}
+			return getList(params).then(res => {
+				this.completes(res)
+			})
+		},
+		// 搜索
+		searchFn(val) {
+			if (!val) return false
+			this.search = val
+			this.resetList()
+			this._list()
+		},
+		// 选择员工
+		changeFn(e) {
+			uni.setStorageSync('addStaffData', e)
+			this.$util.pageTo({
+				url: '/pages/staff/add',
+				query: {
+					...this.option
+				},
+				type: 2
+			})
+		}
 	}
 }
 </script>