浏览代码

'产品中心'

Ethan 6 年之前
父节点
当前提交
10699cb20d

+ 1 - 1
application/admin/controller/Homeinfo.php

@@ -53,7 +53,7 @@ class Homeinfo extends AdminControl
                 $oldFile = $imgurl . "\\" . substr(input('post.bgImgName'),$begin + 1);
                 if(file_exists($oldFile)){
                     unlink($oldFile);
-                };print_r($oldFile);die;
+                };
                 $files = $files->setSaveName($oldFileName);//设置保存文件名
                 $imgt = $files->move($imgurl, $savename = $oldFileName, $replace = true);
                 if($imgt){

+ 29 - 0
application/home/controller/Product.php

@@ -33,6 +33,24 @@ class Product extends Common
      */
     public function product()
     {
+        $fatherProductField = [
+            'product_name',
+            'product_content',
+            'product_img',
+            'product_id',
+        ];
+        $fatherProductWhere = [
+            'product_pid' => 0,
+        ];
+        $getFatherProduct = model('Product')->getSelect($fatherProductField, $fatherProductWhere);
+        $this->assign('fatherProduct', $getFatherProduct);
+        $id = input('get.id') ?? $getFatherProduct[0]->product_id;
+        $productWhere = [
+            'product_pid' => $id,
+        ];
+        $getProduct = model('Product')->getSelect($fatherProductField, $productWhere);
+        $this->assign('product', $getProduct);
+        $this->assign('id', $id);
 
         return $this->fetch();
     }
@@ -45,6 +63,17 @@ class Product extends Common
      */
     public function details()
     {
+        $findProductinfo = model('Productinfo')->getFind();
+        $id = input('get.id') ?? $findProductinfo->product_id;
+        $productWhere = [
+            'product_id' => $id,
+        ];
+        $getProductInfo = model('Productinfo')->getSelect($productWhere);
+        $this->assign('productInfo', $getProductInfo);
+        $getProduct = model('Product')->getFind($productWhere);
+        $this->assign('product', $getProduct);
+        $getRenewal = model('Renewal')->getRenewal();
+        $this->assign('renewal', $getRenewal);
 
         return $this->fetch();
     }

+ 11 - 1
application/home/model/Product.php

@@ -29,6 +29,16 @@ class Product extends Model
         $result = $result->order($order)->select();
         return $result;
     }//endgetSelect()
+    public function getFind($where=[])
+    {
+        $result = $this;
+        if (empty($where) === false) {
+            $result = $result->where($where);
+        }
+        $result = $result->find();
+
+        return $result;
+    }//endgetSelect()
 
 
-}
+}

+ 40 - 0
application/home/model/Productinfo.php

@@ -0,0 +1,40 @@
+<?php
+namespace app\home\model;
+
+use think\Model;
+
+/**
+ * 主页导航管理模型
+ */
+class Productinfo extends Model
+{
+
+
+    /**
+     * 主页文字获取
+     *
+     * @access public
+     * @param mixed $field 查询字段
+     * @param mixed $where 条件
+     * @param mixed $order 排序
+     * @return array 返回类型
+     */
+    public function getSelect($where=[], $order='product_id asc')
+    {
+        $result = $this;
+        if (empty($where) === false) {
+            $result = $result->where($where);
+        }
+        $result = $result->order($order)->select();
+
+        return $result;
+    }//endgetSelect()
+    public function getFind()
+    {
+        $result = $this->find();
+
+        return $result;
+    }//endgetSelect()
+
+
+}

+ 28 - 0
application/home/model/Renewal.php

@@ -0,0 +1,28 @@
+<?php
+namespace app\home\model;
+
+use think\Model;
+
+/**
+ * 用户管理
+ */
+class Renewal extends Model
+{
+    public function getRenewal()
+    {
+        $result = $this
+            ->where(['renewal_status' => 1])
+            ->select();
+
+        return $result;
+    }
+    public function findRenewal($condition)
+    {
+        $result = $this
+            ->where($condition)
+            ->find();
+
+        return $result;
+    }
+
+}

+ 74 - 9
application/home/view/product/details.html

@@ -1,4 +1,6 @@
 {include file="layout/header" /}
