Commit 382a244b by 前端

Merge branch 'v3.9.0' into 'master'

V3.9.0 ==> master

See merge request !1
2 parents 481cc6b8 039279da
Showing 68 changed files with 4096 additions and 0 deletions
NODE_ENV='development'
# must start with VUE_APP_
VUE_APP_ENV = 'development'
VUE_APP_PORT = 6658
NODE_ENV='production'
# must start with VUE_APP_
VUE_APP_ENV = 'production'
\ No newline at end of file \ No newline at end of file
{
"root": true,
"env": {
"node": true
},
"extends": ["plugin:vue/essential", "@vue/prettier"],
"rules": {
"no-console": "off",
"no-unused-vars":"off",
"prettier.endOfLine": "crlf",
"endOfLine":"auto"
},
"parserOptions": {
"parser": "babel-eslint"
}
}
.DS_Store
node_modules
/dist
# local env files
.env.local
.env.*.local
# Log files
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
{
"printWidth": 800,
"tabWidth": 2,
"singleQuote": true,
"trailingComma": "none",
"semi": false,
"wrap_line_length": 820,
"wrap_attributes": "auto",
"proseWrap": "always",
"arrowParens": "avoid",
"bracketSpacing": true,
"htmlWhitespaceSensitivity": "ignore",
"javascript.format.insertSpaceBeforeFunctionParenthesis": true,
"jsxBracketSameLine": true,
"files.insertFinalNewline": true,
"useTabs": false,
"eslintIntegration": true,
"overrides": [
{
"files": ".prettierrc",
"options": {
"parser": "json"
}
}
],
"endOfLine": "auto"
}
# subapp-blog
微前端博客子应用
## Project setup
```
npm install
```
### Compiles and hot-reloads for development
```
npm run serve
```
### Compiles and minifies for production
```
npm run build
```
### Lints and fixes files
```
npm run lint
```
### Customize configuration
See [Configuration Reference](https://cli.vuejs.org/config/).
module.exports = {
presets: ["@vue/cli-plugin-babel/preset"],
plugins: [
[
"component",
{
libraryName: "element-ui",
styleLibraryName: "theme-chalk"
}
]
]
};
This diff could not be displayed because it is too large.
{
"name": "mall",
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint"
},
"dependencies": {
"core-js": "^3.4.4",
"el-tree-transfer": "^2.2.6",
"element-ui": "^2.4.5",
"glsx-common": "^1.4.6",
"glsx-components": "^1.5.7",
"lodash": "^4.17.21",
"vue": "^2.6.10",
"vue-router": "^3.1.3",
"vuex": "^3.1.2"
},
"devDependencies": {
"@vue/cli-plugin-babel": "^4.1.0",
"@vue/cli-plugin-eslint": "^4.1.0",
"@vue/cli-plugin-router": "^4.1.0",
"@vue/cli-plugin-vuex": "^4.1.0",
"@vue/cli-service": "^4.1.0",
"@vue/eslint-config-prettier": "^5.0.0",
"babel-eslint": "^10.0.3",
"babel-plugin-component": "^1.1.1",
"eslint": "^5.16.0",
"eslint-plugin-prettier": "^3.1.1",
"eslint-plugin-vue": "^5.0.0",
"node-sass": "^4.14.1",
"prettier": "^1.19.1",
"sass-loader": "^8.0.0",
"vue-cli-plugin-element": "^1.0.1",
"vue-template-compiler": "^2.6.10"
},
"browserslist": [
"> 1%",
"last 2 versions"
]
}
No preview for this file type
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<meta name="referrer" content="never">
<meta name="referrer" content="no-referrer">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<!-- 使用CDN的CSS文件 -->
<% for (var i in htmlWebpackPlugin.options.cdn && htmlWebpackPlugin.options.cdn.css) { %>
<link href="<%= htmlWebpackPlugin.options.cdn.css[i] %>" rel="preload" as="style" />
<link href="<%= htmlWebpackPlugin.options.cdn.css[i] %>" rel="stylesheet" />
<% } %>
<!-- 使用CDN的JS文件 预加载 -->
<% for (var i in htmlWebpackPlugin.options.cdn && htmlWebpackPlugin.options.cdn.js) { %>
<link href="<%= htmlWebpackPlugin.options.cdn.js[i] %>" rel="preload" as="script" />
<% } %>
<title>微前端子应用:博客</title>
</head>
<body>
<noscript>
<strong>We're sorry but module-report doesn't work properly without JavaScript enabled. Please enable it to
continue.</strong>
</noscript>
<div id="app"></div>
<!-- built files will be auto injected -->
<% for (var i in htmlWebpackPlugin.options.cdn && htmlWebpackPlugin.options.cdn.js) { %>
<script src="<%= htmlWebpackPlugin.options.cdn.js[i] %>"></script>
<% } %>
</body>
</html>
\ No newline at end of file \ No newline at end of file
var express = require('express')
// var history = require('connect-history-api-fallback')
var cors = require('cors')
var app = express()
// app.use(history())
app.use(cors())
app.use(express.static('./dist'))
app.get('/', function(req, res) {
res.send('Hello jq')
})
const port = 6652
app.listen(port)
// console.log(`服务已运行:\r\n http://127.0.0.1:${port}`)
\ No newline at end of file \ No newline at end of file
<template>
<div id="app">
<router-view />
</div>
</template>
<script>
export default {
name: 'report-app',
props: {
msg: String,
message: String
},
data() {
return {
myMsg: '',
gs: ''
}
},
created() {
this.myMsg = this.msg
this.myMessage = this.message
}
}
</script>
<style lang="scss">
.parent-child-communication {
padding: 20px 0;
line-height: 36px;
}
// #app {
// background: #f4f5fa;
// padding: 0px 20px 20px 20px !important;
// position: absolute;
// box-sizing: border-box;
// width: 100%;
// top: 0px;
// left: 0px;
// overflow-y: auto;
// height: 100%;
// }
// 分页全局
.pagination_box {
display:flex;
justify-content: flex-end;
}
</style>
/*
所有模块都定义在 modules
|-modules
|----demo.js
|----demo1.js
|----...
|-index.js ---动态对外暴露所有模块 无须手动添加
参考demo.js 用法 : this.$apis.demo.GETLISTDEVICEFILEUNSTOCK(...)
*/
const modulesFiles = require.context('./modules', true, /\.js$/)
const modules = modulesFiles.keys().reduce((modules, modulePath) => {
const moduleName = modulePath.replace(/^\.\/(.*)\.\w+$/, '$1')
const value = modulesFiles(modulePath)
modules[moduleName] = value.default
return modules
}, {})
export default modules
import { http, http_brand } from '@/main'
const defaultPath = 'scrm.api.equity.service.package.'
const orderPath = 'scrm.api.equity.service.order.'
const getUserInfoApi = params => {
params.method = 'scrm.api.equity.common.merchant.current.det'
return http({
url: 'rop-scrm-equity/router',
method: 'GET',
data: params,
sign: true
})
}
const getCountNoDataApi = params => {
params.method = `${defaultPath}count.unDataEffective`
return http({
url: 'rop-scrm-equity/router',
method: 'GET',
data: params,
sign: true
})
}
const getListApi = params => {
params.method = `${defaultPath}order.list.get`
return http({
url: 'rop-scrm-equity/router',
method: 'GET',
data: params,
sign: true
})
}
// 获取门店
const getMerchantApi = params => {
params.method = 'scrm.api.equity.common.under.merchant.list.det'
return http({
url: 'rop-scrm-equity/router',
method: 'GET',
data: params,
sign: true
})
}
const getExportApi = params => {
params.method = `scrm.api.equity.service.package.dj.order.export.get`
return http({
url: 'rop-scrm-equity/router',
method: 'GET',
data: params,
sign: true
})
}
// 打印合同
const getPriteApi = params => {
params.method = `scrm.api.equity.service.package.dj.order.print`
return http({
url: 'rop-scrm-equity/router',
method: 'GET',
data: params,
sign: true
})
}
const getCarBrandListApi = params => {
// params.method = 'dj.api.car.series.list'
params.method = 'scrm.api.carlife.common.getCarBrandList'
return http_brand({
url: 'rop-scrm-carlife/router',
method: 'GET',
data: params,
sign: true
})
}
const getCarChildListApi = params => {
// params.method = 'dj.api.car.series.list'
params.method = 'scrm.api.carlife.common.getOnlyCarBrandList'
return http_brand({
url: 'rop-scrm-carlife/router',
method: 'GET',
data: params,
sign: true
})
}
const getCarSeriesListApi = params => {
params.method = 'scrm.api.carlife.common.getCarSeriesList'
return http_brand({
url: 'rop-scrm-carlife/router',
method: 'GET',
data: params,
sign: true
})
}
const getCarTypeListApi = params => {
params.method = 'scrm.api.carlife.common.getCarTypeList'
return http_brand({
url: 'rop-scrm-carlife/router',
method: 'GET',
data: params,
sign: true
})
}
const getHotlineApi = params => {
// params.method = `${defaultPath}merchant.hotline.get`
params.method = `scrm.api.equity.service.package.merchant.config.get`
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true
})
}
const getDefaultCarbrandApi = params => {
params.method = 'scrm.api.equity.service.merchant.vehicle.default.detail'
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true
})
}
const updateHotlineApi = params => {
params.method = `${defaultPath}merchant.hotline.update`
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
const updateCarBrandApi = params => {
params.method = 'scrm.api.equity.service.merchant.vehicle.default.insert.or.update'
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
// 获取产品名称(套餐名称)
const getProListApi = params => {
params.method = `${defaultPath}select.get`
return http({
url: 'rop-scrm-equity/router',
method: 'GET',
data: params,
sign: true
})
}
// 获取无忧卡套餐列表
const getPackageListApi = params => {
params.method = `scrm.api.equity.service.package.dj.list.get`
// params.method = `scrm.api.equity.service.package.list.get`
return http({
url: 'rop-scrm-equity/router',
method: 'GET',
data: params,
sign: true
})
}
const getEquityApi = params => {
params.method = `scrm.api.equity.service.channel.order.detail`
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true
})
}
const updateEquityApi = params => {
params.method = `scrm.api.equity.service.channel.order.insert.or.update`
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
// 获取合同号
const createCodeApi = params => {
params.method = `${orderPath}code.create`
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true
})
}
// 获取套菜附件属性
const getOrderAttrApi = params => {
params.method = `${defaultPath}order.attachment.get`
return http({
url: 'rop-scrm-equity/router',
method: 'GET',
data: params,
sign: true
})
}
// 获取套菜附件属性
// const getOrderValueApi = params => {
// params.method = `${defaultPath}order.attachment.value.get`
// return http({
// url: 'rop-scrm-equity/router',
// method: 'GET',
// data: params,
// sign: true
// })
// }
const getAllOrderValueApi = params => {
params.method = `${defaultPath}order.attachments.value.get`
return http({
url: 'rop-scrm-equity/router',
method: 'GET',
data: params,
sign: true
})
}
// 校验
const verifyOrderApi = params => {
params.method = 'scrm.api.equity.service.order.verify'
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
// 车架号
const checkOrderApi = params => {
params.method = 'scrm.api.equity.service.order.check'
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
// 更新套菜附件属性
const updateOrderApi = params => {
params.method = `${orderPath}attachment.update`
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
const uploadImgApi = params => {
params.method = 'scrm.api.equity.common.upload.image'
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true,
noSignAttr: ['file']
})
}
// 退保
const backOrderApi = params => {
params.method = `scrm.api.equity.service.channel.order.charge.back`
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
// 审核
const aduitOrderApi = params => {
params.method = `${orderPath}aduit`
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
// 是否开通配置
const judgeSetting = params => {
params.method = 'scrm.api.equity.service.merchant.config.get'
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
// 获取特别约定
const spaAgressData = params => {
params.method = 'scrm.api.equity.service.spa.list.get'
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true
})
}
// 店铺信息
const merchantInfo = params => {
params.method = 'scrm.api.equity.common.merchant.detail.det'
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true
})
}
// 卡号---获取期限
const dateBycarNo = params => {
params.method = 'scrm.api.equity.service.cfc.get.by.seqno'
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true
})
}
// 获取活码列表-
const activeCodeList = params => {
params.method = 'entmicro.api.code.getFreeChannelCode'
return http({
url: 'rop-scrm-entmicro/router',
method: 'POST',
data: params,
sign: true
})
}
// 更新活码
const updateActiveCode = params => {
params.method = 'scrm.api.equity.service.merchant.qrcode.update'
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true
})
}
// 获取汇总订单列表
const getOrdersummary = params => {
params.method = 'scrm.api.equity.service.order.summary.page'
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true
})
}
// 获取汇总产品列表
const getSummaryPackage = params => {
params.method = 'scrm.api.equity.service.summary.package'
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true
})
}
const getSummaryExportApi = params => {
params.method = `scrm.api.equity.service.order.summary.export`
return http({
url: 'rop-scrm-equity/router',
method: 'GET',
data: params,
sign: true
})
}
export default { getOrdersummary, getSummaryPackage, getSummaryExportApi, getUserInfoApi, getCountNoDataApi, getListApi, getMerchantApi, getExportApi, getPriteApi, getCarBrandListApi, getCarChildListApi, getCarTypeListApi, getCarSeriesListApi, getHotlineApi, getDefaultCarbrandApi, updateHotlineApi, updateCarBrandApi, getProListApi, getPackageListApi, getEquityApi, updateEquityApi, createCodeApi, getOrderAttrApi, getAllOrderValueApi, verifyOrderApi, checkOrderApi, updateOrderApi, uploadImgApi, backOrderApi, aduitOrderApi, judgeSetting, spaAgressData, merchantInfo, dateBycarNo, activeCodeList, updateActiveCode }
import { http } from '@/main'
const defaultPath = 'scrm.api.live.'
const getGoodsList = params => {
params.method = 'scrm.api.shopmall.goods.page.curMerchant'
return http({
url: 'rop-scrm-shopmall/router',
method: 'GET',
data: params,
sign: true
})
}
const uploadImg = params => {
params.method = `${defaultPath}wechat.upload.image`
return http({
url: 'rop-scrm-live/router',
method: 'POST',
data: params,
sign: true,
noSignAttr: ['file']
})
}
const getMerchantList = params => {
params.method = `${defaultPath}get.merchant.list`
return http({
url: 'rop-scrm-live/router',
method: 'POST',
data: params,
sign: true
})
}
const getZoneList = params => {
params.method = `${defaultPath}get.zone.list`
return http({
url: 'rop-scrm-live/router',
method: 'POST',
data: params,
sign: true
})
}
const pictureUpload = params => {
params.method = 'glsx.accounts.biz.common.pictureUpload'
return http({
url: '/router?method=glsx.accounts.biz.common.pictureUpload',
method: 'POST',
data: params,
sign: true,
noSignAttr: ['file']
})
}
const uploadFileApi = (params, callback) => {
params.method = 'scrm.api.equity.common.upload.common.multiple'
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true,
noSignAttr: ['file'],
returnAll: true,
onUploadProgress: res => {
callback(res)
}
})
}
export default { getGoodsList, uploadImg, getMerchantList, getZoneList, pictureUpload, uploadFileApi }
import { http, http_brand, request_merchant } from '@/main'
const getExpertList = params => {
params.method = 'entmicro.api.operation.page'
return http({
url: 'rop-scrm-entmicro/router',
method: 'POST',
data: params,
sign: true
})
}
const getDepartment = params => {
params.method = 'entmicro.api.department.listDepartmentTree'
return http({
url: '/rop-scrm-entmicro/router',
method: 'POST',
data: params,
sign: true
})
}
const saveExpert = params => {
params.method = 'entmicro.api.operation.save'
return http({
url: '/rop-scrm-entmicro/router',
method: 'POST',
data: params,
sign: true
})
}
const delExpert = params => {
params.method = 'entmicro.api.operation.delete'
return http({
url: '/rop-scrm-entmicro/router',
method: 'POST',
data: params,
sign: true
})
}
const editExpert = params => {
params.method = 'entmicro.api.operation.update'
return http({
url: '/rop-scrm-entmicro/router',
method: 'POST',
data: params,
sign: true
})
}
const expertDetail = params => {
params.method = 'entmicro.api.operation.detail'
return http({
url: '/rop-scrm-entmicro/router',
method: 'POST',
data: params,
sign: true
})
}
const getMenberType = params => {
params.method = 'merchants.api.menu.findAllDictData'
return request_merchant({
url: '/rop-merchants/router',
method: 'POST',
data: params,
sign: true
})
}
const getOtherNumber = params => {
params.method = 'entmicro.api.code.getCodeStaffList'
return http({
url: '/rop-scrm-entmicro/router',
method: 'POST',
data: params,
sign: true
})
}
export default { getExpertList, getDepartment, saveExpert, delExpert, editExpert, expertDetail, getMenberType, getOtherNumber }
import { other_http } from '@/main'
const url = 'rop-scrm-coupon/router'
const defaultPath = 'scrm.api.coupon.'
/**商品分页查询*/
const getCouponsList = params => {
params.method = `${defaultPath}equity.list.merchant`
return other_http({
url,
data: params
})
}
const createCoupons = params => {
params.method = `${defaultPath}equity.batch.create`
return other_http({
url,
data: params
})
}
const getExportApi = params => {
params.method = `${defaultPath}equity.list.merchant.export`
return other_http({
url,
data: params,
sign: true
})
}
//领取记录列表
const getListReceiveRecordApi = params => {
params.method = `${defaultPath}listReceiveRecordByCouponId`
return other_http({
url,
method: 'GET',
data: params,
sign: true
})
}
//查看优惠券
const getCouponDetailApi = params => {
params.method = `${defaultPath}detail`
return other_http({
url,
method: 'GET',
data: params,
sign: true
})
}
//删除
const deleteCouponApi = params => {
params.method = `${defaultPath}delete`
return other_http({
url,
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
// 优惠券-作废
const couponUserCancelApi = params => {
params.method = `${defaultPath}user.cancel`
return other_http({
url,
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
const detailExportApi = params => {
params.method = `${defaultPath}equity.exportReceiveRecord`
return other_http({
url,
data: params,
sign: true
})
}
//生效/失效
const effectiveCouponApi = params => {
params.method = `${defaultPath}effective`
return other_http({
url,
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
// 获取模板配置
const getTemplateList = params => {
params.method = `${defaultPath}template.page`
return other_http({
url,
method: 'POST',
data: params,
sign: true
})
}
// 获取模板配置
const saveTemplate = params => {
params.method = `${defaultPath}template.save`
return other_http({
url,
method: 'POST',
data: params,
sign: true
})
}
// 保存模板下的优惠券
const saveCouponInfo = params => {
params.method = `${defaultPath}template.details.save`
return other_http({
url,
method: 'POST',
data: params,
sign: true
})
}
// 获取模板下的优惠券列表
const getCouponById = params => {
if(!params.templateId) {
return new Promise((resolve, reject)=>{
reject()
})
};
params.method = `${defaultPath}template.details.page`
return other_http({
url,
method: 'POST',
data: params,
sign: true
})
}
const delCouponById = params => {
params.method = `${defaultPath}template.details.delete`
return other_http({
url,
method: 'POST',
data: params,
sign: true
})
}
const delTemplateById = params => {
params.method = `${defaultPath}template.delete`
return other_http({
url,
method: 'POST',
data: params,
sign: true
})
}
export default {
getCouponsList,
createCoupons,
getExportApi,
getListReceiveRecordApi,
getCouponDetailApi,
deleteCouponApi,
couponUserCancelApi,
detailExportApi,
effectiveCouponApi,
getTemplateList,
saveTemplate,
saveCouponInfo,
getCouponById,
delCouponById,
delTemplateById
}
import { http } from '@/main'
const defaultPath = 'scrm.api.shopmall.platform.'
const url = 'rop-scrm-shopmall/router'
// 获取平台商品分类
const getCategoryListApi = params => {
params.method = `${defaultPath}goods.category.list`
return http({
url,
data: params,
sign: true
})
}
// 分页查询选品库商品
const getGoodsListApi = params => {
params.method = `${defaultPath}goods.list`
return http({
url,
data: params,
sign: true
})
}
// 平台商品批量入库
const addWarehouseApi = params => {
params.method = `${defaultPath}goods.batch.add`
return http({
url,
data: params,
sign: true
})
}
// 分页查询仓库/销售中商品
const getListApi = params => {
params.method = `${defaultPath}goods.stockroom.page`
return http({
url,
data: params,
sign: true
})
}
// 平台商品批量移出仓库
const batchRemoveApi = params => {
params.method = `${defaultPath}goods.stockroom.batch.remove`
return http({
url,
data: params,
sign: true
})
}
// 平台商品批量上架销售
const batchSaleApi = params => {
params.method = `${defaultPath}goods.stockroom.batch.sale`
return http({
url,
data: params,
sign: true
})
}
// 平台商品批量下架
const batchOffApi = params => {
params.method = `${defaultPath}goods.stockroom.batch.off`
return http({
url,
data: params,
sign: true
})
}
// 商品详情
const goodsDetailApi = params => {
params.method = `scrm.api.shopmall.stockroom.goods.detail`
return http({
url,
data: params,
sign: true
})
}
// 平台商品批量改价
const modifyPriceApi = params => {
params.method = `${defaultPath}goods.stockroom.batch.modify.price`
return http({
url,
data: params,
sign: true
})
}
// 订单列表
const getOrderList = params => {
params.method = `${defaultPath}order.page`
return http({
url,
data: params,
sign: true
})
}
// 订单详情
const getOrderDetail = params => {
params.method = `${defaultPath}order.detail`
return http({
url,
data: params,
sign: true
})
}
// 售后列表
const getSaleOrderList = params => {
params.method = `${defaultPath}after.sales.order.page`
return http({
url,
data: params,
sign: true
})
}
// 订单详情
const getSaleOrderDetail = params => {
params.method = `${defaultPath}after.sales.order.detail`
return http({
url,
data: params,
sign: true
})
}
export default {
getCategoryListApi,
getGoodsListApi,
addWarehouseApi,
getListApi,
batchRemoveApi,
batchSaleApi,
batchOffApi,
goodsDetailApi,
modifyPriceApi,
getOrderList,
getOrderDetail,
getSaleOrderList,
getSaleOrderDetail
}
$theme_color: #5850ff;
$theme_bg_color: #5850ff;
.left {
float: left;
}
.right {
float: right;
}
.align-right {
text-align: right;
}
.left{float:left}.right{float:right}.align-right{text-align:right}
.left {
float: left;
}
.right {
float: right;
}
.align-right {
text-align: right;
}
::-webkit-scrollbar {
/*滚动条整体样式*/
width: 6px;
height: 4px;
}
::-webkit-scrollbar-thumb {
/*滚动条里面小方块*/
border-radius: 4px;
background-color: rgba(144, 147, 153, 0.3);
}
.h1_title {
font-size: 42px;
font-weight: 500;
color: #000000;
}
.h2_title {
font-size: 24px;
font-weight: 500;
color: #000000;
}
.h3_title {
font-size: 18px;
font-weight: 600;
color: #333333;
height: 18px;
}
.h4_title {
font-size: 16px;
font-weight: 400;
color: #666666;
}
.h5_title {
font-size: 14px;
font-weight: 400;
color: #3a3a3a;
}
.h6_title {
font-size: 16px;
font-weight: 500;
color: #3a3a3a;
}
.h7_title {
font-size: 14px;
font-weight: 500;
color: #333333;
}
.h8_title {
font-size: 24px;
font-weight: 600;
color: #3a3a3a;
}
.h9_title {
font-size: 14px;
font-weight: 400;
color: #666666;
}
.h10_title {
font-size: 12px;
font-weight: 400;
color: #3a3a3a;
}
.h11_title {
font-size: 14px;
font-weight: 500;
color: #000000;
}
.h12_title {
font-size: 14px;
font-weight: 400;
color: #888888;
}
.h13_title {
font-size: 14px;
font-weight: 400;
color: #333333;
}
.h14_title {
font-size: 14px;
font-weight: 400;
color: #37383a;
}
.h15_title {
font-size: 14px;
font-weight: 500;
color: #5850ff;
}
.h16_title {
font-size: 12px;
font-weight: 500;
color: #5850ff;
}
.h17_title {
font-size: 12px;
font-weight: 400;
color: #333333;
}
.h18_title {
font-size: 14px;
font-weight: 500;
color: #333333;
}
.h19_title {
font-size: 14px;
font-weight: 500;
color: #666666;
}
.h20_title {
font-size: 12px;
font-weight: 400;
color: #666666;
}
.h21_title {
font-size: 16px;
font-weight: 600;
color: #333333;
}
.flex_scb {
display: flex;
align-items: center;
justify-content: space-between;
}
.flex_cc {
display: flex;
align-items: center;
justify-content: center;
}
.flex_sc {
display: flex;
align-items: center;
}
.flex_ccc {
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
}
.equity-wrap .contain {
background: #ffffff;
margin: 0 0 20px 0;
padding: 20px;
// box-shadow: 0 1px 5px 0 rgba(38, 38, 38, 0.1);
}
.equity-wrap .contain .el-table__empty-text {
display: inline-block;
width: 64px;
height: 41px;
}
.fr-mr0 {
float: right;
margin-right: 0px !important;
}
// 单行省略
.ellipsis-1 {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
-o-text-overflow: ellipsis;
/* for Opera */
}
.mb10 {
margin-bottom: 10px;
}
// 我这里以两行为例,该方法基本兼容市场上面所有主流浏览器。
.ellipsis-2 {
overflow: hidden;
height: 40px;
line-height: 20px;
position: relative;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
/*显示的行数*/
}
.ellipsis-2-text:after {
content: '...';
position: absolute;
bottom: 0;
right: 15px;
padding-left: 20px;
background: -webkit-linear-gradient(left, transparent, #fff 55%);
/*我在Safari上测试时发现透明到白色中间会有一个黑色的过渡后来我就写成-webkit-linear-gradient(left,rgba(255,255,255,0),rgba(255,255,255,1) 55%)*/
background: -o-linear-gradient(left, transparent, #fff 55%);
background: -moz-linear-gradient(left, transparent, #fff 55%);
background: linear-gradient(to right, transparent, #fff 55%);
}
.el-scrollbar__bar.is-horizontal {
height: 10px !important;
left: 10px;
}
.base-container-right .el-main-scroll .el-scrollbar__thumb {
background-color: rgba(144, 147, 153, 0.5) !important;
}
.equity-wrap .el-table .cell {
line-height: 16px;
}
.equity-wrap .table-btns .el-button {
padding: 0 0 0 5px;
margin-left: 5px;
border-left: 1px solid #dcdfe6;
border-radius: 0;
}
.equity-wrap .table-btns .el-button:first-child {
padding: 0;
border: 0;
}
.equity-wrap .img-60 {
width: 60px;
height: 60px;
}
.equity-wrap .edit-container {
margin: 20px 40px 84px;
}
.equity-wrap .footer {
position: absolute;
bottom: 0;
width: 100%;
height: 64px;
text-align: center;
line-height: 64px;
background: #ffffff;
z-index: 999;
}
.equity-wrap .flex {
display: flex;
justify-content: space-between;
}
.equity-wrap .edit-title {
font-size: 16px;
font-weight: bold;
height: 48px;
line-height: 48px;
// color: #0947C6;
border-bottom: 1px solid #e7eaec;
// padding-left: 20px;
margin: 0 0;
}
.equity-wrap .edit-sub-title::before {
position: absolute;
display: inline-block;
content: '';
height: 18px;
width: 4px;
top: 2px;
left: 0;
background-color: #0947c6;
}
.equity-wrap .edit-sub-title {
position: relative;
font-size: 16px;
font-weight: 700;
color: #333333;
margin: 0 0 30px 0;
padding-left: 8px;
}
// .app {
// background: #f4f5fa;
// padding: 0px 0 20px 0;
// position: absolute;
// box-sizing: border-box;
// width: 100%;
// top: 0px;
// left: 0px;
// overflow-y: auto;
// height: 100%;
// }
.el-cascader-menu {
max-height: 250px;
}
.primary_plain_btn {
.el-button--primary.is-plain {
color: #5850ff;
background-color: #fff;
border-color: #5850ff;
}
.el-button--primary.is-plain:hover {
color: #7973ff;
background-color: #fff;
border-color: #7973ff;
}
.el-button--primary.is-plain:active {
color: #3a32e1;
background-color: #fff;
border-color: #3a32e1;
}
}
.el-loading-mask {
.el-loading-spinner {
.el-icon-loading,
.el-loading-text {
color: #5850ff;
}
}
}
.page-btm-btn {
display: flex;
justify-content: center;
margin-top: 16px;
}
.el-message.msgHierarchy {
z-index: 5000 !important;
}
.el-popover.imgPopper {
.el-form-item {
margin: 0 !important;
}
}
.operate-wrap {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 10px;
.table-title {
height: 32px;
font-family: PingFangSC-Medium;
font-weight: 600;
font-size: 16px;
color: #333333;
line-height: 32px;
}
.operate-btn {
.el-button {
margin-left: 8px;
}
.export-btn {
margin-left: 8px;
}
}
}
.el-message.msgHierarchy {
z-index: 5000 !important;
}
.global-title-wrap {
height: 48px;
background: #fff;
border-bottom: 1px solid #EEEDFF;
border-radius: 4px 4px 0 0;
.title {
&:first-child {
border-left: unset !important;
}
display: inline-block;
box-sizing: border-box;
height: 48px;
line-height: 48px;
padding: 0 32px;
font-weight: 400;
font-size: 16px;
color: #37383A;
border-radius: 4px 4px 0 0;
margin-right: 2px;
border-top: 1px;
border-left: 1px;
border-right: 1px;
border-style: solid;
border-color: #EEEDFF;
background: #FAFAFA;
text-align: center;
cursor: pointer;
}
.curTitleCla {
font-weight: 600;
height: 49px;
color: #5850FF;
background-color: #fff;
border-bottom: 1px solid #fff;
}
}
.circle {
display: inline-block;
vertical-align: middle;
margin-right: 8px;
width: 6px;
height: 6px;
border-radius: 50%;
background-color: #999;
}
.goodsNameSlot {
display: flex;
align-items: center;
img {
width: 36px;
height: 36px;
vertical-align: middle;
margin-right: 8px;
}
.name {
width: 200px;
display: inline-block;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
}
\ No newline at end of file \ No newline at end of file
/**
* 根据路由匹配地址
* @param {*} data 路由数据
* @param {*} base 路由前缀
* @param {*} options 粗略的配置项
*/
function routeMatch(data, base, options = { url: 'url', name: 'name', id: 'id', permissions: 'permissions' }) {
if (!Array.isArray(data)) return []
// 主视图路由 正式项目需要区分登陆注册等
/* let userRouter = {
path: "/layout",
name: "layout",
component: () => import('@/views/layout/index.vue'),
redirect: '/index',
children: []
}; */
// 创建路由盒子
let routerBox = []
// 将菜单数据处理为一维函数 如果有多级菜单
// let menu = flattenDeep(data, 'children');
let menu = data
// 遍历处理路由
menu.forEach(item => {
if (!item[options.url]) return
let _url = item[options.url].replace(base, '')
try {
let routerItem = {
path: _url, // 路由路径名
name: item[options.name] || item[options.id], // 命名路由 用于配合菜单简洁跳转
meta: {
purview: item[options.permissions]
}, // 路由元信息 定义路由时即可携带的参数,可用来管理每个路由的按钮操作权限
component: () => import(`@/views${_url}/index.vue`) // 路由映射真实视图路径
}
routerBox.push(routerItem)
} catch (err) {
item[options.url] = '/err-404'
}
})
// 推入需要授权后等异步加载的,非服务端获取的功能性页面
// routerBox.push(...nextRouter);
let errorBox = {
path: '*',
redirect: '/err-404'
}
routerBox.push(errorBox)
return routerBox
}
export default routeMatch
File mode changed
<template>
<el-cascader placeholder="全部" clearable :props="categoryProps" v-model="categoryCode[key]" :options="categoryList"></el-cascader>
</template>
<script>
export default {
name: 'categoryCascader',
props: {
categoryCode:{
type: Array
},
key:{
type: String,
default: 'categoryCode'
}
},
data() {
return {
categoryProps: {
lazy: true,
label: 'categoryName',
value: 'categoryCode',
lazyLoad: this.getCategoryList
},
categoryList: []
}
},
methods: {
// aa(){
// console.log(this.categoryCode)
// },
getCategoryList(node, resolve){
const params = {
categoryCode: node?.value,
categoryLevel: node?.level + 1
}
this.$apis.platformGoods.getCategoryListApi(params).then(res=>{
if(res){
res.map(item => item.leaf = params.categoryLevel>2)
if(params.categoryLevel == 1) this.categoryList = res
resolve(res)
}
})
},
}
}
</script>
<style lang="scss" scoped>
</style>
\ No newline at end of file \ No newline at end of file
/**
* 时间控件-限制月份
*/
export const beforeRangePickerOptions = {
disabledDate(date) {
if (date > new Date()) {
return true
}
return false
}
}
export const afterRangePickerOptions = {
disabledDate(date) {
const yesterday = new Date(new Date().setDate(new Date().getDate() - 1))
if (date < yesterday) {
return true
}
return false
}
}
<!-- 弹窗 -->
<template>
<div>
<GLDialog :bigTitle="bigTitle" :title="title" :mode="mode" :visible.sync="isVisible" :show-close="showClose" :before-close="handleClose" :close-on-click-modal="false" :width="width">
<span slot="title">
{{ title }}
<span class="dialog-sub-title">
<slot name="sub-title"></slot>
</span>
</span>
<slot></slot>
<div slot="footer">
<slot name="btn-start"></slot>
<el-button type="primary" :size="btnSize" @click="handleConfirm">{{ btnOkLabel }}</el-button>
<el-button v-if="!noCancel" :size="btnSize" @click="handleClose">取消</el-button>
<slot name="btn-middle"></slot>
</div>
</GLDialog>
</div>
</template>
<script>
export default {
name: 'glsx-dialog',
data() {
return {}
},
props: {
title: {
type: String,
default: ''
},
isVisible: {
type: Boolean,
default: false
},
showClose: {
type: Boolean,
default: true
},
btnOkLabel: {
type: String,
default: '确定'
},
noCancel: {
type: Boolean,
default: false
},
width: {
type: String,
default: '580px'
},
btnSize: {
type: String,
default: 'small'
},
mode:{
type: String,
default: 'mid'
},
bigTitle:{
type: String,
default: ''
}
},
methods: {
handleClose() {
this.$emit('closeDialog')
},
handleConfirm() {
this.$emit('confirmDialog')
}
}
}
</script>
<style scoped>
.dialog-sub-title {
font-size: 12px;
color: #666666;
}
</style>
<template>
<div>
<div class="input-number-range" :class="{ 'is-disabled': disabled }">
<div class="flex">
<div class="from">
<el-input
ref="input_from"
v-model="formData[keyObj.from]"
:disabled="disabled"
onkeyup="value=value.replace(/^(0+)|[^\d]+/g,'')"
placeholder=""
@input="handleInputChangeFrom"
></el-input>
</div>
<div class="center">
<span>至</span>
</div>
<div class="to">
<el-input
ref="input_to"
v-model="formData[keyObj.to]"
onkeyup="value=value.replace(/^(0+)|[^\d]+/g,'')"
:disabled="disabled"
placeholder=""
@input="handleInputChangeTo"
></el-input>
</div>
<div class="unit">
<span>元</span>
</div>
</div>
</div>
</div>
</template>
<script>
export default {
name: 'InputNumberRange',
props: {
// 是否禁用
disabled: {
type: Boolean,
default: false
},
formData:{
type: Object,
default: ()=>{
return {}
}
},
keyObj:{
type: Object,
default: ()=>{
return {
from: 'a',
to: 'b'
}
}
},
},
data() {
return {
}
},
methods: {
// from输入框change事件
handleInputChangeFrom(value) {
// let from = this.formData[this.keyObj.from]
// let to = this.formData[this.keyObj.to]
// if(from > to){
// this.formData[this.keyObj.to] = from
// }
},
// to输入框change事件
handleInputChangeTo(value) {
// let from = this.formData[this.keyObj.from]
// let to = this.formData[this.keyObj.to]
// if(from > to){
// this.formData[this.keyObj.to] = from
// }
},
}
}
</script>
<style lang="scss" scoped>
.input-number-range {
background-color: #fff;
border: 1px solid #dcdfe6;
border-radius: 4px;
}
.flex {
display: flex;
flex-direction: row;
width: 100%;
justify-content: center;
align-items: center;
/deep/ .el-input .el-input__inner {
border: 0px;
margin: 0;
padding: 0 10px;
background-color: transparent;
}
.center {
margin-top: 1px;
}
.unit{
margin-right: 10px;
}
}
.is-disabled {
background-color: #eef0f6;
border-color: #e4e7ed;
color: #c0c4cc;
cursor: not-allowed;
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<div class="qr-code-components">
<div :style="[{ bottom: bottom + 'px' }]" @mousedown="move" @mouseup="moveEnd" ref="callCenter" @mouseenter="show = true" @mouseleave="show = false" class="right_btn flex_ccc">
<img src="../../assets/contact_icon.png" />
<div class="contact_text">联系我们</div>
<div v-if="show" class="left_code flex_ccc">
<img :src="codeUrl" />
<div style="height: 16px"></div>
<span class="h18_title">{{phoneTitle}}</span>
<span class="h18_title">{{ phone }}</span>
</div>
</div>
</div>
</template>
<script>
export default {
name: '',
props: {
bottom: {
type: Number,
default: 64
},
codeUrl: {
type: String,
default: 'https://img01.glsx.com.cn/weapp/resource/equity-h5-new/qrcode2.jpg'
},
phone: {
type: String,
default: '189 0000 1234'
},
phoneTitle:{
type:String,
default:'服务热线'
}
},
data() {
return {
show: false
}
},
methods: {
// 拖动窗口,鼠标按下
move(event) {
// 给对应div添加拖拽属性
let callCenter = this.$refs.callCenter
callCenter.style.cursor = 'move'
var distanceX = event.clientX - callCenter.offsetLeft
var distanceY = event.clientY - callCenter.offsetTop
// 获取按下时对应的坐标
this.startX = event.pageX
this.startY = event.pageY
document.onmousemove = function (ev) {
var oevent = ev || event
// 加入判断,让浮窗在限定的页面内可拖动
if (ev.clientX < 40 || ev.clientX > document.body.clientWidth - 30) {
return
}
if (ev.clientY < 40 || ev.clientY > document.body.clientHeight - 30) {
return
}
callCenter.style.left = oevent.clientX - distanceX + 'px'
callCenter.style.top = oevent.clientY - distanceY + 'px'
}
document.onmouseup = function () {
document.onmousemove = null
document.onmouseup = null
callCenter.style.cursor = 'default'
}
},
// 鼠标抬起触发
moveEnd(event) {
// 获取鼠标抬起时的坐标
this.endX = event.pageX
this.endY = event.pageY
// 计算按下与抬起位置差值
var d = Math.sqrt((this.startX - this.endX) * (this.startX - this.endX) + (this.startY - this.endY) * (this.startY - this.endY))
if (d === 0 || d < 7) {
// console.log('执行了点击事件')
} else {
// console.log('执行了拖拽事件')
}
}
}
}
</script>
<style lang="scss" scoped>
.qr-code-components {
.left_code {
position: absolute;
right: 57px;
bottom: 0px;
width: 144px;
height: 201px;
background: #ffffff;
z-index: 88;
box-shadow: 0px 3px 6px -4px rgba(0, 0, 0, 0.12), 0px 6px 16px 0px rgba(0, 0, 0, 0.08), 0px 9px 28px 8px rgba(0, 0, 0, 0.05);
> img {
width: 124px;
height: 124px;
}
> span {
line-height: 20px;
}
}
.right_btn {
position: fixed;
right: 20px;
bottom: 64px;
cursor: pointer;
width: 52px;
height: 201px;
background: #5850ff;
border-radius: 4px;
z-index: 88;
box-shadow: 0px 3px 6px -4px rgba(0, 0, 0, 0.12), 0px 6px 16px 0px rgba(0, 0, 0, 0.08), 0px 9px 28px 8px rgba(0, 0, 0, 0.05);
> img {
width: 20px;
height: 20px;
margin-bottom: 7px;
}
.contact_text {
width: 14px;
line-height: 20px;
font-size: 14px;
font-weight: 400;
color: #ffffff;
}
}
}
</style>
<template>
<glsx-dialog bigTitle="选择商户" mode="big" :isVisible.sync="relateStoreVisible" width="70%" btnOkLabel="确定" @confirmDialog="handleRelateStoreConfirm" @closeDialog="handleRelateStoreClose" class="relateStore">
<slot></slot>
<el-row>
<el-col :span="12">
<el-table ref="seletingTable" class="table hightline" :data="selectingData" height="464px" @select="handleChange" @select-all="handleAll">
<el-table-column fixed="left" width="5">
<template slot-scope="scope">
<span :scope="scope"></span>
</template>
</el-table-column>
<el-table-column type="selection" width="55" align="center" :selectable="selectable"></el-table-column>
<el-table-column prop="merchantName" label="商户名称" align="center"></el-table-column>
</el-table>
<el-pagination small background @current-change="handleCurrentChange" :current-page.sync="pageNum" :page-size="pageSize" layout="total, prev, pager, next" :total="total"></el-pagination>
</el-col>
<el-col :span="12">
<el-table :data="selectedData" class="table hightline" height="464px">
<el-table-column fixed="left" width="5">
<template slot-scope="scope">
<span :scope="scope"></span>
</template>
</el-table-column>
<el-table-column prop="merchantName" label="商户名称" align="center"></el-table-column>
<el-table-column align="center" width="100">
<template slot="header">
<el-link :underline="false" icon="el-icon-delete" @click="batchDelete">批量删除</el-link>
</template>
<template slot-scope="scope">
<el-button style="padding: 0" class="el-icon-delete" @click="handleDelete(scope.row)" type="text"></el-button>
</template>
</el-table-column>
</el-table>
</el-col>
</el-row>
</glsx-dialog>
</template>
<script>
import glsxDialog from '@/components/glsx-dialog'
export default {
name: 'relateStoreDialog',
data() {
return {
merchantIds: [],
selectedData: [],
selectingData: [],
// needTip: ['editProduct'],
// 分页
total: 0,
pageNum: 1,
pageSize: 20
}
},
props: {
relateStoreVisible: {
type: Boolean,
default: false
},
// 页面来源
// sourcePage: {
// type: String,
// default: ''
// },
storeApi: {
type: Function,
default: () => {}
},
storeSelected: {
type: Array,
default: () => []
},
storeSearchForm: {
type: Object,
default: () => {}
}
// 去掉表格中某些字段
// noTableField: {
// type: Array,
// default: () => []
// }
},
components: {
glsxDialog
},
mounted() {
this.selectedData = this.storeSelected
this.selectedData.forEach(item => {
item.merchantNo = item.merchantId ? item.merchantId + '' : item.merchantNo
})
this.getSelectingList()
},
methods: {
batchDelete() {
console.log('1')
this.selectedData = []
this.recoverySelection()
},
selectable(row, index) {
var isSelect = row.hasOwnProperty('beServed') ? !row.beServed : true
return isSelect
},
recoverySelection() {
var exitIds = this.selectedData.map(item => item.merchantNo + '')
console.log(this.selectingData)
this.selectingData.forEach(item => {
if (exitIds.includes(item.merchantNo + '')) {
this.$refs.seletingTable.toggleRowSelection(item, true)
} else {
this.$refs.seletingTable.toggleRowSelection(item, false)
}
})
},
getSelectingList() {
var params = JSON.parse(JSON.stringify(this.storeSearchForm))
if (this.storeSearchForm.select == 1) {
params.merchantName = this.storeSearchForm.selectInput
params.merchantId = ''
} else {
params.merchantId = this.storeSearchForm.selectInput
params.merchantName = ''
}
this.storeApi({
...params,
pageNum: this.pageNum,
currentPage: this.pageNum,
pageSize: this.pageSize
}).then(res => {
console.log(res)
if (res.code == '33') {
this.$message.error('请正确输入商户号')
}
this.selectingData = res.data.list
for (var a = 0; a < this.selectingData.length; a++) {
this.selectingData[a].merchantNo = this.selectingData[a].merchantId + ''
}
this.total = res.data.total
this.$nextTick(() => {
this.recoverySelection()
})
})
},
handleChange(selection, row) {
var addOrDelete = !!selection.find(item => item.merchantNo === row.merchantNo)
addOrDelete ? this.selectedData.push(row) : (this.selectedData = this.selectedData.filter(item => item.merchantNo !== row.merchantNo))
},
handleAll(selection) {
console.log(selection, '112112')
// this.selectedData=[]
this.selectingData.forEach(item => {
var isExit = this.selectedData.findIndex(subItem => subItem.merchantNo === item.merchantNo)
// var isServed = item.hasOwnProperty('beServed') ? item.beServed : false
if (selection.length && isExit === -1) {
console.log(item)
this.selectedData.push(item)
} else if (!selection.length && isExit !== -1) {
this.selectedData.splice(isExit, 1)
}
})
},
handleDelete(row) {
this.selectedData = this.selectedData.filter(item => item.merchantNo !== row.merchantNo)
this.recoverySelection()
},
handleCurrentChange(val) {
this.pageNum = val
this.getSelectingList()
},
handleRelateStoreConfirm() {
if (!this.selectedData.length) {
this.$message({
message: '请选择关联门店',
type: 'warning',
showClose: true,
customClass: 'message-Z-zinde'
})
return true
}
this.$emit('handleRelateStoreConfirm', this.selectedData)
},
handleRelateStoreClose() {
this.$emit('handleRelateStoreClose')
}
}
}
</script>
<style>
.relateStore .table {
margin: 0 auto 20px !important;
width: 98%;
}
/* .service-store .relateStore .el-table .cell,
.d2-form .relateStore .el-table .cell {
line-height: 26px !important;
} */
.service-store .relateStore .el-table--medium td,
.d2-form .relateStore .el-table--medium td {
padding: 6px 8px !important;
}
.relateStore .red {
color: red;
}
.relateStore .tip-icon {
position: absolute;
display: inline-block;
height: 10px;
width: 10px;
line-height: 10px;
color: #ffffff;
background-color: red;
border: 1px solid red;
border-radius: 50%;
cursor: pointer;
font-size: 6px;
margin-left: 2px;
}
</style>
\ No newline at end of file \ No newline at end of file
<!-- 选择商品弹窗 -->
<template>
<glsx-dialog class="muti-pro" title="选择商品" :isVisible.sync="isMutiSelectVisible" width="70%" @confirmDialog="handleMutiSelectConfirm" @closeDialog="handleMutiSelectClose">
<div class="flex">
<el-form :inline="true" :model="searchForm">
<el-form-item label="商品名称:">
<el-input :size="size" v-model="searchForm.name" placeholder="请输入商品名称" clearable></el-input>
</el-form-item>
<el-form-item>
<el-button :size="size" type="primary" @click="getList(true)">查询</el-button>
<el-button :size="size" @click="handleReset">重置</el-button>
</el-form-item>
</el-form>
</div>
<GLTable ref="mutiProRef" :tableData="productList" :searchForm="searchForm" :tableParams="tableParams" @refreshTable="getList">
<span slot="coverImgUrl" slot-scope="scope">
<img class="m-t-10 img-60" :src="scope.scope.coverImgUrl" />
</span>
</GLTable>
</glsx-dialog>
</template>
<script>
// import { getGoodsList } from '@/api/modules/common'
import glsxDialog from '@/components/glsx-dialog'
export default {
name: 'selectMutiProDialog',
data() {
return {
size: 'small',
// 表格组件
// getListApi: getGoodsList,
productList: [],
// pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
// 表格参数
tableParams: {
listName: 'list',
// 行数据的key
mutiSelectUniqueKey: 'id',
// 多选ref的名称
mutiSelectName: 'list',
tableColumns: [
{
label: '商品名称',
prop: 'name'
},
{
label: '缩略图',
prop: 'coverImgUrl',
addHtml: 'coverImgUrl'
},
{
label: '价格(元)',
prop: 'price1',
formatter: cellValue => {
return cellValue.price2 && cellValue.price1 != cellValue.price2 ? (cellValue.price1 / 100).toFixed(2) + '-' + (cellValue.price2 / 100).toFixed(2) : (cellValue.price1 / 100).toFixed(2)
}
},
{
label: '来源门店',
prop: 'merchantName'
}
]
}
}
},
props: {
isMutiSelectVisible: {
type: Boolean,
default: false
},
selectedProList: {
type: Array,
default: () => []
},
getListApi: {
type: Function,
default: () => {}
},
searchForm: {
type: Object,
default: () => {}
}
},
components: {
glsxDialog
},
mounted() {
this.getList(true)
},
methods: {
getList(isMounted = false) {
var params = {
// goodsStatus: 1,
// goodsSource: 1,
...this.searchForm,
pageNum: isMounted ? 1 : this.$refs.mutiProRef.page.pageNum,
pageSize: isMounted ? 10 : this.$refs.mutiProRef.page.pageSize
}
var that = this
this.getListApi(params).then(res => {
// console.log(res)
this.productList = res.list
this.$refs.mutiProRef.tableTotal = res.total
this.recoverySelected()
})
},
handleReset() {
this.searchForm.name = ''
this.getList()
},
recoverySelected() {
if (this.selectedProList.length) {
this.selectedProList.forEach(row => {
this.$refs.mutiProRef.$refs[this.tableParams.mutiSelectName + 'MutiTable'].toggleRowSelection(row)
})
}
},
handleMutiSelectConfirm() {
var selectedData = this.$refs.mutiProRef.mutiSelectArr[this.tableParams.mutiSelectName]
this.$emit('handleMutiSelectConfirm', selectedData)
},
handleMutiSelectClose() {
this.$emit('handleMutiSelectClose')
}
}
}
</script>
<style>
.muti-pro .m-t-10 {
margin-top: 10px;
}
</style>
/*
* @Descripttion:
* @version:
* @Author: limin
* @Date: 2021-06-07 14:12:32
* @LastEditors: limin
* @LastEditTime: 2021-06-08 16:55:43
*/
// 根据环境引入不同配置 process.env.VUE_APP_ENV
const environment = process.env.NODE_ENV || 'production'
let config = require('./env.' + environment)
module.exports = config
/*
* @Descripttion:
* @version:
* @Author: limin
* @Date: 2021-06-07 14:12:32
* @LastEditors: limin
* @LastEditTime: 2021-09-18 11:51:29
*/
// 本地环境配置
module.exports = {
title: 'scrm-sub-blog',
response: {
data_key: 'data',
message_key: 'message',
code_key: 'code',
code_success_value: '0',
errId_logout_value: '21',
code_message_map: {}
},
request: {
// baseURL: 'http://192.168.3.171:7300/mock/6136bea6ceeb5a5c2bec6950/',
// baseURL: 'http://scrm.test.glsx.com.cn/',
baseURL: 'http://192.168.2.60:7226/rop-scrm-equity/router',
// 设置超时时间
timeout: 180000,
// 携带凭证
withCredentials: true,
// 返回数据类型
responseType: 'json'
},
sign: {
appKey: '48e5e13229b82c1b4e6e8c96151f0637',
v: '1.0.0',
format: 'json',
source: ''
},
secret: 'c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b',
cdn: 'https://www.xxx.cn/static'
}
module.exports = {
title: 'scrm-sub-blog',
response: {
data_key: 'data',
message_key: 'message',
code_key: 'code',
code_success_value: '0',
errId_logout_value: '21',
code_message_map: {}
},
request: {
baseURL: 'http://192.168.3.171:7300/mock/6136bea6ceeb5a5c2bec6950/',
// 设置超时时间
timeout: 180000,
// 携带凭证
withCredentials: true,
// 返回数据类型
responseType: 'json'
},
sign: {
app_key: '48e5e13229b82c1b4e6e8c96151f0637',
v: '1.0.0',
format: 'json',
source: ''
},
secret: 'c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b',
cdn: 'https://www.xxx.cn/static'
}
/*
* @Descripttion:
* @version:
* @Author: limin
* @Date: 2021-06-07 14:12:32
* @LastEditors: limin
* @LastEditTime: 2021-09-07 14:38:52
*/
// 根据环境引入不同配置 process.env.VUE_APP_ENV
// let request = require('@/http/request.js')
let cfg = require('./conf.js')
let timeout = 30000 //超时时间
import { Http } from 'glsx-common'
export const fetchConfig = function(isEnv = true) {
// if (isEnv) {
// let { request } = cfg
// Object.assign(request, { timeout })
// return Promise.resolve(cfg)
// }
return new Http({ Headers: { refererurl: location.href }, request: { timeout: 30000 } }).get('https://oss-config.test.glsx.com.cn/mock/618f5cc91072f92988f05a26/services/config')
//return window.fetch('https://', {}).then(res => res.json())
// request({ url: 'https://oss-config.test.glsx.com.cn/mock/5be17454f31545347559d499/config/oss_commodity_center', method: 'get' })
}
export const config = {
install(vue, cfg) {
vue.prototype.$config = cfg
}
}
\ No newline at end of file \ No newline at end of file
/*
* @Descripttion:
* @version: 1.0.0
* @Author: limin
* @Date: 2021-08-13 14:12:11
* @LastEditors: limin
* @LastEditTime: 2021-09-24 10:41:31
* @FilePath: \scrm\scrm-sub-blog\src\main.js
*/
import Vue from 'vue'
import apis from './api'
import './public-path'
import '@/assets/css/public.scss'
// import 'glsx-components/dist/glsx-components.css'
import { start } from '@/setup'
Vue.config.productionTip = false
Vue.prototype.$apis = apis
start()
export { bootstrap, mount, unmount } from '@/setup'
export const http = params => Vue.prototype.$http(params)
export const other_http = params => Vue.prototype.$other_http(params)
File mode changed
import Vue from 'vue'
import { Message, Button, ButtonGroup, Form, FormItem, Input, Radio, RadioGroup, Checkbox, CheckboxGroup, Switch, Select, Option, TimePicker, Col, DatePicker, Tree, Card, Table, TableColumn, Pagination, Loading, Dialog, MessageBox, Upload, Tooltip, Tabs, TabPane, Container, Progress, Timeline, TimelineItem, Dropdown, DropdownMenu, Rate, Image, Drawer, Popover, Row } from 'element-ui'
Vue.use(Button)
Vue.use(ButtonGroup)
Vue.use(Form)
Vue.use(FormItem)
Vue.use(Input)
Vue.use(Radio)
Vue.use(RadioGroup)
Vue.use(Checkbox)
Vue.use(CheckboxGroup)
Vue.use(Switch)
Vue.use(Select)
Vue.use(Option)
Vue.use(TimePicker)
Vue.use(Col)
Vue.use(DatePicker)
Vue.use(Tree)
Vue.use(Card)
Vue.use(Table)
Vue.use(TableColumn)
Vue.use(Pagination)
Vue.use(Loading)
Vue.use(Dialog)
Vue.use(Upload)
Vue.use(Tooltip)
Vue.use(Tabs)
Vue.use(TabPane)
Vue.use(Progress)
Vue.use(Timeline)
Vue.use(TimelineItem)
Vue.use(Dropdown)
Vue.use(DropdownMenu)
Vue.use(Rate)
Vue.use(Image)
Vue.use(Drawer)
Vue.use(Popover)
Vue.use(Row)
export const message = Message
export const messageBox = MessageBox
\ No newline at end of file \ No newline at end of file
if (window.__POWERED_BY_QIANKUN__) {
// eslint-disable-next-line no-undef
__webpack_public_path__ = window.__INJECTED_PUBLIC_PATH_BY_QIANKUN__;
}
import Vue from 'vue'
import VueRouter from 'vue-router'
import routes from './routes'
Vue.use(VueRouter)
// 处理重复点击同一个路由报错的问题
const originalPush = VueRouter.prototype.push
VueRouter.prototype.push = function push(location) {
return originalPush.call(this, location).catch(err => err)
}
function getRoutes(routesData) {
return routesData.reduce((routes, route) => {
routes.push({ ...route, component: () => import('@/views' + route.compath + '.vue') })
return routes
}, [])
}
export { VueRouter, routes, getRoutes }
const staticRoutes = Object.freeze([
])
export default staticRoutes
/*
* @Descripttion:
* @version: 1.0.0
* @Author: limin
* @Date: 2021-09-23 19:31:52
* @LastEditors: limin
* @LastEditTime: 2021-09-24 10:41:09
* @FilePath: \scrm\scrm-sub-blog\src\setup\index.js
*/
import { bootstrap, mount, unmount } from './qiankun'
import { start } from './single'
export { bootstrap, mount, unmount, start }
import Vue from 'vue'
import { message, messageBox } from '@/plugins/element.js'
import { fetchConfig } from '@/config'
import { GLButton, GLTable , GLCombiForm, GLTableButton,GLDialog} from 'glsx-components' //权限按钮 (根据权限动态创建)
import { getRoutes } from '@/router'
import render from './render'
import 'glsx-components/dist/glsx-components.css'
// import 'glsx-components/src/theme/theme.scss'
let routes = []
let router = null
let instance = null
Vue.use(GLTable).use(GLCombiForm).use(GLTableButton).use(GLDialog)
export async function bootstrap({ history, common, messenger, globalState, routerBase }) {
const { response, request, other_request, sign, secret } = await fetchConfig()
// request.baseURL = 'https://scrm.dev.glsx.com.cn'
// request_brand.baseURL = 'https://scrm.dev.glsx.com.cn'
// request.baseURL = 'http://192.168.1.53:7226'
// request_brand.baseURL = 'http://192.168.1.53:7226'
Vue.prototype.$history = history
Vue.prototype.$messenger = messenger
Vue.prototype.$globalState = globalState
Vue.prototype.$common = common
Vue.prototype.$message = message
Vue.prototype.$messageBox = messageBox
// // Vue.prototype.$defaultStartDate = '2021-07-01'
Vue.prototype.$http = new common.Http({ response, request, sign, secret, alert: message.error, headers: { token: globalState.session.token } })
Vue.prototype.$other_http = new common.Http({ response, request: other_request, sign, secret, alert: message.error, headers: { token: globalState.session.token } })
// Vue.prototype.$http = new common.Http({ response, request, sign, secret, alert: message.error, headers: { token: 'scrm-base-811305a2-49a3-4e8a-b6dc-fb925c65c95c-rop' } })
// Vue.prototype.$http_brand = new common.Http({ response, request: request_brand, sign, secret, alert: message.error, headers: { token: 'scrm-base-811305a2-49a3-4e8a-b6dc-fb925c65c95c-rop' } })
// Vue.prototype.$http = new common.Http({ response, request, sign, secret, alert: message.error, headers: { token: '781f08c5-c443-46fd-80e1-f98d94673a73' } })
// Vue.prototype.$setGlobalState = globalState.actions.setGlobalState
const routesData = common.utils.deepClone(globalState.routers)
routes = getRoutes(routesData)
subscribe({ messenger })
Vue.use(GLButton, { routes, routerBase })
}
export async function mount({ routerBase }) {
const insts = render(routerBase, routes)
router = insts.router
instance = insts.vm
}
export async function unmount() {
instance.$destroy()
instance.$el.innerHTML = ''
instance = null
router = null
}
function subscribe({ messenger }) {
messenger.subscribe(v => {
// console.log(`监听到子应用${v.from}发来消息:`, v)
})
}
/*
* @Descripttion:
* @version: 1.0.0
* @Author: limin
* @Date: 2021-09-23 19:04:32
* @LastEditors: limin
* @LastEditTime: 2021-10-14 16:30:47
* @FilePath: \scrm\scrm-sub-blog\src\setup\render.js
*/
import App from '../App.vue'
import Vue from 'vue'
import store from '@/store'
import { VueRouter } from '@/router'
const render = (base, routes) => {
const router = new VueRouter({
base,
routes,
mode: 'history'
})
const vm = new Vue({
router,
store,
render: h => h(App)
}).$mount('#app')
return { router, vm }
}
export default render
/*
* @Descripttion:
* @version: 1.0.0
* @Author: limin
* @Date: 2021-09-23 19:02:23
* @LastEditors: limin
* @LastEditTime: 2021-09-24 10:41:17
* @FilePath: \scrm\scrm-sub-blog\src\setup\single.js
*/
import Vue from 'vue'
import { message } from '@/plugins/element.js'
import { fetchConfig } from '@/config'
import { GLButton } from 'glsx-components' //权限按钮 (根据权限动态创建)
import { Http, utils } from 'glsx-common'
import render from './render'
import { routes } from '@/router'
export async function start() {
if (window.__POWERED_BY_QIANKUN__) return
const { response, request, request_brand, sign, secret } = await fetchConfig()
var urlParams = {}
window.location.href.split('?').length > 1
? window.location.href
.split('?')[1]
.split('&')
.forEach(item => {
urlParams[item.split('=')[0]] = item.split('=')[1]
})
: ''
var token = Object.keys(urlParams).includes('sessionId') ? urlParams.sessionId : '1112223333444'
Vue.prototype.$http = new Http({ response, request, sign, secret, alert: message.error, headers: { token: token } })
Vue.prototype.$http_brand = new Http({ response, request: request_brand, sign, secret, alert: message.error, headers: { token: token } })
Vue.prototype.$common = {
utils: utils
}
Vue.use(GLButton, { permissions: ['1-1-1-1', '2-1-1-1', '3-1-1-1'] })
render('/', routes)
}
/*
* @Descripttion:
* @version: 1.0.0
* @Author: limin
* @Date: 2021-08-13 14:12:11
* @LastEditors: limin
* @LastEditTime: 2021-08-25 14:14:44
* @FilePath: \scrm\scrm-base\src\store\index.js
*/
import Vue from 'vue'
import Vuex from 'vuex'
Vue.use(Vuex)
const modulesFiles = require.context('./modules', true, /\.js$/)
const modules = modulesFiles.keys().reduce(
(result, modulePath) => {
const moduleName = modulePath.replace(/^\.\/(.*)\.\w+$/, '$1')
const value = modulesFiles(modulePath)
result.getters[moduleName] = state => state[moduleName]
result.modules[moduleName] = value.default
return result
},
{ modules: {}, getters: {} }
)
const store = new Vuex.Store(modules)
export default store
export default {
namespaced: true,
state: {
size: 10, // 分页 页大小
token: ''
},
mutations: {
// 设置分页大小
SET_PAGE_SIZE(state, data) {
state.size = data
},
// 设置token
SET_TOKEN(state, data) {
state.token = data
}
},
actions: {
// 设置分页大小
setPageSize({ commit }, data) {
commit('SET_PAGE_SIZE', data)
},
// 设置token
setToken({ commit }, data) {
commit('SET_TOKEN', data)
}
}
}
export default {
namespaced: true,
state: {
},
mutations: {},
actions: {}
}
let util = {}
util.dateFormat = function(dateTime, format = 'YYYY-MM-DD') {
const date = new Date(dateTime)
const config = {
YYYY: date.getFullYear(),
MM: appendZero(date.getMonth() + 1), //getMonth() 方法根据本地时间返回指定日期的月份(从 0 到 11)
DD: appendZero(date.getDate()),
HH: appendZero(date.getHours()),
mm: appendZero(date.getMinutes()),
ss: appendZero(date.getSeconds())
}
for (const key in config) {
format = format.replace(key, config[key])
}
return format
}
function appendZero(int) {
if (int < 10) {
return '0' + `${int}`
} else {
return int
}
}
util.decimal = function(num, fixed) {
let pow = Math.pow(10, fixed)
return Math.round(num * pow) / pow
}
util.getLastDay = function(date) {
let current = new Date(date)
let currentMonth = current.getMonth()
let nextMoth = ++currentMonth
let nextMonthDayOne = new Date(current.getFullYear(), nextMoth, 1)
let minusDate = 1000 * 60 * 60 * 24
return new Date(nextMonthDayOne.getTime() - minusDate)
}
util.getDateStr = function(num) {
let now = new Date()
now.setDate(now.getDate() + num)
util.dateFormat(now)
// let y = now.getFullYear()
// let m = (now.getMonth() + 1) < 10 ? '0' + (now.getMonth() + 1) : (now.getMonth() + 1)
// let d = now.getDate() < 10 ? '0' + now.getDate() : now.getDate()
// return y + "-" + m + "-" + d
return util.dateFormat(now)
}
util.getExplorer = function() {
var ua = navigator.userAgent.toLocaleLowerCase();
var browserType = null;
if (ua.match(/msie/) != null || ua.match(/trident/) != null) {
browserType = "IE";
} else if (ua.match(/firefox/) != null) {
browserType = "火狐";
} else if (ua.match(/ubrowser/) != null) {
browserType = "UC";
} else if (ua.match(/opera/) != null) {
browserType = "欧朋";
} else if (ua.match(/bidubrowser/) != null) {
browserType = "百度";
} else if (ua.match(/metasr/) != null) {
browserType = "搜狗";
} else if (ua.match(/tencenttraveler/) != null || ua.match(/qqbrowse/) != null) {
browserType = "QQ";
} else if (ua.match(/maxthon/) != null) {
browserType = "遨游";
} else {
browserType = '谷歌'
}
return browserType
}
util.transfStatus = function(firstKey, key) {
if(firstKey==1001) return {name: '待支付', color: '#FDB757'}
let arr1 = [1002,1006,1007,1008]
let arr2 = [1003,1004,1005,1012]
if(arr1.includes(+key)){
return {name: '待收货', color: '#5850FF'}
}else if(arr2.includes(+key)){
return {name: '已关闭', color: '#999999'}
}else if(key==1009){
return {name: '已完成', color: '#2CCA74'}
}else{
return {name: '售后/退款', color: '#EB4E4E'}
}
}
export default util
\ No newline at end of file \ No newline at end of file
<!-- 秒杀活动 -->
<template>
<div class="ctnr">
<div class="stutas-wrap">
<span>订单状态:</span>
<span v-if="!isLoading" class="stutas-circle" :style="{backgroundColor: transfStatus(orderInfo.payStatus,orderInfo.orderStatus).color}"></span>
<span v-if="!isLoading">{{transfStatus(orderInfo.payStatus, orderInfo.orderStatus).name}}</span>
</div>
<div class="info-wrap order-info">
<div class="title">订单信息</div>
<div class="detail">
<glsxCombiForm ref="editFormRef" labelWidth="154px" defaultWidth="214px" :formObj="orderInfo" :formData="editFormData"></glsxCombiForm>
</div>
</div>
<div class="info-wrap">
<div class="title">商品信息</div>
<div class="detail">
<GLTable :hasPage="false" ref="goodsTableRef" :tableParams="tableParams" :tableData="orderInfo.subOrderGoodsList">
<div slot="goodsNameSlot" class="goodsNameSlot" slot-scope="scope">
<img :src="scope.scope.goodsImageUrl" alt="">
<el-tooltip class="item" effect="dark" :content="(scope.scope.brandName || '') + (scope.scope.goodsSkuName || '')" placement="top">
<span class="name">{{ scope.scope.brandName }} {{ scope.scope.goodsSkuName }}</span>
</el-tooltip>
</div>
</GLTable>
</div>
</div>
<div class="info-wrap">
<div class="title">发货信息</div>
<div class="detail">
<GLTable :hasPage="false" ref="shipmentsRef" :tableParams="shipmentsParams" :tableData="orderInfo.subOrderGoodsList">
<div slot="goodsNameSlot" class="goodsNameSlot" slot-scope="scope">
<img :src="scope.scope.goodsImageUrl" alt="">
<el-tooltip class="item" effect="dark" :content="(scope.scope.brandName || '') + (scope.scope.goodsSkuName || '')" placement="top">
<span class="name">{{ scope.scope.brandName }} {{ scope.scope.goodsSkuName }}</span>
</el-tooltip>
</div>
</GLTable>
</div>
</div>
<GLFooter>
<el-button style="margin-top: 16px;" @click="$router.back()" size="medium">取消</el-button>
</GLFooter>
</div>
</template>
<script>
import glsxCombiForm from '@/components/glsx-combi-form'
import util from '@/util/util'
export default {
name: 'goodsOrderDetail',
data() {
return {
editForm: {
name: 123
},
isLoading: false,
orderInfo:{},
shipmentsParams: {
listName: 'shipments',
tableOption: false,
tableColumns: [
{
label: '发货商品',
prop: 'goodsName',
addHtml: 'goodsNameSlot'
},
{
label: '发货数量',
prop: 'sellQty'
},
{
label: '快递公司',
formatter: cell => {
return this.orderInfo.expressName || '--'
}
},
{
label: '快递单号',
prop: 'effectiveDays',
formatter: cell => {
return this.orderInfo.expressNo || '--'
}
},
{
label: '物流状态',
prop: 'effectiveDays',
formatter: cell =>{
return {1000:'待揽件',1001:'已揽件',1002:'运输中',1003:'已签收',1004:'拒收'}[this.orderInfo.logisticsStatus] || '--'
}
}
]
},
tableParams: {
listName: 'list',
tableOption: false,
tableColumns: [
{
label: '商品名称',
prop: 'goodsName',
addHtml: 'goodsNameSlot'
},
{
label: '单价 (元)',
prop: 'salePrice'
},
{
label: '数量',
prop: 'sellQty'
},
{
label: '小计 (元)',
formatter: cell => {
return (cell.salePrice * cell.sellQty).toFixed(2)
}
},
{
label: '实收金额 (元)',
prop: 'orderAmount',
formatter: cell => {
return (cell.salePrice * cell.sellQty).toFixed(2)
}
}
]
},
editFormData: [
{
label: '第三方订单编号',
name: 'thirdSubOrderCode',
type: 'showTxt'
},
{
label: '平台订单编号',
name: 'subOrderCode',
type: 'showTxt'
},
{
label: '下单时间',
name: 'orderCreatedDate',
type: 'showTxt'
},
{
label: '支付金额',
name: 'payPrice',
type: 'showTxt'
},
{
label: '支付时间',
name: 'payDate',
type: 'showTxt'
},
{
label: '商户订单号',
name: 'outTradeNo',
type: 'showTxt'
},
{
label: '用户名称',
name: 'accountName',
type: 'showTxt'
},
{
label: '用户手机号',
name: 'customerPhone',
type: 'showTxt'
},
{
label: '用户备注',
name: 'buyerMsg',
type: 'showTxt'
},
{
label: '收货人信息',
name: 'addInfo',
type: 'showTxt'
}
]
}
},
components: {
glsxCombiForm
},
created() {
this.getDetailById()
},
mounted() {
},
methods: {
transfStatus: util.transfStatus,
getDetailById(){
const { id } = this.$route.params
const loading = this.$loading({
lock: true,
text: 'Loading',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.3)'
})
this.isLoading = true
this.$apis.platformGoods.getOrderDetail({subOrderCode:id}).then(res =>{
loading.close()
this.isLoading = false
if(res?.id){
const {receiveName, receiveMobile, provinceName, cityName, townName, address}= res?.receiveAddress || {}
res.addInfo = `${receiveName} ${receiveMobile} ${provinceName}${cityName}${townName}${address}`
res.addInfo = res.addInfo.replaceAll('null','')
res.payPrice = res.payPrice ? res.payPrice + '元' : '--'
res.subOrderGoodsList = res?.subOrderGoodsList?.length ? res?.subOrderGoodsList : []
// res.logisticsStatus = undefined
this.orderInfo = res
}
}).catch(err=>{
this.isLoading = false
loading.close()
console.log(err)
})
},
}
}
</script>
<style scoped lang="scss">
.ctnr{
.stutas-wrap{
background-color: #fff;
height: 72px;
line-height: 72px;
font-weight: 500;
font-size: 20px;
color: #333333;
padding: 0 20px;
.stutas-circle{
display: inline-block;
border-radius: 50%;
width: 10px;
height: 10px;
background: #FDB757;
margin-right: 10px;
vertical-align: middle;
}
}
.info-wrap{
background-color: #fff;
margin-top: 16px;
.title{
height: 60px;
line-height: 60px;
border-bottom: 1px solid #E5E5E5;
padding: 0 20px;
font-weight: 500;
font-size: 20px;
color: #333333;
}
.detail{
padding: 20px;
}
}
.order-info{
}
}
</style>
\ No newline at end of file \ No newline at end of file
<!-- 秒杀活动 -->
<template>
<div class="ctnr">
<GLCombiForm class="search-wrap" rowNumber="1" ref="orderRef" @handleOk="handleSearch" @handleRest="handleReset" :formObj="orderFormObj" :formData="orderFormData">
</GLCombiForm>
<div class="main-wrap">
<div class="global-title-wrap">
<span v-for="item in titleList" :key="item.id" :class="['title', {'curTitleCla': orderFormObj.requestType==item.id}]" @click="changeTable(item.id)">{{item.name}}</span>
</div>
<div class="table-wrap">
<GLTable @setTableFinishFun="setTableFinishFun" ref="tableRef" :pageConf="pageConf" :searchForm="searchForm" :tableParams="tableParams" :getListApi="getListApi" :beforeSearchFn="beforeSearchFn">
<div slot="goodsNameSlot" class="goodsNameSlot" slot-scope="scope">
<img :src="scope.scope.goodsImageUrl" alt="">
<el-tooltip class="item" effect="dark" :content="(scope.scope.brandName || '') + (scope.scope.goodsSkuName || '')" placement="top">
<span class="name">{{ scope.scope.brandName }}{{ scope.scope.goodsSkuName }}</span>
</el-tooltip>
</div>
<div slot="userInfoSlot" class="userInfoSlot" slot-scope="scope">
<p class="name">{{ scope.scope.accountName || '--' }}</p>
<p class="phone">{{ scope.scope.customerPhone}}</p>
</div>
<div slot="orderStatusSlot" slot-scope="scope">
<span class="circle" :style="{backgroundColor: transfStatus(scope.scope.payStatus,scope.scope.orderStatus).color}"></span>
<span>{{ transfStatus(scope.scope.payStatus,scope.scope.orderStatus).name }}</span>
</div>
<div slot="orderNoSlot" class="userInfoSlot" slot-scope="scope">
<p class="name">第三方:{{ scope.scope.thirdSubOrderCode || '--' }}</p>
<p class="name">平台:{{ scope.scope.subOrderCode || '--'}}</p>
</div>
<div slot="auth-button" slot-scope="scope">
<GLTableButton :buttonList="buttonList" :buttonItem="scope" :buttonNum="3"></GLTableButton>
</div>
</GLTable>
</div>
</div>
</div>
</template>
<script>
import { utils } from 'glsx-common'
import util from '@/util/util'
const titleList = [
{
id: 0,
name: '全部'
},
{
id: 2,
name: '待支付'
},
{
id: 1,
name: '待收货'
},
{
id: 4,
name: '已完成'
},
{
id: 3,
name: '退款/售后'
},
{
id: 5,
name: '已关闭'
},
]
export default {
name: 'goodsOrderIndex',
data() {
return {
size: 'small',
titleList,
buttonList: [
{
type: 'el-button',
name: '详情',
attrs: {
type: 'text',
fn: '商品订单详情'
},
listeners: {
click: row => this.goOrderDetaillPage(row.scope)
}
}
],
searchForm: {},
orderFormObj: {
customerInfo: '',
searchOrderCode: '',
goodsInfo: '',
requestType: '0',
time: ''
},
orderFormData: [
{
label: '用户信息',
name: 'customerInfo',
placeholder: '请输入姓名或手机号',
type: 'input',
isClear: true
},
{
label: '商品信息',
name: 'goodsInfo',
type: 'input',
isClear: true
},
{
label: '订单编号',
name: 'searchOrderCode',
type: 'input',
isClear: true
},
{
label: '下单时间',
name: 'time',
type: 'datePicker',
isClear: true,
pickerOptions: 'beforeRangePickerOptions'
}
],
getListApi: this.$apis.platformGoods.getOrderList,
pageConf: { pageSize: 'pageSize', pageNum: 'currentPage', totalCount: 'total' },
tableParams: {
listName: 'list',
tableOption: true,
tableColumns: [
{
label: '商品名称',
width: 300,
addHtml: 'goodsNameSlot'
},
{
label: '单价 (元)',
width: 100,
prop: 'salePrice'
},
{
label: '数量',
prop: 'sellQty'
},
{
label: '实收金额 (元)',
width: 130,
formatter: cell => {
return (cell.salePrice * cell.sellQty).toFixed(2)
}
},
{
label: '用户信息',
width: 150,
addHtml: 'userInfoSlot'
},
{
label: '订单状态',
width: 110,
addHtml: 'orderStatusSlot'
},
{
label: '订单编号',
width: 300,
addHtml: 'orderNoSlot'
},
{
label: '下单时间',
width: 200,
formatter: cellValue => {
return cellValue.orderCreatedDate ? util.dateFormat(cellValue.orderCreatedDate, 'YYYY-MM-DD HH:mm:ss') : '--'
}
}
]
}
}
},
components: {
},
mounted() {
},
methods: {
transfStatus: util.transfStatus,
setTableFinishFun () {
//接收到的数据为空
this.$refs.tableRef.data.length ? (this.$refs.tableRef.tableHeightValues = '') : this.$refs.tableRef.setTableHeightFun()
},
changeTable(id){
this.orderFormObj.requestType = id
this.handleSearch()
},
handleReset(){
this.orderFormObj = {
customerInfo: '',
searchOrderCode: '',
goodsInfo: '',
requestType: this.orderFormObj.requestType,
time: ''
}
this.handleSearch()
},
handleSearch(){
this.$refs.tableRef.refreshTable()
},
getParams(){
let params = utils.deepClone(this.orderFormObj)
if(params?.time?.length){
params.createdStartTime = new Date(params.time[0]).toLocaleDateString().replace(/\//g, '-') + ' 00:00:00'
params.createdEndTime = new Date(params.time[1]).toLocaleDateString().replace(/\//g, '-') + ' 23:59:59'
}
delete params.time
return params
},
beforeSearchFn(){
return new Promise((resolve, reject)=>{
this.searchForm = this.getParams()
resolve()
})
},
goOrderDetaillPage(item){
this.$router.push({ path: `/goodsOrder/detail/${item.subOrderCode}`})
}
}
}
</script>
<style scoped lang="scss">
.ctnr{
.search-wrap{
background-color: #fff;
padding: 20px;
}
.main-wrap{
background-color: #fff;
margin-top: 16px;
.table-wrap{
padding: 20px;
.userInfoSlot{
.name{
font-size: 14px;
color: #666666;
}
.phone{
font-size: 10px;
color: #999999;
}
}
}
}
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<GLDialog title="批量改价" mode="small" :visible.sync="visible" :show-close="true" :before-close="handleClose" @onOk="confirmPriceChange" @onCancel="handleClose" okText="提交" cancelText="取消">
<div class="dialog-wrap">
<span>销售价 = 供货价 +</span>
<el-input size="small" type="text" onkeyup="value = value ? value.replace(/^0\d/g, '0').replace(/[^\d.]/g, '').replace(/^\./g, '').replace(/^\d{6}\d+(\.\d+)?/g, value.substr(0,6)).replace(/\.{2,}/g, '').replace('.', '$#$')
.replace(/\./g, '').replace('$#$', '.').replace(/^(-)*(\d+)\.(\d\d).*$/, '$1$2.$3') : value" v-model="batchPrice" placeholder="请输入金额">
<span slot="append">元</span>
</el-input>
</div>
</GLDialog>
</template>
<script>
export default {
name: 'setPriceDialog',
props: {
visible:{
type: Boolean,
default: false
}
},
data() {
return {
batchPrice: ''
}
},
methods: {
confirmPriceChange(){
this.$emit('confirm', this.batchPrice)
},
handleClose(){
this.$emit('handleClose')
}
}
}
</script>
<style lang="scss" scoped>
.dialog-wrap{
display: flex;
align-items: center;
justify-content: center;
height: 100%;
width: 100%;
span{
white-space: nowrap;
margin-right: 8px;
}
/deep/ .el-input{
&, .el-input__inner{
width: 222px;
}
.el-input-group__append{
box-sizing: border-box;
padding: 0 11px;
span{
margin: 0;
}
}
}
}
</style>
\ No newline at end of file \ No newline at end of file
<!-- 秒杀活动 -->
<template>
<div class="ctnr">
<div class="stutas-wrap">
<span>售后状态:</span>
<span v-if="!isLoading" class="stutas-circle" :style="{backgroundColor: (orderInfo.returnOrderStatus == 1003 || orderInfo.returnOrderStatus == 1006) ? '#2CCA74': '#5850FF'}"></span>
<span v-if="!isLoading">{{ (orderInfo.returnOrderStatus == 1003 || orderInfo.returnOrderStatus == 1006) ? '售后完成': '售后中'}}</span>
</div>
<div class="info-wrap order-info">
<div class="title">售后信息</div>
<div class="detail">
<glsxCombiForm ref="editFormRef" labelWidth="154px" defaultWidth="214px" :formObj="orderInfo" :formData="editFormData">
<div slot="addDescImgSlot" class="addDescImgSlot">
<el-image class="img" v-for="(item,index) in orderInfo.imgUrlList" :preview-src-list="orderInfo.imgUrlList" :key="index" :src="item" ></el-image>
<span v-if="!orderInfo.imgUrlList || orderInfo.imgUrlList.length==0">--</span>
</div>
</glsxCombiForm>
</div>
</div>
<div class="info-wrap">
<div class="title">商品信息</div>
<div class="detail">
<GLTable :hasPage="false" ref="goodsTableRef" :tableParams="tableParams" :tableData="orderInfo.goodsInfoTableDate">
<div slot="goodsNameSlot" class="goodsNameSlot" slot-scope="scope">
<img :src="scope.scope.goodsImageUrl" alt="">
<el-tooltip class="item" effect="dark" :content="(scope.scope.brandName || '') + (scope.scope.goodsSkuName || '')" placement="top">
<span class="name">{{ scope.scope.brandName }} {{ scope.scope.goodsSkuName }}</span>
</el-tooltip>
</div>
</GLTable>
</div>
</div>
<div v-if="showEmailInfo" class="info-wrap">
<div class="title">商品寄回</div>
<div class="detail">
<GLTable :hasPage="false" ref="shipmentsRef" :tableParams="shipmentsParams" :tableData="orderInfo.expressInfo">
</GLTable>
</div>
</div>
<GLFooter>
<el-button style="margin-top: 16px;" @click="$router.back()" size="medium">取消</el-button>
</GLFooter>
</div>
</template>
<script>
import glsxCombiForm from '@/components/glsx-combi-form'
import util from '@/util/util'
const reasonObj = {1001:'商品无货',1002:'发货时间问题',1003:'不想要了/不喜欢',1004:'商品信息填写错误',1005:'地址信息填写错误',1006:'商品降价',1007:'其他',1008:'尺码不合适',1009:'无理由退货',1010:'发票问题',1011:'商品与页面描述不符',1012:'发错货',1013:'质量问题',1014:'买错尺码/颜色/型号',1015:'商品缺少或破损',1016:'买错了'}
const refundStatusObj = {1000:'待审核',1001: '审核通过',1002: '已收货',1003: '已退款',1004: '已生成新订单',1005: '审核不通过'}
const outRefundTypeObj = {0:'退款成功',1:'退款关闭',2:'退款处理中',3:'退款异常'}
export default {
name: 'goodsOrderDetail',
data() {
return {
editForm: {
name: 123
},
isLoading: false,
showEmailInfo: false,
orderInfo: {},
shipmentsParams: {
listName: 'shipments',
tableOption: false,
tableColumns: [
{
label: '快递公司',
prop: 'expressName'
},
{
label: '快递单号',
prop: 'expressNo'
},
{
label: '寄回时间',
prop: 'returnTime'
}
]
},
tableParams: {
listName: 'list',
tableOption: false,
tableColumns: [
{
label: '商品名称',
prop: 'goodsName',
addHtml: 'goodsNameSlot'
},
{
label: '申请数量',
prop: 'applyQty'
},
{
label: '申请金额 (元)',
prop: 'refundPrice'
},
{
label: '平台订单编号',
prop: 'tparReturnOrderCode'
},
{
label: '订单状态',
prop: 'refundStatus'
}
]
},
editFormData: [
{
label: '第三方售后编号',
name: 'returnOrderCode',
type: 'showTxt'
},
{
label: '平台订单编号',
name: 'tparReturnOrderCode',
type: 'showTxt'
},
{
label: '申请时间',
name: 'createdDate',
type: 'showTxt'
},
{
label: '售后类型',
name: 'returnType',
type: 'showTxt'
},
{
label: '售后原因',
name: 'returnReasonType',
type: 'showTxt'
},
{
label: '用户名称',
name: 'accountName',
type: 'showTxt'
},
{
label: '用户手机号',
name: 'customerPhone',
type: 'showTxt'
},
{
label: '申请描述',
name: 'returnContent',
type: 'showTxt'
},
{
label: '描述图片',
name: 'imgUrlList',
addHtml: 'addDescImgSlot'
}
]
}
},
components: {
glsxCombiForm
},
created() {
this.getDetailById()
},
mounted() {
},
methods: {
getDetailById(){
const { id } = this.$route.params
const loading = this.$loading({
lock: true,
text: 'Loading',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.3)'
})
this.isLoading = true
this.$apis.platformGoods.getSaleOrderDetail({afterSalesOrderCode:id}).then(res =>{
loading.close()
this.isLoading = false
if(res?.id){
let {applyQty, refundPrice, outRefundType, refundStatus, tparReturnOrderCode, returnType, returnReasonType, returnTime} = res || {}
const {brandName, goodsSkuName, goodsImageUrl} = res.orderGoods || {}
this.showEmailInfo = returnType == 1001
res.returnType = {1001: '退货退款', 1002: '仅退款', 1003:'退货换货'}[returnType] || '--'
res.returnReasonType = reasonObj[returnReasonType]
refundStatus = refundStatus!=1003 ? refundStatusObj[refundStatus] : outRefundTypeObj[outRefundType]
res.goodsInfoTableDate = [{brandName, goodsSkuName, goodsImageUrl, applyQty, refundPrice, refundStatus, tparReturnOrderCode}]
res.createdDate = res.createdDate ? util.dateFormat(res.createdDate, 'YYYY-MM-DD HH:mm:ss') : '--'
res.returnTime = returnTime ? util.dateFormat(returnTime, 'YYYY-MM-DD HH:mm:ss') : '--'
res.expressInfo = [{expressName: res.expressName, expressNo: res.expressNo, returnTime: res.returnTime}]
this.orderInfo = res
}
}).catch(err=>{
this.isLoading = false
loading.close()
console.log(err)
})
},
}
}
</script>
<style scoped lang="scss">
.ctnr{
.stutas-wrap{
background-color: #fff;
height: 72px;
line-height: 72px;
font-weight: 500;
font-size: 20px;
color: #333333;
padding: 0 20px;
.stutas-circle{
display: inline-block;
border-radius: 50%;
width: 10px;
height: 10px;
background: #FDB757;
margin-right: 10px;
vertical-align: middle;
}
}
.info-wrap{
background-color: #fff;
margin-top: 16px;
.title{
height: 60px;
line-height: 60px;
border-bottom: 1px solid #E5E5E5;
padding: 0 20px;
font-weight: 500;
font-size: 20px;
color: #333333;
}
.detail{
padding: 20px;
.addDescImgSlot{
.img{
width: 36px;
height: 36px;
margin-right: 8px;
}
}
}
}
.order-info{
}
}
</style>
\ No newline at end of file \ No newline at end of file
<!-- 秒杀活动 -->
<template>
<div class="ctnr">
<GLCombiForm class="search-wrap" rowNumber="2" ref="orderRef" @handleOk="handleSearch" @handleRest="handleReset" :formObj="orderFormObj" :formData="orderFormData">
</GLCombiForm>
<div class="main-wrap">
<div class="global-title-wrap">
<span v-for="item in titleList" :key="item.id" :class="['title', {'curTitleCla': orderFormObj.requestType==item.id}]" @click="changeTable(item.id)">{{item.name}}</span>
</div>
<div class="table-wrap">
<GLTable @setTableFinishFun="setTableFinishFun" ref="tableRef" :pageConf="pageConf" :searchForm="searchForm" :tableParams="tableParams" :getListApi="getListApi" :beforeSearchFn="beforeSearchFn">
<div slot="goodsNameSlot" class="goodsNameSlot" slot-scope="scope">
<img :src="scope.scope.goodsImageUrl" alt="">
<el-tooltip class="item" effect="dark" :content="(scope.scope.brandName || '') + (scope.scope.goodsSkuName || '')" placement="top">
<span class="name">{{ scope.scope.brandName }} {{ scope.scope.goodsSkuName }}</span>
</el-tooltip>
</div>
<div slot="userInfoSlot" class="userInfoSlot" slot-scope="scope">
<p class="name">{{ scope.scope.accountName || '--' }}</p>
<p class="phone">{{ scope.scope.customerPhone}}</p>
</div>
<div slot="orderStatusSlot" slot-scope="scope">
<span class="circle" :style="{backgroundColor: (scope.scope.returnOrderStatus == 1003 || scope.scope.returnOrderStatus == 1006) ? '#2CCA74': '#5850FF'}"></span>
<span>{{ (scope.scope.returnOrderStatus == 1003 || scope.scope.returnOrderStatus == 1006) ? '售后完成': '售后中' }}</span>
</div>
<div slot="orderNoSlot" class="userInfoSlot" slot-scope="scope">
<p class="name">第三方:{{ scope.scope.returnOrderCode || '--' }}</p>
<p class="name">平台:{{ scope.scope.tparReturnOrderCode || '--'}}</p>
</div>
<div slot="auth-button" slot-scope="scope">
<GLTableButton :buttonList="buttonList" :buttonItem="scope" :buttonNum="3"></GLTableButton>
</div>
</GLTable>
</div>
</div>
</div>
</template>
<script>
import { utils } from 'glsx-common'
import util from '@/util/util'
const titleList = [
{
id: 0,
name: '全部'
},
{
id: 1,
name: '售后中'
},
{
id: 2,
name: '售后完成'
}
]
export default {
name: 'goodsOrderIndex',
data() {
return {
size: 'small',
titleList,
searchForm: {},
buttonList: [
{
type: 'el-button',
name: '详情',
attrs: {
type: 'text',
fn: '售后订单详情'
},
listeners: {
click: row => this.goOrderDetaillPage(row.scope)
}
}
],
orderFormObj: {
requestType: '0',
customerInfo: '',
goodsInfo: '',
searchOrderCode: '',
returnType: '',
time: ''
},
orderFormData: [
{
label: '用户信息',
name: 'customerInfo',
placeholder: '请输入姓名或手机号',
type: 'input',
isClear: true
},
{
label: '商品信息',
name: 'goodsInfo',
type: 'input',
isClear: true
},
{
label: '售后编号',
name: 'searchOrderCode',
type: 'input',
isClear: true
},
{
label: '售后类型',
name: 'returnType',
type: 'select',
optionList: [
{
label: '全部',
value: '1000'
},
{
label: '退货退款',
value: '1001'
},
{
label: '仅退款',
value: '1002'
},
{
label: '退货换货',
value: '1003'
},
],
optionId: 'value',
optionLabel: 'label',
},
{
label: '申请时间',
name: 'time',
type: 'datePicker',
isClear: true,
pickerOptions: 'beforeRangePickerOptions'
}
],
getListApi: this.$apis.platformGoods.getSaleOrderList,
pageConf: { pageSize: 'pageSize', pageNum: 'currentPage', totalCount: 'total' },
tableParams: {
listName: 'list',
tableOption: true,
tableColumns: [
{
label: '商品名称',
minWidth: 300,
addHtml: 'goodsNameSlot'
},
{
label: '申请数量',
width: 130,
prop: 'applyQty'
},
{
label: '申请金额 (元)',
width: 130,
prop: 'refundPrice'
},
{
label: '售后类型',
width: 130,
prop: 'returnType',
formatter: cell => {
let obj = {1001: '退货退款', 1002: '仅退款', 1003:'退货换货'}
return obj[cell.returnType] || '--'
}
},
{
label: '用户信息',
width: 110,
addHtml: 'userInfoSlot'
},
{
label: '售后状态',
width: 110,
addHtml: 'orderStatusSlot'
},
{
label: '售后编号',
width: 300,
addHtml: 'orderNoSlot'
},
{
label: '申请时间',
width: 200,
formatter: cellValue => {
return cellValue.createdDate ? util.dateFormat(cellValue.createdDate, 'YYYY-MM-DD HH:mm:ss') : '--'
}
}
]
}
}
},
components: {
},
mounted() {
},
methods: {
setTableFinishFun () {
//接收到的数据为空
this.$refs.tableRef.data.length ? (this.$refs.tableRef.tableHeightValues = '') : this.$refs.tableRef.setTableHeightFun()
},
changeTable(id){
this.orderFormObj.requestType = id
this.handleSearch()
},
handleReset(){
this.orderFormObj = {
requestType: this.orderFormObj.requestType,
customerInfo: '',
goodsInfo: '',
searchOrderCode: '',
returnType: '',
time: ''
}
this.handleSearch()
},
handleSearch(){
this.$refs.tableRef.refreshTable()
},
getParams(){
let params = utils.deepClone(this.orderFormObj)
if(params?.time?.length){
params.createdStartTime = new Date(params.time[0]).toLocaleDateString().replace(/\//g, '-') + ' 00:00:00'
params.createdEndTime = new Date(params.time[1]).toLocaleDateString().replace(/\//g, '-') + ' 23:59:59'
}
delete params.time
return params
},
beforeSearchFn(){
return new Promise((resolve, reject)=>{
this.searchForm = this.getParams()
resolve()
})
},
goOrderDetaillPage(item){
this.$router.push({ path: `/saleOrder/detail/${item.tparReturnOrderCode}`})
},
}
}
</script>
<style scoped lang="scss">
.ctnr{
.search-wrap{
background-color: #fff;
padding: 20px;
}
.main-wrap{
background-color: #fff;
margin-top: 16px;
.table-wrap{
padding: 20px;
.userInfoSlot{
.name{
font-size: 14px;
color: #666666;
}
.phone{
font-size: 10px;
color: #999999;
}
}
}
}
}
</style>
\ No newline at end of file \ No newline at end of file
const path = require('path')
const packageName = require('./package.json').name
const node_env = process.env.NODE_ENV === 'production'
const publicPath = node_env ? `/child/${packageName}/` : '/'
const resolve = dir => path.join(__dirname, dir)
// const CDN_DOMAIN = 'https://cdn.bootcdn.net/'
const CDN_DOMAIN = 'https://img02.glsx.com.cn/'
const cdn = {
//css: [`${CDN_DOMAIN}ajax/libs/element-ui/2.11.1/theme-chalk/index.css`],
css: [`${CDN_DOMAIN}ajax/libs/element-ui/2.11.1/theme-chalk/index.css`],
js: [`${CDN_DOMAIN}ajax/libs/vue/2.6.11/vue.min.js`, `${CDN_DOMAIN}ajax/libs/vue-router/3.2.0/vue-router.min.js`, `${CDN_DOMAIN}ajax/libs/element-ui/2.11.1/index.js`, `${CDN_DOMAIN}ajax/libs/vuex/3.6.2/vuex.min.js`, `${CDN_DOMAIN}ajax/libs/echarts/5.1.2/echarts.min.js`]
}
module.exports = {
outputDir: `dist`,
publicPath,
assetsDir: 'static',
productionSourceMap: false,
configureWebpack: {
resolve: {
alias: {
'@': resolve('src'),
assets: resolve('src/assets'),
views: resolve('src/views'),
components: resolve('src/components')
}
},
output: {
library: `${packageName}-[name]`,
libraryTarget: 'umd', // 把微应用打包成 umd 库格式
jsonpFunction: `webpackJsonp_${packageName}`
},
externals: {
vue: 'Vue',
'element-ui': 'ELEMENT',
'vue-router': 'VueRouter',
vuex: 'Vuex',
axios: 'axios',
echarts: 'echarts'
}
},
devServer: {
hot: true,
disableHostCheck: true,
host: process.env.VUE_APP_HOST,
port: process.env.VUE_APP_PORT,
headers: {
'Access-Control-Allow-Origin': '*' // 主应用获取子应用时跨域响应头
}
},
chainWebpack: config => {
config.plugin('html').tap(args => {
// args[0].minify.removeComments = false;
args[0].cdn = cdn
return args
})
config.plugins.delete('preload') // TODO: need test
config.plugins.delete('prefetch') // TODO: need test
config.module
.rule('fonts')
.test(/.(ttf|otf|eot|woff|woff2)$/)
.use('url-loader')
.loader('url-loader')
.tap(options => {
options = {
// limit: 10000,
name: '/static/fonts/[name].[ext]'
}
return options
})
.end()
}
}
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!