diff --git a/components/InputAndSwiper/InputAndSwiper.vue b/components/InputAndSwiper/InputAndSwiper.vue index 0b1ba5f..478d6b2 100644 --- a/components/InputAndSwiper/InputAndSwiper.vue +++ b/components/InputAndSwiper/InputAndSwiper.vue @@ -13,7 +13,8 @@ - + @@ -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.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/detail/detail.vue b/pages/detail/detail.vue index 0c2aef0..2089b20 100644 --- a/pages/detail/detail.vue +++ b/pages/detail/detail.vue @@ -1,175 +1,215 @@ + + + .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..b3583a0 100644 --- a/pages/my/my.vue +++ b/pages/my/my.vue @@ -4,11 +4,13 @@ - + {{username}} - - + + @@ -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,6 @@ return } this.isLoad = true - this.$data.account = wx.getStorageSync('account') - this.$data.username = wx.getStorageSync('nickname') }, methods: { reOnLoad() { @@ -65,6 +65,9 @@ return } this.isLoad = true + if(this.isLoad){ + this.getInfo() + } }, failToLoad() { uni.reLaunch({ @@ -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 => { + var data = res.data.data + if (data) { + this.src = this.$api.imgUrl + data.avatar + this.username = data.nickname + this.account = data.sn + } }) } - //---------页面调用接口示例------------ - // 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/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 a868970..05c6906 100644 --- a/pages/publish/publishTransfer/publishTransfer.vue +++ b/pages/publish/publishTransfer/publishTransfer.vue @@ -10,32 +10,36 @@ - 请选择所属区域 + {{form.region}} + 请选择所属区域 + - + + v-model="form.region" @confirm="regionConfirm"> - - 请选择行业类型 + + {{form.trade}} + 请选择店铺行业 - + - + - 请选择行业业态 + {{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: '', @@ -88,9 +92,10 @@ call: '', introduce: '' }, - columns: [ - - ], + Classcolumns: [], + ClassCheckId:'', + Karmacolumns: [], + pid:[], show1: false, show2: false, show3: false, @@ -181,8 +186,8 @@ }) }, changeAddress(e) { - console.log('changeAddress', e); - // this.getAddressList(e) + // console.log('changeAddress', e); + this.getAddressList(e) }, getAddressList(value) { var that = this @@ -199,9 +204,49 @@ } }) }, + 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; + } } } @@ -250,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; diff --git a/service/request.js b/service/request.js index 1973f88..c41bcba 100644 --- a/service/request.js +++ b/service/request.js @@ -1,4 +1,4 @@ -const serverHost = 'https://spsp.feashow.com/api/' //http://xx.xxx.xx +const serverHost = 'https://spsp.feashow.com/api' //http://xx.xxx.xx const service = { get(url, data) { @@ -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' @@ -160,10 +160,10 @@ const apiService = { }) }, // 获取详情 - getProductDetail(id) { - const url = `/home/pdetail/?productId=${id}` + getShopDetail(type,id) { + const url = `/home/adetail/?type=${type}&id=${id}` return new Promise((resolve, reject) => { - resolve(service.get(url, id)) + resolve(service.get(url)) }) }, //修改 @@ -211,24 +211,31 @@ const apiService = { resolve(service.get(url)) }) }, + //获取个人信息 + getUser() { + const url = '/center/userinfo' + return new Promise((resolve, reject) => { + resolve(service.get(url)) + }) + }, //修改个人信息 - editPersonInfo(data){ - const url = `center/userupdate` - return new Promise((resolve,reject) => { - resolve(service.putWithFormData(url,data)) + editPersonInfo(data) { + const url = `/center/userupdate` + 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)) }) }, diff --git a/static/shoplist/service.png b/static/shoplist/service.png new file mode 100644 index 0000000..86c4b6b Binary files /dev/null and b/static/shoplist/service.png differ diff --git a/static/shoplist/share.png b/static/shoplist/share.png new file mode 100644 index 0000000..780dd85 Binary files /dev/null and b/static/shoplist/share.png differ