Browse Source

添加用户页面

Administrator 1 year ago
parent
commit
18b05efecb

+ 375 - 0
file/resources/css/user.css

@@ -0,0 +1,375 @@
+.user-page {
+    display: flex;
+    flex-direction: column;
+    width: 100VW;
+    padding-top: 6.66667VW;
+    background-image: linear-gradient(rgba(255, 208, 221, 0.5), rgba(204, 201, 201, 0.5));
+}
+
+.user-page .user-page-login {
+    z-index: 1;
+    width: calc(100% - 5.33333vW);
+    height: 13.3VW;
+    padding: 0 2.6666VW;
+
+    margin-bottom: 6.66666VW;
+}
+
+.user-page .user-page-login .user-info-show {
+    display: flex;
+}
+
+.user-page .user-page-login .user-info-show .user-info-show-avatar {
+    width: 13VW;
+    height: 13VW;
+    background-color: rgb(190, 218, 248);
+    display: flex;
+    justify-content: center;
+    align-items: center;
+    border-radius: 50%;
+
+    margin-right: 2.333333vw;
+}
+
+.user-page .user-page-login .user-info-show .user-info-show-avatar img {
+    border-radius: inherit;
+    min-width: 50px;
+    min-height: 50px;
+    max-width: 50px;
+    max-height: 50px;
+}
+
+.user-page .user-page-login .user-info-show .user-info-show-name .user-info-show-name-text {
+    height: 5.6vw;
+    font-weight: 700;
+    font-size: 4.53333vw;
+    color: rgb(26, 26, 26);
+    line-height: 5.6vw;
+    margin-bottom: 2.26667vw;
+}
+
+.user-page .user-page-login .user-info-show .user-info-show-name .user-info-show-name-button {
+    font-size: 3.46667vw;
+    font-weight: normal;
+    line-height: 5.86667vw;
+    height: 5.86667vw;
+    letter-spacing: 0;
+    font-feature-settings: "kern";
+    color: rgb(118, 118, 118);
+}
+
+
+.user-page .user-page-handler {
+    height: 100VH;
+    background-color: white;
+    border-radius: 4.26667VW 4.26667VW 0 0;
+}
+
+.user-page .user-page-handler .user-handler-info {
+    display: flex;
+    -webkit-box-align: center;
+    align-items: center;
+    width: 94.6667vw;
+    height: 15.2vw;
+    margin: 0px auto;
+    position: relative;
+}
+
+.user-page .user-page-handler .user-handler-info .user-handler-info-item {
+    width: 23.4667vw;
+    height: 100%;
+    display: flex;
+    flex-direction: column;
+    -webkit-box-pack: center;
+    justify-content: center;
+    -webkit-box-align: center;
+    align-items: center;
+    position: relative;
+}
+
+.user-handler-info .user-handler-info-item .user-handler-info-item-number {
+    font-size: 4.8vw;
+    font-weight: 500;
+    line-height: 4.26667vw;
+    text-align: center;
+    letter-spacing: 0;
+    color: rgb(26, 26, 26);
+}
+
+.user-handler-info .user-handler-info-item .user-handler-info-item-remark {
+    font-size: 3.46667vw;
+    font-weight: normal;
+    line-height: 4.26667vw;
+    margin-top: 1.33333vw;
+    text-align: center;
+    letter-spacing: 0px;
+    color: rgb(26, 26, 26);
+}
+
+.user-handler-other {
+    width: 94.6667vw;
+    padding: 2.66667vw;
+    background: rgb(255, 255, 255);
+    border-radius: 1.06667vw;
+    margin: 0px auto 2.66667vw;
+}
+
+.user-handler-other .user-handler-other-header {
+    display: flex;
+    -webkit-box-align: center;
+    align-items: center;
+    -webkit-box-pack: justify;
+    justify-content: space-between;
+    margin-bottom: 2vw;
+}
+
+.user-handler-other .user-handler-other-header .title {
+    height: 6.4vw;
+    font-weight: 500;
+    font-size: 4.53333vw;
+    color: rgb(26, 26, 26);
+    line-height: 6.4vw;
+}
+
+.user-handler-other .user-handler-other-header .more-btn {
+    font-size: 3.46667vw;
+    color: rgb(118, 118, 118);
+}
+
+.user-handler-other .user-handler-other-bottom {
+    width: 100%;
+    height: 17.3333vw;
+    background: rgb(255, 255, 255);
+    display: flex;
+    -webkit-box-align: center;
+    align-items: center;
+    -webkit-box-pack: justify;
+    justify-content: space-between;
+    padding: 0px 1.33333vw;
+}
+
+.user-handler-other .user-handler-other-bottom .user-handler-other-bottom-item {
+    width: 17.3333vw;
+    height: 11.2vw;
+    position: relative;
+}
+
+.user-handler-other .user-handler-other-bottom .user-handler-other-bottom-item .icon {
+    display: flex;
+    -webkit-box-pack: center;
+    justify-content: center;
+    -webkit-box-align: center;
+    align-items: center;
+    width: 100%;
+}
+
+.user-handler-other .user-handler-other-bottom .user-handler-other-bottom-item .icon img {
+    width: 24px;
+    height: 24px;
+}
+
+.user-handler-other .user-handler-other-bottom .user-handler-other-bottom-item .label {
+    margin-top: 0.8vw;
+    font-size: 3.46667vw;
+    font-weight: normal;
+    line-height: 4.33333vw;
+    text-align: center;
+    letter-spacing: 0px;
+    color: rgb(26, 26, 26);
+}
+
+.user-page-handler .user-handler-goods-recommend {
+    width: 94.6667vw;
+    padding: 2.66667vw;
+    background: rgb(255, 255, 255);
+    border-radius: 1.06667vw;
+    margin: 0px auto 2.66667vw;
+}
+
+.user-page-handler .user-handler-goods-recommend .user-handler-goods-recommend-header {
+    display: flex;
+    -webkit-box-align: center;
+    align-items: center;
+    -webkit-box-pack: justify;
+    justify-content: space-between;
+    margin-bottom: 2vw;
+}
+
+.user-page-handler .user-handler-goods-recommend .user-handler-goods-recommend-header .title {
+    height: 6.4vw;
+    font-weight: 500;
+    font-size: 4.53333vw;
+    color: rgb(26, 26, 26);
+    line-height: 6.4vw;
+}
+
+.user-page-handler .user-handler-goods-recommend .user-handler-goods-recommend-header .more-btn {
+    font-size: 3.46667vw;
+    color: rgb(118, 118, 118);
+}
+
+.user-page-handler .user-handler-goods-recommend .user-handler-goods-recommend-skus {
+    display: flex;
+    flex-wrap: wrap;
+    padding: 0px 1.06667vw;
+    margin-top: 1.33333vw;
+}
+
+.user-page-handler .user-handler-goods-recommend .user-handler-goods-recommend-skus .sku-item {
+    width: 26.4vw;
+    margin-right: 4vw;
+    margin-bottom: 4vw;
+    border-radius: 1.06667vw;
+    overflow: hidden;
+    position: relative;
+
+}
+
+.user-page-handler .user-handler-goods-recommend .user-handler-goods-recommend-skus .sku-item .image {
+    height: 34.6667vw;
+    width: 100%;
+    overflow: hidden;
+    display: flex;
+    -webkit-box-align: center;
+    align-items: center;
+    -webkit-box-pack: center;
+    justify-content: center;
+}
+
+.user-page-handler .user-handler-goods-recommend .user-handler-goods-recommend-skus .sku-item .image img {
+    border-radius: 5px;
+    width: 100%;
+    height: 100%;
+}
+
+.user-page-handler .user-handler-goods-recommend .user-handler-goods-recommend-skus .sku-item .name {
+    font-size: 3.46667vw;
+    line-height: 4.8vw;
+    color: rgb(26, 26, 26);
+    display: -webkit-box;
+    -webkit-box-orient: vertical;
+    -webkit-line-clamp: 2;
+    text-overflow: ellipsis;
+    overflow: hidden;
+    margin-top: 1.2vw;
+}
+
+.router-bar-view {
+    position: fixed;
+    top: 0;
+    left: 0;
+    right: 0;
+    bottom: 0;
+    z-index: 12;
+    background-color: white;
+    width: 100%;
+}
+
+.router-bar-view .view-header {
+    display: flex;
+    width: 100VW;
+    text-align: center;
+    box-shadow: rgba(100, 100, 100, 0.1) 0px 2px 4px;
+}
+
+.view-header .view-header-back-btn .header-return {
+    width: 10.5VW;
+    height: 10.5VW;
+    font-size: 1.6em;
+    line-height: 10.5VW;
+    position: fixed;
+    text-align: center;
+    color: #666666;
+    border-radius: 50%;
+    user-select: none;
+}
+
+.view-header .view-header-back-btn .header-return::after {
+    content: "<";
+}
+
+.view-header .view-header-back-btn .header-title {
+    width: 100VW;
+    height: 10.5VW;
+    font-size: 1.6em;
+    line-height: 10.5VW;
+
+    text-align: center;
+    color: #666666;
+    border-radius: 50%;
+    user-select: none;
+
+
+    display: -webkit-box; /* 创建弹性盒子模型 */
+    -webkit-box-orient: vertical; /* 垂直排列子元素 */
+    overflow: hidden; /* 隐藏溢出的内容 */
+    text-overflow: ellipsis; /* 溢出的部分显示省略号 */
+    -webkit-line-clamp: 1; /* 限制显示的行数,这里限制为3行 */
+    max-height: calc(1.5em * 3); /* 计算出元素的最大高度(行高乘以行数) */
+}
+
+/*----用户信息----*/
+.router-bar-user-info-view {
+    display: flex;
+    flex-direction: column;
+    justify-content: flex-start;
+    padding: 4VW;
+}
+
+.router-bar-user-info-view .router-user-info-list {
+    display: flex;
+    flex-direction: column;
+    justify-content: space-between;
+    padding: 0 15px;
+}
+
+.router-bar-user-info-view .router-user-info-list .list-item {
+    display: flex;
+    flex-direction: row;
+    justify-content: space-between;
+    padding: 4VW 0;
+
+}
+
+.router-bar-user-info-view .router-user-info-list .list-item .title {
+    font-size: 3.33333VW;
+    color: #333333;
+}
+
+.router-bar-user-info-view .router-user-info-list .list-item .value {
+    font-size: 3.33333VW;
+    color: #999999;
+}
+
+.router-bar-user-info-view .router-user-info-list .router-user-info-avatar {
+    margin-bottom: 4VW;
+}
+
+.router-bar-user-info-view .router-user-info-list .router-user-info-avatar .title {
+    font-size: 3.33333VW;
+    color: #333333;
+    width: 16.5VW;
+    line-height: 16.5VW;
+}
+
+.router-bar-user-info-view .router-user-info-list .router-user-info-email {
+    border-bottom: 1px solid #aaaaaa;
+
+}
+
+.router-bar-user-info-view .router-user-info-list .router-user-info-avatar img {
+    width: 16.5VW;
+    height: 16.5VW;
+    border-radius: 50%;
+}
+
+
+.router-bar-user-info-view .router-user-logout{
+    font-size: 3.7VW;
+    text-align: center;
+    padding: 4VW;
+    color: rgb(20, 117, 250);;
+    margin-bottom: 4VW;
+}
+
+

