applicationInfo.vue 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  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-if="!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. // 如果已报名则回显
  73. if(this.registrationFlag){
  74. this.getById()
  75. }
  76. },
  77. methods:{
  78. getById(){
  79. const data = {
  80. activityId: this.activityId,
  81. companyId: getUserLocalStorageInfo().userId,
  82. }
  83. getRegistrationInfo(data).then((res)=>{
  84. this.form = res.data
  85. })
  86. },
  87. submit(e){
  88. this.form.communityActivityId = this.activityId
  89. updateRegistration(this.form).then((res) => {
  90. if (res.errno === 0){
  91. uni.showToast({
  92. title: '报名成功',
  93. icon: 'success',
  94. mask: true,
  95. duration: 1000
  96. });
  97. uni.navigateBack({
  98. })
  99. }else {
  100. uni.showToast({
  101. title: res.msg,
  102. icon: 'success',
  103. mask: true,
  104. duration: 1000
  105. });
  106. }
  107. })
  108. },
  109. }
  110. }
  111. </script>
  112. <style lang="scss">
  113. .applicationInfo{
  114. padding-bottom: 120rpx;
  115. .applicationBox{
  116. background: white;
  117. margin-top: 24rpx;
  118. padding: 32rpx;
  119. }
  120. .applicationInfoTitle{
  121. color:#222222;
  122. font-size: 36rpx;
  123. font-weight: 600;
  124. }
  125. .appInfoBox{
  126. margin: 16rpx 0;
  127. .appInfoLi{
  128. padding: 32rpx 0;
  129. display: flex;
  130. justify-content: space-between;
  131. align-items: center;
  132. border-bottom: 1px solid #E6E6E6;
  133. .appInfoLiTitle{
  134. display: flex;
  135. align-items: center;
  136. .redDoll{
  137. color: red;
  138. margin-right: 5rpx;
  139. }
  140. .liName{
  141. color: #333333;
  142. font-size: 32rpx;
  143. }
  144. }
  145. .appInfoIpt{
  146. width: 400rpx;
  147. font-size: 32rpx;
  148. color: #666666;
  149. text-align: right;
  150. }
  151. .van-cell {
  152. background: #F5F7FA !important;
  153. border-radius: 8rpx;
  154. font-size: 28rpx;
  155. width: 686rpx;
  156. margin: 24rpx 0;
  157. }
  158. }
  159. }
  160. .bmBtn{
  161. width: 654rpx;
  162. height: 96rpx;
  163. display: flex;
  164. align-items: center;
  165. justify-content: center;
  166. color: white;
  167. background: #0365F9;
  168. border-radius: 8rpx;
  169. margin: 48rpx 48rpx 0rpx 48rpx;
  170. }
  171. }
  172. </style>