registerInfo.vue 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  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. userId:'',
  33. mobile:'',
  34. realName:'',
  35. email:''
  36. }
  37. }
  38. },
  39. onLoad(options) {
  40. let params = JSON.parse(decodeURIComponent(options.params));
  41. this.info = params.info;
  42. this.user = params.user;
  43. this.dto.userId = this.info.userId||'';
  44. this.dto.mobile = this.info.mobile||'';
  45. },
  46. methods:{
  47. handleSubmit(){
  48. if(!this.dto.realName) return this.$showToast('请输入姓名')
  49. if(!this.$reg.email(this.dto.email)) return this.$showToast('请输入正确的邮箱')
  50. uni.showLoading({ title:'注册提交中' });
  51. this.$api.post('/wx/register',this.dto,false).then(({data:res})=>{
  52. if(res.code!==0) return this.$showToast(res.msg)
  53. this.postRegisterRecord()
  54. })
  55. },
  56. postRegisterRecord(){
  57. this.$api.post('/core/register/record',{
  58. channelType:this.info.channelType||'common',
  59. referrerId:this.info.referrerId||'',
  60. teamQuestionnaireId:this.info.teamQuestionnaireId||'',
  61. userId:this.info.userId||''
  62. },false).then(({data:res})=>{
  63. if(res.code!==0) return this.$showToast(res.msg)
  64. uni.setStorageSync('token',this.user.token);
  65. uni.setStorageSync('userInfo',JSON.stringify({
  66. id:this.user.id,
  67. gender:this.user.gender,
  68. realName:this.user.realName,
  69. mobile:this.user.mobile,
  70. headUrl:this.user.headUrl,
  71. teamId:this.user.teamId,
  72. enterpriseId:this.user.enterpriseId,
  73. enterpriseName:this.user.enterpriseName,
  74. teamName:this.user.teamName,
  75. referrerId:this.user.referrerId,
  76. teamQuestionnaireId:this.user.teamQuestionnaireId,
  77. isRegister:1
  78. }));
  79. uni.hideLoading();
  80. this.$showToast('提交成功');
  81. uni.reLaunch({
  82. url:'/pages/home'
  83. })
  84. })
  85. },
  86. checkUser(){
  87. this.$api.post('/wx/check',{
  88. channelType:this.info.channelType||'',
  89. isRegister:this.info.isRegister,
  90. referrerId:this.info.referrerId||'',
  91. teamQuestionnaireId:this.info.teamQuestionnaireId||'',
  92. userId:this.info.userId||''
  93. },false).then(({data:res})=>{
  94. if(res.code!==0) return this.$showToast(res.msg)
  95. uni.hideLoading();
  96. console.log(res);
  97. })
  98. },
  99. }
  100. }
  101. </script>
  102. <style scoped lang="scss">
  103. ::v-deep .u-input__content__field-wrapper__field{
  104. font-size: 28rpx !important;
  105. line-height: 40rpx !important;
  106. text-align: right !important;
  107. }
  108. .default_page{
  109. padding: 0 30rpx;
  110. background: url('https://gitee.com/hw_0302/chuang-heng-wechat-images/raw/master/info_bg.png') no-repeat;
  111. background-repeat: no-repeat;
  112. background-size: 100% 100%;
  113. .info{
  114. width: 100%;
  115. margin-top: 88rpx;
  116. padding: 0 18rpx;
  117. box-sizing: border-box;
  118. &-title{
  119. font-family: PingFang-SC, PingFang-SC;
  120. font-weight: bold;
  121. font-size: 42rpx;
  122. color: #002846;
  123. line-height: 42rpx;
  124. }
  125. &-tip{
  126. font-family: PingFangSC, PingFang SC;
  127. font-weight: 400;
  128. font-size: 26rpx;
  129. color: #667E90;
  130. line-height: 40rpx;
  131. margin-top: 24rpx;
  132. }
  133. &-form{
  134. width: 100%;
  135. background: #FFFFFF;
  136. border-radius: 24rpx;
  137. margin-top: 60rpx;
  138. padding: 0 24rpx;
  139. box-sizing: border-box;
  140. &-item{
  141. border-bottom: 1rpx solid #EFEFEF;
  142. padding: 39rpx 0;
  143. &:last-child{
  144. border: none;
  145. }
  146. &-left{
  147. width: 160rpx;
  148. font-family: PingFang-SC, PingFang-SC;
  149. font-weight: bold;
  150. font-size: 30rpx;
  151. color: #002846;
  152. line-height: 42rpx;
  153. }
  154. &-right{
  155. width: calc(100% - 160rpx);
  156. }
  157. }
  158. }
  159. }
  160. .zt_btn{
  161. margin-top: 390rpx;
  162. }
  163. }
  164. </style>