订单状态
diff --git a/seller/src/config/index.js b/seller/src/config/index.js
index 17f824e8..a7163666 100644
--- a/seller/src/config/index.js
+++ b/seller/src/config/index.js
@@ -18,14 +18,14 @@ export default {
* @description api请求基础路径
*/
api_dev: {
- // common: 'https://common-api.pickmall.cn',
- // buyer: 'https://buyer-api.pickmall.cn',
- // seller: 'https://store-api.pickmall.cn',
- // manager: 'https://admin-api.pickmall.cn',
- common: 'http://192.168.0.100:8890',
- buyer: 'http://192.168.0.100:8888',
- seller: 'http://192.168.0.100:8889',
- manager: 'http://192.168.0.100:8887'
+ common: 'https://common-api.pickmall.cn',
+ buyer: 'https://buyer-api.pickmall.cn',
+ seller: 'https://store-api.pickmall.cn',
+ manager: 'https://admin-api.pickmall.cn',
+ // common: 'http://192.168.0.109:8890',
+ // buyer: 'http://192.168.0.109:8888',
+ // seller: 'http://192.168.0.109:8889',
+ // manager: 'http://192.168.0.109:8887'
},
api_prod: {
common: 'https://common-api.pickmall.cn',
diff --git a/seller/src/utils/filters.js b/seller/src/utils/filters.js
index f5b6f8a4..c0b03cf1 100644
--- a/seller/src/utils/filters.js
+++ b/seller/src/utils/filters.js
@@ -6,17 +6,32 @@
* @returns {*}
*/
export function unitPrice(val, unit, location) {
- let price = formatPrice(val)
- if (location === 'before') {
- return price.substr(0, price.length - 3)
+ let price = formatPrice(val);
+ if (location === "before") {
+ return price.substr(0, price.length - 3);
}
- if (location === 'after') {
- return price.substr(-2)
+ if (location === "after") {
+ return price.substr(-2);
}
- return (unit || '') + price
+ return (unit || "") + price;
}
-
+/**
+ * 订单来源
+ */
+export function clientTypeWay(val) {
+ if (val == "H5") {
+ return "移动端";
+ } else if (val == "PC") {
+ return "PC端";
+ } else if (val == "WECHAT_MP") {
+ return "小程序端";
+ } else if (val == "APP") {
+ return "移动应用端";
+ } else {
+ return val;
+ }
+}
/**
* 货币格式化
@@ -24,8 +39,8 @@ export function unitPrice(val, unit, location) {
* @returns {string}
*/
export function formatPrice(price) {
- if (typeof price !== 'number') return price
- return String(Number(price).toFixed(2)).replace(/\B(?=(\d{3})+(?!\d))/g, ',')
+ if (typeof price !== "number") return price;
+ return String(Number(price).toFixed(2)).replace(/\B(?=(\d{3})+(?!\d))/g, ",");
}
/**
@@ -35,51 +50,60 @@ export function formatPrice(price) {
* @returns {*|string}
*/
export function unixToDate(unix, format) {
- let _format = format || 'yyyy-MM-dd hh:mm:ss'
- const d = new Date(unix * 1000)
+ let _format = format || "yyyy-MM-dd hh:mm:ss";
+ const d = new Date(unix * 1000);
const o = {
- 'M+': d.getMonth() + 1,
- 'd+': d.getDate(),
- 'h+': d.getHours(),
- 'm+': d.getMinutes(),
- 's+': d.getSeconds(),
- 'q+': Math.floor((d.getMonth() + 3) / 3),
+ "M+": d.getMonth() + 1,
+ "d+": d.getDate(),
+ "h+": d.getHours(),
+ "m+": d.getMinutes(),
+ "s+": d.getSeconds(),
+ "q+": Math.floor((d.getMonth() + 3) / 3),
S: d.getMilliseconds()
- }
- if (/(y+)/.test(_format)) _format = _format.replace(RegExp.$1, (d.getFullYear() + '').substr(4 - RegExp.$1.length))
- for (const k in o) if (new RegExp('(' + k + ')').test(_format)) _format = _format.replace(RegExp.$1, (RegExp.$1.length === 1) ? (o[k]) : (('00' + o[k]).substr(('' + o[k]).length)))
- return _format
+ };
+ if (/(y+)/.test(_format))
+ _format = _format.replace(
+ RegExp.$1,
+ (d.getFullYear() + "").substr(4 - RegExp.$1.length)
+ );
+ for (const k in o)
+ if (new RegExp("(" + k + ")").test(_format))
+ _format = _format.replace(
+ RegExp.$1,
+ RegExp.$1.length === 1 ? o[k] : ("00" + o[k]).substr(("" + o[k]).length)
+ );
+ return _format;
}
//是否格式化
export function unixWhether(status) {
switch (status) {
- case 'YES':
- return "是"
- case 'NO':
- return "否"
+ case "YES":
+ return "是";
+ case "NO":
+ return "否";
}
}
export function unixSellerBillStatus(status_code) {
switch (status_code) {
- case 'OUT':
- return '已出账'
- case 'CHECK':
- return '已对账'
- case 'EXAMINE':
- return '已审核'
- case 'PAY':
- return '已结算'
- case 'COMPLETE':
- return '已完成'
+ case "OUT":
+ return "已出账";
+ case "CHECK":
+ return "已对账";
+ case "EXAMINE":
+ return "已审核";
+ case "PAY":
+ return "已结算";
+ case "COMPLETE":
+ return "已完成";
}
}
export function unixSwitchStatus(status_code) {
switch (status_code) {
- case 'OPEN':
- return '开启'
- case 'CLOSE':
- return '关闭'
+ case "OPEN":
+ return "开启";
+ case "CLOSE":
+ return "关闭";
}
}
@@ -89,30 +113,35 @@ export function unixSwitchStatus(status_code) {
* @returns {*}
*/
export function secrecyMobile(mobile) {
- mobile = String(mobile)
+ mobile = String(mobile);
if (!/\d{11}/.test(mobile)) {
- return mobile
+ return mobile;
}
- return mobile.replace(/(\d{3})(\d{4})(\d{4})/, '$1****$3')
+ return mobile.replace(/(\d{3})(\d{4})(\d{4})/, "$1****$3");
}
-
export function formatDate(date, fmt) {
if (/(y+)/.test(fmt)) {
- fmt = fmt.replace(RegExp.$1, (date.getFullYear() + '').substr(4 - RegExp.$1.length));
+ fmt = fmt.replace(
+ RegExp.$1,
+ (date.getFullYear() + "").substr(4 - RegExp.$1.length)
+ );
}
let o = {
- 'M+': date.getMonth() + 1,
- 'd+': date.getDate(),
- 'h+': date.getHours(),
- 'm+': date.getMinutes(),
- 's+': date.getSeconds()
+ "M+": date.getMonth() + 1,
+ "d+": date.getDate(),
+ "h+": date.getHours(),
+ "m+": date.getMinutes(),
+ "s+": date.getSeconds()
};
for (let k in o) {
- if (new RegExp(`(${k})`).test(fmt)) {
- let str = o[k] + '';
- fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1) ? str : padLeftZero(str));
- }
+ if (new RegExp(`(${k})`).test(fmt)) {
+ let str = o[k] + "";
+ fmt = fmt.replace(
+ RegExp.$1,
+ RegExp.$1.length === 1 ? str : padLeftZero(str)
+ );
+ }
}
return fmt;
-};
+}
diff --git a/seller/src/views/order/order/orderDetail.vue b/seller/src/views/order/order/orderDetail.vue
index e758ffd2..241e9403 100644
--- a/seller/src/views/order/order/orderDetail.vue
+++ b/seller/src/views/order/order/orderDetail.vue
@@ -21,7 +21,7 @@
订单来源:
- {{ orderInfo.order.clientType }}
+ {{ orderInfo.order.clientType | clientTypeWay }}
diff --git a/seller/src/views/promotion/coupon/coupon.vue b/seller/src/views/promotion/coupon/coupon.vue
index 9cd259de..5fae1965 100644
--- a/seller/src/views/promotion/coupon/coupon.vue
+++ b/seller/src/views/promotion/coupon/coupon.vue
@@ -2,29 +2,12 @@