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({
pagePath:'',
contentList:[],
currentShareContent: null,
contentPermission: false,
contentPermission: false
},
// 点击切换
......@@ -75,6 +75,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 +150,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 +172,7 @@ wxService.page({
}else{
wxService.post(`/merchant/contentMobileTerminal/operationDelete`, {
contentId: e.detail.contentId,
id: e.detail.contentId,
userId: e.detail.userId
}).then(res => {
if (!res) return false
......@@ -201,6 +215,12 @@ wxService.page({
cardUrl: e.detail.url,
pagePath: path
});
let params = {
contentId: e.detail.id,
type: 3,
userId: memberId
}
this.getReadyOrForwardNumber(params)
}
})
},
......
......@@ -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,6 +175,7 @@ wxService.page({
var params = {
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 => {
if (!res) return false
const { result, data } = res.data
......@@ -152,17 +186,19 @@ wxService.page({
}
}).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.currentType) {
if (!this.data.contentInfo.type) {
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.getContentList(this.data.currentTab)
this.getContentDetail()
}
}).finally(() => {
......@@ -179,7 +215,7 @@ wxService.page({
} else {
wxService.post(`/merchant/contentMobileTerminal/operationDelete`, {
contentId: this.data.contentInfo.id,
id: this.data.contentInfo.id,
userId: memberId
}).then(res => {
if (!res) return false
......@@ -189,7 +225,7 @@ wxService.page({
title: '取消点赞成功',
icon: 'none'
})
this.getContentList(this.data.currentTab)
this.getContentDetail()
}
}).finally(() => {
......@@ -198,6 +234,13 @@ wxService.page({
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
clearTimeout(this.data.loadingTime)
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function (res) {
......
......@@ -4,7 +4,7 @@
<view>{{contentInfo.describe}}</view>
<view class="share-wrap">
<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>
</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>
......
......@@ -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)
}
})
},
......
......@@ -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.getContentList(this.data.currentTab)
this.getContentDetail()
}
}).finally(() => {
......@@ -148,7 +166,7 @@ wxService.page({
title: '取消点赞成功',
icon: 'none'
})
this.getContentList(this.data.currentTab)
this.getContentDetail()
}
}).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)
})
},
/**
......
......@@ -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.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>
</view>
<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