Преглед на файлове

Merge remote-tracking branch 'root/master'

# Conflicts:
#	file/resources/js/handler.js
Administrator преди 1 година
родител
ревизия
2a54571ab0

+ 2 - 2
data/dao/DetailDao.go

@@ -10,7 +10,7 @@ import (
 // 排序
 func GetGoodsTagList(goodsTag domain.GoodsTag, pageNum, pageSize int) (vo.BaseListVo, error) {
 	var arr []domain.GoodsTag
-	Count, err := configs.Engine.Table("goods_tag").OrderBy("sort").
+	Count, err := configs.Engine.Table("goods_tag").
 		Limit(pageSize, (pageNum-1)*pageSize).FindAndCount(&arr, &goodsTag)
 	var vo vo.BaseListVo
 	if err != nil {
@@ -233,7 +233,7 @@ func SelectSkuInfoBySkuId(skuId int64) (vo.DetailInfoVo, error) {
 	}
 
 	var skus = make([]domain.GoodsSku, 0)
-	err = configs.Engine.Table("goods_sku").Where("goods_id = ?", goods.Id).Find(&skus)
+	err = configs.Engine.Table("goods_sku").Where("goods_id = ?", goods.Id).OrderBy("sort").Find(&skus)
 
 	infoVo.Sku = sku
 	infoVo.Goods = goods

+ 8 - 1
data/dao/ShopDao.go

@@ -69,7 +69,14 @@ func GetTopicList() ([]vo.ShopHomeTopicVo, error) {
 			vos[i].Skus = skus
 		}
 	}
-	return vos, nil
+	//处理vos防止skus数组为空
+	var newVos = make([]vo.ShopHomeTopicVo, 0)
+	for i := range vos {
+		if len(vos[i].Skus) != 0 {
+			newVos = append(newVos, vos[i])
+		}
+	}
+	return newVos, nil
 }
 func GetTopicPageDataListById(topicId int64) (vo.TopicPageData, error) {
 	topic := domain.ShopTopic{}

+ 15 - 0
data/dao/manage/Dao.go

@@ -1976,6 +1976,21 @@ func Get2GoodsSkuList(query domain.GoodsSkuQuery, pageNum, pageSize int) (vo.Bas
 	if query.CreateTimeStart != "" || query.CreateTimeEnd != "" {
 		session.Where("create_time between ? and ?", query.CreateTimeStart, query.CreateTimeEnd)
 	}
+	if query.Sort != 0 {
+		session.Where("sort = ?", query.Sort)
+	}
+
+	if query.SeoTitle != "" {
+		session.Where("seo_title = ?", query.SeoTitle)
+	}
+
+	if query.SeoKeywords != "" {
+		session.Where("seo_keywords = ?", query.SeoKeywords)
+	}
+
+	if query.SeoDescription != "" {
+		session.Where("seo_description = ?", query.SeoDescription)
+	}
 	Count, err := session.FindAndCount(&arr)
 	var vo vo.BaseListVo
 	if err != nil {

+ 4 - 1
data/domain/DoMain.go

@@ -244,10 +244,13 @@ type GoodsSku struct {
 	CreateBy         string    `xorm:"create_by" json:"createBy"`                 //注释:创建人
 	CreateTime       time.Time `xorm:"create_time" json:"createTime"`             //注释:创建时间
 	Sort             int64     `xorm:"sort" json:"sort"`                          //注释:排序
+	SeoTitle         string    `xorm:"seo_title" json:"seoTitle"`                 //注释:seo_标题
+	SeoKeywords      string    `xorm:"seo_keywords" json:"seoKeywords"`           //注释:seo_关键字
+	SeoDescription   string    `xorm:"seo_description" json:"seoDescription"`     //注释:seo_描述
 }
 
 func (receiver GoodsSku) String() string {
-	return fmt.Sprint("GoodsSku{", "Id:", receiver.Id, "SkuImage:", receiver.SkuImage, "SkuName:", receiver.SkuName, "Price:", receiver.Price, "HistoricalPrices:", receiver.HistoricalPrices, "InventoryNumber:", receiver.InventoryNumber, "CommodityAreaId:", receiver.CommodityAreaId, "GoodsId:", receiver.GoodsId, "CreateBy:", receiver.CreateBy, "CreateTime:", receiver.CreateTime, "Sort:", receiver.Sort, "}")
+	return fmt.Sprint("GoodsSku{", "Id:", receiver.Id, "SkuImage:", receiver.SkuImage, "SkuName:", receiver.SkuName, "Price:", receiver.Price, "HistoricalPrices:", receiver.HistoricalPrices, "InventoryNumber:", receiver.InventoryNumber, "CommodityAreaId:", receiver.CommodityAreaId, "GoodsId:", receiver.GoodsId, "CreateBy:", receiver.CreateBy, "CreateTime:", receiver.CreateTime, "Sort:", receiver.Sort, "SeoTitle:", receiver.SeoTitle, "SeoKeywords:", receiver.SeoKeywords, "SeoDescription:", receiver.SeoDescription, "}")
 }
 
 type GoodsSkuCard struct {

+ 3 - 0
data/domain/Query.go

@@ -185,6 +185,9 @@ type GoodsSkuQuery struct {
 	CreateTimeStart  string  `xorm:"create_time"  json:"createTime"`             // 创建时间
 	CreateTimeEnd    string  `xorm:"create_time"  json:"createTime"`             // 创建时间
 	Sort             int64   `xorm:"sort"  json:"sort"`                          // 排序
+	SeoTitle         string  `xorm:"seo_title"  json:"seoTitle"`                 // seo_标题
+	SeoKeywords      string  `xorm:"seo_keywords"  json:"seoKeywords"`           // seo_关键字
+	SeoDescription   string  `xorm:"seo_description"  json:"seoDescription"`     // seo_描述
 }
 
 type GoodsSkuCardQuery struct {

+ 0 - 10
file/resources/171705348458411.png

@@ -1,10 +0,0 @@
-<!DOCTYPE html>
-<html>
-    <head>
-        <meta charset="UTF-8" />
-        <title>404</title>
-    </head>
-    <body>
-        <script type="text/javascript" charset="utf-8" src="//qzonestyle.gtimg.cn/qzone/hybrid/app/404/search_children.js" homePageUrl="https://www.zuhaohao.com/" homePageName="回到我的主页"></script>
-    </body>
-</html>

+ 2 - 2
file/static/NavigationBar.tmpl

@@ -5,12 +5,12 @@
             <img src="/api/static/image/logo.png" alt="logo" onclick="JumpRouter('/','')"/>
         </div>
         <div class="nav-search">
-            <form action="/search" target="_blank">
+            <form action="/search" target="_blank" name="form">
                 <div class="nav-search-div">
                     <input class="search-input" type="text" name="key" placeholder="搜索商品名称"/>
                 </div>
                 <!--          点击-->
-                <div class="search-btn">
+                <div class="search-btn" onclick="form.submit();">
                     <div class="search-btn-icon">
                         <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024" data-v-6fbb019e="">
                             <path fill="currentColor"

+ 7 - 4
file/static/detail.html

@@ -2,21 +2,24 @@
 <html lang="en">
 <head>
     <meta charset="UTF-8">
-    <title>{{.sku.skuName}}</title>
+    <title>{{if .sku.seoTitle}}{{.sku.seoTitle}}{{else}}{{.sku.skuName}} - 易租租{{end}}</title>
     <link rel="stylesheet" href="/api/static//css/index.css">
     <link rel="stylesheet" href="/api/static/css/detail.css">
+    <meta name="og:title" content="{{if .sku.seoKeywords}}{{.sku.seoTitle}}{{else}}{{.sku.skuName}} - 易租租{{end}}">
     <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
-    <meta name="description" content="{{.goods.goodsName}} / {{.sku.skuName}}" />
+    <meta name="keywords" content="{{if .sku.seoKeywords}}{{.sku.seoKeywords}} - 易租租{{else}}{{.goods.goodsName}} - 易租租{{end}}">
+    <meta name="og:keywords" content="{{if .sku.seoKeywords}}{{.sku.seoKeywords}} - 易租租{{else}}{{.goods.goodsName}} - 易租租{{end}}">
+    <meta name="description" content="{{if .sku.seoDescription}}{{.sku.seoKeywords}}{{else}}{{.goods.goodsName}} / {{.sku.skuName}}{{end}}" />
+    <meta name="og:description" content="{{if .sku.seoDescription}}{{.sku.seoKeywords}}{{else}}{{.goods.goodsName}} / {{.sku.skuName}}{{end}}" />
 </head>
 <body>
-
 {{template "NavigationBar.tmpl" .}}
 <div class="detail">
     <!--    路由地址栏-->
 <!--    <RouterJumpBar v-model:nowRouterName="detailInfo.sku.skuName"/>-->
     <div class="router-jump-bar">
         <div class="router-bar">
-            <ul class="router-bar-list" id="router-bar-list" >
+            <ul class="router-bar-list" id="router-bar-list">
             </ul>
         </div>
     </div>

+ 3 - 1
file/static/index.html

@@ -2,10 +2,11 @@
 <html lang="en">
 <head>
     <meta charset="UTF-8">
-    <title>card 商城</title>
+    <title>易租租</title>
     <link rel="stylesheet" href="/api/static/css/index.css">
     <link rel="stylesheet" href="/api/static/css/carousel.css">
     <link rel="stylesheet" href="/api/static/css/home.css">
+    <meta name="keywords" content="易租租">
     <meta name="description"
           content="海外数字商城,为全球用户提供谷歌、苹果、脸书等购买服务,还有苹果、谷歌、steam礼品卡等购买渠道。在这里您还能进行steam代充、steam海外代充、steam钱包代充等,7*24小时为您提供满意的交易。">
 </head>
@@ -224,6 +225,7 @@
             </div>
             {{end}}
             {{end}}
+
             {{if gt $itemLen 12}}
             <!--            <div class="card-show" v-if="props.ShopHomeTopic.skus&&props.ShopHomeTopic.skus.length>12">-->
             <div class="card-show">

+ 4 - 1
file/static/info.html

@@ -2,9 +2,12 @@
 <html lang="en">
 <head>
     <meta charset="UTF-8">
-    <title>{{.title}}</title>
+    <title>{{.title}} - 易租租</title>
     <meta name="viewport" content="width=device-width, initial-scale=1.0">
     <link rel="stylesheet" href="/api/static/css/index.css">
+    <meta name="keywords" content="{{.title}} - 易租租">
+    <meta name="description"
+          content="海外数字商城,为全球用户提供谷歌、苹果、脸书等购买服务,还有苹果、谷歌、steam礼品卡等购买渠道。在这里您还能进行steam代充、steam海外代充、steam钱包代充等,7*24小时为您提供满意的交易。">
 </head>
 <body>
 {{template "NavigationBar.tmpl" .}}

+ 4 - 1
file/static/search.html

@@ -2,9 +2,12 @@
 <html lang="en">
 <head>
     <meta charset="UTF-8">
-    <title>搜索-</title>
+    <title>搜索 {{.key}} - 易租租</title>
     <link rel="stylesheet" href="/api/static/css/search.css">
     <link rel="stylesheet" href="/api/static/css/index.css">
+    <meta name="keywords" content="{{.key}} - 易租租">
+    <meta name="description"
+          content="海外数字商城,为全球用户提供谷歌、苹果、脸书等购买服务,还有苹果、谷歌、steam礼品卡等购买渠道。在这里您还能进行steam代充、steam海外代充、steam钱包代充等,7*24小时为您提供满意的交易。">
 </head>
 <body>
 {{template "NavigationBar.tmpl" .}}

+ 2 - 1
file/static/topic.html

@@ -2,9 +2,10 @@
 <html lang="en">
 <head>
     <meta charset="UTF-8">
-    <title>{{.topic.topicName}}</title>
+    <title>{{.topic.topicName}} - 易租租</title>
     <link rel="stylesheet" href="/api/static/css/index.css">
     <link rel="stylesheet" href="/api/static/css/topic.css">
+    <meta name="keywords" content="{{.topic.topicName }}">
     <meta name="description" content="{{.topic.topicDesc}}">
 </head>
 <body>

Файловите разлики са ограничени, защото са твърде много
+ 3 - 3
file/virtual_mall.sql


+ 1 - 1
router/FileRouter.go

@@ -68,7 +68,7 @@ func DeleteFile(c *gin.Context) {
 	if strings.Index(url, "/api/static/") != 0 {
 		c.JSON(200, CreateResultError(400, "文件路径错误"))
 	}
-	url = fmt.Sprint("file/resources/", strings.Replace(url, "/api/static/", "", 1))
+	url = strings.Replace(url, "/api/static/", "file/resources/", 1)
 
 	s, err := os.Stat(url)
 	if os.IsNotExist(err) {

+ 1 - 2
router/TestRouter.go

@@ -66,7 +66,6 @@ func Home(c *gin.Context) {
 		return
 	}
 	json.Unmarshal(marshal, &m)
-
 	//首页主题信息
 	list, err := dao.GetTopicList()
 	if err != nil {
@@ -85,7 +84,6 @@ func Home(c *gin.Context) {
 	}
 	json.Unmarshal(d2m, &m)
 
-	fmt.Println("data:", m)
 	c.HTML(http.StatusOK, "index.html", m)
 }
 
@@ -183,6 +181,7 @@ func SearchPage(c *gin.Context) {
 	fmt.Println("list:", string(list))
 	json.Unmarshal(list, &m)
 	m["count"] = count
+	m["key"] = key
 	fmt.Println("map:", m)
 	c.HTML(http.StatusOK, "search.html", m)
 }

Някои файлове не бяха показани, защото твърде много файлове са промени