Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
严立
/
mini-shimao
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
573bd2f4
authored
Sep 22, 2020
by
严立
Browse files
Options
_('Browse Files')
Download
Plain Diff
Merge branch 'master' of
http://120.77.182.185/yanl/mini-shimao
parents
45962e2d
fa9f0e8c
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
335 additions
and
144 deletions
pages/mine/appointment/appointment.js
pages/mine/appointment/appointment.wxml
pages/mine/home/home.wxml
pages/mine/order/order.js
pages/pay/order-comment/order-comment.js
pages/pay/order-comment/order-comment.wxml
project.config.json
pages/mine/appointment/appointment.js
View file @
573bd2f4
...
@@ -12,6 +12,8 @@ Page({
...
@@ -12,6 +12,8 @@ Page({
* 页面的初始数据
* 页面的初始数据
*/
*/
data
:
{
data
:
{
isDoing
:
false
,
pageNo
:
1
,
// 导航栏相关属性
// 导航栏相关属性
navigationStyle
:
{
navigationStyle
:
{
normal
:
{
normal
:
{
...
@@ -43,97 +45,74 @@ Page({
...
@@ -43,97 +45,74 @@ Page({
],
],
// 订单状态(-1已取消, 0未付款, 2待使用, 3已使用, 4已过期 6已关闭)
// 订单状态(-1已取消, 0未付款, 2待使用, 3已使用, 4已过期 6已关闭)
// 活动状态(0 未开始 1进行中 2 已结束)
// 活动状态(0 未开始 1进行中 2 已结束)
activityList
:
[
activityList
:
[],
// {
data
:
[
// 假数据数组,type=0入园预约,type=1 看房预约
// orderId: 0,
// name: '海滩夏日音乐节',
// status: '0',
// activeState: '0',
// cover: '',
// date: '6月30日 10:00-12:00',
// address: '云之亭广场外侧',
// num: 3,
// amount: '326.00'
// },
// {
// orderId: 1,
// name: '海滩夏日音乐节',
// status: '2',
// activeState: '0',
// cover: '',
// date: '6月30日 10:00-12:00',
// address: '云之亭广场外侧',
// num: 3,
// amount: '326.00'
// },
// {
// orderId: 2,
// name: '海滩夏日音乐节海滩夏日音乐节海滩夏日音乐节海滩夏日音乐节',
// status: '2',
// activeState: '1',
// cover: '',
// date: '6月30日 10:00-12:00',
// address: '云之亭广场外侧云之亭广场外侧云之亭广场外侧云之亭广场外侧云之亭广场外侧',
// num: 3,
// amount: '326.00'
// },
// {
// orderId: 2,
// name: '海滩夏日音乐节海滩夏日音乐节海滩夏日音乐节海滩夏日音乐节',
// status: '3',
// activeState: '2',
// cover: '',
// date: '6月30日 10:00-12:00',
// address: '云之亭广场外侧云之亭广场外侧云之亭广场外侧云之亭广场外侧云之亭广场外侧',
// num: 3,
// amount: '326.00'
// },
// {
// {
// orderId: 2,
// title: '夜间入园预约',
// name: '海滩夏日音乐节海滩夏日音乐节海滩夏日音乐节海滩夏日音乐节',
// type: '0',
// status: '4',
// time: '6月30日 20:00-24:00',
// activeState: '1',
// cover: '',
// date: '6月30日 10:00-12:00',
// address: '云之亭广场外侧云之亭广场外侧云之亭广场外侧云之亭广场外侧云之亭广场外侧',
// num: 3,
// num: 3,
//
amount: '326.00
'
//
url: 'http://upload.miaomiao-bao.com/36acd202008141719598303.jpg
'
// },
// },
// {
// {
// orderId: 2,
// title: '看房预约',
// name: '海滩夏日音乐节海滩夏日音乐节海滩夏日音乐节海滩夏日音乐节',
// type: '1',
// status: '-1',
// time: '6月30日',
// activeState: '1',
// cover: '',
// date: '6月30日 10:00-12:00',
// address: '云之亭广场外侧云之亭广场外侧云之亭广场外侧云之亭广场外侧云之亭广场外侧',
// num: 3,
// num: 3,
//
amount: '326.00
'
//
url: ' http://upload.miaomiao-bao.com/4c644202008141702599692.jpg
'
// },
// },
],
],
data
:
[
// 假数据数组,type=0入园预约,type=1 看房预约
{
title
:
'夜间入园预约'
,
type
:
'0'
,
time
:
'6月30日 20:00-24:00'
,
num
:
3
,
url
:
'http://upload.miaomiao-bao.com/36acd202008141719598303.jpg'
},
{
title
:
'看房预约'
,
type
:
'1'
,
time
:
'6月30日'
,
num
:
3
,
url
:
' http://upload.miaomiao-bao.com/4c644202008141702599692.jpg'
},
],
active
:
0
,
active
:
0
,
height
:
0
,
height
:
0
,
},
},
/**
* 生命周期函数--监听页面加载
*/
onLoad
:
function
(
options
)
{
let
type
=
options
.
tab
?
1
*
options
.
tab
:
0
this
.
setData
({
height
:
wx
.
getSystemInfoSync
().
windowHeight
,
//获取屏幕的高度
active
:
type
})
if
(
type
===
0
)
{
this
.
getActivity
()
}
else
{
this
.
getList
(
type
)
}
},
// 去使用
onOrderUse
:
function
(
event
)
{
this
.
onOrderDetail
(
event
)
},
/**
* 订单评价
* @function
* @param
* @returns
*/
onOrderEvaluate
:
function
(
event
)
{
let
item
=
JSON
.
stringify
(
event
.
currentTarget
.
dataset
.
item
)
wx
.
navigateTo
({
url
:
`/pages/pay/order-comment/order-comment?orderItem=
${
item
}
&pageFrom=activityList`
,
})
},
// 跳转详情页面
onOrderDetail
:
function
(
event
)
{
let
funcItem
=
event
.
currentTarget
.
dataset
.
item
wx
.
navigateTo
({
url
:
'/pages/pay/order-detail/order-detail?id='
+
funcItem
.
orderId
,
})
},
// 点击导航切换,默认是全部的
// 点击导航切换,默认是全部的
chageNav
(
e
)
{
chageNav
(
e
)
{
let
index
=
e
.
currentTarget
.
dataset
.
index
let
index
=
e
.
currentTarget
.
dataset
.
index
if
(
index
===
0
)
{
if
(
index
===
0
)
{
this
.
setData
({
pageNo
:
1
,
activityList
:
[]
})
this
.
getActivity
()
this
.
getActivity
()
}
else
{
}
else
{
this
.
getList
(
index
)
this
.
getList
(
index
)
...
@@ -142,11 +121,44 @@ Page({
...
@@ -142,11 +121,44 @@ Page({
active
:
index
active
:
index
})
})
},
},
/**
* 订单支付
* @function
* @param
* @returns
*/
onOrderPay
:
function
(
event
)
{
// 数据校验不通过
let
that
=
this
let
funcItem
=
event
.
currentTarget
.
dataset
.
item
let
wxRequest
=
funcItem
.
wxRequest
// 待支付返回的wx支付参数
if
(
wxRequest
)
{
wx
.
requestPayment
({
timeStamp
:
wxRequest
.
timeStamp
,
nonceStr
:
wxRequest
.
nonceStr
,
package
:
wxRequest
.
package
,
signType
:
wxRequest
.
signType
,
paySign
:
wxRequest
.
paySign
,
success
(
res
)
{
that
.
setData
({
'orderList'
:
[],
'orderPages'
:
1
,
})
that
.
queryOrder
()
},
fail
(
res
)
{}
})
}
},
//预约凭证
//预约凭证
gohotelAccommodation
(
e
)
{
gohotelAccommodation
(
e
)
{
console
.
log
(
e
)
wx
.
navigateTo
({
wx
.
navigateTo
({
url
:
'
../hotelAccommodation/hotelAccommodation
?detail='
+
JSON
.
stringify
(
e
.
currentTarget
.
dataset
.
item
),
url
:
'
/pages/mine/appointment-ticket/appointment-ticket
?detail='
+
JSON
.
stringify
(
e
.
currentTarget
.
dataset
.
item
),
})
})
},
},
//预约
//预约
...
@@ -166,22 +178,7 @@ Page({
...
@@ -166,22 +178,7 @@ Page({
url
:
url
url
:
url
})
})
},
},
/**
* 生命周期函数--监听页面加载
*/
onLoad
:
function
(
options
)
{
let
type
=
options
.
tab
?
1
*
options
.
tab
:
0
this
.
setData
({
height
:
wx
.
getSystemInfoSync
().
windowHeight
,
//获取屏幕的高度
active
:
type
})
if
(
type
===
0
)
{
this
.
getActivity
()
}
else
{
this
.
getList
(
type
)
}
},
// 页面滚动
// 页面滚动
onPageScroll
:
function
(
funcEvent
)
{
onPageScroll
:
function
(
funcEvent
)
{
// 优化滚动事件触发频率
// 优化滚动事件触发频率
...
@@ -197,6 +194,55 @@ Page({
...
@@ -197,6 +194,55 @@ Page({
clearTimeout
(
logicData
.
pageScrollTimer
)
clearTimeout
(
logicData
.
pageScrollTimer
)
},
10
)
},
10
)
},
},
// 删除,取消预约
doCancel
:
function
(
event
)
{
let
that
=
this
wx
.
lin
.
showDialog
({
type
:
"confirm"
,
title
:
""
,
content
:
"是否确认删除报名"
,
success
:
(
res
)
=>
{
if
(
res
.
confirm
)
{
console
.
log
(
'用户点击确定'
)
wx
.
showLoading
({
title
:
'处理中'
,
mask
:
true
})
this
.
setData
({
isDoing
:
true
})
let
funcItem
=
event
.
target
.
dataset
.
item
App
.
wxRequest
({
url
:
'/api/v1/activity/doCancel'
,
data
:
{
'enrollId'
:
funcItem
.
enrollId
,
'type'
:
1
,
//0取消1删除
},
success
:
(
response
)
=>
{
wx
.
hideLoading
()
wx
.
lin
.
showToast
({
image
:
'/image/success.png'
,
title
:
'删除成功'
,
})
setTimeout
(()
=>
{
that
.
setData
({
isDoing
:
false
,
'activityList'
:
[],
'pageNo'
:
1
,
})
that
.
getActivity
()
},
2000
);
}
})
}
else
if
(
res
.
cancel
)
{
console
.
log
(
'用户点击取消'
)
}
}
})
},
// 我的活动
// 我的活动
getActivity
:
function
()
{
getActivity
:
function
()
{
let
that
=
this
let
that
=
this
...
@@ -208,7 +254,7 @@ Page({
...
@@ -208,7 +254,7 @@ Page({
data
:
{
data
:
{
activeState
:
''
,
//""全部 0 未开始 1进行中 2已结束
activeState
:
''
,
//""全部 0 未开始 1进行中 2已结束
pageSize
:
'10'
,
pageSize
:
'10'
,
pageNo
:
'1'
,
pageNo
:
this
.
data
.
pageNo
,
type
:
'1'
type
:
'1'
},
},
success
:
function
(
res
)
{
success
:
function
(
res
)
{
...
@@ -225,7 +271,7 @@ Page({
...
@@ -225,7 +271,7 @@ Page({
status
:
item
.
status
,
// 订单状态(-1已取消, 0未付款, 2待使用, 3已使用, 4已过期 6已关闭)
status
:
item
.
status
,
// 订单状态(-1已取消, 0未付款, 2待使用, 3已使用, 4已过期 6已关闭)
activeState
:
item
.
activeState
,
// 活动状态(0 未开始 1进行中 2 已结束)
activeState
:
item
.
activeState
,
// 活动状态(0 未开始 1进行中 2 已结束)
cover
:
item
.
cover
,
cover
:
item
.
cover
,
date
:
item
.
active
Date
+
' '
+
item
.
active
Time
,
date
:
item
.
activeTime
,
address
:
item
.
address
,
address
:
item
.
address
,
num
:
item
.
number
,
num
:
item
.
number
,
amount
:
item
.
totalMoney
.
toFixed
(
2
)
amount
:
item
.
totalMoney
.
toFixed
(
2
)
...
@@ -297,6 +343,17 @@ Page({
...
@@ -297,6 +343,17 @@ Page({
})
})
}
}
})
})
},
// 触底加载
onReachBottom
:
function
()
{
this
.
setData
({
pageNo
:
this
.
data
.
pageNo
+
1
})
if
(
this
.
data
.
active
==
0
)
{
this
.
getActivity
()
}
}
},
})
})
\ No newline at end of file
pages/mine/appointment/appointment.wxml
View file @
573bd2f4
<!--pages/myAppointment/myAppointment.wxml-->
<!--pages/myAppointment/myAppointment.wxml-->
<navigation class="navigation" titleText="我的预约" backIcon="/image/back.png" scrollStyle="{{navigationStyle}}" scrollHeight="{{navigationScroll}}"></navigation>
<navigation class="navigation" titleText="我的预约" backIcon="/image/back.png" scrollStyle="{{navigationStyle}}"
scrollHeight="{{navigationScroll}}"></navigation>
<view class="container all">
<view class="container all">
<view class="myActivity-container" style="min-height:{{height}}px;">
<view class="myActivity-container" style="min-height:{{height}}px;">
<view class="myAppointment-nav">
<view class="myAppointment-nav">
<!-- 遍历头部导航 -->
<!-- 遍历头部导航 -->
<view bindtap="chageNav" data-index="{{index}}" wx:for="{{navItem}}" wx:key="index" class="navItem {{index == active? 'active':''}}">{{item.content}}</view>
<view bindtap="chageNav" data-index="{{index}}" wx:for="{{navItem}}" wx:key="index"
class="navItem {{index == active? 'active':''}}">{{item.content}}</view>
</view>
</view>
<!-- 主题活动 -->
<view class="myAppointment-body" wx:if="{{activityList.length > 0 && active === 0}}">
<view class="myAppointment-body" wx:if="{{activityList.length > 0 && active === 0}}">
<block wx:for="{{activityList}}" wx:for-item="activity" wx:for-index="indexActivity" wx:key="orderId">
<block wx:for="{{activityList}}" wx:for-item="activity" wx:for-index="indexActivity" wx:key="orderId">
<!-- 待付款 -->
<!-- 待付款 -->
<view class="appointment-wrapper" wx:if="{{activity.status === '0'}}">
<view class="appointment-wrapper" wx:if="{{activity.status === '0'}}" bindtap="onOrderDetail"
data-item="{{activity}}">
<view class="appointment-time">{{activity.date}}</view>
<view class="appointment-time">{{activity.date}}</view>
<view class="appintment-activity-status-pay">
<view class="appintment-activity-status-pay">
<text>待付款</text>
<text>待付款</text>
...
@@ -36,8 +40,8 @@
...
@@ -36,8 +40,8 @@
<text>{{activity.amount}}</text>
<text>{{activity.amount}}</text>
</view>
</view>
<view class="appointment-activity-btn row">
<view class="appointment-activity-btn row">
<view class="cancel-btn">删除报名</view>
<view c
atchtap="doCancel" data-item="{{activity}}" c
lass="cancel-btn">删除报名</view>
<view class="confirm-btn">去支付</view>
<view c
atchtap="onOrderPay" data-item="{{activity}}" c
lass="confirm-btn">去支付</view>
</view>
</view>
</view>
</view>
</view>
</view>
...
@@ -69,7 +73,7 @@
...
@@ -69,7 +73,7 @@
<text>{{activity.amount}}</text>
<text>{{activity.amount}}</text>
</view>
</view>
<view class="appointment-activity-btn row">
<view class="appointment-activity-btn row">
<view class="confirm-btn">去使用</view>
<view
data-item="{{activity}}" catchtap="onOrderUse"
class="confirm-btn">去使用</view>
</view>
</view>
</view>
</view>
</view>
</view>
...
@@ -81,7 +85,7 @@
...
@@ -81,7 +85,7 @@
</view>
</view>
<view class="appointment-activity-content row align-c">
<view class="appointment-activity-content row align-c">
<view class="appointment-activity-img">
<view class="appointment-activity-img">
<image src=""></image>
<image src="
{{activity.cover}}
"></image>
</view>
</view>
<view class="appointment-activity-info col con-a">
<view class="appointment-activity-info col con-a">
<view class="appointment-activity-title">
<view class="appointment-activity-title">
...
@@ -101,7 +105,7 @@
...
@@ -101,7 +105,7 @@
<text>{{activity.amount}}</text>
<text>{{activity.amount}}</text>
</view>
</view>
<view class="appointment-activity-btn row">
<view class="appointment-activity-btn row">
<view class="confirm-btn">去使用</view>
<view
data-item="{{activity}}" catchtap="onOrderUse"
class="confirm-btn">去使用</view>
</view>
</view>
</view>
</view>
</view>
</view>
...
@@ -113,7 +117,7 @@
...
@@ -113,7 +117,7 @@
</view>
</view>
<view class="appointment-activity-content row align-c">
<view class="appointment-activity-content row align-c">
<view class="appointment-activity-img">
<view class="appointment-activity-img">
<image src=""></image>
<image src="
{{activity.cover}}
"></image>
</view>
</view>
<view class="appointment-activity-info col con-a">
<view class="appointment-activity-info col con-a">
<view class="appointment-activity-title">
<view class="appointment-activity-title">
...
@@ -133,7 +137,7 @@
...
@@ -133,7 +137,7 @@
<text>{{activity.amount}}</text>
<text>{{activity.amount}}</text>
</view>
</view>
<view class="appointment-activity-btn row">
<view class="appointment-activity-btn row">
<view class="confirm-btn">去评价</view>
<view
data-item="{{activity}}" catchtap="onOrderEvaluate"
class="confirm-btn">去评价</view>
</view>
</view>
</view>
</view>
</view>
</view>
...
@@ -146,7 +150,7 @@
...
@@ -146,7 +150,7 @@
</view>
</view>
<view class="appointment-activity-content row align-c">
<view class="appointment-activity-content row align-c">
<view class="appointment-activity-img">
<view class="appointment-activity-img">
<image src=""></image>
<image src="
{{activity.cover}}
"></image>
</view>
</view>
<view class="appointment-activity-info col con-a">
<view class="appointment-activity-info col con-a">
<view class="appointment-activity-title">
<view class="appointment-activity-title">
...
@@ -166,20 +170,20 @@
...
@@ -166,20 +170,20 @@
<text>{{activity.amount}}</text>
<text>{{activity.amount}}</text>
</view>
</view>
<view class="appointment-activity-btn row">
<view class="appointment-activity-btn row">
<view
class="cancel-btn cancel-overtime
">删除报名</view>
<view
data-item="{{activity}}" catchtap="doCancel" class="cancel-btn cancel
">删除报名</view>
</view>
</view>
</view>
</view>
</view>
</view>
<!-- 已取消 -->
<!-- 已取消 -->
<view class="appointment-wrapper" wx:if="{{activity.status === '-1'}}">
<view class="appointment-wrapper" wx:if="{{activity.status === '-1'}}">
<view class="mask-cancel"></view>
<view class="mask-cancel"
bindtap="onOrderDetail" data-item="{{activity}}"
></view>
<view class="appointment-time mask-cancel-time">7月15日 10:00-12:00</view>
<view class="appointment-time mask-cancel-time">7月15日 10:00-12:00</view>
<view class="appintment-activity-status-cancel">
<view class="appintment-activity-status-cancel">
<text>已取消</text>
<text>已取消</text>
</view>
</view>
<view class="appointment-activity-content row align-c">
<view class="appointment-activity-content row align-c">
<view class="appointment-activity-img">
<view class="appointment-activity-img">
<image src=""></image>
<image src="
{{activity.cover}}
"></image>
</view>
</view>
<view class="appointment-activity-info col con-a">
<view class="appointment-activity-info col con-a">
<view class="appointment-activity-title">
<view class="appointment-activity-title">
...
@@ -199,13 +203,14 @@
...
@@ -199,13 +203,14 @@
<text>{{activity.amount}}</text>
<text>{{activity.amount}}</text>
</view>
</view>
<view class="appointment-activity-btn row">
<view class="appointment-activity-btn row">
<view class="cancel-btn cancel">删除报名</view>
<view
data-item="{{activity}}" catchtap="doCancel"
class="cancel-btn cancel">删除报名</view>
<view class="confirm-btn confirm-once">再次报名</view>
<view
data-index="0" catchtap="goAppoint"
class="confirm-btn confirm-once">再次报名</view>
</view>
</view>
</view>
</view>
</view>
</view>
</block>
</block>
</view>
</view>
<!-- 夜间入园预约、看房预约 -->
<view class="myAppointment-body" wx:if="{{data.length > 0 && active !== 0}}">
<view class="myAppointment-body" wx:if="{{data.length > 0 && active !== 0}}">
<view class="myAppointment-item" wx:for="{{data}}" wx:key="index">
<view class="myAppointment-item" wx:for="{{data}}" wx:key="index">
<image src="{{item.url}}" class="item-img"></image>
<image src="{{item.url}}" class="item-img"></image>
...
@@ -218,23 +223,28 @@
...
@@ -218,23 +223,28 @@
</view>
</view>
</view>
</view>
</view>
</view>
<view class="noActive" wx:if="{{data.length === 0 && active ===
2
}}">
<view class="noActive" wx:if="{{data.length === 0 && active ===
1
}}">
<view class="noActive-title">暂无夜间入园预约</view>
<view class="noActive-title">暂无夜间入园预约</view>
<view class="noActive-rule">20:00后入园需要提前预约,每日限流200人</view>
<view class="noActive-rule">20:00后入园需要提前预约,每日限流200人</view>
<view class="noActive-botton" data-index="2" bindtap="goAppoint">去预约</view>
<view class="noActive-botton" data-index="2" bindtap="goAppoint">去预约</view>
</view>
</view>
<view class="noActive" wx:if="{{data.length === 0 && active ===
1
}}">
<view class="noActive" wx:if="{{data.length === 0 && active ===
2
}}">
<view class="noActive-title">暂无看房预约</view>
<view class="noActive-title">暂无看房预约</view>
<view class="noActive-botton" data-index="1" bindtap="goAppoint">去预约</view>
<view class="noActive-botton" data-index="1" bindtap="goAppoint">去预约</view>
</view>
</view>
<!-- 主题活动数据为空 -->
<view class="noActive" wx:if="{{activityList.length === 0 && active === 0}}">
<view class="noActive" wx:if="{{activityList.length === 0 && active === 0}}">
<view class="noActive-title">暂无活动预约</view>
<view class="noActive-title">暂无活动预约</view>
<view class="noActive-botton" data-index="0" bindtap="goAppoint">去预约</view>
<view class="noActive-botton" data-index="0" bindtap="goAppoint">去预约</view>
</view>
</view>
</view>
</view>
<!-- 确认框 -->
<l-dialog />
<l-toast l-image-class="toast-image"></l-toast>
<wxs module="m1">
<wxs module="m1">
var getDate = function(date, type) {
var getDate = function
(date, type) {
return date.substring(5, 11).replace('-', '月').replace(' ', '日') + ((type == 0) ? ' 20:00-24:00' : '');
return date.substring(5, 11).replace('-', '月').replace(' ', '日') + ((type == 0) ? ' 20:00-24:00' : '');
}
}
module.exports.getDate = getDate;
module.exports.getDate = getDate;
...
...
pages/mine/home/home.wxml
View file @
573bd2f4
...
@@ -100,45 +100,45 @@
...
@@ -100,45 +100,45 @@
<view class="order-activity-icon-wrapper col align-c" data-type="3" bindtap="goOrderByclass">
<view class="order-activity-icon-wrapper col align-c" data-type="3" bindtap="goOrderByclass">
<view class="order-activity-icon row con-c align-c">
<view class="order-activity-icon row con-c align-c">
<image src="{{imageResourcesBase+'mine/home/or_ticket.png'}}"></image>
<image src="{{imageResourcesBase+'mine/home/or_ticket.png'}}"></image>
<view class="order-activity-badge {{ goodTypeCountData['
1
'] > 9 ? 'badge-widen' : ''}}"
<view class="order-activity-badge {{ goodTypeCountData['
3
'] > 9 ? 'badge-widen' : ''}}"
wx:if="{{goodTypeCountData['
1
'] > 0}}">
wx:if="{{goodTypeCountData['
3
'] > 0}}">
{{goodTypeCountData['
1'] > 99 ? '···' : goodTypeCountData['1
']}}</view>
{{goodTypeCountData['
3'] > 99 ? '···' : goodTypeCountData['3
']}}</view>
</view>
</view>
<text>门票</text>
<text>门票</text>
</view>
</view>
<view class="order-activity-icon-wrapper col align-c" data-type="5" bindtap="goOrderByclass">
<view class="order-activity-icon-wrapper col align-c" data-type="5" bindtap="goOrderByclass">
<view class="order-activity-icon row con-c align-c">
<view class="order-activity-icon row con-c align-c">
<image src="{{imageResourcesBase+'mine/home/or_food.png'}}"></image>
<image src="{{imageResourcesBase+'mine/home/or_food.png'}}"></image>
<view class="order-activity-badge {{ goodTypeCountData['
2
'] > 9 ? 'badge-widen' : ''}}"
<view class="order-activity-badge {{ goodTypeCountData['
5
'] > 9 ? 'badge-widen' : ''}}"
wx:if="{{goodTypeCountData['
2
'] > 0}}">
wx:if="{{goodTypeCountData['
5
'] > 0}}">
{{goodTypeCountData['
2'] > 99 ? '···' : goodTypeCountData['2
']}}</view>
{{goodTypeCountData['
5'] > 99 ? '···' : goodTypeCountData['5
']}}</view>
</view>
</view>
<text>餐饮</text>
<text>餐饮</text>
</view>
</view>
<view class="order-activity-icon-wrapper col align-c" data-type="
3
" bindtap="goOrderByclass">
<view class="order-activity-icon-wrapper col align-c" data-type="
-2
" bindtap="goOrderByclass">
<view class="order-activity-icon row con-c align-c">
<view class="order-activity-icon row con-c align-c">
<image src="{{imageResourcesBase+'mine/home/or_movice.png'}}"></image>
<image src="{{imageResourcesBase+'mine/home/or_movice.png'}}"></image>
<view class="order-activity-badge {{ goodTypeCountData['
3
'] > 9 ? 'badge-widen' : ''}}"
<view class="order-activity-badge {{ goodTypeCountData['
-2
'] > 9 ? 'badge-widen' : ''}}"
wx:if="{{goodTypeCountData['
3
'] > 0}}">
wx:if="{{goodTypeCountData['
-2
'] > 0}}">
{{goodTypeCountData['
3'] > 99 ? '···' : goodTypeCountData['3
']}}</view>
{{goodTypeCountData['
-2'] > 99 ? '···' : goodTypeCountData['-2
']}}</view>
</view>
</view>
<text>影票</text>
<text>影票</text>
</view>
</view>
<view class="order-activity-icon-wrapper col align-c" data-type="2" bindtap="goOrderByclass">
<view class="order-activity-icon-wrapper col align-c" data-type="2" bindtap="goOrderByclass">
<view class="order-activity-icon row con-c align-c">
<view class="order-activity-icon row con-c align-c">
<image src="{{imageResourcesBase+'mine/home/or_spa.png'}}"></image>
<image src="{{imageResourcesBase+'mine/home/or_spa.png'}}"></image>
<view class="order-activity-badge {{ goodTypeCountData['
4
'] > 9 ? 'badge-widen' : ''}}"
<view class="order-activity-badge {{ goodTypeCountData['
2
'] > 9 ? 'badge-widen' : ''}}"
wx:if="{{goodTypeCountData['
4
'] > 0}}">
wx:if="{{goodTypeCountData['
2
'] > 0}}">
{{goodTypeCountData['
4'] > 99 ? '···' : goodTypeCountData['4
']}}</view>
{{goodTypeCountData['
2'] > 99 ? '···' : goodTypeCountData['2
']}}</view>
</view>
</view>
<text>SPA</text>
<text>SPA</text>
</view>
</view>
<view class="order-activity-icon-wrapper col align-c" data-type="4" bindtap="goOrderByclass">
<view class="order-activity-icon-wrapper col align-c" data-type="4" bindtap="goOrderByclass">
<view class="order-activity-icon row con-c align-c">
<view class="order-activity-icon row con-c align-c">
<image src="{{imageResourcesBase+'mine/home/or_art.png'}}"></image>
<image src="{{imageResourcesBase+'mine/home/or_art.png'}}"></image>
<view class="order-activity-badge {{ goodTypeCountData['
5
'] > 9 ? 'badge-widen' : ''}}"
<view class="order-activity-badge {{ goodTypeCountData['
4
'] > 9 ? 'badge-widen' : ''}}"
wx:if="{{goodTypeCountData['
5
'] > 0}}">
wx:if="{{goodTypeCountData['
4
'] > 0}}">
{{goodTypeCountData['
5'] > 99 ? '···' : goodTypeCountData['5
']}}</view>
{{goodTypeCountData['
4'] > 99 ? '···' : goodTypeCountData['4
']}}</view>
</view>
</view>
<text>文创</text>
<text>文创</text>
</view>
</view>
...
@@ -257,7 +257,7 @@
...
@@ -257,7 +257,7 @@
<!-- 预约卡片 -->
<!-- 预约卡片 -->
<view class="appintment">
<view class="appintment">
<!-- 主题活动 -->
<!-- 主题活动 -->
<view class="appointment-wrapper" wx:for="{{activityList}}" wx:key="*this">
<view class="appointment-wrapper" wx:for="{{activityList}}" wx:key="*this"
data-item="{{item}}" bindtap="onOrderDetail"
>
<view class="appointment-time">{{item.activeTime}}</view>
<view class="appointment-time">{{item.activeTime}}</view>
<view class="appointment-activity-content row">
<view class="appointment-activity-content row">
<view class="appointment-activity-img">
<view class="appointment-activity-img">
...
...
pages/mine/order/order.js
View file @
573bd2f4
...
@@ -33,12 +33,13 @@ Page({
...
@@ -33,12 +33,13 @@ Page({
orderPages
:
1
,
orderPages
:
1
,
winOrderType
:
false
,
winOrderType
:
false
,
isLoading
:
false
,
isLoading
:
false
,
isFinished
:
false
isFinished
:
false
,
optionsGoodType
:
''
},
},
onLoad
:
function
(
options
)
{
onLoad
:
function
(
options
)
{
this
.
setData
({
this
.
setData
({
option
:
options
,
option
:
options
,
o
rderTypeActive
:
options
.
goodType
!=
undefined
?
1
*
options
.
goodType
:
0
o
ptionsGoodType
:
options
.
goodType
!=
undefined
?
1
*
options
.
goodType
:
''
})
})
// App.login({
// App.login({
// timeout: 0,
// timeout: 0,
...
@@ -176,10 +177,11 @@ Page({
...
@@ -176,10 +177,11 @@ Page({
* @returns
* @returns
*/
*/
setOrderType
:
function
()
{
setOrderType
:
function
()
{
let
that
=
this
;
App
.
wxRequest
({
App
.
wxRequest
({
url
:
'/api/v1/common/getDictByType'
,
url
:
'/api/v1/common/getDictByType'
,
data
:
{
data
:
{
'type'
:
'good_type'
,
'type'
:
'
order_
good_type'
,
},
},
success
:
(
response
)
=>
{
success
:
(
response
)
=>
{
...
@@ -196,14 +198,27 @@ Page({
...
@@ -196,14 +198,27 @@ Page({
funcList
.
push
(
funcItem
)
funcList
.
push
(
funcItem
)
}
}
let
typeTitle
=
'全部分类'
//
let
typeTitle
=
'全部分类'
//
if
(
this
.
data
.
orderTypeActive
)
{
let
orderTypeActive
=
0
//
typeTitle
=
funcList
[
this
.
data
.
orderTypeActive
].
name
let
aVal
=
''
funcList
.
forEach
((
item
,
index
)
=>
{
if
(
item
.
value
==
that
.
data
.
optionsGoodType
)
{
typeTitle
=
item
.
name
orderTypeActive
=
index
}
}
})
// if (filter.length > 0) {
// typeTitle = filter[0].name
// orderTypeActive = 0
// }
this
.
setData
({
this
.
setData
({
'orderType'
:
funcList
,
'orderType'
:
funcList
,
orderTypeTitle
:
typeTitle
orderTypeTitle
:
typeTitle
,
})
orderTypeActive
})
this
.
queryOrder
()
this
.
queryOrder
()
}
}
})
})
...
...
pages/pay/order-comment/order-comment.js
View file @
573bd2f4
...
@@ -2,6 +2,7 @@ let App = getApp()
...
@@ -2,6 +2,7 @@ let App = getApp()
Page
({
Page
({
data
:
{
data
:
{
shopConfig
:
App
.
globalData
.
shopId
,
imageBase
:
App
.
globalData
.
appImageBase
,
imageBase
:
App
.
globalData
.
appImageBase
,
resourcesBase
:
App
.
globalData
.
appResourcesBase
,
resourcesBase
:
App
.
globalData
.
appResourcesBase
,
scoreServe
:
0
,
// 服务分数
scoreServe
:
0
,
// 服务分数
...
@@ -21,14 +22,114 @@ Page({
...
@@ -21,14 +22,114 @@ Page({
fileResults
:
[]
fileResults
:
[]
},
},
onLoad
:
function
(
options
)
{
onLoad
:
function
(
options
)
{
console
.
log
(
options
,
'99999999999999999999999999999'
);
let
orderItem
=
JSON
.
parse
(
options
.
orderItem
)
let
pageFrom
=
options
.
pageFrom
let
pageFrom
=
options
.
pageFrom
let
orderItem
=
JSON
.
parse
(
options
.
orderItem
)
this
.
setData
({
this
.
setData
({
orderInfo
:
orderItem
,
orderInfo
:
orderItem
,
pageFrom
:
pageFrom
pageFrom
:
pageFrom
})
})
if
(
pageFrom
==
'activityList'
)
{
this
.
queryOrderDetail
()
}
},
/**
* 订单详情
* @function
* @param
* @returns
*/
queryOrderDetail
:
function
()
{
let
that
=
this
App
.
wxRequest
({
url
:
'/api/v1/order/getOrderDetail'
,
data
:
{
'orderId'
:
this
.
data
.
orderInfo
.
orderId
},
success
:
(
response
)
=>
{
let
funcResponse
=
response
.
data
let
funcOrderInfo
=
{
'id'
:
this
.
data
.
orderInfo
.
orderId
,
'score'
:
funcResponse
.
integral
,
// 积分
'state'
:
Number
(
funcResponse
.
status
),
// 订单状态
'amount'
:
funcResponse
.
totalMoney
,
// 实付金额
'contactName'
:
funcResponse
.
name
,
// 联系人名称
'contactPhone'
:
funcResponse
.
mobilePhone
,
// 联系人电话
'commodityType'
:
Number
(
funcResponse
.
goodType
),
// 商品类型
'commodity'
:
[],
'tipOrderNo'
:
funcResponse
.
orderSerialNumber
,
// 订单编号
'tipTimeSubmit'
:
funcResponse
.
createDate
,
'tipTimePay'
:
App
.
modular
.
miment
(
funcResponse
.
paymentTime
).
format
(
'YYYY-MM-DD hh:mm:ss'
),
'tipIntegral'
:
funcResponse
.
integral
,
'officeName'
:
funcResponse
.
officeName
,
'wxRequest'
:
funcResponse
.
wxRequest
,
'businessTime'
:
funcResponse
.
businessTime
,
//营业时间
'expireTime'
:
funcResponse
.
expireTime
,
//订单有效期
}
// 设置印章
let
shopName
=
funcResponse
.
officeName
;
let
shopFilter
=
this
.
data
.
shopConfig
.
filter
(
item
=>
{
return
item
.
name
.
toLowerCase
()
==
shopName
.
toLowerCase
()
}
)
funcOrderInfo
.
shopInfo
=
shopFilter
[
0
]
console
.
log
(
shopFilter
[
0
],
'-----------shopFilter[0]------'
);
// 添加订单商品列表
let
funcCommodity
=
funcResponse
.
smOrderDetails
for
(
let
i
=
0
,
l
=
funcCommodity
.
length
;
i
<
l
;
i
++
)
{
let
funcCommodityItem
=
{
'cover'
:
funcCommodity
[
i
].
imgUrl
,
'name'
:
funcCommodity
[
i
].
name
,
// 名称
'quantity'
:
funcCommodity
[
i
].
number
,
// 数量
'amount'
:
funcCommodity
[
i
].
unitPrice
,
// 总价
'state'
:
Number
(
funcCommodity
[
i
].
status
),
// 状态
'codeId'
:
funcCommodity
[
i
].
volumeId
,
// 券码
}
funcOrderInfo
.
commodity
.
push
(
funcCommodityItem
)
}
// 倒计时
if
(
funcOrderInfo
.
state
==
0
)
{
// 待付款状态
let
doTime
=
15
*
60
*
1000
let
timeInter
=
setInterval
(()
=>
{
let
creatdTime
=
new
Date
(
funcOrderInfo
.
tipTimeSubmit
.
replace
(
/-/g
,
'/'
)).
getTime
()
let
endTime
=
creatdTime
+
doTime
let
now
=
new
Date
().
getTime
()
let
residueStamp
=
endTime
-
now
let
residuePayTime
=
App
.
modular
.
miment
(
residueStamp
).
format
(
'mm:ss'
)
if
(
residueStamp
>
0
)
{
that
.
setData
({
residuePayTime
:
residuePayTime
})
}
else
{
console
.
log
(
residueStamp
,
'residueStamp----------------'
);
clearInterval
(
timeInter
)
// that.queryOrderDetail()
let
state
=
`orderInfo.state`
that
.
setData
({
[
state
]:
-
1
})
}
},
1000
)
}
this
.
setData
({
orderInfo
:
funcOrderInfo
})
// 判断是否自动展示二维码
// 订单列表 去使用 按钮
if
(
this
.
data
.
isFromUse
)
{
}
}
})
},
},
/**
/**
...
@@ -208,6 +309,9 @@ Page({
...
@@ -208,6 +309,9 @@ Page({
}
else
if
(
pageFrom
==
'orderDetail'
)
{
}
else
if
(
pageFrom
==
'orderDetail'
)
{
//评价详情
//评价详情
url
=
'/pages/pay/order-detail/order-detail?id='
+
that
.
data
.
orderInfo
.
id
url
=
'/pages/pay/order-detail/order-detail?id='
+
that
.
data
.
orderInfo
.
id
}
else
if
(
pageFrom
==
'activityList'
)
{
//主题活动列表
url
=
'/pages/mine/appointment/appointment'
}
else
{
}
else
{
url
=
'/pages/home/home/home'
url
=
'/pages/home/home/home'
}
}
...
...
pages/pay/order-comment/order-comment.wxml
View file @
573bd2f4
...
@@ -11,9 +11,8 @@
...
@@ -11,9 +11,8 @@
<image src="{{item.cover}}"></image>
<image src="{{item.cover}}"></image>
</view>
</view>
</block>
</block>
<view class="order-name" wx:if="{{orderInfo.commodity.length === 1}}">
<view class="order-name" wx:if="{{orderInfo.commodity.length === 1}}">
<text>{{orderInfo.name}}</text>
<text>{{orderInfo.
commodity[0].
name}}</text>
</view>
</view>
<view class="order-price-wrapper col align-e">
<view class="order-price-wrapper col align-e">
<view class="order-price">
<view class="order-price">
...
@@ -26,7 +25,6 @@
...
@@ -26,7 +25,6 @@
</view>
</view>
</view>
</view>
</view>
</view>
<view class="order-comment-wrapper">
<view class="order-comment-wrapper">
<view class="order-comment-title">
<view class="order-comment-title">
<text>订单评价</text>
<text>订单评价</text>
...
...
project.config.json
View file @
573bd2f4
...
@@ -89,6 +89,12 @@
...
@@ -89,6 +89,12 @@
"pathName"
:
"pages/play/service-detail/service-detail"
,
"pathName"
:
"pages/play/service-detail/service-detail"
,
"query"
:
"id=1&type=4"
,
"query"
:
"id=1&type=4"
,
"scene"
:
null
"scene"
:
null
},
{
"id"
:
-1
,
"name"
:
"pages/mine/home/home"
,
"pathName"
:
"pages/mine/home/home"
,
"scene"
:
null
}
}
]
]
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment