1c3f7cc2 by simon

默认提交

1 parent 00f58933
...@@ -2,7 +2,7 @@ let ENV_CONFIG = require('./env/index'); ...@@ -2,7 +2,7 @@ let ENV_CONFIG = require('./env/index');
2 2
3 const APPID = '' 3 const APPID = ''
4 /** ====每次发布版本记得修改此环境配置==== */ 4 /** ====每次发布版本记得修改此环境配置==== */
5 const ENV = 'Prod'; // Dev Prod 5 const ENV = 'Dev'; // Dev Prod
6 const NET_CONFIG = ENV_CONFIG[ENV]; 6 const NET_CONFIG = ENV_CONFIG[ENV];
7 const MOCKAPI = ENV_CONFIG.mockApi; 7 const MOCKAPI = ENV_CONFIG.mockApi;
8 8
......
...@@ -20,7 +20,6 @@ function wxLogin() { ...@@ -20,7 +20,6 @@ function wxLogin() {
20 }); 20 });
21 } 21 }
22 22
23
24 // 检查并获取sessionid 23 // 检查并获取sessionid
25 function checkSessionId(sid) { 24 function checkSessionId(sid) {
26 return new Promise((resolve, reject) => { 25 return new Promise((resolve, reject) => {
......
1 import { 1 import {
2 getBindtapData 2 getBindtapData,
3 checkAuth
3 } from '../../utils/util'; 4 } from '../../utils/util';
4 5
5
6 import Dialog from '../../ui/vant-weapp/dialog/dialog'; 6 import Dialog from '../../ui/vant-weapp/dialog/dialog';
7 7
8 let app = getApp(); 8 let app = getApp();
...@@ -16,9 +16,13 @@ Page({ ...@@ -16,9 +16,13 @@ Page({
16 indexInfo: {}, 16 indexInfo: {},
17 userInfo: {}, 17 userInfo: {},
18 show: true, 18 show: true,
19 options: {},
19 detailData: {}, 20 detailData: {},
20 memberList: [], 21 ownerMember: {}, // 房主
21 options: {} 22 memberList: [], // 用户信息
23 blessContent: [], // 祝福内容
24 isAuth: false, // 是否授权
25 // type: 0, // 0单人 1组队
22 }, 26 },
23 onShareAppMessage() {}, 27 onShareAppMessage() {},
24 showAuth() { 28 showAuth() {
...@@ -27,76 +31,53 @@ Page({ ...@@ -27,76 +31,53 @@ Page({
27 }) 31 })
28 }, 32 },
29 onLoad(options) { 33 onLoad(options) {
34
35
30 this.setData({ 36 this.setData({
31 options 37 options
32 }); 38 });
39 checkAuth().then((result) => {
40 this.setData({
41 isAuth: result
42 })
43 }).catch((err) => {});
33 this.queryBlessDetail(); 44 this.queryBlessDetail();
34 this.initData(); 45 this.initData();
35 // Dialog.confirm({ 46
36 // title: '标题',
37 // message: '弹窗内容',
38 // asyncClose: true
39 // }).then(() => {
40 // setTimeout(() => {
41 // Dialog.close();
42 // }, 1000);
43 // })
44 // .catch(() => {
45 // Dialog.close();
46 // });
47 }, 47 },
48 48
49 /** 49 /**
50 * 基础方法 50 * 基础方法
51 * 授权完毕重拉数据用 51 * 授权完毕重拉数据用
52 */ 52 */
53 initData() { 53 initData() {},
54 54
55 },
56 /** 55 /**
57 * 到达底部 56 * 赞赏祝福
58 * 做加载更多操作 57 * 跳转到赞赏页
59 */ 58 */
60 onReachBottom() { 59 toReward() {
61 // if (this.data.dataList.length < this.data.total) { 60 app.router.push({
62 // this.setData({ 61 path: "reward"
63 // page: this.data.page + 1
64 // });
65 // this.queryDataList();
66 // }
67 },
68
69 // 重置页面列表 点击搜索条件时需要
70 resetPage() {
71 this.setData({
72 page: 1,
73 dataList: []
74 }) 62 })
75 }, 63 },
76 64
77 /** 65 /**
78 * 请求DataList 66 * 选择更多祝福模版
79 */ 67 */
80 queryDataList() { 68 onMoreTemplateHandler() {
81 return; 69 let pages = getCurrentPages();
82 return new Promise((resolve, reject) => { 70 if (pages.length > 1) {
83 app.post({ 71 // 如果能返回上一级
84 sid: false, 72 app.router.push({
85 url: app.api.dataList, 73 openType: "back"
86 data: { 74 });
87 page: this.data.page, 75 } else {
88 size: this.data.size, 76 app.router.push({
89 }, 77 openType: "redirect",
90 }).then((result) => { 78 path: "index"
91 let dataList = result.list; 79 });
92 dataList = this.data.dataList.concat(dataList); 80 }
93 this.setData({
94 dataList: dataList,
95 total: result.total
96 })
97 resolve();
98 })
99 });
100 }, 81 },
101 82
102 83
...@@ -114,7 +95,9 @@ Page({ ...@@ -114,7 +95,9 @@ Page({
114 }).then((result) => { 95 }).then((result) => {
115 this.setData({ 96 this.setData({
116 detailData: result, 97 detailData: result,
117 memberList: result.memberList 98 ownerMember: result.ownerMember,
99 memberList: result.memberList,
100 blessContent: result.blessContent,
118 }); 101 });
119 resolve(result); 102 resolve(result);
120 }).catch((err) => { 103 }).catch((err) => {
...@@ -161,3 +144,17 @@ Page({ ...@@ -161,3 +144,17 @@ Page({
161 } 144 }
162 }, 145 },
163 }) 146 })
147
148
149 // Dialog.confirm({
150 // title: '标题',
151 // message: '弹窗内容',
152 // asyncClose: true
153 // }).then(() => {
154 // setTimeout(() => {
155 // Dialog.close();
156 // }, 1000);
157 // })
158 // .catch(() => {
159 // Dialog.close();
160 // });
......
...@@ -11,25 +11,26 @@ ...@@ -11,25 +11,26 @@
11 11
12 &-inner { 12 &-inner {
13 width: 167px; 13 width: 167px;
14 height: 167px;
15 border-radius: 167px;
14 } 16 }
15 17
16 &-border { 18 &-border {
17 width: 216px; 19 width: 167px;
20 height: 167px;
18 position: absolute; 21 position: absolute;
19 } 22 }
20 } 23 }
21 24
22
23 .page { 25 .page {
24 padding-bottom: 200px; 26 padding-bottom: 200px;
25 27
26 .bgc {} 28 .bgc {}
27 29
28 .bg { 30 .ebg {
29 position: fixed; 31 position: fixed;
30 background: url('https://kdcdn.oss-cn-shenzhen.aliyuncs.com/weapp/jyes/assets/oss/blessing-bg.png') no-repeat center; 32 width: 100%;
31 // height: auto; 33 height: 100%;
32 // padding-bottom: 80px;
33 } 34 }
34 35
35 .main { 36 .main {
...@@ -47,6 +48,7 @@ ...@@ -47,6 +48,7 @@
47 48
48 .content { 49 .content {
49 position: relative; 50 position: relative;
51 z-index: 11;
50 52
51 // 标题 53 // 标题
52 .title { 54 .title {
...@@ -225,10 +227,11 @@ ...@@ -225,10 +227,11 @@
225 position: fixed; 227 position: fixed;
226 bottom: 0; 228 bottom: 0;
227 width: 100%; 229 width: 100%;
230 z-index: 101;
228 231
229 .bottom-bg { 232 .bottom-bg {
230 width: 750px; 233 width: 750px;
231 height: 160px; 234 height: 132px;
232 position: absolute; 235 position: absolute;
233 bottom: 0; 236 bottom: 0;
234 } 237 }
...@@ -238,7 +241,7 @@ ...@@ -238,7 +241,7 @@
238 position: relative; 241 position: relative;
239 display: flex; 242 display: flex;
240 justify-content: center; 243 justify-content: center;
241 margin: 24px auto; 244 margin: 0px auto 24px;
242 245
243 .btn { 246 .btn {
244 margin: 0 22px; 247 margin: 0 22px;
......
1 <view class="page"> 1 <view class="page">
2 <view class="app__bgc bgc"></view> 2 <view class="app__bgc bgc" style="background-color: {{detailData.background}};"></view>
3 <view class="app__bg bg"></view> 3 <!-- <view class="app__bg bg " style="background: url('{{detailData.backgroundImage}}')"></view> -->
4 <image mode="scaleToFill" class="ebg" src="{{detailData.backgroundImage}}" />
4 <view class="app__content main"> 5 <view class="app__content main">
5 <!-- 顶部背景 --> 6 <!-- 顶部背景 -->
6 <image class="top-bg" mode="widthFix" src="../../image/blessing/top-d1.png" /> 7 <image class="top-bg" mode="widthFix" src="{{detailData.headImage}}" />
7 <!-- <view class="top-bg"></view> --> 8 <!-- <view class="top-bg"></view> -->
8 <view class="top-space"></view> 9 <view class="top-space"></view>
9 <view class="content"> 10 <view class="content">
...@@ -12,8 +13,10 @@ ...@@ -12,8 +13,10 @@
12 <view class="user"> 13 <view class="user">
13 <!-- 用户头像 --> 14 <!-- 用户头像 -->
14 <view class="portrait"> 15 <view class="portrait">
15 <image class="portrait-inner" mode="widthFix" src="../../image/blessing/portrait.png" /> 16 <!-- <image class="portrait-inner" mode="widthFix" src="../../image/blessing/portrait.png" /> -->
16 <image class="portrait-border" mode="widthFix" src="../../image/blessing/portrait-border.png" /> 17 <!-- <image class="portrait-border" mode="widthFix" src="../../image/blessing/portrait-border.png" /> -->
18 <image class="portrait-inner" mode="scaleToFill" src="{{ownerMember.memberHead}}" />
19 <image class="portrait-border" mode="scaleToFill" src="{{detailData.headFrame}}" />
17 </view> 20 </view>
18 <!-- 用户名称 --> 21 <!-- 用户名称 -->
19 <view class="name"> 22 <view class="name">
...@@ -24,7 +27,7 @@ ...@@ -24,7 +27,7 @@
24 <view class="edit"> 27 <view class="edit">
25 <view class="tt t1">{{detailData.sentence}}</view> 28 <view class="tt t1">{{detailData.sentence}}</view>
26 <image class="name-edit" mode="widthFix" src="../../image/blessing/icon-edit.png" /> 29 <image class="name-edit" mode="widthFix" src="../../image/blessing/icon-edit.png" />
27 <view class="tt t2">{{memberList.length}}人</view> 30 <view class="tt t2">{{detailData.count}}人</view>
28 </view> 31 </view>
29 <!-- 用户组 --> 32 <!-- 用户组 -->
30 <view class="group"> 33 <view class="group">
...@@ -48,32 +51,56 @@ ...@@ -48,32 +51,56 @@
48 <view class="tail"> 51 <view class="tail">
49 <!-- 尾部头像 --> 52 <!-- 尾部头像 -->
50 <view class="portrait"> 53 <view class="portrait">
51 <image class="portrait-inner" mode="widthFix" src="../../image/blessing/portrait.png" /> 54 <!-- <image class="portrait-inner" mode="widthFix" src="../../image/blessing/portrait.png" />
52 <image class="portrait-border" mode="widthFix" src="../../image/blessing/portrait-border.png" /> 55 <image class="portrait-border" mode="widthFix" src="../../image/blessing/portrait-border.png" /> -->
56 <image class="portrait-inner" mode="scaleToFill" src="{{ownerMember.memberHead}}" />
57 <image class="portrait-border" mode="scaleToFill" src="{{detailData.headFrame}}" />
53 </view> 58 </view>
54 <view class="name"> 59 <view class="name">
55 <view class="tt t1">滴水</view> 60 <view class="tt t1">{{ownerMember.memberName}}</view>
56 <view class="tt t2">祝你数年大吉</view> 61 <view class="tt t2">{{detailData.blessTitle}}</view>
57 </view> 62 </view>
58 <!-- 按钮组 --> 63 <!-- 按钮组 -->
59 <view class="tail-btn-wrap"> 64 <view class="tail-btn-wrap">
60 <!-- 分享团队图片 --> 65 <!-- 分享团队图片 -->
61 <!-- <view class="share"></view> --> 66 <!-- <view class="share"></view> -->
62 <image mode="widthFix" class="tail-btn-wrap-item blessing-share-group-btn" src="../../image/blessing/blessing-share-group-btn.png" /> 67 <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" />
68 <view wx:if="{{detailData.type == 0}}" bindtap="toReward" class="tail-btn-wrap-item more-template">
69 <span class="t1">赞赏祝福</span>
70 >>
71 </view>
63 <!-- 选择更多祝福模板 --> 72 <!-- 选择更多祝福模板 -->
64 <view class="tail-btn-wrap-item more-template"> 73 <view bindtap="onMoreTemplateHandler" class="tail-btn-wrap-item more-template">
65 <span class="t1">选择更多祝福模版</span> 74 <span class="t1">选择更多祝福模版</span>
66 >> 75 >>
67 </view> 76 </view>
68 </view> 77 </view>
69 </view> 78 </view>
70 </view> 79 </view>
80 <!-- fix底部 -->
71 <view class="bottom"> 81 <view class="bottom">
72 <image class="bottom-bg" mode="scaleToFill" src="../../image/blessing/blessing-bottom.png" /> 82 <image class="bottom-bg" mode="scaleToFill" src="{{detailData.tailImage}}" />
73 <view class="btn-wrap"> 83 <!-- 分情况显示btn-wrap -->
84 <!-- 单人 -->
85 <block wx:if="{{detailData.type == 0}}">
86 <view class="btn-wrap">
87 <view class="btn btn1">分享图片祝福</view>
88 <view class="btn btn2">祝福送朋友</view>
89 <!-- <view wx:if="{{detailData.customMade == 0}}" class="btn btn2">祝福送朋友</view>
90 <view wx:if="{{detailData.customMade == 1}}" class="btn btn2">祝福送朋友</view> -->
91 </view>
92 </block>
93 <!-- 组队 -->
94 <block wx:if="{{detailData.type == 1}}">
95 <view class="btn-wrap">
96 <view class="btn btn1">定制我的祝福</view>
97 <view class="btn btn2">祝福送朋友</view>
98 </view>
99 </block>
100 <!-- <view class="btn-wrap">
74 <view class="btn btn1">定制我的祝福</view> 101 <view class="btn btn1">定制我的祝福</view>
75 <view class="btn btn2">祝福送朋友</view> 102 <view class="btn btn2">祝福送朋友</view>
76 </view> 103 </view> -->
77 </view> 104 </view>
78 </view> 105 </view>
79 </view> 106 </view>
......
...@@ -17,9 +17,9 @@ Page({ ...@@ -17,9 +17,9 @@ Page({
17 indexInfo: {}, 17 indexInfo: {},
18 userInfo: {}, 18 userInfo: {},
19 options: {}, 19 options: {},
20 detailData: {},
21 vidHeight: 0, // 视频高度 20 vidHeight: 0, // 视频高度
22 isVideoEnded: false, 21 isVideoEnded: false,
22 detailData: {}, // 详情列表
23 }, 23 },
24 onShareAppMessage(res) { 24 onShareAppMessage(res) {
25 if (res.from === 'button') { 25 if (res.from === 'button') {
...@@ -51,10 +51,21 @@ Page({ ...@@ -51,10 +51,21 @@ Page({
51 }) 51 })
52 }, 52 },
53 onLoad(options) { 53 onLoad(options) {
54 let _this = this;
54 this.setData({ 55 this.setData({
55 options 56 options
56 }); 57 });
57 this.queryVideoDetail(); 58 this.queryVideoDetail().then((result) => {
59 // wifi下自动播放
60 // wx.getNetworkType({
61 // success(res) {
62 // const networkType = res.networkType;
63 // if (networkType == "wifi") {
64 // _this.onReplayHandler();
65 // }
66 // }
67 // })
68 }).catch((err) => {});;
58 this.initData(); 69 this.initData();
59 }, 70 },
60 71
......
...@@ -12,12 +12,24 @@ Page({ ...@@ -12,12 +12,24 @@ Page({
12 size: 10, 12 size: 10,
13 dataList: [], 13 dataList: [],
14 tabList: [], // 标签列表 14 tabList: [], // 标签列表
15 listType: 2, // 0是普通视频列表 1是推荐 2是祝福语 非2就是普通视频 15 listType: 2, // 拜年模块 0是普通视频列表 1是推荐 2是祝福语 非2就是普通视频
16 bannerList: [], 16 bannerList: [],
17 curTab: {}, 17 curTab: {},
18 queueCode: "", // 队列标识,每次请求,会返回一个队列标识,用户加载更多时候请携带queueCode参数 18 queueCode: "", // 队列标识,每次请求,会返回一个队列标识,用户加载更多时候请携带queueCode参数
19 active: 0, 19 active: 0,
20 curBanner: {}, 20 curBanner: {},
21 blessContent: [
22 {
23 type: "text",
24 content: "文本内容",
25 color: "0xffffff",
26 size: "26"
27 },
28 {
29 type: "image",
30 content: "url",
31 },
32 ]
21 }, 33 },
22 onShareAppMessage(res) { 34 onShareAppMessage(res) {
23 if (res.from === 'button') { 35 if (res.from === 'button') {
......
...@@ -80,14 +80,28 @@ ...@@ -80,14 +80,28 @@
80 justify-content: space-between; 80 justify-content: space-between;
81 border-bottom: solid 2px #dfdfdf; 81 border-bottom: solid 2px #dfdfdf;
82 padding: 24px 0; 82 padding: 24px 0;
83 position: relative;
83 84
84 .tit { 85 .desc-wrap {
86 position: relative;
85 @extend .bb; 87 @extend .bb;
86 padding: 8px 0; 88 padding: 8px 14px;
87 height: 180px; 89 height: 180px;
88 flex: 1; 90 flex: 1;
89 font-size: 40px; 91 }
92
93 .tit {
94 font-size: 36px;
90 @include ellipsis(3); 95 @include ellipsis(3);
96 color: #fc464a;
97 }
98
99 .scene {
100 position: absolute;
101 font-size: 36px;
102 bottom: 12px;
103 left: 14px;
104 @include ellipsis(1);
91 } 105 }
92 106
93 .poster { 107 .poster {
......
...@@ -28,7 +28,10 @@ ...@@ -28,7 +28,10 @@
28 <block wx:if="{{listType == 2}}"> 28 <block wx:if="{{listType == 2}}">
29 <view wx:for="{{dataList}}" bindtap="onDetailHandler" data-data="{{item}}" data-index="{{index}}" wx:key="index" class="list-bless-item"> 29 <view wx:for="{{dataList}}" bindtap="onDetailHandler" data-data="{{item}}" data-index="{{index}}" wx:key="index" class="list-bless-item">
30 <image class="poster" src="{{item.thumbnail}}" /> 30 <image class="poster" src="{{item.thumbnail}}" />
31 <view class="tit">{{item.blessTitle}}</view> 31 <view class="desc-wrap">
32 <view class="tit">{{item.blessTitle}}</view>
33 <view class="scene">{{item.scene}}</view>
34 </view>
32 </view> 35 </view>
33 </block> 36 </block>
34 <!-- 视频item --> 37 <!-- 视频item -->
......
...@@ -228,6 +228,25 @@ function throttle(func, wait, type) { ...@@ -228,6 +228,25 @@ function throttle(func, wait, type) {
228 } 228 }
229 } 229 }
230 230
231 /**
232 * 检查是否授权
233 * @param {*} name
234 */
235 function checkAuth(name, url) {
236 return new Promise((resolve, reject) => {
237 wx.getSetting({
238 success(res) {
239 if (res.authSetting['scope.userInfo']) {
240 // 已经授权
241 resolve(true);
242 } else {
243 resolve(false);
244 }
245 }
246 });
247 });
248 }
249
231 module.exports = { 250 module.exports = {
232 formatTime: formatTime, 251 formatTime: formatTime,
233 checkMobile: checkMobile, 252 checkMobile: checkMobile,
...@@ -241,4 +260,5 @@ module.exports = { ...@@ -241,4 +260,5 @@ module.exports = {
241 wxacodeGet: wxacodeGet, 260 wxacodeGet: wxacodeGet,
242 getObjByListKeyValue: getObjByListKeyValue, 261 getObjByListKeyValue: getObjByListKeyValue,
243 getQueryByUrl: getQueryByUrl, 262 getQueryByUrl: getQueryByUrl,
263 checkAuth: checkAuth
244 } 264 }
......