Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
U
uni-pdtravel
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
panyongping
uni-pdtravel
Commits
122173dc
Commit
122173dc
authored
Sep 06, 2023
by
renjie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改相册首页进入逻辑
parent
f318a2cf
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
52 additions
and
85 deletions
+52
-85
albumIndex.vue
pages/album/albumIndex.vue
+51
-84
chooseFavorite.vue
pages/album/chooseFavorite.vue
+1
-1
No files found.
pages/album/albumIndex.vue
View file @
122173dc
...
...
@@ -70,28 +70,18 @@
</view>
</view>
<view
class=
"coupon"
@
click=
"couponTip = true"
>
<image
class=
"coupon-img"
src=
"@/static/img/my/coupon.png"
mode=
"aspectFit"
v-if=
"isHaveCoupon"
>
</image>
<view
class=
"coupon"
@
click=
"showUseRule = true"
v-if=
"isHaveCoupon"
>
<image
class=
"coupon-img"
src=
"@/static/img/my/coupon.png"
mode=
"aspectFit"
></image>
<text
class=
"coupon-price"
>
<text
class=
"r-symbol"
>
¥
</text>
{{couponPrice}}
</text>
</view>
<u-mask
:show=
"
postCartTip ||
couponTip || showUseRule"
>
<u-mask
:show=
"couponTip || showUseRule"
>
<view
class=
"mask"
>
<view
class=
"img-box"
>
<image
class=
"bg"
src=
"@/static/img/my/backgroundIcon01.png"
mode=
"aspectFit"
></image>
<view
class=
"post-card"
v-if=
"postCartTip"
>
<view
class=
"thank"
>
- 感谢您的参与 -
</view>
<view
class=
"tip-content"
>
<text>
免费领取
</text>
<text>
纪念小照片1张
</text>
</view>
<image
class=
"my-card"
src=
"./static/album/myCard.png"
mode=
"aspectFit"
></image>
<view
class=
"address"
>
(领取地址:南站观景台旁)
</view>
</view>
<view
class=
"coupon-box"
v-if=
"couponTip"
>
<view
class=
"congra"
>
恭喜您!
</view>
<view
class=
"get-coupon"
>
...
...
@@ -139,7 +129,6 @@ export default {
},
data
()
{
return
{
postCartTip
:
false
,
//明信片领取提示
couponTip
:
false
,
//券领取提示
showUseRule
:
false
,
//使用规则提示
statusBarHeight
:
0
,
...
...
@@ -198,7 +187,6 @@ export default {
})
},
closeMask
()
{
//---关闭遮罩
this
.
postCartTip
=
false
this
.
couponTip
=
false
this
.
showUseRule
=
false
},
...
...
@@ -260,15 +248,15 @@ export default {
})
},
async
handleWhetherToVotePage
()
{
//---判断是否跳转投票页面
// 1.获取调查列表
// 1.获取调查列表
id
const
surveyQueryData
=
{
pageCode
:
'albumIndex'
,
//默认前端写死
channelId
:
this
.
options
.
channelId
//游客扫码携带的channelId
或者是胖丁登录时的公司id
channelId
:
this
.
options
.
channelId
//游客扫码携带的channelId
}
const
surveyList
=
await
this
.
judgeWhether
(
'scenic/market/findPageMarket'
,
surveyQueryData
)
// 2.判断商店是否在做投票活动
// 2.判断商店是否在做投票活动
,获取模板
let
surveyIds
let
surveyResult
=
[]
...
...
@@ -279,20 +267,25 @@ export default {
})
}
else
{
// 调查模板为空则直接展示首页
this
.
show
=
true
this
.
getCoupon
()
this
.
couponIsUse
()
return
}
// 3.判断用户是否已经投过票
let
voteObj
=
{}
// 用户投票信息
if
(
surveyResult
.
length
)
{
// 默认保存第一个商店id
// this.options.merchantId = surveyResult[0].merchantId
const
votedQueryData
=
{
merchantId
:
surveyResult
[
0
].
merchantId
,
openid
:
uni
.
getStorageSync
(
'openid'
)
}
voteObj
=
await
this
.
judgeWhether
(
'wechatUser/pdAlbum/checkVisitorSurvey'
,
votedQueryData
)
}
else
{
this
.
show
=
true
this
.
getCoupon
()
this
.
couponIsUse
()
return
}
// 4.判断是否跳转投票页面
...
...
@@ -302,9 +295,11 @@ export default {
})
}
else
if
(
voteObj
.
alreadySurvey
===
1
)
{
// 已投票
this
.
show
=
true
this
.
getCoupon
()
this
.
couponIsUse
()
}
},
findPageMarketFu
n
()
{
//---获取优惠券
getCoupo
n
()
{
//---获取优惠券
var
data
=
{
pageCode
:
'albumIndex'
,
marketingStatus
:
1
,
...
...
@@ -313,7 +308,9 @@ export default {
}
this
.
$request
(
'scenic/market/findPageMarket'
,
data
).
then
((
res
)
=>
{
if
(
res
.
code
===
'00'
)
{
this
.
couponIsUse
()
if
(
res
.
data
.
length
)
{
this
.
couponTip
=
true
}
}
else
if
(
res
.
code
===
'04'
)
{
this
.
isHaveCoupon
=
false
}
else
{
...
...
@@ -329,36 +326,18 @@ export default {
openid
:
this
.
openid
}).
then
(
res
=>
{
if
(
res
.
code
===
'00'
)
{
res
.
data
.
forEach
(
item
=>
{
if
(
item
.
useRange
===
11
&&
item
.
couponStatus
===
1
)
{
const
albumCoupon
=
res
.
data
.
filter
(
item
=>
item
.
useRange
===
11
&&
item
.
couponStatus
===
1
)
// 过滤 相册的劵
if
(
!
albumCoupon
.
length
)
return
const
firstItem
=
albumCoupon
[
0
]
this
.
isHaveCoupon
=
true
this
.
couponPrice
=
i
tem
.
deductPrice
this
.
couponPrice
=
firstI
tem
.
deductPrice
// 处理使用规则数据结构
let
ruleContents
=
item
.
couponRule
?
item
.
couponRule
.
split
(
';'
)
:
[]
ruleContents
=
ruleContents
.
map
(
value
=>
{
return
{
value
}
})
this
.
rules
.
push
({
ruleName
:
'规则说明'
,
contents
:
ruleContents
})
let
elseContents
=
item
.
couponRuleRemind
?
item
.
couponRuleRemind
.
split
(
';'
)
:
[]
elseContents
=
elseContents
.
map
(
value
=>
{
return
{
value
}
})
this
.
rules
.
push
({
ruleName
:
'补充说明'
,
contents
:
elseContents
})
}
})
this
.
handleDataStructure
(
firstItem
.
couponRule
,
'规则说明'
)
this
.
handleDataStructure
(
firstItem
.
couponRuleRemind
,
'补充说明'
)
}
else
{
uni
.
showToast
({
title
:
res
.
message
,
...
...
@@ -372,6 +351,18 @@ export default {
})
})
},
handleDataStructure
(
str
,
title
)
{
//---处理使用规则数据结构
let
ruleContents
=
str
?
str
.
split
(
';'
)
:
[]
ruleContents
=
ruleContents
.
map
(
value
=>
{
return
{
value
}
})
this
.
rules
.
push
({
ruleName
:
title
,
contents
:
ruleContents
})
},
recordDeviceInfo
()
{
//---记录设备信息
this
.
statusBarHeight
=
uni
.
getSystemInfoSync
().
statusBarHeight
// 状态栏高度
this
.
capsule
=
uni
.
getMenuButtonBoundingClientRect
()
// 胶囊大小、位置数据
...
...
@@ -382,16 +373,17 @@ export default {
this
.
$commonjs
.
getCompanyId
(
options
)
this
.
openid
=
uni
.
getStorageSync
(
'openid'
)
this
.
userId
=
uni
.
getStorageSync
(
'userId'
)
this
.
findPageMarketFun
()
this
.
recordDeviceInfo
()
this
.
options
=
options
if
(
this
.
options
.
t
ip
===
'true'
)
{
// 从模板选择页进入
if
(
this
.
options
.
t
emplate
===
'true'
)
{
// 从模板选择页进入
this
.
show
=
true
this
.
postCartTip
=
true
this
.
getCoupon
()
this
.
couponIsUse
()
}
else
if
(
this
.
options
.
channelId
)
{
// 扫码进入本页
this
.
handleWhetherToVotePage
()
}
else
if
(
this
.
options
.
index
==
1
)
{
// 从vlog首页进入
this
.
show
=
true
this
.
couponIsUse
()
}
if
(
uni
.
getStorageSync
(
'location'
))
return
...
...
@@ -402,10 +394,7 @@ export default {
uni
.
setStorageSync
(
'location'
,
JSON
.
stringify
(
res
))
},
fail
()
{
uni
.
showToast
({
title
:
'获取经纬度失败'
,
icon
:
'none'
})
console
.
log
(
'获取经纬度失败'
)
}
})
}
...
...
@@ -635,7 +624,6 @@ export default {
}
}
.post-card
,
.coupon-box
,
.rules
{
display
:
flex
;
...
...
@@ -646,27 +634,6 @@ export default {
overflow-y
:
auto
;
}
.post-card
{
justify-content
:
space-between
;
font-size
:
36rpx
;
.thank
{
font-size
:
28rpx
;
color
:
#999
;
}
.tip-content
{
display
:
flex
;
flex-direction
:
column
;
align-items
:
center
;
}
.address
{
font-size
:
24rpx
;
font-weight
:
700
;
}
}
.coupon-box
{
justify-content
:
space-between
;
font-size
:
36rpx
;
...
...
pages/album/chooseFavorite.vue
View file @
122173dc
...
...
@@ -67,7 +67,7 @@ export default {
icon
:
'success'
})
uni
.
navigateTo
({
url
:
`./albumIndex?t
ip
=true&merchantId=
${
data
.
merchantId
}
`
url
:
`./albumIndex?t
emplate
=true&merchantId=
${
data
.
merchantId
}
`
})
}
else
{
uni
.
showToast
({
...
...
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