becomeSale.vue 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208
  1. <template>
  2. <view class="centerV hb base-bg-f plr40" >
  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. companyUserId:''
  51. }
  52. },
  53. computed: {
  54. imgPath() {
  55. return this.$store.state.imgpath
  56. },
  57. },
  58. onLoad(option) {
  59. this.companyId = option.id
  60. this.companyUserId=option.companyUserId
  61. },
  62. methods: {
  63. close() {},
  64. open() {},
  65. login(){
  66. const data={
  67. companyId:this.companyId,
  68. phoneNumber:this.phoneNumber,
  69. nickName:this.nickName,
  70. password:this.password,
  71. companyUserId:this.companyUserId
  72. }
  73. if(this.phoneNumber==''){
  74. uni.showToast({ title: '请输入手机号!', icon: 'none' });
  75. return
  76. }
  77. if(this.nickName==''){
  78. uni.showToast({ title: '请输入名字!', icon: 'none' });
  79. return
  80. }
  81. if(this.password==''){
  82. uni.showToast({ title: '请输入密码!', icon: 'none' });
  83. return
  84. }
  85. if(!uni.$u.test.mobile(this.phoneNumber)){
  86. uni.showToast({ title: '请输入正确的手机号码!', icon: 'none' });
  87. return
  88. }
  89. loginsales(data).then(res=>{
  90. console.log(res)
  91. if(res.code==200){
  92. this.showvip=true
  93. this.tips='恭喜账户注册成功'
  94. uni.showToast({
  95. title: '注册成功',
  96. icon: 'none',
  97. });
  98. }else{
  99. uni.showToast({
  100. title: res.msg,
  101. icon: 'none',
  102. duration: 2000
  103. });
  104. }
  105. })
  106. },
  107. loginNav(){
  108. // 条件编译判断平台,设置不同登录页路径
  109. let loginPage = '';
  110. loginPage = '/pages_manage/login';
  111. uni.navigateTo({
  112. url:loginPage
  113. })
  114. }
  115. }
  116. }
  117. </script>
  118. <style lang="scss" scoped>
  119. .VIPvie {
  120. width: 580rpx;
  121. background: linear-gradient(to bottom, #c3dbfe 2%, #f6fbfe 50%);
  122. border-radius: 20rpx;
  123. height: 640rpx;
  124. position: relative;
  125. image {
  126. position: absolute;
  127. top: -120rpx;
  128. left: 16%;
  129. }
  130. }
  131. .login{
  132. width: 100%;
  133. padding: 30rpx 50rpx;
  134. .login-item{
  135. margin-bottom: 30rpx;
  136. text-align: left;
  137. .input-account{
  138. margin-top: 20rpx;
  139. margin-bottom: 20rpx;
  140. border-radius:40rpx;
  141. border:solid 1rpx #e4e4e4;
  142. height: 80rpx;
  143. width: 100%;
  144. background:url('/static/account.png') no-repeat 0 center;
  145. background-size: 30rpx 30rpx;
  146. background-position: 30rpx;
  147. input{
  148. margin-left: 80rpx;
  149. height: 80rpx;
  150. line-height: 80rpx
  151. }
  152. }
  153. .input-pwd{
  154. margin-top: 20rpx;
  155. margin-bottom: 20rpx;
  156. border-radius:40rpx;
  157. border:solid 1rpx #e4e4e4;
  158. height: 80rpx;
  159. width: 100%;
  160. background:url('/static/password.png') no-repeat 0 center;
  161. background-size: 30rpx 30rpx;
  162. background-position: 30rpx;
  163. input{
  164. margin-left: 80rpx;
  165. height: 80rpx;
  166. line-height: 80rpx
  167. }
  168. }
  169. .input-phone{
  170. background:url('https://fbylive.obs.cn-southwest-2.myhuaweicloud.com/app/manergevip/companyphone.png') no-repeat 0 center;
  171. background-size: 40rpx 40rpx;
  172. background-position: 24rpx;
  173. }
  174. }
  175. .btns{
  176. margin: 60rpx 0rpx;
  177. .login-btn {
  178. display: flex;
  179. align-items: center;
  180. justify-content: center;
  181. width: 100%;
  182. height: 80rpx;
  183. // background: linear-gradient(to bottom, #cfe3ff, #cabbfd);
  184. background: #5c82ff;
  185. box-shadow: 0px 7rpx 6rpx 0px rgba(0, 0, 0, 0.2);
  186. border-radius: 40rpx;
  187. font-size: 30rpx;
  188. // font-family: PingFang SC;
  189. font-weight: 500;
  190. color: rgba(255, 255, 255, 1.0);
  191. }
  192. }
  193. }
  194. .gologin{
  195. color: #80b9ff;
  196. margin-top: 40rpx;
  197. border: #80b9ff solid 2rpx;
  198. padding:10rpx 30rpx;
  199. font-size: 24rpx;
  200. border-radius: 40rpx;
  201. margin-bottom: 20rpx;
  202. }
  203. </style>