调整登录,我的页权限判断

master
chen 2021-08-22 16:53:12 +08:00
parent 9095998f99
commit 259b3d3606
69 changed files with 730 additions and 452 deletions

43
App.vue
View File

@ -1,57 +1,22 @@
<script> <script>
import toolAll from '@/jsFile/tools.js'; import toolAll from '@/jsFile/tools.js';
// import {checkSwip} from '@/jsFile/publicAPI.js'
export default { export default {
onLaunch: function() { onLaunch: function() {
toolAll.tools.clearClog()// toolAll.tools.clearClog()//
}, },
onShow: function() { onShow: function() {
uni.setStorageSync('publicColor', '#3875F6') //#3875F6 toolAll.tools.zhuColorT()
// uni.clearStorageSync() // uni.clearStorageSync()
if(uni.getStorageSync('token')!='') { if(uni.getStorageSync('token')!='') {
toolAll.tools.daoTime() toolAll.tools.daoTime()
toolAll.tools.networkStatus()// toolAll.tools.networkStatus()//
toolAll.tools.updaX()// toolAll.tools.updaX()//
} }
let ya = this toolAll.tools.overdue()//
uni.login({ // checkSwip()//
provider: 'weixin',
success: function(res) {
if (res.code) {
let obj = uni.getStorageSync('comeOn')//
var params = {
code:res.code,
nickname: '',
headimgurl: '',
country: '',
province: '',
city: '',
gender: '',
language:'',
invite_code:'',//
channel:''//
}
ya.$requst.post('user/login',params).then(res => {
if(res.data.token!=''){
uni.setStorageSync('token',res.data.token)//token
uni.setStorageSync('headImg',res.data.headimgurl)//
}
},error => {})
}
}
});
// wx.checkSession({ //session_key
// success: function() { //session_key
// return;
// },
// fail: function() { //session_key
// setTimeout(()=>{
// uni.reLaunch({url:'/pages/login/login'})
// },2000)
// }
// })
}, },
onHide: function() { onHide: function() {
// console.log('hide');
toolAll.tools.closeTimer()// toolAll.tools.closeTimer()//
} }
}; };

View File

@ -100,7 +100,7 @@
.width100{width: 100%;} .width100{width: 100%;}
.width33{width: 33%;} .width33{width: 33%;}
.posAll{position: fixed;top: 0;left: 0;right: 0;bottom: 0;background-color: rgba(0,0,0,.45);z-index: 2;} .posAll{position: fixed;top: 0;left: 0;right: 0;bottom: 0;background-color: rgba(0,0,0,.45);z-index: 3;}
.posir{position: relative;} .posir{position: relative;}
.posia{position: absolute;} .posia{position: absolute;}
.posiszy{position: fixed;left: 0;right: 0;z-index: 2;} .posiszy{position: fixed;left: 0;right: 0;z-index: 2;}

View File

@ -58,26 +58,26 @@
default:function(){ default:function(){
return uni.getStorageSync('imgList') return uni.getStorageSync('imgList')
// return [ // return [
// { // {
// iconPath: '/static/tabbar/homem.png',//icon // iconPath: '/static/tabbar/homem.png',//icon
// selectedIconPath: '/static/tabbar/homeAc.png',//icon // selectedIconPath: '/static/tabbar/homeAc.png',//icon
// }, // },
// { // {
// iconPath: '/static/tabbar/catem.png',//icon // iconPath: '/static/tabbar/catem.png',//icon
// selectedIconPath: '/static/tabbar/cates.png',//icon // selectedIconPath: '/static/tabbar/cates.png',//icon
// }, // },
// { // {
// iconPath: '/static/tabbar/customerm.png',//icon // iconPath: '/static/tabbar/customerm.png',//icon
// selectedIconPath: '/static/tabbar/customerm.png',//icon // selectedIconPath: '/static/tabbar/customerm.png',//icon
// }, // },
// { // {
// iconPath: '/static/tabbar/shopm.png',//icon // iconPath: '/static/tabbar/shopm.png',//icon
// selectedIconPath: '/static/tabbar/shopa.png',//icon // selectedIconPath: '/static/tabbar/shopa.png',//icon
// }, // },
// { // {
// iconPath: '/static/tabbar/mym.png',//icon // iconPath: '/static/tabbar/mym.png',//icon
// selectedIconPath: '/static/tabbar/mya.png',//icon // selectedIconPath: '/static/tabbar/mya.png',//icon
// } // }
// ] // ]
} }
} }
@ -87,42 +87,11 @@
vision:false, vision:false,
isShowT:false, isShowT:false,
isKef:true, isKef:true,
// tabArr:[ jieDuan:false
// {
// pagePath: 'pages/tabbar/homePage/homePage',
// iconPath: '/static/tabbar/homeAc.png',//icon
// selectedIconPath: '/static/tabbar/homeAc.png',//icon
// text: ''
// },
// {
// pagePath: 'pages/tabbar/cate/cate',
// iconPath: '/static/tabbar/catem.png',//icon
// selectedIconPath: '/static/tabbar/catem.png',//icon
// text: ''
// },
// {
// pagePath: '',
// iconPath: '/static/tabbar/customerm.png',//icon
// selectedIconPath: '/static/tabbar/customerm.png',//icon
// text: ''
// },
// {
// pagePath: 'pages/tabbar/shop/shop',
// iconPath: '/static/tabbar/shopm.png',//icon
// selectedIconPath: '/static/tabbar/shopm.png',//icon
// text: ''
// },
// {
// pagePath: 'pages/tabbar/my/my',
// iconPath: '/static/tabbar/mym.png',//icon
// selectedIconPath: '/static/tabbar/mym.png',//icon
// text: ''
// },
//],
}; };
}, },
mounted() { mounted() {
if(uni.getStorageSync('headImg')=='') this.isKef = false if(uni.getStorageSync('is_active')==0) this.isKef = false
}, },
methods:{ methods:{
cancleEv(e){ cancleEv(e){
@ -132,24 +101,25 @@
// this.current = index // this.current = index
switch (index){ switch (index){
case 0: case 0:
console.log(this.imgList[index].selectedIcoPath); // console.log(this.imgList[index].selectedIcoPath);
uni.reLaunch({url:'/pages/tabbar/pagehome/pagehome'}) uni.reLaunch({url:'/pages/tabbar/pagehome/pagehome'})
break; break;
case 1: case 1:
uni.navigateTo({url:'/pages/tabbar/cate/cate'}) uni.navigateTo({url:'/pages/tabbar/cate/cate'})
break; break;
case 2: case 2:
if(uni.getStorageSync('headImg')==''){ if(!this.jieDuan){
this.vision = true let isAuth = this.$toolAll.tools.returnAuth()
} else { if(!isAuth){
this.$toolAll.tools.closeTimer()// this.$toolAll.tools.closeTimer()//
// uni.navigateTo({url:'/pages/tabbar/pagehome/pagehome'}) // uni.navigateTo({url:'/pages/tabbar/pagehome/pagehome'})
this.$requst.post('user/record',{type:'other',action:'ask',id:0}).then(res=>{},error=>{}) this.$requst.post('user/record',{type:'other',action:'ask',id:0}).then(res=>{},error=>{})
let maiOjb = { let maiOjb = {
e:5,// e:5,//
t:new Date().getTime()// t:new Date().getTime()//
} }
this.$toolAll.tools.maiDian(maiOjb) this.$toolAll.tools.maiDian(maiOjb)
} else this.jieDuan = true
} }
break; break;
case 3: case 3:
@ -157,7 +127,12 @@
// uni.navigateTo({url:'/pages/tabbar/shop/shop'}) // uni.navigateTo({url:'/pages/tabbar/shop/shop'})
break; break;
case 4: case 4:
uni.reLaunch({url:'/pages/tabbar/my/my'}) if(!this.jieDuan){
let isAuth = this.$toolAll.tools.returnAuth()
if(!isAuth){
uni.reLaunch({url:'/pages/tabbar/my/my'})
} else this.jieDuan = true
}
break; break;
} }
}, },

View File

@ -12,7 +12,7 @@
<!-- 喜欢 --> <!-- 喜欢 -->
<image v-else :class="item.is_collected==1?'bounceIn':'bounceOut'" class="animated" src="/static/public/like.png" mode="aspectFill"></image> <image v-else :class="item.is_collected==1?'bounceIn':'bounceOut'" class="animated" src="/static/public/like.png" mode="aspectFill"></image>
</view> </view>
<view :class="radiu?'list-cont-box15':'list-cont-box'" class="posia fon20"> <view v-if="item.main_img!=''" :class="radiu?'list-cont-box15':'list-cont-box'" class="posia fon20">
<!-- 视频标题 --> <!-- 视频标题 -->
<view class="fon30 bold mar-x10 disac" :style="{fontSize:nFon+'px'}"> <view class="fon30 bold mar-x10 disac" :style="{fontSize:nFon+'px'}">
<view class="clips1">{{item.title}}</view> <view class="clips1">{{item.title}}</view>
@ -40,7 +40,7 @@
<!-- 喜欢 --> <!-- 喜欢 -->
<image v-else :class="item.is_collected==1?'bounceIn':'bounceOut'" class="animated" src="/static/public/like.png" mode="aspectFill"></image> <image v-else :class="item.is_collected==1?'bounceIn':'bounceOut'" class="animated" src="/static/public/like.png" mode="aspectFill"></image>
</view> </view>
<view :class="radiu?'list-cont-box15':'list-cont-box'" class="posia fon20 "> <view v-if="item.main_img!=''" :class="radiu?'list-cont-box15':'list-cont-box'" class="posia fon20 ">
<!-- 视频标题 --> <!-- 视频标题 -->
<view class="fon30 bold mar-x10 disac" :style="{fontSize:nFon+'px'}"> <view class="fon30 bold mar-x10 disac" :style="{fontSize:nFon+'px'}">
<view class="clips1">{{item.title}}</view> <view class="clips1">{{item.title}}</view>
@ -110,7 +110,8 @@
vision:false, vision:false,
isShowT:false, isShowT:false,
pu_content:'是否需要取消收藏?', pu_content:'是否需要取消收藏?',
current:'-1' current:'-1',
jieDuan:false
}; };
}, },
methods:{ methods:{
@ -125,21 +126,22 @@
}, },
chooseLike(index){// chooseLike(index){//
// console.log('',index); // console.log('',index);
if(uni.getStorageSync('headImg')==0){ if(this.jieDuan==false){
this.vision = true let isAuth = this.$toolAll.tools.returnAuth()
} else { if(!isAuth){
this.$emit('chooseLike',index) this.$emit('chooseLike',index)
this.current = index this.current = index
if(this.list[index].is_collected==1) { if(this.list[index].is_collected==1) {
this.isShowT = true this.isShowT = true
} else { } else {
let maiOjb = { let maiOjb = {
e:3,// e:3,//
c:this.list[index].id, c:this.list[index].id,
t:new Date().getTime()// t:new Date().getTime()//
}
this.$toolAll.tools.maiDian(maiOjb)
} }
this.$toolAll.tools.maiDian(maiOjb) } else this.jieDuan = true
}
} }
}, },
comfirmev(){ comfirmev(){

View File

@ -3,7 +3,9 @@
<view :style="{height:statusBarHeight+'px',background:backgroudColor}"></view> <view :style="{height:statusBarHeight+'px',background:backgroudColor}"></view>
<view class="status-nav" :style="{background:backgroudColor}"> <view class="status-nav" :style="{background:backgroudColor}">
<!-- 返回键 --> <!-- 返回键 -->
<image @tap="backEvent" v-if="statusBack" class="tab-back" src="/static/public/backBlackm.png"></image> <view @tap="backEvent" v-if="statusBack" style="height: 33rpx;width: 80rpx;flex-shrink: 0;position: absolute;">
<image class="tab-back" src="/static/public/backBlackm.png"></image>
</view>
<!-- 标题 --> <!-- 标题 -->
<!-- <view v-if="statusTitle" :class="statusBack ? 'tcenter' : 'tleft'" class="tab-title" :style="{color:tabcolor}">{{titleVal}}</view> --> <!-- <view v-if="statusTitle" :class="statusBack ? 'tcenter' : 'tleft'" class="tab-title" :style="{color:tabcolor}">{{titleVal}}</view> -->
<view v-if="statusTitle" class="tab-title tcenter" :style="{color:tabcolor}">{{titleVal}}</view> <view v-if="statusTitle" class="tab-title tcenter" :style="{color:tabcolor}">{{titleVal}}</view>

View File

@ -62,6 +62,9 @@
chooseImg(index){ chooseImg(index){
// console.log('banner',index); // console.log('banner',index);
this.bcurrent = index this.bcurrent = index
uni.navigateTo({
url:this.bannerList[index].url
})
}, },
changeBanner(e){ changeBanner(e){
this.bcurrent = e.detail.current// this.bcurrent = e.detail.current//

View File

@ -38,6 +38,25 @@ export function buriedPoint(){//查询埋点类型事件
},error=>{}) },error=>{})
} }
export function reportBuriedPoint(data){//上报埋点事件 export function reportBuriedPoint(data){//上报埋点事件
console.log('埋点的数据:',data); // console.log('埋点的数据:',data);
return requst.post('statistics/report',data).then(res=>{},error=>{}) return requst.post('statistics/report',data).then(res=>{},error=>{})
} }
export function zhuColor(){//查询主题色
return requst.post('index/mini-program-setting').then(res=>{
if(res.code==0){
uni.setStorageSync('publicColor', res.data.mainColor) //#3875F6 #2E8B57
// uni.setStorageSync('publicColor', '#2E8B57') //#3875F6 #2E8B57
}
},error=>{})
}
export function checkSwip(){//查询主题色
return requst.post('common/slide-positions').then(res=>{
if(res.code==0){
console.log(res);
}
},error=>{})
}
export function checkBanner(data){//查询主题色
return requst.post('common/slides',data)
}

View File

@ -1,4 +1,4 @@
import {buriedPoint,reportBuriedPoint} from './publicAPI.js'; import {buriedPoint,reportBuriedPoint,zhuColor} from './publicAPI.js';
const tools = { const tools = {
timer:'', timer:'',
timerNot:'', timerNot:'',
@ -37,15 +37,18 @@ const tools = {
},1000) },1000)
} }
}, },
zhuColorT(){//调用主色调
console.log('tools');
zhuColor()
},
networkStatus(){//检查网络状态 networkStatus(){//检查网络状态
uni.getNetworkType({ uni.getNetworkType({
success: function (res) { success: function (res) {
console.log('当前网络状态:',res.networkType);//none当前无网络连接 console.log('当前网络状态:',res.networkType);//none当前无网络连接
if(res.networkType=='none'){ if(res.networkType=='none'){
uni.showToast({ uni.setStorageSync('isNet',false)
title:'当前无网络连接', } else {
icon:'loading' uni.setStorageSync('isNet',true)
})
} }
} }
}); });
@ -253,6 +256,74 @@ const tools = {
console.log = () =>{} console.log = () =>{}
} }
// #endif // #endif
},
overdue(){//查询过期时间和是否有token并调用登录事件
var date = new Date();
var timestamp = date.getTime();//精确到毫秒
if((uni.getStorageSync('expire')*1000) - 10000 < timestamp){
this.loginEv()
} else if(uni.getStorageSync('token')==''){
this.loginEv()
} else if(uni.getStorageSync('is_active')=='' || uni.getStorageSync('is_active')==0){
this.loginEv()
}
},
loginEv(){//执行登录事件
uni.login({
provider: 'weixin',
success: function(res) {
if (res.code) {
let code = res.code;
let obj = uni.getStorageSync('params')
var params = {
invite_code:'',
code:code,
nickname: obj.nickname,
avatar: obj.avatarUrl,
country: obj.country,
province: obj.province,
city: obj.city,
gender: obj.gender,
language:obj.language
}
uni.request({
url: `https://hm.hmzfyy.cn/api/user/login`,
method: 'post',
data: params,
header: {
'Content-Type': 'application/json; charset=UTF-8',
// "content-type": "application/x-www-form-urlencoded;charset=UTF-8",
'Authorization': 'Bearer '+uni.getStorageSync('token') || ''
},
success: res => {
if(res.data.data.token!=''){
uni.setStorageSync('token',res.data.data.token)//缓存token
uni.setStorageSync('openid',res.data.data.openid)//缓存Openid
uni.setStorageSync('expire',res.data.data.expire)//缓存失效时间(时间戳格式)
uni.setStorageSync('is_active',res.data.data.is_active)//是否第一次授权
// console.log('is_active',uni.getStorageSync('is_active'));
}
}
})
}
},
});
},
returnAuth(){//是否第一次授权
let auth = false
if(uni.getStorageSync('is_active')==0) {
this.showToast('您目前是游客,请授权登录')
setTimeout(()=>{
uni.navigateTo({url:'/pages/login/login'})
},1500)
auth = true
}
return auth
},
isLogin(){//是否已经登录
if(uni.getStorageSync('is_active')!='' && uni.getStorageSync('is_active') !=0 ){
this.overdue()
}
} }
} }

View File

@ -3,14 +3,14 @@
{ {
"path" : "pages/tabbar/pagehome/pagehome", "path" : "pages/tabbar/pagehome/pagehome",
"style" :{} "style" :{}
},{
"path" : "pages/tabbar/my/my",
"style" :{}
},{ },{
"path" : "pages/login/login", "path" : "pages/login/login",
"style" :{ "style" :{
"navigationBarTextStyle":"black" // "navigationBarTextStyle":"black" //
} }
},{
"path" : "pages/tabbar/my/my",
"style" :{}
}, },
{ {
"path" : "pages/tabbar/shop/shop", "path" : "pages/tabbar/shop/shop",
@ -105,6 +105,10 @@
{ {
"path":"video/playVideo", "path":"video/playVideo",
"style":{} "style":{}
},
{
"path":"customer/customer",
"style":{}
} }
] ]
} }

View File

@ -1,6 +1,6 @@
<template> <template>
<view> <view>
<status-nav :titleVal="'登录'" :tabcolor="'rgba(244, 244, 244,1)'" :whereCome="1" :statusTitle="true" :backgroudColor="'rgba(244, 244, 244,1)'"></status-nav> <status-nav :titleVal="'登录'" :tabcolor="'rgba(244, 244, 244,1)'" :whereCome="1*1" :statusTitle="true" :backgroudColor="'rgba(244, 244, 244,1)'"></status-nav>
<view class='login-header'> <view class='login-header'>
<image class="infoImg" :style="{boxShadow: '0px 0px 20px '+ publicColor}" mode="aspectFit" :src="userInfo.avatarUrl || imgSrc"></image> <image class="infoImg" :style="{boxShadow: '0px 0px 20px '+ publicColor}" mode="aspectFit" :src="userInfo.avatarUrl || imgSrc"></image>
<view class="logo-name">恒美植发</view> <view class="logo-name">恒美植发</view>
@ -52,7 +52,7 @@
}, },
methods: { methods: {
goInfo(){ goInfo(){
uni.setStorageSync('uinfo',this.infoObj) uni.setStorageSync('firstInfo',this.infoObj)
uni.navigateTo({ uni.navigateTo({
url:'/pagesA/nodifyData/nodifyData?whereNum=2' url:'/pagesA/nodifyData/nodifyData?whereNum=2'
}) })
@ -81,7 +81,7 @@
lang: 'zh_CN', lang: 'zh_CN',
success: (res) => { success: (res) => {
ya.userInfo = res.userInfo; ya.userInfo = res.userInfo;
console.log('可用用户信息:',ya.userInfo); // console.log('',ya.userInfo);
try { try {
ya.login(); ya.login();
} catch (e) {} } catch (e) {}
@ -126,7 +126,8 @@
language:ya.userInfo.language,// language:ya.userInfo.language,//
invite_code:ya.invite_code,// invite_code:ya.invite_code,//
invite_source:ya.invite_source,//[def|link|qr] invite_source:ya.invite_source,//[def|link|qr]
channel:ya.channel// channel:ya.channel,//
is_active:1
} }
this.$requst.post('user/login',params).then(res => { this.$requst.post('user/login',params).then(res => {
// console.log(res); // console.log(res);
@ -139,21 +140,17 @@
city: ya.userInfo.city,// city: ya.userInfo.city,//
language:ya.userInfo.language,// language:ya.userInfo.language,//
} }
uni.setStorageSync('params',params)
uni.setStorageSync('comeOn',comeOn) uni.setStorageSync('comeOn',comeOn)
uni.setStorageSync('token',res.data.token)//token uni.setStorageSync('token',res.data.token)//token
uni.setStorageSync('expire',res.data.expire)//
uni.setStorageSync('is_active',res.data.is_active)//
this.isShowT = true this.isShowT = true
this.$requst.post('user/info').then(res=>{ this.infoObj = {
// console.log('',res); headimgurl:ya.userInfo.avatarUrl,
if(res.code==0 && res.data.length!=0) { nickname:ya.userInfo.nickName,
this.infoObj = res.data; gender:ya.userInfo.gender
} }
},error=>{})
// ya.$toolAll.tools.showToast('','success')
// setTimeout(()=>{
// uni.reLaunch({
// url:'/pages/tabbar/pagehome/pagehome'
// })
// },1000)
} }
},error => {}) },error => {})
} }

