Merge branch 'dev' into test
This commit is contained in:
+9
-1
@@ -78,4 +78,12 @@ export function getRecipe(params) {
|
||||
*/
|
||||
export function getBanner() {
|
||||
return request.get("/wellness/exhibition/banner")
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 康养生活-康养旅居顶部配置
|
||||
* @returns
|
||||
*/
|
||||
export function getWellnessTopImage() {
|
||||
return request.get("/wellness/topImage")
|
||||
}
|
||||
|
||||
@@ -191,6 +191,10 @@ export function getHotelTypeList() {
|
||||
});
|
||||
}
|
||||
|
||||
export function getHotelBanner(params) {
|
||||
return request.get("/hotelBanner", params);
|
||||
}
|
||||
|
||||
/**
|
||||
* 店铺详情海报
|
||||
* @param id 店铺ID int
|
||||
|
||||
@@ -65,6 +65,11 @@ export function getHotelInfo(params) {
|
||||
return request.get("merchantApply/info/hotel", params, {login: true})
|
||||
}
|
||||
|
||||
// 获取千县名品店铺类型列表
|
||||
export function getCountyFamousHotelType() {
|
||||
return request.get("/countyFamous/hotelType", {}, {login: true})
|
||||
}
|
||||
|
||||
/**
|
||||
* 旅居管家入驻申请详情
|
||||
*/
|
||||
|
||||
@@ -312,3 +312,7 @@ export function getCityNewsCategory() {
|
||||
export function getCityShopList(params) {
|
||||
return request.get('/countyFamous/hotel', params, {login: true})
|
||||
}
|
||||
|
||||
export function getCountyFamousHotelType() {
|
||||
return request.get('/countyFamous/hotelType', {}, {login: true})
|
||||
}
|
||||
|
||||
+2
-1
@@ -25,4 +25,5 @@ export function getMessageList(params) {
|
||||
*/
|
||||
export function replyMessage(data) {
|
||||
return request.post("/user/reply/add", data, {login: true})
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+5
-1
@@ -578,6 +578,10 @@ export function getHistory(params) {
|
||||
return request.get('/history/list', params)
|
||||
}
|
||||
|
||||
export function deleteHistory(id) {
|
||||
return request.delete(`/history/${id}`)
|
||||
}
|
||||
|
||||
/**
|
||||
* 购物车猜你喜欢
|
||||
* @param {*} params
|
||||
@@ -598,4 +602,4 @@ export function queryUserGuide(params) {
|
||||
|
||||
export function setUserGuide(params) {
|
||||
return request.post('/user/guide/status', params)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
原定时间:{{ originDate }}
|
||||
</view>
|
||||
</view>
|
||||
<view class="calendar">
|
||||
<view class="calendar" @touchstart="onTouchStart" @touchend="onTouchEnd">
|
||||
<view class="calendar-header">
|
||||
<view class="month-nav">
|
||||
<text class="nav-btn" @click="changeMonth(-1)">〈</text>
|
||||
@@ -28,33 +28,58 @@
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="days">
|
||||
<view
|
||||
v-for="(day, index) in calendarDays"
|
||||
:key="index"
|
||||
class="day"
|
||||
:class="{
|
||||
'empty': !day,
|
||||
'selected': isSelected(day),
|
||||
'in-range': isInRange(day),
|
||||
'start-date': isStartDate(day),
|
||||
'end-date': isEndDate(day),
|
||||
'selecting-start': isSelectingStart(day),
|
||||
'disabled': isDisabled(day),
|
||||
'booked': getDateStatus(day) === 1,
|
||||
'unavailable': getDateStatus(day) === 2,
|
||||
'available': getDateStatus(day) === 0
|
||||
}"
|
||||
@click="selectDate(day)"
|
||||
>
|
||||
<text>{{ day || '' }}</text>
|
||||
<view class="v12-font-20" v-if="day && getDateStatus(day) !== null">{{ getDateStatus(day) }}</view>
|
||||
<view class="calendar-body">
|
||||
<view class="days" :class="[isAnimating ? 'absolute ' + transitionMode + '-enter' : '']">
|
||||
<view
|
||||
v-for="(day, index) in calendarDays"
|
||||
:key="index"
|
||||
class="day"
|
||||
:class="{
|
||||
'empty': !day,
|
||||
'selected': isSelected(day),
|
||||
'in-range': isInRange(day),
|
||||
'start-date': isStartDate(day),
|
||||
'end-date': isEndDate(day),
|
||||
'selecting-start': isSelectingStart(day),
|
||||
'disabled': isDisabled(day),
|
||||
'booked': getDateStatus(day) === '已被预约',
|
||||
'unavailable': getDateStatus(day) === '不可预约',
|
||||
'available': getDateStatus(day) === '可预约'
|
||||
}"
|
||||
@click="selectDate(day)"
|
||||
>
|
||||
<text>{{ day || '' }}</text>
|
||||
<view class="v12-font-20" v-if="day && getDateStatus(day) !== null">{{ getDateStatus(day) }}</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="days absolute" v-if="isAnimating" :class="[transitionMode + '-leave']">
|
||||
<view
|
||||
v-for="(day, index) in prevMonthDays"
|
||||
:key="'prev-' + index"
|
||||
class="day"
|
||||
:class="{
|
||||
'empty': !day,
|
||||
'selected': isSelected(day, prevYear, prevMonth),
|
||||
'in-range': isInRange(day, prevYear, prevMonth),
|
||||
'start-date': isStartDate(day, prevYear, prevMonth),
|
||||
'end-date': isEndDate(day, prevYear, prevMonth),
|
||||
'selecting-start': isSelectingStart(day, prevYear, prevMonth),
|
||||
'disabled': isDisabled(day, prevYear, prevMonth),
|
||||
'booked': getDateStatus(day, prevYear, prevMonth) === '已被预约',
|
||||
'unavailable': getDateStatus(day, prevYear, prevMonth) === '不可预约',
|
||||
'available': getDateStatus(day, prevYear, prevMonth) === '可预约'
|
||||
}"
|
||||
>
|
||||
<text>{{ day || '' }}</text>
|
||||
<view class="v12-font-20" v-if="day && getDateStatus(day, prevYear, prevMonth) !== null">{{ getDateStatus(day, prevYear, prevMonth) }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="picker-footer">
|
||||
<button class="btn btn-confirm" @click="confirmSelect">确定</button>
|
||||
<button class="btn btn-confirm" @click="confirmSelect">立即预订</button>
|
||||
</view>
|
||||
</view>
|
||||
</u-popup>
|
||||
@@ -111,7 +136,15 @@ export default {
|
||||
tempStartDate: null,
|
||||
tempEndDate: null,
|
||||
dateStatusMap: {}, // 存储日期状态
|
||||
selectionState: 'initial' // 'initial' | 'selecting' | 'completed'
|
||||
selectionState: 'initial', // 'initial' | 'selecting' | 'completed'
|
||||
touchStartX: 0,
|
||||
touchStartY: 0,
|
||||
// 动画相关状态
|
||||
isAnimating: false,
|
||||
transitionMode: '', // 'next' or 'prev'
|
||||
prevYear: null,
|
||||
prevMonth: null,
|
||||
prevMonthDays: []
|
||||
}
|
||||
},
|
||||
|
||||
@@ -169,37 +202,38 @@ export default {
|
||||
|
||||
methods: {
|
||||
getDays(){
|
||||
uni.showLoading({
|
||||
title: '加载中...',
|
||||
mask: true,
|
||||
})
|
||||
// uni.showLoading({
|
||||
// title: '加载中...',
|
||||
// mask: true,
|
||||
// })
|
||||
sojoumOrderCalendar({
|
||||
travelGroupProductId: this.travelGroupProductId,
|
||||
month: `${this.currentYear}-${String(this.currentMonth + 1).padStart(2, '0')}`
|
||||
}).then(res => {
|
||||
if (res.data) {
|
||||
// 更新日期状态映射
|
||||
this.dateStatusMap = {}
|
||||
// 更新日期状态映射,使用合并而不是覆盖,以支持动画时的旧数据显示
|
||||
const newStatusMap = {}
|
||||
res.data.forEach(day => {
|
||||
// inventoryStatus int 状态 (0:可预约, 1:已被预约, 2:不可预约)
|
||||
this.dateStatusMap[day.date] = day.inventoryStatus === 0 ? '可预约' : day.inventoryStatus === 1 ? '已被预约' : '不可预约'
|
||||
newStatusMap[day.date] = day.inventoryStatus === 0 ? '可预约' : day.inventoryStatus === 1 ? '已被预约' : '不可预约'
|
||||
})
|
||||
this.dateStatusMap = { ...this.dateStatusMap, ...newStatusMap }
|
||||
}
|
||||
}).finally(() => {
|
||||
uni.hideLoading()
|
||||
})
|
||||
},
|
||||
|
||||
getDateStatus(day) {
|
||||
getDateStatus(day, year, month) {
|
||||
if (!day) return null
|
||||
const date = this.formatDate(this.getDateFromDay(day))
|
||||
const date = this.formatDate(this.getDateFromDay(day, year, month))
|
||||
return this.dateStatusMap[date]
|
||||
},
|
||||
|
||||
isDisabled(day) {
|
||||
isDisabled(day, year, month) {
|
||||
|
||||
if (!day) return true
|
||||
const date = this.getDateFromDay(day)
|
||||
const date = this.getDateFromDay(day, year, month)
|
||||
// 禁用过去的日期(今天之前的日期)
|
||||
const today = new Date()
|
||||
today.setHours(0, 0, 0, 0)
|
||||
@@ -210,7 +244,7 @@ export default {
|
||||
if (this.maxDate && date > new Date(this.maxDate)) return true
|
||||
|
||||
// 检查预约状态
|
||||
const status = this.getDateStatus(day)
|
||||
const status = this.getDateStatus(day, year, month)
|
||||
// 只允许选择可预约的日期(状态为"可预约"),其他状态都禁用
|
||||
|
||||
return status !== '可预约'
|
||||
@@ -242,6 +276,15 @@ export default {
|
||||
},
|
||||
|
||||
changeMonth(delta) {
|
||||
if (this.isAnimating) return
|
||||
|
||||
// Setup animation state
|
||||
this.prevYear = this.currentYear
|
||||
this.prevMonth = this.currentMonth
|
||||
this.prevMonthDays = [...this.calendarDays]
|
||||
this.transitionMode = delta > 0 ? 'next' : 'prev'
|
||||
this.isAnimating = true
|
||||
|
||||
let newMonth = this.currentMonth + delta
|
||||
if (newMonth < 0) {
|
||||
this.currentYear--
|
||||
@@ -251,6 +294,34 @@ export default {
|
||||
newMonth = 0
|
||||
}
|
||||
this.currentMonth = newMonth
|
||||
|
||||
// Reset animation state after transition
|
||||
setTimeout(() => {
|
||||
this.isAnimating = false
|
||||
this.prevMonthDays = []
|
||||
}, 300)
|
||||
},
|
||||
|
||||
onTouchStart(e) {
|
||||
if (!e || !e.changedTouches || !e.changedTouches.length) return
|
||||
this.touchStartX = e.changedTouches[0].clientX
|
||||
this.touchStartY = e.changedTouches[0].clientY
|
||||
},
|
||||
|
||||
onTouchEnd(e) {
|
||||
if (!e || !e.changedTouches || !e.changedTouches.length) return
|
||||
const touchEndX = e.changedTouches[0].clientX
|
||||
const touchEndY = e.changedTouches[0].clientY
|
||||
const deltaX = touchEndX - this.touchStartX
|
||||
const deltaY = touchEndY - this.touchStartY
|
||||
if (Math.abs(deltaX) <= Math.abs(deltaY)) return
|
||||
const minDistance = 50
|
||||
if (Math.abs(deltaX) < minDistance) return
|
||||
if (deltaX < 0) {
|
||||
this.changeMonth(1)
|
||||
} else {
|
||||
this.changeMonth(-1)
|
||||
}
|
||||
},
|
||||
|
||||
formatDate(date) {
|
||||
@@ -261,8 +332,10 @@ export default {
|
||||
return `${year}-${month}-${day}`
|
||||
},
|
||||
|
||||
getDateFromDay(day) {
|
||||
return day ? new Date(this.currentYear, this.currentMonth, day) : null
|
||||
getDateFromDay(day, year, month) {
|
||||
const y = year !== undefined ? year : this.currentYear
|
||||
const m = month !== undefined ? month : this.currentMonth
|
||||
return day ? new Date(y, m, day) : null
|
||||
},
|
||||
|
||||
// isDisabled(day) {
|
||||
@@ -281,42 +354,52 @@ export default {
|
||||
// return false
|
||||
// },
|
||||
|
||||
isSelected(day) {
|
||||
isSelected(day, year, month) {
|
||||
if (!day) return false
|
||||
const date = this.getDateFromDay(day)
|
||||
return this.isStartDate(day) || this.isEndDate(day)
|
||||
// const date = this.getDateFromDay(day, year, month) // Unused?
|
||||
return this.isStartDate(day, year, month) || this.isEndDate(day, year, month)
|
||||
},
|
||||
|
||||
isStartDate(day) {
|
||||
isStartDate(day, year, month) {
|
||||
if (!day || !this.tempStartDate) return false
|
||||
const date = this.getDateFromDay(day)
|
||||
const date = this.getDateFromDay(day, year, month)
|
||||
return date.getTime() === this.tempStartDate.getTime()
|
||||
},
|
||||
|
||||
isEndDate(day) {
|
||||
isEndDate(day, year, month) {
|
||||
if (!day || !this.tempEndDate) return false
|
||||
const date = this.getDateFromDay(day)
|
||||
const date = this.getDateFromDay(day, year, month)
|
||||
return date.getTime() === this.tempEndDate.getTime()
|
||||
},
|
||||
|
||||
isInRange(day) {
|
||||
isInRange(day, year, month) {
|
||||
if (!day || !this.tempStartDate || !this.tempEndDate) return false
|
||||
const date = this.getDateFromDay(day)
|
||||
const date = this.getDateFromDay(day, year, month)
|
||||
return date > this.tempStartDate && date < this.tempEndDate
|
||||
},
|
||||
|
||||
isSelectingStart(day) {
|
||||
isSelectingStart(day, year, month) {
|
||||
if (!day || !this.tempStartDate || this.tempEndDate) return false
|
||||
// 只有在选择状态且只有开始日期时才显示特殊样式
|
||||
if (this.selectionState !== 'selecting') return false
|
||||
const date = this.getDateFromDay(day)
|
||||
const date = this.getDateFromDay(day, year, month)
|
||||
return date.getTime() === this.tempStartDate.getTime()
|
||||
},
|
||||
|
||||
selectDate(day) {
|
||||
if (!day || this.isDisabled(day)) return
|
||||
selectDate(day, year, month) {
|
||||
if (!day || this.isDisabled(day, year, month)) return
|
||||
|
||||
const selectedDate = this.getDateFromDay(day)
|
||||
const selectedDate = this.getDateFromDay(day, year, month)
|
||||
|
||||
// 如果设置了最小预订天数,则自动计算结束日期
|
||||
if (this.minBookingDays > 0) {
|
||||
this.tempStartDate = selectedDate
|
||||
const endDate = new Date(selectedDate)
|
||||
endDate.setDate(selectedDate.getDate() + this.minBookingDays - 1)
|
||||
this.tempEndDate = endDate
|
||||
this.selectionState = 'completed'
|
||||
return
|
||||
}
|
||||
|
||||
// 如果已有完整的日期区间(开始日期和结束日期都存在),重置选择
|
||||
if (this.tempStartDate && this.tempEndDate && this.selectionState === 'completed') {
|
||||
@@ -674,17 +757,57 @@ export default {
|
||||
}
|
||||
|
||||
@keyframes pulse {
|
||||
0% {
|
||||
opacity: 1;
|
||||
transform: scale(1);
|
||||
0% {
|
||||
opacity: 1;
|
||||
transform: scale(1);
|
||||
}
|
||||
50% {
|
||||
opacity: 0.7;
|
||||
transform: scale(1.05);
|
||||
}
|
||||
100% {
|
||||
opacity: 1;
|
||||
transform: scale(1);
|
||||
}
|
||||
}
|
||||
50% {
|
||||
opacity: 0.7;
|
||||
transform: scale(1.05);
|
||||
|
||||
// Animation Styles
|
||||
.calendar-body {
|
||||
position: relative;
|
||||
height: 480rpx; // 6 rows * 80rpx
|
||||
overflow: hidden;
|
||||
width: 100%;
|
||||
}
|
||||
100% {
|
||||
opacity: 1;
|
||||
transform: scale(1);
|
||||
|
||||
.days.absolute {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
// height: 100%;
|
||||
z-index: 1;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
// Keyframes for sliding
|
||||
@keyframes slide-next-enter {
|
||||
from { transform: translateX(100%); }
|
||||
to { transform: translateX(0); }
|
||||
}
|
||||
@keyframes slide-next-leave {
|
||||
from { transform: translateX(0); }
|
||||
to { transform: translateX(-100%); }
|
||||
}
|
||||
@keyframes slide-prev-enter {
|
||||
from { transform: translateX(-100%); }
|
||||
to { transform: translateX(0); }
|
||||
}
|
||||
@keyframes slide-prev-leave {
|
||||
from { transform: translateX(0); }
|
||||
to { transform: translateX(100%); }
|
||||
}
|
||||
|
||||
.next-enter { animation: slide-next-enter 0.3s forwards; }
|
||||
.next-leave { animation: slide-next-leave 0.3s forwards; }
|
||||
.prev-enter { animation: slide-prev-enter 0.3s forwards; }
|
||||
.prev-leave { animation: slide-prev-leave 0.3s forwards; }
|
||||
</style>
|
||||
|
||||
@@ -59,7 +59,7 @@ export default {
|
||||
},
|
||||
// 点赞数显示
|
||||
cLikeCount: function () {
|
||||
return this.data.like_count === 0 ? "" : this.data.like_count > 99 ? `99+` : this.data.like_count;
|
||||
return this.data.like_count === 0 ? "" : this.$formatCount(this.data.like_count);
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
|
||||
@@ -30,7 +30,6 @@
|
||||
@click="gotoPage(item.url, item.type, item.index)"
|
||||
>
|
||||
<view class="img-wrap">
|
||||
<!-- 预加载两张图片,可以在点击切换的时候不闪屏 -->
|
||||
<image
|
||||
:src="item.onIcon"
|
||||
class="img on"
|
||||
@@ -41,6 +40,12 @@
|
||||
/>
|
||||
</view>
|
||||
<view class="name">{{ item.name }}</view>
|
||||
<view
|
||||
v-if="item.name === '消息' && showUnreadBadge"
|
||||
class="badge"
|
||||
>
|
||||
{{ unreadCountText }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -48,6 +53,8 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import store from '@/store'
|
||||
import { getUnreadMessageCount, getUnreadMessageCountForSeller } from '@/api/rooms'
|
||||
export default {
|
||||
name: 'XddTabbar',
|
||||
props: {
|
||||
@@ -93,14 +100,57 @@ export default {
|
||||
type: 1,
|
||||
index: 3
|
||||
}
|
||||
]]
|
||||
]],
|
||||
unreadCount: 0
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
isLogin() {
|
||||
return store.getters.isLogin
|
||||
},
|
||||
showUnreadBadge() {
|
||||
return this.isLogin && this.unreadCount > 0
|
||||
},
|
||||
unreadCountText() {
|
||||
if (this.unreadCount > 99) {
|
||||
return '99+'
|
||||
}
|
||||
return this.unreadCount
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
isLogin(val) {
|
||||
if (val) {
|
||||
this.fetchUnreadCount()
|
||||
} else {
|
||||
this.unreadCount = 0
|
||||
uni.$emit('updateUnreadMessageCount', 0)
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.getElementData('#quweiIcon')
|
||||
this.getIconData('#icon1')
|
||||
if (this.isLogin) {
|
||||
this.fetchUnreadCount()
|
||||
}
|
||||
uni.$on('updateUnreadMessageCount', this.handleUpdateUnreadMessageCount)
|
||||
},
|
||||
beforeDestroy() {
|
||||
uni.$off('updateUnreadMessageCount', this.handleUpdateUnreadMessageCount)
|
||||
},
|
||||
methods: {
|
||||
handleUpdateUnreadMessageCount(count) {
|
||||
if (!this.isLogin) {
|
||||
this.unreadCount = 0
|
||||
return
|
||||
}
|
||||
if (typeof count === 'number') {
|
||||
this.unreadCount = count
|
||||
} else {
|
||||
this.fetchUnreadCount()
|
||||
}
|
||||
},
|
||||
getElementData(el) {
|
||||
const query = uni.createSelectorQuery().in(this)
|
||||
query.select(el).boundingClientRect().exec((res)=> {
|
||||
@@ -117,10 +167,37 @@ export default {
|
||||
}
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 跳转至目标页面
|
||||
* type: 1-tabbar页面,2-非tabbar页面
|
||||
*/
|
||||
fetchUnreadCount() {
|
||||
uni.request({
|
||||
url: this.$SERVICE_API_URL + '/unread-num',
|
||||
method: 'POST',
|
||||
data: {
|
||||
uid: store.getters.userInfo.uid
|
||||
},
|
||||
success:(res)=>{
|
||||
if(res.data.status_code === 200) {
|
||||
const count = res.data.content || 0
|
||||
getUnreadMessageCount().then(res => {
|
||||
const { success, data } = res
|
||||
if (success) {
|
||||
const _count = data || 0
|
||||
this.unreadCount = count + _count
|
||||
uni.$emit('updateUnreadMessageCount', this.unreadCount)
|
||||
} else {
|
||||
this.unreadCount = 0
|
||||
uni.$emit('updateUnreadMessageCount', 0)
|
||||
}
|
||||
}).catch(() => {
|
||||
this.unreadCount = 0
|
||||
uni.$emit('updateUnreadMessageCount', 0)
|
||||
})
|
||||
} else {
|
||||
this.unreadCount = 0
|
||||
}
|
||||
},
|
||||
})
|
||||
|
||||
},
|
||||
gotoPage(url, type = 1, index) {
|
||||
if (this.currIndex === index) return
|
||||
if (type === 1) {
|
||||
@@ -199,6 +276,7 @@ export default {
|
||||
}
|
||||
.item {
|
||||
width: 140rpx;
|
||||
position: relative;
|
||||
&.curr {
|
||||
.name {
|
||||
color: #C52733;
|
||||
@@ -211,6 +289,21 @@ export default {
|
||||
}
|
||||
}
|
||||
}
|
||||
.badge {
|
||||
position: absolute;
|
||||
top: -4rpx;
|
||||
right: 32rpx;
|
||||
min-width: 28rpx;
|
||||
padding: 0 6rpx;
|
||||
height: 28rpx;
|
||||
line-height: 28rpx;
|
||||
border-radius: 14rpx;
|
||||
background-color: #FF564A;
|
||||
color: #ffffff;
|
||||
font-size: 20rpx;
|
||||
text-align: center;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -75,6 +75,18 @@ const force2Decimal = function change2Decimal(value) {
|
||||
return forceToDecimal(value, 2)
|
||||
}
|
||||
|
||||
const formatCount = function(value) {
|
||||
if (!value) return 0;
|
||||
const num = parseFloat(value);
|
||||
if (isNaN(num)) return 0;
|
||||
if (num >= 10000) {
|
||||
let val = num / 10000;
|
||||
val = parseFloat(val.toFixed(1));
|
||||
return val + '万';
|
||||
}
|
||||
return num;
|
||||
}
|
||||
|
||||
const toast = (title = '', position = 'center', success = function() {}) => {
|
||||
uni.showToast({
|
||||
title,
|
||||
@@ -88,6 +100,7 @@ const toast = (title = '', position = 'center', success = function() {}) => {
|
||||
|
||||
Vue.prototype.$force2Decimal = force2Decimal
|
||||
Vue.prototype.$forceToDecimal = forceToDecimal
|
||||
Vue.prototype.$formatCount = formatCount
|
||||
|
||||
Vue.config.productionTip = false
|
||||
App.mpType = 'app'
|
||||
|
||||
+1
-1
@@ -532,7 +532,7 @@
|
||||
"path": "views/healthFoods",
|
||||
"style": {
|
||||
"navigationBarTitleText": "康养旅居",
|
||||
"navigationBarBackgroundColor": "#FAEED8"
|
||||
"navigationBarBackgroundColor": "#FFFFFF"
|
||||
}
|
||||
},
|
||||
{
|
||||
|
||||
+2
-1
@@ -440,6 +440,7 @@ export default {
|
||||
},
|
||||
onShow() {
|
||||
this.isEdit = false
|
||||
uni.$emit('updateUnreadMessageCount')
|
||||
if (!this.isLoad) {
|
||||
return
|
||||
}
|
||||
@@ -1222,4 +1223,4 @@ view {
|
||||
background-color: #C52733;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
||||
+64
-11
@@ -76,7 +76,7 @@
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="type-banner-wrap">
|
||||
<view class="type-banner-wrap" v-if="typeIndex !== -1">
|
||||
<view v-if="currType.titleImage" class="title">
|
||||
<image
|
||||
:src="currType.titleImage"
|
||||
@@ -84,7 +84,7 @@
|
||||
class="img"
|
||||
/>
|
||||
</view>
|
||||
<view v-if="currType.carousel" class="slider-wrap">
|
||||
<view v-if="hotelBanner.length" class="slider-wrap">
|
||||
<swiper
|
||||
indicatorDots="true"
|
||||
indicator-color="rgba(255, 255, 255, .3)"
|
||||
@@ -94,12 +94,12 @@
|
||||
style="height: 330rpx;"
|
||||
>
|
||||
<block
|
||||
v-for="(item, bannerIndex) in currType.carousel"
|
||||
v-for="(item, bannerIndex) in hotelBanner"
|
||||
:key="bannerIndex"
|
||||
>
|
||||
<swiper-item>
|
||||
<view class="swiper-item" @click="typeBannerItemClick(item)">
|
||||
<image :src="item.carouselImage" class="img" />
|
||||
<image :src="item.bannerImage" class="img" />
|
||||
</view>
|
||||
</swiper-item>
|
||||
</block>
|
||||
@@ -120,9 +120,9 @@
|
||||
</view>
|
||||
</view>
|
||||
<view class="body" v-else>
|
||||
<view class="v12-justify-between v12-align-center">
|
||||
<text class="v12-font-bold" v-if="currType.carousel">推荐</text>
|
||||
<view class="v12-dark1-text v12-font-28 v12-align-center" @click="handleRefresh">
|
||||
<view class="v12-justify-between v12-align-center" v-if="hotelList.length > 0">
|
||||
<text class="v12-font-bold" v-if="hotelBanner.length">推荐</text>
|
||||
<view class="v12-dark1-text v12-font-28 v12-align-center refresh-btn" @click="handleRefresh">
|
||||
<u-icon name="reload"></u-icon>
|
||||
换一换
|
||||
</view>
|
||||
@@ -170,7 +170,8 @@
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
import { getHotelList, getHotelTypeList, getAncientTownIcon, getAncientTownList } from "@/api/inn.js"
|
||||
import { getHotelList, getHotelTypeList, getAncientTownIcon, getAncientTownList, getHotelBanner } from "@/api/inn.js"
|
||||
import { fetchCity } from "@/api/wenwan"
|
||||
import { getCurAddress, getLocation } from "@/utils/common"
|
||||
import FunHotelItem from './components/HotelItem'
|
||||
import { pageListenMixins } from '@/mixins/pageListenMixins'
|
||||
@@ -202,7 +203,10 @@ export default {
|
||||
isNext: false,
|
||||
townConfig: {},
|
||||
townList: [],
|
||||
randomSeed: null
|
||||
randomSeed: null,
|
||||
hotelBanner: [],
|
||||
goodCityId: '',
|
||||
cityOptions: []
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@@ -223,8 +227,12 @@ export default {
|
||||
this.fetchList(random, this.randomSeed)
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
onLoad(options) {
|
||||
this.currType = {}
|
||||
if (options && options.city) {
|
||||
this.goodCityId = options.city
|
||||
}
|
||||
this.initGoodCity()
|
||||
getHotelTypeList().then(({data}) => {
|
||||
this.typeList = data
|
||||
this.currType = this.typeIndex === -1 ? {} : data[this.typeIndex]
|
||||
@@ -234,6 +242,7 @@ export default {
|
||||
this.queryGuide('findFunIndex')
|
||||
},
|
||||
onShow() {
|
||||
uni.$emit('updateUnreadMessageCount')
|
||||
const memCityName = uni.getStorageSync('cityName')
|
||||
// this.typeIndex = 0
|
||||
this.name = ''
|
||||
@@ -246,7 +255,8 @@ export default {
|
||||
watch: {
|
||||
cityName: {
|
||||
handler(value) {
|
||||
if(value) {
|
||||
if (value) {
|
||||
this.updateGoodCityId()
|
||||
this.search()
|
||||
}
|
||||
},
|
||||
@@ -445,6 +455,27 @@ export default {
|
||||
this.townConfig = res.data
|
||||
})
|
||||
},
|
||||
initGoodCity() {
|
||||
fetchCity(2).then(({ data }) => {
|
||||
const group = data && data.group ? data.group : []
|
||||
const list = []
|
||||
group.forEach(item => {
|
||||
if (item.city && item.city.length) {
|
||||
list.push(...item.city)
|
||||
}
|
||||
})
|
||||
this.cityOptions = list
|
||||
this.updateGoodCityId()
|
||||
})
|
||||
},
|
||||
updateGoodCityId() {
|
||||
if (!this.cityOptions.length || !this.cityName) return
|
||||
const found = this.cityOptions.find(item => item.cityName === this.cityName)
|
||||
if (found) {
|
||||
this.goodCityId = found.id || found.cityId || this.goodCityId
|
||||
this.fetchHotelBanner()
|
||||
}
|
||||
},
|
||||
goCity() {
|
||||
uni.navigateTo({
|
||||
url: `/pages/chose-city/chose-city?type=2&city=${this.cityName}`
|
||||
@@ -531,6 +562,24 @@ export default {
|
||||
uni.hideLoading()
|
||||
})
|
||||
},
|
||||
fetchHotelBanner() {
|
||||
if (!this.goodCityId) {
|
||||
return
|
||||
}
|
||||
const params = {
|
||||
goodCityId: this.goodCityId
|
||||
}
|
||||
getHotelBanner(params).then(res => {
|
||||
const { success, data } = res
|
||||
if (success && data) {
|
||||
if (Array.isArray(data.hotelBanner)) {
|
||||
this.hotelBanner = data.hotelBanner
|
||||
} else if (Array.isArray(data)) {
|
||||
this.hotelBanner = data
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
typeBannerItemClick(item) {
|
||||
if (!item.hotelId) return
|
||||
uni.navigateTo({ url: `/pagesInn/inn/innHome?id=${item.hotelId}` })
|
||||
@@ -711,6 +760,10 @@ export default {
|
||||
background: #f5f5f5;
|
||||
}
|
||||
|
||||
.refresh-btn {
|
||||
margin-left: auto;
|
||||
}
|
||||
|
||||
.city-box {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
|
||||
@@ -54,7 +54,7 @@
|
||||
:src="webUrl + '/20230803152147141807.png'"
|
||||
class="icon"
|
||||
/>
|
||||
<text class="seeNum-txt v12-font-28">{{ item.pv }}</text>
|
||||
<text class="seeNum-txt v12-font-28">{{ $formatCount(item.pv) }}</text>
|
||||
</view>
|
||||
<view class="flex">
|
||||
<image
|
||||
@@ -73,7 +73,7 @@
|
||||
v-show="item.zan > 0"
|
||||
:class="item.hasZan ? 'on' : ''"
|
||||
class="seeNum-txt v12-font-28 v12-ml-1"
|
||||
>{{ item.zan }}</text
|
||||
>{{ $formatCount(item.zan) }}</text
|
||||
>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -497,6 +497,7 @@ export default {
|
||||
},
|
||||
onShow() {
|
||||
this.pageToShowHandle()
|
||||
uni.$emit('updateUnreadMessageCount')
|
||||
},
|
||||
onHide() {
|
||||
this.pageToHideHandle()
|
||||
@@ -2002,4 +2003,4 @@ export default {
|
||||
.price-wrap{
|
||||
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
||||
@@ -494,7 +494,7 @@ export default {
|
||||
{ name: '全部' },
|
||||
{ name: '待付款' },
|
||||
{ name: '待发货' },
|
||||
{ name: '待收货/待核销' },
|
||||
{ name: '待收货' },
|
||||
{ name: '退款/售后' },
|
||||
{ name: '待评价' },
|
||||
{ name: '已完成' }
|
||||
@@ -870,8 +870,32 @@ export default {
|
||||
orderTypeTabChange(item) {
|
||||
this.orderTypeTabIndex = item.index
|
||||
this.orderType = item.orderType
|
||||
this.updateTabListByOrderType()
|
||||
this.changeType()
|
||||
},
|
||||
updateTabListByOrderType() {
|
||||
if (this.orderType === 'travel') {
|
||||
this.tabList = [
|
||||
{ name: '全部' },
|
||||
{ name: '待付款' },
|
||||
{ name: '待确认' },
|
||||
{ name: '待使用' },
|
||||
{ name: '退款/售后' },
|
||||
{ name: '待评价' },
|
||||
{ name: '已完成' }
|
||||
]
|
||||
} else {
|
||||
this.tabList = [
|
||||
{ name: '全部' },
|
||||
{ name: '待付款' },
|
||||
{ name: '待发货' },
|
||||
{ name: '待收货/待核销' },
|
||||
{ name: '退款/售后' },
|
||||
{ name: '待评价' },
|
||||
{ name: '已完成' }
|
||||
]
|
||||
}
|
||||
},
|
||||
changeType() {
|
||||
this.orderList = []
|
||||
this.page = 1
|
||||
@@ -930,7 +954,7 @@ export default {
|
||||
status = "待付款"
|
||||
break;
|
||||
case 1:
|
||||
status = order.isTravelGroup === 1 ? "待使用" : "待发货"
|
||||
status = order.isTravelGroup === 1 ? "待确认" : "待发货"
|
||||
break;
|
||||
case 2:
|
||||
status = order.isTravelGroup === 1 ? "待使用" : "待收货"
|
||||
|
||||
@@ -119,7 +119,16 @@
|
||||
{{ item.name }}
|
||||
</view>
|
||||
<view class="type">
|
||||
<view v-if="item.typeName" class="type-tag">
|
||||
<view
|
||||
v-if="item.isTravel === 1"
|
||||
class="type-tag-travel"
|
||||
>
|
||||
旅居店铺
|
||||
</view>
|
||||
<view
|
||||
v-else-if="item.typeName"
|
||||
class="type-tag"
|
||||
>
|
||||
{{ item.typeName }}
|
||||
</view>
|
||||
<view v-else> </view>
|
||||
@@ -261,12 +270,18 @@ export default {
|
||||
})
|
||||
},
|
||||
hotelItemClick(item) {
|
||||
this.$yrouter.push({
|
||||
path: '/pagesInn/inn/innHome',
|
||||
query: {
|
||||
id: item.id
|
||||
}
|
||||
})
|
||||
if (item.isTravel === 1) {
|
||||
uni.navigateTo({
|
||||
url: '/pkg_product/views/sojoumStore?id=' + item.id
|
||||
})
|
||||
} else {
|
||||
this.$yrouter.push({
|
||||
path: '/pagesInn/inn/innHome',
|
||||
query: {
|
||||
id: item.id
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
getList() {
|
||||
if (this.loading || this.loadend) {
|
||||
@@ -531,6 +546,13 @@ export default {
|
||||
color: #946300;
|
||||
background: linear-gradient(to bottom, #FDF8B9, #E3A72C);
|
||||
}
|
||||
.type-tag-travel {
|
||||
padding: 2px 6px;
|
||||
border-radius: 3px;
|
||||
font-size: 12px;
|
||||
color: #fff;
|
||||
background: linear-gradient(to bottom, #77E49F, #4FA379);
|
||||
}
|
||||
}
|
||||
.desc {
|
||||
display: flex;
|
||||
|
||||
@@ -54,7 +54,7 @@
|
||||
:src="webUrl + '/20230803152147141807.png'"
|
||||
class="icon"
|
||||
/>
|
||||
<text class="seeNum-txt v12-font-28">{{ item.pv }}</text>
|
||||
<text class="seeNum-txt v12-font-28">{{ $formatCount(item.pv) }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -27,6 +27,13 @@
|
||||
class="v12-white v12-radius-20 history-card"
|
||||
@click="goodsDetail(historyItem)"
|
||||
>
|
||||
<view class="delete-icon" @click.stop="deleteHistoryItem(historyItem)">
|
||||
<u-icon
|
||||
name="close"
|
||||
color="#fff"
|
||||
size="16"
|
||||
/>
|
||||
</view>
|
||||
<image
|
||||
class="goods-img"
|
||||
:src="historyItem.image"
|
||||
@@ -83,7 +90,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getHistory } from '@/api/user'
|
||||
import { getHistory, deleteHistory as deleteHistoryApi } from '@/api/user'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
@@ -179,6 +186,21 @@ export default {
|
||||
}
|
||||
})
|
||||
},
|
||||
deleteHistoryItem(historyItem) {
|
||||
const id = historyItem.id
|
||||
if (!id) return
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '确认删除该浏览足迹吗?',
|
||||
success: (res) => {
|
||||
if (res.confirm) {
|
||||
deleteHistoryApi(id).then(() => {
|
||||
this.queryHistory()
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
queryHistory() {
|
||||
this.items = []
|
||||
this.isLoad = false
|
||||
@@ -245,6 +267,7 @@ export default {
|
||||
margin-right: 16rpx;
|
||||
border-radius: 20rpx;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
&:nth-child(3n) {
|
||||
margin-right: 0;
|
||||
}
|
||||
@@ -271,6 +294,19 @@ export default {
|
||||
}
|
||||
}
|
||||
}
|
||||
.delete-icon{
|
||||
position: absolute;
|
||||
top: 8rpx;
|
||||
right: 8rpx;
|
||||
z-index: 2;
|
||||
width: 32rpx;
|
||||
height: 32rpx;
|
||||
border-radius: 16rpx;
|
||||
// background-color: rgba(0, 0, 0, 0.35);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
.active{
|
||||
background: #C52733;
|
||||
color: #fff !important;
|
||||
@@ -283,4 +319,4 @@ export default {
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
</style>
|
||||
</style>
|
||||
|
||||
@@ -402,6 +402,7 @@ export default {
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
uni.$emit('updateUnreadMessageCount')
|
||||
if (this.$store.getters.token) {
|
||||
this.isNoLogin = false
|
||||
uni.showLoading({
|
||||
|
||||
@@ -13,11 +13,11 @@
|
||||
<view class="acea-row row-left row-middle">
|
||||
<view class="see-num-box acea-row row-middle" style="margin-right: 20rpx;">
|
||||
<image :src="webUrl+'/20230304131559277594.png'" class="eye-icon" mode=""></image>
|
||||
<text class="see-num-text">{{item.pv||0}}</text>
|
||||
<text class="see-num-text">{{$formatCount(item.pv||0)}}</text>
|
||||
</view>
|
||||
<view class="zan-num-box acea-row row-middle">
|
||||
<img class="zan-icon" :src="webUrl+'/20230304133322439350.png'" />
|
||||
<text class="zan-num-text">{{item.zan||0}}</text>
|
||||
<text class="zan-num-text">{{$formatCount(item.zan||0)}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -9,6 +9,9 @@
|
||||
</view>
|
||||
<view style="position: relative;" class="item" v-for="(item, addressListIndex) in addressList"
|
||||
:key="addressListIndex" @click="tapAddress(item)">
|
||||
<view v-if="choosMode" @click.stop="editAddress(addressListIndex)" style="position: absolute; right: 20rpx; top: 0; z-index: 10; padding: 0;" :style="item.isDefault||item.isDefault=='1' ? 'right: 80rpx' : ''">
|
||||
<text class="iconfont icon-bianji" style="color: #999; font-size: 32rpx;"></text>
|
||||
</view>
|
||||
<view v-if="item.isDefault||item.isDefault=='1' ? true : false" class=""
|
||||
style="position: absolute;top: 0;right: 0;">
|
||||
<image style="width: 72rpx;height: 36rpx;" :src="webUrl+'/20210807165228290910.png'" mode=""></image>
|
||||
@@ -27,7 +30,7 @@
|
||||
<u-icon name="checkbox-mark" color="#C52733" size="20"></u-icon>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="!choosMode" class="operation acea-row row-between-wrapper">
|
||||
<view class="operation acea-row row-between-wrapper" v-if="!choosMode">
|
||||
<view class="select-btn">
|
||||
<view class="checkbox-wrapper">
|
||||
<checkbox-group @change.stop="radioChange(item.id)">
|
||||
|
||||
@@ -273,7 +273,7 @@
|
||||
:src="webUrl + '/20230803152147141807.png'"
|
||||
class="icon"
|
||||
/>
|
||||
<text class="seeNum-txt">{{ item.pv }}</text>
|
||||
<text class="seeNum-txt">{{ $formatCount(item.pv) }}</text>
|
||||
</view>
|
||||
<view class="flex">
|
||||
<image
|
||||
@@ -292,7 +292,7 @@
|
||||
v-show="item.zan > 0"
|
||||
:class="item.zanVo ? 'on' : ''"
|
||||
class="seeNum-txt"
|
||||
>{{ item.zan }}</text>
|
||||
>{{ $formatCount(item.zan) }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -272,7 +272,7 @@
|
||||
:src="webUrl + '/20230803152147141807.png'"
|
||||
class="icon"
|
||||
/>
|
||||
<text class="seeNum-txt">{{ item.pv }}</text>
|
||||
<text class="seeNum-txt">{{ $formatCount(item.pv) }}</text>
|
||||
</view>
|
||||
<view class="flex">
|
||||
<image
|
||||
@@ -291,7 +291,7 @@
|
||||
v-show="item.zan > 0"
|
||||
:class="item.zanVo ? 'on' : ''"
|
||||
class="seeNum-txt"
|
||||
>{{ item.zan }}</text>
|
||||
>{{ $formatCount(item.zan) }}</text>
|
||||
</view>
|
||||
<view class="flex" @click="infoClick(item)">
|
||||
<!-- <image
|
||||
@@ -299,7 +299,7 @@
|
||||
class="icon"
|
||||
/> -->
|
||||
<u-icon name="chat" size="24"></u-icon>
|
||||
<text class="seeNum-txt">{{ item.replyCount || 0 }}</text>
|
||||
<text class="seeNum-txt">{{ $formatCount(item.replyCount || 0) }}</text>
|
||||
</view>
|
||||
<view v-if="isMyInn" class="flex more-btn" @click="toggleMoreHandle(index)">
|
||||
<image
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
<view class="btns">
|
||||
<view class="flex">
|
||||
<image :src="webUrl + '/20230803152147141807.png'" class="icon" />
|
||||
<text class="seeNum-txt">{{ item.pv }}</text>
|
||||
<text class="seeNum-txt">{{ $formatCount(item.pv) }}</text>
|
||||
</view>
|
||||
<view class="flex">
|
||||
<image
|
||||
@@ -68,12 +68,12 @@
|
||||
v-show="item.zan > 0"
|
||||
:class="item.zanVo ? 'on' : ''"
|
||||
class="seeNum-txt"
|
||||
>{{ item.zan }}</text
|
||||
>{{ $formatCount(item.zan) }}</text
|
||||
>
|
||||
</view>
|
||||
<view class="flex">
|
||||
<u-icon name="chat" size="24"></u-icon>
|
||||
<text class="seeNum-txt">{{ item.replyCount || comments.length }}</text>
|
||||
<text class="seeNum-txt">{{ $formatCount(item.replyCount || comments.length) }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -33,18 +33,18 @@
|
||||
<cover-image style="width: 60rpx;height: 60rpx" :src="webUrl+'/20240113230547221591.png'"
|
||||
v-if="item['hasLike']"/>
|
||||
<cover-image style="width: 60rpx;height: 60rpx" :src="webUrl+'/20240113230552152511.png'" v-else/>
|
||||
<cover-view class="one-t tc">{{ item['likeCount'] }}</cover-view>
|
||||
<cover-view class="one-t tc">{{ $formatCount(item['likeCount']) }}</cover-view>
|
||||
</cover-view>
|
||||
<cover-view class="flex flex-col ai-center" style="width:78rpx;margin-right: 16rpx;"
|
||||
@click="changeFav(item)">
|
||||
<cover-image style="width: 60rpx;height: 60rpx" :src="webUrl+'/20240113230535491918.png'"
|
||||
v-if="item['hasFavorite']"/>
|
||||
<cover-image style="width: 60rpx;height: 60rpx" :src="webUrl+'/20240113230541207016.png'" v-else/>
|
||||
<cover-view class="one-t tc">{{ item['favoriteCount'] }}</cover-view>
|
||||
<cover-view class="one-t tc">{{ $formatCount(item['favoriteCount']) }}</cover-view>
|
||||
</cover-view>
|
||||
<cover-view class="flex flex-col ai-center" style="width:78rpx" @click="showDialog=true">
|
||||
<cover-image style="width: 60rpx;height: 60rpx" :src="webUrl+'/20240113230529202260.png'"/>
|
||||
<cover-view class="one-t tc">{{ item['replyCount'] }}</cover-view>
|
||||
<cover-view class="one-t tc">{{ $formatCount(item['replyCount']) }}</cover-view>
|
||||
</cover-view>
|
||||
</cover-view>
|
||||
</cover-view>
|
||||
@@ -56,7 +56,7 @@
|
||||
@close="dialogClose" @open="dialogOpen">
|
||||
<view style="z-index: 100">
|
||||
<cover-view class="tc" style="padding: 20rpx 0 40rpx;font-size: 28rpx">{{
|
||||
list[current]['replyCount']
|
||||
$formatCount(list[current]['replyCount'])
|
||||
}}条评论
|
||||
</cover-view>
|
||||
<scroll-view style="max-height: 740rpx" scroll-y @scrolltolower="fetchReply">
|
||||
|
||||
@@ -111,6 +111,7 @@ export default {
|
||||
*/
|
||||
toMessage() {
|
||||
markMessagesAsRead().then(res => {
|
||||
uni.$emit('updateUnreadMessageCount', 0)
|
||||
uni.navigateTo({url: '/pkg_common/views/message'})
|
||||
})
|
||||
},
|
||||
@@ -120,7 +121,21 @@ export default {
|
||||
*/
|
||||
getUnreadMessageCount(item) {
|
||||
getUnreadMessageCount().then(res => {
|
||||
this.unreadNum = res.data
|
||||
const count = res.data || 0
|
||||
this.unreadNum = count
|
||||
uni.request({
|
||||
url: this.$SERVICE_API_URL + '/customer-chat-list',
|
||||
method: 'POST',
|
||||
data: {uid: this.uid},
|
||||
success: res => {
|
||||
if (res.data.status_code === 200) {
|
||||
const _count = res.data.content + count
|
||||
uni.$emit('updateUnreadMessageCount', _count)
|
||||
} else {
|
||||
uni.$emit('updateUnreadMessageCount', count)
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
goRoom(item) {
|
||||
@@ -279,4 +294,4 @@ export default {
|
||||
box-sizing: border-box;
|
||||
padding: 4rpx;
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
||||
+117
-18
@@ -175,27 +175,54 @@
|
||||
</template>
|
||||
</u-cell>
|
||||
</view>
|
||||
<u-form-item prop="typeText">
|
||||
<u-cell title="店铺类型" :border="false" isLink>
|
||||
<u-form-item prop="isCountyFamous">
|
||||
<u-cell title="县域店铺" :border="false">
|
||||
<template #icon>
|
||||
<text class="required">*</text>
|
||||
</template>
|
||||
<template #value>
|
||||
<picker
|
||||
:value="indexType"
|
||||
:range="columnsType"
|
||||
<u-radio-group
|
||||
v-model="form.isCountyFamous"
|
||||
:disabled="reviewing"
|
||||
mode=selector
|
||||
range-key="name"
|
||||
class="picker"
|
||||
@change="typeChange"
|
||||
placement="row"
|
||||
@change="countyFamousChange"
|
||||
>
|
||||
<u--text v-if="form.typeText" :text="form.typeText"></u--text>
|
||||
<u--text v-else text="请选择类型" color="#c0c4cc"></u--text>
|
||||
</picker>
|
||||
<u-radio
|
||||
:name="0"
|
||||
:customStyle="{marginRight: '16px'}"
|
||||
active-color="red"
|
||||
label="否"
|
||||
/>
|
||||
<u-radio
|
||||
:name="1"
|
||||
active-color="red"
|
||||
label="是"
|
||||
/>
|
||||
</u-radio-group>
|
||||
</template>
|
||||
</u-cell>
|
||||
</u-form-item>
|
||||
<u-form-item prop="typeText">
|
||||
<picker
|
||||
:value="indexType"
|
||||
:range="columnsType"
|
||||
:disabled="reviewing"
|
||||
mode="selector"
|
||||
range-key="name"
|
||||
class="picker"
|
||||
@change="typeChange"
|
||||
>
|
||||
<u-cell title="店铺类型" :border="false" isLink>
|
||||
<template #icon>
|
||||
<text class="required">*</text>
|
||||
</template>
|
||||
<template #value>
|
||||
<u--text v-if="form.typeText" :text="form.typeText"></u--text>
|
||||
<u--text v-else text="请选择类型" color="#c0c4cc"></u--text>
|
||||
</template>
|
||||
</u-cell>
|
||||
</picker>
|
||||
</u-form-item>
|
||||
<u-form-item prop="contact">
|
||||
<u-cell title="联系人姓名" :border="false">
|
||||
<template #icon>
|
||||
@@ -316,7 +343,15 @@
|
||||
<text class="required">*</text>
|
||||
</template>
|
||||
<template #value>
|
||||
<u--text :text="form.serviceTime + ' - ' + form.serviceEndTime"></u--text>
|
||||
<u--text
|
||||
v-if="form.serviceTime && form.serviceEndTime"
|
||||
:text="form.serviceTime + ' - ' + form.serviceEndTime"
|
||||
></u--text>
|
||||
<u--text
|
||||
v-else
|
||||
text="请选择营业时间"
|
||||
color="#c0c4cc"
|
||||
></u--text>
|
||||
<tpf-time-range
|
||||
startTime="00:00"
|
||||
endTime="23:59"
|
||||
@@ -414,7 +449,8 @@ import {
|
||||
getShopInfo,
|
||||
removeApply,
|
||||
saveShop,
|
||||
getHotelInfo
|
||||
getHotelInfo,
|
||||
getCountyFamousHotelType
|
||||
} from '@/api/join'
|
||||
import {
|
||||
getCity,
|
||||
@@ -449,6 +485,8 @@ export default {
|
||||
qualification: '',
|
||||
type: 0,
|
||||
typeText: '',
|
||||
isCountyFamous: 0,
|
||||
countyFamousHotelType: null,
|
||||
phone: '',
|
||||
captcha: '',
|
||||
area: '',
|
||||
@@ -483,6 +521,12 @@ export default {
|
||||
message: '请上传店铺LOGO',
|
||||
trigger: ['blur', 'change']
|
||||
},
|
||||
'isCountyFamous': {
|
||||
type: 'number',
|
||||
required: true,
|
||||
message: '请选择是否为县域店铺',
|
||||
trigger: ['blur', 'change']
|
||||
},
|
||||
'typeText': {
|
||||
type: 'string',
|
||||
required: true,
|
||||
@@ -539,6 +583,8 @@ export default {
|
||||
}
|
||||
},
|
||||
columnsType: [],
|
||||
hotelTypeList: [],
|
||||
countyFamousHotelTypeList: [],
|
||||
indexType: [0],
|
||||
district: [],
|
||||
address: {},
|
||||
@@ -574,6 +620,8 @@ export default {
|
||||
qualification: '',
|
||||
type: 0,
|
||||
typeText: '',
|
||||
isCountyFamous: 0,
|
||||
countyFamousHotelType: null,
|
||||
phone: '',
|
||||
captcha: '',
|
||||
area: '',
|
||||
@@ -646,9 +694,18 @@ export default {
|
||||
this.district = data
|
||||
})
|
||||
getShopData().then(({data}) => {
|
||||
this.columnsType = data.hotelTypeList
|
||||
this.hotelTypeList = data.hotelTypeList || []
|
||||
this.columnsType = this.hotelTypeList
|
||||
this.notice = data.merchantApplyNotice
|
||||
this.initInfo()
|
||||
getCountyFamousHotelType().then(res => {
|
||||
const listData = Array.isArray(res.data)
|
||||
? res.data
|
||||
: (res.data && (res.data.hotelTypeList || res.data.list || res.data.records)) || []
|
||||
this.countyFamousHotelTypeList = listData || []
|
||||
this.initInfo()
|
||||
}).catch(() => {
|
||||
this.initInfo()
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
@@ -685,6 +742,10 @@ export default {
|
||||
// 店铺图片
|
||||
this.pics = []
|
||||
this.form = data.hotelInfo
|
||||
if (!this.form.serviceTime || !this.form.serviceEndTime) {
|
||||
this.form.serviceTime = ''
|
||||
this.form.serviceEndTime = ''
|
||||
}
|
||||
this.form.coverVideo = this.form.coverType === 2 ? this.form.cover : ''
|
||||
const picsTemp = this.form.pics.split(',')
|
||||
if (picsTemp.length > 0) {
|
||||
@@ -704,7 +765,16 @@ export default {
|
||||
}
|
||||
})
|
||||
}
|
||||
this.indexType = this.columnsType.findIndex(item => item.id === this.form.type)
|
||||
if (this.form.isCountyFamous !== 1 && this.form.isCountyFamous !== 0) {
|
||||
this.form.isCountyFamous = 0
|
||||
}
|
||||
if (this.form.isCountyFamous === 1) {
|
||||
this.columnsType = this.countyFamousHotelTypeList
|
||||
this.indexType = this.columnsType.findIndex(item => item.id === this.form.countyFamousHotelType)
|
||||
} else {
|
||||
this.columnsType = this.hotelTypeList
|
||||
this.indexType = this.columnsType.findIndex(item => item.id === this.form.type)
|
||||
}
|
||||
if (this.indexType !== -1) {
|
||||
this.form.typeText = this.columnsType[this.indexType].name
|
||||
}
|
||||
@@ -767,13 +837,42 @@ export default {
|
||||
})
|
||||
}
|
||||
},
|
||||
countyFamousChange(e) {
|
||||
const value = parseInt(e)
|
||||
this.form.isCountyFamous = value
|
||||
if (value === 1) {
|
||||
if (this.countyFamousHotelTypeList.length === 0) {
|
||||
getCountyFamousHotelType().then(res => {
|
||||
const listData = Array.isArray(res.data)
|
||||
? res.data
|
||||
: (res.data && (res.data.hotelTypeList || res.data.list || res.data.records)) || []
|
||||
this.countyFamousHotelTypeList = listData || []
|
||||
this.columnsType = this.countyFamousHotelTypeList
|
||||
})
|
||||
} else {
|
||||
this.columnsType = this.countyFamousHotelTypeList
|
||||
}
|
||||
this.indexType = 0
|
||||
this.form.typeText = ''
|
||||
this.form.countyFamousHotelType = null
|
||||
} else {
|
||||
this.columnsType = this.hotelTypeList
|
||||
this.indexType = 0
|
||||
this.form.typeText = ''
|
||||
this.form.type = 0
|
||||
}
|
||||
},
|
||||
typeChange(e) {
|
||||
const idx = parseInt(e.detail.value)
|
||||
this.columnsType.map((item, index) => {
|
||||
if (index === idx) {
|
||||
this.form.typeText = item.name
|
||||
this.indexType = index
|
||||
this.form.type = item.id
|
||||
if (this.form.isCountyFamous === 1) {
|
||||
this.form.countyFamousHotelType = item.id
|
||||
} else {
|
||||
this.form.type = item.id
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
@@ -36,6 +36,21 @@
|
||||
</template>
|
||||
</u-cell>
|
||||
</u-form-item>
|
||||
<u-form-item prop="businessLicense">
|
||||
<u-cell title="营业执照名称" :border="false">
|
||||
<template #icon>
|
||||
<text class="required">*</text>
|
||||
</template>
|
||||
<template #value>
|
||||
<u-input
|
||||
v-model="formSupplier.businessLicense"
|
||||
:disabled="reviewing"
|
||||
border="none"
|
||||
placeholder="请填写营业执照名称"
|
||||
/>
|
||||
</template>
|
||||
</u-cell>
|
||||
</u-form-item>
|
||||
<u-form-item prop="avatar">
|
||||
<u-cell title="头像" :border="false">
|
||||
<template #label>
|
||||
@@ -555,6 +570,7 @@ export default {
|
||||
quaPics: [],
|
||||
formSupplier: {
|
||||
name: '',
|
||||
businessLicense: '',
|
||||
avatar: '',
|
||||
contact: '',
|
||||
phone: '',
|
||||
@@ -590,6 +606,12 @@ export default {
|
||||
message: '请填写供应商名称',
|
||||
trigger: ['blur', 'change']
|
||||
},
|
||||
'businessLicense': {
|
||||
type: 'string',
|
||||
required: true,
|
||||
message: '请填写营业执照名称',
|
||||
trigger: ['blur', 'change']
|
||||
},
|
||||
'contact': {
|
||||
type: 'string',
|
||||
required: true,
|
||||
@@ -769,6 +791,7 @@ export default {
|
||||
}
|
||||
this.formSupplier = !this.reviewing && local || {
|
||||
name: '',
|
||||
businessLicense: '',
|
||||
avatar: '',
|
||||
contact: '',
|
||||
phone: '',
|
||||
|
||||
@@ -21,6 +21,22 @@
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
<view class="form-item v12-mt-2">
|
||||
<view class="title">
|
||||
<text class="required">* </text>
|
||||
营业执照名称:
|
||||
</view>
|
||||
<view class="input">
|
||||
<u-textarea
|
||||
border="none"
|
||||
:disabled="form.isDraft === 0 && (form.reviewStatus === 0 || form.reviewStatus === 1)"
|
||||
placeholder="请输入营业执照名称"
|
||||
:placeholder-style="inputPlaceholderStyle"
|
||||
v-model="form.businessLicense"
|
||||
autoHeight
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
<view class="form-item v12-mt-2 v12-d-flex v12-justify-start">
|
||||
<view>
|
||||
<view class="title">
|
||||
@@ -580,6 +596,10 @@ export default {
|
||||
uni.$u.toast('请输入名称')
|
||||
return
|
||||
}
|
||||
if (!this.form.businessLicense) {
|
||||
uni.$u.toast('请输入营业执照名称')
|
||||
return
|
||||
}
|
||||
if (!this.form.cover) {
|
||||
uni.$u.toast('请上传主图')
|
||||
return
|
||||
|
||||
@@ -265,6 +265,12 @@ export default {
|
||||
message: '请填写批发商名称',
|
||||
trigger: ['blur', 'change']
|
||||
},
|
||||
'businessLicense': {
|
||||
type: 'string',
|
||||
required: true,
|
||||
message: '请填写营业执照名称',
|
||||
trigger: ['blur', 'change']
|
||||
},
|
||||
'contact': {
|
||||
type: 'string',
|
||||
required: true,
|
||||
|
||||
@@ -64,11 +64,11 @@
|
||||
<view class="zan-box flex flex-0 ai-end" @click="zanInn">
|
||||
<template v-if="isLike">
|
||||
<image :src="webUrl + '/icon/icon-like.png'" class="img" />
|
||||
<text class="on">{{ inn.zan }}</text>
|
||||
<text class="on">{{ $formatCount(inn.zan) }}</text>
|
||||
</template>
|
||||
<template v-else>
|
||||
<image :src="webUrl + '/icon/icon-like.png'" class="img" />
|
||||
<text>{{ inn.zan }}</text>
|
||||
<text>{{ $formatCount(inn.zan) }}</text>
|
||||
</template>
|
||||
</view>
|
||||
<view class="flex flex-0 ai-end favorite-box" @click="doneFavorite">
|
||||
@@ -84,7 +84,7 @@
|
||||
mode="scaleToFill"
|
||||
class="icon"
|
||||
/>
|
||||
<text>{{ favoriteCount }}</text>
|
||||
<text>{{ $formatCount(favoriteCount) }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -217,7 +217,7 @@
|
||||
:src="webUrl + '/20230803152147141807.png'"
|
||||
class="icon"
|
||||
/>
|
||||
<text class="seeNum-txt">{{ item.pv }}</text>
|
||||
<text class="seeNum-txt">{{ $formatCount(item.pv) }}</text>
|
||||
</view>
|
||||
<view class="flex">
|
||||
<image
|
||||
@@ -236,12 +236,12 @@
|
||||
v-show="item.zan > 0"
|
||||
:class="item.hasZan ? 'on' : ''"
|
||||
class="seeNum-txt"
|
||||
>{{ item.zan }}</text>
|
||||
>{{ $formatCount(item.zan) }}</text>
|
||||
|
||||
</view>
|
||||
<view class="flex" @click="infoClick(item)">
|
||||
<u-icon name="chat" size="24"></u-icon>
|
||||
<text class="seeNum-txt">{{ item.replyCount || 0}}</text>
|
||||
<text class="seeNum-txt">{{ $formatCount(item.replyCount) || 0}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -552,6 +552,16 @@
|
||||
</view>
|
||||
</view>
|
||||
<view class="village-wrap v12-pt-3">
|
||||
<view class="v12-pa-2 sale-wrap">
|
||||
<view
|
||||
v-for="(type, typeIndex) in shopTypeList"
|
||||
:key="typeIndex"
|
||||
:class="{ saleActive: shopTypeActive === type.id }"
|
||||
@click="handleShopType(type)"
|
||||
>
|
||||
{{ type.name }}
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="shopList.length > 0" class="village-list">
|
||||
<view
|
||||
v-for="(shop, shopIndex) in shopList"
|
||||
@@ -876,7 +886,8 @@ import {
|
||||
getSaleList,
|
||||
getJiaLouList,
|
||||
getCityNewsCategory,
|
||||
getCityShopList
|
||||
getCityShopList,
|
||||
getCountyFamousHotelType
|
||||
} from '@/api/qianxian'
|
||||
import ProductWindow from '@/components/ProductWindow'
|
||||
import goCartMixin from '@/mixins/goCartMixins'
|
||||
@@ -966,6 +977,8 @@ export default {
|
||||
newsCategoryList: [],
|
||||
newsCurrent: 0,
|
||||
shopList: [],
|
||||
shopTypeList: [],
|
||||
shopTypeActive: '',
|
||||
}
|
||||
},
|
||||
onShareAppMessage() {
|
||||
@@ -1641,7 +1654,7 @@ export default {
|
||||
industryTabItemClick(index) {
|
||||
if (index === this.industryTabIndex) return
|
||||
this.industryTabIndex = index
|
||||
if(index === 2) {
|
||||
if (index === 2) {
|
||||
const params = {
|
||||
countyId: this.countyId,
|
||||
shopType: 'countyFamous',
|
||||
@@ -1649,23 +1662,44 @@ export default {
|
||||
page: 1,
|
||||
limit: 9999
|
||||
}
|
||||
console.log(this.inn);
|
||||
|
||||
getJiaLouList(params).then(res => {
|
||||
this.jiaLouList = res.data.records || []
|
||||
})
|
||||
}
|
||||
if(index === 1) {
|
||||
const params = {
|
||||
countyFamousDataId: this.id,
|
||||
page: 1,
|
||||
limit: 9999
|
||||
if (index === 1) {
|
||||
this.shopTypeActive = ''
|
||||
if (this.shopTypeList.length === 0) {
|
||||
this.getShopTypeList()
|
||||
}
|
||||
getCityShopList(params).then(res => {
|
||||
this.shopList = res.data.records || []
|
||||
})
|
||||
this.getShopList()
|
||||
}
|
||||
},
|
||||
getShopTypeList() {
|
||||
getCountyFamousHotelType().then(res => {
|
||||
const listData = Array.isArray(res.data)
|
||||
? res.data
|
||||
: (res.data && (res.data.hotelTypeList || res.data.list || res.data.records)) || []
|
||||
this.shopTypeList = [{ name: '全部', id: '' }].concat(listData || [])
|
||||
})
|
||||
},
|
||||
getShopList() {
|
||||
const params = {
|
||||
countyFamousDataId: this.id,
|
||||
page: 1,
|
||||
limit: 9999
|
||||
}
|
||||
if (this.shopTypeActive) {
|
||||
params.countyFamousHotelType = this.shopTypeActive
|
||||
}
|
||||
getCityShopList(params).then(res => {
|
||||
this.shopList = (res.data && (res.data.records || res.data.list)) || []
|
||||
})
|
||||
},
|
||||
handleShopType(type) {
|
||||
if (this.shopTypeActive === type.id) return
|
||||
this.shopTypeActive = type.id
|
||||
this.getShopList()
|
||||
},
|
||||
fileItemClick(file) {
|
||||
const url = file.attachment || ''
|
||||
if (!url) return
|
||||
|
||||
@@ -52,11 +52,11 @@
|
||||
</view>
|
||||
<view class="intro-text v12-mt-2">* 下单后与商家确认入住时间</view>
|
||||
<view class="v12-justify-between v12-align-center v12-mt-2">
|
||||
<view class="v12-primary v12-white-text v12-font-30 date-item v12-px-1" style="height: 160rpx;">
|
||||
<view @click="handleDate" class="v12-primary v12-white-text v12-font-30 date-item v12-px-1" style="height: 160rpx;">
|
||||
<view>预</view>
|
||||
<view>约</view>
|
||||
</view>
|
||||
<view v-for="(d) in currentWeek" :key="d.date" class="date-item" style="width: 74rpx;">
|
||||
<view v-for="(d) in currentWeek" @click="handleDate" :key="d.date" class="date-item" style="width: 74rpx;">
|
||||
<view>{{ d.week }}</view>
|
||||
<view class="v12-my-1 v12-primary-text">{{ d.monthDay }}</view>
|
||||
<view>{{ d.status }}</view>
|
||||
@@ -308,6 +308,7 @@ export default {
|
||||
},
|
||||
handleDateSelected(dateRange) {
|
||||
this.dateRange = dateRange
|
||||
this.showAgreementPopup = true
|
||||
},
|
||||
handleDate() {
|
||||
this.showDatePicker = true
|
||||
|
||||
+305
-440
@@ -1,498 +1,312 @@
|
||||
<template>
|
||||
<view class="health-foods">
|
||||
<view class="v12-justify-center">
|
||||
<view
|
||||
class="ys-btn v12-mr-3 v12-radius-100 v12-dark-text v12-px-5 v12-py-2 v12-font-28 v12-font-bold"
|
||||
@click="toSanctun"
|
||||
>养生胜地</view
|
||||
>
|
||||
<view
|
||||
class="v12-radius-100 v12-primary v12-white-text v12-px-5 v12-py-2 v12-font-28 v12-font-bold"
|
||||
>养生食材</view
|
||||
>
|
||||
</view>
|
||||
<view class="v12-justify-between v12-align-center v12-mt-5">
|
||||
<view
|
||||
class="banner-wrap"
|
||||
v-if="topImageConfig && topImageConfig.backgroundImage"
|
||||
>
|
||||
<image
|
||||
:src="webUrl + '/orderIcon/map_dark.png'"
|
||||
:src="topImageConfig.backgroundImage"
|
||||
class="banner-img"
|
||||
mode="widthFix"
|
||||
class="icon"
|
||||
/>
|
||||
<view class="v12-font-28 v12-secondary-dark-text v12-mr-3">{{
|
||||
cityName
|
||||
}}</view>
|
||||
<view class="flex-1">
|
||||
<u-search
|
||||
:showAction="false"
|
||||
v-model="keyword"
|
||||
bgColor="#fff"
|
||||
searchIconColor="#C52733"
|
||||
@search="search"
|
||||
></u-search>
|
||||
<view class="banner-tabs v12-justify-center">
|
||||
<image
|
||||
class="tab-btn v12-mr-3"
|
||||
:src="travelButtonSrc"
|
||||
mode="widthFix"
|
||||
@click="toSanctun"
|
||||
/>
|
||||
<image
|
||||
class="tab-btn"
|
||||
:src="wellnessButtonSrc"
|
||||
mode="widthFix"
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
<swiper
|
||||
class="v12-justify-between swap"
|
||||
autoplay
|
||||
circular
|
||||
next-margin="300rpx"
|
||||
duration="10000"
|
||||
interval="3000"
|
||||
>
|
||||
<swiper-item v-for="(item, index) in foodItems" :key="index" @click="toDetails(item.id)">
|
||||
<view class="trave-item-wrap v12-mr-3 v12-mt-3">
|
||||
<view class="trave-item">
|
||||
<image
|
||||
class="trave-item"
|
||||
mode="widthFix"
|
||||
:src="item.indexImage"
|
||||
></image>
|
||||
</view>
|
||||
<view class="trave-btn">
|
||||
<text class="one-t">{{ item.name }}</text>
|
||||
<image
|
||||
:src="webUrl + '/orderIcon/arrow.png'"
|
||||
class="arrow-icon v12-ml-1"
|
||||
></image>
|
||||
</view>
|
||||
</view>
|
||||
</swiper-item>
|
||||
</swiper>
|
||||
<view class="v12-justify-center v12-mt-3" v-if="hasRankData">
|
||||
<!-- <view class="v12-justify-center v12-mt-3" v-if="hasRankData">
|
||||
<image
|
||||
class="title-img"
|
||||
:src="webUrl + '/orderIcon/rankTitle.png'"
|
||||
mode="widthFix"
|
||||
></image>
|
||||
</view>
|
||||
<view class="rank-wrap v12-mt-3" v-if="hasRankData">
|
||||
<view class="rank-items-wrap">
|
||||
<view class="bee-rank" v-for="(k, i) in rank" :key="i">
|
||||
<image :src="k.backgroundImage" class="bg-img" style="width:inherit" mode="scaleToFill"></image>
|
||||
<view class="rank-title-wrap">
|
||||
<view class="rank-title v12-font-34 v12-font-bold one-t">{{
|
||||
k.title
|
||||
}}</view>
|
||||
</view>
|
||||
<view class="v12-px-2">
|
||||
</view> -->
|
||||
<!-- <vi
|
||||
<view
|
||||
class="rank-item v12-justify-start v12-align-center v12-mb-4"
|
||||
v-for="(item, index) in k.products"
|
||||
@click="toGoods(item.productId)"
|
||||
:key="index"
|
||||
>
|
||||
<view
|
||||
class="rank-tag"
|
||||
:class="{ 'rank2-bg': index === 1, 'rank3-bg': index === 2 }"
|
||||
>
|
||||
<view
|
||||
class="rank-2"
|
||||
:class="{
|
||||
'rank2-2-bg': index === 1,
|
||||
'rank3-3-bg': index === 2,
|
||||
}"
|
||||
>
|
||||
<view
|
||||
class="rank-item v12-justify-start v12-align-center v12-mb-4"
|
||||
v-for="(item, index) in k.products"
|
||||
@click="toGoods(item.productId)"
|
||||
:key="index"
|
||||
class="rank-3"
|
||||
:class="{
|
||||
'rank2-4-bg': index === 1,
|
||||
'rank3-4-bg': index === 2,
|
||||
}"
|
||||
>
|
||||
<view
|
||||
class="rank-tag"
|
||||
:class="{ 'rank2-bg': index === 1, 'rank3-bg': index === 2 }"
|
||||
class="rank-4"
|
||||
:class="{
|
||||
'rank2-bg': index === 1,
|
||||
'rank3-bg': index === 2,
|
||||
}"
|
||||
>{{ index + 1 }}</view
|
||||
>
|
||||
<view
|
||||
class="rank-2"
|
||||
:class="{
|
||||
'rank2-2-bg': index === 1,
|
||||
'rank3-3-bg': index === 2,
|
||||
}"
|
||||
>
|
||||
<view
|
||||
class="rank-3"
|
||||
:class="{
|
||||
'rank2-4-bg': index === 1,
|
||||
'rank3-4-bg': index === 2,
|
||||
}"
|
||||
>
|
||||
<view
|
||||
class="rank-4"
|
||||
:class="{
|
||||
'rank2-bg': index === 1,
|
||||
'rank3-bg': index === 2,
|
||||
}"
|
||||
>{{ index + 1 }}</view
|
||||
>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="rank-img">
|
||||
<image
|
||||
:src="item.productImage"
|
||||
mode="widthFix"
|
||||
class="rank-img"
|
||||
></image>
|
||||
</view>
|
||||
<view class="v12-ml-2">
|
||||
<view
|
||||
class="v12-font-bold v12-font-24 one-t"
|
||||
style="width: 160rpx"
|
||||
>{{ item.productTitle }}</view
|
||||
>
|
||||
<view class="v12-font-22 more-t">{{ item.productDesc }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="recommend-wrap v12-mt-3">
|
||||
<view class="recommend-title v12-px-3">
|
||||
<text class="v12-dark-text v12-font-36 v12-font-bold">食补推荐</text>
|
||||
<view class="slider"></view>
|
||||
</view>
|
||||
<view class="recommends v12-mt-3">
|
||||
<view
|
||||
class="recommend-item"
|
||||
v-for="(item, index) in recommendItems"
|
||||
:key="index"
|
||||
@click="toGoods(item.productId)"
|
||||
>
|
||||
<view>
|
||||
<view class="recommend-img">
|
||||
<image class="recommend-img" :src="item.image" mode="aspectFit"></image>
|
||||
<view class="name-wrap v12-white-text v12-text-center more-t">{{
|
||||
item.title
|
||||
}}</view>
|
||||
</view>
|
||||
<view class="v12-px-2 v12-font-bold v12-font-28 more-t v12-my-2">{{
|
||||
item.productName
|
||||
}}</view>
|
||||
</view>
|
||||
<view
|
||||
class="v12-justify-between v12-primary-text v12-font-bold v12-px-2 v12-pb-2"
|
||||
>
|
||||
<view class="">
|
||||
<text class="v12-font-32">¥</text>
|
||||
<text class="v12-font-36">{{ item.price }}</text>
|
||||
</view>
|
||||
<view class="cart-img" @click.stop="addToCart(item, 'productId')">
|
||||
<image
|
||||
class="cart-img"
|
||||
:src="webUrl + '/orderIcon/组 355.png'"
|
||||
></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="recommendItems.length === 0">
|
||||
<view class="no-data-wrap v12-justify-center v12-mt-6">
|
||||
<view class="rank-img">
|
||||
<image
|
||||
:src="webUrl + '/orderIcon/微信图片_20241009220552.png'"
|
||||
:src="item.productImage"
|
||||
mode="widthFix"
|
||||
class="rank-img"
|
||||
></image>
|
||||
</view>
|
||||
<view class="v12-ml-2">
|
||||
<view
|
||||
class="v12-font-bold v12-font-24 one-t"
|
||||
style="width: 160rpx"
|
||||
>{{ item.productTitle }}</view
|
||||
>
|
||||
<view class="v12-font-22 more-t">{{ item.productDesc }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view> -->
|
||||
<view class="v12-justify-between v12-align-center v12-px-3 tabs-wrap">
|
||||
<view
|
||||
class="tab v12-font-34 v12-dark-text v12-mr-5"
|
||||
v-for="(tab, index) in tabs"
|
||||
@click="handleTab(index,tab)"
|
||||
:class="{'activeTab' : index === actived}"
|
||||
:key="index">
|
||||
<text>{{ tab.name }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="v12-justify-between sanctup-items v12-mt-3">
|
||||
<view v-for="(item, index) in items" :key="index" class="v12-pa-1" @click="toStore(item)">
|
||||
<view class="img">
|
||||
<video
|
||||
class="img"
|
||||
:src="item.cover"
|
||||
:play-btn-position="'center'"
|
||||
:show-fullscreen-btn="false"
|
||||
:show-center-play-btn="false"
|
||||
:show-play-btn="false"
|
||||
:controls="false"
|
||||
:poster="item.cover + '?vframe/jpg/offset/1'"
|
||||
v-if="item.coverType === 2">
|
||||
</video>
|
||||
<image v-else class="img" :src="item.cover"></image>
|
||||
<view class="v12-white-text address">
|
||||
<image
|
||||
class="map-icon v12-mr-1"
|
||||
:src="webUrl + '/orderIcon/map_white.png'"
|
||||
></image>
|
||||
<text class="v12-font-28">{{ item.areaName }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="item.intro" class="v12-font-bold v12-font-28 v12-mt-1 more-t desc-txt">{{ item.intro }}</view>
|
||||
<view class="v12-justify-start v12-align-center v12-my-1">
|
||||
<view class="atr">
|
||||
<image class="atr" :src="item.avatar"></image>
|
||||
</view>
|
||||
<view class="v12-font-26 v12-ml-2 v12-dark-text one-t">{{ item.name }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="items.length === 0" class="v12-justify-center v12-mt-6">
|
||||
<view class="no-data-wrap">
|
||||
<image :src="webUrl + '/orderIcon/微信图片_20241009220552.png'" mode="widthFix"></image>
|
||||
</view>
|
||||
</view>
|
||||
<ProductWindow
|
||||
ref="attrWindow"
|
||||
:attr="attr"
|
||||
:cartNum="cart_num"
|
||||
:showOk="true"
|
||||
@changeFun="changeFun"
|
||||
@ok="handleOk"
|
||||
/>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
import { getRank, getFoods, getRecipe } from "@/api/health";
|
||||
import ProductWindow from '@/components/ProductWindow'
|
||||
import goCartMixin from '@/mixins/goCartMixins'
|
||||
import { getCategory,getWellnessPlace } from '@/api/health'
|
||||
import { getJiaLouList } from '@/api/qianxian'
|
||||
import { getWellnessTopImage } from '@/api/health'
|
||||
export default {
|
||||
components: {
|
||||
ProductWindow
|
||||
},
|
||||
mixins: [goCartMixin],
|
||||
computed: {
|
||||
hasRankData() {
|
||||
if (!Array.isArray(this.rank)) return false;
|
||||
const hasText = (v) => typeof v === "string" && v.trim() !== "";
|
||||
const hasValue = (v) => v !== null && v !== undefined && v !== "";
|
||||
return this.rank.some((item) => {
|
||||
if (!item) return false;
|
||||
if (hasText(item.title) || hasText(item.backgroundImage)) {
|
||||
return true;
|
||||
}
|
||||
if (Array.isArray(item.products)) {
|
||||
return item.products.some((p) => {
|
||||
if (!p) return false;
|
||||
return (
|
||||
hasText(p.productTitle) ||
|
||||
hasText(p.productDesc) ||
|
||||
hasValue(p.productImage) ||
|
||||
hasValue(p.productId)
|
||||
);
|
||||
});
|
||||
}
|
||||
return false;
|
||||
});
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
webUrl: this.$VUE_APP_RESOURCES_URL,
|
||||
foodItems: [],
|
||||
recommendItems: [],
|
||||
cityId: "",
|
||||
cityName: "",
|
||||
keyword: "",
|
||||
rank: [],
|
||||
};
|
||||
tabs: [],
|
||||
items: [],
|
||||
traveItems: [],
|
||||
actived: 0,
|
||||
cityId: '',
|
||||
cityName: '',
|
||||
categoryId: null,
|
||||
topImageConfig: {}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
travelButtonSrc() {
|
||||
const config = this.topImageConfig || {}
|
||||
return config.travelButtonImage || config.travelButtonImage || ''
|
||||
},
|
||||
wellnessButtonSrc() {
|
||||
const config = this.topImageConfig || {}
|
||||
return config.wellnessButtonImageFocus || config.wellnessButtonImage || ''
|
||||
}
|
||||
},
|
||||
onLoad(opts) {
|
||||
this.cityId = opts.city;
|
||||
this.cityName = decodeURIComponent(opts.cityName);
|
||||
this.getRank();
|
||||
this.getList();
|
||||
this.getRecipeList();
|
||||
console.log(opts);
|
||||
|
||||
this.cityId = opts.city
|
||||
this.cityName = decodeURIComponent(decodeURIComponent(opts.cityName))
|
||||
getCategory().then(res => {
|
||||
this.tabs = res.data
|
||||
this.categoryId = res.data[0].id
|
||||
this.getList()
|
||||
})
|
||||
this.getTop()
|
||||
this.getTopImage()
|
||||
},
|
||||
onUnload() {
|
||||
// uni.navigateBack({
|
||||
// delta: 0
|
||||
// })
|
||||
},
|
||||
methods: {
|
||||
toGoods(id) {
|
||||
this.$yrouter.push({
|
||||
path: "/pages/shop/GoodsCon/index",
|
||||
query: {
|
||||
id: id,
|
||||
},
|
||||
});
|
||||
handleTab(index, tab) {
|
||||
this.actived = index
|
||||
this.categoryId = tab.id
|
||||
this.getList()
|
||||
},
|
||||
toSanctun() {
|
||||
uni.redirectTo({
|
||||
url:
|
||||
"/pkg_product/views/healthSanctum?city=" +
|
||||
this.cityId +
|
||||
"&cityName=" +
|
||||
this.cityName,
|
||||
});
|
||||
url: '/pkg_product/views/healthSanctum?city=' + this.cityId + '&cityName=' + this.cityName
|
||||
})
|
||||
},
|
||||
getRecipeList() {
|
||||
getRecipe().then((res) => {
|
||||
// console.log(res);
|
||||
this.foodItems = res.data.records;
|
||||
});
|
||||
},
|
||||
toDetails(id) {
|
||||
uni.navigateTo({
|
||||
url: "/pkg_product/views/healthFoodDetails?id=" + id,
|
||||
});
|
||||
},
|
||||
getRank() {
|
||||
let params = {
|
||||
goodCityId: this.cityId,
|
||||
};
|
||||
getRank(params).then((res) => {
|
||||
this.rank = res.data;
|
||||
});
|
||||
toFoods() {
|
||||
uni.redirectTo({
|
||||
url: '/pkg_product/views/healthFoods?city=' + this.cityId + '&cityName=' + this.cityName
|
||||
})
|
||||
},
|
||||
getList() {
|
||||
const params = {
|
||||
// countyId: this.cityId,
|
||||
goodCityId: this.cityId,
|
||||
keyword: this.keyword,
|
||||
wellnessPlaceCateId : this.categoryId,
|
||||
shopType: 'wellnessCate',
|
||||
page: 1,
|
||||
limit: 9999,
|
||||
};
|
||||
getFoods(params).then((res) => {
|
||||
this.recommendItems = res.data.records;
|
||||
});
|
||||
limit: 9999
|
||||
}
|
||||
getJiaLouList(params).then(res => {
|
||||
// console.log(res);
|
||||
this.items = res.data.records
|
||||
})
|
||||
},
|
||||
search() {
|
||||
this.getList();
|
||||
uni.navigateTo({
|
||||
url: '/pkg_product/views/healthSearch?city=' + this.cityId + '&cityName=' + this.cityName
|
||||
})
|
||||
},
|
||||
},
|
||||
};
|
||||
getTop() {
|
||||
const params = {
|
||||
goodCityId: this.cityId,
|
||||
shopType: 'wellnessTop',
|
||||
page: 1,
|
||||
limit: 9999
|
||||
}
|
||||
getJiaLouList(params).then(res => {
|
||||
// console.log(res);
|
||||
this.traveItems = res.data.records
|
||||
})
|
||||
},
|
||||
toStore(item) {
|
||||
if(item.dataType === 'wellnessPlace'){
|
||||
this.$yrouter.push({
|
||||
path: '/pagesInn/inn/innHome',
|
||||
query: {
|
||||
id: item.hotelId
|
||||
}
|
||||
})
|
||||
}else{
|
||||
uni.navigateTo({ url: '/pkg_product/views/sojoumStore?id=' + item.id })
|
||||
}
|
||||
},
|
||||
getTopImage() {
|
||||
const cached = uni.getStorageSync('wellnessTopImageConfig')
|
||||
if (cached) {
|
||||
this.topImageConfig = cached
|
||||
}
|
||||
getWellnessTopImage().then(res => {
|
||||
this.topImageConfig = res.data || {}
|
||||
uni.setStorageSync('wellnessTopImageConfig', this.topImageConfig)
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="less" scoped>
|
||||
.arrow-icon {
|
||||
.health-foods{
|
||||
background: #fff;
|
||||
overflow-x: hidden;
|
||||
}
|
||||
.banner-wrap{
|
||||
position: relative;
|
||||
}
|
||||
.banner-img{
|
||||
width: 100%;
|
||||
height: auto;
|
||||
display: block;
|
||||
will-change: transform;
|
||||
}
|
||||
.banner-tabs{
|
||||
position: absolute;
|
||||
left: 0;
|
||||
right: 0;
|
||||
top: 40rpx;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
.tab-btn{
|
||||
width: 200rpx;
|
||||
will-change: transform;
|
||||
display: block;
|
||||
height: auto;
|
||||
}
|
||||
.tabs-wrap{
|
||||
white-space: nowrap;
|
||||
overflow: scroll;
|
||||
.tab:last-child{
|
||||
margin-right: 0 !important;
|
||||
}
|
||||
}
|
||||
.map-icon{
|
||||
width: 28rpx;
|
||||
height: 28rpx;
|
||||
}
|
||||
.arrow-icon{
|
||||
width: 25rpx;
|
||||
height: 25rpx;
|
||||
}
|
||||
.icon {
|
||||
.icon{
|
||||
width: 30rpx;
|
||||
height: 30rpx;
|
||||
}
|
||||
.rank2-bg {
|
||||
background-color: #ecdad6 !important;
|
||||
}
|
||||
.rank3-bg {
|
||||
background-color: #dae3f3 !important;
|
||||
}
|
||||
.rank3-3-bg {
|
||||
background-color: #c8c8c8 !important;
|
||||
}
|
||||
.rank2-2-bg {
|
||||
background-color: #d3b9b2 !important;
|
||||
}
|
||||
.rank2-4-bg {
|
||||
background-color: #ad8578 !important;
|
||||
}
|
||||
.rank3-4-bg {
|
||||
background-color: #a5a5a5 !important;
|
||||
}
|
||||
.rank-2 {
|
||||
width: 40rpx; /* 宽度 */
|
||||
height: 45rpx; /* 高度,根据正六边形的几何特性计算 */
|
||||
background-color: #ddc76f; /* 背景颜色 */
|
||||
clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
.rank-3 {
|
||||
width: 30rpx; /* 宽度 */
|
||||
height: 35rpx; /* 高度,根据正六边形的几何特性计算 */
|
||||
background-color: #ad9161; /* 背景颜色 */
|
||||
clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-weight: bold;
|
||||
color: #333;
|
||||
}
|
||||
.rank-4 {
|
||||
width: 25rpx; /* 宽度 */
|
||||
height: 28rpx; /* 高度,根据正六边形的几何特性计算 */
|
||||
background-color: #fff3c2; /* 背景颜色 */
|
||||
clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-weight: bold;
|
||||
color: #333;
|
||||
}
|
||||
.ys-btn {
|
||||
background: #e2d7c3;
|
||||
}
|
||||
.cart-img {
|
||||
width: 48rpx;
|
||||
height: 48rpx;
|
||||
border-radius: 50%;
|
||||
}
|
||||
.bg-img {
|
||||
position: absolute;
|
||||
height: 100%;
|
||||
}
|
||||
.recommends {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
grid-column-gap: 20rpx;
|
||||
grid-row-gap: 20rpx;
|
||||
}
|
||||
.recommend-img {
|
||||
width: 344rpx;
|
||||
height: 344rpx;
|
||||
background: #333;
|
||||
border-radius: 20rpx;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
}
|
||||
.name-wrap {
|
||||
position: absolute;
|
||||
background: rgba(0, 0, 0, 0.2);
|
||||
width: 100%;
|
||||
padding: 8px 0;
|
||||
bottom: 0;
|
||||
height: 70rpx;
|
||||
}
|
||||
.recommend-item {
|
||||
background: #ffffff;
|
||||
border-radius: 20rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
}
|
||||
.recommend-title {
|
||||
position: relative;
|
||||
width: fit-content;
|
||||
}
|
||||
.slider {
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
height: 6rpx;
|
||||
background: linear-gradient(
|
||||
to right,
|
||||
#c52733 0%,
|
||||
rgba(255, 255, 255, 0) 100%
|
||||
);
|
||||
border-radius: 6rpx;
|
||||
bottom: 5rpx;
|
||||
}
|
||||
.rank-wrap {
|
||||
background: #e2bc8d;
|
||||
border-radius: 20rpx;
|
||||
}
|
||||
.rank-tag {
|
||||
width: 50rpx; /* 宽度 */
|
||||
height: 55rpx; /* 高度,根据正六边形的几何特性计算 */
|
||||
background-color: #fbeeb7; /* 背景颜色 */
|
||||
clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
|
||||
position: absolute;
|
||||
text-align: center;
|
||||
color: #ffffff;
|
||||
font-size: 20rpx;
|
||||
line-height: 55rpx;
|
||||
top: -22.5rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
.rank-img {
|
||||
min-width: 104rpx;
|
||||
width: 104rpx;
|
||||
height: 104rpx;
|
||||
background: #666;
|
||||
border-radius: 20rpx;
|
||||
}
|
||||
.bee-rank,
|
||||
.drug-rank {
|
||||
width: 100%;
|
||||
background: #999;
|
||||
border-radius: 20rpx;
|
||||
overflow: hidden;
|
||||
box-sizing: border-box;
|
||||
position: relative;
|
||||
}
|
||||
.rank-title-wrap {
|
||||
height: 140rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.rank-title {
|
||||
width: 200rpx;
|
||||
padding: 10rpx 5rpx;
|
||||
background: linear-gradient(
|
||||
to right,
|
||||
#ffffff 0%,
|
||||
rgba(255, 255, 255, 0) 100%
|
||||
);
|
||||
z-index: 999;
|
||||
}
|
||||
.rank-items-wrap {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
grid-column-gap: 20rpx;
|
||||
padding: 20rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.rank-item {
|
||||
width: 100%;
|
||||
height: 116rpx;
|
||||
background: #ffffff;
|
||||
border-radius: 20rpx;
|
||||
padding: 0 10rpx;
|
||||
box-sizing: border-box;
|
||||
position: relative;
|
||||
}
|
||||
.title-img {
|
||||
width: 404rpx;
|
||||
}
|
||||
.health-foods {
|
||||
min-height: 100vh;
|
||||
background-color: #faeed8;
|
||||
padding: 20rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.flex-1 {
|
||||
.flex-1{
|
||||
flex: 1;
|
||||
}
|
||||
.swap {
|
||||
.swap{
|
||||
overflow: auto;
|
||||
}
|
||||
.trave-item-wrap {
|
||||
.trave-item-wrap{
|
||||
position: relative;
|
||||
}
|
||||
.trave-btn {
|
||||
.trave-btn{
|
||||
position: absolute;
|
||||
left: 0;
|
||||
right: 0;
|
||||
@@ -500,20 +314,71 @@ export default {
|
||||
bottom: 30rpx;
|
||||
text-align: center;
|
||||
width: 212rpx;
|
||||
background: rgba(255, 255, 255, 0.7);
|
||||
background: rgba(255,255,255,0.7);
|
||||
border-radius: 60rpx;
|
||||
font-size: 28rpx;
|
||||
font-weight: bold;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 10rpx 20rpx;
|
||||
}
|
||||
.trave-item{
|
||||
width: 382rpx;
|
||||
height: 272rpx;
|
||||
background: rgba(230,178,178,0.39);
|
||||
border-radius: 20rpx;
|
||||
position: relative;
|
||||
}
|
||||
.desc-txt {
|
||||
height: 78rpx;
|
||||
line-height: 40rpx;
|
||||
}
|
||||
.address{
|
||||
position: absolute;
|
||||
left: 30rpx;
|
||||
bottom: 30rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
.trave-item {
|
||||
width: 382rpx;
|
||||
height: 272rpx;
|
||||
background: rgba(230, 178, 178, 0.39);
|
||||
border-radius: 20rpx;
|
||||
overflow: hidden;
|
||||
.sanctup-items{
|
||||
display: grid;
|
||||
grid-template-columns: 50% 50%;
|
||||
}
|
||||
.atr{
|
||||
width: 52rpx;
|
||||
height: 52rpx;
|
||||
border-radius: 50%;
|
||||
}
|
||||
.img{
|
||||
width: 320rpx;
|
||||
height: 320rpx;
|
||||
// background: #707070;
|
||||
border-radius: 16rpx;
|
||||
position: relative;
|
||||
}
|
||||
.sanctum-wrap{
|
||||
min-height: 100vh;
|
||||
background-color: #fff;
|
||||
padding: 20rpx ;
|
||||
}
|
||||
.tab{
|
||||
position: relative;
|
||||
}
|
||||
.slider{
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
height: 6rpx;
|
||||
background: linear-gradient(to right, #C52733 0%, rgba(255,255,255,0) 100%);
|
||||
border-radius: 6rpx;
|
||||
bottom: 5rpx;
|
||||
}
|
||||
.activeTab{
|
||||
font-size: 34rpx;
|
||||
background: #C52733;
|
||||
color: #fff !important;
|
||||
border-radius: 100rpx;
|
||||
padding: 4rpx 20rpx;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,8 +1,22 @@
|
||||
<template>
|
||||
<view class="sanctum-wrap">
|
||||
<view class="v12-justify-center">
|
||||
|
||||
<!-- <view class="v12-justify-center">
|
||||
<view class="v12-mr-3 v12-radius-100 v12-primary v12-white-text v12-px-5 v12-py-2 v12-font-28 v12-font-bold">养生胜地</view>
|
||||
<view class="v12-radius-100 v12-grey v12-dark-text v12-px-5 v12-py-2 v12-font-28 v12-font-bold" @click="toFoods">养生食材</view>
|
||||
</view> -->
|
||||
<view class="banner-tabs v12-justify-center">
|
||||
<image
|
||||
class="tab-btn v12-mr-3"
|
||||
:src="travelButtonSrc"
|
||||
mode="widthFix"
|
||||
/>
|
||||
<image
|
||||
class="tab-btn"
|
||||
:src="wellnessButtonSrc"
|
||||
mode="widthFix"
|
||||
@click="toFoods"
|
||||
/>
|
||||
</view>
|
||||
<view class="v12-justify-between v12-align-center v12-mt-5">
|
||||
<image
|
||||
@@ -38,7 +52,7 @@
|
||||
</swiper-item>
|
||||
</swiper>
|
||||
<view class="v12-justify-between v12-align-center v12-px-3 v12-mt-3 tabs-wrap">
|
||||
<view
|
||||
<!-- <view
|
||||
class="tab v12-font-34 v12-dark-text v12-mr-5"
|
||||
v-for="(tab, index) in tabs"
|
||||
@click="handleTab(index,tab)"
|
||||
@@ -46,7 +60,8 @@
|
||||
:key="index">
|
||||
<text>{{ tab.name }}</text>
|
||||
<view :class="{'slider': index === actived}"></view>
|
||||
</view>
|
||||
</view> -->
|
||||
<text class=" v12-font-34 v12-dark-text v12-mr-5 v12-font-bold">大家都在看</text>
|
||||
</view>
|
||||
<view class="v12-justify-between sanctup-items v12-mt-3">
|
||||
<view v-for="(item, index) in items" :key="index" class="v12-pa-1" @click="toStore(item)">
|
||||
@@ -90,6 +105,7 @@
|
||||
<script>
|
||||
import { getCategory,getWellnessPlace } from '@/api/health'
|
||||
import { getJiaLouList } from '@/api/qianxian'
|
||||
import { getWellnessTopImage } from '@/api/health'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
@@ -101,6 +117,17 @@ export default {
|
||||
cityId: '',
|
||||
cityName: '',
|
||||
categoryId: null,
|
||||
topImageConfig: {}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
travelButtonSrc() {
|
||||
const config = this.topImageConfig || {}
|
||||
return config.travelButtonImageFocus || config.travelButtonImage || ''
|
||||
},
|
||||
wellnessButtonSrc() {
|
||||
const config = this.topImageConfig || {}
|
||||
return config.wellnessButtonImage || config.wellnessButtonImageFocus || ''
|
||||
keyword: ''
|
||||
}
|
||||
},
|
||||
@@ -115,6 +142,7 @@ export default {
|
||||
this.getList()
|
||||
})
|
||||
this.getTop()
|
||||
this.getTopImage()
|
||||
},
|
||||
onUnload() {
|
||||
// uni.navigateBack({
|
||||
@@ -136,8 +164,7 @@ export default {
|
||||
const params = {
|
||||
// countyId: this.cityId,
|
||||
goodCityId: this.cityId,
|
||||
wellnessPlaceCateId : this.categoryId,
|
||||
shopType: 'wellnessCate',
|
||||
shopType: 'wellnessTravel',
|
||||
page: 1,
|
||||
limit: 9999
|
||||
}
|
||||
@@ -175,10 +202,44 @@ export default {
|
||||
uni.navigateTo({ url: '/pkg_product/views/sojoumStore?id=' + item.id })
|
||||
}
|
||||
},
|
||||
getTopImage() {
|
||||
const cached = uni.getStorageSync('wellnessTopImageConfig')
|
||||
if (cached) {
|
||||
this.topImageConfig = cached
|
||||
}
|
||||
getWellnessTopImage().then(res => {
|
||||
this.topImageConfig = res.data || {}
|
||||
uni.setStorageSync('wellnessTopImageConfig', this.topImageConfig)
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="less" scoped>
|
||||
.banner-wrap{
|
||||
position: relative;
|
||||
margin-left: -20rpx;
|
||||
margin-right: -20rpx;
|
||||
}
|
||||
.banner-img{
|
||||
width: 100%;
|
||||
height: auto;
|
||||
display: block;
|
||||
will-change: transform;
|
||||
}
|
||||
.banner-tabs{
|
||||
left: 0;
|
||||
right: 0;
|
||||
top: 40rpx;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
.tab-btn{
|
||||
width: 200rpx;
|
||||
will-change: transform;
|
||||
display: block;
|
||||
height: auto;
|
||||
}
|
||||
.tabs-wrap{
|
||||
white-space: nowrap;
|
||||
overflow: scroll;
|
||||
|
||||
@@ -22,15 +22,15 @@
|
||||
class="map-icon v12-mr-1"
|
||||
:src="webUrl + '/orderIcon/map_white.png'"
|
||||
></image>
|
||||
<text class="v12-font-28">{{ item.areaName }}</text>
|
||||
<text class="v12-font-28">{{ item.areaName || '' }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="v12-font-bold v12-font-28 v12-mt-1 more-t desc-txt">{{ item.intro }}</view>
|
||||
<view class="v12-font-bold v12-font-28 v12-mt-1 more-t desc-txt">{{ item.intro || '' }}</view>
|
||||
<view class="v12-justify-start v12-align-center v12-my-1">
|
||||
<view class="atr">
|
||||
<image class="atr" :src="item.avatar"></image>
|
||||
</view>
|
||||
<view class="v12-font-26 v12-ml-2 v12-dark-text one-t">{{ item.name }}</view>
|
||||
<view class="v12-font-26 v12-ml-2 v12-dark-text one-t">{{ item.name || '' }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
<view class="btns">
|
||||
<view class="flex">
|
||||
<image :src="webUrl + '/20230803152147141807.png'" class="icon" />
|
||||
<text class="seeNum-txt">{{ item.pv }}</text>
|
||||
<text class="seeNum-txt">{{ $formatCount(item.pv) }}</text>
|
||||
</view>
|
||||
<view class="flex">
|
||||
<image
|
||||
@@ -68,12 +68,12 @@
|
||||
v-show="item.zan > 0"
|
||||
:class="item.zanVo ? 'on' : ''"
|
||||
class="seeNum-txt"
|
||||
>{{ item.zan }}</text
|
||||
>{{ $formatCount(item.zan) }}</text
|
||||
>
|
||||
</view>
|
||||
<view class="flex">
|
||||
<u-icon name="chat" size="24"></u-icon>
|
||||
<text class="seeNum-txt">{{ item.replyCount || comments.length }}</text>
|
||||
<text class="seeNum-txt">{{ $formatCount(item.replyCount || comments.length) }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -227,7 +227,7 @@
|
||||
:src="webUrl + '/20230803152147141807.png'"
|
||||
class="icon"
|
||||
/>
|
||||
<text class="seeNum-txt">{{ item.pv }}</text>
|
||||
<text class="seeNum-txt">{{ $formatCount(item.pv) }}</text>
|
||||
</view>
|
||||
<view class="flex">
|
||||
<image
|
||||
@@ -246,7 +246,7 @@
|
||||
v-show="item.zan > 0"
|
||||
:class="item.zanVo ? 'on' : ''"
|
||||
class="seeNum-txt"
|
||||
>{{ item.zan }}</text>
|
||||
>{{ $formatCount(item.zan) }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -176,7 +176,7 @@
|
||||
<button class="btn v12-primary-border v12-primary-text modify-time" @click="modifyStayTime">修改入住时间</button>
|
||||
<button class="btn v12-primary-border v12-primary-text refund" @click="applyRefund">申请退款</button>
|
||||
</view>
|
||||
<view class="v12-align-center" v-if="orderInfo._status && ['3','4'].includes(orderInfo._status._type)">
|
||||
<view class="v12-align-center" v-if="orderInfo._status && ['3'].includes(orderInfo._status._type)">
|
||||
<button class="btn v12-primary-border v12-primary-text" @click="goEvaluate">立即评价</button>
|
||||
</view>
|
||||
<view class="v12-align-center" v-if="!orderInfo._status && ['1','2'].includes(orderInfo._status._type)">
|
||||
|
||||
@@ -173,7 +173,7 @@
|
||||
:src="webUrl + '/20230803152147141807.png'"
|
||||
class="icon"
|
||||
/>
|
||||
<text class="seeNum-txt">{{ item.pv }}</text>
|
||||
<text class="seeNum-txt">{{ $formatCount(item.pv) }}</text>
|
||||
</view>
|
||||
<view class="flex">
|
||||
<image
|
||||
@@ -192,7 +192,7 @@
|
||||
v-show="item.zan > 0"
|
||||
:class="item.zanVo ? 'on' : ''"
|
||||
class="seeNum-txt"
|
||||
>{{ item.zan }}</text>
|
||||
>{{ $formatCount(item.zan) }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -211,7 +211,7 @@
|
||||
mode="scaleToFill"
|
||||
class="icon-heart"
|
||||
/>
|
||||
<text>{{ item['favoriteCount'] }}</text>
|
||||
<text>{{ $formatCount(item['favoriteCount']) }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
Reference in New Issue
Block a user