暂存我的页面修改

This commit is contained in:
2024-11-28 17:33:29 +08:00
parent 7bbe58a0d0
commit 520f44a25f
25 changed files with 469 additions and 26 deletions

View File

@@ -1,68 +0,0 @@
import { getBannerList } from "../../../../service/system"
import { alertInfo } from "../../../../utils/index";
import request from '../../../../utils/request'
const { OK } = request;
// pages/home/components/home-swiper/index.js
Component({
/**
* 组件的属性列表
*/
properties: {
park: String,
},
observers: {
'park': function(newValue) {
this.init(newValue)
}
},
/**
* 组件的初始数据
*/
data: {
indicatorDots: true,
vertical: false,
autoplay: false,
interval: 2000,
duration: 500,
list: [],
},
/**
* 组件的方法列表
*/
methods: {
async init(park) {
const { code, message, data = [] } = await getBannerList(park, 1);
if (code !== OK) {
alertInfo(message);
this.setData({ list: [] })
return
}
this.setData({ list: data })
},
handleJump(e) {
const { data = {} } = e.currentTarget.dataset;
switch(data.jumpType) {
case 1:
wx.navigateToMiniProgram({
appId: data.appId,
path: data.wxPath,
envVersion: "trial"
})
break;
case 2:
wx.navigateTo({
url: data.value,
})
break;
case 3:
wx.navigateTo({
url: '/pages/webPage/index?path=' + data.value,
})
break;
}
}
}
})

View File

@@ -1,6 +0,0 @@
{
"component": true,
"usingComponents": {
"van-image": "@vant/weapp/image/index"
}
}

View File

@@ -1,21 +0,0 @@
<!--pages/home/components/home-swiper/index.wxml-->
<swiper
indicator-dots="{{indicatorDots}}"
autoplay="{{autoplay}}"
interval="{{interval}}"
duration="{{duration}}"
wx:if="{{list.length}}"
>
<block wx:for="{{list}}" wx:key="{{item.id}}" wx:item="item">
<swiper-item>
<van-image
width="100%"
height="100%"
lazy-load
src="{{item.url}}"
data-data="{{item}}"
bind:click="handleJump"
/>
</swiper-item>
</block>
</swiper>

View File

@@ -1 +0,0 @@
/* pages/home/components/home-swiper/index.wxss */

View File

@@ -10,7 +10,7 @@
"van-grid": "@vant/weapp/grid/index",
"van-grid-item": "@vant/weapp/grid-item/index",
"van-action-sheet": "@vant/weapp/action-sheet/index",
"home-swiper": "./components/home-swiper/index"
"banner": "/components/banner/index"
},
"navigationStyle": "custom"
}

View File

@@ -33,7 +33,7 @@
<!-- <view class="welcome"> 欢迎使用华昌宝能用电管理系统! </view> -->
</view>
</view>
<home-swiper wx:if="{{park.id}}" park="{{park.id}}" />
<banner type="{{1}}" wx:if="{{park.id}}" park="{{park.id}}" />
<view class="rechargeWrapper">
<view class="card">
<view class="cardTop">