浏览代码

调整首页代码

腾讯ocr渠道不签约
zhoujie 9 个月前
父节点
当前提交
cbfbfe47c1
共有 2 个文件被更改,包括 297 次插入80 次删除
  1. 20
    22
      pages/index/index - 副本.vue
  2. 277
    58
      pages/index/index.vue

+ 20
- 22
pages/index/index - 副本.vue 查看文件

<!-- Banner --> <!-- Banner -->
<view class="banner"> <view class="banner">
<swiper class="swiper" circular :indicator-dots="swiper.indicatorDots" :autoplay="swiper.autoplay" <swiper class="swiper" circular :indicator-dots="swiper.indicatorDots" :autoplay="swiper.autoplay"
:interval="swiper.interval" :duration="swiper.duration"
indicator-active-color="rgba(0, 179, 139, 1)" :easing-function="swiper.easing">
:interval="swiper.interval" :duration="swiper.duration" indicator-active-color="rgba(0, 179, 139, 1)"
:easing-function="swiper.easing">
<block v-if="state.swiperList.length >0" v-for="item in state.swiperList" :key="item.id"> <block v-if="state.swiperList.length >0" v-for="item in state.swiperList" :key="item.id">
<swiper-item class="swiper-item" @click="link(item)"> <swiper-item class="swiper-item" @click="link(item)">
<image :src="fileURLList + item.imgUrl" mode="widthFix"></image> <image :src="fileURLList + item.imgUrl" mode="widthFix"></image>
</swiper> </swiper>


<view class="notice"> <view class="notice">
<image class="icon" :src="fileURL + 'image/index/icon-notice.png'" lazy-load="false"
mode="aspectFill">
<image class="icon" :src="fileURL + 'image/index/icon-notice.png'" lazy-load="false" mode="aspectFill">
</image> </image>
<uni-notice-bar style="width: 100%;" scrollable single :text="state.notice"> <uni-notice-bar style="width: 100%;" scrollable single :text="state.notice">
</uni-notice-bar> </uni-notice-bar>
</view> </view>
<view class="text">卡签信息查询</view> <view class="text">卡签信息查询</view>
</view> </view>
<view class="item-box"
@click="$util.navTo('/subpackage/personal-center/install-activation-order',true)">
<view class="item-box" @click="$util.navTo('/subpackage/personal-center/install-activation-order',true)">
<view class="item item-4"> <view class="item item-4">
<image :src="fileURL + 'image/index/item-4.png'" mode="aspectFill" /> <image :src="fileURL + 'image/index/item-4.png'" mode="aspectFill" />
</view> </view>
<view class="flow-path"> <view class="flow-path">
<scroll-view scroll-x="true" class="scroll-view"> <scroll-view scroll-x="true" class="scroll-view">
<view class="top-menu"> <view class="top-menu">
<view :class="item == state.tabActive ? 'tab active' : 'tab'"
v-for="item in state.flowPathTabList" :key="item" @click="flowPathTabHandle(item)">
<view :class="item == state.tabActive ? 'tab active' : 'tab'" v-for="item in state.flowPathTabList"
:key="item" @click="flowPathTabHandle(item)">
<view class="border"></view>{{ item }} <view class="border"></view>{{ item }}
</view> </view>
</view> </view>
} from "vue"; } from "vue";
import { import {
onPageScroll, onPageScroll,
onLoad, onReachBottom,onReady
onLoad, onReachBottom, onReady
} from "@dcloudio/uni-app"; } from "@dcloudio/uni-app";
import flowPathList from "./components/flow-path-list.vue"; import flowPathList from "./components/flow-path-list.vue";
import filter from '@/components/filter/filter.vue'; import filter from '@/components/filter/filter.vue';
scrollTop.value = e.scrollTop; scrollTop.value = e.scrollTop;
}); });
onLoad((options) => { onLoad((options) => {
console.log("wechatSignNo",options)
getInfo();
console.log("wechatSignNo", options)
getInfo();
}) })
// 页面初次渲染完成时触发 // 页面初次渲染完成时触发
onReady(()=>{
setTimeout(()=>{
quanKeyAction()
},5000)
})
onReady(() => {
setTimeout(() => {
quanKeyAction()
}, 5000)
})


