This commit is contained in:
裴浩宇 2020-03-20 16:36:40 +08:00
parent 3d660454a1
commit 93a1329ad0
30 changed files with 424 additions and 142 deletions

View File

@ -183,4 +183,11 @@ public class EbuyController {
return result;
}
//查询各状态订单数量
@RequestMapping("/orderNumber")
@ResponseBody
public List<Map<String,Object>> orderNumber(@RequestParam("userId")String userId) {
List<Map<String,Object>> result = ebuyService.orderNumber(userId);
return result;
}
}

View File

@ -43,4 +43,9 @@ public interface EbuyMapper {
* 获取商品列表
*/
List<Map<String,Object>> commodityInfo(String keyword);
/**
* 查询各状态订单数量
*/
List<Map<String,Object>> orderNumber(String userId);
}

View File

@ -130,4 +130,9 @@ inner join ebuy_commodity_attribute ca on c.commodity_id = ca.commodity_id
ORDER BY
c.commodity_type ,c.commodity_type_details
</select>
<!--查询状态订单数量-->
<select id="orderNumber" resultType="map" parameterType="string">
select order_status,count(*) number from ebuy_order _status where user_id = #{userId} GROUP BY order_status
</select>
</mapper>

View File

@ -34,4 +34,9 @@ public interface EbuyService {
* 获取商品列表
*/
List<Map<String, Object>> commodityInfo(String keyword);
/**
* 查询各状态订单数量
*/
List<Map<String,Object>> orderNumber(String userId);
}

View File

@ -89,4 +89,10 @@ public class EbuyServiceImpl implements EbuyService {
List<Map<String, Object>> result = ebuyMapper.commodityInfo(keyword);
return result;
}
@Override
public List<Map<String,Object>> orderNumber(String userId) {
List<Map<String,Object>> result = ebuyMapper.orderNumber(userId);
return result;
}
}

View File

@ -0,0 +1,19 @@
package com.phy.ebuy.util;
import java.util.ArrayList;
import java.util.List;
public class Listw {
public static void main(String[] args) {
List<String> list1=new ArrayList<String>();
list1.add("xxx");
List<String> list2=new ArrayList<String>();
list2.add("yyy");
list2.add("yyy");
list1.addAll(list2);
System.out.println(list1);
}
}

View File

@ -6,11 +6,47 @@
<link rel="stylesheet" href="../../static/css/accountSettings.css">
<link rel="shortcut icon" type="image/x-icon" href="../../static/img/favicon.ico" rel="external nofollow" />
<link rel="stylesheet" href="../../static/layui/css/layui.css">
<script src="../../static/layui/layui.all.js"></script>
<link rel="stylesheet" href="../../../static/css/public.css">
<script src="../../static/layui/layui.all.js"></script>
</head>
<body>
<div class="">
<h1>账户设置</h1>
<div class="content">
<fieldset class="layui-elem-field layui-field-title" style="margin-top: 30px;">
<legend>账号管理</legend>
</fieldset>
<nav>
<ul>
<li>安全设置</li>
<li>个人资料</li>
<li>收货地址</li>
</ul>
</nav>
<div class="security-settig select-content">
<p>您的安全设置</p>
<div>
<div class="one">
<div class="left">会员名</div>
<div class="right">帅气的布里茨</div>
</div>
<div class="one">
<div class="left">登 录 邮 箱:</div>
<div class="right">您尚未设置登录邮箱</div>
<div class="add selection-text">添加邮箱</div>
<div class="modify selection-text">修改邮箱</div>
</div>
<div class="one">
<div class="left">绑 定 手 机:</div>
<div class="right">15006732580</div>
<div class="modify selection-text">修改手机</div>
</div>
</div>
</div>
<div class="personal-data select-content">
</div>
<div class="receiving-address select-content">
</div>
</div>
</body>
<script src="../../static/layui/layui.js"></script>

View File

@ -6,6 +6,7 @@
<link rel="stylesheet" href="../../../../static/css/allOrder.css">
<link rel="shortcut icon" type="image/x-icon" href="../../static/img/favicon.ico" rel="external nofollow" />
<link rel="stylesheet" href="../../static/layui/css/layui.css">
<link rel="stylesheet" href="../../../static/css/noSuchCommodity.css">
<script src="../../static/layui/layui.all.js"></script>
</head>
<body>

View File

