|
|
@ -3,6 +3,11 @@ |
|
|
|
<!-- 导航栏 --> |
|
|
|
<navbar title="商家合作" leftClick @leftClick="$utils.navigateBack" color="#fff" /> |
|
|
|
|
|
|
|
<view v-if="['0', '2'].includes(status) && statusDesc" class="flex tips"> |
|
|
|
<uv-icon name="info-circle" color="#86A941" size="28rpx"></uv-icon> |
|
|
|
<text style="margin-left: 3rpx;">{{ statusDesc }}</text> |
|
|
|
</view> |
|
|
|
|
|
|
|
<view class="content"> |
|
|
|
<view class="form"> |
|
|
|
<view class="form-title">门头照片</view> |
|
|
@ -83,7 +88,7 @@ |
|
|
|
</uv-form> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="tools"> |
|
|
|
<view class="tools" v-if="status != '1'"> |
|
|
|
<button plain class="btn btn-submit" @click="onSubmit">提交</button> |
|
|
|
</view> |
|
|
|
</view> |
|
|
@ -91,11 +96,13 @@ |
|
|
|
</template> |
|
|
|
|
|
|
|
<script> |
|
|
|
import Position from '@/utils/position.js' |
|
|
|
import { mapState } from 'vuex' |
|
|
|
|
|
|
|
import Position from '@/utils/position.js' |
|
|
|
|
|
|
|
import formInput from '../components/formInput.vue' |
|
|
|
import formUpload from '../components/formUpload.vue' |
|
|
|
import formTextarea from '../components/formTextarea.vue' |
|
|
|
import formInput from '../components/formInput.vue' |
|
|
|
import formUpload from '../components/formUpload.vue' |
|
|
|
import formTextarea from '../components/formTextarea.vue' |
|
|
|
|
|
|
|
export default { |
|
|
|
components: { |
|
|
@ -105,6 +112,9 @@ export default { |
|
|
|
}, |
|
|
|
data() { |
|
|
|
return { |
|
|
|
id: null, |
|
|
|
status: null, |
|
|
|
statusDesc: null, |
|
|
|
form: { |
|
|
|
image: null, |
|
|
|
shop: null, |
|
|
@ -149,6 +159,15 @@ export default { |
|
|
|
}, |
|
|
|
} |
|
|
|
}, |
|
|
|
computed: { |
|
|
|
...mapState(['userInfo']), |
|
|
|
}, |
|
|
|
onLoad() { |
|
|
|
this.initData() |
|
|
|
}, |
|
|
|
onPullDownRefresh() { |
|
|
|
this.updateStatus() |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
//地图上选择地址 |
|
|
|
selectAddr() { |
|
|
@ -172,6 +191,65 @@ export default { |
|
|
|
} |
|
|
|
this.form.area = '' //用户啥都没选就点击勾选 |
|
|
|
}, |
|
|
|
async initData() { |
|
|
|
|
|
|
|
try { |
|
|
|
const shopList = (await this.$fetch('queryShopList', { userId: this.userInfo.id }))?.records |
|
|
|
|
|
|
|
if (!shopList.length) { |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
const { |
|
|
|
id, |
|
|
|
status, |
|
|
|
status_dictText, |
|
|
|
remark, |
|
|
|
image, |
|
|
|
shop, |
|
|
|
name, |
|
|
|
phone, |
|
|
|
area, |
|
|
|
latitude, |
|
|
|
longitude, |
|
|
|
address, |
|
|
|
} = shopList[0] |
|
|
|
|
|
|
|
this.form = { |
|
|
|
image, |
|
|
|
shop, |
|
|
|
name, |
|
|
|
phone, |
|
|
|
area, |
|
|
|
latitude, |
|
|
|
longitude, |
|
|
|
address, |
|
|
|
} |
|
|
|
|
|
|
|
this.id = id |
|
|
|
this.status = status |
|
|
|
this.statusDesc = status == '2' ? `${status_dictText}:${remark}` : status_dictText |
|
|
|
|
|
|
|
} catch (err) { |
|
|
|
|
|
|
|
} |
|
|
|
}, |
|
|
|
async updateStatus() { |
|
|
|
if (!this.id) { |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
try { |
|
|
|
const { status, status_dictText, remark } = await this.$fetch('queryShopById', { id: this.id }) |
|
|
|
|
|
|
|
this.status = status |
|
|
|
this.statusDesc = status == '2' ? `${status_dictText}:${remark}` : status_dictText |
|
|
|
} catch (err) { |
|
|
|
console.log('--err', err) |
|
|
|
} |
|
|
|
|
|
|
|
uni.stopPullDownRefresh(); |
|
|
|
}, |
|
|
|
async onSubmit() { |
|
|
|
try { |
|
|
|
|
|
|
@ -199,7 +277,9 @@ export default { |
|
|
|
address, |
|
|
|
} |
|
|
|
|
|
|
|
await this.$fetch('addShop', params) |
|
|
|
let api = this.id ? 'updateShop' : 'addShop' |
|
|
|
|
|
|
|
await this.$fetch(api, params) |
|
|
|
|
|
|
|
uni.showToast({ |
|
|
|
title: '提交成功', |
|
|
@ -227,6 +307,14 @@ export default { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
.tips { |
|
|
|
padding: 5rpx 0; |
|
|
|
font-weight: bold; |
|
|
|
font-size: 28rpx; |
|
|
|
color: $uni-color; |
|
|
|
background-color: rgba($color: #D8FF8F, $alpha: 0.3); |
|
|
|
} |
|
|
|
|
|
|
|
.content { |
|
|
|
padding: 28rpx 30rpx; |
|
|
|
} |
|
|
|