Commit f71194d8 by 谢中龙

种草海报

parent 65262373
...@@ -100,7 +100,8 @@ ...@@ -100,7 +100,8 @@
{ {
"root": "subPackageA/page", "root": "subPackageA/page",
"pages": [ "pages": [
"pages/deliveryCode/deliveryCode" "pages/deliveryCode/deliveryCode",
"pages/shareArticle/shareArticle"
] ]
} }
], ],
......
...@@ -57,6 +57,7 @@ Component({ ...@@ -57,6 +57,7 @@ Component({
* 组件的方法列表 * 组件的方法列表
*/ */
methods: { methods: {
//跳转到海报页面
gotoPoster(){ gotoPoster(){
// this.setData({ // this.setData({
// showCardModal:false // showCardModal:false
...@@ -78,7 +79,7 @@ Component({ ...@@ -78,7 +79,7 @@ Component({
"scene": this.data.scene, "scene": this.data.scene,
"width": 100 "width": 100
} }
console.log(this.data.pagePath)
wxService.post(`/marketing/quickMark/getAppQrCodePicture`, data).then(res => { wxService.post(`/marketing/quickMark/getAppQrCodePicture`, data).then(res => {
wx.hideLoading(); wx.hideLoading();
const { result, data } = res.data const { result, data } = res.data
...@@ -90,17 +91,32 @@ Component({ ...@@ -90,17 +91,32 @@ Component({
console.log(this.data.codeImg) console.log(this.data.codeImg)
if (this.data.codeImg) { if (this.data.codeImg) {
// this.selectComponent('#getPoster').getAvaterInfo() // this.selectComponent('#getPoster').getAvaterInfo()
let obj = { if (this.data.product){
productName: this.data.cardTitle, let obj = {
minSalePrice: this.data.product.minSalePrice, productName: this.data.cardTitle,
productImg: this.data.cardUrl, minSalePrice: this.data.product.minSalePrice,
qrcodeImg: this.data.codeImg, productImg: this.data.cardUrl,
type: this.data.product.type qrcodeImg: this.data.codeImg,
}; type: this.data.product.type
};
wx.setStorageSync('shareInfo', obj)
wx.navigateTo({
url: '/subPackage/page/pages/shareConfig/shareConfig',
});
}
else{
let obj = {
productName: this.data.cardTitle,
productImg: this.data.cardUrl,
qrcodeImg: this.data.codeImg,
}
wx.navigateTo({ wx.setStorageSync('shareArticle', obj)
url: '/subPackage/page/pages/shareConfig/shareConfig?shareInfo=' + JSON.stringify(obj), wx.navigateTo({
}); url: '/subPackageA/page/pages/shareArticle/shareArticle',
});
}
} }
} }
}) })
......
...@@ -77,7 +77,7 @@ ...@@ -77,7 +77,7 @@
data-id="{{id}}" data-id="{{id}}"
data-current-type="{{currentType}}" data-current-type="{{currentType}}"
> >
<image class="share-img" src="https://img3.bigaka.com/prd/3001/202003/20200309/3001843570f0-4ff8-4e72-8d69-9710269420bf.png" /> <image class="share-img" src="/assets/imgs/7_1_0/08_22/share.png" />
<text class="share-number">{{transmitSum || 0}}</text> <text class="share-number">{{transmitSum || 0}}</text>
</view> </view>
</view> </view>
......
...@@ -280,10 +280,10 @@ wxService.page({ ...@@ -280,10 +280,10 @@ wxService.page({
type : 'spread', type : 'spread',
}; };
wx.setStorageSync('shareInfo', obj);
wx.navigateTo({ wx.navigateTo({
url: '/subPackage/page/pages/shareConfig/shareConfig?shareInfo=' + JSON.stringify(obj), url: '/subPackage/page/pages/shareConfig/shareConfig',
}); });
// this.selectComponent('#getPoster').getAvaterInfo()
} }
}) })
} }
......
...@@ -75,7 +75,6 @@ wxService.page({ ...@@ -75,7 +75,6 @@ wxService.page({
}, },
//根据详情那边过来的点赞分享数据 更改列表中对应的数据 //根据详情那边过来的点赞分享数据 更改列表中对应的数据
updateFavoriteAndShareNumById(){ updateFavoriteAndShareNumById(){
console.log(wx.getStorageSync('articleInfo'))
let articleInfo = wx.getStorageSync('articleInfo'); let articleInfo = wx.getStorageSync('articleInfo');
if (articleInfo){ if (articleInfo){
//更新数据 //更新数据
...@@ -256,7 +255,8 @@ wxService.page({ ...@@ -256,7 +255,8 @@ wxService.page({
// 分享 // 分享
_onTapShare(e){ _onTapShare(e){
const { memberId, member } = wx.getStorageSync('_baseUserInfo') const { memberId, member } = wx.getStorageSync('_baseUserInfo');
e.detail.title = e.detail.title ? e.detail.title : e.detail.headline;
let tentacleInfo = { let tentacleInfo = {
content: JSON.stringify(e.detail), content: JSON.stringify(e.detail),
contentId: e.detail.id, contentId: e.detail.id,
...@@ -266,7 +266,6 @@ wxService.page({ ...@@ -266,7 +266,6 @@ wxService.page({
} }
this.data.currentShareContent = e.detail; this.data.currentShareContent = e.detail;
wxService.getTentacleContent(tentacleInfo).then(res =>{ wxService.getTentacleContent(tentacleInfo).then(res =>{
if (res && res.id){ if (res && res.id){
this.data.currentShareContent.tentacleId = res.id; this.data.currentShareContent.tentacleId = res.id;
......
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
open-type='getUserInfo' open-type='getUserInfo'
hover-class="btn-hover" hover-class="btn-hover"
> >
<view class="add">+</view> <view class="add"><image src='/assets/imgs/icon_plus.png' mode='aspectFit'></image></view>
</button> </button>
<view wx:if="{{currentHasUserInfo}}"> <view wx:if="{{currentHasUserInfo}}">
......
...@@ -62,7 +62,7 @@ scroll-view{ ...@@ -62,7 +62,7 @@ scroll-view{
color: #ffffff; color: #ffffff;
position: fixed; position: fixed;
right: 25rpx; right: 25rpx;
bottom: 320rpx; bottom: 230rpx;
/* bottom: 35rpx; */ /* bottom: 35rpx; */
z-index: 99; z-index: 99;
display: flex; display: flex;
......
...@@ -58,7 +58,7 @@ ...@@ -58,7 +58,7 @@
bindgetuserinfo="_getUserInfo" bindgetuserinfo="_getUserInfo"
open-type='getUserInfo' class="clear-btn"> open-type='getUserInfo' class="clear-btn">
<view class="share-oprate" bindtap="onTapShare"> <view class="share-oprate" bindtap="onTapShare">
<image class="share-img" src="https://img3.bigaka.com/prd/3001/202003/20200309/3001843570f0-4ff8-4e72-8d69-9710269420bf.png" /> <image class="share-img" src="/assets/imgs/7_1_0/08_22/share.png" />
<text class="share-number">{{contentInfo.transmitSum || 0}}</text> <text class="share-number">{{contentInfo.transmitSum || 0}}</text>
</view> </view>
</button> </button>
...@@ -73,7 +73,7 @@ ...@@ -73,7 +73,7 @@
</view> </view>
<view class="share-oprate" bindtap="onTapShare"> <view class="share-oprate" bindtap="onTapShare">
<image class="share-img" src="https://img3.bigaka.com/prd/3001/202003/20200309/3001843570f0-4ff8-4e72-8d69-9710269420bf.png" /> <image class="share-img" src="/assets/imgs/7_1_0/08_22/share.png" />
<text class="share-number">{{contentInfo.transmitSum || 0}}</text> <text class="share-number">{{contentInfo.transmitSum || 0}}</text>
</view> </view>
......
...@@ -43,7 +43,7 @@ ...@@ -43,7 +43,7 @@
"list": [] "list": []
}, },
"miniprogram": { "miniprogram": {
"current": 65, "current": 15,
"list": [ "list": [
{ {
"id": -1, "id": -1,
...@@ -149,7 +149,7 @@ ...@@ -149,7 +149,7 @@
"id": 16, "id": 16,
"name": "商品详情页", "name": "商品详情页",
"pathName": "pages/productDetail/productDetail", "pathName": "pages/productDetail/productDetail",
"query": "i=c72c(omX00&t=c8Yp1GGc00", "query": "id=634719195157905408",
"scene": null "scene": null
}, },
{ {
...@@ -574,6 +574,13 @@ ...@@ -574,6 +574,13 @@
"pathName": "subPackageA/page/pages/deliveryCode/deliveryCode", "pathName": "subPackageA/page/pages/deliveryCode/deliveryCode",
"query": "id=686957183723900928", "query": "id=686957183723900928",
"scene": null "scene": null
},
{
"id": -1,
"name": "种草海报",
"pathName": "subPackageA/page/pages/shareArticle/shareArticle",
"query": "",
"scene": null
} }
] ]
} }
......
...@@ -166,6 +166,9 @@ wxService.page({ ...@@ -166,6 +166,9 @@ wxService.page({
this.generatorBarCode(canvasId); this.generatorBarCode(canvasId);
}); });
//改成跳转到详情页
}, },
//关闭 //关闭
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
<view class='card-status'>已过期</view> <view class='card-status'>已过期</view>
</view> </view>
</view> </view>
<view class='card-top-info' bindtap='onTapShowMoreInfo' data-item="{{item}}" data-index="{{idx}}"> <view class='card-top-info' bindtap='onTapToInfoPage' data-item="{{item}}" data-index="{{idx}}">
<image class='bg-image {{item.isOpen ? "expand" : "unexpand"}}' <image class='bg-image {{item.isOpen ? "expand" : "unexpand"}}'
src='{{item.backGroundUrl}}' src='{{item.backGroundUrl}}'
mode='widthFix'></image> mode='widthFix'></image>
......
...@@ -72,6 +72,7 @@ wxService.page({ ...@@ -72,6 +72,7 @@ wxService.page({
no: obj.supValCardCode no: obj.supValCardCode
}, () => { }, () => {
this.generatorBarCode(); this.generatorBarCode();
this.startTimer();
}); });
} }
}); });
...@@ -89,9 +90,10 @@ wxService.page({ ...@@ -89,9 +90,10 @@ wxService.page({
no: this.data.no, no: this.data.no,
}, () => { }, () => {
this.generatorBarCode(); this.generatorBarCode();
wx.showToast({ // wx.showToast({
title: '刷新成功!', // title: '已刷新',
}); // icon : 'none'
// });
}) })
} }
else { else {
...@@ -104,6 +106,20 @@ wxService.page({ ...@@ -104,6 +106,20 @@ wxService.page({
}); });
}, },
//开始定时任务 每10s调用一下
startTimer(){
this.timer = setInterval(() => {
this.onTapRefreshNo();
},10000);
},
//
onUnload(){
if (this.timer){
clearInterval(this.timer);
}
},
//生成条形码 //生成条形码
generatorBarCode() { generatorBarCode() {
if (this.data.no) { if (this.data.no) {
......
...@@ -85,7 +85,7 @@ wxService.page({ ...@@ -85,7 +85,7 @@ wxService.page({
}, },
tempShareLogo: '', tempShareLogo: '',
username: '', username: '',
height: '1100rpx', height: '1000rpx',
canvasTempFileUrl: '', canvasTempFileUrl: '',
btnIsDisabled: true, btnIsDisabled: true,
isInput: false, isInput: false,
...@@ -97,7 +97,7 @@ wxService.page({ ...@@ -97,7 +97,7 @@ wxService.page({
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function (options) { onLoad: function (options) {
let shareInfo = options.shareInfo ? JSON.parse(options.shareInfo) : null; let shareInfo = wx.getStorageSync('shareInfo') ? wx.getStorageSync('shareInfo') : null;
this.getCurrentUserName(); this.getCurrentUserName();
wx.hideShareMenu(); wx.hideShareMenu();
if (shareInfo) { if (shareInfo) {
...@@ -112,6 +112,11 @@ wxService.page({ ...@@ -112,6 +112,11 @@ wxService.page({
} }
}, },
//頁面销毁
onUnload(){
wx.removeStorageSync('shareInfo')
},
/** /**
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
......
{
"navigationBarTitleText": "种草海报",
"usingComponents": {}
}
\ No newline at end of file
<!--share/share.wxml-->
<view hidden="{{isInput}}" class="canvas-container">
<canvas class='canvas' canvas-id="myCanvas" style="height:{{height}};"></canvas>
</view>
<view class="statistic-img" hidden="{{!isInput}}">
<image src="{{canvasTempFileUrl}}" mode="widthFix"></image>
</view>
<view class="btns-containers">
<view class="edit-btn" bindtap="onTapEditShareContent">编辑文案(限50字)</view>
<view class="save-btn {{btnIsDisabled ? 'disabled' : ''}}" bindtap="onTapSaveImg">保存海报至相册</view>
</view>
<!-- 输入文案 -->
<view class="input-text" hidden="{{!isInput}}">
<view class="input-body">
<textarea placeholder="请设置您的个性化分享海报文案(最多50个字)..."
value="{{inputText}}"
maxlength="50" bindinput="onShareTextInput"></textarea>
<view class="bot-btns">
<view class="mo-btns" bindtap="onTapCancal">取消</view>
<view class="mo-btns reset" bindtap="onTapReset">重置</view>
<view class="mo-btns sure" bindtap="onTapSure">确认</view>
</view>
</view>
</view>
\ No newline at end of file
/* subPackage/page/pages/shareConfig/shareConfig.wxss */
/* share/share.wxss */
page{
background: #ffffff;
box-sizing: border-box;
-webkit-box-sizing: border-box;
}
view{
box-sizing: border-box;
-webkit-box-sizing: border-box;
}
.canvas-container{
display: flex;
justify-content: center;
padding-top: 20rpx;
}
.canvas-container canvas{
box-shadow: 0 0 8rpx 3rpx rgba(0, 0, 0, 0.1);
}
.btns-containers{
/* width: 100%; */
height: auto;
display: flex;
align-items: center;
justify-content: space-between;
/* padding: 30rpx 80rpx; */
width: 562rpx;
margin: auto;
margin-top: 30rpx;
padding-bottom: 30rpx;
}
.btns-containers .save-btn{
background: #cb3c3c;
color: #ffffff;
flex: 1;
height: 80rpx;
border-radius: 35rpx;
display: flex;
align-items: center;
justify-content: center;
font-size: 24rpx;
border: solid 2rpx #cb3c3c;
}
.btns-containers .save-btn.disabled{
opacity:0.6;
}
.btns-containers .edit-btn{
background: #ffffff;
color: #cb3c3c;
flex: 0;
min-width: 40%;
max-width: 40%;
height: 80rpx;
border-radius: 35rpx;
display: flex;
align-items: center;
justify-content: center;
font-size: 24rpx;
border: solid 2rpx #cb3c3c;
margin-right: 30rpx;
}
.btns-containers .edit-btn:active{
opacity: 0.7;
}
.statistic-img{
width: 100%;
height: auto;
display: flex;
justify-content: center;
}
.statistic-img image{
display: block;
width: 562rpx;
height: 1000rpx;
box-shadow: 0 0 8rpx 6rpx rgba(0, 0, 0, 0.1);
}
.input-text{
position: fixed;
width: 100%;
height: 100%;
z-index: 22;
background: rgba(0,0,0,0.5);
left: 0;
top: 0;
}
.input-body{
position: absolute;
width: 80vw;
height: 28vh;
left: 50%;
margin-left: -40vw;
top: 50%;
margin-top: -20vh;
background: #ffffff;
border-radius: 8rpx;
padding: 30rpx;
display: flex;
flex-direction: column;
padding-bottom: 0;
}
.input-body textarea{
width: 100%;
flex: 1;
color: #333333;
}
.input-body .bot-btns{
flex: 0;
width: 100%;
height: auto;
/* padding-top: 30rpx; */
min-height: 90rpx;
max-height: 90rpx;
border-top: solid 1rpx #eeeeee;
display: flex;
align-items: center;
justify-content: center;
}
.input-body .bot-btns .mo-btns{
flex: 0;
min-width: 33.3%;
max-width: 33.3%;
font-size: 28rpx;
display: flex;
align-items: center;
justify-content: center;
}
.input-body .bot-btns .mo-btns.reset{
border-left: solid 1rpx #eeeeee;
color: #999999;
}
.input-body .bot-btns .mo-btns.sure{
border-left: solid 1rpx #eeeeee;
color: #cb3c3c;
}
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