wcomlist.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313
  1. <template>
  2. <view>
  3. <scroll-view scroll-x class="bg-white nav solid-bottom solid-bottom echo-fixed-top">
  4. <view class="flex text-center">
  5. <view class="cu-item flex-sub" :class="status==0?'text-red cur':''" @tap="tabSelect" data-status="0">全部</view>
  6. <view class="cu-item flex-sub" :class="status==1?'text-red cur':''" @tap="tabSelect" data-status="1">待修改</view>
  7. <view class="cu-item flex-sub" :class="status==2?'text-red cur':''" @tap="tabSelect" data-status="2">待审核</view>
  8. <view class="cu-item flex-sub" :class="status==3?'text-red cur':''" @tap="tabSelect" data-status="3">已上架</view>
  9. <view class="cu-item flex-sub" :class="status==4?'text-red cur':''" @tap="tabSelect" data-status="4">已停招</view>
  10. <view class="cu-item flex-sub" :class="status==5?'text-red cur':''" @tap="tabSelect" data-status="5">已下架</view>
  11. </view>
  12. </scroll-view>
  13. <view class="echo-fixed-top-empty"></view>
  14. <block v-for="(item,index) in plist" :key="index">
  15. <view class="cu-card dynamic no-card solid-bottom echo-comjobs-item margin-tb-sm">
  16. <view class="cu-item shadow padding-top-sm padding-bottom">
  17. <view class="padding-lr padding-bottom-xs flex justify-between align-center">
  18. <view class="basis-xl text-bold text-lg text-cut">
  19. {{item.title}}
  20. <text class="text-red text-sm" v-if="item.wtype==1">(按月)</text>
  21. <text class="text-red text-sm" v-if="item.wtype==2">(按时)</text>
  22. <text class="text-red text-sm" v-if="item.wtype==3">(按件)</text>
  23. <text class="text-red text-sm" v-if="item.wtype==4">(按项目)</text>
  24. <text class="text-sm">{{item.recruit_num}}名</text>
  25. </view>
  26. <view class="basis-xs text-cut text-right text-gray text-sm">{{item.city}}</view>
  27. </view>
  28. <view class="padding-lr flex justify-between align-bottom">
  29. <view><text class="text-red text-bold">{{item.zwagall}}</text></view>
  30. <view class="text-red" v-if="item.recruitment_cate == 2">悬赏{{item.retmoney}}</view>
  31. </view>
  32. <view class="padding-lr padding-bottom-sm text-cut">
  33. <view v-for="(titem,tindex) in item.tags" :key="tindex" class="cu-tag light bg-gray sm">{{titem}}</view>
  34. </view>
  35. <view class="grid solids-top text-center col-3" v-if="item.status==1">
  36. <view @tap="goWcomform" :data-comjobsid="item.id" class="padding-top"><text class="cuIcon-write padding-right-xs"></text> 编辑 </view>
  37. <view @tap="statusComjobs" :data-comjobsid="item.id" :data-status="2" class="padding-top"><text class="cuIcon-pulldown padding-right-xs"></text> 提交审核 </view>
  38. <view @tap="synOutjobs" :data-comjobsid="item.id" class="padding-top"><text class="cuIcon-text padding-right-xs"></text> 同步省外 </view>
  39. </view>
  40. <view class="grid solids-top text-center col-2" v-if="item.status==2">
  41. <view @tap="goWcomform" :data-comjobsid="item.id" class="padding-top"><text class="cuIcon-write padding-right-xs"></text> 编辑 </view>
  42. <view @tap="synOutjobs" :data-comjobsid="item.id" class="padding-top"><text class="cuIcon-text padding-right-xs"></text> 同步省外 </view>
  43. </view>
  44. <view class="grid solids-top text-center col-5" v-if="item.status==3">
  45. <view @tap="goWcomform" :data-comjobsid="item.id" class="padding-top"><text class="cuIcon-write padding-right-xs"></text> 编辑 </view>
  46. <view @tap="shareComjobs" :data-comjobsid="item.id" class="padding-top"><text class="cuIcon-share padding-right-xs"></text> 分享 </view>
  47. <view @tap="statusComjobs" :data-comjobsid="item.id" :data-status="5" class="padding-top"><text class="cuIcon-pulldown padding-right-xs"></text> 下架 </view>
  48. <view @tap="updateTime" :data-comjobsid="item.id" class="padding-top"><text class="cuIcon-top padding-right-xs"></text> 置顶 </view>
  49. <view @tap="synOutjobs" :data-comjobsid="item.id" class="padding-top"><text class="cuIcon-text padding-right-xs"></text> 同步省外 </view>
  50. <!-- <view @tap="goComjobsDetail" :data-comjobsid="item.id" class="padding-top"><text class="cuIcon-text padding-right-xs"></text> 详情 </view> -->
  51. </view>
  52. <view class="grid solids-top text-center col-4" v-if="item.status==4">
  53. <view @tap="goWcomform" :data-comjobsid="item.id" class="padding-top"><text class="cuIcon-write padding-right-xs"></text> 编辑 </view>
  54. <view @tap="shareComjobs" :data-comjobsid="item.id" class="padding-top"><text class="cuIcon-share padding-right-xs"></text> 分享 </view>
  55. <view @tap="statusComjobs" :data-comjobsid="item.id" :data-status="5" class="padding-top"><text class="cuIcon-pulldown padding-right-xs"></text> 下架 </view>
  56. <view @tap="synOutjobs" :data-comjobsid="item.id" class="padding-top"><text class="cuIcon-text padding-right-xs"></text> 同步省外 </view>
  57. <!-- <view @tap="goComjobsDetail" :data-comjobsid="item.id" class="padding-top"><text class="cuIcon-text padding-right-xs"></text> 详情 </view> -->
  58. </view>
  59. <view class="grid solids-top text-center col-3" v-if="item.status==5">
  60. <view @tap="goWcomform" :data-comjobsid="item.id" class="padding-top"><text class="cuIcon-write padding-right-xs"></text> 编辑 </view>
  61. <view @tap="statusComjobs" :data-comjobsid="item.id" :data-status="4" class="padding-top"><text class="cuIcon-pullup padding-right-xs"></text> 上架 </view>
  62. <view @tap="synOutjobs" :data-comjobsid="item.id" class="padding-top"><text class="cuIcon-text padding-right-xs"></text> 同步省外 </view>
  63. </view>
  64. </view>
  65. </view>
  66. </block>
  67. <uni-load-more :status="pstatus"></uni-load-more>
  68. <view class="padding"></view>
  69. <button class="cu-btn bg-themeBtn lg shadow echo-gohome" data-pageurl="/pages/worker/wcomform" @tap="goPage"> 发布招聘 </button>
  70. <view class="cu-modal" :class="modal.isshow">
  71. <view class="cu-dialog picmodal">
  72. <view class="bg-img">
  73. <image mode="widthFix" :src="modal.comjobspic"></image>
  74. <view class="cu-bar justify-end text-white picmodalclose">
  75. <view class="action" @tap="hideModal">
  76. <text class="cuIcon-close "></text>
  77. </view>
  78. </view>
  79. </view>
  80. <view class="cu-bar bg-white margin-top-xs">
  81. <view class="action margin-0 flex-sub solid-left" @tap="saveImage">保存到相册</view>
  82. </view>
  83. </view>
  84. </view>
  85. </view>
  86. </template>
  87. <script>
  88. import uniLoadMore from "@/components/uni-load-more/uni-load-more.vue";
  89. var _this;
  90. export default {
  91. components: {
  92. uniLoadMore
  93. },
  94. data() {
  95. return {
  96. isRotate: false,
  97. status: 3,
  98. userinfo: false,
  99. workerinfo: false,
  100. param: {},
  101. pstatus: 'more',
  102. ppage: 1,
  103. psize: 20,
  104. plist: [],
  105. modal:{
  106. isshow: "",
  107. comjobspic: ""
  108. }
  109. }
  110. },
  111. onLoad: function(option) {
  112. _this = this;
  113. _this.status = option.status || 3;
  114. _this.userinfo = _this.checkLogin("/pages/my/my");
  115. _this.workerinfo = uni.getStorageSync('workerinfo') || false;
  116. if (_this.userinfo === false || _this.workerinfo === false) {
  117. uni.reLaunch({
  118. url: "/pages/my/my"
  119. });
  120. return false;
  121. }
  122. _this.getMore();
  123. },
  124. onPullDownRefresh: function() {
  125. _this.pageRefresh();
  126. },
  127. onReachBottom: function() {
  128. if (_this.pstatus !== 'more') {
  129. return;
  130. }
  131. _this.getMore();
  132. },
  133. methods: {
  134. goComjobsDetail: function(e) {
  135. var comjobsid = e.currentTarget.dataset.comjobsid;
  136. uni.navigateTo({
  137. url: '/pages/comjobs/detail?comjobsid='+comjobsid
  138. });
  139. },
  140. goWcomform: function(e) {
  141. var comjobsid = e.currentTarget.dataset.comjobsid;
  142. uni.navigateTo({
  143. url: '/pages/worker/wcomform?comjobsid='+comjobsid
  144. });
  145. },
  146. saveImage: function() {
  147. uni.downloadFile({
  148. url: _this.modal.comjobspic, //仅为示例,并非真实的资源
  149. success: (res) => {
  150. if (res.statusCode === 200) {
  151. uni.saveImageToPhotosAlbum({
  152. filePath: res.tempFilePath,
  153. success: function () {
  154. uni.showModal({
  155. title: '信息提示',
  156. content: "已保存到手机相册,注意查收。",
  157. showCancel: false
  158. });
  159. }
  160. });
  161. }
  162. }
  163. });
  164. },
  165. hideModal: function() {
  166. _this.modal.isshow = "";
  167. },
  168. shareComjobs: function(e) {
  169. var comjobsid = e.currentTarget.dataset.comjobsid;
  170. _this.$req.ajax({
  171. title: "招聘简章生成中...",
  172. path: "comjobs/getcomjobscode",
  173. data: {
  174. comjobsid: comjobsid,
  175. userid: _this.userinfo.id
  176. }
  177. }).then((data) => {
  178. _this.modal.comjobspic = data.comjobspic;
  179. _this.modal.isshow = "show";
  180. }).catch((err) => {
  181. uni.showModal({
  182. title: '温馨提示',
  183. content: err,
  184. showCancel: false
  185. });
  186. });
  187. },
  188. statusComjobs: function(e) {
  189. var comjobsid = e.currentTarget.dataset.comjobsid;
  190. var status = e.currentTarget.dataset.status;
  191. _this.$req.ajax({
  192. path: "wcomjobs/statuscomjobs",
  193. data: {
  194. comjobsid: comjobsid,
  195. userid: _this.userinfo.id,
  196. workerid: _this.workerinfo.id,
  197. status: status
  198. }
  199. }).then((data) => {
  200. _this.pageRefresh();
  201. }).catch((err) => {
  202. uni.showModal({
  203. title: '信息提示',
  204. content: err,
  205. showCancel: false
  206. });
  207. });
  208. },
  209. updateTime: function(e) {
  210. var comjobsid = e.currentTarget.dataset.comjobsid;
  211. uni.showModal({
  212. title: '信息提示',
  213. content: '每次置顶会扣除'+_this.param.topcomjobs+'积分,确定要做置顶操作吗?',
  214. success: function(res) {
  215. if (res.confirm) {
  216. _this.$req.ajax({
  217. path: "wcomjobs/updatecomjobs",
  218. data: {
  219. comjobsid: comjobsid,
  220. userid: _this.userinfo.id,
  221. workerid: _this.workerinfo.id
  222. }
  223. }).then((data) => {
  224. _this.pageRefresh();
  225. }).catch((err) => {
  226. uni.showModal({
  227. title: '信息提示',
  228. content: err,
  229. showCancel: false
  230. });
  231. });
  232. }
  233. }
  234. });
  235. },
  236. pageRefresh: function() {
  237. _this.pstatus = 'more';
  238. _this.ppage = 1;
  239. _this.plist = [];
  240. _this.getMore();
  241. },
  242. getMore: function() {
  243. _this.$req.ajax({
  244. path: "wcomjobs/listcomjobs",
  245. data: {
  246. ppage: _this.ppage,
  247. psize: _this.psize,
  248. status: _this.status,
  249. workerid: _this.workerinfo.id
  250. }
  251. }).then((data) => {
  252. _this.param = data.param;
  253. _this.pstatus = data.pstatus;
  254. _this.plist = _this.plist.concat(data.plist);
  255. _this.ppage += 1;
  256. uni.stopPullDownRefresh();
  257. }).catch((err) => {
  258. uni.showModal({
  259. title: '信息提示',
  260. content: err,
  261. showCancel: false
  262. });
  263. });
  264. },
  265. tabSelect: function(e) {
  266. _this.status = e.currentTarget.dataset.status;
  267. _this.pageRefresh();
  268. },
  269. goPage: function(e) {
  270. var pageurl = e.currentTarget.dataset.pageurl;
  271. uni.navigateTo({
  272. url: pageurl,
  273. fail: function() {
  274. uni.switchTab({
  275. url: pageurl
  276. });
  277. }
  278. });
  279. },
  280. synOutjobs: function(e) {
  281. let id = e.currentTarget.dataset.comjobsid;
  282. uni.navigateTo({
  283. url: '/pages/worker/synoutjobs?id='+id
  284. })
  285. },
  286. },
  287. }
  288. </script>
  289. <style>
  290. .picmodal{ width: 640rpx; background-color: transparent; }
  291. .picmodal image{ width: 100%; }
  292. .picmodal .bg-img{ position: relative; }
  293. .picmodalclose{ position: absolute; top: 0rpx; right: 0rpx; }
  294. </style>