| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354 |
- <template>
- <view :class="$isEmpty(list) ? 'bg-white':''">
- <mescroll-body ref="mescrollRef" @init="mescrollInit" @down="downCallback" @up="upCallback" :down="downOption" :up="upOption">
- <!-- <myCarCard @delItem="delItem" :list="list"></myCarCard> -->
- <u-popup v-model="detailShow" mode="center" width="670" :closeable="true" border-radius="10" negative-top="300">
- <view style="padding: 60rpx 5rpx 40rpx;">
- <u-cell-group >
- <u-cell-item :icon-style="iconStyle" :border-top="false" :arrow="false" icon="eye-fill" title="车牌号码:" :value="detailData.number"></u-cell-item>
- <u-cell-item :key="index" v-for="(item,index) in carTypeList" v-if="item.value==detailData.type" :value="item.label" :icon-style="iconStyle" :arrow="false" icon="car-fill" title="车辆类型:" ></u-cell-item>
- <u-cell-item :key="index" v-for="(item,index) in carPropertiesList" v-if="item.value==detailData.properties" :value="item.label" :icon-style="iconStyle" :arrow="false" icon="error-circle-fill" title="车辆性质:" ></u-cell-item>
- <u-cell-item value-style="{'color':'#5064eb'}" :key="index" v-for="(item,index) in fuelCategoryList" v-if="item.value==detailData.fuelCategory" :value="item.label" :icon-style="iconStyle" :border-bottom="false" :arrow="false" icon="grid-fill" title="燃油类别:" ></u-cell-item>
- <u-cell-item v-if="detailData.opinion" :icon-style="iconStyle" :border-top="false" :arrow="false" icon="more-circle-fill" title="审核意见:" :value="detailData.opinion"></u-cell-item>
- </u-cell-group>
- </view>
- </u-popup>
-
- <view @click="detailData=item;detailShow=true" class="card" v-for="(item,index) in list" :key="index">
- <view class="top" >
- <text class="number">车牌号:{{item.number}}</text>
- <!-- <text @click.stop="jump('/pages/index/car/list?carNo='+item.number)" style="text-decoration: underline;margin-top: 10rpx;">出入记录</text> -->
- </view>
- <view class="center">
- <view style="display: flex;">
- <view @click.stop="$util.preview(item.carImg)" class="justify-center align-center">
- <image :src="item.carImg" mode=""></image>
- </view>
- <view class="content">
- <text class="padding-bottom-10">车主姓名:{{item.personName}}</text>
- <text class="padding-top-10">车主电话:{{item.personPhone}}</text>
- <view class="padding-bottom-10" v-if="false">
- 审核状态:
- <text style="color: #008f69;" v-if="item.auditStatus==1">已通过</text>
- <text style="color: #ea7500;" v-if="item.auditStatus==0">待审核</text>
- <text style="color: #da0000;" v-if="item.auditStatus==-1">未通过</text>
- </view>
- </view>
- </view>
-
- </view>
- <view class="bottom" >
- <view @click.stop="edit(item)" style="font-size: 22rpx;" class="cu-btn sm round base-line margin-right-20" >
- <u-icon name="edit-pen-fill" style="padding-right: 10rpx;"></u-icon>
- 编辑
- </view>
- <!-- <view @click.stop="delItem(item)" style="font-size: 22rpx;" class="cu-btn sm round red-line" >
- <u-icon name="edit-pen-fill" style="padding-right: 10rpx;"></u-icon>
- 删除
- </view> -->
- </view>
- </view>
- <view style="height: 80rpx;" v-if="status">
- <u-divider bgColor="#f1f1f1;" height="80">到底了</u-divider>
- </view>
- </mescroll-body>
- <view class="addCar" @click="add">
- <u-icon name="plus-circle-fill" size="70" color="#5064eb"></u-icon>
- </view>
- </view>
- </template>
- <script>
- import MescrollMixin from "@/comps/mescroll-body/mescroll-mixins.js";
- import DtEmpty from '@/comps/dt_empty.vue';
- var app = getApp();
- export default {
- mixins: [MescrollMixin], // 使用mixin
- components: {
- DtEmpty
- },
- data() {
- return {
- list: [],
- iconStyle: {
- color: '#5064eb'
- },
- page: {
- current: 1,
- size:30,
- },
- status: false,
- //详情
- detailShow: false,
- detailData: {},
- carTypeList: [],
- carPropertiesList: [],
- fuelCategoryList: []
- }
- },
- onLoad() {
- // this.personId = this.$cache.get('userId');
- this.getDict();
- },
- onShow() {
- //刷新mescroll数据
- this.$util.reload(this.mescroll);
- },
- methods: {
- add() {
- uni.navigateTo({
- url: "add"
- })
- },
- delItem(item) {
- this.$util.showModal('确认要删除此记录吗?').then(res => {
- // this.$api.car.carRemove(item.id).then(res => {
- // if (res.success == true) {
- // this.$u.toast('操作成功')
- // this.mescroll.resetUpScroll();
- // } else {
- // this.$util.showModal(res.msg, false)
- // }
- // })
- })
- },
- edit(item) {
- //重新编辑,审核状态重置为0
- let params = {
- id: item.id,
- auditOpinion: "",
- auditStatus: 0,
- carImg: item.carImg,
- fuelCategory: item.fuelCategory,
- number: item.number,
- properties: item.properties,
- type: item.type,
- vehicleDrivingLicense1: item.vehicleDrivingLicense1,
- vehicleDrivingLicense2: item.vehicleDrivingLicense2
- }
- uni.navigateTo({
- url:"/pages/myCar/add"+this.$u.queryParams(params)
- })
- },
- jump(url) {
- if (!this.$isEmpty(url)) {
- uni.navigateTo({
- url
- })
- }
- },
- getDict() {
- let carType = uni.getStorageSync("carType");
- let carProperty = uni.getStorageSync("carProperty");
- let fuelCategory = uni.getStorageSync("fuelCategory");
- if (!this.$isEmpty(carType) || !this.$isEmpty(carProperty) || !this.$isEmpty(fuelCategory)) {
- this.carTypeList = carType;
- this.carPropertiesList = carProperty;
- this.fuelCategoryList = fuelCategory;
- return;
- }
-
- // let operation = 'permissions/dict/getByCode?code=car_type';
- let that = this;
- let params = {};
- //车辆类型
- that.$http.getDictByCode("car_type").then (res=>{
- if (res.data.code != 200) {
- app.globalData.oneFailHint(res.data.msg, function () {
- uni.switchTab({
- url:"../index/index"
- })
- });
- }
- res.data.data.forEach((item) => {
- let tmp = {
- value: item.dictKey,
- label: item.dictValue
- }
- that.carTypeList.push(tmp)
- })
- uni.setStorageSync("carType",that.carTypeList)
-
-
- });
-
- //车辆性质
- // operation = "permissions/dict/getByCode?code=car_properties"
- that.$http.getDictByCode("car_properties").then(res=>{
- if (res.data.code != 200) {
- app.globalData.oneFailHint(res.data.msg, function () {
- uni.switchTab({
- url:"../index/index"
- })
- });
- }
- res.data.data.forEach((item) => {
- let tmp = {
- value:item.dictKey,
- label:item.dictValue
- }
- that.carPropertiesList.push(tmp)
- })
- uni.setStorageSync("carProperty",that.carPropertiesList)
-
- });
-
- //燃油类别
- // operation = "permissions/dict/getByCode?code=fuel_category"
- that.$http.getDictByCode("fuel_category").then (res=>{
- if (res.data.code != 200) {
- app.globalData.oneFailHint(res.data.msg, function () {
- uni.switchTab({
- url:"../index/index"
- })
- });
- }
- res.data.data.forEach((item)=>{
- let tmp = {
- value:item.dictKey,
- label:item.dictValue
- }
- that.fuelCategoryList.push(tmp);
- })
- uni.setStorageSync("fuelCategory",that.fuelCategoryList)
-
- });
- },
- downCallback(mescroll){
- setTimeout(()=>{
- this.mescroll.resetUpScroll()
- },1500)
- },
- upCallback(mescroll) {
- let that = this;
- let params = {
- current: mescroll.num,
- size: 10,
- residentialId:uni.getStorageSync("residentialId"),
- memberId:this.vuex_member.id
- }
- try {
- that.$http.carPage(params).then (res=>{
- let data = res.data.data.records
- let total = res.data.data.total;
- mescroll.endBySize(data.length, total);
- if (mescroll.num == 1) {
- that.list = []; //如果是第一页需手动制空列表
- }
- that.list = that.list.concat(data); //追加新数据
-
- });
- } catch(e) {
- this.mescroll.endErr()
- }
- }
- }
- }
- </script>
- <style lang="scss" scoped>
-
- .detail-img {
- display: flex;
- justify-content: space-around;
- text-align: center;
- color: #707175;
-
- view {
- display: flex;
- flex-direction: column;
- width: 48%;
- height: 300rpx;
-
- text{
- padding: 10rpx 0;
- }
- }
- }
-
- .addCar {
- width: 100upx;
- height: 90upx;
- border-radius: 60upx 0 0 60upx;
- position: fixed;
- bottom: 200upx;
- right: 0;
- z-index: 999;
- display: flex;
- justify-content: center;
- align-items: center;
- background: #ffffff;
- box-shadow: -4upx -4upx 30upx #888888;
- }
-
- .base-line{
- font-weight: 800;
- color: #5064eb;
- border: 1rpx solid #5064eb;
- }
-
- .red-line{
- font-weight: 800;
- color: #da0000;
- border: 1rpx solid #da0000;
- }
-
- .card {
- background-color: #FFFFFF;
- margin: 20rpx;
- padding: 0 40rpx;
- border-radius: 20rpx;
- display: flex;
- flex-direction: column;
- image{
- width: 120rpx;
- height: 120rpx;
- }
-
- .top {
- display: flex;
- justify-content: space-between;
- padding: 20rpx 0 20rpx 0rpx;
- border-bottom: 1rpx solid #e5e5e5;
- .number {
- font-size: 34rpx;
- }
-
- .audit {
- font-size: 30rpx;
- }
- }
-
- .center {
- padding: 40rpx 0;
- border-bottom: 1rpx solid #e5e5e5;
- display: flex;
- justify-content: space-between;
- .content {
- padding-left: 30rpx;
- display: flex;
- flex-direction: column;
- font-size: 30rpx;
-
- text {
- padding-bottom: 10rpx;
- }
-
- }
- .record {
- display: flex;
- justify-content: center;
- align-items: center;
- color: #545454;
- }
-
- }
-
- .bottom {
- display: flex;
- justify-content: flex-end;
- padding: 20rpx 0;
- }
- }
- </style>
|