123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168 |
- <template>
- <view class="contianer">
- <view class="">
- </view>
- <view class="list" v-if="false">
- <view @click="clickItem(item,index)" v-for="(item,index) in list" :key="index" class="list-item">
- <view class="list-item-img">
- <!-- <image v-if="item." style="width:72rpx;height: 72rpx;margin-right: 20rpx;" src="@/static/image/male.png" mode=""></image> -->
- <image style="width:72rpx;height: 72rpx;margin-right: 20rpx;" src="@/static/image/female.png"
- mode=""></image>
- <view class="list-item-name">
- 我是 {{item.school.school_name}} {{item.role.title}}
- </view>
- </view>
- <view class="list-item-active">
- <uni-icons v-if="active == item.id" style="color:rgba(5,204,161, 1) ;" type="checkmarkempty"
- size="24"></uni-icons>
- </view>
- </view>
- </view>
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- active: 0,
- list: []
- }
- },
- methods: {
- clickItem(item, index) {
- this.$api.sendRequest({
- url: '/mobile/selectRole',
- data: {
- role_id: item.role_id,
- school_id: item.school.id,
- },
- success: res => {
- console.log(res);
- this.active = item.id
- this.$store.commit('setInfo', item)
- this.$store.commit('setRoleInfo', res.data)
-
- let url = item.role.title == '维修人员' ?
- '/pages/fixedAssetsProcessed/fixedAssetsProcessed' :
- '/pages/homePage/homePage'
- uni.navigateTo({
- url: url
- })
- },
- })
- },
- getUserList() {
- this.$api.sendRequest({
- url: '/mobile/getRole',
- success: res => {
- this.list = res.data
- let info = res.data[0]
- this.$store.commit('setInfo', info)
- this.active = info.id
- }
- })
- }
- },
- mounted() {
- if(process.env.NODE_ENV === 'development'){
- let data={
- "id": 16,
- "admin_id": 0,
- "school_id": 1,
- "person_id": 16,
- "teacher_number": "",
- "teacher_name": "李墨",
- "sex": 0,
- "teacher_photo": "",
- "type": 0,
- "education": "大学本科",
- "degree": "文学学士学位",
- "course_id": 1,
- "teacher_phone": "15158468759",
- "teacher_email": "",
- "address": "",
- "batch_id": 7,
- "level": 1,
- "status": 0,
- "is_del": 0,
- "upload_total": 0,
- "download_total": 0,
- "created_at": "2023-09-26 17:22:56",
- "updated_at": null,
- "access_token": "a58d238956a13b9a818c0f6d9a35d487",
- "token": "f26618b059869f0bec57e8f16a3e15e0",
- "selfclass": {
- "id": 3,
- "school_id": 1,
- "grade_level": 2,
- "class_level": 3,
- "grade_id": 2,
- "dept_id": 673412163,
- "teacher_id": 16,
- "class_number": "",
- "class_no": "2023_2_3",
- "class_num": 3,
- "class_name": "二年级3班",
- "class_photo": "https://zhxy.obs.cn-hz1.ctyun.cn/zhxy/classroom/112053504953.jpg",
- "class_type": 1,
- "enrol_year": 2023,
- "sessions_year": 2022,
- "deduct": 9,
- "status": 0,
- "is_del": 0,
- "batch_id": 1,
- "created_at": "2023-09-26 14:48:58",
- "updated_at": null
- }
- }
- this.$store.commit("setTeacherInfo",data)
- uni.setStorageSync('token', "a1df03154b53637cab5c003e0a9f94c2")
- console.log(11111);
- uni.navigateTo({
- url:'/pages/studentRanked/studentRanked'
- })
- }
-
- }
- }
- </script>
- <style lang="scss" scoped>
- .contianer {
- padding: 48rpx;
- .list {
- width: 100%;
- }
- .list-item {
- height: 94rpx;
- width: 100%;
- border-radius: 10rpx;
- background-color: #fff;
- display: flex;
- align-items: center;
- justify-content: space-between;
- margin-bottom: 32rpx;
- box-shadow: -0.67px 0px 5px 0.67px rgba(46, 46, 46, 0.28);
- .list-item-img {
- margin-left: 32rpx;
- border-radius: 50%;
- display: flex;
- align-items: center;
- }
- .list-item-active {
- margin-right: 32rpx;
- }
- }
- }
- </style>
|