diff --git a/app.wxss b/app.wxss index 5abb5bb..2b39a1b 100644 --- a/app.wxss +++ b/app.wxss @@ -446,12 +446,12 @@ background: #ffe3e2; /* 图标字体(ty) */ @font-face { font-family: 'iconfont'; /* project id 2054717 */ - src: url('//at.alicdn.com/t/font_2054717_ntayyd8f2u.eot'); - src: url('//at.alicdn.com/t/font_2054717_ntayyd8f2u.eot?#iefix') format('embedded-opentype'), - url('//at.alicdn.com/t/font_2054717_ntayyd8f2u.woff2') format('woff2'), - url('//at.alicdn.com/t/font_2054717_ntayyd8f2u.woff') format('woff'), - url('//at.alicdn.com/t/font_2054717_ntayyd8f2u.ttf') format('truetype'), - url('//at.alicdn.com/t/font_2054717_ntayyd8f2u.svg#iconfont') format('svg'); + src: url('//at.alicdn.com/t/font_2054717_qfl8swm1iw.eot'); + src: url('//at.alicdn.com/t/font_2054717_qfl8swm1iw.eot?#iefix') format('embedded-opentype'), + url('//at.alicdn.com/t/font_2054717_qfl8swm1iw.woff2') format('woff2'), + url('//at.alicdn.com/t/font_2054717_qfl8swm1iw.woff') format('woff'), + url('//at.alicdn.com/t/font_2054717_qfl8swm1iw.ttf') format('truetype'), + url('//at.alicdn.com/t/font_2054717_qfl8swm1iw.svg#iconfont') format('svg'); } .iconfont { @@ -462,6 +462,10 @@ background: #ffe3e2; -moz-osx-font-smoothing: grayscale; } +.icon-riqi:before { + content: "\e64c"; +} + .icon-shanchu:before { content: "\e61b"; } diff --git a/components/diy_advertising/diy_advertising.wxml b/components/diy_advertising/diy_advertising.wxml index 9895b34..a8e1a3b 100644 --- a/components/diy_advertising/diy_advertising.wxml +++ b/components/diy_advertising/diy_advertising.wxml @@ -401,7 +401,7 @@ - 0){ + th.data.timer = setInterval(function() { + th.countDown2(th); + }, 1000); + } + } + }, + + ready: function() { console.log("ready"); var g_id = this.data.object.data; @@ -55,50 +69,83 @@ Component({ app = getApp(), all_array = [], index = 0, goodsidlist=""; + + //-- 当是默认的调用的时候 -- + if(!g_id || g_id.length<=0 ){ + th.no_gid_set(); + }else{ + //--先把商品ID串起来-- + g_id.forEach(function(val, ind) { + var item = {}; + goodsidlist+=val.goodsid+","; + }) + goodsidlist= goodsidlist.substr(0,goodsidlist.length-1); - //--先把商品ID串起来-- - g_id.forEach(function(val, ind) { - var item = {}; - goodsidlist+=val.goodsid+","; - }) - goodsidlist= goodsidlist.substr(0,goodsidlist.length-1); - - //--调用接口,读取拼单-- - app.request.promiseGet("/api/weshop/teamlist/getGoodsList?store_id=" - +os.stoid+"&goodsidlist="+goodsidlist, {}).then(res => { - - //如果拼单的数组为空的时候 - var goodslist=res.data.data; - if(!goodslist || goodslist.length==0) return false; - - /*--商品队列按照添加的顺序排列--*/ - g_id.forEach(function(val, ind) { - goodslist.forEach(function (vy,indy) { - if(val.goodsid==vy.goods_id){ - all_array.push(vy); - } - }) - }) - if(all_array.length==0){ - all_array=goodslist; - } - - var arr = new Array(); - //--三个三个一组--- - for(var i=0;i< all_array.length;i+=3){ - arr.push(all_array.slice(i,i+3)); - } - /*--熏染到前台--*/ - th.setData({goods_array:arr}); - var newTime = ut.gettimestamp(); - th.setData({ newTime: newTime }); - - th.data.timer = setInterval(function() { - th.countDown2(th); - }, 1000); - }); + //--调用接口,读取拼单-- + app.request.promiseGet("/api/weshop/teamlist/getGoodsList?store_id=" + +os.stoid+"&goodsidlist="+goodsidlist, {}).then(res => { + //如果拼单的数组为空的时候 + var goodslist=res.data.data; + if(goodslist && goodslist.length>0){ + th.set_goods_list(g_id,goodslist); + } + + }); + } }, - //---小于10的格式化函数---- + + no_gid_set(){ + var th=this; + var url= "/api/weshop/teamlist/pageteam/2?page=1&pageSize=9"; + getApp().request.promiseGet(url, { + data: { + store_id: os.stoid,is_end: 0,is_show: 1, + } + }).then(res => { + if(res.data.code==0 && res.data.data.pageData && res.data.data.pageData.length>0){ + var goodslist=res.data.data.pageData; + th.set_goods_list(null,goodslist); + } + }) + }, + + //设置商品列表 + set_goods_list:function(g_id,goodslist){ + var th=this,all_array=[]; + if(g_id){ + /*--商品队列按照添加的顺序排列--*/ + g_id.forEach(function(val, ind) { + goodslist.forEach(function (vy,indy) { + if(val.goodsid==vy.goods_id){ + all_array.push(vy); + //th.setData({goods_array:arr}); + } + }) + }) + }else{ + all_array=goodslist; + } + + if(all_array.length==0){ + all_array=goodslist; + } + + var arr = new Array(); + //--三个三个一组--- + for(var i=0;i< all_array.length;i+=3){ + arr.push(all_array.slice(i,i+3)); + } + /*--熏染到前台--*/ + th.setData({goods_array:arr}); + var newTime = ut.gettimestamp(); + th.setData({ newTime: newTime }); + + th.data.timer = setInterval(function() { + th.countDown2(th); + }, 1000); + }, + + //---小于10的格式化函数---- timeFormat: function(param) { return param < 10 ? '0' + param : param; }, @@ -108,6 +155,8 @@ Component({ var ee = ob; // 获取当前时间,同时得到活动结束时间数组 var newTime = ut.gettimestamp(); + this.setData({newTime:newTime}); + var List = ee.data.goods_array; if (List.length == 0) return false; for (var j = 0; j < List.length; j++) { diff --git a/components/diy_pingd_buy/diy_pingd_buy.wxml b/components/diy_pingd_buy/diy_pingd_buy.wxml index 5564c64..fb31a7c 100644 --- a/components/diy_pingd_buy/diy_pingd_buy.wxml +++ b/components/diy_pingd_buy/diy_pingd_buy.wxml @@ -1,5 +1,5 @@ - + @@ -21,11 +21,10 @@ 即将开始 - - + + 火热进行 - @@ -50,12 +49,17 @@ - {{aitem.ct_num}}人团 - - 去参团 - 去开团 - 去开团 - 已抢光 + {{aitem.ct_num}}人团 + + + 已结束 + + + 去参团 + 去开团 + 去开团 + 已抢光 + @@ -89,16 +93,21 @@ ¥{{aitem.price}} ¥{{aitem.market_price}} - + - {{aitem.djs.day}}天{{aitem.djs.hou}}时{{aitem.djs.min}}分{{aitem.djs.sec}}秒 + {{aitem.djs.day}}天{{aitem.djs.hou}}时{{aitem.djs.min}}分{{aitem.djs.sec}}秒 - - 去参团 - 去开团 - 去参团 - 已抢光 - + + + + 已结束 + + + 去参团 + 去开团 + 去参团 + 已抢光 + diff --git a/components/diy_pingd_buy/diy_pingd_buy.wxss b/components/diy_pingd_buy/diy_pingd_buy.wxss index 2ca2b78..14e0da8 100644 --- a/components/diy_pingd_buy/diy_pingd_buy.wxss +++ b/components/diy_pingd_buy/diy_pingd_buy.wxss @@ -362,4 +362,5 @@ swiper { display: flex; align-items: center; margin:5rpx 0rpx; -} \ No newline at end of file +} +.o1_right_p .wo_p.huise{ background-color: #eee;} \ No newline at end of file diff --git a/components/diy_seckill/diy_seckill.js b/components/diy_seckill/diy_seckill.js index 069c855..1cc16a8 100644 --- a/components/diy_seckill/diy_seckill.js +++ b/components/diy_seckill/diy_seckill.js @@ -36,6 +36,19 @@ Component({ imghost: os.imghost, timer: null, }, + + pageLifetimes:{ + //要处理一下,游客登录后的界面的变化,主要还该是改变会员 + show: function () { + var th=this; + if(this.data.goods_array.length>0){ + th.data.timer = setInterval(function() { + th.countDown2(th); + }, 1000); + } + } + }, + ready: function() { console.log("ready"); var g_id = this.data.object.data; @@ -50,66 +63,82 @@ Component({ // 这里是一个自定义方法 customMethod: function() {}, init: function(g_id) { - var th = this, app = getApp(),all_array = [], goodsidlist=""; - - //--先把商品ID串起来-- - g_id.forEach(function(val, ind) { - var item = {}; - goodsidlist+=val.goodsid+","; - }) - goodsidlist=ut.sub_last(goodsidlist); - - //--调用接口,读取秒杀-- - app.request.promiseGet("/api/ms/flash_sale/getGoodsList?store_id=" - +os.stoid+"&goodsidlist="+goodsidlist, {}).then(res => { - //如果秒杀的数组为空的时候 - - var goodslist=res.data.data; - if(!goodslist || goodslist.length==0) return false; - - // 判断火热,预热 - var newTime = ut.gettimestamp(); - th.setData({newTime:newTime}); - // for(var a=0;a< goodslist.length;a++){ - // var starTime=goodslist[a].start_time; - // var msStr=[]; - // console.log(2222222222) - // console.log(starTime+":"+newTime) - // if (starTime>newTime){ - // msStr.push() - // //th.setData({msText:'即将开始'}); - // } - // if (starTime0){ + //--先把商品ID串起来-- + g_id.forEach(function(val, ind) { + var item = {}; + goodsidlist+=val.goodsid+","; + }) + goodsidlist=ut.sub_last(goodsidlist); + + //--调用接口,读取秒杀-- + app.request.promiseGet("/api/ms/flash_sale/getGoodsList?store_id=" + +os.stoid+"&goodsidlist="+goodsidlist, {}).then(res => { + //如果秒杀的数组为空的时候 + var goodslist=res.data.data; + //就算是添加的活动已经过期,就要用最新的进行中活动 + if(goodslist && goodslist.length>0) { + th.set_goods_list(g_id,goodslist); + } + }); + }else{ + th.no_gid_set(); + } }, + + //当是默认的情况 + no_gid_set(){ + getApp().request.promiseGet("/api/ms/flash_sale/spikepage?page=1&pageSize=9", + {isShowLoading:1,data:{store_id:os.stoid,is_end:0,is_show:1}} + ).then(res=>{ + if(res.data.code==0 && res.data.data.pageData && res.data.data.pageData.length>0) { + goodsidlist=res.data.data.pageData; + th.set_goods_list(null,goodslist); + } + }); + }, + + //就算是添加的活动已经过期,就要用最新的活动 + set_goods_list(g_id,goodslist){ + // 判断火热,预热 + var newTime = ut.gettimestamp(),all_array = [],th=this; + th.setData({newTime:newTime}); + if(g_id){ + /*--商品队列按照添加的顺序排列--*/ + g_id.forEach(function(val, ind) { + goodslist.forEach(function (vy,indy) { + if(val.goodsid==vy.goods_id){ + all_array.push(vy); + //th.setData({goods_array:arr}); + } + }) + }) + }else{ + all_array=goodslist; + } + + + if(all_array.length==0){ + all_array=goodslist; + } + + var arr = new Array(); + //--三个三个一组--- + for(var i=0;i< all_array.length;i+=3){ + arr.push(all_array.slice(i,i+3)); + } + /*--熏染到前台--*/ + + th.setData({goods_array:arr}); + + th.data.timer = setInterval(function() { + th.countDown2(th); + }, 1000); + }, + + + //---小于10的格式化函数---- timeFormat: function(param) { return param < 10 ? '0' + param : param; @@ -120,6 +149,8 @@ Component({ var ee = ob; // 获取当前时间,同时得到活动结束时间数组 var newTime = ut.gettimestamp(); + this.setData({newTime:newTime}); + var List = ee.data.goods_array; if (List.length == 0) return false; for (var j = 0; j < List.length; j++) { diff --git a/components/diy_seckill/diy_seckill.wxml b/components/diy_seckill/diy_seckill.wxml index f5cee6e..789e7af 100644 --- a/components/diy_seckill/diy_seckill.wxml +++ b/components/diy_seckill/diy_seckill.wxml @@ -1,4 +1,4 @@ - + @@ -24,16 +24,26 @@ 即将开始 - - - 火热进行 - - - - - 已抢光 - - + + + + 活动已结束 + + + + + + 火热进行 + + + + + 已抢光 + + + + + @@ -92,17 +102,25 @@ 正在预热 - - - 我要抢 - - - - - - 已抢光 - - + + + + 已结束 + + + + + + 我要抢 + + + + + + 已抢光 + + + diff --git a/components/diy_shopname/diy_shopname.wxml b/components/diy_shopname/diy_shopname.wxml index 537b0f7..48837a3 100644 --- a/components/diy_shopname/diy_shopname.wxml +++ b/components/diy_shopname/diy_shopname.wxml @@ -10,7 +10,7 @@ - + diff --git a/components/diy_shopname/diy_shopname.wxss b/components/diy_shopname/diy_shopname.wxss index dc3f2aa..247be95 100644 --- a/components/diy_shopname/diy_shopname.wxss +++ b/components/diy_shopname/diy_shopname.wxss @@ -139,9 +139,9 @@ left:-116rpx; width: 100%; height: 260rpx; position: absolute; - top: -130rpx; + margin-top: -130rpx; text-align: center; - margin-top: 50%; + top: 50%; } /* 小图片2圆边框 */ diff --git a/components/full_screen/filter.wxs b/components/full_screen/filter.wxs new file mode 100644 index 0000000..68e2458 --- /dev/null +++ b/components/full_screen/filter.wxs @@ -0,0 +1,12 @@ +var format = function (text) { + + if (!text) { + return + } + var reg = getRegExp('\\\\n', 'g') + return text.replace(reg, '\n') +} + +module.exports = { + format: format +} diff --git a/components/full_screen/full_screen.js b/components/full_screen/full_screen.js new file mode 100644 index 0000000..7206499 --- /dev/null +++ b/components/full_screen/full_screen.js @@ -0,0 +1,74 @@ +// components/userqy_pop_up/userqy_pop_up.js +var o = getApp().globalData.setting +Component({ + /** + * 页面的初始数据 + */ + data: { + control: 1, + is_full_screen_show:0, //全屏显示 + sec_show:3, //倒计时的秒数 + full_ad:null, //全屏广告 + url:o.imghost, + full_screen:0, + is_full_screen_men:1, + }, + + pageLifetimes:{ + hide: function() { + // 页面被隐藏 + clearInterval(this.data.full_screen); + }, + }, + + properties: {}, + methods: { + close_full_screen(){ + this.setData({is_full_screen_show:0,sec_show:0,is_full_screen_men:0}); + }, + //-- 跳转到满屏广告的链接 -- + go_full_ad(){ + if(!this.data.full_ad) return false; + if(!this.data.full_ad.ad_weapplink) return false; + getApp().goto(this.data.full_ad.ad_weapplink); + this.setData({is_full_screen_show:0,is_full_screen_men:0}); + }, + get_the_full_screen(){ + if(this.data.full_ad) return false; + var th=this; + //获取全屏的广告 + getApp().request.promiseGet("/api/weshop/ad/page?pid=1001&store_id=" + o.stoid,{ + data: { enabled: 1 } + }).then(res=>{ + //判断是不是有全屏广告 + if(res.data.code==0 && res.data.data.pageData && res.data.data.pageData.length>0){ + th.setData({ + is_full_screen_show:1, + full_ad:res.data.data.pageData[0], + }) + + //--定时关闭-- + th.data.full_screen=setInterval(function(){ + if(!th.data.sec_show) { + clearInterval(th.data.full_screen); + th.close_full_screen(); + return false; + } + th.data.sec_show--; + th.setData({sec_show:th.data.sec_show}); + },1000) + + + setTimeout(function(){ + th.setData({is_full_screen_men:0}); + },1000) + }else{ + th.setData({ + is_full_screen_men:0 + }) + } + }) + } + }, + +}) \ No newline at end of file diff --git a/components/full_screen/full_screen.json b/components/full_screen/full_screen.json new file mode 100644 index 0000000..a88fc2f --- /dev/null +++ b/components/full_screen/full_screen.json @@ -0,0 +1,4 @@ +{ + "component": true, + "usingComponents": {} +} \ No newline at end of file diff --git a/components/full_screen/full_screen.wxml b/components/full_screen/full_screen.wxml new file mode 100644 index 0000000..8feebdd --- /dev/null +++ b/components/full_screen/full_screen.wxml @@ -0,0 +1,8 @@ + + + + 跳过 {{sec_show}} + + + + diff --git a/components/full_screen/full_screen.wxss b/components/full_screen/full_screen.wxss new file mode 100644 index 0000000..f6dde99 --- /dev/null +++ b/components/full_screen/full_screen.wxss @@ -0,0 +1,18 @@ +.full_screen{ + position: fixed;left: 0;top: 0; + z-index: 1000000000000; + background-color: rgba(0,0,0,0.4); + width: 100%; + height: 100%; + background-position: center; + background-size: 100% 100%; + background-repeat: no-repeat; +} + + +.skip_box{ + float: right; margin-top: 10rpx; margin-right: 10rpx; + background-color: gainsboro; width: 120rpx; + height: 48rpx; font-size: 28rpx; line-height: 48rpx; + text-align: center; border-radius: 20rpx; + } \ No newline at end of file diff --git a/packageA/pages/checkin/checkin.js b/packageA/pages/checkin/checkin.js index 10ea4fa..37ed28e 100644 --- a/packageA/pages/checkin/checkin.js +++ b/packageA/pages/checkin/checkin.js @@ -1,6 +1,6 @@ // packageA//pages/checkin/checkin.js const app = getApp(); - +let self; Page({ /** @@ -25,12 +25,12 @@ Page({ checkInNums: 0, //补签次数 isCheckInDay: '', - flag: true, + isLogin: false, + }, loadQd(callback) { - let self = this; app.request.get('/api/weshop/qdrecord/getUser/'+ app.globalData.setting.stoid + '/' + app.globalData.user_id, { success: function (res) { if(callback) callback(); @@ -46,17 +46,62 @@ Page({ * 生命周期函数--监听页面加载 */ onLoad: function(options) { - let self = this; + console.log('执行onload'); + self = this; this.getDate(); this.setDate(); var res = wx.getSystemInfoSync(); this.setData({ param: res.windowHeight / 12, + }) + + + // 判断会员是否授权登录, + // 没有登录则跳转到登录页, + // 已登录则设置已登录状态,请求加载签到数据 + this.isLogin().then(function() { + console.log('loginnnn',app.globalData.userInfo); + self.setData({ + isLogin: true + }); + self.loadQd(); + }); - this.loadQd(); }, + + onShow() { + if(app.globalData.userInfo instanceof Object) { + if(this.data.isLogin) { + return; + } else { + this.setData({ + isLogin: true + }); + this.loadQd(); + }; + } + }, + + onHide() { + console.log('执行onHide'); + }, + + // 是否登录 + isLogin() { + return new Promise(function(resolve, reject) { + let user_info = getApp().globalData.userInfo; + if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) { + wx.navigateTo({ + url: '/pages/togoin/togoin', + }) + return false; + } else { + resolve(); + }; + }); + }, // 点击"我的积分"和"去购物"进行跳转 @@ -219,73 +264,7 @@ Page({ } this.setData({ dateArr: this.data.dateArr, - // firstDay: this.data.firstDay }); }, - // prevMonth: function() { //上一月 - // var months = ""; - // var years = ""; - // if (this.data.month == 1) { - // years = this.data.year - 1 - // this.data.month = 12; - // months = this.data.month; - // } else { - // years = this.data.year; - // months = this.data.month - 1; - // } - - // var first = new Date(years, months - 1, 1); - // this.data.firstDay = first.getDay(); - // var last = new Date(years, months, 0); - // this.data.lastDay = last.getDate(); - - // this.setData({ - // month: months, - // year: years, - // firstDay: this.data.firstDay, - // lastDay: this.data.lastDay - // }) - - // this.data.dateArr = []; - // for (var i = 1; i < this.data.lastDay + 1; i++) { - // this.data.dateArr.push(i); - // } - // this.setData({ - // dateArr: this.data.dateArr - // }) - // }, - - // nextMonth: function() { //下一月 - // var months = ""; - // var years = ""; - // if (this.data.month == 12) { - // this.data.month = 0; - // months = this.data.month; - // years = this.data.year + 1; - // } else { - // months = this.data.month + 1; - // years = this.data.year; - // } - // var months = this.data.month + 1; - // var first = new Date(years, months - 1, 1); - // this.data.firstDay = first.getDay(); - // var last = new Date(years, months, 0); - // this.data.lastDay = last.getDate(); - // this.setData({ - // month: months, - // year: years, - // firstDay: this.data.firstDay, - // lastDay: this.data.lastDay - // }) - - // this.data.dateArr = []; - // for (var i = 1; i < this.data.lastDay + 1; i++) { - // this.data.dateArr.push(i); - // } - // this.setData({ - // dateArr: this.data.dateArr - // }) - // }, - }) diff --git a/packageA/pages/checkin/checkin.wxml b/packageA/pages/checkin/checkin.wxml index a155ed9..d297782 100644 --- a/packageA/pages/checkin/checkin.wxml +++ b/packageA/pages/checkin/checkin.wxml @@ -38,9 +38,12 @@ - + {{!dateArr[day-1].isCheckIn ? '立即签到':'今日已签到'}} + + 签到请登录 + 补签(-10分) @@ -103,7 +106,7 @@ 签到规则 - 1.每日签到领积分 + {{res.qdrules}} X diff --git a/packageA/pages/hongBao/hongBao.js b/packageA/pages/hongBao/hongBao.js new file mode 100644 index 0000000..b02e4b0 --- /dev/null +++ b/packageA/pages/hongBao/hongBao.js @@ -0,0 +1,333 @@ +// 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, + qianging: 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() { + if(!this.data.qianging) { + this.data.qianging = true; + 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, + qianging: false, + }); + }, + + + gotoDetails() { + // this.data.qiangHongBao = false; + this.setData({ + qiangHongBao: false + }); + 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}}秒 + + + + + + + + + + + ¥{{result.data.redmoney}} + + + + + + + + + + {{result.msg}} + 看看大家的手气 > + + + + + + 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..87de214 --- /dev/null +++ b/packageA/pages/hongBaoDetails/hongBaoDetails.js @@ -0,0 +1,208 @@ +// 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.isLogin() + .then(function(data) { + + _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 () { + + }, + + // 判断是否授权登录 + 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(); + }; + }); + }, + + // 请求数据 + 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..98fd0b2 --- /dev/null +++ b/packageA/pages/hongBaoDetails/hongBaoDetails.json @@ -0,0 +1,8 @@ +{ + "usingComponents": { + "nodata": "/components/nodata/nodata", + "nav_box": "/components/nav_box/nav_box" + }, + "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..7d81b03 --- /dev/null +++ b/packageA/pages/hongBaoDetails/hongBaoDetails.wxml @@ -0,0 +1,70 @@ + + + + + + + ¥{{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/packageA/pages/jfbuy/jfbuy.wxml b/packageA/pages/jfbuy/jfbuy.wxml index 72de11f..c9be835 100644 --- a/packageA/pages/jfbuy/jfbuy.wxml +++ b/packageA/pages/jfbuy/jfbuy.wxml @@ -43,7 +43,7 @@ data-errorimg="list2[{{index}}].original_img"> - {{item.goods_name}} + {{item.name}} {{item.integral}}积分 + ¥{{item.addmoney}} diff --git a/packageA/pages/quan/quan.js b/packageA/pages/quan/quan.js index b53a556..58460a6 100644 --- a/packageA/pages/quan/quan.js +++ b/packageA/pages/quan/quan.js @@ -17,6 +17,7 @@ Page({ currentPage:1, //当前的页码 share_hidden:1, //-- 分享的按钮隐藏 -- hiddenPopup:1, + imghost: oo.imghost, }, /** diff --git a/packageA/pages/quan/quan.wxml b/packageA/pages/quan/quan.wxml index 089d1f3..c344c6d 100644 --- a/packageA/pages/quan/quan.wxml +++ b/packageA/pages/quan/quan.wxml @@ -29,7 +29,8 @@ {{filters.format_time(getcurday+3600*24*item.startdays)}}至 {{filters.format_time(getcurday+3600*24*item.days)}}不限 - {{filters.toFix(item.money,2)}} + {{filters.toFix(item.money,2)}} + 全场任意产品通用 diff --git a/packageA/pages/quan/quan.wxss b/packageA/pages/quan/quan.wxss index 6146348..7bd257e 100644 --- a/packageA/pages/quan/quan.wxss +++ b/packageA/pages/quan/quan.wxss @@ -507,7 +507,7 @@ radio .wx-radio-input.wx-radio-input-checked::before{ .active { background-color: #f2f2f2; } - +.sharelink{ width: 40rpx; height: 40rpx; padding-left:10rpx;} diff --git a/packageA/pages/quan_list/quan_list.js b/packageA/pages/quan_list/quan_list.js index f1a13f0..a37841c 100644 --- a/packageA/pages/quan_list/quan_list.js +++ b/packageA/pages/quan_list/quan_list.js @@ -52,7 +52,7 @@ Page({ th.data.loading=1; var user_id=getApp().globalData.user_id; getApp().request.promiseGet("/api/weshop/prom/coupon/pageCouponList", { - data:{store_id:os.stoid,type:1,pageSize:10,page:th.data.curpage,user_id:user_id} + data:{store_id:os.stoid,type:1,pageSize:10,page:th.data.curpage,user_id:user_id,is_share:0} }).then(res => { th.data.loading=0; if(res.data.code==0){ diff --git a/packageA/pages/service_record/service_record.js b/packageA/pages/service_record/service_record.js new file mode 100644 index 0000000..7d083f1 --- /dev/null +++ b/packageA/pages/service_record/service_record.js @@ -0,0 +1,233 @@ +const app = getApp(); +let _this = null; +let reqData = {}; + +Page({ + + data: { + list: null, + isLoading: false, // 检测是否已经发送请求,防止重复发送请求 + noMore: false, // 检测是否有更多数据,true为没有更多数据,false为还有数据 + pageNum: 1, // 当前页数 + + startDate: '开始日期', + endDate: '结束日期', + }, + + onLoad: function(t) { + _this = this; + + this.setData({ + currentDate: this.currentDate(), + }); + + + + + }, + + onShow: function() { + this.isLogin() + .then(function(data) { + reqData.url = '/api/weshop/marketing/servicewrite/page'; + reqData.data = { + storeId: app.globalData.setting.stoid, + userId: app.globalData.user_id, + }; + _this.getData(true, reqData.url, reqData.data); + }); + }, + + + onReachBottom: function() { + this.scrollToLower(reqData.url, reqData.data); + }, + + // 判断是否授权登录 + 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(); + }; + }); + }, + + + bindDateChange1: function(e) { + console.log('picker发送选择改变,携带值为', e.detail.value) + this.setData({ + startDate: e.detail.value + }) + }, + + bindDateChange2: function(e) { + console.log('picker发送选择改变,携带值为', e.detail.value) + this.setData({ + endDate: e.detail.value + }) + }, + + searchOffline() { + console.log('执行查询'); + + let startDate = this.data.startDate; + let endDate = this.data.endDate; + + + + if(startDate == '开始日期' || endDate == '结束日期') { + wx.showToast({ + title: '请选择完整的查询日期!', + icon: 'none', + }) + } else if(new Date(startDate) > new Date(endDate)) { + wx.showToast({ + title: '出错了,开始日期不能晚于结束日期!', + icon: 'none', + }) + return; + } else { + this.setData({ + list: null, + isLoading: false, // 检测是否已经发送请求,防止重复发送请求 + noMore: false, // 检测是否有更多数据,true为没有更多数据,false为还有数据 + pageNum: 1, // 当前页数 + }); + + reqData.data.BeginDate = startDate; + reqData.data.EndDate = endDate; + reqData.data.page = 1; + this.getData(true, reqData.url, reqData.data); + }; + + + }, + + currentDate() { + var now = new Date(); + var year = now.getFullYear(); //年 + var month = now.getMonth() + 1; //月 + var day = now.getDate(); //日 + + var clock = year + "-"; + + if(month < 10) month += "0"; + clock += month + "-"; + + if(day < 10) day += "0"; + clock += day; + + // if(hh < 10) + // clock += "0"; + + // clock += hh + ":"; + // if (mm < 10) clock += '0'; + // clock += mm + ":"; + + // if (ss < 10) clock += '0'; + // clock += ss; + return clock; + }, + + + // 请求数据 + 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() { + wx.hideLoading(); + _this.setData({ + 'list.pageData': [] + }); + }); + // .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/service_record/service_record.json b/packageA/pages/service_record/service_record.json new file mode 100644 index 0000000..412579a --- /dev/null +++ b/packageA/pages/service_record/service_record.json @@ -0,0 +1,7 @@ +{ + "navigationBarTitleText": "服务记录", + "enablePullDownRefresh": false, + "usingComponents": { + "nodata": "/components/nodata/nodata" + } +} \ No newline at end of file diff --git a/packageA/pages/service_record/service_record.wxml b/packageA/pages/service_record/service_record.wxml new file mode 100644 index 0000000..ba12c86 --- /dev/null +++ b/packageA/pages/service_record/service_record.wxml @@ -0,0 +1,49 @@ + + + + + + + + {{startDate}} + + + + {{endDate}} + + + 查询 + + + + + + + + 服务时间:{{item.EffectiveDay}} + + + + 项目名称 + {{item.ProjectName}} + + + 服务门店 + {{item.StorageName}} + + + 剩余次数 + {{item.EndQty}} + + + + + + + + + + + + + diff --git a/packageA/pages/service_record/service_record.wxss b/packageA/pages/service_record/service_record.wxss new file mode 100644 index 0000000..51bcc10 --- /dev/null +++ b/packageA/pages/service_record/service_record.wxss @@ -0,0 +1,638 @@ +/* 背景色相关 */ +bg-white { + background-color: white; +} + +/* 外边距相关 */ +mgt12 { + margin-top: 12rpx; +} + +/* 边框相关 */ +.bdt { + border-top: 2rpx solid #F6F6F6; +} + +/* 颜色相关 */ +.c-a9{ + color: #A9A9A9; +} +.c-9 { + color: #999; +} + +.c-tb { + color: #ff5000; +} + +.c-r { + color: #FF3B3D; +} + +/* 内边距 */ +.pdt20 { + padding-top: 20rpx; +} + +.bold { + font-weight: bold; +} + +.f1 { + flex: 1; +} + +.pdh10 { + padding-left: 10rpx; + padding-right: 10rpx; +} + + +page { + font-family: microsoft yahei; + background-color: #F5F5F5; + height: 100%; +} + +.type-navbar { + white-space: nowrap; + display: flex; + height: 88rpx; + background-color: #fff; + justify-content: space-between; + /* border-top: 2rpx solid #f6f6f6; */ +} + +.type-box { + box-sizing: border-box; + width: 20%; + line-height: 88rpx; + text-align: center; + display: inline-block; + overflow: hidden; +} + +.type-navbar-item { + /* border-bottom: 4rpx solid #fff; */ +} + +.type-item-on { + /* background-color: #FF3B3D; */ + color: #FF3B3D; + font-weight: bold; + /* border-bottom: 4rpx solid #ED3036; */ + position: relative; +} +.type-item-on:after { + content: ''; + position: absolute; + left: 0; + right: 0; + bottom: 0; + width: 40%; + height: 4rpx; + background-color: #FF3B3D; + margin: 0 auto; +} + +.container { + position: fixed; + width: 100%; + top: 0; + z-index: 4; + /* position: -webkit-sticky; + position:sticky; + top: 0; */ +} + +.list-container { + padding-left: 20rpx; + padding-right: 20rpx; + overflow: hidden; + /* height: calc(100% - 282rpx); */ + padding-top: 282rpx; +} + +.stay_evaluate { + background-color: white; + margin-top: 20rpx; + border-radius: 8rpx; +} + +/* 原 */ + +.goods-container { + display: flex; + justify-content: space-between; + flex-wrap: wrap; + box-sizing: content-box; + padding: 20rpx 0; +} + +.goods-box { + width: 100%; + background-color: #fff; + padding: 0 25rpx; + margin-bottom: 20rpx; + font-size: 28rpx; + border-bottom: 1rpx solid #eee; + padding-bottom: 25rpx; +} + +.goods-title { + display: flex; + justify-content: space-between; + align-items: center; + height: 100rpx; +} + +.order-number { + font-size: 32rpx; + color: #666; +} + +.pay-status { + color: #f23030; +} + +.goods-cont { + padding: 20rpx 0; + display: flex; + justify-content: space-between; + position: relative; +} + +.img-box { + width: 180rpx; + height: 180rpx; +} + +.goods-mes { + width: 490rpx; +} + +.goods-name { + height: 30rpx; + margin-bottom: 16rpx; + overflow: hidden; + line-height: 30rpx; + color: #333; + word-break: keep-all; + white-space: nowrap; + text-overflow: ellipsis; + font-size: 30rpx; +} + +.goods-price { + color: #f23030; + padding-bottom: 20rpx; + font-size: 30rpx; +} + +.goods-num { + color: #999; + font-size: 30rpx; +} + +.goods-tips { + height: 60rpx; + padding: 10rpx 0; + display: flex; + justify-content: space-between; + align-items: center; +} + +.order-total { + display: flex; + justify-content: flex-end; + padding-top: 24rpx; + padding-bottom: 24rpx; +} + +.goods-total { + margin-right: 20rpx; +} + +.order-btn { + width: 150rpx; + height: 50rpx; + line-height: 50rpx; + text-align: center; + /* border: 1px solid #eee; */ + margin-left: 10rpx; + /* float: right; */ + border-radius: 6rpx; + overflow: hidden; + background-color: #FF3B3D; +} + +.order-btn-pay { + color: #fff; + background-color: #f23030; + border-color: #f23030; +} + +.return-btn.co-red { + color: #e02e24; +} + +.check-btn { + margin-bottom: 20rpx; +} + +/* 新 */ + + +.Commodity_number { + height: 80rpx; + color: #696969; + /* border-top: 13rpx solid rgb(245, 245, 245); */ +} + +.Commodity_number .lin { + border-right: 1rpx solid #C4182E; + margin: 0rpx 11rpx; width: 2rpx; + height: 31rpx; +} + +.Commodity_number image { + width: 30rpx; + height: 30rpx; +} + +.padding { + padding: 0 18rpx; +} + +/* 文字基线对齐 */ + +.baseline { + align-items: baseline; +} + +.border_bottom { + border-bottom: 2rpx solid rgb(245, 245, 245); +} + +/* 单个商品框架 */ + +.detail_commodity { + height: 231rpx; +} + +.detail_commodity image { + display: block; + /* width: 186rpx; + height: 186rpx; */ + width: 100%; + height: 100%; +} + +.detail_commodity .goods_name { + width: 485rpx; + /* height: 75rpx; */ + line-height: 37rpx; + text-align: justify; +} + +.Commodity_content { + height: 185rpx; + margin-left: 21rpx; +} + +.Commodity_content .Commodity_goods { + height: 150rpx; +} + +.Commodity_content .Commodity_money { + font-size: 16rpx; + letter-spacing: 1rpx; +} + +/* 商品评价按钮框架 */ + +.commodity_evaluate { + /* padding-top: 15rpx; + padding-bottom: 15rpx; */ + /* border-bottom: 4rpx solid rgb(245, 245, 245); */ +} + +.commodity_evaluate .commodity_smy .commodity_money { + margin-left: 29rpx; + letter-spacing: 1rpx; + /* font-weight: bold; */ + +} + +.commodity_evaluate .links { + /* height: 92rpx; */ + /* height: auto; */ + padding-top: 20rpx; + padding-bottom: 20rpx; + border-top: 2rpx solid #F6F6F6; + display: flex; + align-items: center; +} + +.commodity_evaluate .commodity_To_evaluate { + width: 155rpx; + height: 48rpx; + border-radius: 6rpx; + line-height: 48rpx; + /* margin-bottom: 10rpx; */ +} + +.commodity_evaluate .commodity_To_evaluate view { + height: 39rpx; + line-height: 39rpx; +} + +.commodity_evaluate .comment_go { + /* background-color: rgb(211, 28, 52); */ + background-color: #FF3B3D; + color: white; + margin-left: 18rpx; + width: 155rpx; + height: 48rpx; + line-height: 48rpx; +} + +.Commodity_spec { + height: 37rpx; + line-height: 37rpx; + max-width: 160rpx; + background-color: rgb(236, 236, 236); + border-radius: 6rpx; + font-size: 22rpx; + margin-top: 10rpx; + padding:0rpx 10rpx; +} + +.Commodity_evaluation .Comment_content { + color: rgb(153, 153, 153); + letter-spacing: 1rpx; +} + +.Commodity_evaluation .starss { + height: 58rpx; + /* // line-height: 58rpx; */ + align-items: center; +} + +.Commodity_evaluation .commen { + height: 58rpx; + line-height: 58rpx; +} + +.Commodity_evaluation .starss .stars { + line-height: 58rpx; +} + +.Commodity_evaluation .starss .stars image { + width: 29rpx; + height: 26rpx; + margin-right: 5rpx; +} + +.Commodity_evaluation .Comment_images image { + width: 100rpx; + height: 100rpx; + margin-right: 8rpx; + margin-top: 18rpx; + border-radius: 6rpx; + border: 3rpx solid rgb(245, 245, 245); +} + +.commodity_evaluate .View_evaluation { + border: 1px solid #E5E5E5; + color: rgb(0, 0, 0); + background-color: rgb(255, 255, 255); + margin-left: 18rpx; +} + +.comment_addtime { + height: 50rpx; +} + +.title_width { + width: 146rpx; + text-align: center; +} + +.After_all { + height: 80rpx; + background-color: rgb(245, 245, 245); +} + +.After_all .Line { + border-top: 1rpx solid rgb(0, 0, 0); + width: 130rpx; +} + +.After_all .end { + margin: 0rpx 15rpx; + color: #ccc; +} + +/* 无订单 */ + +.empty_order image { + width: 292rpx; + height: 268rpx; + margin-top: 202rpx; +} + +.empty_order .xc-ash { + margin-top: 10rpx; + font-weight: 600px; +} + +.empty_order navigator { + margin-top: 60rpx; + border-radius: 40rpx; +} + +.empty_order navigator view { + width: 247rpx; + height: 60rpx; + line-height: 60rpx; + background-color: rgb(255, 72, 72); + border-radius: 8rpx; +} + +.rel { + box-sizing: border-box; + width: 180rpx; + height: 180rpx; + overflow: hidden; + /* border: 2rpx solid rgb(236, 236, 236); */ +} + +.abs { + top: 15rpx; + left: -39rpx; + width: 154rpx; + height: 40rpx; + background-color: rgb(214, 1, 33); + transform: rotate(320deg); + color: rgb(255, 255, 255); + line-height: 40rpx; +} +.code{ + width: 44rpx; + height: 44rpx; +} +.refund{ + margin-top: 20rpx; +} + +.tab-container { + display: flex; + justify-content: space-between; + text-align: center; + font-size: 28rpx; + border-bottom: 2rpx solid #f2f2f2; +} +.tab-container .iconfont { + margin-right: 10rpx; +} +.tab { + flex: 1; + line-height: 80rpx; + background-color: white; + position: relative; +} +.tab.active { + color: #FF3B3D; + font-weight: bold; +} +.tab.active::after { + content: ''; + position: absolute; + left: 0; + right: 0; + bottom: 0; + width: 50%; + height: 2px; + margin: 0 auto; + background-color: #FF3B3D; +} +.search-container { + /* display: flex; */ + padding: 10px; + background-color: white; +} +.search-input { + background-color: #f2f2f2; + flex: 1; + border-radius: 4px 0 0 4px; + height: 70rpx; + line-height: 70rpx; + font-size: 14px; + padding: 0 10px; +} +.search-btn { + color: white; + font-size: 14px; + background-color: #FF3B3D; + padding: 8px 20px; + border-radius: 0 4px 4px 0; +} +.picker-container { + padding-right: 10rpx; + align-items: center; + +} +.picker-date { + background-color: #f5f5f5; + flex: 1; + border-radius: 10rpx; +} +/* .picker-date:before { + font-family: iconfont; + content: '\e64c'; +} */ +.picker { + color: #ccc; + line-height: 70rpx; + font-size: 26rpx; + position: relative; + padding-left: 70rpx; +} + +.picker:before { + position: absolute; + font-family: iconfont; + content: '\e64c'; + left: 30rpx; +} + +.list2 { + padding-left: 18rpx; + padding-right: 18rpx; +} +.title { + padding: 20rpx; + font-size: 26rpx; + display: flex; + align-items: center; +} +.icon-order { + font-size: 26rpx; + color: #FF3B3D; + margin-right: 10rpx; +} +.subtitle { + display: flex; + font-size: 24rpx; + justify-content: space-between; + background-color: #f0f0f0; + line-height: 60rpx; + padding: 0 20rpx; + color: #999; +} +.item { + background-color: white; + border-radius: 16rpx; + margin-top: 20rpx; + overflow: hidden; +} +.subitem { + width: calc(100% / 3); + text-align: center; + font-size: 26rpx; +} +.name { + padding: 0 20rpx; + margin: 20rpx 0; + font-size: 26rpx; + word-break: break-all; + text-align: justify; +} +.key { + padding: 20rpx 0; + color: #999; +} +.val { + padding-bottom: 20rpx; + color: red; +} + +.offline-container { + padding: 106rpx 20rpx 20rpx; +} + +.search-btn2 { + border-top-left-radius: 8rpx; + border-bottom-left-radius: 8rpx; +} + + +.no-more { + font-size: 28rpx; + line-height: 3; + color: #909090; +} + + + diff --git a/pages/giftpack/buygiftpack/giftpackbuy.js b/pages/giftpack/buygiftpack/giftpackbuy.js index ef114b1..062f03f 100644 --- a/pages/giftpack/buygiftpack/giftpackbuy.js +++ b/pages/giftpack/buygiftpack/giftpackbuy.js @@ -249,7 +249,7 @@ Page({ bind_bnerr2: function(e) { var _errImg = e.target.dataset.errorimg; var _errObj = {}; - _errObj[_errImg] = "/public/images/empty.jpg"; + _errObj[_errImg] = "/miniapp/images/default_g_img.gif"; this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ; }, goto: function(e) { diff --git a/pages/giftpack/buygiftpack/giftpackbuy.wxml b/pages/giftpack/buygiftpack/giftpackbuy.wxml index ed1d5c4..6b36821 100644 --- a/pages/giftpack/buygiftpack/giftpackbuy.wxml +++ b/pages/giftpack/buygiftpack/giftpackbuy.wxml @@ -24,7 +24,10 @@ - + + diff --git a/pages/giftpack/buygiftpack/giftpackbuy.wxss b/pages/giftpack/buygiftpack/giftpackbuy.wxss index 4125b40..b9a7391 100644 --- a/pages/giftpack/buygiftpack/giftpackbuy.wxss +++ b/pages/giftpack/buygiftpack/giftpackbuy.wxss @@ -84,7 +84,7 @@ page { } .content_box_img image { - width: 100%; + width: 230rpx; height: 230rpx; } diff --git a/pages/giftpack/mygiftpack/mygiftpack.js b/pages/giftpack/mygiftpack/mygiftpack.js index 2bd7c82..5e38b80 100644 --- a/pages/giftpack/mygiftpack/mygiftpack.js +++ b/pages/giftpack/mygiftpack/mygiftpack.js @@ -129,7 +129,7 @@ Page({ bind_bnerr2: function(e) { var _errImg = e.target.dataset.errorimg; var _errObj = {}; - _errObj[_errImg] = "/public/images/empty.jpg"; + _errObj[_errImg] = "/miniapp/images/default_g_img.gif"; this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ; }, diff --git a/pages/giftpack/mygiftpack/mygiftpack.wxml b/pages/giftpack/mygiftpack/mygiftpack.wxml index 1fdc67e..5d9fc3e 100644 --- a/pages/giftpack/mygiftpack/mygiftpack.wxml +++ b/pages/giftpack/mygiftpack/mygiftpack.wxml @@ -26,7 +26,9 @@ - + + + diff --git a/pages/giftpack/mygiftpack/mygiftpack.wxss b/pages/giftpack/mygiftpack/mygiftpack.wxss index 6418ac2..ec5986b 100644 --- a/pages/giftpack/mygiftpack/mygiftpack.wxss +++ b/pages/giftpack/mygiftpack/mygiftpack.wxss @@ -80,7 +80,7 @@ } .content_box_img image { - width: 100%; + width: 230rpx; height: 230rpx; } diff --git a/pages/goods/goodsInfo/buy_integral.wxml b/pages/goods/goodsInfo/buy_integral.wxml index a49250f..0406e25 100644 --- a/pages/goods/goodsInfo/buy_integral.wxml +++ b/pages/goods/goodsInfo/buy_integral.wxml @@ -26,7 +26,7 @@ - + {{def_pick_store.pickup_name}} 距离:{{def_pick_store.distance>1000?filters.toFix(def_pick_store.distance/1000,2)+"km":filters.toFix(def_pick_store.distance,0)+"m"}} @@ -53,7 +53,7 @@ - 地址:{{def_pick_store.fulladdress}} + 地址:{{def_pick_store.fulladdress}} diff --git a/pages/goods/goodsInfo/buy_integral_normal.wxml b/pages/goods/goodsInfo/buy_integral_normal.wxml index 8bb1445..e14a36f 100644 --- a/pages/goods/goodsInfo/buy_integral_normal.wxml +++ b/pages/goods/goodsInfo/buy_integral_normal.wxml @@ -28,7 +28,7 @@ - + {{def_pick_store.pickup_name}} 距离:{{def_pick_store.distance>1000?filters.toFix(def_pick_store.distance/1000,2)+"km":filters.toFix(def_pick_store.distance,0)+"m"}} @@ -54,7 +54,7 @@ (库存不足) - 地址:{{def_pick_store.fulladdress}} + 地址:{{def_pick_store.fulladdress}} diff --git a/pages/goods/goodsInfo/goodsInfo.js b/pages/goods/goodsInfo/goodsInfo.js index bf7e9c2..ea3b5d3 100644 --- a/pages/goods/goodsInfo/goodsInfo.js +++ b/pages/goods/goodsInfo/goodsInfo.js @@ -492,9 +492,8 @@ Page({ }) } } - }, 500) - },1500) + },700) }); @@ -2075,8 +2074,9 @@ Page({ var timer_get = setInterval(function() { if (th.data.is_get_local_ok == 0) return false; - var dd = null, - i = getApp().request; + var dd = null,i = getApp().request; + if (!th.data.sele_g) return false; + var g_distr_type = th.data.sele_g.distr_type; if (g_distr_type != 0) { dd = { @@ -2163,6 +2163,8 @@ Page({ //------------处理门店--------------- deal_pickup(e){ var th=this; + if(!th.data.sele_g) return false + var g_distr_type=th.data.sele_g.distr_type; wx.hideLoading(); @@ -2323,6 +2325,8 @@ Page({ //------------处理线下门店库存-------- deal_pickup_dline(e){ var pkno=[],th=this; + if(!th.data.sele_g) return false; + if(this.data.def_pick_store){ pkno.push(this.data.def_pick_store.pickup_no); } @@ -2698,6 +2702,7 @@ Page({ }else{ ee.setData({prom_type: 0, isshow: 1,}); ee.get_sku(os.stoid, ee.data.data.sku, gid); + ee.get_sto(); return false; } }) diff --git a/pages/goods/goodsInfo/goodsInfo.wxml b/pages/goods/goodsInfo/goodsInfo.wxml index 78bb381..d56de6c 100644 --- a/pages/goods/goodsInfo/goodsInfo.wxml +++ b/pages/goods/goodsInfo/goodsInfo.wxml @@ -433,7 +433,7 @@ - + {{def_pick_store.pickup_name}} @@ -1031,7 +1031,7 @@ - + {{def_pick_store.pickup_name}} 距离:{{def_pick_store.distance>1000?filters.toFix(def_pick_store.distance/1000,2)+"km":filters.toFix(def_pick_store.distance,0)+"m"}} @@ -1058,7 +1058,7 @@ - 地址:{{def_pick_store.fulladdress}} + 地址:{{def_pick_store.fulladdress}} diff --git a/pages/index/index/index.js b/pages/index/index/index.js index bc6f8b6..417d268 100644 --- a/pages/index/index/index.js +++ b/pages/index/index/index.js @@ -75,6 +75,8 @@ Page({ new_nav: "", //新人页面跳转地址 w_holiday_pop:0, + showHongbao: true, + showHongbaoSmall: false, }, onLoad: async function(tt) { @@ -94,7 +96,27 @@ Page({ } }) } - + + // 判断是否有红包活动 + getApp().request.promiseGet('/api/weshop/redmoney/redConfig/get/'+getApp().globalData.setting.stoid, { + data: {} + }).then(function(data) { + // console.log('909090909090----->', data.data.code); + let code = data.data.code; + if(code == 0) { + + th.setData({ + showHongbao: true, + }); + } else if(code == -1) { + th.setData({ + showHongbao: false, + }); + }; + }); + + + // console.log(9090909); //看一下商家是否开通了权益 @@ -184,8 +206,7 @@ Page({ } }) - - + }, //关闭新用户领取广告 close_disgraceful: function() { @@ -205,7 +226,15 @@ Page({ getApp().requestCardNum(this); } - var th = this + var th = this + var show=getApp().globalData.isLoad_ad; + if(show){ + var full_screen = this.selectComponent("#full_screen"); //组件的id + full_screen.get_the_full_screen(); + }else{ + getApp().globalData.isLoad_ad=1; + } + }, //当隐藏的时候就关闭计时器 onHide: function() { @@ -251,6 +280,7 @@ Page({ } }) + //--首页的问题-- if (getApp().globalData.config && getApp().globalData.config.store_name != undefined && getApp().globalData.config.store_name != null) { @@ -261,7 +291,10 @@ Page({ wx.setNavigationBarTitle({ title: getApp().globalData.setting.appName, }); - } + }; + + + }, //---读取数据内容--- async init_fir() { @@ -273,21 +306,24 @@ Page({ enabled: 1 } }).then(res => { - var a = res.data.data.pageData; - var arr = new Array(); - for (var i = 0; i < a.length; i++) { - var tt = { - 'ad_code': o.imghost + a[i].ad_code, - 'media_link': '', - 'ad_weapplink':a[i].ad_weapplink - }; - arr.push(tt); - } - if (arr.length > 0) e.setData({ - banner: arr, - }); + + if(res.data.code==0 && res.data.data.pageData && res.data.data.pageData.length>0){ + var a = res.data.data.pageData; + var arr = new Array(); + for (var i = 0; i < a.length; i++) { + var tt = { + 'ad_code': o.imghost + a[i].ad_code, + 'media_link': '', + 'ad_weapplink':a[i].ad_weapplink + }; + arr.push(tt); + } + if (arr.length > 0) e.setData({ + banner: arr, + }); - wx.stopPullDownRefresh(); + wx.stopPullDownRefresh(); + } }) //-----秒杀----- @@ -875,10 +911,16 @@ Page({ //导航跳转 nav_goto:function(e){ - var url=e.currentTarget.dataset.url; - if(!url || url=='') return; - if(url[0]!='/') url='/'+url; - getApp().goto(url); + var url=e.currentTarget.dataset.url; + if(!url || url=='') return; + if(url[0]!='/') url='/'+url; + getApp().goto(url); + if(this.data.showHongbao) { + this.setData({ + showHongbao: false, + showHongbaoSmall: true, //显示抢红包小图标 + }); + } }, //----跳转到搭配购买---- @@ -898,6 +940,14 @@ Page({ title: '首页-' + getApp().globalData.config.store_name, } }, - + + + // 关闭首页抢红包主弹窗,显示侧边栏抢红包小图标 + closeHongbao() { + this.setData({ + showHongbao: false, //关闭抢红包主弹窗 + showHongbaoSmall: true, //显示抢红包小图标 + }); + }, }); \ No newline at end of file diff --git a/pages/index/index/index.json b/pages/index/index/index.json index 63d46fb..878ab3a 100644 --- a/pages/index/index/index.json +++ b/pages/index/index/index.json @@ -17,7 +17,8 @@ "picMax": "/components/diy_picMax/diy_picMax", "mvideo": "/components/diy_video/diy_video", "service": "/components/diy_service/diy_service", - "scan": "/components/diy_scan/diy_scan" + "scan": "/components/diy_scan/diy_scan", + "full_screen": "/components/full_screen/full_screen" }, "enablePullDownRefresh": false } \ No newline at end of file diff --git a/pages/index/index/index.wxml b/pages/index/index/index.wxml index 66f3926..6d5db66 100644 --- a/pages/index/index/index.wxml +++ b/pages/index/index/index.wxml @@ -287,8 +287,11 @@ + + + @@ -377,6 +380,27 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/pages/index/index/index.wxss b/pages/index/index/index.wxss index 82585c7..3a0bfc4 100644 --- a/pages/index/index/index.wxss +++ b/pages/index/index/index.wxss @@ -925,4 +925,43 @@ page { overflow-x: hidden; padding-bottom: 120rpx; } -.container{ overflow: hidden;} \ No newline at end of file +.container{ overflow: hidden;} + + +.hongbao-container { + position: fixed; + width: 100%; + height: 100%; + top: 0; + left: 0; + background-color: rgba(0,0,0,.5); + z-index: 999; +} + +.hongbao { + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); +} + +.hongbao-img { + width: 440rpx; + height: 640rpx; +} + +.close { + position: absolute; + top: 0; + right: 0; +} + +.hongbao_sm-img { + width: 124rpx; + height: 170rpx; + position: fixed; + top: 50%; + right: 0; + /* transform: translateY(-50%); */ + z-index: 10000; +} \ No newline at end of file diff --git a/pages/user/coupons/coupons.wxml b/pages/user/coupons/coupons.wxml index 9d3cbd9..b061963 100644 --- a/pages/user/coupons/coupons.wxml +++ b/pages/user/coupons/coupons.wxml @@ -63,7 +63,7 @@ 有效期:不限 - {{detail.Remark}} + {{filter.getNum(detail.Sum)}}元优惠券,{{(detail.UseObjectID==null || detail.UseObjectID=='')?"全场通用":"仅限"+(detail.UseObjectName)+"使用"}},满 {{detail.BuySum==null || detail.BuySum==''?filter.getNum(0):filter.getNum(detail.BuySum)}}元使用 {{detail.region_list_name==null || detail.region_list_name==''?"":",不包邮地区:"+region_list_name}};{{detail.Remark1}} 使用说明: {{filter.getNum(detail.Sum)}}元优惠券,{{(detail.UseObjectID==null || detail.UseObjectID=='')?"全场通用":"仅限"+(detail.UseObjectName)+"使用"}},满 {{detail.BuySum==null || detail.BuySum==''?filter.getNum(0):filter.getNum(detail.BuySum)}}元使用 {{detail.region_list_name==null || detail.region_list_name==''?"":",不包邮地区:"+region_list_name}} diff --git a/pages/user/coupons/query/index.wxml b/pages/user/coupons/query/index.wxml index 9aa7de2..77a1742 100644 --- a/pages/user/coupons/query/index.wxml +++ b/pages/user/coupons/query/index.wxml @@ -102,7 +102,8 @@ 有效期: 不限 - 使用说明: {{filter.getNum(detail.Sum)}}元优惠券,{{detail.UseObjectID==null || detail.UseObjectID==''?"全场通用":"仅限"+(detail.UseObjectName)+"使用"}},满 {{detail.BuySum==null || detail.BuySum==''?filter.getNum(0):filter.getNum(detail.BuySum)}}元使用{{detail.region_list_name==null || detail.region_list_name==''?"":",不包邮地区:"+region_list_name}} + {{filter.getNum(detail.Sum)}}元优惠券,{{(detail.UseObjectID==null || detail.UseObjectID=='')?"全场通用":"仅限"+(detail.UseObjectName)+"使用"}},满 {{detail.BuySum==null || detail.BuySum==''?filter.getNum(0):filter.getNum(detail.BuySum)}}元使用 {{detail.region_list_name==null || detail.region_list_name==''?"":",不包邮地区:"+region_list_name}};{{detail.Remark}} + 使用说明: {{filter.getNum(detail.Sum)}}元优惠券,{{(detail.UseObjectID==null || detail.UseObjectID=='')?"全场通用":"仅限"+(detail.UseObjectName)+"使用"}},满 {{detail.BuySum==null || detail.BuySum==''?filter.getNum(0):filter.getNum(detail.BuySum)}}元使用 {{detail.region_list_name==null || detail.region_list_name==''?"":",不包邮地区:"+region_list_name}} diff --git a/pages/user/coupons/query/index.wxss b/pages/user/coupons/query/index.wxss index 90f9443..e0f335c 100644 --- a/pages/user/coupons/query/index.wxss +++ b/pages/user/coupons/query/index.wxss @@ -350,7 +350,8 @@ color:#999999; font-size: 25rpx; text-align: center; - height: 47rpx; + min-height: 47rpx; + height:auto; color: #999999; } 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