三轮车购买页面完成

This commit is contained in:
THK3121 2023-10-11 15:54:26 +08:00
parent 8965c01b23
commit 96d0fb5e81
7 changed files with 494 additions and 379 deletions

View File

@ -3,7 +3,9 @@ import {
HEADER,
TOKENNAME,
} from '@/config/app';
import { Toast } from '../libs/uniApi';
import {
Toast
} from '../libs/uniApi';
// import { checkLogin } from '../libs/login';
import store from '../store';
@ -43,3 +45,6 @@ export const upLoadImage = (data)=>{
export const VIDEO_URL = HTTP_REQUEST_URL_THREE + '/api/upload/video'
export const FILE_URL = HTTP_REQUEST_URL_THREE + '/api/upload/file'
// im文件上传
// export const VIDEO_URL_IM = HTTP_REQUEST_URL_THREE + '/api/upload/video'
export const FILE_URL_IM = HTTP_REQUEST_URL_THREE + '/common/im/sendFileMsg'

View File

@ -14,6 +14,10 @@ export const upVehicleApi = (data) => oahttp.post('/vehicle/rentApply', data)
export const applycarApi = (data) => oahttp.post('/vehicle/rentApply', data)
// 显示轨迹
export const locusApi = (data) => oahttp.post('/vehicle/vehicleTrack', data)
// 获取可购买车辆列表
export const canBuyCarListApi = (data) => oahttp.post('/vehicle/vehicleTrack', data)
// 购买车辆
export const buyCarApi = (data) => oahttp.post('/vehicle/vehicleTrack', data)
// 当前车辆位置信息
// export const locusApi = (data) => oahttp.post('/vehicle/vehicleTrack', data)
// api / getCarLocal

View File

@ -1,9 +1,9 @@
<template>
<view class="login">
<!-- <image class="bg-iamge" src="../../static/img/login/login_back_img.png"></image> -->
<hx-lottie :options="options" ref="lottie" style="width: 100vw;height: 100vh;transform: scale(1.3);background-color: #0122c7;"/>
<u-navbar v-if="uniMP" @leftClick="leftClick" bgColor="rgba(0,0,0,0)"
leftIconColor=" #fff" :autoBack="false">
<hx-lottie :options="options" ref="lottie"
style="width: 100vw;height: 100vh;transform: scale(1.3);background-color: #0122c7;" />
<u-navbar v-if="uniMP" @leftClick="leftClick" bgColor="rgba(0,0,0,0)" leftIconColor=" #fff" :autoBack="false">
</u-navbar>
<!-- #ifdef APP-PLUS||H5 -->
<!-- <view style="height: var(--status-bar-height)"></view> -->
@ -18,10 +18,10 @@
</view>
<input @click="getId" class="mobile item" v-model="formData.account" type="tel"
placeholder="输入账号" />
<input style="width: 0;height: 0;opacity: 0;margin: 0;padding: 0;" v-model="formData.account" type="tel"
placeholder="输入账号" />
<input @click="getId" class="mobile item" v-model="formData.password"
maxlength="26" placeholder="输入密码" password type="safe-password" />
<input style="width: 0;height: 0;opacity: 0;margin: 0;padding: 0;" v-model="formData.account"
type="tel" placeholder="输入账号" />
<input @click="getId" class="mobile item" v-model="formData.password" maxlength="26"
placeholder="输入密码" password type="safe-password" />
<!-- <input v-if="current == 1" class="mobile item" v-model="formData.account" placeholder="输入手机号" />
<view v-if="current == 1" class="code item">
<input placeholder="输入验证码" v-model="formData.code" maxlength="6" />
@ -42,7 +42,9 @@
loginAccount,
userInfo
} from "@/api/oaUser.js"
import { getConfig } from "@/api/config.js";
import {
getConfig
} from "@/api/config.js";
import {
Toast
} from "../../libs/uniApi";

View File