onMounted(() => { onMounted(() => {
uni.getSystemInfo({ uni.getSystemInfo({
method: "POST", method: "POST",
showLoading: true, showLoading: true,
}; };
request(queryKey, options).then((res) => {
request(queryKey, options).then((res) => {
console.log(stringToJson(res.bizContent)); console.log(stringToJson(res.bizContent));
const data = stringToJson(res.bizContent) const data = stringToJson(res.bizContent)
console.log("轮播图", data) console.log("轮播图", data)
setItem('key', data.dictTypeAndItem) setItem('key', data.dictTypeAndItem)
}) })
.catch((err) => {
console.log(err);
});
.catch((err) => {
console.log(err);
});
} }




request(infoQuery, options) request(infoQuery, options)
.then((res) => { .then((res) => {
let data = stringToJson(res.bizContent) let data = stringToJson(res.bizContent)
console.log(data,'公告');
console.log(data, '公告');
state.notice = data.text state.notice = data.text
}) })
.catch((err) => { .catch((err) => {
console.log(err);
console.log(err, '错误');
}); });
} }
// 高速快讯查询接口 // 高速快讯查询接口

+ 277
- 58
pages/index/index.vue 查看文件

</view> </view>
<view class="content"> <view class="content">
<view class="header"> <view class="header">
<!-- <navBar :isBack='false' :title='首页'></navBar> -->
<view class="title"> <view class="title">
<view :style="{ height: `${statusBarHeight}px` }"></view> <view :style="{ height: `${statusBarHeight}px` }"></view>
<!-- 自定义导航栏高度 -->
<!-- 自定义导航栏高度 -->
<view class='title-txt' :style="{ <view class='title-txt' :style="{
height: `${barHeight}px`, height: `${barHeight}px`,
'line-height': `${barHeight}px` 'line-height': `${barHeight}px`
</view> </view>


<view class="nav"> <view class="nav">
<view class="item-box" v-for='item in navList' @click="handleNav(item)">
<view class="item-box" v-for='(item,index) in navList' :key='index' @click="handleNav(item)">
<view class="icon-img"> <view class="icon-img">
<image :src="item.imgUrl" mode="aspectFit" class='img'></image> <image :src="item.imgUrl" mode="aspectFit" class='img'></image>
</view> </view>
<image :src="`${fileURL}image/newHome/tongzhi-l.png`" class='img' mode="aspectFit"></image> <image :src="`${fileURL}image/newHome/tongzhi-l.png`" class='img' mode="aspectFit"></image>
</view> </view>
<view class="r-info"> <view class="r-info">
如何授权登录小程序?
<!-- <u-notice-bar mode="vertical" :list="state.noticeList" type="none" :volume-icon="false" :no-list-hidden='true'></u-notice-bar> -->
{{state.notice}}
</view> </view>
</view> </view>


<view class="supervision-con"> <view class="supervision-con">
<view class="txt">
<!-- <u-swiper :list="state.swiperListArr"></u-swiper> -->
<swiper class="swiper" circular :indicator-dots="swiper.indicatorDots" :autoplay="swiper.autoplay"
:interval="swiper.interval" :duration="swiper.duration" :easing-function="swiper.easing">
<block v-if="state.swiperList.length >0" v-for="item in state.swiperList" :key="item.id">
<swiper-item class="swiper-item" @click="link(item)">
<image :src="fileURLList + item.imgUrl" mode="widthFix" class='img'></image>
</swiper-item>
</block>
</swiper>
<!-- <view class="txt">
ETC服务监督电话 ETC服务监督电话
</view> </view>
<view class="phone"> <view class="phone">
</view> </view>
<view class="btn"> <view class="btn">
<text>立即拨打 ></text> <text>立即拨打 ></text>
</view>
</view> -->
</view> </view>


<view class="title-name"> <view class="title-name">
</view> </view>
<view class="express-lane"> <view class="express-lane">
<view class="item keche"> <view class="item keche">
<view class="item-con">
<view class="item-con" @click="showMask(1)">
<view class="top-txt"> <view class="top-txt">
客车用户 客车用户
</view> </view>
</view> </view>
</view> </view>
<view class="item huoche"> <view class="item huoche">
<view class="item-con">
<view class="item-con" @click="showMask(2)">
<view class="top-txt"> <view class="top-txt">
货车用户 货车用户
</view> </view>
</view> </view>
</view> </view>
</view> </view>


<view class="news-con"> <view class="news-con">
<view class="title-con"> <view class="title-con">
<text>高速快讯</text> <text>高速快讯</text>
<view class="r-more">
<view class="r-more" @click="$util.navTo('/subpackage/orders/moreHighMsg/moreHighMsg',true)">
<text class='txt'>更多</text> <text class='txt'>更多</text>
<image :src="`${fileURL}image/newHome/r-icon.png`" mode="aspectFit" class='icon'></image> <image :src="`${fileURL}image/newHome/r-icon.png`" mode="aspectFit" class='icon'></image>
</view> </view>
</view> </view>
<view class="news-box"> <view class="news-box">
<view class="news-item">
<view class="l-img">
<image :src="`${fileURL}image/newHome/图层 5.png`" mode="aspectFill" class="img"></image>
</view>
<view class="r-txt">
<view class="tit">
后装ETC与选装ETC的介绍
</view>
<view class="b-time">
2024-09-22
</view>
</view>
</view>
<view class="news-item">
<view class="l-img">
<image :src="`${fileURL}image/newHome/图层 5.png`" mode="aspectFill" class="img"></image>
</view>
<view class="r-txt">
<view class="tit">
后装ETC与选装ETC的介绍
</view>
<view class="b-time">
2024-09-22
</view>
</view>
</view>
<view class="news-item">
<view class="l-img">
<image :src="`${fileURL}image/newHome/图层 5.png`" mode="aspectFill" class="img"></image>
</view>
<view class="r-txt">
<view class="tit">
后装ETC与选装ETC的介绍
<template v-if='state.highMsgData'>
<view class="news-item" v-for="(item,index) in state.highMsgData" :key='index' @click="link(item)">
<view class="l-img">
<image :src="fileURLList + item.imgUrl" mode="aspectFill" class="img"></image>
</view> </view>
<view class="b-time">
2024-09-22
<view class="r-txt">
<view class="tit">
{{item.title}}
</view>
<view class="b-time">
{{item.updateTime}}
</view>
</view> </view>
</view> </view>
</template>
<view class="empty-news" v-else>
<u-empty text="暂无数据" mode="news" :icon-size='90' :font-size='24'></u-empty>
</view> </view>

</view> </view>

</view> </view>


<!-- 办理流程 --> <!-- 办理流程 -->
</view> </view>
<view v-else-if="state.tabActive === '常见问题'"> <view v-else-if="state.tabActive === '常见问题'">
<view class="flow-list wenti"> <view class="flow-list wenti">
<view class="item-box" v-for='item in state.commonQuestionArr'>
<view class="item-box" v-for='(item,index) in state.commonQuestionArr' :key='index'>
<view class="l-icon"> <view class="l-icon">
<image :src="`${fileURL}image/newHome/wenhao.png`" mode="scaleToFill" class="icon-img"></image> <image :src="`${fileURL}image/newHome/wenhao.png`" mode="scaleToFill" class="icon-img"></image>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
</view>




</view>
</view>
<!-- ETC选择弹窗 -->
<view class="mask" v-if="isShowMask">

<view class="mask-content">
<filter>
<view class="mask-close">
<image :src="fileURL + 'image/index/icon-close.png'" class="icon-closed" @click="closeMask"></image>
</view>
<view class="mask-title" :style="{ '--color': color }">选择ETC用户类型</view>
<view class="mask-tab">
<view class="tab-item active" @click="toCreatOrder('1')">
<image :src="fileURL + 'image/index/icon-personal.png'" mode="aspectFill"></image>
<text class="tab-tit on">个人办理</text>
</view>
<view class="tab-item" @click="toCreatOrder('2')">
<image :src="fileURL + 'image/index/icon-unit.png'" mode="aspectFill"></image>
<text class="tab-tit on">单位办理</text>
</view>
</view>
</filter>
</view>
</view> </view>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
getCodeName getCodeName
} from "@/datas/queryKey.js"; } from "@/datas/queryKey.js";
// import { jump } from "@/datas/9901Jump.js"; // import { jump } from "@/datas/9901Jump.js";
import navBar from "@/components/nav-bar/nav-bar2.vue";
// import navBar from "@/components/nav-bar/nav-bar2.vue";
import { getCurrentInstance } from 'vue';
const tools = require("../../static/etcUtil/tools.js");
const instance = getCurrentInstance();
const swiper = reactive({
indicatorDots: false,
autoplay: true,
interval: 6000,
duration: 3000,
easing: "easeInOutCubic"
})

onLoad((options) => { onLoad((options) => {
console.log("wechatSignNo", options) console.log("wechatSignNo", options)
getInfo(); getInfo();
}) })
onMounted(() => { onMounted(() => {
statusBarHeight.value = uni.getSystemInfoSync().statusBarHeight;
const query = uni.createSelectorQuery().in(instance.proxy);
query
.select(".news-con")
.boundingClientRect((data) => {
console.log("得到布局位置信息", data);
console.log("节点离页面顶部的距离为" + data.top);
newTop.value = data.top
})
.exec();
let systemInfo = uni.getSystemInfoSync()
viewHeight.value = systemInfo.windowHeight
statusBarHeight.value = systemInfo.statusBarHeight;
const { const {
top, top,
height height
} = uni.getMenuButtonBoundingClientRect(); } = uni.getMenuButtonBoundingClientRect();
barHeight.value = height ? height + (top - statusBarHeight.value) * 2 : 38; barHeight.value = height ? height + (top - statusBarHeight.value) * 2 : 38;
console.log(barHeight.value, statusBarHeight.value, '计算的顶部高度');
console.log(barHeight.value, statusBarHeight.value, systemInfo, '计算的顶部高度');
getSwiper()
}) })
const statusBarHeight = ref(0) const statusBarHeight = ref(0)
const viewHeight = ref(0) //可视区高度
const barHeight = ref(0) const barHeight = ref(0)
const searchParams = ref('') const searchParams = ref('')
const newTop = ref(0) //高速快讯距离顶部距离
const isShowMask = ref(false);
//搜索 //搜索
const onKeyInput = (event) => { const onKeyInput = (event) => {
searchParams.value = event.target.value; searchParams.value = event.target.value;
userType: 1, //1个人 2单位 userType: 1, //1个人 2单位
notice: "", notice: "",
swiperList: [], swiperList: [],
swiperListArr: [],
noticeList: [], //公告栏列表 noticeList: [], //公告栏列表
flowPathTabList: ["办理流程", "办理条件", "常见问题"], flowPathTabList: ["办理流程", "办理条件", "常见问题"],
tabActive: "办理流程", tabActive: "办理流程",
request(infoQuery, options) request(infoQuery, options)
.then((res) => { .then((res) => {
let data = stringToJson(res.bizContent) let data = stringToJson(res.bizContent)
console.log(data, '公告');
state.notice = data.text state.notice = data.text
state.noticeList = [data.text || '暂无公告', '平明送客楚山孤',]
console.log(data, state.noticeList, '公告');
}) })
.catch((err) => { .catch((err) => {
console.log(err);
console.log(err, '错误');
}); });
} }
let newLock = false
// 高速快讯查询接口 // 高速快讯查询接口
const highMsg = () => { const highMsg = () => {
newLock = true
let options = { let options = {
type: 2, //type: 2,JSON格式提交数据(默认表单形式提交) type: 2, //type: 2,JSON格式提交数据(默认表单形式提交)
data: { data: {
state.highMsgData = stringToJson(res.bizContent).data state.highMsgData = stringToJson(res.bizContent).data
for (var i = 0; i < state.highMsgData.length; i++) { for (var i = 0; i < state.highMsgData.length; i++) {
state.highMsgData[i]["copywriting"] = getCodeName('COPYWRITING', state.highMsgData[i]["copywriting"]) state.highMsgData[i]["copywriting"] = getCodeName('COPYWRITING', state.highMsgData[i]["copywriting"])
state.highMsgData[i]["updateTime"] = state.highMsgData[i]["updateTime"].replace('T', ' ')
if (state.highMsgData[i]["type"] == 3) { if (state.highMsgData[i]["type"] == 3) {
state.highMsgData[i]["title"] = state.highMsgData[i]["hyperLink"] state.highMsgData[i]["title"] = state.highMsgData[i]["hyperLink"]
} }
} }
//监听页面滚动 //监听页面滚动
onPageScroll((e) => { onPageScroll((e) => {
console.log(e.scrollTop,);
let h = viewHeight.value + e.scrollTop
if (h >= newTop.value - 50 && !newLock) {
highMsg()
}
}); });
const toCreatOrder = (val : number) => {
console.log(typeof (val));
state.userType = val;
navTo(`/subpackage/orders/choice-product?type=${state.type}&&userType=${state.userType}`)
closeMask();
};

const showMask = (val : any) => {
state.type = val; //1 客车 2货车
isShowMask.value = true;
};

const closeMask = () => {
isShowMask.value = false;
};
//全量枚举值查询
const quanKeyAction = () => {
var data = {};
const options = {
type: 2,
data: data,
method: "POST",
showLoading: true,
};
request(queryKey, options).then((res) => {
console.log(stringToJson(res.bizContent));
const data = stringToJson(res.bizContent)
console.log("枚举", data)
setItem('key', data.dictTypeAndItem)
})
.catch((err) => {
console.log(err);
});
}
onReady(() => {
setTimeout(() => {
quanKeyAction()
}, 5000)
})
//获取轮播
const getSwiper = () => {

let options = {
type: 2, //type: 2,JSON格式提交数据(默认表单形式提交)
data: {
}, //请求参数
method: "POST", //提交方式(默认POST)
showLoading: true, //是否显示加载中(默认显示)
};

//调用方式
request(querySwiper, options).then((res) => {
console.log(stringToJson(res.bizContent));
const data = stringToJson(res.bizContent)
console.log("轮播图", data)
state.swiperList = data.swipers ? data.swipers : [],
state.swiperListArr = state.swiperList.map(item => fileURLList + item.imgUrl)
})
.catch((err) => {
console.log(err);
});

};
const link = (item : any) => {
console.log(item);
if (item.type == 1) {
const params = encodeURIComponent(JSON.stringify(item.hyperLink))
tools.toUrl(`/subpackage/personal-center/webview?url=` + params);
} else if (item.type == 2) {
navTo(item.hyperLink)
} else if (item.type == 3) {
const param = encodeURIComponent(JSON.stringify(item))
tools.toUrl(`/subpackage/orders/moreHighMsg/textDetails?item=` + param);
} else if (item.type == 4) {
uni.navigateToMiniProgram({
appId: item.hyperLink,
path: item.speedUrl,
success(res) {
console.log(res);
},
complete(res) {
console.log(res);
},
fail(res) {
console.log(res);
// 未成功跳转到车主小程序
},
});
}
}
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.container { .container {
color: #fff; color: #fff;
font-weight: 500; font-weight: 500;
font-size: 26rpx; font-size: 26rpx;
background: #1a394d;
} }
} }


height: 180rpx; height: 180rpx;
width: 690rpx; width: 690rpx;
margin: 24rpx 30rpx 0; margin: 24rpx 30rpx 0;
background-image: url(https://qtzl.etcjz.cn/default-bucket/image/newHome/phone.png);
background-size: 100% 100%;
background-repeat: no-repeat;
padding: 35rpx 0 0 52rpx;
// background-image: url(https://qtzl.etcjz.cn/default-bucket/image/newHome/phone.png);
// background-size: 100% 100%;
// background-repeat: no-repeat;
// padding: 35rpx 0 0 52rpx;
// background: #FFFFFF;
border-radius: 12rpx;
overflow: hidden;

.swiper {
height: 180rpx;
width: 690rpx;
}

.swiper-item .img {
overflow: hidden;
border-radius: 12rpx;
height: 180rpx !important;
width: 690rpx;
}


.txt { .txt {
font-family: AlibabaPuHuiTi, AlibabaPuHuiTi; font-family: AlibabaPuHuiTi, AlibabaPuHuiTi;
} }
} }


.empty-news {}

.news-box { .news-box {
border-radius: 12rpx; border-radius: 12rpx;
background-color: #fff; background-color: #fff;
} }
} }
} }

.mask {
background: $uni-bg-color-mask;
position: fixed;
left: 0;
top: 0;
right: 0;
bottom: 0;
}

.mask-content {
background: $uni-bg-color;
width: 570rpx;
height: 480rpx;
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
display: flex;
flex-direction: column;
border-radius: 20rpx;
}

.mask-close {
text-align: right;
}

.mask-title {
text-align: center;
font-size: 32rpx;
color: $uni-text-color-black;
margin-bottom: 50rpx;
}

.mask-tab {
display: flex;
justify-content: space-evenly;
}

.icon-closed {
width: 48rpx;
height: 48rpx;
margin: 24rpx 24rpx 0 0;
}

.tab-item {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}

.tab-tit {
font-size: 32rpx;
margin-top: 20rpx;
color: #666;
}

.tab-item image {
width: 160rpx;
height: 160rpx;
}

.backlog-notice {
margin: 50rpx 30rpx 0rpx;
}
</style> </style>

正在加载...
取消
保存