123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313 |
- <template>
- <view>
- <u-navbar back-text="共享用工" back-icon-size="28" back-icon-color="#ffffff" :background="{backgroundColor: '#2795FD',}"
- :back-text-style="{color: '#ffffff'}"></u-navbar>
- <!-- 标签 -->
- <view class="tabs">
- <u-tabs :list="list" :is-scroll="false" :current="current" @change="change"></u-tabs>
- </view>
- <view class="content">
- <view class="info-card" v-for="(item,i) in list[current].list" :key="i">
- <!-- 卡片信息 -->
- <view class="detail" @click="gotoUrl('pages/packages/shareEmployment/articleDetail?id='+item.id)">
- {{item.content}}
- </view>
- <view class="tag" @click="gotoUrl('pages/packages/shareEmployment/articleDetail?id='+item.id)">
- <view class="item1" v-if="item.type == '1'">
- 急需用工
- </view>
- <view class="item2" v-if="item.type == '2'">
- 资源共享
- </view>
- <view class="date-item">
- {{item.createTime.slice(0,10)}}
- </view>
- </view>
- <u-line color="#CFD2D5" />
- <!-- 发布状态 -->
- <view class="check">
- <view class="state" v-if="item.status == '1'">
- 发布中
- </view>
- <view class="state" v-if="item.status == '0'">
- 待审核
- </view>
- <view class="state" v-if="item.status == '2'">
- 未通过
- </view>
- <view class="handle">
- <view class="amend" @click="toPostMessage(item)">
- 修改
- </view>
- <view class="delete" @click="deleteWork(item.id)">
- 删除
- </view>
- </view>
- </view>
- </view>
- </view>
- <u-divider bg-color="#F0F0F2" margin-top="40" border-color="#CFD2D5"
- v-if="formList[current].recordsTotal==list[current].list.length"
- :isnone="formList[current].recordsTotal==0" nonetext="没有找到相关内容">
- 已经到底了
- </u-divider>
-
- <!-- 底部按钮 -->
- <button class="btn" @click="toPostMessage()">发布信息
- </button>
- </view>
- </template>
- <script>
- import * as API_packages from '@/apis/pagejs/packages.js'
-
- export default {
- data() {
- return {
- formList: [
- {
- pageIndex: 1,
- pageSize: 20,
- recordsTotal: 1,
- status: "1",
- },
- {
- pageIndex: 1,
- pageSize: 20,
- recordsTotal: 1,
- status: "0",
- },
- {
- pageIndex: 1,
- pageSize: 20,
- recordsTotal: 1,
- status: "2",
- },
- ],
- list: [{
- name: '发布中',
- list: []
- }, {
- name: '待审核',
- list: []
- }, {
- name: '未通过',
- list: []
- }],
- current: 0
- }
- },
- onReady() {
- this.getMyShareWorkList();
- },
- onReachBottom() {
- var obj = this.list[this.current];
- var objf = this.formList[this.current];
- if (obj.list.length < objf.recordsTotal) {
- this.myLoadmore();
- }
- },
- methods: {
- init() {
- //this.current = 0
- for(var i in this.list){
- this.formList[i].pageIndex = 1
- this.list[i].list = []
- }
- this.getMyShareWorkList()
- },
- toPostMessage(item) {
- var url = "";
- if(item) {
- var url = "/pages/packages/mine/employmentService/postMessage?id=" +item.id;
- } else {
- var url = "/pages/packages/mine/employmentService/postMessage";
- }
- uni.navigateTo({
- url: url,
- events: {
- refreshData: () => {
- this.init()
- }
- }
- })
- },
- deleteWork(id) {
- uni.showLoading({
- title: "加载中",
- mask: true,
- })
- API_packages.myShareWorkDelete({id: id}).then((res) => {
- this.getMyShareWorkList();
- uni.hideLoading();
- }).catch(error => {
- uni.showToast({
- title: error,
- icon: "none"
- })
- })
- },
- getMyShareWorkList() {
- uni.showLoading({
- title: "加载中",
- mask: true,
- })
- var list = this.list[this.current].list
- var listForm = this.formList[this.current]
-
- API_packages.myShareWork(listForm).then((res) => {
- if (listForm.pageIndex == 1) {
- list = res.data.data;
- } else {
- list = [
- ...list,
- ...res.data.data
- ];
- }
-
- this.list[this.current].list = list
- this.formList[this.current].recordsTotal = res.data.recordsTotal;
- uni.hideLoading();
- }).catch(error => {
- uni.showToast({
- title: error,
- icon: "none"
- })
- })
- },
- myLoadmore() {
- this.formList[this.current].pageIndex += 1;
- this.getMyShareWorkList();
- },
- change(index) {
- this.current = index;
- var list = this.list[this.current].list
- if (list.length == 0) {
- this.getMyShareWorkList();
- }
- }
- }
- }
- </script>
- <style>
- page {
- background: #F0F0F2;
- padding-bottom: 120px;
- }
- </style>
- <style scoped lang="scss">
- // 标签
- .tabs {
- position: fixed;
- left: 0;
- right: 0;
- z-index: 99;
- }
- .content {
- margin-top: 108rpx;
- }
- .info-card {
- margin: 24rpx 32rpx 0;
- padding: 24rpx;
- background-color: #fff;
- border-radius: 24rpx;
- // 卡片信息
- .detail {
- color: rgba(16, 16, 16, 1);
- line-height: 40rpx;
- }
- .tag {
- display: flex;
- justify-content: space-between;
- margin-top: 16rpx;
- margin-bottom: 24rpx;
- .item1 {
- color: rgba(39, 149, 253, 1);
- font-size: 24rpx;
- }
- .item2 {
- color: rgba(0, 185, 98, 1);
- font-size: 24rpx;
- }
- }
- // 发布状态
- .check {
- display: flex;
- justify-content: space-between;
- align-items: center;
- margin-top: 32rpx;
- .state {
- color: rgba(51, 51, 51, 1);
- font-weight: 600;
- }
- .handle {
- display: flex;
- align-items: center;
- .unamend {
- width: 120rpx;
- height: 56rpx;
- line-height: 56rpx;
- text-align: center;
- font-family: Microsoft Yahei;
- border: 1px solid rgba(231, 232, 234, 1);
- border-radius: 50px;
- opacity: 0.4;
- }
- .amend {
- width: 120rpx;
- height: 56rpx;
- line-height: 56rpx;
- text-align: center;
- font-family: Microsoft Yahei;
- border: 1px solid rgba(231, 232, 234, 1);
- border-radius: 50px;
- }
- .delete {
- width: 120rpx;
- height: 56rpx;
- line-height: 56rpx;
- text-align: center;
- font-family: Microsoft Yahei;
- border: 1px solid rgba(231, 232, 234, 1);
- border-radius: 50px;
- margin-left: 24rpx;
- color: #E60012;
- }
- }
- }
- }
- // 底部按钮
- .btn {
- position: fixed;
- bottom: 40rpx;
- left: 0;
- right: 0;
- background-color: #F0F0F2;
- padding: 0 32rpx;
- border-radius: 50px;
- background-color: rgba(34, 149, 255, 1);
- color: rgba(241, 241, 241, 1);
- font-size: 36rpx;
- margin: 0 32rpx;
- box-shadow: 0px 0px 6px 0px rgba(0, 0, 0, 0.03);
- }
- </style>
|