applicationInfo.vue 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  1. <template>
  2. <div class="applicationInfo">
  3. <div class="applicationBox">
  4. <div class="applicationInfoTitle">请填写报名信息</div>
  5. <ul class="appInfoBox">
  6. <li class="appInfoLi">
  7. <span class="appInfoLiTitle">
  8. <span class="redDoll">*</span>
  9. <span class="liName">公司名称</span>
  10. </span>
  11. <input type="text" name="" id="" v-model="form.companyName" class="appInfoIpt" placeholder="请输入">
  12. </li>
  13. <li class="appInfoLi">
  14. <span class="appInfoLiTitle">
  15. <span class="redDoll">*</span>
  16. <span class="liName">参与人姓名</span>
  17. </span>
  18. <input type="text" name="" id="" v-model="form.name" class="appInfoIpt" placeholder="请输入">
  19. </li>
  20. <li class="appInfoLi">
  21. <span class="appInfoLiTitle">
  22. <span class="redDoll">*</span>
  23. <span class="liName">参与人职位</span>
  24. </span>
  25. <input type="text" name="" id="" v-model="form.position" class="appInfoIpt" placeholder="请输入">
  26. </li>
  27. <li class="appInfoLi">
  28. <span class="appInfoLiTitle">
  29. <span class="redDoll">*</span>
  30. <span class="liName">联系手机</span>
  31. </span>
  32. <input type="text" name="" id="" v-model="form.phone" class="appInfoIpt" placeholder="请输入">
  33. </li>
  34. <li class="appInfoLi" style="border: none;flex-direction: column;align-items: start">
  35. <span class="appInfoLiTitle">
  36. <span class="liName">说明</span>
  37. </span>
  38. <van-field
  39. :value="form.remark"
  40. autosize
  41. type="textarea"
  42. placeholder="请输入说明"
  43. class="appInfoIpt"
  44. maxlength="800"
  45. />
  46. </li>
  47. </ul>
  48. </div>
  49. <button v-show="!registrationFlag" class="bmBtn" @tap="submit">提交报名</button>
  50. </div>
  51. </template>
  52. <script>
  53. import { updateRegistration,getUserLocalStorageInfo } from "@/js_sdk/http";
  54. import {getRegistrationInfo} from "../../../js_sdk/http";
  55. export default {
  56. name: "applicationInfo",
  57. data(){
  58. return{
  59. getUserLocalStorageInfo: getUserLocalStorageInfo(),
  60. value:'',
  61. activityId: '',
  62. form:{
  63. companyId: getUserLocalStorageInfo().userId,
  64. companyName: getUserLocalStorageInfo().username,
  65. },
  66. registrationFlag: false
  67. }
  68. },
  69. onLoad(options){
  70. this.activityId = options.activityId
  71. // this.registrationFlag = options.registrationFlag
  72. switch (options.registrationFlag) {
  73. case 'true':
  74. this.registrationFlag = true
  75. break;
  76. case 'false':
  77. this.registrationFlag = false
  78. break;
  79. default:
  80. this.registrationFlag = options.registrationFlag // 或者你可以根据需要返回false或其他值
  81. }
  82. console.log('this.registrationFlag',typeof options.registrationFlag)
  83. // 如果已报名则回显
  84. if(this.registrationFlag){
  85. this.getById()
  86. }
  87. },
  88. methods:{
  89. getById(){
  90. const data = {
  91. activityId: this.activityId,
  92. companyId: getUserLocalStorageInfo().userId,
  93. }
  94. getRegistrationInfo(data).then((res)=>{
  95. this.form = res.data
  96. })
  97. },
  98. submit(e){
  99. this.form.communityActivityId = this.activityId
  100. updateRegistration(this.form).then((res) => {
  101. if (res.errno === 0){
  102. uni.showToast({
  103. title: '报名成功',
  104. icon: 'success',
  105. mask: true,
  106. duration: 1000
  107. });
  108. uni.navigateBack({
  109. })
  110. }else {
  111. uni.showToast({
  112. title: res.msg,
  113. icon: 'success',
  114. mask: true,
  115. duration: 1000
  116. });
  117. }
  118. })
  119. },
  120. }
  121. }
  122. </script>
  123. <style lang="scss">
  124. .applicationInfo{
  125. padding-bottom: 120rpx;
  126. .applicationBox{
  127. background: white;
  128. margin-top: 24rpx;
  129. padding: 32rpx;
  130. }
  131. .applicationInfoTitle{
  132. color:#222222;
  133. font-size: 36rpx;
  134. font-weight: 600;
  135. }
  136. .appInfoBox{
  137. margin: 16rpx 0;
  138. .appInfoLi{
  139. padding: 32rpx 0;
  140. display: flex;
  141. justify-content: space-between;
  142. align-items: center;
  143. border-bottom: 1px solid #E6E6E6;
  144. .appInfoLiTitle{
  145. display: flex;
  146. align-items: center;
  147. .redDoll{
  148. color: red;
  149. margin-right: 5rpx;
  150. }
  151. .liName{
  152. color: #333333;
  153. font-size: 32rpx;
  154. }
  155. }
  156. .appInfoIpt{
  157. width: 400rpx;
  158. font-size: 32rpx;
  159. color: #666666;
  160. text-align: right;
  161. }
  162. .van-cell {
  163. background: #F5F7FA !important;
  164. border-radius: 8rpx;
  165. font-size: 28rpx;
  166. width: 686rpx;
  167. margin: 24rpx 0;
  168. }
  169. }
  170. }
  171. .bmBtn{
  172. width: 654rpx;
  173. height: 96rpx;
  174. display: flex;
  175. align-items: center;
  176. justify-content: center;
  177. color: white;
  178. background: #0365F9;
  179. border-radius: 8rpx;
  180. margin: 48rpx 48rpx 0rpx 48rpx;
  181. }
  182. }
  183. </style>