فهرست منبع

门店管理优化

shish 5 سال پیش
والد
کامیت
d412c952a5
2فایلهای تغییر یافته به همراه25 افزوده شده و 38 حذف شده
  1. 10 17
      ghsApp/src/admin/shop/add.vue
  2. 15 21
      hdApp/src/admin/shop/add.vue

+ 10 - 17
ghsApp/src/admin/shop/add.vue

@@ -63,10 +63,9 @@
 	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";
+	import AppUploader from "@/components/app-uploader";
 	const form = require('@/utils/formValidation.js')
-	// api
-    import { updateShop as update, addShop as add } from '@/api/shop'
+	import { updateShop as update, addShop as add } from '@/api/shop'
 	import {mapActions} from "vuex";
 	export default {
 		name: 'staff-add',
@@ -102,7 +101,6 @@
 			}
 		},
 		onLoad() {
-			// this.init()
 		},
 		onShow() {
 			if (this.option.id) {
@@ -120,22 +118,19 @@
 			init() {
                 this._getDet()
 			},
-       _resultData(val) {
-        console.log(val)
-        this.form.img = val;
-        // this.form.upImgList = item
-      },
-			// api
+			_resultData(val) {
+				console.log(val)
+				this.form.img = val;
+			},
 			_getDet() {
 				let data = uni.getStorageSync('modifyShopB')
 				if (this.$util.isEmpty(data)) return
 				Object.keys(this.form).forEach((i, index) => {
-					// if (i != 'password') {
 					this.form[i] = data[i]
-					// }
 				})
+				this.region.lat = data.lat
+				this.region.long = data.long
 			},
-			// option
 			// 选择地址
 			selRegionFn() {
 				if (!this.form.city) {
@@ -155,13 +150,11 @@
 				this.$refs.simpleAddress.open()
 			},
 			onCityConfirm(e) {
-				// this.form.receiveAddress = e.label
 				this.form.province = e.provinceName
 				this.form.city = e.cityName
-        this.form.address = ''
-        this.region.lat = 0
+				this.form.address = ''
+				this.region.lat = 0
 				this.region.long = 0
-				// this.pickerText = JSON.stringify(e)
 			},
 			confirmFn() {
 				let hostFn = this.option.id ? update : add

+ 15 - 21
hdApp/src/admin/shop/add.vue

@@ -61,13 +61,12 @@
 <script>
 	import TuiListCell from '@/components/plugin/list-cell'
 	import AppAvatarModule from '@/components/module/app-avatar'
-  import AppUploader from "@/components/app-uploader";
+	import AppUploader from "@/components/app-uploader";
 	import SimpleAddress from '@/components/plugin/simple-address'
 	import AppAreaSel from '@/components/app-area-sel'
 	const form = require('@/utils/formValidation.js')
-  import {mapActions} from "vuex";
-	// api
-    import { updateShop as update, addShop as add } from '@/api/shop'
+	import {mapActions} from "vuex";
+	import { updateShop as update, addShop as add } from '@/api/shop'
 	export default {
 		name: 'staff-add',
 		components: {
@@ -103,7 +102,6 @@
 			}
 		},
 		onLoad() {
-			// this.init()
 		},
 		onShow() {
 			if (this.option.id) {
@@ -121,18 +119,17 @@
 			init() {
                 this._getDet()
 			},
-			// api
 			_getDet() {
 				let data = uni.getStorageSync('modifyShopB')
-        console.log('data===>', data)
-				if (this.$util.isEmpty(data)) return
+				if (this.$util.isEmpty(data)){
+					return
+				} 
 				Object.keys(this.form).forEach((i, index) => {
-					// if (i != 'password') {
 					this.form[i] = data[i]
-					// }
 				})
+				this.region.lat = data.lat
+				this.region.long = data.long
 			},
-			// option
 			// 选择地址
 			selRegionFn() {
 				if (!this.form.city) {
@@ -141,11 +138,10 @@
 				}
 				this.showRegion = true
 			},
-      _resultData(val) {
-        console.log(val)
-        this.form.img = val;
-        // this.form.upImgList = item
-      },
+			_resultData(val) {
+				console.log(val)
+				this.form.img = val;
+			},
 			changeAreaFn(e) {
 				console.log('changeAreaFn', e)
 				this.form.address = e.title
@@ -157,13 +153,11 @@
 				this.$refs.simpleAddress.open()
 			},
 			onCityConfirm(e) {
-				// this.form.receiveAddress = e.label
 				this.form.province = e.provinceName
 				this.form.city = e.cityName
-        this.form.address = ''
-        this.region.lat = 0
+				this.form.address = ''
+				this.region.lat = 0
 				this.region.long = 0
-				// this.pickerText = JSON.stringify(e)
 			},
 			confirmFn() {
 				let hostFn = this.option.id ? update : add
@@ -172,7 +166,7 @@
 				}
 				this.form = {...this.form,...this.region}
 				hostFn(this.form).then(res => {
-          this.setUserShopAll();
+          			this.setUserShopAll();
 					let promptText = this.option.id ? '修改成功!' : '添加成功!'
                     this.$msg(promptText)
                     uni.removeStorageSync('modifyShopB')