register-general.vue 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280
  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.bindMobile }}</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" @click.stop="ShareRegister">分享</button>
  40. </view>
  41. </view>
  42. </view>
  43. </view>
  44. </template>
  45. <script>
  46. export default{
  47. data() {
  48. return{
  49. isRegisterStep:false,
  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(response.data.userId)
  114. },2000)
  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. })
  123. .catch(error =>{
  124. this.$util.msg(error.msg,2000)
  125. })
  126. },
  127. ShareRegister(res){
  128. if (res.from === 'button') { // 来自页面内转发按钮
  129. }
  130. return {
  131. title: '您已注册采美365网,请点击登录',
  132. path: `pages/login/bindOperator?clubUserId=${this.clubInfo.userId}`,
  133. imageUrl:'https://static.caimei365.com/app/img/icon/icon-addShare@3x.png'
  134. }
  135. },
  136. agreeCheck() {//勾选协议
  137. this.isCheck = !this.isCheck
  138. if(this.isCheck){
  139. this.params.isAgreed = 1
  140. }else{
  141. this.params.isAgreed = 0
  142. }
  143. },
  144. },
  145. onShareAppMessage(res){//分享转发
  146. if (res.from === 'button') { // 来自页面内转发按钮
  147. }
  148. return {
  149. title: '您已注册采美365网,请点击登录',
  150. path: `pages/login/bindOperator?clubUserId=${this.clubInfo.userId}`,
  151. imageUrl:'https://static.caimei365.com/app/img/icon/icon-addShare@3x.png'
  152. }
  153. },
  154. }
  155. </script>
  156. <style lang="scss">
  157. page{
  158. height: auto;
  159. }
  160. .register{
  161. width: 100%;
  162. position: relative;
  163. box-sizing: border-box;
  164. .register-main{
  165. width: 100%;
  166. height: auto;
  167. box-sizing: border-box;
  168. padding: 0 24rpx;
  169. margin-top: 24rpx;
  170. .main-form-item{
  171. width: 100%;
  172. height: 82rpx;
  173. box-sizing: border-box;
  174. padding: 13rpx 0;
  175. border-bottom: 1px solid #e1e1e1;
  176. margin-top: 10rpx;
  177. position: relative;
  178. .form-label{
  179. width: 148rpx;
  180. float: left;
  181. height: 100%;
  182. line-height: 56rpx;
  183. font-size: $font-size-28;
  184. text-align: left;
  185. color: #999999;
  186. }
  187. .form-input{
  188. width: 554rpx;
  189. height: 56rpx;
  190. line-height: 56rpx;
  191. font-size: $font-size-28;
  192. text-align: left;
  193. color: #333333;
  194. float: left;
  195. &.phone{
  196. width: 418rpx;
  197. }
  198. }
  199. .form-text{
  200. width: 554rpx;
  201. height: 56rpx;
  202. line-height: 56rpx;
  203. font-size: $font-size-28;
  204. text-align: left;
  205. color: #333333;
  206. float: left;
  207. }
  208. .form-btn{
  209. width: 136rpx;
  210. height: 56rpx;
  211. background: $btn-confirm;
  212. color: #FFFFFF;
  213. font-size: $font-size-28;
  214. text-align: center;
  215. border-radius: 28rpx;
  216. line-height: 56rpx;
  217. float: left;
  218. }
  219. }
  220. .register-fiexd{
  221. width: 100%;
  222. height: auto;
  223. padding: 20rpx 0;
  224. position: fixed;
  225. bottom: 0;
  226. left: 0;
  227. z-index: 9999;
  228. background: #FFFFFF;
  229. .register-agree{
  230. display: flex;
  231. flex-direction: column;
  232. align-items: center;
  233. margin: 32rpx 0;
  234. .agree-text{
  235. .checkbox{
  236. float: left;
  237. margin: 4rpx 6rpx 0 0;
  238. color: #999999;
  239. font-size: $font-size-32;
  240. &.icon-gouxuan{
  241. color: $color-system;
  242. }
  243. }
  244. font-size: 20rpx;
  245. line-height: 44rpx;
  246. color: #999999;
  247. text{
  248. color:#0091FF;
  249. }
  250. }
  251. }
  252. }
  253. .register-btn{
  254. width: 702rpx;
  255. height: 88rpx;
  256. border-radius: 44rpx;
  257. font-size: $font-size-28;
  258. line-height: 88rpx;
  259. color: #FFFFFF;
  260. margin: 0 auto;
  261. text-align: center;
  262. background: $btn-confirm;
  263. margin-top: 96rpx;
  264. &.none{
  265. background: #FFFFFF;
  266. color: $text-color;
  267. margin-top: 0;
  268. }
  269. &.sub{
  270. margin-top: 0;
  271. }
  272. }
  273. }
  274. }
  275. </style>