Style(店铺):界面调整
This commit is contained in:
+11
@@ -198,3 +198,14 @@ export function getHotelTypeList() {
|
||||
export function getPoster(id) {
|
||||
return request.get("/api/hotelMain/poster/" + id, {}, {login: true})
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取客栈商品列表
|
||||
* @param data
|
||||
* @returns {*}
|
||||
*/
|
||||
export function getHotelGoodList(data) {
|
||||
return request.get("/api/hotelMain/goodsList", data, {
|
||||
login: false
|
||||
});
|
||||
}
|
||||
+18
-84
@@ -357,7 +357,7 @@ import {
|
||||
getHotelNewsList,
|
||||
getHotelZan,
|
||||
getPoster,
|
||||
goodsList,
|
||||
getHotelGoodList,
|
||||
postHotelNewsDel
|
||||
} from "@/api/inn.js";
|
||||
import {formatDateTime} from "@/utils";
|
||||
@@ -436,18 +436,15 @@ export default {
|
||||
}
|
||||
}
|
||||
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);
|
||||
uni.getSystemInfo({
|
||||
success: (e) => {
|
||||
//两列商品宽度
|
||||
that.picColumnWidth = (e.screenWidth - uni.upx2px(92)) / 2 + 'px';
|
||||
console.log('picColumnWidth:' + that.picColumnWidth);
|
||||
}
|
||||
});
|
||||
},
|
||||
@@ -460,28 +457,12 @@ export default {
|
||||
this.fetchInnInfoList();
|
||||
} else {
|
||||
this.fetchInnDetail();
|
||||
|
||||
}
|
||||
},
|
||||
// 上拉触底
|
||||
onReachBottom() {
|
||||
if (this.activeIndex === 3) {
|
||||
this.goodsPage++;
|
||||
this.fetchGoods();
|
||||
} else {
|
||||
!this.loading && this.fetchInnInfoList();
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
changeShare() {
|
||||
this.showShare = !this.showShare;
|
||||
},
|
||||
goRoom() {
|
||||
uni.navigateTo({
|
||||
url: `/pkg_common/views/room?id=${this.inn.merId}&name=${this.inn.name}`
|
||||
})
|
||||
},
|
||||
|
||||
goGoodsConByID(item) {
|
||||
this.$yrouter.push({
|
||||
path: '/pages/shop/GoodsCon/index',
|
||||
@@ -490,10 +471,8 @@ export default {
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
saveImg() {
|
||||
let that = this;
|
||||
|
||||
uni.getSetting({
|
||||
success: getRes => {
|
||||
if (getRes.authSetting["scope.writePhotosAlbum"]) {
|
||||
@@ -526,17 +505,13 @@ export default {
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
downloadImage() {
|
||||
let that = this;
|
||||
const randomID = () => Math.random().toString(36).substring(2);
|
||||
|
||||
uni.downloadFile({
|
||||
url: this.posterUrl, //网络图片的地址
|
||||
filePath: wx.env.USER_DATA_PATH + "/share_" + randomID() + ".png", //指定的本地文件路径
|
||||
success: downRes => {
|
||||
console.log(typeof downRes, downRes, "down")
|
||||
|
||||
uni.saveImageToPhotosAlbum({
|
||||
filePath: downRes.filePath, //临时文件地址
|
||||
success: function () {
|
||||
@@ -564,7 +539,6 @@ export default {
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
doExpandDesc: function () {
|
||||
this.isExpand = !this.isExpand;
|
||||
},
|
||||
@@ -593,7 +567,6 @@ export default {
|
||||
publishBtnClick: function () {
|
||||
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');
|
||||
@@ -612,47 +585,28 @@ export default {
|
||||
|
||||
if (res.confirm) {
|
||||
uni.showLoading();
|
||||
var param = {
|
||||
postHotelNewsDel({
|
||||
id: info.id,
|
||||
hotelId: that.inn.id
|
||||
}
|
||||
postHotelNewsDel(param).then((res1) => {
|
||||
}).then((res1) => {
|
||||
uni.hideLoading();
|
||||
|
||||
|
||||
that.$dialog.toast({
|
||||
mes: '删除成功!'
|
||||
});
|
||||
//删除成功刷新动态列表
|
||||
// 删除成功刷新动态列表
|
||||
that.page = 1;
|
||||
that.loading = false;
|
||||
that.loadend = false;
|
||||
that.fetchInnInfoList();
|
||||
|
||||
// setTimeout(function() {
|
||||
|
||||
|
||||
// }, 1000);
|
||||
|
||||
|
||||
}).catch((err) => {
|
||||
uni.hideLoading();
|
||||
|
||||
uni.showToast({
|
||||
title: err.msg,
|
||||
icon: "none",
|
||||
duration: 1500
|
||||
});
|
||||
|
||||
}).finally(() => {
|
||||
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
},
|
||||
fail: () => {
|
||||
},
|
||||
complete: () => {
|
||||
}
|
||||
});
|
||||
},
|
||||
@@ -661,12 +615,11 @@ export default {
|
||||
if (that.loading) return; //阻止下次请求(false可以进行请求);
|
||||
if (that.loadend) return; //阻止结束当前请求(false可以进行请求);
|
||||
that.loading = true;
|
||||
let q = {
|
||||
getHotelNewsList({
|
||||
page: that.page,
|
||||
limit: that.limit,
|
||||
hotelId: that.id
|
||||
};
|
||||
getHotelNewsList(q).then(res => {
|
||||
}).then(res => {
|
||||
that.loading = false;
|
||||
//apply();js将一个数组插入另一个数组;
|
||||
if (that.page == 1) {
|
||||
@@ -698,7 +651,7 @@ export default {
|
||||
fetchInnDetail: function () {
|
||||
const that = this
|
||||
let reqFn = null
|
||||
if (this.isMyInn) {
|
||||
if (that.isMyInn) {
|
||||
reqFn = getHotelDetail
|
||||
} else {
|
||||
reqFn = getHomeHotelDetail
|
||||
@@ -717,6 +670,8 @@ export default {
|
||||
if (data.hasProduct <= 0) {
|
||||
that.activeIndex = 1
|
||||
that.tabList[0].isShow = false
|
||||
} else {
|
||||
that.fetchGoods()
|
||||
}
|
||||
// coverType: 1-图片,2-视频
|
||||
if (data.coverType === 2) {
|
||||
@@ -766,18 +721,6 @@ export default {
|
||||
getPoster(this.id).then(({data}) => this.posterUrl = data);
|
||||
},
|
||||
showLocation: function () {
|
||||
// if (this.inn.position != null && this.inn.position.length > 0) {
|
||||
// var arr = this.inn.position.split(",");
|
||||
// uni.openLocation({
|
||||
// latitude: parseFloat(arr[1]),
|
||||
// longitude: parseFloat(arr[0]),
|
||||
// success: function () {
|
||||
// console.log('success');
|
||||
// }
|
||||
// });
|
||||
// } else {
|
||||
// this.$dialog.error('暂无位置信息');
|
||||
// }
|
||||
if (!this.inn.latitude || !this.inn.longitude) {
|
||||
this.$dialog.error('暂无位置信息');
|
||||
} else {
|
||||
@@ -798,56 +741,47 @@ export default {
|
||||
this.page = 1;
|
||||
this.loading = false;
|
||||
this.loadend = false;
|
||||
|
||||
//刷新数据
|
||||
switch (this.activeIndex) {
|
||||
case 0:
|
||||
this.fetchInnDetail();
|
||||
break;
|
||||
case 1:
|
||||
this.fetchInnInfoList();
|
||||
break;
|
||||
case 3:
|
||||
case 0:
|
||||
this.goodsPage = 1;
|
||||
this.goodsList = [];
|
||||
this.fetchGoods();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
},
|
||||
fetchGoods() {
|
||||
goodsList({
|
||||
getHotelGoodList({
|
||||
id: this.inn.id,
|
||||
page: this.goodsPage
|
||||
}).then(({
|
||||
data
|
||||
}) => {
|
||||
let len = data.records.length;
|
||||
page: this.goodsPage,
|
||||
limit: 12
|
||||
}).then(data => {
|
||||
const len = data.records.length;
|
||||
if (len > 0) {
|
||||
for (let i = 0; i < len; i++) {
|
||||
this.goodsList.push(data.records[i]);
|
||||
}
|
||||
}
|
||||
}).catch(() => {
|
||||
})
|
||||
},
|
||||
call: function () {
|
||||
|
||||
if (this.inn.tel != undefined && this.inn.tel.length > 0) {
|
||||
uni.makePhoneCall({
|
||||
|
||||
// 手机号
|
||||
phoneNumber: this.inn.tel,
|
||||
|
||||
// 成功回调
|
||||
success: (res) => {
|
||||
console.log('调用成功!')
|
||||
},
|
||||
|
||||
// 失败回调
|
||||
fail: (res) => {
|
||||
console.log('调用失败!')
|
||||
}
|
||||
|
||||
});
|
||||
} else {
|
||||
this.$dialog.error('电话为空');
|
||||
|
||||
Reference in New Issue
Block a user