修改商城医生选择bug
parent
306949fc25
commit
e8f3205187
|
@ -84,7 +84,7 @@
|
|||
this.showAuth = true;
|
||||
}
|
||||
let pagesArr = getCurrentPages();
|
||||
console.log(pagesArr.length,'获取页面栈大小');
|
||||
// console.log(pagesArr.length,'获取页面栈大小');
|
||||
if(pagesArr.length==1) {
|
||||
uni.setStorageSync('outside',6);
|
||||
}
|
||||
|
@ -161,6 +161,7 @@
|
|||
uni.setStorageSync('token',res.data.token); // 缓存token
|
||||
uni.setStorageSync('expire',res.data.expire); // 缓存失效时间(时间戳格式)
|
||||
uni.setStorageSync('invite_code',res.data.invite_code); // 缓存用户邀请码
|
||||
uni.setStorageSync('is_active',res.data.is_active);
|
||||
uni.setStorageSync('phone_active',res.data.phone_active); // 是否第一次授权
|
||||
this.isAnimation++;
|
||||
if(res.data.phone_active==1){
|
||||
|
|
|
@ -245,7 +245,7 @@ const tools = {
|
|||
// 判断是否授权,没授权,前往登录页面授权
|
||||
judgeAuth(){
|
||||
let auth = true;
|
||||
if(uni.getStorageSync('phone_active')==0) {
|
||||
if(uni.getStorageSync('phone_active')==0 || uni.getStorageSync('is_active')==0) {
|
||||
uni.navigateTo({url:'/pages/login/login'});
|
||||
auth = false
|
||||
} else {
|
||||
|
@ -347,7 +347,7 @@ const tools = {
|
|||
var date = new Date();
|
||||
var timestamp = date.getTime();//精确到毫秒
|
||||
// 如果过期时间 减 10分钟 小于当前时间,刷新token
|
||||
if((uni.getStorageSync('expire')*1000 - 600000) < timestamp) {
|
||||
if((uni.getStorageSync('expire')*1000 - 600000) < timestamp && uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0) {
|
||||
// 调用登录事件
|
||||
this.loginEv();
|
||||
}
|
||||
|
@ -368,6 +368,7 @@ const tools = {
|
|||
uni.setStorageSync('token',res.data.data.token); // 缓存token
|
||||
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)//是否第一次授权
|
||||
}
|
||||
}
|
||||
})
|
||||
|
|
|
@ -167,6 +167,7 @@
|
|||
uni.setStorageSync('token',res.data.token)//缓存token
|
||||
uni.setStorageSync('expire',res.data.expire)//缓存失效时间(时间戳格式)
|
||||
uni.setStorageSync('phone_active',res.data.phone_active)//是否第一次授权
|
||||
uni.setStorageSync('is_active',res.data.is_active)//是否第一次授权
|
||||
uni.setStorageSync('invite_code',res.data.invite_code)
|
||||
uni.hideToast()
|
||||
// if(res.data.phone_active!=1){
|
||||
|
|
|
@ -212,14 +212,14 @@
|
|||
this.$toolAll.tools.plantPoint(7);
|
||||
this.checkSwi()
|
||||
|
||||
if(uni.getStorageSync('phone_active')!=0){
|
||||
if(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){
|
||||
this.checkBZ()//调用病种列表事件
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
this.$toolAll.tools.isLogin();
|
||||
this.isAutoPlay = true;
|
||||
if(uni.getStorageSync('phone_active')!=0){
|
||||
if(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){
|
||||
if(this.category_id!='') this.checkCate(this.category_id)//调用左侧列表点击事件
|
||||
this.$requst.post('index/mini-program-setting').then(res=>{
|
||||
// log('数据:',res);
|
||||
|
|
|
@ -238,7 +238,7 @@
|
|||
uni.removeStorageSync('uinfo')//清空用户缓存信息
|
||||
this.$toolAll.tools.isLogin();
|
||||
uni.removeStorageSync('shareAll')//清空分享中心里的统计信息
|
||||
if(uni.getStorageSync('phone_active')!=0){
|
||||
if(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){
|
||||
this.checkInfo();
|
||||
this.$requst.post('index/mini-program-setting').then(res=>{
|
||||
// log('数据:',res);
|
||||
|
|
|
@ -198,11 +198,12 @@
|
|||
this.$requst.post('user/login',params).then(res => {
|
||||
uni.setStorageSync('phone_active',res.data.phone_active);
|
||||
uni.setStorageSync('invite_code',res.data.invite_code);
|
||||
uni.setStorageSync('is_active',res.data.is_active)//是否第一次授权
|
||||
uni.setStorageSync('token',res.data.token);
|
||||
},error => {})
|
||||
},
|
||||
});
|
||||
} else if(uni.getStorageSync('token')=='' || uni.getStorageSync('phone_active')==0){
|
||||
} else if(uni.getStorageSync('token')=='' || uni.getStorageSync('phone_active')==0 && uni.getStorageSync('is_active')!=0){
|
||||
this.loginEv(options);
|
||||
}
|
||||
const query = wx.createSelectorQuery()
|
||||
|
@ -236,6 +237,7 @@
|
|||
this.$requst.post('user/login',params).then(res => {
|
||||
uni.setStorageSync('phone_active',res.data.phone_active);
|
||||
uni.setStorageSync('invite_code',res.data.invite_code);
|
||||
uni.setStorageSync('is_active',res.data.is_active)//是否第一次授权
|
||||
uni.setStorageSync('token',res.data.token);
|
||||
},error => {})
|
||||
},
|
||||
|
@ -523,8 +525,16 @@
|
|||
searchEv(){//搜索事件
|
||||
// log(this.searchVal);
|
||||
if(this.$toolAll.tools.judgeAuth()){
|
||||
uni.navigateTo({
|
||||
url:'/pagesB/searchPage/searchPage?keyWorld='+this.searchVal
|
||||
this.$requst.post('archives/keyword-check',{keyword:this.searchVal}).then(res=>{
|
||||
if(res.data.has) {
|
||||
uni.navigateTo({
|
||||
url:`/${res.data.target}`
|
||||
})
|
||||
} else {
|
||||
uni.navigateTo({
|
||||
url:'/pagesB/searchPage/searchPage?keyWorld='+this.searchVal
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
<view v-if="doctorVal!=''">{{doctorVal}}<view class="mar-z10" @tap="deleteSX(1)">×</view></view>
|
||||
<view v-if="activityVal!=''">{{activityVal}}<view class="mar-z10" @tap="deleteSX(2)">×</view></view>
|
||||
</view>
|
||||
<view v-if="isXiao">
|
||||
<view v-if="isXiao" @tap="doctorBlur">
|
||||
<view class="pad-zy30">
|
||||
<view class="mar-s50 mar-x20 fon28 bold">{{cateTitle}}</view>
|
||||
<view class="disac fw">
|
||||
|
@ -34,9 +34,9 @@
|
|||
<view v-if="activeIndex==1">
|
||||
<view class="fon28 bold mar-sx40">医生选择</view>
|
||||
<view class="posir">
|
||||
<input disabled @tap="chooseEv" type="text" class="mar-x40" v-model="doctor_name" placeholder="请输入医生姓名并选择" />
|
||||
<view v-if="showDoctor" class="posia" style="top: 52px;left: 0;right: 0;border: 1rpx solid #E6E6E6;padding: 20rpx;background: #FFFFFF;">
|
||||
<view @tap="chooseDoctor(index)" class="disjbac fon28 col9" v-for="(item,index) in doctorList" :key="index">
|
||||
<input @tap.stop="chooseEv" type="text" class="mar-x40" v-model="doctor_name" placeholder="请输入医生姓名并选择" />
|
||||
<view v-if="showDoctor" class="posia" style="top: 52px;left: 0;right: 0;border: 1rpx solid #E6E6E6;padding: 20rpx;background: #FFFFFF;max-height: 400rpx;overflow: hidden;overflow-y: scroll;">
|
||||
<view @tap.stop="chooseDoctor(index)" class="disjbac fon28 col9" v-for="(item,index) in doctorList" :key="index">
|
||||
<span>姓名:{{item.doctor_extra.name}}</span>
|
||||
<!-- <span>部门:{{item.doctor_extra.skill}}</span> -->
|
||||
</view>
|
||||
|
@ -46,12 +46,12 @@
|
|||
</view>
|
||||
<!-- 重置、筛选 -->
|
||||
<view class="disjbac pad-zy20 mar-s50 mar-x30 pad-s20">
|
||||
<view @tap="chongz">重置</view>
|
||||
<view @tap.stop="chongz">重置</view>
|
||||
<view @tap.stop="shaix">筛选</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="isXiao" @tap="isXiao=false" class="moban"></view>
|
||||
<view v-if="isXiao" @tap="closePop" class="moban"></view>
|
||||
<!-- 数据列表 -->
|
||||
<!-- <view v-if="loading" :style="{marginTop:statusHNH+titleHeight+(isClick?52:0)+'px'}"> -->
|
||||
<view v-if="loading" :style="{marginTop:(gaodu==242?titleHeight : 0)+'px'}">
|
||||
|
@ -244,7 +244,7 @@
|
|||
// 调用查询轮播事件
|
||||
this.checkSwi();
|
||||
|
||||
if(uni.getStorageSync('phone_active')!=0){
|
||||
if(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){
|
||||
this.checkSX();
|
||||
this.$requst.post('index/mini-program-setting').then(res=>{
|
||||
// log('数据:',res);
|
||||
|
@ -317,20 +317,25 @@
|
|||
this.showDoctor = false;
|
||||
},
|
||||
chooseEv(){//查询医生列表
|
||||
console.log(this.dataList.length);
|
||||
if(this.dataList.length){
|
||||
this.$requst.post('user/doctor-list',{page:1,size:1000}).then(res=>{
|
||||
if(res.code==0){
|
||||
this.doctor_name = '';
|
||||
if(res.data.list.length!=0){
|
||||
this.showDoctor = true;
|
||||
this.doctorList = res.data.list;
|
||||
} else this.$toolAll.tools.showToast('暂无医生可选');
|
||||
} else this.$toolAll.tools.showToast(res.msg);
|
||||
})
|
||||
},
|
||||
// 医生选择失去焦点
|
||||
doctorBlur(){
|
||||
setTimeout(()=>{
|
||||
this.showDoctor = false;
|
||||
} else {
|
||||
this.$requst.post('user/doctor-list',{page:1,size:1000}).then(res=>{
|
||||
if(res.code==0){
|
||||
this.doctor_name = '';
|
||||
if(res.data.list.length!=0){
|
||||
this.showDoctor = true;
|
||||
this.doctorList = res.data.list;
|
||||
} else this.$toolAll.tools.showToast('暂无医生可选');
|
||||
} else this.$toolAll.tools.showToast(res.msg);
|
||||
})
|
||||
}
|
||||
},500)
|
||||
},
|
||||
closePop(){
|
||||
this.isXiao = false;
|
||||
this.showDoctor = false;
|
||||
},
|
||||
cartNumEv(){//购物车数量
|
||||
this.$requst.post('order/shopping-cart-count',{type:'spu'}).then(res=>{
|
||||
|
|
|
@ -89,7 +89,7 @@
|
|||
},
|
||||
onShow() {
|
||||
this.$toolAll.tools.isLogin();
|
||||
if(uni.getStorageSync('phone_active')!=0){
|
||||
if(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){
|
||||
this.checkList();
|
||||
}
|
||||
},
|
||||
|
|
|
@ -88,7 +88,7 @@
|
|||
// console.log('状态栏+标题栏:',rect);
|
||||
this.chuTop = rect.height;
|
||||
}).exec()
|
||||
if(uni.getStorageSync('phone_active')!=0){
|
||||
if(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){
|
||||
this.checkAllList(0);
|
||||
}
|
||||
},
|
||||
|
|
|
@ -90,7 +90,7 @@
|
|||
this.$toolAll.tools.isLogin();
|
||||
},
|
||||
onLoad(options) {
|
||||
if(uni.getStorageSync('phone_active')!=0){
|
||||
if(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){
|
||||
this.checkInfo();
|
||||
this.checkList();
|
||||
}
|
||||
|
|
|
@ -77,7 +77,7 @@
|
|||
},
|
||||
onShow() {
|
||||
this.$toolAll.tools.isLogin()
|
||||
if(uni.getStorageSync('phone_active')!=0){
|
||||
if(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){
|
||||
this.$toolAll.tools.showToast('加载中...','loading')
|
||||
this.checkPoint()//调用自主预约列表事件
|
||||
}
|
||||
|
|
|
@ -74,7 +74,7 @@
|
|||
this.$toolAll.tools.isLogin();
|
||||
},
|
||||
onLoad(options) {
|
||||
if(uni.getStorageSync('phone_active')!=0){
|
||||
if(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){
|
||||
this.checkList();
|
||||
this.checkInfo();
|
||||
}
|
||||
|
|
|
@ -110,7 +110,7 @@
|
|||
this.$toolAll.tools.isLogin();
|
||||
},
|
||||
onLoad(options) {
|
||||
if(uni.getStorageSync('phone_active')!=0){
|
||||
if(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){
|
||||
// 查询要编辑日记的信息
|
||||
if(options.id!=undefined){
|
||||
this.checkDiaryInfo(options.id);
|
||||
|
|
|
@ -59,7 +59,7 @@
|
|||
},
|
||||
onShow() {
|
||||
this.$toolAll.tools.isLogin()
|
||||
if(uni.getStorageSync('phone_active')!=0){
|
||||
if(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){
|
||||
this.checkDiaryEv();
|
||||
}
|
||||
},
|
||||
|
|
|
@ -122,7 +122,7 @@
|
|||
},
|
||||
onLoad(options) {
|
||||
this.isWhere = options.isWhere;
|
||||
if(uni.getStorageSync('phone_active')!=0){
|
||||
if(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){
|
||||
this.checkList();
|
||||
}
|
||||
},
|
||||
|
|
|
@ -174,7 +174,7 @@
|
|||
// 禁用小程序分享
|
||||
this.$toolAll.tools.disableShareEv();
|
||||
this.$toolAll.tools.isLogin();
|
||||
if(uni.getStorageSync('phone_active')!=0){
|
||||
if(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){
|
||||
this.checkZT(this.activeIndex);
|
||||
this.checkList(this.activeIndex);
|
||||
}
|
||||
|
|
|
@ -103,7 +103,7 @@
|
|||
this.$toolAll.tools.isLogin();
|
||||
},
|
||||
onLoad(options) {
|
||||
if(uni.getStorageSync('phone_active')!=0){
|
||||
if(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){
|
||||
this.checkInfo();
|
||||
this.checkList(this.ntype);
|
||||
}
|
||||
|
|
|
@ -84,7 +84,7 @@
|
|||
// 调用tools.js中的种植埋点事件
|
||||
this.$toolAll.tools.plantPoint(12);
|
||||
|
||||
if(uni.getStorageSync('phone_active')!=0){
|
||||
if(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){
|
||||
this.checkList();
|
||||
}
|
||||
},
|
||||
|
|
|
@ -117,7 +117,7 @@
|
|||
onLoad() {
|
||||
this.category = this.xialone[0]
|
||||
this.categoryT = this.xialTwo[0]
|
||||
if(uni.getStorageSync('phone_active')!=0){
|
||||
if(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){
|
||||
this.checkZParmas();
|
||||
this.lphone = uni.getStorageSync('phone');
|
||||
}
|
||||
|
|
|
@ -88,7 +88,7 @@
|
|||
},
|
||||
onLoad(options) {
|
||||
options.isScore=='score' ? this.isScore = 'score' : ''
|
||||
if(uni.getStorageSync('phone_active')!=0){
|
||||
if(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){
|
||||
this.checkList();
|
||||
}
|
||||
},
|
||||
|
|
|
@ -80,7 +80,7 @@
|
|||
this.$toolAll.tools.isLogin();
|
||||
},
|
||||
onLoad() {
|
||||
if(uni.getStorageSync('phone_active')!=0){
|
||||
if(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){
|
||||
this.checkTime();
|
||||
this.checkList();
|
||||
}
|
||||
|
|
|
@ -96,7 +96,7 @@
|
|||
this.$toolAll.tools.isLogin()
|
||||
},
|
||||
onLoad() {
|
||||
if(uni.getStorageSync('phone_active')!=0){
|
||||
if(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){
|
||||
this.checkCate();
|
||||
this.tphone = uni.getStorageSync('phone');
|
||||
this.$requst.post('index/mini-program-setting').then(res=>{
|
||||
|
|
|
@ -102,7 +102,7 @@
|
|||
},
|
||||
onLoad(options) {
|
||||
this.checkSwi()
|
||||
if(uni.getStorageSync('phone_active')!=0){
|
||||
if(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){
|
||||
this.checkAbout(this.category_id)
|
||||
}
|
||||
},
|
||||
|
|
|
@ -106,7 +106,7 @@
|
|||
onLoad(options) {
|
||||
this.detailId = options.id
|
||||
this.category_id = options.category_id
|
||||
if(uni.getStorageSync('phone_active')!=0){
|
||||
if(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){
|
||||
this.checkDetail(options.id);
|
||||
this.checkAbout(this.category_id);
|
||||
}
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
this.$toolAll.tools.isLogin()
|
||||
},
|
||||
onLoad() {
|
||||
if(uni.getStorageSync('phone_active')!=0){
|
||||
if(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){
|
||||
this.checkImg()
|
||||
}
|
||||
},
|
||||
|
|
|
@ -76,7 +76,7 @@
|
|||
this.$toolAll.tools.isLogin();
|
||||
},
|
||||
onLoad(options) {
|
||||
if(uni.getStorageSync('phone_active')!=0){
|
||||
if(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){
|
||||
this.checkList()
|
||||
}
|
||||
},
|
||||
|
|
|
@ -158,7 +158,7 @@
|
|||
this.$toolAll.tools.isLogin();
|
||||
},
|
||||
onLoad() {
|
||||
if(uni.getStorageSync('phone_active')!=0){
|
||||
if(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){
|
||||
this.checkKF()//查询客服列表
|
||||
this.checkCL()//客户列表
|
||||
this.checkLY()//渠道来源
|
||||
|
|
|
@ -103,7 +103,7 @@
|
|||
},
|
||||
onShow() {
|
||||
this.$toolAll.tools.isLogin();
|
||||
if(uni.getStorageSync('phone_active')!=0){
|
||||
if(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){
|
||||
this.checkConList(this.category_id)
|
||||
}
|
||||
},
|
||||
|
@ -113,7 +113,7 @@
|
|||
this.chuTop = rect.top
|
||||
}).exec()
|
||||
this.doctorId = options.doctor_id;
|
||||
if(uni.getStorageSync('phone_active')!=0){
|
||||
if(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){
|
||||
this.checkDoD(this.doctorId)
|
||||
}
|
||||
},
|
||||
|
|
|
@ -79,7 +79,7 @@
|
|||
this.chuTop = rect.height
|
||||
}).exec()
|
||||
if(options.index==undefined){this.isWen = false;this.ntype = 'message';}
|
||||
if(uni.getStorageSync('phone_active')!=0){
|
||||
if(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){
|
||||
this.checkMsg();
|
||||
let that = this ;
|
||||
wx.showModal({
|
||||
|
|
|
@ -180,7 +180,7 @@
|
|||
// 禁用小程序分享
|
||||
this.$toolAll.tools.disableShareEv();
|
||||
this.$toolAll.tools.isLogin()
|
||||
if(uni.getStorageSync('phone_active')!=0){
|
||||
if(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){
|
||||
this.checkConList(this.category_id);
|
||||
this.shopCollection();
|
||||
}
|
||||
|
|
|
@ -88,7 +88,7 @@
|
|||
this.navH = rect.height
|
||||
}).exec()
|
||||
}
|
||||
if(uni.getStorageSync('phone_active')!=0){
|
||||
if(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){
|
||||
this.checkShare()//查询一二级分享总人数
|
||||
this.checkPeople()//查询分享一二级列表人数
|
||||
}
|
||||
|
|
|
@ -153,7 +153,7 @@
|
|||
this.$toolAll.tools.isLogin();
|
||||
},
|
||||
onLoad(options) {
|
||||
if(uni.getStorageSync('phone_active')!=0){
|
||||
if(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){
|
||||
this.checkInfo(options.id);
|
||||
}
|
||||
},
|
||||
|
|
|
@ -56,7 +56,7 @@
|
|||
}
|
||||
},
|
||||
onLoad(options) {
|
||||
if(uni.getStorageSync('phone_active')!=0){
|
||||
if(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){
|
||||
this.$toolAll.tools.isLogin() ;
|
||||
//如果还没有生成海报
|
||||
if(uni.getStorageSync('imgSrcList')!='') this.imgSrcList = uni.getStorageSync('imgSrcList')//弹框关闭
|
||||
|
|
|
@ -47,7 +47,7 @@
|
|||
style="width: 42rpx;height: 42rpx;" mode=""></image>
|
||||
<view class="fon24 col9 tc">{{likeCon}}</view>
|
||||
</view>
|
||||
<view @tap="shareEv" class="disac fc mar-zy36 posir">
|
||||
<view class="disac fc mar-zy36 posir">
|
||||
<image src="/static/public/weix.png" style="width: 42rpx;height: 42rpx;" mode=""></image>
|
||||
<view class="fon24 col9">分享</view>
|
||||
<button class="posia" open-type="share"
|
||||
|
@ -186,6 +186,7 @@
|
|||
}, error => {})
|
||||
// 调用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')}`, // 默认是当前页面,必须是以‘/’开头的完整路径
|
||||
|
@ -205,7 +206,7 @@
|
|||
this.isAutoPlay = false;
|
||||
},
|
||||
onLoad(options) {
|
||||
if(uni.getStorageSync('phone_active')!=0){
|
||||
if(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){
|
||||
if (options.category_id != undefined) {
|
||||
this.category_id = options.category_id
|
||||
if(options.invite_code!=undefined){this.invite_code = options.invite_code;}
|
||||
|
|
|
@ -77,7 +77,7 @@
|
|||
onLoad(options) {
|
||||
this.category_id = options.category_id;//病种id
|
||||
this.titleStr = options.title;//标题
|
||||
if(uni.getStorageSync('phone_active')!=0){
|
||||
if(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){
|
||||
this.searchEv()
|
||||
}
|
||||
},
|
||||
|
|
|
@ -101,7 +101,7 @@
|
|||
uni.removeStorageSync('cateList')
|
||||
},
|
||||
onLoad(options) {
|
||||
if(uni.getStorageSync('phone_active')!=0){
|
||||
if(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){
|
||||
if(options.keyWorld!=undefined && options.keyWorld!='') {
|
||||
this.searchVal = options.keyWorld
|
||||
this.searchEv()
|
||||
|
@ -112,7 +112,7 @@
|
|||
},
|
||||
onShow() {
|
||||
this.$toolAll.tools.isLogin()
|
||||
if(uni.getStorageSync('phone_active')!=0){
|
||||
if(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){
|
||||
if(this.searchVal!=undefined && this.searchVal!='') this.searchEv()
|
||||
}
|
||||
},
|
||||
|
@ -180,66 +180,78 @@
|
|||
searchEv(){//搜索事件
|
||||
// console.log('栏目ID:',this.category_id,'关键词:',this.searchVal);
|
||||
this.$toolAll.tools.showToast('搜索中...')
|
||||
this.$requst.post('archives/category',{page:this.page,size:this.size,category_id:this.category_id,keyword:this.searchVal}).then(res=>{
|
||||
// console.log('搜索提交:',res);
|
||||
if(res.code==0){
|
||||
uni.hideToast()
|
||||
if(uni.getStorageSync('cateList')==''){//首次渲染栏目
|
||||
if(res.data.category.length!=0){
|
||||
res.data.category.forEach((item,index)=>{
|
||||
let cateObj = {
|
||||
id:item.id,//栏目ID
|
||||
title:item.title,//栏目名称
|
||||
active:item.active,//是否选中
|
||||
model_id:item.model_id,//模型ID
|
||||
model_name:item.model_name,//模型标识
|
||||
sort:item.sort
|
||||
// 检测是否完全匹配关键词
|
||||
this.$requst.post('archives/keyword-check',{keyword:this.searchVal}).then(res=>{
|
||||
if(res.data.has) {
|
||||
this.searchVal = '';
|
||||
// 完全匹配,跳转匹配路径
|
||||
uni.navigateTo({
|
||||
url:`/${res.data.target}`
|
||||
})
|
||||
} else {
|
||||
// 不匹配时进行搜索接口调用
|
||||
this.$requst.post('archives/category',{page:this.page,size:this.size,category_id:this.category_id,keyword:this.searchVal}).then(res=>{
|
||||
// console.log('搜索提交:',res);
|
||||
if(res.code==0){
|
||||
uni.hideToast()
|
||||
if(uni.getStorageSync('cateList')==''){//首次渲染栏目
|
||||
if(res.data.category.length!=0){
|
||||
res.data.category.forEach((item,index)=>{
|
||||
let cateObj = {
|
||||
id:item.id,//栏目ID
|
||||
title:item.title,//栏目名称
|
||||
active:item.active,//是否选中
|
||||
model_id:item.model_id,//模型ID
|
||||
model_name:item.model_name,//模型标识
|
||||
sort:item.sort
|
||||
}
|
||||
this.cateList.push(cateObj)
|
||||
})
|
||||
uni.setStorageSync('cateList',this.cateList)
|
||||
}
|
||||
this.cateList.push(cateObj)
|
||||
})
|
||||
uni.setStorageSync('cateList',this.cateList)
|
||||
}
|
||||
} else {
|
||||
//获取缓存中的栏目
|
||||
this.cateList = uni.getStorageSync('cateList')
|
||||
}
|
||||
// 获取列表
|
||||
if(this.page==1) this.dataList = []
|
||||
this.total = res.data.list.total
|
||||
if(res.data.list.list.length!=0){
|
||||
res.data.list.list.forEach(item=>{
|
||||
let fabImg = '';
|
||||
if(item.published_headimgurl!='' && item.published_headimgurl!=null) fabImg = this.$http + item.published_headimgurl;
|
||||
let tObj = {
|
||||
category_id:item.category_id,//栏目ID
|
||||
id:item.id,
|
||||
is_collected:item.is_collected,//是否已收藏
|
||||
collects:item.collects,//收藏量
|
||||
views:item.views,//查看量
|
||||
main_img:this.$http + item.cover,//封面图
|
||||
video:this.$http + item.video,//视频地址
|
||||
title:item.title,//标题
|
||||
content:item.subtitle,//副标题
|
||||
head_img: fabImg || '/static/public/logo.png',//发布者头像
|
||||
name:item.published_by || '恒美植发',//发布者昵称
|
||||
isVideo:item.video.includes(".mp4"),//是否是视频
|
||||
likes:item.likes,//点赞数量
|
||||
is_liked:item.is_liked//是否已点赞
|
||||
} else {
|
||||
//获取缓存中的栏目
|
||||
this.cateList = uni.getStorageSync('cateList')
|
||||
}
|
||||
this.dataList.push(tObj);
|
||||
// if(this.newCurrent==0 && item.category_id==32) this.dataList.push(tObj)
|
||||
// if(this.newCurrent==1 && item.category_id==33) this.dataList.push(tObj)
|
||||
// if(this.newCurrent==2 && item.category_id==34) this.dataList.push(tObj)
|
||||
// if(this.newCurrent==3 && item.category_id==38) this.dataList.push(tObj)
|
||||
})
|
||||
}
|
||||
let obj = {
|
||||
content:this.searchVal
|
||||
}
|
||||
this.reSearchList[0].list.push(obj)
|
||||
this.isList = false
|
||||
} else this.$toolAll.tools.showToast(res.msg);
|
||||
},error=>{this.$toolAll.tools.showToast(error.msg);})
|
||||
// 获取列表
|
||||
if(this.page==1) this.dataList = []
|
||||
this.total = res.data.list.total
|
||||
if(res.data.list.list.length!=0){
|
||||
res.data.list.list.forEach(item=>{
|
||||
let fabImg = '';
|
||||
if(item.published_headimgurl!='' && item.published_headimgurl!=null) fabImg = this.$http + item.published_headimgurl;
|
||||
let tObj = {
|
||||
category_id:item.category_id,//栏目ID
|
||||
id:item.id,
|
||||
is_collected:item.is_collected,//是否已收藏
|
||||
collects:item.collects,//收藏量
|
||||
views:item.views,//查看量
|
||||
main_img:this.$http + item.cover,//封面图
|
||||
video:this.$http + item.video,//视频地址
|
||||
title:item.title,//标题
|
||||
content:item.subtitle,//副标题
|
||||
head_img: fabImg || '/static/public/logo.png',//发布者头像
|
||||
name:item.published_by || '恒美植发',//发布者昵称
|
||||
isVideo:item.video.includes(".mp4"),//是否是视频
|
||||
likes:item.likes,//点赞数量
|
||||
is_liked:item.is_liked//是否已点赞
|
||||
}
|
||||
this.dataList.push(tObj);
|
||||
// if(this.newCurrent==0 && item.category_id==32) this.dataList.push(tObj)
|
||||
// if(this.newCurrent==1 && item.category_id==33) this.dataList.push(tObj)
|
||||
// if(this.newCurrent==2 && item.category_id==34) this.dataList.push(tObj)
|
||||
// if(this.newCurrent==3 && item.category_id==38) this.dataList.push(tObj)
|
||||
})
|
||||
}
|
||||
let obj = {
|
||||
content:this.searchVal
|
||||
}
|
||||
this.reSearchList[0].list.push(obj)
|
||||
this.isList = false
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
delev(){//删除事件
|
||||
this.isShowT = true
|
||||
|
|
|
@ -78,7 +78,7 @@
|
|||
return shareObj;
|
||||
},
|
||||
onLoad(options) {
|
||||
if(uni.getStorageSync('phone_active')!=0){this.$toolAll.tools.isLogin()}
|
||||
if(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){this.$toolAll.tools.isLogin()}
|
||||
uni.getStorageSync('shareAll')!='' ? this.dataList[1].num = uni.getStorageSync('shareAll').share_users.total : this.dataList[1].num = 0
|
||||
this.$requst.post('index/mini-program-setting').then(res=>{
|
||||
// log('数据:',res);
|
||||
|
|
|
@ -384,7 +384,7 @@
|
|||
this.isAutoPlay = false;
|
||||
},
|
||||
onLoad(options) {
|
||||
if(uni.getStorageSync('phone_active')!=0){
|
||||
if(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){
|
||||
this.checkDetail(options.id,options.is_activity);
|
||||
this.cartNumEv();
|
||||
}
|
||||
|
|
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
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