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
68933f16
authored
Sep 24, 2020
by
wjw
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
ww--电影价格,活动报名修改
parent
323a7ed7
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
84 additions
and
26 deletions
pages/play/activity/activity.js
pages/play/activity/activity.wxml
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/activity/activity.js
View file @
68933f16
...
...
@@ -93,8 +93,9 @@ Page({
funcData
.
forEach
(
item
=>
{
let
tmpItem
=
{
id
:
item
.
id
,
officeId
:
item
.
officeId
,
cover
:
item
.
cover
,
titl
e
:
item
.
name
,
nam
e
:
item
.
name
,
date
:
item
.
activeDate
,
//'6月30日-7月12日 10:00-12:00',
describe
:
item
.
summary
,
beginDate
:
item
.
activeDate
.
split
(
'-'
)[
0
],
...
...
@@ -186,10 +187,24 @@ Page({
})
},
// 活动报名
onReport
:
function
()
{
onReport
:
function
(
event
)
{
let
index
=
event
.
currentTarget
.
dataset
.
index
let
selectedActivity
=
this
.
data
.
selectedActivity
selectedActivity
[
index
].
quantity
=
1
this
.
setShopInfo
(
selectedActivity
[
index
].
officeId
,
2
)
wx
.
setStorageSync
(
'shoppingCartBuffer'
,
[
selectedActivity
[
index
]])
wx
.
navigateTo
({
url
:
'/pages/pay/order-input/order-input?type=6'
})
}
},
setShopInfo
:
function
(
funcShopId
,
funcShopType
)
{
for
(
let
i
=
0
,
l
=
App
.
globalData
.
shopId
.
length
;
i
<
l
;
i
++
)
{
if
(
funcShopId
===
App
.
globalData
.
shopId
[
i
].
id
)
{
let
funcShopInfo
=
JSON
.
parse
(
JSON
.
stringify
(
App
.
globalData
.
shopId
[
i
]))
console
.
log
(
funcShopInfo
.
name
)
if
(
funcShopType
)
funcShopInfo
.
shopType
=
funcShopType
wx
.
setStorageSync
(
'shopInfoBuffer'
,
funcShopInfo
)
}
}
},
})
\ No newline at end of file
pages/play/activity/activity.wxml
View file @
68933f16
...
...
@@ -21,7 +21,7 @@
</view>
<view class="item-info col">
<view class="item-title row con-b align-c">
<text>{{item.
titl
e}}</text>
<text>{{item.
nam
e}}</text>
<text wx:if="{{item.tagNames[0]}}">{{item.tagNames[0]}}</text>
</view>
<view class="item-date row align-c">
...
...
@@ -50,7 +50,7 @@
<text>{{item.price == '0' ? '免费' : item.priceText}}</text>
</view>
<view>
<button class="row con-c align-c" catchtap="onReport" data-i
d="{{item.id
}}">报名</button>
<button class="row con-c align-c" catchtap="onReport" data-i
ndex="{{index
}}">报名</button>
</view>
</view>
</view>
...
...
pages/play/movie-detail/movie-detail.js
View file @
68933f16
...
...
@@ -120,12 +120,13 @@ Page({
day
++
}
})
// console.log(showList)
movieInfo
.
priceSpecialText
=
movieInfo
.
ownerPrice
.
toFixed
(
2
)
movieInfo
.
priceText
=
movieInfo
.
visitorPrice
.
toFixed
(
2
)
movieInfo
.
priceSpecialText
=
App
.
modular
.
utils
.
formatAmount
(
movieInfo
.
ownerPrice
),
// 业主价文本格式
movieInfo
.
priceText
=
App
.
modular
.
utils
.
formatAmount
(
movieInfo
.
visitorPrice
),
movieInfo
.
tags
=
movieInfo
.
tags
.
replace
(
/
(
)?
热映影片
(
)?
/
,
' '
).
split
(
' '
)
movieInfo
.
free
=
movieInfo
.
ownerPrice
==
'0'
&&
movieInfo
.
visitorPrice
==
'0'
?
'免费'
:
`¥
${
movieInfo
.
ownerPrice
.
toFixed
(
2
)}
`
let
funcUserType
=
wx
.
getStorageSync
(
'userInfo'
).
userType
// 根据后台判断价格显示类型
// 活动价优先级最高,如果存在活动价,则只显示活动价和普通价
...
...
@@ -133,7 +134,7 @@ Page({
movieInfo
.
priceType
=
1
}
else
{
// 活动价不存在,进一步判断普通价与业主价是否一致,如果不一致,则显示两者
if
(
movieInfo
.
p
rice
!==
movieInfo
.
ownerPrice
&&
funcUserType
)
{
if
(
movieInfo
.
visitorP
rice
!==
movieInfo
.
ownerPrice
&&
funcUserType
)
{
movieInfo
.
priceType
=
2
}
else
{
movieInfo
.
priceType
=
3
...
...
pages/play/movie-detail/movie-detail.wxml
View file @
68933f16
...
...
@@ -81,8 +81,14 @@
<view class="show-time-end">
<text>{{item.endTime + '散场'}}</text>
</view>
<view class="show-free">
<text>{{movieInfo.free}}</text>
<view class="show-free" wx:if="{{movieInfo.priceType === 1}}">
<text>{{movieInfo.priceDiscount === 0 ? '免费' : '¥' + movieInfo.priceDiscount}}</text>
</view>
<view class="show-free" wx:if="{{movieInfo.priceType === 2}}">
<text>{{movieInfo.ownerPrice === 0 ? '免费' : '¥' + movieInfo.priceSpecialText}}</text>
</view>
<view class="show-free" wx:if="{{movieInfo.priceType === 3}}">
<text>{{movieInfo.visitorPrice === 0 ? '免费' : '¥' + movieInfo.priceText}}</text>
</view>
<view class="show-btn" bindtap="onReportMovie" data-item="{{item}}">
<text>报名观影</text>
...
...
pages/play/movie/movie.js
View file @
68933f16
...
...
@@ -90,9 +90,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
.
priceSpecialText
=
App
.
modular
.
utils
.
formatAmount
(
v
.
ownerPrice
),
v
.
priceText
=
App
.
modular
.
utils
.
formatAmount
(
v
.
visitorPrice
),
v
.
tags
=
v
.
tags
.
replace
(
/
(
)?
热映影片
(
)?
/
,
' '
).
split
(
' '
)
let
funcUserType
=
wx
.
getStorageSync
(
'userInfo'
).
userType
...
...
@@ -140,10 +139,22 @@ 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
.
priceSpecialText
=
App
.
modular
.
utils
.
formatAmount
(
v
.
ownerPrice
),
v
.
priceText
=
App
.
modular
.
utils
.
formatAmount
(
v
.
visitorPrice
),
v
.
tags
=
v
.
tags
.
replace
(
/
(
)?
热映影片
(
)?
/
,
' '
).
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
({
'movieAll.movieWeek'
:
{
...
...
@@ -167,10 +178,22 @@ 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
.
priceSpecialText
=
App
.
modular
.
utils
.
formatAmount
(
v
.
ownerPrice
),
v
.
priceText
=
App
.
modular
.
utils
.
formatAmount
(
v
.
visitorPrice
),
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
({
'movieAll.movieNextWeek'
:
{
...
...
pages/play/movie/movie.wxml
View file @
68933f16
...
...
@@ -65,8 +65,14 @@
<view class="movie-label">
<text wx:if="{{item.keyword}}">{{item.keyword}}</text>
</view>
<view class="movie-free">
<text>{{item.free}}</text>
<view class="movie-free" wx:if="{{item.priceType === 1}}">
<text>{{item.priceDiscount === 0 ? '免费' : '¥' + item.priceDiscount}}</text>
</view>
<view class="movie-free" wx:if="{{item.priceType === 2}}">
<text>{{item.ownerPrice === 0 ? '免费' : '¥' + item.priceSpecialText}}</text>
</view>
<view class="movie-free" wx:if="{{item.priceType === 3}}">
<text>{{item.visitorPrice === 0 ? '免费' : '¥' + item.priceText}}</text>
</view>
<view class="movie-btn" catchtap="onReportMovie" data-item="{{item}}">
<text>报名观影</text>
...
...
@@ -137,8 +143,14 @@
<view class="movie-label">
<text>{{item.keyword}}</text>
</view>
<view class="movie-free">
<text>{{item.free}}</text>
<view class="movie-free" wx:if="{{item.priceType === 1}}">
<text>{{item.priceDiscount === 0 ? '免费' : '¥' + item.priceDiscount}}</text>
</view>
<view class="movie-free" wx:if="{{item.priceType === 2}}">
<text>{{item.ownerPrice === 0 ? '免费' : '¥' + item.priceSpecialText}}</text>
</view>
<view class="movie-free" wx:if="{{item.priceType === 3}}">
<text>{{item.visitorPrice === 0 ? '免费' : '¥' + item.priceText}}</text>
</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