@ -6,6 +6,7 @@
<link rel="stylesheet" href="../../../../static/css/pendingPayment.css">
<link rel="stylesheet" href="../../../../static/css/allOrder.css">
<link rel="stylesheet" href="../../static/layui/css/layui.css">
<link rel="stylesheet" href="../../../static/css/noSuchCommodity.css">
<script src="../../static/layui/layui.all.js"></script>

View File

@ -6,6 +6,7 @@
<link rel="stylesheet" href="../../../../static/css/toBeEvaluated.css">
<link rel="stylesheet" href="../../../../static/css/allOrder.css">
<link rel="stylesheet" href="../../static/layui/css/layui.css">
<link rel="stylesheet" href="../../../static/css/noSuchCommodity.css">
<script src="../../static/layui/layui.all.js"></script>
</head>

View File

@ -6,6 +6,7 @@
<link rel="stylesheet" href="../../../../static/css/toBeReceived.css">
<link rel="stylesheet" href="../../../../static/css/allOrder.css">
<link rel="stylesheet" href="../../static/layui/css/layui.css">
<link rel="stylesheet" href="../../../static/css/noSuchCommodity.css">
<script src="../../static/layui/layui.all.js"></script>

View File

@ -6,6 +6,7 @@
<link rel="stylesheet" href="../../../../static/css/toBeShipped.css">
<link rel="stylesheet" href="../../../../static/css/allOrder.css">
<link rel="stylesheet" href="../../static/layui/css/layui.css">
<link rel="stylesheet" href="../../../static/css/noSuchCommodity.css">
<script src="../../static/layui/layui.all.js"></script>
</head>

View File

@ -6,8 +6,9 @@
<link rel="shortcut icon" type="image/x-icon" href="../../static/img/favicon.ico" rel="external nofollow" />
<link rel="stylesheet" href="../../static/layui/css/layui.css">
<link rel="stylesheet" href="../../static/css/cart.css">
<script src="../../static/layui/layui.all.js"></script>
<link rel="stylesheet" href="../../../static/css/noSuchCommodity.css">
<link rel="stylesheet" href="../../static/css/public.css">
<script src="../../static/layui/layui.all.js"></script>
</head>
<body>

View File

@ -8,6 +8,7 @@
<link rel="stylesheet" href="../../static/layui/css/layui.css">
<link rel="stylesheet" href="../../static/css/commodity.css">
<link rel="stylesheet" href="../../static/css/public.css">
<link rel="stylesheet" href="../../../static/css/noSuchCommodity.css">
<script src="../../static/layui/layui.all.js"></script>
</head>
@ -28,6 +29,10 @@
</div>
<div class="strip"></div>
<div class="commodity-list">
<!-- <div>
<img src="../../static/img/noLogo.png"/>
<p>没有符合条件的宝贝,请尝试其他搜索条件。</p>
</div>-->
<!--<div class="commodity">
<div class="business-name">
<input type="checkbox" class="checkbox">

View File

@ -237,19 +237,19 @@
</div>
<div class="order">
<div class="receiving">
<div class="receiving-num">5</div>
<div class="receiving-num">0</div>
<span>待收货</span>
</div>
<div class="deliver">
<div class="deliver-num">8</div>
<div class="deliver-num">0</div>
<span>待发货</span>
</div>
<div class="payment">
<div class="payment-num">45</div>
<div class="payment-num">0</div>
<span>待付款</span>
</div>
<div class="evaluate">
<div class="evaluate-num">12</div>
<div class="evaluate-num">0</div>
<span>待评价</span>
</div>
</div>

View File

@ -9,5 +9,38 @@ html{
}
body{
width: 100%;
height: 100%;
}
.content{
margin: 0 auto;
width: 85%;
}
nav{
width: 8.5rem;
float: left;
}
nav ul li{
height: 3rem;
line-height: 3rem;
text-align: center;
cursor: pointer;
}
nav ul li:hover{
color: #17b5fe;
}
.select-content{
width: 52.4rem;
height: 42rem;
float: left;
margin: 0 2rem;
border: 2px solid rgb(196,213,224);
padding: 2rem 3rem;
}
.security-settig{
}
.personal-data{
display: none;
}
.receiving-address{
display: none;
}

View File

