合并部分代码 回滚规格

master
lemon橪 2022-02-16 11:22:35 +08:00
commit 0994b6659a
27 changed files with 606 additions and 627 deletions

View File

@ -1 +1 @@
docker build -t registry.cn-beijing.aliyuncs.com/lili-images/buyer-ui:4.3.0.1 . docker build -t registry.cn-beijing.aliyuncs.com/lili-images/buyer-ui:4.2.4.1 .

View File

@ -3,10 +3,10 @@ var BASE = {
* @description api请求基础路径 * @description api请求基础路径
*/ */
API_DEV: { API_DEV: {
seller: "http://127.0.0.1:8889", common: "https://common-api.pickmall.cn",
manager: "http://127.0.0.1:8887", buyer: "https://buyer-api.pickmall.cn",
buyer: "http://127.0.0.1:8888", seller: "https://store-api.pickmall.cn",
common: "http://127.0.0.1:8890", manager: "https://admin-api.pickmall.cn"
}, },
API_PROD: { API_PROD: {
common: "https://common-api.pickmall.cn", common: "https://common-api.pickmall.cn",

View File

@ -10,7 +10,7 @@ $warning_color: #ff9900;
$error_color: #ed3f14; $error_color: #ed3f14;
$handle-btn-color: #438cde; $handle-btn-color: #438cde;
$theme_color: #ff5c58; $theme_color: #e4393c;
$border_color: #dddee1; $border_color: #dddee1;
$title_color: #8c8c8c; $title_color: #8c8c8c;

View File

@ -147,9 +147,11 @@ export default {
cursor: pointer; cursor: pointer;
} }
.store-search{ .store-search{
width:63px;
padding: 0 9px; padding: 0 9px;
border-radius: 0; border-radius: 0;
&:nth-child(2){ &:nth-child(2){
width:62px;
margin-left: -5px; margin-left: -5px;
} }
} }

View File

@ -43,7 +43,7 @@
{{config.icpCard}} {{config.icpCard}}
</a> </a>
</li> </li>
<li v-if="config.icpMessage"> <li v-if="config.icpMessage" class="footer-bottmom">
<a href="https://beian.miit.gov.cn/" target="_blank"> <a href="https://beian.miit.gov.cn/" target="_blank">
{{config.icpMessage}} {{config.icpMessage}}
</a> </a>
@ -51,7 +51,7 @@
</div> </div>
</div> </div>
<div class="information"> <div class="information footer-bottmom">
<a class="flex " :href="config.company.href"> <a class="flex " :href="config.company.href">
<img class="zhizhao" src="@/assets/images/zhizhao.jpg" mode="" />{{config.company.name}} <img class="zhizhao" src="@/assets/images/zhizhao.jpg" mode="" />{{config.company.name}}
@ -173,12 +173,19 @@ export default {
cursor: pointer; cursor: pointer;
line-height: 26px; line-height: 26px;
} }
.servece-type-info li:hover{
color:#b8b8be;
}
.servece-type-info li:first-child { .servece-type-info li:first-child {
font-size: 16px; font-size: 16px;
line-height: 28px; line-height: 28px;
font-weight: bold; font-weight: bold;
} }
.servece-type-info li:first-child:hover{
// font-size:15px;
// font-weight: bold;
color:#b8b8be;
}
.friend-link { .friend-link {
display: flex; display: flex;
align-items: flex-start; align-items: flex-start;
@ -207,6 +214,17 @@ export default {
padding: 5px 0px; padding: 5px 0px;
float: left; float: left;
} }
.friend-link-item li:hover{
color:#b8b8be;
margin-top:-2px;
}
.footer-bottmom:hover{
margin-top:0 !important;
}
.footer-bottmom>a:hover{
color:#e4393c;
}
.link-item { .link-item {
padding: 0px 8px; padding: 0px 8px;
cursor: pointer; cursor: pointer;

View File

@ -61,12 +61,9 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
.content { .content {
width: 1200px; width: 1200px;
height: 100%; height: 40px;
margin: auto; margin: 10px auto;
position: fixed; position: relative;
top: 0;
left: 50%;
margin-left: -600px;
} }
.cate { .cate {
float: left; float: left;

View File

@ -2,13 +2,19 @@
<div class="model-item" v-if="element && element.key"> <div class="model-item" v-if="element && element.key">
<!-- 轮播图模块包括个人信息快捷导航模块 --> <!-- 轮播图模块包括个人信息快捷导航模块 -->
<template v-if="element.type == 'carousel'"> <template v-if="element.type == 'carousel'">
<model-carousel :data="element" class="mb_20 width_1200_auto"></model-carousel> <model-carousel
:data="element"
class="mb_20 width_1200_auto"
></model-carousel>
</template> </template>
<template v-if="element.type == 'carousel1'"> <template v-if="element.type == 'carousel1'">
<model-carousel1 :data="element" class="mb_20"></model-carousel1> <model-carousel1 :data="element" class="mb_20"></model-carousel1>
</template> </template>
<template v-if="element.type == 'carousel2'"> <template v-if="element.type == 'carousel2'">
<model-carousel2 :data="element" class="mb_20 width_1200_auto"></model-carousel2> <model-carousel2
:data="element"
class="mb_20 width_1200_auto"
></model-carousel2>
</template> </template>
<!-- 热门广告 --> <!-- 热门广告 -->
<template v-if="element.type == 'hotAdvert'"> <template v-if="element.type == 'hotAdvert'">
@ -37,13 +43,16 @@
</template> </template>
<!-- 限时秒杀 待完善 --> <!-- 限时秒杀 待完善 -->
<template v-if="element.type == 'seckill' && element.options.list.length"> <template v-if="element.type == 'seckill' && element.options.list.length">
<seckill :data="element" class="mb_20 width_1200_auto"></seckill> <seckill :data="element" class="mb_20 width_1200_auto"></seckill>
</template> </template>
<!-- 折扣广告 --> <!-- 折扣广告 -->
<template v-if="element.type == 'discountAdvert'"> <template v-if="element.type == 'discountAdvert'">
<div <div
class="discountAdvert" class="discountAdvert"
:style="{'backgroundImage' :'url(' + require('@/assets/images/decorate.png') + ')'}" :style="{
backgroundImage:
'url(' + require('@/assets/images/decorate.png') + ')',
}"
> >
<img <img
@click="linkTo(item.url)" @click="linkTo(item.url)"
@ -74,44 +83,53 @@
</template> </template>
<!-- 新品排行 --> <!-- 新品排行 -->
<template v-if="element.type == 'newGoodsSort'"> <template v-if="element.type == 'newGoodsSort'">
<new-goods-sort :data="element" class="mb_20 width_1200_auto"></new-goods-sort> <new-goods-sort
:data="element"
class="mb_20 width_1200_auto"
></new-goods-sort>
</template> </template>
<!-- 首页广告 --> <!-- 首页广告 -->
<template v-if="element.type == 'firstAdvert'"> <template v-if="element.type == 'firstAdvert'">
<first-page-advert :data="element" class="mb_20 width_1200_auto"></first-page-advert> <first-page-advert
:data="element"
class="mb_20 width_1200_auto"
></first-page-advert>
</template> </template>
<!-- 横幅广告 --> <!-- 横幅广告 -->
<template v-if="element.type == 'bannerAdvert'"> <template v-if="element.type == 'bannerAdvert'">
<div style="width:100%; text-align: center;"> <div style="width: 100%; text-align: center">
<img <img
width="1200" width="1200"
class="hover-pointer mb_20" class="hover-pointer mb_20"
@click="linkTo(element.options.url)"
@click="linkTo(element.options.url)" :src="element.options.img"
:src="element.options.img" alt=""
alt="" />
/>
</div> </div>
</template> </template>
<template v-if="element.type == 'notEnough'"> <template v-if="element.type == 'notEnough'"
<not-enough :data="element" class="mb_20 width_1200_auto"></not-enough> >
<not-enough
:data="element"
class="mb_20 width_1200_auto"
></not-enough>
</template> </template>
</div> </div>
</template> </template>
<script> <script>
import ModelCarousel from './modelList/Carousel.vue'; import ModelCarousel from "./modelList/Carousel.vue";
import ModelCarousel1 from './modelList/Carousel1.vue'; import ModelCarousel1 from "./modelList/Carousel1.vue";
import ModelCarousel2 from './modelList/Carousel2.vue'; import ModelCarousel2 from "./modelList/Carousel2.vue";
import FirstPageAdvert from './modelList/FirstPageAdvert.vue'; import FirstPageAdvert from "./modelList/FirstPageAdvert.vue";
import NewGoodsSort from './modelList/NewGoodsSort.vue'; import NewGoodsSort from "./modelList/NewGoodsSort.vue";
import Recommend from './modelList/Recommend.vue'; import Recommend from "./modelList/Recommend.vue";
import NotEnough from './modelList/NotEnough.vue'; import NotEnough from "./modelList/NotEnough.vue";
import Seckill from './modelList/Seckill.vue'; import Seckill from "./modelList/Seckill.vue";
export default { export default {
name: 'modelFormItem', name: "modelFormItem",
props: ['element', 'select', 'index', 'data'], props: ["element", "select", "index", "data"],
components: { components: {
ModelCarousel, ModelCarousel,
ModelCarousel1, ModelCarousel1,
@ -120,18 +138,17 @@ export default {
NewGoodsSort, NewGoodsSort,
FirstPageAdvert, FirstPageAdvert,
NotEnough, NotEnough,
Seckill Seckill,
}, },
data () { data() {
return { return {
showModal: false, // showModal: false, //
selected: {} // selected: {}, //
}; };
} },
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.model-item { .model-item {
position: relative; position: relative;
margin-bottom: 10px; margin-bottom: 10px;
@ -181,7 +198,7 @@ export default {
} }
} }
.width_1200_auto{ .width_1200_auto {
width: 1200px; width: 1200px;
margin: 0 auto; margin: 0 auto;
background-color: #fff; background-color: #fff;

View File

@ -23,12 +23,18 @@
<div class="person-msg"> <div class="person-msg">
<img :src="userInfo.face" v-if="userInfo.face" alt /> <img :src="userInfo.face" v-if="userInfo.face" alt />
<Avatar icon="ios-person" class="mb_10" v-else size="80" /> <Avatar icon="ios-person" class="mb_10" v-else size="80" />
<div>Hi{{ userInfo.nickName || `欢迎来到${config.title}` | secrecyMobile }}</div> <div>
Hi, {{
userInfo.nickName || `欢迎来到${config.title}` | secrecyMobile
}}
</div>
<div v-if="userInfo.id"> <div v-if="userInfo.id">
<Button type="error" shape="circle" @click="$router.push('home')"></Button> <Button class="btns" shape="circle" @click="$router.push('home')"
>会员中心</Button
>
</div> </div>
<div v-else> <div v-else>
<Button type="error" @click="$router.push('login')" shape="circle" <Button class="btns" @click="$router.push('login')" shape="circle"
>请登录</Button >请登录</Button
> >
</div> </div>
@ -37,8 +43,14 @@
<div> <div>
<span>常见问题</span> <span>常见问题</span>
<ul class="article-list"> <ul class="article-list">
<li class="ellipsis" :alt="article.title" v-for="(article, index) in articleList" :key="index" @click="goArticle(article.id)"> <li
{{article.title}} class="ellipsis"
:alt="article.title"
v-for="(article, index) in articleList"
:key="index"
@click="goArticle(article.id)"
>
{{ article.title }}
</li> </li>
</ul> </ul>
</div> </div>
@ -49,45 +61,48 @@
</template> </template>
<script> <script>
import { articleList } from "@/api/common.js";
import {articleList} from '@/api/common.js' import storage from "@/plugins/storage";
import storage from '@/plugins/storage';
export default { export default {
name: 'modelCarousel', name: "modelCarousel",
props: ['data'], props: ["data"],
data () { data() {
return { return {
config:require('@/config'), config: require("@/config"),
userInfo: {}, // userInfo: {}, //
articleList: [], // articleList: [], //
params: { // params: {
//
pageNumber: 1, pageNumber: 1,
pageSize: 5, pageSize: 5,
type: 'ANNOUNCEMENT', type: "ANNOUNCEMENT",
sort: 'sort' sort: "sort",
} },
}; };
}, },
methods: { methods: {
getArticleList () { // getArticleList() {
articleList(this.params).then(res => { //
articleList(this.params).then((res) => {
if (res.success) { if (res.success) {
this.articleList = res.result.records this.articleList = res.result.records;
} }
})
},
goArticle (id) { //
let routeUrl = this.$router.resolve({
path: '/article',
query: {id}
}); });
window.open(routeUrl.href, '_blank'); },
} goArticle(id) {
//
let routeUrl = this.$router.resolve({
path: "/article",
query: { id },
});
window.open(routeUrl.href, "_blank");
},
},
mounted() {
if (storage.getItem("userInfo"))
this.userInfo = JSON.parse(storage.getItem("userInfo"));
this.getArticleList();
}, },
mounted () {
if (storage.getItem('userInfo')) this.userInfo = JSON.parse(storage.getItem('userInfo'));
this.getArticleList()
}
}; };
</script> </script>
@ -98,6 +113,16 @@ export default {
overflow: hidden; overflow: hidden;
} }
.btns {
background-color:#363634 ;
line-height:30px;
color: white !important;
}
.btns:hover {
background-color: #363634;
line-height:32px !important;
color: #e5d790 !important;
}
/* 导航主体 */ /* 导航主体 */
.nav-body { .nav-body {
width: 1200px; width: 1200px;
@ -130,12 +155,14 @@ export default {
flex-direction: column; flex-direction: column;
margin: 20px auto; margin: 20px auto;
button { button {
height: 25px !important; height: 30px !important;
margin-top: 10px; margin-top: 10px;
line-height: 30px;
border: none;
} }
.ivu-btn-default { .ivu-btn-default {
color: $theme_color; // color: $theme_color;
border-color: $theme_color; // border-color: $theme_color;
} }
img { img {
margin-bottom: 10px; margin-bottom: 10px;

View File

@ -1,16 +1,18 @@
<template> <template>
<div class="not-enough"> <div class="not-enough" ref="obtain" id="demo">
<ul class="nav-bar"> <Affix :offset-top="62" @on-change="change">
<li <ul class="nav-bar" v-show="topSearchShow">
v-for="(item, index) in conData.options.navList" <li
:class="currentIndex === index ? 'curr' : ''" v-for="(item, index) in conData.options.navList"
@click="changeCurr(index)" :class="currentIndex === index ? 'curr' : ''"
:key="index" @click="changeCurr(index)"
> :key="index"
<p>{{ item.title }}</p> >
<p>{{ item.desc }}</p> <p @click="gotoDemo">{{ item.title }}</p>
</li> <p @click="gotoDemo">{{ item.desc }}</p>
</ul> </li>
</ul>
</Affix>
<div class="content" v-if="showContent"> <div class="content" v-if="showContent">
<div <div
v-for="(item, index) in conData.options.list[currentIndex]" v-for="(item, index) in conData.options.list[currentIndex]"
@ -29,17 +31,26 @@
</template> </template>
<script> <script>
export default { export default {
mounted() {
window.addEventListener('scroll',this.handleScrollx,true)
},
props: { props: {
data: { data: {
type: Object, type: Object,
default: null default: null,
} },
}, },
data () { data() {
return { return {
screenHeight:document.body.clientHeight,
scrollHieght:0,
topSearchShow: true, //
topIndex: 0, //
scrollTops: 0,
open:'',
currentIndex: 0, // currentIndex: 0, //
conData: this.data, // conData: this.data, //
showContent: true // showContent: true, //
}; };
}, },
watch: { watch: {
@ -47,14 +58,40 @@ export default {
this.conData = val; this.conData = val;
}, },
conData: function (val) { conData: function (val) {
this.$emit('content', val); this.$emit("content", val);
} },
}, },
methods: { methods: {
changeCurr (index) { // handleScrollx(){
this.currentIndex = index; // console.log('',window.pageYOffset) //
// console.log(this.$refs.obtain.getBoundingClientRect().top) //
this.scrollHieght = Number(window.pageYOffset);//
this.scrollTops = Number(this.$refs.obtain.getBoundingClientRect().top); //
this.topSearchShow = true; //
if(this.scrollTops < -660){ //
this.topSearchShow = false;
}
},
toguid(path,id){
var path =path;
var Id = id;
localStorage.setItem('toId',Id);
this.$router.push(path);
},
change(status){ //
this.open = status
},
gotoDemo(){ // demo
if(this.open){ //
document.querySelector("#demo").scrollIntoView(true);
} }
} //scrollIntoView()HTML
},
changeCurr(index) {
//
this.currentIndex = index;
},
},
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@ -63,10 +100,13 @@ export default {
justify-content: center; justify-content: center;
width: 100%; width: 100%;
margin-bottom: 10px; margin-bottom: 10px;
background-color: #f3f5f7; background-color: #f8f8f8;
height: 60px; height: 60px;
align-items: center; align-items: center;
position: relative; position: relative;
position: sticky;
position: -webkit-sticky;
top: 0;
li { li {
padding: 0 30px; padding: 0 30px;
text-align: center; text-align: center;
@ -140,5 +180,6 @@ export default {
} }
} }
} }
} }
</style> </style>

View File

@ -1,28 +1,54 @@
<template> <template>
<div class="cate-nav"> <div class="cate-nav">
<div class="nav-con"> <div class="nav-con">
<div class="all-categories hover-pointer" @mouseenter="showFirstList = true" @mouseleave="showFirstList = false">全部商品分类</div> <div
class="all-categories hover-pointer"
@mouseenter="showFirstList = true"
@mouseleave="showFirstList = false"
>
全部商品分类
</div>
<ul class="nav-item" v-if="showNavBar"> <ul class="nav-item" v-if="showNavBar">
<li <li
class ="nav-lis" class="nav-lis"
v-for="(item, index) in navList.list" v-for="(item, index) in navList.list"
:key="index" :key="index"
@click="linkTo(item.url)" @click="linkTo(item.url)"
> >
{{ item.name }} {{ item.name }}
</li> </li>
</ul> </ul>
</div> <hr style="width:1200px;height:2px;background:#e4393c;margin-top:-1px;margin-bottom:5px;"/> </div>
<!-- 全部商品分类 --> <!-- 全部商品分类 -->
<div class="cate-list" v-show="showAlways || showFirstList" @mouseenter="showFirstList = true" @mouseleave="showFirstList = false"> <div
class="cate-list"
v-show="showAlways || showFirstList"
@mouseenter="showFirstList = true"
@mouseleave="showFirstList = false"
>
<!-- 第一级分类 --> <!-- 第一级分类 -->
<div class="nav-side" :class="{'large-nav': large, 'opacity-nav': opacity}" @mouseleave="panel = false"> <div
class="nav-side"
:class="{ 'large-nav': large, 'opacity-nav': opacity }"
@mouseleave="panel = false"
>
<ul> <ul>
<li v-for="(item, index) in cateList" :key="index" @mouseenter="showDetail(index)" > <li
<span class="nav-side-item" @click="goGoodsList(item.id)">{{item.name}}</span> v-for="(item, index) in cateList"
:key="index"
@mouseenter="showDetail(index)"
>
<span class="nav-side-item" @click="goGoodsList(item.id)">{{
item.name
}}</span>
<span v-for="(second, secIndex) in item.children" :key="secIndex"> <span v-for="(second, secIndex) in item.children" :key="secIndex">
<span v-if="secIndex < 2" > / </span> <span v-if="secIndex < 2"> / </span>
<span @click="goGoodsList(second.id, second.parentId)" class="nav-side-item" v-if="secIndex < 2">{{second.name}}</span> <span
@click="goGoodsList(second.id, second.parentId)"
class="nav-side-item"
v-if="secIndex < 2"
>{{ second.name }}</span
>
</span> </span>
</li> </li>
</ul> </ul>
@ -30,14 +56,19 @@
<!-- 展开分类 --> <!-- 展开分类 -->
<div <div
class="detail-item-panel" class="detail-item-panel"
:style="{'minHeight': large?'470px':'340px'}" :style="{ minHeight: large ? '470px' : '340px' }"
v-show="panel" v-show="panel"
@mouseenter="panel = true" @mouseenter="panel = true"
@mouseleave="panel = false" @mouseleave="panel = false"
> >
<div class="nav-detail-item"> <div class="nav-detail-item">
<template v-for="(item, index) in panelData"> <template v-for="(item, index) in panelData">
<span @click="goGoodsList(item.id, item.parentId)" v-if="index < 8" :key="index">{{ item.name }}<Icon type="ios-arrow-forward" /></span> <span
@click="goGoodsList(item.id, item.parentId)"
v-if="index < 8"
:key="index"
>{{ item.name }}<Icon type="ios-arrow-forward"
/></span>
</template> </template>
</div> </div>
<ul> <ul>
@ -46,13 +77,21 @@
:key="index" :key="index"
class="detail-item-row" class="detail-item-row"
> >
<span class="detail-item-title" @click="goGoodsList(items.id,items.parentId)"> <span
class="detail-item-title"
@click="goGoodsList(items.id, items.parentId)"
>
{{ items.name }} <Icon type="ios-arrow-forward" /> {{ items.name }} <Icon type="ios-arrow-forward" />
<span class="glyphicon glyphicon-menu-right"></span> <span class="glyphicon glyphicon-menu-right"></span>
</span> </span>
<div> <div>
<span v-for="(item, subIndex) in items.children" @click="goGoodsList(item.id,items.id,items.parentId)" <span
:key="subIndex" class="detail-item">{{ item.name }}</span> v-for="(item, subIndex) in items.children"
@click="goGoodsList(item.id, items.id, items.parentId)"
:key="subIndex"
class="detail-item"
>{{ item.name }}</span
>
</div> </div>
</li> </li>
</ul> </ul>
@ -62,105 +101,116 @@
</template> </template>
<script> <script>
import { getCategory } from '@/api/goods'; import { getCategory } from "@/api/goods";
import storage from '@/plugins/storage.js' import storage from "@/plugins/storage.js";
export default { export default {
name: 'GoodsListNav', name: "GoodsListNav",
props: { props: {
showAlways: { // showAlways: {
//
default: false, default: false,
type: Boolean type: Boolean,
}, },
showNavBar: { // showNavBar: {
//
default: true, default: true,
type: Boolean type: Boolean,
}, },
hover: { hover: {
default: false, default: false,
type: Boolean type: Boolean,
}, },
large: { // large: {
//
default: false, default: false,
type: Boolean type: Boolean,
}, },
opacity: { // opacity: {
//
default: false, default: false,
type: Boolean type: Boolean,
} },
}, },
data () { data() {
return { return {
panel: false, // panel: false, //
panelData: [], // panelData: [], //
showFirstList: false, // showFirstList: false, //
cateList: [] // cateList: [], //
} };
}, },
computed: { computed: {
navList () { // navList() {
if (storage.getItem('navList')) { //
return JSON.parse(storage.getItem('navList')) if (storage.getItem("navList")) {
return JSON.parse(storage.getItem("navList"));
} else { } else {
return [] return [];
} }
} },
}, },
methods: { methods: {
getCate () { // getCate() {
//
if (this.hover) return false; if (this.hover) return false;
getCategory(0).then(res => { getCategory(0).then((res) => {
if (res.success) { if (res.success) {
this.cateList = res.result; this.cateList = res.result;
this.$store.commit('SET_CATEGORY', res.result) this.$store.commit("SET_CATEGORY", res.result);
// //
var expirationTime = new Date().setHours(new Date().getHours() + 1); var expirationTime = new Date().setHours(new Date().getHours() + 1);
// //
localStorage.setItem('category_expiration_time', expirationTime); localStorage.setItem("category_expiration_time", expirationTime);
// //
localStorage.setItem('category', JSON.stringify(res.result)) localStorage.setItem("category", JSON.stringify(res.result));
} }
}); });
}, },
showDetail (index) { // showDetail(index) {
this.panel = true //
this.panelData = this.cateList[index].children this.panel = true;
this.panelData = this.cateList[index].children;
}, },
goGoodsList (id, secondId, firstId) { // goGoodsList(id, secondId, firstId) {
const arr = [firstId, secondId, id] //
const arr = [firstId, secondId, id];
if (!arr[1]) { if (!arr[1]) {
arr.splice(0, 2) arr.splice(0, 2);
} }
if (!arr[0]) { if (!arr[0]) {
arr.shift() arr.shift();
} }
let routerUrl = this.$router.resolve({ let routerUrl = this.$router.resolve({
path: '/goodsList', path: "/goodsList",
query: {categoryId: arr.toString()} query: { categoryId: arr.toString() },
}) });
window.open(routerUrl.href, '_blank') window.open(routerUrl.href, "_blank");
} },
}, },
mounted () { mounted() {
if (localStorage.getItem('category') && localStorage.getItem('category_expiration_time')) { if (
localStorage.getItem("category") &&
localStorage.getItem("category_expiration_time")
) {
// //
if (new Date() > localStorage.getItem('category_expiration_time')) { if (new Date() > localStorage.getItem("category_expiration_time")) {
this.getCate(); this.getCate();
return; return;
} }
this.cateList = JSON.parse(localStorage.getItem('category')) this.cateList = JSON.parse(localStorage.getItem("category"));
} else { } else {
this.getCate() this.getCate();
} }
} },
}; };
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.nav-lis:hover{ .nav-lis:hover {
color:#e4393c !important; color: $theme_color !important;
cursor: pointer; cursor: pointer;
} }
.cate-nav{ .cate-nav {
width: 1200px; width: 1200px;
position: relative; position: relative;
margin: 0 auto; margin: 0 auto;
@ -175,10 +225,10 @@ export default {
width: 200px; width: 200px;
line-height: 40px; line-height: 40px;
color: #fff; color: #fff;
background-color: #e4393c; background-color: $theme_color;
text-align: center; text-align: center;
font-size: 16px; font-size: 16px;
border-bottom:none; border-bottom: none;
} }
.nav-item { .nav-item {
width: 1000px; width: 1000px;
@ -195,13 +245,13 @@ export default {
color: rgb(129, 127, 127); color: rgb(129, 127, 127);
font-size: 15px; font-size: 15px;
&:hover { &:hover {
color: $theme_color; color: #e1251b;
} }
} }
} }
} }
// //
.cate-list{ .cate-list {
margin: 0 auto; margin: 0 auto;
position: absolute; position: absolute;
z-index: 1000; z-index: 1000;
@ -216,14 +266,14 @@ export default {
height: 335px; height: 335px;
overflow: hidden; overflow: hidden;
} }
.large-nav{ .large-nav {
height: 470px; height: 470px;
ul>li{ ul > li {
line-height: 20px; line-height: 20px;
} }
} }
.opacity-nav{ .opacity-nav {
background-color:rgba(0,0,0,.5); background-color: rgba(0, 0, 0, 0.5);
} }
.nav-side ul { .nav-side ul {
width: 100%; width: 100%;
@ -236,13 +286,13 @@ export default {
padding-left: 12px; padding-left: 12px;
font-size: 13px; font-size: 13px;
line-height: 18px; line-height: 18px;
&:hover{ &:hover {
background: #999395; background: #999395;
} }
} }
.nav-side-item:hover { .nav-side-item:hover {
cursor: pointer; cursor: pointer;
color: $theme_color; color: #e1251b;
} }
/*显示商品详细信息*/ /*显示商品详细信息*/
@ -271,7 +321,7 @@ export default {
background-color: #6e6568; background-color: #6e6568;
} }
.nav-detail-item span:hover { .nav-detail-item span:hover {
background-color: $theme_color; background-color: #e1251b;
} }
.detail-item-panel li { .detail-item-panel li {
line-height: 30px; line-height: 30px;
@ -286,11 +336,13 @@ export default {
text-align: right; text-align: right;
} }
.detail-item-title:hover { .detail-item-title:hover {
color: $theme_color; color: #e1251b;
} }
.detail-item-row { .detail-item-row {
display: flex; display: flex;
>div{flex: 1;} > div {
flex: 1;
}
} }
.detail-item { .detail-item {
font-size: 12px; font-size: 12px;
@ -298,12 +350,12 @@ export default {
padding-right: 8px; padding-right: 8px;
cursor: pointer; cursor: pointer;
border-left: 1px solid #ccc; border-left: 1px solid #ccc;
&:first-child{ &:first-child {
border: none; border: none;
padding-left: 0; padding-left: 0;
} }
} }
.detail-item:hover { .detail-item:hover {
color: $theme_color; color: #e1251b;
} }
</style> </style>

View File

@ -414,7 +414,7 @@ export default {
font-size: 18px; font-size: 18px;
font-weight: bold; font-weight: bold;
&:hover { &:hover {
color: #e4393c; color: $theme_color;
cursor: pointer; cursor: pointer;
} }
} }
@ -428,8 +428,8 @@ export default {
text-align: center; text-align: center;
margin: 0 3px; margin: 0 3px;
&:hover { &:hover {
color: #e4393c; color: $theme_color;
border-color: #e4393c; border-color: $theme_color;
border-bottom-color: #fff; border-bottom-color: #fff;
cursor: pointer; cursor: pointer;
ul { ul {
@ -447,7 +447,7 @@ export default {
width: 300px; width: 300px;
padding: 5px 10px; padding: 5px 10px;
background: #fff; background: #fff;
border: 1px solid #e4393c; border: 1px solid $theme_color;
z-index: 1; z-index: 1;
&::before { &::before {
content: ""; content: "";
@ -470,7 +470,7 @@ export default {
margin: 3px 0; margin: 3px 0;
text-align: left; text-align: left;
&:hover { &:hover {
color: #e4393c; color: $theme_color;
cursor: pointer; cursor: pointer;
} }
} }
@ -489,23 +489,23 @@ export default {
background-color: #f3f3f3; background-color: #f3f3f3;
border: 1px solid #ddd; border: 1px solid #ddd;
&:hover { &:hover {
border-color: #e4393c; border-color: $theme_color;
background-color: #fff; background-color: #fff;
.ivu-icon { .ivu-icon {
color: #fff; color: #fff;
background-color: #e4393c; background-color: $theme_color;
} }
} }
span:nth-child(2) { span:nth-child(2) {
color: #e4393c; color: $theme_color;
} }
.ivu-icon { .ivu-icon {
position: absolute; position: absolute;
right: 0; right: 0;
top: 0; top: 0;
color: #e4393c; color: $theme_color;
line-height: 22px; line-height: 22px;
width: 21px; width: 21px;
height: 22px; height: 22px;
@ -557,8 +557,8 @@ export default {
} }
&:hover { &:hover {
border-color: #e4393c; border-color: $theme_color;
border: 2px solid #e4393c; border: 2px solid $theme_color;
top: 0; top: 0;
left: 0; left: 0;
position: relative; position: relative;
@ -572,7 +572,7 @@ export default {
display: inline-block; display: inline-block;
width: 100%; width: 100%;
height: 100%; height: 100%;
color: #e4393c; color: $theme_color;
text-align: center; text-align: center;
font-size: 12px; font-size: 12px;
cursor: pointer; cursor: pointer;
@ -585,7 +585,7 @@ export default {
div { div {
width: 0; width: 0;
border-top: 20px solid transparent; border-top: 20px solid transparent;
border-right: 20px solid #e4393c; border-right: 20px solid $theme_color;
} }
.ivu-icon { .ivu-icon {
font-size: 12px; font-size: 12px;
@ -598,7 +598,7 @@ export default {
} }
} }
.border-color { .border-color {
border-color: #e4393c; border-color: $theme_color;
z-index: 1; z-index: 1;
} }
} }
@ -620,8 +620,8 @@ export default {
font-size: 12px; font-size: 12px;
&:hover { &:hover {
cursor: pointer; cursor: pointer;
color: #e4393c; color: $theme_color;
border-color: #e4393c; border-color: $theme_color;
} }
} }
} }
@ -674,7 +674,7 @@ export default {
padding: 2px; padding: 2px;
cursor: pointer; cursor: pointer;
&:hover { &:hover {
color: #e4393c; color: $theme_color;
} }
} }
} }
@ -696,8 +696,8 @@ export default {
font-size: 12px; font-size: 12px;
&:hover { &:hover {
cursor: pointer; cursor: pointer;
color: #e4393c; color: $theme_color;
border-color: #e4393c; border-color: $theme_color;
} }
} }
} }

View File

@ -295,7 +295,7 @@ export default {
.item-as-title { .item-as-title {
width: 100%; width: 100%;
height: 36px; height: 36px;
color: #e4393c; color: $theme_color;
line-height: 36px; line-height: 36px;
font-size: 18px; font-size: 18px;
} }
@ -396,7 +396,7 @@ export default {
background-color: #fff; background-color: #fff;
} }
.goods-list-tool span:hover { .goods-list-tool span:hover {
border-color: #e4393c; border-color: $theme_color;
position: relative; position: relative;
text-decoration: none; text-decoration: none;
z-index: 1; z-index: 1;
@ -408,7 +408,7 @@ export default {
.goods-list-tool-active { .goods-list-tool-active {
color: #fff; color: #fff;
border-left: 1px solid #ccc; border-left: 1px solid #ccc;
background-color: #e4393c !important; background-color: $theme_color !important;
} }
/* ---------------商品栏结束------------------- */ /* ---------------商品栏结束------------------- */

View File

@ -15,10 +15,15 @@
> >
<div class="user-icon"> <div class="user-icon">
<div class="user-img"> <div class="user-img">
<img :src="userInfo.face" style="width:100%;height:100%;" v-if="userInfo.face" alt /> <img
:src="userInfo.face"
style="width: 100%; height: 100%"
v-if="userInfo.face"
alt
/>
<Avatar icon="ios-person" class="mb_10" v-else size="96" /> <Avatar icon="ios-person" class="mb_10" v-else size="96" />
</div> </div>
<p>{{userInfo.nickName}}</p> <p>{{ userInfo.nickName }}</p>
</div> </div>
<!-- 循环导航栏 --> <!-- 循环导航栏 -->
@ -38,7 +43,6 @@
>{{ chlidren.title }}</MenuItem >{{ chlidren.title }}</MenuItem
> >
</Submenu> </Submenu>
</Menu> </Menu>
</Sider> </Sider>
<Layout class="layout ml_10"> <Layout class="layout ml_10">
@ -54,47 +58,33 @@
</template> </template>
<script> <script>
import menuList from './menu'; import menuList from "./menu";
import Storage from '@/plugins/storage.js'; import Storage from "@/plugins/storage.js";
export default { export default {
name: 'Home', name: "Home",
data () { data() {
return { return {
menuList // menuList, //
}; };
}, },
computed: { computed: {
userInfo () { // userInfo() {
if(Storage.getItem('userInfo')){ //
return JSON.parse(Storage.getItem('userInfo')); if (Storage.getItem("userInfo")) {
} else{ return JSON.parse(Storage.getItem("userInfo"));
this.$Modal.confirm({ } else {
title:'请登录', return {};
content:"<p>请登录后执行此操作</p>", }
okText: '立即登录', },
cancelText: '继续浏览',
onOk:()=>{
if(true){
this.$router.push('/login');
}
}
})
return {}
}
}
}, },
methods: { methods: {
// barcallback // barcallback
onSelect (name) { onSelect(name) {
this.$router.push({name: name}); this.$router.push({ name: name });
}, },
// },
toUserMain () {
this.$router.push(`/home`);
}
}
}; };
</script> </script>

View File

@ -5,7 +5,7 @@ import Storage from './storage';
import router from '../router/index.js'; import router from '../router/index.js';
import store from '../vuex/store'; import store from '../vuex/store';
import { handleRefreshToken } from '@/api/index'; import { handleRefreshToken } from '@/api/index';
import {v4 as uuidv4} from 'uuid'; import { v4 as uuidv4} from 'uuid';
const qs = require('qs'); const qs = require('qs');
// api地址 // api地址
@ -88,7 +88,7 @@ service.interceptors.request.use(
} }
); );
async function refresh (error) { async function refresh(error) {
const getTokenRes = await refreshToken(); const getTokenRes = await refreshToken();
if (getTokenRes === 'success') { if (getTokenRes === 'success') {
// 刷新token // 刷新token
@ -121,7 +121,8 @@ async function refresh (error) {
}); });
}, },
onCancel: () => { onCancel: () => {
router.go(0) // router.go(0)
router.push("/");
Modal.remove(); Modal.remove();
} }
}); });

