Browse Source

底部菜单栏

master
tianqian 2 years ago
parent
commit
6ef7fb3a52
  1. 6
      miniprogram/custom-tab-bar/index.js
  2. 9
      miniprogram/custom-tab-bar/index.wxml
  3. 25
      miniprogram/custom-tab-bar/index.wxss
  4. BIN
      miniprogram/images/main/home01.png
  5. BIN
      miniprogram/images/main/home02.png
  6. BIN
      miniprogram/images/main/home03.png
  7. BIN
      miniprogram/images/main/home04.png
  8. BIN
      miniprogram/images/main/home05.png
  9. BIN
      miniprogram/images/main/home06.png
  10. BIN
      miniprogram/images/main/home_top.png
  11. 30
      miniprogram/pages/home/components/banner/banner.js
  12. 3
      miniprogram/pages/home/components/banner/banner.json
  13. 28
      miniprogram/pages/home/components/banner/banner.wxml
  14. 77
      miniprogram/pages/home/components/banner/banner.wxss
  15. 13
      miniprogram/pages/home/components/newsList/newsList.js
  16. 3
      miniprogram/pages/home/components/newsList/newsList.json
  17. 24
      miniprogram/pages/home/components/newsList/newsList.wxml
  18. 69
      miniprogram/pages/home/components/newsList/newsList.wxss
  19. 17
      miniprogram/pages/home/components/notice/notice.js
  20. 3
      miniprogram/pages/home/components/notice/notice.json
  21. 16
      miniprogram/pages/home/components/notice/notice.wxml
  22. 49
      miniprogram/pages/home/components/notice/notice.wxss
  23. 23
      miniprogram/pages/home/components/project/project.js
  24. 3
      miniprogram/pages/home/components/project/project.json
  25. 41
      miniprogram/pages/home/components/project/project.wxml
  26. 142
      miniprogram/pages/home/components/project/project.wxss
  27. 280
      miniprogram/pages/home/components/sudoku/sudoku.js
  28. 3
      miniprogram/pages/home/components/sudoku/sudoku.json
  29. 24
      miniprogram/pages/home/components/sudoku/sudoku.wxml
  30. 87
      miniprogram/pages/home/components/sudoku/sudoku.wxss
  31. 9
      miniprogram/pages/home/home.json

6
miniprogram/custom-tab-bar/index.js

