Style(店铺):界面调整
This commit is contained in:
+136
-199
@@ -263,9 +263,9 @@
|
||||
class="more-wrapper"
|
||||
>
|
||||
<view
|
||||
v-show="item.isTop === 0"
|
||||
v-if="item.isTop === 0"
|
||||
class="more-item"
|
||||
@click="setTopInfoHandle(item, index)"
|
||||
@click="setTopInfoHandle(item, 1)"
|
||||
>
|
||||
<image
|
||||
:src="webUrl + '/page/hotel/settop.png'"
|
||||
@@ -273,6 +273,17 @@
|
||||
/>
|
||||
置顶动态
|
||||
</view>
|
||||
<view
|
||||
v-else
|
||||
class="more-item"
|
||||
@click="setTopInfoHandle(item, 0)"
|
||||
>
|
||||
<image
|
||||
:src="webUrl + '/page/hotel/delete.png'"
|
||||
class="more-icon"
|
||||
/>
|
||||
取消置顶
|
||||
</view>
|
||||
<view class="more-item" @click="deleteInnInfo(item, index)">
|
||||
<image
|
||||
:src="webUrl + '/page/hotel/delete.png'"
|
||||
@@ -376,12 +387,12 @@ import {
|
||||
getHotelGoodList,
|
||||
postHotelNewsDel,
|
||||
setTopHotelNew
|
||||
} from "@/api/inn.js";
|
||||
import {formatDateTime} from "@/utils";
|
||||
import {getUrlParam} from "@/utils/common.js";
|
||||
} from "@/api/inn.js"
|
||||
import {formatDateTime} from "@/utils"
|
||||
import {getUrlParam} from "@/utils/common.js"
|
||||
import imgBox from '@/components/imageTypeSet/imagebox.vue'
|
||||
import cookie from "@/utils/store/cookie";
|
||||
import {addStore, removeStore} from "@/api/favorite";
|
||||
import cookie from "@/utils/store/cookie"
|
||||
import {addStore, removeStore} from "@/api/favorite"
|
||||
import GooSkeleton from '@/components/GooSkeleton/index.vue'
|
||||
|
||||
export default {
|
||||
@@ -393,12 +404,8 @@ export default {
|
||||
return {
|
||||
webUrl: this.$VUE_APP_RESOURCES_URL,
|
||||
isLoad: false,
|
||||
isExpand: false,
|
||||
activeIndex: 0,
|
||||
page: 1,
|
||||
limit: 20,
|
||||
loading: false,
|
||||
loadend: false,
|
||||
picColumnWidth: '325rpx',
|
||||
scrollData: {},
|
||||
infoArray: [],
|
||||
@@ -411,9 +418,8 @@ export default {
|
||||
},
|
||||
isMyInn: false, //是否是自己的客栈
|
||||
goodsList: [],
|
||||
goodsPage: 1,
|
||||
showShare: false,
|
||||
posterUrl: "", // 分享海报
|
||||
posterUrl: '', // 分享海报
|
||||
id: null,
|
||||
partnerId: null,
|
||||
isLike: false, //点赞
|
||||
@@ -431,54 +437,47 @@ export default {
|
||||
]
|
||||
}
|
||||
},
|
||||
//必须在页面加 onPageScroll(e){} ,才能滑动显示背景
|
||||
// 必须在页面加 onPageScroll(e){} ,才能滑动显示背景
|
||||
onPageScroll(e) {
|
||||
this.scrollData = e;
|
||||
},
|
||||
onShow: function () {
|
||||
this.page = 1;
|
||||
this.loading = false;
|
||||
this.loadend = false;
|
||||
this.scrollData = e
|
||||
},
|
||||
onLoad: function (options) {
|
||||
if (options.id) {
|
||||
this.id = options.id || null;
|
||||
this.partnerId = options.partnerId || null;
|
||||
this.id = options.id || null
|
||||
this.partnerId = options.partnerId || null
|
||||
} else {
|
||||
let obj = uni.getEnterOptionsSync();
|
||||
let obj = uni.getEnterOptionsSync()
|
||||
if (options.scene || obj.query.scene) {
|
||||
let query = options ? decodeURIComponent(options.scene) : decodeURIComponent(obj.query.scene);
|
||||
this.id = getUrlParam(query, "id") || null;
|
||||
this.partnerId = getUrlParam(query, "partnerId") || null;
|
||||
const query = options ? decodeURIComponent(options.scene) : decodeURIComponent(obj.query.scene)
|
||||
this.id = getUrlParam(query, 'id') || null
|
||||
this.partnerId = getUrlParam(query, 'partnerId') || null
|
||||
}
|
||||
}
|
||||
if (this.partnerId) cookie.set("spread", this.partnerId);
|
||||
this.fetchInnDetail();
|
||||
this.fetchInnInfoList();
|
||||
this.initPoster();
|
||||
let that = this;
|
||||
this.isMyInn = (this.$yroute.query.isMyInn != null ? true : false);
|
||||
if (this.partnerId) cookie.set('spread', this.partnerId)
|
||||
this.fetchInnDetail()
|
||||
this.fetchInnInfoList()
|
||||
this.initPoster()
|
||||
this.isMyInn = (this.$yroute.query.isMyInn != null ? true : false)
|
||||
uni.getSystemInfo({
|
||||
success: (e) => {
|
||||
//两列商品宽度
|
||||
that.picColumnWidth = (e.screenWidth - uni.upx2px(92)) / 2 + 'px';
|
||||
// 两列商品宽度
|
||||
this.picColumnWidth = (e.screenWidth - uni.upx2px(92)) / 2 + 'px'
|
||||
}
|
||||
});
|
||||
})
|
||||
},
|
||||
// 下拉刷新
|
||||
onPullDownRefresh() {
|
||||
if (this.activeIndex == 0) {
|
||||
this.page = 1;
|
||||
this.loading = false;
|
||||
this.loadend = false;
|
||||
this.fetchInnInfoList();
|
||||
} else {
|
||||
this.fetchInnDetail();
|
||||
onShow() {
|
||||
if (!this.isLoad) {
|
||||
return
|
||||
}
|
||||
if (this.inn.hasProduct <= 0) {
|
||||
this.fetchGoods()
|
||||
}
|
||||
this.fetchInnInfoList()
|
||||
this.fetchInnDetail()
|
||||
},
|
||||
methods: {
|
||||
changeShare() {
|
||||
this.showShare = !this.showShare;
|
||||
this.showShare = !this.showShare
|
||||
},
|
||||
goGoodsConByID(item) {
|
||||
this.$yrouter.push({
|
||||
@@ -486,22 +485,21 @@ export default {
|
||||
query: {
|
||||
id: item.id
|
||||
}
|
||||
});
|
||||
})
|
||||
},
|
||||
saveImg() {
|
||||
let that = this;
|
||||
const _this = this
|
||||
uni.getSetting({
|
||||
success: getRes => {
|
||||
if (getRes.authSetting["scope.writePhotosAlbum"]) {
|
||||
that.downloadImage();
|
||||
_this.downloadImage()
|
||||
} else {
|
||||
uni.authorize({
|
||||
scope: "scope.writePhotosAlbum",
|
||||
success: () => {
|
||||
that.downloadImage();
|
||||
_this.downloadImage()
|
||||
},
|
||||
fail: () => {
|
||||
console.log("authorize fail")
|
||||
uni.openSetting({
|
||||
success: openRes => {
|
||||
console.log(typeof openRes, openRes)
|
||||
@@ -523,20 +521,20 @@ export default {
|
||||
})
|
||||
},
|
||||
downloadImage() {
|
||||
let that = this;
|
||||
const randomID = () => Math.random().toString(36).substring(2);
|
||||
const _this = this
|
||||
const randomID = () => Math.random().toString(36).substring(2)
|
||||
uni.downloadFile({
|
||||
url: this.posterUrl, //网络图片的地址
|
||||
filePath: wx.env.USER_DATA_PATH + "/share_" + randomID() + ".png", //指定的本地文件路径
|
||||
url: this.posterUrl, // 网络图片的地址
|
||||
filePath: wx.env.USER_DATA_PATH + "/share_" + randomID() + ".png", // 指定的本地文件路径
|
||||
success: downRes => {
|
||||
uni.saveImageToPhotosAlbum({
|
||||
filePath: downRes.filePath, //临时文件地址
|
||||
filePath: downRes.filePath, // 临时文件地址
|
||||
success: function () {
|
||||
uni.showToast({
|
||||
title: "保存成功",
|
||||
icon: "success",
|
||||
success() {
|
||||
that.showShare = false;
|
||||
_this.showShare = false
|
||||
}
|
||||
})
|
||||
},
|
||||
@@ -556,147 +554,122 @@ export default {
|
||||
}
|
||||
})
|
||||
},
|
||||
doExpandDesc: function () {
|
||||
this.isExpand = !this.isExpand;
|
||||
},
|
||||
showQrcode: function () {
|
||||
uni.previewImage({
|
||||
current: 0,
|
||||
urls: [this.inn.qrcode]
|
||||
});
|
||||
},
|
||||
zanInn: function () {
|
||||
getHotelZan(this.inn.id).then(() => {
|
||||
this.isLike = !this.isLike;
|
||||
this.fetchInnDetail();
|
||||
this.isLike = !this.isLike
|
||||
this.fetchInnDetail()
|
||||
}).catch((err) => {
|
||||
uni.showToast({
|
||||
title: err.msg + '',
|
||||
icon: 'none',
|
||||
mask: false,
|
||||
duration: 1500
|
||||
});
|
||||
})
|
||||
})
|
||||
},
|
||||
infoClick: function (info) {
|
||||
this.$yrouter.push('/pagesInn/inn/innInfoDetail?id=' + info.id);
|
||||
this.$yrouter.push('/pagesInn/inn/innInfoDetail?id=' + info.id)
|
||||
},
|
||||
publishBtnClick: function () {
|
||||
this.$yrouter.push('/pagesInn/inn/innInfoPublish?hotelId=' + this.inn.id);
|
||||
this.$yrouter.push('/pagesInn/inn/innInfoPublish?hotelId=' + this.inn.id)
|
||||
},
|
||||
modifyBtnClick: function () {
|
||||
this.$yrouter.push("/pagesInn/inn/innProfileEdit?hotel=" + encodeURIComponent(JSON.stringify(this.inn)));
|
||||
// this.$yrouter.push('/pagesInn/inn/innProfileEdit');
|
||||
uni.setStorageSync('MY_HOTEL_INFO', JSON.stringify(this.inn))
|
||||
this.$yrouter.push("/pagesInn/inn/innProfileEdit?id=" + this.inn.id)
|
||||
},
|
||||
//删除客栈动态
|
||||
// 删除客栈动态
|
||||
deleteInnInfo: function (info, index) {
|
||||
let that = this;
|
||||
that.toggleMoreHandle(index)
|
||||
const _this = this
|
||||
_this.toggleMoreHandle(index)
|
||||
uni.showModal({
|
||||
title: '确认删除此动态?',
|
||||
content: '',
|
||||
title: '提示',
|
||||
content: '确认删除此动态?',
|
||||
showCancel: true,
|
||||
cancelText: '取消',
|
||||
confirmText: '确认',
|
||||
success: res => {
|
||||
|
||||
if (res.confirm) {
|
||||
uni.showLoading();
|
||||
uni.showLoading()
|
||||
postHotelNewsDel({
|
||||
id: info.id,
|
||||
hotelId: that.inn.id
|
||||
hotelId: _this.inn.id
|
||||
}).then((res1) => {
|
||||
uni.hideLoading();
|
||||
that.$dialog.toast({
|
||||
uni.hideLoading()
|
||||
_this.$dialog.toast({
|
||||
mes: '删除成功!'
|
||||
});
|
||||
})
|
||||
// 删除成功刷新动态列表
|
||||
that.page = 1;
|
||||
that.loading = false;
|
||||
that.loadend = false;
|
||||
that.fetchInnInfoList();
|
||||
_this.fetchInnInfoList()
|
||||
}).catch((err) => {
|
||||
uni.hideLoading();
|
||||
uni.hideLoading()
|
||||
uni.showToast({
|
||||
title: err.msg,
|
||||
icon: "none",
|
||||
duration: 1500
|
||||
});
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
});
|
||||
})
|
||||
},
|
||||
fetchInnInfoList: function () {
|
||||
let that = this;
|
||||
if (that.loading) return; //阻止下次请求(false可以进行请求);
|
||||
if (that.loadend) return; //阻止结束当前请求(false可以进行请求);
|
||||
that.loading = true;
|
||||
getHotelNewsList({
|
||||
page: that.page,
|
||||
limit: that.limit,
|
||||
hotelId: that.id
|
||||
}).then(res => {
|
||||
that.loading = false;
|
||||
//apply();js将一个数组插入另一个数组;
|
||||
if (that.page == 1) {
|
||||
that.infoArray = [];
|
||||
}
|
||||
that.infoArray.push.apply(that.infoArray, res.data.map((info) => {
|
||||
var pt = info.createdTime.replace(/-/g, "/");
|
||||
info.year = formatDateTime(pt, 'yyyy');
|
||||
info.monthDay = formatDateTime(pt, 'MM/dd');
|
||||
info.time = formatDateTime(pt, 'HH:mm:ss');
|
||||
info.showMore = false
|
||||
return info;
|
||||
}));
|
||||
that.loadend = res.data.length < that.limit; //判断所有数据是否加载完成;
|
||||
that.page = that.page + 1;
|
||||
}).catch((err) => {
|
||||
|
||||
}).finally(() => {
|
||||
uni.stopPullDownRefresh();
|
||||
});
|
||||
},
|
||||
handleRichText: function (str) {
|
||||
if (str != null) {
|
||||
return `<span class="fixed">简介:</span>` + str.replace(/<\/?[^>]*>/g, '');
|
||||
} else {
|
||||
return '';
|
||||
const _this = this
|
||||
if (_this.loading) {
|
||||
return
|
||||
}
|
||||
_this.loading = true
|
||||
_this.infoArray = []
|
||||
getHotelNewsList({
|
||||
page: 1,
|
||||
limit: 9999,
|
||||
hotelId: _this.id
|
||||
}).then(res => {
|
||||
_this.loading = false
|
||||
_this.infoArray.push.apply(_this.infoArray, res.data.map((info) => {
|
||||
var pt = info.createdTime.replace(/-/g, "/")
|
||||
info.year = formatDateTime(pt, 'yyyy')
|
||||
info.monthDay = formatDateTime(pt, 'MM/dd')
|
||||
info.time = formatDateTime(pt, 'HH:mm:ss')
|
||||
info.showMore = false
|
||||
return info
|
||||
}))
|
||||
}).finally(() => {
|
||||
_this.loading = false
|
||||
uni.stopPullDownRefresh()
|
||||
})
|
||||
},
|
||||
fetchInnDetail: function () {
|
||||
const that = this
|
||||
const _this = this
|
||||
let reqFn = null
|
||||
if (that.isMyInn) {
|
||||
if (_this.isMyInn) {
|
||||
reqFn = getHotelDetail
|
||||
} else {
|
||||
reqFn = getHomeHotelDetail
|
||||
}
|
||||
reqFn(that.id).then((res) => {
|
||||
reqFn(_this.id).then((res) => {
|
||||
const { success, data } = res
|
||||
if (success) {
|
||||
that.isLoad = true
|
||||
that.inn = data
|
||||
that.isLike = data.zanVo !== null
|
||||
that.isFavorite = data.hasFavorite
|
||||
that.favoriteCount = data.favoriteCount
|
||||
that.inn.latitude = that.inn.latitude ? parseFloat(that.inn.latitude) : 24.993587
|
||||
that.inn.longitude = that.inn.longitude ? parseFloat(that.inn.longitude) : 102.779656
|
||||
_this.isLoad = true
|
||||
_this.inn = data
|
||||
_this.isLike = data.zanVo !== null
|
||||
_this.isFavorite = data.hasFavorite
|
||||
_this.favoriteCount = data.favoriteCount
|
||||
_this.inn.latitude = _this.inn.latitude ? parseFloat(_this.inn.latitude) : 24.993587
|
||||
_this.inn.longitude = _this.inn.longitude ? parseFloat(_this.inn.longitude) : 102.779656
|
||||
// 该店铺无商品则不显示“精选商品”
|
||||
if (data.hasProduct <= 0) {
|
||||
that.activeIndex = 1
|
||||
that.tabList[0].isShow = false
|
||||
_this.activeIndex = 1
|
||||
_this.tabList[0].isShow = false
|
||||
} else {
|
||||
that.fetchGoods()
|
||||
_this.fetchGoods()
|
||||
}
|
||||
// coverType: 1-图片,2-视频
|
||||
if (data.coverType === 2) {
|
||||
uni.getSystemInfo({
|
||||
success: info => {
|
||||
const screenWidth = info.windowWidth
|
||||
that.videoStyle.width = screenWidth + 'px'
|
||||
that.videoStyle.height = screenWidth * 500 / 750 + 'px'
|
||||
_this.videoStyle.width = screenWidth + 'px'
|
||||
_this.videoStyle.height = screenWidth * 500 / 750 + 'px'
|
||||
}
|
||||
})
|
||||
// 视频宽高自适应
|
||||
@@ -728,23 +701,21 @@ export default {
|
||||
*/
|
||||
}
|
||||
}
|
||||
}).catch((err) => {
|
||||
|
||||
}).finally(() => {
|
||||
uni.stopPullDownRefresh();
|
||||
});
|
||||
uni.stopPullDownRefresh()
|
||||
})
|
||||
},
|
||||
initPoster() {
|
||||
getPoster(this.id).then(({data}) => this.posterUrl = data);
|
||||
getPoster(this.id).then(({data}) => this.posterUrl = data)
|
||||
},
|
||||
showLocation: function () {
|
||||
if (!this.inn.latitude || !this.inn.longitude) {
|
||||
this.$dialog.error('暂无位置信息');
|
||||
this.$dialog.error('暂无位置信息')
|
||||
} else {
|
||||
uni.openLocation({
|
||||
latitude: this.inn.latitude,
|
||||
longitude: this.inn.longitude
|
||||
});
|
||||
})
|
||||
}
|
||||
},
|
||||
showPic: function (index) {
|
||||
@@ -754,28 +725,25 @@ export default {
|
||||
})
|
||||
},
|
||||
changeTab: function (index) {
|
||||
this.activeIndex = index;
|
||||
this.page = 1;
|
||||
this.loading = false;
|
||||
this.loadend = false;
|
||||
//刷新数据
|
||||
this.activeIndex = index
|
||||
this.loading = false
|
||||
// 刷新数据
|
||||
switch (this.activeIndex) {
|
||||
case 1:
|
||||
this.fetchInnInfoList();
|
||||
break;
|
||||
this.fetchInnInfoList()
|
||||
break
|
||||
case 0:
|
||||
this.goodsPage = 1;
|
||||
this.goodsList = [];
|
||||
this.fetchGoods();
|
||||
break;
|
||||
this.goodsList = []
|
||||
this.fetchGoods()
|
||||
break
|
||||
default:
|
||||
break;
|
||||
break
|
||||
}
|
||||
},
|
||||
fetchGoods() {
|
||||
getHotelGoodList({
|
||||
id: this.inn.id,
|
||||
page: this.goodsPage,
|
||||
page: 1,
|
||||
limit: 12
|
||||
}).then(res => {
|
||||
const { success, data } = res
|
||||
@@ -802,9 +770,9 @@ export default {
|
||||
fail: (res) => {
|
||||
console.log('调用失败!')
|
||||
}
|
||||
});
|
||||
})
|
||||
} else {
|
||||
this.$dialog.error('电话为空');
|
||||
this.$dialog.error('电话为空')
|
||||
}
|
||||
},
|
||||
async doneFavorite() {
|
||||
@@ -827,14 +795,14 @@ export default {
|
||||
},
|
||||
viewAllGoodHandle() {
|
||||
uni.navigateTo({
|
||||
url: '/pagesInn/inn/innGoodList?id=' + this.inn.id,
|
||||
url: '/pagesInn/inn/innGoodList?id=' + this.inn.id
|
||||
})
|
||||
},
|
||||
setTopInfoHandle(item) {
|
||||
setTopInfoHandle(item, isTop) {
|
||||
uni.showLoading()
|
||||
setTopHotelNew({
|
||||
id: item.id,
|
||||
isTop: 1
|
||||
isTop
|
||||
}).then(res => {
|
||||
const { success } = res
|
||||
if (success) {
|
||||
@@ -851,37 +819,6 @@ export default {
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.conter {
|
||||
/* width:600upx; */
|
||||
height: auto;
|
||||
min-height: 100rpx;
|
||||
display: -webkit-box;
|
||||
word-break: break-all;
|
||||
-webkit-box-orient: vertical;
|
||||
/* 要显示多少行就改变line-clamp的数据,此处折叠起来显示一行*/
|
||||
-webkit-line-clamp: 5;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
background-color: #F5F5F5;
|
||||
padding: 10rpx;
|
||||
}
|
||||
|
||||
.hide {
|
||||
display: -webkit-box;
|
||||
}
|
||||
|
||||
.show {
|
||||
display: block;
|
||||
}
|
||||
|
||||
|
||||
.conter >>> img {
|
||||
display: block;
|
||||
max-width: 100% !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
<style scoped lang="less">
|
||||
@import "@/assets/css/store.less";
|
||||
.my-inn-page {
|
||||
@@ -1333,6 +1270,9 @@ export default {
|
||||
border-radius: 12rpx;
|
||||
background-color: #fff;
|
||||
box-shadow: 0px 1px 6px rgba(0,0,0,0.16);
|
||||
.more-item + .more-item {
|
||||
border-top: 1px solid #d5d5d5;
|
||||
}
|
||||
.more-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
@@ -1340,9 +1280,6 @@ export default {
|
||||
height: 70rpx;
|
||||
font-size: 14px;
|
||||
color: #333;
|
||||
&:first-child {
|
||||
border-bottom: 1px solid #d5d5d5;
|
||||
}
|
||||
.more-icon {
|
||||
width: 36rpx;
|
||||
height: 36rpx;
|
||||
|
||||
@@ -223,8 +223,9 @@
|
||||
border-radius: 6rpx;
|
||||
}
|
||||
.inp-input {
|
||||
height: 72rpx;
|
||||
line-height: 72rpx;
|
||||
padding: 0 16rpx;
|
||||
height: 76rpx;
|
||||
line-height: 76rpx;
|
||||
}
|
||||
.title {
|
||||
margin: 0 0 10rpx 0;
|
||||
|
||||
+199
-197
@@ -1,25 +1,30 @@
|
||||
<template>
|
||||
<view class="container">
|
||||
|
||||
<view class="base-info-section" style="margin-bottom: 86rpx;margin-bottom: 86rpx;">
|
||||
<!-- <text class="section-title">详细信息</text> -->
|
||||
<view class="item is_required" @click="chooseLogoImg()">
|
||||
<view class="base-info-section">
|
||||
<view
|
||||
class="item is_required"
|
||||
@click="chooseLogoImg()"
|
||||
>
|
||||
<view class="cell acea-row row-between row-middle">
|
||||
<view class="cell-title">店铺LOGO</view>
|
||||
<view class="">
|
||||
<image style="width: 64rpx;height: 64rpx;"
|
||||
:src="innApplyInfo.logo.length>0?innApplyInfo.logo:webUrl+'/20210228103411271415.png'"
|
||||
mode=""></image>
|
||||
<view>
|
||||
<image
|
||||
:src="innApplyInfo.logo ? innApplyInfo.logo : webUrl + '/20210228103411271415.png'"
|
||||
class="img-item"
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
<text class="iconfont icon-jiantou"></text>
|
||||
</view>
|
||||
|
||||
<view class="item is_required">
|
||||
<view class="cell acea-row row-between row-middle">
|
||||
<view class="cell-title">店铺类型</view>
|
||||
<view class="cell-value">
|
||||
<picker :value="typeIndex" @change="typePickerChange" :range="typeRange">
|
||||
<picker
|
||||
:value="typeIndex"
|
||||
:range="typeRange"
|
||||
@change="typePickerChange"
|
||||
>
|
||||
<view style="text-align: right;font-size:24rpx;color:#C2C5CC;" v-if="typeList.length>0">
|
||||
{{ typeList[typeIndex].name }}
|
||||
</view>
|
||||
@@ -29,97 +34,110 @@
|
||||
</view>
|
||||
<text class="iconfont icon-jiantou"></text>
|
||||
</view>
|
||||
|
||||
<view class="item is_required" @click="chooseCoverImg()">
|
||||
<view v-if="innApplyInfo.coverType === 1" class="item is_required" @click="chooseCoverImg()">
|
||||
<view class="cell acea-row row-between row-middle">
|
||||
<view class="cell-title">封面照片</view>
|
||||
<view class="">
|
||||
<image style="width: 64rpx;height: 64rpx;"
|
||||
:src="innApplyInfo.cover.length>0?innApplyInfo.cover:webUrl+'/20210228103411271415.png'"
|
||||
mode=""></image>
|
||||
<view>
|
||||
<image
|
||||
:src="innApplyInfo.cover ? innApplyInfo.cover : webUrl + '/20210228103411271415.png'"
|
||||
class="img-item"
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
<text class="iconfont icon-jiantou"></text>
|
||||
</view>
|
||||
<view v-if="innApplyInfo.coverType === 2" class="item is_required" @click="chooseLogoVideo()">
|
||||
<view class="cell acea-row row-between row-middle">
|
||||
<view class="cell-title">封面视频</view>
|
||||
<view>
|
||||
<video
|
||||
:src="innApplyInfo.coverVideo"
|
||||
:poster="innApplyInfo.coverVideo + '?vframe/jpg/offset/1'"
|
||||
:controls="false"
|
||||
play-btn-position="center"
|
||||
class="video-item"
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
<text class="iconfont icon-jiantou"></text>
|
||||
</view>
|
||||
|
||||
<view class="item" @click="chooseQrcodeImg()">
|
||||
<view class="cell acea-row row-between row-middle">
|
||||
<view class="cell-title">微信二维码</view>
|
||||
<view class="">
|
||||
<image style="width: 64rpx;height: 64rpx;"
|
||||
:src="innApplyInfo.qrcode.length>0?innApplyInfo.qrcode:webUrl+'/20210228103411271415.png'"
|
||||
mode=""></image>
|
||||
<view>
|
||||
<image
|
||||
:src="innApplyInfo.qrcode ? innApplyInfo.qrcode : webUrl + '/20210228103411271415.png'"
|
||||
class="img-item"
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
<text class="iconfont icon-jiantou"></text>
|
||||
</view>
|
||||
|
||||
<view class="item is_required">
|
||||
<view class="cell acea-row row-between row-middle">
|
||||
<view class="cell-title">店主名字</view>
|
||||
<view class="cell-value" style="text-align: right;">
|
||||
<input type="text" v-model="innApplyInfo.ownerName" placeholder="请输入店主名字"
|
||||
placeholder-style="font-size:24rpx;color:#C2C5CC;"/>
|
||||
<view class="cell-value">
|
||||
<input
|
||||
v-model="innApplyInfo.ownerName"
|
||||
type="text"
|
||||
placeholder="请输入店主名字"
|
||||
placeholder-style="font-size:24rpx;color:#C2C5CC;"
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- <view class="item is_required">-->
|
||||
<!-- <view class="cell acea-row row-between row-middle">-->
|
||||
<!-- <view class="cell-title">关键词</view>-->
|
||||
<!-- <view class="cell-value" style="text-align: right;">-->
|
||||
<!-- <input type="text" v-model="innApplyInfo.tips" placeholder="店主想对游客说的话" placeholder-style="font-size:24rpx;color:#C2C5CC;" />-->
|
||||
<!-- </view>-->
|
||||
<!-- </view>-->
|
||||
<!-- </view>-->
|
||||
|
||||
<view class="item is_required">
|
||||
<view class="cell acea-row row-between row-middle">
|
||||
<view class="cell-title">一句话介绍</view>
|
||||
<view class="cell-value" style="text-align: right;">
|
||||
<input type="text" v-model="innApplyInfo.content" placeholder="店铺风格一句话描述"
|
||||
placeholder-style="font-size:24rpx;color:#C2C5CC;"/>
|
||||
<view class="cell-value">
|
||||
<input
|
||||
v-model="innApplyInfo.content"
|
||||
type="text"
|
||||
placeholder="店铺风格一句话描述"
|
||||
placeholder-style="font-size:24rpx;color:#C2C5CC;"
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="item is_required">
|
||||
<view class="cell acea-row row-column">
|
||||
<view class="cell-title">店铺简介</view>
|
||||
<view class="">
|
||||
<textarea style="height: 200rpx;color:#C2C5CC;" v-model="innApplyInfo.desc" placeholder="请输入店铺简介..."
|
||||
placeholder-style="font-size:24rpx;color:#C2C5CC;"/>
|
||||
<view>
|
||||
<textarea
|
||||
v-model="innApplyInfo.desc"
|
||||
placeholder="请输入店铺简介..."
|
||||
placeholder-style="font-size:24rpx;color:#C2C5CC;"
|
||||
class="inp-textarea"
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="item">
|
||||
<view class="img-upload">
|
||||
<tm-upload
|
||||
:dataList="picsArray"
|
||||
:upload_img_wh="uploadImgWH"
|
||||
:upload_max="uploadMax"
|
||||
:url="uploadUrl"
|
||||
:header="uploadHeader"
|
||||
@change="uploadedImgChange"/>
|
||||
:dataList="picsArray"
|
||||
:upload_img_wh="(750 - 3 * 16 - 2 * 32) / 3.0"
|
||||
:upload_max="10"
|
||||
:url="uploadUrl"
|
||||
:header="uploadHeader"
|
||||
@change="uploadedImgChange"
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
|
||||
<view class="submit-btn" @tap="submit">确定修改</view>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import CitySelect from "@/components/CitySelect";
|
||||
import tmUpload from '@/pagesInn/components/tm-upload/tm-upload.vue';
|
||||
import {chooseImage} from "@/utils";
|
||||
import {VUE_APP_API_URL} from "@/config"
|
||||
import {getHotelTypeList, postHotelInfoEdit} from "@/api/inn.js";
|
||||
|
||||
var that;
|
||||
import CitySelect from '@/components/CitySelect'
|
||||
import tmUpload from '@/pagesInn/components/tm-upload/tm-upload.vue'
|
||||
import {
|
||||
chooseImage,
|
||||
chooseVideoToUpload
|
||||
} from '@/utils'
|
||||
import {VUE_APP_API_URL} from '@/config'
|
||||
import {getHotelTypeList, postHotelInfoEdit} from '@/api/inn.js'
|
||||
export default {
|
||||
components: {
|
||||
CitySelect,
|
||||
@@ -129,190 +147,164 @@ export default {
|
||||
return {
|
||||
webUrl: this.$VUE_APP_RESOURCES_URL,
|
||||
uploadUrl: VUE_APP_API_URL + '/api/upload',
|
||||
uploadImgWH: (750 - 3 * 16 - 2 * 32) / 3.0,
|
||||
uploadHeader: {
|
||||
Authorization: "Bearer " + this.$store.getters.token
|
||||
Authorization: 'Bearer ' + this.$store.getters.token
|
||||
},
|
||||
innHistory: {},//历史信息
|
||||
innHistory: {}, // 历史信息
|
||||
picsArray: [],
|
||||
typeList: [],//类型列表
|
||||
typeIndex: 0,//选中的类型
|
||||
typeRange: [],//类型数据源
|
||||
typeList: [], // 类型列表
|
||||
typeIndex: 0, // 选中的类型
|
||||
typeRange: [], // 类型数据源
|
||||
uploadedFilesArray: [],
|
||||
uploadMax: 10,
|
||||
innApplyInfo: {
|
||||
"address": "",
|
||||
"areaId": 0,
|
||||
"cityId": 0,
|
||||
"provinceId": 0,
|
||||
"content": "",
|
||||
"cover": "",
|
||||
"desc": "",
|
||||
"logo": "",
|
||||
"name": "",
|
||||
"ownerName": "",
|
||||
"pics": [],
|
||||
"position": "",
|
||||
"tel": "",
|
||||
"qrcode": "",
|
||||
"tips": "",
|
||||
"type": "",
|
||||
'address': '',
|
||||
'areaId': 0,
|
||||
'cityId': 0,
|
||||
'provinceId': 0,
|
||||
'content': '',
|
||||
'cover': '',
|
||||
'coverType': 1, // coverType: 1-图片,2-视频
|
||||
'desc': '',
|
||||
'logo': '',
|
||||
'name': '',
|
||||
'ownerName': '',
|
||||
'pics': [],
|
||||
'position': '',
|
||||
'tel': '',
|
||||
'qrcode': '',
|
||||
'tips': '',
|
||||
'type': ''
|
||||
}
|
||||
}
|
||||
},
|
||||
onShow: function () {
|
||||
this.getHotelType();
|
||||
onShow() {
|
||||
this.getHotelType()
|
||||
},
|
||||
onLoad: function (e) {
|
||||
that = this;
|
||||
if (e.hotel) {
|
||||
//赋值
|
||||
var hotel = JSON.parse(decodeURIComponent(e.hotel));
|
||||
this.innHistory = hotel;
|
||||
|
||||
this.fillData(this.innApplyInfo, this.innHistory);
|
||||
|
||||
//Object.assign(this.innApplyInfo,hotel);
|
||||
|
||||
|
||||
//this.addressText = this.innHistory.provinceName+" "+this.innHistory.cityName+" "+this.innHistory.areaName;
|
||||
|
||||
//图片填充
|
||||
onLoad(options) {
|
||||
const id = options.id
|
||||
if (id) {
|
||||
// 赋值
|
||||
const hotel = JSON.parse(uni.getStorageSync('MY_HOTEL_INFO'))
|
||||
this.innHistory = hotel
|
||||
this.fillData(this.innApplyInfo, this.innHistory)
|
||||
if (hotel.coverType === 2) {
|
||||
this.innApplyInfo.coverVideo = hotel.cover
|
||||
} else {
|
||||
this.innApplyInfo.coverVideo = ''
|
||||
}
|
||||
// 图片填充
|
||||
this.picsArray = hotel.pics.map(function (item) {
|
||||
var obj = {
|
||||
return {
|
||||
path: item,
|
||||
upload_percent: 100
|
||||
}
|
||||
return obj;
|
||||
});
|
||||
})
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
typePickerChange: function (e) {
|
||||
this.typeIndex = e.target.value;
|
||||
|
||||
//修改type
|
||||
this.typeIndex = e.target.value
|
||||
// 修改type
|
||||
if (this.typeList.length > 0) {
|
||||
this.$set(this.innApplyInfo, 'type', this.typeList[this.typeIndex].id);
|
||||
this.$set(this.innApplyInfo, 'type', this.typeList[this.typeIndex].id)
|
||||
}
|
||||
},
|
||||
getHotelType: function () {
|
||||
getHotelType() {
|
||||
const _this = this
|
||||
getHotelTypeList().then((res) => {
|
||||
that.typeList = res.data;
|
||||
|
||||
//构建数据源
|
||||
that.typeRange = [];
|
||||
that.typeList.forEach((item, index) => {
|
||||
that.typeRange.push(item.name);
|
||||
});
|
||||
|
||||
//重新填写模式预填充type
|
||||
let len = this.typeList.length;
|
||||
_this.typeList = res.data
|
||||
// 构建数据源
|
||||
_this.typeRange = [];
|
||||
_this.typeList.forEach((item, index) => {
|
||||
_this.typeRange.push(item.name)
|
||||
})
|
||||
// 重新填写模式预填充type
|
||||
const len = this.typeList.length
|
||||
if (len > 0) {
|
||||
for (let i = 0; i < len; i++) {
|
||||
if (this.typeList[i].id === this.innHistory.type) this.typeIndex = i;
|
||||
if (this.typeList[i].id === this.innHistory.type) this.typeIndex = i
|
||||
}
|
||||
}
|
||||
}).catch((err) => {
|
||||
}).finally(() => {
|
||||
})
|
||||
},
|
||||
fillData: function (target, source) {
|
||||
//var keys = Object.keys(target);
|
||||
//this.uploadedFilesArray = source.pics;
|
||||
|
||||
Object.keys(target).forEach((value, key) => {
|
||||
target[value] = source[value];
|
||||
// console.log('key:'+value);
|
||||
});
|
||||
target[value] = source[value]
|
||||
})
|
||||
},
|
||||
//文件上传结果
|
||||
// 文件上传结果
|
||||
uploadedImgChange: function (uploadedFilesList) {
|
||||
this.uploadedFilesArray = uploadedFilesList;
|
||||
this.uploadedFilesArray = uploadedFilesList
|
||||
},
|
||||
chooseQrcodeImg: function () {
|
||||
chooseQrcodeImg() {
|
||||
chooseImage(img => {
|
||||
that.$set(that.innApplyInfo, 'qrcode', img);
|
||||
});
|
||||
this.$set(this.innApplyInfo, 'qrcode', img)
|
||||
})
|
||||
},
|
||||
chooseLogoImg: function () {
|
||||
chooseLogoImg() {
|
||||
chooseImage(img => {
|
||||
that.innApplyInfo.logo = img;
|
||||
});
|
||||
this.$set(this.innApplyInfo, 'logo', img)
|
||||
})
|
||||
},
|
||||
chooseCoverImg: function () {
|
||||
chooseLogoVideo() {
|
||||
chooseVideoToUpload(path => {
|
||||
this.$set(this.innApplyInfo, 'coverVideo', path)
|
||||
})
|
||||
},
|
||||
chooseCoverImg() {
|
||||
chooseImage(img => {
|
||||
that.innApplyInfo.cover = img;
|
||||
});
|
||||
this.$set(this.innApplyInfo, 'cover', img)
|
||||
})
|
||||
},
|
||||
// successImage(e){
|
||||
// uni.showModal({
|
||||
// content : '上传成功,详细信息请看控制台'
|
||||
// })
|
||||
// },
|
||||
// successvideo(e){
|
||||
// },
|
||||
submit: function () {
|
||||
|
||||
if (this.innApplyInfo.logo.length == 0) {
|
||||
this.$dialog.error("请上传店铺LOGO图片");
|
||||
return;
|
||||
submit() {
|
||||
if (this.innApplyInfo.logo.length === 0) {
|
||||
this.$dialog.error('请上传店铺LOGO图片')
|
||||
return
|
||||
}
|
||||
|
||||
if (this.innApplyInfo.cover.length == 0) {
|
||||
this.$dialog.error("请上传店铺封面图片");
|
||||
return;
|
||||
if (this.innApplyInfo.cover.length === 0 && this.innApplyInfo.coverType === 1) {
|
||||
this.$dialog.error('请上传店铺封面图片')
|
||||
return
|
||||
}
|
||||
|
||||
if (this.innApplyInfo.ownerName.length == 0) {
|
||||
this.$dialog.error("请输入店主名字");
|
||||
return;
|
||||
if (this.innApplyInfo.coverVideo.length === 0 && this.innApplyInfo.coverType === 2) {
|
||||
this.$dialog.error('请上传店铺封面视频')
|
||||
return
|
||||
}
|
||||
|
||||
// if (this.innApplyInfo.tips.length == 0) {
|
||||
// this.$dialog.error("请输入关键词");
|
||||
// return;
|
||||
// }
|
||||
|
||||
if (this.innApplyInfo.content.length == 0) {
|
||||
this.$dialog.error("请输入一句话介绍");
|
||||
return;
|
||||
if (this.innApplyInfo.ownerName.length === 0) {
|
||||
this.$dialog.error('请输入店主名字')
|
||||
return
|
||||
}
|
||||
|
||||
if (this.innApplyInfo.desc.length == 0) {
|
||||
this.$dialog.error("请输入店铺简介");
|
||||
return;
|
||||
if (this.innApplyInfo.content.length === 0) {
|
||||
this.$dialog.error('请输入一句话介绍')
|
||||
return
|
||||
}
|
||||
|
||||
if (this.uploadedFilesArray.length == 0) {
|
||||
this.$dialog.error("请上传至少一张店铺图片");
|
||||
return;
|
||||
if (this.innApplyInfo.desc.length === 0) {
|
||||
this.$dialog.error('请输入店铺简介')
|
||||
return
|
||||
}
|
||||
|
||||
var param = {};
|
||||
//深拷贝
|
||||
param = JSON.parse(JSON.stringify(this.innApplyInfo));
|
||||
if (this.uploadedFilesArray.length === 0) {
|
||||
this.$dialog.error('请上传至少一张店铺图片')
|
||||
return
|
||||
}
|
||||
// 深拷贝
|
||||
const param = JSON.parse(JSON.stringify(this.innApplyInfo))
|
||||
if (this.uploadedFilesArray.length > 0) {
|
||||
param.pics = this.uploadedFilesArray.join(',');
|
||||
param.pics = this.uploadedFilesArray.join(',')
|
||||
}
|
||||
|
||||
param.id = this.innHistory.id;
|
||||
|
||||
|
||||
uni.showLoading();
|
||||
param.id = this.innHistory.id
|
||||
if (param.coverType === 2) {
|
||||
param.cover = param.coverVideo
|
||||
}
|
||||
uni.showLoading()
|
||||
postHotelInfoEdit(param).then((res) => {
|
||||
uni.hideLoading()
|
||||
uni.showToast({
|
||||
title: '修改成功!',
|
||||
mask: false,
|
||||
duration: 1500
|
||||
});
|
||||
|
||||
})
|
||||
setTimeout(function () {
|
||||
|
||||
that.$yrouter.back();
|
||||
|
||||
}, 1000);
|
||||
uni.navigateBack()
|
||||
}, 1000)
|
||||
}).catch((err) => {
|
||||
uni.hideLoading()
|
||||
uni.showToast({
|
||||
@@ -320,22 +312,31 @@ export default {
|
||||
icon: 'none',
|
||||
mask: false,
|
||||
duration: 1500
|
||||
});
|
||||
}).finally(() => {
|
||||
|
||||
})
|
||||
})
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
|
||||
|
||||
.base-info-section {
|
||||
padding: 32rpx;
|
||||
padding: 32rpx 32rpx 120rpx 32rpx;
|
||||
background: #FFFFFF;
|
||||
.img-item {
|
||||
display: block;
|
||||
width: 64rpx;
|
||||
height: 64rpx;
|
||||
}
|
||||
.video-item {
|
||||
width: 64rpx;
|
||||
height: 64rpx;
|
||||
}
|
||||
.inp-textarea {
|
||||
width: 100%;
|
||||
height: 200rpx;
|
||||
color:#C2C5CC;
|
||||
}
|
||||
}
|
||||
|
||||
.base-info-section .section-title {
|
||||
@@ -406,6 +407,7 @@ export default {
|
||||
|
||||
.base-info-section .item.is_required .cell .cell-value {
|
||||
flex-grow: 1;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.base-info-section .item.is_required .cell .cell-title::before {
|
||||
|
||||
Reference in New Issue
Block a user