View File

@ -1,5 +1,5 @@
docker push registry.cn-beijing.aliyuncs.com/lili-images/buyer-ui:4.3.0.1 docker push registry.cn-beijing.aliyuncs.com/lili-images/buyer-ui:4.2.4.1
docker push registry.cn-beijing.aliyuncs.com/lili-images/wap-ui:4.3.0.1 docker push registry.cn-beijing.aliyuncs.com/lili-images/wap-ui:4.2.4.1
docker push registry.cn-beijing.aliyuncs.com/lili-images/seller-ui:4.3.0.1 docker push registry.cn-beijing.aliyuncs.com/lili-images/seller-ui:4.2.4.1
docker push registry.cn-beijing.aliyuncs.com/lili-images/manager-ui:4.3.0.1 docker push registry.cn-beijing.aliyuncs.com/lili-images/manager-ui:4.2.4.1

View File

@ -1 +1 @@
docker build -t registry.cn-beijing.aliyuncs.com/lili-images/manager-ui:4.3.0.1 . docker build -t registry.cn-beijing.aliyuncs.com/lili-images/manager-ui:4.2.4.1 .

View File

@ -3,10 +3,10 @@ var BASE = {
* @description api请求基础路径 * @description api请求基础路径
*/ */
API_DEV: { API_DEV: {
seller: "http://127.0.0.1:8889", common: "https://common-api.pickmall.cn",
manager: "http://127.0.0.1:8887", buyer: "https://buyer-api.pickmall.cn",
buyer: "http://127.0.0.1:8888", seller: "https://store-api.pickmall.cn",
common: "http://127.0.0.1:8890", manager: "https://admin-api.pickmall.cn"
}, },
API_PROD: { API_PROD: {
common: "https://common-api.pickmall.cn", common: "https://common-api.pickmall.cn",

View File

@ -58,7 +58,7 @@ export const logout = () => {
// 刷新token // 刷新token
export const handleRefreshToken = (token) => { export const handleRefreshToken = (token) => {
return getRequestWithNoToken(`/user/refresh/${token}`); return getRequestWithNoToken(`/passport/user/refresh/${token}`);
}; };
// 获取用户登录信息 // 获取用户登录信息
export const userInfo = (params) => { export const userInfo = (params) => {

View File

@ -4,12 +4,12 @@
<Form ref="searchForm" :model="searchForm" class="search-form"> <Form ref="searchForm" :model="searchForm" class="search-form">
<Form-item label="会员名称" class="flex" prop="memberName"> <Form-item label="会员名称" class="flex" prop="memberName">
<Input <Input
type="text" v-model="searchForm.memberName" type="text" v-model="searchForm.memberName" clearable
style="width: 200px"></Input> style="width: 200px"></Input>
</Form-item> </Form-item>
<Form-item label="编号" class="flex"> <Form-item label="编号" class="flex">
<Input <Input
type="text" v-model="searchForm.sn" type="text" v-model="searchForm.sn" clearable
style="width: 200px"></Input> style="width: 200px"></Input>
</Form-item> </Form-item>
<Form-item label="状态" <Form-item label="状态"

View File

@ -62,9 +62,11 @@ export default {
}; };
}, },
props: { props: {
selectedWay: { selectedWay: {
type: Array, type: Array,
default: new Array() default: function(){
return new Array()
}
} }
}, },
watch: { watch: {

View File

@ -22,7 +22,7 @@
<Table height="350" border tooltip :loading="loading" :columns="activeColumns" :data="showPromotionList"></Table> <Table height="350" border tooltip :loading="loading" :columns="activeColumns" :data="showPromotionList"></Table>
<Page @on-change="(val) => {params.pageNumber = val; } " :current="params.pageNumber" :page-size="params.pageSize" class="mt_10" :total="totals" size="small" show-elevator /> <Page @on-change="(val) => {params.pageNumber = val; } " :current="params.pageNumber" :page-size="params.pageSize" class="mt_10" :total="Number(totals)" size="small" show-elevator />
</div> </div>
@ -187,6 +187,7 @@ export default {
on: { on: {
click: () => { click: () => {
this.selectedPromotion(params); this.selectedPromotion(params);
console.log(this.index)
}, },
}, },
}, },

View File

@ -1,15 +1,36 @@
<template> <template>
<div class="layout"> <div class="layout">
<div class="goods-cell-title"> <div class="goods-cell-title">
<div class="goods-item-title" :class="{ selected: selected.index == index }" @click="handleClickTitle(title, index)" v-for="(title, index) in res.list[0].titleWay" :key="index"> <div
class="goods-item-title"
:class="{ selected: selected.index == index }"
@click="handleClickTitle(title, index)"
v-for="(title, index) in res.list[0].titleWay"
:key="index"
>
<h4>{{ title.title }}</h4> <h4>{{ title.title }}</h4>
<div>{{ title.desc }}</div> <div>{{ title.desc }}</div>
</div> </div>
</div> </div>
<div class="goods-list"> <div class="goods-list">
<div v-if="item.___index != undefined ? (selected.index == item.___index) : ( selected.val == item.type)" class="goods-item" v-for="(item, item_index) in res.list[0].listWay" :key="item_index"> <div
v-if="
item.___index != undefined
? selected.index == item.___index
: selected.val == item.type
"
class="goods-item"
v-for="(item, item_index) in res.list[0].listWay"
:key="item_index"
>
<div class="goods-img"> <div class="goods-img">
<Icon size="20" color="#e1251b" @click="closeGoods(item, item_index)" class="goods-icon" type="ios-close-circle" /> <Icon
size="20"
color="#e1251b"
@click="closeGoods(item, item_index)"
class="goods-icon"
type="ios-close-circle"
/>
<img :src="item.img" alt /> <img :src="item.img" alt />
</div> </div>
<div class="goods-desc"> <div class="goods-desc">
@ -70,7 +91,7 @@ export default {
} }
> div { > div {
font-weight: bold; font-weight: bold;
color: #e4393c !important; color: $theme_color !important;
} }
} }
.goods-cell-title { .goods-cell-title {
@ -137,7 +158,7 @@ export default {
display: flex; display: flex;
> .goods-price { > .goods-price {
line-height: 2; line-height: 2;
color: #e4393c; color: $theme_color;
} }
} }
} }

