diff --git a/manager/package.json b/manager/package.json index 45dbf723..e7cc6f19 100644 --- a/manager/package.json +++ b/manager/package.json @@ -32,7 +32,8 @@ "vue-router": "^3.1.3", "vuedraggable": "^2.23.2", "vuex": "^3.4.0", - "xss": "^1.0.7" + "xss": "^1.0.7", + "price-color":"1.0.2" }, "devDependencies": { "@vue/cli-plugin-babel": "^4.4.4", diff --git a/manager/src/config/index.js b/manager/src/config/index.js index cbbf0588..d8e2ebb6 100644 --- a/manager/src/config/index.js +++ b/manager/src/config/index.js @@ -11,5 +11,6 @@ module.exports = { website: "https://www.pickmall.cn", //官网地址 enableCDN: true, //生产环境 是否启用cdn加载 vue等js port: 10003, //端口 - inputMaxLength:'140' //全局输入框默认最大输入长度字 + inputMaxLength:'140', //全局输入框默认最大输入长度字 + mainColor:"#ff5c58", //主题色 }; diff --git a/manager/src/main.js b/manager/src/main.js index 595d42ce..cc153c1a 100644 --- a/manager/src/main.js +++ b/manager/src/main.js @@ -25,7 +25,7 @@ import {md5} from '@/utils/md5.js'; import Print from 'vue-print-nb'; Vue.use(Print); -const {aMapSecurityJsCode, inputMaxLength} = require("@/config"); +const {aMapSecurityJsCode, inputMaxLength,mainColor } = require("@/config"); // 高德安全密钥 if (aMapSecurityJsCode) { window._AMapSecurityConfig = { @@ -45,6 +45,9 @@ Vue.prototype.wapLinkTo = function (goodsId, skuId) { // app端二维码 return `${WAP_URL}/pages/product/goods?id=${skuId}&goodsId=${goodsId}` }; +// 引入价格格式化组件 +import priceColorScheme from 'price-color' +Vue.use(priceColorScheme); const copyViewUi = {...ViewUI} copyViewUi.Input.props.maxlength.default = inputMaxLength // 挂载最大输入值 @@ -66,6 +69,7 @@ Vue.prototype.uploadFileRequest = uploadFileRequest; Vue.prototype.setStore = setStore; Vue.prototype.getStore = getStore; Vue.prototype.removeStore = removeStore; +Vue.prototype.$mainColor = mainColor; Vue.prototype.md5 = md5; Array.prototype.remove = function (from, to) { diff --git a/manager/src/views/distribution/distribution.vue b/manager/src/views/distribution/distribution.vue index 761bc2ef..62eac804 100644 --- a/manager/src/views/distribution/distribution.vue +++ b/manager/src/views/distribution/distribution.vue @@ -105,11 +105,9 @@ export default { width: 150, sortable: false, render: (h, params) => { - return h( - "div", - this.$options.filters.unitPrice(params.row.rebateTotal, "¥") - ); + return h("priceColorScheme", {props:{value:params.row.rebateTotal,color:this.$mainColor}} ); }, + }, { title: "可用金额", @@ -117,10 +115,7 @@ export default { width: 150, sortable: false, render: (h, params) => { - return h( - "div", - this.$options.filters.unitPrice(params.row.canRebate, "¥") - ); + return h("priceColorScheme", {props:{value:params.row.canRebate,color:'green'}} ); }, }, { @@ -129,10 +124,7 @@ export default { width: 150, sortable: false, render: (h, params) => { - return h( - "div", - this.$options.filters.unitPrice(params.row.commissionFrozen, "¥") - ); + return h("priceColorScheme", {props:{value:params.row.commissionFrozen,color:'#347dda'}} ); }, }, { diff --git a/manager/src/views/distribution/distributionCash.vue b/manager/src/views/distribution/distributionCash.vue index 7e130b5f..c76a798d 100644 --- a/manager/src/views/distribution/distributionCash.vue +++ b/manager/src/views/distribution/distributionCash.vue @@ -97,8 +97,8 @@ export default { key: "price", minWidth: 90, render: (h, params) => { - return h("div", this.$options.filters.unitPrice(params.row.price,'¥')); - } + return h("priceColorScheme", {props:{value:params.row.price,color:this.$mainColor}} ); + }, }, { title: "申请时间", diff --git a/manager/src/views/distribution/distributionGoods.vue b/manager/src/views/distribution/distributionGoods.vue index 2053cfe1..53dca285 100644 --- a/manager/src/views/distribution/distributionGoods.vue +++ b/manager/src/views/distribution/distributionGoods.vue @@ -98,11 +98,9 @@ export default { key: "price", minWidth: 100, render: (h, params) => { - return h( - "div", - this.$options.filters.unitPrice(params.row.price, "¥") - ); + return h("priceColorScheme", {props:{value:params.row.price,color:this.$mainColor}} ); }, + }, { title: "库存", @@ -126,11 +124,9 @@ export default { minWidth: 100, sortable: false, render: (h, params) => { - return h( - "div", - this.$options.filters.unitPrice(params.row.commission, "¥") - ); + return h("priceColorScheme", {props:{value:params.row.commission,color:this.$mainColor}} ); }, + }, { title: "操作", diff --git a/manager/src/views/distribution/distributionOrder.vue b/manager/src/views/distribution/distributionOrder.vue index 2f0c8852..53a372f1 100644 --- a/manager/src/views/distribution/distributionOrder.vue +++ b/manager/src/views/distribution/distributionOrder.vue @@ -126,13 +126,10 @@ minWidth:80, sortable: false, render: (h, params) => { - if(params.row.rebate == null){ - return h("div", this.$options.filters.unitPrice(0, '¥')); - }else{ - return h("div", this.$options.filters.unitPrice(params.row.rebate, '¥')); - } + return h("priceColorScheme", {props:{value:params.row.rebate,color:this.$mainColor}} ); + }, + - } }, { fixed: "right", diff --git a/manager/src/views/goods/goods-info/goods.vue b/manager/src/views/goods/goods-info/goods.vue index a7862b16..94a3b332 100644 --- a/manager/src/views/goods/goods-info/goods.vue +++ b/manager/src/views/goods/goods-info/goods.vue @@ -200,10 +200,7 @@ export default { key: "price", width: 130, render: (h, params) => { - return h( - "div", - this.$options.filters.unitPrice(params.row.price, "¥") - ); + return h("priceColorScheme", {props:{value:params.row.price,color:this.$mainColor}} ); }, }, { diff --git a/manager/src/views/goods/goods-info/goodsApply.vue b/manager/src/views/goods/goods-info/goodsApply.vue index e6438bc7..7c7080a0 100644 --- a/manager/src/views/goods/goods-info/goodsApply.vue +++ b/manager/src/views/goods/goods-info/goodsApply.vue @@ -115,7 +115,7 @@ export default { key: "price", minWidth: 130, render: (h, params) => { - return h("div", this.$options.filters.unitPrice(params.row.price, "¥")); + return h("priceColorScheme", {props:{value:params.row.price,color:this.$mainColor}} ); }, }, { diff --git a/manager/src/views/goods/goods-info/goodsDetail.vue b/manager/src/views/goods/goods-info/goodsDetail.vue index e83198e3..2ef4e8c9 100644 --- a/manager/src/views/goods/goods-info/goodsDetail.vue +++ b/manager/src/views/goods/goods-info/goodsDetail.vue @@ -38,7 +38,8 @@