+ 1 - 0
file/resources/image/bar/wallet.svg

@@ -0,0 +1 @@
+<svg t="1728716168229" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="7701" width="200" height="200"><path d="M902.095238 463.238095v292.571429a73.142857 73.142857 0 0 1-73.142857 73.142857H195.047619a73.142857 73.142857 0 0 1-73.142857-73.142857V463.238095h780.190476z m-536.380952 170.666667h-121.904762v73.142857h121.904762v-73.142857zM828.952381 195.047619a73.142857 73.142857 0 0 1 73.142857 73.142857v121.904762H121.904762v-121.904762a73.142857 73.142857 0 0 1 73.142857-73.142857h633.904762z" p-id="7702"></path></svg>

BIN
file/resources/image/user-page-back.png


+ 125 - 83
file/static/category.html

@@ -62,26 +62,7 @@
     let categoryData = null
     let categoryGoodsData = null
     let nowGoodsId = null
-    for (let i = 0; i < categoryMenuItems.length; i++) {
-        let item = categoryMenuItems[i]
-
-        item.addEventListener("click", function () {
-            for (let j = 0; j < categoryMenuItems.length; j++) {
-                let cmi = categoryMenuItems[j]
-                if (cmi !== item && cmi.classList.contains("category-menu-item-select")) {
-                    cmi.className = "category-menu-item"
-                }
-            }
-            this.className = "category-menu-item category-menu-item-select"
-            var newUrl = window.location.origin + '/category/';
-            history.pushState(null, null, newUrl + item.dataset.value);
-            postCategoryData(item.dataset.value, 1, 30)
-
-        })
-        if (i === 0) {
-            item.click()
-        }
-    }
+
 
     function showOrNoneCPGD() {
         if (cpgd.style.display) {
@@ -91,7 +72,8 @@
         } else {
             cpgd.style.display = "none"
             cpd.style.display = ""
-            var newUrl = window.location + '/' + nowGoodsId;
+            console.log(666)
+            let newUrl = window.location.href;
             let number = newUrl.lastIndexOf('/');
             newUrl = newUrl.substring(0, number)
             history.pushState(null, null, newUrl);
@@ -99,8 +81,10 @@
     }
 
     function getSkuList() {
-        var newUrl = window.location + '/' + nowGoodsId;
-        history.pushState(null, null, newUrl);
+        if (nowGoodsId) {
+            var newUrl = window.location + '/' + nowGoodsId;
+            history.pushState(null, null, newUrl);
+        }
         postCategoryGoodsData(nowGoodsId)
     }
 
@@ -144,6 +128,7 @@
         xhr.send(JSON.stringify(data));
     }
 
