Commit 7a022bc898cc39686015e4ea7c07fc1385e137e6

Authored by pengye
1 parent 8adcbd2a

付费券、免费券详情、券列表页面修改

... ... @@ -21,6 +21,7 @@ Page({
is_time: false, //是否继续执行
timeList: [], //定时器列表
timers: null,
distance:'',
},
stopWaiting() {
for (var i = 0; i < this.data.timeList.length; i++) {
... ... @@ -34,7 +35,7 @@ Page({
this.setData({
id: options.id
})
console.log(this.data.id);
console.log('options',{...options});
this.getDetail('1')
},
... ... @@ -57,17 +58,21 @@ Page({
}).then(res => {
let detail = res.data;
let exp_date = detail.exp_date ? JSON.parse(detail.exp_date) : '';
let use = detail.activity.use ? JSON.parse(detail.activity.use) : '';
use.images = use && use.images ? JSON.parse(use.images) : '';
let date = Date.now() * 1;
if (date > detail.etime) {
detail.is_expire = '0';
} else {
detail.is_expire = '1';
}
detail.use = use;
this.setData({
detail,
exp_date
})
console.log('is_examine', detail.is_examine);
console.log('detail', {...detail});
console.log('exp_date', {...exp_date});
if (detail.is_examine == '0') {
this.setData({
is_time: true,
... ... @@ -122,6 +127,7 @@ Page({
},
// 获取商家信息
getSeller(sid) {
let that = this;
App.Customer.GetSellerDetail({
sid,
}).then(res => {
... ... @@ -138,13 +144,45 @@ Page({
})
cateStr = cateStr.join('/')
}
let distance = '';
let latitude = '';
let longitude = '';
let sellerObj = {
sellername: data.sellername,
sid: data.id,
seller_image: data.seller_image,
real_address: data.real_address,
cateStr
is_parking: data.is_parking,
average: data.average,
is_online_reserve: data.is_online_reserve,
phone: data.phone,
cateStr,
}
wx.getLocation({
type: 'wgs84', // 返回可以用于 wx.openLocation 的经纬度
success: function (res) {
latitude = res.latitude; // 纬度
longitude = res.longitude; // 经度
console.log(`当前的纬度: ${latitude}, 当前的经度: ${longitude}`);
if (latitude && longitude) {
console.log('dddddd',latitude, longitude, data.lat, data.long);
distance = that.getDistance(latitude, longitude, data.lat, data.long);
console.log('distancedistancedistance');
distance = parseInt(distance)
if (distance > 1000) {
distance = (distance / 1000).toFixed(2) + 'km'
} else {
distance += 'm';
}
that.setData({
distance
})
}
},
fail: function (err) {
console.error('获取位置失败:', err);
}
});
this.setData({
sellerObj
})
... ... @@ -153,6 +191,12 @@ Page({
});
})
},
// 拨打电话
callPhone() {
wx.makePhoneCall({
phoneNumber: this.data.sellerObj.phone
})
},
// 申请退款
subscribeDrawback() {
clearTimeout(this.timers)
... ... @@ -167,6 +211,22 @@ Page({
url: '/pages/reserve/shopHome?id=' + this.data.detail.sellerid
})
},
// 计算2点之间的距离
getDistance(lat1, lon1, lat2, lon2) {
const R = 6371e3; // 地球半径(米)
// 将经纬度转换为弧度
const φ1 = lat1 * Math.PI / 180; // 纬度1
const φ2 = lat2 * Math.PI / 180; // 纬度2
const Δφ = (lat2 - lat1) * Math.PI / 180; // 纬度差
const Δλ = (lon2 - lon1) * Math.PI / 180; // 经度差
// Haversine 公式
const a = Math.sin(Δφ / 2) * Math.sin(Δφ / 2) +
Math.cos(φ1) * Math.cos(φ2) *
Math.sin(Δλ / 2) * Math.sin(Δλ / 2);
const c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));
const distance = R * c; // 计算距离(米)
return distance; // 返回距离
},
/**
* 生命周期函数--监听页面隐藏
*/
... ...
<!--pack-activity/pack/examineCertificate.wxml 二维码验券页面-->
<wxs src="../../utils/util.wxs" module="util" />
<nav>{{detail.sellername}}</nav>
<view class="box_wrap">
<view class="top_box">
<view class="discount_name font40r">
{{detail.activity.aname}}
</view>
<view class="shop_name font28r">
{{detail.sellername}}
</view>
<!-- is_type 1店铺券 2个人券 是店铺券 && 需要验券-->
<view class="lineBox" wx:if="{{detail.activity.is_type=='1' && detail.activity.is_examine=='1'}}">
<view class="line" ></view>
<image wx:if="{{detail.is_examine=='1'}}" class="group" src="https://qn.colorcun.com/WechatIMG713.png" mode="" />
<image wx:if="{{detail.is_expire=='1'}}" class="group" src="https://qn.colorcun.com/WechatIMG714.png" mode="" />
</view>
<image wx:if="{{detail.qrcode && detail.activity.is_type=='1' && detail.activity.is_examine=='1'}}" class="qcode" src="{{detail.qrcode}}" mode="" />
<view class="orderNumber font28r" wx:if="{{detail.activity.is_type=='1' && detail.activity.is_examine=='1'}}">
{{detail.order_no}}
</view>
</view>
<view class="center_box">
<view class="info" wx:if="{{detail.activity.desc}}">
<view class="info_left font32r">
券要求
</view>
<view class="info_right font32r">
{{detail.activity.desc}}
</view>
</view>
<view class="info" wx:if="{{detail.stime}}">
<view class="info_left font32r">
有效期从
</view>
<view class="info_right font32r">
{{util.unixtoTime(detail.stime,'YYYY-MM-DD')}}
</view>
</view>
<view class="info">
<view class="info_left font32r" wx:if="{{detail.etime}}">
有效期至
</view>
<view class="info_right font32r">
{{util.unixtoTime(detail.etime,'YYYY-MM-DD')}}
</view>
</view>
<view wx:if="{{exp_date.is_none=='1' || exp_date.is_none===true}}" class="info">
<view class="info_left font32r">
使用限制:
</view>
<view class="info_right font32r">
无限制
</view>
</view>
<view wx:if="{{exp_date.is_birthday=='1' || exp_date.is_birthday===true}}" class="info">
<view class="info_left font32r">
使用限制:
</view>
<view class="info_right font32r">
会员生日当天
</view>
</view>
<view wx:if="{{exp_date.is_week=='1' || exp_date.is_week===true}}" class="week">
<view class="week_top">
<view class="week_left font32r">
充值日期限制:
</view>
<view class="texts font32r">
每周指定日期餐段可用
</view>
</view>
<text class="dateList texts font30r">
{{exp_date.week_show?exp_date.week_show+'可用':''}}
</text>
</view>
<view class="info info1" wx:if="{{detail.activity.explain}}">
<view class="info_left font32r">
券说明
</view>
</view>
<view class="explain_news">{{detail.activity.explain}}</view>
</view>
<view class="btns" wx:if="{{detail.is_examine!='1' && detail.is_expire!='1' && detail.price!='0'}}">
<button class="font24r" plain="true" bindtap="subscribeDrawback">申请退费</button>
</view>
<view class="canteen_box" bindtap="getReserve">
<image src="{{sellerObj.seller_image}}" mode="heightFix" />
<view class="info_right">
<view class="font36r sellerName">{{sellerObj.sellername}}</view>
<view class="font24r" wx:if="{{sellerObj.cateStr}}">{{sellerObj.cateStr}}</view>
<view class="font28r" wx:if="{{sellerObj.real_address}}">{{sellerObj.real_address}}</view>
</view>
</view>
<view class="bottom_box">
<view class="font24r">温馨提示:</view>
<view class="font24r">1、到店消费时,请您向餐厅出示该二维码。</view>
<view class="font24r">2、从<text class="bold_box">周到安排</text>微信小程序,我的-卡券,可以找到您的卡券。</view>
<!-- <view class="font24r">3、您也可以关注<text class="bold_box">周到安排</text>公众号,公众号菜单“优惠券”获取优惠券更多信息。</view> -->
<view class="font28r publicity" bindtap="wananchi">关注<text class="bold_box">周到安排</text>公众号,及时获取更多优惠券动态<view class="more" style="margin-left: 20rpx;"></view>
</view>
</view>
<view class="top_box">
<image src="https://qn.colorcun.com/voucherIcon1.png" mode="" />
<view class="texts">
<view class="font32r textName">{{detail.use.is_discount=='1'?'店铺折扣券':''}}{{detail.use.is_dish=='1'?'店铺菜品券':''}}{{detail.use.is_cash=='1'?'店铺代金券':''}}</view>
<view class="font24r threshold">
<block wx:if="{{detail.use.is_cash=='1'}}">
¥<text class="priceText">{{detail.price}}</text>
</block>
<block wx:if="{{detail.use.is_discount=='1'}}">
<text class="priceText">{{detail.use.discount}}折</text>
</block>
<text class="font24r" wx:if="{{detail.use.is_dish!='1' && detail.activity.desc}}">{{detail.activity.desc}}</text>
<text class="priceText" wx:if="{{detail.use.is_dish=='1'}}">{{detail.activity.aname}}</text>
</view>
</view>
</view>
<view class="center_box qrcodeBox">
<view class="infoText font28r">请向店员出示二维码,用于核销确认</view>
<image wx:if="{{detail.qrcode && detail.activity.is_type=='1' && detail.activity.is_examine=='1'}}" class="qcode" src="{{detail.qrcode}}" mode="" />
<view class="infoText font28r" wx:if="{{detail.activity.is_type=='1' && detail.activity.is_examine=='1'}}">
{{detail.order_no}}
</view>
</view>
<view class="center_box" wx:if="{{detail.use && (detail.use.dish || detail.use.images.length>0)}}">
<view class="centerMain">
<view class="title">
<image src="https://qn.colorcun.com/voucherUnion_1.png" mode="" />
<text class="font28r">菜品</text>
</view>
<view class="info font24r">{{detail.use.dish}}</view>
<image class="useImg" wx:for="{{detail.use.images}}" src="{{item}}" mode="" />
</view>
</view>
<view class="center_box">
<view class="centerMain">
<view class="title">
<image src="https://qn.colorcun.com/voucherUnion_1.png" mode="" />
<text class="font28r">有效期</text>
</view>
<view class="info font24r"><text>活动期限</text>{{util.unixtoTime(detail.stime,'YYYY-MM-DD')}}<text>至</text>{{util.unixtoTime(detail.etime,'YYYY-MM-DD')}}</view>
</view>
<view class="centerMain">
<view class="title">
<image src="https://qn.colorcun.com/voucherUnion_2.png" mode="" />
<text class="font28r">可用日期</text>
</view>
<view class="mLeft">
<text wx:if="{{exp_date.is_week=='1' || exp_date.is_week===true}}" class="info font24r">{{exp_date.week_show?exp_date.week_show:''}}</text>
<view wx:if="{{exp_date.is_none=='1' || exp_date.is_none===true}}" class="info font24r">无限制</view>
</view>
</view>
<view class="centerMain" wx:if="{{exp_date.is_birthday=='1' || exp_date.is_birthday===true}}">
<view class="title">
<image src="https://qn.colorcun.com/voucherUnion_2.png" mode="" />
<text class="font28r">使用限制</text>
</view>
<view class="info font24r">会员生日当天</view>
</view>
<view class="centerMain" wx:if="{{detail.activity.explain}}">
<view class="title">
<image src="https://qn.colorcun.com/voucherUnion_5.png" mode="" />
<text class="font28r">其他说明</text>
</view>
<view class="info font24r">{{detail.activity.explain}}</view>
</view>
</view>
<view class="seller_data">
<image src="{{sellerObj.seller_image}}" mode="aspectFill" />
<view class="seller_box">
<view class="infos">
<view class="info_name font32r">{{sellerObj.sellername}}</view>
<view class="park font24r" wx:if="{{sellerObj.is_parking}}">可停车</view>
</view>
<view class="infos infos1">
<view class="dish font24r">{{sellerObj.cateStr}}</view>
<view class="averageText font24r" wx:if="{{sellerObj.average && sellerObj.average>0}}">人均¥{{sellerObj.average}}</view>
<view class="marTop font24r">{{distance}}</view>
</view>
<!-- <view class="bottom_btns">
<view class="book font24r">朋友订过</view>
<view class="book font24r">我订过</view>
<view class="book font24r">我去过</view>
<view class="book font24r">我有券</view>
</view> -->
</view>
</view>
<view class="bottom_box_wrap">
<view class="bottom_box">
<view class="font24r">温馨提示:</view>
<view class="font24r">到店消费时,请您扫描商家二维码付款时,可以直接识别并使用优惠券</view>
<view class="font24r">2、从<text class="bold_box">周到安排</text>微信小程序,<text class="bold_box">“我的-卡券”</text>中,可以找到您的卡券。</view>
<view class="font24r">3、您也可以关注<text class="bold_box">周到安排</text>公众号,获取更多优惠券信息</view>
<view class="font28r publicity" bindtap="wananchi">关注<text class="bold_box">周到安排</text>公众号,及时获取更多优惠券动态<view class="more" style="margin-left: 20rpx;"></view>
</view>
</view>
</view>
<view class="sharewidth" wx:if="{{(detail.is_examine!='1' && detail.is_expire!='1' && detail.price!='0') || (sellerObj.is_online_reserve == '1')}}">
<view class="btns">
<view wx:if="{{detail.is_examine!='1' && detail.is_expire!='1' && detail.price!='0'}}" class="btn1 font36r" bindtap="subscribeDrawback">申请退款</view>
<view class="btn font36r" wx:if="{{sellerObj.is_online_reserve == '1'}}">
<navigator url="/pages/reserve/reserve?id={{sellerObj.sid}}&activeTab=reserve" class="book-item-font second-book-button flex-cc font30r" style="position: relative;">预订包间</navigator>
</view>
<view class="btn font36r" wx:if="{{sellerObj.is_online_reserve == '0' && sellerObj.phone}}">
<view bindtap="callPhone">预订包间</view>
</view>
</view>
</view>
\ No newline at end of file
... ...
/* pack-activity/pack/examineCertificate.wxss */
.box_wrap {
display: flex;
padding: 0 40rpx 30rpx 40rpx;
flex-direction: column;
align-items: center;
justify-content: center;
page {
background: #F5F5F5;
}
.top_box {
border-radius: 16rpx;
background: #f8f9fd;
width: 100%;
padding: 48rpx 0 42rpx 0;
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
background: #fff;
display: flex;
padding: 20rpx 40rpx;
margin-bottom: 2rpx;
}
.lineBox {
position: relative;
width: 92%;
height: 4rpx;
margin-bottom: 80rpx;
.top_box image {
width: 120rpx;
height: 120rpx;
}
.discount_name {
color: #0143a3;
font-family: PingFang SC;
font-weight: 500;
.textName {
font-weight: 600;
margin-bottom: 10rpx;
}
.top_box .qcode {
width: 400rpx;
height: 400rpx;
.threshold .priceText {
font-size: 52rpx;
font-weight: 600;
margin-right: 12rpx;
}
.lineBox .group {
width: 100rpx;
height: 100rpx;
position: absolute !important;
right: 12%;
top: -30rpx;
.top_box .texts {
flex: 1;
margin-left: 32rpx;
}
.shop_name {
color: #515151;
font-family: PingFang SC;
font-weight: 500;
margin: 34rpx 0 30rpx 0;
.threshold {
color: #FD4D59;
font-weight: 400;
}
.line {
width: 100%;
height: 4rpx;
border-bottom: 4rpx dashed #999999;
.receive {
display: flex;
align-items: flex-end;
color: #999999;
}
.orderNumber {
color: #515151;
font-family: PingFang SC;
font-weight: 500;
margin-top: 16rpx;
.center_box {
border-radius: 20rpx;
background: #ffffff;
padding: 40rpx;
margin: 20rpx;
}
.center_box {
margin: 24rpx 0 32rpx 0;
border-radius: 16rpx;
background: #f8f9fd;
width: 100%;
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
.qrcodeBox {
display: flex;
flex-direction: column;
align-items: center;
}
.info {
width: 93%;
height: 96rpx;
margin-left: 7%;
padding-right: 7%;
box-sizing: border-box;
display: flex;
justify-content: space-between;
align-items: center;
line-height: 48rpx;
border-bottom: 2rpx solid #E7E7E7;
.qrcodeBox .infoText:nth-last-of-type(1) {
border-bottom: none;
}
.info_left {
color: #515151;
font-family: PingFang SC;
.infoText {
color: #515151;
font-family: PingFang SC;
font-weight: 500;
line-height: 32rpx;
border-bottom: 4rpx dashed #999;
margin: 0 16rpx;
flex: 1;
padding-bottom: 40rpx;
width: 100%;
text-align: center;
}
.info_right {
color: #999999;
font-family: PingFang SC;
.qcode {
width: 400rpx;
height: 400rpx;
}
.sellerName{
color: #515151;
.title {
display: flex;
align-items: center;
margin-bottom: 16rpx;
}
.explain_news {
width: 100%;
box-sizing: border-box;
padding: 24rpx 7%;
color: #999999;
font-family: PingFang SC;
font-size: 24rpx;
line-height: 48rpx;
.title text {
letter-spacing: 2rpx;
}
.info1 {
border-bottom: 1rpx solid #E7E7E7;
.title image {
width: 26rpx;
height: 26rpx;
margin-right: 14rpx;
}
.btns {
width: 100%;
display: flex;
align-items: flex-end;
justify-content: flex-end;
.centerMain3 image {
width: 22rpx;
}
.btns button {
margin: 0;
border-radius: 50rpx;
border: 2rpx solid #0143a3;
background-color: #fff;
color: #999999;
font-family: PingFang SC;
cursor: none;
box-shadow: none;
.centerMain {
margin-bottom: 40rpx;
}
.canteen_box {
margin: 32rpx 0;
border-radius: 16rpx;
background: #f8f9fd;
width: 100%;
display: flex;
align-items: center;
padding: 30rpx 20rpx;
box-sizing: border-box;
.centerMain .drop {
width: 8rpx;
height: 8rpx;
background: #575757;
border-radius: 50%;
position: absolute;
left: -23rpx;
top: 45%;
}
.canteen_box image {
height: 160rpx;
border-radius: 10rpx;
margin-right: 20rpx;
.centerMain:nth-last-of-type(1) {
margin-bottom: 0;
}
.info_right .font24r {
margin: 10rpx 0 38rpx 0;
.centerMain .useImg:nth-of-type(1) {
margin-bottom: 20rpx;
}
.centerMain .useImg {
margin-bottom: 20rpx;
}
.title text {
font-weight: 600;
}
.info {
margin-left: 44rpx;
color: #575757;
letter-spacing: 2rpx;
position: relative;
line-height: 40rpx;
}
.mLeft {
margin-left: 44rpx;
}
.mLeft .info {
margin-left: 0;
}
.bottom_box {
border-radius: 16rpx;
background: #f8f9fd;
width: 100%;
padding: 8rpx 20rpx 28rpx 20rpx;
box-sizing: border-box;
border-radius: 16rpx;
background: #fff;
padding: 40rpx 40rpx 36rpx 40rpx;
box-sizing: border-box;
margin: 0 20rpx;
}
.bottom_box_wrap {
padding-bottom: 180rpx;
}
.bottom_box view {
color: #999999;
font-family: PingFang SC;
line-height: 38rpx;
color: #515151;
font-family: PingFang SC;
line-height: 40rpx;
}
.bold_box {
font-weight: bold;
color: #515151;
font-size: 28rpx;
font-weight: bold;
color: #000;
}
.publicity {
margin-top: 14rpx;
display: flex;
align-items: center;
justify-content: center;
padding: 20rpx 0;
}
.week {
width: 93%;
margin-left: 7%;
padding-right: 7%;
box-sizing: border-box;
display: flex;
justify-content: space-between;
flex-direction: column;
align-items: center;
line-height: 48rpx;
border-bottom: 2rpx solid #E7E7E7;
}
.week_top {
padding: 24rpx 0;
padding-bottom: 0;
width: 100%;
display: flex;
align-items: center;
justify-content: space-between;
}
.week_left {
color: #515151;
font-family: PingFang SC;
}
.texts {
color: #999;
font-family: PingFang SC;
}
.dateList {
width: 100%;
display: flex;
padding-bottom: 24rpx;
position: relative;
top: -10rpx;
letter-spacing:4rpx;
justify-content: flex-end;
margin-top: 14rpx;
display: flex;
align-items: center;
padding: 20rpx 0;
}
.sharewidth {
position: fixed;
left: 0;
bottom: 0;
height: 160rpx;
padding: 40rpx 32rpx;
background: #fff;
box-sizing: border-box;
z-index: 100;
width: 100%;
display: flex;
}
.btns {
flex: 1;
display: flex;
justify-content: flex-end;
}
.shareBtn {
display: flex;
flex-direction: column;
font-weight: 600;
margin-left: 40rpx;
background: transparent;
align-items: center;
}
.shareBtn image {
width: 34rpx;
height: 40rpx;
}
.btn {
color: #fff;
padding: 0 40rpx;
height: 80rpx;
line-height: 80rpx;
border-radius: 40rpx;
font-weight: 600;
margin-left: 20rpx;
width: 40%;
background: linear-gradient(90.98deg, #f41919 0.25%, #ff7426 120.07%);
}
.btn1 {
font-weight: 600;
padding: 0 40rpx;
height: 80rpx;
line-height: 80rpx;
border-radius: 40rpx;
color: #fb4e21;
border: 2rpx solid #fb4e21;
width: 40%;
text-align: center;
}
#myModal .titleModal {
margin-top: 80%;
width: 100%;
position: relative;
}
#myModal .titleModal2 {
margin-top: 80%;
}
#myModal .titleModal3 {
margin-top: 60%;
}
#myModal .titleModal4 {
margin-top: 30%;
}
#myModal .mymodal {
background: rgba(0, 0, 0, 0.8);
width: 100% !important;
top: 0 !important;
height: auto !important;
z-index: 300;
}
.closeImg {
width: 60rpx;
height: 60rpx;
position: absolute;
right: 0;
top: 0;
}
.modalText1 {
color: #dfdfdf;
font-family: PingFang SC;
font-weight: 600;
font-size: 52rpx;
text-align: center;
}
.modalText2 {
color: #dfdfdf;
font-family: PingFang SC;
font-weight: 500;
text-align: center;
margin: 0 40rpx;
}
.couponBtn {
width: 80%;
margin: 0 auto;
border-radius: 42rpx;
background: linear-gradient(90.98deg, #f41919 0.25%, #ff7426 120.07%);
font-weight: 400;
color: #fff;
text-align: center;
border: 4rpx solid #fff;
padding: 12rpx 0;
margin: 80rpx auto 20rpx auto;
}
.seller_data {
display: flex;
justify-content: space-between;
padding: 16rpx 24rpx;
background: #fff;
margin: 20rpx;
border-radius: 16rpx;
}
.seller_data image {
width: 200rpx;
height: 200rpx;
border-radius: 10rpx;
}
.seller_box {
margin-left: 16rpx;
flex: 1;
position: relative;
}
.infos {
display: flex;
align-items: center;
justify-content: space-between;
margin: 8rpx 0;
color: #696969;
}
.dish {
overflow: hidden;
word-break: break-all;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
}
.marTop {
margin-top: 4rpx;
}
.infos1 {
padding-bottom: 40rpx;
}
.averageText {
flex-shrink: 0;
margin: 0 14rpx;
}
.park {
background: #FFEEDF;
color: #B56737;
padding: 8rpx 12rpx 0 12rpx;
border-radius: 4rpx;
height: 30rpx;
line-height: 30rpx;
flex-shrink: 0;
}
.info_name {
color: #000;
overflow: hidden;
word-break: break-all;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 1;
font-weight: 600;
}
.bottom_btns {
display: flex;
position: absolute;
bottom: 0;
}
.book {
margin-right: 8rpx;
padding: 4rpx 12rpx;
background: #FFE8D7;
color: #fb4e21;
border-radius: 4rpx;
}
\ No newline at end of file
... ...
... ... @@ -175,9 +175,12 @@ Page({
let distance = '';
let seller = {
cateStr,
is_parking: data.is_parking,
average: data.average,
sellername: data.sellername,
is_online_reserve: data.is_online_reserve,
seller_image: data.seller_image,
phone: data.phone,
}
wx.getLocation({
type: 'wgs84', // 返回可以用于 wx.openLocation 的经纬度
... ... @@ -212,6 +215,12 @@ Page({
})
})
},
// 拨打电话
callPhone() {
wx.makePhoneCall({
phoneNumber: this.data.seller.phone
})
},
// 处理优惠券不可用日期数据
hasConsecutiveSelect(arr, type) {
let firstTitle = null;
... ...
... ... @@ -77,12 +77,12 @@
<view class="seller_box">
<view class="infos">
<view class="info_name font32r">{{seller.sellername}}</view>
<!-- <view class="park font24r">可停车</view> -->
<view class="park font24r" wx:if="{{seller.is_parking}}">可停车</view>
</view>
<view class="infos">
<view class="infos infos1">
<view class="dish font24r">{{seller.cateStr}}</view>
<view class="aa font24r" wx:if="{{seller.average && seller.average>0}}">人均¥{{seller.average}}</view>
<text class="font24r">{{distance}}</text>
<view class="averageText font24r" wx:if="{{seller.average && seller.average>0}}">人均¥{{seller.average}}</view>
<view class="marTop font24r">{{distance}}</view>
</view>
<!-- <view class="bottom_btns">
<view class="book font24r">朋友订过</view>
... ... @@ -111,6 +111,9 @@
<view class="btn1 font36r" wx:if="{{seller.is_online_reserve == '1'}}">
<navigator url="/pages/reserve/reserve?id={{opt.sid}}&activeTab=reserve" class="book-item-font second-book-button flex-cc font30r" style="position: relative;">预订包间</navigator>
</view>
<view class="btn font36r" wx:if="{{seller.is_online_reserve == '0' && seller.phone}}">
<view bindtap="callPhone">预订包间</view>
</view>
<view wx:if="{{resultCoupon == '0' && detail.grant_last>0}}" class="btn font36r" bindtap="submitOrder">领取到卡包</view>
</view>
</view>
... ...
... ... @@ -270,11 +270,34 @@ page {
.infos {
display: flex;
align-items: center;
justify-content: space-between;
margin: 8rpx 0;
color: #696969;
}
.dish {
overflow: hidden;
word-break: break-all;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
}
.marTop {
margin-top: 4rpx;
}
.infos1 {
padding-bottom: 40rpx;
}
.averageText {
flex-shrink: 0;
margin: 0 14rpx;
}
.park {
background: #FFEEDF;
color: #B56737;
... ...
... ... @@ -40,6 +40,47 @@ Page({
item.status = '2';
item.is_examine = '0';
}
item.exp_date = item.exp_date ? util.determine(item.exp_date) : '';
item.arule = item.arule ? util.determine(item.arule) : '';
item.use = item.use ? util.determine(item.use) : '';
if ((item.use && (!item.use.is_cash || item.use.is_cash == '1'))) {
let cash = item.use.cash * 1;
let price = item.price * 1;
item.discount = cash != 0 ? ((price / cash) * 10).toFixed(1) : '';
}
if (item.exp_date && item.exp_date.week_data) {
let noon = this.hasConsecutiveSelect(item.exp_date.week_data, '1').rArr.join('、')
let nig = this.hasConsecutiveSelect(item.exp_date.week_data, '2').rArr.join('、')
if (noon) noon = '午餐:' + noon
if (nig) nig = '晚餐:' + nig
item.noonText = noon;
item.nigText = nig;
}
item.noShow = '1';
item.noShowTetxt = '';
if(item.is_examine=='1' && item.is_comment!='1'){
item.noShow = '0'
item.noShowTetxt = '已使用'
}
if(item.is_expire=='1'){
item.noShow = '0'
item.noShowTetxt = '已失效'
}
if(item.status=='4'){
item.noShow = '0'
item.noShowTetxt = '退款中'
}
if(item.status=='5'){
item.noShow = '0'
item.noShowTetxt = '已退款'
}
if(item.is_examine=='1' && item.is_comment=='1'){
item.noShow = '0'
item.noShowTetxt = '已评价'
}
if(item.is_examine=='1' && item.is_expire=='0' && item.status!='4' && item.status!='5' && item.is_comment!='1'){
item.noShow = '1'
}
})
list.sort((a, b) => a.is_examine - b.is_examine);
list.sort((a, b) => a.is_expire - b.is_expire);
... ... @@ -104,4 +145,48 @@ Page({
this.todetail()
}
},
// 处理优惠券不可用日期数据
hasConsecutiveSelect(arr, type) {
let firstTitle = null;
let lastTitle = null;
let rArr = []
let num = 0
for (let i = 0; i < arr.length; i++) {
let str = type == '1' ? arr[i].selectNoon : arr[i].selectNig
if (str) {
rArr.push(arr[i].title)
num++
if (num == 1) {
firstTitle = arr[i].title
}
if (num >= 5) {
lastTitle = arr[i].title
}
if (num >= 5 && i >= (arr.length - 1)) {
let fi = rArr.findIndex((item) => {
return item == firstTitle
})
rArr.splice(fi, num, firstTitle + '至' + lastTitle)
num = 0
}
} else {
if (num < 5) {
num = 0
firstTitle = null;
lastTitle = null;
} else {
let fi = rArr.findIndex((item) => {
return item == firstTitle
})
rArr.splice(fi, num, firstTitle + '至' + lastTitle)
num = 0
}
}
}
return {
rArr,
lastTitle,
firstTitle
};
},
})
\ No newline at end of file
... ...
... ... @@ -3,23 +3,43 @@
<nav>卡券</nav>
<scroll-view class="list" style="height:{{contentHeight}}px;" scroll-y>
<block wx:if="{{list.length>0}}">
<view wx:for="{{list}}" class="card bg-white" bindtap="todetail" data-item="{{item}}" >
<view class="flex-vl gray-font card-main" style="justify-content:space-between;">
<view class="seller-info flex-ll">
<view class="smooth font-siny font32r" wx:if="{{item.recharge_name || item.aname}}">{{item.recharge_name || item.aname}}</view>
</view>
<view class="font24r font-bold text1" wx:if="{{item.sellername}}">{{item.sellername}}</view>
<view class="font24r font-bold text1" wx:if="{{item.order_no}}">{{item.order_no}}</view>
<view wx:for="{{list}}" bindtap="todetail" data-item="{{item}}" wx:if="{{item.recharge_name || item.aname}}" class="preferentialItems {{item.noShow == '0' ? 'noStyle':''}}">
<view class="itemLeft">
<text wx:if="{{item.discount!='0.00' && (item.use.is_cash=='1' || item.use.is_cash) && item.discount}}" class="discountText font24r">{{item.discount}}折</text>
<view class="discountText1 font20r {{item.arule.is_accumulation == '1'?'discountText2':'discountText3'}}" wx:if="{{item.is_type == '3'}}">{{item.arule.is_accumulation == '1' ? '可' : '不可'}}叠加</view>
<view class="priceText" wx:if="{{item.price}}">
<view class="icons font24r">¥</view><text class="font40r">{{item.price}}</text>
</view>
<view class="icons font20r" wx:if="{{item.is_type == '3' && item.desc!='0'}}">消费满{{item.desc}}元可用</view>
</view>
<view class="couponLine"></view>
<view class="itemRight">
<view class="btns">
<text class="font40r">{{item.recharge_name || item.aname}}</text>
<block wx:if="{{item.is_type == '1' || item.is_type == '2' || item.type == '1' || item.type == '2'}}">
<view wx:if="{{item.exp_date.is_week=='1' || item.exp_date.is_week===true}}" class="bottom font24r">{{item.exp_date.week_show?item.exp_date.week_show+'可用':''}}{{item.desc?','+item.desc+'。':'。'}}</view>
<view wx:if="{{item.exp_date.is_none=='1' || item.exp_date.is_none===true}}" class="bottom font24r">
无限制{{item.desc?','+item.desc+'。':'。'}}
</view>
<view wx:if="{{item.exp_date.is_birthday=='1' || item.exp_date.is_birthday===true}}" class="bottom font24r">
会员生日当天可用{{item.desc?','+item.desc+'。':'。'}}
</view>
</block>
<block wx:if="{{item.is_type == '3'}}">
<view wx:if="{{item.is_type == '3' && item.aexpiration>0}}" class="bottom font24r">领取后{{item.aexpiration}}天有效</view>
<view wx:if="{{item.noonText || item.noonText}}" class="bottom font24r">不可用日期:</view>
<view wx:if="{{item.noonText}}" class="bottom font24r nodate">{{item.noonText}}</view>
<view wx:if="{{item.nigText}}" class="bottom font24r nodate">{{item.nigText}}</view>
<view wx:if="{{item.exp_date.week_show=='无'}}" class="bottom font24r">无使用时间限制</view>
<view wx:if="{{item.is_type == '4' && item.desc!='0'}}" class="bottom font24r">消费满{{item.desc}}元可用</view>
</block>
</view>
<view class="btnBox">
<view class="font24r orderingFood" wx:if="{{item.is_examine=='0' && item.is_expire=='0' && item.is_examine=='0' && item.status!='4' && item.status!='5'}}">去核销</view>
<view class="font24r orderingFood" wx:if="{{item.is_examine=='1' && item.is_expire=='0' && item.status!='4' && item.status!='5' && item.is_comment!='1'}}">去评价</view>
<view class="font24r orderingFood" wx:if="{{!(item.is_examine=='1' && item.is_expire=='0' && item.status!='4' && item.status!='5' && item.is_comment!='1') && item.noShowTetxt}}">{{item.noShowTetxt}}</view>
</view>
</view>
<!-- status 状态 1 待支付 2 已支付 3 支付失败 4 退款中 5 已退款 is_expire 1未失效 -->
<image wx:if="{{item.is_examine=='1' && item.is_comment!='1'}}" src="https://qn.colorcun.com/WechatIMG713.png" class="imgs1" mode="" />
<image wx:if="{{item.is_expire=='1'}}" src="https://qn.colorcun.com/WechatIMG714.png" class="imgs1" mode="" />
<image wx:if="{{item.status=='4'}}" src="https://qn.colorcun.com/WechatIMG1.png" class="imgs1" mode="" />
<image wx:if="{{item.status=='5'}}" src="https://qn.colorcun.com/WechatIMG2.png" class="imgs1" mode="" />
<image wx:if="{{item.is_examine=='1' && item.is_comment=='1'}}" src="https://qn.colorcun.com/A1.png" class="imgs1" mode="" />
<!-- is_comment 1已评论 is_examine 1已核销 is_expire 1已过期-->
<button wx:if="{{item.is_examine=='1' && item.is_expire=='0' && item.status!='4' && item.status!='5' && item.is_comment!='1'}}" class="flex-cc card-info font30r font-bold smooth">去评价</button>
<view class="font24r texts {{(item.is_examine=='1' || item.is_expire=='1' || item.status=='4' || item.status=='5')?'texts2':'texts1' }} smooth">有效时间:{{util.unixtoTime(item.stime,'YYYY-MM-DD')}} 至 {{util.unixtoTime(item.etime,'YYYY-MM-DD')}}</view>
</view>
</block>
<block wx:if="{{list.length=='0' && isShow}}">
... ...
/* pages/me/coupon_news.wxss */
@import "../../app.wxss";
.card {
width: 690rpx;
height: 240rpx;
border-radius: 6rpx;
margin: 0 auto 30rpx;
background: #F8F9FD;
overflow: hidden;
position: relative;
border-radius: 16rpx;
}
.font-siny {
color: #0143a3;
font-family: PingFang SC;
... ... @@ -42,135 +31,137 @@
}
.card-main.canuse {
border-right: 2rpx dashed #F05522;
border-right: 2rpx dashed #F05522;
}
.card-main.used {
border-right: 2rpx dashed #CCCCCC;
border-right: 2rpx dashed #CCCCCC;
}
.seller-image {
width: 30rpx;
height: 30rpx;
border-radius: 50%;
background: #EEEEEE;
margin-right: 10rpx;
width: 30rpx;
height: 30rpx;
border-radius: 50%;
background: #EEEEEE;
margin-right: 10rpx;
}
.card-info {
padding: 0 26rpx;
height: 48rpx;
line-height: 48rpx;
box-sizing: border-box;
margin: 0;
position: absolute;
right: 4%;
bottom: 44%;
border: 2rpx solid #0143A3;
border-radius: 44rpx;
font-weight: normal;
color: #999999;
padding: 0 26rpx;
height: 48rpx;
line-height: 48rpx;
box-sizing: border-box;
margin: 0;
position: absolute;
right: 4%;
bottom: 44%;
border: 2rpx solid #0143A3;
border-radius: 44rpx;
font-weight: normal;
color: #999999;
}
.use-button {
width: 160rpx;
height: 44rpx;
border-radius: 24rpx;
border: 2rpx solid #5EB2FF;
width: 160rpx;
height: 44rpx;
border-radius: 24rpx;
border: 2rpx solid #5EB2FF;
}
.circle-pos {
width: 24rpx;
height: 100%;
position: absolute;
left: 78%;
top: 0;
margin-left: -14rpx;
width: 24rpx;
height: 100%;
position: absolute;
left: 78%;
top: 0;
margin-left: -14rpx;
}
.circle {
width: 24rpx;
height: 12rpx;
background: #FFFFFF;
width: 24rpx;
height: 12rpx;
background: #FFFFFF;
}
.circle-top {
border-radius: 12rpx 12rpx 0 0;
border-radius: 12rpx 12rpx 0 0;
}
.circle-bottom {
border-radius: 0 0 12rpx 12rpx;
border-radius: 0 0 12rpx 12rpx;
}
.orange-font {
color: #F05522;
color: #F05522;
}
.list {
width: 100%;
padding-top: 20rpx;
box-sizing: border-box;
width: 100%;
padding-top: 20rpx;
box-sizing: border-box;
}
.select-all {
width: 200rpx;
padding: 30rpx 20rpx;
box-sizing: border-box;
width: 200rpx;
padding: 30rpx 20rpx;
box-sizing: border-box;
}
.circle {
width: 30rpx;
height: 30rpx;
border: 2rpx solid #ECD9B7;
border-radius: 50%;
box-sizing: border-box;
width: 30rpx;
height: 30rpx;
border: 2rpx solid #ECD9B7;
border-radius: 50%;
box-sizing: border-box;
}
.card-used {
width: 90%;
box-sizing: border-box;
height: 120rpx;
box-shadow: 0 0 8rpx #EEF0F2;
background: #FFFFFF;
display: flex;
align-items: center;
justify-content: center;
margin: 0 auto;
color: #999999;
font-family: PingFang SC;
font-weight: 500;
font-size: 28rpx;
width: 90%;
box-sizing: border-box;
height: 120rpx;
box-shadow: 0 0 8rpx #EEF0F2;
background: #FFFFFF;
display: flex;
align-items: center;
justify-content: center;
margin: 0 auto;
color: #999999;
font-family: PingFang SC;
font-weight: 500;
font-size: 28rpx;
}
.wananchi text{
color: #515151;
color: #515151;
}
.texts {
width: 100%;
height: 60rpx;
padding-left: 24rpx;
box-sizing: border-box;
display: flex;
align-items: center;
position: absolute;
bottom: 0;
left: 0;
color: #fff;
width: 100%;
height: 60rpx;
padding-left: 24rpx;
box-sizing: border-box;
display: flex;
align-items: center;
position: absolute;
bottom: 0;
left: 0;
color: #fff;
}
.texts1{
background: linear-gradient(104.24deg, #4c8dad -57.47%, #0143a3 55.72%, #42a5ff 148.72%);
background: linear-gradient(104.24deg, #4c8dad -57.47%, #0143a3 55.72%, #42a5ff 148.72%);
}
.texts2{
background:#DBDBDB;
background:#DBDBDB;
}
.imgs1{
position: absolute !important;
right: 30%;
top: 15%;
width: 92rpx;
height: 92rpx;
position: absolute !important;
right: 30%;
top: 15%;
width: 92rpx;
height: 92rpx;
}
.empty-img{
... ... @@ -179,6 +170,7 @@
width:302rpx;
height:408rpx;
}
.empty-txt{
height:44rpx;
font-size:32rpx;
... ... @@ -187,4 +179,177 @@
color:rgba(53,53,53,1);
line-height:44rpx;
margin-top: 40rpx;
}
.preferentialItems {
display: flex;
background: linear-gradient(180deg, #ffefd0 0%, #ffdc9b 100%);
min-height: 160rpx;
padding-bottom: 10rpx;
border-radius: 20rpx;
margin: 0 40rpx 20rpx;
}
.itemLeft {
width: 27%;
display: flex;
flex-direction: column;
justify-content: center;
position: relative;
align-items: center;
}
.discountText {
text-align: center;
color: #FFEFC5;
border-radius: 6rpx;
font-family: PingFang SC;
background: #FD4D59;
width: max-content;
padding: 6rpx;
position: absolute;
left: 16rpx;
top: 12rpx;
}
.discountText1 {
text-align: center;
border-radius: 6rpx;
font-family: PingFang SC;
background: transparent;
width: max-content;
padding: 2rpx 8rpx;
position: absolute;
left: 16rpx;
top: 12rpx;
}
.discountText2 {
background: #FD4D59;
color: #fff;
}
.discountText3 {
color: #FD4D59;
border: 2rpx solid #FD4D59;
}
.priceText {
display: flex;
align-items: baseline;
justify-content: center;
font-family: PingFang SC;
color: #F6231B;
font-weight: 600;
font-size: 48rpx;
padding-top: 20rpx;
}
.icons {
color: #F6231B;
}
.priceText .icons {
color: #FD4D59;
}
.priceText text {
font-size: 48rpx;
}
.nodate{
margin-left: 20rpx;
}
.couponLine {
margin: 24rpx 0;
border-right: 2rpx dashed #f6231b;
}
.itemRight {
padding-right: 10rpx;
margin-left: 14rpx;
width: 74%;
display: flex;
align-items: center;
}
.btns {
margin: 24rpx 20rpx 0 0;
display: flex;
justify-content: space-between;
align-items: baseline;
flex-direction: column;
}
.orderingFood {
padding: 0 24rpx;
border-radius: 22rpx;
text-align: center;
border-radius: 20rpx;
line-height: 44rpx;
height: 44rpx;
width: max-content;
flex-shrink: 0;
border: 2rpx solid #fa4b20;
background: transparent;
color: #fa4b20;
}
.btns {
flex: 1;
}
.btnBox {
display: flex;
flex-direction: column;
}
.btns text {
font-weight: 600;
margin-bottom: 4rpx;
}
.bottom {
margin-top: 4rpx;
width: 100%;
color: #C36607;
font-family: PingFang SC;
font-weight: 500;
display: -webkit-box;
word-break: break-all;
word-wrap: break-word;
overflow: hidden;
text-align: left;
}
.noStyle .preferentialItems{
background: #DBDBDB;
}
.noStyle .priceText,
.noStyle .bottom,
.noStyle .btns,
.noStyle .icons,
.noStyle .priceText .icons {
color: #999;
}
.noStyle .orderingFood{
border: 2rpx solid #999;
color: #999;
}
.noStyle .couponLine {
border-right: 2rpx dashed #999;
}
.noStyle .discountText2{
background: #999;
color: #fff;
}
.noStyle .discountText3{
color: #999;
border: 2rpx solid #999;
}
\ No newline at end of file
... ...