From 48c9f10539e38be8fa3ff0a2a4864ea9e1af9ad3 Mon Sep 17 00:00:00 2001
From: ZhaoTongYao <531131322@qq.com>
Date: Thu, 7 Jul 2022 15:36:18 +0800
Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=82=AC=E6=B5=AE=E6=8C=89?=
=?UTF-8?q?=E9=92=AE-=E5=A4=A7=E5=85=9A=E5=A7=94?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
components/moveButton/moveButton.js | 47 +++++++++++++++++++++++++++
components/moveButton/moveButton.json | 3 ++
components/moveButton/moveButton.wxml | 8 +++++
components/moveButton/moveButton.wxss | 34 +++++++++++++++++++
components/project/project.js | 5 +--
pages/index/index.js | 30 ++++++++++++++++-
pages/index/index.json | 1 +
pages/index/index.wxml | 5 ++-
pages/project/project.js | 10 +++---
project.private.config.json | 10 +++---
10 files changed, 140 insertions(+), 13 deletions(-)
create mode 100644 components/moveButton/moveButton.js
create mode 100644 components/moveButton/moveButton.json
create mode 100644 components/moveButton/moveButton.wxml
create mode 100644 components/moveButton/moveButton.wxss
diff --git a/components/moveButton/moveButton.js b/components/moveButton/moveButton.js
new file mode 100644
index 0000000..51cf38f
--- /dev/null
+++ b/components/moveButton/moveButton.js
@@ -0,0 +1,47 @@
+Component({
+ data: {
+ },
+ properties: {
+ areaTop: {
+ type: Number,
+ value: 0
+ },
+ areaLeft: {
+ type: Number,
+ value: 0
+ },
+ areaWidth: {
+ type: String,
+ value: '100%'
+ },
+ areaHeight: {
+ type: String,
+ value: '100%'
+ },
+ buttonWidth: {
+ type: Number,
+ value: 178
+ },
+ buttonHeight: {
+ type: Number,
+ value: 178
+ },
+ buttonTop: {
+ type: Number,
+ value: 1000
+ },
+ buttonLeft: {
+ type: Number,
+ value: 580
+ },
+ imgUrl: {
+ type: String,
+ value: ''
+ }
+ },
+ methods: {
+ onClickButton () {
+ this.triggerEvent('movebtnCallBack')
+ }
+ }
+})
\ No newline at end of file
diff --git a/components/moveButton/moveButton.json b/components/moveButton/moveButton.json
new file mode 100644
index 0000000..32640e0
--- /dev/null
+++ b/components/moveButton/moveButton.json
@@ -0,0 +1,3 @@
+{
+ "component": true
+}
\ No newline at end of file
diff --git a/components/moveButton/moveButton.wxml b/components/moveButton/moveButton.wxml
new file mode 100644
index 0000000..10c5065
--- /dev/null
+++ b/components/moveButton/moveButton.wxml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/components/moveButton/moveButton.wxss b/components/moveButton/moveButton.wxss
new file mode 100644
index 0000000..0f29c00
--- /dev/null
+++ b/components/moveButton/moveButton.wxss
@@ -0,0 +1,34 @@
+
+/* 悬浮按钮 -start- */
+.movable-area{
+ pointer-events:none;
+ z-index: 999;
+ width: 100%;
+ height: 90%;
+ position: fixed;
+ top: 60px;
+ left: 0;
+ right: 0;
+ bottom: 0;
+}
+.movable-view{
+ pointer-events:auto;
+ width: 178rpx;
+ height: 178rpx;
+ transform: translateX(0rpx) translateY(0rpx) translateZ(0rpx) scale(1);
+ transform-origin: center center;
+ will-change: auto;
+ position: absolute;
+ top: 0rpx;
+ left: 0rpx;
+}
+.img-box {
+ width: 100%;
+ height: 100%;
+}
+.img-box image {
+ width: 100%;
+ height: 100%;
+ object-fit: cover;
+}
+/* 悬浮按钮 -end- */
\ No newline at end of file
diff --git a/components/project/project.js b/components/project/project.js
index 75eeced..8f1874b 100644
--- a/components/project/project.js
+++ b/components/project/project.js
@@ -28,7 +28,7 @@ Component({
},
methods: {
- getItemList: function (page, index, clear) {
+ getItemList: function (page, index, clear, isPartyFlag=0) {
// wx.showLoading({
// title: '加载中',
// })
@@ -55,7 +55,8 @@ Component({
"pageIndex": page,
"pageSize": app.globalData.pageSize,
"timestamp": utils.formatTimeOpen(new Date(), '-', ':'),
- "itemState": itemState
+ "itemState": itemState,
+ "isPartyFlag": isPartyFlag
}
console.log("params:" + JSON.stringify(params))
api.getItemList(params).then(function (res) {
diff --git a/pages/index/index.js b/pages/index/index.js
index a626603..d267074 100644
--- a/pages/index/index.js
+++ b/pages/index/index.js
@@ -20,6 +20,7 @@ Page({
joinFlag: true,
buttonName:'', // 获取点击按钮的名字
qrCodeId: '',
+ floatButton: {}
},
onLoad: function() {
// this.checkUpdateAvatar()
@@ -48,8 +49,18 @@ Page({
getIndexPanel: function() {
let that = this
api.indexPanel().then(function(res) {
+ res.data.forEach(item => {
+ if (item.templateInfo.templateCode == 'dadangwei') {
+ that.data.floatButton.icon = item.childNav[0].icon,
+ that.data.floatButton.code = item.childNav[0].navCode,
+ that.data.floatButton.label = item.childNav[0].label
+ } else {
+ that.data.panel.push(item)
+ }
+ })
that.setData({
- panel: res.data
+ floatButton: that.data.floatButton,
+ panel: that.data.panel
})
console.log('panel', res.data)
that.getIndexStatistics()
@@ -584,4 +595,21 @@ Page({
}
})
},
+ // 点击悬浮按钮 大党委
+ clickMoveButton () {
+ const tabMenu = [
+ {
+ label: '待处理'
+ },
+ {
+ label: '已结案'
+ },
+ {
+ label: '已关闭'
+ }
+ ]
+ wx.navigateTo({
+ url: '/pages/project/project?state=0&childNav=' + JSON.stringify(tabMenu) + '&isPartyFlag=1'
+ })
+ }
})
\ No newline at end of file
diff --git a/pages/index/index.json b/pages/index/index.json
index 3a2d11d..c9bb5f3 100644
--- a/pages/index/index.json
+++ b/pages/index/index.json
@@ -3,6 +3,7 @@
"navigationBarBackgroundColor": "#BB0300",
"navigationBarTextStyle": "white",
"usingComponents": {
+ "move-btn": "/components/moveButton/moveButton",
"wux-icon": "../../dist/icon/index",
"wux-grids": "../../dist/grids/index",
"wux-grid": "../../dist/grid/index",
diff --git a/pages/index/index.wxml b/pages/index/index.wxml
index 1de2660..12e3ca0 100644
--- a/pages/index/index.wxml
+++ b/pages/index/index.wxml
@@ -91,4 +91,7 @@
-
\ No newline at end of file
+
+
+
+
\ No newline at end of file
diff --git a/pages/project/project.js b/pages/project/project.js
index 290e79e..fd4a1f0 100644
--- a/pages/project/project.js
+++ b/pages/project/project.js
@@ -24,6 +24,7 @@ Page({
title: 'Tab 4',
},
],
+ isPartyFlag: 0
},
onLoad: function (options) {
const temp = Number(options.state) + 1
@@ -31,26 +32,27 @@ Page({
key: 'tab' + temp,
index: options.state,
childNav: JSON.parse(options.childNav),
+ isPartyFlag: options.isPartyFlag ? options.isPartyFlag : 0
})
},
onShow: function (options) {
this.setData({
indexPage:1
})
- this.selectComponent("#state-" + this.data.index).getItemList(1, this.data.index, 0)
+ this.selectComponent("#state-" + this.data.index).getItemList(1, this.data.index, 0, this.data.isPartyFlag)
},
onReachBottom: function () {
this.setData({
indexPage: this.data.indexPage + 1
})
- this.selectComponent("#state-" + this.data.index).getItemList(this.data.indexPage,this.data.index,1)
+ this.selectComponent("#state-" + this.data.index).getItemList(this.data.indexPage, this.data.index, 1, this.data.isPartyFlag)
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function (options) {
- this.selectComponent("#state-" + this.data.index).getItemList(1, this.data.index, 0)
+ this.selectComponent("#state-" + this.data.index).getItemList(1, this.data.index, 0, this.data.isPartyFlag)
wx.stopPullDownRefresh();
},
onChange(e) {
@@ -67,7 +69,7 @@ Page({
index,
indexPage: 1
})
- this.selectComponent("#state-" + this.data.index).getItemList(this.data.indexPage,this.data.index,0)
+ this.selectComponent("#state-" + this.data.index).getItemList(this.data.indexPage, this.data.index, 0, this.data.isPartyFlag)
},
onSwiperChange(e) {
console.log('onSwiperChange', e)
diff --git a/project.private.config.json b/project.private.config.json
index e488daf..c22badf 100644
--- a/project.private.config.json
+++ b/project.private.config.json
@@ -1,7 +1,7 @@
{
- "projectname": "epdc-office-mp-yushan",
- "setting": {
- "compileHotReLoad": true
- },
- "description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html"
+ "projectname": "榆山工作端",
+ "setting": {
+ "compileHotReLoad": true
+ },
+ "description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html"
}
\ No newline at end of file