signUpPage.vue 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234
  1. <template>
  2. <view class="sign-up-page" v-if="!isSignStatus">
  3. <block>
  4. <view class="content-sign">
  5. <view class="sign-title">{{ dataInfo.Title }}</view>
  6. <view class="sign-info-txt">报名信息</view>
  7. <view class="sign-info">
  8. <view class="lable">姓名</view>
  9. <van-field
  10. class="input-custom-class"
  11. clearable
  12. :value="form.name"
  13. placeholder="请输入姓名"
  14. @change="inputChange('name', $event)"
  15. />
  16. <view class="lable">公司名称</view>
  17. <van-field
  18. class="input-custom-class"
  19. clearable
  20. :value="form.companyName"
  21. placeholder="请输入公司名"
  22. @change="inputChange('companyName', $event)"
  23. />
  24. <view class="lable">手机号</view>
  25. <van-field
  26. class="input-custom-class"
  27. clearable
  28. type="number"
  29. :value="form.mobile"
  30. placeholder="请输入手机号"
  31. @change="inputChange('mobile', $event)"
  32. />
  33. </view>
  34. </view>
  35. <view class="content-share-user">
  36. <view class="user-info-txt">分享人信息</view>
  37. <view class="user-item">姓名:{{ dataInfo.RealName }} </view>
  38. <view class="user-item">联系方式:{{ dataInfo.Mobile }}</view>
  39. </view>
  40. <image
  41. class="sign-up-logo"
  42. src="https://hzstatic.hzinsights.com/yb_xcx/sign-up-logo.png"
  43. ></image>
  44. <view class="sign-button">
  45. <view class="button" @click="submit">提交报名</view>
  46. </view>
  47. </block>
  48. </view>
  49. <view class="status-sign-box" v-else>
  50. <image
  51. class="sign-success"
  52. src="https://hzstatic.hzinsights.com/yb_xcx/sign-success.png"
  53. ></image>
  54. <view class="success-txt">报名成功</view>
  55. <view>对口销售会尽快联系您!</view>
  56. </view>
  57. </template>
  58. <script>
  59. import { bannerSignup } from "@/api/report";
  60. export default {
  61. data() {
  62. return {
  63. form: {
  64. name: "",
  65. companyName: "",
  66. mobile: "",
  67. },
  68. isSignStatus: false,
  69. dataInfo: {
  70. BannerId: "",
  71. CompanyName: "",
  72. Mobile: "",
  73. RealName: "",
  74. Title: "",
  75. },
  76. };
  77. },
  78. methods: {
  79. // 双向绑定输入框
  80. inputChange(key, event) {
  81. this.form[key] = event.detail;
  82. },
  83. // 提交报名信息
  84. async submit() {
  85. let params = {
  86. RealName: this.dataInfo.RealName,
  87. CompanyName: this.dataInfo.CompanyName,
  88. Mobile: this.dataInfo.Mobile,
  89. BannerId: this.dataInfo.BannerId,
  90. CustomName: this.form.name,
  91. CustomMobile: this.form.mobile,
  92. CustomCompanyName: this.form.companyName,
  93. };
  94. if (!params.CustomCompanyName) {
  95. uni.showToast({
  96. title: "请填写公司名",
  97. icon: "none",
  98. });
  99. return;
  100. }
  101. if (!params.CustomName) {
  102. uni.showToast({
  103. title: "请填写姓名",
  104. icon: "none",
  105. });
  106. return;
  107. }
  108. if (!params.CustomMobile) {
  109. uni.showToast({
  110. title: "请填写手机号",
  111. icon: "none",
  112. });
  113. return;
  114. }
  115. const res = await bannerSignup(params);
  116. if (res.code == 200) {
  117. this.isSignStatus = true;
  118. }
  119. },
  120. },
  121. onLoad(op) {
  122. this.dataInfo = op;
  123. this.dataInfo.Title = decodeURIComponent(op.Title);
  124. this.dataInfo.CompanyName = decodeURIComponent(op.CompanyName);
  125. },
  126. };
  127. </script>
  128. <style>
  129. page {
  130. padding: 0;
  131. }
  132. .input-custom-class .van-cell {
  133. border: 1rpx solid #dcdfe6;
  134. border-radius: 8rpx;
  135. margin-bottom: 40rpx;
  136. }
  137. </style>
  138. <style lang="scss" scoped>
  139. .sign-up-page {
  140. position: relative;
  141. background: #f4f5fa;
  142. padding: 70rpx 34rpx 0;
  143. height: 100vh;
  144. .content-sign {
  145. background-color: #fff;
  146. padding: 40rpx;
  147. border-radius: 16rpx;
  148. color: #333;
  149. .sign-title {
  150. width: 100%;
  151. font-size: 34rpx;
  152. font-weight: 500;
  153. text-align: center;
  154. }
  155. .sign-info-txt {
  156. font-size: 28rpx;
  157. font-weight: 500;
  158. margin: 40rpx 0 20rpx;
  159. }
  160. .sign-info {
  161. .lable {
  162. font-size: 28rpx;
  163. line-height: 36rpx;
  164. margin-bottom: 20rpx;
  165. }
  166. }
  167. }
  168. .content-share-user {
  169. margin-top: 30rpx;
  170. background-color: #fff;
  171. color: #333333;
  172. width: 100%;
  173. height: 208rpx;
  174. padding: 40rpx;
  175. border-radius: 8rpx;
  176. .user-info-txt {
  177. font-size: 28rpx;
  178. font-weight: 500;
  179. margin-bottom: 20rpx;
  180. }
  181. }
  182. .sign-up-logo {
  183. display: block;
  184. width: 588rpx;
  185. height: 305rpx;
  186. margin: 0 auto;
  187. }
  188. view {
  189. box-sizing: border-box;
  190. }
  191. .sign-button {
  192. position: sticky;
  193. left: 0;
  194. bottom: 0;
  195. display: flex;
  196. align-items: center;
  197. justify-content: center;
  198. width: calc(100% + 80rpx);
  199. margin-left: -40rpx;
  200. height: 176rpx;
  201. color: #fff;
  202. background-color: #fff;
  203. z-index: 9;
  204. .button {
  205. width: 654rpx;
  206. height: 80rpx;
  207. line-height: 80rpx;
  208. text-align: center;
  209. border-radius: 12rpx;
  210. background-color: #0052d9;
  211. }
  212. }
  213. }
  214. .status-sign-box {
  215. width: 100%;
  216. height: 100vh;
  217. background-color: #fff;
  218. padding-top: 333rpx;
  219. text-align: center;
  220. color: #333;
  221. font-size: 34rpx;
  222. font-weight: 600;
  223. .sign-success {
  224. width: 200rpx;
  225. height: 200rpx;
  226. }
  227. .success-txt {
  228. margin: 40rpx 0 50rpx;
  229. }
  230. }
  231. </style>
  232. s