@ -4,8 +4,7 @@
<!-- 消息 -->
<view class="content" @click="showPlus=false" id="content" v-show='!showLoading'>
<view class="">
<u-loadmore :status="status"
:loadmore-text="`你正在与${manager_nmae}聊天`" />
<u-loadmore :status="status" :loadmore-text="`你正在与${manager_nmae}聊天`" />
</view>
<view class="task-li" v-for="item,index in list" :key="index">
<view class="" v-if="index %5 ==0" style="text-align: center;">
@ -15,7 +14,8 @@
<view v-if="item.from_user_id!=fromId">
<view class="task-li-r">
<view class="" style="margin-right: 10rpx;">
<u--image :showLoading="true" :src="item.from_user_avatar" shape="circle" width="40px" height="40px"></u--image>
<u--image :showLoading="true" :src="item.from_user_avatar" shape="circle" width="40px"
height="40px"></u--image>
</view>
<view @longpress="copyText(item.content)" class="task-li-content" v-if="item.type=='text'"
style="margin-right: 10rpx;">
@ -35,7 +35,9 @@
<view class="task-li-content" v-if="item.type=='video'"
style="margin-right: 10rpx;position: relative;"
@tap="showOverLayFn(item.content,item.type)">
<u--image :showLoading="true" :src=" item.content+'?x-oss-process=video\/snapshot,t_1000,m_fast,w_800,f_png' " width="100px" height="80px"></u--image>
<u--image :showLoading="true"
:src=" item.content+'?x-oss-process=video\/snapshot,t_1000,m_fast,w_800,f_png' "
width="100px" height="80px"></u--image>
<view class="yl-text">
<u-icon name="play-circle" color='white' size='30'></u-icon>
</view>
@ -68,7 +70,9 @@
<!-- 视频 -->
<view class="task-li-content" v-if="item.type=='video'"
style="margin-right: 10rpx;position: relative;" @tap="showOverLayFn(item.content,item.type)">
<u--image :showLoading="true" :src=" item.content+'?x-oss-process=video\/snapshot,t_1000,m_fast,w_800,f_png' " width="100px" height="80px"></u--image>
<u--image :showLoading="true"
:src=" item.content+'?x-oss-process=video\/snapshot,t_1000,m_fast,w_800,f_png' "
width="100px" height="80px"></u--image>
<view class="yl-text">
<u-icon name="play-circle" color='white' size='30'></u-icon>
</view>
@ -146,7 +150,14 @@
</template>
<script>
import {
sendMsgApi,getMsgListApi,bindScoket,sendFileApi,getAreaManagerApi
FILE_URL_IM
} from "@/api/file.js"
import {
sendMsgApi,
getMsgListApi,
bindScoket,
sendFileApi,
getAreaManagerApi
} from "@/api/bussness.js"
export default {
data() {
@ -293,12 +304,12 @@
let that = this
this.scollNum += 100
setTimeout(() => {
uni.pageScrollTo({  
 scrollTop: that.scollNum,//
uni.pageScrollTo({
scrollTop: that.scollNum, //
success: function() {
console.log('滚动')
}
  })
})
}, 100)
},
@ -353,7 +364,7 @@
that.scrollFn()
console.log(that.local)
uni.uploadFile({
url: "https://worker-task.lihaink.cn/common/im/sendFileMsg",
url: FILE_URL_IM,
filePath: tempFilePath, //
name: 'file',
header: {
@ -405,7 +416,7 @@
that.showPlus = false
that.scrollFn()
uni.uploadFile({
url: "https://worker-task.lihaink.cn/common/im/sendFileMsg",
url: FILE_URL_IM,
filePath: tempFilePath, //
name: 'file',
header: {
@ -457,7 +468,9 @@
this.generateRandId()
this.fromId = JSON.parse(uni.getStorageSync("USER_INFO")).id
getAreaManagerApi({user_id:this.fromId}).then(res=>{
getAreaManagerApi({
user_id: this.fromId
}).then(res => {
this.toId = res.data.to_user_id
this.manager_nmae = res.data.manager_name
getMsgListApi({
@ -483,6 +496,7 @@
},
onLoad() {
console.log(F)
let user = JSON.parse(uni.getStorageSync('USER_INFO'))
this.a = user.avatar
console.log(user.avatar)
@ -538,6 +552,7 @@
font-size: 24rpx;
}
.topflag {
height: 80rpx;
background-color: #F6F7FD;
@ -548,6 +563,7 @@
min-height: 95vh;
background-color: #F6F7FD;
padding-top: 10rpx;
.task-li {
margin-bottom: 20rpx;
}
@ -563,11 +579,13 @@
.task-li-content {
background-color: white;
padding: 20rpx;
padding: 10rpx 20rpx;
line-height: 50rpx;
// line-height: 30rpx;
border-radius: 20rpx;
// color: white;
word-break: break-all;
max-width: 60vw;
max-width: 535rpx;
overflow-wrap: break-word;

View File

@ -1,15 +1,23 @@
<template>
<view class="box">
<view class="car-list" v-for="item,index in carList" :key="index">
<!-- 搜索 -->
<view class="" style="padding:10rpx 20rpx;">
<u-search :showAction="true" bgColor='white' @search="queryCarFn" placeholder="搜索车牌号" actionText="搜索"
:animation="true" v-model="queryCar" @custom='queryCarFn'></u-search>
</view>
<view style="height: 80vh;" v-if="carList.length==0">
<u-empty mode="search" marginTop='100' icon="/static/img/empty/data.png">
</u-empty>
</view>
<view v-else class="car-list" v-for="item,index in carList" :key="index">
<view class="car-info">
<view class="car-info-l">
<view class="">
<u--image :src="a" width="150rpx" height="150rpx"
style="margin-right:20rpx"></u--image>
<u--image :src="a" width="150rpx" height="150rpx" style="margin-right:20rpx"></u--image>
</view>
<view class="car-info-c">
<view class="lincense">
车牌号: 12121545454
车牌号: {{item.lincense}}
</view>
<view class="lincense">
行驶里程: 1212KM
@ -19,46 +27,43 @@
</view>
</view>
</view>
<!-- -->
<view class="car-info-r">
选择该车辆为监管车辆
<view class="" style="margin: 10rpx 50rpx;">
<u-checkbox-group
v-model="checkboxValue1[index]"
placement="column"
@change="checkboxChange(index)"
>
<u-checkbox
>
<u-checkbox-group v-model="item.checked" placement="column" @change="checkboxChange(index)">
<u-checkbox>
</u-checkbox>
</u-checkbox-group>
</view>
<view class="" v-show="index==carCheckedArr[0]">
选择该车辆为监管车辆
</view>
</view>
</view>
</view>
<view class="bottom">
<view class="" @tap="open">
已选择2辆车
已选择{{carCheckedArr.length}}辆车
</view>
<view class="bottom-btn">
<u-button type="primary" text="确定"></u-button>
<view class="bottom-btn" @tap="buyCarFn">
<u-button type="primary" style="background-color: #0122C7;border: none;" text="确定"></u-button>
</view>
</view>
<!-- 组件 -->
<u-popup :show="showPop" mode="bottom" @close="close" @open="open">
<view class="pop">
<view class="check-car-list" v-for="item,index in checkList" :key="index">
<u--image :src="a" width="150rpx" height="150rpx"
></u--image>
<view class="check-car-list" v-for="item,index in carList" v-show="item.checked.length" :key="index">
<u--image :src="a" width="150rpx" height="150rpx"></u--image>
<view class="" style="margin-top: 10rpx;">
dsfdsfdf
{{item.lincense}}
</view>
<view class="pop-check">
<checkbox activeBorderColor='red' color="#FFCC33" backgroundColor='#FFCC33'></checkbox>
<u-checkbox-group v-model="item.checked" @change="popChange(index)">
<u-checkbox>
</u-checkbox>
</u-checkbox-group>
</view>
</view>
</view>
@ -68,39 +73,104 @@
<script scoped>
// import { methods } from '../../uni_modules/uview-ui/libs/mixin/mixin'
import {
canBuyCarListApi,
buyCarApi
} from "@/api/property.js"
import {
Toast
} from "../../libs/uniApi"
export default {
data() {
return {
queryCar: '',
a: "https://tse3-mm.cn.bing.net/th/id/OIP-C.0xzWZj1_A-nzJiUBxrk8XQHaEo?w=298&h=186&c=7&r=0&o=5&pid=1.7",
carList:[1,1,1,1,1,1,,1,1,],
carList: [],
carListI: [{
checked: [],
lincense: '川Y103D1'
}, {
checked: [],
lincense: '川Y103D6'
}, {
checked: [],
lincense: '川Y103D5'
}, {
checked: [],
lincense: '川Y103D4'
}, {
checked: [],
lincense: '川Y103D3'
}, {
checked: [],
lincense: '川Y103D2'
}],
showPop: false,
checkList:[1,1,1,1,1,1,1,1],
checkboxValue1:[],
arr:[]
carCheckeList: [1, 1, 1, 1, 1, 1, 1, 1],
carCheckedArr: []
}
},
methods: {
buyCarFn() {
if (this.carCheckedArr.length == 0) {
Toast("请先选择车辆!")
return
}
// buyCarApi({}).then(res => {
// Toast("!")
// setTimeout(() => {
// uni.navigateTo({
// url: '/subpkg/property/index'
// })
// }, 500)
,methods:{
// })
uni.navigateTo({
url: '/subpkg/property/index'
})
},
queryCarFn() {
this.carList = []
this.carListI.forEach(item => {
if (item.lincense.includes(this.queryCar)) {
this.carList.push(item)
}
})
},
checkboxChange(i) {
if(this.arr.includes(i)){
if (this.carCheckedArr.includes(i)) {
// let index=this.ca
let index = this.carCheckedArr.indexOf(i)
// console.log(index)
this.carCheckedArr.splice(index, 1)
// this.arr
} else {
this.arr.push(i)
this.carCheckedArr.push(i)
}
console.log(this.arr)
// console.log(this.carCheckedArr)
},
popChange(index) {
this.checkboxChange(index)
console.log(this.carCheckedArr)
},
close() {
this.showPop = false
},
open() {
if (this.carCheckedArr.length == 0) return
this.showPop = true
},
change(e) {
console.log(e)
}
},
onLoad() {
// canBuyCarListApi({}).then(res => {
// this.carListI = res.data
// })
this.carList = Array.from(this.carListI);
}
}
@ -110,26 +180,33 @@
.box {
padding-bottom: 100rpx;
}
.car-list {
padding: 20rpx;
background-color: #fff;
// padding-bottom: 200rpx;
.car-info {
display: flex;
justify-content: space-between;
margin-bottom: 20rpx;
.car-info-l {
display: flex;
}
.car-info-c {
display: flex;
flex-direction: column;
justify-content: space-between;
}
.car-info-r {
max-width: 20vw;
}
}
}
.pop {
min-height: 40vh;
display: flex;
@ -138,6 +215,7 @@
padding: 20rpx 10rpx;
padding-right: 0;
padding-bottom: 100rpx;
.check-car-list {
// margin-right: 30rpx;
width: 182.5rpx;
@ -147,12 +225,14 @@
align-items: center;
position: relative;
}
.pop-check {
position: absolute;
right: 0;
top: -5rpx;
}
}
.bottom {
background-color: white;
height: 100rpx;
@ -166,6 +246,7 @@
display: flex;
align-items: center;
justify-content: space-between;
.bottom-btn {
width: 200rpx;
}

View File

@ -8,23 +8,18 @@
<view class="noCar" v-if='company_type==18'>
<!-- 申请 -->
<view class="" v-if="step==6||step==9999">
<u-empty text="你还没有所属车辆哦,请向镇公司申请用车或使用自有车辆并绑定系统~" icon="../../static/img/empty/data.png">
</u-empty>
<view class="">
<mytn text='购买车辆' ></mytn>
<view>
<mytn text='购买车辆' class="buyCar" :position="false" @click="navgo('/subpkg/property/buyCar')">
</mytn>
</view>
<view>
<mytn text='申请用车' class="upCar" :position="false" @click="applycarFn"></mytn>
</view>
<view class="">
<mytn text='上传自有车辆' @click="show=true"></mytn>
</view>
<u-modal :show="show" @close="show=false" :showCancelButton="true" @confirm="upCarFn"
:closeOnClickOverlay="true" @cancel="show=false" title="车辆上传">
<view class="slot-content">
@ -70,7 +65,6 @@
<!-- 等待 -->
<view class="" v-if='[5,-1,0,1,2].includes(step)'>
<view class="loading" v-if='step==5'>
<span>你已提交解除申请,等待签约</span>
<span class="dots">...</span>
@ -90,7 +84,14 @@
<span class="dots">...</span>
</view>
</view>
<!-- 购买车辆 -->
<view class="loading" v-if="datas.type==999999999999999">
<span>您的购车申请已经提交我们正在加快审核中请耐心等待在此期间您可以继续使用车辆完成配送任务哦~</span>
<span class="dots">...</span>
</view>
</view>
<!-- 审核结束 -->
<view class="" v-if="step==4">
<view style="margin-top: 15vh;">
@ -170,7 +171,6 @@
申请用车</u-button>
</view>
</view>
</view>
<!-- 镇街公司 -->
<view v-if='company_type==16'>
@ -188,6 +188,7 @@
</view>
</view>
<text v-if="datas.self_num">自有车辆 {{datas.self_num}}</text>
<!-- <text v-if="datas.self_num">出售车辆 {{datas.self_num}}</text> -->
</view>
<!-- 公告栏 -->
<view class="application_tit" v-if="applicationList.length">
@ -276,7 +277,6 @@
<view class="slot-content">
<u--input placeholder="请输入内容" type="number" v-model="newCarNum"></u--input>
<view style="color: red;font-size: 20rpx;" v-show="novalue">
<view class="" v-if="newCarNum>datas.can_rent_num">
数量超过上限
</view>
@ -300,6 +300,9 @@
</template>
<script>
import {
FILE_URL_IM
} from "@/api/file.js"
import {
getvehicleListApi,
getAgencyListApi,
@ -345,41 +348,21 @@
newcarTit: "",
flag: false,
showpopp: false,
};
},
onLoad() {
// if (true) {
// uni.navigateTo({
// url: '/subpkg/property/vehicle_a'
// })
// }
// getvehicleListApi().then(res => {
// console.log(res)
// // this.getvehicleList = res
// })
// getAgencyListApi().then(res => {
// // this.applicationList=res
// })
this.initIndex()
setTimeout(() => {
this.flag = true
})
},
onShow() {
this.initIndex()
},
onPullDownRefresh() {
this.initIndex()
//
// setTimeout(() => {
// const newList = this.hostProduct.reverse();
// this.hostProduct = newList;
uni.stopPullDownRefresh();
// }, 500)
},
methods: {
@ -423,7 +406,7 @@
},
confirmFn() {
uni.reLaunch({
url: '/subpkg/property/index' //
url: '/subpkg/property/index'
});
},
@ -560,7 +543,19 @@
position: fixed;
bottom: 110rpx;
left: 0;
// z-index: 9999999;
z-index: 1;
width: 100%;
border-radius: 0;
color: #fff;
height: 90rpx;
line-height: 90rpx;
background-color: $theme-oa-color;
}
.buyCar {
position: fixed;
bottom: 220rpx;
left: 0;
z-index: 1;
width: 100%;
border-radius: 0;

View File

@ -69,6 +69,7 @@
height="80px"></u--image>
<view class="text">
<view class="name">租赁合同</view>
<!-- <view class="name">购买合同</view> -->
<view>
<text>{{ datas.create_time}}</text>
</view>
@ -82,6 +83,10 @@
</view>
</view>
</view>
<mybtn text="购买车辆" @click="navTo('/subpkg/property/buyCar')"></mybtn>
</view>
<web-view style="height: 100vh;" :src="pdfUrl" v-if="showPDF"></web-view>
@ -163,6 +168,11 @@
},
methods: {
navTo(url) {
uni.navigateTo({
url
})
},
//
overDateFn(date) {
var specifiedDate = new Date(date);