소스 검색

前端首页修改

huangyan 6 달 전
부모
커밋
d9e534a84a
12개의 변경된 파일200개의 추가작업 그리고 340개의 파일을 삭제
  1. 24 0
      Makefile
  2. 2 0
      controllers/dataModel.go
  3. 2 11
      controllers/index.go
  4. 1 1
      controllers/product.go
  5. 8 7
      main.go
  6. 9 7
      models/dataModel.go
  7. 2 2
      service/dataModel.go
  8. 82 1
      static/css/style.css
  9. 0 228
      views/Rich_Editor.html
  10. 0 5
      views/contact.html
  11. 48 56
      views/index.html
  12. 22 22
      views/product.html

+ 24 - 0
Makefile

@@ -0,0 +1,24 @@
+BINARY_NAME := cc-officialweb
+GOOS := linux
+GOARCH := amd64
+
+all: build
+# 运行
+run:
+	@echo "Running $(BINARY_NAME)..."
+	go run main.go
+# 编译为linux下的二进制文件
+build:
+	@echo "Cross-compiling for $(GOOS)/$(GOARCH)..."
+	go build -o $(BINARY_NAME)-$(GOOS)-$(GOARCH) -ldflags="-s -w" -tags netgo -a -installsuffix cgo -x -v -gcflags=all=-trimpath=$(GOPATH) -asmflags=all=-trimpath=$(GOPATH)
+# 安装必要的依赖
+deps:
+	@echo "Installing dependencies..."
+	go mod tidy
+	go mod download
+# 删除编译生成的文件
+clean:
+	@echo "Cleaning..."
+	del /Q $(BINARY_NAME)-*
+
+.PHONY: all build clean

+ 2 - 0
controllers/dataModel.go

