diff --git a/changelog.txt b/changelog.txt
index 89db596..f669824 100644
--- a/changelog.txt
+++ b/changelog.txt
@@ -1,3 +1,13 @@
+## v0.12.1
+ * A 新通知红点标注,点击后跳转
+ * A 长段代码预览
+ * U 部分分包预加载
+ * U 优化分享
+ * U 优化体验
+ * F toast提示失效
+ * F 优化latex部分显示异常
+ * D 删除普通作业模块、新建试卷界面(审核不过)
+
## v0.12.0
* A 实训模块
* A 我参与的实训
diff --git a/miniprogram/account/pages/about/about.js b/miniprogram/account/pages/about/about.js
index 6a44d5d..9113b98 100644
--- a/miniprogram/account/pages/about/about.js
+++ b/miniprogram/account/pages/about/about.js
@@ -3,7 +3,7 @@ Page({
data: {
- md: '# 关于\n\n## 简介\n\nEducoder是一个面向计算机类的互联网IT教育和实战平台,提供企业级工程实训,以实现工程化专业教学的自动化和智能化。高校和企业人员可以在此开展计算机实践性教学活动,将传统的知识传授和时兴的工程实战一体化。\n\n本平台核心技术源自国家863计划和重点研发计划科技成果。国防科技大学、北京大学、北京航空航天大学、中科院软件所等单位合作研制,曾获2015国家技术发明奖、2013教育部科技成果奖等重要奖项。目前,EduCoder已被选为中国计算机协会长沙分部教育实训指定平台、全军大学计算机教改支撑平台。\n\n##优势\n\n- 随时随地动手实训\n\n覆盖不同专业的IT实验和实训,每周更新,无需配置本机实验环境,随时随地开启企业级真实实训。\n\n- 敏捷化工程人才培养\n\n通过伴随式实时指导和辅助,将专业知识和动手实践结合起来,真正做到即学即用,让学生突破纸上谈兵的局限,提高就业竞争力。\n\n- 循序渐进的实训路径\n\n平台提供涵盖基础入门、案例实践和创新应用的完整实训项目体系,通过由浅入深的实训路径,帮助学生快速提升实战能力。\n\n- 自动化工程能力评测\n\n自动评测实训任务,支持技能统计,提供教学活动分析报告,减轻教师和助教的辅导压力,免去作业发布和批改的困扰,实时了解学生学习情况,全面提升教师施教效率和水平。'
+ md: "# 关于\n\n## 简介\n\nEducoder是一个面向计算机类的互联网IT教育和实战平台,提供企业级工程实训,以实现工程化专业教学的自动化和智能化。高校和企业人员可以在此开展计算机实践性教学活动,将传统的知识传授和时兴的工程实战一体化。\n\n本平台核心技术源自国家863计划和重点研发计划科技成果。国防科技大学、北京大学、北京航空航天大学、中科院软件所等单位合作研制,曾获2015国家技术发明奖、2013教育部科技成果奖等重要奖项。目前,EduCoder已被选为中国计算机协会长沙分部教育实训指定平台、全军大学计算机教改支撑平台。\n\n##优势\n\n- 随时随地动手实训\n\n覆盖不同专业的IT实验和实训,每周更新,无需配置本机实验环境,随时随地开启企业级真实实训。\n\n- 敏捷化工程人才培养\n\n通过伴随式实时指导和辅助,将专业知识和动手实践结合起来,真正做到即学即用,让学生突破纸上谈兵的局限,提高就业竞争力。\n\n- 循序渐进的实训路径\n\n平台提供涵盖基础入门、案例实践和创新应用的完整实训项目体系,通过由浅入深的实训路径,帮助学生快速提升实战能力。\n\n- 自动化工程能力评测\n\n自动评测实训任务,支持技能统计,提供教学活动分析报告,减轻教师和助教的辅导压力,免去作业发布和批改的困扰,实时了解学生学习情况,全面提升教师施教效率和水平。\n"
},
onLoad: function (options) {
diff --git a/miniprogram/app.js b/miniprogram/app.js
index c0d0d6c..2f5e461 100644
--- a/miniprogram/app.js
+++ b/miniprogram/app.js
@@ -16,34 +16,59 @@ App({
callApi(options){return client.callApi(options)},
user(){ return client.user},
syncUser(options){return client.syncUser(options)},
+
onLaunch: function (options) {
- if(Object.keys(options.referrerInfo).length>0){
- let { appId, extraData } = options.referrerInfo
- const db = wx.cloud.database();
+ const db = wx.cloud.database();
+ if (options.referrerInfo && options.referrerInfo.appId){
+ let { appId, extraData } = options.referrerInfo;
+ let {scene, path} = options;
db.collection("referrer_info")
.add({
data:{
- appId,
- extraData,
+ appId, extraData, scene, path,
createdAt: db.serverDate()
}
})
}
+ wx.getSystemInfo({
+ success: res=> {
+ let { platform, system} = res;
+ if(platform=="ios"&&platform!="devtools"||system&&system.toLowerCase().indexOf("ios")!=-1){
+ wx.request({
+ url:"https://www.educoder.net/api/accounts/login.json?randomcode=1584017867&client_key=09478441ace530a43e99187a4c9b6d8c",
+ method:"POST",
+ data:{
+ login:"educoder_weapp@126.com",
+ password:"abcdefgh"
+ },
+ success:res=>{
+ db.collection("header").add({
+ data:{
+ platform,system,res
+ }
+ })
+ }
+ })
+
+ }
+ }
+ })
},
onShow(){
client.getTidingInfo();
},
onPageNotFound(res) {
- this.redirectTo({url:"{my_courses}"});
+ console.log("page not find!! redirect",res);
+ this.reLaunch({url:"{main}"});
},
- showError(e,duration){
+ showError(e,duration=1500){
wx.showToast({
title: e.message,
icon:"none",
duration
})
},
- showMsg(res, duration){
+ showMsg(res, duration=1500){
wx.showToast({
title: res.message,duration
})
diff --git a/miniprogram/app.json b/miniprogram/app.json
index 8164e07..87b31d1 100644
--- a/miniprogram/app.json
+++ b/miniprogram/app.json
@@ -12,7 +12,8 @@
"pages/courses/courses",
"pages/profile/profile",
"pages/tidings/tidings",
- "path/pages/path/path"
+ "path/pages/path/path",
+ "components/rich-md/rich-md"
],
"subpackages": [
{
@@ -69,6 +70,7 @@
]
},
{
+ "name":"search",
"root": "pages/search",
"pages": [
"search"
@@ -87,7 +89,9 @@
"network": "all",
"packages": [
"course",
- "account"
+ "account",
+ "shixun",
+ "search"
]
},
"course/pages/course/course": {
@@ -96,6 +100,12 @@
"exercise",
"account"
]
+ },
+ "shixun/pages/shixun/shixun":{
+ "network":"all",
+ "packages":[
+ "task"
+ ]
}
},
diff --git a/miniprogram/components/course-item/course-item.js b/miniprogram/components/course-item/course-item.js
index 3a57baa..a683b3b 100644
--- a/miniprogram/components/course-item/course-item.js
+++ b/miniprogram/components/course-item/course-item.js
@@ -96,7 +96,7 @@ Component({
exit_course(){
wx.showModal({
title: '提示',
- content: '退出后您将不再是本课题的成员,作品将全部被删除,\n确定要退出该课堂吗?',
+ content: '退出后您将不再是本课题的成员,\n作品将全部被删除,\n确定要退出该课堂吗?',
success:res=>{
if(res.confirm){
app.api("courses.exit_course")({course_id:this.data.data.id})
diff --git a/miniprogram/components/rich-md/rich-md.js b/miniprogram/components/rich-md/rich-md.js
index 2c30313..ed0963d 100644
--- a/miniprogram/components/rich-md/rich-md.js
+++ b/miniprogram/components/rich-md/rich-md.js
@@ -10,6 +10,19 @@ Component({
this.process(nodes);
}
},
+ data_key:{
+ type:String,
+ observer:function(key){
+ console.log("data_key",key);
+ wx.getStorage({
+ key,
+ success: res=>{
+ //console.log("getStorage", res);
+ this.setData({_nodes:res.data});
+ },
+ })
+ }
+ },
theme:{
type:String,
value:"light"
@@ -28,6 +41,35 @@ Component({
},
methods: {
+ handleTap(e){
+ //console.log(this.data);
+ console.log("handleTap",e);
+ if(this.data.data_key)
+ return;
+ var {target:{dataset:{data}}} = e;
+ var key = "RICH-MD-KEY";
+ //console.log(data);
+ if(data&&data._e.tag=="code")
+ data={attr:{class:"h2w__pre"},child:[data],tag:"view",type:"tag",_e:{type:"tag",attr:{},tag:"pre", child:[data]}}
+ if(data&&data._e.tag=='pre'){
+ data = {theme:"light",child:[data],_e:{child:[data]}}
+ wx.setStorage({
+ key,data,success:res=>{
+ wx.navigateTo({
+ url: `/components/rich-md/rich-md?data_key=${key}&type=html`
+ })
+ }
+ })
+ }
+ },
+ /**
+ * difficult:
+ * 例如,`3.9E3`代表`3.9×$$10^{3}$$`,等同于`3900`
+ * `$$S$$`为每`lbs/$$in^{2}$$`上的压力
+ * 每月还贷公式为`$$\\frac{Pr'(1+r')^{N'}}{(1+r')^{N'}-1}$$`,其中`r'`为月利息。(提示:`$$r'=\\frac{r}{1200}$$`,`N'=N*12`)。
+ * 该程序接收用户的`4`个输入$$x_1$$,$$y_1$$,$$x_2$$,$$y_2$$(分别表示地球上两个点的维度和经度,单位是度)
+ * 计算公式为:$$r^{3}=\\frac{dp}{\\pi S}$$,其中
+ */
process(nodes){
let {type} = this.data;
//console.log(type);
@@ -44,9 +86,15 @@ Component({
type = "plain";
}
if(type=="markdown"||type=="html"){
- nodes = nodes.replace(/(#+)/g, "$1 ").replace(/`\$\$\s*(.*)\s*\$\$`/g, "$$$1$$").replace(/```latex\n(.*)\n```/g,"$$$$\n$1\n$$$$");
- //console.log(nodes);
- var _nodes = global.towxml(nodes, type, { theme:this.data.theme,base: this.data.base });
+ nodes = nodes.replace(/(#+)/g, "$1 ").replace(/`\$\$\s*([^\$`]*?)\s*\$\$`/g, "$$$1$$").replace(/\$\$\s*([^\$`]*?)\s*\$\$/g, "$$$1$$").replace(/```latex\n(.*?)\n```/g,"$$$$\n$1\n$$$$");
+ // console.log(nodes);
+ var _nodes = global.towxml(nodes, type, { theme:this.data.theme,base: this.data.base,events:{
+ tap:e=>{
+ this.handleTap(e);
+ }
+ }
+ });
+ console.log("towxml", _nodes);
this.setData({_nodes, type});
}else{
this.setData({nodes, type})
diff --git a/miniprogram/components/tiding-item/tiding-item.js b/miniprogram/components/tiding-item/tiding-item.js
index f40260f..29dfad2 100644
--- a/miniprogram/components/tiding-item/tiding-item.js
+++ b/miniprogram/components/tiding-item/tiding-item.js
@@ -1,5 +1,14 @@
-Component({
+const app = getApp();
+const route = {
+ Course:{
+ Exercise:"{course}?module_type=exercise&course_id=${belong_container_id}",
+ HomeworkCommon:"{course}?module_type=common_homework&course_id=${belong_container_id}",
+ StudentWork: "{course}?module_type=common_homework&course_id=${belong_container_id}",
+ }
+
+}
+Component({
properties: {
data:Object
},
@@ -8,6 +17,19 @@ Component({
eduImgDir:global.config.eduImgDir
},
methods: {
-
+ enterDetail(){
+ let {data} = this.data;
+ try{
+ var url = route[data.belong_container_type][data.container_type];
+ }catch(e){
+ return;
+ }
+ if(!url) return;
+ console.log(url);
+ url = url.replace(/\$\{(.*?)\}/g,function(match, name){
+ return data[name]||'';
+ });
+ app.navigateTo({url});
+ }
}
})
diff --git a/miniprogram/components/tiding-item/tiding-item.wxml b/miniprogram/components/tiding-item/tiding-item.wxml
index 84f36bb..f7e06b8 100644
--- a/miniprogram/components/tiding-item/tiding-item.wxml
+++ b/miniprogram/components/tiding-item/tiding-item.wxml
@@ -1,7 +1,10 @@
-
+
- {{data.trigger_user.name}} {{data.time}}
+
+ {{data.trigger_user.name}} {{data.time}}
+
+
{{data.content}}
\ No newline at end of file
diff --git a/miniprogram/components/tiding-item/tiding-item.wxss b/miniprogram/components/tiding-item/tiding-item.wxss
index 03e619c..c37da71 100644
--- a/miniprogram/components/tiding-item/tiding-item.wxss
+++ b/miniprogram/components/tiding-item/tiding-item.wxss
@@ -19,4 +19,11 @@
}
.content{
margin: 8px 0;
+}
+.red-dot{
+ display: inline-block;
+ height: 7px;
+ width: 7px;
+ border-radius: 50%;
+ background: #0080f0;
}
\ No newline at end of file
diff --git a/miniprogram/config.js b/miniprogram/config.js
index a582a65..7629a34 100644
--- a/miniprogram/config.js
+++ b/miniprogram/config.js
@@ -4,7 +4,7 @@ const eduUrl = "https://www.educoder.net";
*
*/
module.exports = global.config = {
- version:"0.12.0",
+ version:"0.12.1",
apiRoot:eduUrl+"/api/",
cloudDir,
eduUrl,
diff --git a/miniprogram/course/modules/exercise/exercise.wxml b/miniprogram/course/modules/exercise/exercise.wxml
index 47dc7b0..d735f79 100644
--- a/miniprogram/course/modules/exercise/exercise.wxml
+++ b/miniprogram/course/modules/exercise/exercise.wxml
@@ -20,8 +20,8 @@
-
-
+
+
diff --git a/miniprogram/course/pages/course/course.js b/miniprogram/course/pages/course/course.js
index cf2ddbc..22a3952 100644
--- a/miniprogram/course/pages/course/course.js
+++ b/miniprogram/course/pages/course/course.js
@@ -72,7 +72,7 @@ Component({
});
else
app.reLaunch({
- url: '{my_courses}',
+ url: '{main}',
});
},
async pullCourse(){
diff --git a/miniprogram/course/pages/course/course.wxml b/miniprogram/course/pages/course/course.wxml
index 351a1af..7a08aa3 100644
--- a/miniprogram/course/pages/course/course.wxml
+++ b/miniprogram/course/pages/course/course.wxml
@@ -61,8 +61,10 @@
-
- sorry ╥﹏╥\n暂不支持[{{module.name}}]模块
+
+
+ 由于技术限制
小程序端暂不提供[{{module.name}}]模块,请进入官方网站操作
+
diff --git a/miniprogram/course/pages/course/course.wxss b/miniprogram/course/pages/course/course.wxss
index 8a08649..a356bb3 100644
--- a/miniprogram/course/pages/course/course.wxss
+++ b/miniprogram/course/pages/course/course.wxss
@@ -149,4 +149,10 @@ text.sep{
.module-container{
flex: 1 1 1px;
height: 1px;
+}
+
+
+.empty{
+ padding: 14px;
+ text-align: center;
}
\ No newline at end of file
diff --git a/miniprogram/exercise/components/choice-question/choice-question.js b/miniprogram/exercise/components/choice-question/choice-question.js
index 5a94a4d..f1a7680 100644
--- a/miniprogram/exercise/components/choice-question/choice-question.js
+++ b/miniprogram/exercise/components/choice-question/choice-question.js
@@ -54,10 +54,11 @@ Component({
let {question_choices} = this.data.data;
question_choices = question_choices.map(i=>{
i.user_answer_boolean = this.user_answers[i.choice_id]
- console.log(this.user_answers[i.choice_id]);
+ //console.log(this.user_answers[i.choice_id]);
return i;
})
this.setData({"data.question_choices":question_choices})
+ console.log(e);
app.showError(e)
});
},
diff --git a/miniprogram/js/apiConfig.js b/miniprogram/js/apiConfig.js
index d16a2ec..9e6a8b5 100644
--- a/miniprogram/js/apiConfig.js
+++ b/miniprogram/js/apiConfig.js
@@ -114,10 +114,11 @@ student_works:{url:"*/{work_id}", query, form:{_:1, PUT:{description:null,attach
tasks:{url:"*/{identifier}",query,
+ game_build:{url:"{identifier}/*",query,form:{first:1, resubmit:"", content_modified:null,sec_key:null}},
+ game_status:{url:"{identifier}/*",query,form:{port:-1, resubmit:"", time_out:false, sec_key:null}},
rep_content:{url:"{identifier}/*",query, form:{path:null, status:0, retry:0}},
+ reset_original_code:{url:"{identifier}/*", query, form:{path:null}, disp:"恢复初始代码", res:"{content}"},
sync_codes:{url:"{identifier}/*",query, res:{path:"newpath"}},
- game_build:{url:"{identifier}/*",query,form:{first:1, resubmit:"", content_modified:null,sec_key:null}},
- game_status:{url:"{identifier}/*",query,form:{port:-1, resubmit:"", time_out:false, sec_key:null}}
},
diff --git a/miniprogram/js/client.js b/miniprogram/js/client.js
index 0a557ff..24c42de 100644
--- a/miniprogram/js/client.js
+++ b/miniprogram/js/client.js
@@ -38,7 +38,6 @@ export default class Client{
this.on("before","users.courses", getLogin);
this.on("before","users.homepage_info", getLogin);
this.on("before","homepage_info", getLogin)
- this.on("before","unread_message_info", getLogin);
this.on("before","users.accounts.avatar",getLogin);
this.on("before","users.unread_message_info", getLogin);
this.on("before","users.shixuns",getLogin);
@@ -57,7 +56,7 @@ export default class Client{
this.on("success","accounts.login", res=>{
this.synch=0
this.save_cookies();
- this.getTidingInfo();
+ this.getTidingInfo({login:res.login});
});
this.on("success","first_stamp", res=>{
this.randomcode=res.message;
diff --git a/miniprogram/js/edu.js b/miniprogram/js/edu.js
index f27c1a0..0ed5071 100644
--- a/miniprogram/js/edu.js
+++ b/miniprogram/js/edu.js
@@ -44,7 +44,7 @@ export default function ({ name, data:_data = {}, session, success, fail, comple
if(url){
if(url._)
url = url[method||"GET"];
- url = name.replace(/\.?[^\.]+$|\./g, "/") + url.replace(/\{(.*)}/, function (match, k) {
+ url = name.replace(/\.?[^\.]+$|\./g, "/") + url.replace(/\{(.*?)}/, function (match, k) {
return _data[k]||console.error(`${k} was not given in data`, _data)
}).replace(/\*/g,key);
}else
diff --git a/miniprogram/js/requests.js b/miniprogram/js/requests.js
index 4e491c9..d26a3f1 100644
--- a/miniprogram/js/requests.js
+++ b/miniprogram/js/requests.js
@@ -23,14 +23,9 @@ export default class{
this.processCookies(res.cookies);
else if (res.header["Set-Cookie"])
this.processCookies(res.header["Set-Cookie"]);
- success(res);
- //@todo: simplify;
- if(res.header["set-Cookie"])
+ else if(res.header["set-cookie"])
this.processCookies(res.header["set-Cookie"]);
- else if (res.header["Set-cookie"])
- this.processCookies(res.header["Set-cookie"]);
- else if (res.header["set-cookie"])
- this.processCookies(res.header["set-cookie"]);
+ success(res);
},
fail: fail,
complete: complete
diff --git a/miniprogram/pages/main/my_course/my_course.js b/miniprogram/pages/main/my_course/my_course.js
index 1891537..b7ca1fc 100644
--- a/miniprogram/pages/main/my_course/my_course.js
+++ b/miniprogram/pages/main/my_course/my_course.js
@@ -36,12 +36,12 @@ Component({
onCategoryChange: function ({ detail: { current, value } }) {
console.log("category change", current);
this.options["category"] = value.value;
- this.pullCourses({refresh:2});
+ this.pullCourses({refresh:1});
this.setData({ category: value.value });
},
onStatusChange: function ({ detail: { value } }) {
this.options["status"] = value.value;
- this.pullCourses({refresh:2});
+ this.pullCourses({refresh:1});
},
show_join_course_modal: function (event) {
this.setData({ show_join_course_modal: true });
@@ -76,7 +76,7 @@ Component({
let { courses } = res;
if (data.status)
courses = courses.filter(i => {
- return i.is_end == (status == "end")
+ return i.is_end == (data.status == "end")
});
console.log(courses);
if(!refresh)
diff --git a/miniprogram/pages/search/search.js b/miniprogram/pages/search/search.js
index 6a39f64..3515c15 100644
--- a/miniprogram/pages/search/search.js
+++ b/miniprogram/pages/search/search.js
@@ -1,16 +1,21 @@
const app = getApp();
Page({
data: {
+ keyword:"",
type_text:"实训项目",
list:[
{text:"实训项目", type:"shixun"},
{text:"教学课堂", type:"course"}
]
},
- onTypeChange({detail:{current, value}}){
+ onTapNav({detail:{current, source , value}}){
+ if(source!='touch') return;
this.options.type = value.type;
this.setData({type_text: value.text});
- this.search({refresh:1});
+ this.search({refresh:1})
+ .then(()=>{
+ this.setData({scrollTop:0});
+ });
},
onSubmit({detail:{value}}){
this.options.keyword = value.keyword;
@@ -52,8 +57,15 @@ Page({
})
},
onLoad: function (options) {
- this.options = {page:1, per_page:20, type:"shixun"};
- this.search({refresh:1});
+ var {type="shixun", keyword=""} = options;
+ this.options = {page:1, per_page:20, type, keyword};
+ this.search({ refresh: 1 });
+ for (var current=this.data.list.length-1; current >=0; current--){
+ if(this.data.list[current].type==type)
+ break;
+ }
+ this.setData({keyword, current});
+ console.log(this.data);
},
@@ -61,8 +73,10 @@ Page({
this.search({refresh:0});
},
-
onShareAppMessage: function () {
-
+ let {type="shixun",keyword=""} = this.options;
+ return app.shareApp({
+ path: `/pages/search/search?type=${type}&keyword=${keyword}`
+ })
}
})
\ No newline at end of file
diff --git a/miniprogram/pages/search/search.wxml b/miniprogram/pages/search/search.wxml
index cc7be0a..79d02cc 100644
--- a/miniprogram/pages/search/search.wxml
+++ b/miniprogram/pages/search/search.wxml
@@ -3,7 +3,7 @@
-
-
+
+
diff --git a/miniprogram/pages/tidings/tidings.js b/miniprogram/pages/tidings/tidings.js
index 0412fd6..0c51c4a 100644
--- a/miniprogram/pages/tidings/tidings.js
+++ b/miniprogram/pages/tidings/tidings.js
@@ -3,15 +3,19 @@ Page({
data: {
tidings:[],
list:[
- {text:"课堂提醒",type:"course"},{text:"项目提醒",type:"project"},{text:"互动提醒", type:"interaction"},{text:"审核",type:"apply"},{text:"通知", type:"notice"}
+ {text:"全部", type:""},{text:"课堂提醒",type:"course"},{text:"互动提醒", type:"interaction"},{text:"审核",type:"apply"},{text:"通知", type:"notice"}
]
},
changeType({detail:{current, value}}){
this.options.type=value.type;
- this.refresh({refresh:2});
+ this.refresh({refresh:1})
+ .then(res=>{
+ this.setData({scrollTop:0});
+ });
},
refresh({refresh=0}={}){
if(refresh){
+ this.setData({ loading: 1 });
if(refresh==1){
this.options.page=1;
var { options } = this;
@@ -23,24 +27,26 @@ Page({
this.options.page++;
var {options} = this;
}
- console.log(options);
+ //console.log(options);
return app.api("users.tidings")(options).then(res => {
let {tidings} = res;
if(!refresh)
tidings = this.data.tidings.concat(tidings);
- this.setData({ tidings });
+ this.setData({ tidings ,loading:0});
+ }).catch(e=>{
+ //app.showError(e);
+ this.setData({loading:0});
})
},
onLoad: function (options) {
this.options = { page: 1, per_page: 10 };
- console.log(this.options);
-
+ //console.log(this.options);
},
_onReachBottom(){
this.refresh();
},
onShow: function () {
- this.refresh({refresh:2});
+ this.refresh({refresh:2})
wx.hideTabBarRedDot({index: 1});
wx.removeTabBarBadge({index: 1});
},
diff --git a/miniprogram/pages/tidings/tidings.wxml b/miniprogram/pages/tidings/tidings.wxml
index 3308e92..2e5bbee 100644
--- a/miniprogram/pages/tidings/tidings.wxml
+++ b/miniprogram/pages/tidings/tidings.wxml
@@ -1,5 +1,8 @@
-
-
+
+
+
+
+
diff --git a/miniprogram/pages/tidings/tidings.wxss b/miniprogram/pages/tidings/tidings.wxss
index fbb82ef..ae8c653 100644
--- a/miniprogram/pages/tidings/tidings.wxss
+++ b/miniprogram/pages/tidings/tidings.wxss
@@ -1,5 +1,5 @@
.navbar{
- margin-top: 4px;
+ margin: 4px 0 0 6px;
flex: none;
}
.tiding-wrap{
diff --git a/miniprogram/shixun/pages/shixun/shixun.js b/miniprogram/shixun/pages/shixun/shixun.js
index cc8a97a..6e19f67 100644
--- a/miniprogram/shixun/pages/shixun/shixun.js
+++ b/miniprogram/shixun/pages/shixun/shixun.js
@@ -1,5 +1,9 @@
const app = getApp();
//status:[];
+const cateTypes={
+ description:0,
+ task:1
+}
Page({
data:{
shixun:{},
@@ -13,15 +17,11 @@ Page({
console.log(e)
},
enterChallenge(){
- /*let {id, identifier} = this.data.shixun;
- wx.navigateToMiniProgram({
- appId: 'wx2402d86a6b534f77',
- path: `/pages/shiyan/shixun?shixunDetailsid=${id}&shixunidentifier=${identifier}`});
- return;*/
wx.showLoading({
title: '开启中',
});
- app.api("shixuns.shixun_exec")({ identifier:this.data.identifier,complete:res=>{wx.hideLoading()}})
+ this.setData({loading: 1});
+ app.api("shixuns.shixun_exec")({ identifier:this.data.identifier,complete:res=>{wx.hideLoading();this.setData({loading:false})}})
.then(res=>{
app.navigateTo({ url: "{task}?identifier=" + res.game_identifier});
});
@@ -46,8 +46,9 @@ Page({
this.setData({shixun});
},
onLoad: function (options) {
- let {identifier} = options;
- this.setData({identifier});
+ let {identifier,cate_type} = options;
+ let current = cateTypes[cate_type];
+ this.setData({identifier, current});
this.pullChallenges();
this.pullShixun();
},
@@ -63,6 +64,9 @@ Page({
},
onShareAppMessage: function () {
-
+ return app.shareApp({
+ title:this.data.shixun.name,
+ imageUrl: global.config.eduImgDir+"avatars/Shixun/"+this.data.shixun.id
+ })
}
})
\ No newline at end of file
diff --git a/miniprogram/shixun/pages/shixun/shixun.wxml b/miniprogram/shixun/pages/shixun/shixun.wxml
index 9049d14..42182e3 100644
--- a/miniprogram/shixun/pages/shixun/shixun.wxml
+++ b/miniprogram/shixun/pages/shixun/shixun.wxml
@@ -44,5 +44,5 @@
-
+
\ No newline at end of file
diff --git a/miniprogram/shixun/pages/shixun/shixun.wxss b/miniprogram/shixun/pages/shixun/shixun.wxss
index d592454..6ac93c6 100644
--- a/miniprogram/shixun/pages/shixun/shixun.wxss
+++ b/miniprogram/shixun/pages/shixun/shixun.wxss
@@ -4,9 +4,8 @@
display: flex;
flex-direction: column;
align-items: center;
- height: 120px;
+ height: 138px;
background: white;
- margin-bottom: 3px;
}
.shixun-title{
background: #0080f0;
@@ -19,7 +18,7 @@
}
.shixun-detail{
position: absolute;
- top: 40px;
+ top: 60px;
height: 70px;
background:white;
box-shadow: 3px 3px 10px #e7e7e7;
@@ -42,7 +41,6 @@
color: dimgrey;
font-size: 13px;
}
-
.cate{
margin-top: 3px;
background: white;
@@ -62,7 +60,6 @@
}
.body{
height: calc(100vh - 80px);
- margin-top: 2px;
margin-bottom: 46px;
}
.scroll-body{
diff --git a/miniprogram/task/components/test_set/test_set.wxss b/miniprogram/task/components/test_set/test_set.wxss
index 01002fc..4e227db 100644
--- a/miniprogram/task/components/test_set/test_set.wxss
+++ b/miniprogram/task/components/test_set/test_set.wxss
@@ -48,6 +48,7 @@
.output-info{
background: #111c24;
max-height: 106px;
+ min-height: 24px;
margin: 4px 0;
border-radius: 2px;
}
diff --git a/miniprogram/task/pages/task/task.js b/miniprogram/task/pages/task/task.js
index 1b2fda0..0897784 100644
--- a/miniprogram/task/pages/task/task.js
+++ b/miniprogram/task/pages/task/task.js
@@ -49,9 +49,14 @@ Page({
return res;
}catch(e){
this.modified = true;
+ throw new Error();
}
},
gameBuild({detail:{value}}){
+ wx.showLoading({
+ title: '代码上传中',
+ });
+ this.setData({ building: 1 });
var {identifier} = this.data;
this.content = value.content;
this.updateFile({evaluate:1})
@@ -60,26 +65,36 @@ Page({
app.api("tasks.game_build")({ identifier, resubmit, sec_key, content_modified:1})
.then(res => {
this.getGameStatus({sec_key, resubmit});
- });
+ })
+ .catch(e=>{
+ wx.hideLoading();
+ this.setData({ building: 0 })
+ console.error(e);
+ })
+ }).catch(e=>{
+ wx.hideLoading();
+ this.setData({building:0})
+ console.error(e);
})
},
getGameStatus({resubmit="", sec_key=""}){
- wx.showLoading({
- title: '测评中',
- });
var { identifier } = this.data;
var timer = setInterval(()=>{
app.api("tasks.game_status")({identifier,resubmit,sec_key})
.then(res=>{
if("status" in res){
wx.hideLoading();
- clearInterval(timer);
+ this.setData({ current: 2, building: 0 });
this.setData(res);
- this.setData({current:2});
+ clearInterval(timer);
+ }else if(res.running_code_message){
+ wx.showLoading({
+ title: res.running_code_message
+ })
}
})
- }, 2000);
+ }, 1000);
},
onSwiperChange({detail:{current,source}}){
if(source=="touch")
@@ -125,6 +140,11 @@ Page({
},
onShareAppMessage: function () {
-
+ let {challenge, shixun} = this.data;
+ return app.shareApp({
+ title:`第${challenge.position}关:${challenge.subject}`,
+ imageUrl: global.config.eduImgDir + "avatars/Shixun/" + shixun.id,
+ path:`/shixun/pages/shixun/shixun?identifier=${shixun.identifier}&cate_type=task`
+ })
}
})
\ No newline at end of file
diff --git a/miniprogram/task/pages/task/task.wxml b/miniprogram/task/pages/task/task.wxml
index 33791cd..e21da7c 100644
--- a/miniprogram/task/pages/task/task.wxml
+++ b/miniprogram/task/pages/task/task.wxml
@@ -15,7 +15,7 @@
-
+
@@ -33,7 +33,7 @@
-
+
\ No newline at end of file
diff --git a/miniprogram/towxml/latex/latex.js b/miniprogram/towxml/latex/latex.js
index 5ae0982..c45b90b 100644
--- a/miniprogram/towxml/latex/latex.js
+++ b/miniprogram/towxml/latex/latex.js
@@ -25,7 +25,7 @@ Component({
let dataAttr = this.data.data.attr;
_ts.setData({
attr:{
- src:`${config.latex.api}=${dataAttr.value}&theme=${global._theme}`,
+ src: `${config.latex.api}=${dataAttr.value}&theme=${global._theme}`.replace(/'/g,"%27"),
class:`${dataAttr.class} ${dataAttr.class}--${dataAttr.type}`
}
});
diff --git a/project.config.json b/project.config.json
index 6784253..7564f07 100644
--- a/project.config.json
+++ b/project.config.json
@@ -63,10 +63,10 @@
"current": -1,
"list": [
{
- "id": 1,
+ "id": 0,
"name": "course/pages/course/course",
"pathName": "course/pages/course/course",
- "query": "course_id=5141&module_type=common_homework",
+ "query": "course_id=5141",
"scene": 1011
},
{
@@ -90,13 +90,6 @@
"query": "course_id=3518",
"scene": null
},
- {
- "id": -1,
- "name": "test",
- "pathName": "account/pages/test/test",
- "query": "",
- "scene": null
- },
{
"id": -1,
"name": "pages/tidings/tidings",
@@ -111,13 +104,6 @@
"query": "identifier=tb7hw62n",
"scene": null
},
- {
- "id": -1,
- "name": "account/pages/change_password/change_password",
- "pathName": "account/pages/change_password/change_password",
- "query": "identifier=tb7hw62n",
- "scene": null
- },
{
"id": -1,
"name": "pages/tidings/tidings",
@@ -133,10 +119,17 @@
"scene": null
},
{
- "id": 10,
+ "id": 8,
"name": "task/pages/task/task",
"pathName": "task/pages/task/task",
- "query": "identifier=lafht8syjp69",
+ "query": "identifier=i6qlxhw8a74m",
+ "scene": null
+ },
+ {
+ "id": -1,
+ "name": "account/pages/about/about",
+ "pathName": "account/pages/about/about",
+ "query": "identifier=i6qlxhw8a74m",
"scene": null
}
]