123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177 |
- <template>
- <view class="content">
- <view class="top-content">
- <view class="example-body">
- <text>请选择月份:</text>
- <picker mode="date" @change="bindDateChange" fields="month">
- <view class="uni-input">{{state.date}}</view>
- </picker>
- <button size="mini" style="color: #ffffff;
- backgroundColor: rgb(118, 200, 77);
- borderColor: rgb(118, 200, 77);
- font-size: 26rpx;
- flex-shrink: 0;margin-left: 20rpx;" @click="search()">搜索</button>
- </view>
- </view>
-
-
- <view class="uni-container" v-if="state.listData.length>0">
- <view class="list-item" v-for="(item,index) in state.listData"
- @click="query(item.handleDate,item.vehicleId)">
- <view><text>姓名:</text><text>{{item.customerName}}</text></view>
- <view><text>证件号码:</text><text>{{item.customerIdNum}}</text></view>
- <view><text>通行次数:</text><text>{{item.num}}</text></view>
- <view><text>通行年月:</text><text>{{item.handleDate}}</text></view>
- <view><text>通行车牌号:</text><text>{{state.vehicleNum}}</text></view>
- <view><text>通行车牌颜色:</text><text>{{state.vehicleColor}}</text></view>
- <view><text>月通行总额:</text><text>{{item.money/100}}元</text></view>
- </view>
- <view class="bottom-line" v-if="state.flags">我是有底线的~~~</view>
- </view>
-
- </view>
-
- </template>
-
- <script setup lang="ts">
- import { reactive } from "vue";
- import { onLoad, onReachBottom } from "@dcloudio/uni-app";
- import { monthStatementApi, getUserMsg,monthlyStatementQuery } from "@/utils/network/api.js";
- import { stringToJson } from "@/utils/network/encryption";
- import { request, requestNew } from "@/utils/network/request.js";
- import { getItem, StorageKeys } from "@/utils/storage";
- import { getVehiclePlateColor } from "@/datas/vehiclePlateColor";
- import { msg, navTo } from "@/utils/utils";
- const state = reactive({
- startTime: Date.now(), //日期
- listData: [],
- range: ['', ''],
- flags: false,
- vehicleId: "",
- customerIdNum: "",
- vehicleNum: "",
- vehicleColor: "",
- date: "请选择月份"
- })
- onLoad((option) => {
- console.log("option", option.vehicleId)
- state.vehicleId = option.vehicleId;
- state.vehicleNum = option.vehicleId.split('_')[0];
- state.vehicleColor = getVehiclePlateColor(option.vehicleId.split('_')[1]);
- getUserinfo()
- })
- const bindDateChange = (e) => {
- state.date = e.detail.value
- }
- const getUserinfo = () => {
- const options = {
- type: 2,
- data: { openId: getItem('openId') },
- method: "POST",
- showLoading: true,
- };
- request(getUserMsg, options).then((res) => {
- const data = stringToJson(res.bizContent);
- console.log(data, "用户信息");
- state.customerIdNum = data.customerIdNum
- });
- }
- //业务完成日志
- const search = () => {
- if (state.date == '请选择月份') {
- msg("请选择月份");
- return;
- }
- var data = {
- startTime: state.date,
- // endTime: state.range[1],
- vehicleId: state.vehicleId,
- customerIdNum: state.customerIdNum
- };
- const options = {
- type: 2,
- data: data,
- method: "POST",
- showLoading: true,
- };
-
- requestNew(monthlyStatementQuery, options).then((res) => {
- const data = stringToJson(res.bizContent);
- state.listData = stringToJson(res.bizContent).data
- console.log("业务完成日志", state.listData,)
- });
- }
- const query = (handleDate, vehicleId) => {
- navTo(`/subpackage/personal-center/search/select-card?vehicleId=${vehicleId}&&handleDate=${handleDate}`)
- }
- </script>
-
- <style scoped>
- .top-content {
- position: fixed;
- left: 0;
- top: 0;
- background-color: white;
- width: 100%;
- padding: 20rpx;
- box-sizing: border-box;
- }
-
- .content {
- font-size: 32rpx;
- padding: 20rpx 30rpx;
- background-color: #EEF7F7;
- min-height: 100vh;
- }
-
- .card {
- display: flex;
- margin: 0 20rpx;
- align-items: center;
- }
-
- .title {
- margin-bottom: 20rpx;
- }
-
- .uni-container {
- margin: 50rpx 0;
- margin-top: 150rpx;
- }
-
- .example-body {
- display: flex;
- align-items: center;
- margin-top: 20rpx;
- }
-
- /deep/.uni-date-x {
- height: 76rpx !important;
- }
-
- .list-item {
- width: 95%;
- border-radius: 10rpx;
- margin: 30rpx auto;
- font-size: 28rpx;
- border: 1rpx solid #ccc;
- padding: 12rpx;
- box-sizing: border-box;
- background-color: white;
- }
-
- .list-item>view {
- margin-bottom: 10rpx;
- }
-
- .bottom-line {
- text-align: center;
- margin: 30rpx 0;
- }
-
- .uni-input {
- width: 200rpx;
- border: 1rpx solid #ccc;
- border-radius: 10rpx;
- }
- </style>
|