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
8cc2e3b2
authored
Sep 22, 2020
by
wjw
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
ww--电影报名
parent
bac06374
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
97 additions
and
55 deletions
pages/play/movie-detail/movie-detail.js
pages/play/movie-detail/movie-detail.wxml
pages/play/movie/movie.js
pages/play/movie/movie.wxml
pages/play/service-detail/service-detail.js
pages/play/service-detail/service-detail.wxml
pages/play/movie-detail/movie-detail.js
View file @
8cc2e3b2
...
...
@@ -121,10 +121,25 @@ Page({
}
})
// console.log(showList)
movieInfo
.
priceSpecialText
=
movieInfo
.
ownerPrice
.
toFixed
(
2
)
movieInfo
.
priceText
=
movieInfo
.
visitorPrice
.
toFixed
(
2
)
movieInfo
.
tags
=
movieInfo
.
tags
.
replace
(
/
(
)?
热映影片
(
)?
/
,
' '
).
split
(
' '
)
movieInfo
.
free
=
movieInfo
.
ownerPrice
==
'0'
&&
movieInfo
.
visitorPrice
==
'0'
?
'免费'
:
`¥
${
movieInfo
.
ownerPrice
.
toFixed
(
2
)}
`
let
funcUserType
=
wx
.
getStorageSync
(
'userInfo'
).
userType
// 根据后台判断价格显示类型
// 活动价优先级最高,如果存在活动价,则只显示活动价和普通价
if
(
movieInfo
.
priceDiscount
)
{
movieInfo
.
priceType
=
1
}
else
{
// 活动价不存在,进一步判断普通价与业主价是否一致,如果不一致,则显示两者
if
(
movieInfo
.
price
!==
movieInfo
.
ownerPrice
&&
funcUserType
)
{
movieInfo
.
priceType
=
2
}
else
{
movieInfo
.
priceType
=
3
}
}
this
.
setData
({
movieInfo
,
showList
,
...
...
@@ -135,9 +150,24 @@ Page({
},
// 跳转到报名页面
onReportMovie
:
function
(
event
)
{
let
id
=
event
.
currentTarget
.
dataset
.
movieid
let
film
=
event
.
currentTarget
.
dataset
.
film
let
movie
=
this
.
data
.
movieInfo
console
.
log
(
film
)
let
funcItem
=
{
id
:
movie
.
activityId
,
filmId
:
film
.
filmId
,
name
:
movie
.
filmName
,
price
:
movie
.
visitorPrice
,
priceSpecial
:
movie
.
ownerPrice
,
date
:
film
.
beginTime
+
'-'
+
film
.
endTime
,
cover
:
movie
.
cover
,
priceType
:
movie
.
priceType
,
quantity
:
1
}
wx
.
setStorageSync
(
'shoppingCartBuffer'
,
[
funcItem
])
wx
.
navigateTo
({
url
:
'/pages/pay/order-input/order-input?type=
'
+
'7'
+
'&id='
+
id
,
url
:
'/pages/pay/order-input/order-input?type=
7'
,
})
}
})
\ No newline at end of file
pages/play/movie-detail/movie-detail.wxml
View file @
8cc2e3b2
...
...
@@ -84,7 +84,7 @@
<view class="show-free">
<text>{{movieInfo.free}}</text>
</view>
<view class="show-btn" bindtap="onReportMovie" data-
movieId="{{item.filmId
}}">
<view class="show-btn" bindtap="onReportMovie" data-
film="{{item
}}">
<text>报名观影</text>
</view>
</view>
...
...
pages/play/movie/movie.js
View file @
8cc2e3b2
...
...
@@ -90,8 +90,24 @@ Page({
v
.
filmType
=
v
.
filmType
.
replace
(
/
\/
/g
,
' / '
)
v
.
filmDirector
=
v
.
filmDirector
.
replace
(
/
\/
/g
,
' '
)
v
.
filmLead
=
v
.
filmLead
.
replace
(
/
\/
/g
,
' '
)
v
.
priceSpecialText
=
v
.
ownerPrice
.
toFixed
(
2
)
v
.
priceText
=
v
.
visitorPrice
.
toFixed
(
2
)
v
.
free
=
v
.
ownerPrice
==
'0'
?
'免费'
:
`¥
${
v
.
ownerPrice
.
toFixed
(
2
)}
`
v
.
tags
=
v
.
tags
.
replace
(
/
(
)?
热映影片
(
)?
/
,
' '
).
split
(
' '
)
let
funcUserType
=
wx
.
getStorageSync
(
'userInfo'
).
userType
// 根据后台判断价格显示类型
// 活动价优先级最高,如果存在活动价,则只显示活动价和普通价
if
(
v
.
priceDiscount
)
{
v
.
priceType
=
1
}
else
{
// 活动价不存在,进一步判断普通价与业主价是否一致,如果不一致,则显示两者
if
(
v
.
price
!==
v
.
ownerPrice
&&
funcUserType
)
{
v
.
priceType
=
2
}
else
{
v
.
priceType
=
3
}
}
})
this
.
setData
({
movieToday
...
...
@@ -124,6 +140,8 @@ Page({
v
.
filmType
=
v
.
filmType
.
replace
(
/
\/
/g
,
' / '
)
v
.
filmDirector
=
v
.
filmDirector
.
replace
(
/
\/
/g
,
' '
)
v
.
filmLead
=
v
.
filmLead
.
replace
(
/
\/
/g
,
' '
)
v
.
priceSpecialText
=
v
.
ownerPrice
.
toFixed
(
2
)
v
.
priceText
=
v
.
visitorPrice
.
toFixed
(
2
)
v
.
free
=
v
.
ownerPrice
==
'0'
?
'免费'
:
`¥
${
v
.
ownerPrice
.
toFixed
(
2
)}
`
v
.
tags
=
v
.
tags
.
replace
(
/
(
)?
热映影片
(
)?
/
,
' '
).
replace
(
/
(
)
+$/
,
''
).
split
(
' '
)
})
...
...
@@ -149,6 +167,8 @@ Page({
v
.
filmType
=
v
.
filmType
.
replace
(
/
\/
/g
,
' / '
)
v
.
filmDirector
=
v
.
filmDirector
.
replace
(
/
\/
/g
,
' '
)
v
.
filmLead
=
v
.
filmLead
.
replace
(
/
\/
/g
,
' '
)
v
.
priceSpecialText
=
v
.
ownerPrice
.
toFixed
(
2
)
v
.
priceText
=
v
.
visitorPrice
.
toFixed
(
2
)
v
.
free
=
v
.
ownerPrice
==
'0'
?
'免费'
:
`¥
${
v
.
ownerPrice
.
toFixed
(
2
)}
`
v
.
tags
=
v
.
tags
.
replace
(
/
(
)?
热映影片
(
)?
/
,
' '
).
split
(
' '
)
})
...
...
@@ -183,11 +203,22 @@ Page({
},
// 跳转到报名页面
onReportMovie
:
function
(
event
)
{
console
.
log
(
event
)
let
movie
=
event
.
currentTarget
.
dataset
.
movie
let
funcItem
=
{
id
:
movie
.
activityId
,
filmId
:
movie
.
filmId
,
name
:
movie
.
filmName
,
price
:
movie
.
visitorPrice
,
priceSpecial
:
movie
.
ownerPrice
,
date
:
movie
.
beginTime
+
'-'
+
movie
.
endTime
,
cover
:
movie
.
cover
,
priceType
:
movie
.
priceType
,
quantity
:
1
}
wx
.
setStorageSync
(
'shoppingCartBuffer'
,
[
funcItem
])
let
id
=
event
.
currentTarget
.
dataset
.
movieid
wx
.
navigateTo
({
url
:
'/pages/pay/order-input/order-input?type=
'
+
'7'
+
'&id='
+
id
,
url
:
'/pages/pay/order-input/order-input?type=
7'
,
})
}
})
\ No newline at end of file
pages/play/movie/movie.wxml
View file @
8cc2e3b2
...
...
@@ -68,7 +68,7 @@
<view class="movie-free">
<text>{{item.free}}</text>
</view>
<view class="movie-btn" catchtap="onReportMovie" data-movie
Id="{{item.activityId
}}">
<view class="movie-btn" catchtap="onReportMovie" data-movie
="{{item
}}">
<text>报名观影</text>
</view>
</view>
...
...
pages/play/service-detail/service-detail.js
View file @
8cc2e3b2
...
...
@@ -471,56 +471,33 @@ Page({
},
success
:
(
response
)
=>
{
let
funcResponse
=
response
.
data
.
list
let
func
Commodity
List
=
[]
let
funcList
=
[]
for
(
let
i
=
0
,
l
=
funcResponse
.
length
;
i
<
l
;
i
++
)
{
let
funcItem
=
{
'id'
:
funcResponse
[
i
].
activityId
,
// 商品标识
'typeId'
:
7
,
// 商品类别标识
'sidebarId'
:
''
,
'name'
:
funcResponse
[
i
].
filmName
,
'cover'
:
funcResponse
[
i
].
cover
,
// 商品封面
'price'
:
funcResponse
[
i
].
visitorPrice
,
// 普通价
'priceText'
:
App
.
modular
.
utils
.
formatAmount
(
funcResponse
[
i
].
visitorPrice
),
// 普通价文本格式
'priceSpecial'
:
funcResponse
[
i
].
ownerPrice
,
// 业主价
'priceSpecialText'
:
App
.
modular
.
utils
.
formatAmount
(
funcResponse
[
i
].
ownerPrice
),
// 业主价文本格式
'priceDiscount'
:
funcResponse
[
i
].
price
,
// 活动价
'priceDiscountText'
:
App
.
modular
.
utils
.
formatAmount
(
funcResponse
[
i
].
price
),
// 活动价文本格式
'priceType'
:
1
,
'describe'
:
funcResponse
[
i
].
synopsis
,
'describeDetail'
:
''
,
// 商品描述详情,在点击详情时获得数据
'name'
:
funcResponse
[
i
].
activityId
,
'dateBegin'
:
funcResponse
[
i
].
beginDate
,
'dateEnd'
:
funcResponse
[
i
].
endDate
,
'cover'
:
funcResponse
[
i
].
cover
,
'movieDirector'
:
funcResponse
[
i
].
filmDirector
,
'movieLeader'
:
funcResponse
[
i
].
filmLead
,
'movieName'
:
funcResponse
[
i
].
filmName
,
'movieType'
:
funcResponse
[
i
].
filmType
,
'movieKeyWord'
:
funcResponse
[
i
].
keyword
,
'movieLeader'
:
funcResponse
[
i
].
filmLead
,
'price'
:
funcResponse
[
i
].
visitorPrice
,
// 普通价
'priceText'
:
App
.
modular
.
utils
.
formatAmount
(
funcResponse
[
i
].
visitorPrice
),
// 普通价文本格式
'priceSpecial'
:
funcResponse
[
i
].
ownerPrice
,
// 业主价
'priceSpecialText'
:
App
.
modular
.
utils
.
formatAmount
(
funcResponse
[
i
].
ownerPrice
),
// 业主价文本格式
'priceType'
:
1
,
'tagsId'
:
funcResponse
[
i
].
tagIds
,
'tags'
:
funcResponse
[
i
].
tags
.
split
(
' '
),
}
let
funcUserType
=
wx
.
getStorageSync
(
'userInfo'
).
userType
// 根据后台判断价格显示类型
// 活动价优先级最高,如果存在活动价,则只显示活动价和普通价
if
(
funcItem
.
priceDiscount
)
{
funcItem
.
priceType
=
1
}
else
{
// 活动价不存在,进一步判断普通价与业主价是否一致,如果不一致,则显示两者
if
(
funcItem
.
price
!==
funcItem
.
priceSpecial
&&
funcUserType
)
{
funcItem
.
priceType
=
2
}
else
{
funcItem
.
priceType
=
3
}
}
if
(
funcItem
.
tagsId
.
includes
(
'102'
))
{
func
Commodity
List
.
push
(
funcItem
)
funcList
.
push
(
funcItem
)
}
funcCommodityList
.
push
(
funcItem
)
}
this
.
setData
({
detailCommodity
:
func
Commodity
List
detailCommodity
:
funcList
})
}
})
...
...
@@ -550,18 +527,20 @@ Page({
},
onBuy
:
function
(
event
)
{
let
funcCommodityInfo
=
event
.
currentTarget
.
dataset
.
item
// 补充必要参数
funcCommodityInfo
.
quantity
=
1
funcCommodityInfo
.
quantityMin
=
1
funcCommodityInfo
.
quantityMax
=
1
funcCommodityInfo
.
isActive
=
true
wx
.
setStorageSync
(
'shoppingCartBuffer'
,
[
funcCommodityInfo
])
let
id
=
event
.
currentTarget
.
dataset
.
id
wx
.
navigateTo
({
url
:
'/pages/pay/order-input/order-input?type='
+
funcCommodityInfo
.
typeId
})
url
:
'/pages/play/movie-detail/movie-detail?id='
+
id
,
})
// // 补充必要参数
// funcCommodityInfo.quantity = 1
// funcCommodityInfo.quantityMin = 1
// funcCommodityInfo.quantityMax = 1
// funcCommodityInfo.isActive = true
// wx.setStorageSync('shoppingCartBuffer', [funcCommodityInfo])
// wx.navigateTo({
// url: '/pages/pay/order-input/order-input?type=' + funcCommodityInfo.typeId
// })
},
onLocation
:
function
()
{
...
...
pages/play/service-detail/service-detail.wxml
View file @
8cc2e3b2
...
...
@@ -298,7 +298,7 @@
</view>
<view class="commodity-card-list row">
<block wx:for="{{detailCommodity}}" wx:for-index="index" wx:for-item="item" wx:key="index">
<view class="movie-card-item col">
<view class="movie-card-item col"
data-id="{{item.name}}" bindtap="onBuy"
>
<image src="{{item.cover}}"></image>
<view class="movie-card-item-title row align-c">
<text>{{item.movieName}}</text>
...
...
@@ -324,7 +324,7 @@
<text>免费</text>
</view>
<view>
<button class="row con-c align-c"
data-item="{{item}}" bindtap="onBuy"
>报名观影</button>
<button class="row con-c align-c">报名观影</button>
</view>
</view>
</view>
...
...
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