This commit is contained in:
xyc 2025-07-11 13:16:08 +08:00
parent 2b6351037d
commit 288deaa2ee
7 changed files with 803 additions and 254 deletions

View File

@ -4,9 +4,11 @@
<view class="content">
<view class="authentication_top">
<image class="image3" style="width: 100%;margin-top: 50%;" v-if="PreviewContract" :src="contractImg" mode="widthFix"></image>
<image class="image3" style="width: 100%;margin-top: 50%;" v-if="PreviewContract" :src="contractImg"
mode="widthFix"></image>
<!-- 创建合成画布 -->
<view class="bgCoverBox" v-if="publish"><canvas :style="{width:height +'px',height:width +'px'}" canvas-id="mycontract" class="canvsborder2"></canvas></view>
<view class="bgCoverBox" v-if="publish"><canvas :style="{width:height +'px',height:width +'px'}"
canvas-id="mycontract" class="canvsborder2"></canvas></view>
<!-- 创建合成画布 -->
</view>
<!-- <view class="authentication_bottom" v-if="NavAutograph" style="background:#ffe9e9" @click="agreeSign">
@ -30,7 +32,8 @@
<view class="in-input">
<view class="in-left">请选择人</view>
<view class="in-right">
<input type="text" v-model="showtext1" @input="getcarlist" @blur="getcarlist" @confirm="getcarlist" placeholder="输入姓名/手机号">
<input type="text" v-model="showtext1" @input="getcarlist" @blur="getcarlist"
@confirm="getcarlist" placeholder="输入姓名/手机号">
</view>
</view>
<scroll-view class="l-bai" scroll-y="true">
@ -82,8 +85,10 @@
</view>
</template>
<script>
import request from '../../utils/request'
import { getToken } from '@/utils/auth'
import request from '../../utils/newRequest'
import {
getToken
} from '@/utils/auth'
import config from '@/config'
var x = 20;
var y = 20;
@ -177,7 +182,7 @@
async getcarlist() {
let resc = await request({
url: '/appInspection/userOwn/getCars',
url: '/app-api/appInspection/userOwn/getCars',
method: 'get',
})
console.log(resc);
@ -188,7 +193,7 @@
pageSize: this.pageSize, //
}
let res = await request({
url: '/appInspection/userOwn/getDbList',
url: '/app-api/appInspection/userOwn/getDbList',
method: 'get',
params: data
})
@ -496,7 +501,9 @@
console.log("签字", 'success');
}
});
uni.navigateBack({ delta: 1 }); //
uni.navigateBack({
delta: 1
}); //
}
}
})
@ -519,6 +526,7 @@
font-weight: 400;
color: #0D2E8D;
}
.l-bai {
width: 100%;
height: 220px;
@ -529,17 +537,20 @@
white-space: nowrap;
overflow: hidden;
}
.ming {
font-size: 16px;
font-weight: 400;
color: #333333;
margin-right: 10px;
}
.tel {
font-size: 16px;
font-weight: 400;
color: #999999;
}
.renname {
width: 100%;
display: flex;
@ -548,11 +559,13 @@
box-sizing: border-box;
padding: 10px;
}
.dix {
display: flex;
align-items: center;
}
.anniux {
width: 55px;
height: 25px;
@ -564,10 +577,8 @@
border-radius: 50px;
font-size: 15px;
}
.image3 {
}
.image3 {}
.in-box {
background-color: white;
@ -575,33 +586,199 @@
border-bottom: 1px solid #E8E8E8;
box-sizing: border-box;
}
.anniu{ width: 95%; height: 40px; margin: 0 auto; border-radius: 50px; display: flex; justify-content: center; align-items: center; color: #333333;
background: #0D2E8D; margin-top: 10px; color: white;}
.inforMation{width:100%; height: 100%; box-sizing: border-box; padding-top: 88px; background:#F6F6F6;position:fixed;top:0;left:0;right:0;
box-sizing: border-box; }
.in-input{background-color: white; width: 100%;border-bottom: 1px solid #E8E8E8; display: flex; justify-content: space-between;
align-items: center; box-sizing: border-box;padding: 20px;}
.in-left{font-size: 16px;font-weight: bold;color: #333333;}
.in-right{font-size: 16px;font-weight: 400;color: #C2C2C2; text-align: right;}
.authentication_top{width:100%;height:90%;position:fixed;top:0;left:0;right:0;margin:auto;overflow-y:scroll;padding-bottom:40rpx}
.authentication_top image{width:100%;display:inline-block}
.authentication_bottom{width:100%;height:10%;position:fixed;bottom:0;left:0;right:0;margin:auto;display:flex;flex-direction:column;justify-content:center;align-items:center;background:#ffe9e9}
.authentication_bottom button{background:0 0;border:none;font-size:15px;color:red;width:100%;text-align:center}
.authentication_bottom button:after{display:none}
.authentication_fun{width:100%;height:10%;position:fixed;bottom:30rpx;left:0;right:0;margin:auto;display:flex;flex-direction:row;justify-content:center;align-items:center;background:#ffe9e9;padding:0 3%;width:90%;border-radius:50px;box-shadow:0 3px 13px rgba(0,0,0,.2);border:4px solid #fd972e;box-sizing:border-box}
.authentication_fun button{border:none;font-size:15px;background:0 0;width:100%;text-align:center}
.authentication_fun button:after{display:none}
.signMask{width:100%;height:100%;background:#fff;position:fixed;top:0;bottom:0;left:0;right:0;flex-direction:row}
.sign-box,.signMask{margin:auto;display:flex}
.sign-box{width:80%;height:90%;flex-direction:column;text-align:center}
.sigh-btns,.sign-view{height:100%}
.sigh-btns{margin:auto;display:flex;flex-direction:column;justify-content:space-around}
.btn{margin:auto;padding:8rpx 40rpx;font-size:14px;transform:rotate(90deg);border:1rpx solid grey}
.mycanvas{margin:auto 0rpx;background-color:#ececec}
.canvsborder{border:1rpx solid #333;position:fixed;top:0;left:10000rpx}
.bgCoverBox{width:100%;height:auto}
.canvsborder2{height:700px!important}
.anniu {
width: 95%;
height: 40px;
margin: 0 auto;
border-radius: 50px;
display: flex;
justify-content: center;
align-items: center;
color: #333333;
background: #0D2E8D;
margin-top: 10px;
color: white;
}
.inforMation {
width: 100%;
height: 100%;
box-sizing: border-box;
padding-top: 88px;
background: #F6F6F6;
position: fixed;
top: 0;
left: 0;
right: 0;
box-sizing: border-box;
}
.in-input {
background-color: white;
width: 100%;
border-bottom: 1px solid #E8E8E8;
display: flex;
justify-content: space-between;
align-items: center;
box-sizing: border-box;
padding: 20px;
}
.in-left {
font-size: 16px;
font-weight: bold;
color: #333333;
}
.in-right {
font-size: 16px;
font-weight: 400;
color: #C2C2C2;
text-align: right;
}
.authentication_top {
width: 100%;
height: 90%;
position: fixed;
top: 0;
left: 0;
right: 0;
margin: auto;
overflow-y: scroll;
padding-bottom: 40rpx
}
.authentication_top image {
width: 100%;
display: inline-block
}
.authentication_bottom {
width: 100%;
height: 10%;
position: fixed;
bottom: 0;
left: 0;
right: 0;
margin: auto;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
background: #ffe9e9
}
.authentication_bottom button {
background: 0 0;
border: none;
font-size: 15px;
color: red;
width: 100%;
text-align: center
}
.authentication_bottom button:after {
display: none
}
.authentication_fun {
width: 100%;
height: 10%;
position: fixed;
bottom: 30rpx;
left: 0;
right: 0;
margin: auto;
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
background: #ffe9e9;
padding: 0 3%;
width: 90%;
border-radius: 50px;
box-shadow: 0 3px 13px rgba(0, 0, 0, .2);
border: 4px solid #fd972e;
box-sizing: border-box
}
.authentication_fun button {
border: none;
font-size: 15px;
background: 0 0;
width: 100%;
text-align: center
}
.authentication_fun button:after {
display: none
}
.signMask {
width: 100%;
height: 100%;
background: #fff;
position: fixed;
top: 0;
bottom: 0;
left: 0;
right: 0;
flex-direction: row
}
.sign-box,
.signMask {
margin: auto;
display: flex
}
.sign-box {
width: 80%;
height: 90%;
flex-direction: column;
text-align: center
}
.sigh-btns,
.sign-view {
height: 100%
}
.sigh-btns {
margin: auto;
display: flex;
flex-direction: column;
justify-content: space-around
}
.btn {
margin: auto;
padding: 8rpx 40rpx;
font-size: 14px;
transform: rotate(90deg);
border: 1rpx solid grey
}
.mycanvas {
margin: auto 0rpx;
background-color: #ececec
}
.canvsborder {
border: 1rpx solid #333;
position: fixed;
top: 0;
left: 10000rpx
}
.bgCoverBox {
width: 100%;
height: auto
}
.canvsborder2 {
height: 700px !important
}
</style>

View File

@ -377,11 +377,11 @@
fang() {
console.log("1212")
uni.openLocation({
latitude: this.obj.latitude,
longitude: this.obj.longitude,
latitude: this.obj.lat,
longitude: this.obj.lgt,
success: function() {
console.log('success');
}
},
});
},
async getindex() {

View File

@ -503,6 +503,7 @@
}
})
//
console.log(res);
if (res.data) {
data.businessChannelId = res.data.business.id

View File

@ -258,6 +258,11 @@
import config from '@/config'
import tabBar from '../../components/detection/tabBar.vue'
import newRequest from "@/utils/newRequest";
import {
toast,
showConfirm,
tansParams
} from '@/utils/common'
export default {
data() {
return {
@ -345,11 +350,12 @@
// 退
outoflogin() {
uni.clearStorageSync();
uni.reLaunch({
uni.navigateTo({
url: '/pages/detection/detection'
})
},
async getmy() {
console.log(getToken(), 111);
if (!getToken()) {
return
}
@ -369,16 +375,46 @@
console.log('车辆信息', this.carobj);
},
goorder(id) {
if (!getToken()) {
showConfirm('登录状态已过期,您可以继续留在该页面,或者重新登录?').then(res => {
if (res.confirm) {
uni.navigateTo({
url: '/pages/login/login'
})
}
})
reject('无效的会话,或者会话已过期,请重新登录。')
}
uni.navigateTo({
url: '/pages/detection/my-order?id=' + id
})
},
goreservation() {
if (!getToken()) {
showConfirm('登录状态已过期,您可以继续留在该页面,或者重新登录?').then(res => {
if (res.confirm) {
uni.navigateTo({
url: '/pages/login/login'
})
}
})
reject('无效的会话,或者会话已过期,请重新登录。')
}
uni.navigateTo({
url: '/pages/detection/my-reservation'
})
},
goshang() {
if (!getToken()) {
showConfirm('登录状态已过期,您可以继续留在该页面,或者重新登录?').then(res => {
if (res.confirm) {
uni.navigateTo({
url: '/pages/login/login'
})
}
})
reject('无效的会话,或者会话已过期,请重新登录。')
}
uni.navigateTo({
url: '/pages/ruzhu/ruzhu'
})
@ -389,23 +425,63 @@
})
},
gowei() {
if (!getToken()) {
showConfirm('登录状态已过期,您可以继续留在该页面,或者重新登录?').then(res => {
if (res.confirm) {
uni.navigateTo({
url: '/pages/login/login'
})
}
})
reject('无效的会话,或者会话已过期,请重新登录。')
}
uni.navigateTo({
url: '/pages/contract/contract'
})
},
//
gocollect() {
if (!getToken()) {
showConfirm('登录状态已过期,您可以继续留在该页面,或者重新登录?').then(res => {
if (res.confirm) {
uni.navigateTo({
url: '/pages/login/login'
})
}
})
reject('无效的会话,或者会话已过期,请重新登录。')
}
uni.navigateTo({
url: '/pages/detection/my-collect'
})
},
gocarinfo(id) {
if (!getToken()) {
showConfirm('登录状态已过期,您可以继续留在该页面,或者重新登录?').then(res => {
if (res.confirm) {
uni.navigateTo({
url: '/pages/login/login'
})
}
})
reject('无效的会话,或者会话已过期,请重新登录。')
}
uni.navigateTo({
url: '/pages/detection/my-carinfo?id=' + id
})
},
//
gousers() {
if (!getToken()) {
showConfirm('登录状态已过期,您可以继续留在该页面,或者重新登录?').then(res => {
if (res.confirm) {
uni.navigateTo({
url: '/pages/login/login'
})
}
})
reject('无效的会话,或者会话已过期,请重新登录。')
}
console.log('11');
uni.navigateTo({
url: '/pages/detection/my-user'
@ -413,6 +489,16 @@
},
//
gosfz() {
if (!getToken()) {
showConfirm('登录状态已过期,您可以继续留在该页面,或者重新登录?').then(res => {
if (res.confirm) {
uni.navigateTo({
url: '/pages/login/login'
})
}
})
reject('无效的会话,或者会话已过期,请重新登录。')
}
if (this.userinfo.idCard != null) {
uni.showToast({
title: '已上传身份证'
@ -425,6 +511,16 @@
},
//
goyhq() {
if (!getToken()) {
showConfirm('登录状态已过期,您可以继续留在该页面,或者重新登录?').then(res => {
if (res.confirm) {
uni.navigateTo({
url: '/pages/login/login'
})
}
})
reject('无效的会话,或者会话已过期,请重新登录。')
}
uni.navigateTo({
url: '/pages/detection/my-coupon'
})

View File

@ -0,0 +1,181 @@
<template>
<view class="container">
<VNavigationBar titleColor="rgba(0,0,0,0.9)" backgroundColor="#fff" title="通知公告详情"></VNavigationBar>
<view class="body">
<view class="header">
<view class="title line-clamp-3">{{ noticeDetails.title }}</view>
<view class="time" v-if="noticeDetails.updateTime">{{ getCurrentDateTime(noticeDetails.updateTime) }}
</view>
</view>
<view class="content">
<u-parse :content="noticeDetails.content"></u-parse>
<!-- <u-parse :content="test"></u-parse> -->
</view>
</view>
</view>
</template>
<script>
import {
getJSONData
} from "@/utils/auth";
import VNavigationBar from '@/components/tabBar/VNavigationBar.vue'
import request from '@/utils/request.js'
import newRequest from "@/utils/newRequest";
export default {
name: "content",
components: {
VNavigationBar
},
filters: {
formatRichText(html) {
const nodes = parser.getRichTextJson(html)
return nodes.children
}
},
data() {
return {
richTextHtml: '',
toUrl: null,
noticeId: null,
noticeDetails: [],
};
},
onLoad(data) {
console.log('data', data.id)
this.noticeId = data.id
this.getNoticeById()
},
methods: {
getNoticeById() {
newRequest({
url: '/app-api/base/notice/get',
method: 'GET',
params: {
id: this.noticeId
}
}).then(res => {
this.noticeDetails = res.data
})
},
//
getCurrentDateTime() {
const now = new Date();
const year = now.getFullYear();
const month = String(now.getMonth() + 1).padStart(2, '0');
const day = String(now.getDate()).padStart(2, '0');
const hours = String(now.getHours()).padStart(2, '0');
const minutes = String(now.getMinutes()).padStart(2, '0');
const seconds = String(now.getSeconds()).padStart(2, '0');
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
// return now;
},
}
}
</script>
<style scoped lang="scss">
.container {
height: 100vh;
display: flex;
flex-direction: column;
background-color: #ffffff;
.body {
flex: 1;
padding: 24rpx 32rpx;
overflow-y: auto;
box-sizing: border-box;
.header {
margin-bottom: 40rpx;
padding-bottom: 24rpx;
border-bottom: 1rpx solid #f0f0f0;
.title {
font-size: 36rpx;
font-weight: 600;
color: #333333;
line-height: 1.5;
margin-bottom: 16rpx;
word-break: break-word;
white-space: normal;
}
.time {
font-size: 24rpx;
color: #999999;
}
}
.content {
font-size: 30rpx;
color: #333333;
line-height: 1.8;
/* 图片样式增强 */
img {
max-width: 100% !important;
/* 确保图片不超过容器宽度 */
height: auto !important;
/* 保持图片原始比例 */
display: block;
/* 改为块级元素避免间隙 */
margin: 32rpx auto;
/* 增加上下边距 */
border-radius: 12rpx;
/* 圆角效果 */
box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.08);
/* 轻微阴影提升层次感 */
background-color: #f8f8f8;
/* 加载时的背景色 */
}
/* 图片点击预览(可选) */
img {
cursor: pointer;
transition: transform 0.2s;
}
img:active {
transform: scale(0.98);
}
/* 其他富文本元素样式 */
p {
margin: 24rpx 0;
word-break: break-word;
}
h1,
h2,
h3 {
margin: 32rpx 0 24rpx;
font-weight: 600;
}
a {
color: #2979ff;
text-decoration: none;
}
table {
width: 100%;
border-collapse: collapse;
margin: 24rpx 0;
font-size: 28rpx;
}
th,
td {
border: 1rpx solid #e0e0e0;
padding: 16rpx;
text-align: left;
}
}
}
}
</style>

View File

@ -46,12 +46,9 @@ const request = config => {
if (code === 401) {
showConfirm('登录状态已过期,您可以继续留在该页面,或者重新登录?').then(res => {
if (res.confirm) {
console.log('跳转');
uni.reLaunch({
uni.navigateTo({
url: '/pages/login/login'
})
}
})
reject('无效的会话,或者会话已过期,请重新登录。')

97
utils/utils.js Normal file
View File

@ -0,0 +1,97 @@
import request from "./request";
import {
setStorageWithExpiry,
getStorageWithExpiry
} from './auth'
export async function getDictDataByType(type) {
let data = getStorageWithExpiry(type);
if (data === null || data === undefined) {
try {
const response = await request({
url: '/app-api/system/dict-data/type',
method: 'get',
params: {type}
});
data = response.data;
setStorageWithExpiry(type, data, 3600); // 存储数据并设置过期时间
} catch (error) {
console.error("请求字典数据时出现了异常:", error);
throw error; // 确保错误能够被外部捕获
}
}
return data;
}
export function formatDate(timestamp) {
// 将时间戳转换为Date对象
const date = new Date(timestamp);
// 获取年月日时分秒
const year = date.getFullYear();
const month = (date.getMonth() + 1).toString().padStart(2, '0');
const day = date.getDate().toString().padStart(2, '0');
// 组合成日期时间字符串
return `${year}-${month}-${day}`;
}
export function formatDateChinese(timestamp) {
// 将时间戳转换为Date对象
const date = new Date(timestamp);
// 获取年月日时分秒
const year = date.getFullYear();
const month = (date.getMonth() + 1).toString().padStart(2, '0');
const day = date.getDate().toString().padStart(2, '0');
// 组合成日期时间字符串
return `${year}${month}${day}`;
}
export function formatDateTimeToMinute(timestamp) {
// 将时间戳转换为 Date 对象
const date = new Date(timestamp);
// 获取年月日时分
const year = date.getFullYear();
const month = (date.getMonth() + 1).toString().padStart(2, '0');
const day = date.getDate().toString().padStart(2, '0');
const hours = date.getHours().toString().padStart(2, '0');
const minutes = date.getMinutes().toString().padStart(2, '0');
// 组合成日期时间字符串格式yyyy-MM-dd hh:mm
return `${year}-${month}-${day} ${hours}:${minutes}`;
}
export function formatTimestamp(timestamp) {
// 将时间戳转换为Date对象
const date = new Date(timestamp);
// 获取年月日时分秒
const year = date.getFullYear();
const month = (date.getMonth() + 1).toString().padStart(2, '0');
const day = date.getDate().toString().padStart(2, '0');
const hours = date.getHours().toString().padStart(2, '0');
const minutes = date.getMinutes().toString().padStart(2, '0');
const seconds = date.getSeconds().toString().padStart(2, '0');
// 组合成日期时间字符串
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
}
export function getWXStatusHeight() {
// #ifdef MP-WEIXIN
// 获取距上
const barTop = wx.getSystemInfoSync().statusBarHeight
// 获取胶囊按钮位置信息
const menuButtonInfo = wx.getMenuButtonBoundingClientRect()
// 获取导航栏高度
const barHeight = menuButtonInfo.height + (menuButtonInfo.top - barTop) * 2
let barWidth = menuButtonInfo.width
console.log('menuButtonInfo', menuButtonInfo)
let barLeftPosition = 375 - menuButtonInfo.right + menuButtonInfo.width
let menuButtonLeft = menuButtonInfo.left
let menuButtonRight = menuButtonInfo.right
return {
barHeight,
barTop,
barWidth,
barLeftPosition,
menuButtonLeft,
menuButtonRight
}
// #endif
}