From 2d2756dc0e61ed8cd38c2796daf5cacdfdd49bf2 Mon Sep 17 00:00:00 2001
From: jialh <1972868360@qq.com>
Date: 星期三, 20 八月 2025 18:46:54 +0800
Subject: [PATCH] 更新
---
components/index/index-ads.vue | 64 ++++++++++++++++++++++++--------
1 files changed, 48 insertions(+), 16 deletions(-)
diff --git a/components/index/index-ads.vue b/components/index/index-ads.vue
index a1c9535..209b0f6 100644
--- a/components/index/index-ads.vue
+++ b/components/index/index-ads.vue
@@ -3,9 +3,9 @@
<view class="home_swiper">
<swiper class="ad-swiper bg-white" indicator-dots="true" indicator-color="rgba(228,228,228,1)"
indicator-active-color="#FECA49" autoplay="true" interval="5000" duration="1000" circular="true">
- <block v-for="(item, index) in ad" :key="index" @click="_advertJump(item)">
- <swiper-item>
- <image style="height:100%;width: 100%" :src="item.url"></image>
+ <block v-for="(item, index) in ad" :key="index">
+ <swiper-item @click="_advertJump(item)">
+ <image style="height:100%;width: 100%" :src="item.ossUrl"></image>
</swiper-item>
</block>
</swiper>
@@ -21,43 +21,75 @@
loadActivites,
loadAdverts
} from '../../api/index/indexApi.js'
+ import {
+ advertsListApp
+ } from '@/api/user/userApi.js';
export default {
name: "indexAds",
data() {
return {
banner: [{
- url: this.imgUrl+'/h5/images/serve/banner1.jpg'
+ ossUrl: this.imgUrl + '/h5/images/serve/banner1.jpg'
},
{
- url: this.imgUrl+'/h5/images/serve/banner2.jpg'
+ ossUrl: this.imgUrl + '/h5/images/serve/banner2.jpg'
}
],
- ad:[],
+ ad: [],
};
},
created() {
+ console.log('==_loadAdvertPhoto==')
this._loadAdvertPhoto();
},
- methods:{
+ methods: {
+
+ // _loadAdvertPhoto: function() {
+ // let _that = this;
+ // let _objData = {
+ // page: 1,
+ // row: 5,
+ // locationTypeCd: '2000',
+ // viewType: '8888',
+ // clientType: 'H5'
+ // };
+ // //鏌ヨ 骞垮憡
+ // loadAdverts(_objData)
+ // .then(function(_aPhotos) {
+ // _that.ad = _aPhotos;
+ // if(!_aPhotos || _aPhotos.length <1){
+ // _that.ad = _that.banner;
+ // }
+ // });
+ // },
_loadAdvertPhoto: function() {
+ // console.log('==_loadAdvertPhoto==')
let _that = this;
let _objData = {
- page: 1,
- row: 5,
- locationTypeCd: '2000',
- viewType: '8888',
- clientType: 'H5'
+ position: '涓氫富灏忕▼搴忛椤佃疆鎾浘',
};
//鏌ヨ 骞垮憡
- loadAdverts(_objData)
+ advertsListApp(_objData)
.then(function(_aPhotos) {
- _that.ad = _aPhotos;
- if(!_aPhotos || _aPhotos.length <1){
+ _that.ad = _aPhotos.data;
+ console.log('==_that.ad==', _that.ad)
+ if (!_aPhotos || _that.ad.length < 1) {
_that.ad = _that.banner;
}
});
},
_advertJump: function(ad) {
+ if (!ad) return;
+ // 浼樺厛鍒ゆ柇鏄惁鏈夌洿鎺ョ殑澶栭儴閾炬帴
+ if (ad.url) {
+ let url = encodeURIComponent(ad.url)
+ uni.navigateTo({
+ url: '/pages/fee/webview?url=' + url
+ })
+ return;
+ }
+
+
if (ad.advertType == 3 || !ad.pageUrl) {
return;
}
@@ -85,4 +117,4 @@
.home_swiper {
margin-bottom: 20upx;
}
-</style>
+</style>
\ No newline at end of file
--
Gitblit v1.8.0