homebak.vue 6.6 KB

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