View File

@ -17,7 +17,7 @@
<!-- 热门推荐 --> <!-- 热门推荐 -->
<template v-if="ccurrent==0"> <template v-if="ccurrent==0">
<!-- 自定义轮播 --> <!-- 自定义轮播 -->
<swiper-pu :newHeight="'154'" :newRadius="'10'" :newBottom="'10'"></swiper-pu> <swiper-pu :bannerList="bannerList" :newHeight="'154'" :newRadius="'10'" :newBottom="'10'"></swiper-pu>
<!-- 自定义二级分类 --> <!-- 自定义二级分类 -->
<view class="mar-x20 mar-s40"> <view class="mar-x20 mar-s40">
<cate-pu :newCurrent="newCurrent*1" :activeb="publicColor" @choosecateEv="chooseTwo" :newcateList="cateListTwo"></cate-pu> <cate-pu :newCurrent="newCurrent*1" :activeb="publicColor" @choosecateEv="chooseTwo" :newcateList="cateListTwo"></cate-pu>
@ -53,7 +53,7 @@
<script> <script>
import swiperPu from '@/components/swiper-pu.vue'; import swiperPu from '@/components/swiper-pu.vue';
import cateTu from '@/components/cate-items/cate-tu.vue'; import cateTu from '@/components/cate-items/cate-tu.vue';
import {collectionEV,cancleCollectionEV} from '@/jsFile/publicAPI.js'; import {collectionEV,cancleCollectionEV,checkBanner} from '@/jsFile/publicAPI.js';
export default { export default {
components:{ components:{
swiperPu, swiperPu,
@ -73,33 +73,7 @@
], ],
showTop:false,// showTop:false,//
tuList:[ tuList:[
// {
// title:'',
// src:'',
// list:[
// {content:''},
// {content:''},
// {content:''},
// {content:''},
// ]
// },
// {
// title:'',
// src:'',
// list:[
// {content:''},
// {content:''},
// {content:''},
// {content:''},
// ]
// },
// {
// title:'',
// src:'',
// list:[
// {content:''},
// ]
// },
], ],
newCurrent:0, newCurrent:0,
cateW:'',// cateW:'',//
@ -109,7 +83,8 @@
total:'',// total:'',//
isZanw:true, isZanw:true,
category_id:'',//ID category_id:'',//ID
disease_id:''//ID disease_id:'',//ID
bannerList:[]
} }
}, },
onPageScroll(e) { onPageScroll(e) {
@ -131,13 +106,34 @@
t:new Date().getTime()// t:new Date().getTime()//
} }
this.$toolAll.tools.maiDian(maiOjb) this.$toolAll.tools.maiDian(maiOjb)
this.checkSwi()
}, },
onShow() { onShow() {
this.$toolAll.tools.isLogin()
// console.log(this.category_id); // console.log(this.category_id);
if(this.category_id!='') this.checkCate(this.category_id)// if(this.category_id!='') this.checkCate(this.category_id)//
}, },
methods: { methods: {
checkSwi(){
checkBanner({position:'category-hot-banner'}).then(res=>{
if(res.code==0){
if(res.data.length!=0){
res.data.forEach(item=>{
let isVideo = false
if(item.type!='img') isVideo = true
let banObj = {
imgSrc:this.$http + item.src,
url:item.url,
isVideo:isVideo,
poster:this.$http + item.src,
}
this.bannerList.push(banObj)
})
}
//
}
})
},
chooseLike(e){// chooseLike(e){//
// console.log(this.dataList[e].is_collected); // console.log(this.dataList[e].is_collected);
if(this.dataList[e].is_collected==0){ if(this.dataList[e].is_collected==0){
@ -245,6 +241,7 @@
this.$requst.post('archives/disease-question',{disease_id:disease_id}).then(res=>{ this.$requst.post('archives/disease-question',{disease_id:disease_id}).then(res=>{
// console.log('',res); // console.log('',res);
if(res.code==0){ if(res.code==0){
this.tuList = []
if(res.data.list.length!=0){ if(res.data.list.length!=0){
res.data.list.forEach(item=>{ res.data.list.forEach(item=>{
let arr = [] let arr = []
@ -279,7 +276,6 @@
}, },
chooseCate(index){// chooseCate(index){//
this.ccurrent = index this.ccurrent = index
this.tuList = []
this.checkData(this.cateList[index].id) this.checkData(this.cateList[index].id)
// console.log(':',index); // console.log(':',index);
}, },

View File

@ -9,14 +9,14 @@
<view class="disjbac"> <view class="disjbac">
<view class="disac"> <view class="disac">
<!-- 头像 --> <!-- 头像 -->
<image class="mar-sx30" :src="userInfo.headimgurl || headImg" style="width:120rpx;height: 120rpx;border-radius: 100%;margin-left: 15rpx;z-index: 1;" mode="aspectFill"></image> <image class="mar-sx30" :src="userInfo.headimgurl || ''" style="width:120rpx;height: 120rpx;border-radius: 100%;margin-left: 15rpx;z-index: 1;" mode="aspectFill"></image>
<view class="mar-z30"> <view class="mar-z30">
<!-- 昵称 --> <!-- 昵称 -->
<view class="fon36 bold">{{userInfo.nickname || '未知'}}</view> <view class="fon36 bold">{{userInfo.nickname || ''}}</view>
<view class="disac mar-s10"> <view class="disac mar-s10" v-if="userInfo.mobile!==''">
<image src="/static/public/phone.png" style="width: 14rpx;height: 20rpx;" mode=""></image> <image src="/static/public/phone.png" style="width: 14rpx;height: 20rpx;" mode=""></image>
<!-- 手机号 --> <!-- 手机号 -->
<view class="fon24 col3 mar-z10">{{userInfo.mobile || '未知'}}</view> <view class="fon24 col3 mar-z10">{{userInfo.mobile}}</view>
</view> </view>
</view> </view>
</view> </view>
@ -24,7 +24,9 @@
<!-- 二维码 --> <!-- 二维码 -->
<image @tap="isQrcode=true" src="/static/public/eqr.png" style="width: 43rpx;height: 43rpx;z-index: 1;" mode=""></image> <image @tap="isQrcode=true" src="/static/public/eqr.png" style="width: 43rpx;height: 43rpx;z-index: 1;" mode=""></image>
<!-- 前进键 --> <!-- 前进键 -->
<image @tap="goNodifyData" class="mar-z20" src="/static/public/nextM.png" style="width: 35rpx;height: 35rpx;z-index: 1;" mode="aspectFill"></image> <view @tap="goNodifyData" style="width: 50rpx;position: relative;z-index: 1;justify-content: flex-end;" class="disac">
<image class="" src="/static/public/nextM.png" style="width: 35rpx;height: 35rpx;z-index: 1;" mode="aspectFill"></image>
</view>
</view> </view>
</view> </view>
<view class="disja posir" style="z-index: 1;"> <view class="disja posir" style="z-index: 1;">
@ -36,11 +38,11 @@
<image class="posia" style="top: 0;left: 0;right: 0;bottom: 0;width: 100%;height: 100%;z-index: 0;" src="/static/public/mybt.png" mode=""></image> <image class="posia" style="top: 0;left: 0;right: 0;bottom: 0;width: 100%;height: 100%;z-index: 0;" src="/static/public/mybt.png" mode=""></image>
</view> </view>
<!-- 员工功能 --> <!-- 员工功能 -->
<view v-if="userInfo.is_staff!=1" class="bacf radius20 mar-s20 pad20"> <view v-if="userInfo.is_staff && yuanList.length!=0" class="bacf radius20 mar-s20 pad20">
<view class="mar-x30 fon28 bold col3">员工功能</view> <view class="mar-x30 fon28 bold col3">员工功能</view>
<view class="disac yuan-box"> <view class="disac yuan-box">
<view @tap="chooseYitem(indexy)" style="width: 33%;display: flex;justify-content: center;align-items: center;position: relative;" v-for="(itemy,indexy) in yuanList" :key="indexy"> <view @tap="chooseYitem(indexy)" style="width: 33%;display: flex;justify-content: center;align-items: center;position: relative;" v-for="(itemy,indexy) in yuanList" :key="indexy">
<view class="disac fc" > <view class="disac fc">
<image :src="itemy.src" style="width: 54rpx;height: 54rpx;" mode="aspectFill"></image> <image :src="itemy.src" style="width: 54rpx;height: 54rpx;" mode="aspectFill"></image>
<view class="fon28 mar-s20 mar-x10">{{itemy.title}}</view> <view class="fon28 mar-s20 mar-x10">{{itemy.title}}</view>
</view> </view>
@ -49,7 +51,7 @@
</view> </view>
</view> </view>
<!-- 广告 --> <!-- 广告 -->
<image class="width100 radius20 mar-sx20" src="/static/public/banner.png" style="height: 160rpx;" mode="aspectFill"></image> <image class="width100 radius20 mar-sx20" :src="guangImg" style="height: 160rpx;" mode="aspectFill"></image>
<!-- 功能列表 --> <!-- 功能列表 -->
<view class="bacf radius20 pad-zy30"> <view class="bacf radius20 pad-zy30">
<view @tap="chooseItem(indexl)" class="disjbac pad-sx30 borbot" v-for="(iteml,indexl) in toolsList" :key="indexl"> <view @tap="chooseItem(indexl)" class="disjbac pad-sx30 borbot" v-for="(iteml,indexl) in toolsList" :key="indexl">
@ -65,12 +67,6 @@
</view> </view>
</view> </view>
<!-- 我的二维码弹框 --> <!-- 我的二维码弹框 -->
<view v-if="isQrcode" class="posAll disjcac"> <view v-if="isQrcode" class="posAll disjcac">
<view> <view>
@ -87,12 +83,16 @@
<foot-tab :titleList="titleList" :imgList="imgList" :newcurrent='4'></foot-tab> <foot-tab :titleList="titleList" :imgList="imgList" :newcurrent='4'></foot-tab>
<!-- 弹框授权 --> <!-- 弹框授权 -->
<empower :vision="vision" @cancleEv="cancleEv"></empower> <empower :vision="vision" @cancleEv="cancleEv"></empower>
<view v-if="isQian" style="position: fixed;top: 50%;left: 50%;transform: translate(-50%,-50%);">
<view style="padding: 20rpx 40rpx;background-color: rgba(0,0,0,.6);color: #FFFFFF;border-radius: 6rpx;">签到成功</view>
</view>
</view> </view>
</template> </template>
<script> <script>
import {base64ToPath} from '@/jsFile/base64-src.js'; import {base64ToPath} from '@/jsFile/base64-src.js';
import empower from '@/components/empower.vue'; import empower from '@/components/empower.vue';
import {checkBanner} from '@/jsFile/publicAPI.js';
export default { export default {
components:{empower}, components:{empower},
data() { data() {
@ -106,10 +106,11 @@
{num:'0',title:'积分'}, {num:'0',title:'积分'},
{num:'0',title:'我的分享'} {num:'0',title:'我的分享'}
], ],
yuanList:[ yuanList:uni.getStorageSync('rules'), //'customer-list','footmarks','scan'
{src:'/static/public/keh.png',title:'客户列表'}, zanCyuanList:[
{src:'/static/public/zu.png',title:'用户足迹'}, {src:'/static/public/keh.png',title:'客户列表',rule:'customer-list'},
{src:'/static/public/scan.png',title:'扫码签到'}, {src:'/static/public/zu.png',title:'用户足迹',rule:'footmarks'},
{src:'/static/public/scan.png',title:'扫码签到',rule:'scan'},
], ],
toolsList:[ toolsList:[
{src:'/static/public/zyuy.png',title:'自助预约',num:''}, {src:'/static/public/zyuy.png',title:'自助预约',num:''},
@ -119,6 +120,7 @@
{src:'/static/public/message.png',title:'消息通知',num:''}, {src:'/static/public/message.png',title:'消息通知',num:''},
{src:'/static/public/ts.png',title:'投诉与建议',num:''}, {src:'/static/public/ts.png',title:'投诉与建议',num:''},
{src:'/static/public/aboutus.png',title:'关于我们',num:''}, {src:'/static/public/aboutus.png',title:'关于我们',num:''},
{src:'/static/public/aboutus.png',title:'客服二维码',num:''},
], ],
isQrcode:false,// isQrcode:false,//
userInfo:{},// userInfo:{},//
@ -129,23 +131,27 @@
is_servicer:'',//01 is_servicer:'',//01
is_staff:'',//01 is_staff:'',//01
titleList:[], titleList:[],
imgList:[] imgList:[],
isQian:false,
bannerList:[],
guangImg:'',
isAuth:''
} }
}, },
onUnload: function() { onUnload: function() {
// //
let pages = getCurrentPages(); let pages = getCurrentPages();
console.log('pages:',pages); // console.log('pages:',pages);
}, },
onShow() { onShow() {
uni.removeStorageSync('uinfo')// uni.removeStorageSync('uinfo')//
this.$toolAll.tools.isLogin()
this.checkInfo() this.checkInfo()
uni.removeStorageSync('shareAll')//
}, },
onLoad() { onLoad() {
this.titleList = uni.getStorageSync('footTitle') this.titleList = uni.getStorageSync('footTitle')
this.imgList = uni.getStorageSync('footimg') this.imgList = uni.getStorageSync('footimg')
uni.setStorageSync('footimg',this.imgList)
uni.removeStorageSync('shareAll')//
if(uni.getStorageSync('gao')==''){ if(uni.getStorageSync('gao')==''){
const query = wx.createSelectorQuery() const query = wx.createSelectorQuery()
query.select('.gao').boundingClientRect((rect) => { query.select('.gao').boundingClientRect((rect) => {
@ -153,20 +159,32 @@
this.gaoh = rect.height this.gaoh = rect.height
}).exec() }).exec()
} }
this.checkSwi()
this.checkGM() this.checkGM()
// if(uni.getStorageSync('headImg')=='') this.vision = true // if(uni.getStorageSync('headImg')=='') this.vision = true
if(uni.getStorageSync('headImg')=='') {
this.$toolAll.tools.showToast('您当前是游客,请授权登录')
setTimeout(()=>{
uni.navigateTo({
url:'/pages/login/login'
})
},1500)
}
// const eventChannel = this.getOpenerEventChannel()
// console.log(eventChannel);
}, },
methods: { methods: {
checkSwi(){
checkBanner({position:'personal-center-banner'}).then(res=>{
// console.log('res',res);
if(res.code==0){
if(res.data.length!=0){
this.guangImg = this.$http + res.data[0].src
// res.data.forEach(item=>{
// let isVideo = false
// if(item.type!='img') isVideo = true
// let banObj = {
// imgSrc:this.$http + item.src,
// url:item.url,
// isVideo:isVideo,
// poster:this.$http + item.src,
// }
// this.bannerList.push(banObj)
// })
}
}
})
},
cancleEv(e){ cancleEv(e){
if(e==0) this.vision = false if(e==0) this.vision = false
}, },
@ -194,7 +212,17 @@
this.is_doctor = res.data.is_doctor//01 this.is_doctor = res.data.is_doctor//01
this.is_servicer = res.data.is_servicer//01 this.is_servicer = res.data.is_servicer//01
this.is_staff = res.data.is_staff//01 this.is_staff = res.data.is_staff//01
if(res.data.is_staff==0){
this.toolsList.splice((this.toolsList.length-1),1)
}
uni.setStorageSync('shareAll',res.data) uni.setStorageSync('shareAll',res.data)
if(uni.getStorageSync('rules')==''){
if(res.data.rules.length!=0){
let result = this.zanCyuanList.filter(item => res.data.rules.some(itemt => itemt===item.rule))
this.yuanList = result
uni.setStorageSync('rules',this.yuanList)
} else this.yuanList = []
}
} }
},error=>{}) },error=>{})
}, },
@ -208,6 +236,7 @@
if(index==4) newUrl = '/pagesB/messagecenter/messagecenter' if(index==4) newUrl = '/pagesB/messagecenter/messagecenter'
if(index==5) newUrl = '/pagesA/suggestions/suggestions' if(index==5) newUrl = '/pagesA/suggestions/suggestions'
if(index==6) newUrl = '/pagesB/aboutUs/aboutUs' if(index==6) newUrl = '/pagesB/aboutUs/aboutUs'
if(index==7) newUrl = '/pagesB/customer/customer'
uni.navigateTo({ uni.navigateTo({
url:newUrl url:newUrl
}) })
@ -236,7 +265,10 @@
this.$requst.post('user/sign-in',{user_coding:uc}).then(res=>{ this.$requst.post('user/sign-in',{user_coding:uc}).then(res=>{
// console.log('',res); // console.log('',res);
if(res.code==0){ if(res.code==0){
this.$toolAll.tools.showToast(res.msg) this.isQian = true
setTimeout(()=>{
this.isQian = false
},2000)
} }
},error=>{}) },error=>{})
} }

View File

@ -5,65 +5,72 @@
<view :style="{height:statusBarHeight+'px',background:publicColor}"></view> <view :style="{height:statusBarHeight+'px',background:publicColor}"></view>
<view class="status-nav" :style="{background:publicColor}"> <view class="status-nav" :style="{background:publicColor}">
<!-- 标题 --> <!-- 标题 -->
<view class="tab-title tcenter" style="color: #FFFFFF;">首页</view> <view class="tab-title tcenter" style="color: #FFFFFF;">首页<text v-if="!isNet" class="mar-z20">(...)</text></view>
</view> </view>
</view> </view>
<!-- <status-nav :titleVal="'首页'" :backgroudColor="publicColor" :tabcolor="'#FFFFFF'" :statusBack="false" :statusTitle="true"></status-nav> --> <template v-if="isNet">
<!-- 输入框 --> <!-- <status-nav :titleVal="'首页'" :backgroudColor="publicColor" :tabcolor="'#FFFFFF'" :statusBack="false" :statusTitle="true"></status-nav> -->
<view class="input-box posiszy" :style="{top: statusHNH+'px',background:publicColor}" style="height: 50px;display: flex;align-items: center;"> <!-- 输入框 -->
<view class="disac width100"> <view class="input-box posiszy" :style="{top: statusHNH+'px',background:publicColor}" style="height: 50px;display: flex;align-items: center;">
<image class="searchImg flexs" src="/static/public/search.png" mode="aspectFill"></image> <view class="disac width100">
<!-- 输入框 --> <image class="searchImg flexs" src="/static/public/search.png" mode="aspectFill"></image>
<input class="width100 fon28" type="text" v-model="searchVal" placeholder="请输入问题/病种/医生姓名"/> <!-- 输入框 -->
<!-- 竖线 --> <input class="width100 fon28" type="text" v-model="searchVal" placeholder="请输入问题/病种/医生姓名"/>
<view class="linev"></view> <!-- 竖线 -->
<!-- 搜索 --> <view class="linev"></view>
<view @tap="searchEv" class="searchT flexs" :style="{color:publicColor}">搜索</view> <!-- 搜索 -->
</view> <view @tap="searchEv" class="searchT flexs" :style="{color:publicColor}">搜索</view>
</view>
<view class="mar-s10 pad-x180">
<!-- 自定义轮播 -->
<view :style="{marginTop: (statusHNH+60)+'px'}">
<swiper-pu></swiper-pu>
</view>
<!-- 宫格 -->
<view v-if="gonggList.length>1" class="mar-zy30 bacf radius10 pad-s25 mar-s10 disac fw">
<view class="disac fc gongg-box mar-x25" style="width: 25%;" @tap="chooseGon(indexgg)" v-for="(itemgg,indexgg) in gonggList" :key="indexgg">
<view class="img-box">
<image :src="itemgg.src" mode="aspectFill"></image>
</view>
<view class="fon24">{{itemgg.title}}</view>
</view> </view>
</view> </view>
<!-- 发问 --> <view class="mar-s10 pad-x180">
<view class="mar-zy30 mar-sx20 disjb"> <!-- 自定义轮播 -->
<image class="flexs mar-y20 radius30 fawen-img" @tap="tapChoose(0)" :src="gaoone.imgSrc" mode="aspectFill"></image> <view :style="{marginTop: (statusHNH+60)+'px'}">
<view class="disjb fc width100"> <swiper-pu :bannerList="bannerList"></swiper-pu>
<image class="radius30 width100 fawen-itemImg" @tap="tapChoose(1)" :src="gaotwo.imgSrc" mode=""></image>
<image class="radius30 width100 fawen-itemImg" @tap="tapChoose(2)" :src="gaothree.imgSrc" mode=""></image>
</view> </view>
</view> <!-- 宫格 -->
<!-- 热门搜索 --> <view v-if="gonggList.length>1" class="mar-zy30 bacf radius10 pad-s25 mar-s10 disac fw">
<view v-if="isLoading" class="mar-zy30 mar-s50"> <view class="disac fc gongg-box mar-x25" style="width: 25%;" @tap="chooseGon(indexgg)" v-for="(itemgg,indexgg) in gonggList" :key="indexgg">
<view class="col2c fon36 bold mar-x36">热门搜索</view> <view class="img-box">
<view class="bacf fon24 disac fw radius20 pad-zy20 pad-s20"> <image :src="itemgg.src" mode="aspectFill"></image>
<view @tap="chooseReEv(indexf)" v-for="(itemf,indexf) in fwList" :key="indexf" class="disac radius10 mar-x20 reitem-box"> </view>
<image src="/static/public/hot.png" mode="aspectFill"></image> <view class="fon24">{{itemgg.title}}</view>
<view>{{itemf.title}}</view>
</view> </view>
</view> </view>
</view> <!-- 发问 -->
<!-- 恒美小课堂 --> <view class="mar-zy30 mar-sx20 disjb">
<view v-if="isLoading" class="mar-zy30 mar-s40"> <image class="flexs mar-y20 radius30 fawen-img" @tap="tapChoose(0)" :src="gaoone.imgSrc" mode="aspectFill"></image>
<view class="col2c fon36 bold">恒美小课堂</view> <view class="disjb fc width100">
<!-- 自定义二级分类 --> <image class="radius30 width100 fawen-itemImg" @tap="tapChoose(1)" :src="gaotwo.imgSrc" mode=""></image>
<view class="mar-s50 mar-x30"> <image class="radius30 width100 fawen-itemImg" @tap="tapChoose(2)" :src="gaothree.imgSrc" mode=""></image>
<cate-pu :activeb="publicColor" :newcateList="ktList" :isMinW="true" :newCurrent="newCurrent*1" @choosecateEv="choosecateEv" :newbmo="'#E0E0E0'"></cate-pu> </view>
</view>
<!-- 热门搜索 -->
<view v-if="isLoading" class="mar-zy30 mar-s50">
<view class="col2c fon36 bold mar-x36">热门搜索</view>
<view class="bacf fon24 disac fw radius20 pad-zy20 pad-s20">
<view @tap="chooseReEv(indexf)" v-for="(itemf,indexf) in fwList" :key="indexf" class="disac radius10 mar-x20 reitem-box">
<image src="/static/public/hot.png" mode="aspectFill"></image>
<view>{{itemf.title}}</view>
</view>
</view>
</view>
<!-- 恒美小课堂 -->
<view v-if="isLoading" class="mar-zy30 mar-s40">
<view class="col2c fon36 bold">恒美小课堂</view>
<!-- 自定义二级分类 -->
<view class="mar-s50 mar-x30">
<cate-pu :activeb="publicColor" :newcateList="ktList" :isMinW="true" :newCurrent="newCurrent*1" @choosecateEv="choosecateEv" :newbmo="'#E0E0E0'"></cate-pu>
</view>
<!-- 列表 -->
<list-pu @chooseLike="chooseLike" @comfirmev="comfirmev" :list="dataList"></list-pu>
</view> </view>
<!-- 列表 -->
<list-pu @chooseLike="chooseLike" @comfirmev="comfirmev" :list="dataList"></list-pu>
</view> </view>
</view> </template>
<template v-else>
<view class="disjcac fc" style="height: 100vh;">
<view class="fon24 col3">{{wuNet}}<text @tap="refresh" style="color: #007AFF;margin-left: 20rpx;">刷新</text></view>
</view>
</template>
<!-- 底部tab --> <!-- 底部tab -->
<foot-tab :titleList="titleList" :imgList="imgList"></foot-tab> <foot-tab :titleList="titleList" :imgList="imgList"></foot-tab>
<!-- 返回顶部 --> <!-- 返回顶部 -->
@ -73,7 +80,7 @@
<script> <script>
import swiperPu from '@/components/swiper-pu.vue'; import swiperPu from '@/components/swiper-pu.vue';
import {collectionEV,cancleCollectionEV} from '@/jsFile/publicAPI.js'; import {collectionEV,cancleCollectionEV,checkBanner} from '@/jsFile/publicAPI.js';
export default { export default {
components:{ components:{
swiperPu swiperPu
@ -83,44 +90,15 @@
statusBarHeight:uni.getSystemInfoSync().statusBarHeight, statusBarHeight:uni.getSystemInfoSync().statusBarHeight,
statusHNH:uni.getStorageSync('statusHNH'), statusHNH:uni.getStorageSync('statusHNH'),
searchVal:'',// searchVal:'',//
publicColor:uni.getStorageSync('publicColor'),// publicColor:'',//
gonggList:[// gonggList:[//
// {src:'/static/public/tuof.png',title:''},
// {src:'/static/public/zhif.png',title:''},
// {src:'/static/public/toub.png',title:''},
// {src:'/static/public/tous.png',title:''},
// {src:'/static/public/zhir.png',title:''},
// {src:'/static/public/zhij.png',title:''},
// {src:'/static/public/zhis.png',title:''},
// {src:'/static/public/gengd.png',title:''},
], ],
fwList:[// fwList:[//
// {title:''},
// {title:''},
// {title:''},
// {title:''},
// {title:''},
// {title:''},
], ],
kcurrent:0,// kcurrent:0,//
ktList:[// ktList:[//
// {title:'线'},
// {title:''},
// {title:''},
// {title:''},
// {title:''},
], ],
dataList:[// dataList:[//
// {
// status:false,
// main_img:'/static/public/main_img.png',
// title:'',
// content:'',
// head_img:'/static/public/like.png',
// name:'',
// isCate:0,
// isVideo:false
// },
], ],
showTop:false, showTop:false,
newCurrent:0, newCurrent:0,
@ -135,7 +113,12 @@
imgList:[],// imgList:[],//
gaoone:{}, gaoone:{},
gaotwo:{}, gaotwo:{},
gaothree:{} gaothree:{},
isNet:true,
wuNet:'当前无网络连接',
refTime:'',
reNum:0,
bannerList:[]//
} }
}, },
onPageScroll(e) { onPageScroll(e) {
@ -151,6 +134,8 @@
} }
}, },
onShow() { onShow() {
this.checkNet()
this.$toolAll.tools.isLogin()
let maiOjb = { let maiOjb = {
e:6,// e:6,//
t:new Date().getTime()// t:new Date().getTime()//
@ -171,9 +156,63 @@
this.checkKT() this.checkKT()
this.checkBCate() this.checkBCate()
this.checkKey() this.checkKey()
this.checkSwi()//
// this.checkBanner()//
this.$toolAll.tools.buriedPointAll()//id this.$toolAll.tools.buriedPointAll()//id
}, },
methods: { methods: {
checkSwi(){
checkBanner({position:'home-banner'}).then(res=>{
if(res.code==0){
if(res.data.length!=0){
res.data.forEach(item=>{
let isVideo = false
if(item.type!='img') isVideo = true
let banObj = {
imgSrc:this.$http + item.src,
url:item.url,
isVideo:isVideo,
poster:this.$http + item.src,
}
this.bannerList.push(banObj)
})
}
//
}
})
},
checkNet(){
uni.getNetworkType({
success: (res)=> {
if(res.networkType=='none'){
uni.setStorageSync('isNet',false)
this.isNet = false
if((this.reNum++)==5){
clearInterval(this.refTime)
this.wuNet = '刷新失败'
this.reNum = 0
}
this.publicColor = uni.getStorageSync('publicColor')
} else {
uni.setStorageSync('isNet',true)
this.isNet = true
clearInterval(this.refTime)
if(this.wuNet == '正在刷新...') {
getCurrentPages()[getCurrentPages().length - 1].onLoad()
}
}
}
});
},
refresh(){
this.wuNet = '正在刷新...'
this.refTime = setInterval(()=>{
this.checkNet()
},1000)
},
bangd(){//
this.$requst.post('').then(res=>{console.log('绑定客服:',res);},error=>{})
},
tapChoose(index){// tapChoose(index){//
let newUrl = '' let newUrl = ''
if(index==0) newUrl = this.gaoone.url if(index==0) newUrl = this.gaoone.url
@ -257,6 +296,8 @@
url:res.data.ad[2].link, url:res.data.ad[2].link,
} }
} }
// this.publicColor = res.data.mainColor
this.publicColor = uni.getStorageSync('publicColor')
} }
} }
},error=>{}) },error=>{})

