This commit is contained in:
ChuShiZ 2024-08-28 22:02:00 +08:00
parent 3ea34df13e
commit 8a515698ff
772 changed files with 90902 additions and 11 deletions

15
.gitignore vendored
View File

@ -1,11 +1,4 @@
# ---> Vue
# gitignore template for Vue.js projects
#
# Recommended template: Node.gitignore
# TODO: where does this rule come from?
docs/_book
# TODO: where does this rule come from?
test/
/unpackage/
/node_modules/
/.idea
/.hbuilderx/

108
App.vue Normal file
View File

@ -0,0 +1,108 @@
<script>
import config from '@/config'
import request from './utils/request';
import {
setTenantId,
getToken
} from '@/utils/auth'
export default {
onLaunch: function() {
/*#ifdef MP*/
return
/*#endif*/
if (!getToken()) {
return
}
console.log('rescueDriverVersion');
let version = config.appInfo.version
request({
url: '/system/config/configKey/rescueDriverVersion',
method: 'get',
params: ''
}).then(res => {
if (res.code == 200 && res.msg && res.msg != version) {
uni.showModal({
title: '版本升级',
content: '新版本上线了,根据您自己的选择是否升级',
showCancel: true,
confirmText: '升级',
success: res => {
if (res.cancel) return;
let waiting = plus.nativeUI.showWaiting("正在下载 - 0%");
// uni.showLoading({
// title: ''
// });
// wgt
const downloadTask = uni.downloadFile({
url: 'http://159.75.168.143:88/apk/rescueDriver.apk',
success: res => {
if (res.statusCode !== 200) {
console.error('下载安装包失败', err);
return;
}
//
plus.runtime.install(res.tempFilePath, {
force: false
}, () => {
uni.hideLoading()
if (is_mandatory) {
//app
plus.runtime.restart();
return;
}
uni.showModal({
title: '安装成功是否重启?',
success: res => {
if (res.confirm) {
//app
plus.runtime.restart();
}
}
});
}, err => {
uni.hideLoading()
uni.showModal({
title: '更新失败',
content: err.message,
showCancel: false
});
});
},
//
complete: () => {
uni.hideLoading();
downloadTask.offProgressUpdate(); //
}
});
//
downloadTask.onProgressUpdate(res => {
waiting.setTitle("正在下载 - " + res.progress + "%");
});
}
});
}
})
},
onShow: function() {
console.log('App Show')
},
onHide: function() {
console.log('App Hide')
}
}
</script>
<style lang="scss">
// @import "uview-ui/index.scss";
@import "@/node_modules/uview-ui/index.scss";
/*每个页面公共css */
</style>

58
api/login.js Normal file
View File

@ -0,0 +1,58 @@
import request from '@/utils/request'
// 登录方法
export function login(username, password, code, uuid) {
const data = {
username,
password,
code,
uuid
}
return request({
'url': '/rescue/driverLogin',
headers: {
isToken: false
},
'method': 'post',
'data': data
})
}
// 获取用户详细信息
export function getInfo() {
return request({
'url': '/getInfo',
'method': 'get'
})
}
// 退出方法
export function logout() {
return request({
'url': '/logout',
'method': 'post'
})
}
// 获取验证码
export function getCodeImg() {
return request({
'url': '/captchaImage',
headers: {
isToken: false
},
method: 'get',
timeout: 20000
})
}
// 使用租户域名(标识),获得租户编号
export function getTenantIdByWebsite(website) {
return request({
url: '/system/tenant/get-by-website',
method: 'get',
params: {
website
}
})
}

41
api/system/user.js Normal file
View File

@ -0,0 +1,41 @@
import upload from '@/utils/upload'
import request from '@/utils/request'
// 用户密码重置
export function updateUserPwd(oldPassword, newPassword) {
const data = {
oldPassword,
newPassword
}
return request({
url: '/system/user/profile/updatePwd',
method: 'put',
params: data
})
}
// 查询用户个人信息
export function getUserProfile() {
return request({
url: '/system/user/profile',
method: 'get'
})
}
// 修改用户个人信息
export function updateUserProfile(data) {
return request({
url: '/system/user/profile',
method: 'put',
data: data
})
}
// 用户头像上传
export function uploadAvatar(data) {
return upload({
url: '/system/user/profile/avatar',
name: data.name,
filePath: data.filePath
})
}

View File

@ -0,0 +1,239 @@
<template>
<view class="bottoms">
<view class="box" @click="getgogo(1)">
<view class="imgs">
<image src="../../static/detection/sy.png" v-show="aindex == 1"></image>
<image src="../../static/detection/syw.png" v-show="aindex != 1"></image>
</view>
<view class="xzz" v-show="aindex == 1">首页</view>
<view class="wxz" v-show="aindex != 1">首页</view>
</view>
<view class="box" @click="getgogo(2)">
<view class="imgs" style="position: relative;">
<view class="hongdian" v-if=" msgNum != 0">
{{msgNum}}
</view>
<image src="../../static/detection/dd.png" v-show="aindex == 2"></image>
<image src="../../static/detection/ddw.png" v-show="aindex != 2"></image>
</view>
<view class="xzz" v-show="aindex == 2">通知</view>
<view class="wxz" v-show="aindex != 2">通知</view>
</view>
<view class="box" @click="getgogo(3)">
<view class="imgs">
<image src="../../static/detection/wd.png" v-show="aindex == 3"></image>
<image src="../../static/detection/wdw.png" v-show="aindex != 3"></image>
</view>
<view class="xzz" v-show="aindex == 3">我的</view>
<view class="wxz" v-show="aindex != 3">我的</view>
</view>
</view>
</template>
<script>
const innerAudioContext = uni.createInnerAudioContext();
const jyJPush = uni.requireNativePlugin('JY-JPush');
import request from '../../utils/request';
export default {
data() {
return {
msgSocket: this.$msgSocket,
aindex: 1,
chuan: 0,
msgNum: 0,
nowPageInterval: null,
arr: [{
text: '首页'
},
{
text: '个人中心'
},
],
}
},
props: {
msg: String
},
onLoad() {
},
onUnload() {
if (this.nowPageInterval) {
clearTimeout(this.nowPageInterval);
}
},
mounted() {
if (!this.nowPageInterval) {
this.nowPageInterval = setInterval(() => {
this.msgSocket = this.$msgSocket
}, 3000);
}
console.log("msgSocket赋值");
this.aindex = this.msg
setTimeout(() => {
this.msgInfo()
}, 2000);
this.getbottom()
},
watch: {
msgSocket(newVal, oldVal) {
console.log('msgSocket值发生变化', newVal, oldVal)
this.msgInfo()
},
deep: true,
},
methods: {
dianyidain() {
console.log('执行了dianyidain');
innerAudioContext.src = 'https://www.nuoyunr.com/lananRsc/rescue/msgV.mp3';
//
const playCount = 5;
let currentCount = 0;
//
innerAudioContext.onEnded(() => {
//
currentCount++;
//
if (currentCount < playCount) {
//
innerAudioContext.play();
} else {
//
console.log('播放完成');
}
});
//
innerAudioContext.play();
},
msgInfo() {
console.log(this.msgSocket, 'msgSocket')
if (this.msgSocket) {
console.log('消息回调启动成功')
this.msgSocket.onMessage(res => {
console.log("发出提示音");
this.getbottom();
this.dianyidain()
})
}
},
async getbottom() {
let res = await request({
url: '/announcement/announcement/getOwnNoRead',
method: 'get',
})
if (res.code == 200) {
this.msgNum = res.data
// #ifdef APP
plus.runtime.setBadgeNumber(0)
// #endif
console.log("清除角标");
}
},
async getlooklook() {
let res = await request({
url: '/announcement/announcement/setAllRead',
method: 'get',
})
},
getgogo(index) {
if (index == 1) {
this.aindex = index
uni.reLaunch({
url: '/pages/index/index'
});
}
if (index == 2) {
this.aindex = index
uni.reLaunch({
url: '/pages/message/message'
});
// this.getlooklook()
}
if (index == 3) {
this.aindex = index
uni.reLaunch({
url: '/pages/my/my'
});
}
},
},
}
</script>
<style scoped lang="scss">
.bottoms {
width: 100%;
height: 50px;
position: fixed;
bottom: 0px;
background: white;
display: flex;
justify-content: space-between;
font-size: 14px;
font-weight: 400;
}
.box {
width: 50%;
text-align: center;
font-size: 12px;
}
.hongdian {
width: 12px;
height: 12px;
background-color: crimson;
border-radius: 50%;
overflow: hidden;
position: absolute;
top: -5px;
right: -8px;
z-index: 9999;
display: flex;
align-items: center;
justify-content: center;
color: white;
font-size: 2px;
}
.imgs {
margin: 0 auto;
margin-top: 10px;
width: 18px;
height: 16px;
image {
width: 100%;
height: 100%;
}
}
.xzz {
color: #0D2E8D;
}
.wxz {
color: #AAAAAA;
}
</style>

30
config.js Normal file
View File

@ -0,0 +1,30 @@
// 应用全局配置
module.exports = {
baseUrl: 'http://192.168.1.8:48080/admin-api',
// baseUrl: 'http://127.0.0.1:8011/rescue',
// baseUrl: 'http://47.95.206.185:8011/rescue',
imagesUrl: 'http://shequ.0315e.com/static/images/pages/',
wsUrl: 'ws://47.95.206.185:8011/rescue',
//wsUrl: 'ws://192.168.0.149:8011/rescue',
// 应用信息
appInfo: {
// 应用名称
name: "ruoyi-app",
// 应用版本
version: "2.6",
// 应用logo
logo: "/static/logo.png'",
// 官方网站
site_url: "http://ruoyi.vip",
// 政策协议
agreements: [{
title: "隐私政策",
url: "https://ruoyi.vip/protocol.html"
},
{
title: "用户服务协议",
url: "https://ruoyi.vip/protocol.html"
}
]
}
}

20
index.html Normal file
View File

@ -0,0 +1,20 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<script>
var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') ||
CSS.supports('top: constant(a)'))
document.write(
'<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' +
(coverSupport ? ', viewport-fit=cover' : '') + '" />')
</script>
<title></title>
<!--preload-links-->
<!--app-context-->
</head>
<body>
<div id="app"><!--app-html--></div>
<script type="module" src="/main.js"></script>
</body>
</html>

96
main.js Normal file
View File

@ -0,0 +1,96 @@
import App from './App'
import config from '@/config'
const baseUrl = config.baseUrl
Vue.prototype.$baseUrl = baseUrl;
const wsUrl = config.wsUrl
Vue.prototype.$wsUrl = wsUrl;
// main.js注意要在use方法之后执行
import uView from "uview-ui";
Vue.use(uView);
// orderSocket
import {
connect,
sendSocketMessage,
closeSocket
} from './utils/orderSocket.js'
let SocketTask;
let timerId;
export function startSocketConnect(driverId) {
SocketTask = null
SocketTask = connect(driverId);
if (!timerId && uni.getStorageSync('driverInfo')) {
timerId = setInterval(() => {
sendSocketMessage(SocketTask)
}, 10000);
}
}
export function closeSocketMain(driverId) {
clearInterval(timerId);
closeSocket(SocketTask);
}
Vue.prototype.$startSocketConnect = startSocketConnect
Vue.prototype.$closeSocketMain = closeSocketMain
// tabBarSocket
import {
tabBarconnect,
closeMsgSocket,
sendMsg
} from './utils/tebBarSocket.js'
let msgTimer;
let msgSocket;
export function startMsgSocket(userId) {
msgSocket = null
msgSocket = tabBarconnect(userId);
if (!msgTimer && uni.getStorageSync('driverInfo')) {
msgTimer = setInterval(() => {
sendMsg(msgSocket)
}, 10000);
}
Vue.prototype.$msgSocket = msgSocket
}
Vue.prototype.$startMsgSocket = startMsgSocket; //userid
export function tabBarcloseSocket() {
closeMsgSocket;
}
export function getclearInterval() {
console.log('执行关闭请求');
clearInterval(timerId);
clearInterval(msgTimer);
timerId = undefined;
msgTimer = undefined;
}
Vue.prototype.$getclearInterval = getclearInterval;
// #ifndef VUE3
import Vue from 'vue'
import './uni.promisify.adaptor'
import {
request
} from "@/utils/request.js"
Vue.prototype.$request = request
Vue.config.productionTip = false
App.mpType = 'app'
const app = new Vue({
...App
})
app.$mount()
// #endif
// #ifdef VUE3
import {
createSSRApp
} from 'vue'
export function createApp() {
const app = createSSRApp(App)
return {
app
}
}
// #endif

212
manifest.json Normal file
View File

