|
@@ -83,6 +83,12 @@
|
|
|
userMark,
|
|
|
getOrderList
|
|
|
} from '@/api/order.js';
|
|
|
+ import {
|
|
|
+ mapGetters
|
|
|
+ } from "vuex";
|
|
|
+ import {
|
|
|
+ tokenIsExistApi
|
|
|
+ } from '@/api/api.js';
|
|
|
var statusBarHeight = uni.getSystemInfoSync().statusBarHeight + 'px';
|
|
|
let app = getApp();
|
|
|
export default {
|
|
@@ -104,14 +110,19 @@
|
|
|
ProductTypeEnum,
|
|
|
change:false,
|
|
|
orderInfo:{},
|
|
|
- status: ""
|
|
|
+ status: "",
|
|
|
+ tokenIsExist: false, //校验token是否有效
|
|
|
}
|
|
|
},
|
|
|
+ computed: {
|
|
|
+ ...mapGetters(['isLogin', 'productType', 'globalData', 'bottomNavigationIsCustom']),
|
|
|
+ },
|
|
|
//下拉刷新
|
|
|
onPullDownRefresh() {
|
|
|
|
|
|
},
|
|
|
onLoad(options) {
|
|
|
+ this.getTokenIsExist();
|
|
|
let that = this;
|
|
|
//首页数据加载
|
|
|
// this.getIndexConfig();
|
|
@@ -122,13 +133,22 @@
|
|
|
this.navigationBarHeight = custom.height + (custom.top - this.statusBarHeight) * 2
|
|
|
// console.log("导航栏高度:"+this.globalData.navigationBarHeight)
|
|
|
// #endif
|
|
|
- this.getOrderList() //订单列表
|
|
|
+
|
|
|
|
|
|
},
|
|
|
onShow() {
|
|
|
|
|
|
},
|
|
|
methods: {
|
|
|
+ //校验token是否有效,true为有效,false为无效
|
|
|
+ getTokenIsExist() {
|
|
|
+ tokenIsExistApi().then(res => {
|
|
|
+ this.tokenIsExist = res.data;
|
|
|
+ if (this.isLogin && this.tokenIsExist) {
|
|
|
+ this.getOrderList() //订单列表
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
modify: function(item, status) {
|
|
|
this.change = true;
|
|
|
this.status = status.toString();
|