作者 刘晓艳

修改会员模式

@@ -273,15 +273,15 @@ Page({ @@ -273,15 +273,15 @@ Page({
273 /** 273 /**
274 * 生命周期函数--监听页面显示 274 * 生命周期函数--监听页面显示
275 */ 275 */
276 - onShow: function () { 276 + onShow: function (options) {
277 let that = this; 277 let that = this;
278 that.getFuxiInfo(); 278 that.getFuxiInfo();
279 - if (options.page == 1) {  
280 - for (var i = 0; i < 8; i++) {  
281 - that.dateLater(temdata_i);  
282 - that.dateLater1(temdata_i1);  
283 - }  
284 - } 279 + // if (options.page == 1) {
  280 + // for (var i = 0; i < 8; i++) {
  281 + // that.dateLater(temdata_i);
  282 + // that.dateLater1(temdata_i1);
  283 + // }
  284 + // }
285 }, 285 },
286 286
287 /** 287 /**
@@ -7,10 +7,12 @@ @@ -7,10 +7,12 @@
7 justify-content: space-between; 7 justify-content: space-between;
8 padding: 0 20rpx; 8 padding: 0 20rpx;
9 } 9 }
  10 +
10 .label_box { 11 .label_box {
11 display: flex; 12 display: flex;
12 align-items: center; 13 align-items: center;
13 } 14 }
  15 +
14 .label_item { 16 .label_item {
15 width: 120rpx; 17 width: 120rpx;
16 height: 40rpx; 18 height: 40rpx;
@@ -23,6 +25,7 @@ @@ -23,6 +25,7 @@
23 justify-content: center; 25 justify-content: center;
24 margin-right: 20rpx; 26 margin-right: 20rpx;
25 } 27 }
  28 +
26 .info { 29 .info {
27 font-size: 28rpx; 30 font-size: 28rpx;
28 color: #1db9fa; 31 color: #1db9fa;
@@ -33,10 +36,11 @@ @@ -33,10 +36,11 @@
33 margin-top: 6rpx; 36 margin-top: 6rpx;
34 margin-right: 17rpx; 37 margin-right: 17rpx;
35 } 38 }
36 -.content_itembox{ 39 +
  40 +.content_itembox {
37 height: 70%; 41 height: 70%;
38 - overflow:scroll;  
39 - padding:0 0 100rpx 0; 42 + overflow: scroll;
  43 + padding: 0 0 100rpx 0;
40 } 44 }
41 45
42 .item_content { 46 .item_content {
@@ -73,11 +77,17 @@ @@ -73,11 +77,17 @@
73 } 77 }
74 78
75 .mask_box { 79 .mask_box {
  80 + width: 100%;
  81 + height: 121%;
76 font-size: 30rpx; 82 font-size: 30rpx;
77 color: #ccc; 83 color: #ccc;
78 background: #fff; 84 background: #fff;
79 text-align: center; 85 text-align: center;
80 - margin-top: 220rpx; 86 + top: 544rpx;
  87 + position: fixed;
  88 + left: 0;
  89 + /* z-index: 50; */
  90 + padding-top: 235rpx;
81 } 91 }
82 92
83 .icon-dianji { 93 .icon-dianji {
@@ -94,12 +104,12 @@ @@ -94,12 +104,12 @@
94 background: #fafafa; 104 background: #fafafa;
95 } 105 }
96 106
97 -  
98 .item_box { 107 .item_box {
99 padding: 0 50rpx; 108 padding: 0 50rpx;
100 /* height: 50%; 109 /* height: 50%;
101 overflow: scroll; */ 110 overflow: scroll; */
102 } 111 }
  112 +
103 .item_list { 113 .item_list {
104 background: rgba(255, 255, 255, 1); 114 background: rgba(255, 255, 255, 1);
105 border-radius: 20rpx; 115 border-radius: 20rpx;
@@ -138,16 +148,17 @@ @@ -138,16 +148,17 @@
138 bottom: 0; 148 bottom: 0;
139 left: 0; 149 left: 0;
140 padding: 0 40rpx; 150 padding: 0 40rpx;
  151 + z-index: 999;
141 } 152 }
142 153
143 .btn { 154 .btn {
144 width: 192rpx; 155 width: 192rpx;
145 height: 60rpx; 156 height: 60rpx;
146 font-size: 30rpx; 157 font-size: 30rpx;
147 - color: #FFFFFF; 158 + color: #fff;
148 border: 1rpx solid rgba(255, 255, 255, 1); 159 border: 1rpx solid rgba(255, 255, 255, 1);
149 border-radius: 10rpx; 160 border-radius: 10rpx;
150 - display: flex; 161 + display: flex;
151 align-items: center; 162 align-items: center;
152 justify-content: center; 163 justify-content: center;
153 } 164 }
@@ -6,28 +6,42 @@ Page({ @@ -6,28 +6,42 @@ Page({
6 * 页面的初始数据 6 * 页面的初始数据
7 */ 7 */
8 data: { 8 data: {
9 - page: 0,//0默认,1显示示意 9 + page: 0, //0默认,1显示示意
10 moudel: false, 10 moudel: false,
11 - listdata: [],//单词详情数据  
12 - myplan_detail_id:'',//下一题id  
13 - handle_myplan_detail_id:'',//本题的id  
14 - myplan_id:'',  
15 - starttime:'', 11 + listdata: [], //单词详情数据
  12 + myplan_detail_id: '', //下一题id
  13 + handle_myplan_detail_id: '', //本题的id
  14 + myplan_id: '',
  15 + starttime: '',
16 endtime: '', 16 endtime: '',
17 - if_time: '' 17 + if_time: '',
  18 + mask_state:true,
18 }, 19 },
19 20
20 //显示释义 21 //显示释义
21 showParaphrase() { 22 showParaphrase() {
22 this.setData({ 23 this.setData({
23 page: 1, 24 page: 1,
  25 + mask_state:false
24 }) 26 })
25 }, 27 },
26 //单词分批处理 28 //单词分批处理
27 handleWords(e) { 29 handleWords(e) {
28 console.log(e); 30 console.log(e);
29 let that = this; 31 let that = this;
30 - that.handleWordsError(e.currentTarget.dataset.status); 32 + var plannum = e.currentTarget.dataset.plannum
  33 + if (plannum != -1) {
  34 + console.log(22)
  35 + that.handleWordsError(e.currentTarget.dataset.status);
  36 + this.setData({
  37 + mask_state:true
  38 + })
  39 + } else {
  40 + wx.showToast({
  41 + title: '已完成复习',
  42 + icon: 'none'
  43 + })
  44 + }
31 }, 45 },
32 //播放音频 46 //播放音频
33 audioPlay(e) { 47 audioPlay(e) {
@@ -72,100 +86,108 @@ Page({ @@ -72,100 +86,108 @@ Page({
72 handle_myplan_detail_id: res.data.data.handle_myplan_detail_id 86 handle_myplan_detail_id: res.data.data.handle_myplan_detail_id
73 }) 87 })
74 } 88 }
75 - }else if(res.data.code==0){ 89 + } else if (res.data.code == 0) {
76 wx.showToast({ 90 wx.showToast({
77 title: res.data.msg, 91 title: res.data.msg,
78 icon: 'success', 92 icon: 'success',
79 duration: 2000, 93 duration: 2000,
80 }) 94 })
81 - setTimeout(function(){ 95 + setTimeout(function() {
82 wx.switchTab({ 96 wx.switchTab({
83 url: '/pages/MemorizingWords/MemorizingWords', 97 url: '/pages/MemorizingWords/MemorizingWords',
84 }) 98 })
85 - },2000) 99 + }, 2000)
86 } 100 }
87 }).catch((errMsg) => { 101 }).catch((errMsg) => {
88 console.log(errMsg) 102 console.log(errMsg)
89 }) 103 })
90 }, 104 },
91 //获取复习界面单词详情(按时间) 105 //获取复习界面单词详情(按时间)
92 - getTimeWordsDetail(){  
93 - let that=this;  
94 - let url ='Words/getTimeWordsDetail';  
95 - let params={  
96 - token: wx.getStorageSync('token'),  
97 - start_time: that.data.starttime,  
98 - end_time: that.data.endtime,  
99 - myplan_detail_id: that.data.myplan_detail_id  
100 - }  
101 - app.post(url, params).then((res) => {  
102 - if (res.data.code == 1) {  
103 - if (res.data.data == '') {  
104 - wx.showToast({  
105 - title: res.data.msg,  
106 - icon: 'success',  
107 - duration: 2000,  
108 - })  
109 - wx.navigateTo({  
110 - url: '../wordsReport/wordsReport',  
111 - })  
112 - } else {  
113 - that.setData({  
114 - listdata: res.data.data,  
115 - myplan_detail_id: res.data.data.myplan_detail_id,  
116 - handle_myplan_detail_id: res.data.data.handle_myplan_detail_id  
117 - })  
118 - }  
119 - } else if (res.data.code == 0) {  
120 - wx.showToast({  
121 - title: res.data.msg,  
122 - icon: 'success',  
123 - duration: 2000,  
124 - })  
125 - setTimeout(function () {  
126 - wx.switchTab({  
127 - url: '/pages/MemorizingWords/MemorizingWords',  
128 - })  
129 - }, 2000)  
130 - }  
131 - }).catch((errMsg) => {  
132 - console.log(errMsg)  
133 - })  
134 - },  
135 - //处理错词  
136 - handleWordsError(status){  
137 - let that=this;  
138 - let url ='Words/handleWordsError';  
139 - let params={ 106 + getTimeWordsDetail() {
  107 + let that = this;
  108 + let url = 'Words/getTimeWordsDetail';
  109 + let params = {
  110 + token: wx.getStorageSync('token'),
  111 + start_time: that.data.starttime,
  112 + end_time: that.data.endtime,
  113 + myplan_detail_id: that.data.myplan_detail_id
  114 + }
  115 + app.post(url, params).then((res) => {
  116 + if (res.data.code == 1) {
  117 + if (res.data.data == '') {
  118 + wx.showToast({
  119 + title: res.data.msg,
  120 + icon: 'success',
  121 + duration: 2000,
  122 + })
  123 + wx.navigateTo({
  124 + url: '../wordsReport/wordsReport',
  125 + })
  126 + } else {
  127 + that.setData({
  128 + listdata: res.data.data,
  129 + myplan_detail_id: res.data.data.myplan_detail_id,
  130 + handle_myplan_detail_id: res.data.data.handle_myplan_detail_id
  131 + })
  132 + }
  133 + } else if (res.data.code == 0) {
  134 + wx.showToast({
  135 + title: res.data.msg,
  136 + icon: 'success',
  137 + duration: 2000,
  138 + })
  139 + setTimeout(function() {
  140 + wx.switchTab({
  141 + url: '/pages/MemorizingWords/MemorizingWords',
  142 + })
  143 + }, 2000)
  144 + }
  145 + }).catch((errMsg) => {
  146 + console.log(errMsg)
  147 + })
  148 + },
  149 + //处理错词
  150 + handleWordsError(status) {
  151 + let that = this;
  152 + let url = 'Words/handleWordsError';
  153 + let params = {
140 id: that.data.handle_myplan_detail_id, 154 id: that.data.handle_myplan_detail_id,
141 status: status 155 status: status
142 } 156 }
143 - app.post(url,params).then((res)=>{  
144 -  
145 - if(res.data.code=='1'){  
146 - if (that.data.if_time){ 157 + app.post(url, params).then((res) => {
  158 + console.log(222)
  159 + console.log('aa',res)
  160 + if (res.data.code == '1') {
  161 + console.log(11)
  162 + if (that.data.if_time) {
147 that.getTimeWordsDetail(); 163 that.getTimeWordsDetail();
148 - }else{  
149 - that.getPackageDetailInfo();  
150 - } 164 + } else {
  165 + that.getPackageDetailInfo();
151 } 166 }
152 - }).catch((errMsg)=>{ 167 + } else if (res.data.code == '0'){
  168 + console.log(333)
  169 + wx.showToast({
  170 + title: '加载中',
  171 + icon:'none'
  172 + })
  173 + }
  174 + }).catch((errMsg) => {
153 console.log(errMsg) 175 console.log(errMsg)
154 }) 176 })
155 }, 177 },
156 /** 178 /**
157 * 生命周期函数--监听页面加载 179 * 生命周期函数--监听页面加载
158 */ 180 */
159 - onLoad: function (options) {  
160 - let that=this;  
161 - if (options.id.length !=0 ){ 181 + onLoad: function(options) {
  182 + let that = this;
  183 + if (options.id.length != 0) {
162 that.setData({ 184 that.setData({
163 myplan_id: options.id, 185 myplan_id: options.id,
164 - if_time:false 186 + if_time: false
165 }) 187 })
166 that.getPackageDetailInfo(); 188 that.getPackageDetailInfo();
167 } 189 }
168 - if (options.starttime.length !=0){ 190 + if (options.starttime.length != 0) {
169 that.setData({ 191 that.setData({
170 starttime: options.starttime, 192 starttime: options.starttime,
171 endtime: options.endtime, 193 endtime: options.endtime,
@@ -173,55 +195,55 @@ Page({ @@ -173,55 +195,55 @@ Page({
173 }) 195 })
174 that.getTimeWordsDetail(); 196 that.getTimeWordsDetail();
175 } 197 }
176 - 198 +
177 }, 199 },
178 200
179 /** 201 /**
180 * 生命周期函数--监听页面初次渲染完成 202 * 生命周期函数--监听页面初次渲染完成
181 */ 203 */
182 - onReady: function () { 204 + onReady: function() {
183 205
184 }, 206 },
185 207
186 /** 208 /**
187 * 生命周期函数--监听页面显示 209 * 生命周期函数--监听页面显示
188 */ 210 */
189 - onShow: function () { 211 + onShow: function() {
190 212
191 }, 213 },
192 214
193 /** 215 /**
194 * 生命周期函数--监听页面隐藏 216 * 生命周期函数--监听页面隐藏
195 */ 217 */
196 - onHide: function () { 218 + onHide: function() {
197 innerAudioContext.stop() 219 innerAudioContext.stop()
198 }, 220 },
199 221
200 /** 222 /**
201 * 生命周期函数--监听页面卸载 223 * 生命周期函数--监听页面卸载
202 */ 224 */
203 - onUnload: function () { 225 + onUnload: function() {
204 innerAudioContext.stop() 226 innerAudioContext.stop()
205 }, 227 },
206 228
207 /** 229 /**
208 * 页面相关事件处理函数--监听用户下拉动作 230 * 页面相关事件处理函数--监听用户下拉动作
209 */ 231 */
210 - onPullDownRefresh: function () { 232 + onPullDownRefresh: function() {
211 233
212 }, 234 },
213 235
214 /** 236 /**
215 * 页面上拉触底事件的处理函数 237 * 页面上拉触底事件的处理函数
216 */ 238 */
217 - onReachBottom: function () { 239 + onReachBottom: function() {
218 240
219 }, 241 },
220 242
221 /** 243 /**
222 * 用户点击右上角分享 244 * 用户点击右上角分享
223 */ 245 */
224 - onShareAppMessage: function () { 246 + onShareAppMessage: function() {
225 247
226 } 248 }
227 }) 249 })
1 -<!--pages/MemorizingWords/wordsDetail_review/wordsDetail_review.wxml-->  
2 -<!--pages/MemorizingWords/wordsDetail/wordsDetail.wxml-->  
3 -<view class='null_box'></view> 1 +<view class='null_box'>
  2 +</view>