View File

@ -18,6 +18,9 @@
imgList:[] imgList:[]
} }
}, },
onShow() {
this.$toolAll.tools.isLogin()
},
onLoad() { onLoad() {
this.titleList = uni.getStorageSync('footTitle') this.titleList = uni.getStorageSync('footTitle')
this.imgList = uni.getStorageSync('footimg') this.imgList = uni.getStorageSync('footimg')

View File

@ -72,6 +72,7 @@
} }
}, },
onShow() { onShow() {
this.$toolAll.tools.isLogin()
this.checkPoint()// this.checkPoint()//
this.$toolAll.tools.showToast('加载中...','loading') this.$toolAll.tools.showToast('加载中...','loading')
}, },

View File

@ -107,9 +107,15 @@
newProvice:'',// newProvice:'',//
newCity:'',// newCity:'',//
newDistrict:'',// newDistrict:'',//
whereCome:1 whereCome:0
} }
}, },
onShow() {
this.$toolAll.tools.isLogin()
},
onUnload() {
uni.removeStorageSync('firstInfo')
},
onLoad(options) { onLoad(options) {
if(options.whereNum==2){ if(options.whereNum==2){
this.whereCome = options.whereNum this.whereCome = options.whereNum
@ -123,17 +129,24 @@
this.getDistrict(res.latitude, res.longitude) this.getDistrict(res.latitude, res.longitude)
}, },
}) })
let obj = uni.getStorageSync('uinfo') let firstObj = uni.getStorageSync('firstInfo')
if(obj!='') this.uinfo = obj console.log('firstObj',firstObj);
this.dataList[0].imgSrc = obj.headimgurl// if(firstObj==''){
this.dataList[1].content = obj.nickname// let obj = uni.getStorageSync('uinfo')
this.dataList[2].content = obj.coding//ID if(obj!='') this.uinfo = obj
this.current = obj.gender//12,0 this.dataList[0].imgSrc = obj.headimgurl//
obj.birthday!='' ? this.pickerTime = [obj.birthday.slice(0,10)] : this.pickerTime = [time.slice(0,10)]// this.dataList[1].content = obj.nickname//
obj.real_name!=null && obj.real_name !='' ? this.dataList[5].content = obj.real_name : this.dataList[5].fcon = '未知'// this.dataList[2].content = obj.coding//ID
obj.mobile!='' ? this.dataList[6].content = obj.mobile : this.dataList[6].fcon = '未知'// this.current = obj.gender//12,0
if(obj.county!='') this.pickerText = obj.province + obj.city + obj.county// obj.birthday!='' ? this.pickerTime = [obj.birthday.slice(0,10)] : this.pickerTime = [time.slice(0,10)]//
obj.real_name!=null && obj.real_name !='' ? this.dataList[5].content = obj.real_name : this.dataList[5].fcon = '未知'//
obj.mobile!='' ? this.dataList[6].content = obj.mobile : this.dataList[6].fcon = '未知'//
if(obj.county!='') this.pickerText = obj.province + obj.city + obj.county//
} else {
this.dataList[0].imgSrc = firstObj.headimgurl//
this.dataList[1].content = firstObj.nickname//
this.current = firstObj.gender//12,0
}
}, },
methods: { methods: {
updataInfo(){// updataInfo(){//

View File

@ -107,6 +107,9 @@
btnCon:'立即提交' btnCon:'立即提交'
} }
}, },
onShow() {
this.$toolAll.tools.isLogin()
},
onLoad() { onLoad() {
this.category = this.xialone[0] this.category = this.xialone[0]
this.categoryT = this.xialTwo[0] this.categoryT = this.xialTwo[0]

View File

@ -71,6 +71,9 @@
btnCon:'立即提交' btnCon:'立即提交'
} }
}, },
onShow() {
this.$toolAll.tools.isLogin()
},
onLoad() { onLoad() {
this.checkCate() this.checkCate()
}, },

