271bf4a4 by simon

默认提交

1 parent 8739c417
......@@ -267,7 +267,6 @@
}
}
// 返回首页按钮
.index-btn {
margin: 60px auto 0;
......
import {
getBindtapData
getBindtapData,
pxToRpx,
getLastScreenHeight
} from '../../utils/util';
let app = getApp();
Page({
data: {
isOverShare: true,
authorizeVisible: false,
total: 0,
page: 1,
size: 10,
dataList: [],
productList: [], // 产品列表
indexInfo: {},
userInfo: {}
userInfo: {},
options: {},
detailData: {},
vidHeight: 0, // 视频高度
isVideoEnded: false,
},
onShareAppMessage() {
let detailData = this.data.detailData;
let title = detailData && detailData.videoName || "";
let path = `pages/detail/detail?c=${detailData.videoCode}`;
let imageUrl = detailData && detailData.thumbnail || "";
return {
title,
path,
imageUrl
}
},
onShareAppMessage() {},
showAuth() {
this.setData({
authorizeVisible: true
})
},
onLoad(options) {},
onLoad(options) {
this.setData({
options
});
this.queryVideoDetail();
this.initData();
},
/**
* 基础方法
* 授权完毕重拉数据用
*/
initData() {
this.queryVideoMore();
},
/**
* 到达底部
* 做加载更多操作
*/
onReachBottom() {
return;
if (this.data.dataList.length < this.data.total) {
this.setData({
page: this.data.page + 1
});
// this.queryDataList();
this.queryVideoMore();
}
},
......@@ -50,24 +75,73 @@ Page({
})
},
/**
* 到个人列表页面
*/
toPersonalList() {
let detailData = this.data.detailData;
if (detailData && detailData.accountCode) {
detailData.c = detailData.accountCode;
app.router.push({
path: "personalList",
query: detailData
})
}
},
/**
* 跳转详情页面
*/
onDetailHandler(evt) {
let curItem = getBindtapData(evt);
app.router.push({
path: "detail",
query: {
c: curItem.videoCode || ""
}
})
},
/**
* 播放完毕
*/
onVideoEndedHandler(evt) {
this.setData({
isVideoEnded: true
})
},
/**
* 重播
*/
onReplayHandler() {
let video = wx.createVideoContext("vid", this);
console.log("video:", video);
video.seek(0);
video.play();
this.setData({
isVideoEnded: false
})
},
/**
* 返回首页
*/
toIndex() {
app.router.push({
path: "personalList",
openType: "reLaunch",
path: "index"
})
},
/**
* 请求DataList
*/
queryDataList() {
queryVideoMore() {
return new Promise((resolve, reject) => {
app.post({
sid: false,
url: app.api.dataList,
url: app.api.videoMore,
data: {
page: this.data.page,
size: this.data.size,
......@@ -75,6 +149,7 @@ Page({
}).then((result) => {
let dataList = result.list;
dataList = this.data.dataList.concat(dataList);
console.log("dataList:", dataList);
this.setData({
dataList: dataList,
total: result.total
......@@ -85,6 +160,41 @@ Page({
},
/**
* 视频详情
*/
queryVideoDetail() {
return new Promise((resolve, reject) => {
app.post({
url: app.api.rewardDetail,
data: {
videoCode: this.data.options.c
}
}).then((result) => {
this.setData({
detailData: result
})
// let {
// width,
// height
// } = result;
// let vidHeight = (height / width) * 750;
// if (vidHeight < 800) {
// vidHeight = 800;
// } else {
// vidHeight = getLastScreenHeight(132);
// }
// this.setData({
// vidHeight: vidHeight,
// });
resolve(result);
}).catch((err) => {
reject(err);
});
});
},
/**
* 隐藏蒙层
*/
hideMask() {
......
......@@ -41,7 +41,7 @@
.vid {
margin: 24px auto 0;
width: 640px;
width: 710px;
border-radius: 16px;
}
}
......@@ -77,10 +77,12 @@
.t1 {
width: 100%;
font-size: 32px;
font-weight: normal;
}
.name {
font-size: 36px;
// font-size: 36px;
}
.num {
......@@ -95,8 +97,9 @@
display: flex;
.btn {
margin-right: 24px;
width: 200px;
// margin-right: 24px;
margin: 0 0;
width: 240px;
height: 80px;
font-size: 32px;
background-color: #3ec03c;
......@@ -112,6 +115,7 @@
.t1 {
padding: 0 6px;
}
&:last-child {
......@@ -124,7 +128,9 @@
color: #7f776e;
}
.btn3 {
background-color: #8d8d8d;
}
}
}
......@@ -134,7 +140,7 @@
@extend .bb;
padding: 0 24px;
font-size: 36px;
margin: 0px auto 24px;
margin: 24px auto 0px;
}
// 广告
......@@ -170,16 +176,16 @@
.tit {
@extend .bb;
padding: 24px 0;
height: 230px;
padding: 8px 0;
height: 180px;
flex: 1;
font-size: 36px;
@include ellipsis(4);
font-size: 40px;
@include ellipsis(3);
}
.poster {
width: 350px;
height: 230px;
height: 180px;
border-radius: 8px;
}
}
......
......@@ -20,12 +20,10 @@
</view>
</view>
<view class="btn-wrap">
<view class="btn btn2">
<!-- <view class="tit">{{item.videoName}}</view> -->
<view class="tit">一家人在一起的时刻</view>
<!-- <view class="btn btn2">
<span>更多推荐</span>
</view>
<!-- <view class="btn">
<span class="t1 iconfont iconhome"></span>
<span>返回首页</span>
</view> -->
</view>
</view>
......@@ -40,14 +38,14 @@
<view class="more">
<view class="more-title">-- 更多推荐欣赏 --</view>
<view class="more-list">
<view wx:for="{{2}}" wx:key="{{index}}" class="more-list-item">
<view class="tit">新政策来了!家有小孩的都要过来看看</view>
<image class="poster" src="https://kd.cdn.xyiyang.com/pro/mzczcradmin/008194acee794506aac4c7200ce654dc.jpg" />
<view bindtap="onDetailHandler" data-data="{{item}}" data-index="{{index}}" wx:for="{{dataList}}" wx:key="{{index}}" class="more-list-item">
<view class="tit">{{item.videoName}}</view>
<image class="poster" src="{{item.thumbnail}}" />
</view>
</view>
</view>
<!-- 返回首页按钮 -->
<view class="index-btn">
<view bindtap="toIndex" class="index-btn">
<span class="t1 iconfont iconhome"></span>
<span>返回首页</span>
</view>
......@@ -58,3 +56,4 @@
<authorize-comp bind:evtcomp="evtcomp"></authorize-comp>
</van-popup>
<!-- <shortcut></shortcut> -->
<shortcut class="red-p" types="{{[]}}" pics="{{['red-package']}}"></shortcut>
......
......@@ -75,18 +75,51 @@ Page({
},
/**
*
* 打赏
*/
onRewardHandler(evt) {
let curItem = getBindtapData(evt);
console.log("curItem:", curItem);
curItem.packet = "ONE_CENT";
app.post({
url: app.api.wxPay,
data: curItem
}).then((result) => {
console.log("wxPay result:", result);
}).catch((err) => {
}).then((res2) => {
console.log("wxPay result:", res2);
wx.requestPayment({
timeStamp: res2.timeStamp + "",
nonceStr: res2.nonceStr,
paySign: res2.paySign,
package: res2.package,
signType: 'MD5',
success(res) {
// console.log("success:", res);
// 支付成功
app.router.push({
path: "rewardCompleted",
query: {
c: "" // orderCode
}
})
},
fail(res) {
console.log("fail:", res);
wx.showModal({
content: '赞赏失败',
showCancel: false,
success(res) {
// if (res.confirm) {
// console.log('用户点击确定')
// } else if (res.cancel) {
// console.log('用户点击取消')
// }
}
})
}
})
}).catch((err) => {
console.log("catch:", err);
});
},
......
{
"navigationBarTitleText": ""
}
......
......@@ -22,29 +22,31 @@
position: relative;
width: 207px;
height: 207px;
margin: 0 auto;
&-bg {
text-align: center;
position: absolute;
width: 207px;
top: -3px;
border-radius: 50%;
// top: -3px;
}
// 头像
.avatar {
margin: 0 auto;
position: relative;
display: block;
width: 201px;
height: 201px;
border-radius: 50%;
overflow: hidden
}
// .avatar {
// margin: 0 auto;
// position: relative;
// display: block;
// width: 201px;
// height: 201px;
// border-radius: 50%;
// overflow: hidden
// }
.avatar-avatar::after {
border-radius: 205px;
}
// .avatar-avatar::after {
// border-radius: 205px;
// }
}
.reward {
......
......@@ -6,7 +6,7 @@
<view class="top-space"></view>
<view class="content">
<view class="portrait">
<image class="portrait-bg" mode="widthFix" src="../../image/reward/reward-portrait-bg.png" />
<image class="portrait-bg" mode="widthFix" src="../../image/logo.jpeg" />
<!-- <open-data class="avatar" type="userAvatarUrl"></open-data> -->
</view>
<view class="reward">
......