registerInfo.vue 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  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.dto.realName,
  69. email:this.dto.email,
  70. mobile:this.user.mobile,
  71. headUrl:this.user.headUrl,
  72. teamId:this.user.teamId,
  73. enterpriseId:this.user.enterpriseId,
  74. enterpriseName:this.user.enterpriseName,
  75. teamName:this.user.teamName,
  76. referrerId:this.user.referrerId,
  77. teamQuestionnaireId:this.user.teamQuestionnaireId,
  78. isRegister:1
  79. }));
  80. uni.hideLoading();
  81. this.$showToast('提交成功');
  82. uni.reLaunch({
  83. url:'/pages/home'
  84. })
  85. })
  86. },
  87. checkUser(){
  88. this.$api.post('/wx/check',{
  89. channelType:this.info.channelType||'',
  90. isRegister:this.info.isRegister,
  91. referrerId:this.info.referrerId||'',
  92. teamQuestionnaireId:this.info.teamQuestionnaireId||'',
  93. userId:this.info.userId||''
  94. },false).then(({data:res})=>{
  95. if(res.code!==0) return this.$showToast(res.msg)
  96. uni.hideLoading();
  97. console.log(res);
  98. })
  99. },
  100. }
  101. }
  102. </script>
  103. <style scoped lang="scss">
  104. ::v-deep .u-input__content__field-wrapper__field{
  105. font-size: 28rpx !important;
  106. line-height: 40rpx !important;
  107. text-align: right !important;
  108. }
  109. .default_page{
  110. padding: 0 30rpx;
  111. background: url('https://gitee.com/hw_0302/chuang-heng-wechat-images/raw/master/info_bg.png') no-repeat;
  112. background-repeat: no-repeat;
  113. background-size: 100% 100%;
  114. .info{
  115. width: 100%;
  116. margin-top: 88rpx;
  117. padding: 0 18rpx;
  118. box-sizing: border-box;
  119. &-title{
  120. font-family: PingFang-SC, PingFang-SC;
  121. font-weight: bold;
  122. font-size: 42rpx;
  123. color: #002846;
  124. line-height: 42rpx;
  125. }
  126. &-tip{
  127. font-family: PingFangSC, PingFang SC;
  128. font-weight: 400;
  129. font-size: 26rpx;
  130. color: #667E90;
  131. line-height: 40rpx;
  132. margin-top: 24rpx;
  133. }
  134. &-form{
  135. width: 100%;
  136. background: #FFFFFF;
  137. border-radius: 24rpx;
  138. margin-top: 60rpx;
  139. padding: 0 24rpx;
  140. box-sizing: border-box;
  141. &-item{
  142. border-bottom: 1rpx solid #EFEFEF;
  143. padding: 39rpx 0;
  144. &:last-child{
  145. border: none;
  146. }
  147. &-left{
  148. width: 160rpx;
  149. font-family: PingFang-SC, PingFang-SC;
  150. font-weight: bold;
  151. font-size: 30rpx;
  152. color: #002846;
  153. line-height: 42rpx;
  154. }
  155. &-right{
  156. width: calc(100% - 160rpx);
  157. }
  158. }
  159. }
  160. }
  161. .zt_btn{
  162. margin-top: 390rpx;
  163. }
  164. }
  165. </style>