作者 刘晓艳

修改会员模式

... ... @@ -273,15 +273,15 @@ Page({
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
onShow: function (options) {
let that = this;
that.getFuxiInfo();
if (options.page == 1) {
for (var i = 0; i < 8; i++) {
that.dateLater(temdata_i);
that.dateLater1(temdata_i1);
}
}
// if (options.page == 1) {
// for (var i = 0; i < 8; i++) {
// that.dateLater(temdata_i);
// that.dateLater1(temdata_i1);
// }
// }
},
/**
... ...
... ... @@ -7,10 +7,12 @@
justify-content: space-between;
padding: 0 20rpx;
}
.label_box {
display: flex;
align-items: center;
}
.label_item {
width: 120rpx;
height: 40rpx;
... ... @@ -23,6 +25,7 @@
justify-content: center;
margin-right: 20rpx;
}
.info {
font-size: 28rpx;
color: #1db9fa;
... ... @@ -33,10 +36,11 @@
margin-top: 6rpx;
margin-right: 17rpx;
}
.content_itembox{
.content_itembox {
height: 70%;
overflow:scroll;
padding:0 0 100rpx 0;
overflow: scroll;
padding: 0 0 100rpx 0;
}
.item_content {
... ... @@ -73,11 +77,17 @@
}
.mask_box {
width: 100%;
height: 121%;
font-size: 30rpx;
color: #ccc;
background: #fff;
text-align: center;
margin-top: 220rpx;
top: 544rpx;
position: fixed;
left: 0;
/* z-index: 50; */
padding-top: 235rpx;
}
.icon-dianji {
... ... @@ -94,12 +104,12 @@
background: #fafafa;
}
.item_box {
padding: 0 50rpx;
/* height: 50%;
overflow: scroll; */
}
.item_list {
background: rgba(255, 255, 255, 1);
border-radius: 20rpx;
... ... @@ -138,13 +148,14 @@
bottom: 0;
left: 0;
padding: 0 40rpx;
z-index: 999;
}
.btn {
width: 192rpx;
height: 60rpx;
font-size: 30rpx;
color: #FFFFFF;
color: #fff;
border: 1rpx solid rgba(255, 255, 255, 1);
border-radius: 10rpx;
display: flex;
... ...
... ... @@ -6,28 +6,42 @@ Page({
* 页面的初始数据
*/
data: {
page: 0,//0默认,1显示示意
page: 0, //0默认,1显示示意
moudel: false,
listdata: [],//单词详情数据
myplan_detail_id:'',//下一题id
handle_myplan_detail_id:'',//本题的id
myplan_id:'',
starttime:'',
listdata: [], //单词详情数据
myplan_detail_id: '', //下一题id
handle_myplan_detail_id: '', //本题的id
myplan_id: '',
starttime: '',
endtime: '',
if_time: ''
if_time: '',
mask_state:true,
},
//显示释义
showParaphrase() {
this.setData({
page: 1,
mask_state:false
})
},
//单词分批处理
handleWords(e) {
console.log(e);
let that = this;
var plannum = e.currentTarget.dataset.plannum
if (plannum != -1) {
console.log(22)
that.handleWordsError(e.currentTarget.dataset.status);
this.setData({
mask_state:true
})
} else {
wx.showToast({
title: '已完成复习',
icon: 'none'
})
}
},
//播放音频
audioPlay(e) {
... ... @@ -72,27 +86,27 @@ Page({
handle_myplan_detail_id: res.data.data.handle_myplan_detail_id
})
}
}else if(res.data.code==0){
} else if (res.data.code == 0) {
wx.showToast({
title: res.data.msg,
icon: 'success',
duration: 2000,
})
setTimeout(function(){
setTimeout(function() {
wx.switchTab({
url: '/pages/MemorizingWords/MemorizingWords',
})
},2000)
}, 2000)
}
}).catch((errMsg) => {
console.log(errMsg)
})
},
//获取复习界面单词详情(按时间)
getTimeWordsDetail(){
let that=this;
let url ='Words/getTimeWordsDetail';
let params={
getTimeWordsDetail() {
let that = this;
let url = 'Words/getTimeWordsDetail';
let params = {
token: wx.getStorageSync('token'),
start_time: that.data.starttime,
end_time: that.data.endtime,
... ... @@ -122,7 +136,7 @@ Page({
icon: 'success',
duration: 2000,
})
setTimeout(function () {
setTimeout(function() {
wx.switchTab({
url: '/pages/MemorizingWords/MemorizingWords',
})
... ... @@ -133,39 +147,47 @@ Page({
})
},
//处理错词
handleWordsError(status){
let that=this;
let url ='Words/handleWordsError';
let params={
handleWordsError(status) {
let that = this;
let url = 'Words/handleWordsError';
let params = {
id: that.data.handle_myplan_detail_id,
status: status
}
app.post(url,params).then((res)=>{
if(res.data.code=='1'){
if (that.data.if_time){
app.post(url, params).then((res) => {
console.log(222)
console.log('aa',res)
if (res.data.code == '1') {
console.log(11)
if (that.data.if_time) {
that.getTimeWordsDetail();
}else{
} else {
that.getPackageDetailInfo();
}
} else if (res.data.code == '0'){
console.log(333)
wx.showToast({
title: '加载中',
icon:'none'
})
}
}).catch((errMsg)=>{
}).catch((errMsg) => {
console.log(errMsg)
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
let that=this;
if (options.id.length !=0 ){
onLoad: function(options) {
let that = this;
if (options.id.length != 0) {
that.setData({
myplan_id: options.id,
if_time:false
if_time: false
})
that.getPackageDetailInfo();
}
if (options.starttime.length !=0){
if (options.starttime.length != 0) {
that.setData({
starttime: options.starttime,
endtime: options.endtime,
... ... @@ -179,49 +201,49 @@ Page({
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
onReady: function() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
onShow: function() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
onHide: function() {
innerAudioContext.stop()
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
onUnload: function() {
innerAudioContext.stop()
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
onPullDownRefresh: function() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
onReachBottom: function() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
onShareAppMessage: function() {
}
})
\ No newline at end of file
... ...
<!--pages/MemorizingWords/wordsDetail_review/wordsDetail_review.wxml-->
<!--pages/MemorizingWords/wordsDetail/wordsDetail.wxml-->
<view class='null_box'></view>
<view class='null_box'>
</view>
<view class='content_box'>
<view class='banner_box'>
<view class='label_box'>
... ... @@ -28,11 +27,15 @@
</view>
<view class='paraphrase'>{{listdata.info.explain}}</view>
</view>
<view class='mask_box' bindtap='showParaphrase'>
<view class='mask_box' wx:if='{{mask_state}}' bindtap='showParaphrase'>
<view class='iconfont icon-dianji'></view>
<view>点击屏幕显示释义</view>
</view>
<view class='bottom_btn'>
<view class='btn' data-status='1' bindtap='handleWords' data-plannum='{{listdata.myplan_detail_id}}'>认识</view>
<view class='btn' data-status='2' bindtap='handleWords' data-plannum='{{listdata.myplan_detail_id}}'>不认识</view>
<view class='btn' data-status='3' bindtap='handleWords' data-plannum='{{listdata.myplan_detail_id}}'>忘记</view>
</view>
</view>
<block wx:if='{{page==1}}'>
... ... @@ -64,11 +67,16 @@
</view>
</view>
</view>
<view class='bottom_btn'>
<view class='btn' data-status='1' bindtap='handleWords'>认识</view>
<view class='btn' data-status='2' bindtap='handleWords'>不认识</view>
<view class='btn' data-status='3' bindtap='handleWords'>忘记</view>
<view class='bottom_btn'>
<view class='btn' data-status='1' bindtap='handleWords' data-plannum='{{listdata.myplan_detail_id}}'>认识</view>
<view class='btn' data-status='2' bindtap='handleWords' data-plannum='{{listdata.myplan_detail_id}}'>不认识</view>
<view class='btn' data-status='3' bindtap='handleWords' data-plannum='{{listdata.myplan_detail_id}}'>忘记</view>
</view>
<view class='mask_box' wx:if='{{mask_state}}' bindtap='showParaphrase'>
<view class='iconfont icon-dianji'></view>
<view>点击屏幕显示释义</view>
</view>
</view>
</block>
\ No newline at end of file
... ...
... ... @@ -70,11 +70,19 @@
}
.mask_box {
width: 100%;
height: 121%;
font-size: 30rpx;
color: #ccc;
background: #fff;
text-align: center;
margin-top: 220rpx;
position: fixed;
left: 0;
top: 544rpx;
/* border: 1rpx solid red; */
/* z-index: 50; */
padding-top: 235rpx;
}
.icon-dianji {
... ... @@ -133,13 +141,14 @@
bottom: 0;
left: 0;
padding: 0 40rpx;
z-index: 999;
}
.btn {
width: 192rpx;
height: 60rpx;
font-size: 30rpx;
color: #FFFFFF;
color: #fff;
border: 1rpx solid rgba(255, 255, 255, 1);
border-radius: 10rpx;
display: flex;
... ...
... ... @@ -45,26 +45,24 @@ Page({
console.log(1);
let that=this;
let myinfo = that.data.myinfo;
if (that.data.myinfo.is_member){
console.log('1111111111111')
}else{
console.log('222222222222222');
that.videoContext.pause()
wx.showModal({
title: '提示',
content: '您还不是会员,不能观看,是否开通',
success:function(res){
if(res.confirm){
that.setData({
// state:1
temshow: true
})
}else if(res.cancel){
// if (that.data.myinfo.is_member){
// }else{
// that.videoContext.pause()
// wx.showModal({
// title: '提示',
// content: '您还不是会员,不能观看,是否开通',
// success:function(res){
// if(res.confirm){
// that.setData({
}
}
})
}
// temshow: true
// })
// }else if(res.cancel){
// }
// }
// })
// }
},
//获取个人信息判断是否开通会员
getMyMessage() {
... ...
... ... @@ -63,25 +63,25 @@ Page({
videoplay() {
let that = this;
let myinfo = that.data.myinfo;
if (that.data.myinfo.is_member) {
console.log('1111111111111111');
} else {
console.log('2222222222222222222');
that.videoContext.pause()
wx.showModal({
title: '提示',
content: '您还不是会员,不能观看,是否开通',
success: function (res) {
if (res.confirm) {
that.setData({
// state:1
temshow:true
})
} else if (res.cancel) {
}
}
})
}
// if (that.data.myinfo.is_member) {
// console.log('1111111111111111');
// } else {
// console.log('2222222222222222222');
// that.videoContext.pause()
// wx.showModal({
// title: '提示',
// content: '您还不是会员,不能观看,是否开通',
// success: function (res) {
// if (res.confirm) {
// that.setData({
// // state:1
// temshow:true
// })
// } else if (res.cancel) {
// }
// }
// })
// }
},
setstate0() {
... ...
... ... @@ -19,7 +19,7 @@
</view>
</view>
<view class='laber_box'>
<view class='laber' bindtap='openVip'>{{listdata.is_member?'续费':'点击开通会员'}}</view>
<!-- <view class='laber' bindtap='openVip'>{{listdata.is_member?'续费':'点击开通会员'}}</view> -->
<view class='laber' bindtap='gocontact'>联系我们</view>
</view>
... ...