Browse Source

修改错误提示不弹出的问题

zyh
Gao xiaosong 3 years ago
parent
commit
6f12083ef1
  1. 114
      pages/order/OrderReturnDetail/index.vue
  2. 45
      pages/order/submitExpress/index.vue
  3. 265
      pages/user/Login/index.vue

114
pages/order/OrderReturnDetail/index.vue

@ -35,15 +35,9 @@
</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,16 +64,8 @@
</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" 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,53 +140,55 @@ 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() {
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;
<style scoped lang="scss">
$red: #eb3729;
.returnList {
.colorRed {
color: $red;
@ -221,16 +201,16 @@ $red: #EB3729;
height: 150rpx;
line-height: 150rpx;
padding-left: 30rpx;
color: #FFF;
color: #fff;
}
.money {
background-color: #FFF;
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 {
padding: 20rpx 30rpx;
@ -246,7 +226,7 @@ $red: #EB3729;
height: 160rpx;
padding: 20rpx 30rpx;
color: #999999;
border-bottom: 2rpx solid #F3F4F5;
border-bottom: 2rpx solid #f3f4f5;
font-size: 26rpx;
.title {
overflow: hidden;
@ -271,18 +251,18 @@ $red: #EB3729;
border-radius: 180rpx;
}
.def {
color: #DDDDDD;
border: 2rpx solid #DDDDDD;
color: #dddddd;
border: 2rpx solid #dddddd;
}
.redBtn {
color: #FFF;
color: #fff;
background-color: $red;
}
}
}
.rebackInfo {
padding: 0 30rpx;
background-color: #FFF;
background-color: #fff;
.top {
height: 80rpx;
margin: 20rpx 0;
@ -290,13 +270,13 @@ $red: #EB3729;
font-size: 30rpx;
font-weight: bold;
color: #333333;
border-bottom: 2rpx solid #F3F4F5;
border-bottom: 2rpx solid #f3f4f5;
}
.rebackItem {
padding: 20rpx 0;
font-size: 28rpx;
display: flex;
border-bottom: 2rpx solid #F3F4F5;
border-bottom: 2rpx solid #f3f4f5;
.img {
width: 120rpx;
height: 120rpx;
@ -313,7 +293,7 @@ $red: #EB3729;
}
.sku {
font-size: 24rpx;
color: #CCCCCC;
color: #cccccc;
}
}
}
@ -325,7 +305,7 @@ $red: #EB3729;
display: flex;
justify-content: space-between;
.right {
color: #AAAAAA;
color: #aaaaaa;
}
}
}

45
pages/order/submitExpress/index.vue

@ -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,10 +35,7 @@
</template>
<script>
import {
getExpressData,
addExpressData
} from '@/api/aftersales.js'
import { getExpressData, addExpressData } from '@/api/aftersales.js'
export default {
data() {
return {
@ -50,11 +43,11 @@ export default {
code: '', //
name: '', //
postalCode: 'SF1213132132', //
orderCode: '' //
orderCode: '', //
},
expressList: [],
expressPicker: [],
express: ''
express: '',
}
},
mounted() {
@ -69,7 +62,7 @@ export default {
return {
id: item.id,
name: item.name,
code: item.code
code: item.code,
}
})
this.expressPicker = res.data.map(item => {
@ -77,7 +70,7 @@ 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
},
@ -96,26 +89,26 @@ 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>
@ -134,14 +127,14 @@ export default {
height: 80rpx;
padding: 0 32rpx;
line-height: 80rpx;
background-color: #FFF;
background-color: #fff;
display: flex;
.title {
font-size: 28rpx;
color: #333333;
display: flex;
.point {
color: #EA3729;
color: #ea3729;
}
}
.input {
@ -155,7 +148,7 @@ export default {
.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;
@ -166,8 +159,8 @@ export default {
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%);
}
}
}

265
pages/user/Login/index.vue

@ -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",
name: 'Login',
mixins: [sendVerifyCode],
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;
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,68 +268,60 @@
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'),
})
.then(res => {
this.$store.commit('login', res.data.token, dayjs(res.data.expires_time))
handleGetUserInfo()
})
if (res.status === 200) {
this.$store.commit("login", res.data.token, dayjs(res.data.expires_time));
handleGetUserInfo();
} else {
.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">
@ -401,7 +340,7 @@
.phoneCode {
width: 30%;
text-align: center;
color: #FFFFFF;
color: #ffffff;
background-color: #f35749;
padding: 12rpx;
font-size: 28rpx;

Loading…
Cancel
Save