Commit e73876b1 by zeven

修复迷你店显示订单问题

parent 5845778f
...@@ -40,7 +40,7 @@ axios.interceptors.request.use(config => { ...@@ -40,7 +40,7 @@ axios.interceptors.request.use(config => {
}); });
axios.interceptors.response.use(res => { axios.interceptors.response.use(res => {
// 请求拦截器,自动添加token // 请求拦截器,自动添加token
if (res.data.code < 0) { if (res.data.code < 0 && res.data.msg) {
Toast.fail(res.data.msg); Toast.fail(res.data.msg);
} }
return res; return res;
......
...@@ -160,12 +160,12 @@ class FacePage extends Component { ...@@ -160,12 +160,12 @@ class FacePage extends Component {
* @param {Boolean} timeoutt 当参数为false时会清空定时器 * @param {Boolean} timeoutt 当参数为false时会清空定时器
*/ */
orderDetailMiniPop = timeoutt => { orderDetailMiniPop = timeoutt => {
let timerr = null;
if (timeoutt === false) { if (timeoutt === false) {
this.setState({ this.setState({
orderDetailMini: false, orderDetailMini: false,
}); });
clearTimeout(timerr); clearTimeout(this.goodsCounterTimer);
clearInterval(this.goodsCounterInter);
return; return;
} else if (timeoutt === true) { } else if (timeoutt === true) {
this.setState({ this.setState({
...@@ -176,7 +176,7 @@ class FacePage extends Component { ...@@ -176,7 +176,7 @@ class FacePage extends Component {
this.setState({ this.setState({
orderDetailMini: true, orderDetailMini: true,
}); });
timerr = setTimeout(() => { this.goodsCounterTimer = setTimeout(() => {
this.setState({ this.setState({
orderDetailMini: false, orderDetailMini: false,
}); });
...@@ -385,8 +385,10 @@ class FacePage extends Component { ...@@ -385,8 +385,10 @@ class FacePage extends Component {
} else if (this.sense) { } else if (this.sense) {
this.setState({loadingModal: false}); this.setState({loadingModal: false});
if ((ret.action = 'enter')) { if ((ret.action = 'enter')) {
this.getOrderDetailMiniCounter(); this.goodsCounterInter = setInterval(() => {
this.orderDetailMiniPop(1800000); this.getOrderDetailMiniCounter();
}, 3000);
this.orderDetailMiniPop(600000); // 十分钟后关闭弹窗
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment