expressgy 1 year ago
parent 7b09db551d
commit 903b5297b4
  1. 41
      src/pages/About/index.jsx
  2. 47
      src/pages/About/index.module.scss
  3. 3
      src/pages/Compontents/NewsAndVideo.jsx
  4. 6
      src/pages/Compontents/NewsAndVideo.module.scss
  5. 306
      src/pages/Home/index.jsx
  6. 174
      src/pages/Home/index.module.scss
  7. 1
      src/pages/Home/photo.svg
  8. 1
      src/pages/Home/video.svg
  9. 119
      src/pages/News/index.jsx
  10. 195
      src/pages/News/index.module.scss
  11. 1
      src/pages/Video/index.jsx
  12. 0
      src/pages/Video/index.module.scss
  13. 22
      src/pages/index.jsx
  14. 38
      src/pages/index.module.scss
  15. 33
      src/request/index.js
  16. 2
      src/routes/index.jsx
  17. 24
      vite.config.js

@ -1,3 +1,42 @@
import css from './index.module.scss'
import { Swiper, SwiperSlide } from 'swiper/react';
// Import Swiper styles
import 'swiper/css';
import 'swiper/css/navigation';
import 'swiper/css/pagination';
// import required modules
import { Navigation, Pagination, Mousewheel, Keyboard } from 'swiper/modules';
const yaoa5 = 'https://omo-oss-image.thefastimg.com/portal-saas/new2022122617044678164/cms/image/855d519c-6d36-4de0-b9e1-72d90eee90a6.jpg_1920xaf.jpg'
const loginImg = 'https://omo-oss-image.thefastimg.com/portal-saas/new2022122617044678164/cms/image/42f7910a-9205-4429-b89b-27d426bbe979.jpg'
export default function About(){
return <div>About</div>
return <div className={css.about}>
<Swiper
cssMode={true}
navigation={true}
pagination={true}
mousewheel={true}
keyboard={true}
modules={[Navigation, Pagination, Mousewheel, Keyboard]}
className="mySwiper">
<SwiperSlide className={css.SwiperContent}><div style={{backgroundImage:`url(${yaoa5})`}}></div></SwiperSlide>
<SwiperSlide className={css.SwiperContent}><div style={{backgroundImage:`url(${loginImg})`}}></div></SwiperSlide>
</Swiper>
<div className={css.main}>
<header><h2>公司简介</h2></header>
<div>
<h3>延安嘉盛石油机械有限责任公司</h3>
<p className={css.img}>
<img src="https://omo-oss-image.thefastimg.com/portal-saas/new2022122617044678164/cms/image/adcf2621-8487-4080-b5ca-53a20d698f58.jpg" alt=""/>
</p>
<p>延安嘉盛石油机械有限责任公司是西北地区一家大型的现代化石油管材加工企业公司经过30余年的发展现占地102亩总投资3.3亿元员工346人具有年生产石油油管套管30万吨抽油杆500万米产能力是西北地区大型的石油机械制造企业公司地处革命圣地陕西省延安市毗邻延安市飞机场和火车北站并且处于陕北石油资源的区域交通便利公司按照现代企业制度建立的集设计开发生产销售服务一体化的生产经营和管理体系下设6个职能部门和4个生产车间</p>
<p>公司油套管车间的六条油管套管生产线和一条管接箍生产线均采用数控车床进行作业各辅助作业岗位也同时实现了电脑自动化控制实行流水线作业在线检测严格按照API规范组织生产产品涵盖60.32mm339.72 mm等多种规格各种壁厚的石油油管套管产品具有加工精度高等特点</p>
<p>抽油杆车间采用抽油杆平锻机抽油杆数控车床隧道式抽油杆抛丸机抽油杆淬火炉抽油杆回火炉等设备具有生产ф16ф25等多规格抽油杆的能力</p>
<p>公司拥有检测设备120余台和70多名经验丰富的检验人员并且建立了完善的质量体系产品化学成分分析力学性能试验螺纹检验静水压试验无损探伤等检验项目均严格质量管理体系及API标准进行分级控制层层把关从而保障产品的质量</p>
<p>公司在日常经营中以诚信经营为企业根本经过不懈的努力公司产品于2007年初在陕北地区率先获得了美国石油学会API认证公司同时获得质量ISO9001:2008环境ISO14001:2004职业健康安全GB/T280012001三体系管理认证抽油杆产品获得国家质检总局颁发的生产许可证公司还是中国石油天然气集团公司能源一号网的会员单位长庆油田川庆钻探工程公司中石油煤层气合格的材料供应商同时公司还获得了各级政府部门授予的多种荣誉和称号公司被认定为2014年度陕西省高新技术企业陕西省民营科技企业油套管产品连续多年被陕西省政府评为陕西省名牌产品2011年被陕西省国税局地税局联合授予A级纳税人称号2010嘉盛商标被陕西省工商局评为陕西省商标2009年度陕西省银行业协会信贷诚信企业2009年度延安市安全生产先进单位2008年度延安市优秀民营企业2008年度延安市优秀加工型企业和纳税大户等这些资格资质荣誉称号的获得和健全完善为企业的市场开拓和进一步发展奠定了坚实的基础</p>
<p>公司长期坚持服务型市场化的导向和原则内重质量外塑形象不断健全服务机构完善服务网络加强产品的售前售中和售后服务提升服务水平努力从传统的制造型企业向现代的服务型企业转变产品主要销往延长油田长庆油田中石油煤层气苏里格油田还远销出口到吉尔吉斯斯坦哈萨克斯坦等国家和地区产品在以上油田长期使用且未出现过质量事故以产品的质量完善的服务和良好的信誉获得用户的长期信赖和一致好评</p>
<p>创新是企业发展的动力为了更好地开发新产品服务于油田公司充分发挥自身技术潜力并和国内外高校公司和研究机构广泛的开展技术交流与合作不断研究设计开发适合深井高深井高温高压油井的产品当前公司和国内的研究机构合作开发的套管扣项目在技术上取得突破性进展产品已通过了石油管材权威机构的鉴定和评价并且于2011年开始在陕西延长石油集团油气勘探公司气井中使用至今已经批量使用3500余吨凭借精密的加工和严苛的检测特殊扣套管井下服役情况良好该项目从设计上综合性的考虑了当前国内外特殊扣的优缺点和产品的使用环境结合多年的研究资料和产品使用情况加工效率较高工况条件适应性好产品具有良好的抗拉伸弯曲等复合载荷能力和优良的气密封性能可广泛应用于深井高深井和高温高压井等油田和气田生产环境该产品属于高技术含量高附加值的高新技术产品能有效解决API规范产品设计的缺欠和不足综合性的为油田公司提供规格齐全适合需求的特色的API规范产品和非API规范产品</p>
<p>公司通过持续改进锐意创新不断提升管理水平提高产品质量和服务水平坚持走专业化的精品加工之路努力将延安嘉盛石油机械有限责任公司建设成西北乃至全国的石油管材和器械精品加工基地</p>
</div>
</div>
</div>
}

@ -0,0 +1,47 @@
.about{
.SwiperContent{
position: relative;
height: 300px;
//min-width: 1000px;
//width: 100%;
overflow: hidden;
display: flex;
align-items: center;
justify-content: center;
& > img{
height: 100%;
}
& > div{
position: relative;
height: 100%;
width: 100%;
background-repeat:no-repeat;
background-size:cover;
background-position:center;
}
}
position: relative;
color: #333333;
& > div.main{
position: relative;
max-width: 1200px;
min-width: 1000px;
margin: 0 auto;
& > header{
position: relative;
text-align: center;
}
& > div{
position: relative;
& > p.img{
float: right;
text-indent: 1em;
}
& > p{
font-size: 14px;
line-height: 1.8em;
text-indent: 2em;
}
}
}
}

@ -0,0 +1,3 @@
export default function NewsAndVideo(){
return <div></div>
}

@ -0,0 +1,6 @@
.NewsAndVideo{
position: relative;
max-width: 1200px;
min-width: 1000px;
margin: 0 auto;
}

@ -1,4 +1,6 @@
import css from './index.module.scss';
import {useState, useEffect} from "react";
import {useNavigate} from 'react-router-dom'
import { Swiper, SwiperSlide } from 'swiper/react';
// Import Swiper styles
import 'swiper/css';
@ -9,7 +11,8 @@ import { Navigation, Pagination, Mousewheel, Keyboard } from 'swiper/modules';
import loginImg from './loginImg.jpg'
import yaoa5 from './yaoa5.jpg'
import photoImg from './photo.svg'
import videoImg from './video.svg'
const swiperBG1 = `https://omo-oss-image.thefastimg.com/portal-saas/new2022122617044678164/cms/image/29543145-3d23-4c1d-b020-e0b6b9f60629.jpg`
const swiperBG2 = `https://omo-oss-image.thefastimg.com/portal-saas/new2022122617044678164/cms/image/8b13bf9a-dfdf-4c86-bc6e-f42807b56f1a.jpg`
@ -18,7 +21,71 @@ const powerBG1 = `https://omo-oss-image.thefastimg.com/portal-saas/new2022122617
const powerBG2 = `https://omo-oss-image.thefastimg.com/portal-saas/new2022122617044678164/cms/image/dfb076ec-6cae-49c4-8344-a80fd1ea2622.jpg_560xaf.jpg`
const powerBG3 = `https://omo-oss-image.thefastimg.com/portal-saas/new2022122617044678164/cms/image/c07119f0-c300-4532-bc4e-09be93421edb.jpg_560xaf.jpg`
import {getNews, getVideo} from "../../request/index.js";
export default function App(){
const [newsList, setNewsList] = useState([]);
const [videoList, setVideoList] = useState([]);
const navigate = useNavigate()
useEffect(() => {
async function getData(){
const newsListResd = await getNews({
pageNum: 1,
pageSize: 3,
status: 0,
order:0
})
const videoListResd = await getVideo({
pageNum: 1,
pageSize: 3,
status: 0,
order:0
})
let news = newsListResd?.data?.rows;
let video = videoListResd?.data?.rows;
if(news){
while (news.length != 3){
news.push({
safe:true,
articleId: new Date().getTime().toString()
})
}
}else{
news = []
while (news.length != 3){
news.push({
safe:true,
articleId: new Date().getTime().toString()
})
}
}
if(video){
while (video.length != 3){
video.push({
safe:true,
videoId: new Date().getTime().toString()
})
}
}else{
video = []
while (video.length != 3){
video.push({
safe:true,
videoId: new Date().getTime().toString()
})
}
}
console.log(news)
console.log(video)
setNewsList(news)
setVideoList(video)
}
getData()
},[0])
return <>
<div className={css.home}>
@ -116,192 +183,113 @@ export default function App(){
<div>
<div className={css.powerBox}>
<div>
<div>
<div className={css.powerImg}>
<img src={powerBG1} alt=""/>
</div>
<div></div>
<div></div>
<div className={css.powerText}>
<div className={css.powerHeader}>
<div>
<div>01</div><div>产品供应</div>
</div>
</div>
<div className={css.powerBody}>
延安嘉盛是中国石油天然气集团公司一级供应商并且是一家进入中石油能源一 号网的民营企业合格供应商产品主要销往中石油下属的长庆油田新疆油田川庆钻探 公司延安石油天然气公司中石油煤层气公司苏里格油田也是延长集团主要供应 同时还远销到吉尔吉斯斯坦哈萨克斯坦等国家和地区
</div>
</div>
</div>
</div>
<div className={css.powerBox}>
<div>
<div>
<div className={css.powerImg}>
<img src={powerBG2} alt=""/>
</div>
<div></div>
<div></div>
<div className={css.powerText}>
<div className={css.powerHeader}>
<div>
<div>02</div><div>产品质量</div>
</div>
</div>
<div className={css.powerBody}>延安嘉盛是西北地区一家生产气密封螺纹的民营企业我公司现有特殊螺纹油套 管6类已获专利5项其中XGC1特殊扣螺纹套管XGT1特殊扣螺纹油管TC-50 XGL经济型特殊扣螺纹套管JST4特殊扣油管各系列产品质量性能可靠市场占 有率高</div>
</div>
</div>
</div>
<div className={css.powerBox}>
<div>
<div>
<div className={css.powerImg}>
<img src={powerBG3} alt=""/>
</div>
<div></div>
<div></div>
<div className={css.powerText}>
<div className={css.powerHeader}>
<div>
<div>03</div><div>技术研究</div>
</div>
</div>
<div className={css.powerBody}>延安嘉盛已建立西北地区首个石油行业院士工作站公司于2019年5月与工程院院士 李鹤林合作成立了延安嘉盛院士工作站并与李鹤林院士所在的中国石油集团石油管 工程技术研究院建立了长期战略合作关系共同开展油田油气井管柱研究;围绕石油行 业发展急需解决的超深井高温高压井况的材料选型等重大关键难题开展技术攻关科技 成果转化和产业化发展</div>
</div>
</div>
</div>
</div>
</>
}
//
console.log(1)
function a(){
console.log(2)
</div>
</div>
<div className={css.newsAndVideo}>
<div>
<header>
<div>新闻中心</div>
</header>
<div>
{
newsList.map(item => {
return <div key={item.articleId} className={css.newsBox} onClick={() => navigate('news')}>
{
item.safe ? <div className={css.safe}>
<div>
<div><img src={photoImg} alt=""/></div>
<div>暂无数据</div>
</div>
</div> : <div className={css.newsBBB}>
<div style={{backgroundImage:`url("${item.fileUrl}")`}}></div>
<div>{item.articleName}</div>
<div>{item.releaseTime.toString().split(' ')[0]}</div>
</div>
}
(function autoRun(){
return console.log(3)
})()
setTimeout(() => {
console.log(4)
})
function b(){
return new Promise((resolve, reject) =>{
console.log(5)
new Promise((res) => {
console.log(6)
res(7)
})
resolve(8)
setTimeout(() => {
reject(9)
})
</div>
})
}
a()
b().then(
res => {
console.log(res)
},
e => {
console.log(e)
}
)
// this
class A{
constructor() {
this.name = 'haha'
}
one(){
return () => {
console.log(this.name)
}
}
two(){
return function (){
console.log(this?.name)
}
}
}
const aClass = new A()
const one = aClass.one()
const two = aClass.two()
one()
two()
// two.call(aClass)
//
// name
//
let num1 = 99, num2 = 98;
const str1 = 'World', str2 = 'Hello';
[num1, num2] = [num2, num1];
// [str1, str2] = [str2, str1];
console.log(num1, num2);
console.log(str1, str2);
//
const list1 = [1,2,3,4,5];
const list2 = [6,7,8,9,10];
let list = [];
// list1list2
// 1 list = [...list, ...list2]
// 2 list = list1.concat(list2)
// list
// list.sort((x,y)=> x - y)
//
let arrNum = [1,1,3,4,4,9,1,4,6,8]
// console.log(Array.from(new Set(arrNum)));
//
function autoRun(){
let name = 'Nier'
let people = {
age: 24,
sex: 1,
birthday: `991332`
}
function makeNewPeople(name, people){
people.name = name
name = 'Anto'
console.log(name, people)
}
console.log(name, people)
makeNewPeople(name, people)
console.log(name, people)
}
autoRun()
//
function autoRun2(){
const CP1 = {
cpu: 'i9 13900k',
mem: '32GB 7600MHz DDR5',
videoCard: 'RTX 4090'
}
const CP2 = {
cpu: 'i5 8250U',
mem: '8GB 3200MHz DDR4',
videoCard: 'GTX 1050 MaxQ'
</div>
</div>
</div>
<div className={css.newsAndVideo} style={{backgroundColor:'#f7f7f7'}}>
<div>
<header>
<div>视频中心</div>
</header>
<div>
{
videoList.map(item => {
return <div key={item.videoId} className={css.newsBox} style={{backgroundColor:'#fff'}} onClick={() => navigate('video')}>
{
item.safe ? <div className={css.safe}>
<div>
<div><img src={videoImg} alt=""/></div>
<div>暂无数据</div>
</div>
</div> : <div className={css.newsBBB}>
<div style={{'backgroundImage': 'url("'+item.coverUrl+'")'}}></div>
<div>{item.videoTittle}</div>
<div>{item.releaseTime.toString().split(' ')[0]}</div>
</div>
}
// CP1CP2
// const CP = {...CP1, ...CP2}
const CPList = [CP1, CP2]
// CP1CPList
</div>
})
}
//
function autoRun3(){
const resd = [
{ id: 32, name: 'a', fatherId: 0 },
{ id: 16, name:'b', fatherId: 32 },
{ id: 8, name: 'c', fatherId: 4 },
{ id: 7, name: 'c', fatherId: 8 },
{ id: 6, name: 'c', fatherId: 4 },
{ id: 5, name: 'c', fatherId: 4 },
{ id: 4, name: 'c', fatherId: 1 },
{ id: 3, name: 'c', fatherId: 16 },
{ id: 2, name: 'c', fatherId: 5 },
{ id: 1, name: 'c', fatherId: 0 }
]
</div>
</div>
</div>
</div>
</>
}
// resd
// sessionStoragelocalStorageAB sessionStorage
function autoRun5(){
window.location.href = "http://www.baidu.com";
window.history.go(-1);
window.open('page.html');
this.$router.push('/goods/add')
// <router-link to="/goods/add"></router-link>
this.$router.replace({path:'/goods/add'});
this.$router.go(-1)
}

@ -135,6 +135,8 @@
.power{
position: relative;
background-color: #f7f7f7;
margin: 40px 0;
& > div{
position: relative;
max-width: 1200px;
@ -147,7 +149,7 @@
padding: 30px 0;
& > div{
position: relative;
line-height: normal;
line-height: 60px;
font_radio: 2;
display-radio: 1;
font-size: 28px;
@ -160,17 +162,187 @@
position: relative;
display: flex;
height: 450px;
overflow: hidden;
& > div{
position: relative;
margin: 0 10px;
cursor: pointer;
flex:1;
}
& > div:nth-child(1){
margin-left: 0;
}
& > div:nth-child(3){
margin-right: 0;
}
& > div.powerBox{
&:hover div.powerText{
height: 350px;
background: #187bc3;
color: #fefefe;
& > div.powerHeader{
margin-top: 50px;
height: 120px;
}
}
& > div{
position: relative;
height: 100%;
& > div.powerImg{
position: relative;
height: 300px;
overflow: hidden;
& > img {
width: 100%;
}
}
& > div.powerText{
position: absolute;
height: 150px;
width: 100%;
bottom: 0;
background-color: #fefefe;
transition: all cubic-bezier(0.25,0.1,0.25,1) 500ms;
& > div.powerHeader{
height: 150px;
margin-top: 0px;
position: relative;
display: flex;
align-items: center;
justify-content: center;
transition: margin-top cubic-bezier(0.25,0.1,0.25,1) 500ms;
& > div{
& > div{
font-weight: bold;
text-align: center;
}
& > div:nth-child(1){
font-size: 24px;
line-height: 48px;
}
& > div:nth-child(2){
font-size: 18px;
line-height: 36px;
}
}
}
& > div.powerBody{
position: relative;
text-indent: 2em;
width: 300px;
height: 150px;
margin: 0 auto;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
font-size: 14px;
}
}
}
}
}
}
}
.newsAndVideo{
position: relative;
background-color: #fff;
padding: 40px 0;
& > div{
position: relative;
max-width: 1200px;
margin: 0 auto;
& > header{
position: relative;
display: flex;
align-items: center;
justify-content: center;
padding: 30px 0;
& > div{
position: relative;
line-height: 60px;
font_radio: 2;
display-radio: 1;
font-size: 28px;
letter-spacing: 5px;
font-family: Microsoft YaHei;
color: #333;
}
}
& > div{
position: relative;
display: flex;
height: 300px;
//overflow: hidden;
& > div:nth-child(1){
margin-left: 0;
}
& > div:nth-child(3){
margin-right: 0;
}
&>div.newsBox{
position: relative;
margin: 0 10px;
cursor: pointer;
display: flex;
width: 300px;
flex-direction: column;
flex: 1;
background-color: #f7f7f7;
padding: 5px;
//box-shadow: 2px 2px 10px 0 #33333311;
& > div.safe{
position: relative;
display: flex;
align-items: center;
justify-content: center;
height: 100%;
text-align: center;
color: #666;
& > div{
position: relative;
height: 200px;
}
img{
height: 160px;
}
}
& > div.newsBBB{
position: relative;
display: flex;
flex-direction: column;
height: 100%;
&:hover div:nth-child(1){
transform: scale(1.02);
box-shadow: 0px 23px 20px -20px #33333399;
}
& > div:nth-child(1){
position: relative;
flex: 1;
background-repeat:no-repeat;
background-size:cover;
background-position:center;
transition: all ease-in-out 200ms;
& > img{
width: 100%;
}
}
& > div:nth-child(2){
position: relative;
flex-shrink: 0;
height: 28px;
margin: 10px 0;
line-height: 28px;
}
& > div:nth-child(3){
position: relative;
flex-shrink: 0;
font-size: 14px;
color: #666;
margin-bottom: 5px;
}
}
}
}
}
}

@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1691812737494" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6953" xmlns:xlink="http://www.w3.org/1999/xlink" width="1024" height="1024"><path d="M790.754133 93.866667C867.733333 93.866667 930.133333 156.266667 930.133333 233.245867v557.508266C930.133333 867.733333 867.733333 930.133333 790.754133 930.133333H233.245867C156.266667 930.133333 93.866667 867.733333 93.866667 790.754133V233.245867C93.866667 156.266667 156.266667 93.866667 233.245867 93.866667h557.508266zM247.125333 861.866667h581.998934a34.133333 34.133333 0 0 0 29.751466-50.858667l-107.208533-190.685867c-13.44-23.906133-43.332267-32.977067-67.7888-20.5696l-130.850133 66.372267a17.066667 17.066667 0 0 1-23.2064-8.042667l-93.405867-201.506133c-11.8912-25.655467-42.3296-36.8128-67.985067-24.917333a51.2 51.2 0 0 0-19.1488 15.36l-176.622933 231.112533A51.2 51.2 0 0 0 162.133333 709.218133v67.6608C162.133333 823.816533 200.183467 861.866667 247.121067 861.866667zM665.6 311.466667c0 25.92 21.013333 46.933333 46.933333 46.933333s46.933333-21.013333 46.933334-46.933333-21.013333-46.933333-46.933334-46.933334-46.933333 21.013333-46.933333 46.933334z" fill="#E0E0E0" p-id="6954"></path></svg>

After

Width:  |  Height:  |  Size: 1.3 KiB

@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1691812775333" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1368" xmlns:xlink="http://www.w3.org/1999/xlink" width="1024" height="1024"><path d="M783.108267 300.6464c0-69.44-56.635733-125.713067-126.506667-125.713067H169.1776C99.306667 174.933333 42.666667 231.2064 42.666667 300.6464v422.698667C42.666667 792.785067 99.306667 849.066667 169.173333 849.066667h487.428267c69.870933 0 126.506667-56.290133 126.506667-125.717334a14.0544 14.0544 0 0 1 18.0736-13.469866l106.7648 31.816533c27.0976 8.0768 55.616-7.342933 63.6928-34.4448a51.2 51.2 0 0 0 2.133333-14.621867V329.3696c0-28.2752-22.9248-51.2-51.2-51.2a51.2 51.2 0 0 0-14.626133 2.133333l-108.680534 32.388267a12.565333 12.565333 0 0 1-16.157866-12.0448zM311.466667 623.761067v-219.264c0-28.279467 22.9248-51.2 51.2-51.2a51.2 51.2 0 0 1 27.392 7.940266l173.1072 109.623467c23.893333 15.1296 30.993067 46.762667 15.863466 70.651733a51.2 51.2 0 0 1-15.8592 15.8592l-173.1072 109.6448c-23.889067 15.133867-55.517867 8.034133-70.651733-15.854933A51.2 51.2 0 0 1 311.466667 623.765333z" fill="#E0E0E0" p-id="1369"></path></svg>

After

Width:  |  Height:  |  Size: 1.2 KiB

@ -1,3 +1,120 @@
import {useState, useEffect} from "react";
import css from './index.module.scss'
import { Swiper, SwiperSlide } from 'swiper/react';
// Import Swiper styles
import 'swiper/css';
import 'swiper/css/navigation';
import 'swiper/css/pagination';
// import required modules
import { Navigation, Pagination, Mousewheel, Keyboard } from 'swiper/modules';
import {getGroupList, getNews} from "../../request/index.js";
const yaoa5 = 'https://omo-oss-image.thefastimg.com/portal-saas/new2022122617044678164/cms/image/855d519c-6d36-4de0-b9e1-72d90eee90a6.jpg_1920xaf.jpg'
const loginImg = 'https://omo-oss-image.thefastimg.com/portal-saas/new2022122617044678164/cms/image/42f7910a-9205-4429-b89b-27d426bbe979.jpg'
export default function News(){
return <div>News</div>
const [groupList, setGroupList] = useState([]);
const [newsList, setNewsList] = useState([]);
const [pageNum, setPageNum] = useState(1);
const [pageSize, setPageSize] = useState(10);
const [total, setTotal] = useState(0);
const [catState, setCatState] = useState(css.cat);
const [newsData, setNewsData] = useState(null)
useEffect(() => {
async function getGL(){
const resd = await getGroupList(0)
setGroupList(resd.data || [])
const newsListResd = await getNews({
pageNum,
pageSize,
status: 0,
order:0
})
setNewsList(newsListResd?.data?.rows)
setTotal(newsListResd?.data.total)
}
getGL()
},[pageNum])
function handleChangePage(turnSign){
turnSign === true? setPageNum(pageNum+1): '';
turnSign === false? setPageNum(pageNum-1): '';
(/^[0-9]+.?[0-9]*/).test(turnSign) ? setPageNum(turnSign):'';
}
function openCat(state, data = null){
state ? setCatState([css.cat, css.catOpen].join(' ')): setCatState(css.cat)
data && setNewsData(data)
}
return <div className={css.News}>
<Swiper
cssMode={true}
navigation={true}
pagination={true}
mousewheel={true}
keyboard={true}
modules={[Navigation, Pagination, Mousewheel, Keyboard]}
className="mySwiper">
<SwiperSlide className={css.SwiperContent}><div style={{backgroundImage:`url(${yaoa5})`}}></div></SwiperSlide>
<SwiperSlide className={css.SwiperContent}><div style={{backgroundImage:`url(${loginImg})`}}></div></SwiperSlide>
</Swiper>
<div className={css.main}>
<div className={css.menu}>
<div className={css.menuTitle}>
<img src="https://omo-oss-image.thefastimg.com/portal-saas/new2022122617044678164/cms/image/0fa2acb8-a027-4826-804a-ead578cd1ef1.jpg" alt=""/>
</div>
<div className={css.menuList}>
{
groupList.map(i => {
return <div key={i.groupId}>{i.groupName}</div>
})
}
</div>
</div>
<div className={css.body}>
<div className={css.table}>
{
newsList.map(i => {
return <div className={css.newsBox} key={i.articleId} onClick={() => {openCat(true, i)}}>
<div>{i.articleName}</div>
<div>
<div>{i.releaseTime?.toString()?.split(' ')[0].split('-')[0]}</div>
<div>{i.releaseTime?.toString()?.split(' ')[0].split('-').slice(1,3).join('-')}</div>
</div>
</div>
})
}
</div>
<footer>
<div>
<div className={pageNum == 1 ? css.unChoose : ''} onClick={() => pageNum == 1 ? () => {} :handleChangePage(false)}>上一页</div>
{
new Array(parseInt(total/pageSize) + 1).fill('').map((i,j) => {
return <div key={j} className={[css.page, pageNum == j + 1 ? css.pageChoose : ''].join(' ')} onClick={() => pageNum == j+1 ? () =>{}:handleChangePage(j+1)}>{j + 1}</div>
})
}
<div className={new Array(parseInt(total/pageSize) + 1).fill('').length == pageNum ? css.unChoose : ''} onClick={() => new Array(parseInt(total/pageSize) + 1).fill('').length == pageNum ? () => {} :handleChangePage(true)}>下一页</div>
</div>
</footer>
</div>
</div>
<div className={catState}>
<header>
<div onClick={() =>openCat(false)}>返回</div>
<div>新闻详情</div>
</header>
<div className={css.catBody}>
<div>
{
JSON.stringify(newsData)
}
</div>
</div>
</div>
</div>
}

@ -0,0 +1,195 @@
.News{
position: relative;
.SwiperContent{
position: relative;
height: 300px;
//min-width: 1000px;
//width: 100%;
overflow: hidden;
display: flex;
align-items: center;
justify-content: center;
& > img{
height: 100%;
}
& > div{
position: relative;
height: 100%;
width: 100%;
background-repeat:no-repeat;
background-size:cover;
background-position:center;
}
}
& > div.main{
position: relative;
max-width: 1200px;
min-width: 1000px;
margin: 20px auto;
display: flex;
& > div.menu{
position: relative;
flex-shrink: 0;
width: 221px;
& > div{
padding-left: 10px;
user-select: none;
}
& > div.menuTitle{
position: relative;
font-size: 18px;
line-height: 2.5em;
padding: 0;
line-height: 0;
border-bottom: 0;
}
& > div.menuList{
position: relative;
line-height: 2em;
margin: 1px 0;
transition: all ease-in-out 300ms;
&:hover{
cursor: pointer;
background-color: #e70012;
color: #fff;
}
}
}
& > div.body{
position: relative;
flex: 1;
margin-left: 10px;
overflow: hidden;
& > div.table{
position: relative;
& > div.newsBox{
position: relative;
border-bottom: 1px dashed rgba(218,218,218,1);
cursor: pointer;
display: flex;
height: 70px;
padding: 20px 30px;
transition: all cubic-bezier(0.25,0.1,0.25,1) 600ms;
left: 0;
&:hover{
background: #e7eaf4;
left: 5px;
div:last-child{
color: #173394 !important;
}
}
& > div:first-child{
position: relative;
flex: 1;
}
& > div:last-child{
position: relative;
flex-shrink: 0;
width: 80px;
color: rgba(153,153,153,1);
transition: all cubic-bezier(0.25,0.1,0.25,1) 600ms;
& > div:first-child{
min-height: 20px;
font_radio: 2;
font-size: 14px;
text-align: right;
line-height: 1;
}
& > div:last-child{
font-size: 34px;
font-family: Impact;
text-align: right;
line-height: 1.5;
}
}
}
}
& > footer{
position: relative;
display: flex;
//align-items: center;
justify-content: center;
margin-top: 20px;
& >div{
position: relative;
display: flex;
& > div{
position: relative;
margin: 0 5px;
border: 1px solid #33333333;
padding: 5px;
cursor: pointer;
border-radius: 3px;
transition: all cubic-bezier(0.25,0.1,0.25,1) 600ms;;
&:hover{
border: 1px solid #187bc3;
color: #187bc3;
}
}
&>div.page{
position: relative;
min-width: 20px;
text-align: center;
}
&>div.pageChoose{
border: 1px solid #187bc3;
background: #187bc3;
color: #fefefe;
}
& > div.unChoose{
border: 1px solid #33333333;
background: #33333311;
color: #333;
cursor: not-allowed;
}
}
}
}
}
.cat{
position: fixed;
height: 0;
width: 100%;
left: 0;
bottom: 0;
transition: height cubic-bezier(0.25,0.1,0.25,1) 600ms;;
background: #f7f7f7fc;
z-index: 999;
overflow: hidden;
display: flex;
flex-direction: column;
& > header{
position: relative;
height: 50px;
flex-shrink: 0;
border-bottom: 1px solid #99999999;
display: flex;
&>div:first-child{
position: relative;
flex-shrink: 0;
width: 100px;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
}
}
& > div.catBody{
position: relative;
flex: 1;
overflow: hidden;
&>div{
position: relative;
min-width: 1000px;
max-width: 1200px;
overflow: auto;
margin: 0 auto;
}
}
}
.catOpen{
height: 100%;
width: 100%;
}
}

@ -1,3 +1,4 @@
import css from './index.module.scss'
export default function Video(){
return <div>Video</div>
}

@ -1,7 +1,8 @@
import css from './index.module.scss'
import {Outlet} from 'react-router-dom'
import {Outlet, useNavigate} from 'react-router-dom'
import headerPng from './header.png'
export default function Index(){
const navigate = useNavigate()
return <>
<div className={css.home}>
@ -9,14 +10,25 @@ export default function Index(){
<nav>
<div><img src={headerPng} alt=""/></div>
<div>
<div>关于我们</div>
<div>新闻</div>
<div>视频</div>
<div>首页</div>
<div onClick={() => navigate('/jsview/about')}>关于我们</div>
<div onClick={() => navigate('/jsview/news')}>新闻</div>
<div onClick={() => navigate('/jsview/video')}>视频</div>
<div onClick={() => navigate('/jsview')}>首页</div>
</div>
</nav>
</header>
<Outlet/>
<footer>
<div>
<div></div>
<div>
<div>延安嘉盛石油机械有限责任公司版权所有</div>
<div><a href="https://beian.miit.gov.cn/#/Integrated/index" target="_blank">陕ICP备09012932号-1</a></div>
<div><a target="_blank" href="https://omo-oss-image.thefastimg.com/portal-saas/new2022122617044678164/cms/image/3c184dab-aac7-40b1-bbe7-1c8b858834e3.png?d=1677549326206">营业执照</a></div>
<div>网站建设西安升邦联创技术服务有限公司</div>
</div>
</div>
</footer>
</div>
</>
}

@ -27,6 +27,7 @@
position: relative;
margin: 0 20px;
cursor: pointer;
color: #333;
}
}
}
@ -34,4 +35,41 @@
& > div{
position: relative;
}
& > footer{
position: relative;
background-color: rgba(26,26,26,1);
user-select: none;
& > div{
position: relative;
max-width: 1200px;
margin: 0 auto;
& > div:nth-child(1){}
& > div:nth-child(2){
position: relative;
color: #f2f2f2b3;
line-height: 5;
font-size: 14px;
display: flex;
& > div{
&>a{
all:unset;
cursor: pointer;
}
}
& >div:nth-child(1){
flex: 5;
}
& >div:nth-child(2){
user-select: auto;
flex: 5;
}
& >div:nth-child(3){
flex: 5;
}
& >div:nth-child(4){
flex: 5;
}
}
}
}
}

@ -0,0 +1,33 @@
import axios from "axios";
const instance = axios.create({
timeout: 10000,
baseURL: "/api", // 服务器请求地址
});
instance.interceptors.response.use(
async (response) => {
const data = response.data;
if (data.status === 200 || data.code === 200) return data;
}
);
export const getNews = params => instance({
url: `/jiaSheng/civilization/article/getPage`,
method: 'get',
params
})
export const getVideo = params => instance({
url: `/jiaSheng/civilization/video/getPage`,
method: 'get',
params
})
export const getGroupList = type => instance({
url: `/jiaSheng/civilization/group/getGroupList`,
method: 'get',
params:{
groupType: type
},
})

@ -31,7 +31,7 @@ export default [
},
{
path: '/', //'<Navigate>'
element: <Navigate to="/jsview/home"/> //`<Navigate>`
element: <Navigate to="/jsview"/> //`<Navigate>`
}
// {
// path: '/home', //'/'

@ -4,4 +4,28 @@ import react from '@vitejs/plugin-react'
// https://vitejs.dev/config/
export default defineConfig({
plugins: [react()],
server: {
host: "0.0.0.0",
proxy: {
'/api': {
// target: "https://app.uair.cc/api",// 目标地址
// target: `http://10.10.10.168:8080`,// sar目标地址
target: `http://10.10.10.200/api/`,// 测试服务器址
// target: "http://10.10.10.146:9309",// Rock目标地址
// target: `http://togy.top:18080/api/`,// sar目标地址
ws: true,// 开始ws代理
changeOrigin: true, // 开发模式
rewrite: (path) => path.replace(/^\/api/, "")
},
'/statics': {
// target: "https://app.uair.cc/api",// 目标地址
target: `http://10.10.10.168:9300`,// sar目标地址
// target: `http://10.10.10.200/api/`,// 测试服务器址
// target: "http://10.10.10.146:9309",// Rock目标地址
// target: `http://togy.top:18080/api/`,// sar目标地址
ws: true,// 开始ws代理
changeOrigin: true, // 开发模式
},
}
},
})

Loading…
Cancel
Save