4 <view class='content_box'> 3 <view class='content_box'>
5 <view class='banner_box'> 4 <view class='banner_box'>
6 <view class='label_box'> 5 <view class='label_box'>
@@ -28,11 +27,15 @@ @@ -28,11 +27,15 @@
28 </view> 27 </view>
29 <view class='paraphrase'>{{listdata.info.explain}}</view> 28 <view class='paraphrase'>{{listdata.info.explain}}</view>
30 </view> 29 </view>
31 -  
32 - <view class='mask_box' bindtap='showParaphrase'> 30 + <view class='mask_box' wx:if='{{mask_state}}' bindtap='showParaphrase'>
33 <view class='iconfont icon-dianji'></view> 31 <view class='iconfont icon-dianji'></view>
34 <view>点击屏幕显示释义</view> 32 <view>点击屏幕显示释义</view>
35 </view> 33 </view>
  34 + <view class='bottom_btn'>
  35 + <view class='btn' data-status='1' bindtap='handleWords' data-plannum='{{listdata.myplan_detail_id}}'>认识</view>
  36 + <view class='btn' data-status='2' bindtap='handleWords' data-plannum='{{listdata.myplan_detail_id}}'>不认识</view>
  37 + <view class='btn' data-status='3' bindtap='handleWords' data-plannum='{{listdata.myplan_detail_id}}'>忘记</view>
  38 + </view>
