准备联调抄表记录

This commit is contained in:
2025-09-16 17:35:49 +08:00
194 changed files with 6560 additions and 1095 deletions

View File

@@ -0,0 +1,37 @@
// components/datePicker/index.js
import dayjs from "../../utils/dayjs"
Component({
/**
* 组件的属性列表
*/
properties: {
show: Boolean,
},
/**
* 组件的初始数据
*/
data: {
currentDate: new Date().getTime(),
maxDate: new Date().getTime(),
minDate: new Date(2024, 1, 1).getTime(),
},
lifetimes: {
attached() {
}
},
/**
* 组件的方法列表
*/
methods: {
onCancel() {
this.triggerEvent("cancel")
},
onConfirm(e) {
this.triggerEvent("confirm", { time: dayjs(e.detail).format("YYYY-MM-DD HH:mm:ss") })
}
}
})

View File

@@ -0,0 +1,7 @@
{
"component": true,
"usingComponents": {
"van-popup": "@vant/weapp/popup/index",
"van-datetime-picker": "@vant/weapp/datetime-picker/index"
}
}

View File

@@ -0,0 +1,18 @@
<!--components/datePicker/index.wxml-->
<van-popup
show="{{ show }}"
position="bottom"
bind:close="onClose"
z-index="10000"
>
<van-datetime-picker
type="datetime"
value="{{ currentDate }}"
min-date="{{ minDate }}"
max-date="{{ maxDate }}"
bind:confirm="onConfirm"
bind:cancel="onCancel"
/>
</van-popup>

View File

@@ -0,0 +1 @@
/* components/datePicker/index.wxss */

View File

@@ -0,0 +1,31 @@
// components/Segmented/index.js
Component({
/**
* 组件的属性列表
*/
properties: {
list: Array,
active: Number,
},
/**
* 组件的初始数据
*/
data: {
},
/**
* 组件的方法列表
*/
methods: {
handleChange(e) {
const { index } = e.currentTarget.dataset;
if (index === this.data.active) {
return;
}
this.triggerEvent("change", { index, name: this.data.list[index] })
}
}
})

View File

@@ -0,0 +1,4 @@
{
"component": true,
"usingComponents": {}
}

View File

@@ -0,0 +1,12 @@
<!--components/Segmented/index.wxml-->
<view style="margin: 10rpx 20rpx">
<view
wx:for="{{list}}"
wx:key="index"
class="item {{index === active ? 'active' : ''}}"
bind:tap="handleChange"
data-index="{{index}}"
>
{{ item }}
</view>
</view>

View File

@@ -0,0 +1,19 @@
/* components/Segmented/index.wxss */
.item {
display: inline-block;
padding: 20rpx;
border: 1rpx solid #ccc;
border-right: 0rpx;
font-size: 32rpx;
min-width: 140rpx;
text-align: center;
}
.item:nth-last-child(1) {
border-right: 1rpx solid #ccc;
}
.active {
background-color: var(--middle-green);
}

View File

@@ -17,9 +17,11 @@
<view class="userLevel"> {{ item.level }} </view>
</view>
<view class="synopsis"> {{item.synopsis}}{{item.synopsis}} {{item.synopsis}} </view>
<view class="connect" catch:tap="consult" data-id="{{item.id}}">
<van-icon name="service-o" color="#1989fa" />
<view style="margin-left: 10rpx;color: #1989fa;"> 在线咨询 </view>
<view class="connect" >
<view style="display: flex; align-items: center;" catch:tap="consult" data-id="{{item.id}}">
<van-icon name="service-o" color="#1989fa" />
<view style="margin-left: 10rpx;color: #1989fa;"> 在线咨询 </view>
</view>
</view>
</view>
</view>

View File

