Commit 4229d7a6 by 赵雅纹

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

Feature zyw sc

See merge request !95
parents 223d18fd 41ecd597
// component/cardModal/cardModal.js
const app = getApp();
const wxService = require('../../utils/wxService')
const utils = require('../../utils/util')
......@@ -30,6 +31,7 @@ Component({
* 组件的初始数据
*/
data: {
codeImg:''
},
/**
......@@ -40,8 +42,35 @@ Component({
this.setData({
showCardModal:false
})
this.getMiniCode();
},
//获取二维码
getMiniCode() {
const urls = utils.getCurrentPageUrlWithArgs()
const page = urls && urls.split("?")[0]
let data = {
"autoColor": true,
"page": this.data.pagePath,
"scene": '123',
"width": 100
}
console.log('---', this.data.pagePath)
wxService.post(`/merchant/contentMobileTerminal/getAppletQrCode`, data).then(res => {
const { result, data } = res.data
if (result == 0) {
this.setData({
codeImg: app.globalData.imageUrl + '/' + data.codeUrl
// codeImg: "https://hwimagecdn.ihotwind.cn/usr/201908/miniQrCode-f00c5051fef7479395efb193431762c4.jpg"
})
if (this.data.codeImg) {
this.selectComponent('#getPoster').getAvaterInfo()
}
}
})
},
_showMiniCard(e){
......
......@@ -18,6 +18,6 @@
<view class="quick-share" bindtap="gotoPoster" hidden='{{!showCardModal}}'>
生成朋友圈海报
</view>
<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}}"></share-poster>
<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>
......@@ -14,13 +14,18 @@ Component({
* 组件的初始数据
*/
data: {
currentTab:0
},
/**
* 组件的方法列表
*/
methods: {
switchNav(e){
console.log(e)
this.setData({
currentTab: e.currentTarget.dataset.current
})
}
}
})
<!--component/plus/plus.wxml-->
<view class="plus-bottom fixed-bottom0 clearfix::after">
<view class="bottom-top">
<scroll-view scroll-x="true" class="scroll-view_H">
<view class="uploadWrap" scroll-x="true">
<block wx:for='{{skuList}}' wx:for-item="sub" wx:key="s">
<view class="upload_Item item-img" style="background-image:url({{sub.mainImgUrl}})">
<view class="item-mouth">每月仅¥ 25</view>
<view class="item-year">全年卡· 366 天</view>
<view class="item-price">¥ 300</view>
<view class="plus-wrap" wx:if="{{skuList}}">
<scroll-view scroll-x class="scroll-view_H" scroll-with-animation="{{true}}">
<block
wx:for="{{skuList}}"
wx:for-index="idx"
wx:for-item="navItem"
wx:key="idx"
>
<view
class="scroll-view-item {{currentTab == idx ?'poster-active':''}}"
data-current="{{idx}}"
data-startTimeStr="{{navItem.startTimeStr}}"
data-endTimeStr="{{navItem.endTimeStr}}"
data-btnText="{{navItem.buttonText}}"
data-id="{{navItem.id}}"
bindtap="switchNav"
>
<view class="plus-choose">
<text>每月仅¥25</text>
</view>
</block>
<view class="card-kinds">
全年卡· 366 天
</view>
</scroll-view>
<view class="plus-price">
<text class="rmb">¥</text>
<text class="amount">100</text>
</view>
<view class="select-plus" wx:if="{{idx == currentTab}}">
<view class="circle-radio theme-color">
<image class="tick-success" src="/assets/imgs/7_1_0/tick-success.png" mode="widthFix"></image>
</view>
<view class="bottom-bottom">
<view class="bottom-pay">立即支付 ¥158 </view>
</view>
</view>
</block>
</scroll-view>
<view class="pay">
<button class="btn btn-primary">
<text>立即支付</text>
<text>¥158</text>
</button>
</view>
</view>
\ No newline at end of file
/* component/plus/plus.wxss */
@import '../../base/base.wxss';
.scroll-view_H{
@import "/app.wxss";
.plus-wrap {
width: 100%;
}
.plus-bottom {
height: 314rpx;
/* background-color: rgba(192, 154, 116, .02); */
background-color: pink;
}
.plus-bottom .bottom-top {
display: flex;
white-space: nowrap;
box-sizing: border-box;
height: 226rpx;
/* display: flex;
align-items: center; */
position: fixed;
bottom: 88rpx;
padding: 36rpx 0 36rpx 30rpx;
background-color: #C09A74;
}
.pro-list {
/* height: 155rpx; */
background-color: gray;
margin-left: 20rpx;
/* margin-top: 40rpx; */
box-sizing: border-box;
white-space: nowrap;
/* margin: 40rpx 30rpx 0 30rpx; */
.scroll-view_H {
width: 100%;
}
.item-mouth {
height: 25rpx;
color: rgba(255, 255, 255, 1);
font-size: 18rpx;
.scroll-view-item {
display: inline-block;
width: 209rpx;
height: 155rpx;
background-color: #d8d8d8;
margin-right: 12rpx;
border-radius: 12rpx;
background-position: 100% 100%;
background-size: 100%;
background-repeat: no-repeat;
position: relative;
}
.item-year {
height: 33rpx;
color: rgba(247, 181, 0, 1);
font-size: 24rpx;
.poster-tips{
position: fixed;
bottom: 220rpx;
left: 33rpx;
}
.item-price {
height: 50rpx;
color: rgba(245, 248, 250, 1);
font-size: 36rpx;
.poster-tips image{
width: 362rpx;
}
.plus-bottom .bottom-bottom {
width: 100%;
.pay{
height: 88rpx;
padding-top: 18rpx;
background-color: rgba(255, 255, 255, 1);
line-height: 88rpx;
position: fixed;
bottom: 0;
right: 30rpx;
display: flex;
align-items: center;
}
.bottom-pay {
text-align: center;
.pay button{
width: 280rpx;
line-height: 52rpx;
height: 52rpx;
border-radius: 26px;
background-color: rgba(203, 60, 60, 1);
left: 480px;
color: rgba(255, 255, 255, 1);
line-height: 52rpx;
border-radius: 26rpx;
font-size: 26rpx;
float: right;
margin-right: 30rpx;
}
.item-img {
background-repeat: no-repeat;
background-size: 100% 100%;
.card-kinds{
font-size: 24rpx;
color: #F7B500;
margin: 8rpx 0 0 34rpx;
}
.uploadWrap {
/* height: 155rpx; */
height: 100%;
width: 100%;
display: flex;
align-items: center;
display: -webkit-box;
flex-direction: column;
/* margin: 40rpx 30rpx 0 30rpx; */
.scroll-view-item .plus-price .amount{
color: #F5F8FA;
font-size: 36rpx;
}
.upload_Item {
width: 209rpx;
height: 155rpx;
flex: 1;
margin: 0rpx 15rpx 15rpx 0;
box-sizing: border-box;
background-color: aqua;
.scroll-view-item .plus-price .rmb{
font-size: 24rpx;
color: #ffffff;
}
.upload_Item:last-child {
margin-right: 20rpx;
.scroll-view-item .plus-price{
margin:10rpx 0 0 100rpx;
}
.upload_Item_img {
width: 209rpx;
height: 155rpx;
.plus-choose{
font-size: 18rpx;
color: #ffffff;
margin: 24rpx 0 0 34rpx;
}
.select-plus{
position: absolute;
top: 18rpx;
right: 20rpx;
}
.tick-success{
width: 18rpx;
}
.circle-radio{
width: 32rpx;
height: 32rpx;
border-radius: 50%;
/* border: 1rpx solid rgba(0, 0, 0, 0.2); */
line-height: 26rpx;
text-align: center;
}
......@@ -19,7 +19,7 @@ Component({
type: String,
value: ''
},
pagePath:{
codeImg:{
type: String,
value: ''
}
......@@ -35,7 +35,6 @@ Component({
},
attached() {
},
/**
......@@ -91,59 +90,7 @@ Component({
}
},
//获取二维码
getMiniCode() {
const urls = utils.getCurrentPageUrlWithArgs()
const page = urls && urls.split("?")[0]
let data = {
"autoColor": true,
"page": this.data.pagePath,
"scene": '123',
"width": 100
}
console.log('---', this.data.pagePath)
wxService.post(`/merchant/contentMobileTerminal/getAppletQrCode`, data).then(res => {
const { result, data } = res.data
if(result == 0){
this.setData({
codeImg: data.codeUrl
// codeImg: "https://hwimagecdn.ihotwind.cn/usr/201908/miniQrCode-f00c5051fef7479395efb193431762c4.jpg"
})
}
// if (result == 0) {
// const fsm = wx.getFileSystemManager();
// const FILE_BASE_NAME = 'tmp_base64src';
// const base64src = function (data) {
// return new Promise((resolve, reject) => {
// const filePath = `${wx.env.USER_DATA_PATH}/${FILE_BASE_NAME}.png`;
// const buffer = wx.base64ToArrayBuffer(data);
// fsm.writeFile({
// filePath,
// data: buffer,
// encoding: 'binary',
// success() {
// resolve(filePath);
// },
// fail() {
// reject(new Error('ERROR_BASE64SRC_WRITE'));
// },
// });
// });
// };
// base64src(data).then(res => {
// console.log(res)
// this.setData({
// codeImg: res
// })
// })
// }
})
},
//下载二维码
getQrCode: function (productSrc, imgInfo = "") {
......@@ -183,8 +130,7 @@ Component({
//canvas绘制分享海报
sharePosteCanvas: function (avaterSrc, codeSrc, imgInfo) {
// 获取小程序二维码 url
this.getMiniCode()
wx.showLoading({
title: '生成中...',
mask: true,
......
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