diff --git a/packageA/pages/hongBao/hongBao.js b/packageA/pages/hongBao/hongBao.js
new file mode 100644
index 0000000..18f1263
--- /dev/null
+++ b/packageA/pages/hongBao/hongBao.js
@@ -0,0 +1,322 @@
+// packageA//pages/hongBao/hongBao.js
+const app = getApp();
+let self = null;
+
+let ut = require("../../../utils/util.js")
+
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ url: app.globalData.setting.imghost,
+ qiangHongBao: false,
+ time: null,
+
+ // hongBaoData: null, //保存抢红包活动的相关时间等信息
+ isStart: 0, //记录抢红包活动是否开始
+ result: null, //保存抢红包的结果
+ },
+
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function (options) {
+ console.log('onload');
+ self = this;
+
+ this.isLogin()
+ .then(function(data) {
+
+ self.requestData('/api/weshop/redmoney/redConfig/get/'+app.globalData.setting.stoid, {})
+ .then(function(data) {
+ self.data.hongBaoData = data.data.data;
+ self.countDown();
+ self.setData({
+ storeName: app.globalData.config.store_name
+ });
+ });
+
+ });
+ },
+
+ // 判断是否授权登录
+ isLogin() {
+ return new Promise((resolve, reject) => {
+ let user_info = app.globalData.userInfo;
+ if(user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
+ wx.navigateTo({
+ url: '/pages/togoin/togoin',
+ })
+ } else {
+ resolve();
+ };
+ });
+ },
+
+ /**
+ * 生命周期函数--监听页面初次渲染完成
+ */
+ onReady: function () {
+ console.log('onready');
+
+
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function () {
+ console.log('onshow');
+
+
+
+
+ },
+
+ /**
+ * 生命周期函数--监听页面隐藏
+ */
+ onHide: function () {
+ console.log('onhide');
+ },
+
+ /**
+ * 生命周期函数--监听页面卸载
+ */
+ onUnload: function () {
+
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh: function () {
+
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom: function () {
+
+ },
+
+ /**
+ * 用户点击右上角分享
+ */
+ onShareAppMessage: function () {
+
+ },
+
+ // 请求数据
+ requestData(url, data) {
+ return new Promise((resolve, reject) => {
+ app.request.promiseGet(url, {data: data})
+ .then(res => {
+ if(res.data.code == 0) {
+ console.log('resolve', res);
+ resolve(res);
+ } else {
+ reject(res);
+ };
+ })
+ });
+ },
+
+ //秒杀倒计时
+ //---小于10的格式化函数----
+ timeFormat(param) {
+ return param < 10 ? '0' + param : param;
+ },
+
+ handleTime(time) {
+ var day = parseInt(time / (60 * 60 * 24));
+ var hou = parseInt(time % (60 * 60 * 24) / 3600);
+ var min = parseInt(time % (60 * 60 * 24) % 3600 / 60);
+ var sec = parseInt(time % (60 * 60 * 24) % 3600 % 60);
+ return {
+ day: this.timeFormat(day),
+ hou: this.timeFormat(hou),
+ min: this.timeFormat(min),
+ sec: this.timeFormat(sec),
+ };
+ },
+
+ //----秒杀倒计时函数-----
+ countDown() {
+ // if (!this.data.is_timer) return false;
+ var time;
+ // 获取当前时间,同时得到活动结束时间数组
+ var newTime = ut.gettimestamp();
+ // var List = this.data.saleGoods;
+ // for (var j = 0; j < List.length; j++) {
+ // var endTimeList = List[j];
+ // 对结束时间进行处理渲染到页面
+ // for (var i = 0; i < endTimeList.length; i++) {
+ // var o = endTimeList[i];
+ var startTime = this.data.hongBaoData.start_time;
+ // var startTime = 1600;
+ var endTime = this.data.hongBaoData.end_time;
+ // if (o.status == 0) endTime = o.start_time
+ var obj = null;
+
+ if(startTime - newTime > 0) { //活动还没开始
+ this.setData({
+ isStart: 0,
+ });
+ time = startTime - newTime;
+ // var day = parseInt(time / (60 * 60 * 24));
+ // var hou = parseInt(time % (60 * 60 * 24) / 3600);
+ // var min = parseInt(time % (60 * 60 * 24) % 3600 / 60);
+ // var sec = parseInt(time % (60 * 60 * 24) % 3600 % 60);
+ // obj = {
+ // day: this.timeFormat(day),
+ // hou: this.timeFormat(hou),
+ // min: this.timeFormat(min),
+ // sec: this.timeFormat(sec),
+ // };
+
+ obj = this.handleTime(time);
+ }
+ // 如果活动未结束,对时间进行处理
+ if (endTime - newTime > 0) { //活动还没结束
+ this.setData({
+ isStart: 1,
+ });
+ time = endTime - newTime;
+ // 获取天、时、分、秒
+ // var day = parseInt(time / (60 * 60 * 24));
+ // var hou = parseInt(time % (60 * 60 * 24) / 3600);
+ // var min = parseInt(time % (60 * 60 * 24) % 3600 / 60);
+ // var sec = parseInt(time % (60 * 60 * 24) % 3600 % 60);
+ // obj = {
+ // day: this.timeFormat(day),
+ // hou: this.timeFormat(hou),
+ // min: this.timeFormat(min),
+ // sec: this.timeFormat(sec),
+ // };
+
+ obj = this.handleTime(time);
+
+ } else { //活动已经结束
+ //活动已结束,全部设置为'00'
+ this.setData({
+ isStart: 2,
+ });
+ obj = {
+ day: '00',
+ hou: '00',
+ min: '00',
+ sec: '00'
+ }
+ }
+ // var txt = "saleGoods[" + j + "][" + i + "].djs";
+ self.setData({
+ time: obj,
+ });
+ // }
+
+ // }
+ setTimeout(self.countDown, 1000);
+ },
+
+ qiangHongBao() {
+ app.request.promisePost('/api/weshop/redmoney/redRecord/saveRecord', {
+ data: {
+ store_id: app.globalData.setting.stoid,
+ user_id: app.globalData.user_id,
+ redid: this.data.hongBaoData.id,
+ }
+ })
+ .then(res => {
+ if(res.data.code == 0){
+ // wx.hideLoading();
+ // wx.showToast({
+ // title: '领取成功',
+ // icon: 'success',
+ // duration: 2000
+ // });
+ console.log('请求提交成功',res.data);
+ // if(callback) {
+ // callback(res.data.data);
+ // }
+ } else if(res.data.code === -1) {
+ // wx.hideLoading();
+ // wx.showToast({
+ // title: '领取失败:' + res.data.msg,
+ // icon: 'none',
+ // duration: 2000
+ // });
+ // self.setData({
+ // result: res.data
+ // });
+
+ };
+ self.setData({
+ result: res.data,
+ qiangHongBao: true,
+ });
+ })
+
+ },
+
+ receive() {
+ // app.postData('/api/wemd/stafftask/saveGuideTaskListGive', {
+ // store_id: app.globalData.userInfo.store_id,
+ // StaffId: _this.data.StaffId,
+ // Id: _this.data.details.Id,
+ // TaskType: _this.data.details.TaskType,
+ // });
+
+ // postData(url, data, callback) {
+ wx.showLoading({
+ title: '奖励领取中'
+ });
+ app.request.promisePost('/api/wemd/stafftask/saveGuideTaskListGive', {
+ data: {
+ store_id: app.globalData.userInfo.store_id,
+ StaffId: _this.data.StaffId,
+ Id: _this.data.details.Id,
+ TaskType: _this.data.details.TaskType,
+ }
+ })
+ .then(res => {
+ if(res.data.code == 0){
+ wx.hideLoading();
+ wx.showToast({
+ title: '领取成功',
+ icon: 'success',
+ duration: 2000
+ });
+ // console.log('请求提交成功',res.data.data);
+ // if(callback) {
+ // callback(res.data.data);
+ // }
+ } else if(res.data.code === -1) {
+ wx.hideLoading();
+ wx.showToast({
+ title: '领取失败:' + res.data.msg,
+ icon: 'none',
+ duration: 2000
+ });
+ };
+ })
+ // },
+ },
+
+
+ closePopup() {
+ this.setData({
+ qiangHongBao: false,
+ });
+ },
+
+
+ gotoDetails() {
+ app.goto('/packageA/pages/hongBaoDetails/hongBaoDetails?redid=' + this.data.hongBaoData.id);
+ },
+
+
+})
\ No newline at end of file
diff --git a/packageA/pages/hongBao/hongBao.json b/packageA/pages/hongBao/hongBao.json
new file mode 100644
index 0000000..7fcdba8
--- /dev/null
+++ b/packageA/pages/hongBao/hongBao.json
@@ -0,0 +1,5 @@
+{
+ "usingComponents": {},
+ "enablePullDownRefresh": false,
+ "navigationBarTitleText": "抢红包"
+}
\ No newline at end of file
diff --git a/packageA/pages/hongBao/hongBao.wxml b/packageA/pages/hongBao/hongBao.wxml
new file mode 100644
index 0000000..a2edc77
--- /dev/null
+++ b/packageA/pages/hongBao/hongBao.wxml
@@ -0,0 +1,47 @@
+
+
+ 由{{storeName}}发起抢红包
+
+
+
+
+ {{isStart == 0 ? '距离活动开始还有':(isStart == 1 ? '距离活动结束还有':'活动已经结束')}}
+
+ {{time.day}}天
+ {{time.hou}}时
+ {{time.min}}分
+ {{time.sec}}秒
+
+
+
+
+
+
+
+
+
diff --git a/packageA/pages/hongBao/hongBao.wxss b/packageA/pages/hongBao/hongBao.wxss
new file mode 100644
index 0000000..8eb2dee
--- /dev/null
+++ b/packageA/pages/hongBao/hongBao.wxss
@@ -0,0 +1,131 @@
+/* packageA//pages/hongBao/hongBao.wxss */
+page {
+ background: url('https://mshopimg.yolipai.net/miniapp/images/redmoney/hongbao_bg.jpg') center top;
+ background-size: 100% auto;
+}
+
+.hongBao-container {
+ padding: 20rpx;
+}
+
+.btn-container {
+ padding-top: 60rpx;
+ padding-bottom: 60rpx;
+ -webkit-animation: free_download 600ms linear alternate infinite;
+ animation: free_download 600ms linear alternate infinite;
+}
+
+@-webkit-keyframes free_download{
+ 0% {-webkit-transform:scale(0.9);}
+ 100% {-webkit-transform:scale(1.1);}
+}
+
+@keyframes free_download{
+ 0% {transform:scale(0.9);}
+ 100% {transform:scale(1.1);}
+}
+
+.countdown-container {
+ position: fixed;
+ left: 0;
+ bottom: 0;
+ width: 100%;
+ height: 688rpx;
+ background: url('https://mshopimg.yolipai.net/miniapp/images/redmoney/indexbot.png') no-repeat left bottom;
+ background-size: 100% auto;
+ text-align: center;
+}
+
+.countdown {
+ display: flex;
+ justify-content: space-around;
+ padding: 200rpx 160rpx 0;
+}
+
+.countdown-item {
+ background: url('https://mshopimg.yolipai.net/miniapp/images/redmoney/timebox.png') no-repeat;
+ background-size: 100% 100%;
+ width: 90rpx;
+ height: 100rpx;
+ line-height: 120rpx;
+ color: white;
+}
+
+.btn {
+ width: 100%;
+ height: 400rpx;
+}
+
+.countdown-txt {
+ color: #ff6768;
+ text-align: center;
+ padding-top: 120rpx;
+ font-size: 36rpx;
+ font-weight: bold;
+}
+
+.popup-container {
+ position: fixed;
+ width: 100%;
+ height: 100%;
+ top: 0;
+ background-color: rgba(0,0,0,.7);
+}
+
+.popup {
+ position: relative;
+ top: 50%;
+ left: 50%;
+ transform: translate(-50%, -50%);
+ text-align: center;
+}
+
+
+.btn-img {
+ width: 200rpx;
+ height: 50rpx;
+}
+
+.amount-container {
+ position: absolute;
+ left: 50%;
+ top: 50%;
+ transform: translateX(-55%);
+}
+
+.amount {
+ color: #fff005;
+ font-size: 68rpx;
+ text-align: center;
+ padding-top: 10rpx;
+ padding-bottom: 20rpx;
+}
+
+
+
+.none,
+.see {
+ position: absolute;
+ font-size: 26rpx;
+ color: white;
+ left: 50%;
+ transform: translateX(-60%);
+}
+
+.none {
+ font-size: 20rpx;
+ top: 36%;
+ margin-left: 55rpx;
+}
+
+.see {
+ top: 82%;
+ left: 50%;
+ transform: translateX(-58%);
+}
+
+.late {
+ font-size: 38;
+ color: #fff005;
+ padding-top: 40rpx;
+}
\ No newline at end of file
diff --git a/packageA/pages/hongBaoDetails/hongBaoDetails.js b/packageA/pages/hongBaoDetails/hongBaoDetails.js
new file mode 100644
index 0000000..a074d79
--- /dev/null
+++ b/packageA/pages/hongBaoDetails/hongBaoDetails.js
@@ -0,0 +1,186 @@
+// packageA//pages/hongBao/hongBao.js
+const app = getApp();
+let reqData = {};
+let _this = null;
+
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ url: app.globalData.setting.imghost,
+ list: null,
+ isLoading: false, // 检测是否已经发送请求,防止重复发送请求
+ noMore: false, // 检测是否有更多数据,true为没有更多数据,false为还有数据
+ pageNum: 1, // 当前页数
+ },
+
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function (options) {
+ _this = this;
+ console.log('options', options);
+ this.data.options = options;
+ reqData.url = '/api/weshop/redmoney/redRecord/page',
+ reqData.data = {
+ store_id: app.globalData.setting.stoid,
+ redid: this.data.options.redid,
+ };
+ reqData.data2 = {
+ store_id: app.globalData.setting.stoid,
+ user_id: app.globalData.user_id,
+ redid: this.data.options.redid,
+ pageSize: 1,
+ page: 1,
+ };
+ this.getData(true, reqData.url, reqData.data);
+ this.requestData(reqData.url, reqData.data2)
+ .then(function(data) {
+ _this.setData({
+ myRed: data.data.data.pageData[0]
+ });
+ // console.log('123', data.data.data.pageData[0]);
+ });
+ },
+
+ /**
+ * 生命周期函数--监听页面初次渲染完成
+ */
+ onReady: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面隐藏
+ */
+ onHide: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面卸载
+ */
+ onUnload: function () {
+
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh: function () {
+
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom: function () {
+ this.scrollToLower(reqData.url, reqData.data);
+ },
+
+ /**
+ * 用户点击右上角分享
+ */
+ onShareAppMessage: function () {
+
+ },
+
+ // 请求数据
+ requestData(url, data) {
+ return new Promise((resolve, reject) => {
+ app.request.promiseGet(url, {data: data})
+ .then(res => {
+ if(res.data.code == 0) {
+ console.log('resolve', res);
+ resolve(res);
+ } else {
+ reject(res);
+ };
+ })
+ });
+ },
+
+
+
+ // 上拉加载请求数据
+ getData: function(isInit, url, data) {
+ wx.showLoading({
+ title: '加载中',
+ })
+ this.requestData(url, data)
+ .then(function(res) {
+ wx.hideLoading();
+ console.log('res--->', res);
+ _this.setData({
+ isLoading: false
+ });
+
+ if(isInit) {// 第一次加载
+ _this.setData({
+ list: res.data.data
+ });
+ } else {
+
+ _this.setData({
+ 'list.pageData': _this.data.list.pageData.concat(res.data.data.pageData)
+ });
+ };
+
+ if((res.data.data.pageData.length == 0) || (res.data.data.pageSize * res.data.data.page >= res.data.data.total)) {
+ _this.setData({
+ noMore: true
+ });
+ };
+
+ })
+ .catch(function(reason) {
+ wx.hideLoading();
+ wx.showToast({
+ title: reason.data.msg,
+ icon: 'none',
+ duration: 2000
+ })
+ _this.setData({
+ 'list.pageData': []
+ });
+ });
+ },
+
+
+ // 上拉加载
+ scrollToLower(url, requestData, callback) {
+ // 页面数据
+ // let pageData = this.data.list.pageData;
+ // 数据总量
+ let total = this.data.list.total;
+ // 单页最大数据量
+ let pageSize = this.data.list.pageSize;
+ // 如果数据总量不为0且小于或等于单页最大数据量,说明数据已全部加载,显示‘没有更多了’
+ if((total != 0)&&(total <= pageSize)) {
+ this.setData({
+ noMore: true
+ });
+ };
+
+ if(!this.data.isLoading && !this.data.noMore) {
+ this.setData({
+ isLoading: true,
+ pageNum: this.data.pageNum + 1
+ });
+ requestData.page = this.data.pageNum;
+ this.getData(false, url, requestData);
+ };
+ },
+
+
+
+})
\ No newline at end of file
diff --git a/packageA/pages/hongBaoDetails/hongBaoDetails.json b/packageA/pages/hongBaoDetails/hongBaoDetails.json
new file mode 100644
index 0000000..f460f69
--- /dev/null
+++ b/packageA/pages/hongBaoDetails/hongBaoDetails.json
@@ -0,0 +1,7 @@
+{
+ "usingComponents": {
+ "nodata": "/components/nodata/nodata"
+ },
+ "enablePullDownRefresh": false,
+ "navigationBarTitleText": "抢红包"
+}
\ No newline at end of file
diff --git a/packageA/pages/hongBaoDetails/hongBaoDetails.wxml b/packageA/pages/hongBaoDetails/hongBaoDetails.wxml
new file mode 100644
index 0000000..5ad9b77
--- /dev/null
+++ b/packageA/pages/hongBaoDetails/hongBaoDetails.wxml
@@ -0,0 +1,68 @@
+
+
+
+
+
+
+ ¥{{filter.show_default(myRed.redmoney, '0.00')}}
+
+
+
+
+
+
+
+
+
+
+
+ {{item.vipname}}
+ {{filter.format_time(item.addtime, 1)}}
+
+
+ ¥{{item.redmoney}}
+
+
+
+
+
+
+ - 没有更多了 -
+
+
+
+
+
+
+
+
diff --git a/packageA/pages/hongBaoDetails/hongBaoDetails.wxss b/packageA/pages/hongBaoDetails/hongBaoDetails.wxss
new file mode 100644
index 0000000..c65d6c8
--- /dev/null
+++ b/packageA/pages/hongBaoDetails/hongBaoDetails.wxss
@@ -0,0 +1,187 @@
+/* packageA//pages/hongBao/hongBao.wxss */
+page {
+ background: url('https://mshopimg.yolipai.net/miniapp/images/redmoney/hongbao_bg.jpg') center top;
+ background-size: 100% auto;
+}
+
+.hongBao-container {
+ padding: 20rpx;
+}
+
+.btn-container {
+ padding-top: 60rpx;
+ /* padding-bottom: 60rpx; */
+ /* transform:scale(1.2); */
+ position: relative;
+ /* -webkit-animation: free_download 600ms linear alternate infinite;
+ animation: free_download 600ms linear alternate infinite; */
+}
+
+/* @-webkit-keyframes free_download{
+ 0% {-webkit-transform:scale(0.9);}
+ 100% {-webkit-transform:scale(1.1);}
+}
+
+@keyframes free_download{
+ 0% {transform:scale(0.9);}
+ 100% {transform:scale(1.1);}
+} */
+
+.countdown-container {
+ /* position: fixed;
+ left: 0;
+ bottom: 0;
+ width: 100%;
+ height: 688rpx;
+ background: url('https://mshopimg.yolipai.net/miniapp/images/redmoney/indexbot.png') no-repeat left bottom;
+ background-size: 100% auto;
+ text-align: center; */
+}
+
+.countdown {
+ /* display: flex;
+ justify-content: space-around;
+ padding: 200rpx 160rpx 0; */
+}
+
+.countdown-item {
+ /* background: url('https://mshopimg.yolipai.net/miniapp/images/redmoney/timebox.png') no-repeat;
+ background-size: 100% 100%;
+ width: 90rpx;
+ height: 100rpx;
+ line-height: 120rpx;
+ color: white; */
+}
+
+.btn {
+ width: 100%;
+ height: 400rpx;
+ transform: scale(1.1);
+}
+
+.countdown-txt {
+ /* color: #ff6768;
+ text-align: center;
+ padding-top: 120rpx;
+ font-size: 36rpx;
+ font-weight: bold; */
+}
+
+.popup-container {
+ position: fixed;
+ width: 100%;
+ height: 100%;
+ top: 0;
+ background-color: rgba(0,0,0,.7);
+}
+
+.popup {
+ position: relative;
+ top: 50%;
+ left: 50%;
+ transform: translate(-50%, -50%);
+ text-align: center;
+}
+
+
+.btn-img {
+ /* width: 200rpx;
+ height: 50rpx; */
+}
+
+.amount-container {
+ /* position: absolute;
+ left: 50%;
+ top: 50%;
+ transform: translateX(-55%); */
+}
+
+.amount {
+ color: #fff005;
+ font-size: 60rpx;
+ text-align: center;
+ position: absolute;
+ left: 49%;
+ top: 50%;
+ transform: translate(-50%);
+ padding-top: 30rpx;
+ /* padding-top: 10rpx;
+ padding-bottom: 20rpx; */
+}
+
+
+
+/* .none,
+.see {
+ position: absolute;
+ font-size: 26rpx;
+ color: white;
+ left: 50%;
+ transform: translateX(-60%);
+}
+
+.none {
+ font-size: 20rpx;
+ top: 36%;
+ margin-left: 55rpx;
+}
+
+.see {
+ top: 82%;
+ left: 50%;
+ transform: translateX(-58%);
+} */
+
+
+/* .list-container {
+ /* background: url('https://mshopimg.yolipai.net/miniapp/images/redmoney/timebox.png') no-repeat;
+} */
+
+.list-container {
+ border-radius: 12rpx;
+ overflow: hidden;
+}
+
+.list {
+ /* position: relative; */
+ margin-top: -8rpx;
+}
+
+.list-img {
+ width: 100%;
+ height: 326rpx;
+}
+
+.list-item {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ background-color: white;
+ padding: 30rpx 20rpx;
+ border-bottom: 2rpx solid #f8f8f8;
+}
+
+.list-item:last-child {
+ border-bottom: none;
+}
+
+.avatar-container {
+ width: 100rpx;
+ height: 100rpx;
+ border-radius: 50%;
+ overflow: hidden;
+ margin-right: 20rpx;
+}
+
+.avatar {
+ display: block;
+ width: 100%;
+ height: 100%;
+}
+
+.nodata {
+ color: white;
+ font-size: 24rpx;
+ text-align: center;
+ padding-top: 20rpx;
+}
diff --git a/utils/filter.wxs b/utils/filter.wxs
index 93eddaf..7bb6dce 100644
--- a/utils/filter.wxs
+++ b/utils/filter.wxs
@@ -29,7 +29,7 @@ var filters = {
var fm = [d.getFullYear(), d.getMonth() + 1, d.getDate()].join('-');
var md = (d.getMonth() + 1) + '月' + d.getDate() + '日';
if (isFull == 1)
- fm = fm + ' ' + [d.getHours(), d.getMinutes(), d.getSeconds()].join(':');
+ fm = fm + ' ' + [appendZero(d.getHours()), appendZero(d.getMinutes()), appendZero(d.getSeconds())].join(':');
if (isFull == 2) {
fm = md + ' ' + [appendZero(d.getHours()), appendZero(d.getMinutes())].join(':');
}
@@ -55,7 +55,30 @@ var filters = {
return spec + "/" + color;
}
}
- }
+ },
+
+
+ show_default: function (value, placeholder, multiple) {
+ if(typeof value === 'number') {
+ if(isNaN(value) || value === 0) {
+ return placeholder || '0';
+ } else {
+ if(multiple) {
+ return value / multiple;
+ } else {
+ return value;
+ }
+ };
+ } else if(value === '' || value === undefined || value === null) {
+ return placeholder || '-';
+ } else {
+ return value;
+ }
+ },
+
+
+
+
};
module.exports = {
@@ -65,4 +88,5 @@ module.exports = {
format_time: filters.format_time,
pInt: filters.pInt,
show_gui_ge: filters.show_gui_ge,
+ show_default: filters.show_default,
}
\ No newline at end of file