修改进入文章1详情bug
parent
0a2511967b
commit
e628ae8726
|
@ -75,6 +75,7 @@
|
|||
uni.removeStorageSync('urlparams');
|
||||
},
|
||||
mounted() {
|
||||
console.log(1234);
|
||||
this.appletImg = uni.getStorageSync('appletImg');
|
||||
// 转发进入:获取页面路径
|
||||
let pages = getCurrentPages(); //获取加载的页面
|
||||
|
@ -112,12 +113,13 @@
|
|||
if(res.data.data.token!=''){
|
||||
uni.setStorageSync('token',res.data.data.token); // 缓存token
|
||||
uni.setStorageSync('openid',res.data.data.openid)//缓存openid
|
||||
uni.setStorageSync('userId',res.data.data.account_id)//缓存用户id
|
||||
uni.setStorageSync('expire',res.data.data.expire); // 缓存失效时间(时间戳格式)
|
||||
uni.setStorageSync('phone_active',res.data.data.phone_active); // 是否绑定手机号
|
||||
uni.setStorageSync('is_active',res.data.data.is_active)//是否第一次授权
|
||||
if(res.data.data.phone_active==0 || res.data.data.is_active==0) {
|
||||
this.showAuth = true;
|
||||
this.$requst.post('user/first-enter',{openid:res.data.data.openid,path:uni.getStorageSync('urlparams')}).then(res=>{})
|
||||
// this.$requst.post('user/first-enter',{openid:res.data.data.openid,path:uni.getStorageSync('urlparams')}).then(res=>{})
|
||||
} else {
|
||||
uni.reLaunch({ // 重新进入当前页面
|
||||
url:uni.getStorageSync('urlparams')
|
||||
|
|
|
@ -233,9 +233,9 @@
|
|||
path:this.pagePath,
|
||||
openid:res.data.openid
|
||||
}).then(res=>{})
|
||||
if(res.data.is_active==0 || res.data.phone_active==0) {
|
||||
this.$requst.post('user/first-enter',{openid:res.data.openid,path:this.pagePath}).then(res=>{})
|
||||
}
|
||||
// if(res.data.is_active==0 || res.data.phone_active==0) {
|
||||
// this.$requst.post('user/first-enter',{openid:res.data.openid,path:this.pagePath}).then(res=>{})
|
||||
// }
|
||||
},error => {})
|
||||
},
|
||||
});
|
||||
|
@ -276,9 +276,9 @@
|
|||
openid:res.data.openid
|
||||
}).then(res=>{})
|
||||
}
|
||||
if(res.data.is_active==0 || res.data.phone_active==0) {
|
||||
this.$requst.post('user/first-enter',{openid:res.data.openid,path:this.pagePath}).then(res=>{})
|
||||
}
|
||||
// if(res.data.is_active==0 || res.data.phone_active==0) {
|
||||
// this.$requst.post('user/first-enter',{openid:res.data.openid,path:this.pagePath}).then(res=>{})
|
||||
// }
|
||||
},error => {})
|
||||
},
|
||||
});
|
||||
|
|
|
@ -209,7 +209,6 @@
|
|||
|
||||
// 调用tools.js中的种植埋点事件
|
||||
this.$toolAll.tools.plantPoint(4,this.detailObj.id);
|
||||
console.log(`/pagesB/problemDetail/problemDetail?id=${this.detailObj.id}&category_id=${this.category_id}&share_id=${uni.getStorageSync('userId')}&invite_code=${uni.getStorageSync('invite_code')}`);
|
||||
var shareObj = {
|
||||
title: `${ya.detailObj.title}`, // 默认是小程序的名称(可以写slogan等)
|
||||
path: `/pagesB/problemDetail/problemDetail?id=${this.detailObj.id}&category_id=${this.category_id}&share_id=${uni.getStorageSync('userId')}&invite_code=${uni.getStorageSync('invite_code')}`, // 默认是当前页面,必须是以‘/’开头的完整路径
|
||||
|
@ -227,6 +226,7 @@
|
|||
this.isAutoPlay = false;
|
||||
},
|
||||
onLoad(options) {
|
||||
console.log(uni.getStorageSync('phone_active'),uni.getStorageSync('is_active'));
|
||||
if(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){
|
||||
if (options.category_id != undefined) {
|
||||
this.category_id = options.category_id
|
||||
|
@ -237,10 +237,45 @@
|
|||
this.$toolAll.tools.plantPoint(1,options.id);
|
||||
}
|
||||
} else {
|
||||
console.log(options);
|
||||
let pages = getCurrentPages(); //获取加载的页面
|
||||
let currentPage = pages[pages.length - 1]; //获取当前页面的对象
|
||||
let data = currentPage.options;
|
||||
if (options.category_id != undefined) {
|
||||
this.category_id = options.category_id
|
||||
this.checkDetail(options.id);
|
||||
this.timer = setInterval(()=>{
|
||||
if(uni.getStorageSync('userId')){
|
||||
|
||||
}
|
||||
},200)
|
||||
uni.login({
|
||||
provider: 'weixin',
|
||||
success: (res)=> {
|
||||
if (res.code) {
|
||||
var params = {
|
||||
code: res.code,
|
||||
invite_code: data.invite_code || '', // 用户邀请码
|
||||
source_code: data.source_code || '', // 渠道
|
||||
channel: data.channel || ''
|
||||
}
|
||||
uni.request({
|
||||
url: `${uni.getStorageSync('hostapi')}user/login`,
|
||||
method: 'GET',
|
||||
data: params,
|
||||
success: result => {
|
||||
if(result.data.data.token!=''){
|
||||
uni.setStorageSync('token',result.data.data.token); // 缓存token
|
||||
uni.setStorageSync('userId',result.data.data.account_id)//缓存用户id
|
||||
uni.setStorageSync('expire',result.data.data.expire); // 缓存失效时间(时间戳格式)
|
||||
uni.setStorageSync('phone_active',result.data.data.phone_active); // 是否绑定手机号
|
||||
uni.setStorageSync('is_active',result.data.data.is_active)//是否第一次授权
|
||||
this.share_id = result.data.data.account_id;
|
||||
this.checkDetail(options.id);
|
||||
}
|
||||
},
|
||||
})
|
||||
}
|
||||
},
|
||||
});
|
||||
// 调用tools.js中的种植埋点事件
|
||||
this.$toolAll.tools.plantPoint(1,options.id);
|
||||
}
|
||||
|
@ -330,7 +365,6 @@
|
|||
}).then(res => {
|
||||
// console.log('详情数据:',res);
|
||||
if (res.code == 0) {
|
||||
this.isLoading = true
|
||||
// 栏目类别
|
||||
if (res.data.category.length != 0) {
|
||||
res.data.category.forEach((item, index) => {
|
||||
|
@ -347,7 +381,6 @@
|
|||
// 默认选中的栏目
|
||||
if (item.active == 1) this.active = this.cateCurrent = index
|
||||
// 默认展示栏目详情
|
||||
console.log(this.category_id,item.id);
|
||||
if (this.category_id == item.id) this.isNum = index
|
||||
})
|
||||
this.contentVal = this.cateList[this.cateCurrent].title.slice(2);
|
||||
|
@ -355,11 +388,13 @@
|
|||
this.newHeight = '200';
|
||||
}
|
||||
}
|
||||
console.log(this.isNum,this.cateCurrent);
|
||||
// 详情
|
||||
this.detailObj = res.data.detail;
|
||||
if(uni.getStorageSync('phone_active')!=1){
|
||||
this.ifNeedAuth = this.detailObj.need_permission ? true : false;
|
||||
this.isLoading = this.detailObj.need_permission ? false : true;
|
||||
} else {
|
||||
this.isLoading = true;
|
||||
}
|
||||
// 是否显示swiper
|
||||
this.ifSwiper = this.detailObj.images_show;
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue