1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- <template>
- <view>
- <u-swiper v-if="homeTemplate&&homeTemplate.banner&&homeTemplate.banner.length>0" :list="homeTemplate.banner" keyName="path" easingFunction="easeOutCubic" height="120" indicator radius="10"
- @click="click"></u-swiper>
- </view>
- </template>
- <script>
- import {
- mapMutations,
- mapActions,
- mapState,
- mapGetters
- } from 'vuex';
- export default {
- name: "wike-ad",
- data() {
- return {};
- },
- computed: {
- ...mapGetters(['appInfo', 'homeTemplate'])
- },
- methods: {
- click(index) {
- var that = this,
- del = {};
- del = that.homeTemplate.banner[index];
- // console.log(del);
- if (del.link_type == 2) {
- // #ifdef MP-WEIXIN
- uni.navigateTo({
- url: '/pages/user/public/webview?url=' + escape(del.link_url)
- })
- // #endif
- // #ifdef H5
- window.location = del.link_url
- // #endif
- } else if (del.link_type == 1) {
- // console.log(del);
- uni.navigateTo({
- url: del.link_url,
- });
-
- } else if (del.link_type == 0) {
- uni.switchTab({
- url: del.link_url
- });
- } else if (del.link_type == 3) {
- uni.navigateToMiniProgram({
- appId: del.link_url,
- path: del.link_other,
- success(res) {}
- })
- }
- }
- }
- }
- </script>
- <style>
- </style>
|