mirror of
https://gitee.com/elegant_wings/dbd-meeting-wx-small.git
synced 2025-06-21 14:19:38 +08:00
描述:修改
This commit is contained in:
parent
17225a83a4
commit
fa4ee7faf1
11
miniprogram/api/index/index.js
Normal file
11
miniprogram/api/index/index.js
Normal file
@ -0,0 +1,11 @@
|
||||
import {
|
||||
request
|
||||
} from '../selfRequest';
|
||||
|
||||
// 轮播图
|
||||
export function visitorCarouselRq() {
|
||||
return request({
|
||||
url: '/api/visitor/carousel',
|
||||
method: "get",
|
||||
});
|
||||
}
|
@ -10,6 +10,10 @@ import {
|
||||
userProfile
|
||||
} from "../../api/user/user.js"
|
||||
|
||||
import {
|
||||
visitorCarouselRq
|
||||
} from "../../api/index/index.js"
|
||||
|
||||
|
||||
Page({
|
||||
data: {
|
||||
@ -148,19 +152,21 @@ Page({
|
||||
},
|
||||
|
||||
],
|
||||
bannerList: [{
|
||||
bg: '/profile/static/index/banner/1.jpg',
|
||||
url: ''
|
||||
}, {
|
||||
bg: '/profile/static/index/banner/2.jpg',
|
||||
url: ''
|
||||
}, {
|
||||
bg: '/profile/static/index/banner/3.jpg',
|
||||
url: ''
|
||||
}],
|
||||
bannerList: [],
|
||||
userDetail: {},
|
||||
},
|
||||
|
||||
onLoad() {
|
||||
let _this = this;
|
||||
// 轮播图
|
||||
visitorCarouselRq().then(res => {
|
||||
console.log('visitorCarouselRq', res);
|
||||
_this.setData({
|
||||
bannerList: res.data
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
// 切换tabbar
|
||||
switchTab(e) {
|
||||
const data = e.currentTarget.dataset
|
||||
|
@ -16,7 +16,7 @@
|
||||
<!-- 轮播图 -->
|
||||
<swiper class='swiper-box' indicator-dots autoplay interval="3000" duration="1000" circular='true'>
|
||||
<swiper-item wx:for="{{bannerList}}" wx:key="index">
|
||||
<image class="img" src="{{IMG_NAME + item.bg}}" mode="aspectFill"></image>
|
||||
<image class="img" src="{{IMG_NAME + item.bannerImg}}" mode="aspectFill"></image>
|
||||
</swiper-item>
|
||||
</swiper>
|
||||
</view>
|
||||
|
Loading…
x
Reference in New Issue
Block a user