register-general.vue 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271
  1. <template>
  2. <view class="register">
  3. <view class="register-main" v-if="isRegisterStep">
  4. <view class="main-form-item">
  5. <view class="form-label">联系人</view>
  6. <input class="form-input" type="text" name="input" v-model="params.linkMan" placeholder="请输入联系姓名" maxlength="6"/>
  7. </view>
  8. <view class="main-form-item">
  9. <view class="form-label">手机号</view>
  10. <input class="form-input phone" type="text" v-model="params.bindMobile" placeholder="请输入联系人手机号" maxlength="11"/>
  11. <view class="form-btn" @click.stop="CheckMobile()">检测</view>
  12. </view>
  13. <view class="register-fiexd clearfix" :style="{paddingBottom:isIphoneX ? '68rpx':''}">
  14. <view class="register-agree">
  15. <view class="agree-text" @tap.stop="agreeCheck()">
  16. <button class="checkbox iconfont" :class="[isCheck ?'icon-gouxuan':'icon-weigouxuan']"></button>
  17. 我已阅读并同意
  18. <text @click.stop="this.$api.navigateTo('/pages/service/organagree')">《机构协议》</text>
  19. <text @click.stop="this.$api.navigateTo('/pages/service/useragree')">《用户协议》</text>及
  20. <text @click.stop="this.$api.navigateTo('/pages/service/privacyagree')">《隐私权政策》</text>
  21. </view>
  22. </view>
  23. <view class="register-row">
  24. <view class="register-btn sub" @click.stop="SubmitRegister">确定</view>
  25. </view>
  26. </view>
  27. </view>
  28. <view class="register-main" v-else>
  29. <view class="main-form-item">
  30. <view class="form-label">联系人</view>
  31. <view class="form-text"> {{ clubInfo.linkMan }} </view>
  32. </view>
  33. <view class="main-form-item">
  34. <view class="form-label">手机号</view>
  35. <view class="form-text">{{ clubInfo.contractMobile }}</view>
  36. </view>
  37. <view class="register-fiexd clearfix" :style="{paddingBottom:isIphoneX ? '68rpx':''}">
  38. <view class="register-row">
  39. <button open-type="share" class="register-btn sub" @tap="ShareRegister">分享</button>
  40. </view>
  41. </view>
  42. </view>
  43. </view>
  44. </template>
  45. <script>
  46. export default{
  47. data() {
  48. return{
  49. isRegisterStep:true,
  50. isIphoneX:this.$store.state.isIphone,
  51. isCheck:false,
  52. clubUserId:0,
  53. params:{
  54. linkMan:'',
  55. bindMobile:'',
  56. isAgreed:0,
  57. userId:0
  58. },
  59. clubInfo:{
  60. linkMan:'',
  61. bindMobile:'',
  62. userId:0
  63. }
  64. }
  65. },
  66. onLoad(option) {
  67. this.$api.getStorage().then((resolve) =>{
  68. this.params.userId = resolve.userId ? resolve.userId : 0
  69. })
  70. },
  71. computed: {
  72. },
  73. methods:{
  74. CheckMobile(){//检测手机是否能注册
  75. if( this.params.bindMobile == ''){
  76. this.$util.msg('请输入手机号',2000);
  77. return
  78. }
  79. if(!this.$reg.isMobile(this.params.bindMobile)){
  80. this.$util.msg('请输入正确的手机号',2000);
  81. return
  82. }
  83. this.SellerService.SellerClubCheck({bindMobile:this.params.bindMobile})
  84. .then(response =>{
  85. this.$util.msg(response.data,2000);
  86. })
  87. .catch(error =>{
  88. this.$util.msg(error.msg,2000);
  89. })
  90. },
  91. SubmitRegister(){//提交注册
  92. if( this.params.linkMan == ''){
  93. this.$util.msg('请输入联系人姓名',2000);
  94. return
  95. }
  96. if( this.params.bindMobile == ''){
  97. this.$util.msg('请输入联系人手机号',2000);
  98. return
  99. }
  100. if(!this.$reg.isMobile(this.params.bindMobile)){
  101. this.$util.msg('手机格式不正确',2000);
  102. return
  103. }
  104. if(this.params.isAgreed == 0){
  105. this.$util.msg('请勾选同意协议',2000);
  106. return
  107. }
  108. this.SellerService.SellerClubRegister(this.params).then(response =>{
  109. this.$util.msg('注册成功',2000);
  110. // this.clubInfo.userId = response.data.userId
  111. setTimeout(()=>{
  112. this.isRegisterStep = false
  113. this.GetClubUserInfo(11162)
  114. },1500)
  115. }).catch(error =>{
  116. this.$util.msg(error.msg,2000);
  117. })
  118. },
  119. GetClubUserInfo(userId){
  120. this.UserService.OrganizationUpdateModifyInfo({userId:userId})
  121. .then(response =>{
  122. this.clubInfo = response.data.club
  123. })
  124. .catch(error =>{
  125. this.$util.msg(error.msg,2000)
  126. })
  127. },
  128. ShareRegister(res){
  129. if (res.from === 'button') { // 来自页面内转发按钮
  130. }
  131. return {
  132. title: '您已注册采美365网,请点击登录',
  133. path: `/pages/login/binding?userId=${this.clubInfo.userId}`,
  134. imageUrl:'https://static.caimei365.com/app/img/icon/icon-addShare@3x.png'
  135. }
  136. },
  137. agreeCheck() {//勾选协议
  138. this.isCheck = !this.isCheck
  139. if(this.isCheck){
  140. this.params.isAgreed = 1
  141. }else{
  142. this.params.isAgreed = 0
  143. }
  144. },
  145. }
  146. }
  147. </script>
  148. <style lang="scss">
  149. page{
  150. height: auto;
  151. }
  152. .register{
  153. width: 100%;
  154. position: relative;
  155. box-sizing: border-box;
  156. .register-main{
  157. width: 100%;
  158. height: auto;
  159. box-sizing: border-box;
  160. padding: 0 24rpx;
  161. margin-top: 24rpx;
  162. .main-form-item{
  163. width: 100%;
  164. height: 82rpx;
  165. box-sizing: border-box;
  166. padding: 13rpx 0;
  167. border-bottom: 1px solid #e1e1e1;
  168. margin-top: 10rpx;
  169. position: relative;
  170. .form-label{
  171. width: 148rpx;
  172. float: left;
  173. height: 100%;
  174. line-height: 56rpx;
  175. font-size: $font-size-28;
  176. text-align: left;
  177. color: #999999;
  178. }
  179. .form-input{
  180. width: 554rpx;
  181. height: 56rpx;
  182. line-height: 56rpx;
  183. font-size: $font-size-28;
  184. text-align: left;
  185. color: #333333;
  186. float: left;
  187. &.phone{
  188. width: 418rpx;
  189. }
  190. }
  191. .form-text{
  192. width: 554rpx;
  193. height: 56rpx;
  194. line-height: 56rpx;
  195. font-size: $font-size-28;
  196. text-align: left;
  197. color: #333333;
  198. float: left;
  199. }
  200. .form-btn{
  201. width: 136rpx;
  202. height: 56rpx;
  203. background: $btn-confirm;
  204. color: #FFFFFF;
  205. font-size: $font-size-28;
  206. text-align: center;
  207. border-radius: 28rpx;
  208. line-height: 56rpx;
  209. float: left;
  210. }
  211. }
  212. .register-fiexd{
  213. width: 100%;
  214. height: auto;
  215. padding: 20rpx 0;
  216. position: fixed;
  217. bottom: 0;
  218. left: 0;
  219. z-index: 9999;
  220. background: #FFFFFF;
  221. .register-agree{
  222. display: flex;
  223. flex-direction: column;
  224. align-items: center;
  225. margin: 32rpx 0;
  226. .agree-text{
  227. .checkbox{
  228. float: left;
  229. margin: 4rpx 6rpx 0 0;
  230. color: #999999;
  231. font-size: $font-size-32;
  232. &.icon-gouxuan{
  233. color: $color-system;
  234. }
  235. }
  236. font-size: 20rpx;
  237. line-height: 44rpx;
  238. color: #999999;
  239. text{
  240. color:#0091FF;
  241. }
  242. }
  243. }
  244. }
  245. .register-btn{
  246. width: 702rpx;
  247. height: 88rpx;
  248. border-radius: 44rpx;
  249. font-size: $font-size-28;
  250. line-height: 88rpx;
  251. color: #FFFFFF;
  252. margin: 0 auto;
  253. text-align: center;
  254. background: $btn-confirm;
  255. margin-top: 96rpx;
  256. &.none{
  257. background: #FFFFFF;
  258. color: $text-color;
  259. margin-top: 0;
  260. }
  261. &.sub{
  262. margin-top: 0;
  263. }
  264. }
  265. }
  266. }
  267. </style>