@ -2,12 +2,12 @@ const app = getApp()
Component({
data: {
selected: 0,
color: "#7A7E83",
selectedColor: "#3cc51f",
color: "#999",
selectedColor: "#F13A47",
"list": [
{
"pagePath": "/pages/home/home",
"text": "",
"text": "首页",
"iconPath": "/images/main/icon01.png",
"selectedIconPath": "/images/main/icon01-a.png"
},

9
miniprogram/custom-tab-bar/index.wxml

@ -1,8 +1,15 @@
<!--miniprogram/custom-tab-bar/index.wxml-->
<view class="tab-bar">
<view class="tab-bar-border"></view>
<view wx:for="{{list}}" wx:key="index" class="tab-bar-item" data-path="{{item.pagePath}}" data-index="{{index}}" bindtap="switchTab">
<view wx:if="{{index==0}}" >
<image wx:if="{{index!=selected}}" src="{{item.iconPath}}"></image>
<image wx:else class="bigicon" src="{{item.selectedIconPath}}"></image>
<view wx:if="{{index!=selected}}" style="color: {{selected === index ? selectedColor : color}}">{{item.text}}</view>
</view>
<view wx:else>
<image src="{{selected === index ? item.selectedIconPath : item.iconPath}}"></image>
<view style="color: {{selected === index ? selectedColor : color}}">{{item.text}}</view>
</view>
</view>
</view>

25
miniprogram/custom-tab-bar/index.wxss

@ -3,20 +3,11 @@
bottom: 0;
left: 0;
right: 0;
height: 48px;
height: 98rpx;
background: white;
display: flex;
padding-bottom: env(safe-area-inset-bottom);
}
.tab-bar-border {
background-color: rgba(0, 0, 0, 0.33);
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 1px;
transform: scaleY(0.5);
box-shadow: 0px 6rpx 18rpx 0px rgba(216,216,216,0.66);
}
.tab-bar-item {
@ -29,10 +20,14 @@
}
.tab-bar-item image {
width: 27px;
height: 27px;
width: 54rpx;
height: 54rpx;
}
.tab-bar-item image.bigicon{
width: 70rpx;
height: 70rpx;
}
.tab-bar-item view {
font-size: 10px;
font-size: 22rpx;
color:#999999
}

BIN
miniprogram/images/main/home01.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 7.5 KiB

BIN
miniprogram/images/main/home02.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

After

Width:  |  Height:  |  Size: 9.5 KiB

BIN
miniprogram/images/main/home03.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 8.1 KiB

BIN
miniprogram/images/main/home04.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 6.1 KiB

BIN
miniprogram/images/main/home05.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 6.1 KiB

BIN
miniprogram/images/main/home06.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 8.1 KiB

BIN
miniprogram/images/main/home_top.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 726 KiB

After

Width:  |  Height:  |  Size: 312 KiB

30
miniprogram/pages/home/components/banner/banner.js

@ -1,30 +0,0 @@
Component({
data: {
currentIndex: 0
},
properties: {
bannerList: {
type: Array,
value: []
}
},
lifetimes: {
},
pageLifetimes: {
},
methods: {
swiperChange (e) {
if (e.detail.source === 'touch') {
this.setData({
currentIndex: e.detail.current
})
}
},
navigatetoBannerDetail (e) {
const { id, url, newsflag } = e.currentTarget.dataset
this.triggerEvent('navigatetoBannerDetail', {id, url, newsFlag: newsflag} )
}
}
})

3
miniprogram/pages/home/components/banner/banner.json

@ -1,3 +0,0 @@
{
"component": true
}

28
miniprogram/pages/home/components/banner/banner.wxml

@ -1,28 +0,0 @@
<view class="banner">
<swiper circular="{{true}}" autoplay="{{true}}" interval="{{3000}}" current="{{currentIndex}}" bindchange="swiperChange">
<swiper-item
wx:for="{{bannerList}}"
wx:key="index"
wx:for-index="index"
wx:for-item="item">
<view
class="banner-item"
data-id="{{item.id}}"
data-url="{{item.url}}"
data-newsflag="{{item.newsFlag}}"
bindtap="navigatetoBannerDetail">
<image mode="aspectFill" class="banner-img" src="{{item.imgUrl}}" />
<view class="banner-content">
<view class="title">
<view class="title-text">{{item.title}}</view>
</view>
<view class="indication">
<block wx:for="{{bannerList}}" wx:key="index">
<view class="spot{{index == currentIndex? ' active' : ''}}"></view>
</block>
</view>
</view>
</view>
</swiper-item>
</swiper>
</view>

77
miniprogram/pages/home/components/banner/banner.wxss

@ -1,77 +0,0 @@
.banner {
width: 100%;
height: 320rpx;
}
.banner swiper {
width: 100%;
height: 320rpx;
}
.banner-item {
width: 100%;
height: 320rpx;
position: relative;
}
.banner-item .banner-img {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
}
.banner-item .banner-content {
position: relative;
width: 100%;
height: 100%;
top: 0;
left: 0;
z-index: 100;
display: flex;
align-items: flex-end;
}
.banner-item .banner-content .title {
width: 100%;
height: 50rpx;
background: rgba(0,0,0, 0.4);
box-sizing: border-box;
padding: 0 20rpx;
display: flex;
align-items: center;
justify-content: space-between;
}
.banner-item .banner-content .title .title-text {
width: 75%;
height: 50rpx;
color: #fff;
font-size: 26rpx;
line-height: 50rpx;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
/* 自定义轮播指示点样式 */
.indication {
height: 50rpx;
display:flex;
position: absolute;
bottom: -2rpx;
right: 20rpx;
flex-direction:row;
align-items:center;
justify-content:center;
}
/* 未选中指示点样式 */
.spot{
width: 15rpx;
height: 15rpx;
border-radius: 50%;
margin-right: 10rpx;
background-color: #c6c6c8;
}
/*选中指示样式 */
.spot.active{
width: 15rpx;
height: 15rpx;
border-radius: 50%;
background-color: #fff;
}

13
miniprogram/pages/home/components/newsList/newsList.js

@ -1,13 +0,0 @@
Component({
properties: {
newsList: {
type: Array,
value: []
}
},
methods: {
navigatetoNewsDetail (e) {
this.triggerEvent('navigatetoNewsDetail', {newsId: e.currentTarget.dataset.newsid})
}
}
})

3
miniprogram/pages/home/components/newsList/newsList.json

@ -1,3 +0,0 @@
{
"component": true
}

24
miniprogram/pages/home/components/newsList/newsList.wxml

@ -1,24 +0,0 @@
<wxs src="../../../../utils/filter.wxs" module="filters"></wxs>
<view class="news-list">
<view
hover-stay-time="150"
hover-class="hover-sudoku"
class="list-item"
data-newsid="{{item.id}}"
bindtap="navigatetoNewsDetail"
wx:for="{{newsList}}"
wx:for-item="item"
wx:for-index="index"
wx:key="index">
<view class="left">
<view class="title">{{item.newsTitle}}</view>
<view class="bottom">
<view class="category">{{item.deptName}}-{{item.newsCategoryName}}</view>
<view class="time">{{filters.formatTimestamp(item.newsStartTime)}}</view>
</view>
</view>
<view class="right">
<image src="{{item.newsImageUrl}}" />
</view>
</view>
</view>

69
miniprogram/pages/home/components/newsList/newsList.wxss

@ -1,69 +0,0 @@
.news-list {
width: 100%;
background: #fff;
box-sizing: border-box;
padding: 0 35rpx;
margin-top: 10rpx;
}
.news-list .list-item {
width: 100%;
height: 205rpx;
box-sizing: border-box;
padding: 30rpx 0;
display: flex;
align-items: center;
justify-content: space-between;
}
.news-list .list-item .left {
width: calc(100% - 50rpx - 220rpx);
height: 146rpx;
}
.news-list .list-item .left .title {
color: #3f3f3f;
font-size: 30rpx;
line-height: 45rpx;
display: -webkit-box;
overflow: hidden;
text-overflow: ellipsis;
word-wrap: break-word;
white-space: normal !important;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
}
.news-list .list-item .left .bottom {
display: flex;
align-items: center;
justify-content: space-between;
}
.news-list .list-item .left .bottom .category {
color: #aaa;
font-size: 22rpx;
line-height: 48rpx;
width: calc(100% - 150rpx);
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.news-list .list-item .left .bottom .time {
color: #aaa;
font-size: 22rpx;
line-height: 48rpx;
width: 150rpx;
text-align: right;
}
.news-list .list-item .right {
width: 220rpx;
height: 146rpx;
border-radius: 12rpx;
overflow: hidden;
}
.news-list .list-item .right image {
width: 100%;
height:100%;
}
.news-list .list-item + .list-item {
border-top: 1rpx solid #ece9ec;
}
.news-list .hover-sudoku {
background: rgba(0,0,0,0.1);
}

17
miniprogram/pages/home/components/notice/notice.js

@ -1,17 +0,0 @@
Component({
properties: {
infoList: {
type: Array,
value: []
},
unreadnum: {
type: Number,
value: 0
}
},
methods: {
navigateToInfoList () {
this.triggerEvent('navigateToInfoList')
}
}
})

3
miniprogram/pages/home/components/notice/notice.json

@ -1,3 +0,0 @@
{
"component": true
}

16
miniprogram/pages/home/components/notice/notice.wxml

@ -1,16 +0,0 @@
<view class="notice" bindtap="navigateToInfoList">
<view class="border-content">
<image class="notice-logo" src="../../../../images/home/notice-logo.png" />
<image class="info-note" src="../../../../images/home/info-note.png" />
<swiper circular="{{true}}" autoplay="{{true}}" interval="{{3000}}" vertical="{{true}}">
<swiper-item
wx:for="{{infoList}}"
wx:for-index="index"
wx:for-item="item"
wx:key="index">
<view class="content">{{item.title}}</view>
</swiper-item>
</swiper>
<view class="num">{{unreadnum}}</view>
</view>
</view>

49
miniprogram/pages/home/components/notice/notice.wxss

@ -1,49 +0,0 @@
.notice {
width: 100%;
background: #fff;
height: 76rpx;
box-sizing: border-box;
padding: 0 40rpx;
}
.notice .border-content {
width: 100%;
background: #fff;
height: 76rpx;
display: flex;
align-items: center;
justify-content: center;
border-top: 1rpx solid #ece9ec;
}
.notice .notice-logo {
width: 32rpx;
height: 32rpx;
}
.notice .info-note {
width: 94rpx;
height: 24rpx;
margin: 0 20rpx 0 10rpx;
}
.notice swiper {
height: 76rpx;
width: calc(100% - 32rpx - 94rpx - 40rpx - 20rpx);
}
.notice swiper .content {
height: 76rpx;
line-height: 76rpx;
color: #aaa;
font-size: 24rpx;
width: 100%;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.notice .num {
font-size: 18rpx;
height: 28rpx;
text-align: center;
line-height: 28rpx;
color: #fff;
background: #fdb500;
border-radius: 8rpx 8rpx 8rpx 0;
width: 40rpx;
}

23
miniprogram/pages/home/components/project/project.js

@ -1,23 +0,0 @@
Component({
data: {
currentIndex: 0
},
properties: {
projectList: {
type: Array,
value: []
}
},
methods: {
// 手动滑动swiper
swiperChange (e) {
this.setData({
currentIndex: e.detail.current
})
},
// 跳转到项目详情
navigatetoItemDetail (e) {
this.triggerEvent('navigatetoItemDetail', { itemId: e.currentTarget.dataset.id})
}
}
})

3
miniprogram/pages/home/components/project/project.json

@ -1,3 +0,0 @@
{
"component": true
}

41
miniprogram/pages/home/components/project/project.wxml

@ -1,41 +0,0 @@
<wxs src="../../../../utils/filter.wxs" module="filters"></wxs>
<view class="project" wx:if="{{projectList.length > 0}}">
<swiper circular="{{true}}" autoplay="{{false}}" current="{{currentIndex}}" bindchange="swiperChange">
<swiper-item wx:for="{{projectList}}" wx:for-index="index" wx:for-item="item" wx:key="index">
<view class="content" data-id="{{item.id}}" bindtap="navigatetoItemDetail">
<view class="top">
<image mode="aspectFill" wx:if="{{item.images.length > 0}}" class="top-bg" src="{{item.images[0]}}" />
<image wx:else class="top-bg" src="https://epdc-shibei.elinkservice.cn/epdcFile/M00/02/89/rBAAM16O4_OAB6d6AALSjaFpI9M647.png" />
<view class="top-content">
<view>
<image class="project-status" src="{{filters.formatState(item.stateName)}}" />
</view>
<view class="progress">
<view class="image-logo">
<image class="progress-logo" src="../../../../images/home/new-progress.png"/>
</view>
<view class="progress-content">最新进展:{{item.latestProgress.progressName}}</view>
</view>
</view>
</view>
<view class="bottom">
<view class="title">{{item.itemContent}}</view>
<view class="info">
<view class="left">
<image class="avatar" src="{{item.avatar}}" />
<view class="name">{{item.nickname}}</view>
</view>
<view class="right">表达态度 {{item.statementNum}}次</view>
</view>
</view>
</view>
</swiper-item>
</swiper>
<view class="indication">
<block wx:for="{{projectList}}" wx:key="index">
<view class="spot{{index == currentIndex? ' active' : ''}}"></view>
</block>
</view>
</view>

142
miniprogram/pages/home/components/project/project.wxss

@ -1,142 +0,0 @@
.project {
width: 100%;
height: 450rpx;
box-sizing: border-box;
padding-top: 20rpx;
}
.project swiper {
width: 100%;
height: 380rpx;
}
.project swiper swiper-item {
box-sizing: border-box;
padding: 0 40rpx;
width:100%;
height: 380rpx;
}
.project .content {
width: 100%;
height: 380rpx;
background: #fff;
border-radius: 0 16rpx 16rpx 16rpx;
overflow: hidden;
}
.project .content .top {
width:100%;
height: 260rpx;
position: relative;
}
.project .content .top .top-bg {
width: 100%;
height: 100%;
position: absolute;
left: 0;
top: 0;
z-index: 10;
}
.project .content .top .top-content {
width: 100%;
height: 260rpx;
position: relative;
z-index: 100;
display: flex;
justify-content: space-between;
flex-direction: column;
}
.project .content .top .top-content .project-status {
width: 110rpx;
height: 42rpx;
}
.project .content .top .top-content .progress {
height: 36rpx;
width: 36%;
margin-left: 20rpx;
background: rgba(0,0,0, 0.4);
border-radius: 17rpx;
margin-bottom: 10rpx;
display: flex;
align-items: center;
}
.project .content .top .top-content .progress .image-logo {
width: 36rpx;
height:36rpx;
}
.project .content .top .top-content .progress .progress-logo {
width: 36rpx;
height: 36rpx;
position: relative;
top: -2rpx;
}
.project .content .top .top-content .progress .progress-content {
color: #fff;
font-size: 22rpx;
line-height: 36rpx;
margin-left: 5rpx;
}
.project .content .bottom {
width: 100%;
height: 120rpx;
box-sizing: border-box;
padding: 0 20rpx;
}
.project .content .bottom .title {
color: #333;
font-size: 30rpx;
width: 100%;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
line-height: 62rpx;
}
.project .content .bottom .info {
width:100%;
height: 30rpx;
display: flex;
align-items: center;
justify-content: space-between;
}
.project .content .bottom .info .left {
display: flex;
align-items: center;
}
.project .content .bottom .info .left .avatar {
width: 30rpx;
height: 30rpx;
border-radius: 50%;
margin-right: 10rpx;
position: relative;
top: 2rpx;
}
.project .content .bottom .info .left .name {
font-size: 22rpx;
color:#aaa;
}
.project .content .bottom .info .right {
color: #aaa;
font-size: 20rpx;
}
/* 自定义轮播指示点样式 */
.indication {
height: 45rpx;
width: 100%;
display:flex;
flex-direction: row;
align-items:center;
justify-content:center;
}
/* 未选中指示点样式 */
.spot{
width: 22rpx;
height: 8rpx;
border-radius: 3rpx;
margin-right: 10rpx;
background-color: #dcdbe0;
}
/*选中指示样式 */
.spot.active{
width: 22rpx;
height: 8rpx;
border-radius: 53rpx;
background-color: #cb090b;
}

280
miniprogram/pages/home/components/sudoku/sudoku.js

@ -1,280 +0,0 @@
Component({
properties: {
sudokuState: {
type: Object,
value: {
consultAvailable: "0",
appraiseAvailable: "0",
talkAndNeedAndPartyAvaliable: "0"
},
},
userInfo: {
type: Object,
},
},
observers: {
sudokuState: function (value) {
this.updateList()
}
},
data: {
isShowAll: false, // 是否显示全部菜单 默认最多显示8个(2行)
consultAvailableList: [
{
title: "网格专员",
icon: "../../../../images/home/consult.png",
triggerEvent: "navigatetoConsultion",
sort: 7
}
],
appraiseAvailableList: [
{
title: "清廉市北",
icon: "../../../../images/home/appramise.png",
triggerEvent: "navigatetoAppraise",
sort: 9
}
],
talkAndNeedAndPartyAvaliableList: [
// {
// title: "随时讲",
// icon: "../../../../images/home/suishijiang.png",
// triggerEvent: "navigateToAnytimeSay",
// sort: 1
// },
{
title: "需求清单",
icon: "../../../../images/home/xuqiuqingdan.png",
triggerEvent: "navigateToDemand",
sort: 3
},
{
title: "党群服务中心",
icon: "../../../../images/home/party-masses.png",
triggerEvent: "navigateToPartyMasses",
sort: 8
},
{
title: "问卷调查",
icon: "../../../../images/home/wenjuandiaocha.png",
triggerEvent: "navigateToQuestionnaire",
sort: 6
},
{
title: "办事指南",
icon: "../../../../images/home/banshizhinan.png",
triggerEvent: "navigateToServiceGuide",
sort: 4
}
],
commonList: [
// {
// title: "有奖举报",
// icon: "../../../../images/home/chuangC.png",
// triggerEvent: "navigateToAnytimeSay_cc",
// sort: 1
// },
// {
// title: "随时报",
// icon: "../../../../images/home/suishibao.png",
// triggerEvent: "navigateToAddIssue",
// sort: 2
// },
{
title: "通知公告",
icon: "../../../../images/home/notice.png",
triggerEvent: "navigateToNotice",
sort: 5
},
{
title: "人才赋能",
icon: "../../../../images/home/talents.png",
triggerEvent: "navigatetoTalents",
sort: 10
},
{
title: "党员风采",
icon: "../../../../images/home/partyElegant.png",
triggerEvent: "navigatetoPartyElegant",
sort: 11
},
{
title: "联建活动",
icon: "../../../../images/home/dyfc.png",
triggerEvent: "navigatetoUnionBuild",
sort: 11
},
// { **********************************暂时屏蔽这期功能不上线2022/3/31********************************************
// title: "行程上报",
// icon: "../../../../images/home/xingchengshangbao.png",
// triggerEvent: "navigateToTripReport",
// sort: 11
// },
], // 通用的菜单
menuList: []
},
lifetimes:{
attached () {
this.updateList()
}
},
methods: {
updateList () {
let list1 = []
let list2 = []
let list3 = []
if (this.data.sudokuState.consultAvailable && this.data.sudokuState.consultAvailable == "1") {
list1 = this.data.consultAvailableList
}
if (this.data.sudokuState.appraiseAvailable && this.data.sudokuState.appraiseAvailable == "1") {
list2 = this.data.appraiseAvailableList
}
if (this.data.sudokuState.talkAndNeedAndPartyAvaliable && this.data.sudokuState.talkAndNeedAndPartyAvaliable == "1") {
list3 = this.data.talkAndNeedAndPartyAvaliableList
}
const menuList = [ ...this.data.commonList, ...list1, ...list2, ...list3 ]
menuList.sort((a, b) => a.sort - b.sort)
this.setData({
menuList
})
// console.log(this.data.sudokuState, this.data.menuList)
},
navigateTo (e) {
let to = e.currentTarget.dataset.to
if (to == "navigateToTripReport") { // 行程上报
// wx.navigateTo({
// url: "/subpages/extend/pages/tripReport/tripReport"
// })
this.triggerEvent("navigateToTripReport")
} else if (to == "navigateToPartyMasses") { // 党群服务中心
this.triggerEvent("navigateToPartyMasses")
// wx.navigateTo({
// url: "/subpages/partyMassesServiceCenter/pages/partyMassesMap/partyMassesMap"
// })
} else if (to == "navigateToQuestionnaire") { // 问卷调查
this.triggerEvent("navigateToQuestionnaire")
// wx.navigateTo({
// url: "/subpages/questionnaire/pages/index/index"
// })
} else if (to == "navigateToServiceGuide") { // 办事指南
this.triggerEvent("navigateToServiceGuide")
// wx.navigateTo({
// url: "/subpages/workguide/pages/index/index"
// })
} else if (to == "navigatetoPartyElegant") { // 党员风采
this.triggerEvent("navigatetoPartyElegant")
// wx.navigateTo({
// url: "/subpages/workguide/pages/index/index"
// })
}else if (to == "navigatetoUnionBuild") { // 联建活动
this.triggerEvent("navigatetoUnionBuild")
} else if (to == "navigatetoTalents") { // 人才赋能
this.navigatetoTalents()
} else {
this.triggerEvent(to)
}
},
changeMenu () {
this.data.isShowAll = !this.data.isShowAll
this.setData({
isShowAll: this.data.isShowAll
})
},
// 跳转到需求清单
navigateToDemand () {
this.triggerEvent("navigateToDemand")
},
// 跳转到随时讲
navigateToAnytimeSay() {
this.triggerEvent("navigateToAnytimeSay")
},
// 跳转到随时讲
navigateToAnytimeSay_cc() {
this.triggerEvent("navigateToAnytimeSay_cc")
},
// 跳转到我要报事
navigateToAddIssue() {
this.triggerEvent("navigateToAddIssue")
},
// 跳转到网格专员
navigatetoConsultion() {
this.triggerEvent("navigatetoConsultion")
},
// 跳转到通知公告
navigateToNotice() {
this.triggerEvent("navigateToNotice")
},
// 跳转到请您监督
navigatetoAppraise() {
this.triggerEvent("navigatetoAppraise")
},
// 工商联
navigatetoAssociatio() {
wx.navigateToMiniProgram({
appId: "wx2e9510d76f23fff6",
path: "",
envVersion: "release", // 打开正式版ß
// envVersion: "develop",// 打开正式版ß
success() {
// 打开成功
console.log("点击允许")
},
fail: function (err) {
console.log(err)
},
})
},
// 人才赋能
navigatetoTalents() {
let { faceImg, mobile, nickname } = this.data.userInfo
console.log("", this.data.userInfo)
wx.navigateToMiniProgram({
appId: "wx8f4ebf5537cf4962",
path: "",
envVersion: "release", // 打开正式版ß
// envVersion: "develop",
success() {
// 打开成功
console.log("点击允许")
},
extraData: {
nickname,
mobile,
faceImg,
},
fail: function (err) {
console.log(err)
},
})
},
// 党史学习
navigateToPartyHistory() {
wx.navigateToMiniProgram({
appId: "wx2aed548e27e28de9",
path: "/pages/detail/detail?qid=606fc907e17b4a1a960591ca",
envVersion: "release", // 打开正式版ß
success() {
// 打开成功
console.log("点击允许")
},
fail: function (err) {
console.log(err)
},
})
},
// APP跳转
navigatetoApp() {
// console.log("111", wx.getLaunchOptionsSync())
wx.navigateTo({
url: "/pages/navigatetoApp/navigatetoApp",
})
},
launchAppError(e) {
console.log(e.detail.errMsg)
},
handleContact(e) {
console.log(e.detail.path)
console.log(e.detail.query)
},
},
})

3
miniprogram/pages/home/components/sudoku/sudoku.json

@ -1,3 +0,0 @@
{
"component": true
}

24
miniprogram/pages/home/components/sudoku/sudoku.wxml

@ -1,24 +0,0 @@
<view class="sudoku">
<view class="content" style="height:{{menuList.length > 8 && !isShowAll ? '400rpx' : 'auto'}};">
<view class="item" hover-stay-time="150" hover-class="hover-sudoku" data-to="{{item.triggerEvent}}" bindtap="navigateTo" wx:for="{{menuList}}" wx:for-item="item" wx:for-index="index" wx:key="index">
<image src="{{item.icon}}" />
<view class="name">{{item.title}}</view>
</view>
<!-- <view class="item" hover-stay-time="150" hover-class="hover-sudoku" bindtap="navigatetoAssociatio">
<image src="../../../../images/home/Associatio.png" />
<view class="name">工商联</view>
</view> -->
<!-- <button open-type="launchApp" app-parameter="wechat" binderror="launchAppError" class="item button-item" bind:tap="navigatetoApp">
<image src="../../../../images/home/app-icon.png" />
<view>初心互助</view>
</button> -->
<!-- <button open-type="launchApp" app-parameter="wechat" binderror="launchAppError" class="item button-item" bind:tap="navigateToPartyHistory">
<image src="../../../../images/home/partyhistory.png" />
<view>党史学习</view>
</button> -->
<!-- <button class='modal-btn' open-type='contact' bindcontact="handleContact">进入【护血糖APP】</button> -->
</view>
<view class="show-all" bindtap="changeMenu" wx:if="{{menuList.length > 8}}">
<image src="../../../../images/home/{{isShowAll?'up':'down'}}.png" />
</view>
</view>

87
miniprogram/pages/home/components/sudoku/sudoku.wxss

@ -1,87 +0,0 @@
.sudoku {
background: #fff;
padding: 0 20rpx;
position: relative;
}
.show-all {
height: 60rpx;
text-align: right;
padding: 0 20rpx;
display: flex;
align-items: center;
justify-content: center;
}
.show-all image {
height: 40rpx;
width: 40rpx;
}
.content {
width: 100%;
/* height: 215rpx; */
display: inline-block;
box-sizing: border-box;
overflow: hidden;
}
.item {
display: inline-flex;
flex-direction: column;
justify-content: center;
align-items: center;
width: 25%;
margin-top: 25rpx;
}
.item image {
width: 126rpx;
height: 126rpx;
}
.item .name {
font-size: 28rpx;
color: #3f3f3f;
font-weight: bold;
}
.sudoku .hover-sudoku {
background: rgba(0, 0, 0, 0.1);
}
button::after {
content: " ";
width: 200%;
height: 200%;
position: absolute;
top: 0;
left: 0;
border: none !important;
-webkit-transform: scale(.5);
transform: scale(.5);
-webkit-transform-origin: 0 0;
transform-origin: 0 0;
box-sizing: border-box;
border-radius: 10px;
}
button {
position: relative;
display: block;
margin-left: auto;
margin-right: auto;
padding-left: 14px;
padding-right: 14px;
box-sizing: border-box;
font-size: 28rpx;
font-weight: bold;
text-align: center;
text-decoration: none;
line-height: 40rpx !important;
border-radius: 5px;
-webkit-tap-highlight-color: transparent;
overflow: hidden;
color: #3f3f3f;
background-color: #fff;
}

9
miniprogram/pages/home/home.json

@ -3,14 +3,7 @@
"navigationStyle": "custom",
"navigationBarTextStyle": "white",
"usingComponents": {
"banner": "./components/banner/banner",
"sudoku": "./components/sudoku/sudoku",
"notice": "./components/notice/notice",
"project": "./components/project/project",
"news-list":"./components/newsList/newsList",
"load-more": "../../components/loadMore/loadMore",
"complete-info-dialog": "../../components/completeInfoDialog/completeInfoDialog",
"wux-popup": "../../dist/popup/index"
},
"enablePullDownRefresh": true,
"backgroundColor": "#f8f8f8",

Loading…
Cancel
Save