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