@ -1,5 +1,5 @@
p,span{
text-decoration: none;
user-select: none;
}
.middle .box{
height: fit-content;
@ -77,6 +77,9 @@ p,span{
padding: 1em;
font-weight: bold;
}
.commodity-price p{
font-weight: normal;
}
.commodity-price span:nth-child(3){
font-weight: normal;
@ -85,6 +88,7 @@ p,span{
text-align: center;
padding:1em;
}
.commodity-amount .amount-box{
width: 5rem;
display: flex;

View File

@ -0,0 +1,14 @@
.no{
margin: 2rem auto;
width: 22.7rem;
height: 8rem;
}
.no img{
float: left;
height: 8rem;
}
.no p{
float: left;
height: 8rem;
line-height: 8rem;
}

View File

@ -1,13 +1,14 @@
.hand-shape{
cursor: pointer;
}
/*选中小手*/
.selection-text{
cursor: pointer;
cursor: pointer !important;
}
/*选中变色*/
.selection-text:hover{
color: #17b5fe;
text-decoration: underline;
color: #17b5fe !important;
text-decoration: underline !important;
}
/*灰色字体*/
.gray-font{
color:rgb(136,136,136);
color:rgb(136,136,136) !important;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

View File

@ -1,40 +1,4 @@
//选择Tab页内容
let accountTab = sessionStorage.getItem("accountTab");
//个人首页
if (accountTab == "personalHomepage") {
$(".layui-tab-title li:eq(0)").addClass("layui-this");
$(".layui-tab-title li:eq(1)").removeClass("layui-this");
$(".layui-tab-title li:eq(2)").removeClass("layui-this");
$(".layui-tab-item:eq(0)").addClass("layui-show");
$(".layui-tab-item:eq(1)").removeClass("layui-show");
$(".layui-tab-item:eq(2)").removeClass("layui-show");
//账户设置
}else if (accountTab == "accountSettings") {
$(".layui-tab-title li:eq(0)").removeClass("layui-this");
$(".layui-tab-title li:eq(1)").addClass("layui-this");
$(".layui-tab-title li:eq(2)").removeClass("layui-this");
$(".layui-tab-item:eq(0)").removeClass("layui-show");
$(".layui-tab-item:eq(1)").addClass("layui-show");
$(".layui-tab-item:eq(2)").removeClass("layui-show");
//消息
} else if (accountTab == "accountSettings") {
$(".layui-tab-title li:eq(0)").removeClass("layui-this");
$(".layui-tab-title li:eq(1)").removeClass("layui-this");
$(".layui-tab-title li:eq(2)").addClass("layui-this");
$(".layui-tab-item:eq(0)").removeClass("layui-show");
$(".layui-tab-item:eq(1)").removeClass("layui-show");
$(".layui-tab-item:eq(2)").addClass("layui-show");
}
//logo跳转个人首页
$(".my-logo").on("click",function () {
$(".layui-tab-title li:eq(0)").addClass("layui-this");
$(".layui-tab-title li:eq(1)").removeClass("layui-this");
$(".layui-tab-title li:eq(2)").removeClass("layui-this");
$(".layui-tab-item:eq(0)").addClass("layui-show");
$(".layui-tab-item:eq(1)").removeClass("layui-show");
$(".layui-tab-item:eq(2)").removeClass("layui-show");
});
layui.use(['layer',"jquery","element","carousel"], function() {
const layer = layui.layer
@ -42,5 +6,44 @@ layui.use(['layer',"jquery","element","carousel"], function() {
,element = layui.element
,carousel = layui.carousel;
let index = layer.load(0, {shade: [0.5,'#000']});
setTimeout("layer.closeAll()",5000)
//选择Tab页内容
let accountTab = sessionStorage.getItem("accountTab");
//个人首页
if (accountTab == "personalHomepage") {
$(".layui-tab-title li:eq(0)").addClass("layui-this");
$(".layui-tab-title li:eq(1)").removeClass("layui-this");
$(".layui-tab-title li:eq(2)").removeClass("layui-this");
$(".layui-tab-item:eq(0)").addClass("layui-show");
$(".layui-tab-item:eq(1)").removeClass("layui-show");
$(".layui-tab-item:eq(2)").removeClass("layui-show");
//账户设置
}else if (accountTab == "accountSettings") {
$(".layui-tab-title li:eq(0)").removeClass("layui-this");
$(".layui-tab-title li:eq(1)").addClass("layui-this");
$(".layui-tab-title li:eq(2)").removeClass("layui-this");
$(".layui-tab-item:eq(0)").removeClass("layui-show");
$(".layui-tab-item:eq(1)").addClass("layui-show");
$(".layui-tab-item:eq(2)").removeClass("layui-show");
//消息
} else if (accountTab == "accountSettings") {
$(".layui-tab-title li:eq(0)").removeClass("layui-this");
$(".layui-tab-title li:eq(1)").removeClass("layui-this");
$(".layui-tab-title li:eq(2)").addClass("layui-this");
$(".layui-tab-item:eq(0)").removeClass("layui-show");
$(".layui-tab-item:eq(1)").removeClass("layui-show");
$(".layui-tab-item:eq(2)").addClass("layui-show");
}
//logo跳转个人首页
$(".my-logo").on("click",function () {
$(".layui-tab-title li:eq(0)").addClass("layui-this");
$(".layui-tab-title li:eq(1)").removeClass("layui-this");
$(".layui-tab-title li:eq(2)").removeClass("layui-this");
$(".layui-tab-item:eq(0)").addClass("layui-show");
$(".layui-tab-item:eq(1)").removeClass("layui-show");
$(".layui-tab-item:eq(2)").removeClass("layui-show");
});
})

View File

@ -15,13 +15,22 @@ layui.use(["layer","jquery","element","carousel","table"], function() {
orderStatus:"05",
},
success:function (data) {
if (data.length == 0) {
let no = `
<div class="no">
<img src="../../static/img/noLogo.png"/>
<p>没有符合条件的宝贝请尝试其他搜索条件</p>
</div>`;
$(".table-body").html(no);
} else {
orderInfo = data;
let orderTable = "";
for (let i = 0; i < data.length; i++) {
let orderOne = "";
//待付款
if (data[i].order_status == "01") {
orderOne = `<div class="oneOrder">
let orderOne = "";
//待付款
if (data[i].order_status == "01") {
orderOne = `<div class="oneOrder">
<div class="top">
<div class="timeAndOrderId">
<div class="time">${data[i].creat_time}</div>
@ -62,9 +71,9 @@ layui.use(["layer","jquery","element","carousel","table"], function() {
</div>
</div>
</div>`;
//待发货
} else if (data[i].order_status == "02") {
orderOne = `
//待发货
} else if (data[i].order_status == "02") {
orderOne = `
<div class="oneOrder">
<div class="top">
<div class="timeAndOrderId">
@ -103,9 +112,9 @@ layui.use(["layer","jquery","element","carousel","table"], function() {
</div>
</div>
</div>`
//待收货
}else if (data[i].order_status == "03") {
orderOne = `<div class="oneOrder">
//待收货
} else if (data[i].order_status == "03") {
orderOne = `<div class="oneOrder">
<div class="top">
<div class="timeAndOrderId">
<div class="time">${data[i].creat_time}</div>
@ -148,9 +157,9 @@ layui.use(["layer","jquery","element","carousel","table"], function() {
</div>
</div>
</div>`
//待评价
}else if (data[i].order_status == "04") {
orderOne = ` <div class="oneOrder">
//待评价
} else if (data[i].order_status == "04") {
orderOne = ` <div class="oneOrder">
<div class="top">
<div class="timeAndOrderId">
<div class="time">${data[i].creat_time}</div>
@ -191,10 +200,11 @@ layui.use(["layer","jquery","element","carousel","table"], function() {
</div>
</div>
</div>`;
}
orderTable += orderOne;
}
orderTable += orderOne;
$(".table-body").html(orderTable);
}
$(".table-body").html(orderTable);
},
error:function () {
}

View File

@ -8,17 +8,26 @@ $.ajax({
userId:userId,
},
success:function (data) {
if (data.length == 0) {
let no = `
<div class="no">
<img src="../../static/img/noLogo.png"/>
<p>没有符合条件的宝贝请尝试其他搜索条件</p>
</div>`;
$(".cart-info").html(no);
} else {
console.log(data);
let cartInfo = "";
for (let i = 0; i < data.length; i++) {
let attribute = data[i].commodity_attribute;
let attributes = attribute.split(",");
let attributesInfo = "";
for (let j = 0; j < attributes.length; j++) {
let one = `<p>${attributes[j]}</p>`;
attributesInfo += one;
}
let oneInfo = `
let attribute = data[i].commodity_attribute;
let attributes = attribute.split(",");
let attributesInfo = "";
for (let j = 0; j < attributes.length; j++) {
let one = `<p>${attributes[j]}</p>`;
attributesInfo += one;
}
let oneInfo = `
<div class="info-one">
<div class="business-name">
<input type="checkbox" class="checkbox">
@ -38,8 +47,8 @@ $.ajax({
<div class="commodity-attribute frame">
<span>修改</span>
<i class="layui-icon layui-icon-edit"></i>`
+attributesInfo+
`
+ attributesInfo +
`
</div>
<div class="commodity-price">
${data[i].commodity_price}
@ -51,7 +60,7 @@ $.ajax({
<div class="addition arithmetic hand-shape">+</div>
</div>
</div>
<div class="commodity-money">`+(data[i].commodity_price*data[i].commodity_amount).toFixed(2)+`</div>
<div class="commodity-money">` + (data[i].commodity_price * data[i].commodity_amount).toFixed(2) + `</div>
<div class="operation">
<p class="selection-text">移入收藏夹</p>
<p class="selection-text">删除</p>
@ -60,10 +69,10 @@ $.ajax({
</div>
</div>
`;
cartInfo += oneInfo;
cartInfo += oneInfo;
}
$(".cart-info").html(cartInfo);
}
$(".cart-info").html(cartInfo);
for (let i = 0; i < data.length; i++) {
//监听数量
let $input = $(".amount:eq("+i+")");

View File

@ -33,38 +33,45 @@ layui.use(['layer',"jquery","element","carousel"], function() {
dataType:"json",
type:"post",
success:function (data) {
let commodityList = '';
for (let i = 0; i < data.length; i++) {
//商品属性
let attribute = data[i].commodity_attribute.split(";");
let attrs = '';
for (let j = 0; j < attribute.length; j++) {
let attributeName = attribute[j].split("");
let attributeText = attributeName[1].split(",");
let texts = '';
for (let k = 0; k < attributeText.length; k++) {
let text = `<option value="0">${attributeText[k]}</option>`;
texts += text;
}
let attr = `<span>${attributeName[0]}:</span>
if (data.length == 0) {
let no = `
<div class="no">
<img src="../../static/img/noLogo.png"/>
<p>没有符合条件的宝贝请尝试其他搜索条件</p>
</div>`;
$(".commodity-list").html(no);
} else {
let commodityList = '';
for (let i = 0; i < data.length; i++) {
//商品属性
let attribute = data[i].commodity_attribute.split(";");
let attrs = '';
for (let j = 0; j < attribute.length; j++) {
let attributeName = attribute[j].split("");
let attributeText = attributeName[1].split(",");
let texts = '';
for (let k = 0; k < attributeText.length; k++) {
let text = `<option value="${attributeText[k]}">${attributeText[k]}</option>`;
texts += text;
}
let attr = `<span>${attributeName[0]}:</span>
<div class="attribute">
<select name="">
<select name="" id="${j}">
<option value="" selected="">请选择</option>
`+texts+`
</select>
</div>`;
attrs += attr;
}
//商品描述
let describes = '';
let commodity_describe = data[i].commodity_describe.split(",");
for (let j = 0; j < commodity_describe.length; j++) {
let describe = `<p>${commodity_describe[j]}</p>`;
describes += describe;
}
let commodity =
`
attrs += attr;
}
//商品描述
let describes = '';
let commodity_describe = data[i].commodity_describe.split(",");
for (let j = 0; j < commodity_describe.length; j++) {
let describe = `<p>${commodity_describe[j]}</p>`;
describes += describe;
}
let commodity =
`
<div class="commodity">
<div class="business-name">
<input type="checkbox" class="checkbox">
@ -91,7 +98,7 @@ layui.use(['layer',"jquery","element","carousel"], function() {
<div class="commodity-amount">
<div class="amount-box">
<div class="subtraction arithmetic hand-shape">-</div>
<input type="text" class="amount" value="1">
<input type="text" class="amount" value="1" readonly="readonly">
<div class="addition arithmetic hand-shape">+</div>
</div>
</div>
@ -101,7 +108,7 @@ layui.use(['layer',"jquery","element","carousel"], function() {
`+describes+`
</div>
<div class="operation">
<p class="selection-text">加入购物车</p>
<p class="selection-text add-to-cart">加入购物车</p>
<p class="selection-text">立即购买</p>
<p class="selection-text">收藏宝贝</p>
<p class="selection-text">举报</p>
@ -109,9 +116,10 @@ layui.use(['layer',"jquery","element","carousel"], function() {
</div>
</div>
`;
commodityList += commodity;
commodityList += commodity;
}
$(".commodity-list").html(commodityList);
}
$(".commodity-list").html(commodityList);
for (let i = 0; i < data.length; i++) {
//监听数量
@ -205,20 +213,30 @@ layui.use(['layer',"jquery","element","carousel"], function() {
}
//加入购物车
$(".add-to-cart").on("click",function () {
//获取属性
let first = $(".commodity-attribute span:eq(0)").text()+""+$("#0").val();
let second = $(".commodity-attribute span:eq(1)").text()+""+$("#1").val();
if ($("#0").val() == "" || $("#0").val() == null) {
layer.msg("请选择第一商品属性")
} else if ($("#1").val() == "" || $("#0").val() == null) {
layer.msg("请选择第二商品属性")
}
})
},
error:function () {
}
})
//加入购物车
$(".operation .selection-text").on("click",function () {
alert(1)
})
//商品浏览
$(".middle .box .search .search-box .search-box-box .search-text").on("click",function () {
$(".iframe-middle",window.parent.document).attr("src","/ebuy/commodity");
sessionStorage.setItem("keyword",$(".search-box-input").val());
})
//保留搜索框的内容
$(".search-box-input").val(sessionStorage.getItem("keyword"));
})

View File

@ -28,7 +28,7 @@ layui.use(['layer',"jquery","element","carousel"], function() {
let typeNum = i.split(",")[1];
let type = "";
for (let j = 0; j < data[i].length; j++) {
let o = `<span>${data[i][j]}</span>`;
let o = `<span class="type">${data[i][j]}</span>`;
type += o;
}
let one = `
@ -57,4 +57,37 @@ layui.use(['layer',"jquery","element","carousel"], function() {
$(".iframe-middle",window.parent.document).attr("src","/ebuy/commodity");
sessionStorage.setItem("keyword",$(".search-box-input").val());
})
//单击类型搜索
$(".type").on("click",function () {
$(".iframe-middle",window.parent.document).attr("src","/ebuy/commodity");
sessionStorage.setItem("keyword",$(this).text());
})
//各状态订单数量
let userInfo = JSON.parse(sessionStorage.getItem("userInfo"));
$.ajax({
url:"/ebuy/orderNumber",
type:"post",
dataType: "json",
data:{
userId: userInfo.user_id
},
success:function (data) {
$(".receiving-num").text(data[2].number)
$(".deliver-num").text(data[1].number)
$(".payment-num").text(data[0].number)
$(".evaluate-num").text(data[3].number)
},
error:function () {
}
})
//订单去个人首页
$(".order div").on("click",function () {
$(".iframe-middle", window.parent.document).attr("src","/ebuy/account");
sessionStorage.setItem("accountTab","personalHomepage");
sessionStorage.setItem("orderStatus",$(this).find("span").text());
})
})

View File

@ -15,11 +15,20 @@ layui.use(["layer","jquery","element","carousel","table"], function() {
orderStatus:"01",
},
success:function (data) {
if (data.length == 0) {
let no = `
<div class="no">
<img src="../../static/img/noLogo.png"/>
<p>没有符合条件的宝贝请尝试其他搜索条件</p>
</div>`;
$(".table-body").html(no);
} else {
orderInfo = data;
let orderTable = "";
for (let i = 0; i < data.length; i++) {
let orderOne = "";
//待付款
let orderOne = "";
//待付款
orderOne = `<div class="oneOrder">
<div class="top">
<div class="timeAndOrderId">
@ -61,9 +70,10 @@ layui.use(["layer","jquery","element","carousel","table"], function() {
</div>
</div>
</div>`;
orderTable += orderOne;
orderTable += orderOne;
}
$(".table-body").html(orderTable);
}
$(".table-body").html(orderTable);
},
error:function () {
}

View File

@ -5,4 +5,28 @@ layui.use(['layer',"jquery","element","carousel"], function() {
, element = layui.element
, carousel = layui.carousel;
//获取订单类型
let orderStatus = sessionStorage.getItem("orderStatus");
if (orderStatus == '待付款') {
$(".layui-tab-item").removeClass("layui-show");
$(".layui-tab-content div:eq(1)").addClass("layui-show");
$(".layui-tab-title li").removeClass("layui-this");
$(".layui-tab-title li:eq(1)").addClass("layui-this");
} else if (orderStatus == '待发货') {
$(".layui-tab-item").removeClass("layui-show");
$(".layui-tab-content div:eq(2)").addClass("layui-show")
$(".layui-tab-title li").removeClass("layui-this");
$(".layui-tab-title li:eq(2)").addClass("layui-this");
} else if (orderStatus == '待收货') {
$(".layui-tab-item").removeClass("layui-show");
$(".layui-tab-content div:eq(3)").addClass("layui-show")
$(".layui-tab-title li").removeClass("layui-this");
$(".layui-tab-title li:eq(3)").addClass("layui-this");
} else if (orderStatus == '待评价') {
$(".layui-tab-item").removeClass("layui-show");
$(".layui-tab-content div:eq(4)").addClass("layui-show")
$(".layui-tab-title li").removeClass("layui-this");
$(".layui-tab-title li:eq(4)").addClass("layui-this");
}
})

View File

@ -15,12 +15,20 @@ layui.use(["layer","jquery","element","carousel","table"], function() {
orderStatus:"04",
},
success:function (data) {
orderInfo = data;
let orderTable = "";
for (let i = 0; i < data.length; i++) {
let orderOne = "";
//待评价
orderOne = ` <div class="oneOrder">
if (data.length == 0) {
let no = `
<div class="no">
<img src="../../static/img/noLogo.png"/>
<p>没有符合条件的宝贝请尝试其他搜索条件</p>
</div>`;
$(".table-body").html(no);
} else {
orderInfo = data;
let orderTable = "";
for (let i = 0; i < data.length; i++) {
let orderOne = "";
//待评价
orderOne = ` <div class="oneOrder">
<div class="top">
<div class="timeAndOrderId">
<div class="time">${data[i].creat_time}</div>
@ -61,9 +69,10 @@ layui.use(["layer","jquery","element","carousel","table"], function() {
</div>
</div>
</div>`;
orderTable += orderOne;
orderTable += orderOne;
}
$(".table-body").html(orderTable);
}
$(".table-body").html(orderTable);
},
error:function () {
}

View File

@ -15,12 +15,21 @@ layui.use(["layer","jquery","element","carousel","table"], function() {
orderStatus:"03",
},
success:function (data) {
if (data.length == 0) {
let no = `
<div class="no">
<img src="../../static/img/noLogo.png"/>
<p>没有符合条件的宝贝请尝试其他搜索条件</p>
</div>`;
$(".table-body").html(no);
} else {
orderInfo = data;
let orderTable = "";
for (let i = 0; i < data.length; i++) {
let orderOne = "";
//待收货
orderOne = `<div class="oneOrder">
let orderOne = "";
//待收货
orderOne = `<div class="oneOrder">
<div class="top">
<div class="timeAndOrderId">
<div class="time">${data[i].creat_time}</div>
@ -63,9 +72,10 @@ layui.use(["layer","jquery","element","carousel","table"], function() {
</div>
</div>
</div>`
orderTable += orderOne;
orderTable += orderOne;
}
$(".table-body").html(orderTable);
}
$(".table-body").html(orderTable);
},
error:function () {
}

View File

@ -15,12 +15,21 @@ layui.use(["layer","jquery","element","carousel","table"], function() {
orderStatus:"02",
},
success:function (data) {
if (data.length == 0) {
let no = `
<div class="no">
<img src="../../static/img/noLogo.png"/>
<p>没有符合条件的宝贝请尝试其他搜索条件</p>
</div>`;
$(".table-body").html(no);
} else {
orderInfo = data;
let orderTable = "";
for (let i = 0; i < data.length; i++) {
let orderOne = "";
//待发货
orderOne = `<div class="oneOrder">
let orderOne = "";
//待发货
orderOne = `<div class="oneOrder">
<div class="top">
<div class="timeAndOrderId">
<div class="time">${data[i].creat_time}</div>
@ -58,9 +67,10 @@ layui.use(["layer","jquery","element","carousel","table"], function() {
</div>
</div>
</div>`
orderTable += orderOne;
orderTable += orderOne;
}
$(".table-body").html(orderTable);
}
$(".table-body").html(orderTable);
},
error:function () {
}