修改进入文章1详情bug

master
chen 2022-08-12 15:36:39 +08:00
parent 0a2511967b
commit e628ae8726
22 changed files with 69 additions and 32 deletions

View File

@ -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')

View File

@ -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 => {})
},
});

View File

@ -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