becomeSale.vue 4.9 KB

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