开始做工作台的抄表
This commit is contained in:
60
pages/workBench/components/reading/index.js
Normal file
60
pages/workBench/components/reading/index.js
Normal file
@@ -0,0 +1,60 @@
|
||||
// pages/workBench/components/reading/index.js
|
||||
Component({
|
||||
|
||||
/**
|
||||
* 组件的属性列表
|
||||
*/
|
||||
properties: {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 组件的初始数据
|
||||
*/
|
||||
data: {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 组件的方法列表
|
||||
*/
|
||||
methods: {
|
||||
onParkFocus(e) {
|
||||
this.setData({
|
||||
show: true,
|
||||
title: "园区",
|
||||
type: 'park'
|
||||
})
|
||||
},
|
||||
async init() {
|
||||
|
||||
},
|
||||
onConfirm(e) {
|
||||
const { data } = e.detail;
|
||||
const that = this;
|
||||
this.setData({
|
||||
parkName: data.name,
|
||||
park: data.id,
|
||||
}, () => {
|
||||
loadingFunc(async () => {
|
||||
await that.init();
|
||||
})
|
||||
})
|
||||
this.onConcal();
|
||||
},
|
||||
onConcal() {
|
||||
this.setData({
|
||||
show: false,
|
||||
title: "",
|
||||
type: "",
|
||||
})
|
||||
},
|
||||
jumpToReading(e) {
|
||||
const { id } = e.currentTarget.dataset;
|
||||
console.log("id", id, "e", e)
|
||||
wx.navigateTo({
|
||||
url: '/pages/writeReading/index',
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
16
pages/workBench/components/reading/index.json
Normal file
16
pages/workBench/components/reading/index.json
Normal file
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {
|
||||
"van-field": "@vant/weapp/field/index",
|
||||
"van-button": "@vant/weapp/button/index",
|
||||
"search-select": "/components/searchSelect/index",
|
||||
"van-empty": "@vant/weapp/empty/index",
|
||||
"table": "/components/table/table",
|
||||
"pagination": "/components/pagination/index",
|
||||
"empty": "/components/empty/index",
|
||||
"van-radio": "@vant/weapp/radio/index",
|
||||
"van-radio-group": "@vant/weapp/radio-group/index",
|
||||
"van-dialog": "@vant/weapp/dialog/index",
|
||||
"van-cell": "@vant/weapp/cell/index"
|
||||
}
|
||||
}
|
48
pages/workBench/components/reading/index.wxml
Normal file
48
pages/workBench/components/reading/index.wxml
Normal file
@@ -0,0 +1,48 @@
|
||||
<!--pages/workBench/components/reading/index.wxml-->
|
||||
<van-field
|
||||
value="{{ parkName }}"
|
||||
placeholder="请选择园区"
|
||||
label="园区"
|
||||
readonly
|
||||
border="{{ false }}"
|
||||
use-button-slot
|
||||
title-width="100rpx"
|
||||
>
|
||||
<van-button slot="button" size="small" type="primary" bind:click="onParkFocus">
|
||||
选择
|
||||
</van-button>
|
||||
</van-field>
|
||||
|
||||
<search-select
|
||||
show="{{show}}"
|
||||
title="{{title}}"
|
||||
type="{{type}}"
|
||||
park="{{park}}"
|
||||
bindconfirm="onConfirm"
|
||||
bindcancel="onConcal"
|
||||
/>
|
||||
|
||||
|
||||
<van-cell
|
||||
title="路线1"
|
||||
label="包含12个抄表点"
|
||||
>
|
||||
<view slot="right-icon">
|
||||
<!-- <van-icon name="search" class="search-icon" /> -->
|
||||
<van-button type="primary" size="small" type="primary"> 去抄表 </van-button>
|
||||
</view>
|
||||
</van-cell>
|
||||
<van-cell
|
||||
title="路线2"
|
||||
label="包含12个抄表点"
|
||||
>
|
||||
<view slot="right-icon">
|
||||
<!-- <van-icon name="search" class="search-icon" /> -->
|
||||
<van-button
|
||||
type="primary"
|
||||
size="small"
|
||||
bind:tap="jumpToReading"
|
||||
data-id="1234"
|
||||
> 去抄表 </van-button>
|
||||
</view>
|
||||
</van-cell>
|
1
pages/workBench/components/reading/index.wxss
Normal file
1
pages/workBench/components/reading/index.wxss
Normal file
@@ -0,0 +1 @@
|
||||
/* pages/workBench/components/reading/index.wxss */
|
@@ -5,7 +5,7 @@ Page({
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
active: 0
|
||||
active: 3
|
||||
},
|
||||
|
||||
/**
|
||||
|
@@ -5,7 +5,8 @@
|
||||
"navigator": "/components/navigator/index",
|
||||
"approve": "./components/approve/index",
|
||||
"recharge": "./components/recharge/index",
|
||||
"record": "./components/record/index"
|
||||
"record": "./components/record/index",
|
||||
"reading": "./components/reading/index"
|
||||
},
|
||||
"navigationStyle": "custom"
|
||||
}
|
@@ -10,4 +10,7 @@
|
||||
<van-tab title="审核">
|
||||
<approve />
|
||||
</van-tab>
|
||||
<van-tab title="抄表">
|
||||
<reading />
|
||||
</van-tab>
|
||||
</van-tabs>
|
24
pages/writeReading/components/meterInfo/index.js
Normal file
24
pages/writeReading/components/meterInfo/index.js
Normal file
@@ -0,0 +1,24 @@
|
||||
// pages/writeReading/components/meterInfo/index.js
|
||||
Component({
|
||||
|
||||
/**
|
||||
* 组件的属性列表
|
||||
*/
|
||||
properties: {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 组件的初始数据
|
||||
*/
|
||||
data: {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 组件的方法列表
|
||||
*/
|
||||
methods: {
|
||||
|
||||
}
|
||||
})
|
4
pages/writeReading/components/meterInfo/index.json
Normal file
4
pages/writeReading/components/meterInfo/index.json
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {}
|
||||
}
|
2
pages/writeReading/components/meterInfo/index.wxml
Normal file
2
pages/writeReading/components/meterInfo/index.wxml
Normal file
@@ -0,0 +1,2 @@
|
||||
<!--pages/writeReading/components/meterInfo/index.wxml-->
|
||||
<text>pages/writeReading/components/meterInfo/index.wxml</text>
|
1
pages/writeReading/components/meterInfo/index.wxss
Normal file
1
pages/writeReading/components/meterInfo/index.wxss
Normal file
@@ -0,0 +1 @@
|
||||
/* pages/writeReading/components/meterInfo/index.wxss */
|
41
pages/writeReading/components/meterList/index.js
Normal file
41
pages/writeReading/components/meterList/index.js
Normal file
@@ -0,0 +1,41 @@
|
||||
// pages/writeReading/components/meterList/index.js
|
||||
Component({
|
||||
|
||||
/**
|
||||
* 组件的属性列表
|
||||
*/
|
||||
properties: {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 组件的初始数据
|
||||
*/
|
||||
data: {
|
||||
animationData: {}, // 存储动画数据
|
||||
position: -100
|
||||
},
|
||||
lifetimes: {
|
||||
attached() {
|
||||
// 在页面准备就绪时初始化动画实例
|
||||
this.animation = wx.createAnimation({
|
||||
duration: 500, // 动画持续时间,单位 ms
|
||||
timingFunction: 'ease-out', // 动画缓动函数,还可以是 'linear', 'ease-in', 'ease-in-out'
|
||||
delay: 0 // 动画延迟时间
|
||||
});
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 组件的方法列表
|
||||
*/
|
||||
methods: {
|
||||
handleLeft() {
|
||||
// 将动画数据设置到 data 中,从而触发视图更新
|
||||
|
||||
this.setData({
|
||||
position: this.data.position - 100,
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
})
|
6
pages/writeReading/components/meterList/index.json
Normal file
6
pages/writeReading/components/meterList/index.json
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {
|
||||
|
||||
}
|
||||
}
|
24
pages/writeReading/components/meterList/index.wxml
Normal file
24
pages/writeReading/components/meterList/index.wxml
Normal file
@@ -0,0 +1,24 @@
|
||||
<!--pages/writeReading/components/meterList/index.wxml-->
|
||||
|
||||
<view class="wrapper">
|
||||
<view class="title">
|
||||
<text> 电表列表 </text>
|
||||
</view>
|
||||
<view style="display: flex; align-items: center;">
|
||||
<view bind:tap="handleLeft">
|
||||
左
|
||||
</view>
|
||||
<scroll-view
|
||||
scroll-x="{{true}}"
|
||||
class="meterListScrollView"
|
||||
>
|
||||
<view style="width: 1000px; margin-left: {{position}}rpx">
|
||||
12345623425346356356356 12345623425346356356356 12345623425346356356356 12345623425346356356356
|
||||
</view>
|
||||
</scroll-view>
|
||||
<view>
|
||||
右
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
16
pages/writeReading/components/meterList/index.wxss
Normal file
16
pages/writeReading/components/meterList/index.wxss
Normal file
@@ -0,0 +1,16 @@
|
||||
/* pages/writeReading/components/meterList/index.wxss */
|
||||
|
||||
.wrapper {
|
||||
padding: 0 20rpx;
|
||||
}
|
||||
|
||||
.title {
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
|
||||
.meterListScrollView {
|
||||
flex: 1;
|
||||
margin-left: 20rpx;
|
||||
margin-right: 20rpx;
|
||||
overflow: hidden;
|
||||
}
|
66
pages/writeReading/index.js
Normal file
66
pages/writeReading/index.js
Normal file
@@ -0,0 +1,66 @@
|
||||
// pages/writeReading/index.js
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad(options) {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
onReady() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面隐藏
|
||||
*/
|
||||
onHide() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面卸载
|
||||
*/
|
||||
onUnload() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面相关事件处理函数--监听用户下拉动作
|
||||
*/
|
||||
onPullDownRefresh() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面上拉触底事件的处理函数
|
||||
*/
|
||||
onReachBottom() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 用户点击右上角分享
|
||||
*/
|
||||
onShareAppMessage() {
|
||||
|
||||
}
|
||||
})
|
7
pages/writeReading/index.json
Normal file
7
pages/writeReading/index.json
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"usingComponents": {
|
||||
"navigator": "/components/navigator/index",
|
||||
"meter-list": "./components/meterList/index"
|
||||
},
|
||||
"navigationStyle": "custom"
|
||||
}
|
3
pages/writeReading/index.wxml
Normal file
3
pages/writeReading/index.wxml
Normal file
@@ -0,0 +1,3 @@
|
||||
<!--pages/writeReading/index.wxml-->
|
||||
<navigator title="录入抄表记录" canBack="{{true}}" />
|
||||
<meter-list />
|
1
pages/writeReading/index.wxss
Normal file
1
pages/writeReading/index.wxss
Normal file
@@ -0,0 +1 @@
|
||||
/* pages/writeReading/index.wxss */
|
Reference in New Issue
Block a user