@ -0,0 +1,212 @@
{
"name" : "蓝安救援-司机端",
// "appid" : "__UNI__D743A11",
"description" : "",
"versionName" : "1.0.1",
"versionCode" : 101,
"transformPx" : false,
/* 5+App */
"app-plus" : {
"usingComponents" : true,
"nvueStyleCompiler" : "uni-app",
"compilerVersion" : 3,
"splashscreen" : {
"alwaysShowBeforeRender" : true,
"waiting" : true,
"autoclose" : true,
"delay" : 0
},
/* */
"modules" : {
"Maps" : {},
"Geolocation" : {},
"Camera" : {},
"Barcode" : {}
},
/* */
"distribute" : {
/* android */
"android" : {
"permissions" : [
"<uses-feature android:name=\"android.hardware.camera\"/>",
"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_COARSE_LOCATION\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_FINE_LOCATION\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
"<uses-permission android:name=\"android.permission.CALL_PHONE\"/>",
"<uses-permission android:name=\"android.permission.CAMERA\"/>",
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
"<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
"<uses-permission android:name=\"android.permission.INTERNET\"/>",
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
"<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
"<uses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\"/>",
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
]
},
/* ios */
"ios" : {
"dSYMs" : false
},
/* SDK */
"sdkConfigs" : {
"maps" : {
"amap" : {
"appkey_ios" : "36576cf7091d7b12a49c207cabf92661",
"appkey_android" : "fecaac7796303d2b6b49f8f79ec28f0b"
}
},
"ad" : {},
"geolocation" : {
"amap" : {
"__platform__" : [ "android" ],
"appkey_ios" : "fecaac7796303d2b6b49f8f79ec28f0b",
"appkey_android" : "fecaac7796303d2b6b49f8f79ec28f0b"
}
},
"push" : {
"unipush" : {
"version" : "2",
"offline" : false
}
}
},
"icons" : {
"android" : {
"hdpi" : "unpackage/res/icons/72x72.png",
"xhdpi" : "unpackage/res/icons/96x96.png",
"xxhdpi" : "unpackage/res/icons/144x144.png",
"xxxhdpi" : "unpackage/res/icons/192x192.png"
},
"ios" : {
"appstore" : "unpackage/res/icons/1024x1024.png",
"ipad" : {
"app" : "unpackage/res/icons/76x76.png",
"app@2x" : "unpackage/res/icons/152x152.png",
"notification" : "unpackage/res/icons/20x20.png",
"notification@2x" : "unpackage/res/icons/40x40.png",
"proapp@2x" : "unpackage/res/icons/167x167.png",
"settings" : "unpackage/res/icons/29x29.png",
"settings@2x" : "unpackage/res/icons/58x58.png",
"spotlight" : "unpackage/res/icons/40x40.png",
"spotlight@2x" : "unpackage/res/icons/80x80.png"
},
"iphone" : {
"app@2x" : "unpackage/res/icons/120x120.png",
"app@3x" : "unpackage/res/icons/180x180.png",
"notification@2x" : "unpackage/res/icons/40x40.png",
"notification@3x" : "unpackage/res/icons/60x60.png",
"settings@2x" : "unpackage/res/icons/58x58.png",
"settings@3x" : "unpackage/res/icons/87x87.png",
"spotlight@2x" : "unpackage/res/icons/80x80.png",
"spotlight@3x" : "unpackage/res/icons/120x120.png"
}
}
}
},
"nativePlugins" : {
"Ba-KeepAlive" : {
"__plugin_info__" : {
"name" : "安卓保活(采用多种主流技术) Ba-KeepAlive",
"description" : "原生保活插件支持市面上大部分机型Android4.4到13.0 。为定位、推送、websocket、定时任务、蓝牙、聊天等保驾护航**注意:**不保证支持所有机型和场景,建议先试用再购买)",
"platforms" : "Android",
"url" : "https://ext.dcloud.net.cn/plugin?id=9423",
"android_package_name" : "com.lzlanan.rescueDriver",
"ios_bundle_id" : "",
"isCloud" : true,
"bought" : 1,
"pid" : "9423",
"parameters" : {}
}
},
"JY-JPush" : {
"android_appkey" : "5b1bdc33e8296ee5ad336c30",
"android_channel" : "android",
"ios_appkey" : "5b1bdc33e8296ee5ad336c30",
"ios_channel" : "ios",
"__plugin_info__" : {
"name" : "JYJPush极光推送插件 - 极光官方推荐",
"description" : "极光推送Uni版本",
"platforms" : "Android,iOS",
"url" : "https://ext.dcloud.net.cn/plugin?id=741",
"android_package_name" : "com.lzlanan.rescueDriver",
"ios_bundle_id" : "",
"isCloud" : true,
"bought" : 1,
"pid" : "741",
"parameters" : {
"android_appkey" : {
"des" : "极光推送的APPKEY",
"key" : "JPUSH_APPKEY",
"value" : ""
},
"android_channel" : {
"des" : "极光推送的渠道名称",
"key" : "JPUSH_CHANNEL",
"value" : ""
},
"ios_appkey" : {
"des" : "极光推送的APPKEY",
"key" : "JPUSH_APPKEY",
"value" : ""
},
"ios_channel" : {
"des" : "极光推送的渠道名称",
"key" : "JPUSH_CHANNEL",
"value" : ""
}
}
}
}
}
},
/* */
"quickapp" : {},
/* */
"mp-weixin" : {
"appid" : "wxe6518d72cb71a852",
"setting" : {
"urlCheck" : false,
"postcss" : true,
"minified" : true,
"es6" : true
},
"usingComponents" : true
},
"mp-alipay" : {
"usingComponents" : true
},
"mp-baidu" : {
"usingComponents" : true
},
"mp-toutiao" : {
"usingComponents" : true
},
"uniStatistics" : {
"enable" : false
},
"vueVersion" : "2",
"h5" : {
"sdkConfigs" : {
"maps" : {
"qqmap" : {
"key" : "Z2MBZ-YDXKQ-7O25N-B3ACC-ABVV5-SAFVZ"
}
}
}
},
"appid" : "__UNI__DA2C94E"
}
// "push" : {
// "unipush" : {
// "version" : "2",
// "offline" : false
// }
// }

6401
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

11
package.json Normal file
View File

@ -0,0 +1,11 @@
{
"dependencies": {
"uview-ui": "^2.0.36",
"weapp-qrcode": "^1.0.0",
"yarn": "^1.22.19"
},
"devDependencies": {
"sass": "^1.69.5",
"sass-loader": "^10.4.1"
}
}

119
pages.json Normal file
View File

@ -0,0 +1,119 @@
{
"easycom": {
"^u-(.*)": "uview-ui/components/u-$1/u-$1.vue"
},
"pages": [ //pageshttps://uniapp.dcloud.io/collocation/pages
{
"path": "pages/login/index",
"style": {
"navigationBarTitleText": "启动页",
"navigationStyle": "custom"
}
},
{
"path": "pages/index/index",
"style": {
"navigationBarTitleText": "蓝安汽车司机端",
"navigationStyle": "custom"
}
},
{
"path": "pages/orderDetails/details",
"style": {
"navigationBarTitleText": "详情页",
"navigationStyle": "custom"
}
},
{
"path": "pages/my/my",
"style": {
"navigationBarTitleText": "个人中心",
"navigationStyle": "custom"
}
},
{
"path": "pages/my/refuel",
"style": {
"navigationBarTitleText": "加油记录",
"navigationStyle": "custom"
}
},
{
"path": "pages/my/newrefuel",
"style": {
"navigationBarTitleText": "新增加油记录",
"navigationStyle": "custom"
}
},
{
"path": "pages/message/message",
"style": {
"navigationBarTitleText": "消息",
"navigationStyle": "custom"
}
},
{
"path": "pages/rescue/rescue",
"style": {
"navigationBarTitleText": "道路救援首页",
"navigationStyle": "custom"
}
},
{
"path": "pages/rescue/order",
"style": {
"navigationBarTitleText": "下单页-前",
"navigationStyle": "custom"
}
},
{
"path": "pages/rescue/initiate",
"style": {
"navigationBarTitleText": "下单页",
"navigationStyle": "custom"
}
},
{
"path": "pages/rescue/historylist",
"style": {
"navigationBarTitleText": "历史订单列表",
"navigationStyle": "custom"
}
},
{
"path": "pages/select/select",
"style": {
"navigationBarTitleText": "选择身份",
"navigationStyle": "custom"
}
},
{
"path": "pages/login/login",
"style": {
"navigationBarTitleText": "登录",
"navigationStyle": "custom"
}
},
{
"path": "pages/login/register",
"style": {
"navigationBarTitleText": "注册",
"navigationStyle": "custom"
}
},
{
"path": "pages/login/forgot",
"style": {
"navigationBarTitleText": "忘记密码",
"navigationStyle": "custom"
}
}
],
"globalStyle": {
"navigationBarTextStyle": "black",
"navigationBarTitleText": "蓝安汽车",
"navigationBarBackgroundColor": "#F8F8F8",
"backgroundColor": "#F8F8F8"
}
}

1232
pages/index/index.vue Normal file

File diff suppressed because it is too large Load Diff

298
pages/login/forgot.vue Normal file
View File

@ -0,0 +1,298 @@
<template>
<view class="content">
<view class="top">
<view class="top-icon" @click="getback()">
<uni-icons type="left" size="18"></uni-icons>
</view>
<view class="touxiang">
<image src="../../static/xinlogo.png" mode=""></image>
</view>
<view class="twotap" >
<view :class="{'blck':activeid == index}" v-for="(item,index) in qh " :key="index" @click="getxz(index)">{{item.text}}</view>
</view>
<view class="inputs" v-if="activeid == 0">
<input type="text" v-model="tel" placeholder="请输入手机号">
</view>
<view class="inputs" style="justify-content: space-between; " >
<input type="text" v-model="yzm" placeholder="请输入验证码">
<button class="jsq" :disabled="isButtonDisabled" @click="sendVerificationCode">{{ buttonText }}</button>
</view>
<view class="inputs" >
<input type="text" v-model="wrod" placeholder="请输入新密码">
</view>
</view>
<view class="dl" @click="getzh()">
<text>找回密码</text>
</view>
<view class="dbottom">
<text>登录即代表您已同意</text>
<text class="lan">用户协议</text>
<text></text>
<text class="lan">隐私政策</text>
</view>
</view>
</template>
<script>
import request from '../../utils/request';
export default{
data(){
return{
phoneNumber: "",
isButtonDisabled: false,
countdownTime: 60,
tel:'',
wrod:'',
yzm:'',
qh:[
{text:'忘记密码'},
],
activeid:0
}
},
computed: {
buttonText() {
if (this.isButtonDisabled) {
return `${this.countdownTime}s 后重新发送`;
} else {
return "获取验证码";
}
},
},
methods:{
getback(){
uni.navigateBack({
delta:1,
})
},
getxz(index){
this.activeid = index
},
getzh(){
const data ={
phone:this.tel,
msgCode:this.yzm,
password:this.wrod
}
request({
url: '/updatePwd',
method: 'post',
params: data
}).then((res)=>{
console.log('修改请求',res);
if(res.code == 200){
uni.showToast({
title:'修改成功',
icon:'none'
})
}
})
},
sendVerificationCode() {
let reg = /^((13[0-9])|(14[0-9])|(15[0-9])|(17[0-9])|(18[0-9]))\d{8}$/;
if (!reg.test(this.tel)) {
uni.showToast({
icon: 'none',
title: '请输入正确的11位手机号'
})
this.tel = '';
return false;
}
if (this.isButtonDisabled) {
return; //
}
const data = {
phone:this.tel,
}
request({
url: '/pwdSmsCode',
method: 'post',
params: data
}).then((res)=>{
console.log('验证码',res);
if(res.code == 200){
uni.showToast({
title:'验证码已发送 请注意查收',
icon:'none'
})
}else{
uni.showToast({
title:'网络不佳请稍后再试',
icon:'none'
})
}
})
this.disableButton(); //
this.startCountdown(); //
},
disableButton() {
this.isButtonDisabled = true;
},
enableButton() {
this.isButtonDisabled = false;
},
startCountdown() {
let countdown = setInterval(() => {
this.countdownTime--;
if (this.countdownTime === 0) {
clearInterval(countdown);
this.enableButton(); //
}
}, 1000);
},
}
}
</script>
<style scoped lang="scss">
.jsq{
border: none !important;
font-size: 14px;
font-weight: 400;
color: #0078FF;
}
button {
border: none !important;
background: none !important;
margin: 0px;
display: block;
}
button:focus {
color: #0078FF;
outline: none;
box-shadow: none;
}
.content{
box-sizing: border-box;
}
.top{
box-sizing: border-box;
padding: 0px 27px;
padding-top: 45px;
background-image: url('../../static/loginbj.png');
background-size: cover;
background-position: center;
width: 100%;
}
.top-icon{
margin-bottom: 45px;
}
.touxiang{
width: 88px;
height: 88px;
border-radius: 10px;
background: #D7D7D7;
margin: 0 auto;
margin-bottom: 40px;
overflow: hidden;
image{
width: 100%;
height: 100%;
}
}
.twotap{
width: 100%;
display: flex;
align-items: center;
view{
font-size: 15px;
font-family: Microsoft YaHei;
font-weight: 400;
color: #666666;
margin-right: 38.5px;
}
}
.blck{
color: #333333 !important;
font-weight: bold !important;
}
.inputs{
box-sizing: border-box;
padding: 16px 0px;
display: flex;
align-items: center;
border-bottom: 2px solid #E8E8E8 ;
margin-top: 20px;
}
.wjworb{
margin-top: 5px;
width: 100%;
display: flex;
font-size: 12px;
color: #0078FF;
justify-content: flex-end;
align-items: center;
}
.dl{
width: 90%;
height: 44px;
background: linear-gradient(-46deg, #0853C4 0%, #4282D8 80%);
border-radius: 5px;
margin: 0 auto;
font-size: 16px;
color: #FFFFFF;
display: flex;
justify-content: center;
align-items: center;
margin-top: 22px;
}
.hging{
width: 100%;
text-align: center;
font-size: 14px;
font-weight: 400;
color: #636363;
margin-top: 20px;
}
.wx{
width: 38px;
height: 38px;
overflow: hidden;
box-sizing: border-box;
margin: 0px auto;
margin-top: 20px;
image{
width: 100%;
height: 100%;
}
}
.hui{
font-size: 10px;
width: 100%;
text-align: center;
font-weight: 400;
color: #666666;
}
.dbottom{
width: 100%;
margin: 0 auto;
font-size: 12px;
text-align: center;
color: #333333;
margin-top: 40px;
position: fixed;
bottom: 25px;
}
.lan{
color: #0078FF;
}
</style>

491
pages/login/index.vue Normal file
View File

@ -0,0 +1,491 @@
<template>
<view class="content">
<view class="top">
<view class="dalan">你好</view>
<view class="dalan">欢迎来到机动车救援</view>
</view>
</view>
</template>
<script>
import request from '../../utils/request';
import {setToken} from '@/utils/auth.js'
import { getToken } from '@/utils/auth'
export default{
data(){
return{
phoneNumber: "",
shopinfo:0,
yd:false,
isButtonDisabled: false,
countdownTime: 60,
qh:[
{text:'密码登录'},
{text:'验证码登录'},
// {text:''}
],
tel:'',
yzm:'',
wrod:'',
activeid:0
}
},
onLoad() {
console.log('启动页');
if(getToken()){
let info = uni.getStorageSync('driverInfo')
if(info){
uni.navigateTo({
url:'/pages/index/index'
})
}
else{
uni.navigateTo({
url:'/pages/login/login'
})
}
}else{
uni.navigateTo({
url:'/pages/login/login'
})
}
},
computed: {
buttonText() {
if (this.isButtonDisabled) {
return `${this.countdownTime}s 后重新发送`;
} else {
return "获取验证码";
}
},
},
methods:{
//
getlogin(){
if(this.yd == false){
uni.showToast({
title:'请仔细阅读用户协议与隐私政策!',
icon:'none'
})
return
}
if(this.tel == ''){
uni.showToast({
title:'输入框不能为空!',
icon:'none'
})
return
}
if(this.activeid == 0){
const data ={
username:this.tel,
password:this.wrod,
type:0
}
request({
url: '/loginApp',
method: 'post',
data: data
}).then((res)=>{
console.log('密码请求',res);
if(res.code == 200){
setToken(res.token)
// uni.showToast({
// title:'',
// icon:'none'
// })
this.userinfo()
}
})
}
if(this.activeid == 1){
const data ={
phone:this.tel,
code:this.yzm,
type:1
}
request({
url: '/loginApp',
method: 'post',
data: data
}).then((res)=>{
console.log('验证码请求',res);
if(res.code == 200){
setToken(res.token)
this.userinfo()
}
})
}
},
userinfo(){
if(this.shopinfo == 0){
uni.showLoading({
title: '加载中'
});
console.log('商户');
request({
url: '/getJcPartnerInfo',
method: 'get',
}).then((res)=>{
if(res.code == 500){
uni.showToast({
title:"信息有误"
})
return
}
let userJson = {}
userJson.userId = res.user.userId
console.log('身份信息',res);
uni.setStorageSync('userinfo',res.user)
this.goselect()
if(res.code == 200){
uni.hideLoading();
this.goselect()
}
})
}
if(this.shopinfo == 1){
uni.showLoading({
title: '加载中'
});
console.log('员工');
request({
url: '/getJcWorkerInfo',
method: 'get',
}).then((res)=>{
let userJson = {}
userJson.userId = res.user.userId
console.log('身份信息',res);
uni.setStorageSync('userinfo',res.user)
uni.setStorageSync('partnerId',res.partnerInfo.partnerId)
if(res.code == 200){
uni.hideLoading();
uni.navigateTo({
url:'/pages/staff/staff'
})
}
})
}
},
getxz(index){
this.activeid = index
},
getxz1(){
uni.navigateTo({
url:'/pages/Login/modify'
})
},
goregister(){
uni.navigateTo({
url:'/pages/login/register'
})
},
goforgot(){
uni.navigateTo({
url:'/pages/login/forgot'
})
},
goselect(){
console.log('执行');
uni.navigateTo({
url:'/pages/index/index'
})
},
//
sendVerificationCode() {
let reg = /^((13[0-9])|(14[0-9])|(15[0-9])|(17[0-9])|(18[0-9]))\d{8}$/;
if (!reg.test(this.tel)) {
uni.showToast({
icon: 'none',
title: '请输入正确的11位手机号'
})
this.tel = '';
return false;
}
if (this.isButtonDisabled) {
return; //
}
const data = {
phone:this.tel,
}
request({
url: '/loginSmsCode',
method: 'post',
params: data
}).then((res)=>{
console.log('验证码',res);
if(res.code == 200){
uni.showToast({
title:'验证码已发送 请注意查收',
icon:'none'
})
}else{
uni.showToast({
title:'网络不佳请稍后再试',
icon:'none'
})
}
})
this.disableButton(); //
this.startCountdown(); //
},
disableButton() {
this.isButtonDisabled = true;
},
enableButton() {
this.isButtonDisabled = false;
},
startCountdown() {
let countdown = setInterval(() => {
this.countdownTime--;
if (this.countdownTime === 0) {
clearInterval(countdown);
this.enableButton(); //
}
}, 1000);
},
}
}
</script>
<style scoped lang="scss">
.jsq{
border: none !important;
font-size: 12px;
height: 30px;
font-weight: 400;
color: #0078FF;
}
button {
border: none !important;
background: none !important;
margin: 0px;
display: block;
}
button:focus {
color: #0078FF;
outline: none;
box-shadow: none;
}
.content{
box-sizing: border-box;
background: linear-gradient(180deg, rgba(13,46,141,0.2) 0%, rgba(255,255,255,0) 100%);
}
.top{
box-sizing: border-box;
padding: 0px 27px;
padding-top: 100px;
// background-color:lightseagreen;
background-image: url('../../static/detection/loginbj.png');
background-size: cover;
// background-position: center;
width: 100%;
height: calc(100vh);
}
.touxiang{
width: 88px;
height: 88px;
border-radius: 10px;
background: #D7D7D7;
margin: 0 auto;
margin-bottom: 40px;
overflow: hidden;
image{
width: 100%;
height: 100%;
}
}
.twotap{
margin-top: 10px;
width: 100%;
display: flex;
align-items: center;
view{
font-size: 12px;
font-family: Microsoft YaHei;
font-weight: 400;
color: #666666;
margin-right: 38.5px;
}
}
.blck{
color: #333333 !important;
font-weight: bold !important;
}
.inputs{
height: 54px;
box-sizing: border-box;
padding: 16px 0px;
display: flex;
align-items: center;
border-bottom: 2px solid #E8E8E8 ;
margin-top: 20px;
}
.wjworb{
margin-top: 5px;
width: 100%;
display: flex;
font-size: 12px;
color: #0078FF;
justify-content: flex-end;
align-items: center;
}
.dl{
width: 90%;
height: 44px;
background: linear-gradient(-46deg, #0853C4 0%, #4282D8 80%);
border-radius: 5px;
margin: 0 auto;
font-size: 16px;
color: #FFFFFF;
display: flex;
justify-content: center;
align-items: center;
margin-top: 22px;
}
.hging{
width: 100%;
text-align: center;
font-size: 14px;
font-weight: 400;
color: #636363;
margin-top: 20px;
}
.wx{
width: 38px;
height: 38px;
overflow: hidden;
box-sizing: border-box;
margin: 0px auto;
margin-top: 20px;
image{
width: 100%;
height: 100%;
}
}
.hui{
font-size: 10px;
width: 100%;
text-align: center;
font-weight: 400;
color: #666666;
}
.dbottom{
display: flex;
align-items: center;
justify-content: center;
width: 100%;
text-align: center;
font-size: 12px;
color: #333333;
margin-top: 40px;
position: fixed;
bottom: 25px;
}
.lan{
color: #0D2E8D;
}
.box-box{
width: 95%;
margin: 20px auto;
border-radius: 8px;
overflow: hidden;
}
.bb-top{
height: 65px;
width: 100%;
display: flex;
align-items: center;
justify-content: space-between;
}
.bb-bai{
width: 50%;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
font-size: 17px;
font-weight: bold;
background: #FFFFFF;
color: #0D2E8D;
}
.bb-hui{
height: 100%;
width: 50%;
display: flex;
align-items: center;
justify-content: center;
background: #B5BACA;
font-size: 17px;
font-weight: 400;
color: #FFFFFF;
}
.bb-baibox{
box-sizing: border-box;
width: 100%;
padding: 15px;
background-color: white;
}
.anniulanan{
width: 90%;
height: 42px;
margin: 20px auto;
display: flex;
align-items: center;
justify-content: center;
border-radius: 50px;
background-color: #0D2E8D;
color: white;
}
.dalan{
font-size: 25px;
font-weight: bold;
color: #0D2E8D;
margin-left: 10px;
}
.axquan{
width: 14px;
height: 14px;
border-radius: 50%;
border: 1px solid #AAAAAA;
margin-right: 5px;
}
.axquanl{
width: 14px;
height: 14px;
border-radius: 50%;
border: 1px solid #AAAAAA;
margin-right: 5px;
background-color: #0D2E8D;
}
</style>

379
pages/login/login.vue Normal file
View File

@ -0,0 +1,379 @@
<template>
<view class="content">
<view class="top">
<view class="touxiang">
<image src="../../static/xinlogo.png" mode=""></image>
</view>
<view class="twotap" >
<view :class="{'blck':activeid == index}" v-for="(item,index) in qh " :key="index" @click="getxz(index)">{{item.text}}</view>
</view>
<view class="inputs" v-if="activeid == 0">
<input type="text" v-model="tel" placeholder="请输入手机号">
</view>
<view class="inputs" v-if="activeid == 1">
<input type="text" v-model="tel" placeholder="请输入手机号">
</view>
<view class="inputs" style="justify-content: space-between; " v-if="activeid == 1">
<input type="text" v-model="yzm" placeholder="请输入验证码">
<button class="jsq" :disabled="isButtonDisabled" @click="sendVerificationCode">{{ buttonText }}</button>
</view>
<view class="inputs" v-if="activeid == 0">
<input type="password" v-model="wrod" placeholder="请输入密码">
</view>
<view class="wjworb" v-if="activeid == 0" @click="goforgot()">
<view class="">忘记密码</view>
</view>
</view>
<view class="dl" @click="getlogin()">
<text> </text>
</view>
<view class="hging">
<text>没有账号</text>
<text style="color: #0078FF;" @click="goregister()">立即注册</text>
</view>
<!-- <view class="wx">
<image src="../../static/-h-wxdl.png" mode=""></image>
</view>
<view class="hui">
<text>微信登录</text>
</view> -->
<view class="dbottom">
<text>登录即代表您已同意</text>
<text class="lan">用户协议</text>
<text></text>
<text class="lan">隐私政策</text>
</view>
</view>
</template>
<script>
import request from '../../utils/request';
import {setToken, setTenantId} from '@/utils/auth.js'
import {
getTenantIdByWebsite
} from '@/api/login.js'
export default{
data(){
return{
phoneNumber: "",
isButtonDisabled: false,
countdownTime: 60,
qh:[
{text:'密码登录'},
{text:'验证码登录'}
],
tel:'',
yzm:'',
wrod:'',
activeid:0,
tenantCode: 'lighting'
}
},
created() {
getTenantIdByWebsite(this.tenantCode).then(res => {
const tenantId = res.data;
if (tenantId && tenantId >= 0) {
setTenantId(tenantId)
}
})
},
computed: {
buttonText() {
if (this.isButtonDisabled) {
return `${this.countdownTime}s 后重新发送`;
} else {
return "获取验证码";
}
},
},
methods:{
//
getlogin(){
if(this.tel == ''){
uni.showToast({
title:'输入框不能为空!',
icon:'none'
})
return
}
if(this.activeid == 0){
let data ={
username:this.tel,
password:this.wrod,
type:0
}
console.log('密码请求',data);
request({
url: '/rescue/driverLogin',
method: 'post',
data: data
}).then((res)=>{
console.log('密码请求',res);
if(res.code == 200){
setToken(res.data.accessToken)
this.userinfo()
}
})
}
if(this.activeid == 1){
let data ={
phone:this.tel,
code:this.yzm,
type:1
}
request({
url: '/rescue/driverLogin',
method: 'post',
data: data
}).then((res)=>{
console.log('验证码请求',res);
if(res.code == 200){
setToken(res.data.accessToken)
this.userinfo()
uni.showToast({
title:'登录成功',
icon:'none'
})
}
})
}
},
userinfo(){
request({
url: '/rescue/getRescueDriverInfo',
method: 'get',
}).then((res)=>{
if(res.code =='200'){
console.log(res)
uni.setStorageSync('driverInfo', res.data.driverInfo.id)
uni.setStorageSync('userId', res.data.user.id)
this.goselect()
}
})
},
getxz(index){
this.activeid = index
},
goregister(){
uni.navigateTo({
url:'/pages/login/register'
})
},
goforgot(){
uni.navigateTo({
url:'/pages/login/forgot'
})
},
goselect(){
console.log('去司机端首页');
uni.navigateTo({
url:'/pages/index/index'
})
},
//
sendVerificationCode() {
let reg = /^((13[0-9])|(14[0-9])|(15[0-9])|(17[0-9])|(18[0-9]))\d{8}$/;
if (!reg.test(this.tel)) {
uni.showToast({
icon: 'none',
title: '请输入正确的11位手机号'
})
this.tel = '';
return false;
}
if (this.isButtonDisabled) {
return; //
}
const data = {
phone:this.tel,
}
request({
url: '/loginSmsCode',
method: 'post',
params: data
}).then((res)=>{
console.log('验证码',res);
if(res.code == 200){
uni.showToast({
title:'验证码已发送 请注意查收',
icon:'none'
})
}else{
uni.showToast({
title:'网络不佳请稍后再试',
icon:'none'
})
}
})
this.disableButton(); //
this.startCountdown(); //
},
disableButton() {
this.isButtonDisabled = true;
},
enableButton() {
this.isButtonDisabled = false;
},
startCountdown() {
let countdown = setInterval(() => {
this.countdownTime--;
if (this.countdownTime === 0) {
clearInterval(countdown);
this.enableButton(); //
}
}, 1000);
},
}
}
</script>
<style scoped lang="scss">
.jsq{
border: none !important;
font-size: 14px;
font-weight: 400;
color: #0078FF;
}
button {
border: none !important;
background: none !important;
margin: 0px;
display: block;
}
button:focus {
color: #0078FF;
outline: none;
box-shadow: none;
}
.content{
box-sizing: border-box;
}
.top{
box-sizing: border-box;
padding: 0px 27px;
padding-top: 100px;
// background-color:lightseagreen;
background-image: url('../../static/loginbj.png');
background-size: cover;
background-position: center;
width: 100%;
// height: 385px;
}
.touxiang{
width: 88px;
height: 88px;
border-radius: 10px;
background: #D7D7D7;
margin: 0 auto;
margin-bottom: 40px;
overflow: hidden;
image{
width: 100%;
height: 100%;
}
}
.twotap{
width: 100%;
display: flex;
align-items: center;
view{
font-size: 15px;
font-family: Microsoft YaHei;
font-weight: 400;
color: #666666;
margin-right: 38.5px;
}
}
.blck{
color: #333333 !important;
font-weight: bold !important;
}
.inputs{
box-sizing: border-box;
padding: 16px 0px;
display: flex;
align-items: center;
border-bottom: 2px solid #E8E8E8 ;
margin-top: 20px;
}
.wjworb{
margin-top: 5px;
width: 100%;
display: flex;
font-size: 12px;
color: #0078FF;
justify-content: flex-end;
align-items: center;
}
.dl{
width: 90%;
height: 44px;
background: linear-gradient(-46deg, #0853C4 0%, #4282D8 80%);
border-radius: 5px;
margin: 0 auto;
font-size: 16px;
color: #FFFFFF;
display: flex;
justify-content: center;
align-items: center;
margin-top: 22px;
}
.hging{
width: 100%;
text-align: center;
font-size: 14px;
font-weight: 400;
color: #636363;
margin-top: 20px;
}
.wx{
width: 38px;
height: 38px;
overflow: hidden;
box-sizing: border-box;
margin: 0px auto;
margin-top: 20px;
image{
width: 100%;
height: 100%;
}
}
.hui{
font-size: 10px;
width: 100%;
text-align: center;
font-weight: 400;
color: #666666;
}
.dbottom{
width: 100%;
text-align: center;
font-size: 12px;
color: #333333;
margin-top: 40px;
position: fixed;
bottom: 25px;
}
.lan{
color: #0078FF;
}
</style>

317
pages/login/register.vue Normal file
View File

@ -0,0 +1,317 @@
<template>
<view class="content">
<view class="top">
<view class="top-icon" @click="getback()">
<uni-icons type="left" size="18"></uni-icons>
</view>
<view class="touxiang">
<image src="../../static/xinlogo.png" mode=""></image>
</view>
<view class="twotap" >
<view :class="{'blck':activeid == index}" v-for="(item,index) in qh " :key="index" @click="getxz(index)">{{item.text}}</view>
</view>
<view class="inputs" v-if="activeid == 0">
<input type="text" v-model="tel" placeholder="请输入手机号">
</view>
<view class="inputs" style="justify-content: space-between; " >
<input type="text" style="width: 50%;" v-model="yzm" placeholder="请输入验证码">
<button class="jsq" :disabled="isButtonDisabled" @click="sendVerificationCode">{{ buttonText }}</button>
</view>
<view class="inputs" >
<input type="password" v-model="word" placeholder="请输入密码">
</view>
<view class="inputs">
<input type="password" v-model="words" placeholder="请输入确认密码">
</view>
<view class="dbottom">
<text>注册即代表您已同意</text>
<text class="lan">用户协议</text>
<text></text>
<text class="lan">隐私政策</text>
</view>
</view>
<view class="dl" @click="getindex()">
<text> </text>
</view>
</view>
</template>
<script>
import request from '../../utils/request';
export default{
data(){
return{
phoneNumber: "",
isButtonDisabled: false,
countdownTime: 5,
tel:'',
yzm:'',
word:'',
words:'',
qh:[
{text:'注册账号'},
],
activeid:0
}
},
computed: {
buttonText() {
if (this.isButtonDisabled) {
return `${this.countdownTime}s 后重新发送`;
} else {
return "获取验证码";
}
},
},
methods:{
getback(){
uni.navigateBack({
delta:1,
})
},
//
getindex(){
if(this.word != this.words){
uni.showToast({
title:'密码不一致',
icon:'none'
})
return
}
if(this.word.length < 6 ){
uni.showToast({
title:'密码不能低于六位数',
icon:'none'
})
return
}
const data ={
phone:this.tel,
msgCode:this.yzm,
password:this.word
}
request({
url: '/registerPhone',
method: 'post',
data: data
}).then((res)=>{
console.log('注册',res);
if(res.code == 200){
uni.showToast({
title:'注册成功',
icon:'none'
})
uni.navigateTo({
url:'/pages/login/login'
})
}
} )
},
//
getxz(index){
this.activeid = index
},
sendVerificationCode() {
let reg = /^((13[0-9])|(14[0-9])|(15[0-9])|(17[0-9])|(18[0-9]))\d{8}$/;
if (!reg.test(this.tel)) {
uni.showToast({
icon: 'none',
title: '请输入正确的11位手机号'
})
this.tel = '';
return false;
}
if (this.isButtonDisabled) {
return; //
}
const data = {
phone:this.tel,
}
request({
url: '/registerSmsCode',
method: 'post',
params: data
}).then((res)=>{
console.log('验证码',res);
if(res.code == 200){
uni.showToast({
title:'验证码已发送 请注意查收',
icon:'none'
})
}else{
uni.showToast({
title:'网络不佳请稍后再试',
icon:'none'
})
}
})
// alert("");
this.disableButton(); //
this.startCountdown(); //
},
disableButton() {
this.isButtonDisabled = true;
},
enableButton() {
this.isButtonDisabled = false;
},
startCountdown() {
let countdown = setInterval(() => {
this.countdownTime--;
if (this.countdownTime === 0) {
clearInterval(countdown);
this.enableButton(); //
}
}, 1000);
},
}
}
</script>
<style scoped lang="scss">
input{
width: 100%;
}
.jsq{
border: none !important;
font-size: 14px;
font-weight: 400;
color: #0078FF;
}
button {
border: none !important;
background: none !important;
margin: 0px;
display: block;
}
button:focus {
color: #0078FF;
outline: none;
box-shadow: none;
}
.content{
box-sizing: border-box;
}
.top{
box-sizing: border-box;
padding: 0px 27px;
padding-top: 45px;
background-image: url('../../static/loginbj.png');
background-size: cover;
background-position: center;
width: 100%;
}
.top-icon{
margin-bottom: 45px;
}
.touxiang{
width: 88px;
height: 88px;
border-radius: 10px;
background: #D7D7D7;
margin: 0 auto;
margin-bottom: 40px;
overflow: hidden;
image{
width: 100%;
height: 100%;
}
}
.twotap{
width: 100%;
display: flex;
align-items: center;
view{
font-size: 15px;
font-family: Microsoft YaHei;
font-weight: 400;
color: #666666;
margin-right: 38.5px;
}
}
.blck{
color: #333333 !important;
font-weight: bold !important;
}
.inputs{
box-sizing: border-box;
padding: 16px 0px;
display: flex;
align-items: center;
border-bottom: 2px solid #E8E8E8 ;
margin-top: 20px;
}
.wjworb{
margin-top: 5px;
width: 100%;
display: flex;
font-size: 12px;
color: #0078FF;
justify-content: flex-end;
align-items: center;
}
.dl{
width: 90%;
height: 44px;
background: linear-gradient(-46deg, #0853C4 0%, #4282D8 80%);
border-radius: 5px;
margin: 0 auto;
font-size: 16px;
color: #FFFFFF;
display: flex;
justify-content: center;
align-items: center;
margin-top: 22px;
}
.hging{
width: 100%;
text-align: center;
font-size: 14px;
font-weight: 400;
color: #636363;
margin-top: 20px;
}
.wx{
width: 38px;
height: 38px;
overflow: hidden;
box-sizing: border-box;
margin: 0px auto;
margin-top: 20px;
image{
width: 100%;
height: 100%;
}
}
.hui{
font-size: 10px;
width: 100%;
text-align: center;
font-weight: 400;
color: #666666;
}
.dbottom{
width: 100%;
margin: 0 auto;
font-size: 12px;
color: #333333;
margin-top: 10px;
}
.lan{
color: #0078FF;
}
</style>

214
pages/message/message.vue Normal file
View File

@ -0,0 +1,214 @@
<template>
<view class="content">
<view class="head-top">
<view class=""></view>
<view class="">消息</view>
<view class=""></view>
</view>
<view class="mubu">
<view class="jsy" v-if="listArr.length == 0">
<image src="http://www.nuoyunr.com/lananRsc/detection/qs.png" mode=""></image>
</view>
<!-- <view class="" @click="dianyidain()">测试方法</view> -->
<view class="bao-box" v-for="(item,index) in listArr" :key="index">
<view class="icon-lv">
<view class="hongdi" v-if="item.isRead == '0' "></view>
<image src="../../static/jiejin.png" mode=""></image>
</view>
<view class="you">
<view class="box-top">
<text class="numone">{{item.title || ''}}</text>
<text class="numthree">{{item.createTime ? (item.createTime.slice(0, -3) || '') : ''}}</text>
</view>
<view class="numtwo">{{item.content || ''}}</view>
</view>
</view>
</view>
<view style="width: 100%; height: 50px;"></view>
<tabBar :msg="msg"></tabBar>
</view>
</template>
<script>
import request from '../../utils/request';
import tabBar from '../../components/tabBar/tabBar.vue'
const innerAudioContext = uni.createInnerAudioContext();
export default {
data() {
return {
msg: '2',
value2: 1,
pageNum: 1, //
pageSize: 10, //
totalPages: 0, //
listArr: []
}
},
onShow() {
this.driverRescuePage()
this.getlooklook()
},
onReachBottom() {
if (this.pageNum >= this.totalPages) {
uni.showToast({
title: '没有下一页数据',
icon: 'none'
})
} else {
this.pageNum++
this.driverRescuePage()
}
},
components: {
tabBar,
},
methods: {
dianyidain() {
console.log('执行了');
innerAudioContext.src =
'https://mp-8344f740-3cda-4d89-b902-7235115ddaaf.cdn.bspapp.com/8080/LOL页面确认声_耳聆网_[声音ID36839].mp3';
innerAudioContext.play()
},
driverRescuePage() {
let data = {
pageSize: this.pageSize,
pageNum: this.pageNum
}
request({
url: '/announcement/announcement/getOwnMsg',
method: 'get',
params: data
}).then((res) => {
if (res.code == 200) {
if (this.pageNum != 1) {
this.listArr = this.listArr.concat(res.rows)
} else {
this.listArr = res.rows
}
let total = res.total
this.totalPages = Math.ceil(total / this.pageSize);
}
})
},
async getlooklook() {
let res = await request({
url: '/announcement/announcement/setAllRead',
method: 'get',
})
},
}
}
</script>
<style scoped lang="scss">
.content {
width: 100%;
height: calc(100vh);
background-color: #F6F6F6;
box-sizing: border-box;
padding-top: 40px;
}
.head-top {
width: 100%;
display: flex;
align-items: center;
justify-content: space-between;
}
.mubu {
width: 100%;
background-color: #F6F6F6;
box-sizing: border-box;
padding: 10px;
}
.bao-box {
width: 100%;
background: white;
box-sizing: border-box;
padding: 15px;
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 10px;
}
.icon-lv {
width: 40px;
height: 40px;
border-radius: 50%;
background: #CBF0D0;
box-sizing: border-box;
padding: 10px;
position: relative;
image {
width: 100%;
height: 100%;
}
}
.hongdi {
position: absolute;
right: 2px;
top: 2px;
width: 6px;
height: 6px;
background: #FF3829;
border-radius: 50%;
}
.ddx {
display: flex;
align-items: center;
}
.you {
width: 80%;
}
.box-top {
width: 100%;
display: flex;
justify-content: space-between;
align-items: center;
}
.numone {
font-size: 14px;
font-family: Microsoft YaHei;
font-weight: 400;
}
.numtwo {
font-size: 16px;
color: #666666;
margin-top: 10px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.numthree {
font-size: 14px;
font-weight: 400;
color: #999999;
}
.jsy {
width: 95%;
margin: 10px auto;
}
</style>

537
pages/my/my.vue Normal file
View File

@ -0,0 +1,537 @@
<template>
<view class="content">
<view class="c-top">
<view class="t-title">个人中心</view>
<view class="dis-b" style="margin-top: 16px;">
<view class="t-left">
<view class="touxiang" >
<u-upload
:fileList="fileList6"
@afterRead="afterRead"
@delete="deletePic"
name="6"
multiple
:maxCount="1"
width="60"
height="60"
>
<image :src=" baseUrl + userInfo.avatar " v-if="userInfo.avatar != '' " style="width: 60px; height: 60px; border-radius: 50%; z-index: 99;" mode="" ></image>
</u-upload>
</view>
<view >
<view class="t-zi1">
<text>{{userInfo.nickname || ''}}</text>
<view class="paizi">
<image src="../../static/rzsj.png" mode=""></image>
</view>
</view>
<view class="x-baiz">{{userInfo.mobile || ''}}</view>
<!-- <view class="t-biao">5.0 <uni-icons type="star-filled" size="18" color="#fffff"></uni-icons> </view> -->
</view>
</view>
</view>
<view class="t-bottom">
<view class="top-box">
<view class="t-lan">300</view>
<view class="t-hui">累计完成()</view>
</view>
<view class="top-box" style="border: none;">
<view class="t-lan">5.0</view>
<view class="t-hui">当前星级</view>
</view>
</view>
</view>
<view class="t-ybr">
</view>
<view class="hui-content">
<view class="">
<view class="dix">
<uni-icons type="wallet-filled" color="#0D2E8D" size="22"></uni-icons>
<text>当前余额</text>
</view>
<view class="yey">1999.00</view>
</view>
<view class="dix">
<text class="hui-zi">账户</text>
<uni-icons type="right" color=" #AAAAAA" size="16"></uni-icons>
</view>
</view>
<view class="hui-twotwo">
<view class="ddis" @click="gorefuel()">
<view class="left-icon">
<image src="../../static/smrz.png" mode=""></image>
</view>
<view class="right-box">
<view class="lefts">加油记录</view>
<view class="">
<uni-icons type="right" color=" #AAAAAA" size="14"></uni-icons>
</view>
</view>
</view>
<view class="ddis">
<view class="left-icon">
<image src="../../static/clxx.png" mode=""></image>
</view>
<view class="right-box">
<view class="lefts">车辆信息维护</view>
<view class="">
<uni-icons type="right" color=" #AAAAAA" size="14"></uni-icons>
</view>
</view>
</view>
<!-- <view class="ddis">
<view class="left-icon">
<image src="../../static/bxwh.png" mode=""></image>
</view>
<view class="right-box">
<view class="lefts">保险维护</view>
<view class="">
<uni-icons type="right" color=" #AAAAAA" size="14"></uni-icons>
</view>
</view>
</view> -->
<view class="ddis">
<view class="left-icon">
<image src="../../static/xtsz.png" mode=""></image>
</view>
<view class="right-box" @click="dialogToggle()">
<view class="lefts">退出登录</view>
<view class="">
<uni-icons type="right" color=" #AAAAAA" size="14"></uni-icons>
</view>
</view>
</view>
</view>
<!-- <view class="anniu" @click="getnaiv()">
<view class="">测试页</view>
</view> -->
<uni-popup ref="alertDialog" type="dialog">
<uni-popup-dialog cancelText="关闭" confirmText="同意" title="通知" content="您确认退出吗" @confirm="dialogConfirm"
@close="dialogClose"></uni-popup-dialog>
</uni-popup>
<tabBar :msg="msg " ></tabBar>
</view>
</template>
<script>
import request from '../../utils/request';
import tabBar from'../../components/tabBar/tabBar.vue'
import { getToken } from '@/utils/auth'
export default {
data() {
return {
msg:'3',
fileList6:[],
topdata:[
{text:'待确认',id:1},
{text:'进行中',id:2},
{text:'已完成',id:3}
],
baseUrl:this.$baseUrl,
userInfo:{},
tabindex:0,
title: 'user',
checkedindex:false,
}
},
onShow() {
this.getUserinfo()
},
components:{
tabBar,
},
methods: {
deletePic(event) {
this[`fileList${event.name}`].splice(event.index, 1)
},
//
async afterRead(event) {
// multiple true , file
let lists = [].concat(event.file)
let fileListLen = this[`fileList${event.name}`].length
lists.map((item) => {
this[`fileList${event.name}`].push({
...item,
})
})
for (let i = 0; i < lists.length; i++) {
const result = await this.onChooseavatar(lists[i].url)
let item = this[`fileList${event.name}`][fileListLen]
this[`fileList${event.name}`].splice(fileListLen, 1, Object.assign(item, {
status: 'success',
message: '',
url: result
}))
fileListLen++
}
},
onChooseavatar(e) {
uni.uploadFile({
url: this.baseUrl + '/system/user/profile/avatar',
filePath: e,
name: 'avatarfile',
header: {
Authorization: 'Bearer ' + getToken()
},
success: (uploadFileRes) => {
console.log(uploadFileRes);
if (uploadFileRes.statusCode == 200) {
this.getUserinfo()
}
}
});
},
async getUserinfo(){
let res = await request({
url: '/rescue/getRescueDriverInfo',
method: 'get',
})
console.log('司机13',res);
if(res.code == 200){
uni.setStorageSync('userinfo',res.data.user)
this.userInfo = res.data.user
}
},
gorefuel(){
uni.navigateTo({
url:'/pages/my/refuel'
})
},
dialogToggle() {
this.$refs.alertDialog.open()
},
dialogConfirm(){
this.$refs.alertDialog.close()
this.gologin()
},
dialogClose(){
this.$refs.alertDialog.close()
},
gologin(){
this.$getclearInterval()
uni.clearStorageSync();
uni.reLaunch({
url:'/pages/login/login'
});
}
}
}
</script>
<style scoped lang="scss">
.content {
box-sizing: border-box;
padding-top: 40px;
background: #F4F4F4;
width: 100%;
height: calc(100vh);
}
.dix{
display: flex;
align-items: center;
}
.htzit{
display: flex;
align-items: center;
font-size: 15px;
color: #999999;
}
.yey{
font-size: 24px;
font-weight: 500;
color: #333333;
}
.xshui{
font-size: 15px;
font-weight: 400;
color: #333333;
}
.changimg{
width: 58px;
height: 20px;
margin-right: 5px;
image{
width: 100%;
height: 100%;
}
}
.shiwuimg{
width: 15px;
height: 15px;
margin-right: 5px;
image{
width: 100%;
height: 100%;
}
}
.lefts{
font-size: 14px;
font-weight: 400;
color: #333333;
}
.inanniu{
width: 30%;
height: 38px;
border-radius: 19px 19px 19px 19px;
border: 1px solid #3CBC6F;
display: flex;
align-items: center;
justify-content: center;
font-size: 15px;
color: #3CBC6F;
}
.lanniu{
width: 30%;
height: 38px;
border-radius: 19px 19px 19px 19px;
border: 1px solid #3C9CFF;
display: flex;
align-items: center;
justify-content: center;
font-size: 15px;
color: #3C9CFF;
}
.anniua{
width: 30%;
height: 38px;
border-radius: 19px 19px 19px 19px;
border: 1px solid #0D2E8D;
display: flex;
align-items: center;
justify-content: center;
font-size: 15px;
background: #0D2E8D;
color: #ffffff;
}
.dis-bb{
display: flex;
align-items: center;
justify-content: space-between;
box-sizing: border-box;
padding-bottom: 15px;
border-bottom: 1px solid #EEEEEE;
}
.dis-tt{
display: flex;
align-items: center;
justify-content: space-between;
box-sizing: border-box;
padding-top: 15px;
border-top: 1px solid #EEEEEE;
}
.c-top{
width: 100%;
height: 150px;
background: #0D2E8D;
box-sizing: border-box;
padding: 15px;
}
.t-title{
font-size: 18px;
font-weight: bold;
color: #FFFFFF;
}
.dis-b{
display: flex;
justify-content: space-between;
}
.t-left{
display: flex;
.touxiang{
width: 60px;
height: 60px;
border-radius: 50%;
overflow: hidden;
// background-color: #E3E3E3;
border:1px solid white;
margin-right: 15px;
}
}
.t-zi1{
font-size: 16px;
font-weight: bold;
color: white;
margin-bottom: 10px;
display: flex;
align-items: center;
}
.t-biao{
border-radius: 11px 11px 11px 0px;
background: linear-gradient(90deg, #EE8342 0%, #EA3942 100%);
color: white;
text-align: center;
}
.t-right{
}
.t-zi2{
font-size: 14px;
font-weight: bold;
color: white;
}
.t-bottom{
background: #FFFFFF;
box-shadow: 0px 4px 4px 0px rgba(13,46,141,0.15);
border-radius: 8px;
margin-top: 10px;
box-sizing: border-box;
padding: 16px;
display: flex;
justify-content: space-between;
z-index: 999999999;
}
.top-box{
width: 50%;
height: 100%;
border-right: 1px solid #EEEEEE;
text-align: center;
}
.t-lan{
font-size: 28px;
font-weight: bold;
color: #0D2E8D;
}
.t-hui{
font-size: 14px;
font-weight: 400;
color: #999999;
}
.t-ybr{
width: 100%;
z-index: 99;
height: 80px;
box-sizing: border-box;
padding-top: 90px;
display: flex;
justify-content: space-around;
}
.anniu{
width: 95%;
height: 44%;
border-radius: 6px;
background-color: #0D2E8D;
color: white;
display: flex;
justify-content: center;
align-items: center;
}
.gang{
width: 24px;
height: 4px;
background: #ffffff;
border-radius: 4px 4px 4px 4px;
margin: 2px auto;
}
.left-icon{
width: 26px;
height: 26px;
border-radius: 4px;
overflow: hidden;
margin-right: 15px;
image{
width: 100%;
height: 100%;
}
}
.hui-content{
width: 90%;
background-color: #ffffff;
box-sizing: border-box;
padding: 10px 15px;
z-index: -999899;
margin: 10px auto;
border-radius: 8px;
margin-top: 0px;
display: flex;
align-items: center;
justify-content: space-between;
box-sizing: border-box;
padding: 15px;
}
.right-box{
width: 85%;
border-bottom: 1px solid #EEEEEE;
box-sizing: border-box;
padding-bottom: 10px;
display: flex;
align-items: center;
justify-content: space-between;
}
.ddis{
display: flex;
margin-top: 10px;
}
.hui-twotwo{
width: 90%;
background-color: #ffffff;
box-sizing: border-box;
padding: 10px 15px;
z-index: -999899;
margin: 10px auto;
border-radius: 8px;
margin-top: 0px;
box-sizing: border-box;
padding: 15px;
}
.content-box{
width: 100%;
box-sizing: border-box;
padding: 15px;
height: 222px;
background: #FFFFFF;
border-radius: 8px 8px 8px 8px;
margin-bottom: 10px;
}
.hui-text{
font-size: 16px;
font-weight: 400;
color: #666666;
}
.indexhei{
color: #333333 !important;
font-weight: bold !important;
}
.indexlan{
background: #0D2E8D !important;
}
.x-baiz{
font-size: 15px;
font-weight: 400;
color: #FFFFFF;
}
.hui-zi{
font-size: 14px;
font-weight: 400;
color: #AAAAAA;
}
.paizi{
width: 75px;
height: 20px;
margin-left: 15px;
image{
width: 100%;
height: 100%;
}
}
</style>

382
pages/my/newrefuel.vue Normal file
View File

@ -0,0 +1,382 @@
<!-- 发起订单 -->
<template>
<view class="content">
<view class="dil">
<view class="top-icon" @click="getback()">
<uni-icons type="left" size="18"></uni-icons>
</view>
<!-- 发起救援 头部-->
<!-- -->
<!-- 填空 -->
<view class="tinput">
<view class="text1"> <text class="hong1">*</text>加油车辆</view>
<view class="you" @click="carSelectShow = true">
<text style="color: blue;">选择车辆</text> <text style="margin-left: 5px;">{{carName}}</text>
</view>
</view>
<view class="tinput">
<view class="text1"> <text class="hong1">*</text>加了多少油(L)</view>
<view class="you">
<input type="number" v-model="refuelNum" placeholder="请输入加了多少油">
</view>
</view>
<view class="tinput">
<view class="text1"> <text class="hong1">*</text> 加油消费金额()</view>
<view class="you">
<input type="number" v-model="refuelMonry" placeholder="请输入消费金额">
</view>
</view>
<view class="tinput">
<view class="text1"> <text class="hong1">*</text>当前公里数(KM)</view>
<!-- <u-number-box v-model="value" @change="valChange"></u-number-box> -->
<uni-number-box :min="0" :max="9989999" v-model="refuelDistance"></uni-number-box>
</view>
<view class="tinput" @click="show = true">
<view class="text1"> <text class="hong1">*</text> 选择时间</view>
<view class="you">
<text>{{recordTime}}</text>
</view>
</view>
<view class="tinput">
<view class="text1"> 证明截图</view>
<view class="">
<u-upload :fileList="fileList1" @afterRead="afterRead" @delete="deletePic" name="1" multiple
:maxCount="1"></u-upload>
</view>
</view>
<view class="anniu" @click="getadd()">
<text>提交</text>
</view>
<u-datetime-picker :show="show" v-model="value1" @cancel="cancelclose" @confirm="confirmopen"
mode="datetime"></u-datetime-picker>
<u-picker :show="carSelectShow" :columns="carList" keyName="rescueCarNum" @confirm="confirmCar"
@cancel="cancelCar"></u-picker>
</view>
</view>
</template>
<script>
import request from '../../utils/request'
import config from '@/config'
import upload from '@/utils/upload.js'
export default {
data() {
return {
fileList1: [],
showImage: "",
id: 1,
carSelectShow: false,
carList: [],
value: 0,
show: false,
value1: Number(new Date()),
recordTime: '',
refuelNum: '',
refuelMonry: '',
refuelDistance: '',
carId: null,
carName: null,
}
},
onLoad() {
this.timef()
this.getCarList()
},
methods: {
confirmCar(e) {
console.log(e);
this.carSelectShow = false
this.carId = e.value[0].id
this.carName = e.value[0].rescueCarNum
},
cancelCar() {
this.carSelectShow = false
},
getCarList() {
request({
url: '/system/rescueCar/list',
method: 'get',
params: {
pageNum: 1,
pageSize: 100
}
}).then((res) => {
this.carList.push(res.rows)
})
},
deletePic(event) {
this[`fileList${event.name}`].splice(event.index, 1)
},
//
async afterRead(event) {
// multiple true , file
let lists = [].concat(event.file)
let fileListLen = this[`fileList${event.name}`].length
lists.map((item) => {
this[`fileList${event.name}`].push({
...item,
})
})
for (let i = 0; i < lists.length; i++) {
const result = await this.uploadFilePromise(lists[i].url)
let item = this[`fileList${event.name}`][fileListLen]
this[`fileList${event.name}`].splice(fileListLen, 1, Object.assign(item, {
status: 'success',
message: '',
url: result
}))
fileListLen++
}
},
uploadFilePromise(url) {
upload({
url: '/common/upload',
filePath: url,
}).then((res) => {
console.log('images', res.fileName);
this.showImage = res.fileName
})
},
valChange(e) {
console.log('当前值为: ' + e.value)
},
getadd() {
if (!this.refuelNum || !this.refuelMonry || !this.recordTime || !this.refuelDistance || !this.carId) {
uni.showToast({
title: "必填不能有空",
icon: 'error'
})
return
}
let data = {
driverId: uni.getStorageSync('driverInfo'),
refuelNum: this.refuelNum,
refuelMoney: this.refuelMonry,
recordTime: this.recordTime,
refuelDistance: this.refuelDistance,
showImage: this.showImage,
carId: this.carId
}
request({
url: '/app/driver/addRefuelRecord',
method: 'post',
data: data
}).then((res) => {
if (res.code == 200) {
console.log(res);
uni.showToast({
title: '提交成功',
})
setTimeout(
uni.navigateBack(), 1000);
}
})
},
timef() {
let timestamp = Number(new Date()); //
let date = new Date(timestamp);
let year = date.getFullYear();
let month = ("0" + (date.getMonth() + 1)).slice(-2);
let day = ("0" + date.getDate()).slice(-2);
let hour = ("0" + date.getHours()).slice(-2);
let minute = ("0" + date.getMinutes()).slice(-2);
let formattedDate = year + "-" + month + "-" + day + " " + hour + ":" + minute;
this.recordTime = formattedDate
},
cancelclose(e) {
console.log(e);
this.show = false
},
confirmopen(e) {
console.log(e);
let timestamp = e.value; //
let date = new Date(timestamp);
let year = date.getFullYear();
let month = ("0" + (date.getMonth() + 1)).slice(-2);
let day = ("0" + date.getDate()).slice(-2);
let hour = ("0" + date.getHours()).slice(-2);
let minute = ("0" + date.getMinutes()).slice(-2);
let formattedDate = year + "-" + month + "-" + day + " " + hour + ":" + minute;
this.recordTime = formattedDate
console.log(formattedDate); //
this.show = false
},
getback() {
uni.navigateBack({
delta: 1,
})
},
getzhi(index) {
this.carzhi = index
},
getzhi2(index) {
this.maneizhi = index
},
}
}
</script>
<style scoped lang="scss">
.content {
width: 100%;
height: calc(100vh);
background-color: #F6F6F6;
box-sizing: border-box;
padding-top: 45px;
}
.top-icon {
margin-bottom: 15px;
}
.dil {
box-sizing: border-box;
background-color: #F6F6F6;
padding: 0px 12px;
}
.top {
box-sizing: border-box;
padding: 0px 15px;
width: 100%;
background-color: white;
}
.top-box {
display: flex;
justify-content: space-between;
align-items: center;
box-sizing: border-box;
padding: 20px 0px;
}
.tb-left {
height: 100%;
width: 80%;
display: flex;
align-items: center;
}
.uicon {
width: 18px;
height: 18px;
border-radius: 4px;
color: white;
background: orangered;
display: flex;
justify-content: center;
align-items: center;
font-size: 12px;
font-weight: bold;
margin-right: 6px;
}
.tb-right {
width: 20px;
height: 26px;
image {
width: 100%;
height: 100%;
}
}
.text1 {
font-size: 16px;
font-weight: bold;
color: #363636;
}
.hong1 {
margin-top: 5px;
font-size: 12px;
font-weight: 400;
color: #FF5453;
}
.hong2 {
margin-top: 5px;
font-size: 12px;
font-weight: 400;
}
.tinput {
width: 100%;
display: flex;
background: white;
align-items: center;
justify-content: space-between;
box-sizing: border-box;
padding: 16px;
margin-top: 14px;
}
.xinput {
width: 100%;
background: white;
box-sizing: border-box;
padding: 16px;
margin-top: 14px;
}
.you {
text-align: right;
}
.xz {
margin-top: 10px;
display: flex;
align-items: center;
}
.kuang {
width: 38px;
height: 23px;
background: #ECECEC;
border-radius: 5px;
display: flex;
justify-content: center;
align-items: center;
color: #666666;
font-size: 14px;
margin-right: 15px;
}
.xlan {
background: #CDE7FF !important;
color: #1D62FF !important;
border: 1px solid #2A96FE;
}
.anniu {
width: 100%;
background: linear-gradient(105deg, #FFE3AC 0%, #F3BA60 98%);
height: 40px;
display: flex;
justify-content: center;
align-items: center;
color: #542F0E;
border-radius: 4px;
margin-top: 20px;
}
</style>

211
pages/my/refuel.vue Normal file
View File

@ -0,0 +1,211 @@
<template>
<view class="content">
<view class="head-top">
<view class="" @click="banckf()">
<uni-icons type="left" size="22"></uni-icons>
</view>
<view class="">加油记录</view>
<view class=""></view>
</view>
<view class="mubu">
<view class="jsy" v-if="listArr.length == 0">
<image src="http://www.nuoyunr.com/lananRsc/detection/qs.png" mode=""></image>
</view>
<!-- <view class="" @click="dianyidain()">测试方法</view> -->
<view class="bao-box" v-for="(item,index) in listArr" :key="index">
<view class="you">
<view class="box-top">
<text class="numone">一共加油{{item.refuelNum || ''}}</text>
<text class="numthree">{{item.recordTime|| '0'}}</text>
</view>
<view class="numtwo">消费{{item.refuelMoney || '0'}}</view>
</view>
</view>
</view>
<view class="box-pupop" @click="gonews">
<view class="">
<uni-icons type="plusempty" color="#ffffff" size="26"></uni-icons>
<view class="">新增</view>
</view>
</view>
</view>
</template>
<script>
import request from '../../utils/request';
export default{
data(){
return{
msg:'2',
value2:1,
pageNum: 1,//
pageSize: 10,//
totalPages: 0,//
listArr:[]
}
},
onShow() {
this.driverRescuePage()
},
onReachBottom() {
if (this.pageNum >= this.totalPages) {
uni.showToast({
title: '没有下一页数据',
icon: 'none'
})
} else {
this.pageNum++
this.driverRescuePage()
}
},
methods:{
driverRescuePage(){
let data = {
driverId : uni.getStorageSync('driverInfo'),
pageSize:this.pageSize,
pageNum:this.pageNum
}
request({
url: '/app/driver/listRefuelRecord',
method: 'get',
params:data
}).then((res)=>{
if(res.code == 200){
if (this.pageNum != 1) {
this.listArr = this.listArr.concat(res.rows)
}else{
this.listArr = res.rows
}
let total = res.total
this.totalPages = Math.ceil(total / this.pageSize);
}
})
},
banckf(){
uni.navigateBack()
},
gonews(){
uni.navigateTo({
url:'/pages/my/newrefuel'
})
}
}
}
</script>
<style scoped lang="scss">
.content{
width: 100%;
height: calc(100vh);
background-color: #F6F6F6;
box-sizing: border-box;
padding-top: 40px;
}
.head-top{
width: 100%;
display: flex;
align-items: center;
justify-content: space-between;
box-sizing: border-box;
padding: 0px 10px;
}
.mubu{
width: 100%;
background-color: #F6F6F6;
box-sizing: border-box;
padding: 10px;
}
.jsy{
width: 90%;
margin: 40px auto;
}
.bao-box{
width: 100%;
background: white;
box-sizing: border-box;
padding: 15px;
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 10px;
}
.icon-lv{
width: 40px;
height: 40px;
border-radius: 50%;
background: #CBF0D0;
box-sizing: border-box;
padding: 10px;
position: relative;
image{
width: 100%;
height: 100%;
}
}
.hongdi{
position: absolute;
right: 2px;
top: 2px;
width: 6px;
height: 6px;
background: #FF3829;
border-radius: 50%;
}
.ddx{
display: flex;
align-items: center;
}
.you{
width: 100%;
}
.box-top{
width: 100%;
display: flex;
justify-content: space-between;
align-items: center;
}
.numone{
font-size: 14px;
font-family: Microsoft YaHei;
font-weight: 400;
}
.numtwo{
font-size: 16px;
color: #666666;
margin-top: 10px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.numthree{
font-size: 14px;
font-weight: 400;
color: #999999;
}
.box-pupop{
width: 60px;
height: 60px;
border-radius: 50%;
position: fixed;
bottom: 45px;
right: 15px;
background-color: #0D2E8D;
display: flex;
align-items: center;
justify-content: center;
color: white;
font-size: 14px;
}
</style>

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,251 @@
<!-- 历史订单列表-->
<template>
<view class="content">
<view class="top-icon" >
<view class="h-text" @click="getback()">返回</view>
<view class="s-input">
<uni-icons type="search" color=" #999999" size="16"></uni-icons>
<input type="text" placeholder="搜索我的订单">
</view>
<view class="h-text">搜索</view>
</view>
<view class="top-tap">
<view class="tap-box" :class="{'cc' : gindex == index }" v-for="(item,index) in arrtap" :key="index" @click="getindex(index)">
<view style="margin-bottom: 4px;">{{item.text}}</view>
<view class="gang" v-if="index == gindex"></view>
</view>
</view>
<view class="dil">
<view class="ques" v-if="arrbox== '' ">
<image src="../../static/quesheng.png" mode=""></image>
</view>
<view class="d-box" v-for="(item,index) in arrbox " :key="index">
<view class="d-y-top">搭电</view>
<view class="t-right">
<view class="bq" v-if="item.id == 1">
<text>待支付</text>
</view>
<view class="bq2" v-if="item.id == 2">
<text>待评价</text>
</view>
</view>
<view class="d-left">
<text>目的地</text>
</view>
<view class="t-left">
<text>订单编号121212</text>
</view>
<view class="x-left">
<view class="">下单时间2023-07-15</view>
<view class="hong">65</view>
</view>
</view>
<view style="width: 100%; height: 60px;"></view>
</view>
<tabBar></tabBar>
</view>
</template>
<script>
import tabBar from'../../components/tabBar/tabBar.vue'
import request from '../../utils/request';
export default{
data(){
return{
gindex:0,
arrtap:[
{text:'全部'},
{text:'救援中'},
{text:'待支付'},
{text:'待取车'},
{text:'待评价'},
],
arrbox:[
// {text:'',id:1},
// {text:'',id:2},
]
}
},
components:{
tabBar,
},
methods:{
getback(){
uni.navigateBack({
delta:1,
})
},
getindex(index){
this.gindex = index
}
}
}
</script>
<style scoped lang="scss">
.content{
width: 100%;
height: calc(100vh);
background-color: #F6F6F6;
box-sizing: border-box;
padding-top: 45px;
}
.top-icon{
box-sizing: border-box;
width: 100%;
padding: 5px 14px;
background: white;
display: flex;
justify-content: space-between;
align-items: center;
}
.dil{
background-color: #F6F6F6;
box-sizing: border-box;
padding: 15px 12px;
}
.h-text{
font-size: 14px;
font-weight: 400;
color: #999999;
}
.s-input{
width: 78%;
height: 30px;
background: #F3F3F3;
border-radius: 50px;
box-sizing: border-box;
display: flex;
align-items: center;
padding: 0px 10px;
input{
margin-left: 5px;
width: 80%;
font-size: 14px;
color: #999999;
}
}
.top-tap{
width: 100%;
background: white;
display: flex;
align-items: center;
box-sizing: border-box;
padding-top: 5px;
}
.tap-box{
width: 20%;
font-size: 15px;
font-weight: 400;
color: #666666;
text-align: center;
}
.gang{
width: 80%;
height: 5px;
margin: 0 auto;
border-radius: 12px;
background: linear-gradient(87deg, #B6E1FF 0%, #339DFF 100%);
}
.d-box{
width: 100%;
// height: 100px;
background: white;
border-radius: 10px;
margin-bottom: 15px;
box-sizing: border-box;
padding: 8px;
position: relative;
overflow: hidden;
}
.d-y-top{
position: absolute;
top: 0px;
left: 0px;
width: 40px;
height: 20px;
border-radius: 0px 0px 6px 0px;
background-color: #339DFF;
color: white;
font-size: 12px;
text-align: center;
}
.t-right{
width: 100%;
display: flex;
justify-content: flex-end;
.bq{
width: 55px;
height: 20px;
background: #FFD7D7;
border-radius: 4px;
font-size: 12px;
font-weight: 400;
color: #FF4C4C;
display: flex;
justify-content: center;
align-items: center;
}
.bq2{
width: 55px;
height: 20px;
background: #CDE2FF;
border-radius: 4px;
font-size: 12px;
font-weight: 400;
color: #3289FF;
display: flex;
justify-content: center;
align-items: center;
}
}
.d-left{
margin-left: 10px;
display: flex;
font-size: 16px;
font-weight: bold;
color: #666666;
margin-bottom: 10px;
}
.t-left{
margin-left: 10px;
display: flex;
font-size: 12px;
font-weight: 400;
color: #666666;
margin-bottom: 5px;
}
.x-left{
margin-left: 10px;
display: flex;
justify-content: space-between;
font-size: 12px;
font-weight: 400;
color: #666666;
}
.cc{
font-weight: bold;
}
.hong{
font-size: 16px;
font-weight: 400;
color: #F85021;
}
.ques{
margin: 0px auto;
margin-top: 40px;
width: 80%;
image{
width: 100%;
}
}
</style>

428
pages/rescue/initiate.vue Normal file
View File

@ -0,0 +1,428 @@
<!-- 发起订单 -->
<template>
<view class="content">
<view class="dil">
<view class="top-icon" @click="getback()">
<uni-icons type="left" size="18"></uni-icons>
</view>
<!-- 发起救援 头部-->
<view class="top">
<!-- -->
<view class="top-box" >
<view class="tb-left">
<view class="uicon" style="background:#2A96FE; ">
<text></text>
</view>
<view class="">
<view class="text1" v-show="four == ''">请选择起点地址</view>
<view class="text1" v-show="four != ''">{{province}}{{city}}{{area}}</view>
<view class="hong1" v-show="four == ''">*必填请填写详细地址</view>
<view class="hong2" v-show="four != ''">
<input type="text" :placeholder="four">
</view>
</view>
</view>
<view class="tb-right" @click="getmap()">
<image src="../../static/dingwei.png" mode=""></image>
</view>
</view>
<!-- -->
<view class="top-box" v-if="id == 1" style="border-top:1px solid #EAEAEA;">
<view class="tb-left">
<view class="uicon" >
<text></text>
</view>
<view class="">
<view class="text1" v-show="four1 == ''">请选择终点地址</view>
<view class="text1" v-show="four1 != ''">{{province1}}{{city1}}{{area1}}</view>
<view class="hong1" v-show="four1 == ''">*必填请填写详细地址</view>
<view class="hong2" v-show="four1 != ''">
<input type="text" :placeholder="four1">
</view>
</view>
</view>
<view class="tb-right" @click="getmap1()">
<image src="../../static/dingwei.png" mode=""></image>
</view>
</view>
</view>
<!-- 填空 -->
<view class="tinput">
<view class="text1"> <text class="hong1">*</text> 联系人</view>
<view class="you">
<input type="text" placeholder="请输入联系人">
</view>
</view>
<view class="tinput">
<view class="text1"> <text class="hong1">*</text> 手机号</view>
<view class="you">
<input type="text" placeholder="请输入手机号">
</view>
</view>
<view class="tinput">
<view class="text1"> <text class="hong1">*</text> 车牌号</view>
<view class="you">
<input type="text" placeholder="请输入车牌号">
</view>
</view>
<view class="xinput">
<view class="text1"> <text class="hong1">*</text> 车辆类型</view>
<view class="xz">
<view :class="{'xlan':carzhi == index}" class="kuang" v-for="(item,index) in car" :key="index" @click="getzhi(index)">
<view class="">{{item.text}}</view>
</view>
</view>
</view>
<view class="xinput">
<view class="text1"> <text class="hong1">*</text> 收费类型</view>
<view class="xz">
<view :class="{'xlan':maneizhi == index}" class="kuang" v-for="(item,index) in manei" :key="index" @click="getzhi2(index)">
<view class="">{{item.text}}</view>
</view>
</view>
</view>
<view class="tinput">
<view class="text1"> <text class="hong1">*</text> 备注</view>
<view class="you">
<input type="text" placeholder="请输入备注">
</view>
</view>
<view class="tinput">
<view class="text1"> <text class="hong1">*</text> 现场图片</view>
<view class="you">
<input type="text" placeholder="请输入现场图片">
</view>
</view>
<!-- 上传图片 -->
<u-upload
:fileList="fileList1"
@afterRead="afterRead"
@delete="deletePic"
name="1"
multiple
:maxCount="10"
></u-upload>
<view class="anniu">
<text>发起</text>
</view>
<view style="width: 100%; height: 60px;"></view>
</view>
<tabBar></tabBar>
</view>
</template>
<script>
import tabBar from'../../components/tabBar/tabBar.vue'
import request from '../../utils/request'
import config from '@/config'
import upload from '@/utils/upload.js'
export default{
data(){
return{
fileList1: [],
id:1,
carzhi:0,
car:[
{text:'大'},
{text:'中'},
{text:'小'}
],
maneizhi:0,
manei:[
{text:'现金'},
{text:'签单'},
],
province:'',
city:'',
area:'',
four:'',
province1:'',
city1:'',
area1:'',
four1:'',
}
},
onLoad(option) {
this.id = option.id
},
components:{
tabBar,
},
methods:{
//
deletePic(event) {
this[`fileList${event.name}`].splice(event.index, 1)
},
//
async afterRead(event) {
// multiple true , file
let lists = [].concat(event.file)
let fileListLen = this[`fileList${event.name}`].length
lists.map((item) => {
this[`fileList${event.name}`].push({
...item,
})
})
for (let i = 0; i < lists.length; i++) {
const result = await this.uploadFilePromise(lists[i].url)
let item = this[`fileList${event.name}`][fileListLen]
this[`fileList${event.name}`].splice(fileListLen, 1, Object.assign(item, {
status: 'success',
message: '',
url: result
}))
fileListLen++
}
},
uploadFilePromise(url) {
console.log(url);
upload({
url:'/common/upload',
filePath: url,
}).then((res)=>{
console.log(res);
})
// return new Promise((resolve, reject) => {
// let a = uni.uploadFile({
// url: 'http://192.168.1.2:8080/common/upload', //
// filePath: url,
// name: 'file',
// formData: {
// user: 'test'
// },
// success: (res) => {
// setTimeout(() => {
// resolve(res.data.data)
// }, 1000)
// }
// });
// })
},
//
getmap(){
let that =this
uni.chooseLocation({
success: function (res) {
console.log('位置名称:' + res.name);
console.log('详细地址:' + res.address);
console.log('纬度:' + res.latitude);
console.log('经度:' + res.longitude);
console.log(res)
that.four = res.address
// that.adds = res.address;
// let point = new plus.maps.Point(res.longitude,res.latitude);
var address = res.address;
var reg = /.+?(省|市|自治区|自治州|县|区)/g;
let addressList=address.match(reg).toString().split(",");
if(addressList[0] == '重庆市' || addressList[0] == '北京市' || addressList[0] == '天津市' || addressList[0] == '上海市'){
that.province = addressList[0];
that.city = '市辖区';
that.area = addressList[1];
that.four = address.replace(that.province,'').replace(that.city,'').replace(that.area,'');
}else{
that.province = addressList[0];
that.city = addressList[1];
that.area = addressList[2];
that.four = address.replace(that.province,'').replace(that.city,'').replace(that.area,'');
};
console.log(that.four);
}
});
},
getmap1(){
let that =this
uni.chooseLocation({
success: function (res) {
console.log('位置名称:' + res.name);
console.log('详细地址:' + res.address);
console.log('纬度:' + res.latitude);
console.log('经度:' + res.longitude);
console.log(res)
var address = res.address;
var reg = /.+?(省|市|自治区|自治州|县|区)/g;
let addressList=address.match(reg).toString().split(",");
if(addressList[0] == '重庆市' || addressList[0] == '北京市' || addressList[0] == '天津市' || addressList[0] == '上海市'){
that.province1 = addressList[0];
that.city1 = '市辖区';
that.area1 = addressList[1];
that.four1 = address.replace(that.province,'').replace(that.city,'').replace(that.area,'');
}else{
that.province1 = addressList[0];
that.city1 = addressList[1];
that.area1 = addressList[2];
that.four1 = address.replace(that.province,'').replace(that.city,'').replace(that.area,'');
};
console.log(that.four1);
}
});
},
getback(){
uni.navigateBack({
delta:1,
})
},
getzhi(index){
this.carzhi = index
},
getzhi2(index){
this.maneizhi = index
},
//
//
//
//
}
}
</script>
<style scoped lang="scss">
.content{
width: 100%;
height: calc(100vh);
background-color: #F6F6F6;
box-sizing: border-box;
padding-top: 45px;
}
.top-icon{
margin-bottom: 15px;
}
.dil{
box-sizing: border-box;
background-color: #F6F6F6;
padding: 0px 12px;
}
.top{
box-sizing: border-box;
padding: 0px 15px;
width: 100%;
background-color: white;
}
.top-box{
display: flex;
justify-content: space-between;
align-items: center;
box-sizing: border-box;
padding: 20px 0px;
}
.tb-left{
height: 100%;
width: 80%;
display: flex;
align-items: center;
}
.uicon{
width: 18px;
height: 18px;
border-radius: 4px;
color: white;
background: orangered;
display: flex;
justify-content: center;
align-items: center;
font-size: 12px;
font-weight: bold;
margin-right: 6px;
}
.tb-right{
width: 20px;
height: 26px;
image{
width: 100%;
height: 100%;
}
}
.text1{
font-size: 16px;
font-weight: bold;
color: #363636;
}
.hong1{
margin-top: 5px;
font-size: 12px;
font-weight: 400;
color: #FF5453;
}
.hong2{
margin-top: 5px;
font-size: 12px;
font-weight: 400;
}
.tinput{
width: 100%;
display: flex;
background: white;
align-items: center;
justify-content: space-between;
box-sizing: border-box;
padding: 16px;
margin-top: 14px;
}
.xinput{
width: 100%;
background: white;
box-sizing: border-box;
padding: 16px;
margin-top: 14px;
}
.you{
text-align: right;
}
.xz{
margin-top: 10px;
display: flex;
align-items: center;
}
.kuang{
width: 38px;
height: 23px;
background: #ECECEC;
border-radius: 5px;
display: flex;
justify-content: center;
align-items: center;
color: #666666;
font-size: 14px;
margin-right: 15px;
}
.xlan{
background: #CDE7FF !important;
color: #1D62FF !important;
border: 1px solid #2A96FE;
}
.anniu{
width: 100%;
background: linear-gradient(105deg, #FFE3AC 0%, #F3BA60 98%);
height: 40px;
display: flex;
justify-content: center;
align-items: center;
color: #542F0E;
border-radius: 4px;
margin-top: 20px;
}
</style>

147
pages/rescue/order.vue Normal file
View File

@ -0,0 +1,147 @@
<!-- 选择页 -->
<template>
<view class="content">
<view class="bil">
<view class="top-icon" @click="getback()">
<uni-icons type="left" size="18"></uni-icons>
<view class="">返回</view>
</view>
<view class="top-white">
请选择您需要的业务
</view>
<view class="box">
<view class="xz-box" id="y1" @click="getsx(1)">
<view class="box-wenzi">拖车</view>
</view>
<view class="xz-box" id="y2" @click="getsx(2)">
<view class="box-wenzi">送油</view>
</view>
<view class="xz-box" id="y3" @click="getsx(3)">
<view class="box-wenzi">搭电</view>
</view>
<view class="xz-box" id="y4" @click="getsx(4)">
<view class="box-wenzi">换胎</view>
</view>
<view class="xz-box" id="y5" @click="getsx(5)">
<view class="box-wenzi">扣车</view>
</view>
</view>
<!-- <view class="anniu" @click="goindex()">
<view class="">立即进入</view>
</view> -->
</view>
<tabBar></tabBar>
</view>
</template>
<script>
import request from '../../utils/request';
import tabBar from'../../components/tabBar/tabBar.vue'
export default{
data(){
return{
sx1:true,
sx2:false,
}
},
components:{
tabBar,
},
methods:{
getback(){
uni.navigateBack({
delta:1,
})
},
getsx(id){
uni.navigateTo({
url:'/pages/rescue/initiate?id='+id
})
},
goindex(){
uni.navigateTo({
url:'/pages/index/index'
})
}
}
}
</script>
<style scoped lang="scss">
.content{
width: 100%;
height: calc(100vh);
background: white;
}
.bil{
box-sizing: border-box;
padding: 18px;
padding-top: 50px;
}
.top-icon{
display: flex;
color: #999999;
margin-bottom: 25px;
}
.top-white{
color: #333333;
font-size: 19px;
font-weight: bold;
// margin-top: 40px;
}
.box{
box-sizing: border-box;
display: flex;
justify-content: space-between;
flex-wrap: wrap;
}
.xz-box{
height: 80px;
width: 48%;
display: flex;
justify-content: center;
align-items: center;
font-size: 16px;
font-weight: 400;
color: #FFFFFF;
background-size: cover;
background-position: center;
margin-top: 14px;
}
.anniu{
background: linear-gradient(105deg, #FFE3AC 0%, #F3BA60 98%);
display: flex;
justify-content: center;
align-items: center;
font-size: 16px;
font-weight: 400;
color: #542F0E;
width: 100%;
border-radius: 10rpx;
height: 45px;
margin-top: 40px;
}
#y1{
background-image: url('../../static/tc.png');
}
#y2{
background-image: url('../../static/sy.png');
}
#y3{
background-image: url('../../static/dd.png');
}
#y4{
background-image: url('../../static/ht.png');
}
#y5{
background-image: url('../../static/kc.png');
}
</style>

531
pages/rescue/rescue.vue Normal file
View File

@ -0,0 +1,531 @@
<!-- 道路救援 首页-->
<template>
<view class="content">
<view class="dil">
<!-- 顶部 -->
<view class="top-two">
<view class="top-left">
<view class="left1">
<text>当前空闲</text>
</view>
<view class="left2">
<text>10条待确认</text>
</view>
</view>
<view class="top-right">
<view class="">
<uni-icons type="location-filled" color="#4282D8" size="16"></uni-icons>
</view>
<view class="">泸州</view>
</view>
</view>
<!-- 四个选项 -->
<view class="four-box">
<view class="boxf">
<view class="zi1">待确认</view>
<view class="zi2">0</view>
</view>
<view class="boxf1">
<view class="zi1">进行中</view>
<view class="zi2">0</view>
</view>
<view class="boxf2">
<view class="zi1">已完成</view>
<view class="zi2">0</view>
</view>
<view class="boxf3" @click="getyyz()">
<view class="zi1" v-if="yy==true">开始营业</view>
<view class="zi1" v-if="yy==false">营业中...</view>
<!-- <view class="zi2">0</view> -->
</view>
</view>
<!-- 标签切换 -->
<view class="box-tap">
<view class="tap-left">
<view v-for="(item,index) in tapbox" :key="index">
<view class="zi3" :class="{'acttext' : tapid == item.id }" @click="gettap(item.id)">
{{item.text}}
</view>
<view class="gang" v-if=" tapid == item.id "></view>
</view>
</view>
<!-- <view class="tap-right" @click="gohistory()">
<view class="zi3">
历史订单
</view>
<view class="">
<uni-icons color: #666666; type="right" size="18"></uni-icons>
</view>
</view> -->
</view>
<view class="tap-box">
<view class="boxt">
<view class="boxt-left">
<view class="left-lan">
<view class="">搭电</view>
</view>
<view class="text1">目的地</view>
<view class="text2">救援车辆距 <text class="lanzi"> 1.7KM</text> </view>
<view class="text2">预计 <text class="lanzi">30分钟</text> 到达</view>
</view>
<view class="boxt-right">
<view class="zhtai">
<view class="">待支付</view>
</view>
<view class="dianhua">
<view class="ticon">
<image src="../../static/dh.png" mode=""></image>
</view>
<view class="">联系司机</view>
</view>
</view>
</view>
</view>
<!-- 一键救援 -->
<view class="yijian">
<view class="y-left" @click="getyi()">
<view class="">司机端测试</view>
</view>
<view class="y-right">
<view class="">列表</view>
</view>
</view>
<view style="width: 100%; height: 80px; "></view>
<!-- dibu -->
</view>
<tabBar></tabBar>
</view>
</template>
<script>
import request from '../../utils/request';
import tabBar from '../../components/tabBar/tabBar.vue';
export default {
data() {
return {
latitude: '',
longitude: '',
counter: 0,
timer: null,
yy: true,
arrbox: [{
text: '待支付',
id: 1
},
{
text: '待评价',
id: 2
},
],
tapid: 1,
tapbox: [{
text: '待确认',
id: 1
},
{
text: '进行中',
id: 2
},
{
text: '已完成',
id: 3
},
],
userinfo: {},
one: true,
ws: null,
timeout: null,
heartbeatMessage: 'ping',
heartbeatInterval: 5000, //
reconnectInterval: 1000, // 线
lastHeartbeatTime: null, //
}
},
onLoad() {},
onShow() {},
components: {
tabBar,
},
methods: {
getStatus() {
request({
url: '/app/driver/getStatus?driverId=' + this.userinfo.userId,
method: 'get',
}).then((res) => {
console.log('初次加载', res);
})
},
getyyz() {
this.yy = !this.yy
if (this.yy == true) {
this.getconnect()
}
},
getone() {
this.one = !this.one
},
//
getyi() {
uni.navigateTo({
url: '/pages/rescue/order'
})
},
//
getyue() {
uni.navigateTo({
url: '/pages/rescue/order'
})
},
//
gettap(id) {
this.tapid = id
},
gohistory() {
uni.navigateTo({
url: '/pages/rescue/historylist'
})
},
beforeDestroy() {
clearInterval(this.timer); //
}
}
}
</script>
<style scoped lang="scss">
.content {
width: 100%;
height: calc(100vh);
background-color: #F6F6F6;
}
.dil {
background-color: #F6F6F6;
box-sizing: border-box;
padding: 45px 12px;
}
.top-two {
width: 100%;
display: flex;
justify-content: space-between;
align-items: center;
}
.top-left {
width: 180px;
height: 26px;
box-sizing: border-box;
border-radius: 50px;
background-color: #D1EDFF;
display: flex;
justify-content: space-between;
overflow: hidden;
}
.left1 {
width: 50%;
background: linear-gradient(87deg, #B6E1FF 0%, #339DFF 100%);
font-size: 13px;
color: white;
font-weight: 400;
text-align: center;
display: flex;
justify-content: center;
align-items: center;
}
.left2 {
width: 50%;
background: #D1EDFF;
font-size: 13px;
color: #207EFE;
font-weight: 400;
text-align: center;
display: flex;
justify-content: center;
align-items: center;
}
.top-right {
display: flex;
align-items: center;
font-size: 14px;
font-weight: 400;
color: #4282D8;
}
.four-box {
margin-top: 15px;
width: 100%;
display: flex;
justify-content: space-between;
flex-wrap: wrap;
}
.boxf {
margin-top: 6px;
height: 84px;
width: 49%;
overflow: hidden;
box-sizing: border-box;
border-radius: 6px;
padding: 12px;
background-image: url('../../static/dzf.png');
background-size: cover;
background-position: center;
}
.boxf1 {
margin-top: 6px;
height: 84px;
width: 49%;
overflow: hidden;
box-sizing: border-box;
border-radius: 6px;
padding: 12px;
background-image: url('../../static/dpq.png');
background-size: cover;
background-position: center;
}
.boxf2 {
margin-top: 6px;
height: 84px;
width: 49%;
overflow: hidden;
box-sizing: border-box;
border-radius: 6px;
padding: 12px;
background-image: url('../../static/zxz.png');
background-size: cover;
background-position: center;
}
.boxf3 {
margin-top: 6px;
height: 84px;
width: 49%;
overflow: hidden;
box-sizing: border-box;
border-radius: 6px;
padding: 12px;
background-image: url('../../static/yyd.png');
background-size: cover;
background-position: center;
}
.zi1 {
font-size: 16px;
font-weight: bold;
color: #FFFFFF;
}
.zi2 {
width: 100%;
text-align: center;
font-size: 26px;
font-weight: bold;
color: #FFFFFF;
}
.box-tap {
width: 100%;
display: flex;
align-items: center;
justify-content: space-between;
margin-top: 25px;
}
.tap-left {
display: flex;
}
.tap-right {
display: flex;
align-items: center;
}
.zi3 {
font-size: 16px;
font-weight: 400;
color: #666666;
margin-right: 10px;
}
.left-img1 {
width: 65px;
height: 15px;
margin-right: 20px;
// smargin-bottom: 10px;
image {
width: 100%;
height: 100%;
}
}
.gang {
width: 40px;
height: 5px;
border-radius: 50px;
margin-top: 6px;
background: linear-gradient(87deg, #B6E1FF 0%, #339DFF 100%);
}
.tap-box {
margin-top: 24px;
background-color: #F6F6F6;
}
.boxt {
// height: 110px;
width: 100%;
background-color: white;
border-radius: 6px;
margin-top: 14px;
overflow: hidden;
display: flex;
box-sizing: border-box;
padding-bottom: 15px;
}
.boxt-left {
width: 50%;
height: 100%;
}
.left-lan {
width: 50px;
height: 25px;
display: flex;
justify-content: center;
align-items: center;
background-color: #207EFE;
font-size: 14px;
color: white;
border-radius: 0px 0px 6px 0px;
}
.text1 {
margin-left: 24px;
margin-top: 5px;
color: #333333;
font-size: 16px;
font-weight: bold;
color: #333333;
}
.lanzi {
font-weight: bold;
color: #4C98FF;
}
.text2 {
margin-left: 24px;
margin-top: 5px;
color: #333333;
font-size: 16px;
font-weight: 400;
color: #333333;
}
.boxt-right {
width: 50%;
height: 100%;
position: relative;
}
.zhtai {
position: absolute;
top: 10px;
right: 10px;
width: 60px;
height: 25px;
box-sizing: border-box;
background: #FFD7D7;
border-radius: 4px;
display: flex;
justify-content: center;
align-items: center;
color: #FF4C4C;
font-size: 14px;
}
.dianhua {
position: absolute;
bottom: -110px;
right: 10px;
display: flex;
font-size: 14px;
font-weight: 400;
color: #3289FF;
}
.ticon {
width: 12px;
height: 13px;
margin-right: 5px;
image {
width: 100%;
height: 100%;
}
}
.yijian {
width: 100%;
overflow: hidden;
display: flex;
justify-content: space-between;
align-items: center;
border-radius: 10px;
height: 40px;
font-size: 16px;
background: #F3BA60;
color: #542F0E;
margin-top: 22px;
}
.y-left {
display: flex;
justify-content: center;
align-items: center;
width: 70%;
height: 100%;
border-radius: 10px;
background: #FFE3AC;
}
.y-right {
width: 30%;
height: 100%;
display: flex;
justify-content: center;
align-items: center;
}
.acttext {
font-weight: bold;
}
</style>

54
pages/select/moban.vue Normal file
View File

@ -0,0 +1,54 @@
<!-- 默认复制 -->
<template>
<view class="content">
<view class="dil">
<view class="top-icon" @click="getback()">
<uni-icons type="left" size="18"></uni-icons>
</view>
<!-- 占位符 -->
<view style="width: 100%; height: 60px;"></view>
</view>
<tabBar></tabBar>
</view>
</template>
<script>
import tabBar from'../../components/tabBar/tabBar.vue'
import request from '../../utils/request';
export default{
data(){
return{
}
},
components:{
tabBar,
},
methods:{
getback(){
uni.navigateBack({
delta:1,
})
},
}
}
</script>
<style scoped lang="scss">
.content{
width: 100%;
height: calc(100vh);
background-color: #F6F6F6;
box-sizing: border-box;
padding-top: 45px;
}
.top-icon{
margin-bottom: 45px;
}
.dil{
box-sizing: border-box;
padding: 0px 12px;
}
</style>

106
pages/select/select.vue Normal file
View File

@ -0,0 +1,106 @@
<!-- 选择页 -->
<template>
<view class="content">
<view class="top-white">
请选择您需要的业务
</view>
<view class="box">
<view class="xz-box" v-if="sx1 == false" style="background-image: url('../../static/dljy.png');" @click="getsx()">
<view class="box-wenzi">道路救援</view>
</view>
<view class="xz-box" v-if="sx1 == true" style="background-image: url('../../static/xdljy.png');" @click="getsx()">
<view class="box-wenzi">道路救援</view>
</view>
<view class="xz-box" v-if="sx2 == false" style="background-image: url('../../static/qcjc.png');" @click="getsx2()">
<view class="box-wenzi">汽车检测</view>
</view>
<view class="xz-box" v-if="sx2 == true" style="background-image: url('../../static/xqcjc.png');" @click="getsx2()">
<view class="box-wenzi">汽车检测</view>
</view>
</view>
<view class="anniu" @click="goindex()">
<view class="">立即进入</view>
</view>
</view>
</template>
<script>
import request from '../../utils/request';
export default{
data(){
return{
sx1:true,
sx2:false,
}
},
methods:{
getsx(){
this.sx1 =! this.sx1
this.sx2 = false
},
getsx2(){
this.sx2 =! this.sx2
this.sx1 = false
},
goindex(){
uni.navigateTo({
url:'/pages/rescue/rescue'
})
}
}
}
</script>
<style scoped lang="scss">
.content{
width: 100%;
height: calc(100vh);
background: #282A32;
box-sizing: border-box;
padding: 18px;
}
.top-white{
color: white;
font-size: 19px;
font-weight: bold;
margin-top: 40px;
}
.box{
box-sizing: border-box;
display: flex;
justify-content: space-between;
flex-wrap: wrap;
}
.xz-box{
height: 80px;
width: 48%;
display: flex;
justify-content: center;
align-items: center;
font-size: 16px;
font-weight: 400;
color: #FFFFFF;
background-size: cover;
background-position: center;
margin-top: 14px;
}
.anniu{
background: linear-gradient(105deg, #FFE3AC 0%, #F3BA60 98%);
display: flex;
justify-content: center;
align-items: center;
font-size: 16px;
font-weight: 400;
color: #542F0E;
width: 100%;
border-radius: 10rpx;
height: 45px;
margin-top: 40px;
}
</style>

BIN
static/-h-wxdl.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

BIN
static/bxwh.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

BIN
static/clbx.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

BIN
static/clxx.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

BIN
static/dd.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

BIN
static/detection/dd.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 367 B

BIN
static/detection/ddw.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 337 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 507 KiB

BIN
static/detection/shouji.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 269 B

BIN
static/detection/sja.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 625 B

BIN
static/detection/sy.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 441 B

BIN
static/detection/syw.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 457 B

BIN
static/detection/wd.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 443 B

BIN
static/detection/wdw.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 528 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 463 B

BIN
static/dh.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

BIN
static/dingwei.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.0 KiB

BIN
static/dljy.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

BIN
static/dpq.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

BIN
static/dzf.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

BIN
static/home.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

BIN
static/homex.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

BIN
static/ht.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 319 B

BIN
static/images/bddh.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 256 B

BIN
static/images/cldd.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 333 B

BIN
static/images/cllx.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 426 B

BIN
static/images/ddian.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

BIN
static/images/dzlq.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 401 B

BIN
static/images/fqsj.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 469 B

BIN
static/images/htai.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

BIN
static/images/kouche.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

BIN
static/images/lxr.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 449 B

BIN
static/images/profile.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 79 KiB

BIN
static/images/syou.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

BIN
static/images/tche.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

BIN
static/jiejin.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

BIN
static/jyls.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.0 KiB

BIN
static/jyz.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

BIN
static/jzkq.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

BIN
static/kc.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

BIN
static/loginbj.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 256 KiB

BIN
static/logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

BIN
static/message.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

BIN
static/messagex.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

BIN
static/my.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

BIN
static/myx.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

BIN
static/qcjc.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

BIN
static/qcwx.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

BIN
static/quesheng.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 134 KiB

BIN
static/rscgm.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

BIN
static/rzsj.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

BIN
static/smrz.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

BIN
static/sy.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

BIN
static/tc.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

BIN
static/xclbx.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

BIN
static/xdljy.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

BIN
static/xinlogo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 86 KiB

BIN
static/xjzkq.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

BIN
static/xqcjc.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

BIN
static/xqcjx.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

BIN
static/xrscgm.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

BIN
static/xtsz.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

BIN
static/xxxx.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

BIN
static/ycar.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

BIN
static/ycarx.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

BIN
static/yyd.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

BIN
static/zxz.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

8
store/getters.js Normal file
View File

@ -0,0 +1,8 @@
const getters = {
token: state => state.user.token,
avatar: state => state.user.avatar,
name: state => state.user.name,
roles: state => state.user.roles,
permissions: state => state.user.permissions
}
export default getters

15
store/index.js Normal file
View File

@ -0,0 +1,15 @@
import Vue from 'vue'
import Vuex from 'vuex'
import user from '@/store/modules/user'
import getters from './getters'
Vue.use(Vuex)
const store = new Vuex.Store({
modules: {
user
},
getters
})
export default store

98
store/modules/user.js Normal file
View File

@ -0,0 +1,98 @@
import config from '@/config'
import storage from '@/utils/storage'
import constant from '@/utils/constant'
import { login, logout, getInfo } from '@/api/login'
import { getToken, setToken, removeToken } from '@/utils/auth'
const baseUrl = config.baseUrl
const user = {
state: {
token: getToken(),
name: storage.get(constant.name),
avatar: storage.get(constant.avatar),
roles: storage.get(constant.roles),
permissions: storage.get(constant.permissions)
},
mutations: {
SET_TOKEN: (state, token) => {
state.token = token
},
SET_NAME: (state, name) => {
state.name = name
storage.set(constant.name, name)
},
SET_AVATAR: (state, avatar) => {
state.avatar = avatar
storage.set(constant.avatar, avatar)
},
SET_ROLES: (state, roles) => {
state.roles = roles
storage.set(constant.roles, roles)
},
SET_PERMISSIONS: (state, permissions) => {
state.permissions = permissions
storage.set(constant.permissions, permissions)
}
},
actions: {
// 登录
Login({ commit }, userInfo) {
const username = userInfo.username.trim()
const password = userInfo.password
const code = userInfo.code
const uuid = userInfo.uuid
return new Promise((resolve, reject) => {
login(username, password, code, uuid).then(res => {
setToken(res.token)
commit('SET_TOKEN', res.token)
resolve()
}).catch(error => {
reject(error)
})
})
},
// 获取用户信息
GetInfo({ commit, state }) {
return new Promise((resolve, reject) => {
getInfo().then(res => {
const user = res.user
const avatar = (user == null || user.avatar == "" || user.avatar == null) ? require("@/static/images/profile.jpg") : baseUrl + user.avatar
const username = (user == null || user.userName == "" || user.userName == null) ? "" : user.userName
if (res.roles && res.roles.length > 0) {
commit('SET_ROLES', res.roles)
commit('SET_PERMISSIONS', res.permissions)
} else {
commit('SET_ROLES', ['ROLE_DEFAULT'])
}
commit('SET_NAME', username)
commit('SET_AVATAR', avatar)
resolve(res)
}).catch(error => {
reject(error)
})
})
},
// 退出系统
LogOut({ commit, state }) {
return new Promise((resolve, reject) => {
logout(state.token).then(() => {
commit('SET_TOKEN', '')
commit('SET_ROLES', [])
commit('SET_PERMISSIONS', [])
removeToken()
storage.clean()
resolve()
}).catch(error => {
reject(error)
})
})
}
}
}
export default user

10
uni.promisify.adaptor.js Normal file
View File

@ -0,0 +1,10 @@
uni.addInterceptor({
returnValue (res) {
if (!(!!res && (typeof res === "object" || typeof res === "function") && typeof res.then === "function")) {
return res;
}
return new Promise((resolve, reject) => {
res.then((res) => res[0] ? reject(res[0]) : resolve(res[1]));
});
},
});

Some files were not shown because too many files have changed in this diff Show More