unsubscribeCode.vue 3.9 KB

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