From b07248d07b07f99b830f2d70e5526a73d2684012 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=93=E6=B4=81?= <209192278@qq.com> Date: Thu, 16 Nov 2023 21:42:01 +0800 Subject: [PATCH 1/7] =?UTF-8?q?=E9=82=93=E6=B4=81=20:=20=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E4=B8=AA=E4=BA=BA=E4=BF=A1=E6=81=AF=E6=8E=A5=E5=8F=A3=E5=AF=B9?= =?UTF-8?q?=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages.json | 20 +++---- pages/my/edit/edit.vue | 133 ++++++++++++++++++++++++++++++++--------- pages/my/my.vue | 41 +++++++------ service/request.js | 25 +++++--- 4 files changed, 155 insertions(+), 64 deletions(-) diff --git a/pages.json b/pages.json index 31eb97f..8e4147a 100644 --- a/pages.json +++ b/pages.json @@ -172,17 +172,17 @@ "navigationBarTitleText": "", "enablePullDownRefresh": false } + }, { + "path": "pages/my/edit/edit", + "style": { + "navigationBarTitleText": "修改个人信息", + "navigationBarTextStyle": "white", + "navigationBarBackgroundColor": "#339967", + "enablePullDownRefresh": false + } + } - ,{ - "path" : "pages/my/edit/edit", - "style" : - { - "navigationBarTitleText": "修改个人信息", - "enablePullDownRefresh": false - } - - } - ], + ], "tabBar": { "color": "#CCCCCC", "borderStyle": "white", diff --git a/pages/my/edit/edit.vue b/pages/my/edit/edit.vue index f448e44..fa9a520 100644 --- a/pages/my/edit/edit.vue +++ b/pages/my/edit/edit.vue @@ -1,69 +1,146 @@ - + + + .u-button { + width: 644rpx !important; + height: 86rpx !important; + background: #0EBB5B; + border-radius: 20rpx !important; + } + \ No newline at end of file diff --git a/pages/my/my.vue b/pages/my/my.vue index bbb5e5d..81bd79b 100644 --- a/pages/my/my.vue +++ b/pages/my/my.vue @@ -7,8 +7,10 @@ {{username}} - 账号:{{account}} - + 账号:{{account}} + + + @@ -43,8 +45,8 @@ data() { return { src: 'https://cdn.uviewui.com/uview/album/2.jpg', - account: '', - username: '', + account: '123', + username: '用户名', isLoad: true } }, @@ -54,8 +56,9 @@ return } this.isLoad = true - this.$data.account = wx.getStorageSync('account') - this.$data.username = wx.getStorageSync('nickname') + // this.$data.account = wx.getStorageSync('account') + // this.$data.username = wx.getStorageSync('nickname') + this.getInfo() }, methods: { reOnLoad() { @@ -86,17 +89,22 @@ url: '/pages/Partnerships/Partnerships' }) }, - toEdit(){ + toEdit() { uni.navigateTo({ - url:'/pages/my/edit/edit' + url: '/pages/my/edit/edit' + }) + }, + //---------页面调用接口示例------------ + getInfo() { + this.$api.getUser().then(res => { + console.log('userInfo', res); + var data = res.data.data + if (data) { + this.src = uni.getStorageSync('img_url') + data.avatar + this.username = data.nickname + } }) } - //---------页面调用接口示例------------ - // getInfo() { - // this.$api.getUserInfo().then(res => { - // console.log('userInfo', res); - // }) - // } } } @@ -134,9 +142,8 @@ font-weight: 1rpx; display: flex; } - .edit-icon{ - - } + + .edit-icon {} } \ No newline at end of file diff --git a/service/request.js b/service/request.js index a83e178..b1d58ab 100644 --- a/service/request.js +++ b/service/request.js @@ -130,7 +130,7 @@ const apiService = { serverHost, imgUrl: 'https://spsp.feashow.com/', key: 'ZRKBZ-Q7FWL-GVZPK-MCRBU-4XFB5-ATBDB', - uploadImgUrl: serverHost + `/upload/image/`, + uploadImgUrl: serverHost + '/upload/image/', //登录接口 login(data) { const url = '/login/mnpLogin' @@ -211,27 +211,34 @@ const apiService = { resolve(service.get(url)) }) }, + //获取个人信息 + getUser() { + const url = '/center/userinfo' + return new Promise((resolve, reject) => { + resolve(service.get(url)) + }) + }, //修改个人信息 - editPersonInfo(data){ + editPersonInfo(data) { const url = `center/userupdate` - return new Promise((resolve,reject) => { - resolve(service.putWithFormData(url,data)) + return new Promise((resolve, reject) => { + resolve(service.post(url, data)) }) }, //获取我的匹配 - getMyMatch(){ + getMyMatch() { const url = `/center/match/` - return new Promise((resolve,reject) => { + return new Promise((resolve, reject) => { resolve(service.get(url)) }) }, //获取行业和业态 - getClassList(pid){ + getClassList(pid) { const url = `/home/classlist/?pid=${pid}` - return new Promise((resolve,reject) => { + return new Promise((resolve, reject) => { resolve(service.post(url)) }) - } + }, } export { apiService, From dc57ab9ade1a8e904b47243258b7f280ca7c279f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=93=E6=B4=81?= <209192278@qq.com> Date: Thu, 16 Nov 2023 21:44:31 +0800 Subject: [PATCH 2/7] =?UTF-8?q?=E9=82=93=E6=B4=81=20:=20=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E5=A4=B4=E5=83=8F=E5=A4=A7=E5=B0=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/my/my.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/my/my.vue b/pages/my/my.vue index 81bd79b..32beca2 100644 --- a/pages/my/my.vue +++ b/pages/my/my.vue @@ -4,7 +4,7 @@ - + {{username}} - + @@ -38,19 +39,23 @@ }, data() { return { - position: uni.getStorageSync('city')+uni.getStorageSync('district').slice(0, 2) + position: uni.getStorageSync('city') + uni.getStorageSync('district').slice(0, 2), + currentNum: '' }; }, options: { styleIsolation: 'shared', // 解除样式隔离 }, created() { - if (this.type !== '0') { - // this.open() - } }, methods: { - + //点击轮播图 + handleSwiperList(currentNum, bannerURL) { + const item=bannerURL[currentNum] + uni.navigateTo({ + url: item.link+`?id=${item.param}&type=${item.type}` + }) + }, } } diff --git a/pages/detail/detail.vue b/pages/detail/detail.vue index 0c2aef0..9a909d1 100644 --- a/pages/detail/detail.vue +++ b/pages/detail/detail.vue @@ -94,9 +94,9 @@ }, data() { return { - shopInfo:{ + // shopInfo:{ - } + // } } }, @@ -112,9 +112,17 @@ } }, onLoad: function(options) { - const shopInfomation = JSON.parse(decodeURIComponent(options.shopInfo)) - console.log(shopInfomation); - this.shopInfo = shopInfomation + // const shopInfomation = JSON.parse(decodeURIComponent(options.shopInfo)) + // console.log(shopInfomation); + // this.shopInfo = shopInfomation + console.log('detail',options); + //点击轮播图跳转详情, 传递的参数id, type + if(options.id){ + + } + if(options.type){ + + } } } diff --git a/pages/index/index.vue b/pages/index/index.vue index bb38c7c..4d6255d 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -55,7 +55,11 @@ methods: { getBanner() { this.$api.getBanner().then(res => { - this.swiperList = res.data.data.map(item => this.$api.imgUrl + item.img) + res.data.data.forEach(item=>{ + item.img =this.$api.imgUrl + item.img + }) + this.swiperList = res.data.data + // .map(item => this.$api.imgUrl + item.img) }) }, getNotice() { From 789dc3c1fbc039dffd02d4ee9ff70ed5b9e47da5 Mon Sep 17 00:00:00 2001 From: dengj <209192278@qq.com> Date: Fri, 17 Nov 2023 17:51:22 +0800 Subject: [PATCH 6/7] =?UTF-8?q?=E9=82=93=E6=B4=81=20:=20=E8=AF=A6=E6=83=85?= =?UTF-8?q?=E7=95=8C=E9=9D=A2=E5=8F=8A=E6=8E=A5=E5=8F=A3=E5=AF=B9=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/detail/detail.vue | 252 ++++++++++++++++++++---------------- service/request.js | 10 +- static/shoplist/service.png | Bin 0 -> 5221 bytes static/shoplist/share.png | Bin 0 -> 4237 bytes 4 files changed, 146 insertions(+), 116 deletions(-) create mode 100644 static/shoplist/service.png create mode 100644 static/shoplist/share.png diff --git a/pages/detail/detail.vue b/pages/detail/detail.vue index 9a909d1..2089b20 100644 --- a/pages/detail/detail.vue +++ b/pages/detail/detail.vue @@ -1,183 +1,215 @@ + \ 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;