@@ -96,6 +96,7 @@ func (d *DataModelController) UpdataData() {
 	data.Title = dataDto.Title
 	data.Types = dataDto.Types
 	data.Nums = dataDto.Nums
+	data.IsIndex = dataDto.IsIndex
 	id, err := unity.UpdateById(dataDto.ID, &data)
 	if err == nil {
 		d.Data["json"] = JSON{Code: 200, Msg: "更新成功", Data: id}
@@ -138,6 +139,7 @@ func (d *DataModelController) AddData() {
 	data.Nums = dataDto.Nums
 	data.Title = dataDto.Title
 	data.Types = dataDto.Types
+	data.IsIndex = dataDto.IsIndex
 	add, err := unity.Add(&data)
 	if err != nil {
 		d.Data["json"] = JSON{Code: 104, Msg: "添加失败", Data: ""}

+ 2 - 11
controllers/index.go

@@ -32,18 +32,9 @@ func (c *MainController) Get() {
 	products := service.GetIndexProductServe("product")
 	serve := service.GetIndexProductServe("serve")
 	//数据大屏展示
-	//    data, err := service.GetData()
-	data, err := service.GetDataByType("覆盖区域")
-	data2, err := service.GetDataByType("覆盖领域")
-	data3, err := service.GetDataByType("监测对象")
-	data4, err := service.GetDataByType("冷链验证")
-	data5, err := service.GetDataByType("探头校准")
-	data = append(data, data2...)
-	data = append(data, data3...)
-	data = append(data, data4...)
-	data = append(data, data5...)
+	getData, err := service.GetData(true)
 	if err == nil {
-		c.Data["Datas"] = data
+		c.Data["Datas"] = getData
 	} else {
 		c.Data["Datas"] = "未获得数据"
 	}

+ 1 - 1
controllers/product.go

@@ -25,7 +25,7 @@ func (s *ProductController) Get() {
 		success = append(success, v.Url)
 	}
 	//数据大屏展示
-	data, err := service.GetDataByType("管理效率")
+	data, err := service.GetData(false)
 	if err == nil {
 		s.Data["Datas"] = data
 	} else {

+ 8 - 7
main.go

@@ -4,16 +4,17 @@ import (
 	"cc-officialweb/middleware"
 	_ "cc-officialweb/routers"
 	beego "github.com/beego/beego/v2/server/web"
+	"github.com/beego/beego/v2/server/web/filter/cors"
 )
 
 func main() {
-	//beego.InsertFilter("*", beego.BeforeRouter, cors.Allow(&cors.Options{
-	//	AllowAllOrigins:  true,
-	//	AllowMethods:     []string{"GET", "POST", "PUT", "DELETE", "OPTIONS"},
-	//	AllowHeaders:     []string{"Origin", "Content-Type", "Authorization", "X-Requested-With"},
-	//	ExposeHeaders:    []string{"Content-Length", "Access-Control-Allow-Origin"},
-	//	AllowCredentials: true,
-	//}))
+	beego.InsertFilter("*", beego.BeforeRouter, cors.Allow(&cors.Options{
+		AllowAllOrigins:  true,
+		AllowMethods:     []string{"GET", "POST", "PUT", "DELETE", "OPTIONS"},
+		AllowHeaders:     []string{"Origin", "Content-Type", "Authorization", "X-Requested-With"},
+		ExposeHeaders:    []string{"Content-Length", "Access-Control-Allow-Origin"},
+		AllowCredentials: true,
+	}))
 	beego.InsertFilter("/api/*", beego.BeforeRouter, middleware.AuthMiddleware)
 	beego.SetStaticPath("/image", "./static/upload")
 	beego.SetStaticPath("/file", "./static/file")

+ 9 - 7
models/dataModel.go

@@ -45,15 +45,17 @@ type DataMOdel struct {
 }
 type Data struct {
 	gorm.Model
-	Title string `json:"title"`
-	Types string `json:"types"`
-	Nums  int    `json:"nums"`
+	Title   string `json:"title"`
+	Types   string `json:"types"`
+	Nums    int    `json:"nums"`
+	IsIndex bool   `json:"is_index"`
 }
 type DataDto struct {
-	ID    uint   `json:"id"`
-	Title string `json:"title"`
-	Types string `json:"types"`
-	Nums  int    `json:"nums"`
+	ID      uint   `json:"id"`
+	Title   string `json:"title"`
+	Types   string `json:"types"`
+	Nums    int    `json:"nums"`
+	IsIndex bool   `json:"is_index"`
 }
 type DataMOdelDto struct {
 	ID uint `json:"id"`

+ 2 - 2
service/dataModel.go

@@ -31,8 +31,8 @@ func GetDataByType(types string) (data []models.Data, error error) {
 }
 
 // GetData 获得所有数据
-func GetData() (data []models.Data, error error) {
-	tx := utils.DB.Find(&data)
+func GetData(isindex bool) (data []models.Data, error error) {
+	tx := utils.DB.Where("is_index=?", isindex).Find(&data)
 	if tx.RowsAffected > 0 {
 		return data, nil
 	}

+ 82 - 1
static/css/style.css

@@ -1549,4 +1549,85 @@ p.help-block li {
 #custom-unaffected-card-body {
   color: white; /* 或指定你需要的颜色,如果需要的话 */
   font-size: 16px; /* 保持或调整为你希望的字体大小 */
-}
+}
+/* 服务介绍区域整体样式 */
+.features {
+  background-color: #f9f9f9;
+}
+
+/* 服务介绍头部样式 */
+.section-header p {
+  max-width: 32rem;
+  margin: 0 auto;
+}
+
+/* 服务项目列表样式 */
+.service-description {
+  /* 可以根据需要调整间距和字体样式 */
+}
+
+.service-item h4 {
+  color: #343a40;
+}
+
+.service-item p {
+  color: #6c757d;
+}
+
+/* 背景图片容器样式 */
+.service-img {
+  max-width: 100%;
+  height: auto;
+  border-radius: 10px; /* 添加圆角使图片更加友好 */
+  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); /* 添加阴影增强立体感 */
+}
+
+/* 按钮样式 */
+.btn-primary {
+  background-color: #007bff;
+  border-color: #007bff;
+  transition: all 0.3s ease;
+}
+
+.btn-primary:hover {
+  background-color: #0056b3;
+  border-color: #0056b3;
+}
+/* 添加服务项的现代化边框样式 */
+.service-item {
+  background-color: white; /* 或者其他背景色,以确保边框清晰可见 */
+  border: 1px solid #dee2e6; /* 初始边框颜色,Bootstrap默认的浅灰色 */
+  border-radius: 8px; /* 圆角大小,可根据设计需求调整 */
+  padding: 20px; /* 内边距,让内容与边框有适当距离 */
+  transition: box-shadow 0.3s ease, border-color 0.3s ease; /* 平滑过渡效果 */
+}
+
+/* 鼠标悬停时改变边框颜色,增强交互反馈 */
+.service-item:hover {
+  border-color: #007bff; /* 或选择与网站主题相匹配的颜色 */
+  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); /* 添加轻微阴影效果 */
+}
+/* 为服务项添加Flex布局 */
+.service-item {
+  flex-wrap: wrap; /* 允许内容换行 */
+}
+
+/* 图片容器,控制图片大小和位置 */
+.service-image-container {
+  width: 30%; /* 图片占30%宽度 */
+  margin-right: 20px; /* 图片与文字间的间隔,可调整 */
+}
+
+.service-image-container img {
+  max-width: 100%; /* 图片最大宽度为其容器宽度,即30% */
+  max-height: 200px; /* 设置图片最大高度,根据需要调整 */
+  height: auto; /* 保持图片原始宽高比 */
+  object-fit: cover; /* 保持图片比例的同时填充容器,可能会裁剪 */
+  border-radius: 8px; /* 可选,为图片添加圆角 */
+}
+
+/* 文字信息容器 */
+.service-info {
+  width: calc(70% - 20px); /* 文字占70%,减去右边距以对齐底部 */
+  flex-grow: 1; /* 如果需要,允许此部分扩展以填充剩余空间 */
+}

+ 0 - 228
views/Rich_Editor.html

@@ -1,228 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-<head>
-    <meta charset="UTF-8">
-    <title>Rich Editor</title>
-</head>
-<body>
-
-<style>
-    #container {
-        width: 1000px;
-        margin: 20px auto;
-    }
-    .ck-editor__editable[role="textbox"] {
-        /* Editing area */
-        min-height: 600px;
-    }
-    .ck-content .image {
-        /* Block images */
-        max-width: 80%;
-        margin: 20px auto;
-    }
-    /* 居中编辑器标题 */
-    h2 {
-        text-align: center;
-    }
-</style>
-
-<h2>Rich Editor</h2>
-
-<div id="container">
-    <div id="editor"></div>
-</div>
-<!--
-    The "superbuild" of CKEditor&nbsp;5 served via CDN contains a large set of plugins and multiple editor types.
-    See https://ckeditor.com/docs/ckeditor5/latest/installation/getting-started/quick-start.html#running-a-full-featured-editor-from-cdn
--->
-<script src="https://cdn.ckeditor.com/ckeditor5/41.1.0/super-build/ckeditor.js"></script>
-<script>
-    ClassicEditor
-        .create(document.getElementById('editor'))
-        .then(editor => {
-            const savedData = localStorage.getItem('editorData');
-            if (savedData) {
-                editor.setData(savedData);
-            }
-
-            editor.model.document.on('change:data', () => {
-                const editorData = editor.getData();
-                localStorage.setItem('editorData', editorData);
-            });
-        })
-        .catch(error => {
-            console.error(error);
-        });
-</script>
-
-<!-- Uncomment to load the Spanish translation -->
-<!-- <script src="https://cdn.ckeditor.com/ckeditor5/41.1.0/super-build/translations/es.js"></script> -->
-
-<script>
-    // This sample still does not showcase all CKEditor&nbsp;5 features (!)
-    // Visit https://ckeditor.com/docs/ckeditor5/latest/features/index.html to browse all the features.
-    CKEDITOR.ClassicEditor.create(document.getElementById("editor"), {
-        // https://ckeditor.com/docs/ckeditor5/latest/features/toolbar/toolbar.html#extended-toolbar-configuration-format
-        toolbar: {
-            items: [
-                'exportPDF','exportWord', '|',
-                'findAndReplace', 'selectAll', '|',
-                'heading', '|',
-                'bold', 'italic', 'strikethrough', 'underline', 'code', 'subscript', 'superscript', 'removeFormat', '|',
-                'bulletedList', 'numberedList', 'todoList', '|',
-                'outdent', 'indent', '|',
-                'undo', 'redo',
-                '-',
-                'fontSize', 'fontFamily', 'fontColor', 'fontBackgroundColor', 'highlight', '|',
-                'alignment', '|',
-                'link', 'uploadImage', 'blockQuote', 'insertTable', 'mediaEmbed', 'codeBlock', 'htmlEmbed', '|',
-                'specialCharacters', 'horizontalLine', 'pageBreak', '|',
-                'textPartLanguage', '|',
-                'sourceEditing'
-            ],
-            shouldNotGroupWhenFull: true
-        },
-        // Changing the language of the interface requires loading the language file using the <script> tag.
-        // language: 'es',
-        language: {
-            textPartLanguage: [
-                { title: 'Arabic', languageCode: 'ar' },
-                { title: '中文', languageCode: 'zh' },
-                { title: 'English', languageCode: 'en' },
-                { title: 'French', languageCode: 'fr' },
-                { title: 'Hebrew', languageCode: 'he' },
-                { title: 'español', languageCode: 'es' }
-            ]
-        },
-        list: {
-            properties: {
-                styles: true,
-                startIndex: true,
-                reversed: true
-            }
-        },
-        // https://ckeditor.com/docs/ckeditor5/latest/features/headings.html#configuration
-        heading: {
-            options: [
-                { model: 'paragraph', title: 'Paragraph', class: 'ck-heading_paragraph' },
-                { model: 'heading1', view: 'h1', title: 'Heading 1', class: 'ck-heading_heading1' },
-                { model: 'heading2', view: 'h2', title: 'Heading 2', class: 'ck-heading_heading2' },
-                { model: 'heading3', view: 'h3', title: 'Heading 3', class: 'ck-heading_heading3' },
-                { model: 'heading4', view: 'h4', title: 'Heading 4', class: 'ck-heading_heading4' },
-                { model: 'heading5', view: 'h5', title: 'Heading 5', class: 'ck-heading_heading5' },
-                { model: 'heading6', view: 'h6', title: 'Heading 6', class: 'ck-heading_heading6' }
-            ]
-        },
-        // https://ckeditor.com/docs/ckeditor5/latest/features/editor-placeholder.html#using-the-editor-configuration
-        placeholder: 'Welcome to CKEditor 5!',
-        // https://ckeditor.com/docs/ckeditor5/latest/features/font.html#configuring-the-font-family-feature
-        fontFamily: {
-            options: [
-                'default',
-                'Ubuntu, Arial, sans-serif',
-                'Ubuntu Mono, Courier New, Courier, monospace',
-                'Arial, Helvetica, sans-serif',
-                'Courier New, Courier, monospace',
-                'Georgia, serif',
-                'Lucida Sans Unicode, Lucida Grande, sans-serif',
-                'Tahoma, Geneva, sans-serif',
-                'Times New Roman, Times, serif',
-                'Trebuchet MS, Helvetica, sans-serif',
-                'Verdana, Geneva, sans-serif'
-            ],
-            supportAllValues: true
-        },
-        // https://ckeditor.com/docs/ckeditor5/latest/features/font.html#configuring-the-font-size-feature
-        fontSize: {
-            options: [ 10, 12, 14, 'default', 18, 20, 22 ],
-            supportAllValues: true
-        },
-        // Be careful with the setting below. It instructs CKEditor to accept ALL HTML markup.
-        // https://ckeditor.com/docs/ckeditor5/latest/features/general-html-support.html#enabling-all-html-features
-        htmlSupport: {
-            allow: [
-                {
-                    name: /.*/,
-                    attributes: true,
-                    classes: true,
-                    styles: true
-                }
-            ]
-        },
-        // Be careful with enabling previews
-        // https://ckeditor.com/docs/ckeditor5/latest/features/html-embed.html#content-previews
-        htmlEmbed: {
-            showPreviews: true
-        },
-        // https://ckeditor.com/docs/ckeditor5/latest/features/link.html#custom-link-attributes-decorators
-        link: {
-            decorators: {
-                addTargetToExternalLinks: true,
-                defaultProtocol: 'https://',
-                toggleDownloadable: {
-                    mode: 'manual',
-                    label: 'Downloadable',
-                    attributes: {
-                        download: 'file'
-                    }
-                }
-            }
-        },
-        // https://ckeditor.com/docs/ckeditor5/latest/features/mentions.html#configuration
-        mention: {
-            feeds: [
-                {
-                    marker: '@',
-                    feed: [
-                        '@apple', '@bears', '@brownie', '@cake', '@cake', '@candy', '@canes', '@chocolate', '@cookie', '@cotton', '@cream',
-                        '@cupcake', '@danish', '@donut', '@dragée', '@fruitcake', '@gingerbread', '@gummi', '@ice', '@jelly-o',
-                        '@liquorice', '@macaroon', '@marzipan', '@oat', '@pie', '@plum', '@pudding', '@sesame', '@snaps', '@soufflé',
-                        '@sugar', '@sweet', '@topping', '@wafer'
-                    ],
-                    minimumCharacters: 1
-                }
-            ]
-        },
-        // The "superbuild" contains more premium features that require additional configuration, disable them below.
-        // Do not turn them on unless you read the documentation and know how to configure them and setup the editor.
-        removePlugins: [
-            // These two are commercial, but you can try them out without registering to a trial.
-            // 'ExportPdf',
-            // 'ExportWord',
-            'AIAssistant',
-            'CKBox',
-            'CKFinder',
-            'EasyImage',
-            // This sample uses the Base64UploadAdapter to handle image uploads as it requires no configuration.
-            // https://ckeditor.com/docs/ckeditor5/latest/features/images/image-upload/base64-upload-adapter.html
-            // Storing images as Base64 is usually a very bad idea.
-            // Replace it on production website with other solutions:
-            // https://ckeditor.com/docs/ckeditor5/latest/features/images/image-upload/image-upload.html
-            // 'Base64UploadAdapter',
-            'RealTimeCollaborativeComments',
-            'RealTimeCollaborativeTrackChanges',
-            'RealTimeCollaborativeRevisionHistory',
-            'PresenceList',
-            'Comments',
-            'TrackChanges',
-            'TrackChangesData',
-            'RevisionHistory',
-            'Pagination',
-            'WProofreader',
-            // Careful, with the Mathtype plugin CKEditor will not load when loading this sample
-            // from a local file system (file://) - load this site via HTTP server if you enable MathType.
-            'MathType',
-            // The following features are part of the Productivity Pack and require additional license.
-            'SlashCommand',
-            'Template',
-            'DocumentOutline',
-            'FormatPainter',
-            'TableOfContents',
-            'PasteFromOfficeEnhanced',
-            'CaseChange'
-        ]
-    });
-
-</script>
-</body>
-</html>

+ 0 - 5
views/contact.html

@@ -190,10 +190,6 @@ Footer
         var form = layui.form;
         // 监听表单提交事件
         form.on('submit(formSubmit)', function (data) {
-
-
-
-          // 阻止表单默认提交行为
           event.preventDefault();
           // 获取表单数据
           var name = data.field.name;
@@ -229,7 +225,6 @@ Footer
               return false; // 阻止表单再次提交
               });
               });
-
     </script>
   </body>
 </html>

+ 48 - 56
views/index.html

@@ -16,11 +16,8 @@
         <link
             href="https://fonts.googleapis.com/css?family=Open+Sans:300,300i,400,400i,700,700i|Raleway:300,400,500,700,800|Montserrat:300,400,700"
             rel="stylesheet">
-
         <!-- Bootstrap CSS File -->
         <link href="../static/lib/bootstrap/css/bootstrap.min.css" rel="stylesheet">
-
-
         <!-- Libraries CSS Files -->
         <link href="../static/lib/font-awesome/css/font-awesome.min.css" rel="stylesheet">
         <link href="../static/lib/animate/animate.min.css" rel="stylesheet">
@@ -28,16 +25,10 @@
         <link href="../static/lib/owlcarousel/assets/owl.carousel.min.css" rel="stylesheet">
         <link href="../static/lib/magnific-popup/magnific-popup.css" rel="stylesheet">
         <link href="../static/lib/ionicons/css/ionicons.min.css" rel="stylesheet">
-
         <!-- Main Stylesheet File -->
         <link href="../static/css/style.css" rel="stylesheet">
     </head>
-
     <body id="body">
-
-        <!--==========================
-Header
-        ============================-->
         <header id="header">
             <div class="container">
                 <div id="logo" class="pull-left">
@@ -102,54 +93,57 @@ banner
         </div><!-- #intro -->
 
         <main id="main">
-            <div class="container">
-                <div class="section-header" style="margin-top: 20px;">
-                    <h2>宝智达-服务数量</h2>
-                </div>
-                <!-- 数据点列表开始 -->
-                <div class="row text-center">
-                    <!-- 在这里放置数据点 -->
-                    <div class="row text-center">
-                        {{range .Datas}}
-                        <div class="col-md-2 mb-5">
-                            <div class="card h-100">
-                                <div class="card-body">
-                                    <h5 class="card-title count-up" data-target="{{.Nums}}">0</h5>
-                                    <p class="card-text">{{.Title}}</p>
-                                </div>
-                            </div>
-                        </div>
-                        {{end}}
-                    </div>
-                </div>
-                <!-- 数据点列表结束 -->
-            </div>
+<!--            <div class="container">-->
+<!--                <div class="section-header" style="margin-top: 20px;">-->
+<!--                    <h2>宝智达-全国服务数量</h2>-->
+<!--                </div>-->
+<!--                &lt;!&ndash; 数据点列表开始 &ndash;&gt;-->
+<!--                <div class="row text-center">-->
+<!--                    &lt;!&ndash; 在这里放置数据点 &ndash;&gt;-->
+<!--                    <div class="row text-center">-->
+<!--                        {{range .Datas}}-->
+<!--                        <div class="col-md-2 mb-5">-->
+<!--                            <div class="card h-100">-->
+<!--                                <div class="card-body">-->
+<!--                                    <h5 class="card-title count-up" data-target="{{.Nums}}">0</h5>-->
+<!--                                    <p class="card-text">{{.Title}}</p>-->
+<!--                                </div>-->
+<!--                            </div>-->
+<!--                        </div>-->
+<!--                        {{end}}-->
+<!--                    </div>-->
+<!--                </div>-->
+<!--                &lt;!&ndash; 数据点列表结束 &ndash;&gt;-->
+<!--            </div>-->
             <!--==========================
-服务介绍
+                服务介绍
             ============================-->
-            <section id="features" class="features">
-                <div class="container" data-aos="fade-up">
-                    <div class="section-header" style="margin-top: 40px;">
-                        <h2>服务介绍</h2>
-                        <p>
-                            宝智达主要经营冷链温湿度监测平台、储运温湿度监测系统、温湿度监控设备及温湿度记录仪等系列产品、药品专用陈列柜、药品温度实时监测保温箱、冷链验证服务等均具有自主知识产权。</p>
+            <section id="features" class="features py-5">
+                <div class="container">
+                    <div class="section-header text-center mb-5">
+                        <h2 class="display-4">服务介绍</h2>
+                        <p class="lead">宝智达提供全面的冷链解决方案,包括温湿度监测平台、专用陈列柜等,均拥有自主知识产权。</p>
                     </div>
                     <div class="row">
-                        <div class="div1 col-6">
-                            {{range .Serves}}
-                            <h4><a href="services/{{.ID}}">{{.Title}}</a></h4>
-                            <p>{{.Synopsis}}</p>
-                            {{end}}
-                        </div>
-                        <div class="div2 col-6 serverbg">
-                            <img src="/image/cclod.png" alt=""></img>
+                        <div class="col-lg-12">
+                            <div class="service-description">
+                                {{range .Serves}}
+                                <div class="service-item mb-4 d-flex">
+                                    <div class="service-image-container">
+                                        <img src="{{.Url}}" alt="{{.Title}} 图例" class="img-fluid">
+                                    </div>
+                                    <div class="service-info">
+                                        <h4><a class="text-decoration-none" href="services/{{.ID}}">{{.Title}}</a></h4>
+                                        <p class="text-muted">{{.Synopsis}}</p>
+                                    </div>
+                                </div>
+                                {{end}}
+                            </div>
                         </div>
-                        <button class="btn btn-outline-primary" style="margin-top: 40px;"
-                                onclick="location.href = '/services/1'">
-                            了解更多服务
-                        </button>
                     </div>
-
+                    <div class="text-center mt-5">
+                        <a href="/services/1" class="btn btn-primary rounded-pill px-4">深入了解我们的服务</a>
+                    </div>
                 </div>
             </section><!-- End Features Section -->
             <!--==========================
@@ -171,8 +165,9 @@ banner
                             </div>
                         </div>
                         {{end}}
-                        <button class="btn btn-outline-primary" onclick="location.href = 'product?ptype=hardware'">查看更多
-                        </button>
+                        <div class="text-center mt-5">
+                        <a class="btn btn-primary rounded-pill px-4" href= 'product?ptype=hardware'>了解更多产品</a>
+                        </div>
                     </div>
                 </div>
             </section><!-- #services -->
@@ -272,18 +267,15 @@ Call To Action Section
         <script src="/static/layui/layui.js"></script>
         <script>
             document.addEventListener('DOMContentLoaded', function () {
-
                 var countUpElements = document.querySelectorAll('.count-up');
                 countUpElements.forEach(function (element) {
                     var target = parseInt(element.getAttribute('data-target')); // 获取目标数值
                     var start = 0; // 初始值
                     var duration = 2000; // 动画持续时间,单位毫秒
                     var increment = Math.ceil(target / (duration / 16)); // 计算每16ms增加的值
-
                     var timer = setInterval(function () {
                         start += increment;
                         element.textContent = start; // 更新显示的数值
-
                         if (start > target) {
                             clearInterval(timer); // 达到或超过目标值时停止
                             element.textContent = target;

+ 22 - 22
views/product.html

@@ -149,28 +149,28 @@ Page Banner Section
         <!--    </div>-->
         <!--</div>-->
         <main id="main">
-            <div class="container">
-                <div class="section-header" style="margin-top: 20px;">
-                    <h2>宝智达-服务数量</h2>
-                </div>
-                <!-- 数据点列表开始 -->
-                <div class="row text-center">
-                    <!-- 在这里放置数据点 -->
-                    <div class="row text-center">
-                        {{range .Datas}}
-                        <div class="col-md-2 mb-5">
-                            <div class="card h-100">
-                                <div class="card-body">
-                                    <h5 class="card-title count-up" data-target="{{.Nums}}">0</h5>
-                                    <p class="card-text">{{.Title}}</p>
-                                </div>
-                            </div>
-                        </div>
-                        {{end}}
-                    </div>
-                </div>
-                <!-- 数据点列表结束 -->
-            </div>
+<!--            <div class="container">-->
+<!--                <div class="section-header" style="margin-top: 20px;">-->
+<!--                    <h2>宝智达-服务数量</h2>-->
+<!--                </div>-->
+<!--                &lt;!&ndash; 数据点列表开始 &ndash;&gt;-->
+<!--                <div class="row text-center">-->
+<!--                    &lt;!&ndash; 在这里放置数据点 &ndash;&gt;-->
+<!--                    <div class="row text-center">-->
+<!--                        {{range .Datas}}-->
+<!--                        <div class="col-md-2 mb-5">-->
+<!--                            <div class="card h-100">-->
+<!--                                <div class="card-body">-->
+<!--                                    <h5 class="card-title count-up" data-target="{{.Nums}}">0</h5>-->
+<!--                                    <p class="card-text">{{.Title}}</p>-->
+<!--                                </div>-->
+<!--                            </div>-->
+<!--                        </div>-->
+<!--                        {{end}}-->
+<!--                    </div>-->
+<!--                </div>-->
+<!--                &lt;!&ndash; 数据点列表结束 &ndash;&gt;-->
+<!--            </div>-->
 
             <!--==========================
 Services Section