Commit fd7181ce authored by mengcuiguang's avatar mengcuiguang

代码优化

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