master
lion 1 year ago
parent 6fde122dbe
commit 75e8859ce8

@ -10,7 +10,11 @@
{{form.sex}}
</u-form-item>
<u-form-item label="联系方式" prop="mobile">
<u-input type="number" border placeholder="请输入联系方式" v-model="form.mobile" />
<view style="display: flex;justify-content: space-between;align-items: center;">
<u-input type="number" disabled placeholder="请输入联系方式" v-model="form.mobile" />
<!-- <view>{{form.mobile}}</view> -->
<u-button size="mini" type="primary" @click="addMobile">{{form.mobile?'':''}}</u-button>
</view>
</u-form-item>
<u-form-item label="身份证号" prop="idcard">
<u-input type="idcard" border placeholder="请输入身份证号" v-model="form.idcard" />
@ -25,8 +29,7 @@
<u-input v-model="form.company_name" border placeholder="请输入公司名称" />
</u-form-item>
<u-form-item label="职务" prop="company_position">
<u-input border v-model="form.company_position"
placeholder="请输入职务" />
<u-input border v-model="form.company_position" placeholder="请输入职务" />
</u-form-item>
<u-form-item label="车牌" prop="plate">
@ -48,9 +51,6 @@
<view @click="saveUser" type="primary">提交</view>
</view>
</view>
<u-picker @confirm="selectPosition" v-model="showPosition" :range="positionList" range-key="value"
mode="selector"></u-picker>
<view class="modal">
<u-popup v-model="showPark" mode="bottom">
<view class="modal-tip">绑定车牌号</view>
@ -64,6 +64,30 @@
</view>
</u-popup>
</view>
<!-- 修改手机号 -->
<view class="modal">
<u-popup v-model="showMobile" mode="bottom">
<view class="modal-tip">联系方式</view>
<view class="modal-content" style="height:400rpx">
<view class="login-form">
<view>
<u-input :custom-style="inputStyle" :clearable="false" v-model="myMobile"
placeholder="联系方式"></u-input>
</view>
<view class="sendmsg">
<u-input v-model="myCode" :custom-style="inputSendStyle" :clearable="false"
placeholder="验证码"></u-input>
<view @click="getSmsCode" class="send" :class="{'hasSend':hasSend}">
{{hasSend?'已发送':'获取验证码'}}<text v-if="hasSend">({{count}}s)</text>
</view>
</view>
</view>
</view>
<view class="form-btn">
<view @click="changeMobile" type="primary">确定</view>
</view>
</u-popup>
</view>
</view>
</template>
@ -78,14 +102,30 @@
},
data() {
return {
showPosition: false,
positionList: [],
showMobile: false,
myMobile: '',
myCode: '',
hasSend: false,
sendTimer: null,
count: 60,
inputStyle: {
'padding': '0rpx 30rpx',
'height': '80rpx',
'border': '1rpx solid #dad8d8;',
'border-radius': '20rpx'
},
inputSendStyle: {
'padding': '0rpx 30rpx',
'height': '80rpx',
'border': '1rpx solid #dad8d8;',
'border-radius': '20rpx 0 0 20rpx'
},
form: {
},
plateList: [],
showPark: false,
isLocked:false,
showPark: false,
isLocked: false,
plate1: '',
plateNumber: ['苏', 'E', '', '', '', '', ''],
rules: {
@ -113,11 +153,11 @@
trigger: ['blur'],
}],
email: [{
validator: (rule, value, callback) => {
if (!this.base.isNull(value)) {
return this.$u.test.email(value);
} else {
return true
validator: (rule, value, callback) => {
if (!this.base.isNull(value)) {
return this.$u.test.email(value);
} else {
return true
}
},
message: '邮箱不正确',
@ -132,19 +172,82 @@
onShow() {
this.getUserInfo()
},
onLoad() {
this.getPosition()
onLoad() {},
onUnload() {
if (this.sendTimer) {
clearInterval(this.sendTimer);
this.sendTimer = null
}
},
onHide() {
if (this.sendTimer) {
clearInterval(this.sendTimer);
this.sendTimer = null
}
},
methods: {
selectPosition(e) {
this.form.company_position = this.positionList[e[0]]['value']
addMobile() {
this.myMobile = this.form.mobile
this.showMobile = true
},
getPosition() {
this.$u.api.getparameter({
number: 'company_position'
getSmsCode() {
if (this.hasSend) {
return
}
if (this.base.isNull(this.myMobile)) {
this.base.toast('手机号码不能为空')
return
}
if (!this.base.isMobile(this.myMobile)) {
this.base.toast('手机号码错误')
return
}
if (this.myMobile == this.form.mobile && !this.base.isNull(this.form.mobile)) {
this.base.toast('请输入需要变更的手机号码')
return
}
let that = this
this.$u.api.sendSms({
mobile: this.myMobile
}).then(res => {
this.positionList = res.detail
this.base.toast("发送成功")
this.hasSend = true
this.sendTimer = setInterval(function() {
if (that.count > 1) {
that.count--
} else {
clearInterval(that.sendTimer);
that.sendTimer = null
that.count = 60
that.hasSend = false;
}
}, 1000)
})
},
changeMobile() {
if (this.base.isNull(this.myMobile)) {
this.base.toast('请输入手机号')
return
}
if (this.base.isNull(this.myCode)) {
this.base.toast('请输入验证码')
return
}
let that = this
this.$u.api.bindMobile({
mobile: this.myMobile,
code: this.myCode,
is_bind: 1
}).then(res => {
this.base.toast('更改成功', 1500, function() {
that.myMobile = ''
that.myCode = ''
that.showMobile = false
setTimeout(function() {
that.getUserInfo()
}, 1500)
})
})
},
getUserInfo() {
@ -159,11 +262,11 @@
this.plateList.splice(index, 1)
}
})
}
}
this.isLocked = false
this.$u.vuex('vuex_user', res.user)
}).catch(res=>{
this.isLocked = false
}).catch(res => {
this.isLocked = false
})
},
addPlate() {
@ -177,9 +280,6 @@
delPlate(index) {
this.plateList.splice(index, 1)
this.saveUser('del')
},
changeMobile() {
},
plateChange(val) {
this.plate1 = val.join('')
@ -204,14 +304,14 @@
if (type == 'del') {
this.form.plate = this.plateList.join(",")
}
console.log("plateList", this.plateList)
console.log("plateList", this.plateList)
let that = this
this.$refs.uForm.validate(valid => {
if (valid) {
if(this.isLocked){
return
}
if (valid) {
if (this.isLocked) {
return
}
this.isLocked = true
this.$u.api.saveUser(this.form).then(res => {
this.showPark = false
@ -239,8 +339,8 @@
})
}).catch(err=>{
this.isLocked = false
}).catch(err => {
this.isLocked = false
})
} else {
console.log('验证失败');
@ -308,5 +408,46 @@
padding: 0 30rpx;
}
}
.login-form {
margin: 100rpx 50rpx;
&>view {
border-radius: 20rpx;
&:first-child {
margin-bottom: 50rpx;
}
}
.sendmsg {
display: flex;
justify-content: space-between;
align-items: center;
u-input {
width: calc(100% - 200rpx);
}
.send {
background: #c69c6d;
color: #fff;
height: 80rpx;
line-height: 80rpx;
border-radius: 0 20rpx 20rpx 0;
width: 200rpx;
text-align: center;
border: 1px solid #c69c6d;
box-sizing: content-box;
}
.hasSend {
background: #dad8d8;
color: #333;
border: 1px solid #dad8d8;
}
}
}
}
</style>

@ -15,7 +15,7 @@
<text class="courseName">班主任</text>
</view>
</view>
<view class="teacher-mobile" @click="callPhone(tea.mobile)">
<view v-if="tea.mobile" class="teacher-mobile" @click="callPhone(tea.mobile)">
<image style="width:22rpx;height:22rpx;margin-right:20rpx"
:src="base.imgHost('txl-phone.png')"></image>
<view style="color:blue">{{tea.mobile?tea.mobile:''}}</view>
@ -24,38 +24,48 @@
</view>
</view>
<view v-if="!show_mobile" class="showMobile"></view>
<view v-if="studentList.length>0">
<view class="teacher" v-for="item in studentList">
<view>
<image style="width:97rpx;height:97rpx;margin-right:30rpx"
:src="base.imgHost('txl-student.png')"></image>
</view>
<view>
<view class="teacher-name">
<view style="display: flex;align-items: center;">
<text>{{item.name}}</text>
<text class="courseName">{{item.course_signs[0]['position']}}</text>
<view class="tips">
按照姓名首字母顺序排列,排名不分先后
</view>
<!-- 其他学生 -->
<view class="wrap2" style="height:100vh;overflow: scroll;">
<view v-if="hasData">
<scroll-view :scroll-top="0" style="height:100vh;padding-bottom: 600rpx;" :scroll-y="true" @scrolltolower="scrollGet" class="list">
<view class="left-item-card" v-for="(mess,inx) in list">
<view class="left-item-card-info">
<view class="left-item-card-name">
<view>
<text style="font-size:32rpx;color:#000">{{mess.name}}</text>
<text class="courseName" v-if="mess.position">{{mess.position}}</text>
</view>
</view>
<view v-if="mess['company_name']"
style="font-size:28rpx;color:#666;margin-bottom:10rpx">
{{mess['company_name']||''}}
</view>
<view v-if="mess['company_position']"
style="font-size:28rpx;color:#666;margin-bottom:10rpx">
{{mess['company_position']||''}}
</view>
</view>
</view>
<view class="teacher-company">{{item.company_name?item.company_name:''}}</view>
<view class="teacher-company">{{item.company_position?item.company_position:''}}</view>
<view v-if="show_mobile" class="teacher-company">{{item.mobile?item.mobile:''}}</view>
<!-- <view class="teacher-mobile">
<view style="font-size:24rpx;color:#999;margin-bottom:10rpx">如需联系方式请联系班主任</view>
</view> -->
</view>
</scroll-view>
</view>
<view class="nodata" v-else>
<u-empty mode="data"></u-empty>
</view>
</view>
<view class="next-scroll-right">
<view :class="{'next-scroll-right-name':true,'next-scroll-right-select':letter==''}"
@click.stop="changeLetter('All')">
All
</view>
<view :class="{'next-scroll-right-name':true,'next-scroll-right-select':letter===item}"
v-for="(item,index) in letterList" :key="index" @click.stop="changeLetter(item)">{{item}}
</view>
</view>
</view>
<!-- <view v-if="list.length>0"> -->
<nextIndexedXlist ref="txllist" :dataList="list" :show-avatar="false">
</nextIndexedXlist>
<!-- </view> -->
<!-- <view class="nodata" v-else>
<u-empty mode="data"></u-empty>
</view> -->
</view>
</view>
</template>
@ -68,48 +78,102 @@
},
data() {
return {
course_id: '',
list: [],
teacher: [],
studentList: [],
show_mobile: false,
current_page: 1,
total_page: 0,
hasData: true,
letter: '',
letterList: ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S",
"T", "U", "V", "W", "X", "Y", "Z"
]
}
},
onLoad(options) {
let that = this
this.show_mobile = options.show_mobile == 1 ? true : false
this.course_id = options.id
console.log("this.$refs.txllist", options.show_mobile, this.show_mobile, this.$refs.txllist)
this.$nextTick(function() {
that.$refs.txllist.setShowMobile(options.show_mobile)
})
// this.$nextTick(function() {
// that.$refs.txllist.setShowMobile(options.show_mobile)
// })
this.getMyTeachers(options.id)
this.getMyCourseTxl(options.id)
},
methods: {
scrollGet() {
if (!this.hasData) {
return
}
if (this.current_page > this.total_page) {
this.base.toast('没有更多了')
return
}
this.current_page = this.current_page + 1
this.getMyCourseTxl()
},
changeLetter(e) {
if (e === 'All') {
this.letter = ''
} else {
this.letter = e
}
this.current_page = 1
this.total_page = 0
this.hasData = true
this.list = []
this.getMyCourseTxl()
},
async getMyCourseTxl(id) {
uni.showLoading({
title: "...",
icon: 'none'
})
const res = await this.$u.api.courseUserList({
course_id: id,
type: 2
course_id: this.course_id,
type: 2,
page: this.current_page,
letter: this.letter
})
let _student = []
let _other = []
res.list.map(item => {
if (item.course_signs && item.course_signs.length > 0) {
if (!this.base.isNull(item.course_signs[0]['position'])) {
_student.push(item)
} else {
_other.push(item)
}
} else {
_other.push(item)
}
this.total_page = res.list.last_page
if (res.list.data.length === 0 && this.current_page === 1) {
this.hasData = false
}
this.list.push(...res.list.data)
console.log("qwe", this.list)
uni.hideLoading()
// let _student = []
// let _other = []
// res.list.data.map(item => {
// if (item.course_signs && item.course_signs.length > 0) {
// if (!this.base.isNull(item.course_signs[0]['position'])) {
// _student.push(item)
// } else {
// _other.push(item)
// }
// } else {
// _other.push(item)
// }
// })
// this.studentList = _student
// this.list = _other
},
async getMyTeachers(id) {
const res = await this.$u.api.courseUserList({
course_id: this.course_id,
type: 2
})
this.studentList = _student
this.list = _other
this.teacher = res.teacher
},
callPhone(phoneNumber) {
if(this.base.isNull(phoneNumber)){
return
callPhone(phoneNumber) {
if (this.base.isNull(phoneNumber)) {
return
}
uni.makePhoneCall({
phoneNumber: phoneNumber, //
@ -128,7 +192,7 @@
<style scoped lang="scss">
.container {
padding: 30rpx 60rpx;
padding: 30rpx;
width: 100%;
height: 100vh;
overflow: hidden;
@ -144,7 +208,9 @@
.wrap {
position: relative;
height: 100%;
overflow: scroll;
// overflow: scroll;
padding-right: 60rpx;
// padding-top: 100rpx;
.nodata {
@ -200,29 +266,125 @@
margin-bottom: 10rpx;
}
}
.tips {
font-size: 24rpx;
text-align: left;
padding-left: 30rpx;
color: #999999;
margin-bottom: 30rpx;
border-bottom: 1rpx solid #cfd5d9;
padding-bottom: 20rpx;
}
.wrap2 {
// &-item {
// margin: 30rpx 0;
// padding: 30rpx;
// background-color: #fff;
// border-radius: 20rpx;
.left-item-card {
width: 100%;
// height: 112rpx;
background-color: #FFFFFF;
box-sizing: border-box;
padding-left: 24rpx;
display: flex;
align-items: center;
justify-content: flex-start;
margin-bottom: 30rpx;
padding: 30rpx;
background-color: #fff;
border-radius: 20rpx;
.left-item-card-img {
width: 80rpx;
min-width: 80rpx;
height: 80rpx;
background-color: #CFCFCF;
display: flex;
align-items: center;
justify-content: center;
font-size: 36rpx;
font-weight: bold;
color: #FFFFFF;
}
.img-info {
background: none;
border: solid #f0f0f0 1rpx;
}
.left-item-card-info {
width: 100%;
// margin-left: 32rpx;
height: 100%;
display: flex;
align-items: flex-start;
justify-content: center;
flex-direction: column;
// &>view {
// margin-bottom: 10rpx;
&>view {
margin-bottom: 10rpx;
// }
}
.left-item-card-name {
font-size: 32rpx;
color: #333;
// &-name {
// font-size: 32rpx;
// color: #333;
.courseName {
color: #b89155;
margin: 0 20rpx;
font-size: 24rpx;
border-radius: 0rpx 28rpx 28rpx 28rpx;
color: #fff;
padding: 0rpx 15rpx;
background: #b89155;
}
}
// .courseName {
// color: #b89155;
// margin: 0 10rpx;
// font-size: 28rpx;
// }
// }
// }
.left-item-card-phone {
margin-top: 14rpx;
font-size: 28rpx;
line-height: 28rpx;
color: #999999;
}
}
}
}
.next-scroll-right {
position: fixed;
right: 10rpx;
top: 50%;
transform: translateY(-47%);
z-index: 999 !important;
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
.next-scroll-right-name {
width: 40rpx;
height: 40rpx;
font-size: 32rpx;
color: #333333;
line-height: 40rpx;
margin: 6rpx 10rpx;
margin-top: 0;
display: flex;
align-items: center;
justify-content: center;
}
.next-scroll-right-select {
width: 40rpx;
height: 40rpx;
border-radius: 50%;
background: #b89155;
color: #FFFFFF;
font-size: 24rpx;
line-height: 40rpx;
margin: 0 10rpx;
}
}
}
}
</style>

@ -1,6 +1,6 @@
<template>
<view class="container">
<image class="cbg" :src="base.imgHost('common_bg.png')"></image>
<image class="cbg" :src="base.imgHost('common_bg.png')"></image>
<view class="wrap">
<u-form :model="form" :label-width="140" ref="uForm" :label-align="'left'" :error-type="['message']">
<u-form-item label="姓名" prop="username" required>
@ -9,26 +9,58 @@
<u-form-item label="性别" prop="sex" required>
<u-input @click="showSex = true" placeholder="请选择性别" v-model="form.sex" type="select" />
</u-form-item>
<u-form-item label="联系方式" prop="mobile" required>
<u-input type="number" placeholder="请输入联系方式"
v-model="form.mobile" />
<u-form-item label="联系方式" prop="mobile" required>
<!-- <u-input type="number" placeholder="请输入联系方式" v-model="form.mobile" /> -->
<view style="display: flex;justify-content: space-between;align-items: center;">
<u-input type="number" disabled placeholder="联系方式" v-model="form.mobile" />
<!-- <view>{{form.mobile}}</view> -->
<u-button size="mini" type="primary" @click="addMobile"></u-button>
</view>
</u-form-item>
<u-form-item label="出生日期" prop="birthday">
<u-input @click="dateShow=true" placeholder="请选择出生日期" v-model="form.birthday" type="select" /></u-form-item>
<u-input @click="dateShow=true" placeholder="请选择出生日期" v-model="form.birthday"
type="select" /></u-form-item>
<u-form-item label="邮箱" prop="email">
<u-input v-model="form.email" placeholder="请输入邮箱"/></u-form-item>
<u-form-item label="公司名称" prop="company_name">
<u-input v-model="form.company_name" placeholder="请输入公司名称"/>
<u-input v-model="form.email" placeholder="请输入邮箱" /></u-form-item>
<u-form-item label="公司名称" prop="company_name">
<u-input v-model="form.company_name" placeholder="请输入公司名称" />
</u-form-item>
<u-form-item label="职务" prop="company_position">
<u-input v-model="form.company_position" type="text" placeholder="请输入职务"/></u-form-item>
<u-form-item label="职务" prop="company_position">
<u-input v-model="form.company_position" type="text" placeholder="请输入职务" /></u-form-item>
</u-form>
</view>
<view class="form-btn">
<view @click="saveUser"></view>
</view>
</view>
<!-- 修改手机号 -->
<view class="modal">
<u-popup v-model="showMobile" mode="bottom">
<view class="modal-tip">联系方式</view>
<view class="modal-content" style="height:400rpx">
<view class="login-form">
<view>
<u-input :custom-style="inputStyle" :clearable="false" v-model="myMobile"
placeholder="联系方式"></u-input>
</view>
<view class="sendmsg">
<u-input v-model="myCode" :custom-style="inputSendStyle" :clearable="false"
placeholder="验证码"></u-input>
<view @click="getSmsCode" class="send" :class="{'hasSend':hasSend}">
{{hasSend?'已发送':'获取验证码'}}<text v-if="hasSend">({{count}}s)</text>
</view>
</view>
</view>
</view>
<view class="form-btn">
<view @click="changeMobile" type="primary">确定</view>
</view>
</u-popup>
</view>
<u-picker @confirm="selectSex" v-model="showSex" :range="sexList" range-key="value" mode="selector"></u-picker>
<u-picker @confirm="dateConfirm" mode="time" v-model="dateShow" :params="dateParams"></u-picker>
<u-picker @confirm="dateConfirm" mode="time" v-model="dateShow" :params="dateParams"></u-picker>
</view>
</template>
@ -36,18 +68,37 @@
export default {
data() {
return {
course_id:null,
showSex: false,
showPosition:false,
positionList:[],
dateShow:false,
dateParams: {
year: true,
month: true,
day: true,
hour: false,
minute: false,
second: false
showMobile: false,
myMobile:'',
myCode: '',
hasSend: false,
sendTimer: null,
count: 60,
inputStyle: {
'padding': '0rpx 30rpx',
'height': '80rpx',
'border': '1rpx solid #dad8d8;',
'border-radius': '20rpx'
},
inputSendStyle: {
'padding': '0rpx 30rpx',
'height': '80rpx',
'border': '1rpx solid #dad8d8;',
'border-radius': '20rpx 0 0 20rpx'
},
course_id: null,
showSex: false,
dateShow: false,
dateParams: {
year: true,
month: true,
day: true,
hour: false,
minute: false,
second: false
},
form: {
username: '',
@ -69,7 +120,7 @@
sex: [{
required: true,
message: '请选择性别',
trigger: ['change','blur'],
trigger: ['change', 'blur'],
}],
mobile: [{
required: true,
@ -81,13 +132,13 @@
},
message: '手机号码不正确',
trigger: ['blur'],
}],
// email: [{
// validator: (rule, value, callback) => {
// return this.$u.test.email(value);
// },
// message: '',
// trigger: ['blur'],
}],
// email: [{
// validator: (rule, value, callback) => {
// return this.$u.test.email(value);
// },
// message: '',
// trigger: ['blur'],
// }],
}
@ -96,43 +147,113 @@
onReady() {
this.$refs.uForm.setRules(this.rules);
},
onLoad(options) {
this.course_id = options.id?options.id:null
onLoad(options) {
this.course_id = options.id ? options.id : null
},
methods: {
selectSex(e) {
this.form.sex = this.sexList[e[0]]['value']
onUnload() {
if (this.sendTimer) {
clearInterval(this.sendTimer);
this.sendTimer = null
}
},
onHide() {
if (this.sendTimer) {
clearInterval(this.sendTimer);
this.sendTimer = null
}
},
methods: {
addMobile() {
// this.myMobile = this.form.mobile
this.showMobile = true
},
//
dateConfirm(e) {
this.form.birthday = e.year + '-' + e.month + '-' + e.day
getSmsCode() {
if (this.hasSend) {
return
}
if (this.base.isNull(this.myMobile)) {
this.base.toast('手机号码不能为空')
return
}
if (!this.base.isMobile(this.myMobile)) {
this.base.toast('手机号码错误')
return
}
let that = this
this.$u.api.sendSms({
mobile: this.myMobile
}).then(res => {
this.base.toast("发送成功")
this.hasSend = true
this.sendTimer = setInterval(function() {
if (that.count > 1) {
that.count--
} else {
clearInterval(that.sendTimer);
that.sendTimer = null
that.count = 60
that.hasSend = false;
}
}, 1000)
})
},
saveUser() {
changeMobile() {
if (this.base.isNull(this.myMobile)) {
this.base.toast('请输入手机号')
return
}
if (this.base.isNull(this.myCode)) {
this.base.toast('请输入验证码')
return
}
let that = this
this.$u.api.bindMobile({
mobile: this.myMobile,
code: this.myCode,
is_bind: 1
}).then(res => {
this.base.toast('绑定成功')
this.form.mobile = this.myMobile
// that.myMobile = ''
this.myCode = ''
this.showMobile = false
})
},
selectSex(e) {
this.form.sex = this.sexList[e[0]]['value']
},
//
dateConfirm(e) {
this.form.birthday = e.year + '-' + e.month + '-' + e.day
},
saveUser() {
let that = this
this.$refs.uForm.validate(valid => {
if (valid) {
if (valid) {
this.form.name = this.form.username
this.$u.api.saveUser(this.form).then(res => {
this.$u.api.user().then(res => {
this.$u.vuex('vuex_user', res.user)
this.base.toast("注册成功",2000,function(){
console.log("that.course_id",that.course_id)
if(that.course_id){
uni.redirectTo({
url:'/packages/course/detail?id='+that.course_id
})
// uni.redirectTo({
// url:'/pages/course/index'
// })
}else{
uni.switchTab({
url: '/pages/me/index'
})
}
})
this.$u.vuex('vuex_user', res.user)
this.base.toast("注册成功", 2000, function() {
console.log("that.course_id", that.course_id)
if (that.course_id) {
uni.redirectTo({
url: '/packages/course/detail?id=' +
that.course_id
})
// uni.redirectTo({
// url:'/pages/course/index'
// })
} else {
uni.switchTab({
url: '/pages/me/index'
})
}
})
})
})
} else {
@ -151,6 +272,7 @@
padding: 30rpx;
height: 100vh;
overflow: scroll;
.cbg {
position: absolute;
top: 0;
@ -181,6 +303,63 @@
border-radius: 30rpx;
padding: 20rpx;
}
}
.modal {
::v-deep .u-drawer-bottom {
border-radius: 40rpx;
}
&-tip {
text-align: center;
padding: 30rpx;
font-size: 32rpx;
}
&-content {
// height: 400rpx;
padding: 0 30rpx;
}
}
.login-form {
margin: 100rpx 50rpx;
&>view {
border-radius: 20rpx;
&:first-child {
margin-bottom: 50rpx;
}
}
.sendmsg {
display: flex;
justify-content: space-between;
align-items: center;
u-input {
width: calc(100% - 200rpx);
}
.send {
background: #c69c6d;
color: #fff;
height: 80rpx;
line-height: 80rpx;
border-radius: 0 20rpx 20rpx 0;
width: 200rpx;
text-align: center;
border: 1px solid #c69c6d;
box-sizing: content-box;
}
.hasSend {
background: #dad8d8;
color: #333;
border: 1px solid #dad8d8;
}
}
}
}

@ -51,6 +51,18 @@
},
onLoad(options) {
this.type=options.id?'course':'me'
},
onUnload() {
if(this.sendTimer){
clearInterval(this.sendTimer);
this.sendTimer = null
}
},
onHide() {
if(this.sendTimer){
clearInterval(this.sendTimer);
this.sendTimer = null
}
},
methods: {
getSmsCode() {
@ -75,7 +87,9 @@
if (that.count > 1) {
that.count--
} else {
clearInterval(that.sendTimer);
clearInterval(that.sendTimer);
that.sendTimer = null
that.count = 60
that.hasSend = false;
}
}, 1000)

@ -1,27 +1,55 @@
<template>
<view class="container">
<image class="cbg" :src="base.imgHost('common_bg.png')"></image>
<view class="search">
<view class="search-icon" @click="showSearch=!showSearch">
<image :src="base.imgHost('search.png')"></image>
<view class="search">
<view class="search-icon" @click="showSearch=!showSearch">
<image :src="base.imgHost('search.png')"></image>
</view>
<view class="search-tab">
<u-tabs :bg-color="'#f0f7fc'" active-color="#b89155" :list="selectArr.company_industry" name="value"
:is-scroll="true" :current="current" @change="changeSearch"></u-tabs>
</view>
</view>
<!-- 字母 -->
<view class="next-scroll-right">
<view :class="{'next-scroll-right-name':true,'next-scroll-right-select':select.letter==''}"
@click.stop="changeLetter('All')">
All
</view>
<view :class="{'next-scroll-right-name':true,'next-scroll-right-select':select.letter===item}"
v-for="(item,index) in letterList" :key="index" @click.stop="changeLetter(item)">{{item}}
</view>
</view>
<view class="wrap">
<view v-if="list.length>0">
<nextIndexedXlist :dataList="list" :show-avatar="false">
</nextIndexedXlist>
<view v-if="hasData">
<view class="tips">
按照姓名首字母顺序排列,排名不分先后
</view>
<scroll-view style="height:100vh" :scroll-y="true" @scrolltolower="scrollGet" class="list">
<view class="left-item-card" v-for="(mess,inx) in list">
<view class="left-item-card-info">
<view class="left-item-card-name">
<view>
<text style="font-size:32rpx;color:#000">{{mess.name}}</text>
</view>
</view>
<view v-if="mess['company_name']" style="font-size:28rpx;color:#666;margin-bottom:10rpx">
{{mess['company_name']||''}}</view>
<view v-if="mess['company_position']"
style="font-size:28rpx;color:#666;margin-bottom:10rpx">{{mess['company_position']||''}}
</view>
</view>
</view>
<!-- <nextIndexedXlist :dataList="list" :show-avatar="false">
</nextIndexedXlist> -->
</scroll-view>
</view>
<view class="nodata" v-else>
<u-empty mode="data"></u-empty>
</view>
</view>
<view class="modal" v-if="showSearch">
<view>
<text>姓名</text>
@ -98,10 +126,15 @@
// company_position: '',
company_area: '',
company_type: '',
company_industry: '',
company_industry: '',
letter:''
},
current: 0,
list: [],
current_page: 1,
total_page: 0,
hasData: true,
letterList:["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"]
}
},
onLoad() {
@ -109,7 +142,37 @@
this.getIndustry()
},
methods: {
scrollGet() {
if (!this.hasData) {
return
}
if (this.current_page > this.total_page) {
this.base.toast('没有更多了')
return
}
this.current_page = this.current_page + 1
this.getMyCourseTxl()
},
changeLetter(e){
if(e==='All'){
this.select.letter = ''
}else{
this.select.letter = e
}
this.current_page = 1
this.total_page = 0
this.hasData = true
this.list = []
this.getMyCourseTxl()
},
async getMyCourseTxl() {
uni.showLoading({
title: "...",
icon: 'none'
})
const res = await this.$u.api.courseUserList({
// course_id: id,
name: this.select.name,
@ -118,11 +181,19 @@
company_area: this.select.company_area,
company_type: this.select.company_type,
company_industry: this.select.company_industry,
type: 1
type: 1,
page: this.current_page,
letter: this.select.letter
})
this.list = res.list
this.showSearch = false
this.total_page = res.list.last_page
if (res.list.data.length === 0 && this.current_page === 1) {
this.hasData = false
}
this.list.push(...res.list.data)
this.showSearch = false
console.log("qwe",this.list)
uni.hideLoading()
},
selectIndex(e) {
console.log("e", e)
@ -153,7 +224,12 @@
this.select.company_industry = this.selectArr.company_industry[e]['value']
} else {
this.select.company_industry = ''
}
}
this.current_page = 1
this.total_page = 0
this.list = []
this.hasData = true
this.select.letter = ""
this.getMyCourseTxl()
},
// selectPosition(e) {
@ -175,9 +251,14 @@
// company_position: '',
company_area: '',
company_type: '',
company_industry: '',
}
company_industry: '',
letter:''
}
this.current = 0
this.current_page = 1
this.total_page = 0
this.list = []
this.hasData = true
this.getMyCourseTxl()
},
confirmSearch() {
@ -190,7 +271,7 @@
<style scoped lang="scss">
.container {
padding: 30rpx 60rpx;
padding: 30rpx;
width: 100%;
height: 100vh;
overflow: scroll;
@ -240,34 +321,121 @@
.wrap {
position: relative;
padding-top: 100rpx;
height:100%;
height: 100%;
overflow: scroll;
padding-right: 60rpx;
.nodata {
height: calc(100vh - 160rpx);
}
&-item {
margin: 30rpx 0;
padding: 30rpx;
background-color: #fff;
border-radius: 20rpx;
&>view {
margin-bottom: 10rpx;
}
&-name {
font-size: 32rpx;
color: #333;
.courseName {
color: #b89155;
margin: 0 10rpx;
font-size: 28rpx;
}
}
.tips{
font-size: 24rpx;
text-align: left;
padding-left:30rpx;
color:#999999;
margin-bottom:30rpx;
border-bottom:1rpx solid #cfd5d9;
padding-bottom:20rpx;
}
.left-item-card {
width: 100%;
// height: 112rpx;
background-color: #FFFFFF;
box-sizing: border-box;
padding-left: 24rpx;
display: flex;
align-items: center;
justify-content: flex-start;
margin-bottom: 30rpx;
padding: 30rpx;
background-color: #fff;
border-radius: 20rpx;
.left-item-card-img {
width: 80rpx;
min-width: 80rpx;
height: 80rpx;
background-color: #CFCFCF;
display: flex;
align-items: center;
justify-content: center;
font-size: 36rpx;
font-weight: bold;
color: #FFFFFF;
}
.img-info {
background: none;
border: solid #f0f0f0 1rpx;
}
.left-item-card-info {
width: 100%;
// margin-left: 32rpx;
height: 100%;
display: flex;
align-items: flex-start;
justify-content: center;
flex-direction: column;
&>view {
margin-bottom: 10rpx;
}
.left-item-card-name {
font-size: 32rpx;
color: #333;
.courseName {
color: #b89155;
margin: 0 10rpx;
font-size: 28rpx;
}
}
.left-item-card-phone {
margin-top: 14rpx;
font-size: 28rpx;
line-height: 28rpx;
color: #999999;
}
}
}
}
.next-scroll-right {
position: fixed;
right: 10rpx;
top: 50%;
transform: translateY(-47%);
z-index: 999 !important;
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
.next-scroll-right-name {
width: 40rpx;
height: 40rpx;
font-size: 32rpx;
color: #333333;
line-height: 40rpx;
margin: 6rpx 10rpx;
margin-top:0;
display: flex;
align-items: center;
justify-content: center;
}
.next-scroll-right-select {
width: 40rpx;
height: 40rpx;
border-radius: 50%;
background: #b89155;
color: #FFFFFF;
font-size: 24rpx;
line-height: 40rpx;
margin: 0 10rpx;
}
}
.modal {
@ -275,8 +443,8 @@
height: 100vh;
position: fixed;
top: 0;
left: 0;
z-index:1000;
left: 0;
z-index: 1000;
// z-index: 999999;
background-color: #fff;
padding: 30rpx 60rpx;
@ -318,6 +486,7 @@
}
}
}
}
}
</style>
Loading…
Cancel
Save