功能测试与修改

master
Chopper 2022-08-26 17:12:48 +08:00 committed by chc
parent ba91d7c26d
commit a345586b25
27 changed files with 2468 additions and 986 deletions

2107
buyer/package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

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

View File

@ -45,3 +45,14 @@ export function handleRefreshToken(token) {
needToken: false,
});
}
// /**
// * 获取店铺楼层数据
// */
// export function getFloorStoreData(params) {
// return request({
// url: `/buyer/other/pageData?pageClientType=PC`,
// method: "get",
// params,
// });
// }

View File

@ -1,14 +1,12 @@
<template>
<div class="merchant">
<!-- 普通店铺装修 -->
<div v-if="basePageData">
<BaseHeader />
<BaseHeader/>
<!-- 搜索栏 -->
<Search :store="true" @search="search"></Search>
<!-- 店铺logo -->
<div class="shop-logo">
<div>
<img :src="storeMsg.storeLogo" height="80" alt="" />
<img :src="storeMsg.storeLogo" height="80" alt=""/>
<div>
<p>{{ storeMsg.storeName || "xx店铺" }}</p>
<p
@ -19,16 +17,16 @@
</div>
<div>
<span class="hover-pointer" @click="collect"
><Icon
type="ios-heart"
:color="storeCollected ? '#ed3f14' : '#fff'"
/>{{ storeCollected ? "" : "" }}</span
><Icon
type="ios-heart"
:color="storeCollected ? '#ed3f14' : '#fff'"
/>{{ storeCollected ? "" : "" }}</span
>
<span
style="width: 80px"
class="hover-pointer ml_10"
@click="connectCs(storeMsg.yzfSign)"
><Icon custom="icomoon icon-customer-service" />联系客服</span
><Icon custom="icomoon icon-customer-service"/>联系客服</span
>
</div>
</div>
@ -44,7 +42,8 @@
<li class="cate-item" v-for="(cate, index) in cateList" :key="index">
<Dropdown v-if="cate.children.length">
<div @click.self="searchByCate(cate)">
{{ cate.labelName }} <Icon type="ios-arrow-down"></Icon>
{{ cate.labelName }}
<Icon type="ios-arrow-down"></Icon>
</div>
<DropdownMenu slot="list">
<DropdownItem
@ -52,97 +51,79 @@
:name="sec.id"
v-for="sec in cate.children"
:key="sec.id"
>{{ sec.labelName }}</DropdownItem
>{{ sec.labelName }}
</DropdownItem
>
</DropdownMenu>
</Dropdown>
<span v-else @click.self="searchByCate(cate)">{{
cate.labelName
}}</span>
cate.labelName
}}</span>
</li>
</ul>
</div>
<div class="promotion-decorate">{{ cateName }}</div>
<div class="goods-list">
<empty v-if="goodsList.length === 0" />
<div
v-else
class="goods-show-info"
v-for="(item, index) in goodsList"
:key="index"
@click="goGoodsDetail(item.content.id, item.content.goodsId)"
>
<div class="goods-show-img">
<img width="220" height="220" :src="item.content.thumbnail" />
</div>
<div class="goods-show-price">
<span>
<span class="seckill-price text-danger">{{
item.content.price | unitPrice("¥")
}}</span>
</span>
</div>
<div class="goods-show-detail">
<span>{{ item.content.goodsName }}</span>
</div>
<div class="goods-show-num">
已有<span>{{ item.content.commentNum || 0 }}</span
>人评价
</div>
</div>
</div>
<div class="goods-page">
<Page
show-sizer
@on-change="changePageNum"
@on-page-size-change="changePageSize"
:total="total"
:page-size="params.pageSize"
></Page>
</div>
<BaseFooter />
</div>
<!-- <div class="goods-list">-->
<!-- <empty v-if="goodsList.length === 0"/>-->
<!-- <div-->
<!-- v-else-->
<!-- class="goods-show-info"-->
<!-- v-for="(item, index) in goodsList"-->
<!-- :key="index"-->
<!-- @click="goGoodsDetail(item.content.id, item.content.goodsId)"-->
<!-- >-->
<!-- <div class="goods-show-img">-->
<!-- <img width="220" height="220" :src="item.content.thumbnail"/>-->
<!-- </div>-->
<!-- <div class="goods-show-price">-->
<!-- <span>-->
<!-- <span class="seckill-price text-danger">{{-->
<!-- item.content.price | unitPrice("¥")-->
<!-- }}</span>-->
<!-- </span>-->
<!-- </div>-->
<!-- <div class="goods-show-detail">-->
<!-- <span>{{ item.content.goodsName }}</span>-->
<!-- </div>-->
<!-- <div class="goods-show-num">-->
<!-- 已有<span>{{ item.content.commentNum || 0 }}</span-->
<!-- >人评价-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
<!-- <div class="goods-page">-->
<!-- <Page-->
<!-- show-sizer-->
<!-- @on-change="changePageNum"-->
<!-- @on-page-size-change="changePageSize"-->
<!-- :total="total"-->
<!-- :page-size="params.pageSize"-->
<!-- ></Page>-->
<!-- </div>-->
<!-- -->
<!-- 楼层装修部分 -->
<model-form ref="modelForm" :data="modelForm"></model-form>
<BaseFooter/>
<div v-if="enablePageData">
<drawer></drawer>
<!-- 固定头部 -->
<hover-search
class="hover-search"
:class="{ show: topSearchShow }"
></hover-search>
<!-- 顶部广告 -->
<FixedTopPage :data="topAdvert"></FixedTopPage>
<!-- 头部 包括登录我的订单等 -->
<BaseHeader></BaseHeader>
<!-- 搜索框logo -->
<Search :store="true" @search="search"></Search>
<!-- 商品分类 -->
<cateNav
:showAlways="true"
v-if="showNav"
:large="carouselLarge"
:opacity="carouselOpacity"
></cateNav>
<!-- 楼层装修部分 -->
<model-form ref="modelForm" :data="modelForm"></model-form>
<!-- 底部栏 -->
<BaseFooter></BaseFooter>
</div>
</div>
</template>
<script>
import { getDetailById, getCateById } from "@/api/shopentry";
import { cancelCollect, collectGoods, isCollection } from "@/api/member";
import { goodsList } from "@/api/goods";
import {getDetailById, getCateById} from "@/api/shopentry";
import {cancelCollect, collectGoods, isCollection} from "@/api/member";
import {goodsList} from "@/api/goods";
import Search from "@/components/Search";
import ModelForm from "@/components/indexDecorate/ModelForm";
import HoverSearch from "@/components/header/hoverSearch";
import storage from "@/plugins/storage";
import { getFloorStoreData } from "@/api/index.js";
import { seckillByDay } from "@/api/promotion";
import {getFloorStoreData} from "@/api/index.js";
import {seckillByDay} from "@/api/promotion";
export default {
name: "Merchant",
components: {
@ -153,13 +134,12 @@ export default {
data() {
return {
//
modelForm: { list: [] }, //
modelForm: {list: []}, //
topAdvert: {}, // 广
showNav: false, //
topSearchShow: false, //
carouselLarge: false, //
carouselOpacity: false, // ,
enablePageData: false, //
basePageData: false, //
storeMsg: {}, //
@ -184,7 +164,7 @@ export default {
methods: {
getIndexData() {
//
getFloorStoreData({ clientType: "PC", num: this.$route.query.id ,pageType:'STORE'}).then(
getFloorStoreData({clientType: "PC", num: this.$route.query.id, pageType: 'STORE'}).then(
(res) => {
if (res.success) {
let dataJson = JSON.parse(res.result.pageData);
@ -226,35 +206,21 @@ export default {
//
getDetailById(this.$route.query.id).then((res) => {
if (res.success) {
if (res.result.pageShow == "1") {
this.getIndexData();
let that = this;
window.onscroll = function () {
let top =
document.documentElement.scrollTop || document.body.scrollTop;
if (top > 300) {
that.topSearchShow = true;
} else {
that.topSearchShow = false;
}
};
//
this.enablePageData = true;
} else {
this.storeMsg = res.result;
document.title = this.storeMsg.storeName;
if (this.Cookies.getItem("userInfo")) {
isCollection("STORE", this.storeMsg.storeId).then((res) => {
if (res.success && res.result) {
this.storeCollected = true;
}
});
}
this.basePageData = true;
this.getCateList();
this.getGoodsList();
}
this.storeMsg = res.result;
this.getIndexData();
let that = this;
window.onscroll = function () {
let top =
document.documentElement.scrollTop || document.body.scrollTop;
if (top > 300) {
that.topSearchShow = true;
} else {
that.topSearchShow = false;
}
};
}
});
},
@ -275,13 +241,14 @@ export default {
this.total = res.result.totalElements;
}
})
.catch(() => {});
.catch(() => {
});
},
goGoodsDetail(skuId, goodsId) {
//
let routeUrl = this.$router.resolve({
path: "/goodsDetail",
query: { skuId, goodsId },
query: {skuId, goodsId},
});
window.open(routeUrl.href, "_blank");
},
@ -330,15 +297,18 @@ export default {
<style scoped lang="scss">
@import "../assets/styles/goodsList.scss";
.merchant {
margin: 0 auto;
}
.shop-logo {
position: relative;
width: 100%;
background-color: #666;
padding: 4px;
color: #fff;
> div {
display: flex;
width: 1200px;
@ -354,9 +324,11 @@ export default {
width: 200px;
}
}
p:nth-child(1) {
font-size: 20px;
}
p:nth-child(2) {
font-size: 14px;
max-height: 40px;
@ -367,21 +339,25 @@ export default {
.store-category {
background-color: #005aa0;
color: #fff;
.cate-list {
width: 1200px;
margin: 0 auto;
clear: left;
height: 30px;
line-height: 30px;
.cate-item {
margin-right: 25px;
float: left;
}
.cate-item:hover {
cursor: pointer;
}
}
}
.promotion-decorate::before,
.promotion-decorate::after {
background-image: url("/src/assets/images/sprite@2x.png");

View File

@ -10,12 +10,14 @@
"dev": "vue-cli-service serve"
},
"dependencies": {
"-": "0.0.1",
"@amap/amap-jsapi-loader": "0.0.7",
"@antv/g2": "^4.1.14",
"axios": "^0.21.1",
"dplayer": "^1.26.0",
"dplayer": "^1.27.0",
"js-cookie": "^2.2.1",
"node-sass": "^4.14.1",
"s": "^1.0.0",
"sass-loader": "^8.0.2",
"sockjs-client": "^1.4.0",
"swiper": "^6.3.5",

View File

@ -3,25 +3,16 @@ var BASE = {
* @description api请求基础路径
*/
API_DEV: {
<<<<<<< HEAD
common: "http://192.168.0.102:8890",
buyer: "https://buyer-api.pickmall.cn",
seller: "http://192.168.0.102:8889",
manager: "https://admin-api.pickmall.cn"
=======
// common: "http://localhost:8890",
// buyer: "http://localhost:8888",
// seller: "http://localhost:8889",
// manager: "http://localhost:8887"
common:"http://127.0.0.1:8890",
buyer:"http://192.168.0.113:8888",
manager:"http://192.168.0.113:8887",
<<<<<<< HEAD
seller:"http://192.168.0.113:8889"
>>>>>>> 32336decc6e9e0ae8a0e67033f8ca66a89bbd372
=======
seller:"http://127.0.0.1:8889"
>>>>>>> 4ea142ea086a3f534419a31b595de80497e16d90
common: "http://localhost:8890",
buyer: "http://localhost:8888",
seller: "http://localhost:8889",
manager: "http://localhost:8887"
// common:"http://127.0.0.1:8890",
// buyer:"http://192.168.0.113:8888",
// manager:"http://192.168.0.113:8887",
//
// seller:"http://192.168.0.113:8889"
},
API_PROD: {
common: "https://common-api.pickmall.cn",

View File

@ -6,7 +6,8 @@ import {
deleteRequest,
importRequest,
getRequestWithNoToken,
commonUrl
commonUrl,
postRequestWithNoForm
} from "@/libs/axios";
// 获取数据字典
export const getDictData = "/dictData/getByType/";
@ -355,3 +356,13 @@ export const refundStatistics = params => {
export const refundPriceStatistics = params => {
return getRequest(`/statistics/refund/order/getPrice`, params);
};
//下载结算单
export const downLoadGoods = () => {
return getRequest(`/goods/import/downLoad/`, {}, 'blob')
}
// 上传待发货的订单列表
export const uploadGoodsExcel = params => {
return postRequestWithNoForm(`/goods/import/import`, params );
};

View File

@ -21,7 +21,6 @@ export const getAllCity = (params) => {
export const getCurrentPermissionList = (params) => {
return getRequest("/menu/memberMenu", params);
};
// 登陆
export const getHomeNotice = params => {
return getRequest("/other/article/getByPage?type=STORE_ARTICLE&pageSize=15");
@ -131,7 +130,6 @@ export const unRelate = params => {
export const getRelatedListData = params => {
return getRequest("/relate/findByCondition", params);
};
// 获取用户数据 多条件
export const getUserListData = params => {
return getRequest("/clerk", params);

View File

@ -4,10 +4,6 @@ import {
postRequest,
putRequest,
deleteRequest,
importRequest,
getRequestWithNoToken,
putRequestWithNoForm,
postRequestWithNoForm,
} from "@/libs/axios";
/**
@ -15,8 +11,7 @@ import {
*
*/
export const setHomeSetup = params => {
return postRequest("/other/pageData/add", params);
return postRequest("/settings/pageData/save", params);
};
/**
@ -25,7 +20,7 @@ export const setHomeSetup = params => {
*/
export const getHomeData = params => {
return getRequest(`/other/pageData/${params}`);
return getRequest(`/settings/pageData/${params}`);
};
@ -34,21 +29,8 @@ export const getHomeData = params => {
*
*/
export const getHomeList = params => {
return getRequest(`/settings/pageData/${params.pageClientType}/pageDataList`, params);
return getRequest("/other/pageData/pageDataList", params);
};
/**
* 发布页面
*
*/
export const releasePageHome = (id) => {
return putRequest(`/other/pageData/release/${id}`);
};
@ -57,8 +39,7 @@ export const getHomeList = params => {
*
*/
export const updateHome = (id, params) => {
return putRequest(`/other/pageData/update/${id}`, params);
return putRequest(`/settings/pageData/update/${id}`, params);
};
/**
@ -66,7 +47,15 @@ export const getHomeList = params => {
*
*/
export const removePageHome = (id) => {
return deleteRequest(`/other/pageData/remove/${id}`);
return deleteRequest(`/settings/pageData/removePageData/${id}`);
};
/**
* 发布页面
*
*/
export const releasePageHome = (id) => {
return putRequest(`/settings/pageData/release/${id}`);
};

View File

@ -491,14 +491,34 @@ export const result = [{
children: null,
},
{
name: "shopAddress",
name: "wapList",
level: 2,
type: 0,
title: "自提管理",
path: "shopAddress",
component: "shop/shopAddress",
children: null,
}
title: "移动楼层",
path: "wapList",
component: "shop/wap/wapList",
children: null
},
{
name: "pcList",
level: 2,
type: 0,
title: "PC楼层",
path: "pcList",
component: "shop/floorList",
children: null
},
// {
// name: "shopAddress",
// level: 2,
// type: 0,
// title: "自提管理",
// path: "shopAddress",
// component: "shop/shopAddress",
// children: null,
// }
]
}
]

View File

@ -1,5 +1,6 @@
import lazyLoading from './lazyLoading.js';
import Cookies from "js-cookie";
import { result } from './routerJson.js';
import { getCurrentPermissionList } from "@/api/index";
@ -10,447 +11,447 @@ let util = {
};
util.title = function (title) {
title = title || `${config.title} 商家后台`;
window.document.title = title;
title = title || `${config.title} 商家后台`;
window.document.title = title;
};
util.millsToTime = function (mills) {
if (!mills) {
return "";
}
let s = mills / 1000;
if (s < 60) {
return s.toFixed(0) + " 秒"
}
let m = s / 60;
if (m < 60) {
return m.toFixed(0) + " 分钟"
}
let h = m / 60;
if (h < 24) {
return h.toFixed(0) + " 小时"
}
let d = h / 24;
if (d < 30) {
return d.toFixed(0) + " 天"
}
let month = d / 30
if (month < 12) {
return month.toFixed(0) + " 个月"
}
let year = month / 12
return year.toFixed(0) + " 年"
if (!mills) {
return "";
}
let s = mills / 1000;
if (s < 60) {
return s.toFixed(0) + " 秒"
}
let m = s / 60;
if (m < 60) {
return m.toFixed(0) + " 分钟"
}
let h = m / 60;
if (h < 24) {
return h.toFixed(0) + " 小时"
}
let d = h / 24;
if (d < 30) {
return d.toFixed(0) + " 天"
}
let month = d / 30
if (month < 12) {
return month.toFixed(0) + " 个月"
}
let year = month / 12
return year.toFixed(0) + " 年"
};
util.inOf = function (arr, targetArr) {
let res = true;
arr.forEach(item => {
if (targetArr.indexOf(item) < 0) {
res = false;
}
});
return res;
let res = true;
arr.forEach(item => {
if (targetArr.indexOf(item) < 0) {
res = false;
}
});
return res;
};
util.oneOf = function (ele, targetArr) {
if (targetArr.indexOf(ele) >= 0) {
return true;
} else {
return false;
}
if (targetArr.indexOf(ele) >= 0) {
return true;
} else {
return false;
}
};
util.getRouterObjByName = function (routers, name) {
if (!name || !routers || !routers.length) {
return null;
}
let routerObj = null;
for (let item of routers) {
if (item.name == name) {
return item;
}
routerObj = util.getRouterObjByName(item.children, name);
if (routerObj) {
return routerObj;
}
}
if (!name || !routers || !routers.length) {
return null;
}
let routerObj = null;
for (let item of routers) {
if (item.name == name) {
return item;
}
routerObj = util.getRouterObjByName(item.children, name);
if (routerObj) {
return routerObj;
}
}
return null;
};
util.handleTitle = function (vm, item) {
if (typeof item.title == 'object') {
return item.title;
} else {
return item.title;
}
if (typeof item.title == 'object') {
return item.title;
} else {
return item.title;
}
};
util.setCurrentPath = function (vm, name) {
let title = '';
let isOtherRouter = false;
vm.$store.state.app.routers.forEach(item => {
if (item.children.length == 1) {
if (item.children[0].name == name) {
title = util.handleTitle(vm, item);
if (item.name == 'otherRouter') {
isOtherRouter = true;
}
}
} else {
item.children.forEach(child => {
if (child.name == name) {
title = util.handleTitle(vm, child);
if (item.name == 'otherRouter') {
isOtherRouter = true;
}
}
});
let title = '';
let isOtherRouter = false;
vm.$store.state.app.routers.forEach(item => {
if (item.children.length == 1) {
if (item.children[0].name == name) {
title = util.handleTitle(vm, item);
if (item.name == 'otherRouter') {
isOtherRouter = true;
}
});
let currentPathArr = [];
if (name == 'home_index') {
currentPathArr = [
{
title: util.handleTitle(vm, util.getRouterObjByName(vm.$store.state.app.routers, 'home_index')),
path: '',
name: 'home_index'
}
];
} else if ((name.indexOf('_index') >= 0 || isOtherRouter) && name !== 'home_index') {
currentPathArr = [
{
title: util.handleTitle(vm, util.getRouterObjByName(vm.$store.state.app.routers, 'home_index')),
path: '/home',
name: 'home_index'
},
{
title: title,
path: '',
name: name
}
];
}
} else {
let currentPathObj = vm.$store.state.app.routers.filter(item => {
if (item.children.length <= 1) {
return item.children[0].name == name;
} else {
let i = 0;
let childArr = item.children;
let len = childArr.length;
while (i < len) {
if (childArr[i].name == name) {
return true;
}
i++;
}
return false;
}
})[0];
if (currentPathObj.children.length <= 1 && currentPathObj.name == 'home') {
currentPathArr = [
{
title: '首页',
path: '',
name: 'home_index'
}
];
} else if (currentPathObj.children.length <= 1 && currentPathObj.name !== 'home') {
currentPathArr = [
{
title: '首页',
path: '/home',
name: 'home_index'
},
{
title: currentPathObj.title,
path: '',
name: name
}
];
} else {
let childObj = currentPathObj.children.filter((child) => {
return child.name == name;
})[0];
currentPathArr = [
{
title: '首页',
path: '/home',
name: 'home_index'
},
{
title: currentPathObj.title,
path: '',
name: currentPathObj.name
},
{
title: childObj.title,
path: currentPathObj.path + '/' + childObj.path,
name: name
}
];
item.children.forEach(child => {
if (child.name == name) {
title = util.handleTitle(vm, child);
if (item.name == 'otherRouter') {
isOtherRouter = true;
}
}
});
}
vm.$store.commit('setCurrentPath', currentPathArr);
});
let currentPathArr = [];
if (name == 'home_index') {
currentPathArr = [
{
title: util.handleTitle(vm, util.getRouterObjByName(vm.$store.state.app.routers, 'home_index')),
path: '',
name: 'home_index'
}
];
} else if ((name.indexOf('_index') >= 0 || isOtherRouter) && name !== 'home_index') {
currentPathArr = [
{
title: util.handleTitle(vm, util.getRouterObjByName(vm.$store.state.app.routers, 'home_index')),
path: '/home',
name: 'home_index'
},
{
title: title,
path: '',
name: name
}
];
} else {
let currentPathObj = vm.$store.state.app.routers.filter(item => {
if (item.children.length <= 1) {
return item.children[0].name == name;
} else {
let i = 0;
let childArr = item.children;
let len = childArr.length;
while (i < len) {
if (childArr[i].name == name) {
return true;
}
i++;
}
return false;
}
})[0];
if (currentPathObj.children.length <= 1 && currentPathObj.name == 'home') {
currentPathArr = [
{
title: '首页',
path: '',
name: 'home_index'
}
];
} else if (currentPathObj.children.length <= 1 && currentPathObj.name !== 'home') {
currentPathArr = [
{
title: '首页',
path: '/home',
name: 'home_index'
},
{
title: currentPathObj.title,
path: '',
name: name
}
];
} else {
let childObj = currentPathObj.children.filter((child) => {
return child.name == name;
})[0];
currentPathArr = [
{
title: '首页',
path: '/home',
name: 'home_index'
},
{
title: currentPathObj.title,
path: '',
name: currentPathObj.name
},
{
title: childObj.title,
path: currentPathObj.path + '/' + childObj.path,
name: name
}
];
}
}
vm.$store.commit('setCurrentPath', currentPathArr);
return currentPathArr;
return currentPathArr;
};
util.openNewPage = function (vm, name, argu, query) {
if (!vm.$store) {
return;
if (!vm.$store) {
return;
}
let storeOpenedList = vm.$store.state.app.storeOpenedList;
let openedPageLen = storeOpenedList.length;
let i = 0;
let tagHasOpened = false;
while (i < openedPageLen) {
if (name == storeOpenedList[i].name) { // 页面已经打开
vm.$store.commit('storeOpenedList', {
index: i,
argu: argu,
query: query
});
tagHasOpened = true;
break;
}
let storeOpenedList = vm.$store.state.app.storeOpenedList;
let openedPageLen = storeOpenedList.length;
let i = 0;
let tagHasOpened = false;
while (i < openedPageLen) {
if (name == storeOpenedList[i].name) { // 页面已经打开
vm.$store.commit('storeOpenedList', {
index: i,
argu: argu,
query: query
});
tagHasOpened = true;
break;
}
i++;
i++;
}
if (!tagHasOpened) {
let tag = vm.$store.state.app.tagsList.filter((item) => {
if (item.children) {
return name == item.children[0].name;
} else {
return name == item.name;
}
});
tag = tag[0];
if (tag) {
tag = tag.children ? tag.children[0] : tag;
if (argu) {
tag.argu = argu;
}
if (query) {
tag.query = query;
}
vm.$store.commit('increateTag', tag);
}
if (!tagHasOpened) {
let tag = vm.$store.state.app.tagsList.filter((item) => {
if (item.children) {
return name == item.children[0].name;
} else {
return name == item.name;
}
});
tag = tag[0];
if (tag) {
tag = tag.children ? tag.children[0] : tag;
if (argu) {
tag.argu = argu;
}
if (query) {
tag.query = query;
}
vm.$store.commit('increateTag', tag);
}
}
vm.$store.commit('setCurrentPageName', name);
}
vm.$store.commit('setCurrentPageName', name);
};
util.toDefaultPage = function (routers, name, route, next) {
let len = routers.length;
let i = 0;
let notHandle = true;
while (i < len) {
if (routers[i].name == name && routers[i].children && routers[i].redirect == undefined) {
route.replace({
name: routers[i].children[0].name
});
notHandle = false;
next();
break;
}
i++;
}
if (notHandle) {
next();
let len = routers.length;
let i = 0;
let notHandle = true;
while (i < len) {
if (routers[i].name == name && routers[i].children && routers[i].redirect == undefined) {
route.replace({
name: routers[i].children[0].name
});
notHandle = false;
next();
break;
}
i++;
}
if (notHandle) {
next();
}
};
// 将Csv文件解析为二维数组
export const getArrayFromFile = (file) => {
let nameSplit = file.name.split('.')
let format = nameSplit[nameSplit.length - 1]
return new Promise((resolve, reject) => {
let reader = new FileReader()
reader.readAsText(file) // 以文本格式读取
let arr = []
reader.onload = function (evt) {
let data = evt.target.result // 读到的数据
let pasteData = data.trim()
arr = pasteData.split((/[\n\u0085\u2028\u2029]|\r\n?/g)).map(row => {
return row.split('\t')
}).map(item => {
return item[0].split(',')
})
if (format == 'csv') resolve(arr)
else reject(new Error('[Format Error]:不是Csv文件'))
}
})
let nameSplit = file.name.split('.')
let format = nameSplit[nameSplit.length - 1]
return new Promise((resolve, reject) => {
let reader = new FileReader()
reader.readAsText(file) // 以文本格式读取
let arr = []
reader.onload = function (evt) {
let data = evt.target.result // 读到的数据
let pasteData = data.trim()
arr = pasteData.split((/[\n\u0085\u2028\u2029]|\r\n?/g)).map(row => {
return row.split('\t')
}).map(item => {
return item[0].split(',')
})
if (format == 'csv') resolve(arr)
else reject(new Error('[Format Error]:不是Csv文件'))
}
})
}
// 将二维数组转为表格数据
export const getTableDataFromArray = (array) => {
let columns = []
let tableData = []
if (array.length > 1) {
let titles = array.shift()
columns = titles.map(item => {
return {
title: item,
key: item
}
})
tableData = array.map(item => {
let res = {}
item.forEach((col, i) => {
res[titles[i]] = col
})
return res
})
}
return {
columns,
tableData
}
let columns = []
let tableData = []
if (array.length > 1) {
let titles = array.shift()
columns = titles.map(item => {
return {
title: item,
key: item
}
})
tableData = array.map(item => {
let res = {}
item.forEach((col, i) => {
res[titles[i]] = col
})
return res
})
}
return {
columns,
tableData
}
}
util.initRouter = function (vm) { // 初始化路由
const constRoutes = [];
const otherRoutes = [];
const constRoutes = [];
const otherRoutes = [];
// 404路由需要和动态路由一起加载
const otherRouter = [{
path: '/*',
name: 'error-404',
meta: {
title: '404-页面不存在'
},
component: 'error-page/404'
}];
// 判断用户是否登录
let userInfo = Cookies.get('userInfoSeller')
if (!userInfo) {
// 未登录
return;
// 404路由需要和动态路由一起加载
const otherRouter = [{
path: '/*',
name: 'error-404',
meta: {
title: '404-页面不存在'
},
component: 'error-page/404'
}];
// 判断用户是否登录
let userInfo = Cookies.get('userInfoSeller')
if (!userInfo) {
// 未登录
return;
}
// 加载菜单
getCurrentPermissionList().then(res => {
if (!res.success) return false;
let menuData = res.result;
// 格式化数据,设置 空children 为 null
for (let i = 0; i < menuData.length; i++) {
let t = menuData[i].children
for (let k = 0; k < t.length; k++) {
let tt = t[k].children;
for (let z = 0; z < tt.length; z++) {
tt[z].children = null
// 给所有三级路由添加字段显示一级菜单name方便点击页签时的选中筛选
tt[z].firstRouterName = menuData[i].name
}
}
}
// 加载菜单
getCurrentPermissionList().then(res => {
if (!res.success) return false;
let menuData = res.result;
// 格式化数据,设置 空children 为 null
for (let i = 0; i < menuData.length; i++) {
let t = menuData[i].children
for (let k = 0; k < t.length; k++) {
let tt = t[k].children;
for (let z = 0; z < tt.length; z++) {
tt[z].children = null
// 给所有三级路由添加字段显示一级菜单name方便点击页签时的选中筛选
tt[z].firstRouterName = menuData[i].name
}
}
}
if (!menuData) {
return;
}
util.initAllMenuData(constRoutes, menuData);
util.initRouterNode(otherRoutes, otherRouter);
// 添加所有主界面路由
vm.$store.commit('updateAppRouter', constRoutes.filter(item => item.children.length > 0));
// 添加全局路由
vm.$store.commit('updateDefaultRouter', otherRoutes);
// 添加菜单路由
util.initMenuData(vm, menuData);
// 缓存数据 修改加载标识
window.localStorage.setItem('menuData', JSON.stringify(menuData));
vm.$store.commit('setAdded', true);
})
if (!menuData) {
return;
}
util.initAllMenuData(constRoutes, menuData);
util.initRouterNode(otherRoutes, otherRouter);
// 添加所有主界面路由
vm.$store.commit('updateAppRouter', constRoutes.filter(item => item.children.length > 0));
// 添加全局路由
vm.$store.commit('updateDefaultRouter', otherRoutes);
// 添加菜单路由
util.initMenuData(vm, menuData);
// 缓存数据 修改加载标识
window.localStorage.setItem('menuData', JSON.stringify(menuData));
vm.$store.commit('setAdded', true);
})
};
// 添加所有顶部导航栏下的菜单路由
util.initAllMenuData = function (constRoutes, data) {
let allMenuData = [];
data.forEach(e => {
if (e.level == 0) {
e.children.forEach(item => {
allMenuData.push(item);
})
}
})
util.initRouterNode(constRoutes, allMenuData);
let allMenuData = [];
data.forEach(e => {
if (e.level == 0) {
e.children.forEach(item => {
allMenuData.push(item);
})
}
})
util.initRouterNode(constRoutes, allMenuData);
}
// 生成菜单格式数据
util.initMenuData = function (vm, data) {
const menuRoutes = [];
let menuData = data;
// 顶部菜单
let navList = [];
menuData.forEach(e => {
let nav = {
name: e.name,
title: e.title,
}
navList.push(nav);
})
if (navList.length < 1) {
return;
const menuRoutes = [];
let menuData = data;
// 顶部菜单
let navList = [];
menuData.forEach(e => {
let nav = {
name: e.name,
title: e.title,
}
// 存入vuex
vm.$store.commit('setNavList', navList);
let currNav = window.localStorage.getItem('currNav')
if (currNav) {
// 读取缓存title
for (var item of navList) {
if (item.name == currNav) {
vm.$store.commit('setCurrNavTitle', item.title);
break;
}
}
} else {
// 默认第一个
currNav = navList[0].name;
vm.$store.commit('setCurrNavTitle', navList[0].title);
navList.push(nav);
})
if (navList.length < 1) {
return;
}
// 存入vuex
vm.$store.commit('setNavList', navList);
let currNav = window.localStorage.getItem('currNav')
if (currNav) {
// 读取缓存title
for (var item of navList) {
if (item.name == currNav) {
vm.$store.commit('setCurrNavTitle', item.title);
break;
}
}
vm.$store.commit('setCurrNav', currNav);
for (var item of menuData) {
if (item.name == currNav) {
// 过滤
menuData = item.children;
break;
}
} else {
// 默认第一个
currNav = navList[0].name;
vm.$store.commit('setCurrNavTitle', navList[0].title);
}
vm.$store.commit('setCurrNav', currNav);
for (var item of menuData) {
if (item.name == currNav) {
// 过滤
menuData = item.children;
break;
}
util.initRouterNode(menuRoutes, menuData);
// 刷新界面菜单
vm.$store.commit('updateMenulist', menuRoutes.filter(item => item.children.length > 0));
}
util.initRouterNode(menuRoutes, menuData);
// 刷新界面菜单
vm.$store.commit('updateMenulist', menuRoutes.filter(item => item.children.length > 0));
let tagsList = [];
vm.$store.state.app.routers.map((item) => {
if (item.children.length <= 1) {
tagsList.push(item.children[0]);
} else {
tagsList.push(...item.children);
}
});
vm.$store.commit('setTagsList', tagsList);
let tagsList = [];
vm.$store.state.app.routers.map((item) => {
if (item.children.length <= 1) {
tagsList.push(item.children[0]);
} else {
tagsList.push(...item.children);
}
});
vm.$store.commit('setTagsList', tagsList);
};
// 生成路由节点
util.initRouterNode = function (routers, data) { // data为所有子菜单数据
for (var item of data) {
let menu = Object.assign({}, item);
menu.component = lazyLoading(menu.frontRoute);
if (item.children && item.children.length > 0) {
menu.children = [];
util.initRouterNode(menu.children, item.children);
}
let meta = {};
// 给页面添加标题
meta.title = menu.title ? menu.title + " - " + config.title + "商家后台" : null;
meta.firstRouterName = item.firstRouterName
meta.keepAlive = menu.keepAlive ? true : false
menu.meta = meta;
routers.push(menu);
for (var item of data) {
let menu = Object.assign({}, item);
menu.component = lazyLoading(menu.frontRoute);
if (item.children && item.children.length > 0) {
menu.children = [];
util.initRouterNode(menu.children, item.children);
}
let meta = {};
// 给页面添加标题
meta.title = menu.title ? menu.title + " - " + config.title + "商家后台" : null;
meta.firstRouterName = item.firstRouterName
meta.keepAlive = menu.keepAlive ? true : false
menu.meta = meta;
routers.push(menu);
}
};
export default util;

View File

@ -5,6 +5,7 @@ import "./styles/theme.less";
import "core-js/stable";
import vueQr from "vue-qr";
import liliDialog from '@/views/lili-dialog'
import App from "./App";
import { router } from "./router/index";
import store from "./store";
@ -21,7 +22,6 @@ import { setStore, getStore, removeStore } from "@/libs/storage";
import i18nBox from '@/views/lili-components/i18n-translate'
import util from "@/libs/util";
import liliDialog from '@/views/lili-dialog'
import VueLazyload from "vue-lazyload";
import * as filters from "@/utils/filters"; // global filter
@ -37,6 +37,7 @@ Vue.use(VueLazyload, {
Vue.use(ViewUI);
Vue.component('liliDialog',liliDialog)
Vue.component('i18nBox',i18nBox)
Vue.component('liliDialog',liliDialog)
Vue.component("vue-qr", vueQr); //此处将vue-qr添加为全局组件
// 挂载全局使用的方法

View File

@ -102,6 +102,18 @@ export const otherRouter = {
name: "order-detail",
component: () => import("@/views/order/order/orderDetail.vue")
},
{
path: "/floorList/main",
title: "编辑模板",
name: "main",
component: () => import("@/views/shop/wap/main.vue")
},
{
path: "/pcFloorList/main",
title: "编辑模板",
name: "renovation",
component: () => import("@/views/shop/renovation.vue")
},
{
path: "order-complaint-detail",
title: "投诉详情",

View File

@ -162,3 +162,60 @@ export function formatDate(date, fmt) {
}
return fmt;
}
// 楼层装修,选择链接处理跳转方式
export function formatLinkType (item) {
const types = ['goods', 'category', 'shops', 'marketing', 'pages', 'other'] // 所有跳转的分类 依次为 商品、分类、店铺、活动、页面、其他
let url = '';
switch (item.___type) {
case 'goods':
url = `/goodsDetail?skuId=${item.id}&goodsId=${item.goodsId}`;
break;
case 'category':
url = `/goodsList?categoryId=${item.allId}`;
break;
case 'shops':
url = `/merchant?id=${item.id}`;
break;
case 'marketing': // 暂无数据,需要后续修改
url = `/seckill?id=${item.id}`;
break;
case 'pages': // 暂无数据,需要后续修改
url = `/article?id=${item.id}`;
break;
case 'other':
switch (item.title) {
case '首页':
url = '/';
break;
case '购物车':
url = '/cart';
break;
case '我的订单':
url = '/home/MyOrder';
break;
case '收藏商品':
url = '/home/Favorites';
break;
case '个人中心':
url = '/home';
break;
case '外部链接':
url = item.url;
break;
case '秒杀频道':
url = '/seckill';
break;
case '领券中心':
url = '/coupon';
break;
}
break;
}
return url;
}

View File

@ -181,7 +181,7 @@
</div>
</Modal>
<Modal title="导入商品信息" v-model="importModal" :mask-closable="false">
<div>
<div style="text-align: center">
<Upload :before-upload="handleUpload" name="files" accept="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel"
multiple type="drag" :action="action" :headers="accessToken">
<div style="padding: 50px 0">
@ -189,6 +189,7 @@
<h2>选择或拖拽文件上传</h2>
</div>
</Upload>
<Button @click="exportGoods" type="text" style="color: red">下载导入模板</Button>
</div>
<div slot="footer">
<Button type="text" @click="importModal = false">确定</Button>
@ -206,9 +207,12 @@ import {
lowGoods,
deleteGoods,
batchShipTemplate,
downLoadGoods
} from "@/api/goods";
import { baseUrl } from "@/libs/axios.js";
import * as API_Shop from "@/api/shops";
import Cookies from "js-cookie";
import {uploadGoodsExcel} from "../../../api/goods";
export default {
name: "goods",
@ -511,9 +515,51 @@ export default {
this.upload();
return false;
},
/**
* 上传文件
*/
async upload() {
let fd = new FormData();
fd.append("files", this.file);
let res = await uploadGoodsExcel(fd);
if (res.success) {
this.stepList.map((item) => {
item.checked = false;
});
this.stepList[2].checked = true;
}
},
openImportGoods(){
this.importModal = true
},
async exportGoods(){
downLoadGoods()
.then((res) => {
console.log(res)
const blob = new Blob([res], {
type: "application/vnd.ms-excel;charset=utf-8",
});
//<a> Firefox Chrome download
//IE10blobdownload
if ("download" in document.createElement("a")) {
//adownload
const link = document.createElement("a"); //a
link.download = "商品批量导入模板.xls"; //a
link.style.display = "none";
link.href = URL.createObjectURL(blob);
document.body.appendChild(link);
link.click(); //
URL.revokeObjectURL(link.href); //url
document.body.removeChild(link); //
} else {
navigator.msSaveBlob(blob, fileName);
}
})
.catch((err) => {
console.log(err);
});
},
//
updateStock() {
let updateStockList = this.stockList.map((i) => {

0
seller/src/views/lili-dialog/goods-dialog.vue Normal file → Executable file
View File

0
seller/src/views/lili-dialog/index.vue Normal file → Executable file
View File

0
seller/src/views/lili-dialog/link-dialog.vue Normal file → Executable file
View File

0
seller/src/views/lili-dialog/style.scss Normal file → Executable file
View File

View File

@ -11,6 +11,17 @@ export default [
// name: "category"
// },
// {
// title: "活动",
// url: "3",
// name: "marketing"
// },
// {
// title: "页面",
// url: "3",
// name: "pages"
// },
// {
// title: "活动",
// url: "3",

View File

@ -126,7 +126,7 @@ export default {
const data = this.formData;
data.status ? (data.pageShow = "OPEN") : (data.pageShow = "CLOSE");
delete data.status;
(data.pageType = "INDEX"), (data.pageClientType = "PC");
(data.pageType = "STORE"), (data.pageClientType = "PC");
if (data.id) {
API_floor.updateHome(data.id, data).then((res) => {
this.$Message.success("编辑模板成功");

View File

@ -1,98 +1,5 @@
export const modelData = [{
type: 'carousel',
name: '图片轮播',
icon: 'md-image',
showName: '',
size: "790*340",
options: {
list: [{
img: require('@/assets/nav/1.jpg'),
url: ''
},
{
img: require('@/assets/nav/2.jpg'),
url: ''
},
{
img: require('@/assets/nav/3.jpg'),
url: ''
}
],
},
},
// {
// type: 'carousel1',
// name: '图片轮播1',
// icon: 'md-image',
// size: "1200*470",
// options: {
// list: [{
// img: require('@/assets/nav/1.jpg'),
// url: '',
// bgColor: 'yellow'
// },
// {
// img: require('@/assets/nav/2.jpg'),
// url: '',
// bgColor: 'purple'
// },
// {
// img: require('@/assets/nav/3.jpg'),
// url: '',
// bgColor: 'blue'
// }
// ],
// },
// },
// {
// type: 'carousel2',
// name: '图片轮播2',
// icon: 'md-image',
// size: "590*470",
// options: {
// list: [{
// img: require('@/assets/nav/1.jpg'),
// url: ''
// },
// {
// img: require('@/assets/nav/2.jpg'),
// url: ''
// },
// {
// img: require('@/assets/nav/3.jpg'),
// url: ''
// }
// ],
// listRight: [
// [{
// img: require('@/assets/nav/1.jpg'),
// url: ''
// },
// {
// img: require('@/assets/nav/2.jpg'),
// url: ''
// },
// {
// img: require('@/assets/nav/3.jpg'),
// url: ''
// }
// ],
// [{
// img: require('@/assets/nav/1.jpg'),
// url: ''
// },
// {
// img: require('@/assets/nav/2.jpg'),
// url: ''
// },
// {
// img: require('@/assets/nav/3.jpg'),
// url: ''
// }
// ],
// ]
// },
// },
export const modelData = [
{
type: 'hotAdvert',
name: '热门广告',

View File

@ -61,7 +61,7 @@
</ul>
</div>
</div>
</div>
</div>)
</div>
<!-- 左侧轮播装修 -->
<Modal
@ -166,14 +166,12 @@
</table>
</TabPane>
</Tabs>
</div>
</Modal>
<!-- 选择商品链接 -->
<liliDialog
ref="liliDialog"
@selectedLink="selectedLink"
></liliDialog>
<!-- 选择图片 -->
<Modal width="1200px" v-model="picModelFlag" footer-hide>

View File

@ -459,10 +459,9 @@ export default {
}
});
},
<<<<<<< HEAD
pageShow(type){
pageShow(type) {
this.form.pageShow = type
=======
},
getDeliverAddress(){
API_Shop.getDeliverAddress().then(res=>{
if(res.success){
@ -474,7 +473,6 @@ export default {
}
}
})
>>>>>>> 4ea142ea086a3f534419a31b595de80497e16d90
},
//
regionClick() {

View File

@ -116,7 +116,7 @@ export default {
: (this.submitWay.pageShow = "CLOSE");
this.submitWay.pageData = JSON.stringify(this.$store.state.styleStore);
this.submitWay.pageType = "INDEX";
this.submitWay.pageType = "STORE";
this.$route.query.id ? this.update() : this.submit(this.submitWay);
},
@ -128,7 +128,7 @@ export default {
pageData: JSON.stringify(this.$store.state.styleStore),
name: this.submitWay.name,
pageShow: this.submitWay.pageShow,
pageType: "INDEX",
pageType: "STORE",
pageClientType: "H5",
})
.then((res) => {

View File

@ -63,7 +63,7 @@ export default {
pageSize: 10,
sort: "createTime",
order: "desc",
pageType: "INDEX",
pageType: "STORE",
pageClientType: "H5",
},
total: 0, //