+    //获取商品列表
     function postCategoryGoodsData(goodsId) {
         // 创建 XMLHttpRequest 对象
         var xhr = new XMLHttpRequest();
@@ -161,7 +146,6 @@
                     // 解析服务器返回的 JSON 数据
                     var response = JSON.parse(xhr.responseText);
                     categoryGoodsData = response.data
-                    console.log(categoryGoodsData)
                     generateGoodsStructure(categoryGoodsData)
                     // 在此处理返回的数据对象
                 } catch (e) {
@@ -174,7 +158,6 @@
         var data = {
             goodsId: goodsId,
         };
-
         // 将数据对象转换为 JSON 字符串并发送
         xhr.send(JSON.stringify(data));
     }
@@ -188,7 +171,6 @@
             console.error("未找到 .first 容器");
             return;
         }
-        console.log(categoryData)
         for (let i = 0; i < categoryData.list.length; i++) {
             let item = categoryData.list[i]
             // 创建外层 div
@@ -231,67 +213,127 @@
 
         // 清空容器,确保不会重复添加
         container.innerHTML = '';
-
-        // 遍历返回的商品列表
-        data.list.forEach(function (item) {
-            // 创建外层 div
-            const skuDiv = document.createElement('div');
-            skuDiv.classList.add('category-goods-detail-sku');
-
-            // 左侧图片 div
-            const leftImgDiv = document.createElement('div');
-            leftImgDiv.classList.add('cgds-left-img');
-            const imgElement = document.createElement('img');
-            imgElement.src = item.skuImage; // 设置图片地址
-            leftImgDiv.appendChild(imgElement);
-
-            // 右侧详细信息 div
-            const rightDetailDiv = document.createElement('div');
-            rightDetailDiv.classList.add('cgds-right-detail');
-
-            // 名称 div
-            const nameDiv = document.createElement('div');
-            nameDiv.classList.add('cgds-right-detail-name');
-            nameDiv.textContent = item.skuName; // 设置商品名称
-
-            // 销量 div
-            const salesNumDiv = document.createElement('div');
-            salesNumDiv.classList.add('cgds-right-detail-salesnum');
-            salesNumDiv.textContent = `销量:${item.inventoryNumber}`; // 设置库存信息
-
-            // 价格 div
-            const priceDiv = document.createElement('div');
-            priceDiv.classList.add('cgds-right-detail-price');
-
-            const priceNowDiv = document.createElement('div');
-            priceNowDiv.classList.add('cgds-right-detail-price-now');
-            priceNowDiv.textContent = item.price; // 当前价格
-
-            const priceHistoryDiv = document.createElement('div');
-            priceHistoryDiv.classList.add('cgds-right-detail-price-history');
-            priceHistoryDiv.textContent = item.historicalPrices; // 历史价格
-
-            // 将价格 divs 添加到价格容器
-            priceDiv.appendChild(priceNowDiv);
-            priceDiv.appendChild(priceHistoryDiv);
-
-            // 将名称、销量、价格 div 添加到右侧详细信息 div
-            rightDetailDiv.appendChild(nameDiv);
-            rightDetailDiv.appendChild(salesNumDiv);
-            rightDetailDiv.appendChild(priceDiv);
-
-            // 将左侧图片和右侧详细信息 div 添加到外层 sku div
-            skuDiv.appendChild(leftImgDiv);
-            skuDiv.appendChild(rightDetailDiv);
-
-            // 将生成的 sku div 添加到页面容器中
-            container.appendChild(skuDiv);
-        });
+        if (data.list)
+            // 遍历返回的商品列表
+            data.list.forEach(function (item) {
+                // 创建外层 div
+                const skuDiv = document.createElement('div');
+                skuDiv.classList.add('category-goods-detail-sku');
+
+                // 左侧图片 div
+                const leftImgDiv = document.createElement('div');
+                leftImgDiv.classList.add('cgds-left-img');
+                const imgElement = document.createElement('img');
+                imgElement.src = item.skuImage; // 设置图片地址
+                leftImgDiv.appendChild(imgElement);
+
+                // 右侧详细信息 div
+                const rightDetailDiv = document.createElement('div');
+                rightDetailDiv.classList.add('cgds-right-detail');
+
+                // 名称 div
+                const nameDiv = document.createElement('div');
+                nameDiv.classList.add('cgds-right-detail-name');
+                nameDiv.textContent = item.skuName; // 设置商品名称
+
+                // 销量 div
+                const salesNumDiv = document.createElement('div');
+                salesNumDiv.classList.add('cgds-right-detail-salesnum');
+                salesNumDiv.textContent = `销量:${item.inventoryNumber}`; // 设置库存信息
+
+                // 价格 div
+                const priceDiv = document.createElement('div');
+                priceDiv.classList.add('cgds-right-detail-price');
+
+                const priceNowDiv = document.createElement('div');
+                priceNowDiv.classList.add('cgds-right-detail-price-now');
+                priceNowDiv.textContent = item.price; // 当前价格
+
+                const priceHistoryDiv = document.createElement('div');
+                priceHistoryDiv.classList.add('cgds-right-detail-price-history');
+                priceHistoryDiv.textContent = item.historicalPrices; // 历史价格
+
+                // 将价格 divs 添加到价格容器
+                priceDiv.appendChild(priceNowDiv);
+                priceDiv.appendChild(priceHistoryDiv);
+
+                // 将名称、销量、价格 div 添加到右侧详细信息 div
+                rightDetailDiv.appendChild(nameDiv);
+                rightDetailDiv.appendChild(salesNumDiv);
+                rightDetailDiv.appendChild(priceDiv);
+
+                // 将左侧图片和右侧详细信息 div 添加到外层 sku div
+                skuDiv.appendChild(leftImgDiv);
+                skuDiv.appendChild(rightDetailDiv);
+
+                // 将生成的 sku div 添加到页面容器中
+                container.appendChild(skuDiv);
+            });
     }
 
     // 调用函数,传入实际数据