+<style type="text/css">
+</style>
 <!-- banner -->
 <div class="product-details-banner">
     <div class="container">
@@ -7,16 +9,15 @@
                 <ul class="rslides">
                     <li>
                         <div class="slider-info" style="text-align: left !important;">
-                            <p style="font-size: 2.8vw; margin-left: 170px">
-                                数据分析
+                            <p style="font-size: 2.8vw;">
+                                {$product.product_name}
                             </p>
-                            <p style="font-size: 1vw; text-align: center;">
-                                提供全球约150个国家和地区的篮球赛事赛程赛果、实时比分、比赛事件。覆盖500+不同赛事、6,000+球队 <br>
-                                的一手赛况数据;用户无需守在电视直播前,即可快速了解多场篮球比赛的实时赛况、比赛结果等信息。
+                            <p style="font-size: 1vw;">
+                                {$product.product_content}
                             </p>
-                            <button>
-                                立即选购
-                            </button>
+                            <div style="text-align: right">
+                                <button>立即选购</button>
+                            </div>
                         </div>
                     </li>
                 </ul>
@@ -24,4 +25,68 @@
         </div>
     </div>
 </div>
-{include file="layout/footer" /}
+
+<section class="wthree-row" id="pricing">
+    <div class="container" style="font-size: 18px; font-weight: 800; margin-top: 50px;">
+        产品介绍
+    </div>
+    {volist name="productInfo" id="value"}
+    <div>
+        <div class="container" style="margin-top: 5px;">
+            <img src="{$Think.HOME_SITE_ROOT}/images/infoData.png">
+            {$value.productInfo_title}
+        </div>
+        <div class="container" style="margin-top: 5px;">
+            {$value.productInfo_content}
+        </div>
+        <div class="container" style="margin-top: 20px; margin-bottom: 50px">
+            <img src="{$Think.UPLOADS_ROOT}{$value.productInfo_img}" width="100%">
+        </div>
+    </div>
+    {/volist}
+    <div class="container" style="font-size: 18px; font-weight: 800; margin-top: 50px;">
+        产品价格
+    </div>
+    <div class="container" style="margin-top: 10px; margin-bottom: 50px;">
+        <table class="gridtable">
+            <tr>
+                <td style="border-right: 0;">产品名称</td>
+                <td style="border-right: 0; border-left: 0;">时间</td>
+                <td style="border-right: 0; border-left: 0;">价格</td>
+                <td style="border-left: 0;">选购</td>
+            </tr>
+            {volist name="renewal" id="value"}
+            <tr>
+                <td>{$value.renewal_name}</td>
+                <td>{$value.renewal_name}</td>
+                <td>
+                    <?php
+                        switch($value->renewal_id){
+                            case 1:
+                                echo $product->product_TypeOne;
+                                break;
+                            case 2:
+                                echo $product->product_TypeTwo;
+                                break;
+                            case 3:
+                                echo $product->product_TypeThree;
+                                break;
+                            case 4:
+                                echo $product->product_TypeFour;
+                                break;
+                        }
+                    ?>元
+                </td>
+                <td onclick="shopping('{$value.renewal_id}')" style="color: #0d93bf; cursor:pointer;">选购</td>
+            </tr>
+            {/volist}
+        </table>
+    </div>
+</section>
+<script>
+    const myHost = "http://" + window.location.host;
+    function shopping(id) {
+        window.location.href = myHost + "/home/product/details.html?id=" + id;
+    }
+</script>
+{include file="layout/footer" /}

+ 64 - 13
application/home/view/product/product.html

@@ -11,29 +11,80 @@
                     <p style="font-size: 1vw; text-align: center; margin-bottom:3%">
                         football data
                     </p>
-                    <div class="product-banner-button">
+                    <!--<div class="product-banner-button">
                         <button type="button" style="border:1px solid rgb(91, 120, 249); background-color: rgb(91, 120, 249)">
                             免费使用
                         </button>
                         <button type="button" style = "background-color: transparent; border: 1px solid ;">
                             购买咨询
                         </button>
-                    </div>
+                    </div>-->
                 </div>
             </li>
         </ul>
     </div>
 </div>
 
-<div>
-    <div>
-        <p>产品服务</p>
-        <ul style="line-height: 1.8;">
-            <li>足球数据</li>
-            <li>篮球数据</li>
-            <li>网球数据</li>
-            <li>棒球数据</li>
-        </ul>
+<section class="wthree-row" id="pricing">
+    <input style="display: none" id="id" value="{$id}">
+    <div class="container">
+        <div class="row pb-5">
+            <div class="col-lg-2 col-md-6 text-center  pb-0 pt-3 px-3 agile-pricegrid">
+                <ul class="list-group-flush">
+                    <li class="list-group-item" style="font-size: 16px; text-align: right;">产品与服务</li>
+                    {volist name="fatherProduct" id="value"}
+                    <li onclick="showCurrent('{$value.product_id}')" id="li-{$value.product_id}" class="list-group-item product-group">{$value.product_name}</li>
+                    {/volist}
+                </ul>
+            </div>
+            <div class="col-lg-10 col-md-6 text-center  pb-0 pt-3 px-3 agile-pricegrid">
+                {volist name="product" id="value"}
+                <div style="display: flex;">
+                    <div class="col-lg-5 col-md-6" style="text-align: left">
+                        <div style="font-size: 16px; height: 40px; border-bottom: 2px solid #777;">
+                            {$value.product_name}
+                        </div>
+                        <div style="margin-top: 10px; height: 120px; font-size: 14px; color: #3e3e3e;">
+                            {$value.product_content}
+                        </div>
+                        <div style="text-align: right; margin-bottom: 50px; color: #3e3e3e;">
+                            <span style="cursor:pointer;" onclick="goInfo('{$value.product_id}')">查看详情</span>
+                        </div>
+                    </div>
+                    <div class="col-lg-7 col-md-6">
+                        <img src="{$Think.UPLOADS_ROOT}{$value.product_img}" style="width: 550px">
+                    </div>
+                </div>
+                {/volist}
+            </div>
+        </div>
     </div>
-</div>
-{include file="layout/footer" /}
+</section>
+<script>
+    const myHost = "http://" + window.location.host;
+    let current = $("#id").val();
+    $("#li-"+current).attr("style","background: #E6F5FF")
+    function showCurrent(id) {
+        window.location.href = myHost + "/home/product/product.html?id=" + id;
+    }
+    function goInfo(id) {
+        window.location.href = myHost + "/home/product/details.html?id=" + id;
+    }
+    layui.use('laydate', function(){
+        var laydate = layui.laydate;
+
+        //执行一个laydate实例
+        laydate.render({
+            elem: '#creatTime' //指定元素
+        });
+        laydate.render({
+            elem:'#timeRang',
+            range:true,
+            format: 'yyyy/MM/dd',
+            done: function(value, date){
+                /* 时间选择完成后的回调 */
+            }
+        })
+    });
+</script>
+{include file="layout/footer" /}

+ 30 - 0
public/static/home/css/style.css

@@ -1414,6 +1414,36 @@ h5.modal-title {
     font-size: 1.6em;
 }
 
+.product-group {
+    cursor:pointer;
+    font-size: 14px;
+    text-align: right;
+}
+table.gridtable {
+    font-family: verdana,arial,sans-serif;
+    font-size:16px;
+    color:#333333;
+    border-width: 2px;
+    border-color: #ccc;
+    border-collapse: collapse;
+    width: 100%;
+    text-align: center;
+}
+table.gridtable th {
+    border-width: 2px;
+    padding: 8px;
+    border-style: solid;
+    border-color: #ccc;
+    background-color: #dedede;
+}
+table.gridtable td {
+    border-width: 2px;
+    padding: 8px;
+    border-style: solid;
+    border-color: #ccc;
+    background-color: #ffffff;
+}
+
 /* //modal */
 
 /*-- bottom-to-top --*/

二进制
public/static/home/images/immediate - 副本.png


二进制
public/static/home/images/infoData.png


二进制
public/uploads/home/productInfo_1.png


二进制
public/uploads/home/productInfo_2.png


二进制
public/uploads/home/product_1.png


二进制
public/uploads/home/product_2.png


二进制
public/uploads/home/product_3.png


二进制
public/uploads/home/product_4.png


二进制
public/uploads/home/product_5.png


二进制
public/uploads/home/product_details.png