修改错误提示不弹出的问题
This commit is contained in:
@ -31,19 +31,13 @@
|
||||
<view class="money">
|
||||
<view class="top">
|
||||
<text>退款总金额</text>
|
||||
<text class="colorRed">¥{{ orderDetail.refundAmount || 0}}</text>
|
||||
<text class="colorRed">¥{{ orderDetail.refundAmount || 0 }}</text>
|
||||
</view>
|
||||
<view class="express" v-if="orderDetail.serviceType === 1">
|
||||
<view class="title">商家已同意退货申请,请尽快发货。</view>
|
||||
<view class="info people">
|
||||
收货人: {{ orderDetail.consignee || '' }}
|
||||
</view>
|
||||
<view class="info address">
|
||||
收货地址: {{ orderDetail.address || '' }}
|
||||
</view>
|
||||
<view class="info phone">
|
||||
收货电话: {{ orderDetail.phoneNumber || '' }}
|
||||
</view>
|
||||
<view class="info people"> 收货人: {{ orderDetail.consignee || '' }} </view>
|
||||
<view class="info address"> 收货地址: {{ orderDetail.address || '' }} </view>
|
||||
<view class="info phone"> 收货电话: {{ orderDetail.phoneNumber || '' }} </view>
|
||||
</view>
|
||||
<!-- 退款信息 -->
|
||||
<view class="tips" v-if="orderDetail.state === 0">
|
||||
@ -70,17 +64,9 @@
|
||||
</view>
|
||||
</view> -->
|
||||
<view class="bottom">
|
||||
<view class="btns redBtn"
|
||||
v-if="orderDetail.salesState === 0
|
||||
&& orderDetail.serviceType === 1
|
||||
&& orderDetail.state === 1"
|
||||
@click="toExpress"
|
||||
>填写物流</view>
|
||||
<view class="btns def"
|
||||
v-if="orderDetail.salesState === 0"
|
||||
@click="cancelReq"
|
||||
>撤销申请</view>
|
||||
<!-- <view class="btns redBtn" @click="editReq">修改申请</view>-->
|
||||
<view class="btns redBtn" v-if="orderDetail.salesState === 0 && orderDetail.serviceType === 1 && orderDetail.state === 1" @click="toExpress">填写物流</view>
|
||||
<view class="btns def" v-if="orderDetail.salesState === 0" @click="cancelReq">撤销申请</view>
|
||||
<!-- <view class="btns redBtn" @click="editReq">修改申请</view>-->
|
||||
</view>
|
||||
</view>
|
||||
<!-- 退款信息 -->
|
||||
@ -88,10 +74,7 @@
|
||||
<view class="top">
|
||||
退款信息
|
||||
</view>
|
||||
<view class="rebackItem"
|
||||
v-for="item in orderDetail.cartInfo"
|
||||
:key="item.id"
|
||||
>
|
||||
<view class="rebackItem" v-for="item in orderDetail.cartInfo" :key="item.id">
|
||||
<image class="img" :src="item.productInfo.image" mode=""></image>
|
||||
<view class="info">
|
||||
<view class="productName">
|
||||
@ -115,9 +98,7 @@
|
||||
<view class="left">
|
||||
退款金额:
|
||||
</view>
|
||||
<view class="right">
|
||||
¥{{ orderDetail.refundAmount || 0 }}
|
||||
</view>
|
||||
<view class="right"> ¥{{ orderDetail.refundAmount || 0 }} </view>
|
||||
</view>
|
||||
<view class="reason">
|
||||
<view class="left">
|
||||
@ -141,17 +122,14 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import{
|
||||
getAfterSealsDetail,
|
||||
rebackAfterSeals
|
||||
} from '@/api/aftersales.js';
|
||||
import { getAfterSealsDetail, rebackAfterSeals } from '@/api/aftersales.js'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
orderId: '',
|
||||
id: '',
|
||||
orderInfo: {},
|
||||
orderDetail: {}
|
||||
orderDetail: {},
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
@ -162,106 +140,108 @@ export default {
|
||||
methods: {
|
||||
/** state售后状态 0已提交等待平台审核 1平台已审核 等待用户发货/退款 2 用户已发货 3已完成 */
|
||||
async getReturnDetail() {
|
||||
const res = await getAfterSealsDetail(this.orderId, this.id)
|
||||
if (res.status === 200) {
|
||||
getAfterSealsDetail(this.orderId, this.id)
|
||||
.then(res => {
|
||||
this.orderDetail = res.data
|
||||
} else {
|
||||
})
|
||||
.catch(err => {
|
||||
uni.showToast({
|
||||
title: "订单异常",
|
||||
icon: "none",
|
||||
title: '订单异常',
|
||||
icon: 'none',
|
||||
duration: 2000,
|
||||
});
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
toExpress () {
|
||||
toExpress() {
|
||||
this.$yrouter.push({
|
||||
path: '/pages/order/submitExpress/index',
|
||||
query: {
|
||||
orderCode: this.orderId
|
||||
}
|
||||
orderCode: this.orderId,
|
||||
},
|
||||
})
|
||||
},
|
||||
// 撤销申请
|
||||
async cancelReq() {
|
||||
const res = await rebackAfterSeals(this.orderId, this.id)
|
||||
if (res.status === 200) {
|
||||
rebackAfterSeals(this.orderId, this.id)
|
||||
.then(res => {
|
||||
uni.showToast({
|
||||
title: "已撤销",
|
||||
icon: "none",
|
||||
title: '已撤销',
|
||||
icon: 'none',
|
||||
duration: 2000,
|
||||
});
|
||||
})
|
||||
setTimeout(() => {
|
||||
this.$yrouter.back();
|
||||
this.$yrouter.back()
|
||||
}, 1500)
|
||||
} else {
|
||||
})
|
||||
.catch(err => {
|
||||
uni.showToast({
|
||||
title: "撤销失败",
|
||||
icon: "none",
|
||||
title: '撤销失败',
|
||||
icon: 'none',
|
||||
duration: 2000,
|
||||
});
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
// 修改申请
|
||||
editReq() {}
|
||||
}
|
||||
editReq() {},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang='scss'>
|
||||
$red: #EB3729;
|
||||
.returnList{
|
||||
.colorRed{
|
||||
<style scoped lang="scss">
|
||||
$red: #eb3729;
|
||||
.returnList {
|
||||
.colorRed {
|
||||
color: $red;
|
||||
}
|
||||
.bgRed{
|
||||
.bgRed {
|
||||
background-color: $red;
|
||||
}
|
||||
.data{
|
||||
.data {
|
||||
width: 100%;
|
||||
height: 150rpx;
|
||||
line-height: 150rpx;
|
||||
padding-left: 30rpx;
|
||||
color: #FFF;
|
||||
color: #fff;
|
||||
}
|
||||
.money{
|
||||
background-color: #FFF;
|
||||
.top{
|
||||
.money {
|
||||
background-color: #fff;
|
||||
.top {
|
||||
padding: 20rpx 30rpx;
|
||||
font-size: 30rpx;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
border-bottom: 2rpx solid #F3F4F5;
|
||||
border-bottom: 2rpx solid #f3f4f5;
|
||||
}
|
||||
.express{
|
||||
.express {
|
||||
padding: 20rpx 30rpx;
|
||||
font-size: 26rpx;
|
||||
.title{
|
||||
.title {
|
||||
color: #333333;
|
||||
}
|
||||
.info{
|
||||
.info {
|
||||
color: #999999;
|
||||
}
|
||||
}
|
||||
.tips{
|
||||
.tips {
|
||||
height: 160rpx;
|
||||
padding: 20rpx 30rpx;
|
||||
color: #999999;
|
||||
border-bottom: 2rpx solid #F3F4F5;
|
||||
border-bottom: 2rpx solid #f3f4f5;
|
||||
font-size: 26rpx;
|
||||
.title{
|
||||
.title {
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
.content{
|
||||
.content {
|
||||
font-size: 20rpx;
|
||||
}
|
||||
}
|
||||
.bottom{
|
||||
.bottom {
|
||||
padding: 20rpx 30rpx;
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
.btns{
|
||||
.btns {
|
||||
width: 160rpx;
|
||||
height: 58rpx;
|
||||
margin: 0 10rpx;
|
||||
@ -270,62 +250,62 @@ $red: #EB3729;
|
||||
line-height: 58rpx;
|
||||
border-radius: 180rpx;
|
||||
}
|
||||
.def{
|
||||
color: #DDDDDD;
|
||||
border: 2rpx solid #DDDDDD;
|
||||
.def {
|
||||
color: #dddddd;
|
||||
border: 2rpx solid #dddddd;
|
||||
}
|
||||
.redBtn{
|
||||
color: #FFF;
|
||||
.redBtn {
|
||||
color: #fff;
|
||||
background-color: $red;
|
||||
}
|
||||
}
|
||||
}
|
||||
.rebackInfo{
|
||||
.rebackInfo {
|
||||
padding: 0 30rpx;
|
||||
background-color: #FFF;
|
||||
.top{
|
||||
background-color: #fff;
|
||||
.top {
|
||||
height: 80rpx;
|
||||
margin: 20rpx 0;
|
||||
line-height: 80rpx;
|
||||
font-size: 30rpx;
|
||||
font-weight: bold;
|
||||
color: #333333;
|
||||
border-bottom: 2rpx solid #F3F4F5;
|
||||
border-bottom: 2rpx solid #f3f4f5;
|
||||
}
|
||||
.rebackItem{
|
||||
.rebackItem {
|
||||
padding: 20rpx 0;
|
||||
font-size: 28rpx;
|
||||
display: flex;
|
||||
border-bottom: 2rpx solid #F3F4F5;
|
||||
.img{
|
||||
border-bottom: 2rpx solid #f3f4f5;
|
||||
.img {
|
||||
width: 120rpx;
|
||||
height: 120rpx;
|
||||
}
|
||||
.info{
|
||||
.info {
|
||||
margin-left: 16rpx;
|
||||
flex: 1;
|
||||
.productName{
|
||||
.productName {
|
||||
width: 100%;
|
||||
height: 80rpx;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
color: #333333;
|
||||
}
|
||||
.sku{
|
||||
.sku {
|
||||
font-size: 24rpx;
|
||||
color: #CCCCCC;
|
||||
color: #cccccc;
|
||||
}
|
||||
}
|
||||
}
|
||||
.bottom{
|
||||
.bottom {
|
||||
padding: 20rpx 0;
|
||||
.reason{
|
||||
.reason {
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
.right{
|
||||
color: #AAAAAA;
|
||||
.right {
|
||||
color: #aaaaaa;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -3,11 +3,7 @@
|
||||
<view class="submitExpress">
|
||||
<!-- 填写物流 -->
|
||||
<view class="form">
|
||||
<picker class="picker"
|
||||
:value="express"
|
||||
:range="expressPicker"
|
||||
@change="changeExpress"
|
||||
>
|
||||
<picker class="picker" :value="express" :range="expressPicker" @change="changeExpress">
|
||||
<view class="item acea-row row-between-wrapper">
|
||||
<view class="title">
|
||||
<view class="point">
|
||||
@ -39,37 +35,34 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
getExpressData,
|
||||
addExpressData
|
||||
} from '@/api/aftersales.js'
|
||||
import { getExpressData, addExpressData } from '@/api/aftersales.js'
|
||||
export default {
|
||||
data () {
|
||||
data() {
|
||||
return {
|
||||
expressQuery: {
|
||||
code: '', // 快递公司编码
|
||||
name: '', // 快递公司名称
|
||||
postalCode: 'SF1213132132', // 快递编号
|
||||
orderCode: '' // 订单编号
|
||||
orderCode: '', // 订单编号
|
||||
},
|
||||
expressList: [],
|
||||
expressPicker: [],
|
||||
express: ''
|
||||
express: '',
|
||||
}
|
||||
},
|
||||
mounted () {
|
||||
mounted() {
|
||||
this.expressQuery.orderCode = this.$yroute.query.orderCode
|
||||
this.getExpress()
|
||||
},
|
||||
methods: {
|
||||
async getExpress () {
|
||||
async getExpress() {
|
||||
const res = await getExpressData()
|
||||
console.log(res)
|
||||
this.expressList = res.data.map(item => {
|
||||
return {
|
||||
id: item.id,
|
||||
name: item.name,
|
||||
code: item.code
|
||||
code: item.code,
|
||||
}
|
||||
})
|
||||
this.expressPicker = res.data.map(item => {
|
||||
@ -77,11 +70,11 @@ export default {
|
||||
})
|
||||
},
|
||||
changeExpress(e) {
|
||||
this.express = this.expressPicker[e.mp.detail.value];
|
||||
this.express = this.expressPicker[e.mp.detail.value]
|
||||
this.expressQuery.code = this.expressList[e.mp.detail.value].code
|
||||
this.expressQuery.name = this.expressList[e.mp.detail.value].name
|
||||
},
|
||||
async addExpress () {
|
||||
async addExpress() {
|
||||
let errMsg = '请选择'
|
||||
if (!this.expressQuery.code || !this.expressQuery.code) {
|
||||
errMsg += ' 快递公司 '
|
||||
@ -96,55 +89,55 @@ export default {
|
||||
duration: 2000,
|
||||
})
|
||||
}
|
||||
console.log(this.expressQuery)
|
||||
const res = await addExpressData(this.expressQuery)
|
||||
if (res.status === 200) {
|
||||
addExpressData(this.expressQuery)
|
||||
.then(res => {
|
||||
uni.showToast({
|
||||
title: '物流填写成功!',
|
||||
icon: 'none',
|
||||
duration: 2000,
|
||||
})
|
||||
this.$yrouter.push({
|
||||
path: '/pages/order/ReturnList/index'
|
||||
path: '/pages/order/ReturnList/index',
|
||||
})
|
||||
} else {
|
||||
})
|
||||
.catch(err => {
|
||||
uni.showToast({
|
||||
title: '提交物流信息失败!',
|
||||
icon: 'none',
|
||||
duration: 2000,
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.submitExpress{
|
||||
.form{
|
||||
.submitExpress {
|
||||
.form {
|
||||
margin-bottom: 170rpx;
|
||||
.picker{
|
||||
.picker {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
font-size: 28rpx;
|
||||
color: #999999;
|
||||
}
|
||||
.item{
|
||||
.item {
|
||||
width: 100%;
|
||||
height: 80rpx;
|
||||
padding: 0 32rpx;
|
||||
line-height: 80rpx;
|
||||
background-color: #FFF;
|
||||
background-color: #fff;
|
||||
display: flex;
|
||||
.title{
|
||||
.title {
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
display: flex;
|
||||
.point{
|
||||
color: #EA3729;
|
||||
.point {
|
||||
color: #ea3729;
|
||||
}
|
||||
}
|
||||
.input{
|
||||
.input {
|
||||
height: 80rpx;
|
||||
line-height: 80rpx;
|
||||
font-size: 28rpx;
|
||||
@ -152,22 +145,22 @@ export default {
|
||||
}
|
||||
}
|
||||
}
|
||||
.btnContainer{
|
||||
.btnContainer {
|
||||
width: 100%;
|
||||
height: 170rpx;
|
||||
background-color: #FFF;
|
||||
background-color: #fff;
|
||||
box-shadow: 0px 0px 0px rgba(197, 202, 207, 0.5);
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
.addBtn{
|
||||
.addBtn {
|
||||
height: 90rpx;
|
||||
margin: 40rpx 30rpx;
|
||||
line-height: 90rpx;
|
||||
text-align: center;
|
||||
border-radius: 50rpx;
|
||||
font-size: 28rpx;
|
||||
color: #FFF;
|
||||
background: linear-gradient(90deg, #E93526 0%, #FF8E3C 100%);
|
||||
color: #fff;
|
||||
background: linear-gradient(90deg, #e93526 0%, #ff8e3c 100%);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,16 +2,14 @@
|
||||
<view class="register absolute">
|
||||
<view class="whiteBg" v-if="formItem === 1">
|
||||
<view class="title acea-row">
|
||||
<view class="item" :class="current === index ? 'on' : ''" v-for="(item, index) in navList"
|
||||
@click="navTap(index)" :key="index">{{ item }}</view>
|
||||
<view class="item" :class="current === index ? 'on' : ''" v-for="(item, index) in navList" @click="navTap(index)" :key="index">{{ item }}</view>
|
||||
</view>
|
||||
<!-- 手机号登录 -->
|
||||
<view class="list" :hidden="current !== 0">
|
||||
<form @submit.prevent="submit">
|
||||
<view class="item getPhoneCode">
|
||||
<view class="phoneInput acea-row row-between-wrapper">
|
||||
<input type="text" placeholder="输入手机号码"
|
||||
v-model="account" required/>
|
||||
<input type="text" placeholder="输入手机号码" v-model="account" required />
|
||||
</view>
|
||||
<view class="phoneCode" @click="sendCode">
|
||||
{{ clockText }}
|
||||
@ -72,8 +70,7 @@
|
||||
<use xlink:href="#icon-code_1" />
|
||||
</svg>-->
|
||||
<input name="verifyCode" type="text" placeholder="填写验证码" class="codeIput" v-model="captcha" />
|
||||
<button class="code" :disabled="disabled" :class="disabled === true ? 'on' : ''"
|
||||
@click="code">{{ text }}</button>
|
||||
<button class="code" :disabled="disabled" :class="disabled === true ? 'on' : ''" @click="code">{{ text }}</button>
|
||||
</view>
|
||||
</view>
|
||||
<view class="item">
|
||||
@ -94,7 +91,6 @@
|
||||
</view>
|
||||
</view>
|
||||
<!-- #endif -->
|
||||
|
||||
</view>
|
||||
<view class="logon" @click="register">注册</view>
|
||||
<view class="tip">
|
||||
@ -105,90 +101,69 @@
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
import sendVerifyCode from "@/mixins/SendVerifyCode";
|
||||
import {
|
||||
login,
|
||||
loginMobile,
|
||||
registerVerify,
|
||||
register
|
||||
} from "@/api/user";
|
||||
import attrs, {
|
||||
required,
|
||||
alpha_num,
|
||||
chs_phone
|
||||
} from "@/utils/validate";
|
||||
import {
|
||||
validatorDefaultCatch
|
||||
} from "@/utils/dialog";
|
||||
import dayjs from "dayjs";
|
||||
import cookie from "@/utils/store/cookie";
|
||||
import sendVerifyCode from '@/mixins/SendVerifyCode'
|
||||
import { login, loginMobile, registerVerify, register } from '@/api/user'
|
||||
import attrs, { required, alpha_num, chs_phone } from '@/utils/validate'
|
||||
import { validatorDefaultCatch } from '@/utils/dialog'
|
||||
import dayjs from 'dayjs'
|
||||
import cookie from '@/utils/store/cookie'
|
||||
|
||||
import {
|
||||
handleGetUserInfo
|
||||
} from "@/utils";
|
||||
import { handleGetUserInfo } from '@/utils'
|
||||
|
||||
const BACK_URL = "login_back_url";
|
||||
const BACK_URL = 'login_back_url'
|
||||
|
||||
export default {
|
||||
name: "Login",
|
||||
export default {
|
||||
name: 'Login',
|
||||
mixins: [sendVerifyCode],
|
||||
data: function () {
|
||||
data: function() {
|
||||
return {
|
||||
navList: ["手机号登录", "密码登录"],
|
||||
navList: ['手机号登录', '密码登录'],
|
||||
// navList: ["手机号登录",],
|
||||
current: 0,
|
||||
account: "",
|
||||
password: "",
|
||||
captcha: "",
|
||||
inviteCode: "",
|
||||
account: '',
|
||||
password: '',
|
||||
captcha: '',
|
||||
inviteCode: '',
|
||||
formItem: 1,
|
||||
type: "login",
|
||||
type: 'login',
|
||||
timer: null,
|
||||
clock: 60,
|
||||
clockText: '验证码'
|
||||
};
|
||||
clockText: '验证码',
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async loginMobile() {
|
||||
var that = this;
|
||||
const {
|
||||
account,
|
||||
captcha
|
||||
} = that;
|
||||
var that = this
|
||||
const { account, captcha } = that
|
||||
try {
|
||||
await that
|
||||
.$validator({
|
||||
account: [
|
||||
required(required.message("手机号码")),
|
||||
chs_phone(chs_phone.message())
|
||||
],
|
||||
captcha: [
|
||||
required(required.message("验证码")),
|
||||
alpha_num(alpha_num.message("验证码"))
|
||||
]
|
||||
account: [required(required.message('手机号码')), chs_phone(chs_phone.message())],
|
||||
captcha: [required(required.message('验证码')), alpha_num(alpha_num.message('验证码'))],
|
||||
})
|
||||
.validate({
|
||||
account,
|
||||
captcha
|
||||
});
|
||||
captcha,
|
||||
})
|
||||
} catch (e) {
|
||||
return validatorDefaultCatch(e);
|
||||
return validatorDefaultCatch(e)
|
||||
}
|
||||
const res = await loginMobile({
|
||||
loginMobile({
|
||||
account: that.account,
|
||||
captcha: that.captcha,
|
||||
spread: cookie.get("spread")
|
||||
spread: cookie.get('spread'),
|
||||
})
|
||||
if (res.status === 200) {
|
||||
this.$store.commit("login", res.data.token, dayjs(res.data.expires_time));
|
||||
handleGetUserInfo();
|
||||
} else {
|
||||
.then(res => {
|
||||
this.$store.commit('login', res.data.token, dayjs(res.data.expires_time))
|
||||
handleGetUserInfo()
|
||||
})
|
||||
.catch(err => {
|
||||
uni.showToast({
|
||||
title: res.msg || res.response.data.msg || err.response.data.message,
|
||||
icon: "none",
|
||||
duration: 2000
|
||||
});
|
||||
}
|
||||
icon: 'none',
|
||||
duration: 2000,
|
||||
})
|
||||
})
|
||||
// .then(res => {
|
||||
// that.$store.commit("login", res.data.token, dayjs(res.data.expires_time));
|
||||
// handleGetUserInfo();
|
||||
@ -203,100 +178,72 @@
|
||||
// });
|
||||
},
|
||||
async register() {
|
||||
var that = this;
|
||||
const {
|
||||
account,
|
||||
captcha,
|
||||
password
|
||||
} = that;
|
||||
var that = this
|
||||
const { account, captcha, password } = that
|
||||
try {
|
||||
await that
|
||||
.$validator({
|
||||
account: [
|
||||
required(required.message("手机号码")),
|
||||
chs_phone(chs_phone.message())
|
||||
],
|
||||
captcha: [
|
||||
required(required.message("验证码")),
|
||||
alpha_num(alpha_num.message("验证码"))
|
||||
],
|
||||
password: [
|
||||
required(required.message("密码")),
|
||||
attrs.range([6, 16], attrs.range.message("密码")),
|
||||
alpha_num(alpha_num.message("密码"))
|
||||
]
|
||||
account: [required(required.message('手机号码')), chs_phone(chs_phone.message())],
|
||||
captcha: [required(required.message('验证码')), alpha_num(alpha_num.message('验证码'))],
|
||||
password: [required(required.message('密码')), attrs.range([6, 16], attrs.range.message('密码')), alpha_num(alpha_num.message('密码'))],
|
||||
})
|
||||
.validate({
|
||||
account,
|
||||
captcha,
|
||||
password
|
||||
});
|
||||
password,
|
||||
})
|
||||
} catch (e) {
|
||||
return validatorDefaultCatch(e);
|
||||
return validatorDefaultCatch(e)
|
||||
}
|
||||
register({
|
||||
account: that.account,
|
||||
captcha: that.captcha,
|
||||
password: that.password,
|
||||
inviteCode: that.inviteCode,
|
||||
spread: cookie.get("spread")
|
||||
spread: cookie.get('spread'),
|
||||
})
|
||||
.then(res => {
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
icon: "success",
|
||||
duration: 2000
|
||||
});
|
||||
that.formItem = 1;
|
||||
icon: 'success',
|
||||
duration: 2000,
|
||||
})
|
||||
that.formItem = 1
|
||||
})
|
||||
.catch(err => {
|
||||
uni.showToast({
|
||||
title: err.msg || err.response.data.msg || err.response.data.message,
|
||||
icon: "none",
|
||||
duration: 2000
|
||||
});
|
||||
});
|
||||
icon: 'none',
|
||||
duration: 2000,
|
||||
})
|
||||
})
|
||||
},
|
||||
// 获取验证码
|
||||
async code() {
|
||||
const {
|
||||
account
|
||||
} = this;
|
||||
const { account } = this
|
||||
try {
|
||||
await this
|
||||
.$validator({
|
||||
account: [
|
||||
required(required.message("手机号码")),
|
||||
chs_phone(chs_phone.message())
|
||||
]
|
||||
await this.$validator({
|
||||
account: [required(required.message('手机号码')), chs_phone(chs_phone.message())],
|
||||
}).validate({
|
||||
account,
|
||||
})
|
||||
.validate({
|
||||
account
|
||||
});
|
||||
} catch (e) {
|
||||
return validatorDefaultCatch(e);
|
||||
return validatorDefaultCatch(e)
|
||||
}
|
||||
if (this.formItem == 2) this.type = "register";
|
||||
if (this.formItem == 2) this.type = 'register'
|
||||
this.showCode()
|
||||
},
|
||||
// 手机号登录获取验证码
|
||||
async sendCode () {
|
||||
const {
|
||||
account
|
||||
} = this;
|
||||
async sendCode() {
|
||||
const { account } = this
|
||||
try {
|
||||
await this
|
||||
.$validator({
|
||||
account: [
|
||||
required(required.message("手机号码")),
|
||||
chs_phone(chs_phone.message())
|
||||
]
|
||||
await this.$validator({
|
||||
account: [required(required.message('手机号码')), chs_phone(chs_phone.message())],
|
||||
}).validate({
|
||||
account,
|
||||
})
|
||||
.validate({
|
||||
account
|
||||
});
|
||||
} catch (e) {
|
||||
return validatorDefaultCatch(e);
|
||||
return validatorDefaultCatch(e)
|
||||
}
|
||||
// 倒计时
|
||||
if (this.clock !== 60) {
|
||||
@ -321,87 +268,79 @@
|
||||
showCode() {
|
||||
return registerVerify({
|
||||
phone: this.account,
|
||||
type: this.type
|
||||
type: this.type,
|
||||
})
|
||||
.then(res => {
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
icon: "success",
|
||||
duration: 2000
|
||||
});
|
||||
this.sendCode();
|
||||
icon: 'success',
|
||||
duration: 2000,
|
||||
})
|
||||
this.sendCode()
|
||||
})
|
||||
.catch(err => {
|
||||
uni.showToast({
|
||||
title: err.msg || err.response.data.msg || err.response.data.message,
|
||||
icon: "none",
|
||||
duration: 2000
|
||||
});
|
||||
});
|
||||
icon: 'none',
|
||||
duration: 2000,
|
||||
})
|
||||
})
|
||||
},
|
||||
navTap(index) {
|
||||
this.current = index
|
||||
},
|
||||
navTap(index) { this.current = index; },
|
||||
async submit() {
|
||||
const {
|
||||
account,
|
||||
password
|
||||
} = this;
|
||||
const { account, password } = this
|
||||
try {
|
||||
await this.$validator({
|
||||
account: [
|
||||
required(required.message("账号")),
|
||||
attrs.range([5, 16], attrs.range.message("账号")),
|
||||
alpha_num(alpha_num.message("账号"))
|
||||
],
|
||||
password: [
|
||||
required(required.message("密码")),
|
||||
attrs.range([6, 16], attrs.range.message("密码")),
|
||||
alpha_num(alpha_num.message("密码"))
|
||||
]
|
||||
account: [required(required.message('账号')), attrs.range([5, 16], attrs.range.message('账号')), alpha_num(alpha_num.message('账号'))],
|
||||
password: [required(required.message('密码')), attrs.range([6, 16], attrs.range.message('密码')), alpha_num(alpha_num.message('密码'))],
|
||||
}).validate({
|
||||
account,
|
||||
password
|
||||
});
|
||||
password,
|
||||
})
|
||||
} catch (e) {
|
||||
return validatorDefaultCatch(e);
|
||||
return validatorDefaultCatch(e)
|
||||
}
|
||||
// 账号密码登录
|
||||
const res = await login({
|
||||
|
||||
login({
|
||||
username: account,
|
||||
password,
|
||||
spread: cookie.get("spread")
|
||||
spread: cookie.get('spread'),
|
||||
})
|
||||
if (res.status === 200) {
|
||||
this.$store.commit("login", res.data.token, dayjs(res.data.expires_time));
|
||||
handleGetUserInfo();
|
||||
} else {
|
||||
.then(res => {
|
||||
this.$store.commit('login', res.data.token, dayjs(res.data.expires_time))
|
||||
handleGetUserInfo()
|
||||
})
|
||||
.catch(err => {
|
||||
uni.showToast({
|
||||
title: res.msg || res.response.data.msg || err.response.data.message,
|
||||
icon: "none",
|
||||
duration: 2000
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
title: err.msg || err.response.data.msg || err.response.data.message,
|
||||
icon: 'none',
|
||||
duration: 2000,
|
||||
})
|
||||
})
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.register .whiteBg .title .item{
|
||||
.register .whiteBg .title .item {
|
||||
border-bottom: 2px solid;
|
||||
}
|
||||
.register .whiteBg .title .item.on{
|
||||
.register .whiteBg .title .item.on {
|
||||
border-bottom-color: #f35749;
|
||||
}
|
||||
.getPhoneCode{
|
||||
.getPhoneCode {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
.phoneInput{
|
||||
.phoneInput {
|
||||
width: 70%;
|
||||
}
|
||||
.phoneCode{
|
||||
.phoneCode {
|
||||
width: 30%;
|
||||
text-align: center;
|
||||
color: #FFFFFF;
|
||||
color: #ffffff;
|
||||
background-color: #f35749;
|
||||
padding: 12rpx;
|
||||
font-size: 28rpx;
|
||||
|
||||
Reference in New Issue
Block a user