| | |
| | | require('../../pages/activity-detail/activity-detail?hash=3ff7dd30a3ea0de70909d48b0b8ce5bda62ef62e'); |
| | | require('../../pages/assist-process/assist-process?hash=f1b7dc4ca438ceda80574161c70b1f25cb9fb567'); |
| | | require('../../pages/lucky-coupon/lucky-coupon?hash=f1b7dc4ca438ceda80574161c70b1f25cb9fb567'); |
| | | require('../../pages/msg-record/msg-record?hash=59bab5c4a4a4ec930e168925c97c3057ac83fa7d'); |
| | | require('../../pages/msg-record/msg-record?hash=428ae1fc7930c1018c56f69f43d3453112ebabbd'); |
| | | require('../../pages/assist-friends/assist-friends?hash=59bab5c4a4a4ec930e168925c97c3057ac83fa7d'); |
| | | require('../../pages/msg-setting/msg-setting?hash=5f504890acbcf3bad0486fc198ac7448dd406718'); |
| | | require('../../pages/lucky-record/lucky-record?hash=f1b7dc4ca438ceda80574161c70b1f25cb9fb567'); |
| | |
| | | require('../../pages/activity-detail/activity-detail?hash=3ff7dd30a3ea0de70909d48b0b8ce5bda62ef62e'); |
| | | require('../../pages/assist-process/assist-process?hash=f1b7dc4ca438ceda80574161c70b1f25cb9fb567'); |
| | | require('../../pages/lucky-coupon/lucky-coupon?hash=f1b7dc4ca438ceda80574161c70b1f25cb9fb567'); |
| | | require('../../pages/msg-record/msg-record?hash=59bab5c4a4a4ec930e168925c97c3057ac83fa7d'); |
| | | require('../../pages/msg-record/msg-record?hash=428ae1fc7930c1018c56f69f43d3453112ebabbd'); |
| | | require('../../pages/assist-friends/assist-friends?hash=59bab5c4a4a4ec930e168925c97c3057ac83fa7d'); |
| | | require('../../pages/msg-setting/msg-setting?hash=5f504890acbcf3bad0486fc198ac7448dd406718'); |
| | | require('../../pages/lucky-record/lucky-record?hash=f1b7dc4ca438ceda80574161c70b1f25cb9fb567'); |
| | |
| | | var help = require('/util/help.js'); |
| | | var api = require('./util/api.js'); |
| | | const user = require('./util/user.js'); |
| | | var $this; |
| | | App({ |
| | | themeColor: "#0080FF", |
| | | appKey: '1000001', |
| | |
| | | logined: false, |
| | | baseUrl: 'http://192.168.3.122:8083', |
| | | onLaunch(options) { |
| | | |
| | | $this = this; |
| | | // 第一次打开 |
| | | // options.query == {number:1} |
| | | console.info('App onLaunch'); |
| | | my.hideFavoriteMenu(); |
| | | |
| | | |
| | | api.getConfig({ |
| | | success: function (res) { |
| | | if (res.code == 0) { |
| | | |
| | | $this.shareInfo = res.data.shareInfo; |
| | | //保存参数 |
| | | help.cacheConfig(res.data); |
| | | } |
| | |
| | | |
| | | //全局分享函数 |
| | | onShareAppMessage(obj) { |
| | | |
| | | |
| | | return $this.shareInfo; |
| | | }, |
| | | |
| | | onShow(options) { |
| | |
| | | </view> |
| | | </view> |
| | | <view style="display:flex; justify-content: space-between;margin:60rpx 0 40rpx 0;"> |
| | | <button type="ghost" open-type="{{!logined?'getAuthorize':'share'}}" onGetAuthorize="onGetAuthorize" onError="onAuthError" scope='userInfo' hover-class="btn-ghost-hover" onTap="onAssistClick" style="width:238rpx;"> |
| | | <button type="ghost" open-type="{{!logined?'getAuthorize':'share'}}" onGetAuthorize="onGetAuthorize" onError="onAuthError" scope='userInfo' hover-class="btn-ghost-hover" style="width:238rpx;"> |
| | | 好友助力 |
| | | </button> |
| | | <button a:if="{{!logined}}" open-type="getAuthorize" onGetAuthorize="onGetAuthorize" onError="onAuthError" scope='userInfo' type="primary" class="btn-primary" hover-class="btn-primary-hover" style="width:392rpx;"> |
| | |
| | | </view> |
| | | </view> |
| | | </modal> |
| | | |
| | | <modal show="{{showDrawnModal}}" zIndex="100" onModalClose="onCloseDialog1" class="dialog" advice="{{true}}"> |
| | | <view > |
| | | <image class="title" mode="scaleToFill" src="/image/reward_dialog_title.png"/> |
| | | <view class="content"> |
| | | <view style="font-size:24rpx;"> |
| | | {{award.title}} |
| | | </view> |
| | | <image class="icon" src="/image/reward_dialog_icon.png"/> |
| | | <view style="font-size:30rpx;margin-top:10rpx;"> |
| | | {{award.award.title}} |
| | | </view> |
| | | <view class="btn" onTap="onRecieveAward"> |
| | | 领 |
| | | </view> |
| | | <view style="font-size:18rpx;margin-top:32rpx;"> |
| | | {{award.desc}} |
| | | </view> |
| | | </view> |
| | | </view> |
| | | </modal> |
| | | <modal show="{{showOutDateModal}}" zIndex="100" onModalClose="onCloseDialog2" class="dialog-outdate" advice="{{true}}"> |
| | | <view > |
| | | <image class="title" mode="scaleToFill" src="/image/reward_outdate_dialog_title.png"/> |
| | | <view class="content"> |
| | | <view style="font-size:24rpx;"> |
| | | {{award.title}} |
| | | </view> |
| | | <image class="icon" src="/image/reward_outdate_dialog_icon.png"/> |
| | | <view class="reward"> |
| | | <image mode="scaleToFill" src="{{award.award.typeIcon}}"/> |
| | | <text number-of-lines="2"> {{award.award.title}}</text> |
| | | </view> |
| | | <view class="btn" onTap="onOutDateDetailClick"> |
| | | 查看详情 |
| | | </view> |
| | | <view style="font-size:18rpx;margin-top:40rpx;line-height:28rpx;"> |
| | | {{award.desc}} |
| | | </view> |
| | | </view> |
| | | </view> |
| | | </modal> |
| | | </view> |
| | |
| | | mm: "00", |
| | | ss: "00" |
| | | }, |
| | | |
| | | leftTimeMS: 0, |
| | | checkFollow: false, |
| | | showFollow: false, |
| | |
| | | //参与条件查看更多 |
| | | joinShowMore: true, |
| | | |
| | | //中奖弹框 |
| | | showDrawnModal:false, |
| | | |
| | | //过期未领弹框 |
| | | showOutDateModal:false, |
| | | |
| | | //开奖条件查看更多 |
| | | openShowMore: true, |
| | | //奖品列表最大数量 |
| | |
| | | drawnAnouncementDesc: [], |
| | | }, |
| | | |
| | | onShareAppMessage() { |
| | | onShareAppMessage(obj) { |
| | | console.log('onShareAppMessage'); |
| | | var shareData = $this.data.activity.shareInfo; |
| | | return shareData; |
| | | if (obj.from == 'menu') {//菜单分享 |
| | | var shareData = $this.data.activity.shareInfo; |
| | | return shareData; |
| | | } else {//助力 |
| | | var shareData = $this.data.activity.assistShareInfo; |
| | | return shareData; |
| | | } |
| | | |
| | | }, |
| | | onLoad(query) { |
| | | $this = this; |
| | |
| | | help.setPageNavBar("抽奖详情"); |
| | | $this.setData({ |
| | | joinInfo: query.joinInfo, |
| | | logined:getApp().logined |
| | | logined: getApp().logined |
| | | }); |
| | | $this.refreshDetailInfo(query.id); |
| | | }, |
| | | |
| | | refreshDetailInfo(id) { |
| | | |
| | | if (id == null) { |
| | | id = $this.data.activity.activity.id; |
| | | } |
| | | |
| | | api.getActivityDetail({ |
| | | showErrorToast: true, |
| | | showLoading: true, |
| | | id: query.id, |
| | | id: id, |
| | | success: function (res) { |
| | | if (res.code != 0) { |
| | | return; |
| | |
| | | }); |
| | | } |
| | | |
| | | |
| | | //首次请求需要获取中奖结果 |
| | | if (!$this.data.activity) { |
| | | $this.requestRecieveAwardNotify(id); |
| | | } |
| | | |
| | | $this.setData({ |
| | | activity: data |
| | |
| | | my.showToast({ |
| | | content: '登录成功' |
| | | }) |
| | | $this.refreshDetailInfo(null); |
| | | }, fail(e) { |
| | | my.showToast({ |
| | | content: '登录失败' |
| | |
| | | content: '授权失败' |
| | | }); |
| | | }, |
| | | |
| | | |
| | | closeMianZeModal() { |
| | | this.setData({ |
| | | showMianZeModal: false |
| | |
| | | activity: activity |
| | | }); |
| | | |
| | | $this.refreshDetailInfo(null); |
| | | } |
| | | } |
| | | }) |
| | |
| | | }, |
| | | }); |
| | | |
| | | } |
| | | }, |
| | | //获取奖项通知 |
| | | requestRecieveAwardNotify() { |
| | | api.getRecieveAwardNotify({ |
| | | success: function (res) { |
| | | if (res.code == 0) { |
| | | if (res.data.type == 1)//领奖 |
| | | { |
| | | $this.setData({ |
| | | award: res.data, |
| | | showDrawnModal: true |
| | | }); |
| | | } else if (res.data.type == 2)//过期 |
| | | { |
| | | $this.setData({ |
| | | award: res.data, |
| | | showOutDateModal: true |
| | | }); |
| | | } |
| | | } |
| | | } |
| | | }); |
| | | }, |
| | | //领奖 |
| | | onRecieveAward() { |
| | | api.recieveAward({ |
| | | showLoading: true, |
| | | showErrorToast: true, |
| | | activityId: $this.data.award.activityId, |
| | | success: function (res) { |
| | | if (res.code == 0) { |
| | | my.showToast({ |
| | | content: res.msg |
| | | }); |
| | | } else { |
| | | my.showToast({ |
| | | content: res.msg |
| | | }); |
| | | } |
| | | } |
| | | |
| | | }); |
| | | }, |
| | | onOutDateDetailClick() { |
| | | api.setDrawnNotifyRead({ |
| | | id: $this.data.award.id, |
| | | success: function (res) { |
| | | |
| | | } |
| | | }); |
| | | }, |
| | | |
| | | |
| | | |
| | |
| | | <view class="page"> |
| | | <!-- <bc-module a:if="{{ showComponent }}" code="suite://bc.suite.choiceness/bc.template.choiceness" name="block-choiceness" onError="bcError" ext="{{pluginOptions: {pageSize:20,relationId:'123123'}}}" /> --> |
| | | <bc-module a:if="{{ showComponent }}" code="suite://bc.suite.etaoMarketing/bc.template.rebate.search" name="block-etao-searchbox" onError="bcError" /> |
| | | <bc-module a:if="{{ showComponent }}" code="suite://bc.suite.materiel/bc.template.materiel" name="block-materiel" onError="bcError" ext="{{ pluginOptions: pluginOptions, loadMoreTime }}"/> |
| | | </view> |
| | |
| | | import { loadBC } from 'miniapp-bc-user' |
| | | Page({ |
| | | data: {}, |
| | | data: { |
| | | pluginOptions: { |
| | | relationId: '513796574' // 如果插件有 pluginOptions |
| | | } |
| | | }, |
| | | onLoad() { }, |
| | | async onReady() { |
| | | try { |
| | | await loadBC(); |
| | | this.setData({ showComponent: true }) |
| | | } catch (e) { |
| | | } catch (e) { |
| | | console.log(e); |
| | | } |
| | | }, |
| | |
| | | // 每日精选插件 |
| | | // 监听页面滚动到底部,加载更多 |
| | | onReachBottom() { |
| | | console.log("到达底部"); |
| | | this.setData({ |
| | | loadMoreTime: (this.data.loadMoreTime || 0) + 1 |
| | | }) |
| | |
| | | <view class="title"> |
| | | {{content.title}} |
| | | </view> |
| | | <rich-text class="content" nodes=" {{item.content}}" onTap="tap"></rich-text> |
| | | <rich-text class="content" nodes=" {{content.content}}" onTap="tap"></rich-text> |
| | | </flex> |
| | | </view> |
| | | </view> |
| | |
| | | onLoad() { |
| | | help.setPageNavBar("消息记录"); |
| | | $this = this; |
| | | this.requestUserMsgList(1, true); |
| | | }, |
| | | onPullDownRefresh() { |
| | | console.log('onPullDownRefresh', new Date()); |
| | |
| | | convertToRichText(list, callback) { |
| | | for (var i = 0; i < list.length; i++) { |
| | | for (var j = 0; j < list[i].contentList.length; j++) { |
| | | help.loadRichTextNode(list[i].contentList[j].content, function (res) { |
| | | help.loadRichTextNode(list[i].contentList[j].content.replace('#theme',getApp().themeColor), function (res) { |
| | | list[i].contentList[j].content = res; |
| | | if (i == list.length - 1 && j == list[i].contentList.length) { |
| | | if (i == list.length - 1 && j == list[i].contentList.length-1) { |
| | | callback(list); |
| | | } |
| | | }); |
| | |
| | | console.log(res) |
| | | if (res.code == 0) { |
| | | var list = res.data.data; |
| | | console.log("数据:"+ list.length); |
| | | //数据预处理 |
| | | $this.convertToRichText(list, function (list) { |
| | | console.log("富文本转换完成") |
| | | //设置列表数据 |
| | | if (list != null && list.length > 0) { |
| | | var totalList = $this.data.list.concat(list); |
| | |
| | | { |
| | | "usingComponents": { |
| | | "flex": "mini-ali-ui/es/flex/index", |
| | | "flex-item": "mini-ali-ui/es/flex/flex-item/index" |
| | | "flex-item": "mini-ali-ui/es/flex/flex-item/index", |
| | | "footer": "mini-ali-ui/es/footer/index" |
| | | } |
| | | } |
| | |
| | | <image class="title" mode="scaleToFill" src="/image/reward_dialog_title.png"/> |
| | | <view class="content"> |
| | | <view style="font-size:24rpx;"> |
| | | 活动期号:NO.12378947 |
| | | {{award.title}} |
| | | </view> |
| | | <image class="icon" src="/image/reward_dialog_icon.png"/> |
| | | <view style="font-size:30rpx;margin-top:10rpx;"> |
| | | 大额现金红包100 |
| | | {{award.award.title}} |
| | | </view> |
| | | <view class="btn" onTap="onRecieveAward"> |
| | | 领 |
| | | </view> |
| | | <view style="font-size:18rpx;margin-top:32rpx;"> |
| | | 未领取,可在"我的-全部抽奖"中查看 |
| | | {{award.desc}} |
| | | </view> |
| | | </view> |
| | | </view> |
| | |
| | | <image class="title" mode="scaleToFill" src="/image/reward_outdate_dialog_title.png"/> |
| | | <view class="content"> |
| | | <view style="font-size:24rpx;"> |
| | | 活动期号:NO.12378947 |
| | | {{award.title}} |
| | | </view> |
| | | <image class="icon" src="/image/reward_outdate_dialog_icon.png"/> |
| | | <view class="reward"> |
| | | <image mode="scaleToFill" src="/image/portrait-test.jpg"/> |
| | | <text number-of-lines="2">大额现金红包大额现金红包大额现红包10000</text> |
| | | <image mode="scaleToFill" src="{{award.award.typeIcon}}"/> |
| | | <text number-of-lines="2"> {{award.award.title}}</text> |
| | | </view> |
| | | <view class="btn" onTap="onDetail"> |
| | | <view class="btn" onTap="onOutDateDetailClick"> |
| | | 查看详情 |
| | | </view> |
| | | <view style="font-size:18rpx;margin-top:40rpx;line-height:28rpx;"> |
| | | 注:中奖日起7天内未领取奖品,将会把对应奖品原路退回赞助商,切记中奖后按时领取奖品。 |
| | | {{award.desc}} |
| | | </view> |
| | | </view> |
| | | </view> |
| | |
| | | $this = this; |
| | | $this.requestNotice(); |
| | | $this.requestActivity(1, true); |
| | | //延时请求 |
| | | setTimeout(() => { |
| | | $this.requestRecieveAwardNotify(); |
| | | }, 1000); |
| | | |
| | | }, |
| | | |
| | | //请求活动 |
| | | requestActivity(page, first) { |
| | | $this.setData({ |
| | |
| | | $this.setData({ |
| | | notice: res.data, |
| | | showNotice: true, |
| | | noticeMode: res.data.link?'link':'closable' |
| | | noticeMode: res.data.link ? 'link' : 'closable' |
| | | }) |
| | | } |
| | | } |
| | | }); |
| | | |
| | | }, |
| | | //获取奖项通知 |
| | | requestRecieveAwardNotify() { |
| | | api.getRecieveAwardNotify({ |
| | | success: function (res) { |
| | | if (res.code == 0) { |
| | | if (res.data.type == 1)//领奖 |
| | | { |
| | | $this.setData({ |
| | | award: res.data, |
| | | showDrawnModal: true |
| | | }); |
| | | } else if (res.data.type == 2)//过期 |
| | | { |
| | | $this.setData({ |
| | | award: res.data, |
| | | showOutDateModal: true |
| | | }); |
| | | } |
| | | |
| | | } |
| | | } |
| | | }); |
| | | }, |
| | | //领奖 |
| | | onRecieveAward() { |
| | | api.recieveAward({ |
| | | showLoading: true, |
| | | showErrorToast: true, |
| | | activityId: $this.data.award.activityId, |
| | | success: function (res) { |
| | | if (res.code == 0) { |
| | | my.showToast({ |
| | | content: res.msg |
| | | }); |
| | | } else { |
| | | my.showToast({ |
| | | content: res.msg |
| | | }); |
| | | } |
| | | } |
| | | |
| | | }); |
| | | }, |
| | | onOutDateDetailClick() { |
| | | api.setDrawnNotifyRead({ |
| | | id: $this.data.award.id, |
| | | success: function (res) { |
| | | |
| | | } |
| | | }); |
| | | }, |
| | | |
| | | //下拉刷新 |
| | | onPullDownRefresh() { |
| | | this.requestActivity(1, false); |
| | |
| | | showOutDateModal: false |
| | | }); |
| | | }, |
| | | onRecieveAward() { |
| | | my.showToast({ |
| | | content: "领奖" |
| | | }); |
| | | |
| | | }, |
| | | |
| | | |
| | | |
| | | onNoticeClick() { |
| | | |
| | | if (this.data.noticeMode == 'closable') { |
| | |
| | | getRecommendActivity(obj) { |
| | | this.commonRequest("/api/client/activity/getRecommendActivity", obj); |
| | | }, |
| | | |
| | | /** |
| | | * 获取未显示的领奖通知 |
| | | * @param {*} obj |
| | | */ |
| | | getRecieveAwardNotify(obj) { |
| | | if (obj.activityId) { |
| | | obj.data = { activityId: obj.activityId }; |
| | | } |
| | | this.commonRequest("/api/client/activity/awards/getRecieveAwardNotify", obj); |
| | | }, |
| | | |
| | | setDrawnNotifyRead(obj) { |
| | | obj.id = { id: obj.id }; |
| | | this.commonRequest("/api/client/activity/awards/setDrawnNotifyRead", obj); |
| | | }, |
| | | |
| | | |
| | | /** |
| | | * 领取奖励 |
| | | * @param {*} obj |
| | | */ |
| | | recieveAward(obj) { |
| | | this.commonRequest("/api/client/activity/awards/recieveAward", obj); |
| | | }, |
| | | |
| | | /** |
| | | * 获取活动详情 |
| | | * @param {*} obj |