Commit fd7181ce authored by mengcuiguang's avatar mengcuiguang

代码优化

parent 79ae6d66
......@@ -146,8 +146,8 @@ export default {
let requestTask;
Object.assign(header, {
token: app.globalData.token,
// token: 'AC8FA7EB65C3074472378362124462E70E762CAB0EAD1C6EABB742EB893A61C05F433703067DF5142735505C42F58997',
// token: app.globalData.token,
token: 'AC8FA7EB65C3074472378362124462E70E762CAB0EAD1C6EABB742EB893A61C05F433703067DF5142735505C42F58997',
pkgName: app.globalData.pkgName
})
......@@ -165,9 +165,9 @@ export default {
break;
default:
if (fail) {
fail(res.data.msg);
fail(res.data.message);
}
message.notify(res.data.errorMsg || res.data.msg);
message.notify(res.data.message);
break;
}
},
......
......@@ -33,7 +33,11 @@
<view style="font-size: 20rpx;margin-top: 10rpx;">{{item.title}}</view>
<view style="font-size: 18rpx;margin-top: 10rpx;"
v-if="item.orderTags!=null&&item.orderTags.length>0">
<template v-for="t in item.orderTags">{{t+' '}} </template>
<scroll-view scroll-x="true">
<block v-for="t in item.orderTags" :key="item.orderTags">
<view style="display:inline-block;margin-right: 4rpx;">{{t}} </view>
</block>
</scroll-view>
</view>
</view>
</block>
......@@ -155,11 +159,19 @@
dataList: [],
bannerList: [],
newRecordBean: null,
userInfo: app.globalData.userInfo,
topList: []
};
},
methods: {
show() {
console.log('123123123');
if (app.globalData.userInfo != 'undefined' && app.globalData.userInfo == null) {
this.visitorlogin();
} else {
this.loadPost();
}
},
visitorlogin() {
let that = this
var obj = wx.getEnterOptionsSync()
......@@ -197,7 +209,6 @@
advertiserId: advertiserId,
reqId: reqId,
creativeId: creativeId,
code: loginRes.code,
inviteUId: tempInviteUId
},
showLoading: false,
......@@ -208,16 +219,15 @@
app.globalData.userId = data.pk_id;
app.globalData.userInfo = data;
that.loadPost();
},
fail: (e) => {
// 测试使用
that.loadPost();
}
});
},
loadPost() {
console.log('showshowshowshow')
if (this.$refs.paging != null) {
this.$refs.paging.refresh();
}
// 轮播图
this.post({
url: '/vedio/topTabs',
......@@ -239,25 +249,19 @@
}
});
// 最近观看剧
this.post({
url: '/vedio/newest',
showLoading: false,
success: ({
data
}) => {
if (data.list != null && data.list.length > 0) {
this.newRecordBean = data.list[0];
}
}
});
},
show() {
if (userInfo == null) {
visitorlogin();
} else {
loadPost();
}
// this.post({
// url: '/vedio/newest',
// showLoading: false,
// success: ({
// data
// }) => {
// if (data.list != null && data.list.length > 0) {
// this.newRecordBean = data.list[0];
// }
// }
// });
},
queryList(page, size) {
// 推荐列表
this.post({
......
......@@ -89,7 +89,6 @@
advertiserId: advertiserId,
reqId: reqId,
creativeId: creativeId,
code: loginRes.code,
inviteUId: tempInviteUId
},
showLoading: false,
......@@ -99,6 +98,11 @@
app.globalData.token = data.token;
app.globalData.userId = data.pk_id;
app.globalData.userInfo = data;
},
fail: (e) => {
setTimeout(() => {
redirectTo('home');
}, 1300);
}
});
}
......
......@@ -83,8 +83,8 @@
};
},
methods: {
// show() {
loadData() {
show() {
// loadData() {
this.post({
url: '/user/baseMsg',
showLoading: false,
......
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