F个人信息性别设置,实训文件内容获取

master
educoder_weapp 5 years ago
parent 78eb1192ff
commit 1f1d9ad6ea

@ -1,4 +1,10 @@
##v0.14.3
* F 实训文件内容获取失败(文件path错误)
* F 个人信息性别设置bug
* D 删除实名认证界面
##v0.14.2 ##v0.14.2
* F 签到界面无权限访问提示
* F 更改头像界面图片初次加载失败 * F 更改头像界面图片初次加载失败
* F 电脑端用户界面图标及文字位置不正确 * F 电脑端用户界面图标及文字位置不正确

@ -16,6 +16,7 @@ Page({
}) })
}, },
onGenderChange({detail:{value}}){ onGenderChange({detail:{value}}){
value = parseInt(value);
this.setData({ gender: value }); this.setData({ gender: value });
}, },
onSubmit(e){ onSubmit(e){
@ -23,6 +24,7 @@ Page({
let {detail:{value}} = e; let {detail:{value}} = e;
if(!this.checkInput(value)) return; if(!this.checkInput(value)) return;
value.attachment_ids[0] = parseInt(value.attachment_ids[0]); value.attachment_ids[0] = parseInt(value.attachment_ids[0]);
value.gender = parseInt(value.gender);
app.api("users.accounts.authentication_apply")(value) app.api("users.accounts.authentication_apply")(value)
.then(res=>{ .then(res=>{
let db = wx.cloud.database(); let db = wx.cloud.database();

@ -67,6 +67,7 @@ Page({
}, },
onGenderChange({detail:{value}}){ onGenderChange({detail:{value}}){
console.log("gender change", value); console.log("gender change", value);
value = parseInt(value);
this.setData({gender:value}); this.setData({gender:value});
}, },
onLocationChange(e){ onLocationChange(e){
@ -197,6 +198,7 @@ Page({
}, },
saveInfo(value){ saveInfo(value){
value.gender = parseInt(value.gender);
app.api("users.accounts", { method: "PUT" })(value) app.api("users.accounts", { method: "PUT" })(value)
.then(res => { .then(res => {
app.syncUser({refresh:1}); app.syncUser({refresh:1});

@ -24,7 +24,6 @@
"pages/profile/profile", "pages/profile/profile",
"pages/account/account", "pages/account/account",
"pages/profile/school_select/school_select", "pages/profile/school_select/school_select",
"pages/authentication/authentication",
"pages/pro_authentication/pro_authentication", "pages/pro_authentication/pro_authentication",
"pages/accounts/accounts", "pages/accounts/accounts",
"pages/user_info/user_info" "pages/user_info/user_info"
@ -41,7 +40,6 @@
"pages": [ "pages": [
"pages/course/course", "pages/course/course",
"pages/course_invite/course_invite", "pages/course_invite/course_invite",
"pages/course_setting/course_setting",
"pages/attendance_detail/attendance_detail", "pages/attendance_detail/attendance_detail",
"modules/attendance/attendance", "modules/attendance/attendance",
"pages/attendances/attendances" "pages/attendances/attendances"

@ -0,0 +1,14 @@
const app = getApp();
Component({
properties: {
},
data: {
},
methods: {
}
})

@ -0,0 +1,4 @@
{
"component": true,
"usingComponents": {}
}

@ -0,0 +1 @@
<navigator wx:if="{{user_id==2}}" class="nav" style="background:{{bg}}" url="/account/pages/account/account?action=login">{{message}}</navigator>

@ -0,0 +1 @@
/* components/head-tip/head-tip.wxss */

@ -1,3 +1,4 @@
import { deprecate} from "../../js/utils";
const app = getApp(); const app = getApp();
Component({ Component({
properties: { properties: {
@ -13,6 +14,9 @@ Component({
value:"#0080f0" value:"#0080f0"
} }
}, },
attached(){
deprecate("require-login");
},
pageLifetimes:{ pageLifetimes:{
show:function(){ show:function(){
app.syncUser() app.syncUser()

@ -10,17 +10,18 @@ Component({
this.process(nodes); this.process(nodes);
} }
}, },
data_key:{ datakey:{
type:String, type:String,
observer:function(key){ observer:function(key){
console.log("data_key",key); console.log("data_key",key, this.data);
wx.getStorage({ wx.getStorage({
key, key,
success: res=>{ success: res=>{
//console.log("getStorage", res); //console.log("getStorage", res);
this.setData({_nodes:res.data}); this.setData({_nodes:res.data});
}, },
}) });
return key;
} }
}, },
theme:{ theme:{
@ -43,11 +44,9 @@ Component({
methods: { methods: {
handleTap(e){ handleTap(e){
//console.log(this.data); //console.log(this.data);
console.log("handleTap",e); console.log("handleTap",e, this.data,this);
if(this.data.data_key)
return;
var {target:{dataset:{data}}} = e; var {target:{dataset:{data}}} = e;
var key = "RICH-MD-KEY"; var key = "RICHMDKEY";
//console.log(data); //console.log(data);
if(data&&data._e.tag=="code") 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]}} data={attr:{class:"h2w__pre"},child:[data],tag:"view",type:"tag",_e:{type:"tag",attr:{},tag:"pre", child:[data]}}
@ -56,7 +55,7 @@ Component({
wx.setStorage({ wx.setStorage({
key,data,success:res=>{ key,data,success:res=>{
wx.navigateTo({ wx.navigateTo({
url: `/components/rich-md/rich-md?data_key=${key}&type=html` url: `/components/rich-md/rich-md?datakey=${key}&type=html`
}) })
} }
}) })

@ -5,9 +5,10 @@ const developUrl = "https://test-newweb.educoder.net";
const trialUrl = "https://pre-newweb.educoder.net"; const trialUrl = "https://pre-newweb.educoder.net";
const releaseUrl = "https://www.educoder.net"; const releaseUrl = "https://www.educoder.net";
let _version = "0.14.2"; let _version = "0.14.3";
var eduUrl = releaseUrl; var eduUrl = releaseUrl;
/** /**
*
*/ */
export function switchEnv(env) { export function switchEnv(env) {

@ -50,6 +50,9 @@ Component({
navBack(){ navBack(){
if(getCurrentPages().length<=1){ if(getCurrentPages().length<=1){
let {course_identity, course_id} = this.data; let {course_identity, course_id} = this.data;
let {code,message} = this.data;
if(code!=200&&message)
return app.reLaunch({url:"{main}"});//@todo
app.redirectTo({ app.redirectTo({
url: `{attendance}?course_identity=${course_identity}&course_id=${course_id}` url: `{attendance}?course_identity=${course_identity}&course_id=${course_id}`
}); });
@ -130,15 +133,17 @@ Component({
app.api("weapps.attendances")({attendance_id}) app.api("weapps.attendances")({attendance_id})
.then(res=>{ .then(res=>{
this.setData(res); this.setData(res);
this.setData({status:200}); this.setData({status:200, message:""});
if(course_identity<5&&res.mode=="QRCODE"){ if(course_identity<5&&res.mode=="QRCODE"){
let code_url = getWXACodeUrl({url: this.route, scene: this.getScene()}); let code_url = getWXACodeUrl({url: this.route, scene: this.getScene()});
this.setData({code_url}); this.setData({code_url});
} }
}).catch(e=>{ }).catch(e=>{
console.error(e); //console.error(e);
app.showError(e) if(e.code==402)
this.setData({status: e.code}); e.message = "你没有访问权限";
app.showError(e);
this.setData({status: e.code, message:e.message});
}) })
}else{ }else{
this.refreshIdentity() this.refreshIdentity()

@ -2,6 +2,7 @@
<navigation-bar title="{{name?'签到-'+name:'签到'}}" /> <navigation-bar title="{{name?'签到-'+name:'签到'}}" />
</page-meta> </page-meta>
<require-login message="登陆后才可以查看哦,点击这里登录吧"/> <require-login message="登陆后才可以查看哦,点击这里登录吧"/>
<view class="err-msg" wx:if="{{code!=200&&message}}">{{message}}</view>
<view class="info"> <view class="info">
<view class="tea-title">{{name}}</view> <view class="tea-title">{{name}}</view>
<view class="tea-time-wrap" wx:if="{attendance_date{}}">签到时间: <view class="tea-time-wrap" wx:if="{attendance_date{}}">签到时间:
@ -40,7 +41,7 @@
<input hidden="1" name="attendance_id" value="{{attendance_id}}"></input> <input hidden="1" name="attendance_id" value="{{attendance_id}}"></input>
<view class="tip">{{mode=='QRCODE'?'请扫二维码签到':mode=='NUMBER'?'请输入签到码签到':mode=='QUICK'?'点击签到按钮,快速签到':''}}</view> <view class="tip">{{mode=='QRCODE'?'请扫二维码签到':mode=='NUMBER'?'请输入签到码签到':mode=='QUICK'?'点击签到按钮,快速签到':''}}</view>
<view> <view>
<button form-type="submit" type="main">{{mode=='QUICK'?'快速签到':'签到'}}</button> <button id="stu-attendance" form-type="submit" type="main">{{mode=='QUICK'?'快速签到':'签到'}}</button>
<button class="nav-back" type="main" plain="1" bindtap="navBack">返回</button> <button class="nav-back" type="main" plain="1" bindtap="navBack">返回</button>
</view> </view>
</form> </form>

@ -1,3 +1,9 @@
.err-msg{
background: #00b0f0;
color: white;
padding: 6px;
text-align: center;
}
.input-wrap{ .input-wrap{
display: flex; display: flex;
padding: 4px 12px; padding: 4px 12px;

@ -66,6 +66,7 @@ Page({
return `course_id=${course_id}` return `course_id=${course_id}`
}, },
pull_course(){ pull_course(){
app.syncUser().then(res=>{
app.api("weapps.courses.basic_info")({ course_id: this.data.course_id }) app.api("weapps.courses.basic_info")({ course_id: this.data.course_id })
.then(({ course }) => { .then(({ course }) => {
this.setData({ course, status: 200 }); this.setData({ course, status: 200 });
@ -73,6 +74,7 @@ Page({
app.showError(e); app.showError(e);
this.setData({ status: -1 }) this.setData({ status: -1 })
}); });
})
}, },
onLoad: function (options) { onLoad: function (options) {
console.log("onLoad", options); console.log("onLoad", options);

@ -7,7 +7,9 @@ Page({
data: { data: {
}, },
onScanCode(e){
console.log(e);
},
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */

@ -1,3 +0,0 @@
<!--miniprogram/dev/pages/dev/dev.wxml-->
<text>miniprogram/dev/pages/dev/dev.wxml</text>
<text class="iconfont icon_back"></text>

@ -1,52 +1,4 @@
@font-face { #cam{
font-family: 'iconfont'; width: 100%;
/* project id 706535 */ height: 40vh;
src: url('//at.alicdn.com/t/font_706535_gcxl9md3eyj.eot');
src: url('//at.alicdn.com/t/font_706535_gcxl9md3eyj.eot?#iefix') format('embedded-opentype'), url('//at.alicdn.com/t/font_706535_gcxl9md3eyj.woff') format('woff'), url('//at.alicdn.com/t/font_706535_gcxl9md3eyj.ttf') format('truetype'), url('//at.alicdn.com/t/font_706535_gcxl9md3eyj.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_back::before {
content: "\e62c";
}
.icon_close::before {
content: "\e628";
}
.icon_refresh::before {
content: "\e732";
}
.icon_jiantou_bottom::before {
content: "\e605"
}
.icon_jiantou_top::before {
content: "\e733"
}
.icon_bill::before {
content: "\e627";
}
.icon_edit::before {
content: "\e63b";
}
.icon_edit_pen::before {
content: "\e609";
}
.icon_right_jiantou::before {
content: "\e7a5"
}
.icon_back::before {
content: "\e7a5"
} }

@ -70,8 +70,8 @@ export default class Client{
}) })
} }
getTidingInfo({login}={}){ getTidingInfo({login}={}){
this.tidingGet = 1;
const handler = { const handler = {
success: res=>{this.tidingGet =1},
fail: res=>{this.tidingGet=0} fail: res=>{this.tidingGet=0}
}; };
return this.api("users.unread_message_info")({login}).then(res => { return this.api("users.unread_message_info")({login}).then(res => {
@ -82,7 +82,7 @@ export default class Client{
else{ else{
wx.removeTabBarBadge({index:1}); wx.removeTabBarBadge({index:1});
wx.hideTabBarRedDot({index:1}); wx.hideTabBarRedDot({index:1});
this.tidingGet = 1;
} }
}).catch(e => { }).catch(e => {
console.error("getTidingInfo", e); console.error("getTidingInfo", e);

@ -1,5 +1,10 @@
export function deprecate(name=""){ export function deprecate(name=""){
console.warn(name + "这个方法或界面被弃用了"); try{
throw new Error(name + "这个方法或界面被弃用了");
}catch(e){
console.info(e);
}
} }
export function getFormatDate(date){ export function getFormatDate(date){
date = date||new Date(); date = date||new Date();

@ -14,7 +14,6 @@ Page({
console.log(e); console.log(e);
}, },
enterPage({ target: { dataset: { path } } }) { enterPage({ target: { dataset: { path } } }) {
console.log("enterPage");
if (!path) return; if (!path) return;
let { id } = this.data.user; let { id } = this.data.user;
if (!id || id == 2) if (!id || id == 2)
@ -98,8 +97,6 @@ Page({
logout: function ({ showToast = 1 }) { logout: function ({ showToast = 1 }) {
app.callApi({ app.callApi({
name: "accounts.logout", success: res => { name: "accounts.logout", success: res => {
console.log("注销成功");
console.log(res);
if (showToast) if (showToast)
app.showMsg(res); app.showMsg(res);
this.onShow(); this.onShow();
@ -130,9 +127,9 @@ Page({
}, },
onShow() { onShow() {
app.syncUser().then(res => { app.syncUser().then(res => {
if (res.user.user_id != 2) if (res.user.user_id != 2){
this.refresh(); this.refresh();
else }else
this.setData({ user: {}, currentLogin:"" }) this.setData({ user: {}, currentLogin:"" })
}); });
}, },
@ -159,7 +156,7 @@ Page({
} else { } else {
var currentLogin = ""; var currentLogin = "";
} }
this.setData({ currentLogin }); this.setData({ currentLogin, profile_completed: app.user().profile_completed});
}, },
tapAutoAttendence() { tapAutoAttendence() {
this.setData({ auto_attendance: !this.data.auto_attendance }); this.setData({ auto_attendance: !this.data.auto_attendance });

@ -12,6 +12,7 @@
<iconfont catchtap class="auth-tip" type="authentication" color="{{user.authentication?'#00c6da':'#bbbbbb'}}" size="22" info="{{user.authentication?'已实名认证':'未实名认证'}}" /> <iconfont catchtap class="auth-tip" type="authentication" color="{{user.authentication?'#00c6da':'#bbbbbb'}}" size="22" info="{{user.authentication?'已实名认证':'未实名认证'}}" />
<iconfont catchtap type="certification" size="22" color="{{user.professional_certification?'#00c6da':'#bbbbbb'}}" info="{{user.professional_certification?'已职业认证':'未职业认证'}}" /> <iconfont catchtap type="certification" size="22" color="{{user.professional_certification?'#00c6da':'#bbbbbb'}}" info="{{user.professional_certification?'已职业认证':'未职业认证'}}" />
</view> </view>
<text class="tip" wx:if="{{!profile_completed}}">完善个人信息</text>
<iconfont type="jinru" color="dimgrey" size="15" class="enter"></iconfont> <iconfont type="jinru" color="dimgrey" size="15" class="enter"></iconfont>
</navigator> </navigator>
<view class="relation-info"> <view class="relation-info">
@ -36,10 +37,10 @@
<iconfont class="icon" type="xiugaimima" size="21" />修改密码 <iconfont class="icon" type="xiugaimima" size="21" />修改密码
<iconfont type="jinru" color="dimgrey" size="15" class="enter"></iconfont> <iconfont type="jinru" color="dimgrey" size="15" class="enter"></iconfont>
</view> </view>
<view class="nav" data-path="authentication"> <!--view class="nav" data-path="authentication">
<iconfont class="icon" type="shimingrenzheng" size="21" />实名认证 <iconfont class="icon" type="shimingrenzheng" size="21" />实名认证
<iconfont type="jinru" color="dimgrey" size="15" class="enter"></iconfont> <iconfont type="jinru" color="dimgrey" size="15" class="enter"></iconfont>
</view> </view-->
<view class="nav gap" data-path="pro_authentication"> <view class="nav gap" data-path="pro_authentication">
<iconfont class="icon" type="wode-zhiyerenzheng" size="21" />职业认证 <iconfont class="icon" type="wode-zhiyerenzheng" size="21" />职业认证
<iconfont type="jinru" color="dimgrey" size="15" class="enter"></iconfont> <iconfont type="jinru" color="dimgrey" size="15" class="enter"></iconfont>

@ -18,17 +18,23 @@
align-items: center; align-items: center;
position: relative; position: relative;
} }
.user-info>.enter,
.nav>.enter{ .nav>.enter{
right: 12px; right: 12px;
} }
.nav>.icon{ .nav>.icon{
margin-right: 10px; margin-right: 10px;
} }
.user-info>.tip,
.nav>.tip{ .nav>.tip{
right: 36px; right: 36px;
color: dimgray; color: dimgray;
font-size: 12px; font-size: 12px;
} }
.user-info>.enter,
.user-info>.tip{
position: absolute;
}
.nav>.enter, .nav>.tip{ .nav>.enter, .nav>.tip{
position: absolute; position: absolute;
top:50%; top:50%;
@ -82,10 +88,7 @@ navigator[hidden] {
align-items: center; align-items: center;
position: relative; position: relative;
} }
.user-info>.enter{
position: absolute;
right: 12px;
}
.user-detail{ .user-detail{
margin-left: 20px; margin-left: 20px;

@ -47,6 +47,8 @@ Component({
this.pullCourses({ refresh: 1 }); this.pullCourses({ refresh: 1 });
}, },
addCourse() { addCourse() {
return this.setData({ showModal: 1 });
/*
if (app.user().user_identity == "学生") { if (app.user().user_identity == "学生") {
this.setData({ showModal: 1 }); this.setData({ showModal: 1 });
} else { } else {
@ -61,6 +63,7 @@ Component({
} }
}) })
} }
*/
}, },
enter_course: function (event) { enter_course: function (event) {
console.log(event); console.log(event);

@ -43,6 +43,6 @@
</scroll-view> </scroll-view>
</swiper-item> </swiper-item>
</swiper> </swiper>
<view class="operations"> <view wx:if="{{shixun.task_operation[0]}}" class="operations">
<button bindtap="enterChallenge" loading="{{loading}}" disabled="{{loading}}" type="main">{{shixun.task_operation[0]}}</button> <button bindtap="enterChallenge" loading="{{loading}}" disabled="{{loading}}" type="main">{{shixun.task_operation[0]}}</button>
</view> </view>

@ -44,6 +44,7 @@
} }
.detail{ .detail{
transition: 0.8s all ease; transition: 0.8s all ease;
max-height: 100vh;
} }
.output-info{ .output-info{
background: #111c24; background: #111c24;
@ -57,7 +58,7 @@
padding: 0 8px; padding: 0 8px;
} }
.hidden{ .hidden{
height: 0px; max-height: 0px;
overflow: hidden; overflow: hidden;
} }
.different{ .different{

@ -37,9 +37,13 @@ Page({
} }
this.content = value; this.content = value;
}, },
processPath(path){
return path.replace(/[;]$/,"");
},
async updateFile({ evaluate=0}={}){ async updateFile({ evaluate=0}={}){
var {content} = this; var {content} = this;
var {path} = this.data.challenge; var {path} = this.data.challenge;
path = this.processPath(path);
var {identifier} = this.data.myshixun; var {identifier} = this.data.myshixun;
var {id:game_id} = this.data.game; var {id:game_id} = this.data.game;
if(this.modified||evaluate) if(this.modified||evaluate)
@ -109,6 +113,7 @@ Page({
}, },
async pullContent(){ async pullContent(){
let {path} = this.data.challenge; let {path} = this.data.challenge;
path = this.processPath(path);
let {identifier} = this.data; let {identifier} = this.data;
let {content} = await app.api("tasks.rep_content")({identifier,path}); let {content} = await app.api("tasks.rep_content")({identifier,path});
this.setData({content}); this.setData({content});

@ -28,7 +28,7 @@
font: 14px/normal 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', monospace; font: 14px/normal 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', monospace;
white-space: pre; white-space: pre;
padding: 4px 12px; padding: 4px 12px;
height: calc(100vh - 56px); height: calc(100vh - 51px);
flex: auto; flex: auto;
} }
.operations{ .operations{

@ -143,7 +143,7 @@
"id": 11, "id": 11,
"name": "course/pages/attendance_detail/attendance_detail", "name": "course/pages/attendance_detail/attendance_detail",
"pathName": "course/pages/attendance_detail/attendance_detail", "pathName": "course/pages/attendance_detail/attendance_detail",
"query": "course_identity=2&course_id=5141&code=&mode=&attendance_id=956", "query": "course_identity=5&course_id=5141&code=&mode=&attendance_id=956",
"scene": null "scene": null
}, },
{ {

Loading…
Cancel
Save