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
1c3f7cc2
authored
2020-01-10 22:05:57 +0800
by
simon
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
默认提交
1 parent
00f58933
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
174 additions
and
88 deletions
src/config.js
src/http/fetch-api.js
src/pages/blessing/blessing.js
src/pages/blessing/blessing.scss
src/pages/blessing/blessing.wxml
src/pages/detail/detail.js
src/pages/index/index.js
src/pages/index/index.scss
src/pages/index/index.wxml
src/utils/util.js
src/config.js
View file @
1c3f7cc
...
...
@@ -2,7 +2,7 @@ let ENV_CONFIG = require('./env/index');
const
APPID
=
''
/** ====每次发布版本记得修改此环境配置==== */
const
ENV
=
'
Prod
'
;
// Dev Prod
const
ENV
=
'
Dev
'
;
// Dev Prod
const
NET_CONFIG
=
ENV_CONFIG
[
ENV
];
const
MOCKAPI
=
ENV_CONFIG
.
mockApi
;
...
...
src/http/fetch-api.js
View file @
1c3f7cc
...
...
@@ -20,7 +20,6 @@ function wxLogin() {
});
}
// 检查并获取sessionid
function
checkSessionId
(
sid
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
...
...
src/pages/blessing/blessing.js
View file @
1c3f7cc
import
{
getBindtapData
getBindtapData
,
checkAuth
}
from
'../../utils/util'
;
import
Dialog
from
'../../ui/vant-weapp/dialog/dialog'
;
let
app
=
getApp
();
...
...
@@ -16,9 +16,13 @@ Page({
indexInfo
:
{},
userInfo
:
{},
show
:
true
,
options
:
{},
detailData
:
{},
memberList
:
[],
options
:
{}
ownerMember
:
{},
// 房主
memberList
:
[],
// 用户信息
blessContent
:
[],
// 祝福内容
isAuth
:
false
,
// 是否授权
// type: 0, // 0单人 1组队
},
onShareAppMessage
()
{},
showAuth
()
{
...
...
@@ -27,76 +31,53 @@ Page({
})
},
onLoad
(
options
)
{
this
.
setData
({
options
});
checkAuth
().
then
((
result
)
=>
{
this
.
setData
({
isAuth
:
result
})
}).
catch
((
err
)
=>
{});
this
.
queryBlessDetail
();
this
.
initData
();
// Dialog.confirm({
// title: '标题',
// message: '弹窗内容',
// asyncClose: true
// }).then(() => {
// setTimeout(() => {
// Dialog.close();
// }, 1000);
// })
// .catch(() => {
// Dialog.close();
// });
},
/**
* 基础方法
* 授权完毕重拉数据用
*/
initData
()
{
initData
()
{
},
},
/**
*
到达底部
*
做加载更多操作
*
赞赏祝福
*
跳转到赞赏页
*/
onReachBottom
()
{
// if (this.data.dataList.length < this.data.total) {
// this.setData({
// page: this.data.page + 1
// });
// this.queryDataList();
// }
},
// 重置页面列表 点击搜索条件时需要
resetPage
()
{
this
.
setData
({
page
:
1
,
dataList
:
[]
toReward
()
{
app
.
router
.
push
({
path
:
"reward"
})
},
/**
*
请求DataList
*
选择更多祝福模版
*/
queryDataList
()
{
return
;
return
new
Promise
((
resolve
,
reject
)
=>
{
app
.
post
({
sid
:
false
,
url
:
app
.
api
.
dataList
,
data
:
{
page
:
this
.
data
.
page
,
size
:
this
.
data
.
size
,
},
}).
then
((
result
)
=>
{
let
dataList
=
result
.
list
;
dataList
=
this
.
data
.
dataList
.
concat
(
dataList
);
this
.
setData
({
dataList
:
dataList
,
total
:
result
.
total
})
resolve
();
})
});
onMoreTemplateHandler
()
{
let
pages
=
getCurrentPages
();
if
(
pages
.
length
>
1
)
{
// 如果能返回上一级
app
.
router
.
push
({
openType
:
"back"
});
}
else
{
app
.
router
.
push
({
openType
:
"redirect"
,
path
:
"index"
});
}
},
...
...
@@ -114,7 +95,9 @@ Page({
}).
then
((
result
)
=>
{
this
.
setData
({
detailData
:
result
,
memberList
:
result
.
memberList
ownerMember
:
result
.
ownerMember
,
memberList
:
result
.
memberList
,
blessContent
:
result
.
blessContent
,
});
resolve
(
result
);
}).
catch
((
err
)
=>
{
...
...
@@ -161,3 +144,17 @@ Page({
}
},
})
// Dialog.confirm({
// title: '标题',
// message: '弹窗内容',
// asyncClose: true
// }).then(() => {
// setTimeout(() => {
// Dialog.close();
// }, 1000);
// })
// .catch(() => {
// Dialog.close();
// });
...
...
src/pages/blessing/blessing.scss
View file @
1c3f7cc
...
...
@@ -11,25 +11,26 @@
&
-inner
{
width
:
167px
;
height
:
167px
;
border-radius
:
167px
;
}
&
-border
{
width
:
216px
;
width
:
167px
;
height
:
167px
;
position
:
absolute
;
}
}
.page
{
padding-bottom
:
200px
;
.bgc
{}
.bg
{
.
e
bg
{
position
:
fixed
;
background
:
url('https://kdcdn.oss-cn-shenzhen.aliyuncs.com/weapp/jyes/assets/oss/blessing-bg.png')
no-repeat
center
;
// height: auto;
// padding-bottom: 80px;
width
:
100%
;
height
:
100%
;
}
.main
{
...
...
@@ -47,6 +48,7 @@
.content
{
position
:
relative
;
z-index
:
11
;
// 标题
.title
{
...
...
@@ -225,10 +227,11 @@
position
:
fixed
;
bottom
:
0
;
width
:
100%
;
z-index
:
101
;
.bottom-bg
{
width
:
750px
;
height
:
1
60
px
;
height
:
1
32
px
;
position
:
absolute
;
bottom
:
0
;
}
...
...
@@ -238,7 +241,7 @@
position
:
relative
;
display
:
flex
;
justify-content
:
center
;
margin
:
24px
auto
;
margin
:
0px
auto
24px
;
.btn
{
margin
:
0
22px
;
...
...
src/pages/blessing/blessing.wxml
View file @
1c3f7cc
<view class="page">
<view class="app__bgc bgc"></view>
<view class="app__bg bg"></view>
<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}}" />
<view class="app__content main">
<!-- 顶部背景 -->
<image class="top-bg" mode="widthFix" src="
../../image/blessing/top-d1.png
" />
<image class="top-bg" mode="widthFix" src="
{{detailData.headImage}}
" />
<!-- <view class="top-bg"></view> -->
<view class="top-space"></view>
<view class="content">
...
...
@@ -12,8 +13,10 @@
<view class="user">
<!-- 用户头像 -->
<view class="portrait">
<image class="portrait-inner" mode="widthFix" src="../../image/blessing/portrait.png" />
<image class="portrait-border" mode="widthFix" src="../../image/blessing/portrait-border.png" />
<!-- <image class="portrait-inner" mode="widthFix" src="../../image/blessing/portrait.png" /> -->
<!-- <image class="portrait-border" mode="widthFix" src="../../image/blessing/portrait-border.png" /> -->
<image class="portrait-inner" mode="scaleToFill" src="{{ownerMember.memberHead}}" />
<image class="portrait-border" mode="scaleToFill" src="{{detailData.headFrame}}" />
</view>
<!-- 用户名称 -->
<view class="name">
...
...
@@ -24,7 +27,7 @@
<view class="edit">
<view class="tt t1">{{detailData.sentence}}</view>
<image class="name-edit" mode="widthFix" src="../../image/blessing/icon-edit.png" />
<view class="tt t2">{{
memberList.length
}}人</view>
<view class="tt t2">{{
detailData.count
}}人</view>
</view>
<!-- 用户组 -->
<view class="group">
...
...
@@ -48,32 +51,56 @@
<view class="tail">
<!-- 尾部头像 -->
<view class="portrait">
<image class="portrait-inner" mode="widthFix" src="../../image/blessing/portrait.png" />
<image class="portrait-border" mode="widthFix" src="../../image/blessing/portrait-border.png" />
<!-- <image class="portrait-inner" mode="widthFix" src="../../image/blessing/portrait.png" />
<image class="portrait-border" mode="widthFix" src="../../image/blessing/portrait-border.png" /> -->
<image class="portrait-inner" mode="scaleToFill" src="{{ownerMember.memberHead}}" />
<image class="portrait-border" mode="scaleToFill" src="{{detailData.headFrame}}" />
</view>
<view class="name">
<view class="tt t1">
滴水
</view>
<view class="tt t2">
祝你数年大吉
</view>
<view class="tt t1">
{{ownerMember.memberName}}
</view>
<view class="tt t2">
{{detailData.blessTitle}}
</view>
</view>
<!-- 按钮组 -->
<view class="tail-btn-wrap">
<!-- 分享团队图片 -->
<!-- <view class="share"></view> -->
<image mode="widthFix" class="tail-btn-wrap-item blessing-share-group-btn" src="../../image/blessing/blessing-share-group-btn.png" />
<image 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>
<!-- 选择更多祝福模板 -->
<view class="tail-btn-wrap-item more-template">
<view
bindtap="onMoreTemplateHandler"
class="tail-btn-wrap-item more-template">
<span class="t1">选择更多祝福模版</span>
>>
</view>
</view>
</view>
</view>
<!-- fix底部 -->
<view class="bottom">
<image class="bottom-bg" mode="scaleToFill" src="../../image/blessing/blessing-bottom.png" />
<view class="btn-wrap">
<image class="bottom-bg" mode="scaleToFill" src="{{detailData.tailImage}}" />
<!-- 分情况显示btn-wrap -->
<!-- 单人 -->
<block wx:if="{{detailData.type == 0}}">
<view class="btn-wrap">
<view class="btn btn1">分享图片祝福</view>
<view class="btn btn2">祝福送朋友</view>
<!-- <view wx:if="{{detailData.customMade == 0}}" class="btn btn2">祝福送朋友</view>
<view wx:if="{{detailData.customMade == 1}}" class="btn btn2">祝福送朋友</view> -->
</view>
</block>
<!-- 组队 -->
<block wx:if="{{detailData.type == 1}}">
<view class="btn-wrap">
<view class="btn btn1">定制我的祝福</view>
<view class="btn btn2">祝福送朋友</view>
</view>
</block>
<!-- <view class="btn-wrap">
<view class="btn btn1">定制我的祝福</view>
<view class="btn btn2">祝福送朋友</view>
</view>
</view>
-->
</view>
</view>
</view>
...
...
src/pages/detail/detail.js
View file @
1c3f7cc
...
...
@@ -17,9 +17,9 @@ Page({
indexInfo
:
{},
userInfo
:
{},
options
:
{},
detailData
:
{},
vidHeight
:
0
,
// 视频高度
isVideoEnded
:
false
,
detailData
:
{},
// 详情列表
},
onShareAppMessage
(
res
)
{
if
(
res
.
from
===
'button'
)
{
...
...
@@ -51,10 +51,21 @@ Page({
})
},
onLoad
(
options
)
{
let
_this
=
this
;
this
.
setData
({
options
});
this
.
queryVideoDetail
();
this
.
queryVideoDetail
().
then
((
result
)
=>
{
// wifi下自动播放
// wx.getNetworkType({
// success(res) {
// const networkType = res.networkType;
// if (networkType == "wifi") {
// _this.onReplayHandler();
// }
// }
// })
}).
catch
((
err
)
=>
{});;
this
.
initData
();
},
...
...
src/pages/index/index.js
View file @
1c3f7cc
...
...
@@ -12,12 +12,24 @@ Page({
size
:
10
,
dataList
:
[],
tabList
:
[],
// 标签列表
listType
:
2
,
//
0是普通视频列表 1是推荐 2是祝福语 非2就是普通视频
listType
:
2
,
//
拜年模块
0是普通视频列表 1是推荐 2是祝福语 非2就是普通视频
bannerList
:
[],
curTab
:
{},
queueCode
:
""
,
// 队列标识,每次请求,会返回一个队列标识,用户加载更多时候请携带queueCode参数
active
:
0
,
curBanner
:
{},
blessContent
:
[
{
type
:
"text"
,
content
:
"文本内容"
,
color
:
"0xffffff"
,
size
:
"26"
},
{
type
:
"image"
,
content
:
"url"
,
},
]
},
onShareAppMessage
(
res
)
{
if
(
res
.
from
===
'button'
)
{
...
...
src/pages/index/index.scss
View file @
1c3f7cc
...
...
@@ -80,14 +80,28 @@
justify-content
:
space-between
;
border-bottom
:
solid
2px
#dfdfdf
;
padding
:
24px
0
;
position
:
relative
;
.tit
{
.desc-wrap
{
position
:
relative
;
@extend
.bb
;
padding
:
8px
0
;
padding
:
8px
14px
;
height
:
180px
;
flex
:
1
;
font-size
:
40px
;
}
.tit
{
font-size
:
36px
;
@include
ellipsis
(
3
);
color
:
#fc464a
;
}
.scene
{
position
:
absolute
;
font-size
:
36px
;
bottom
:
12px
;
left
:
14px
;
@include
ellipsis
(
1
);
}
.poster
{
...
...
src/pages/index/index.wxml
View file @
1c3f7cc
...
...
@@ -28,7 +28,10 @@
<block wx:if="{{listType == 2}}">
<view wx:for="{{dataList}}" bindtap="onDetailHandler" data-data="{{item}}" data-index="{{index}}" wx:key="index" class="list-bless-item">
<image class="poster" src="{{item.thumbnail}}" />
<view class="tit">{{item.blessTitle}}</view>
<view class="desc-wrap">
<view class="tit">{{item.blessTitle}}</view>
<view class="scene">{{item.scene}}</view>
</view>
</view>
</block>
<!-- 视频item -->
...
...
src/utils/util.js
View file @
1c3f7cc
...
...
@@ -228,6 +228,25 @@ function throttle(func, wait, type) {
}
}
/**
* 检查是否授权
* @param {*} name
*/
function
checkAuth
(
name
,
url
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
wx
.
getSetting
({
success
(
res
)
{
if
(
res
.
authSetting
[
'scope.userInfo'
])
{
// 已经授权
resolve
(
true
);
}
else
{
resolve
(
false
);
}
}
});
});
}
module
.
exports
=
{
formatTime
:
formatTime
,
checkMobile
:
checkMobile
,
...
...
@@ -241,4 +260,5 @@ module.exports = {
wxacodeGet
:
wxacodeGet
,
getObjByListKeyValue
:
getObjByListKeyValue
,
getQueryByUrl
:
getQueryByUrl
,
checkAuth
:
checkAuth
}
...
...
Please
register
or
sign in
to post a comment