2d4931fc by simon

默认提交

1 parent c23b19a3
...@@ -48,5 +48,8 @@ ...@@ -48,5 +48,8 @@
48 "postcss-lazysprite": "^2.0.0", 48 "postcss-lazysprite": "^2.0.0",
49 "postcss-px2rpx": "0.0.4", 49 "postcss-px2rpx": "0.0.4",
50 "yargs": "^13.1.0" 50 "yargs": "^13.1.0"
51 },
52 "dependencies": {
53 "@vant/weapp": "^1.0.2"
51 } 54 }
52 } 55 }
......
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
22 "empty-tips": "../../component/empty-tips/empty-tips", 22 "empty-tips": "../../component/empty-tips/empty-tips",
23 "shortcut": "../../component/shortcut/shortcut", 23 "shortcut": "../../component/shortcut/shortcut",
24 "van-popup": "../../ui/vant-weapp/popup/index", 24 "van-popup": "../../ui/vant-weapp/popup/index",
25 "van-dialog": "../../ui/vant-weapp/dialog/index",
25 "van-sticky": "../../ui/vant-weapp/sticky/index", 26 "van-sticky": "../../ui/vant-weapp/sticky/index",
26 "van-tab": "../../ui/vant-weapp/tab/index", 27 "van-tab": "../../ui/vant-weapp/tab/index",
27 "van-tabs": "../../ui/vant-weapp/tabs/index" 28 "van-tabs": "../../ui/vant-weapp/tabs/index"
......
...@@ -15,6 +15,8 @@ module.exports = { ...@@ -15,6 +15,8 @@ module.exports = {
15 wxPay: '/wx/pay', // 帐号详情 15 wxPay: '/wx/pay', // 帐号详情
16 stat: '/dot', // 打点 16 stat: '/dot', // 打点
17 17
18 blessDetail: "/bless/detail", //
19
18 /** 20 /**
19 * 通用接口 21 * 通用接口
20 * 请求时 "mode"传"custom" 22 * 请求时 "mode"传"custom"
......
...@@ -3,7 +3,10 @@ let Store = require('./../utils/stroage'); ...@@ -3,7 +3,10 @@ let Store = require('./../utils/stroage');
3 let Router = require('./../router/index'); 3 let Router = require('./../router/index');
4 const errMsg = '服务异常,请稍后重试'; 4 const errMsg = '服务异常,请稍后重试';
5 5
6 // let isWxLogin = false; 6 /**
7 * 1.业务接口返回404时,会自动调用自定义login接口重拉sessionId,成功后会重新调用该业务接口
8 * 2.当自定义login接口返回状态码不为200时,弹出授权登陆
9 */
7 10
8 function wxLogin() { 11 function wxLogin() {
9 return new Promise((resolve, reject) => { 12 return new Promise((resolve, reject) => {
...@@ -58,6 +61,7 @@ function login() { ...@@ -58,6 +61,7 @@ function login() {
58 } = res2.data; 61 } = res2.data;
59 if (code == 200 && content.sessionId) { 62 if (code == 200 && content.sessionId) {
60 Store.setItem('sessionId', content.sessionId); 63 Store.setItem('sessionId', content.sessionId);
64 Store.setItem('memberCode', content.memberCode);
61 resolve(); 65 resolve();
62 } else { 66 } else {
63 wx.hideLoading(); 67 wx.hideLoading();
...@@ -128,9 +132,6 @@ const fetch = function ({ ...@@ -128,9 +132,6 @@ const fetch = function ({
128 if (res.code == 404) { 132 if (res.code == 404) {
129 //登陆失效的回调 133 //登陆失效的回调
130 Store.clear("sessionId"); 134 Store.clear("sessionId");
131 // wx.reLaunch({
132 // url: '/pages/index/index'
133 // })
134 // 404后拉取登陆后再做一次 135 // 404后拉取登陆后再做一次
135 login().then((resultLogin) => { 136 login().then((resultLogin) => {
136 wx.request({ 137 wx.request({
......
...@@ -2,6 +2,9 @@ import { ...@@ -2,6 +2,9 @@ import {
2 getBindtapData 2 getBindtapData
3 } from '../../utils/util'; 3 } from '../../utils/util';
4 4
5
6 import Dialog from '../../ui/vant-weapp/dialog/dialog';
7
5 let app = getApp(); 8 let app = getApp();
6 Page({ 9 Page({
7 data: { 10 data: {
...@@ -12,6 +15,10 @@ Page({ ...@@ -12,6 +15,10 @@ Page({
12 productList: [], // 产品列表 15 productList: [], // 产品列表
13 indexInfo: {}, 16 indexInfo: {},
14 userInfo: {}, 17 userInfo: {},
18 show: true,
19 detailData: {},
20 memberList: [],
21 options: {}
15 }, 22 },
16 onShareAppMessage() {}, 23 onShareAppMessage() {},
17 showAuth() { 24 showAuth() {
...@@ -19,7 +26,25 @@ Page({ ...@@ -19,7 +26,25 @@ Page({
19 authorizeVisible: true 26 authorizeVisible: true
20 }) 27 })
21 }, 28 },
22 onLoad(options) {}, 29 onLoad(options) {
30 this.setData({
31 options
32 });
33 this.queryBlessDetail();
34 this.initData();
35 // Dialog.confirm({
36 // title: '标题',
37 // message: '弹窗内容',
38 // asyncClose: true
39 // }).then(() => {
40 // setTimeout(() => {
41 // Dialog.close();
42 // }, 1000);
43 // })
44 // .catch(() => {
45 // Dialog.close();
46 // });
47 },
23 48
24 /** 49 /**
25 * 基础方法 50 * 基础方法
...@@ -33,12 +58,12 @@ Page({ ...@@ -33,12 +58,12 @@ Page({
33 * 做加载更多操作 58 * 做加载更多操作
34 */ 59 */
35 onReachBottom() { 60 onReachBottom() {
36 if (this.data.dataList.length < this.data.total) { 61 // if (this.data.dataList.length < this.data.total) {
37 this.setData({ 62 // this.setData({
38 page: this.data.page + 1 63 // page: this.data.page + 1
39 }); 64 // });
40 this.queryDataList(); 65 // this.queryDataList();
41 } 66 // }
42 }, 67 },
43 68
44 // 重置页面列表 点击搜索条件时需要 69 // 重置页面列表 点击搜索条件时需要
...@@ -74,6 +99,30 @@ Page({ ...@@ -74,6 +99,30 @@ Page({
74 }); 99 });
75 }, 100 },
76 101
102
103 /**
104 * 视频详情
105 */
106 queryBlessDetail() {
107 return new Promise((resolve, reject) => {
108 app.post({
109 url: app.api.blessDetail,
110 data: {
111 blessCode: this.data.options.c,
112 ownerMemberCode: this.data.options.m ? this.data.options.m : app.store.getItem("memberCode") ? app.store.getItem("memberCode") : "",
113 }
114 }).then((result) => {
115 this.setData({
116 detailData: result,
117 memberList: result.memberList
118 });
119 resolve(result);
120 }).catch((err) => {
121 reject(err);
122 });
123 });
124 },
125
77 /** 126 /**
78 * 隐藏蒙层 127 * 隐藏蒙层
79 */ 128 */
...@@ -99,9 +148,9 @@ Page({ ...@@ -99,9 +148,9 @@ Page({
99 this.hideMask(); 148 this.hideMask();
100 break; 149 break;
101 150
102 /** 151 /**
103 * 重拉数据已在 152 * 重拉数据已在
104 */ 153 */
105 case "_evt_auth_complete": 154 case "_evt_auth_complete":
106 // this.initData(); 155 // this.initData();
107 this.hideMask(); 156 this.hideMask();
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
7 <!-- <view class="top-bg"></view> --> 7 <!-- <view class="top-bg"></view> -->
8 <view class="top-space"></view> 8 <view class="top-space"></view>
9 <view class="content"> 9 <view class="content">
10 <view class="title">大年初一</view> 10 <view class="title">{{detailData.lunarCalendar}}</view>
11 <!-- 用户 --> 11 <!-- 用户 -->
12 <view class="user"> 12 <view class="user">
13 <!-- 用户头像 --> 13 <!-- 用户头像 -->
...@@ -17,18 +17,18 @@ ...@@ -17,18 +17,18 @@
17 </view> 17 </view>
18 <!-- 用户名称 --> 18 <!-- 用户名称 -->
19 <view class="name"> 19 <view class="name">
20 <view class="tt">姓名</view> 20 <view class="tt">{{detailData.familyName}}</view>
21 <image class="name-edit" mode="widthFix" src="../../image/blessing/icon-edit.png" /> 21 <image class="name-edit" mode="widthFix" src="../../image/blessing/icon-edit.png" />
22 </view> 22 </view>
23 <!-- 编辑 --> 23 <!-- 编辑 -->
24 <view class="edit"> 24 <view class="edit">
25 <view class="tt t1">携家人</view> 25 <view class="tt t1">{{detailData.sentence}}</view>
26 <image class="name-edit" mode="widthFix" src="../../image/blessing/icon-edit.png" /> 26 <image class="name-edit" mode="widthFix" src="../../image/blessing/icon-edit.png" />
27 <view class="tt t2">2人</view> 27 <view class="tt t2">{{memberList.length}}人</view>
28 </view> 28 </view>
29 <!-- 用户组 --> 29 <!-- 用户组 -->
30 <view class="group"> 30 <view class="group">
31 <view wx:for="{{6}}" class="group-item"> 31 <view wx:for="{{memberList}}" wx:key="{{index}}" class="group-item">
32 <view class="group-item-portrait"></view> 32 <view class="group-item-portrait"></view>
33 <view class="group-item-name"> 33 <view class="group-item-name">
34 <view class="t1">李四</view> 34 <view class="t1">李四</view>
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
42 <image class="icon-down" mode="widthFix" src="../../image/blessing/icon-down-arrow.png" /> 42 <image class="icon-down" mode="widthFix" src="../../image/blessing/icon-down-arrow.png" />
43 </view> 43 </view>
44 <!-- 自定义句子 --> 44 <!-- 自定义句子 -->
45 <view class="sentence">给您拜年啦!</view> 45 <view class="sentence">{{detailData.sentence}}</view>
46 </view> 46 </view>
47 <!-- 尾部内容 --> 47 <!-- 尾部内容 -->
48 <view class="tail"> 48 <view class="tail">
...@@ -77,3 +77,4 @@ ...@@ -77,3 +77,4 @@
77 </view> 77 </view>
78 </view> 78 </view>
79 </view> 79 </view>
80 <van-dialog id="van-dialog" />
......
...@@ -12,11 +12,12 @@ Page({ ...@@ -12,11 +12,12 @@ Page({
12 size: 10, 12 size: 10,
13 dataList: [], 13 dataList: [],
14 tabList: [], // 标签列表 14 tabList: [], // 标签列表
15 listType: 2, // 0是普通视频列表 1是推荐 2是祝福语 非2就是普通视频
15 bannerList: [], 16 bannerList: [],
16 curTab: {}, 17 curTab: {},
17 queueCode: "", // 队列标识,每次请求,会返回一个队列标识,用户加载更多时候请携带queueCode参数 18 queueCode: "", // 队列标识,每次请求,会返回一个队列标识,用户加载更多时候请携带queueCode参数
18 active: 0, 19 active: 0,
19 curBanner: {} 20 curBanner: {},
20 }, 21 },
21 onShareAppMessage(res) { 22 onShareAppMessage(res) {
22 if (res.from === 'button') { 23 if (res.from === 'button') {
...@@ -110,15 +111,29 @@ Page({ ...@@ -110,15 +111,29 @@ Page({
110 */ 111 */
111 onDetailHandler(evt) { 112 onDetailHandler(evt) {
112 let curItem = getBindtapData(evt); 113 let curItem = getBindtapData(evt);
113 let videoCode = curItem.videoCode || "" 114 let listType = this.data.listType;
114 if (videoCode) { 115 if (listType == 2) {
115 app.router.push({ 116 let blessCode = curItem.blessCode || "";
116 path: "detail", 117 if (blessCode) {
117 query: { 118 app.router.push({
118 c: videoCode 119 path: "blessing",
119 } 120 query: {
120 }) 121 c: blessCode
122 }
123 })
124 }
125 } else {
126 let videoCode = curItem.videoCode || "";
127 if (videoCode) {
128 app.router.push({
129 path: "detail",
130 query: {
131 c: videoCode
132 }
133 })
134 }
121 } 135 }
136
122 }, 137 },
123 138
124 /** 139 /**
...@@ -273,6 +288,7 @@ Page({ ...@@ -273,6 +288,7 @@ Page({
273 dataList: dataList, 288 dataList: dataList,
274 total: result.total, 289 total: result.total,
275 queueCode: result.queueCode, 290 queueCode: result.queueCode,
291 listType: result.type
276 }) 292 })
277 resolve(result); 293 resolve(result);
278 }).catch((err) => { 294 }).catch((err) => {
......
...@@ -74,6 +74,30 @@ ...@@ -74,6 +74,30 @@
74 margin: 0 auto; 74 margin: 0 auto;
75 width: $contentWidth; 75 width: $contentWidth;
76 76
77 // 拜年祝福item
78 &-bless-item {
79 display: flex;
80 justify-content: space-between;
81 border-bottom: solid 2px #dfdfdf;
82 padding: 24px 0;
83
84 .tit {
85 @extend .bb;
86 padding: 8px 0;
87 height: 180px;
88 flex: 1;
89 font-size: 40px;
90 @include ellipsis(3);
91 }
92
93 .poster {
94 width: 350px;
95 height: 180px;
96 border-radius: 8px;
97 }
98 }
99
100 // 视频item
77 &-item { 101 &-item {
78 // @extend .shadow; 102 // @extend .shadow;
79 box-shadow: 0 6px 10px 0 rgba(0, 0, 0, 0.6); 103 box-shadow: 0 6px 10px 0 rgba(0, 0, 0, 0.6);
...@@ -113,7 +137,7 @@ ...@@ -113,7 +137,7 @@
113 bottom: 0; 137 bottom: 0;
114 @include ellipsis(2); 138 @include ellipsis(2);
115 139
116 .tit-t1{ 140 .tit-t1 {
117 @extend .bb; 141 @extend .bb;
118 padding: 0 24px; 142 padding: 0 24px;
119 position: relative; 143 position: relative;
......
...@@ -24,28 +24,38 @@ ...@@ -24,28 +24,38 @@
24 </view> 24 </view>
25 <view class="content"> 25 <view class="content">
26 <view class="list"> 26 <view class="list">
27 <view wx:for="{{dataList}}" wx:key="index" class="list-item"> 27 <!-- 拜年item -->
28 <view bindtap="onDetailHandler" data-data="{{item}}" data-index="{{index}}" class="list-item-video"> 28 <block wx:if="{{listType == 2}}">
29 <image class="img" src="{{item.thumbnail}}" mode="aspectFill" /> 29 <view wx:for="{{dataList}}" bindtap="onDetailHandler" data-data="{{item}}" data-index="{{index}}" wx:key="index" class="list-bless-item">
30 <view class="tit"> 30 <image class="poster" src="{{item.thumbnail}}" />
31 <view class="tit-bg"></view> 31 <view class="tit">{{item.blessTitle}}</view>
32 <view class="tit-t1">{{item.videoName}}</view>
33 </view>
34 <div class="play">
35 <span class="iconfont iconplay"></span>
36 </div>
37 </view> 32 </view>
38 <view class="list-item-func"> 33 </block>
39 <view bindtap="onDetailHandler" data-data="{{item}}" data-index="{{index}}" class="user"> 34 <!-- 视频item -->
40 <image class="portrait" mode="aspectFill" src="{{item.headImage}}" /> 35 <block wx:else>
41 <text class="name">{{item.accountName || ""}}</text> 36 <view wx:for="{{dataList}}" wx:key="index" class="list-item">
37 <view bindtap="onDetailHandler" data-data="{{item}}" data-index="{{index}}" class="list-item-video">
38 <image class="img" src="{{item.thumbnail}}" mode="aspectFill" />
39 <view class="tit">
40 <view class="tit-bg"></view>
41 <view class="tit-t1">{{item.videoName}}</view>
42 </view>
43 <div class="play">
44 <span class="iconfont iconplay"></span>
45 </div>
46 </view>
47 <view class="list-item-func">
48 <view bindtap="onDetailHandler" data-data="{{item}}" data-index="{{index}}" class="user">
49 <image class="portrait" mode="aspectFill" src="{{item.headImage}}" />
50 <text class="name">{{item.accountName || ""}}</text>
51 </view>
52 <button data-data="{{item}}" data-index="{{index}}" class="share" open-type="share" bindtap="onShareItem">
53 <span class="t1 iconfont iconwechat"></span>
54 <span class="t1">分享</span>
55 </button>
42 </view> 56 </view>
43 <button data-data="{{item}}" data-index="{{index}}" class="share" open-type="share" bindtap="onShareItem">
44 <span class="t1 iconfont iconwechat"></span>
45 <span class="t1">分享</span>
46 </button>
47 </view> 57 </view>
48 </view> 58 </block>
49 </view> 59 </view>
50 </view> 60 </view>
51 </view> 61 </view>
......