添加注释

This commit is contained in:
mabo
2021-07-31 09:49:17 +08:00
parent ff92fd8d76
commit 2792d24e98
20 changed files with 39 additions and 139 deletions

View File

@@ -53,51 +53,6 @@ export function unitAddress (val) {
return val.replace(/,/g, ' ');
}
export function pointStatus (status) {
switch (status) {
case 'COMPLETE':
return '已成交';
case 'WITHDRAW':
return '已撤回';
case 'DEALING':
return '交易中';
case 'AUDITING':
return '待审核';
case 'NODEAL':
return '未成交';
case 'CANCEL':
return '已取消';
}
};
/**
* 根据订单状态码返回订单状态
* @param status_code
* @returns {string}
*/
export function unixOrderStatus (statusCode) {
switch (statusCode) {
case 'NEW':
return '新订单';
case 'INTODB_ERROR':
return '入库失败';
case 'CONFIRM':
return '已确认';
case 'PAID_OFF':
return '已付款';
case 'SHIPPED':
return '已发货';
case 'ROG':
return '已收货';
case 'COMPLETE':
return '已完成';
case 'CANCELLED':
return '已取消';
case 'AFTER_SERVICE':
return '售后中';
}
}
/**
* 13888888888 -> 138****8888
* @param mobile
@@ -110,13 +65,3 @@ export function secrecyMobile (mobile) {
}
return mobile.replace(/(\d{3})(\d{4})(\d{4})/, '$1****$3');
}
/**
* 格式化货品的规格
* @param sku
* @returns {*}
*/
export function formatterSkuSpec (sku) {
if (!sku.spec_list || !sku.spec_list.length) return '';
return sku.spec_list.map(spec => spec.spec_value).join(' - ');
}

View File

@@ -10,7 +10,7 @@
* Add integers, wrapping at 2^32. This uses 16-bit operations internally
* to work around bugs in some JS interpreters.
*/
function safe_add(x, y) {
function safe_add (x, y) {
var lsw = (x & 0xFFFF) + (y & 0xFFFF)
var msw = (x >> 16) + (y >> 16) + (lsw >> 16)
return (msw << 16) | (lsw & 0xFFFF)
@@ -19,7 +19,7 @@ function safe_add(x, y) {
/*
* Bitwise rotate a 32-bit number to the left.
*/
function rol(num, cnt) {
function rol (num, cnt) {
return (num << cnt) | (num >>> (32 - cnt))
}
@@ -42,7 +42,7 @@ function hh(a, b, c, d, x, s, t) {
return cmn(b ^ c ^ d, a, b, x, s, t)
}
function ii(a, b, c, d, x, s, t) {
function ii (a, b, c, d, x, s, t) {
return cmn(c ^ (b | (~d)), a, b, x, s, t)
}
@@ -50,7 +50,7 @@ function ii(a, b, c, d, x, s, t) {
* Calculate the MD5 of an array of little-endian words, producing an array
* of little-endian words.
*/
function coreMD5(x) {
function coreMD5 (x) {
var a = 1732584193
var b = -271733879
var c = -1732584194

View File

@@ -1,4 +1,3 @@
// import Vue from 'vue';
import axios from 'axios';
import https from 'https';
import { Message, Spin, Modal } from 'view-design';
@@ -8,6 +7,7 @@ import router from '../router/index.js';
import store from '../vuex/store';
import { handleRefreshToken } from '@/api/index';
const qs = require('qs');
// api地址
export const buyerUrl =
process.env.NODE_ENV === 'development'
? config.api_dev.buyer
@@ -180,13 +180,8 @@ export const Method = {
};
export default function request (options) {
// 如果是服务端或者是请求的刷新token不需要检查token直接请求。
// if (process.server || options.url.indexOf('passport/token') !== -1) {
return service(options);
// }
// service(options).then(resolve).catch(reject)
}
// 防抖闭包来一波
function getTokenDebounce () {
let lock = false;

View File

@@ -8,9 +8,9 @@ const psl = require('psl');
export default {
setItem: (key, value, options = {}) => {
if (process.client) {
const p_psl = psl.parse(document.domain);
let domain = p_psl.domain;
if (/\d+\.\d+\.\d+\.\d+/.test(p_psl.input)) domain = p_psl.input;
const pPsl = psl.parse(document.domain);
let domain = pPsl.domain;
if (/\d+\.\d+\.\d+\.\d+/.test(pPsl.input)) domain = pPsl.input;
options = { domain, ...options };
}
Cookies.set(key, value, options);
@@ -20,9 +20,9 @@ export default {
},
removeItem: (key, options = {}) => {
if (process.client) {
const p_psl = psl.parse(document.domain);
let domain = p_psl.domain;
if (/\d+\.\d+\.\d+\.\d+/.test(p_psl.input)) domain = p_psl.input;
const pPsl = psl.parse(document.domain);
let domain = pPsl.domain;
if (/\d+\.\d+\.\d+\.\d+/.test(pPsl.input)) domain = pPsl.input;
options = { domain, ...options };
}
Cookies.remove(key, options);