Commit fd813fc2 by 赵雅纹

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

Feature zyw sc

See merge request !114
parents d2f7efdc 48276b9f
......@@ -15,10 +15,10 @@ const testCtx = 'https://crm-b.bigaka.net/api' // 发测试时解开此注释
const preCtx = 'https://crm-b.bigaka.com/api' // 发预生产时解开此注释
const prodCtx = 'https://crm-b.bigaka.com/api' // 发生产时解开此注释
const devImgCtx = 'http://testimg3.bigaka.com' // 开发环境图片地址
const testImgCtx = 'http://testimg3.bigaka.com' // 测试环境图片地址
const preImgCtx = 'http://testimg3.bigaka.com' // 预生产环境图片地址
const prodImgCtx = 'http://testimg3.bigaka.com' // 预生产环境图片地址
const devImgCtx = 'https://img3.bigaka.com/test' // 开发环境图片地址
const testImgCtx = 'https://img3.bigaka.com/test' // 测试环境图片地址
const preImgCtx = 'https://img3.bigaka.com/test' // 预生产环境图片地址
const prodImgCtx = 'https://img3.bigaka.com/prd' // 预生产环境图片地址
// const prodImgCtx = 'https://img3.bigaka.com' // 生产环境图片地址
const config = {
......
export default class InviteFriends {
palette(posterImg,qrcodeImg) {
palette(posterImg, qrcodeImg, userName, avatarUrl) {
return ({
width: '410rpx',
height: '705rpx',
background: '#eee',
background: '#fff',
views: [
{
type: 'image',
url: posterImg,
css: {
width: '410rpx',
height: '705rpx'
height: '540rpx'
}
},
{
......@@ -23,6 +23,28 @@ export default class InviteFriends {
bottom: '43rpx',
}
},
{
type: 'image',
url: avatarUrl,
css: {
width: '50rpx',
height: '50rpx',
left: '23rpx',
bottom: '43rpx',
borderRadius: '25rpx'
}
},
{
type: 'text',
text: userName + '邀请您一起成为会员,共享优惠,赶快扫码加入吧~。',
css: {
width: '180rpx',
left: '82rpx',
bottom: '43rpx',
fontSize: '18rpx',
color: '#333333'
},
},
],
});
}
......
......@@ -197,7 +197,7 @@ wxService.page({
success++;//图片上传成功,图片上传成功的变量+1
this.data.params.sspList.push({
cover: 0,
url: img.url
url: envInfo.imgCtx + img.url
});
that.setData({
'params.sspList': this.data.params.sspList
......@@ -265,6 +265,12 @@ wxService.page({
'params.headline': e.detail.value.headline,
'params.article': e.detail.value.article
})
this.data.params.sspList.forEach((item,index) => {
if(index == 0){
item.cover = 1;
}
});
wxService.post(`/merchant/contentMobileTerminal/contentSave`, this.data.params).then(res => {
const { result, data } = res.data
if (result == 0) {
......
......@@ -3,6 +3,9 @@ var app = getApp()
const wxService = require('../../../../utils/wxService')
const utils = require('../../../../utils/util')
import { Integer } from '../../../../utils/integerDigitalConvertion'
const { member } = wx.getStorageSync('_baseUserInfo')
const { avatarUrl } = wx.getStorageSync('_userInfo')
// src/pages/xml2can/xml2can.js
......@@ -23,15 +26,19 @@ wxService.page({
posterImgData:[],
currentPosterImg: '',
codeImg:'', //二维码
template :{},
template :{}
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
this.getShareImg()
},
onLoad: function(){
this.getMiniCode()
this.getShareImg()
wx.hideShareMenu()
},
......@@ -60,7 +67,7 @@ wxService.page({
//生成海报
generatePoster(){
this.setData({
template: new Card().palette(this.data.currentPosterImg, this.data.codeImg),
template: new Card().palette(this.data.currentPosterImg, this.data.codeImg, member.memberWeixin.nickname, avatarUrl),
});
},
......@@ -98,7 +105,7 @@ wxService.page({
codeImg: "https://hwimagecdn.ihotwind.cn/usr/201908/miniQrCode-f00c5051fef7479395efb193431762c4.jpg"
},()=>{
this.setData({
template: new Card().palette(this.data.posterImgData[0], this.data.codeImg),
template: new Card().palette(this.data.posterImgData[0], this.data.codeImg, member.memberWeixin.nickname, avatarUrl),
});
})
}
......@@ -107,6 +114,7 @@ wxService.page({
// 保存海报
savePoster(){
console.log('111')
let tentacleInfo = {
content: "我的邀请页面",
contentType: app.globalData.contants.SHARE_TYPE.INVITE_FRIENDS, //内容类型
......@@ -115,16 +123,31 @@ wxService.page({
}
wxService.getTentacleContent(tentacleInfo).then(res => {
console.log(res)
if (res && res.tentacleId) {
wx.saveImageToPhotosAlbum({
filePath: this.imagePath,
success(res) {
console.log('3333')
setTimeout(()=>{
wx.showToast({
title: '保存成功,请前往相册查看~',
icon: 'none'
},2000)
})
},
fail(err){
console.log(err)
let txt = '保存失敗';
if (err.errMsg == 'saveImageToPhotosAlbum:fail auth deny'){
txt = '获取相册授权失败'
}
setTimeout(() => {
wx.showToast({
title: txt,
icon: 'none'
}, 2000)
})
}
});
}
......
......@@ -9,8 +9,17 @@
<swiper-item class="swiper-item">
<image class="slide-image {{swiperCurrent == index ? 'active' : ''}}" src="{{item}}"
id="{{index}}"></image>
<view class=""></view>
<image wx:if="{{swiperCurrent == index}}" class="code-img" src="{{codeImg}}"></image>
<view class="poster-bottom" wx:if="{{swiperCurrent == index}}">
<view class="avatar">
<open-data type="userAvatarUrl" />
</view>
<view class="poster-title">
<open-data type="userNickName"></open-data>
<text>邀请您一起成为会员,共享优惠,赶快扫码加入吧~。</text>
</view>
<image class="code-img" src="{{codeImg}}"></image>
</view>
</swiper-item>
</block>
</swiper>
......@@ -53,7 +62,7 @@
<!-- 测试 -->
<view class="test" >
<painter customStyle='margin-left:40rpx' palette="{{template}}" bind:imgOK="onImgOK" />
<painter customStyle='margin-left:40rpx;z-index:-99999' palette="{{template}}" bind:imgOK="onImgOK" />
</view>
<!--goHome-->
<go-home />
\ No newline at end of file
/* subPackage/page/pages/share/share.wxss */
page{
width: 100%;
background-color: #f9f9f9;
overflow: hidden;
height: 100vh;
/* padding-top: 25rpx; */
}
.banner-swiper {
width: 410rpx;
height: 705rpx;
overflow: hidden;
}
.page-share{
background: #f9f9f9;
position: relative;
z-index: 9999;
}
swiper {
display: block;
height: 705rpx;
position: relative;
margin-top: 25rpx;
padding-top: 25rpx;
}
swiper-item{
width: 410rpx;
position: relative;
}
.slide-image {
......@@ -24,21 +35,17 @@ swiper-item{
margin: 37rpx auto 0;
height: 619rpx;
box-shadow: 0px 4rpx 17rpx 0px rgba(0, 0, 0, 0.12);
}
.swiper-item{
position: relative;
}
.code-img{
position: absolute;
width: 100rpx;
height: 100rpx;
bottom: 43rpx;
right: 50rpx;
right: 24rpx;
}
.active{
margin-top:0rpx;
height:705rpx !important;
height:540rpx !important;
}
.save-btn{
width: 340rpx;
......@@ -108,13 +115,42 @@ swiper-item{
line-height: 26rpx;
text-align: center;
}
.poster-bottom{
width: 410rpx;
margin: 0 auto ;
height: 165rpx;
position: relative;
background-color: #ffffff;
box-shadow: 0px 4rpx 17rpx 0px rgba(0, 0, 0, 0.12);
}
.avatar{
width: 50rpx;
height: 50rpx;
border-radius: 50%;
overflow: hidden;
display: inline-block;
position: absolute;
top: 72rpx;
left: 23rpx;
}
.poster-title{
width: 180rpx;
font-size: 18rpx;
color: #333333;
display: inline-block;
position: absolute;
top: 72rpx;
left: 82rpx;
}
/* 测试 */
.test{
position: absolute;
top: 0;
transform: translateX(100%);
bottom: 0;
transform: translateY(100%);
width: 100vw;
height: 100vh;
background: #ffffff;
/* background: #ffffff; */
z-index: -9999;
}
\ 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