diff --git a/App.vue b/App.vue index 887d98c..32394fb 100644 --- a/App.vue +++ b/App.vue @@ -16,6 +16,7 @@ setTimeout(()=>{ toolAll.tools.overdue()//查询是否第一次授权 },3000) + toolAll.tools.isVedio(); // checkSwip()//查询轮播图位置 }, onHide: function() { diff --git a/commons/hengmei.css b/commons/hengmei.css index 7e3f4ad..3c31d09 100644 --- a/commons/hengmei.css +++ b/commons/hengmei.css @@ -20,7 +20,7 @@ .list-box{width: 48.4%;} .list-like-box{top: 18rpx;right: 18rpx;z-index: 1;} .list-like-box>image{width: 69rpx;height: 69rpx;} -.list-cont-box{bottom: 10rpx;left: 0rpx;right: 0; padding-top: 100rpx; background:-webkit-linear-gradient(bottom,rgba(0,0,0,0.79),rgba(255,255,255,0));padding-left: 22rpx;padding-right: 22rpx;padding-bottom: 18rpx;border-bottom-left-radius: 30rpx;border-bottom-right-radius: 30rpx;} +.list-cont-box{bottom: 6rpx;left: 0rpx;right: 0; padding-top: 100rpx; background:-webkit-linear-gradient(bottom,rgba(0,0,0,0.79),rgba(255,255,255,0));padding-left: 22rpx;padding-right: 22rpx;padding-bottom: 18rpx;border-bottom-left-radius: 30rpx;border-bottom-right-radius: 30rpx;} .list-cont-box15{bottom: 10rpx;left: 0rpx;right: 0; padding-top: 100rpx; background:-webkit-linear-gradient(bottom,rgba(0,0,0,0.79),rgba(255,255,255,0));padding-left: 22rpx;padding-right: 22rpx;padding-bottom: 18rpx;border-bottom-left-radius: 15rpx;border-bottom-right-radius: 15rpx;} .list-headimg{width: 28rpx;height: 28rpx;margin-right: 6rpx;border-radius: 100%;} /* 分类 */ diff --git a/components/auth-phone.vue b/components/auth-phone.vue new file mode 100644 index 0000000..bd0bb26 --- /dev/null +++ b/components/auth-phone.vue @@ -0,0 +1,48 @@ + + + + + diff --git a/components/list-pu.vue b/components/list-pu.vue index 79f67bd..accfc61 100644 --- a/components/list-pu.vue +++ b/components/list-pu.vue @@ -16,7 +16,8 @@ {{item.title}} - 视频 + 视频 + {{item.content}} @@ -26,7 +27,7 @@ {{item.name}} - + @@ -44,7 +45,7 @@ {{item.title}} - 视频 + 视频 {{item.content}} @@ -55,7 +56,7 @@ {{item.name}} - + @@ -111,7 +112,7 @@ isShowT:false, pu_content:'是否需要取消收藏?', current:'-1', - jieDuan:false + isVedio:uni.getStorageSync('isVedio') }; }, methods:{ @@ -119,35 +120,23 @@ if(e==0) this.vision = false }, goDetail(index){//查看详情 - if(this.jieDuan==false){ - let isAuth = this.$toolAll.tools.returnAuth() - if(!isAuth){ - uni.navigateTo({ - // url:'/pagesB/problemDetail/problemDetail?isCate='+this.list[index].isCate - url:'/pagesB/problemDetail/problemDetail?id='+this.list[index].id+'&category_id='+this.list[index].category_id - }) - } else this.jieDuan = true - } + uni.navigateTo({ + url:'/pagesB/problemDetail/problemDetail?id='+this.list[index].id+'&category_id='+this.list[index].category_id + }) }, - chooseLike(index){//喜欢不喜欢事件 - // console.log('喜欢不喜欢:',index); - if(this.jieDuan==false){ - let isAuth = this.$toolAll.tools.returnAuth() - if(!isAuth){ - // this.$emit('chooseLike',this.list[index].id) - 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) - } - } else this.jieDuan = true + chooseLike(index){//喜欢事件 + // console.log('喜欢:',index); + 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) } }, comfirmev(){ diff --git a/components/swiper-pu.vue b/components/swiper-pu.vue index 050e7f1..2d5f4c5 100644 --- a/components/swiper-pu.vue +++ b/components/swiper-pu.vue @@ -5,7 +5,7 @@ - + @@ -64,6 +64,7 @@ bcurrent:0, isShowVideo:false, autoplay:false, + isVedio:uni.getStorageSync('isVedio') }; }, methods:{ @@ -73,12 +74,22 @@ if(this.browseP){ let imgList = [] this.bannerList.forEach(item=>{ - let nurl = '' - item.url=='' ? nurl = item.imgSrc : nurl = item.url - let obj = { - url:nurl, - type:item.isVideo?'video':'image', - poster:item.poster + let nurl = ''; + let obj = {} + if(this.isVedio) { + item.url=='' ? nurl = item.imgSrc : nurl = item.url + obj = { + url:nurl, + type:item.isVideo?'video':'image', + poster:item.poster + } + } else { + nurl = item.imgSrc + obj = { + url:nurl, + type:'image', + poster:item.poster + } } imgList.push(obj) }) diff --git a/jsFile/tools.js b/jsFile/tools.js index f23c4bf..e398574 100644 --- a/jsFile/tools.js +++ b/jsFile/tools.js @@ -6,13 +6,13 @@ const tools = { daoTime(){ let daoTime = uni.getStorageSync('daoTime') if(daoTime==''){//初次判断倒计时是否为空 - uni.setStorageSync('daoTime',600)//设置倒计时 + uni.setStorageSync('daoTime',60)//设置倒计时 daoTime = uni.getStorageSync('daoTime') this.timer = setInterval(()=>{ uni.setStorageSync('daoTime',daoTime--)//设置倒计时 // console.log('埋点倒计时初次:',daoTime); // console.log('埋点长度初次:',uni.getStorageSync('maiList').length); - if(uni.getStorageSync('daoTime')<=0 || uni.getStorageSync('maiList').length==20){ + if(uni.getStorageSync('daoTime')<=0 || uni.getStorageSync('maiList').length==5){ uni.removeStorageSync('daoTime')//清空倒计时 clearInterval(this.timer)//关闭倒计时 // console.log('上/报,埋点'); @@ -26,7 +26,7 @@ const tools = { uni.setStorageSync('daoTime',daoTime--)//设置倒计时 // console.log('埋点倒计时:',daoTime); // console.log('埋点长度:',uni.getStorageSync('maiList').length); - if(uni.getStorageSync('daoTime')<=0 || uni.getStorageSync('maiList').length==20){ + if(uni.getStorageSync('daoTime')<=0 || uni.getStorageSync('maiList').length==5){ uni.removeStorageSync('daoTime')//清空倒计时 clearInterval(this.timer)//关闭倒计时 // console.log('上报,埋点'); @@ -322,6 +322,28 @@ const tools = { if(uni.getStorageSync('is_active')!='' && uni.getStorageSync('is_active') !=0){ this.overdue() } + }, + isVedio(){//是否显示视频内容 + uni.request({ + url: `https://hm.hmzfyy.cn/api/index/base-config`, + method: 'get', + 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 => { + // console.log(res); + if(res.data.code==0){ + if(res.data.data.v==0) { + uni.setStorageSync('isVedio',false); + } else { + uni.setStorageSync('isVedio',true); + } + // console.log(uni.getStorageSync('isVedio/')); + } + } + }) } } diff --git a/main.js b/main.js index deb04d9..ec71eb2 100644 --- a/main.js +++ b/main.js @@ -16,7 +16,10 @@ import nothingPage from './components/nothing-page.vue'//引入无内容组件 Vue.component('nothing-page',nothingPage)//全局注册无内容组件 import publicCustomer from './components/public-customer.vue'//引入客服组件 Vue.component('public-customer',publicCustomer)//全局注册客服组件 - +import authPhone from './components/auth-phone.vue'//引入手机授权组件 +Vue.component('auth-phone',authPhone)//全局注册手机授权组件 +import empower from './components/empower.vue'//引入用户授权组件 +Vue.component('empower',empower)//全局注册用户授权组件 // 常用工具 diff --git a/pages/tabbar/cate/cate.vue b/pages/tabbar/cate/cate.vue index 59a5bda..11b13f3 100644 --- a/pages/tabbar/cate/cate.vue +++ b/pages/tabbar/cate/cate.vue @@ -47,6 +47,10 @@ + + + + @@ -85,7 +89,9 @@ bannerList:[], titleList:[], imgList:[], - isAutoPlay:false + isAutoPlay:false, + vision:false, + isShowP:false, } }, onPageScroll(e) { @@ -106,7 +112,13 @@ onUnload() { this.isAutoPlay = false; }, - onLoad() { + onLoad(options) { + if(uni.getStorageSync('is_active')!=1){this.vision = true;} + if(options.invite_code!='' && options.invite_code!=undefined){ + this.loginEv(options.invite_code); + } else if(options.source_code!='' && options.source_code!=undefined){ + this.loginEv('',options.source_code,options.channel); + } this.checkBZ()//调用病种列表事件 let maiOjb = { e:7,//进入分类 @@ -124,6 +136,34 @@ this.isAutoPlay = true; }, methods: { + loginEv(invite_code='',source='',channel=''){ + uni.login({ + provider: 'weixin', + success: (res)=> { + if (res.code) { + var params = { + code:res.code, + invite_code:invite_code,//用户邀请码 + source_code:source, + channel:channel + } + this.$requst.post('user/login',params).then(res => { + if(res.data.token!=''){ + if(res.data.is_active==0) { + this.vision = true; + } + } + },error => {}) + } + }, + }); + }, + buttonH(e){//授权成功 + if(e) { + this.vision = false; + this.isShowP = true; + } + }, checkSwi(){ checkBanner({position:'category-hot-banner'}).then(res=>{ if(res.code==0){ @@ -236,10 +276,11 @@ name:item.published_by || '恒美植发',//发布者昵称 isVideo:item.video.includes(".mp4")//是否是视频 } - if(this.newCurrent==0 && item.category_id==32) this.dataList.push(tObj) - if(this.newCurrent==1 && item.category_id==33) this.dataList.push(tObj) - if(this.newCurrent==2 && item.category_id==34) this.dataList.push(tObj) - if(this.newCurrent==3 && item.category_id==38) this.dataList.push(tObj) + this.dataList.push(tObj); + // if(this.newCurrent==0 && item.category_id==32) this.dataList.push(tObj) + // if(this.newCurrent==1 && item.category_id==33) this.dataList.push(tObj) + // if(this.newCurrent==2 && item.category_id==34) this.dataList.push(tObj) + // if(this.newCurrent==3 && item.category_id==38) this.dataList.push(tObj) }) } } diff --git a/pages/tabbar/my/my.vue b/pages/tabbar/my/my.vue index 97b01a2..7ace222 100644 --- a/pages/tabbar/my/my.vue +++ b/pages/tabbar/my/my.vue @@ -83,23 +83,22 @@ - - 签到成功 + + + + diff --git a/pagesB/searchPage/searchPage.vue b/pagesB/searchPage/searchPage.vue index 174c3a0..65da899 100644 --- a/pagesB/searchPage/searchPage.vue +++ b/pagesB/searchPage/searchPage.vue @@ -33,6 +33,10 @@ + + + + @@ -41,7 +45,7 @@ import {collectionEV,cancleCollectionEV} from '@/jsFile/publicAPI.js'; export default { components:{ - cateTu + cateTu, }, data() { return { @@ -80,7 +84,9 @@ size:10, total:'',//总数 isZanw:true, - category_id:''//栏目ID + category_id:'',//栏目ID + vision:false, + isShowP:false, } }, onPageScroll(e) { @@ -99,6 +105,12 @@ uni.removeStorageSync('cateList') }, onLoad(options) { + if(uni.getStorageSync('is_active')!=1){this.vision = true;} + if(options.invite_code!='' && options.invite_code!=undefined){ + this.loginEv(options.invite_code); + } else if(options.source_code!='' && options.source_code!=undefined){ + this.loginEv('',options.source_code,options.channel); + } if(options.keyWorld!=undefined && options.keyWorld!='') { this.searchVal = options.keyWorld this.searchEv() @@ -111,6 +123,34 @@ if(this.searchVal!=undefined && this.searchVal!='') this.searchEv() }, methods: { + loginEv(invite_code='',source='',channel=''){ + uni.login({ + provider: 'weixin', + success: (res)=> { + if (res.code) { + var params = { + code:res.code, + invite_code:invite_code,//用户邀请码 + source_code:source, + channel:channel + } + this.$requst.post('user/login',params).then(res => { + if(res.data.token!=''){ + if(res.data.is_active==0) { + this.vision = true; + } + } + },error => {}) + } + }, + }); + }, + buttonH(e){//授权成功 + if(e) { + this.vision = false + this.isShowP = true + } + }, checkKey(){//查询热搜关键词事件 this.$requst.get('index/hot-keywords').then(res=>{ // console.log('关键词列表:',res); @@ -186,7 +226,7 @@ this.cateList = uni.getStorageSync('cateList') } // 获取列表 - if(this.page==1) this.dataList = [] + if(this.page==1) this.dataList = []; this.total = res.data.list.total if(res.data.list.list.length!=0){ res.data.list.list.forEach(item=>{ @@ -206,10 +246,11 @@ name:item.published_by || '恒美植发',//发布者昵称 isVideo:item.video.includes(".mp4")//是否是视频 } - if(this.newCurrent==0 && item.category_id==32) this.dataList.push(tObj) - if(this.newCurrent==1 && item.category_id==33) this.dataList.push(tObj) - if(this.newCurrent==2 && item.category_id==34) this.dataList.push(tObj) - if(this.newCurrent==3 && item.category_id==38) this.dataList.push(tObj) + this.dataList.push(tObj); + // if(this.newCurrent==0 && item.category_id==32) this.dataList.push(tObj) + // if(this.newCurrent==1 && item.category_id==33) this.dataList.push(tObj) + // if(this.newCurrent==2 && item.category_id==34) this.dataList.push(tObj) + // if(this.newCurrent==3 && item.category_id==38) this.dataList.push(tObj) }) } let obj = { diff --git a/pagesB/sharingCenter/sharingCenter.vue b/pagesB/sharingCenter/sharingCenter.vue index c905dc6..6fd8c45 100644 --- a/pagesB/sharingCenter/sharingCenter.vue +++ b/pagesB/sharingCenter/sharingCenter.vue @@ -28,6 +28,10 @@ + + + + @@ -44,7 +48,9 @@ {num:'0',title:'分享人'}, {num:'0',title:'分享订单'}, ], - imgSrcP:uni.getStorageSync('imgSrcP') + imgSrcP:uni.getStorageSync('imgSrcP'), + vision:false, + isShowP:false, } }, onShareAppMessage(options) { @@ -77,10 +83,45 @@ onShow() { this.$toolAll.tools.isLogin() }, - onLoad() { + onLoad(options) { + if(uni.getStorageSync('is_active')!=1){this.vision = true;} + if(options.invite_code!='' && options.invite_code!=undefined){ + this.loginEv(options.invite_code); + } else if(options.source_code!='' && options.source_code!=undefined){ + this.loginEv('',options.source_code,options.channel); + } uni.getStorageSync('shareAll')!='' ? this.dataList[1].num = uni.getStorageSync('shareAll').share_users.total : this.dataList[1].num = 0 + }, methods: { + loginEv(invite_code='',source='',channel=''){ + uni.login({ + provider: 'weixin', + success: (res)=> { + if (res.code) { + var params = { + code:res.code, + invite_code:invite_code,//用户邀请码 + source_code:source, + channel:channel + } + this.$requst.post('user/login',params).then(res => { + if(res.data.token!=''){ + if(res.data.is_active==0) { + this.vision = true; + } + } + },error => {}) + } + }, + }); + }, + buttonH(e){//授权成功 + if(e) { + this.vision = false + this.isShowP = true + } + }, shareEv(){//分享事件 if(this.imgSrcP==''){ this.$toolAll.tools.showToast('请先前往个人海报申请海报') diff --git a/pagesB/userFootprint/userFootprint.vue b/pagesB/userFootprint/userFootprint.vue index d302be9..876630e 100644 --- a/pagesB/userFootprint/userFootprint.vue +++ b/pagesB/userFootprint/userFootprint.vue @@ -32,6 +32,10 @@ + + + + @@ -48,7 +52,9 @@ page:1, size:10, total:'',//总数 - isZanw:true + isZanw:true, + vision:false, + isShowP:false, } }, onPageScroll(e) { @@ -66,10 +72,44 @@ onShow() { this.$toolAll.tools.isLogin() }, - onLoad() { + onLoad(options) { + if(uni.getStorageSync('is_active')!=1){this.vision = true;} + if(options.invite_code!='' && options.invite_code!=undefined){ + this.loginEv(options.invite_code); + } else if(options.source_code!='' && options.source_code!=undefined){ + this.loginEv('',options.source_code,options.channel); + } this.checkList() }, methods: { + loginEv(invite_code='',source='',channel=''){ + uni.login({ + provider: 'weixin', + success: (res)=> { + if (res.code) { + var params = { + code:res.code, + invite_code:invite_code,//用户邀请码 + source_code:source, + channel:channel + } + this.$requst.post('user/login',params).then(res => { + if(res.data.token!=''){ + if(res.data.is_active==0) { + this.vision = true; + } + } + },error => {}) + } + }, + }); + }, + buttonH(e){//授权成功 + if(e) { + this.vision = false + this.isShowP = true + } + }, chooseId(id){ this.backTop() this.page = 1 diff --git a/static/public/back-home-02.png b/static/public/back-home-02.png new file mode 100644 index 0000000..5f56859 Binary files /dev/null and b/static/public/back-home-02.png differ