diff --git a/pages/Partnerships/Partnerships.vue b/pages/Partnerships/Partnerships.vue index e9c6783..47b0602 100644 --- a/pages/Partnerships/Partnerships.vue +++ b/pages/Partnerships/Partnerships.vue @@ -1,90 +1,189 @@ - + \ No newline at end of file diff --git a/pages/my/my.vue b/pages/my/my.vue index 1815acf..d7fbc01 100644 --- a/pages/my/my.vue +++ b/pages/my/my.vue @@ -7,6 +7,8 @@ {{username}} + 账号:{{account}} @@ -47,6 +49,7 @@ src: 'https://cdn.uviewui.com/uview/album/2.jpg', account: '', username: '', + member: '', isLoad: true } }, @@ -102,19 +105,10 @@ if (data) { this.src = this.$api.imgUrl + data.avatar this.username = data.nickname + this.member = data.member this.account = data.sn - } - }) - } - //---------页面调用接口示例------------ - 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 + uni.setStorageSync("uid", data.user_id) + uni.setStorageSync("member", data.member) } }) } @@ -132,7 +126,7 @@ justify-content: center; align-items: center; flex-direction: column; - gap: 10rpx; + // gap: 10rpx; .profile-bgi { position: absolute; diff --git a/pages/publish/publishTransfer/publishTransfer.vue b/pages/publish/publishTransfer/publishTransfer.vue index 222cba0..8c88826 100644 --- a/pages/publish/publishTransfer/publishTransfer.vue +++ b/pages/publish/publishTransfer/publishTransfer.vue @@ -2,17 +2,22 @@ - - 发布房源图片(0/5) + + + + + 发布房源图片({{imageLength}}/5}) - - + - + {{form.region}} 请选择所属区域 - + @@ -23,14 +28,15 @@ - + {{form.business}} 请选择店铺行业 - + {{form.commercial}} @@ -38,8 +44,8 @@ - + @@ -48,7 +54,8 @@ - + @@ -71,6 +78,8 @@ export default { data() { return { + imageLength: '0', + fileList1: [], regionColumns: [JSON.parse(uni.getStorageSync('regionList'))] || [], form: { @@ -84,16 +93,16 @@ transferFee: '', mobile: '', content: '', - images:[], - longitude:'', - latitude:'', - id:'', - + images: [], + longitude: '', + latitude: '', + id: '', + }, Classcolumns: [], - ClassCheckId:'', + ClassCheckId: '', Karmacolumns: [], - pid:[], + pid: [], show1: false, show2: false, show3: false, @@ -148,32 +157,91 @@ message: '请输入地址', trigger: ['change', 'blur'] }], - 'mobile':[{ - 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('发布成功') @@ -206,32 +274,32 @@ } }) }, - tradeConfirm(e){ + 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 - }) + return item = item.name + }) }) }, - karmaConfirm(e){ + karmaConfirm(e) { this.show3 = false 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 @@ -239,15 +307,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; } } } @@ -274,8 +342,12 @@ justify-content: center; align-items: center; background-color: #F8F8F8; - height: 300rpx; + + // height: 300rpx; // margin-right: 20px; + .count { + margin-bottom: 30px; + } } .submit-btn { @@ -297,12 +369,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/static/my/hz_bj.png b/static/my/hz_bj.png new file mode 100644 index 0000000..03b04f9 Binary files /dev/null and b/static/my/hz_bj.png differ diff --git a/static/my/wo_icon_hhr.png b/static/my/wo_icon_hhr.png new file mode 100644 index 0000000..a5fabf8 Binary files /dev/null and b/static/my/wo_icon_hhr.png differ