Browse Source

feat(student): 添加合同列表功能- 新增合同列表页面,展示合同标题、内容和时间

- 实现下拉刷新和加载更多功能
- 添加跳转到合同详情页面的功能
- 在我的页面添加合同列表入口
- 更新页面配置,添加新的导航栏样式
master
liutong 12 months ago
parent
commit
15b85addca
  1. 72
      pages.json
  2. 225
      pages/common/contract_list.vue
  3. 10
      pages/student/my/my.vue

72
pages.json

@ -91,101 +91,115 @@
} }
}, },
{ {
"path" : "pages/common/privacy_agreement", "path" : "pages/student/my/update_pass",
"style": { "style": {
"navigationBarTitleText": "隐私协议", "navigationBarTitleText": "修改密码",
"navigationStyle": "default", "navigationStyle": "default",
"navigationBarBackgroundColor": "#fff", "navigationBarBackgroundColor": "#fff",
"navigationBarTextStyle": "black" "navigationBarTextStyle": "black"
} }
}, },
{ {
"path" : "pages/common/my_message", "path" : "pages/student/my/lesson_consumption",
"style": { "style": {
"navigationBarTitleText": "我的消息", "navigationBarTitleText": "课时消耗",
"navigationStyle": "default", "navigationStyle": "default",
"navigationBarBackgroundColor": "#292929", "navigationBarBackgroundColor": "#333333",
"navigationBarTextStyle": "white" "navigationBarTextStyle": "white"
} }
}, },
{ {
"path" : "pages/common/im_chat_info", "path" : "pages/student/my/my_members",
"style": { "style": {
"navigationBarTitleText": "", "navigationBarTitleText": "我的成员",
"navigationStyle": "default", "navigationStyle": "default",
"navigationBarBackgroundColor": "#292929", "navigationBarBackgroundColor": "#333333",
"navigationBarTextStyle": "white" "navigationBarTextStyle": "white"
} }
}, },
{ {
"path" : "pages/common/sys_msg_list", "path" : "pages/student/my/personal_data",
"style": { "style": {
"navigationBarTitleText": "系统消息", "navigationBarTitleText": "个人资料",
"navigationStyle": "default", "navigationStyle": "default",
"navigationBarBackgroundColor": "#292929", "navigationBarBackgroundColor": "#333333",
"navigationBarTextStyle": "white" "navigationBarTextStyle": "white"
} }
}, },
{ {
"path" : "pages/student/my/update_pass", "path" : "pages/student/index/job_list",
"style": { "style": {
"navigationBarTitleText": "修改密码", "navigationBarTitleText": "作业列表",
"navigationStyle": "default",
"navigationBarBackgroundColor": "#29d3b4",
"navigationBarTextStyle": "white"
}
},
{
"path" : "pages/common/privacy_agreement",
"style": {
"navigationBarTitleText": "隐私协议",
"navigationStyle": "default", "navigationStyle": "default",
"navigationBarBackgroundColor": "#fff", "navigationBarBackgroundColor": "#fff",
"navigationBarTextStyle": "black" "navigationBarTextStyle": "black"
} }
}, },
{ {
"path" : "pages/common/article_info", "path" : "pages/common/my_message",
"style": { "style": {
"navigationBarTitleText": "文章详情", "navigationBarTitleText": "我的消息",
"navigationStyle": "default", "navigationStyle": "default",
"navigationBarBackgroundColor": "#292929", "navigationBarBackgroundColor": "#292929",
"navigationBarTextStyle": "white" "navigationBarTextStyle": "white"
} }
}, },
{ {
"path" : "pages/common/feedback", "path" : "pages/common/im_chat_info",
"style": { "style": {
"navigationBarTitleText": "意见反馈", "navigationBarTitleText": "",
"navigationStyle": "default", "navigationStyle": "default",
"navigationBarBackgroundColor": "#292929", "navigationBarBackgroundColor": "#292929",
"navigationBarTextStyle": "white" "navigationBarTextStyle": "white"
} }
}, },
{ {
"path" : "pages/student/my/lesson_consumption", "path" : "pages/common/sys_msg_list",
"style": { "style": {
"navigationBarTitleText": "课时消耗", "navigationBarTitleText": "系统消息",
"navigationStyle": "default", "navigationStyle": "default",
"navigationBarBackgroundColor": "#333333", "navigationBarBackgroundColor": "#292929",
"navigationBarTextStyle": "white" "navigationBarTextStyle": "white"
} }
}, },
{ {
"path" : "pages/student/my/my_members", "path" : "pages/common/article_info",
"style": { "style": {
"navigationBarTitleText": "我的成员", "navigationBarTitleText": "文章详情",
"navigationStyle": "default", "navigationStyle": "default",
"navigationBarBackgroundColor": "#333333", "navigationBarBackgroundColor": "#292929",
"navigationBarTextStyle": "white" "navigationBarTextStyle": "white"
} }
}, },
{ {
"path" : "pages/student/my/personal_data", "path" : "pages/common/feedback",
"style": { "style": {
"navigationBarTitleText": "个人资料", "navigationBarTitleText": "意见反馈",
"navigationStyle": "default", "navigationStyle": "default",
"navigationBarBackgroundColor": "#333333", "navigationBarBackgroundColor": "#292929",
"navigationBarTextStyle": "white" "navigationBarTextStyle": "white"
} }
}, },
{ {
"path" : "pages/student/index/job_list", "path" : "pages/common/contract_list",
"style": { "style": {
"navigationBarTitleText": "作业列表", "navigationBarTitleText": "合同列表",
"navigationStyle": "default", "navigationStyle": "default",
"navigationBarBackgroundColor": "#29d3b4", "navigationBarBackgroundColor": "#292929",
"navigationBarTextStyle": "white" "navigationBarTextStyle": "white"
} }
}, },

