This commit is contained in:
zhouhefeng
2026-06-01 08:36:26 +08:00
parent f05e534e52
commit 8b47088953
47 changed files with 1733 additions and 301 deletions
@@ -99,7 +99,7 @@ layout("/layouts/platform_tour_signup_h5.html"){
</style>
<div id="app">
<van-nav-bar title="疗休养报名" left-text="返回" left-arrow @click-left="historyBack" fixed placeholder></van-nav-bar>
<van-nav-bar title="疗休养报名" left-text="返回" left-arrow @click-left="historyBack('/platform/tour/signup/h5/signup')" fixed placeholder></van-nav-bar>
<div class="tour-apply-page">
<van-loading v-if="pageLoading" size="24px" vertical>加载中...</van-loading>
@@ -544,7 +544,7 @@ layout("/layouts/platform_tour_signup_h5.html"){
message: res.msg || "报名成功",
confirmButtonColor: "#1867b0"
}).then(() => {
window.location.href = "/platform/tour/signup/h5/signup"
window.location.replace("/platform/tour/signup/h5/signup")
})
} else {
vant.Dialog.alert({
@@ -173,7 +173,7 @@ layout("/layouts/platform_tour_signup_h5.html"){
</style>
<div id="app">
<van-nav-bar title="线路详情" left-text="返回" left-arrow @click-left="historyBack" fixed placeholder></van-nav-bar>
<van-nav-bar title="线路详情" left-text="返回" left-arrow @click-left="historyBack('/platform/tour/signup/h5/signup')" fixed placeholder></van-nav-bar>
<div class="tour-detail-page">
<van-loading v-if="detailLoading" size="24px" vertical>加载中...</van-loading>
@@ -379,7 +379,7 @@ layout("/layouts/platform_tour_signup_h5.html"){
</style>
<div id="app" class="tour-line-page">
<van-nav-bar title="疗休养线路" left-text="返回" left-arrow @click-left="historyBack" fixed placeholder></van-nav-bar>
<van-nav-bar title="疗休养线路" left-text="返回" left-arrow @click-left="historyBack('/platform/tour/signup/h5')" fixed placeholder></van-nav-bar>
<div class="tour-line-toolbar">
<div class="tour-line-search-row">
@@ -411,7 +411,8 @@ layout("/layouts/platform_h5.html"){
currentSegmentId: "",
studying: false,
pendingSeconds: 0,
heartbeatTimer: null
heartbeatTimer: null,
navigatingBack: false
}
},
computed: {
@@ -685,9 +686,29 @@ layout("/layouts/platform_h5.html"){
this.finishStudy(false)
this.playerVisible = false
},
goBack() {
this.finishStudy(true)
pjaxReplace("/platform/learning/course/h5")
async goBack() {
if (this.navigatingBack) return
this.navigatingBack = true
try {
await this.finishStudy(true)
} finally {
this.navigateBack()
}
},
navigateBack() {
if (window.history.length > 1) {
window.history.back()
return
}
$.pjax({
url: "/platform/learning/course/h5",
container: "#container",
maxCacheLength: 0,
push: false,
replace: true,
fragment: "#container",
timeout: 8000
})
}
},
async mounted() {
@@ -230,18 +230,18 @@ const home = {
.map(src => ({ src }))
},
listHomeBanner() {
const cached = this.readHomeCache("banner")
const cached = this.readHomeCache("h5Banner")
if (cached && cached.length) {
this.bannerList = cached
this.activeBannerIndex = 0
}
this.$axios.post("/open/common/getConfigKey", { key: "AppHomeImg" }).then((res) => {
this.$axios.post("/open/common/getConfigKey", { key: "H5AppHomeImg" }).then((res) => {
if (res.code === 0) {
const configBannerList = this.parseBannerList(res.data)
const nextBannerList = configBannerList.length > 0 ? configBannerList : this.defaultBannerList
this.bannerList = nextBannerList
this.activeBannerIndex = 0
this.writeHomeCache("banner", nextBannerList, this.homeCacheTtl.banner)
this.writeHomeCache("h5Banner", nextBannerList, this.homeCacheTtl.banner)
this.cacheBannerImages(nextBannerList)
}
}).catch(() => {
@@ -164,7 +164,7 @@ layout("/layouts/platform_h5.html"){
position: relative;
display: flex;
flex-direction: row;
height: 90px;
min-height: 120px;
}
.welfare-option.selected {
@@ -185,49 +185,87 @@ layout("/layouts/platform_h5.html"){
}
.welfare-option-image {
width: 90px;
height: 90px;
width: 100px;
height: 100px;
margin: 10px 0 10px 10px;
position: relative;
flex-shrink: 0;
border-radius: 8px;
overflow: hidden;
background: #f7f8fa;
}
.welfare-option-content {
padding: 6px 12px;
padding: 10px 12px;
flex: 1;
display: flex;
flex-direction: column;
position: relative;
min-width: 0;
}
.welfare-option-title {
font-size: 15px;
font-weight: bold;
color: var(--text-primary);
margin-bottom: 0;
padding-right: 30px;
margin-bottom: 5px;
padding-right: 34px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
line-height: 1.4;
}
.welfare-option-type-tag {
display: inline-flex;
align-items: center;
height: 17px;
padding: 0 4px;
margin-right: 5px;
border-radius: 3px;
background: var(--primary-color);
color: #fff;
font-size: 11px;
line-height: 17px;
vertical-align: 1px;
}
.welfare-option-rank {
margin-bottom: 4px;
color: #d6a21e;
font-size: 12px;
line-height: 1.3;
display: flex;
align-items: center;
}
.welfare-option-rank .van-icon {
margin-right: 3px;
font-size: 14px;
}
.welfare-option-desc {
padding-right: 4px;
color: var(--text-secondary);
font-size: 12px;
line-height: 1.45;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
line-height: 1.4;
}
.welfare-option-desc {
display: none;
}
.welfare-option-footer {
margin-top: auto;
display: flex;
justify-content: space-between;
justify-content: flex-end;
align-items: center;
gap: 10px;
}
.welfare-option-checkbox {
position: absolute;
bottom: 12px;
right: 12px;
flex-shrink: 0;
}
.welfare-option-checkbox .van-stepper {
@@ -240,13 +278,16 @@ layout("/layouts/platform_h5.html"){
}
.welfare-detail-btn {
position: absolute;
bottom: 12px;
left: 12px;
color: var(--primary-color);
height: 24px;
padding: 0 10px;
border-radius: 12px;
background: var(--primary-color);
color: #fff;
font-size: 13px;
display: flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
}
.welfare-detail-btn .van-icon {
@@ -640,14 +681,17 @@ layout("/layouts/platform_h5.html"){
</div>
<div class="welfare-option-content">
<div class="welfare-option-title">{{ option.optionName }}</div>
<!-- 查看详情按钮 -->
<div class="welfare-detail-btn" @click.stop="showOptionDetail(option)">
<van-icon name="info-o"/>
<span style="position: relative; top: -0.5px">查看详情</span>
<div class="welfare-option-title">
<span class="welfare-option-type-tag">套餐</span>{{ option.optionName }}
</div>
<div class="welfare-option-rank">
<van-icon name="medal-o"/>
<span>{{ optionRankText(option) }}</span>
</div>
<div class="welfare-option-desc">{{ optionBrief(option) }}</div>
<!-- 单选模式使用单选按钮 -->
<div class="welfare-option-radio" v-if="projectInfo.isCheckBox === 'radio'">
<van-radio
@@ -658,21 +702,29 @@ layout("/layouts/platform_h5.html"){
></van-radio>
</div>
<!-- 多选模式使用步进器 -->
<div class="welfare-option-checkbox" v-else>
<van-stepper
:key="'input-number-'+index+'-'+option.selectNumKey|| 0"
v-model="option.selectNum"
integer
disable-input
:default-value="0"
:min="0"
:disabled="isDeadlinePassed"
input-width="40px"
button-size="22px"
@change="selectNumChange(index,option.selectNum)"
theme="round"
></van-stepper>
<div class="welfare-option-footer">
<!-- 查看详情按钮 -->
<div class="welfare-detail-btn" @click.stop="showOptionDetail(option)">
<van-icon name="info-o"/>
<span style="position: relative; top: -0.5px">查看详情</span>
</div>
<!-- 多选模式使用步进器 -->
<div class="welfare-option-checkbox" v-if="projectInfo.isCheckBox !== 'radio'">
<van-stepper
:key="'input-number-'+index+'-'+option.selectNumKey|| 0"
v-model="option.selectNum"
integer
disable-input
:default-value="0"
:min="0"
:disabled="isDeadlinePassed"
input-width="40px"
button-size="22px"
@change="selectNumChange(index,option.selectNum)"
theme="round"
></van-stepper>
</div>
</div>
</div>
</div>
@@ -894,6 +946,19 @@ layout("/layouts/platform_h5.html"){
},
methods: {
optionRankText(option) {
if (option.rankNo) {
return "此套餐在本次福利排行第" + option.rankNo + "名"
}
return "此套餐暂无排行数据"
},
optionBrief(option) {
const content = option.simpleDesc || option.description || option.supplier || ""
const div = document.createElement("div")
div.innerHTML = content
const text = (div.textContent || div.innerText || "").replace(/\s+/g, " ").trim()
return text || "暂无套餐详情"
},
selectNumChange(index, newValue) {
const option = this.projectInfo.options[index];
const maxSelect = this.projectInfo.multiSelectNum || this.projectInfo.options.length;
@@ -1221,8 +1286,6 @@ layout("/layouts/platform_h5.html"){
// 显示选项详情
showOptionDetail(option) {
// 阻止事件冒泡,避免触发父元素的点击事件
event.stopPropagation()
this.selectedOption = option
this.showOptionDetailDialog = true
},