Browse Source

活动联调

master
kola-web 1 week ago
parent
commit
cd433b40a8
  1. 11
      project.private.config.json
  2. 4
      src/app.json
  3. 68
      src/components/popup/index.scss
  4. 125
      src/components/popup/index.ts
  5. 14
      src/components/popup/index.wxml
  6. BIN
      src/images/bg10.png
  7. BIN
      src/images/bg8.png
  8. BIN
      src/images/bg9.png
  9. BIN
      src/images/icon92.png
  10. BIN
      src/images/icon93.png
  11. BIN
      src/images/icon94.png
  12. BIN
      src/images/icon95.png
  13. 215
      src/pages/actAdd/index.ts
  14. 4
      src/pages/actAdd/index.wxml
  15. 2
      src/pages/actAddResult/index.ts
  16. 17
      src/pages/actDetail/index.ts
  17. 10
      src/pages/actDetail/index.wxml
  18. 6
      src/pages/actQrcode/index.json
  19. 72
      src/pages/actQrcode/index.scss
  20. 49
      src/pages/actQrcode/index.ts
  21. 19
      src/pages/actQrcode/index.wxml
  22. 3
      src/pages/agent/index.json
  23. 18
      src/pages/agent/index.scss
  24. 42
      src/pages/agent/index.ts
  25. 12
      src/pages/agent/index.wxml
  26. 5
      src/pages/feedback/index.json
  27. 90
      src/pages/feedback/index.scss
  28. 94
      src/pages/feedback/index.ts
  29. 45
      src/pages/feedback/index.wxml
  30. 185
      src/pages/index/index.ts
  31. 10
      src/pages/index/index.wxml
  32. 1
      src/pages/my/index.scss
  33. 77
      src/pages/my/index.ts
  34. 12
      src/pages/my/index.wxml
  35. 31
      src/pages/myAct/index.scss
  36. 6
      src/pages/myAct/index.ts
  37. 76
      src/pages/myAct/index.wxml
  38. 3
      src/pages/myComment/index.json
  39. 31
      src/pages/myComment/index.scss
  40. 171
      src/pages/myComment/index.ts
  41. 115
      src/pages/myComment/index.wxml
  42. 15
      src/pages/notice/index.scss
  43. 30
      src/pages/notice/index.ts
  44. 15
      src/pages/notice/index.wxml
  45. 1
      src/pages/noticeDetail/index.scss
  46. 10
      src/pages/noticeDetail/index.ts
  47. 4
      src/pages/noticeDetail/index.wxml
  48. 5
      src/pages/search/index.json
  49. 3
      src/pages/search/index.scss
  50. 8
      src/pages/search/index.ts
  51. 0
      src/pages/search/index.wxml
  52. 3
      src/pages/webview/index.json
  53. 0
      src/pages/webview/index.scss
  54. 16
      src/pages/webview/index.ts
  55. 1
      src/pages/webview/index.wxml

11
project.private.config.json

@ -4,13 +4,20 @@ @@ -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",

4
src/app.json

@ -12,6 +12,7 @@ @@ -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 @@ @@ -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",

68
src/components/popup/index.scss

@ -28,6 +28,74 @@ @@ -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;

125
src/components/popup/index.ts

@ -21,145 +21,20 @@ Component({ @@ -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,
})
})
},
},
})

14
src/components/popup/index.wxml

@ -16,6 +16,20 @@ @@ -16,6 +16,20 @@
<view class="content">活动即将开始,请有序进场</view>
</view>
</view>
<view class="popup2" wx:if="{{type==='popup2'}}">
<view class="container" style="background: url('/images/bg8.png') no-repeat top center/100%">
<view class="title">提交成功</view>
<view class="content">感谢您的反馈,我们会尽快处理</view>
</view>
</view>
<view class="popup3" wx:if="{{type==='popup3'}}">
<view class="container" style="background: url('/images/bg10.png') no-repeat top center/100%">
<view class="title">创建您专属智能体</view>
<view class="content">请登陆电脑端创建您的专属智能体</view>
<view class="link">www.tencent.yuanqi.com</view>
<view class="btn" bind:tap="handleOk">复制</view>
</view>
</view>
<image
wx:if="{{params.close}}"

BIN
src/images/bg10.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 MiB

BIN
src/images/bg8.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 563 KiB

BIN
src/images/bg9.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 MiB

BIN
src/images/icon92.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
src/images/icon93.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 542 B

BIN
src/images/icon94.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

BIN
src/images/icon95.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 768 B

215
src/pages/actAdd/index.ts

