Commit 9335c560 authored by wangxuelai's avatar wangxuelai

Merge remote-tracking branch 'origin/20190829_lvtz' into wxl-youhua

parents 2746e21b f020ad79
......@@ -404,13 +404,6 @@
"index"
]
},
{
"root": "src/pages/inviteteacher",
"name": "inviteteacher",
"pages": [
"index"
]
},
{
"root": "src/pages/setting",
"name": "setting",
......
......@@ -87,17 +87,6 @@ Page({
this.getTeacherList('up');
},
/**
* 用户点击右上角分享
*/
// onShareAppMessage: function() {
// return {
// title: '邀请您加入学校',
// path: `/src/pages/inviteteacher/index?sid=${this.data.sid}&cid=${this.data.cid}`,
// imageUrl: 'https://cdn.img.shangjiadao.cn/source/images/dakav3/2c/common/invite.png'
// }
// },
// 搜索操作
teacherSearch(e){
const {value} = e.detail;
......
// business/pages/inviteteacher/index.js
import {
bindschool,
} from '../../../service/business/teachermgt.js'
import {
nicknameStoreTeacher,
} from '../../../service/business/common.js'
import {
LocalStorage,
} from '../../../utilities/index.js';
import {
activityLog,
formIdCreate
} from '../../../service/common.js';
var app = getApp();
Page({
/**
* 页面的初始数据
*/
data: {
sid:'',
cid: '',
teacherName:'',
namePublishing: false,
nameMaxLength: 10,
imageVersion: app.globalData.imageVersion,
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
if(options.sid){
this.setData({
sid: options.sid,
cid: options.cid,
})
const visitor = LocalStorage.getItem('visitor');
activityLog({
type: 22,
open_id: visitor && visitor.openid,
school_id:this.data.sid,
remark: ''
})
}
console.log(options)
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
this.bindschool();
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
},
bindschool(){
const visitor = LocalStorage.getItem('visitor');
bindschool({
school_id: this.data.sid,
class_id: this.data.cid
}).then((res) => {
if (res.code == 200) { // 成功的操作
LocalStorage.setItem('teacher', {
// expires_in: data.expires_in,
token: visitor && visitor.token,
// mobile,
role: 2 // 1是校长 2是老师
});
LocalStorage.setItem('dakarole', 2);
wx.redirectTo({
url: `/business/pages/organizationalmgt/index?sid=${this.data.sid}`
})
wx.showToast({
title: '绑定成功'
})
}
if (res.code == 40000){
LocalStorage.setItem('teacher', {
// expires_in: data.expires_in,
token: visitor && visitor.token,
// mobile,
role: 2 // 1是校长 2是老师
});
LocalStorage.setItem('dakarole', 2);
wx.redirectTo({
url: `/business/pages/organizationalmgt/index?sid=${this.data.sid}`
})
}
}).catch((e) => {
});
},
teacherNameChange(e) {
const { value } = e.detail;
this.setData({
teacherName: value
})
},
closeWordsDia() {
const visitor = LocalStorage.getItem('visitor');
LocalStorage.setItem('teacher', {
// expires_in: data.expires_in,
token: visitor && visitor.token,
// mobile,
role: 2 // 1是校长 2是老师
});
LocalStorage.setItem('dakarole', 2);
this.setData({
teacherName: ''
})
wx.redirectTo({
url: `/business/pages/organizationalmgt/index?sid=${this.data.sid}`
})
},
saveTeacherName() {
let teacherName = this.data.teacherName.trim();
const that = this;
if (teacherName.length == 0) {
wx.showModal({
title: '提示',
content: '机构身份昵称不能为空',
showCancel: false
})
return;
}
if (teacherName.length > 10) {
wx.showModal({
title: '提示',
content: '机构身份昵称不能超过十个字',
showCancel: false
})
return;
}
if (this.data.namePublishing) {
return
}
this.setData({
namePublishing: true
})
nicknameStoreTeacher({
school_id: this.data.sid,
nickname: teacherName
}).then(res => {
this.setData({
namePublishing: false
})
if (res.code == 200) {
const visitor = LocalStorage.getItem('visitor');
LocalStorage.setItem('teacher', {
// expires_in: data.expires_in,
token: visitor && visitor.token,
// mobile,
role: 2 // 1是校长 2是老师
});
LocalStorage.setItem('dakarole', 2);
wx.showToast({
title: '保存成功',
success() {
wx.redirectTo({
url: `/business/pages/organizationalmgt/index?sid=${that.data.sid}`
})
}
})
this.setData({
teacherName: '',
nickName: teacherName,
changeHide: true
})
}
}).catch(() => {
this.setData({
namePublishing: false
})
})
},
formIdCreate (e) {
const {formId} = e.detail;
formIdCreate({
formId
})
},
})
\ No newline at end of file
{
"usingComponents": {}
}
\ No newline at end of file
<!--business/pages/inviteteacher/index.wxml-->
<view class="container">
<!-- <view class="dailog-container clearfix">
<view class="diacontent" >
<view class="worddiatitle" >
输入机构身份昵称
</view>
<view class="inputbox" >
<input class="wordtextare" name="" id="" placeholder="如:王刚老师、王刚校长" value="{{teacherName}}" maxlength="{{nameMaxLength}}" bindinput="teacherNameChange"></input>
<text class="count" selectable="false" space="false" decode="false">{{teacherName.length}}/10</text>
</view>
<view class="bottombtn" >
<view class="btn" bindtap="closeWordsDia">
取消
</view>
<view class="btn" bindtap="saveTeacherName">
{{namePublishing ? '保存中...' : '确认'}}
</view>
</view>
</view>
</view> -->
</view>
\ No newline at end of file
/* business/pages/inviteteacher/index.wxss */
.dailog-container{
position: fixed;
left: 0;
top: 0;
width: 100%;
height: 100%;
z-index: 101;
display: flex;
align-items: center;
justify-content: center;
background:rgba(0,0,0,.5);
}
.dailog-container .diacontent {
background-color: #fff;
width: 600rpx;
height: 384rpx;
position: relative;
z-index: 2;
border-radius: 20rpx;
}
.dailog-container .diacontent .bottombtn {
border-top: 2rpx solid rgba(0,0,0,0.05);
position: absolute;
bottom: 0;
left: 0;
width: 100%;
display: flex;
align-items: center;
}
.dailog-container .diacontent .bottombtn .btn:first-child {
border-right: 2rpx solid rgba(0,0,0,0.05);
}
.dailog-container .diacontent .bottombtn .btn {
flex: 1;
text-align: center;
font-size: 30rpx;
letter-spacing: 2rpx;
line-height: 96rpx;
color: rgba(67, 67, 67, 1);
}
.dailog-container .diacontent .inputbox {
padding: 90rpx 36rpx 0;
position: relative;
}
.dailog-container .diacontent .inputbox .wordtextare{
width: 100%;
height: 50rpx;
line-height: 50rpx;
/* margin-top: 90rpx; */
}
.dailog-container .diacontent .inputbox .count {
position: absolute;
color: rgba(0,0,0,0.3);
font-size: 26rpx;
right: 20rpx;
bottom: -50rpx;
}
.dailog-container .diacontent .bottombtn .btn:last-child {
color: rgba(101, 184, 244, 1);
}
.dailog-container .diacontent .worddiatitle {
text-align: center;
line-height: 1;
padding-top: 48rpx;
font-size: 32rpx;
font-weight: 700;
}
......@@ -74,6 +74,8 @@ Page({
this.setData({
sid
})
this.getClassList();
wx.hideShareMenu();
const visitor = LocalStorage.getItem('visitor');
activityLog({
......@@ -95,10 +97,6 @@ Page({
* 生命周期函数--监听页面显示
*/
onShow: function () {
if (this.data.sid == 0) {
return;
}
this.getClassList();
},
/**
......
......@@ -170,9 +170,9 @@
<text class="" selectable="false" space="false" decode="false">人</text>
</view>
<view class="" wx:if="{{themeSelect.is_cheat == 0 || (themeSelect.is_cheat == 1 && isClock) || (themeSelect.is_cheat == 1 && !isSchoolStudent) || (clockTotal + selfcount) == 0}}">
<block class="clock-list" wx:if="{{!emptyPage}}">
<block class="clock-item" wx:for="{{clockList}}" wx:key="bigindex" wx:for-index="bigindex" wx:for-item="bigitem" wx:if="{{clockList.length > 0}}">
<view class="" wx:key="index" wx:for="{{bigitem}}">
<view class="clock-list" wx:if="{{!emptyPage}}">
<block wx:for="{{clockList}}" wx:key="bigindex" wx:for-index="bigindex" wx:for-item="bigitem">
<view class="clock-item" wx:key="index" wx:for="{{bigitem}}">
<clock-item clock="{{item}}"
bind:delClock="delClock"
bind:fingureUp="fingureUp"
......@@ -205,7 +205,7 @@
</block>
<list-loading loading="{{clockGetting}}"></list-loading>
</block>
</view>
<view class="empty-content-box" wx:if="{{(clockTotal + selfcount) == 0}}">
<empty-content text="还没有同学交作业,快来抢沙发吧~" emptyimg="common/empty/empty_c_sraech.png" width="263" height="219"></empty-content>
</view>
......
......@@ -912,7 +912,6 @@ Page({
businessinfo
} = this.data.boxTop;
var scrolltop = 0;
console.log(_tabList[index],'_tabList[index]')
// switch (_tabList[index]) {
// case '全部':
// this.data.scrolltop = 1;
......@@ -1194,7 +1193,6 @@ Page({
tabshow: false
})
}
console.log(1112)
wx.createSelectorQuery().select('#student-clock').boundingClientRect(function (rect) {
if(studentclock<businessinfo){
......
......@@ -84,9 +84,8 @@
<view class="title">
<view class="text">学员动态</view>
</view>
<view class="clock-box-wrapper">
<view class="clock-box" wx:for="{{clockList}}"
wx:key="index" bindtap="readClock" data-item="{{item}}">
<view class="clock-list">
<view class="clock-item" wx:for="{{clockList}}" wx:key="index" bindtap="readClock" data-item="{{item}}">
<clock-item
clock="{{item}}"
bind:delClock="delClock"
......@@ -115,9 +114,6 @@
bind:integrallogpost="integrallogpost"
>
</clock-item>
<!-- <form report-submit="true" bindsubmit="formIdCreate" class="createidform">
<button form-type="submit" class="createidbutton">生成form</button>
</form> -->
</view>
</view>
</view>
......
......@@ -363,13 +363,13 @@
background-size: 100% 100%;
background-position: -4rpx -6rpx;
}
.student-clock-box .clock-box-wrapper{
.student-clock-box .clock-list{
margin-top: -12rpx;
}
.student-clock-box .clock-box{
.student-clock-box .clock-item{
border-bottom: 15rpx solid #F7F7F9;
}
.student-clock-box .clock-box:last-of-type{
.student-clock-box .clock-item:last-of-type{
border-bottom: 0;
}
.student-clock-box .bottom-box{
......
......@@ -224,39 +224,38 @@ Page({
loginToManager(){
const visitor = LocalStorage.getItem('visitor') || {};
let user = LocalStorage.getItem('user');
let teacher = LocalStorage.getItem('teacher');
let dakarole = LocalStorage.getItem('dakarole');
if(user && user.token){
wx.request({
url: apis.business.ucenter.schoolList,
data: {
page: 1,
perPage: 100
},
header: {
'Authorization': user.token,
},
success(res){
if (res.data.code == 200) {
LocalStorage.setItem('user', {
token: user.token,
})
LocalStorage.setItem('dakarole', 1);
if (res.data.data.total > 0 ) {
wx.reLaunch({
url: `/business/pages/deskcenter/index?sid=${res.data.data.list[0].id}`
})
} else {
wx.redirectTo({
url: '/business/pages/shopeditor/index?from=1'
})
}
} else {
}
}
})
return
}
// if(user && user.token){
// wx.request({
// url: apis.business.ucenter.schoolList,
// data: {
// page: 1,
// perPage: 100
// },
// header: {
// 'Authorization': user.token,
// },
// success(res){
// if (res.data.code == 200) {
// LocalStorage.setItem('user', {
// token: user.token,
// })
// LocalStorage.setItem('dakarole', 1);
// if (res.data.data.total > 0 ) {
// wx.reLaunch({
// url: `/business/pages/deskcenter/index?sid=${res.data.data.list[0].id}`
// })
// } else {
// wx.redirectTo({
// url: '/business/pages/shopeditor/index?from=1'
// })
// }
// } else {
// }
// }
// })
// return
// }
getMember({
consumer_id: visitor && visitor.id
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment