Commit 1a0e4657 authored by 华国豪's avatar 华国豪 🙄

自由行使用优惠券

parent 9ad715f8
......@@ -609,7 +609,7 @@
</div>
</el-col>
</el-row>
<div class="empty-data" v-if="dataList.length<1">
<div class="empty-data" v-if="dataList.length<1 && !laoding">
<i class="iconfont icon-kong"></i>
很抱歉,你想要的信息我们真的找不到了
</div>
......@@ -897,15 +897,22 @@ export default {
if(item.id == "TAG_0") {
delete this.msg.cat_main_keys
this.msg.cat_keys = [item.list[0].id]
} else {
delete this.msg.keywords
} else if(item.id == "TAG_4") {
this.msg.cat_main_keys = [item.id]
this.msg.keywords = '一日游'
delete this.msg.cat_keys
}else {
this.msg.cat_main_keys = [item.id]
delete this.msg.cat_keys
delete this.msg.keywords
}
this.getList()
} else {
delete this.msg.cat_main_keys
delete this.msg.cat_keys
delete this.msg.keywords
this.getList()
}
},
......
......@@ -488,7 +488,7 @@
<div class="fl-ad-cont">
<div class="search">
<span class="el-icon-close __cp" @click="addShow = !addShow"></span>
<el-input size="mini"></el-input>
<!-- <el-input size="mini"></el-input> -->
</div>
<el-row v-if="CCList.length>0 ">
<el-col :span="6">
......@@ -643,7 +643,7 @@
</div>
</el-col>
</el-row>
<div class="empty-data" v-if="dataList.length<1">
<div class="empty-data" v-if="dataList.length<1 && !laoding">
<i class="iconfont icon-kong"></i>
很抱歉,你想要的信息我们真的找不到了
</div>
......@@ -704,6 +704,7 @@ export default {
],
"page_size": 16,
"start": 0,
"keywords": '一日游'
},
priceSort: "PASC", // PDESC 高到低
KkdayDomain: '',
......@@ -952,13 +953,13 @@ export default {
this.getList()
},
changeMainTag(e){
console.log(e)
if(e.length > 0) {
this.msg.cat_keys = e
} else {
delete this.msg.cat_keys
}
delete this.msg.cat_main_keys
delete this.msg.keywords
this.getList()
},
changeNav(id, num){
......@@ -966,12 +967,18 @@ export default {
x.checkedCities = [];
})
this.typeTagIndex = num
if (id !== 'TAG_0') {
if (id !== 'TAG_0' && id !== "TAG_4") {
this.msg.cat_main_keys = [id]
delete this.msg.cat_keys
delete this.msg.keywords
} else if(id == "TAG_4") {
this.msg.cat_main_keys = [id]
this.msg.keywords = '一日游'
delete this.msg.cat_keys
} else {
delete this.msg.cat_main_keys
this.msg.cat_keys = ["TAG_2_5"]
delete this.msg.keywords
}
this.getList()
},
......@@ -980,36 +987,6 @@ export default {
name: "FreeHome",
});
},
// 选中小标签 加载数据
setChangeTag(item){
delete this.msg.cat_main_keys;
this.msg.cat_keys = item.checkedCities
this.getList()
},
// 游玩类型切换 取消其他选中
setChange(item, index){
if (item.checkd) {
this.typeTag.map((x, i)=>{
if (i !== index) {
x.checkd = false;
x.checkedCities = [];
}
})
if(item.id == "TAG_0") {
delete this.msg.cat_main_keys
this.msg.cat_keys = [item.list[0].id]
} else {
this.msg.cat_main_keys = [item.id]
delete this.msg.cat_keys
}
this.getList()
} else {
this.msg.cat_main_keys = ["TAG_4"]
delete this.msg.cat_keys
this.getList()
}
},
goDetails(obj){
let dom = document.querySelector("#blankLink")
let fullPath = `/FreeDetail?id=${obj.prod_no}`;
......
......@@ -6,6 +6,7 @@
<div class="left" style="width:795px;margin-right:17px">
<div class="ListDiv">
<el-form class="OrderConForm" ref="freeMsg" :model="freeMsg" label-width="100px">
<div class="commomStyle">
<div class="titleDiv">
......@@ -287,6 +288,55 @@
</div>
</div>
</el-form>
<div class="commomStyle">
<div class="titleDiv">
<span class="redSpan"></span>
<span class="f18 pfR">优惠</span>
</div>
<div style="padding:20px">
<p style="margin:10px 0;">兑换码</p>
<div>
<el-input size="small" v-model="ActivateCode" placeholder="请输入兑换码" style="width:200px"></el-input>
<el-button @click="GetCode" size="small" style="margin-left:10px">兑换</el-button>
</div>
<el-row class="_trip_xiangqing _coupon_box">
<p style="width:100%;margin:10px 0;">优惠券</p>
<p v-if="!Verification.length || Verification[0].ApplyState !== 1" class="_trip_xiangqing_tips">您还为进行 <span @click="goShenqing">实名认证</span>,认证后可使用优惠券哦~如果已提认证申请,申请审核通过后即可使用优惠券!</p>
<div v-if="UserCanUseCouponList.length>0" class="_coupon_box">
<div class="_coupon_item" v-for="(item, index) in UserCanUseCouponList" :class="{'blue':item.couponsType===1,'_active':item.active,'disab': !Verification.length || Verification[0].ApplyState !== 1}" @click="!Verification.length || Verification[0].ApplyState !== 1 ? '' : clickCoupon(item)">
<div class="_left_raduis">
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
</div>
<div class="_coupon_info">
<p class="_coupon_name" :title="item.couponName">{{item.couponName}}</p>
<p v-if="item.couponsType===1"><span class="_sale">{{item.denomination}}</span></p>
<p v-else><span class="_sale">{{item.denomination}}</span></p>
<p class="_info_full">{{item.useCondition}}可用</p>
<p class="_info_time _time">有效时间:{{item.effectDate | YMD}}-{{item.expirationDate | YMD}}</p>
<p class="_repeat" v-if="item.overlapUse === 1">可叠加</p>
<div class="_choice_box">
<span v-if="!item.active"></span>
<span v-else class="iconfont icon-xuanzhong2"></span>
</div>
</div>
</div>
</div>
<div v-else class="_no_coupon">
<p>暂无可用优惠券</p>
</div>
</el-row>
</div>
</div>
<el-button :loading="BtnLoading" @click="PayBtn" class="OrderConBtn">
下一步,支付
......@@ -345,6 +395,13 @@
<el-col style="text-align:center" :span="6">{{freeMsg.price4_b2c}}</el-col>
</el-row>
</div>
<div class="f14" style="padding:20px">
<el-row style="margin-bottom:7px" >
<el-col :span="6">优惠金额</el-col>
<el-col :span="12"><div class="dashDiv"></div></el-col>
<el-col style="text-align:center" :span="6">{{SettlementPrice == 0 ? 0 : freeMsg.MySelfTotalPrice - SettlementPrice}}</el-col>
</el-row>
</div>
</div>
......@@ -352,6 +409,7 @@
</div>
</div>
</div>
<a :href='blankUrl' id='blankLink' target="_blank" style="display:none">1</a>
</div>
</template>
<script>
......@@ -368,6 +426,13 @@ export default {
custom:[],
},
UserCanUseCouponList: [],
CouponList: [],
CouponIds: '',
Verification: '',
blankUrl: '',
ActivateCode: '',
SettlementPrice: 0,
booking_field:{},
markMsg:{
contact:false,
......@@ -447,11 +512,135 @@ export default {
};
this.getDetails(id)
this.GetInfo();
let userInfo = this.getLocalStorage();
this.apipost("app_customer_GetCertificationModel", { CustomerID: userInfo.customerId }, res => {
if (res.data.resultCode == 1) {
this.Verification = res.data.data
} else {
this.$message.error(res.data.message);
}
},err => {});
this.getUserCanUseCouponList()
},
mounted() {
},
methods: {
goShenqing: function () {
let dom = document.querySelector("#blankLink")
dom.href=`http://${window.location.host}/#/PsSystem/${1}`
//console.log(that.$refs.blankLink.click())
dom.click()
},
clickCoupon: function (item) {
let list = [];
if (!item.active) { // 是否选中
if (item.overlapUse === 1) { // 1允许叠加使用
this.CouponList.forEach(x=>{
if (x.overlapUse === 1 && x.couponsType === item.couponsType) { // 优惠券列表筛选出允许叠加并且type相同的
list.push(x)
}
})
item.active = !item.active
this.UserCanUseCouponList = list
} else { // 不允许叠加使用
this.CouponList.forEach(x=>{ // 筛选掉其他
if (x.id === item.id) {
list.push(x)
}
})
item.active = !item.active
this.UserCanUseCouponList = list
}
} else {
item.active = !item.active
if (this.UserCanUseCouponList.length===1) { // 取消优惠券选中状态 之前直选择了一个优惠券
this.UserCanUseCouponList = this.CouponList
} else { //... 之前选择了多个优惠券 循环判断是否已全部取消
let num = 0
this.UserCanUseCouponList.forEach(x=>{
if (x.active)
num +=1
})
if (num===0) {
this.CouponList.forEach(x=>{
x.active = false
})
this.UserCanUseCouponList = this.CouponList
}
}
}
if (this.UserCanUseCouponList.length>0) {
let CouponIds = ''
let CouponMoney = 0
let CouponSale = 1
let type = 0
this.UserCanUseCouponList.forEach((x, index)=>{
if (x.active) {
type = x.couponsType
CouponIds = CouponIds + x.id + (index!==this.UserCanUseCouponList.length-1 ? ',' : '')
if (x.couponsType === 1) {
CouponMoney = CouponMoney + x.denomination
} else {
CouponSale = CouponSale * (x.denomination/10)
}
}
})
this.CouponIds = CouponIds
if (type === 1) {
this.SettlementPrice = this.freeMsg.MySelfTotalPrice - CouponMoney
} else if (type === 2) {
this.SettlementPrice = this.freeMsg.MySelfTotalPrice * CouponSale
} else if (type === 0) {
this.SettlementPrice = this.freeMsg.MySelfTotalPrice
}
} else {
this.SettlementPrice = this.freeMsg.MySelfTotalPrice
}
// 计算幸福存折
// this.SettlementPrice = this.SettlementPrice - this.RedEnvelopeMoney
},
getUserCanUseCouponList: function () {
let msg = {
lineId: 0,
lineteamId: 0,
CouponsUseScope: 7,
}
this.apiJavaPost('/api/b2b/user/getUserCanUseCouponList',msg,res=>{
if(res.data.resultCode==1){
let data = res.data.data;
data.forEach(x=>{
x.active = false
})
this.CouponList = data
this.filterCoupon()
}else{
this.Error(res.data.message);
}
this.dataLoading = false;
},null)
},
filterCoupon: function () {
let list = []
this.CouponList.forEach(x=>{
if (this.freeMsg.MySelfTotalPrice>x.useCondition) {
x.active = false
list.push(x)
}
})
this.UserCanUseCouponList = list
},
GetCode(){
this.apiJavaPost('/api/b2b/user/updateUseCouponBycode',{ActivateCode:this.ActivateCode},res=>{
if(res.data.resultCode==1){
this.Success("兑换码激活成功!");
this.getUserCanUseCouponList();
}else{
this.Error("该兑换码无效!");
}
},null)
},
rePlace(str){
if(str.indexOf('KKday')!=-1){
return str.replace('KKday', '印象之旅');
......@@ -621,8 +810,10 @@ export default {
// console.log("可以下单")
// return;
this.BtnLoading=true;
this.apipost('dmc_post_Get_KKDayOrderBooking',this.freeMsg,res=>{
this.freeMsg.DiscountMoney = this.SettlementPrice == 0 ? 0 : this.freeMsg.MySelfTotalPrice - this.SettlementPrice;
this.freeMsg.CouponAllotIds = this.CouponIds;
this.freeMsg.CustomerPayMoney = this.SettlementPrice < 0 ? 0 : this.SettlementPrice;
this.apipost('dmc_post_Get_KKDayOrderBooking', this.freeMsg,res=>{
this.BtnLoading=false;
if(res.data.data&&res.data.data.orderId) {
......@@ -639,7 +830,7 @@ export default {
msg.costType=data.costType;
msg.attach=`${data.costType}|${userInfo.name}|${data.orderId}|${userInfo.customerId}|${data.RB_Branch_id}`;
sessionStorage.setItem("FreePay",JSON.stringify(msg));
this.$router.push({name:'FreePayBefore'})
this.$router.push({name:'FreePayBefore'})
}else{
this.$message.error(res.data.message)
}
......@@ -979,4 +1170,123 @@ export default {
float: left;
}
._coupon_box{
display: flex;
flex-wrap: wrap;
}
.OrderCon ._coupon_box ._coupon_item{
width: 224px;
padding: 12px 20px 12px 25px;
margin:0 26px 20px 0;
position: relative;
background-color: #F1BC69;
cursor: pointer;
}
._coupon_box ._coupon_item ._coupon_info p{
color: #FFFFFF;
}
._coupon_box ._coupon_item:hover{
background-color: #D9A24D;
}
._coupon_box ._coupon_item.blue{
background-color: #8794E2;
}
._coupon_box ._coupon_item.blue:hover{
background-color: #6776D2;
}
._coupon_box ._coupon_item.blue ._time{
color: #4C58A4 !important;
}
._coupon_box ._coupon_item._active{
background-color: #D9A24D;
}
._coupon_box ._coupon_item.blue._active{
background-color: #6776D2;
}
._coupon_box ._coupon_item.disab,._coupon_box ._coupon_item.blue.disab ._repeat,._coupon_box ._coupon_item.blue.disab ._info_time{
background-color: #C3C3C3 !important;
color: #777777 !important
}
._coupon_box ._coupon_item ._time{
color: #A7711C !important;
}
._coupon_box ._coupon_item ._left_raduis span{
display: inline-block;
width: 8px;
height: 8px;
margin: 2px 3px;
border-radius: 50%;
background-color: white;
}
._left_raduis{
width: 15px;
position: absolute;
left: -7px;
top: 0;
}
._coupon_box ._coupon_item ._coupon_info p{
font-size: 16px !important;
margin: 0
}
.OrderCon ._coupon_box ._coupon_item ._coupon_info p._coupon_name{
font-size: 14px !important;
margin-bottom: 10px;
max-width: 190px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap
}
._coupon_box ._coupon_item ._coupon_info p span._sale{
font-size: 24px;
}
.OrderCon ._coupon_box ._coupon_item ._coupon_info p._repeat{
padding: 0 5px;
color: #7C6F01;
position: absolute;
top: 0px;
right: 0px;
background-color: #FFE71B;
font-size: 12px !important;
}
._coupon_box ._coupon_item ._coupon_info ._info_full {
color: #FFFFFF;
font-size: 12px;
padding: 5px 0;
}
._coupon_box ._coupon_item ._coupon_info ._info_time {
font-size: 12px !important;
}
._choice_box{
height: 19px;
position: absolute;
right: 20px;
bottom: 14px;
}
._choice_box span{
width: 16px;
height: 16px;
border-radius: 50%;
line-height: 16px;
text-align: center;
background-color: white;
display: inline-block;
font-size: 12px !important;
}
.icon-xuanzhong2{
color: #31AA21;
}
._no_coupon{
width: 100%;
margin: 0 !important;
color: gray !important;
}
._trip_xiangqing_tips{
color: red !important;
font-size: 14px !important;
}
._trip_xiangqing_tips span{
color: #3965B0;
cursor: pointer;
}
</style>
......@@ -53,7 +53,13 @@
<el-col style="text-align:center" :span="6">{{oldModel.OldContent.price2_b2c}}</el-col>
</el-row>
</div>
<div class="f14" >
<el-row style="margin-bottom:7px">
<el-col :span="6">优惠金额</el-col>
<el-col :span="12"><div class="dashDiv"></div></el-col>
<el-col style="text-align:center" :span="6">{{oldModel.DiscountMoney}}</el-col>
</el-row>
</div>
</ul>
</div>
......@@ -101,7 +107,7 @@
</li>
<div class="btnDiv">
<span @click="Exit" v-if="IsCanOrder==0" style="border:1px solid #EE4454;color:#EE4454">取消订单</span>
<span @click="Pay" v-if="oldModel.Income!=oldModel.TotalPrice" style="background:#EE4454;color:#fff">立即付款</span>
<span @click="Pay" v-if="oldModel.Income!=oldModel.TotalPrice && oldModel.CustomerPayMoney > 0" style="background:#EE4454;color:#fff">立即付款</span>
</div>
</ul>
......@@ -239,7 +245,7 @@ export default {
let payInfoGo=this.payInfoGo;
msg.CancelTime=payInfoGo.CancelTime;
msg.OrderSource=15;
msg.total_fee=data.TotalPrice;
msg.total_fee=data.CustomerPayMoney;
msg.body=payInfoGo.Describe;
msg.orderId=data.OrderID;
msg.costType=payInfoGo.costType;
......
......@@ -230,6 +230,8 @@
</td>
<td class="money">
<p>总额 ¥{{item.TotalPrice | priceFormat}}</p>
<p v-if="item.DiscountMoney > 0">优惠金额 ¥{{item.DiscountMoney | priceFormat}}</p>
<p>应付金额 ¥{{item.CustomerPayMoney | priceFormat}}</p>
<p>实付金额 ¥{{item.Income | priceFormat}}</p>
<!-- <p class="__cp pay_no" v-if="!item.payShow" @click="item.payShow = true">已付总额 ¥{{item.customerPayMoney | priceFormat}} <i class="iconfont icon-xia"></i></p> -->
<!-- <p class="__cp pay_no" v-if="item.payShow" @click="item.payShow = false">已付总额 ¥{{item.customerPayMoney | priceFormat}} <i class="iconfont icon-xia shang"></i></p> -->
......@@ -247,7 +249,7 @@
<span>{{item.OrderStateStr}}</span>
</td>
<td>
<p style="margin-bottom:6px" v-if="item.Income!=item.TotalPrice &&item.OrderStatus!=2">
<p style="margin-bottom:6px" v-if="item.Income!=item.TotalPrice &&item.OrderStatus!=2 && item.CustomerPayMoney > 0">
<el-button @click="Pay(item)" size="mini" type="danger">立即支付</el-button>
</p>
......@@ -382,7 +384,7 @@ export default {
let data=item;
msg.CancelTime=data.EndTime;
msg.OrderSource=15;
msg.total_fee=data.TotalPrice;
msg.total_fee=data.CustomerPayMoney;
msg.body=data.Describe;
msg.orderId=data.OrderID;
msg.costType=data.costType;
......
......@@ -2,9 +2,6 @@
@import url('../../../assets/trip/trade/index.css');
._coupon_box{
border-bottom: 1px dashed #E5E5E5;
}
._no_coupon{
}
._pay_info{
margin: 20px 0 0 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment