Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
7
7-Eleven
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
高淑倩
7-Eleven
Commits
4229d7a6
Commit
4229d7a6
authored
Aug 29, 2019
by
赵雅纹
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature-zyw-sc' into 'dev_7.1.0'
Feature zyw sc See merge request
!95
parents
223d18fd
41ecd597
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
161 additions
and
151 deletions
+161
-151
cardModal.js
src/component/cardModal/cardModal.js
+30
-1
cardModal.wxml
src/component/cardModal/cardModal.wxml
+1
-1
plus.js
src/component/plus/plus.js
+7
-2
plus.wxml
src/component/plus/plus.wxml
+44
-18
plus.wxss
src/component/plus/plus.wxss
+76
-72
sharePoster.js
src/component/sharePoster/sharePoster.js
+3
-57
No files found.
src/component/cardModal/cardModal.js
View file @
4229d7a6
// 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
();
this
.
selectComponent
(
'#getPoster'
).
getAvaterInfo
()
},
//获取二维码
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
){
...
...
src/component/cardModal/cardModal.wxml
View file @
4229d7a6
...
...
@@ -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>
src/component/plus/plus.js
View file @
4229d7a6
...
...
@@ -14,13 +14,18 @@ Component({
* 组件的初始数据
*/
data
:
{
currentTab
:
0
},
/**
* 组件的方法列表
*/
methods
:
{
switchNav
(
e
){
console
.
log
(
e
)
this
.
setData
({
currentTab
:
e
.
currentTarget
.
dataset
.
current
})
}
}
})
src/component/plus/plus.wxml
View file @
4229d7a6
<!--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>
</block>
</view>
</scroll-view>
</view>
<view class="bottom-bottom">
<view class="bottom-pay">立即支付 ¥158 </view>
</view>
</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>
<view class="card-kinds">
全年卡· 366 天
</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>
</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
src/component/plus/plus.wxss
View file @
4229d7a6
/* component/plus/plus.wxss */
@import '../../base/base.wxss';
.scroll-view_H{
@import "/app.wxss";
.plus-wrap {
width: 100%;
display: flex;
white-space: nowrap;
box-sizing: border-box;
height: 226rpx;
position: fixed;
bottom: 88rpx;
padding: 36rpx 0 36rpx 30rpx;
background-color: #C09A74;
}
.plus-bottom {
height: 314rpx;
/* background-color: rgba(192, 154, 116, .02); */
background-color: pink;
.scroll-view_H {
width: 100%;
}
.plus-bottom .bottom-top {
height: 226rpx;
/* display: flex;
align-items: center; */
.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;
}
.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; */
.poster-tips{
position: fixed;
bottom: 220rpx;
left: 33rpx;
}
.item-mouth {
height: 25rpx;
color: rgba(255, 255, 255, 1);
font-size: 18rpx;
.poster-tips image{
width: 362rpx;
}
.item-year {
height: 33rpx;
color: rgba(247, 181, 0, 1);
font-size: 24rpx;
.pay{
height: 88rpx;
line-height: 88rpx;
position: fixed;
bottom: 0;
right: 30rpx;
display: flex;
align-items: center;
}
.item-price {
height: 50rpx;
color: rgba(245, 248, 250, 1);
font-size: 36rpx;
.pay button{
width: 280rpx;
height: 52rpx;
line-height: 52rpx;
border-radius: 26rpx;
font-size: 26rpx;
}
.plus-bottom .bottom-bottom {
width: 100%;
height: 88rpx;
padding-top: 18rpx;
background-color: rgba(255, 255, 255, 1);
.card-kinds{
font-size: 24rpx;
color: #F7B500;
margin: 8rpx 0 0 34rpx;
}
.bottom-pay {
text-align: center;
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);
font-size: 26rpx;
float: right;
margin-right: 30rpx;
.scroll-view-item .plus-price .amount{
color: #F5F8FA;
font-size: 36rpx;
}
.
item-img
{
background-repeat: no-repeat
;
background-size: 100% 100%
;
.
scroll-view-item .plus-price .rmb
{
font-size: 24rpx
;
color: #ffffff
;
}
.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{
margin:10rpx 0 0 100rpx;
}
.upload_Item {
width: 209rpx;
height: 155rpx;
flex: 1;
margin: 0rpx 15rpx 15rpx 0;
box-sizing: border-box;
background-color: aqua;
.plus-choose{
font-size: 18rpx;
color: #ffffff;
margin: 24rpx 0 0 34rpx;
}
.upload_Item:last-child {
margin-right: 20rpx;
.select-plus{
position: absolute;
top: 18rpx;
right: 20rpx;
}
.upload_Item_img {
width: 209rpx;
height: 155rpx;
.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;
}
src/component/sharePoster/sharePoster.js
View file @
4229d7a6
...
...
@@ -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
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment