星油云站更新
This commit is contained in:
@@ -7,13 +7,13 @@
|
||||
<view class="bg-white cu-card margin-bottom-lg">
|
||||
<view class="text-gray text-lg padding-top-lg padding-bottom-lg margin-bottom margin-top-lg text-center">
|
||||
请输入 <text class="text-black">
|
||||
{{oldPhone}}
|
||||
{{loginUser.userPhone}}
|
||||
</text> 收到的短信验证码
|
||||
</view>
|
||||
</view>
|
||||
<view class="cu-form-group padding-top-sm padding-bottom-sm">
|
||||
<view class="title text-black ">验证码</view>
|
||||
<input type="number" :maxlength="6" v-model="authCode" placeholder="填写验证码" name="input" />
|
||||
<input type="number" :maxlength="6" v-model="code" placeholder="填写验证码" name="input" />
|
||||
<text class="mini-left-border" :class="frozen?'text-gray':'oil-main-color'" @tap="sendMsg">{{tips}}</text>
|
||||
</view>
|
||||
<view class="padding margin-top-lg padding-top-lg">
|
||||
@@ -24,34 +24,42 @@
|
||||
|
||||
<script>
|
||||
import cloudSiteApi from '@/api/cloud-site.js'
|
||||
import oliUserApi from '@/api/oli-user.js'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
odphone:'',
|
||||
oldPhone: uni.getStorageSync('oldPhone'),
|
||||
loginUser: uni.getStorageSync('loginUser'),
|
||||
auth: {},
|
||||
type: 'oldPhone',
|
||||
authCode: "",
|
||||
code: "",
|
||||
tips: '获取验证码',
|
||||
frozen: false // 冷却时间
|
||||
frozen: false ,// 冷却时间
|
||||
verifyCodeToken:''
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
let phones = uni.getStorageSync('loginUser')
|
||||
this.odphone =phones.userPhone
|
||||
},
|
||||
methods: {
|
||||
nextStep() {
|
||||
if (this.authCode) {
|
||||
if (this.code) {
|
||||
const data3 = {
|
||||
phone: this.loginUser.userPhone,
|
||||
authCode: this.authCode,
|
||||
type: this.type
|
||||
code: this.code,
|
||||
type: this.type,
|
||||
verifyCodeToken : this.verifyCodeToken
|
||||
}
|
||||
cloudSiteApi.updatePhone(data3).then(res => {
|
||||
oliUserApi.checkOldPhoneCode(data3).then(res => {
|
||||
if (res.code == 20000) {
|
||||
uni.showToast({
|
||||
title: res.msg
|
||||
})
|
||||
setTimeout(() => {
|
||||
uni.navigateTo({
|
||||
url: '/pages/setup/changePhone/changePhone',
|
||||
url: '/packageSecurity/changePhone/changePhone',
|
||||
fail: (err) => {
|
||||
console.log(err)
|
||||
}
|
||||
@@ -72,8 +80,9 @@
|
||||
const data2 = {
|
||||
phone: this.loginUser.userPhone
|
||||
}
|
||||
cloudSiteApi.updatePhoneSms(data2).then(res => {
|
||||
oliUserApi.sendOldPhoneSms(data2).then(res => {
|
||||
console.log('res', res)
|
||||
this.verifyCodeToken = res.data.verifyCodeToken
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
icon: 'none'
|
||||
|
||||
@@ -36,6 +36,7 @@
|
||||
|
||||
<script>
|
||||
import cloudSiteApi from '@/api/cloud-site.js'
|
||||
import oliUserApi from '@/api/oli-user.js'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
@@ -46,7 +47,8 @@
|
||||
type: 'newPhone',
|
||||
authCode: "",
|
||||
tips: '获取验证码',
|
||||
frozen: false // 冷却时间
|
||||
frozen: false ,// 冷却时间
|
||||
verifyCodeToken:''
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@@ -54,10 +56,12 @@
|
||||
if (this.authCode) {
|
||||
const data3 = {
|
||||
phone: this.newPhone,
|
||||
authCode: this.authCode,
|
||||
type: this.type
|
||||
code: this.authCode,
|
||||
type: this.type,
|
||||
verifyCodeToken : this.verifyCodeToken,
|
||||
id:this.loginUser.id
|
||||
}
|
||||
cloudSiteApi.updatePhone(data3).then(res => {
|
||||
oliUserApi.changeNewPhone(data3).then(res => {
|
||||
if (res.code == 20000) {
|
||||
uni.showToast({
|
||||
title: res.msg + '请重新登录'
|
||||
@@ -84,13 +88,13 @@
|
||||
},
|
||||
sendMsg() {
|
||||
if (!this.frozen) {
|
||||
if (this.newPhone) {
|
||||
|
||||
if (this.newPhone) {
|
||||
const data2 = {
|
||||
phone: this.newPhone
|
||||
}
|
||||
cloudSiteApi.updatePhoneSms(data2).then(res => {
|
||||
oliUserApi.sendNewPhoneSms(data2).then(res => {
|
||||
console.log('res', res)
|
||||
this.verifyCodeToken = res.data.verifyCodeToken
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
icon: 'none'
|
||||
|
||||
Reference in New Issue
Block a user