diff --git a/pages/my/my.vue b/pages/my/my.vue index 5fbf821..1815acf 100644 --- a/pages/my/my.vue +++ b/pages/my/my.vue @@ -106,6 +106,18 @@ } }) } + //---------页面调用接口示例------------ + getInfo() { + this.$api.getUser().then(res => { + var data = res.data.data + if (data) { + console.log(data); + this.src = this.$api.imgUrl + data.avatar + this.username = data.nickname + this.account = data.sn + } + }) + } } } diff --git a/pages/publish/publishTransfer/publishTransfer.vue b/pages/publish/publishTransfer/publishTransfer.vue index 05c6906..222cba0 100644 --- a/pages/publish/publishTransfer/publishTransfer.vue +++ b/pages/publish/publishTransfer/publishTransfer.vue @@ -2,8 +2,8 @@ - - 发布房源图片({{ShopInfomation.count}}/5) + + 发布房源图片(0/5) @@ -19,45 +19,45 @@ - - + - - {{form.trade}} + + {{form.business}} 请选择店铺行业 + v-model="form.business" @confirm="tradeConfirm"> - - {{form.karma}} + + {{form.commercial}} 请选择店铺业态 + v-model="form.commercial" @confirm="karmaConfirm"> - - + + - - + + - - + + - - + + - - + + @@ -72,25 +72,23 @@ data() { return { regionColumns: [JSON.parse(uni.getStorageSync('regionList'))] || [], - ShopInfomation: { - city: '', - area: '', - count: 0, - - }, form: { title: '', region: '', - place: '', - trade: '', - karma: '', - size: '', + address: '', + business: '', + commercial: '', + area: '', rent: '', - sell: '', - name: '', - call: '', - introduce: '' + transferFee: '', + mobile: '', + content: '', + images:[], + longitude:'', + latitude:'', + id:'', + }, Classcolumns: [], ClassCheckId:'', @@ -105,37 +103,37 @@ message: '请输入标题', trigger: ['change', 'blur'] }], - 'trade': [{ + 'business': [{ required: true, message: '请选择行业', - trigger: ['change', 'blur'] + trigger: ['change'] }], 'region': [{ required: true, message: '请选择地区', - trigger: ['change', 'blur'] + trigger: ['change'] }], - 'karma': [{ + 'commercial': [{ required: true, message: '请选择业态', - trigger: ['change', 'blur'] + trigger: ['change'] }], - 'name': [{ + 'contact': [{ required: true, message: '请输入姓名', trigger: ['change', 'blur'] }], - 'sell': [{ + 'transferFee': [{ required: true, message: '请输入转让金', trigger: ['change', 'blur'] }], - 'introduce': [{ + 'content': [{ required: true, message: '请输入介绍', trigger: ['change', 'blur'] }], - 'size': [{ + 'area': [{ required: true, message: '请输入面积', trigger: ['change', 'blur'] @@ -145,12 +143,12 @@ message: '请输入租金', trigger: ['change', 'blur'] }], - 'place': [{ + 'address': [{ required: true, message: '请输入地址', trigger: ['change', 'blur'] }], - 'call':[{ + 'mobile':[{ required: true, message: '请输入电话号码', }, @@ -179,7 +177,9 @@ this.$refs.uForm.validate().then(res => { console.log("提交表单信息:" + JSON.stringify(this.form)) uni.$u.toast('发布成功') - // 调用服务端入表接口W + this.$api.publishTransfer(this.form).then(res => { + console.log(res); + }) }).catch(errors => { console.log("失败信息:" + JSON.stringify(errors)) // uni.$u.toast('校验失败') @@ -196,8 +196,10 @@ that.$api.key, success(res) { console.log('diz', res.data.result.location); - console.log('lat', res.data.result.location.lat); - console.log('lng', res.data.result.location.lng); + // console.log('lat', res.data.result.location.lat); + that.form.latitude = res.data.result.location.lat + // console.log('lng', res.data.result.location.lng); + that.form.longitude = res.data.result.location.lng }, fail(err) { console.log('请求区域失败:', err); @@ -206,7 +208,7 @@ }, tradeConfirm(e){ this.show2 = false - this.form.trade = e.value[0] + this.form.business = e.value[0] this.ClassCheckId = this.pid[e.indexs[0]] this.$api.getClassList(this.ClassCheckId).then(res => { // console.log(res); @@ -217,7 +219,7 @@ }, karmaConfirm(e){ this.show3 = false - this.form.karma = e.value[0] + this.form.commercial = e.value[0] }, regionConfirm(e){ this.show1 = false diff --git a/service/request.js b/service/request.js index 727a26b..d122fbb 100644 --- a/service/request.js +++ b/service/request.js @@ -1,5 +1,4 @@ const serverHost = 'https://spsp.feashow.com/api' //http://xx.xxx.xx - const service = { get(url, data) { const header = {} @@ -253,7 +252,14 @@ const apiService = { return new Promise((resolve,reject) => { resolve(service.get(url)) }) - } + }, + //发布店铺转让 + publishTransfer(data){ + const url = `/shop/transfer/` + return new Promise((resolve, reject) => { + resolve(service.post(url, data)) + }) + }, } export { apiService,