导入抄表记录完成电表列表部分(未调试)
This commit is contained in:
@@ -1,4 +1,9 @@
|
||||
// pages/workBench/components/reading/index.js
|
||||
import { getMeterReadingRouteList } from "../../../../service/workBench"
|
||||
import { alertError, loadingFunc } from "../../../../utils/index"
|
||||
import request from "../../../../utils/request"
|
||||
const { OK } = request
|
||||
|
||||
Component({
|
||||
|
||||
/**
|
||||
@@ -12,7 +17,8 @@ Component({
|
||||
* 组件的初始数据
|
||||
*/
|
||||
data: {
|
||||
|
||||
park: "",
|
||||
parkName: ""
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -27,7 +33,15 @@ Component({
|
||||
})
|
||||
},
|
||||
async init() {
|
||||
|
||||
const { parkName, park } = this.data;
|
||||
const { code, message, data } = await getMeterReadingRouteList(parkName)
|
||||
if (code !== OK) {
|
||||
alertError(message)
|
||||
return
|
||||
}
|
||||
this.setData({
|
||||
list: data
|
||||
})
|
||||
},
|
||||
onConfirm(e) {
|
||||
const { data } = e.detail;
|
||||
@@ -51,7 +65,6 @@ Component({
|
||||
},
|
||||
jumpToReading(e) {
|
||||
const { id } = e.currentTarget.dataset;
|
||||
console.log("id", id, "e", e)
|
||||
wx.navigateTo({
|
||||
url: '/pages/writeReading/index',
|
||||
})
|
||||
|
@@ -22,27 +22,17 @@
|
||||
bindcancel="onConcal"
|
||||
/>
|
||||
|
||||
<van-empty description="请先选择园区" wx:if="{{!park}}" />
|
||||
|
||||
<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>
|
||||
<view wx:else>
|
||||
<van-cell
|
||||
wx:for="{{list}}"
|
||||
wx:key="id"
|
||||
title="路线1"
|
||||
label="包含12个抄表点"
|
||||
>
|
||||
<view slot="right-icon">
|
||||
<van-button type="primary" size="small" type="primary"> 去抄表 </van-button>
|
||||
</view>
|
||||
</van-cell>
|
||||
</view>
|
||||
|
@@ -1,4 +1,8 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {}
|
||||
"usingComponents": {
|
||||
"van-tag": "@vant/weapp/tag/index",
|
||||
"van-row": "@vant/weapp/row/index",
|
||||
"van-col": "@vant/weapp/col/index"
|
||||
}
|
||||
}
|
@@ -1,2 +1,61 @@
|
||||
<!--pages/writeReading/components/meterInfo/index.wxml-->
|
||||
<text>pages/writeReading/components/meterInfo/index.wxml</text>
|
||||
<view class="wrapper">
|
||||
<view class="title">
|
||||
<text> 电表列表 </text>
|
||||
</view>
|
||||
<view class="info">
|
||||
<view class="title">
|
||||
<view class="address">
|
||||
标1东-307
|
||||
</view>
|
||||
<view class="meterType">
|
||||
<van-tag type="primary">华昌宝能收费</van-tag>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
<view class="detail">
|
||||
<van-row gutter="20">
|
||||
<van-col span="12">
|
||||
<view class="text">
|
||||
<view>
|
||||
编号
|
||||
</view>
|
||||
<view>
|
||||
1202312423524
|
||||
</view>
|
||||
</view>
|
||||
</van-col>
|
||||
<van-col span="12">
|
||||
<view class="text">
|
||||
<view>
|
||||
编号
|
||||
</view>
|
||||
<view>
|
||||
1202312423524
|
||||
</view>
|
||||
</view>
|
||||
</van-col>
|
||||
<van-col span="12">
|
||||
<view class="text">
|
||||
<view>
|
||||
编号
|
||||
</view>
|
||||
<view>
|
||||
1202312423524
|
||||
</view>
|
||||
</view>
|
||||
</van-col>
|
||||
<van-col span="12">
|
||||
<view class="text">
|
||||
<view>
|
||||
编号
|
||||
</view>
|
||||
<view>
|
||||
1202312423524
|
||||
</view>
|
||||
</view>
|
||||
</van-col>
|
||||
</van-row>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
@@ -1 +1,33 @@
|
||||
/* pages/writeReading/components/meterInfo/index.wxss */
|
||||
/* pages/writeReading/components/meterInfo/index.wxss */
|
||||
|
||||
.wrapper {
|
||||
padding: 0 20rpx 20rpx;
|
||||
}
|
||||
|
||||
.info {
|
||||
margin-top: 20rpx;
|
||||
padding: 20rpx;
|
||||
border-radius: 15rpx;
|
||||
background-color: white;
|
||||
}
|
||||
|
||||
.info .title {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.info .title .address {
|
||||
font-size: 36rpx;
|
||||
font-weight: 800;
|
||||
}
|
||||
|
||||
.info .detail {
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
|
||||
.info .detail .text {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
font-size: 30rpx;
|
||||
}
|
@@ -0,0 +1,32 @@
|
||||
// pages/writeReading/components/meterList/components/meterItem/index.js
|
||||
Component({
|
||||
|
||||
/**
|
||||
* 组件的属性列表
|
||||
*/
|
||||
properties: {
|
||||
active: Boolean,
|
||||
},
|
||||
observers: {
|
||||
"active": function (newValue) {
|
||||
this.setData({
|
||||
isDeep: newValue
|
||||
})
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 组件的初始数据
|
||||
*/
|
||||
data: {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 组件的方法列表
|
||||
*/
|
||||
methods: {
|
||||
onClick: function() {
|
||||
this.triggerEvent("click")
|
||||
}
|
||||
}
|
||||
})
|
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {}
|
||||
}
|
@@ -0,0 +1,4 @@
|
||||
<!--pages/writeReading/components/meterList/components/meterItem/index.wxml-->
|
||||
<view class="wrapper {{isDeep ? 'deepBg' : ''}}" bind:tap="onClick">
|
||||
标1东-3071312452636756756857
|
||||
</view>
|
@@ -0,0 +1,22 @@
|
||||
/* pages/writeReading/components/meterList/components/meterItem/index.wxss */
|
||||
|
||||
.wrapper {
|
||||
border-radius: 20rpx;
|
||||
padding: 20rpx;
|
||||
margin-bottom: 30rpx;
|
||||
width: 200rpx;
|
||||
box-sizing: border-box;
|
||||
margin-right: 20rpx;
|
||||
background-color: white;
|
||||
word-break: break-all;
|
||||
overflow: hidden;
|
||||
font-size: 32rpx;
|
||||
height: 150rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.deepBg {
|
||||
background-color: var(--deep-green);
|
||||
color: white;
|
||||
}
|
@@ -13,7 +13,7 @@ Component({
|
||||
*/
|
||||
data: {
|
||||
animationData: {}, // 存储动画数据
|
||||
position: -100
|
||||
position: 0
|
||||
},
|
||||
lifetimes: {
|
||||
attached() {
|
||||
@@ -31,11 +31,35 @@ Component({
|
||||
methods: {
|
||||
handleLeft() {
|
||||
// 将动画数据设置到 data 中,从而触发视图更新
|
||||
|
||||
const currentPosition = this.data.position
|
||||
if (currentPosition === 0) {
|
||||
this.setData({
|
||||
position: currentPosition,
|
||||
});
|
||||
return;
|
||||
}
|
||||
this.setData({
|
||||
position: this.data.position - 100,
|
||||
position: this.data.position + 300,
|
||||
});
|
||||
|
||||
},
|
||||
handleRight() {
|
||||
// // 将动画数据设置到 data 中,从而触发视图更新
|
||||
// const currentPosition = this.data.position
|
||||
// if (currentPosition === 0) {
|
||||
// this.setData({
|
||||
// position: currentPosition,
|
||||
// });
|
||||
// return;
|
||||
// }
|
||||
|
||||
this.setData({
|
||||
position: this.data.position - 300,
|
||||
});
|
||||
|
||||
},
|
||||
onChangeMeter() {
|
||||
console.log("---------------")
|
||||
}
|
||||
}
|
||||
})
|
@@ -1,6 +1,7 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {
|
||||
|
||||
"van-icon": "@vant/weapp/icon/index",
|
||||
"meter-item": "./components/meterItem/index"
|
||||
}
|
||||
}
|
@@ -4,21 +4,26 @@
|
||||
<view class="title">
|
||||
<text> 电表列表 </text>
|
||||
</view>
|
||||
<view style="display: flex; align-items: center;">
|
||||
<view bind:tap="handleLeft">
|
||||
左
|
||||
</view>
|
||||
<view style="display: flex; align-items: center;margin-top: 20rpx;">
|
||||
<van-icon name="arrow-left" size="50rpx" bind:tap="handleLeft" />
|
||||
<scroll-view
|
||||
scroll-x="{{true}}"
|
||||
class="meterListScrollView"
|
||||
>
|
||||
<view style="width: 1000px; margin-left: {{position}}rpx">
|
||||
12345623425346356356356 12345623425346356356356 12345623425346356356356 12345623425346356356356
|
||||
<view style="margin-left: {{position}}rpx; display: flex;">
|
||||
<meter-item active="{{true}}" />
|
||||
<meter-item active="{{false}}" bind:click="onChangeMeter" />
|
||||
<meter-item active="{{false}}" />
|
||||
<meter-item active="{{false}}" />
|
||||
<meter-item active="{{false}}" />
|
||||
<meter-item active="{{false}}" />
|
||||
<meter-item active="{{false}}" />
|
||||
<meter-item active="{{false}}" />
|
||||
<meter-item active="{{false}}" />
|
||||
<meter-item active="{{false}}" />
|
||||
</view>
|
||||
</scroll-view>
|
||||
<view>
|
||||
右
|
||||
</view>
|
||||
<van-icon name="arrow" size="50rpx" bind:tap="handleRight" />
|
||||
</view>
|
||||
|
||||
</view>
|
||||
|
@@ -1,7 +1,7 @@
|
||||
/* pages/writeReading/components/meterList/index.wxss */
|
||||
|
||||
.wrapper {
|
||||
padding: 0 20rpx;
|
||||
padding: 0 20rpx 20rpx;
|
||||
}
|
||||
|
||||
.title {
|
||||
@@ -12,5 +12,9 @@
|
||||
flex: 1;
|
||||
margin-left: 20rpx;
|
||||
margin-right: 20rpx;
|
||||
overflow: hidden;
|
||||
overflow-x: hidden;
|
||||
}
|
||||
|
||||
page {
|
||||
background-color: #ebedf0;
|
||||
}
|
@@ -1,7 +1,8 @@
|
||||
{
|
||||
"usingComponents": {
|
||||
"navigator": "/components/navigator/index",
|
||||
"meter-list": "./components/meterList/index"
|
||||
"meter-list": "./components/meterList/index",
|
||||
"meter-info": "./components/meterInfo/index"
|
||||
},
|
||||
"navigationStyle": "custom"
|
||||
}
|
@@ -1,3 +1,4 @@
|
||||
<!--pages/writeReading/index.wxml-->
|
||||
<navigator title="录入抄表记录" canBack="{{true}}" />
|
||||
<meter-list />
|
||||
<meter-list />
|
||||
<meter-info />
|
Reference in New Issue
Block a user