activityApply.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441
  1. <template>
  2. <view class="common_page adffc" :style="{'min-height':h+'px', 'padding-top':mt+'px'}">
  3. <cus-header title="报名信息填写" bgColor="transparent"></cus-header>
  4. <image src="https://transcend.ringzle.com/xiaozhi-app/profile/2025/09/19/54b75bc8-d926-449b-95a5-1126f700b481.png" class="top_bg_img" mode="widthFix"></image>
  5. <view class="box box1">
  6. <view class="box1-top">
  7. <view class="title">{{activity?.activityName||''}}</view>
  8. <view class="tip">活动时间:{{activity?.activityStartTime||''}} 到 {{activity?.activityEndTime||''}}</view>
  9. <view class="tip">活动地点:{{activity?.provinceName||''}}{{activity?.cityName||''}}{{activity?.address||''}}</view>
  10. </view>
  11. <view class="box1-bottom adfac">
  12. <image src="https://transcend.ringzle.com/xiaozhi-app/profile/2025/10/10/0f8ec76b-5c24-4d79-a77e-354d3e70bb36.png"></image>
  13. <text>报名时间截止前可取消并返还{{activityLimitCfg[activity?.activityLimit]}},截止后不可取消。</text>
  14. </view>
  15. </view>
  16. <view class="box box2">
  17. <view class="box2-title">报名信息</view>
  18. <view class="box2-members" v-if="selectMemberList.length">
  19. <view class="box2-members-pre adfacjb" v-for="(item,index) in selectMemberList" :key="index">
  20. <view class="box2-members-pre-left">
  21. <view class="ltop adfac">
  22. <view class="name">{{item.name}}</view>
  23. <image class="sex" v-if="item.gender==1" src="https://transcend.ringzle.com/xiaozhi-app/profile/2025/09/12/b6d1fcb3-55ba-4104-b8cd-756b963a4da8.png"></image>
  24. <image class="sex" v-else-if="item.gender==0" src="https://transcend.ringzle.com/xiaozhi-app/profile/2025/09/12/a1899fd0-c468-48d9-b554-2f17b75a4157.png"></image>
  25. <view class="age" :class="{'women':item.gender==1,'man':item.gender==0}">{{item.age}}岁</view>
  26. </view>
  27. <view class="lbottom">
  28. 身份证 {{item.idCardCopy}}
  29. </view>
  30. </view>
  31. <view class="box2-members-pre-right" @click="deleteMember(item,index)">
  32. <image src="https://transcend.ringzle.com/xiaozhi-app/profile/2025/10/10/bf4876c8-43bf-4eeb-a153-1414e567ed10.png"></image>
  33. </view>
  34. </view>
  35. </view>
  36. <view class="box2-add adfacjc" @click="handleAdd">
  37. <image src="https://transcend.ringzle.com/xiaozhi-app/profile/2025/10/10/9aa7a091-d1fe-40a9-9a7e-846decf2d4e0.png"></image>
  38. <text>添加</text>
  39. </view>
  40. </view>
  41. <view class="box box3">
  42. <view class="box3-pre adfacjb">
  43. <view class="box3-pre-left">联系人姓名</view>
  44. <view class="box3-pre-right">
  45. <up-input v-model="submitDto.contact" border="none" style="font-size: 30rpx;color: #151B29;text-align: right;" placeholder="请输入联系人姓名"></up-input>
  46. </view>
  47. </view>
  48. <view class="box3-pre adfacjb">
  49. <view class="box3-pre-left">联系人电话</view>
  50. <view class="box3-pre-right">
  51. <up-input v-model="submitDto.contactPhone" border="none" style="font-size: 30rpx;color: #151B29;text-align: right;" placeholder="请输入联系人电话"></up-input>
  52. </view>
  53. </view>
  54. </view>
  55. <view class="box box4 adfacjb" v-if="activity?.activityLimit==2" @click="handleSelectTicket">
  56. <view class="box4-left">专享券抵扣</view>
  57. <view class="box4-right adfac">
  58. <text>{{ticketText}}</text>
  59. <image src="https://transcend.ringzle.com/xiaozhi-app/profile/2025/10/10/4d3329f1-7421-4bde-a7dd-5175a7748f8f.png"></image>
  60. </view>
  61. </view>
  62. <view class="cbottom">
  63. <view class="cbottom-top adfac" @click="changeAgree">
  64. <image v-if="agree" src="https://transcend.ringzle.com/xiaozhi-app/profile/2025/09/12/87b5b244-d14f-43cd-991b-4ac9f48d909e.png"></image>
  65. <image v-else src="https://transcend.ringzle.com/xiaozhi-app/profile/2025/09/12/b8a5cabd-57f8-4ad7-9677-f6372423c50a.png"></image>
  66. <text>我已知晓并同意活动组织方获取以上我所提交的报名信息。</text>
  67. </view>
  68. <view class="cbottom-btn adfacjb">
  69. <view class="cbottom-btn-left adffcac">
  70. <template v-if="activity?.activityLimit<3">
  71. <view class="heart adfac">
  72. <image src="https://transcend.ringzle.com/xiaozhi-app/profile/2025/10/10/ab188fd0-afcc-4d76-a1d6-de367af3e756.png"></image>
  73. <text>{{payValue}}</text>
  74. </view>
  75. <view class="text">{{activityLimitCfg[activity?.activityLimit]||''}}</view>
  76. </template>
  77. <template v-else>
  78. <view class="free">免费</view>
  79. </template>
  80. </view>
  81. <view class="cbottom-btn-right" @click="handleApply">确定报名</view>
  82. </view>
  83. </view>
  84. </view>
  85. </template>
  86. <script setup name="">
  87. import CusHeader from '@/components/CusHeader/index.vue'
  88. import { ref, getCurrentInstance, onMounted } from 'vue'
  89. import { onLoad } from '@dcloudio/uni-app'
  90. const { proxy } = getCurrentInstance()
  91. const activity = ref(null)
  92. const activityLimitCfg = ref({
  93. 1:'爱心值',
  94. 2:'专享券',
  95. 3:'免费'
  96. })
  97. const selectMemberList = ref([])
  98. const submitDto = ref({
  99. activityId:'',
  100. contact:'',
  101. contactPhone:'',
  102. couponIds:[],
  103. memberIds:[],
  104. userId:''
  105. })
  106. const agree = ref(false)
  107. const payValue = ref(0)
  108. const userLoveTicket = ref(null)
  109. const selectCouponIds = ref([])
  110. const ticketText = ref('暂无可用专享券')
  111. const handleAdd = () => {
  112. uni.navigateTo({
  113. url:'/pagesHome/applyMember',
  114. events:{
  115. 'selectMembers': data => {
  116. selectMemberList.value = data;
  117. payValue.value = selectMemberList.value.length*activity.value?.valueLimit;
  118. }
  119. }
  120. })
  121. }
  122. const handleSelectTicket = () => {
  123. uni.navigateTo({
  124. url:'/pagesMy/exclusiveScroll?activityId='+activity.value?.id,
  125. events:{
  126. 'selectTickets': data => {
  127. selectCouponIds.value = data;
  128. ticketText.value = `已选${data?.length||0}张,剩余${userLoveTicket.value?.couponIds?.length-data?.length}张可用`;
  129. }
  130. }
  131. })
  132. }
  133. const handleApply = async () => {
  134. if(selectMemberList.value.length===0) return proxy.$showToast('请至少添加一位报名人员')
  135. if(!submitDto.value.contact) return proxy.$showToast('请输入联系人姓名')
  136. if(!proxy.$reg.mobile(submitDto.value.contactPhone)) return proxy.$showToast('请输入正确的联系电话')
  137. submitDto.value.memberIds = selectMemberList.value.map(m=>m.id);
  138. submitDto.value.activityId = activity.value.id;
  139. submitDto.value.userId = JSON.parse(uni.getStorageSync('userInfo')).id;
  140. if(activity.value?.activityLimit==2){
  141. let smnum = selectMemberList.value.length;
  142. let stnum = selectCouponIds.value.length;
  143. if(stnum<smnum) return proxy.$showToast(`请选择${smnum}张专享券`)
  144. }
  145. submitDto.value.couponIds = selectCouponIds.value;
  146. if(!agree.value) return proxy.$showToast('请勾选已知晓并同意')
  147. proxy.$api.post('/core/activity/signup/signup',submitDto.value).then(({data:res})=>{
  148. if(res.code!==0) return proxy.$showToast(res.msg)
  149. uni.redirectTo({
  150. url:'/pagesHome/applyResult'
  151. })
  152. })
  153. }
  154. const getUserLoveTicket = () => {
  155. let userId = JSON.parse(uni.getStorageSync('userInfo'))?.id;
  156. proxy.$api.get(`/core/activity/signup/userAsset/${userId}/${activity.value?.id}`).then(({data:res})=>{
  157. if(res.code!==0) return proxy.$showToast(res.msg)
  158. userLoveTicket.value = res.data;
  159. ticketText.value = `剩余${res.data?.couponIds?.length||0}张可用`;
  160. })
  161. }
  162. const changeAgree = () => {
  163. agree.value = !agree.value;
  164. }
  165. const deleteMember = (item,index) => {
  166. selectMemberList.value.splice(index,1);
  167. payValue.value = selectMemberList.value.length*activity.value?.valueLimit;
  168. }
  169. onLoad(options=>{
  170. activity.value = options.activity&&JSON.parse(decodeURIComponent(options.activity))
  171. })
  172. onMounted(()=>{
  173. getUserLoveTicket()
  174. })
  175. </script>
  176. <style scoped lang="scss">
  177. ::v-deep .u-input__content__field-wrapper__field{
  178. text-align: right !important;
  179. }
  180. .common_page{
  181. padding-bottom: 248rpx;
  182. .box{
  183. margin-top: 20rpx;
  184. background: #FFFFFF;
  185. border-radius: 20rpx;
  186. position: relative;
  187. }
  188. .box1{
  189. &-top{
  190. padding: 36rpx 24rpx 24rpx;
  191. border-bottom: 1rpx solid #E5E7EB;
  192. &>.title{
  193. font-family: PingFang-SC, PingFang-SC;
  194. font-weight: bold;
  195. font-size: 32rpx;
  196. color: #151B29;
  197. line-height: 32rpx;
  198. }
  199. &>.tip{
  200. font-family: PingFangSC, PingFang SC;
  201. font-weight: 400;
  202. font-size: 24rpx;
  203. color: #666666;
  204. line-height: 24rpx;
  205. margin-top: 30rpx;
  206. }
  207. }
  208. &-bottom{
  209. padding: 26rpx 24rpx;
  210. image{
  211. width: 20rpx;
  212. height: 20rpx;
  213. }
  214. text{
  215. font-family: PingFangSC, PingFang SC;
  216. font-weight: 400;
  217. font-size: 24rpx;
  218. color: #C9A771;
  219. line-height: 24rpx;
  220. margin-left: 10rpx;
  221. }
  222. }
  223. }
  224. .box2{
  225. padding: 40rpx 24rpx 48rpx;
  226. &-title{
  227. font-family: PingFang-SC, PingFang-SC;
  228. font-weight: bold;
  229. font-size: 36rpx;
  230. color: #151B29;
  231. line-height: 36rpx;
  232. margin-bottom: 26rpx;
  233. display: inline-block;
  234. }
  235. &-members{
  236. &-pre{
  237. padding: 36rpx 0;
  238. box-shadow: inset 0rpx -1rpx 0rpx 0rpx #F2F2F2;
  239. &-left{
  240. .ltop{
  241. .name{
  242. font-family: PingFang-SC, PingFang-SC;
  243. font-weight: bold;
  244. font-size: 32rpx;
  245. color: #151B29;
  246. line-height: 32rpx;
  247. }
  248. .sex{
  249. width: 44rpx;
  250. height: 32rpx;
  251. margin-left: 20rpx;
  252. }
  253. .age{
  254. border-radius: 13rpx;
  255. font-family: PingFangSC, PingFang SC;
  256. font-weight: 400;
  257. font-size: 20rpx;
  258. line-height: 24rpx;
  259. padding: 4rpx 10rpx;
  260. margin-left: 13rpx;
  261. &.women{
  262. background: rgba(244,101,122,0.14);
  263. color: #F4657A;
  264. }
  265. &.man{
  266. background: rgba(5,169,254,0.12);
  267. color: #05A9FE;
  268. }
  269. }
  270. }
  271. .lbottom{
  272. font-family: PingFangSC, PingFang SC;
  273. font-weight: 400;
  274. font-size: 24rpx;
  275. color: #989998;
  276. line-height: 24rpx;
  277. margin-top: 24rpx;
  278. }
  279. }
  280. &-right{
  281. width: 36rpx;
  282. height: 36rpx;
  283. image{
  284. width: 100%;
  285. height: 100%;
  286. }
  287. }
  288. }
  289. }
  290. &-add{
  291. width: 100%;
  292. height: 78rpx;
  293. background: rgba(112,207,82,0.08);
  294. border-radius: 24rpx;
  295. border: 1rpx dotted #70CF52;
  296. margin-top: 40rpx;
  297. image{
  298. width: 36rpx;
  299. height: 36rpx;
  300. }
  301. text{
  302. font-family: PingFang-SC, PingFang-SC;
  303. font-weight: bold;
  304. font-size: 28rpx;
  305. color: #70CF52;
  306. line-height: 40rpx;
  307. margin-left: 10rpx;
  308. }
  309. }
  310. }
  311. .box3{
  312. &-pre{
  313. padding: 36rpx 24rpx;
  314. &:first-child{
  315. box-shadow: inset 0rpx -1rpx 0rpx 0rpx #ECEEF5;
  316. }
  317. &-left{
  318. font-family: PingFangSC, PingFang SC;
  319. font-weight: 400;
  320. font-size: 30rpx;
  321. color: #151B29;
  322. line-height: 36rpx;
  323. }
  324. }
  325. }
  326. .box4{
  327. padding: 36rpx 24rpx;
  328. &-left{
  329. font-family: PingFangSC, PingFang SC;
  330. font-weight: 400;
  331. font-size: 30rpx;
  332. color: #151B29;
  333. line-height: 36rpx;
  334. }
  335. &-right{
  336. text{
  337. font-family: PingFangSC, PingFang SC;
  338. font-weight: 400;
  339. font-size: 24rpx;
  340. color: #989998;
  341. line-height: 33rpx;
  342. }
  343. image{
  344. width: 32rpx;
  345. height: 32rpx;
  346. margin-left: 20rpx;
  347. }
  348. }
  349. }
  350. .cbottom{
  351. width: 100%;
  352. position: fixed;
  353. left: 0;
  354. right: 0;
  355. bottom: 0;
  356. &-top{
  357. padding: 0 30rpx;
  358. image{
  359. width: 36rpx;
  360. height: 36rpx;
  361. }
  362. text{
  363. font-family: PingFangSC, PingFang SC;
  364. font-weight: 400;
  365. font-size: 24rpx;
  366. color: #989998;
  367. line-height: 33rpx;
  368. margin-left: 16rpx;
  369. }
  370. }
  371. &-btn{
  372. background: #FFFFFF;
  373. padding: 20rpx 30rpx 44rpx 36rpx;
  374. margin-top: 40rpx;
  375. &-left{
  376. .heart{
  377. image{
  378. width: 30rpx;
  379. height: 30rpx;
  380. }
  381. text{
  382. font-family: PingFang-SC, PingFang-SC;
  383. font-weight: bold;
  384. font-size: 36rpx;
  385. color: #F4657A;
  386. line-height: 36rpx;
  387. margin-left: 2rpx;
  388. }
  389. }
  390. .text{
  391. font-family: PingFangSC, PingFang SC;
  392. font-weight: 400;
  393. font-size: 24rpx;
  394. color: #252525;
  395. line-height: 24rpx;
  396. margin-top: 11rpx;
  397. }
  398. .free{
  399. font-family: PingFangSC, PingFang SC;
  400. font-weight: 400;
  401. font-size: 32rpx;
  402. color: #252525;
  403. line-height: 32rpx;
  404. }
  405. }
  406. &-right{
  407. width: 528rpx;
  408. height: 90rpx;
  409. background: #B7F358;
  410. border-radius: 45rpx;
  411. font-family: PingFang-SC, PingFang-SC;
  412. font-weight: bold;
  413. font-size: 32rpx;
  414. color: #151B29;
  415. line-height: 90rpx;
  416. text-align: center;
  417. letter-spacing: 2rpx;
  418. }
  419. }
  420. }
  421. }
  422. </style>