mirror of
https://gitee.com/elegant_wings/dbd-meeting-wx-small.git
synced 2025-06-21 03:49:37 +08:00
描述:选择园区切换首页banner图
This commit is contained in:
parent
2391abad08
commit
93a7a9be24
@ -9,3 +9,11 @@ export function visitorCarouselRq() {
|
||||
method: "get",
|
||||
});
|
||||
}
|
||||
|
||||
// 根据园区查询轮播图
|
||||
export function getParkRq(id) {
|
||||
return request({
|
||||
url: '/api/admin/park/get/' + id,
|
||||
method: "get",
|
||||
});
|
||||
}
|
@ -12,7 +12,7 @@ import {
|
||||
} from "../../api/user/user.js"
|
||||
|
||||
import {
|
||||
visitorCarouselRq
|
||||
getParkRq
|
||||
} from "../../api/index/index.js"
|
||||
|
||||
|
||||
@ -160,15 +160,7 @@ Page({
|
||||
|
||||
onLoad(options) {
|
||||
console.log('onLoad options', options);
|
||||
|
||||
let _this = this;
|
||||
// 轮播图
|
||||
visitorCarouselRq().then(res => {
|
||||
console.log('visitorCarouselRq', res);
|
||||
_this.setData({
|
||||
bannerList: res.data
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
// 切换tabbar
|
||||
@ -219,6 +211,13 @@ Page({
|
||||
_this.setData({
|
||||
parkName: wx.getStorageSync('parkName')
|
||||
})
|
||||
getParkRq(parkId).then(res=>{
|
||||
console.log('getParkRq' , res);
|
||||
let bannerList = res.bannerImages.map(item=>item.url)
|
||||
_this.setData({
|
||||
bannerList
|
||||
})
|
||||
})
|
||||
} else {
|
||||
wx.navigateTo({
|
||||
url: '/pages/index/parkList/parkList',
|
||||
|
@ -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.bannerImg}}" mode="aspectFill"></image>
|
||||
<image class="img" src="{{IMG_NAME + item}}" mode="aspectFill"></image>
|
||||
</swiper-item>
|
||||
</swiper>
|
||||
</view>
|
||||
|
@ -51,7 +51,7 @@
|
||||
"condition": false
|
||||
},
|
||||
"compileType": "miniprogram",
|
||||
"libVersion": "2.13.1",
|
||||
"libVersion": "3.4.0",
|
||||
"appid": "wx5582a07c1fbbcf06",
|
||||
"projectname": "SmartPark",
|
||||
"simulatorType": "wechat",
|
||||
|
Loading…
x
Reference in New Issue
Block a user