123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276 |
- <template>
- <view>
- <scroll-view scroll-x class="bg-white nav solid-bottom solid-bottom echo-fixed-top">
- <view class="flex text-center">
- <view class="cu-item flex-sub" :class="status==0?'text-red cur':''" @tap="tabSelect" data-status="0">全部</view>
- <view class="cu-item flex-sub" :class="status==1?'text-red cur':''" @tap="tabSelect" data-status="1">待修改</view>
- <view class="cu-item flex-sub" :class="status==2?'text-red cur':''" @tap="tabSelect" data-status="2">待审核</view>
- <view class="cu-item flex-sub" :class="status==3?'text-red cur':''" @tap="tabSelect" data-status="3">已上架</view>
- <view class="cu-item flex-sub" :class="status==4?'text-red cur':''" @tap="tabSelect" data-status="4">已停招</view>
- <view class="cu-item flex-sub" :class="status==5?'text-red cur':''" @tap="tabSelect" data-status="5">已下架</view>
- </view>
- </scroll-view>
- <view class="echo-fixed-top-empty"></view>
-
-
- <block v-for="(item,index) in plist" :key="index">
- <view class="cu-card dynamic no-card solid-bottom echo-demand-item margin-tb-sm">
- <view class="cu-item shadow padding-top-sm padding-bottom">
- <view class="padding-lr padding-bottom-xs flex justify-between align-center">
- <view class="basis-xl text-bold text-lg text-cut">{{item.title}}</view>
- <view class="basis-xs text-cut text-right text-gray text-sm">{{item.city}}</view>
- </view>
- <view class="padding-lr flex justify-between align-bottom">
- <view v-if="item.wtype==1"><text class="text-red text-bold">{{item.zwagall}}</text></view>
- <view v-if="item.wtype==5"><text class="text-red text-bold">其他</text></view>
- <view v-else><text class="text-red text-bold">{{item.bwagall}}</text></view>
- <view class="text-red">{{item.ftype_text}}:{{item.fwagall}}</view>
- </view>
- <view class="padding-lr padding-bottom-sm text-cut">
- <view v-for="(titem,tindex) in item.tags" :key="tindex" class="cu-tag light bg-gray sm">{{titem}}</view>
- </view>
-
- <view class="grid solids-top text-center col-2" v-if="item.status==1">
- <view @tap="goDemandform" :data-demandid="item.id" class="padding-top"><text class="cuIcon-write padding-right-xs"></text> 编辑 </view>
- <view @tap="statusDemand" :data-demandid="item.id" :data-status="2" class="padding-top"><text class="cuIcon-pulldown padding-right-xs"></text> 提交审核 </view>
- </view>
- <view class="grid solids-top text-center col-1" v-if="item.status==2">
- <view @tap="goDemandform" :data-demandid="item.id" class="padding-top"><text class="cuIcon-write padding-right-xs"></text> 编辑 </view>
- </view>
- <view class="grid solids-top text-center col-5" v-if="item.status==3">
- <view @tap="goDemandform" :data-demandid="item.id" class="padding-top"><text class="cuIcon-write padding-right-xs"></text> 编辑 </view>
- <view @tap="statusDemand" :data-demandid="item.id" :data-status="5" class="padding-top"><text class="cuIcon-pulldown padding-right-xs"></text> 下架 </view>
- <view @tap="updateTime" :data-demandid="item.id" class="padding-top"><text class="cuIcon-top padding-right-xs"></text> 置顶 </view>
- <view @tap="goWdemandLog" :data-demandid="item.id" class="padding-top"><text class="cuIcon-list padding-right-xs"></text> 记录 </view>
- <view @tap="goDemandDetail" :data-demandid="item.id" class="padding-top"><text class="cuIcon-text padding-right-xs"></text> 详情 </view>
- </view>
- <view class="grid solids-top text-center col-4" v-if="item.status==4">
- <view @tap="goDemandform" :data-demandid="item.id" class="padding-top"><text class="cuIcon-write padding-right-xs"></text> 编辑 </view>
- <view @tap="statusDemand" :data-demandid="item.id" :data-status="5" class="padding-top"><text class="cuIcon-pulldown padding-right-xs"></text> 下架 </view>
- <view @tap="goWdemandLog" :data-demandid="item.id" class="padding-top"><text class="cuIcon-list padding-right-xs"></text> 记录 </view>
- <view @tap="goDemandDetail" :data-demandid="item.id" class="padding-top"><text class="cuIcon-text padding-right-xs"></text> 详情 </view>
- </view>
- <view class="grid solids-top text-center col-3" v-if="item.status==5">
- <view @tap="goDemandform" :data-demandid="item.id" class="padding-top"><text class="cuIcon-write padding-right-xs"></text> 编辑 </view>
- <view @tap="statusDemand" :data-demandid="item.id" :data-status="4" class="padding-top"><text class="cuIcon-pullup padding-right-xs"></text> 上架 </view>
- <view @tap="goWdemandLog" :data-demandid="item.id" class="padding-top"><text class="cuIcon-list padding-right-xs"></text> 记录 </view>
- </view>
-
- </view>
- </view>
- </block>
- <uni-load-more :status="pstatus"></uni-load-more>
- <view class="padding"></view>
-
- </view>
- </template>
- <script>
- import uniLoadMore from "@/components/uni-load-more/uni-load-more.vue";
- var _this;
- export default {
- components: {
- uniLoadMore
- },
- data() {
- return {
- isRotate: false,
- status: 3,
- userinfo: false,
- workerinfo: false,
-
- param: {},
- pstatus: 'more',
- ppage: 1,
- psize: 20,
- plist: [],
-
- modal:{
- isshow: "",
- demandpic: ""
- }
- }
- },
- onLoad: function(option) {
- _this = this;
- _this.status = option.status || 3;
- _this.userinfo = _this.checkLogin("/pages/my/my");
- _this.workerinfo = uni.getStorageSync('workerinfo') || false;
- if (_this.userinfo === false || _this.workerinfo === false) {
- uni.reLaunch({
- url: "/pages/my/my"
- });
- return false;
- }
- _this.getMore();
- },
- onPullDownRefresh: function() {
- _this.pageRefresh();
- },
- onReachBottom: function() {
- if (_this.pstatus !== 'more') {
- return;
- }
- _this.getMore();
- },
- methods: {
-
- goDemandDetail: function(e) {
- var demandid = e.currentTarget.dataset.demandid;
- uni.navigateTo({
- url: '/pages/demand/detail?demandid='+demandid
- });
- },
-
- goWdemandLog: function(e) {
- var demandid = e.currentTarget.dataset.demandid;
- uni.navigateTo({
- url: '/pages/demand/wdemandlog?demandid='+demandid
- });
- },
-
- goDemandform: function(e) {
- var demandid = e.currentTarget.dataset.demandid;
- uni.navigateTo({
- url: '/pages/demand/demandform?demandid='+demandid
- });
- },
-
- saveImage: function() {
- uni.downloadFile({
- url: _this.modal.demandpic, //仅为示例,并非真实的资源
- success: (res) => {
- if (res.statusCode === 200) {
- uni.saveImageToPhotosAlbum({
- filePath: res.tempFilePath,
- success: function () {
- uni.showModal({
- title: '信息提示',
- content: "已保存到手机相册,注意查收。",
- showCancel: false
- });
- }
- });
- }
- }
- });
- },
- hideModal: function() {
- _this.modal.isshow = "";
- },
- shareDemand: function(e) {
- var demandid = e.currentTarget.dataset.demandid;
- _this.$req.ajax({
- title: "招聘简章生成中...",
- path: "demand/getdemandcode",
- data: {
- demandid: demandid,
- userid: _this.userinfo.id
- }
- }).then((data) => {
- _this.modal.demandpic = data.demandpic;
- _this.modal.isshow = "show";
- }).catch((err) => {
- uni.showModal({
- title: '温馨提示',
- content: err,
- showCancel: false
- });
- });
- },
-
- statusDemand: function(e) {
- var demandid = e.currentTarget.dataset.demandid;
- var status = e.currentTarget.dataset.status;
- _this.$req.ajax({
- path: "wdemand/statusdemand",
- data: {
- demandid: demandid,
- userid: _this.userinfo.id,
- workerid: _this.workerinfo.id,
- status: status
- }
- }).then((data) => {
- _this.pageRefresh();
- }).catch((err) => {
- uni.showModal({
- title: '信息提示',
- content: err,
- showCancel: false
- });
- });
- },
-
- updateTime: function(e) {
- var demandid = e.currentTarget.dataset.demandid;
- uni.showModal({
- title: '信息提示',
- content: '每次置顶会扣除'+_this.param.topdemand+'积分,确定要做置顶操作吗?',
- success: function(res) {
- if (res.confirm) {
- _this.$req.ajax({
- path: "wdemand/updatedemand",
- data: {
- demandid: demandid,
- userid: _this.userinfo.id,
- workerid: _this.workerinfo.id
- }
- }).then((data) => {
- _this.pageRefresh();
- }).catch((err) => {
- uni.showModal({
- title: '信息提示',
- content: err,
- showCancel: false
- });
- });
- }
- }
- });
- },
-
- pageRefresh: function() {
- _this.pstatus = 'more';
- _this.ppage = 1;
- _this.plist = [];
- _this.getMore();
- },
- getMore: function() {
- _this.$req.ajax({
- path: "wdemand/listdemand",
- data: {
- ppage: _this.ppage,
- psize: _this.psize,
- status: _this.status,
- workerid: _this.workerinfo.id
- }
- }).then((data) => {
- _this.param = data.param;
- _this.pstatus = data.pstatus;
- _this.plist = _this.plist.concat(data.plist);
- _this.ppage += 1;
- uni.stopPullDownRefresh();
- }).catch((err) => {
- uni.showModal({
- title: '信息提示',
- content: err,
- showCancel: false
- });
- });
- },
-
- tabSelect: function(e) {
- _this.status = e.currentTarget.dataset.status;
- _this.pageRefresh();
- },
- },
- }
- </script>
- <style>
- .picmodal{ width: 640rpx; background-color: transparent; }
- .picmodal image{ width: 100%; }
-
- .picmodal .bg-img{ position: relative; }
- .picmodalclose{ position: absolute; top: 0rpx; right: 0rpx; }
- </style>
|