diff --git a/pages/Partnerships/Partnerships.vue b/pages/Partnerships/Partnerships.vue
index e9c6783..b2a9373 100644
--- a/pages/Partnerships/Partnerships.vue
+++ b/pages/Partnerships/Partnerships.vue
@@ -1,90 +1,189 @@
-
+<
-
-
- 名称
-
-
-
- 身份证号
-
-
-
-
-
- 支付信息
- 请选择支付方式
-
-
-
-
-
-
-
-
- 提交审核
+
+
+ 名称
+
+
+
+ 身份证号
+
+
-
+
+
+ 已是合伙人
+
+
+
+ {{btnText}}
+
+
+
+
-
+
\ No newline at end of file
diff --git a/pages/detail/detail.vue b/pages/detail/detail.vue
index 2089b20..d7703ad 100644
--- a/pages/detail/detail.vue
+++ b/pages/detail/detail.vue
@@ -1,7 +1,7 @@
-
+
@@ -100,7 +100,17 @@
this.$api.getShopDetail(type, id).then(res => {
const data = res.data.data
if (res.data.code == 1) {
- data.pics = [this.$api.imgUrl + data.pics]
+ console.log('data.pics', data.pics);
+ var arr = [];
+ var arr1 = [];
+ let obj = {}
+ arr = data.pics.split(",")
+ arr.map(item => {
+ obj = this.$api.imgUrl + item
+ arr1.push(obj)
+ })
+ data.pics = arr1
+ console.log('arr', arr1);
this.shopInfo = data
}
})
diff --git a/pages/index/map/map.vue b/pages/index/map/map.vue
index d77f9d3..e3b429b 100644
--- a/pages/index/map/map.vue
+++ b/pages/index/map/map.vue
@@ -8,12 +8,12 @@
-->
-
+
-
+
@@ -22,6 +22,7 @@
data() {
return {
radius: '',
+ showShop: false,
scaleM: [{
scale: 3,
milo: 1000000
@@ -82,29 +83,40 @@
}
],
scale: '',
- lat: '30.48772', //纬度
- lng: '104.080145', //经度
- marker: [{ //用户当前位置
- id: 1,
- latitude: 30.48772,
- longitude: 104.080145,
- iconPath: '../../../static/map/sp_icon_dw.png',
- width: '58rpx',
- height: '72rpx',
- rotate: 0,
- alpha: 1
- },
- //周围标记点
- {
- id: 2,
- latitude: 30.488573,
- longitude: 104.081248,
- // iconPath: '../../../static/map/sp_icon_dw.png',
- width: '58rpx',
- height: '72rpx',
- rotate: 0,
- alpha: 1
- }
+ lat: uni.getStorageSync('latitude'), //纬度
+ lng: uni.getStorageSync('longitude'), //经度
+ marker: [
+ // { //用户当前位置
+ // id: 1,
+ // latitude: uni.getStorageSync('latitude'),
+ // longitude: uni.getStorageSync('longitude'),
+ // // iconPath: '../../../static/map/sp_icon_hdw.png',
+ // width: '58rpx',
+ // height: '72rpx',
+ // rotate: 0,
+ // alpha: 1
+ // },
+ // { //用户当前位置
+ // id: 2,
+ // latitude: 30.48772,
+ // longitude: 104.080145,
+ // iconPath: '../../../static/map/sp_icon_dw.png',
+ // width: '58rpx',
+ // height: '72rpx',
+ // rotate: 0,
+ // alpha: 1
+ // },
+ // //周围标记点
+ // {
+ // id: 2,
+ // latitude: 30.488573,
+ // longitude: 104.081248,
+ // // iconPath: '../../../static/map/sp_icon_dw.png',
+ // width: '58rpx',
+ // height: '72rpx',
+ // rotate: 0,
+ // alpha: 1
+ // }
],
shopList: {
shopid: 1,
@@ -149,9 +161,10 @@
},
watch: {
scale(newVal, oldVal) {
- console.log('thisscale',newVal, Math.round(newVal));
- let ra=''
- this.scaleM.forEach(item => {
+ console.log('thisscale', newVal, Math.round(newVal));
+ this.showShop = false
+ let ra = ''
+ this.scaleM.forEach(item => {
if (item.scale == Math.round(newVal)) {
ra = item.milo
}
@@ -168,35 +181,63 @@
}
},
created() {
- this.getMapList()
+ // this.getMapList()
},
methods: {
+ getDetail(type, id) {
+ this.$api.getShopDetail(type, id).then(res => {
+ console.log('详情', res);
+ const data = res.data.data
+ if (res.data.code == 1) {
+ this.shopList = data
+ // {
+ // shopid: 1,
+ // pics: this.$api.imgUrl + data.pics,
+ // tt: data.tt,
+ // num: data.num,
+ // zujin: data.zujin,
+ // date: data.update_time,
+ // area1: data.area1,
+ // address: data.address,
+ // mianji: data.mianji,
+ // zhuanrangfei: "转让费:" + data.zhuanrangfei,
+ // trade: data.trade,
+ // lianxiren: data.lianxiren,
+ // mobile: data.mobile,
+ // }
+ // data.pics = [this.$api.imgUrl + data.pics]
+ // this.shopInfo = data
+ }
+ })
+ },
handleRegionChange(e) {
console.log('地图缩放层级变化, 只能监听拖拽, 不能监听缩放', e);
},
getMapList(radius) {
- console.log('this.radius',radius);
+ console.log('longitude', uni.getStorageSync('longitude'));
+ console.log('latitude', uni.getStorageSync('latitude'));
const realData = {
longitude: uni.getStorageSync('longitude'),
latitude: uni.getStorageSync('latitude'),
- radius: 100
+ radius: radius * 1000
}
+ console.log('realData.radius', realData.radius);
const mockData = {
longitude: 23.40,
latitude: 116.38,
radius: 1111111111
}
- this.$api.getMap(mockData).then(res => {
+ this.$api.getMap(realData).then(res => {
console.log('getMap', res);
let obj = {}
let arr = []
- if (res.statusCode === 200) {
+ if (res.data.code == 1) {
res.data.data.forEach(item => {
obj = {
id: parseInt(item.id),
latitude: item.lat,
longitude: item.lng,
- // iconPath: '../../../static/map/sp_icon_dw.png',
+ iconPath: '../../../static/map/sp_icon_dw.png',
width: '58rpx',
height: '72rpx',
rotate: 0,
@@ -204,7 +245,18 @@
}
arr.push(obj)
})
- // this.marker=arr
+ this.marker = [{ //用户当前位置
+ id: 1,
+ latitude: realData.latitude,
+ longitude: realData.longitude,
+ iconPath: '../../../static/map/sp_icon_hdw.png',
+ width: '58rpx',
+ height: '72rpx',
+ rotate: 0,
+ alpha: 1
+ },
+ ...arr,
+ ]
console.log('this.marker', this.marker);
}
})
@@ -212,12 +264,20 @@
// 图标点击
markerClick(e) {
console.log('标记点击', e);
+ this.showShop = true
let markerId = e.markerId; //点击标记点, 获取id, 查询店铺详情, 展示在下方
+ this.getDetail(1, markerId)
this.marker.forEach(item => {
if (markerId === item.id) {
- item.iconPath = ""
+ console.log('变红');
+ item.iconPath = "../../../static/map/sp_icon_hdw.png"
+ item.width = '58rpx'
+ item.height = '72rpx'
} else {
+ console.log('变绿');
item.iconPath = "../../../static/map/sp_icon_dw.png"
+ item.width = '58rpx'
+ item.height = '72rpx'
}
})
},
diff --git a/pages/my/my.vue b/pages/my/my.vue
index b3583a0..c1392e8 100644
--- a/pages/my/my.vue
+++ b/pages/my/my.vue
@@ -7,10 +7,11 @@
{{username}}
+
账号:{{account}}
-
@@ -45,8 +46,9 @@
data() {
return {
src: 'https://cdn.uviewui.com/uview/album/2.jpg',
- account: '123',
- username: '用户名',
+ account: '',
+ username: '',
+ member: '',
isLoad: true
}
},
@@ -56,6 +58,7 @@
return
}
this.isLoad = true
+ this.getInfo()
},
methods: {
reOnLoad() {
@@ -65,7 +68,7 @@
return
}
this.isLoad = true
- if(this.isLoad){
+ if (this.isLoad) {
this.getInfo()
}
},
@@ -101,7 +104,10 @@
if (data) {
this.src = this.$api.imgUrl + data.avatar
this.username = data.nickname
+ this.member = data.member
this.account = data.sn
+ uni.setStorageSync("uid", data.user_id)
+ uni.setStorageSync("member", data.member)
}
})
}
@@ -119,7 +125,7 @@
justify-content: center;
align-items: center;
flex-direction: column;
- gap: 10rpx;
+ // gap: 10rpx;
.profile-bgi {
position: absolute;
diff --git a/pages/publish/publishAddress/publishAddress.vue b/pages/publish/publishAddress/publishAddress.vue
index 309985f..7df2dc4 100644
--- a/pages/publish/publishAddress/publishAddress.vue
+++ b/pages/publish/publishAddress/publishAddress.vue
@@ -2,53 +2,59 @@
-
+
-
+
{{form.region}}
请选择所属区域
-
+
-
- {{form.trade}}
+
+ {{form.business}}
请选择行业
-
+
-
- {{form.karma}}
- 请选择业态
+
+ {{form.commercialForm}}
+ 请选择业态
-
+
-
+
-
-
+
+
+
+
+
-
+
-
-
+
+
-
-
+
+
-
-
-
-
-
+
+
@@ -62,31 +68,24 @@
export default {
data() {
return {
- regionColumns: [JSON.parse(uni.getStorageSync('regionList'))] || [],
- ShopInfomation: {
- city: '',
- area: '',
- count: 0,
-
- },
-
+ regionColumns: [],
form: {
title: '',
region: '',
- place: '',
- trade: '',
- karma: '',
- size: '',
+ business: '',
+ commercialForm: '',
+ area: '',
+ transferFee: '',
rent: '',
- sell: '',
- name: '',
- call: '',
- introduce: ''
+ contactPerson: '',
+ phone: '',
+ details: '',
+ id: '',
},
Classcolumns: [],
- ClassCheckId:'',
+ ClassCheckId: '',
Karmacolumns: [],
- pid:[],
+ pid: [],
show1: false,
show2: false,
show3: false,
@@ -96,37 +95,42 @@
message: '请输入标题',
trigger: ['change', 'blur']
}],
- 'trade': [{
+ 'business': [{
required: true,
message: '请选择行业',
- trigger: ['change', 'blur']
+ trigger: ['change']
}],
'region': [{
required: true,
message: '请选择地区',
- trigger: ['change', 'blur']
+ trigger: ['change']
}],
- 'karma': [{
+ 'commercialForm': [{
required: true,
message: '请选择业态',
- trigger: ['change', 'blur']
+ trigger: ['change']
}],
- 'name': [{
+ 'area': [{
required: true,
- message: '请输入姓名',
+ message: '请输入面积',
trigger: ['change', 'blur']
}],
- 'sell': [{
+ 'transferFee': [{
required: true,
message: '请输入转让金',
trigger: ['change', 'blur']
}],
- 'introduce': [{
+ 'contactPerson': [{
+ required: true,
+ message: '请输入姓名',
+ trigger: ['change', 'blur']
+ }],
+ 'details': [{
required: true,
message: '请输入介绍',
trigger: ['change', 'blur']
}],
- 'size': [{
+ 'area': [{
required: true,
message: '请输入面积',
trigger: ['change', 'blur']
@@ -136,31 +140,29 @@
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
- }
+ 'phone': [{
+ required: true,
+ message: '请输入电话号码',
},
- message: '号码不正确',
- trigger: ['change','blur'],
- }]
-
+ {
+ validator: (rule, value, callback) => {
+ if (value) {
+ return this.$u.test.mobile(value);
+ } else {
+ return true
+ }
+ },
+ message: '号码不正确',
+ trigger: ['change', 'blur'],
+ }
+ ]
},
}
},
methods: {
+ preview(e) {
+ console.log('预览', e);
+ },
handleSearchAddress() {
uni.navigateTo({
url: '/pages/publish/chooseAddress/chooseAddress'
@@ -168,40 +170,68 @@
},
submit() {
this.$refs.uForm.validate().then(res => {
- console.log("提交表单信息:" + JSON.stringify(this.form))
- uni.$u.toast('发布成功')
- // 调用服务端入表接口W
+ console.log("提交表单信息:", this.form)
+ this.$api.publishAddress(this.form).then(res => {
+ console.log('发布找店地址', res);
+ if (res.data.code == 1) {
+ uni.$u.toast('发布成功')
+ } else {
+ uni.$u.toast(res.data.msg)
+ }
+ })
}).catch(errors => {
- console.log("失败信息:" + JSON.stringify(errors))
+ console.log("失败信息:", JSON.stringify(errors))
// uni.$u.toast('校验失败')
})
},
- tradeConfirm(e){
+ choosecommercialForm() {
+ if (!this.form.business) {
+ uni.$u.toast('请先选择行业')
+ return false
+ } else {
+ this.show3 = true
+ }
+ },
+ getRegionList() {
+ var that = this
+ uni.request({
+ url: 'https://apis.map.qq.com/ws/district/v1/getchildren?id=' + uni.getStorageSync('city_code') + '&key=' +
+ that.$api.key,
+ success(res) {
+ that.regionColumns = [res.data.result[0].map(item => item.fullname)]
+ },
+ fail(err) {
+ console.log('请求区域失败:', err);
+ }
+ })
+ },
+ 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);
this.Karmacolumns = res.data.data.map((item) => {
- return item = item.name
- })
+ return item = item.name
+ })
})
},
- karmaConfirm(e){
+ karmaConfirm(e) {
this.show3 = false
- this.form.karma = e.value[0]
+ this.form.commercialForm = e.value[0]
},
- regionConfirm(e){
+ regionConfirm(e) {
this.show1 = false
this.form.region = e.value[0]
},
},
onReady() {
this.$refs.uForm.setRules(this.rules)
-
+
},
onLoad() {
- this.$api.getClassList().then(res =>{
+ this.getRegionList()
+ this.$api.getClassList().then(res => {
// console.log(res.data.data.length);
this.Classcolumns = res.data.data.map((item) => {
return item = item.name
@@ -209,15 +239,15 @@
this.pid = res.data.data.map((item) => {
return item = item.id
})
-
+
})
},
- computed:{
- isChecked(index){
- if(index.length > 0)
- return true;
+ computed: {
+ isChecked(index) {
+ if (index.length > 0)
+ return true;
else
- return false;
+ return false;
}
}
}
@@ -244,7 +274,12 @@
justify-content: center;
align-items: center;
background-color: #F8F8F8;
- height: 300rpx;
+
+ // height: 300rpx;
+ .count {
+ margin-bottom: 30px;
+ }
+
// margin-right: 20px;
}
@@ -267,12 +302,14 @@
font-weight: 1px;
color: #c1c4c7;
}
- .checkedtext{
+
+ .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/publishInvestment/publishInvestment.vue b/pages/publish/publishInvestment/publishInvestment.vue
index 6160647..7b24bf5 100644
--- a/pages/publish/publishInvestment/publishInvestment.vue
+++ b/pages/publish/publishInvestment/publishInvestment.vue
@@ -2,52 +2,50 @@
-
- 发布房源图片({{ShopInfomation.count}}/5)
+
+
+
+
+ 发布房源图片({{imageLength}}/5)
-
-
+
+
-
-
-
-
+
{{form.region}}
请选择所属区域
-
+
-
- {{form.trade}}
- 请选择行业
+
+
+
+
+ {{form.business}}
+ 请选择项目行业
-
+
-
- {{form.karma}}
- 请选择业态
-
-
-
-
+
+
-
-
+
+
-
-
-
-
-
+
+
@@ -61,31 +59,28 @@
export default {
data() {
return {
+ imageLength: '0',
+ fileList1: [],
regionColumns: [JSON.parse(uni.getStorageSync('regionList'))] || [],
- ShopInfomation: {
- city: '',
- area: '',
- count: 0,
-
- },
form: {
title: '',
region: '',
- place: '',
- trade: '',
- karma: '',
- size: '',
- rent: '',
- sell: '',
- name: '',
- call: '',
- introduce: ''
+ address: '',
+ business: '',
+ mobile: '',
+ contact:'',
+ content: '',
+ images: [],
+ longitude: '',
+ latitude: '',
+ id: '',
+
},
Classcolumns: [],
- ClassCheckId:'',
+ ClassCheckId: '',
Karmacolumns: [],
- pid:[],
+ pid: [],
show1: false,
show2: false,
show3: false,
@@ -95,76 +90,127 @@
message: '请输入标题',
trigger: ['change', 'blur']
}],
- 'trade': [{
+ 'business': [{
required: true,
message: '请选择行业',
- trigger: ['change', 'blur']
+ trigger: ['change']
}],
'region': [{
required: true,
message: '请选择地区',
- trigger: ['change', 'blur']
+ trigger: ['change']
}],
- 'karma': [{
- required: true,
- message: '请选择业态',
- trigger: ['change', 'blur']
- }],
- 'name': [{
+ 'contact': [{
required: true,
message: '请输入姓名',
trigger: ['change', 'blur']
}],
- 'sell': [{
- required: true,
- message: '请输入转让金',
- trigger: ['change', 'blur']
- }],
- 'introduce': [{
+ 'content': [{
required: true,
message: '请输入介绍',
trigger: ['change', 'blur']
}],
- 'size': [{
- required: true,
- message: '请输入面积',
- trigger: ['change', 'blur']
- }],
- 'rent': [{
- required: true,
- message: '请输入租金',
- trigger: ['change', 'blur']
- }],
- 'place': [{
+ 'address': [{
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
- }
+ 'mobile': [{
+ required: true,
+ message: '请输入电话号码',
},
- message: '号码不正确',
- trigger: ['change','blur'],
- }]
+ {
+ validator: (rule, value, callback) => {
+ if (value) {
+ return this.$u.test.mobile(value);
+ } else {
+ return true
+ }
+ },
+ message: '号码不正确',
+ trigger: ['change', 'blur'],
+ }
+ ]
},
}
},
methods: {
+ // 删除图片
+ deletePic(event) {
+ this[`fileList${event.name}`].splice(event.index, 1)
+ },
+ preview(e) {
+ console.log('预览', e);
+ },
+ // 新增图片
+ async afterRead(event) {
+ // 当设置 multiple 为 true 时, file 为数组格式,否则为对象格式
+ let lists = [].concat(event.file)
+ let fileListLen = this[`fileList${event.name}`].length
+ lists.map((item) => {
+ this[`fileList${event.name}`].push({
+ ...item,
+ status: 'uploading',
+ message: '上传中'
+ })
+ })
+ for (let i = 0; i < lists.length; i++) {
+ console.log('lists[i].url', lists[i].url);
+ const result = await this.uploadFilePromise(lists[i].url)
+ console.log('result', result);
+ let item = this[`fileList${event.name}`][fileListLen]
+ this[`fileList${event.name}`].splice(fileListLen, 1, Object.assign(item, {
+ status: 'success',
+ message: '',
+ url: result
+ }))
+ fileListLen++
+ this.imageLength = fileListLen
+ }
+ },
+ uploadFilePromise(filePath) {
+ return new Promise((resolve, reject) => {
+ const token = uni.getStorageSync('loginToken')
+ const a = uni.uploadFile({
+ url: this.$api.uploadImgUrl,
+ filePath: filePath,
+ name: 'file',
+ header: {
+ "Content-Type": "multipart/form-data",
+ 'Authorization': token
+ },
+ success: (res) => {
+ resolve(JSON.parse(res.data).data.url)
+ }
+ });
+ })
+ },
handleSearchAddress() {
uni.navigateTo({
url: '/pages/publish/chooseAddress/chooseAddress'
})
},
+ submit() {
+ const temp = []
+ if (this.fileList1.length > 0) {
+ this.fileList1.map(item => {
+ const url = item.url
+ temp.push(url.replace(this.imgUrl + '/', ''))
+ })
+ }
+ console.log('images---', temp.join(','));
+ this.$refs.uForm.validate().then(res => {
+ console.log("提交表单信息:" + JSON.stringify(this.form))
+ uni.$u.toast('发布成功')
+ this.$api.publishInvestment(this.form).then(res => {
+ console.log(res);
+ })
+ }).catch(errors => {
+ console.log("失败信息:" + JSON.stringify(errors))
+ // uni.$u.toast('校验失败')
+ })
+ },
changeAddress(e) {
// console.log('changeAddress', e);
this.getAddressList(e)
@@ -176,50 +222,42 @@
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);
}
})
},
- 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){
+ 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);
this.Karmacolumns = res.data.data.map((item) => {
- return item = item.name
- })
+ return item = item.name
+ })
})
},
- karmaConfirm(e){
+ karmaConfirm(e) {
this.show3 = false
- this.form.karma = e.value[0]
+ this.form.commercial = e.value[0]
},
- regionConfirm(e){
+ regionConfirm(e) {
this.show1 = false
this.form.region = e.value[0]
},
},
onReady() {
this.$refs.uForm.setRules(this.rules)
-
+
},
onLoad() {
- this.$api.getClassList().then(res =>{
+ this.$api.getClassList().then(res => {
// console.log(res.data.data.length);
this.Classcolumns = res.data.data.map((item) => {
return item = item.name
@@ -227,15 +265,15 @@
this.pid = res.data.data.map((item) => {
return item = item.id
})
-
+
})
},
- computed:{
- isChecked(index){
- if(index.length > 0)
- return true;
+ computed: {
+ isChecked(index) {
+ if (index.length > 0)
+ return true;
else
- return false;
+ return false;
}
}
}
@@ -262,7 +300,11 @@
justify-content: center;
align-items: center;
background-color: #F8F8F8;
- height: 300rpx;
+
+ // height: 300rpx;
+ .count {
+ margin-bottom: 30px;
+ }
// margin-right: 20px;
}
@@ -285,12 +327,14 @@
font-weight: 1px;
color: #c1c4c7;
}
- .checkedtext{
+
+ .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/publishRent/publishRent.vue b/pages/publish/publishRent/publishRent.vue
index 6670fde..fd4ed8d 100644
--- a/pages/publish/publishRent/publishRent.vue
+++ b/pages/publish/publishRent/publishRent.vue
@@ -2,54 +2,71 @@
-
- 发布店铺图片({{ShopInfomation.count}}/5)
+
+
+
+
+ 发布房源图片({{imageLength}}/5)
-
-
-
-
-
- {{form.region}}
- 请选择所属区域
-
-
-
-
-
-
-
-
-
-
- {{form.trade}}
- 请选择店铺行业
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 发布
-
+
+
+
+
+ {{form.region}}
+ 请选择所属区域
+
+
+
+
+
+
+
+
+
+
+ {{form.business}}
+ 请选择店铺行业
+
+
+
+
+
+
+ {{form.commercial}}
+ 请选择店铺业态
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 发布
+
@@ -57,56 +74,66 @@
export default {
data() {
return {
- regionColumns:[JSON.parse(uni.getStorageSync('regionList'))]||[],
- ShopInfomation:{
- city:'',
- area:'',
- count:0,
-
- },
-
+ imageLength: '0',
+ fileList1: [],
+ regionColumns: [JSON.parse(uni.getStorageSync('regionList'))] || [],
+
form: {
title: '',
region: '',
- place: '',
- trade: '',
- size: '',
+ address: '',
+ business: '',
+ commercial: '',
+ area: '',
rent: '',
- name: '',
- call: '',
- introduce: ''
+ contact:'',
+ mobile: '',
+ content: '',
+ images: [],
+ longitude: '',
+ latitude: '',
+ id: '',
+
},
- Classcolumns:[],
- show1:false,
- show2:false,
- show3:false,
+ Classcolumns: [],
+ ClassCheckId: '',
+ Karmacolumns: [],
+ pid: [],
+ show1: false,
+ show2: false,
+ show3: false,
rules: {
'title': [{
required: true,
message: '请输入标题',
trigger: ['change', 'blur']
}],
- 'trade': [{
+ 'business': [{
required: true,
message: '请选择行业',
- trigger: ['change', 'blur']
+ trigger: ['change']
}],
'region': [{
required: true,
message: '请选择地区',
- trigger: ['change', 'blur']
+ trigger: ['change']
}],
- 'name': [{
+ 'commercial': [{
+ required: true,
+ message: '请选择业态',
+ trigger: ['change']
+ }],
+ 'contact': [{
required: true,
message: '请输入姓名',
trigger: ['change', 'blur']
}],
- 'introduce': [{
+ 'content': [{
required: true,
message: '请输入介绍',
trigger: ['change', 'blur']
}],
- 'size': [{
+ 'area': [{
required: true,
message: '请输入面积',
trigger: ['change', 'blur']
@@ -116,123 +143,239 @@
message: '请输入租金',
trigger: ['change', 'blur']
}],
- 'place': [{
+ 'address': [{
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
- }
+ 'mobile': [{
+ required: true,
+ message: '请输入电话号码',
},
- message: '号码不正确',
- trigger: ['change','blur'],
- }]
-
+ {
+ validator: (rule, value, callback) => {
+ if (value) {
+ return this.$u.test.mobile(value);
+ } else {
+ return true
+ }
+ },
+ message: '号码不正确',
+ trigger: ['change', 'blur'],
+ }
+ ]
+
},
}
-
},
methods: {
- confirmArea(e) {
- this.ShopInfomation.city = e.value[0]
- this.ShopInfomation.area = e.value[1]
- this.show1 = false
+ // 删除图片
+ deletePic(event) {
+ this[`fileList${event.name}`].splice(event.index, 1)
+ },
+ preview(e) {
+ console.log('预览', e);
+ },
+ // 新增图片
+ async afterRead(event) {
+ // 当设置 multiple 为 true 时, file 为数组格式,否则为对象格式
+ let lists = [].concat(event.file)
+ let fileListLen = this[`fileList${event.name}`].length
+ lists.map((item) => {
+ this[`fileList${event.name}`].push({
+ ...item,
+ status: 'uploading',
+ message: '上传中'
+ })
+ })
+ for (let i = 0; i < lists.length; i++) {
+ console.log('lists[i].url', lists[i].url);
+ const result = await this.uploadFilePromise(lists[i].url)
+ console.log('result', result);
+ let item = this[`fileList${event.name}`][fileListLen]
+ this[`fileList${event.name}`].splice(fileListLen, 1, Object.assign(item, {
+ status: 'success',
+ message: '',
+ url: result
+ }))
+ fileListLen++
+ this.imageLength = fileListLen
+ }
+ },
+ uploadFilePromise(filePath) {
+ return new Promise((resolve, reject) => {
+ const token = uni.getStorageSync('loginToken')
+ const a = uni.uploadFile({
+ url: this.$api.uploadImgUrl,
+ filePath: filePath,
+ name: 'file',
+ header: {
+ "Content-Type": "multipart/form-data",
+ 'Authorization': token
},
+ success: (res) => {
+ resolve(JSON.parse(res.data).data.url)
+ }
+ });
+ })
+ },
+ handleSearchAddress() {
+ uni.navigateTo({
+ url: '/pages/publish/chooseAddress/chooseAddress'
+ })
+ },
submit() {
+ const temp = []
+ if (this.fileList1.length > 0) {
+ this.fileList1.map(item => {
+ const url = item.url
+ temp.push(url.replace(this.imgUrl + '/', ''))
+ })
+ }
+ console.log('images---', temp.join(','));
this.$refs.uForm.validate().then(res => {
console.log("提交表单信息:" + JSON.stringify(this.form))
uni.$u.toast('发布成功')
- // 调用服务端入表接口W
+ this.$api.publishRent(this.form).then(res => {
+ console.log(res);
+ })
}).catch(errors => {
console.log("失败信息:" + JSON.stringify(errors))
// uni.$u.toast('校验失败')
})
},
- tradeConfirm(e){
- this.show2 = false
- this.form.trade = e.value[0]
+ changeAddress(e) {
+ // console.log('changeAddress', e);
+ this.getAddressList(e)
},
- regionConfirm(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);
+ 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);
+ }
+ })
+ },
+ tradeConfirm(e) {
+ this.show2 = false
+ this.form.business = 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.commercial = 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 =>{
+ 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
+ })
+
})
},
- onReady() {
- this.$refs.uForm.setRules(this.rules)
-
- },
+ computed: {
+ isChecked(index) {
+ if (index.length > 0)
+ return true;
+ else
+ return false;
+ }
+ }
}
+
\ No newline at end of file
diff --git a/pages/publish/publishTransfer/publishTransfer.vue b/pages/publish/publishTransfer/publishTransfer.vue
index 05c6906..adc855e 100644
--- a/pages/publish/publishTransfer/publishTransfer.vue
+++ b/pages/publish/publishTransfer/publishTransfer.vue
@@ -2,62 +2,68 @@
-
- 发布房源图片({{ShopInfomation.count}}/5)
+
+
+
+
+ 发布房源图片({{imageLength}}/5})
-
-
+
-
+
{{form.region}}
请选择所属区域
-
-
-
+
+
-
- {{form.trade}}
+
+ {{form.business}}
请选择店铺行业
-
+
-
- {{form.karma}}
- 请选择店铺业态
+
+ {{form.commercial}}
+ 请选择店铺业态
-
+
-
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
@@ -66,36 +72,35 @@
-
-