Commit 0216500b by 李伟康

优惠券

1 parent 34aee901
Showing 43 changed files with 3667 additions and 15 deletions
import api from '../request/http'
module.exports = {
/**获取卡券列表 */
getCardData(data) {
return api.post({
method: `scrm.api.coupon.app.list`,
...data
// discountTypes: [3, 7]
})
},
/**获取卡券数量 */
getCouponNum() {
return api.post({
method: 'scrm.api.coupon.list.by.account.id',
useMemberType: 0
})
},
/**获取首页可以领取的券 */
getHomeCardData(data) {
let {merchantId} = wx.p.storage.get('merchant_info')
if (merchantId) {
merchantId = Number(JSON.parse(merchantId))
data.merchantId = merchantId
}
return api.post({
method: `scrm.api.coupon.list.merchant.account`,
...data
})
},
/**领取优惠券 */
toReciveCard(data) {
let {
merchantId
} = wx.p.storage.get('merchant_info')
if (merchantId) {
merchantId = Number(JSON.parse(merchantId))
data.merchantId = merchantId
}
return api.post({
method: `scrm.api.coupon.customer.receive`,
...data,
receiveWay: 1,
receiveSource: 3
})
},
/**卡券详情 */
couponsDetail(data) {
return api.post({
method: `scrm.api.coupon.verification.code.detail`,
...data
})
},
/**免费领取体验卡 */
tolqFreecard(data) {
return api.post({
method: `scrm.api.equity.h5.free.card.receive`,
...data
},
true
)
},
/**获取体验卡天数 */
getFreeCardDay(data) {
return api.post({
method: `scrm.api.equity.class.free.day.get`,
...data
})
},
/** 获取企微分享优惠卷信息 */
getCouponInfo(data) {
return api.post({
method: `scrm.api.coupon.share.info`,
...data
})
},
/**领取优惠券 */
receiveCoupon(data) {
return api.post({
method: `scrm.api.coupon.share.receive`,
...data,
receiveSource: 4
},
true
)
},
/**获取套餐详情(权益) */
packageInfo(data) {
return api.post({
method: `scrm.api.equity.main.page.package.detail.get`,
...data
})
},
/**获取门店单号(权益) */
createOrderNum(data) {
return api.post({
method: `scrm.api.equity.merchant.order.code.create`,
...data
})
},
/**创建门店订单(权益) */
createOrder(data) {
return api.post({
method: `scrm.api.equity.merchant.order.create`,
...data
})
},
/**获取折扣券 兑换券详情 */
getWWCoupon(data) {
return api.post({
method: `scrm.api.coupon.verification.code.detail`,
...data
})
},
/** 检查是否领取优惠券 */
checkCoupon(data) {
return api.post({
method: `scrm.api.coupon.share.receive.check`,
...data
})
},
// 定向礼包详情
giftsDetail(data) {
return api.post({
method: `scrm.api.coupon.directional.gift.detail`,
...data
})
},
// 定向礼包领取
giftsRecive(data) {
return api.post({
method: `scrm.api.coupon.user.directional.gift.create`,
...data
})
},
// 获取优惠券详情--道路救援
getDigitalCoupons(data) {
return api.post({
method: `scrm.api.coupon.detail`,
...data
})
},
// 领取发现模块的优惠券
toReciveDiscoverCard(data) {
let {
merchantId
} = wx.p.storage.get('merchant_info')
if (merchantId) {
merchantId = Number(JSON.parse(merchantId))
data.merchantId = merchantId
}
return api.post({
method: `scrm.api.coupon.customer.receive`,
...data,
receiveWay: 9,
receiveSource: 3
})
},
}
\ No newline at end of file
......@@ -5,6 +5,8 @@ import homeApi from './home'
import discoveryApi from './discovery'
import shopmallApi from './shopmall'
import mineApi from './mine'
import couponsApi from './coupons'
module.exports = {
wechatApi,
entmicroApi,
......@@ -12,5 +14,6 @@ module.exports = {
homeApi,
discoveryApi,
shopmallApi,
mineApi
mineApi,
couponsApi
}
\ No newline at end of file
......@@ -81,7 +81,13 @@
"pages/order/afterSale_step_one/afterSale_step_one",
"pages/order/afterSale_step_two/afterSale_step_two",
"pages/order/afterSale_step_three/afterSale_step_three",
"pages/order/afterSaleDetail/afterSaleDetail"
"pages/order/afterSaleDetail/afterSaleDetail",
"pages/coupon/index/index",
"pages/coupon/success/success",
"pages/coupon/center/center",
"pages/coupon/detail/detail",
"pages/coupon/recommend/recommend",
"pages/coupon/usedDetail/usedDetail"
]
}
],
......
import kfMixin from './kfMixin'
import orderMixin from './orderMixin'
import afterSaleMixin from './afterSaleMixin'
module.exports = {
kfMixin,
orderMixin,
afterSaleMixin,
}
// const kf_list = [{
// sapCode: 5036,
// url: 'https://work.weixin.qq.com/kfid/kfc82ffd378b8649621'
// },
// {
// sapCode: 5028,
// url: 'https://work.weixin.qq.com/kfid/kfcd636da4134201fbb'
// },
// {
// sapCode: 5016,
// url: 'https://work.weixin.qq.com/kfid/kfcdef92056fc8ef091'
// },
// ]
module.exports = Behavior({
data: {},
methods: {
filterKfList(data) {
let showKF = false,
customerlist = [],
kfUrl = ''
if (data.customerServerType) {
if (data.customerServerType == 1)
customerlist[0] = {
thumbAvatar: data.customerServerAvatar,
staffName: data.customerServerName,
qrCode: data.customerServerOrCode
}
else kfUrl = data.customerServerUrl
showKF = true
}
this.setData({
showKF,
kfUrl,
customerlist
})
},
openKF(e) {
let { kfUrl, widgetStatus } = this.data
if (kfUrl)
wx.openCustomerServiceChat({
extInfo: {
url: kfUrl
},
corpId: 'wx51bda2e574d24a91',
success(res) {
console.log(res)
},
fail({ errMsg }) {
console.log(errMsg)
wx.$api.showToast(errMsg)
}
})
else
this.setData({
widgetStatus: !widgetStatus
})
}
}
})
Page({
data: {
couponsList: []
},
toReciveAll() {
let para = {
couponIdList: this.data.ids
}
wx.p.api.couponsApi.toReciveCard(para).then(res => {
if (res) {
wx.p.router.go('/packageMine/pages/coupon/success/success')
}
})
},
/**获取礼券 */
getCoupons() {
let para = {
discountTypes: [3]
}
let ids = []
wx.p.api.couponsApi.getHomeCardData(para).then(res => {
res.list.map(item => {
if (item.effectiveStartTime) {
item.effectiveStartTime = new Date(item.effectiveStartTime).format('yyyy.MM.dd')
item.effectiveEndTime = new Date(item.effectiveEndTime).format('yyyy.MM.dd')
}
ids.push(item.id)
return item
})
this.setData({
couponsList: res.list,
ids
})
})
},
onLoad() {
this.getCoupons()
}
})
{
"navigationBarTitleText": "领券中心",
"usingComponents": {
"coupon-item": "../components/CouponsItem/element"
}
}
\ No newline at end of file
page {
background: #F7F8FA;
}
.center-page {
box-sizing: border-box;
padding: 0 32rpx;
}
.btn_wrapper {
/* width: calc(100% - 64rpx); */
width: 100%;
background: #FC5B32;
height: 88rpx;
text-align: center;
line-height: 88rpx;
border-radius: 8rpx;
font-size: 32rpx;
color: #FFFFFF;
margin-top: 100rpx;
margin-bottom: 210rpx;
/* position: fixed;
bottom: 210rpx;
left: 50%;
transform: translate(-50%, 0);
z-index: 10; */
}
\ No newline at end of file
<view class="center-page">
<block wx:for="{{couponsList}}" wx:key="index">
<coupon-item mode="center" coupons="{{item}}"></coupon-item>
</block>
<view class="btn_wrapper" bind:tap="toReciveAll">一键领取</view>
</view>
\ No newline at end of file
Component({
properties: {
coupons: {
type: Object,
value: {}
},
mode: {
type: String,
value: 'coupon' //coupon卡券 center领券中心
},
btnStatus: {
type: Number,
value: 0
},
useMemberType: Number,
hideBtn: Boolean,
couponStyle: String
},
data: {
// 2 折扣券,3 代金券,4 兑换券,7 服务券
IMGURL: wx.$imgUrl
},
methods: {
toRecive() {
let para = {
couponIdList: [this.data.coupons.id]
}
wx.p.api.couponsApi.toReciveCard(para).then(res => {
if (res) {
wx.p.router.go('/packageMine/pages/coupon/success/success')
}
})
},
toDetail() {
let {
coupons,
useMemberType
} = this.data, {
discountType,
useChannel,
id
} = coupons, detailInfo = {
xx: 'xx'
}
if (discountType == 2 || discountType == 4) {
wx.$router.go('/packageMall/pages/coupon/coupon', {
userCouponId: id,
useMemberType,
detailInfo
})
return
}
/**线上商品代金券 */
if (discountType == 3 && useChannel == 1) {
wx.$router.go('/packageMine/pages/coupon/recommend/recommend', {
couponInfo: coupons
})
return
}
wx.$router.go('/packageMine/pages/coupon/detail/detail', {
item: coupons
})
}
}
})
\ No newline at end of file
{
"component": true
}
\ No newline at end of file
<!-- <view class="box_wrapper" style="{{couponStyle}}; background-image: url({{btnStatus == 0 ? couponBaseList[coupons.discountType]:unCouponBaseList[coupons.discountType]}});"> -->
<view class="box_wrapper" style="{{couponStyle}}">
<view class="bg">
<image webp src="{{IMGURL}}mine/coupon/{{btnStatus == 0 ? '' :'un-'}}coupon-{{coupons.discountType}}.png?v={{img_version}}"></image>
</view>
<view class="container">
<view class="{{coupons.discountType==4 || coupons.discountType==7 ? '':'left_icon_box'}}">
<!-- <image wx:if="{{btnStatus==0}}" class="left_bg" src="../../packageMine/images/coupons/coupons_active.png" />
<image wx:else class="left_bg" src="../../packageMine/images/coupons/coupons.png" /> -->
<!-- <view wx:if="{{coupons.discountType==7}}" class="left_text_one left_text_four">
<text class="anText">券</text>
<text wx:if="{{coupons.useType&&coupons.effectiveType!=3}}">{{ coupons.usedAmount }}/{{ coupons.useAllAmount }}</text>
<text wx:else>不限次数</text>
</view> -->
<view wx:if="{{coupons.discountType==3}}" class="left_text_one left_text_two {{btnStatus == 0 ? 'brightColor':'darkColor'}}">
<text class="price_icon">¥</text>
<text>{{coupons.denomination}}</text>
</view>
<view wx:if="{{coupons.discountType==2}}" class="left_text_one left_text_two {{btnStatus == 0 ? 'brightColor':'darkColor'}}">
<!-- <text class="anText">券</text> -->
<text class="anText" wx:if="{{coupons.discountIntensity}}">{{coupons.discountIntensity}}</text>
<text class="discount" wx:if="{{coupons.discountIntensity}}">折</text>
</view>
<!-- <view class="left_text_one">8.5折</view> -->
<!-- <view class="left_text_one left_text_two">
</view> -->
<!-- <view class="left_text_one left_text_three">满99可用</view> -->
</view>
<view class="main_box {{coupons.discountType==4 || coupons.discountType==7 ? 'leftMargin':''}}">
<view class="title_text {{btnStatus == 0 ? 'brightColor':'darkColor'}}">{{coupons.couponName}}</view>
<view wx:if="{{coupons.useType==0 && coupons.discountType==7}}" class="h4_text {{btnStatus == 0 ? 'describeColor':'darkColor'}}">不限次数</view>
<view wx:if="{{coupons.useType==1 && coupons.discountType==7}}" class="h4_text {{btnStatus == 0 ? 'describeColor':'darkColor'}}">可用{{coupons.useAmount}}次</view>
<view wx:if="{{coupons.useType==2 && coupons.discountType==7}}" class="h4_text {{btnStatus == 0 ? 'describeColor':'darkColor'}}">{{coupons.useLimitDays}}天可用{{coupons.useAmount}}次</view>
<!-- <view wx:if="{{coupons.discountType==3}}" style="height:1px" class="drive"></view> -->
<view wx:if="{{coupons.useBarriers==1 && coupons.discountType!=4}}" class="h4_text {{btnStatus == 0 ? 'describeColor':'darkColor'}}">无门槛</view>
<view wx:if="{{coupons.useBarriers==2 && coupons.discountType!=4}}" class="h4_text {{btnStatus == 0 ? 'describeColor':'darkColor'}}">满{{coupons.full}}元可用</view>
<view wx:if="{{coupons.effectiveType==3}}" class="h4_text {{btnStatus == 0 ? 'describeColor':'darkColor'}}">永久有效</view>
<view wx:if="{{coupons.effectiveType==2}}" class="h4_text {{btnStatus == 0 ? 'describeColor':'darkColor'}}">{{coupons.receiveStartTime}}-{{coupons.receiveEndTime}}</view>
<view wx:if="{{coupons.effectiveType==1}}" class="h4_text {{btnStatus == 0 ? 'describeColor':'darkColor'}}">有效期至{{coupons.receiveEndTime}}</view>
<!-- <view wx:else class="h4_text drive">{{coupons.receiveStartTime}}-{{coupons.receiveEndTime}}</view> -->
<!-- <view wx:if="{{coupons.effectiveType==1}}" class="h4_text drive">{{coupons.effectiveStartTime}}-{{coupons.effectiveEndTime}}</view> -->
</view>
<!-- <view wx:if="{{mode=='center'}}" class="box_btn box_btn_color" bind:tap="toRecive">领取</view> -->
<block wx:if="{{!hideBtn}}">
<view wx:if="{{mode=='coupon'&&btnStatus==0}}" class="box_btn box_btn_color" bind:tap="toDetail">去使用</view>
<view wx:if="{{mode=='coupon'&&btnStatus==1}}" class="box_btn box_btn_color box_btn_color_grey" bind:tap="toDetail">去查看</view>
<view wx:if="{{mode=='coupon'&&btnStatus==2}}" class="box_btn box_btn_color box_btn_color_grey" bind:tap="toDetail">去查看</view>
</block>
</view>
</view>
\ No newline at end of file
page {
background: white;
}
.box_wrapper {
width: 100%;
height: 162rpx;
/* background: #FFFFFF; */
/* border-radius: 8rpx; */
margin-top: 19rpx;
display: flex;
align-items: center;
position: relative;
box-sizing: border-box;
background-size: cover;
}
.left_icon_box {
width: 156rpx;
height: 156rpx;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
position: relative;
}
.left_bg {
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
width: 156rpx;
height: 156rpx;
z-index: 1;
}
.left_text_one {
font-size: 48rpx;
font-weight: 600;
z-index: 2;
}
.left_text_two {
display: flex;
align-items: flex-end;
}
.left_text_four {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
.left_text_three {
font-size: 20rpx;
margin-top: 6rpx;
}
.left_tran {
transform: translateX(-120rpx);
}
.anText {
font-size: 48rpx;
/* color: rgba(white, white, white, 0.45); */
font-weight: 600;
/* color: #FFF; */
/* opacity: 0.45; */
}
.price_icon {
font-size: 24rpx;
/* margin-right: 4rpx; */
margin-bottom: 7rpx;
font-weight: 500;
}
.main_box {
height: 156rpx;
box-sizing: border-box;
padding: 24rpx 24rpx 24rpx 0rpx;
justify-content: space-evenly;
display: flex;
flex-direction: column;
z-index: 1;
}
.box_btn {
position: absolute;
right: 47rpx;
top: 50%;
transform: translate(0, -50%);
width: 120rpx;
height: 44rpx;
/* background: #B1B1B3; */
text-align: center;
line-height: 44rpx;
font-size: 28rpx;
font-weight: 600;
}
.box_btn_color {
/* background: var(--btnColor); */
color: var(--btnColor);
}
.box_btn_color_grey {
color: #6D6D6D;
}
.title_text {
color: #282829;
font-weight: 600;
color: #282829;
font-size: 28rpx;
width: 309rpx;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.h4_text {
font-weight: 400;
color: #B1B1B3;
font-size: 20rpx;
}
.leftMargin {
padding-left: 32rpx;
}
.brightColor {
color: #FC5B32;
}
.darkColor {
color: #6D6D6D;
}
.describeColor {
color: #D83C14;
}
.discount {
font-size: 20rpx;
font-weight: 500;
margin-bottom: 10rpx;
}
.box_wrapper .bg{
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
.box_wrapper .container {
display: flex;
align-items: center;
position: relative;
z-index: 1;
width: 100%;
height: 100%;
}
import QR from '~/lib/wxqrcode'
Page({
data: {
coupon: {
discountType: 7
},
detailInfo: {},
failure: false,
future: false,
dayDiff: 0,
hourDiff: 0,
minDiff: 0
},
jump(e) {
let { item } = e.currentTarget.dataset
wx.openLocation({
latitude: item.lat,
longitude: item.lng,
name: item.merchantName,
address: item.merchantAddress
})
},
getDetailData(id) {
let para = {
userCouponId: id
}
wx.$api.showLoading('加载中...')
wx.p.api.couponsApi.couponsDetail(para).then(res => {
wx.hideLoading()
let qrcodeURL = QR.createQrCodeImg(`t=2&c=${res.verificationCode}`)
let failure = false
let future = false
res.receiveTime = new Date(res.receiveTime).format('yyyy.MM.dd hh:mm:ss')
res.verificationCode = res.verificationCode.replace(/(.{4})/g, '$1 ')
if (res.couponState == 2) {
failure = true
} else if (res.couponState == 1) {
failure = false
} else if (res.couponState == 3) {
future = true
} else if (res.couponState == 4) {
future = true
} else if (res.couponState == 5) {
failure = true
}
let dayDiff = 0
let hourDiff = 0
let minDiff = 0
if (future) {
dayDiff = res.nextLimitDays
hourDiff = res.nextLimitHours
minDiff = res.nextLimitMin
}
if (res.list.length) {
res.list.map(el => {
el.verificationTime = new Date(el.verificationTime).format('yyyy-MM-dd hh:mm:ss')
return el
})
}
res.receiveEndTime = new Date(res.receiveEndTime).format('yyyy.MM.dd hh:mm:ss')
res.receiveStartTime = new Date(res.receiveStartTime).format('yyyy.MM.dd hh:mm:ss')
this.setData({
detailInfo: res,
future,
failure,
dayDiff,
hourDiff,
minDiff,
qrcodeURL,
coupon: res,
flag: true
})
})
},
onLoad(options) {
let couponInfo = options.item
this.getDetailData(couponInfo.id)
this.setData({
couponInfo
})
// wx.$Track.setTrack(
// {
// couponInfo
// },
// 6
// )
}
})
{
"navigationBarTitleText": "卡券详情",
"usingComponents": {
"coupon-item": "../components/CouponsItem/element"
}
}
\ No newline at end of file
page {
background: #F7F8FA !important;
/* background: #f5f5f5; */
}
.detail-page {
box-sizing: border-box;
padding: 32rpx 32rpx 20rpx;
}
.an-page {
box-sizing: border-box;
padding: 32rpx;
}
.wrapper {
width: 100%;
background: #FFFFFF;
border-radius: 8rpx;
}
.top_element_wrap {
display: flex;
box-sizing: border-box;
border-bottom: 2rpx solid #EFF0F2;
}
.coupon {
height: 196rpx;
border-radius: 8rpx;
margin: 0 32rpx;
}
.icon_box {
width: 156rpx;
height: 156rpx;
display: flex;
align-items: center;
justify-content: center;
position: relative;
}
.ele_icon {
position: absolute;
width: 100%;
height: 100%;
left: 0;
right: 0;
top: 0;
bottom: 0;
z-index: 1;
}
.icon_text {
font-size: 36rpx;
font-family: PingFangSC-Semibold, PingFang SC;
font-weight: 600;
color: #FFFFFF;
position: relative;
z-index: 2;
}
.ele_conetent_box {
box-sizing: border-box;
padding-left: 20rpx;
}
.title_wrap {
margin-top: 64rpx;
box-sizing: border-box;
padding-left: 20rpx;
}
.code_wrap {
margin-top: 36rpx;
box-sizing: border-box;
width: 100%;
text-align: center;
}
.code-text {
font-size: 64rpx;
font-family: DINAlternate-Bold, DINAlternate;
font-weight: bold;
color: #FC5B32;
letter-spacing: 20rpx;
}
.code_box {
width: calc(100% - 64rpx);
height: 140rpx;
background: #979797;
margin: 0 auto;
margin-top: 36rpx;
}
.html-wrap {
width: 100%;
box-sizing: border-box;
padding: 0 20rpx;
word-wrap: break-word;
}
.title-text {
font-size: 28rpx;
font-weight: 600;
color: #282829;
margin-top: 4rpx;
}
.min-text {
font-size: 24rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #B1B1B3;
margin-top: 2rpx;
}
.date-text {
margin-top: 38rpx;
}
.code-tip {
margin-top: 10rpx;
text-align: center;
}
.drive_line {
width: 100%;
height: 2rpx;
background: #EFF0F2;
}
.shop_info_wrap {
box-sizing: border-box;
padding: 0 20rpx;
margin-top: 24rpx;
}
.shop_header {
display: flex;
align-items: center;
}
.header_img {
width: 40rpx;
height: 40rpx;
border-radius: 50%;
}
.shop_title {
color: #282829;
font-size: 28rpx;
padding-left: 28rpx;
font-weight: 400;
}
.shop_adress {
width: 100%;
font-size: 24rpx;
font-weight: 400;
color: #656566;
margin-top: 24rpx;
}
.shop_date {
font-size: 24rpx;
font-weight: 400;
color: #656566;
margin-top: 8rpx;
}
/* 服务券 */
.other_wrapper {
width: 100%;
}
.an_title_text {
font-size: 32rpx;
font-weight: 500;
color: #333;
margin-bottom: 20rpx;
}
.an_min_title_text {
text-align: center;
font-size: 22rpx;
font-weight: 500;
color: #B1B1B3;
margin-top: 10rpx;
}
/* .code_widget {
width: 100%;
height: 364rpx;
box-sizing: border-box;
background: #FEFFFE;
border-radius: 8rpx;
margin-top: 32rpx;
padding: 32rpx 0;
padding-top: 32rpx;
padding-bottom: 32rpx;
position: relative;
} */
.code_failture {
position: absolute;
left: 50%;
top: 154rpx;
transform: translate(-50%, 0);
padding: 10rpx 44rpx;
color: #FFFFFF;
background: #999999;
border-radius: 16rpx;
}
.code_future {
position: absolute;
left: 50%;
top: 144rpx;
transform: translate(-50%, 0);
padding: 10rpx 50rpx;
color: #FC5B32;
background: #FDDED5;
border-radius: 16rpx;
}
.code_text_red {
font-size: 28rpx;
text-align: center;
line-height: 40rpx;
}
.mar5 {
margin-bottom: 10rpx;
}
.iamge_qr_wrap {
width: 280rpx;
height: 280rpx;
position: relative;
margin: 24rpx auto;
}
.qrcodeimage {
width: 280rpx;
height: 280rpx;
}
.qrBtn {
/* position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
width: 236rpx;
height: 64rpx; */
display: flex;
/* align-items: center; */
justify-content: center;
/* background: #FFFFFF;
border: 2rpx solid #979797;
box-shadow: 0px 4rpx 8rpx 0px rgba(0, 0, 0, 0.29);
border-radius: 16rpx; */
font-size: 28rpx;
margin: 24rpx 0 12rpx;
/* line-height: 40px; */
/* color: #656566;
font-weight: 400; */
}
.qrBtns {
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
display: flex;
align-items: center;
justify-content: center;
font-size: 28rpx;
font-weight: 400;
color: #FFFFFF;
line-height: 32rpx;
width: 181rpx;
height: 84rpx;
background: #000;
border-radius: 8rpx;
opacity: 0.7;
}
.op30 {
opacity: 0.3;
}
.qrText {
color: #FC5B32;
}
.code_main_text {
text-align: center;
display: flex;
align-items: center;
justify-content: center;
font-size: 32rpx;
}
.count_text {
margin-left: 10rpx;
font-weight: 600;
}
/* .useed_widget {
width: 100%;
height: 554rpx;
box-sizing: border-box;
background: #FEFFFE;
margin-top: 32rpx;
padding: 32rpx 0;
border-radius: 8rpx;
} */
.step_wrapper {
display: flex;
align-items: center;
justify-content: center;
margin-top: 40rpx;
}
.step_icon {
width: 92rpx;
height: 92rpx;
margin-bottom: 20rpx;
}
.step_arrpw {
width: 46rpx;
height: 33rpx;
margin: 0 24rpx;
}
.step_box {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.desc_wrapper {
padding: 0 24rpx;
color: #B1B1B3;
font-size: 28rpx;
margin-top: 40rpx;
}
.note_line {
box-sizing: border-box;
/* padding: 0 24rpx; */
/* margin-bottom: 20rpx; */
line-height: 48rpx;
/* display: flex;
align-items: center;
justify-content: space-between; */
}
.line_text {
font-size: 24rpx;
color: #666;
}
.price_icon {
font-size: 20rpx;
margin-right: 4rpx;
}
.code_text_grey {
color: #B1B1B3;
}
.box {
padding: 0 32rpx 40rpx 32rpx;
}
.box-X {
border-radius: 8rpx;
background-color: #fff;
padding: 24rpx 24rpx 40rpx;
}
.box .title {
font-size: 32rpx;
padding-bottom: 24rpx;
font-weight: 500;
}
.box .goods {
margin-top: 24rpx;
display: flex;
align-items: center;
height: 160rpx;
}
.box .goods .icon {
width: 160rpx;
height: 100%;
overflow: hidden;
border-radius: 8rpx;
margin-right: 20rpx;
}
.box .goods .info {
width: calc(100% - 180rpx);
height: 100%;
display: flex;
flex-direction: column;
justify-content: space-between;
}
.box .goods .info .name {
font-size: 30rpx;
color: #333;
}
.box .goods .info .price {
display: flex;
color: var(--btnColor);
font-weight: 500;
}
.box .goods .info .price-X {
margin-top: -8rpx;
font-size: 36rpx;
font-family: DINAlternate-Bold, DINAlternate;
}
.couponBox {
border-radius: 8rpx;
background-color: #fff;
padding: 32rpx 32rpx 20rpx 32rpx;
margin: 0 0 20rpx;
box-shadow: 0rpx 8rpx 16rpx 0rpx rgba(224, 224, 224, 0.5);
}
.note_line .line_text_name {
font-size: 28rpx;
color: #333;
}
.note_line .line {
height: 2rpx;
background: #EEE;
margin: 16rpx 0 14rpx;
}
.couponBox .couponBox-X {
max-width: 610rpx;
line-height: 48rpx;
}
.couponBox .couponBox-X .titleDay {
font-size: 28rpx;
font-weight: 500;
color: #333;
}
.titleDay_text {
font-size: 24rpx;
color: #666;
}
.darkColor {
color: #666;
}
.couponBox .title {
font-size: 32rpx;
font-weight: 500;
color: #333;
}
.couponBox .store-box {
background: #F9F9F9;
border: 2rpx solid #E9E9E9;
border-radius: 8rpx;
padding: 16rpx 32rpx;
margin-bottom: 18rpx;
}
.couponBox .store-box:last-child {
margin-bottom: 0;
}
.couponBox .storeName {
font-size: 28rpx;
color: #333;
margin-bottom: 8rpx;
}
.couponBox .businessTime {
font-size: 24rpx;
color: #999;
padding-bottom: 18rpx;
}
.couponBox .line {
height: 2rpx;
background: #EEE;
}
.couponBox .addressBox {
padding-top: 20rpx;
font-size: 24rpx;
color: #666;
display: flex;
align-items: center;
}
.couponBox .addressBox .navigation {
width: 32rpx;
height: 32rpx;
}
.timeColor {
color: #999;
}
.changeColor {
color: #333;
}
.numberColor {
color: #B4B4B4;
}
.couponBox .topBox {
display: flex;
}
.couponBox .topBox .baseImage {
width: 140rpx;
height: 138rpx;
background-size: cover;
position: absolute;
right: 24rpx;
top: 22rpx;
}
.couponBox .topBox .title_text {
font-size: 36rpx;
font-weight: 600;
margin-bottom: 20rpx;
max-width: 510rpx;
}
.couponBox .lines {
height: 2rpx;
background: #EEE;
margin: 32rpx 0 30rpx;
}
.couponBox .process {
display: flex;
align-items: center;
justify-content: center;
margin-bottom: 4rpx;
}
.process .process_text {
margin-left: 4rpx;
font-size: 24rpx;
color: #333;
}
.process image {
width: 24rpx;
height: 24rpx;
}
.process .rightArrow {
padding: 0 40rpx;
}
\ No newline at end of file
// index.js
// 获取应用实例
Page({
data: {
tabs: ['店铺优惠券', '权益优惠券'],
curTabIndex: 0,
couponsList: [],
imgBaseURL: 'https://img01.glsx.com.cn/weapp/resource/equity-h5-new/mini/',
showGiftsModal: false,
giftsList: [],
haveCouponsList: []
},
jump(e) {
let {
item
} = e.currentTarget.dataset
// console.log(e)
let url = '/packageMine/pages/order/detail/detail'
wx.p.router.go(url, item)
},
state(e) {
let {
key
} = e.currentTarget.dataset
let {
couponsList,
haveCouponsList
} = this.data
couponsList[key].checkCoupon = !couponsList[key].checkCoupon
if (!couponsList[key].checkCoupon) {
couponsList[key].userCouponList = haveCouponsList[key].slice(0, 4)
} else {
couponsList[key].userCouponList = haveCouponsList[key]
}
this.setData({
couponsList
})
},
changeTab(e) {
let {
showLogin
} = this.data
if(showLogin) return
this.data.haveCouponsList = []
this.setData({
curTabIndex: e.detail,
couponsList: [],
flag: false
})
this.getCouponsList()
},
bottomToRefresh(e) {
let isBottom = e.detail.direction
if (isBottom == 'bottom') {
//刷新下一页
}
},
getCouponsList() {
wx.p.wxApi.showLoading('加载中...')
let {
curTabIndex,
isMerchant
} = this.data
let {merchantId} = wx.p.storage.get('merchant_info')
let para = {
useMemberType: 0
}
if (curTabIndex == 1) para.discountType = 8 //线上优惠券加上这个参数
if (!isMerchant) para.merchantId = merchantId
wx.p.api.couponsApi.getCardData(para).then(res => {
wx.hideLoading()
// console.log(res);
let list = res.map(item => {
item.checkCoupon = false
item.userCouponList.map((itm, index) => {
itm.receiveStartTime = new Date(itm.receiveStartTime).format('yyyy.MM.dd')
if (itm.effectiveType == 1) {
itm.receiveEndTime = new Date(itm.receiveEndTime).format('yyyy.MM.dd hh:mm:ss')
} else {
itm.receiveEndTime = new Date(itm.receiveEndTime).format('yyyy.MM.dd')
}
itm.discountIntensity = itm.discountIntensity / 100
return itm
})
this.data.haveCouponsList.push(item.userCouponList)
return item
})
list = res.map(item => {
if (item.userCouponList.length > 4 && curTabIndex != 1) {
item.userCouponList = item.userCouponList.slice(0, 4)
}
return item
})
this.setData({
couponsList: list,
haveCouponsList: this.data.haveCouponsList,
flag: true
})
})
},
async onLoad(options) {
console.log(options)
const showLogin = await wx.p.router.intercept(false)
this.setData({
showLogin
})
//判断只展示当前门店的
if (options.isMerchant == 1) {
this.setData({
isMerchant: true
})
}
if (options.pageFrom == 'directional') {
this.setData({
showGiftsModal: true,
giftsList: options.list
})
}
this.getCouponsList()
},
// ***********定向礼包相关内容***********
clickClose() {
this.setData({
showGiftsModal: false
})
},
goInvolidPage() {
wx.p.router.go('../usedDetail/usedDetail', {
isOnline: this.data.curTabIndex
})
},
// 去使用
toUseGifts(e) {
let {
item
} = e.currentTarget.dataset
let {
discountType,
useChannel,
id
} = item
if (discountType == 2 || discountType == 4) {
wx.p.router.go('/packageMall/pages/coupon/coupon', {
userCouponId: id,
useMemberType: item.useMemberType
})
return
}
/**线上商品代金券 */
if (discountType == 3 && useChannel == 1) {
if (item.useMemberType == 1) {
wx.p.wxApi.showToast('代金券已使用')
return
}
wx.p.router.go('/packageMine/pages/coupon/recommend/recommend', {
couponInfo: item
})
return
}
wx.p.router.go('/packageMine/pages/coupon/detail/detail', {
item
})
},
toUseConpon(e) {
const {
brandName,
goodsId,
id,
goodsLogo,
appearance,
goodsName,
couponId
} = e.currentTarget.dataset.item
let path = '/packageEquity/pages/commodity/detail/detail'
let param = {
supplier: 'HW',
brandName,
id: goodsId,
couponsId: id,
couponId
}
if (appearance == 2) {
path = '/packageEquity/pages/commodity/chargeDetail/chargeDetail'
param.productName = goodsName
param.icon = goodsLogo
}
wx.p.router.go(path, {
inType: 'game',
param
})
}
})
\ No newline at end of file
{
"usingComponents": {
"coupon-item": "../components/CouponsItem/element",
"tab":"/components/Tab/Tab"
},
"navigationBarTitleText": "我的卡券"
}
\ No newline at end of file
/* packageMine/pages/coupon/index/index.wxss */
/**index.wxss**/
::-webkit-scrollbar {
width: 0;
height: 0;
color: transparent;
}
page {
background: #F7F8FA;
}
.tab_widget {
width: 100%;
height: 92rpx;
background: #FFFFFF;
}
.tab_element {
width: 120rpx;
height: 92rpx;
position: relative;
color: #707071;
font-size: 36rpx;
display: flex;
align-items: center;
justify-content: center;
font-weight: 400;
}
.tab_element_active {
font-size: 40rpx;
color: #2D2D2E;
font-weight: 500;
}
.active_tab_line {
width: 48rpx;
height: 8rpx;
background: #FC5B32;
border-radius: 2rpx;
position: absolute;
left: 50%;
bottom: 0;
transform: translate(-50%, 0);
}
.content_widget {
box-sizing: border-box;
/* padding: 0 32rpx; */
}
.box_wrapper {
width: 100%;
box-sizing: border-box;
padding: 20rpx;
display: flex;
align-items: center;
position: relative;
margin-top: 24rpx;
}
.left_icon_box {
width: 156rpx;
height: 156rpx;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
position: relative;
}
.left_bg {
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
width: 156rpx;
height: 156rpx;
z-index: 1;
}
.left_text_one {
font-size: 36rpx;
font-weight: 600;
color: #FFFFFF;
z-index: 2;
}
.left_text_two {
display: flex;
align-items: flex-end;
}
.left_text_three {
font-size: 20rpx;
margin-top: 6rpx;
}
.price_icon {
font-size: 20rpx;
margin-right: 4rpx;
}
.main_box {
height: 156rpx;
box-sizing: border-box;
padding: 4rpx 0 4rpx 20rpx;
}
.box_btn {
position: absolute;
right: 20rpx;
top: 50%;
transform: translate(0, -50%);
width: 120rpx;
height: 44rpx;
background: #B1B1B3;
border-radius: 22rpx;
color: #FFF;
font-size: 20rpx;
text-align: center;
line-height: 44rpx;
}
.title_text {
color: #282829;
font-weight: 600;
color: #282829;
font-size: 28rpx;
}
.h4_text {
font-weight: 400;
color: #B1B1B3;
font-size: 24rpx;
}
.drive {
margin-top: 38rpx;
}
.involid_btn{
display: flex;
justify-content: center;
}
.view_involid{
height: 48rpx;
line-height: 48rpx;
border: 2rpx solid #999999;
border-radius: 24rpx;
color: #999999;
width: 204rpx;
text-align: center;
/* display: flex;
align-items: center;
justify-content: center; */
}
.view_involid .text{
height: 48rpx;
line-height: 48rpx;
}
.view_involid .right{
width: 24rpx;
height: 24rpx;
vertical-align: middle;
}
.no_data {
padding-top: 48rpx;
display: flex;
flex-direction: column;
align-items: center;
margin-bottom: 36rpx;
}
.nodata_bg {
width: 320rpx;
height: 320rpx;
}
.nodata_text {
color: #B1B1B3;
font-size: 28rpx;
line-height: 44rpx;
margin-top: 8rpx;
}
/* 定向礼包弹框 */
.flex_ccc {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.gifts_modal {
position: fixed;
left: 0;
right: 0;
top: 0;
right: 0;
background: rgba(0, 0, 0, 0.66);
width: 100%;
height: 100%;
z-index: 999999;
}
.gifts_wrap {
width: 100%;
height: 100%;
}
.gifts_wrapper {
width: 100%;
/* height: 337rpx; */
position: relative;
}
/*自定义背景颜色*/
.custom_banner_wrap{
width: 86%;
min-height: 170rpx;
/* background: linear-gradient(-180deg, #FE7534, #FF4815); */
position: absolute;
top:51.3%;
left: 50%;
transform: translateX(-50%);
z-index: -1;
/* border-radius:0 0 32rpx 32rpx; */
}
.custom_box{
height: 170rpx;
}
.gifts_modal_bg {
width: 87.3%;
height: 51.3%;
}
.gifts_modal_btn {
width: 39%;
height: 102rpx;
margin-top: 56rpx;
}
.gifts_content_wrap {
width: calc(87.3% - 52rpx);
height: 64%;
/* background: #FFFFFF; */
position: absolute;
left: 50%;
bottom: 6rpx;
transform: translate(-50%, 0);
overflow-x: hidden;
overflow-y: scroll;
}
.gifts_modal_bottom_bg {
position: absolute;
left: 50%;
bottom: 6rpx;
transform: translate(-50%, 0);
width: 83.2%;
height: 87rpx;
}
.gifts_item_wrap {
width: 100%;
height: 170rpx;
position: relative;
}
.gifts_item_bg {
width: 100%;
height: 170rpx;
}
.gifts_po_wrap {
position: absolute;
left: 0;
top: 0;
height: 170rpx;
width: 100%;
display: flex;
align-items: center;
justify-content: space-between;
}
.left_widget {
box-sizing: border-box;
padding:0 0 0 40rpx;
width: 70%;
}
.coup_title{
font-size: 30rpx;
font-weight: 400;
color: #1A1919;
width: 70%;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.coup_tip {
font-size: 24rpx;
font-weight: 400;
color: #817F7C;
margin-top: 19rpx;
}
.right_widget{
padding-right: 32rpx;
}
.gifts_to_use_bg{
width: 120rpx;
height: 46rpx;
}
/**小于2的样式*/
.mini_widget{
width: 100%;
min-height: 207rpx;
}
.mini_header_bg{
width: 87.3%;
height: 207rpx;
}
.mini_box_wrap{
width: 86.3%;
height: 281rpx;
position: relative;
box-sizing: border-box;
padding: 0 29rpx;
}
.mini_box_bg{
width: 100%;
height: 345rpx;
position: absolute;
top: -54rpx;
left: 0;
right: 0;
z-index: -1;
}
.storeName {
margin-top: 30rpx;
font-size: 32rpx;
font-weight: 500;
color: #282829;
/* display: inline-block; */
}
.storeWidth {
max-width: 477rpx;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.stretch {
font-size: 32rpx;
font-weight: 500;
color: #999;
margin-left: 10rpx;
}
.stretchColor {
color: #FC5B32;
font-size: 32rpx;
font-weight: 500;
margin-left: 10rpx;
}
/* .listWidth {
max-height: 810rpx;
overflow: hidden;
white-space: nowrap;
} */
.checkList {
justify-content: center;
margin-top: 18rpx;
}
.checkList .check {
font-size: 24rpx;
color: #999;
}
.state {
width: 24rpx;
height: 24rpx;
margin-left: 10rpx;
}
.associatedOrder {
display: flex;
font-size: 24rpx;
padding-top: 8rpx;
}
.associatedOrder .order {
color: #666;
}
.associatedOrder .order-X {
color: #333;
max-width: 337rpx;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.associatedOrder .checkOrder {
color: #FC5B32;
position: absolute;
right: 0;
}
.online_conpon_ctnr{
margin-top: 32rpx;
}
.online_conpon{
height: 156rpx;
background: #FFF5F3;
border-radius: 8rpx;
padding: 8rpx;
display: flex;
}
.online_conpon .price_wrap{
padding-left: 16rpx;
display: flex;
flex-direction: column;
justify-content: center;
width: 154rpx;
flex-shrink: 0;
color: #FC5B32;
}
.price_wrap .num{
height: 84rpx;
font-weight: 600;
font-size: 42rpx;
color: #FC5B32;
}
.price_wrap .unit{
height: 28rpx;
font-weight: 500;
font-size: 20rpx;
color: #FC5B32;
vertical-align: text-top;
margin-left: 4rpx;
}
.price_wrap .tip{
height: 34rpx;
font-weight: 400;
font-size: 24rpx;
color: #D83C14;
}
.online_conpon .info_wrap{
flex: 1;
background-color: #fff;
padding: 16rpx 12rpx 16rpx 24rpx;
display: flex;
flex-direction: column;
justify-content: space-between;
position: relative;
}
.info_wrap .name{
height: 80rpx;
font-weight: 600;
font-size: 28rpx;
color: #333333;
line-height: 40rpx;
}
.info_wrap .remark,.info_wrap .date{
height: 28rpx;
line-height: 20rpx;
font-weight: 400;
font-size: 20rpx;
color: #D83C14;
}
.info_wrap .use_btn{
position: absolute;
width: 136rpx;
height: 48rpx;
line-height: 48rpx;
background-image: linear-gradient(90deg, #FC5B32 2%, #FF1A33 96%);
border-radius: 23rpx;
color: #fff;
text-align: center;
right: 12rpx;
bottom: 16rpx;
}
.isFullSucreen-btn{
padding-bottom: constant(safe-area-inset-bottom) !important;
padding-bottom: env(safe-area-inset-bottom) !important;
}
\ No newline at end of file
<view class="coupons_container">
<view class="tab_widget">
<tab tab="{{tabs}}" bindclick="changeTab"></tab>
</view>
<block wx:if="{{showLogin}}">
<view class="no_data">
<glsx-image webp class="nodata_bg" src="coupons/no_card_bg.png" />
<view class="nodata_text">暂无优惠券</view>
</view>
</block>
<block wx:else>
<block wx:if="{{flag}}">
<view wx:if="{{couponsList.length}}" style="height:-116rpx;padding-bottom: 35rpx;" class="content_widget">
<scroll-view scroll-y="{{true}}" style="height:100%;padding: 0 32rpx;box-sizing: border-box;" class="scroll_wrap" bindscrolltolower="bottomToRefresh">
<!-- listWidth -->
<view wx:for="{{couponsList}}" wx:key="index">
<block wx:if="{{curTabIndex == 0}}">
<view class="flex storeName">
<text class="storeWidth">{{item.merchantName}}</text>
<text class="{{curTabIndex == 0 ? 'stretchColor':'stretch'}}">({{item.couponAmount}}张)</text>
</view>
<block wx:for="{{item.userCouponList}}" wx:for-item="i" wx:key="id">
<coupon-item btnStatus="{{curTabIndex}}" coupons="{{i}}" useMemberType="{{curTabIndex}}"></coupon-item>
<view class="associatedOrder" wx:if="{{i.goodsOrderCode && curTabIndex == 1}}">
<view class="order">该券已用在订单:</view>
<view class="order-X" catchtap="jump" data-item="{{i.goodsOrderCode}}">{{i.goodsName}}</view>
<view class="checkOrder" catchtap="jump" data-item="{{i.goodsOrderCode}}">查看订单></view>
</view>
</block>
<block wx:if="{{haveCouponsList[index].length > 4}}">
<view class="flex checkList" wx:if="{{!item.checkCoupon}}" catchtap="state" data-key="{{index}}">
<view class="check">查看剩余所有券</view>
<glsx-image webp class="state" src="mine/coupon/down.png" />
</view>
<view class="flex checkList" wx:else catchtap="state" data-key="{{index}}">
<view class="check">收起</view>
<glsx-image webp class="state" src="mine/coupon/up.png" />
</view>
</block>
</block>
<block wx:else>
<view class="online_conpon_ctnr" wx:for="{{item.userCouponList}}" wx:for-item="i" wx:key="id">
<view class="online_conpon">
<view class="price_wrap">
<view>
<text class="num">{{i.denomination || 0}}</text>
<text class="unit">元</text>
</view>
<view class="tip">无门槛</view>
</view>
<view class="info_wrap">
<view class="name">{{i.brandName ? i.brandName + '·' : ''}}{{i.appearance == 2 ? i.goodsName + i.rechargeDenomination : i.goodsName}}</view>
<!-- <view class="remark">无门槛</view> -->
<view class="date" wx:if="{{i.discountType == 8}}">数量:{{i.amount}}</view>
<view class="date" wx:if="{{i.discountType != 8}}">有效期{{i.effectiveDays || 0}}天</view>
<view class="date" wx:else>剩余有效期:{{i.residueEffectiveDays || 0}}天</view>
<view class="use_btn" bindtap="toUseConpon" data-item="{{i}}">去使用</view>
</view>
</view>
</view>
</block>
</view>
</scroll-view>
</view>
<view wx:else class="no_data">
<glsx-image webp class="nodata_bg" src="coupons/no_card_bg.png" />
<view class="nodata_text">暂无优惠券</view>
</view>
<view class="involid_btn isFullSucreen-btn">
<view class="view_involid" bindtap="goInvolidPage">
<text class="text">查看失效券</text>
<glsx-image class="right" src="mine/right.png?v=1.0.0"></image>
</view>
</view>
</block>
<!-- 定向礼包弹框 -->
<view wx:if="{{showGiftsModal}}" class="gifts_modal flex_ccc">
<view class="gifts_wrap flex_ccc">
<view wx:if="{{giftsList.length>2}}" class="gifts_wrapper flex_ccc">
<image webp mode="widthFix" class="gifts_modal_bg" src="{{imgBaseURL}}gifts_list_bg.png" />
<view class="gifts_content_wrap">
<view wx:for="{{giftsList}}" class="gifts_item_wrap">
<image webp mode="widthFix" class="gifts_item_bg" src="{{imgBaseURL}}gifts_coupons_bg.png" />
<view class="gifts_po_wrap">
<view class="left_widget">
<view class="coup_title">{{item.couponName}}</view>
<view wx:if="{{item.effectiveType==3}}" class="coup_tip">无限期</view>
<view wx:if="{{item.effectiveType==2}}" class="coup_tip">有效期:{{item.receiveStartTime}}-{{item.receiveEndTime}}</view>
<view wx:if="{{item.effectiveType==1}}" class="coup_tip">有效至{{item.receiveEndTime}}</view>
</view>
<view class="right_widget">
<image webp mode="widthFix" bind:tap="toUseGifts" data-item="{{item}}" class="gifts_to_use_bg" src="{{imgBaseURL}}gifts_touse.png" />
</view>
</view>
</view>
<view style="height:88rpx"></view>
</view>
<image webp mode="widthFix" class="gifts_modal_bottom_bg" src="{{imgBaseURL}}gifts_fixed_bottom.png" />
</view>
<view wx:if="{{giftsList.length<3}}" class="mini_widget flex_ccc">
<image webp mode="widthFix" class="mini_header_bg" src="{{imgBaseURL}}gifts_header_bg.png" />
<view class="mini_box_wrap" style="height:{{giftsList.length==2?408:298}}rpx">
<image webp class="mini_box_bg" style="height:{{giftsList.length==2?450:340}}rpx" src="{{imgBaseURL}}gifts_box_bg.png" />
<view style="height:50rpx"></view>
<view wx:for="{{giftsList}}" class="gifts_item_wrap">
<image webp mode="widthFix" class="gifts_item_bg" src="{{imgBaseURL}}gifts_coupons_bg.png" />
<view class="gifts_po_wrap">
<view class="left_widget">
<view class="coup_title">{{item.couponName}}</view>
<view wx:if="{{item.effectiveType==3}}" class="coup_tip">无限期</view>
<view wx:if="{{item.effectiveType==2}}" class="coup_tip">有效期:{{item.receiveStartTime}}-{{item.receiveEndTime}}</view>
<view wx:if="{{item.effectiveType==1}}" class="coup_tip">有效至{{item.receiveEndTime}}</view>
</view>
<view class="right_widget">
<image webp mode="widthFix" bind:tap="toUseGifts" data-item="{{item}}" class="gifts_to_use_bg" src="{{imgBaseURL}}gifts_touse.png" />
</view>
</view>
</view>
</view>
</view>
<image webp mode="widthFix" bind:tap="clickClose" class="gifts_modal_btn" src="{{imgBaseURL}}gifts_comfirm_btn.png" />
</view>
</view>
</block>
</view>
\ No newline at end of file
// packageMine/pages/coupon/recommend/recommend.js
Page({
/**
* 页面的初始数据
*/
data: {
list: [],
pageNum: 1,
detailInfo: {}
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
if(options.id){
// 领取记录id 优惠券id 门店id
this.setData({
couponInfo: { merchantId:options.merchantId,couponId:options.couponId }
},()=>{
this.getDetailData(options.id)
})
return
}
this.setData(options, () => {
this.getDetailData(options.couponInfo.id)
})
},
jump(e) {
let { item } = e.currentTarget.dataset
wx.openLocation({
latitude: item.lat,
longitude: item.lng,
name: item.merchantName,
address: item.merchantAddress
})
},
jumpCommodity(e) {
let { item } = e.currentTarget.dataset
// console.log('item',item);
let { id } = item
let isActivity = false
if (this.data.couponInfo.merchantId == this.data.userInfo.merchantId) {
wx.p.router.go('/packageMall/pages/detail/detail', { id, isActivity, notIntercept: true })
} else {
wx.p.wxApi.showToast('其他门店商品,暂不支持查看')
}
},
getDetailData(id) {
let para = {
userCouponId: id
}
wx.p.wxApi.showLoading('加载中...')
wx.p.api.couponsApi.couponsDetail(para).then(res => {
res.receiveEndTime = new Date(res.receiveEndTime).format('yyyy.MM.dd hh:mm:ss')
res.receiveStartTime = new Date(res.receiveStartTime).format('yyyy.MM.dd hh:mm:ss')
res.receiveTime = new Date(res.receiveTime).format('yyyy.MM.dd hh:mm:ss')
this.setData(
{
detailInfo: res,
flag: true
},
() => {
this.getCouponGoodsPage()
}
)
})
},
getCouponGoodsPage() {
// wx.p.wxApi.showLoading()
let total = 0
let {
list,
pageNum,
couponInfo: { merchantId },
couponInfo: { couponId, id }
} = this.data
wx.p.api.shopmallApi
.getCouponGoodsPage({
pageNum,
couponId: couponId || id,
merchantId
})
.then(data => {
console.log(data)
this.setData({
list: [...list, ...data.list],
total,
listFlag: true
})
wx.hideLoading()
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
let { pageNum, total } = this.data
wx.p.wxApi.onReachBottom(
{
pageNum,
total
},
() => {
this.getCouponGoodsPage()
}
)
}
})
{
"navigationBarTitleText": "卡券详情",
"usingComponents": {
"coupon-item": "../components/CouponsItem/element"
}
}
/* packageMine/pages/coupon/recommend/recommend.wxss */
page {
background-color: #F7F8FA !important;
}
.layout{
padding-top: 24rpx;
padding-bottom: 24rpx;
}
.coupon {
height: 203rpx;
/* background: rgba(252, 91, 50, 0.05); */
/* border-radius: 8rpx; */
margin: 0 24rpx;
position: relative;
}
.coupon .bg {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
.coupon .info {
position: relative;
z-index: 2;
display: flex;
width: 100%;
height: 100%;
}
.tips {
font-size: 28rpx;
color: #b1b1b3;
text-align: center;
margin: 32rpx 0 20rpx;
}
.goods-box{
display: flex;
flex-wrap: wrap;
justify-content: space-between;
padding: 0 32rpx ;
}
.goods{
width: 328rpx;
height: 520rpx;
margin-bottom: 32rpx;
position: relative;
}
.coupon .left_box {
width: 255rpx;
height: 150rpx;
color: #FFFFFF;
font-size: 56rpx;
font-weight: 600;
text-align: center;
line-height: 150rpx;
}
.coupon .left_box .price_icon {
font-size: 24rpx;
font-weight: 500;
}
.coupon .right_box {
padding: 28rpx 28rpx 0 28rpx;
width: 464rpx;
}
.top_box {
height: 120rpx;
border-bottom: 2rpx dashed rgba(216, 60, 20, 0.1);
}
.top_box .voucherName {
font-size: 28rpx;
font-weight: 600;
padding-bottom: 8rpx;
}
.h4_text {
font-size: 20rpx;
font-weight: 400;
}
.brightColor {
color: #FC5B32;
}
.darkColor {
color: #666;
}
.describeColor {
color: #D83C14;
}
.timeColor {
color: #999;
}
.bottom_box {
height: 42rpx;
line-height: 42rpx;
}
.box {
border-radius: 8rpx;
background-color: #fff;
padding: 32rpx 32rpx 20rpx 32rpx;
margin: 20rpx 32rpx 0;
box-shadow: 0rpx 8rpx 16rpx 0rpx rgba(224, 224, 224, 0.5);
}
.box .title {
font-size: 32rpx;
font-weight: 500;
padding-bottom: 24rpx;
color: #333;
}
.box .good {
display: flex;
padding-bottom: 12rpx;
}
.box .good .icon {
width: 144rpx;
height: 144rpx;
}
.box .good .icon image {
border-radius: 8rpx;
}
.box .lines {
height: 2rpx;
background: #EFF0F2;
margin: 20rpx 0 32rpx 0;
}
.box .good .info {
margin-left: 32rpx;
}
.box .good .info .name {
font-size: 28rpx;
color: #282829;
}
.box .good .info .price {
display: flex;
margin-top: 50rpx;
font-size: 36rpx;
font-weight: 600;
color: #FC5B32;
}
.box .good .info .price .price-X {
margin-left: 10rpx;
}
.box .store-box {
background: #F9F9F9;
border: 2rpx solid #E9E9E9;
border-radius: 8rpx;
padding: 16rpx 32rpx;
margin-bottom: 18rpx;
}
.box .store-box:last-child {
margin-bottom: 0;
}
.box .storeName {
font-size: 28rpx;
color: #333;
margin-top: -4rpx;
}
.box .businessTime {
font-size: 24rpx;
color: #999;
margin-top: 4rpx;
padding-bottom: 18rpx;
}
.box .line {
height: 2rpx;
background: #EEE;
}
.box .addressBox {
padding-top: 20rpx;
font-size: 24rpx;
color: #666;
display: flex;
align-items: center;
}
.box .addressBox .navigation {
width: 32rpx;
height: 32rpx;
}
.box .box-X {
max-width: 610rpx;
line-height: 48rpx;
}
.box .box-X .titleDay {
font-size: 28rpx;
font-weight: 500;
color: #333;
}
.box .box-X .titleDay_text {
font-size: 24rpx;
color: #666;
}
\ No newline at end of file
<block wx:if="{{flag}}">
<view class="layout">
<!-- <view class="coupon" style="background-image: url({{detailInfo.useMemberType == 0 ? onlineCouponBaseList[0]:onlineCouponBaseList[1]}});"> -->
<!-- <coupon-item coupons="{{couponInfo}}" hideBtn couponStyle="background:transparent"></coupon-item> -->
<view class="coupon">
<glsx-image webp src="mine/coupon/daijin{{detailInfo.useMemberType == 0 == 1?'':'-lose'}}.png" class="bg"></glsx-image>
<view class="info">
<view class="left_box">
<text class="price_icon">¥</text>
<text>{{detailInfo.denomination / 100}}</text>
</view>
<view class="right_box">
<view class="top_box">
<view class="voucherName {{detailInfo.useMemberType == 0 ? 'brightColor':''}}">{{couponInfo.couponName}}</view>
<view wx:if="{{(couponInfo.useBarriers==1 && couponInfo.discountType!=4) || (detailInfo.useBarriers==1 && detailInfo.discountType!=4)}}" class="h4_text {{detailInfo.useMemberType == 0 ? 'describeColor':'darkColor'}}">无门槛</view>
<view wx:if="{{(couponInfo.useBarriers==2 && couponInfo.discountType!=4) || (detailInfo.useBarriers==2 && detailInfo.discountType!=4)}}" class="h4_text {{detailInfo.useMemberType == 0 ? 'describeColor':'darkColor'}}">满{{detailInfo.full / 100}}元可用</view>
</view>
<view class="bottom_box">
<view wx:if="{{couponInfo.effectiveType==3 || detailInfo.effectiveType==3}}" class="h4_text timeColor">永久有效</view>
<view wx:if="{{couponInfo.effectiveType==2 || detailInfo.effectiveType==2}}" class="h4_text timeColor">{{detailInfo.receiveStartTime}}-{{detailInfo.receiveEndTime}}</view>
<view wx:if="{{couponInfo.effectiveType==1 || detailInfo.effectiveType==1}}" class="h4_text timeColor">有效期至{{detailInfo.receiveEndTime}}</view>
</view>
</view>
</view>
</view>
<view class="box" style="padding-bottom: 32rpx;">
<view class="box-X" style="padding-bottom: 16rpx;">
<view class="titleDay">有效日期:</view>
<view wx:if="{{couponInfo.effectiveType==3 || detailInfo.effectiveType==3}}" class="titleDay_text darkColor">永久有效</view>
<view wx:if="{{couponInfo.effectiveType==2 || detailInfo.effectiveType==2}}" class="titleDay_text darkColor">{{detailInfo.receiveStartTime}}-{{detailInfo.receiveEndTime}}</view>
<view wx:if="{{couponInfo.effectiveType==1 || detailInfo.effectiveType==1}}" class="titleDay_text darkColor">有效期至{{detailInfo.receiveEndTime}}</view>
</view>
<view class="box-X" style="padding-bottom: 16rpx;">
<view class="titleDay">获取日期:</view>
<view class="titleDay_text darkColor">{{detailInfo.receiveTime}}</view>
</view>
<view class="box-X" style="line-height: 44rpx;">
<view class="titleDay">使用说明:</view>
<view class="titleDay_text darkColor" style="white-space:pre-wrap">{{detailInfo.useDescription || ''}}</view>
</view>
</view>
<view class="box" wx:if="{{list.length}}">
<view class="title">适用商品</view>
<block wx:for="{{list}}" wx:key="index">
<view class="good" catchtap="jumpCommodity" data-item="{{item}}">
<view class="icon">
<image webp src="{{item.goodsImage}}"></image>
</view>
<view class="info">
<view class="name">{{item.goodsName}}</view>
<view class="price">
¥<view class="price-X">{{item.retailPrice / 100}}</view>
</view>
</view>
</view>
<view class="lines" wx:if="{{index < list.length - 1}}"></view>
</block>
</view>
<view class="box" style="margin-bottom: 32rpx;" wx:if="{{detailInfo.suitMerchantLists && detailInfo.suitMerchantLists.length}}">
<view class="title">适用门店</view>
<view wx:for="{{detailInfo.suitMerchantLists}}" wx:key="index" class="store-box">
<view class="storeName">{{item.merchantName}}</view>
<view wx:if="{{item.bussinessBegintime}}" class="businessTime">营业时间:{{item.bussinessBegintime}}-{{item.bussinessEndtime}}</view>
<view wx:else class="businessTime">营业时间:无</view>
<view class="line" wx:if="{{item.merchantAddress}}"></view>
<view class="addressBox" wx:if="{{item.merchantAddress}}">
<view style="width: 552rpx;padding-right: 24rpx;">{{item.merchantAddress}}</view>
<view class="navigation" catchtap="jump" data-item="{{item}}">
<glsx-image webp src="mine/icon-go.png"></glsx-image>
</view>
</view>
</view>
</view>
<!-- <view class="tips">- 为你推荐 -</view>
<view class="goods-box">
<block wx:if="{{listFlag}}">
<block wx:if="{{list.length}}">
<block wx:for="{{list}}" wx:key="index">
<view class="goods">
<goods item="{{item}}"></goods>
</view>
</block>
<block wx:if="{{nothing}}">
<view class="list-nothing ">到底啦!!</view>
</block>
</block>
<block wx:else>
<view class="list-nothing">
暂无可使用商品
</view>
</block>
</block>
</view> -->
</view>
</block>
\ No newline at end of file
Page({
data: {
count: 5
},
countDown() {
let count = this.data.count
this.data.countDownTime = setInterval(() => {
if (count == 0) {
clearInterval(this.data.countDownTime);
this.goToIndex()
return;
}
count--;
this.setData({
count
})
}, 1 * 1000);
},
goToIndex() {
wx.p.router.switchTab('/pages/tab/index/index')
},
goToCoupons() {
clearInterval(this.data.countDownTime);
wx.p.router.redirectTo('/packageMine/pages/coupon/index/index')
},
onUnload() {
clearInterval(this.data.countDownTime);
},
onLoad() {
this.countDown()
}
})
\ No newline at end of file
{
"navigationBarTitleText": "领取成功"
}
\ No newline at end of file
/* packageMine/pages/coupon/success/success.wxss */
\ No newline at end of file
<view class="success_page">
<!-- <image webp class="success_icon" src="../../../../images/coupons/success.png" /> -->
<image webp class="success_icon" src="{{IMGURL}}coupons/success.png?v={{img_version}}" />
<view class="success_text">您的优惠礼券领取成功!</view>
<view class="success_count">{{count}}秒后自动跳转到首页</view>
<view class="success_btn_wrap btn_pos">
<view class="btn_box btn_orage" bind:tap="goToCoupons">使用优惠券</view>
</view>
<view class="success_btn_wrap">
<view bind:tap="goToIndex" class="btn_box">回到首页</view>
</view>
</view>
\ No newline at end of file
page {
background: #F7F8FA;
}
.success_page {
display: flex;
flex-direction: column;
align-items: center;
}
.success_icon {
width: 140rpx;
height: 140rpx;
border-radius: 50%;
margin-top: 112rpx;
}
.success_text {
font-weight: 500;
color: #282829;
font-size: 32rpx;
margin-top: 84rpx;
}
.success_count {
font-weight: 400;
color: #B1B1B3;
font-size: 28rpx;
margin-top: 20rpx;
}
.success_btn_wrap {
position: fixed;
bottom: 270rpx;
left: 0;
right: 0;
box-sizing: border-box;
padding: 0 32rpx;
}
.btn_box {
width: 100%;
height: 88rpx;
text-align: center;
line-height: 88rpx;
color: #B1B1B3;
font-size: 32rpx;
border-radius: 8rpx;
border: 2rpx solid #B1B1B3;
}
.btn_orage {
background: #FC5B32;
border: 2rpx solid #FC5B32;
color: #FFFFFF;
}
.btn_pos {
bottom: 390rpx;
}
\ No newline at end of file
// index.js
// 获取应用实例
Page({
data: {
tabs: ['已使用', '已失效'],
curTabIndex: 0,
couponsList: [],
imgBaseURL: 'https://img01.glsx.com.cn/weapp/resource/equity-h5-new/mini/',
showGiftsModal: false,
giftsList: [],
haveCouponsList: []
},
jump(e) {
let {
item
} = e.currentTarget.dataset
// console.log(e)
let url = '/packageMine/pages/order/detail/detail'
// if (orderStatus > 5 && orderStatus != 14 && orderStatus != 13&&orderStatus != 15) url = 'afterSaleDetail'
wx.p.router.go(url, item)
// wx.navigateTo({
// url: '/packageMine/pages/order/detail/detail?orderCode=S2112081509592138'
// })
},
state(e) {
let {
key
} = e.currentTarget.dataset
let {
couponsList,
haveCouponsList
} = this.data
couponsList[key].checkCoupon = !couponsList[key].checkCoupon
if (!couponsList[key].checkCoupon) {
couponsList[key].userCouponList = haveCouponsList[key].slice(0, 4)
} else {
couponsList[key].userCouponList = haveCouponsList[key]
}
this.setData({
couponsList
})
},
changeTab(e) {
this.data.haveCouponsList = []
this.setData({
curTabIndex: e.detail,
couponsList: [],
flag: false
})
this.getCouponList()
},
bottomToRefresh(e) {
let isBottom = e.detail.direction
if (isBottom == 'bottom') {
//刷新下一页
}
},
getCouponList() {
wx.p.wxApi.showLoading('加载中...')
let {
curTabIndex,
isMerchant,
isOnline
} = this.data
let {
merchantId
} = wx.p.storage.get('merchant_info')
let para = {
useMemberType: curTabIndex + 1
}
if (isOnline == 1) para.discountType = 8 //线上优惠券加上这个参数
if (!isMerchant) para.merchantId = merchantId
wx.p.api.couponsApi.getCardData(para).then(res => {
wx.hideLoading()
// console.log(res);
let list = res.map(item => {
item.checkCoupon = false
item.userCouponList.map((itm, index) => {
itm.receiveStartTime = new Date(itm.receiveStartTime).format('yyyy.MM.dd')
if (itm.effectiveType == 1) {
itm.receiveEndTime = new Date(itm.receiveEndTime).format('yyyy.MM.dd hh:mm:ss')
} else {
itm.receiveEndTime = new Date(itm.receiveEndTime).format('yyyy.MM.dd')
}
itm.discountIntensity = itm.discountIntensity / 100
return itm
})
this.data.haveCouponsList.push(item.userCouponList)
return item
})
list = res.map(item => {
if (item.userCouponList.length > 4 && isOnline != 1) {
item.userCouponList = item.userCouponList.slice(0, 4)
}
return item
})
this.setData({
couponsList: list,
haveCouponsList: this.data.haveCouponsList,
flag: true
})
})
},
onLoad(options) {
if (options.pageFrom == 'directional') {
this.setData({
showGiftsModal: true,
giftsList: options.list
})
}
this.setData({
isMerchant: true,
isOnline: options.isOnline
})
//判断只展示当前门店的
// if (isMerchant == 1) {
// this.setData({
// isMerchant: true
// })
// }
this.getCouponList()
},
// ***********定向礼包相关内容***********
clickClose() {
this.setData({
showGiftsModal: false
})
},
// 去使用
toUseGifts(e) {
let {
item
} = e.currentTarget.dataset
let {
discountType,
useChannel,
id
} = item
if (discountType == 2 || discountType == 4) {
wx.p.router.go('/packageMall/pages/coupon/coupon', {
userCouponId: id,
useMemberType: item.useMemberType
})
return
}
/**线上商品代金券 */
if (discountType == 3 && useChannel == 1) {
if (item.useMemberType == 1) {
wx.p.wxApi.showToast('代金券已使用')
return
}
wx.p.router.go('/packageMine/pages/coupon/recommend/recommend', {
couponInfo: item
})
return
}
wx.p.router.go('/packageMine/pages/coupon/detail/detail', {
item
})
wx.navigateTo({
url: '/?item=' + temp
})
}
})
\ No newline at end of file
{
"usingComponents": {
"coupon-item": "../components/CouponsItem/element",
"tab":"/components/Tab/Tab"
},
"navigationBarTitleText": "我的卡券"
}
\ No newline at end of file
/* packageMine/pages/coupon/index/index.wxss */
/**index.wxss**/
::-webkit-scrollbar {
width: 0;
height: 0;
color: transparent;
}
page {
background: #F7F8FA;
}
.tab_widget {
width: 100%;
height: 92rpx;
background: #FFFFFF;
}
.tab_element {
width: 120rpx;
height: 92rpx;
position: relative;
color: #707071;
font-size: 36rpx;
display: flex;
align-items: center;
justify-content: center;
font-weight: 400;
}
.tab_element_active {
font-size: 40rpx;
color: #2D2D2E;
font-weight: 500;
}
.active_tab_line {
width: 48rpx;
height: 8rpx;
background: #FC5B32;
border-radius: 2rpx;
position: absolute;
left: 50%;
bottom: 0;
transform: translate(-50%, 0);
}
.content_widget {
box-sizing: border-box;
/* padding: 0 32rpx; */
}
.box_wrapper {
width: 100%;
box-sizing: border-box;
padding: 20rpx;
display: flex;
align-items: center;
position: relative;
margin-top: 24rpx;
}
.left_icon_box {
width: 156rpx;
height: 156rpx;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
position: relative;
}
.left_bg {
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
width: 156rpx;
height: 156rpx;
z-index: 1;
}
.left_text_one {
font-size: 36rpx;
font-weight: 600;
color: #FFFFFF;
z-index: 2;
}
.left_text_two {
display: flex;
align-items: flex-end;
}
.left_text_three {
font-size: 20rpx;
margin-top: 6rpx;
}
.price_icon {
font-size: 20rpx;
margin-right: 4rpx;
}
.main_box {
height: 156rpx;
box-sizing: border-box;
padding: 4rpx 0 4rpx 20rpx;
}
.box_btn {
position: absolute;
right: 20rpx;
top: 50%;
transform: translate(0, -50%);
width: 120rpx;
height: 44rpx;
background: #B1B1B3;
border-radius: 22rpx;
color: #FFF;
font-size: 20rpx;
text-align: center;
line-height: 44rpx;
}
.title_text {
color: #282829;
font-weight: 600;
color: #282829;
font-size: 28rpx;
}
.h4_text {
font-weight: 400;
color: #B1B1B3;
font-size: 24rpx;
}
.drive {
margin-top: 38rpx;
}
.involid_btn{
display: flex;
justify-content: center;
margin-top: 36rpx;
}
.view_involid{
height: 48rpx;
line-height: 48rpx;
border: 2rpx solid #999999;
border-radius: 24rpx;
color: #999999;
width: 204rpx;
text-align: center;
}
.no_data {
padding-top: 48rpx;
display: flex;
flex-direction: column;
align-items: center;
}
.nodata_bg {
width: 320rpx;
height: 320rpx;
}
.nodata_text {
color: #B1B1B3;
font-size: 28rpx;
line-height: 44rpx;
margin-top: 8rpx;
}
/* 定向礼包弹框 */
.flex_ccc {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.gifts_modal {
position: fixed;
left: 0;
right: 0;
top: 0;
right: 0;
background: rgba(0, 0, 0, 0.66);
width: 100%;
height: 100%;
z-index: 999999;
}
.gifts_wrap {
width: 100%;
height: 100%;
}
.gifts_wrapper {
width: 100%;
/* height: 337rpx; */
position: relative;
}
/*自定义背景颜色*/
.custom_banner_wrap{
width: 86%;
min-height: 170rpx;
/* background: linear-gradient(-180deg, #FE7534, #FF4815); */
position: absolute;
top:51.3%;
left: 50%;
transform: translateX(-50%);
z-index: -1;
/* border-radius:0 0 32rpx 32rpx; */
}
.custom_box{
height: 170rpx;
}
.gifts_modal_bg {
width: 87.3%;
height: 51.3%;
}
.gifts_modal_btn {
width: 39%;
height: 102rpx;
margin-top: 56rpx;
}
.gifts_content_wrap {
width: calc(87.3% - 52rpx);
height: 64%;
/* background: #FFFFFF; */
position: absolute;
left: 50%;
bottom: 6rpx;
transform: translate(-50%, 0);
overflow-x: hidden;
overflow-y: scroll;
}
.gifts_modal_bottom_bg {
position: absolute;
left: 50%;
bottom: 6rpx;
transform: translate(-50%, 0);
width: 83.2%;
height: 87rpx;
}
.gifts_item_wrap {
width: 100%;
height: 170rpx;
position: relative;
}
.gifts_item_bg {
width: 100%;
height: 170rpx;
}
.gifts_po_wrap {
position: absolute;
left: 0;
top: 0;
height: 170rpx;
width: 100%;
display: flex;
align-items: center;
justify-content: space-between;
}
.left_widget {
box-sizing: border-box;
padding:0 0 0 40rpx;
width: 70%;
}
.coup_title{
font-size: 30rpx;
font-weight: 400;
color: #1A1919;
width: 70%;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.coup_tip {
font-size: 24rpx;
font-weight: 400;
color: #817F7C;
margin-top: 19rpx;
}
.right_widget{
padding-right: 32rpx;
}
.gifts_to_use_bg{
width: 120rpx;
height: 46rpx;
}
/**小于2的样式*/
.mini_widget{
width: 100%;
min-height: 207rpx;
}
.mini_header_bg{
width: 87.3%;
height: 207rpx;
}
.mini_box_wrap{
width: 86.3%;
height: 281rpx;
position: relative;
box-sizing: border-box;
padding: 0 29rpx;
}
.mini_box_bg{
width: 100%;
height: 345rpx;
position: absolute;
top: -54rpx;
left: 0;
right: 0;
z-index: -1;
}
.storeName {
margin-top: 30rpx;
font-size: 32rpx;
font-weight: 500;
color: #282829;
/* display: inline-block; */
}
.storeWidth {
max-width: 477rpx;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.stretch {
font-size: 32rpx;
font-weight: 500;
color: #999;
margin-left: 10rpx;
}
.stretchColor {
color: #FC5B32;
font-size: 32rpx;
font-weight: 500;
margin-left: 10rpx;
}
/* .listWidth {
max-height: 810rpx;
overflow: hidden;
white-space: nowrap;
} */
.checkList {
justify-content: center;
margin-top: 18rpx;
}
.checkList .check {
font-size: 24rpx;
color: #999;
}
.state {
width: 24rpx;
height: 24rpx;
margin-left: 10rpx;
}
.associatedOrder {
display: flex;
font-size: 24rpx;
padding-top: 8rpx;
}
.associatedOrder .order {
color: #666;
}
.associatedOrder .order-X {
color: #333;
max-width: 337rpx;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.associatedOrder .checkOrder {
color: #FC5B32;
position: absolute;
right: 0;
}
.online_conpon_ctnr{
margin-top: 32rpx;
}
.online_conpon{
height: 156rpx;
background: #F1F1F1;
border-radius: 8rpx;
padding: 8rpx;
display: flex;
}
.online_conpon .price_wrap{
padding-left: 16rpx;
display: flex;
flex-direction: column;
justify-content: center;
width: 154rpx;
flex-shrink: 0;
color: #FC5B32;
}
.price_wrap .num{
height: 84rpx;
font-weight: 600;
font-size: 42rpx;
color: #6D6D6D;
}
.price_wrap .unit{
height: 28rpx;
font-weight: 500;
font-size: 20rpx;
color: #6D6D6D;
vertical-align: text-top;
margin-left: 4rpx;
}
.price_wrap .tip{
height: 34rpx;
font-weight: 400;
font-size: 24rpx;
color: #6D6D6D;
}
.online_conpon .info_wrap{
flex: 1;
background-color: #fff;
padding: 16rpx 12rpx 16rpx 24rpx;
display: flex;
flex-direction: column;
justify-content: space-between;
position: relative;
}
.info_wrap .name{
height: 80rpx;
font-weight: 600;
font-size: 28rpx;
color: #333333;
line-height: 40rpx;
}
.info_wrap .remark,.info_wrap .date{
height: 28rpx;
line-height: 20rpx;
font-weight: 400;
font-size: 20rpx;
color: #6D6D6D;
}
.info_wrap .use_btn{
position: absolute;
width: 136rpx;
height: 48rpx;
line-height: 48rpx;
background-color: #B0B0B0;
border-radius: 23rpx;
color: #fff;
text-align: center;
right: 12rpx;
bottom: 16rpx;
}
\ No newline at end of file
<view class="coupons_container">
<view class="tab_widget">
<tab tab="{{tabs}}" bindclick="changeTab"></tab>
</view>
<block wx:if="{{flag}}">
<view wx:if="{{couponsList.length}}" style="height:-116rpx;padding-bottom: 35rpx;" class="content_widget">
<scroll-view scroll-y="{{true}}" style="height:100%;padding: 0 32rpx;box-sizing: border-box;" class="scroll_wrap" bindscrolltolower="bottomToRefresh">
<!-- listWidth -->
<view wx:for="{{couponsList}}" wx:key="index">
<block wx:if="{{isOnline!=1}}">
<view class="flex storeName">
<text class="storeWidth">{{item.merchantName}}</text>
<text class="'stretch'">({{item.couponAmount}}张)</text>
</view>
<block wx:for="{{item.userCouponList}}" wx:for-item="i" wx:key="id">
<coupon-item btnStatus="{{curTabIndex+1}}" coupons="{{i}}" useMemberType="{{curTabIndex+1}}"></coupon-item>
<view class="associatedOrder" wx:if="{{i.goodsOrderCode && curTabIndex == 0}}">
<view class="order">该券已用在订单:</view>
<view class="order-X" catchtap="jump" data-item="{{i.goodsOrderCode}}">{{i.goodsName}}</view>
<view class="checkOrder" catchtap="jump" data-item="{{i.goodsOrderCode}}">查看订单></view>
</view>
</block>
<block wx:if="{{haveCouponsList[index].length > 4}}">
<view class="flex checkList" wx:if="{{!item.checkCoupon}}" catchtap="state" data-key="{{index}}">
<view class="check">查看剩余所有券</view>
<glsx-image webp class="state" src="mine/coupon/down.png" />
</view>
<view class="flex checkList" wx:else catchtap="state" data-key="{{index}}">
<view class="check">收起</view>
<glsx-image webp class="state" src="mine/coupon/up.png" />
</view>
</block>
</block>
<block wx:else>
<view class="online_conpon_ctnr" wx:for="{{item.userCouponList}}" wx:for-item="i" wx:key="id">
<view class="online_conpon">
<view class="price_wrap">
<view>
<text class="num">{{i.denomination || 0}}</text>
<text class="unit">元</text>
</view>
<view class="tip">无门槛</view>
</view>
<view class="info_wrap">
<view class="name">{{i.brandName ? i.brandName + '·' : ''}}{{i.appearance == 2 ? i.goodsName + i.rechargeDenomination : i.goodsName}}</view>
<view class="date" wx:if="{{i.discountType == 8}}">数量:{{i.amount}}</view>
<view class="date">有效期{{i.effectiveDays || 0}}天</view>
<view class="use_btn">去使用</view>
</view>
</view>
</view>
</block>
</view>
</scroll-view>
</view>
<view wx:else class="no_data">
<glsx-image webp class="nodata_bg" src="coupons/no_card_bg.png" />
<view class="nodata_text">暂无优惠券</view>
</view>
</block>
<!-- 定向礼包弹框 -->
<view wx:if="{{showGiftsModal}}" class="gifts_modal flex_ccc">
<view class="gifts_wrap flex_ccc">
<view wx:if="{{giftsList.length>2}}" class="gifts_wrapper flex_ccc">
<image webp mode="widthFix" class="gifts_modal_bg" src="{{imgBaseURL}}gifts_list_bg.png" />
<view class="gifts_content_wrap">
<view wx:for="{{giftsList}}" class="gifts_item_wrap">
<image webp mode="widthFix" class="gifts_item_bg" src="{{imgBaseURL}}gifts_coupons_bg.png" />
<view class="gifts_po_wrap">
<view class="left_widget">
<view class="coup_title">{{item.couponName}}</view>
<view wx:if="{{item.effectiveType==3}}" class="coup_tip">无限期</view>
<view wx:if="{{item.effectiveType==2}}" class="coup_tip">有效期:{{item.receiveStartTime}}-{{item.receiveEndTime}}</view>
<view wx:if="{{item.effectiveType==1}}" class="coup_tip">有效至{{item.receiveEndTime}}</view>
</view>
<view class="right_widget">
<image webp mode="widthFix" bind:tap="toUseGifts" data-item="{{item}}" class="gifts_to_use_bg" src="{{imgBaseURL}}gifts_touse.png" />
</view>
</view>
</view>
<view style="height:88rpx"></view>
</view>
<image webp mode="widthFix" class="gifts_modal_bottom_bg" src="{{imgBaseURL}}gifts_fixed_bottom.png" />
</view>
<view wx:if="{{giftsList.length<3}}" class="mini_widget flex_ccc">
<image webp mode="widthFix" class="mini_header_bg" src="{{imgBaseURL}}gifts_header_bg.png" />
<view class="mini_box_wrap" style="height:{{giftsList.length==2?408:298}}rpx">
<image webp class="mini_box_bg" style="height:{{giftsList.length==2?450:340}}rpx" src="{{imgBaseURL}}gifts_box_bg.png" />
<view style="height:50rpx"></view>
<view wx:for="{{giftsList}}" class="gifts_item_wrap">
<image webp mode="widthFix" class="gifts_item_bg" src="{{imgBaseURL}}gifts_coupons_bg.png" />
<view class="gifts_po_wrap">
<view class="left_widget">
<view class="coup_title">{{item.couponName}}</view>
<view wx:if="{{item.effectiveType==3}}" class="coup_tip">无限期</view>
<view wx:if="{{item.effectiveType==2}}" class="coup_tip">有效期:{{item.receiveStartTime}}-{{item.receiveEndTime}}</view>
<view wx:if="{{item.effectiveType==1}}" class="coup_tip">有效至{{item.receiveEndTime}}</view>
</view>
<view class="right_widget">
<image webp mode="widthFix" bind:tap="toUseGifts" data-item="{{item}}" class="gifts_to_use_bg" src="{{imgBaseURL}}gifts_touse.png" />
</view>
</view>
</view>
</view>
</view>
<image webp mode="widthFix" bind:tap="clickClose" class="gifts_modal_btn" src="{{imgBaseURL}}gifts_comfirm_btn.png" />
</view>
</view>
</view>
\ No newline at end of file
// components/banner/banner.js
Component({
/**
* 组件的属性列表
*/
properties: {
customerlist: {
type: Array,
value: []
},
show: Boolean
},
/**
* 组件的初始数据
*/
data: {},
/**
* 组件的方法列表
*/
methods: {
showFlex() {
this.setData({
show: false
})
},
// 保存客服企微二维码
saveClick() {
const [item] = this.data.customerlist
if (!item || !item.qrCode) return
wx.getSetting({
success(res) {
wx.downloadFile({
url: item.qrCode,
success: function (res) {
wx.saveImageToPhotosAlbum({
filePath: res.tempFilePath,
success: function (data) {
wx.showToast({
title: "保存成功",
icon: "success",
duration: 2000
});
},
fail: function (err) {
console.log(err);
},
complete(res) {
console.log(res);
}
});
}
});
}
});
}
}
})
\ No newline at end of file
{
"usingComponents": {
},
"component": true
}
\ No newline at end of file
<block wx:if="{{show}}">
<view class="model" catchtouchmove="noScroll">
<view class="bgkf">
<glsx-image webp src="home/home-kf-bg.png"></glsx-image>
<view class="close-icon" bindtap="showFlex">
<glsx-image webp src="home/kf-close.png"></glsx-image>
</view>
<view class="qr-box">
<view class="userinfo-wrap">
<view class="icon">
<image wx:if="{{customerlist[0].thumbAvatar}}" webp src="{{customerlist[0].thumbAvatar}}"></image>
<glsx-image wx:else webp src="home/kf-persion-icon.png"></glsx-image>
</view>
<view class="name">{{customerlist[0].staffName || ''}}</view>
<view class="mobile" wx:if="{{customerlist[0].staffPhone}}">
<glsx-image webp src="home/kf-mobile.png"></glsx-image>
<text>{{customerlist[0].staffPhone}}</text>
</view>
<view class="qr-icon">
<glsx-image webp src="home/home-kf-qr-bg.png"></glsx-image>
<view class="qr-code">
<image webp src="{{customerlist[0].qrCode}}" show-menu-by-longpress="{{customerlist[0].qrCode}}"></image>
</view>
</view>
</view>
</view>
<view class="kf-text">
<view class="text-left"><glsx-image webp src="home/home-Kf-down.png"></glsx-image><text>保存图片\n到相册</text></view>
<view><glsx-image webp src="home/home-Kf-phone.png"></glsx-image><text>打开微信扫一扫添加客服企微</text></view>
</view>
<view class="save-btn">
<view class="btn text-center" bindtap="saveClick">
保存
</view>
</view>
</view>
</view>
</block>
.model {
position: fixed;
left: 0;
right: 0;
top: 0;
right: 0;
background: rgba(0, 0, 0, 0.5);
width: 100%;
height: 100%;
z-index: 999999;
}
.close-icon{
width:48rpx;
height:48rpx;
position: absolute;
right: 16rpx;
top: -68rpx;
}
.close-icon image{
width:48rpx;
height:48rpx;
}
.model .bgkf {
width: 600rpx;
height: 700rpx;
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
margin: auto;
z-index: 99999;
}
.model .qr-box {
height: 560rpx;
width: 100%;
display: flex;
flex-flow: column;
justify-content: center;
align-items: center;
position: absolute;
top: 0;
left: 0;
}
.model .bgkf .icon {
width: 104rpx;
height: 104rpx;
border-radius: 50%;
position: absolute;
top: -28rpx;
}
.model .bgkf .icon image {
border-radius: 50%;
}
.userinfo-wrap {
display: flex;
align-items: center;
flex-direction: column
}
.qr-box .text {
font-size: 32rpx;
font-weight: 500;
color: #282829;
line-height: 44rpx;
}
.qr-box .name {
font-size: 36rpx;
font-weight: 500;
color: #282829;
line-height: 50rpx;
margin: 80rpx 0 0 0;
text-align: center;
}
.qr-box .mobile{
font-size: 32rpx;
font-weight: 500;
line-height: 44rpx;
display: inline-flex;
justify-content: center;
align-items: center;
margin-bottom: 20rpx;
}
.qr-box .mobile image{
width: 24rpx;
height: 26rpx;
}
.qr-box .qr-icon {
width: 284rpx;
height: 284rpx;
position: relative;
}
.qr-box .qr-code {
width: 220rpx;
height: 220rpx;
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
margin: auto;
}
.kf-text{
width:100%;
height:140rpx;
position: absolute;
bottom: 0;
z-index: 999998;
display: flex;
background: #F7F8FA;
border-radius: 0 0 10px 10px;
padding: 0 40rpx;
box-sizing: border-box;
}
.kf-text view{
flex: 1;
display: flex;
align-items: center;
justify-content: left;
font-weight: 400;
font-size: 12px;
margin-left: 20rpx;
color: #B1B1B3;
}
.kf-text image{
flex-shrink: 0;
width: 60rpx;
height: 60rpx;
margin-right: 12rpx;
}
.save-btn{
display: flex;
align-items: center;
justify-content: center;
margin-top: 32rpx;
}
.save-btn .btn{
width: 420rpx;
height: 80rpx;
background: var(--btnColor);
border-radius: 8rpx;
}
.save-btn .btn.text-center{
text-align: center;
line-height: 80rpx;
color: #ffffff;
font-size: 28rpx;
}
\ No newline at end of file
import {
kfMixin,
} from '~/mixins/index'
Page({
// behaviors: [kfMixin],
behaviors: [kfMixin],
/**
* 页面的初始数据
*/
......@@ -121,6 +124,7 @@ Page({
noticeContent,
bannerList
})
this.filterKfList(data)
})
},
changeTab(e) {
......
......@@ -5,7 +5,8 @@
"banner": "./components/banner/banner",
"good-tab": "./components/good-tab/good-tab",
"goods": "./components/goods/goods",
"activity": "./components/activity/activity"
"activity": "./components/activity/activity",
"customer": "./components/customer/customer"
},
"navigationStyle": "custom",
"onReachBottomDistance": 10,
......
......@@ -77,14 +77,12 @@ page {
padding: 10rpx 0;
}
.back-to-top {
background: #fff;
border-radius: 50%;
.wx {
position: fixed;
right: 24rpx;
right: 0;
bottom: 245rpx;
width: 60rpx;
height: 60rpx;
width: 96rpx;
height: 96rpx;
z-index: 100;
}
......
......@@ -72,10 +72,10 @@
</view>
</block>
</block>
<view class="back-to-top {{scrollToTop ? 'show-top': 'hidden-top'}}" bindtap="backTop">
<image webp src="{{IMGURL}}index/back-to-top.png"></image>
<view class="wx" bindtap="openKF">
<glsx-image webp src="home/wx.png"></glsx-image>
</view>
</view>
</block>
<!-- 客服 -->
<customer show="{{widgetStatus}}" customerlist="{{customerlist}}" bindclose="closeCustomer"></customer>
\ No newline at end of file
<customer model:show="{{widgetStatus}}" customerlist="{{customerlist}}"></customer>
\ No newline at end of file
<view class="navigation-bar">
<navigation-bar navStyle="background-color: transparent;" bindnavbarReady="navbarReady" page-title="个人中心">个人中心</navigation-bar>
<navigation-bar navStyle="background-color: transparent;" bindnavbarReady="navbarReady" page-title="会员中心">会员中心</navigation-bar>
</view>
<block wx:if="{{user_box_style}}">
<view class="layout mine">
......@@ -65,7 +65,7 @@
</block>
</view>
<!-- 我的券包 -->
<view class="coupon-box box flex">
<view class="coupon-box box flex" bindtap="jump" data-url="/packageMine/pages/coupon/index/index">
我的卡券
<view class="icon">
<glsx-image src="mine/mine-arrow.png"></glsx-image>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!