home.vue 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248
  1. <template>
  2. <view class="page">
  3. <view class="bg-white homepage">
  4. <view>
  5. <view class="" @tap="checkWorker">
  6. <view class="padding"></view>
  7. <image mode="widthFix" style="width: 100%;" :src="zqtop"></image>
  8. <view class="padding text-center text-blue">我要招聘</view>
  9. </view>
  10. <view class="" @tap="goUser">
  11. <image mode="widthFix" style="width: 100%; position: fixed; left: 0; bottom: 160rpx;" :src="zqbottom"></image>
  12. <view class="padding text-center text-blue" style="width: 100%; position: fixed; left: 0; bottom: 40rpx;">我要求职</view>
  13. </view>
  14. </view>
  15. </view>
  16. <view class="cu-modal" :class="modalName=='workerModal'?'show':''">
  17. <view class="cu-dialog">
  18. <view class="cu-bar bg-white justify-end">
  19. <view class="content">身份切换</view>
  20. <view class="action" @tap="hideModal">
  21. <text class="cuIcon-close text-red"></text>
  22. </view>
  23. </view>
  24. <view class="padding-tb-sm">
  25. <view class="cu-list menu">
  26. <block v-if="workerall!=null">
  27. <view class="cu-item arrow" v-for="(item,index) in workerall" :key="index" @tap="goWorker" :data-index="index">
  28. <view class="content text-left">
  29. <text class="cuIcon-settings text-grey"></text>
  30. <text>{{item.title}}</text>
  31. </view>
  32. <view class="action">
  33. <text class="text-grey">
  34. <text class="margin-left text-red" v-if="item.status==1">待审核</text>
  35. <text class="margin-left text-red" v-if="item.status==4">升级审核</text>
  36. </text>
  37. </view>
  38. </view>
  39. </block>
  40. <view class="cu-item arrow" @click="goLogin(1)">
  41. <view class="content text-left">
  42. <text class="cuIcon-settings text-grey"></text>
  43. <text>个人雇主注册</text>
  44. </view>
  45. </view>
  46. <view class="cu-item arrow" @click="goLogin(2)">
  47. <view class="content text-left">
  48. <text class="cuIcon-settings text-grey"></text>
  49. <text>企业雇主注册</text>
  50. </view>
  51. </view>
  52. </view>
  53. </view>
  54. </view>
  55. </view>
  56. <view class="cu-modal" :class="modalName=='apptreatyModal'?'show':''">
  57. <view class="cu-dialog">
  58. <view class="cu-bar bg-white justify-end">
  59. <view class="content">服务协议和隐私政策</view>
  60. </view>
  61. <view class="padding-tb-sm">
  62. <scroll-view class="xy-content text-left" scroll-y>
  63. <text>请你务必审慎阅读、充分理解“用户服务协议”和“隐私政策”各条款,包括但不限于:为了向你提供即时招聘讯息、内容分享等服务,我们需要收集你的设备信息、操作日志等个人信息。</text> <br/>
  64. <view>你可阅读
  65. <text class="text-blue" @tap="goPage('/pages/tool/sinpage?field=service')">《用户服务协议》</text>
  66. 和<text class="text-blue" @tap="goPage('/pages/tool/sinpage?field=privacy')">《隐私政策》</text>
  67. 了解详细信息,如你同意,请点击“我同意”开始接受我们等服务。
  68. </view>
  69. </scroll-view>
  70. </view>
  71. <view class="cu-bar bg-white justify-end">
  72. <view class="action">
  73. <button class="cu-btn line-blue text-blue" @tap="outApptreaty">不同意</button>
  74. <button class="cu-btn bg-blue margin-left" @tap="setApptreaty">我同意</button>
  75. </view>
  76. </view>
  77. </view>
  78. </view>
  79. </view>
  80. </template>
  81. <script>
  82. var _this;
  83. export default {
  84. data() {
  85. return {
  86. identityinfo: false,
  87. userinfo: false,
  88. workerinfo: null,
  89. workerall: null,
  90. modalName: null,
  91. apptreaty: "",
  92. zqtop: '',
  93. zqbottom: ''
  94. }
  95. },
  96. onLoad: function(option) {
  97. _this = this;
  98. _this.getImage();
  99. _this.identityinfo = uni.getStorageSync('identityinfo') || false;
  100. _this.userinfo = uni.getStorageSync('userinfo') || false;
  101. _this.workerinfo = uni.getStorageSync('workerinfo') || null;
  102. if (_this.identityinfo==true && _this.workerinfo!=null){
  103. uni.reLaunch({
  104. url: "/pages/worker/worker"
  105. });
  106. return;
  107. }
  108. if (_this.identityinfo==true){
  109. uni.reLaunch({
  110. url: "/pages/index/index"
  111. });
  112. return;
  113. }
  114. _this.$req.ajax({
  115. path: "index/gethomedata",
  116. data: {
  117. userid: _this.userinfo==false ? 0 : _this.userinfo.id
  118. }
  119. }).then((data) => {
  120. _this.apptreaty = data.apptreaty;
  121. _this.workerall = data.workerall;
  122. // #ifdef APP-PLUS
  123. _this.modalName = uni.getStorageSync('apptreatyModal') || "apptreatyModal";
  124. // #endif
  125. }).catch((err) => {
  126. uni.showModal({
  127. title: '信息提示',
  128. content: err,
  129. showCancel: false
  130. });
  131. });
  132. },
  133. onShareAppMessage: function(res) {
  134. return {
  135. title: "晋江人力",
  136. path: "/pages/index/home"
  137. }
  138. },
  139. methods: {
  140. // 获取图片
  141. getImage: function() {
  142. _this.$req.ajax({
  143. path: "my/getauthimg",
  144. data: {}
  145. }).then((data) => {
  146. _this.zqtop = data.head1;
  147. _this.zqbottom = data.head2;
  148. }).catch((err) => {});
  149. },
  150. setApptreaty: function() {
  151. uni.setStorageSync('apptreatyModal', "hideapptreatyModal");
  152. _this.modalName = null;
  153. },
  154. outApptreaty: function() {
  155. plus.runtime.quit();
  156. },
  157. goPage: function(pageurl) {
  158. uni.navigateTo({
  159. url: pageurl,
  160. fail: function() {
  161. uni.switchTab({
  162. url: pageurl
  163. });
  164. }
  165. });
  166. },
  167. checkWorker: function() {
  168. if (_this.workerall=='null'){
  169. uni.navigateTo({
  170. url: "/pages/login/worker"
  171. });
  172. return false;
  173. }
  174. _this.modalName = "workerModal";
  175. },
  176. hideModal: function(e) {
  177. _this.modalName = null;
  178. },
  179. goWorker: function(e) {
  180. var index = e.currentTarget.dataset.index;
  181. if (_this.workerall[index].status==1){
  182. // uni.showModal({
  183. // title: '信息提示',
  184. // content: "信息审核中,请耐心等待。",
  185. // showCancel: false
  186. // });
  187. // return;
  188. }
  189. uni.setStorageSync('identityinfo', true);
  190. uni.setStorageSync('workerinfo', _this.workerall[index]);
  191. uni.reLaunch({
  192. url: "/pages/worker/worker"
  193. });
  194. },
  195. goLogin: function(wtype) {
  196. uni.setStorageSync('identityinfo', true);
  197. uni.navigateTo({
  198. url: "/pages/login/worker?wtype="+wtype
  199. });
  200. },
  201. goUser: function() {
  202. _this.userinfo = _this.checkLogin("/pages/index/index");
  203. uni.setStorageSync('identityinfo', true);
  204. uni.setStorageSync('workerinfo', null);
  205. uni.reLaunch({
  206. url: "/pages/index/index"
  207. });
  208. }
  209. }
  210. }
  211. </script>
  212. <style>
  213. page{ background-color:#fffff6; text-align: center;}
  214. bg-color{ background-color:#fffff6;}
  215. .homepage{ height: calc(100vh); background-repeat: no-repeat; background-size: 100%; background-position: bottom center; }
  216. .homepage image{ width: 100%; }
  217. .homepage image.homebg{ width: 750rpx; position: fixed; bottom: 0rpx; }
  218. .homebox{ }
  219. .homebox image{ width: 280rpx; }
  220. .xy-content{padding:10rpx 30rpx; background:#F6F6F6; line-height:50rpx; font-size:28rpx; text-align: justify; box-sizing:border-box;}
  221. .padding{ padding: 40rpx;}
  222. .padding15 {
  223. padding: 15rpx;
  224. }
  225. .padding10 {
  226. padding: 10rpx;
  227. }
  228. </style>