@ -108,17 +108,36 @@ Page({ @@ -108,17 +108,36 @@ Page({
// 提交状态
submitting: false,
// 编辑模式:传入的活动ID
editId: 0,
isEdit: false,
},
async onLoad() {
async onLoad(options: any) {
await app.waitLogin({ type: 1 })
// 判断是否为编辑模式
const editId = options?.id ? Number(options.id) : 0
const isEdit = editId > 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({ @@ -131,7 +150,6 @@ Page({
if (res.confirm) {
this.restoreDraft(draft)
} else {
// 用户选择重新开始,清除草稿
this.clearDraft()
}
},
@ -142,6 +160,102 @@ Page({ @@ -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<number, string> = { 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<string, any> = {}) {
const keys = [
@ -229,7 +343,10 @@ Page({ @@ -229,7 +343,10 @@ Page({
setAndSave(patch: Record<string, any>) {
this.setData(patch)
this.saveDraft(patch)
// 编辑模式下不保存本地草稿缓存
if (!this.data.isEdit) {
this.saveDraft(patch)
}
},
// 获取活动等级列表
@ -662,53 +779,57 @@ Page({ @@ -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({ @@ -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({ @@ -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) {

4
src/pages/actAdd/index.wxml

@ -409,7 +409,7 @@ @@ -409,7 +409,7 @@
</scroll-view>
<view class="action-bar action-bar--multi">
<view class="btn btn-default" bindtap="onPrevStep">存草搞</view>
<view class="btn btn-default" bindtap="onSaveDraft">存草稿</view>
<view class="btn btn-default" bindtap="onPrevStep">上一步</view>
<view class="btn btn-primary" bindtap="onNextStep">下一步</view>
</view>
@ -490,7 +490,7 @@ @@ -490,7 +490,7 @@
</scroll-view>
<view class="action-bar action-bar--multi">
<view class="btn btn-default" bindtap="onPrevStep">存草搞</view>
<view class="btn btn-default" bindtap="onSaveDraft">存草稿</view>
<view class="btn btn-default" bindtap="onPrevStep">上一步</view>
<view class="btn btn-primary" bindtap="onSubmit">提交</view>
</view>

2
src/pages/actAddResult/index.ts

@ -44,7 +44,7 @@ Page({ @@ -44,7 +44,7 @@ Page({
// 返回活动页
handleBack() {
wx.redirectTo({
url: `/pages/actDetail/index?id=${this.data.activityId}`,
url: `/pages/act/index`,
})
},
})

17
src/pages/actDetail/index.ts

@ -126,13 +126,14 @@ Page({ @@ -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({ @@ -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)

10
src/pages/actDetail/index.wxml

@ -82,14 +82,11 @@ @@ -82,14 +82,11 @@
</view>
<!-- 精彩评论 -->
<view class="comment-list" wx:if="{{detail.commentCount>0}}">
<view id="comment-anchor" class="comment-list" wx:if="{{detail.commentCount>0}}">
<view class="c-title">精彩评论 ({{detail.commentCount}}条)</view>
<view class="c-card" wx:for="{{reviewList}}" wx:key="id">
<view class="user">
<image
class="avatar"
src="{{item.avatarUrl}}"
></image>
<image class="avatar" src="{{item.avatarUrl}}"></image>
<view class="wrap">
<view class="name">{{item.isAnonymous ? '匿名用户' : item.nickname}}</view>
<view class="rate">
@ -122,7 +119,8 @@ @@ -122,7 +119,8 @@
</view>
<!-- 底部操作栏 -->
<view class="footer">
<!-- 审核没通过的活动不应该展示 -->
<view class="footer" wx:if="{{detail.activityStatus!=4}}">
<van-count-down
use-slot
wx:if="{{countdownSeconds}}"

6
src/pages/actQrcode/index.json

@ -0,0 +1,6 @@ @@ -0,0 +1,6 @@
{
"navigationBarTitleText": "活动签到",
"usingComponents": {
"van-icon": "@vant/weapp/icon/index"
}
}

72
src/pages/actQrcode/index.scss

@ -0,0 +1,72 @@ @@ -0,0 +1,72 @@
page {
background: linear-gradient(180deg, #ffffff 40%, #4ab8fd 64.24%, #aadeff 100%);
}
.page-title {
font-size: 32rpx;
color: #fff;
}
.page-back {
font-size: 32rpx;
color: #fff;
}
.page {
padding: 256rpx 0 0;
min-height: 100vh;
box-sizing: border-box;
.page-title {
font-size: 44rpx;
color: rgba(17, 24, 39, 1);
font-weight: bold;
text-align: center;
line-height: 46rpx;
height: 138rpx;
}
.title {
margin-top: 112rpx;
text-align: center;
font-weight: bold;
font-size: 40rpx;
color: rgba(17, 24, 39, 1);
line-height: 52rpx;
}
.content {
margin-top: 16rpx;
font-size: 32rpx;
color: rgba(71, 85, 105, 1);
text-align: center;
.high {
color: rgba(74, 184, 253, 1);
}
}
.code {
margin: 80rpx auto 0;
display: block;
width: 365rpx;
height: 365rpx;
}
.btn {
margin: 78rpx auto 0;
width: 333rpx;
height: 68rpx;
background: #ffffff;
font-size: 28rpx;
display: flex;
align-items: center;
justify-content: center;
gap: 12rpx;
color: rgba(74, 184, 253, 1);
border-radius: 75rpx 75rpx 75rpx 75rpx;
border: 2rpx solid rgba(74, 184, 253, 0.2);
.icon {
width: 38rpx;
height: 38rpx;
}
}
.date {
margin: 80rpx 80rpx 0;
font-size: 32rpx;
color: rgba(255, 255, 255, 1);
text-align: center;
}
}

49
src/pages/actQrcode/index.ts

@ -0,0 +1,49 @@ @@ -0,0 +1,49 @@
const app = getApp<IAppOption>()
Page({
data: {
id: '',
qrcodeUrl: '',
detail: {},
},
onLoad(options) {
this.setData({
id: options.id,
})
app.waitLogin({ type: 1 }).then(() => {
this.getQrCode()
this.getDetail()
})
},
getDetail() {
wx.ajax({
method: 'GET',
url: '/activity/detail',
data: {
id: this.data.id,
},
}).then((res) => {
this.setData({
detail: res,
})
})
},
getQrCode() {
wx.ajax({
method: 'GET',
url: '/activity/checkin-qrcode',
data: {
activityId: this.data.id,
},
}).then((res) => {
this.setData({
codeUrl: res.qrcodeUrl,
})
})
},
handleBack() {
wx.navigateBack()
},
})
export {}

19
src/pages/actQrcode/index.wxml

@ -0,0 +1,19 @@ @@ -0,0 +1,19 @@
<navbar fixed customStyle="background:{{background}};">
<van-icon class="page-back" name="arrow-left" slot="left" bind:tap="handleBack" />
<view class="page-title" slot="title"></view>
</navbar>
<view class="page" style="background: url('/images/bg9.png') no-repeat top center/100% 1627rpx">
<view class="page-title">{{detail.name}}</view>
<view class="title">活动签到</view>
<view class="content">
请使用
<text class="high">微信</text>
扫一扫进行签到
</view>
<image class="code" src="{{codeUrl}}"></image>
<view class="btn">
<image class="icon" src="/images/icon92.png"></image>
长按保存二维码
</view>
<view class="date">签到时间: {{detail.checkinStartTime}}</view>
</view>

3
src/pages/agent/index.json

@ -4,6 +4,7 @@ @@ -4,6 +4,7 @@
"usingComponents": {
"van-icon": "@vant/weapp/icon/index",
"van-tab": "@vant/weapp/tab/index",
"van-tabs": "@vant/weapp/tabs/index"
"van-tabs": "@vant/weapp/tabs/index",
"popup": "/components/popup/index"
}
}

18
src/pages/agent/index.scss

@ -248,3 +248,21 @@ page { @@ -248,3 +248,21 @@ page {
}
}
}
.fixed-add {
position: fixed;
right: 16rpx;
bottom: 320rpx;
width: 110rpx;
height: 110rpx;
background: linear-gradient(90deg, #9ddffd 0%, #4ab8fd 100%);
box-shadow: 0rpx 15rpx 30rpx -6rpx rgba(74, 172, 219, 0.4);
display: flex;
align-items: center;
justify-content: center;
border-radius: 50%;
.icon{
width: 54rpx;
height: 54rpx;
}
}

42
src/pages/agent/index.ts

@ -1,13 +1,53 @@ @@ -1,13 +1,53 @@
const _app = getApp<IAppOption>()
Page({
data: {},
data: {
// 弹窗
popupShow: true,
popupType: 'popup3',
popupParams: {} as any,
},
onLoad() {},
handleEva() {
wx.navigateTo({
url: '/pages/agentEva/index',
})
},
handleAdd() {
this.setData({
popupShow: true,
popupType: 'popup3',
})
},
// 弹窗确认
handlePopupOk() {
this.setData({
popupShow: false,
})
wx.setClipboardData({
data: 'www.tencent.yuanqi.com',
success: () => {
wx.showToast({
title: '复制成功',
icon: 'success',
duration: 1500,
})
},
fail: () => {
wx.showToast({
title: '复制失败',
icon: 'none',
})
},
})
},
// 弹窗取消
handlePopupCancel() {
this.setData({
popupShow: false,
})
},
})
export {}

12
src/pages/agent/index.wxml

@ -110,3 +110,15 @@ @@ -110,3 +110,15 @@
</van-tabs>
</view>
</view>
<view class="fixed-add" bind:tap="handleAdd">
<image class="icon" src="/images/icon95.png"></image>
</view>
<popup
show="{{popupShow}}"
type="{{popupType}}"
params="{{popupParams}}"
bind:ok="handlePopupOk"
bind:cancel="handlePopupCancel"
></popup>

5
src/pages/feedback/index.json

@ -1,5 +1,8 @@ @@ -1,5 +1,8 @@
{
"navigationBarTitleText": "我要反馈",
"navigationStyle": "default",
"usingComponents": {}
"usingComponents": {
"popup": "/components/popup/index",
"upload-file": "/components/uploadFile/index"
}
}

90
src/pages/feedback/index.scss

@ -12,6 +12,91 @@ page { @@ -12,6 +12,91 @@ page {
background-color: rgba(247, 248, 250, 1);
border-radius: 16rpx;
}
.tex-count {
margin-top: 8rpx;
text-align: right;
font-size: 24rpx;
color: rgba(153, 153, 153, 1);
}
// 图片上传区域
.upload-area {
margin-top: 24rpx;
.upload-list {
display: flex;
flex-wrap: wrap;
gap: 16rpx;
.upload-item {
position: relative;
width: 160rpx;
height: 160rpx;
.upload-img {
width: 160rpx;
height: 160rpx;
border-radius: 12rpx;
}
.upload-del {
position: absolute;
top: -8rpx;
right: -8rpx;
width: 32rpx;
height: 32rpx;
background: rgba(0, 0, 0, 0.5);
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
&::before,
&::after {
content: '';
position: absolute;
width: 18rpx;
height: 2rpx;
background: #fff;
}
&::before {
transform: rotate(45deg);
}
&::after {
transform: rotate(-45deg);
}
}
}
.upload-trigger {
width: 160rpx;
height: 160rpx;
background-color: rgba(247, 248, 250, 1);
border-radius: 12rpx;
display: flex;
align-items: center;
justify-content: center;
.upload-trigger-icon {
width: 48rpx;
height: 48rpx;
position: relative;
&::before,
&::after {
content: '';
position: absolute;
background: rgba(200, 200, 200, 1);
top: 50%;
left: 50%;
}
&::before {
width: 48rpx;
height: 2rpx;
transform: translate(-50%, -50%);
}
&::after {
width: 2rpx;
height: 48rpx;
transform: translate(-50%, -50%);
}
}
}
}
}
.btn {
margin-top: 48rpx;
font-size: 32rpx;
@ -21,6 +106,9 @@ page { @@ -21,6 +106,9 @@ page {
align-items: center;
justify-content: center;
background: linear-gradient(90deg, #9ddffd 0%, #4ab8fd 100%);
border-radius: 16rpx 16rpx 16rpx 16rpx;
border-radius: 16rpx;
}
.btn-disabled {
opacity: 0.6;
}
}

94
src/pages/feedback/index.ts

@ -1,8 +1,94 @@ @@ -1,8 +1,94 @@
const _app = getApp<IAppOption>();
const app = getApp<IAppOption>()
Page({
data: {},
onLoad() {},
});
data: {
content: '',
imageList: [] as any[],
submitting: false,
// 弹窗
popupShow: false,
popupType: 'popup2',
popupParams: {} as any,
},
onLoad() {
app.waitLogin({ type: 1 })
},
onContentInput(e: any) {
this.setData({ content: e.detail.value })
},
onUploadSuccess(e: any) {
const file = e.detail.file
const imageList = this.data.imageList.concat([file])
this.setData({ imageList })
},
onUploadError(e: any) {
wx.showToast({ title: '图片上传失败', icon: 'none' })
},
deleteImage(e: any) {
const uid = e.currentTarget.dataset.uid
const imageList = this.data.imageList.filter((item: any) => item.uid !== uid)
this.setData({ imageList })
},
previewImage(e: any) {
const url = e.currentTarget.dataset.url
const urls = this.data.imageList.map((item: any) => item.url)
wx.previewImage({ current: url, urls })
},
handleSubmit() {
if (this.data.submitting) return
const content = this.data.content.trim()
if (!content) {
wx.showToast({ title: '请输入反馈内容', icon: 'none' })
return
}
if (content.length > 500) {
wx.showToast({ title: '反馈内容不能超过500字', icon: 'none' })
return
}
this.setData({ submitting: true })
const images = this.data.imageList.map((item: any) => item.url)
const imagesStr = images.length > 0 ? JSON.stringify(images) : ''
wx.ajax({
url: '/feedback/submit',
method: 'POST',
data: {
content,
images: imagesStr,
},
loading: true,
loadingText: '提交中...',
})
.then(() => {
this.setData({ popupShow: true })
})
.catch(() => {
wx.showToast({ title: '提交失败,请重试', icon: 'none' })
})
.finally(() => {
this.setData({ submitting: false })
})
},
handlePopupOk() {
this.setData({ popupShow: false })
wx.navigateBack()
},
handlePopupCancel() {
this.setData({ popupShow: false })
wx.navigateBack()
},
})
export {}

45
src/pages/feedback/index.wxml

@ -4,6 +4,49 @@ @@ -4,6 +4,49 @@
placeholder-class="place-tex"
placeholder="请描述具体问题,有助于我们更好的服务"
auto-height="{{true}}"
maxlength="{{500}}"
value="{{content}}"
bindinput="onContentInput"
></textarea>
<view class="btn">提交</view>
<view class="tex-count">{{content.length || 0}}/500</view>
<!-- 图片上传区域 -->
<view class="upload-area">
<view class="upload-list">
<view class="upload-item" wx:for="{{imageList}}" wx:key="uid">
<image
class="upload-img"
src="{{item.url}}"
mode="aspectFill"
bindtap="previewImage"
data-url="{{item.url}}"
></image>
<view class="upload-del" catchtap="deleteImage" data-uid="{{item.uid}}"></view>
</view>
<!-- 上传按钮,最多9张 -->
<upload-file
wx:if="{{imageList.length < 9}}"
maxCount="{{9}}"
fileList="{{imageList}}"
accept="{{['image']}}"
useSlot
bind:success="onUploadSuccess"
bind:error="onUploadError"
>
<view slot="upload-area" class="upload-trigger">
<view class="upload-trigger-icon"></view>
</view>
</upload-file>
</view>
</view>
<view class="btn {{submitting ? 'btn-disabled' : ''}}" bindtap="handleSubmit">提交</view>
</view>
<popup
show="{{popupShow}}"
type="{{popupType}}"
params="{{popupParams}}"
bind:ok="handlePopupOk"
bind:cancel="handlePopupCancel"
></popup>

185
src/pages/index/index.ts

@ -56,58 +56,60 @@ Page({ @@ -56,58 +56,60 @@ Page({
wx.ajax({
url: '/home/index',
method: 'GET',
}).then((res: any) => {
const data: any = {}
// 搜索模块
if (res.searchModule?.config?.placeholder) {
data.searchPlaceholder = res.searchModule.config.placeholder
}
// Banner 模块
if (res.bannerModule?.items?.length) {
data.bannerItems = res.bannerModule.items
data.currentBannerImage = res.bannerModule.items[0].imageUrl
this.startBannerRotation(res.bannerModule.items)
}
// 快捷入口模块
if (res.quickEntryModule?.items?.length) {
data.quickEntries = res.quickEntryModule.items
}
// 通知栏模块
if (res.notificationModule?.data?.length) {
data.notifications = res.notificationModule.data
}
// 热门活动模块 - 处理mainImages JSON字符串解析
if (res.hotActivityModule?.data?.length) {
const hotActivities = res.hotActivityModule.data.map((item: any) => {
let mainImages = item.mainImages
// 如果mainImages是字符串,解析为数组
if (typeof mainImages === 'string') {
try {
mainImages = JSON.parse(mainImages)
} catch (e) {
console.error('解析mainImages失败', e)
mainImages = []
})
.then((res: any) => {
const data: any = {}
// 搜索模块
if (res.searchModule?.config?.placeholder) {
data.searchPlaceholder = res.searchModule.config.placeholder
}
// Banner 模块
if (res.bannerModule?.items?.length) {
data.bannerItems = res.bannerModule.items
data.currentBannerImage = res.bannerModule.items[0].imageUrl
this.startBannerRotation(res.bannerModule.items)
}
// 快捷入口模块
if (res.quickEntryModule?.items?.length) {
data.quickEntries = res.quickEntryModule.items
}
// 通知栏模块
if (res.notificationModule?.data?.length) {
data.notifications = res.notificationModule.data
}
// 热门活动模块 - 处理mainImages JSON字符串解析
if (res.hotActivityModule?.data?.length) {
const hotActivities = res.hotActivityModule.data.map((item: any) => {
let mainImages = item.mainImages
// 如果mainImages是字符串,解析为数组
if (typeof mainImages === 'string') {
try {
mainImages = JSON.parse(mainImages)
} catch (e) {
console.error('解析mainImages失败', e)
mainImages = []
}
}
}
return { ...item, mainImages }
})
data.hotActivities = hotActivities
}
return { ...item, mainImages }
})
data.hotActivities = hotActivities
}
// 推荐智能体模块
if (res.recommendAgentModule?.data?.length) {
data.recommendAgents = res.recommendAgentModule.data
}
// 推荐智能体模块
if (res.recommendAgentModule?.data?.length) {
data.recommendAgents = res.recommendAgentModule.data
}
this.setData(data)
}).catch((err) => {
console.error('获取首页数据失败', err)
})
this.setData(data)
})
.catch((err) => {
console.error('获取首页数据失败', err)
})
},
fetchRecommendedActivities(page: number) {
@ -119,40 +121,42 @@ Page({ @@ -119,40 +121,42 @@ Page({
url: '/activity/list',
method: 'GET',
data: { getRecommended: 1, page, pageSize: 10 },
}).then((res: any) => {
const list = res.list || []
const pagination = res.pagination || {}
// 处理mainImages JSON字符串解析
const activities = list.map((item: any) => {
let mainImages = item.mainImages
if (typeof mainImages === 'string') {
try {
mainImages = JSON.parse(mainImages)
} catch (e) {
console.error('解析mainImages失败', e)
mainImages = []
}
}
return { ...item, mainImages }
})
})
.then((res: any) => {
const list = res.list || []
const pagination = res.pagination || {}
// 如果是第一页,直接替换;否则追加
const latestActivities = page === 1 ? activities : [...this.data.latestActivities, ...activities]
// 处理mainImages JSON字符串解析
const activities = list.map((item: any) => {
let mainImages = item.mainImages
if (typeof mainImages === 'string') {
try {
mainImages = JSON.parse(mainImages)
} catch (e) {
console.error('解析mainImages失败', e)
mainImages = []
}
}
return { ...item, mainImages }
})
this.setData({
latestActivities,
activityPagination: {
page: pagination.page || page,
pages: pagination.totalPages || 1,
count: pagination.total || 0,
},
activityLoading: false,
// 如果是第一页,直接替换;否则追加
const latestActivities = page === 1 ? activities : [...this.data.latestActivities, ...activities]
this.setData({
latestActivities,
activityPagination: {
page: pagination.page || page,
pages: pagination.totalPages || 1,
count: pagination.total || 0,
},
activityLoading: false,
})
})
.catch((err) => {
console.error('获取推荐活动失败', err)
this.setData({ activityLoading: false })
})
}).catch((err) => {
console.error('获取推荐活动失败', err)
this.setData({ activityLoading: false })
})
},
loadMoreActivities() {
@ -167,13 +171,15 @@ Page({ @@ -167,13 +171,15 @@ Page({
url: '/agent/list',
method: 'GET',
data: { page: 1, pageSize: 10 },
}).then((res: any) => {
if (res.list?.length) {
this.setData({ agentList: res.list })
}
}).catch((err) => {
console.error('获取智能体列表失败', err)
})
.then((res: any) => {
if (res.list?.length) {
this.setData({ agentList: res.list })
}
})
.catch((err) => {
console.error('获取智能体列表失败', err)
})
},
startBannerRotation(bannerItems: any[]) {
@ -186,7 +192,7 @@ Page({ @@ -186,7 +192,7 @@ Page({
currentBannerIndex: nextIndex,
currentBannerImage: bannerItems[nextIndex].imageUrl,
})
}, 3000)
}, 6000)
},
onSearchTap() {
@ -205,6 +211,11 @@ Page({ @@ -205,6 +211,11 @@ Page({
onMoreAgentsTap() {
wx.showToast({ title: '更多智能体开发中', icon: 'none' })
},
handleKkd(e) {
const { index } = e.currentTarget.dataset
const { quickEntries } = this.data
const { jumpType, jumpTarget } = quickEntries[index]
},
onAgentTap(e: WechatMiniprogram.TouchEvent) {
const id = e.currentTarget.dataset.id

10
src/pages/index/index.wxml

@ -9,13 +9,7 @@ @@ -9,13 +9,7 @@
<view class="notice" wx:if="{{notifications.length > 0}}">
<image class="icon" src="{{imageUrl}}icon2.png?t={{Timestamp}}"></image>
<view class="content">
<swiper
class="notice-swiper"
vertical="{{true}}"
autoplay="{{true}}"
circular="{{true}}"
interval="{{3000}}"
>
<swiper class="notice-swiper" vertical="{{true}}" autoplay="{{true}}" circular="{{true}}" interval="{{3000}}">
<swiper-item wx:for="{{notifications}}" wx:key="id">
<view class="notice-text">{{item.title}}</view>
</swiper-item>
@ -24,7 +18,7 @@ @@ -24,7 +18,7 @@
<van-icon class="more" name="arrow" />
</view>
<view class="kkd" wx:if="{{quickEntries.length > 0}}">
<view class="k-item" wx:for="{{quickEntries}}" wx:key="id">
<view class="k-item" wx:for="{{quickEntries}}" wx:key="id" bind:tap="handleKkd" data-index="{{index}}">
<image class="icon" src="{{item.imageUrl}}"></image>
<view class="name">{{item.name}}</view>
</view>

1
src/pages/my/index.scss

@ -16,6 +16,7 @@ page { @@ -16,6 +16,7 @@ page {
display: block;
width: 100%;
height: 100%;
border-radius: 50%;
}
}
.wrap {

77
src/pages/my/index.ts

@ -2,31 +2,98 @@ const app = getApp<IAppOption>() @@ -2,31 +2,98 @@ const app = getApp<IAppOption>()
Page({
data: {
userInfo: {},
imageUrl: app.globalData.imageUrl,
Timestamp: app.globalData.Timestamp,
profile: null as any,
activityCount: 0,
agentCount: 0,
},
onLoad() {
app.waitLogin()
app.waitLogin({ type: 1 }).then(() => {
this.fetchProfile()
})
},
onShow() {
this.setData({
userInfo: app.globalData.userInfo,
})
// 每次展示时刷新统计数
if (app.globalData.loginState) {
this.fetchActivityCount()
this.fetchAgentCount()
}
},
// 获取个人信息
async fetchProfile() {
try {
const res = await wx.ajax({
url: '/me/profile',
method: 'GET',
})
if (res) {
this.setData({ profile: res })
// 同时获取统计数
this.fetchActivityCount()
this.fetchAgentCount()
}
} catch (err) {
console.error('获取个人信息失败:', err)
}
},
// 获取活动参与数
async fetchActivityCount() {
try {
const res = await wx.ajax({
url: '/me/my-activities',
method: 'GET',
data: { page: 1, pageSize: 1 },
})
if (res) {
this.setData({ activityCount: res.pagination?.total || 0 })
}
} catch (err) {
console.error('获取活动统计失败:', err)
}
},
// 获取智能体使用数
async fetchAgentCount() {
try {
const res = await wx.ajax({
url: '/me/my-agents',
method: 'GET',
data: { type: 'recent', page: 1, pageSize: 1 },
})
if (res) {
this.setData({ agentCount: res.pagination?.total || 0 })
}
} catch (err) {
console.error('获取智能体统计失败:', err)
}
},
handleMyAct() {
wx.navigateTo({
url: '/pages/myAct/index',
})
},
handleMyAgent() {
wx.navigateTo({
url: '/pages/myAgent/index',
})
},
handleMyCommet() {
wx.navigateTo({
url: '/pages/myComment/index',
})
},
handleFeedback() {
wx.navigateTo({
url: '/pages/feedback/index',

12
src/pages/my/index.wxml

@ -4,27 +4,27 @@ @@ -4,27 +4,27 @@
>
<view class="user">
<view class="avatar">
<image class="a-img" src="{{imageUrl}}icon2.png?t={{Timestamp}}"></image>
<image class="a-img" src="{{profile.avatarUrl || imageUrl + 'icon2.png?t=' + Timestamp}}" mode="aspectFill"></image>
</view>
<view class="wrap">
<view class="w-header">
<view class="name">奇妙的双子座</view>
<view class="id">20989182</view>
<view class="name">{{profile.nickname || '未登录'}}</view>
<view class="id">{{profile.studentNo || ''}}</view>
</view>
<view class="content">计算机科学学院软件工程3班</view>
<view class="content">{{profile.collegeName}}{{profile.majorName ? profile.majorName : ''}}{{profile.className ? profile.className : ''}}</view>
</view>
</view>
<view class="kkd">
<view class="k-item" bind:tap="handleMyAct">
<view class="wrap" style="background: url('{{imageUrl}}icon58.png?t={{Timestamp}}') no-repeat center/100%">
<view class="title">我的活动</view>
<view class="content">已参与10个活动</view>
<view class="content">已参与{{activityCount}}个活动</view>
</view>
</view>
<view class="k-item" bind:tap="handleMyAgent">
<view class="wrap" style="background: url('{{imageUrl}}icon59.png?t={{Timestamp}}') no-repeat center/100%">
<view class="title">我的智能体</view>
<view class="content">已启用20个智能体</view>
<view class="content">已启用{{agentCount}}个智能体</view>
</view>
</view>
</view>

31
src/pages/myAct/index.scss

@ -53,6 +53,7 @@ page { @@ -53,6 +53,7 @@ page {
align-items: center;
gap: 8rpx;
.icon {
display: none;
width: 24rpx;
height: 24rpx;
}
@ -63,10 +64,16 @@ page { @@ -63,10 +64,16 @@ page {
&.status2 {
color: rgba(255, 255, 255, 1);
background: rgba(254, 181, 74, 1);
.icon {
display: block;
}
}
&.status3 {
color: rgba(255, 255, 255, 1);
background: rgba(111, 220, 174, 1);
.icon {
display: block;
}
}
&.status4 {
color: rgba(255, 255, 255, 1);
@ -89,6 +96,9 @@ page { @@ -89,6 +96,9 @@ page {
background: rgba(233, 239, 245, 1);
}
&.status9 {
.icon {
display: block;
}
color: rgba(255, 255, 255, 1);
background: rgba(74, 184, 253, 1);
}
@ -135,15 +145,34 @@ page { @@ -135,15 +145,34 @@ page {
font-size: 28rpx;
color: rgba(100, 116, 139, 1);
display: flex;
align-items: center;
gap: 8rpx;
.icon {
margin-top: 8rpx;
flex-shrink: 0;
width: 22rpx;
height: 22rpx;
}
}
}
}
.reject {
padding: 16rpx;
background-color: rgba(253, 91, 89, 0.1);
border-radius: 16rpx;
display: flex;
gap: 12rpx;
.icon {
margin-top: 8rpx;
flex-shrink: 0;
width: 22rpx;
height: 22rpx;
}
.r-content{
font-size: 28rpx;
color: rgba(253, 91, 89, 1);
line-height: 38rpx;
}
}
.c-footer {
padding-top: 24rpx;
display: flex;

6
src/pages/myAct/index.ts

@ -157,13 +157,13 @@ Page({ @@ -157,13 +157,13 @@ Page({
// 编辑活动
handleEdit(e: WechatMiniprogram.TouchEvent) {
const { id } = e.currentTarget.dataset
wx.navigateTo({ url: `/pages/actEdit/index?id=${id}` })
wx.navigateTo({ url: `/pages/actAdd/index?id=${id}` })
},
// 查看详情
handleDetail(e: WechatMiniprogram.TouchEvent) {
const { id } = e.currentTarget.dataset
wx.navigateTo({ url: `/pages/actDetail/index?id=${id}` })
const { id, anchor } = e.currentTarget.dataset
wx.navigateTo({ url: `/pages/actDetail/index?id=${id}&anchor=${anchor}` })
},
// 取消活动

76
src/pages/myAct/index.wxml

@ -6,6 +6,7 @@ @@ -6,6 +6,7 @@
title-active-color="rgba(74, 184, 253, 1)"
active="{{ active }}"
bind:change="onChange"
sticky
>
<van-tab title="我发布的">
<view class="page0">
@ -16,7 +17,11 @@ @@ -16,7 +17,11 @@
<image class="icon" src="{{imageUrl}}icon89.png?t={{Timestamp}}"></image>
{{item.activityStatusName}}
</view>
<image class="p-img" src="{{item.mainImages[0] || imageUrl + 'bg1.png?t=' + Timestamp}}" mode="aspectFill"></image>
<image
class="p-img"
src="{{item.mainImages[0] || imageUrl + 'bg1.png?t=' + Timestamp}}"
mode="aspectFill"
></image>
<view class="user">{{item.regCount}}人已报名</view>
</view>
<view class="wrap">
@ -31,28 +36,56 @@ @@ -31,28 +36,56 @@
</view>
</view>
</view>
<view class="reject" wx:if="{{item.activityStatus==4}}">
<image class="icon" src="/images/icon63.png"></image>
<view class="r-content">驳回原因:{{item.reviewReason}}</view>
</view>
<view class="c-footer">
<view class="stat">{{item.regCount}}人已报名</view>
<!-- 草稿状态 -->
<block wx:if="{{item.activityStatus === 0}}">
<!-- 1 草稿:删除、编辑 -->
<block wx:if="{{item.activityStatus === 1}}">
<view class="btn1" data-id="{{item.id}}" bind:tap="handleDelete">删除</view>
<view class="btn2" data-id="{{item.id}}" bind:tap="handleEdit">编辑</view>
</block>
<!-- 已发布/报名中状态 -->
<block wx:elif="{{item.activityStatus === 5}}">
<!-- 2 待审核:删除、编辑 -->
<block wx:elif="{{item.activityStatus === 2}}">
<view class="btn1" data-id="{{item.id}}" bind:tap="handleDelete">删除</view>
<view class="btn2" data-id="{{item.id}}" bind:tap="handleEdit">编辑</view>
</block>
<!-- 3 审核通过待报名:查看 -->
<block wx:elif="{{item.activityStatus === 3}}">
<view class="btn1" data-id="{{item.id}}" bind:tap="handleQrcode">签到二维码</view>
<view class="btn1" data-id="{{item.id}}" bind:tap="handleCancel">取消</view>
<view class="btn1" data-id="{{item.id}}" bind:tap="handleDetail">查看</view>
</block>
<!-- 4 已驳回:删除、编辑 -->
<block wx:elif="{{item.activityStatus === 4}}">
<view class="btn1" data-id="{{item.id}}" bind:tap="handleDelete">删除</view>
<view class="btn2" data-id="{{item.id}}" bind:tap="handleEdit">编辑</view>
</block>
<!-- 进行中状态 -->
<!-- 5 报名中:查看 -->
<block wx:elif="{{item.activityStatus === 5}}">
<view class="btn1" data-id="{{item.id}}" bind:tap="handleQrcode">签到二维码</view>
<view class="btn1" data-id="{{item.id}}" bind:tap="handleDetail">查看</view>
</block>
<!-- 6 进行中:查看 -->
<block wx:elif="{{item.activityStatus === 6}}">
<view class="btn1" data-id="{{item.id}}" bind:tap="handleQrcode">签到二维码</view>
<view class="btn1" data-id="{{item.id}}" bind:tap="handleDetail">详情</view>
<view class="btn1" data-id="{{item.id}}" bind:tap="handleDetail">查看</view>
</block>
<!-- 已结束状态 -->
<!-- 7 已结束:查看 -->
<block wx:elif="{{item.activityStatus === 7}}">
<view class="btn1" data-id="{{item.id}}" bind:tap="handleQrcode">签到二维码</view>
<view class="btn1" data-id="{{item.id}}" bind:tap="handleDetail">查看</view>
</block>
<!-- 8 已取消:删除、查看 -->
<block wx:elif="{{item.activityStatus === 8}}">
<view class="btn1" data-id="{{item.id}}" bind:tap="handleDelete">删除</view>
<view class="btn1" data-id="{{item.id}}" bind:tap="handleDetail">详情</view>
<view class="btn1" data-id="{{item.id}}" bind:tap="handleDetail">查看</view>
</block>
<!-- 9 审核通过待开始:查看 -->
<block wx:elif="{{item.activityStatus === 9}}">
<view class="btn1" data-id="{{item.id}}" bind:tap="handleQrcode">签到二维码</view>
<view class="btn1" data-id="{{item.id}}" bind:tap="handleDetail">查看</view>
</block>
</view>
</view>
@ -68,7 +101,11 @@ @@ -68,7 +101,11 @@
<image class="icon" src="{{imageUrl}}icon89.png?t={{Timestamp}}"></image>
{{item.activityStatusName}}
</view>
<image class="p-img" src="{{item.mainImages[0] || imageUrl + 'bg1.png?t=' + Timestamp}}" mode="aspectFill"></image>
<image
class="p-img"
src="{{item.mainImages[0] || imageUrl + 'bg1.png?t=' + Timestamp}}"
mode="aspectFill"
></image>
<view class="user">{{item.regCount}}人已报名</view>
</view>
<view class="wrap">
@ -85,22 +122,9 @@ @@ -85,22 +122,9 @@
</view>
<view class="c-footer">
<view class="stat">
<text wx:if="{{item.isChecked}}">已签到</text>
<text wx:elif="{{item.isReviewed}}">已评价</text>
<text wx:else>已报名</text>
<text>{{item.regCount}}人已报名</text>
</view>
<!-- 进行中且未签到 -->
<block wx:if="{{item.activityStatus === 6 && !item.isChecked}}">
<view class="btn2" data-id="{{item.id}}" bind:tap="handleDetail">去签到</view>
</block>
<!-- 已结束且未评价 -->
<block wx:elif="{{item.activityStatus === 7 && !item.isReviewed}}">
<view class="btn2" data-id="{{item.id}}" bind:tap="handleDetail">去评价</view>
</block>
<!-- 其他状态 -->
<block wx:else>
<view class="btn1" data-id="{{item.id}}" bind:tap="handleDetail">详情</view>
</block>
<view class="btn1" data-id="{{item.id}}" bind:tap="handleDetail">查看</view>
</view>
</view>
<pagination pagination="{{registeredPagination}}" />

3
src/pages/myComment/index.json

@ -5,6 +5,7 @@ @@ -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"
}
}

31
src/pages/myComment/index.scss

@ -14,6 +14,7 @@ page { @@ -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 { @@ -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;
}
}
}
}
}

171
src/pages/myComment/index.ts

@ -1,8 +1,171 @@ @@ -1,8 +1,171 @@
const _app = getApp<IAppOption>();
const app = getApp<IAppOption>()
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 {}

115
src/pages/myComment/index.wxml

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
<view class="page">
<view class="page" bind:tap="handleCloseOptions">
<van-tabs
class="tabs"
color="rgba(74, 184, 253, 1)"
@ -6,52 +6,123 @@ @@ -6,52 +6,123 @@
title-active-color="rgba(74, 184, 253, 1)"
active="{{ active }}"
bind:change="onChange"
sticky
>
<!-- 活动评论 Tab -->
<van-tab title="活动">
<view class="page0">
<view class="card">
<view class="card" wx:for="{{activityList}}" wx:key="id">
<view class="c-header">
<view class="status status1">待审核</view>
<!-- 审核状态:1待审核 2已通过 3已驳回 -->
<view class="status status{{item.auditStatus}}">{{item.auditStatusLabel}}</view>
<view class="wrap">
<view class="name">匿名</view>
<view class="options">
<image class="icon"></image>
<view class="name" wx:if="{{item.isAnonymous}}">匿名</view>
<view class="options" wx:if="{{item.auditStatus === 2 || item.auditStatus === 3}}" data-key="activity-{{index}}" catch:tap="handleToggleOptions">
<image class="icon" src="/images/icon93.png"></image>
<view class="options-wrap" wx:if="{{showOptionsKey === 'activity-' + index}}">
<view class="o-item" wx:if="{{item.auditStatus === 2 && item.isAnonymous}}" data-id="{{item.id}}" data-index="{{index}}" data-type="activity" catch:tap="handleSetPublic">
公开
</view>
<view class="o-item" data-id="{{item.id}}" data-index="{{index}}" catch:tap="handleDelete">
<image class="icon" src="/images/icon94.png"></image>
删除
</view>
</view>
</view>
</view>
</view>
<view class="station">
<view class="date">2026-01-01 13:00:09</view>
<view class="date">{{item.createdAt}}</view>
<view class="rate">
<van-rate value="{{4.5}}" color="#F7B550" allow-half size="28rpx" void-color="#F7F8FA" />
<view class="num">4.5</view>
<van-rate value="{{item.rating}}" color="#F7B550" allow-half readonly size="28rpx" void-color="#F7F8FA" />
<view class="num">{{item.rating}}</view>
</view>
</view>
<view class="content">
本次活动组织有序、流程顺畅,现场氛围良好。活 动内容丰富、安排合理,服务贴心到位,整体体验 良好。
<view class="content">{{item.content}}</view>
<view class="photo-wrap" wx:if="{{item.images.length > 0}}">
<view class="photo" wx:for="{{item.images}}" wx:for-item="img" wx:key="*this">
<image class="p-img" src="{{img}}" mode="aspectFill"></image>
</view>
</view>
<view class="act-card" data-targetid="{{item.targetId}}" bind:tap="handleGoDetail">
<image class="ac-photo" mode="aspectFill" src="{{item.coverImage}}"></image>
<view class="wrap">
<view class="title">{{item.targetTitle}}</view>
<view class="content">{{item.targetDate}}</view>
</view>
</view>
<!-- 待审核提示 -->
<view class="tip-card" wx:if="{{item.auditStatus === 1 && item.statusMessage}}">
<image class="icon" src="{{imageUrl}}icon62.png?t={{Timestamp}}"></image>
<view class="t-content">{{item.statusMessage}}</view>
</view>
<!-- 已驳回提示 -->
<view class="reject-card" wx:if="{{item.auditStatus === 3 && item.statusMessage}}">
<image class="icon" src="{{imageUrl}}icon63.png?t={{Timestamp}}"></image>
<view class="t-content">{{item.statusMessage}}</view>
</view>
</view>
<pagination pagination="{{activityPagination}}"></pagination>
</view>
</van-tab>
<!-- 智能体评论 Tab -->
<van-tab title="智能体">
<view class="page0">
<view class="card" wx:for="{{agentList}}" wx:key="id">
<view class="c-header">
<view class="status status{{item.auditStatus}}">{{item.auditStatusLabel}}</view>
<view class="wrap">
<view class="name" wx:if="{{item.isAnonymous}}">匿名</view>
<view class="options" wx:if="{{item.auditStatus === 2 || item.auditStatus === 3}}" data-key="agent-{{index}}" catch:tap="handleToggleOptions">
<image class="icon" src="/images/icon93.png"></image>
<view class="options-wrap" wx:if="{{showOptionsKey === 'agent-' + index}}">
<view class="o-item" wx:if="{{item.auditStatus === 2 && item.isAnonymous}}" data-id="{{item.id}}" data-index="{{index}}" data-type="agent" catch:tap="handleSetPublic">
公开
</view>
<view class="o-item" data-id="{{item.id}}" data-index="{{index}}" catch:tap="handleDelete">
<image class="icon" src="/images/icon94.png"></image>
删除
</view>
</view>
</view>
</view>
</view>
<view class="station">
<view class="date">{{item.createdAt}}</view>
<view class="rate">
<van-rate value="{{item.rating}}" color="#F7B550" allow-half readonly size="28rpx" void-color="#F7F8FA" />
<view class="num">{{item.rating}}</view>
</view>
</view>
<view class="photo-wrap">
<view class="photo" wx:for="{{3}}" wx:key="index">
<image class="p-img" src="{{imageUrl}}bg1.png?t={{Timestamp}}" mode="aspectFill"></image>
<view class="content">{{item.content}}</view>
<view class="photo-wrap" wx:if="{{item.images.length > 0}}">
<view class="photo" wx:for="{{item.images}}" wx:for-item="img" wx:key="*this">
<image class="p-img" src="{{img}}" mode="aspectFill"></image>
</view>
</view>
<view class="act-card">
<image class="ac-photo" mode="aspectFill" src="{{imageUrl}}bg1.png?t={{Timestamp}}"></image>
<image class="ac-photo" mode="aspectFill" src="{{item.coverImage}}"></image>
<view class="wrap">
<view class="title">深职大第十五届校园歌手大赛</view>
<view class="content">2026年5月30日 19:00</view>
<view class="title">{{item.targetTitle}}</view>
<view class="content">{{item.targetDate}}</view>
</view>
</view>
<view class="tip-card">
<!-- 待审核提示 -->
<view class="tip-card" wx:if="{{item.auditStatus === 1 && item.statusMessage}}">
<image class="icon" src="{{imageUrl}}icon62.png?t={{Timestamp}}"></image>
<view class="t-content">内容已提交,正在审核中,预计1-2个工作日内完成审核。</view>
<view class="t-content">{{item.statusMessage}}</view>
</view>
<view class="reject-card">
<!-- 已驳回提示 -->
<view class="reject-card" wx:if="{{item.auditStatus === 3 && item.statusMessage}}">
<image class="icon" src="{{imageUrl}}icon63.png?t={{Timestamp}}"></image>
<view class="t-content">驳回原因:内容中包含不当言论,请修改后重新提交。</view>
<view class="t-content">{{item.statusMessage}}</view>
</view>
</view>
<pagination pagination="{{agentPagination}}"></pagination>
</view>
</van-tab>
<van-tab title="我的评论">内容 2</van-tab>
</van-tabs>
</view>

15
src/pages/notice/index.scss

@ -3,6 +3,7 @@ page { @@ -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 { @@ -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 { @@ -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 { @@ -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);
}

30
src/pages/notice/index.ts

@ -64,6 +64,7 @@ Page({ @@ -64,6 +64,7 @@ Page({
onLoad() {
app.waitLogin({ type: 1 }).then(() => {
this.clearNotice('announcement')
this.fetchAnnouncementList()
})
},
@ -76,16 +77,37 @@ Page({ @@ -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({ @@ -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() {

15
src/pages/notice/index.wxml

@ -6,6 +6,7 @@ @@ -6,6 +6,7 @@
title-active-color="rgba(74, 184, 253, 1)"
active="{{ active }}"
bind:change="onChange"
sticky
>
<!-- 公告 -->
<van-tab title="公告">
@ -22,7 +23,6 @@ @@ -22,7 +23,6 @@
<view class="title">{{item.title}}</view>
<mp-html class="content" content="{{item.content}}"></mp-html>
<view class="c-footer">
<view class="tag">公告</view>
<view class="detail">
查看详情
<van-icon name="arrow" />
@ -49,7 +49,6 @@ @@ -49,7 +49,6 @@
<view class="title">{{item.title}}</view>
<mp-html class="content" content="{{item.content}}"></mp-html>
<view class="c-footer">
<view class="tag">重要通知</view>
<view class="detail">
查看详情
<van-icon name="arrow" />
@ -64,21 +63,13 @@ @@ -64,21 +63,13 @@
<!-- 活动通知 -->
<van-tab title="活动通知">
<view class="page2">
<view
class="module"
wx:for="{{activityList}}"
wx:key="id"
data-task-id="{{item.taskId}}"
bind:tap="handleNoticeDetail"
>
<view class="module" wx:for="{{activityList}}" wx:key="id" data-index="{{index}}" bind:tap="handleActNotice">
<view class="date">{{item.scheduleAt}}</view>
<view class="card">
<view class="title">{{item.title}}</view>
<view class="content">{{item.subtitle}}</view>
<view class="c-footer">
<view class="tag {{item.subType === 'approved' ? 'tag1' : item.subType === 'rejected' ? 'tag2' : item.subType === 'registered' ? 'tag3' : item.subType === 'checked_in' ? 'tag4' : item.subType === 'review_approved' ? 'tag5' : item.subType === 'review_rejected' ? 'tag2' : 'tag3'}}">
{{item.subTypeName}}
</view>
<view class="tag {{item.subType}}">{{item.subTypeName}}</view>
<view class="detail">
查看详情
<van-icon name="arrow" />

1
src/pages/noticeDetail/index.scss

@ -93,6 +93,7 @@ @@ -93,6 +93,7 @@
align-items: center;
gap: 8rpx;
.icon {
flex-shrink: 0;
width: 30rpx;
height: 30rpx;
}

10
src/pages/noticeDetail/index.ts

@ -19,7 +19,7 @@ Page({ @@ -19,7 +19,7 @@ Page({
categoryName: '',
},
onLoad(options: { id?: string, taskId?: string, type?: string }) {
onLoad(options: { id?: string; taskId?: string; type?: string }) {
const type = options.type || 'notice'
const id = Number(options.id || 0)
const taskId = Number(options.taskId || 0)
@ -96,13 +96,17 @@ Page({ @@ -96,13 +96,17 @@ Page({
if (detail.jumpType === 1) {
// 不跳转
} else if (detail.jumpType === 2) {
// 跳转活动
wx.navigateTo({ url: `/pages/actDetail/index?id=${detail.jumpTarget}` })
} else if (detail.jumpType === 3) {
// 跳转小程序页面
wx.navigateTo({ url: detail.jumpTarget })
wx.navigateTo({
url: detail.jumpTarget,
fail() {
wx.switchTab({ url: detail.jumpTarget })
},
})
} else if (detail.jumpType === 4) {
// 跳转H5链接
wx.navigateTo({

4
src/pages/noticeDetail/index.wxml

@ -12,6 +12,10 @@ @@ -12,6 +12,10 @@
<image class="icon" src="{{imageUrl}}icon24.png?t={{Timestamp}}"></image>
<view class="content">{{type === 'announcement' ? detail.createdAt : detail.scheduleAt}}</view>
</view>
<view class="user" wx:if="{{type === 'notice'}}">
<image class="icon" src="{{imageUrl}}icon25.png?t={{Timestamp}}"></image>
<view class="content">浏览人数:{{detail.reviewCount}}</view>
</view>
</view>
</view>
<view class="mp-html">

5
src/pages/search/index.json

@ -0,0 +1,5 @@ @@ -0,0 +1,5 @@
{
"navigationStyle": "default",
"navigationBarBackgroundColor": "#F7F8FA",
"usingComponents": {}
}

3
src/pages/search/index.scss

@ -0,0 +1,3 @@ @@ -0,0 +1,3 @@
page {
background-color: #f7f8fa;
}

8
src/pages/search/index.ts

@ -0,0 +1,8 @@ @@ -0,0 +1,8 @@
const _app = getApp<IAppOption>();
Page({
data: {},
onLoad() {},
});
export {}

0
src/pages/search/index.wxml

3
src/pages/webview/index.json

@ -0,0 +1,3 @@ @@ -0,0 +1,3 @@
{
"usingComponents": {}
}

0
src/pages/webview/index.scss

16
src/pages/webview/index.ts

@ -0,0 +1,16 @@ @@ -0,0 +1,16 @@
const app = getApp<IAppOption>()
Page({
data: {
// url: "https://uat-open2.ehaoyao.com/wap/jointlogin/index?appid=vgcL5j9BIXEG0CdKXgsmpX3t1uQJufNa&mobile=YHHaNEJf/rCetEvRn5Iekw==&time=1661486102&username=YHHaNEJf/rCetEvRn5Iekw==&sign=97d9002ae18dc26885d983122a21c717&returnUrl=https%3A%2F%2Fuat-open2.ehaoyao.com%2Fm%2F%3Fappid%3D50%26channelgoodsid%3D728485%26nums%3D1%23%2ForderConfirm&threeSerialNumber=2022082611550200002&mark=",
url: '',
},
onLoad(options) {
if (options.url) {
this.setData({
url: decodeURIComponent(options.url),
})
}
},
getDetail() {},
})

1
src/pages/webview/index.wxml

@ -0,0 +1 @@ @@ -0,0 +1 @@
<web-view src="{{url}}" />
Loading…
Cancel
Save