feat: 商家端新增格式化价格文件插件并在代码中引入,更新代码需要install插件

master
Yer 2023-07-03 16:28:58 +08:00
parent 26a539662e
commit bf70527c58
26 changed files with 61 additions and 87 deletions

View File

@ -235,11 +235,9 @@ export default {
key: "finalPrice", key: "finalPrice",
width: 120, width: 120,
render: (h, params) => { render: (h, params) => {
return h( return h("priceColorScheme", {props:{value:params.row.finalPrice,color:this.$mainColor}} );
"div",
this.$options.filters.unitPrice(params.row.finalPrice, "¥")
);
}, },
}, },
{ {
title: "平台分佣", title: "平台分佣",

View File

@ -602,8 +602,9 @@
key: "flowPrice", key: "flowPrice",
width: 140, width: 140,
render: (h, params) => { render: (h, params) => {
return h("div", this.$options.filters.unitPrice(params.row.flowPrice, '¥')); return h("priceColorScheme", {props:{value:params.row.flowPrice,color:this.$mainColor}} );
} },
}, },
{ {
title: "订单类型", title: "订单类型",

View File

@ -18,6 +18,7 @@
"dplayer": "^1.27.0", "dplayer": "^1.27.0",
"js-cookie": "^2.2.1", "js-cookie": "^2.2.1",
"node-sass": "^4.14.1", "node-sass": "^4.14.1",
"price-color": "^1.0.2",
"s": "^1.0.0", "s": "^1.0.0",
"sass-loader": "^8.0.2", "sass-loader": "^8.0.2",
"sockjs-client": "^1.4.0", "sockjs-client": "^1.4.0",

View File

@ -11,5 +11,10 @@ module.exports = {
website: "https://www.pickmall.cn", //官网地址 website: "https://www.pickmall.cn", //官网地址
enableCDN: true, //生产环境 是否启用cdn加载 vue等js enableCDN: true, //生产环境 是否启用cdn加载 vue等js
port: 10002, //端口 port: 10002, //端口
inputMaxLength:'140' //全局输入框默认最大输入长度字 inputMaxLength:'140', //全局输入框默认最大输入长度字
/**
* 如需更换主题请修改此处以及theme.less中修改
*/
mainColor:"#ff5c58", //主题色
}; };

View File

@ -28,7 +28,7 @@ import * as filters from "@/utils/filters"; // global filter
import {md5} from "@/utils/md5.js"; import {md5} from "@/utils/md5.js";
const {aMapSecurityJsCode, inputMaxLength} = require("@/config"); const {aMapSecurityJsCode, inputMaxLength,mainColor} = require("@/config");
// 打印 // 打印
import Print from 'vue-print-nb'; import Print from 'vue-print-nb';
@ -46,6 +46,9 @@ Vue.use(VueLazyload, {
loading: require("./assets/loading2.gif") loading: require("./assets/loading2.gif")
}); });
// 引入价格格式化组件
import priceColorScheme from 'price-color'
Vue.use(priceColorScheme);
const copyViewUi = {...ViewUI} const copyViewUi = {...ViewUI}
copyViewUi.Input.props.maxlength.default = inputMaxLength // 挂载最大输入值 copyViewUi.Input.props.maxlength.default = inputMaxLength // 挂载最大输入值
@ -66,6 +69,7 @@ Vue.prototype.uploadFileRequest = uploadFileRequest;
Vue.prototype.setStore = setStore; Vue.prototype.setStore = setStore;
Vue.prototype.getStore = getStore; Vue.prototype.getStore = getStore;
Vue.prototype.removeStore = removeStore; Vue.prototype.removeStore = removeStore;
Vue.prototype.$mainColor = mainColor;
Vue.prototype.md5 = md5; Vue.prototype.md5 = md5;
const PC_URL = BASE.PC_URL; // 跳转买家端地址 pc端 const PC_URL = BASE.PC_URL; // 跳转买家端地址 pc端
const WAP_URL = BASE.WAP_URL; // 跳转买家端地址 wap端 const WAP_URL = BASE.WAP_URL; // 跳转买家端地址 wap端

View File

@ -118,7 +118,7 @@ export default {
key: "price", key: "price",
width: 130, width: 130,
render: (h, params) => { render: (h, params) => {
return h("div", this.$options.filters.unitPrice(params.row.price,'¥')); return h("priceColorScheme", {props:{value:params.row.price,color:this.$mainColor}} );
} }
}, },
{ {

View File

@ -85,10 +85,7 @@ export default {
title: "商品价格", title: "商品价格",
key: "price", key: "price",
render: (h, params) => { render: (h, params) => {
return h( return h("priceColorScheme", {props:{value:params.row.price,color:this.$mainColor}} );
"div",
this.$options.filters.unitPrice(params.row.price, "¥")
);
}, },
}, },
{ {

View File

@ -354,7 +354,7 @@ export default {
key: "price", key: "price",
width: 130, width: 130,
render: (h, params) => { render: (h, params) => {
return h("div", this.$options.filters.unitPrice(params.row.price, "¥")); return h("priceColorScheme", {props:{value:params.row.price,color:this.$mainColor}} );
}, },
}, },
{ {

View File

@ -196,7 +196,7 @@
订单金额 订单金额
</dt> </dt>
<dd> <dd>
{{ complaintInfo.orderPrice | unitPrice('¥')}} <priceColorScheme :value="complaintInfo.orderPrice" :color="$mainColor"></priceColorScheme>
</dd> </dd>
</dl> </dl>

View File

@ -143,11 +143,9 @@
key: "applyRefundPrice", key: "applyRefundPrice",
width: 130, width: 130,
render: (h, params) => { render: (h, params) => {
return h( return h("priceColorScheme", {props:{value:params.row.applyRefundPrice,color:this.$mainColor}} );
"div",
this.$options.filters.unitPrice(params.row.applyRefundPrice, "¥")
);
}, },
}, },
{ {
title: "会员名称", title: "会员名称",

View File

@ -142,13 +142,10 @@
title: "申请退款金额", title: "申请退款金额",
key: "applyRefundPrice", key: "applyRefundPrice",
width: 130, width: 130,
render: (h, params) => { render: (h, params) => {
return h( return h("priceColorScheme", {props:{value:params.row.applyRefundPrice,color:this.$mainColor}} );
"div",
this.$options.filters.unitPrice(params.row.applyRefundPrice, "¥")
);
}, },
}, },
{ {
title: "会员", title: "会员",

View File

@ -22,7 +22,9 @@
</dl> </dl>
<dl> <dl>
<dt>申请退款金额</dt> <dt>申请退款金额</dt>
<dd>{{ afterSaleInfo.applyRefundPrice | unitPrice('¥') }}</dd> <dd>
<priceColorScheme :value="afterSaleInfo.applyRefundPrice" :color="$mainColor" />
</dd>
</dl> </dl>
<dl v-if="afterSaleInfo.actualRefundPrice"> <dl v-if="afterSaleInfo.actualRefundPrice">
<dt>实际退款金额</dt> <dt>实际退款金额</dt>
@ -89,7 +91,9 @@
<dl> <dl>
<dt>申请退款金额</dt> <dt>申请退款金额</dt>
<dd>{{ afterSaleInfo.applyRefundPrice | unitPrice('¥') }}</dd> <dd>
<priceColorScheme :value="afterSaleInfo.applyRefundPrice" :color="$mainColor" />
</dd>
</dl> </dl>
<dl v-if="params.serviceStatus == 'PASS'"> <dl v-if="params.serviceStatus == 'PASS'">
<dt>实际退款金额</dt> <dt>实际退款金额</dt>

View File

@ -202,10 +202,7 @@ export default {
minWidth: 100, minWidth: 100,
tooltip: true, tooltip: true,
render: (h, params) => { render: (h, params) => {
return h( return h("priceColorScheme", {props:{value:params.row.flowPrice,color:this.$mainColor}} );
"div",
this.$options.filters.unitPrice(params.row.flowPrice, "¥")
);
}, },
}, },

View File

@ -107,11 +107,10 @@ export default {
minWidth: 100, minWidth: 100,
tooltip: true, tooltip: true,
render: (h, params) => { render: (h, params) => {
return h( return h("priceColorScheme", {props:{value:params.row.flowPrice,color:this.$mainColor}} );
"div",
this.$options.filters.unitPrice(params.row.flowPrice, "¥")
);
}, },
}, },
{ {

View File

@ -96,10 +96,7 @@ export default {
key: "billPrice", key: "billPrice",
width: 150, width: 150,
render: (h, params) => { render: (h, params) => {
return h( return h("priceColorScheme", {props:{value:params.row.receiptPrice,color:this.$mainColor}} );
"div",
this.$options.filters.unitPrice(params.row.receiptPrice, "¥")
);
}, },
}, },
{ {

View File

@ -301,7 +301,7 @@ export default {
key: "price", key: "price",
minWidth: 40, minWidth: 40,
render: (h, params) => { render: (h, params) => {
return h("div", this.$options.filters.unitPrice(params.row.price, "¥")); return h("priceColorScheme", {props:{value:params.row.price,color:this.$mainColor}} );
}, },
}, },
{ {

View File

@ -127,10 +127,7 @@ export default {
width: 100, width: 100,
render: (h, params) => { render: (h, params) => {
if (params.row.price) { if (params.row.price) {
return h( return h("priceColorScheme", {props:{value:params.row.price,color:this.$mainColor}} );
"div",
this.$options.filters.unitPrice(params.row.price, "¥")
);
} else { } else {
return h("div", params.row.discount + "折"); return h("div", params.row.discount + "折");
} }

View File

@ -155,10 +155,7 @@ export default {
width: 100, width: 100,
render: (h, params) => { render: (h, params) => {
if (params.row.price) { if (params.row.price) {
return h( return h("priceColorScheme", {props:{value:params.row.price,color:this.$mainColor}} );
"div",
this.$options.filters.unitPrice(params.row.price || 0, "¥")
);
} else { } else {
return h("div", (params.row.couponDiscount || 0) + "折"); return h("div", (params.row.couponDiscount || 0) + "折");
} }

View File

@ -201,10 +201,7 @@ export default {
key: "price", key: "price",
minWidth: 40, minWidth: 40,
render: (h, params) => { render: (h, params) => {
return h( return h("priceColorScheme", {props:{value:params.row.price,color:this.$mainColor}} );
"div",
this.$options.filters.unitPrice(params.row.price, "¥")
);
}, },
}, },
{ {

View File

@ -53,9 +53,9 @@
</div> </div>
</RadioGroup> </RadioGroup>
<div v-else> <div v-else>
<div v-if="row.priceType == 1">{{row.price | unitPrice('')}}</div> <div v-if="row.priceType == 1"><priceColorScheme :value="row.price" :color="$mainColor" /></div>
<div v-if="row.priceType == 2">{{row.price | unitPrice('')}}{{row.price2 | unitPrice('')}}</div> <div class="flex" v-if="row.priceType == 2"><priceColorScheme :value="row.price" :color="$mainColor" /><priceColorScheme :value="row.price2" :color="$mainColor" /></div>
<div v-if="row.priceType == 3">{{row.price2 | unitPrice('¥')}}<span class="original-price">{{row.price | unitPrice('')}}</span></div> <div class="flex" v-if="row.priceType == 3"><priceColorScheme :value="row.price2" :color="$mainColor" /><span class="original-price">{{row.price | unitPrice('')}}</span></div>
</div> </div>
</template> </template>
@ -381,4 +381,9 @@ h4 {
line-height: 40px; line-height: 40px;
text-align: left; text-align: left;
} }
.flex{
display: flex;
align-items: center;
justify-content: flex-start;
}
</style> </style>

View File

@ -82,7 +82,7 @@
title: "账单号", title: "账单号",
key: "sn", key: "sn",
minWidth: 250, minWidth: 250,
tooltip: true tooltip: true
}, },
{ {
title: "生成时间", title: "生成时间",
@ -103,10 +103,7 @@
key: "billPrice", key: "billPrice",
minWidth: 100, minWidth: 100,
render: (h, params) => { render: (h, params) => {
return h( return h("priceColorScheme", {props:{value:params.row.billPrice,color:this.$mainColor}} );
"div",
this.$options.filters.unitPrice(params.row.billPrice, "¥")
);
}, },
}, },

View File

@ -180,10 +180,7 @@ export default {
title: "订单金额", title: "订单金额",
key: "finalPrice", key: "finalPrice",
render: (h, params) => { render: (h, params) => {
return h( return h("priceColorScheme", {props:{value:params.row.finalPrice,color:this.$mainColor}} );
"div",
this.$options.filters.unitPrice(params.row.finalPrice, "¥")
);
}, },
}, },
{ {
@ -191,13 +188,7 @@ export default {
key: "kanjiaSettlementPrice", key: "kanjiaSettlementPrice",
render: (h, params) => { render: (h, params) => {
if (params.row.kanjiaSettlementPrice) { if (params.row.kanjiaSettlementPrice) {
return h( return h("priceColorScheme", {props:{value:params.row.kanjiaSettlementPrice,color:this.$mainColor}} );
"div",
this.$options.filters.unitPrice(
params.row.kanjiaSettlementPrice,
"¥"
)
);
} else { } else {
return h("div", "¥0.00"); return h("div", "¥0.00");
} }

View File

@ -106,11 +106,9 @@
key: "billPrice", key: "billPrice",
minWidth: 100, minWidth: 100,
render: (h, params) => { render: (h, params) => {
return h( return h("priceColorScheme", {props:{value:params.row.billPrice,color:this.$mainColor}} );
"div",
this.$options.filters.unitPrice(params.row.billPrice, "¥")
);
}, },
}, },

View File

@ -47,10 +47,7 @@ export default {
title: "销售金额", title: "销售金额",
key: "price", key: "price",
render: (h, params) => { render: (h, params) => {
return h( return h("priceColorScheme", {props:{value:params.row.price,color:this.$mainColor}} );
"div",
this.$options.filters.unitPrice(params.row.price)
);
}, },
}, },
], ],

View File

@ -260,10 +260,7 @@ export default {
title: "价格", title: "价格",
key: "flowPrice", key: "flowPrice",
render: (h, params) => { render: (h, params) => {
return h( return h("priceColorScheme", {props:{value:params.row.flowPrice,color:this.$mainColor}} );
"div",
this.$options.filters.unitPrice(params.row.flowPrice, "¥")
);
}, },
}, },
], ],
@ -329,11 +326,9 @@ export default {
title: "申请退款金额", title: "申请退款金额",
key: "applyRefundPrice", key: "applyRefundPrice",
render: (h, params) => { render: (h, params) => {
return h( return h("priceColorScheme", {props:{value:params.row.applyRefundPrice,color:this.$mainColor}} );
"div",
this.$options.filters.unitPrice(params.row.applyRefundPrice, "¥")
);
}, },
}, },
{ {
title: "申请原因", title: "申请原因",

View File

@ -18,7 +18,9 @@
</div> </div>
<div class="label-item"> <div class="label-item">
<span>申请退款金额</span> <span>申请退款金额</span>
<span>{{res.applyRefundPrice || '0'}}</span> <span>
<priceColorScheme :value="afterSaleInfo.applyRefundPrice" :color="$mainColor" />
</span>
</div> </div>
<div class="label-item"> <div class="label-item">
<span>商家备注</span> <span>商家备注</span>