|
@@ -324,7 +324,7 @@
|
|
|
</el-carousel-item>
|
|
</el-carousel-item>
|
|
|
</el-carousel>
|
|
</el-carousel>
|
|
|
</viewer>
|
|
</viewer>
|
|
|
- <el-button @click="openImageDetailUploadDialog_modify"
|
|
|
|
|
|
|
+ <el-button @click="openImageDetailUploadDialog_modify"
|
|
|
style="margin-top: 8px; width: 150px; border: none; background: rgba(9, 101, 98, 1); color: #fff; border-radius: 5px;"
|
|
style="margin-top: 8px; width: 150px; border: none; background: rgba(9, 101, 98, 1); color: #fff; border-radius: 5px;"
|
|
|
size="small">上传详情图片</el-button>
|
|
size="small">上传详情图片</el-button>
|
|
|
<input type="file" ref="modifyImageDetailUploadInput" style="display:none" accept=".jpg,.png"
|
|
<input type="file" ref="modifyImageDetailUploadInput" style="display:none" accept=".jpg,.png"
|
|
@@ -519,12 +519,16 @@
|
|
|
} from '@/api/perimeterMgr'
|
|
} from '@/api/perimeterMgr'
|
|
|
|
|
|
|
|
import {
|
|
import {
|
|
|
- isEmpty
|
|
|
|
|
|
|
+ isEmpty,
|
|
|
|
|
+ cos
|
|
|
} from '@/js/common'
|
|
} from '@/js/common'
|
|
|
|
|
+
|
|
|
import {
|
|
import {
|
|
|
valid
|
|
valid
|
|
|
} from 'mockjs'
|
|
} from 'mockjs'
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
|
|
+ import COS from 'cos-js-sdk-v5'
|
|
|
|
|
+
|
|
|
var townOptions = [] // 民宿列表
|
|
var townOptions = [] // 民宿列表
|
|
|
var townOptions_obj = [] // 民宿列表
|
|
var townOptions_obj = [] // 民宿列表
|
|
|
export default {
|
|
export default {
|
|
@@ -691,36 +695,36 @@
|
|
|
rtypeOptions: [{
|
|
rtypeOptions: [{
|
|
|
rtypeId: 0,
|
|
rtypeId: 0,
|
|
|
rtype: '民宿'
|
|
rtype: '民宿'
|
|
|
- },{
|
|
|
|
|
|
|
+ }, {
|
|
|
rtypeId: 1,
|
|
rtypeId: 1,
|
|
|
rtype: '美食'
|
|
rtype: '美食'
|
|
|
}, {
|
|
}, {
|
|
|
rtypeId: 2,
|
|
rtypeId: 2,
|
|
|
rtype: '景点'
|
|
rtype: '景点'
|
|
|
- // }, {
|
|
|
|
|
- // rtypeId: 3,
|
|
|
|
|
- // rtype: '停车场'
|
|
|
|
|
- // }, {
|
|
|
|
|
- // rtypeId: 4,
|
|
|
|
|
- // rtype: '洗浴'
|
|
|
|
|
- // }, {
|
|
|
|
|
- // rtypeId: 5,
|
|
|
|
|
- // rtype: '健身'
|
|
|
|
|
- // }, {
|
|
|
|
|
- // rtypeId: 6,
|
|
|
|
|
- // rtype: 'KTV'
|
|
|
|
|
- // }, {
|
|
|
|
|
- // rtypeId: 7,
|
|
|
|
|
- // rtype: '电影院'
|
|
|
|
|
- // }, {
|
|
|
|
|
- // rtypeId: 8,
|
|
|
|
|
- // rtype: '酒吧'
|
|
|
|
|
|
|
+ // }, {
|
|
|
|
|
+ // rtypeId: 3,
|
|
|
|
|
+ // rtype: '停车场'
|
|
|
|
|
+ // }, {
|
|
|
|
|
+ // rtypeId: 4,
|
|
|
|
|
+ // rtype: '洗浴'
|
|
|
|
|
+ // }, {
|
|
|
|
|
+ // rtypeId: 5,
|
|
|
|
|
+ // rtype: '健身'
|
|
|
|
|
+ // }, {
|
|
|
|
|
+ // rtypeId: 6,
|
|
|
|
|
+ // rtype: 'KTV'
|
|
|
|
|
+ // }, {
|
|
|
|
|
+ // rtypeId: 7,
|
|
|
|
|
+ // rtype: '电影院'
|
|
|
|
|
+ // }, {
|
|
|
|
|
+ // rtypeId: 8,
|
|
|
|
|
+ // rtype: '酒吧'
|
|
|
}, {
|
|
}, {
|
|
|
rtypeId: 9,
|
|
rtypeId: 9,
|
|
|
rtype: '加油站'
|
|
rtype: '加油站'
|
|
|
- // }, {
|
|
|
|
|
- // rtypeId: 10,
|
|
|
|
|
- // rtype: '其它'
|
|
|
|
|
|
|
+ // }, {
|
|
|
|
|
+ // rtypeId: 10,
|
|
|
|
|
+ // rtype: '其它'
|
|
|
}],
|
|
}],
|
|
|
// 查询数据
|
|
// 查询数据
|
|
|
formInline: {
|
|
formInline: {
|
|
@@ -908,7 +912,14 @@
|
|
|
dialogDeleteVisible: false, // 删除确认对话框
|
|
dialogDeleteVisible: false, // 删除确认对话框
|
|
|
dialogAddProductVisible: false, // 添加产品对话框
|
|
dialogAddProductVisible: false, // 添加产品对话框
|
|
|
dialogModifyProductVisible: false, // 编辑产品对话框
|
|
dialogModifyProductVisible: false, // 编辑产品对话框
|
|
|
- delPerimeterId: ''
|
|
|
|
|
|
|
+ delPerimeterId: '',
|
|
|
|
|
+ cosVal: {
|
|
|
|
|
+ SecretId: "AKIDCPVZdcWIxgHpy5FYxVyPiqkZGrhdXUBg",
|
|
|
|
|
+ SecretKey: "NkyCN3cz97qKaeXLvHOGxOcdS8f184pL",
|
|
|
|
|
+ SecurityToken: "1306339220",
|
|
|
|
|
+ Bucket: "wanzai-1306339220",
|
|
|
|
|
+ Region: "ap-shanghai",
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
created() {
|
|
created() {
|
|
@@ -1148,23 +1159,20 @@
|
|
|
// 周边新增上传文件
|
|
// 周边新增上传文件
|
|
|
uploadImageVideo(event, imgOrVideo) {
|
|
uploadImageVideo(event, imgOrVideo) {
|
|
|
const file = event.target.files[0];
|
|
const file = event.target.files[0];
|
|
|
|
|
+
|
|
|
|
|
+ const key = `/uploads/zhoubian/${new Date().getTime()}`; // 设置上传到 COS 后的文件名
|
|
|
var that = this
|
|
var that = this
|
|
|
- // 调用接口上传文件的逻辑
|
|
|
|
|
- uploadFiles(file).then((res) => {
|
|
|
|
|
- // console.log(res);
|
|
|
|
|
- if (res.code === 1) {
|
|
|
|
|
- if (!isEmpty(res.data)) {
|
|
|
|
|
- if (imgOrVideo == 'img') {
|
|
|
|
|
- that.$set(that.formAddDialog, 'first_img', res.data)
|
|
|
|
|
- } else if (imgOrVideo == 'imgDetail') {
|
|
|
|
|
- that.detail_img_array.push(res.data)
|
|
|
|
|
- that.$set(that.formAddDialog, 'detail_img', that.detail_img_array)
|
|
|
|
|
- } else {
|
|
|
|
|
- that.videoOptions.sources[0].src = res.data
|
|
|
|
|
- that.$set(that.formAddDialog, 'show_video', that.videoOptions)
|
|
|
|
|
- that.$set(that.formAddDialog, 'post_video', res.data)
|
|
|
|
|
- }
|
|
|
|
|
- } else {
|
|
|
|
|
|
|
+ const cos = new COS(this.cosVal);
|
|
|
|
|
+ cos.putObject({
|
|
|
|
|
+ Bucket: "wanzai-1306339220",
|
|
|
|
|
+ Region: "ap-shanghai",
|
|
|
|
|
+ Key: key,
|
|
|
|
|
+ Body: file,
|
|
|
|
|
+ },
|
|
|
|
|
+ function(err, data) {
|
|
|
|
|
+ if (err) {
|
|
|
|
|
+ // console.error(err);
|
|
|
|
|
+ that.$message.error(err);
|
|
|
if (imgOrVideo == 'img') {
|
|
if (imgOrVideo == 'img') {
|
|
|
that.$set(that.formAddDialog, 'first_img', '')
|
|
that.$set(that.formAddDialog, 'first_img', '')
|
|
|
} else if (imgOrVideo == 'imgDetail') {
|
|
} else if (imgOrVideo == 'imgDetail') {
|
|
@@ -1172,41 +1180,50 @@
|
|
|
} else {
|
|
} else {
|
|
|
that.$set(that.formAddDialog, 'show_video', '')
|
|
that.$set(that.formAddDialog, 'show_video', '')
|
|
|
}
|
|
}
|
|
|
- }
|
|
|
|
|
- } else {
|
|
|
|
|
- if (imgOrVideo == 'img') {
|
|
|
|
|
- that.$set(that.formAddDialog, 'first_img', '')
|
|
|
|
|
- } else if (imgOrVideo == 'imgDetail') {
|
|
|
|
|
- that.$set(that.formAddDialog, 'detail_img', '')
|
|
|
|
|
|
|
+ return;
|
|
|
} else {
|
|
} else {
|
|
|
- that.$set(that.formAddDialog, 'show_video', '')
|
|
|
|
|
|
|
+ // console.log(data);
|
|
|
|
|
+ if (!isEmpty(`${data.Location}`)) {
|
|
|
|
|
+ if (imgOrVideo == 'img') {
|
|
|
|
|
+ that.$set(that.formAddDialog, 'first_img', `https://${data.Location}`)
|
|
|
|
|
+ } else if (imgOrVideo == 'imgDetail') {
|
|
|
|
|
+ that.detail_img_array.push(`https://${data.Location}`)
|
|
|
|
|
+ that.$set(that.formAddDialog, 'detail_img', that.detail_img_array)
|
|
|
|
|
+ } else {
|
|
|
|
|
+ that.videoOptions.sources[0].src = `https://${data.Location}`
|
|
|
|
|
+ that.$set(that.formAddDialog, 'show_video', that.videoOptions)
|
|
|
|
|
+ that.$set(that.formAddDialog, 'post_video', `https://${data.Location}`)
|
|
|
|
|
+ }
|
|
|
|
|
+ } else {
|
|
|
|
|
+ if (imgOrVideo == 'img') {
|
|
|
|
|
+ that.$set(that.formAddDialog, 'first_img', '')
|
|
|
|
|
+ } else if (imgOrVideo == 'imgDetail') {
|
|
|
|
|
+ that.$set(that.formAddDialog, 'detail_img', '')
|
|
|
|
|
+ } else {
|
|
|
|
|
+ that.$set(that.formAddDialog, 'show_video', '')
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- }).catch((err) => {
|
|
|
|
|
- // console.log(err);
|
|
|
|
|
- that.$message.error(err.message)
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ );
|
|
|
},
|
|
},
|
|
|
// 周边修改上传文件
|
|
// 周边修改上传文件
|
|
|
uploadModifyImageVideo(event, imgOrVideo) {
|
|
uploadModifyImageVideo(event, imgOrVideo) {
|
|
|
const file = event.target.files[0];
|
|
const file = event.target.files[0];
|
|
|
|
|
+
|
|
|
|
|
+ const key = `/uploads/zhoubian/${new Date().getTime()}`; // 设置上传到 COS 后的文件名
|
|
|
var that = this
|
|
var that = this
|
|
|
- // 调用接口上传文件的逻辑
|
|
|
|
|
- uploadFiles(file).then((res) => {
|
|
|
|
|
- // console.log(res);
|
|
|
|
|
- if (res.code === 1) {
|
|
|
|
|
- if (!isEmpty(res.data)) {
|
|
|
|
|
- if (imgOrVideo == 'img') {
|
|
|
|
|
- that.$set(that.formModifyDialog, 'first_img', res.data)
|
|
|
|
|
- } else if (imgOrVideo == 'imgDetail') {
|
|
|
|
|
- that.detail_img_array.push(res.data)
|
|
|
|
|
- that.$set(that.formModifyDialog, 'detail_img', that.detail_img_array)
|
|
|
|
|
- } else {
|
|
|
|
|
- that.videoOptions.sources[0].src = res.data
|
|
|
|
|
- that.$set(that.formModifyDialog, 'show_video', that.videoOptions)
|
|
|
|
|
- that.$set(that.formModifyDialog, 'post_video', res.data)
|
|
|
|
|
- }
|
|
|
|
|
- } else {
|
|
|
|
|
|
|
+ const cos = new COS(this.cosVal);
|
|
|
|
|
+ cos.putObject({
|
|
|
|
|
+ Bucket: "wanzai-1306339220",
|
|
|
|
|
+ Region: "ap-shanghai",
|
|
|
|
|
+ Key: key,
|
|
|
|
|
+ Body: file,
|
|
|
|
|
+ },
|
|
|
|
|
+ function(err, data) {
|
|
|
|
|
+ if (err) {
|
|
|
|
|
+ // console.error(err);
|
|
|
|
|
+ that.$message.error(err);
|
|
|
if (imgOrVideo == 'img') {
|
|
if (imgOrVideo == 'img') {
|
|
|
that.$set(that.formModifyDialog, 'first_img', '')
|
|
that.$set(that.formModifyDialog, 'first_img', '')
|
|
|
} else if (imgOrVideo == 'imgDetail') {
|
|
} else if (imgOrVideo == 'imgDetail') {
|
|
@@ -1214,20 +1231,32 @@
|
|
|
} else {
|
|
} else {
|
|
|
that.$set(that.formModifyDialog, 'show_video', '')
|
|
that.$set(that.formModifyDialog, 'show_video', '')
|
|
|
}
|
|
}
|
|
|
- }
|
|
|
|
|
- } else {
|
|
|
|
|
- if (imgOrVideo == 'img') {
|
|
|
|
|
- that.$set(that.formModifyDialog, 'first_img', '')
|
|
|
|
|
- } else if (imgOrVideo == 'imgDetail') {
|
|
|
|
|
- that.$set(that.formModifyDialog, 'detail_img', '')
|
|
|
|
|
|
|
+ return;
|
|
|
} else {
|
|
} else {
|
|
|
- that.$set(that.formModifyDialog, 'show_video', '')
|
|
|
|
|
|
|
+ // console.log(data);
|
|
|
|
|
+ if (!isEmpty(`${data.Location}`)) {
|
|
|
|
|
+ if (imgOrVideo == 'img') {
|
|
|
|
|
+ that.$set(that.formModifyDialog, 'first_img', `https://${data.Location}`)
|
|
|
|
|
+ } else if (imgOrVideo == 'imgDetail') {
|
|
|
|
|
+ that.detail_img_array.push(`https://${data.Location}`)
|
|
|
|
|
+ that.$set(that.formModifyDialog, 'detail_img', that.detail_img_array)
|
|
|
|
|
+ } else {
|
|
|
|
|
+ that.videoOptions.sources[0].src = `https://${data.Location}`
|
|
|
|
|
+ that.$set(that.formModifyDialog, 'show_video', that.videoOptions)
|
|
|
|
|
+ that.$set(that.formModifyDialog, 'post_video', `https://${data.Location}`)
|
|
|
|
|
+ }
|
|
|
|
|
+ } else {
|
|
|
|
|
+ if (imgOrVideo == 'img') {
|
|
|
|
|
+ that.$set(that.formModifyDialog, 'first_img', '')
|
|
|
|
|
+ } else if (imgOrVideo == 'imgDetail') {
|
|
|
|
|
+ that.$set(that.formModifyDialog, 'detail_img', '')
|
|
|
|
|
+ } else {
|
|
|
|
|
+ that.$set(that.formModifyDialog, 'show_video', '')
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- }).catch((err) => {
|
|
|
|
|
- // console.log(err);
|
|
|
|
|
- that.$message.error(err.message)
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ );
|
|
|
},
|
|
},
|
|
|
// 删除本地显示的图片或视频
|
|
// 删除本地显示的图片或视频
|
|
|
del_local_display_img(param) {
|
|
del_local_display_img(param) {
|