Commit 55832d66 by 李伟康

修复

1 parent 2b819d39
...@@ -35,7 +35,7 @@ Page({ ...@@ -35,7 +35,7 @@ Page({
const { const {
options options
} = this } = this
console.log(this.options) console.log(options)
if (options.isLogin) this.getRedEnvelopeH5() if (options.isLogin) this.getRedEnvelopeH5()
else this.jumpLoading() //直接打开时跳转、防止sessionId失效 else this.jumpLoading() //直接打开时跳转、防止sessionId失效
}, },
...@@ -84,11 +84,10 @@ Page({ ...@@ -84,11 +84,10 @@ Page({
if (code == 0) { if (code == 0) {
if (data.id && data.link) { if (data.id && data.link) {
// /**sourceType 0-自研,1-外采 */ // /**sourceType 0-自研,1-外采 */
if (sourceType == 1) wx.p.router.redirectTo('/packageEquity/pages/receiveRed/receiveRed', { if (sourceType == 1) {
isOpenMember: source == 0, this.showRedModel()
activityRedEnvelopeLink: data.link this.jumpUrl = data.link
}) } else this.jumpRedEnvelopeH5({
else this.jumpRedEnvelopeH5({
activityId, activityId,
linkId: data.id, linkId: data.id,
source source
...@@ -157,6 +156,9 @@ Page({ ...@@ -157,6 +156,9 @@ Page({
if (recordId) query += `&recordId=${recordId}` if (recordId) query += `&recordId=${recordId}`
if (awardInfoId) query += `&awardInfoId=${awardInfoId}` if (awardInfoId) query += `&awardInfoId=${awardInfoId}`
this.linkQuery = query this.linkQuery = query
this.showRedModel()
},
showRedModel() {
this.setData({ this.setData({
show: true show: true
}) })
...@@ -165,28 +167,29 @@ Page({ ...@@ -165,28 +167,29 @@ Page({
countDown() { countDown() {
let { let {
count, count,
timer,
isJump isJump
} = this.data } = this.data
let _this = this let _this = this
if (this.data.count == 0) { if (count == 0) {
!isJump && this.jump() !isJump && this.jump()
if (this.timer) clearTimeout(this.timer)
return return
} }
clearTimeout(timer) this.timer = setTimeout(() => {
timer = new setTimeout(() => {
_this.setData({ _this.setData({
count: count - 1 count: count - 1
}) })
this.countDown() this.countDown()
}, 1000) }, 1e3)
}, },
jump() { jump() {
this.setData({ this.setData({
isJump: true, isJump: true,
show: false, show: false,
}) })
let url = `${domain}/scrm-wx-red-packet/#/redEnvelope?${this.linkQuery}` //测试、预发布、生产 if (this.timer) clearTimeout(this.timer)
/**jumpUrl 外采链接 */
let url = this.jumpUrl ? this.jumpUrl : `${domain}/scrm-wx-red-packet/#/redEnvelope?${this.linkQuery}` //测试、预发布、生产
// url: `${domain}/dj-scrm-wx-work-main-lwk/#/?${this.linkQuery}` //开发环境 // url: `${domain}/dj-scrm-wx-work-main-lwk/#/?${this.linkQuery}` //开发环境
wx.p.router.redirectToH5(url) wx.p.router.redirectToH5(url)
}, },
......
...@@ -35,7 +35,9 @@ page { ...@@ -35,7 +35,9 @@ page {
color: #999999; color: #999999;
} }
} }
.info{
max-width: 380rpx;
}
.icon { .icon {
width: 128rpx; width: 128rpx;
height: 128rpx; height: 128rpx;
......
...@@ -245,18 +245,9 @@ Page({ ...@@ -245,18 +245,9 @@ Page({
}, },
userInfo userInfo
} = this.data } = this.data
// , {
// data
// } = await wx.p.api.questionnaireApi.bindRedEnvelopeLink({
// activityId: rewardId,
// bindingSource: 2,
// wechatName: userInfo.nickName,
// businessId: id
// })
wx.p.router.redirectTo('/packageActivity/pages/redEnvelope/index/index', { wx.p.router.redirectTo('/packageActivity/pages/redEnvelope/index/index', {
activityId: rewardId, activityId: rewardId,
merchantId: userInfo.merchantId, merchantId: userInfo.merchantId,
// linkId: data.id,
source: 2, source: 2,
recordId, recordId,
isLogin: 1, isLogin: 1,
......
...@@ -13,7 +13,11 @@ Page({ ...@@ -13,7 +13,11 @@ Page({
imgList: new Array(3), imgList: new Array(3),
authStatus: true, authStatus: true,
hasUserInfo: false, hasUserInfo: false,
isOpenMember: false isOpenMember: false,
txtObj: {
noMember: '恭喜领取成功',
member: '恭喜您已成为会员用户'
},
}, },
navbarReady(e) { navbarReady(e) {
let { let {
...@@ -129,6 +133,7 @@ Page({ ...@@ -129,6 +133,7 @@ Page({
}, },
// 领取会员卡 // 领取会员卡
toPostFreeCard(merchantId, phone, userInfo) { toPostFreeCard(merchantId, phone, userInfo) {
wx.p.wxApi.showLoading()
let para = { let para = {
merchantId, merchantId,
phone phone
...@@ -177,6 +182,7 @@ Page({ ...@@ -177,6 +182,7 @@ Page({
}) })
}, },
receiveRed(equityFreeCardId) { receiveRed(equityFreeCardId) {
wx.p.wxApi.showLoading()
let { let {
isOpenMember, isOpenMember,
nickName, nickName,
...@@ -188,6 +194,7 @@ Page({ ...@@ -188,6 +194,7 @@ Page({
} }
if (bindingSource) params.bindingSource = bindingSource if (bindingSource) params.bindingSource = bindingSource
wx.p.api.equityApi.checkReceiveRed(params).then(async res => { wx.p.api.equityApi.checkReceiveRed(params).then(async res => {
wx.hideLoading()
console.log(res, 'checkReceiveRed---') console.log(res, 'checkReceiveRed---')
let { let {
code, code,
...@@ -207,12 +214,19 @@ Page({ ...@@ -207,12 +214,19 @@ Page({
isOpenMember: true, isOpenMember: true,
addWelfareOfficer: 'bg-member-welfare' addWelfareOfficer: 'bg-member-welfare'
}) })
} else wx.p.router.redirectTo('/packageActivity/pages/redEnvelope/index/index', { } else {
activityId: data.activityRedEnvelopeId, this.setData({
businessId: equityFreeCardId, receiveSuccess: true
source: 0, })
isLogin: 1 setTimeout(() => {
}) wx.p.router.redirectTo('/packageActivity/pages/redEnvelope/index/index', {
activityId: data.activityRedEnvelopeId,
businessId: equityFreeCardId,
source: 0,
isLogin: 1
})
}, 1.5e3)
}
} else this.jumpMine() } else this.jumpMine()
} }
}) })
...@@ -222,9 +236,11 @@ Page({ ...@@ -222,9 +236,11 @@ Page({
// 先判断登录 // 先判断登录
const authStatus = await wx.p.router.intercept(false) const authStatus = await wx.p.router.intercept(false)
if (authStatus) return if (authStatus) return
wx.p.wxApi.showLoading()
wx.p.api.equityApi.checkOpenMember({ wx.p.api.equityApi.checkOpenMember({
isTrialCardFlag: 1 isTrialCardFlag: 1
}).then(res => { }).then(res => {
wx.hideLoading()
if (res.code == -1 && res.errId == 2008) { if (res.code == -1 && res.errId == 2008) {
this.showTips(res.message || '服务不可用') this.showTips(res.message || '服务不可用')
return return
......
...@@ -82,4 +82,37 @@ ...@@ -82,4 +82,37 @@
width: 100%; width: 100%;
height: 20rpx; height: 20rpx;
} }
}
.red-bg-iamge {
width: 100%;
position: absolute;
left: 0;
top: 0;
.image-class {
background-color: #fff;
width: 100%;
height: 320rpx;
}
.img-card {
position: absolute;
bottom: -42rpx;
left: 35%;
width: 136rpx;
height: 136rpx;
}
}
.receive-red {
text-align: center;
.title {
font-weight: 600;
font-size: 48rpx;
color: #3871E1;
text-align: center;
line-height: 48rpx;
}
} }
\ No newline at end of file \ No newline at end of file
<navigation-bar bindnavbarReady="navbarReady" navStyle="{{navStyle}}" showBack="{{true}}" navTitleStyle="{{navTitleStyle}}" page-title="领取会员卡">领取会员卡</navigation-bar> <navigation-bar bindnavbarReady="navbarReady" navStyle="{{navStyle}}" showBack="{{true}}" navTitleStyle="{{navTitleStyle}}" page-title="领取会员卡">领取会员卡</navigation-bar>
<view class="bg-iamge" style="height: calc({{statusBarHeight + navigationBarHeight - 30}}px);">
<glsx-image src="equity/bg-card.png" class="image-class" /> <block wx:if="{{receiveSuccess}}">
</view> <view class="red-bg-iamge" style="height: calc({{statusBarHeight + navigationBarHeight + 26}}px);">
<scroll-view class="box" scroll-y style="margin-top:calc({{statusBarHeight + navigationBarHeight - 30}}px);" refresher-enabled="{{false}}"> <glsx-image src="equity/bg-receive.png" class="image-class" />
<view style="height: calc(100vh - {{statusBarHeight + navigationBarHeight - 30}}px);"> <glsx-image src="equity/icon-receive.png" class="img-card" />
<view class="img-box"> </view>
<glsx-image src="equity/card.png" class="img-card" /> <view class="receive-red" style="margin-top:calc({{statusBarHeight + navigationBarHeight + 100}}px);">
<view class="title">{{txtObj[isOpenMember ? 'member' : 'noMember']}}</view>
</view>
</block>
<block wx:else>
<view class="bg-iamge" style="height: calc({{statusBarHeight + navigationBarHeight - 30}}px);">
<glsx-image src="equity/bg-card.png" class="image-class" />
</view>
<scroll-view class="box" scroll-y style="margin-top:calc({{statusBarHeight + navigationBarHeight - 30}}px);" refresher-enabled="{{false}}">
<view style="height: calc(100vh - {{statusBarHeight + navigationBarHeight - 30}}px);">
<view class="img-box">
<glsx-image src="equity/card.png" class="img-card" />
</view>
<glsx-image class="card-free" src="equity/card-free.png" />
<view class="equity-box" wx:for="{{imgList}}" wx:key="index">
<glsx-image class="img-equity" src="equity/card-{{index}}.png" />
</view>
</view> </view>
<glsx-image class="card-free" src="equity/card-free.png" /> </scroll-view>
<view class="equity-box" wx:for="{{imgList}}" wx:key="index"> <view class="card-btn isFullSucreen">
<glsx-image class="img-equity" src="equity/card-{{index}}.png" /> <view class="tips">限时领红包</view>
<button wx:if="{{authStatus}}" open-type="getPhoneNumber" catchgetphonenumber="getPhoneNumber" class="text-center btn-defalut">免费领取</button>
<button wx:elif="{{!hasUserInfo}}" catchtap="jumpAuthUserInfo" class="text-center btn-defalut">免费领取</button>
<view wx:else>
<view class="btn-defalut" bindtap="toCheckMember">免费领取</view>
</view> </view>
<view class="h-20"></view>
</view> </view>
</scroll-view>
<view class="card-btn isFullSucreen">
<view class="tips">限时领红包</view>
<button wx:if="{{authStatus}}" open-type="getPhoneNumber" catchgetphonenumber="getPhoneNumber" class="text-center btn-defalut">免费领取</button>
<button wx:elif="{{!hasUserInfo}}" catchtap="jumpAuthUserInfo" class="text-center btn-defalut">免费领取</button>
<view wx:else>
<view class="btn-defalut" bindtap="toCheckMember">免费领取</view>
</view>
<view class="h-20"></view>
</view>
<glsx-privacy appletName="业主甄选"></glsx-privacy>
\ No newline at end of file \ No newline at end of file
<glsx-privacy appletName="业主甄选"></glsx-privacy>
</block>
\ No newline at end of file \ No newline at end of file
...@@ -30,45 +30,28 @@ Component({ ...@@ -30,45 +30,28 @@ Component({
notIntercept: true notIntercept: true
} }
if (data.activityType == 3) { if (data.activityType == 3) {
const { options = {
userInfo activityId,
} = wx.p.router.getPageInstance().data businessId: data.id,
const response = await wx.p.api.questionnaireApi.receiveQuestionnaireRedEnvelope({ merchantId,
questionnaireId: data.id, source: 1,
activityRedEnvelopeId: activityId, isLogin: 1
nickName: userInfo.nickName
})
if (response.isActivityRedEnvelopeFlag && !response.isReceiveFlag) this.setData({
jumpOption: {
type: data.activityType,
options: {
activityId,
businessId: data.id,
merchantId,
source: 1,
isLogin: 1
}
}
})
// wx.p.router.redirectTo('/packageActivity/pages/redEnvelope/index/index', {
// })
this.countDown()
} else {
if (data.activityType == 2) {
options.couponId = activityId
url = '/packageMall/pages/coupon/coupon'
} }
this.setData({ url = '/packageActivity/pages/redEnvelope/index/index'
jumpOption: { }
url, if (data.activityType == 2) {
type: data.activityType, options.couponId = activityId
options url = '/packageMall/pages/coupon/coupon'
}
})
this.countDown()
} }
} else this.countDown() this.setData({
jumpOption: {
url,
type: data.activityType,
options
}
})
}
this.countDown()
} }
}, },
timer: null, timer: null,
...@@ -82,10 +65,8 @@ Component({ ...@@ -82,10 +65,8 @@ Component({
const { const {
jumpOption jumpOption
} = this.data } = this.data
if (jumpOption) { if (jumpOption) wx.p.router.redirectTo(jumpOption.url, jumpOption.options)
if (jumpOption.type == 3) wx.p.router.redirectTo('/packageActivity/pages/redEnvelope/index/index', jumpOption.options) else wx.p.router.goHome()
else wx.p.router.redirectTo(jumpOption.url, jumpOption.options)
} else wx.p.router.goHome()
}, },
countDown() { countDown() {
this.timer = setTimeout(() => { this.timer = setTimeout(() => {
......
...@@ -8,7 +8,6 @@ Page({ ...@@ -8,7 +8,6 @@ Page({
navStyle, navStyle,
noticeContent: '', noticeContent: '',
bannerList: [], bannerList: [],
isEmpty: false,
codeList: [{ codeList: [{
title: '官方', title: '官方',
desc: '福利群', desc: '福利群',
...@@ -53,17 +52,6 @@ Page({ ...@@ -53,17 +52,6 @@ Page({
}) })
} }
this.getStrategyList(); this.getStrategyList();
if (options?.jumpH5Url) {
this.setData({
isEmpty: true
})
wx.p.router.jumpH5(options.jumpH5Url)
setTimeout(() => {
this.setData({
isEmpty: false
})
}, 1600)
}
this.shareTitle = "甄选福利" this.shareTitle = "甄选福利"
}, },
......
<view wx:if="{{isEmpty}}"></view> <view class="container">
<view wx:else> <navigation-bar bindnavbarReady="navbarReady" navStyle="{{navStyle}}" page-title="甄选福利">
<view class="container"> <view class="bar-text">甄选福利</view>
<navigation-bar bindnavbarReady="navbarReady" navStyle="{{navStyle}}" page-title="甄选福利"> </navigation-bar>
<view class="bar-text">甄选福利</view> <view style="{{user_box_style}}" class="top_bg_wrap">
</navigation-bar> <view class="store-wrap">
<view style="{{user_box_style}}" class="top_bg_wrap"> <view class="inner flex_sc">
<view class="store-wrap"> <glsx-image class="logo" webp src="home/store_logo.png"></glsx-image>
<view class="inner flex_sc"> <view class="store_name">{{currentStore.merchantName}}</view>
<glsx-image class="logo" webp src="home/store_logo.png"></glsx-image> <picker mode="selector" bindchange="changeStore" range="{{storeList}}" range-key="merchantName">
<view class="store_name">{{currentStore.merchantName}}</view> <view class="change_box">
<picker mode="selector" bindchange="changeStore" range="{{storeList}}" range-key="merchantName"> <glsx-image class="icon" webp src="home/change_store_icon.png"></glsx-image>
<view class="change_box"> </view>
<glsx-image class="icon" webp src="home/change_store_icon.png"></glsx-image> </picker>
</view> </view>
</picker>
</view>
</view>
</view>
<!-- 公告 -->
<block wx:if="{{currentStore.noticeContent}}">
<view class="notice-bar">
<notice-bar data="{{currentStore.noticeContent}}" speed="7500" id="com-1"></notice-bar>
</view>
</block>
<!-- 家生活/车生活 -->
<view class="menu_wrap flex_scb">
<glsx-image class="cover" webp src="home/family_menu_banner.png" bind:tap="toHomeLife"></glsx-image>
<glsx-image class="cover" webp src="home/car_menu_banner.png" bind:tap="toCarLife"></glsx-image>
</view>
<!-- 轮播图 -->
<view class="banner-box" wx:if="{{currentStore.bannerList.length > 0}}">
<banner bannerList="{{currentStore.bannerList}}"></banner>
</view>
<!-- 福利二维码 -->
<view class="code_wrap flex_scb">
<block wx:for="{{codeList}}" wx:key="index">
<view data-item="{{item}}" bind:tap="toShowQrCode" class="code_item flex_scb">
<view class="left">
<view class="title">
<text>{{item.title}}</text>
<text class="spc">{{item.desc}}</text>
</view>
<view class="tip">{{item.tip}}</view>
</view>
<glsx-image class="code" webp src="home/qr_code_logo.png"></glsx-image>
</view>
</block>
</view>
<!-- 省钱攻略 -->
<block wx:if="{{strategyList.length}}">
<MoneySavingTips list="{{strategyList}}" bind:selectStrategy="selectStrategy"></MoneySavingTips>
</block>
</view> </view>
</view>
<!-- 公告 -->
<block wx:if="{{currentStore.noticeContent}}">
<view class="notice-bar">
<notice-bar data="{{currentStore.noticeContent}}" speed="7500" id="com-1"></notice-bar>
</view>
</block>
<!-- 家生活/车生活 -->
<view class="menu_wrap flex_scb">
<glsx-image class="cover" webp src="home/family_menu_banner.png" bind:tap="toHomeLife"></glsx-image>
<glsx-image class="cover" webp src="home/car_menu_banner.png" bind:tap="toCarLife"></glsx-image>
</view>
<!-- 轮播图 -->
<view class="banner-box" wx:if="{{currentStore.bannerList.length > 0}}">
<banner bannerList="{{currentStore.bannerList}}"></banner>
</view>
<!-- 福利二维码 -->
<view class="code_wrap flex_scb">
<block wx:for="{{codeList}}" wx:key="index">
<view data-item="{{item}}" bind:tap="toShowQrCode" class="code_item flex_scb">
<view class="left">
<view class="title">
<text>{{item.title}}</text>
<text class="spc">{{item.desc}}</text>
</view>
<view class="tip">{{item.tip}}</view>
</view>
<glsx-image class="code" webp src="home/qr_code_logo.png"></glsx-image>
</view>
</block>
</view>
<!-- 省钱攻略 -->
<block wx:if="{{strategyList.length}}">
<MoneySavingTips list="{{strategyList}}" bind:selectStrategy="selectStrategy"></MoneySavingTips>
</block>
</view> </view>
<!-- 弹框 --> <!-- 弹框 -->
<view wx:if="{{showModal}}" class="modal_widget"> <view wx:if="{{showModal}}" class="modal_widget">
<view bind:tap="closeModal" class="popup-bg"></view> <view bind:tap="closeModal" class="popup-bg"></view>
<view class="box_cover"> <view class="box_cover">
<!-- <image class="max_cover" src="{{IMG_URL}}home/fuliguan/{{urlName}}.png" show-menu-by-longpress="{{true}}" /> --> <!-- <image class="max_cover" src="{{IMG_URL}}home/fuliguan/{{urlName}}.png" show-menu-by-longpress="{{true}}" /> -->
<image class="max_cover" src="{{IMG_URL}}home/fuliguan/{{bannerName}}.png" show-menu-by-longpress="{{true}}" /> <image class="max_cover" src="{{IMG_URL}}home/fuliguan/{{bannerName}}.png" show-menu-by-longpress="{{true}}" />
<image bind:tap="closeModal" class="close_icon" src="{{IMG_URL}}home/close_modal.png" /> <image bind:tap="closeModal" class="close_icon" src="{{IMG_URL}}home/close_modal.png" />
<view class="code_banner"> <view class="code_banner">
<image class="codeimg" src="{{urlName}}" show-menu-by-longpress="{{true}}" /> <image class="codeimg" src="{{urlName}}" show-menu-by-longpress="{{true}}" />
</view>
</view> </view>
</view>
</view> </view>
<store-select show="{{showStore}}" bind:freshMerchant="freshMerchant"></store-select> <store-select show="{{showStore}}" bind:freshMerchant="freshMerchant"></store-select>
\ No newline at end of file \ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!