registerInfo.vue 5.0 KB

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