提交 98d3fd21 authored 作者: 潘鹏's avatar 潘鹏

4-11

上级 e338f331
......@@ -10,7 +10,6 @@ import com.platform.service.PostService;
import com.platform.utils.IdUtil;
import com.platform.utils.ShiroUtils;
import com.platform.vo.PostVo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -29,7 +28,7 @@ import static com.platform.utils.ShiroUtils.getUserId;
* @author lipengjun
* @date 2020-06-17 11:02:21
*/
@Slf4j
@Service("postService")
public class PostServiceImpl implements PostService {
@Autowired
......@@ -94,7 +93,7 @@ public class PostServiceImpl implements PostService {
post.setCategory(URLDecoder.decode(post.getCategory(), "utf-8"));
res = postDao.save(post);
} catch (Exception e) {
log.info(e.getMessage());
}
return res;
}
......@@ -113,7 +112,7 @@ public class PostServiceImpl implements PostService {
post.setCategory(URLDecoder.decode(post.getCategory(), "utf-8"));
res = postDao.update(post);
} catch (Exception e) {
log.info(e.getMessage());
}
return res;
}
......
package com.platform.vo;
import com.platform.entity.PostEntity;
import lombok.Data;
/**
* @Auther: wudepeng
......
......@@ -3,6 +3,99 @@
<head>
<title></title>
#parse("sys/header.html")
<style>
.tag-wrapper li{
display: inline-block;
padding:4px 16px;
border-radius: 4px;
border: 1px solid grey;
line-height: 16px;
margin-right:8px;
}
.tag-wrapper .add-tag-btn{
cursor: pointer;
color:white;
border: 1px solid #2db7f5;
background: #2db7f5;
}
.modal-wrapper{
position: fixed;
width:100vw;
height:100vh;
top:0;
left:0;
z-index: 1000;
}
.modal-bg{
position: absolute;
width:100vw;
height:100vh;
top:0;
left:0;
background: #000;
opacity: 0.5;
}
.modal-container{
position: absolute;
width:800px;
height:600px;
left:50%;
top:50%;
transform: translate(-50%,-50%);
border-radius: 6px;
background: white;
padding:50px 14px 14px 14px;
}
.modal-container .modal-close{
position: absolute;
right: 18px;
top:18px;
font-size: 20px;
cursor: pointer;
}
.tag-search{
display: flex;
}
.tag-search>:first-child{
margin-right: 10px;
}
.tag-search-result{
height:450px;
overflow: auto;
}
.bottom-btn-group{
float: right;
}
.product-container >ul li{
border-radius: 4px;
cursor: pointer;
text-align: center;
display: flex;
align-items: center;
justify-content: center;
}
.product-container >ul>.add-product{
width:120px;
height: 120px;
border:1px solid #dddee1
}
.productList-style-start{
display: flex;
justify-content: start;
}
.search{
display: flex;
justify-content: start;
}
.search>button{
margin-left:10px;
}
#showItems{
height:380px;
margin:15px 0;
}
</style>
</head>
<body>
<div id="rrapp" v-cloak style="height: calc(100% - 15px);">
......@@ -86,6 +179,101 @@
</div>
</div>
</Form-item>
<Form-item label="商品图片">
<div class="product-container">
<ul>
<li class="add-product" @click="isShownProductMadal = true">
+添加产品
</li>
</ul>
<p>限制最大可添加6个规格<br/>
上传图片的最佳尺寸:720像素*720像素,其他尺寸会影响页效果,格式png,jpeg,jpg,gif。大小不超过2M,商品图片一共可以上传6张,默认第一张为主图封面
</p>
<div class="modal-wrapper" v-show="isShownProductMadal">
<div class="modal-bg"></div>
<div class="modal-container">
<i @click="isShownProductMadal = false">
<Icon type="close" class="modal-close" ></Icon>
</i>
<div class="productList-style-start">
<div>
<span>一级分类</span>
<i-Select v-model="commoditycategoryListsActive1" style="width:100px" @on-change="changeSubCateType">
<i-Option v-for="item in commodityCategoryLists1" :value="item.value" :key="item.value">{{ item.label }}</i-Option>
</i-Select>
</div>
<div>
<span style="margin-left:20px;" >二级分类</span>
<i-Select v-model="commoditycategoryListsActive2" @on-change="queryMiniCatagory(3)" style="width:100px">
<i-Option v-for="item in commodityCategoryLists2" :value="item.value" :key="item.value">{{ item.label }}</i-Option>
</i-Select>
</div>
<div>
<span style="margin-left:20px;" >三级分类</span>
<i-Select v-model="commoditycategoryListsActive3" style="width:100px">
<i-Option v-for="item in commodityCategoryLists3" :value="item.value" :key="item.value">{{ item.label }}</i-Option>
</i-Select>
</div>
</div>
<div class="search" style="margin-top:20px;">
<div>
<i-Input
v-model="productSearch"
placeholder="请输入搜索内容(可选)"
style="width:500px;" />
</div>
<i-Button
type="primary"
style="width:100px;"
@click='handleSearchProduct()'
>搜索</i-Button>
<i-Button style="width:100px;" >重置</i-Button>
</div>
<section id="showItems">
<table id="searchjqGrid"></table>
</section>
<div class="bottom-btn-group">
<i-button type="success" @click="isShownProductMadal = false">确认</i-button>
<i-button type="warning" @click="isShownProductMadal = false">取消</i-button>
</div>
</div>
</div>
</div>
</Form-item>
<Form-item label="标签">
<ul class="tag-wrapper">
<li>#af</li>
<li class="add-tag-btn" @click="isShownTagMadal = true">+添加标签</li>
</ul>
<div class="modal-wrapper" v-show="isShownTagMadal">
<div class="modal-bg"></div>
<div class="modal-container">
<i @click="isShownTagMadal = false">
<Icon type="close" class="modal-close" ></Icon>
</i>
<div class="tag-search">
<i-input v-model="tagSearchValue" placeholder="请输入搜索的标签..." icon="close" @on-click="tagSearchValue=''" ></i-input>
<i-button type="info">搜索</i-button>
</div>
<ul class="tag-wrapper tag-search-result" style="margin-top:10px;">
<li v-for="el in 100">
<p>#shoe</p>
<p>192POST</p>
</li>
</ul>
<div class="bottom-btn-group">
<i-button type="success" @click="isShownTagMadal = false">确认</i-button>
<i-button type="warning" @click="isShownTagMadal = false">取消</i-button>
</div>
</div>
</div>
</Form-item>
<Form-item label="文章内容" prop="content">
<!-- <script id="Detail" name="tbCfVersion.versionDetail"type="text/plain">${pd.COLLSORT_DETAILS}</script>-->
<textarea id="content" style="width: 800px;height: 600px;"></textarea>
......
......@@ -35,8 +35,12 @@ $(function () {
});
});
let vm = new Vue({
el: '#rrapp',
components:{
},
data: {
uploadList: [],
account: true,
......@@ -66,9 +70,107 @@ let vm = new Vue({
title: '',
author: '',
topic: ''
},
isShownTagMadal:false,
tagSearchValue:"",
isShownProductMadal:false,
productSearch:'',
commodityCategoryLists1: [
{
value: '商品一级',
label: '商品一级'
}
],
commoditycategoryListsActive1: null,
//二级
commodityCategoryLists2: [
{
value: '商品二级',
label: '商品二级'
}
],
commoditycategoryListsActive2: null,
//三级
commodityCategoryLists3: [
{
value: '商品三级',
label: '商品三级'
}
],
commoditycategoryListsActive3: null,
},
methods: {
handleSearchProduct(e){
1==1 ? (()=>{
$('#showItems').children().remove();
$('#showItems').append(`<table id="searchjqGrid"></table>`);
function beforeSelectRow(){
$("#searchjqGrid").jqGrid('resetSelection');
return(true);
}
let _this = this;
$(function () {
$("#searchjqGrid").Grid({
url: `../tbcfstationitem/list?itemCategory=${_this.commoditycategoryListsActive1||''}&typeTwo=${_this.commoditycategoryListsActive2||''}&typeThree=${_this.commoditycategoryListsActive3||''}&name=${vm.productSearch||e||''}`,
colModel: [
{label: 'itemId', name: 'itemId', index: 'item_id', key: true, hidden: true},
{label: '商品图片', name: 'itemImg', index: 'item_img', width: 50, formatter: imageFormat},
{label: '商品编号', name: 'itemCode', index: 'item_code', width: 160},
{label: '商品名称', name: 'itemName', index: 'item_name', width: 160},
/* {label: '商品标题', name: 'itemBrief', index: 'item_brief', width: 120},*/
/*{label: '商品链接', name: 'itemUrl', index: 'item_url', width: 80,formatter:linkFormat},*/
{label: '商品原价', name: 'itemPrice', index: 'item_price', width: 65},
{label: '商品现价', name: 'discountPrice', index: 'discount_price', width: 55},
{label: '库存', name: 'itemCount', index: 'item_count', width: 55},
{label: '点击量', name: 'itemNum', index: 'item_num', width: 55},
/*{label: '所属平台', name: 'platformCode', index: 'platform_code', width: 80},
{label: '平台名', name: 'platformName', index: 'platform_name', width: 80},*/
{label: '供应商', name: 'supplier', index: 'supplier', width: 80},
{label: '商品一级分类', name: 'goodtype', index: 'goodtype', width: 80},
{label: '商品二级分类', name: 'title', index: 'title', width: 80},
{label: '商品品名', name: 'dname', index: 'itemDescritionId', width: 120},
{label: '状态', name: 'enableFlag', index: 'enable_flag', width: 120, formatter: itemStatusFormat},
{label: '创建日期', name: 'createTime', index: 'create_time', width: 160}
],
multiselect: true,
multiboxonly:true,
beforeSelectRow: beforeSelectRow,
});
});
})() : alert('未输入搜索内容~');
},
//查询二级分类
changeSubCateType(){
this.commodityCategoryLists2 = [];
$.get('../tbcfstationitem/queryByItemType?typeId=' + this.commoditycategoryListsActive1, res => {
let _res = JSON.parse(res);
_res.code === 0 ? (() => {
_res.list.forEach((item) => {
this.commodityCategoryLists2.push({
label: item.goodstwotypeTitle,
value: item.goodstwotypeId
})
})
})() : null
})
},
//查询三级分类
queryMiniCatagory(){
$.get('../tbcfstationitem/queryByItemTypeTwo?typeTwoId=' + this.commoditycategoryListsActive2, res => {
this.commodityCategoryLists3 = [];
let _res = JSON.parse(res);
_res.code === 0 ? (() => {
_res.descripiton.forEach((item) => {
this.commodityCategoryLists3.push({
label: item.descripitionName,
value: item.descripitionId
})
})
})() : null
})
},
placedTop: function (id) {
let url = '../post/placedPostTop/' + id;
Ajax.request({
......@@ -320,5 +422,19 @@ let vm = new Vue({
handleReset: function (name) {
handleResetForm(this, name);
}
},
created(){
//获取分类子页面一级分类数据
$.get('../tbcfgoodstype/queryAll', res => {
res.code === 0 ? (() => {
this.commodityCategoryLists1 = [];
res.list.forEach((item) => {
this.commodityCategoryLists1.push({
label: item.goodstypeTitle,
value: item.goodstypeId
});
})
})() : null
})
}
});
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论