becomeSale.vue 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  1. <template>
  2. <view class="centerV hb base-bg-f">
  3. <image :src="imgPath+'/app/image/logo.png'" mode="aspectFit" class="w400"></image>
  4. <view class="fs48 bold mt30">注册账户</view>
  5. <view class="login">
  6. <view class="login-item">
  7. <view class="input-pwd input-phone">
  8. <input v-model="phoneNumber" maxlength="11"
  9. placeholder="请输入电话号码" type="number" ></input>
  10. </view>
  11. </view>
  12. <view class="login-item">
  13. <view class="input-account">
  14. <input v-model="nickName"
  15. placeholder="请输入名字" type="text" ></input>
  16. </view>
  17. </view>
  18. <view class="login-item">
  19. <!-- <text>密码</text> -->
  20. <view class="input-pwd">
  21. <input v-model="password" maxlength="16"
  22. placeholder="请输入密码" type="password" ></input>
  23. </view>
  24. </view>
  25. <view class="btns">
  26. <view class="login-btn" @click="login">注册账号</view>
  27. </view>
  28. </view>
  29. <u-popup :show="showvip" @close="close" @open="open"
  30. mode='center' round='20' style="flex: 0;" >
  31. <view class="VIPvie w600 h600 column justify-center align-center">
  32. <image :src="imgPath+'/app/manergevip/becomeTrue.png'" class="h400 w400"></image>
  33. <view class="bold fs50 center mt100">{{tips}}!</view>
  34. <view class="gologin" @click="loginNav">去登录</view>
  35. </view>
  36. </u-popup>
  37. </view>
  38. </template>
  39. <script>
  40. import { loginsales } from '@/api/courseManage.js'
  41. export default {
  42. data() {
  43. return {
  44. tips:'',
  45. showvip:false,
  46. companyId:'',
  47. phoneNumber:'',
  48. nickName:'',
  49. password:''
  50. }
  51. },
  52. computed: {
  53. imgPath() {
  54. return this.$store.state.imgpath
  55. },
  56. },
  57. onLoad(option) {
  58. this.companyId = option.id
  59. },
  60. methods: {
  61. close() {},
  62. open() {},
  63. login(){
  64. const data={
  65. companyId:this.companyId,
  66. phoneNumber:this.phoneNumber,
  67. nickName:this.nickName,
  68. password:this.password
  69. }
  70. if(this.phoneNumber==''){
  71. uni.showToast({ title: '请输入手机号!', icon: 'none' });
  72. return
  73. }
  74. if(this.nickName==''){
  75. uni.showToast({ title: '请输入名字!', icon: 'none' });
  76. return
  77. }
  78. if(this.password==''){
  79. uni.showToast({ title: '请输入密码!', icon: 'none' });
  80. return
  81. }
  82. if(!uni.$u.test.mobile(this.phoneNumber)){
  83. uni.showToast({ title: '请输入正确的手机号码!', icon: 'none' });
  84. return
  85. }
  86. loginsales(data).then(res=>{
  87. console.log(res)
  88. if(res.code==200){
  89. this.showvip=true
  90. this.tips='恭喜账户注册成功'
  91. uni.showToast({
  92. title: '注册成功',
  93. icon: 'none',
  94. });
  95. }else{
  96. uni.showToast({
  97. title: res.msg,
  98. icon: 'none',
  99. duration: 2000
  100. });
  101. }
  102. })
  103. },
  104. loginNav(){
  105. // 条件编译判断平台,设置不同登录页路径
  106. let loginPage = '';
  107. // #ifdef H5
  108. loginPage = '/pages/auth/login';
  109. // #endif
  110. // #ifdef MP-WEIXIN
  111. loginPage = '/pages/auth/wxlogin';
  112. // #endif
  113. uni.navigateTo({
  114. url:loginPage
  115. })
  116. }
  117. }
  118. }
  119. </script>
  120. <style lang="scss" scoped>
  121. .VIPvie {
  122. width: 580rpx;
  123. background: linear-gradient(to bottom, #c3dbfe 2%, #f6fbfe 50%);
  124. border-radius: 20rpx;
  125. height: 640rpx;
  126. position: relative;
  127. image {
  128. position: absolute;
  129. top: -120rpx;
  130. left: 16%;
  131. }
  132. }
  133. .login{
  134. width: 100%;
  135. padding: 30rpx 50rpx;
  136. .login-item{
  137. margin-bottom: 30rpx;
  138. text-align: left;
  139. .input-account{
  140. margin-top: 20rpx;
  141. margin-bottom: 20rpx;
  142. border-radius:40rpx;
  143. border:solid 1rpx #e4e4e4;
  144. height: 80rpx;
  145. width: 100%;
  146. background:url('/static/account.png') no-repeat 0 center;
  147. background-size: 30rpx 30rpx;
  148. background-position: 30rpx;
  149. input{
  150. margin-left: 80rpx;
  151. height: 80rpx;
  152. line-height: 80rpx
  153. }
  154. }
  155. .input-pwd{
  156. margin-top: 20rpx;
  157. margin-bottom: 20rpx;
  158. border-radius:40rpx;
  159. border:solid 1rpx #e4e4e4;
  160. height: 80rpx;
  161. width: 100%;
  162. background:url('/static/password.png') no-repeat 0 center;
  163. background-size: 30rpx 30rpx;
  164. background-position: 30rpx;
  165. input{
  166. margin-left: 80rpx;
  167. height: 80rpx;
  168. line-height: 80rpx
  169. }
  170. }
  171. .input-phone{
  172. background:url('https://fbylive.obs.cn-southwest-2.myhuaweicloud.com:443/app/manergevip/companyphone.png') no-repeat 0 center;
  173. background-size: 40rpx 40rpx;
  174. background-position: 24rpx;
  175. }
  176. }
  177. .btns{
  178. margin: 60rpx 0rpx;
  179. .login-btn {
  180. display: flex;
  181. align-items: center;
  182. justify-content: center;
  183. width: 100%;
  184. height: 80rpx;
  185. // background: linear-gradient(to bottom, #cfe3ff, #cabbfd);
  186. background: #5c82ff;
  187. box-shadow: 0px 7rpx 6rpx 0px rgba(0, 0, 0, 0.2);
  188. border-radius: 40rpx;
  189. font-size: 30rpx;
  190. font-family: PingFang SC;
  191. font-weight: 500;
  192. color: rgba(255, 255, 255, 1.0);
  193. }
  194. }
  195. }
  196. .gologin{
  197. color: #80b9ff;
  198. margin-top: 40rpx;
  199. border: #80b9ff solid 2rpx;
  200. padding:10rpx 30rpx;
  201. font-size: 24rpx;
  202. border-radius: 40rpx;
  203. margin-bottom: 20rpx;
  204. }
  205. </style>