|
@@ -1,32 +1,38 @@
|
|
|
<template>
|
|
|
<view>
|
|
|
<uni-swipe-action>
|
|
|
- <!-- <template v-for="(item, index) in courses" > -->
|
|
|
- <uni-swipe-action-item :threshold="0" :right-options="options" @click="bindClick()">
|
|
|
- <view class="requires">
|
|
|
+ <template v-for="(item, index) in requirement">
|
|
|
+ <uni-swipe-action-item :threshold="0" :right-options="item.options" @click="bindClick(item)">
|
|
|
+ <view class="requires" @click="requireDetail(item)">
|
|
|
<uni-row class="demo-uni-row">
|
|
|
- <view>需求号:1231411312123131334244</view>
|
|
|
- </uni-row>
|
|
|
- <uni-row class="demo-uni-row">
|
|
|
- <view>需求科目:xxx</view>
|
|
|
+ <uni-col offset="1">
|
|
|
+ <view class="requires-col1">需求号:{{item.requireId}}</view>
|
|
|
+ </uni-col>
|
|
|
</uni-row>
|
|
|
<uni-row class="demo-uni-row">
|
|
|
- <uni-col :span="12">
|
|
|
- <view>需求金额:xxx</view>
|
|
|
- </uni-col>
|
|
|
- <uni-col :span="4" >
|
|
|
- 已通过
|
|
|
- </uni-col>
|
|
|
- <uni-col :span="4" >
|
|
|
- 未成交
|
|
|
- </uni-col>
|
|
|
- <uni-col :span="4" >
|
|
|
- 未锁
|
|
|
+ <uni-col offset="1">
|
|
|
+ <view class="requires-col2">需求科目:{{item.subjectSmall}}</view>
|
|
|
</uni-col>
|
|
|
</uni-row>
|
|
|
+ <view class="requires-col3">
|
|
|
+ <uni-row class="demo-uni-row">
|
|
|
+ <uni-col :span="11" offset="1">
|
|
|
+ <view>需求金额:{{item.salary}}</view>
|
|
|
+ </uni-col>
|
|
|
+ <uni-col :span="4" >
|
|
|
+ <view style="color: red;">{{item.verifyStatus}}</view>
|
|
|
+ </uni-col>
|
|
|
+ <uni-col :span="4" >
|
|
|
+ <view style="color: red;">{{item.deal}}</view>
|
|
|
+ </uni-col>
|
|
|
+ <uni-col :span="4" >
|
|
|
+ <view style="color: red;">{{item.locked}}</view>
|
|
|
+ </uni-col>
|
|
|
+ </uni-row>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
</uni-swipe-action-item>
|
|
|
- <!-- </template> -->
|
|
|
+ </template>
|
|
|
</uni-swipe-action>
|
|
|
|
|
|
<uni-fab :pattern="pattern" horizontal="left" vertical="bottom"
|
|
@@ -39,21 +45,60 @@
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
|
- options: '上架',
|
|
|
+ requirement: [], // 需求列表
|
|
|
+ publishCount: 0, // 上架数量
|
|
|
pattern: {
|
|
|
color: '#7A7E83',
|
|
|
- backgroundColor: '#fff',
|
|
|
- selectedColor: '#C00000',
|
|
|
- buttonColor: '#C00000',
|
|
|
- iconColor: '#fff'
|
|
|
+ backgroundColor: '#000000',
|
|
|
+ selectedColor: '#E2F0D9',
|
|
|
+ buttonColor: '#E2F0D9',
|
|
|
+ iconColor: '#000000'
|
|
|
}
|
|
|
};
|
|
|
},
|
|
|
+ created() {
|
|
|
+ this.getPublishCounts()
|
|
|
+ },
|
|
|
methods: {
|
|
|
fabClick() {
|
|
|
uni.navigateTo({
|
|
|
url: '/subpkg/add_stu_require/add_stu_require'
|
|
|
})
|
|
|
+ },
|
|
|
+ // 查询个人上架了多少课程
|
|
|
+ async getPublishCounts() {
|
|
|
+ const { data: result } = await uni.$http.get('/education/student-requirements/getPublishCounts')
|
|
|
+ this.publishCount = result.data.count
|
|
|
+ this.requirement = result.data.list
|
|
|
+ for (let i = 0; i < this.requirement.length; i++) {
|
|
|
+ if (this.requirement[i].display === '上架') {
|
|
|
+ this.requirement[i].dispaly = '下架'
|
|
|
+ this.requirement[i].options = [{text: '下架', style: {backgroundColor: '#E2F0D9', color: 'black'}}]
|
|
|
+ } else {
|
|
|
+ this.requirement[i].dispaly = '上架'
|
|
|
+ this.requirement[i].options = [{text: '上架', style: {backgroundColor: '#E2F0D9', color: 'black'}}]
|
|
|
+ }
|
|
|
+ }
|
|
|
+ console.log(this.requirement)
|
|
|
+ },
|
|
|
+ async bindClick(item) {
|
|
|
+ const queryObj = {
|
|
|
+ display: item.dispaly,
|
|
|
+ requireId: item.requireId
|
|
|
+ }
|
|
|
+ const { data: result } = await uni.$http.get('/education/student-requirements/updatePersonDisplay', queryObj)
|
|
|
+ if (result.code === 20000) {
|
|
|
+ uni.$showMsg(item.dispaly + '成功')
|
|
|
+ setTimeout(() => {
|
|
|
+ this.getPublishCounts()
|
|
|
+ }, 500)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ requireDetail(item) {
|
|
|
+ let stu_require = JSON.stringify(item)
|
|
|
+ uni.navigateTo({
|
|
|
+ url: '/subpkg/stu_require_detail/stu_require_detail?item=' + encodeURIComponent(stu_require)
|
|
|
+ })
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -62,5 +107,18 @@
|
|
|
<style lang="scss">
|
|
|
.requires {
|
|
|
background-color: #FFF2CC;
|
|
|
+ border: 1px solid #41719C;
|
|
|
+
|
|
|
+ .requires-col1 {
|
|
|
+ margin-top: 15rpx;
|
|
|
+ }
|
|
|
+
|
|
|
+ .requires-col2 {
|
|
|
+ margin: 15rpx 0;
|
|
|
+ }
|
|
|
+
|
|
|
+ .requires-col3 {
|
|
|
+ padding-bottom: 15rpx;
|
|
|
+ }
|
|
|
}
|
|
|
</style>
|