邓洁 : 编辑接口

This commit is contained in:
邓洁
2023-11-19 22:27:47 +08:00
parent 7fd9354a2e
commit 6eb6756796
7 changed files with 248 additions and 31 deletions

View File

@@ -7,7 +7,7 @@
</u-form-item>
<u-form-item label="区域" label-position="top" border-bottom="true" right-icon="arrow-right" prop="region"
label-width="auto">
<text @click="show1 = true" class="checkedtext" v-if="form.region.length>0">{{form.region}}</text>
<text @click="show1 = true" class="checkedtext" v-if="form.region">{{form.region}}</text>
<text @click="show1 = true" class="checktext" v-else>请选择所属区域</text>
<view class="arrow-icon">
@@ -18,7 +18,7 @@
</u-form-item>
<u-form-item label="行业" label-position="top" border-bottom="true" class="picker" label-width="auto"
prop="business">
<text @click="show2 = true" class="checkedtext" v-if="form.business.length>0">{{form.business}}</text>
<text @click="show2 = true" class="checkedtext" v-if="form.business">{{form.business}}</text>
<text @click="show2 = true" class="checktext" v-else>请选择行业</text>
<view class="arrow-icon">
<u-icon name="arrow-right" size="30px" @click="show2 = true"></u-icon>
@@ -28,7 +28,7 @@
</u-form-item>
<u-form-item label="业态" label-position="top" border-bottom="true" label-width="auto" prop="commercialForm">
<text @click="choosecommercialForm" class="checkedtext"
v-if="form.commercialForm.length>0">{{form.commercialForm}}</text>
v-if="form.commercialForm">{{form.commercialForm}}</text>
<text @click="choosecommercialForm" class="checktext" v-else>请选择业态</text>
<view class="arrow-icon">
<u-icon name="arrow-right" size="30px" @click="choosecommercialForm"></u-icon>
@@ -160,6 +160,28 @@
}
},
methods: {
getDetail(type, id) {
console.log('type, id', type, id);
this.$api.getShopDetail(type, id).then(res => {
console.log(',re', res);
const data = res.data.data
if (res.data.code == 1) {
this.form = {
title: data.tt,
region: data.area1,
business: data.trade1,
commercialForm: data.trade2,
area: data.mianji,
transferFee: data.zhuanrangfei,
rent: data.zujin,
contactPerson: data.lianxiren,
phone: data.mobile,
details: data.content,
id: id
}
}
})
},
preview(e) {
console.log('预览', e);
},
@@ -170,11 +192,14 @@
},
submit() {
this.$refs.uForm.validate().then(res => {
console.log("提交表单信息:", this.form)
console.log("提交表单信息:", this.form, this.form.id)
this.$api.publishAddress(this.form).then(res => {
console.log('发布找店地址', res);
if (res.data.code == 1) {
uni.$u.toast('发布成功')
uni.$u.toast(res.data.msg)
uni.reLaunch({
url: '/pages/my/my'
})
} else {
uni.$u.toast(res.data.msg)
}
@@ -229,7 +254,16 @@
this.$refs.uForm.setRules(this.rules)
},
onLoad() {
onLoad(options) {
console.log('修改找店地址', options);
if (options.item) {
console.log('修改');
if (options.id) {
this.getDetail(2, options.id)
}
} else {
console.log('发布');
}
this.getRegionList()
this.$api.getClassList().then(res => {
// console.log(res.data.data.length);