123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201 |
- <template>
- <!-- 登录 -->
- <view class="container flex-items-plus flex-column">
- <global-loading />
- <view class="login-logoBox">
- <image class="login-logo" src="../../static/images/origin/loginLogo.png"></image>
- </view>
- <view class="iphoneNum-box flex-row-plus flex-items">
- <view style="margin-right: 30rpx">
- <image class="loginIcon" src="../../static/images/origin/phone.png"></image>
- </view>
- <view>
- <input
- v-model="userInfo.phone" maxlength="11" placeholder-class="iphoneNum-input" type="number"
- disabled
- placeholder="请输入您的手机号"
- />
- </view>
- </view>
- <view class="flex-row-plus mar-top-20">
- <view class="code-box">
- <view style="margin-right: 30rpx">
- <image class="loginIcon" src="../../static/images/origin/code.png"></image>
- </view>
- <view>
- <input v-model="code" maxlength="6" placeholder-class="codeNum-input" placeholder="请输入验证码" />
- </view>
- </view>
- <view :class="disabled === true ? 'on' : ''" :disabled="disabled" class="getcode" @click="codede">
- {{ text }}
- </view>
- </view>
- <view class="mar-top-60">
- <view class="registerBut mar-top-100" @click="unsubscribe">立即注销</view>
- </view>
- </view>
- </template>
- <script>
- import sendVerifyCode from '@/mixins/SendVerifyCode'
- import { J_STORAGE_KEY } from '../../config/constant'
- const NET = require('../../utils/request')
- const API = require('../../config/api')
- import { getVerifyCodeApi } from '../../api/user'
- export default {
- name: 'UnsubscribeCode',
- mixins: [ sendVerifyCode ],
- data() {
- return {
- code: '',
- userInfo: {}
- }
- },
- onLoad() {
- this.userInfo = uni.getStorageSync('storage_userInfo')
- },
- methods: {
- // 获取验证码
- codede() {
- this.getVerify()
- },
- getVerify() {
- getVerifyCodeApi({
- phone: this.userInfo.phone
- }).then((res) => {
- this.sendCode()
- })
- .catch((res) => {
- uni.showToast({
- title: res.data.message,
- duration: 1000,
- icon: 'none'
- })
- })
- },
- // 账户注销
- unsubscribe() {
- NET.request(API.delUser + this.code, {}, 'delete').then((res) => {
- if (res.code == '200') {
- // uni.showLoading({
- // mask: true,
- // title: '注销成功,正在退出...',
- // duration: 2000,
- // });
- setTimeout(function () {
- uni.removeStorageSync(J_STORAGE_KEY)
- uni.removeStorageSync('distributorId')
- uni.reLaunch({
- url: 'login',
- success() {
- // uni.hideLoading()
- }
- })
- }, 1000)
- } else {
- uni.showToast({
- title: res.data.message,
- duration: 1000,
- icon: 'none'
- })
- }
- })
- }
- }
- }
- </script>
- <style lang="scss">
- .container {
- background-color: #FFFFFF;
- height: 100vh;
- .login-logoBox {
- margin-top: -300rpx;
- .login-logo {
- width: 234rpx;
- height: 193rpx;
- }
- }
- .iphoneNum-box {
- margin-top: 100rpx;
- border-bottom: 1rpx solid #DDDDDD;
- height: 100rpx;
- width: 600rpx;
- .loginIcon {
- width: 40rpx;
- height: 53rpx;
- }
- .iphoneNum-input {
- color: #999999;
- font-size: 28rpx;
- font-weight: 400;
- }
- }
- .passwordNum-box {
- border-bottom: 1rpx solid #DDDDDD;
- height: 100rpx;
- width: 600rpx;
- .passwordNum-input {
- color: #999999;
- font-size: 28rpx;
- font-weight: 400;
- width: 346rpx;
- }
- }
- .code-box {
- border-bottom: 1rpx solid #DDDDDD;
- height: 100rpx;
- width: 360rpx;
- display: flex;
- flex-direction: row;
- justify-content: space-between;
- align-items: center;
- .loginIcon {
- width: 44rpx;
- height: 50rpx;
- }
- .code-lab {
- width: 200rpx;
- }
- .codeNum-input {
- color: #999999;
- font-size: 28rpx;
- font-weight: 400;
- }
- }
- .getcode {
- background-color: #C5AA7B;
- height: 100rpx;
- width: 230rpx;
- display: flex;
- flex-direction: row;
- justify-content: center;
- align-items: center;
- margin-left: 20rpx;
- color: #FFFFFF;
- }
- .registerBut {
- background: #333333;
- color: #FFEBC4;
- height: 100rpx;
- width: 600rpx;
- text-align: center;
- line-height: 100rpx;
- margin-top: 30rpx;
- }
- }
- </style>
|