Просмотр исходного кода

客户列表及省市区列表组件调整

fuwei 5 лет назад
Родитель
Сommit
0d9d3a8e1b

+ 24 - 34
ghs/src/admin/home/member.vue

@@ -8,24 +8,24 @@
       :height="100"
       @add="pageTo('/admin/member/add')"
       @change="change"
-      itemWidth="25%"
+      itemWidth="50%"
     />
     <!-- list -->
-    <view style="padding:0 8px 10px 8px;" v-if="showMoreUser">
+    <!-- <view style="padding:0 8px 10px 8px;" v-if="showMoreUser">
 
-<span class="user_tag">恋人(867)</span>
-<span class="user_tag">学生(50)</span>
-<span class="user_tag">准婚(150)</span>
-<span class="user_tag">同行(30)</span>
-<span class="user_tag">常买散花(837)</span>
-<span class="user_tag">企业客户(66)</span>
-<span class="user_tag">生日送过(43)</span>
-<span class="user_tag">酒店(28)</span>
-<span class="user_tag">影楼(10)</span>
-<span class="user_tag">开花艺课(42)</span>
-<span class="user_tag">学员(711)</span>
+      <span class="user_tag">恋人(867)</span>
+      <span class="user_tag">学生(50)</span>
+      <span class="user_tag">准婚(150)</span>
+      <span class="user_tag">同行(30)</span>
+      <span class="user_tag">常买散花(837)</span>
+      <span class="user_tag">企业客户(66)</span>
+      <span class="user_tag">生日送过(43)</span>
+      <span class="user_tag">酒店(28)</span>
+      <span class="user_tag">影楼(10)</span>
+      <span class="user_tag">开花艺课(42)</span>
+      <span class="user_tag">学员(711)</span>
 
-    </view>
+    </view> -->
     <block v-if="!$util.isEmpty(list.data)">
       <block v-for="(item,index) in list.data" :key="index">
         <tui-list-cell
@@ -38,14 +38,14 @@
 				})"
         >
           <div class="tui-msg-box">
-            <img :src="item.avatarUrl" class="tui-msg-pic" mode="widthFix" />
+            <img :src="item.avatar" class="tui-msg-pic" mode="widthFix" />
             <div class="tui-msg-item">
               <div class="tui-msg-name">
-                <div class="tui-user-name">{{item.userName}}</div>
+                <div class="tui-user-name">{{item.shopName}}</div>
                 <appVipModule
-                  v-if="item.member > 0"
+                  v-if="item.level > 0"
                   class="level-img"
-                  :vipImg="`${constant.imgUrl}/retail/member/grade/${item.userAsset.member}.png`"
+                  :vipImg="`${constant.imgUrl}/retail/member/grade/${item.level}.png`"
                 />
                 <template v-else>
                   <appVipModule
@@ -62,7 +62,7 @@
                 </template>
               </div>
               <div class="tui-msg-content">
-                <span>{{item.visitTimeFormat}}</span>
+                <span>{{item.visitTime}}</span>
               </div>
             </div>
           </div>
