Commit 2c009371 authored by 罗超's avatar 罗超

调整排行榜

parent bc533da4
This diff is collapsed.
......@@ -108,20 +108,20 @@ Vue.prototype.DateDiff = function (sDate1, sDate2) {
//价钱格式化,三位数逗号分隔,保留两位小数
Vue.prototype.moneyFormat = function (value) {
if (!value) {
return 0.00
}
let nStr = Number(value).toFixed(2)
nStr += '';
let x = nStr.split('.');
let x1 = x[0];
let x2 = x.length > 1 ? '.' + x[1] : '';
var rgx = /(\d+)(\d{3})/;
while (rgx.test(x1)) {
x1 = x1.replace(rgx, '$1' + ',' + '$2');
}
return x1 + x2;
},
if (!value) {
return 0.00
}
let nStr = Number(value).toFixed(2)
nStr += '';
let x = nStr.split('.');
let x1 = x[0];
let x2 = x.length > 1 ? '.' + x[1] : '';
var rgx = /(\d+)(\d{3})/;
while (rgx.test(x1)) {
x1 = x1.replace(rgx, '$1' + ',' + '$2');
}
return x1 + x2;
},
// 注册
Vue.filter('priceFormat', function (value) {
......@@ -174,15 +174,15 @@ Vue.filter("YMDHMS", function (date) {
})
Vue.prototype.random_string = function (len) {
len = len || 32;
var chars = 'ABCDEFGHJKMNPQRSTWXYZabcdefhijkmnprstwxyz2345678';
var maxPos = chars.length;
var pwd = '';
for (let i = 0; i < len; i++) {
pwd += chars.charAt(Math.floor(Math.random() * maxPos));
}
return pwd;
},
len = len || 32;
var chars = 'ABCDEFGHJKMNPQRSTWXYZabcdefhijkmnprstwxyz2345678';
var maxPos = chars.length;
var pwd = '';
for (let i = 0; i < len; i++) {
pwd += chars.charAt(Math.floor(Math.random() * maxPos));
}
return pwd;
},
//上传文件到文件服务器
Vue.prototype.UploadSelfFileT = function (path, files, successCall) {
......@@ -220,7 +220,7 @@ Vue.prototype.random_string = function (len) {
*/
Vue.prototype.UploadLocalSystem = function (params, fileObj, successCall) {
let that = this;
let url = that.domainManager().PostUrl+"/api/Upload/Index";
let url = that.domainManager().PostUrl + "/api/Upload/Index";
let formData = new FormData()
if (params) {
formData.append("params", JSON.stringify(params));
......@@ -279,6 +279,26 @@ Vue.prototype.checkInteger = function (item, filed) {
item[filed] = value;
}
Vue.prototype.formatDate = function (date, fmt, type) { //type : 类型 0:时间为秒 1:时间为毫秒
let ret;
const opt = {
"Y+": date.getFullYear().toString(), // 年
"M+": (date.getMonth() + 1).toString(), // 月
"d+": date.getDate().toString(), // 日
"h+": date.getHours().toString(), // 时
"m+": date.getMinutes().toString(), // 分
"s+": date.getSeconds().toString() // 秒
// 有其他格式化字符需求可以继续添加,必须转化成字符串
};
for (let k in opt) {
ret = new RegExp("(" + k + ")").exec(fmt);
if (ret) {
fmt = fmt.replace(ret[1], (ret[1].length == 1) ? (opt[k]) : (opt[k].padStart(ret[1].length, "0")))
};
};
return fmt;
}
new Vue({
router,
store,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment