|
|
@@ -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')
|