Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
dev
/
home-with-kids-mp
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
55251512
authored
2020-01-15 19:12:01 +0800
by
simon
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
默认提交
1 parent
181c0ddf
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
117 additions
and
50 deletions
src/http/api.js
src/pages/blessing/blessing.js
src/pages/blessing/blessing.scss
src/pages/blessing/blessing.wxml
src/pages/index/index.scss
src/pages/index/index.wxml
src/http/api.js
View file @
5525151
...
...
@@ -28,7 +28,7 @@ module.exports = {
*/
areaQuery
:
'https://api.k.wxpai.cn/bizproxy/kdapi/area'
,
// post 区域查询
wxacodeGet
:
"/
mzcfsapi/qrcode/createV2
"
,
// 通用上传 ?path=/pages/index/index?pa=1
wxacodeGet
:
"/
wx/create/wxacode
"
,
// 通用上传 ?path=/pages/index/index?pa=1
uploadFile
:
'/kdapi/file/upload'
,
//上传图片通用接口
}
...
...
src/pages/blessing/blessing.js
View file @
5525151
...
...
@@ -58,6 +58,13 @@ Page({
options
}
=
this
.
data
;
let
title
=
"亲爱的家人们新年快乐"
;
if
(
detailData
.
type
==
0
)
{
// 单人 给您拜年啦!来看看是怎样特别的祝福
title
=
`
${
ownerMember
.
memberName
}
给您拜年啦!来看看是怎样特别的祝福`
;
}
else
{
// 团队
title
=
`
${
ownerMember
.
memberName
}
携
${
ownerMember
.
memberName
}${
detailData
.
count
}
人给您拜年啦!看看这xx都是谁`
;
}
let
shareType
=
""
// let imageUrl = detailData && detailData.thumbnail || "";
if
(
res
.
from
===
'button'
)
{
...
...
@@ -143,7 +150,7 @@ Page({
}
});
/**
/**
q
* 显示加入房间条件
* 1.已定制
* 2.类型为组队类型
...
...
@@ -331,15 +338,18 @@ Page({
detailData
}
=
this
.
data
;
let
memberCode
=
app
.
store
.
getItem
(
"memberCode"
);
let
wxCodePath
=
`pages/blessing/blessing?c=
${
detailData
.
blessCode
}
&m=
${
memberCode
}
`
;
//
let wxCodePath = `pages/blessing/blessing?c=${detailData.blessCode}&m=${memberCode}`;
return
new
Promise
((
resolve
,
reject
)
=>
{
// 先获取小程序码
app
.
get
({
mode
:
"common"
,
app
.
post
({
url
:
app
.
api
.
wxacodeGet
,
data
:
{
path
:
encodeURIComponent
(
wxCodePath
)
page
:
"pages/blessing/blessing"
,
content
:
JSON
.
stringify
({
blessCode
:
detailData
.
blessCode
||
""
,
ownerMemberCode
:
memberCode
||
""
,
})
}
}).
then
((
result
)
=>
{
this
.
setData
({
...
...
@@ -441,6 +451,7 @@ Page({
{
width
:
100
,
height
:
100
,
borderRadius
:
100
,
x
:
586
,
y
:
1198
,
url
:
wxCodeUrl
,
...
...
@@ -486,15 +497,6 @@ Page({
let
wid
=
160
;
let
startY
=
800
;
memberDrawList
.
forEach
((
element
,
idx
)
=>
{
// blocks.push({
// x: endX - (idx * wid) - ((wid - 92)),
// y: startY,
// width: 92,
// height: 92,
// borderRadius: 92,
// zIndex: 90,
// borderColor: "#fee085",
// })
images
.
push
({
x
:
endX
-
(
idx
*
wid
)
-
((
wid
-
92
)
/
2
)
-
4
,
y
:
startY
+
2
,
...
...
@@ -516,6 +518,7 @@ Page({
})
});
if
(
detailData
.
count
>
0
)
{
texts
.
push
({
x
:
686
,
y
:
startY
+
200
,
...
...
@@ -523,9 +526,10 @@ Page({
color
:
"#fee085"
,
textAlign
:
"right"
,
zIndex
:
11
,
text
:
`长按查看全部
${
detailData
.
count
}
人 >>
`
,
text
:
`长按查看祝福
`
,
})
}
}
let
posterData
=
{
width
:
750
,
...
...
@@ -548,7 +552,6 @@ Page({
files
:
[]
})
});
},
// 房主名字
...
...
@@ -727,11 +730,16 @@ Page({
*/
queryBlessDetail
()
{
return
new
Promise
((
resolve
,
reject
)
=>
{
let
{
options
}
=
this
.
data
;
const
scene
=
options
.
scene
||
""
;
app
.
post
({
url
:
app
.
api
.
blessDetail
,
data
:
{
blessCode
:
this
.
data
.
options
.
c
,
blessCode
:
this
.
data
.
options
.
c
||
""
,
ownerMemberCode
:
this
.
data
.
options
.
m
?
this
.
data
.
options
.
m
:
app
.
store
.
getItem
(
"memberCode"
)
?
app
.
store
.
getItem
(
"memberCode"
)
:
""
,
scene
:
scene
||
""
}
}).
then
((
result
)
=>
{
let
blessContent
=
[];
...
...
@@ -811,6 +819,7 @@ Page({
* 加入房间
*/
onBlessJoinHandler
(
e
)
{
this
.
checkAuthShowComp
().
then
((
result
)
=>
{
let
{
options
,
detailData
...
...
@@ -835,6 +844,12 @@ Page({
}).
catch
((
err
)
=>
{
});
}).
catch
((
err
)
=>
{
});
},
// 点击确认授权按钮
...
...
src/pages/blessing/blessing.scss
View file @
5525151
...
...
@@ -21,18 +21,18 @@ $blessContentLabelWidth: 650px;
position
:
relative
;
margin
:
24px
auto
;
text-align
:
center
;
width
:
216px
;
//
width: 216px;
@extend
.fcc
;
&
-inner
{
width
:
1
67
px
;
height
:
1
67
px
;
border-radius
:
1
67
px
;
width
:
1
90
px
;
height
:
1
90
px
;
border-radius
:
1
90
px
;
}
&
-border
{
width
:
191
px
;
height
:
191
px
;
width
:
216
px
;
height
:
216
px
;
position
:
absolute
;
}
}
...
...
@@ -106,6 +106,9 @@ $blessContentLabelWidth: 650px;
height
:
100%
;
}
.ebggif
{}
.main
{
position
:
relative
;
...
...
@@ -129,6 +132,8 @@ $blessContentLabelWidth: 650px;
font-weight
:
500
;
text-align
:
center
;
color
:
#fee085
;
width
:
$blessContentWidth
;
margin
:
0
auto
;
}
// 用户
...
...
@@ -263,7 +268,7 @@ $blessContentLabelWidth: 650px;
}
}
.more2
{
.more2
{
margin-top
:
0
;
}
...
...
@@ -345,10 +350,38 @@ $blessContentLabelWidth: 650px;
margin-right
:
40px
;
margin-top
:
24px
;
.t1
{
text-decoration
:
underline
;
}
}
&
-item
{
display
:
flex
;
justify-content
:
flex-end
;
.btn
{
@extend
.bb
;
margin
:
24px
45px
8px
0
;
height
:
76px
;
line-height
:
76px
;
padding
:
0
20px
;
color
:
#fee085
;
font-size
:
36px
;
border-radius
:
8px
;
box-shadow
:
5
.9px
5
.5px
18px
0
rgba
(
26
,
36
,
91
,
0
.73
);
// background-image: linear-gradient(to top, #b41d36, #bb2634);
background-image
:
linear-gradient
(
to
top
,
#e65638
,
#dd784d
);
}
.btn2
{
color
:
#940023
;
box-shadow
:
5
.9px
5
.5px
18px
0
rgba
(
26
,
36
,
91
,
0
.73
);
background-image
:
linear-gradient
(
to
top
,
#f4b44d
,
#e8b976
,
#ffebb5
);
}
}
}
&
-image-bot
{
...
...
@@ -358,7 +391,7 @@ $blessContentLabelWidth: 650px;
}
&
-bot-space
{
min-height
:
1
5
6px
;
min-height
:
1
6
6px
;
}
}
...
...
@@ -384,7 +417,7 @@ $blessContentLabelWidth: 650px;
position
:
relative
;
display
:
flex
;
justify-content
:
center
;
margin
:
0px
auto
4
2px
;
margin
:
0px
auto
5
2px
;
.btn
{
margin
:
0
22px
;
...
...
@@ -395,6 +428,7 @@ $blessContentLabelWidth: 650px;
box-shadow
:
5
.9px
5
.5px
18px
0
rgba
(
26
,
36
,
91
,
0
.73
);
// background-image: linear-gradient(to top, #b41d36, #bb2634);
background-image
:
linear-gradient
(
to
top
,
#e65638
,
#dd784d
);
padding
:
0
;
}
.btn2
{
...
...
src/pages/blessing/blessing.wxml
View file @
5525151
<poster id="poster" hide-loading="{{true}}" preload="{{false}}" config="{{posterConfig}}" bind:success="onPosterSuccess" bind:fail="onPosterFail"></poster>
<view class="page">
<view class="app__bgc bgc" style="background-color: {{detailData.background}};"></view>
<!-- <view class="app__bg bg " style="background: url('{{detailData.backgroundImage}}')"></view> -->
<image mode="scaleToFill" class="ebg" src="{{detailData.backgroundImage}}" />
<image mode="aspectFill" class="ebg" src="{{detailData.backgroundGif}}" />
<!-- <image mode="aspectFill" class="ebg" src="{{detailData.backgroundGif}}" /> -->
<view class="ebggif" style="background: url('{{detailData.backgroundGif}}');position: fixed;width: 100%;height: 100%; background-size: 100% 100%;background-size: contain;"></view>
<!-- <view class="ebggif" ></view> -->
<view class="app__content main">
<!-- 顶部背景 -->
<image class="top-bg" mode="widthFix" src="{{detailData.headImage}}" />
...
...
@@ -27,7 +28,7 @@
<view wx:if="{{detailData.type == 1}}" class="edit">
<view class="tt t1">{{isAuth ? '携' + detailData.familyName : '携家人'}}</view>
<image wx:if="{{ownerMember.mySelf == 1}}" bindtap="showUpdateRoomDialog" class="name-edit" mode="widthFix" src="../../image/blessing/icon-edit.png" />
<view class="tt t2">{{detailData.count}}人</view>
<view
wx:if="{{memberList.length > 0}}"
class="tt t2">{{detailData.count}}人</view>
</view>
<!-- 用户组 -->
<view wx:if="{{detailData.type == 1}}" class="group {{isMore ? 'all' : ''}} {{memberList.length >= 6 && !isMore ? 'six':''}}">
...
...
@@ -40,12 +41,27 @@
</view>
<!-- 邀请 房主或组队模式显示 -->
<view class="group-item" wx:if="{{options.t || ownerMember.mySelf == 1}}">
<button wx:if="{{isAuth}}" data-data="join" open-type="share" class="group-item-inv">
<block wx:if="{{isAuth}}">
<!-- 已授权 -->
<!-- 未定制 -->
<block wx:if="{{detailData.customMade == 0}}">
<button bindtap="showTips" data-data="请定制祝福后再邀请" class="group-item-inv">
<image class="icon-inv" mode="widthFix" src="../../image/icon/icon-inv.png" />
</button>
</block>
<!-- 已定制 -->
<block wx:else>
<button data-data="join" open-type="share" class="group-item-inv">
<image class="icon-inv" mode="widthFix" src="../../image/icon/icon-inv.png" />
</button>
<button wx:else open-type="getUserInfo" bindgetuserinfo="bindGetUserInfo" class="group-item-inv">
</block>
</block>
<block wx:else>
<!-- 未授权 -->
<button open-type="getUserInfo" bindgetuserinfo="bindGetUserInfo" class="group-item-inv">
<image class="icon-inv" mode="widthFix" src="../../image/icon/icon-inv.png" />
</button>
</block>
</view>
</view>
<!-- 更多 -->
...
...
@@ -86,14 +102,12 @@
<view class="tail-btn-wrap">
<!-- 分享团队图片 -->
<image bindtap="onPosterHandler" wx:if="{{detailData.type == 1}}" mode="widthFix" class="tail-btn-wrap-item blessing-share-group-btn" src="../../image/blessing/blessing-share-group-btn.png" />
<view wx:if="{{detailData.type == 0}}" bindtap="toReward" class="tail-btn-wrap-item more-template">
<span class="t1">赞赏祝福</span>
>>
<view wx:if="{{detailData.type == 0}}" bindtap="toReward" class="tail-btn-wrap-item more-template2">
<view class="btn btn2">赞赏祝福</view>
</view>
<!-- 选择更多祝福模板 -->
<view bindtap="onMoreTemplateHandler" class="tail-btn-wrap-item more-template">
<span class="t1">选择更多祝福模版</span>
>>
<view bindtap="onMoreTemplateHandler" class="tail-btn-wrap-item more-template2 ">
<view class="btn btn2">选择更多祝福模版 >></view>
</view>
</view>
<!-- 尾图 -->
...
...
@@ -117,7 +131,7 @@
<!-- 已定制 -->
<view wx:if="{{detailData.customMade == 1}}" class="btn-wrap">
<button bindtap="onPosterHandler" class="btn btn1">分享图片祝福</button>
<button open-type="share" class="btn btn2">送
出我的祝福
</button>
<button open-type="share" class="btn btn2">送
祝福给亲友
</button>
</view>
</block>
<!-- 组队 -->
...
...
@@ -127,7 +141,7 @@
<!-- 未授权 -->
<block wx:if="{{!isAuth}}">
<button open-type="getUserInfo" bindgetuserinfo="bindGetUserInfo" class="btn btn1">
邀
请家人加入
邀
亲友组团拜年
</button>
<button open-type="getUserInfo" bindgetuserinfo="bindGetUserInfo" class="btn btn2">
定制我的祝福
...
...
@@ -135,7 +149,7 @@
</block>
<!-- 已授权 -->
<block wx:else>
<button bindtap="showTips" data-data="请定制祝福后再邀请" class="btn btn1">邀
请家人加入
</button>
<button bindtap="showTips" data-data="请定制祝福后再邀请" class="btn btn1">邀
亲友组团拜年
</button>
<button bindtap="onBlessMakeHandler" class="btn btn2">定制我的祝福</button>
</block>
</view>
...
...
@@ -147,9 +161,9 @@
</block>
<!-- 不能加入状态 -->
<block wx:else>
<button data-data="join" open-type="share" class="btn btn1">邀
请家人加入
</button>
<button data-data="join" open-type="share" class="btn btn1">邀
亲友组团拜年
</button>
</block>
<button open-type="share" class="btn btn2">送
出我的祝福
</button>
<button open-type="share" class="btn btn2">送
祝福给亲友
</button>
</view>
</block>
</view>
...
...
src/pages/index/index.scss
View file @
5525151
...
...
@@ -78,16 +78,19 @@
&
-bless-item
{
display
:
flex
;
justify-content
:
space-between
;
border-bottom
:
solid
2px
#dfdfdf
;
padding
:
24px
0
;
padding
:
8px
0
8px
;
position
:
relative
;
border-radius
:
8px
;
.desc-wrap
{
position
:
relative
;
@extend
.bb
;
padding
:
8px
1
4
px
;
height
:
18
0px
;
padding
:
8px
1
6px
8px
20
px
;
height
:
20
0px
;
flex
:
1
;
background-color
:
#ffffff
;
@include
border-right-radius
(
8px
);
}
.tit
{
...
...
@@ -106,9 +109,10 @@
}
.poster
{
width
:
3
5
0px
;
height
:
18
0px
;
width
:
3
0
0px
;
height
:
20
0px
;
border-radius
:
8px
;
@include
border-left-radius
(
8px
);
}
}
...
...
src/pages/index/index.wxml
View file @
5525151
...
...
@@ -30,7 +30,7 @@
<image class="poster" src="{{item.thumbnail}}" />
<view class="desc-wrap">
<view class="tit">{{item.blessTitle}}</view>
<view class="scene">{{item.type == 0 ? '
单人祝福 >> 送' : '团队
祝福 >> 送'}}{{item.scene}}</view>
<view class="scene">{{item.type == 0 ? '
我的祝福 >> 送' : '组团
祝福 >> 送'}}{{item.scene}}</view>
</view>
</view>
</block>
...
...
Please
register
or
sign in
to post a comment