Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
yoho-limited-sell-miniapp
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
肖亚东
6 years ago
Commit
2af022f78e03a8a94b2eec500a531ea1320a8cea
1 parent
fa1cece4
用户是否关注有货服务号功能开发
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
53 additions
and
29 deletions
app/models/product/detail.js
app/pages/product/detail/detail.js
app/pages/product/detail/detail.wxml
app/models/product/detail.js
View file @
2af022f
...
...
@@ -143,5 +143,19 @@ export default {
}).
catch
(
e
=>
{
console
.
log
(
'error'
,
e
);
});
}
},
/**
* 用户是否关注过有货服务号
* 返回值:"isSubscribe": "Y" 已关注 "N"未关注
*/
getUserWechatRelateInfo
(
uid
)
{
return
api
.
get
({
url
:
''
,
data
:
{
method
:
'app.passport.userWechatRelateInfo'
,
uid
}
});
},
};
...
...
app/pages/product/detail/detail.js
View file @
2af022f
...
...
@@ -163,22 +163,20 @@ Page(Object.assign({
title
:
'加载中...'
,
mask
:
true
,
});
},
setTimeout
(()
=>
{
app
=
app
||
getApp
();
if
(
this
.
data
.
scene
)
{
this
.
loadDataFromCode
().
then
(()
=>
{
this
.
init
().
then
(()
=>
{
this
.
_showRepeat
();
});
});
}
else
{
onShow
()
{
if
(
this
.
data
.
scene
)
{
this
.
loadDataFromCode
().
then
(()
=>
{
this
.
init
().
then
(()
=>
{
this
.
_showRepeat
();
});
}
},
1000
);
});
}
else
{
this
.
init
().
then
(()
=>
{
this
.
_showRepeat
();
});
}
},
loadDataFromCode
()
{
...
...
@@ -231,12 +229,6 @@ Page(Object.assign({
});
},
onShow
()
{
this
.
init
().
then
(()
=>
{
this
.
_showRepeat
();
});
},
onShareAppMessage
:
function
(
res
)
{
let
params
=
{
TITLE
:
this
.
data
.
productName
,
...
...
@@ -393,9 +385,6 @@ Page(Object.assign({
(
this
.
data
.
originUid
&&
this
.
data
.
originUid
!==
this
.
data
.
uid
))
{
productSourceType
=
PRODUCT_SOURCE_TYPE
.
SHARE
;
}
let
isFollowedServiceNumber
=
res
.
data
&&
res
.
data
.
isFollowedServiceNumber
?
res
.
data
.
isFollowedServiceNumber
:
false
;
this
.
setData
({
productSkn
:
res
.
data
.
productSkn
?
res
.
data
.
productSkn
:
''
,
productName
:
res
.
data
.
productName
?
res
.
data
.
productName
:
''
,
...
...
@@ -410,7 +399,6 @@ Page(Object.assign({
productDesc
,
snapData
,
productSourceType
,
isFollowedServiceNumber
,
isNew
:
res
.
data
.
isNew
?
res
.
data
.
isNew
:
''
,
currentTime
:
res
.
data
.
currentTime
?
res
.
data
.
currentTime
:
''
,
oldSaleTime
:
res
.
data
.
oldSaleTime
?
res
.
data
.
oldSaleTime
:
''
,
...
...
@@ -662,11 +650,16 @@ Page(Object.assign({
showCancel
:
false
,
success
(
res
)
{
if
(
res
.
confirm
)
{
wx
.
showToast
({
icon
:
'none'
,
title
:
'公众号“YOHOBUY有货”,已复制成功,打开微信去搜索关注吧!'
,
duration
:
3000
});
wx
.
setClipboardData
({
data
:
'YOHOBUY有货'
,
success
(
res
)
{
wx
.
showToast
({
icon
:
'none'
,
title
:
'公众号“YOHOBUY有货”,已复制成功,打开微信去搜索关注吧!'
,
duration
:
3000
});
}
})
}
}
})
...
...
@@ -776,6 +769,8 @@ Page(Object.assign({
}).
then
(()
=>
{
return
this
.
getAssistInfo
();
}).
then
(()
=>
{
return
this
.
getUserWechatRelateInfo
();
}).
then
(()
=>
{
wx
.
hideLoading
();
});
},
...
...
@@ -812,6 +807,21 @@ Page(Object.assign({
}
});
},
//用户是否关注过有货服务号
getUserWechatRelateInfo
()
{
if
(
!
this
.
data
.
uid
)
{
return
Promise
.
resolve
();
}
let
uid
=
this
.
data
.
uid
;
return
detailModel
.
getUserWechatRelateInfo
(
uid
).
then
(
result
=>
{
if
(
result
.
code
===
200
&&
result
.
data
.
isSubscribe
)
{
this
.
setData
({
isSubscribe
:
result
.
data
.
isSubscribe
,
});
}
});
},
_showRepeat
()
{
if
(
this
.
data
.
queueStatus
===
QUEUE_STATUS
.
QUEUE_HELP
)
{
this
.
setData
({
...
...
app/pages/product/detail/detail.wxml
View file @
2af022f
...
...
@@ -200,7 +200,7 @@
<block wx:elif="{{showStatus === 6}}">
<action-bar wx:if="{{productSourceType === 1}}">
<view class="bottom1-action">
<view wx:if="{{is
FollowedServiceNumber
== 'N'}}" class="as-bottom confirm" bindtap="saleRemind">关注公众号获得发售提醒</view>
<view wx:if="{{is
Subscribe
== 'N'}}" class="as-bottom confirm" bindtap="saleRemind">关注公众号获得发售提醒</view>
<view wx:else class="as-bottom cancel">即将开售</view>
</view>
</action-bar>
...
...
Please
register
or
login
to post a comment