Ship signup sheet, subscribe reminders, cover crop, and theme updates.

Wire real WeChat app config, prefer activity cover over posters, and add admin cover cropping for the home banner.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Michelle Zan
2026-10-08 13:06:43 +08:00
co-authored by Cursor
parent cd05113755
commit 0ca2e87bf2
35 changed files with 968 additions and 184 deletions
+5 -61
View File
@@ -1,71 +1,15 @@
const api = require('../../utils/api')
const authUtil = require('../../utils/auth')
const activityUtil = require('../../utils/activity')
Page({
data: {
name: '',
phone: '',
company: '',
submitting: false
activityId: ''
},
onLoad(query) {
this.activityId = (query && query.id) || ''
api
.profile()
.then((profile) => {
if (!profile) return
this.setData({
name: this.data.name || profile.name || '',
phone: this.data.phone || profile.phone || '',
company: this.data.company || profile.company || ''
})
})
.catch(() => {})
this.setData({ activityId: (query && query.id) || '' })
},
onName(event) {
this.setData({ name: event.detail.value })
onClose() {
wx.navigateBack({ fail: () => wx.switchTab({ url: '/pages/index/index' }) })
},
onPhone(event) {
this.setData({ phone: event.detail.value })
},
onCompany(event) {
this.setData({ company: event.detail.value })
},
submit() {
if (this.data.submitting) return
const name = this.data.name.trim()
const phone = this.data.phone.trim()
const company = this.data.company.trim()
if (!name || !phone) {
wx.showToast({ title: '请填写姓名和手机号', icon: 'none' })
return
}
if (!/^1\d{10}$/.test(phone)) {
wx.showToast({ title: '请填写正确的手机号', icon: 'none' })
return
}
this.setData({ submitting: true })
api
.signup({
activityId: this.activityId,
name: name,
phone: phone,
company: company,
sourceSharer: authUtil.sourceSharer()
})
.then(() => {
wx.showToast({ title: '报名成功', icon: 'success' })
setTimeout(() => wx.navigateBack(), 600)
})
.catch((error) => {
this.setData({ submitting: false })
activityUtil.toast(error)
})
}
onSuccess() {}
})