diff --git a/changelog.md b/changelog.md index a0acbf8..bf224eb 100644 --- a/changelog.md +++ b/changelog.md @@ -1,3 +1,7 @@ +## v0.19.1 + * U 个人中心界面优化 + * U 主题色加深 + ## v0.19.0 * A 增加教学案例模块 * D 个人中心的EduCoder云网入口 @@ -12,7 +16,6 @@ * A 增加设置界面 * U 完善markdown网址解析功能 - ## v0.17.1 * A 增加分享朋友圈 * A 添加收藏时的封面图 diff --git a/miniprogram/account/pages/accounts/accounts.js b/miniprogram/account/pages/accounts/accounts.js index 117948c..b5f72ef 100644 --- a/miniprogram/account/pages/accounts/accounts.js +++ b/miniprogram/account/pages/accounts/accounts.js @@ -140,7 +140,7 @@ Page({ }) this.navToAccount({message:"密码将在本地加密保存"}); }, - showMsg({message,duration=800}){ + showMsg({message,duration=1000}){ if(this.timeoutId) clearTimeout(this.timeoutId); this.setData({ message, showMessage:1}); diff --git a/miniprogram/account/pages/accounts/accounts.json b/miniprogram/account/pages/accounts/accounts.json index 5bfd99b..0f00a11 100644 --- a/miniprogram/account/pages/accounts/accounts.json +++ b/miniprogram/account/pages/accounts/accounts.json @@ -1,6 +1,7 @@ { "usingComponents": { - "mp-slideview": "/weui-miniprogram/slideview/slideview" + "mp-slideview": "/weui-miniprogram/slideview/slideview", + "mp-toptips":"/weui-miniprogram/toptips/toptips" }, "navigationBarTitleText": "切换账号" } \ No newline at end of file diff --git a/miniprogram/account/pages/accounts/accounts.wxml b/miniprogram/account/pages/accounts/accounts.wxml index 57b3cff..97f03e9 100644 --- a/miniprogram/account/pages/accounts/accounts.wxml +++ b/miniprogram/account/pages/accounts/accounts.wxml @@ -3,8 +3,16 @@ - + + + + + 暂无账号 + + + 轻触切换账号 - - 暂无账号 - + \ No newline at end of file diff --git a/miniprogram/app.json b/miniprogram/app.json index 9644954..e558260 100644 --- a/miniprogram/app.json +++ b/miniprogram/app.json @@ -199,6 +199,5 @@ "sitemapLocation": "sitemap.json", "themeLocation": "theme.json", "lazyCodeLoading": "requiredComponents", - "style": "v2", - "debug": true + "style": "v2" } \ No newline at end of file diff --git a/miniprogram/app.wxss b/miniprogram/app.wxss index 4c0890e..f529321 100644 --- a/miniprogram/app.wxss +++ b/miniprogram/app.wxss @@ -29,8 +29,9 @@ page { } .error{color:red;} .warning{color: orange;} -.color-main{color:#00b0f0} -.bg-main{background-color:#00b0f0} +.bg-main{background-color:#0590f0} +.color-main{color:#0590f0} +.color-light-main{color: #00b0f0;} .color-dark-main{color:#0080f0} button.button-main{background:#00b0f0} .border-main{border-color:#00b0f0} diff --git a/miniprogram/components/iconfont/iconfont.js b/miniprogram/components/iconfont/iconfont.js index a162998..f34295a 100644 --- a/miniprogram/components/iconfont/iconfont.js +++ b/miniprogram/components/iconfont/iconfont.js @@ -9,7 +9,8 @@ Component({ value: 23 }, fontsize:{ - type:Number + type:Number, + value:14 }, color: { type:String, @@ -34,8 +35,8 @@ Component({ title: info,icon:"none", duration }) else if(showtype=='modal') - wx.showToast({ - title: info, showCancel:false,duration + wx.showModal({ + content: info, showCancel:false }) else this.showInfo() diff --git a/miniprogram/components/iconfont/iconfont.wxml b/miniprogram/components/iconfont/iconfont.wxml index b1e2539..7749c11 100644 --- a/miniprogram/components/iconfont/iconfont.wxml +++ b/miniprogram/components/iconfont/iconfont.wxml @@ -1,6 +1,7 @@ - + + diff --git a/miniprogram/components/iconfont/iconfont.wxss b/miniprogram/components/iconfont/iconfont.wxss index 3609967..25bcf53 100644 --- a/miniprogram/components/iconfont/iconfont.wxss +++ b/miniprogram/components/iconfont/iconfont.wxss @@ -1,11 +1,11 @@ @font-face { font-family: 'iconfont'; /* project id 1656783 */ - src: url('//at.alicdn.com/t/font_1656783_bha2h77g8oh.eot'); - src: url('//at.alicdn.com/t/font_1656783_bha2h77g8oh.eot?#iefix') format('embedded-opentype'), - url('//at.alicdn.com/t/font_1656783_bha2h77g8oh.woff2') format('woff2'), - url('//at.alicdn.com/t/font_1656783_bha2h77g8oh.woff') format('woff'), - url('//at.alicdn.com/t/font_1656783_bha2h77g8oh.ttf') format('truetype'), - url('//at.alicdn.com/t/font_1656783_bha2h77g8oh.svg#iconfont') format('svg'); + src: url('//at.alicdn.com/t/font_1656783_9q51195darj.eot'); + src: url('//at.alicdn.com/t/font_1656783_9q51195darj.eot?#iefix') format('embedded-opentype'), + url('//at.alicdn.com/t/font_1656783_9q51195darj.woff2') format('woff2'), + url('//at.alicdn.com/t/font_1656783_9q51195darj.woff') format('woff'), + url('//at.alicdn.com/t/font_1656783_9q51195darj.ttf') format('truetype'), + url('//at.alicdn.com/t/font_1656783_9q51195darj.svg#iconfont') format('svg'); } .iconfont { display: inline-block; @@ -41,6 +41,8 @@ flex-direction: column; align-items: center; opacity: 0.9; + z-index: 10000; + overflow:visible } @@ -144,4 +146,7 @@ } .icon-anli:before{ content: "\e643"; +} +.icon-qiandao:before{ + content:"\e811" } \ No newline at end of file diff --git a/miniprogram/components/nav-bar/nav-bar.wxss b/miniprogram/components/nav-bar/nav-bar.wxss index 4b10cc1..c14d8ce 100644 --- a/miniprogram/components/nav-bar/nav-bar.wxss +++ b/miniprogram/components/nav-bar/nav-bar.wxss @@ -19,16 +19,16 @@ transition: all 0.26s ease; } .view.nav.active{ - color: #0080f0; + color: #0590f0; font-size: 15px; font-weight: bold; - border-bottom: 2px solid #0080f0; + border-bottom: 2px solid #0590f0; } .view.plain{ transition: all 0.26s ease; } .view.plain.active{ - color: #0080f0; + color: #0590f0; font-size: 15px; font-weight: bold; } diff --git a/miniprogram/config.js b/miniprogram/config.js index aae4f5e..3a3f4d7 100644 --- a/miniprogram/config.js +++ b/miniprogram/config.js @@ -1,6 +1,6 @@ const cloudDir = "cloud://educoder.6564-educoder-1300855313/"; -let _version = "0.19.0"; +let _version = "0.19.1"; let { miniProgram:{ envVersion="release", version=_version}={}} = wx.getAccountInfoSync(); version = version||_version; diff --git a/miniprogram/includes/navigation-bar/navigation-bar.wxss b/miniprogram/includes/navigation-bar/navigation-bar.wxss index 9a5c657..6042066 100644 --- a/miniprogram/includes/navigation-bar/navigation-bar.wxss +++ b/miniprogram/includes/navigation-bar/navigation-bar.wxss @@ -1,8 +1,9 @@ .navigation{ - background: #00b0f0; + background: #0590f0; flex: none; } +/* #1670e0;, #0092f0,#0981f8;*/ .status-bar{ transition: all ease-out 0.4s } @@ -39,7 +40,7 @@ } .navitem{ flex: auto; - background: #00d0f0; + background: #00b0f0; color: white; padding: 5px 1px; transition: all ease 0.6s; diff --git a/miniprogram/markdown/competition/competition/competition.js b/miniprogram/markdown/competition/competition/competition.js index c12c2e0..469ee9c 100644 --- a/miniprogram/markdown/competition/competition/competition.js +++ b/miniprogram/markdown/competition/competition/competition.js @@ -21,6 +21,8 @@ Page({ header.modules.push(m); } this.setData(header); + let {name, sub_title} = header; + wx.setNavigationBarTitle({title: name+(sub_title?('--'+sub_title):'')}) try{ wx.showLoading({title: '加载中'}); let module = await app.api("competitions.competition_modules")({ @@ -51,7 +53,6 @@ Page({ onTapAttachment(e){ //console.log(e); let {currentTarget:{dataset:{id}}} = e; - openAttachment({id}); }, diff --git a/miniprogram/markdown/competition/competition/competition.wxml b/miniprogram/markdown/competition/competition/competition.wxml index fe144ed..0e1ba12 100644 --- a/miniprogram/markdown/competition/competition/competition.wxml +++ b/miniprogram/markdown/competition/competition/competition.wxml @@ -1,7 +1,6 @@ - - + diff --git a/miniprogram/markdown/mooc_case/mooc_case/mooc_case.js b/miniprogram/markdown/mooc_case/mooc_case/mooc_case.js index 4ffd4c7..6643b5a 100644 --- a/miniprogram/markdown/mooc_case/mooc_case/mooc_case.js +++ b/miniprogram/markdown/mooc_case/mooc_case/mooc_case.js @@ -18,6 +18,7 @@ Page({ app.api("libraries.$")({mooc_case_id: options.mooc_case_id}) .then(res=>{ this.setData(res); + wx.setNavigationBarTitle({title: res.title}) }) }, diff --git a/miniprogram/markdown/mooc_case/mooc_case/mooc_case.wxml b/miniprogram/markdown/mooc_case/mooc_case/mooc_case.wxml index 962c9a3..4d6fa89 100644 --- a/miniprogram/markdown/mooc_case/mooc_case/mooc_case.wxml +++ b/miniprogram/markdown/mooc_case/mooc_case/mooc_case.wxml @@ -1,6 +1,6 @@ - + diff --git a/miniprogram/pages/home/home.js b/miniprogram/pages/home/home.js index 5969126..d3e2ee8 100644 --- a/miniprogram/pages/home/home.js +++ b/miniprogram/pages/home/home.js @@ -128,9 +128,11 @@ Page({ if(cache_homepage) this.setData({user: cache_homepage}); } + /* let data = wx.getStorageSync("auto-attendence"); if (data) this.setData({ auto_attendance: true }); + */ }, onShow() { app.syncUser().then(res => { @@ -152,7 +154,8 @@ Page({ data: res, key }) - if (!res.attendance_signed && this.data.auto_attendance) + // 自动签到 + if (!res.attendance_signed) this.attendance({ show: 0 }) }); let account = accountManager.getCurrentAccount(); @@ -177,16 +180,35 @@ Page({ data: this.data.auto_attendance, }); }, - attendance({ show = 1 }) { + updateGold({gold, duration}){ + let {grade} = this.data.user; + if(grade >= gold) + return console.log(new Date().getTime()) + else{ + let time = 1; + this.setData({"user.grade": grade+1}, ()=>{ + //this.updateGold(gold); + var id = setTimeout(()=>{ + clearTimeout(id); + this.updateGold({gold,duration}); + }, time); + } + ); + } + }, + attendance({ show = 1 }={}) { + if(!app.checkLogin({content:"您需要登陆后才能签到获取金币"})) + return; app.api("users.attendance")() .then(res => { res.message = "签到成功"; if (show) app.showMsg(res); + let {grade} = res; + this.updateGold({gold: grade}) }).catch(e=>{ if(show) app.showError(e); - }).finally(()=>{ this.refresh(); }) }, diff --git a/miniprogram/pages/home/home.json b/miniprogram/pages/home/home.json index aa50eff..982134f 100644 --- a/miniprogram/pages/home/home.json +++ b/miniprogram/pages/home/home.json @@ -3,5 +3,7 @@ "enablePullDownRefresh": false, "usingComponents": { "mp-icon":"/weui-miniprogram/icon/icon" - } + }, + "navigationBarBackgroundColor": "#0590f0", + "navigationBarTextStyle": "white" } diff --git a/miniprogram/pages/home/home.wxml b/miniprogram/pages/home/home.wxml index 6892347..272d3c0 100644 --- a/miniprogram/pages/home/home.wxml +++ b/miniprogram/pages/home/home.wxml @@ -1,4 +1,72 @@ - + + + + + + 经验值 + {{user.experience||0}} + + + + 金币 + + {{user.grade||0}} + + + + + + + + + + + + + + 教学案例 + 查看获奖案例 + + + + + + + + + 在线竞赛 + 绿色计算大赛 + + + + + + + + + - + - 修改密码 - + 修改密码 + - 职业认证 - + 职业认证 + - 设置 - + 设置 + - 切换账号 + 切换账号 {{currentLogin}} - + diff --git a/miniprogram/pages/home/home.wxss b/miniprogram/pages/home/home.wxss index 07c69ea..f61c13b 100644 --- a/miniprogram/pages/home/home.wxss +++ b/miniprogram/pages/home/home.wxss @@ -1,6 +1,129 @@ -.auth-tip{ - margin-right: 12px; +/**用户展示开始*/ +.profile-display{ + background: #0590f0; + transition: all 0.6s ease; + max-height: 100vh; + overflow:hidden; +} +.user-info-display{ + display: flex; + align-items: center; + color: white; + height: 166rpx; +} +.require-login>image{ + height: 88px; + width: 88px; + margin-left: 16px; +} +.user-avatar{ + border-radius: 50%; + overflow: hidden; + width: 150rpx; + height: 150rpx; + border: 8rpx #52B3FF solid; + margin: 0rpx 40rpx; + flex: none; +} +.user-info-mid{ + flex: auto; + overflow: hidden; +} +.user-info-left{ + flex: none; + margin-right: 14px; +} +.user-name{ + font-size: 20px; +} +.authentication-display{ + align-items: center; +} +.authentication-tip{ + margin-right: 6px; +} +.complete-profile-tip{ + flex: auto; + text-align: right; + font-size: 13px; +} + +/**用户展示结束*/ + + +/**经验展示开始*/ +.experience-display{ + padding: 5rpx 10rpx; + align-items: center; + color: white; +} +.experience-item{ + flex: auto; + align-items: center; +} +.experience-item>.key{ + font-size: 17px; +} +.experience-item>.value{ + font-size: 15px; +} + +/*经验展示结束*/ + + + +/* 浮层 */ +.icon-button{ + margin-right: 16rpx; + margin-left: 8rpx; +} +.jiantou{ + width: 30rpx; + height: 30rpx; +} +.box{ + display: flex; + justify-content: center; + position: relative; +} +.box-background{ + background: #0590f0; + position: absolute; + top: 0; + width: 100%; + height: 50%; + z-index: -100; + border-radius: 0 0 24% 24%; +} +.whitebox{ + width: 94%; + background-color: white; + display: flex; + justify-content: space-between; + border-radius: 20rpx; + box-shadow: #e0e0e0 0px 0px 5px; + padding: 25rpx 0rpx; } +.box_context{ + display: flex; + justify-content: space-around; + align-items: center; + width: 50%; + padding: 20rpx 0rpx; + border-right: 1rpx #F7F7F7 solid; +} +.left-content{ + display: flex; + justify-content: space-around; + align-items: center; +} +.red-tip{ + color: #FD6500; + font-size: 25rpx; + padding-top: 8rpx; +} +/* 浮层结束 */ + .nav-list{ margin-top: 4px; } @@ -12,7 +135,7 @@ background: white; border-bottom: 1px solid #eee; padding: 0 14px; - height: 42px; + height: 44px; font-weight: normal; display: flex; align-items: center; @@ -23,7 +146,7 @@ right: 12px; } .nav>.icon{ - margin-right: 10px; + margin-right: 12px; } .nav>image.icon{ width:21px; diff --git a/miniprogram/setting/pages/image_crop/image_crop.js b/miniprogram/setting/pages/image_crop/image_crop.js index 351dc73..25ed836 100644 --- a/miniprogram/setting/pages/image_crop/image_crop.js +++ b/miniprogram/setting/pages/image_crop/image_crop.js @@ -112,7 +112,7 @@ Page({ encoding: "base64", success: res => { let image = "data:image/jpeg;base64," + res.data; - app.api("users.accounts.avatar")({ image }).then(resolve); + app.api("users.accounts.avatar")({ image }).then(resolve).catch(reject); }, fail: reject }); @@ -138,11 +138,11 @@ Page({ }); },500); }).catch(e => { + wx.hideLoading(); wx.showToast({ title: '上传失败', icon: "none" }); - wx.hideLoading(); this.setData({submitting:0}); }); } else { diff --git a/miniprogram/styles/banner.wxss b/miniprogram/styles/banner.wxss new file mode 100644 index 0000000..d529153 --- /dev/null +++ b/miniprogram/styles/banner.wxss @@ -0,0 +1,28 @@ +/* 主导航栏 */ +.banner-main{ + display: flex; + align-items: center; + justify-content: space-between; + padding: 30rpx; + border-bottom: 15rpx #F7F7F7 solid; + background: white; +} +.banner-left{ + display: flex; +} +.banner-right{ + display: flex; +} +.banner-icon{ + width: 46rpx; + height: 46rpx; +} +.banner-name{ + margin-left: 30rpx; +} +.banner-tip{ + color: #BABABA; + font-size: 25rpx; + margin-right: 10rpx; +} +/* 主导航栏结束 */ \ No newline at end of file diff --git a/miniprogram/templates/banner/banner.wxml b/miniprogram/templates/banner/banner.wxml new file mode 100644 index 0000000..e69de29 diff --git a/miniprogram/templates/banner/banner.wxss b/miniprogram/templates/banner/banner.wxss new file mode 100644 index 0000000..e69de29 diff --git a/project.config.json b/project.config.json index 880dc48..98144b1 100644 --- a/project.config.json +++ b/project.config.json @@ -33,7 +33,7 @@ "skeletonGenerateFilesWithoutConfirm": true }, "compileType": "miniprogram", - "libVersion": "2.11.0", + "libVersion": "2.12.0", "appid": "wxc5c2b711f23f3a1d", "projectname": "educoder_weapp", "debugOptions": { @@ -141,7 +141,7 @@ "id": 10, "name": "path", "pathName": "markdown/path/path/path", - "query": "subject_id=169", + "query": "subject_id=1426", "scene": null }, {