售后部分测试改动
This commit is contained in:
@ -407,7 +407,8 @@ export function wxappBindingPhone(data) {
|
|||||||
* 小程序上传用户头像
|
* 小程序上传用户头像
|
||||||
*/
|
*/
|
||||||
export function wxappGetUserInfo (data) {
|
export function wxappGetUserInfo (data) {
|
||||||
return request.post('/wxapp/loginAuth', data)
|
// return request.post('/wxapp/loginAuth', data)
|
||||||
|
return request.get('/wechat/auth', data)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -318,7 +318,7 @@
|
|||||||
{
|
{
|
||||||
"path": "pages/order/ReturnList/index",
|
"path": "pages/order/ReturnList/index",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "退货列表"
|
"navigationBarTitleText": "我的售后"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -29,8 +29,7 @@
|
|||||||
return {
|
return {
|
||||||
status: true,
|
status: true,
|
||||||
id: 0,
|
id: 0,
|
||||||
image: "",
|
image: ""
|
||||||
img: 'https://img-blog.csdnimg.cn/20190626120443986.png'
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
mounted () {
|
mounted () {
|
||||||
|
@ -11,6 +11,8 @@
|
|||||||
class="cu-btn author-btn"
|
class="cu-btn author-btn"
|
||||||
open-type="getPhoneNumber"
|
open-type="getPhoneNumber"
|
||||||
@getphonenumber="phoneLogin">微信手机号一键登录</button>
|
@getphonenumber="phoneLogin">微信手机号一键登录</button>
|
||||||
|
<!-- <button class="cu-btn author-btn" v-if="canIUseGetUserProfile" @tap="getUserInfoProfile">授权并查看</button>
|
||||||
|
<button class="cu-btn author-btn" v-else @getuserinfo="getUserInfoBtn" open-type="getUserInfo">授权并查看</button> -->
|
||||||
<button class="cu-btn close-btn" @tap="back">暂不登录</button>
|
<button class="cu-btn close-btn" @tap="back">暂不登录</button>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@ -35,11 +37,14 @@ import dayjs from 'dayjs'
|
|||||||
import cookie from '@/utils/store/cookie'
|
import cookie from '@/utils/store/cookie'
|
||||||
import store from '@/store'
|
import store from '@/store'
|
||||||
|
|
||||||
|
// 公众号登录
|
||||||
|
import { auth } from '@/libs/wechat.js'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
authorize: false,
|
authorize: false,
|
||||||
canIUseGetUserProfile: false,
|
canIUseGetUserProfile: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
@ -315,43 +315,44 @@ export default {
|
|||||||
startQr: function() {
|
startQr: function() {
|
||||||
uni.scanCode({
|
uni.scanCode({
|
||||||
success: res => {
|
success: res => {
|
||||||
let option = handleUrlParam(res.result)
|
let option = handleUrlParam(res.result)
|
||||||
switch (option.pageType) {
|
console.log(option)
|
||||||
case 'good':
|
switch (option.pageType) {
|
||||||
// 跳转商品详情
|
case 'good':
|
||||||
this.$yrouter.push({
|
// 跳转商品详情
|
||||||
path: '/pages/shop/GoodsCon/index',
|
this.$yrouter.push({
|
||||||
query: {
|
path: '/pages/shop/GoodsCon/index',
|
||||||
q: res.result,
|
query: {
|
||||||
},
|
q: res.result,
|
||||||
})
|
},
|
||||||
break
|
})
|
||||||
case 'group':
|
break
|
||||||
// 跳转团购
|
case 'group':
|
||||||
this.$yrouter.push({
|
// 跳转团购
|
||||||
path: '/pages/activity/GroupRule/index',
|
this.$yrouter.push({
|
||||||
query: {
|
path: '/pages/activity/GroupRule/index',
|
||||||
q: res.result,
|
query: {
|
||||||
},
|
q: res.result,
|
||||||
})
|
},
|
||||||
break
|
})
|
||||||
case 'dargain':
|
break
|
||||||
// 跳转砍价
|
case 'dargain':
|
||||||
this.$yrouter.push({
|
// 跳转砍价
|
||||||
path: '/pages/activity/DargainDetails/index',
|
this.$yrouter.push({
|
||||||
query: {
|
path: '/pages/activity/DargainDetails/index',
|
||||||
q: res.result,
|
query: {
|
||||||
},
|
q: res.result,
|
||||||
})
|
},
|
||||||
break
|
})
|
||||||
default:
|
break
|
||||||
// 跳转分销
|
default:
|
||||||
this.$yrouter.push({
|
// 跳转分销
|
||||||
path: '/pages/Loading/index',
|
this.$yrouter.push({
|
||||||
query: {},
|
path: '/pages/Loading/index',
|
||||||
})
|
query: {},
|
||||||
break
|
})
|
||||||
}
|
break
|
||||||
|
}
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
@ -1,45 +1,75 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="apply-return">
|
<view class="apply-return">
|
||||||
<view class="goodsStyle acea-row row-between" v-for="cart in orderInfo.cartInfo" :key="cart.id">
|
<!-- 售后提交 -->
|
||||||
<view class="pictrue">
|
<view class="container" v-if="selected">
|
||||||
<image :src="cart.productInfo.image" class="image" />
|
<view class="goodsStyle acea-row row-between"
|
||||||
</view>
|
v-for="cart in orderInfo.cartInfo"
|
||||||
<view class="text acea-row row-between">
|
:key="cart.id"
|
||||||
<view class="name line2">{{ cart.productInfo.storeName }}</view>
|
>
|
||||||
<view class="money">
|
<view class="pictrue">
|
||||||
<view>
|
<image :src="cart.productInfo.image" class="image" />
|
||||||
¥{{
|
</view>
|
||||||
cart.productInfo.attrInfo
|
<view class="text acea-row row-between">
|
||||||
? cart.productInfo.attrInfo.price
|
<view class="name line2">{{ cart.productInfo.storeName }}</view>
|
||||||
: cart.productInfo.price
|
<view class="money">
|
||||||
}}
|
<view>
|
||||||
|
¥{{
|
||||||
|
cart.productInfo.attrInfo
|
||||||
|
? cart.productInfo.attrInfo.price
|
||||||
|
: cart.productInfo.price
|
||||||
|
}}
|
||||||
|
</view>
|
||||||
|
<view class="num">x{{ cart.cartNum }}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="num">x{{ cart.cartNum }}</view>
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
<view class="list">
|
||||||
<view class="list">
|
|
||||||
<view class="item acea-row row-between-wrapper">
|
|
||||||
<view>退货件数</view>
|
|
||||||
<view class="num">{{ orderInfo.totalNum }}</view>
|
|
||||||
</view>
|
|
||||||
<view class="item acea-row row-between-wrapper">
|
|
||||||
<view>退款金额</view>
|
|
||||||
<view class="num">¥{{ orderInfo.payPrice }}</view>
|
|
||||||
</view>
|
|
||||||
<picker :value="reason" :range="reasonList" @change="changeReason">
|
|
||||||
<view class="item acea-row row-between-wrapper">
|
<view class="item acea-row row-between-wrapper">
|
||||||
<view>退款原因</view>
|
<view>退货件数</view>
|
||||||
<view class="num">{{reason}}</view>
|
<view class="num">{{ orderInfo.totalNum }}</view>
|
||||||
<text class="iconfont icon-jiantou"></text>
|
</view>
|
||||||
|
<view class="item acea-row row-between-wrapper">
|
||||||
|
<view>退款金额</view>
|
||||||
|
<view class="num">¥{{ orderInfo.payPrice }}</view>
|
||||||
|
</view>
|
||||||
|
<picker :value="reason" :range="reasonList" @change="changeReason">
|
||||||
|
<view class="item acea-row row-between-wrapper">
|
||||||
|
<view>退款原因</view>
|
||||||
|
<view class="num">{{reason}}</view>
|
||||||
|
<text class="iconfont icon-jiantou"></text>
|
||||||
|
</view>
|
||||||
|
</picker>
|
||||||
|
<view class="item textarea acea-row row-between">
|
||||||
|
<view>备注说明</view>
|
||||||
|
<textarea placeholder="填写备注信息,100字以内" class="num" v-model="refund_reason_wap_explain"></textarea>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="returnBnt bg-color-red" @click="submit">申请退款</view>
|
||||||
|
</view>
|
||||||
|
<!-- 选择商品 -->
|
||||||
|
<view class="selectProduct">
|
||||||
|
<view class="goodsStyle acea-row row-between"
|
||||||
|
v-for="cart in orderInfo.cartInfo"
|
||||||
|
:key="cart.id"
|
||||||
|
>
|
||||||
|
<view class="pictrue">
|
||||||
|
<image :src="cart.productInfo.image" class="image" />
|
||||||
|
</view>
|
||||||
|
<view class="text acea-row row-between">
|
||||||
|
<view class="name line2">{{ cart.productInfo.storeName }}</view>
|
||||||
|
<view class="money">
|
||||||
|
<view>
|
||||||
|
¥{{
|
||||||
|
cart.productInfo.attrInfo
|
||||||
|
? cart.productInfo.attrInfo.price
|
||||||
|
: cart.productInfo.price
|
||||||
|
}}
|
||||||
|
</view>
|
||||||
|
<view class="num">x{{ cart.cartNum }}</view>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</picker>
|
|
||||||
<view class="item textarea acea-row row-between">
|
|
||||||
<view>备注说明</view>
|
|
||||||
<textarea placeholder="填写备注信息,100字以内" class="num" v-model="refund_reason_wap_explain"></textarea>
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="returnBnt bg-color-red" @click="submit">申请退款</view>
|
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -68,13 +98,20 @@
|
|||||||
Authorization: "Bearer " + this.$store.state.token
|
Authorization: "Bearer " + this.$store.state.token
|
||||||
},
|
},
|
||||||
id: 0,
|
id: 0,
|
||||||
|
selected: true,
|
||||||
orderInfo: {},
|
orderInfo: {},
|
||||||
|
rebackList: [],
|
||||||
reasonList: [],
|
reasonList: [],
|
||||||
reason: "",
|
reason: "",
|
||||||
refund_reason_wap_explain: "",
|
refund_reason_wap_explain: "",
|
||||||
refund_reason_wap_img: []
|
refund_reason_wap_img: []
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
mounted() {
|
||||||
|
this.id = this.$yroute.query.id || 0;
|
||||||
|
this.getOrderDetail();
|
||||||
|
this.getRefundReason();
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
changeReason(e) {
|
changeReason(e) {
|
||||||
this.reason = this.reasonList[e.mp.detail.value];
|
this.reason = this.reasonList[e.mp.detail.value];
|
||||||
@ -143,11 +180,6 @@
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
this.id = this.$yroute.query.id || 0;
|
|
||||||
this.getOrderDetail();
|
|
||||||
this.getRefundReason();
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
39
pages/order/GoodsReturn/productlist.vue
Normal file
39
pages/order/GoodsReturn/productlist.vue
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
<template>
|
||||||
|
<view class="productList">
|
||||||
|
<view class="goodsStyle acea-row row-between"
|
||||||
|
v-for="cart in list"
|
||||||
|
:key="cart.id"
|
||||||
|
>
|
||||||
|
<view class="pictrue">
|
||||||
|
<image :src="cart.productInfo.image" class="image" />
|
||||||
|
</view>
|
||||||
|
<view class="text acea-row row-between">
|
||||||
|
<view class="name line2">{{ cart.productInfo.storeName }}</view>
|
||||||
|
<view class="money">
|
||||||
|
<view>
|
||||||
|
¥{{
|
||||||
|
cart.productInfo.attrInfo
|
||||||
|
? cart.productInfo.attrInfo.price
|
||||||
|
: cart.productInfo.price
|
||||||
|
}}
|
||||||
|
</view>
|
||||||
|
<view class="num">x{{ cart.cartNum }}</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
props: {
|
||||||
|
list: {
|
||||||
|
type: Array,
|
||||||
|
default: () => []
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="less">
|
||||||
|
</style>
|
@ -239,12 +239,20 @@
|
|||||||
<!-- -->
|
<!-- -->
|
||||||
<template v-if="orderInfo.shippingType == 1 && status.type == 2">
|
<template v-if="orderInfo.shippingType == 1 && status.type == 2">
|
||||||
<view class="bnt default"
|
<view class="bnt default"
|
||||||
@click="$yrouter.push({ path: '/pages/order/Logistics/index' ,query:{id:orderInfo.orderId }})">查看物流</view>
|
@click="$yrouter.push({
|
||||||
|
path: '/pages/order/Logistics/index',
|
||||||
|
query:{
|
||||||
|
id:orderInfo.orderId
|
||||||
|
}
|
||||||
|
})"
|
||||||
|
>查看物流</view>
|
||||||
|
<view class="bnt default" @click="goGoodsReturn(orderInfo)">申请退款</view>
|
||||||
<view class="bnt bg-color-red" @click="takeOrder">确认收货</view>
|
<view class="bnt bg-color-red" @click="takeOrder">确认收货</view>
|
||||||
</template>
|
</template>
|
||||||
<template v-if="orderInfo.shippingType == 1 && status.type == 3 && orderInfo.deliveryType == 'express'">
|
<template v-if="orderInfo.shippingType == 1 && status.type == 3 && orderInfo.deliveryType == 'express'">
|
||||||
<view class="bnt default"
|
<view class="bnt default"
|
||||||
@click="$yrouter.push({ path: '/pages/order/Logistics/index' ,query:{id:orderInfo.orderId }})">查看物流</view>
|
@click="$yrouter.push({ path: '/pages/order/Logistics/index' ,query:{id:orderInfo.orderId }})">查看物流</view>
|
||||||
|
<view class="bnt default" @click="goGoodsReturn(orderInfo)">申请退款</view>
|
||||||
</template>
|
</template>
|
||||||
<template v-if="orderInfo.shippingType == 1 && status.type == 4">
|
<template v-if="orderInfo.shippingType == 1 && status.type == 4">
|
||||||
<view class="bnt cancel" @click="delOrder">删除订单</view>
|
<view class="bnt cancel" @click="delOrder">删除订单</view>
|
||||||
@ -256,10 +264,20 @@
|
|||||||
<view class="bnt bg-color-red" @click="goGroupRule(orderInfo)">查看拼团</view>
|
<view class="bnt bg-color-red" @click="goGroupRule(orderInfo)">查看拼团</view>
|
||||||
</template>
|
</template>
|
||||||
</view>
|
</view>
|
||||||
<Payment v-model="pay" :types="payType" @checked="toPay" :balance="userInfo.nowMoney"></Payment>
|
<Payment
|
||||||
|
v-model="pay"
|
||||||
|
:types="payType"
|
||||||
|
@checked="toPay"
|
||||||
|
:balance="userInfo.nowMoney"
|
||||||
|
></Payment>
|
||||||
<view class="geoPage" v-if="mapShow">
|
<view class="geoPage" v-if="mapShow">
|
||||||
<iframe width="100%" height="100%" frameborder="0" scrolling="no"
|
<iframe
|
||||||
:src="'https://apis.map.qq.com/uri/v1/geocoder?coord=' + system_store.latitude + ',' +system_store.longitude +'&referer=' +mapKey"></iframe>
|
width="100%"
|
||||||
|
height="100%"
|
||||||
|
frameborder="0"
|
||||||
|
scrolling="no"
|
||||||
|
:src="'https://apis.map.qq.com/uri/v1/geocoder?coord=' + system_store.latitude + ',' +system_store.longitude +'&referer=' +mapKey"
|
||||||
|
></iframe>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
@ -329,6 +347,7 @@
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
copyClipboard,
|
copyClipboard,
|
||||||
|
// 申请退款
|
||||||
goGoodsReturn(orderInfo) {
|
goGoodsReturn(orderInfo) {
|
||||||
this.$yrouter.push({
|
this.$yrouter.push({
|
||||||
path: "/pages/order/GoodsReturn/index",
|
path: "/pages/order/GoodsReturn/index",
|
||||||
|
@ -145,199 +145,196 @@
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
async loginMobile() {
|
async loginMobile() {
|
||||||
var that = this;
|
var that = this;
|
||||||
const {
|
const {
|
||||||
account,
|
account,
|
||||||
captcha
|
captcha
|
||||||
} = that;
|
} = that;
|
||||||
try {
|
try {
|
||||||
await that
|
await that
|
||||||
.$validator({
|
.$validator({
|
||||||
account: [
|
account: [
|
||||||
required(required.message("手机号码")),
|
required(required.message("手机号码")),
|
||||||
chs_phone(chs_phone.message())
|
chs_phone(chs_phone.message())
|
||||||
],
|
],
|
||||||
captcha: [
|
captcha: [
|
||||||
required(required.message("验证码")),
|
required(required.message("验证码")),
|
||||||
alpha_num(alpha_num.message("验证码"))
|
alpha_num(alpha_num.message("验证码"))
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
.validate({
|
.validate({
|
||||||
account,
|
account,
|
||||||
captcha
|
captcha
|
||||||
});
|
});
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
return validatorDefaultCatch(e);
|
return validatorDefaultCatch(e);
|
||||||
}
|
}
|
||||||
loginMobile({
|
loginMobile({
|
||||||
phone: that.account,
|
phone: that.account,
|
||||||
captcha: that.captcha,
|
captcha: that.captcha,
|
||||||
spread: cookie.get("spread")
|
spread: cookie.get("spread")
|
||||||
})
|
})
|
||||||
.then(res => {
|
.then(res => {
|
||||||
var data = res.data;
|
var data = res.data;
|
||||||
that.$store.commit("login", data.token, dayjs(data.expires_time));
|
that.$store.commit("login", data.token, dayjs(data.expires_time));
|
||||||
handleGetUserInfo();
|
handleGetUserInfo();
|
||||||
})
|
})
|
||||||
.catch(err => {
|
.catch(err => {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: err.msg || err.response.data.msg || err.response.data.message,
|
title: err.msg || err.response.data.msg || err.response.data.message,
|
||||||
icon: "none",
|
icon: "none",
|
||||||
duration: 2000
|
duration: 2000
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
async register() {
|
async register() {
|
||||||
var that = this;
|
var that = this;
|
||||||
const {
|
const {
|
||||||
account,
|
account,
|
||||||
captcha,
|
captcha,
|
||||||
password
|
password
|
||||||
} = that;
|
} = that;
|
||||||
try {
|
try {
|
||||||
await that
|
await that
|
||||||
.$validator({
|
.$validator({
|
||||||
account: [
|
account: [
|
||||||
required(required.message("手机号码")),
|
required(required.message("手机号码")),
|
||||||
chs_phone(chs_phone.message())
|
chs_phone(chs_phone.message())
|
||||||
],
|
],
|
||||||
captcha: [
|
captcha: [
|
||||||
required(required.message("验证码")),
|
required(required.message("验证码")),
|
||||||
alpha_num(alpha_num.message("验证码"))
|
alpha_num(alpha_num.message("验证码"))
|
||||||
],
|
],
|
||||||
password: [
|
password: [
|
||||||
required(required.message("密码")),
|
required(required.message("密码")),
|
||||||
attrs.range([6, 16], attrs.range.message("密码")),
|
attrs.range([6, 16], attrs.range.message("密码")),
|
||||||
alpha_num(alpha_num.message("密码"))
|
alpha_num(alpha_num.message("密码"))
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
.validate({
|
.validate({
|
||||||
account,
|
account,
|
||||||
captcha,
|
captcha,
|
||||||
password
|
password
|
||||||
});
|
});
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
return validatorDefaultCatch(e);
|
return validatorDefaultCatch(e);
|
||||||
}
|
}
|
||||||
register({
|
register({
|
||||||
account: that.account,
|
account: that.account,
|
||||||
captcha: that.captcha,
|
captcha: that.captcha,
|
||||||
password: that.password,
|
password: that.password,
|
||||||
inviteCode: that.inviteCode,
|
inviteCode: that.inviteCode,
|
||||||
spread: cookie.get("spread")
|
spread: cookie.get("spread")
|
||||||
})
|
})
|
||||||
.then(res => {
|
.then(res => {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: res.msg,
|
title: res.msg,
|
||||||
icon: "success",
|
icon: "success",
|
||||||
duration: 2000
|
duration: 2000
|
||||||
});
|
});
|
||||||
that.formItem = 1;
|
that.formItem = 1;
|
||||||
})
|
})
|
||||||
.catch(err => {
|
.catch(err => {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: err.msg || err.response.data.msg || err.response.data.message,
|
title: err.msg || err.response.data.msg || err.response.data.message,
|
||||||
icon: "none",
|
icon: "none",
|
||||||
duration: 2000
|
duration: 2000
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
async code() {
|
async code() {
|
||||||
var that = this;
|
var that = this;
|
||||||
const {
|
const {
|
||||||
account
|
account
|
||||||
} = that;
|
} = that;
|
||||||
try {
|
try {
|
||||||
await that
|
await that
|
||||||
.$validator({
|
.$validator({
|
||||||
account: [
|
account: [
|
||||||
required(required.message("手机号码")),
|
required(required.message("手机号码")),
|
||||||
chs_phone(chs_phone.message())
|
chs_phone(chs_phone.message())
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
.validate({
|
.validate({
|
||||||
account
|
account
|
||||||
});
|
});
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
return validatorDefaultCatch(e);
|
return validatorDefaultCatch(e);
|
||||||
}
|
}
|
||||||
if (that.formItem == 2) that.type = "register";
|
if (that.formItem == 2) that.type = "register";
|
||||||
await registerVerify({
|
await registerVerify({
|
||||||
phone: that.account,
|
phone: that.account,
|
||||||
type: that.type
|
type: that.type
|
||||||
})
|
})
|
||||||
.then(res => {
|
.then(res => {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: res.msg,
|
title: res.msg,
|
||||||
icon: "success",
|
icon: "success",
|
||||||
duration: 2000
|
duration: 2000
|
||||||
});
|
});
|
||||||
that.sendCode();
|
that.sendCode();
|
||||||
})
|
})
|
||||||
.catch(err => {
|
.catch(err => {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: err.msg || err.response.data.msg || err.response.data.message,
|
title: err.msg || err.response.data.msg || err.response.data.message,
|
||||||
icon: "none",
|
icon: "none",
|
||||||
duration: 2000
|
duration: 2000
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
navTap: function (index) {
|
navTap: function (index) {
|
||||||
this.current = index;
|
this.current = index;
|
||||||
},
|
},
|
||||||
async submit() {
|
async submit() {
|
||||||
const {
|
const {
|
||||||
account,
|
account,
|
||||||
password
|
password
|
||||||
} = this;
|
} = this;
|
||||||
try {
|
try {
|
||||||
await this.$validator({
|
await this.$validator({
|
||||||
account: [
|
account: [
|
||||||
required(required.message("账号")),
|
required(required.message("账号")),
|
||||||
attrs.range([5, 16], attrs.range.message("账号")),
|
attrs.range([5, 16], attrs.range.message("账号")),
|
||||||
alpha_num(alpha_num.message("账号"))
|
alpha_num(alpha_num.message("账号"))
|
||||||
],
|
],
|
||||||
password: [
|
password: [
|
||||||
required(required.message("密码")),
|
required(required.message("密码")),
|
||||||
attrs.range([6, 16], attrs.range.message("密码")),
|
attrs.range([6, 16], attrs.range.message("密码")),
|
||||||
alpha_num(alpha_num.message("密码"))
|
alpha_num(alpha_num.message("密码"))
|
||||||
]
|
]
|
||||||
}).validate({
|
}).validate({
|
||||||
account,
|
account,
|
||||||
password
|
password
|
||||||
});
|
});
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
return validatorDefaultCatch(e);
|
return validatorDefaultCatch(e);
|
||||||
}
|
}
|
||||||
|
login({
|
||||||
|
username: account,
|
||||||
|
password,
|
||||||
|
spread: cookie.get("spread")
|
||||||
|
})
|
||||||
|
.then(({ data }) => {
|
||||||
|
this.$store.commit("login", data.token, dayjs(data.expires_time));
|
||||||
|
handleGetUserInfo();
|
||||||
|
// let replace=this.$yroute.query.replace
|
||||||
|
// if(replace){
|
||||||
|
|
||||||
login({
|
// }
|
||||||
username: account,
|
// this.$yrouter.replace({
|
||||||
password,
|
// path: this.$yroute.query.replace || '/pages/home/index'
|
||||||
spread: cookie.get("spread")
|
// });
|
||||||
})
|
})
|
||||||
.then(({
|
.catch(err => {
|
||||||
data
|
console.log(err);
|
||||||
}) => {
|
uni.showToast({
|
||||||
this.$store.commit("login", data.token, dayjs(data.expires_time));
|
title: err.msg || err.response.data.msg || err.response.data.message,
|
||||||
handleGetUserInfo();
|
icon: "none",
|
||||||
// let replace=this.$yroute.query.replace
|
duration: 2000
|
||||||
// if(replace){
|
});
|
||||||
|
});
|
||||||
// }
|
}
|
||||||
// this.$yrouter.replace({
|
|
||||||
// path: this.$yroute.query.replace || '/pages/home/index'
|
|
||||||
// });
|
|
||||||
})
|
|
||||||
.catch(err => {
|
|
||||||
console.log(err);
|
|
||||||
uni.showToast({
|
|
||||||
title: err.msg || err.response.data.msg || err.response.data.message,
|
|
||||||
icon: "none",
|
|
||||||
duration: 2000
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
@ -314,7 +314,6 @@ export default {
|
|||||||
iv: res.iv,
|
iv: res.iv,
|
||||||
code: loginRes.code, // 开发code
|
code: loginRes.code, // 开发code
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
console.log(res === 200)
|
|
||||||
if (res.status === 200) {
|
if (res.status === 200) {
|
||||||
this.userInfo.avatar = res.data.avatar
|
this.userInfo.avatar = res.data.avatar
|
||||||
this.userInfo.nickname = res.data.nickname
|
this.userInfo.nickname = res.data.nickname
|
||||||
|
@ -524,7 +524,7 @@ export const handleLoginStatus = (location, complete, fail, success) => {
|
|||||||
|
|
||||||
// 是否可以访问
|
// 是否可以访问
|
||||||
let isAuth = false
|
let isAuth = false
|
||||||
console.log('即将跳转', location, parseUrl(location))
|
// console.log('即将跳转', location, parseUrl(location))
|
||||||
|
|
||||||
// 从 location 中获取当前url,location typeof string || object
|
// 从 location 中获取当前url,location typeof string || object
|
||||||
let path = ''
|
let path = ''
|
||||||
|
@ -22,12 +22,12 @@ fly.config.baseURL = VUE_APP_API_URL
|
|||||||
|
|
||||||
// 小程序请求域名
|
// 小程序请求域名
|
||||||
// #ifdef MP-WEIXIN
|
// #ifdef MP-WEIXIN
|
||||||
fly.config.baseURL = 'http://itxzz.51vip.biz/api'
|
fly.config.baseURL = 'http://347i13244b.zicp.vip/api'
|
||||||
// #endif
|
// #endif
|
||||||
|
|
||||||
// #ifdef APP-PLUS
|
// #ifdef APP-PLUS
|
||||||
// app端
|
// app端
|
||||||
fly.config.baseURL = 'http://itxzz.51vip.biz/api'
|
fly.config.baseURL = 'http://347i13244b.zicp.vip/api'
|
||||||
// #endif
|
// #endif
|
||||||
|
|
||||||
fly.interceptors.response.use(
|
fly.interceptors.response.use(
|
||||||
|
Reference in New Issue
Block a user