Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
7
7-Eleven
Overview
Overview
Details
Activity
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
高淑倩
7-Eleven
Commits
722764fc
Commit
722764fc
authored
Sep 12, 2019
by
赵雅纹
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
统计转发与阅读数
parent
69315081
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
147 additions
and
32 deletions
+147
-32
myShare.js
src/pages/myShare/myShare.js
+25
-4
wantToBuyDetail.js
src/pages/wantToBuyDetail/wantToBuyDetail.js
+61
-18
wantToBuyDetail.wxml
src/pages/wantToBuyDetail/wantToBuyDetail.wxml
+2
-2
myRelease.js
src/subPackage/page/pages/myRelease/myRelease.js
+23
-2
myReleaseDetail.js
src/subPackage/page/pages/myReleaseDetail/myReleaseDetail.js
+35
-5
myReleaseDetail.wxml
...ubPackage/page/pages/myReleaseDetail/myReleaseDetail.wxml
+1
-1
No files found.
src/pages/myShare/myShare.js
View file @
722764fc
...
...
@@ -24,7 +24,7 @@ wxService.page({
pagePath
:
''
,
contentList
:[],
currentShareContent
:
null
,
contentPermission
:
false
,
contentPermission
:
false
},
// 点击切换
...
...
@@ -61,6 +61,7 @@ wxService.page({
*/
onShow
()
{
let
time
=
Date
.
parse
(
new
Date
())
member
.
premiumExpireTime
?
member
.
premiumExpireTime
:
''
if
(
member
.
premiumExpireTime
&&
member
.
premiumExpireTime
>
time
)
{
this
.
setData
({
plus
:
1
...
...
@@ -75,6 +76,17 @@ wxService.page({
this
.
data
.
currentShareContent
=
null
;
},
// 统计阅读和转发量
getReadyOrForwardNumber
(
params
)
{
wxService
.
post
(
`/merchant/contentMobileTerminal/operationSave`
,
params
).
then
(
res
=>
{
if
(
!
res
)
return
false
const
{
result
,
data
}
=
res
.
data
if
(
result
==
0
)
{
}
}).
finally
(()
=>
{
})
},
// 发布内容权限
getContentPermission
()
{
console
.
log
(
member
)
...
...
@@ -139,8 +151,11 @@ wxService.page({
// 点赞
gotoLike
(
e
){
console
.
log
(
e
.
detail
)
let
params
=
e
.
detail
let
params
=
{
contentId
:
e
.
detail
.
contentId
,
type
:
1
,
userId
:
e
.
detail
.
userId
}
if
(
!
e
.
detail
.
type
){
wxService
.
post
(
`/merchant/contentMobileTerminal/operationSave`
,
params
).
then
(
res
=>
{
if
(
!
res
)
return
false
...
...
@@ -158,7 +173,7 @@ wxService.page({
}
else
{
wxService
.
post
(
`/merchant/contentMobileTerminal/operationDelete`
,
{
contentI
d
:
e
.
detail
.
contentId
,
i
d
:
e
.
detail
.
contentId
,
userId
:
e
.
detail
.
userId
}).
then
(
res
=>
{
if
(
!
res
)
return
false
...
...
@@ -201,6 +216,12 @@ wxService.page({
cardUrl
:
e
.
detail
.
url
,
pagePath
:
path
});
let
params
=
{
contentId
:
e
.
detail
.
id
,
type
:
3
,
userId
:
memberId
}
this
.
getReadyOrForwardNumber
(
params
)
}
})
},
...
...
src/pages/wantToBuyDetail/wantToBuyDetail.js
View file @
722764fc
...
...
@@ -18,7 +18,9 @@ wxService.page({
proList
:[],
showCardModal
:
false
,
currentShareContent
:
null
,
pagePath
:
''
pagePath
:
''
,
loadingTime
:
''
},
/**
...
...
@@ -34,7 +36,6 @@ wxService.page({
let
memberId
=
options
.
memberId
;
if
(
memberId
)
{
let
content
=
{
title
:
this
.
data
.
contentInfo
.
headline
,
id
:
this
.
data
.
contentInfo
.
id
,
...
...
@@ -60,7 +61,32 @@ wxService.page({
this
.
getContentDetail
()
this
.
data
.
currentShareContent
=
null
;
//超过15s统计阅读
this
.
setData
({
loadingTime
:
setTimeout
(()
=>
{
let
params
=
{
contentId
:
this
.
data
.
contentInfo
.
id
,
type
:
2
,
userId
:
memberId
}
this
.
getReadyOrForwardNumber
(
params
)
},
15000
)
})
},
// 统计阅读和转发量
getReadyOrForwardNumber
(
params
){
wxService
.
post
(
`/merchant/contentMobileTerminal/operationSave`
,
params
).
then
(
res
=>
{
if
(
!
res
)
return
false
const
{
result
,
data
}
=
res
.
data
if
(
result
==
0
)
{
}
}).
finally
(()
=>
{
})
},
//跳转商品详情
onTapToGoodsInfo
(
e
){
console
.
log
(
e
)
...
...
@@ -115,6 +141,12 @@ wxService.page({
cardUrl
:
this
.
data
.
contentInfo
.
shareShowPictureRESDTOList
[
0
].
url
,
pagePath
:
path
});
let
params
=
{
contentId
:
this
.
data
.
contentInfo
.
id
,
type
:
3
,
userId
:
memberId
}
this
.
getReadyOrForwardNumber
(
params
)
}
})
},
...
...
@@ -122,7 +154,8 @@ wxService.page({
// 获取内容详情
getContentDetail
(){
wxService
.
post
(
`/merchant/contentMobileTerminal/getContentParticulars`
,{
id
:
this
.
data
.
id
id
:
this
.
data
.
id
,
userId
:
memberId
}).
then
(
res
=>
{
if
(
!
res
)
return
false
const
{
result
,
data
}
=
res
.
data
...
...
@@ -142,27 +175,30 @@ wxService.page({
var
params
=
{
productIds
:
this
.
data
.
contentInfo
.
productIds
}
wxService
.
post
(
`/sale/product/buyer/listPage?pageNo=
${
this
.
data
.
pageNo
}
&pageSize=
${
this
.
data
.
pageSize
}
`
,
params
).
then
(
res
=>
{
if
(
!
res
)
return
false
const
{
result
,
data
}
=
res
.
data
if
(
result
==
0
&&
data
.
content
)
{
this
.
setData
({
proList
:
data
.
content
})
}
}).
finally
(()
=>
{
})
if
(
this
.
data
.
contentInfo
.
productIds
&&
this
.
data
.
contentInfo
.
productIds
.
length
>
0
){
wxService
.
post
(
`/sale/product/buyer/listPage?pageNo=
${
this
.
data
.
pageNo
}
&pageSize=
${
this
.
data
.
pageSize
}
`
,
params
).
then
(
res
=>
{
if
(
!
res
)
return
false
const
{
result
,
data
}
=
res
.
data
if
(
result
==
0
&&
data
.
content
)
{
this
.
setData
({
proList
:
data
.
content
})
}
}).
finally
(()
=>
{
})
}
},
// 点赞
gotoLike
(){
const
{
memberId
}
=
wx
.
getStorageSync
(
'_baseUserInfo'
)
let
params
=
{
contentId
:
this
.
data
.
contentInfo
.
id
,
type
:
this
.
data
.
contentInfo
.
currentType
,
type
:
1
,
userId
:
memberId
}
if
(
!
this
.
data
.
contentInfo
.
currentT
ype
)
{
if
(
!
this
.
data
.
contentInfo
.
t
ype
)
{
wxService
.
post
(
`/merchant/contentMobileTerminal/operationSave`
,
params
).
then
(
res
=>
{
if
(
!
res
)
return
false
const
{
result
,
data
}
=
res
.
data
...
...
@@ -171,7 +207,7 @@ wxService.page({
title
:
'点赞成功'
,
icon
:
'none'
})
this
.
getContent
List
(
this
.
data
.
currentTab
)
this
.
getContent
Detail
(
)
}
}).
finally
(()
=>
{
...
...
@@ -179,7 +215,7 @@ wxService.page({
}
else
{
wxService
.
post
(
`/merchant/contentMobileTerminal/operationDelete`
,
{
contentI
d
:
this
.
data
.
contentInfo
.
id
,
i
d
:
this
.
data
.
contentInfo
.
id
,
userId
:
memberId
}).
then
(
res
=>
{
if
(
!
res
)
return
false
...
...
@@ -189,7 +225,7 @@ wxService.page({
title
:
'取消点赞成功'
,
icon
:
'none'
})
this
.
getContent
List
(
this
.
data
.
currentTab
)
this
.
getContent
Detail
(
)
}
}).
finally
(()
=>
{
...
...
@@ -198,6 +234,13 @@ wxService.page({
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide
:
function
()
{
clearTimeout
(
this
.
data
.
loadingTime
)
},
/**
* 用户点击右上角分享
*/
onShareAppMessage
:
function
(
res
)
{
...
...
src/pages/wantToBuyDetail/wantToBuyDetail.wxml
View file @
722764fc
...
...
@@ -4,7 +4,7 @@
<view>{{contentInfo.describe}}</view>
<view class="share-wrap">
<view class="share-oprate" bindtap="gotoLike">
<image class="share-img" src="{{contentInfo.
currentT
ype ? '/assets/imgs/heart-primary.png' : '/assets/imgs/heart-default.png'}}" />
<image class="share-img" src="{{contentInfo.
t
ype ? '/assets/imgs/heart-primary.png' : '/assets/imgs/heart-default.png'}}" />
<text class="share-number">{{contentInfo.enjoySum || 0}}</text>
</view>
<view class="share-oprate" bindtap="onTapShare">
...
...
@@ -28,7 +28,7 @@
<view class="bottom-price">
<text class="price">¥{{item.minSalePrice}}</text>
<!-- <text class="cost-price">¥456</text> -->
<view class="look-over">
查看详情
</view>
<view class="look-over">
购买
</view>
</view>
</view>
</view>
...
...
src/subPackage/page/pages/myRelease/myRelease.js
View file @
722764fc
...
...
@@ -134,10 +134,24 @@ wxService.page({
})
},
// 统计阅读和转发量
getReadyOrForwardNumber
(
params
)
{
wxService
.
post
(
`/merchant/contentMobileTerminal/operationSave`
,
params
).
then
(
res
=>
{
if
(
!
res
)
return
false
const
{
result
,
data
}
=
res
.
data
if
(
result
==
0
)
{
}
}).
finally
(()
=>
{
})
},
// 点赞
gotoLike
(
e
)
{
console
.
log
(
e
.
detail
)
let
params
=
e
.
detail
let
params
=
{
contentId
:
e
.
detail
.
contentId
,
type
:
1
,
userId
:
e
.
detail
.
userId
}
if
(
!
e
.
detail
.
type
)
{
wxService
.
post
(
`/merchant/contentMobileTerminal/operationSave`
,
params
).
then
(
res
=>
{
if
(
!
res
)
return
false
...
...
@@ -198,6 +212,13 @@ wxService.page({
cardUrl
:
e
.
detail
.
url
,
pagePath
:
path
});
let
params
=
{
contentId
:
e
.
detail
.
id
,
type
:
3
,
userId
:
memberId
}
this
.
getReadyOrForwardNumber
(
params
)
}
})
},
...
...
src/subPackage/page/pages/myReleaseDetail/myReleaseDetail.js
View file @
722764fc
...
...
@@ -16,7 +16,8 @@ wxService.page({
showDialig
:
false
,
showCardModal
:
false
,
currentShareContent
:
null
,
pagePath
:
''
pagePath
:
''
,
loadingTime
:
''
},
/**
...
...
@@ -88,6 +89,12 @@ wxService.page({
cardUrl
:
this
.
data
.
contentInfo
.
sspList
[
0
].
url
,
pagePath
:
path
});
let
params
=
{
contentId
:
this
.
data
.
contentInfo
.
id
,
type
:
3
,
userId
:
memberId
}
this
.
getReadyOrForwardNumber
(
params
)
}
})
},
...
...
@@ -113,15 +120,26 @@ wxService.page({
})
},
// 统计阅读和转发量
getReadyOrForwardNumber
(
params
)
{
wxService
.
post
(
`/merchant/contentMobileTerminal/operationSave`
,
params
).
then
(
res
=>
{
if
(
!
res
)
return
false
const
{
result
,
data
}
=
res
.
data
if
(
result
==
0
)
{
}
}).
finally
(()
=>
{
})
},
// 点赞
gotoLike
()
{
const
{
memberId
}
=
wx
.
getStorageSync
(
'_baseUserInfo'
)
let
params
=
{
contentId
:
this
.
data
.
contentInfo
.
id
,
type
:
this
.
data
.
contentInfo
.
type
,
type
:
1
,
userId
:
memberId
}
if
(
!
this
.
data
.
contentInfo
.
currentType
)
{
if
(
this
.
data
.
contentInfo
.
type
==
0
)
{
wxService
.
post
(
`/merchant/contentMobileTerminal/operationSave`
,
params
).
then
(
res
=>
{
if
(
!
res
)
return
false
const
{
result
,
data
}
=
res
.
data
...
...
@@ -130,7 +148,7 @@ wxService.page({
title
:
'点赞成功'
,
icon
:
'none'
})
this
.
getContent
List
(
this
.
data
.
currentTab
)
this
.
getContent
Detail
(
)
}
}).
finally
(()
=>
{
...
...
@@ -148,7 +166,7 @@ wxService.page({
title
:
'取消点赞成功'
,
icon
:
'none'
})
this
.
getContent
List
(
this
.
data
.
currentTab
)
this
.
getContent
Detail
(
)
}
}).
finally
(()
=>
{
...
...
@@ -185,6 +203,18 @@ wxService.page({
this
.
getContentDetail
()
}
this
.
data
.
currentShareContent
=
null
;
//超过15s统计阅读
this
.
setData
({
loadingTime
:
setTimeout
(()
=>
{
let
params
=
{
contentId
:
this
.
data
.
contentInfo
.
id
,
type
:
2
,
userId
:
memberId
}
this
.
getReadyOrForwardNumber
(
params
)
},
15000
)
})
},
/**
...
...
src/subPackage/page/pages/myReleaseDetail/myReleaseDetail.wxml
View file @
722764fc
...
...
@@ -16,7 +16,7 @@
<!-- <view class="share-num"> {{contentInfo.enjoySum || 0}} </view>
<view class="share-num"> {{contentInfo.readSum || 0}} </view> -->
<view class="share-oprate" bindtap="gotoLike">
<image class="share-img" src="{{contentInfo.
currentT
ype ? '/assets/imgs/heart-primary.png' : '/assets/imgs/heart-default.png'}}" />
<image class="share-img" src="{{contentInfo.
t
ype ? '/assets/imgs/heart-primary.png' : '/assets/imgs/heart-default.png'}}" />
<text class="share-number">{{contentInfo.enjoySum || 0}}</text>
</view>
<view class="share-oprate" bindtap="onTapShare">
...
...
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