多租户商城-商户小程序端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

193 lines
4.1 KiB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
  1. <template>
  2. <!-- 登录 -->
  3. <view class="container flex-items-plus flex-column">
  4. <global-loading />
  5. <view class="login-logoBox">
  6. <image class="login-logo" src="http://36.138.125.206:8081/ceres-local-file/static/images/loginLogo.png"></image>
  7. </view>
  8. <view class="iphoneNum-box flex-row-plus flex-items">
  9. <view style="margin-right: 30rpx">
  10. <image class="loginIcon" src="http://36.138.125.206:8081/ceres-local-file/static/images/phone.png"></image>
  11. </view>
  12. <view>
  13. <input v-model="userInfo.phone" maxlength="11" placeholder-class="iphoneNum-input" type="number" disabled
  14. :placeholder="$t('common.entermobilephone')" />
  15. </view>
  16. </view>
  17. <view class="flex-row-plus mar-top-20">
  18. <view class="code-box">
  19. <view style="margin-right: 30rpx">
  20. <image class="loginIcon" src="http://36.138.125.206:8081/ceres-local-file/static/images/code.png"></image>
  21. </view>
  22. <view>
  23. <input v-model="code" maxlength="6" placeholder-class="codeNum-input" :placeholder="$t('common.enterverificationcode')" />
  24. </view>
  25. </view>
  26. <view :class="disabled === true ? 'on' : ''" :disabled="disabled" class="getcode" @click="codede">{{text}}
  27. </view>
  28. </view>
  29. <view class="mar-top-60">
  30. <view class="registerBut mar-top-100" @click="unsubscribe">{{$t('common.unsubscribe')}}</view>
  31. </view>
  32. </view>
  33. </template>
  34. <script>
  35. import sendVerifyCode from "@/mixins/SendVerifyCode";
  36. const NET = require('../../utils/request')
  37. const API = require('../../config/api')
  38. export default {
  39. data() {
  40. return {
  41. code: '',
  42. userInfo: {}
  43. }
  44. },
  45. mixins: [sendVerifyCode],
  46. onLoad() {
  47. this.userInfo = uni.getStorageSync('storage_userInfo')
  48. },
  49. methods: {
  50. // 获取验证码
  51. codede() {
  52. this.getVerify()
  53. },
  54. getVerify() {
  55. NET.request(API.Verify, {
  56. phone: this.userInfo.phone,
  57. }, 'GET').then(res => {
  58. this.sendCode()
  59. }).catch(res => {
  60. uni.showToast({
  61. title: res.data.message,
  62. duration: 1000,
  63. icon: 'none'
  64. });
  65. })
  66. },
  67. // 账户注销
  68. unsubscribe() {
  69. NET.request(API.delUser + this.code, {}, "delete").then(res => {
  70. if (res.code == '200') {
  71. // uni.showLoading({
  72. // mask: true,
  73. // title: '注销成功,正在退出...',
  74. // duration: 2000,
  75. // });
  76. setTimeout(function() {
  77. uni.removeStorageSync('storage_key');
  78. uni.removeStorageSync('distributorId');
  79. uni.reLaunch({
  80. url: 'login',
  81. success() {
  82. // uni.hideLoading()
  83. }
  84. })
  85. }, 1000)
  86. } else {
  87. uni.showToast({
  88. title: res.data.message,
  89. duration: 1000,
  90. icon: 'none'
  91. });
  92. }
  93. })
  94. }
  95. }
  96. }
  97. </script>
  98. <style lang="scss">
  99. .container {
  100. background-color: #FFFFFF;
  101. height: 100vh;
  102. .login-logoBox {
  103. margin-top: -300rpx;
  104. .login-logo {
  105. width: 234rpx;
  106. height: 193rpx;
  107. }
  108. }
  109. .iphoneNum-box {
  110. margin-top: 100rpx;
  111. border-bottom: 1rpx solid #DDDDDD;
  112. height: 100rpx;
  113. width: 600rpx;
  114. .loginIcon {
  115. width: 40rpx;
  116. height: 53rpx;
  117. }
  118. .iphoneNum-input {
  119. color: #999999;
  120. font-size: 28rpx;
  121. font-weight: 400;
  122. }
  123. }
  124. .passwordNum-box {
  125. border-bottom: 1rpx solid #DDDDDD;
  126. height: 100rpx;
  127. width: 600rpx;
  128. .passwordNum-input {
  129. color: #999999;
  130. font-size: 28rpx;
  131. font-weight: 400;
  132. width: 346rpx;
  133. }
  134. }
  135. .code-box {
  136. border-bottom: 1rpx solid #DDDDDD;
  137. height: 100rpx;
  138. width: 360rpx;
  139. display: flex;
  140. flex-direction: row;
  141. justify-content: space-between;
  142. align-items: center;
  143. .loginIcon {
  144. width: 44rpx;
  145. height: 50rpx;
  146. }
  147. .code-lab {
  148. width: 200rpx;
  149. }
  150. .codeNum-input {
  151. color: #999999;
  152. font-size: 28rpx;
  153. font-weight: 400;
  154. }
  155. }
  156. .getcode {
  157. background-color: #C5AA7B;
  158. height: 100rpx;
  159. width: 230rpx;
  160. display: flex;
  161. flex-direction: row;
  162. justify-content: center;
  163. align-items: center;
  164. margin-left: 20rpx;
  165. color: #FFFFFF;
  166. }
  167. .registerBut {
  168. background: #333333;
  169. color: #FFEBC4;
  170. height: 100rpx;
  171. width: 600rpx;
  172. text-align: center;
  173. line-height: 100rpx;
  174. margin-top: 30rpx;
  175. }
  176. }
  177. </style>