You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
high-mini/pages/pay/success/success.vue

278 lines
8.1 KiB

<template>
<view>
<view class="width100" v-if="couponDesInfo">
<view class="width100 fotct coupon-status font20 fcorred" v-if="couponDesInfo.couponCodeInfo.status == 3">
已使用
</view>
<view class="width100 fotct coupon-status font20 fcor41c" v-if="couponDesInfo.couponCodeInfo.status == 2">
未使用
</view>
<view class="line1"></view>
4 years ago
<view class="width90">
<view class="flright fotct">
<image mode="widthFix" class="coupon-img" :src="imageUrl+couponDesInfo.couponInfo.couponImg"></image>
</view>
<view class="coupon-mes mart10">
<view class="fcor333 fontwig6 font24 width100 text2">{{couponDesInfo.couponInfo.couponName}}</view>
<view class="fcor666 font13 width100 mart5" v-if="oneTime">
领取时间:{{oneTime | formatDate('-')}}</view>
<view class="fcor666 font13 width100 mart5" v-if="twoTime">
使用有效期:{{twoTime | formatDate('-')}}</view>
<view class="fcorred font15 width100 mart5" v-if="threeTime">
消费时间:{{threeTime | formatDate('-')}}</view>
</view>
</view>
<view class="line1 mart15"></view>
<view class="width100" v-if="couponDesInfo.couponInfo.couponSource == 4">
<view class="mart20 width90 font18 fcor333 fontwig6">
使用流程
</view>
<view class="mart5 width80 font14 fcor999 fontwig6" style="list-style-type: decimal;">
<view style="width: 5%;" class="flleft">1:</view>
<view style="margin-left: 5%;">客户使用积分兑换或者工会卡购买</view>
</view>
<view class="mart5 width80 font14 fcor999 fontwig6" style="list-style-type: decimal;">
<view style="width: 5%;" class="flleft">2:</view>
<view style="margin-left: 5%;">兑换成功后中石化给客户发送一张同等面额的码商券保存在加油中石化APP中</view>
</view>
<view class="mart5 width80 font14 fcor999 fontwig6" style="list-style-type: decimal;">
<view style="width: 5%;" class="flleft">3:</view>
<view style="margin-left: 5%;">客户登录加油中石化APP查看码商券详情</view>
</view>
<view class="mart5 width80 font14 fcor999 fontwig6" style="list-style-type: decimal;">
<view style="width: 5%;" class="flleft">4:</view>
<view style="margin-left: 5%;">客户选择中石化任意加油站加油加完油后在加油中石化APP中查看订单选择支付支付时选择码商券抵用支付完成即可</view>
</view>
</view>
<view class="width100" v-if="couponDesInfo.couponInfo.couponSource != 4">
<view class="width90 mart10 fcor666">核销码(商户扫客户)</view>
<view class="mart20 fotct fcorred font15 marb20">请告知加油员用码商支付</view>
<view class="width90 mart20 fotct">
<image class="coupon-qr" :src="imageUrl+'couponCode/'+couponDesInfo.highUserCoupon.qrCodeImg">
</image>
</view>
</view>
<view class="width90 mart30 font20 fcor333 fotct marb40" v-if="!couponDesInfo">二维码生效中,前往个人中心查看</view>
<view class="width90 mart20" style="height: 80px;" v-for="(store,i) in storeList" :key="i">
<view class="coupon-des flleft">
<image mode="widthFix" :src="imageUrl+store.ext1"></image>
</view>
<view class="coupon-cont-dh">
<view class="coupon-title flleft width70">
<view class="font20 fcor333 fontwig6 width100 text1">{{store.storeName}}</view>
<view class="font14 fcor999 width100 text2 mart5">{{store.address}}</view>
</view>
<view class="coupon-map flright width30 fotct" @click="seeloaction(store)">
<!-- 地图logo -->
<image :src="imagewxUrl+imgadres1">
</image>
<view class="mart5 fcor999 font13">{{store.distance}}km</view>
</view>
</view>
</view>
</view>
<view class="height60"></view>
<button class="coupne-btn width100" @click="toUser">个人中心</button>
</view>
</template>
<script>
import {
getUserNewCouponDetail,
getStoreListByCoupon
} from "../../../Utils/Api.js"
let app = getApp()
export default {
data() {
return {
couDesId: '',
imageUrl: app.globalData.imgUrl,
imagewxUrl: app.globalData.imageWxImg,
imgadres1: 'dhl.png',
couponDesInfo: [],
storeList: [],
oneTime: '',
twoTime: '',
threeTime: ''
}
},
onLoad(option) {
this.couDesId = option.id;
this.getUserNewCouponDetail();
},
filters: {
//过滤器 用于格式化时间
formatDate: function(value, spe = '/') {
let data = new Date(value);
let year = data.getFullYear();
let month = data.getMonth() + 1;
let day = data.getDate();
let h = data.getHours();
let mm = data.getMinutes();
let s = data.getSeconds();
month = month >= 10 ? month : "0" + month;
day = day >= 10 ? day : "0" + day;
h = h >= 10 ? h : "0" + h;
mm = mm >= 10 ? mm : "0" + mm;
s = s >= 10 ? s : "0" + s;
return `${year}${spe}${month}${spe}${day} ${h}:${mm}:${s}`;
}
},
onReachBottom() {
this.getStoreListByCoupon();
},
methods: {
//我的卡券详情
getUserNewCouponDetail() {
uni.showLoading({
title: '加载中...'
})
let params = {
couponId: this.couDesId
}
getUserNewCouponDetail(params).then(res => {
if (res.return_code == '000000') {
uni.hideLoading();
this.couponDesInfo = res.return_data;
if(res.return_data.couponInfo.couponSource == 4){
this.oneTime = res.return_data.highUserCoupon.createTime;
this.twoTime = res.return_data.highUserCoupon.useEndTime;
this.threeTime = res.return_data.highUserCoupon.consumeTime;
return;
}
this.getStoreListByCoupon();
this.oneTime = res.return_data.couponCodeInfo.receiveTime;
this.twoTime = res.return_data.couponCodeInfo.salesEndTime;
this.threeTime = res.return_data.couponCodeInfo.consumeTime;
} else {
uni.hideLoading()
}
})
},
//导航
seeloaction(e) {
uni.openLocation({
latitude: Number(e.latitude), //目的地的定位
longitude: Number(e.longitude), //目的地的定位
name: e.storeName,
address: e.address
})
},
/**
* 查询门店列表
*/
getStoreListByCoupon() {
uni.showLoading({
title: '加载中...'
})
let params = {
couponId: this.couDesId,
longitude: app.globalData.longitude,
latitude: app.globalData.latitude
}
getStoreListByCoupon(params).then(res => {
if (res.return_code == '000000' && res.return_data.list != '') {
uni.hideLoading();
this.storeList = res.return_data;
} else {
this.storeList = [];
uni.hideLoading()
}
})
},
toUser() {
uni.switchTab({
url: '/pages/tabBar/user/user'
});
},
scan() {
uni.scanCode({
success: function(res) {
console.log('条码类型:' + res.scanType);
console.log('条码内容:' + res.result);
}
});
}
}
}
</script>
<style lang="scss">
.loading-text {
width: 100%;
display: flex;
justify-content: center;
align-items: center;
height: 60upx;
color: #979797;
font-size: 24upx;
}
.coupon-status {
height: 35px;
line-height: 35px;
}
.coupon-mes {
margin-right: 90px;
}
.coupon-img {
width: 80px;
max-height: 80px;
}
.coupon-qr {
width: 250px;
height: 250px;
}
.coupon-des {
width: 80px;
max-height: 80px;
text-align: center;
color: white;
font-size: 28px;
border-radius: 10px;
image{
width: 80px;
max-height: 80px;
}
}
.coupon-cont-dh {
margin-left: 90px;
}
.coupon-map image {
width: 25px;
height: 25px;
}
.coupon-no {
height: 80px;
line-height: 80px;
border: 1px solid #b2b2b2;
border-radius: 10px;
}
.coupne-btn {
position: fixed;
bottom: 0px;
background-color: red;
color: #FFFFFF;
}
.coupne-btn {
position: fixed;
bottom: 0px;
background-color: red;
color: #FFFFFF;
}
</style>