提交 039a17af 编写于 作者: 杨广俊's avatar 杨广俊

token 收藏

上级 ad6a5beb
...@@ -61,6 +61,7 @@ import GroupTitle from '@/components/business/group-title'; ...@@ -61,6 +61,7 @@ import GroupTitle from '@/components/business/group-title';
export default { export default {
data() { data() {
return { return {
token: '',
isShowNum: false, isShowNum: false,
list: [], list: [],
pageNo: 2, pageNo: 2,
...@@ -104,16 +105,18 @@ export default { ...@@ -104,16 +105,18 @@ export default {
}, },
}, },
created() { created() {
let _this = this
window.__getUserInfo_CA = function(params){ window.__getUserInfo_CA = function(params){
_self.setUserInfo(params) _this.token = params.userToken
_this.getData()
_this.setUserInfo(params)
} }
window.__refresh = function (parm) { window.__refresh = function (parm) {
_this.getUserInfo(); _this.getUserInfo();
} }
}, },
mounted() { mounted() {
this.getUserInfo()
}, },
computed: { computed: {
...mapGetters({ ...mapGetters({
...@@ -210,14 +213,15 @@ export default { ...@@ -210,14 +213,15 @@ export default {
}) })
let _this = this, let _this = this,
parm = { parm = {
token: _this.userInfo.userToken, token: _this.token,
type: status, type: status,
courseId: id, courseId: id,
setEntry: 'headers', setEntry: 'headers',
} }
_this.POST('contents/favors', parm).then(function (res) { _this.POST('contents/favors', parm).then(function (res) {
if (res.code === '000000') { if (res.code === '000000') {
_this.handelData(id, status); // _this.handelData(id, status);
_this.getData()
} else { } else {
rocNative.showNativeToast({ rocNative.showNativeToast({
message: '注册登陆后才能收藏哦' message: '注册登陆后才能收藏哦'
...@@ -240,31 +244,15 @@ export default { ...@@ -240,31 +244,15 @@ export default {
getData(type) { getData(type) {
let _this = this, let _this = this,
parm = { parm = {
pageNo: _this.pageNo, pageNo: 1,
pageSize: _this.pageSize, pageSize: 4,
token: _this.userToken, token: _this.token,
setEntry: 'headers' setEntry: 'headers'
} }
_this.GET('contents/courses/recommendCourseList', parm).then(function (res) { _this.GET('contents/courses/recommendCourseList', parm).then(function (res) {
if (res.code === '000000') { if (res.code === '000000') {
if (res.data == null || res.data.length == 0) { this.list = res.data || []
res.data = [];
_this.isLoading = false;
_this.noMore = true;
_this.loading = true;
_this.isReauestBack = false;
} else {
_this.isReauestBack = true;
_this.list = [..._this.list, ...res.data];
_this.isLoading = true;
_this.noMore = false;
_this.loading = false;
_this.pageNo += 1;
}
} }
}) })
} }
} }
......
...@@ -167,7 +167,7 @@ export default { ...@@ -167,7 +167,7 @@ export default {
let _this = this; let _this = this;
window.__getUserInfo = function(params){ window.__getUserInfo = function(params){
_this.token = params.userToken _this.token = params.userToken
_this.getAdjustData() // _this.getAdjustData()
_this.search() _this.search()
} }
window.__refresh = function(){ window.__refresh = function(){
...@@ -313,7 +313,7 @@ export default { ...@@ -313,7 +313,7 @@ export default {
let _this = this, let _this = this,
parm = { parm = {
pageNo: 1, pageNo: 1,
pageSize: 10, pageSize: 4,
token: _this.token, token: _this.token,
setEntry: 'headers', setEntry: 'headers',
} }
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册