From 46fe8133ef7c51df54766c9680595b69bd4c84a7 Mon Sep 17 00:00:00 2001 From: "gao.zhiyuan" Date: Mon, 27 Feb 2023 16:21:31 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BC=95=E5=85=A5=20vant=20UI=20=E7=BB=84?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- weapp/package.json | 2 +- weapp/package/troubleshooting/index.js | 142 +++++++++++++---------- weapp/package/troubleshooting/index.json | 6 +- weapp/package/troubleshooting/index.wxml | 33 +++++- weapp/package/troubleshooting/index.wxss | 54 ++++++++- weapp/project.config.json | 9 +- weapp/project.private.config.json | 15 ++- 7 files changed, 191 insertions(+), 70 deletions(-) diff --git a/weapp/package.json b/weapp/package.json index 140a828..fddc20b 100644 --- a/weapp/package.json +++ b/weapp/package.json @@ -4,9 +4,9 @@ "description": "", "main": ".eslintrc.js", "dependencies": { + "@vant/weapp": "^1.10.14", "tdesign-miniprogram": "^1.0.0-rc.2" }, - "devDependencies": {}, "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, diff --git a/weapp/package/troubleshooting/index.js b/weapp/package/troubleshooting/index.js index b51d75d..3595828 100644 --- a/weapp/package/troubleshooting/index.js +++ b/weapp/package/troubleshooting/index.js @@ -1,66 +1,84 @@ // package/bindTroubleshooting/index.js Page({ - /** - * 页面的初始数据 - */ - data: { - - }, - - /** - * 生命周期函数--监听页面加载 - */ - onLoad(options) { - - }, - - /** - * 生命周期函数--监听页面初次渲染完成 - */ - onReady() { - - }, - - /** - * 生命周期函数--监听页面显示 - */ - onShow() { - - }, - - /** - * 生命周期函数--监听页面隐藏 - */ - onHide() { - - }, - - /** - * 生命周期函数--监听页面卸载 - */ - onUnload() { - - }, - - /** - * 页面相关事件处理函数--监听用户下拉动作 - */ - onPullDownRefresh() { - - }, - - /** - * 页面上拉触底事件的处理函数 - */ - onReachBottom() { - - }, - - /** - * 用户点击右上角分享 - */ - onShareAppMessage() { - - } + /** + * 页面的初始数据 + */ + data: { + // hidden: true, + currentTab: '0', + }, + + // 顶部tab切换 + clickTab (e) { + this.setData({ + currentTab: e.currentTarget.dataset.current + }) + if (e.currentTarget.dataset.current == '0') { + this.setData({ + page: 0, + dataList: [] + }, () => { + // this.getPatrolPlan(); + }) + } else if (e.currentTarget.dataset.current == '1') { + // this.getPatrolRecord(); + } + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad (options) { + + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow () { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom () { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage () { + + } }) \ No newline at end of file diff --git a/weapp/package/troubleshooting/index.json b/weapp/package/troubleshooting/index.json index 8835af0..aa2a0ec 100644 --- a/weapp/package/troubleshooting/index.json +++ b/weapp/package/troubleshooting/index.json @@ -1,3 +1,7 @@ { - "usingComponents": {} + "usingComponents": { + "van-button": "@vant/weapp/button/index", + "van-field": "@vant/weapp/field/index", + "van-cell-group": "@vant/weapp/cell-group/index" + } } \ No newline at end of file diff --git a/weapp/package/troubleshooting/index.wxml b/weapp/package/troubleshooting/index.wxml index 6f32331..42789a1 100644 --- a/weapp/package/troubleshooting/index.wxml +++ b/weapp/package/troubleshooting/index.wxml @@ -1,2 +1,31 @@ - -package/bindTroubleshooting/index.wxml + + + + + + 待办事项 + + + 已办事项 + + + + s + + + + + asd + 按钮 + + + + + + + + + \ No newline at end of file diff --git a/weapp/package/troubleshooting/index.wxss b/weapp/package/troubleshooting/index.wxss index c0f73fc..0ac692f 100644 --- a/weapp/package/troubleshooting/index.wxss +++ b/weapp/package/troubleshooting/index.wxss @@ -1 +1,53 @@ -/* package/bindTroubleshooting/index.wxss */ \ No newline at end of file +/* package/bindTroubleshooting/index.wxss */ +.page { + min-height: 100vh; + background: #F7F7FA; + position: relative; +} + +/* 顶部tab */ +.swiper-tab { + display: flex; + height: 98rpx; + line-height: 98rpx; + width: 100%; + /* position: fixed; */ + top: 0; + z-index: 100; + background: #fff; + border-bottom: 2rpx solid #e8e8e8; +} + +.swiper-tab-item { + flex: 1; + font-size: 28rpx; + text-align: center; + color: #333333; + position: relative; +} + +.noData { + width: 254rpx; + height: 298rpx; + display: block; + margin: 0rpx auto 16rpx; +} + +.noTxt { + font-size: 30rpx; + color: #999; + font-weight: bold; + text-align: center; +} + +/* 任务卡片 */ +.mission-card {} + +.mission-card-title { + background-color: #fff; + overflow: auto; + padding: 24rpx 12rpx; + display: flex; + justify-content: space-between; + align-items: center +} \ No newline at end of file diff --git a/weapp/project.config.json b/weapp/project.config.json index 62fc226..2387fee 100644 --- a/weapp/project.config.json +++ b/weapp/project.config.json @@ -27,9 +27,14 @@ "useApiHook": true, "useApiHostProcess": true, "showShadowRootInWxmlPanel": true, - "packNpmManually": false, + "packNpmManually": true, + "packNpmRelationList": [ + { + "packageJsonPath": "./package.json", + "miniprogramNpmDistDir": "./" + } + ], "enableEngineNative": false, - "packNpmRelationList": [], "minifyWXSS": true, "showES6CompileOption": false, "minifyWXML": true, diff --git a/weapp/project.private.config.json b/weapp/project.private.config.json index 86fa333..b16d2d1 100644 --- a/weapp/project.private.config.json +++ b/weapp/project.private.config.json @@ -4,5 +4,18 @@ "urlCheck": false, "compileHotReLoad": true }, - "projectname": "%E8%BF%90%E7%BB%B4%E5%B7%A1%E6%A3%80" + "projectname": "%E8%BF%90%E7%BB%B4%E5%B7%A1%E6%A3%80", + "condition": { + "miniprogram": { + "list": [ + { + "name": "运维巡检", + "pathName": "package/troubleshooting/index", + "query": "", + "launchMode": "default", + "scene": null + } + ] + } + } } \ No newline at end of file