register-general.vue 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293
  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/service?id=1036&title=机构协议')">《机构协议》</text>
  19. <text @click.stop="this.$api.navigateTo('/pages/service/service?id=1023&title=用户协议')">《用户协议》</text>及
  20. <text @click.stop="this.$api.navigateTo('/pages/service/service?id=1013&title=隐私权政策')">《隐私权政策》</text>
  21. </view>
  22. </view>
  23. <view class="register-row">
  24. <view class="register-btn sub" :class="isSubLoading ? 'disabled' : ''" @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 class="register-btn sub" @tap="ShareRegister">分享</button>
  40. </view>
  41. </view>
  42. </view>
  43. <!-- 分享弹窗 -->
  44. <shareModel v-if="isShareModal" :bindId="bindId" @shareConfirm ='onShareAppMessage'></shareModel>
  45. </view>
  46. </template>
  47. <script>
  48. import shareModel from '@/components/cm-module/modelAlert/shareModel.vue' //分享弹窗
  49. export default{
  50. components:{
  51. shareModel
  52. },
  53. data() {
  54. return{
  55. isRegisterStep:true,
  56. isIphoneX:this.$store.state.isIphone,
  57. isCheck:false,
  58. clubUserId:0,
  59. isShareModal:false,
  60. bindId:0,
  61. isSubLoading:false,
  62. params:{
  63. linkMan:'',
  64. bindMobile:'',
  65. isAgreed:0,
  66. userId:0
  67. },
  68. clubInfo:{
  69. linkMan:'',
  70. bindMobile:'',
  71. userId:0
  72. }
  73. }
  74. },
  75. onLoad(option) {
  76. this.$api.getStorage().then((resolve) =>{
  77. this.params.userId = resolve.userId ? resolve.userId : 0
  78. })
  79. },
  80. computed: {
  81. },
  82. methods:{
  83. CheckMobile(){//检测手机是否能注册
  84. if( this.params.bindMobile == ''){
  85. this.$util.msg('请输入手机号',2000);
  86. return
  87. }
  88. if(!this.$reg.isMobile(this.params.bindMobile)){
  89. this.$util.msg('请输入正确的手机号',2000);
  90. return
  91. }
  92. this.SellerService.SellerClubCheck({bindMobile:this.params.bindMobile})
  93. .then(response =>{
  94. this.$util.msg(response.data,2000);
  95. })
  96. .catch(error =>{
  97. this.$util.msg(error.msg,2000);
  98. })
  99. },
  100. SubmitRegister(){//提交注册
  101. if(this.isSubLoading){ return; }
  102. if( this.params.linkMan == ''){
  103. this.$util.msg('请输入联系人姓名',2000);
  104. return
  105. }
  106. if( this.params.bindMobile == ''){
  107. this.$util.msg('请输入联系人手机号',2000);
  108. return
  109. }
  110. if(!this.$reg.isMobile(this.params.bindMobile)){
  111. this.$util.msg('手机格式不正确',2000);
  112. return
  113. }
  114. if(this.params.isAgreed == 0){
  115. this.$util.msg('请勾选同意协议',2000);
  116. return
  117. }
  118. this.isSubLoading = true;
  119. this.SellerService.SellerClubTemporary(this.params).then(response =>{
  120. this.bindId = response.data
  121. setTimeout(()=>{
  122. this.isRegisterStep = false
  123. this.isSubLoading = false;
  124. this.GetClubUserInfo(this.bindId)
  125. },1500)
  126. }).catch(error =>{
  127. this.isSubLoading = false;
  128. this.$util.msg(error.msg,2000);
  129. })
  130. },
  131. GetClubUserInfo(id){//回显数据
  132. this.UserService.UseRregisterTemporaryInfo({id:id})
  133. .then(response =>{
  134. this.clubInfo = response.data
  135. })
  136. .catch(error =>{
  137. this.$util.msg(error.msg,2000)
  138. })
  139. },
  140. ShareRegister(){//点击分享
  141. this.isShareModal = true
  142. },
  143. agreeCheck() {//勾选协议
  144. this.isCheck = !this.isCheck
  145. if(this.isCheck){
  146. this.params.isAgreed = 1
  147. }else{
  148. this.params.isAgreed = 0
  149. }
  150. },
  151. },
  152. onShareAppMessage(res){//分享转发
  153. this.isShareModal = false
  154. if (res.from === 'button') {
  155. // 来自页面内转发按钮
  156. }
  157. return {
  158. title: '请确认资料完成注册~ ',
  159. path: `/pages/login/binding?bindId=${this.bindId}&Identity=4`,
  160. imageUrl:'https://static.caimei365.com/app/img/icon/icon-addShare@3x.png'
  161. }
  162. },
  163. }
  164. </script>
  165. <style lang="scss">
  166. page{
  167. height: auto;
  168. }
  169. .register{
  170. width: 100%;
  171. position: relative;
  172. box-sizing: border-box;
  173. .register-main{
  174. width: 100%;
  175. height: auto;
  176. box-sizing: border-box;
  177. padding: 0 24rpx;
  178. margin-top: 24rpx;
  179. .main-form-item{
  180. width: 100%;
  181. height: 82rpx;
  182. box-sizing: border-box;
  183. padding: 13rpx 0;
  184. border-bottom: 1px solid #e1e1e1;
  185. margin-top: 10rpx;
  186. position: relative;
  187. .form-label{
  188. width: 148rpx;
  189. float: left;
  190. height: 100%;
  191. line-height: 56rpx;
  192. font-size: $font-size-28;
  193. text-align: left;
  194. color: #999999;
  195. }
  196. .form-input{
  197. width: 554rpx;
  198. height: 56rpx;
  199. line-height: 56rpx;
  200. font-size: $font-size-28;
  201. text-align: left;
  202. color: #333333;
  203. float: left;
  204. &.phone{
  205. width: 418rpx;
  206. }
  207. }
  208. .form-text{
  209. width: 554rpx;
  210. height: 56rpx;
  211. line-height: 56rpx;
  212. font-size: $font-size-28;
  213. text-align: left;
  214. color: #333333;
  215. float: left;
  216. }
  217. .form-btn{
  218. width: 136rpx;
  219. height: 56rpx;
  220. background: $btn-confirm;
  221. color: #FFFFFF;
  222. font-size: $font-size-28;
  223. text-align: center;
  224. border-radius: 28rpx;
  225. line-height: 56rpx;
  226. float: left;
  227. }
  228. }
  229. .register-fiexd{
  230. width: 100%;
  231. height: auto;
  232. padding: 20rpx 0;
  233. position: fixed;
  234. bottom: 0;
  235. left: 0;
  236. z-index: 9999;
  237. background: #FFFFFF;
  238. .register-agree{
  239. display: flex;
  240. flex-direction: column;
  241. align-items: center;
  242. margin: 32rpx 0;
  243. .agree-text{
  244. .checkbox{
  245. float: left;
  246. margin: 4rpx 6rpx 0 0;
  247. color: #999999;
  248. font-size: $font-size-32;
  249. &.icon-gouxuan{
  250. color: $color-system;
  251. }
  252. }
  253. font-size: 20rpx;
  254. line-height: 44rpx;
  255. color: #999999;
  256. text{
  257. color:#0091FF;
  258. }
  259. }
  260. }
  261. }
  262. .register-btn{
  263. width: 702rpx;
  264. height: 88rpx;
  265. border-radius: 44rpx;
  266. font-size: $font-size-28;
  267. line-height: 88rpx;
  268. color: #FFFFFF;
  269. margin: 0 auto;
  270. text-align: center;
  271. background: $btn-confirm;
  272. margin-top: 96rpx;
  273. &.disabled{
  274. background: #e4e8eb;
  275. color: #999999;
  276. }
  277. &.none{
  278. background: #FFFFFF;
  279. color: $text-color;
  280. margin-top: 0;
  281. }
  282. &.sub{
  283. margin-top: 0;
  284. }
  285. }
  286. }
  287. }
  288. </style>