Commit d5c5049f by wjw

wjw--订单详情增加报名状态

parent be976f6f
// pages/orderDetail/index.js
Page({
data: {
showNotice: false,
isFoodOrder: true,
orderBtnText: '去评价',
bottom: '0rpx',
swiperCurrent: 0,
showCodePopup: false,
// ticketInfo: {
// store: '元养水韵SPA',
// status: 1, // 0未使用 1待评价 2已过期 3已取消 4已评价
// time: '周一至周日 10:00 - 20:00',
// name: '文碧海',
// phone: '17612345222',
// useNum:'1件商品可用',
// useTime: '2019.09.30 - 2020.12.30',
// sealImg: './image/seal.png'
// },
// ticketInfo: {
// status: 1, // 0未使用 1待评价 2已过期 3已取消 4已评价 5待付款
// store: '拾光花坊插花分享会',
// date: '8月24日',
// time: '10:00 - 12:30',
// address: '拾光花坊2号厅',
// name: '文碧海',
// phone: '17612345222',
// useNum:'1件商品可用',
// useTime: '2019.09.30 - 2020.12.30',
// sealImg: './image/seal2.png'
// },
data: {
showNotice: false,
isFoodOrder: true,
orderBtnText: '去评价',
bottom: '0rpx',
swiperCurrent: 0,
showCodePopup: false,
codeUsed: false,
statusTips: '',
// ticketInfo: {
// store: '元养水韵SPA',
// status: 1, // 0未使用 1待评价 2已过期 3已取消 4已评价
// time: '周一至周日 10:00 - 20:00',
// name: '文碧海',
// phone: '17612345222',
// useNum:'1件商品可用',
// useTime: '2019.09.30 - 2020.12.30',
// sealImg: './image/seal.png'
// },
ticketInfo: {
status: 3, // 0未使用 1待评价 2已过期 3已取消 4已评价 5待付款
ticketType: 'food',
store: '拾光花坊插花分享会',
date: '8月24日',
time: '10:00 - 12:30',
address: '拾光花坊2号厅',
name: '文碧海',
phone: '17612345222',
useNum:'1件商品可用',
useTime: '2019.09.30 - 2020.12.30',
sealImg: './image/seal2.png'
},
// ticketInfo: {
// status: 1, // 0未使用 1待评价 2已过期 3已取消 4已评价 5待付款
// store: '夏日音乐盛典星光之夜主题演唱会',
// date: '8月24日 - 10月30日',
// time: '10:00 - 12:30',
// address: '世茂 · 碧海银湖营销展示中心前100米星光广场',
// name: '文碧海',
// phone: '17612345222',
// useNum:'1件商品可用',
// useTime: '2019.09.30 - 2020.12.30',
// sealImg: './image/seal2.png',
// sealImg2: './image/seal2-1.png'
// },
// ticketInfo: {
// status: 1, // 0未使用 1待评价 2已过期 3已取消 4已评价 5待付款
// store: '夏日音乐盛典星光之夜主题演唱会',
// date: '8月24日 - 10月30日',
// time: '10:00 - 12:30',
// address: '世茂 · 碧海银湖营销展示中心前100米星光广场',
// type: 'movie',
// status: 0, // 0未使用 1待评价 2已过期 3已取消 4已评价 5待付款
// store: '阿凡达',
// date: '8月24日 10:00 - 12:30',
// name: '文碧海',
// phone: '17612345222',
// useNum:'1件商品可用',
// useNum:'3张电影票',
// useTime: '2019.09.30 - 2020.12.30',
// sealImg: './image/seal2.png',
// sealImg2: './image/seal2-1.png'
// },
ticketInfo: {
type: 'movie',
status: 0, // 0未使用 1待评价 2已过期 3已取消 4已评价 5待付款
store: '阿凡达',
date: '8月24日 10:00 - 12:30',
name: '文碧海',
phone: '17612345222',
useNum:'3张电影票',
useTime: '2019.09.30 - 2020.12.30',
sealImg: './image/seal2.png',
sealImg2: './image/seal2-1.png'
},
goodsInfo:{
titleImg: './image/goods_title.png',
title: '海错图展馆',
list: [
{
id: 0,
infoText: '《海错图》展览单人门票',
img: './image/goods_item.png',
price: '30.60',
used: '查看券码'
},
{
id: 1,
infoText: '《海错图》展览单人门票',
img: './image/goods_item.png',
price: '30.60',
used: '已使用'
},
]
titleImg: './image/goods_title.png',
title: '海错图展馆',
list: [
{
id: 0,
infoText: '拾光花坊国际花艺设计咖啡烘焙基础知识交流分享会',
img: './image/goods_item.png',
price: '30.60',
used: '查看券码'
},
{
id: 1,
infoText: '《海错图》展览单人门票',
img: './image/goods_item.png',
price: '30.60',
used: '已使用'
},
]
},
// goodsInfo:{
// titleImg: './image/good2.png',
......@@ -102,77 +105,131 @@ Page({
score: 50
},
codeList: [
{
id: 0,
title: '《 阿凡达 》电影票',
img: './image/QRcode.png',
num: '2179 7092 0925'
},
{
id: 1,
title: '《 阿凡达 》电影票',
img: './image/QRcode.png',
num: '2179 7092 0925'
},
{
id: 2,
title: '《 阿凡达 》电影票',
img: './image/QRcode.png',
num: '2179 7092 0925'
}
{
id: 0,
title: '《 阿凡达 》电影票',
img: './image/QRcode.png',
num: '2179 7092 0925'
},
{
id: 1,
title: '《 阿凡达 》电影票',
img: './image/QRcode.png',
num: '2179 7092 0925'
},
{
id: 2,
title: '《 阿凡达 》电影票',
img: './image/QRcode.png',
num: '2179 7092 0925'
}
]
},
onShow() {
let statusText = ''
let status = this.data.ticketInfo.status
let orderBtnText = this.data.orderBtnText
let bottom = ''
if (status === 0) {
console.log(0)
bottom = '-32rpx'
} else if (status === 1) {
console.log(1)
statusText = '订单待评价',
orderBtnText = '去评价'
} else if (status === 2) {
statusText = '订单已过期'
} else if (status === 3) {
statusText = '订单已取消'
orderBtnText = '再次下单'
} else if (status === 4) {
statusText = '订单已评价'
} else {
statusText = '订单待付款'
orderBtnText = '去支付'
}
this.setData({
statusText,
orderBtnText,
bottom
})
},
handleQRcode() {
let showCodePopup = true
this.setData({
showCodePopup
})
},
closeQRcode() {
let showCodePopup = false
this.setData({
showCodePopup
})
},
handleNotice() {
let showNotice = true
this.setData({
showNotice
})
},
swiperChange(e) {
let swiperCurrent = e.detail.current
this.setData({
swiperCurrent
},
onShow() {
let statusText = ''
let statusTips = ''
let ticketInfo = this.data.ticketInfo
let orderBtnText = this.data.orderBtnText
let bottom = ''
if (ticketInfo.ticketType === 'active') {
switch (ticketInfo.status) {
case 0:
bottom = '-32rpx'
break
case 1:
statusText = '活动待评价',
statusTips = '评价本单获得10积分'
orderBtnText = '去评价'
break
case 2:
statusText = '活动已结束'
statusTips = '有效期2019.09.30 - 2020.12.30'
break
case 3:
statusText = '报名已取消'
statusTips = '报名后15分钟内未付款,自动取消报名'
orderBtnText = '再次报名'
break
case 4:
statusText = '活动已评价'
break
case 5:
statusText = '报名待付款'
statusTips = '请在14:59内付款,否则讲自动取消订单'
orderBtnText = '去支付'
break
}
} else {
switch (ticketInfo.status) {
case 0:
bottom = '-32rpx'
break
case 1:
statusText = '订单待评价',
orderBtnText = '去评价'
break
case 2:
statusText = '订单已过期'
statusTips = '有效期2019.09.30 - 2020.12.30'
break
case 3:
statusText = '订单已取消'
statusTips = '下单后15分钟内未付款,自动取消订单'
orderBtnText = '再次下单'
break
case 4:
statusText = '订单已评价'
break
case 5:
statusText = '订单待付款'
statusTips = '请在14:59内付款,否则讲自动取消订单'
orderBtnText = '去支付'
break
}
}
this.setData({
statusText,
orderBtnText,
statusTips,
bottom
})
},
handleQRcode() {
let showCodePopup = true
this.setData({
showCodePopup
})
},
closeQRcode() {
let showCodePopup = false
this.setData({
showCodePopup
})
},
handleNotice() {
let showNotice = true
this.setData({
showNotice
})
},
swiperChange(e) {
let swiperCurrent = e.detail.current
this.setData({
swiperCurrent
})
},
setClipboard(e) {
const index = e.currentTarget.dataset.index
const data = this.data.codeList[index].num
wx.setClipboardData({
data: data,
success (res) {
wx.getClipboardData({
success (res) {
console.log(res.data) // data
}
})
}
})
}
})
\ No newline at end of file
<view class="order-status col con-c {{ticketInfo.status === 1 ? 'bgPink' : ''}}" wx:if="{{ticketInfo.status !== 0}}">
<view class="status-text">{{statusText}}</view>
<view class="status-tips" wx:if="{{ticketInfo.status === 2}}">有效期2019.09.30 - 2020.12.30</view>
<view class="status-tips" wx:elif="{{ticketInfo.status === 3}}">下单后15分钟内未付款,自动取消订单</view>
<view class="status-tips" wx:elif="{{ticketInfo.status === 5}}">请在14:59内付款,否则讲自动取消订单</view>
<view class="status-tips" wx:if="{{statusTips}}">{{statusTips}}</view>
</view>
<view class="ticket-wrapper">
......@@ -66,10 +64,13 @@
<view class="code-img">
<image mode="widthFix" src="{{item.img}}"></image>
</view>
<view class="code-num-wrapper row align-c con-b">
<view class="code-num-title">券码{{index+1}}:</view>
<view class="code-num">{{item.num}}</view>
<view class="num-copy">复制</view>
<view class="code-num-wrapper row align-c con-a">
<view class="code-num-title {{codeUsed ? 'code-used' : ''}}">券码{{index+1}}:</view>
<view class="code-num {{codeUsed ? 'code-used' : ''}}">{{item.num}}</view>
<view class="num-copy" wx:if="{{!codeUsed}}" bindtap="setClipboard" data-index="{{index}}">复制</view>
</view>
<view class="code-used-seal" wx:if="{{codeUsed}}">
<image mode="widthFix" src="./image/used.png"></image>
</view>
</view>
</swiper-item>
......@@ -118,7 +119,7 @@
<view class="goods-item-img">
<image mode="widthFix" src="{{item.img}}"></image>
</view>
<view class="goods-item-info">
<view class="goods-item-info col con-a">
<view class="goods-item-info-text">{{item.infoText}}</view>
<view class="goods-item-info-price">
<text class="price-symbol">¥</text>
......@@ -126,7 +127,6 @@
</view>
</view>
<view class="goods-item-btn {{item.used === '已使用'?'disabled':''}}" bindtap="handleQRcode">{{item.used}}</view>
<!-- <view class="goods-item-btn"></view> -->
</view>
</view>
</view>
......
......@@ -122,6 +122,7 @@
height: 666rpx;
}
.code-item {
position: relative;
width: 526rpx;
height: 666rpx;
background-color: #fff;
......@@ -146,19 +147,32 @@
padding: 0 24rpx;
background-color: #F2F3F5;
border-radius: 4rpx;
line-height: 96rpx;
}
.code-num-title {
color: #959DA9;
text-decoration: none !important;
font-size: 26rpx;
}
.code-num {
color: #15191F;
font-size: 30rpx;
}
.code-used {
color: #C2C7CF;
text-decoration: line-through;
}
.num-copy {
color: #5DB5DD;
font-size: 26rpx;
}
.code-used-seal {
position: absolute;
right: -68rpx;
transform: translateY(56rpx);
width: 254rpx;
height: 254rpx;
}
.img-num {
margin-top: 54rpx;
}
......@@ -219,6 +233,7 @@
.goods-title {
color: #15191F;
font-size: 34rpx;
font-weight: 600;
}
.goods-list {
margin-top: 40rpx;
......@@ -256,7 +271,7 @@
}
.goods-item-info {
flex: 1;
padding: 0 32rpx 0 24rpx;
padding-left: 24rpx;
}
.goods-item-info-text {
color: #15191F;
......@@ -268,7 +283,6 @@
-webkit-line-clamp: 2;
}
.goods-item-info-price {
margin-top: 18rpx;
color: #15191F;
font-weight: 600;
}
......@@ -279,9 +293,10 @@
font-size: 26rpx;
}
.goods-item-btn {
margin-top: 40rpx;
width: 120rpx;
height: 56rpx;
margin-top: 40rpx;
margin-left: 32rpx;
color: #fff;
font-size: 22rpx;
text-align: center;
......
......@@ -119,8 +119,8 @@
},
{
"id": 7,
"name": "pages/pay/order-input/order-input",
"pathName": "pages/pay/order-input/order-input",
"name": "pages/pay/order-detail/order-detail",
"pathName": "pages/pay/order-detail/order-detail",
"query": "",
"scene": null
}
......
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 sign in to comment