|
@@ -7,22 +7,89 @@
|
|
|
<view class="top-box">
|
|
|
<view class="top-item" v-for="(item,index) in list">
|
|
|
<view class="top-main">
|
|
|
- <image class="top-icon" :src="baseURL + item.iconimage" mode=""></image>
|
|
|
- <view class="top-name">
|
|
|
+ <image v-if="tabCurrentIndex >= index" class="top-icon" :src="baseURL + item.iconimage" mode="">
|
|
|
+ </image>
|
|
|
+ <image v-if="tabCurrentIndex < index" class="top-icon" :src="baseURL + item.icon2image" mode="">
|
|
|
+ </image>
|
|
|
+ <view class="top-name" :class="{curret:tabCurrentIndex==index}">
|
|
|
{{item.name}}
|
|
|
</view>
|
|
|
</view>
|
|
|
<image class="jt" v-if="index != list.length -1" src="../../static/img/jt.png" mode=""></image>
|
|
|
</view>
|
|
|
</view>
|
|
|
+ <swiper :current="tabCurrentIndex" :style="{ height: height }" class="swiper-box" duration="300"
|
|
|
+ disable-touch>
|
|
|
+ <swiper-item class="tab-content" v-for="(tabItem, tabIndex) in list" :key="tabIndex">
|
|
|
+ <view class="student-box flex">
|
|
|
+ <view class="student-left">
|
|
|
+ <view class="shu">
|
|
|
+ </view>
|
|
|
+ <view class="student-name">
|
|
|
+ 学生: <text>{{dquser.nickname}}</text>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view class="student-right" @click="qh()">
|
|
|
+ <view class="student-qh">
|
|
|
+ 切换
|
|
|
+ </view>
|
|
|
+ <image class="student-back" src="../../static/icon/back.png" mode=""></image>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view class="step" v-for="(item,index) in tabItem.item" :key="index">
|
|
|
+ <view class="step-top">
|
|
|
+ <view class="shu"></view>
|
|
|
+ <view class="step-title">{{item.name}}</view>
|
|
|
+ </view>
|
|
|
+ <view class="step-main flex">
|
|
|
+ <view class="step-left">分数(共{{item.max_score}}分)</view>
|
|
|
+ <view class="step-right">
|
|
|
+ <input class="step-input" type="digit" v-model="item.score" :max="item.max_score*1"
|
|
|
+ placeholder-class="place" placeholder="请输入分数">
|
|
|
+ <view class="step-font">分</view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view class="step-info" v-if="item.info">
|
|
|
+ <view class="set-info-title">说明:</view>
|
|
|
+ <view class="set-info-mian">{{item.info}}</view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view class="btn" @click="tj(tabItem)">
|
|
|
+ {{tabIndex == (this.list.length -1)?'确认提交' : '下一步'}}
|
|
|
+ </view>
|
|
|
+ </swiper-item>
|
|
|
+ </swiper>
|
|
|
</view>
|
|
|
+ <uni-popup ref="student" type="bottom">
|
|
|
+ <view class="popup-box">
|
|
|
+ <view class="popup-title flex">
|
|
|
+ <view class="qx" @click="cancel">取消</view>
|
|
|
+ <view class="qd" @click="cancel">确定</view>
|
|
|
+ </view>
|
|
|
+ <view class="popup">
|
|
|
+ <scroll-view class="popup-left" scroll-y="true">
|
|
|
+ <view class="popup-left-item" v-for="(item,index) in userlist" :key="index"
|
|
|
+ :class="{curr:index==studentIndex}" @click="changezu(index)">
|
|
|
+ {{item.group}}
|
|
|
+ </view>
|
|
|
+ </scroll-view>
|
|
|
+ <scroll-view class="popup-right" scroll-y="true">
|
|
|
+ <view v-for="(item,index) in userlist[studentIndex].users" :key="index" class="popup-right-item"
|
|
|
+ :class="{currRight:item.id==dquser.id}" @click="changepeople(item,index)">
|
|
|
+ {{item.nickname}}
|
|
|
+ </view>
|
|
|
+ </scroll-view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </uni-popup>
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import {
|
|
|
misssion,
|
|
|
- user_list
|
|
|
+ user_list,
|
|
|
+ score
|
|
|
} from '@/api/project.js'
|
|
|
import {
|
|
|
mapState,
|
|
@@ -31,13 +98,31 @@
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
|
- te
|
|
|
- user: {},
|
|
|
+ studentIndex: 0,
|
|
|
+ tabCurrentIndex: 0,
|
|
|
+ dquser: '',
|
|
|
+ dqz: '',
|
|
|
+ dqdjg: '',
|
|
|
id: '',
|
|
|
list: [],
|
|
|
- userlist: []
|
|
|
+ userlist: [],
|
|
|
+ height: ''
|
|
|
};
|
|
|
},
|
|
|
+ onReady(res) {
|
|
|
+ var _this = this;
|
|
|
+ uni.getSystemInfo({
|
|
|
+ success: resu => {
|
|
|
+ const query = uni.createSelectorQuery();
|
|
|
+ query.select('.swiper-box').boundingClientRect();
|
|
|
+ query.exec(function(res) {
|
|
|
+ _this.height = resu.windowHeight - res[0].top + 'px';
|
|
|
+ console.log('打印页面的剩余高度', _this.height);
|
|
|
+ });
|
|
|
+ },
|
|
|
+ fail: res => {}
|
|
|
+ });
|
|
|
+ },
|
|
|
onLoad(opt) {
|
|
|
this.id = opt.id
|
|
|
},
|
|
@@ -49,23 +134,126 @@
|
|
|
...mapState(['baseURL'])
|
|
|
},
|
|
|
onReachBottom() {},
|
|
|
- onReady() {},
|
|
|
methods: {
|
|
|
loadData() {
|
|
|
user_list({}).then(e => {
|
|
|
console.log(e, '123456');
|
|
|
this.userlist = e.data
|
|
|
- this.user = e.data[0].users[0]
|
|
|
+ this.dqz = 0;
|
|
|
+ this.dqdjg = 0;
|
|
|
+ this.dquser = e.data[0].users[0]
|
|
|
this.getproject()
|
|
|
})
|
|
|
},
|
|
|
getproject() {
|
|
|
- misssion({}, this.id, this.user.id).then(({
|
|
|
+ uni.showLoading({
|
|
|
+ title: '加载中'
|
|
|
+ })
|
|
|
+ misssion({}, this.id, this.dquser.id).then(({
|
|
|
data
|
|
|
}) => {
|
|
|
+ uni.hideLoading()
|
|
|
this.list = data.step
|
|
|
- console.log(data, '12456');
|
|
|
})
|
|
|
+ },
|
|
|
+ next() {
|
|
|
+ const obj = this
|
|
|
+ for (var i = this.dqz; i < this.userlist.length; i++) {
|
|
|
+ for (var j = this.dqdjg; j < this.userlist[i].users.length; j++) {
|
|
|
+ if (obj.dquser.id == this.userlist[i].users[j].id) {
|
|
|
+ if (j + 1 < this.userlist[i].users.length) {
|
|
|
+ obj.dqdjg = j + 1
|
|
|
+ break;
|
|
|
+ } else {
|
|
|
+ obj.dqdjg = 0;
|
|
|
+ obj.dqz++
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (obj.dqz == this.userlist.length) {
|
|
|
+ break
|
|
|
+ } else {
|
|
|
+ if (this.userlist[obj.dqz].users.length != 0) {
|
|
|
+ break
|
|
|
+ } else {
|
|
|
+ obj.dqz++
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ console.log(obj.dqz, obj.dqdjg);
|
|
|
+ if (obj.dqz >= this.userlist.length) {
|
|
|
+ uni.showModal({
|
|
|
+ title: '提示',
|
|
|
+ content: '当前关的全部学生已全部评完,是否跳回到首页',
|
|
|
+ success: function(res) {
|
|
|
+ if (res.confirm) {
|
|
|
+ uni.switchTab({
|
|
|
+ url: '/pages/index/index'
|
|
|
+ })
|
|
|
+ } else if (res.cancel) {}
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ obj.$api.msg('当前学生已评价,切换到下一个')
|
|
|
+ obj.dquser = obj.userlist[obj.dqz].users[obj.dqdjg]
|
|
|
+ this.tabCurrentIndex = 0
|
|
|
+ this.getproject()
|
|
|
+ }
|
|
|
+ },
|
|
|
+ qh() {
|
|
|
+ this.$refs.student.open()
|
|
|
+ },
|
|
|
+ cancel() {
|
|
|
+ this.$refs.student.close()
|
|
|
+ },
|
|
|
+ changezu(index) {
|
|
|
+ this.studentIndex = index
|
|
|
+ },
|
|
|
+ changepeople(item, index) {
|
|
|
+ this.dquser = item
|
|
|
+ this.dqz = this.studentIndex
|
|
|
+ this.dqdjg = index
|
|
|
+ this.cancel()
|
|
|
+ this.studentIndex = 0
|
|
|
+ this.tabCurrentIndex = 0
|
|
|
+ this.getproject()
|
|
|
+ },
|
|
|
+ tj(opt) {
|
|
|
+ const obj = this
|
|
|
+ let isok = 0;
|
|
|
+ try {
|
|
|
+ opt.item.forEach(e => {
|
|
|
+ if (!e.score) {
|
|
|
+ obj.$api.msg('请输入' + e.name + '的分数')
|
|
|
+ isok = 1
|
|
|
+ throw Error()
|
|
|
+ }
|
|
|
+ if (e.score * 1 > e.max_score) {
|
|
|
+ obj.$api.msg(e.name + '的最大分数为' + e.max_score + ',请不要超过这个分数')
|
|
|
+ isok = 1
|
|
|
+ throw Error()
|
|
|
+ }
|
|
|
+ score({
|
|
|
+ score: e.score
|
|
|
+ }, e.id, obj.dquser.id).then(e => {})
|
|
|
+
|
|
|
+ })
|
|
|
+ if (isok == 1) {
|
|
|
+ throw Error()
|
|
|
+ } else {
|
|
|
+ if (obj.tabCurrentIndex != obj.list.length - 1 && isok == 0) {
|
|
|
+ obj.tabCurrentIndex++
|
|
|
+ } else {
|
|
|
+ obj.next()
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } catch (e) {
|
|
|
+ //TODO handle the exception
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
};
|
|
@@ -123,8 +311,13 @@
|
|
|
position: relative;
|
|
|
z-index: 2;
|
|
|
margin-top: 16rpx;
|
|
|
- font-size: 30rpx;
|
|
|
+ font-size: 24rpx;
|
|
|
font-family: PingFang SC;
|
|
|
+ font-weight: 500;
|
|
|
+ color: rgba(#ffffff, 0.7);
|
|
|
+ }
|
|
|
+
|
|
|
+ .curret {
|
|
|
font-weight: bold;
|
|
|
color: #2A9CEC;
|
|
|
-webkit-text-stroke: 1rpx #FFFFFF;
|
|
@@ -140,4 +333,231 @@
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ .student-box {
|
|
|
+ margin: 34rpx auto 0;
|
|
|
+ width: 698rpx;
|
|
|
+ background: #FFFFFF;
|
|
|
+ box-shadow: 0px 6rpx 12rpx 1rpx rgba(101, 101, 101, 0.06);
|
|
|
+ border-radius: 28rpx;
|
|
|
+ padding: 28rpx 22rpx;
|
|
|
+
|
|
|
+ .student-left {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+
|
|
|
+ .shu {
|
|
|
+ width: 6rpx;
|
|
|
+ height: 30rpx;
|
|
|
+ background: #F9A81B;
|
|
|
+ border-radius: 3rpx;
|
|
|
+ }
|
|
|
+
|
|
|
+ .student-name {
|
|
|
+ margin-left: 16rpx;
|
|
|
+ font-size: 30rpx;
|
|
|
+ font-family: PingFang SC;
|
|
|
+ font-weight: bold;
|
|
|
+ color: #000000;
|
|
|
+
|
|
|
+ text {
|
|
|
+ color: #40547E;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .student-right {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+
|
|
|
+ .student-qh {
|
|
|
+ font-size: 26rpx;
|
|
|
+ font-family: PingFang SC;
|
|
|
+ font-weight: 500;
|
|
|
+ color: #666666;
|
|
|
+ margin-right: 10rpx;
|
|
|
+ }
|
|
|
+
|
|
|
+ .student-back {
|
|
|
+ width: 12rpx;
|
|
|
+ height: 23rpx;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .step {
|
|
|
+ margin: 34rpx auto 0;
|
|
|
+ width: 698rpx;
|
|
|
+ background: #FFFFFF;
|
|
|
+ box-shadow: 0px 6rpx 12rpx 1rpx rgba(101, 101, 101, 0.06);
|
|
|
+ border-radius: 20rpx;
|
|
|
+ padding: 28rpx 22rpx;
|
|
|
+
|
|
|
+ .step-top {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+
|
|
|
+ .shu {
|
|
|
+ width: 6rpx;
|
|
|
+ height: 30rpx;
|
|
|
+ background: #F9A81B;
|
|
|
+ border-radius: 3rpx;
|
|
|
+ }
|
|
|
+
|
|
|
+ .step-title {
|
|
|
+ margin-left: 16rpx;
|
|
|
+ font-size: 30rpx;
|
|
|
+ font-family: PingFang SC;
|
|
|
+ font-weight: bold;
|
|
|
+ color: #000000;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .step-main {
|
|
|
+ padding: 50rpx 20rpx 32rpx;
|
|
|
+ line-height: 1;
|
|
|
+
|
|
|
+ .step-left {
|
|
|
+ font-size: 28rpx;
|
|
|
+ font-family: PingFang SC;
|
|
|
+ font-weight: 500;
|
|
|
+ color: #666666;
|
|
|
+ }
|
|
|
+
|
|
|
+ .step-right {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+
|
|
|
+ .step-input {
|
|
|
+ text-align: right;
|
|
|
+ font-size: 32rpx;
|
|
|
+ font-family: PingFang SC;
|
|
|
+ font-weight: bold;
|
|
|
+ color: #FF4C4C;
|
|
|
+ }
|
|
|
+
|
|
|
+ .place {
|
|
|
+ line-height: 1;
|
|
|
+ font-size: 28rpx;
|
|
|
+ font-family: PingFang SC;
|
|
|
+ font-weight: bold;
|
|
|
+ color: #999999;
|
|
|
+ }
|
|
|
+
|
|
|
+ .step-font {
|
|
|
+ margin-left: 10rpx;
|
|
|
+ font-size: 28rpx;
|
|
|
+ font-family: PingFang SC;
|
|
|
+ font-weight: bold;
|
|
|
+ color: #000000;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .step-info {
|
|
|
+ margin-right: 20rpx;
|
|
|
+ border-top: 1px solid #ECECEC;
|
|
|
+ padding: 32rpx 20rpx 0;
|
|
|
+ display: flex;
|
|
|
+ align-items: flex-start;
|
|
|
+
|
|
|
+ .set-info-title {
|
|
|
+ width: 80rpx;
|
|
|
+ flex-shrink: 0;
|
|
|
+ margin-right: 10rpx;
|
|
|
+ font-size: 24rpx;
|
|
|
+ font-family: PingFang SC;
|
|
|
+ font-weight: 500;
|
|
|
+ color: #666666;
|
|
|
+ line-height: 41rpx;
|
|
|
+ }
|
|
|
+
|
|
|
+ .set-info-mian {
|
|
|
+ font-size: 24rpx;
|
|
|
+ font-family: PingFang SC;
|
|
|
+ font-weight: 500;
|
|
|
+ color: #666666;
|
|
|
+ line-height: 41rpx;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .btn {
|
|
|
+ margin: 50rpx auto 0;
|
|
|
+ width: 674rpx;
|
|
|
+ height: 88rpx;
|
|
|
+ background: #2A9CEC;
|
|
|
+ border-radius: 20rpx;
|
|
|
+ text-align: center;
|
|
|
+ line-height: 88rpx;
|
|
|
+ font-size: 36rpx;
|
|
|
+ font-family: PingFang SC;
|
|
|
+ font-weight: 500;
|
|
|
+ color: #FFFFFF;
|
|
|
+ }
|
|
|
+
|
|
|
+ .popup-box {
|
|
|
+ width: 750rpx;
|
|
|
+ background: #FFFFFF;
|
|
|
+ border-top-left-radius: 30rpx;
|
|
|
+ border-top-right-radius: 30rpx;
|
|
|
+
|
|
|
+ .popup-title {
|
|
|
+ padding: 32rpx 38rpx;
|
|
|
+
|
|
|
+ .qx {
|
|
|
+ font-size: 28rpx;
|
|
|
+ font-family: PingFang SC;
|
|
|
+ font-weight: 500;
|
|
|
+ color: #666666;
|
|
|
+ }
|
|
|
+
|
|
|
+ .qd {
|
|
|
+ font-size: 28rpx;
|
|
|
+ font-family: PingFang SC;
|
|
|
+ font-weight: bold;
|
|
|
+ color: #2A9CEC;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .popup {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+
|
|
|
+ .popup-left {
|
|
|
+ width: 244rpx;
|
|
|
+ height: 500rpx;
|
|
|
+
|
|
|
+ .popup-left-item {
|
|
|
+ width: 244rpx;
|
|
|
+ padding: 30rpx 0;
|
|
|
+ text-align: center;
|
|
|
+ font-size: 28rpx;
|
|
|
+ font-family: PingFang SC;
|
|
|
+ font-weight: 500;
|
|
|
+ color: #000000;
|
|
|
+ background: #f6f6f6;
|
|
|
+ }
|
|
|
+
|
|
|
+ .curr {
|
|
|
+ background: #ffffff;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .popup-right {
|
|
|
+ width: 506rpx;
|
|
|
+ height: 500rpx;
|
|
|
+ padding: 0 20rpx;
|
|
|
+
|
|
|
+ .popup-right-item {
|
|
|
+ padding: 30rpx 20rpx;
|
|
|
+ border-bottom: 1px solid #f7f7f7;
|
|
|
+ }
|
|
|
+
|
|
|
+ .currRight {
|
|
|
+ color: #2A9CEC;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
</style>
|