diff --git a/project.private.config.json b/project.private.config.json
index 336503e..2816fb7 100644
--- a/project.private.config.json
+++ b/project.private.config.json
@@ -4,13 +4,20 @@
"miniprogram": {
"list": [
{
- "name": "我要反馈",
- "pathName": "pages/feedback/index",
+ "name": "搜索",
+ "pathName": "pages/search/index",
"query": "",
"scene": null,
"launchMode": "default"
},
{
+ "name": "我要反馈",
+ "pathName": "pages/feedback/index",
+ "query": "",
+ "launchMode": "default",
+ "scene": null
+ },
+ {
"name": "活动报名成功页",
"pathName": "pages/actResult/index",
"query": "id=59",
diff --git a/src/app.json b/src/app.json
index 1d72841..619ccca 100644
--- a/src/app.json
+++ b/src/app.json
@@ -12,6 +12,7 @@
"pages/actPoster/index",
"pages/actAdd/index",
"pages/actAddResult/index",
+ "pages/actQrcode/index",
"pages/noticeDetail/index",
"pages/login/index",
"pages/chat/index",
@@ -21,7 +22,8 @@
"pages/myAgent/index",
"pages/myComment/index",
"pages/schedule/index",
- "pages/feedback/index"
+ "pages/feedback/index",
+ "pages/search/index"
],
"window": {
"backgroundTextStyle": "light",
diff --git a/src/components/popup/index.scss b/src/components/popup/index.scss
index 9da7845..1e503af 100644
--- a/src/components/popup/index.scss
+++ b/src/components/popup/index.scss
@@ -28,6 +28,74 @@
}
}
+.popup2 {
+ .container {
+ padding: 231rpx 55rpx 55rpx;
+ background: linear-gradient(180deg, #e9f6ff 0%, #ffffff 32.53%, #ffffff 100%);
+ border-radius: 32rpx;
+ width: 590rpx;
+ height: 394rpx;
+ box-sizing: border-box;
+ .title {
+ font-size: 48rpx;
+ color: rgba(74, 184, 253, 1);
+ font-weight: bold;
+ text-align: center;
+ }
+ .content {
+ margin-top: 16rpx;
+ font-size: 32rpx;
+ color: rgba(17, 24, 39, 1);
+ text-align: center;
+ }
+ }
+}
+
+.popup3 {
+ .container {
+ padding: 293rpx 40rpx 0;
+ background: linear-gradient(180deg, #e9f6ff 0%, #ffffff 32.53%, #ffffff 100%);
+ border-radius: 32rpx;
+ width: 670rpx;
+ height: 732rpx;
+ box-sizing: border-box;
+ .title {
+ font-size: 40rpx;
+ color: rgba(17, 24, 39, 1);
+ font-weight: bold;
+ text-align: center;
+ }
+ .content {
+ margin-top: 16rpx;
+ font-size: 32rpx;
+ color: rgba(71, 85, 105, 1);
+ text-align: center;
+ }
+ .link {
+ margin-top: 38rpx;
+ padding: 23rpx;
+ text-align: center;
+ font-size: 36rpx;
+ color: rgba(71, 85, 105, 1);
+ background-color: rgba(247, 248, 250, 1);
+ border: 1px solid #fff;
+ border-radius: 16rpx;
+ }
+ .btn {
+ margin-top: 45rpx;
+ height: 96rpx;
+ font-size: 32rpx;
+ color: rgba(255, 255, 255, 1);
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ background: linear-gradient(90deg, #9ddffd 0%, #4ab8fd 100%);
+ box-shadow: 0rpx 15rpx 30rpx -6rpx rgba(74, 172, 219, 0.4);
+ border-radius: 16rpx 16rpx 16rpx 16rpx;
+ }
+ }
+}
+
.close {
margin: 32rpx auto 0;
display: block;
diff --git a/src/components/popup/index.ts b/src/components/popup/index.ts
index 1e69b34..303945b 100644
--- a/src/components/popup/index.ts
+++ b/src/components/popup/index.ts
@@ -21,145 +21,20 @@ Component({
observers: {
show(val) {
if (val) {
- if (this.data.type === 'TCenter') {
- this.setData({
- TCenterId: this.data.params.hospitalId,
- })
- }
- if (this.data.type === 'inhibitors') {
- this.setData({
- inhibitorsId: this.data.params.drugId || '',
- inhibitorsName: this.data.params.drugName || '',
- inhibitorsContent: this.data.params.content || '',
- })
- }
- if (this.data.type === 'publicCard') {
- this.getCodeImg()
- }
}
},
},
data: {
- popup1Check1: false,
-
- TCenterId: '',
-
- inhibitorsId: '',
- inhibitorsName: '',
- inhibitorsContent: '',
-
- selectDoctorId: '',
-
- codeImg: '',
-
imageUrl: app.globalData.imageUrl,
Timestamp: app.globalData.Timestamp,
},
methods: {
handleOk() {
- const { type, inhibitorsId, inhibitorsName, inhibitorsContent } = this.data
- if (type === 'argument' && !this.data.popup1Check1) {
- wx.showToast({
- title: '请同意隐私政策',
- icon: 'none',
- })
- return
- }
- if (type === 'TCenter') {
- if (!this.data.TCenterId) {
- wx.showToast({
- title: '请选择治疗中心',
- icon: 'none',
- })
- return
- }
- this.triggerEvent('ok', { id: this.data.TCenterId })
- return
- }
-
- if (type === 'inhibitors') {
- if (!inhibitorsId) {
- wx.showToast({
- title: '请选择抑制剂',
- icon: 'none',
- })
- return
- }
- if (inhibitorsName === '其他' && !inhibitorsContent) {
- wx.showToast({
- title: '请填写其他抑制剂',
- icon: 'none',
- })
- return
- }
-
- this.triggerEvent('ok', { id: inhibitorsId, name: inhibitorsName, content: inhibitorsContent })
- return
- }
-
- if (type === 'selectDoctor') {
- if (!this.data.selectDoctorId) {
- wx.showToast({
- title: '请选择医生',
- icon: 'none',
- })
- return
- }
- this.triggerEvent('ok', { id: this.data.selectDoctorId })
- return
- }
this.triggerEvent('ok')
},
handleCancel() {
this.triggerEvent('cancel')
},
- routerTo(e: any) {
- const { url } = e.currentTarget.dataset
- wx.navigateTo({
- url,
- })
- },
- handlePopup1Check1() {
- if (this.data.popup1Check1) {
- app.mpBehavior({ PageName: 'BTN_PATIENTPRIVACY' })
- }
- },
- handleSelectStatus(e) {
- const { status } = e.currentTarget.dataset
- this.triggerEvent('ok', { type: 'selectStatusComplete', status })
- },
- handleSelectTCenter(e) {
- const { id } = e.currentTarget.dataset
- this.setData({
- TCenterId: id,
- })
- },
- handleSelectDoctor(e) {
- const { id } = e.currentTarget.dataset
- this.setData({
- selectDoctorId: id,
- })
- },
- handleSelectInhibitors(e) {
- const { id, name } = e.currentTarget.dataset
- this.setData({
- inhibitorsId: id,
- inhibitorsName: name,
- })
- },
- getCodeImg() {
- wx.ajax({
- method: 'GET',
- url: '?r=wtx/common/get-channel-wx-code',
- data: {
- ChannelType: 2,
- },
- }).then((res) => {
- this.setData({
- codeImg: res,
- })
- })
- },
},
})
diff --git a/src/components/popup/index.wxml b/src/components/popup/index.wxml
index 7bcaea5..94bbf1c 100644
--- a/src/components/popup/index.wxml
+++ b/src/components/popup/index.wxml
@@ -16,6 +16,20 @@
活动即将开始,请有序进场
+
+
0
+ this.setData({ editId, isEdit })
+
+ // 设置导航栏标题
+ wx.setNavigationBarTitle({ title: isEdit ? '编辑活动' : '创建活动' })
+
try {
await Promise.all([this.fetchLevelList(), this.fetchCategoryList(), this.fetchTagList()])
} catch (err) {
console.error('初始化数据失败:', err)
}
- // 检查是否有本地草稿
+ // 编辑模式:从接口回显数据,忽略本地草稿
+ if (isEdit) {
+ await this.fetchActivityDetail(editId)
+ return
+ }
+
+ // 新建模式:检查是否有本地草稿
try {
const draft = wx.getStorageSync(DRAFT_KEY) as any
if (draft && Object.keys(draft).length) {
@@ -131,7 +150,6 @@ Page({
if (res.confirm) {
this.restoreDraft(draft)
} else {
- // 用户选择重新开始,清除草稿
this.clearDraft()
}
},
@@ -142,6 +160,102 @@ Page({
}
},
+ // 获取活动详情并回显到表单
+ async fetchActivityDetail(id: number) {
+ wx.showLoading({ title: '加载中...' })
+ try {
+ const res = await wx.ajax({
+ url: `/activity/detail?id=${id}`,
+ method: 'GET',
+ data: {},
+ })
+ if (!res) return
+
+ // 签到方式映射
+ const checkinWayMap: Record = { 1: 'dynamic', 2: 'fixed', 3: 'none' }
+
+ // 封面图片转为本地上传格式
+ const coverImageList = (res.mainImages || []).map((url: string, index: number) => ({
+ uid: `cover_${index}`,
+ url,
+ type: 'image',
+ name: url.split('/').pop() || '',
+ size: 0,
+ status: 'success',
+ progress: 100,
+ }))
+
+ // 议程数据
+ const agendas = (res.agendas || []).map((item: any, index: number) => ({
+ agendaTime: item.agendaTime || `${item.agendaDate || ''} ${item.agendaTime || ''}`,
+ title: item.title || '',
+ description: item.description || '',
+ sort: index,
+ }))
+
+ // 如果没有议程,提供一个空行
+ if (agendas.length === 0) {
+ agendas.push({ agendaTime: '', title: '', description: '', sort: 0 })
+ }
+
+ // 分类和标签
+ const selectedCategoryIds = res.categoryIds || []
+ const selectedTagIds = (res.tags || []).map((t: any) => typeof t === 'object' ? t.id : t)
+
+ // 报名设置
+ const needRegister = res.regType === 1
+ const registerLimit = res.quota > 0 ? 'limited' : 'unlimited'
+ const registerLimitCount = res.quota > 0 ? String(res.quota) : ''
+
+ this.setData({
+ coverImageList,
+ title: res.name || '',
+ type: res.type || 1,
+ typeOther: res.typeOther || '',
+ summary: res.summary || '',
+ startTime: res.startAt || '',
+ endTime: res.endAt || '',
+ detail: res.description || '',
+ detailImages: res.detailImages || [],
+ location: res.location || '',
+ organizer: res.organizer || '',
+ contactName: res.contactName || '',
+ contactPhone: res.contactPhone || '',
+ levelId: res.levelId || 0,
+ selectedCategoryIds,
+ selectedTagIds,
+ needRegister,
+ registerStartTime: res.regStartAt || '',
+ registerEndTime: res.regEndAt || '',
+ registerLimit,
+ registerLimitCount,
+ registerCondition: res.regCondition || '',
+ checkinWay: checkinWayMap[res.checkinType] || 'dynamic',
+ checkinStartTime: res.checkinStartTime || '',
+ checkinEndTime: res.checkinEndTime || '',
+ agendas,
+ })
+
+ // 重建标签选中状态
+ const categoryTags = (this.data.categoryList || []).map((item: ICategoryItem) => ({
+ id: item.id,
+ name: item.name,
+ isSelected: selectedCategoryIds.includes(item.id),
+ }))
+ const tagTags = (this.data.tagList || []).map((item: ITagItem) => ({
+ id: item.id,
+ name: item.name,
+ isSelected: selectedTagIds.includes(item.id),
+ }))
+ this.setData({ categoryTags, tagTags })
+ } catch (err) {
+ console.error('获取活动详情失败:', err)
+ wx.showToast({ title: '加载失败', icon: 'none' })
+ } finally {
+ wx.hideLoading()
+ }
+ },
+
// ========== 草稿管理 ==========
buildDraft(partial: Record = {}) {
const keys = [
@@ -229,7 +343,10 @@ Page({
setAndSave(patch: Record) {
this.setData(patch)
- this.saveDraft(patch)
+ // 编辑模式下不保存本地草稿缓存
+ if (!this.data.isEdit) {
+ this.saveDraft(patch)
+ }
},
// 获取活动等级列表
@@ -662,53 +779,57 @@ Page({
if (submitting) return
- // 校验必填字段
- if (!coverImageList.length) {
- wx.showToast({ title: '请上传活动头图', icon: 'error' })
- return
- }
- if (!title.trim()) {
- wx.showToast({ title: '请输入活动标题', icon: 'error' })
- return
- }
- if (!startTime) {
- wx.showToast({ title: '请选择活动开始时间', icon: 'error' })
- return
- }
- if (!endTime) {
- wx.showToast({ title: '请选择活动结束时间', icon: 'error' })
- return
- }
- if (!location.trim()) {
- wx.showToast({ title: '请输入活动地点', icon: 'error' })
- return
- }
-
- // 校验报名设置
- if (needRegister) {
- if (!registerStartTime) {
- wx.showToast({ title: '请选择报名开始时间', icon: 'error' })
+ // 草稿模式不做严格校验,仅提交已填内容
+ // 正式提交(activityStatus=2)才校验必填字段
+ if (activityStatus === 2) {
+ // 校验必填字段
+ if (!coverImageList.length) {
+ wx.showToast({ title: '请上传活动头图', icon: 'error' })
return
}
- if (!registerEndTime) {
- wx.showToast({ title: '请选择报名截止时间', icon: 'error' })
+ if (!title.trim()) {
+ wx.showToast({ title: '请输入活动标题', icon: 'error' })
return
}
- }
-
- // 校验签到设置
- if (checkinWay !== 'none') {
- if (!checkinStartTime) {
- wx.showToast({ title: '请选择签到开始时间', icon: 'error' })
+ if (!startTime) {
+ wx.showToast({ title: '请选择活动开始时间', icon: 'error' })
return
}
- if (!checkinEndTime) {
- wx.showToast({ title: '请选择签到结束时间', icon: 'error' })
+ if (!endTime) {
+ wx.showToast({ title: '请选择活动结束时间', icon: 'error' })
return
}
- }
+ if (!location.trim()) {
+ wx.showToast({ title: '请输入活动地点', icon: 'error' })
+ return
+ }
+
+ // 校验报名设置
+ if (needRegister) {
+ if (!registerStartTime) {
+ wx.showToast({ title: '请选择报名开始时间', icon: 'error' })
+ return
+ }
+ if (!registerEndTime) {
+ wx.showToast({ title: '请选择报名截止时间', icon: 'error' })
+ return
+ }
+ }
- // 议程可选,不做必填验证
+ // 校验签到设置
+ if (checkinWay !== 'none') {
+ if (!checkinStartTime) {
+ wx.showToast({ title: '请选择签到开始时间', icon: 'error' })
+ return
+ }
+ if (!checkinEndTime) {
+ wx.showToast({ title: '请选择签到结束时间', icon: 'error' })
+ return
+ }
+ }
+
+ // 议程可选,不做必填验证
+ }
this.setData({ submitting: true })
wx.showLoading({ title: activityStatus === 1 ? '保存中...' : '提交中...' })
@@ -757,6 +878,11 @@ Page({
activityStatus,
}
+ // 编辑模式传入 id,统一使用 /activity/apply 接口
+ if (this.data.isEdit) {
+ params.id = this.data.editId
+ }
+
const res = await wx.ajax({
url: '/activity/apply',
method: 'POST',
@@ -774,9 +900,10 @@ Page({
// 清理本地草稿
this.clearDraft()
- // 跳转到结果页面
+ // 跳转到结果页面(编辑模式使用 editId)
+ const activityId = this.data.isEdit ? this.data.editId : res.activityId
wx.redirectTo({
- url: `/pages/actAddResult/index?id=${res.activityId}&status=${res.status}`,
+ url: `/pages/actAddResult/index?id=${activityId}&status=${res.status || ''}`,
})
}
} catch (err: any) {
diff --git a/src/pages/actAdd/index.wxml b/src/pages/actAdd/index.wxml
index 1638a81..7fc1990 100644
--- a/src/pages/actAdd/index.wxml
+++ b/src/pages/actAdd/index.wxml
@@ -409,7 +409,7 @@
- 存草搞
+ 存草稿
上一步
下一步
@@ -490,7 +490,7 @@
- 存草搞
+ 存草稿
上一步
提交
diff --git a/src/pages/actAddResult/index.ts b/src/pages/actAddResult/index.ts
index 2a28e5a..35d8047 100644
--- a/src/pages/actAddResult/index.ts
+++ b/src/pages/actAddResult/index.ts
@@ -44,7 +44,7 @@ Page({
// 返回活动页
handleBack() {
wx.redirectTo({
- url: `/pages/actDetail/index?id=${this.data.activityId}`,
+ url: `/pages/act/index`,
})
},
})
diff --git a/src/pages/actDetail/index.ts b/src/pages/actDetail/index.ts
index f20b939..032fc20 100644
--- a/src/pages/actDetail/index.ts
+++ b/src/pages/actDetail/index.ts
@@ -126,13 +126,14 @@ Page({
agendaGroups: [] as Array<{ date: string; items: IActivityDetail['agendas'] }>,
},
- onLoad(options: { id?: string }) {
+ onLoad(options: { id?: string; anchor?: string }) {
const activityId = options.id ? Number(options.id) : 0
if (!activityId) {
wx.showToast({ title: '活动不存在', icon: 'error' })
setTimeout(() => wx.navigateBack(), 1500)
return
}
+ this._anchor = options.anchor || ''
this.setData({ activityId })
@@ -159,6 +160,20 @@ Page({
loading: false,
agendaGroups,
})
+
+ // 锚点滚动:anchor=comment 时滚动到精彩评论区域
+ if (this._anchor === 'comment') {
+ setTimeout(() => {
+ wx.createSelectorQuery()
+ .select('#comment-anchor')
+ .boundingClientRect((rect) => {
+ if (rect) {
+ wx.pageScrollTo({ scrollTop: rect.top, duration: 300 })
+ }
+ })
+ .exec()
+ }, 300) // 延迟等待渲染完成
+ }
}
} catch (err) {
console.error('获取活动详情失败:', err)
diff --git a/src/pages/actDetail/index.wxml b/src/pages/actDetail/index.wxml
index 3a189eb..e9f818b 100644
--- a/src/pages/actDetail/index.wxml
+++ b/src/pages/actDetail/index.wxml
@@ -82,14 +82,11 @@
-
diff --git a/src/pages/myComment/index.json b/src/pages/myComment/index.json
index fd56525..5e39e9a 100644
--- a/src/pages/myComment/index.json
+++ b/src/pages/myComment/index.json
@@ -5,6 +5,7 @@
"van-tab": "@vant/weapp/tab/index",
"van-tabs": "@vant/weapp/tabs/index",
"van-icon": "@vant/weapp/icon/index",
- "van-rate": "@vant/weapp/rate/index"
+ "van-rate": "@vant/weapp/rate/index",
+ "pagination": "/components/pagination/index"
}
}
diff --git a/src/pages/myComment/index.scss b/src/pages/myComment/index.scss
index 33762b1..b51040e 100644
--- a/src/pages/myComment/index.scss
+++ b/src/pages/myComment/index.scss
@@ -14,6 +14,7 @@ page {
.page0 {
padding: 43rpx 30rpx;
.card {
+ margin-bottom: 30rpx;
padding: 32rpx;
background-color: #fff;
border-radius: 24rpx;
@@ -48,10 +49,40 @@ page {
color: rgba(148, 163, 184, 1);
}
.options {
+ position: relative;
.icon {
width: 32rpx;
height: 32rpx;
}
+ .options-wrap {
+ position: absolute;
+ z-index: 10;
+ bottom: -14rpx;
+ right: -24rpx;
+ background-color: #fff;
+ transform: translateY(100%);
+ border-radius: 8rpx;
+ filter: drop-shadow(10rpx 10rpx 10rpx rgba(148, 163, 184, 0.09));
+ .o-item {
+ display: flex;
+ align-items: center;
+ flex-wrap: nowrap;
+ gap: 20rpx;
+ padding: 28rpx;
+ white-space: nowrap;
+ }
+ &::before {
+ position: absolute;
+ right: 24rpx;
+ top: -20rpx;
+ content: '';
+ width: 0;
+ height: 0;
+ border-style: solid;
+ border-width: 0 24rpx 24rpx 24rpx;
+ border-color: transparent transparent #fff transparent;
+ }
+ }
}
}
}
diff --git a/src/pages/myComment/index.ts b/src/pages/myComment/index.ts
index 067b6bb..80cbe3f 100644
--- a/src/pages/myComment/index.ts
+++ b/src/pages/myComment/index.ts
@@ -1,8 +1,171 @@
-const _app = getApp();
+const app = getApp()
Page({
- data: {},
- onLoad() {},
-});
+ data: {
+ active: 0,
+
+ // 当前展开的操作菜单索引及类型
+ showOptionsKey: '',
+
+ // 活动评论列表
+ activityList: [] as any[],
+ activityPagination: { count: 0, page: 1, pages: 0, pageSize: 20 },
+ activityLoading: false,
+
+ // 智能体评论列表
+ agentList: [] as any[],
+ agentPagination: { count: 0, page: 1, pages: 0, pageSize: 20 },
+ agentLoading: false,
+ },
+
+ onLoad() {
+ app.waitLogin({ type: 1 }).then(() => {
+ this.fetchList('activity', true)
+ })
+ },
+
+ // Tab切换
+ onChange(e: WechatMiniprogram.CustomEvent) {
+ const active = e.detail.index ?? e.detail.name
+ this.setData({ active })
+
+ const type = active === 0 ? 'activity' : 'agent'
+ const list = active === 0 ? this.data.activityList : this.data.agentList
+ // 只有列表为空时才加载
+ if (!list.length) {
+ this.fetchList(type, true)
+ }
+ },
+
+ // 获取评论列表
+ async fetchList(type: string, isRefresh = false) {
+ const key = type === 'activity' ? 'activity' : 'agent'
+ const loadingKey = `${key}Loading`
+ const paginationKey = `${key}Pagination`
+
+ if (this.data[loadingKey]) return
+
+ const pagination = this.data[paginationKey]
+ const page = isRefresh ? 1 : pagination.page
+
+ this.setData({ [loadingKey]: true })
+
+ try {
+ const res = await wx.ajax({
+ url: '/me/my-reviews',
+ method: 'GET',
+ data: { page, pageSize: pagination.pageSize, type },
+ })
+
+ if (res) {
+ const newList = isRefresh ? res.list : [...this.data[`${key}List`], ...res.list]
+ this.setData({
+ [`${key}List`]: newList,
+ [paginationKey]: {
+ count: res.pagination?.total || 0,
+ page: res.pagination?.page || page,
+ pages: res.pagination?.totalPages || 0,
+ pageSize: res.pagination?.pageSize || pagination.pageSize,
+ },
+ })
+ }
+ } catch (err) {
+ console.error('获取评论列表失败:', err)
+ } finally {
+ this.setData({ [loadingKey]: false })
+ }
+ },
+
+ // 触底加载更多
+ onReachBottom() {
+ const { active, activityPagination, agentPagination, activityLoading, agentLoading } = this.data
+ const type = active === 0 ? 'activity' : 'agent'
+ const pagination = active === 0 ? activityPagination : agentPagination
+ const loading = active === 0 ? activityLoading : agentLoading
+
+ if (loading) return
+ if (pagination.page >= pagination.pages) return
+
+ // 先递增page
+ const key = active === 0 ? 'activityPagination' : 'agentPagination'
+ this.setData({ [`${key}.page`]: pagination.page + 1 })
+ this.fetchList(type)
+ },
+
+ // 点击options图标,显示/隐藏操作菜单
+ handleToggleOptions(e: WechatMiniprogram.TouchEvent) {
+ const { key } = e.currentTarget.dataset
+ this.setData({ showOptionsKey: this.data.showOptionsKey === key ? '' : key })
+ },
+
+ // 关闭操作菜单
+ handleCloseOptions() {
+ this.setData({ showOptionsKey: '' })
+ },
+
+ // 匿名→公开切换
+ async handleSetPublic(e: WechatMiniprogram.TouchEvent) {
+ const { id, index, type } = e.currentTarget.dataset
+ const { active } = this.data
+
+ try {
+ const res = await wx.ajax({
+ url: `/me/set-comment-public`,
+ method: 'POST',
+ data: { id },
+ })
+
+ if (res) {
+ wx.showToast({ title: '已公开', icon: 'success' })
+ const listKey = active === 0 ? 'activityList' : 'agentList'
+ const list = this.data[listKey] as any[]
+ list[index].isAnonymous = false
+ this.setData({ [listKey]: list })
+ }
+ } catch (err: any) {
+ const message = err?.message || '操作失败'
+ wx.showToast({ title: message, icon: 'error' })
+ }
+ },
+
+ // 删除评价
+ async handleDelete(e: WechatMiniprogram.TouchEvent) {
+ const { id, index } = e.currentTarget.dataset
+ const { active } = this.data
+
+ const confirmRes = await wx.showModal({
+ title: '确认删除',
+ content: '删除后不可恢复,是否确认删除?',
+ })
+ if (!confirmRes.confirm) return
+
+ try {
+ const res = await wx.ajax({
+ url: `/me/delete-comment`,
+ method: 'POST',
+ data: { id },
+ })
+
+ if (res) {
+ wx.showToast({ title: '已删除', icon: 'success' })
+ const listKey = active === 0 ? 'activityList' : 'agentList'
+ const list = this.data[listKey] as any[]
+ list.splice(index, 1)
+ this.setData({ [listKey]: list })
+ }
+ } catch (err: any) {
+ const message = err?.message || '删除失败'
+ wx.showToast({ title: message, icon: 'error' })
+ }
+ },
+
+ // 跳转活动详情
+ handleGoDetail(e: WechatMiniprogram.TouchEvent) {
+ const { targetid, anchor } = e.currentTarget.dataset
+ wx.navigateTo({
+ url: `/pages/actDetail/index?id=${targetid}&anchor=${anchor || ''}`,
+ })
+ },
+})
export {}
diff --git a/src/pages/myComment/index.wxml b/src/pages/myComment/index.wxml
index cc7d98a..c4c43ec 100644
--- a/src/pages/myComment/index.wxml
+++ b/src/pages/myComment/index.wxml
@@ -1,4 +1,4 @@
-
+
+
-
+
+
+
+
+
+
+
+
+
+ {{item.createdAt}}
+
+
+ {{item.rating}}
+
-
-
-
+ {{item.content}}
+
+
+
-
+
- 深职大第十五届校园歌手大赛
- 2026年5月30日 19:00
+ {{item.targetTitle}}
+ {{item.targetDate}}
-
+
+
- 内容已提交,正在审核中,预计1-2个工作日内完成审核。
+ {{item.statusMessage}}
-
+
+
- 驳回原因:内容中包含不当言论,请修改后重新提交。
+ {{item.statusMessage}}
+
+
- 内容 2
diff --git a/src/pages/notice/index.scss b/src/pages/notice/index.scss
index f883f8a..629dbad 100644
--- a/src/pages/notice/index.scss
+++ b/src/pages/notice/index.scss
@@ -3,6 +3,7 @@ page {
}
.page {
+ padding-bottom: calc(env(safe-area-inset-bottom) + 120rpx);
.tabs {
.van-tabs__line {
width: 32rpx !important;
@@ -49,7 +50,7 @@ page {
border-top: 1px solid rgba(235, 235, 235, 1);
display: flex;
align-items: center;
- justify-content: space-between;
+ justify-content: flex-end;
.tag {
font-size: 24rpx;
color: rgba(74, 184, 253, 1);
@@ -90,6 +91,7 @@ page {
font-size: 28rpx;
color: rgba(100, 116, 139, 1);
line-height: 44rpx;
+ white-space: pre-line;
}
.c-footer {
margin-top: 30rpx;
@@ -100,23 +102,24 @@ page {
font-size: 24rpx;
padding: 4rpx 16rpx;
border-radius: 6rpx;
- &.tag1 {
+ &.approved {
color: rgba(111, 220, 174, 1);
background-color: rgba(111, 220, 174, 0.1);
}
- &.tag2 {
+ &.rejected {
color: rgba(253, 91, 89, 1);
background-color: rgba(253, 91, 89, 0.1);
}
- &.tag3 {
+ &.registered {
color: rgba(74, 184, 253, 1);
background-color: rgba(74, 184, 253, 0.1);
}
- &.tag4 {
+ &.checked_in {
color: rgba(254, 181, 74, 1);
background-color: rgba(254, 181, 74, 0.1);
}
- &.tag5 {
+ &.review_approved,
+ &.review_rejected {
color: rgba(171, 89, 248, 1);
background-color: rgba(171, 89, 248, 0.1);
}
diff --git a/src/pages/notice/index.ts b/src/pages/notice/index.ts
index 58a6c9e..63c8d70 100644
--- a/src/pages/notice/index.ts
+++ b/src/pages/notice/index.ts
@@ -64,6 +64,7 @@ Page({
onLoad() {
app.waitLogin({ type: 1 }).then(() => {
+ this.clearNotice('announcement')
this.fetchAnnouncementList()
})
},
@@ -76,16 +77,37 @@ Page({
}
},
+ // 自动清空当前tab类型的通知(进入列表时即清空)
+ async clearNotice(type: string) {
+ try {
+ await wx.ajax({
+ url: '/notification/mark-read-by-type',
+ method: 'POST',
+ data: { type },
+ })
+ // 刷新 tabbar 红点
+ const tabBar = this.getTabBar()
+ if (tabBar && typeof tabBar.fetchUnreadCount === 'function') {
+ tabBar.fetchUnreadCount()
+ }
+ } catch (err) {
+ console.error('清空通知失败:', err)
+ }
+ },
+
// 切换 tab
onChange(e: WechatMiniprogram.CustomEvent) {
const active = e.detail.index ?? 0
this.setData({ active })
if (active === 0 && this.data.announcementList.length === 0) {
+ this.clearNotice('announcement')
this.fetchAnnouncementList()
} else if (active === 1 && this.data.importantList.length === 0) {
+ this.clearNotice('important')
this.fetchNoticeList('important')
} else if (active === 2 && this.data.activityList.length === 0) {
+ this.clearNotice('activity')
this.fetchNoticeList('activity')
}
},
@@ -179,6 +201,14 @@ Page({
url: `/pages/noticeDetail/index?taskId=${taskId}&type=notice`,
})
},
+ handleActNotice(e) {
+ const { index } = e.currentTarget.dataset
+ const { activityList } = this.data
+ const { jumpTarget } = activityList[index]
+ wx.navigateTo({
+ url: `/pages/actDetail/index?id=${jumpTarget}`,
+ })
+ },
// 下拉刷新
onPullDownRefresh() {
@@ -222,4 +252,4 @@ Page({
},
})
-export {}
\ No newline at end of file
+export {}
diff --git a/src/pages/notice/index.wxml b/src/pages/notice/index.wxml
index d94dc5b..b96dad2 100644
--- a/src/pages/notice/index.wxml
+++ b/src/pages/notice/index.wxml
@@ -6,6 +6,7 @@
title-active-color="rgba(74, 184, 253, 1)"
active="{{ active }}"
bind:change="onChange"
+ sticky
>
@@ -22,7 +23,6 @@
{{item.title}}