-    postCategoryData(1, 1, 10);
+    // postCategoryData(1, 1, 10);
+    function init() {
+        let ele = null
+        for (let i = 0; i < categoryMenuItems.length; i++) {
+            let item = categoryMenuItems[i]
+
+            item.addEventListener("click", function () {
+                for (let j = 0; j < categoryMenuItems.length; j++) {
+                    let cmi = categoryMenuItems[j]
+                    if (cmi !== item && cmi.classList.contains("category-menu-item-select")) {
+                        cmi.className = "category-menu-item"
+                    }
+                }
+                this.className = "category-menu-item category-menu-item-select"
+                var newUrl = window.location.host + '/category/';
+                history.pushState(null, null, newUrl + item.dataset.value);
+                postCategoryData(item.dataset.value, 1, 30)
 
+            })
+            if (i === 0) {
+                ele = item
+            }
+        }
+        //获取路由
+        let path = ""
+        let host = window.location.host
+        let href = window.location.href
+        let number = href.indexOf(host)
+        if (number === -1) {
+            ele.click()
+        } else {
+            path = href.substring(number + host.length)
+        }
+        let strings = path.split("/");
+        let sign = 0
+        let reg = /^[0-9]*$/
+        for (let i = 0; i < strings.length; i++) {
+            if (strings[i] === "category") {
+                sign = 1
+                if (i === strings.length - 1) {
+                    let d = ele.getAttribute("data-value");
+                    postCategoryData(d, 1, 30)
+                    var newUrl = window.location.href + '/' + d;
+                    history.pushState(null, null, newUrl);
+                    console.log("base")
+                }
+                continue
+            }
+            if (sign === 1 && reg.test(strings[i])) {
+                sign++
+                postCategoryData(strings[i], 1, 30)
+                continue
+            }
+            if (sign === 2 && reg.test(strings[i])) {
+                sign++
+                postCategoryGoodsData(strings[i])
+                showOrNoneCPGD()
+                break
+            }
+        }
+    }
 
