From b5f084460e9e639358fbf91056a86be8d0a5c4b2 Mon Sep 17 00:00:00 2001 From: yaolonglong <yaolonglong15@163.com> Date: 星期四, 09 十月 2025 20:18:57 +0800 Subject: [PATCH] 获取验证码功能 --- pages/index/index.vue | 458 +++++++++++++++++++++++++++++++++++--------------------- 1 files changed, 286 insertions(+), 172 deletions(-) diff --git a/pages/index/index.vue b/pages/index/index.vue index 35a2c05..17f8bf5 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -1,51 +1,57 @@ <template> - <view> - <img src="/static/head.png" class="head" alt="" /> - <view class="hqzc"> - <img src="/static/hqzc.png" class="img" alt="" /> - <view class="line"></view> - <view class="font"> - <p>娴峰叧鎬荤讲璐告槗鎸佺画鍙戝睍2024骞寸珛娉�...</p> - <p>鍥藉鍖荤枟淇濋殰灞�鍔炲叕瀹ゅ叧浜庡彂甯冪鐞�... </p> - </view> - <img src="/static/i06.png" class="more" alt="" /> - </view> - <view class="btnbox"> - <img src="/static/i01.png" class="more" alt="" style="margin-right: 18rpx;" /> - <img src="/static/i02.png" class="more" alt="" /> - <img src="/static/i03.png" class="more" alt="" style="margin-right: 18rpx;" /> - <img src="/static/i04.png" class="more" alt="" /> - <!-- <u-button @click="goMyCompany('01')">鎴戞槸鎵ф硶浜哄憳</u-button> + <view> + <image src="/static/head.png" class="head" alt="" /> + <view class="hqzc" @click="more1()"> + <image src="/static/hqzc.png" class="img" alt="" /> + <view class="line"></view> + <view class="font"> + <p v-for="(item,index) in list1" :key="index" class="u-line-1">{{item.docTitle}}</p> + <!-- <p>娴峰叧鎬荤讲璐告槗鎸佺画鍙戝睍2024骞寸珛娉�...</p> + <p>鍥藉鍖荤枟淇濋殰灞�鍔炲叕瀹ゅ叧浜庡彂甯冪鐞�... </p> --> + </view> + <img src="/static/i06.png" class="more" alt="" style="width: 46rpx;height: 46rpx;" /> + </view> + <view class="btnbox"> + <image mode="widthFix" src="/static/i01.png" class="more" alt="" style="margin-right: 18rpx;" + @click="goMyCompany('01')" /> + <image mode="widthFix" src="/static/i02.png" class="more" alt="" @click="goMyCompany('02')" /> + <image mode="widthFix" src="/static/i03.png" class="more" alt="" style="margin-right: 18rpx;" + @click="goMyCompany('01')" /> + <image mode="widthFix" src="/static/i04.png" class="more" alt="" @click="goMyCompany('00')" /> + <!-- <u-button @click="goMyCompany('01')">鎴戞槸鎵ф硶浜哄憳</u-button> <u-button @click="goMyCompany('02')">鎴戞槸浼佷笟</u-button> <u-button @click="goMyCompany('00')">杩愯惀绠$悊</u-button> --> - </view> - <view class="msgbox"> - <view class="tit"> - <view class="t"> - 淇℃伅鍏ず - </view> - <view class="m"> - 鏌ユ洿澶�> - </view> - </view> - <view class="item"> - <img src="/static/i05.png" class="img" alt="" /> - <view class="right"> - <view class="name"> - 鍖椾含灏氱瓥浜掑姩绉戞妧鏈夐檺鍏徃 - </view> - <view class="box"> - <view class="l"> - <p>鎵ф硶鍗曚綅锛氬啘涓氬啘鏉戝眬</p> - <p>鎵ф硶鏃堕棿锛�2024-06-03 12:30:67</p> - </view> - <view class="r"> - 鍘绘煡鐪� - </view> - </view> - </view> - </view> - <view class="item"> + </view> + <view class="login-news" @click="goLogin"> + <image src="/static/index-1.png" mode="widthFix"></image> + </view> + <view class="msgbox"> + <view class="tit"> + <view class="t"> + 淇℃伅鍏ず + </view> + <view class="m" @click="more2()"> + 鏌ユ洿澶�> + </view> + </view> + <view class="item" v-for="(item,index) in list2"> + <image src="/static/i05.png" class="img" alt="" /> + <view class="right"> + <view class="name"> + {{item.companyName}} + </view> + <view class="box"> + <view class="l"> + <p>鎵ф硶鍗曚綅锛歿{item.executeDeptName}}</p> + <p>鎵ф硶鏃堕棿锛歿{item.executeTime}}</p> + </view> + <view class="r" @click="kankna(item.orderId)"> + 鍘绘煡鐪� + </view> + </view> + </view> + </view> + <!-- <view class="item"> <img src="/static/i05.png" class="img" alt="" /> <view class="right"> <view class="name"> @@ -112,140 +118,248 @@ </view> </view> </view> - </view> - </view> - <view style="height: 30rpx;"></view> - </view> + </view> --> + </view> + <view style="height: 30rpx;"></view> + </view> </template> <script> - // 00钀ュ晢鍔�,01鎵ф硶,02浼佷笟 鍖哄垎涓嶅悓鐨勭櫥闄嗛〉闈� - export default { - onLoad() { - }, - methods: { - goMyCompany(item) { - uni.navigateTo({ - url: `/pages/companyLogin/companyLogin?code=${item}` - }) - } - } - }; + import { + docList, + showList + } from '@/api/index.js' + + // 00钀ュ晢鍔�,01鎵ф硶,02浼佷笟 鍖哄垎涓嶅悓鐨勭櫥闄嗛〉闈� + export default { + onLoad() { + + }, + onShow() { + this.getInfo() + const value = uni.getStorageSync("userInfo") + const sessionToken = uni.getStorageSync('sessionToken') + if (sessionToken && value && value.userType) { + const qiyeData = uni.getStorageSync('qiyedata') + if (value.userType == '02') { + uni.reLaunch({ + url: `/qiye/qiyeIndex/qiyeIndex?id=${qiyeData.deptId}` + }) + } else if (value.userType == '01') { + uni.reLaunch({ + url: `/policy/policyIndex/policyIndex` + }) + } else { + uni.reLaunch({ + url: `/policy/policyIndex/policyIndex` + }) + } + } + }, + data() { + return { + list1: [], + list2: [], + } + }, + methods: { + kankna(id) { + uni.navigateTo({ + url: `/pages/message/details?id=${id}` + }) + }, + more1() { + uni.navigateTo({ + url: `/pages/hqzc/list` + }) + }, + more2() { + uni.navigateTo({ + url: `/pages/message/list` + }) + }, + getInfo() { + docList({ + pageNum: 1, + pageSize: 2 + }).then(val => { + let data = val.data.rows + for (let i = 0; i < data.length; i++) { + if (data[i].docTitle.length > 17) { + data[i].docTitle = data[i].docTitle.slice(0, 17) + '...' + } + } + this.list1 = data + }) + showList({ + pageNum: 1, + pageSize: 10 + }).then(val => { + //console.log(val.data.rows) + this.list2 = val.data.rows + }) + }, + goMyCompany(item) { + uni.navigateTo({ + url: `/pages/companyLogin/companyLogin?code=${item}` + }) + }, + goLogin() { + uni.scanCode({ + success: (val) => { + uni.navigateTo({ + url: `/pages/visitiorRegis/visitiorRegis?value=${val.result}` + }) + } + }) + } + } + }; </script> <style> - page{ - background: #F7F7F7; - } + page { + background: #F7F7F7; + } </style> <style lang="scss" scoped> + .hqzc { + position: absolute; + border-radius: 5px; + background: #fff; + display: flex; + width: calc(100vw - 64rpx); + align-items: center; + left: 32rpx; + top: 500rpx; + padding: 24rpx; + box-sizing: border-box; - .hqzc{ - position: absolute; - border-radius: 5px; - background: #fff; - display: flex; - width: calc(100vw - 64rpx); - align-items: center; - left: 32rpx; - top: 500rpx; - padding: 24rpx; - box-sizing: border-box; - .line{ - width: 2rpx; - height: 50rpx; - background: #f1f1f1; - margin-right: 18rpx; - } - .img{ - width: 76rpx; - height: 76rpx; - margin-right: 18rpx; - } - .more{ - width: 28rpx; - height: 28rpx; - } - .font{ - font-size: 26rpx; - color: #4A4E60; - margin-right: 50rpx; - - } - } - .btnbox{ - margin-top: 110rpx; - margin-left: 32rpx; - margin-right: 32rpx; - img{ - width: 334rpx; - height: 208rpx; - } - } - .msgbox{ - background: #fff; - border-radius: 5px; - padding: 24rpx; - box-sizing: border-box; - margin: 20rpx 32rpx; - .tit{ - display: flex; - justify-content: space-between; - .t{ - color: #202d44; - font-size: 36rpx; - font-weight: bolder; - } - .m{ - color: #7e8596; - font-size: 24rpx; - } - } - .item{ - display: flex; - margin-top: 26rpx; - border-bottom: 1px solid #F1F1F1; - padding-bottom: 26rpx; - .img{ - width: 56rpx; - height: 56rpx; - } - .right{ - width: 90%; - .name{ - color: #202d44; - font-size: 32rpx; - line-height: 44rpx; - margin-bottom: 24rpx; - } - .box{ - display: flex; - justify-content: space-between; - .l{ - font-size: 26rpx; - color: #7e8593; - } - .r{ - width: 132rpx; - height: 64rpx; - line-height: 64rpx; - border-radius: 5px; - border: 1px solid #ABD2FF; - background: #F0F8FF; - color: #1171e0; - text-align: center; - font-size: 30rpx; - } - } - } - } - .item:last-child{ - border: none; - padding-bottom: 0; - } + .line { + width: 2rpx; + height: 50rpx; + background: #f1f1f1; + margin-right: 18rpx; + } - } - .head{ - width: 100%; - height: 518rpx; - } + .img { + width: 76rpx; + height: 76rpx; + margin-right: 18rpx; + } + + .more { + width: 28rpx; + height: 28rpx; + } + + .font { + font-size: 26rpx; + color: #4A4E60; + margin-right: 50rpx; + width: 450rpx; + // text-align: center; + text-align: left; + } + } + + .btnbox { + margin-top: 110rpx; + margin-left: 32rpx; + margin-right: 32rpx; + + image { + width: 334rpx; + height: 208rpx; + } + } + + .msgbox { + background: #fff; + border-radius: 5px; + padding: 24rpx; + box-sizing: border-box; + margin: 20rpx 32rpx; + + .tit { + display: flex; + justify-content: space-between; + + .t { + color: #202d44; + font-size: 36rpx; + font-weight: bolder; + } + + .m { + color: #7e8596; + font-size: 24rpx; + } + } + + .item { + display: flex; + margin-top: 26rpx; + border-bottom: 1px solid #F1F1F1; + padding-bottom: 26rpx; + + .img { + width: 56rpx; + height: 56rpx; + } + + .right { + width: 90%; + + .name { + color: #202d44; + font-size: 32rpx; + line-height: 44rpx; + margin-bottom: 24rpx; + } + + .box { + display: flex; + justify-content: space-between; + + .l { + font-size: 26rpx; + color: #7e8593; + max-width: 80%; + + } + + .r { + width: 132rpx; + height: 64rpx; + line-height: 64rpx; + border-radius: 5px; + border: 1px solid #ABD2FF; + background: #F0F8FF; + color: #1171e0; + text-align: center; + font-size: 30rpx; + } + } + } + } + + .item:last-child { + border: none; + padding-bottom: 0; + } + + } + + .head { + width: 100%; + height: 518rpx; + } + + .login-news { + margin: 20rpx 32rpx; + + image { + width: 100%; + } + } </style> \ No newline at end of file -- Gitblit v1.9.1