|
@@ -4,7 +4,7 @@
|
|
<view class="card">
|
|
<view class="card">
|
|
<view class="card1" @click="goToPosition()">
|
|
<view class="card1" @click="goToPosition()">
|
|
<text>位置定位</text>
|
|
<text>位置定位</text>
|
|
- <text>></text>
|
|
|
|
|
|
+ <u-icon name="arrow-right" size="24"></u-icon>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<view class="card">
|
|
<view class="card">
|
|
@@ -20,7 +20,11 @@
|
|
<view style="margin-top: 20rpx;">
|
|
<view style="margin-top: 20rpx;">
|
|
<span>
|
|
<span>
|
|
<u--textarea border='none' :maxlength='300' count v-model="stayInfo.introduction"
|
|
<u--textarea border='none' :maxlength='300' count v-model="stayInfo.introduction"
|
|
- placeholder="请输入酒店简介" height='250'></u--textarea>
|
|
|
|
|
|
+ placeholder="请输入酒店简介" height='250'>
|
|
|
|
+ </u--textarea>
|
|
|
|
+
|
|
|
|
+ <!-- <u-parse :content="stayInfo.introduction"></u-parse> -->
|
|
|
|
+
|
|
</span>
|
|
</span>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
@@ -52,7 +56,7 @@
|
|
</u-upload>
|
|
</u-upload>
|
|
</view>
|
|
</view>
|
|
</u-collapse-item>
|
|
</u-collapse-item>
|
|
- <!-- <u-collapse-item title="环境照片" name="Docs guide">
|
|
|
|
|
|
+ <u-collapse-item title="环境照片(0/10)" name="Docs guide">
|
|
<text class="collapseTitle">至少上传1张,建议上传5-10张,需展示完整环境</text>
|
|
<text class="collapseTitle">至少上传1张,建议上传5-10张,需展示完整环境</text>
|
|
<view class="upload" v-if="fileList1.length==0">
|
|
<view class="upload" v-if="fileList1.length==0">
|
|
<u-upload :fileList="fileList1" multiple :maxCount="10" :maxSize="10 * 1024 * 1024"
|
|
<u-upload :fileList="fileList1" multiple :maxCount="10" :maxSize="10 * 1024 * 1024"
|
|
@@ -75,7 +79,7 @@
|
|
</view>
|
|
</view>
|
|
</u-upload>
|
|
</u-upload>
|
|
</view>
|
|
</view>
|
|
- </u-collapse-item> -->
|
|
|
|
|
|
+ </u-collapse-item>
|
|
</u-collapse>
|
|
</u-collapse>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
@@ -100,17 +104,34 @@
|
|
imgUrlList: [],
|
|
imgUrlList: [],
|
|
fileList2: [],
|
|
fileList2: [],
|
|
stayInfo: {
|
|
stayInfo: {
|
|
- picList: []
|
|
|
|
- }
|
|
|
|
|
|
+ // picList: []
|
|
|
|
+ },
|
|
|
|
+ picList: []
|
|
}
|
|
}
|
|
},
|
|
},
|
|
onLoad() {
|
|
onLoad() {
|
|
this.getStayInfo()
|
|
this.getStayInfo()
|
|
},
|
|
},
|
|
|
|
+ filters: {
|
|
|
|
+ // 去除富文本标签样式
|
|
|
|
+ removeHtmlStyle(html) {
|
|
|
|
+ const relStyle = /style\s*?=\s*?(['"])[\s\S]*?\1/g
|
|
|
|
+ const relTag = /<.+?>/g
|
|
|
|
+ const relClass = /class\s*?=\s*?(['"])[\s\S]*?\1/g
|
|
|
|
+ let newHtml = ''
|
|
|
|
+ if (html) {
|
|
|
|
+ newHtml = html.replace(relStyle, '')
|
|
|
|
+ newHtml = newHtml.replace(relTag, '')
|
|
|
|
+ newHtml = newHtml.replace(relClass, '')
|
|
|
|
+ }
|
|
|
|
+ return newHtml
|
|
|
|
+ }
|
|
|
|
+ },
|
|
methods: {
|
|
methods: {
|
|
|
|
+
|
|
goToPosition() {
|
|
goToPosition() {
|
|
- const qwe=JSON.stringify(this.stayInfo)
|
|
|
|
- console.log(qwe,'qweqweqweqwe');
|
|
|
|
|
|
+ const qwe = JSON.stringify(this.stayInfo)
|
|
|
|
+ console.log(qwe, 'qweqweqweqwe');
|
|
uni.navigateTo({
|
|
uni.navigateTo({
|
|
url: '/pagesMy/stayInfo/roomPosition?item=' + JSON.stringify(this.stayInfo)
|
|
url: '/pagesMy/stayInfo/roomPosition?item=' + JSON.stringify(this.stayInfo)
|
|
})
|
|
})
|
|
@@ -119,10 +140,12 @@
|
|
this.$api.get('/merchant/hotel/mine/getMerchantHomestayInfo/' + '1711268640588517378').then(res => {
|
|
this.$api.get('/merchant/hotel/mine/getMerchantHomestayInfo/' + '1711268640588517378').then(res => {
|
|
if (res.data.code == 0) {
|
|
if (res.data.code == 0) {
|
|
this.stayInfo = res.data.data
|
|
this.stayInfo = res.data.data
|
|
|
|
+ // this.stayInfo.introduction.forEach(item => {
|
|
|
|
+ // this.substrings1 = item.content.split('\n');
|
|
|
|
+ // })
|
|
} else {
|
|
} else {
|
|
uni.showToast({
|
|
uni.showToast({
|
|
title: res.data.msg,
|
|
title: res.data.msg,
|
|
-
|
|
|
|
})
|
|
})
|
|
setTimeout(() => {
|
|
setTimeout(() => {
|
|
uni.navigateBack()
|
|
uni.navigateBack()
|
|
@@ -143,16 +166,16 @@
|
|
// 删除图片
|
|
// 删除图片
|
|
deletePic(event) {
|
|
deletePic(event) {
|
|
console.log('jinlaile1');
|
|
console.log('jinlaile1');
|
|
- this[`stayInfo.picList{event.name}`].splice(event.index, 1)
|
|
|
|
|
|
+ this[`picList{event.name}`].splice(event.index, 1)
|
|
},
|
|
},
|
|
// 新增图片
|
|
// 新增图片
|
|
async afterRead(event) {
|
|
async afterRead(event) {
|
|
console.log('jinlaile2', event);
|
|
console.log('jinlaile2', event);
|
|
// 当设置 multiple 为 true 时, file 为数组格式,否则为对象格式
|
|
// 当设置 multiple 为 true 时, file 为数组格式,否则为对象格式
|
|
let lists = [].concat(event.file)
|
|
let lists = [].concat(event.file)
|
|
- let fileListLen = this.stayInfo.picList.length
|
|
|
|
|
|
+ let fileListLen = this.picList.length
|
|
lists.map((item) => {
|
|
lists.map((item) => {
|
|
- this.stayInfo.picList.push({
|
|
|
|
|
|
+ this.picList.push({
|
|
...item,
|
|
...item,
|
|
status: 'uploading',
|
|
status: 'uploading',
|
|
message: '上传中'
|
|
message: '上传中'
|
|
@@ -160,8 +183,8 @@
|
|
})
|
|
})
|
|
for (let i = 0; i < lists.length; i++) {
|
|
for (let i = 0; i < lists.length; i++) {
|
|
const result = await this.uploadFilePromise(lists[i].url)
|
|
const result = await this.uploadFilePromise(lists[i].url)
|
|
- let item = this.stayInfo.picList[fileListLen]
|
|
|
|
- this.stayInfo.picList.splice(fileListLen, 1, Object.assign(item, {
|
|
|
|
|
|
+ let item = this.picList[fileListLen]
|
|
|
|
+ this.picList.splice(fileListLen, 1, Object.assign(item, {
|
|
status: 'success',
|
|
status: 'success',
|
|
message: '',
|
|
message: '',
|
|
url: result
|
|
url: result
|
|
@@ -173,7 +196,8 @@
|
|
console.log('jinlaile3');
|
|
console.log('jinlaile3');
|
|
return new Promise((resolve, reject) => {
|
|
return new Promise((resolve, reject) => {
|
|
let a = uni.uploadFile({
|
|
let a = uni.uploadFile({
|
|
- url: 'http://192.168.2.21:7001/upload', // 仅为示例,非真实的接口地址
|
|
|
|
|
|
+ // url: 'http://192.168.2.21:7001/upload', // 仅为示例,非真实的接口地址
|
|
|
|
+ url: 'https://i.ringzle.com/island-cloud-server/oss/file/upload', // 仅为示例,非真实的接口地址
|
|
filePath: url,
|
|
filePath: url,
|
|
name: 'file',
|
|
name: 'file',
|
|
formData: {
|
|
formData: {
|