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

部分功能更新

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