diff --git a/commons/js/config.js b/commons/js/config.js index a28495c..9be6f18 100644 --- a/commons/js/config.js +++ b/commons/js/config.js @@ -113,6 +113,12 @@ api = { appCusorderdata:'app/Cusorderdata', //获取订单图片 /上传编辑国补资料 appCusorderV2Info:'app/cusorderV2/info', //修改订单基本信息 appCusorderV2Status:'app/cusorderV2/status', //删除订单 + + appSytactivityTabs:'app/sytactivity/tabs', //私域通_tab + appSytactivityList:'app/sytactivity/list', //活动列表 + appSytactivityDetail:'app/sytactivity/detail', //活动详情 + appSytactivityLog:'app/sytactivity/log', //实时战报 + appSytactivityRanking:'app/sytactivity/ranking', //活动排名 } diff --git a/commons/js/utils/apiQuery.js b/commons/js/utils/apiQuery.js index c1c2a05..582d206 100644 --- a/commons/js/utils/apiQuery.js +++ b/commons/js/utils/apiQuery.js @@ -754,4 +754,39 @@ apiQuery.putAppCusorderV2Status = function (params) { }) } +//私域通_tab +apiQuery.getAppSytactivityTabs = function (params) { + return new Promise(function (resolve, reject) { + HttpRequest(false, Config.api.appSytactivityTabs, 2, params, "GET", resolve, reject) + }) +} + +//活动列表 +apiQuery.getAppSytactivityList = function (params) { + return new Promise(function (resolve, reject) { + HttpRequest(false, Config.api.appSytactivityList, 2, params, "GET", resolve, reject) + }) +} + +//活动详情 +apiQuery.getAppSytactivityDetail = function (params) { + return new Promise(function (resolve, reject) { + HttpRequest(false, Config.api.appSytactivityDetail, 2, params, "GET", resolve, reject) + }) +} + +//实时战报 +apiQuery.getAppSytactivityLog = function (params) { + return new Promise(function (resolve, reject) { + HttpRequest(false, Config.api.appSytactivityLog, 2, params, "GET", resolve, reject) + }) +} + +//活动排名 +apiQuery.getAppSytactivityRanking = function (params) { + return new Promise(function (resolve, reject) { + HttpRequest(false, Config.api.appSytactivityRanking, 2, params, "GET", resolve, reject) + }) +} + export default apiQuery; \ No newline at end of file diff --git a/components/activityPoster/index.js b/components/activityPoster/index.js index 2d28c8f..a3ae3a0 100644 --- a/components/activityPoster/index.js +++ b/components/activityPoster/index.js @@ -101,8 +101,9 @@ Component({ //二维码 if (that.data.imgs[1]) { - Canvas.circleImage(CTX,that.data.imgs[1].path,417, height-180,70) + CTX.drawImage(that.data.imgs[1].path,417, height-180,140,140) } + setTimeout(function(){ CTX.save() diff --git a/pages/customer/filterList/index.js b/pages/customer/filterList/index.js index ddb8cb0..3348345 100644 --- a/pages/customer/filterList/index.js +++ b/pages/customer/filterList/index.js @@ -22,6 +22,7 @@ Page({ cfrom:'',//客户来源 o_type:'',//排序类型 visit:'',//只显示待回访客户(1是) + a_id:'',//活动ID }, onLoad(options) { for (let key in options) { @@ -85,6 +86,9 @@ Page({ if(this.data.o_type != ''){ params['o_type'] = this.data.o_type; } + if(this.data.a_id != ''){ + params['a_id'] = this.data.a_id; + } _.apiQuery.getAppCustomersList(params).then(res => { this.setData({ total: res.data.total, diff --git a/pages/siyutong/activityDetail/index.js b/pages/siyutong/activityDetail/index.js index 6158ca9..366edf5 100644 --- a/pages/siyutong/activityDetail/index.js +++ b/pages/siyutong/activityDetail/index.js @@ -9,10 +9,64 @@ Page({ isShowBg: false, txtColor: '#fff' }, - imgs: [], + list: [], + pageNo: 1, + noData: false, + end: false, + load: true, + loading: false, }, onLoad: function (options) { + for (let key in options) { + this.setData({ + [key]: options[key] + }) + } flagForScroll = false + this.getAppSytactivityDetail() + this.getAppSytactivityLog() + }, + + //活动详情 + getAppSytactivityDetail(){ + let params = {}; + params['id'] = this.data.id; + _.apiQuery.getAppSytactivityDetail(params).then(res => { + this.setData({ + info:res.data, + }) + wx.stopPullDownRefresh() + }); + }, + + //实时战报 + getAppSytactivityLog() { + this.setData({ + load: false, + loading: true, + }) + let params = {}; + params['page'] = this.data.pageNo; + params['size'] = 10; + params['id'] = this.data.id; + _.apiQuery.getAppSytactivityLog(params).then(res => { + this.setData({ + pageNo: this.data.pageNo + 1, + list: this.data.list.concat(res.data.list), + load: true, + loading: false, + }) + if (res.data.total == 0) { + this.setData({ + noData: true + }) + } else if (this.data.list.length == res.data.total) { + this.setData({ + end: true + }) + } + wx.stopPullDownRefresh() + }); }, //生成海报 @@ -22,8 +76,8 @@ Page({ title: '正在生成中...', }) that.setData({ - 'poster.customPoster':'https://qs.haodian.cn/wechat_app/lichebao/siyutong/detail.jpg', - 'poster.codeImg':'https://qs.haodian.cn/wechat_app/lichebao/index/jrKF-code2.jpg', + 'poster.customPoster':that.data.info.poster, + 'poster.codeImg':that.data.info.btn.share_url, }) setTimeout(function(){ that.setData({ @@ -67,8 +121,30 @@ Page({ } }, - //页面相关事件处理函数--监听用户下拉动作 - onPullDownRefresh: function () { + //推送链接 + pushLink(e) { + if(e.currentTarget.dataset.url){ + _.$router.openUrlScheme(e.currentTarget.dataset.url) + } + }, + //页面相关事件处理函数--监听用户下拉动作 + onPullDownRefresh(){ + this.setData({ + list: [], + pageNo: 1, + noData: false, + end: false, + load: true, + loading: false, + }) + this.getAppSytactivityDetail() + this.getAppSytactivityLog() + }, + + //页面上拉触底事件的处理函数 + onReachBottom(){ + if (this.data.noData || this.data.end||!this.data.load) return; + this.getAppSytactivityLog() }, }) \ No newline at end of file diff --git a/pages/siyutong/activityDetail/index.wxml b/pages/siyutong/activityDetail/index.wxml index d11ebdb..e25d6e3 100644 --- a/pages/siyutong/activityDetail/index.wxml +++ b/pages/siyutong/activityDetail/index.wxml @@ -1,61 +1,42 @@ - + - 年末购车大潮,为满足公司需要,现开展蓄客活动。各位狸车同仁,请积极邀请朋友参加活动所有客户都会进入你们自己的客户池。 + {{info.remark}} - - 当前门店排名 + + {{info.ranking.title}} - 2 + {{info.ranking.value}} - - - 50.32w - 报名 - - - 50.32w - 报名 - - - 50.32w - 报名 - + + + {{item.value}} + {{item.title}} + + - - 东风EX1特约直播!东风EX1特约直播!东风EX1特约直播!东风EX1特约直播! - - 2秒前 + + + {{item.content}} + {{item.c_time}} - - - 东风EX1特约直播!东风EX1特约直播!东风EX1特约直播!东风EX1特约直播! - - 2秒前 - - - - 东风EX1特约直播!东风EX1特约直播!东风EX1特约直播!东风EX1特约直播! - - 2秒前 - - + - 马上邀请 + {{info.btn.title}} diff --git a/pages/siyutong/activityDetail/index.wxss b/pages/siyutong/activityDetail/index.wxss index 86c6608..01f3785 100644 --- a/pages/siyutong/activityDetail/index.wxss +++ b/pages/siyutong/activityDetail/index.wxss @@ -32,4 +32,9 @@ page{ .ac-btn{ background-image:linear-gradient(#ffa73d,#ff7a28); border-bottom:#db610d 6rpx solid; +} + +.ac-btn-none{ + background-image:linear-gradient(#bebebe,#aaa9a9); + border-bottom:#888 6rpx solid; } \ No newline at end of file diff --git a/pages/siyutong/activityRanking/index.js b/pages/siyutong/activityRanking/index.js index c49aa23..f8fa87f 100644 --- a/pages/siyutong/activityRanking/index.js +++ b/pages/siyutong/activityRanking/index.js @@ -1,9 +1,30 @@ +import _ from '../../../commons/js/commons' Page({ data: { isShowRule:false, }, onLoad: function (options) { + for (let key in options) { + this.setData({ + [key]: options[key] + }) + } + this.getAppSytactivityRanking() + }, + //活动排名 + getAppSytactivityRanking(){ + let params = {}; + params['id'] = this.data.id; + _.apiQuery.getAppSytactivityRanking(params).then(res => { + this.setData({ + info:res.data, + }) + wx.setNavigationBarTitle({ + title:res.data.title, + }) + wx.stopPullDownRefresh() + }); }, //显示隐藏积分规则 @@ -12,4 +33,16 @@ Page({ isShowRule:!this.data.isShowRule, }) }, + + //推送链接 + pushLink(e) { + if(e.currentTarget.dataset.url){ + _.$router.openUrlScheme(e.currentTarget.dataset.url) + } + }, + + //页面相关事件处理函数--监听用户下拉动作 + onPullDownRefresh(){ + this.getAppSytactivityRanking() + }, }) \ No newline at end of file diff --git a/pages/siyutong/activityRanking/index.wxml b/pages/siyutong/activityRanking/index.wxml index d4b3cae..e8131f2 100644 --- a/pages/siyutong/activityRanking/index.wxml +++ b/pages/siyutong/activityRanking/index.wxml @@ -1,23 +1,21 @@ - 我的直营店 - 120分 + {{info.biz.title}} + {{info.biz.value}} - - 厦门直营店 - 120分 - - - 2厦门直营店 - 120分 - - - 3厦门直营店 - 120分 - + + + + + {{item.num}} + {{item.biz_name}} + + {{item.score}} + + 积分规则> @@ -26,10 +24,9 @@ - 积分规则 + {{info.rule.title}} - 邀请一个人进入活动页面 浏览1分 - 邀请一个人进入活动页面报名10分 + {{info.rule.value}} 知道了 diff --git a/pages/siyutong/index.js b/pages/siyutong/index.js index 1a6cb61..32470b3 100644 --- a/pages/siyutong/index.js +++ b/pages/siyutong/index.js @@ -16,6 +16,7 @@ Page({ current: 0 }, swiperCurrent: 0, + list: [], }, //生命周期函数--监听页面加载 @@ -27,28 +28,47 @@ Page({ }) } - this.getMaterialBiz() + this.getAppSytactivityTabs() + this.getAppSytactivityList() }, - //cms详细信息 - getMaterialBiz() { - let res = {"code":200,"data":{"user":{"uid":"258","nickname":"老叶","headimg":"https:\/\/thirdwx.qlogo.cn\/mmopen\/vi_32\/Q0j4TwGTfTKe4jENRCNiaqeuxLBdzUCk2BSc3rPC4qABoZicHrrjEjg2ffYA0qeOr93mNcdcxqL2Hibib0Ou35PpZA\/132"},"card":{"id":"3","title":"星选卡","remark":"特权福利享不停","icon":"http:\/\/qs.haodian.cn\/wechat_app\/xingxuanka\/mine\/icon_card-200824.png","cover":"https:\/\/qimg.haodian.cn\/hdi\/2020\/08\/7cc1dbdfc8c028d7\/eed56196042b324d.png","card_id":3},"tip":"会员装修一站式,1对1的消费顾问服务","account":[{"title":"余额","value":"¥0"},{"title":"红包","value":"¥0"},{"title":"额度","value":"最高30万元"}],"icons":[{"id":0,"title":"免费设计","icon":"https:\/\/qs.haodian.cn\/wechat_app\/xingxuanka\/card\/design.png?v=20082615","type":"topic","url":"\/pages\/specialtopic\/mianfeisheji\/index"},{"id":0,"title":"专属顾问","icon":"https:\/\/qs.haodian.cn\/wechat_app\/xingxuanka\/card\/service.png?v=20082615","type":"alert","url":""},{"id":"8","title":"红包权益","icon":"https:\/\/qimg.haodian.cn\/hdi\/2020\/08\/ed48eaab121b8a97\/b48176ea164897ce.png?width=92","type":"right","url":""},{"id":"9","title":"免费量尺","icon":"https:\/\/qimg.haodian.cn\/hdi\/2020\/08\/5d7742c70015717b\/9c0054f73f6a86cf.png?width=92","type":"right","url":""},{"id":"10","title":"媒体监督","icon":"https:\/\/qimg.haodian.cn\/hdi\/2020\/08\/aa63ecd669541f24\/80459c732704caf5.png?width=92","type":"right","url":""},{"id":"11","title":"质保服务","icon":"https:\/\/qimg.haodian.cn\/hdi\/2020\/08\/582e30122b596474\/3e4a8f613c8e38f0.png?width=92","type":"right","url":""},{"id":"12","title":"无忧退款","icon":"https:\/\/qimg.haodian.cn\/hdi\/2020\/08\/55b679a040e8922c\/0a4f057fedf475f9.png?width=92","type":"right","url":""}],"body":{"title":"建材礼金","remark":"不定时福利放送,随购随用","gift":{"id":"7","price":0,"title":"内含超5000元建材抵用券","have":1}}},"msg":""} + //私域通_tab + getAppSytactivityTabs(){ + _.apiQuery.getAppSytactivityTabs().then(res => { + this.setData({ + bg_img:res.data.bg_img, + menus:res.data.menus, + }) + wx.setNavigationBarTitle({ + title:res.data.title, + }) + wx.stopPullDownRefresh() + }); + }, - this.setData({ - icons: this.getIconByGroup(res.data.icons), - }) + //活动列表 + getAppSytactivityList(){ + let params = {}; + params['page'] = 1; + params['size'] = 100; + _.apiQuery.getAppSytactivityList(params).then(res => { + this.setData({ + list: this.getIconByGroup(res.data.list), + }) + wx.stopPullDownRefresh() + }); }, //数据分组 - getIconByGroup(icons) { + getIconByGroup(list) { let arr = [] - if (icons.length > 3) { - for (var i = 0; i < icons.length; i += 3) { - arr.push(icons.slice(i, i + 3)); + if (list.length > 3) { + for (var i = 0; i < list.length; i += 3) { + arr.push(list.slice(i, i + 3)); } } else { - arr.push(icons) + arr.push(list) } return arr }, @@ -81,9 +101,10 @@ Page({ current: 0 }, swiperCurrent: 0, - icons: [], + list: [], }) - this.getMaterialBiz() + this.getAppSytactivityTabs() + this.getAppSytactivityList() }, }) \ No newline at end of file diff --git a/pages/siyutong/index.wxml b/pages/siyutong/index.wxml index 954ec79..23df34b 100644 --- a/pages/siyutong/index.wxml +++ b/pages/siyutong/index.wxml @@ -1,19 +1,13 @@ - + - - 50.32w - 报名 - - - 50.32w - 报名 - - - 50.32w - 报名 - + + + {{item.value}} + {{item.title}} + + @@ -23,13 +17,13 @@ interval="{{swiperOptions.interval}}" duration="{{swiperOptions.duration}}" display-multiple-items="{{swiperOptions.items}}" circular="{{swiperOptions.circular}}" bindchange="swiperChange"> - + - - 东风EX1特约直播!东风EX1特约直播!东风EX1特约直播!东风EX1特约直播! + + {{it.title}} - 进行中 + {{it.type_name}} @@ -37,8 +31,8 @@ - - + +