|
@ -27,7 +27,9 @@ |
|
|
:labelStyle="{ |
|
|
:labelStyle="{ |
|
|
color: '#000000', |
|
|
color: '#000000', |
|
|
fontSize: '28rpx', |
|
|
fontSize: '28rpx', |
|
|
}"> |
|
|
|
|
|
|
|
|
}" |
|
|
|
|
|
errorType="toast" |
|
|
|
|
|
> |
|
|
<view class="form-item"> |
|
|
<view class="form-item"> |
|
|
<uv-form-item label="店铺名称" prop="shop"> |
|
|
<uv-form-item label="店铺名称" prop="shop"> |
|
|
<view class="form-item-content"> |
|
|
<view class="form-item-content"> |
|
@ -82,6 +84,7 @@ |
|
|
mapState |
|
|
mapState |
|
|
} from 'vuex' |
|
|
} from 'vuex' |
|
|
|
|
|
|
|
|
|
|
|
import util from '@/utils/utils.js' |
|
|
import Position from '@/utils/position.js' |
|
|
import Position from '@/utils/position.js' |
|
|
|
|
|
|
|
|
import formInput from '../components/formInput.vue' |
|
|
import formInput from '../components/formInput.vue' |
|
@ -128,7 +131,12 @@ |
|
|
'phone': { |
|
|
'phone': { |
|
|
type: 'string', |
|
|
type: 'string', |
|
|
required: true, |
|
|
required: true, |
|
|
message: '请输入您的手机号', |
|
|
|
|
|
|
|
|
message: '请输入正确的手机号', |
|
|
|
|
|
validator: (rule, value, callback) => { |
|
|
|
|
|
// 此处业务逻辑省略 |
|
|
|
|
|
// 返回true表校验通过,返回false表示不通过 |
|
|
|
|
|
return util.validatePhone(value) |
|
|
|
|
|
}, |
|
|
}, |
|
|
}, |
|
|
'area': { |
|
|
'area': { |
|
|
type: 'string', |
|
|
type: 'string', |
|
@ -149,6 +157,9 @@ |
|
|
onLoad() { |
|
|
onLoad() { |
|
|
this.initData() |
|
|
this.initData() |
|
|
}, |
|
|
}, |
|
|
|
|
|
onReady() { |
|
|
|
|
|
this.$refs.form.setRules(this.rules) |
|
|
|
|
|
}, |
|
|
onPullDownRefresh() { |
|
|
onPullDownRefresh() { |
|
|
this.updateStatus() |
|
|
this.updateStatus() |
|
|
}, |
|
|
}, |
|
@ -224,22 +235,38 @@ |
|
|
}, |
|
|
}, |
|
|
async updateStatus() { |
|
|
async updateStatus() { |
|
|
if (!this.id) { |
|
|
if (!this.id) { |
|
|
|
|
|
uni.stopPullDownRefresh(); |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
try { |
|
|
try { |
|
|
|
|
|
const shopDetails = (await this.$fetch('queryShopById')) |
|
|
|
|
|
|
|
|
const { |
|
|
const { |
|
|
status, |
|
|
status, |
|
|
status_dictText, |
|
|
status_dictText, |
|
|
remark |
|
|
remark |
|
|
} = await this.$fetch('queryShopById', { |
|
|
|
|
|
id: this.id |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
} = shopDetails |
|
|
|
|
|
|
|
|
this.status = status |
|
|
this.status = status |
|
|
this.statusDesc = status == '2' ? `${status_dictText}:${remark}` : status_dictText |
|
|
this.statusDesc = status == '2' ? `${status_dictText}:${remark}` : status_dictText |
|
|
} catch (err) { |
|
|
} catch (err) { |
|
|
console.log('--err', err) |
|
|
|
|
|
|
|
|
if (this.id) { |
|
|
|
|
|
this.form = { |
|
|
|
|
|
image: null, |
|
|
|
|
|
shop: null, |
|
|
|
|
|
name: null, |
|
|
|
|
|
phone: null, |
|
|
|
|
|
area: null, |
|
|
|
|
|
latitude: null, |
|
|
|
|
|
longitude: null, |
|
|
|
|
|
address: null, |
|
|
|
|
|
} |
|
|
|
|
|
this.id = null |
|
|
|
|
|
this.status = null |
|
|
|
|
|
this.statusDesc = null |
|
|
|
|
|
} |
|
|
|
|
|
console.log('err', err) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
uni.stopPullDownRefresh(); |
|
|
uni.stopPullDownRefresh(); |
|
@ -271,7 +298,12 @@ |
|
|
address, |
|
|
address, |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
let api = this.id ? 'updateShop' : 'addShop' |
|
|
|
|
|
|
|
|
let api = 'addShop' |
|
|
|
|
|
|
|
|
|
|
|
if (this.id) { |
|
|
|
|
|
api = 'updateShop' |
|
|
|
|
|
params.id = this.id |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
await this.$fetch(api, params) |
|
|
await this.$fetch(api, params) |
|
|
|
|
|
|
|
@ -283,7 +315,7 @@ |
|
|
setTimeout(uni.navigateBack, 1000, -1) |
|
|
setTimeout(uni.navigateBack, 1000, -1) |
|
|
|
|
|
|
|
|
} catch (err) { |
|
|
} catch (err) { |
|
|
|
|
|
|
|
|
|
|
|
console.log('err', err) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
}, |
|
|
}, |
|
|