activityApply.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413
  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. <div class="box box1">
  6. <div class="box1-top">
  7. <div class="title">{{activity?.activityName||''}}</div>
  8. <div class="tip">活动时间:{{activity?.activityStartTime||''}} 到 {{activity?.activityEndTime||''}}</div>
  9. <div class="tip">活动地点:{{activity?.provinceName||''}}{{activity?.cityName||''}}{{activity?.address||''}}</div>
  10. </div>
  11. <div 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. </div>
  15. </div>
  16. <div class="box box2">
  17. <div class="box2-title">报名信息</div>
  18. <div class="box2-members" v-if="selectMemberList.length">
  19. <div class="box2-members-pre adfacjb" v-for="(item,index) in selectMemberList" :key="index">
  20. <div class="box2-members-pre-left">
  21. <div class="ltop adfac">
  22. <div class="name">{{item.name}}</div>
  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. <div class="age" :class="{'women':item.gender==1,'man':item.gender==0}">{{item.age}}岁</div>
  26. </div>
  27. <div class="lbottom">
  28. 身份证 {{item.idCardCopy}}
  29. </div>
  30. </div>
  31. <div 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. </div>
  34. </div>
  35. </div>
  36. <div class="box2-add adfacjc" @tap="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. </div>
  40. </div>
  41. <div class="box box3">
  42. <div class="box3-pre adfacjb">
  43. <div class="box3-pre-left">联系人姓名</div>
  44. <div 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. </div>
  47. </div>
  48. <div class="box3-pre adfacjb">
  49. <div class="box3-pre-left">联系人电话</div>
  50. <div 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. </div>
  53. </div>
  54. </div>
  55. <div class="box box4 adfacjb">
  56. <div class="box4-left">专享券抵扣</div>
  57. <div class="box4-right adfac" @tap="handleSelectTicket">
  58. <text>{{'暂无可用专享券'}}</text>
  59. <image src="https://transcend.ringzle.com/xiaozhi-app/profile/2025/10/10/4d3329f1-7421-4bde-a7dd-5175a7748f8f.png"></image>
  60. </div>
  61. </div>
  62. <div class="cbottom">
  63. <div class="cbottom-top adfac" @tap="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. </div>
  68. <div class="cbottom-btn adfacjb">
  69. <div class="cbottom-btn-left adffcac">
  70. <template v-if="activity?.activityLimit<3">
  71. <div 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. </div>
  75. <div class="text">{{activityLimitCfg[activity?.activityLimit]||''}}</div>
  76. </template>
  77. <template v-else>
  78. <view class="free">免费</view>
  79. </template>
  80. </div>
  81. <div class="cbottom-btn-right" @click="handleApply">确定报名</div>
  82. </div>
  83. </div>
  84. </view>
  85. </template>
  86. <script setup name="">
  87. import CusHeader from '@/components/CusHeader/index.vue'
  88. import { ref, getCurrentInstance } 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 handleAdd = () => {
  109. uni.navigateTo({
  110. url:'/pagesHome/applyMember',
  111. events:{
  112. 'selectMembers': data => {
  113. selectMemberList.value = data;
  114. payValue.value = selectMemberList.value.length*activity.value?.valueLimit;
  115. }
  116. }
  117. })
  118. }
  119. const handleSelectTicket = () => {
  120. uni.navigateTo({
  121. url:'/pagesMy/exclusiveScroll'
  122. })
  123. }
  124. const handleApply = () => {
  125. if(selectMemberList.value.length===0) return proxy.$showToast('请至少添加一位报名人员')
  126. if(!submitDto.value.contact) return proxy.$showToast('请输入联系人姓名')
  127. if(!proxy.$reg.mobile(submitDto.value.contactPhone)) return proxy.$showToast('请输入正确的联系电话')
  128. if(!agree.value) return proxy.$showToast('请勾选已知晓并同意')
  129. submitDto.value.memberIds = selectMemberList.value.map(m=>m.id);
  130. submitDto.value.activityId = activity.value.id;
  131. submitDto.value.userId = JSON.parse(uni.getStorageSync('userInfo')).id;
  132. proxy.$api.post('/core/activity/signup/signup',submitDto.value).then(({data:res})=>{
  133. if(res.code!==0) return proxy.$showToast(res.msg)
  134. uni.redirectTo({
  135. url:'/pagesHome/applyResult'
  136. })
  137. })
  138. }
  139. const changeAgree = () => {
  140. agree.value = !agree.value;
  141. }
  142. const deleteMember = (item,index) => {
  143. selectMemberList.value.splice(index,1);
  144. payValue.value = selectMemberList.value.length*activity.value?.valueLimit;
  145. }
  146. onLoad(options=>{
  147. activity.value = options.activity&&JSON.parse(decodeURIComponent(options.activity))
  148. })
  149. </script>
  150. <style scoped lang="scss">
  151. ::v-deep .u-input__content__field-wrapper__field{
  152. text-align: right !important;
  153. }
  154. .common_page{
  155. padding-bottom: 248rpx;
  156. .box{
  157. margin-top: 20rpx;
  158. background: #FFFFFF;
  159. border-radius: 20rpx;
  160. position: relative;
  161. }
  162. .box1{
  163. &-top{
  164. padding: 36rpx 24rpx 24rpx;
  165. border-bottom: 1rpx solid #E5E7EB;
  166. &>.title{
  167. font-family: PingFang-SC, PingFang-SC;
  168. font-weight: bold;
  169. font-size: 32rpx;
  170. color: #151B29;
  171. line-height: 32rpx;
  172. }
  173. &>.tip{
  174. font-family: PingFangSC, PingFang SC;
  175. font-weight: 400;
  176. font-size: 24rpx;
  177. color: #666666;
  178. line-height: 24rpx;
  179. margin-top: 30rpx;
  180. }
  181. }
  182. &-bottom{
  183. padding: 26rpx 24rpx;
  184. image{
  185. width: 20rpx;
  186. height: 20rpx;
  187. }
  188. text{
  189. font-family: PingFangSC, PingFang SC;
  190. font-weight: 400;
  191. font-size: 24rpx;
  192. color: #C9A771;
  193. line-height: 24rpx;
  194. margin-left: 10rpx;
  195. }
  196. }
  197. }
  198. .box2{
  199. padding: 40rpx 24rpx 48rpx;
  200. &-title{
  201. font-family: PingFang-SC, PingFang-SC;
  202. font-weight: bold;
  203. font-size: 36rpx;
  204. color: #151B29;
  205. line-height: 36rpx;
  206. margin-bottom: 26rpx;
  207. display: inline-block;
  208. }
  209. &-members{
  210. &-pre{
  211. padding: 36rpx 0;
  212. box-shadow: inset 0rpx -1rpx 0rpx 0rpx #F2F2F2;
  213. &-left{
  214. .ltop{
  215. .name{
  216. font-family: PingFang-SC, PingFang-SC;
  217. font-weight: bold;
  218. font-size: 32rpx;
  219. color: #151B29;
  220. line-height: 32rpx;
  221. }
  222. .sex{
  223. width: 44rpx;
  224. height: 32rpx;
  225. margin-left: 20rpx;
  226. }
  227. .age{
  228. border-radius: 13rpx;
  229. font-family: PingFangSC, PingFang SC;
  230. font-weight: 400;
  231. font-size: 20rpx;
  232. line-height: 24rpx;
  233. padding: 4rpx 10rpx;
  234. margin-left: 13rpx;
  235. &.women{
  236. background: rgba(244,101,122,0.14);
  237. color: #F4657A;
  238. }
  239. &.man{
  240. background: rgba(5,169,254,0.12);
  241. color: #05A9FE;
  242. }
  243. }
  244. }
  245. .lbottom{
  246. font-family: PingFangSC, PingFang SC;
  247. font-weight: 400;
  248. font-size: 24rpx;
  249. color: #989998;
  250. line-height: 24rpx;
  251. margin-top: 24rpx;
  252. }
  253. }
  254. &-right{
  255. width: 36rpx;
  256. height: 36rpx;
  257. image{
  258. width: 100%;
  259. height: 100%;
  260. }
  261. }
  262. }
  263. }
  264. &-add{
  265. width: 100%;
  266. height: 78rpx;
  267. background: rgba(112,207,82,0.08);
  268. border-radius: 24rpx;
  269. border: 1rpx dotted #70CF52;
  270. margin-top: 40rpx;
  271. image{
  272. width: 36rpx;
  273. height: 36rpx;
  274. }
  275. text{
  276. font-family: PingFang-SC, PingFang-SC;
  277. font-weight: bold;
  278. font-size: 28rpx;
  279. color: #70CF52;
  280. line-height: 40rpx;
  281. margin-left: 10rpx;
  282. }
  283. }
  284. }
  285. .box3{
  286. &-pre{
  287. padding: 36rpx 24rpx;
  288. &:first-child{
  289. box-shadow: inset 0rpx -1rpx 0rpx 0rpx #ECEEF5;
  290. }
  291. &-left{
  292. font-family: PingFangSC, PingFang SC;
  293. font-weight: 400;
  294. font-size: 30rpx;
  295. color: #151B29;
  296. line-height: 36rpx;
  297. }
  298. }
  299. }
  300. .box4{
  301. padding: 36rpx 24rpx;
  302. &-left{
  303. font-family: PingFangSC, PingFang SC;
  304. font-weight: 400;
  305. font-size: 30rpx;
  306. color: #151B29;
  307. line-height: 36rpx;
  308. }
  309. &-right{
  310. text{
  311. font-family: PingFangSC, PingFang SC;
  312. font-weight: 400;
  313. font-size: 24rpx;
  314. color: #989998;
  315. line-height: 33rpx;
  316. }
  317. image{
  318. width: 32rpx;
  319. height: 32rpx;
  320. margin-left: 20rpx;
  321. }
  322. }
  323. }
  324. .cbottom{
  325. width: 100%;
  326. position: fixed;
  327. left: 0;
  328. right: 0;
  329. bottom: 0;
  330. &-top{
  331. padding: 0 30rpx;
  332. image{
  333. width: 36rpx;
  334. height: 36rpx;
  335. }
  336. text{
  337. font-family: PingFangSC, PingFang SC;
  338. font-weight: 400;
  339. font-size: 24rpx;
  340. color: #989998;
  341. line-height: 33rpx;
  342. margin-left: 16rpx;
  343. }
  344. }
  345. &-btn{
  346. background: #FFFFFF;
  347. padding: 20rpx 30rpx 44rpx 36rpx;
  348. margin-top: 40rpx;
  349. &-left{
  350. .heart{
  351. image{
  352. width: 30rpx;
  353. height: 30rpx;
  354. }
  355. text{
  356. font-family: PingFang-SC, PingFang-SC;
  357. font-weight: bold;
  358. font-size: 36rpx;
  359. color: #F4657A;
  360. line-height: 36rpx;
  361. margin-left: 2rpx;
  362. }
  363. }
  364. .text{
  365. font-family: PingFangSC, PingFang SC;
  366. font-weight: 400;
  367. font-size: 24rpx;
  368. color: #252525;
  369. line-height: 24rpx;
  370. margin-top: 11rpx;
  371. }
  372. .free{
  373. font-family: PingFangSC, PingFang SC;
  374. font-weight: 400;
  375. font-size: 32rpx;
  376. color: #252525;
  377. line-height: 32rpx;
  378. }
  379. }
  380. &-right{
  381. width: 528rpx;
  382. height: 90rpx;
  383. background: #B7F358;
  384. border-radius: 45rpx;
  385. font-family: PingFang-SC, PingFang-SC;
  386. font-weight: bold;
  387. font-size: 32rpx;
  388. color: #151B29;
  389. line-height: 90rpx;
  390. text-align: center;
  391. letter-spacing: 2rpx;
  392. }
  393. }
  394. }
  395. }
  396. </style>