用工小程序前端代码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

70 lines
1.5 KiB

6 months ago
3 months ago
6 months ago
3 months ago
6 months ago
3 months ago
6 months ago
6 months ago
3 months ago
3 months ago
6 months ago
  1. <template>
  2. <view class="u-page se-w-vw-100">
  3. <view v-if="!isLogin" class="se-flex se-flex-h-e se-p-20">
  4. <u-button style="background-color: #FF7A31;color: #fff;" @click="goLogin">登录</u-button>
  5. </view>
  6. <template v-else>
  7. <u-subsection bg-color="#ff7a31" button-color="#f0b744" active-color="#ff7a31" inactive-color="#ffffff" :list="list" :current="current" @change="sectionChange"></u-subsection>
  8. <!-- 招聘订单 -->
  9. <enterpriseBox ref="enterpriseBoxRef" v-if="current==0" />
  10. <!--求职订单 -->
  11. <masterBox ref="masterBoxRef" v-if="current==1" />
  12. </template>
  13. </view>
  14. </template>
  15. <script>
  16. import masterBox from "./component/master.vue"
  17. import enterpriseBox from "./component/enterprise.vue"
  18. export default{
  19. components:{
  20. enterpriseBox,
  21. masterBox
  22. },
  23. data(){
  24. return{
  25. list: [
  26. {
  27. name: '招聘订单'
  28. },
  29. {
  30. name: '求职订单'
  31. }
  32. ],
  33. current: 0,
  34. isLogin: !!uni.getStorageSync('token')
  35. }
  36. },
  37. onShow() {
  38. this.isLogin = !!uni.getStorageSync('token')
  39. },
  40. onReachBottom() {
  41. if(this.current==0){
  42. this.$refs.enterpriseBoxRef.onReach();
  43. }else if(this.current==1){
  44. this.$refs.masterBoxRef.onReach();
  45. }
  46. },
  47. onPullDownRefresh() {
  48. if(this.current==0){
  49. this.$refs.enterpriseBoxRef.onRefresh();
  50. }else if(this.current==1){
  51. this.$refs.masterBoxRef.onRefresh();
  52. }
  53. },
  54. methods:{
  55. sectionChange(index){
  56. this.current=index
  57. },
  58. goLogin(){
  59. uni.navigateTo({ url: '/pages/auth/index' })
  60. }
  61. }
  62. }
  63. </script>
  64. <style>
  65. </style>