Commit c4979ed0 authored by 罗超's avatar 罗超

Merge branch 'master' of http://gitlab.oytour.com/zk123/jz_travel

# Conflicts:
#	asset/css/flex.css
#	plugin/utils.js
parents c04b6053 0c23764b
...@@ -203,7 +203,13 @@ ...@@ -203,7 +203,13 @@
{ {
"root": "pages/coupon", "root": "pages/coupon",
"pages": [{ "pages": [{
"path": "list/list" "path": "list/list",
"style": {
"navigationStyle": "custom"
},
"globalStyle": {
"navigationStyle": "custom"
}
}, },
{ {
"path": "details/details", "path": "details/details",
......
<template> <template>
<view class="bgF5" <view class="bgF5" :class="[dataList.length==0||3>dataList.length?'height100vh':'height100']">
:class="[dataList.length==0||3>dataList.length?'height100vh':'height100']">
<view class="TicketOrderList-header bgFFF fixed row-sb-n z-index3"> <view class="TicketOrderList-header bgFFF fixed row-sb-n z-index3">
<view v-for="(item,index) in TicketOrderTyle" <view v-for="(item,index) in TicketOrderTyle" class="border1 hidden fz24 bgF5 textCenter" :class="[msg.orderState==item.Id?'borderDEBF7B':'borderF5']"
class="border1 hidden fz24 bgF5 textCenter"
:class="[msg.orderState==item.Id?'borderDEBF7B':'borderF5']"
@click="research(item.Id)"> @click="research(item.Id)">
{{item.Name}} {{item.Name}}
</view> </view>
</view> </view>
<u-empty v-if="dataList.length==0" text="暂无数据" mode="data"></u-empty> <u-empty v-if="dataList.length==0" text="暂无数据" mode="data"></u-empty>
<scroll-view v-else :scroll-y="true" style="background-color: #f0f4f7;" <scroll-view v-else :scroll-y="true" style="background-color: #f0f4f7;" :enable-back-to-top="true" :enable-flex="true"
:enable-back-to-top="true" :enable-flex="true"
@scrolltolower="lower" :style="{ 'height': `calc(100% - ${scrollHeight})`}"> @scrolltolower="lower" :style="{ 'height': `calc(100% - ${scrollHeight})`}">
<view class="TicketOrderListC"> <view class="TicketOrderListC">
<view class="TicketOrderList-box"> <view class="TicketOrderList-box">
<TicketOrderList :dataList="dataList" :msg="msg" @research="research"></TicketOrderList> <TicketOrderList :dataList="dataList" :msg="msg" @research="research"></TicketOrderList>
</view> </view>
<view style="padding:10px 0;"> <view style="padding:10px 0;">
<u-loadmore :status="status" :load-text="loadText" <u-loadmore :status="status" :load-text="loadText" :font-size="24" :margin-top="0" :margin-bottom="0" bg-color="#f0f4f7" />
:font-size="24" :margin-top="0"
:margin-bottom="0" bg-color="#f0f4f7" />
</view> </view>
</view> </view>
</scroll-view> </scroll-view>
...@@ -28,7 +22,9 @@ ...@@ -28,7 +22,9 @@
</template> </template>
<script> <script>
import TicketOrderList from "./components/TicketOrderList.vue"; import TicketOrderList from "./components/TicketOrderList.vue";
import { getDateWeek } from "./dates.js"; import {
getDateWeek
} from "./dates.js";
export default { export default {
components: { components: {
TicketOrderList TicketOrderList
...@@ -37,23 +33,34 @@ ...@@ -37,23 +33,34 @@
return { return {
scrollTop: 0, scrollTop: 0,
status: 'loadmore', status: 'loadmore',
msg:{ msg: {
pageIndex: 1, pageIndex: 1,
pageSize: 15, pageSize: 15,
//MiniAppUserId: 0, CustomerId: 0, //客户ID
orderType:-1, orderType: -1,
orderState: 0, orderState: 0,
GroupType:5,//线路订单 GroupType: 5, //机票订单
queryDays:0, queryDays: 0,
OutBranchId:-1 OutBranchId: -1
}, },
pageCount: 0, pageCount: 0,
dataList: [], dataList: [],
TicketOrderTyle:[ TicketOrderTyle: [{
{Name:'全部订单',Id:0}, Name: '全部订单',
{Name:'已付款',Id:3}, Id: 0
{Name:'待付款',Id:1}, },
{Name:'已取消',Id:4}, {
Name: '已付款',
Id: 3
},
{
Name: '待付款',
Id: 1
},
{
Name: '已取消',
Id: 4
},
], ],
loadText: { loadText: {
loadmore: "轻轻上拉,加载更多", loadmore: "轻轻上拉,加载更多",
...@@ -61,10 +68,13 @@ ...@@ -61,10 +68,13 @@
nomore: "没有更多了", nomore: "没有更多了",
}, },
scrollHeight: '30px', scrollHeight: '30px',
b2b_user_info: {},
} }
}, },
onLoad(options){ onLoad(options) {
this.msg.orderState = options.orderState?options.orderState:0 this.msg.orderState = options.orderState ? options.orderState : 0;
this.b2b_user_info = uni.getStorageSync('b2b_user');
this.msg.CustomerId = this.b2b_user_info.customerId;
}, },
created() {}, created() {},
onShow() { onShow() {
...@@ -104,8 +114,8 @@ ...@@ -104,8 +114,8 @@
this.msg, this.msg,
(res) => { (res) => {
if (res.resultCode == 1) { if (res.resultCode == 1) {
let arr = function(list){ let arr = function(list) {
list.forEach(x=>{ list.forEach(x => {
x.time = '' x.time = ''
x.week = '' x.week = ''
x.duration = '' x.duration = ''
...@@ -116,33 +126,35 @@ ...@@ -116,33 +126,35 @@
}) })
} }
arr(res.data.pageData) arr(res.data.pageData)
res.data.pageData.forEach(x=>{ res.data.pageData.forEach(x => {
arr(x.flightList) arr(x.flightList)
}) })
res.data.pageData.forEach(x=>{ res.data.pageData.forEach(x => {
if(x.flightList.length>2){ if (x.flightList.length > 2) {
x.different = 1 x.different = 1
} }
let FlightList = x.flightList.filter(z=>{ let FlightList = x.flightList.filter(z => {
return z.flightSubType!=3 return z.flightSubType != 3
}) })
let FlightList2 = x.flightList.filter(z=>{ let FlightList2 = x.flightList.filter(z => {
return z.flightSubType==3 return z.flightSubType == 3
}) })
x.flightList.forEach((y,index)=>{ x.flightList.forEach((y, index) => {
let date = y.flightDate.split('-') let date = y.flightDate.split('-')
y.time = `${date[1]}-${date[2]}` y.time = `${date[1]}-${date[2]}`
y.week = getDateWeek(y.flightDate) y.week = getDateWeek(y.flightDate)
if(index==0){ if (index == 0) {
y.frequency = FlightList.length-1 y.frequency = FlightList.length - 1
y.duration = `${x.departureTime.days>0?x.departureTime.days+'d ':''}${x.departureTime.hours>0?x.departureTime.hours+'h ':''}${x.departureTime.minutes>0?x.departureTime.minutes+'m ':''}` y.duration =
`${x.departureTime.days>0?x.departureTime.days+'d ':''}${x.departureTime.hours>0?x.departureTime.hours+'h ':''}${x.departureTime.minutes>0?x.departureTime.minutes+'m ':''}`
x.NewFlightList.push(y) x.NewFlightList.push(y)
} }
if(x.flightList.length-1==index){ if (x.flightList.length - 1 == index) {
y.frequency = FlightList2.length-1 y.frequency = FlightList2.length - 1
y.duration = `${x.arrivalTime.days>0?x.arrivalTime.days+'d ':''}${x.arrivalTime.hours>0?x.arrivalTime.hours+'h ':''}${x.arrivalTime.minutes>0?x.arrivalTime.minutes+'m ':''}` y.duration =
`${x.arrivalTime.days>0?x.arrivalTime.days+'d ':''}${x.arrivalTime.hours>0?x.arrivalTime.hours+'h ':''}${x.arrivalTime.minutes>0?x.arrivalTime.minutes+'m ':''}`
x.NewFlightList.push(y) x.NewFlightList.push(y)
} }
}) })
...@@ -153,7 +165,7 @@ ...@@ -153,7 +165,7 @@
this.dataList = this.dataList.concat(res.data.pageData); this.dataList = this.dataList.concat(res.data.pageData);
} }
this.pageCount = res.data.pageCount; this.pageCount = res.data.pageCount;
if(this.pageCount==1) this.status = "nomore"; if (this.pageCount == 1) this.status = "nomore";
} }
uni.hideLoading() uni.hideLoading()
} }
...@@ -173,24 +185,28 @@ ...@@ -173,24 +185,28 @@
} }
</script> </script>
<style scoped> <style scoped>
@import url("@/asset/css/flex.css"); @import url("@/asset/css/flex.css");
@import url("./style.css"); @import url("./style.css");
.TicketOrderList-header{
.TicketOrderList-header {
left: 0; left: 0;
right: 0; right: 0;
top: 0; top: 0;
padding: 27rpx 54rpx; padding: 27rpx 54rpx;
} }
.TicketOrderList-header>view{
.TicketOrderList-header>view {
width: 135rpx; width: 135rpx;
padding: 15rpx 0; padding: 15rpx 0;
border-radius: 20rpx; border-radius: 20rpx;
} }
.TicketOrderListC{
.TicketOrderListC {
padding-top: 145rpx; padding-top: 145rpx;
} }
.TicketOrderList-box{
.TicketOrderList-box {
padding: 0 54rpx; padding: 0 54rpx;
padding-bottom: 49rpx; padding-bottom: 49rpx;
} }
</style> </style>
...@@ -46,11 +46,20 @@ ...@@ -46,11 +46,20 @@
<view class="cdTiaojianBRight"> <view class="cdTiaojianBRight">
<view class="cdTiaojianBRTitle">使用说明</view> <view class="cdTiaojianBRTitle">使用说明</view>
<view class="cdTiaojianBRText">券类型:{{ g.couponsType==1?'抵用券':'折扣券' }}</view> <view class="cdTiaojianBRText">券类型:{{ g.couponsType==1?'抵用券':'折扣券' }}</view>
<view class="cdTiaojianBRText">使用范围:{{ g.couponsUseScopeName }}</view> <view class="cdTiaojianBRText">使用范围:
<template v-if="g.couponsUseScopeName">
{{ g.couponsUseScopeName }}
</template>
<template v-if="g.couponsUseScope">
{{ g.couponsUseScope }}
</template>
</view>
<view class="cdTiaojianBRText" v-if="g.remark&&g.remark!=''">备注:{{ g.remark }}</view> <view class="cdTiaojianBRText" v-if="g.remark&&g.remark!=''">备注:{{ g.remark }}</view>
</view> </view>
</view> </view>
<view class="cdTiaojianButtom" @click="gouseUrl(g)">立即使用</view> <view class="cdTiaojianButtom" v-if="type==1" @click="gouseUrl(g)">立即使用</view>
<view class="cdTiaojianButtom" v-else @click="g.couponReceiveCount==0?receive(g.couponReceiveCount):gouseUrl(g)">{{ g.couponReceiveCount==0?'立即领取':'立即使用' }}</view>
</view> </view>
</view> </view>
</template> </template>
...@@ -98,25 +107,26 @@ ...@@ -98,25 +107,26 @@
console.log("this.g", this.g); console.log("this.g", this.g);
}, },
methods: { methods: {
receive(id) { receive(id){
this.request2({ this.apipost("b2c_post_CustomerGrantCoupon", {
url: '/api/AppletUser/GrantCoupon', Id: id
data: { }, (res) => {
CouponId: id
}
},
(res) => {
if (res.resultCode == 1) { if (res.resultCode == 1) {
uni.showToast({ uni.showToast({
title: res.message, title: res.message,
icon: "none" icon: "none"
}); });
this.g.IsReceive = 1; this.g.couponReceiveCount=1;
}
} }
); }, (failed) => {
}, uni.showToast({
title: failed.message,
icon: "none",
});
}, (error) => {
})
},
gouseUrl(g) { gouseUrl(g) {
uni.redirectTo({ uni.redirectTo({
......
...@@ -408,6 +408,7 @@ ...@@ -408,6 +408,7 @@
} }
.couponStyle .item .miane .tiaojian { .couponStyle .item .miane .tiaojian {
width: 146rpx;
font-size: 24rpx; font-size: 24rpx;
text-align: center; text-align: center;
margin-top: 2px; margin-top: 2px;
......
This diff is collapsed.
...@@ -17,12 +17,6 @@ function SystemInfo() {//获取屏幕宽高 ...@@ -17,12 +17,6 @@ function SystemInfo() {//获取屏幕宽高
}) })
return SystemInfo return SystemInfo
} }
function getWeekName(date) {
const weeks = ['周日','周一','周二','周三','周四','周五','周六']
const currentDate = new Date(date)
const i = currentDate.getDay()
return weeks[i]
}
function getRect(selector) {//获取元素的信息 function getRect(selector) {//获取元素的信息
return new Promise((resolve) => { return new Promise((resolve) => {
let view = uni.createSelectorQuery().select(selector); let view = uni.createSelectorQuery().select(selector);
...@@ -154,6 +148,29 @@ function VersionUpdate() { ...@@ -154,6 +148,29 @@ function VersionUpdate() {
} }
} }
//方法二
function formatDates(date, fmt) {
if (/(y+)/.test(fmt)) {
fmt = fmt.replace(RegExp.$1, (date.getFullYear() + '').substr(4 - RegExp.$1.length));
}
let o = {
'M+': date.getMonth() + 1,
'd+': date.getDate(),
'h+': date.getHours(),
'm+': date.getMinutes(),
's+': date.getSeconds()
};
for (let k in o) {
if (new RegExp(`(${k})`).test(fmt)) {
let str = o[k] + '';
fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1) ? str : padLeftZero(str));
}
}
return fmt;
};
function padLeftZero(str) {
return ('00' + str).substr(str.length);
}
export default { export default {
calcContentHeight, calcContentHeight,
SystemInfo, SystemInfo,
...@@ -163,5 +180,5 @@ export default { ...@@ -163,5 +180,5 @@ export default {
SubscribeMsgAli, SubscribeMsgAli,
// #endif // #endif
VersionUpdate, VersionUpdate,
getWeekName formatDates,
} }
\ No newline at end of file
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