+    init()
 </script>
 </html>

+ 214 - 0
file/static/user.html

@@ -0,0 +1,214 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="UTF-8">
+    <title>易租租-用户</title>
+
+    <meta name="viewport" content="width=device-width, initial-scale=1.0">
+    <link rel="stylesheet" href="/api/static/css/index.css">
+    <link rel="stylesheet" href="/api/static/css/user.css">
+</head>
+<body>
+<div class="user-page">
+    <div style="position: fixed;top: 0;width: 100%;height: 100%;left: 0;right: 0;z-index:-1">
+        <img src="/api/static/image/user-page-back.png" style="width: 100VW;height: 100%"/>
+    </div>
+    <div class="user-page-login">
+        <div class="user-info-show">
+            <div class="user-info-show-avatar">
+                <img src="/api/static/image/def_image.png"/>
+            </div>
+            <div class="user-info-show-name">
+                <div class="user-info-show-name-text">名称</div>
+                <div class="user-info-show-name-button">完善资料 ></div>
+            </div>
+        </div>
+
+    </div>
+    <div class="user-page-handler">
+        <div class="user-handler-info">
+            <div class="user-handler-info-item">
+                <div class="user-handler-info-item-number">0</div>
+                <div class="user-handler-info-item-remark">积分</div>
+            </div>
+            <div class="user-handler-info-item">
+                <div class="user-handler-info-item-number">0</div>
+                <div class="user-handler-info-item-remark">卡券</div>
+            </div>
+            <div class="user-handler-info-item">
+                <div class="user-handler-info-item-number">0.00</div>
+                <div class="user-handler-info-item-remark">账户余额</div>
+            </div>
+            <div class="user-handler-info-item">
+                <div class="user-handler-info-item-number">0.00</div>
+                <div class="user-handler-info-item-remark">累计收益</div>
+            </div>
+        </div>
+
+        <div class="user-handler-other">
+            <div class="user-handler-other-header">
+                <div class="title">我的订单</div>
+                <div class="more-btn">全部</div>
+            </div>
+            <div class="user-handler-other-bottom">
+                <div class="user-handler-other-bottom-item">
+                    <div class="icon">
+                        <img src="/api/static/image/bar/wallet.svg"/>
+                    </div>
+                    <div class="label">待付款</div>
+                </div>
+                <div class="user-handler-other-bottom-item">
+                    <div class="icon">
+                        <img src="/api/static/image/bar/wallet.svg"/>
+                    </div>
+                    <div class="label">待付款</div>
+                </div>
+                <div class="user-handler-other-bottom-item">
+                    <div class="icon">
+                        <img src="/api/static/image/bar/wallet.svg"/>
+                    </div>
+                    <div class="label">待付款</div>
+                </div>
+                <div class="user-handler-other-bottom-item">
+                    <div class="icon">
+                        <img src="/api/static/image/bar/wallet.svg"/>
+                    </div>
+                    <div class="label">待付款</div>
+                </div>
+                <div class="user-handler-other-bottom-item">
+                    <div class="icon">
+                        <img src="/api/static/image/bar/wallet.svg"/>
+                    </div>
+                    <div class="label">待付款</div>
+                </div>
+                <div class="user-handler-other-bottom-item">
+                    <div class="icon">
+                        <img src="/api/static/image/bar/wallet.svg"/>
+                    </div>
+                    <div class="label">待付款</div>
+                </div>
+            </div>
+        </div>
+        <div class="user-handler-service"></div>
+        <div class="user-handler-publicize"></div>
+        <div class="user-handler-goods-recommend">
+            <div class="user-handler-goods-recommend-header">
+                <div class="title">我的订单</div>
+                <div class="more-btn">全部</div>
+            </div>
+            <div class="user-handler-goods-recommend-skus">
+                <div class="sku-item">
+                    <div class="image">
+                        <img src="/api/static/image/def_image.png"/>
+                    </div>
+                    <div class="name">100钻石</div>
+                </div>
+                <div class="sku-item">
+                    <div class="image">
+                        <img src="/api/static/image/def_image.png"/>
+                    </div>
+                    <div class="name">100钻石</div>
+                </div>
+                <div class="sku-item">
+                    <div class="image">
+                        <img src="/api/static/image/def_image.png"/>
+                    </div>
+                    <div class="name">100钻石</div>
+                </div>
+                <div class="sku-item">
+                    <div class="image">
+                        <img src="/api/static/image/def_image.png"/>
+                    </div>
+                    <div class="name">100钻石</div>
+                </div>
+                <div class="sku-item">
+                    <div class="image">
+                        <img src="/api/static/image/def_image.png"/>
+                    </div>
+                    <div class="name">100钻石</div>
+                </div>
+            </div>
+
+        </div>
+    </div>
+
+</div>
+<div class="router-bar-view" id="router-bar-view">
+    <div class="view-header">
+        <div class="view-header-back-btn">
+            <div class="header-return" id="header-return"></div>
+            <div class="header-title">标题</div>
+        </div>
+    </div>
+    {{template "user_info.tmpl" . }}
+    <!--    用户信息-->
+    <div class="router-bar-user-info-view"></div>
+    <!--    用户设置-->
+    <div class="router-bar-user-setting-view" id="router-user-setting"></div>
+    <!--    用户优惠券-->
+    <div class="router-bar-user-coupon-view" id="router-user-coupon"></div>
+    <!--    用户余额-->
+    <div class="router-bar-user-balance-view" id="router-user-balance"></div>
+    <!--    用户收益-->
+    <div class="router-bar-user-earnings-view" id="router-user-earnings"></div>
+    <!--    订单-->
+    <div class="router-bar-user-order-view" id="router-user-order"></div>
+</div>
+{{template "FooterBar.tmpl" .}}
+</body>
+<script>
+    setTimeout(function () {
+        let imgs = document.getElementsByTagName("img");
+        if (imgs) {
+            for (let i = 0; i < imgs.length; i++) {
+                if (!imgs[i].getAttribute("src")) {
+                    imgs[i].setAttribute("src", "/api/static/image/def_image.png")
+                }
+            }
+        }
+    }, 100)
+
+    document.getElementById("header-return").addEventListener("click", function () {
+        showOrNoneUserReturn()
+    })
+    let showRouteNameList = ["router-user-info", "router-user-setting", "router-user-coupon", "router-user-balance", "router-user-earnings", "router-user-order"]
+    let showRouteName = ""
+
+    function init() {
+        //打开用户信息页面
+        let userInfo = document.getElementsByClassName("user-info-show-name-text");
+        let avatar = document.getElementsByClassName("user-info-show-avatar")
+        for (let i = 0; i < userInfo.length; i++) {
+            userInfo[i].addEventListener("click", function () {
+                showOrNoneUserReturn()
+                showRouteName = "router-user-info"
+            })
+        }for (let i = 0; i < avatar.length; i++) {
+            avatar[i].addEventListener("click", function () {
+                showOrNoneUserReturn()
+                showRouteName = "router-user-info"
+            })
+        }
+
+
+    }
+
+    function showOrNoneUserReturn() {
+        let page = document.getElementById("user-page");
+        let bar = document.getElementById("router-bar-view");
+        if (bar.style.display) {
+            bar.style.display = ""
+            page.style.display = "none"
+            showRouteName = ""
+        } else {
+            bar.style.display = "none"
+            page.style.display = ""
+        }
+        for (let i = 0; i < showRouteNameList.length; i++) {
+            let res = showRouteNameList[i] === showRouteName
+            document.getElementById(showRouteName).style.display = res ? "" : "none"
+        }
+
+    }
+</script>
+</html>

+ 19 - 0
file/static/user_info.tmpl

@@ -0,0 +1,19 @@
+<div class="router-bar-user-info-view" id="router-user-info">
+    <div class="router-user-info-list">
+        <div class="router-user-info-avatar list-item">
+            <div class="title">我的头像</div>
+            <div class="image">
+                <img src=""/>
+            </div>
+        </div>
+        <div class="router-user-info-email list-item">
+            <div class="title">邮箱</div>
+            <div class="value">18425@qq.com</div>
+        </div>
+        <div class="router-user-info-real list-item">
+            <div class="title">实名认证</div>
+            <div class="value">未认证 ></div>
+        </div>
+    </div>
+    <div class="router-user-logout">退出登录</div>
+</div>

+ 7 - 1
router/TestRouter.go

@@ -29,8 +29,11 @@ func TestRouth(engine *gin.RouterGroup) {
 		PushRouter(user, "GET", "/search", SearchPage)
 		PushRouter(user, "GET", "/info/:infoName", InfoPage)
 
-		PushRouter(user, "GET", "/category/:category", CategoryPage)
 		PushRouter(user, "GET", "/category", CategoryPage)
+		PushRouter(user, "GET", "/category/:category", CategoryPage)
+		PushRouter(user, "GET", "/category/:category/:TypeId", CategoryPage)
+
+		PushRouter(user, "GET", "/user", UserPage)
 
 		PushRouter(user, "POST", "/category", GetCategoryListByTypeId)
 		PushRouter(user, "POST", "/category/goods", GetCategoryGoodsSkuListByGoodsId)
@@ -234,6 +237,9 @@ func CategoryPage(c *gin.Context) {
 
 	c.HTML(http.StatusOK, "category.html", dm)
 }
+func UserPage(c *gin.Context) {
+	c.HTML(http.StatusOK, "user.html", nil)
+}
 
 //================存json请求======================