轮播修改
parent
4978f9ed95
commit
19856feb31
|
@ -1,7 +1,7 @@
|
|||
<template>
|
||||
<view>
|
||||
<view v-if="isDot" class="banner-box">
|
||||
<swiper :current="bcurrent" @change="changeBanner" :style="{height: newHeight+'px'}" :autoplay="true" :circular="true" :interval="3000" :duration="500">
|
||||
<swiper :current="bcurrent" @change="changeBanner" :style="{height: newHeight+'px'}" :isplay="autoplay" :circular="true" :interval="3000" :duration="500">
|
||||
<swiper-item v-for="(item,index) in bannerList" :key="index">
|
||||
<view @tap="chooseImg(index)" class="posir">
|
||||
<image :style="{borderRadius:newRadius+'px',height:newHeight+'px'}" class="img" :src="item.imgSrc" mode="aspectFill"></image>
|
||||
|
@ -21,6 +21,10 @@
|
|||
export default {
|
||||
name:"swiper-pu",
|
||||
props:{
|
||||
isplay:{
|
||||
type:Boolean,
|
||||
default:false
|
||||
},
|
||||
isDot:{//是否显示指示点
|
||||
type:Boolean,
|
||||
default:true
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
<!-- 热门推荐 -->
|
||||
<template v-if="ccurrent==0">
|
||||
<!-- 自定义轮播 -->
|
||||
<swiper-pu :bannerList="bannerList" :newHeight="'154'" :newRadius="'10'" :newBottom="'10'"></swiper-pu>
|
||||
<swiper-pu :bannerList="bannerList" :isplay="isAutoPlay" :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>
|
||||
|
@ -85,6 +85,7 @@
|
|||
bannerList:[],
|
||||
titleList:[],
|
||||
imgList:[],
|
||||
isAutoPlay:false
|
||||
}
|
||||
},
|
||||
onPageScroll(e) {
|
||||
|
@ -99,6 +100,12 @@
|
|||
this.isZanw = false
|
||||
}
|
||||
},
|
||||
onHide() {
|
||||
this.isAutoPlay = false;
|
||||
},
|
||||
onUnload() {
|
||||
this.isAutoPlay = false;
|
||||
},
|
||||
onLoad() {
|
||||
this.checkBZ()//调用病种列表事件
|
||||
let maiOjb = {
|
||||
|
@ -114,6 +121,7 @@
|
|||
this.$toolAll.tools.isLogin()
|
||||
// console.log(this.category_id);
|
||||
if(this.category_id!='') this.checkCate(this.category_id)//调用左侧列表点击事件
|
||||
this.isAutoPlay = true;
|
||||
},
|
||||
methods: {
|
||||
checkSwi(){
|
||||
|
|
|
@ -25,21 +25,7 @@
|
|||
<view class="pad-x180">
|
||||
<!-- 自定义轮播 -->
|
||||
<view :style="{marginTop: (statusHNH+60)+'px'}">
|
||||
<!-- <swiper-pu :bannerList="bannerList"></swiper-pu> -->
|
||||
<view class="banner-box">
|
||||
<swiper :current="bcurrent" @change="changeBanner" :style="{height: 200+'px'}" :autoplay="isAutoPlay" :circular="true" :interval="3000" :duration="500">
|
||||
<swiper-item v-for="(item,index) in bannerList" :key="index">
|
||||
<view @tap="chooseImg(index)" class="posir">
|
||||
<image :style="{borderRadius:0+'px',height:200+'px'}" class="img" :src="item.imgSrc" mode="aspectFill"></image>
|
||||
<image @tap.stop="playVideo(index)" v-if="item.isVideo" class="posia" style="top: 50%;left: 50%;transform: translate(-50%,-50%);width: 126rpx;height: 126rpx;z-index: 1;" src="/static/public/video.png" mode=""></image>
|
||||
</view>
|
||||
</swiper-item>
|
||||
</swiper>
|
||||
<!-- 指示点 -->
|
||||
<view class="dot-box" :style="{bottom:18+'px'}">
|
||||
<view :class="bcurrent==indexd ? 'dotActive' : 'dotMo'" v-for="(itemd,indexd) in bannerList.length" :key="indexd"></view>
|
||||
</view>
|
||||
</view>
|
||||
<swiper-pu :bannerList="bannerList" :isplay="isAutoPlay"></swiper-pu>
|
||||
</view>
|
||||
<!-- 宫格 -->
|
||||
<view v-if="gonggList.length>1" class="mar-zy30 bacf radius10 pad-s25 mar-s10 disac fw">
|
||||
|
@ -147,7 +133,6 @@
|
|||
jieDuan:false,
|
||||
isNewRenderDone:false ,//锁的作用
|
||||
isQuan:true,
|
||||
bcurrent:0,
|
||||
isAutoPlay:false
|
||||
}
|
||||
},
|
||||
|
@ -166,6 +151,9 @@
|
|||
onHide() {
|
||||
this.isAutoPlay = false;
|
||||
},
|
||||
onUnload() {
|
||||
this.isAutoPlay = false;
|
||||
},
|
||||
onShow() {
|
||||
log('输出的解构')
|
||||
this.checkNet()
|
||||
|
@ -183,47 +171,55 @@
|
|||
this.checkKT()//恒美课堂列表
|
||||
this.isAutoPlay = true;
|
||||
},
|
||||
onShareAppMessage(res) {},
|
||||
onShareAppMessage(res) {
|
||||
var ya = this;
|
||||
let maiOjb = {
|
||||
e:6,//内容分享
|
||||
c:this.detailObj.id*1,
|
||||
t:new Date().getTime()//当前时间戳
|
||||
}
|
||||
this.$toolAll.tools.maiDian(maiOjb)
|
||||
var shareObj = {
|
||||
title: '成都恒美毛发', // 默认是小程序的名称(可以写slogan等)
|
||||
path: `/pages/tabbar/pagehome/pagehome?invite_code=${uni.getStorageSync('invite_code')}` // 默认是当前页面,必须是以‘/’开头的完整路径
|
||||
};
|
||||
return shareObj;
|
||||
},
|
||||
onLoad(options) {
|
||||
// 模拟首次加载列表数据
|
||||
// setTimeout(()=>{
|
||||
// // this.list = list;
|
||||
// this.$refs.wfalls.init();
|
||||
// },1000)
|
||||
if (options && options.q) {
|
||||
let arr = decodeURIComponent(options.q).split('?')[1].split('&')
|
||||
let obj = {}
|
||||
arr.forEach(item => {
|
||||
let brr = item.split('=')
|
||||
obj[brr[0]] = brr[1]
|
||||
})
|
||||
console.log(obj);
|
||||
uni.login({
|
||||
provider: 'weixin',
|
||||
success: (res)=> {
|
||||
var params = ''
|
||||
if(obj.channel!='' && obj.channel!=undefined){
|
||||
params = {
|
||||
code:res.code,
|
||||
channel:obj.channel,
|
||||
source_code:obj.source_code
|
||||
}
|
||||
}
|
||||
if(obj.invite_code!='' && obj.invite_code!=undefined){
|
||||
params = {
|
||||
code:res.code,
|
||||
invite_code:obj.invite_code,//用户邀请码
|
||||
}
|
||||
if (options.invite_code!=undefined) {
|
||||
uni.login({
|
||||
provider: 'weixin',
|
||||
success: (res)=> {
|
||||
var params = {
|
||||
code:res.code,
|
||||
invite_code:options.invite_code,//用户邀请码
|
||||
}
|
||||
this.$requst.post('user/login',params).then(res => {console.log('调用成功');},error => {})
|
||||
},
|
||||
});
|
||||
}
|
||||
console.log(options.invite_code);
|
||||
if(options.invite_code!='' && options.invite_code!=undefined){
|
||||
uni.login({
|
||||
provider: 'weixin',
|
||||
success: (res)=> {
|
||||
if (res.code) {
|
||||
var params = {
|
||||
code:res.code,
|
||||
invite_code:options.invite_code,//用户邀请码
|
||||
}
|
||||
if(obj.coding!='' && obj.coding!=undefined){
|
||||
params = {service_coding:obj.coding}
|
||||
this.$requst.post('user/bind-service',params).then(res => {console.log('调用成功');},error => {})
|
||||
} else {
|
||||
this.$requst.post('user/login',params).then(res => {console.log('调用成功');},error => {})
|
||||
}
|
||||
},
|
||||
});
|
||||
}
|
||||
this.$requst.post('user/login',params).then(res => {
|
||||
if(res.data.token!=''){
|
||||
if(res.data.is_active==0) {
|
||||
this.haveImg = false
|
||||
this.vision = true
|
||||
}
|
||||
}
|
||||
},error => {})
|
||||
}
|
||||
},
|
||||
});
|
||||
}
|
||||
const query = wx.createSelectorQuery()
|
||||
query.select('.statusHNH').boundingClientRect((rect) => {
|
||||
// log('状态栏+标题栏:',rect.height);
|
||||
|
@ -247,15 +243,6 @@
|
|||
}
|
||||
})
|
||||
},
|
||||
changeBanner(e){
|
||||
this.bcurrent = e.detail.current//当前的指示点下标
|
||||
},
|
||||
playVideo(index){
|
||||
// console.log('播放视频');
|
||||
uni.navigateTo({
|
||||
url:`/pagesB/video/playVideo?src=${this.bannerList[index].url}&posterSrc=${this.bannerList[index].poster}`
|
||||
})
|
||||
},
|
||||
closeEv(){
|
||||
this.isQuan = false;
|
||||
},
|
||||
|
@ -545,9 +532,5 @@
|
|||
</script>
|
||||
|
||||
<style>
|
||||
.banner-box{position: relative;}
|
||||
.img{width:100%;}
|
||||
.dot-box{position: absolute;bottom: 36rpx;display: flex;justify-content: center;width: 100%;}
|
||||
.dotActive{width: 22rpx;height: 12rpx;margin-right: 10rpx;border-radius: 20rpx; background-color: rgba(56, 117, 246, 1);}
|
||||
.dotMo{width: 12rpx;height: 12rpx;margin-right: 10rpx;border-radius: 100%;background-color: rgba(191, 191, 191, 1);}
|
||||
|
||||
</style>
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<view :style="{paddingTop: statusHNH+'px'}" class="pad-zy32">
|
||||
<!-- 自定义轮播 -->
|
||||
<view class="mar-s20">
|
||||
<swiper-pu :bannerList="bannerList" :newHeight="'200'" :newRadius="'10'" :newBottom="'5'"></swiper-pu>
|
||||
<swiper-pu :bannerList="bannerList" :isplay="isAutoPlay" :newHeight="'200'" :newRadius="'10'" :newBottom="'5'"></swiper-pu>
|
||||
</view>
|
||||
<!-- 导航 -->
|
||||
<view class="mar-s50 pad-s10">
|
||||
|
@ -66,7 +66,8 @@
|
|||
size:10,
|
||||
total:'',//总数
|
||||
isZanw:true,
|
||||
bannerList:[]
|
||||
bannerList:[],
|
||||
isAutoPlay:false
|
||||
}
|
||||
},
|
||||
onPageScroll(e) {
|
||||
|
@ -82,7 +83,14 @@
|
|||
}
|
||||
},
|
||||
onShow() {
|
||||
this.$toolAll.tools.isLogin()
|
||||
this.$toolAll.tools.isLogin();
|
||||
this.isAutoPlay = true;
|
||||
},
|
||||
onHide() {
|
||||
this.isAutoPlay = false;
|
||||
},
|
||||
onUnload() {
|
||||
this.isAutoPlay = false;
|
||||
},
|
||||
onLoad() {
|
||||
this.checkAbout(this.category_id)
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
<view v-show="cateCurrent==isNum">
|
||||
<view class="pad-zy32">
|
||||
<!-- 自定义轮播 -->
|
||||
<swiper-pu :browseP="true" :bannerList="bannerList" :newHeight="'250'" :newRadius="'10'" :newBottom="'5'"></swiper-pu>
|
||||
<swiper-pu :browseP="true" :isplay="isAutoPlay" :bannerList="bannerList" :newHeight="'450'" :newRadius="'10'" :newBottom="'5'"></swiper-pu>
|
||||
<!-- 标题 -->
|
||||
<view class="fon36 col3 bold mar-sx20 clips2" style="line-height: 50rpx;">{{detailObj.title}}</view>
|
||||
<view class="disjbac">
|
||||
|
@ -197,7 +197,9 @@
|
|||
// jieDuan:false,
|
||||
share_id:0,
|
||||
invite_code:'',
|
||||
isShowP:false
|
||||
isShowP:false,
|
||||
bcurrent:0,
|
||||
isAutoPlay:false
|
||||
}
|
||||
},
|
||||
onPageScroll(e) {
|
||||
|
@ -241,6 +243,13 @@
|
|||
return shareObj;
|
||||
},
|
||||
onShow() {
|
||||
this.isAutoPlay = true;
|
||||
},
|
||||
onHide() {
|
||||
this.isAutoPlay = false;
|
||||
},
|
||||
onUnload() {
|
||||
this.isAutoPlay = false;
|
||||
},
|
||||
onLoad(options) {
|
||||
if(options.category_id!=undefined) {
|
||||
|
@ -597,4 +606,5 @@
|
|||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
</style>
|
||||
|
|
Loading…
Reference in New Issue