View File

@ -5,7 +5,7 @@
<view :style="{paddingTop: statusHNH+'px'}" class="pad-zy32"> <view :style="{paddingTop: statusHNH+'px'}" class="pad-zy32">
<!-- 自定义轮播 --> <!-- 自定义轮播 -->
<view class="mar-s20"> <view class="mar-s20">
<swiper-pu :newHeight="'200'" :newRadius="'10'" :newBottom="'5'"></swiper-pu> <swiper-pu :bannerList="bannerList" :newHeight="'200'" :newRadius="'10'" :newBottom="'5'"></swiper-pu>
</view> </view>
<!-- 导航 --> <!-- 导航 -->
<view class="mar-s50 pad-s10"> <view class="mar-s50 pad-s10">
@ -33,6 +33,7 @@
<script> <script>
import swiperPu from '@/components/swiper-pu.vue'; import swiperPu from '@/components/swiper-pu.vue';
import {checkBanner} from '@/jsFile/publicAPI.js';
export default { export default {
components:{ components:{
swiperPu swiperPu
@ -63,6 +64,7 @@
size:10, size:10,
total:'',// total:'',//
isZanw:true, isZanw:true,
bannerList:[]
} }
}, },
onPageScroll(e) { onPageScroll(e) {
@ -77,10 +79,36 @@
this.isZanw = false this.isZanw = false
} }
}, },
onShow() {
this.$toolAll.tools.isLogin()
},
onLoad() { onLoad() {
this.checkAbout(this.category_id) this.checkAbout(this.category_id)
this.checkSwi()
}, },
methods: { methods: {
checkSwi(){
checkBanner({position:'home-banner'}).then(res=>{
if(res.code==0){
if(res.data.length!=0){
res.data.forEach(item=>{
let isVideo = false
if(item.type!='img') isVideo = true
let haveImg = ''
if(item.src!='') haveImg = this.$http + item.src
let banObj = {
imgSrc:haveImg,
url:item.url,
isVideo:isVideo,
poster:this.$http + item.src,
}
this.bannerList.push(banObj)
})
}
//
}
})
},
checkAbout(category_id){ checkAbout(category_id){
let params = { let params = {
category_id:category_id, category_id:category_id,

View File

@ -40,6 +40,9 @@
isLoading:false isLoading:false
} }
}, },
onShow() {
this.$toolAll.tools.isLogin()
},
onLoad(options) { onLoad(options) {
this.checkDetail(options.id) this.checkDetail(options.id)
}, },

View File

@ -0,0 +1,51 @@
<template>
<view>
<!-- 状态栏 -->
<status-nav :titleVal="'我的二维码'" :statusTitle="true"></status-nav>
<view :style="{paddingTop: statusHNH+'px'}" class="pad-zy32">
<image :src="imgSrc" class="mar-s32" style="width: 100%;" mode="widthFix"></image>
<view v-if="isBtn" @tap="sendImg" class="fon40 bold colf mar-z10 radius20 tc" style="height: 90rpx;margin: 80rpx;background-color: #38CE51;line-height: 90rpx;"></view>
</view>
</view>
</template>
<script>
import {base64ToPath} from '@/jsFile/base64-src.js';
export default {
data() {
return {
statusHNH:uni.getStorageSync('statusHNH'),
publicColor:uni.getStorageSync('publicColor'),//
imgSrc:'',
isBtn:false
}
},
onShow() {
this.$toolAll.tools.isLogin()
},
onLoad() {
this.checkImg()
},
methods: {
checkImg(){
this.$requst.post('user/service-qr').then(res=>{
// console.log('',res);
if(res.code==0){
base64ToPath(res.data.qr).then(path => {
this.imgSrc = path
this.isBtn = true
}).catch(error => {})
}
},error=>{})
},
sendImg(){
wx.showShareImageMenu({
path: this.imgSrc
})
}
}
}
</script>
<style>
</style>

View File

@ -79,6 +79,9 @@
this.dataList.push(obj) this.dataList.push(obj)
} }
}, },
onShow() {
this.$toolAll.tools.isLogin()
},
onLoad() { onLoad() {
this.category = this.xialone[0] this.category = this.xialone[0]
}, },