@@ -105,23 +105,14 @@ export default {
   data() {
     return {
       tabIndex: 0,
-      showMoreUser:false,
       tabs: [
         {
           name: "全部",
           value: 0
         },
         {
-          name: "粉丝",
+          name: "已开店",
           value: 0
-        },
-        {
-          name: "会员",
-          value: 0
-        },
-        {
-          name: "更多",
-          value: "..."
         }
       ]
     };
@@ -160,9 +151,8 @@ export default {
       }).then(res => {
         this.completes(res);
         if (this.$util.isEmpty(res.data)) return false;
-        this.tabs[0].value = res.data.asset.totalUser;
-        this.tabs[1].value = res.data.asset.totalFans;
-        this.tabs[2].value = res.data.asset.totalMember;
+        this.tabs[0].value = res.data.allNum;
+        this.tabs[1].value = res.data.isOpenNum;
       });
     },
     change(e) {
@@ -170,10 +160,10 @@ export default {
         return false;
       } else {
         if(e.index == 3){
-          this.showMoreUser = true;
+          // this.showMoreUser = true;
           this.tabIndex = e.index;
         }else{
-          this.showMoreUser = false;
+          // this.showMoreUser = false;
           this.tabIndex = e.index;
           this.resetList();
           this._list();

+ 89 - 14
ghs/src/admin/member/add.vue

@@ -3,14 +3,23 @@
 		<form @submit="formSubmit">
 			<div class="module-com input-line-wrap">
 				<tui-list-cell class="line-cell" :hover="false">
-					<div class="tui-title required">手机号</div>
+					<div class="tui-title">花店名称</div>
+					<input v-model="form.name" placeholder-class="phcolor" class="tui-input" name="phone" placeholder="请输入(选填)" maxlength="50" type="text" />
+				</tui-list-cell>
+				<tui-list-cell class="line-cell" :hover="false">
+					<div class="tui-title">店长姓名</div>
+					<input v-model="form.adminName" placeholder-class="phcolor" class="tui-input" name="phone" placeholder="请输入(选填)" maxlength="50" type="text" />
+				</tui-list-cell>
+				<tui-list-cell class="line-cell" :hover="false">
+					<div class="tui-title required">店长手机号</div>
 					<input v-model="form.mobile" placeholder-class="phcolor" class="tui-input" name="mobile" placeholder="请输入" maxlength="50" type="number" />
 				</tui-list-cell>
 				<tui-list-cell class="line-cell" :hover="false">
 					<div class="tui-title required">确认手机号</div>
 					<input v-model="form.confirmMobile" placeholder-class="phcolor" class="tui-input" name="confirmMobile" placeholder="请输入" maxlength="50" type="number" />
 				</tui-list-cell>
-				<tui-list-cell class="line-cell" :hover="false">
+				
+				<!-- <tui-list-cell class="line-cell" :hover="false">
 					<div class="tui-title required">余额</div>
 					<input v-model="form.balance" placeholder-class="phcolor" class="tui-input" name="balance" placeholder="请输入" maxlength="50" type="number" />
 				</tui-list-cell>
@@ -22,19 +31,50 @@
 						<div class="tui-placeholder" v-else>请选择</div>
 					</picker>
 				</tui-list-cell>
-				<tui-list-cell class="line-cell" :hover="false">
-					<div class="tui-title">姓名</div>
-					<input v-model="form.realName" placeholder-class="phcolor" class="tui-input" name="phone" placeholder="请输入(选填)" maxlength="50" type="text" />
-				</tui-list-cell>
+				
 				<tui-list-cell class="line-cell" :hover="false">
 					<div class="tui-title required">确认密码</div>
 					<input v-model="form.confirmPassword" placeholder-class="phcolor" class="tui-input" name="confirmPassword" placeholder="请输入确认密码" maxlength="50" type="password" />
+				</tui-list-cell> -->
+				<!-- <div class="prompt-text">注册会员时会根据手机号识别此客户,等级和余额自动同步到帐户里。</div> -->
+				
+			</div>
+			<div 
+			style="margin-top:20px"
+				class="module-com input-line-wrap">
+				<tui-list-cell class="line-cell" :hover="false" :arrow="true" @click="openAddres">
+					<div class="tui-title">所在城市</div>
+					<div class="tui-input" v-if="form.province">{{ form.province + '-' + form.city }}</div>
+					<div class="tui-placeholder" v-else>请选择</div>
 				</tui-list-cell>
-				<div class="prompt-text">注册会员时会根据手机号识别此客户,等级和余额自动同步到帐户里。</div>
+				 <tui-list-cell class="line-cell" :hover="false" :arrow="true" @click="selRegionFn">
+					<div class="tui-title">详细地址</div>
+					<div class="tui-input" v-if="form.address">{{ form.address }}</div>
+					<div class="tui-placeholder" v-else>请填写详细地址</div>
+					</tui-list-cell>
+					<tui-list-cell class="line-cell" :hover="false">
+					<div class="tui-title">门牌号</div>
+					<input
+						v-model="form.floor"
+						placeholder-class="phcolor"
+						placeholder-style="color:#CCCCCC"
+						class="tui-input"
+						name="floor"
+						placeholder="楼号门牌号(选填)"
+					/>
+					</tui-list-cell>
 				<div class="btn-wrap">
 					<button class="admin-button-com blue big" formType="submit">确认</button>
 				</div>
 			</div>
+			<!-- 选择地区 -->
+			<app-area-sel :show.sync="showRegion" @change="changeAreaFn" :city="form.city" />
+			<!-- 省市联动 -->
+			<simple-address
+				ref="simpleAddress"
+				:pickerValueDefault="cityPickerValueDefault"
+				@onConfirm="onCityConfirm"
+			></simple-address>
 		</form>
 	</div>
 </template>
@@ -46,31 +86,66 @@ const form = require('@/utils/formValidation.js')
 // api
 import { getLevel } from '@/utils/config'
 import { add } from '@/api/member'
+// import {
+//   regionTree
+// } from "@/api/official";
+import AppAreaSel from "@/components/app-area-sel";
+import SimpleAddress from "@/components/plugin/simple-address";
 export default {
 	name: 'member-add',
 	components: {
-		TuiListCell
+		TuiListCell,
+		AppAreaSel,
+        SimpleAddress,
 	},
 	data() {
 		return {
+			showRegion:false,
+			 // 省市联动
+			regionData: [],
+			cityPickerValueDefault: [0, 0],
 			form: {
+				floor:'',
+				address:'',
+				province:'',
+				city:'',
 				mobile: '',
 				confirmMobile: '',
-				balance: 0,
-				memberLevel: '',
-				realName: '',
-				confirmPassword: ''
+				name: '',
+				adminName: '',
+				lat:'',
+				long: ''
 			},
 			levelSelData: {}
 		}
 	},
 	computed: {
-		...mapGetters({ levelData: 'getLevel' })
 	},
 	onLoad() {
-		getLevel()
 	},
 	methods: {
+		init(){
+		},
+		onCityConfirm(e) {
+		this.form.province = e.provinceName;
+		this.form.city = e.cityName;
+		},
+		changeAreaFn(e) {
+		console.log("changeAreaFn", e);
+		this.form.address = e.address;
+		this.form.lat = e.location.lat;
+		this.form.long = e.location.lng;
+		},
+		selRegionFn(){
+			if (!this.form.city) {
+				this.$msg("请先选择城市!");
+				return false;
+			}
+			this.showRegion = true;
+		},
+		openAddres(){
+			this.$refs.simpleAddress.open();
+		},
 		confirmFn() {
 			add(this.form).then(res => {
 				this.$msg('添加成功!')

+ 6 - 8
ghs/src/admin/official/apply.vue

@@ -79,7 +79,6 @@
       <!-- 省市联动 -->
       <simple-address
         ref="simpleAddress"
-        :region="regionData"
         :pickerValueDefault="cityPickerValueDefault"
         @onConfirm="onCityConfirm"
       ></simple-address>
@@ -145,22 +144,21 @@ export default {
   },
   methods: {
     init() {
-   
       this.$util.getCheckLogin().then(res => {
         if (res) {
           let id = uni.getStorageSync("introMerchantId");
           if (id > 0) {
             this._getMerchantDet();
           }
-          this._regionTree();
+          // this._regionTree();
         }
       });
     },
-    _regionTree() {
-      regionTree().then(res => {
-        this.regionData = res.data.tree;
-      });
-    },
+    // _regionTree() {
+    //   regionTree().then(res => {
+    //     this.regionData = res.data.tree;
+    //   });
+    // },
     _getMerchantDet() {
       let id = uni.getStorageSync("introMerchantId");
       getIntroduce({ id: id }).then(res => {

+ 1 - 8
ghs/src/admin/shop/add.vue

@@ -48,7 +48,7 @@
 			</div>
 		</form>
 		<!-- 省市联动 -->
-		<simple-address ref="simpleAddress" :region="regionData" :pickerValueDefault="cityPickerValueDefault" @onConfirm="onCityConfirm"></simple-address>
+		<simple-address ref="simpleAddress" :pickerValueDefault="cityPickerValueDefault" @onConfirm="onCityConfirm"></simple-address>
 		<!-- 选择地区 -->
 		<app-area-sel :show.sync="showRegion" :city="form.receiveCity" @change="changeAreaFn" />
 	</div>
@@ -62,7 +62,6 @@
 	const form = require('@/utils/formValidation.js')
 	// api
     import { updateShop as update, addShop as add } from '@/api/shop'
-    import { regionTree } from '@/api/official'
 	export default {
 		name: 'staff-add',
 		components: {
@@ -111,12 +110,6 @@
 		methods: {
 			init() {
                 this._getDet()
-                this._regionTree()
-			},
-			_regionTree() {
-				regionTree().then(res => {
-					this.regionData = res.data.tree
-				})
 			},
 			// api
 			_getDet() {

+ 1 - 1
ghs/src/api/member/index.js

@@ -4,7 +4,7 @@ import https from '@/plugins/luch-request_0.0.7/request'
  * 客户列表 b
  */
 export const getList = data => {
-	return https.get('/user/list', data)
+	return https.get('/custom/list', data)
 }
 
 /** *

+ 18 - 8
ghs/src/components/plugin/simple-address.vue

@@ -56,6 +56,9 @@
 // import provinceData from './city-data/province.js'
 // import cityData from './city-data/city.js'
 // import areaData from './city-data/area.js'
+import {
+  regionTree
+} from "@/api/official";
 export default {
 	name: 'simpleAddress',
 	props: {
@@ -91,13 +94,13 @@ export default {
 				return [0, 0]
 			}
 		},
-		// 省市区数据
-		region: {
-			type: Array,
-			default() {
-				return []
-			}
-		}
+		// // 省市区数据
+		// region: {
+		// 	type: Array,
+		// 	default() {
+		// 		return []
+		// 	}
+		// }
 	},
 	data() {
 		return {
@@ -106,7 +109,8 @@ export default {
 			pickerValue: [0, 0],
 			provinceDataList: [],
 			cityDataList: [],
-			areaDataList: []
+			areaDataList: [],
+			region: []
 		}
 	},
 	watch: {
@@ -125,7 +129,13 @@ export default {
 		this.sInit()
 	},
 	methods: {
+		_regionTree() {
+			regionTree().then(res => {
+				this.region = res.data.tree;
+			});
+		},
 		sInit() {
+			this._regionTree()
 		// 	this.handPickValueDefault() // 对 pickerValueDefault 做兼容处理
 		// 	this.provinceDataList = JSON.parse(JSON.stringify(this.region))
 		// 	this.cityDataList = []