diff --git a/pages/contract/contract.vue b/pages/contract/contract.vue index 9553af7..81bbf87 100644 --- a/pages/contract/contract.vue +++ b/pages/contract/contract.vue @@ -4,9 +4,11 @@ - + - + 请选择车辆: - + {{showtext}} - + - 请选择人: - - - + 请选择人: + + + - - - {{item.nickname}} - {{item.mobile}} - - - 选择 - - - + + + {{item.nickname}} + {{item.mobile}} + + + 选择 + + + 点击加载更多 - + 暂无信息 - - - - + + + + - + 下一步 @@ -76,14 +79,16 @@ - + + .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 + } + \ No newline at end of file diff --git a/pages/detection/MerchantDetails.vue b/pages/detection/MerchantDetails.vue index 6bd3d4c..d13c6e9 100644 --- a/pages/detection/MerchantDetails.vue +++ b/pages/detection/MerchantDetails.vue @@ -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() { diff --git a/pages/detection/Merchantproducts.vue b/pages/detection/Merchantproducts.vue index 1651a9f..229dfef 100644 --- a/pages/detection/Merchantproducts.vue +++ b/pages/detection/Merchantproducts.vue @@ -503,6 +503,7 @@ } }) // 查询业务来源和渠道 + console.log(res); if (res.data) { data.businessChannelId = res.data.business.id diff --git a/pages/detection/my.vue b/pages/detection/my.vue index 9bd5859..b7f456c 100644 --- a/pages/detection/my.vue +++ b/pages/detection/my.vue @@ -257,7 +257,12 @@ } from '@/utils/auth' import config from '@/config' import tabBar from '../../components/detection/tabBar.vue' - import newRequest from "@/utils/newRequest"; + 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' }) diff --git a/pages/noticeContent/index.vue b/pages/noticeContent/index.vue new file mode 100644 index 0000000..d0603ff --- /dev/null +++ b/pages/noticeContent/index.vue @@ -0,0 +1,181 @@ + + + + + \ No newline at end of file diff --git a/utils/newRequest.js b/utils/newRequest.js index 28dc308..7677713 100644 --- a/utils/newRequest.js +++ b/utils/newRequest.js @@ -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('无效的会话,或者会话已过期,请重新登录。') diff --git a/utils/utils.js b/utils/utils.js new file mode 100644 index 0000000..fc961cc --- /dev/null +++ b/utils/utils.js @@ -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 +} +