registerInfo.vue 5.0 KB

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