36 </view> 39 </view>
37 40
38 <block wx:if='{{page==1}}'> 41 <block wx:if='{{page==1}}'>
@@ -59,16 +62,21 @@ @@ -59,16 +62,21 @@
59 <view class='item_list'> 62 <view class='item_list'>
60 <view class='title'>近义词</view> 63 <view class='title'>近义词</view>
61 <view class='list_content'> 64 <view class='list_content'>
62 - 65 +
63 <view>{{listdata.info.jinyici}}</view> 66 <view>{{listdata.info.jinyici}}</view>
64 </view> 67 </view>
65 </view> 68 </view>
66 </view> 69 </view>
  70 +
67 <view class='bottom_btn'> 71 <view class='bottom_btn'>
68 - <view class='btn' data-status='1' bindtap='handleWords'>认识</view>  
69 - <view class='btn' data-status='2' bindtap='handleWords'>不认识</view>  
70 - <view class='btn' data-status='3' bindtap='handleWords'>忘记</view>  
71 - 72 + <view class='btn' data-status='1' bindtap='handleWords' data-plannum='{{listdata.myplan_detail_id}}'>认识</view>
  73 + <view class='btn' data-status='2' bindtap='handleWords' data-plannum='{{listdata.myplan_detail_id}}'>不认识</view>
  74 + <view class='btn' data-status='3' bindtap='handleWords' data-plannum='{{listdata.myplan_detail_id}}'>忘记</view>
  75 + </view>
  76 + <view class='mask_box' wx:if='{{mask_state}}' bindtap='showParaphrase'>
  77 + <view class='iconfont icon-dianji'></view>
  78 + <view>点击屏幕显示释义</view>
