From 95d2903e300eacc0b4038686324369e910f471fa Mon Sep 17 00:00:00 2001 From: hot777zz <912275990@qq.com> Date: Fri, 17 Nov 2023 18:06:25 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A2=81=E8=88=AA=EF=BC=9A=E5=8F=91=E5=B8=83?= =?UTF-8?q?=E9=A1=B5=E4=BF=A1=E6=81=AF=E6=95=B4=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../publish/publishAddress/publishAddress.vue | 310 ++++++++++++----- .../publishInvestment/publishInvestment.vue | 328 +++++++++++++----- pages/publish/publishRent/publishRent.vue | 160 +++++++-- .../publishTransfer/publishTransfer.vue | 39 ++- 4 files changed, 640 insertions(+), 197 deletions(-) diff --git a/pages/publish/publishAddress/publishAddress.vue b/pages/publish/publishAddress/publishAddress.vue index edb7c1f..309985f 100644 --- a/pages/publish/publishAddress/publishAddress.vue +++ b/pages/publish/publishAddress/publishAddress.vue @@ -1,46 +1,60 @@ @@ -48,53 +62,183 @@ export default { data() { return { - regionColumns:[JSON.parse(uni.getStorageSync('regionList'))]||[], - ShopInfomation:{ - city:'', - area:'', - count:0, - + regionColumns: [JSON.parse(uni.getStorageSync('regionList'))] || [], + ShopInfomation: { + city: '', + area: '', + count: 0, + }, - - form:{ - title:'' + + form: { + title: '', + region: '', + place: '', + trade: '', + karma: '', + size: '', + rent: '', + sell: '', + name: '', + call: '', + introduce: '' + }, + Classcolumns: [], + ClassCheckId:'', + Karmacolumns: [], + pid:[], + show1: false, + show2: false, + show3: false, + rules: { + 'title': [{ + required: true, + message: '请输入标题', + trigger: ['change', 'blur'] + }], + 'trade': [{ + required: true, + message: '请选择行业', + trigger: ['change', 'blur'] + }], + 'region': [{ + required: true, + message: '请选择地区', + trigger: ['change', 'blur'] + }], + 'karma': [{ + required: true, + message: '请选择业态', + trigger: ['change', 'blur'] + }], + 'name': [{ + required: true, + message: '请输入姓名', + trigger: ['change', 'blur'] + }], + 'sell': [{ + required: true, + message: '请输入转让金', + trigger: ['change', 'blur'] + }], + 'introduce': [{ + required: true, + message: '请输入介绍', + trigger: ['change', 'blur'] + }], + 'size': [{ + required: true, + message: '请输入面积', + trigger: ['change', 'blur'] + }], + 'rent': [{ + required: true, + message: '请输入租金', + trigger: ['change', 'blur'] + }], + 'place': [{ + required: true, + message: '请输入地址', + trigger: ['change', 'blur'] + }], + 'call':[{ + required: true, + message: '请输入电话号码', + }, + { + validator: (rule, value, callback) => { + if(value) { + return this.$u.test.mobile(value); + } else { + return true + } + }, + message: '号码不正确', + trigger: ['change','blur'], + }] + }, - columns:[ - ], - show1:false, - show2:false, - show3:false, } - }, methods: { - confirmArea(e) { - this.ShopInfomation.city = e.value[0] - this.ShopInfomation.area = e.value[1] - this.show1 = false - }, - submit(){ - console.log('提交'); + handleSearchAddress() { + uni.navigateTo({ + url: '/pages/publish/chooseAddress/chooseAddress' + }) + }, + submit() { + this.$refs.uForm.validate().then(res => { + console.log("提交表单信息:" + JSON.stringify(this.form)) + uni.$u.toast('发布成功') + // 调用服务端入表接口W + }).catch(errors => { + console.log("失败信息:" + JSON.stringify(errors)) + // uni.$u.toast('校验失败') + }) + }, + tradeConfirm(e){ + this.show2 = false + this.form.trade = e.value[0] + this.ClassCheckId = this.pid[e.indexs[0]] + this.$api.getClassList(this.ClassCheckId).then(res => { + // console.log(res); + this.Karmacolumns = res.data.data.map((item) => { + return item = item.name + }) + }) + }, + karmaConfirm(e){ + this.show3 = false + this.form.karma = e.value[0] + }, + regionConfirm(e){ + this.show1 = false + this.form.region = e.value[0] + }, + }, + onReady() { + this.$refs.uForm.setRules(this.rules) + + }, + onLoad() { + this.$api.getClassList().then(res =>{ + // console.log(res.data.data.length); + this.Classcolumns = res.data.data.map((item) => { + return item = item.name + }) + this.pid = res.data.data.map((item) => { + return item = item.id + }) + + }) + }, + computed:{ + isChecked(index){ + if(index.length > 0) + return true; + else + return false; } } } + \ No newline at end of file diff --git a/pages/publish/publishInvestment/publishInvestment.vue b/pages/publish/publishInvestment/publishInvestment.vue index 81cfadd..6160647 100644 --- a/pages/publish/publishInvestment/publishInvestment.vue +++ b/pages/publish/publishInvestment/publishInvestment.vue @@ -3,50 +3,57 @@ - 发布项目图片({{ShopInfomation.count}}/5) + 发布房源图片({{ShopInfomation.count}}/5) + + + + + + + + {{form.region}} + 请选择所属区域 - - - - - 请选择所属区域 - - - - - - - - - - 请选择行业类型 - - - - - - - 请选择行业业态 - - - - - - - - - - - - - - - - - - 发布 - + + + + + + + {{form.trade}} + 请选择行业 + + + + + + + {{form.karma}} + 请选择业态 + + + + + + + + + + + + + + + + + 发布 + @@ -54,53 +61,202 @@ export default { data() { return { - regionColumns:[JSON.parse(uni.getStorageSync('regionList'))]||[], - ShopInfomation:{ - city:'', - area:'', - count:0, - + regionColumns: [JSON.parse(uni.getStorageSync('regionList'))] || [], + ShopInfomation: { + city: '', + area: '', + count: 0, + }, - - form:{ - title:'' + + form: { + title: '', + region: '', + place: '', + trade: '', + karma: '', + size: '', + rent: '', + sell: '', + name: '', + call: '', + introduce: '' + }, + Classcolumns: [], + ClassCheckId:'', + Karmacolumns: [], + pid:[], + show1: false, + show2: false, + show3: false, + rules: { + 'title': [{ + required: true, + message: '请输入标题', + trigger: ['change', 'blur'] + }], + 'trade': [{ + required: true, + message: '请选择行业', + trigger: ['change', 'blur'] + }], + 'region': [{ + required: true, + message: '请选择地区', + trigger: ['change', 'blur'] + }], + 'karma': [{ + required: true, + message: '请选择业态', + trigger: ['change', 'blur'] + }], + 'name': [{ + required: true, + message: '请输入姓名', + trigger: ['change', 'blur'] + }], + 'sell': [{ + required: true, + message: '请输入转让金', + trigger: ['change', 'blur'] + }], + 'introduce': [{ + required: true, + message: '请输入介绍', + trigger: ['change', 'blur'] + }], + 'size': [{ + required: true, + message: '请输入面积', + trigger: ['change', 'blur'] + }], + 'rent': [{ + required: true, + message: '请输入租金', + trigger: ['change', 'blur'] + }], + 'place': [{ + required: true, + message: '请输入地址', + trigger: ['change', 'blur'] + }], + 'call':[{ + required: true, + message: '请输入电话号码', + }, + { + validator: (rule, value, callback) => { + if(value) { + return this.$u.test.mobile(value); + } else { + return true + } + }, + message: '号码不正确', + trigger: ['change','blur'], + }] + }, - columns:[ - ], - show1:false, - show2:false, - show3:false, } - }, methods: { - confirmArea(e) { - this.ShopInfomation.city = e.value[0] - this.ShopInfomation.area = e.value[1] - this.show1 = false - }, - submit(){ - console.log('提交'); + handleSearchAddress() { + uni.navigateTo({ + url: '/pages/publish/chooseAddress/chooseAddress' + }) + }, + changeAddress(e) { + // console.log('changeAddress', e); + this.getAddressList(e) + }, + getAddressList(value) { + var that = this + uni.request({ + url: 'https://apis.map.qq.com/ws/geocoder/v1/?address=' + value + '&key=' + + 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); + }, + fail(err) { + console.log('请求区域失败:', err); + } + }) + }, + submit() { + this.$refs.uForm.validate().then(res => { + console.log("提交表单信息:" + JSON.stringify(this.form)) + uni.$u.toast('发布成功') + // 调用服务端入表接口W + }).catch(errors => { + console.log("失败信息:" + JSON.stringify(errors)) + // uni.$u.toast('校验失败') + }) + }, + tradeConfirm(e){ + this.show2 = false + this.form.trade = e.value[0] + this.ClassCheckId = this.pid[e.indexs[0]] + this.$api.getClassList(this.ClassCheckId).then(res => { + // console.log(res); + this.Karmacolumns = res.data.data.map((item) => { + return item = item.name + }) + }) + }, + karmaConfirm(e){ + this.show3 = false + this.form.karma = e.value[0] + }, + regionConfirm(e){ + this.show1 = false + this.form.region = e.value[0] + }, + }, + onReady() { + this.$refs.uForm.setRules(this.rules) + + }, + onLoad() { + this.$api.getClassList().then(res =>{ + // console.log(res.data.data.length); + this.Classcolumns = res.data.data.map((item) => { + return item = item.name + }) + this.pid = res.data.data.map((item) => { + return item = item.id + }) + + }) + }, + computed:{ + isChecked(index){ + if(index.length > 0) + return true; + else + return false; } } } + \ No newline at end of file diff --git a/pages/publish/publishRent/publishRent.vue b/pages/publish/publishRent/publishRent.vue index 425d647..6670fde 100644 --- a/pages/publish/publishRent/publishRent.vue +++ b/pages/publish/publishRent/publishRent.vue @@ -6,40 +6,45 @@ 发布店铺图片({{ShopInfomation.count}}/5) - - + + - - 请选择所属区域 + + {{form.region}} + 请选择所属区域 + - + - + - - + + - - 请选择行业类型 + + {{form.trade}} + 请选择店铺行业 - + - + - - + + - - + + - - + + - + - - + + @@ -60,14 +65,79 @@ }, - form:{ - title:'' + form: { + title: '', + region: '', + place: '', + trade: '', + size: '', + rent: '', + name: '', + call: '', + introduce: '' }, - columns:[ - ], + Classcolumns:[], show1:false, show2:false, show3:false, + rules: { + 'title': [{ + required: true, + message: '请输入标题', + trigger: ['change', 'blur'] + }], + 'trade': [{ + required: true, + message: '请选择行业', + trigger: ['change', 'blur'] + }], + 'region': [{ + required: true, + message: '请选择地区', + trigger: ['change', 'blur'] + }], + 'name': [{ + required: true, + message: '请输入姓名', + trigger: ['change', 'blur'] + }], + 'introduce': [{ + required: true, + message: '请输入介绍', + trigger: ['change', 'blur'] + }], + 'size': [{ + required: true, + message: '请输入面积', + trigger: ['change', 'blur'] + }], + 'rent': [{ + required: true, + message: '请输入租金', + trigger: ['change', 'blur'] + }], + 'place': [{ + required: true, + message: '请输入地址', + trigger: ['change', 'blur'] + }], + 'call':[{ + required: true, + message: '请输入电话号码', + }, + { + validator: (rule, value, callback) => { + if(value) { + return this.$u.test.mobile(value); + } else { + return true + } + }, + message: '号码不正确', + trigger: ['change','blur'], + }] + + }, } }, @@ -77,10 +147,37 @@ this.ShopInfomation.area = e.value[1] this.show1 = false }, - submit(){ - console.log('提交'); + submit() { + this.$refs.uForm.validate().then(res => { + console.log("提交表单信息:" + JSON.stringify(this.form)) + uni.$u.toast('发布成功') + // 调用服务端入表接口W + }).catch(errors => { + console.log("失败信息:" + JSON.stringify(errors)) + // uni.$u.toast('校验失败') + }) + }, + tradeConfirm(e){ + this.show2 = false + this.form.trade = e.value[0] + }, + regionConfirm(e){ + this.show1 = false + this.form.region = e.value[0] } - } + }, + onLoad() { + this.$api.getClassList().then(res =>{ + // console.log(res.data.data.length); + this.Classcolumns = res.data.data.map((item) => { + return item = item.name + }) + }) + }, + onReady() { + this.$refs.uForm.setRules(this.rules) + + }, } @@ -123,7 +220,12 @@ font-weight:1px; color: #c1c4c7; } - + .checkedtext{ + margin-top: 5rpx; + font-size: 28rpx; + font-weight: 1px; + border-style: none; + } .picker{ display: flex; justify-content: space-between; diff --git a/pages/publish/publishTransfer/publishTransfer.vue b/pages/publish/publishTransfer/publishTransfer.vue index 07a75a4..05c6906 100644 --- a/pages/publish/publishTransfer/publishTransfer.vue +++ b/pages/publish/publishTransfer/publishTransfer.vue @@ -10,19 +10,22 @@ - 请选择所属区域 + {{form.region}} + 请选择所属区域 + + v-model="form.region" @confirm="regionConfirm"> - {{form.trade}} + {{form.trade}} + 请选择店铺行业 @@ -30,7 +33,8 @@ v-model="form.trade" @confirm="tradeConfirm"> - {{form.karma}} + {{form.karma}} + 请选择店铺业态 @@ -67,7 +71,7 @@ export default { data() { return { - // regionColumns: [JSON.parse(uni.getStorageSync('regionList'))] || [], + regionColumns: [JSON.parse(uni.getStorageSync('regionList'))] || [], ShopInfomation: { city: '', area: '', @@ -79,8 +83,8 @@ title: '', region: '', place: '', - trade: '请选择行业', - karma: '请选择业态', + trade: '', + karma: '', size: '', rent: '', sell: '', @@ -214,7 +218,11 @@ karmaConfirm(e){ this.show3 = false this.form.karma = e.value[0] - } + }, + regionConfirm(e){ + this.show1 = false + this.form.region = e.value[0] + }, }, onReady() { this.$refs.uForm.setRules(this.rules) @@ -231,6 +239,14 @@ }) }) + }, + computed:{ + isChecked(index){ + if(index.length > 0) + return true; + else + return false; + } } } @@ -279,7 +295,12 @@ font-weight: 1px; color: #c1c4c7; } - + .checkedtext{ + margin-top: 5rpx; + font-size: 28rpx; + font-weight: 1px; + border-style: none; + } .picker { display: flex; justify-content: space-between;