shish 2 سال پیش
والد
کامیت
f2ec0785d7

+ 0 - 1
ghsApp/src/pagesClient/member/detail.vue

@@ -285,7 +285,6 @@ export default {
 			// 将经纬度转换成Number
 			// 将经纬度转换成Number
 			let latituded = Number(latitude)
 			let latituded = Number(latitude)
 			let longituded = Number(longitude)
 			let longituded = Number(longitude)
-      console.log(latituded+'_'+longituded)
 			uni.openLocation({
 			uni.openLocation({
 				latitude: latituded,
 				latitude: latituded,
 				longitude: longituded,
 				longitude: longituded,

+ 88 - 1
hdApp/src/admin/member/detail.vue

@@ -32,6 +32,28 @@
     </div>
     </div>
 -->
 -->
 
 
+    <view class="module-com user-address_bx">
+        <view class="address-tit"> 地址 </view>
+        <view class="address-des_bx">
+          <view @click.stop="pageTo({ url: '/admin/member/modify?id='+data.id+'&name='+data.name })">
+              <view>
+                {{data.name}}
+              </view>
+              <view style="margin-bottom:20upx;color:#333333">{{data.superInfo.name||''}} {{data.mobile}}</view>
+              <view>
+                <text v-if="!$util.isEmpty(data.city)" style="margin-right:15upx;">{{data.city}}</text>
+                {{data.dist}}{{data.address}}{{data.floor}}
+                <text v-if="data.showAddress && !$util.isEmpty(data.showAddress)">({{data.showAddress}})</text>
+                <i class="iconfont iconbianji" style="font-size:25upx;margin-left:20upx;"></i>
+              </view>
+          </view>
+          <view>
+            <i @click="callMobile" class="iconfont icondianhua1"></i>
+            <i @click.stop="navigate(data.lat,data.long,data.customName)" class="iconfont icondianhua" style="font-size:48upx;margin-left:60upx;margin-right:18upx;color:#3385ff;"></i>
+          </view>
+        </view>
+    </view>
+
     <div class="module-com tabs-wrap">
     <div class="module-com tabs-wrap">
       <div class="tabs-list" v-for="(item, index) in tabsData" :key="index" @click="pageTo(item)">
       <div class="tabs-list" v-for="(item, index) in tabsData" :key="index" @click="pageTo(item)">
         <div class="tabs-img">
         <div class="tabs-img">
@@ -287,8 +309,29 @@ export default {
   computed: {
   computed: {
     ...mapGetters({ levelData: "getLevel" })
     ...mapGetters({ levelData: "getLevel" })
   },
   },
-  onLoad() {},
+  onLoad(){
+
+  },
+  onShow(){
+    this.init()
+  },
   methods: {
   methods: {
+		navigate(latitude, longitude, address) {   
+			// 将经纬度转换成Number
+			let latituded = Number(latitude)
+			let longituded = Number(longitude)
+			uni.openLocation({
+				latitude: latituded,
+				longitude: longituded,
+				address: address,
+				success: function() { }
+			})
+		},
+    callMobile() {
+      uni.makePhoneCall({
+        phoneNumber:this.data.mobile
+      });
+    },
 		changeNameFn(){
 		changeNameFn(){
 			this.customName = this.data.name
 			this.customName = this.data.name
 			this.changeShow = true
 			this.changeShow = true
@@ -533,6 +576,50 @@ export default {
     }
     }
   }
   }
 }
 }
+.user-address_bx {
+  padding:20upx 0;
+  & .address-tit {
+    color: #999999;
+    font-size: 24upx;
+    font-weight: 600;
+    padding:10upx 0 20upx 20upx;
+    border-bottom: 1upx solid #EEEEEE;
+  }
+  & .address-des_bx {
+    display: flex;
+    padding: 20upx 10upx 30upx 20upx;
+    & > view:nth-child(1) {
+      flex: 1;
+      margin-top: 10upx;
+
+      & > view:nth-child(1) {
+        color: #333333;
+        font-size: 28upx;
+        font-weight: bold;
+        display: flex;
+        align-items: center;
+        & .admin-button-com {
+          margin-left: 10upx;
+          border-radius: 25upx;
+        }
+      }
+      & > view:nth-child(2) {
+          color: #666666;
+          font-size: 28upx;
+          font-weight: 400;
+          margin-top: 20upx; 
+      }
+    }
+    & > view:nth-child(2) {
+      display: flex;
+      & .icondianhua1 {
+          font-size: 44upx;
+          color: #3385FF;
+          margin-left: 10upx;
+        }
+    }
+  }
+}
 .tabs-wrap {
 .tabs-wrap {
   padding: 40upx 10upx;
   padding: 40upx 10upx;
   @include disFlex(center, center);
   @include disFlex(center, center);

+ 185 - 0
hdApp/src/admin/member/modify.vue

@@ -0,0 +1,185 @@
+<template>
+	<view class="app-content">
+		<form @submit="formSubmit">
+			<view class="module-com input-line-wrap">
+
+				<tui-list-cell class="line-cell" :hover="false" :arrow="true" @click="openAddres">
+					<view class="tui-title">城市</view>
+					<view class="tui-input" v-if="form.province || form.city">{{ form.province + '-' + form.city }}</view>
+					<view class="tui-placeholder" v-else>请选择</view>
+					<input v-model="form.province" name="province" hidden />
+				</tui-list-cell>
+				<tui-list-cell class="line-cell" :hover="false" :arrow="true" @click="selectRegion">
+					<view class="tui-title">地址</view>
+					<view class="tui-input" v-if="form.address">{{ form.address }}</view>
+					<view class="tui-placeholder" v-else>请填写详细地址</view>
+					<input v-model="form.address" name="address" hidden />
+				</tui-list-cell>
+				<tui-list-cell class="line-cell" :hover="false">
+					<view class="tui-title ">门牌</view>
+					<input v-model="form.floor" placeholder-class="phcolor" class="tui-input" name="floor" placeholder="楼号门牌号(建议填写,方便查找)" />
+				</tui-list-cell>
+
+			</view>
+			<view class="confirm-btn">
+				<button class="admin-button-com big blue" formType="submit">提交</button>
+			</view>
+		</form>
+		<!-- 省市联动 -->
+		<simple-address ref="simpleAddress" :pickerValueDefault="cityPickerValueDefault" @onConfirm="onCityConfirm"></simple-address>
+		<!-- 选择地区 -->
+		<app-area-sel :show.sync="showRegion" :city="form.city" @change="changeAreaFn" />
+	</view>
+</template>
+
+<script>
+import TuiListCell from '@/components/plugin/list-cell'
+import AppAvatarModule from '@/components/module/app-avatar'
+import SimpleAddress from '@/components/plugin/simple-address'
+import AppAreaSel from '@/components/app-area-sel'
+import AppUploader from "@/components/app-uploader";
+const form = require('@/utils/formValidation.js')
+import { modifyAddress } from '@/api/custom'
+import {mapActions} from "vuex";
+export default {
+	name: 'add',
+	components: {
+		TuiListCell,
+		AppAvatarModule,
+		SimpleAddress,
+		AppAreaSel,
+		AppUploader
+	},
+	data() {
+		return {
+			form: {
+				province: '',
+				city: '',
+				address: '',
+				floor: '',
+				showAddress:''
+			},
+			showRegion: false,
+			region: {
+				lat: 0,
+				long: 0
+			},
+			regionData: [],
+			cityPickerValueDefault: [0, 0]
+		}
+	},
+	onLoad() {
+		if(this.option.name){
+			uni.setNavigationBarTitle({ title: this.option.name })
+		}
+	},
+	onShow() {
+
+	},
+	methods: {
+		...mapActions(['setUserShopAll']),
+		init() {
+
+		},
+		// 选择城市
+		selectRegion() {
+			if (!this.form.city) {
+				this.$msg('请先选择城市!')
+				return false
+			}
+			this.showRegion = true
+		},
+		changeAreaFn(e) {
+			this.form.address = e.title
+			this.form.showAddress = e.address
+			this.region.lat = e.location.lat
+			this.region.long = e.location.lng
+		},
+		//省市联动
+		openAddres() {
+			this.$refs.simpleAddress.open()
+		},
+		onCityConfirm(e) {
+			this.form.province = e.provinceName
+			this.form.city = e.cityName
+			this.form.address = ''
+			this.region.lat = 0
+			this.region.long = 0
+		},
+		confirmFn() {
+			let that = this
+			that.$util.confirmModal({content:'确认修改?'},() => {
+				this.form.id = this.option.id ? this.option.id : 0
+				this.form = {...this.form,...this.region}
+				uni.showLoading({mask:true})
+				modifyAddress(this.form).then(res=>{
+					if(res.code == 1){
+						that.$msg('修改成功')
+						setTimeout(() => {
+							uni.navigateBack({})
+						}, 1200)
+					}
+				})
+			})
+		},
+		// 表单验证
+		formSubmit(e) {
+			// 表单规则
+			let rules = [
+				{
+					name: 'province',
+					rule: ['required'],
+					msg: ['请选择城市']
+				},
+				{
+					name: 'address',
+					rule: ['required'],
+					msg: ['请填选地址']
+				}
+			]
+			let formData = e.detail.value
+			let checkRes = form.validation(formData, rules)
+			if (!checkRes) {
+				this.confirmFn()
+			} else {
+				this.$msg(checkRes)
+			}
+		},
+	}
+}
+</script>
+
+<style lang="scss" scoped>
+	.app-content {
+		min-height: calc(100vh - 20upx);
+		padding-top: 20upx;
+	}
+	.prompt-text {
+		color: $fontColor3;
+		padding-left: 30upx;
+		margin-bottom: 30upx;
+	}
+	.module-com {
+		margin-bottom: 20upx;
+		.member-wrap {
+			.member-det {
+				font-size: 24upx;
+				margin-left: 20upx;
+			}
+		}
+		.remark-wrap {
+			align-items: flex-start;
+			.remark {
+				height: 180upx;
+			}
+		}
+	}
+	// 按钮
+	.confirm-btn {
+		width: calc(100% - 60upx);
+		margin: 60upx 30upx 20upx;
+		.admin-button-com {
+			width: 100%;
+		}
+	}
+</style>

+ 5 - 2
hdApp/src/admin/order/detail.vue

@@ -59,8 +59,8 @@
               <view class="value" style="font-weight:bold;color:red;">到店自取</view>
               <view class="value" style="font-weight:bold;color:red;">到店自取</view>
             </view>
             </view>
             <view class="msg-list" v-if="!$util.isEmpty(orderInfo.bookName)">
             <view class="msg-list" v-if="!$util.isEmpty(orderInfo.bookName)">
-              <view class="label">订花:</view>
-              <view class="value">{{orderInfo.bookName}} <text style="margin-left:18upx;" v-if="!$util.isEmpty(orderInfo.bookMobile)" @click="callUp(orderInfo.bookMobile)">{{orderInfo.bookMobile}}</text></view>
+              <view class="label" @click.stop="getCustomInfo(orderInfo)">订花:</view>
+              <view class="value" @click.stop="getCustomInfo(orderInfo)">{{orderInfo.bookName}} <text style="margin-left:22upx;color:blue;" v-if="!$util.isEmpty(orderInfo.bookMobile)" @click="callUp(orderInfo.bookMobile)">{{orderInfo.bookMobile}}</text></view>
             </view>
             </view>
           </view>
           </view>
         </view>
         </view>
@@ -251,6 +251,9 @@ export default {
         }
         }
       })
       })
     },
     },
+    getCustomInfo(item){
+      this.$util.pageTo({url:'/admin/member/detail?id='+item.customId})
+    },
     edit(item){
     edit(item){
       this.$util.pageTo({url:'/admin/order/modify?id='+item.id})
       this.$util.pageTo({url:'/admin/order/modify?id='+item.id})
     },
     },

+ 4 - 0
hdApp/src/api/custom/index.js

@@ -6,4 +6,8 @@ export const batchAddCumtom = data => {
 
 
 export const changeName = data => {
 export const changeName = data => {
 	return https.get('/custom/change-name', data)
 	return https.get('/custom/change-name', data)
+}
+
+export const modifyAddress = data => {
+	return https.post('/custom/modify-address', data)
 }
 }

+ 2 - 1
hdApp/src/pages.json

@@ -353,7 +353,8 @@
 		{
 		{
 			"root": "admin/member",
 			"root": "admin/member",
 			"pages": [
 			"pages": [
-				{ "path": "detail", "style": { "navigationBarTitleText": "详情" } }
+				{ "path": "detail", "style": { "navigationBarTitleText": "详情" } },
+				{ "path": "modify", "style": { "navigationBarTitleText": "修改地址" } }
 			]
 			]
 		},
 		},
 		{
 		{