|
After Width: | Height: | Size: 1.8 MiB |
|
After Width: | Height: | Size: 563 KiB |
|
After Width: | Height: | Size: 2.8 MiB |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 542 B |
|
After Width: | Height: | Size: 1.4 KiB |
|
After Width: | Height: | Size: 768 B |
@ -0,0 +1,6 @@
@@ -0,0 +1,6 @@
|
||||
{ |
||||
"navigationBarTitleText": "活动签到", |
||||
"usingComponents": { |
||||
"van-icon": "@vant/weapp/icon/index" |
||||
} |
||||
} |
||||
@ -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; |
||||
} |
||||
} |
||||
@ -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 {} |
||||
@ -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> |
||||
@ -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 {} |
||||
|
||||
@ -1,5 +1,8 @@
@@ -1,5 +1,8 @@
|
||||
{ |
||||
"navigationBarTitleText": "我要反馈", |
||||
"navigationStyle": "default", |
||||
"usingComponents": {} |
||||
"usingComponents": { |
||||
"popup": "/components/popup/index", |
||||
"upload-file": "/components/uploadFile/index" |
||||
} |
||||
} |
||||
|
||||
@ -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 {} |
||||
|
||||
@ -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 {} |
||||
|
||||
@ -0,0 +1,5 @@
@@ -0,0 +1,5 @@
|
||||
{ |
||||
"navigationStyle": "default", |
||||
"navigationBarBackgroundColor": "#F7F8FA", |
||||
"usingComponents": {} |
||||
} |
||||
@ -0,0 +1,3 @@
@@ -0,0 +1,3 @@
|
||||
page { |
||||
background-color: #f7f8fa; |
||||
} |
||||
@ -0,0 +1,8 @@
@@ -0,0 +1,8 @@
|
||||
const _app = getApp<IAppOption>(); |
||||
|
||||
Page({ |
||||
data: {}, |
||||
onLoad() {}, |
||||
}); |
||||
|
||||
export {} |
||||
@ -0,0 +1,3 @@
@@ -0,0 +1,3 @@
|
||||
{ |
||||
"usingComponents": {} |
||||
} |
||||
@ -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() {}, |
||||
}) |
||||