View File

@ -23,7 +23,8 @@
</view> </view>
<view v-if="dataList.length==0" class="disjcac fc" style="margin-top: 50%;"> <view v-if="dataList.length==0" class="disjcac fc" style="margin-top: 50%;">
<image class="zanw-img" src="/static/public/nothing.png" mode="aspectFill"></image> <image class="zanw-img" src="/static/public/nothing.png" mode="aspectFill"></image>
<view class="fon24 col3">您搜索的内容暂无结果换个关键词试试吧</view> <view v-if="keyword!=''" class="fon24 col3"></view>
<view v-if="keyword==''" class="fon24 col3"></view>
</view> </view>
<!-- 返回顶部 --> <!-- 返回顶部 -->
<!-- <back-top :showTop="showTop" @backTop="backTop"></back-top> --> <!-- <back-top :showTop="showTop" @backTop="backTop"></back-top> -->
@ -68,6 +69,9 @@
this.isZanw = false this.isZanw = false
} }
}, },
onShow() {
this.$toolAll.tools.isLogin()
},
onLoad() { onLoad() {
this.checkDor() this.checkDor()
}, },

View File

@ -67,7 +67,7 @@
], ],
showTop:false, showTop:false,
newCurrent:0, newCurrent:0,
category_id:'',//ID category_id:0,//ID
moImg:'/static/public/logo.png', moImg:'/static/public/logo.png',
doctorObj:{},// doctorObj:{},//
page:1, page:1,
@ -93,6 +93,9 @@
this.isZanw = false this.isZanw = false
} }
}, },
onShow() {
this.$toolAll.tools.isLogin()
},
onLoad(options) { onLoad(options) {
this.checkDoD(options.doctor_id) this.checkDoD(options.doctor_id)
this.checkConList(this.category_id) this.checkConList(this.category_id)
@ -119,7 +122,7 @@
page:this.page, page:this.page,
size:this.size size:this.size
} }
this.$requst.post('archives/collects',params).then(res=>{ this.$requst.post('archives/hot',params).then(res=>{
if(res.code==0){ if(res.code==0){
// //
if(uni.getStorageSync('cateList')==''){// if(uni.getStorageSync('cateList')==''){//
@ -137,10 +140,12 @@
this.cateList.push(cateObj) this.cateList.push(cateObj)
}) })
uni.setStorageSync('cateList',this.cateList) uni.setStorageSync('cateList',this.cateList)
this.category_id = this.cateList[0].id
} }
} else { } else {
// //
this.cateList = uni.getStorageSync('cateList') this.cateList = uni.getStorageSync('cateList')
this.category_id = this.cateList[0].id
} }
// //
if(this.page==1) this.dataList = [] if(this.page==1) this.dataList = []

