diff --git a/changelog.md b/changelog.md index c557cbf..5d44ae3 100644 --- a/changelog.md +++ b/changelog.md @@ -1,3 +1,7 @@ +## v0.16.1 + * A 发送实训至课堂 + * A 探索实训界面支持多选 + ## v0.16.0 * A 探索界面 * A 我的实践课程模块 diff --git a/miniprogram/account/pages/about/about.js b/miniprogram/account/pages/about/about.js index 9113b98..00368fb 100644 --- a/miniprogram/account/pages/about/about.js +++ b/miniprogram/account/pages/about/about.js @@ -10,6 +10,8 @@ Page({ }, onShareAppMessage: function () { - + return getApp().shareApp({ + title:"关于EduCoder" + }) } }) \ No newline at end of file diff --git a/miniprogram/account/pages/agreement/agreement.js b/miniprogram/account/pages/agreement/agreement.js index 3867323..793bacf 100644 --- a/miniprogram/account/pages/agreement/agreement.js +++ b/miniprogram/account/pages/agreement/agreement.js @@ -8,6 +8,8 @@ Page({ }, onShareAppMessage: function () { - + return getApp().shareApp({ + title:"EduCoder服务协议" + }) } }) \ No newline at end of file diff --git a/miniprogram/account/pages/change_password/change_password.js b/miniprogram/account/pages/change_password/change_password.js index eeb1645..9b32675 100644 --- a/miniprogram/account/pages/change_password/change_password.js +++ b/miniprogram/account/pages/change_password/change_password.js @@ -47,13 +47,5 @@ Page({ .then(res=>{ this.setData({}) }) - }, - - onReady: function () { - - }, - - onShow: function () { - } }) \ No newline at end of file diff --git a/miniprogram/account/pages/profile/profile.js b/miniprogram/account/pages/profile/profile.js index 4747ef7..3d1d785 100644 --- a/miniprogram/account/pages/profile/profile.js +++ b/miniprogram/account/pages/profile/profile.js @@ -240,8 +240,5 @@ Page({ this.setData({showError:0}); }, during); } - }, - onUnload: function () { - } }) \ No newline at end of file diff --git a/miniprogram/account/pages/profile/school_select/school_select.js b/miniprogram/account/pages/profile/school_select/school_select.js index af69682..1936d4d 100644 --- a/miniprogram/account/pages/profile/school_select/school_select.js +++ b/miniprogram/account/pages/profile/school_select/school_select.js @@ -40,8 +40,5 @@ Page({ this.setData({keyword, _keyword: keyword}); this.search({keyword}) } - }, - onShow: function () { - } }) \ No newline at end of file diff --git a/miniprogram/app.js b/miniprogram/app.js index 6f86dca..4d6f4ed 100644 --- a/miniprogram/app.js +++ b/miniprogram/app.js @@ -33,8 +33,9 @@ App({ }); wx.reportMonitor('1', 1); } - const db = wx.cloud.database(); + if (options.referrerInfo && options.referrerInfo.appId) { + var db = wx.cloud.database(); let { appId, extraData } = options.referrerInfo; let { scene, path } = options; db.collection("referrer_info") diff --git a/miniprogram/app.json b/miniprogram/app.json index 221297f..9723449 100644 --- a/miniprogram/app.json +++ b/miniprogram/app.json @@ -6,8 +6,8 @@ "navigationBarTitleText": "EduCoder", "backgroundColor": "#f5f5f5" }, - "usingComponents":{ - "require-login":"/components/require-login/require-login" + "usingComponents": { + "require-login": "/components/require-login/require-login" }, "pages": [ "pages/main/main", @@ -78,7 +78,8 @@ { "root": "path", "pages": [ - "pages/path/path" + "pages/path/path", + "pages/path_send/path_send" ] }, { @@ -97,9 +98,9 @@ } ], "preloadRule": { - "pages/findmore/findmore":{ - "network":"all", - "packages":[ + "pages/findmore/findmore": { + "network": "all", + "packages": [ "shixun", "search", "path" @@ -169,6 +170,6 @@ "weui": true }, "sitemapLocation": "sitemap.json", - "themeLocation":"theme.json", + "themeLocation": "theme.json", "style": "v2" } \ No newline at end of file diff --git a/miniprogram/app.wxss b/miniprogram/app.wxss index 148902f..4c0890e 100644 --- a/miniprogram/app.wxss +++ b/miniprogram/app.wxss @@ -87,7 +87,7 @@ button[plain][disabled]{ } button[type=secondary]{ color: #00b0f0; - background: #eee; + background: #f1f1f1; } button[type=error]{ background: #fa5151; diff --git a/miniprogram/avatar/pages/image_crop/image_crop.js b/miniprogram/avatar/pages/image_crop/image_crop.js index b43a128..00611a4 100644 --- a/miniprogram/avatar/pages/image_crop/image_crop.js +++ b/miniprogram/avatar/pages/image_crop/image_crop.js @@ -5,17 +5,13 @@ Page({ }, touchStart(e) { - ; this.mycropper.touchStart(e) }, touchMove(e) { - ; this.mycropper.touchMove(e) }, - touchEnd(e) { - ; this.mycropper.touchEnd(e) }, upload_avartar(filePath) { @@ -33,14 +29,11 @@ Page({ }, getCropperImage() { this.mycropper.getCropperImage((avatar) => { - ; if (avatar) { wx.showLoading({ title: '上传中', }); this.upload_avartar(avatar).then(res => { - ; - ; wx.navigateBack({ delta: 1 }); diff --git a/miniprogram/components/modal/send-to-course/send-to-course.js b/miniprogram/components/modal/send-to-course/send-to-course.js index 5043e2c..29e97da 100644 --- a/miniprogram/components/modal/send-to-course/send-to-course.js +++ b/miniprogram/components/modal/send-to-course/send-to-course.js @@ -6,15 +6,21 @@ Component({ shixun_ids:Array, subject_id:{ type:Number, - value:-1 + value:0 + }, + open_type:{ + type:String, + value:"navigateTo" }, show: { type:Boolean, value:false, observer:function(v){ if(v){ - if(this.data.status!=200) - this.pullCourse({refresh:1}) + if(this.data.status!=200||this.user_id!=app.user().user_id){ + this.pullCourse({refresh:1}); + this.user_id = app.user().user_id; + } this.setData({auto_nav: !wx.getStorageSync(KEY)}) } } @@ -30,12 +36,9 @@ Component({ }, methods: { - close(){ - this.setData({show:false}); - this.onClose(); - }, onClose(){ this.setData({checked: false}); + this.setData({show:false}); this.course_id = null; }, changeOption(e){ @@ -59,20 +62,27 @@ Component({ }) } //console.log(shixun_ids, course_id); - let api_name = subject_id>0?'paths.send_to_course':"shixuns.batch_send_to_course" + if(subject_id>0){ + var api_name = 'paths.send_to_course'; + wx.showLoading({ + title: '发送中', + }) + }else{ + var api_name = "shixuns.batch_send_to_course"; + } app.api(api_name)({subject_id, course_id, shixun_ids}) .then(res=>{ this.triggerEvent("success",{}); + wx.hideLoading(); //console.log(res); app.showMsg(res); - this.close(); this.onClose(); if(this.data.auto_nav) setTimeout(()=>{ - app.navigateTo({ - url:`{course}?course_id=${res.course_id}&module_type=shixun_homework` + app[this.data.open_type]({ + url:`{course}?course_id=${course_id}&module_type=shixun_homework` }) - },400); + },420); }).catch(e=>{ app.showError(e); }); diff --git a/miniprogram/components/modal/send-to-course/send-to-course.wxml b/miniprogram/components/modal/send-to-course/send-to-course.wxml index 8e69171..03a4c6c 100644 --- a/miniprogram/components/modal/send-to-course/send-to-course.wxml +++ b/miniprogram/components/modal/send-to-course/send-to-course.wxml @@ -14,9 +14,11 @@ - - - + + + + + 发送后跳转到课堂 \ No newline at end of file diff --git a/miniprogram/components/modal/send-to-course/send-to-course.wxss b/miniprogram/components/modal/send-to-course/send-to-course.wxss index 97714d8..e0c06ff 100644 --- a/miniprogram/components/modal/send-to-course/send-to-course.wxss +++ b/miniprogram/components/modal/send-to-course/send-to-course.wxss @@ -18,15 +18,19 @@ font-size: 15px; padding-top: 10vh; } +.footer{ + margin: -28px -18px -28px -18px; +} .operations{ - text-align: center; - margin: -28px 0 -20px 0; + display: flex; + justify-content: space-evenly; } .operation{ width: 120px!important; margin: 0 8px!important; - display: inline-block!important; + flex-shrink: 1; } .option{ transform: scale(0.6); + padding-top: 8px; } \ No newline at end of file diff --git a/miniprogram/config.js b/miniprogram/config.js index 1dcff6d..41d2332 100644 --- a/miniprogram/config.js +++ b/miniprogram/config.js @@ -1,11 +1,11 @@ const cloudDir = "cloud://educoder.6564-educoder-1300855313/"; -let { miniProgram:{ envVersion, version}} = wx.getAccountInfoSync(); +let { miniProgram:{ envVersion, version}={}} = {}//wx.getAccountInfoSync(); const developUrl = "https://test-newweb.educoder.net"; const trialUrl = "https://pre-newweb.educoder.net"; const releaseUrl = "https://www.educoder.net"; -let _version = "0.16.0"; +let _version = "0.16.1"; var eduUrl = releaseUrl; /** */ diff --git a/miniprogram/course/modules/students/students.wxml b/miniprogram/course/modules/students/students.wxml index c1dbae0..37ada63 100644 --- a/miniprogram/course/modules/students/students.wxml +++ b/miniprogram/course/modules/students/students.wxml @@ -1,7 +1,7 @@ - 学生人数: + 学生人数: {{students_count}} diff --git a/miniprogram/course/modules/students/students.wxss b/miniprogram/course/modules/students/students.wxss index f04e122..28c1b94 100644 --- a/miniprogram/course/modules/students/students.wxss +++ b/miniprogram/course/modules/students/students.wxss @@ -8,6 +8,7 @@ display: flex; justify-content: space-between; align-items: center; + white-space: nowrap; } .invite-button{ margin: 0; diff --git a/miniprogram/course/pages/course/course.json b/miniprogram/course/pages/course/course.json index 4f14f34..f8cbebd 100644 --- a/miniprogram/course/pages/course/course.json +++ b/miniprogram/course/pages/course/course.json @@ -19,5 +19,7 @@ "navigationBarTextStyle": "white", "enablePullDownRefresh": true, "backgroundTextStyle": "light", - "backgroundColor": "#0080f0" + "backgroundColor": "#0080f0", + "navigationBarTitleText": "教学课堂", + "navigationBarBackgroundColor": "#0080f0" } \ No newline at end of file diff --git a/miniprogram/includes/navigation-bar/navigation-bar.wxss b/miniprogram/includes/navigation-bar/navigation-bar.wxss index d211bb9..fae84f2 100644 --- a/miniprogram/includes/navigation-bar/navigation-bar.wxss +++ b/miniprogram/includes/navigation-bar/navigation-bar.wxss @@ -38,7 +38,7 @@ flex: auto; background: #00d0f0; color: white; - padding: 6px 1px; + padding: 5px 1px; transition: all ease 0.6s; } .navitem.active{ diff --git a/miniprogram/js/apiConfig.js b/miniprogram/js/apiConfig.js index d2578f5..601000d 100644 --- a/miniprogram/js/apiConfig.js +++ b/miniprogram/js/apiConfig.js @@ -102,6 +102,7 @@ myshixuns:{ update_file:{url:"{identifier}/*",query,form:{path:null, content: null, evaluate:null, game_id:null},config} }, paths:{url:"*/{subject_id}",query, + choose_course:{url:"{subject_id}/*", query}, right_banner:{url:"{subject_id}/*",query}, send_to_course:{url:"{subject_id}/*", query, config, form:{course_id:null, shixun_ids:null}}, }, diff --git a/miniprogram/js/client.js b/miniprogram/js/client.js index 2ec6d41..ce013b6 100644 --- a/miniprogram/js/client.js +++ b/miniprogram/js/client.js @@ -152,6 +152,7 @@ export default class Client{ fail&&fail(e); }, complete:res=>{ global.realTimeLog.debug(name+" api was called"); + complete&&complete(res); }, }); } diff --git a/miniprogram/pages/findmore/findmore.json b/miniprogram/pages/findmore/findmore.json index bfbfeb1..514ed72 100644 --- a/miniprogram/pages/findmore/findmore.json +++ b/miniprogram/pages/findmore/findmore.json @@ -3,7 +3,7 @@ "paths":"./paths/paths", "shixuns":"./shixuns/shixuns" }, - "navigationBarTitleText": "发现", + "navigationBarTitleText": "探索", "navigationBarTextStyle": "white", "navigationStyle": "custom", "navigationBarBackgroundColor": "#00b0f0" diff --git a/miniprogram/pages/main/main.json b/miniprogram/pages/main/main.json index dda9b16..5ad1890 100644 --- a/miniprogram/pages/main/main.json +++ b/miniprogram/pages/main/main.json @@ -7,5 +7,6 @@ "my-path":"../my_path/my_path" }, "navigationBarTextStyle": "white", + "navigationBarTitleText": "我的", "navigationBarBackgroundColor": "#00b0f0" } \ No newline at end of file diff --git a/miniprogram/path/pages/path/path.js b/miniprogram/path/pages/path/path.js index 722ce43..22c652c 100644 --- a/miniprogram/path/pages/path/path.js +++ b/miniprogram/path/pages/path/path.js @@ -13,12 +13,19 @@ Page({ this.setData({current}); } }, + enterSend(){ + if(app.user().user_id==2) + return wx.showToast({ + title: '登录后才能操作哦',icon:"none" + }); + let {id} = this.data.subject; + app.navigateTo({url:"{path_send}?subject_id="+id}); + }, collect(){ let {id, is_collect} = this.data.subject; let api_name = is_collect?"collections.cancel":"collections"; app.api(api_name)({container_type:"Subject", container_id:id}) .then(res=>{ - ; this.pullSubject({showLoading:0}); if(is_collect){ res.message = "已取消收藏"; @@ -46,7 +53,6 @@ Page({ this.pullSubject(); }, onEnterShixun(e){ - ; let {currentTarget:{dataset:{allow_visit}}} = e; if(!allow_visit) wx.showToast({ @@ -72,7 +78,6 @@ Page({ }).catch(e=>{ if(e.code==403) e.message = "您没有权限访问" - ; wx.hideLoading(); app.showError(e); }) diff --git a/miniprogram/path/pages/path/path.wxml b/miniprogram/path/pages/path/path.wxml index 5470e6f..381fe5c 100644 --- a/miniprogram/path/pages/path/path.wxml +++ b/miniprogram/path/pages/path/path.wxml @@ -82,4 +82,5 @@ + \ No newline at end of file diff --git a/miniprogram/path/pages/path/path.wxss b/miniprogram/path/pages/path/path.wxss index c77a194..3849224 100644 --- a/miniprogram/path/pages/path/path.wxss +++ b/miniprogram/path/pages/path/path.wxss @@ -96,8 +96,12 @@ position: sticky; bottom: 0; display: flex; + background: white; } .operations>.collect{ background: white!important; flex: 1; +} +.operations>button{ + flex: 1; } \ No newline at end of file diff --git a/miniprogram/path/pages/path_send/path_send.js b/miniprogram/path/pages/path_send/path_send.js new file mode 100644 index 0000000..ff80c64 --- /dev/null +++ b/miniprogram/path/pages/path_send/path_send.js @@ -0,0 +1,56 @@ +const app = getApp(); +Page({ + + data: { + selectCount: 0 + }, + + onLoad: function (options) { + let {subject_id} = options; + this.setData({subject_id}); + this.pullShixuns(); + }, + onChange(e){ + let {detail:{value}} = e; + this.setData({selectCount: value.length}); + if(this.length>value.length) + this.setData({isSelectAll: false}); + else + this.setData({isSelectAll: true}); + + }, + onTapSelectAll(e){ + let {detail} = e; + let selectAll = !this.data.isSelectAll; + let selectCount = selectAll?this.length:0; + this.setData({isSelectAll: selectAll, selectAll, selectCount}); + }, + onSubmit(e){ + let {detail:{value:{shixun_ids}}} = e; + if(shixun_ids.length==0) + return wx.showToast({ + title: '请选择实训',icon:"none" + }) + shixun_ids = shixun_ids.map(i=>parseInt(i)); + this.setData({shixun_ids, showSendDialog: true}); + + }, + pullShixuns(){ + let {subject_id} = this.data; + let apiName = "paths.choose_course"; + app.api(apiName)({subject_id}) + .then(res=>{ + let {stages} = res; + this.setData({stages}); + let length = 0; + console.log(stages); + for(var i=0;i{ + global.realTimeLog.error(e, apiName + " fail to call"); + app.showError(e); + }) + }, +}) \ No newline at end of file diff --git a/miniprogram/path/pages/path_send/path_send.json b/miniprogram/path/pages/path_send/path_send.json new file mode 100644 index 0000000..5d8c910 --- /dev/null +++ b/miniprogram/path/pages/path_send/path_send.json @@ -0,0 +1,6 @@ +{ + "usingComponents": { + "send-to-course":"/components/modal/send-to-course/send-to-course" + }, + "navigationBarTitleText": "发送至课堂" +} \ No newline at end of file diff --git a/miniprogram/path/pages/path_send/path_send.wxml b/miniprogram/path/pages/path_send/path_send.wxml new file mode 100644 index 0000000..89ce556 --- /dev/null +++ b/miniprogram/path/pages/path_send/path_send.wxml @@ -0,0 +1,24 @@ +
+ + + + + + + + {{item.shixun_name}} + + + + + + + + + 全选 + + + + +
+ \ No newline at end of file diff --git a/miniprogram/path/pages/path_send/path_send.wxss b/miniprogram/path/pages/path_send/path_send.wxss new file mode 100644 index 0000000..3b0b4c0 --- /dev/null +++ b/miniprogram/path/pages/path_send/path_send.wxss @@ -0,0 +1,44 @@ +.shixun-checkbox .wx-checkbox-input{ + flex: none; +} +.body{ + height: 100vh; +display: flex; +flex-direction: column; + +} +.scroll-body{ + flex: 1; +height: 1px; +flex-basis: 1px; + +} +.shixun-wrp{ + background: white; + padding: 12px; + margin-bottom: 2px; +} +.shixun-item{ + padding-left: 8px; +} +.operations{ + display: flex; + background: white; +} +.operation{ + justify-content: center; + align-items: center; +} +view.operation{ + display: flex; + flex: 2; +} +button.operation{ + flex: 3; + background: #00b0f0; + color: white; + border-radius: 0; +} +.weui-half-screen-dialog__hd__side .weui-icon-btn.weui-icon-btn_more{ + display: none; +} \ No newline at end of file diff --git a/miniprogram/shixun/pages/shixun/shixun.js b/miniprogram/shixun/pages/shixun/shixun.js index f23f49b..6bbaefa 100644 --- a/miniprogram/shixun/pages/shixun/shixun.js +++ b/miniprogram/shixun/pages/shixun/shixun.js @@ -47,15 +47,17 @@ Page({ title: '开启中', }); this.setData({loading: 1}); - app.api("shixuns.shixun_exec")({ identifier:this.data.identifier,complete:res=>{wx.hideLoading();this.setData({loading:false})}}) + app.api("shixuns.shixun_exec")({ identifier:this.data.identifier}) .then(res=>{ app.navigateTo({ url: "{task}?identifier=" + res.game_identifier}); }).catch(e=>{ app.showError(e); + }).finally(e=>{ + wx.hideLoading(); + this.setData({loading:false}) }); }, scrollTo({scrollTop}){ - ; wx.pageScrollTo({scrollTop,duration:200}) }, switchNav({detail:{current,source}}){ diff --git a/miniprogram/shixun/pages/shixun/shixun.wxml b/miniprogram/shixun/pages/shixun/shixun.wxml index d8a5a9a..5fc0681 100644 --- a/miniprogram/shixun/pages/shixun/shixun.wxml +++ b/miniprogram/shixun/pages/shixun/shixun.wxml @@ -45,7 +45,7 @@ - + \ No newline at end of file diff --git a/miniprogram/shixun/pages/shixun/shixun.wxss b/miniprogram/shixun/pages/shixun/shixun.wxss index 378c744..6e05f1c 100644 --- a/miniprogram/shixun/pages/shixun/shixun.wxss +++ b/miniprogram/shixun/pages/shixun/shixun.wxss @@ -70,9 +70,14 @@ left:0; right:0; display: flex; + background: white; } .operations>button{ flex: 1; + display: flex; + justify-content: center; + align-content: center; + white-space: nowrap; } button.collect, button.send{ background: white!important; diff --git a/project.config.json b/project.config.json index fe7b99d..8bdfbf1 100644 --- a/project.config.json +++ b/project.config.json @@ -154,6 +154,14 @@ "id": -1, "name": "dev/pages/dev/dev", "pathName": "dev/pages/dev/dev", + "query": "", + "scene": null + }, + { + "id": -1, + "name": "path/pages/path_send/path_send", + "pathName": "path/pages/path_send/path_send", + "query": "subject_id=475", "scene": null } ]