Commit 5d6fd72c by 赵雅纹

Merge branch 'feature-zyw-sc' into 'dev_7.1.0'

Feature zyw sc

See merge request !90
parents d52923ee 191f703e
......@@ -45,6 +45,12 @@ Component({
this.setData({
showCardModal: true
})
},
closeCardModal(){
this.setData({
showCardModal: false
})
}
......
......@@ -39,6 +39,14 @@ Component({
* 组件的方法列表
*/
methods: {
// 关闭modal
closePoste(){
this.setData({
showpost: false
})
},
//下载产品图片
getAvaterInfo: function () {
wx.showLoading({
......
......@@ -2,6 +2,6 @@
"navigationBarTitleText": "推广商品",
"usingComponents": {
"share-modal": "/component/shareModal/shareModal",
"share-poster": "/component/sharePoster/sharePoster"
"card-modal": "/component/cardModal/cardModal"
}
}
\ No newline at end of file
......@@ -188,7 +188,7 @@ wxService.page({
if (res.from != 'menu'){
let id = Integer.digit(this.data.currentShareContent.id, 10, 64);
let tentacleId = Integer.digit(this.data.currentShareContent.tentacleId,10,64);
var path = 'subPackage/page/pages/myReleaseDetail/myReleaseDetail?i=' + id + '&t=' + tentacleId;
var path = 'pages/wantToBuyDetail/wantToBuyDetail?i=' + id + '&t=' + tentacleId;
console.log(path)
return {
path: path
......@@ -204,11 +204,6 @@ wxService.page({
wxService.getTentacleContent(tentacleInfo).then(res => {
if (res && res.tentacleId) {
this.data.currentShareContent.tentacleId = res.tentacleId;
this.setData({
showCardModal: true,
cardTitle: e.detail.title,
cardUrl: e.detail.url
});
let tentacleId = Integer.digit(res.tentacleId, 10, 64);
var path = `pages/myShare/myShare?t=${tentacleId}`;
return {
......
......@@ -8,7 +8,7 @@
</view>
<scroll-view scroll-y >
<view class="main-content" wx:if="{{contentList.length > 0}}">
<water-flow-layout type="2" image-data="{{contentList}}" bind:updataLike="gotoLike" bind:_onTapShare="_onTapShare"/>
<water-flow-layout type="1" image-data="{{contentList}}" bind:updataLike="gotoLike" bind:_onTapShare="_onTapShare"/>
</view>
<view class="empty" wx:if="{{!contentList || contentList.length < 1}}">
暂无内容哦~
......
......@@ -3,6 +3,7 @@ const app = getApp()
const wxService = require('../../utils/wxService')
const utils = require('../../utils/util')
const envInfo = require('../../config/index').envInfo
import { Integer } from '../../utils/integerDigitalConvertion'
wxService.page({
/**
......@@ -13,7 +14,9 @@ wxService.page({
id:'',
pageNo:1,
pageSize:100,
proList:[]
proList:[],
showCardModal: false,
currentShareContent: null
},
/**
......@@ -32,6 +35,44 @@ wxService.page({
*/
onShow() {
this.getContentDetail()
this.data.currentShareContent = null;
},
// 分享
onTapShare() {
this.setData({
showCardModal: true,
cardTitle: this.data.contentInfo.headline,
cardUrl: this.data.contentInfo.url,
})
let content = {
headline: this.data.contentInfo.headline,
id: this.data.contentInfo.id,
article: this.data.contentInfo.article,
url: this.data.contentInfo.url
}
let tentacleInfo = {
content: JSON.stringify(content),
contentId: this.data.contentInfo.id,
contentType: 2, //内容类型 1.文章 2.商品 3.页面
title: this.data.contentInfo.headline, //标题
type: 3// 1:门店,2:员工(暂时不做),3:会员,4:第三方外部渠道,5:智能营销
}
this.data.currentShareContent = this.data.contentInfo;
wxService.getTentacleContent(tentacleInfo).then(res => {
if (res && res.tentacleId) {
this.data.currentShareContent.tentacleId = res.tentacleId;
this.setData({
showCardModal: true,
cardTitle: this.data.contentInfo.headline,
cardUrl: this.data.contentInfo.url
});
}
})
},
// 获取内容详情
......@@ -110,6 +151,19 @@ wxService.page({
}).finally(() => {
})
}
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function (res) {
let id = Integer.digit(this.data.currentShareContent.id, 10, 64);
let tentacleId = Integer.digit(this.data.currentShareContent.tentacleId, 10, 64);
var path = 'pages/wantToBuyDetail/wantToBuyDetail?i=' + id + '&t=' + tentacleId;
console.log(path)
return {
path: path
}
}
})
\ No newline at end of file
{
"navigationBarTitleText": "种草详情",
"usingComponents": {
"buy-image-swiper": "/component/buyImageSwiper/buyImageSwiper"
"buy-image-swiper": "/component/buyImageSwiper/buyImageSwiper",
"card-modal": "/component/cardModal/cardModal"
}
}
\ No newline at end of file
......@@ -8,7 +8,7 @@
<image class="share-img" src="{{contentInfo.currentType ? '/assets/imgs/heart-primary.png' : '/assets/imgs/heart-default.png'}}"></image>
<text class="share-number">{{contentInfo.enjoySum || 0}}</text>
</view>
<view class="share-oprate">
<view class="share-oprate" bindtap="onTapShare">
<image class="share-img" src="/assets/imgs/share.png"></image>
<text class="share-number">{{contentInfo.transmitSum || 0}}</text>
</view>
......@@ -38,4 +38,6 @@
</view>
</view>
</view>
<card-modal show-card-modal="{{showCardModal}}" card-title="{{cardTitle}}" card-url="{{cardUrl}}"/>
......@@ -3,6 +3,8 @@ const app = getApp()
const wxService = require('../../../../utils/wxService')
const utils = require('../../../../utils/util')
const envInfo = require('../../../../config/index').envInfo
const { memberId } = wx.getStorageSync('_baseUserInfo')
import { Integer } from '../../../../utils/integerDigitalConvertion'
wxService.page({
/**
......@@ -19,8 +21,9 @@ wxService.page({
showCardModal: false,
cardTitle: '',
cardUrl: '',
contentList: [
]
contentList: [],
contentPermission: false,
currentShareContent: null
},
/**
......@@ -28,7 +31,6 @@ wxService.page({
*/
onLoad(options) {
},
/**
* 生命周期函数--监听页面显示
......@@ -36,11 +38,28 @@ wxService.page({
onShow() {
this.getBannerInfo()
this.getContentList()
this.getContentPermission()
this.data.currentShareContent = null;
},
// 发布内容权限
getContentPermission(){
wxService.post(`/merchant/contentMobileTerminal/getReleasePermissions`, {
userId: memberId
}).then(res => {
if (!res) return false
const { result, data } = res.data
if (result == 0) {
this.setData({
contentPermission: data
})
}
}).finally(() => {
})
},
// banner
getBannerInfo(){
const { memberId } = wx.getStorageSync('_baseUserInfo')
wxService.post(`/merchant/contentMobileTerminal/getBannerAndInviteSum`, {
userId: memberId
}).then(res => {
......@@ -130,11 +149,25 @@ wxService.page({
// 分享
_onTapShare(e) {
console.log(e)
this.setData({
showCardModal: true,
cardTitle: e.detail.title,
cardUrl: e.detail.url,
let tentacleInfo = {
content: JSON.stringify(e.detail),
contentId: e.detail.id,
contentType: 2, //内容类型 1.文章 2.商品 3.页面
title: e.detail.title, //标题
type: 3// 1:门店,2:员工(暂时不做),3:会员,4:第三方外部渠道,5:智能营销
}
this.data.currentShareContent = e.detail;
wxService.getTentacleContent(tentacleInfo).then(res => {
if (res && res.tentacleId) {
this.data.currentShareContent.tentacleId = res.tentacleId;
this.setData({
showCardModal: true,
cardTitle: e.detail.title,
cardUrl: e.detail.url
});
}
})
},
......@@ -159,5 +192,36 @@ wxService.page({
})
this.getContentList(this.data.currentTab)
}
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function (res) {
if (res.from != 'menu') {
let id = Integer.digit(this.data.currentShareContent.id, 10, 64);
let tentacleId = Integer.digit(this.data.currentShareContent.tentacleId, 10, 64);
var path = 'subPackage/page/pages/myReleaseDetail/myReleaseDetail?i=' + id + '&t=' + tentacleId;
console.log(path)
return {
path: path
}
}
let tentacleInfo = {
content: this.route,
title: this.route,
contentType: 3,
type: 3// 1:门店,2:员工(暂时不做),3:会员,4:第三方外部渠道,5:智能营销
};
wxService.getTentacleContent(tentacleInfo).then(res => {
if (res && res.tentacleId) {
this.data.currentShareContent.tentacleId = res.tentacleId;
let tentacleId = Integer.digit(res.tentacleId, 10, 64);
var path = `subPackage/page/pages/myRelease/myRelease?t=${tentacleId}`;
return {
path: path
}
}
});
}
})
\ No newline at end of file
......@@ -12,9 +12,11 @@
<view class="diy-banner">
<image src="{{bannerUrl}}" ></image>
</view>
<navigator open-type="navigate" url="/subPackage/page/pages/grassCommunity/grassCommunity" >
<view class="add">+</view>
</navigator>
<block wx:if="{{contentPermission}}">
<navigator open-type="navigate" url="/subPackage/page/pages/grassCommunity/grassCommunity">
<view class="add">+</view>
</navigator>
</block>
<water-flow-layout type="2" image-data="{{contentList}}" bind:updataLike="gotoLike" bind:_onTapShare="_onTapShare"/>
<card-modal show-card-modal="{{showCardModal}}" card-title="{{cardTitle}}" card-url="{{cardUrl}}"/>
......
......@@ -42,7 +42,7 @@
height: 82rpx;
background-color: rgba(203, 60, 60, 1);
border-radius: 50%;
line-height:90rpx;
line-height:82rpx;
text-align: center;
font-size: 60rpx;
color: #ffffff;
......
......@@ -12,7 +12,9 @@ wxService.page({
*/
data: {
id: '',
showDialig: false
showDialig: false,
showCardModal: false,
currentShareContent: null
},
/**
......@@ -34,6 +36,42 @@ wxService.page({
})
},
// 分享
onTapShare(){
this.setData({
showCardModal: true,
cardTitle: this.data.contentInfo.headline,
cardUrl: this.data.contentInfo.url,
})
let content = {
headline: this.data.contentInfo.headline,
id: this.data.contentInfo.id,
article: this.data.contentInfo.article,
url: this.data.contentInfo.url
}
let tentacleInfo = {
content: JSON.stringify(content),
contentId: this.data.contentInfo.id,
contentType: 2, //内容类型 1.文章 2.商品 3.页面
title: this.data.contentInfo.headline, //标题
type: 3// 1:门店,2:员工(暂时不做),3:会员,4:第三方外部渠道,5:智能营销
}
this.data.currentShareContent = this.data.contentInfo;
wxService.getTentacleContent(tentacleInfo).then(res => {
if (res && res.tentacleId) {
this.data.currentShareContent.tentacleId = res.tentacleId;
this.setData({
showCardModal: true,
cardTitle: e.detail.title,
cardUrl: e.detail.url
});
}
})
},
// 获取内容详情
getContentDetail() {
wxService.post(`/merchant/contentMobileTerminal/terminalContentParticulars`, {
......@@ -126,6 +164,7 @@ wxService.page({
if(this.data.id){
this.getContentDetail()
}
this.data.currentShareContent = null;
},
/**
......@@ -157,9 +196,15 @@ wxService.page({
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
* 用户点击右上角分享
*/
onShareAppMessage: function (res) {
let id = Integer.digit(this.data.currentShareContent.id, 10, 64);
let tentacleId = Integer.digit(this.data.currentShareContent.tentacleId, 10, 64);
var path = 'subPackage/page/pages/myReleaseDetail/myReleaseDetail?i=' + id + '&t=' + tentacleId;
console.log(path)
return {
path: path
}
}
})
\ No newline at end of file
{
"navigationBarTitleText": "种草详情",
"usingComponents": {
"x-dialog": "/component/dialog/dialog"
"x-dialog": "/component/dialog/dialog",
"card-modal": "/component/cardModal/cardModal"
}
}
\ No newline at end of file
......@@ -19,7 +19,7 @@
<image class="share-img" src="{{contentInfo.currentType ? '/assets/imgs/heart-primary.png' : '/assets/imgs/heart-default.png'}}"></image>
<text class="share-number">{{contentInfo.enjoySum || 0}}</text>
</view>
<view class="share-oprate">
<view class="share-oprate" bindtap="onTapShare">
<image class="share-img" src="/assets/imgs/share.png"></image>
<text class="share-number">{{contentInfo.transmitSum || 0}}</text>
</view>
......@@ -39,4 +39,5 @@
<view class="bottom-img">
<image class="img-top" mode="widthFix" src="/assets/imgs/7_1_0/go-top.png" bindtap="goTop"></image>
</view>
<x-dialog show="{{showDialig}}" bind:_closeDialog="closeDialog" />
\ No newline at end of file
<x-dialog show="{{showDialig}}" bind:_closeDialog="closeDialog" />
<card-modal show-card-modal="{{showCardModal}}" card-title="{{cardTitle}}" card-url="{{cardUrl}}"/>
\ No newline at end of file
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