register-general.vue 7.1 KB

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