shish 3 лет назад
Родитель
Сommit
83acf981c7
3 измененных файлов с 42 добавлено и 30 удалено
  1. 37 23
      ghsApp/src/admin/shop/add.vue
  2. 1 7
      ghsApp/src/admin/shop/list.vue
  3. 4 0
      ghsApp/src/api/shop/index.js

+ 37 - 23
ghsApp/src/admin/shop/add.vue

@@ -77,6 +77,12 @@
 					<view class="tui-title ">门牌</view>
 					<input v-model="form.floor" placeholder-class="phcolor" class="tui-input" name="floor" placeholder="楼号门牌号(选填)" />
 				</tui-list-cell>
+
+				<tui-list-cell class="line-cell" :hover="false">
+					<view class="tui-title ">打包费</view>
+					<input v-model="form.packCost" @focus="form.packCost=''" placeholder-class="phcolor" class="tui-input" name="packCost" placeholder="打包费" />
+				</tui-list-cell>
+
 				<tui-list-cell class="line-cell remark-wrap" :hover="false">
 					<view class="tui-title">简介</view>
 					<view class="tui-input">
@@ -104,6 +110,7 @@ import AppUploader from "@/components/app-uploader";
 const form = require('@/utils/formValidation.js')
 import { updateShop as update, addShop as add } from '@/api/shop'
 import {mapActions} from "vuex";
+import {getDetail} from "@/api/shop"
 export default {
 	name: 'staff-add',
 	components: {
@@ -132,6 +139,7 @@ export default {
 				openEndTime: '',
 				introduction: '',
 				mobile: '',
+				packCost:0,
 				img: []
 			},
 			showRegion: false,
@@ -159,35 +167,41 @@ export default {
 	methods: {
 		...mapActions(['setUserShopAll']),
 		init() {
-	this._getDet()
+			this._getDet()
 		},
 		_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) => {
-				this.form[i] = data[i]
-			})
-			this.region.lat = data.lat
-			this.region.long = data.long
 
-			this.visible = this.form.open == 1 ? true : false
-			this.openTimeVisible = true
-			this.form.openType = 1
-			this.start_time = this.form.openStartTime
-			this.end_time = this.form.openEndTime
-			if (data.openStartTime == '') {
-				this.openTimeVisible = false
-				this.form.openType = 0
-				this.start_time = '09:00'
-				this.form.openStartTime = this.start_time
-			}
-			if (data.openEndTime == '') {
-				this.end_time = '18:00'
-				this.form.openEndTime = this.end_time
+			if(this.option.id && !this.$util.isEmpty(this.option.id)){
+				getDetail({shopId:this.option.id}).then(res=>{
+					let data = res.data.info
+
+					if (this.$util.isEmpty(data)) return
+					Object.keys(this.form).forEach((i, index) => {
+						this.form[i] = data[i]
+					})
+					this.region.lat = data.lat
+					this.region.long = data.long
+
+					this.visible = this.form.open == 1 ? true : false
+					this.openTimeVisible = true
+					this.form.openType = 1
+					this.start_time = this.form.openStartTime
+					this.end_time = this.form.openEndTime
+					if (data.openStartTime == '') {
+						this.openTimeVisible = false
+						this.form.openType = 0
+						this.start_time = '09:00'
+						this.form.openStartTime = this.start_time
+					}
+					if (data.openEndTime == '') {
+						this.end_time = '18:00'
+						this.form.openEndTime = this.end_time
+					}
+				})
 			}
 		},
 		openChange(e) {
@@ -314,7 +328,7 @@ export default {
 		.remark-wrap {
 			align-items: flex-start;
 			.remark {
-				height: 240upx;
+				height: 180upx;
 			}
 		}
 	}

+ 1 - 7
ghsApp/src/admin/shop/list.vue

@@ -102,13 +102,7 @@ export default {
 			})
 		},
 		toModiyFn(item) {
-			uni.setStorageSync('modifyShopB', item)
-			this.pageTo({
-				url: '/admin/shop/add',
-				query: {
-					id: item.id
-				}
-			})
+			this.pageTo({ url: '/admin/shop/add?id='+item.id})
 		},
 		// 收款码
 		downQrCodeFn(item, index) {

+ 4 - 0
ghsApp/src/api/shop/index.js

@@ -1,5 +1,9 @@
 import https from '@/plugins/luch-request_0.0.7/request'
 
+export const getDetail = data => {
+	return https.get('/shop/detail', data)
+}
+
 export const totalDebtChangeList = data => {
 	return https.get('/total-debt-change/list', data)
 }