Feat(店铺):置顶资讯接口对接

This commit is contained in:
lifizer
2024-03-20 21:48:39 +08:00
parent 326010949b
commit 56fc52bb10
2 changed files with 54 additions and 6 deletions
+43 -6
View File
@@ -181,7 +181,7 @@
</view>
</view>
</view>
<view class="btn">
<view v-show="goodsList.length > 0" class="btn">
<view class="btn-cont" @click="viewAllGoodHandle">
查看所有商品
<text class="iconfont icon-jiantou"></text>
@@ -200,7 +200,14 @@
:key="index"
class="info-item"
>
<view class="info-item-header" @click="infoClick(item)">
<view
:class="item.isTop === 1 ? 'info-item-top' : ''"
:style="{
'background-image': item.isTop ? ('url(' + webUrl + '/page/hotel/info-top-bg.png)') : 'none'
}"
class="info-item-header"
@click="infoClick(item)"
>
<view class="name one-t">
{{ item.name }}
</view>
@@ -255,7 +262,11 @@
v-if="item.showMore"
class="more-wrapper"
>
<view class="more-item">
<view
v-show="item.isTop === 0"
class="more-item"
@click="setTopInfoHandle(item, index)"
>
<image
:src="webUrl + '/page/hotel/settop.png'"
class="more-icon"
@@ -363,7 +374,8 @@ import {
getHotelZan,
getPoster,
getHotelGoodList,
postHotelNewsDel
postHotelNewsDel,
setTopHotelNew
} from "@/api/inn.js";
import {formatDateTime} from "@/utils";
import {getUrlParam} from "@/utils/common.js";
@@ -817,6 +829,23 @@ export default {
uni.navigateTo({
url: '/pagesInn/inn/innGoodList?id=' + this.inn.id,
})
},
setTopInfoHandle(item) {
uni.showLoading()
setTopHotelNew({
id: item.id,
isTop: 1
}).then(res => {
const { success } = res
if (success) {
this.$dialog.toast({
mes: '操作成功!'
})
this.fetchInnInfoList()
}
}).finally(() => {
uni.hideLoading()
})
}
}
}
@@ -976,13 +1005,15 @@ export default {
}
.btn {
display: flex;
padding: 20rpx 0;
padding: 20rpx 0 40rpx 0;
justify-content: center;
.btn-cont {
padding: 10rpx 30rpx;
padding: 13rpx 30rpx;
border: 1px solid #0DC5C5;
border-radius: 8rpx;
color: #0DC5C5;
.iconfont {
margin: 0 0 0 20rpx;
font-size: 24rpx;
}
}
@@ -1239,6 +1270,12 @@ export default {
.info-item-header {
position: relative;
padding: 20rpx 20rpx 0 20rpx;
&.info-item-top {
padding-top: 60rpx;
background-size: 100% 80rpx;
background-repeat: no-repeat;
background-image: url();
}
.name {
font-size: 16px;
color: #333;