Merge remote-tracking branch 'origin/main'

This commit is contained in:
@jyuhsin
2025-09-25 21:34:42 +08:00
59 changed files with 2492 additions and 412 deletions
@@ -8,6 +8,8 @@ layout("/layouts/platform_h5.html"){
}
.list-card-body {
/* width: calc(100% - 140px);
display: flex;*/
width: calc(100% - 140px);
display: flex;
flex-direction: column;
@@ -35,6 +37,9 @@ layout("/layouts/platform_h5.html"){
padding: 5px;
border-radius: 5px;
}
.list-card-img img{
width: 100%;
}
</style>
<div id="app" v-cloak>
@@ -44,6 +49,7 @@ layout("/layouts/platform_h5.html"){
<year-van-dropdown-item :num="5" @change="doSearch" v-model="pageForm.year"></year-van-dropdown-item>
<van-dropdown-item :options="stateList" @change="doSearch" v-model="pageForm.state"></van-dropdown-item>
<van-dropdown-item :options="isEnrolledOptions" @change="doSearch" v-model="pageForm.isEnrolledText"></van-dropdown-item>
<van-dropdown-item :options="activityTypeOptions" @change="doSearch" v-model="pageForm.activity_type"></van-dropdown-item>
</van-dropdown-menu>
</van-sticky>
@@ -58,33 +64,33 @@ layout("/layouts/platform_h5.html"){
<div class="time">{{item.startTime + ' 至 ' + item.endTime}}</div>
<div class="footer">
<span
class="tag"
v-if="$moment(item.applyStartTime).valueOf() > $moment().valueOf()"
style="color: var(--color-primary); border: 1px solid var(--color-primary)"
class="tag"
v-if="$moment(item.applyStartTime).valueOf() > $moment().valueOf()"
style="color: var(--color-primary); border: 1px solid var(--color-primary)"
>
未开始报名
</span>
<span
class="tag"
v-else-if="$moment(item.applyEndTime).valueOf() > $moment().valueOf() && $moment().valueOf() > $moment(item.applyStartTime).valueOf()"
style="color: var(--color-primary); border: 1px solid var(--color-primary)"
class="tag"
v-else-if="$moment(item.applyEndTime).valueOf() > $moment().valueOf() && $moment().valueOf() > $moment(item.applyStartTime).valueOf()"
style="color: var(--color-primary); border: 1px solid var(--color-primary)"
>
报名进行中
</span>
<span
class="tag"
v-else-if="$moment(item.applyEndTime).valueOf() < $moment().valueOf() && $moment().valueOf() < $moment(item.startTime).valueOf()"
style="color: var(--color-primary); border: 1px solid var(--color-primary)"
class="tag"
v-else-if="$moment(item.applyEndTime).valueOf() < $moment().valueOf() && $moment().valueOf() < $moment(item.startTime).valueOf()"
style="color: var(--color-primary); border: 1px solid var(--color-primary)"
>
报名已结束
</span>
<span
class="tag"
v-else-if="$moment(item.startTime).valueOf() < $moment().valueOf() && $moment().valueOf() < $moment(item.endTime).valueOf()"
style="color: var(--color-primary); border: 1px solid var(--color-primary)"
class="tag"
v-else-if="$moment(item.startTime).valueOf() < $moment().valueOf() && $moment().valueOf() < $moment(item.endTime).valueOf()"
style="color: var(--color-primary); border: 1px solid var(--color-primary)"
>
活动进行中
</span>
@@ -120,7 +126,8 @@ layout("/layouts/platform_h5.html"){
year: new Date().getFullYear(),
pageNumber: 1,
pageSize: 5,
totalCount: 0
totalCount: 0,
activity_type: 40001
},
yearList: [],
isEnrolledOptions: [
@@ -134,7 +141,12 @@ layout("/layouts/platform_h5.html"){
],
subLoading: false,
viewShow: false,
viewData: {}
viewData: {},
activityTypeOptions: [
{ value: 40001, text: "校文化活动" },
{ value: 40002, text: "分工会文化活动" },
{ value: 40003, text: "协会文化活动" },
]
}
},
components: {
@@ -270,3 +282,4 @@ layout("/layouts/platform_h5.html"){
<!--#
}
#-->
@@ -74,11 +74,7 @@ layout("/layouts/platform_h5.html"){
}, 500)
},
back() {
if (this.projectId) {
this.$pjaxReplace("/platform/h5/welfare/userChoose/index?id=" + this.projectId)
} else {
this.$pjaxReplace("/platform/h5/home")
}
this.historyBack()
},
onEdit(row) {
this.title = "编辑地址"
@@ -56,6 +56,10 @@ const selectView = {
<div class="info-row__label">联系电话</div>
<div class="info-row__value">{{ mergedSelections[0]?.mobile || '暂无' }}</div>
</div>
<div class="info-row">
<div class="info-row__label">收货地址</div>
<div class="info-row__value">{{ mergedSelections[0]?.receiveAddress || '暂无' }}</div>
</div>
</div>
</div>
@@ -73,7 +77,7 @@ const selectView = {
:key="item.id"
@click="showOptionDetail(item)">
<div class="selection-item__image">
<img :src="item.imgUrl || '/static/images/default-welfare.png'"
<img :src="item.imgUrl"
alt="福利图片"
@error="handleImageError">
</div>
@@ -678,18 +678,17 @@ layout("/layouts/platform_h5.html"){
maxlength="11"
required
></van-field>
<!--
收货地址字段预留位置
<!--收货地址-->
<van-field
v-if="projectInfo.needAddress"
v-model="formData.address"
v-if="projectInfo.provideMode == 3"
v-model="formData.receiveAddress"
label="收货地址"
placeholder="请输入收货地址"
type="textarea"
rows="2"
placeholder="请选择收货地址"
readonly
is-link
@click="showAddressSheet = true"
required
></van-field>
-->
></van-field>
</div>
<!-- 选择内容 -->
@@ -733,6 +732,35 @@ layout("/layouts/platform_h5.html"){
<div class="welfare-detail-content" v-html="selectedOption.description"></div>
</div>
</van-popup>
<!-- 收货地址选择弹窗 -->
<van-action-sheet v-model="showAddressSheet" title="选择收货地址" :round="true">
<div style="padding: 16px 0 0">
<div
v-for="address in addressOptions"
:key="address.id"
class="address-item"
@click="selectAddress(address)"
style="padding: 12px 16px; border-bottom: 1px solid #f0f0f0; cursor: pointer"
>
<div style="display: flex; justify-content: space-between; align-items: flex-start">
<div style="flex: 1">
<div style="font-size: 16px; font-weight: 500; color: #323233; margin-bottom: 4px">
{{ address.userName }} {{ address.tel }}
</div>
<div style="font-size: 14px; color: #646566; line-height: 1.4">
{{ address.province }}{{ address.city }}{{ address.county }}{{ address.addressDetail }}
</div>
</div>
<van-tag v-if="address.isDefault" type="primary" size="mini" style="margin-left: 8px">默认</van-tag>
</div>
</div>
<div v-if="addressOptions.length === 0" style="text-align: center; padding: 40px 16px; color: #969799">暂无收货地址</div>
</div>
<div style="padding: 16px; border-top: 1px solid #f0f0f0; background: #fafafa">
<van-button type="info" block round @click="goToAddressManage">收货地址管理</van-button>
</div>
</van-action-sheet>
</div>
</div>
@@ -757,8 +785,12 @@ layout("/layouts/platform_h5.html"){
formData: {
userSign: "", // 用户签名
mobile: "", // 手机号码
address: "" // 收货地址(预留)
}
address: "" // 收货地址
},
addressOptions: [],
showAddressSheet: false, // 收货地址选择弹窗
selectedAddressText: "" // 选中的收货地址显示文本
}
},
@@ -815,6 +847,11 @@ layout("/layouts/platform_h5.html"){
if (res.code === 0) {
this.projectInfo = res.data
// 获取收货地址
if (this.projectInfo.provideMode === 3) {
this.getAddress()
}
// 初始化选项的selectNum为0
if (this.projectInfo.options) {
this.projectInfo.options.forEach((option) => {
@@ -846,10 +883,16 @@ layout("/layouts/platform_h5.html"){
}
} else if (this.$store.user && this.$store.user.mobile) {
// 如果没有选择过,使用store中的默认手机号
debugger
this.formData.mobile = this.$store.user.mobile
}
// 地址回显
if (this.projectInfo.provideMode === 3) {
if (this.userSelection && this.userSelection[0].receiveAddress) {
this.formData.receiveAddress = this.userSelection[0].receiveAddress
}
}
// 设置已选择的选项
if (this.projectInfo.options && this.userSelection.length > 0) {
// 单选模式
@@ -898,6 +941,12 @@ layout("/layouts/platform_h5.html"){
return
}
// 如果需要邮寄
if (this.projectInfo.provideMode === 3 && !this.formData.receiveAddress) {
this.$toast.fail("请填写邮寄地址")
return
}
if (this.isSubmitting) return
this.isSubmitting = true
@@ -937,10 +986,10 @@ layout("/layouts/platform_h5.html"){
})
}
// 未来可扩展添加收货地址
if (this.formData.address) {
// 收货地址
if (this.projectInfo.provideMode === 3 && this.formData.receiveAddress) {
selections.forEach((selection) => {
selection.address = this.formData.address
selection.receiveAddress = this.formData.receiveAddress
})
}
@@ -1082,6 +1131,18 @@ layout("/layouts/platform_h5.html"){
}
},
// 选择收货地址
selectAddress(address) {
this.formData.receiveAddress =
address.userName + " " + address.tel + " " + address.province + address.city + address.county + address.addressDetail
this.showAddressSheet = false
},
// 跳转到地址管理页面
goToAddressManage() {
this.$pjaxReplace("/platform/h5/welfare/address/list")
},
// 切换选项选中状态
toggleOption(option) {
if (this.projectInfo.isCheckBox === "radio") {
@@ -1120,6 +1181,14 @@ layout("/layouts/platform_h5.html"){
}
}
}
},
// 获取收货地址
async getAddress() {
const resp = await this.$axios.post("/platform/welfare/addressManage/selectUserAddress")
if (resp.code === 0) {
this.addressOptions = resp.data
}
}
},