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
@ -8,4 +8,12 @@ export function visitorCarouselRq() {
|
|||||||
url: '/api/visitor/carousel',
|
url: '/api/visitor/carousel',
|
||||||
method: "get",
|
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"
|
} from "../../api/user/user.js"
|
||||||
|
|
||||||
import {
|
import {
|
||||||
visitorCarouselRq
|
getParkRq
|
||||||
} from "../../api/index/index.js"
|
} from "../../api/index/index.js"
|
||||||
|
|
||||||
|
|
||||||
@ -160,15 +160,7 @@ Page({
|
|||||||
|
|
||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
console.log('onLoad options', options);
|
console.log('onLoad options', options);
|
||||||
|
|
||||||
let _this = this;
|
let _this = this;
|
||||||
// 轮播图
|
|
||||||
visitorCarouselRq().then(res => {
|
|
||||||
console.log('visitorCarouselRq', res);
|
|
||||||
_this.setData({
|
|
||||||
bannerList: res.data
|
|
||||||
})
|
|
||||||
})
|
|
||||||
},
|
},
|
||||||
|
|
||||||
// 切换tabbar
|
// 切换tabbar
|
||||||
@ -219,6 +211,13 @@ Page({
|
|||||||
_this.setData({
|
_this.setData({
|
||||||
parkName: wx.getStorageSync('parkName')
|
parkName: wx.getStorageSync('parkName')
|
||||||
})
|
})
|
||||||
|
getParkRq(parkId).then(res=>{
|
||||||
|
console.log('getParkRq' , res);
|
||||||
|
let bannerList = res.bannerImages.map(item=>item.url)
|
||||||
|
_this.setData({
|
||||||
|
bannerList
|
||||||
|
})
|
||||||
|
})
|
||||||
} else {
|
} else {
|
||||||
wx.navigateTo({
|
wx.navigateTo({
|
||||||
url: '/pages/index/parkList/parkList',
|
url: '/pages/index/parkList/parkList',
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
<!-- 轮播图 -->
|
<!-- 轮播图 -->
|
||||||
<swiper class='swiper-box' indicator-dots autoplay interval="3000" duration="1000" circular='true'>
|
<swiper class='swiper-box' indicator-dots autoplay interval="3000" duration="1000" circular='true'>
|
||||||
<swiper-item wx:for="{{bannerList}}" wx:key="index">
|
<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-item>
|
||||||
</swiper>
|
</swiper>
|
||||||
</view>
|
</view>
|
||||||
|
@ -51,7 +51,7 @@
|
|||||||
"condition": false
|
"condition": false
|
||||||
},
|
},
|
||||||
"compileType": "miniprogram",
|
"compileType": "miniprogram",
|
||||||
"libVersion": "2.13.1",
|
"libVersion": "3.4.0",
|
||||||
"appid": "wx5582a07c1fbbcf06",
|
"appid": "wx5582a07c1fbbcf06",
|
||||||
"projectname": "SmartPark",
|
"projectname": "SmartPark",
|
||||||
"simulatorType": "wechat",
|
"simulatorType": "wechat",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user