225
pages/common/contract_list.vue

@ -0,0 +1,225 @@
<!--合同列表-列表-->
<template>
<view class="main_box">
<view class="main_section">
<scroll-view
class="section_1"
scroll-y="true"
:lower-threshold="lowerThreshold"
@scrolltolower="loadMoreData"
style="height: 90vh;"
>
<view
class="item"
v-for="(v,k) in tableList"
:key="k"
@click="openViewArticleInfo(v)"
>
<view class="title">{{v.title}}</view>
<!-- <image-->
<!-- class="img_box"-->
<!-- :src="$util.img('/upload/attachment/image/202504/02/1743562333d1bb6666f969da1b7170381d0845153e_local.png')"-->
<!-- model="aspectFit"-->
<!-- ></image>-->
<view class="content" v-html="v.content"></view>
<view class="time">{{v.show_time}}</view>
</view>
</scroll-view>
</view>
</view>
</template>
<script>
import commonApi from '@/api/common.js';
export default {
components: {
},
data() {
return {
loading:false,//
lowerThreshold: 100,//
isReachedBottom: false,//|true=|false=
//
filteredData:{
page:1,//
limit:10,//
total:10,//
hair_staff_id: '',//id
},
tableList:[],//
}
},
onLoad(options) {
this.filteredData.hair_staff_id = options.hair_staff_id//id
},
onShow(){
this.init()
},
//
async onPullDownRefresh() {
//
await this.resetFilteredData()
await this.getList()
},
methods: {
//
async init(){
await this.getList();
},
//()
loadMoreData() {
//
if (!this.isReachedBottom) {
this.isReachedBottom = true;//
this.getList();
}
},
//
async resetFilteredData() {
this.isReachedBottom = false; // 便
this.filteredData.page = 1//
this.filteredData.limit = 10//
this.filteredData.total = 10//
},
//
async getList(){
this.loading = true
let data = {...this.filteredData}
//
if(this.filteredData.page * this.filteredData.limit > this.filteredData.total){
this.loading = false
uni.showToast({
title: '暂无更多',
icon: 'none'
})
return
}
if(data.page == 1){
this.tableList = []
}
let res = await commonApi.getContactMessage(data)//
this.loading = false
this.isReachedBottom = false;
if (res.code != 1){
uni.showToast({
title: res.msg,
icon: 'none'
})
return
}
this.tableList = this.tableList.concat(res.data.data); // 使 concat
// this.tableList.unshift(...res.data.data); //
console.log('列表',this.tableList)
this.filteredData.total = res.data.total
this.filteredData.page++
},
//
openViewArticleInfo(item) {
let id = item.id
let redirect = item.redirect//
uni.navigateTo({
url: `/pages/common/article_info?id=${id}`
})
},
}
}
</script>
<style lang="less" scoped>
.main_box {
background: #292929;
}
//
.navbar_section {
display: flex;
justify-content: center;
align-items: center;
background: #29d3b4;
.title {
padding: 20rpx 0;
font-size: 30rpx;
color: #315d55;
}
}
.main_section {
min-height: 100vh;
background: #292929 100%;
padding: 0 0rpx;
padding-top: 32rpx;
padding-bottom: 150rpx;
font-size: 28rpx;
display: flex;
flex-direction: column;
gap: 20rpx;
.section {
background-color: #434544;
padding: 40rpx 40rpx;
}
.section_1{
padding: 0 24rpx;
display: flex;
flex-direction: column;
.item{
margin-bottom: 38rpx;
display: flex;
flex-direction: column;
padding: 32rpx 24rpx;
border-radius: 14rpx;
background-color: rgba(255,255,255,1);
border: 2rpx solid rgba(187,187,187,1);
color: #4F4F4F;
font-size: 32rpx;
.title{
}
.img_box{
margin-top: 30rpx;
width: 100%;
}
.content{
margin-top: 30rpx;
}
.time{
display: flex;
justify-content: flex-end;
margin-top: 36rpx;
}
}
}
}
.describe {
color: #999999;
padding-left: 30rpx;
}
</style>

10
pages/student/my/my.vue

@ -56,7 +56,7 @@
<!-- <view></view>--> <!-- <view></view>-->
<!-- </view>--> <!-- </view>-->
<view class="item"> <view class="item" @click="openViewContractList()">
<view>我的合同</view> <view>我的合同</view>
<view></view> <view></view>
</view> </view>
@ -143,6 +143,14 @@
url: '/pages/student/my/personal_data' url: '/pages/student/my/personal_data'
}) })
}, },
//-
openViewContractList(item) {
uni.navigateTo({
url: `/pages/common/contract_list`
})
},
//- //-
openViewMyMessage(item) { openViewMyMessage(item) {
uni.navigateTo({ uni.navigateTo({

Loading…
Cancel
Save