Commit 954a0c03 authored by 罗超's avatar 罗超

部分功能更新

parent 97a65a45
......@@ -5,7 +5,12 @@
<img src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/couponsbg.png" mode="widthFix" />
<view class="coupons-box">
<text style="font-size: 18px;color: #FFFFFF;">恭喜获得{{msgtype==1?'优惠券':'积分'}}</text>
<text style="font-size: 14px;color: #FDE005;;margin-top: 20rpx;" v-for="(x,i) in msgs" :key="i">{{x}}</text>
<scroll-view scroll-y="true" style="max-height: 80px;">
<view style="font-size: 14px;color: #FDE005;;margin-top: 20rpx; text-align: center;" v-for="(x,i) in msgs" :key="i">
{{x.Name}}
<text v-if="x.Num>0">*{{x.Num}}</text>
</view>
</scroll-view>
<text style="font-size: 12px;color: #FDE005;;margin-top: 20rpx;" v-if="cform!=null && cform!=''">{{cform}}</text>
<view class="btn" @click="goLook">
<text>立即查看</text>
......@@ -42,10 +47,11 @@
},
created() {
if(typeof this.couponMessage == 'string'){
this.msgs.push(this.couponMessage)
this.msgs.push({Name:this.couponMessage,Num:-1})
}else{
this.msgs = this.couponMessage
}
uni.removeStorageSync('coupons')
},
methods: {
goLook() {
......@@ -114,6 +120,6 @@
justify-content: center;
font-size: 36rpx;
color: #1A1A1A;
margin-top: 70rpx;
margin-top: 40rpx;
}
</style>
......@@ -30,7 +30,7 @@
<scroll-view :scroll-y="true" :enable-back-to-top="true" :enable-flex="true" @scrolltolower="lower" :style="{ height: '100%' }">
<view class="couponList">
<view class="couponListBox" :class="[x.couponsUseScope>0&&msg.CouponStatus!=3?'active'+x.couponsUseScope:'active0']"
v-for="(x, i) in couponDataList" :key="i">
v-for="(x, i) in couponDataList" :key="i" @click.stop="msg.CouponStatus!=3?godetails(x):''">
<view class="item">
<view :style="{'background-image':`url(${x.backGroubd}) `}" class="couponItemLeft">
<view class="miane">
......@@ -45,17 +45,17 @@
</view>
<view class="detail">
<view class="coupond">
<view class="name" style="font-family:'microsoft yahei ui light';">
<view class="nameText">{{ x.couponName }}</view>
<view class="name" style="font-family:'microsoft yahei ui light'; display: flex; align-items: center;">
<view class="nameText" style="width: 1px; flex: 1;">{{ x.couponName }}</view>
<view class="nameType">{{x.couponsUseScopeName}}</view>
</view>
<view class="coupondLineTb">
<view class="coupondLineTb" >
<view class="coupondLineTbt">
<template v-if="x.CouponsUseScopeNameStr&&x.CouponsUseScopeName!=''">适用线路:{{x.CouponsUseScopeNameStr}}</template>
<template v-if="x.lineteamNameStr&&x.lineteamNameStr!=''">适用系列:{{x.lineteamNameStr}}</template>
<template v-if="x.remark&&x.remark!=''">{{x.remark}}</template>
</view>
<view class="coupondLineGo" @click.stop="msg.CouponStatus!=3?godetails(x):''">{{msg.CouponStatus!=3?'去使用':'已过期'}}</view>
<!-- <view class="coupondLineGo" @click.stop="msg.CouponStatus!=3?godetails(x):''">{{msg.CouponStatus!=3?'详情':'已过期'}}</view> -->
</view>
<view class="date">{{x.effectDate}}至{{ x.expirationDate }}</view>
</view>
......@@ -230,6 +230,7 @@
},
init() {
this.loading = true;
if(this.msg.pageIndex==1) this.couponDataList = []
this.apipost("coupon_post_GetUserCanUseCouponPageList", this.msg, (res) => {
this.loading = false;
if (res.resultCode == 1) {
......@@ -239,8 +240,8 @@
})
}
arrList(res.data.pageData)
this.couponDataList = res.data.pageData;
this.couponDataList.forEach((x,index) => {
const d = res.data.pageData;
d.forEach((x,index) => {
if(this.msg.CouponStatus!=3){
if(x.couponsUseScope==1) x.backGroubd = this.lineImgs[0]
if(x.couponsUseScope==2) x.backGroubd = this.lineImgs[1]
......@@ -259,6 +260,7 @@
})
this.page_count = res.data.pageCount;
this.couponDataList = this.couponDataList.concat(d)
if(this.page_count==1) this.status = 'nomore'
console.log("this.couponDataList", this.couponDataList)
}
......@@ -661,7 +663,7 @@
}
.coupondLineTbt {
height: 56rpx;
max-height: 56rpx;
word-break: break-all;
text-overflow: ellipsis;
display: -webkit-box;
......@@ -686,6 +688,7 @@
font-size: 22rpx;
text-align: center;
line-height: 44rpx;
background: rgba(0,0,0,.3) !important;
}
.couponListBox.active0 .coupondLineGo {
......
......@@ -269,10 +269,11 @@
}
}
let mall_UserInfo = uni.getStorageSync("mall_UserInfo");
//同行联系人绑定的优惠卷
if (options && options.isCustomerCoupon && options.isCustomerCoupon == "1") {
if (uni.getStorageSync('coupons')) {
this.showCoupons = true;
this.couponMessage = options.couponMessage;
this.couponMessage = uni.getStorageSync('coupons');
}
if (options && options.Up) {
//校园id
......
......@@ -77,8 +77,13 @@
uni.removeStorageSync('mall_UserInfo')
let tempData = res.data;
if (tempData && tempData.Id && tempData.Id > 0) {
let newUrl = '/pages/index/index?isCustomerCoupon=1&couponMessage=' + tempData.CouponsName + '&msgtype=' +
tempData.CouponsType;
if(tempData.CounponList){
uni.setStorageSync('coupons',tempData.CounponList)
}else{
uni.setStorageSync('coupons',[{Name:tempData.CouponsName,Num:1}])
}
let newUrl = '/pages/index/index';
uni.redirectTo({
url: newUrl
})
......
......@@ -80,7 +80,7 @@
(line < end[0] && line > start[0])
? 'bg-higlt-orange'
: '',
line == 0 && index + 1 < nowDay ? 'time-out' : '',
(line == 0 && index + 1 < nowDay) ? 'time-out' : '',
isNaN(item) ? 'is-festival' : '',
(isNaN(item) && line == start[0] && index == start[1]) ||
(isNaN(item) && line == end[0] && index == end[1])
......@@ -122,8 +122,7 @@
style="font-size: 12px; padding-bottom: 3px"
v-if="priceStauts.length > 0"
>
<view v-if="priceStauts[line][index] > 0"
>{{ priceStauts[line][index] }}</view
<view v-if="priceStauts[line][index] > 0" style="color:#FF3166">{{ priceStauts[line][index] }}</view
>
<view v-if="priceStauts[line][index] < 0">售罄</view>
</view>
......@@ -267,6 +266,7 @@ export default {
this.start = this.setDefaultDate(this.userDefaultDate);
}
this.priceStauts = this.initPrice();
console.log(this.priceStauts)
},
//入住日期
start(newVal) {
......@@ -317,27 +317,41 @@ export default {
let data = [];
//月份
var month = new Date().getMonth();
console.log('执行。。。。')
for (let i = 0; i < this.count; i++) {
var days = [];
var week = 0;
for (var j = 0; j < new Date(year, month + 1, 0).getDate(); j++) {
let isexsit = false;
this.priceList.forEach((x) => {
let m = month + 1 > 9 ? month + 1 : "0" + (month + 1);
let d = j + 1 > 9 ? j + 1 : "0" + (j + 1);
if (x.startDate == `${year}-${m}-${d}`) {
isexsit = true;
if (x.remainNum > 0) {
days.push(this.$utils.getretailer() ? x.b2BPrice : x.b2CPrice);
//days.push(x.b2CPrice);
} else {
days.push(-1);
}
}
});
if (!isexsit) {
days.push(0);
}
const m = month + 1 > 9 ? month + 1 : "0" + (month + 1);
const d = j + 1 > 9 ? j + 1 : "0" + (j + 1);
const ds =`${year}-${m}-${d}`
const price = this.priceList.find(p=>p.startDate==ds)
if(price){
isexsit = true
days.push(price.remainNum > 0?(this.$utils.getretailer() ? price.b2BPrice : price.b2CPrice):-1)
}else{
days.push(0);
}
console.log(this.priceList.length,new Date(year, month + 1, 0).getDate(),price)
// for (var k = 0; k < this.priceList.length; k++) {
// const x = this.priceList[k];
// console.log(x)
// }
// this.priceList.forEach((x) => {
// let m = month + 1 > 9 ? month + 1 : "0" + (month + 1);
// let d = j + 1 > 9 ? j + 1 : "0" + (j + 1);
// //console.log(x.startDate+'-----'+`${year}-${m}-${d}`)
// if (x.startDate == `${year}-${m}-${d}`) {
// isexsit = true;
// if (x.remainNum > 0) {
// days.push(this.$utils.getretailer() ? x.b2BPrice : x.b2CPrice);
// //days.push(x.b2CPrice);
// } else {
// days.push(-1);
// }
// }
// });
}
data.push(days);
if (month == 11) {
......
......@@ -106,7 +106,7 @@
<u-icon name="5wodejifen" custom-prefix='tffont' color="#cecece" size="40" style="position: relative;z-index: 2;" ></u-icon>
<text style="color:#cecece; margin-left: 5px;">会员积分</text>
<view style="text-align: right;" class="col">
<text>预计可</text>
<text>预计可</text>
<text style="color:#ff3166; ">{{ (currentPrice.b2BPrice/100).toFixed(2) }}</text>
<text></text>
</view>
......@@ -215,7 +215,7 @@
<text style="font-size: 28rpx; font-weight: 600">{{ item.remainNum }}</text>
</view>
<view v-if="item.remainNum > 0" style="color: #ff3166; font-size: 26rpx">
{{ $utils.getretailer()?currentPrice.b2BPrice:currentPrice.b2CPrice}}</view>
{{ $utils.getretailer()?item.b2BPrice:item.b2CPrice}}</view>
<view v-if="item.remainNum <= 0" style="padding: 20rpx 0">
<text style="font-size: 32rpx; font-weight: 600">已售罄</text>
</view>
......
......@@ -144,17 +144,20 @@
<!-- #ifdef MP-ALIPAY -->
<subscribe-msg />
<!-- #endif -->
<tabbars></tabbars>
<!-- <tabbars></tabbars> -->
<auth v-if="showAuth" @changeuserinfo="reloadUserinfo" @gbAuth="gbAuth"></auth>
<coupons v-if="showCoupons" :coupon-message="couponMessage" @goLook="()=>showCoupons=false" @closeBtn="()=>showCoupons=false"></coupons>
</view>
</template>
<script>
import tabbars from "@/components/tabbar/index";
import auth from "@/components/auth/index.vue";
import coupons from "@/components/coupons/coupons.vue";
export default {
components: {
tabbars,
auth
auth,
coupons
},
data() {
return {
......@@ -169,6 +172,8 @@
MiniAppUserId: 0, //旅小友小程序用户Id,
DirectCustomerId: 0, //直客Id
},
showCoupons:false,
couponMessage:[],
mainColor: "",
list: [{
name: "全部",
......@@ -234,6 +239,11 @@
} else {
this.getOrderInfo();
}
//同行联系人绑定的优惠卷
if (uni.getStorageSync('coupons')) {
this.showCoupons = true;
this.couponMessage = uni.getStorageSync('coupons');
}
},
methods: {
//获取订单状态名称
......
......@@ -871,6 +871,10 @@
msg,
(res) => {
if (res.resultCode == 1) {
const tempData = res.data
if(tempData.CounponList){
uni.setStorageSync('coupons',tempData.CounponList)
}
uni.showToast({
title: '订单创建成功.',
icon: 'none'
......
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