Initial Commit
31
.eslintrc.js
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
/*
|
||||
* Eslint config file
|
||||
* Documentation: https://eslint.org/docs/user-guide/configuring/
|
||||
* Install the Eslint extension before using this feature.
|
||||
*/
|
||||
module.exports = {
|
||||
env: {
|
||||
es6: true,
|
||||
browser: true,
|
||||
node: true,
|
||||
},
|
||||
ecmaFeatures: {
|
||||
modules: true,
|
||||
},
|
||||
parserOptions: {
|
||||
ecmaVersion: 2018,
|
||||
sourceType: 'module',
|
||||
},
|
||||
globals: {
|
||||
wx: true,
|
||||
App: true,
|
||||
Page: true,
|
||||
getCurrentPages: true,
|
||||
getApp: true,
|
||||
Component: true,
|
||||
requirePlugin: true,
|
||||
requireMiniProgram: true,
|
||||
},
|
||||
// extends: 'eslint:recommended',
|
||||
rules: {},
|
||||
}
|
||||
14
.gitignore
vendored
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
# Windows
|
||||
[Dd]esktop.ini
|
||||
Thumbs.db
|
||||
$RECYCLE.BIN/
|
||||
|
||||
# macOS
|
||||
.DS_Store
|
||||
.fseventsd
|
||||
.Spotlight-V100
|
||||
.TemporaryItems
|
||||
.Trashes
|
||||
|
||||
# Node.js
|
||||
node_modules/
|
||||
174
app.js
Normal file
|
|
@ -0,0 +1,174 @@
|
|||
// app.js
|
||||
App({
|
||||
onLaunch: function () {
|
||||
wx.getSystemInfo({
|
||||
success: e => {
|
||||
this.globalData.StatusBar = e.statusBarHeight;
|
||||
let capsule = wx.getMenuButtonBoundingClientRect();
|
||||
if (capsule) {
|
||||
this.globalData.Custom = capsule;
|
||||
this.globalData.CustomBar = capsule.bottom + capsule.top - e.statusBarHeight;
|
||||
} else {
|
||||
this.globalData.CustomBar = e.statusBarHeight + 50;
|
||||
}
|
||||
}
|
||||
})
|
||||
if (wx.canIUse('getUpdateManager')) {
|
||||
const updateManager = wx.getUpdateManager()
|
||||
updateManager.onCheckForUpdate(function (res) {
|
||||
if (res.hasUpdate) {
|
||||
updateManager.onUpdateReady(function () {
|
||||
wx.showModal({
|
||||
title: '更新提示',
|
||||
content: '新版本已经准备好,请重启应用。',
|
||||
showCancel: false,
|
||||
success: function (res) {
|
||||
if (res.confirm) {
|
||||
updateManager.applyUpdate()
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
updateManager.onUpdateFailed(function () {
|
||||
wx.showModal({
|
||||
title: '已经有新版本了哟~',
|
||||
content: '新版本已经上线啦,请您删除当前小程序,重新搜索打开',
|
||||
showCancel: false,
|
||||
success: function (res) {
|
||||
if (res.confirm) {
|
||||
updateManager.applyUpdate()
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
globalData: {
|
||||
versionCode: 'V1',
|
||||
userInfo: {},
|
||||
headerUrl: "http://42.193.40.239:8017/"
|
||||
},
|
||||
|
||||
// 文件服务器地址
|
||||
FILE_SERVER_URL: "http://42.193.40.239:8888", //查看
|
||||
FILE_SERVER_UP_URL: "http://42.193.40.239:8017/", //上传
|
||||
|
||||
// 文件类型
|
||||
FileType: {
|
||||
avatar: "SysPhoto", // 用户头像
|
||||
resumptionAcs: "WorkFile", // 履职附件
|
||||
taskAcs: "TaskAttachment", // 任务附件
|
||||
msgAcs: "MsgAcs", // 消息附件
|
||||
checkMethodPic: "checkMethodPic", //检查方法图片
|
||||
userSign: "UserSign", //用户签名
|
||||
entSign: "entSign", //企业签名
|
||||
buildImg: "buildImg", //建筑体图片
|
||||
buildDesignImg: "buildDesignImg", //建筑体总平图
|
||||
dangerBefore: "APPRectifyImgBefore", //整改前
|
||||
dangerAfter: "APPRectifyImgAfter", //整改后
|
||||
|
||||
entEmResourse: "entEmResourse", //应急物资台账
|
||||
|
||||
EmergencyImg: "Content", // 应急预案---一图一表
|
||||
EmergencyFile: "EmergencyFile", // 应急预案---文件
|
||||
EmergencyPlanFile: "EmergencyPlanFile", // 应急演练---文件
|
||||
checkEnclosure: "CheckEnclosure", // 检查附件
|
||||
},
|
||||
|
||||
// 接口类型
|
||||
ApiFileType: {
|
||||
GET: "/getFile",
|
||||
POST: "/uploadFile",
|
||||
DELETE: "/delFile",
|
||||
},
|
||||
|
||||
// 请求函数封装
|
||||
axios: function (type, con, url, data, showLoading) {
|
||||
try {
|
||||
if (showLoading) {
|
||||
wx.showLoading({
|
||||
title: '加载中...',
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
return new Promise((resolve, reject) => {
|
||||
wx.request({
|
||||
url: `${this.globalData.headerUrl}${con}${url}`,
|
||||
method: type,
|
||||
data: data,
|
||||
header: {
|
||||
'content-type': 'application/json;charset=UTF-8',
|
||||
'userToken': this.globalData.userInfo.userToken || ""
|
||||
},
|
||||
success: function (res) {
|
||||
var data = res.data
|
||||
resolve(data)
|
||||
},
|
||||
fail: function (err) {
|
||||
reject(err)
|
||||
},
|
||||
complete: function (params) {
|
||||
if (showLoading) wx.hideLoading();
|
||||
}
|
||||
})
|
||||
})
|
||||
} catch {}
|
||||
},
|
||||
|
||||
/** 上传文件 */
|
||||
uploadFile: function (OTCId, OTCType, filePath) {
|
||||
let params = {
|
||||
OTCId,
|
||||
OTCType,
|
||||
userId: this.globalData.userInfo.userId,
|
||||
}
|
||||
console.info(params)
|
||||
return new Promise((resolve, reject) => {
|
||||
wx.uploadFile({
|
||||
url: this.FILE_SERVER_UP_URL + this.ApiFileType.POST,
|
||||
filePath: filePath,
|
||||
name: 'file',
|
||||
formData: params,
|
||||
success: function (res) {
|
||||
if (res.statusCode === 200) {
|
||||
resolve(res.data);
|
||||
} else {
|
||||
reject()
|
||||
}
|
||||
},
|
||||
fail: function (err) {
|
||||
reject(err);
|
||||
}
|
||||
})
|
||||
}).catch()
|
||||
},
|
||||
|
||||
// 设置监听器
|
||||
watch: function (ctx, obj) {
|
||||
Object.keys(obj).forEach(key => {
|
||||
this.observer(ctx.data, key, ctx.data[key], function (value) {
|
||||
obj[key].call(ctx, value)
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
// 监听属性,并执行监听函数
|
||||
observer: function (data, key, val, fn) {
|
||||
Object.defineProperty(data, key, {
|
||||
configurable: true,
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return val
|
||||
},
|
||||
set: function (newVal) {
|
||||
if (newVal === val) return
|
||||
fn && fn(newVal)
|
||||
val = newVal
|
||||
},
|
||||
})
|
||||
}
|
||||
})
|
||||
56
app.json
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
{
|
||||
"pages": [
|
||||
"pages/login/index",
|
||||
"pages/index/index",
|
||||
"pages/account/info/index",
|
||||
"pages/task/file/index/index",
|
||||
"pages/task/index/index",
|
||||
"pages/task/check/index/index",
|
||||
"pages/emergency/index/index",
|
||||
"pages/emergency/suddenly-up/up/index",
|
||||
"pages/msg/index/index",
|
||||
"pages/msg/push-index/index",
|
||||
"pages/msg/push/index",
|
||||
|
||||
"pages/web/index",
|
||||
|
||||
"pages/t-j/y-j/index/index",
|
||||
"pages/t-j/j-b-x-x/index/index",
|
||||
"pages/t-j/g-z-t-j/index/index",
|
||||
"pages/t-j/g-z-r-z/index/index",
|
||||
"pages/t-j/g-z-r-z/detail/index",
|
||||
|
||||
"pages/g-z-t/s-b/index/index",
|
||||
"pages/g-z-t/d-b-s-x/index/index",
|
||||
"pages/g-z-t/d-b-s-x/detail/index",
|
||||
|
||||
"pages/y-j/y-a/index/index",
|
||||
"pages/y-j/z-h/index/index",
|
||||
"pages/y-j/t-x/index/index"
|
||||
],
|
||||
"window": {
|
||||
"backgroundTextStyle": "light",
|
||||
"navigationBarBackgroundColor": "#fff",
|
||||
"navigationBarTitleText": "",
|
||||
"navigationBarTextStyle": "white"
|
||||
},
|
||||
"usingComponents": {
|
||||
"ec-canvas": "/ec-canvas/ec-canvas",
|
||||
"cu-custom": "/colorui/components/cu-custom",
|
||||
"empty": "/components/empty/empty",
|
||||
"title-bar": "/components/title-bar/index"
|
||||
},
|
||||
"permission": {
|
||||
"scope.userLocation": {
|
||||
"desc": "你的位置信息将用于记录检查佐证"
|
||||
},
|
||||
"scope.writePhotosAlbum": {
|
||||
"desc": "用于保存图片到相册"
|
||||
},
|
||||
"scope.writeFiles": {
|
||||
"desc": "用于保存文件"
|
||||
}
|
||||
},
|
||||
"style": "v2",
|
||||
"sitemapLocation": "sitemap.json"
|
||||
}
|
||||
134
app.wxss
Normal file
|
|
@ -0,0 +1,134 @@
|
|||
/**app.wxss**/
|
||||
@import './weui.wxss';
|
||||
@import "colorui/main.wxss";
|
||||
@import "colorui/icon.wxss";
|
||||
|
||||
page {
|
||||
--main-theme: #346df5;
|
||||
--green: #199F67;
|
||||
--blue: #0460FE;
|
||||
--red: #FF2626;
|
||||
--org: #f59709;
|
||||
--yellow: #ece24e;
|
||||
background-color: #F2F4F7;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar {
|
||||
width: 0;
|
||||
height: 0;
|
||||
color: transparent;
|
||||
}
|
||||
|
||||
scroll-view {
|
||||
background-color: #f5f5f5;
|
||||
}
|
||||
|
||||
.container {
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.v-div {
|
||||
display: flex;
|
||||
display: -webkit-flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.h-div {
|
||||
display: flex;
|
||||
display: -webkit-flex;
|
||||
flex-direction: row;
|
||||
}
|
||||
|
||||
.v-center {
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.h-center {
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.flex {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.space-between {
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
/* 超出单行省略号 */
|
||||
.ellipsis {
|
||||
display: -webkit-box;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
-webkit-line-clamp: 1;
|
||||
-webkit-box-orient: vertical;
|
||||
}
|
||||
|
||||
/* 超出多行省略号 */
|
||||
.ellipsis--l2 {
|
||||
display: -webkit-box;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
-webkit-line-clamp: 2;
|
||||
-webkit-box-orient: vertical;
|
||||
}
|
||||
|
||||
.arrow {
|
||||
width: 32rpx;
|
||||
height: 32rpx;
|
||||
color: #c6c6c6 !important;
|
||||
}
|
||||
|
||||
.space {
|
||||
height: calc(constant(safe-area-inset-bottom) + 30rpx);
|
||||
height: calc(env(safe-area-inset-bottom) + 30rpx);
|
||||
}
|
||||
|
||||
.submit {
|
||||
margin: 30px 0;
|
||||
padding: 0;
|
||||
line-height: 40px;
|
||||
font-weight: normal;
|
||||
background: -webkit-linear-gradient(top, #54CBFD, #327DF4);
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.submit:active {
|
||||
background: -webkit-linear-gradient(top, #54CBFD, #54CBFD);
|
||||
}
|
||||
|
||||
.option {
|
||||
position: fixed;
|
||||
bottom: calc(constant(safe-area-inset-bottom) + 30rpx);
|
||||
bottom: calc(env(safe-area-inset-bottom) + 30rpx);
|
||||
left: 0;
|
||||
right: 0;
|
||||
padding: 16rpx 32rpx;
|
||||
background: #FFFFFF;
|
||||
box-shadow: 0rpx 0rpx 12rpx 2rpx #DDECF3;
|
||||
z-index: 10;
|
||||
}
|
||||
|
||||
.option .btn {
|
||||
padding: 14rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background: #409CFF;
|
||||
color: #FFFFFF;
|
||||
border-radius: 12rpx;
|
||||
}
|
||||
|
||||
.option .btn:active {
|
||||
opacity: 0.8;
|
||||
}
|
||||
|
||||
.pop .pop-header {
|
||||
background: #cfd3d8;
|
||||
color: #222222;
|
||||
}
|
||||
184
colorui/animation.wxss
Normal file
|
|
@ -0,0 +1,184 @@
|
|||
/*
|
||||
Animation 微动画
|
||||
基于ColorUI组建库的动画模块 by 文晓港 2019年3月26日19:52:28
|
||||
*/
|
||||
|
||||
/* css 滤镜 控制黑白底色gif的 */
|
||||
.gif-black{
|
||||
mix-blend-mode: screen;
|
||||
}
|
||||
.gif-white{
|
||||
mix-blend-mode: multiply;
|
||||
}
|
||||
|
||||
|
||||
/* Animation css */
|
||||
[class*=animation-] {
|
||||
animation-duration: .5s;
|
||||
animation-timing-function: ease-out;
|
||||
animation-fill-mode: both
|
||||
}
|
||||
|
||||
.animation-fade {
|
||||
animation-name: fade;
|
||||
animation-duration: .8s;
|
||||
animation-timing-function: linear
|
||||
}
|
||||
|
||||
.animation-scale-up {
|
||||
animation-name: scale-up
|
||||
}
|
||||
|
||||
.animation-scale-down {
|
||||
animation-name: scale-down
|
||||
}
|
||||
|
||||
.animation-slide-top {
|
||||
animation-name: slide-top
|
||||
}
|
||||
|
||||
.animation-slide-bottom {
|
||||
animation-name: slide-bottom
|
||||
}
|
||||
|
||||
.animation-slide-left {
|
||||
animation-name: slide-left
|
||||
}
|
||||
|
||||
.animation-slide-right {
|
||||
animation-name: slide-right
|
||||
}
|
||||
|
||||
.animation-shake {
|
||||
animation-name: shake
|
||||
}
|
||||
|
||||
.animation-reverse {
|
||||
animation-direction: reverse
|
||||
}
|
||||
|
||||
@keyframes fade {
|
||||
0% {
|
||||
opacity: 0
|
||||
}
|
||||
|
||||
100% {
|
||||
opacity: 1
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes scale-up {
|
||||
0% {
|
||||
opacity: 0;
|
||||
transform: scale(.2)
|
||||
}
|
||||
|
||||
100% {
|
||||
opacity: 1;
|
||||
transform: scale(1)
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes scale-down {
|
||||
0% {
|
||||
opacity: 0;
|
||||
transform: scale(1.8)
|
||||
}
|
||||
|
||||
100% {
|
||||
opacity: 1;
|
||||
transform: scale(1)
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes slide-top {
|
||||
0% {
|
||||
opacity: 0;
|
||||
transform: translateY(-100%)
|
||||
}
|
||||
|
||||
100% {
|
||||
opacity: 1;
|
||||
transform: translateY(0)
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes slide-bottom {
|
||||
0% {
|
||||
opacity: 0;
|
||||
transform: translateY(100%)
|
||||
}
|
||||
|
||||
100% {
|
||||
opacity: 1;
|
||||
transform: translateY(0)
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes shake {
|
||||
|
||||
0%,
|
||||
100% {
|
||||
transform: translateX(0)
|
||||
}
|
||||
|
||||
10% {
|
||||
transform: translateX(-9px)
|
||||
}
|
||||
|
||||
20% {
|
||||
transform: translateX(8px)
|
||||
}
|
||||
|
||||
30% {
|
||||
transform: translateX(-7px)
|
||||
}
|
||||
|
||||
40% {
|
||||
transform: translateX(6px)
|
||||
}
|
||||
|
||||
50% {
|
||||
transform: translateX(-5px)
|
||||
}
|
||||
|
||||
60% {
|
||||
transform: translateX(4px)
|
||||
}
|
||||
|
||||
70% {
|
||||
transform: translateX(-3px)
|
||||
}
|
||||
|
||||
80% {
|
||||
transform: translateX(2px)
|
||||
}
|
||||
|
||||
90% {
|
||||
transform: translateX(-1px)
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes slide-left {
|
||||
0% {
|
||||
opacity: 0;
|
||||
transform: translateX(-100%)
|
||||
}
|
||||
|
||||
100% {
|
||||
opacity: 1;
|
||||
transform: translateX(0)
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes slide-right {
|
||||
0% {
|
||||
opacity: 0;
|
||||
transform: translateX(100%)
|
||||
}
|
||||
|
||||
100% {
|
||||
opacity: 1;
|
||||
transform: translateX(0)
|
||||
}
|
||||
}
|
||||
54
colorui/components/cu-custom.js
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
const app = getApp();
|
||||
Component({
|
||||
/**
|
||||
* 组件的一些选项
|
||||
*/
|
||||
options: {
|
||||
addGlobalClass: true,
|
||||
multipleSlots: true
|
||||
},
|
||||
/**
|
||||
* 组件的对外属性
|
||||
*/
|
||||
properties: {
|
||||
bgColor: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
isCustom: {
|
||||
type: [Boolean, String],
|
||||
default: false
|
||||
},
|
||||
isBack: {
|
||||
type: [Boolean, String],
|
||||
default: false
|
||||
},
|
||||
bgImage: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
},
|
||||
/**
|
||||
* 组件的初始数据
|
||||
*/
|
||||
data: {
|
||||
StatusBar: app.globalData.StatusBar,
|
||||
CustomBar: app.globalData.CustomBar,
|
||||
Custom: app.globalData.Custom
|
||||
},
|
||||
/**
|
||||
* 组件的方法列表
|
||||
*/
|
||||
methods: {
|
||||
BackPage() {
|
||||
wx.navigateBack({
|
||||
delta: 1
|
||||
});
|
||||
},
|
||||
toHome(){
|
||||
wx.reLaunch({
|
||||
url: '/pages/index/index',
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
4
colorui/components/cu-custom.json
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"component": true,
|
||||
"usingComponents": {}
|
||||
}
|
||||
16
colorui/components/cu-custom.wxml
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
<view class="cu-custom" style="height:{{CustomBar}}px">
|
||||
<view class="cu-bar fixed {{bgImage!=''?'none-bg text-white bg-img':''}} {{bgColor}}" style="height:{{CustomBar}}px;padding-top:{{StatusBar}}px;{{bgImage?'background-image:url(' + bgImage+')':''}}">
|
||||
<view class="action" bindtap="BackPage" wx:if="{{isBack}}">
|
||||
<text class="cuIcon-back text-white"></text>
|
||||
<slot name="backText"></slot>
|
||||
</view>
|
||||
<view class="action border-custom" wx:if="{{isCustom}}" style="width:{{Custom.width}}px;height:{{Custom.height}}px;margin-left:calc(750rpx - {{Custom.right}}px)">
|
||||
<text class="cuIcon-back" bindtap="BackPage"></text>
|
||||
<text class="cuIcon-homefill" bindtap="toHome"></text>
|
||||
</view>
|
||||
<view class="content" style="top:{{StatusBar}}px">
|
||||
<slot name="content"></slot>
|
||||
</view>
|
||||
<slot name="right"></slot>
|
||||
</view>
|
||||
</view>
|
||||
1
colorui/components/cu-custom.wxss
Normal file
|
|
@ -0,0 +1 @@
|
|||
/* colorui/components/cu-custom.wxss */
|
||||
1226
colorui/icon.wxss
Normal file
3941
colorui/main.wxss
Normal file
285
components/dropdownmenu/dropdownmenu.js
Normal file
|
|
@ -0,0 +1,285 @@
|
|||
Component({
|
||||
properties: {
|
||||
dropDownMenuTitle: {
|
||||
type: Array,
|
||||
value: [],
|
||||
},
|
||||
dropDownMenuDistrictData: {
|
||||
type: Array,
|
||||
value: [],
|
||||
observer: function (newVal, oldVal) {
|
||||
let model = newVal[0] ? newVal[0] : null
|
||||
this.selectDefaltDistrictLeft(model)
|
||||
}
|
||||
},
|
||||
|
||||
dropDownMenuSourceData: {
|
||||
type: Array,
|
||||
value: []
|
||||
},
|
||||
dropDownMenuStyleData: {
|
||||
type: Array,
|
||||
value: []
|
||||
},
|
||||
dropDownMenuFilterData: {
|
||||
type: Array,
|
||||
value: []
|
||||
},
|
||||
},
|
||||
data: {
|
||||
district_open: false, // 区域
|
||||
source_open: false, // 来源
|
||||
style_open: false, // 出租 出售
|
||||
filteropen: false, // 筛选
|
||||
shownavindex: '',
|
||||
dropDownMenuDistrictDataRight: {},
|
||||
district_left_select: '',
|
||||
district_right_select: '',
|
||||
district_right_select_name: '',
|
||||
selected_style_id: 0,
|
||||
selected_style_name: '',
|
||||
selected_source_id: 0,
|
||||
selected_source_name: '',
|
||||
selected_filter_id: 0,
|
||||
selected_filter_name: ''
|
||||
},
|
||||
methods: {
|
||||
tapDistrictNav: function (e) {
|
||||
if (this.data.district_open) {
|
||||
this.setData({
|
||||
district_open: false,
|
||||
source_open: false,
|
||||
style_open: false,
|
||||
filter_open: false,
|
||||
shownavindex: 0
|
||||
})
|
||||
} else {
|
||||
this.setData({
|
||||
district_open: true,
|
||||
style_open: false,
|
||||
source_open: false,
|
||||
filter_open: false,
|
||||
shownavindex: e.currentTarget.dataset.nav
|
||||
})
|
||||
}
|
||||
|
||||
},
|
||||
tapSourceNav: function (e) {
|
||||
if (this.data.source_open) {
|
||||
this.setData({
|
||||
source_open: false,
|
||||
style_open: false,
|
||||
district_open: false,
|
||||
filter_open: false,
|
||||
shownavindex: 0
|
||||
})
|
||||
} else {
|
||||
this.setData({
|
||||
source_open: true,
|
||||
style_open: false,
|
||||
district_open: false,
|
||||
filter_open: false,
|
||||
shownavindex: e.currentTarget.dataset.nav
|
||||
})
|
||||
}
|
||||
},
|
||||
tapStyleNav: function (e) {
|
||||
if (this.data.style_open) {
|
||||
this.setData({
|
||||
source_open: false,
|
||||
style_open: false,
|
||||
district_open: false,
|
||||
filter_open: false,
|
||||
shownavindex: 0
|
||||
})
|
||||
} else {
|
||||
this.setData({
|
||||
source_open: false,
|
||||
style_open: true,
|
||||
filter_open: false,
|
||||
district_open: false,
|
||||
shownavindex: e.currentTarget.dataset.nav
|
||||
})
|
||||
}
|
||||
console.log(e.target)
|
||||
},
|
||||
tapFilterNav: function (e) {
|
||||
if (this.data.filter_open) {
|
||||
this.setData({
|
||||
source_open: false,
|
||||
style_open: false,
|
||||
district_open: false,
|
||||
filter_open: false,
|
||||
shownavindex: 0
|
||||
})
|
||||
} else {
|
||||
this.setData({
|
||||
source_open: false,
|
||||
style_open: false,
|
||||
district_open: false,
|
||||
filter_open: true,
|
||||
shownavindex: e.currentTarget.dataset.nav
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
selectDefaltDistrictLeft(model) {
|
||||
if (!model) {
|
||||
return
|
||||
}
|
||||
var model = model.childModel;
|
||||
var selectedId = model.id
|
||||
var selectedTitle = model.title;
|
||||
this.setData({
|
||||
dropDownMenuDistrictDataRight: model ? model : '',
|
||||
district_left_select: selectedId,
|
||||
district_right_select: '',
|
||||
})
|
||||
},
|
||||
|
||||
selectDistrictLeft: function (e) {
|
||||
var model = e.target.dataset.model.childModel;
|
||||
var selectedId = e.target.dataset.model.id
|
||||
var selectedTitle = e.target.dataset.model.title;
|
||||
this.setData({
|
||||
dropDownMenuDistrictDataRight: model ? model : '',
|
||||
district_left_select: selectedId,
|
||||
district_right_select: '',
|
||||
})
|
||||
},
|
||||
|
||||
selectDistrictRight: function (e) {
|
||||
var selectedId = e.target.dataset.model.id
|
||||
var selectedTitle = e.target.dataset.model.title;
|
||||
this.closeHyFilter();
|
||||
this.setData({
|
||||
district_right_select: selectedId,
|
||||
district_right_select_name: selectedTitle
|
||||
})
|
||||
this.triggerEvent("selectedItem", {
|
||||
index: this.data.shownavindex,
|
||||
selectedId: selectedId,
|
||||
selectedTitle: selectedTitle
|
||||
})
|
||||
},
|
||||
|
||||
selectSourceItem: function (e) {
|
||||
var selectedId = e.target.dataset.model.id
|
||||
var selectedTitle = e.target.dataset.model.title;
|
||||
this.closeHyFilter();
|
||||
this.setData({
|
||||
selected_source_id: selectedId,
|
||||
selected_source_name: selectedTitle
|
||||
})
|
||||
this.triggerEvent("selectedItem", {
|
||||
index: this.data.shownavindex,
|
||||
selectedId: selectedId,
|
||||
selectedTitle: selectedTitle
|
||||
})
|
||||
},
|
||||
|
||||
selectFilterItem: function (e) {
|
||||
var selectedId = e.target.dataset.model.id
|
||||
var selectedTitle = e.target.dataset.model.title;
|
||||
this.closeHyFilter();
|
||||
this.setData({
|
||||
selected_filter_id: selectedId,
|
||||
selected_filter_name: selectedTitle
|
||||
})
|
||||
this.triggerEvent("selectedItem", {
|
||||
index: this.data.shownavindex,
|
||||
selectedId: selectedId,
|
||||
selectedTitle: selectedTitle
|
||||
})
|
||||
},
|
||||
|
||||
selectStyleItem: function (e) {
|
||||
var selectedId = e.target.dataset.model.id
|
||||
var selectedTitle = e.target.dataset.model.title;
|
||||
this.closeHyFilter();
|
||||
this.setData({
|
||||
selected_style_id: selectedId,
|
||||
selected_style_name: selectedTitle
|
||||
})
|
||||
this.triggerEvent("selectedItem", {
|
||||
index: this.data.shownavindex,
|
||||
selectedId: selectedId,
|
||||
selectedTitle: selectedTitle
|
||||
})
|
||||
},
|
||||
|
||||
/**关闭筛选 */
|
||||
closeHyFilter: function () {
|
||||
if (this.data.district_open) {
|
||||
this.setData({
|
||||
district_open: false,
|
||||
source_open: false,
|
||||
style_open: false,
|
||||
filter_open: false,
|
||||
})
|
||||
} else if (this.data.source_open) {
|
||||
this.setData({
|
||||
source_open: false,
|
||||
style_open: false,
|
||||
district_open: false,
|
||||
filter_open: false,
|
||||
})
|
||||
} else if (this.data.style_open) {
|
||||
this.setData({
|
||||
source_open: false,
|
||||
style_open: false,
|
||||
district_open: false,
|
||||
filter_open: false,
|
||||
})
|
||||
} else if (this.data.filter_open) {
|
||||
this.setData({
|
||||
source_open: false,
|
||||
style_open: false,
|
||||
district_open: false,
|
||||
filter_open: false,
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
/**重设值 */
|
||||
resetMenu: function (index) {
|
||||
switch (index) {
|
||||
case 0:
|
||||
this.data.district_right_select_name = ""
|
||||
this.data.district_left_select = ""
|
||||
this.data.district_right_select = ""
|
||||
break;
|
||||
case 1:
|
||||
this.data.selected_source_name = ""
|
||||
this.data.selected_source_id = ""
|
||||
break;
|
||||
case 2:
|
||||
this.data.selected_style_name = ""
|
||||
this.data.selected_style_id = ""
|
||||
break;
|
||||
case 3:
|
||||
this.data.selected_filter_name = ""
|
||||
this.data.selected_filter_id = ""
|
||||
break;
|
||||
}
|
||||
this.setData(this.data)
|
||||
},
|
||||
|
||||
/**关闭弹窗 */
|
||||
close: function (params) {
|
||||
this.setData({
|
||||
district_open: false,
|
||||
source_open: false,
|
||||
style_open: false,
|
||||
filter_open: false,
|
||||
})
|
||||
}
|
||||
},
|
||||
//组件生命周期函数,在组件实例进入页面节点树时执行
|
||||
attached: function () {
|
||||
|
||||
|
||||
},
|
||||
|
||||
})
|
||||
3
components/dropdownmenu/dropdownmenu.json
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"component": true
|
||||
}
|
||||
59
components/dropdownmenu/dropdownmenu.wxml
Normal file
|
|
@ -0,0 +1,59 @@
|
|||
<view class="nav">
|
||||
<view class="nav-child {{district_open? 'active' : ''}}" bindtap="tapDistrictNav" hidden='{{dropDownMenuDistrictData.length > 0 ? false :true}}' data-nav="1">
|
||||
<view class="nav-title">{{district_right_select_name.length > 0 ?district_right_select_name : dropDownMenuTitle[0]}}</view>
|
||||
<view class="icon"></view>
|
||||
</view>
|
||||
<view class="nav-child borders {{source_open? 'active' : ''}}" bindtap="tapSourceNav" hidden='{{dropDownMenuSourceData.length > 0 ? false : true}}' data-nav="2">
|
||||
<view class="nav-title">{{selected_source_name.length > 0 ?selected_source_name : dropDownMenuTitle[1]}}</view>
|
||||
<view class="icon"></view>
|
||||
</view>
|
||||
<view class="nav-child borders-right {{style_open? 'active' : ''}}" bindtap="tapStyleNav" hidden='{{dropDownMenuStyleData.length > 0 ? false : true}}' data-nav="3">
|
||||
<view class="nav-title">{{selected_style_name.length > 0 ?selected_style_name : dropDownMenuTitle[2]}}</view>
|
||||
<view class="icon"></view>
|
||||
</view>
|
||||
<view class="nav-child {{filter_open ? 'active' : ''}}" bindtap="tapFilterNav" hidden='{{dropDownMenuFilterData.length > 0 ? false : true}}' data-nav="4">
|
||||
<view class="nav-title">{{selected_filter_name.length > 0 ?selected_filter_name : dropDownMenuTitle[3]}}</view>
|
||||
<view class="icon"></view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view catchtap="close" class="district {{district_open ? 'show' : 'disappear'}} ">
|
||||
<view class="half half-left">
|
||||
<view class="{{district_left_select == item.id ? 'current_left_select' : ''}}" wx:for="{{dropDownMenuDistrictData}}" bindtap="selectDistrictLeft" data-model='{{item}}' wx:key="unique">
|
||||
{{item.title}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="half half-right">
|
||||
<view class="{{district_right_select == item.id ? 'current_right_select' : ''}}" wx:for="{{dropDownMenuDistrictDataRight}}" bindtap="selectDistrictRight" data-model='{{item}}' wx:key="unique">
|
||||
{{item.title}}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view catchtap="close" class="container container_hd {{source_open ? 'show' : 'disappear'}} ">
|
||||
<view class='z-height'>
|
||||
<view>
|
||||
<block wx:for="{{dropDownMenuSourceData}}" wx:key="unique">
|
||||
<view class="sortitem {{selected_source_id==item.id ? ' active ' : ' '}}" data-model='{{item}}' bindtap='selectSourceItem'> {{item.title}}</view>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view catchtap="close" class="container container_hd {{style_open ? 'show' : 'disappear'}} ">
|
||||
<view class='z-height'>
|
||||
<view>
|
||||
<block wx:for="{{dropDownMenuStyleData}}" wx:key="unique">
|
||||
<view class="sortitem {{selected_style_id==item.id ? ' active ' : ' '}}" data-model='{{item}}' bindtap='selectStyleItem'> {{item.title}}</view>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view catchtap="close" class="container container_hd {{filter_open ? 'show' : 'disappear'}} ">
|
||||
<view class='z-height'>
|
||||
<view>
|
||||
<block wx:for="{{dropDownMenuFilterData}}" wx:key="unique">
|
||||
<view class="sortitem {{selected_filter_id==item.id ? ' active ' : ' '}}" data-model='{{item}}' bindtap='selectFilterItem'> {{item.title}}</view>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
234
components/dropdownmenu/dropdownmenu.wxss
Normal file
|
|
@ -0,0 +1,234 @@
|
|||
.page {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: #fff;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.position {
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
.nav {
|
||||
position: sticky;
|
||||
top: 0;
|
||||
z-index: 99;
|
||||
display: flex;
|
||||
border-bottom: 1px solid #f7f7f7;
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
.nav-child {
|
||||
display: flex;
|
||||
flex: 1;
|
||||
text-align: center;
|
||||
height: 48rpx;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 28rpx;
|
||||
margin: 20rpx 0;
|
||||
}
|
||||
|
||||
.borders-right {
|
||||
border-right: 1px solid #e6e6e6;
|
||||
}
|
||||
|
||||
.borders-left {
|
||||
border-left: 1px solid #e6e6e6;
|
||||
}
|
||||
|
||||
.borders {
|
||||
border-left: 1px solid #e6e6e6;
|
||||
border-right: 1px solid #e6e6e6;
|
||||
}
|
||||
|
||||
.nav-title {
|
||||
display: inline-block;
|
||||
font-size: 32rpx !important;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.icon {
|
||||
display: inline-block;
|
||||
border: 4px solid transparent;
|
||||
border-top: 4px solid #9b9b9b;
|
||||
margin-left: 5px;
|
||||
margin-top: 10rpx;
|
||||
}
|
||||
|
||||
.container {
|
||||
position: relative;
|
||||
z-index: 4;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
|
||||
.slidedown {
|
||||
transform: translateY(0%);
|
||||
}
|
||||
|
||||
.district {
|
||||
position: absolute;
|
||||
display: none;
|
||||
z-index: 5;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background-color: rgba(0, 0, 0, 0.5);
|
||||
}
|
||||
|
||||
.district .half {
|
||||
overflow-y: scroll;
|
||||
float: left;
|
||||
width: 50%;
|
||||
height: 600rpx;
|
||||
line-height: 80rpx;
|
||||
box-sizing: border-box;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.half view {
|
||||
text-overflow: ellipsis;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
padding-left: 15rpx;
|
||||
}
|
||||
|
||||
.half-left {
|
||||
background: #f7f7f7;
|
||||
}
|
||||
|
||||
.half-center {
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
.half-right {
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
.half-right view {
|
||||
border-bottom: 1px solid #f7f7f7;
|
||||
}
|
||||
|
||||
.current_left_select {
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
.current_right_select {
|
||||
background: #fff;
|
||||
color: #2B56E6;
|
||||
}
|
||||
|
||||
.nav-child.active .nav-title {
|
||||
color: #2B56E6;
|
||||
}
|
||||
|
||||
.nav-child.active .icon {
|
||||
border-bottom: 4px solid #2B56E6;
|
||||
border-top: 0;
|
||||
}
|
||||
|
||||
@keyframes slidown {
|
||||
from {
|
||||
transform: translateY(-100%);
|
||||
}
|
||||
|
||||
to {
|
||||
transform: translateY(0%);
|
||||
}
|
||||
}
|
||||
|
||||
.slidown {
|
||||
display: block;
|
||||
animation: slidown 0.2s ease-in both;
|
||||
}
|
||||
|
||||
@keyframes slidup {
|
||||
from {
|
||||
transform: translateY(0%);
|
||||
}
|
||||
|
||||
to {
|
||||
transform: translateY(-100%);
|
||||
}
|
||||
}
|
||||
|
||||
.z-height {
|
||||
overflow-y: scroll;
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
.slidup {
|
||||
display: block;
|
||||
animation: slidup 0.2s ease-in both;
|
||||
}
|
||||
|
||||
.disappear {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.show {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.slidowntop {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
padding: 20rpx 24rpx 10rpx 24rpx;
|
||||
}
|
||||
|
||||
.emptyall {
|
||||
margin-left: 475rpx;
|
||||
color: #2B56E6;
|
||||
}
|
||||
|
||||
.emptyallright {
|
||||
width: 80rpx;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.endselect {
|
||||
width: 350rpx;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.return {
|
||||
margin-left: 200rpx;
|
||||
color: #2B56E6;
|
||||
}
|
||||
|
||||
.slidowncenter {
|
||||
margin-top: 20rpx;
|
||||
padding-top: 20rpx;
|
||||
padding-left: 24rpx;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-content: space-between;
|
||||
border-top: solid #d1d3d4 1rpx;
|
||||
}
|
||||
|
||||
.slidownbottom {
|
||||
margin-top: 10rpx;
|
||||
padding: 10rpx;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.sortitem {
|
||||
border-bottom: solid #f7f7f7 1rpx;
|
||||
justify-content: space-between;
|
||||
padding: 20rpx 30rpx;
|
||||
}
|
||||
|
||||
.sortitem.active {
|
||||
color: #2B56E6;
|
||||
}
|
||||
|
||||
.container_hd {
|
||||
width: 100vw;
|
||||
height: calc(100vh - 185rpx - env(safe-area-inset-bottom));
|
||||
height: calc(100vh - 185rpx - constant(safe-area-inset-bottom));
|
||||
position: fixed;
|
||||
overflow-y: scroll;
|
||||
background-color: rgba(0, 0, 0, 0.5);
|
||||
}
|
||||
28
components/empty/empty.js
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
// pages/components/empty.js
|
||||
Component({
|
||||
/**
|
||||
* 组件的属性列表
|
||||
*/
|
||||
properties: {
|
||||
src: {
|
||||
type: String,
|
||||
value: '/images/empty.png'
|
||||
},
|
||||
tips: {
|
||||
type: String,
|
||||
value: ''
|
||||
},
|
||||
},
|
||||
|
||||
/**
|
||||
* 组件的初始数据
|
||||
*/
|
||||
data: {},
|
||||
|
||||
/**
|
||||
* 组件的方法列表
|
||||
*/
|
||||
methods: {
|
||||
|
||||
}
|
||||
})
|
||||
4
components/empty/empty.json
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"component": true,
|
||||
"usingComponents": {}
|
||||
}
|
||||
5
components/empty/empty.wxml
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
<!--pages/components/empty.wxml-->
|
||||
<view class="empty-content">
|
||||
<image class="image" src="{{src}}" mode="aspectFit"></image>
|
||||
<text class="text">{{tips}}</text>
|
||||
</view>
|
||||
18
components/empty/empty.wxss
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
/* pages/components/empty.wxss */
|
||||
.empty-content {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex-direction: column;
|
||||
background-color: #f5f5f5;
|
||||
}
|
||||
|
||||
.image {
|
||||
width: 50vw;
|
||||
padding: 20rpx;
|
||||
}
|
||||
|
||||
.text {
|
||||
font-size: 30rpx;
|
||||
color: #B3B3B3;
|
||||
}
|
||||
73
components/pop-sheet/index.js
Normal file
|
|
@ -0,0 +1,73 @@
|
|||
// components/pop-sheet/index.js
|
||||
Component({
|
||||
/**
|
||||
* 组件的属性列表
|
||||
*/
|
||||
properties: {
|
||||
show: Boolean,
|
||||
multiple: {
|
||||
type: Boolean,
|
||||
value: false
|
||||
},
|
||||
title: String,
|
||||
proName: String,
|
||||
single: String,
|
||||
outSide: Array,
|
||||
list: Array
|
||||
},
|
||||
|
||||
/**
|
||||
* 组件的初始数据
|
||||
*/
|
||||
data: {
|
||||
item: {}
|
||||
},
|
||||
|
||||
/**
|
||||
* 组件的方法列表
|
||||
*/
|
||||
methods: {
|
||||
/**
|
||||
* 关闭弹窗
|
||||
*/
|
||||
close: function () {
|
||||
this.triggerEvent('close', {
|
||||
item: this.data.multiple ? this.data.list.filter(item => {
|
||||
return item.checked
|
||||
}) : this.data.item,
|
||||
single: this.data.single
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 选中列表
|
||||
*/
|
||||
filterFun: function (params) {
|
||||
const item = params.currentTarget.dataset.item;
|
||||
const index = params.currentTarget.dataset.index;
|
||||
item.checked = !item.checked;
|
||||
this.data.outSide?.forEach(el => {
|
||||
if (item[this.data.proName] == el) {
|
||||
this.data.list.forEach(ele => {
|
||||
ele.checked = false;
|
||||
})
|
||||
} else {
|
||||
this.data.list.filter(els => {
|
||||
if (els[this.data.proName] == el) els.checked = false
|
||||
})
|
||||
}
|
||||
})
|
||||
this.data.item = item;
|
||||
this.data.list[index] = item;
|
||||
this.setData(this.data)
|
||||
if (!this.data.multiple) this.close();
|
||||
},
|
||||
|
||||
/**
|
||||
* 确定/取消
|
||||
*/
|
||||
submit: function (params) {
|
||||
this.close();
|
||||
},
|
||||
}
|
||||
})
|
||||
4
components/pop-sheet/index.json
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"component": true,
|
||||
"usingComponents": {}
|
||||
}
|
||||
22
components/pop-sheet/index.wxml
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
<!--components/pop-sheet/index.wxml-->
|
||||
<view catchtap="close" data-type="{{single}}" class="cu-modal center-modal {{show?'show':''}}">
|
||||
<view class="cu-dialog pop" style="overflow-y: hidden;">
|
||||
<view class="cu-bar justify-end pop-header">
|
||||
<view class="content">{{title}}</view>
|
||||
<view class="action" catchtap="close" data-type="{{single}}">
|
||||
<text class="cuIcon-close text-red"></text>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 列表 -->
|
||||
<view style="max-height: 40vh;overflow-y: scroll;">
|
||||
<view catchtap="filterFun" data-type="{{single}}" data-item="{{item}}" data-index="{{index}}" class="item-pop" wx:for="{{list}}">
|
||||
<text wx:if="{{item.checked}}" class="cuIcon-radiobox box text-blue"></text>
|
||||
<text class="name">{{item[proName]||item}}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view wx:if="{{multiple}}" class="h-div pop-option">
|
||||
<view class="btn cancle" catchtap="submit">取消</view>
|
||||
<view class="btn sub" catchtap="submit">确定</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
47
components/pop-sheet/index.wxss
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
/* components/pop-sheet/index.wxss */
|
||||
@import "/colorui/main.wxss";
|
||||
@import "/colorui/icon.wxss";
|
||||
@import "/app.wxss";
|
||||
|
||||
.box {
|
||||
position: absolute;
|
||||
left: 5%;
|
||||
}
|
||||
|
||||
.pop {
|
||||
max-height: 50vh;
|
||||
overflow-y: scroll;
|
||||
}
|
||||
|
||||
.pop .item-pop {
|
||||
padding: 20rpx;
|
||||
border-bottom: 1rpx dashed #f5f5f5;
|
||||
}
|
||||
|
||||
.pop-option {
|
||||
background-color: #f5f5f5;
|
||||
height: 80rpx;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.pop-option .btn {
|
||||
flex: 1;
|
||||
font-size: 30rpx;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.pop-option .sub {
|
||||
color: var(--blue) !important;
|
||||
}
|
||||
|
||||
.pop-option .sub::before {
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
content: ' ';
|
||||
width: 1rpx;
|
||||
height: 70%;
|
||||
background-color: #e5e5e5;
|
||||
}
|
||||
171
components/signature/signature.js
Normal file
|
|
@ -0,0 +1,171 @@
|
|||
// components/autograph/index.js
|
||||
Component({
|
||||
lifetimes: {
|
||||
attached: function () {
|
||||
this.initCanvas();
|
||||
},
|
||||
detached: function () {
|
||||
// 在组件实例被从页面节点树移除时执行
|
||||
},
|
||||
},
|
||||
|
||||
/**
|
||||
* 组件的属性列表
|
||||
*/
|
||||
properties: {
|
||||
width: {
|
||||
type: String,
|
||||
value: 'calc(100vw - 32rpx)'
|
||||
},
|
||||
height: {
|
||||
type: String,
|
||||
value: '100%'
|
||||
},
|
||||
lineWidth: {
|
||||
type: Number,
|
||||
value: 4
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 组件的初始数据
|
||||
*/
|
||||
data: {
|
||||
isDraw: false, // 是否能画画
|
||||
canvasElement: null,
|
||||
canvasContext: null,
|
||||
oldPosition: {
|
||||
x: 0,
|
||||
y: 0
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 组件的方法列表
|
||||
*/
|
||||
methods: {
|
||||
// 初始化canvas
|
||||
initCanvas(fn) {
|
||||
const query = wx.createSelectorQuery().in(this)
|
||||
query.select('.autograph-canvas').fields({
|
||||
node: true,
|
||||
size: true,
|
||||
context: true
|
||||
}).exec(res => {
|
||||
const canvas = res[0].node
|
||||
const context = canvas.getContext('2d')
|
||||
const dpr = wx.getSystemInfoSync().pixelRatio
|
||||
canvas.width = res[0].width * dpr
|
||||
canvas.height = res[0].height * dpr
|
||||
context.scale(dpr, dpr)
|
||||
this.setData({
|
||||
canvasElement: canvas,
|
||||
canvasContext: context,
|
||||
}, function () {
|
||||
if (typeof fn == 'function') {
|
||||
fn()
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
// 描绘canvas
|
||||
drawCanvas(position) {
|
||||
if (this.data.canvasContext) {
|
||||
|
||||
this.data.canvasContext.strokeStyle = this.properties.lineColor
|
||||
this.data.canvasContext.lineWidth = this.properties.lineWidth
|
||||
|
||||
this.data.canvasContext.beginPath()
|
||||
this.data.canvasContext.moveTo(this.data.oldPosition.x, this.data.oldPosition.y)
|
||||
this.data.canvasContext.lineTo(position.x, position.y)
|
||||
this.data.canvasContext.stroke()
|
||||
this.data.canvasContext.closePath();
|
||||
|
||||
this.setData({
|
||||
oldPosition: {
|
||||
x: position.x,
|
||||
y: position.y
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
// 在画布触摸开始
|
||||
handleTouchStart(e) {
|
||||
var self = this;
|
||||
const x = e.touches[0].x;
|
||||
const y = e.touches[0].y;
|
||||
self.setData({
|
||||
oldPosition: {
|
||||
x: x,
|
||||
y: y
|
||||
},
|
||||
}, () => {
|
||||
self.setData({
|
||||
isDraw: true,
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
},
|
||||
// 在画布触摸移动
|
||||
handleTouchMove(e) {
|
||||
if (this.data.isDraw) {
|
||||
let positionItem = e.touches[0]
|
||||
if (this.data.canvasContext) {
|
||||
this.drawCanvas(positionItem, true)
|
||||
} else {
|
||||
this.initCanvas(() => {
|
||||
this.drawCanvas(positionItem, true)
|
||||
})
|
||||
}
|
||||
}
|
||||
},
|
||||
// 在画布触摸结束
|
||||
handleTouchEnd() {
|
||||
this.setData({
|
||||
isDraw: false
|
||||
})
|
||||
},
|
||||
// 清除画布
|
||||
clearCanvas() {
|
||||
if (this.data.canvasElement) {
|
||||
const x = this.data.canvasElement.width
|
||||
const y = this.data.canvasElement.height
|
||||
this.data.canvasContext.clearRect(0, 0, x, y)
|
||||
}
|
||||
|
||||
},
|
||||
// 获取画布的base64
|
||||
getCanvasBase64() {
|
||||
if (this.data.canvasElement) {
|
||||
const pngPic = this.data.canvasElement.toDataURL()
|
||||
return pngPic
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
},
|
||||
// 获取临时文件
|
||||
getCavasTempFile() {
|
||||
return new Promise((resolve, reject) => {
|
||||
wx.canvasToTempFilePath({
|
||||
x: 0,
|
||||
y: 0,
|
||||
// width: this.properties.width,
|
||||
// height: this.properties.height,
|
||||
|
||||
// destWidth:this.properties.width,
|
||||
// destHeight:this.properties.height,
|
||||
|
||||
canvas: this.data.canvasElement,
|
||||
success: (res) => {
|
||||
resolve(res)
|
||||
},
|
||||
fail: () => {
|
||||
reject('图片临时文件生成失败')
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
4
components/signature/signature.json
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"component": true,
|
||||
"usingComponents": {}
|
||||
}
|
||||
3
components/signature/signature.wxml
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
<view class="autograph-container" style="width: {{ width }}; height: {{ height }};">
|
||||
<canvas id="canvas" class="autograph-canvas" type="2d" disable-scroll style="width: 100%; height: 100%;" bindtouchstart="handleTouchStart" bindtouchmove="handleTouchMove" bindtouchend="handleTouchEnd" bindtouchcancel="handleTouchEnd" binderror="handleTouchEnd"></canvas>
|
||||
</view>
|
||||
8
components/signature/signature.wxss
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
/* components/signature/signature.wxss */
|
||||
.autograph-container {
|
||||
margin: 16rpx;
|
||||
padding: 16rpx;
|
||||
background-color: #ffffff;
|
||||
border-radius: 10rpx;
|
||||
border: 1rpx dashed #f5f5f5;
|
||||
}
|
||||
26
components/title-bar/index.js
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
// components/title-bar/index.js
|
||||
Component({
|
||||
/**
|
||||
* 组件的属性列表
|
||||
*/
|
||||
properties: {
|
||||
title: {
|
||||
type: String,
|
||||
value: ''
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 组件的初始数据
|
||||
*/
|
||||
data: {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 组件的方法列表
|
||||
*/
|
||||
methods: {
|
||||
|
||||
}
|
||||
})
|
||||
4
components/title-bar/index.json
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"component": true,
|
||||
"usingComponents": {}
|
||||
}
|
||||
5
components/title-bar/index.wxml
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
<!--components/title-bar/index.wxml-->
|
||||
<image class="title-bar-img" src="/images/home/icon_top-bg.png" mode="aspectFill" />
|
||||
<cu-custom isBack="{{true}}">
|
||||
<view slot="content" class="text-white">{{title}}</view>
|
||||
</cu-custom>
|
||||
14
components/title-bar/index.wxss
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
/* components/title-bar/index.wxss */
|
||||
.title-bar-img {
|
||||
width: 100vw;
|
||||
height: 300rpx;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
z-index: -1;
|
||||
}
|
||||
|
||||
.text-white {
|
||||
font-size: 32rpx;
|
||||
color: white;
|
||||
font-weight: bold;
|
||||
}
|
||||
243
components/tree/index.js
Normal file
|
|
@ -0,0 +1,243 @@
|
|||
// components/tree/index.js
|
||||
Component({
|
||||
/**
|
||||
* 组件的属性列表
|
||||
*/
|
||||
properties: {
|
||||
dataTree: {
|
||||
type: Array,
|
||||
value: []
|
||||
},
|
||||
pros: {
|
||||
type: Object,
|
||||
value: {
|
||||
key: 'name',
|
||||
val: 'id'
|
||||
}
|
||||
},
|
||||
checkrule: {
|
||||
type: Array,
|
||||
value: []
|
||||
},
|
||||
treeListIndex: { // 当期树形列表的索引
|
||||
type: Number,
|
||||
value: 1
|
||||
},
|
||||
isOpenAll: { // 是否展开全部节点
|
||||
type: Boolean,
|
||||
value: false
|
||||
}
|
||||
},
|
||||
observers: {
|
||||
'dataTree': function (params) {
|
||||
var arr = []
|
||||
if (this.properties.checkrule.length > 0) {
|
||||
this.setData({
|
||||
allChoiceIdList: this.properties.checkrule
|
||||
})
|
||||
arr = this.showcheck(params)
|
||||
} else {
|
||||
arr = params
|
||||
}
|
||||
this.setData({
|
||||
tree: this._initSourceData(arr),
|
||||
})
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 组件的初始数据
|
||||
*/
|
||||
data: {
|
||||
tree: [],
|
||||
allChoiceIdList: [] // 所有选中的id数组
|
||||
},
|
||||
/**
|
||||
* 组件的方法列表
|
||||
*/
|
||||
methods: {
|
||||
isOpen(e) {
|
||||
const open = 'tree[' + e.currentTarget.dataset.index + '].open'
|
||||
this.setData({
|
||||
[open]: !this.data.tree[e.currentTarget.dataset.index].open
|
||||
})
|
||||
},
|
||||
_initSourceData(nodes) {
|
||||
nodes.forEach(element => {
|
||||
if (element.checked === undefined) element.checked = 0
|
||||
element.open = this.properties.isOpenAll // 是否展开
|
||||
if (element.children && element.children.length > 0) element.children = this._initSourceData(element.children)
|
||||
})
|
||||
return nodes
|
||||
|
||||
|
||||
},
|
||||
// 选择
|
||||
select(e) {
|
||||
let item = e.currentTarget.dataset.item
|
||||
item = this._handleClickItem(item)
|
||||
console.log('当前节点:', item)
|
||||
this.data.tree = this._updateTree(this.data.tree, item)
|
||||
this.setData({
|
||||
tree: this.data.tree
|
||||
})
|
||||
this.data.allChoiceIdList = this.getAllChoiceId(this.data.tree)
|
||||
this.triggerEvent('select', {
|
||||
item: item,
|
||||
idList: this.data.allChoiceIdList
|
||||
}, {
|
||||
bubbles: true,
|
||||
composed: true
|
||||
})
|
||||
this.triggerEvent('clickItem', {
|
||||
item: item
|
||||
}, {
|
||||
bubbles: true,
|
||||
composed: true
|
||||
})
|
||||
},
|
||||
// 选择冒泡事件
|
||||
handleSelect(e) {
|
||||
let parent = e.currentTarget.dataset.parent
|
||||
let currentTap = e.detail.item
|
||||
console.log('parent节点:', parent)
|
||||
// 修正它的父节点
|
||||
parent.children = this._updateTree(parent.children, currentTap)
|
||||
const {
|
||||
half,
|
||||
all,
|
||||
none
|
||||
} = this.getChildState(parent.children)
|
||||
if (half) parent.checked = -1
|
||||
if (all) parent.checked = 1
|
||||
if (none) parent.checked = 0
|
||||
// 修正整个tree
|
||||
this.data.tree = this._updateTree(this.data.tree, parent)
|
||||
this.data.allChoiceIdList = this.getAllChoiceId(this.data.tree)
|
||||
this.setData({
|
||||
tree: this.data.tree,
|
||||
idList: this.data.allChoiceIdList
|
||||
})
|
||||
this.triggerEvent('select', {
|
||||
item: parent,
|
||||
idList: this.data.allChoiceIdList
|
||||
}, {
|
||||
bubbles: true,
|
||||
composed: true
|
||||
})
|
||||
},
|
||||
/**
|
||||
* @method 处理点击选择
|
||||
* @param {Object} node 节点对象
|
||||
* @returns {Object} node 处理完毕的节点
|
||||
* @description 有子节点则全选中或全取消,当前为最底层单节点则选中或单取消
|
||||
*/
|
||||
_handleClickItem(node) {
|
||||
switch (node.checked) {
|
||||
case 0:
|
||||
node.checked = 1
|
||||
if (node.children && node.children.length > 0) node.children = this._allChoice(node.children)
|
||||
break;
|
||||
case 1:
|
||||
node.checked = 0
|
||||
if (node.children && node.children.length > 0) node.children = this._allCancel(node.children)
|
||||
break;
|
||||
default:
|
||||
node.checked = 1
|
||||
if (node.children && node.children.length > 0) node.children = this._allChoice(node.children)
|
||||
break;
|
||||
}
|
||||
return node
|
||||
},
|
||||
/**
|
||||
* @method 全选
|
||||
* @param {Array} nodes 节点数组
|
||||
* @returns {Array} nodes 处理完毕的节点数组
|
||||
*/
|
||||
_allChoice(nodes) {
|
||||
if (nodes.length <= 0) return
|
||||
for (let i = 0; i < nodes.length; i++) {
|
||||
nodes[i].checked = 1
|
||||
if (nodes[i].children && nodes[i].children.length > 0) nodes[i].children = this._allChoice(nodes[i].children)
|
||||
}
|
||||
return nodes
|
||||
},
|
||||
/**
|
||||
* @method 全取消
|
||||
* @param {Array} nodes 节点数组
|
||||
* @returns {Array} nodes 处理完毕的节点数组
|
||||
*/
|
||||
_allCancel(nodes) {
|
||||
if (nodes.length <= 0) return
|
||||
for (let i = 0; i < nodes.length; i++) {
|
||||
nodes[i].checked = 0
|
||||
if (nodes[i].children && nodes[i].children.length > 0) nodes[i].children = this._allCancel(nodes[i].children)
|
||||
}
|
||||
return nodes
|
||||
},
|
||||
/**
|
||||
* @method 更新tree
|
||||
* @param {Array} tree 节点树
|
||||
* @param {Object} newItem 需要替换新节点
|
||||
* @description 找到tree中目标进行替换
|
||||
*/
|
||||
_updateTree(tree, newItem) {
|
||||
if (!tree || tree.length <= 0) return
|
||||
for (let i = 0; i < tree.length; i++) {
|
||||
if (tree[i][this.properties.pros.val] === newItem[this.properties.pros.val]) {
|
||||
tree[i] = newItem
|
||||
break
|
||||
} else {
|
||||
if (tree[i].children && tree[i].children.length > 0) {
|
||||
tree[i].children = this._updateTree(tree[i].children, newItem)
|
||||
}
|
||||
}
|
||||
}
|
||||
return tree
|
||||
},
|
||||
/**
|
||||
* @method 获取子节点的状态
|
||||
* @param {Array} node 节点数组
|
||||
*/
|
||||
getChildState(node) {
|
||||
let all = true;
|
||||
let none = true;
|
||||
for (let i = 0, j = node.length; i < j; i++) {
|
||||
const n = node[i];
|
||||
if (n.checked === 1 || n.checked === -1) {
|
||||
none = none && false;
|
||||
}
|
||||
if (n.checked === 0 || n.checked === -1) {
|
||||
all = all && false
|
||||
}
|
||||
}
|
||||
return {
|
||||
all,
|
||||
none,
|
||||
half: !all && !none
|
||||
};
|
||||
},
|
||||
// 获取所有选中的节点id
|
||||
getAllChoiceId(nodes, res = []) {
|
||||
for (let i = 0; i < nodes.length; i++) {
|
||||
if (nodes[i].checked === 1) res.push(nodes[i][this.properties.pros.val])
|
||||
if (nodes[i].children && nodes[i].children.length > 0) this.getAllChoiceId(nodes[i].children, res)
|
||||
}
|
||||
return res
|
||||
},
|
||||
|
||||
//回显选中的
|
||||
showcheck(nodes) {
|
||||
for (let i = 0; i < nodes.length; i++) {
|
||||
if (this.properties.checkrule.indexOf(nodes[i][this.properties.pros.val]) > -1) {
|
||||
nodes[i].checked = 1
|
||||
}
|
||||
if (nodes[i].children && nodes[i].children.length > 0) this.showcheck(nodes[i].children)
|
||||
}
|
||||
return nodes
|
||||
},
|
||||
|
||||
getData() {
|
||||
return this.data.tree
|
||||
}
|
||||
}
|
||||
})
|
||||
6
components/tree/index.json
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"component": true,
|
||||
"usingComponents": {
|
||||
"tree": "./index"
|
||||
}
|
||||
}
|
||||
17
components/tree/index.wxml
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
<!--components/tree/index.wxml-->
|
||||
<view wx:for="{{tree}}" wx:key="id" class="tree_container">
|
||||
<!-- 一级菜单 -->
|
||||
<view style="margin-left: {{treeListIndex*40}}rpx" class="tree-item">
|
||||
<view class="tree-item-onOff" wx:if="{{item.children && item.children.length > 0}}" catchtap="isOpen" data-index="{{index}}">
|
||||
<image src="/images/expand.png" class="expand {{item.open ? '' : 'collapse'}}" />
|
||||
</view>
|
||||
<view class="tree-item-onOff" wx:else></view>
|
||||
<view class="tree-item-name" catchtap="select" data-item="{{item}}" data-index="{{index}}">
|
||||
<image wx:if="{{item.checked == 1}}" src="/images/checkbox-checked.png" class="check-box"></image>
|
||||
<image wx:if="{{item.checked == 0||item.checked==-1}}" src="/images/checkbox.png" class="check-box"></image>
|
||||
<text class="tree-item-title {{item.checked === 1 ? 'tree-item-name-select' : '' }}">{{item[pros.key]}}</text>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 二级菜单 -->
|
||||
<tree wx:if="{{item.children && item.children.length > 0 && item.open }}" data-parent="{{item}}" dataTree='{{ item.children }}' isOpenAll="{{isOpenAll}}" treeListIndex="{{treeListIndex+1}}" catch:select="handleSelect" pros="{{pros}}" />
|
||||
</view>
|
||||
58
components/tree/index.wxss
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
/* components/tree/index.wxss */
|
||||
/* modules/attestation/pages/checkrule/index.wxss */
|
||||
.tree_container {
|
||||
width: auto;
|
||||
box-sizing: border-box;
|
||||
overflow: scroll;
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
.tree-item {
|
||||
width: auto;
|
||||
box-sizing: border-box;
|
||||
overflow-x: scroll;
|
||||
padding: 10rpx 0;
|
||||
display: flex;
|
||||
justify-content: flex-start;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.tree-item-name {
|
||||
display: flex;
|
||||
justify-content: flex-start;
|
||||
align-items: center;
|
||||
flex: 8;
|
||||
}
|
||||
|
||||
.tree-item-title {
|
||||
margin-left: 24rpx;
|
||||
color: #1c2438;
|
||||
font-size: 32rpx;
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
.tree-item-onOff {
|
||||
width: 40rpx;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.collapse {
|
||||
transform: rotate(-90deg);
|
||||
}
|
||||
|
||||
.expand {
|
||||
width: 36rpx;
|
||||
height: 36rpx;
|
||||
}
|
||||
|
||||
.check-box {
|
||||
height: 30rpx;
|
||||
width: 30rpx;
|
||||
margin-left: 30rpx;
|
||||
}
|
||||
|
||||
.tree-item-name-select {
|
||||
color: #0079FE;
|
||||
}
|
||||
250
ec-canvas/ec-canvas.js
Normal file
|
|
@ -0,0 +1,250 @@
|
|||
import WxCanvas from './wx-canvas';
|
||||
import * as echarts from './echarts';
|
||||
|
||||
let ctx;
|
||||
|
||||
function compareVersion(v1, v2) {
|
||||
v1 = v1.split('.')
|
||||
v2 = v2.split('.')
|
||||
const len = Math.max(v1.length, v2.length)
|
||||
|
||||
while (v1.length < len) {
|
||||
v1.push('0')
|
||||
}
|
||||
while (v2.length < len) {
|
||||
v2.push('0')
|
||||
}
|
||||
|
||||
for (let i = 0; i < len; i++) {
|
||||
const num1 = parseInt(v1[i])
|
||||
const num2 = parseInt(v2[i])
|
||||
|
||||
if (num1 > num2) {
|
||||
return 1
|
||||
} else if (num1 < num2) {
|
||||
return -1
|
||||
}
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
Component({
|
||||
properties: {
|
||||
canvasId: {
|
||||
type: String,
|
||||
value: 'ec-canvas'
|
||||
},
|
||||
|
||||
ec: {
|
||||
type: Object
|
||||
},
|
||||
|
||||
forceUseOldCanvas: {
|
||||
type: Boolean,
|
||||
value: false
|
||||
}
|
||||
},
|
||||
|
||||
data: {
|
||||
isUseNewCanvas: true
|
||||
},
|
||||
|
||||
ready: function () {
|
||||
// Disable prograssive because drawImage doesn't support DOM as parameter
|
||||
// See https://developers.weixin.qq.com/miniprogram/dev/api/canvas/CanvasContext.drawImage.html
|
||||
echarts.registerPreprocessor(option => {
|
||||
if (option && option.series) {
|
||||
if (option.series.length > 0) {
|
||||
option.series.forEach(series => {
|
||||
series.progressive = 0;
|
||||
});
|
||||
}
|
||||
else if (typeof option.series === 'object') {
|
||||
option.series.progressive = 0;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
if (!this.data.ec) {
|
||||
console.warn('组件需绑定 ec 变量,例:<ec-canvas id="mychart-dom-bar" '
|
||||
+ 'canvas-id="mychart-bar" ec="{{ ec }}"></ec-canvas>');
|
||||
return;
|
||||
}
|
||||
|
||||
if (!this.data.ec.lazyLoad) {
|
||||
this.init();
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
init: function (callback) {
|
||||
const version = wx.getSystemInfoSync().SDKVersion
|
||||
|
||||
const canUseNewCanvas = compareVersion(version, '2.9.0') >= 0;
|
||||
const forceUseOldCanvas = this.data.forceUseOldCanvas;
|
||||
const isUseNewCanvas = canUseNewCanvas && !forceUseOldCanvas;
|
||||
this.setData({ isUseNewCanvas });
|
||||
|
||||
if (forceUseOldCanvas && canUseNewCanvas) {
|
||||
console.warn('开发者强制使用旧canvas,建议关闭');
|
||||
}
|
||||
|
||||
if (isUseNewCanvas) {
|
||||
// console.log('微信基础库版本大于2.9.0,开始使用<canvas type="2d"/>');
|
||||
// 2.9.0 可以使用 <canvas type="2d"></canvas>
|
||||
this.initByNewWay(callback);
|
||||
} else {
|
||||
const isValid = compareVersion(version, '1.9.91') >= 0
|
||||
if (!isValid) {
|
||||
console.error('微信基础库版本过低,需大于等于 1.9.91。'
|
||||
+ '参见:https://github.com/ecomfe/echarts-for-weixin'
|
||||
+ '#%E5%BE%AE%E4%BF%A1%E7%89%88%E6%9C%AC%E8%A6%81%E6%B1%82');
|
||||
return;
|
||||
} else {
|
||||
console.warn('建议将微信基础库调整大于等于2.9.0版本。升级后绘图将有更好性能');
|
||||
this.initByOldWay(callback);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
initByOldWay(callback) {
|
||||
// 1.9.91 <= version < 2.9.0:原来的方式初始化
|
||||
ctx = wx.createCanvasContext(this.data.canvasId, this);
|
||||
const canvas = new WxCanvas(ctx, this.data.canvasId, false);
|
||||
|
||||
echarts.setCanvasCreator(() => {
|
||||
return canvas;
|
||||
});
|
||||
// const canvasDpr = wx.getSystemInfoSync().pixelRatio // 微信旧的canvas不能传入dpr
|
||||
const canvasDpr = 1
|
||||
var query = wx.createSelectorQuery().in(this);
|
||||
query.select('.ec-canvas').boundingClientRect(res => {
|
||||
if (typeof callback === 'function') {
|
||||
this.chart = callback(canvas, res.width, res.height, canvasDpr);
|
||||
}
|
||||
else if (this.data.ec && typeof this.data.ec.onInit === 'function') {
|
||||
this.chart = this.data.ec.onInit(canvas, res.width, res.height, canvasDpr);
|
||||
}
|
||||
else {
|
||||
this.triggerEvent('init', {
|
||||
canvas: canvas,
|
||||
width: res.width,
|
||||
height: res.height,
|
||||
canvasDpr: canvasDpr // 增加了dpr,可方便外面echarts.init
|
||||
});
|
||||
}
|
||||
}).exec();
|
||||
},
|
||||
|
||||
initByNewWay(callback) {
|
||||
// version >= 2.9.0:使用新的方式初始化
|
||||
const query = wx.createSelectorQuery().in(this)
|
||||
query
|
||||
.select('.ec-canvas')
|
||||
.fields({ node: true, size: true })
|
||||
.exec(res => {
|
||||
const canvasNode = res[0].node
|
||||
this.canvasNode = canvasNode
|
||||
|
||||
const canvasDpr = wx.getSystemInfoSync().pixelRatio
|
||||
const canvasWidth = res[0].width
|
||||
const canvasHeight = res[0].height
|
||||
|
||||
const ctx = canvasNode.getContext('2d')
|
||||
|
||||
const canvas = new WxCanvas(ctx, this.data.canvasId, true, canvasNode)
|
||||
echarts.setCanvasCreator(() => {
|
||||
return canvas
|
||||
})
|
||||
|
||||
if (typeof callback === 'function') {
|
||||
this.chart = callback(canvas, canvasWidth, canvasHeight, canvasDpr)
|
||||
} else if (this.data.ec && typeof this.data.ec.onInit === 'function') {
|
||||
this.chart = this.data.ec.onInit(canvas, canvasWidth, canvasHeight, canvasDpr)
|
||||
} else {
|
||||
this.triggerEvent('init', {
|
||||
canvas: canvas,
|
||||
width: canvasWidth,
|
||||
height: canvasHeight,
|
||||
dpr: canvasDpr
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
canvasToTempFilePath(opt) {
|
||||
if (this.data.isUseNewCanvas) {
|
||||
// 新版
|
||||
const query = wx.createSelectorQuery().in(this)
|
||||
query
|
||||
.select('.ec-canvas')
|
||||
.fields({ node: true, size: true })
|
||||
.exec(res => {
|
||||
const canvasNode = res[0].node
|
||||
opt.canvas = canvasNode
|
||||
wx.canvasToTempFilePath(opt)
|
||||
})
|
||||
} else {
|
||||
// 旧的
|
||||
if (!opt.canvasId) {
|
||||
opt.canvasId = this.data.canvasId;
|
||||
}
|
||||
ctx.draw(true, () => {
|
||||
wx.canvasToTempFilePath(opt, this);
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
touchStart(e) {
|
||||
if (this.chart && e.touches.length > 0) {
|
||||
var touch = e.touches[0];
|
||||
var handler = this.chart.getZr().handler;
|
||||
handler.dispatch('mousedown', {
|
||||
zrX: touch.x,
|
||||
zrY: touch.y
|
||||
});
|
||||
handler.dispatch('mousemove', {
|
||||
zrX: touch.x,
|
||||
zrY: touch.y
|
||||
});
|
||||
handler.processGesture(wrapTouch(e), 'start');
|
||||
}
|
||||
},
|
||||
|
||||
touchMove(e) {
|
||||
if (this.chart && e.touches.length > 0) {
|
||||
var touch = e.touches[0];
|
||||
var handler = this.chart.getZr().handler;
|
||||
handler.dispatch('mousemove', {
|
||||
zrX: touch.x,
|
||||
zrY: touch.y
|
||||
});
|
||||
handler.processGesture(wrapTouch(e), 'change');
|
||||
}
|
||||
},
|
||||
|
||||
touchEnd(e) {
|
||||
if (this.chart) {
|
||||
const touch = e.changedTouches ? e.changedTouches[0] : {};
|
||||
var handler = this.chart.getZr().handler;
|
||||
handler.dispatch('mouseup', {
|
||||
zrX: touch.x,
|
||||
zrY: touch.y
|
||||
});
|
||||
handler.dispatch('click', {
|
||||
zrX: touch.x,
|
||||
zrY: touch.y
|
||||
});
|
||||
handler.processGesture(wrapTouch(e), 'end');
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
function wrapTouch(event) {
|
||||
for (let i = 0; i < event.touches.length; ++i) {
|
||||
const touch = event.touches[i];
|
||||
touch.offsetX = touch.x;
|
||||
touch.offsetY = touch.y;
|
||||
}
|
||||
return event;
|
||||
}
|
||||
4
ec-canvas/ec-canvas.json
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"component": true,
|
||||
"usingComponents": {}
|
||||
}
|
||||
4
ec-canvas/ec-canvas.wxml
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
<!-- 新的:接口对其了H5 -->
|
||||
<canvas wx:if="{{isUseNewCanvas}}" type="2d" class="ec-canvas" canvas-id="{{ canvasId }}" bindinit="init" bindtouchstart="{{ ec.disableTouch ? '' : 'touchStart' }}" bindtouchmove="{{ ec.disableTouch ? '' : 'touchMove' }}" bindtouchend="{{ ec.disableTouch ? '' : 'touchEnd' }}"></canvas>
|
||||
<!-- 旧的 -->
|
||||
<canvas wx:else class="ec-canvas" canvas-id="{{ canvasId }}" bindinit="init" bindtouchstart="{{ ec.disableTouch ? '' : 'touchStart' }}" bindtouchmove="{{ ec.disableTouch ? '' : 'touchMove' }}" bindtouchend="{{ ec.disableTouch ? '' : 'touchEnd' }}"></canvas>
|
||||
4
ec-canvas/ec-canvas.wxss
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
.ec-canvas {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
45
ec-canvas/echarts.js
Normal file
121
ec-canvas/wx-canvas.js
Normal file
|
|
@ -0,0 +1,121 @@
|
|||
export default class WxCanvas {
|
||||
constructor(ctx, canvasId, isNew, canvasNode) {
|
||||
this.ctx = ctx;
|
||||
this.canvasId = canvasId;
|
||||
this.chart = null;
|
||||
this.isNew = isNew
|
||||
if (isNew) {
|
||||
this.canvasNode = canvasNode;
|
||||
}
|
||||
else {
|
||||
this._initStyle(ctx);
|
||||
}
|
||||
|
||||
// this._initCanvas(zrender, ctx);
|
||||
|
||||
this._initEvent();
|
||||
}
|
||||
|
||||
getContext(contextType) {
|
||||
if (contextType === '2d') {
|
||||
return this.ctx;
|
||||
}
|
||||
}
|
||||
|
||||
// canvasToTempFilePath(opt) {
|
||||
// if (!opt.canvasId) {
|
||||
// opt.canvasId = this.canvasId;
|
||||
// }
|
||||
// return wx.canvasToTempFilePath(opt, this);
|
||||
// }
|
||||
|
||||
setChart(chart) {
|
||||
this.chart = chart;
|
||||
}
|
||||
|
||||
attachEvent() {
|
||||
// noop
|
||||
}
|
||||
|
||||
detachEvent() {
|
||||
// noop
|
||||
}
|
||||
|
||||
_initCanvas(zrender, ctx) {
|
||||
zrender.util.getContext = function () {
|
||||
return ctx;
|
||||
};
|
||||
|
||||
zrender.util.$override('measureText', function (text, font) {
|
||||
ctx.font = font || '12px sans-serif';
|
||||
return ctx.measureText(text);
|
||||
});
|
||||
}
|
||||
|
||||
_initStyle(ctx) {
|
||||
var styles = ['fillStyle', 'strokeStyle', 'globalAlpha',
|
||||
'textAlign', 'textBaseAlign', 'shadow', 'lineWidth',
|
||||
'lineCap', 'lineJoin', 'lineDash', 'miterpageSize', 'fontSize'];
|
||||
|
||||
styles.forEach(style => {
|
||||
Object.defineProperty(ctx, style, {
|
||||
set: value => {
|
||||
if (style !== 'fillStyle' && style !== 'strokeStyle'
|
||||
|| value !== 'none' && value !== null
|
||||
) {
|
||||
ctx['set' + style.charAt(0).toUpperCase() + style.slice(1)](value);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
ctx.createRadialGradient = () => {
|
||||
return ctx.createCircularGradient(arguments);
|
||||
};
|
||||
}
|
||||
|
||||
_initEvent() {
|
||||
this.event = {};
|
||||
const eventNames = [{
|
||||
wxName: 'touchStart',
|
||||
ecName: 'mousedown'
|
||||
}, {
|
||||
wxName: 'touchMove',
|
||||
ecName: 'mousemove'
|
||||
}, {
|
||||
wxName: 'touchEnd',
|
||||
ecName: 'mouseup'
|
||||
}, {
|
||||
wxName: 'touchEnd',
|
||||
ecName: 'click'
|
||||
}];
|
||||
|
||||
eventNames.forEach(name => {
|
||||
this.event[name.wxName] = e => {
|
||||
const touch = e.touches[0];
|
||||
this.chart.getZr().handler.dispatch(name.ecName, {
|
||||
zrX: name.wxName === 'tap' ? touch.clientX : touch.x,
|
||||
zrY: name.wxName === 'tap' ? touch.clientY : touch.y
|
||||
});
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
set width(w) {
|
||||
if (this.canvasNode) this.canvasNode.width = w
|
||||
}
|
||||
set height(h) {
|
||||
if (this.canvasNode) this.canvasNode.height = h
|
||||
}
|
||||
|
||||
get width() {
|
||||
if (this.canvasNode)
|
||||
return this.canvasNode.width
|
||||
return 0
|
||||
}
|
||||
get height() {
|
||||
if (this.canvasNode)
|
||||
return this.canvasNode.height
|
||||
return 0
|
||||
}
|
||||
}
|
||||
BIN
images/bg.png
Normal file
|
After Width: | Height: | Size: 356 KiB |
BIN
images/check/icon_building.png
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
images/check/icon_pass.png
Normal file
|
After Width: | Height: | Size: 5.6 KiB |
BIN
images/check/icon_unpass.png
Normal file
|
After Width: | Height: | Size: 5.8 KiB |
BIN
images/checkbox-checked.png
Normal file
|
After Width: | Height: | Size: 515 B |
BIN
images/checkbox.png
Normal file
|
After Width: | Height: | Size: 362 B |
BIN
images/close_img.png
Normal file
|
After Width: | Height: | Size: 1.0 KiB |
BIN
images/danger/examine_icon.png
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
images/danger/icon-fixed.png
Normal file
|
After Width: | Height: | Size: 2.4 KiB |
BIN
images/danger/icon_pass.png
Normal file
|
After Width: | Height: | Size: 1.7 KiB |
BIN
images/danger/icon_review.png
Normal file
|
After Width: | Height: | Size: 1.8 KiB |
BIN
images/danger/icon_unpass.png
Normal file
|
After Width: | Height: | Size: 1.7 KiB |
BIN
images/danger/not_rectified_icon.png
Normal file
|
After Width: | Height: | Size: 987 B |
BIN
images/danger/rectified_icon.png
Normal file
|
After Width: | Height: | Size: 1.0 KiB |
BIN
images/danger/under_rectification_icon.png
Normal file
|
After Width: | Height: | Size: 1012 B |
BIN
images/emergency/icon-guide.png
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
images/empty.png
Normal file
|
After Width: | Height: | Size: 14 KiB |
BIN
images/expand.png
Normal file
|
After Width: | Height: | Size: 352 B |
BIN
images/help.png
Normal file
|
After Width: | Height: | Size: 1.5 KiB |
BIN
images/home/avatar.png
Normal file
|
After Width: | Height: | Size: 7.8 KiB |
BIN
images/home/icon-emergency.png
Normal file
|
After Width: | Height: | Size: 4.0 KiB |
BIN
images/home/icon_arrow.png
Normal file
|
After Width: | Height: | Size: 608 B |
BIN
images/home/icon_filter-bg.png
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
images/home/icon_msg.png
Normal file
|
After Width: | Height: | Size: 3.2 KiB |
BIN
images/home/icon_static.png
Normal file
|
After Width: | Height: | Size: 695 B |
BIN
images/home/icon_study.png
Normal file
|
After Width: | Height: | Size: 454 B |
BIN
images/home/icon_tab1.png
Normal file
|
After Width: | Height: | Size: 5.1 KiB |
BIN
images/home/icon_tab2.png
Normal file
|
After Width: | Height: | Size: 5.3 KiB |
BIN
images/home/icon_tab3.png
Normal file
|
After Width: | Height: | Size: 4.7 KiB |
BIN
images/home/icon_tab4.png
Normal file
|
After Width: | Height: | Size: 5.1 KiB |
BIN
images/home/icon_tab5.png
Normal file
|
After Width: | Height: | Size: 6.0 KiB |
BIN
images/home/icon_tab6.png
Normal file
|
After Width: | Height: | Size: 5.9 KiB |
BIN
images/home/icon_top-bg.png
Normal file
|
After Width: | Height: | Size: 240 KiB |
BIN
images/home/icon_work.png
Normal file
|
After Width: | Height: | Size: 464 B |
BIN
images/pws-icon.png
Normal file
|
After Width: | Height: | Size: 795 B |
BIN
images/risk/risk-1.png
Normal file
|
After Width: | Height: | Size: 727 B |
BIN
images/risk/risk-2.png
Normal file
|
After Width: | Height: | Size: 716 B |
BIN
images/risk/risk-3.png
Normal file
|
After Width: | Height: | Size: 666 B |
BIN
images/risk/risk-red.png
Normal file
|
After Width: | Height: | Size: 668 B |
BIN
images/task/icon-bottom-line.png
Normal file
|
After Width: | Height: | Size: 12 KiB |
BIN
images/task/icon-cloud.png
Normal file
|
After Width: | Height: | Size: 1.3 KiB |
BIN
images/user_icon.png
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
245
pages/account/info/index.js
Normal file
|
|
@ -0,0 +1,245 @@
|
|||
const {
|
||||
regPwd
|
||||
} = require("../../../utils/util");
|
||||
|
||||
// pages/info/index.js
|
||||
const app = getApp();
|
||||
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
showPwdPop: false,
|
||||
userInfo: {},
|
||||
postData: {}
|
||||
},
|
||||
|
||||
/**
|
||||
* 解绑
|
||||
*/
|
||||
unbindWX: function () {
|
||||
const userId = this.data.userInfo.userId;
|
||||
wx.showModal({
|
||||
title: '微信解绑',
|
||||
content: '是否解绑当前账号?',
|
||||
complete: (res) => {
|
||||
if (res.confirm) {
|
||||
app.axios('POST', 'app', `/User/userUnbinding/${userId}`, {}, false).then(res => {
|
||||
if (res.code == 1) {
|
||||
this.data.userInfo.openid = '';
|
||||
this.setData(this.data)
|
||||
wx.showToast({
|
||||
title: '操作成功',
|
||||
icon: 'none'
|
||||
})
|
||||
|
||||
} else wx.showToast({
|
||||
title: res.message,
|
||||
icon: 'none'
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 绑定
|
||||
*/
|
||||
bindWX: function () {
|
||||
const userId = this.data.userInfo.userId;
|
||||
wx.login({
|
||||
success: (res) => {
|
||||
app.axios('POST', 'app', '/User/userBinding', {
|
||||
userId,
|
||||
code: res.code
|
||||
}, true).then(res => {
|
||||
if (res.code == 1) {
|
||||
this.data.userInfo.openid = res.data;
|
||||
this.setData(this.data)
|
||||
wx.showToast({
|
||||
title: '绑定成功',
|
||||
icon: 'none'
|
||||
})
|
||||
} else wx.showToast({
|
||||
title: res.message,
|
||||
icon: 'none'
|
||||
})
|
||||
})
|
||||
},
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 协议
|
||||
*/
|
||||
deal: function (params) {
|
||||
wx.navigateTo({
|
||||
url: `/pages/web/index?title=用户协议和隐私协议`,
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 修改名字
|
||||
*/
|
||||
fixName: function (params) {
|
||||
this.data.showNamePop = !this.data.showNamePop
|
||||
this.setData(this.data)
|
||||
},
|
||||
|
||||
/**
|
||||
* 修改密码弹窗
|
||||
*/
|
||||
changePwd: function () {
|
||||
this.data.showPwdPop = !this.data.showPwdPop
|
||||
this.setData(this.data)
|
||||
},
|
||||
|
||||
/**
|
||||
* 输入框
|
||||
*/
|
||||
inputedit: function (e) {
|
||||
let dataset = e.currentTarget.dataset;
|
||||
let value = e.detail.value;
|
||||
this.data[dataset.obj][dataset.item] = value;
|
||||
this.setData({
|
||||
postData: this.data[dataset.obj]
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 提交
|
||||
*/
|
||||
submit: function (e) {
|
||||
const type = e.currentTarget.dataset.type;
|
||||
if (type == 1) {
|
||||
if (!this.data.postData.oldPassword) {
|
||||
wx.showToast({
|
||||
title: '请输入旧密码',
|
||||
icon: 'none'
|
||||
})
|
||||
return
|
||||
} else if (!this.data.postData.password) {
|
||||
wx.showToast({
|
||||
title: '请输入新密码',
|
||||
icon: 'none'
|
||||
})
|
||||
return
|
||||
} else if (!regPwd(this.data.postData.password)) {
|
||||
wx.showToast({
|
||||
title: '密码格式不正确',
|
||||
icon: 'none'
|
||||
})
|
||||
return
|
||||
} else if (!this.data.postData.checkPassword) {
|
||||
wx.showToast({
|
||||
title: '请确认新密码',
|
||||
icon: 'none'
|
||||
})
|
||||
return
|
||||
} else if (this.data.postData.password !== this.data.postData.checkPassword) {
|
||||
wx.showToast({
|
||||
title: '两次密码输入不一致!',
|
||||
icon: 'none'
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
this.data.postData.userId = app.globalData.userInfo.userId;
|
||||
app.axios('POST', 'app', '/User/uploadPassword', this.data.postData, true).then(res => {
|
||||
if (res.code == 1) {
|
||||
this.data.showPwdPop = false
|
||||
this.setData(this.data)
|
||||
wx.showToast({
|
||||
title: '修改成功',
|
||||
icon: 'none'
|
||||
})
|
||||
} else {
|
||||
wx.showToast({
|
||||
title: res.message,
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.data.showPwdPop = false
|
||||
this.setData(this.data)
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 退出登录
|
||||
*/
|
||||
exit: function (params) {
|
||||
wx.showModal({
|
||||
title: '温馨提示',
|
||||
content: '是否退出当前账号?',
|
||||
complete: (res) => {
|
||||
if (res.confirm) {
|
||||
app.globalData.userInfo = {}
|
||||
wx.reLaunch({
|
||||
url: '/pages/login/index',
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad(options) {
|
||||
this.data.userInfo = app.globalData.userInfo;
|
||||
this.setData(this.data)
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
onReady() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面隐藏
|
||||
*/
|
||||
onHide() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面卸载
|
||||
*/
|
||||
onUnload() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面相关事件处理函数--监听用户下拉动作
|
||||
*/
|
||||
onPullDownRefresh() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面上拉触底事件的处理函数
|
||||
*/
|
||||
onReachBottom() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 用户点击右上角分享
|
||||
*/
|
||||
onShareAppMessage() {
|
||||
|
||||
}
|
||||
})
|
||||
4
pages/account/info/index.json
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"usingComponents": {},
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
82
pages/account/info/index.wxml
Normal file
|
|
@ -0,0 +1,82 @@
|
|||
<!--pages/info/index.wxml-->
|
||||
<title-bar title="个人信息"></title-bar>
|
||||
<scroll-view>
|
||||
<view class="bg">
|
||||
<view catchtap="fixName" class="item h-div v-center">
|
||||
<text class="flex lab">姓名</text>
|
||||
<text class="val">{{userInfo.chinaName}}</text>
|
||||
</view>
|
||||
<view class="item h-div v-center">
|
||||
<text class="lab flex">岗位名称</text>
|
||||
<text class="val">{{userInfo.postName}}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="bg">
|
||||
<view class="item h-div v-center">
|
||||
<text class="lab flex">微信绑定</text>
|
||||
<text catchtap="unbindWX" wx:if="{{userInfo.openid}}" class="val tips">解除绑定</text>
|
||||
<text catchtap="bindWX" wx:else class=" val tips">立即绑定</text>
|
||||
<a class="weui-cell_access">
|
||||
<view class="weui-cell__ft"></view>
|
||||
</a>
|
||||
</view>
|
||||
<view class="item h-div v-center" catchtap="changePwd">
|
||||
<text class="lab flex">修改密码</text>
|
||||
<a class="weui-cell_access">
|
||||
<view class="weui-cell__ft"></view>
|
||||
</a>
|
||||
</view>
|
||||
<view class="item h-div v-center" catchtap="deal">
|
||||
<text class="lab flex">用户协议和隐私协议</text>
|
||||
<a class="weui-cell_access">
|
||||
<view class="weui-cell__ft"></view>
|
||||
</a>
|
||||
</view>
|
||||
</view>
|
||||
<view catchtap="exit" class="exit">退出登录</view>
|
||||
</scroll-view>
|
||||
|
||||
<!-- 修改密码 -->
|
||||
<view class="cu-modal {{showPwdPop?'show':''}}">
|
||||
<view class="cu-dialog pop">
|
||||
<view class="cu-bar justify-end pop-header">
|
||||
<view class="content text-black" style="font-weight: bold;">修改密码</view>
|
||||
<view class="action" catchtap="submit" data-type="{{2}}">
|
||||
<text class="cuIcon-close text-black"></text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="h-div v-center pwd-bg">
|
||||
<image class="icon" src="/images/pws-icon.png" mode="aspectFit" />
|
||||
<input value="{{postData.oldPassword}}" placeholder="输入旧密码" bindinput="inputedit" data-item="oldPassword" data-obj="postData" placeholder-style="color:#999999" style="color: #333333;" />
|
||||
</view>
|
||||
<view class="h-div v-center pwd-bg">
|
||||
<image class="icon" src="/images/pws-icon.png" mode="aspectFit" />
|
||||
<input value="{{postData.password}}" placeholder="输入新密码" bindinput="inputedit" data-item="password" data-obj="postData" placeholder-style="color:#999999" style="color: #333333;" />
|
||||
</view>
|
||||
<view class="h-div v-center pwd-bg">
|
||||
<image class="icon" src="/images/pws-icon.png" mode="aspectFit" />
|
||||
<input value="{{postData.checkPassword}}" placeholder="确认新密码" bindinput="inputedit" data-item="checkPassword" data-obj="postData" placeholder-style="color:#999999" style="color: #333333;" />
|
||||
</view>
|
||||
|
||||
<view class="single">密码为6-20位数字、字母或下划线,至少包括其中两种,以字母开头!</view>
|
||||
|
||||
<view catchtap="submit" data-type="{{1}}" class="submit-btn btn-option">确定</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 修改密码 -->
|
||||
<view class="cu-modal {{showNamePop?'show':''}}">
|
||||
<view class="cu-dialog pop">
|
||||
<view class="cu-bar justify-end pop-header">
|
||||
<view class="content text-black" style="font-weight: bold;">修改名字</view>
|
||||
<view class="action" catchtap="submit" data-type="{{3}}">
|
||||
<text class="cuIcon-close text-black"></text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="h-div v-center pwd-bg">
|
||||
<image class="icon" src="/images/pws-icon.png" mode="aspectFit" />
|
||||
<input value="{{postData.name}}" placeholder="输入姓名" bindinput="inputedit" data-item="oldPassword" data-obj="postData" placeholder-style="color:#999999" style="color: #333333;" />
|
||||
</view>
|
||||
|
||||
<view catchtap="fixName" data-type="{{3}}" class="submit-btn btn-option">确定</view>
|
||||
</view>
|
||||
</view>
|
||||
108
pages/account/info/index.wxss
Normal file
|
|
@ -0,0 +1,108 @@
|
|||
/* pages/info/index.wxss */
|
||||
page {
|
||||
background-color: #f5f5f5;
|
||||
}
|
||||
|
||||
.bg {
|
||||
margin: 20rpx;
|
||||
border-radius: 10rpx;
|
||||
background-color: #ffffff;
|
||||
}
|
||||
|
||||
.bg .item {
|
||||
padding: 20rpx;
|
||||
border-bottom: 1rpx solid #f5f5f5;
|
||||
}
|
||||
|
||||
.bg .item .lab {
|
||||
min-width: 25vw;
|
||||
font-size: 32rpx;
|
||||
color: #111111;
|
||||
}
|
||||
|
||||
.bg .item .val {
|
||||
font-size: 32rpx;
|
||||
color: #949494;
|
||||
}
|
||||
|
||||
.exit {
|
||||
font-size: 30rpx;
|
||||
color: #333333;
|
||||
background-color: #ffffff;
|
||||
border-radius: 50rpx;
|
||||
border: 1rpx solid #C7C7C7;
|
||||
padding: 15rpx;
|
||||
margin: 30rpx 20rpx;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
|
||||
.in {
|
||||
height: fit-content;
|
||||
background: linear-gradient(180deg, #67C3FF 0%, #4199FF 100%);
|
||||
border-radius: 40rpx;
|
||||
color: white;
|
||||
font-size: 30rpx;
|
||||
padding: 5rpx 50rpx;
|
||||
}
|
||||
|
||||
.weui-dialog__hd {
|
||||
padding: 10px 24px 16px;
|
||||
}
|
||||
|
||||
.pwd-bg {
|
||||
padding: 10px;
|
||||
background: #F5F7FB;
|
||||
font-size: 30rpx;
|
||||
text-align: start;
|
||||
margin: 10px;
|
||||
border-radius: 90rpx;
|
||||
}
|
||||
|
||||
.pwd-bg .icon {
|
||||
width: 30rpx;
|
||||
height: 30rpx;
|
||||
margin: 0 20rpx;
|
||||
}
|
||||
|
||||
input {
|
||||
width: 95%;
|
||||
}
|
||||
|
||||
.btn-option {
|
||||
width: 90%;
|
||||
height: 80rpx;
|
||||
line-height: 80rpx;
|
||||
border-radius: 110rpx;
|
||||
margin: 50rpx 5%;
|
||||
}
|
||||
|
||||
.btn-option:active {
|
||||
opacity: 0.8;
|
||||
}
|
||||
|
||||
.submit-btn {
|
||||
color: #ffffff;
|
||||
background: linear-gradient(161deg, #1DB2FF 0%, #047BFF 100%);
|
||||
|
||||
}
|
||||
|
||||
.tips {
|
||||
font-size: 28rpx !important;
|
||||
color: #999999 !important;
|
||||
}
|
||||
|
||||
.single {
|
||||
font-size: 26rpx;
|
||||
margin-top: 30rpx;
|
||||
color: #999999;
|
||||
margin: 30rpx;
|
||||
}
|
||||
|
||||
.single::before {
|
||||
content: '*';
|
||||
color: red;
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
85
pages/emergency/index/index.js
Normal file
|
|
@ -0,0 +1,85 @@
|
|||
// pages/emergency/index/index.js
|
||||
const app = getApp();
|
||||
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
topBarH: app.globalData.CustomBar,
|
||||
curTab: 0,
|
||||
tabs: [{
|
||||
lab: '突发事件',
|
||||
val: 0
|
||||
}, {
|
||||
lab: '应急资源',
|
||||
val: 1
|
||||
}],
|
||||
},
|
||||
|
||||
/**
|
||||
* 切换筛选
|
||||
*/
|
||||
tabSelect: function (params) {
|
||||
const index = Number.parseInt(params.currentTarget.dataset.index) || Number.parseInt(params.detail.current);
|
||||
this.data.curTab = index;
|
||||
this.setData(this.data)
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad(options) {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
onReady() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面隐藏
|
||||
*/
|
||||
onHide() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面卸载
|
||||
*/
|
||||
onUnload() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面相关事件处理函数--监听用户下拉动作
|
||||
*/
|
||||
onPullDownRefresh() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面上拉触底事件的处理函数
|
||||
*/
|
||||
onReachBottom() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 用户点击右上角分享
|
||||
*/
|
||||
onShareAppMessage() {
|
||||
|
||||
}
|
||||
})
|
||||
7
pages/emergency/index/index.json
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"usingComponents": {
|
||||
"suddenly": "../suddenly-up/index/index",
|
||||
"resourse": "../resourse/index/index"
|
||||
},
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
18
pages/emergency/index/index.wxml
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
<!--pages/emergency/index/index.wxml-->
|
||||
<title-bar title="应急管理"></title-bar>
|
||||
<!-- 筛选 -->
|
||||
<scroll-view scroll-x class="bg-white nav">
|
||||
<view class="flex text-center">
|
||||
<view class="cu-item flex-sub {{index==curTab?'text-blue cur':''}}" wx:for="{{tabs}}" wx:key catchtap="tabSelect" data-index="{{index}}">
|
||||
{{item.lab}}
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
<swiper style="height: calc(100vh - 90rpx - {{topBarH}}px);" current="{{curTab}}" bindanimationfinish="tabSelect">
|
||||
<swiper-item>
|
||||
<suddenly></suddenly>
|
||||
</swiper-item>
|
||||
<swiper-item>
|
||||
<resourse></resourse>
|
||||
</swiper-item>
|
||||
</swiper>
|
||||
9
pages/emergency/index/index.wxss
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
/* pages/emergency/index/index.wxss */
|
||||
page {
|
||||
background-color: #f5f5f5;
|
||||
}
|
||||
|
||||
.cu-item {
|
||||
font-size: 30rpx;
|
||||
font-weight: bold;
|
||||
}
|
||||
111
pages/emergency/resourse/index/index.js
Normal file
|
|
@ -0,0 +1,111 @@
|
|||
// pages/emergency/resourse/index/index.js
|
||||
const app = getApp();
|
||||
|
||||
Component({
|
||||
/**
|
||||
* 组件的属性列表
|
||||
*/
|
||||
properties: {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 组件的初始数据
|
||||
*/
|
||||
data: {
|
||||
condition: '',
|
||||
curTab: 0,
|
||||
tabs: [{
|
||||
lab: '应急物资',
|
||||
val: 0
|
||||
}, {
|
||||
lab: '应急专家',
|
||||
val: 0
|
||||
}, {
|
||||
lab: '救援队伍',
|
||||
val: 0
|
||||
}],
|
||||
|
||||
canChange: false,
|
||||
freshIng: false,
|
||||
page: 1,
|
||||
pageSize: 10,
|
||||
list: []
|
||||
},
|
||||
|
||||
pageLifetimes: {
|
||||
show: function () {
|
||||
this.getList();
|
||||
},
|
||||
},
|
||||
|
||||
/**
|
||||
* 组件的方法列表
|
||||
*/
|
||||
methods: {
|
||||
|
||||
/**
|
||||
* 搜索
|
||||
*/
|
||||
inputSearch: function (e) {
|
||||
this.data.condition = e.detail.value;
|
||||
this.refresh();
|
||||
},
|
||||
|
||||
/**
|
||||
* 切换筛选
|
||||
*/
|
||||
tabSelect: function (params) {
|
||||
if (!this.data.canChange) return
|
||||
this.data.canChange = false;
|
||||
const index = Number.parseInt(params.currentTarget.dataset.index);
|
||||
this.data.curTab = index;
|
||||
this.setData(this.data)
|
||||
this.refresh()
|
||||
},
|
||||
|
||||
/**
|
||||
* 刷新
|
||||
* @param {*} params
|
||||
*/
|
||||
refresh: function (params) {
|
||||
this.data.page = 1;
|
||||
this.data.list = [];
|
||||
this.setData(this.data)
|
||||
this.getList();
|
||||
},
|
||||
|
||||
/**
|
||||
* 获取列表
|
||||
*/
|
||||
getList: function () {
|
||||
let url = ""
|
||||
const params = {
|
||||
page: this.data.page,
|
||||
pageSize: this.data.pageSize,
|
||||
}
|
||||
switch (this.data.curTab) {
|
||||
case 0:
|
||||
url = "/OtheWareHouse/getOtheWareHousePage"
|
||||
params.houseName = this.data.condition;
|
||||
break;
|
||||
case 1:
|
||||
url = "/Othexpert/getOthexpertPage"
|
||||
params.othname = this.data.condition;
|
||||
break;
|
||||
case 2:
|
||||
url = "/Othteam/getOthteamPage"
|
||||
params.teamname = this.data.condition;
|
||||
break;
|
||||
}
|
||||
app.axios("GET", "app", url, params, true).then(res => {
|
||||
this.data.canChange = true;
|
||||
if (res.code == 1) {
|
||||
this.data.list = [...this.data.list, ...res.data.rows];
|
||||
if (res.data.rows.length != 0) this.data.page = res.data.pageNum + 1
|
||||
}
|
||||
this.setData(this.data)
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
4
pages/emergency/resourse/index/index.json
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"component": true,
|
||||
"usingComponents": {}
|
||||
}
|
||||
104
pages/emergency/resourse/index/index.wxml
Normal file
|
|
@ -0,0 +1,104 @@
|
|||
<!--pages/emergency/resourse/index/index.wxml-->
|
||||
<!-- 搜索 -->
|
||||
<view class="cu-bar search">
|
||||
<view class="search-form round">
|
||||
<text class="cuIcon-search"></text>
|
||||
<input value="{{condition}}" bindinput="inputSearch" type="text" placeholder="请输入关键字" confirm-type="search"></input>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 筛选 -->
|
||||
<scroll-view scroll-x class="filter">
|
||||
<view class="tag text-blue {{index==curTab?'cur':''}}" wx:for="{{tabs}}" wx:key catchtap="tabSelect" data-index="{{index}}">
|
||||
{{item.lab}}
|
||||
</view>
|
||||
</scroll-view>
|
||||
<scroll-view scroll-y style="height: calc(100% - 170rpx)" refresher-enabled bindrefresherrefresh="refresh" bindscrolltolower="getList" refresher-triggered="{{freshIng}}">
|
||||
<!-- 列表 -->
|
||||
<view class="item-bg" wx:for="{{list}}">
|
||||
<!-- 应急资源 -->
|
||||
<view wx:if="{{curTab == 0}}" catchtap="toDetail" data-item="{{item}}" class="item">
|
||||
<view class="h-div v-center">
|
||||
<view class="lab flex">{{item.houseName||''}}</view>
|
||||
<image class="guide" src="/images/emergency/icon-guide.png" />
|
||||
<view class="phone">导航</view>
|
||||
</view>
|
||||
<view class="line"></view>
|
||||
<view class="h-div v-center">
|
||||
<text class="lab">所属单位:</text>
|
||||
<text class="val">{{item.possession||''}}</text>
|
||||
</view>
|
||||
<view class="line"></view>
|
||||
<view class="h-div v-center">
|
||||
<text class="lab">管理员:</text>
|
||||
<text class="val flex">{{item.nameText||''}}</text>
|
||||
<text class="phone">{{item.telephone|''}}</text>
|
||||
</view>
|
||||
<view class="line"></view>
|
||||
<view class="h-div v-center">
|
||||
<text class="lab">物资数量:</text>
|
||||
<text class="val">{{item.houseTotal}}</text>
|
||||
</view>
|
||||
<view class="line"></view>
|
||||
<view class="h-div v-center" style="color: #999999; font-size: 26rpx;">
|
||||
<text class="cuIcon-location"></text>
|
||||
<text class="address">316m</text>
|
||||
<text style="margin: 0 20rpx;">|</text>
|
||||
<text class="address">{{item.address}}</text>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 应急专家 -->
|
||||
<view wx:if="{{curTab == 1}}" catchtap="toDetail" data-item="{{item}}" class="item">
|
||||
<view class="h-div v-center">
|
||||
<view class="lab">{{item.othname}}</view>
|
||||
<view class="lab age flex">{{item.othage}}岁</view>
|
||||
<image class="guide" src="/images/emergency/icon-guide.png" />
|
||||
<view class="phone">导航</view>
|
||||
</view>
|
||||
<view class="line"></view>
|
||||
<view class="h-div v-center">
|
||||
<text class="lab">职称:</text>
|
||||
<text class="val">{{item.othmajor}}</text>
|
||||
</view>
|
||||
<view class="line"></view>
|
||||
<view class="h-div v-center">
|
||||
<text class="lab">任职单位:</text>
|
||||
<text class="val">{{item.othcompany||''}}</text>
|
||||
</view>
|
||||
<view class="line"></view>
|
||||
<view class="h-div v-center">
|
||||
<text class="lab">联系电话:</text>
|
||||
<text class="phone">{{item.othphone}}</text>
|
||||
</view>
|
||||
<view class="line"></view>
|
||||
<view class="h-div v-center">
|
||||
<text class="lab">专业领域:</text>
|
||||
<text class="val">{{item.othmajortype}}</text>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 救援队伍 -->
|
||||
<view wx:if="{{curTab == 2}}" catchtap="toDetail" data-item="{{item}}" class="item">
|
||||
<view class="h-div v-center">
|
||||
<view class="lab flex">{{item.teamname}}</view>
|
||||
<image class="guide" src="/images/emergency/icon-guide.png" />
|
||||
<view class="phone">导航</view>
|
||||
</view>
|
||||
<view class="line"></view>
|
||||
<view class="h-div v-center">
|
||||
<text class="lab">所属单位:</text>
|
||||
<text class="val">{{item.unitname||''}}</text>
|
||||
</view>
|
||||
<view class="line"></view>
|
||||
<view class="h-div v-center">
|
||||
<text class="lab">联系人:</text>
|
||||
<text class="val flex">{{item.principal}}</text>
|
||||
<text class="phone">{{item.principaltel}}</text>
|
||||
</view>
|
||||
<view class="line"></view>
|
||||
<view class="h-div v-center">
|
||||
<text class="lab">队伍人数:</text>
|
||||
<text class="val">{{item.personnum||'0'}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="space"></view>
|
||||
</scroll-view>
|
||||
129
pages/emergency/resourse/index/index.wxss
Normal file
|
|
@ -0,0 +1,129 @@
|
|||
/* pages/emergency/resourse/index/index.wxss */
|
||||
@import "../../../../colorui/main.wxss";
|
||||
@import "../../../../colorui/icon.wxss";
|
||||
|
||||
page {
|
||||
background-color: #f5f5f5;
|
||||
}
|
||||
|
||||
|
||||
.v-div {
|
||||
display: flex;
|
||||
display: -webkit-flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.h-div {
|
||||
display: flex;
|
||||
display: -webkit-flex;
|
||||
flex-direction: row;
|
||||
}
|
||||
|
||||
.v-center {
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.h-center {
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.flex {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.space-between {
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.cu-item {
|
||||
font-size: 30rpx;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.filter {
|
||||
height: 60rpx;
|
||||
margin-bottom: 10rpx;
|
||||
min-width: 100%;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.filter .tag {
|
||||
background: #CEDFFD;
|
||||
border-radius: 46rpx;
|
||||
padding: 2rpx 40rpx;
|
||||
margin-left: 20rpx;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.filter .cur {
|
||||
background: #FFFFFF;
|
||||
border: 2rpx solid #417AFF;
|
||||
}
|
||||
|
||||
.filter view {
|
||||
width: fit-content;
|
||||
}
|
||||
|
||||
.search {
|
||||
background-color: #f5f5f5;
|
||||
position: sticky;
|
||||
top: 0;
|
||||
z-index: 10;
|
||||
}
|
||||
|
||||
.cu-bar .search-form {
|
||||
background: #FFFFFF;
|
||||
box-shadow: 0rpx 0rpx 12rpx 2rpx #DDECF3;
|
||||
border-radius: 12rpx;
|
||||
}
|
||||
|
||||
.item-bg {
|
||||
padding: 0 20rpx;
|
||||
/* background-color: #f5f5f5; */
|
||||
}
|
||||
|
||||
.item {
|
||||
background-color: #ffffff;
|
||||
padding: 20rpx;
|
||||
position: relative;
|
||||
border-radius: 10rpx;
|
||||
z-index: 2;
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
|
||||
.item .lab {
|
||||
font-size: 32rpx;
|
||||
font-weight: bold;
|
||||
color: #222222;
|
||||
}
|
||||
|
||||
.item .val {
|
||||
font-size: 32rpx;
|
||||
color: #222222;
|
||||
}
|
||||
|
||||
.item .age {
|
||||
font-size: 32rpx;
|
||||
margin-left: 30rpx;
|
||||
}
|
||||
|
||||
.item .phone {
|
||||
font-size: 32rpx;
|
||||
color: var(--blue);
|
||||
}
|
||||
|
||||
.item .guide {
|
||||
width: 32rpx;
|
||||
height: 32rpx;
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
|
||||
.item .line {
|
||||
margin: 20rpx -20rpx;
|
||||
border-top: 2rpx dashed #f5f5f5;
|
||||
}
|
||||
|
||||
.space {
|
||||
height: calc(constant(safe-area-inset-bottom) + 30rpx);
|
||||
height: calc(env(safe-area-inset-bottom) + 30rpx);
|
||||
}
|
||||
30
pages/emergency/suddenly-up/index/index.js
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
// pages/emergency/suddenly-up/index/index.js
|
||||
Component({
|
||||
/**
|
||||
* 组件的属性列表
|
||||
*/
|
||||
properties: {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 组件的初始数据
|
||||
*/
|
||||
data: {
|
||||
list: [{}, {}, {}, {}, {}]
|
||||
},
|
||||
|
||||
/**
|
||||
* 组件的方法列表
|
||||
*/
|
||||
methods: {
|
||||
/**
|
||||
* 上报事件
|
||||
*/
|
||||
push: function (params) {
|
||||
wx.navigateTo({
|
||||
url: '/pages/emergency/suddenly-up/up/index',
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
4
pages/emergency/suddenly-up/index/index.json
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"component": true,
|
||||
"usingComponents": {}
|
||||
}
|
||||
31
pages/emergency/suddenly-up/index/index.wxml
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
<!--pages/emergency/suddenly-up/index/index.wxml-->
|
||||
<!-- 搜索 -->
|
||||
<view class="cu-bar search">
|
||||
<view class="search-form round">
|
||||
<text class="cuIcon-search"></text>
|
||||
<input type="text" placeholder="请输入关键字" confirm-type="search"></input>
|
||||
</view>
|
||||
</view>
|
||||
<scroll-view scroll-y style="height: calc(100% - 100rpx)" refresher-enabled>
|
||||
<!-- 列表 -->
|
||||
<view class="item-bg" wx:for="{{list}}">
|
||||
<view catchtap="toDetail" data-item="{{item}}" class="item">
|
||||
<view class="head h-div v-center">
|
||||
<view class="single"></view>
|
||||
<view class="title ellipsis">文件签批流转任务</view>
|
||||
</view>
|
||||
<view class="tv">关于某某某某某某某某某某某项工作的任务要求,关于某某某某某某某某工作的任务要求。
|
||||
</view>
|
||||
<view class="line"></view>
|
||||
<view class="h-div bottom">
|
||||
<text class="flex">发布人:某某人</text>
|
||||
<text>发布时间:2022-09-15</text>
|
||||
</view>
|
||||
<image class="bottom-img" src="/images/task/icon-bottom-line.png" mode="aspectFill" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="space"></view>
|
||||
</scroll-view>
|
||||
<view class="option">
|
||||
<view catchtap="push" class="btn">上报事件</view>
|
||||
</view>
|
||||
162
pages/emergency/suddenly-up/index/index.wxss
Normal file
|
|
@ -0,0 +1,162 @@
|
|||
/* pages/emergency/suddenly-up/index/index.wxss */
|
||||
@import "../../../../colorui/main.wxss";
|
||||
@import "../../../../colorui/icon.wxss";
|
||||
|
||||
page {
|
||||
background-color: #f5f5f5;
|
||||
}
|
||||
|
||||
|
||||
.v-div {
|
||||
display: flex;
|
||||
display: -webkit-flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.h-div {
|
||||
display: flex;
|
||||
display: -webkit-flex;
|
||||
flex-direction: row;
|
||||
}
|
||||
|
||||
.v-center {
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.h-center {
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.flex {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.space-between {
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.cu-item {
|
||||
font-size: 30rpx;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.search {
|
||||
background-color: #f5f5f5;
|
||||
position: sticky;
|
||||
top: 0;
|
||||
z-index: 10;
|
||||
}
|
||||
|
||||
.cu-bar .search-form {
|
||||
background: #FFFFFF;
|
||||
box-shadow: 0rpx 0rpx 12rpx 2rpx #DDECF3;
|
||||
border-radius: 12rpx;
|
||||
}
|
||||
|
||||
.item-bg {
|
||||
padding: 0 32rpx 20rpx 32rpx;
|
||||
background-color: #f5f5f5;
|
||||
}
|
||||
|
||||
.item {
|
||||
background-color: #ffffff;
|
||||
padding: 32rpx 20rpx 20rpx 20rpx;
|
||||
position: relative;
|
||||
border-radius: 10rpx;
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
.item .head {
|
||||
margin: 0 -20rpx;
|
||||
margin-top: -32rpx;
|
||||
background-color: #CDE5FC;
|
||||
padding: 16rpx;
|
||||
border-radius: 10rpx 10rpx 0 0;
|
||||
}
|
||||
|
||||
.item .head .single {
|
||||
width: 8rpx;
|
||||
height: 36rpx;
|
||||
background: #4882EE;
|
||||
border-radius: 4rpx;
|
||||
}
|
||||
|
||||
.item .head .title {
|
||||
flex: 1;
|
||||
margin-left: 16rpx;
|
||||
font-size: 28rpx;
|
||||
font-weight: bold;
|
||||
color: #4882EE;
|
||||
}
|
||||
|
||||
.item .head .status {
|
||||
font-weight: bold;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
|
||||
.item .tv {
|
||||
font-size: 28rpx;
|
||||
font-weight: 500;
|
||||
color: #222222;
|
||||
padding-top: 20rpx;
|
||||
}
|
||||
|
||||
.item .bottom {
|
||||
font-size: 26rpx;
|
||||
font-weight: bold;
|
||||
color: #222222;
|
||||
}
|
||||
|
||||
.item .val {
|
||||
font-size: 26rpx;
|
||||
font-weight: 500;
|
||||
color: #222222;
|
||||
margin-left: 20rpx;
|
||||
}
|
||||
|
||||
.item .line {
|
||||
margin: 20rpx -20rpx;
|
||||
border-top: 2rpx dashed #f5f5f5;
|
||||
}
|
||||
|
||||
.item .bottom-img {
|
||||
width: calc(100vw - 65rpx);
|
||||
max-width: calc(100vw - 65rpx);
|
||||
height: 40rpx;
|
||||
margin: 0 -20rpx;
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
z-index: -1;
|
||||
}
|
||||
|
||||
.option {
|
||||
position: fixed;
|
||||
bottom: calc(constant(safe-area-inset-bottom) + 30rpx);
|
||||
bottom: calc(env(safe-area-inset-bottom) + 30rpx);
|
||||
left: 0;
|
||||
right: 0;
|
||||
margin-top: 30rpx;
|
||||
padding: 16rpx 32rpx;
|
||||
background: #FFFFFF;
|
||||
box-shadow: 0rpx 0rpx 12rpx 2rpx #DDECF3;
|
||||
z-index: 10;
|
||||
}
|
||||
|
||||
.option .btn {
|
||||
padding: 14rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background: #409CFF;
|
||||
color: #FFFFFF;
|
||||
border-radius: 12rpx;
|
||||
}
|
||||
|
||||
.option .btn:active {
|
||||
opacity: 0.8;
|
||||
}
|
||||
|
||||
.space {
|
||||
height: calc(constant(safe-area-inset-bottom) + 150rpx);
|
||||
height: calc(env(safe-area-inset-bottom) + 150rpx);
|
||||
}
|
||||