View File

@ -72,6 +72,9 @@
// this.dataList.push(obj) // this.dataList.push(obj)
// } // }
}, },
onShow() {
this.$toolAll.tools.isLogin()
},
onLoad() { onLoad() {
this.checkMsg() this.checkMsg()
}, },

View File

@ -59,6 +59,9 @@
onUnload() { onUnload() {
uni.removeStorageSync('cateList') uni.removeStorageSync('cateList')
}, },
onShow() {
this.$toolAll.tools.isLogin()
},
onLoad() { onLoad() {
this.checkConList(this.category_id) this.checkConList(this.category_id)
const query = wx.createSelectorQuery() const query = wx.createSelectorQuery()

View File

@ -75,6 +75,9 @@
this.isZanw = false this.isZanw = false
} }
}, },
onShow() {
this.$toolAll.tools.isLogin()
},
onLoad() { onLoad() {
if(uni.getStorageSync('navHeight')==''){ if(uni.getStorageSync('navHeight')==''){
const query = wx.createSelectorQuery() const query = wx.createSelectorQuery()

View File

@ -10,7 +10,7 @@
<image class="width100 radius20" :src="imgSrc" mode="widthFix" lazy-load></image> <image class="width100 radius20" :src="imgSrc" mode="widthFix" lazy-load></image>
</view> </view>
<!-- 分享按钮 --> <!-- 分享按钮 -->
<view @tap="shareEv" class="disjcac radius20 posir" style="height: 90rpx;margin: 20rpx 80rpx 0 80rpx;background-color: #38CE51;line-height: 90rpx;"> <view v-if="showBtn" @tap="shareEv" class="disjcac radius20 posir" style="height: 90rpx;margin: 20rpx 80rpx 0 80rpx;background-color: #38CE51;line-height: 90rpx;">
<view class="disac"> <view class="disac">
<image src="/static/public/sharef.png" style="width: 54rpx;height: 54rpx;" mode=""></image> <image src="/static/public/sharef.png" style="width: 54rpx;height: 54rpx;" mode=""></image>
<view class="fon40 bold colf mar-z10">分享给好友</view> <view class="fon40 bold colf mar-z10">分享给好友</view>
@ -36,12 +36,21 @@
publicColor:uni.getStorageSync('publicColor'),// publicColor:uni.getStorageSync('publicColor'),//
isShowT:true, isShowT:true,
imgSrc:uni.getStorageSync('imgSrcP'), imgSrc:uni.getStorageSync('imgSrcP'),
isHaib:false isHaib:false,
showBtn:false
} }
}, },
onShow() {
this.$toolAll.tools.isLogin()
},
onLoad() { onLoad() {
// //
this.imgSrc = uni.getStorageSync('imgSrcP')// this.imgSrc = uni.getStorageSync('imgSrcP')//
if(this.imgSrc!='') {
setTimeout(()=>{
this.showBtn = true
},500)
}
}, },
methods: { methods: {
shareEv(){ shareEv(){
@ -60,6 +69,7 @@
this.$toolAll.tools.showToast('生成海报成功') this.$toolAll.tools.showToast('生成海报成功')
base64ToPath(this.imgSrc).then(path => { base64ToPath(this.imgSrc).then(path => {
this.imgSrc = path this.imgSrc = path
this.showBtn = true
uni.setStorageSync('imgSrcP',path) uni.setStorageSync('imgSrcP',path)
}).catch(error => {}) }).catch(error => {})
} }

View File

@ -5,7 +5,7 @@
<!-- 列表 --> <!-- 列表 -->
<view :style="{top: statusHNH+'px'}" class="posiszy" style="height: 50px;"> <view :style="{top: statusHNH+'px'}" class="posiszy" style="height: 50px;">
<view class="bacf pad-zy32 pad-sx20"> <view class="bacf pad-zy32 pad-sx20">
<cate-pu @choosecateEv="choosecateEv" :newCurrent="cateCurrent*1" :newbmo="'#F2F2F2'" :isCenter="false" :newcateList="cateList"></cate-pu> <cate-pu @choosecateEv="choosecateEv" :activeb="publicColor" :newCurrent="cateCurrent*1" :newbmo="'#F2F2F2'" :isCenter="false" :newcateList="cateList"></cate-pu>
</view> </view>
</view> </view>
<view class="" :style="{paddingTop: (statusHNH+50)+'px'}" style="padding-bottom: 118rpx;"> <view class="" :style="{paddingTop: (statusHNH+50)+'px'}" style="padding-bottom: 118rpx;">
@ -161,7 +161,6 @@
xgList:[// xgList:[//
], ],
dataList:[// dataList:[//
// {imgSrc:'/static/public/doctor.png',name:'',cyear:'16',bmen:'',zcheng:'',goodAt:''},
], ],
showTop:false, showTop:false,
isDetailLike:false,// isDetailLike:false,//
@ -170,18 +169,16 @@
isNum:0, isNum:0,
listArrone:[],// listArrone:[],//
listArrtwo:[// listArrtwo:[//
// {status:false,main_img:'/static/public/main_four.png',title:'',content:'',head_img:'/static/public/like.png',name:'',isCate:1},
], ],
listArrthree:[// listArrthree:[//
// {status:false,main_img:'/static/public/main_two.png',title:'',content:'',head_img:'/static/public/like.png',name:'',isCate:2},
], ],
listArrfour:[// listArrfour:[//
// {status:false,main_img:'/static/public/main_three.png',title:'',content:'',head_img:'/static/public/like.png',name:'',isCate:3},
], ],
detailObj:{},// detailObj:{},//
detailInfo:'',// detailInfo:'',//
category_id:'',//ID category_id:'',//ID
active:'',// active:'',//
jieDuan:false
} }
}, },
onPageScroll(e) { onPageScroll(e) {
@ -237,6 +234,9 @@
  };   };
  return shareObj;   return shareObj;
}, },
onShow() {
this.$toolAll.tools.isLogin()
},
onLoad(options) { onLoad(options) {
if(options.category_id!=undefined) { if(options.category_id!=undefined) {
this.category_id = options.category_id this.category_id = options.category_id
@ -249,7 +249,7 @@
t:new Date().getTime()// t:new Date().getTime()//
} }
this.$toolAll.tools.maiDian(maiOjb) this.$toolAll.tools.maiDian(maiOjb)
if(uni.getStorageSync('headImg')=='') this.haveImg = false if(uni.getStorageSync('is_active')==0) this.haveImg = false
}, },
methods: { methods: {
chooseLike(e){// chooseLike(e){//
@ -321,22 +321,18 @@
url:'/pages/tabbar/pagehome/pagehome' url:'/pages/tabbar/pagehome/pagehome'
}) })
}, },
lianK(){ lianK(){//
if(uni.getStorageSync('headImg')=='') { if(!this.jieDuan){
this.$toolAll.tools.showToast('您当前是游客,请授权登录') let isAuth = this.$toolAll.tools.returnAuth()
setTimeout(()=>{ if(!isAuth){
uni.navigateTo({ this.$toolAll.tools.closeTimer()//
url:'/pages/login/login' this.$requst.post('user/record',{type:'other',action:'ask',id:0}).then(res=>{},error=>{})
}) let maiOjb = {
},1500) e:5,//
} else { t:new Date().getTime()//
this.$toolAll.tools.closeTimer()// }
this.$requst.post('user/record',{type:'other',action:'ask',id:0}).then(res=>{},error=>{}) this.$toolAll.tools.maiDian(maiOjb)
let maiOjb = { } else this.jieDuan = true
e:5,//
t:new Date().getTime()//
}
this.$toolAll.tools.maiDian(maiOjb)
} }
}, },
buttonH(e){ buttonH(e){
@ -346,14 +342,10 @@
if(e==0) this.vision = false if(e==0) this.vision = false
}, },
shareEv(){ shareEv(){
if(uni.getStorageSync('headImg')=='') { if(!this.jieDuan){
this.$toolAll.tools.showToast('您当前是游客,请授权登录') let isAuth = this.$toolAll.tools.returnAuth()
setTimeout(()=>{ if(!isAuth){this.haveImg=true} else this.jieDuan = true
uni.navigateTo({ }
url:'/pages/login/login'
})
},1500)
} else {this.haveImg=true}
}, },
checkDetail(newId){ checkDetail(newId){
this.$requst.post('archives/detail',{id:newId}).then(res=>{ this.$requst.post('archives/detail',{id:newId}).then(res=>{
@ -385,21 +377,9 @@
else this.likeCon = this.detailObj.likes else this.likeCon = this.detailObj.likes
} }
// //
//
if(this.detailObj.video!=''){
this.bannerList = [
{
imgSrc:this.$http + this.detailObj.cover,
url:this.$http + this.detailObj.video,
isVideo:true,
poster:'',
}
]
}
// //
let arrImg = this.detailObj.images.split(',') let arrImg = this.detailObj.images.split(',')
arrImg.forEach(item=>{ arrImg.forEach(item=>{
console.log(item);
let newImgObj = { let newImgObj = {
imgSrc:this.$http + item, imgSrc:this.$http + item,
url:'', url:'',
@ -409,7 +389,15 @@
// //
this.bannerList.push(newImgObj) this.bannerList.push(newImgObj)
}) })
//
if(this.detailObj.video!=''){
this.bannerList[0] = {
imgSrc:arrImg[0],
url:this.$http + this.detailObj.video,
isVideo:true,
poster:'',
}
}
// //
if(this.detailObj.is_collected==0) this.isDetailConllection = false if(this.detailObj.is_collected==0) this.isDetailConllection = false
if(this.detailObj.is_collected==1) this.isDetailConllection = true if(this.detailObj.is_collected==1) this.isDetailConllection = true
@ -501,45 +489,37 @@
},error=>{}) },error=>{})
}, },
tapLike(){// tapLike(){//
if(uni.getStorageSync('headImg')=='') { if(!this.jieDuan){
this.$toolAll.tools.showToast('您当前是游客,请授权登录') let isAuth = this.$toolAll.tools.returnAuth()
setTimeout(()=>{ if(!isAuth){
uni.navigateTo({ this.isDetailLike = !this.isDetailLike
url:'/pages/login/login' if(this.isDetailLike){
}) this.detailObj.likes++
},1500) this.likeCon = this.detailObj.likes
} else { if(this.likeCon >= 1000) this.likeCon = '999+'
this.isDetailLike = !this.isDetailLike }else{
if(this.isDetailLike){ this.detailObj.likes--
this.detailObj.likes++ this.likeCon = '喜欢'
this.likeCon = this.detailObj.likes }
if(this.likeCon >= 1000) this.likeCon = '999+' let isLikeCon = 'like'
}else{ //
this.detailObj.likes-- if(this.isDetailLike) collectionEV({action:isLikeCon,archive_id:this.detailObj.id})
this.likeCon = '喜欢' //
} else cancleCollectionEV({action:isLikeCon,archive_id:this.detailObj.id})
let isLikeCon = 'like' } else this.jieDuan = true
//
if(this.isDetailLike) collectionEV({action:isLikeCon,archive_id:this.detailObj.id})
//
else cancleCollectionEV({action:isLikeCon,archive_id:this.detailObj.id})
} }
}, },
tapConllection(){// tapConllection(){//
let isLikeCon = 'collect' let isLikeCon = 'collect'
if(uni.getStorageSync('headImg')=='') { if(!this.jieDuan){
this.$toolAll.tools.showToast('您当前是游客,请授权登录') let isAuth = this.$toolAll.tools.returnAuth()
setTimeout(()=>{ if(!isAuth){
uni.navigateTo({ //
url:'/pages/login/login' if(!this.isDetailConllection) collectionEV({action:isLikeCon,archive_id:this.detailObj.id})
}) //
},1500) else cancleCollectionEV({action:isLikeCon,archive_id:this.detailObj.id})
} else { this.isDetailConllection = !this.isDetailConllection
// } else this.jieDuan = true
if(!this.isDetailConllection) collectionEV({action:isLikeCon,archive_id:this.detailObj.id})
//
else cancleCollectionEV({action:isLikeCon,archive_id:this.detailObj.id})
this.isDetailConllection = !this.isDetailConllection
} }
}, },
backTop(){// backTop(){//

View File

@ -106,6 +106,7 @@
this.checkSearchHistory() this.checkSearchHistory()
}, },
onShow() { onShow() {
this.$toolAll.tools.isLogin()
if(this.searchVal!=undefined && this.searchVal!='') this.searchEv() if(this.searchVal!=undefined && this.searchVal!='') this.searchEv()
}, },
methods: { methods: {

View File

@ -72,6 +72,9 @@
  };   };
  return shareObj;   return shareObj;
}, },
onShow() {
this.$toolAll.tools.isLogin()
},
onLoad() { onLoad() {
uni.getStorageSync('shareAll')!='' ? this.dataList[1].num = uni.getStorageSync('shareAll').share_users.total : this.dataList[1].num = 0 uni.getStorageSync('shareAll')!='' ? this.dataList[1].num = uni.getStorageSync('shareAll').share_users.total : this.dataList[1].num = 0
}, },

View File

@ -8,23 +8,27 @@
<view class="radius20 fon28 col3 mar-sx20"> <view class="radius20 fon28 col3 mar-sx20">
<view class="disac"> <view class="disac">
<view class="disjbac width100 radius10 pad-zy20 xialak bacf"> <view class="disjbac width100 radius10 pad-zy20 xialak bacf">
<input class="fon28" type="text" value="" placeholder="请输入姓名/电话查找" placeholder-style="color: #B3B3B3;" /> <input class="fon28 width100" type="text" v-model="keyword" placeholder="请输入姓名/电话查找" placeholder-style="color: #B3B3B3;" />
</view> </view>
<view class="flexs tc mar-z30 colf radius10 customer-btn" :style="{background:publicColor}">搜索</view> <view @tap="searchEv" class="flexs tc mar-z30 colf radius10 customer-btn" :style="{background:publicColor}">搜索</view>
</view> </view>
</view> </view>
<!-- 列表 --> <!-- 列表 -->
<view class="bacf radius10 pad20 mar-x20 fon28" v-for="(item,index) in dataList" :key="index"> <view @tap="chooseId(item.id)" class="bacf radius10 pad20 mar-x20 fon28" v-for="(item,index) in dataList" :key="index">
<view style="color: #B3B3B3;">{{item.time}}</view> <view style="color: #B3B3B3;">{{item.time}}</view>
<view class="mar-s20"> <view class="mar-s20">
<text class="bold col3">{{item.name}}</text> <text class="bold col3">{{item.name}}</text>
<text style="color: #B3B3B3;">查看了</text> <text style="color: #B3B3B3;">{{item.action}}</text>
<text class="bold col3">{{item.title}}</text> <text class="bold col3" v-if="item.title!=null && item.title!=''">{{item.title}}</text>
<text style="color: #B3B3B3;">{{item.zwhat}}</text> <text style="color: #B3B3B3;" v-if="item.zwhat!=null && item.zwhat!=''">{{item.zwhat}}</text>
</view> </view>
</view> </view>
<view v-if="dataList.length==0" class="disjcac fc" style="margin-top: 50%;">
<image class="zanw-img" src="/static/public/nothing.png" mode="aspectFill"></image>
<view class="fon24 col3">您搜索的内容暂无结果换个关键词试试吧</view>
</view>
<!-- 返回顶部 --> <!-- 返回顶部 -->
<!-- <back-top :showTop="showTop" @backTop="backTop"></back-top> --> <back-top :showTop="showTop" @backTop="backTop"></back-top>
</view> </view>
</view> </view>
</template> </template>
@ -35,34 +39,80 @@
return { return {
statusHNH:uni.getStorageSync('statusHNH'), statusHNH:uni.getStorageSync('statusHNH'),
publicColor:uni.getStorageSync('publicColor'),// publicColor:uni.getStorageSync('publicColor'),//
dataList:[ dataList:[],//
{name:'恒美小姐姐',title:'秃顶如何治疗',time:'2021-07-15 20:26:16',zwhat:'日记'}, showTop:false,//
{name:'恒美小姐姐',title:'秃顶如何治疗',time:'2021-07-15 20:26:16',zwhat:'日记'}, customer_id:'',//ID
{name:'恒美小姐姐',title:'秃顶如何治疗',time:'2021-07-15 20:26:16',zwhat:'日记'}, keyword:'',//
{name:'恒美小姐姐',title:'秃顶如何治疗',time:'2021-07-15 20:26:16',zwhat:'日记'}, page:1,
{name:'恒美小姐姐',title:'秃顶如何治疗',time:'2021-07-15 20:26:16',zwhat:'案例'}, size:10,
{name:'恒美小姐姐',title:'秃顶如何治疗',time:'2021-07-15 20:26:16',zwhat:'案例'}, total:'',//
{name:'恒美小姐姐',title:'秃顶如何治疗',time:'2021-07-15 20:26:16',zwhat:'案例'}, isZanw:true
{name:'恒美小姐姐',title:'秃顶如何治疗',time:'2021-07-15 20:26:16',zwhat:'案例'},
{name:'恒美小姐姐',title:'秃顶如何治疗',time:'2021-07-15 20:26:16',zwhat:'案例'},
{name:'恒美小姐姐',title:'秃顶如何治疗',time:'2021-07-15 20:26:16',zwhat:'案例'},
],
showTop:false,
} }
}, },
onPageScroll(e) { onPageScroll(e) {
e.scrollTop > 360 ? this.showTop = true : this.showTop = false e.scrollTop > 360 ? this.showTop = true : this.showTop = false
}, },
onReachBottom() {// onReachBottom() {//
for (let i = 0; i < 4; i++) { if(this.total!=this.dataList.length){
let obj = {name:'恒美小姐姐',title:'秃顶如何治疗',time:'2021-07-15 20:26:16',zwhat:'案例'} this.page++
this.dataList.push(obj) this.checkList()
} else {
if(this.isZanw) this.$toolAll.tools.showToast('暂无更多足迹内容')
this.isZanw = false
} }
}, },
onShow() {
this.$toolAll.tools.isLogin()
},
onLoad() { onLoad() {
this.checkList()
}, },
methods: { methods: {
chooseId(id){
this.backTop()
this.page = 1
this.isZanw = true
this.customer_id = id
this.keyword = ''
this.checkList()
},
searchEv(){//
if(this.keyword!='') this.customer_id = ''
this.page = 1
this.isZanw = true
this.checkList()
},
checkList(){//
let params = {
page:this.page,
size:this.size,
customer_id:this.customer_id,//ID
keyword:this.keyword
}
this.$requst.post('user/footmarks',params).then(res=>{
// console.log('',res);
if(res.code==0){
if(this.page==1) this.dataList = []
this.total = res.data.total
if(res.data.list.length!=0){
res.data.list.forEach(item=>{
let newCate = ''
if(item.content_id > 0) newCate = item.category
else newCate = ''
let obj = {
id:item.account_id,
name:item.nickname,
action:item.action,
title:item.title,
time:item.created_at,
zwhat:newCate,
}
this.dataList.push(obj)
})
}
}
},error=>{})
},
backTop(){// backTop(){//
uni.pageScrollTo({ uni.pageScrollTo({
scrollTop: 0, scrollTop: 0,

Binary file not shown.

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

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

Binary file not shown.