registerInfo.vue 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. <template>
  2. <view class="default_page" :style="{'height':h+'px', 'padding-top':mt+'px'}">
  3. <cus-header title='创衡汇教练AI智能体' bgColor="transparent" backUrl="/pages/login"></cus-header>
  4. <div class="info">
  5. <div class="info-title">邀请您填写以下基本信息</div>
  6. <div class="info-tip">以便后续为您发送问卷和报告,确保接收成功!</div>
  7. <div class="info-form">
  8. <div class="info-form-item adfacjb">
  9. <div class="info-form-item-left">您的姓名</div>
  10. <div class="info-form-item-right">
  11. <u-input v-model="dto.realName" border="none" placeholder="请填写姓名"></u-input>
  12. </div>
  13. </div>
  14. <div class="info-form-item adfacjb">
  15. <div class="info-form-item-left">您的邮箱</div>
  16. <div class="info-form-item-right">
  17. <u-input v-model="dto.email" border="none" placeholder="请填写邮箱"></u-input>
  18. </div>
  19. </div>
  20. </div>
  21. </div>
  22. <div class="zt_btn" @click="handleSubmit">提交</div>
  23. </view>
  24. </template>
  25. <script>
  26. export default {
  27. data(){
  28. return {
  29. info:null,
  30. user:null,
  31. dto:{
  32. mobile:'',
  33. realName:'',
  34. email:''
  35. }
  36. }
  37. },
  38. onLoad(options) {
  39. let params = JSON.parse(decodeURIComponent(options.params));
  40. this.info = params.info;
  41. this.user = params.user;
  42. this.dto.mobile = this.info.mobile||'';
  43. },
  44. methods:{
  45. handleSubmit(){
  46. if(!this.dto.realName) return this.$showToast('请输入姓名')
  47. if(!this.$reg.email(this.dto.email)) return this.$showToast('请输入正确的邮箱')
  48. uni.showLoading({ title:'注册提交中' });
  49. this.$api.post('/wx/register',this.dto,false).then(({data:res})=>{
  50. if(res.code!==0) return this.$showToast(res.msg)
  51. this.postRegisterRecord()
  52. })
  53. },
  54. postRegisterRecord(){
  55. this.$api.post('/core/register/record',{
  56. channelType:this.info.channelType||'',
  57. referrerId:this.info.referrerId||'',
  58. teamQuestionnaireId:this.info.teamQuestionnaireId||'',
  59. userId:this.info.userId||''
  60. },false).then(({data:res})=>{
  61. if(res.code!==0) return this.$showToast(res.msg)
  62. uni.setStorageSync('token',this.user.token);
  63. uni.setStorageSync('userInfo',JSON.stringify({
  64. id:this.user.id,
  65. gender:this.user.gender,
  66. realName:this.user.realName,
  67. mobile:this.user.mobile,
  68. headUrl:this.user.headUrl,
  69. teamId:this.user.teamId,
  70. enterpriseId:this.user.enterpriseId,
  71. enterpriseName:this.user.enterpriseName,
  72. teamName:this.user.teamName,
  73. referrerId:this.user.referrerId,
  74. teamQuestionnaireId:this.user.teamQuestionnaireId,
  75. isRegister:1
  76. }));
  77. uni.hideLoading();
  78. this.$showToast('提交成功');
  79. uni.reLaunch({
  80. url:'/pages/home'
  81. })
  82. })
  83. },
  84. checkUser(){
  85. this.$api.post('/wx/check',{
  86. channelType:this.info.channelType||'',
  87. isRegister:this.info.isRegister,
  88. referrerId:this.info.referrerId||'',
  89. teamQuestionnaireId:this.info.teamQuestionnaireId||'',
  90. userId:this.info.userId||''
  91. },false).then(({data:res})=>{
  92. if(res.code!==0) return this.$showToast(res.msg)
  93. uni.hideLoading();
  94. console.log(res);
  95. })
  96. },
  97. }
  98. }
  99. </script>
  100. <style scoped lang="scss">
  101. ::v-deep .u-input__content__field-wrapper__field{
  102. font-size: 28rpx !important;
  103. line-height: 40rpx !important;
  104. text-align: right !important;
  105. }
  106. .default_page{
  107. padding: 0 30rpx;
  108. background: url('https://gitee.com/hw_0302/chuang-heng-wechat-images/raw/master/info_bg.png') no-repeat;
  109. background-repeat: no-repeat;
  110. background-size: 100% 100%;
  111. .info{
  112. width: 100%;
  113. margin-top: 88rpx;
  114. padding: 0 18rpx;
  115. box-sizing: border-box;
  116. &-title{
  117. font-family: PingFang-SC, PingFang-SC;
  118. font-weight: bold;
  119. font-size: 42rpx;
  120. color: #002846;
  121. line-height: 42rpx;
  122. }
  123. &-tip{
  124. font-family: PingFangSC, PingFang SC;
  125. font-weight: 400;
  126. font-size: 26rpx;
  127. color: #667E90;
  128. line-height: 40rpx;
  129. margin-top: 24rpx;
  130. }
  131. &-form{
  132. width: 100%;
  133. background: #FFFFFF;
  134. border-radius: 24rpx;
  135. margin-top: 60rpx;
  136. padding: 0 24rpx;
  137. box-sizing: border-box;
  138. &-item{
  139. border-bottom: 1rpx solid #EFEFEF;
  140. padding: 39rpx 0;
  141. &:last-child{
  142. border: none;
  143. }
  144. &-left{
  145. width: 160rpx;
  146. font-family: PingFang-SC, PingFang-SC;
  147. font-weight: bold;
  148. font-size: 30rpx;
  149. color: #002846;
  150. line-height: 42rpx;
  151. }
  152. &-right{
  153. width: calc(100% - 160rpx);
  154. }
  155. }
  156. }
  157. }
  158. .zt_btn{
  159. margin-top: 390rpx;
  160. }
  161. }
  162. </style>