View File

@ -32,7 +32,7 @@
</div> </div>
<div class="no-more" v-if="list.length ==0"></div> <div class="no-more" v-if="list.length ==0"></div>
</div> </div>
<Page :total="total" size="small" @on-change="(val) => {params.pageNumber = val; } " :current="params.pageNumber" :page-size="params.pageSize" /> <Page :total="total" size="small" @on-change="(val) => {params.pageNumber = val; } " :current="params.pageNumber" :page-size="params.pageSize" show-sizer :page-size-opts="[10, 20, 50]" @on-page-size-change="changePageSize"/>
</Card> </Card>
@ -74,8 +74,8 @@ export default {
params: { // params: { //
pageNumber: 1, pageNumber: 1,
pageSize: 10, pageSize: 10,
sort: "", sort: "createTime",
order: "asc", order: "desc",
pageType: "INDEX", pageType: "INDEX",
pageClientType: "H5", pageClientType: "H5",
}, },
@ -147,6 +147,12 @@ export default {
this.$router.push({ this.$router.push({
path: "/floorList/main", path: "/floorList/main",
}); });
},
//
changePageSize(v) {
this.params.pageNumber = 1;
this.params.pageSize = v;
this.init();
}, },
// //
handleDel(val) { handleDel(val) {

View File

@ -1 +1 @@
docker build -t registry.cn-beijing.aliyuncs.com/lili-images/seller-ui:4.3.0.1 . docker build -t registry.cn-beijing.aliyuncs.com/lili-images/seller-ui:4.2.4.1 .

View File

@ -3,10 +3,10 @@ var BASE = {
* @description api请求基础路径 * @description api请求基础路径
*/ */
API_DEV: { API_DEV: {
seller: "http://127.0.0.1:8889", common: "https://common-api.pickmall.cn",
manager: "http://127.0.0.1:8887", buyer: "https://buyer-api.pickmall.cn",
buyer: "http://127.0.0.1:8888", seller: "https://store-api.pickmall.cn",
common: "http://127.0.0.1:8890", manager: "https://admin-api.pickmall.cn"
}, },
API_PROD: { API_PROD: {
common: "https://common-api.pickmall.cn", common: "https://common-api.pickmall.cn",

View File

@ -181,11 +181,11 @@
<Button <Button
type="primary" type="primary"
slot="extra" slot="extra"
@click="handleCloseSkuItem(item, $index)" @click="handleCloseSkuItem($index)"
> >
删除规格 删除规格
</Button> </Button>
<Form :model="item" class="flex"> <div>
<FormItem <FormItem
label="规格名" label="规格名"
class="sku-item-content-val flex" class="sku-item-content-val flex"
@ -197,11 +197,11 @@
placeholder="请输入规格项名称" placeholder="请输入规格项名称"
:filter-method="filterMethod" :filter-method="filterMethod"
:data="skuData" :data="skuData"
@on-change="handleSkuTitle($event, $index)" @on-change="editSkuItem"
> >
</AutoComplete> </AutoComplete>
</FormItem> </FormItem>
</Form> </div>
<div class="flex sku-val"> <div class="flex sku-val">
<Form :model="item" class="flex"> <Form :model="item" class="flex">
<!--规格值文本列表--> <!--规格值文本列表-->
@ -222,12 +222,7 @@
:data="skuVal" :data="skuVal"
@on-focus="changeSkuVals(item.name)" @on-focus="changeSkuVals(item.name)"
@on-change=" @on-change="
handleSkuValue( skuValueChange(val.value, $index, item)
val.value,
$index,
val,
index
)
" "
> >
</AutoComplete> </AutoComplete>
@ -263,97 +258,9 @@
规格详细 规格详细
<div slot="content"> <div slot="content">
<div slot="content"> <div slot="content">
<ul class="flex sku-ul">
<li
v-for="(item, index) in skuTableColumn"
:key="index"
>
{{ item.title }}
</li>
</ul>
<div
class="mt_10 flex sku-editor"
v-for="(item, index) in skuTableData"
:key="index"
>
<div
v-for="(spec, specIndex) in skuTableColumn.filter(
(val) => {
return val.key;
}
)"
:key="specIndex"
>
{{
skuTableData[index][
spec.title || spec.key || spec.___key
]
}}
</div>
<div
v-if="
skuTableColumn.find((val) => {
return val.slot == 'weight';
})
"
>
<Input
clearable
:min="0"
v-model="item.weight"
placeholder="请输入重量"
@on-change="updateSkuTable(item, 'weight', index)"
/>
</div>
<div>
<Input
clearable
v-model="item.sn"
placeholder="请输入货号"
@on-change="updateSkuTable(item, 'sn', index)"
/>
</div>
<div>
<InputNumber
clearable
class="input-number"
:min="0"
v-model="item.quantity"
placeholder="请输入库存"
@on-change="updateSkuTable(item, 'quantity', index)"
/>
</div>
<div>
<InputNumber
clearable
class="input-number"
:min="0"
v-model="item.cost"
placeholder="请输入成本价"
@on-change="updateSkuTable(item, 'cost', index)"
/>
</div>
<div>
<InputNumber
class="input-number"
clearable
:min="0"
v-model="item.price"
placeholder="请输入价格"
@on-change="updateSkuTable(item, 'price', index)"
/>
</div>
<div>
<Button @click="editSkuPicture(item)"
>编辑图片</Button
>
</div>
</div>
<!-- #TODO 此处有待优化 --> <!-- #TODO 此处有待优化 -->
<!-- <Table <Table
class="mt_10"
:columns="skuTableColumn" :columns="skuTableColumn"
:data="skuTableData" :data="skuTableData"
style=" style="
@ -409,73 +316,74 @@
</template> </template>
<template slot-scope="{ row }" slot="images"> <template slot-scope="{ row }" slot="images">
<Button @click="editSkuPicture(row)"></Button> <Button @click="editSkuPicture(row)"></Button>
<Modal
v-model="showSkuPicture"
:styles="{ top: '30px' }"
class-name="sku-preview-modal"
title="编辑图片"
ok-text="结束编辑"
@on-ok="updateSkuPicture()"
cancel-text="取消"
>
<div class="preview-picture">
<img
v-if="previewPicture !== ''"
:src="previewPicture"
/>
</div>
<Divider />
<vuedraggable
:list="selectedSku.images"
:animation="200"
style="display: inline-block"
>
<div
class="sku-upload-list"
v-for="(img, __index) in selectedSku.images"
:key="__index"
>
<template>
<img :src="img.url" />
<div class="sku-upload-list-cover">
<Icon
type="md-search"
@click="handleView(img.url)"
></Icon>
<Icon
type="md-trash"
@click="handleRemove(img, __index)"
></Icon>
</div>
</template>
</div>
</vuedraggable>
<Upload
ref="uploadSku"
:show-upload-list="false"
:on-success="handleSuccess"
:format="['jpg', 'jpeg', 'png']"
:on-format-error="handleFormatError"
:on-exceeded-size="handleMaxSize"
:max-size="1024"
:before-upload="handleBeforeUpload"
multiple
type="drag"
:action="uploadFileUrl"
:headers="{ ...accessToken }"
style="display: inline-block; width: 58px"
>
<div>
<Icon type="ios-camera" size="55"></Icon>
</div>
</Upload>
</Modal>
</template> </template>
</Table> --> </Table>
</div> </div>
</div> </div>
</Panel> </Panel>
</Collapse> </Collapse>
</div> </div>
<Modal
v-model="showSkuPicture"
:styles="{ top: '30px' }"
class-name="sku-preview-modal"
title="编辑图片"
ok-text="结束编辑"
@on-ok="updateSkuPicture()"
cancel-text="取消"
>
<div class="preview-picture">
<img v-if="previewPicture !== ''" :src="previewPicture" />
</div>
<Divider />
<vuedraggable
:list="selectedSku.images"
:animation="200"
style="display: inline-block"
>
<div
class="sku-upload-list"
v-for="(img, __index) in selectedSku.images"
:key="__index"
>
<template>
<img :src="img.url" />
<div class="sku-upload-list-cover">
<Icon
type="md-search"
@click="handleView(img.url)"
></Icon>
<Icon
type="md-trash"
@click="handleRemove(img, __index)"
></Icon>
</div>
</template>
</div>
</vuedraggable>
<Upload
ref="uploadSku"
:show-upload-list="false"
:on-success="handleSuccess"
:format="['jpg', 'jpeg', 'png']"
:on-format-error="handleFormatError"
:on-exceeded-size="handleMaxSize"
:max-size="1024"
:before-upload="handleBeforeUpload"
multiple
type="drag"
:action="uploadFileUrl"
:headers="{ ...accessToken }"
style="display: inline-block; width: 58px"
>
<div>
<Icon type="ios-camera" size="55"></Icon>
</div>
</Upload>
</Modal>
</div> </div>
<h4>商品详情描述</h4> <h4>商品详情描述</h4>
<div class="form-item-view"> <div class="form-item-view">
@ -799,7 +707,6 @@ export default {
], ],
}; };
}, },
methods: { methods: {
/** /**
* 选择参数 * 选择参数
@ -852,8 +759,7 @@ export default {
}, },
// sku // sku
editSkuPicture(row) { editSkuPicture(row) {
console.log(row); if (row.images && row.images.length > 0) {
if (row.images && row.images.length) {
this.previewPicture = row.images[0].url; this.previewPicture = row.images[0].url;
} }
this.selectedSku = row; this.selectedSku = row;
@ -909,6 +815,7 @@ export default {
}, },
// //
handleSuccessGoodsPicture(res, file) { handleSuccessGoodsPicture(res, file) {
console.log(res);
if (file.response) { if (file.response) {
file.url = file.response.result; file.url = file.response.result;
this.baseInfoForm.goodsGalleryFiles.push(file); this.baseInfoForm.goodsGalleryFiles.push(file);
@ -1040,18 +947,12 @@ export default {
cost: e.cost, cost: e.cost,
quantity: e.quantity, quantity: e.quantity,
weight: e.weight, weight: e.weight,
// ___keys: [],
}; };
e.specList.forEach((u) => { e.specList.forEach((u) => {
if (u.specName === "images") { if (u.specName === "images") {
sku.images = u.specImage; sku.images = u.specImage;
} else { } else {
sku[u.specName] = u.specValue; sku[u.specName] = u.specValue;
// keys
// sku.___keys.push({
// key: u.specName,
// value: u.specValue,
// });
if ( if (
!skusInfo.some((s) => s.name === u.specName) && !skusInfo.some((s) => s.name === u.specName) &&
!this.ignoreColumn.includes(u.specName) !this.ignoreColumn.includes(u.specName)
@ -1064,7 +965,6 @@ export default {
id: u.specValueId, id: u.specValueId,
name: u.specName, name: u.specName,
value: u.specValue || "", value: u.specValue || "",
___key: u.specValue || "",
}, },
], ],
}); });
@ -1078,7 +978,6 @@ export default {
id: u.specValueId, id: u.specValueId,
name: u.specName, name: u.specName,
value: u.specValue || "", value: u.specValue || "",
___key: u.specValue || "",
}); });
} }
if (!sk.spec_id && u.specName === "specId") { if (!sk.spec_id && u.specName === "specId") {
@ -1093,7 +992,6 @@ export default {
}); });
this.skuInfo = skusInfo; this.skuInfo = skusInfo;
this.renderTableData(); this.renderTableData();
this.skuTableData = skus; this.skuTableData = skus;
}, },
@ -1144,11 +1042,18 @@ export default {
// //
this.$set(this.skuInfo, this.skuInfo.length, { this.$set(this.skuInfo, this.skuInfo.length, {
spec_values: [], spec_values: [],
name: "规格名" + (this.skuInfo.length + 1), name: "规格名",
}); });
// this.renderTableData(); this.renderTableData();
},
//
editSkuItem() {
this.renderTableData();
},
//
async skuValueChange(val, index, item) {
this.renderTableData();
}, },
// //
changeSkuVals(name) { changeSkuVals(name) {
if (name) { if (name) {
@ -1161,7 +1066,14 @@ export default {
}); });
} }
}, },
/** 移除当前规格项 进行数据变化*/
handleCloseSkuItem($index) {
this.skuInfo.splice($index, 1);
/**
* 渲染规格详细表格
*/
this.renderTableData();
},
// //
validateEmpty(params) { validateEmpty(params) {
let flag = true; let flag = true;
@ -1187,7 +1099,6 @@ export default {
this.$set(item.spec_values, item.spec_values.length, { this.$set(item.spec_values, item.spec_values.length, {
name: item.name, name: item.name,
value: "", value: "",
___key: "",
}); });
this.baseInfoForm.regeneratorSkuFlag = true; this.baseInfoForm.regeneratorSkuFlag = true;
/** /**
@ -1197,99 +1108,27 @@ export default {
} }
}, },
/** 移除当前规格项 进行数据变化*/ /** 移除当前规格值 */
handleCloseSkuItem(item, $index) {
console.log(item);
let oldsSkuTableData = cloneObj(this.skuTableData);
oldsSkuTableData.forEach((sku, i) => {
if (sku[item.name]) {
delete sku[item.name];
}
});
this.skuTableData = oldsSkuTableData;
this.skuTableColumn.forEach((column, i) => {
if (column.key == item.name) {
this.skuTableColumn.splice(i, 1);
}
});
this.skuInfo.splice($index, 1);
},
/**
* 移除当前规格值
* 找到一样规格的值进行移出
*/
handleCloseSkuValue(item, index) { handleCloseSkuValue(item, index) {
let oldsSkuTableData = cloneObj(this.skuTableData);
console.log("oldsSkuTableData", oldsSkuTableData);
this.skuTableData = oldsSkuTableData.filter((sku, i) => {
if (
sku[item.spec_values[index].name] != item.spec_values[index].value
) {
return sku;
}
});
item.spec_values.splice(index, 1); item.spec_values.splice(index, 1);
this.baseInfoForm.regeneratorSkuFlag = true; this.baseInfoForm.regeneratorSkuFlag = true;
}, /**
* 渲染规格详细表格
/** */
* 编辑规格值 this.renderTableData();
* 根据当前___keys的索引指定需修改的值
* @param {*} change 返回input更改的值
* @param {*} index 修改规格名的索引
* @param {*} item 当前规格值
*/
async handleSkuValue(change, index, item) {
this.skuTableData.map((sku, i) => {
// key
if (sku[item.name] == item.___key) {
sku[item.name] = change;
console.log(1);
} else if (!item.___key && !sku[item.name]) {
//
sku[item.name] = change;
console.log("赋值", sku);
}
});
item.___key = change;
},
/**
* 编辑规格名
* 根据修改的规格名将skuTableData的key(规格名)进行修改
* @param {*} change 返回input更改的值
* @param {*} index 修改规格名的索引
*/
handleSkuTitle(change, index) {
let oldSkuTableColumn = cloneObj(this.skuTableColumn);
this.skuTableData.forEach((sku, i) => {
Object.keys(sku).forEach((key) => {
if (oldSkuTableColumn[index].key == key) {
// sku
sku = {
[change]: sku[key],
...sku,
};
delete sku[key];
this.skuTableData[i] = sku;
}
});
});
this.skuTableColumn[index].key = change;
this.skuTableColumn[index].title = change;
}, },
/** /**
* 渲染table所需要的column data * 渲染table所需要的column data
*/ */
renderTableData() { renderTableData() {
this.skuTableColumn = [];
this.skuTableData = [];
let pushData = []; let pushData = [];
// //
this.skuInfo.forEach((sku) => { this.skuInfo.forEach((sku) => {
// !sku.name ? (sku.name = "") : "";
// //
let columnName = sku.name; let columnName = sku.name;
pushData.push({ pushData.push({
@ -1330,20 +1169,14 @@ export default {
this.skuTableColumn = pushData; this.skuTableColumn = pushData;
// //
let cloneTemp = cloneObj(this.skuInfo); let cloneTemp = cloneObj(this.skuInfo);
if (cloneTemp.length) {
cloneTemp.map((temp) => {
return {
[temp.name]: temp.value,
images: this.baseInfoForm.goodsGalleryFiles || [],
};
});
}
//
this.$set(this, "skuTableData", []);
// //
if (cloneTemp[0]) { if (cloneTemp[0]) {
// //
let result = []; let result = [];
// // sku
cloneTemp[0].spec_values.forEach((specItem) => { cloneTemp[0].spec_values.forEach((specItem) => {
result.push({ result.push({
[cloneTemp[0].name]: specItem.value, [cloneTemp[0].name]: specItem.value,
@ -1352,14 +1185,8 @@ export default {
}); });
cloneTemp.splice(0, 1); cloneTemp.splice(0, 1);
result = this.specIterator(result, cloneTemp); result = this.specIterator(result, cloneTemp);
// skuTable
let oldData = cloneObj(this.skuTableData);
this.skuTableData = result; this.skuTableData = result;
// skuTable console.log(this.skuTableData);
this.skuTableData = Object.assign(this.skuTableData, oldData);
console.log(result, this.skuTableData);
} }
}, },
/** /**
@ -1371,25 +1198,16 @@ export default {
// //
if (cloneTemp.length > 0) { if (cloneTemp.length > 0) {
let table = []; let table = [];
let newVal = []; // result.forEach((resItem) => {
result.forEach((resItem, i) => {
cloneTemp[0].spec_values.forEach((valItem) => { cloneTemp[0].spec_values.forEach((valItem) => {
let obj = cloneObj(resItem); let obj = cloneObj(resItem);
obj[cloneTemp[0].name] = valItem.value; obj[cloneTemp[0].name] = valItem.value;
if (valItem.value) { table.push(obj);
table.push(obj);
} else {
newVal.push(obj);
}
}); });
}); });
result = []; result = [];
table.push(...newVal);
table.forEach((t) => { table.forEach((t) => {
console.log("t", t);
result.push(t); result.push(t);
}); });
// //
@ -1399,7 +1217,6 @@ export default {
} }
return this.specIterator(result, cloneTemp); return this.specIterator(result, cloneTemp);
}, },
/** 根据分类id获取系统设置规格信息*/ /** 根据分类id获取系统设置规格信息*/
Get_SkuInfoByCategory(categoryId) { Get_SkuInfoByCategory(categoryId) {
if (categoryId) { if (categoryId) {
@ -1419,7 +1236,8 @@ export default {
return option.toUpperCase().indexOf(value.toUpperCase()) !== -1; return option.toUpperCase().indexOf(value.toUpperCase()) !== -1;
}, },
/** 数据改变之后 抛出数据 */ /** 数据改变之后 抛出数据 */
updateSkuTable(row, item, index) { updateSkuTable(row, item, type = "deafult") {
let index = row._index;
this.baseInfoForm.regeneratorSkuFlag = true; this.baseInfoForm.regeneratorSkuFlag = true;
/** 进行自定义校验 判断是否是数字(小数也能通过)重量 */ /** 进行自定义校验 判断是否是数字(小数也能通过)重量 */
if (item === "weight") { if (item === "weight") {
@ -1457,7 +1275,6 @@ export default {
} }
} }
this.$nextTick(() => { this.$nextTick(() => {
console.log(index, item);
this.skuTableData[index][item] = row[item]; this.skuTableData[index][item] = row[item];
}); });
// this.$set(this.skuTableData,[index][item],row[item]) // this.$set(this.skuTableData,[index][item],row[item])
@ -1522,9 +1339,6 @@ export default {
delete sku.specValueId; delete sku.specValueId;
return sku; return sku;
}); });
if (this.firstData.tempId) {
delete submit.id;
}
if (submit.goodsGalleryFiles.length > 0) { if (submit.goodsGalleryFiles.length > 0) {
submit.goodsGalleryList = submit.goodsGalleryFiles.map( submit.goodsGalleryList = submit.goodsGalleryFiles.map(
@ -1661,30 +1475,4 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@import "./addGoods.scss"; @import "./addGoods.scss";
.sku-ul {
align-items: center;
padding: 10px 0;
border-radius: 0.4em;
background: #f3f5f7;
> li {
flex: 1;
text-align: center;
font-weight: bold;
padding: 10px;
}
}
.sku-editor {
> div {
flex: 1;
display: flex;
align-items: center;
justify-content: center;
overflow: hidden;
padding: 10px;
}
}
.input-number {
width: 100%;
}
</style> </style>

View File

@ -96,27 +96,27 @@
</td> </td>
<td></td> <td></td>
<td> <td>
<Input class="text w40" type="text" v-model="item.firstCompany" maxlength="3" clearable /> <InputNumber class="text w40" type="text" v-model="item.firstCompany" :max="999" :min="0" :step="0.1" clearable/>
</td> </td>
<td> <td>
<Input class="text w60" type="text" v-model="item.firstPrice" maxlength="6" clearable> <InputNumber class="text w60" type="text" v-model="item.firstPrice" :max="999999" :min="0" clearable :formatter="value => `¥ ${value}`.replace(/\B(?=(\d{3})+(?!\d))/g, ',')"
<span slot="append"></span> :parser="value => value.replace(/\¥\s?|(,*)/g, '')">
</Input> </InputNumber>
</td> </td>
<td> <td>
<Input class="text w40" type="text" v-model="item.continuedCompany" maxlength="6" <InputNumber class="text w40" type="text" v-model="item.continuedCompany" :max="999" :min="0" :step="0.1"
clearable /> />
</td> </td>
<td> <td>
<Input class="text w60" type="text" v-model="item.continuedPrice" maxlength="6" clearable> <InputNumber class="text w60" type="text" v-model="item.continuedPrice" :max="999999" :min="0" clearable :formatter="value => `¥ ${value}`.replace(/\B(?=(\d{3})+(?!\d))/g, ',')"
<span slot="append"></span> :parser="value => value.replace(/\¥\s?|(,*)/g, '')">
</Input> </InputNumber>
</td> </td>
<td class="nscs-table-handle"> <td class="nscs-table-handle">
<Button @click="editRegion(item,index)" type="info" size="small" <Button @click="editRegion(item,index)" type="info" size="small"
style="margin-bottom: 5px">修改 style="margin-bottom: 5px">修改
</Button> </Button>
<Button @click="removeTemplateChildren(index)" :loading="submitLoading" type="error" <Button @click="removeTemplateChildren(index)" type="error"
size="small" style="margin-bottom: 5px">删除 size="small" style="margin-bottom: 5px">删除
</Button> </Button>
</td> </td>
@ -145,7 +145,7 @@
<Button @click="addShipTemplateChildren(index)" v-if="form.pricingMethod !== 'FREE'" <Button @click="addShipTemplateChildren(index)" v-if="form.pricingMethod !== 'FREE'"
icon="ios-create-outline">为指定城市设置运费模板 icon="ios-create-outline">为指定城市设置运费模板
</Button> </Button>
<Button @click="handleSubmit" :loading="submitLoading" type="primary" style="margin-right:5px">保存 <Button @click="handleSubmit" type="primary" style="margin-right:5px">保存
</Button> </Button>
</Form-item> </Form-item>
</Form> </Form>
@ -170,12 +170,15 @@ export default {
}, },
data() { data() {
return { return {
gotop: false,
index:'0',
selectedIndex: 0, // selectedIndex: 0, //
item: "", // item: "", //
shipInfo: {}, // shipInfo: {}, //
title: "添加运费模板", // title: "添加运费模板", //
operation: "add", // operation: "add", //
currentTab: "", // tab currentTab: "", // tab
// submitLoading:false,
saveError: false, // saveError: false, //
csTab: false, // csTab: false, //
form: { form: {
@ -234,15 +237,19 @@ export default {
{ {
area: "", area: "",
areaId: "", areaId: "",
firstCompany: "1", firstCompany: 0,
firstPrice: "", firstPrice: 0,
continuedCompany: "1", continuedCompany: 0,
continuedPrice: "", continuedPrice: 0,
selectedAll: false, selectedAll: false,
}, },
], ],
}; };
}, },
handleScroll(){
let scrolltop = document.documentElement.scrollTop || document.body.scrollTop;
scrolltop > 30 ? (this.gotop = true) : (this.gotop = false);
},
// //
edit(item) { edit(item) {
this.title = "修改运费模板"; this.title = "修改运费模板";
@ -252,6 +259,15 @@ export default {
this.saveError = false; this.saveError = false;
//form //form
this.form = item; this.form = item;
let top = document.documentElement.scrollTop || document.body.scrollTop;
//
const timeTop = setInterval(() => {
document.body.scrollTop = document.documentElement.scrollTop = top -= 50;
if (top <= 0) {
clearInterval(timeTop);
}
}, 0);
}, },
// //
editRegion(item, index) { editRegion(item, index) {
@ -268,7 +284,6 @@ export default {
}); });
}); });
}); });
this.$store.state.shipTemplate = this.form.freightTemplateChildList; this.$store.state.shipTemplate = this.form.freightTemplateChildList;
this.$refs.region.open(item, index); this.$refs.region.open(item, index);
@ -328,9 +343,9 @@ export default {
}; };
this.$refs.form.validate((valid) => { this.$refs.form.validate((valid) => {
const regNumber = /^\+?[1-9][0-9]*$/; // const regNumber = /^\+?[1-9][0-9]*$/;
const regMoney = // const regMoney =
/(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/; // /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/;
if (valid) { if (valid) {
if (this.form.pricingMethod != "FREE") { if (this.form.pricingMethod != "FREE") {
// //
@ -349,23 +364,23 @@ export default {
this.saveError = true; this.saveError = true;
return; return;
} }
if ( // if (
regNumber.test( // regNumber.test(
this.form.freightTemplateChildList[i].firstCompany // this.form.freightTemplateChildList[i].firstCompany
) == false || // ) == false ||
regNumber.test( // regNumber.test(
this.form.freightTemplateChildList[i].continuedCompany // this.form.freightTemplateChildList[i].continuedCompany
) == false || // ) == false ||
regMoney.test( // regMoney.test(
this.form.freightTemplateChildList[i].firstPrice // this.form.freightTemplateChildList[i].firstPrice
) == false || // ) == false ||
regMoney.test( // regMoney.test(
this.form.freightTemplateChildList[i].continuedPrice // this.form.freightTemplateChildList[i].continuedPrice
) == false // ) == false
) { // ) {
this.saveError = true; // this.saveError = true;
return; // return;
} // }
} }
} }
@ -400,10 +415,10 @@ export default {
const params = { const params = {
area: "", area: "",
areaId: "", areaId: "",
firstCompany: "1", firstCompany: 0,
firstPrice: "", firstPrice: 0,
continuedCompany: "1", continuedCompany: 0,
continuedPrice: "", continuedPrice: 0,
selectedAll: false, selectedAll: false,
}; };
this.form.freightTemplateChildList.push(params); this.form.freightTemplateChildList.push(params);
@ -437,6 +452,7 @@ export default {
}, },
mounted() { mounted() {
this.init(); this.init();
window.addEventListener("scroll", this.handleScroll, true);
}, },
}; };
</script> </script>