-
diff --git a/pages/tabbar/user/similarGoods.vue b/pages/tabbar/user/similarGoods.vue
index 523c73b..fe15f8b 100644
--- a/pages/tabbar/user/similarGoods.vue
+++ b/pages/tabbar/user/similarGoods.vue
@@ -86,7 +86,7 @@
},
onLoad(option) {
this.goods = JSON.parse(decodeURIComponent(option.goods))
- console.log(this.goods)
+
this.getList()
},
onReachBottom() { //触底事件,页面整个滚动使用
diff --git a/store/index.js b/store/index.js
index c85fe2d..50e0158 100644
--- a/store/index.js
+++ b/store/index.js
@@ -3,7 +3,7 @@ import Vuex from "vuex";
import storage from "@/utils/storage";
Vue.use(Vuex);
-//console.log("Vuex:",Vuex)
+
const store = new Vuex.Store({
state: {
verificationKey: "", //获取key表示验证通过
@@ -48,7 +48,6 @@ const store = new Vuex.Store({
// 登录信息
SET_USER_INFO(state, val) {
state.userInfo = val;
- // console.log("SET_USER_INFO",val)
},
login(state, userInfo) {
@@ -56,7 +55,6 @@ const store = new Vuex.Store({
state.userName =
userInfo.Name || userInfo.Nickname || userInfo.Username || "匿名用户";
state.hasLogin = true;
- console.log("state:", state);
},
logout(state) {
state.userName = "";
diff --git a/utils/filters.js b/utils/filters.js
index 93e4fde..5e87135 100644
--- a/utils/filters.js
+++ b/utils/filters.js
@@ -116,3 +116,39 @@ export function getPages(val) {
return val ? currentPage : url;
}
+
+/**
+ * 服务状态列表
+ */
+export function serviceStatusList(val) {
+ let statusList = {
+ APPLY: "申请售后",
+ PASS: "通过售后",
+ REFUSE: "拒绝售后",
+ BUYER_RETURN: "买家退货,待卖家收货",
+ SELLER_RE_DELIVERY: "商家换货/补发",
+ SELLER_CONFIRM: "卖家确认收货",
+ SELLER_TERMINATION: "卖家终止售后",
+ BUYER_CONFIRM: "买家确认收货",
+ BUYER_CANCEL: "买家取消售后",
+ WAIT_REFUND: "等待平台退款",
+ COMPLETE: "完成售后",
+ };
+ return statusList[val];
+}
+
+/**
+ * 订单状态列表
+ */
+export function orderStatusList(val) {
+ let orderStatusList = {
+ UNDELIVERED: "待发货",
+ UNPAID: "未付款",
+ PAID: "已付款",
+ DELIVERED: "已发货",
+ CANCELLED: "已取消",
+ COMPLETE: "已完成",
+ TAKE: "已完成",
+ };
+ return orderStatusList[val];
+}
diff --git a/utils/request.js b/utils/request.js
index 9923939..e253cbe 100644
--- a/utils/request.js
+++ b/utils/request.js
@@ -23,10 +23,9 @@ function getTokenDebounce() {
return async function () {
if (!lock) {
lock = true;
- console.log('dd')
- await refreshTokenFn(storage.getRefreshToken())
+ console.log("dd");
+ await refreshTokenFn(storage.getRefreshToken())
.then((res) => {
-
if (res.data.success) {
let { accessToken, refreshToken } = res.data.result;
storage.setAccessToken(accessToken);
@@ -34,29 +33,25 @@ function getTokenDebounce() {
success = true;
lock = false;
} else {
-
cleanStorage();
success = false;
lock = false;
}
})
.catch((error) => {
- console.log(error)
+ console.log(error);
cleanStorage();
success = false;
lock = false;
});
-
-
}
return new Promise((resolve) => {
// XXX 我只能想到通过轮询来看获取新的token是否结束,有好的方案可以说。一直看lock,直到请求失败或者成功
const timer = setInterval(() => {
if (!lock) {
clearInterval(timer);
-
+
if (success) {
-
resolve("success");
} else {
cleanStorage();
@@ -74,7 +69,9 @@ function cleanStorage() {
icon: "none",
duration: 1500,
});
- if(uni.showLoading()){ uni.hideLoading();}
+ if (uni.showLoading()) {
+ uni.hideLoading();
+ }
storage.setHasLogin(false);
storage.setAccessToken("");
@@ -144,30 +141,23 @@ http.interceptors.response.use(
/* 请求之后拦截器。可以使用async await 做异步操作 */
// token存在并且token过期
let token = storage.getAccessToken();
-
+
if (token && response.statusCode === 403) {
- expireToken.includes(token) ?cleanStorage() :""
+ expireToken.includes(token) ? cleanStorage() : "";
// jwt token 过期了
expireToken.push(token); // 把过期token 储存
-
const currentToken = storage.getAccessToken();
-
if (expireToken.includes(currentToken)) {
-
// 本地储存的是过期token了,重新获取
const getTokenResult = await refreshToken();
-
if (getTokenResult === "success") {
// 获取新的token成功
-
try {
const repeatRes = await reReqest.request(
configHandle(response.config)
);
response = repeatRes;
- } catch (err) {
-
- }
+ } catch (err) {}
} else {
cleanStorage();
}
@@ -176,26 +166,25 @@ http.interceptors.response.use(
const repeatRes = await reReqest.request(
configHandle(response.config)
);
-
response = repeatRes;
} catch (err) {
cleanStorage();
}
}
+ // 如果当前返回没登录
} else if (response.statusCode === 403 || response.data.code === 403) {
cleanStorage();
- } else if (response.statusCode == 200 && !response.data.success) {
+ // 如果当前状态码为正常但是success为不正常时
+ } else if (response.statusCode == 200 && !response.data.success || response.statusCode == 400) {
uni.showToast({
title: response.data.message,
icon: "none",
duration: 1500,
});
-
}
return response;
},
(error) => {
- // 请求错误做点什么。可以使用async await 做异步操作
return response;
}
);
diff --git a/uview-ui/components/u-number-box/u-number-box.vue b/uview-ui/components/u-number-box/u-number-box.vue
index ee99f61..b8d43f1 100644
--- a/uview-ui/components/u-number-box/u-number-box.vue
+++ b/uview-ui/components/u-number-box/u-number-box.vue
@@ -152,7 +152,7 @@
this.inputVal = v1
// 只有value的改变是来自外部的时候,才去同步inputVal的值,否则会造成循环错误
// if(!this.changeFromInner) {
- // console.log('change')
+
// this.inputVal = v1;
// // 因为inputVal变化后,会触发this.handleChange(),在其中changeFromInner会再次被设置为true,
// // 造成外面修改值,也导致被认为是内部修改的混乱,这里进行this.$nextTick延时,保证在运行周期的最后处
@@ -165,7 +165,7 @@
immediate: true
},
inputVal(v1, v2) {
- // console.log(v1)
+
// 为了让用户能够删除所有输入值,重新输入内容,删除所有值后,内容为空字符串
if (v1 == '') return;
let value = 0;