home.vue 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359
  1. <template>
  2. <view class="page">
  3. <view class="cardList">
  4. <view class="card cardBg-bule" @tap="checkWorker">
  5. <image class="card-avatar" src="../../static/images/index/employer.png"></image>
  6. <view class="card-content">
  7. <view class="content-title">我是雇主</view>
  8. <view class="content-explain">为企业招聘人才</view>
  9. </view>
  10. </view>
  11. <!-- <view class="card cardBg-green">
  12. <image class="card-avatar" src="../../static/images/index/recruiter.png"></image>
  13. <view class="card-content">
  14. <view class="content-title">我是经纪人</view>
  15. <view class="content-explain">推荐人才入职领赏金</view>
  16. </view>
  17. </view> -->
  18. <view class="card cardBg-red" @tap="goUser">
  19. <image class="card-avatar" src="../../static/images/index/jobhunter.png"></image>
  20. <view class="card-content">
  21. <view class="content-title">我是求职者</view>
  22. <view class="content-explain">寻找更好的发展</view>
  23. </view>
  24. </view>
  25. </view>
  26. <!-- <view class="bg-white homepage">
  27. <view>
  28. <view class="" @tap="checkWorker">
  29. <view class="padding"></view>
  30. <image mode="widthFix" style="width: 100%;" :src="zqtop"></image>
  31. <view class="padding text-center text-blue">我要招聘</view>
  32. </view>
  33. <view class="" @tap="goUser">
  34. <image mode="widthFix" style="width: 100%; position: fixed; left: 0; bottom: 160rpx;"
  35. :src="zqbottom"></image>
  36. <view class="padding text-center text-blue"
  37. style="width: 100%; position: fixed; left: 0; bottom: 40rpx;">我要求职</view>
  38. </view>
  39. </view>
  40. </view> -->
  41. <view class="cu-modal" :class="modalName=='workerModal'?'show':''">
  42. <view class="cu-dialog">
  43. <view class="cu-bar bg-white justify-end">
  44. <view class="content">身份切换</view>
  45. <view class="action" @tap="hideModal">
  46. <text class="cuIcon-close text-red"></text>
  47. </view>
  48. </view>
  49. <view class="padding-tb-sm">
  50. <view class="cu-list menu">
  51. <block v-if="workerall!=null">
  52. <view class="cu-item arrow" v-for="(item,index) in workerall" :key="index" @tap="goWorker"
  53. :data-index="index">
  54. <view class="content text-left">
  55. <text class="cuIcon-settings text-grey"></text>
  56. <text>{{item.title}}</text>
  57. </view>
  58. <view class="action">
  59. <text class="text-grey">
  60. <text class="margin-left text-red" v-if="item.status==1">待审核</text>
  61. <text class="margin-left text-red" v-if="item.status==4">升级审核</text>
  62. </text>
  63. </view>
  64. </view>
  65. </block>
  66. <view class="cu-item arrow" @click="goLogin(1)">
  67. <view class="content text-left">
  68. <text class="cuIcon-settings text-grey"></text>
  69. <text>个人雇主注册</text>
  70. </view>
  71. </view>
  72. <view class="cu-item arrow" @click="goLogin(2)">
  73. <view class="content text-left">
  74. <text class="cuIcon-settings text-grey"></text>
  75. <text>企业雇主注册</text>
  76. </view>
  77. </view>
  78. </view>
  79. </view>
  80. </view>
  81. </view>
  82. <view class="cu-modal" :class="modalName=='apptreatyModal'?'show':''">
  83. <view class="cu-dialog">
  84. <view class="cu-bar bg-white justify-end">
  85. <view class="content">服务协议和隐私政策</view>
  86. </view>
  87. <view class="padding-tb-sm">
  88. <scroll-view class="xy-content text-left" scroll-y>
  89. <text>请你务必审慎阅读、充分理解“用户服务协议”和“隐私政策”各条款,包括但不限于:为了向你提供即时招聘讯息、内容分享等服务,我们需要收集你的设备信息、操作日志等个人信息。</text>
  90. <br />
  91. <view>你可阅读
  92. <text class="text-blue" @tap="goPage('/pages/tool/sinpage?field=service')">《用户服务协议》</text>
  93. 和<text class="text-blue" @tap="goPage('/pages/tool/sinpage?field=privacy')">《隐私政策》</text>
  94. 了解详细信息,如你同意,请点击“我同意”开始接受我们等服务。
  95. </view>
  96. </scroll-view>
  97. </view>
  98. <view class="cu-bar bg-white justify-end">
  99. <view class="action">
  100. <button class="cu-btn line-blue text-blue" @tap="outApptreaty">不同意</button>
  101. <button class="cu-btn bg-blue margin-left" @tap="setApptreaty">我同意</button>
  102. </view>
  103. </view>
  104. </view>
  105. </view>
  106. </view>
  107. </template>
  108. <script>
  109. var _this;
  110. export default {
  111. data() {
  112. return {
  113. identityinfo: false,
  114. userinfo: false,
  115. workerinfo: null,
  116. workerall: null,
  117. modalName: null,
  118. apptreaty: "",
  119. zqtop: '',
  120. zqbottom: ''
  121. }
  122. },
  123. onLoad: function(option) {
  124. _this = this;
  125. _this.getImage();
  126. _this.identityinfo = uni.getStorageSync('identityinfo') || false;
  127. _this.userinfo = uni.getStorageSync('userinfo') || false;
  128. _this.workerinfo = uni.getStorageSync('workerinfo') || null;
  129. if (_this.identityinfo == true && _this.workerinfo != null) {
  130. uni.reLaunch({
  131. url: "/pages/worker/worker"
  132. });
  133. return;
  134. }
  135. if (_this.identityinfo == true) {
  136. uni.reLaunch({
  137. url: "/pages/index/index"
  138. });
  139. return;
  140. }
  141. _this.$req.ajax({
  142. path: "index/gethomedata",
  143. data: {
  144. userid: _this.userinfo == false ? 0 : _this.userinfo.id
  145. }
  146. }).then((data) => {
  147. _this.apptreaty = data.apptreaty;
  148. _this.workerall = data.workerall;
  149. // #ifdef APP-PLUS
  150. _this.modalName = uni.getStorageSync('apptreatyModal') || "apptreatyModal";
  151. // #endif
  152. }).catch((err) => {
  153. uni.showModal({
  154. title: '信息提示',
  155. content: err,
  156. showCancel: false
  157. });
  158. });
  159. },
  160. onShareAppMessage: function(res) {
  161. return {
  162. title: "晋江人力",
  163. path: "/pages/index/home"
  164. }
  165. },
  166. methods: {
  167. // 获取图片
  168. getImage: function() {
  169. _this.$req.ajax({
  170. path: "my/getauthimg",
  171. data: {}
  172. }).then((data) => {
  173. _this.zqtop = data.head1;
  174. _this.zqbottom = data.head2;
  175. }).catch((err) => {});
  176. },
  177. setApptreaty: function() {
  178. uni.setStorageSync('apptreatyModal', "hideapptreatyModal");
  179. _this.modalName = null;
  180. },
  181. outApptreaty: function() {
  182. plus.runtime.quit();
  183. },
  184. goPage: function(pageurl) {
  185. uni.navigateTo({
  186. url: pageurl,
  187. fail: function() {
  188. uni.switchTab({
  189. url: pageurl
  190. });
  191. }
  192. });
  193. },
  194. checkWorker: function() {
  195. if (_this.workerall == 'null') {
  196. uni.navigateTo({
  197. url: "/pages/login/worker"
  198. });
  199. return false;
  200. }
  201. _this.modalName = "workerModal";
  202. },
  203. hideModal: function(e) {
  204. _this.modalName = null;
  205. },
  206. goWorker: function(e) {
  207. var index = e.currentTarget.dataset.index;
  208. if (_this.workerall[index].status == 1) {
  209. // uni.showModal({
  210. // title: '信息提示',
  211. // content: "信息审核中,请耐心等待。",
  212. // showCancel: false
  213. // });
  214. // return;
  215. }
  216. uni.setStorageSync('identityinfo', true);
  217. uni.setStorageSync('workerinfo', _this.workerall[index]);
  218. uni.reLaunch({
  219. url: "/pages/worker/worker"
  220. });
  221. },
  222. goLogin: function(wtype) {
  223. uni.setStorageSync('identityinfo', true);
  224. uni.navigateTo({
  225. url: "/pages/login/worker?wtype=" + wtype
  226. });
  227. },
  228. goUser: function() {
  229. _this.userinfo = _this.checkLogin("/pages/index/index");
  230. uni.setStorageSync('identityinfo', true);
  231. uni.setStorageSync('workerinfo', null);
  232. uni.reLaunch({
  233. url: "/pages/index/index"
  234. });
  235. }
  236. }
  237. }
  238. </script>
  239. <style lang="scss">
  240. page {
  241. background-color: #fffff6;
  242. text-align: center;
  243. }
  244. bg-color {
  245. background-color: #fffff6;
  246. }
  247. .homepage {
  248. height: calc(100vh);
  249. background-repeat: no-repeat;
  250. background-size: 100%;
  251. background-position: bottom center;
  252. }
  253. .homepage image {
  254. width: 100%;
  255. }
  256. .homepage image.homebg {
  257. width: 750rpx;
  258. position: fixed;
  259. bottom: 0rpx;
  260. }
  261. .homebox {}
  262. .homebox image {
  263. width: 280rpx;
  264. }
  265. .xy-content {
  266. padding: 10rpx 30rpx;
  267. background: #F6F6F6;
  268. line-height: 50rpx;
  269. font-size: 28rpx;
  270. text-align: justify;
  271. box-sizing: border-box;
  272. }
  273. .padding {
  274. padding: 40rpx;
  275. }
  276. .padding15 {
  277. padding: 15rpx;
  278. }
  279. .padding10 {
  280. padding: 10rpx;
  281. }
  282. .cardList {
  283. padding: 30rpx 18rpx;
  284. .cardBg-bule {
  285. box-shadow: 0rpx 0rpx 10rpx 2rpx rgba(73, 128, 209, 0.3);
  286. }
  287. .cardBg-green {
  288. box-shadow: 0rpx 0rpx 10rpx 2rpx rgba(19, 192, 180, 0.3);
  289. }
  290. .cardBg-red {
  291. box-shadow: 0rpx 0rpx 10rpx 2rpx rgba(230, 66, 88, 0.3);
  292. }
  293. .card {
  294. margin-bottom: 16rpx;
  295. padding: 0 46rpx;
  296. width: 100%;
  297. height: 224rpx;
  298. background: #FFFFFF;
  299. border-radius: 14rpx;
  300. display: flex;
  301. align-items: center;
  302. .card-avatar {
  303. width: 172rpx;
  304. height: 172rpx;
  305. }
  306. .card-content {
  307. margin-left: 54rpx;
  308. .content-title {
  309. margin-bottom: 12rpx;
  310. font-size: 30rpx;
  311. font-weight: 600;
  312. color: #747474;
  313. }
  314. .content-explain {
  315. font-size: 24rpx;
  316. font-weight: normal;
  317. color: #747474;
  318. }
  319. }
  320. }
  321. }
  322. </style>