72 </view> 79 </view>
73 </view> 80 </view>
74 -</block> 81 +
  82 +</block>
@@ -70,11 +70,19 @@ @@ -70,11 +70,19 @@
70 } 70 }
71 71
72 .mask_box { 72 .mask_box {
  73 + width: 100%;
  74 + height: 121%;
73 font-size: 30rpx; 75 font-size: 30rpx;
74 color: #ccc; 76 color: #ccc;
75 background: #fff; 77 background: #fff;
76 text-align: center; 78 text-align: center;
77 - margin-top: 220rpx; 79 +
  80 + position: fixed;
  81 + left: 0;
  82 + top: 544rpx;
  83 + /* border: 1rpx solid red; */
  84 + /* z-index: 50; */
  85 + padding-top: 235rpx;
78 } 86 }
79 87
80 .icon-dianji { 88 .icon-dianji {
@@ -133,16 +141,17 @@ @@ -133,16 +141,17 @@
133 bottom: 0; 141 bottom: 0;
134 left: 0; 142 left: 0;
135 padding: 0 40rpx; 143 padding: 0 40rpx;
  144 + z-index: 999;
136 } 145 }
137 146
138 .btn { 147 .btn {
139 width: 192rpx; 148 width: 192rpx;
140 height: 60rpx; 149 height: 60rpx;
141 font-size: 30rpx; 150 font-size: 30rpx;
142 - color: #FFFFFF; 151 + color: #fff;
143 border: 1rpx solid rgba(255, 255, 255, 1); 152 border: 1rpx solid rgba(255, 255, 255, 1);
144 border-radius: 10rpx; 153 border-radius: 10rpx;
145 - display: flex; 154 + display: flex;
146 align-items: center; 155 align-items: center;
147 justify-content: center; 156 justify-content: center;
148 } 157 }
@@ -45,26 +45,24 @@ Page({ @@ -45,26 +45,24 @@ Page({
45 console.log(1); 45 console.log(1);
46 let that=this; 46 let that=this;
47 let myinfo = that.data.myinfo; 47 let myinfo = that.data.myinfo;
48 - if (that.data.myinfo.is_member){  
49 -console.log('1111111111111')  
50 - }else{  
51 - console.log('222222222222222');  
52 - that.videoContext.pause()  
53 - wx.showModal({  
54 - title: '提示',  
55 - content: '您还不是会员,不能观看,是否开通',  
56 - success:function(res){  
57 - if(res.confirm){  
58 - that.setData({  
59 - // state:1  
60 - temshow: true  
61 - })  
62 - }else if(res.cancel){ 48 + // if (that.data.myinfo.is_member){
  49 + // }else{
  50 + // that.videoContext.pause()
  51 + // wx.showModal({
  52 + // title: '提示',
  53 + // content: '您还不是会员,不能观看,是否开通',
  54 + // success:function(res){
  55 + // if(res.confirm){
  56 + // that.setData({
  57 +
  58 + // temshow: true
  59 + // })
  60 + // }else if(res.cancel){
63 61
64 - }  
65 - }  
66 - })  
67 - } 62 + // }
  63 + // }
  64 + // })
  65 + // }
68 }, 66 },
69 //获取个人信息判断是否开通会员 67 //获取个人信息判断是否开通会员
70 getMyMessage() { 68 getMyMessage() {
@@ -63,25 +63,25 @@ Page({ @@ -63,25 +63,25 @@ Page({
63 videoplay() { 63 videoplay() {
64 let that = this; 64 let that = this;
65 let myinfo = that.data.myinfo; 65 let myinfo = that.data.myinfo;
66 - if (that.data.myinfo.is_member) {  
67 - console.log('1111111111111111');  
68 - } else {  
69 - console.log('2222222222222222222');  
70 - that.videoContext.pause()  
71 - wx.showModal({  
72 - title: '提示',  
73 - content: '您还不是会员,不能观看,是否开通',  
74 - success: function (res) {  
75 - if (res.confirm) {  
76 - that.setData({  
77 - // state:1  
78 - temshow:true  
79 - })  
80 - } else if (res.cancel) {  
81 - }  
82 - }  
83 - })  
84 - } 66 + // if (that.data.myinfo.is_member) {
  67 + // console.log('1111111111111111');
  68 + // } else {
  69 + // console.log('2222222222222222222');
  70 + // that.videoContext.pause()
  71 + // wx.showModal({
  72 + // title: '提示',
  73 + // content: '您还不是会员,不能观看,是否开通',
  74 + // success: function (res) {
  75 + // if (res.confirm) {
  76 + // that.setData({
  77 + // // state:1
  78 + // temshow:true
  79 + // })
  80 + // } else if (res.cancel) {
  81 + // }
  82 + // }
  83 + // })
  84 + // }
85 85
86 }, 86 },
87 setstate0() { 87 setstate0() {
@@ -19,7 +19,7 @@ @@ -19,7 +19,7 @@
19 </view> 19 </view>
20 </view> 20 </view>
21 <view class='laber_box'> 21 <view class='laber_box'>
22 - <view class='laber' bindtap='openVip'>{{listdata.is_member?'续费':'点击开通会员'}}</view> 22 + <!-- <view class='laber' bindtap='openVip'>{{listdata.is_member?'续费':'点击开通会员'}}</view> -->
23 <view class='laber' bindtap='gocontact'>联系我们</view> 23 <view class='laber' bindtap='gocontact'>联系我们</view>
24 </view> 24 </view>
25 25