提交 8c779b05 编写于 作者: guangjun.yang's avatar guangjun.yang

收入格式问题

上级 445fc26c
...@@ -17,12 +17,15 @@ const vueFilter = { ...@@ -17,12 +17,15 @@ const vueFilter = {
// 将数字转换成带千分位数字 // 将数字转换成带千分位数字
yLocalString: function (value) { yLocalString: function (value) {
var b = parseInt(value).toString(); var a = (value + "").split('.');
if (b === 'NaN') return 0; var c = a[1] ? a[1] : '00';
var b = parseInt(a[0]).toString();
if (b === 'NaN') return '0.00';
var len = b.length; var len = b.length;
if (len <= 3) { return b; } if (len <= 3) { return b + '.' + c; }
var r = len % 3; var r = len % 3;
return r > 0 ? b.slice(0, r) + "," + b.slice(r, len).match(/\d{3}/g).join(",") : b.slice(r, len).match(/\d{3}/g).join(","); var pre = r > 0 ? b.slice(0, r) + "," + b.slice(r, len).match(/\d{3}/g).join(",") : b.slice(r, len).match(/\d{3}/g).join(",");
return pre + '.' + c;
}, },
// 将字符串截短至指定长度,并用在最后追加特定字符串(例如:...) // 将字符串截短至指定长度,并用在最后追加特定字符串(例如:...)
......
/* eslint-disable */
import Vue from 'vue'
import request from '@/utils/fetch';
import wx from 'weixin-js-sdk'
import { getWxType } from "@/utils/index";
/** 注入配置信息 */
export const wxConfig = () => {
// const params = { resetURI: true, url: encodeURIComponent(location.href) };
// 上线前是需要把域名改为线上的sc
let type = '&type=' + getWxType(); // type不同,对应的appid不一样,15为线上
request({ url: `https://sc.yunqueyi.com/wechats/signs?url=${encodeURIComponent(location.href)}${type}` }).then(res => {
let configs = res.data.signMap;
wx.config({
debug: false,
appId: configs.appId,
nonceStr: configs.nonceStr,
timestamp: configs.timestamp,
signature: configs.signature,
jsApiList: [
'hideMenuItems',
'previewImage',
'checkJsApi',
'chooseWXPay',
'onMenuShareTimeline',
'onMenuShareAppMessage',
'onMenuShareQQ',
'onMenuShareWeibo',
'onMenuShareQZone',
'getLocation',
'openLocation',
'translateVoice'
]
});
});;
};
/**
* wxShare 分享
* @param option
*/
export const wxShare = (option = {}, successCB = () => {}) => {
wx.ready(() => {
WeixinJSBridge.call('showOptionMenu');
wx.showAllNonBaseMenuItem();
// 分享给朋友
wx.onMenuShareAppMessage({
title: option.title,
desc: option.desc,
link: option.link,
imgUrl: option.imgUrl,
success: function(res) {
// 用户确认分享后执行的回调函数
successCB(res);
},
cancel: function() {
// 用户取消分享后执行的回调函数
}
});
// 分享到朋友圈
wx.onMenuShareTimeline({
title: option.friendtitle || option.title, // 标题
desc: option.desc,
link: option.link, // 链接
imgUrl: option.imgUrl, // 分享图标
success: function(res) {
successCB(res);
},
cancel: function() {
// 用户取消分享后执行的回调函数
}
});
});
};
function wxHideMenu() {
wx.ready(() => {
WeixinJSBridge.call('hideOptionMenu');
wx.hideAllNonBaseMenuItem();
});
}
export const wxDisabledShare = () => {
wx.ready(() => {
wx.hideMenuItems({
menuList: [
'menuItem:share:appMessage',
'menuItem:share:timeline',
'menuItem:share:qq',
'menuItem:share:weiboApp',
'menuItem:share:QZone',
'menuItem:copyUrl',
'menuItem:openWithQQBrowser',
'menuItem:openWithSafari',
],
openTagList: ['wx-open-launch-app', 'wx-open-launch-weapp'],
});
});
};
/**
*
* @param source
* @param option
*/
export const wechatShare = (option = {}, successCB = () => {}, hideMenu) => {
const shareOption = {
link: location.href,
title: `云鹊医!`,
friendtitle: `讨论进行中,速来围观!`,
desc: '参与讨论,一起畅谈医学那些事!快来看看吧~',
imgUrl: 'https://file.yunqueyi.com/logo.png',
...option
};
wxConfig();
if (hideMenu) {
wxHideMenu()
} else {
wxShare(shareOption, successCB);
}
};
export function chooseWXPay(params) {
wx.ready(() => {
wx.chooseWXPay(params);
})
}
Vue.prototype.wechatShare = wechatShare;
Vue.prototype.wxDisabledShare = wxDisabledShare;
...@@ -175,9 +175,9 @@ export default { ...@@ -175,9 +175,9 @@ export default {
anualData.loginTotalTimeM = loginTotalTimeM; anualData.loginTotalTimeM = loginTotalTimeM;
anualData.loginTotalTimeH = loginTotalTimeH; anualData.loginTotalTimeH = loginTotalTimeH;
orderTotalAmount = anualData.orderTotalAmount; orderTotalAmount = anualData.orderTotalAmount || 0;
if (orderTotalAmount) { if (orderTotalAmount) {
orderTotalAmountY = Math.floor(orderTotalAmount / 100).toFixed(2); orderTotalAmountY = (orderTotalAmount / 100).toFixed(2);
} }
anualData.orderTotalAmountY = orderTotalAmountY; anualData.orderTotalAmountY = orderTotalAmountY;
this.anualData = anualData; this.anualData = anualData;
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册