Commit 5c3d38ea authored by 肖健's avatar 肖健

添加广告

parent 1fea7c1c
...@@ -22,11 +22,22 @@ ...@@ -22,11 +22,22 @@
</view> </view>
</view> </view>
</view> </view>
<view v-if="carouselFlag" style="width: 700rpx;margin: 0 auto;position: relative;">
<u-swiper radius="12rpx" :height="120" :list="list5" circular @change="e => current = e.current"
:autoplay="true" keyName="imageUrl" @click="goOtherLink">
</u-swiper>
<view style="position: absolute;right: 10rpx; top:10rpx;z-index: 99999;">
<u--image src="/static/my/close.png" width="12px" height="12px" @click="closeCarouselFlag"></u--image>
</view>
</view>
</view> </view>
</view> </view>
</template> </template>
<script> <script>
import util from '@/pages/login/util.js'
export default { export default {
data() { data() {
return { return {
...@@ -51,9 +62,59 @@ ...@@ -51,9 +62,59 @@
}, },
], ],
scanClick: true, //扫一扫节流 scanClick: true, //扫一扫节流
list5: [],
current: 0,
carouselFlag:false,
} }
}, },
methods: { methods: {
closeCarouselFlag() {
this.carouselFlag = false
},
getRotationList() {
let opts = {
url: '/app/index/carouse/3',
method: 'get'
};
this.http.httpTokenRequest(opts, {}).then(res => {
if (res.data.code == 200) {
let data = []
data = res.data.data
let imgList = []
data.forEach(e => {
imgList.push(e)
})
this.list5 = imgList
this.carouselFlag = true
}
})
},
// 轮播跳转其他页面
goOtherLink(index) {
let item = this.list5[index]
let link = item.link;
if(link) {
if (item.remark == 'jdh5') {
// uni.navigateTo({
// url: '/pages/webview/webview?url=' + link
// })
let url;
let token = uni.getStorageSync('userToken');
if (!token) {
uni.setStorageSync('jdNavto',1)
uni.navigateTo({
url: '/pages/login/index/index'
})
return;
}
util.navigateToH5({page:link})
return
}
uni.navigateTo({
url: link
})
}
},
goUrl(vo) { goUrl(vo) {
uni.removeStorageSync('routerLogin') uni.removeStorageSync('routerLogin')
uni.setStorageSync('routerLogin',vo.url) uni.setStorageSync('routerLogin',vo.url)
...@@ -142,6 +203,8 @@ ...@@ -142,6 +203,8 @@
setTimeout(() => { setTimeout(() => {
this.show = true this.show = true
}, 100); }, 100);
this.getRotationList()
}, },
}; };
</script> </script>
......
...@@ -54,14 +54,26 @@ ...@@ -54,14 +54,26 @@
</view> </view>
</view> </view>
<view class="ps__btn" v-if="token" @click="loginOut">退出登录</view> <view class="ps__btn" v-if="token" @click="loginOut">退出登录</view>
<u-gap bgColor="transparent" v-if="carouselFlag" height="20"></u-gap>
<view v-if="carouselFlag" style="width: 700rpx;margin: 0 auto;position: relative;">
<u-swiper radius="12rpx" :height="120" :list="list5" circular @change="e => current = e.current"
:autoplay="true" keyName="imageUrl" @click="goOtherLink">
</u-swiper>
<view style="position: absolute;right: 10rpx; top:10rpx;z-index: 99999;">
<u--image src="/static/my/close.png" width="12px" height="12px" @click="closeCarouselFlag"></u--image>
</view>
</view>
</view> </view>
<u-gap bgColor="transparent" height="70"></u-gap> <u-gap bgColor="transparent" height="70"></u-gap>
</view> </view>
</template> </template>
<script> <script>
import util from '@/pages/login/util.js'
let plugin = requirePlugin('loginPlugin'); let plugin = requirePlugin('loginPlugin');
export default { export default {
data() { data() {
return { return {
show:false, show:false,
...@@ -122,10 +134,60 @@ export default { ...@@ -122,10 +134,60 @@ export default {
userInfo: null, userInfo: null,
//头像 //头像
avatar: '', avatar: '',
token:null token:null,
list5: [],
current: 0,
carouselFlag:false,
} }
}, },
methods: { methods: {
closeCarouselFlag() {
this.carouselFlag = false
},
getRotationList() {
let opts = {
url: '/app/index/carouse/4',
method: 'get'
};
this.http.httpTokenRequest(opts, {}).then(res => {
if (res.data.code == 200) {
let data = []
data = res.data.data
let imgList = []
data.forEach(e => {
imgList.push(e)
})
this.list5 = imgList
this.carouselFlag = true
}
})
},
// 轮播跳转其他页面
goOtherLink(index) {
let item = this.list5[index]
let link = item.link;
if(link) {
if (item.remark == 'jdh5') {
// uni.navigateTo({
// url: '/pages/webview/webview?url=' + link
// })
let url;
let token = uni.getStorageSync('userToken');
if (!token) {
uni.setStorageSync('jdNavto',1)
uni.navigateTo({
url: '/pages/login/index/index'
})
return;
}
util.navigateToH5({page:link})
return
}
uni.navigateTo({
url: link
})
}
},
loginOut() { loginOut() {
this.$http.request({ this.$http.request({
url:'/logout', url:'/logout',
...@@ -336,6 +398,7 @@ export default { ...@@ -336,6 +398,7 @@ export default {
if(this.token){ if(this.token){
this.getUserInfo() this.getUserInfo()
} }
this.getRotationList()
}, },
onReady: function () { onReady: function () {
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment