三轮车购买页面完成

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

@ -1,45 +1,50 @@
import { import {
HTTP_REQUEST_URL_THREE, HTTP_REQUEST_URL_THREE,
HEADER, HEADER,
TOKENNAME, TOKENNAME,
} from '@/config/app'; } from '@/config/app';
import { Toast } from '../libs/uniApi'; import {
Toast
} from '../libs/uniApi';
// import { checkLogin } from '../libs/login'; // import { checkLogin } from '../libs/login';
import store from '../store'; import store from '../store';
function toLogin() { function toLogin() {
store.commit("LOGOUT"); store.commit("LOGOUT");
uni.showToast({ uni.showToast({
title: '请登录', title: '请登录',
icon: 'none', icon: 'none',
duration: 1000 duration: 1000
}); });
} }
function upLoad(url, data) { function upLoad(url, data) {
let Url = HTTP_REQUEST_URL_THREE, let Url = HTTP_REQUEST_URL_THREE,
header = {} header = {}
if (store.state.app.token) header[TOKENNAME] = store.state.app.token; if (store.state.app.token) header[TOKENNAME] = store.state.app.token;
return new Promise((reslove, reject) => { return new Promise((reslove, reject) => {
uni.uploadFile({ uni.uploadFile({
url: Url + '/api' + url, url: Url + '/api' + url,
filePath: data.filePath, filePath: data.filePath,
name: data.name, name: data.name,
success: (uploadFileRes) => { success: (uploadFileRes) => {
uploadFileRes.data = JSON.parse(uploadFileRes.data) uploadFileRes.data = JSON.parse(uploadFileRes.data)
if(uploadFileRes.data.code==1) reslove(uploadFileRes.data) if (uploadFileRes.data.code == 1) reslove(uploadFileRes.data)
else Toast('网络错误') else Toast('网络错误')
}, },
fail: (err) => { fail: (err) => {
Toast('网络错误') Toast('网络错误')
} }
}) })
}); });
} }
export const upLoadImage = (data)=>{ export const upLoadImage = (data) => {
return upLoad('/upload/image', data) return upLoad('/upload/image', data)
} }
export const VIDEO_URL = HTTP_REQUEST_URL_THREE + '/api/upload/video' export const VIDEO_URL = HTTP_REQUEST_URL_THREE + '/api/upload/video'
export const FILE_URL = HTTP_REQUEST_URL_THREE + '/api/upload/file' 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 applycarApi = (data) => oahttp.post('/vehicle/rentApply', data)
// 显示轨迹 // 显示轨迹
export const locusApi = (data) => oahttp.post('/vehicle/vehicleTrack', 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) // export const locusApi = (data) => oahttp.post('/vehicle/vehicleTrack', data)
// api / getCarLocal // api / getCarLocal

View File

@ -1,10 +1,10 @@
<template> <template>
<view class="login"> <view class="login">
<!-- <image class="bg-iamge" src="../../static/img/login/login_back_img.png"></image> --> <!-- <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;"/> <hx-lottie :options="options" ref="lottie"
<u-navbar v-if="uniMP" @leftClick="leftClick" bgColor="rgba(0,0,0,0)" style="width: 100vw;height: 100vh;transform: scale(1.3);background-color: #0122c7;" />
leftIconColor=" #fff" :autoBack="false"> <u-navbar v-if="uniMP" @leftClick="leftClick" bgColor="rgba(0,0,0,0)" leftIconColor=" #fff" :autoBack="false">
</u-navbar> </u-navbar>
<!-- #ifdef APP-PLUS||H5 --> <!-- #ifdef APP-PLUS||H5 -->
<!-- <view style="height: var(--status-bar-height)"></view> --> <!-- <view style="height: var(--status-bar-height)"></view> -->
<!-- #endif --> <!-- #endif -->
@ -18,10 +18,10 @@
</view> </view>
<input @click="getId" class="mobile item" v-model="formData.account" type="tel" <input @click="getId" class="mobile item" v-model="formData.account" type="tel"
placeholder="输入账号" /> placeholder="输入账号" />
<input style="width: 0;height: 0;opacity: 0;margin: 0;padding: 0;" v-model="formData.account" type="tel" <input style="width: 0;height: 0;opacity: 0;margin: 0;padding: 0;" v-model="formData.account"
placeholder="输入账号" /> type="tel" placeholder="输入账号" />
<input @click="getId" class="mobile item" v-model="formData.password" <input @click="getId" class="mobile item" v-model="formData.password" maxlength="26"
maxlength="26" placeholder="输入密码" password type="safe-password" /> placeholder="输入密码" password type="safe-password" />
<!-- <input v-if="current == 1" class="mobile item" v-model="formData.account" placeholder="输入手机号" /> <!-- <input v-if="current == 1" class="mobile item" v-model="formData.account" placeholder="输入手机号" />
<view v-if="current == 1" class="code item"> <view v-if="current == 1" class="code item">
<input placeholder="输入验证码" v-model="formData.code" maxlength="6" /> <input placeholder="输入验证码" v-model="formData.code" maxlength="6" />
@ -42,12 +42,14 @@
loginAccount, loginAccount,
userInfo userInfo
} from "@/api/oaUser.js" } from "@/api/oaUser.js"
import { getConfig } from "@/api/config.js"; import {
getConfig
} from "@/api/config.js";
import { import {
Toast Toast
} from "../../libs/uniApi"; } from "../../libs/uniApi";
import bj from "@/static/animation/bj2.json" import bj from "@/static/animation/bj2.json"
import encrypt from "@/utils/encrypt.js" import encrypt from "@/utils/encrypt.js"
// #ifdef APP-PLUS // #ifdef APP-PLUS
var jpushModule = uni.requireNativePlugin("JG-JPush"); var jpushModule = uni.requireNativePlugin("JG-JPush");
@ -56,11 +58,11 @@
export default { export default {
data() { data() {
return { return {
options: { options: {
data: '', data: '',
}, },
uniMP: false, uniMP: false,
APP_token: '', APP_token: '',
tabList: [{ tabList: [{
name: '账号登录' name: '账号登录'
}, },
@ -74,33 +76,33 @@
terminal: 6, //6APP terminal: 6, //6APP
scene: 1, scene: 1,
register_id: "", register_id: "",
shop_token: "" shop_token: ""
}, },
tips: '获取验证码', tips: '获取验证码',
// refCode: null, // refCode: null,
seconds: 60, seconds: 60,
}; };
}, },
onLoad() { onLoad() {
this.APP_token = uni.getStorageSync('APP_token'); this.APP_token = uni.getStorageSync('APP_token');
this.options.data = bj; this.options.data = bj;
// this.$refs.lottie.call('play'); // this.$refs.lottie.call('play');
this.initTerminal(); this.initTerminal();
}, },
onShow() { onShow() {
if(uni.getStorageSync('uniMP'))this.uniMP = true; if (uni.getStorageSync('uniMP')) this.uniMP = true;
}, },
methods: { methods: {
changeTabs(e) { changeTabs(e) {
this.current = e.index; this.current = e.index;
this.formData.scene = e.index + 1; this.formData.scene = e.index + 1;
}, },
leftClick(e) { leftClick(e) {
uni.sendHostEvent('closeApp', e, (ret) => { uni.sendHostEvent('closeApp', e, (ret) => {
// //
console.log('关闭应用'+JSON.stringify(ret)); console.log('关闭应用' + JSON.stringify(ret));
}); });
}, },
// id // id
getId() { getId() {
// #ifdef APP-PLUS // #ifdef APP-PLUS
@ -118,13 +120,13 @@
if (!this.formData.account) return Toast('账号不能为空'); if (!this.formData.account) return Toast('账号不能为空');
if (this.formData.scene == 1 && !this.formData.password) return Toast('密码不能为空'); if (this.formData.scene == 1 && !this.formData.password) return Toast('密码不能为空');
if (this.formData.scene == 2 && !this.formData.code) return Toast('验证码不能为空'); if (this.formData.scene == 2 && !this.formData.code) return Toast('验证码不能为空');
this.formData.shop_token = uni.getStorageSync('APP_token'); this.formData.shop_token = uni.getStorageSync('APP_token');
let that = this; let that = this;
uni.showLoading({ uni.showLoading({
title: '正在登录中' title: '正在登录中'
}) })
let res = await loginAccount(that.formData); let res = await loginAccount(that.formData);
encrypt.encode('ACT', that.formData); encrypt.encode('ACT', that.formData);
this.$store.commit('SET_USERINFO', { this.$store.commit('SET_USERINFO', {
user: data, user: data,
token: res.data.token token: res.data.token
@ -133,8 +135,8 @@
data data
} = await userInfo(); } = await userInfo();
this.$store.commit('setUserInfo', data); this.$store.commit('setUserInfo', data);
let config = await getConfig(); let config = await getConfig();
this.$store.commit('SET_CONFIG', config.data); this.$store.commit('SET_CONFIG', config.data);
uni.hideLoading() uni.hideLoading()
if (data.is_new_user) { if (data.is_new_user) {
uni.showLoading({ uni.showLoading({
@ -150,13 +152,13 @@
} }
}) })
// #endif // #endif
return uni.reLaunch({ return uni.reLaunch({
url: '/pages/oaHome/oaHome', url: '/pages/oaHome/oaHome',
success: () => { success: () => {
uni.$emit('initOaTask'); // uni.$emit('initOaTask'); //
uni.hideLoading() uni.hideLoading()
} }
}) })
} else uni.navigateTo({ } else uni.navigateTo({
url: '/pages/updatePassword/updatePassword' url: '/pages/updatePassword/updatePassword'
}); });
@ -223,7 +225,7 @@
width: 100vw; width: 100vw;
height: 100vh; height: 100vh;
position: relative; position: relative;
overflow: hidden; overflow: hidden;
background-color: $theme-oa-color; background-color: $theme-oa-color;
/* #ifdef H5 */ /* #ifdef H5 */
// background-image: url("../../static/img/login/login_back_img.png"); // background-image: url("../../static/img/login/login_back_img.png");
@ -238,10 +240,10 @@
// } // }
.body { .body {
position: absolute; position: absolute;
top: 45%; top: 45%;
left: 50%; left: 50%;
transform: translate(-50%, -50%); transform: translate(-50%, -50%);
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
@ -258,9 +260,9 @@
-webkit-background-clip: text; -webkit-background-clip: text;
} }
::v-deep uni-input{ ::v-deep uni-input {
min-height: 0 !important; min-height: 0 !important;
} }
.login-card { .login-card {
width: 694rpx; width: 694rpx;

View File

@ -4,8 +4,7 @@
<!-- 消息 --> <!-- 消息 -->
<view class="content" @click="showPlus=false" id="content" v-show='!showLoading'> <view class="content" @click="showPlus=false" id="content" v-show='!showLoading'>
<view class=""> <view class="">
<u-loadmore :status="status" <u-loadmore :status="status" :loadmore-text="`你正在与${manager_nmae}聊天`" />
:loadmore-text="`你正在与${manager_nmae}聊天`" />
</view> </view>
<view class="task-li" v-for="item,index in list" :key="index"> <view class="task-li" v-for="item,index in list" :key="index">
<view class="" v-if="index %5 ==0" style="text-align: center;"> <view class="" v-if="index %5 ==0" style="text-align: center;">
@ -15,16 +14,17 @@
<view v-if="item.from_user_id!=fromId"> <view v-if="item.from_user_id!=fromId">
<view class="task-li-r"> <view class="task-li-r">
<view class="" style="margin-right: 10rpx;"> <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>
<view @longpress="copyText(item.content)" class="task-li-content" v-if="item.type=='text'" <view @longpress="copyText(item.content)" class="task-li-content" v-if="item.type=='text'"
style="margin-right: 10rpx;"> style="margin-right: 10rpx;">
<view style="color: #576B95;" @click="href(item.content)" v-if="isLink(item.content)"> <view style="color: #576B95;" @click="href(item.content)" v-if="isLink(item.content)">
{{item.content}} {{item.content}}
</view> </view>
<view class="" v-else> <view class="" v-else>
{{item.content}} {{item.content}}
</view> </view>
</view> </view>
<!-- 图片 --> <!-- 图片 -->
<view class="task-li-content" v-if="item.type=='image'" style="margin-right: 10rpx;" <view class="task-li-content" v-if="item.type=='image'" style="margin-right: 10rpx;"
@ -35,7 +35,9 @@
<view class="task-li-content" v-if="item.type=='video'" <view class="task-li-content" v-if="item.type=='video'"
style="margin-right: 10rpx;position: relative;" style="margin-right: 10rpx;position: relative;"
@tap="showOverLayFn(item.content,item.type)"> @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"> <view class="yl-text">
<u-icon name="play-circle" color='white' size='30'></u-icon> <u-icon name="play-circle" color='white' size='30'></u-icon>
</view> </view>
@ -50,15 +52,15 @@
<!-- 文字 --> <!-- 文字 -->
<view class="task-li-content" @longpress="copyText(item.content)" v-if="item.type=='text'" <view class="task-li-content" @longpress="copyText(item.content)" v-if="item.type=='text'"
style="margin-right: 10rpx;"> style="margin-right: 10rpx;">
<!-- {{item.content}} --> <!-- {{item.content}} -->
<view style="color: #576B95;" @click="href(item.content)" v-if="isLink(item.content)"> <view style="color: #576B95;" @click="href(item.content)" v-if="isLink(item.content)">
{{item.content}} {{item.content}}
</view> </view>
<view class="" v-else> <view class="" v-else>
{{item.content}} {{item.content}}
</view> </view>
<!-- <a href="item.content" target="_blank"> {{item.content}}</a> --> <!-- <a href="item.content" target="_blank"> {{item.content}}</a> -->
</view> </view>
<!-- 图片 --> <!-- 图片 -->
<view class="task-li-content" v-if="item.type=='image'" style="margin-right: 10rpx;" <view class="task-li-content" v-if="item.type=='image'" style="margin-right: 10rpx;"
@ -68,7 +70,9 @@
<!-- 视频 --> <!-- 视频 -->
<view class="task-li-content" v-if="item.type=='video'" <view class="task-li-content" v-if="item.type=='video'"
style="margin-right: 10rpx;position: relative;" @tap="showOverLayFn(item.content,item.type)"> 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"> <view class="yl-text">
<u-icon name="play-circle" color='white' size='30'></u-icon> <u-icon name="play-circle" color='white' size='30'></u-icon>
</view> </view>
@ -84,7 +88,7 @@
<view class="task-li-content" style="margin-right: 10rpx;"> <view class="task-li-content" style="margin-right: 10rpx;">
<video :src="item.localSrc" controls id="vi1" style="width: 400rpx; height: 100px;"></video> <video :src="item.localSrc" controls id="vi1" style="width: 400rpx; height: 100px;"></video>
<!-- <image :src="" style="width:200rpx" mode="widthFix"></image> --> <!-- <image :src="" style="width:200rpx" mode="widthFix"></image> -->
<u-loadmore status="loading" loading-text="努力上传中" /> <u-loadmore status="loading" loading-text="努力上传中" />
</view> </view>
<view class="" style="margin-right: 10rpx;"> <view class="" style="margin-right: 10rpx;">
@ -94,7 +98,7 @@
<view class="localTask" v-if="item.localType=='image'"> <view class="localTask" v-if="item.localType=='image'">
<view class="task-li-content" style="margin-right: 10rpx;"> <view class="task-li-content" style="margin-right: 10rpx;">
<image :src="item.localSrc" style="width:200rpx" mode="widthFix"></image> <image :src="item.localSrc" style="width:200rpx" mode="widthFix"></image>
<u-loadmore status="loading" loading-text="努力上传中" /> <u-loadmore status="loading" loading-text="努力上传中" />
</view> </view>
<view class="" style="margin-right: 10rpx;"> <view class="" style="margin-right: 10rpx;">
@ -112,7 +116,7 @@
<view class="bottom"> <view class="bottom">
<!-- --> <!-- -->
<view class="send-col"> <view class="send-col">
<input type="text" class="send-ipt" @focus="scrollFn" v-model="value" placeholder="请输入聊天内容" <input type="text" class="send-ipt" @focus="scrollFn" v-model="value" placeholder="请输入聊天内容"
placeholder-style="color:#DDD;" :cursor-spacing="6"> placeholder-style="color:#DDD;" :cursor-spacing="6">
<u--image :showLoading="true" src="/static/img/bussness/Plus.png" width="32px" height="32px" <u--image :showLoading="true" src="/static/img/bussness/Plus.png" width="32px" height="32px"
@ -146,21 +150,28 @@
</template> </template>
<script> <script>
import { import {
sendMsgApi,getMsgListApi,bindScoket,sendFileApi,getAreaManagerApi FILE_URL_IM
} from "@/api/file.js"
import {
sendMsgApi,
getMsgListApi,
bindScoket,
sendFileApi,
getAreaManagerApi
} from "@/api/bussness.js" } from "@/api/bussness.js"
export default { export default {
data() { data() {
return { return {
showLoading:true, showLoading: true,
a: "https://img1.baidu.com/it/u=716638254,3920932970&fm=253&app=138&size=w931&n=0&f=JPEG&fmt=auto?sec=1695920400&t=aeec3d0e86c23759d5f82b3757e9b442", a: "https://img1.baidu.com/it/u=716638254,3920932970&fm=253&app=138&size=w931&n=0&f=JPEG&fmt=auto?sec=1695920400&t=aeec3d0e86c23759d5f82b3757e9b442",
list: [], list: [],
bind:false, bind: false,
value: "", value: "",
showPlus: false, showPlus: false,
scollNum: 500000000000, scollNum: 500000000000,
client_id: "", client_id: "",
fromId: "", fromId: "",
toId:"", toId: "",
name: "", name: "",
status: "loadmore", status: "loadmore",
page_no: 1, page_no: 1,
@ -170,30 +181,30 @@
overLayType: "", overLayType: "",
local: [], local: [],
localType: "", localType: "",
imageList:[], imageList: [],
sendData:{}, sendData: {},
manager_nmae:"", manager_nmae: "",
msg_id:"", msg_id: "",
aaa:false, aaa: false,
} }
}, },
methods: { methods: {
isLink(text){ isLink(text) {
var pattern = /^(https?:\/\/|www\.|.*\.com).*$/i; var pattern = /^(https?:\/\/|www\.|.*\.com).*$/i;
return pattern.test(text); return pattern.test(text);
}, },
href(url){ href(url) {
// uni.navigate // uni.navigate
plus.runtime.openURL(url); plus.runtime.openURL(url);
// plus.runtime.openUrl(url) // plus.runtime.openUrl(url)
}, },
previewImage(src) { previewImage(src) {
this.imageList[0]=src this.imageList[0] = src
uni.previewImage({ uni.previewImage({
urls: this.imageList, urls: this.imageList,
}) })
}, },
generateRandId() { generateRandId() {
var d = new Date().getTime(); var d = new Date().getTime();
var uuid = "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(c) { var uuid = "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(c) {
@ -202,17 +213,17 @@
return (c == "x" ? r : r & 0x3 | 0x8).toString(16); return (c == "x" ? r : r & 0x3 | 0x8).toString(16);
}); });
// return uuid; // return uuid;
this.msg_id=uuid this.msg_id = uuid
console.log("改变id") console.log("改变id")
}, },
timeFn(time) { timeFn(time) {
time=time*1000 time = time * 1000
const currentDate = new Date(); // const currentDate = new Date(); //
const targetDate = new Date(time); const targetDate = new Date(time);
if (this.isSameDay(currentDate, targetDate)) { if (this.isSameDay(currentDate, targetDate)) {
const hours = targetDate.getHours(); // const hours = targetDate.getHours(); //
const minutes = targetDate.getMinutes(); // const minutes = targetDate.getMinutes(); //
return hours + ':' + (minutes>=10?minutes:'0'+minutes); return hours + ':' + (minutes >= 10 ? minutes : '0' + minutes);
} else if (this.isYesterday(currentDate, targetDate)) { } else if (this.isYesterday(currentDate, targetDate)) {
return '昨天'; return '昨天';
@ -235,7 +246,7 @@
const yesterday = new Date(currentDate.getFullYear(), currentDate.getMonth(), currentDate.getDate() - 1); const yesterday = new Date(currentDate.getFullYear(), currentDate.getMonth(), currentDate.getDate() - 1);
return this.isSameDay(yesterday, targetDate); return this.isSameDay(yesterday, targetDate);
}, },
toast(msg){ toast(msg) {
uni.showToast({ uni.showToast({
title: msg, title: msg,
icon: 'none' icon: 'none'
@ -274,48 +285,48 @@
}, },
getListFn() { getListFn() {
getMsgListApi({ getMsgListApi({
from_user_id:this.fromId, from_user_id: this.fromId,
to_user_id:this.toId, to_user_id: this.toId,
scene:0, scene: 0,
page_no:this.page_no, page_no: this.page_no,
page_size:10 page_size: 10
}).then(res=>{ }).then(res => {
if(res.data.length<=0){ if (res.data.length <= 0) {
uni.stopPullDownRefresh(); uni.stopPullDownRefresh();
this.status="nomore" this.status = "nomore"
return return
} }
this.list=res.data.reverse().concat(this.list ) this.list = res.data.reverse().concat(this.list)
uni.stopPullDownRefresh(); uni.stopPullDownRefresh();
}) })
}, },
scrollFn() { scrollFn() {
let that=this let that = this
this.scollNum+=100 this.scollNum += 100
setTimeout(() => { setTimeout(() => {
uni.pageScrollTo({   uni.pageScrollTo({
 scrollTop: that.scollNum,// scrollTop: that.scollNum, //
success:function(){ success: function() {
console.log('滚动') console.log('滚动')
} }
  }) })
}, 100) }, 100)
}, },
sendFn() { sendFn() {
let that=this let that = this
if (!this.value) { if (!this.value) {
this.toast("消息不能为空") this.toast("消息不能为空")
return return
} }
let data = { let data = {
from_user_id: this.fromId, from_user_id: this.fromId,
to_user_id:this.toId, to_user_id: this.toId,
type: "text", type: "text",
content: this.value, content: this.value,
scene:0, scene: 0,
create_time:(Date.now()/1000), create_time: (Date.now() / 1000),
msg_id:this.msg_id msg_id: this.msg_id
} }
sendMsgApi({ sendMsgApi({
...data ...data
@ -344,39 +355,39 @@
success: res => { success: res => {
const tempFilePath = res.tempFilePaths[0]; const tempFilePath = res.tempFilePaths[0];
that.local.push({ that.local.push({
localType:'image', localType: 'image',
localSrc:tempFilePath, localSrc: tempFilePath,
status:true, status: true,
msg_id:that.msg_id msg_id: that.msg_id
}) })
that.showPlus = false that.showPlus = false
that.scrollFn() that.scrollFn()
console.log(that.local) console.log(that.local)
uni.uploadFile({ uni.uploadFile({
url: "https://worker-task.lihaink.cn/common/im/sendFileMsg", url: FILE_URL_IM,
filePath: tempFilePath, // filePath: tempFilePath, //
name: 'file', name: 'file',
header: { header: {
"Authorization": uni.getStorageSync("TOKEN") "Authorization": uni.getStorageSync("TOKEN")
}, },
formData: { formData: {
from_user_id:that.fromId, from_user_id: that.fromId,
to_user_id:that.toId, to_user_id: that.toId,
scene:0, scene: 0,
msg_id:that.msg_id, msg_id: that.msg_id,
type:'image' type: 'image'
}, },
success: function(uploadRes) { success: function(uploadRes) {
let data=JSON.parse(uploadRes.data).data let data = JSON.parse(uploadRes.data).data
var localIndex =that.local.findIndex(function (element) { var localIndex = that.local.findIndex(function(element) {
return element.msg_id === data.msg_id; return element.msg_id === data.msg_id;
}); });
that.local[localIndex].status=false that.local[localIndex].status = false
that.list.push(data) that.list.push(data)
}, },
fail: function(error) { fail: function(error) {
this.toast('上传失败') this.toast('上传失败')
} }
}); });
@ -396,36 +407,36 @@
success: res => { success: res => {
const tempFilePath = res.tempFilePath; const tempFilePath = res.tempFilePath;
that.local.push({ that.local.push({
localType:'video', localType: 'video',
localSrc:tempFilePath, localSrc: tempFilePath,
status:true, status: true,
msg_id:that.msg_id msg_id: that.msg_id
}) })
that.showPlus = false that.showPlus = false
that.scrollFn() that.scrollFn()
uni.uploadFile({ uni.uploadFile({
url: "https://worker-task.lihaink.cn/common/im/sendFileMsg", url: FILE_URL_IM,
filePath: tempFilePath, // filePath: tempFilePath, //
name: 'file', name: 'file',
header: { header: {
"Authorization": uni.getStorageSync("token") "Authorization": uni.getStorageSync("token")
}, },
formData: { formData: {
from_user_id:that.fromId, from_user_id: that.fromId,
to_user_id:that.toId, to_user_id: that.toId,
scene:0, scene: 0,
msg_id:that.msg_id, msg_id: that.msg_id,
type:'video' type: 'video'
}, // }, //
success: function(uploadRes) { success: function(uploadRes) {
let data=JSON.parse(uploadRes.data).data let data = JSON.parse(uploadRes.data).data
var localIndex =that.local.findIndex(function (element) { var localIndex = that.local.findIndex(function(element) {
return element.msg_id === data.msg_id; return element.msg_id === data.msg_id;
}); });
that.local[localIndex].status=false that.local[localIndex].status = false
that.list.push(data) that.list.push(data)
// //
}, },
@ -453,29 +464,31 @@
}, },
}, },
onShow() { onShow() {
this.page_no=1 this.page_no = 1
this.generateRandId() this.generateRandId()
this.fromId= JSON.parse( uni.getStorageSync("USER_INFO")).id this.fromId = JSON.parse(uni.getStorageSync("USER_INFO")).id
getAreaManagerApi({user_id:this.fromId}).then(res=>{ getAreaManagerApi({
this.toId=res.data.to_user_id user_id: this.fromId
this.manager_nmae=res.data.manager_name }).then(res => {
this.toId = res.data.to_user_id
this.manager_nmae = res.data.manager_name
getMsgListApi({ getMsgListApi({
from_user_id:this.fromId, from_user_id: this.fromId,
to_user_id:this.toId, to_user_id: this.toId,
scene:0, scene: 0,
page_no:1, page_no: 1,
page_size:10 page_size: 10
}).then(res=>{ }).then(res => {
this.showLoading=false this.showLoading = false
this.list=res.data.reverse() this.list = res.data.reverse()
this.scrollFn() this.scrollFn()
}) })
}) })
}, },
async onPullDownRefresh() { async onPullDownRefresh() {
let that=this let that = this
this.status = "loading" this.status = "loading"
this.page_no++ this.page_no++
await this.getListFn() await this.getListFn()
@ -483,39 +496,40 @@
}, },
onLoad() { onLoad() {
let user=JSON.parse(uni.getStorageSync('USER_INFO')) console.log(F)
this.a=user.avatar let user = JSON.parse(uni.getStorageSync('USER_INFO'))
this.a = user.avatar
console.log(user.avatar) console.log(user.avatar)
uni.connectSocket({ uni.connectSocket({
url: 'wss://worker-task.lihaink.cn/wss' url: 'wss://worker-task.lihaink.cn/wss'
}); });
uni.onSocketOpen(function (res) { uni.onSocketOpen(function(res) {
console.log('WebSocket连接已打开'); console.log('WebSocket连接已打开');
}); });
uni.onSocketError(function (res) { uni.onSocketError(function(res) {
console.log('WebSocket连接打开失败请检查'); console.log('WebSocket连接打开失败请检查');
}); });
let that=this let that = this
uni.onSocketMessage(function(res) { uni.onSocketMessage(function(res) {
let data=JSON.parse(res.data) let data = JSON.parse(res.data)
if(data.client_id){ if (data.client_id) {
let client_id= data.client_id let client_id = data.client_id
if(!that.bind){ if (!that.bind) {
bindScoket({ bindScoket({
client_id:client_id, client_id: client_id,
user_id:that.fromId, user_id: that.fromId,
scene:0, scene: 0,
}).then(res=>{ }).then(res => {
that.bind=true that.bind = true
}) })
} }
} }
// //
else if(data.type!='ping') { else if (data.type != 'ping') {
console.log(data) console.log(data)
that.list.push(data) that.list.push(data)
that.scrollFn() that.scrollFn()
} }
}); });
@ -534,10 +548,11 @@
color: white; color: white;
top: 50%; top: 50%;
left: 50%; left: 50%;
transform: translate(-50%,-50%); transform: translate(-50%, -50%);
font-size: 24rpx; font-size: 24rpx;
} }
.topflag { .topflag {
height: 80rpx; height: 80rpx;
background-color: #F6F7FD; background-color: #F6F7FD;
@ -548,6 +563,7 @@
min-height: 95vh; min-height: 95vh;
background-color: #F6F7FD; background-color: #F6F7FD;
padding-top: 10rpx; padding-top: 10rpx;
.task-li { .task-li {
margin-bottom: 20rpx; margin-bottom: 20rpx;
} }
@ -563,11 +579,13 @@
.task-li-content { .task-li-content {
background-color: white; background-color: white;
padding: 20rpx; padding: 10rpx 20rpx;
line-height: 50rpx;
// line-height: 30rpx;
border-radius: 20rpx; border-radius: 20rpx;
// color: white; // color: white;
word-break: break-all; word-break: break-all;
max-width: 60vw; max-width: 535rpx;
overflow-wrap: break-word; overflow-wrap: break-word;

View File

@ -1,136 +1,213 @@
<template> <template>
<view class="box"> <view class="box">
<view class="car-list" v-for="item,index in carList" :key="index"> <!-- 搜索 -->
<view class="car-info"> <view class="" style="padding:10rpx 20rpx;">
<view class="car-info-l"> <u-search :showAction="true" bgColor='white' @search="queryCarFn" placeholder="搜索车牌号" actionText="搜索"
<view class=""> :animation="true" v-model="queryCar" @custom='queryCarFn'></u-search>
<u--image :src="a" width="150rpx" height="150rpx" </view>
style="margin-right:20rpx"></u--image> <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>
</view>
<view class="car-info-c">
<view class="lincense">
车牌号: {{item.lincense}}
</view>
<view class="lincense">
行驶里程: 1212KM
</view>
<view class="lincense">
当前状态: 平台公司闲置中
</view>
</view>
</view> </view>
<view class="car-info-c"> <!-- -->
<view class="lincense"> <view class="car-info-r">
车牌号: 12121545454 <view class="" style="margin: 10rpx 50rpx;">
<u-checkbox-group v-model="item.checked" placement="column" @change="checkboxChange(index)">
<u-checkbox>
</u-checkbox>
</u-checkbox-group>
</view> </view>
<view class="lincense"> <view class="" v-show="index==carCheckedArr[0]">
行驶里程: 1212KM 选择该车辆为监管车辆
</view> </view>
<view class="lincense"> </view>
当前状态: 平台公司闲置中
</view>
</view>
<view class="bottom">
<view class="" @tap="open">
已选择{{carCheckedArr.length}}辆车
</view>
<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 carList" v-show="item.checked.length" :key="index">
<u--image :src="a" width="150rpx" height="150rpx"></u--image>
<view class="" style="margin-top: 10rpx;">
{{item.lincense}}
</view>
<view class="pop-check">
<u-checkbox-group v-model="item.checked" @change="popChange(index)">
<u-checkbox>
</u-checkbox>
</u-checkbox-group>
</view> </view>
</view> </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>
</u-checkbox-group>
</view>
</view>
</view>
</view>
<view class="bottom">
<view class="" @tap="open">
已选择2辆车
</view>
<view class="bottom-btn">
<u-button type="primary" 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="" style="margin-top: 10rpx;">
dsfdsfdf
</view>
<view class="pop-check" >
<checkbox activeBorderColor='red' color="#FFCC33" backgroundColor='#FFCC33'></checkbox>
</view>
</view>
</view>
</u-popup> </u-popup>
</view> </view>
</template> </template>
<script scoped> <script scoped>
// import { methods } from '../../uni_modules/uview-ui/libs/mixin/mixin' // import { methods } from '../../uni_modules/uview-ui/libs/mixin/mixin'
export default{ import {
data(){ canBuyCarListApi,
return{ buyCarApi
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", } from "@/api/property.js"
carList:[1,1,1,1,1,1,,1,1,], import {
showPop:false, Toast
checkList:[1,1,1,1,1,1,1,1], } from "../../libs/uniApi"
checkboxValue1:[], export default {
arr:[] 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: [],
,methods:{ carListI: [{
checkboxChange(i){ checked: [],
if(this.arr.includes(i)){ lincense: '川Y103D1'
// this.arr }, {
}else{ checked: [],
lincense: '川Y103D6'
this.arr.push(i) }, {
checked: [],
lincense: '川Y103D5'
}, {
checked: [],
lincense: '川Y103D4'
}, {
checked: [],
lincense: '川Y103D3'
}, {
checked: [],
lincense: '川Y103D2'
}],
showPop: false,
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)
console.log(this.arr) // })
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.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.carCheckedArr.push(i)
}
// 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)
}
}, },
close() {
this.showPop=false onLoad() {
}, // canBuyCarListApi({}).then(res => {
open(){ // this.carListI = res.data
this.showPop=true // })
}, this.carList = Array.from(this.carListI);
change(e){
console.log(e)
} }
}
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.box{ .box {
padding-bottom: 100rpx; padding-bottom: 100rpx;
} }
.car-list{
.car-list {
padding: 20rpx; padding: 20rpx;
background-color: #fff;
// padding-bottom: 200rpx; // padding-bottom: 200rpx;
.car-info{ .car-info {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
margin-bottom: 20rpx; margin-bottom: 20rpx;
.car-info-l{
.car-info-l {
display: flex; display: flex;
} }
.car-info-c{
.car-info-c {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
justify-content: space-between; justify-content: space-between;
} }
.car-info-r{
.car-info-r {
max-width: 20vw; max-width: 20vw;
} }
} }
} }
.pop{
.pop {
min-height: 40vh; min-height: 40vh;
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
@ -138,7 +215,8 @@
padding: 20rpx 10rpx; padding: 20rpx 10rpx;
padding-right: 0; padding-right: 0;
padding-bottom: 100rpx; padding-bottom: 100rpx;
.check-car-list{
.check-car-list {
// margin-right: 30rpx; // margin-right: 30rpx;
width: 182.5rpx; width: 182.5rpx;
display: flex; display: flex;
@ -147,13 +225,15 @@
align-items: center; align-items: center;
position: relative; position: relative;
} }
.pop-check{
.pop-check {
position: absolute; position: absolute;
right: 0; right: 0;
top: -5rpx; top: -5rpx;
} }
} }
.bottom{
.bottom {
background-color: white; background-color: white;
height: 100rpx; height: 100rpx;
position: fixed; position: fixed;
@ -165,10 +245,11 @@
padding: 0 20rpx; padding: 0 20rpx;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
.bottom-btn{
width: 200rpx; .bottom-btn {
} width: 200rpx;
}
} }
</style> </style>

View File

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

View File

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