commit message
46
seller/src/App.vue
Normal file
@@ -0,0 +1,46 @@
|
||||
<template>
|
||||
<div id="main" class="app-main">
|
||||
<router-view></router-view>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
mounted() {},
|
||||
beforeDestroy() {},
|
||||
methods: {}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style>
|
||||
html,
|
||||
body {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: #f0f0f0;
|
||||
}
|
||||
|
||||
.app-main {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.br button {
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
.operation button {
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
.ivu-btn-text:focus {
|
||||
box-shadow: none !important;
|
||||
}
|
||||
|
||||
.ivu-tag {
|
||||
cursor: pointer;
|
||||
}
|
||||
</style>
|
||||
10
seller/src/api/address.js
Normal file
@@ -0,0 +1,10 @@
|
||||
// 统一请求路径前缀在libs/axios.js中修改
|
||||
import {getRequest, postRequest, putRequest, deleteRequest, importRequest, getRequestWithNoToken} from '@/libs/axios';
|
||||
|
||||
|
||||
// 传给后台citycode 获取城市街道等id
|
||||
export const handleRegion = (params) => {
|
||||
return getRequest(`/address/region`,params)
|
||||
}
|
||||
|
||||
|
||||
11
seller/src/api/common.js
Normal file
@@ -0,0 +1,11 @@
|
||||
import {commonUrl, getRequest} from '@/libs/axios';
|
||||
|
||||
// 通过id获取子地区
|
||||
export const getChildRegion = (id) => {
|
||||
return getRequest(`${commonUrl}/common/region/item/${id}`);
|
||||
};
|
||||
|
||||
// 点地图获取地址信息
|
||||
export const getRegion = (parpams) => {
|
||||
return getRequest(`${commonUrl}/common/region/region`, parpams);
|
||||
};
|
||||
72
seller/src/api/distribution.js
Normal file
@@ -0,0 +1,72 @@
|
||||
|
||||
// 统一请求路径前缀在libs/axios.js中修改
|
||||
import {getRequest, postRequest, putRequest, deleteRequest, importRequest, getRequestWithNoToken} from '@/libs/axios';
|
||||
|
||||
|
||||
//获取分销商品列表
|
||||
export const getDistributionGoods = (params) => {
|
||||
return getRequest('/distributionGoods', params)
|
||||
}
|
||||
|
||||
// 取消分销商品
|
||||
export const distributionGoodsCancel = (id) => {
|
||||
return deleteRequest(`/distributionGoods/cancel/${id}`)
|
||||
}
|
||||
|
||||
// 选择分销商品
|
||||
export const distributionGoodsCheck = (id,param) => {
|
||||
return putRequest(`/distributionGoods/checked/${id}`,param)
|
||||
}
|
||||
|
||||
|
||||
//查询分销商
|
||||
export const getDistributionListData = (params) => {
|
||||
return getRequest('/distribution/getByPage', params)
|
||||
}
|
||||
//审核分销商
|
||||
export const auditDistribution = (id, params) => {
|
||||
return putRequest(`/distribution/audit/${id}`, params)
|
||||
}
|
||||
|
||||
// 清退分销商
|
||||
export const retreatDistribution = (id, params) => {
|
||||
return putRequest(`/distribution/retreat/${id}`, params)
|
||||
}
|
||||
|
||||
// 恢复分销商
|
||||
export const resumeDistribution = (id, params) => {
|
||||
return putRequest(`/distribution/resume/${id}`, params)
|
||||
}
|
||||
|
||||
//保存更新分销设置
|
||||
export const saveDistributionSetting = (params) => {
|
||||
return postRequest('/distribution/setting/insertOrUpdate', params)
|
||||
}
|
||||
|
||||
//获取分销设置
|
||||
export const getDistributionSetting = (id, params) => {
|
||||
return getRequest(`/distribution/setting/get/${id}`, params)
|
||||
}
|
||||
|
||||
|
||||
//获取分销订单列表
|
||||
export const getDistributionOrder = (params) => {
|
||||
return getRequest('/distribution/order/getByPage', params)
|
||||
}
|
||||
|
||||
|
||||
//删除分销商品
|
||||
export const delDistributionGoods = (ids) => {
|
||||
return deleteRequest(`/distribution/goods/delByIds/${ids}`)
|
||||
}
|
||||
//获取分销佣金信息
|
||||
export const getDistributionCash = (params) => {
|
||||
return getRequest('/distribution/cash/getByPage', params)
|
||||
}
|
||||
//审核分销佣金申请
|
||||
export const auditDistributionCash = (id,params) => {
|
||||
return postRequest(`/distribution/cash/audit/${id}`, params)
|
||||
}
|
||||
|
||||
|
||||
|
||||
370
seller/src/api/goods.js
Normal file
@@ -0,0 +1,370 @@
|
||||
// 统一请求路径前缀在libs/axios.js中修改
|
||||
import {
|
||||
getRequest,
|
||||
postRequest,
|
||||
putRequest,
|
||||
deleteRequest,
|
||||
importRequest,
|
||||
getRequestWithNoToken,
|
||||
commonUrl
|
||||
} from "@/libs/axios";
|
||||
import config from "@/config";
|
||||
|
||||
// 文件上传接口
|
||||
export const uploadFile = commonUrl + "/common/upload/file";
|
||||
// 验证码渲染图片接口
|
||||
export const drawCodeImage = "/common/captcha/draw/";
|
||||
// 获取菜单
|
||||
export const getMenuList = "/permission/getMenuList";
|
||||
// 获取数据字典
|
||||
export const getDictData = "/dictData/getByType/";
|
||||
// Websocket
|
||||
export const ws = "/ws";
|
||||
|
||||
// 获取当前店铺分类
|
||||
export const getShopGoodsLabelList = () => {
|
||||
return getRequest(`/goods/label`);
|
||||
};
|
||||
|
||||
// 添加当前店铺分类
|
||||
export const addShopGoodsLabel = params => {
|
||||
return postRequest(`/goods/label`, params);
|
||||
};
|
||||
|
||||
// 修改当前店铺分类
|
||||
export const editShopGoodsLabel = params => {
|
||||
return putRequest(`/goods/label`, params);
|
||||
};
|
||||
|
||||
// 删除当前店铺分类
|
||||
export const delCategdelShopGoodsLabel = id => {
|
||||
return deleteRequest(`/goods/label/${id}`);
|
||||
};
|
||||
|
||||
// 根据goodsId分页获取商品列表
|
||||
export const getQueryGoodsIdGoodsList = goodsId => {
|
||||
return getRequest(`/goods/sku/${goodsId}/list`);
|
||||
};
|
||||
|
||||
// 获取商品分页列表
|
||||
export const getGoodsSkuListDataSeller = params => {
|
||||
return getRequest("/goods/sku/list", params);
|
||||
};
|
||||
|
||||
// 获取商品品牌分页列表
|
||||
export const getUserListData = params => {
|
||||
return getRequest("/goods/brand/getByPage", params);
|
||||
};
|
||||
// 添加或修改品牌设置
|
||||
export const insertOrUpdateBrand = params => {
|
||||
return postRequest("/goods/brand/insertOrUpdate", params);
|
||||
};
|
||||
// 启用品牌
|
||||
export const enableBrand = (id, params) => {
|
||||
return postRequest(`/goods/brand/enable/${id}`, params);
|
||||
};
|
||||
// 禁用品牌
|
||||
export const disableBrand = (id, params) => {
|
||||
return postRequest(`/goods/brand/disable/${id}`, params);
|
||||
};
|
||||
//根据分类id获取关联品牌
|
||||
export const getCategoryBrandListData = (category_id, params) => {
|
||||
return getRequest(`/category/brand/${category_id}`, params);
|
||||
};
|
||||
//保存获取关联品牌
|
||||
export const saveCategoryBrand = (category_id, params) => {
|
||||
return postRequest(`/category/brand/${category_id}`, params);
|
||||
};
|
||||
//保存获取关联规格
|
||||
export const saveCategorySpec = (category_id, params) => {
|
||||
return postRequest(`/goods/category/spec/${category_id}`, params);
|
||||
};
|
||||
|
||||
//获取所有可用品牌
|
||||
export const getBrandListData = params => {
|
||||
return getRequest("/goods/brand/all", params);
|
||||
};
|
||||
// 获取所有可用规格
|
||||
export const getSpecificationList = params => {
|
||||
return getRequest("/goods/spec/all", params);
|
||||
};
|
||||
|
||||
// 获取店铺分类列表数据
|
||||
export const getAllList = id => {
|
||||
return getRequest(`/goods/label/get/${id}`);
|
||||
};
|
||||
|
||||
// 添加商品分类
|
||||
export const insertCategory = params => {
|
||||
return postRequest("/goods/category/insertCategory", params);
|
||||
};
|
||||
// 添加商品分类
|
||||
export const updateCategory = params => {
|
||||
return postRequest("/goods/category/updateCategory", params);
|
||||
};
|
||||
//删除商品分类
|
||||
export const delCategory = id => {
|
||||
return deleteRequest(`/goods/category/del/${id}`);
|
||||
};
|
||||
// 启用分类
|
||||
export const enableCategory = (id, type) => {
|
||||
return postRequest(`/goods/category/enable/${id}`, type);
|
||||
};
|
||||
// 禁用分类
|
||||
export const disableCategory = (id, type) => {
|
||||
return postRequest(`/goods/category/disable/${id}`, type);
|
||||
};
|
||||
|
||||
// 获取商品规格分页列表
|
||||
export const getSpecListData = params => {
|
||||
return getRequest("/goods/spec/list", params);
|
||||
};
|
||||
// 添加或修改规格设置
|
||||
export const insertOrUpdateSpec = params => {
|
||||
return postRequest("/goods/spec/edit", params);
|
||||
};
|
||||
//根据分类id获取关联规格
|
||||
export const getCategorySpecListData = (category_id, params) => {
|
||||
return getRequest(`/goods/category/spec/${category_id}`, params);
|
||||
};
|
||||
//删除gUI个
|
||||
export const delSpec = (id, params) => {
|
||||
return deleteRequest(`/goods/spec/del/${id}`, params);
|
||||
};
|
||||
// 获取商品规格值列表
|
||||
export const getSpecValuesListData = (id, params) => {
|
||||
return getRequest(`/goods/spec-values/values/${id}`, params);
|
||||
};
|
||||
// 添加商品规格值
|
||||
export const saveSpecValues = (id, params) => {
|
||||
return postRequest(`/goods/spec-values/save/${id}`, params);
|
||||
};
|
||||
|
||||
// 查询某分类下的全部子分类列表
|
||||
export const getGoodsCategory = parent_id => {
|
||||
return getRequest(`/goods/category/${parent_id}/all-children`);
|
||||
};
|
||||
|
||||
// 获取商品sku分页列表
|
||||
export const getGoodsSkuData = params => {
|
||||
return getRequest("/goods/sku/list", params);
|
||||
};
|
||||
|
||||
// 获取商品分页列表
|
||||
export const getGoodsListData = params => {
|
||||
return getRequest("/goods/list", params);
|
||||
};
|
||||
// 获取待审核商品分页列表
|
||||
export const getAuthGoodsListData = params => {
|
||||
return getRequest("/goods/auth/list", params);
|
||||
};
|
||||
|
||||
// 审核商品
|
||||
export const authGoods = (id, params) => {
|
||||
return putRequest(`/goods/${id}/auth`, params);
|
||||
};
|
||||
|
||||
/**
|
||||
* 发布商品 查询商品品类 分级查询(商城商品品类)
|
||||
* @param ids
|
||||
* @param params
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
export const getGoodsCategoryLevelList = (ids, params) => {
|
||||
return getRequest(`/goods/category/${ids}/children`, params);
|
||||
};
|
||||
|
||||
// 获取全部经营类目
|
||||
export const getGoodsCategoryAll = () => {
|
||||
return getRequest(`/goods/category/all`);
|
||||
};
|
||||
|
||||
// 获取当前店铺分类
|
||||
export const getShopGoodsLabelListSeller = () => {
|
||||
return getRequest(`/goods/label`);
|
||||
};
|
||||
|
||||
//查询分类绑定参数信息
|
||||
export const getCategoryParamsListData = (id, params) => {
|
||||
return getRequest(`/goods/category/parameters/${id}`, params);
|
||||
};
|
||||
//查询商品绑定参数信息
|
||||
export const getCategoryParamsByGoodsId = (goodsId, categoryId) => {
|
||||
return getRequest(`/goods/parameters/${goodsId}/${categoryId}`);
|
||||
};
|
||||
//更新或者保存参数
|
||||
export const insertOrUpdateParams = params => {
|
||||
return postRequest("/goods/parameters/save", params);
|
||||
};
|
||||
//删除参数
|
||||
export const deleteParams = (id, params) => {
|
||||
return deleteRequest(`/goods/parameters/${id}`, params);
|
||||
};
|
||||
//更新或者保存参数组
|
||||
export const insertOrUpdateParamsGroup = params => {
|
||||
return postRequest("/goods/category/parameters/save", params);
|
||||
};
|
||||
//删除参数组
|
||||
export const deleteParamsGroup = (id, params) => {
|
||||
return deleteRequest(`/goods/category/parameters/${id}`, params);
|
||||
};
|
||||
|
||||
//保存获取关联规格
|
||||
export const getGoodsSpecInfo = (category_id, params) => {
|
||||
return getRequest(`/goods/category/spec/goods/${category_id}`, params);
|
||||
};
|
||||
|
||||
//获取sku列表
|
||||
export const getSkuPage = params => {
|
||||
return getRequest(`/goodsSku/getByPage`, params);
|
||||
};
|
||||
|
||||
// 获取商品规格值列表
|
||||
export const getSpecValuesListSellerData = (id, params) => {
|
||||
return getRequest(`/goods/spec-values/values/${id}`, params);
|
||||
};
|
||||
// 添加商品规格值
|
||||
export const saveSpecValuesSeller = (id, params) => {
|
||||
return postRequest(`/goods/spec-values/save/${id}`, params);
|
||||
};
|
||||
|
||||
// 获取商品规格分页列表
|
||||
export const getSpecListSellerData = params => {
|
||||
return getRequest("/goods/spec/page", params);
|
||||
};
|
||||
// 添加或修改规格设置
|
||||
export const insertSpecSeller = params => {
|
||||
return postRequest("/goods/spec", params);
|
||||
};
|
||||
|
||||
// 更新商品库存
|
||||
export const updateGoodsSkuStocks = params => {
|
||||
return putRequest("/goods/update/stocks", params, {
|
||||
"Content-Type": "application/json"
|
||||
});
|
||||
};
|
||||
// 获取商品分页列表
|
||||
export const getGoodsListDataSeller = params => {
|
||||
return getRequest("/goods/list", params);
|
||||
};
|
||||
// 获取商品告警分页列表
|
||||
export const getGoodsListDataByStockSeller = params => {
|
||||
return getRequest("/goods/list/stock", params);
|
||||
};
|
||||
// 获取商品详情
|
||||
export const getGoods = id => {
|
||||
return getRequest(`/goods/get/${id}`);
|
||||
};
|
||||
// 上架商品
|
||||
export const upGoods = params => {
|
||||
return putRequest(`/goods/up`, params);
|
||||
};
|
||||
// 删除商品
|
||||
export const deleteGoods = params => {
|
||||
return putRequest(`/goods/delete`, params);
|
||||
};
|
||||
// 下架商品
|
||||
export const lowGoods = params => {
|
||||
return putRequest(`/goods/under`, params);
|
||||
};
|
||||
|
||||
// 获取商品单位列表
|
||||
export const getGoodsUnitList = () => {
|
||||
return getRequest(`/goods/unit`);
|
||||
};
|
||||
//根据分类id获取关联品牌
|
||||
export const getCategoryBrandListDataSeller = (category_id, params) => {
|
||||
return getRequest(`/goods/category/${category_id}/brands`, params);
|
||||
};
|
||||
|
||||
export function createGoods(params) {
|
||||
return postRequest("/goods/create", params, {
|
||||
"Content-Type": "application/json"
|
||||
});
|
||||
}
|
||||
|
||||
export function editGoods(goodsId, params) {
|
||||
return putRequest(`/goods/update/${goodsId}`, params, {
|
||||
"Content-Type": "application/json"
|
||||
});
|
||||
}
|
||||
|
||||
// 获取草稿商品分页列表
|
||||
export const getDraftGoodsListData = params => {
|
||||
return getRequest("/draft/goods/page", params);
|
||||
};
|
||||
|
||||
// 获取草稿商品详情
|
||||
export const getDraftGoodsDetail = id => {
|
||||
return getRequest(`/draft/goods/${id}`);
|
||||
};
|
||||
|
||||
// 保存草稿商品
|
||||
export function saveDraftGoods(params) {
|
||||
return postRequest("/draft/goods/save", params, {
|
||||
"Content-Type": "application/json"
|
||||
});
|
||||
}
|
||||
|
||||
// 删除草稿商品
|
||||
export const deleteDraftGoods = id => {
|
||||
return deleteRequest(`/draft/goods/${id}`);
|
||||
};
|
||||
|
||||
//查询分类绑定参数信息
|
||||
export const getCategoryParamsListDataSeller = (id, params) => {
|
||||
return getRequest(`/goods/category/parameters/${id}`, params);
|
||||
};
|
||||
|
||||
//保存获取关联规格
|
||||
export const getGoodsSpecInfoSeller = (category_id, params) => {
|
||||
return getRequest(`/goods/category/spec/goods/${category_id}`, params);
|
||||
};
|
||||
|
||||
//批量设置运费模板
|
||||
export const batchShipTemplate = params => {
|
||||
return putRequest(`/goods/freight`, params);
|
||||
};
|
||||
|
||||
|
||||
// 获取订单统计图表
|
||||
export const getOrderChart = params => {
|
||||
return getRequest(`/statistics/order`, params);
|
||||
};
|
||||
|
||||
// 订单统计概览
|
||||
export const getOrderOverView = params => {
|
||||
return getRequest(`/statistics/order/overview`, params);
|
||||
};
|
||||
|
||||
// 统计相关订单统计
|
||||
|
||||
export const statisticsOrderList = params => {
|
||||
return getRequest(`/statistics/order/order`, params);
|
||||
};
|
||||
|
||||
// 统计相关退单统计
|
||||
|
||||
export const statisticsOrderRefundList = params => {
|
||||
return getRequest(`/statistics/order/refund`, params);
|
||||
};
|
||||
|
||||
// 获取行业统计列表
|
||||
export const goodsCategoryStatistics = params => {
|
||||
return getRequest(`/statistics/goods/getCategoryByPage`, params);
|
||||
};
|
||||
|
||||
// 获取统计列表,排行前一百的数据
|
||||
export const goodsStatistics = params => {
|
||||
return getRequest(`/statistics/goods`, params);
|
||||
};
|
||||
|
||||
// 获取退款统计列表
|
||||
export const refundStatistics = params => {
|
||||
return getRequest(`/statistics/refund/order/getByPage`, params);
|
||||
};
|
||||
|
||||
// 获取退款统计金额
|
||||
export const refundPriceStatistics = params => {
|
||||
return getRequest(`/statistics/refund/order/getPrice`, params);
|
||||
};
|
||||
273
seller/src/api/index.js
Normal file
@@ -0,0 +1,273 @@
|
||||
// 统一请求路径前缀在libs/axios.js中修改
|
||||
import {
|
||||
getRequest,
|
||||
postRequest,
|
||||
putRequest,
|
||||
deleteRequest,
|
||||
getRequestWithNoToken,
|
||||
postRequestWithNoToken,
|
||||
commonUrl,
|
||||
baseUrl
|
||||
} from "@/libs/axios";
|
||||
|
||||
// 文件上传接口
|
||||
export const uploadFile = commonUrl + "/common/upload/file";
|
||||
// 验证码渲染图片接口
|
||||
export const drawCodeImage = commonUrl + "/common/captcha/draw/";
|
||||
// 获取菜单
|
||||
export const getMenuList = baseUrl + "/permission/getMenuList";
|
||||
|
||||
//获取所有city
|
||||
export const getAllCity = (params) => {
|
||||
return getRequest(commonUrl+'/common/region/allCity', params)
|
||||
}
|
||||
|
||||
// 登陆
|
||||
export const getHomeNotice = params => {
|
||||
return getRequest("/article/getByPage?type=STORE_ARTICLE&pageSize=15");
|
||||
};
|
||||
|
||||
|
||||
|
||||
// 登陆
|
||||
export const getSellerHomeData = params => {
|
||||
return getRequest("/statistics/index", params);
|
||||
};
|
||||
|
||||
|
||||
// 登陆
|
||||
export const login = params => {
|
||||
return postRequestWithNoToken("/login/userLogin", params);
|
||||
};
|
||||
// 获取用户登录信息
|
||||
export const userInfo = params => {
|
||||
return getRequest("/user/info", params);
|
||||
};
|
||||
// 获取登录信息
|
||||
export const userMsg = params => {
|
||||
return getRequest('/settings', params)
|
||||
}
|
||||
// 注册
|
||||
export const regist = params => {
|
||||
return postRequest("/user/regist", params);
|
||||
};
|
||||
// 初始化验证码
|
||||
export const initCaptcha = params => {
|
||||
return getRequestWithNoToken("/common/captcha/init", params);
|
||||
};
|
||||
// 发送登录短信验证码
|
||||
export const sendLoginSms = (mobile, params) => {
|
||||
return getRequest(`/common/captcha/sendLoginSms/${mobile}`, params);
|
||||
};
|
||||
// 发送注册短信验证码
|
||||
export const sendRegistSms = (mobile, params) => {
|
||||
return getRequest(`/common/captcha/sendRegistSms/${mobile}`, params);
|
||||
};
|
||||
// 发送重置密码短信验证码
|
||||
export const sendResetSms = (mobile, params) => {
|
||||
return getRequest(`${commonUrl}/common/captcha/sendResetSms/${mobile}`, params);
|
||||
};
|
||||
// 发送修改绑定手机短信验证码
|
||||
export const sendEditMobileSms = (mobile, params) => {
|
||||
return getRequest(`/common/captcha/sendEditMobileSms/${mobile}`, params);
|
||||
};
|
||||
// 通过手机重置密码
|
||||
export const resetByMobile = params => {
|
||||
return postRequest("/user/resetByMobile", params);
|
||||
};
|
||||
// 发送重置密码邮件验证码
|
||||
export const sendResetEmail = (email, params) => {
|
||||
return getRequest(`/email/sendResetCode/${email}`, params);
|
||||
};
|
||||
// 发送修改绑定邮件验证码
|
||||
export const sendEditEmail = (email, params) => {
|
||||
return getRequest(`/email/sendEditCode/${email}`, params);
|
||||
};
|
||||
// 通过邮件重置密码
|
||||
export const resetByEmail = params => {
|
||||
return postRequest("/email/resetByEmail", params);
|
||||
};
|
||||
// 短信验证码登录
|
||||
export const smsLogin = params => {
|
||||
return postRequest("/user/smsLogin", params);
|
||||
};
|
||||
// IP天气信息
|
||||
export const ipInfo = params => {
|
||||
return getRequest("/common/ip/info", params);
|
||||
};
|
||||
// 个人中心编辑
|
||||
export const userInfoEdit = params => {
|
||||
return postRequest("/user/edit", params);
|
||||
};
|
||||
// 个人中心发送修改邮箱验证邮件
|
||||
export const sendCodeEmail = (email, params) => {
|
||||
return getRequest(`/email/sendCode/${email}`, params);
|
||||
};
|
||||
// 个人中心发送修改邮箱验证邮件
|
||||
export const editEmail = params => {
|
||||
return postRequest("/email/editEmail", params);
|
||||
};
|
||||
// 个人中心修改密码
|
||||
export const changePass = params => {
|
||||
return postRequest("/login/modifyPass", params);
|
||||
};
|
||||
// 个人中心修改手机
|
||||
export const changeMobile = params => {
|
||||
return postRequest("/user/changeMobile", params);
|
||||
};
|
||||
// 获取绑定账号信息
|
||||
export const relatedInfo = (username, params) => {
|
||||
return getRequest(`/relate/getRelatedInfo/${username}`, params);
|
||||
};
|
||||
// 解绑账号
|
||||
export const unRelate = params => {
|
||||
return postRequest("/relate/delByIds", params);
|
||||
};
|
||||
// 分页获取绑定账号信息
|
||||
export const getRelatedListData = params => {
|
||||
return getRequest("/relate/findByCondition", params);
|
||||
};
|
||||
|
||||
// 获取用户数据 多条件
|
||||
export const getUserListData = params => {
|
||||
return getRequest("/user/getByCondition", params);
|
||||
};
|
||||
// 通过用户名搜索
|
||||
export const searchUserByName = (username, params) => {
|
||||
return getRequest("/user/searchByName/" + username, params);
|
||||
};
|
||||
// 获取全部用户数据
|
||||
export const getAllUserData = params => {
|
||||
return getRequest("/user/getAll", params);
|
||||
};
|
||||
|
||||
// 添加用户
|
||||
export const addUser = params => {
|
||||
return postRequest("/user/admin/add", params);
|
||||
};
|
||||
// 编辑用户
|
||||
export const editUser = params => {
|
||||
return postRequest("/user/admin/edit", params);
|
||||
};
|
||||
// 启用用户
|
||||
export const enableUser = (id, params) => {
|
||||
return postRequest(`/user/admin/enable/${id}`, params);
|
||||
};
|
||||
// 禁用用户
|
||||
export const disableUser = (id, params) => {
|
||||
return postRequest(`/user/admin/disable/${id}`, params);
|
||||
};
|
||||
// 删除用户
|
||||
export const deleteUser = (ids, params) => {
|
||||
return deleteRequest(`/user/delByIds/${ids}`, params);
|
||||
};
|
||||
// 重置用户密码
|
||||
export const resetUserPass = params => {
|
||||
return postRequest("/user/resetPass", params);
|
||||
};
|
||||
/****************************** 权限结束 */
|
||||
|
||||
// 分页获取日志数据
|
||||
export const getLogListData = params => {
|
||||
return getRequest("/log/getAllByPage", params);
|
||||
};
|
||||
// 分页获取消息数据
|
||||
export const getMessageData = params => {
|
||||
return getRequest("/message/getByCondition", params);
|
||||
};
|
||||
// 获取单个消息详情
|
||||
export const getMessageDataById = (id, params) => {
|
||||
return getRequest(`/message/get/${id}`, params);
|
||||
};
|
||||
// 添加消息
|
||||
export const addMessage = params => {
|
||||
return postRequest("/message/add", params);
|
||||
};
|
||||
// 编辑消息
|
||||
export const editMessage = params => {
|
||||
return postRequest("/message/edit", params);
|
||||
};
|
||||
// 回收站还原消息
|
||||
export const reductionMessage = (ids, params) => {
|
||||
return putRequest(`/message/${ids}/reduction`, params);
|
||||
};
|
||||
// 彻底删除消息
|
||||
export const clearMessage = (ids, params) => {
|
||||
return deleteRequest(`/message/${ids}`, params);
|
||||
};
|
||||
// 已读消息放入回收站
|
||||
export const deleteMessage = (ids, params) => {
|
||||
return deleteRequest(`/message/${ids}/delete`, params);
|
||||
};
|
||||
// 分页获取消息推送数据
|
||||
export const getMessageSendData = params => {
|
||||
return getRequest("/message", params);
|
||||
};
|
||||
// 进入消息中心首次加载全部数据
|
||||
export const getAllMessage = params => {
|
||||
return getRequest("/message/all", params);
|
||||
};
|
||||
// 已读消息
|
||||
export const read = (id) => {
|
||||
return putRequest(`/message/${id}/read`);
|
||||
};
|
||||
// 删除发送消息
|
||||
export const deleteMessageSend = (ids, params) => {
|
||||
return deleteRequest(`/messageSend/delByIds/${ids}`, params);
|
||||
};
|
||||
|
||||
// 分页获取文件数据
|
||||
export const getFileListData = params => {
|
||||
return getRequest("/file", params);
|
||||
};
|
||||
|
||||
|
||||
// 复制文件
|
||||
export const copyFile = params => {
|
||||
return postRequest("/file/copy", params);
|
||||
};
|
||||
// 重命名文件
|
||||
export const renameFile = params => {
|
||||
return postRequest("/file/rename", params);
|
||||
};
|
||||
// 删除文件
|
||||
export const deleteFile = (ids, params) => {
|
||||
return deleteRequest(`/file/delete/${ids}`, params);
|
||||
};
|
||||
// 下载文件
|
||||
export const aliDownloadFile = (fKey, params) => {
|
||||
return getRequest(`/file/ali/download/${fKey}`, params);
|
||||
};
|
||||
|
||||
|
||||
// base64上传
|
||||
export const base64Upload = params => {
|
||||
return postRequest("/upload/file", params);
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
// 添加商品计量单位
|
||||
export const addGoodsUnit = (params) => {
|
||||
return postRequest(`/goods/goodsUnit`, params);
|
||||
};
|
||||
// 分页获取商品计量单位
|
||||
export const getGoodsUnitPage = (params) => {
|
||||
return getRequest(`/goods/goodsUnit`, params);
|
||||
};
|
||||
// 编辑商品计量单位
|
||||
export const updateGoodsUnit = (id, params) => {
|
||||
return putRequest(`/goods/goodsUnit/${id}`, params);
|
||||
};
|
||||
// 删除商品计量单位
|
||||
export const delGoodsUnit = (ids) => {
|
||||
return deleteRequest(`/goods/goodsUnit/delete/${ids}`);
|
||||
};
|
||||
|
||||
//
|
||||
export const handleRefreshToken = (token) => {
|
||||
return getRequestWithNoToken(`/login/refresh/${token}`);
|
||||
};
|
||||
|
||||
|
||||
34
seller/src/api/logistics.js
Normal file
@@ -0,0 +1,34 @@
|
||||
// 统一请求路径前缀在libs/axios.js中修改
|
||||
import {
|
||||
getRequest,
|
||||
postRequest,
|
||||
putRequest,
|
||||
deleteRequest,
|
||||
importRequest,
|
||||
getRequestWithNoToken
|
||||
} from "@/libs/axios";
|
||||
|
||||
|
||||
|
||||
// 分页获取物流公司
|
||||
export const getLogisticsPage = params => {
|
||||
return getRequest(`/logistics/getByPage`, params);
|
||||
};
|
||||
// 删除
|
||||
export const delLogistics = id => {
|
||||
return deleteRequest(`/logistics/delete/${id}`);
|
||||
};
|
||||
// 添加
|
||||
export const addLogistics = params => {
|
||||
return postRequest(`/logistics/save`,params);
|
||||
};
|
||||
// 通过id查询详情
|
||||
export const getLogisticsDetail = id => {
|
||||
return getRequest(`/logistics/get/${id}`);
|
||||
};
|
||||
// 编辑
|
||||
export const updateLogistics = (id,params) => {
|
||||
return putRequest(`/logistics/${id}`,params);
|
||||
};
|
||||
|
||||
|
||||
91
seller/src/api/member.js
Normal file
@@ -0,0 +1,91 @@
|
||||
// 统一请求路径前缀在libs/axios.js中修改
|
||||
import {getRequest, putRequest, postRequest} from "@/libs/axios";
|
||||
|
||||
// 分页获取会员评价
|
||||
export const getMemberReview = params => {
|
||||
return getRequest("/memberEvaluation", params);
|
||||
};
|
||||
|
||||
// 根据id获取评价详情
|
||||
export const getMemberInfoReview = id => {
|
||||
return getRequest(`/memberEvaluation/get/${id}`);
|
||||
};
|
||||
|
||||
//回复评价信息
|
||||
export const replyMemberReview = (id, params) => {
|
||||
return putRequest(`/memberEvaluation/reply/${id}`, params);
|
||||
};
|
||||
|
||||
// 获取会员注册统计列表
|
||||
export const getStatisticsList = params => {
|
||||
return getRequest("/statistics/view/list", params);
|
||||
};
|
||||
|
||||
// 获取分页
|
||||
export const getMember = params => {
|
||||
return getRequest("/member/getByPage", params);
|
||||
};
|
||||
|
||||
|
||||
// 添加或修改
|
||||
export const insertOrUpdateSpec = params => {
|
||||
return postRequest("/memberNoticeSenter/insertOrUpdate", params);
|
||||
};
|
||||
//删除gUI个
|
||||
export const delSpec = (id, params) => {
|
||||
return deleteRequest(`/goods/spec/del/${id}`, params);
|
||||
};
|
||||
|
||||
// 获取会员列表
|
||||
export const getMemberListData = params => {
|
||||
return getRequest("/member", params);
|
||||
};
|
||||
|
||||
// 获取会员详情
|
||||
export const getMemberInfoData = id => {
|
||||
return getRequest(`/member/${id}`);
|
||||
};
|
||||
|
||||
// 修改会员基本信息
|
||||
export const updateMember = params => {
|
||||
return putRequest(`/member`, params);
|
||||
};
|
||||
|
||||
// 添加会员基本信息
|
||||
export const addMember = params => {
|
||||
return postRequest(`/member`, params);
|
||||
};
|
||||
|
||||
// 获取会员列表
|
||||
export const getMemberAll = () => {
|
||||
return getRequest("/member/getAll");
|
||||
};
|
||||
|
||||
// 增加或修改会员列表
|
||||
export const operationMemberListData = params => {
|
||||
return postRequest("/member/insertOrUpdate", params);
|
||||
};
|
||||
|
||||
// 增加或修改会员列表
|
||||
export const deleteMemberListData = ids => {
|
||||
return deleteRequest(`/member/delByIds/${ids}`);
|
||||
};
|
||||
// 获取充值记录列表数据
|
||||
export const getUserRecharge = params => {
|
||||
return getRequest("/recharge", params);
|
||||
};
|
||||
|
||||
// 获取预存款明细列表数据
|
||||
export const getUserDeposit = params => {
|
||||
return getRequest("/deposit", params);
|
||||
};
|
||||
|
||||
// 获取提现申请列表数据
|
||||
export const getUserWithdrawApply = params => {
|
||||
return getRequest("/members/withdraw-apply", params);
|
||||
};
|
||||
|
||||
// 审核提现申请
|
||||
export const withdrawApply = params => {
|
||||
return postRequest("/members/withdraw-apply", params);
|
||||
};
|
||||
48
seller/src/api/open.js
Normal file
@@ -0,0 +1,48 @@
|
||||
// 统一请求路径前缀在libs/axios.js中修改
|
||||
import { getRequest, postRequest, putRequest, deleteRequest, importRequest, uploadFileRequest } from '@/libs/axios';
|
||||
|
||||
|
||||
// 认证
|
||||
export const authorize = (params) => {
|
||||
return getRequest('/oauth2/authorize', params)
|
||||
}
|
||||
// 认证过
|
||||
export const authorized = (params) => {
|
||||
return getRequest('/oauth2/authorized', params)
|
||||
}
|
||||
// 获取token
|
||||
export const token = (params) => {
|
||||
return getRequest('/oauth2/token', params)
|
||||
}
|
||||
// 获取user信息
|
||||
export const user = (params) => {
|
||||
return getRequest('/oauth2/user', params)
|
||||
}
|
||||
|
||||
// 获取随机secretKey
|
||||
export const getSecretKey = (params) => {
|
||||
return getRequest('/client/getSecretKey', params)
|
||||
}
|
||||
// 获取客户端
|
||||
export const getClientDataList = (params) => {
|
||||
return getRequest('/client/getByCondition', params)
|
||||
}
|
||||
// 添加客户端
|
||||
export const addClient = (params) => {
|
||||
return postRequest('/client/save', params)
|
||||
}
|
||||
// 编辑客户端
|
||||
export const updateClient = (params) => {
|
||||
return putRequest('/client/update', params)
|
||||
}
|
||||
// 删除客户端
|
||||
export const deleteClient = (ids, params) => {
|
||||
return deleteRequest(`/client/delByIds/${ids}`, params)
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
116
seller/src/api/order.js
Normal file
@@ -0,0 +1,116 @@
|
||||
// 统一请求路径前缀在libs/axios.js中修改
|
||||
import {getRequest, postRequest, putRequest} from '@/libs/axios';
|
||||
|
||||
|
||||
// 获取普通订单列表
|
||||
export const getOrderList = (params) => {
|
||||
return getRequest(`/orders`, params)
|
||||
}
|
||||
|
||||
// 获取普通订单详细信息
|
||||
export const getOrderDetail = (sn) => {
|
||||
return getRequest(`/orders/${sn}`)
|
||||
}
|
||||
|
||||
// 调整订单金额
|
||||
export const modifyOrderPrice = (sn, params) => {
|
||||
return putRequest(`/orders/update/${sn}/price`, params)
|
||||
}
|
||||
|
||||
// 取消订单
|
||||
export const cancelOrder = (sn, params) => {
|
||||
return postRequest(`/orders/${sn}/cancel`, params)
|
||||
}
|
||||
|
||||
// 修改收货地址
|
||||
export const editOrderConsignee = (sn, params) => {
|
||||
return postRequest(`/orders/update/${sn}/consignee`, params)
|
||||
}
|
||||
//获取投诉列表
|
||||
export const getComplainPage = (params) => {
|
||||
return getRequest(`/complain`, params)
|
||||
}
|
||||
|
||||
//获取投诉详情
|
||||
export const getComplainDetail = (id) => {
|
||||
return getRequest(`/complain/${id}`)
|
||||
}
|
||||
|
||||
//添加交易投诉对话
|
||||
export const addOrderComplaint = (params) => {
|
||||
return postRequest(`/complain/communication/`, params)
|
||||
}
|
||||
|
||||
//添加交易投诉对话
|
||||
export const appeal = (params) => {
|
||||
return putRequest(`/complain/appeal`, params)
|
||||
}
|
||||
|
||||
//获取订单日志
|
||||
export const getOrderLog = (sn, params) => {
|
||||
return getRequest(`/orderLog/${sn}`, params)
|
||||
}
|
||||
|
||||
// 订单发货
|
||||
export const orderDelivery = (sn, params) => {
|
||||
return postRequest(`/orders/${sn}/delivery`, params)
|
||||
}
|
||||
|
||||
// 获取商家选中的物流公司
|
||||
export const getLogisticsChecked = () => {
|
||||
return getRequest(`/logistics/getChecked`)
|
||||
}
|
||||
|
||||
// 订单核验
|
||||
export const orderTake = (sn, params) => {
|
||||
return postRequest(`/orders/${sn}/take`, params)
|
||||
}
|
||||
|
||||
// 售后服务单
|
||||
export const afterSaleOrderPage = (params) => {
|
||||
return getRequest(`/afterSale/page`, params)
|
||||
}
|
||||
|
||||
// 售后服务单详情
|
||||
export const afterSaleOrderDetail = (sn) => {
|
||||
return getRequest(`/afterSale/${sn}`)
|
||||
}
|
||||
|
||||
// 商家审核
|
||||
export const afterSaleSellerReview = (sn, params) => {
|
||||
return putRequest(`/afterSale/review/${sn}`, params)
|
||||
}
|
||||
|
||||
// 商家确认收货
|
||||
export const afterSaleSellerConfirm = (sn, params) => {
|
||||
return putRequest(`/afterSale/confirm/${sn}`, params)
|
||||
}
|
||||
|
||||
// 商家换货业务发货
|
||||
export const afterSaleSellerDelivery = (sn, params) => {
|
||||
return postRequest(`/afterSale/${sn}/delivery`, params)
|
||||
}
|
||||
//查询物流
|
||||
export const getTraces = (sn, params) => {
|
||||
return postRequest(`/orders/getTraces/${sn}`, params)
|
||||
}
|
||||
//售后单查询物流
|
||||
export const getSellerDeliveryTraces = (sn, params) => {
|
||||
return getRequest(`/afterSale/getSellerDeliveryTraces/${sn}`, params)
|
||||
}
|
||||
//售后单查询物流
|
||||
export const getAfterSaleTraces = (sn, params) => {
|
||||
return getRequest(`/afterSale/getDeliveryTraces/${sn}`, params)
|
||||
}
|
||||
//获取发票列表
|
||||
export const getReceiptPage = (params) => {
|
||||
return getRequest(`/receipt`, params)
|
||||
}
|
||||
|
||||
//获取发票列表
|
||||
export const invoicing = (id) => {
|
||||
return postRequest(`receipt/${id}/invoicing`)
|
||||
}
|
||||
|
||||
|
||||
|
||||
69
seller/src/api/other.js
Normal file
@@ -0,0 +1,69 @@
|
||||
// 统一请求路径前缀在libs/axios.js中修改
|
||||
import {
|
||||
getRequest,
|
||||
postRequest,
|
||||
putRequest,
|
||||
deleteRequest,
|
||||
importRequest,
|
||||
getRequestWithNoToken,
|
||||
putRequestWithNoForm,
|
||||
postRequestWithNoForm,
|
||||
} from "@/libs/axios";
|
||||
|
||||
/**
|
||||
* 楼层装修设置
|
||||
*
|
||||
*/
|
||||
export const setHomeSetup = params => {
|
||||
|
||||
return postRequest("/pageData/add", params);
|
||||
};
|
||||
|
||||
/**
|
||||
* 获取页面信息
|
||||
*
|
||||
*/
|
||||
export const getHomeData = params => {
|
||||
|
||||
return getRequest(`/pageData/${params}`);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* 查询楼层装修
|
||||
*
|
||||
*/
|
||||
export const getHomeList = params => {
|
||||
|
||||
return getRequest("/pageData/pageDataList", params);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* 修改楼层装修
|
||||
*
|
||||
*/
|
||||
export const updateHome = (id,params) => {
|
||||
|
||||
return putRequest(`/pageData/update/${id}`, params);
|
||||
};
|
||||
|
||||
/**
|
||||
* 删除楼层装修
|
||||
*
|
||||
*/
|
||||
export const removePageHome = (id) => {
|
||||
|
||||
return deleteRequest(`/pageData/removePageData/${id}`);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* 发布页面
|
||||
*
|
||||
*/
|
||||
export const releasePageHome = (id) => {
|
||||
|
||||
return putRequest(`/pageData/releasePageData`,id);
|
||||
};
|
||||
|
||||
113
seller/src/api/pages.js
Normal file
@@ -0,0 +1,113 @@
|
||||
// 统一请求路径前缀在libs/axios.js中修改
|
||||
import {getRequest, postRequest, putRequest, deleteRequest, importRequest, getRequestWithNoToken} from '@/libs/axios';
|
||||
|
||||
//保存导航栏
|
||||
export const save = (params) => {
|
||||
return postRequest('/siteNavigation/save', params)
|
||||
}
|
||||
//保存导航栏
|
||||
export const update = (params) => {
|
||||
return postRequest('/siteNavigation/update', params)
|
||||
}
|
||||
//查询导航栏
|
||||
export const getNavigationData = (params) => {
|
||||
return getRequest('/siteNavigation/getByPage', params)
|
||||
}
|
||||
//禁用导航栏
|
||||
export const disableNavigation = (ids) => {
|
||||
return deleteRequest(`/siteNavigation/disable/${ids}`)
|
||||
}
|
||||
//启用导航栏
|
||||
export const enableNavigation = (ids) => {
|
||||
return deleteRequest(`/siteNavigation/enable/${ids}`)
|
||||
}
|
||||
//删除导航栏
|
||||
export const delNavigation = (ids) => {
|
||||
return deleteRequest(`/siteNavigation/remove/${ids}`)
|
||||
}
|
||||
|
||||
//
|
||||
export const saveFocus = (params) => {
|
||||
return deleteRequest('/siteNavigation/remove/${ids}', params)
|
||||
}
|
||||
|
||||
//查询焦点图
|
||||
export const getFocusData = (params) => {
|
||||
return getRequest('/focus/getByPage', params)
|
||||
}
|
||||
//查询焦点图
|
||||
export const saveFocusData = (params) => {
|
||||
return postRequest('/focus/insertOrUpdate', params)
|
||||
}
|
||||
//禁用导航栏
|
||||
export const disableFocus = (ids) => {
|
||||
return putRequest(`/focus/disable/${ids}`)
|
||||
}
|
||||
//启用导航栏
|
||||
export const enableFocus = (ids) => {
|
||||
return putRequest(`/focus/enable/${ids}`)
|
||||
}
|
||||
//删除导航栏
|
||||
export const delFocus = (ids) => {
|
||||
return deleteRequest(`/focus/delByIds/${ids}`)
|
||||
}
|
||||
|
||||
//根据店铺编号查询页面数据(店铺编号为0则为平台)
|
||||
export const getPageData = (id) => {
|
||||
return getRequest(`/page/get/${id}`)
|
||||
}
|
||||
|
||||
//保存页面数据
|
||||
export const savePageData = (params) => {
|
||||
return postRequest('/page/insertOrUpdate', params)
|
||||
}
|
||||
//获取分类列表数据
|
||||
export const getArticleCategory = (parent_id) => {
|
||||
return getRequest(`/article-category/${parent_id}/all-children`)
|
||||
}
|
||||
//文章分类添加
|
||||
export const saveArticleCategory = (params) => {
|
||||
return postRequest('/article-category', params)
|
||||
}
|
||||
|
||||
//删除文章分类
|
||||
export const delArticleCategory = (id) => {
|
||||
return deleteRequest(`/article-category/${id}`)
|
||||
}
|
||||
//修改文章分类
|
||||
export const updateArticleCategory = (params, id) => {
|
||||
return putRequest(`/article-category/update/${id}`, params)
|
||||
}
|
||||
//文章添加
|
||||
export const saveArticle = (params) => {
|
||||
return postRequest('/article', params)
|
||||
}
|
||||
//文章修改
|
||||
export const updateArticle = (params) => {
|
||||
return putRequest(`/article/update/${params.id}`, params)
|
||||
}
|
||||
//查看文章
|
||||
export const seeArticle = (id) => {
|
||||
return getRequest(`/article/${id}`)
|
||||
}
|
||||
//获取文章列表数据
|
||||
export const getArticle = (params) => {
|
||||
return getRequest('/article/getByPage', params)
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//删除文章数据
|
||||
export const delArticle = (ids) => {
|
||||
return deleteRequest(`/article/delByIds/${ids}`)
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
15
seller/src/api/platform.js
Normal file
@@ -0,0 +1,15 @@
|
||||
// 统一请求路径前缀在libs/axios.js中修改
|
||||
import { getRequest, postRequest, putRequest, deleteRequest, importRequest, getRequestWithNoToken } from '@/libs/axios';
|
||||
|
||||
// 验证码渲染图片接口
|
||||
export const drawCodeImage = "/lili/common/captcha/draw/"
|
||||
|
||||
|
||||
// 获取kuaidi配置
|
||||
export const getParams = (params) => {
|
||||
return getRequest('/platformSetting/get/'+params)
|
||||
}
|
||||
// 编辑kuaidi配置
|
||||
export const editParams = (params,method) => {
|
||||
return postRequest('/platformSetting/insertOrUpdate/'+method, params)
|
||||
}
|
||||
131
seller/src/api/promotion.js
Normal file
@@ -0,0 +1,131 @@
|
||||
// 统一请求路径前缀在libs/axios.js中修改
|
||||
import { getRequest, postRequest, putRequest, deleteRequest, importRequest, uploadFileRequest } from '@/libs/axios';
|
||||
|
||||
// 获取拼团列表
|
||||
export const getPintuanList = (params) => {
|
||||
return getRequest('/promotion/pintuan', params)
|
||||
}
|
||||
// 新建 拼团
|
||||
export const savePintuan = (params) => {
|
||||
return postRequest('/promotion/pintuan', params,{'Content-type': 'application/json'})
|
||||
}
|
||||
// 编辑 拼团
|
||||
export const editPintuan = (params) => {
|
||||
return putRequest('/promotion/pintuan', params,{'Content-type': 'application/json'})
|
||||
}
|
||||
// 手动开启拼团活动
|
||||
export const openPintuan = (pintuanId, params) => {
|
||||
return putRequest(`/promotion/pintuan/open/${pintuanId}`, params)
|
||||
}
|
||||
|
||||
// 手动关闭拼团活动
|
||||
export const closePintuan = (pintuanId) => {
|
||||
return putRequest(`/promotion/pintuan/close/${pintuanId}`)
|
||||
}
|
||||
|
||||
// 删除拼团活动
|
||||
export const deletePintuan = (pintuanId) => {
|
||||
return deleteRequest(`/promotion/pintuan/${pintuanId}`)
|
||||
}
|
||||
|
||||
// 根据id获取拼团信息
|
||||
export const getPintuanDetail = (id) => {
|
||||
return getRequest(`/promotion/pintuan/${id}`)
|
||||
}
|
||||
|
||||
// 获取拼团商品列表
|
||||
export const getPintuanGoodsList = (params) => {
|
||||
return getRequest(`/promotion/pintuan/goods/${params.pintuanId}`,params)
|
||||
}
|
||||
|
||||
// 新增优惠券
|
||||
export const saveShopCoupon = (params) => {
|
||||
return postRequest('/promotion/coupon', params,{'Content-type': 'application/json'})
|
||||
}
|
||||
|
||||
// 修改优惠券
|
||||
export const editShopCoupon = (params) => {
|
||||
return putRequest('/promotion/coupon', params,{'Content-type': 'application/json'})
|
||||
}
|
||||
|
||||
// 获取优惠券列表
|
||||
export const getShopCouponList = (params) => {
|
||||
return getRequest('/promotion/coupon', params)
|
||||
}
|
||||
|
||||
// 更新优惠券状态
|
||||
export const updateCouponStatus = ( params) => {
|
||||
return putRequest(`/promotion/coupon/status`, params)
|
||||
}
|
||||
|
||||
// 作废优惠券
|
||||
export const deleteShopCoupon = (ids) => {
|
||||
return deleteRequest(`/promotion/coupon/${ids}`)
|
||||
}
|
||||
// 上架优惠券
|
||||
export const upShopCoupon = (ids, params) => {
|
||||
return postRequest(`/promotion/coupon/up/${ids}`, params)
|
||||
}
|
||||
// 获取单个优惠券
|
||||
export const getShopCoupon = (id) => {
|
||||
return getRequest(`/promotion/coupon/${id}`)
|
||||
}
|
||||
|
||||
// 获取优惠券领取详情
|
||||
export const getMemberReceiveCouponList = (id) => {
|
||||
return getRequest(`/promotion/memberCoupon/getByPage/${id}`)
|
||||
}
|
||||
// 作废会员优惠券
|
||||
export const deleteMemberReceiveCoupon = (ids, params) => {
|
||||
return deleteRequest(`/promotion/memberCoupon/delByIds/${ids}`, params)
|
||||
}
|
||||
|
||||
// 限时秒杀活动列表
|
||||
export const seckillList = (params) => {
|
||||
return getRequest(`/promotion/seckill`,params)
|
||||
}
|
||||
|
||||
// 限时秒杀活动商品
|
||||
export const seckillGoodsList = (params) => {
|
||||
return getRequest(`/promotion/seckill/apply`,params)
|
||||
}
|
||||
|
||||
// 添加限时抢购 商品
|
||||
export const setSeckillGoods = (params) => {
|
||||
return postRequest(`/promotion/seckill/apply/${params.seckillId}`,params.applyVos,{'Content-type': 'application/json'})
|
||||
}
|
||||
|
||||
// 添加限时抢购 商品
|
||||
export const removeSeckillGoods = (seckillId, ids) => {
|
||||
return deleteRequest(`/promotion/seckill/apply/${seckillId}/${ids}`)
|
||||
}
|
||||
|
||||
// 限时秒杀活动详情
|
||||
export const seckillDetail = (seckillId) => {
|
||||
return getRequest(`/promotion/seckill/${seckillId}`)
|
||||
}
|
||||
|
||||
// 满减满赠活动列表
|
||||
export const getFullDiscountList = (params) => {
|
||||
return getRequest(`/promotion/fullDiscount`,params)
|
||||
}
|
||||
|
||||
// 新增满减活动
|
||||
export const newFullDiscount = (params) => {
|
||||
return postRequest(`/promotion/fullDiscount`,params,{'Content-type': 'application/json'})
|
||||
}
|
||||
|
||||
// 编辑满减活动
|
||||
export const editFullDiscount = (params) => {
|
||||
return putRequest(`/promotion/fullDiscount`,params,{'Content-type': 'application/json'})
|
||||
}
|
||||
|
||||
// 通过id获取满减活动
|
||||
export const getFullDiscountById = (id) => {
|
||||
return getRequest(`/promotion/fullDiscount/${id}`)
|
||||
}
|
||||
|
||||
// 删除满减活动
|
||||
export const delFullDiscount = (id) => {
|
||||
return deleteRequest(`/promotion/fullDiscount/${id}`)
|
||||
}
|
||||
123
seller/src/api/shops.js
Normal file
@@ -0,0 +1,123 @@
|
||||
// 统一请求路径前缀在libs/axios.js中修改
|
||||
import {getRequest, postRequest, putRequest, deleteRequest, importRequest, getRequestWithNoToken} from '@/libs/axios';
|
||||
|
||||
// Vaptcha ID
|
||||
export const vaptchaID = "5dce36188713b71e70a41eb7"
|
||||
// 文件上传接口
|
||||
export const uploadFile = "/upload/file"
|
||||
// 验证码渲染图片接口
|
||||
export const drawCodeImage = "/common/captcha/draw/"
|
||||
// 获取菜单
|
||||
export const getMenuList = "/permission/getMenuList"
|
||||
// 获取数据字典
|
||||
export const getDictData = "/dictData/getByType/"
|
||||
// Websocket
|
||||
export const ws = "/ws"
|
||||
|
||||
|
||||
//查询店铺列表
|
||||
export const getShopListData = (params) => {
|
||||
return getRequest('/shop', params)
|
||||
}
|
||||
// 获取结算单分页
|
||||
export const getBillPage = (params) => {
|
||||
return getRequest(`/bill/getByPage`, params)
|
||||
}
|
||||
|
||||
// 获取商家结算单流水分页
|
||||
export const getSellerFlow = (id, params) => {
|
||||
return getRequest(`/bill/${id}/getStoreFlow`, params)
|
||||
}
|
||||
|
||||
// 商家核对结算单
|
||||
export const reconciliation = (id, params) => {
|
||||
return putRequest(`/bill/check/${id}/`, params)
|
||||
}
|
||||
|
||||
// 获取商家分销订单流水分页
|
||||
export const getDistributionFlow = (id, params) => {
|
||||
return getRequest(`/bill/${id}/getDistributionFlow`, params)
|
||||
}
|
||||
|
||||
// 获取商家结算单详细
|
||||
export const getBillDetail = (id, params) => {
|
||||
return getRequest(`/bill/get/${id}`, params)
|
||||
}
|
||||
|
||||
// 获取所有物流公司
|
||||
export const getLogistics = (id, params) => {
|
||||
return getRequest(`/logistics`, params)
|
||||
}
|
||||
|
||||
// 开启物流公司
|
||||
export const logisticsChecked = (id, params) => {
|
||||
return postRequest(`/logistics/${id}`, params)
|
||||
}
|
||||
|
||||
// 关闭开启物流公司
|
||||
export const logisticsUnChecked = (id, params) => {
|
||||
return deleteRequest(`/logistics/${id}`, params)
|
||||
}
|
||||
// 获取商家自提点
|
||||
export const getShopAddress = (id, params) => {
|
||||
return getRequest(`/storeAddress/`, params)
|
||||
}
|
||||
|
||||
// 修改商家自提点
|
||||
export const editShopAddress = (id, params) => {
|
||||
return putRequest(`/storeAddress/${id}`, params)
|
||||
}
|
||||
|
||||
// 添加商品自提点
|
||||
export const addShopAddress = (params) => {
|
||||
return postRequest(`/storeAddress/`, params)
|
||||
}
|
||||
|
||||
// 添加商品自提点
|
||||
export const deleteShopAddress = (id) => {
|
||||
return deleteRequest(`/storeAddress/${id}`)
|
||||
}
|
||||
|
||||
// 获取商家详细信息
|
||||
export const getShopInfo = () => {
|
||||
return getRequest(`/settings`)
|
||||
}
|
||||
|
||||
// 保存商家详细信息
|
||||
export const saveShopInfo = (params) => {
|
||||
return putRequest(`/settings`, params)
|
||||
}
|
||||
|
||||
//获取商家退货地址
|
||||
export const getRefundGoodsAddress = () => {
|
||||
return getRequest(`/settings/storeAfterSaleAddress`)
|
||||
}
|
||||
//修改商家退货地址
|
||||
export const saveRefundGoodsAddress = (params) => {
|
||||
return putRequest(`/settings/storeAfterSaleAddress`, params)
|
||||
}
|
||||
|
||||
//修改保存库存预警数
|
||||
export const updateStockWarning = (params) => {
|
||||
return putRequest(`/settings/updateStockWarning`, params)
|
||||
}
|
||||
//查询运费模板
|
||||
export const getShipTemplate = () => {
|
||||
return getRequest(`/freightTemplate`)
|
||||
}
|
||||
//删除运费模板
|
||||
export const deleteShipTemplate = (id) => {
|
||||
return deleteRequest(`/freightTemplate/${id}`)
|
||||
}
|
||||
//新增运费模板
|
||||
export const addShipTemplate = (params, headers) => {
|
||||
return postRequest(`/freightTemplate`, params, headers)
|
||||
}
|
||||
|
||||
//新增运费模板
|
||||
export const editShipTemplate = (id, params, headers) => {
|
||||
return putRequest(`/freightTemplate/${id}`, params, headers)
|
||||
}
|
||||
|
||||
|
||||
|
||||
20
seller/src/api/statistics.js
Normal file
@@ -0,0 +1,20 @@
|
||||
// 统一请求路径前缀在libs/axios.js中修改
|
||||
import {getRequest, postRequest, putRequest, deleteRequest, importRequest, getRequestWithNoToken} from '@/libs/axios';
|
||||
|
||||
//商品统计
|
||||
export const getGoodsStatisticsData = (params) => {
|
||||
return getRequest(`/statistics/goods`, params)
|
||||
}
|
||||
|
||||
//获取订单统计金额
|
||||
export const getOrderStatisticsPrice = (params) => {
|
||||
return getRequest(`/statistics/order/getPrice`, params)
|
||||
}
|
||||
|
||||
//订单统计列表
|
||||
export const getOrderStatistics = (params) => {
|
||||
return getRequest(`/statistics/order/getByPage`, params)
|
||||
}
|
||||
|
||||
|
||||
|
||||
BIN
seller/src/assets/background.png
Normal file
|
After Width: | Height: | Size: 13 KiB |
1
seller/src/assets/background.svg
Normal file
@@ -0,0 +1 @@
|
||||
<svg height="100%" width="100%" id="svg" viewBox="0 0 1440 400" xmlns="http://www.w3.org/2000/svg" class="transition duration-300 ease-in-out delay-150"><defs><linearGradient id="gradient"><stop offset="5%" stop-color="#fab741ff"></stop><stop offset="95%" stop-color="#f78da7ff"></stop></linearGradient></defs><path d="M 0,400 C 0,400 0,200 0,200 C 45.64618509382542,216.47686725610436 91.29237018765085,232.9537345122087 133,241 C 174.70762981234915,249.0462654877913 212.47670434322208,248.66192920726948 257,220 C 301.5232956567779,191.33807079273052 352.80081243946097,134.39854865871342 396,148 C 439.19918756053903,161.60145134128658 474.3200458989338,245.7438761578768 511,266 C 547.6799541010662,286.2561238421232 585.9190039648037,242.62594670977953 635,230 C 684.0809960351963,217.37405329022047 744.0039382418512,235.75233700300504 792,247 C 839.9960617581488,258.24766299699496 876.0652430677914,262.3647052782003 912,253 C 947.9347569322086,243.63529472179968 983.7350894869837,220.78884188419372 1025,189 C 1066.2649105130163,157.21115811580628 1112.9943989842734,116.47992718502479 1162,127 C 1211.0056010157266,137.5200728149752 1262.2873145759218,199.2914493757072 1309,220 C 1355.7126854240782,240.7085506242928 1397.8563427120391,220.3542753121464 1440,200 C 1440,200 1440,400 1440,400 Z" stroke="none" stroke-width="0" fill="url(#gradient)" class="transition-all duration-300 ease-in-out delay-150"></path></svg>
|
||||
|
After Width: | Height: | Size: 1.4 KiB |
BIN
seller/src/assets/dashboard/console.png
Normal file
|
After Width: | Height: | Size: 2.3 KiB |
BIN
seller/src/assets/dashboard/department.png
Normal file
|
After Width: | Height: | Size: 6.4 KiB |
BIN
seller/src/assets/dashboard/fee.png
Normal file
|
After Width: | Height: | Size: 6.2 KiB |
BIN
seller/src/assets/dashboard/user.png
Normal file
|
After Width: | Height: | Size: 6.1 KiB |
BIN
seller/src/assets/decorate/delete.png
Normal file
|
After Width: | Height: | Size: 5.5 KiB |
BIN
seller/src/assets/decorate/edit.png
Normal file
|
After Width: | Height: | Size: 3.8 KiB |
BIN
seller/src/assets/decorate/phone.png
Normal file
|
After Width: | Height: | Size: 41 KiB |
BIN
seller/src/assets/decorate/poplarGoods.png
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
seller/src/assets/festival_icon.png
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
seller/src/assets/iPhoneX_model.png
Normal file
|
After Width: | Height: | Size: 17 KiB |
BIN
seller/src/assets/img-error.png
Normal file
|
After Width: | Height: | Size: 3.1 KiB |
BIN
seller/src/assets/lili.png
Normal file
|
After Width: | Height: | Size: 302 KiB |
BIN
seller/src/assets/loading.gif
Normal file
|
After Width: | Height: | Size: 70 KiB |
BIN
seller/src/assets/loading2.gif
Normal file
|
After Width: | Height: | Size: 13 KiB |
BIN
seller/src/assets/loading3.gif
Normal file
|
After Width: | Height: | Size: 80 KiB |
BIN
seller/src/assets/logo-min.png
Normal file
|
After Width: | Height: | Size: 4.5 KiB |
BIN
seller/src/assets/logo.png
Normal file
|
After Width: | Height: | Size: 234 KiB |
BIN
seller/src/assets/logo1.png
Normal file
|
After Width: | Height: | Size: 138 KiB |
BIN
seller/src/assets/nav/1.jpg
Normal file
|
After Width: | Height: | Size: 119 KiB |
BIN
seller/src/assets/nav/2.jpg
Normal file
|
After Width: | Height: | Size: 86 KiB |
BIN
seller/src/assets/nav/3.jpg
Normal file
|
After Width: | Height: | Size: 133 KiB |
BIN
seller/src/assets/nav/4.jpg
Normal file
|
After Width: | Height: | Size: 202 KiB |
BIN
seller/src/assets/nav/5.jpg
Normal file
|
After Width: | Height: | Size: 70 KiB |
BIN
seller/src/assets/nav/nav_showimg1.jpg
Normal file
|
After Width: | Height: | Size: 14 KiB |
BIN
seller/src/assets/nav/nav_showimg2.jpg
Normal file
|
After Width: | Height: | Size: 8.1 KiB |
BIN
seller/src/assets/play.png
Normal file
|
After Width: | Height: | Size: 9.1 KiB |
BIN
seller/src/assets/seckillBg.png
Normal file
|
After Width: | Height: | Size: 17 KiB |
BIN
seller/src/assets/selected.png
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
seller/src/assets/title.png
Normal file
|
After Width: | Height: | Size: 2.2 KiB |
BIN
seller/src/assets/vaptcha-loading.gif
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
48
seller/src/config/index.js
Normal file
@@ -0,0 +1,48 @@
|
||||
export default {
|
||||
/**
|
||||
* @description 配置显示在浏览器标签的title
|
||||
*/
|
||||
title: "Lili电商",
|
||||
/**
|
||||
* @description token在Cookie中存储的天数,默认1天
|
||||
*/
|
||||
cookieExpires: 1,
|
||||
/**
|
||||
* @description 是否使用国际化,默认为false
|
||||
* 如果不使用,则需要在路由中给需要在菜单中展示的路由设置meta: {title: 'xxx'}
|
||||
* 用来在菜单中显示文字
|
||||
*/
|
||||
useI18n: true,
|
||||
|
||||
/**
|
||||
* @description api请求基础路径
|
||||
*/
|
||||
api_dev: {
|
||||
common: 'https://common-api.pickmall.cn',
|
||||
buyer: 'https://buyer-api.pickmall.cn',
|
||||
seller: 'https://store-api.pickmall.cn',
|
||||
manager: 'https://admin-api.pickmall.cn',
|
||||
// common: 'http://192.168.0.103:9000',
|
||||
|
||||
// seller: 'http://192.168.0.103:8889',
|
||||
},
|
||||
api_prod: {
|
||||
common: 'https://common-api.pickmall.cn',
|
||||
buyer: 'https://buyer-api.pickmall.cn',
|
||||
seller: 'https://store-api.pickmall.cn',
|
||||
manager: 'https://admin-api.pickmall.cn'
|
||||
},
|
||||
/**
|
||||
* @description api请求基础路径前缀
|
||||
*/
|
||||
baseUrlPrefix: "/store",
|
||||
/**
|
||||
* @description 需要加载的插件
|
||||
*/
|
||||
plugin: {
|
||||
"error-store": {
|
||||
showInHeader: true, // 设为false后不会在顶部显示错误日志徽标
|
||||
developmentOff: true // 设为true后在开发环境不会收集错误信息,方便开发中排查错误
|
||||
}
|
||||
}
|
||||
};
|
||||
47
seller/src/libs/RegExp.js
Normal file
@@ -0,0 +1,47 @@
|
||||
/**
|
||||
* 各种正则表达式
|
||||
* mobile 手机号
|
||||
* email 电子邮箱
|
||||
* password 密码【6-20位】
|
||||
* integer 正整数【不包含0】
|
||||
* money 金钱
|
||||
* TINumber 纳税识别号
|
||||
* IDCard 身份证
|
||||
* userName 账户名称【汉字、字母、数字、“-”、“_”的组合】
|
||||
* URL URL
|
||||
* TEL 固定电话
|
||||
*/
|
||||
|
||||
// 手机号
|
||||
export const mobile = /^0?(13[0-9]|14[0-9]|15[0-9]|16[0-9]|17[0-9]|18[0-9]|19[0-9])[0-9]{8}$/
|
||||
|
||||
// 电子邮箱
|
||||
export const email = /^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/
|
||||
|
||||
// 密码【6-20位】
|
||||
export const password = /^[@A-Za-z0-9!#$%^&*.~,]{6,20}$/
|
||||
|
||||
// 正整数【不包含0】
|
||||
export const integer = /^[1-9]\d*$/
|
||||
|
||||
// 正整数【包含0】
|
||||
export const Integer = /^[0-9]\d*$/
|
||||
|
||||
// 金钱
|
||||
export const money = /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/
|
||||
|
||||
// 纳税识别号
|
||||
export const TINumber = /^((\d{6}[0-9A-Z]{9})|([0-9A-Za-z]{2}\d{6}[0-9A-Za-z]{10,12}))$/
|
||||
|
||||
// 身份证
|
||||
export const IDCard = /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/
|
||||
|
||||
// 账户名称【汉字、字母、数字、“-”、“_”的组合】
|
||||
export const userName = /[A-Za-z0-9_\-\u4e00-\u9fa5]$/
|
||||
|
||||
// URL
|
||||
export const URL =
|
||||
/^(https?|ftp):\/\/([a-zA-Z0-9.-]+(:[a-zA-Z0-9.&%$-]+)*@)*((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]?)(\.(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])){3}|([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+\.(com|edu|gov|int|mil|net|org|biz|arpa|info|name|pro|aero|coop|museum|[a-zA-Z]{2}))(:[0-9]+)*(\/($|[a-zA-Z0-9.,?'\\+&%$#=~_-]+))*$/
|
||||
|
||||
// 固话
|
||||
export const TEL = /0\d{2,3}-\d{7,8}/
|
||||
337
seller/src/libs/axios.js
Normal file
@@ -0,0 +1,337 @@
|
||||
import axios from "axios";
|
||||
import config from "@/config";
|
||||
import { getStore, setStore } from "./storage";
|
||||
import { router } from "../router/index";
|
||||
import { Message } from "view-design";
|
||||
import Cookies from "js-cookie";
|
||||
import {handleRefreshToken} from "@/api/index"
|
||||
|
||||
// 统一请求路径前缀
|
||||
export const baseUrl = (process.env.NODE_ENV === 'development' ? config.api_dev.seller : config.api_prod.seller) + config.baseUrlPrefix;
|
||||
export const commonUrl = (process.env.NODE_ENV === 'development' ? config.api_dev.common : config.api_prod.common);
|
||||
|
||||
var isRefreshToken = 0;
|
||||
const refreshToken = getTokenDebounce()
|
||||
const service = axios.create({
|
||||
timeout: 10000,
|
||||
baseURL: baseUrl
|
||||
})
|
||||
service.interceptors.request.use(
|
||||
config => {
|
||||
if (config.method == 'get') {
|
||||
config.params = {
|
||||
_t: Date.parse(new Date()) / 1000,
|
||||
...config.params
|
||||
}
|
||||
}
|
||||
return config;
|
||||
},
|
||||
err => {
|
||||
Message.error("请求超时");
|
||||
return Promise.resolve(err);
|
||||
}
|
||||
);
|
||||
|
||||
// http response 拦截器
|
||||
service.interceptors.response.use(
|
||||
response => {
|
||||
const data = response.data;
|
||||
// 根据返回的code值来做不同的处理(和后端约定)
|
||||
if (!data.success && data.message) {
|
||||
Message.error(data.message);
|
||||
}
|
||||
switch (data.code) {
|
||||
case 400:
|
||||
if (data.message !== null) {
|
||||
Message.error(data.message);
|
||||
} else {
|
||||
Message.error("系统异常");
|
||||
}
|
||||
break;
|
||||
case 401:
|
||||
// 未登录 清除已登录状态
|
||||
Cookies.set("userInfo", "");
|
||||
setStore("accessToken", "");
|
||||
if (router.history.current.name != "login") {
|
||||
if (data.message !== null) {
|
||||
Message.error(data.message);
|
||||
} else {
|
||||
Message.error("未知错误,请重新登录");
|
||||
}
|
||||
router.push("/login");
|
||||
}
|
||||
break;
|
||||
case 403:
|
||||
// 权限不足
|
||||
if (data.message !== null) {
|
||||
Message.error(data.message);
|
||||
} else {
|
||||
Message.error("权限不足");
|
||||
}
|
||||
break;
|
||||
case 500:
|
||||
// 系统异常
|
||||
if (data.message !== null) {
|
||||
Message.error(data.message);
|
||||
} else {
|
||||
Message.error("系统异常");
|
||||
}
|
||||
break;
|
||||
default:
|
||||
return data;
|
||||
}
|
||||
},
|
||||
async error => {
|
||||
// 返回状态码不为200时候的错误处理
|
||||
|
||||
if (error.response) {
|
||||
if (error.response.status === 401) {
|
||||
// 这种情况一般调到登录页
|
||||
} else if (error.response.status === 403) {
|
||||
isRefreshToken++;
|
||||
if(isRefreshToken === 1) {
|
||||
const getTokenRes = await refreshToken();
|
||||
if (getTokenRes === 'success') { // 刷新token
|
||||
if (isRefreshToken === 1) {
|
||||
error.response.config.headers.accessToken = getStore('accessToken')
|
||||
return service(error.response.config)
|
||||
} else {
|
||||
router.go(0)
|
||||
}
|
||||
} else {
|
||||
Cookies.set("userInfo", "");
|
||||
router.push('/login')
|
||||
}
|
||||
isRefreshToken = 0
|
||||
}
|
||||
} else {
|
||||
// 其他错误处理
|
||||
Message.error(error.response.data.message)
|
||||
}
|
||||
}
|
||||
|
||||
/* router.push("/login") */
|
||||
return Promise.resolve(error);
|
||||
}
|
||||
);
|
||||
|
||||
// 防抖闭包来一波
|
||||
function getTokenDebounce() {
|
||||
let lock = false
|
||||
let success = false
|
||||
return function () {
|
||||
if (!lock) {
|
||||
lock = true
|
||||
let oldRefreshToken = getStore("refreshToken");
|
||||
handleRefreshToken(oldRefreshToken).then(res => {
|
||||
if (res.code === 200) {
|
||||
let {
|
||||
accessToken,
|
||||
refreshToken
|
||||
} = res.result;
|
||||
setStore("accessToken", accessToken);
|
||||
setStore("refreshToken", refreshToken);
|
||||
|
||||
success = true
|
||||
lock = false
|
||||
} else {
|
||||
success = false
|
||||
lock = false
|
||||
// router.push('/login')
|
||||
}
|
||||
}).catch((err) => {
|
||||
success = false
|
||||
lock = false
|
||||
})
|
||||
}
|
||||
return new Promise(resolve => {
|
||||
// 一直看lock,直到请求失败或者成功
|
||||
const timer = setInterval(() => {
|
||||
if (!lock) {
|
||||
clearInterval(timer)
|
||||
if (success) {
|
||||
resolve('success')
|
||||
} else {
|
||||
resolve('fail')
|
||||
}
|
||||
}
|
||||
}, 500) // 轮询时间间隔
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
export const getRequest = (url, params) => {
|
||||
let accessToken = getStore("accessToken");
|
||||
return service({
|
||||
method: "get",
|
||||
url: `${url}`,
|
||||
params: params,
|
||||
headers: {
|
||||
accessToken: accessToken
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
export const postRequest = (url, params, headers) => {
|
||||
let accessToken = getStore("accessToken");
|
||||
return service({
|
||||
method: "post",
|
||||
url: `${url}`,
|
||||
data: params,
|
||||
transformRequest: headers
|
||||
? undefined
|
||||
: [
|
||||
function(data) {
|
||||
let ret = "";
|
||||
for (let it in data) {
|
||||
ret +=
|
||||
encodeURIComponent(it) +
|
||||
"=" +
|
||||
encodeURIComponent(data[it]) +
|
||||
"&";
|
||||
}
|
||||
ret = ret.substring(0, ret.length - 1);
|
||||
return ret;
|
||||
}
|
||||
],
|
||||
headers: {
|
||||
"Content-Type": "application/x-www-form-urlencoded",
|
||||
accessToken: accessToken,
|
||||
...headers
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/** 不带form表单不带transformRequest */
|
||||
export const postRequestWithNoForm = (url, params) => {
|
||||
let accessToken = getStore("accessToken");
|
||||
return service({
|
||||
method: "post",
|
||||
url: `${url}`,
|
||||
data: params,
|
||||
|
||||
headers: {
|
||||
accessToken: accessToken
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
// export const postRequestWithHeaders = (url, params) => {
|
||||
// let accessToken = getStore("accessToken");
|
||||
// return axios({
|
||||
// method: "post",
|
||||
// url: `${url}`,
|
||||
// data: params,
|
||||
|
||||
// headers: {
|
||||
// accessToken: accessToken,
|
||||
// "Content-Type": "application/x-www-form-urlencoded"
|
||||
// }
|
||||
// });
|
||||
// };
|
||||
|
||||
export const putRequest = (url, params,headers) => {
|
||||
let accessToken = getStore("accessToken");
|
||||
return service({
|
||||
method: "put",
|
||||
url: `${url}`,
|
||||
data: params,
|
||||
transformRequest: headers
|
||||
? undefined
|
||||
: [
|
||||
function(data) {
|
||||
let ret = "";
|
||||
for (let it in data) {
|
||||
ret +=
|
||||
encodeURIComponent(it) +
|
||||
"=" +
|
||||
encodeURIComponent(data[it]) +
|
||||
"&";
|
||||
}
|
||||
ret = ret.substring(0, ret.length - 1);
|
||||
return ret;
|
||||
}
|
||||
],
|
||||
headers: {
|
||||
"Content-Type": "application/x-www-form-urlencoded",
|
||||
accessToken: accessToken,
|
||||
...headers
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
export const putRequestWithNoForm = (url, params) => {
|
||||
let accessToken = getStore("accessToken");
|
||||
return service({
|
||||
method: "put",
|
||||
url: `${url}`,
|
||||
data: params,
|
||||
|
||||
headers: {
|
||||
accessToken: accessToken
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
export const deleteRequest = (url, params) => {
|
||||
let accessToken = getStore("accessToken");
|
||||
return service({
|
||||
method: "delete",
|
||||
url: `${url}`,
|
||||
params: params,
|
||||
headers: {
|
||||
accessToken: accessToken
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
export const importRequest = (url, params) => {
|
||||
let accessToken = getStore("accessToken");
|
||||
return service({
|
||||
method: "post",
|
||||
url: `${url}`,
|
||||
data: params,
|
||||
headers: {
|
||||
accessToken: accessToken
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
export const uploadFileRequest = (url, params) => {
|
||||
let accessToken = getStore("accessToken");
|
||||
return service({
|
||||
method: "post",
|
||||
url: `${url}`,
|
||||
params: params,
|
||||
headers: {
|
||||
accessToken: accessToken
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 无需token验证的请求 避免旧token过期导致请求失败
|
||||
* @param {*} url
|
||||
* @param {*} params
|
||||
*/
|
||||
export const getRequestWithNoToken = (url, params) => {
|
||||
return service({
|
||||
method: "get",
|
||||
url: `${url}`,
|
||||
params: params
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 无需token验证的请求 避免旧token过期导致请求失败
|
||||
* @param {*} url
|
||||
* @param {*} params
|
||||
*/
|
||||
export const postRequestWithNoToken = (url, params) => {
|
||||
return service({
|
||||
method: "post",
|
||||
url: `${url}`,
|
||||
params: params
|
||||
});
|
||||
};
|
||||
|
||||
32
seller/src/libs/dictUtil.js
Normal file
@@ -0,0 +1,32 @@
|
||||
import axios from 'axios';
|
||||
import { getDictData } from '@/api/index';
|
||||
|
||||
let dictUtil = {
|
||||
|
||||
};
|
||||
|
||||
// 获取常用的数据字典保存至vuex
|
||||
dictUtil.initDictData = function (vm) {
|
||||
// axios.get(getDictData + "sex").then(res => {
|
||||
// if(res.success){
|
||||
// vm.$store.commit("setSex", res.result);
|
||||
// }
|
||||
// });
|
||||
// axios.get(getDictData + "message_type").then(res => {
|
||||
// if(res.success){
|
||||
// vm.$store.commit("setMessageType", res.result);
|
||||
// }
|
||||
// });
|
||||
// axios.get(getDictData + "priority").then(res => {
|
||||
// if(res.success){
|
||||
// vm.$store.commit("setPriority", res.result);
|
||||
// }
|
||||
// });
|
||||
// axios.get(getDictData + "leave_type").then(res => {
|
||||
// if(res.success){
|
||||
// vm.$store.commit("setLeaveType", res.result);
|
||||
// }
|
||||
// });
|
||||
};
|
||||
|
||||
export default dictUtil;
|
||||
77
seller/src/libs/emoji.js
Normal file
@@ -0,0 +1,77 @@
|
||||
// 新浪表情包api https://api.weibo.com/2/emotions.json?source=1362404091
|
||||
export const sina = [
|
||||
{
|
||||
alt: "[坏笑]",
|
||||
src:
|
||||
"http://img.t.sinajs.cn/t4/appstyle/expression/ext/normal/4d/2018new_huaixiao_org.png"
|
||||
},
|
||||
{
|
||||
alt: "[笑cry]",
|
||||
src:
|
||||
"http://img.t.sinajs.cn/t4/appstyle/expression/ext/normal/4a/2018new_xiaoku_org.png"
|
||||
},
|
||||
{
|
||||
alt: "[拜拜]",
|
||||
src:
|
||||
"http://img.t.sinajs.cn/t4/appstyle/expression/ext/normal/fd/2018new_baibai_org.png"
|
||||
},
|
||||
{
|
||||
alt: "[微笑]",
|
||||
src:
|
||||
"http://img.t.sinajs.cn/t4/appstyle/expression/ext/normal/e3/2018new_weixioa02_org.png"
|
||||
},
|
||||
{
|
||||
alt: "[偷笑]",
|
||||
src:
|
||||
"http://img.t.sinajs.cn/t4/appstyle/expression/ext/normal/71/2018new_touxiao_org.png"
|
||||
},
|
||||
{
|
||||
alt: "[亲亲]",
|
||||
src:
|
||||
"http://img.t.sinajs.cn/t4/appstyle/expression/ext/normal/2c/2018new_qinqin_org.png"
|
||||
},
|
||||
{
|
||||
alt: "[太开心]",
|
||||
src:
|
||||
"http://img.t.sinajs.cn/t4/appstyle/expression/ext/normal/1e/2018new_taikaixin_org.png"
|
||||
},
|
||||
{
|
||||
alt: "[挤眼]",
|
||||
src:
|
||||
"http://img.t.sinajs.cn/t4/appstyle/expression/ext/normal/43/2018new_jiyan_org.png"
|
||||
},
|
||||
{
|
||||
alt: "[可怜]",
|
||||
src:
|
||||
"http://img.t.sinajs.cn/t4/appstyle/expression/ext/normal/96/2018new_kelian_org.png"
|
||||
},
|
||||
{
|
||||
alt: "[可爱]",
|
||||
src:
|
||||
"http://img.t.sinajs.cn/t4/appstyle/expression/ext/normal/09/2018new_keai_org.png"
|
||||
},
|
||||
{
|
||||
alt: "[doge]",
|
||||
src: "http://img.t.sinajs.cn/t4/appstyle/expression/ext/normal/a1/2018new_doge02_org.png"
|
||||
},
|
||||
{
|
||||
alt: "[二哈]",
|
||||
src:
|
||||
"http://img.t.sinajs.cn/t4/appstyle/expression/ext/normal/22/2018new_erha_org.png"
|
||||
},
|
||||
{
|
||||
alt: "[喵喵]",
|
||||
src:
|
||||
"http://img.t.sinajs.cn/t4/appstyle/expression/ext/normal/7b/2018new_miaomiao_org.png"
|
||||
},
|
||||
{
|
||||
alt: "[摊手]",
|
||||
src:
|
||||
"http://img.t.sinajs.cn/t4/appstyle/expression/ext/normal/62/2018new_tanshou_org.png"
|
||||
},
|
||||
{
|
||||
alt: "[跪了]",
|
||||
src:
|
||||
"http://img.t.sinajs.cn/t4/appstyle/expression/ext/normal/75/2018new_gui_org.png"
|
||||
}
|
||||
]
|
||||
102
seller/src/libs/excel.js
Normal file
@@ -0,0 +1,102 @@
|
||||
import XLSX from 'xlsx';
|
||||
|
||||
function auto_width(ws, data){
|
||||
/*set worksheet max width per col*/
|
||||
const colWidth = data.map(row => row.map(val => {
|
||||
/*if null/undefined*/
|
||||
if (val == null) {
|
||||
return {'wch': 10};
|
||||
}
|
||||
/*if chinese*/
|
||||
else if (val.toString().charCodeAt(0) > 255) {
|
||||
return {'wch': val.toString().length * 2};
|
||||
} else {
|
||||
return {'wch': val.toString().length};
|
||||
}
|
||||
}))
|
||||
/*start in the first row*/
|
||||
let result = colWidth[0];
|
||||
for (let i = 1; i < colWidth.length; i++) {
|
||||
for (let j = 0; j < colWidth[i].length; j++) {
|
||||
if (result[j]['wch'] < colWidth[i][j]['wch']) {
|
||||
result[j]['wch'] = colWidth[i][j]['wch'];
|
||||
}
|
||||
}
|
||||
}
|
||||
ws['!cols'] = result;
|
||||
}
|
||||
|
||||
function json_to_array(key, jsonData){
|
||||
return jsonData.map(v => key.map(j => { return v[j] }));
|
||||
}
|
||||
|
||||
// fix data,return string
|
||||
function fixdata(data) {
|
||||
let o = ''
|
||||
let l = 0
|
||||
const w = 10240
|
||||
for (; l < data.byteLength / w; ++l) o += String.fromCharCode.apply(null, new Uint8Array(data.slice(l * w, l * w + w)))
|
||||
o += String.fromCharCode.apply(null, new Uint8Array(data.slice(l * w)))
|
||||
return o
|
||||
}
|
||||
|
||||
// get head from excel file,return array
|
||||
function get_header_row(sheet) {
|
||||
const headers = []
|
||||
const range = XLSX.utils.decode_range(sheet['!ref'])
|
||||
let C
|
||||
const R = range.s.r /* start in the first row */
|
||||
for (C = range.s.c; C <= range.e.c; ++C) { /* walk every column in the range */
|
||||
var cell = sheet[XLSX.utils.encode_cell({ c: C, r: R })] /* find the cell in the first row */
|
||||
var hdr = 'UNKNOWN ' + C // <-- replace with your desired default
|
||||
if (cell && cell.t) hdr = XLSX.utils.format_cell(cell)
|
||||
headers.push(hdr)
|
||||
}
|
||||
return headers
|
||||
}
|
||||
|
||||
export const export_table_to_excel= (id, filename) => {
|
||||
const table = document.getElementById(id);
|
||||
const wb = XLSX.utils.table_to_book(table);
|
||||
XLSX.writeFile(wb, filename);
|
||||
}
|
||||
|
||||
export const export_json_to_excel = ({data, key, title, filename, autoWidth}) => {
|
||||
const wb = XLSX.utils.book_new();
|
||||
data.unshift(title);
|
||||
const ws = XLSX.utils.json_to_sheet(data, {header: key, skipHeader: true});
|
||||
if(autoWidth){
|
||||
const arr = json_to_array(key, data);
|
||||
auto_width(ws, arr);
|
||||
}
|
||||
XLSX.utils.book_append_sheet(wb, ws, filename);
|
||||
XLSX.writeFile(wb, filename + '.xlsx');
|
||||
}
|
||||
|
||||
export const export_array_to_excel = ({key, data, title, filename, autoWidth}) => {
|
||||
const wb = XLSX.utils.book_new();
|
||||
const arr = json_to_array(key, data);
|
||||
arr.unshift(title);
|
||||
const ws = XLSX.utils.aoa_to_sheet(arr);
|
||||
if(autoWidth){
|
||||
auto_width(ws, arr);
|
||||
}
|
||||
XLSX.utils.book_append_sheet(wb, ws, filename);
|
||||
XLSX.writeFile(wb, filename + '.xlsx');
|
||||
}
|
||||
|
||||
export const read = (data, type) => {
|
||||
const workbook = XLSX.read(data, { type: type });
|
||||
const firstSheetName = workbook.SheetNames[0];
|
||||
const worksheet = workbook.Sheets[firstSheetName];
|
||||
const header = get_header_row(worksheet);
|
||||
const results = XLSX.utils.sheet_to_json(worksheet);
|
||||
return {header, results};
|
||||
}
|
||||
|
||||
export default {
|
||||
export_table_to_excel,
|
||||
export_array_to_excel,
|
||||
export_json_to_excel,
|
||||
read
|
||||
}
|
||||
14
seller/src/libs/hasPermission.js
Normal file
@@ -0,0 +1,14 @@
|
||||
const hasPermission = {
|
||||
install (Vue, options) {
|
||||
Vue.directive('has', {
|
||||
inserted (el, binding, vnode) {
|
||||
let permTypes = vnode.context.$route.meta.permTypes;
|
||||
if (permTypes&&!permTypes.includes(binding.value)) {
|
||||
el.parentNode.removeChild(el);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
export default hasPermission;
|
||||
16
seller/src/libs/hasRole.js
Normal file
@@ -0,0 +1,16 @@
|
||||
import { getStore } from './storage';
|
||||
|
||||
const hasRole = {
|
||||
install (Vue, options) {
|
||||
Vue.directive('hasRole', {
|
||||
inserted (el, binding) {
|
||||
let roles = getStore("roles");
|
||||
if (roles&&!roles.includes(binding.value)) {
|
||||
el.parentNode.removeChild(el);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
export default hasRole;
|
||||
3513
seller/src/libs/icon.js
Normal file
82
seller/src/libs/importTemplate.js
Normal file
@@ -0,0 +1,82 @@
|
||||
// 导入表格模版数据
|
||||
export const userColumns = [
|
||||
{
|
||||
title: "username",
|
||||
key: "username"
|
||||
},
|
||||
{
|
||||
title: "password",
|
||||
key: "password"
|
||||
},
|
||||
{
|
||||
title: "avatar",
|
||||
key: "avatar"
|
||||
},
|
||||
{
|
||||
title: "departmentId",
|
||||
key: "departmentId"
|
||||
},
|
||||
{
|
||||
title: "mobile",
|
||||
key: "mobile"
|
||||
},
|
||||
{
|
||||
title: "email",
|
||||
key: "email"
|
||||
},
|
||||
{
|
||||
title: "sex",
|
||||
key: "sex"
|
||||
},
|
||||
{
|
||||
title: "address",
|
||||
key: "address"
|
||||
},
|
||||
{
|
||||
title: "type",
|
||||
key: "type"
|
||||
},
|
||||
{
|
||||
title: "status",
|
||||
key: "status"
|
||||
},
|
||||
{
|
||||
title: "delFlag",
|
||||
key: "delFlag"
|
||||
},
|
||||
{
|
||||
title: "defaultRole",
|
||||
key: "defaultRole"
|
||||
}
|
||||
]
|
||||
|
||||
export const userData = [
|
||||
{
|
||||
username: "【记得删除该说明行】唯一用户名不能为空",
|
||||
password: "密码不能为空",
|
||||
avatar: "头像图片链接",
|
||||
departmentId: "部门表主键id",
|
||||
email: "邮箱",
|
||||
mobile: "手机",
|
||||
sex: "性别 0(女) 1(男)",
|
||||
address: "地址数据省市编号 请勿乱填",
|
||||
type: "用户类型 0(普通用户) 1(管理员)",
|
||||
status: "用户状态 0(正常) -1(禁用)",
|
||||
delFlag: "删除标志 0(正常) 1(已删)",
|
||||
defaultRole: "角色 0(不分配默认角色) 1(分配默认注册用户角色)"
|
||||
},
|
||||
{
|
||||
username: "lili",
|
||||
password: "123456",
|
||||
avatar: "https://s1.ax1x.com/2018/05/19/CcdVQP.png",
|
||||
departmentId: "40652338142121984",
|
||||
email: "1012139570@qq.com",
|
||||
sex: 1,
|
||||
address: "[\"510000\",\"510100\",\"510104\"]",
|
||||
mobile: "18782059038",
|
||||
type: 0,
|
||||
status: 0,
|
||||
delFlag: 0,
|
||||
defaultRole: 1
|
||||
}
|
||||
]
|
||||
2
seller/src/libs/lazyLoading.js
Normal file
@@ -0,0 +1,2 @@
|
||||
export default (url) =>()=>import(`@/views/${url}.vue`)
|
||||
|
||||
706
seller/src/libs/routerJson.js
Normal file
@@ -0,0 +1,706 @@
|
||||
export const result = [
|
||||
{
|
||||
name: "lili",
|
||||
showAlways: true,
|
||||
level: 0,
|
||||
type: -1,
|
||||
title: "商品",
|
||||
path: "",
|
||||
component: "",
|
||||
icon: "md-home",
|
||||
isMenu: true,
|
||||
url: "",
|
||||
description: "",
|
||||
buttonType: "",
|
||||
permTypes: [],
|
||||
children: [
|
||||
{
|
||||
name: "goods-list",
|
||||
showAlways: true,
|
||||
level: 1,
|
||||
type: 0,
|
||||
title: "商品管理",
|
||||
path: "",
|
||||
component: "Main",
|
||||
icon: "md-person",
|
||||
isMenu: true,
|
||||
url: "",
|
||||
permTypes: [],
|
||||
children: [
|
||||
{
|
||||
name: "goods-operation",
|
||||
showAlways: true,
|
||||
level: 2,
|
||||
type: 0,
|
||||
title: "商品发布",
|
||||
path: "goods-operation",
|
||||
component: "goods-operation",
|
||||
icon: "md-person",
|
||||
isMenu: true,
|
||||
url: "",
|
||||
children: null,
|
||||
permTypes: []
|
||||
},
|
||||
{
|
||||
name: "goods",
|
||||
showAlways: true,
|
||||
level: 2,
|
||||
type: 0,
|
||||
title: "商品列表",
|
||||
path: "goods",
|
||||
component: "goods/goods-seller/goods",
|
||||
icon: "md-person",
|
||||
isMenu: true,
|
||||
url: "",
|
||||
children: null,
|
||||
permTypes: []
|
||||
},
|
||||
{
|
||||
name: "daft-goods",
|
||||
showAlways: true,
|
||||
level: 2,
|
||||
type: 0,
|
||||
title: "草稿商品",
|
||||
path: "daft-goods",
|
||||
component: "goods/goods-seller/draftGoods",
|
||||
icon: "md-person",
|
||||
isMenu: true,
|
||||
url: "",
|
||||
children: null,
|
||||
permTypes: []
|
||||
},
|
||||
|
||||
{
|
||||
path: "template-goods",
|
||||
props: {type: "TEMPLATE"},
|
||||
showAlways: true,
|
||||
level: 2,
|
||||
type: 0,
|
||||
title: "商品模版",
|
||||
component: "goods/goods-seller/draftGoods",
|
||||
icon: "md-person",
|
||||
isMenu: true,
|
||||
url: "",
|
||||
name: "template-goods",
|
||||
children: null,
|
||||
permTypes: []
|
||||
},
|
||||
{
|
||||
name: "category",
|
||||
showAlways: true,
|
||||
level: 2,
|
||||
type: 0,
|
||||
title: "店铺分类",
|
||||
path: "category",
|
||||
component: "goods/goods-manage/category",
|
||||
icon: "md-person",
|
||||
isMenu: true,
|
||||
url: "",
|
||||
children: null,
|
||||
permTypes: []
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
{
|
||||
name: "order",
|
||||
showAlways: true,
|
||||
level: 0,
|
||||
type: -1,
|
||||
title: "订单",
|
||||
path: "",
|
||||
component: "",
|
||||
icon: "md-home",
|
||||
isMenu: true,
|
||||
url: "",
|
||||
description: "",
|
||||
buttonType: "",
|
||||
permTypes: [],
|
||||
children: [
|
||||
{
|
||||
name: "order",
|
||||
showAlways: true,
|
||||
level: 1,
|
||||
type: 0,
|
||||
title: "订单管理",
|
||||
path: "/order",
|
||||
component: "Main",
|
||||
icon: "md-person",
|
||||
isMenu: true,
|
||||
url: "",
|
||||
permTypes: [],
|
||||
children: [
|
||||
{
|
||||
name: "order",
|
||||
showAlways: true,
|
||||
level: 2,
|
||||
type: 0,
|
||||
title: "商品订单",
|
||||
path: "orderList",
|
||||
component: "order/order/orderList",
|
||||
icon: "md-person",
|
||||
isMenu: true,
|
||||
url: "",
|
||||
children: null,
|
||||
permTypes: []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "memberComment",
|
||||
showAlways: true,
|
||||
level: 1,
|
||||
type: 0,
|
||||
title: "评价管理",
|
||||
path: "/order",
|
||||
component: "Main",
|
||||
icon: "md-person",
|
||||
isMenu: true,
|
||||
url: "",
|
||||
permTypes: [],
|
||||
children: [
|
||||
{
|
||||
name: "memberComment",
|
||||
showAlways: true,
|
||||
level: 2,
|
||||
type: 0,
|
||||
title: "评价管理",
|
||||
path: "memberComment",
|
||||
component: "member/memberComment",
|
||||
icon: "md-person",
|
||||
isMenu: true,
|
||||
url: "",
|
||||
children: null,
|
||||
permTypes: []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "order",
|
||||
showAlways: true,
|
||||
level: 1,
|
||||
type: 0,
|
||||
title: "售后管理",
|
||||
path: "/order",
|
||||
component: "Main",
|
||||
icon: "md-person",
|
||||
isMenu: true,
|
||||
url: "",
|
||||
permTypes: [],
|
||||
children: [
|
||||
{
|
||||
name: "returnGoodsOrder",
|
||||
showAlways: true,
|
||||
level: 2,
|
||||
type: 0,
|
||||
title: "退货管理",
|
||||
path: "returnGoodsOrder",
|
||||
component: "order/after-order/returnGoodsOrder",
|
||||
icon: "md-person",
|
||||
isMenu: true,
|
||||
url: "",
|
||||
permTypes: [],
|
||||
children: null
|
||||
},
|
||||
{
|
||||
name: "returnMoneyOrder",
|
||||
showAlways: true,
|
||||
level: 2,
|
||||
type: 0,
|
||||
title: "退款管理",
|
||||
path: "returnMoneyOrder",
|
||||
component: "order/after-order/returnMoneyOrder",
|
||||
icon: "md-person",
|
||||
isMenu: true,
|
||||
url: "",
|
||||
permTypes: [],
|
||||
children: null
|
||||
},
|
||||
{
|
||||
name: "orderComplaint",
|
||||
showAlways: true,
|
||||
level: 2,
|
||||
type: 0,
|
||||
title: "投诉管理",
|
||||
path: "orderComplaint",
|
||||
component: "order/after-order/orderComplaint",
|
||||
icon: "md-person",
|
||||
isMenu: true,
|
||||
url: "",
|
||||
permTypes: [],
|
||||
children: null
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
{
|
||||
name: "bill",
|
||||
showAlways: true,
|
||||
level: 0,
|
||||
type: -1,
|
||||
title: "财务",
|
||||
path: "",
|
||||
component: "",
|
||||
icon: "md-home",
|
||||
isMenu: true,
|
||||
url: "",
|
||||
description: "",
|
||||
buttonType: "",
|
||||
permTypes: [],
|
||||
children: [
|
||||
{
|
||||
name: "bill",
|
||||
showAlways: true,
|
||||
level: 1,
|
||||
type: 0,
|
||||
title: "财务管理",
|
||||
path: "/bill",
|
||||
component: "Main",
|
||||
icon: "md-person",
|
||||
isMenu: true,
|
||||
url: "",
|
||||
permTypes: [],
|
||||
children: [
|
||||
{
|
||||
name: "bill",
|
||||
showAlways: true,
|
||||
level: 2,
|
||||
type: 0,
|
||||
title: "财务对账",
|
||||
path: "bill",
|
||||
component: "shop/bill/accountStatementBill",
|
||||
icon: "md-person",
|
||||
isMenu: true,
|
||||
url: "",
|
||||
permTypes: [],
|
||||
children: null
|
||||
},
|
||||
{
|
||||
name: "storeBill",
|
||||
showAlways: true,
|
||||
level: 2,
|
||||
type: 0,
|
||||
title: "店铺结算",
|
||||
path: "storeBill",
|
||||
component: "shop/bill/storeBill",
|
||||
icon: "md-person",
|
||||
isMenu: true,
|
||||
url: "",
|
||||
permTypes: [],
|
||||
children: null
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
{
|
||||
name: "receipt",
|
||||
showAlways: true,
|
||||
level: 1,
|
||||
type: 0,
|
||||
title: "发票管理",
|
||||
path: "/bill",
|
||||
component: "Main",
|
||||
icon: "md-person",
|
||||
isMenu: true,
|
||||
url: "",
|
||||
permTypes: [],
|
||||
children: [
|
||||
{
|
||||
name: "receipt",
|
||||
showAlways: true,
|
||||
level: 2,
|
||||
type: 0,
|
||||
title: "发票管理",
|
||||
path: "receipt",
|
||||
component: "order/receiptManager/receipt",
|
||||
icon: "md-person",
|
||||
isMenu: true,
|
||||
url: "",
|
||||
children: null,
|
||||
permTypes: []
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "promotion",
|
||||
showAlways: true,
|
||||
level: 0,
|
||||
type: -1,
|
||||
title: "营销",
|
||||
path: "",
|
||||
component: "",
|
||||
icon: "md-home",
|
||||
isMenu: true,
|
||||
url: "",
|
||||
description: "",
|
||||
buttonType: "",
|
||||
permTypes: [],
|
||||
children: [
|
||||
{
|
||||
name: "promotion",
|
||||
showAlways: true,
|
||||
level: 1,
|
||||
type: 0,
|
||||
title: "平台活动",
|
||||
path: "/promotion",
|
||||
component: "Main",
|
||||
icon: "md-person",
|
||||
isMenu: true,
|
||||
url: "",
|
||||
permTypes: [],
|
||||
children: [
|
||||
{
|
||||
name: "pintuan",
|
||||
showAlways: true,
|
||||
level: 2,
|
||||
type: 0,
|
||||
title: "拼团活动",
|
||||
path: "pintuan",
|
||||
component: "promotion/pintuan/pintuan",
|
||||
icon: "md-person",
|
||||
isMenu: true,
|
||||
url: "",
|
||||
permTypes: [],
|
||||
children: null
|
||||
},
|
||||
{
|
||||
name: "seckill",
|
||||
showAlways: true,
|
||||
level: 2,
|
||||
type: 0,
|
||||
title: "秒杀活动",
|
||||
path: "seckill",
|
||||
component: "promotion/seckill/seckill",
|
||||
icon: "md-person",
|
||||
isMenu: true,
|
||||
url: "",
|
||||
permTypes: [],
|
||||
children: null
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "promotion",
|
||||
showAlways: true,
|
||||
level: 1,
|
||||
type: 0,
|
||||
title: "商家活动",
|
||||
path: "/promotion",
|
||||
component: "Main",
|
||||
icon: "md-person",
|
||||
isMenu: true,
|
||||
url: "",
|
||||
permTypes: [],
|
||||
children: [
|
||||
{
|
||||
name: "full-cut",
|
||||
showAlways: true,
|
||||
level: 2,
|
||||
type: 0,
|
||||
title: "满额活动",
|
||||
path: "full-cut",
|
||||
component: "promotion/fullCut/full-cut",
|
||||
icon: "md-person",
|
||||
isMenu: true,
|
||||
url: "",
|
||||
permTypes: [],
|
||||
children: null
|
||||
},
|
||||
{
|
||||
name: "coupon",
|
||||
showAlways: true,
|
||||
level: 2,
|
||||
type: 0,
|
||||
title: "优惠券",
|
||||
path: "coupon",
|
||||
component: "promotion/coupon/coupon",
|
||||
icon: "md-person",
|
||||
isMenu: true,
|
||||
url: "",
|
||||
permTypes: [],
|
||||
children: null
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "promotion",
|
||||
showAlways: true,
|
||||
level: 1,
|
||||
type: 0,
|
||||
title: "分销管理",
|
||||
path: "/promotion",
|
||||
component: "Main",
|
||||
icon: "md-person",
|
||||
isMenu: true,
|
||||
url: "",
|
||||
permTypes: [],
|
||||
children: [
|
||||
{
|
||||
name: "distributionGoods",
|
||||
showAlways: true,
|
||||
level: 2,
|
||||
type: 0,
|
||||
title: "分销商品",
|
||||
path: "distributionGoods",
|
||||
component: "distribution/distributionGoods",
|
||||
icon: "md-person",
|
||||
isMenu: true,
|
||||
url: "",
|
||||
permTypes: [],
|
||||
children: null
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
{
|
||||
name: "statistics",
|
||||
showAlways: true,
|
||||
level: 0,
|
||||
type: -1,
|
||||
title: "统计",
|
||||
path: "",
|
||||
component: "",
|
||||
icon: "md-home",
|
||||
isMenu: true,
|
||||
url: "",
|
||||
description: "",
|
||||
buttonType: "",
|
||||
permTypes: [],
|
||||
children: [
|
||||
{
|
||||
name: "statistics",
|
||||
showAlways: true,
|
||||
level: 1,
|
||||
type: 0,
|
||||
title: "统计管理",
|
||||
path: "/statistics",
|
||||
component: "Main",
|
||||
icon: "md-person",
|
||||
isMenu: true,
|
||||
url: "",
|
||||
permTypes: [],
|
||||
children: [
|
||||
{
|
||||
name: "goodsStatistics",
|
||||
showAlways: true,
|
||||
level: 2,
|
||||
type: 0,
|
||||
title: "商品统计",
|
||||
path: "goodsStatistics",
|
||||
component: "statistics/goods",
|
||||
icon: "md-person",
|
||||
isMenu: true,
|
||||
url: "",
|
||||
permTypes: [],
|
||||
children: null
|
||||
},
|
||||
{
|
||||
name: "orderStatistics",
|
||||
showAlways: true,
|
||||
level: 2,
|
||||
type: 0,
|
||||
title: "订单统计",
|
||||
path: "orderStatistics",
|
||||
component: "statistics/order",
|
||||
icon: "md-person",
|
||||
isMenu: true,
|
||||
url: "",
|
||||
permTypes: [],
|
||||
children: null
|
||||
},
|
||||
{
|
||||
name: "trafficStatistics",
|
||||
showAlways: true,
|
||||
level: 2,
|
||||
type: 0,
|
||||
title: "流量统计",
|
||||
path: "trafficStatistics",
|
||||
component: "statistics/traffic",
|
||||
icon: "md-person",
|
||||
isMenu: true,
|
||||
url: "",
|
||||
permTypes: [],
|
||||
children: null
|
||||
},
|
||||
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
{
|
||||
name: "settings",
|
||||
showAlways: true,
|
||||
level: 0,
|
||||
type: -1,
|
||||
title: "设置",
|
||||
path: "",
|
||||
component: "",
|
||||
icon: "md-home",
|
||||
isMenu: true,
|
||||
url: "",
|
||||
description: "",
|
||||
buttonType: "",
|
||||
children: [
|
||||
{
|
||||
name: "user-manage",
|
||||
showAlways: true,
|
||||
level: 1,
|
||||
type: 0,
|
||||
title: "页面设置",
|
||||
path: "user-manage",
|
||||
component: "sys/user-manage/userManage",
|
||||
icon: "md-person",
|
||||
isMenu: true,
|
||||
url: "",
|
||||
permTypes: [],
|
||||
children: []
|
||||
},
|
||||
{
|
||||
name: "ship",
|
||||
showAlways: true,
|
||||
level: 1,
|
||||
type: 0,
|
||||
title: "配送设置",
|
||||
path: "",
|
||||
component: "Main",
|
||||
icon: "md-person",
|
||||
isMenu: true,
|
||||
url: "",
|
||||
permTypes: [],
|
||||
children: [
|
||||
{
|
||||
name: "shipTemplate",
|
||||
showAlways: true,
|
||||
level: 2,
|
||||
type: 0,
|
||||
title: "配送模板",
|
||||
path: "shipTemplate",
|
||||
component: "shop/ship/shipTemplate",
|
||||
icon: "md-person",
|
||||
isMenu: true,
|
||||
url: "",
|
||||
permTypes: [],
|
||||
children: null
|
||||
},
|
||||
{
|
||||
name: "logistics",
|
||||
showAlways: true,
|
||||
level: 2,
|
||||
type: 0,
|
||||
title: "物流公司",
|
||||
path: "logistics",
|
||||
component: "shop/ship/logistics",
|
||||
icon: "md-person",
|
||||
isMenu: true,
|
||||
url: "",
|
||||
permTypes: [],
|
||||
children: null
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "shop",
|
||||
showAlways: false,
|
||||
level: 1,
|
||||
type: 0,
|
||||
title: "店铺管理",
|
||||
path: "/shop",
|
||||
component: "Main",
|
||||
icon: "md-person",
|
||||
isMenu: true,
|
||||
url: "",
|
||||
description: "",
|
||||
buttonType: "",
|
||||
children: [
|
||||
{
|
||||
name: "shopSetting",
|
||||
showAlways: true,
|
||||
level: 2,
|
||||
type: 0,
|
||||
title: "店铺设置",
|
||||
path: "shopSetting",
|
||||
component: "shop/shopSetting",
|
||||
icon: "md-log-in",
|
||||
isMenu: true,
|
||||
url: null,
|
||||
description: null,
|
||||
buttonType: "",
|
||||
children: null,
|
||||
permTypes: []
|
||||
},
|
||||
{
|
||||
name: "shopAddress",
|
||||
showAlways: true,
|
||||
level: 2,
|
||||
type: 0,
|
||||
title: "自提点管理",
|
||||
path: "shopAddress",
|
||||
component: "shop/shopAddress",
|
||||
icon: "md-log-in",
|
||||
isMenu: true,
|
||||
url: null,
|
||||
description: null,
|
||||
buttonType: "",
|
||||
children: null,
|
||||
permTypes: []
|
||||
}
|
||||
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "messages",
|
||||
showAlways: true,
|
||||
level: 0,
|
||||
type: -1,
|
||||
title: "消息",
|
||||
path: "",
|
||||
component: "",
|
||||
icon: "md-home",
|
||||
isMenu: true,
|
||||
url: "",
|
||||
description: "",
|
||||
buttonType: "",
|
||||
children: [
|
||||
{
|
||||
name: "user-manage",
|
||||
showAlways: true,
|
||||
level: 1,
|
||||
type: 0,
|
||||
title: "系统消息",
|
||||
path: "user-manage",
|
||||
component: "sys/user-manage/userManage",
|
||||
icon: "md-person",
|
||||
isMenu: true,
|
||||
url: "",
|
||||
permTypes: [],
|
||||
children: [
|
||||
{
|
||||
name: "message_index",
|
||||
showAlways: true,
|
||||
level: 2,
|
||||
type: 0,
|
||||
title: "系统消息",
|
||||
path: "message",
|
||||
component: "message",
|
||||
icon: "md-person",
|
||||
isMenu: true,
|
||||
url: "",
|
||||
permTypes: [],
|
||||
children: null
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
];
|
||||
30
seller/src/libs/storage.js
Normal file
@@ -0,0 +1,30 @@
|
||||
/**
|
||||
* 存储localStorage
|
||||
*/
|
||||
export const setStore = (name, content) => {
|
||||
if (!name) return;
|
||||
if (typeof content !== 'string') {
|
||||
content = JSON.stringify(content);
|
||||
}
|
||||
window.localStorage.setItem(name, content);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取localStorage
|
||||
*/
|
||||
export const getStore = name => {
|
||||
if (!name) return;
|
||||
let v = window.localStorage.getItem(name);
|
||||
if (v == null) {
|
||||
return "";
|
||||
}
|
||||
return v;
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除localStorage
|
||||
*/
|
||||
export const removeStore = name => {
|
||||
if (!name) return;
|
||||
window.localStorage.removeItem(name);
|
||||
}
|
||||
100
seller/src/libs/table2excel.js
Normal file
@@ -0,0 +1,100 @@
|
||||
var idTmr;
|
||||
function getExplorer () {
|
||||
var explorer = window.navigator.userAgent;
|
||||
if (explorer.indexOf('MSIE') >= 0) {
|
||||
// ie
|
||||
return 'ie';
|
||||
} else if (explorer.indexOf('Firefox') >= 0) {
|
||||
// firefox
|
||||
return 'Firefox';
|
||||
} else if (explorer.indexOf('Chrome') >= 0) {
|
||||
// Chrome
|
||||
return 'Chrome';
|
||||
} else if (explorer.indexOf('Opera') >= 0) {
|
||||
// Opera
|
||||
return 'Opera';
|
||||
} else if (explorer.indexOf('Safari') >= 0) {
|
||||
// Safari
|
||||
return 'Safari';
|
||||
};
|
||||
};
|
||||
function tranform (table, aId, name) {
|
||||
let tableHead = table.$children[0].$el;
|
||||
let tableBody = table.$children[1].$el;
|
||||
let tableInnerHTML = '<thead><tr>';
|
||||
if (table.$children.length !== 1) {
|
||||
let len = tableBody.rows.length;
|
||||
let i = -1;
|
||||
while (i < len) {
|
||||
if (i == -1) {
|
||||
Array.from(tableHead.rows[0].children).forEach((td) => {
|
||||
tableInnerHTML = tableInnerHTML + '<th>' + td.children[0].children[0].innerHTML + '</th>';
|
||||
});
|
||||
tableInnerHTML += '</tr><thead><tbody>';
|
||||
} else {
|
||||
tableInnerHTML += '<tr>';
|
||||
Array.from(tableBody.rows[i].children).forEach((td) => {
|
||||
tableInnerHTML = tableInnerHTML + '<td>' + td.children[0].children[0].innerHTML + '</td>';
|
||||
});
|
||||
tableInnerHTML += '</tr>';
|
||||
}
|
||||
i++;
|
||||
}
|
||||
tableInnerHTML += '</tbody>';
|
||||
}
|
||||
|
||||
if (getExplorer() !== 'Safari' && name.substr(-1, 4) !== '.xls') {
|
||||
name += '.xls';
|
||||
}
|
||||
|
||||
if (getExplorer() == 'ie') {
|
||||
var curTbl = table;
|
||||
var oXL = new ActiveXObject('Excel.Application');
|
||||
var oWB = oXL.Workbooks.Add();
|
||||
var xlsheet = oWB.Worksheets(1);
|
||||
var sel = document.body.createTextRange();
|
||||
sel.moveToElementText(curTbl);
|
||||
sel.select();
|
||||
sel.execCommand('Copy');
|
||||
xlsheet.Paste();
|
||||
oXL.Visible = true;
|
||||
|
||||
try {
|
||||
var fname = oXL.Application.GetSaveAsFilename('Excel.xls', 'Excel Spreadsheets (*.xls), *.xls');
|
||||
} catch (e) {
|
||||
print('Nested catch caught ' + e);
|
||||
} finally {
|
||||
oWB.SaveAs(fname);
|
||||
// oWB.Close(savechanges = false);
|
||||
oXL.Quit();
|
||||
oXL = null;
|
||||
idTmr = setInterval(Cleanup(), 1);
|
||||
}
|
||||
} else {
|
||||
tableToExcel(tableInnerHTML, aId, name);
|
||||
}
|
||||
}
|
||||
function Cleanup () {
|
||||
window.clearInterval(idTmr);
|
||||
// CollectGarbage();
|
||||
}
|
||||
let tableToExcel = (function () {
|
||||
let uri = 'data:application/vnd.ms-excel;base64,';
|
||||
let template = '<html><head><meta charset="UTF-8"></head><body><table>{table}</table></body></html>';
|
||||
let base64 = function (s) { return window.btoa(unescape(encodeURIComponent(s))); };
|
||||
let format = function (s, c) {
|
||||
return s.replace(/{(\w+)}/g, function (m, p) { return c[p]; });
|
||||
};
|
||||
return function (table, aId, name) {
|
||||
let ctx = {worksheet: name || 'Worksheet', table: table};
|
||||
document.getElementById(aId).href = uri + base64(format(template, ctx));
|
||||
document.getElementById(aId).download = name;
|
||||
document.getElementById(aId).click();
|
||||
};
|
||||
})();
|
||||
|
||||
const table2excel = {};
|
||||
|
||||
table2excel.transform = tranform;
|
||||
|
||||
export default table2excel;
|
||||
459
seller/src/libs/util.js
Normal file
@@ -0,0 +1,459 @@
|
||||
import axios from 'axios';
|
||||
import { getMenuList } from '@/api/index';
|
||||
import lazyLoading from './lazyLoading.js';
|
||||
import router from '@/router/index';
|
||||
import Cookies from "js-cookie";
|
||||
import { result } from './routerJson.js';
|
||||
|
||||
let util = {
|
||||
|
||||
};
|
||||
|
||||
util.title = function (title) {
|
||||
title = title || 'lili ';
|
||||
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) + " 年"
|
||||
|
||||
};
|
||||
|
||||
util.inOf = function (arr, targetArr) {
|
||||
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;
|
||||
}
|
||||
};
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
};
|
||||
|
||||
util.handleTitle = function (vm, item) {
|
||||
if (typeof item.title == 'object') {
|
||||
return vm.$t(item.title.i18n);
|
||||
} 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 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;
|
||||
};
|
||||
|
||||
util.openNewPage = function (vm, name, argu, query) {
|
||||
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;
|
||||
}
|
||||
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);
|
||||
}
|
||||
}
|
||||
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();
|
||||
}
|
||||
};
|
||||
|
||||
// 将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文件'))
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 将二维数组转为表格数据
|
||||
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
|
||||
}
|
||||
}
|
||||
|
||||
util.initRouter = function (vm) { // 初始化路由
|
||||
const constRoutes = [];
|
||||
const otherRoutes = [];
|
||||
|
||||
// 404路由需要和动态路由一起加载
|
||||
const otherRouter = [{
|
||||
path: '/*',
|
||||
name: 'error-404',
|
||||
meta: {
|
||||
title: '404-页面不存在'
|
||||
},
|
||||
component: 'error-page/404'
|
||||
}];
|
||||
// 判断用户是否登录
|
||||
let userInfo = Cookies.get('userInfo')
|
||||
// if (!userInfo) {
|
||||
// // 未登录
|
||||
// return;
|
||||
// }
|
||||
|
||||
if (!vm.$store.state.app.added) {
|
||||
// 第一次加载 读取数据
|
||||
let accessToken = window.localStorage.getItem('accessToken');
|
||||
// 加载菜单
|
||||
// axios.get(getMenuList, { headers: { 'accessToken': accessToken } }).then(res => {
|
||||
// let menuData = res.result;
|
||||
let menuData = result;
|
||||
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);
|
||||
// });
|
||||
} else {
|
||||
// 读取缓存数据
|
||||
let data = window.localStorage.getItem('menuData');
|
||||
if (!data) {
|
||||
vm.$store.commit('setAdded', false);
|
||||
return;
|
||||
}
|
||||
let menuData = JSON.parse(data);
|
||||
// 添加菜单路由
|
||||
util.initMenuData(vm, menuData);
|
||||
}
|
||||
};
|
||||
|
||||
// 添加所有顶部导航栏下的菜单路由
|
||||
util.initAllMenuData = function (constRoutes, data) {
|
||||
|
||||
let allMenuData = [];
|
||||
data.forEach(e => {
|
||||
if (e.type == -1) {
|
||||
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,
|
||||
icon: e.icon
|
||||
}
|
||||
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;
|
||||
}
|
||||
}
|
||||
} 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));
|
||||
|
||||
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 = import(`@/views/${menu.component}.vue`);
|
||||
menu.component = lazyLoading(menu.component);
|
||||
|
||||
if (item.children && item.children.length > 0) {
|
||||
menu.children = [];
|
||||
util.initRouterNode(menu.children, item.children);
|
||||
}
|
||||
|
||||
let meta = {};
|
||||
// 给页面添加权限、标题、第三方网页链接
|
||||
meta.permTypes = menu.permTypes ? menu.permTypes : null;
|
||||
meta.title = menu.title ? menu.title + " - lilishop商家后台" : null;
|
||||
meta.url = menu.url ? menu.url : null;
|
||||
menu.meta = meta;
|
||||
|
||||
routers.push(menu);
|
||||
}
|
||||
};
|
||||
|
||||
export default util;
|
||||
80
seller/src/libs/validate.js
Normal file
@@ -0,0 +1,80 @@
|
||||
/**
|
||||
* 密码格式验证
|
||||
* @param rule 验证规则(不少于6位)
|
||||
* @param value 需要验证的值
|
||||
* @param callback 回调函数
|
||||
*/
|
||||
export const validatePassword = (rule, value, callback) => {
|
||||
if (value.length < 6) {
|
||||
callback(new Error('密码长度不得小于6位'));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* 手机号码格式验证
|
||||
* @param rule 验证规则
|
||||
* @param value 需要验证的值
|
||||
* @param callback 回调函数
|
||||
*/
|
||||
export const validateMobile = (rule, value, callback) => {
|
||||
var reg = /^[1][3,4,5,6,7,8][0-9]{9}$/;
|
||||
if (!reg.test(value)) {
|
||||
callback(new Error('手机号格式错误'));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* 身份证号码格式验证
|
||||
* @param rule 验证规则(是否满足18位)
|
||||
* @param value 需要验证的值
|
||||
* @param callback 回调函数
|
||||
*/
|
||||
export const validateIDCard = (rule, value, callback) => {
|
||||
const reg = /^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/;
|
||||
if (!reg.test(value)) {
|
||||
callback(new Error('身份证号码格式错误'));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
// 验证是否整数
|
||||
export function isInteger(rule, value, callback) {
|
||||
if (!value) {
|
||||
return callback(new Error('输入不可以为空'));
|
||||
}
|
||||
setTimeout(() => {
|
||||
if (!Number(value)) {
|
||||
callback(new Error('请输入正整数'));
|
||||
} else {
|
||||
const re = /^[0-9]*[1-9][0-9]*$/;
|
||||
const rsCheck = re.test(value);
|
||||
if (!rsCheck) {
|
||||
callback(new Error('请输入正整数'));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
}
|
||||
}, 1000);
|
||||
}
|
||||
export function isMoney(rule, value, callback) {
|
||||
if (!value) {
|
||||
return callback(new Error('输入不可以为空'));
|
||||
}
|
||||
let re =/(^[1-9]{1}[0-9]*$)|(^[0-9]*\.[0-9]{2}$)/;
|
||||
const rsCheck = re.test(value);
|
||||
if (!rsCheck) {
|
||||
callback(new Error('请输入正整数'));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
}
|
||||
|
||||
export function validatetoFixedNew(str) {
|
||||
return str ;
|
||||
}
|
||||
20
seller/src/libs/zh.json
Normal file
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"name": "zh",
|
||||
"options": {
|
||||
"months": ["1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"],
|
||||
"shortMonths": ["1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"],
|
||||
"days": ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"],
|
||||
"shortDays": ["周日", "周一", "周二", "周三", "周四", "周五", "周六"],
|
||||
"toolbar": {
|
||||
"exportToSVG": "下载图表 SVG",
|
||||
"exportToPNG": "下载图表 PNG",
|
||||
"menu": "菜单",
|
||||
"selection": "选择",
|
||||
"selectionZoom": "区域缩放",
|
||||
"zoomIn": "缩小",
|
||||
"zoomOut": "放大",
|
||||
"pan": "移动",
|
||||
"reset": "重置缩放"
|
||||
}
|
||||
}
|
||||
}
|
||||
28
seller/src/locale/index.js
Normal file
@@ -0,0 +1,28 @@
|
||||
import Vue from 'vue';
|
||||
import VueI18n from 'vue-i18n';
|
||||
import zhLocale from './lang/zh-CN';
|
||||
import enLocale from './lang/en-US';
|
||||
import zhCnLocale from 'view-design/src/locale/lang/zh-CN';
|
||||
import enUsLocale from 'view-design/src/locale/lang/en-US';
|
||||
|
||||
Vue.use(VueI18n);
|
||||
|
||||
// 根据浏览器信息自动设置语言
|
||||
const navLang = navigator.language;
|
||||
const localLang = (navLang == 'zh-CN' || navLang == 'en-US') ? navLang : false;
|
||||
const lang = window.localStorage.lang || localLang || 'zh-CN';
|
||||
|
||||
Vue.config.lang = lang;
|
||||
|
||||
// 多语言配置 vue-i18n 6.x+
|
||||
Vue.locale = () => { };
|
||||
const messages = {
|
||||
'zh-CN': Object.assign(zhCnLocale, zhLocale),
|
||||
'en-US': Object.assign(enUsLocale, enLocale)
|
||||
};
|
||||
const i18n = new VueI18n({
|
||||
locale: lang,
|
||||
messages
|
||||
});
|
||||
|
||||
export default i18n;
|
||||
24
seller/src/locale/lang/en-US.js
Normal file
@@ -0,0 +1,24 @@
|
||||
export default {
|
||||
lili: 'lili',
|
||||
usernameLogin: 'UsernameLogin',
|
||||
mobileLogin: 'MobileLogin',
|
||||
autoLogin: 'Auto Login',
|
||||
forgetPass: 'Forget Password',
|
||||
otherLogin: 'Sign in with',
|
||||
regist: 'Register',
|
||||
login: 'Login',
|
||||
logining: 'Logining...',
|
||||
home: 'home',
|
||||
switchLangTitle: 'Switch Lang',
|
||||
international: 'Switch Lang',
|
||||
userCenter: 'Account Center',
|
||||
changePass: 'Account Pass',
|
||||
logout: 'Logout',
|
||||
tagOption: 'Label Options',
|
||||
closeAll: 'Close All',
|
||||
closeOthers: 'Close Others',
|
||||
help: 'Help',
|
||||
privacy: 'Privacy',
|
||||
terms: 'Terms',
|
||||
rights: 'All Rights Reserved'
|
||||
};
|
||||
24
seller/src/locale/lang/zh-CN.js
Normal file
@@ -0,0 +1,24 @@
|
||||
export default {
|
||||
lili: 'lili',
|
||||
usernameLogin: '账户密码登录',
|
||||
mobileLogin: '手机号登录',
|
||||
autoLogin: '自动登录',
|
||||
forgetPass: '忘记密码',
|
||||
otherLogin: '其他方式登录',
|
||||
regist: '注册账户',
|
||||
login: '登录',
|
||||
logining: '登录中...',
|
||||
home: '首页',
|
||||
switchLangTitle: '切换语言',
|
||||
international: '多语言切换',
|
||||
userCenter: '个人中心',
|
||||
changePass: '修改密码',
|
||||
logout: '退出登录',
|
||||
tagOption: '标签选项',
|
||||
closeAll: '关闭全部',
|
||||
closeOthers: '关闭其他',
|
||||
help: '帮助',
|
||||
privacy: '隐私',
|
||||
terms: '条款',
|
||||
rights: '版权所有'
|
||||
};
|
||||
87
seller/src/main.js
Normal file
@@ -0,0 +1,87 @@
|
||||
// The Vue build version to load with the `import` command
|
||||
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
|
||||
import Vue from "vue";
|
||||
import ViewUI from "view-design";
|
||||
import "./styles/theme.less";
|
||||
|
||||
import "core-js/stable";
|
||||
import "regenerator-runtime/runtime";
|
||||
|
||||
import App from "./App";
|
||||
import { router } from "./router/index";
|
||||
import store from "./store";
|
||||
import i18n from "@/locale";
|
||||
|
||||
import {
|
||||
getRequest,
|
||||
postRequest,
|
||||
putRequest,
|
||||
deleteRequest,
|
||||
importRequest,
|
||||
uploadFileRequest
|
||||
} from "@/libs/axios";
|
||||
import { setStore, getStore, removeStore } from "@/libs/storage";
|
||||
|
||||
import util from "@/libs/util";
|
||||
import dictUtil from "@/libs/dictUtil";
|
||||
|
||||
import VueLazyload from "vue-lazyload";
|
||||
import VueClipboard from "vue-clipboard2";
|
||||
|
||||
import * as filters from "@/utils/filters"; // global filter
|
||||
|
||||
import { md5 } from "@/utils/md5.js";
|
||||
Vue.config.devtools = true;
|
||||
Vue.config.productionTip = false;
|
||||
Vue.use(VueLazyload, {
|
||||
error: require("./assets/img-error.png"),
|
||||
loading: require("./assets/loading2.gif")
|
||||
});
|
||||
Vue.use(ViewUI, {
|
||||
i18n: (key, value) => i18n.t(key, value)
|
||||
});
|
||||
|
||||
Vue.use(VueClipboard);
|
||||
|
||||
// 挂载全局使用的方法
|
||||
Vue.prototype.getRequest = getRequest;
|
||||
Vue.prototype.postRequest = postRequest;
|
||||
Vue.prototype.putRequest = putRequest;
|
||||
Vue.prototype.deleteRequest = deleteRequest;
|
||||
Vue.prototype.importRequest = importRequest;
|
||||
Vue.prototype.uploadFileRequest = uploadFileRequest;
|
||||
Vue.prototype.setStore = setStore;
|
||||
Vue.prototype.getStore = getStore;
|
||||
Vue.prototype.removeStore = removeStore;
|
||||
Vue.prototype.md5 = md5;
|
||||
|
||||
Array.prototype.remove = function(from, to) {
|
||||
var rest = this.slice((to || from) + 1 || this.length);
|
||||
this.length = from < 0 ? this.length + from : from;
|
||||
return this.push.apply(this, rest);
|
||||
};
|
||||
|
||||
Object.keys(filters).forEach(key => {
|
||||
Vue.filter(key, filters[key]);
|
||||
});
|
||||
/* eslint-disable no-new */
|
||||
new Vue({
|
||||
el: "#app",
|
||||
router,
|
||||
store,
|
||||
i18n,
|
||||
render: h => h(App),
|
||||
data: {
|
||||
currentPageName: ""
|
||||
},
|
||||
mounted() {
|
||||
// 初始化菜单
|
||||
util.initRouter(this);
|
||||
// 初始化全局数据字典
|
||||
dictUtil.initDictData(this);
|
||||
this.currentPageName = this.$route.name;
|
||||
// 显示打开的页面的列表
|
||||
this.$store.commit("setOpenedList");
|
||||
this.$store.commit("initCachepage");
|
||||
}
|
||||
});
|
||||
46
seller/src/router/index.js
Normal file
@@ -0,0 +1,46 @@
|
||||
import Vue from 'vue';
|
||||
import ViewUI from 'view-design';
|
||||
import Util from '../libs/util';
|
||||
import VueRouter from 'vue-router';
|
||||
import Cookies from 'js-cookie';
|
||||
import {routers} from './router';
|
||||
|
||||
Vue.use(VueRouter);
|
||||
|
||||
// 路由配置
|
||||
const RouterConfig = {
|
||||
mode: 'history',
|
||||
routes: routers
|
||||
};
|
||||
|
||||
export const router = new VueRouter(RouterConfig);
|
||||
|
||||
router.beforeEach((to, from, next) => {
|
||||
ViewUI.LoadingBar.start();
|
||||
Util.title(to.meta.title);
|
||||
|
||||
next();
|
||||
|
||||
const name = to.name;
|
||||
|
||||
if (!Cookies.get('userInfo') && name !== 'login') {
|
||||
// 判断是否已经登录且前往的页面不是登录页
|
||||
next({
|
||||
name: 'login'
|
||||
});
|
||||
} else if (Cookies.get('userInfo') && name === 'login') {
|
||||
// 判断是否已经登录且前往的是登录页
|
||||
Util.title();
|
||||
next({
|
||||
name: 'home_index'
|
||||
});
|
||||
} else {
|
||||
Util.toDefaultPage([...routers], name, router, next);
|
||||
}
|
||||
});
|
||||
|
||||
router.afterEach((to) => {
|
||||
Util.openNewPage(router.app, to.name, to.params, to.query);
|
||||
ViewUI.LoadingBar.finish();
|
||||
window.scrollTo(0, 0);
|
||||
});
|
||||
165
seller/src/router/router.js
Normal file
@@ -0,0 +1,165 @@
|
||||
import Main from "@/views/Main.vue";
|
||||
|
||||
// 不作为Main组件的子页面展示的页面单独写,如下
|
||||
export const loginRouter = {
|
||||
path: "/login",
|
||||
name: "login",
|
||||
meta: {
|
||||
title: "登录 - lili "
|
||||
},
|
||||
component: () => import("@/views/login.vue")
|
||||
};
|
||||
|
||||
// 作为Main组件的子页面展示但是不在左侧菜单显示的路由写在otherRouter里
|
||||
export const otherRouter = {
|
||||
path: "/",
|
||||
name: "otherRouter",
|
||||
redirect: "/home",
|
||||
component: Main,
|
||||
children: [
|
||||
{
|
||||
path: "home",
|
||||
title: { i18n: "home" },
|
||||
name: "home_index",
|
||||
component: () => import("@/views/home/home.vue")
|
||||
},
|
||||
{
|
||||
path: "change-password",
|
||||
title: "修改密码",
|
||||
name: "change_pass",
|
||||
component: () => import("@/views/change-password/change-password.vue")
|
||||
},
|
||||
{
|
||||
path: "message",
|
||||
title: "消息中心",
|
||||
name: "message_index",
|
||||
component: () => import("@/views/message/message.vue")
|
||||
},
|
||||
{
|
||||
path: "stock-goods",
|
||||
title: "店铺端商品库存告警列表",
|
||||
name: "stock-goods",
|
||||
component: () => import("@/views/goods/goods-seller/goodsStock.vue")
|
||||
},
|
||||
{
|
||||
path: "goods-operation",
|
||||
title: "添加商品",
|
||||
name: "goods-operation",
|
||||
component: () => import("@/views/goods/goods-seller/goodsOperation.vue")
|
||||
},
|
||||
{
|
||||
path: "goods-operation-edit",
|
||||
title: "编辑商品",
|
||||
name: "goods-operation-edit",
|
||||
component: () => import("@/views/goods/goods-seller/goodsOperation.vue")
|
||||
},
|
||||
{
|
||||
path: "goods-template-operation-edit",
|
||||
title: "编辑模版",
|
||||
name: "goods-template-operation-edit",
|
||||
component: () => import("@/views/goods/goods-seller/goodsOperation.vue")
|
||||
},
|
||||
{
|
||||
path: "goods-draft-operation-edit",
|
||||
title: "编辑草稿",
|
||||
name: "goods-draft-operation-edit",
|
||||
component: () => import("@/views/goods/goods-seller/goodsOperation.vue")
|
||||
},
|
||||
{
|
||||
path: "add-coupon",
|
||||
title: "店铺优惠券",
|
||||
name: "add-coupon",
|
||||
component: () => import("@/views/promotion/coupon/couponPublish.vue")
|
||||
},
|
||||
{
|
||||
path: "bill-detail",
|
||||
title: "结算单详情",
|
||||
name: "bill-detail",
|
||||
component: () => import("@/views/shop/bill/billDetail.vue")
|
||||
},
|
||||
{
|
||||
path: "seckill-goods",
|
||||
title: "限时抢购商品",
|
||||
name: "seckill-goods",
|
||||
component: () => import("@/views/promotion/seckill/seckillGoods.vue")
|
||||
},
|
||||
{
|
||||
path: "pintuan-goods",
|
||||
title: "拼团商品",
|
||||
name: "pintuan-goods",
|
||||
component: () => import("@/views/promotion/pintuan/pintuanGoods.vue")
|
||||
},
|
||||
{
|
||||
path: "new-pintuan",
|
||||
title: "新增拼团",
|
||||
name: "new-pintuan",
|
||||
component: () => import("@/views/promotion/pintuan/newPintuan.vue")
|
||||
},
|
||||
{
|
||||
path: "order-detail",
|
||||
title: "订单详情",
|
||||
name: "order-detail",
|
||||
component: () => import("@/views/order/order/orderDetail.vue")
|
||||
},
|
||||
{
|
||||
path: "order-complaint-detail",
|
||||
title: "投诉详情",
|
||||
name: "order-complaint-detail",
|
||||
component: () =>
|
||||
import("@/views/order/after-order/orderComplaintDetail.vue")
|
||||
},
|
||||
{
|
||||
path: "return-goods-order-detail",
|
||||
title: "售后详情",
|
||||
name: "return-goods-order-detail",
|
||||
component: () =>
|
||||
import("@/views/order/after-order/reurnGoodsOrderDetail.vue")
|
||||
},
|
||||
{
|
||||
path: "full-cut",
|
||||
title: "满优惠",
|
||||
name: "full-cut",
|
||||
component: () => import("@/views/promotion/fullCut/full-cut.vue")
|
||||
},
|
||||
{
|
||||
path: "full-cut-detail",
|
||||
title: "添加满优惠",
|
||||
name: "full-cut-detail",
|
||||
component: () => import("@/views/promotion/fullCut/newFullCut.vue")
|
||||
},
|
||||
{
|
||||
path: "order-detail",
|
||||
title: "订单详情",
|
||||
name: "order-detail",
|
||||
component: () => import("@/views/order/order/orderDetail.vue")
|
||||
},
|
||||
// {
|
||||
// path: "/*",
|
||||
// name: "error-404",
|
||||
// meta: {
|
||||
// title: "404-页面不存在"
|
||||
// },
|
||||
// component: () => import("@/views/error-page/404.vue")
|
||||
// }
|
||||
]
|
||||
};
|
||||
|
||||
export const page403 = {
|
||||
path: "/403",
|
||||
meta: {
|
||||
title: "403-权限不足"
|
||||
},
|
||||
name: "error-403",
|
||||
component: () => import("@/views/error-page/403.vue")
|
||||
};
|
||||
|
||||
export const page500 = {
|
||||
path: "/500",
|
||||
meta: {
|
||||
title: "500-服务端错误"
|
||||
},
|
||||
name: "error-500",
|
||||
component: () => import("@/views/error-page/500.vue")
|
||||
};
|
||||
// 所有上面定义的路由都要写在下面的routers里
|
||||
export const routers = [loginRouter, otherRouter, page500, page403];
|
||||
28
seller/src/store/index.js
Normal file
@@ -0,0 +1,28 @@
|
||||
import Vue from 'vue';
|
||||
import Vuex from 'vuex';
|
||||
|
||||
import app from './modules/app';
|
||||
import user from './modules/user';
|
||||
import dict from './modules/dict';
|
||||
|
||||
Vue.use(Vuex);
|
||||
|
||||
const store = new Vuex.Store({
|
||||
state: {
|
||||
// 状态
|
||||
|
||||
},
|
||||
mutations: {
|
||||
// 改变方法
|
||||
},
|
||||
actions: {
|
||||
|
||||
},
|
||||
modules: {
|
||||
app,
|
||||
user,
|
||||
dict
|
||||
}
|
||||
});
|
||||
|
||||
export default store;
|
||||
177
seller/src/store/modules/app.js
Normal file
@@ -0,0 +1,177 @@
|
||||
import { otherRouter } from '@/router/router';
|
||||
import { router } from '@/router/index';
|
||||
import Util from '@/libs/util';
|
||||
import Cookies from 'js-cookie';
|
||||
import Vue from 'vue';
|
||||
|
||||
const app = {
|
||||
state: {
|
||||
styleStore:"", //移动端楼层装修中选择风格存储
|
||||
loading: false, // 全局加载动画
|
||||
added: false, // 加载路由标识
|
||||
navList: [], // 顶部菜单
|
||||
currNav: "", // 当前顶部菜单name
|
||||
currNavTitle: "", // 当前顶部菜单标题
|
||||
cachePage: [],
|
||||
lang: '',
|
||||
isFullScreen: false,
|
||||
openedSubmenuArr: [], // 要展开的菜单数组
|
||||
menuTheme: 'dark', // 主题
|
||||
themeColor: '',
|
||||
storeOpenedList: [{
|
||||
title: '首页',
|
||||
path: '',
|
||||
name: 'home_index'
|
||||
}],
|
||||
currentPageName: '',
|
||||
currentPath: [
|
||||
{
|
||||
title: '首页',
|
||||
path: '',
|
||||
name: 'home_index'
|
||||
}
|
||||
],
|
||||
// 面包屑数组 左侧菜单
|
||||
menuList: [],
|
||||
routers: [
|
||||
otherRouter
|
||||
],
|
||||
tagsList: [...otherRouter.children],
|
||||
messageCount: 0,
|
||||
// 在这里定义你不想要缓存的页面的name属性值(参见路由配置router.js)
|
||||
dontCache: ['test', 'test']
|
||||
},
|
||||
mutations: {
|
||||
// 动态添加主界面路由,需要缓存
|
||||
updateAppRouter(state, routes) {
|
||||
state.routers.push(...routes);
|
||||
router.addRoutes(routes);
|
||||
},
|
||||
// 动态添加全局路由404、500等页面,不需要缓存
|
||||
updateDefaultRouter(state, routes) {
|
||||
router.addRoutes(routes);
|
||||
},
|
||||
setLoading(state, v) {
|
||||
state.loading = v;
|
||||
},
|
||||
setAdded(state, v) {
|
||||
state.added = v;
|
||||
},
|
||||
setNavList(state, list) {
|
||||
state.navList = list;
|
||||
},
|
||||
setCurrNav(state, v) {
|
||||
state.currNav = v;
|
||||
},
|
||||
setCurrNavTitle(state, v) {
|
||||
state.currNavTitle = v;
|
||||
},
|
||||
setTagsList(state, list) {
|
||||
state.tagsList.push(...list);
|
||||
},
|
||||
updateMenulist(state, routes) {
|
||||
state.menuList = routes;
|
||||
},
|
||||
addOpenSubmenu(state, name) {
|
||||
let hasThisName = false;
|
||||
let isEmpty = false;
|
||||
if (name.length == 0) {
|
||||
isEmpty = true;
|
||||
}
|
||||
if (state.openedSubmenuArr.indexOf(name) > -1) {
|
||||
hasThisName = true;
|
||||
}
|
||||
if (!hasThisName && !isEmpty) {
|
||||
state.openedSubmenuArr.push(name);
|
||||
}
|
||||
},
|
||||
closePage(state, name) {
|
||||
state.cachePage.forEach((item, index) => {
|
||||
if (item == name) {
|
||||
state.cachePage.splice(index, 1);
|
||||
}
|
||||
});
|
||||
},
|
||||
initCachepage(state) {
|
||||
if (localStorage.cachePage) {
|
||||
state.cachePage = JSON.parse(localStorage.cachePage);
|
||||
}
|
||||
},
|
||||
removeTag(state, name) {
|
||||
state.storeOpenedList.map((item, index) => {
|
||||
if (item.name == name) {
|
||||
state.storeOpenedList.splice(index, 1);
|
||||
}
|
||||
});
|
||||
},
|
||||
storeOpenedList(state, get) {
|
||||
let openedPage = state.storeOpenedList[get.index];
|
||||
if (get.argu) {
|
||||
openedPage.argu = get.argu;
|
||||
}
|
||||
if (get.query) {
|
||||
openedPage.query = get.query;
|
||||
}
|
||||
state.storeOpenedList.splice(get.index, 1, openedPage);
|
||||
localStorage.storeOpenedList = JSON.stringify(state.storeOpenedList);
|
||||
},
|
||||
clearAllTags(state) {
|
||||
state.storeOpenedList.splice(1);
|
||||
state.cachePage.length = 0;
|
||||
localStorage.storeOpenedList = JSON.stringify(state.storeOpenedList);
|
||||
},
|
||||
clearOtherTags(state, vm) {
|
||||
let currentName = vm.$route.name;
|
||||
let currentIndex = 0;
|
||||
state.storeOpenedList.forEach((item, index) => {
|
||||
if (item.name == currentName) {
|
||||
currentIndex = index;
|
||||
}
|
||||
});
|
||||
if (currentIndex == 0) {
|
||||
state.storeOpenedList.splice(1);
|
||||
} else {
|
||||
state.storeOpenedList.splice(currentIndex + 1);
|
||||
state.storeOpenedList.splice(1, currentIndex - 1);
|
||||
}
|
||||
let newCachepage = state.cachePage.filter(item => {
|
||||
return item == currentName;
|
||||
});
|
||||
state.cachePage = newCachepage;
|
||||
localStorage.storeOpenedList = JSON.stringify(state.storeOpenedList);
|
||||
},
|
||||
setOpenedList(state) {
|
||||
state.storeOpenedList = localStorage.storeOpenedList ? JSON.parse(localStorage.storeOpenedList) : [otherRouter.children[0]];
|
||||
},
|
||||
setCurrentPath(state, pathArr) {
|
||||
state.currentPath = pathArr;
|
||||
},
|
||||
setCurrentPageName(state, name) {
|
||||
state.currentPageName = name;
|
||||
},
|
||||
setAvatarPath(state, path) {
|
||||
localStorage.avatorImgPath = path;
|
||||
},
|
||||
switchLang(state, lang) {
|
||||
state.lang = lang;
|
||||
localStorage.lang = lang;
|
||||
Vue.config.lang = lang;
|
||||
},
|
||||
clearOpenedSubmenu(state) {
|
||||
state.openedSubmenuArr.length = 0;
|
||||
},
|
||||
setMessageCount(state, count) {
|
||||
state.messageCount = count;
|
||||
},
|
||||
increateTag(state, tagObj) {
|
||||
if (!Util.oneOf(tagObj.name, state.dontCache)) {
|
||||
state.cachePage.push(tagObj.name);
|
||||
localStorage.cachePage = JSON.stringify(state.cachePage);
|
||||
}
|
||||
state.storeOpenedList.push(tagObj);
|
||||
localStorage.storeOpenedList = JSON.stringify(state.storeOpenedList);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export default app;
|
||||
26
seller/src/store/modules/dict.js
Normal file
@@ -0,0 +1,26 @@
|
||||
const dict = {
|
||||
state: {
|
||||
// 经常需要读取的数据字典
|
||||
sex: [],
|
||||
messageType: [],
|
||||
priority: [],
|
||||
leaveType: []
|
||||
},
|
||||
mutations: {
|
||||
// 设置值的改变方法
|
||||
setSex(state, list) {
|
||||
state.sex = list;
|
||||
},
|
||||
setMessageType(state, list) {
|
||||
state.messageType = list;
|
||||
},
|
||||
setPriority(state, list) {
|
||||
state.priority = list;
|
||||
},
|
||||
setLeaveType(state, list) {
|
||||
state.leaveType = list;
|
||||
},
|
||||
}
|
||||
};
|
||||
|
||||
export default dict;
|
||||
14
seller/src/store/modules/user.js
Normal file
@@ -0,0 +1,14 @@
|
||||
import Cookies from 'js-cookie';
|
||||
|
||||
const user = {
|
||||
state: {},
|
||||
mutations: {
|
||||
logout () {
|
||||
Cookies.remove('userInfo');
|
||||
// 清空打开的页面等数据
|
||||
localStorage.clear();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export default user;
|
||||
195
seller/src/styles/common.scss
Normal file
@@ -0,0 +1,195 @@
|
||||
$theme_color: #804ed1;
|
||||
|
||||
|
||||
//自动移滚动条样式
|
||||
::-webkit-scrollbar{
|
||||
width: 1px;
|
||||
height: 5px;
|
||||
}
|
||||
::-webkit-scrollbar-thumb{
|
||||
border-radius: 1em;
|
||||
background-color: rgba(50,50,50,.3);
|
||||
}
|
||||
::-webkit-scrollbar-track{
|
||||
border-radius: 1em;
|
||||
background-color: rgba(50,50,50,.1);
|
||||
}
|
||||
|
||||
|
||||
.flex{
|
||||
display: flex !important;
|
||||
|
||||
}
|
||||
.flex_justify_content{
|
||||
justify-content: center;
|
||||
}
|
||||
.flex_align_item{
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.global_text_left {
|
||||
text-align: left;
|
||||
}
|
||||
.global_text_right {
|
||||
text-align: right;
|
||||
}
|
||||
.global_float_left {
|
||||
float: left;
|
||||
}
|
||||
.global_float_right {
|
||||
float: right;
|
||||
}
|
||||
.clearfix::after{
|
||||
content: '';
|
||||
display: block;
|
||||
clear: both;
|
||||
}
|
||||
.width_1200{width: 1200px;}
|
||||
.width_800{width: 800px;}
|
||||
.width_400{width: 400px;}
|
||||
.width_300{width: 300px;}
|
||||
.width_200{width: 200px;}
|
||||
.width_100{width: 100px;}
|
||||
|
||||
.fz_12{font-size: 12px;}
|
||||
.fz_14{font-size: 14px;}
|
||||
.fz_16{font-size: 16px;}
|
||||
.fz_18{font-size: 18px;}
|
||||
.fw_bold{font-weight: bold;}
|
||||
|
||||
.mb_20{margin-bottom: 20px;}
|
||||
.mt_20{margin-top: 20px;}
|
||||
.ml_20{margin-left: 20px;}
|
||||
.mr_20{margin-right: 20px;}
|
||||
|
||||
.mb_10{margin-bottom: 10px;}
|
||||
.mt_10{margin-top: 10px;}
|
||||
.ml_10{margin-left: 10px;}
|
||||
.mr_10{margin-right: 10px;}
|
||||
|
||||
.pb_20{padding-bottom: 20px;}
|
||||
.pt_20{padding-top: 20px;}
|
||||
.pl_20{padding-left: 20px;}
|
||||
.pr_20{padding-right: 20px;}
|
||||
|
||||
.pb_10{padding-bottom: 10px;}
|
||||
.pt_10{padding-top: 10px;}
|
||||
.pl_10{padding-left: 10px;}
|
||||
.pr_10{padding-right: 10px;}
|
||||
|
||||
ul,li{
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
.ellipsis{
|
||||
overflow: hidden;
|
||||
text-overflow:ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
/*
|
||||
* @Author: LMR
|
||||
* @Date: 2020-08-14 11:04:12
|
||||
* @Last Modified by: LMR
|
||||
* @Last Modified time: 2020-08-18 14:21:41
|
||||
*/
|
||||
|
||||
// 主题颜色
|
||||
|
||||
// 明亮主题颜色
|
||||
$primary_color: #2d8cf0;
|
||||
$primary_light_color: #0f1011;
|
||||
$primary_dark_color: #2b85e4;
|
||||
$success_color: #19be6b;
|
||||
$warning_color: #ff9900;
|
||||
$error_color: #ed3f14;
|
||||
$handle-btn-color: #438cde;
|
||||
|
||||
$theme_color: #ed3f14;
|
||||
|
||||
$border_color: #dddee1;
|
||||
$title_color: #8c8c8c;
|
||||
$light_title_color: #1c2438;
|
||||
$light_content_color: #495060;
|
||||
$light_sub_color: #80848f;
|
||||
$light_background_color: #f8f8f9;
|
||||
$light_white_background_color: #fff;
|
||||
// 暗黑主题颜色
|
||||
$dark_background_color: #141414;
|
||||
$dark_sub_background_color: #1d1d1d; //稍微浅一点的
|
||||
$dark_content_color: #d5d5d5;
|
||||
|
||||
/***** 封装一些方法可用于 黑暗主题 ,明亮主题 *****/
|
||||
|
||||
// 背景颜色
|
||||
@mixin background_color($color) {
|
||||
/*通过该函数设置字体颜色,后期方便统一管理;*/
|
||||
background-color: $color;
|
||||
transition: 0.35s;
|
||||
[data-theme="dark"] & {
|
||||
background-color: $dark_background_color;
|
||||
}
|
||||
[data-theme="light"] & {
|
||||
background-color: $light_background_color;
|
||||
}
|
||||
}
|
||||
// 辅助背景颜色
|
||||
@mixin sub_background_color($color) {
|
||||
/*通过该函数设置字体颜色,后期方便统一管理;*/
|
||||
background-color: $color;
|
||||
transition: 0.35s;
|
||||
[data-theme="dark"] & {
|
||||
background-color: $dark_sub_background_color;
|
||||
}
|
||||
[data-theme="light"] & {
|
||||
background-color: $light_background_color;
|
||||
}
|
||||
}
|
||||
|
||||
@mixin white_background_color() {
|
||||
/*通过该函数设置字体颜色,后期方便统一管理;*/
|
||||
background-color: $light_white_background_color;
|
||||
transition: 0.35s;
|
||||
[data-theme="dark"] & {
|
||||
background-color: $dark_sub_background_color;
|
||||
}
|
||||
[data-theme="light"] & {
|
||||
background-color: $light_white_background_color;
|
||||
}
|
||||
}
|
||||
|
||||
// 正文颜色
|
||||
@mixin content_color($color) {
|
||||
/*通过该函数设置字体颜色,后期方便统一管理;*/
|
||||
color: $color;
|
||||
[data-theme="dark"] & {
|
||||
color: $dark_content_color;
|
||||
}
|
||||
[data-theme="light"] & {
|
||||
color: $light_content_color;
|
||||
}
|
||||
}
|
||||
|
||||
// 辅助颜色
|
||||
@mixin sub_color($color) {
|
||||
/*通过该函数设置字体颜色,后期方便统一管理;*/
|
||||
color: $color;
|
||||
[data-theme="dark"] & {
|
||||
color: $dark_content_color;
|
||||
}
|
||||
[data-theme="light"] & {
|
||||
color: $light_sub_color;
|
||||
}
|
||||
}
|
||||
|
||||
// 标题颜色
|
||||
@mixin title_color($color) {
|
||||
/*通过该函数设置字体颜色,后期方便统一管理;*/
|
||||
color: $color;
|
||||
[data-theme="dark"] & {
|
||||
color: $dark_content_color;
|
||||
}
|
||||
[data-theme="light"] & {
|
||||
color: $light_title_color;
|
||||
}
|
||||
}
|
||||
83
seller/src/styles/table-common.scss
Normal file
@@ -0,0 +1,83 @@
|
||||
.search {
|
||||
.operation {
|
||||
margin-bottom: 2vh;
|
||||
}
|
||||
|
||||
.select-count {
|
||||
font-weight: 600;
|
||||
color: #40a9ff;
|
||||
}
|
||||
|
||||
.select-clear {
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
.page {
|
||||
margin-top: 2vh;
|
||||
}
|
||||
|
||||
.drop-down {
|
||||
margin-left: 5px;
|
||||
}
|
||||
}
|
||||
|
||||
.tree-list {
|
||||
position: relative;
|
||||
min-height: 80px;
|
||||
}
|
||||
|
||||
.drawer-footer {
|
||||
z-index: 10;
|
||||
width: 100%;
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
border-top: 1px solid #e8e8e8;
|
||||
padding: 10px 16px;
|
||||
text-align: right;
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
.block-tool .ivu-tooltip,
|
||||
.block-tool .ivu-tooltip-rel {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.block-pop .ivu-poptip,
|
||||
.block-pop .ivu-poptip-rel {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.search-input{
|
||||
width: 270px;
|
||||
margin-right: 20px;
|
||||
}
|
||||
.ivu-form-item{
|
||||
margin:8px 10px !important;
|
||||
}
|
||||
.search-form {
|
||||
width: 100% !important;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
background-color: #F0F0F0;
|
||||
padding: 10px;
|
||||
margin: 0;
|
||||
flex-wrap: wrap;
|
||||
/deep/ .ivu-form-item{
|
||||
|
||||
}
|
||||
}
|
||||
.padding-row{
|
||||
margin-top: 15px;
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
.search-btn{
|
||||
margin-left: 20px;
|
||||
}
|
||||
|
||||
.div-zoom{
|
||||
display: -webkit-box;
|
||||
-webkit-box-orient: vertical;
|
||||
-webkit-line-clamp: 4;
|
||||
overflow: hidden;
|
||||
}
|
||||
9
seller/src/styles/theme.less
Normal file
@@ -0,0 +1,9 @@
|
||||
@import "~view-design/src/styles/index.less";
|
||||
// iview 自定义样式
|
||||
|
||||
@primary-color: #ed3f14;
|
||||
@table-thead-bg: #f8f8f9;
|
||||
@table-td-stripe-bg: #f8f8f9;
|
||||
@table-td-hover-bg: #ededed;
|
||||
@table-td-highlight-bg: #ededed;
|
||||
@font-size-base: 12px;
|
||||
42
seller/src/styles/tree-common.scss
Normal file
@@ -0,0 +1,42 @@
|
||||
.search {
|
||||
.operation {
|
||||
margin-bottom: 2vh;
|
||||
}
|
||||
|
||||
.select-title {
|
||||
font-weight: 600;
|
||||
color: #40a9ff;
|
||||
}
|
||||
|
||||
.select-clear {
|
||||
margin-left: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
.tree-bar {
|
||||
overflow: auto;
|
||||
margin-top: 5px;
|
||||
position: relative;
|
||||
min-height: 80px;
|
||||
}
|
||||
|
||||
.tree-bar::-webkit-scrollbar {
|
||||
width: 6px;
|
||||
height: 6px;
|
||||
}
|
||||
|
||||
.tree-bar::-webkit-scrollbar-thumb {
|
||||
border-radius: 4px;
|
||||
-webkit-box-shadow: inset 0 0 2px #d1d1d1;
|
||||
background: #e4e4e4;
|
||||
}
|
||||
|
||||
.block-tool .ivu-tooltip,
|
||||
.block-tool .ivu-tooltip-rel {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.block-pop .ivu-poptip,
|
||||
.block-pop .ivu-poptip-rel {
|
||||
display: block;
|
||||
}
|
||||
118
seller/src/utils/filters.js
Normal file
@@ -0,0 +1,118 @@
|
||||
/**
|
||||
* 金钱单位置换 2999 --> 2,999.00
|
||||
* @param val
|
||||
* @param unit
|
||||
* @param location
|
||||
* @returns {*}
|
||||
*/
|
||||
export function unitPrice(val, unit, location) {
|
||||
let price = formatPrice(val)
|
||||
if (location === 'before') {
|
||||
return price.substr(0, price.length - 3)
|
||||
}
|
||||
if (location === 'after') {
|
||||
return price.substr(-2)
|
||||
}
|
||||
return (unit || '') + price
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 货币格式化
|
||||
* @param price
|
||||
* @returns {string}
|
||||
*/
|
||||
export function formatPrice(price) {
|
||||
if (typeof price !== 'number') return price
|
||||
return String(Number(price).toFixed(2)).replace(/\B(?=(\d{3})+(?!\d))/g, ',')
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理unix时间戳,转换为可阅读时间格式
|
||||
* @param unix
|
||||
* @param format
|
||||
* @returns {*|string}
|
||||
*/
|
||||
export function unixToDate(unix, format) {
|
||||
let _format = format || 'yyyy-MM-dd hh:mm:ss'
|
||||
const d = new Date(unix * 1000)
|
||||
const o = {
|
||||
'M+': d.getMonth() + 1,
|
||||
'd+': d.getDate(),
|
||||
'h+': d.getHours(),
|
||||
'm+': d.getMinutes(),
|
||||
's+': d.getSeconds(),
|
||||
'q+': Math.floor((d.getMonth() + 3) / 3),
|
||||
S: d.getMilliseconds()
|
||||
}
|
||||
if (/(y+)/.test(_format)) _format = _format.replace(RegExp.$1, (d.getFullYear() + '').substr(4 - RegExp.$1.length))
|
||||
for (const k in o) if (new RegExp('(' + k + ')').test(_format)) _format = _format.replace(RegExp.$1, (RegExp.$1.length === 1) ? (o[k]) : (('00' + o[k]).substr(('' + o[k]).length)))
|
||||
return _format
|
||||
}
|
||||
//是否格式化
|
||||
export function unixWhether(status) {
|
||||
switch (status) {
|
||||
case 'YES':
|
||||
return "是"
|
||||
case 'NO':
|
||||
return "否"
|
||||
}
|
||||
}
|
||||
|
||||
export function unixSellerBillStatus(status_code) {
|
||||
switch (status_code) {
|
||||
case 'OUT':
|
||||
return '已出账'
|
||||
case 'CHECK':
|
||||
return '已对账'
|
||||
case 'EXAMINE':
|
||||
return '已审核'
|
||||
case 'PAY':
|
||||
return '已结算'
|
||||
case 'COMPLETE':
|
||||
return '已完成'
|
||||
}
|
||||
}
|
||||
export function unixSwitchStatus(status_code) {
|
||||
switch (status_code) {
|
||||
case 'OPEN':
|
||||
return '开启'
|
||||
case 'CLOSE':
|
||||
return '关闭'
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 13888888888 -> 138****8888
|
||||
* @param mobile
|
||||
* @returns {*}
|
||||
*/
|
||||
export function secrecyMobile(mobile) {
|
||||
mobile = String(mobile)
|
||||
if (!/\d{11}/.test(mobile)) {
|
||||
return mobile
|
||||
}
|
||||
return mobile.replace(/(\d{3})(\d{4})(\d{4})/, '$1****$3')
|
||||
}
|
||||
|
||||
|
||||
export function formatDate(date, fmt) {
|
||||
if (/(y+)/.test(fmt)) {
|
||||
fmt = fmt.replace(RegExp.$1, (date.getFullYear() + '').substr(4 - RegExp.$1.length));
|
||||
}
|
||||
let o = {
|
||||
'M+': date.getMonth() + 1,
|
||||
'd+': date.getDate(),
|
||||
'h+': date.getHours(),
|
||||
'm+': date.getMinutes(),
|
||||
's+': date.getSeconds()
|
||||
};
|
||||
for (let k in o) {
|
||||
if (new RegExp(`(${k})`).test(fmt)) {
|
||||
let str = o[k] + '';
|
||||
fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1) ? str : padLeftZero(str));
|
||||
}
|
||||
}
|
||||
return fmt;
|
||||
};
|
||||
27
seller/src/utils/index.js
Normal file
@@ -0,0 +1,27 @@
|
||||
import * as regular from './regular'
|
||||
|
||||
export {
|
||||
regular
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 数组对象深拷贝
|
||||
* @param obj
|
||||
* @returns {*}
|
||||
*/
|
||||
export default function cloneObj(obj) {
|
||||
let str = null
|
||||
let newobj = obj.constructor === Array ? [] : {}
|
||||
if (typeof obj !== 'object') {
|
||||
return
|
||||
} else if (window && window.JSON) {
|
||||
str = JSON.stringify(obj) // 系列化对象
|
||||
newobj = JSON.parse(str) // 还原
|
||||
} else {
|
||||
for (var i in obj) {
|
||||
newobj[i] = typeof obj[i] === 'object' ? cloneObj(obj[i]) : obj[i]
|
||||
}
|
||||
}
|
||||
return newobj
|
||||
}
|
||||
223
seller/src/utils/md5.js
Normal file
@@ -0,0 +1,223 @@
|
||||
/*
|
||||
* A JavaScript implementation of the RSA Data Security, Inc. MD5 Message
|
||||
* Digest Algorithm, as defined in RFC 1321.
|
||||
* Version 1.1 Copyright (C) Paul Johnston 1999 - 2002.
|
||||
* Code also contributed by Greg Holt
|
||||
* See http://pajhome.org.uk/site/legal.html for details.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Add integers, wrapping at 2^32. This uses 16-bit operations internally
|
||||
* to work around bugs in some JS interpreters.
|
||||
*/
|
||||
function safe_add(x, y) {
|
||||
var lsw = (x & 0xFFFF) + (y & 0xFFFF)
|
||||
var msw = (x >> 16) + (y >> 16) + (lsw >> 16)
|
||||
return (msw << 16) | (lsw & 0xFFFF)
|
||||
}
|
||||
|
||||
/*
|
||||
* Bitwise rotate a 32-bit number to the left.
|
||||
*/
|
||||
function rol(num, cnt) {
|
||||
return (num << cnt) | (num >>> (32 - cnt))
|
||||
}
|
||||
|
||||
/*
|
||||
* These functions implement the four basic operations the algorithm uses.
|
||||
*/
|
||||
function cmn(q, a, b, x, s, t) {
|
||||
return safe_add(rol(safe_add(safe_add(a, q), safe_add(x, t)), s), b)
|
||||
}
|
||||
|
||||
function ff(a, b, c, d, x, s, t) {
|
||||
return cmn((b & c) | ((~b) & d), a, b, x, s, t)
|
||||
}
|
||||
|
||||
function gg(a, b, c, d, x, s, t) {
|
||||
return cmn((b & d) | (c & (~d)), a, b, x, s, t)
|
||||
}
|
||||
|
||||
function hh(a, b, c, d, x, s, t) {
|
||||
return cmn(b ^ c ^ d, a, b, x, s, t)
|
||||
}
|
||||
|
||||
function ii(a, b, c, d, x, s, t) {
|
||||
return cmn(c ^ (b | (~d)), a, b, x, s, t)
|
||||
}
|
||||
|
||||
/*
|
||||
* Calculate the MD5 of an array of little-endian words, producing an array
|
||||
* of little-endian words.
|
||||
*/
|
||||
function coreMD5(x) {
|
||||
var a = 1732584193
|
||||
var b = -271733879
|
||||
var c = -1732584194
|
||||
var d = 271733878
|
||||
|
||||
for (var i = 0; i < x.length; i += 16) {
|
||||
var olda = a
|
||||
var oldb = b
|
||||
var oldc = c
|
||||
var oldd = d
|
||||
|
||||
a = ff(a, b, c, d, x[i + 0], 7, -680876936)
|
||||
d = ff(d, a, b, c, x[i + 1], 12, -389564586)
|
||||
c = ff(c, d, a, b, x[i + 2], 17, 606105819)
|
||||
b = ff(b, c, d, a, x[i + 3], 22, -1044525330)
|
||||
a = ff(a, b, c, d, x[i + 4], 7, -176418897)
|
||||
d = ff(d, a, b, c, x[i + 5], 12, 1200080426)
|
||||
c = ff(c, d, a, b, x[i + 6], 17, -1473231341)
|
||||
b = ff(b, c, d, a, x[i + 7], 22, -45705983)
|
||||
a = ff(a, b, c, d, x[i + 8], 7, 1770035416)
|
||||
d = ff(d, a, b, c, x[i + 9], 12, -1958414417)
|
||||
c = ff(c, d, a, b, x[i + 10], 17, -42063)
|
||||
b = ff(b, c, d, a, x[i + 11], 22, -1990404162)
|
||||
a = ff(a, b, c, d, x[i + 12], 7, 1804603682)
|
||||
d = ff(d, a, b, c, x[i + 13], 12, -40341101)
|
||||
c = ff(c, d, a, b, x[i + 14], 17, -1502002290)
|
||||
b = ff(b, c, d, a, x[i + 15], 22, 1236535329)
|
||||
|
||||
a = gg(a, b, c, d, x[i + 1], 5, -165796510)
|
||||
d = gg(d, a, b, c, x[i + 6], 9, -1069501632)
|
||||
c = gg(c, d, a, b, x[i + 11], 14, 643717713)
|
||||
b = gg(b, c, d, a, x[i + 0], 20, -373897302)
|
||||
a = gg(a, b, c, d, x[i + 5], 5, -701558691)
|
||||
d = gg(d, a, b, c, x[i + 10], 9, 38016083)
|
||||
c = gg(c, d, a, b, x[i + 15], 14, -660478335)
|
||||
b = gg(b, c, d, a, x[i + 4], 20, -405537848)
|
||||
a = gg(a, b, c, d, x[i + 9], 5, 568446438)
|
||||
d = gg(d, a, b, c, x[i + 14], 9, -1019803690)
|
||||
c = gg(c, d, a, b, x[i + 3], 14, -187363961)
|
||||
b = gg(b, c, d, a, x[i + 8], 20, 1163531501)
|
||||
a = gg(a, b, c, d, x[i + 13], 5, -1444681467)
|
||||
d = gg(d, a, b, c, x[i + 2], 9, -51403784)
|
||||
c = gg(c, d, a, b, x[i + 7], 14, 1735328473)
|
||||
b = gg(b, c, d, a, x[i + 12], 20, -1926607734)
|
||||
|
||||
a = hh(a, b, c, d, x[i + 5], 4, -378558)
|
||||
d = hh(d, a, b, c, x[i + 8], 11, -2022574463)
|
||||
c = hh(c, d, a, b, x[i + 11], 16, 1839030562)
|
||||
b = hh(b, c, d, a, x[i + 14], 23, -35309556)
|
||||
a = hh(a, b, c, d, x[i + 1], 4, -1530992060)
|
||||
d = hh(d, a, b, c, x[i + 4], 11, 1272893353)
|
||||
c = hh(c, d, a, b, x[i + 7], 16, -155497632)
|
||||
b = hh(b, c, d, a, x[i + 10], 23, -1094730640)
|
||||
a = hh(a, b, c, d, x[i + 13], 4, 681279174)
|
||||
d = hh(d, a, b, c, x[i + 0], 11, -358537222)
|
||||
c = hh(c, d, a, b, x[i + 3], 16, -722521979)
|
||||
b = hh(b, c, d, a, x[i + 6], 23, 76029189)
|
||||
a = hh(a, b, c, d, x[i + 9], 4, -640364487)
|
||||
d = hh(d, a, b, c, x[i + 12], 11, -421815835)
|
||||
c = hh(c, d, a, b, x[i + 15], 16, 530742520)
|
||||
b = hh(b, c, d, a, x[i + 2], 23, -995338651)
|
||||
|
||||
a = ii(a, b, c, d, x[i + 0], 6, -198630844)
|
||||
d = ii(d, a, b, c, x[i + 7], 10, 1126891415)
|
||||
c = ii(c, d, a, b, x[i + 14], 15, -1416354905)
|
||||
b = ii(b, c, d, a, x[i + 5], 21, -57434055)
|
||||
a = ii(a, b, c, d, x[i + 12], 6, 1700485571)
|
||||
d = ii(d, a, b, c, x[i + 3], 10, -1894986606)
|
||||
c = ii(c, d, a, b, x[i + 10], 15, -1051523)
|
||||
b = ii(b, c, d, a, x[i + 1], 21, -2054922799)
|
||||
a = ii(a, b, c, d, x[i + 8], 6, 1873313359)
|
||||
d = ii(d, a, b, c, x[i + 15], 10, -30611744)
|
||||
c = ii(c, d, a, b, x[i + 6], 15, -1560198380)
|
||||
b = ii(b, c, d, a, x[i + 13], 21, 1309151649)
|
||||
a = ii(a, b, c, d, x[i + 4], 6, -145523070)
|
||||
d = ii(d, a, b, c, x[i + 11], 10, -1120210379)
|
||||
c = ii(c, d, a, b, x[i + 2], 15, 718787259)
|
||||
b = ii(b, c, d, a, x[i + 9], 21, -343485551)
|
||||
|
||||
a = safe_add(a, olda)
|
||||
b = safe_add(b, oldb)
|
||||
c = safe_add(c, oldc)
|
||||
d = safe_add(d, oldd)
|
||||
}
|
||||
return [a, b, c, d]
|
||||
}
|
||||
|
||||
/*
|
||||
* Convert an array of little-endian words to a hex string.
|
||||
*/
|
||||
function binl2hex(binarray) {
|
||||
var hex_tab = "0123456789abcdef"
|
||||
var str = ""
|
||||
for (var i = 0; i < binarray.length * 4; i++) {
|
||||
str += hex_tab.charAt((binarray[i >> 2] >> ((i % 4) * 8 + 4)) & 0xF) +
|
||||
hex_tab.charAt((binarray[i >> 2] >> ((i % 4) * 8)) & 0xF)
|
||||
}
|
||||
return str
|
||||
}
|
||||
|
||||
/*
|
||||
* Convert an array of little-endian words to a base64 encoded string.
|
||||
*/
|
||||
function binl2b64(binarray) {
|
||||
var tab = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"
|
||||
var str = ""
|
||||
for (var i = 0; i < binarray.length * 32; i += 6) {
|
||||
str += tab.charAt(((binarray[i >> 5] << (i % 32)) & 0x3F) |
|
||||
((binarray[i >> 5 + 1] >> (32 - i % 32)) & 0x3F))
|
||||
}
|
||||
return str
|
||||
}
|
||||
|
||||
/*
|
||||
* Convert an 8-bit character string to a sequence of 16-word blocks, stored
|
||||
* as an array, and append appropriate padding for MD4/5 calculation.
|
||||
* If any of the characters are >255, the high byte is silently ignored.
|
||||
*/
|
||||
function str2binl(str) {
|
||||
var nblk = ((str.length + 8) >> 6) + 1 // number of 16-word blocks
|
||||
var blks = new Array(nblk * 16)
|
||||
for (var i = 0; i < nblk * 16; i++) blks[i] = 0
|
||||
for (var i = 0; i < str.length; i++)
|
||||
blks[i >> 2] |= (str.charCodeAt(i) & 0xFF) << ((i % 4) * 8)
|
||||
blks[i >> 2] |= 0x80 << ((i % 4) * 8)
|
||||
blks[nblk * 16 - 2] = str.length * 8
|
||||
return blks
|
||||
}
|
||||
|
||||
/*
|
||||
* Convert a wide-character string to a sequence of 16-word blocks, stored as
|
||||
* an array, and append appropriate padding for MD4/5 calculation.
|
||||
*/
|
||||
function strw2binl(str) {
|
||||
var nblk = ((str.length + 4) >> 5) + 1 // number of 16-word blocks
|
||||
var blks = new Array(nblk * 16)
|
||||
for (var i = 0; i < nblk * 16; i++) blks[i] = 0
|
||||
for (var i = 0; i < str.length; i++)
|
||||
blks[i >> 1] |= str.charCodeAt(i) << ((i % 2) * 16)
|
||||
blks[i >> 1] |= 0x80 << ((i % 2) * 16)
|
||||
blks[nblk * 16 - 2] = str.length * 16
|
||||
return blks
|
||||
}
|
||||
|
||||
/*
|
||||
* External interface
|
||||
*/
|
||||
function hexMD5(str) {
|
||||
return binl2hex(coreMD5(str2binl(str)))
|
||||
}
|
||||
|
||||
function hexMD5w(str) {
|
||||
return binl2hex(coreMD5(strw2binl(str)))
|
||||
}
|
||||
|
||||
function b64MD5(str) {
|
||||
return binl2b64(coreMD5(str2binl(str)))
|
||||
}
|
||||
|
||||
function b64MD5w(str) {
|
||||
return binl2b64(coreMD5(strw2binl(str)))
|
||||
}
|
||||
/* Backward compatibility */
|
||||
function calcMD5(str) {
|
||||
return binl2hex(coreMD5(str2binl(str)))
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
md5: hexMD5
|
||||
}
|
||||
59
seller/src/utils/regular.js
Normal file
@@ -0,0 +1,59 @@
|
||||
/**
|
||||
* 各种正则表达式
|
||||
*
|
||||
* qq qq号
|
||||
* name 汉字
|
||||
* mobile 手机号
|
||||
* email 电子邮箱
|
||||
* password 密码【6-20位】
|
||||
* integer 正整数【不包含0】
|
||||
* money 金钱
|
||||
* IDCard 身份证
|
||||
* userName 账户名称【汉字、字母、数字、“-”、“_”的组合】
|
||||
* URL URL
|
||||
* TEL 固定电话
|
||||
*/
|
||||
|
||||
|
||||
//qq
|
||||
export const qq = /^[1-9][0-9]{4,14}$/
|
||||
//汉字
|
||||
export const name = /^[\u4e00-\u9fa5]{0,}$/
|
||||
|
||||
// 手机号
|
||||
export const mobile = /^0?(13[0-9]|14[0-9]|15[0-9]|16[0-9]|17[0-9]|18[0-9]|19[0-9])[0-9]{8}$/
|
||||
|
||||
// 电子邮箱
|
||||
export const email = /^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/
|
||||
|
||||
// 密码【6-20位】
|
||||
export const password = /^[@A-Za-z0-9!#$%^&*.~,]{6,20}$/
|
||||
|
||||
// 正整数【不包含0】
|
||||
export const integer = /^[1-9]\d*$/
|
||||
|
||||
// 正整数【包含0】
|
||||
export const Integer = /^[0-9]\d*$/
|
||||
|
||||
// 折扣
|
||||
export const discount = /^((0\.[1-9]{1})|(([1-9]{1})(\.\d{1})?))$/
|
||||
|
||||
// 0-100正整数
|
||||
export const rate = /^([0-9]{1,2}|100)$/
|
||||
|
||||
// 金钱
|
||||
export const money = /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/
|
||||
|
||||
|
||||
// 身份证
|
||||
export const IDCard = /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/
|
||||
|
||||
// 账户名称【汉字、字母、数字、“-”、“_”的组合】
|
||||
export const userName = /[A-Za-z0-9_\-\u4e00-\u9fa5]$/
|
||||
|
||||
// URL
|
||||
export const URL =
|
||||
/^(https?|ftp):\/\/([a-zA-Z0-9.-]+(:[a-zA-Z0-9.&%$-]+)*@)*((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]?)(\.(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])){3}|([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+\.(com|edu|gov|int|mil|net|org|biz|arpa|info|name|pro|aero|coop|museum|[a-zA-Z]{2}))(:[0-9]+)*(\/($|[a-zA-Z0-9.,?'\\+&%$#=~_-]+))*$/
|
||||
|
||||
// 固话
|
||||
export const TEL = /0\d{2,3}-\d{7,8}/
|
||||
21
seller/src/utils/validate.js
Normal file
@@ -0,0 +1,21 @@
|
||||
import * as regExp from "./regular";
|
||||
|
||||
//表单中必须输入汉字
|
||||
export function validateNeedName(rule, value, callback) {
|
||||
const name = regExp.name;
|
||||
if (name.test(value)) {
|
||||
callback();
|
||||
} else {
|
||||
return callback(new Error("请输入汉字"));
|
||||
}
|
||||
}
|
||||
|
||||
//表单中输入手机号验证
|
||||
export function validateMobile(rule, value, callback) {
|
||||
const mobile = regExp.mobile;
|
||||
if (mobile.test(value)) {
|
||||
callback();
|
||||
} else {
|
||||
return callback(new Error("手机号输入错误!"));
|
||||
}
|
||||
}
|
||||
206
seller/src/views/Main.vue
Normal file
@@ -0,0 +1,206 @@
|
||||
<style lang="scss" scoped>
|
||||
@import "./main.scss";
|
||||
</style>
|
||||
|
||||
<template>
|
||||
<div class="main">
|
||||
<div class="sidebar-menu-con menu-bar">
|
||||
<div class="logo-con">
|
||||
<img src="../assets/logo.png" key="max-logo" />
|
||||
</div>
|
||||
<shrinkable-menu></shrinkable-menu>
|
||||
</div>
|
||||
<!-- 顶部标题栏主体 -->
|
||||
<div class="main-header-con" style="padding-left:240px">
|
||||
<div class="main-header">
|
||||
<div :class="{'header-avator-con':navType!=4, 'header-avator-con nav4':navType == 4}">
|
||||
<!-- 用户头像 -->
|
||||
<div class="user-dropdown-menu-con">
|
||||
<Row type="flex" justify="end" align="middle" class="user-dropdown-innercon">
|
||||
<Dropdown transfer trigger="hover" @on-click="handleClickUserDropdown">
|
||||
<div class="dropList">
|
||||
<span class="main-user-name">{{ userInfo.storeName }}</span>
|
||||
<Icon type="md-arrow-dropdown" />
|
||||
<Avatar :src="userInfo.storeLogo" style="background: #fff;margin-left: 10px;"></Avatar>
|
||||
</div>
|
||||
<DropdownMenu slot="list">
|
||||
<!-- <DropdownItem name="ownSpace">{{ $t('userCenter') }}</DropdownItem> -->
|
||||
<DropdownItem name="changePass">{{ $t('changePass') }}</DropdownItem>
|
||||
<DropdownItem name="loginOut" divided>{{ $t('logout') }}</DropdownItem>
|
||||
</DropdownMenu>
|
||||
</Dropdown>
|
||||
</Row>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 已打开的页面标签 -->
|
||||
<div class="tags-con">
|
||||
<tags-page-opened :pageTagsList="pageTagsList"></tags-page-opened>
|
||||
</div>
|
||||
</div>
|
||||
<div class="single-page-con">
|
||||
<div class="single-page">
|
||||
<keep-alive :include="cachePage">
|
||||
<router-view></router-view>
|
||||
</keep-alive>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 全局加载动画 -->
|
||||
<circleLoading class="loading-position" v-show="loading" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import shrinkableMenu from "./main-components/shrinkable-menu/shrinkable-menu.vue";
|
||||
import tagsPageOpened from "./main-components/tags-page-opened.vue";
|
||||
import breadcrumbNav from "./main-components/breadcrumb-nav.vue";
|
||||
import fullScreen from "./main-components/fullscreen.vue";
|
||||
import messageTip from "./main-components/message-tip.vue";
|
||||
import circleLoading from "@/views/my-components/lili/circle-loading.vue";
|
||||
import Cookies from "js-cookie";
|
||||
import util from "@/libs/util.js";
|
||||
|
||||
export default {
|
||||
components: {
|
||||
shrinkableMenu,
|
||||
tagsPageOpened,
|
||||
breadcrumbNav,
|
||||
fullScreen,
|
||||
messageTip,
|
||||
circleLoading,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
sliceNum: 5, // 展示nav数量
|
||||
userInfo: "", // 用户信息
|
||||
navType: 1, // nav类型
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
loading() {
|
||||
return this.$store.state.app.loading;
|
||||
},
|
||||
pageTagsList() {
|
||||
return this.$store.state.app.storeOpenedList; // 打开的页面的页面对象
|
||||
},
|
||||
cachePage() {
|
||||
return this.$store.state.app.cachePage;
|
||||
},
|
||||
lang() {
|
||||
return this.$store.state.app.lang;
|
||||
},
|
||||
mesCount() {
|
||||
return 0;
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
init() {
|
||||
// 菜单
|
||||
let pathArr = util.setCurrentPath(this, this.$route.name);
|
||||
if (pathArr.length >= 2) {
|
||||
this.$store.commit("addOpenSubmenu", pathArr[1].name);
|
||||
}
|
||||
|
||||
let userInfo = JSON.parse(Cookies.get("userInfo"));
|
||||
this.userInfo = userInfo;
|
||||
this.checkTag(this.$route.name);
|
||||
|
||||
let currWidth = document.body.clientWidth;
|
||||
if (currWidth <= 1200) {
|
||||
this.sliceNum = 2;
|
||||
}
|
||||
},
|
||||
selectNav(name) {
|
||||
this.$store.commit("setCurrNav", name);
|
||||
this.setStore("currNav", name);
|
||||
// 清空所有已打开标签
|
||||
// this.$store.commit("clearAllTags");
|
||||
if (this.$route.name != "home_index") {
|
||||
this.$router.push({
|
||||
name: "home_index",
|
||||
});
|
||||
}
|
||||
util.initRouter(this);
|
||||
},
|
||||
toggleClick() {
|
||||
this.shrink = !this.shrink;
|
||||
},
|
||||
handleLanDropdown(name) {
|
||||
this.$i18n.locale = name;
|
||||
this.$store.commit("switchLang", name);
|
||||
},
|
||||
handleClickUserDropdown(name) {
|
||||
if (name == "ownSpace") {
|
||||
util.openNewPage(this, "personal-enter");
|
||||
this.$router.push({
|
||||
name: "personal-enter",
|
||||
});
|
||||
} else if (name == "changePass") {
|
||||
util.openNewPage(this, "change_pass");
|
||||
this.$router.push({
|
||||
name: "change_pass",
|
||||
});
|
||||
} else if (name == "loginOut") {
|
||||
Cookies.set("accessToken", "");
|
||||
this.$store.commit("logout", this);
|
||||
this.$store.commit("clearOpenedSubmenu");
|
||||
this.setStore("accessToken", "");
|
||||
this.setStore("refreshToken", "");
|
||||
this.$router.push({ path: "/login" });
|
||||
}
|
||||
},
|
||||
checkTag(name) {
|
||||
let openpageHasTag = this.pageTagsList.some((item) => {
|
||||
if (item.name == name) {
|
||||
return true;
|
||||
}
|
||||
});
|
||||
if (!openpageHasTag) {
|
||||
// 解决关闭当前标签后再点击回退按钮会退到当前页时没有标签的问题
|
||||
util.openNewPage(
|
||||
this,
|
||||
name,
|
||||
this.$route.params || {},
|
||||
this.$route.query || {}
|
||||
);
|
||||
}
|
||||
},
|
||||
|
||||
resize() {
|
||||
let currWidth = document.body.clientWidth;
|
||||
let count = currWidth / 300;
|
||||
if (count > 6) {
|
||||
this.sliceNum = 6;
|
||||
} else {
|
||||
this.sliceNum = count;
|
||||
}
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
$route(to) {
|
||||
this.$store.commit("setCurrentPageName", to.name);
|
||||
let pathArr = util.setCurrentPath(this, to.name);
|
||||
if (pathArr.length > 2) {
|
||||
this.$store.commit("addOpenSubmenu", pathArr[1].name);
|
||||
}
|
||||
this.checkTag(to.name);
|
||||
localStorage.currentPageName = to.name;
|
||||
},
|
||||
lang() {
|
||||
util.setCurrentPath(this, this.$route.name); // 在切换语言时用于刷新面包屑
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.init();
|
||||
let that = this;
|
||||
this.resize();
|
||||
window.addEventListener("resize", function () {
|
||||
that.resize();
|
||||
});
|
||||
},
|
||||
created() {
|
||||
// 显示打开的页面的列表
|
||||
this.$store.commit("setOpenedList");
|
||||
},
|
||||
};
|
||||
</script>
|
||||
19
seller/src/views/change-password/change-password.scss
Normal file
@@ -0,0 +1,19 @@
|
||||
.change-pass {
|
||||
&-btn-box {
|
||||
margin-bottom: 10px;
|
||||
|
||||
button {
|
||||
padding-left: 0;
|
||||
|
||||
span {
|
||||
color: #2D8CF0;
|
||||
transition: all .2s;
|
||||
}
|
||||
|
||||
span:hover {
|
||||
color: #0C25F1;
|
||||
transition: all .2s;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
175
seller/src/views/change-password/change-password.vue
Normal file
@@ -0,0 +1,175 @@
|
||||
<template>
|
||||
<div>
|
||||
<Card class="change-pass">
|
||||
<p slot="title">
|
||||
<Icon type="key"></Icon>修改密码
|
||||
</p>
|
||||
<div>
|
||||
<Form
|
||||
ref="editPasswordForm"
|
||||
:model="editPasswordForm"
|
||||
:label-width="100"
|
||||
label-position="right"
|
||||
:rules="passwordValidate"
|
||||
style="width:450px"
|
||||
>
|
||||
<FormItem label="原密码" prop="oldPass">
|
||||
<Input type="password" v-model="editPasswordForm.oldPass" placeholder="请输入现在使用的密码"></Input>
|
||||
</FormItem>
|
||||
<FormItem label="新密码" prop="newPassword">
|
||||
<SetPassword style="width:350px;" v-model="editPasswordForm.newPassword" @on-change="changeInputPass" />
|
||||
</FormItem>
|
||||
<FormItem label="确认新密码" prop="rePass">
|
||||
<Input type="password" v-model="editPasswordForm.rePass" placeholder="请再次输入新密码"></Input>
|
||||
</FormItem>
|
||||
<FormItem>
|
||||
<Button
|
||||
type="primary"
|
||||
style="width: 100px;margin-right:5px"
|
||||
:loading="savePassLoading"
|
||||
@click="saveEditPass"
|
||||
>保存</Button>
|
||||
<Button @click="cancelEditPass">取消</Button>
|
||||
</FormItem>
|
||||
</Form>
|
||||
</div>
|
||||
</Card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import SetPassword from "@/views/my-components/lili/set-password";
|
||||
import { changePass } from "@/api/index";
|
||||
export default {
|
||||
name: "change_pass",
|
||||
components: {
|
||||
SetPassword
|
||||
},
|
||||
data() {
|
||||
const valideRePassword = (rule, value, callback) => {
|
||||
if (value !== this.editPasswordForm.newPassword) {
|
||||
callback(new Error("两次输入密码不一致"));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
};
|
||||
return {
|
||||
savePassLoading: false, // 保存loading
|
||||
editPasswordForm: { // 修改密码表单
|
||||
oldPass: "", // 旧密码
|
||||
newPassword: "", // 新密码
|
||||
rePass: "" // 从新输入新密码
|
||||
},
|
||||
strength: "", // 密码强度
|
||||
passwordValidate: {
|
||||
oldPass: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入原密码",
|
||||
trigger: "blur"
|
||||
}
|
||||
],
|
||||
newPassword: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入新密码",
|
||||
trigger: "blur"
|
||||
},
|
||||
{
|
||||
min: 6,
|
||||
message: "请至少输入6个字符",
|
||||
trigger: "blur"
|
||||
},
|
||||
{
|
||||
max: 32,
|
||||
message: "最多输入32个字符",
|
||||
trigger: "blur"
|
||||
}
|
||||
],
|
||||
rePass: [
|
||||
{
|
||||
required: true,
|
||||
message: "请再次输入新密码",
|
||||
trigger: "blur"
|
||||
},
|
||||
{
|
||||
validator: valideRePassword,
|
||||
trigger: "blur"
|
||||
}
|
||||
]
|
||||
}
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
changeInputPass(v, grade, strength) {
|
||||
this.strength = strength;
|
||||
},
|
||||
saveEditPass() {
|
||||
let params = {
|
||||
password: this.md5(this.editPasswordForm.oldPass),
|
||||
newPassword: this.md5(this.editPasswordForm.newPassword)
|
||||
};
|
||||
this.$refs["editPasswordForm"].validate(valid => {
|
||||
if (valid) {
|
||||
this.savePassLoading = true;
|
||||
changePass(params).then(res => {
|
||||
this.savePassLoading = false;
|
||||
if (res.success) {
|
||||
this.$Modal.success({
|
||||
title: "修改密码成功",
|
||||
content: "修改密码成功,需重新登录",
|
||||
onOk: () => {
|
||||
this.$store.commit("logout", this);
|
||||
this.$store.commit("clearOpenedSubmenu");
|
||||
this.$router.push({
|
||||
name: "login"
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
cancelEditPass() {
|
||||
this.$store.commit("removeTag", "change_pass");
|
||||
localStorage.storeOpenedList = JSON.stringify(
|
||||
this.$store.state.app.storeOpenedList
|
||||
);
|
||||
let lastPageName = "";
|
||||
let length = this.$store.state.app.storeOpenedList.length;
|
||||
if (length > 1) {
|
||||
lastPageName = this.$store.state.app.storeOpenedList[length - 1].name;
|
||||
} else {
|
||||
lastPageName = this.$store.state.app.storeOpenedList[0].name;
|
||||
}
|
||||
this.$router.push({
|
||||
name: lastPageName
|
||||
});
|
||||
}
|
||||
},
|
||||
mounted() {}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.change-pass {
|
||||
&-btn-box {
|
||||
margin-bottom: 10px;
|
||||
|
||||
button {
|
||||
padding-left: 0;
|
||||
|
||||
span {
|
||||
color: #2d8cf0;
|
||||
transition: all 0.2s;
|
||||
}
|
||||
|
||||
span:hover {
|
||||
color: #0c25f1;
|
||||
transition: all 0.2s;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
49
seller/src/views/distribution/dataJson.js
Normal file
@@ -0,0 +1,49 @@
|
||||
// 分销商状态列表
|
||||
export const distributionStatusList= [
|
||||
{
|
||||
value:'APPLY',
|
||||
label:'申请中'
|
||||
},
|
||||
{
|
||||
value:'RETREAT',
|
||||
label:'已清退'
|
||||
},
|
||||
{
|
||||
value:'REFUSE',
|
||||
label:'审核拒绝'
|
||||
},
|
||||
{
|
||||
value:'PASS',
|
||||
label:'审核通过'
|
||||
},
|
||||
]
|
||||
// 分销佣金状态列表
|
||||
export const cashStatusList = [
|
||||
{
|
||||
value:'APPLY',
|
||||
label:'待处理'
|
||||
},
|
||||
{
|
||||
value:'REFUSE',
|
||||
label:'拒绝'
|
||||
},
|
||||
{
|
||||
value:'PASS',
|
||||
label:'通过'
|
||||
}
|
||||
]
|
||||
// 分销订单状态列表
|
||||
export const orderStatusList = [
|
||||
{
|
||||
value:'WAIT_BILL',
|
||||
label:'待结算'
|
||||
},
|
||||
{
|
||||
value:'WAIT_CASH',
|
||||
label:'待提现'
|
||||
},
|
||||
{
|
||||
value:'COMPLETE_CASH',
|
||||
label:'提现完成'
|
||||
}
|
||||
]
|
||||
311
seller/src/views/distribution/distributionGoods.vue
Normal file
@@ -0,0 +1,311 @@
|
||||
<template>
|
||||
<div class="search">
|
||||
<Row>
|
||||
<Col>
|
||||
<Card>
|
||||
<Row @keydown.enter.native="handleSearch">
|
||||
<Form ref="searchForm" :model="searchForm" inline :label-width="70" class="search-form">
|
||||
<Form-item label="商品名称" prop="goodsName">
|
||||
<Input type="text" v-model="searchForm.goodsName" placeholder="请输入商品名称" clearable style="width: 200px"/>
|
||||
</Form-item>
|
||||
<!-- <Form-item label="店铺名称">
|
||||
<Select v-model="searchForm.shopId" placeholder="请选择" @on-query-change="searchChange" filterable clearable style="width: 200px">
|
||||
<Option v-for="item in shopList" :value="item.id" :key="item.id">{{ item.storeName }}</Option>
|
||||
</Select>
|
||||
</Form-item> -->
|
||||
<Button @click="handleSearch" type="primary" icon="ios-search" class="search-btn">搜索</Button>
|
||||
</Form>
|
||||
</Row>
|
||||
<Row class="operation padding-row">
|
||||
<Button @click="add" type="primary">添加</Button>
|
||||
<!-- <Button @click="add" type="default">批量删除</Button>-->
|
||||
</Row>
|
||||
<Row>
|
||||
<Table :loading="loading" border :columns="columns" :data="data" ref="table" sortable="custom" @on-sort-change="changeSort" @on-selection-change="changeSelect">
|
||||
<!-- 商品栏目格式化 -->
|
||||
<template slot="goodsSlot" slot-scope="scope">
|
||||
<div style="margin-top: 5px;height: 70px; display: flex;">
|
||||
<div style="">
|
||||
<img :src="scope.row.thumbnail" style="height: 60px;margin-top: 3px;width: 60px">
|
||||
</div>
|
||||
|
||||
<div style="margin-left: 13px;">
|
||||
<div class="div-zoom" >
|
||||
<a>{{scope.row.goodsName}}</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</template>
|
||||
</Table>
|
||||
</Row>
|
||||
<Row type="flex" justify="end" class="page">
|
||||
<Page :current="searchForm.pageNumber" :total="total" :page-size="searchForm.pageSize" @on-change="changePage" @on-page-size-change="changePageSize" :page-size-opts="[10,20,50]" size="small" show-total show-elevator show-sizer></Page>
|
||||
</Row>
|
||||
</Card>
|
||||
</Col>
|
||||
</Row>
|
||||
<liliDialog
|
||||
ref="liliDialog"
|
||||
@selectedGoodsData="selectedGoodsData"
|
||||
></liliDialog>
|
||||
<Modal
|
||||
:title="modalTitle"
|
||||
v-model="modalVisible"
|
||||
:mask-closable="false"
|
||||
:width="500"
|
||||
>
|
||||
<Form ref="form" :model="form" :label-width="100" :rules="formValidate">
|
||||
<FormItem label="分销佣金" prop="commission">
|
||||
<Input v-model="form.commission" clearable style="width: 100%"/>
|
||||
</FormItem>
|
||||
</Form>
|
||||
<div slot="footer">
|
||||
<Button type="text" @click="modalVisible = false">取消</Button>
|
||||
<Button type="primary" :loading="submitLoading" @click="handleSubmit"
|
||||
>提交
|
||||
</Button
|
||||
>
|
||||
</div>
|
||||
</Modal>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
getDistributionGoods,
|
||||
distributionGoodsCancel,
|
||||
distributionGoodsCheck
|
||||
} from "@/api/distribution";
|
||||
import liliDialog from "../lili-dialog/index";
|
||||
|
||||
import {getShopListData} from '@/api/shops'
|
||||
export default {
|
||||
name: "distributionGoods",
|
||||
components: {
|
||||
liliDialog
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
modalVisible: false, // 添加或编辑显示
|
||||
modalTitle: "", // 添加或编辑标题
|
||||
submitLoading: false, // 添加或编辑提交状态
|
||||
shopList:[], // 店铺列表
|
||||
loading: true, // 表单加载状态
|
||||
drop: false,
|
||||
dropDownContent: "展开",
|
||||
dropDownIcon: "ios-arrow-down",
|
||||
searchForm: { // 搜索框初始化对象
|
||||
pageNumber: 1, // 当前页数
|
||||
pageSize: 10, // 页面大小
|
||||
sort: "createTime", // 默认排序字段
|
||||
order: "desc", // 默认排序方式
|
||||
},
|
||||
selectList: [], // 多选数据
|
||||
form:{
|
||||
commission : 1 // 分销金额
|
||||
},
|
||||
skuId:0, // 当前分销商品的skuId
|
||||
formValidate: {
|
||||
commission: [
|
||||
{ required: true, message: '请输入大于1小于9999的合法分销金额'},
|
||||
{
|
||||
pattern: /^[1-9]\d{0,3}(\.\d{1,2})?$/,
|
||||
message: "请输入大于1小于9999的合法分销金额",
|
||||
trigger: "change"
|
||||
}],
|
||||
},
|
||||
columns: [ // 表哥表头
|
||||
{
|
||||
type: "selection",
|
||||
width: 60,
|
||||
align: "center"
|
||||
},
|
||||
{
|
||||
title: "商品名称",
|
||||
key: "goodsName",
|
||||
minWidth: 250,
|
||||
slot: "goodsSlot",
|
||||
},
|
||||
{
|
||||
title: "商品价格",
|
||||
key: "price",
|
||||
width: 130,
|
||||
render: (h, params) => {
|
||||
return h("div", this.$options.filters.unitPrice(params.row.price,'¥'));
|
||||
}
|
||||
},
|
||||
{
|
||||
title: "库存",
|
||||
key: "quantity",
|
||||
width: 100
|
||||
},
|
||||
{
|
||||
title: "店铺名称",
|
||||
key: "storeName",
|
||||
minWidth: 120,
|
||||
},
|
||||
{
|
||||
title: "佣金金额",
|
||||
key: "commission",
|
||||
width: 120,
|
||||
render: (h, params) => {
|
||||
if(params.row.commission !=null){
|
||||
return h("div", this.$options.filters.unitPrice(params.row.commission,'¥'));
|
||||
}else{
|
||||
return h("div", this.$options.filters.unitPrice(0,'¥'));
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
title: "操作",
|
||||
key: "action",
|
||||
align: "center",
|
||||
width: 150,
|
||||
render: (h, params) => {
|
||||
return h("div", [
|
||||
h(
|
||||
"Button",
|
||||
{
|
||||
props: {
|
||||
type: "error",
|
||||
size: "small"
|
||||
},
|
||||
on: {
|
||||
click: () => {
|
||||
this.remove(params.row);
|
||||
}
|
||||
}
|
||||
},
|
||||
"删除"
|
||||
)
|
||||
]);
|
||||
}
|
||||
}
|
||||
],
|
||||
data: [], // 表单数据
|
||||
total: 0 // 表单数据总数
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
init() {
|
||||
this.getDataList();
|
||||
// this.getShopList()
|
||||
},
|
||||
selectedGoodsData(v){
|
||||
this.modalVisible = true
|
||||
this.form.commission = 1
|
||||
this.modalTitle = "保存分销商品"
|
||||
this.skuId = v[0].id
|
||||
//this.data.unshift(v[0])
|
||||
},
|
||||
add(){
|
||||
|
||||
this.$refs.liliDialog.flag = true;
|
||||
this.$refs.liliDialog.goodsFlag = true;
|
||||
|
||||
this.$refs.liliDialog.singleGoods();
|
||||
|
||||
},
|
||||
changePage(v) {
|
||||
this.searchForm.pageNumber = v;
|
||||
this.getDataList();
|
||||
this.clearSelectAll();
|
||||
},
|
||||
handleSubmit(){
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (valid) {
|
||||
distributionGoodsCheck(this.skuId,this.form).then(res => {
|
||||
if(res.message === 'success') {
|
||||
this.$Message.success("添加成功");
|
||||
}
|
||||
this.modalVisible = false
|
||||
this.getDataList()
|
||||
});
|
||||
}
|
||||
})
|
||||
},
|
||||
changePageSize(v) {
|
||||
this.searchForm.pageSize = v;
|
||||
this.getDataList();
|
||||
},
|
||||
handleSearch() {
|
||||
this.searchForm.pageNumber = 1;
|
||||
this.searchForm.pageSize = 10;
|
||||
this.getDataList();
|
||||
},
|
||||
|
||||
changeSort(e) {
|
||||
this.searchForm.sort = e.key;
|
||||
this.searchForm.order = e.order;
|
||||
if (e.order === "normal") {
|
||||
this.searchForm.order = "";
|
||||
}
|
||||
this.getDataList();
|
||||
},
|
||||
clearSelectAll() {
|
||||
this.$refs.table.selectAll(false);
|
||||
},
|
||||
|
||||
getDataList() {
|
||||
this.loading = true;
|
||||
// 带多条件搜索参数获取表单数据 请自行修改接口
|
||||
getDistributionGoods(this.searchForm).then(res => {
|
||||
this.loading = false;
|
||||
if (res.success) {
|
||||
this.data = res.result.records;
|
||||
this.total = res.result.total;
|
||||
}
|
||||
});
|
||||
this.total = this.data.length;
|
||||
this.loading = false;
|
||||
},
|
||||
remove(v) {
|
||||
this.$Modal.confirm({
|
||||
title: "确认删除",
|
||||
// 记得确认修改此处
|
||||
content: "您确认要删除此分销商品么?",
|
||||
loading: true,
|
||||
onOk: () => {
|
||||
// 删除
|
||||
distributionGoodsCancel(v.id).then(res => {
|
||||
this.$Modal.remove();
|
||||
if (res.success) {
|
||||
this.$Message.success("删除成功");
|
||||
this.getDataList();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
getShopList (val) {
|
||||
const params = {
|
||||
pageNumber:1,
|
||||
pageSize:10,
|
||||
storeName:''
|
||||
}
|
||||
if (val) {
|
||||
params.storeName = val;
|
||||
} else {
|
||||
params.storeName = ''
|
||||
}
|
||||
|
||||
getShopListData(params).then(res => {
|
||||
this.shopList = res.result.records
|
||||
})
|
||||
},
|
||||
searchChange(val){
|
||||
this.getShopList(val)
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.init();
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
@import "@/styles/table-common.scss";
|
||||
.search-form{
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
||||
128
seller/src/views/error-page/403.vue
Normal file
@@ -0,0 +1,128 @@
|
||||
|
||||
<template>
|
||||
<div class="error403">
|
||||
<div class="error403-body-con">
|
||||
<Card>
|
||||
<div class="error403-body-con-title">4<span class="error403-0-span">
|
||||
<Icon type="android-lock"></Icon>
|
||||
</span><span class="error403-key-span">
|
||||
<Icon size="220" type="ios-bolt"></Icon>
|
||||
</span></div>
|
||||
<p class="error403-body-con-message">You don't have permission</p>
|
||||
<div class="error403-btn-con">
|
||||
<Button @click="goHome" size="large" style="width: 200px;" type="text">返回首页</Button>
|
||||
<Button @click="backPage" size="large" style="width: 200px;margin-left: 40px;" type="primary">返回上一页</Button>
|
||||
</div>
|
||||
</Card>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "Error403",
|
||||
methods: {
|
||||
backPage() {
|
||||
this.$router.go(-1);
|
||||
},
|
||||
goHome() {
|
||||
this.$router.push({
|
||||
name: "home_index",
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
@keyframes error403animation {
|
||||
0% {
|
||||
transform: rotateZ(0deg);
|
||||
}
|
||||
40% {
|
||||
transform: rotateZ(-20deg);
|
||||
}
|
||||
45% {
|
||||
transform: rotateZ(-15deg);
|
||||
}
|
||||
50% {
|
||||
transform: rotateZ(-20deg);
|
||||
}
|
||||
55% {
|
||||
transform: rotateZ(-15deg);
|
||||
}
|
||||
60% {
|
||||
transform: rotateZ(-20deg);
|
||||
}
|
||||
100% {
|
||||
transform: rotateZ(0deg);
|
||||
}
|
||||
}
|
||||
.error403 {
|
||||
&-body-con {
|
||||
width: 700px;
|
||||
height: 500px;
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
top: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
&-title {
|
||||
text-align: center;
|
||||
font-size: 240px;
|
||||
font-weight: 700;
|
||||
color: #2d8cf0;
|
||||
height: 260px;
|
||||
line-height: 260px;
|
||||
margin-top: 40px;
|
||||
.error403-0-span {
|
||||
display: inline-block;
|
||||
position: relative;
|
||||
width: 170px;
|
||||
height: 170px;
|
||||
border-radius: 50%;
|
||||
border: 20px solid #ed3f14;
|
||||
color: #ed3f14;
|
||||
margin-right: 10px;
|
||||
i {
|
||||
display: inline-block;
|
||||
font-size: 120px;
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
top: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
}
|
||||
}
|
||||
.error403-key-span {
|
||||
display: inline-block;
|
||||
position: relative;
|
||||
width: 100px;
|
||||
height: 190px;
|
||||
border-radius: 50%;
|
||||
margin-right: 10px;
|
||||
i {
|
||||
display: inline-block;
|
||||
font-size: 190px;
|
||||
position: absolute;
|
||||
left: 20px;
|
||||
transform: translate(-50%, -60%);
|
||||
transform-origin: center bottom;
|
||||
animation: error403animation 2.8s ease 0s infinite;
|
||||
}
|
||||
}
|
||||
}
|
||||
&-message {
|
||||
display: block;
|
||||
text-align: center;
|
||||
font-size: 30px;
|
||||
font-weight: 500;
|
||||
letter-spacing: 4px;
|
||||
color: #dddde2;
|
||||
}
|
||||
}
|
||||
&-btn-con {
|
||||
text-align: center;
|
||||
padding: 20px 0;
|
||||
margin-bottom: 40px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
91
seller/src/views/error-page/404.vue
Normal file
@@ -0,0 +1,91 @@
|
||||
|
||||
<template>
|
||||
<div class="error404">
|
||||
<div class="error404-body-con">
|
||||
<Card>
|
||||
<div class="error404-body-con-title">4<span><Icon type="ios-navigate-outline"></Icon></span>4</div>
|
||||
<p class="error404-body-con-message">YOU LOOK LOST</p>
|
||||
<div class="error404-btn-con">
|
||||
<Button @click="goHome" size="large" style="width: 200px;" type="text">返回首页</Button>
|
||||
<Button @click="backPage" size="large" style="width: 200px;margin-left: 40px;" type="primary">返回上一页</Button>
|
||||
</div>
|
||||
</Card>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'Error404',
|
||||
methods: {
|
||||
backPage () {
|
||||
this.$router.go(-1);
|
||||
},
|
||||
goHome () {
|
||||
this.$router.push({
|
||||
name: 'home_index'
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
@keyframes error404animation {
|
||||
0% {
|
||||
transform: rotateZ(0deg);
|
||||
}
|
||||
20% {
|
||||
transform: rotateZ(-60deg);
|
||||
}
|
||||
40% {
|
||||
transform: rotateZ(-10deg);
|
||||
}
|
||||
60% {
|
||||
transform: rotateZ(50deg);
|
||||
}
|
||||
80% {
|
||||
transform: rotateZ(-20deg);
|
||||
}
|
||||
100% {
|
||||
transform: rotateZ(0deg);
|
||||
}
|
||||
}
|
||||
.error404{
|
||||
&-body-con{
|
||||
width: 700px;
|
||||
height: 500px;
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
top: 50%;
|
||||
transform: translate(-50%,-50%);
|
||||
&-title{
|
||||
text-align: center;
|
||||
font-size: 240px;
|
||||
font-weight: 700;
|
||||
color: #2d8cf0;
|
||||
height: 260px;
|
||||
line-height: 260px;
|
||||
margin-top: 40px;
|
||||
span{
|
||||
display: inline-block;
|
||||
color: #19be6b;
|
||||
font-size: 230px;
|
||||
animation: error404animation 3s ease 0s infinite alternate;
|
||||
}
|
||||
}
|
||||
&-message{
|
||||
display: block;
|
||||
text-align: center;
|
||||
font-size: 30px;
|
||||
font-weight: 500;
|
||||
letter-spacing: 12px;
|
||||
color: #dddde2;
|
||||
}
|
||||
}
|
||||
&-btn-con{
|
||||
text-align: center;
|
||||
padding: 20px 0;
|
||||
margin-bottom: 40px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
107
seller/src/views/error-page/500.vue
Normal file
@@ -0,0 +1,107 @@
|
||||
|
||||
|
||||
<template>
|
||||
<div class="error500">
|
||||
<div class="error500-body-con">
|
||||
<Card>
|
||||
<div class="error500-body-con-title">
|
||||
5<span class="error500-0-span"><Icon type="social-freebsd-devil"></Icon></span><span class="error500-0-span"><Icon type="social-freebsd-devil"></Icon></span>
|
||||
</div>
|
||||
<p class="error500-body-con-message">Oops! the server is wrong</p>
|
||||
<div class="error500-btn-con">
|
||||
<Button @click="goHome" size="large" style="width: 200px;" type="text">返回首页</Button>
|
||||
<Button @click="backPage" size="large" style="width: 200px;margin-left: 40px;" type="primary">返回上一页</Button>
|
||||
</div>
|
||||
</Card>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'Error500',
|
||||
methods: {
|
||||
backPage () {
|
||||
this.$router.go(-1);
|
||||
},
|
||||
goHome () {
|
||||
this.$router.push({
|
||||
name: 'home_index'
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
@keyframes error500animation {
|
||||
0% {
|
||||
transform: rotateZ(0deg);
|
||||
}
|
||||
20% {
|
||||
transform: rotateZ(-10deg);
|
||||
}
|
||||
40% {
|
||||
transform: rotateZ(5deg);
|
||||
}
|
||||
60% {
|
||||
transform: rotateZ(-5deg);
|
||||
}
|
||||
80% {
|
||||
transform: rotateZ(10deg);
|
||||
}
|
||||
100% {
|
||||
transform: rotateZ(0deg);
|
||||
}
|
||||
}
|
||||
.error500{
|
||||
&-body-con{
|
||||
width: 700px;
|
||||
height: 500px;
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
top: 50%;
|
||||
transform: translate(-50%,-50%);
|
||||
&-title{
|
||||
text-align: center;
|
||||
font-size: 240px;
|
||||
font-weight: 700;
|
||||
color: #2d8cf0;
|
||||
height: 260px;
|
||||
line-height: 260px;
|
||||
margin-top: 40px;
|
||||
.error500-0-span{
|
||||
display: inline-block;
|
||||
position: relative;
|
||||
width: 170px;
|
||||
height: 170px;
|
||||
border-radius: 50%;
|
||||
border: 20px solid #ed3f14;
|
||||
color: #ed3f14;
|
||||
margin-right: 10px;
|
||||
i{
|
||||
display: inline-block;
|
||||
font-size: 120px;
|
||||
position: absolute;
|
||||
bottom: -10px;
|
||||
left: 10px;
|
||||
transform-origin: center bottom;
|
||||
animation: error500animation 3s ease 0s infinite alternate;
|
||||
}
|
||||
}
|
||||
}
|
||||
&-message{
|
||||
display: block;
|
||||
text-align: center;
|
||||
font-size: 30px;
|
||||
font-weight: 500;
|
||||
letter-spacing: 4px;
|
||||
color: #dddde2;
|
||||
}
|
||||
}
|
||||
&-btn-con{
|
||||
text-align: center;
|
||||
padding: 20px 0;
|
||||
margin-bottom: 40px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
323
seller/src/views/goods/goods-manage/category.vue
Normal file
@@ -0,0 +1,323 @@
|
||||
<template>
|
||||
<div>
|
||||
|
||||
<Card>
|
||||
<div class="operation">
|
||||
<Button @click="addParent">添加一级分类</Button>
|
||||
<Button @click="refresh">刷新列表</Button>
|
||||
</div>
|
||||
<tree-table
|
||||
ref="treeTable"
|
||||
size="default"
|
||||
:loading="loading"
|
||||
:data="tableData"
|
||||
|
||||
:columns="columns"
|
||||
:border="true"
|
||||
:show-index="false"
|
||||
:is-fold="true"
|
||||
:expand-type="false"
|
||||
primary-key="id">
|
||||
<template slot="action" slot-scope="scope">
|
||||
<Button
|
||||
type="dashed"
|
||||
@click="edit(scope.row)"
|
||||
size="small"
|
||||
style="margin-right:5px"
|
||||
>编辑
|
||||
</Button>
|
||||
<Button
|
||||
v-show="scope.row.level != 1 "
|
||||
type="info"
|
||||
@click="addChildren(scope.row)"
|
||||
size="small"
|
||||
style="margin-right:5px"
|
||||
>添加子分类
|
||||
</Button>
|
||||
<Button
|
||||
type="error"
|
||||
@click="remove(scope.row)"
|
||||
size="small"
|
||||
style="margin-right:5px"
|
||||
>删除
|
||||
</Button>
|
||||
|
||||
</template>
|
||||
</tree-table>
|
||||
|
||||
<Modal :title="modalTitle" v-model="modalVisible" :mask-closable='false' :width="500">
|
||||
<Form ref="formAdd" :model="formAdd" :label-width="100" :rules="formValidate">
|
||||
<div v-if="showParent">
|
||||
<FormItem label="上级分类" prop="parentId">
|
||||
{{ parentTitle }}
|
||||
<Input v-model="formAdd.parentId" clearable style="width:100%;display:none"/>
|
||||
</FormItem>
|
||||
</div>
|
||||
<FormItem label="层级" prop="level" style="display:none">
|
||||
<Input v-model="formAdd.level" clearable style="width:100%"/>
|
||||
</FormItem>
|
||||
<FormItem label="分类名称" prop="labelName">
|
||||
<Input v-model="formAdd.labelName" maxlength="12" clearable style="width:100%"/>
|
||||
</FormItem>
|
||||
<FormItem label="排序值" prop="sortOrder" style="width:345px">
|
||||
<InputNumber v-model="formAdd.sortOrder" min="1"></InputNumber>
|
||||
</FormItem>
|
||||
</Form>
|
||||
<div slot="footer">
|
||||
<Button type="text" @click="modalVisible=false">取消</Button>
|
||||
<Button type="primary" :loading="submitLoading" @click="submit">提交</Button>
|
||||
</div>
|
||||
</Modal>
|
||||
</Card>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import * as API_Goods from "@/api/goods";
|
||||
|
||||
import TreeTable from "@/views/my-components/tree-table/Table/Table";
|
||||
import uploadPicInput from "@/views/my-components/lili/upload-pic-input";
|
||||
|
||||
export default {
|
||||
name: "lili-components",
|
||||
components: {
|
||||
TreeTable,
|
||||
uploadPicInput
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
submitLoading: false, // 提交loading
|
||||
loading: false, //表格加载的loading
|
||||
expandLevel: 1, // 展开的层级
|
||||
modalType: 0, // 添加或编辑标识
|
||||
modalVisible: false, // 添加或编辑显示
|
||||
modalTitle: "", // 添加或编辑标题
|
||||
showParent: false, // 是否展示上级菜单
|
||||
parentTitle: "", // 父级菜单名称
|
||||
formAdd: { // 添加或编辑表单对象初始化数据
|
||||
parentId: "",
|
||||
labelName: "",
|
||||
sortOrder: 1,
|
||||
level: 0,
|
||||
},
|
||||
// 表单验证规则
|
||||
formValidate: {
|
||||
labelName: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入分类名称",
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
},
|
||||
columns: [
|
||||
{
|
||||
title: "分类名称",
|
||||
key: "labelName",
|
||||
align: "left",
|
||||
minWidth: "120px",
|
||||
},
|
||||
{
|
||||
title: "操作",
|
||||
key: "action",
|
||||
align: "left",
|
||||
headerAlign: "center",
|
||||
width: "280px",
|
||||
type: "template",
|
||||
template: "action",
|
||||
}
|
||||
],
|
||||
tableData: []
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
init() {
|
||||
this.getAllList();
|
||||
},
|
||||
refresh() {
|
||||
this.loading = true;
|
||||
let that = this;
|
||||
setTimeout(function () {
|
||||
that.loading = false;
|
||||
}, 1000);
|
||||
},
|
||||
//添加子分类
|
||||
addChildren(v) {
|
||||
this.modalType = 0;
|
||||
this.modalTitle = "添加子分类";
|
||||
this.parentTitle = v.labelName;
|
||||
this.formAdd.level = eval(v.level + "+1");
|
||||
this.formAdd.labelName = "";
|
||||
this.showParent = true;
|
||||
delete this.formAdd.id;
|
||||
this.formAdd.parentId = v.id;
|
||||
this.modalVisible = true;
|
||||
},
|
||||
edit(v) {
|
||||
this.modalType = 1;
|
||||
this.modalTitle = "编辑";
|
||||
this.formAdd.id = v.id;
|
||||
this.formAdd.labelName = v.labelName;
|
||||
this.formAdd.level = v.level;
|
||||
this.formAdd.parentId = v.parentId;
|
||||
this.formAdd.sortOrder = v.sortOrder;
|
||||
this.formAdd.image = v.image;
|
||||
this.showParent = false;
|
||||
this.modalVisible = true;
|
||||
},
|
||||
//添加一级分类
|
||||
addParent() {
|
||||
this.modalType = 0;
|
||||
this.formAdd.labelName = "";
|
||||
this.modalTitle = "添加一级分类";
|
||||
this.parentTitle = "顶级分类";
|
||||
this.showParent = true;
|
||||
delete this.formAdd.id;
|
||||
this.formAdd.parentId = 0;
|
||||
this.formAdd.sortOrder = 1
|
||||
this.modalVisible = true;
|
||||
|
||||
},
|
||||
//提交编辑和添加
|
||||
submit() {
|
||||
this.$refs.formAdd.validate(valid => {
|
||||
if (valid) {
|
||||
this.submitLoading = true;
|
||||
if (this.modalType === 0) {
|
||||
// 添加 避免编辑后传入id等数据 记得删除
|
||||
delete this.formAdd.id;
|
||||
API_Goods.addShopGoodsLabel(this.formAdd).then((res) => {
|
||||
this.submitLoading = false;
|
||||
if (res.success) {
|
||||
this.$Message.success("添加成功");
|
||||
this.getAllList(0);
|
||||
this.modalVisible = false;
|
||||
this.$refs.form.resetFields();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
// 编辑
|
||||
API_Goods.editShopGoodsLabel(this.formAdd).then((res) => {
|
||||
this.submitLoading = false;
|
||||
if (res.success) {
|
||||
this.$Message.success("修改成功");
|
||||
this.getAllList(0);
|
||||
this.modalVisible = false;
|
||||
this.$refs.form.resetFields();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
remove(v) {
|
||||
this.$Modal.confirm({
|
||||
title: "确认删除",
|
||||
// 记得确认修改此处
|
||||
content: "您确认要删除 " + v.labelName + " ?",
|
||||
loading: true,
|
||||
onOk: () => {
|
||||
// 删除
|
||||
API_Goods.delCategdelShopGoodsLabel(v.id).then(res => {
|
||||
this.$Modal.remove();
|
||||
if (res.success) {
|
||||
this.$Message.success("操作成功");
|
||||
this.getAllList();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
getAllList() {
|
||||
this.loading = true;
|
||||
API_Goods.getShopGoodsLabelList(this.searchForm).then((res) => {
|
||||
this.loading = false;
|
||||
if (res.success) {
|
||||
// 仅展开指定级数 默认后台已展开所有
|
||||
let expandLevel = this.expandLevel;
|
||||
res.result.forEach(function (e) {
|
||||
if (expandLevel == 1) {
|
||||
if (e.level == 0) {
|
||||
e.expand = false;
|
||||
}
|
||||
if (e.children && e.children.length > 0) {
|
||||
e.children.forEach(function (c) {
|
||||
if (c.level == 1) {
|
||||
c.expand = false;
|
||||
}
|
||||
if (c.children && c.children.length > 0) {
|
||||
c.children.forEach(function (b) {
|
||||
if (b.level == 2) {
|
||||
b.expand = false;
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
} else if (expandLevel == 2) {
|
||||
if (e.level == 0) {
|
||||
e.expand = true;
|
||||
}
|
||||
if (e.children && e.children.length > 0) {
|
||||
e.children.forEach(function (c) {
|
||||
if (c.level == 1) {
|
||||
c.expand = false;
|
||||
}
|
||||
if (c.children && c.children.length > 0) {
|
||||
c.children.forEach(function (b) {
|
||||
if (b.level == 2) {
|
||||
b.expand = false;
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
} else if (expandLevel == 3) {
|
||||
if (e.level == 0) {
|
||||
e.expand = true;
|
||||
}
|
||||
if (e.children && e.children.length > 0) {
|
||||
e.children.forEach(function (c) {
|
||||
if (c.level == 1) {
|
||||
c.expand = true;
|
||||
}
|
||||
if (c.children && c.children.length > 0) {
|
||||
c.children.forEach(function (b) {
|
||||
if (b.level == 2) {
|
||||
b.expand = false;
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
this.tableData = res.result;
|
||||
}
|
||||
});
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.init();
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.article {
|
||||
font-size: 16px;
|
||||
font-weight: 400;
|
||||
margin: 12px 0;
|
||||
}
|
||||
|
||||
.href-text {
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.operation {
|
||||
margin-bottom: 2vh;
|
||||
}
|
||||
|
||||
.select-count {
|
||||
font-weight: 600;
|
||||
color: #40a9ff;
|
||||
}
|
||||
</style>
|
||||
388
seller/src/views/goods/goods-seller/addGoods.scss
Normal file
@@ -0,0 +1,388 @@
|
||||
/*选择商品品类*/
|
||||
.content-goods-publish {
|
||||
padding: 15px;
|
||||
margin: 0 auto;
|
||||
text-align: center;
|
||||
border: 1px solid #ddd;
|
||||
background: none repeat 0 0 #fff;
|
||||
|
||||
/*商品品类*/
|
||||
.goods-category {
|
||||
text-align: left;
|
||||
padding: 10px;
|
||||
background: #fafafa;
|
||||
border: 1px solid #e6e6e6;
|
||||
|
||||
ul {
|
||||
padding: 8px 4px 8px 8px;
|
||||
list-style: none;
|
||||
width: 300px;
|
||||
background: none repeat 0 0 #fff;
|
||||
border: 1px solid #e6e6e6;
|
||||
display: inline-block;
|
||||
letter-spacing: normal;
|
||||
margin-right: 15px;
|
||||
vertical-align: top;
|
||||
word-spacing: normal;
|
||||
|
||||
li {
|
||||
line-height: 20px;
|
||||
padding: 5px;
|
||||
cursor: pointer;
|
||||
color: #333;
|
||||
font-size: 12px;
|
||||
display: flex;
|
||||
flex-wrap: nowrap;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/** 当前品类被选中的样式 */
|
||||
.activeClass {
|
||||
background-color: #d9edf7;
|
||||
border: 1px solid #bce8f1;
|
||||
color: #3a87ad;
|
||||
}
|
||||
|
||||
/*!*当前选择的商品品类文字*!*/
|
||||
.current-goods-category {
|
||||
text-align: left;
|
||||
padding: 10px;
|
||||
width: 100%;
|
||||
border: 1px solid #fbeed5;
|
||||
color: #c09853;
|
||||
background-color: #fcf8e3;
|
||||
margin: 10px auto;
|
||||
padding: 8px 35px 8px 14px;
|
||||
text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
|
||||
font-size: 12px;
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
|
||||
/*编辑基本信息*/
|
||||
.el-form {
|
||||
padding-bottom: 80px;
|
||||
|
||||
.el-form-item {
|
||||
width: 100%;
|
||||
text-align: left;
|
||||
}
|
||||
}
|
||||
|
||||
/*平铺*/
|
||||
div.base-info-item > div {
|
||||
margin-left: 5%;
|
||||
}
|
||||
|
||||
div.base-info-item {
|
||||
h4 {
|
||||
margin-bottom: 10px;
|
||||
padding: 0 10px;
|
||||
border: 1px solid #ddd;
|
||||
background-color: #f8f8f8;
|
||||
font-weight: bold;
|
||||
color: #333;
|
||||
font-size: 14px;
|
||||
line-height: 40px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.form-item-view {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
justify-content: space-between;
|
||||
padding-left: 80px;
|
||||
|
||||
.layout {
|
||||
margin-bottom: 20px;
|
||||
|
||||
.sku-item-content {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
justify-content: center;
|
||||
width: 100%;
|
||||
|
||||
.sku-item-content-name {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.shop-category-text {
|
||||
font-size: 12px;
|
||||
}
|
||||
}
|
||||
|
||||
.form-item-view-bottom {
|
||||
margin-bottom: 50px;
|
||||
}
|
||||
|
||||
.item-goods-properts-row {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
word-break: break-all;
|
||||
white-space: normal;
|
||||
width: 300px;
|
||||
height: 100px;
|
||||
}
|
||||
|
||||
.item-goods-properts {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.form-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
/** 审核信息-拒绝原因 */
|
||||
.auth-info {
|
||||
color: red;
|
||||
}
|
||||
|
||||
.el-form-item {
|
||||
width: 30%;
|
||||
min-width: 300px;
|
||||
}
|
||||
|
||||
.goods-name-width {
|
||||
width: 50%;
|
||||
min-width: 300px;
|
||||
}
|
||||
|
||||
.el-form-item__content {
|
||||
margin-left: 120px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
p.goods-group-manager {
|
||||
padding-left: 7.5%;
|
||||
text-align: left;
|
||||
color: #999;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
/*teatarea*/
|
||||
/deep/ .el-textarea {
|
||||
width: 150%;
|
||||
}
|
||||
|
||||
.seo-text {
|
||||
width: 150%;
|
||||
}
|
||||
}
|
||||
|
||||
/*折叠面板*/
|
||||
.el-collapse-item {
|
||||
/deep/ .el-collapse-item__header {
|
||||
text-align: left;
|
||||
background-color: #f8f8f8;
|
||||
padding: 0 10px;
|
||||
font-weight: bold;
|
||||
color: #333;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.el-form-item {
|
||||
margin-left: 5%;
|
||||
width: 25%;
|
||||
}
|
||||
|
||||
/deep/ .el-form-item__content {
|
||||
margin-left: 120px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
p.goods-group-manager {
|
||||
padding-left: 12%;
|
||||
text-align: left;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
/deep/ .el-collapse-item__content {
|
||||
padding: 10px 0;
|
||||
text-align: left;
|
||||
}
|
||||
}
|
||||
|
||||
/*商品描述*/
|
||||
.goods-intro {
|
||||
line-height: 40;
|
||||
}
|
||||
|
||||
/** 底部步骤 */
|
||||
.footer {
|
||||
width: 88.7%;
|
||||
padding: 10px;
|
||||
background-color: #ffc;
|
||||
position: fixed;
|
||||
bottom: 0px;
|
||||
left: 10%;
|
||||
text-align: center;
|
||||
z-index: 9999;
|
||||
}
|
||||
|
||||
/*图片上传组件第一张图设置封面*/
|
||||
.goods-images {
|
||||
/deep/ li.el-upload-list__item:first-child {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
/deep/ li.el-upload-list__item:first-child:after {
|
||||
content: "封";
|
||||
color: #fff;
|
||||
font-weight: bold;
|
||||
font-size: 12px;
|
||||
position: absolute;
|
||||
left: -15px;
|
||||
top: -6px;
|
||||
width: 40px;
|
||||
height: 24px;
|
||||
padding-top: 6px;
|
||||
background: #13ce66;
|
||||
text-align: center;
|
||||
-webkit-transform: rotate(-45deg);
|
||||
transform: rotate(-45deg);
|
||||
-webkit-box-shadow: 0 0 1pc 1px rgba(0, 0, 0, 0.2);
|
||||
box-shadow: 0 0 1pc 1px rgba(0, 0, 0, 0.2);
|
||||
}
|
||||
}
|
||||
|
||||
.el-form-item__label {
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
.step-view {
|
||||
width: 33%;
|
||||
height: 40px;
|
||||
font-size: 19px;
|
||||
text-align: center;
|
||||
display: flex;
|
||||
background-color: #fff;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.add-sku-btn {
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
.sku-item:not(:first-child) {
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
.sku-upload-list {
|
||||
display: inline-block;
|
||||
width: 60px;
|
||||
height: 60px;
|
||||
text-align: center;
|
||||
line-height: 60px;
|
||||
border: 1px solid transparent;
|
||||
border-radius: 4px;
|
||||
overflow: hidden;
|
||||
background: #fff;
|
||||
position: relative;
|
||||
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
|
||||
margin-right: 4px;
|
||||
}
|
||||
|
||||
.preview-picture {
|
||||
width: 100%;
|
||||
margin: 0 auto;
|
||||
display: block;
|
||||
// text-align: center;
|
||||
border: 1px solid transparent;
|
||||
// justify-self: center;
|
||||
// align-self: center;
|
||||
}
|
||||
|
||||
.preview-picture img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.sku-upload-list img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.sku-upload-list-cover {
|
||||
display: none;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
background: rgba(0, 0, 0, 0.6);
|
||||
}
|
||||
|
||||
.sku-upload-list:hover .sku-upload-list-cover {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.sku-upload-list-cover i {
|
||||
color: #fff;
|
||||
font-size: 20px;
|
||||
cursor: pointer;
|
||||
margin: 0 2px;
|
||||
}
|
||||
.ivu-form-item-content {
|
||||
display: flex;
|
||||
}
|
||||
.required {
|
||||
/deep/ .ivu-form-item-label::before {
|
||||
content: "*";
|
||||
display: inline-block;
|
||||
margin-right: 4px;
|
||||
line-height: 1;
|
||||
font-family: SimSun;
|
||||
font-size: 14px;
|
||||
color: #ed4014;
|
||||
}
|
||||
}
|
||||
.demo-upload-list {
|
||||
width: 150px;
|
||||
height: 150px;
|
||||
text-align: center;
|
||||
border: 1px solid transparent;
|
||||
border-radius: 4px;
|
||||
display: inline-flex;
|
||||
flex-direction: column;
|
||||
background: #fff;
|
||||
position: relative;
|
||||
margin-right: 4px;
|
||||
}
|
||||
.demo-upload-list img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
.demo-upload-list-cover {
|
||||
display: none;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
|
||||
right: 0;
|
||||
background: rgba(0, 0, 0, 0.6);
|
||||
}
|
||||
.demo-upload-list:hover .demo-upload-list-cover {
|
||||
display: block;
|
||||
}
|
||||
.demo-upload-list-cover i {
|
||||
width: 50%;
|
||||
margin-top: 8px;
|
||||
color: #fff;
|
||||
font-size: 20px;
|
||||
cursor: pointer;
|
||||
}
|
||||
370
seller/src/views/goods/goods-seller/draftGoods.vue
Normal file
@@ -0,0 +1,370 @@
|
||||
<template>
|
||||
<div class="search">
|
||||
<Row>
|
||||
<Col>
|
||||
<Card>
|
||||
<Row v-show="openSearch" @keydown.enter.native="handleSearch">
|
||||
<Form
|
||||
ref="searchForm"
|
||||
:model="searchForm"
|
||||
inline
|
||||
:label-width="70"
|
||||
class="search-form"
|
||||
>
|
||||
<Form-item label="商品名称" prop="goodsName">
|
||||
<Input
|
||||
type="text"
|
||||
v-model="searchForm.goodsName"
|
||||
placeholder="请输入商品名称"
|
||||
clearable
|
||||
style="width: 200px"
|
||||
/>
|
||||
</Form-item>
|
||||
<span v-if="drop">
|
||||
<Form-item label="状态" prop="status">
|
||||
<Select
|
||||
v-model="searchForm.marketEnable"
|
||||
placeholder="请选择"
|
||||
clearable
|
||||
style="width: 200px"
|
||||
>
|
||||
<Option value="DOWN">下架</Option>
|
||||
<Option value="UPPER">上架</Option>
|
||||
</Select>
|
||||
</Form-item>
|
||||
<Form-item label="商品编号" prop="sn">
|
||||
<Input
|
||||
type="text"
|
||||
v-model="searchForm.sn"
|
||||
placeholder="商品编号"
|
||||
clearable
|
||||
style="width: 200px"
|
||||
/>
|
||||
</Form-item>
|
||||
</span>
|
||||
<Form-item style="margin-left: -35px" class="br">
|
||||
<Button @click="handleSearch" type="primary" icon="ios-search"
|
||||
>搜索</Button
|
||||
>
|
||||
<Button @click="handleReset">重置</Button>
|
||||
<a class="drop-down" @click="dropDown">
|
||||
{{ dropDownContent }}
|
||||
<Icon :type="dropDownIcon"></Icon>
|
||||
</a>
|
||||
</Form-item>
|
||||
</Form>
|
||||
</Row>
|
||||
<Row>
|
||||
<Table
|
||||
:loading="loading"
|
||||
border
|
||||
:columns="columns"
|
||||
:data="data"
|
||||
ref="table"
|
||||
sortable="custom"
|
||||
@on-sort-change="changeSort"
|
||||
@on-selection-change="changeSelect"
|
||||
></Table>
|
||||
</Row>
|
||||
<Row type="flex" justify="end" class="page">
|
||||
<Page
|
||||
:current="searchForm.pageNumber"
|
||||
:total="total"
|
||||
:page-size="searchForm.pageSize"
|
||||
@on-change="changePage"
|
||||
@on-page-size-change="changePageSize"
|
||||
:page-size-opts="[10, 20, 50]"
|
||||
size="small"
|
||||
show-total
|
||||
show-elevator
|
||||
show-sizer
|
||||
></Page>
|
||||
</Row>
|
||||
</Card>
|
||||
</Col>
|
||||
</Row>
|
||||
<Modal
|
||||
:title="modalTitle"
|
||||
v-model="modalVisible"
|
||||
:mask-closable="false"
|
||||
:width="500"
|
||||
>
|
||||
<Form
|
||||
ref="underForm"
|
||||
:model="underForm"
|
||||
:label-width="100"
|
||||
:rules="formValidate"
|
||||
>
|
||||
<FormItem label="下架原因" prop="reason">
|
||||
<Input v-model="underForm.reason" clearable style="width: 100%" />
|
||||
</FormItem>
|
||||
</Form>
|
||||
<div slot="footer">
|
||||
<Button type="text" @click="modalVisible = false">取消</Button>
|
||||
<Button type="primary" :loading="submitLoading" @click="lower(form.id)"
|
||||
>提交</Button
|
||||
>
|
||||
</div>
|
||||
</Modal>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getDraftGoodsListData, deleteDraftGoods } from "@/api/goods";
|
||||
export default {
|
||||
name: "goods",
|
||||
components: {},
|
||||
data() {
|
||||
return {
|
||||
id: "", //要操作的id
|
||||
openSearch: true, // 显示搜索
|
||||
loading: true, // 表单加载状态
|
||||
modalVisible: false, // 添加或编辑显示
|
||||
modalTitle: "", // 添加或编辑标题
|
||||
drop: false,
|
||||
dropDownContent: "展开",
|
||||
dropDownIcon: "ios-arrow-down",
|
||||
searchForm: {
|
||||
// 搜索框初始化对象
|
||||
pageNumber: 1, // 当前页数
|
||||
pageSize: 10, // 页面大小
|
||||
sort: "create_time", // 默认排序字段
|
||||
order: "desc", // 默认排序方式
|
||||
},
|
||||
underForm: { // 下架表单
|
||||
reason: "",
|
||||
},
|
||||
form: {
|
||||
// 添加或编辑表单对象初始化数据
|
||||
goodsName: "",
|
||||
sn: "",
|
||||
marketEnable: "",
|
||||
price: "",
|
||||
sellerName: "",
|
||||
},
|
||||
// 表单验证规则
|
||||
|
||||
formValidate: {},
|
||||
submitLoading: false, // 添加或编辑提交状态
|
||||
selectList: [], // 多选数据
|
||||
selectCount: 0, // 多选计数
|
||||
columns: [ // 表头
|
||||
{
|
||||
title: "ID",
|
||||
key: "id",
|
||||
minWidth: 120
|
||||
},
|
||||
{
|
||||
title: "商品原图",
|
||||
key: "original",
|
||||
width: 150,
|
||||
align: "center",
|
||||
render: (h, params) => {
|
||||
return h("img", {
|
||||
attrs: {
|
||||
src: params.row.original,
|
||||
alt: "加载图片失败",
|
||||
},
|
||||
style: {
|
||||
cursor: "pointer",
|
||||
width: "80px",
|
||||
height: "60px",
|
||||
margin: "10px 0",
|
||||
"object-fit": "contain",
|
||||
},
|
||||
});
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "商品名称",
|
||||
key: "goodsName",
|
||||
minWidth: 120
|
||||
},
|
||||
{
|
||||
title: "商品价格",
|
||||
key: "price",
|
||||
minWidth: 120
|
||||
},
|
||||
|
||||
{
|
||||
title: "商品库存",
|
||||
key: "quantity",
|
||||
minWidth: 120
|
||||
},
|
||||
{
|
||||
title: "创建时间",
|
||||
key: "createTime",
|
||||
minWidth: 120
|
||||
},
|
||||
{
|
||||
title: "操作",
|
||||
key: "action",
|
||||
align: "center",
|
||||
width: 200,
|
||||
render: (h, params) => {
|
||||
return h("div", [
|
||||
h(
|
||||
"Button",
|
||||
{
|
||||
props: {
|
||||
type: "primary",
|
||||
size: "small",
|
||||
},
|
||||
style: {
|
||||
marginRight: "5px",
|
||||
},
|
||||
on: {
|
||||
click: () => {
|
||||
this.editGoods(params.row);
|
||||
},
|
||||
},
|
||||
},
|
||||
"编辑"
|
||||
),
|
||||
h(
|
||||
"Button",
|
||||
{
|
||||
props: {
|
||||
type: "error",
|
||||
size: "small",
|
||||
},
|
||||
style: {
|
||||
marginRight: "5px",
|
||||
},
|
||||
on: {
|
||||
click: () => {
|
||||
this.removeDraft(params.row.id);
|
||||
},
|
||||
},
|
||||
},
|
||||
"删除"
|
||||
)
|
||||
]);
|
||||
},
|
||||
},
|
||||
],
|
||||
data: [], // 表单数据
|
||||
total: 0, // 表单数据总数
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
init() {
|
||||
let here = this.$route.matched.find((v) => v.name === this.$route.name);
|
||||
this.pageType = here.props.default ? here.props.default.type : "";
|
||||
if (this.pageType === "TEMPLATE") {
|
||||
this.searchForm.saveType = "TEMPLATE";
|
||||
} else {
|
||||
this.searchForm.saveType = "DRAFT";
|
||||
}
|
||||
this.getDataList();
|
||||
},
|
||||
editGoods(v) {
|
||||
this.searchForm.saveType === "TEMPLATE" ?
|
||||
this.$router.push({ name: "goods-template-operation-edit", query: { draftId: v.id } }):
|
||||
this.$router.push({ name: "goods-draft-operation-edit", query: { draftId: v.id } });
|
||||
},
|
||||
removeDraft (id) {
|
||||
let showType = this.searchForm.saveType === "TEMPLATE" ? "模版" : "草稿";
|
||||
this.$Modal.confirm({
|
||||
title: "确认审核",
|
||||
content: "您确认要删除id为 " + id + " 的" + showType + "吗?",
|
||||
loading: true,
|
||||
onOk: () => {
|
||||
deleteDraftGoods(id).then((res) => {
|
||||
this.$Modal.remove();
|
||||
if (res.success) {
|
||||
this.$Message.success("删除成功");
|
||||
this.getDataList();
|
||||
}
|
||||
});
|
||||
},
|
||||
});
|
||||
},
|
||||
changePage(v) {
|
||||
this.searchForm.pageNumber = v;
|
||||
this.getDataList();
|
||||
this.clearSelectAll();
|
||||
},
|
||||
changePageSize(v) {
|
||||
this.searchForm.pageSize = v;
|
||||
this.getDataList();
|
||||
},
|
||||
handleSearch() {
|
||||
this.searchForm.pageNumber = 1;
|
||||
this.searchForm.pageSize = 10;
|
||||
this.getDataList();
|
||||
},
|
||||
handleReset() {
|
||||
this.$refs.searchForm.resetFields();
|
||||
this.searchForm.pageNumber = 1;
|
||||
this.searchForm.pageSize = 10;
|
||||
// 重新加载数据
|
||||
this.getDataList();
|
||||
},
|
||||
changeSort(e) {
|
||||
this.searchForm.sort = e.key;
|
||||
this.searchForm.order = e.order;
|
||||
if (e.order === "normal") {
|
||||
this.searchForm.order = "";
|
||||
}
|
||||
this.getDataList();
|
||||
},
|
||||
clearSelectAll() {
|
||||
this.$refs.table.selectAll(false);
|
||||
},
|
||||
changeSelect(e) {
|
||||
this.selectList = e;
|
||||
this.selectCount = e.length;
|
||||
},
|
||||
dropDown() {
|
||||
if (this.drop) {
|
||||
this.dropDownContent = "展开";
|
||||
this.dropDownIcon = "ios-arrow-down";
|
||||
} else {
|
||||
this.dropDownContent = "收起";
|
||||
this.dropDownIcon = "ios-arrow-up";
|
||||
}
|
||||
this.drop = !this.drop;
|
||||
},
|
||||
getDataList() {
|
||||
this.loading = true;
|
||||
// 带多条件搜索参数获取表单数据
|
||||
getDraftGoodsListData(this.searchForm).then((res) => {
|
||||
this.loading = false;
|
||||
if (res.success) {
|
||||
this.data = res.result.records;
|
||||
this.total = res.result.total;
|
||||
}
|
||||
});
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.init();
|
||||
},
|
||||
watch: {
|
||||
$route(to, from) {
|
||||
this.init();
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.search {
|
||||
.operation {
|
||||
margin-bottom: 2vh;
|
||||
}
|
||||
.select-count {
|
||||
font-weight: 600;
|
||||
color: #40a9ff;
|
||||
}
|
||||
.select-clear {
|
||||
margin-left: 10px;
|
||||
}
|
||||
.page {
|
||||
margin-top: 2vh;
|
||||
}
|
||||
.drop-down {
|
||||
margin-left: 5px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
730
seller/src/views/goods/goods-seller/goods.vue
Normal file
@@ -0,0 +1,730 @@
|
||||
<template>
|
||||
<div class="search">
|
||||
|
||||
<Card>
|
||||
<Row @keydown.enter.native="handleSearch">
|
||||
<Form ref="searchForm" :model="searchForm" inline :label-width="70" class="search-form">
|
||||
<Form-item label="商品名称" prop="goodsName">
|
||||
<Input type="text" v-model="searchForm.goodsName" placeholder="请输入商品名称" clearable style="width: 200px" />
|
||||
</Form-item>
|
||||
<Form-item label="状态" prop="status">
|
||||
<Select v-model="searchForm.marketEnable" placeholder="请选择" clearable style="width: 200px">
|
||||
<Option value="DOWN">下架</Option>
|
||||
<Option value="UPPER">上架</Option>
|
||||
</Select>
|
||||
</Form-item>
|
||||
<Form-item label="商品编号" prop="sn">
|
||||
<Input type="text" v-model="searchForm.sn" placeholder="商品编号" clearable style="width: 200px" />
|
||||
</Form-item>
|
||||
<Button @click="handleSearch" type="primary" icon="ios-search" class="search-btn">搜索</Button>
|
||||
</Form>
|
||||
</Row>
|
||||
<Row class="operation padding-row">
|
||||
<Button @click="addGoods" type="primary">添加商品</Button>
|
||||
<Dropdown @on-click="handleDropdown">
|
||||
<Button type="default">
|
||||
批量操作
|
||||
<Icon type="ios-arrow-down"></Icon>
|
||||
</Button>
|
||||
<DropdownMenu slot="list">
|
||||
<DropdownItem name="uppers">批量上架</DropdownItem>
|
||||
<DropdownItem name="lowers">批量下架</DropdownItem>
|
||||
<DropdownItem name="deleteAll">批量删除</DropdownItem>
|
||||
<DropdownItem name="batchShipTemplate">批量设置运费模板</DropdownItem>
|
||||
</DropdownMenu>
|
||||
</Dropdown>
|
||||
</Row>
|
||||
|
||||
<Table :loading="loading" border :columns="columns" :data="data" ref="table" sortable="custom" @on-sort-change="changeSort" @on-selection-change="changeSelect">
|
||||
|
||||
<!-- 商品栏目格式化 -->
|
||||
<template slot="goodsSlot" slot-scope="scope">
|
||||
<div style="margin-top: 5px;height: 90px; display: flex;">
|
||||
<div style="">
|
||||
<img :src="scope.row.original" style="height: 80px;margin-top: 3px;width: 70px">
|
||||
</div>
|
||||
|
||||
<div style="margin-left: 13px;">
|
||||
<div class="div-zoom">
|
||||
<a>{{scope.row.goodsName}}</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</template>
|
||||
|
||||
</Table>
|
||||
|
||||
<Row type="flex" justify="end" class="page">
|
||||
<Page :current="searchForm.pageNumber" :total="total" :page-size="searchForm.pageSize" @on-change="changePage" @on-page-size-change="changePageSize" :page-size-opts="[10, 20, 50]" size="small"
|
||||
show-total show-elevator show-sizer></Page>
|
||||
</Row>
|
||||
</Card>
|
||||
|
||||
<Modal title="更新库存" v-model="updateStockModalVisible" :mask-closable="false" :width="500">
|
||||
<Input type="number" v-model="stockAllUpdate" placeholder="全部修改,如不需全部修改,则不需输入" />
|
||||
<Table :columns="updateStockColumns" :data="stockList" border :span-method="handleSpan"></Table>
|
||||
<div slot="footer">
|
||||
<Button type="text" @click="updateStockModalVisible = false">取消</Button>
|
||||
<Button type="primary" @click="updateStock">更新</Button>
|
||||
</div>
|
||||
</Modal>
|
||||
|
||||
<!-- 批量设置运费模板 -->
|
||||
<Modal title="批量设置运费模板" v-model="shipTemplateModal" :mask-closable="false" :width="500">
|
||||
<Form ref="shipTemplateForm" :model="shipTemplateForm" :label-width="120">
|
||||
<FormItem class="form-item-view-el" label="运费" prop="freightPayer">
|
||||
<RadioGroup @on-change="logisticsTemplateUndertakerChange" v-model="shipTemplateForm.freightPayer">
|
||||
<Radio label="BUYER">
|
||||
<span>买家承担运费</span>
|
||||
</Radio>
|
||||
<Radio label="STORE">
|
||||
<span>使用物流规则</span>
|
||||
</Radio>
|
||||
</RadioGroup>
|
||||
</FormItem>
|
||||
|
||||
<FormItem class="form-item-view-el" label="物流模板" prop="templateId" v-if="shipTemplateShow">
|
||||
<Select v-model="shipTemplateForm.templateId" style="width: 200px">
|
||||
<Option v-for="item in logisticsTemplate" :value="item.id" :key="item.id">{{ item.name }}
|
||||
</Option>
|
||||
</Select>
|
||||
</FormItem>
|
||||
</Form>
|
||||
<div slot="footer">
|
||||
<Button type="text" @click="shipTemplateModal = false">取消</Button>
|
||||
<Button type="primary" @click="saveShipTemplate">更新</Button>
|
||||
</div>
|
||||
</Modal>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
getGoodsListDataSeller,
|
||||
getGoodsSkuListDataSeller,
|
||||
updateGoodsSkuStocks,
|
||||
upGoods,
|
||||
lowGoods,
|
||||
deleteGoods,
|
||||
batchShipTemplate,
|
||||
} from "@/api/goods";
|
||||
|
||||
import * as API_Store from "@/api/shops";
|
||||
|
||||
export default {
|
||||
name: "goods",
|
||||
components: {},
|
||||
watch: {
|
||||
$route() {
|
||||
this.getDataList();
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
id: "", //要操作的id
|
||||
loading: true, // 表单加载状态
|
||||
shipTemplateForm: {
|
||||
freightPayer: "BUYER",
|
||||
},
|
||||
shipTemplateShow: false, //物流模板是否显示
|
||||
shipTemplateModal: false, // 物流模板是否显示
|
||||
logisticsTemplate: [], // 物流列表
|
||||
updateStockModalVisible: false, // 更新库存模态框显隐
|
||||
stockAllUpdate: undefined, // 更新库存数量
|
||||
searchForm: {
|
||||
// 搜索框初始化对象
|
||||
pageNumber: 1, // 当前页数
|
||||
pageSize: 10, // 页面大小
|
||||
sort: "create_time", // 默认排序字段
|
||||
order: "desc", // 默认排序方式
|
||||
},
|
||||
stockList: [], // 库存列表
|
||||
form: {
|
||||
// 添加或编辑表单对象初始化数据
|
||||
goodsName: "",
|
||||
sn: "",
|
||||
marketEnable: "",
|
||||
price: "",
|
||||
sellerName: "",
|
||||
},
|
||||
updateStockColumns: [
|
||||
{
|
||||
title: "sku规格",
|
||||
key: "sn",
|
||||
minWidth: 120,
|
||||
render: (h, params) => {
|
||||
return h("div", {}, params.row.simpleSpecs);
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "审核状态",
|
||||
key: "isAuth",
|
||||
width: 130,
|
||||
render: (h, params) => {
|
||||
if (params.row.isAuth == "TOBEAUDITED") {
|
||||
return h("div", [
|
||||
h("Badge", {
|
||||
props: {
|
||||
status: "error",
|
||||
text: "待审核",
|
||||
},
|
||||
}),
|
||||
]);
|
||||
} else if (params.row.isAuth == "PASS") {
|
||||
return h("div", [
|
||||
h("Badge", {
|
||||
props: {
|
||||
status: "success",
|
||||
text: "审核通过",
|
||||
},
|
||||
}),
|
||||
]);
|
||||
} else if (params.row.isAuth == "REFUSE") {
|
||||
return h("div", [
|
||||
h("Badge", {
|
||||
props: {
|
||||
status: "error",
|
||||
text: "审核拒绝",
|
||||
},
|
||||
}),
|
||||
]);
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "操作",
|
||||
key: "action",
|
||||
align: "center",
|
||||
width: 200,
|
||||
render: (h, params) => {
|
||||
let vm = this;
|
||||
return h("InputNumber", {
|
||||
props: {
|
||||
value: params.row.quantity,
|
||||
},
|
||||
on: {
|
||||
"on-change": (event) => {
|
||||
vm.stockList[params.index].quantity = event;
|
||||
},
|
||||
},
|
||||
});
|
||||
},
|
||||
},
|
||||
],
|
||||
// 表单验证规则
|
||||
formValidate: {},
|
||||
submitLoading: false, // 添加或编辑提交状态
|
||||
selectList: [], // 多选数据
|
||||
selectCount: 0, // 多选计数
|
||||
columns: [
|
||||
{
|
||||
type: "selection",
|
||||
width: 60,
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
title: "商品编号",
|
||||
key: "sn",
|
||||
width: 200,
|
||||
tooltip: true,
|
||||
},
|
||||
{
|
||||
title: "商品名称",
|
||||
key: "goodsName",
|
||||
minWidth: 200,
|
||||
slot: "goodsSlot",
|
||||
},
|
||||
|
||||
{
|
||||
title: "市场价格",
|
||||
key: "cost",
|
||||
width: 130,
|
||||
render: (h, params) => {
|
||||
return h(
|
||||
"div",
|
||||
this.$options.filters.unitPrice(params.row.cost, "¥")
|
||||
);
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "商品价格",
|
||||
key: "price",
|
||||
width: 130,
|
||||
render: (h, params) => {
|
||||
return h(
|
||||
"div",
|
||||
this.$options.filters.unitPrice(params.row.price, "¥")
|
||||
);
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "库存",
|
||||
key: "quantity",
|
||||
width: 120,
|
||||
render: (h, params) => {
|
||||
if (params.row.quantity) {
|
||||
return h("div", params.row.quantity);
|
||||
} else {
|
||||
return h("div", 0);
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "审核状态",
|
||||
key: "isAuth",
|
||||
width: 120,
|
||||
render: (h, params) => {
|
||||
if (params.row.isAuth == "PASS") {
|
||||
return h("div", [
|
||||
h("Badge", {
|
||||
props: {
|
||||
status: "success",
|
||||
text: "审核通过",
|
||||
},
|
||||
}),
|
||||
]);
|
||||
} else if (params.row.isAuth == "TOBEAUDITED") {
|
||||
return h("div", [
|
||||
h("Badge", {
|
||||
props: {
|
||||
status: "error",
|
||||
text: "待审核",
|
||||
},
|
||||
}),
|
||||
]);
|
||||
} else if (params.row.isAuth == "REFUSE") {
|
||||
return h("div", [
|
||||
h("Badge", {
|
||||
props: {
|
||||
status: "error",
|
||||
text: "审核拒绝",
|
||||
},
|
||||
}),
|
||||
]);
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "上架状态",
|
||||
key: "marketEnable",
|
||||
width: 130,
|
||||
sortable: false,
|
||||
render: (h, params) => {
|
||||
if (params.row.marketEnable == "DOWN") {
|
||||
return h("div", [
|
||||
h("Badge", {
|
||||
props: {
|
||||
status: "error",
|
||||
text: "下架",
|
||||
},
|
||||
}),
|
||||
]);
|
||||
} else if (params.row.marketEnable == "UPPER") {
|
||||
return h("div", [
|
||||
h("Badge", {
|
||||
props: {
|
||||
status: "success",
|
||||
text: "上架",
|
||||
},
|
||||
}),
|
||||
]);
|
||||
} else {
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
title: "操作",
|
||||
key: "action",
|
||||
align: "center",
|
||||
width: 200,
|
||||
render: (h, params) => {
|
||||
let enableOrDisable = "";
|
||||
let showEditStock = "";
|
||||
if (params.row.marketEnable == "DOWN") {
|
||||
enableOrDisable = h(
|
||||
"Button",
|
||||
{
|
||||
props: {
|
||||
size: "small",
|
||||
type: "success",
|
||||
},
|
||||
style: {
|
||||
marginRight: "5px",
|
||||
},
|
||||
on: {
|
||||
click: () => {
|
||||
this.upper(params.row);
|
||||
},
|
||||
},
|
||||
},
|
||||
"上架"
|
||||
);
|
||||
} else {
|
||||
showEditStock = h(
|
||||
"Button",
|
||||
{
|
||||
props: {
|
||||
type: "default",
|
||||
size: "small",
|
||||
},
|
||||
style: {
|
||||
marginRight: "5px",
|
||||
},
|
||||
on: {
|
||||
click: () => {
|
||||
this.getStockDetail(params.row.id);
|
||||
},
|
||||
},
|
||||
},
|
||||
"库存"
|
||||
);
|
||||
enableOrDisable = h(
|
||||
"Button",
|
||||
{
|
||||
props: {
|
||||
type: "warning",
|
||||
size: "small",
|
||||
},
|
||||
style: {
|
||||
marginRight: "5px",
|
||||
},
|
||||
on: {
|
||||
click: () => {
|
||||
this.lower(params.row);
|
||||
},
|
||||
},
|
||||
},
|
||||
"下架"
|
||||
);
|
||||
}
|
||||
return h("div", [
|
||||
h(
|
||||
"Button",
|
||||
{
|
||||
props: {
|
||||
type: "info",
|
||||
size: "small",
|
||||
},
|
||||
style: {
|
||||
marginRight: "5px",
|
||||
},
|
||||
on: {
|
||||
click: () => {
|
||||
this.editGoods(params.row);
|
||||
},
|
||||
},
|
||||
},
|
||||
"编辑"
|
||||
),
|
||||
showEditStock,
|
||||
enableOrDisable,
|
||||
]);
|
||||
},
|
||||
},
|
||||
],
|
||||
data: [], // 表单数据
|
||||
total: 0, // 表单数据总数
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
init() {
|
||||
this.getDataList();
|
||||
},
|
||||
addGoods() {
|
||||
this.$router.push({ name: "goods-operation" });
|
||||
},
|
||||
editGoods(v) {
|
||||
this.$router.push({ name: "goods-operation-edit", query: { id: v.id } });
|
||||
},
|
||||
|
||||
//批量操作
|
||||
handleDropdown(v) {
|
||||
//批量上架
|
||||
if (v == "uppers") {
|
||||
this.uppers();
|
||||
}
|
||||
//批量下架
|
||||
if (v == "lowers") {
|
||||
this.lowers();
|
||||
}
|
||||
//批量删除商品
|
||||
if (v == "deleteAll") {
|
||||
this.deleteAll();
|
||||
}
|
||||
//批量设置运费模板
|
||||
if (v == "batchShipTemplate") {
|
||||
this.batchShipTemplate();
|
||||
}
|
||||
},
|
||||
getStockDetail(id) {
|
||||
getGoodsSkuListDataSeller({ goodsId: id, pageSize: 1000 }).then((res) => {
|
||||
if (res.success) {
|
||||
this.updateStockModalVisible = true;
|
||||
this.stockAllUpdate = undefined;
|
||||
this.stockList = res.result.records;
|
||||
}
|
||||
});
|
||||
},
|
||||
updateStock() {
|
||||
let updateStockList = this.stockList.map((i) => {
|
||||
let j = { skuId: i.id, quantity: i.quantity };
|
||||
if (this.stockAllUpdate) {
|
||||
j.quantity = this.stockAllUpdate;
|
||||
}
|
||||
return j;
|
||||
});
|
||||
updateGoodsSkuStocks(updateStockList).then((res) => {
|
||||
if (res.success) {
|
||||
this.updateStockModalVisible = false;
|
||||
this.$Message.success("更新库存成功");
|
||||
}
|
||||
});
|
||||
},
|
||||
changePage(v) {
|
||||
this.searchForm.pageNumber = v;
|
||||
this.getDataList();
|
||||
this.clearSelectAll();
|
||||
},
|
||||
changePageSize(v) {
|
||||
this.searchForm.pageSize = v;
|
||||
this.getDataList();
|
||||
},
|
||||
handleSearch() {
|
||||
this.searchForm.pageNumber = 1;
|
||||
this.searchForm.pageSize = 10;
|
||||
this.getDataList();
|
||||
},
|
||||
handleReset() {
|
||||
this.$refs.searchForm.resetFields();
|
||||
this.searchForm.pageNumber = 1;
|
||||
this.searchForm.pageSize = 10;
|
||||
// 重新加载数据
|
||||
this.getDataList();
|
||||
},
|
||||
changeSort(e) {
|
||||
this.searchForm.sort = e.key;
|
||||
this.searchForm.order = e.order;
|
||||
if (e.order === "normal") {
|
||||
this.searchForm.order = "";
|
||||
}
|
||||
this.getDataList();
|
||||
},
|
||||
clearSelectAll() {
|
||||
this.$refs.table.selectAll(false);
|
||||
},
|
||||
changeSelect(e) {
|
||||
this.selectList = e;
|
||||
this.selectCount = e.length;
|
||||
},
|
||||
//保存运费模板信息
|
||||
saveShipTemplate() {
|
||||
if (this.shipTemplateForm.freightPayer == "BUYER") {
|
||||
{
|
||||
this.shipTemplateForm.templateId = 0;
|
||||
}
|
||||
}
|
||||
this.$Modal.confirm({
|
||||
title: "确认设置运费模板",
|
||||
content:
|
||||
"您确认要设置所选的 " + this.selectCount + " 个商品的运费模板?",
|
||||
loading: true,
|
||||
onOk: () => {
|
||||
let ids = [];
|
||||
this.selectList.forEach(function (e) {
|
||||
ids.push(e.id);
|
||||
});
|
||||
// 批量设置运费模板
|
||||
batchShipTemplate(this.shipTemplateForm).then((res) => {
|
||||
this.$Modal.remove();
|
||||
if (res.success) {
|
||||
this.$Message.success("运费模板设置成功");
|
||||
this.clearSelectAll();
|
||||
this.getDataList();
|
||||
}
|
||||
this.shipTemplateModal = false;
|
||||
});
|
||||
},
|
||||
});
|
||||
},
|
||||
//批量设置运费模板
|
||||
batchShipTemplate() {
|
||||
if (this.selectCount <= 0) {
|
||||
this.$Message.warning("您还未选择要设置运费模板的商品");
|
||||
return;
|
||||
}
|
||||
let data = [];
|
||||
this.selectList.forEach(function (e) {
|
||||
data.push(e.id);
|
||||
});
|
||||
this.shipTemplateForm.goodsId = data;
|
||||
this.shipTemplateModal = true;
|
||||
},
|
||||
//运费承担者变化
|
||||
logisticsTemplateUndertakerChange(v) {
|
||||
//如果是卖家承担运费 需要显示运费模板
|
||||
if (v == "STORE") {
|
||||
API_Store.getShipTemplate().then((res) => {
|
||||
if (res.success) {
|
||||
this.logisticsTemplate = res.result;
|
||||
}
|
||||
});
|
||||
this.shipTemplateShow = true;
|
||||
}
|
||||
if (v == "BUYER") {
|
||||
this.shipTemplateShow = false;
|
||||
}
|
||||
},
|
||||
getDataList() {
|
||||
this.loading = true;
|
||||
// 带多条件搜索参数获取表单数据
|
||||
getGoodsListDataSeller(this.searchForm).then((res) => {
|
||||
this.loading = false;
|
||||
if (res.success) {
|
||||
this.data = res.result.records;
|
||||
this.total = res.result.total;
|
||||
}
|
||||
});
|
||||
},
|
||||
//下架商品
|
||||
lower(v) {
|
||||
this.$Modal.confirm({
|
||||
title: "确认下架",
|
||||
content: "您确认要下架 " + v.goodsName + " ?",
|
||||
loading: true,
|
||||
onOk: () => {
|
||||
let params = {
|
||||
goodsId: v.id,
|
||||
};
|
||||
lowGoods(params).then((res) => {
|
||||
this.$Modal.remove();
|
||||
if (res.success) {
|
||||
this.$Message.success("下架成功");
|
||||
this.getDataList();
|
||||
}
|
||||
});
|
||||
},
|
||||
});
|
||||
},
|
||||
//批量下架
|
||||
lowers() {
|
||||
if (this.selectCount <= 0) {
|
||||
this.$Message.warning("您还未选择要下架的商品");
|
||||
return;
|
||||
}
|
||||
this.$Modal.confirm({
|
||||
title: "确认下架",
|
||||
content: "您确认要下架所选的 " + this.selectCount + " 个商品?",
|
||||
loading: true,
|
||||
onOk: () => {
|
||||
let ids = [];
|
||||
this.selectList.forEach(function (e) {
|
||||
ids.push(e.id);
|
||||
});
|
||||
let params = {
|
||||
goodsId: ids.toString(),
|
||||
};
|
||||
// 批量上架
|
||||
lowGoods(params).then((res) => {
|
||||
this.$Modal.remove();
|
||||
if (res.success) {
|
||||
this.$Message.success("下架成功");
|
||||
this.clearSelectAll();
|
||||
this.getDataList();
|
||||
}
|
||||
});
|
||||
},
|
||||
});
|
||||
},
|
||||
//批量删除商品
|
||||
deleteAll() {
|
||||
if (this.selectCount <= 0) {
|
||||
this.$Message.warning("您还未选择要删除的商品");
|
||||
return;
|
||||
}
|
||||
this.$Modal.confirm({
|
||||
title: "确认删除",
|
||||
content: "您确认要删除所选的 " + this.selectCount + " 个商品?",
|
||||
loading: true,
|
||||
onOk: () => {
|
||||
let ids = [];
|
||||
this.selectList.forEach(function (e) {
|
||||
ids.push(e.id);
|
||||
});
|
||||
let params = {
|
||||
goodsId: ids.toString(),
|
||||
};
|
||||
// 批量删除
|
||||
deleteGoods(params).then((res) => {
|
||||
this.$Modal.remove();
|
||||
if (res.success) {
|
||||
this.$Message.success("删除成功");
|
||||
this.clearSelectAll();
|
||||
this.getDataList();
|
||||
}
|
||||
});
|
||||
},
|
||||
});
|
||||
},
|
||||
//批量上架
|
||||
uppers(v) {
|
||||
if (this.selectCount <= 0) {
|
||||
this.$Message.warning("您还未选择要上架的商品");
|
||||
return;
|
||||
}
|
||||
this.$Modal.confirm({
|
||||
title: "确认上架",
|
||||
content: "您确认要上架所选的 " + this.selectCount + " 个商品?",
|
||||
loading: true,
|
||||
onOk: () => {
|
||||
let ids = [];
|
||||
this.selectList.forEach(function (e) {
|
||||
ids.push(e.id);
|
||||
});
|
||||
let params = {
|
||||
goodsId: ids.toString(),
|
||||
};
|
||||
// 批量上架
|
||||
upGoods(params).then((res) => {
|
||||
this.$Modal.remove();
|
||||
if (res.success) {
|
||||
this.$Message.success("上架成功");
|
||||
this.clearSelectAll();
|
||||
this.getDataList();
|
||||
}
|
||||
});
|
||||
},
|
||||
});
|
||||
},
|
||||
upper(v) {
|
||||
this.$Modal.confirm({
|
||||
title: "确认上架",
|
||||
content: "您确认要上架 " + v.goodsName + " ?",
|
||||
loading: true,
|
||||
onOk: () => {
|
||||
let params = {
|
||||
goodsId: v.id,
|
||||
};
|
||||
upGoods(params).then((res) => {
|
||||
this.$Modal.remove();
|
||||
if (res.success) {
|
||||
this.$Message.success("上架成功");
|
||||
this.getDataList();
|
||||
}
|
||||
});
|
||||
},
|
||||
});
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.init();
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
@import "@/styles/table-common.scss";
|
||||
/deep/ .ivu-table-wrapper {
|
||||
width: 100% i !important;
|
||||
}
|
||||
</style>
|
||||
1947
seller/src/views/goods/goods-seller/goodsOperation.vue
Normal file
347
seller/src/views/goods/goods-seller/goodsStock.vue
Normal file
@@ -0,0 +1,347 @@
|
||||
<template>
|
||||
<div class="search">
|
||||
<Row>
|
||||
<Col>
|
||||
<Card>
|
||||
<Row v-show="openSearch" @keydown.enter.native="handleSearch">
|
||||
<Form
|
||||
ref="searchForm"
|
||||
:model="searchForm"
|
||||
inline
|
||||
:label-width="70"
|
||||
class="search-form"
|
||||
>
|
||||
<Form-item label="商品名称" prop="goodsName">
|
||||
<Input
|
||||
type="text"
|
||||
v-model="searchForm.goodsName"
|
||||
placeholder="请输入商品名称"
|
||||
clearable
|
||||
style="width: 200px"
|
||||
/>
|
||||
</Form-item>
|
||||
<span v-if="drop">
|
||||
<Form-item label="状态" prop="status">
|
||||
<Select
|
||||
v-model="searchForm.marketEnable"
|
||||
placeholder="请选择"
|
||||
clearable
|
||||
style="width: 200px"
|
||||
>
|
||||
<Option value="DOWN">下架</Option>
|
||||
<Option value="UPPER">上架</Option>
|
||||
</Select>
|
||||
</Form-item>
|
||||
<Form-item label="商品编号" prop="sn">
|
||||
<Input
|
||||
type="text"
|
||||
v-model="searchForm.sn"
|
||||
placeholder="商品编号"
|
||||
clearable
|
||||
style="width: 200px"
|
||||
/>
|
||||
</Form-item>
|
||||
</span>
|
||||
<Form-item style="margin-left: -35px" class="br">
|
||||
<Button @click="handleSearch" type="primary" icon="ios-search"
|
||||
>搜索</Button
|
||||
>
|
||||
<Button @click="handleReset">重置</Button>
|
||||
<a class="drop-down" @click="dropDown">
|
||||
{{ dropDownContent }}
|
||||
<Icon :type="dropDownIcon"></Icon>
|
||||
</a>
|
||||
</Form-item>
|
||||
</Form>
|
||||
</Row>
|
||||
<Row class="operation">
|
||||
<Button @click="addGoods" icon="md-refresh">添加商品</Button>
|
||||
<Button @click="getDataList" icon="md-refresh">刷新</Button>
|
||||
<Button type="dashed" @click="openSearch = !openSearch">{{
|
||||
openSearch ? "关闭搜索" : "开启搜索"
|
||||
}}</Button>
|
||||
<Button type="dashed" @click="openTip = !openTip">{{
|
||||
openTip ? "关闭提示" : "开启提示"
|
||||
}}</Button>
|
||||
</Row>
|
||||
<Row v-show="openTip">
|
||||
<Alert show-icon>
|
||||
已选择 <span class="select-count">{{ selectCount }}</span> 项
|
||||
<a class="select-clear" @click="clearSelectAll">清空</a>
|
||||
</Alert>
|
||||
</Row>
|
||||
<Row>
|
||||
<Table
|
||||
:loading="loading"
|
||||
border
|
||||
:columns="columns"
|
||||
:data="data"
|
||||
ref="table"
|
||||
sortable="custom"
|
||||
@on-sort-change="changeSort"
|
||||
@on-selection-change="changeSelect"
|
||||
></Table>
|
||||
</Row>
|
||||
<Row type="flex" justify="end" class="page">
|
||||
<Page
|
||||
:current="searchForm.pageNumber"
|
||||
:total="total"
|
||||
:page-size="searchForm.pageSize"
|
||||
@on-change="changePage"
|
||||
@on-page-size-change="changePageSize"
|
||||
:page-size-opts="[10, 20, 50]"
|
||||
size="small"
|
||||
show-total
|
||||
show-elevator
|
||||
show-sizer
|
||||
></Page>
|
||||
</Row>
|
||||
</Card>
|
||||
</Col>
|
||||
</Row>
|
||||
<Modal
|
||||
title="更新库存"
|
||||
v-model="updateStockModalVisible"
|
||||
:mask-closable="false"
|
||||
:width="500"
|
||||
>
|
||||
<Input
|
||||
type="number"
|
||||
v-model="updateStockParam.quantity"
|
||||
/>
|
||||
<div slot="footer">
|
||||
<Button type="text" @click="updateStockModalVisible = false"
|
||||
>取消</Button
|
||||
>
|
||||
<Button type="primary" @click="updateStock">更新</Button>
|
||||
</div>
|
||||
</Modal>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
getGoodsListDataByStockSeller,
|
||||
getGoodsSkuListDataSeller,
|
||||
updateGoodsSkuStocks,
|
||||
upGoods,
|
||||
lowGoods,
|
||||
} from "@/api/goods";
|
||||
export default {
|
||||
name: "goods",
|
||||
components: {},
|
||||
data() {
|
||||
return {
|
||||
id: "", //要操作的id
|
||||
openSearch: true, // 显示搜索
|
||||
openTip: true, // 显示提示
|
||||
loading: true, // 表单加载状态
|
||||
updateStockModalVisible: false, // 更新库存模态框
|
||||
drop: false, // 搜索栏更多选项
|
||||
dropDownContent: "展开",
|
||||
dropDownIcon: "ios-arrow-down",
|
||||
searchForm: {
|
||||
// 搜索框初始化对象
|
||||
pageNumber: 1, // 当前页数
|
||||
pageSize: 10, // 页面大小
|
||||
sort: "create_time", // 默认排序字段
|
||||
order: "desc", // 默认排序方式
|
||||
},
|
||||
updateStockParam: { // 更新库存表单
|
||||
id: 0,
|
||||
quantity: 0,
|
||||
},
|
||||
form: {
|
||||
// 添加或编辑表单对象初始化数据
|
||||
goodsName: "",
|
||||
sn: "",
|
||||
marketEnable: "",
|
||||
price: "",
|
||||
sellerName: "",
|
||||
},
|
||||
selectList: [], // 多选数据
|
||||
selectCount: 0, // 多选计数
|
||||
columns: [ // 表格表头
|
||||
{
|
||||
type: "selection",
|
||||
width: 60,
|
||||
align: "center",
|
||||
},
|
||||
|
||||
{
|
||||
title: "商品缩略图",
|
||||
key: "thumbnail",
|
||||
width: 150,
|
||||
align: "center",
|
||||
render: (h, params) => {
|
||||
return h("img", {
|
||||
attrs: {
|
||||
src: params.row.thumbnail,
|
||||
alt: "加载图片失败",
|
||||
},
|
||||
style: {
|
||||
cursor: "pointer",
|
||||
width: "80px",
|
||||
height: "60px",
|
||||
margin: "10px 0",
|
||||
"object-fit": "contain",
|
||||
},
|
||||
});
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
title: "商品名称",
|
||||
key: "goodsName",
|
||||
minWidth: 120
|
||||
},
|
||||
|
||||
{
|
||||
title: "库存预警数量",
|
||||
key: "stockWarningNum",
|
||||
minWidth: 120
|
||||
},
|
||||
|
||||
{
|
||||
title: "商品库存",
|
||||
key: "quantity",
|
||||
minWidth: 120
|
||||
},
|
||||
|
||||
{
|
||||
title: "操作",
|
||||
key: "action",
|
||||
align: "center",
|
||||
width: 200,
|
||||
render: (h, params) => {
|
||||
return h("div", [
|
||||
h(
|
||||
"Button",
|
||||
{
|
||||
props: {
|
||||
type: "info",
|
||||
size: "small",
|
||||
},
|
||||
style: {
|
||||
marginRight: "5px",
|
||||
},
|
||||
on: {
|
||||
click: () => {
|
||||
this.getUpdateStock(params.row);
|
||||
},
|
||||
},
|
||||
},
|
||||
"库存"
|
||||
)
|
||||
]);
|
||||
},
|
||||
},
|
||||
],
|
||||
data: [], // 表单数据
|
||||
total: 0, // 表单数据总数
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
init() {
|
||||
this.getDataList();
|
||||
},
|
||||
getUpdateStock(row) {
|
||||
this.updateStockParam = {skuId: row.id, quantity: row.quantity};
|
||||
this.updateStockModalVisible = true;
|
||||
},
|
||||
updateStock() {
|
||||
let updateStockList = [this.updateStockParam];
|
||||
updateGoodsSkuStocks(updateStockList).then(res => {
|
||||
if (res.success) {
|
||||
this.updateStockModalVisible = false;
|
||||
this.$Message.success("更新库存成功");
|
||||
this.getDataList();
|
||||
}
|
||||
});
|
||||
},
|
||||
changePage(v) {
|
||||
this.searchForm.pageNumber = v;
|
||||
this.getDataList();
|
||||
this.clearSelectAll();
|
||||
},
|
||||
changePageSize(v) {
|
||||
this.searchForm.pageSize = v;
|
||||
this.getDataList();
|
||||
},
|
||||
handleSearch() {
|
||||
this.searchForm.pageNumber = 1;
|
||||
this.searchForm.pageSize = 10;
|
||||
this.getDataList();
|
||||
},
|
||||
handleReset() {
|
||||
this.$refs.searchForm.resetFields();
|
||||
this.searchForm.pageNumber = 1;
|
||||
this.searchForm.pageSize = 10;
|
||||
// 重新加载数据
|
||||
this.getDataList();
|
||||
},
|
||||
changeSort(e) {
|
||||
this.searchForm.sort = e.key;
|
||||
this.searchForm.order = e.order;
|
||||
if (e.order === "normal") {
|
||||
this.searchForm.order = "";
|
||||
}
|
||||
this.getDataList();
|
||||
},
|
||||
clearSelectAll() {
|
||||
this.$refs.table.selectAll(false);
|
||||
},
|
||||
changeSelect(e) {
|
||||
this.selectList = e;
|
||||
this.selectCount = e.length;
|
||||
},
|
||||
dropDown() {
|
||||
if (this.drop) {
|
||||
this.dropDownContent = "展开";
|
||||
this.dropDownIcon = "ios-arrow-down";
|
||||
} else {
|
||||
this.dropDownContent = "收起";
|
||||
this.dropDownIcon = "ios-arrow-up";
|
||||
}
|
||||
this.drop = !this.drop;
|
||||
},
|
||||
getDataList() {
|
||||
this.loading = true;
|
||||
// 带多条件搜索参数获取表单数据
|
||||
getGoodsListDataByStockSeller(this.searchForm).then((res) => {
|
||||
this.loading = false;
|
||||
if (res.success) {
|
||||
this.data = res.result.goodsSkuIPage.records.map(i =>{
|
||||
i.stockWarningNum = res.result.stockWarningNum
|
||||
return i;
|
||||
});
|
||||
this.total = res.result.goodsSkuIPage.total;
|
||||
}
|
||||
});
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.init();
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.search {
|
||||
.operation {
|
||||
margin-bottom: 2vh;
|
||||
}
|
||||
.select-count {
|
||||
font-weight: 600;
|
||||
color: #40a9ff;
|
||||
}
|
||||
.select-clear {
|
||||
margin-left: 10px;
|
||||
}
|
||||
.page {
|
||||
margin-top: 2vh;
|
||||
}
|
||||
.drop-down {
|
||||
margin-left: 5px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
167
seller/src/views/home/home.scss
Normal file
@@ -0,0 +1,167 @@
|
||||
.card {
|
||||
margin: 10px 10px 20px;
|
||||
padding: 0 20px 20px;
|
||||
background: #fff;
|
||||
border: 1px solid #e7e7e7;
|
||||
|
||||
border-radius: 0.4em;
|
||||
}
|
||||
|
||||
h4 {
|
||||
margin: 20px 0;
|
||||
font-size: 18px;
|
||||
}
|
||||
/deep/ .ivu-icon {
|
||||
margin-right: 10px;
|
||||
}
|
||||
.rate-box {
|
||||
flex: 3.5;
|
||||
margin-top: 50px;
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
> div {
|
||||
padding: 0 20px;
|
||||
|
||||
border-left: 1px solid #ededed;
|
||||
> h5 {
|
||||
|
||||
text-align: center;
|
||||
margin: 10px 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
.bold {
|
||||
font-size: 18px;
|
||||
}
|
||||
.shop-box {
|
||||
flex: 3;
|
||||
display: flex;
|
||||
font-size: 12px;
|
||||
margin-top: 50px;
|
||||
flex-wrap: wrap;
|
||||
justify-content: space-between;
|
||||
margin-left: 20px;
|
||||
> .box-item {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin: 10px 0;
|
||||
justify-content: space-between;
|
||||
}
|
||||
> .title {
|
||||
font-size: 30px;
|
||||
}
|
||||
}
|
||||
.shop {
|
||||
align-items: center;
|
||||
justify-content: flex-start;
|
||||
}
|
||||
.notice-title {
|
||||
margin: 10px 0;
|
||||
font-weight: bold;
|
||||
}
|
||||
.detail-list {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
.detail-title {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: -15px;
|
||||
opacity: 0.3;
|
||||
color: #999;
|
||||
font-size: 21px;
|
||||
text-decoration: initial;
|
||||
transition: 0.35s;
|
||||
}
|
||||
|
||||
.detail-item {
|
||||
cursor: pointer;
|
||||
transition: 0.35s;
|
||||
position: relative;
|
||||
font-weight: bold;
|
||||
width: 286px;
|
||||
display: flex;
|
||||
/deep/ span {
|
||||
color: $theme_color;
|
||||
font-size: 18px;
|
||||
}
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 20px;
|
||||
background: #eee;
|
||||
border-radius: 0.4em;
|
||||
margin: 10px;
|
||||
> div {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
margin: 0 20px;
|
||||
}
|
||||
}
|
||||
.detail-item:hover {
|
||||
box-shadow: 3px 5px 12px rgba(0, 0, 0, 0.2);
|
||||
transform: translateY(-4px);
|
||||
> .detail-title {
|
||||
opacity: 1;
|
||||
|
||||
top: 5px;
|
||||
}
|
||||
}
|
||||
|
||||
.shop-logo {
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
border-radius: 50%;
|
||||
border: 3px solid #ededed;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.count-item,
|
||||
.todo-item {
|
||||
height: 84px;
|
||||
display: flex;
|
||||
cursor: pointer;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
color: #fff;
|
||||
border-radius: 0.4em;
|
||||
flex: 1;
|
||||
font-weight: bold;
|
||||
margin-right: 20px;
|
||||
}
|
||||
|
||||
.card {
|
||||
box-shadow: 1px 3px 12px rgba($color: #e7e7e7, $alpha: 0.3);
|
||||
border-radius: 0.4em;
|
||||
box-shadow: 1px 3px 12px rgba($color: #e7e7e7, $alpha: 0.3);
|
||||
}
|
||||
|
||||
.box-left {
|
||||
flex: 8;
|
||||
}
|
||||
.box-right {
|
||||
flex: 2;
|
||||
margin-left: 20px;
|
||||
}
|
||||
|
||||
.count-item:nth-of-type(1) {
|
||||
background-image: linear-gradient(109.6deg, rgba($color: #ff9a76, $alpha: 0.6) 11.2%, #ff9a76 100.2%);
|
||||
|
||||
box-shadow: 1px 3px 12px rgba($color: #ff9a76, $alpha: 0.3);
|
||||
}
|
||||
.count-item:nth-of-type(2) {
|
||||
background-image: linear-gradient(109.6deg, rgba($color: #4e89ae, $alpha: 0.6) 11.2%, #4e89ae 100.2%);
|
||||
|
||||
box-shadow: 1px 3px 12px rgba($color: #4e89ae, $alpha: 0.3);
|
||||
}
|
||||
.count-item:nth-of-type(3) {
|
||||
background-image: linear-gradient(109.6deg, rgba($color: #679b9b, $alpha: 0.6) 11.2%, #679b9b 100.2%);
|
||||
|
||||
box-shadow: 1px 3px 12px rgba($color: #679b9b, $alpha: 0.3);
|
||||
}
|
||||
.count-item:nth-of-type(4) {
|
||||
background-image: linear-gradient(109.6deg, rgba($color: #637373, $alpha: 0.6) 11.2%, #637373 100.2%);
|
||||
|
||||
box-shadow: 1px 3px 12px rgba($color: #637373, $alpha: 0.3);
|
||||
}
|
||||
259
seller/src/views/home/home.vue
Normal file
@@ -0,0 +1,259 @@
|
||||
<template>
|
||||
<div>
|
||||
|
||||
<Modal v-model="noticeFlage" :title="noticesDetail.title">
|
||||
<div v-if="noticesDetail" v-html="noticesDetail.content">
|
||||
|
||||
</div>
|
||||
</Modal>
|
||||
<div class="box flex">
|
||||
<div class="box-left">
|
||||
<div class="card shop flex">
|
||||
<div>
|
||||
<h4>Hi,<span style="margin-left:5px;">{{userData.nickName}}</span></h4>
|
||||
<img class="shop-logo" :src="userData.storeLogo || require('@/assets/logo1.png')" alt="">
|
||||
</div>
|
||||
<div class="shop-box">
|
||||
<div class="box-item">
|
||||
<div>店铺名称:{{userData.storeName || '暂无'}}</div>
|
||||
|
||||
</div>
|
||||
<div class="box-item">
|
||||
<div>店铺状态:{{userData.storeDisable=='OPEN' ? '开启中' : '关闭'}}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="rate-box">
|
||||
<div>
|
||||
<i-circle :size="120" stroke-color="#fecb89" :trail-width="4" :stroke-width="5" :percent="(userData.serviceScore * 20)" stroke-linecap="square">
|
||||
<div class="demo-Circle-custom">
|
||||
|
||||
<p class="bold">{{userData.serviceScore}}分</p>
|
||||
</div>
|
||||
</i-circle>
|
||||
<h5>服务得分</h5>
|
||||
</div>
|
||||
<div>
|
||||
<i-circle :size="120" stroke-color="#a7c5eb" :trail-width="4" :stroke-width="5" :percent="(userData.deliveryScore * 20)" stroke-linecap="square">
|
||||
<div>
|
||||
|
||||
<p class="bold">{{userData.deliveryScore}}分</p>
|
||||
</div>
|
||||
</i-circle>
|
||||
<h5>交货得分</h5>
|
||||
</div>
|
||||
<div>
|
||||
<i-circle :size="120" stroke-color="#848ccf" :trail-width="4" :stroke-width="5" :percent="(userData.descriptionScore * 20)" stroke-linecap="square">
|
||||
<div>
|
||||
<p class="bold">{{userData.descriptionScore}}分</p>
|
||||
</div>
|
||||
</i-circle>
|
||||
<h5>评价得分</h5>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<h4>待办事项</h4>
|
||||
|
||||
<div class="detail-list">
|
||||
<div class="detail-item" @click="navigateTo('order')">
|
||||
<div>
|
||||
<span>{{homeData.unPaidOrder || 0}}</span>
|
||||
<div>待付款</div>
|
||||
</div>
|
||||
<div class="detail-title">
|
||||
交易前
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="detail-item" @click="navigateTo('order')">
|
||||
<div>
|
||||
<span>{{homeData.unDeliveredOrder || 0}}</span>
|
||||
<div>待发货</div>
|
||||
</div>
|
||||
<div>
|
||||
<span>{{homeData.deliveredOrder || 0}}</span>
|
||||
<div>待收货</div>
|
||||
</div>
|
||||
<div class="detail-title">
|
||||
交易中
|
||||
</div>
|
||||
</div>
|
||||
<div class="detail-item">
|
||||
<div @click="navigateTo('returnMoneyOrder')">
|
||||
<span>{{homeData.returnMoney || 0}}</span>
|
||||
<div>退款</div>
|
||||
</div>
|
||||
<div @click="navigateTo('returnGoodsOrder')">
|
||||
<span>{{homeData.returnGoods || 0}}</span>
|
||||
<div>退货</div>
|
||||
</div>
|
||||
<div @click="navigateTo('memberComment')">
|
||||
<span>{{homeData.commentNum || 0}}</span>
|
||||
<div>待评价</div>
|
||||
</div>
|
||||
<div class="detail-title">
|
||||
交易后
|
||||
</div>
|
||||
</div>
|
||||
<div class="detail-item" @click="navigateTo('orderComplaint')">
|
||||
<div>
|
||||
<span>{{homeData.deliveredOrder || 0}}</span>
|
||||
<div>待处理</div>
|
||||
</div>
|
||||
|
||||
<div class="detail-title">
|
||||
投诉
|
||||
</div>
|
||||
</div>
|
||||
<div class="detail-item" @click="navigateTo('goods')">
|
||||
<div>
|
||||
<span>{{homeData.waitUpper || 0}}</span>
|
||||
<div>待上架</div>
|
||||
</div>
|
||||
<div>
|
||||
<span>{{homeData.waitAuth || 0}}</span>
|
||||
<div>审核中</div>
|
||||
</div>
|
||||
<div class="detail-title">
|
||||
商品
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="detail-item">
|
||||
<div>
|
||||
<span>{{homeData.seckillNum || 0}}</span>
|
||||
<div>待参加活动</div>
|
||||
</div>
|
||||
<div>
|
||||
<span>{{homeData.waitPayBill || 0}}</span>
|
||||
<div>待对账</div>
|
||||
</div>
|
||||
<div class="detail-title">
|
||||
其他
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 公告 -->
|
||||
<div class="card box-right">
|
||||
<h4>平台公告</h4>
|
||||
<div>
|
||||
<div class="notice-title" v-for="(item,index) in notices" :key="index">
|
||||
<a @click="clickLinkNotices(item)">{{item.title}}</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card ">
|
||||
<h4>整体数据</h4>
|
||||
<div class="count-list flex">
|
||||
<div class="count-item" @click="navigateTo('goods')">
|
||||
<div>
|
||||
<Icon class="icon" size="31" type="md-photos" />
|
||||
</div>
|
||||
<div>
|
||||
<div class="counts">{{homeData.goodsNum ||0}}</div>
|
||||
<div>商品数量</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="count-item">
|
||||
<div>
|
||||
<Icon class="icon" size="31" type="ios-card" />
|
||||
</div>
|
||||
<div>
|
||||
<div class="counts">{{homeData.orderPrice ||0}}</div>
|
||||
<div>订单总额</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="count-item" @click="navigateTo('order')">
|
||||
<div>
|
||||
|
||||
<Icon class="icon" size="31" type="md-list" />
|
||||
</div>
|
||||
<div>
|
||||
<div class="counts">{{homeData.orderNum ||0}}</div>
|
||||
<div>订单数量</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="count-item">
|
||||
<div>
|
||||
<Icon class="icon" size="31" type="md-person" />
|
||||
</div>
|
||||
<div>
|
||||
<div class="counts">{{homeData.storeUV ||0}}</div>
|
||||
<div>访客数量</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getSellerHomeData, getHomeNotice } from "@/api/index";
|
||||
import { seeArticle } from "@/api/pages";
|
||||
import Cookies from "js-cookie";
|
||||
|
||||
export default {
|
||||
name: "home",
|
||||
data() {
|
||||
return {
|
||||
noticeFlage: false, // 控制平台公告显隐
|
||||
|
||||
homeData: {}, // 首页数据
|
||||
userData: "", // 店铺信息
|
||||
notices: "", // 平台公告列表
|
||||
noticesDetail: { // 平台公告详情
|
||||
title: "",
|
||||
},
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
navigateTo(name) {
|
||||
this.$router.push({
|
||||
name,
|
||||
});
|
||||
},
|
||||
async init() {
|
||||
let userInfo = JSON.parse(Cookies.get("userInfo"));
|
||||
|
||||
this.userData = userInfo;
|
||||
|
||||
let res = await getHomeNotice();
|
||||
if (res.success) {
|
||||
this.notices = res.result.records;
|
||||
}
|
||||
},
|
||||
|
||||
async clickLinkNotices(val) {
|
||||
let res = await seeArticle(val.id);
|
||||
if (res.success) {
|
||||
this.noticesDetail = res.result;
|
||||
this.noticeFlage = true;
|
||||
}
|
||||
},
|
||||
|
||||
async getHomeData() {
|
||||
let res = await getSellerHomeData();
|
||||
if (res.success) {
|
||||
this.homeData = res.result;
|
||||
}
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.init();
|
||||
this.getHomeData();
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
@import "./home.scss";
|
||||
</style>
|
||||