会员中心添加首页按钮,pclogo改为阿里云地址,编辑折扣券没有传折扣值,

This commit is contained in:
mabo
2021-07-21 15:27:39 +08:00
parent f512caa81d
commit 75bff1edc4
30 changed files with 490 additions and 903 deletions

View File

@@ -1,46 +1,42 @@
<template>
<div class="search">
<Card>
<Row @keydown.enter.native="handleSearch">
<Form
ref="searchForm"
:model="searchForm"
inline
:label-width="70"
class="search-form"
>
<Form-item label="商品名称" prop="goodsName">
<Input
type="text"
v-model="searchForm.goodsName"
placeholder="请输入商品名称"
clearable
style="width: 200px"
/>
</Form-item>
<Form-item label="商品编号" prop="sn">
<Input
type="text"
v-model="searchForm.sn"
placeholder="请输入商品编号"
clearable
style="width: 200px"
/>
</Form-item>
<Button @click="handleSearch" class="search-btn" type="primary" icon="ios-search" >搜索</Button>
</Form>
</Row>
<Form
ref="searchForm"
@keydown.enter.native="handleSearch"
:model="searchForm"
inline
:label-width="70"
class="search-form"
>
<Form-item label="商品名称" prop="goodsName">
<Input
type="text"
v-model="searchForm.goodsName"
placeholder="请输入商品名称"
clearable
style="width: 200px"
/>
</Form-item>
<Form-item label="商品编号" prop="sn">
<Input
type="text"
v-model="searchForm.sn"
placeholder="请输入商品编号"
clearable
style="width: 200px"
/>
</Form-item>
<Button @click="handleSearch" class="search-btn" type="primary" icon="ios-search" >搜索</Button>
</Form>
<Table
:loading="loading"
border
:columns="columns"
:data="data"
ref="table"
sortable="custom"
@on-sort-change="changeSort"
@on-selection-change="changeSelect"
class="mt_10"
>
<!-- 商品栏目格式化 -->
<template slot="goodsSlot" slot-scope="scope">
<div style="margin-top: 5px;height: 80px; display: flex;">
@@ -85,7 +81,6 @@
return {
id: "", //要操作的id
loading: true, // 表单加载状态
modalType: 0, // 添加或编辑标识
searchForm: {
// 搜索框初始化对象
pageNumber: 1, // 当前页数
@@ -93,15 +88,9 @@
sort: "create_time", // 默认排序字段
order: "desc", // 默认排序方式
},
underForm: { // 下架原因
reason: "",
},
goodsAuditForm: { // 商品编辑表单
is_auth: 1,
},
submitLoading: false, // 添加或编辑提交状态
selectList: [], // 多选数据
selectCount: 0, // 多选计数
columns: [
{
title: "商品名称",
@@ -252,7 +241,6 @@
changePage(v) { // 改变页码
this.searchForm.pageNumber = v;
this.getDataList();
this.clearSelectAll();
},
changePageSize(v) { // 改变每页数量
this.searchForm.pageSize = v;
@@ -263,21 +251,6 @@
this.searchForm.pageSize = 10;
this.getDataList();
},
changeSort(e) { // 排序
this.searchForm.sort = e.key;
this.searchForm.order = e.order;
if (e.order === "normal") {
this.searchForm.order = "";
}
this.getDataList();
},
clearSelectAll() { // 取消全部选中
this.$refs.table.selectAll(false);
},
changeSelect(e) { // 选中一项
this.selectList = e;
this.selectCount = e.length;
},
getDataList() { // 获取列表数据
this.loading = true;
// 带多条件搜索参数获取表单数据
@@ -312,8 +285,6 @@
},
});
},
//查看商品详情
showDetail(v) {
let id = v.id;

View File

@@ -1,381 +0,0 @@
/*选择商品品类*/
.content-goods-publish {
padding: 15px;
padding-bottom: 50px;
margin: 0 auto;
text-align: center;
border: 1px solid #ddd;
background: none repeat 0 0 #fff;
/*商品品类*/
.goods-category {
text-align: left;
padding: 10px;
background: #fafafa;
border: 1px solid #e6e6e6;
ul {
padding: 8px 4px 8px 8px;
list-style: none;
width: 300px;
background: none repeat 0 0 #fff;
border: 1px solid #e6e6e6;
display: inline-block;
letter-spacing: normal;
margin-right: 15px;
vertical-align: top;
word-spacing: normal;
li {
line-height: 20px;
padding: 5px;
cursor: pointer;
color: #333;
font-size: 12px;
display: flex;
flex-wrap: nowrap;
flex-direction: row;
justify-content: space-between;
align-items: center;
}
}
}
/** 当前品类被选中的样式 */
.activeClass {
background-color: #d9edf7;
border: 1px solid #bce8f1;
color: #3a87ad;
}
/*!*当前选择的商品品类文字*!*/
.current-goods-category {
text-align: left;
padding: 10px;
width: 100%;
border: 1px solid #fbeed5;
color: #c09853;
background-color: #fcf8e3;
margin: 10px auto;
padding: 8px 35px 8px 14px;
text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
font-size: 12px;
font-weight: bold;
}
}
/*编辑基本信息*/
.el-form {
padding-bottom: 80px;
.el-form-item {
width: 100%;
text-align: left;
}
}
/*平铺*/
div.base-info-item>div {
margin-left: 5%;
}
div.base-info-item {
h4 {
margin-bottom: 10px;
padding: 0 10px;
border: 1px solid #ddd;
background-color: #f8f8f8;
font-weight: bold;
color: #333;
font-size: 14px;
line-height: 40px;
text-align: left;
}
.form-item-view {
display: flex;
flex-direction: column;
align-items: flex-start;
justify-content: space-between;
padding-left: 80px;
.layout {
margin-bottom: 20px;
.sku-item-content {
display: flex;
flex-direction: column;
align-items: flex-start;
justify-content: center;
width: 100%;
.sku-item-content-name {
display: flex;
align-items: flex-start;
width: 100%;
}
}
}
.shop-category-text {
font-size: 12px;
}
}
.form-item-view-bottom {
margin-bottom: 50px;
}
.item-goods-properts-row {
display: flex;
flex-direction: row;
word-break: break-all;
white-space: normal;
width: 300px;
height: 100px;
}
.item-goods-properts {
display: flex;
flex-direction: row;
margin-bottom: 10px;
}
.form-item {
display: flex;
align-items: center;
}
/** 审核信息-拒绝原因 */
.auth-info {
color: red;
}
.el-form-item {
width: 30%;
min-width: 300px;
}
.goods-name-width {
width: 50%;
min-width: 300px;
}
.el-form-item__content {
margin-left: 120px;
text-align: left;
}
p.goods-group-manager {
padding-left: 7.5%;
text-align: left;
color: #999;
font-size: 13px;
}
/*teatarea*/
/deep/ .el-textarea {
width: 150%;
}
.seo-text {
width: 150%;
}
}
/*折叠面板*/
.el-collapse-item {
/deep/ .el-collapse-item__header {
text-align: left;
background-color: #f8f8f8;
padding: 0 10px;
font-weight: bold;
color: #333;
font-size: 14px;
}
.el-form-item {
margin-left: 5%;
width: 25%;
}
/deep/ .el-form-item__content {
margin-left: 120px;
text-align: left;
}
p.goods-group-manager {
padding-left: 12%;
text-align: left;
color: #999;
}
/deep/ .el-collapse-item__content {
padding: 10px 0;
text-align: left;
}
}
/*商品描述*/
.goods-intro {
line-height: 40;
}
/** 底部步骤 */
.footer {
width: 88.7%;
padding: 10px;
background-color: #ffc;
position: fixed;
bottom: 0px;
left: 10%;
text-align: center;
z-index: 9999;
}
/*图片上传组件第一张图设置封面*/
.goods-images {
/deep/ li.el-upload-list__item:first-child {
position: relative;
}
/deep/ li.el-upload-list__item:first-child:after {
content: "";
color: #fff;
font-weight: bold;
font-size: 12px;
position: absolute;
left: -15px;
top: -6px;
width: 40px;
height: 24px;
padding-top: 6px;
background: #13ce66;
text-align: center;
-webkit-transform: rotate(-45deg);
transform: rotate(-45deg);
-webkit-box-shadow: 0 0 1pc 1px rgba(0, 0, 0, 0.2);
box-shadow: 0 0 1pc 1px rgba(0, 0, 0, 0.2);
}
}
.el-form-item__label {
word-break: break-all;
}
.step-view {
width: 33%;
height: 40px;
font-size: 19px;
text-align: center;
display: flex;
background-color: #fff;
justify-content: center;
align-items: center;
}
.add-sku-btn {
margin-top: 10px;
}
.sku-item:not(:first-child) {
margin-top: 10px;
}
.sku-upload-list {
display: inline-block;
width: 60px;
height: 60px;
text-align: center;
line-height: 60px;
border: 1px solid transparent;
border-radius: 4px;
overflow: hidden;
background: #fff;
position: relative;
box-shadow: 0 1px 1px rgba(0, 0, 0, .2);
margin-right: 4px;
}
.preview-picture {
width: 100%;
margin: 0 auto;
display: block;
// text-align: center;
border: 1px solid transparent;
// justify-self: center;
// align-self: center;
}
.preview-picture img {
width: 100%;
height: 100%;
}
.sku-upload-list img {
width: 100%;
height: 100%;
}
.sku-upload-list-cover {
display: none;
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
background: rgba(0, 0, 0, .6);
}
.sku-upload-list:hover .sku-upload-list-cover {
display: block;
}
.sku-upload-list-cover i {
color: #fff;
font-size: 20px;
cursor: pointer;
margin: 0 2px;
}
.demo-upload-list{
display: inline-block;
width: 60px;
height: 60px;
text-align: center;
line-height: 60px;
border: 1px solid transparent;
border-radius: 4px;
overflow: hidden;
background: #fff;
position: relative;
box-shadow: 0 1px 1px rgba(0,0,0,.2);
margin-right: 4px;
}
.demo-upload-list img{
width: 100%;
height: 100%;
}
.demo-upload-list-cover{
display: none;
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
background: rgba(0,0,0,.6);
}
.demo-upload-list:hover .demo-upload-list-cover{
display: block;
}
.demo-upload-list-cover i{
color: #fff;
font-size: 20px;
cursor: pointer;
margin: 0 2px;
}

View File

@@ -1,62 +1,35 @@
<template>
<div>
<Form
:label-width="120"
>
<div class="content-goods-publish">
<Form :label-width="120">
<Card>
<div class="base-info-item">
<h4>基本信息</h4>
<div class="form-item-view">
<FormItem label="商品分类">
<span v-for="item in goods.categoryName"> {{ item }} > </span>
<span v-for="(item,index) in goods.categoryName" :key="index"> {{ item }} <i v-if="index !== (goods.categoryName.length-1)">&gt;</i> </span>
</FormItem>
<FormItem label="商品名称" prop="goodsName">
<FormItem label="商品名称">
{{ goods.goodsName }}
</FormItem>
<FormItem label="商品卖点" prop="sellingPoint">
<FormItem label="商品卖点">
{{ goods.sellingPoint }}
</FormItem>
</div>
<h4>商品交易信息</h4>
<div class="form-item-view">
<FormItem
class="form-item-view-el"
label="计量单位"
prop="goodsUnit"
> {{ goods.goodsUnit }}
</FormItem>
<FormItem
class="form-item-view-el"
label="销售模式"
prop="salesModel"
>
<FormItem label="计量单位"> {{ goods.goodsUnit }}</FormItem>
<FormItem label="销售模式">
{{ goods.salesModel === 'RETAIL' ? '零售型' : '批发型' }}
</FormItem>
</div>
<h4>商品规格及图片</h4>
<div class="form-item-view">
<FormItem label="商品编号" prop="sn">
{{ goods.sn }}
</FormItem>
<FormItem label="商品价格" prop="price">
¥{{ goods.price | unitPrice }}
</FormItem>
<FormItem label="市场价格" prop="cost">
¥{{ goods.cost | unitPrice }}
</FormItem>
<FormItem
class="form-item-view-el"
label="商品图片"
prop="goodsGalleryFiles"
>
<div
class="demo-upload-list"
v-for="(item, __index) in goods.goodsGalleryList"
:key="__index"
>
<FormItem label="商品编号"> {{ goods.sn }}</FormItem>
<FormItem label="商品价格"> ¥{{ goods.price | unitPrice }} </FormItem>
<FormItem label="市场价格"> ¥{{ goods.cost | unitPrice }} </FormItem>
<FormItem label="商品图片">
<div class="demo-upload-list" v-for="(item, __index) in goods.goodsGalleryList" :key="__index">
<img :src="item"/>
<div class="demo-upload-list-cover">
<Icon
@@ -64,7 +37,6 @@
@click.native="handleViewGoodsPicture(item)"
></Icon>
</div>
<Modal title="View Image" v-model="goodsPictureVisible">
<img
:src="previewGoodsPicture"
@@ -73,70 +45,50 @@
/>
</Modal>
</div>
</FormItem>
<FormItem
class="form-item-view-el"
label="商品规格"
>
<FormItem label="商品规格">
<Table :columns="skuColumn" :data="skuData">
<!-- 商品栏目格式化 -->
<template slot="showImage" slot-scope="scope">
<div style="margin-top: 5px;height: 80px; display: flex;">
<div style="">
<div>
<img :src="scope.row.image" style="height: 60px;margin-top: 1px;width: 60px">
</div>
</div>
</template>
</Table>
</FormItem>
</div>
<h4>商品详情描述</h4>
<div class="form-item-view">
<FormItem class="form-item-view-el" label="商品描述" prop="intro">
<FormItem label="商品描述">
<div v-html="goods.intro"></div>
</FormItem>
<FormItem
class="form-item-view-el"
label="移动端描述"
prop="skuList"
>
<div v-html="goods.mobileIntro"></div>
</FormItem>
</div>
<h4>商品物流信息</h4>
<div class="form-item-view">
<FormItem class="form-item-view-el" label="商品重量" prop="weight">
<FormItem label="商品重量">
<Input v-model="goods.weight">
<span slot="append">kg</span>
</Input>
</FormItem>
</div>
</div>
</div>
</Card>
</Form>
</div>
</template>
<script>
import {getGoodsDetail} from "@/api/goods";
export default {
name: "goodsDetail",
data() {
return {
goods: '', // 商品信息
goods: {}, // 商品信息
previewGoodsPicture: '', // 预览图片
goodsPictureVisible: false, // 预览图片模态框
skuColumn: [ // 规格表头
@@ -149,7 +101,7 @@ export default {
key: 'sn'
},
{
title: '重量',
title: '重量(kg)',
key: 'weight'
},
{
@@ -173,12 +125,12 @@ export default {
}
,
methods: {
// 初始化数据,获取商品详情
initGoods(id) {
getGoodsDetail(id).then(res => {
this.goods = res.result;
let that = this
res.result.skuList.forEach(function (sku, index, array) {
console.log(sku)
that.skuData.push({
'specs': sku.goodsName,
'sn': sku.sn,
@@ -191,9 +143,8 @@ export default {
console.warn(this.skuData)
});
}
,
},
// 预览商品图片
handleViewGoodsPicture(url) {
this.previewGoodsPicture = url;
this.goodsPictureVisible = true;
@@ -207,8 +158,61 @@ export default {
</script>
<style lang="scss" soped>
@import "./goodsDetail.scss";
/*平铺*/
div.base-info-item {
h4 {
margin-bottom: 10px;
padding: 0 10px;
border: 1px solid #ddd;
background-color: #f8f8f8;
font-weight: bold;
color: #333;
font-size: 14px;
line-height: 40px;
text-align: left;
}
.form-item-view {
padding-left: 80px;
}
}
.demo-upload-list{
display: inline-block;
width: 60px;
height: 60px;
text-align: center;
line-height: 60px;
border: 1px solid transparent;
border-radius: 4px;
overflow: hidden;
background: #fff;
position: relative;
box-shadow: 0 1px 1px rgba(0,0,0,.2);
margin-right: 4px;
}
.demo-upload-list img{
width: 100%;
height: 100%;
}
.demo-upload-list-cover{
display: none;
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
background: rgba(0,0,0,.6);
}
.demo-upload-list:hover .demo-upload-list-cover{
display: block;
}
.demo-upload-list-cover i{
color: #fff;
font-size: 20px;
cursor: pointer;
margin: 0 2px;
}
.ivu-table table {
width: 100% !important;
}