@@ -28,7 +28,7 @@
}
.synopsis {
height: 80rpx;
height: 75rpx;
overflow: hidden;
margin-top: 20rpx;
margin-bottom: 10rpx;

View File

@@ -1,3 +1,8 @@
import { alertInfo, alertSuccess, loadingFunc } from "../../utils/index"
import { redeemCoupons } from "../../service/system";
import request from "../../utils/request"
const { OK } = request;
// components/discountCoupon/index.js
Component({
@@ -5,7 +10,8 @@ Component({
* 组件的属性列表
*/
properties: {
type: Number,
data: Object
},
/**
@@ -19,6 +25,52 @@ Component({
* 组件的方法列表
*/
methods: {
handleChange() {
const { data } = this.data;
const that = this;
loadingFunc(async () => {
const { code, message } = await redeemCoupons({ id: data.id, type: 2 })
if (code !== OK) {
alertInfo(message)
return
}
alertSuccess("兑换成功")
that.triggerEvent("change", { id, type: 2 })
})
},
showRemark() {
wx.showModal({
title: '备注',
content: this.data?.data?.remark,
showCancel: false,
complete: (res) => {
if (res.cancel) {
}
if (res.confirm) {
}
}
})
},
handleUseIt() {
alertInfo("敬请期待")
},
async handleUse() {
const { data } = this.data;
const that = this;
loadingFunc(async () => {
const { code, message } = await redeemCoupons({ id: data.id, type: 2 })
if (code !== OK) {
alertInfo(message)
return;
}
alertSuccess("领取成功")
that.triggerEvent("get", { id, type: 1 })
})
}
}
})

View File

@@ -1,4 +1,7 @@
{
"component": true,
"usingComponents": {}
"usingComponents": {
"van-button": "@vant/weapp/button/index",
"van-dialog": "@vant/weapp/dialog/index"
}
}

View File

@@ -1,2 +1,39 @@
<!--components/discountCoupon/index.wxml-->
<text>components/discountCoupon/index.wxml</text>
<view class="wrapper">
<view class="top">
<view class="left">
<view class="typeText">
<text wx:if="{{data.type === 0}}"> 通用优惠券 </text>
<text wx:if="{{data.type === 1}}"> 无门槛优惠券 </text>
<text wx:if="{{data.type === 2}}"> 满减券 </text>
</view>
<view class="time">
有效期至 {{ data.endTime }}
</view>
</view>
<view class="right">
<view class="price">
<text style="font-size: 26rpx;line-height: 26rpx;"> ¥ </text>
<view class="number" wx:if="{{data.discount > 0}}"> {{ data.discount }} 折 </view>
<view class="number" wx:elif="{{data.discountMoney > 0}}"> {{ data.discountMoney }} 元 </view>
<view wx:else> - </view>
</view>
<view class="limit">
满 {{ data.useMin }} 可用
</view>
</view>
</view>
<view class="bottom">
<view class="left" bind:tap="showRemark">
{{data.remark}}
</view>
<view class="right">
<van-button wx:if="{{type === 1}}" type="info" size="small" bind:tap="handleUse">去领取</van-button>
<van-button wx:if="{{type === 2}}" type="info" size="small" bind:tap="handleChange">去兑换</van-button>
<van-button wx:if="{{type === 3}}" type="info" size="small" bind:tap="handleUseIt">去使用</van-button>
</view>
</view>
</view>
<van-dialog id="van-dialog" />

View File

@@ -1 +1,60 @@
/* components/discountCoupon/index.wxss */
/* components/discountCoupon/index.wxss */
.wrapper {
padding: 24rpx;
border-radius: 16rpx;
background-color: #fff;
}
.top {
display: flex;
justify-content: space-between;
border-bottom: 1rpx dashed #ccc;
padding-bottom: 30rpx;
}
.top .right {
color: #fa541c;
}
.price {
display: flex;
align-items: flex-end;
margin-bottom: 14rpx;
}
.typeText {
font-weight: 700;
font-size: 36rpx;
margin-bottom: 20rpx;
}
.time {
font-size: 30rpx;
}
.price {
font-size: 44rpx;
line-height: 44rpx;
}
.limit {
font-size: 30rpx;
}
.bottom {
margin-top: 20rpx;
display: flex;
justify-content: space-between;
align-items: center;
}
.bottom .left {
flex: 1;
max-width: calc(100vw - 60rpx - 250rpx);
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
font-size: 30rpx;
color: rgba(0, 0, 0, 0.7)
}

View File

@@ -1,24 +0,0 @@
// components/input/index.js
Component({
/**
* 组件的属性列表
*/
properties: {
},
/**
* 组件的初始数据
*/
data: {
},
/**
* 组件的方法列表
*/
methods: {
}
})

View File

@@ -1,8 +0,0 @@
<!--components/input/index.wxml-->
<van-field
value="{{ value }}"
placeholder="请输入本次读数"
bind:change="onChange"
border="{{false}}"
custom-style="border: 1rpx solid #ccc; padding: 2px 14rpx; font-size: 32rpx; border-radius: 10rpx;"
/>

View File

@@ -1 +0,0 @@
/* components/input/index.wxss */

View File

@@ -7,6 +7,7 @@ Component({
properties: {
title: String,
canBack: Boolean,
beforeBack: Function,
},
/**
@@ -34,7 +35,11 @@ Component({
* 组件的方法列表
*/
methods: {
back() {
async back() {
const { beforeBack } = this;
if (beforeBack) {
await beforeBack();
}
wx.navigateBack();
}
}

View File

@@ -1,9 +1,9 @@
import { getParkList } from "../../service/park"
import { getLoginParkList, getParkBuildingList } from "../../service/park"
import { getParkSimpleMeterList } from "../../service/meter"
import { alertInfo } from "../../utils/index";
import request from "../../utils/request"
import { payWays } from "../../utils/data";
import { payWays, feeType } from "../../utils/data";
import { getTenementList, getWxTenementList } from "../../service/tenement";
const { OK } = request;
// components/searchSelect/index.js
@@ -17,6 +17,7 @@ Component({
type: String,
show: Boolean,
park: String,
isBack: Boolean,
},
observers: {
"show,type": function(newShow, newType) {
@@ -32,6 +33,7 @@ Component({
columns: [],
searchText: "",
payWays,
feeType,
},
lifetimes: {
attached() {
@@ -60,6 +62,10 @@ Component({
const { index } = event.detail;
const { list = [], type } = this.data;
const item = list[index];
if (!item) {
alertInfo("请选择一项")
return
}
this.setData({
columns: [],
list: [],
@@ -78,6 +84,17 @@ Component({
})
this.triggerEvent("confirm", { data: item, way: index, type } );
},
onFeeTypeConfirm(event) {
const { index } = event.detail;
const { feeType = [], type } = this.data;
const item = feeType[index];
this.setData({
columns: [],
list: [],
searchText: ""
})
this.triggerEvent("confirm", { data: item, way: index, type } );
},
onSearch() {
const { type } = this.data;
switch(type) {
@@ -86,12 +103,18 @@ Component({
return;
case "meter":
this.onSearchMeter();
return
case "tenement":
this.onSearchTenement();
return;
case "building":
this.onSearchBuilding();
return;
}
},
async onSearchPark() {
const { searchText = "" } = this.data;
const { code, message, data: parks = [] } = await getParkList({keyword: searchText});
const { code, message, data: parks = [] } = await getLoginParkList({keyword: searchText});
if (code !== OK) {
alertInfo(message)
return
@@ -109,9 +132,34 @@ Component({
return
}
this.setData({
columns: parks?.map(item => `${item.meterNo}-${item.address}${item.shortName ? '-' + item.shortName : ''}`),
list: parks,
columns: parks?.map(item => `${item.meterNo}-${item.address}${item.shortName ? '-' + item.shortName : ''}`) || [],
list: parks || [],
})
}
},
async onSearchTenement() {
const { searchText = "", park, isBack } = this.data;
const { code, message, data = [] } = isBack ? await getWxTenementList({keyword: searchText, park}) : await getTenementList({keyword: searchText, park});
if (code !== OK) {
alertInfo(message)
return
}
this.setData({
columns: data?.length ? data?.map(item => item?.name) : [],
list: data,
})
},
async onSearchBuilding() {
const { park } = this.data;
const { code, message, buildings: data = [] } = await getParkBuildingList(park);
if (code !== OK) {
alertInfo(message)
return
}
this.setData({
columns: data?.length ? data?.map(item => item?.name) : [],
list: data,
})
},
}
})
})

View File

@@ -3,11 +3,33 @@
show="{{ show }}"
bind:click="onClickHide"
position="bottom"
z-index="100000"
wx:if="{{show}}"
>
<view wx:if="{{type !== 'pay'}}">
<view wx:if="{{type === 'pay'}}">
<van-picker
custom-style="width: 100%;"
columns="{{ payWays }}"
title="{{title}}"
show-toolbar="{{true}}"
bind:cancel="onCancel"
bind:confirm="onPayConfirm"
/>
</view>
<view wx:elif="{{type === 'feeType'}}">
<van-picker
custom-style="width: 100%;"
columns="{{ feeType }}"
title="{{title}}"
show-toolbar="{{true}}"
bind:cancel="onCancel"
bind:confirm="onFeeTypeConfirm"
/>
</view>
<view wx:elif="{{type !== 'pay'}}">
<van-search
value="{{ value }}"
placeholder="请输入搜索关键词"
placeholder="{{type === 'tenement' ? '请输入关键词搜索后选择' : '请输入搜索关键词'}}"
use-action-slot
bind:change="onChangeSearch"
>
@@ -26,14 +48,15 @@
bind:confirm="onConfirm"
/>
</view>
<view wx:else>
<van-picker
custom-style="width: 100%;"
columns="{{ payWays }}"
columns="{{ columns }}"
title="{{title}}"
show-toolbar="{{true}}"
bind:cancel="onCancel"
bind:confirm="onPayConfirm"
bind:confirm="onConfirm"
/>
</view>
</van-popup>

View File

@@ -1,3 +1 @@
/* components/searchSelect/index.wxss */
.van-ellipsis van-picker-column__item {
}

View File

@@ -0,0 +1,48 @@
// components/searchSelectWrapper/index.js
Component({
/**
* 组件的属性列表
*/
properties: {
label: String,
placeholder: String,
text: String,
fieldType: {
type: String,
value: "text"
},
type: {
type: String,
value: "select"
}
},
/**
* 组件的初始数据
*/
data: {
keyword: "",
text: "",
},
/**
* 组件的方法列表
*/
methods: {
onSearch() {
this.triggerEvent("search")
},
onChangeKeyword(e) {
this.setData({ keyword: e.detail });
},
onChangeText(e) {
this.setData({ text: e.detail });
this.triggerEvent("changeText", e.detail)
},
onSearchKeyword() {
this.triggerEvent("searchKeyword", this.data.keyword)
this.setData({ keyword: "" })
}
}
})

View File

@@ -1,6 +1,8 @@
{
"component": true,
"usingComponents": {
"van-icon": "@vant/weapp/icon/index",
"van-button": "@vant/weapp/button/index",
"van-field": "@vant/weapp/field/index"
}
}

View File

@@ -0,0 +1,35 @@
<!--components/searchSelectWrapper/index.wxml-->
<view class="wrapper" wx:if="{{type === 'select'}}">
<view class="label"> {{ label }} </view>
<view class="content" bind:tap="clickTime" bind:tap="onSearch">
<view class="text" wx:if="{{!text}}" style="color: #ccc;"> {{placeholder}} </view>
<view class="text" wx:else> {{text}} </view>
<van-icon name="arrow-down" />
</view>
</view>
<view class="wrapper" wx:if="{{type === 'inputSearch'}}">
<view class="label"> {{ label }} </view>
<view class="inputContent" bind:tap="clickTime">
<van-field
value="{{ value }}"
placeholder="{{placeholder}}"
border="{{ false }}"
bind:change="onChangeKeyword"
custom-style="padding: 0;font-size: 30rpx;line-height: 32rpx;"
/>
</view>
<van-button type="info" size="small" bind:click="onSearchKeyword"> 搜索 </van-button>
</view>
<view class="wrapper" wx:if="{{type === 'input'}}">
<view class="label"> {{ label }} </view>
<view class="inputContent" bind:tap="clickTime">
<van-field
value="{{ value }}"
placeholder="{{placeholder}}"
border="{{ false }}"
type="fieldType"
bind:change="onChangeText"
custom-style="padding: 0;font-size: 30rpx;line-height: 32rpx;"
/>
</view>
</view>

View File

@@ -0,0 +1,37 @@
/* components/searchSelectWrapper/index.wxss */
.wrapper {
display: flex;
align-items: center;
font-size: 30rpx;
padding: 20rpx;
}
.content {
flex: 1;
margin-left: 30rpx;
margin-right: 30rpx;
display: flex;
padding: 10rpx 20rpx;
border-radius: 12rpx;
border: 1rpx solid #ccc;
background-color: #fff;
}
.inputContent {
flex: 1;
margin-left: 30rpx;
margin-right: 30rpx;
display: flex;
padding: 0 20rpx;
border-radius: 12rpx;
border: 1rpx solid #ccc;
background-color: #fff;
}
.text {
flex: 1;
}
.label {
width: 120rpx;
}

View File

@@ -27,6 +27,9 @@ Component({
type: String,
value: '#d6e8ff'
},
topColor: String,
topStyle: String,
bodyStyle: String,
maxLine: {
type: Number,
value: 2

View File

@@ -8,12 +8,19 @@
</wxs>
<scroll-view hidden="{{!showList.length||!showHeader.length}}" scroll-x class="table1-view" style="--max_line:{{maxLine}};--width:{{getTableWidth(tableWidth)}}">
<view class="table1 d-table table-class">
<view class="d-table-row tr-class">
<view class="d-table-cell th-class" wx:for="{{showHeader}}" wx:key="index">{{item.title}}</view>
<view class="d-table-row tr-class" style="{{topColor ? 'background-color: rgb(242,248,246)' : ''}}">
<view class="d-table-cell th-class" style="{{topStyle}}" wx:for="{{showHeader}}" wx:key="index">{{item.title}}</view>
</view>
<view bindtap="onTap" data-index="{{index}}" bindlongpress="onLongPress" class="tr-class d-table-row {{currentIndex===index?'active':''}} {{index%2===0?'tr-class_even':'tr-class_odd'}}" wx:for="{{showList}}" wx:key="index">
<view class="d-table-cell td-class " wx:for="{{showHeader}}" wx:for-item="head" wx:for-index="hindex" wx:key="hindex" style="background-color: {{item[head.key].bg}};color:{{item[head.key].color}}">
<view class="text">
<view
class="d-table-cell td-class"
wx:for="{{showHeader}}"
wx:for-item="head"
wx:for-index="hindex"
wx:key="hindex"
style="background-color: {{item[head.key].bg}};color:{{item[head.key].color}}"
>
<view class="text" style="{{bodyStyle}}">
{{item[head.key].text}}
</view>
</view>

View File

@@ -23,6 +23,7 @@ Component({
year: String,
month: Number,
day: Number,
currentDate: Number,
},
/**
* 组件的初始数据