becomeSale.vue 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205
  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/manageCompany.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. loginPage = '/pages_manage/login';
  108. uni.navigateTo({
  109. url:loginPage
  110. })
  111. }
  112. }
  113. }
  114. </script>
  115. <style lang="scss" scoped>
  116. .VIPvie {
  117. width: 580rpx;
  118. background: linear-gradient(to bottom, #c3dbfe 2%, #f6fbfe 50%);
  119. border-radius: 20rpx;
  120. height: 640rpx;
  121. position: relative;
  122. image {
  123. position: absolute;
  124. top: -120rpx;
  125. left: 16%;
  126. }
  127. }
  128. .login{
  129. width: 100%;
  130. padding: 30rpx 50rpx;
  131. .login-item{
  132. margin-bottom: 30rpx;
  133. text-align: left;
  134. .input-account{
  135. margin-top: 20rpx;
  136. margin-bottom: 20rpx;
  137. border-radius:40rpx;
  138. border:solid 1rpx #e4e4e4;
  139. height: 80rpx;
  140. width: 100%;
  141. background:url('/static/account.png') no-repeat 0 center;
  142. background-size: 30rpx 30rpx;
  143. background-position: 30rpx;
  144. input{
  145. margin-left: 80rpx;
  146. height: 80rpx;
  147. line-height: 80rpx
  148. }
  149. }
  150. .input-pwd{
  151. margin-top: 20rpx;
  152. margin-bottom: 20rpx;
  153. border-radius:40rpx;
  154. border:solid 1rpx #e4e4e4;
  155. height: 80rpx;
  156. width: 100%;
  157. background:url('/static/password.png') no-repeat 0 center;
  158. background-size: 30rpx 30rpx;
  159. background-position: 30rpx;
  160. input{
  161. margin-left: 80rpx;
  162. height: 80rpx;
  163. line-height: 80rpx
  164. }
  165. }
  166. .input-phone{
  167. background:url('https://fbylive.obs.cn-southwest-2.myhuaweicloud.com/app/manergevip/companyphone.png') no-repeat 0 center;
  168. background-size: 40rpx 40rpx;
  169. background-position: 24rpx;
  170. }
  171. }
  172. .btns{
  173. margin: 60rpx 0rpx;
  174. .login-btn {
  175. display: flex;
  176. align-items: center;
  177. justify-content: center;
  178. width: 100%;
  179. height: 80rpx;
  180. // background: linear-gradient(to bottom, #cfe3ff, #cabbfd);
  181. background: #5c82ff;
  182. box-shadow: 0px 7rpx 6rpx 0px rgba(0, 0, 0, 0.2);
  183. border-radius: 40rpx;
  184. font-size: 30rpx;
  185. // font-family: PingFang SC;
  186. font-weight: 500;
  187. color: rgba(255, 255, 255, 1.0);
  188. }
  189. }
  190. }
  191. .gologin{
  192. color: #80b9ff;
  193. margin-top: 40rpx;
  194. border: #80b9ff solid 2rpx;
  195. padding:10rpx 30rpx;
  196. font-size: 24rpx;
  197. border-radius: 40rpx;
  198. margin-bottom: 20rpx;
  199. }
  200. </style>