Commit 3b72bd32 by 赵雅纹

Merge branch 'fixbug-ZYW' into 'dev_7.1.0'

Fixbug zyw

See merge request !124
parents d5011a23 91bcf738
...@@ -24,7 +24,7 @@ wxService.page({ ...@@ -24,7 +24,7 @@ wxService.page({
pagePath:'', pagePath:'',
contentList:[], contentList:[],
currentShareContent: null, currentShareContent: null,
contentPermission: false, contentPermission: false
}, },
// 点击切换 // 点击切换
...@@ -75,6 +75,17 @@ wxService.page({ ...@@ -75,6 +75,17 @@ wxService.page({
this.data.currentShareContent = null; 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() { getContentPermission() {
console.log(member) console.log(member)
...@@ -139,8 +150,11 @@ wxService.page({ ...@@ -139,8 +150,11 @@ wxService.page({
// 点赞 // 点赞
gotoLike(e){ gotoLike(e){
console.log(e.detail) let params = {
let params = e.detail contentId: e.detail.contentId,
type: 1,
userId: e.detail.userId
}
if (!e.detail.type){ if (!e.detail.type){
wxService.post(`/merchant/contentMobileTerminal/operationSave`, params).then(res => { wxService.post(`/merchant/contentMobileTerminal/operationSave`, params).then(res => {
if (!res) return false if (!res) return false
...@@ -158,7 +172,7 @@ wxService.page({ ...@@ -158,7 +172,7 @@ wxService.page({
}else{ }else{
wxService.post(`/merchant/contentMobileTerminal/operationDelete`, { wxService.post(`/merchant/contentMobileTerminal/operationDelete`, {
contentId: e.detail.contentId, id: e.detail.contentId,
userId: e.detail.userId userId: e.detail.userId
}).then(res => { }).then(res => {
if (!res) return false if (!res) return false
...@@ -201,6 +215,12 @@ wxService.page({ ...@@ -201,6 +215,12 @@ wxService.page({
cardUrl: e.detail.url, cardUrl: e.detail.url,
pagePath: path pagePath: path
}); });
let params = {
contentId: e.detail.id,
type: 3,
userId: memberId
}
this.getReadyOrForwardNumber(params)
} }
}) })
}, },
......
...@@ -18,7 +18,9 @@ wxService.page({ ...@@ -18,7 +18,9 @@ wxService.page({
proList:[], proList:[],
showCardModal: false, showCardModal: false,
currentShareContent: null, currentShareContent: null,
pagePath:'' pagePath:'',
loadingTime:''
}, },
/** /**
...@@ -34,7 +36,6 @@ wxService.page({ ...@@ -34,7 +36,6 @@ wxService.page({
let memberId = options.memberId; let memberId = options.memberId;
if (memberId) { if (memberId) {
let content = { let content = {
title: this.data.contentInfo.headline, title: this.data.contentInfo.headline,
id: this.data.contentInfo.id, id: this.data.contentInfo.id,
...@@ -60,7 +61,32 @@ wxService.page({ ...@@ -60,7 +61,32 @@ wxService.page({
this.getContentDetail() this.getContentDetail()
this.data.currentShareContent = null; 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){ onTapToGoodsInfo(e){
console.log(e) console.log(e)
...@@ -115,6 +141,12 @@ wxService.page({ ...@@ -115,6 +141,12 @@ wxService.page({
cardUrl: this.data.contentInfo.shareShowPictureRESDTOList[0].url, cardUrl: this.data.contentInfo.shareShowPictureRESDTOList[0].url,
pagePath: path pagePath: path
}); });
let params = {
contentId: this.data.contentInfo.id,
type: 3,
userId: memberId
}
this.getReadyOrForwardNumber(params)
} }
}) })
}, },
...@@ -122,7 +154,8 @@ wxService.page({ ...@@ -122,7 +154,8 @@ wxService.page({
// 获取内容详情 // 获取内容详情
getContentDetail(){ getContentDetail(){
wxService.post(`/merchant/contentMobileTerminal/getContentParticulars`,{ wxService.post(`/merchant/contentMobileTerminal/getContentParticulars`,{
id: this.data.id id: this.data.id,
userId: memberId
}).then(res => { }).then(res => {
if (!res) return false if (!res) return false
const { result, data } = res.data const { result, data } = res.data
...@@ -142,6 +175,7 @@ wxService.page({ ...@@ -142,6 +175,7 @@ wxService.page({
var params = { var params = {
productIds: this.data.contentInfo.productIds productIds: this.data.contentInfo.productIds
} }
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 => { wxService.post(`/sale/product/buyer/listPage?pageNo=${this.data.pageNo}&pageSize=${this.data.pageSize}`, params).then(res => {
if (!res) return false if (!res) return false
const { result, data } = res.data const { result, data } = res.data
...@@ -152,17 +186,19 @@ wxService.page({ ...@@ -152,17 +186,19 @@ wxService.page({
} }
}).finally(() => { }).finally(() => {
}) })
}
}, },
// 点赞 // 点赞
gotoLike(){ gotoLike(){
const { memberId } = wx.getStorageSync('_baseUserInfo') const { memberId } = wx.getStorageSync('_baseUserInfo')
let params = { let params = {
contentId: this.data.contentInfo.id, contentId: this.data.contentInfo.id,
type: this.data.contentInfo.currentType, type: 1,
userId: memberId userId: memberId
} }
if (!this.data.contentInfo.currentType) { if (!this.data.contentInfo.type) {
wxService.post(`/merchant/contentMobileTerminal/operationSave`, params).then(res => { wxService.post(`/merchant/contentMobileTerminal/operationSave`, params).then(res => {
if (!res) return false if (!res) return false
const { result, data } = res.data const { result, data } = res.data
...@@ -171,7 +207,7 @@ wxService.page({ ...@@ -171,7 +207,7 @@ wxService.page({
title: '点赞成功', title: '点赞成功',
icon: 'none' icon: 'none'
}) })
this.getContentList(this.data.currentTab) this.getContentDetail()
} }
}).finally(() => { }).finally(() => {
...@@ -179,7 +215,7 @@ wxService.page({ ...@@ -179,7 +215,7 @@ wxService.page({
} else { } else {
wxService.post(`/merchant/contentMobileTerminal/operationDelete`, { wxService.post(`/merchant/contentMobileTerminal/operationDelete`, {
contentId: this.data.contentInfo.id, id: this.data.contentInfo.id,
userId: memberId userId: memberId
}).then(res => { }).then(res => {
if (!res) return false if (!res) return false
...@@ -189,7 +225,7 @@ wxService.page({ ...@@ -189,7 +225,7 @@ wxService.page({
title: '取消点赞成功', title: '取消点赞成功',
icon: 'none' icon: 'none'
}) })
this.getContentList(this.data.currentTab) this.getContentDetail()
} }
}).finally(() => { }).finally(() => {
...@@ -198,6 +234,13 @@ wxService.page({ ...@@ -198,6 +234,13 @@ wxService.page({
}, },
/** /**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
clearTimeout(this.data.loadingTime)
},
/**
* 用户点击右上角分享 * 用户点击右上角分享
*/ */
onShareAppMessage: function (res) { onShareAppMessage: function (res) {
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<view>{{contentInfo.describe}}</view> <view>{{contentInfo.describe}}</view>
<view class="share-wrap"> <view class="share-wrap">
<view class="share-oprate" bindtap="gotoLike"> <view class="share-oprate" bindtap="gotoLike">
<image class="share-img" src="{{contentInfo.currentType ? '/assets/imgs/heart-primary.png' : '/assets/imgs/heart-default.png'}}" /> <image class="share-img" src="{{contentInfo.type ? '/assets/imgs/heart-primary.png' : '/assets/imgs/heart-default.png'}}" />
<text class="share-number">{{contentInfo.enjoySum || 0}}</text> <text class="share-number">{{contentInfo.enjoySum || 0}}</text>
</view> </view>
<view class="share-oprate" bindtap="onTapShare"> <view class="share-oprate" bindtap="onTapShare">
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
<view class="bottom-price"> <view class="bottom-price">
<text class="price">¥{{item.minSalePrice}}</text> <text class="price">¥{{item.minSalePrice}}</text>
<!-- <text class="cost-price">¥456</text> --> <!-- <text class="cost-price">¥456</text> -->
<view class="look-over">查看详情</view> <view class="look-over">购买</view>
</view> </view>
</view> </view>
</view> </view>
......
...@@ -134,10 +134,24 @@ wxService.page({ ...@@ -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) { gotoLike(e) {
console.log(e.detail) let params = {
let params = e.detail contentId: e.detail.contentId,
type: 1,
userId: e.detail.userId
}
if (!e.detail.type) { if (!e.detail.type) {
wxService.post(`/merchant/contentMobileTerminal/operationSave`, params).then(res => { wxService.post(`/merchant/contentMobileTerminal/operationSave`, params).then(res => {
if (!res) return false if (!res) return false
...@@ -198,6 +212,13 @@ wxService.page({ ...@@ -198,6 +212,13 @@ wxService.page({
cardUrl: e.detail.url, cardUrl: e.detail.url,
pagePath: path pagePath: path
}); });
let params = {
contentId: e.detail.id,
type: 3,
userId: memberId
}
this.getReadyOrForwardNumber(params)
} }
}) })
}, },
......
...@@ -16,7 +16,8 @@ wxService.page({ ...@@ -16,7 +16,8 @@ wxService.page({
showDialig: false, showDialig: false,
showCardModal: false, showCardModal: false,
currentShareContent: null, currentShareContent: null,
pagePath:'' pagePath:'',
loadingTime: ''
}, },
/** /**
...@@ -88,6 +89,12 @@ wxService.page({ ...@@ -88,6 +89,12 @@ wxService.page({
cardUrl: this.data.contentInfo.sspList[0].url, cardUrl: this.data.contentInfo.sspList[0].url,
pagePath:path pagePath:path
}); });
let params = {
contentId: this.data.contentInfo.id,
type: 3,
userId: memberId
}
this.getReadyOrForwardNumber(params)
} }
}) })
}, },
...@@ -113,15 +120,26 @@ wxService.page({ ...@@ -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() { gotoLike() {
const { memberId } = wx.getStorageSync('_baseUserInfo') const { memberId } = wx.getStorageSync('_baseUserInfo')
let params = { let params = {
contentId: this.data.contentInfo.id, contentId: this.data.contentInfo.id,
type: this.data.contentInfo.type, type: 1,
userId: memberId userId: memberId
} }
if (!this.data.contentInfo.currentType) { if (this.data.contentInfo.type == 0) {
wxService.post(`/merchant/contentMobileTerminal/operationSave`, params).then(res => { wxService.post(`/merchant/contentMobileTerminal/operationSave`, params).then(res => {
if (!res) return false if (!res) return false
const { result, data } = res.data const { result, data } = res.data
...@@ -130,7 +148,7 @@ wxService.page({ ...@@ -130,7 +148,7 @@ wxService.page({
title: '点赞成功', title: '点赞成功',
icon: 'none' icon: 'none'
}) })
this.getContentList(this.data.currentTab) this.getContentDetail()
} }
}).finally(() => { }).finally(() => {
...@@ -148,7 +166,7 @@ wxService.page({ ...@@ -148,7 +166,7 @@ wxService.page({
title: '取消点赞成功', title: '取消点赞成功',
icon: 'none' icon: 'none'
}) })
this.getContentList(this.data.currentTab) this.getContentDetail()
} }
}).finally(() => { }).finally(() => {
...@@ -185,6 +203,18 @@ wxService.page({ ...@@ -185,6 +203,18 @@ wxService.page({
this.getContentDetail() this.getContentDetail()
} }
this.data.currentShareContent = null; this.data.currentShareContent = null;
//超过15s统计阅读
this.setData({
loadingTime: setTimeout(() => {
let params = {
contentId: this.data.contentInfo.id,
type: 2,
userId: memberId
}
this.getReadyOrForwardNumber(params)
}, 15000)
})
}, },
/** /**
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
<!-- <view class="share-num"> {{contentInfo.enjoySum || 0}} </view> <!-- <view class="share-num"> {{contentInfo.enjoySum || 0}} </view>
<view class="share-num"> {{contentInfo.readSum || 0}} </view> --> <view class="share-num"> {{contentInfo.readSum || 0}} </view> -->
<view class="share-oprate" bindtap="gotoLike"> <view class="share-oprate" bindtap="gotoLike">
<image class="share-img" src="{{contentInfo.currentType ? '/assets/imgs/heart-primary.png' : '/assets/imgs/heart-default.png'}}" /> <image class="share-img" src="{{contentInfo.type ? '/assets/imgs/heart-primary.png' : '/assets/imgs/heart-default.png'}}" />
<text class="share-number">{{contentInfo.enjoySum || 0}}</text> <text class="share-number">{{contentInfo.enjoySum || 0}}</text>
</view> </view>
<view class="share-oprate" bindtap="onTapShare"> <view class="share-oprate" bindtap="onTapShare">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment