作者 郑喜程

增加明码扫码业务、福利页面、不同金额奖卷弹窗。

... ... @@ -13,8 +13,8 @@
],
"subPackages": [{
"root": "scanGroup",
"pages": ["index/index", "dahaoda/index/index", "dahaoda/record/index", "jyScan/index/index",
"jyScan/record/index"
"pages": ["index/index", "dahaoda/index/index", "dahaoda/record/index", "jyScan/index/index", "jyScan/welfare/index",
"jyScan/record/index","jyScan/openCodeLottery/index"
]
},
{
... ...
... ... @@ -86,7 +86,21 @@ Page({
url: `/middlePage/pages/privacyGps/privacyGps`,
})
},
goOpenCode(){
if(getApp().globalData.userInfo?.token || app.utils.getToken()){
wx.navigateTo({
url: `/scanGroup/jyScan/openCodeLottery/index`,
})
}
else{
// wx.navigateTo({
// url: `/scanGroup/jyScan/openCodeLottery/index`,
// })
app.utils.needLogin('scan')
}
},
/**
* 生命周期函数--监听页面隐藏
*/
... ...
... ... @@ -15,6 +15,10 @@
<view class="mt_down">活动</view>
<view>规则</view>
</view> -->
<view class="fixed_btn btn_1" bindtap="goOpenCode">
<view class="mt_down">明码</view>
<view>开奖</view>
</view>
<!-- 二维码本地文件地址:junyao-miniprogram-master\images\erweima\erweima.jpg -->
<view class="saoyisao">开发时先拿个任意的二维码扫</view>
<!-- 二维码本地文件地址:junyao-miniprogram-master\images\erweima\erweima.jpg -->
... ...
... ... @@ -130,73 +130,19 @@ Page({
app.getCode()
const memberInfo = await app.getUserInfo()
if (this.type === 'scan') {
app.updateUserInfoScan(app.globalData.code, memberInfo).then(res => {
wx.hideLoading()
// wx.reLaunch({
// url: this.myrouter ? decodeURIComponent(this.myrouter) : '/pages/index/index'
// })
wx.reLaunch({
url: this.myrouter ? decodeURIComponent(this.myrouter) :
'/custom-pages/custom-index/index'
})
})
this.login()
// app.updateUserInfoScan(app.globalData.code, memberInfo).then(res => {
// wx.hideLoading()
// // wx.reLaunch({
// // url: this.myrouter ? decodeURIComponent(this.myrouter) : '/pages/index/index'
// // })
// wx.reLaunch({
// url: this.myrouter ? decodeURIComponent(this.myrouter) :
// '/custom-pages/custom-index/index'
// })
// })
} else {
const apiBase = config.dataServer
wx.login({
success: (res) => {
if (res.code) {
// 用户登录
wx.request({
url: apiBase + "/auth/mp/login",
header: {},
method: "GET",
data: {
appId: "wx43fc214041ea41da", //wxff6674eabc54fc28 wx0f695ef70a18d602 wx43fc214041ea41da
code: res.code,
source: "0"
},
timeout: 30 * 1000,
success: (res) => {
if(res.data?.token){
let userInfo = {
...(getApp().globalData.userInfo || {}),
...res.data
}
getApp().globalData.userInfo = userInfo
// console.log(getApp().globalData.userInfo, "userInfo1",userInfo);
}
wx.hideLoading()
// wx.reLaunch({
// url: this.myrouter ? decodeURIComponent(this.myrouter) : '/pages/index/index'
// })
wx.reLaunch({
url: this.myrouter ? decodeURIComponent(
this.myrouter) :
'/custom-pages/custom-index/index'
})
},
fail: (res) => {
console.log(res)
// const msg = await getErrortxt()
// wx.showModal({
// title: '提示',
// content: msg,
// showCancel: false,
// confirmText: '知道了',
// confirmColor: '#fe8600'
// })
},
complete: () => {
// wx.hideNavigationBarLoading()
// if (showLoading) {
// wx.hideLoading()
// }
}
})
}
}
})
this.login()
// app.updateUserInfo(app.globalData.code, memberInfo).then(res => {
// console.log(res,"res");
// wx.hideLoading()
... ... @@ -209,6 +155,63 @@ Page({
// })
}
},
login(){
const apiBase = config.dataServer
wx.login({
success: (res) => {
if (res.code) {
// 用户登录
wx.request({
url: apiBase + "/auth/mp/login",
header: {},
method: "GET",
data: {
appId: "wx43fc214041ea41da", //wxff6674eabc54fc28 wx0f695ef70a18d602 wx43fc214041ea41da
code: res.code,
source: "0"
},
timeout: 30 * 1000,
success: (res) => {
if(res.data?.token){
let userInfo = {
...(getApp().globalData.userInfo || {}),
...res.data
}
getApp().globalData.userInfo = userInfo
// console.log(getApp().globalData.userInfo, "userInfo1",userInfo);
}
wx.hideLoading()
// wx.reLaunch({
// url: this.myrouter ? decodeURIComponent(this.myrouter) : '/pages/index/index'
// })
wx.reLaunch({
url: this.myrouter ? decodeURIComponent(
this.myrouter) :
'/custom-pages/custom-index/index'
})
},
fail: (res) => {
console.log(res)
// const msg = await getErrortxt()
// wx.showModal({
// title: '提示',
// content: msg,
// showCancel: false,
// confirmText: '知道了',
// confirmColor: '#fe8600'
// })
},
complete: () => {
// wx.hideNavigationBarLoading()
// if (showLoading) {
// wx.hideLoading()
// }
}
})
}
}
})
},
// getUserProfile() {
// // 推荐使用wx.getUserProfile获取用户信息,开发者每次通过该接口获取用户个人信息均需用户确认
// // 开发者妥善保管用户快速填写的头像昵称,避免重复弹窗
... ...
... ... @@ -38,7 +38,10 @@ Page({
excitationRedPack: false, //激励红包
groupRule: '<p style="text-align:center;">\n\t消费者声明及活动详细规则\n</p>\n<p>\n\t请在参与本活动前仔细阅读本活动的各项条款,如果您参加了本活动,则活动主办方认为您已充分理解并同意该规则中的各条款:\n</p>\n<ol>\n\t<li>\n\t\t活动主办方及其联系方式:\n\t</li>\n</ol>\n<p style="text-indent:24px;">\n\t均瑶集团上海食品有限公司(以下简称“主办方”)\n</p>\n<p style="text-indent:24px;">\n\t联系电话:021-60251969(话费自理,工作日:9:00-12:00,13:30-18:00)\n</p>\n<ol>\n\t<li>\n\t\t活动期间及兑奖时间:\n\t</li>\n</ol>\n<p style="text-indent:24px;">\n\t即日起至2026年4月30日23:59:59截止。\n</p>\n<p style="text-indent:24px;">\n\t为充分保障中奖者权益,兑奖时间为即日起至2026年5月1日23:59:59截止,逾期视为自动放弃兑奖。\n</p>\n<ol>\n\t<li>\n\t\t活动区域:\n\t</li>\n</ol>\n<p style="text-indent:24px;">\n\t仅限中国大陆地区(不含港、澳、台)\n</p>\n<ol>\n\t<li>\n\t\t活动参与条件及参与方式:\n\t</li>\n</ol>\n<p style="text-indent:28px;">\n\t即日起,凡购买“扫码赢红包”味动力AD钙奶饮品(2个口味),揭开活动产品包装上活动标签(因其包装设计二维码于瓶盖内,故为揭开瓶盖,敬请谅解),微信扫描其内二维码,进入活动小程序,根据提示完成授权或登陆即可参与活动。参与活动的消费者有机会赢取666元微信红包一份、1.8元微信红包一份或0.6元微信红包一份;同时,还有机会获得复购奖励“1.8元复购红包”,获得复购奖励后再买一瓶活动产品并扫描再次购买的活动产品瓶盖内二维码后即可解锁领取1.8元现金红包,复购奖励数量有限,发完即止。\n</p>\n<ol>\n\t<li>\n\t\t开奖方式与开奖时间:\n\t</li>\n</ol>\n<p>\n\t&nbsp;&nbsp;&nbsp;&nbsp;参与活动后,根据微信平台活动小程序页面提示,手机扫码即时开奖,若显示中奖,则线上即时领取红包即可。\n</p>\n<ol>\n\t<li>\n\t\t奖项种类设置:\n\t</li>\n</ol>\n<p style="text-indent:24px;">\n\t本活动奖项种类分为常规抽奖与复购奖励。\n</p>\n<ol>\n\t<li>\n\t\t其中常规抽奖设立奖品价格、奖品品名、奖品种类、奖品数量及中奖概率如下:\n\t</li>\n</ol>\n<p style="text-indent:24px;">\n\t一等奖:666元微信现金红包一份,价值人民币六百六十六元,本活动共设18份;中奖概率约为0.0039%\n</p>\n<p style="text-indent:24px;">\n\t二等奖:1.8元微信现金红包一份,价值人民币一元八角,本活动共设6,000份;中奖概率约为1.33%\n</p>\n<p style="text-indent:24px;">\n\t三等奖:0.6元微信现金红包一份,价值人民币八角,本活动共设80,000份;中奖概率约为17.78%\n</p>\n<p style="text-indent:24px;">\n\t其余未中奖将出现“谢谢惠顾”字样。\n</p>\n<p style="text-indent:24px;">\n\t*各奖项中奖率无法整除,谨请谅解。\n</p>\n<ol>\n\t<li>\n\t\t复购奖励设立奖品价格、奖品品名、奖品种类、奖品数量如下:\n\t</li>\n</ol>\n<p style="text-indent:24px;">\n\t复购奖励:人民币1.8元微信现金红包一份,价值人民币壹元捌角,共30,000份,数量有限,先到先得,发完即止。\n</p>\n<ol>\n\t<li>\n\t\t兑奖条件、兑奖方式及奖品交付方式:\n\t</li>\n</ol>\n<p style="text-indent:24px;">\n\t微信扫描活动产品包装上活动标签后,按手机页面提示操作进行兑奖。\n</p>\n<ol>\n\t<li>\n\t\t常规抽奖兑换方式、兑奖方式及奖品交付方式如下:\n\t</li>\n</ol>\n<ol>\n\t<li>\n\t\t如若抽中一等奖666元,需要完善中奖者姓名、身份证、手机号信息并确认提交即可兑奖。提请注意:因微信平台对商家转账到零钱的单笔提现金额上限至200元,即该奖项到账微信钱包时会自动拆分成4笔同时到中奖者微信账户余额;\n\t</li>\n\t<li>\n\t\t如若抽中二等奖1.8元/三等奖0.8元,点击领取即可兑奖,不需要完善中奖者信息;所得现金红包将存入本人微信账户,可在历史中奖记录中查看。\n\t</li>\n</ol>\n<ol>\n\t<li>\n\t\t复购奖励兑换方式、兑奖方式及奖品交付方式如下:\n\t</li>\n</ol>\n<p>\n\t&nbsp;&nbsp;&nbsp;&nbsp;如若抽中复购奖励,复购奖励中奖者再买一瓶活动产品并点击活动页面中的“扫码激活”扫描再次购买的活动产品瓶盖内二维码后点击领取即可兑奖,不需要完善中奖者信息;所得现金红包将自动存入本人微信账户,可在历史中奖记录中查看。\n</p>\n<p style="text-indent:24px;">\n\t红包提现需遵守腾讯公司微信红包提现规则,由系统自动发放,转账延时属正常情况。本次活动所产生的个人所得税由均瑶集团上海食品有限公司依法代扣代缴,现金红包均为税后所得。\n</p>\n<ol>\n\t<li>\n\t\t活动声明、弃奖条件及注意事项:\n\t</li>\n</ol>\n<ol>\n\t<li>\n\t\t均瑶集团上海食品有限公司对活动产品真实性及有效性具有鉴定及确认权。\n\t</li>\n\t<li>\n\t\t本次活动产品总计投入2,250,000份,每个活动产品二维码只可参与一次抽奖活动,重复扫码无效。\n\t</li>\n\t<li>\n\t\t为保证活动参与体验,主办方将检测活动消费者所提交的相关数据以确保真实性。若检测出消费者有恶意或者虚假刷单行为,主办方有权取消其参加本次活动资格。提请注意:每个微信OpenID活动期间日参与次数限6次,超过参与次数后限制参与,并提示微信号参与已达日上限。消费者可以次日零点后再扫码参与。\n\t</li>\n\t<li>\n\t\t现金红包须在兑奖截止日期前(如需完善相关信息应当在兑换有效期内完善并正确)完成兑奖,过期视为弃奖,主办方不予补发。\n\t</li>\n\t<li>\n\t\t复购奖励中奖者,若未在中奖后72小时内再次购买活动产品并扫描再次购买的活动产品瓶盖内二维码的,视为弃奖。\n\t</li>\n\t<li>\n\t\t消费者应当在活动期间内参与活动并在兑奖期间内完成兑奖,否则视为弃奖。\n\t</li>\n\t<li>\n\t\t活动主办方不对因网络传输原因而导致消费者提交的信息错误或延误承担任何责任。\n\t</li>\n\t<li>\n\t\t消费者领奖过程中所发生的个人费用(包含但不限于上网费、手机流量费、短信费、咨询客服电话费)需自理,主办方不做任何形式的补偿。本活动对象为以消费为目的的消费者,禁止非真实活动参与者的刷单行为,活动参与者不遵守活动规则的,主办方有权根据法律法规及活动规则不予兑换/追回已兑换活动奖品,并且主办方保留追究无参与资格者一切法律责任的权力。\n\t</li>\n\t<li>\n\t\t若因消费者个人原因造成账号、密码遗失,并导致参与活动兑奖的消费者无法提交个人信息的情况,活动主办方不承担责任。\n\t</li>\n\t<li>\n\t\t如发现消费者恶意刷奖行为,包括但不限于:入侵本次活动所使用的网络服务器、使用技术手段获取活动后台信息或篡改活动后台中奖规则、参与记录不符合活动的最低参与要求、盗用他人信息参与活动、冒充他人获得红包等不正当行为,主办方有权取消其活动参与权和收回其所得红包。同时保留依法追究其法律责任的权利。\n\t</li>\n\t<li>\n\t\t活动过程中出现“不可抗力”事件或计算机系统故障直接或间接地造成活动主办方无法履行其全部或部分义务,则活动主办方将免予履行该义务,并无需承担相应的责任。“不可抗力”事件包括但不限于,地震、台风、火灾、水灾、战争、法律法规调整、政府命令禁止、因黑客攻击、计算机病毒影响、系统崩溃、数据丢失或其他人为原因造成计算机系统故障,及其他自然或人为灾害等导致活动无法继续开展的,且活动主办方不可预见、无法避免并无法控制的事件。\n\t</li>\n\t<li>\n\t\t活动过程中,如因政府法律法规调整或行政命令要求,活动主办方有权根据上述调整或要求随时调整活动内容及规则。活动内容及规则调整时,活动主办方将另行向活动参与者公告通知相关的调整,但无需征得活动参与者的同意。主办方有权根据法律法规、司法或行政命令的要求以及活动的实际情况,在法律允许的范围内随时取消、中止或终止此次活动。\n\t</li>\n\t<li>\n\t\t本次活动奖品所涉之相关服务由第三方服务提供商提供,使用服务的相关限制及注意事项以具体服务提供商的要求为准。对于消费者在领取和使用奖品过程中发生的任何伤害和损失,如该伤害和损失非由主办方之过错导致,主办方不承担任何责任。\n\t</li>\n\t<li>\n\t\t消费者需就因其违反本条款及细则的任何规定、侵犯他人权利或其他任何违法的行为而引起的所有索偿、责任、损失、损害、费用和开支对主办方做出补偿。\n\t</li>\n\t<li>\n\t\t本活动适用中华人民共和国法律。因本活动引起的或本活动有关的任何争议,由争议双方友好协商解决。如任何争议不能通过双方友好协商解决的,可通过其他有效法律途径征求最终解决方式。\n\t</li>\n\t<li>\n\t\t活动主办方、本促销活动的代理公司、广告公司、印刷商和相关合作企业之员工、家属,不可参加此次促销活动,&nbsp;以示公允。\n\t</li>\n\t<li>\n\t\t个人信息:\n\t</li>\n</ol>\n<ol>\n\t<li>\n\t\t用户向活动主办方提供的个人微信资料数据只会用作本次活动用途,及会被保密处理。\n\t</li>\n\t<li>\n\t\t用户必须授权使用个人微信账号登陆进行互动;若未能及时提供,将不能参加本次活动。\n\t</li>\n\t<li>\n\t\t用户进入本活动时,需要点击同意并授权个人的基本资料给活动主办方使用。本活动将通过微信收集用户基本信息,包括:微信信息资料。以上信息将被主办方委托的第三方用于本活动的奖品派发、活动数据分析等。活动主办方将采取适当的规范手段以保护个人信息安全,防止资料丢失、被盗用或遭篡改。\n\t</li>\n\t<li>\n\t\t用户在使用互联网时对个人信息的运用需进行监管和负责,如有通过公告版等形式自愿提供及公开的个人资料被他人使用或传播,与本活动无关。\n\t</li>\n\t<li>\n\t\t如用户本人主动将微信账号与密码共享,或因各种不可抗力因素所导致的个人资料泄露、丢失、被盗用或被篡改,主办方不承担任何责任。\n\t</li>\n\t<li>\n\t\t如经得用户同意,主办方可使用有关个人资料数据作直接商品促销用途;否则,主办方将不能使用其个人资料作前述直接促销用途。用户须确保所提供的个人资料属实及有效。\n\t</li>\n</ol>',
locate: '',
received: false
received: false,
showWelfare: false,
juanSrc: "",
showjuan: false,
},
/**
... ... @@ -51,7 +54,10 @@ Page({
locate: res
})
})
const pageData = JSON.parse(decodeURIComponent(options.pageData))
let pageData = {}
if(options?.pageData){
pageData = JSON.parse(decodeURIComponent(options?.pageData))
}
let userId = wx.getStorageSync('nick')?.userId
if (!userId) {
// userId = getApp().globalData.userInfo?.openId
... ... @@ -60,10 +66,28 @@ Page({
userId,
pageData
})
console.log(pageData, 'pageData', userId, 'userId');
this.getPromotion(pageData) //junyao 查询二维码信息和活动信息
console.log(pageData, 'pageData11111', userId, 'userId');
if(options.tag){
console.log(options.tag,"options.tag");
//明码抽奖
let {code,uri} = app.utils.getCodeAndUri(options.tag)
console.log(code,uri,"code,uri");
let pageData ={
...pageData,
qrCode:code,
qrUri:uri
}
this.setData({
pageData
})
this.doActivity()
}
else{
console.log(pageData,111111);
this.getPromotion(pageData) //junyao 查询二维码信息和活动信息
}
// this.getMarquee()
} else if (!app.utils.getToken()) {
} else {
app.utils.needLogin()
}
// if (!app.utils.getToken()) {
... ... @@ -114,7 +138,7 @@ Page({
timeout: 30 * 1000,
success: (res) => {
//拟写
let type = res.type
let type = res.type
type = "3"
switch (type) {
case '1':
... ... @@ -213,15 +237,17 @@ Page({
wx.openSetting({})
},
async doActivity() {
console.log(this.data.pageData,"this.data.pageData");
await this.getLocation().then(res => {
this.setData({
locate: res
})
})
const apiBase = config.dataServer
// 抽奖
console.log(this.data.locate,"this.data.locate");
// 抽奖/明码进来自动抽奖
wx.request({
url: apiBase + "/lottery/v2/tag?longitude=&latitude=",
url: apiBase + `/lottery/v2/tag?longitude=${this.data.locate.split(",")[0]}&latitude=${this.data.locate.split(",")[1]}`,
header: {
'Authorization': `Bearer ${getApp().globalData.userInfo?.token}`,
'serialId': getApp().userInfo?.serialId
... ... @@ -239,29 +265,49 @@ Page({
timeout: 30 * 1000,
success: (res) => {
console.log(res, "res"); //抽奖后返回的结果 新接口
//弹出中奖结果
//1.showRedPack
this.setData({
scanRewardVO: (res.data?.prizes && res.data?.prizes[0]) || {
amount: 1
},
showRedPack: true,
excitationRedPack: true
})
//2.完善个人信息
// this.setData({
// showCouponComMess: true,
// isOneReward:true //手机授权/填写身份信息
// })
// 3.receiveVis
// this.setData({
// receiveVis: true,
// isNoAward:true // 获奖/谢谢参与
// })
// 4.领取成功,继续扫码
// this.setData({
// showSecondRedPack: true,
// })
let type = "5"
switch (type) {
//弹出中奖结果
case "1":
//showRedPack
this.setData({
scanRewardVO: (res.data?.prizes && res.data?.prizes[0]) || {
amount: 1
},
showRedPack: true,
excitationRedPack: true
})
return
case "2":
//完善个人信息
this.setData({
showCouponComMess: true,
isOneReward: true //手机授权/填写身份信息
})
return
case "3":
// receiveVis
this.setData({
receiveVis: true,
isNoAward: true // 获奖/谢谢参与
})
return
case "4":
// 领取成功,继续扫码
this.setData({
showSecondRedPack: true,
})
return
case "5":
let price = "5" // 5 50 10 100
let juanSrc = `/images/junyao/juan${price}.png`
// 领取成功,继续扫码
this.setData({
juanSrc,
showjuan: true
})
return
}
},
fail: (res) => {
const [title, info] = res.data.errorMsg.split('|')
... ... @@ -279,59 +325,64 @@ Page({
}
})
return
app.utils.doPost({
url: '/activity/doActivityWithLocate.json',
params: {
locate: this.data.locate,
qrCode: this.data.pageData.qrCode
}
}).then(res => {
if (res.data.scanRewardVO) {
res.data.scanRewardVO.brandId = res.data.brandId
// let subGoodsVOS = Array.isArray(res.data.subGoodsVOS) ? res.data.subGoodsVOS : ['激励红包'] //null
let subGoodsVOS = res.data.subGoodsVOS
this.setData({
scanRewardVO: res.data.scanRewardVO,
// subGoodsVOS:Array.isArray(res.data.subGoodsVOS) ? res.data.subGoodsVOS : ['激励红包'] //null
subGoodsVOS: res.data.subGoodsVOS
}, () => {
if (this.data.scanRewardVO.presentType == 9 && Array.isArray(
subGoodsVOS) && subGoodsVOS.length) { //谢谢惠顾
this.setData({
showSecondRedPack: true,
secondRedPackBg: 'https://hbrand.oss-cn-hangzhou.aliyuncs.com/cpp/jyScan/second_bg2.png'
})
} else if (this.data.scanRewardVO.presentType == 9 && Array.isArray(
subGoodsVOS) && !subGoodsVOS.length) { //待解锁库存没有了
this.setData({
receiveVis: true,
isNoAward: true
})
} else if (this.data.scanRewardVO.presentType == 2 && Array.isArray(
subGoodsVOS)) {
this.setData({
showRedPack: true
})
} else if (this.data.scanRewardVO.presentType == 2 && !Array.isArray(
subGoodsVOS)) {
this.setData({
showRedPack: true,
excitationRedPack: true
})
}
})
} else {
const [title, info, time] = res.data.errorMsg.split('|')
this.setData({
alertShow: true,
alertInfo: title || '',
alertText: info || '',
alertTime: time || ''
})
}
this.setData({
received: true
})
// app.utils.doPost({
// url: '/activity/doActivityWithLocate.json',
// params: {
// locate: this.data.locate,
// qrCode: this.data.pageData.qrCode
// }
// }).then(res => {
// if (res.data.scanRewardVO) {
// res.data.scanRewardVO.brandId = res.data.brandId
// // let subGoodsVOS = Array.isArray(res.data.subGoodsVOS) ? res.data.subGoodsVOS : ['激励红包'] //null
// let subGoodsVOS = res.data.subGoodsVOS
// this.setData({
// scanRewardVO: res.data.scanRewardVO,
// // subGoodsVOS:Array.isArray(res.data.subGoodsVOS) ? res.data.subGoodsVOS : ['激励红包'] //null
// subGoodsVOS: res.data.subGoodsVOS
// }, () => {
// if (this.data.scanRewardVO.presentType == 9 && Array.isArray(
// subGoodsVOS) && subGoodsVOS.length) { //谢谢惠顾
// this.setData({
// showSecondRedPack: true,
// secondRedPackBg: 'https://hbrand.oss-cn-hangzhou.aliyuncs.com/cpp/jyScan/second_bg2.png'
// })
// } else if (this.data.scanRewardVO.presentType == 9 && Array.isArray(
// subGoodsVOS) && !subGoodsVOS.length) { //待解锁库存没有了
// this.setData({
// receiveVis: true,
// isNoAward: true
// })
// } else if (this.data.scanRewardVO.presentType == 2 && Array.isArray(
// subGoodsVOS)) {
// this.setData({
// showRedPack: true
// })
// } else if (this.data.scanRewardVO.presentType == 2 && !Array.isArray(
// subGoodsVOS)) {
// this.setData({
// showRedPack: true,
// excitationRedPack: true
// })
// }
// })
// } else {
// const [title, info, time] = res.data.errorMsg.split('|')
// this.setData({
// alertShow: true,
// alertInfo: title || '',
// alertText: info || '',
// alertTime: time || ''
// })
// }
// this.setData({
// received: true
// })
// })
},
closeJuan(){
this.setData({
showjuan: false
})
},
// 领取红包
... ... @@ -534,6 +585,11 @@ Page({
},
})
},
welfareBoxClose() {
this.setData({
showWelfare: false,
})
},
// 校验数据是否填写完整
checkIsFilled() {
if (this.data.isOneReward) {
... ... @@ -679,6 +735,11 @@ Page({
url: `/scanGroup/jyScan/record/index?groupId=${this.data.pageData?.id}&voucherNo=${this.data.scanRewardVO?.voucherNo}`,
})
},
goWelfare() {
wx.navigateTo({
url: `/scanGroup/jyScan/welfare/index`,
})
},
goIndex() {
wx.switchTab({
url: '/custom-pages/custom-index/index',
... ...
... ... @@ -5,7 +5,7 @@
<image class="index_img product" src="/images/junyao/product.png" mode="widthFix"/>
<image class="drink_power" src="/images/junyao/drinkPower.png" mode="widthFix"/>
<image class="index_img myPrize" bindtap="goRecord" src="/images/junyao/myPrize.png" mode="widthFix"/>
<image class="index_img welfareOfficer" src="/images/junyao/welfareOfficer.png" mode="widthFix"/>
<image class="index_img welfareOfficer" bindtap="goWelfare" src="/images/junyao/welfareOfficer.png" mode="widthFix"/>
<view bindtap="doActivity">
<image class="draw_now" src="/images/junyao/drawNow.png" mode="widthFix"/>
</view>
... ... @@ -111,7 +111,21 @@
<view class="red_close_poup" bindtap="closeRedPack"></view>
</view>
</v-popup>
<v-popup showPopup="{{showjuan}}" >
<image class="index_img packet" src="/images/junyao/packet.png" mode="widthFix"/>
<view class="index_img packet juanBox">
<image class="index_img juan" src="{{juanSrc}}" mode="widthFix"/>
</view>
<view class="redpack_poup">
<!-- <view class="red_amount">{{scanRewardVO.amount}}<text style="font-size: 90rpx;vertical-align: middle;">元</text></view> -->
<!-- <view class="red_text">{{excitationRedPack ? '激励红包' : '现金红包'}}</view> -->
<view class="red_btn secondRed_btn myprice" bindtap="goRecord">我的奖品</view>
<view class="red_btn secondRed_btn openShop" bindtap="goReceive">前往商城使用</view>
<view class="red_close_poup" bindtap="closeJuan"></view>
</view>
</v-popup>
<!-- 完善信息 showCouponComMess -->
<v-popup showPopup="{{showCouponComMess}}">
<image class="index_img packet" src="/images/junyao/frame.png" mode="widthFix"/>
... ... @@ -204,4 +218,12 @@
<view class="secondRed_close_poup" bindtap="closeSecondRedPack"></view>
</view>
</v-popup>
</view>
\ No newline at end of file
<!-- <v-popup showPopup="{{showWelfare}}">
<image class="index_img packet" src="/images/junyao/fulicontent.png" mode="widthFix"/>
<view class="{{isOneReward ? 'comMessBox' : 'comMessBox height_little'}}">
<view class="messTitle"></view>
<view class="messBoxClose" bindtap="welfareBoxClose"></view>
</view>
</v-popup> -->
</view>
... ...
... ... @@ -117,6 +117,19 @@ page {
margin: auto;
}
.juanBox {
display: flex;
align-items: center;
justify-content: center;
width: 100%;
height: 60%;
}
.juan {
width:50%;
transform: translateY(-50%);
}
/* 弹幕消息 */
.wl-msg {
... ... @@ -513,7 +526,8 @@ page {
margin-top: -160rpx;
position: relative;
}
.receive_poup_content{
.receive_poup_content {
position: absolute;
top: 10%;
left: 0;
... ... @@ -533,9 +547,11 @@ page {
color: #333333;
text-align: center;
}
.textTip{
.textTip {
color: #D96531;
}
.coninue_scan {
width: 434rpx;
height: 94rpx;
... ... @@ -655,6 +671,7 @@ page {
color: #F90000;
font-weight: bold;
}
.packTips {
font-size: 50rpx;
color: #F90000;
... ... @@ -687,7 +704,6 @@ page {
color: #fff;
margin: auto
}
.secondRed_btn {
width: 434rpx;
height: 94rpx;
... ... @@ -707,6 +723,19 @@ page {
line-height: 94rpx;
}
.openShop {
position: absolute;
bottom: 100rpx;
}
.myprice{
position: absolute;
bottom: 220rpx;
background: #FF2222;
color: #fff;
border: 1px solid #fff;
border-radius: 50rpx;
width: 400rpx;
}
.secondRed_close_poup {
width: 60rpx;
height: 60rpx;
... ...
import config from "../../../utils/config.js"
Page({
data: {
code: 'QJ234W85' // 这里是二维码下方的变量文本
},
onInputChange(e) {
this.setData({ code: e.detail.value });
},
onOpenReward() {
if (!this.data.code.trim()) {
wx.showToast({
title: '请输入明码',
icon: 'none'
});
return;
}
wx.showToast({
title: '正在验证...',
icon: 'loading'
});
// 请求服务器验证明码
setTimeout(() => {
// let latitude = getApp().globalData.userInfo.latitude
// let longitude = getApp().globalData.userInfo.longitude
const apiBase = config.dataServer
wx.request({
url: apiBase + `/junyao/${this.data.code}`,
header: {
'Authorization': `Bearer ${getApp().globalData.userInfo?.token}`,
'serialId': getApp().userInfo?.serialId
},
method: "POST",
data: {},
timeout: 30 * 1000,
success: (res) => {
let tag = res.data.tag
wx.navigateTo({
url: `/scanGroup/jyScan/index/index?tag=${tag}`,
})
},
fail: (res) => {
console.log(res)
// const msg = await getErrortxt()
// wx.showModal({
// title: '提示',
// content: msg,
// showCancel: false,
// confirmText: '知道了',
// confirmColor: '#fe8600'
// })
},
complete: () => {
// wx.hideNavigationBarLoading()
// if (showLoading) {
// wx.hideLoading()
// }
}
})
// wx.showToast({
// title: '奖励已领取!',
// icon: 'success'
// });
}, 2000);
}
});
\ No newline at end of file
... ...
{
"navigationBarTitleText": "明码开奖",
"usingComponents": {}
}
\ No newline at end of file
... ...
<view class="container">
<view class="codeBox1">
<image class="banner" src="/assets/banner.png" mode="widthFix"></image>
<view class="input-section">
<input class="code-input" placeholder="请输入二维码下方的明码字符" bindinput="onInputChange"/>
<button class="open-btn" bindtap="onOpenReward">明码开奖</button>
</view>
</view>
<view class="codeBox2">
<view class="guide-title">明码领取指引</view>
<view class="qrBox">
<view class="qr-section">
<image class="qr-code" src="/images/erweima/erweima.jpg" mode="widthFix"></image>
<view class="code-box">
<text class="code-text">{{code}}</text>
</view>
</view>
<view class="code-display">
<view class="dashed-line"></view>
<text class="label">明码:</text>
<text class="code-value">{{code}}</text>
</view>
<view class="instruction">
<view>如瓶盖码/瓶贴码无法清晰</view>
<view>识别,可输入二维码下方</view>
<view>的明码进行开奖</view>
</view>
</view>
<view class="steps">
<text class="stepsTxt">步骤:</text>
<text>(1) 查找瓶盖/瓶底的明码;</text>
<text>(2) 输入明码并点击按钮;</text>
<text>(3) 获取奖励信息。</text>
</view>
</view>
</view>
\ No newline at end of file
... ...
page{
width: 100%;
height: 100%;
}
.container{
background-color: rgb(247,247,249);
padding: 20rpx;
box-sizing: border-box;
width: 100%;
height: 100%;
}
.codeBox1{
position: relative;
background-color: #fff;
}
.codeBox2{
position: relative;
background-color: #fff;
margin-top: 20rpx;
}
.qrBox {
display: flex;
/* flex-direction: column; */
align-items: flex-end;
padding: 20rpx;
position: relative;
}
.qr-section {
position: relative;
display: flex;
flex-direction: column;
align-items: center;
}
.qr-code {
width: 300rpx;
height: 300rpx;
}
.code-box {
position: absolute;
bottom: -30rpx;
background-color: white;
border: 2rpx solid red;
padding: 5rpx 15rpx;
border-radius: 8rpx;
}
.code-text {
font-size: 28rpx;
color: #333;
font-weight: bold;
}
.dashed-line {
width: 28vw;
height: 2rpx;
border-bottom: 2rpx dashed red;
/* position: relative; */
/* top: 20rpx; */
}
.code-display {
display: flex;
align-items: center;
/* margin-top: 20rpx; */
transform: translateY(20rpx);
z-index: 8;
position: absolute;
right: 10px;
/* justify-content: center; */
}
.label {
font-size: 30rpx;
font-weight: bold;
color: #333;
}
.code-value {
font-size: 30rpx;
color: red;
font-weight: bold;
}
.instruction {
margin-top: 20rpx;
font-size: 26rpx;
color: #666;
text-align: center;
position: absolute;
top: 0;
right: 0;
text-align: left;
width: 50%;
}
.guide-title {
font-size: 32rpx;
font-weight: bold;
margin-bottom: 20rpx;
padding-top: 40rpx;
text-align: center;
}
.steps {
margin-top: 20rpx;
font-size: 30rpx;
color: #666;
display: flex;
flex-direction: column;
align-items: flex-start;
line-height: 50rpx;
padding-left: 50rpx;
}
.stepsTxt{
font-weight: bold;
font-size: 36rpx;
color: #000;
}
.banner {
width: 100%;
}
.input-section {
margin-top: 40rpx;
display: flex;
flex-direction: column;
align-items: center;
}
.code-input {
width: 80%;
height: 80rpx;
border: 1px solid #ddd;
border-radius: 10rpx;
padding: 0 20rpx;
font-size: 28rpx;
}
.open-btn {
width: 80%;
height: 80rpx;
background-color: #007aff;
color: white;
text-align: center;
line-height: 80rpx;
font-size: 30rpx;
border-radius: 10rpx;
margin-top: 20rpx;
}
... ...
// scanGroup/jyScan/index/index.js
import config from "../../../utils/config.js"
const app = getApp()
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
async onLoad(options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
async onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})
\ No newline at end of file
... ...
{
"usingComponents": {
"alert": "../component/alert/alert",
"popup": "../component/popup/popup"
},
"navigationBarTitleText": "胃动力扫码赢红包"
}
\ No newline at end of file
... ...
<!--scanGroup/jyScan/index/index.wxml-->
<view class="container">
<image class="add" src="/images/junyao/add.png" mode="widthFix"/>
<image class="fulicontent" src="/images/junyao/fulicontent.png" mode="widthFix"/>
<image class="bgimg" src="/images/junyao/bgimg.png" mode="scaleToFill"/>
<image class="fuli" src="/images/junyao/fuli.png" mode="widthFix"/>
<image class="ma" src="/images/junyao/ma.png" mode="widthFix"/>
<view class="{{isOneReward ? 'comMessBox' : 'comMessBox height_little'}}">
<view class="messTitle"></view>
<view class="messBoxClose" bindtap="welfareBoxClose"></view>
</view>
</view>
... ...
.container{
width: 100%;
}
.fulicontent{
position: absolute;
width: 95%;
left: 0;
right: 0;
top: 0;
bottom: 0;
transform: translateY(-10%);
margin: auto;
}
.add{
position: absolute;
left: 0;
right: 0;
top: 5%;
margin: auto;
}
.bgimg{
width: 100%;
height: 100vh;
position: absolute;
z-index: -1;
}
.fuli{
position: absolute;
left: 0;
right: 0;
bottom: 100rpx;
width: 300rpx;
margin: auto;
}
.ma{
position: absolute;
z-index: -1;
left: 0;
right: 0;
bottom: 100rpx;
width: 500rpx;
margin: auto;
transform: translateX(50rpx) translateY(50rpx);
}
\ No newline at end of file
... ...