Commit e31c4590 by 赵雅纹

保存海报

parent e325defe
......@@ -43,7 +43,6 @@ Component({
showCardModal:false
})
this.getMiniCode();
},
//获取二维码
......
......@@ -3,7 +3,7 @@
<view class="card-modal" hidden="{{!showCardModal}}">
<view class="card-modal-content">
<view class="modal-header">
<image class="brand-img"></image>
<image class="brand-img" src="http://t2.hddhhn.com/uploads/tu/201806/9999/91480c0c87.jpg"></image>
<view class="brand-title">{{cardTitle}}</view>
</view>
<view class="card-img-wrap">
......
......@@ -90,8 +90,6 @@ Component({
}
},
//下载二维码
getQrCode: function (productSrc, imgInfo = "") {
wx.showLoading({
......@@ -305,7 +303,7 @@ Component({
showpost: false
})
wxService.nextTick(() => {
this.triggerEvent('showMiniCard', true)
this.triggerEvent('showMiniCard', true)
})
}
},
......
......@@ -94,6 +94,14 @@ wxService.page({
})
},
_showMiniCard(e) {
console.log(e)
this.setData({
showCardModal: true
})
},
//全选
allSelect() {
this.setData({
......@@ -120,14 +128,11 @@ wxService.page({
//生成海报
onTapPoster(){
console.log('111')
this.setData({
showShareModal: true
})
this.getChooseExtendPro(2)
},
// 获取选择推广的商品
getChooseExtendPro(){
getChooseExtendPro(type){
if (!this.data.proData) {
wx.showToast({
title: '请先选择商品',
......@@ -174,12 +179,22 @@ wxService.page({
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/friendShareList/friendShareList?i=' + id + '&t=' + tentacleId;
this.setData({
showCardModal: true,
cardTitle: this.data.proData[0].productName,
cardUrl: this.data.proData[0].productImgUrl,
pagePath: path
});
if(type == 1){
this.setData({
showCardModal: true,
cardTitle: this.data.proData[0].productName,
cardUrl: this.data.proData[0].productImgUrl,
pagePath: path
});
}else{
this.setData({
cardTitle: this.data.proData[0].productName,
cardUrl: this.data.proData[0].productImgUrl,
pagePath: path
});
this.getMiniCode()
}
}
})
}
......@@ -187,9 +202,34 @@ wxService.page({
})
},
//获取二维码
getMiniCode() {
const urls = utils.getCurrentPageUrlWithArgs()
const page = urls && urls.split("?")[0]
let data = {
"autoColor": true,
"page": this.data.pagePath,
"scene": '123',
"width": 100
}
wxService.post(`/marketing/quickMark/getAppQrCodePicture`, data).then(res => {
const { result, data } = res.data
if (result == 0) {
this.setData({
codeImg: app.globalData.imageUrl + data
// codeImg: "https://hwimagecdn.ihotwind.cn/usr/201908/miniQrCode-f00c5051fef7479395efb193431762c4.jpg"
})
if (this.data.codeImg) {
this.selectComponent('#getPoster').getAvaterInfo()
}
}
})
},
//快速分享
onTapShare() {
this.getChooseExtendPro()
this.getChooseExtendPro(1)
},
// 获取推广商品列表
......
......@@ -80,13 +80,15 @@
</view>
</view>
<view class="share-wrap" wx:if="{{extendProList.length}}">
<!-- <view class="share-wrap" wx:if="{{extendProList.length}}"> -->
<view class="share-wrap">
<view class="share-button" bindtap="onTapShare">
<image mode="widthFix" />
<image mode="widthFix" src="/assets/imgs/7_1_0/quick-share-black.jpg" />
<text>快速分享</text>
</view>
<view class="share-button" bindtap="onTapPoster">
<image mode="widthFix" />
<image mode="widthFix" src="/assets/imgs/7_1_0/poster-black.jpg"/>
<text>生成海报</text>
</view>
</view>
......@@ -156,6 +158,7 @@
card-url="{{cardUrl}}"
page-path="{{pagePath}}"
/>
<share-poster id="getPoster" bindmyevent="myEventListener" avater="{{cardUrl}}" productDesc="{{cardTitle}}" userAvatar="http://t2.hddhhn.com/uploads/tu/201806/9999/91480c0c87.jpg" bind:showMiniCard="_showMiniCard" pagePath="{{pagePath}}" code-img="{{codeImg}}"></share-poster>
<!--goHome-->
<go-home/>
......@@ -162,8 +162,10 @@ swiper {
font-size: 26rpx;
}
.share-button image{
width: 18rpx;
height: 18rpx;
width: 28rpx;
height: 28rpx;
margin-right: 24rpx;
vertical-align: middle;
}
/* *************** 我的推广 ****************** */
......
......@@ -52,6 +52,16 @@ wxService.page({
})
},
// 立即开通plus
openPlus(){
wxService.post(`/merchant/modelPage/mainSetting/page?brandId=${app.globalData.brandId}&isMain=3&type=2`).then(res => {
const { result, data } = res.data
if (result == 0){
wxService.router(`/subPackage/page/pages/subPage/subPage?pageId=${data.page.pageId}`)
}
})
},
addCart: function (event) {
this.setData({
showSkuPopup: true,
......
......@@ -58,7 +58,7 @@
}}</text>
<!-- <text class="reduce-price">本次立减¥60</text> -->
</view>
<view class="open">
<view class="open" bindtap="openPlus">
<text class="open-text">立即开通</text>
<image class="big-arrow" src="/assets/imgs/big-arrow-right.png" />
</view>
......
......@@ -39,7 +39,7 @@
"list": []
},
"miniprogram": {
"current": 34,
"current": 13,
"list": [
{
"id": -1,
......@@ -123,7 +123,7 @@
"id": 13,
"name": "subPage",
"pathName": "subPackage/page/pages/subPage/subPage",
"query": "pageId=17",
"query": "pageId=39",
"scene": null
},
{
......
......@@ -54,7 +54,12 @@ wxService.page({
handlerDataOnPage = new utils.HandlerDataOnPage()
renderPage = require('../../../../utils/renderPage').getRenderPage()
handlerDataOnPage.init(this, 'pages')
this.initPage(this.data.pageId)
this.setData({
pageId: this.options.pageId
},()=>{
this.initPage(this.data.pageId)
})
},
/**
* 监听子组件事件
......@@ -74,6 +79,7 @@ wxService.page({
*/
onShow() {
console.log('user=============', this.options)
// 取会员卡号
const baseUserInfo = wx.getStorageSync('_baseUserInfo')
const cardMember = wx.getStorageSync('_cardMember')
......@@ -177,8 +183,8 @@ wxService.page({
wx.showLoading({
title: '加载中'
})
// wxService.post(`/merchant/modelPage/getDetailById?pageId=${pageId}&brandId=${app.globalData.brandId}`).then(res => {
wxService.post(`/merchant/modelPage/mainSetting/mall?brandId=${app.globalData.brandId}`).then(res => {
wxService.post(`/merchant/modelPage/getDetailById?pageId=${pageId}&brandId=${app.globalData.brandId}`).then(res => {
// wxService.post(`/merchant/modelPage/mainSetting/mall?brandId=${app.globalData.brandId}`).then(res => {
if (!res) return false
const { result, data } = res.data
if (result == 0) {
......
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