Commit bd15988d by 谢中龙

消费集点修改

parent 02b105b7
...@@ -116,5 +116,6 @@ App({ ...@@ -116,5 +116,6 @@ App({
isFullSucreen: false, // 当前设备是否为 FullSucreen isFullSucreen: false, // 当前设备是否为 FullSucreen
commonFunc: commonFunc, commonFunc: commonFunc,
brandId: envInfo.brandId, brandId: envInfo.brandId,
appId : envInfo.appId
} }
}) })
// component/adDialog/adDialog.js
var app = getApp()
const wxService = require('../../utils/wxService')
const utils = require('../../utils/util')
const envInfo = require('../../config/index').envInfo
Component({
/**
* 组件的属性列表
*/
properties: {
showDialog : {
type:Boolean,
value: false
},
imageUrl : {
type : String,
default : ''
},
params: {
type:Object,
value: null
}
},
observers:{
},
/**
* 组件的初始数据
*/
data: {
},
lifetimes:{
attached(){
// console.log(this.data.pageInfo)
},
created(){
}
},
/**
* 组件的方法列表
*/
methods: {
//关闭
onTapClose(){
this.setData({
showDialog :false
});
},
//图片的点击
onTapPic(){
this.triggerEvent('dialogTap',this.data.params);
this.setData({
showDialog :false
});
}
}
})
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
<!--component/adDialog/adDialog.wxml-->
<view class="ad-modal-bg" wx:if="{{showDialog}}">
<view class="ad-modal-body">
<view class="show-img">
<image mode="widthFix" src="{{imageUrl}}" bindtap="onTapPic"></image>
</view>
<!-- <view class="close-dia">
<image src="/assets/imgs/close.png" mode="aspectFit" bindtap="onTapClose"></image>
</view> -->
</view>
</view>
/* component/adDialog/adDialog.wxss */
.ad-modal-bg{
position: fixed;
z-index: 9999;
width: 100vw;
height: 100vh;
background: rgba(0, 0, 0, 0.5);
left: 0;
top: 0;
display: flex;
justify-content: center;
align-items: center;
}
.ad-modal-bg .ad-modal-body{
width: 70vw;
height: auto;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.ad-modal-bg .ad-modal-body .show-img{
width: 100%;
height: auto;
}
.ad-modal-bg .ad-modal-body .show-img image{
width: 100%;
height: auto;
}
.ad-modal-bg .ad-modal-body .close-dia{
width: 100%;
height: auto;
padding-top: 10rpx;
display: flex;
align-items: center;
justify-content: center;
}
.ad-modal-bg .ad-modal-body .close-dia image{
width: 80rpx;
height: 80rpx;
}
.ad-modal-bg .ad-modal-body .close-dia image:active{
opacity: 0.7;
}
\ No newline at end of file
const PROJECT_ENV = 'prod' // 生产 prod, 开发1 dev,开发2 dev2, 测试 test, 预生产 pre const PROJECT_ENV = 'test' // 生产 prod, 开发1 dev,开发2 dev2, 测试 test, 预生产 pre
const needMock = '' // const needMock = '' //
const brandId = 2711 ; //1002 测试 2711 生产 const brandId = 1002 ; //1002 测试 2711 生产
// appid_dev_wx wxc3b64b09b1d3dfc2 // appid_dev_wx wxc3b64b09b1d3dfc2
// appid_test_wx wxac09792264c49b5c // appid_test_wx wxac09792264c49b5c
// appid_pre_711 wx358b56af62edbde1 // appid_pre_711 wx358b56af62edbde1
...@@ -32,6 +32,7 @@ const config = { ...@@ -32,6 +32,7 @@ const config = {
const imgConfig = { const imgConfig = {
dev: devImgCtx, dev: devImgCtx,
dev2: devImgCtx,
test: testImgCtx, test: testImgCtx,
pre: preImgCtx, pre: preImgCtx,
prod: prodImgCtx prod: prodImgCtx
...@@ -39,18 +40,28 @@ const imgConfig = { ...@@ -39,18 +40,28 @@ const imgConfig = {
const tunulToken = { const tunulToken = {
dev: 'aa8a1bfb7f6c5031d172d94b6574293ef954a6f2d4e16657da008e0cc15588feD', dev: 'aa8a1bfb7f6c5031d172d94b6574293ef954a6f2d4e16657da008e0cc15588feD',
dev2: 'aa8a1bfb7f6c5031d172d94b6574293ef954a6f2d4e16657da008e0cc15588feD',
test: 'aa8a1bfb7f6c5031d172d94b6574293ef954a6f2d4e16657da008e0cc15588feD', test: 'aa8a1bfb7f6c5031d172d94b6574293ef954a6f2d4e16657da008e0cc15588feD',
pre: '4c8d641cb2b8a576317ee5f6ead1f36474463041d61fb5d4289364565b0c6c63', pre: '4c8d641cb2b8a576317ee5f6ead1f36474463041d61fb5d4289364565b0c6c63',
prod: '4c8d641cb2b8a576317ee5f6ead1f36474463041d61fb5d4289364565b0c6c63' prod: '4c8d641cb2b8a576317ee5f6ead1f36474463041d61fb5d4289364565b0c6c63'
} }
const appId = {
dev: 'wxc3b64b09b1d3dfc2',
dev2: 'wxc3b64b09b1d3dfc2',
test: 'wxac09792264c49b5c',
pre: 'wx358b56af62edbde1',
prod: 'wx700028bf32a3be66'
}
const envInfo = (() => { const envInfo = (() => {
return { return {
ctx: config[PROJECT_ENV], ctx: config[PROJECT_ENV],
env: PROJECT_ENV, env: PROJECT_ENV,
imgCtx: imgConfig[PROJECT_ENV], imgCtx: imgConfig[PROJECT_ENV],
brandId : brandId, brandId : brandId,
tunulToken: tunulToken[PROJECT_ENV] tunulToken: tunulToken[PROJECT_ENV],
appId : appId[PROJECT_ENV]
} }
})() })()
......
...@@ -73,6 +73,7 @@ wxService.page({ ...@@ -73,6 +73,7 @@ wxService.page({
code: res.code, code: res.code,
wechatInfo: null, wechatInfo: null,
brandId: app.globalData.brandId, brandId: app.globalData.brandId,
appId : app.globalData.appId
}).then(response=>{ }).then(response=>{
let dataResp = response.data.data let dataResp = response.data.data
wx.setStorageSync('token', dataResp.token) wx.setStorageSync('token', dataResp.token)
......
...@@ -39,12 +39,16 @@ wxService.page({ ...@@ -39,12 +39,16 @@ wxService.page({
currentStatus: 2, // 活动状态 1 未生效 2 生效中 3 已失效 0 已删除 currentStatus: 2, // 活动状态 1 未生效 2 生效中 3 已失效 0 已删除
currentTimeStatus: 1, // 1 进行中 2 已结束 3 未开始 currentTimeStatus: 1, // 1 进行中 2 已结束 3 未开始
isAuthorization: false, isAuthorization: false,
donateImgUrl : '',
showDonateImgUrl : false,
showTempalteModal : true
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad(options) { onLoad(options) {
}, },
//
watch: { watch: {
experAccessible(newVal, oldVal) { experAccessible(newVal, oldVal) {
// 登录接口返回err // 登录接口返回err
...@@ -99,6 +103,57 @@ wxService.page({ ...@@ -99,6 +103,57 @@ wxService.page({
} }
} }
}, },
//弹出订阅莫泰关闭
onTapCloseModalTemplate(){
this.setData({
showTempalteModal : false
});
},
//确认弹出订阅消息框
onTapSureSubTemplate(e){
//
this.setData({
showTempalteModal : false
});
//查询订阅模板
let baseUserInfo = wx.getStorageSync('_baseUserInfo');
wxService.post(`${'/merchant/message/wxSubMsgMapping/getListByParams'}`, {
scenarioIds: ['ordersend', 'orderconfirm'],
sourceFrom: 2,
switchType: 3
}).then(res => {
let tempArr = res.data.data ? res.data.data : [];
let tempids = [];
tempArr.map(item => {
tempids.push(item.templateId);
});
let promiseArr = []
wx.requestSubscribeMessage({
tmplIds: tempids,
success: (res) => {
for (let i = 0; i < tempArr.length; i++) {
let tempPromise = wxService.post(`${'/merchant/message/wxSubMsgSubscride/member/subscribe'}`, {
businessId: tradeId,
memberId: baseUserInfo.memberId,
scenarioId: tempArr[i].scenarioId,
templateId: tempArr[i].templateId
});
promiseArr.push(tempPromise);
}
}
});
Promise.all(promiseArr).then(promiseArr => {
wx.showToast({
title: '订阅成功',
});
})
});
},
// 集点详情 // 集点详情
getPointDetail(id) { getPointDetail(id) {
wx.showLoading({ wx.showLoading({
...@@ -113,6 +168,7 @@ wxService.page({ ...@@ -113,6 +168,7 @@ wxService.page({
dialog.show = false dialog.show = false
// 弹框背景 // 弹框背景
dialog.image = data.popupImage dialog.image = data.popupImage
this.data.donateImgUrl = data.donateImgUrl ? data.donateImgUrl : 'https://img3.bigaka.com/test/1001/202005/20200517/10010c6f71af-479e-4663-adde-00f64c1fb941.png';
// 是否在有效期 // 是否在有效期
let timeFlag = 1 let timeFlag = 1
let endT = data.endTime let endT = data.endTime
...@@ -141,7 +197,8 @@ wxService.page({ ...@@ -141,7 +197,8 @@ wxService.page({
desc: JSON.parse(data.content), desc: JSON.parse(data.content),
detailImage: data.detailImage, detailImage: data.detailImage,
dialog, dialog,
currentTimeStatus: timeFlag currentTimeStatus: timeFlag,
donateImgUrl : this.data.donateImgUrl
}, () => { }, () => {
// 1 进行中 2 已结束 // 1 进行中 2 已结束
if (timeFlag == 2) { if (timeFlag == 2) {
...@@ -185,21 +242,17 @@ wxService.page({ ...@@ -185,21 +242,17 @@ wxService.page({
} }
this.showModal = true; this.showModal = true;
wx.showModal({ this.setData({
title : '集点领取提示', showDonateImgUrl : true,
content : '恭喜您获得一个集点',
showCancel : false,
confirmText : '确认领取',
confirmColor : '#05C35B',
success (res) {
if(res.confirm){
self.userConfirmGetCollectionPoint(id);
}
self.showModal = false;
}
}) })
}, },
//图片的点击事件
onDialogTap(e){
this.userConfirmGetCollectionPoint(this.data.id);
},
//
//调用领取接口 //调用领取接口
userConfirmGetCollectionPoint(id){ userConfirmGetCollectionPoint(id){
wxService.post(`/sale/touchpoints/pointConsumptionActivity/award?id=${id}`).then(res => { wxService.post(`/sale/touchpoints/pointConsumptionActivity/award?id=${id}`).then(res => {
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
"x-dialog":"/component/dialog/dialog", "x-dialog":"/component/dialog/dialog",
"x-progress-point":"/component/progressPoint/progressPoint", "x-progress-point":"/component/progressPoint/progressPoint",
"x-progress-image":"/component/progressImage/progressImage", "x-progress-image":"/component/progressImage/progressImage",
"image-dialog" : "/component/imageDialog/imageDialog" ,
"authorization-modal-point": "/component/authorization-modal-point/authorization-modal-point" "authorization-modal-point": "/component/authorization-modal-point/authorization-modal-point"
} }
} }
\ No newline at end of file
...@@ -60,3 +60,22 @@ ...@@ -60,3 +60,22 @@
/> />
<authorization-modal-point isAuthorization='{{isAuthorization}}'/> <authorization-modal-point isAuthorization='{{isAuthorization}}'/>
<image-dialog showDialog="{{showDonateImgUrl}}" imageUrl="{{donateImgUrl}}" bind:dialogTap="onDialogTap"/>
<!-- 获取配置模板信息 -->
<view class="modal-template-msg" wx:if="{{showTempalteModal}}">
<view class="modal-tamplate-body">
<view class="modal-top-header">
集点消费服务通知
</view>
<view class="modal-main">
集点成功后 7-Eleven 会及时通知你领取奖励
</view>
<view class="modal-footer-btns">
<view class="footer-btn" bindtap="onTapCloseModalTemplate">下一次</view>
<view class="footer-btn" bindtap="onTapSureSubTemplate">同意</view>
</view>
</view>
</view>
...@@ -76,3 +76,82 @@ ...@@ -76,3 +76,82 @@
.total-points { .total-points {
font-size: 48rpx; font-size: 48rpx;
} }
.modal-template-msg{
background: rgba(0, 0, 0, 0.5);
position: fixed;
left: 0;
top: 0;
width: 100%;
height: 100%;
z-index: 1;
}
.modal-tamplate-body{
position: fixed;
width: 70vw;
height: 300rpx;
left: 50%;
margin-left: -35vw;
top: 50%;
margin-top: -150rpx;
background: #ffffff;
z-index: 2;
display: flex;
flex-direction: column;
border-radius: 8rpx;
}
.modal-tamplate-body .modal-main{
flex: 1;
padding: 20rpx 100rpx;
font-size: 24rpx;
color: #666666;
text-align: center;
}
.modal-tamplate-body .modal-top-header{
flex: 0;
min-height: 80rpx;
max-height: 80rpx;
display: flex;
align-items: center;
justify-content: center;
font-size: 28rpx;
color: #333333;
font-weight: bold;
border-top-right-radius: 8rpx;
border-top-left-radius: 8rpx;
}
.modal-tamplate-body .modal-footer-btns{
flex: 0;
min-height: 80rpx;
max-height: 80rpx;
border-top: solid 1rpx #dddddd;
display: flex;
align-items: center;
}
.modal-tamplate-body .modal-footer-btns .footer-btn{
flex: 1;
display: flex;
align-items: center;
justify-content: center;
height: 100%;
}
.modal-tamplate-body .modal-footer-btns .footer-btn:first-child{
border-bottom-left-radius: 8rpx;
border-right: solid 1rpx #dddddd;
}
.modal-tamplate-body .modal-footer-btns .footer-btn:last-child{
border-bottom-right-radius: 8rpx;
color: rgba(5, 195, 91, 1);
}
.modal-tamplate-body .modal-footer-btns .footer-btn:active{
opacity: 0.7;
}
\ No newline at end of file
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
}, },
"compileType": "miniprogram", "compileType": "miniprogram",
"libVersion": "2.8.2", "libVersion": "2.8.2",
"appid": "wx700028bf32a3be66", "appid": "wxac09792264c49b5c",
"projectname": "7-11", "projectname": "7-11",
"debugOptions": { "debugOptions": {
"hidedInDevtools": [] "hidedInDevtools": []
......
...@@ -286,6 +286,7 @@ function getUserInfoByBtn(userInfo) { ...@@ -286,6 +286,7 @@ function getUserInfoByBtn(userInfo) {
code: res[1].code, code: res[1].code,
wechatInfo: res[0], wechatInfo: res[0],
brandId: app.globalData.brandId, brandId: app.globalData.brandId,
appId : app.globalData.appId
}) })
}, (err) => { }, (err) => {
return Promise.reject(err) return Promise.reject(err)
......
...@@ -121,6 +121,7 @@ class WXService extends Http { ...@@ -121,6 +121,7 @@ class WXService extends Http {
code: result.code, code: result.code,
wechatInfo: null, wechatInfo: null,
brandId: app.globalData.brandId, brandId: app.globalData.brandId,
appId : app.globalData.appId
}).then(response => { }).then(response => {
if (response) { if (response) {
let dataResp = response.data.data let dataResp = response.data.data
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment