调整登录,我的页权限判断
parent
9095998f99
commit
259b3d3606
43
App.vue
43
App.vue
|
@ -1,57 +1,22 @@
|
|||
<script>
|
||||
import toolAll from '@/jsFile/tools.js';
|
||||
// import {checkSwip} from '@/jsFile/publicAPI.js'
|
||||
export default {
|
||||
onLaunch: function() {
|
||||
toolAll.tools.clearClog()//去除体验版和正式版的所有输出日志
|
||||
},
|
||||
onShow: function() {
|
||||
uni.setStorageSync('publicColor', '#3875F6') //#3875F6
|
||||
toolAll.tools.zhuColorT()
|
||||
// uni.clearStorageSync()
|
||||
if(uni.getStorageSync('token')!='') {
|
||||
toolAll.tools.daoTime()
|
||||
toolAll.tools.networkStatus()//检查当前网络状态
|
||||
toolAll.tools.updaX()//检测版本更新
|
||||
}
|
||||
let ya = this
|
||||
uni.login({
|
||||
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)
|
||||
// }
|
||||
// })
|
||||
toolAll.tools.overdue()//查询是否第一次授权
|
||||
// checkSwip()//查询轮播图位置
|
||||
},
|
||||
onHide: function() {
|
||||
// console.log('hide');
|
||||
toolAll.tools.closeTimer()//清空埋点倒计时
|
||||
}
|
||||
};
|
||||
|
|
|
@ -100,7 +100,7 @@
|
|||
.width100{width: 100%;}
|
||||
.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;}
|
||||
.posia{position: absolute;}
|
||||
.posiszy{position: fixed;left: 0;right: 0;z-index: 2;}
|
||||
|
|
|
@ -58,26 +58,26 @@
|
|||
default:function(){
|
||||
return uni.getStorageSync('imgList')
|
||||
// return [
|
||||
// {
|
||||
// iconPath: '/static/tabbar/homem.png',//默认icon
|
||||
// selectedIconPath: '/static/tabbar/homeAc.png',//选中icon
|
||||
// },
|
||||
// {
|
||||
// iconPath: '/static/tabbar/catem.png',//默认icon
|
||||
// selectedIconPath: '/static/tabbar/cates.png',//选中icon
|
||||
// },
|
||||
// {
|
||||
// iconPath: '/static/tabbar/customerm.png',//默认icon
|
||||
// selectedIconPath: '/static/tabbar/customerm.png',//选中icon
|
||||
// },
|
||||
// {
|
||||
// iconPath: '/static/tabbar/shopm.png',//默认icon
|
||||
// selectedIconPath: '/static/tabbar/shopa.png',//选中icon
|
||||
// },
|
||||
// {
|
||||
// iconPath: '/static/tabbar/mym.png',//默认icon
|
||||
// selectedIconPath: '/static/tabbar/mya.png',//选中icon
|
||||
// }
|
||||
// {
|
||||
// iconPath: '/static/tabbar/homem.png',//默认icon
|
||||
// selectedIconPath: '/static/tabbar/homeAc.png',//选中icon
|
||||
// },
|
||||
// {
|
||||
// iconPath: '/static/tabbar/catem.png',//默认icon
|
||||
// selectedIconPath: '/static/tabbar/cates.png',//选中icon
|
||||
// },
|
||||
// {
|
||||
// iconPath: '/static/tabbar/customerm.png',//默认icon
|
||||
// selectedIconPath: '/static/tabbar/customerm.png',//选中icon
|
||||
// },
|
||||
// {
|
||||
// iconPath: '/static/tabbar/shopm.png',//默认icon
|
||||
// selectedIconPath: '/static/tabbar/shopa.png',//选中icon
|
||||
// },
|
||||
// {
|
||||
// iconPath: '/static/tabbar/mym.png',//默认icon
|
||||
// selectedIconPath: '/static/tabbar/mya.png',//选中icon
|
||||
// }
|
||||
// ]
|
||||
}
|
||||
}
|
||||
|
@ -87,42 +87,11 @@
|
|||
vision:false,
|
||||
isShowT:false,
|
||||
isKef:true,
|
||||
// tabArr:[
|
||||
// {
|
||||
// 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: '我的'
|
||||
// },
|
||||
//],
|
||||
jieDuan:false
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
if(uni.getStorageSync('headImg')=='') this.isKef = false
|
||||
if(uni.getStorageSync('is_active')==0) this.isKef = false
|
||||
},
|
||||
methods:{
|
||||
cancleEv(e){
|
||||
|
@ -132,24 +101,25 @@
|
|||
// this.current = index
|
||||
switch (index){
|
||||
case 0:
|
||||
console.log(this.imgList[index].selectedIcoPath);
|
||||
// console.log(this.imgList[index].selectedIcoPath);
|
||||
uni.reLaunch({url:'/pages/tabbar/pagehome/pagehome'})
|
||||
break;
|
||||
case 1:
|
||||
uni.navigateTo({url:'/pages/tabbar/cate/cate'})
|
||||
break;
|
||||
case 2:
|
||||
if(uni.getStorageSync('headImg')==''){
|
||||
this.vision = true
|
||||
} else {
|
||||
this.$toolAll.tools.closeTimer()//清空埋点倒计时
|
||||
// uni.navigateTo({url:'/pages/tabbar/pagehome/pagehome'})
|
||||
this.$requst.post('user/record',{type:'other',action:'ask',id:0}).then(res=>{},error=>{})
|
||||
let maiOjb = {
|
||||
e:5,//内容咨询
|
||||
t:new Date().getTime()//当前时间戳
|
||||
}
|
||||
this.$toolAll.tools.maiDian(maiOjb)
|
||||
if(!this.jieDuan){
|
||||
let isAuth = this.$toolAll.tools.returnAuth()
|
||||
if(!isAuth){
|
||||
this.$toolAll.tools.closeTimer()//清空埋点倒计时
|
||||
// uni.navigateTo({url:'/pages/tabbar/pagehome/pagehome'})
|
||||
this.$requst.post('user/record',{type:'other',action:'ask',id:0}).then(res=>{},error=>{})
|
||||
let maiOjb = {
|
||||
e:5,//内容咨询
|
||||
t:new Date().getTime()//当前时间戳
|
||||
}
|
||||
this.$toolAll.tools.maiDian(maiOjb)
|
||||
} else this.jieDuan = true
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
|
@ -157,7 +127,12 @@
|
|||
// uni.navigateTo({url:'/pages/tabbar/shop/shop'})
|
||||
break;
|
||||
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;
|
||||
}
|
||||
},
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
<!-- 喜欢 -->
|
||||
<image v-else :class="item.is_collected==1?'bounceIn':'bounceOut'" class="animated" src="/static/public/like.png" mode="aspectFill"></image>
|
||||
</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="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>
|
||||
</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="clips1">{{item.title}}</view>
|
||||
|
@ -110,7 +110,8 @@
|
|||
vision:false,
|
||||
isShowT:false,
|
||||
pu_content:'是否需要取消收藏?',
|
||||
current:'-1'
|
||||
current:'-1',
|
||||
jieDuan:false
|
||||
};
|
||||
},
|
||||
methods:{
|
||||
|
@ -125,21 +126,22 @@
|
|||
},
|
||||
chooseLike(index){//喜欢不喜欢事件
|
||||
// console.log('喜欢不喜欢:',index);
|
||||
if(uni.getStorageSync('headImg')==0){
|
||||
this.vision = true
|
||||
} else {
|
||||
this.$emit('chooseLike',index)
|
||||
this.current = index
|
||||
if(this.list[index].is_collected==1) {
|
||||
this.isShowT = true
|
||||
} else {
|
||||
let maiOjb = {
|
||||
e:3,//内容收藏
|
||||
c:this.list[index].id,
|
||||
t:new Date().getTime()//当前时间戳
|
||||
if(this.jieDuan==false){
|
||||
let isAuth = this.$toolAll.tools.returnAuth()
|
||||
if(!isAuth){
|
||||
this.$emit('chooseLike',index)
|
||||
this.current = index
|
||||
if(this.list[index].is_collected==1) {
|
||||
this.isShowT = true
|
||||
} else {
|
||||
let maiOjb = {
|
||||
e:3,//内容收藏
|
||||
c:this.list[index].id,
|
||||
t:new Date().getTime()//当前时间戳
|
||||
}
|
||||
this.$toolAll.tools.maiDian(maiOjb)
|
||||
}
|
||||
this.$toolAll.tools.maiDian(maiOjb)
|
||||
}
|
||||
} else this.jieDuan = true
|
||||
}
|
||||
},
|
||||
comfirmev(){
|
||||
|
|
|
@ -3,7 +3,9 @@
|
|||
<view :style="{height:statusBarHeight+'px',background:backgroudColor}"></view>
|
||||
<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="tab-title tcenter" :style="{color:tabcolor}">{{titleVal}}</view>
|
||||
|
|
|
@ -62,6 +62,9 @@
|
|||
chooseImg(index){
|
||||
// console.log('当前banner图',index);
|
||||
this.bcurrent = index
|
||||
uni.navigateTo({
|
||||
url:this.bannerList[index].url
|
||||
})
|
||||
},
|
||||
changeBanner(e){
|
||||
this.bcurrent = e.detail.current//当前的指示点下标
|
||||
|
|
|
@ -38,6 +38,25 @@ export function buriedPoint(){//查询埋点类型事件
|
|||
},error=>{})
|
||||
}
|
||||
export function reportBuriedPoint(data){//上报埋点事件
|
||||
console.log('埋点的数据:',data);
|
||||
// console.log('埋点的数据:',data);
|
||||
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)
|
||||
}
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import {buriedPoint,reportBuriedPoint} from './publicAPI.js';
|
||||
import {buriedPoint,reportBuriedPoint,zhuColor} from './publicAPI.js';
|
||||
const tools = {
|
||||
timer:'',
|
||||
timerNot:'',
|
||||
|
@ -37,15 +37,18 @@ const tools = {
|
|||
},1000)
|
||||
}
|
||||
},
|
||||
zhuColorT(){//调用主色调
|
||||
console.log('tools');
|
||||
zhuColor()
|
||||
},
|
||||
networkStatus(){//检查网络状态
|
||||
uni.getNetworkType({
|
||||
success: function (res) {
|
||||
console.log('当前网络状态:',res.networkType);//none:当前无网络连接
|
||||
if(res.networkType=='none'){
|
||||
uni.showToast({
|
||||
title:'当前无网络连接',
|
||||
icon:'loading'
|
||||
})
|
||||
uni.setStorageSync('isNet',false)
|
||||
} else {
|
||||
uni.setStorageSync('isNet',true)
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -253,6 +256,74 @@ const tools = {
|
|||
console.log = () =>{}
|
||||
}
|
||||
// #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()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
10
pages.json
10
pages.json
|
@ -3,14 +3,14 @@
|
|||
{
|
||||
"path" : "pages/tabbar/pagehome/pagehome",
|
||||
"style" :{}
|
||||
},{
|
||||
"path" : "pages/tabbar/my/my",
|
||||
"style" :{}
|
||||
},{
|
||||
"path" : "pages/login/login",
|
||||
"style" :{
|
||||
"navigationBarTextStyle":"black" //状态栏字体颜色
|
||||
}
|
||||
},{
|
||||
"path" : "pages/tabbar/my/my",
|
||||
"style" :{}
|
||||
},
|
||||
{
|
||||
"path" : "pages/tabbar/shop/shop",
|
||||
|
@ -105,6 +105,10 @@
|
|||
{
|
||||
"path":"video/playVideo",
|
||||
"style":{}
|
||||
},
|
||||
{
|
||||
"path":"customer/customer",
|
||||
"style":{}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<template>
|
||||
<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'>
|
||||
<image class="infoImg" :style="{boxShadow: '0px 0px 20px '+ publicColor}" mode="aspectFit" :src="userInfo.avatarUrl || imgSrc"></image>
|
||||
<view class="logo-name">恒美植发</view>
|
||||
|
@ -52,7 +52,7 @@
|
|||
},
|
||||
methods: {
|
||||
goInfo(){
|
||||
uni.setStorageSync('uinfo',this.infoObj)
|
||||
uni.setStorageSync('firstInfo',this.infoObj)
|
||||
uni.navigateTo({
|
||||
url:'/pagesA/nodifyData/nodifyData?whereNum=2'
|
||||
})
|
||||
|
@ -81,7 +81,7 @@
|
|||
lang: 'zh_CN',
|
||||
success: (res) => {
|
||||
ya.userInfo = res.userInfo;
|
||||
console.log('可用用户信息:',ya.userInfo);
|
||||
// console.log('可用用户信息:',ya.userInfo);
|
||||
try {
|
||||
ya.login();
|
||||
} catch (e) {}
|
||||
|
@ -126,7 +126,8 @@
|
|||
language:ya.userInfo.language,//语言
|
||||
invite_code:ya.invite_code,//用户邀请码
|
||||
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 => {
|
||||
// console.log(res);
|
||||
|
@ -139,21 +140,17 @@
|
|||
city: ya.userInfo.city,//用户所在城市
|
||||
language:ya.userInfo.language,//语言
|
||||
}
|
||||
uni.setStorageSync('params',params)
|
||||
uni.setStorageSync('comeOn',comeOn)
|
||||
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.$requst.post('user/info').then(res=>{
|
||||
// console.log('用户信息:',res);
|
||||
if(res.code==0 && res.data.length!=0) {
|
||||
this.infoObj = res.data;
|
||||
}
|
||||
},error=>{})
|
||||
// ya.$toolAll.tools.showToast('登录成功','success')
|
||||
// setTimeout(()=>{
|
||||
// uni.reLaunch({
|
||||
// url:'/pages/tabbar/pagehome/pagehome'
|
||||
// })
|
||||
// },1000)
|
||||
this.infoObj = {
|
||||
headimgurl:ya.userInfo.avatarUrl,
|
||||
nickname:ya.userInfo.nickName,
|
||||
gender:ya.userInfo.gender
|
||||
}
|
||||
}
|
||||
},error => {})
|
||||
}
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
<!-- 热门推荐 -->
|
||||
<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">
|
||||
<cate-pu :newCurrent="newCurrent*1" :activeb="publicColor" @choosecateEv="chooseTwo" :newcateList="cateListTwo"></cate-pu>
|
||||
|
@ -53,7 +53,7 @@
|
|||
<script>
|
||||
import swiperPu from '@/components/swiper-pu.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 {
|
||||
components:{
|
||||
swiperPu,
|
||||
|
@ -73,33 +73,7 @@
|
|||
],
|
||||
showTop:false,//是否显示返回顶部
|
||||
tuList:[
|
||||
// {
|
||||
// title:'秃顶如何种植',
|
||||
// src:'',
|
||||
// list:[
|
||||
// {content:'秃顶种植需要的条件'},
|
||||
// {content:'秃顶种植的是什么'},
|
||||
// {content:'秃顶种植需要多少钱'},
|
||||
// {content:'那些人能种植'},
|
||||
// ]
|
||||
// },
|
||||
// {
|
||||
// title:'种植后如何保养',
|
||||
// src:'',
|
||||
// list:[
|
||||
// {content:'秃顶种植保养周期'},
|
||||
// {content:'秃顶种植保养手册'},
|
||||
// {content:'秃顶种植保养项目'},
|
||||
// {content:'那些人需要保养'},
|
||||
// ]
|
||||
// },
|
||||
// {
|
||||
// title:'种植事项',
|
||||
// src:'',
|
||||
// list:[
|
||||
// {content:'秃顶种植需要注意哪些事项?'},
|
||||
// ]
|
||||
// },
|
||||
|
||||
],
|
||||
newCurrent:0,
|
||||
cateW:'',//分类宽度
|
||||
|
@ -109,7 +83,8 @@
|
|||
total:'',//总数
|
||||
isZanw:true,
|
||||
category_id:'',//栏目ID
|
||||
disease_id:''//一级病种ID 可不填
|
||||
disease_id:'',//一级病种ID 可不填
|
||||
bannerList:[]
|
||||
}
|
||||
},
|
||||
onPageScroll(e) {
|
||||
|
@ -131,13 +106,34 @@
|
|||
t:new Date().getTime()//当前时间戳
|
||||
}
|
||||
this.$toolAll.tools.maiDian(maiOjb)
|
||||
|
||||
this.checkSwi()
|
||||
},
|
||||
onShow() {
|
||||
this.$toolAll.tools.isLogin()
|
||||
// console.log(this.category_id);
|
||||
if(this.category_id!='') this.checkCate(this.category_id)//调用左侧列表点击事件
|
||||
},
|
||||
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){//收藏事件
|
||||
// console.log(this.dataList[e].is_collected);
|
||||
if(this.dataList[e].is_collected==0){
|
||||
|
@ -245,6 +241,7 @@
|
|||
this.$requst.post('archives/disease-question',{disease_id:disease_id}).then(res=>{
|
||||
// console.log('一级病种列表内容:',res);
|
||||
if(res.code==0){
|
||||
this.tuList = []
|
||||
if(res.data.list.length!=0){
|
||||
res.data.list.forEach(item=>{
|
||||
let arr = []
|
||||
|
@ -279,7 +276,6 @@
|
|||
},
|
||||
chooseCate(index){//分类选中事件
|
||||
this.ccurrent = index
|
||||
this.tuList = []
|
||||
this.checkData(this.cateList[index].id)
|
||||
// console.log('分类选中:',index);
|
||||
},
|
||||
|
|
|
@ -9,14 +9,14 @@
|
|||
<view class="disjbac">
|
||||
<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="fon36 bold">{{userInfo.nickname || '未知'}}</view>
|
||||
<view class="disac mar-s10">
|
||||
<view class="fon36 bold">{{userInfo.nickname || ''}}</view>
|
||||
<view class="disac mar-s10" v-if="userInfo.mobile!==''">
|
||||
<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>
|
||||
|
@ -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="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 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>
|
||||
</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="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 class="disac fc" >
|
||||
<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">
|
||||
<image :src="itemy.src" style="width: 54rpx;height: 54rpx;" mode="aspectFill"></image>
|
||||
<view class="fon28 mar-s20 mar-x10">{{itemy.title}}</view>
|
||||
</view>
|
||||
|
@ -49,7 +51,7 @@
|
|||
</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 @tap="chooseItem(indexl)" class="disjbac pad-sx30 borbot" v-for="(iteml,indexl) in toolsList" :key="indexl">
|
||||
|
@ -65,12 +67,6 @@
|
|||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- 我的二维码弹框 -->
|
||||
<view v-if="isQrcode" class="posAll disjcac">
|
||||
<view>
|
||||
|
@ -87,12 +83,16 @@
|
|||
<foot-tab :titleList="titleList" :imgList="imgList" :newcurrent='4'></foot-tab>
|
||||
<!-- 弹框授权 -->
|
||||
<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>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {base64ToPath} from '@/jsFile/base64-src.js';
|
||||
import empower from '@/components/empower.vue';
|
||||
import {checkBanner} from '@/jsFile/publicAPI.js';
|
||||
export default {
|
||||
components:{empower},
|
||||
data() {
|
||||
|
@ -106,10 +106,11 @@
|
|||
{num:'0',title:'积分'},
|
||||
{num:'0',title:'我的分享'}
|
||||
],
|
||||
yuanList:[
|
||||
{src:'/static/public/keh.png',title:'客户列表'},
|
||||
{src:'/static/public/zu.png',title:'用户足迹'},
|
||||
{src:'/static/public/scan.png',title:'扫码签到'},
|
||||
yuanList:uni.getStorageSync('rules'), //'customer-list','footmarks','scan'
|
||||
zanCyuanList:[
|
||||
{src:'/static/public/keh.png',title:'客户列表',rule:'customer-list'},
|
||||
{src:'/static/public/zu.png',title:'用户足迹',rule:'footmarks'},
|
||||
{src:'/static/public/scan.png',title:'扫码签到',rule:'scan'},
|
||||
],
|
||||
toolsList:[
|
||||
{src:'/static/public/zyuy.png',title:'自助预约',num:''},
|
||||
|
@ -119,6 +120,7 @@
|
|||
{src:'/static/public/message.png',title:'消息通知',num:''},
|
||||
{src:'/static/public/ts.png',title:'投诉与建议',num:''},
|
||||
{src:'/static/public/aboutus.png',title:'关于我们',num:''},
|
||||
{src:'/static/public/aboutus.png',title:'客服二维码',num:''},
|
||||
],
|
||||
isQrcode:false,//是否显示我的二维码
|
||||
userInfo:{},//用户信息
|
||||
|
@ -129,23 +131,27 @@
|
|||
is_servicer:'',//是否为客服,0否,1是
|
||||
is_staff:'',//是否为普通员工,0否,1是
|
||||
titleList:[],
|
||||
imgList:[]
|
||||
imgList:[],
|
||||
isQian:false,
|
||||
bannerList:[],
|
||||
guangImg:'',
|
||||
isAuth:''
|
||||
}
|
||||
},
|
||||
onUnload: function() {
|
||||
//相当于监听返回按钮
|
||||
let pages = getCurrentPages();
|
||||
console.log('pages:',pages);
|
||||
// console.log('pages:',pages);
|
||||
},
|
||||
onShow() {
|
||||
uni.removeStorageSync('uinfo')//清空用户缓存信息
|
||||
this.$toolAll.tools.isLogin()
|
||||
this.checkInfo()
|
||||
uni.removeStorageSync('shareAll')//清空分享中心里的统计信息
|
||||
},
|
||||
onLoad() {
|
||||
this.titleList = uni.getStorageSync('footTitle')
|
||||
this.imgList = uni.getStorageSync('footimg')
|
||||
uni.setStorageSync('footimg',this.imgList)
|
||||
uni.removeStorageSync('shareAll')//清空分享中心里的统计信息
|
||||
if(uni.getStorageSync('gao')==''){
|
||||
const query = wx.createSelectorQuery()
|
||||
query.select('.gao').boundingClientRect((rect) => {
|
||||
|
@ -153,20 +159,32 @@
|
|||
this.gaoh = rect.height
|
||||
}).exec()
|
||||
}
|
||||
this.checkSwi()
|
||||
this.checkGM()
|
||||
// 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: {
|
||||
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){
|
||||
if(e==0) this.vision = false
|
||||
},
|
||||
|
@ -194,7 +212,17 @@
|
|||
this.is_doctor = res.data.is_doctor//是否为医生,0否,1是
|
||||
this.is_servicer = res.data.is_servicer//是否为客服,0否,1是
|
||||
this.is_staff = res.data.is_staff//是否为普通员工,0否,1是
|
||||
if(res.data.is_staff==0){
|
||||
this.toolsList.splice((this.toolsList.length-1),1)
|
||||
}
|
||||
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=>{})
|
||||
},
|
||||
|
@ -208,6 +236,7 @@
|
|||
if(index==4) newUrl = '/pagesB/messagecenter/messagecenter'
|
||||
if(index==5) newUrl = '/pagesA/suggestions/suggestions'
|
||||
if(index==6) newUrl = '/pagesB/aboutUs/aboutUs'
|
||||
if(index==7) newUrl = '/pagesB/customer/customer'
|
||||
uni.navigateTo({
|
||||
url:newUrl
|
||||
})
|
||||
|
@ -236,7 +265,10 @@
|
|||
this.$requst.post('user/sign-in',{user_coding:uc}).then(res=>{
|
||||
// console.log('执行扫码事件:',res);
|
||||
if(res.code==0){
|
||||
this.$toolAll.tools.showToast(res.msg)
|
||||
this.isQian = true
|
||||
setTimeout(()=>{
|
||||
this.isQian = false
|
||||
},2000)
|
||||
}
|
||||
},error=>{})
|
||||
}
|
||||
|
|
|
@ -5,65 +5,72 @@
|
|||
<view :style="{height:statusBarHeight+'px',background:publicColor}"></view>
|
||||
<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>
|
||||
<!-- <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">
|
||||
<image class="searchImg flexs" src="/static/public/search.png" mode="aspectFill"></image>
|
||||
<!-- 输入框 -->
|
||||
<input class="width100 fon28" type="text" v-model="searchVal" placeholder="请输入问题/病种/医生姓名"/>
|
||||
<!-- 竖线 -->
|
||||
<view class="linev"></view>
|
||||
<!-- 搜索 -->
|
||||
<view @tap="searchEv" class="searchT flexs" :style="{color:publicColor}">搜索</view>
|
||||
</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>
|
||||
<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">
|
||||
<image class="searchImg flexs" src="/static/public/search.png" mode="aspectFill"></image>
|
||||
<!-- 输入框 -->
|
||||
<input class="width100 fon28" type="text" v-model="searchVal" placeholder="请输入问题/病种/医生姓名"/>
|
||||
<!-- 竖线 -->
|
||||
<view class="linev"></view>
|
||||
<!-- 搜索 -->
|
||||
<view @tap="searchEv" class="searchT flexs" :style="{color:publicColor}">搜索</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 发问 -->
|
||||
<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 class="disjb fc width100">
|
||||
<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 class="mar-s10 pad-x180">
|
||||
<!-- 自定义轮播 -->
|
||||
<view :style="{marginTop: (statusHNH+60)+'px'}">
|
||||
<swiper-pu :bannerList="bannerList"></swiper-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 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 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 class="mar-zy30 mar-sx20 disjb">
|
||||
<image class="flexs mar-y20 radius30 fawen-img" @tap="tapChoose(0)" :src="gaoone.imgSrc" mode="aspectFill"></image>
|
||||
<view class="disjb fc width100">
|
||||
<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 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>
|
||||
<!-- 列表 -->
|
||||
<list-pu @chooseLike="chooseLike" @comfirmev="comfirmev" :list="dataList"></list-pu>
|
||||
</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 -->
|
||||
<foot-tab :titleList="titleList" :imgList="imgList"></foot-tab>
|
||||
<!-- 返回顶部 -->
|
||||
|
@ -73,7 +80,7 @@
|
|||
|
||||
<script>
|
||||
import swiperPu from '@/components/swiper-pu.vue';
|
||||
import {collectionEV,cancleCollectionEV} from '@/jsFile/publicAPI.js';
|
||||
import {collectionEV,cancleCollectionEV,checkBanner} from '@/jsFile/publicAPI.js';
|
||||
export default {
|
||||
components:{
|
||||
swiperPu
|
||||
|
@ -83,44 +90,15 @@
|
|||
statusBarHeight:uni.getSystemInfoSync().statusBarHeight,
|
||||
statusHNH:uni.getStorageSync('statusHNH'),
|
||||
searchVal:'',//输入框的值
|
||||
publicColor:uni.getStorageSync('publicColor'),//主题颜色
|
||||
publicColor:'',//主题颜色
|
||||
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:[//热搜关键词
|
||||
// {title:'植发需要多少钱'},
|
||||
// {title:'疤痕植发'},
|
||||
// {title:'眉毛种植'},
|
||||
// {title:'胡须种植'},
|
||||
// {title:'我为什么会脱发'},
|
||||
// {title:'头发如何保养'},
|
||||
],
|
||||
kcurrent:0,//默认选中第一项
|
||||
ktList:[//恒美小课堂
|
||||
// {title:'发际线'},
|
||||
// {title:'秃顶种植'},
|
||||
// {title:'胡须种植'},
|
||||
// {title:'眉毛种植'},
|
||||
// {title:'头发种植'},
|
||||
],
|
||||
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,
|
||||
newCurrent:0,
|
||||
|
@ -135,7 +113,12 @@
|
|||
imgList:[],//底部导航图标
|
||||
gaoone:{},
|
||||
gaotwo:{},
|
||||
gaothree:{}
|
||||
gaothree:{},
|
||||
isNet:true,
|
||||
wuNet:'当前无网络连接',
|
||||
refTime:'',
|
||||
reNum:0,
|
||||
bannerList:[]//轮播图
|
||||
}
|
||||
},
|
||||
onPageScroll(e) {
|
||||
|
@ -151,6 +134,8 @@
|
|||
}
|
||||
},
|
||||
onShow() {
|
||||
this.checkNet()
|
||||
this.$toolAll.tools.isLogin()
|
||||
let maiOjb = {
|
||||
e:6,//进入首页
|
||||
t:new Date().getTime()//当前时间戳
|
||||
|
@ -171,9 +156,63 @@
|
|||
this.checkKT()
|
||||
this.checkBCate()
|
||||
this.checkKey()
|
||||
this.checkSwi()//查询轮播图
|
||||
// this.checkBanner()//调用轮播图查询事件
|
||||
this.$toolAll.tools.buriedPointAll()//查询需要埋点的事件id
|
||||
},
|
||||
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){//宫格下的,三张图点击事件
|
||||
let newUrl = ''
|
||||
if(index==0) newUrl = this.gaoone.url
|
||||
|
@ -257,6 +296,8 @@
|
|||
url:res.data.ad[2].link,
|
||||
}
|
||||
}
|
||||
// this.publicColor = res.data.mainColor
|
||||
this.publicColor = uni.getStorageSync('publicColor')
|
||||
}
|
||||
}
|
||||
},error=>{})
|
||||
|
|
|
@ -18,6 +18,9 @@
|
|||
imgList:[]
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
this.$toolAll.tools.isLogin()
|
||||
},
|
||||
onLoad() {
|
||||
this.titleList = uni.getStorageSync('footTitle')
|
||||
this.imgList = uni.getStorageSync('footimg')
|
||||
|
|
|
@ -72,6 +72,7 @@
|
|||
}
|
||||
},
|
||||
onShow() {
|
||||
this.$toolAll.tools.isLogin()
|
||||
this.checkPoint()//调用自主预约列表事件
|
||||
this.$toolAll.tools.showToast('加载中...','loading')
|
||||
},
|
||||
|
|
|
@ -107,9 +107,15 @@
|
|||
newProvice:'',//当前省份
|
||||
newCity:'',//当前城市
|
||||
newDistrict:'',//当前区县
|
||||
whereCome:1
|
||||
whereCome:0
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
this.$toolAll.tools.isLogin()
|
||||
},
|
||||
onUnload() {
|
||||
uni.removeStorageSync('firstInfo')
|
||||
},
|
||||
onLoad(options) {
|
||||
if(options.whereNum==2){
|
||||
this.whereCome = options.whereNum
|
||||
|
@ -123,17 +129,24 @@
|
|||
this.getDistrict(res.latitude, res.longitude)
|
||||
},
|
||||
})
|
||||
let obj = uni.getStorageSync('uinfo')
|
||||
if(obj!='') this.uinfo = obj
|
||||
this.dataList[0].imgSrc = obj.headimgurl//用户头像
|
||||
this.dataList[1].content = obj.nickname//用户昵称
|
||||
this.dataList[2].content = obj.coding//恒美ID
|
||||
this.current = obj.gender//性别1男,2女,0未知
|
||||
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//省市区县
|
||||
|
||||
let firstObj = uni.getStorageSync('firstInfo')
|
||||
console.log('firstObj',firstObj);
|
||||
if(firstObj==''){
|
||||
let obj = uni.getStorageSync('uinfo')
|
||||
if(obj!='') this.uinfo = obj
|
||||
this.dataList[0].imgSrc = obj.headimgurl//用户头像
|
||||
this.dataList[1].content = obj.nickname//用户昵称
|
||||
this.dataList[2].content = obj.coding//恒美ID
|
||||
this.current = obj.gender//性别1男,2女,0未知
|
||||
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//性别1男,2女,0未知
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
updataInfo(){//修改资料事件
|
||||
|
|
|
@ -107,6 +107,9 @@
|
|||
btnCon:'立即提交'
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
this.$toolAll.tools.isLogin()
|
||||
},
|
||||
onLoad() {
|
||||
this.category = this.xialone[0]
|
||||
this.categoryT = this.xialTwo[0]
|
||||
|
|
|
@ -71,6 +71,9 @@
|
|||
btnCon:'立即提交'
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
this.$toolAll.tools.isLogin()
|
||||
},
|
||||
onLoad() {
|
||||
this.checkCate()
|
||||
},
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<view :style="{paddingTop: statusHNH+'px'}" class="pad-zy32">
|
||||
<!-- 自定义轮播 -->
|
||||
<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 class="mar-s50 pad-s10">
|
||||
|
@ -33,6 +33,7 @@
|
|||
|
||||
<script>
|
||||
import swiperPu from '@/components/swiper-pu.vue';
|
||||
import {checkBanner} from '@/jsFile/publicAPI.js';
|
||||
export default {
|
||||
components:{
|
||||
swiperPu
|
||||
|
@ -63,6 +64,7 @@
|
|||
size:10,
|
||||
total:'',//总数
|
||||
isZanw:true,
|
||||
bannerList:[]
|
||||
}
|
||||
},
|
||||
onPageScroll(e) {
|
||||
|
@ -77,10 +79,36 @@
|
|||
this.isZanw = false
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
this.$toolAll.tools.isLogin()
|
||||
},
|
||||
onLoad() {
|
||||
this.checkAbout(this.category_id)
|
||||
this.checkSwi()
|
||||
},
|
||||
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){
|
||||
let params = {
|
||||
category_id:category_id,
|
||||
|
|
|
@ -40,6 +40,9 @@
|
|||
isLoading:false
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
this.$toolAll.tools.isLogin()
|
||||
},
|
||||
onLoad(options) {
|
||||
this.checkDetail(options.id)
|
||||
},
|
||||
|
|
|
@ -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>
|
|
@ -79,6 +79,9 @@
|
|||
this.dataList.push(obj)
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
this.$toolAll.tools.isLogin()
|
||||
},
|
||||
onLoad() {
|
||||
this.category = this.xialone[0]
|
||||
},
|
||||
|
|
|
@ -23,7 +23,8 @@
|
|||
</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 v-if="keyword!=''" class="fon24 col3">您搜索的内容暂无结果,换个关键词试试吧</view>
|
||||
<view v-if="keyword==''" class="fon24 col3">暂无医生列表</view>
|
||||
</view>
|
||||
<!-- 返回顶部 -->
|
||||
<!-- <back-top :showTop="showTop" @backTop="backTop"></back-top> -->
|
||||
|
@ -68,6 +69,9 @@
|
|||
this.isZanw = false
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
this.$toolAll.tools.isLogin()
|
||||
},
|
||||
onLoad() {
|
||||
this.checkDor()
|
||||
},
|
||||
|
|
|
@ -67,7 +67,7 @@
|
|||
],
|
||||
showTop:false,
|
||||
newCurrent:0,
|
||||
category_id:'',//栏目ID
|
||||
category_id:0,//栏目ID
|
||||
moImg:'/static/public/logo.png',
|
||||
doctorObj:{},//医生详情
|
||||
page:1,
|
||||
|
@ -93,6 +93,9 @@
|
|||
this.isZanw = false
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
this.$toolAll.tools.isLogin()
|
||||
},
|
||||
onLoad(options) {
|
||||
this.checkDoD(options.doctor_id)
|
||||
this.checkConList(this.category_id)
|
||||
|
@ -119,7 +122,7 @@
|
|||
page:this.page,
|
||||
size:this.size
|
||||
}
|
||||
this.$requst.post('archives/collects',params).then(res=>{
|
||||
this.$requst.post('archives/hot',params).then(res=>{
|
||||
if(res.code==0){
|
||||
// 栏目类别
|
||||
if(uni.getStorageSync('cateList')==''){//首次渲染栏目
|
||||
|
@ -137,10 +140,12 @@
|
|||
this.cateList.push(cateObj)
|
||||
})
|
||||
uni.setStorageSync('cateList',this.cateList)
|
||||
this.category_id = this.cateList[0].id
|
||||
}
|
||||
} else {
|
||||
//获取缓存中的栏目
|
||||
this.cateList = uni.getStorageSync('cateList')
|
||||
this.category_id = this.cateList[0].id
|
||||
}
|
||||
// 获取列表
|
||||
if(this.page==1) this.dataList = []
|
||||
|
|
|
@ -72,6 +72,9 @@
|
|||
// this.dataList.push(obj)
|
||||
// }
|
||||
},
|
||||
onShow() {
|
||||
this.$toolAll.tools.isLogin()
|
||||
},
|
||||
onLoad() {
|
||||
this.checkMsg()
|
||||
},
|
||||
|
|
|
@ -59,6 +59,9 @@
|
|||
onUnload() {
|
||||
uni.removeStorageSync('cateList')
|
||||
},
|
||||
onShow() {
|
||||
this.$toolAll.tools.isLogin()
|
||||
},
|
||||
onLoad() {
|
||||
this.checkConList(this.category_id)
|
||||
const query = wx.createSelectorQuery()
|
||||
|
|
|
@ -75,6 +75,9 @@
|
|||
this.isZanw = false
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
this.$toolAll.tools.isLogin()
|
||||
},
|
||||
onLoad() {
|
||||
if(uni.getStorageSync('navHeight')==''){
|
||||
const query = wx.createSelectorQuery()
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
<image class="width100 radius20" :src="imgSrc" mode="widthFix" lazy-load></image>
|
||||
</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">
|
||||
<image src="/static/public/sharef.png" style="width: 54rpx;height: 54rpx;" mode=""></image>
|
||||
<view class="fon40 bold colf mar-z10">分享给好友</view>
|
||||
|
@ -36,12 +36,21 @@
|
|||
publicColor:uni.getStorageSync('publicColor'),//主题颜色
|
||||
isShowT:true,
|
||||
imgSrc:uni.getStorageSync('imgSrcP'),
|
||||
isHaib:false
|
||||
isHaib:false,
|
||||
showBtn:false
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
this.$toolAll.tools.isLogin()
|
||||
},
|
||||
onLoad() {
|
||||
//如果还没有生成海报
|
||||
this.imgSrc = uni.getStorageSync('imgSrcP')//弹框关闭
|
||||
if(this.imgSrc!='') {
|
||||
setTimeout(()=>{
|
||||
this.showBtn = true
|
||||
},500)
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
shareEv(){
|
||||
|
@ -60,6 +69,7 @@
|
|||
this.$toolAll.tools.showToast('生成海报成功')
|
||||
base64ToPath(this.imgSrc).then(path => {
|
||||
this.imgSrc = path
|
||||
this.showBtn = true
|
||||
uni.setStorageSync('imgSrcP',path)
|
||||
}).catch(error => {})
|
||||
}
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<!-- 列表 -->
|
||||
<view :style="{top: statusHNH+'px'}" class="posiszy" style="height: 50px;">
|
||||
<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 class="" :style="{paddingTop: (statusHNH+50)+'px'}" style="padding-bottom: 118rpx;">
|
||||
|
@ -161,7 +161,6 @@
|
|||
xgList:[//相关推荐
|
||||
],
|
||||
dataList:[//推荐医生
|
||||
// {imgSrc:'/static/public/doctor.png',name:'廖恒利医生',cyear:'16',bmen:'美容门诊部',zcheng:'主任医师',goodAt:'毛发种植'},
|
||||
],
|
||||
showTop:false,
|
||||
isDetailLike:false,//是否喜欢
|
||||
|
@ -170,18 +169,16 @@
|
|||
isNum:0,
|
||||
listArrone:[],//问题
|
||||
listArrtwo:[//案例日记
|
||||
// {status:false,main_img:'/static/public/main_four.png',title:'恒美小课堂',content:'饺子会吃肉?',head_img:'/static/public/like.png',name:'吃肉的饺子',isCate:1},
|
||||
],
|
||||
listArrthree:[//效果模拟
|
||||
// {status:false,main_img:'/static/public/main_two.png',title:'恒美小课堂',content:'饺子会吃肉?',head_img:'/static/public/like.png',name:'吃肉的饺子',isCate:2},
|
||||
],
|
||||
listArrfour:[//科普视频
|
||||
// {status:false,main_img:'/static/public/main_three.png',title:'恒美小课堂',content:'饺子会吃肉?',head_img:'/static/public/like.png',name:'吃肉的饺子',isCate:3},
|
||||
],
|
||||
detailObj:{},//详情
|
||||
detailInfo:'',//富文本
|
||||
category_id:'',//栏目ID
|
||||
active:'',//是否是详情页
|
||||
jieDuan:false
|
||||
}
|
||||
},
|
||||
onPageScroll(e) {
|
||||
|
@ -237,6 +234,9 @@
|
|||
};
|
||||
return shareObj;
|
||||
},
|
||||
onShow() {
|
||||
this.$toolAll.tools.isLogin()
|
||||
},
|
||||
onLoad(options) {
|
||||
if(options.category_id!=undefined) {
|
||||
this.category_id = options.category_id
|
||||
|
@ -249,7 +249,7 @@
|
|||
t:new Date().getTime()//当前时间戳
|
||||
}
|
||||
this.$toolAll.tools.maiDian(maiOjb)
|
||||
if(uni.getStorageSync('headImg')=='') this.haveImg = false
|
||||
if(uni.getStorageSync('is_active')==0) this.haveImg = false
|
||||
},
|
||||
methods: {
|
||||
chooseLike(e){//收藏事件
|
||||
|
@ -321,22 +321,18 @@
|
|||
url:'/pages/tabbar/pagehome/pagehome'
|
||||
})
|
||||
},
|
||||
lianK(){
|
||||
if(uni.getStorageSync('headImg')=='') {
|
||||
this.$toolAll.tools.showToast('您当前是游客,请授权登录')
|
||||
setTimeout(()=>{
|
||||
uni.navigateTo({
|
||||
url:'/pages/login/login'
|
||||
})
|
||||
},1500)
|
||||
} else {
|
||||
this.$toolAll.tools.closeTimer()//清空埋点倒计时
|
||||
this.$requst.post('user/record',{type:'other',action:'ask',id:0}).then(res=>{},error=>{})
|
||||
let maiOjb = {
|
||||
e:5,//内容咨询
|
||||
t:new Date().getTime()//当前时间戳
|
||||
}
|
||||
this.$toolAll.tools.maiDian(maiOjb)
|
||||
lianK(){//客服
|
||||
if(!this.jieDuan){
|
||||
let isAuth = this.$toolAll.tools.returnAuth()
|
||||
if(!isAuth){
|
||||
this.$toolAll.tools.closeTimer()//清空埋点倒计时
|
||||
this.$requst.post('user/record',{type:'other',action:'ask',id:0}).then(res=>{},error=>{})
|
||||
let maiOjb = {
|
||||
e:5,//内容咨询
|
||||
t:new Date().getTime()//当前时间戳
|
||||
}
|
||||
this.$toolAll.tools.maiDian(maiOjb)
|
||||
} else this.jieDuan = true
|
||||
}
|
||||
},
|
||||
buttonH(e){
|
||||
|
@ -346,14 +342,10 @@
|
|||
if(e==0) this.vision = false
|
||||
},
|
||||
shareEv(){
|
||||
if(uni.getStorageSync('headImg')=='') {
|
||||
this.$toolAll.tools.showToast('您当前是游客,请授权登录')
|
||||
setTimeout(()=>{
|
||||
uni.navigateTo({
|
||||
url:'/pages/login/login'
|
||||
})
|
||||
},1500)
|
||||
} else {this.haveImg=true}
|
||||
if(!this.jieDuan){
|
||||
let isAuth = this.$toolAll.tools.returnAuth()
|
||||
if(!isAuth){this.haveImg=true} else this.jieDuan = true
|
||||
}
|
||||
},
|
||||
checkDetail(newId){
|
||||
this.$requst.post('archives/detail',{id:newId}).then(res=>{
|
||||
|
@ -385,21 +377,9 @@
|
|||
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(',')
|
||||
arrImg.forEach(item=>{
|
||||
console.log(item);
|
||||
let newImgObj = {
|
||||
imgSrc:this.$http + item,
|
||||
url:'',
|
||||
|
@ -409,7 +389,15 @@
|
|||
// 存图片
|
||||
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==1) this.isDetailConllection = true
|
||||
|
@ -501,45 +489,37 @@
|
|||
},error=>{})
|
||||
},
|
||||
tapLike(){//喜欢、不喜欢事件
|
||||
if(uni.getStorageSync('headImg')=='') {
|
||||
this.$toolAll.tools.showToast('您当前是游客,请授权登录')
|
||||
setTimeout(()=>{
|
||||
uni.navigateTo({
|
||||
url:'/pages/login/login'
|
||||
})
|
||||
},1500)
|
||||
} else {
|
||||
this.isDetailLike = !this.isDetailLike
|
||||
if(this.isDetailLike){
|
||||
this.detailObj.likes++
|
||||
this.likeCon = this.detailObj.likes
|
||||
if(this.likeCon >= 1000) this.likeCon = '999+'
|
||||
}else{
|
||||
this.detailObj.likes--
|
||||
this.likeCon = '喜欢'
|
||||
}
|
||||
let isLikeCon = 'like'
|
||||
//调用点赞事件
|
||||
if(this.isDetailLike) collectionEV({action:isLikeCon,archive_id:this.detailObj.id})
|
||||
//调用取消点赞事件
|
||||
else cancleCollectionEV({action:isLikeCon,archive_id:this.detailObj.id})
|
||||
if(!this.jieDuan){
|
||||
let isAuth = this.$toolAll.tools.returnAuth()
|
||||
if(!isAuth){
|
||||
this.isDetailLike = !this.isDetailLike
|
||||
if(this.isDetailLike){
|
||||
this.detailObj.likes++
|
||||
this.likeCon = this.detailObj.likes
|
||||
if(this.likeCon >= 1000) this.likeCon = '999+'
|
||||
}else{
|
||||
this.detailObj.likes--
|
||||
this.likeCon = '喜欢'
|
||||
}
|
||||
let isLikeCon = 'like'
|
||||
//调用点赞事件
|
||||
if(this.isDetailLike) collectionEV({action:isLikeCon,archive_id:this.detailObj.id})
|
||||
//调用取消点赞事件
|
||||
else cancleCollectionEV({action:isLikeCon,archive_id:this.detailObj.id})
|
||||
} else this.jieDuan = true
|
||||
}
|
||||
},
|
||||
tapConllection(){//收藏、取消收藏事件
|
||||
let isLikeCon = 'collect'
|
||||
if(uni.getStorageSync('headImg')=='') {
|
||||
this.$toolAll.tools.showToast('您当前是游客,请授权登录')
|
||||
setTimeout(()=>{
|
||||
uni.navigateTo({
|
||||
url:'/pages/login/login'
|
||||
})
|
||||
},1500)
|
||||
} else {
|
||||
// 调用收藏事件
|
||||
if(!this.isDetailConllection) collectionEV({action:isLikeCon,archive_id:this.detailObj.id})
|
||||
// 调用取消收藏事件
|
||||
else cancleCollectionEV({action:isLikeCon,archive_id:this.detailObj.id})
|
||||
this.isDetailConllection = !this.isDetailConllection
|
||||
if(!this.jieDuan){
|
||||
let isAuth = this.$toolAll.tools.returnAuth()
|
||||
if(!isAuth){
|
||||
// 调用收藏事件
|
||||
if(!this.isDetailConllection) collectionEV({action:isLikeCon,archive_id:this.detailObj.id})
|
||||
// 调用取消收藏事件
|
||||
else cancleCollectionEV({action:isLikeCon,archive_id:this.detailObj.id})
|
||||
this.isDetailConllection = !this.isDetailConllection
|
||||
} else this.jieDuan = true
|
||||
}
|
||||
},
|
||||
backTop(){//回到顶部事件
|
||||
|
|
|
@ -106,6 +106,7 @@
|
|||
this.checkSearchHistory()
|
||||
},
|
||||
onShow() {
|
||||
this.$toolAll.tools.isLogin()
|
||||
if(this.searchVal!=undefined && this.searchVal!='') this.searchEv()
|
||||
},
|
||||
methods: {
|
||||
|
|
|
@ -72,6 +72,9 @@
|
|||
};
|
||||
return shareObj;
|
||||
},
|
||||
onShow() {
|
||||
this.$toolAll.tools.isLogin()
|
||||
},
|
||||
onLoad() {
|
||||
uni.getStorageSync('shareAll')!='' ? this.dataList[1].num = uni.getStorageSync('shareAll').share_users.total : this.dataList[1].num = 0
|
||||
},
|
||||
|
|
|
@ -8,23 +8,27 @@
|
|||
<view class="radius20 fon28 col3 mar-sx20">
|
||||
<view class="disac">
|
||||
<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 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 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 class="mar-s20">
|
||||
<text class="bold col3">{{item.name}}</text>
|
||||
<text style="color: #B3B3B3;">查看了</text>
|
||||
<text class="bold col3">【{{item.title}}】</text>
|
||||
<text style="color: #B3B3B3;">{{item.zwhat}}</text>
|
||||
<text style="color: #B3B3B3;">{{item.action}}</text>
|
||||
<text class="bold col3" v-if="item.title!=null && item.title!=''">【{{item.title}}】</text>
|
||||
<text style="color: #B3B3B3;" v-if="item.zwhat!=null && item.zwhat!=''">{{item.zwhat}}</text>
|
||||
</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>
|
||||
</template>
|
||||
|
@ -35,34 +39,80 @@
|
|||
return {
|
||||
statusHNH:uni.getStorageSync('statusHNH'),
|
||||
publicColor:uni.getStorageSync('publicColor'),//主题颜色
|
||||
dataList:[
|
||||
{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:'日记'},
|
||||
{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:'案例'},
|
||||
{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:'案例'},
|
||||
{name:'恒美小姐姐',title:'秃顶如何治疗',time:'2021-07-15 20:26:16',zwhat:'案例'},
|
||||
],
|
||||
showTop:false,
|
||||
dataList:[],//数据列表
|
||||
showTop:false,//是否显示返回顶部的箭头
|
||||
customer_id:'',//客户ID
|
||||
keyword:'',//关键词
|
||||
page:1,
|
||||
size:10,
|
||||
total:'',//总数
|
||||
isZanw:true
|
||||
}
|
||||
},
|
||||
onPageScroll(e) {
|
||||
e.scrollTop > 360 ? this.showTop = true : this.showTop = false
|
||||
},
|
||||
onReachBottom() {//触底事件
|
||||
for (let i = 0; i < 4; i++) {
|
||||
let obj = {name:'恒美小姐姐',title:'秃顶如何治疗',time:'2021-07-15 20:26:16',zwhat:'案例'}
|
||||
this.dataList.push(obj)
|
||||
if(this.total!=this.dataList.length){
|
||||
this.page++
|
||||
this.checkList()
|
||||
} else {
|
||||
if(this.isZanw) this.$toolAll.tools.showToast('暂无更多足迹内容')
|
||||
this.isZanw = false
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
this.$toolAll.tools.isLogin()
|
||||
},
|
||||
onLoad() {
|
||||
|
||||
this.checkList()
|
||||
},
|
||||
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(){//回到顶部事件
|
||||
uni.pageScrollTo({
|
||||
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.
Loading…
Reference in New Issue