作者 liaolinfeng

开发完成

正在显示 100 个修改的文件 包含 4319 行增加0 行删除

要显示太多修改。

为保证性能只显示 100 of 100+ 个文件。

//app.js
App({
post(url, data) {
/**
* 自定义post函数,返回Promise
* +-------------------
* @param {String} url 接口网址
* @param {arrayObject} data 要传的数组对象 like: {name: 'name', age: 32}
* +-------------------
* @return {Promise} promise 返回promise供后续操作
*/
wx.showNavigationBarLoading()
wx.showLoading({
title: '加载中',
})
var promise = new Promise((resolve, reject) => {
let that = this;
let postData = data;
// let baseurl = 'http://ewords.w.bronet.cn/portal/';//仅为测试地址
let baseurl = 'https://smallpro.igmat.cn/portal/'
//发起网络请求
wx.request({
url: baseurl + url,
data: postData,
method: 'POST',
header: {
'content-type': 'application/x-www-form-urlencoded'
},
success: function(res) {
//返回取得的数据
if (res.data.code == 1) {
resolve(res);
setTimeout(function() {
wx.hideLoading()
}, 600)
wx.hideNavigationBarLoading()
} else if (res.data.code == '40000') {
wx.showModal({
title: '提示',
content: '登陆超时,请重新登陆',
showCancel: false,
success: function(res) {
if (res.confirm) {
wx.navigateTo({
url: '/pages/star/star',
})
}
}
})
}
},
error: function(e) {
reject("网络错误");
wx.hideLoading();
wx.hideNavigationBarLoading();
wx.showModal({
title: '提示',
content: res.data.msg,
showCancel: false
})
}
})
})
wx.hideLoading();
return promise;
},
globalData: {
userInfo: null,
}
})
\ No newline at end of file
... ...
{
"pages": [
"pages/star/star",
"pages/index/index",
"pages/MemorizingWords/reviewWordsDetail/reviewWordsDetail",
"pages/MemorizingWords/MemorizingWords",
"pages/MemorizingWords/wordsReport/wordsReport",
"pages/MemorizingWords/wordsPlan/wordsPlan",
"pages/MemorizingWords/wordsDetail/wordsDetail",
"pages/MemorizingWords/reviewWords/reviewWords",
"pages/index/goldDetail/goldDetail",
"pages/index/boy/boy",
"pages/index/goldArticle/goldArticle",
"pages/my/my",
"pages/lectureRoom/lectureRoom",
"pages/MemorizingWords/wordsPackage/wordsPackage",
"pages/community/community",
"pages/index/goldArticleSearch/goldArticleSearch",
"pages/index/goldArticleDetail/goldArticleDetail",
"pages/index/goldArticleList/goldArticleList",
"pages/index/articleDetail/articleDetail",
"pages/index/articleList/articleList",
"pages/course/course",
"pages/course/courseDetail/courseDetail",
"pages/communityDetail/communityDetail",
"pages/lectureRoomDetail/lectureRoomDetail",
"pages/MemorizingWords/searchwords/searchwords",
"pages/index/searchlist/searchlist",
"pages/out/out",
"pages/MemorizingWords/wordsDetail_review/wordsDetail_review",
"pages/contact/contact"
],
"window": {
"backgroundTextStyle": "light",
"navigationBarBackgroundColor": "#fff",
"navigationBarTitleText": "WeChat",
"navigationBarTextStyle": "black"
},
"tabBar": {
"color": "#A1A1A1",
"selectedColor": "#1CB9FA",
"list": [
{
"pagePath": "pages/index/index",
"text": "首页",
"iconPath": "images/tab1.png",
"selectedIconPath": "images/tab2.png"
},
{
"pagePath": "pages/community/community",
"text": "社区",
"iconPath": "images/tab3.png",
"selectedIconPath": "images/tab4.png"
},
{
"pagePath": "pages/lectureRoom/lectureRoom",
"text": "大仙讲堂",
"iconPath": "images/tab5.png",
"selectedIconPath": "images/tab6.png"
},
{
"pagePath": "pages/MemorizingWords/MemorizingWords",
"text": "背单词",
"iconPath": "/images/tab7.png",
"selectedIconPath": "images/tab8.png"
},
{
"pagePath": "pages/my/my",
"text": "我的",
"iconPath": "/images/tab9.png",
"selectedIconPath": "/images/tab10.png"
}
]
}
}
\ No newline at end of file
... ...
/**app.wxss**/
.nodata{
color:#999;
font-size:30rpx;
margin-top:36%;
left:50%;
transform:translateX(-50%);
position: absolute;
z-index:100;
}
.wxParse-strong .WxEmojiView{
font-weight:bold;
}
/* html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p,
blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, img,
ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center,
dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody,
tfoot, thead, tr, th, td, article, aside, canvas, details, embed, figure,
figcaption, footer, header, menu, nav, output, ruby, section, summary, time,
mark, audio, video, input, view, text, template, blockquote, page {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
font-weight: normal;
vertical-align: baseline;
box-sizing: border-box;
font-family: 'pingfang';
} */
/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure, footer, header, menu, nav, section {
display: block;
}
body {
line-height: 1;
height: 100%;
position: relative;
}
blockquote, q {
quotes: none;
}
blockquote:before, blockquote:after, q:before, q:after {
content: none;
}
table {
border-collapse: collapse;
border-spacing: 0;
}
html, body {
width: 100%;
}
.wxParse-span{
display: inline !important;
}
.wxParse-span .wxParse-inline{
display: inline !important;
}
/* custom */
a {
color: #000;
text-decoration: none;
-webkit-backface-visibility: hidden;
}
li {
list-style: none;
}
body {
-webkit-text-size-adjust: none;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}
img {
border: 0;
margin: 0;
}
input, textarea {
height: 100%;
width: 100%;
border: 0;
outline: none;
background: none;
}
@font-face {
font-family: 'iconfont'; /* project id 792131 */
src: url('//at.alicdn.com/t/font_792131_ccibtpxh1ok.eot');
src: url('//at.alicdn.com/t/font_792131_ccibtpxh1ok.eot?#iefix') format('embedded-opentype'),
url('//at.alicdn.com/t/font_792131_ccibtpxh1ok.woff') format('woff'),
url('//at.alicdn.com/t/font_792131_ccibtpxh1ok.ttf') format('truetype'),
url('//at.alicdn.com/t/font_792131_ccibtpxh1ok.svg#iconfont') format('svg');
}
.iconfont {
font-family:"iconfont" !important;
font-size:16px;
font-style:normal;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.icon-jiantouarrow487:before { content: "\e6ab"; }
.icon-tianjiaadd73:before { content: "\e71f"; }
.icon-shouye:before { content: "\e61b"; }
.icon-fenxiang:before { content: "\e619"; }
.icon-dingdan:before { content: "\e649"; }
.icon-dianji:before { content: "\e76c"; }
.icon-zhinanzhen:before { content: "\e60a"; }
.icon-wode:before { content: "\e636"; }
.icon-yuan:before { content: "\e601"; }
.icon-bianji:before { content: "\e6c7"; }
.icon-time:before { content: "\e61e"; }
.icon-ren:before { content: "\e602"; }
.icon-yuan1:before { content: "\e6ba"; }
.icon-shouye1:before { content: "\e60c"; }
.icon-laba:before { content: "\e60d"; }
.icon-laba1:before { content: "\e62d"; }
.icon-huatong:before { content: "\e61d"; }
.icon-sousuo:before { content: "\e608"; }
.icon-xinxi-:before { content: "\e614"; }
.icon-jia:before { content: "\e603"; }
.icon-xuanzhong:before { content: "\e637"; }
... ...
// pages/MemorizingWords/MemorizingWords.js
const app=getApp();
Page({
/**
* 页面的初始数据
*/
data: {
page: 0,//0表示没有计划显示词包,1有计划显示计划
wordspackage:[],//词包
reciteInfo:[],//背诵信息
swiper_index:1,//当前swiper_index滑块
next_margin:'60rpx',//后边距
previous_margin:'60rpx',//前边距
circular:true,
},
//词包详情
wordsPackgeDetail(e) {
let that=this;
wx.navigateTo({
url: '../MemorizingWords/wordsPackage/wordsPackage?id=' + e.currentTarget.id,
})
},
//修改计划
editPlan(){
let that=this;
let days = that.data.reciteInfo.days;
let wordspackageid = that.data.reciteInfo.package_id;
let everyday_words = that.data.reciteInfo.everyday_words;
wx.navigateTo({
url: '../MemorizingWords/wordsPlan/wordsPlan?wordspackageid=' + wordspackageid + '&days=' + days + '&wordnum=' + everyday_words,
success: function(res) {},
fail: function(res) {},
complete: function(res) {},
})
},
//修改词包
editwordspage(){
let that=this;
let reciteInfo = that.data.reciteInfo;
let package_id = reciteInfo.package_id;//词包Id
let wordspackage = that.data.wordspackage;
let swiper_index = that.data.swiper_index;
for (let i in wordspackage){
if (wordspackage[i].id == package_id){
wordspackage[i].jindu = reciteInfo.jindu;
swiper_index=i;
}
}
wx.setStorageSync('ifeidtwordpackage',true);
that.setData({
page:0,
wordspackage: wordspackage,
swiper_index: swiper_index
})
},
//搜索页
searchPage() {
wx.navigateTo({
url: '../../pages/index/goldArticleSearch/goldArticleSearch?type='+2,
})
},
//开始背单词
startWords() {
wx.navigateTo({
url: '../MemorizingWords/wordsDetail/wordsDetail',
})
},
//复习跳转
review() {
wx.navigateTo({
url: '../MemorizingWords/reviewWords/reviewWords',
})
},
//单词报告
wordReport() {
wx.navigateTo({
url: '../MemorizingWords/wordsReport/wordsReport',
})
},
//判断是否有计划
getjudge(){
let that=this;
let url = 'Words/ifHasPlan';
let params={
token:wx.getStorageSync('token')
};
app.post(url,params).then((res)=>{
if(res.data.code==1){
if(res.data.data==0){
that.setData({
page:0
})
that.getPackage();
} else{
that.setData({
page: 1
})
that.getReciteInfo();
}
}
}).catch((errMsg)=>{
console.log(errMsg)
})
},
//获取全部词包
getPackage(){
let that=this;
let reciteInfo = that.data.reciteInfo;
let package_id = reciteInfo.package_id;//词包Id
let url ='Words/getPackage';
app.post(url,{}).then((res)=>{
if(res.data.code==1){
let wordspackage=res.data.data;
for (let obj of res.data.data){
if (obj.id == package_id){
obj.jindu = reciteInfo.jindu
}else{
obj.jindu = '0%'
}
}
that.setData({
wordspackage: wordspackage
})
}
}).catch((errMsg)=>{
})
},
//获取背单词页面数据
getReciteInfo() {
let that=this;
let url ='Words/getReciteInfo';
let params={
token: wx.getStorageSync('token')
}
app.post(url,params).then((res)=>{
if(res.data.code==1){
that.setData({
reciteInfo:res.data.data
})
}
}).catch((errMsg)=>{
console.log(errMsg)
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function(options) {
let that=this;
that.getjudge();
that.getPackage();
that.getReciteInfo();
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function() {
let that = this;
that.getjudge();
that.getReciteInfo();
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function() {
}
})
\ No newline at end of file
... ...
{"navigationBarTitleText": "背单词"}
\ No newline at end of file
... ...
<!--pages/MemorizingWords/MemorizingWords.wxml-->
<view class='title'>背单词</view>
<view class='content_item' wx:if='{{page==0}}'>
<swiper class='swiper_box' next-margin='{{next_margin}}'previous-margin='{{previous_margin}}' circular='{{circular}}' current='{{swiper_index}}'>
<block wx:for='{{wordspackage}}' wx:key='' >
<swiper-item class='swiper_item' id='{{item.id}}' bindtap='wordsPackgeDetail'>
<view class='sub_title'>GMAT</view>
<view class='title_info'>{{item.name}}</view>
<view class='sub_title_info'>{{item.short_content}}</view>
<view class='progress_box' >
<view class='progress_num'>{{item.jindu}}</view>
<view class='progress_img' style='left:{{item.jindu}}'>
<image src='/images/person.png'></image>
</view>
<view class='progress_bar'>
<view class='progress_ing' style='width:{{item.jindu}}'></view>
</view>
</view>
</swiper-item>
</block>
</swiper>
</view>
<view class='content_box'>
<block wx:if='{{page==1}}'>
<view class='content_item'>
<view class='serack_box' bindtap='searchPage'>
<view class='iconfont icon-sousuo'></view>
<view class='search_input'>
<input placeholder='请输入要搜索的单词' placeholder-class='input_color' disabled></input>
</view>
</view>
<view class='content_progress'>
<view class='label'>已坚持{{reciteInfo.jianchi_days}}天</view>
<view class='days'>
<image src='/images/bg2.gif'>
<view class='image_txt'>
<text class='day_num'>{{reciteInfo.days}}</text>
<text class='dau_unit'>天</text>
</view>
</image>
</view>
<view class='plan' bindtap='editPlan'>改计划</view>
<view class='plan_box'>
<view class='plan_item'>
<view class=''>
<text class='plan_num'>{{reciteInfo.everyday_words}}</text> 个</view>
<view>今天需背单词</view>
</view>
<view class='line'>|</view>
<view class='plan_item'>
<view>
<text class='plan_num'>{{reciteInfo.finish}}</text> 个</view>
<view>累计已背</view>
</view>
</view>
<view class='words_type' bindtap='editwordspage'>
<view class='iconfont icon-bianji'></view>
<view>GMAT-{{reciteInfo.package_name}}</view>
</view>
<view class='progress_num2'>{{reciteInfo.jindu}}</view>
<view class='progress_img img2' style='left:{{reciteInfo.jindu}}'>
<image src='/images/person.png'></image>
</view>
<view class='progress_bar bar2'>
<view class='progress_ing ing2' style='width:{{reciteInfo.jindu}}'></view>
</view>
</view>
</view>
<view class='bottom_btn'>
<view class='btn1' bindtap='startWords'>开始背单词</view>
<view class='btn2' bindtap='review'>复习</view>
<view class='btn3' bindtap='wordReport'>单词报告</view>
</view>
</block>
</view>
\ No newline at end of file
... ...
/* pages/MemorizingWords/MemorizingWords.wxss */
@import "/pages/index/goldArticle/goldArticle.wxss";
.content_box {
padding: 0 30rpx;
margin: 0;
}
.title {
font-size: 48rpx;
font-weight: bold;
color: #1a1a1a;
margin-left: 30rpx;
}
.content_item {
padding: 0;
margin-top: 40rpx;
/* background: http://ewords.w.bronet.cn/images/ */
}
.swiper_box {
width: 100%;
height: 535rpx;
}
.swiper_item{
padding: 0 30rpx;
box-sizing: border-box;
}
.sub_title {
font-size: 24rpx;
color: #1db9fa;
}
.title_info {
font-size: 24rpx;
color: #1a1a1a;
margin: 5rpx 0;
}
.sub_title_info {
font-size: 30rpx;
color: #999;
}
.progress_box {
width: 100%;
height: 400rpx;
background: radial-gradient(circle, #6cf0f9, #1cb9fa);
/* background: url(http://ewords.w.bronet.cn/images/) */
border-radius: 10rpx;
overflow: hidden;
position: relative;
margin-top: 10rpx;
}
.progress_num {
font-size: 87rpx;
color: #cdefff;
position: absolute;
top: 110rpx;
left: 40rpx;
}
.progress_bar {
width: 100%;
height: 60rpx;
background: rgba(0, 0, 0, 0.2);
position: absolute;
left: 0;
bottom: 48rpx;
}
.progress_ing {
width: 0%;
border-top: 60rpx solid rgba(0, 0, 0, 0.2);
border-right: 37rpx solid transparent;
}
.progress_img {
width: 51rpx;
height: 42rpx;
display: flex;
align-items: center;
justify-content: center;
position: absolute;
bottom: 110rpx;
left: 0%;
}
.progress_img image {
width: 100%;
height: 100%;
}
/* 选完词包的界面 */
.content_progress {
width: 100%;
height: 551rpx;
background: #1dbafa;
border-radius: 10rpx;
margin-top: 35rpx;
position: relative;
/* display: flex;
flex-direction: column;
align-items: center;
justify-content: center; */
overflow: hidden;
}
.label {
width: 131rpx;
height: 43rpx;
font-size: 20rpx;
color: #fff;
border-radius: 0 22rpx 22rpx 0;
background: #ffda94;
display: flex;
align-items: center;
justify-content: center;
position: absolute;
left: 0;
top: 24rpx;
}
.days {
width: 120rpx;
height: 120rpx;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
/* overflow: hidden; */
position: relative;
margin: 0 auto;
margin-top: 28rpx;
}
.days image {
width: 100%;
height: 100%;
border-radius: 50%;
}
.image_txt{
position: absolute;
top:50%;
left:50%;
transform: translate(-50%,-50%);
display: flex;
justify-content: center;
align-items: center;
z-index:10;
}
.day_num {
font-size:32rpx;
color:#131313;
font-weight:bold;
/* position:absolute;
z-index:10;
top:18rpx;
left:50%;
transform: rotateX(-50%); */
}
.dau_unit {
font-size: 20rpx;
font-weight: bold;
color: #131313;
/* position: absolute;
z-index: 10;
top: 34rpx;
right: 13rpx; */
}
.plan {
width: 100rpx;
height: 40rpx;
font-size: 20rpx;
color: #fff;
border: 1rpx solid rgba(255, 255, 255, 1);
border-radius: 10rpx;
display: flex;
align-items: center;
justify-content: center;
margin: 0 auto;
margin-top: 18rpx;
line-height: 40rpx;
}
.plan_box {
display: flex;
align-items: center;
justify-content: center;
margin-top: 40rpx;
}
.plan_item {
font-size: 24rpx;
color: #fff;
text-align: center;
}
.plan_num {
font-size: 36rpx;
font-weight: bold;
color: #fff;
}
.line {
font-size: 50rpx;
color: #fff;
margin: 0 75rpx;
}
.words_type {
font-size: 24rpx;
color: #e0f5ff;
display: flex;
align-items: center;
justify-content: center;
margin-top: 47rpx;
}
.icon-bianji {
font-size: 15rpx;
margin-right: 15rpx;
}
.progress_num2 {
font-size: 72rpx;
color: #cdefff;
position: absolute;
right: 46rpx;
bottom: 47rpx;
}
.bar2 {
height: 16rpx;
position: absolute;
bottom: 0;
left: 0;
}
.ing2 {
border-top: 16rpx solid rgba(0, 0, 0, 0.2);
border-right: 37rpx solid transparent;
}
.img2 {
position: absolute;
bottom: 19rpx;
}
.bottom_btn {
margin-top: 50rpx;
}
.btn1, .btn2, .btn3 {
width: 100%;
height: 80rpx;
background: rgba(29, 185, 250, 1);
border-radius: 40rpx;
display: flex;
align-items: center;
justify-content: center;
font-size: 36rpx;
color: #fff;
margin-bottom: 20rpx;
}
.btn2, .btn3 {
color: #1db9fa;
background: none;
border: 1rpx solid #1db9fa;
}
... ...
// pages/MemorizingWords/reviewWords/reviewWords.js
Page({
/**
* 页面的初始数据
*/
data: {
},
//错词列表
wrongWordsList() {
var page = 0
wx.navigateTo({
url: '../../MemorizingWords/reviewWordsDetail/reviewWordsDetail?page=' + page,
})
},
//时间段复习
timeList() {
var page = 1
wx.navigateTo({
url: '../../MemorizingWords/reviewWordsDetail/reviewWordsDetail?page=' + page,
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function(options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function() {
}
})
\ No newline at end of file
... ...
{"navigationBarTitleText": "复习界面"}
\ No newline at end of file
... ...
<!--pages/MemorizingWords/reviewWords/reviewWords.wxml-->
<view class='null_box'></view>
<view class='content_box'>
<view class='content_img' bindtap='wrongWordsList'>
<image src='/images/words1.png'></image>
</view>
<view class='content_img' bindtap='timeList'>
<image src='/images/words2.png'></image>
</view>
</view>
\ No newline at end of file
... ...
/* pages/MemorizingWords/reviewWords/reviewWords.wxss */
@import "/pages/index/articleList/articleList.wxss";
.content_box{
display: flex;
align-items: center;
justify-content: space-between;
padding: 40rpx;
}
.content_img{
width: 300rpx;
height: 300rpx;
display: flex;
align-items: center;
justify-content: center;
}
.content_img image{
width: 100%;
height: 100%;
}
\ No newline at end of file
... ...
// pages/MemorizingWords/reviewWordsDetail/reviewWordsDetail.js
const app = getApp();
var temdata_i=0;//动态加载开始天数
var temdata_i1 = 0;//动态加载结束天数
Page({
/**
* 页面的初始数据
*/
data: {
starttime:'',
endtime:'',
page:0,
pushdate:[],//动态加载开始的时间
pushdate1: [],//动态加载结束的时间
moudel:false,
Recitewords:'',//根据时间段所需背单词数
toView:''
},
//确定选择某时间段背的单词数
confirmWords(){
let that=this;
if (that.data.starttime==''){
wx.showToast({
title: '请选择开始时间',
icon: 'none',
duration: 2000,
})
} else if (that.data.endtime==''){
wx.showToast({
title: '请选择结束时间',
icon: 'none',
duration: 2000,
})
}else{
that.getTimeWords();
}
},
//获取复习界面信息(错词,模糊词)
getFuxiInfo(){
let that=this;
let url ='Words/getFuxiInfo';
let params={
token: wx.getStorageSync('token')
}
app.post(url,params).then((res)=>{
if(res.data.code==1){
that.setData({
listdata:res.data.data
})
}
})
},
//按时间共需复习单词数
getTimeWords(){
let that=this;
let url ='Words/getTimeWords';
let params={
token: wx.getStorageSync('token'),
start_time: that.data.starttime,
end_time: that.data.endtime
}
app.post(url,params).then((res)=>{
if(res.data.code==1){
if (parseInt(res.data.data.total_num)>0){
that.setData({
moudel: true,
Recitewords: res.data.data.total_num
})
}else{
wx.showToast({
title: '没有错词请重新选择',
icon: 'none',
duration: 2000,
})
}
}
}).catch((errMsg)=>{
console.log(errMsg)
})
},
setmoudel_no(){
let that=this;
that.setData({
moudel:false,
starttime: '',
endtime: '',
})
},
setmoudel_yes(){
let that = this;
that.setData({
moudel: true
})
},
voidfun(){
},
gowordsDetail_review(e){
let that=this;
let id=e.currentTarget.id;
if(id=='-1'){
wx.showToast({
title: '暂无错词,不需要复习',
icon: 'none',
duration: 2000,
})
}else{
wx.navigateTo({
url: '../wordsDetail_review/wordsDetail_review?id=' + id + '&starttime=' + that.data.starttime + '&endtime=' + that.data.endtime,
success: function (res) { },
fail: function (res) { },
complete: function (res) { },
})
}
},
//开始:根据年月日获取(星期等信息)////later=0 当前 later=1明天 later=2后天...
dateLater(later) {
let that=this;
let pushdate = that.data.pushdate;
let dateObj = {};
let date = new Date();
date.setDate(date.getDate() + later);
let timestamp = Date.parse(date);
dateObj.dataday = date.getFullYear() + '-' + ((date.getMonth() + 1) < 10 ? ("0" + (date.getMonth() + 1)) : date.getMonth() + 1) + '-' + (date.getDate() < 10 ? ("0" + date.getDate()) : date.getDate());
if (later==0){
dateObj.state = true;
that.setData({
toView: 'date' + dateObj.dataday,
starttime: dateObj.dataday,
endtime: dateObj.dataday,
})
}else{
dateObj.state = false;
}
dateObj.timestamp = timestamp;
pushdate.push(dateObj);
that.setData({
pushdate: pushdate,
})
temdata_i++;
},
//开始:动态加载时间
loaddate(){
let that=this;
that.dateLater(temdata_i);
},
//开始:
setstarcell(e){
let that=this;
let index = parseInt(e.currentTarget.dataset.index);
let pushdate = that.data.pushdate;
let pushdate1 = that.data.pushdate1;
let starttime = pushdate[index].dataday;
for (let i in pushdate){
pushdate[i].state=false;
if (i == index){
pushdate[i].state = true;
}
}
for (let obj of pushdate1){
obj.state = false;
if (starttime == obj.dataday){
obj.state=true;
}
}
that.setData({
pushdate: pushdate,
pushdate1: pushdate1,
starttime: starttime,
endtime: starttime,
toView: 'date' + pushdate[index].dataday
})
},
//结束:根据年月日获取(星期等信息)////later=0 当前 later=1明天 later=2后天...
dateLater1(later) {
let that = this;
let pushdate1 = that.data.pushdate1;
let dateObj = {};
let date = new Date();
date.setDate(date.getDate() + later);
let timestamp = Date.parse(date);
dateObj.dataday = date.getFullYear() + '-' + ((date.getMonth() + 1) < 10 ? ("0" + (date.getMonth() + 1)) : date.getMonth() + 1) + '-' + (date.getDate() < 10 ? ("0" + date.getDate()) : date.getDate());
if (later == 0) {
dateObj.state = true;
} else {
dateObj.state = false;
}
dateObj.timestamp = timestamp;
pushdate1.push(dateObj);
that.setData({
pushdate1: pushdate1,
})
temdata_i1++;
},
//结束动态加载时间
loaddate1() {
let that = this;
that.dateLater1(temdata_i1);
},
//结束
setstarcell1(e) {
let that = this;
let starttimestamp=''//选中开始时间搓
let endttimestamp = e.currentTarget.dataset.timestamp//选中结束时间搓
let endtime = that.data.endtime;
let index = parseInt(e.currentTarget.dataset.index);
let pushdate1 = that.data.pushdate1;
let pushdate = that.data.pushdate;
for (let obj of pushdate){
if (obj.state){
starttimestamp = obj.timestamp
}
}
if (starttimestamp==''){
wx.showToast({
title: '请选择开始时间',
icon: 'none',
duration: 2000,
})
} else if (starttimestamp > endttimestamp){
wx.showToast({
title: '结束时间应该大于开始时间',
icon: 'none',
duration: 2000,
})
}
else{
for (let i in pushdate1) {
pushdate1[i].state = false;
if (i == index) {
pushdate1[i].state = true;
endtime = pushdate1[i].dataday
}
}
that.setData({
pushdate1: pushdate1,
endtime: endtime
})
}
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
let that=this;
that.setData({
page:options.page,
pushdate:[],
pushdate1: [],
})
that.getFuxiInfo();
temdata_i = 0;//动态加载开始天数
temdata_i1 = 0;//动态加载结束天数
if (options.page==1){
for(var i=0;i<8;i++){
that.dateLater(temdata_i);
that.dateLater1(temdata_i1);
}
}
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
let that = this;
that.getFuxiInfo();
if (options.page == 1) {
for (var i = 0; i < 8; i++) {
that.dateLater(temdata_i);
that.dateLater1(temdata_i1);
}
}
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})
\ No newline at end of file
... ...
{"navigationBarTitleText": "复习界面"}
\ No newline at end of file
... ...
<!--pages/MemorizingWords/reviewWordsDetail/reviewWordsDetail.wxml-->
<view class='null_box'></view>
<view class='content_box'>
<view wx:if='{{page==0}}'>
<view class='title_box'>
<text>共有错词:</text>
<text class='num'> {{listdata.total_error}}</text>
<text>个</text>
</view>
<view>
<view class='label_box' >
<view class='label_item' wx:for='{{listdata.list}}' wx:key id='{{item[0]}}' bindtap='gowordsDetail_review'>{{item[1]}}</view>
</view>
</view>
</view>
<block wx:elif='{{page==1}}'>
<view>
<view class='title title2'>请选择某时间内背的单词</view>
<view class='picker_box'>
<view class='date_box'>
<view class='picker_title'>开始时间</view>
<view class="picker">
{{starttime}}
</view>
<scroll-view class='starbox' bindscrolltolower='loaddate' scroll-y="true">
<view class="starcell {{item.state?'starcellactivite':''}}" wx:for='{{pushdate}}' wx:key bindtap='setstarcell' data-index='{{index}}'>{{item.dataday}}</view>
</scroll-view>
</view>
<view class='words_box'>
<view class='picker_title'>截止时间</view>
<view class="picker">
{{endtime}}
</view>
<view class='starbox'>
<scroll-view class='starbox' bindscrolltolower='loaddate1' scroll-into-view="{{toView}}" scroll-y="true" scroll-with-animation="true" >
<view class="starcell {{item.state?'starcellactivite':''}}" wx:for='{{pushdate1}}' wx:key bindtap='setstarcell1' data-index='{{index}}' data-timestamp='{{item.timestamp}}' id="{{'date'+item.dataday}}">{{item.dataday}}</view>
</scroll-view></view>
</view>
</view>
</view>
<view class='bottom_btn' bindtap='confirmWords'>确定</view>
</block>
</view>
<view class='mask_box' wx:if='{{moudel}}' bindtap='setmoudel_no'>
<view class='popup_box' catchtap='voidfun'>
<view class='popup_title'>共需复习单词数</view>
<view class='days'>{{Recitewords}}</view>
<view class='btn_box'>
<view class='popup_btn' catchtap='gowordsDetail_review'>开始复习</view>
<view class='popup_btn btn2' catchtap='setmoudel_no'>重新选择</view>
</view>
</view>
</view>
\ No newline at end of file
... ...
/* pages/MemorizingWords/reviewWordsDetail/reviewWordsDetail.wxss */
@import "/pages/index/articleList/articleList.wxss";
@import "/pages/MemorizingWords/wordsPlan/wordsPlan.wxss";
.picker_title{
font-size: 30rpx;
color: #666666;
text-align: center;
margin-bottom: 24rpx;
}
.title_box {
font-size: 36rpx;
color: #1db9fa;
}
.num {
font-size: 48rpx;
}
.label_box {
display: flex;
align-items: center;
flex-wrap: wrap;
justify-content: space-between;
padding: 0 40rpx;
}
.label_item {
width: 260rpx;
height: 80rpx;
font-size: 36rpx;
color: #1db9fa;
border: 1rpx solid rgba(29, 185, 250, 1);
border-radius: 20rpx;
display: flex;
align-items: center;
justify-content: center;
}
.title2 {
margin-top: 30rpx;
}
.mask_box {
width: 100%;
height: 100%;
background: rgba(250, 250, 250, 0.7);
/* filter: blur(2rpx); */
position: fixed;
top: 0;
left: 0;
overflow: hidden;
z-index: 5;
display: flex;
align-items: center;
justify-content: center;
}
.popup_box {
width: 500rpx;
height: 410rpx;
background: rgba(29, 185, 250, 1);
border-radius: 20rpx;
position: absolute;
z-index: 10;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.popup_title {
font-size: 48rpx;
color: #fff;
}
.days {
font-size: 120rpx;
color: #fff;
}
.btn_box {
display: flex;
align-items: center;
justify-content: space-between;
}
.btn_box {
margin-top: 30rpx;
}
.popup_btn {
width: 200rpx;
height: 60rpx;
border-radius: 40rpx;
font-size: 30rpx;
color: #2ebbf6;
background: #fff;
display: flex;
align-items: center;
justify-content: center;
}
.btn2 {
background: none;
border: 1rpx solid #fff;
color: #fff;
margin-left: 30rpx;
}
.starbox{
width:100%;
margin:16rpx 0 0 0;
height: 560rpx;
background-color: #fafafa;
border-radius: 5rpx;
border:1rpx solid #EBEBEB;
overflow: scroll;
}
.starcell{
color:#1DB9FA;
font-size:30rpx;
margin: 0 30rpx;
display: flex;
justify-content: center;
align-items: center;
height: 80rpx;
border-bottom:1rpx solid #ccc;
}
.starbox:last-child{
border:none;
}
.starcellactivite{
background-color: #EBEBEB;
border-radius: 5rpx;
margin: 0;
}
\ No newline at end of file
... ...
// pages/MemorizingWords/searchwords/searchwords.js
const app = getApp();
Page({
/**
* 页面的初始数据
*/
data: {
f:false,
page: 0,//0默认,1显示示意
moudel: false,
listdata: []//单词详情数据
},
//显示释义
showParaphrase() {
this.setData({
page: 1,
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
let that = this;
that.setData({
listdata: wx.getStorageSync('searchend')
})
console.log(wx.getStorageSync('searchend'))
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})
\ No newline at end of file
... ...
{"navigationBarTitleText": "单词详情"}
\ No newline at end of file
... ...
<!--pages/MemorizingWords/searchwords/searchwords.wxml-->
<view class='null_box'></view>
<view class='content_box'>
<view class='banner_box'>
</view>
</view>
<view class='content_item' wx:if='{{page==0}}'>
<view class='item_content'>
<view class='words'>{{listdata.word}}</view>
<view class='phonetic_symbol'>
<view class='iconfont icon-laba1' wx:if='{{f}}'></view>
<view>{{listdata.yinbiao}}</view>
</view>
<view class='paraphrase'>{{listdata.explain}}</view>
</view>
<view class='mask_box' bindtap='showParaphrase'>
<view class='iconfont icon-dianji'></view>
<view>点击屏幕显示释义</view>
</view>
</view>
<block wx:if='{{page==1}}'>
<view class='content_item content_item2'>
<view class='content_itembox'>
<view class='item_content'>
<view class='words'>{{listdata.word}}</view>
<view class='phonetic_symbol'>
<view class='iconfont icon-laba1' wx:if='{{f}}'></view>
<view>{{listdata.yinbiao}}</view>
</view>
<view class='paraphrase'>{{listdata.explain}}</view>
</view>
<view class='item_box'>
<view class='item_list'>
<view class='title'>例句</view>
<view class='list_content'>
<view>
<view class='point' wx:if='{{listdata.liju.length !=0}}'></view>
</view>
<view><text>{{listdata.liju}}</text>
</view>
</view>
</view>
<view class='item_list'>
<view class='title'>大仙点评</view>
<view class='list_content'>
<view>
<view class='point' wx:if='{{listdata.dianping.length !=0}}'></view>
</view>
<view>{{listdata.dianping}}
</view>
</view>
</view>
<view class='item_list'>
<view class='title'>近义词</view>
<view class='list_content'>
<view>{{listdata.jinyici}}</view>
</view>
</view>
</view>
</view>
</view>
</block>
\ No newline at end of file
... ...
/* pages/MemorizingWords/searchwords/searchwords.wxss */
@import "/pages/index/articleList/articleList.wxss";
.banner_box {
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 20rpx;
}
.label_box {
display: flex;
align-items: center;
}
.label_item {
width: 120rpx;
height: 40rpx;
font-size: 24rpx;
color: #666;
background: rgba(204, 240, 255, 1);
border-radius: 4rpx;
display: flex;
align-items: center;
justify-content: center;
margin-right: 20rpx;
}
.info {
font-size: 28rpx;
color: #1db9fa;
}
.icon-xuanzhong {
font-size: 26rpx;
margin-top: 6rpx;
margin-right: 17rpx;
}
.item_content {
/* background: url(/images/bg3.png); */
background: #ebebeb;
text-align: center;
padding: 70rpx 0;
}
.words {
font-size: 48rpx;
color: #19191a;
/* margin-top: 78rpx; */
}
.phonetic_symbol {
display: flex;
align-items: center;
justify-content: center;
font-size: 30rpx;
color: #19191a;
margin-top: 30rpx;
}
.icon-laba1 {
color: #1db9fa;
}
.paraphrase {
font-size: 20rpx;
color: #1db9fa;
margin-top: 19rpx;
}
.mask_box {
font-size: 30rpx;
color: #ccc;
background: #fff;
text-align: center;
margin-top: 220rpx;
}
.icon-dianji {
font-size: 87rpx;
color: #ccc;
margin-bottom: 22rpx;
}
.content_item2 {
width: 100%;
height: 100%;
position: fixed;
left: 0;
background: #fafafa;
}
.content_itembox{
height:70%;
overflow:scroll;
padding:0 0 100rpx 0;
}
.item_box {
padding: 0 50rpx;
}
.item_list {
background: rgba(255, 255, 255, 1);
border-radius: 20rpx;
font-size: 26rpx;
color: #666;
padding: 20rpx;
margin-top: 28rpx;
}
.list_content {
display: flex;
align-items: flex-start;
}
.title {
font-size: 30rpx;
color: #666;
margin-bottom: 20rpx;
}
.point {
width: 23rpx;
height: 23rpx;
}
.bottom_btn {
width: 100%;
height: 100rpx;
display: flex;
align-items: center;
justify-content: space-between;
background: #1db9fa;
border-radius: 20rpx 20rpx 0rpx 0rpx;
position: fixed;
bottom: 0;
left: 0;
padding: 0 40rpx;
}
.btn {
width: 192rpx;
height: 60rpx;
font-size: 30rpx;
color: #FFFFFF;
border: 1rpx solid rgba(255, 255, 255, 1);
border-radius: 10rpx;
display: flex;
align-items: center;
justify-content: center;
}
... ...
// pages/MemorizingWords/wordsDetail/wordsDetail.js
const app=getApp();
const innerAudioContext = wx.createInnerAudioContext();
//下面是64个基本的编码
var base64EncodeChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
var base64DecodeChars = new Array(
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 62, -1, -1, -1, 63,
52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -1, -1, -1, -1, -1, -1,
-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1,
-1, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, -1, -1, -1, -1);
Page({
/**
* 页面的初始数据
*/
data: {
f:false,
ifclick:true,
page: 0,//0默认,1显示示意
moudel: false,
listdata:[]//单词详情数据59
},
//显示释义
showParaphrase() {
this.setData({
page: 1,
})
},
//单词分批处理
handleWords(e) {
let that = this;
that.setData({
ifclick:false
})
let url = 'Words/handleWords';
let md_id = that.data.listdata.info.md_id;
let params = {
status: e.currentTarget.dataset.status,
}
if (md_id==undefined){
params.id=''
}else{
params.id= md_id
}
app.post(url, params).then(res => {
if (res.data.code == 1) {
that.getPackageDetailInfo();
that.setData({
page:0,
})
}
}).catch((errMsg) => {
console.log(errMsg)
})
},
//开始背单词
getPackageDetailInfo(){
let that=this;
let url ='Words/getPackageDetailInfo';
let params={
token: wx.getStorageSync('token')
}
app.post(url,params).then((ret)=>{
console.log('开始背单词',ret);
let tem= that.base64decode(ret.data.data.info.liju);
ret.data.data.info.liju=tem;
if(ret.data.code==1){
if (ret.data.data==''){
wx.showToast({
title: ret.data.msg,
icon:'success',
duration:2000,
})
wx.navigateTo({
url: '../wordsReport/wordsReport',
})
}else{
that.setData({
listdata: ret.data.data,
ifclick:true
})
}
}
}).catch((errMsg)=>{
console.log(errMsg)
})
},
//解码的方法
base64decode(str){
var c1, c2, c3, c4;
var i, len, out;
len = str.length;
i = 0;
out = "";
while(i <len) {
do {
c1 = base64DecodeChars[str.charCodeAt(i++) & 0xff];
} while (i < len && c1 == -1);
if (c1 == -1)
break;
do {
c2 = base64DecodeChars[str.charCodeAt(i++) & 0xff];
} while (i < len && c2 == -1);
if (c2 == -1)
break;
out += String.fromCharCode((c1 << 2) | ((c2 & 0x30) >> 4));
do {
c3 = str.charCodeAt(i++) & 0xff;
if (c3 == 61)
return out;
c3 = base64DecodeChars[c3];
} while (i < len && c3 == -1);
if (c3 == -1)
break;
out += String.fromCharCode(((c2 & 0XF) << 4) | ((c3 & 0x3C) >> 2));
do {
c4 = str.charCodeAt(i++) & 0xff;
if (c4 == 61)
return out;
c4 = base64DecodeChars[c4];
} while (i < len && c4 == -1);
if (c4 == -1)
break;
out += String.fromCharCode(((c3 & 0x03) << 6) | c4);
}
return out;
},
//播放音频
audioPlay(e) {
console.log('播放音频');
let that = this;
innerAudioContext.stop()
let listdata = that.data.listdata;
innerAudioContext.src = listdata.info.voice_url;
innerAudioContext.play();
innerAudioContext.onPlay(() => {
console.log('录音播放中');
})
innerAudioContext.onStop(() => {
console.log('录音播放停止');
})
innerAudioContext.onEnded(() => {
console.log('录音播放结束');
innerAudioContext.stop();
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function(options) {
let that=this;
that.getPackageDetailInfo();
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function() {
innerAudioContext.stop()
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function() {
innerAudioContext.stop()
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function() {
}
})
\ No newline at end of file
... ...
{"navigationBarTitleText": "单词详情界面"}
\ No newline at end of file
... ...
<!--pages/MemorizingWords/wordsDetail/wordsDetail.wxml-->
<view class='null_box'></view>
<view class='content_box'>
<view class='banner_box'>
<view class='label_box'>
<view class='label_item'>
<text>新学</text>
<text>{{listdata.new_study}}</text>
</view>
<view class='label_item'>
<text>需复习</text>
<text>{{listdata.review}}</text>
</view>
</view>
<view class='label_box info' data-status='4' bindtap='{{ifclick?"handleWords":""}}'>
<view class='iconfont icon-xuanzhong'></view>
<view>熟识</view>
</view>
</view>
</view>
<view class='content_item' wx:if='{{page==0}}'>
<view class='item_content'>
<view class='words'>{{listdata.info.word}}</view>
<view class='phonetic_symbol' catchtap='audioPlay' >
<view class='iconfont icon-laba1' wx:if='{{f}}'></view>
<view>{{listdata.info.yinbiao}}</view>
</view>
<view class='paraphrase'>{{listdata.info.explain}}</view>
</view>
<view class='mask_box' bindtap='showParaphrase'>
<view class='iconfont icon-dianji'></view>
<view>点击屏幕显示释义</view>
</view>
</view>
<block wx:if='{{page==1}}'>
<view class='content_item content_item2'>
<view class='content_itembox'>
<view class='item_content'>
<view class='words'>{{listdata.info.word}}</view>
<view class='phonetic_symbol'>
<view class='iconfont icon-laba1' wx:if='{{f}}'></view>
<view>{{listdata.info.yinbiao}}</view>
</view>
<view class='paraphrase'>{{listdata.info.explain}}</view>
</view>
<view class='item_box'>
<view class='item_list'>
<view class='title'>例句</view>
<view class='list_content'>
<view>
<view class='point' wx:if='{{listdata.info.liju.length !=0}}'></view>
</view>
<view><text> {{listdata.info.liju}}</text>
</view>
</view>
</view>
<view class='item_list'>
<view class='title'>大仙点评</view>
<view class='list_content'>
<view>
<view class='point' wx:if='{{listdata.info.dianping.length !=0}}'></view>
</view>
<view>{{listdata.info.dianping}}
</view>
</view>
</view>
<view class='item_list'>
<view class='title'>近义词</view>
<view class='list_content'>
<view>{{listdata.info.jinyici?listdata.info.jinyici:'暂无'}}</view>
</view>
</view>
</view>
</view>
</view>
</block>
<view class='bottom_btn'>
<view class='btn' data-status='1' bindtap='{{ifclick?"handleWords":""}}'>认识</view>
<view class='btn' data-status='2' bindtap='{{ifclick?"handleWords":""}}'>不认识</view>
<view class='btn' data-status='3' bindtap='{{ifclick?"handleWords":""}}'>模糊</view>
<view class='btn' wx:if=''>忘记</view>
</view>
\ No newline at end of file
... ...
/* pages/MemorizingWords/wordsDetail/wordsDetail.wxss */
@import "/pages/index/articleList/articleList.wxss";
.banner_box {
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 20rpx;
}
.label_box {
display: flex;
align-items: center;
}
.label_item {
width: 120rpx;
height: 40rpx;
font-size: 24rpx;
color: #666;
background: rgba(204, 240, 255, 1);
border-radius: 4rpx;
display: flex;
align-items: center;
justify-content: center;
margin-right: 20rpx;
}
.info {
font-size: 28rpx;
color: #1db9fa;
}
.icon-xuanzhong {
font-size: 26rpx;
margin-top: 6rpx;
margin-right: 17rpx;
}
.content_itembox{
height: 70%;
overflow:scroll;
padding:0 0 100rpx 0;
}
.item_content {
/* background: url(/images/bg3.png); */
background: #ebebeb;
text-align: center;
padding: 70rpx 0;
/* height: 30%; */
}
.words {
font-size: 48rpx;
color: #19191a;
/* margin-top: 78rpx; */
}
.phonetic_symbol {
display: flex;
align-items: center;
justify-content: center;
font-size: 30rpx;
color: #19191a;
margin-top: 30rpx;
}
.icon-laba1 {
color: #1db9fa;
}
.paraphrase {
font-size: 20rpx;
color: #1db9fa;
margin-top: 19rpx;
}
.mask_box {
font-size: 30rpx;
color: #ccc;
background: #fff;
text-align: center;
margin-top: 220rpx;
}
.icon-dianji {
font-size: 87rpx;
color: #ccc;
margin-bottom: 22rpx;
}
.content_item2 {
width: 100%;
height: 100%;
position: fixed;
left: 0;
background: #fafafa;
}
.item_box {
padding: 0 50rpx;
/* height: 50%;
overflow: scroll; */
}
.item_list {
background: rgba(255, 255, 255, 1);
border-radius: 20rpx;
font-size: 26rpx;
color: #666;
padding: 20rpx;
margin-top: 28rpx;
}
.list_content {
display: flex;
align-items: flex-start;
}
.title {
font-size: 30rpx;
color: #666;
margin-bottom: 20rpx;
}
.point {
width: 23rpx;
height: 23rpx;
}
.bottom_btn {
width: 100%;
height: 100rpx;
box-sizing: border-box;
display: flex;
align-items: center;
justify-content: space-between;
background: #1db9fa;
border-radius: 20rpx 20rpx 0rpx 0rpx;
position: fixed;
bottom: 0;
left: 0;
padding: 0 40rpx;
}
.btn {
width: 192rpx;
height: 60rpx;
font-size: 30rpx;
color: #FFFFFF;
border: 1rpx solid rgba(255, 255, 255, 1);
border-radius: 10rpx;
display: flex;
align-items: center;
justify-content: center;
}
... ...
// pages/MemorizingWords/wordsDetail/wordsDetail.js
const app = getApp();
const innerAudioContext = wx.createInnerAudioContext();
Page({
/**
* 页面的初始数据
*/
data: {
page: 0,//0默认,1显示示意
moudel: false,
listdata: [],//单词详情数据
myplan_detail_id:'',//下一题id
handle_myplan_detail_id:'',//本题的id
myplan_id:'',
starttime:'',
endtime: '',
if_time: ''
},
//显示释义
showParaphrase() {
this.setData({
page: 1,
})
},
//单词分批处理
handleWords(e) {
console.log(e);
let that = this;
that.handleWordsError(e.currentTarget.dataset.status);
},
//播放音频
audioPlay(e) {
let that = this;
innerAudioContext.stop()
let listdata = that.data.listdata;
innerAudioContext.src = listdata.info.voice_url;
innerAudioContext.play();
innerAudioContext.onPlay(() => {
console.log('录音播放中');
})
innerAudioContext.onStop(() => {
console.log('录音播放停止');
})
innerAudioContext.onEnded(() => {
console.log('录音播放结束');
})
},
//获取复习界面单词详情(错词,模糊词)
getPackageDetailInfo() {
let that = this;
let url = 'Words/getWordsDetailError';
let params = {
myplan_id: that.data.myplan_id,
myplan_detail_id: that.data.myplan_detail_id
}
app.post(url, params).then((res) => {
if (res.data.code == 1) {
if (res.data.data == '') {
wx.showToast({
title: res.data.msg,
icon: 'success',
duration: 2000,
})
wx.navigateTo({
url: '../wordsReport/wordsReport',
})
} else {
that.setData({
listdata: res.data.data,
myplan_detail_id: res.data.data.myplan_detail_id,
handle_myplan_detail_id: res.data.data.handle_myplan_detail_id
})
}
}else if(res.data.code==0){
wx.showToast({
title: res.data.msg,
icon: 'success',
duration: 2000,
})
setTimeout(function(){
wx.switchTab({
url: '/pages/MemorizingWords/MemorizingWords',
})
},2000)
}
}).catch((errMsg) => {
console.log(errMsg)
})
},
//获取复习界面单词详情(按时间)
getTimeWordsDetail(){
let that=this;
let url ='Words/getTimeWordsDetail';
let params={
token: wx.getStorageSync('token'),
start_time: that.data.starttime,
end_time: that.data.endtime,
myplan_detail_id: that.data.myplan_detail_id
}
app.post(url, params).then((res) => {
if (res.data.code == 1) {
if (res.data.data == '') {
wx.showToast({
title: res.data.msg,
icon: 'success',
duration: 2000,
})
wx.navigateTo({
url: '../wordsReport/wordsReport',
})
} else {
that.setData({
listdata: res.data.data,
myplan_detail_id: res.data.data.myplan_detail_id,
handle_myplan_detail_id: res.data.data.handle_myplan_detail_id
})
}
} else if (res.data.code == 0) {
wx.showToast({
title: res.data.msg,
icon: 'success',
duration: 2000,
})
setTimeout(function () {
wx.switchTab({
url: '/pages/MemorizingWords/MemorizingWords',
})
}, 2000)
}
}).catch((errMsg) => {
console.log(errMsg)
})
},
//处理错词
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){
that.getTimeWordsDetail();
}else{
that.getPackageDetailInfo();
}
}
}).catch((errMsg)=>{
console.log(errMsg)
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
let that=this;
if (options.id.length !=0 ){
that.setData({
myplan_id: options.id,
if_time:false
})
that.getPackageDetailInfo();
}
if (options.starttime.length !=0){
that.setData({
starttime: options.starttime,
endtime: options.endtime,
if_time: true
})
that.getTimeWordsDetail();
}
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
innerAudioContext.stop()
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
innerAudioContext.stop()
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})
\ No newline at end of file
... ...
{"navigationBarTitleText": "复习单词"}
\ 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='content_box'>
<view class='banner_box'>
<view class='label_box'>
<view class='label_item'>
<text>新学</text>
<text>{{listdata.new_study}}</text>
</view>
<view class='label_item'>
<text>需复习</text>
<text>{{listdata.review}}</text>
</view>
</view>
<view class='label_box info' data-status='4' bindtap='handleWords'>
<view class='iconfont icon-xuanzhong'></view>
<view>熟识</view>
</view>
</view>
</view>
<view class='content_item' wx:if='{{page==0}}'>
<view class='item_content'>
<view class='words'>{{listdata.info.word}}</view>
<view class='phonetic_symbol' catchtap='audioPlay'>
<view class='iconfont icon-laba1'></view>
<view>{{listdata.info.yinbiao}}</view>
</view>
<view class='paraphrase'>{{listdata.info.explain}}</view>
</view>
<view class='mask_box' bindtap='showParaphrase'>
<view class='iconfont icon-dianji'></view>
<view>点击屏幕显示释义</view>
</view>
</view>
<block wx:if='{{page==1}}'>
<view class='content_item content_item2'>
<view class='item_content'>
<view class='words'>{{listdata.info.word}}</view>
<view class='phonetic_symbol'>
<view class='iconfont icon-laba1'></view>
<view>{{listdata.info.yinbiao}}</view>
</view>
<view class='paraphrase'>{{listdata.info.explain}}</view>
</view>
<view class='item_box'>
<view class='item_list'>
<view class='title'>例句</view>
<view class='list_content'>
<view>
<view class='point' wx:if='{{listdata.info.liju.length !=0}}'></view>
</view>
<view>{{listdata.info.liju}}
</view>
</view>
</view>
<view class='item_list'>
<view class='title'>近义词</view>
<view class='list_content'>
<view>{{listdata.info.jinyici}}</view>
</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>
</view>
</block>
... ...
/* pages/MemorizingWords/wordsDetail_review/wordsDetail_review.wxss */
@import "/pages/index/articleList/articleList.wxss";
.banner_box {
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 20rpx;
}
.label_box {
display: flex;
align-items: center;
}
.label_item {
width: 120rpx;
height: 40rpx;
font-size: 24rpx;
color: #666;
background: rgba(204, 240, 255, 1);
border-radius: 4rpx;
display: flex;
align-items: center;
justify-content: center;
margin-right: 20rpx;
}
.info {
font-size: 28rpx;
color: #1db9fa;
}
.icon-xuanzhong {
font-size: 26rpx;
margin-top: 6rpx;
margin-right: 17rpx;
}
.item_content {
/* background: url(/images/bg3.png); */
background: #ebebeb;
text-align: center;
padding: 70rpx 0;
}
.words {
font-size: 48rpx;
color: #19191a;
/* margin-top: 78rpx; */
}
.phonetic_symbol {
display: flex;
align-items: center;
justify-content: center;
font-size: 30rpx;
color: #19191a;
margin-top: 30rpx;
}
.icon-laba1 {
color: #1db9fa;
}
.paraphrase {
font-size: 20rpx;
color: #1db9fa;
margin-top: 19rpx;
}
.mask_box {
font-size: 30rpx;
color: #ccc;
background: #fff;
text-align: center;
margin-top: 220rpx;
}
.icon-dianji {
font-size: 87rpx;
color: #ccc;
margin-bottom: 22rpx;
}
.content_item2 {
width: 100%;
height: 100%;
position: fixed;
left: 0;
background: #fafafa;
}
.item_box {
padding: 0 50rpx;
}
.item_list {
background: rgba(255, 255, 255, 1);
border-radius: 20rpx;
font-size: 26rpx;
color: #666;
padding: 20rpx;
margin-top: 28rpx;
}
.list_content {
display: flex;
align-items: flex-start;
}
.title {
font-size: 30rpx;
color: #666;
margin-bottom: 20rpx;
}
.point {
width: 23rpx;
height: 23rpx;
}
.bottom_btn {
width: 100%;
height: 100rpx;
display: flex;
box-sizing: border-box;
align-items: center;
justify-content: space-between;
background: #1db9fa;
border-radius: 20rpx 20rpx 0rpx 0rpx;
position: fixed;
bottom: 0;
left: 0;
padding: 0 40rpx;
}
.btn {
width: 192rpx;
height: 60rpx;
font-size: 30rpx;
color: #FFFFFF;
border: 1rpx solid rgba(255, 255, 255, 1);
border-radius: 10rpx;
display: flex;
align-items: center;
justify-content: center;
}
... ...
// pages/MemorizingWords/wordsPackage/wordsPackage.js
const app=getApp();
const innerAudioContext = wx.createInnerAudioContext();
Page({
/**
* 页面的初始数据
*/
data: {
wordspackageid:'',//词包id
total:0,//单词量
listdata:{
list: [],
package_id: '',
total_num: 0
},//词包内容
scroll_height:'',//可视区域的高度
page:1,//当前页
pageNum:20,//每页条数
ifload:true
},
// 开始背单词
startPlan() {
let that=this;
let wordspackageid = that.data.wordspackageid;
// wx.setStorageSync('ifeditpage', false);
wx.navigateTo({
url: '../../MemorizingWords/wordsPlan/wordsPlan?wordspackageid=' + wordspackageid
})
},
audioPlay(e){
let that=this;
innerAudioContext.stop()
let listdata = that.data.listdata;
let index =e.currentTarget.dataset.index;
innerAudioContext.src = listdata.list[index].voice_url;
innerAudioContext.play();
innerAudioContext.onPlay(() => {
console.log('录音播放中');
})
innerAudioContext.onStop(() => {
console.log('录音播放停止');
})
innerAudioContext.onEnded(() => {
console.log('录音播放结束');
innerAudioContext.stop()
})
},
//获取单词包详情
getdata(){
let that=this;
let url ='Words/againGetPackageDetail';
let params={
token:wx.getStorageSync('token'),
page:that.data.page,
pageNum: that.data.pageNum,
id: that.data.wordspackageid
}
app.post(url, params).then((res)=>{
if(res.data.code==1){
if (res.data.data.list.length < that.data.pageNum){
that.setData({
ifload:false
})
}
let list=res.data.data.list;
let listdata = that.data.listdata;
let temist=listdata.list.concat(list);
listdata.list = temist;
that.setData({
listdata: listdata,
total: res.data.data.total_num,
page:parseInt(that.data.page)+1
})
}
}).catch((errMsg)=>{
console.log(errMsg)
})
},
//加载更多
onloading(){
let that=this;
if (that.data.ifload){
that.getdata();
}
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function(options) {
let that=this;
let windowHeight = wx.getSystemInfoSync().windowHeight // 屏幕的高度
let windowWidth = wx.getSystemInfoSync().windowWidth // 屏幕的宽度
this.setData({
scroll_height: windowHeight * 750 / windowWidth - 100
})
that.setData({
wordspackageid:options.id,
page:1,
listdata:{
list:[],
package_id:'',
total_num:0
}
})
that.getdata();
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function() {
innerAudioContext.stop();
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function() {
innerAudioContext.stop();
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function() {
}
})
\ No newline at end of file
... ...
{"navigationBarTitleText": "词包详情界面"}
\ No newline at end of file
... ...
<!--pages/MemorizingWords/wordsPackage/wordsPackage.wxml-->
<scroll-view scroll-y='true' bindscrolltolower='onloading' style='max-height:{{scroll_height}}rpx'>
<view class='null_box'></view>
<view class='content_box'>
<view class='content_title'>
<view>单词量:
<text class='current_num'>{{total}}</text>
<text>/{{listdata.total_num}}</text> </view>
<view class='state_box'>
<view class='state_item'>
<view class='iconfont icon-yuan1'></view>
<view>没背</view>
</view>
<view class='state_item'>
<view class='iconfont icon-yuan1 blue'></view>
<view>认识</view>
</view>
<view class='state_item'>
<view class='iconfont icon-yuan1 gree'></view>
<view>不认识 </view>
</view>
<view class='state_item'>
<view class='iconfont icon-yuan1 yellow'></view>
<view>模糊</view>
</view>
</view>
</view>
<view class='content_item'>
<block wx:for='{{listdata.list}}' wx:key>
<view class="item_list" wx:if='{{item.status==0}}' >
<view class='iconfont icon-laba1' bindtap='audioPlay' data-index="{{index}}">
</view>
<view>
<view>
<text>{{item.word}}</text>
<text class='phonetic_symbol' >{{item.yinbiao}}</text>
</view>
<view class='explain'>释义:{{item.explain}}</view>
</view>
</view>
<view class="item_list bgblue" wx:elif='{{item.status==1}}' >
<view class='iconfont icon-laba1' bindtap='audioPlay' data-index="{{index}}">
</view>
<view>
<view>
<text>{{item.word}}</text>
<text class='phonetic_symbol' >{{item.yinbiao}}</text>
</view>
<view class='explain'>释义:{{item.explain}}</view>
</view>
</view>
<view class="item_list bggree" wx:elif='{{item.status==2}}' >
<view class='iconfont icon-laba1' bindtap='audioPlay' data-index="{{index}}">
</view>
<view>
<view>
<text>{{item.word}}</text>
<text class='phonetic_symbol' >{{item.yinbiao}}</text>
</view>
<view class='explain'>释义:{{item.explain}}</view>
</view>
</view>
<view class="item_list bgyellow" wx:elif='{{item.status==3}}' >
<view class='iconfont icon-laba1' bindtap='audioPlay' data-index="{{index}}">
</view>
<view>
<view>
<text>{{item.word}}</text>
<text class='phonetic_symbol' >{{item.yinbiao}}</text>
</view>
<view class='explain'>释义:{{item.explain}}</view>
</view>
</view>
</block>
</view>
</view>
</scroll-view>
<view class='bottom_btn' bindtap='startPlan'>开始背单词</view>
\ No newline at end of file
... ...
/* pages/MemorizingWords/wordsPackage/wordsPackage.wxss */
@import "/pages/index/articleList/articleList.wxss";
page{
padding:0 0 100rpx 0;
}
.content_box {
padding: 30rpx 0;
}
.current_num {
color: #1db9fa;
}
.content_title {
display: flex;
align-items: center;
justify-content: space-between;
font-size: 30rpx;
color: #010000;
padding: 0 30rpx;
}
.state_box {
display: flex;
align-items: center;
}
.state_item {
font-size: 24rpx;
color: #999;
margin-left: 30rpx;
}
.icon-yuan1 {
font-size: 24rpx;
color: #ebebeb;
text-align: center;
}
.blue {
color: #a2e4ff;
}
.gree {
color: #1dfac3;
}
.yellow {
color: RGBA(245, 231, 139, 1);
}
.content_item .bgblue {
background-color: #a2e4ff;
}
.content_item .bggree {
background-color: #1dfac3;
}
.content_item .bgyellow {
background-color: RGBA(245, 231, 139, 1);
}
.item_list .txt_color{
color:#ebebeb;
}
.item_list {
width: 100%;
height: 100rpx;
background: #ebebeb;
display: flex;
align-items: flex-start;
padding: 0 30rpx 0 0;
margin-bottom: 20rpx;
}
.icon-laba1 {
font-size: 30rpx;
color: #1db9fa;
padding: 20rpx 17rpx 20rpx 30rpx;
box-sizing: border-box;
}
.phonetic_symbol {
font-size: 24rpx;
color: #999;
margin-left: 12rpx;
}
.explain {
font-size: 24rpx;
color: #4d4d4d;
}
.bottom_btn {
width: 100%;
height: 100rpx;
font-size: 36rpx;
color: #FFFFFF;
background: rgba(29, 185, 250, 1);
border-radius: 10rpx 10rpx 0rpx 0rpx;
position: fixed;
bottom: 0;
left: 0;
display: flex;
align-items: center;
justify-content: center;
}
... ...
// pages/MemorizingWords/wordsPlan/wordsPlan.js
const app=getApp();
Page({
/**
* 页面的初始数据
*/
data: {
f:false,
ifedit:false,//是否是修改计划
dayNum: [
{
show:'15天',
num:15,
state:false
},
{
show: '30天',
num: 30,
state: false
},
{
show: '45天',
num: 45,
state: false
},
{
show: '60天',
num: 60,
state: false
}
],//天数选择数组
days: '',
wordsNums:[],//单词数选择数组
wordsNum:'',//每天背的单词数
wordspackageid:'',//词包ID
packageDetail:[],//词包详情
toView: '',//天数to
toView1:'',//单词数to
ifeidtwordpackage:false//是否是编辑词包
},
setdayNum(e){
let that = this;
let days = e.currentTarget.dataset.num;
let index = parseInt(e.currentTarget.dataset.index);
let dayNum = that.data.dayNum;
let url = 'Words/handle';
let params = {
days: days,
package_id: that.data.wordspackageid
}
app.post(url, params).then((res) => {
if (res.data.code == 1) {
for (let i in dayNum){
dayNum[i].state = false
if(i == index){
dayNum[i].state = true
}
}
that.setData({
days: days,
wordsNum: res.data.data.everyday_words,
dayNum: dayNum,
})
}
}).catch((errMsg) => {
console.log(errMsg)
})
},
setwordsNum(e){
let that=this;
let url ='Words/handle2';
let index = parseInt(e.currentTarget.dataset.index);
let wordsNum=e.currentTarget.dataset.num;
let dayNum = that.data.dayNum;
let wordsNums = that.data.wordsNums;
let params = {
words_num: e.currentTarget.dataset.num,
package_id: that.data.wordspackageid
}
app.post(url, params).then((res) => {
if (res.data.code == 1) {
for (let i in wordsNums) {
wordsNums[i].state = false
if (i == index) {
wordsNums[i].state = true
}
}
for (let i in dayNum) {
dayNum[i].state = false
if (parseInt(dayNum[i].num) == parseInt(res.data.data.everyday_days)) {
dayNum[i].state = true
}
}
that.setData({
days: res.data.data.everyday_days,
wordsNum: wordsNum,
dayNum: dayNum,
wordsNums: wordsNums,
toView: 'inToView' + res.data.data.everyday_days
})
}
}).catch((errMsg) => {
console.log(errMsg)
})
},
setplanpage(){
let that=this;
if (wx.getStorageSync('ifeidtwordpackage')){//true为修改词包
that.setPackage();
}else{//false为设置计划
that.confirmPlan();
}
},
//设定计划操作
confirmPlan() {
let that=this;
if (that.data.days==''){
wx.showToast({
title: '请选择天数!',
icon: 'none',
duration: 2000
})
}else{
let url ='Words/setPlan';
let params={
package_id: that.data.wordspackageid,
token: wx.getStorageSync('token'),
days:that.data.days,
everyday_words: that.data.wordsNum
}
app.post(url,params).then((res)=>{
wx.switchTab({
url: '../../MemorizingWords/MemorizingWords',
})
}).catch((errMsg)=>{
console.log(errMssg)
})
}
},
//接口:修改词包
setPackage() {
let that = this;
if (that.data.days == '') {
wx.showToast({
title: '请选择天数!',
icon: 'none',
duration: 2000
})
}else{
let url = 'Words/setPackage';
wx.setStorageSync('ifeidtwordpackage', false);
let params = {
package_id: that.data.wordspackageid,
token: wx.getStorageSync('token'),
days: that.data.days,
everyday_words: that.data.wordsNum
}
app.post(url, params).then((res) => {
if (res.data.code == 1) {
wx.switchTab({
url: '../../MemorizingWords/MemorizingWords',
})
}
}).catch((errMsg) => {
console.log(errMssg)
})
}
},
//修改计划操作
seteditPlan() {
let that = this;
if (that.data.days == '') {
wx.showToast({
title: '请选择天数!',
icon: 'none',
duration: 2000
})
} else {
let url = 'Words/editPlan';
let params = {
token: wx.getStorageSync('token'),
days: that.data.days,
everyday_words: that.data.wordsNum
}
app.post(url, params).then((res) => {
if (res.data.code == 1) {
wx.switchTab({
url: '../../MemorizingWords/MemorizingWords',
})
}
}).catch((errMsg) => {
console.log(errMssg)
})
}
},
//获取计划页面详情
getplan(){
let that=this;
let url ='Words/getPlanInfo';
let days = parseInt(that.data.days);//选择天
let wordsNum = parseInt(that.data.wordsNum);//每天背的单词数
let params={
package_id: that.data.wordspackageid
}
app.post(url,params).then((res)=>{
if(res.data.code==1){
that.setData({
packageDetail: res.data.data,
total_num: res.data.data.total_num,
})
}
}).catch((errMsg)=>{
console.log(errMsg)
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function(options) {
let that=this;
if (options.wordspackageid !=undefined){//设置或修改词包
that.setData({
wordspackageid:options.wordspackageid,
ifeidtwordpackage: wx.getStorageSync('ifeidtwordpackage')
})
}
if (options.days !=undefined){
let dayNum = that.data.dayNum;
for (let obj of dayNum){
if (obj.num == options.days){
obj.state=true
}
}
that.setData({
ifedit:true,
dayNum: dayNum,
days: options.days,//选择天(默认是第一天)
wordsNum: options.wordnum,//每天背的单词数
})
}
that.getplan();
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function() {
}
})
\ No newline at end of file
... ...
{"navigationBarTitleText": "我的计划"}
\ No newline at end of file
... ...
<!--pages/MemorizingWords/wordsPlan/wordsPlan.wxml-->
<view class='null_box'></view>
<view class='content_box'>
<view>
<view class='title'>GMAT-{{packageDetail.package_name}}({{packageDetail.total_num}}个词)</view>
<view class='content_info'>我计划
<text class='date_num'>{{days}}</text> 天,每天背
<text class='words_num'>{{wordsNum}}</text>个单词</view>
<view class='picker_box'>
<view class='date_box'>
<view class="picker">
{{days}}天
</view>
<view class='starbox'>
<scroll-view class='starbox' scroll-y='true' scroll-into-view="{{toView}}" scroll-y="true" scroll-with-animation="true">
<view class="starcell {{item.state?'starcellactivite':''}}" wx:for='{{dayNum}}' wx:key bindtap='setdayNum' data-num='{{item.num}}' data-index='{{index}}' id="{{ 'inToView'+item.num}}">{{item.show}}</view>
</scroll-view></view>
</view>
<view class='words_box' wx:if='{{f}}'>
<view class="pickerdata">
{{wordsNum}}个
</view>
<view class='starbox'>
<scroll-view class='starbox' scroll-y='true' scroll-into-view="{{toView1}}" scroll-y="true" scroll-with-animation="true">
<view class="starcell {{item.state?'starcellactivite':''}}" wx:for='{{wordsNums}}' wx:key data-index='{{index}}' data-num='{{item.num}}' id="{{ 'inToView1'+item.num}}" bindtap='setwordsNum' >{{item.show}}</view>
</scroll-view></view>
</view>
</view>
</view>
<view class='bottom_btn' bindtap='{{ifedit?"seteditPlan":"setplanpage"}}'>确定</view>
</view>
\ No newline at end of file
... ...
/* pages/MemorizingWords/wordsPlan/wordsPlan.wxss */
@import "/pages/index/articleList/articleList.wxss";
.title {
font-size: 36rpx;
color: #666;
text-align: center;
}
.content_info {
font-size: 26rpx;
color: #666;
text-align: center;
margin-top: 50rpx;
}
.date_num, .words_num {
display: inline-block;
width: 45rpx;
font-size: 26rpx;
color: #1db9fa;
text-align: center;
border-bottom: 1rpx solid #666;
}
.picker_box {
display: flex;
align-items: center;
justify-content: space-between;
margin-top: 56rpx;
padding: 0 40rpx;
}
.picker,.pickerdata{
margin: 0 auto;
width: 260rpx;
height: 80rpx;
border: 1rpx solid rgba(29, 185, 250, 1);
border-radius: 20rpx;
font-size: 36rpx;
color: #1db9fa;
display: flex;
align-items: center;
justify-content: center;
}
.bottom_btn {
width: 100%;
height: 100rpx;
font-size: 36rpx;
color: #fff;
background: rgba(29, 185, 250, 1);
border-radius: 10rpx 10rpx 0rpx 0rpx;
position: fixed;
bottom: 0;
left: 0;
display: flex;
align-items: center;
justify-content: center;
}
.starbox{
width:100%;
margin:16rpx 0 0 0;
height: auto;
background-color: #fafafa;
border-radius: 5rpx;
overflow: scroll;
}
.starcell{
color:#1DB9FA;
font-size:30rpx;
margin: 0 30rpx;
display: flex;
justify-content: center;
align-items: center;
height: 80rpx;
border-bottom:1rpx solid #ccc;
}
.starcell:last-child{
border:none;
}
.starcellactivite{
background-color: #EBEBEB;
border-radius: 5rpx;
margin: 0;
border:none;
}
.date_box{
width:260rpx;
margin: 0 auto;
}
\ No newline at end of file
... ...
// pages/MemorizingWords/wordsReport/wordsReport.js
const app=getApp();
Page({
/**
* 页面的初始数据
*/
data: {
},
getWordsReport() {//获取单词报告
let that=this;
let url ='Words/getWordsReport';
let params={
token: wx.getStorageSync('token')
};
app.post(url,params).then((res)=>{
if(res.data.code==1){
that.setData({
listdata:res.data.data
})
}
}).catch((errMsg)=>{
console.log(errMsg)
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
let that=this;
that.getWordsReport();
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})
\ No newline at end of file
... ...
{"navigationBarTitleText": "单词报告界面"}
\ No newline at end of file
... ...
<!--pages/MemorizingWords/wordsReport/wordsReport.wxml-->
<view class='content_box'>
<view class='content_item'>
<view class='content_progress'>
<view class='label'>已坚持{{listdata.jianchi_days}}天</view>
<view class='days'>
<image src='/images/bg2.gif'></image>
<text class='day_num'>{{listdata.total_num}}</text>
</view>
<view class='plan'>总单词数</view>
<view class='plan_box'>
<view class='plan_item'>
<view class=''>
<text class='plan_num'>{{listdata.know}}</text>
</view>
<view>认识数</view>
</view>
<view class='line'>|</view>
<view class='plan_item'>
<view>
<text class='plan_num'>{{listdata.noknow}}</text> </view>
<view>不认识数</view>
</view>
</view>
<view class='words_type'>
<view>已完成单词数:{{listdata.total_look_num}}/{{listdata.total_num}}</view>
</view>
<view class='progress_num2'>{{listdata.jindu}}</view>
<view class='progress_img img2' style='left:{{listdata.jindu}}' >
<image src='/images/person.png'></image>
</view>
<view class='progress_bar bar2'>
<view class='progress_ing ing2' style='width:{{listdata.jindu}}'></view>
</view>
</view>
</view>
<view class='info_box'>
<view>
<view class='symble_box top'>
<view class='review1'></view>
<view>平均每天复习的单词量</view>
</view>
<view class='symble_box'>
<view class='new_learn1'></view>
<view>平均每天新学的单词量</view>
</view>
</view>
<view class='symble_box'>
<view class="review {{listdata.everyday_fuxi>listdata.everyday_new?'gao_height':'lowheight'}}" >{{listdata.everyday_fuxi}}</view>
<view class="new_learn left {{listdata.everyday_fuxi>listdata.everyday_new?'lowheight':'gao_height'}}">{{listdata.everyday_new}}</view>
</view>
</view>
</view>
\ No newline at end of file
... ...
/* pages/MemorizingWords/wordsReport/wordsReport.wxss */
@import "/pages/MemorizingWords/MemorizingWords.wxss";
.days{
position: relative;
}
.day_num{
position: absolute;
top:50%;
left:50%;
transform: translate(-50%,-50%);
font-size: 48rpx;
}
.plan{
border: none;
font-size: 20rpx;
}
.words_type{
font-size: 24rpx;
}
.content_box {
padding: 0 30rpx;
}
.info_box {
width: 691rpx;
height: 309rpx;
box-sizing: border-box;
background: rgba(29, 185, 250, 1);
border-radius: 20rpx;
margin-top: 20rpx;
display: flex;
align-items: center;
justify-content: space-between;
font-size: 24rpx;
color: #3a3a3a;
padding: 56rpx;
}
.symble_box {
display: flex;
align-items: flex-end;
}
.review1 {
width: 30rpx;
height: 30rpx;
background: rgba(162, 224, 250, 1);
margin-right: 15rpx;
}
.new_learn1 {
width: 30rpx;
height: 30rpx;
background: rgba(255, 255, 255, 1);
margin-right: 15rpx;
}
.review {
width: 40rpx;
height: 74rpx;
background: rgba(162, 224, 250, 1);
border-radius: 20rpx;
font-size: 24rpx;
color: #fff;
display: flex;
align-items: flex-end;
justify-content: center;
padding-bottom: 7rpx;
}
.new_learn {
width: 40rpx;
height: 146rpx;
background: rgba(255, 255, 255, 1);
border-radius: 20rpx;
font-size: 24rpx;
color: #4ac7fb;
display: flex;
align-items: flex-end;
justify-content: center;
padding-bottom: 7rpx;
}
.symble_box .lowheight{
height: 74rpx;
}
.symble_box .gao_height{
height: 146rpx;
}
.top {
margin-bottom: 50rpx;
}
.left {
margin-left: 37rpx;
}
... ...
// pages/community/community.js
const app=getApp();
Page({
/**
* 页面的初始数据
*/
data: {
current:0,
listdata:[],
slide:'',
cate_id: 15//GMAT高分故事->15,资讯发布->16
},
tabCharge(e){
let that=this;
if (parseInt(e.currentTarget.dataset.current) == 0){
that.setData({
current: e.currentTarget.dataset.current,
cate_id:15
})
that.getdata();
} else if (parseInt(e.currentTarget.dataset.current) == 1){
that.setData({
current: e.currentTarget.dataset.current,
cate_id: 16
})
that.getdata();
}
},
//列表详情
listDetail(e){
wx.navigateTo({
url: '../communityDetail/communityDetail?id='+e.currentTarget.id,
})
},
getdata(){
let that=this;
let url ='Show/getShow6';
app.post(url, { cate_id: that.data.cate_id}).then((res)=>{
if(res.data.code==1){
that.setData({
listdata:res.data.data
})
}
}).catch((errMsg)=>{
console.log(errMsg)
})
},
//获取banner图(1代表首页图片,2代表社区模板最上方图片)
getSlide() {
let that = this;
let url = 'Common/getSlide';
let params = {
id: 2
}
app.post(url, params).then((res) => {
that.setData({
slide: res.data.data[0]
})
}).catch((err) => {
console.log(err)
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
let that=this;
that.getdata();
that.getSlide();
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})
\ No newline at end of file
... ...
{"navigationBarTitleText": "社区"}
\ No newline at end of file
... ...
<!--pages/community/community.wxml-->
<view class='banner_box'>
<view class='title'>社区</view>
<navigator class='banner_img' hover-class='none' url='/pages/out/out?url={{slide.url}}'>
<image src='{{slide.image}}'></image>
</navigator>
</view>
<view class='content_box'>
<view class='tab_content'>
<view class='tab_box'>
<view class="tab_item {{current==0?'active':''}}" data-current='0' bindtap='tabCharge'>GMAT高分故事</view>
<view class="tab_item {{current==1?'active':''}}" data-current="1" bindtap='tabCharge'>资讯发布</view>
</view>
</view>
<view class='content_item' >
<block wx:if='{{listdata.length !=0}}'>
<view class='item_list' bindtap='listDetail' wx:for='{{listdata}}' wx:key id='{{item.id}}'>
<view>
<view>{{item.title}}</view>
<view class='date'>{{item.update_time}}</view>
</view>
<view class='iconfont icon-jiantouarrow487'></view>
</view>
</block>
<block wx:else>
<view class='nodata'>暂无数据</view>
</block>
</view>
</view>
\ No newline at end of file
... ...
/* pages/community/community.wxss */
page {
background: #fafafa;
}
.banner_box {
background: #fff;
padding: 30rpx;
/* position: fixed; */
}
.title {
font-size: 48rpx;
font-weight: bold;
color: #1a1a1a;
}
.banner_img {
width: 100%;
height: 340rpx;
display: flex;
align-items: center;
justify-content: center;
margin-top: 34rpx;
border-radius: 10rpx;
overflow: hidden;
}
.banner_img image {
width: 100%;
height: 100%;
}
.content_box {
background: #fff;
padding: 0 30rpx;
margin-top: 20rpx;
}
.tab_content{
padding: 0 20rpx;
}
.tab_box {
display: flex;
align-items: center;
justify-content: space-between;
border-bottom: 1rpx solid #ebebeb;
padding: 30rpx 100rpx;
}
.tab_item {
font-size: 28rpx;
color: #666;
position: relative;
}
.tab_item.active {
font-size: 32rpx;
color: #1db9fa;
}
.tab_item.active::after {
content: "";
width: 62rpx;
height: 8rpx;
background: rgba(29, 185, 250, 1);
border-radius: 3rpx;
position: absolute;
bottom: -30rpx;
left: 50%;
transform: translateX(-50%);
}
.item_list {
background: rgba(245, 248, 252, 1);
border-radius: 10rpx;
margin-top: 20rpx;
font-size: 28rpx;
color: #000000;
display: flex;
align-items: center;
justify-content: space-between;
padding: 30rpx;
}
.date{
font-size: 28rpx;
color: #999999;
margin-top: 10rpx;
}
.icon-jiantouarrow487{
color: #ccc;
}
.content_item{
padding-bottom: 20rpx;
}
\ No newline at end of file
... ...
const app = getApp();
var wxParse = require("../../wxParse/wxParse.js")
Page({
/**
* 页面的初始数据
*/
data: {
listdata: []
},
getdata(id) {
let that = this;
let url = 'Show/getShow6Detail';
app.post(url, { id: id }).then((res) => {
console.log(res)
if (res.data.code == 1) {
that.setData({
listdata: res.data.data
})
wx.setNavigationBarTitle({
title: res.data.data.title
})
wxParse.wxParse('content', 'html', res.data.data.content, that, 5)
}
}).catch((errMsg) => {
console.log(errMsg)
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
let that = this;
that.getdata(options.id);
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})
\ No newline at end of file
... ...
{"navigationBarTitleText": "社区文章详情"}
\ No newline at end of file
... ...
<!--pages/communityDetail/communityDetail.wxml-->
<view class='null_box'></view>
<view class='content_box'>
<view>
<view class='title'>{{listdata.title}}</view>
<view class='content'>
<import src="../../wxParse/wxParse.wxml" />
<template is='wxParse' data='{{wxParseData:content.nodes}}' />
</view>
<view class='date'>{{listdata.update_time}}</view>
</view>
</view>
\ No newline at end of file
... ...
/* pages/communityDetail/communityDetail.wxss */
@import "/pages/index/goldArticle/goldArticle.wxss";
.title {
font-size: 36rpx;
font-weight: bold;
color: #1a1a1a;
text-align: center;
margin-top: 20rpx;
}
.content {
font-size: 26rpx;
color: #666;
margin-top: 49rpx;
line-height: 50rpx;
box-sizing: border-box;
}
.content image{
width:100%;
}
.date {
font-size: 30rpx;
color: #707070;
text-align: right;
margin-top: 92rpx;
}
\ No newline at end of file
... ...
// pages/contact/contact.js
Page({
/**
* 页面的初始数据
*/
data: {
},
tel(){
wx.showModal({
title: '提示',
content: '是否拨打客服400-728-0020',
showCancel: true,
cancelText: '取消',
cancelColor: '',
confirmText: '确定',
confirmColor: '',
success: function(res) {
wx.makePhoneCall({
phoneNumber: '400-728-0020',
})
},
fail: function(res) {},
complete: function(res) {
},
})
},
gomy(){
wx.switchTab({
url: '/pages/my/my',
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})
\ No newline at end of file
... ...
{"navigationBarTitleText": "单词小程序"}
\ No newline at end of file
... ...
<!--pages/contact/contact.wxml-->
<view bindtap='tel'>全国统一客服:400-728-0020</view>
<view>大仙课程咨询:</view>
<view>KEVAN老师微信:18001662020</view>
<view>小林老师微信:15618952569</view>
<view>E-MAIL:service@igmat.cn</view>
<view>地址:上海静安区南京西路580号40层4003室</view>
<view class='btn' bindtap='gomy'>返回</view>
... ...
/* pages/contact/contact.wxss */
page{
background: linear-gradient(#1fbbfa,#6cf0f9);
padding:30rpx;
box-sizing: border-box;
color:#fff;
font-size:32rpx;
line-height: 3;
text-align: center;
}
.btn{
margin: 160rpx auto 0 auto;
font-size:32rpx;
color:#fff;
width:520rpx;
height:80rpx;
background:#1fbbfa;
border-radius:40rpx;
display:flex;
align-items:center;
justify-content:center;
}
.btn:active{
opacity: 0.7;
}
\ No newline at end of file
... ...
// pages/course/course.js
const app = getApp()
Page({
data: {
imgsUrls:[],
currentindex: 0,
current: 0,
cate_id: 8,//备考策略->8,解题方法->9,经典系列->10
listinfo:[],
},
handleChange(e) {
this.setData({
currentindex: e.detail.current
})
},
chargeTab(e) {
this.setData({
current: e.currentTarget.dataset.current
})
if (this.data.current == 0) {
this.setData({
cate_id: 8
})
this.testStrategy()
} else if (this.data.current == 1) {
this.setData({
cate_id: 9
})
this.testStrategy()
} else if (this.data.current == 2) {
this.setData({
cate_id: 10
})
this.testStrategy()
}
},
courseDetail(e) {
var id=e.currentTarget.dataset.id
wx.navigateTo({
url: '../course/courseDetail/courseDetail?id='+id,
})
},
//获取听大仙讲GMAT列表
//备考策略->8,解题方法->9,经典系列->10
testStrategy() {
let url = 'Show/getShow1'
let params = {
cate_id: this.data.cate_id
}
app.post(url, params).then((res) => {
if(res.data.code==1){
this.setData({
listinfo:res.data.data
})
}
}).catch((errMsg)=>{
console.log(errMsg)
})
},
//获取听大仙讲GMATbanner
GMATbanner(){
let that=this;
let url ='Show/getShow7';
app.post(url,{}).then((res)=>{
console.log(res)
if(res.data.code==1){
that.setData({
imgsUrls:res.data.data
})
}
}).catch((errMsg)=>{
console.log(errMsg)
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function(options) {
let that=this;
this.testStrategy();
that.GMATbanner();
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function() {
}
})
\ No newline at end of file
... ...