用工小程序前端代码
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.

75 lines
1.7 KiB

8 months ago
5 months ago
8 months ago
5 months ago
8 months ago
5 months ago
8 months ago
8 months ago
5 months ago
5 months ago
8 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. if(this.current==0){
  40. this.$refs.enterpriseBoxRef.onRefresh();
  41. }else if(this.current==1){
  42. this.$refs.masterBoxRef.onRefresh();
  43. }
  44. },
  45. onReachBottom() {
  46. if(this.current==0){
  47. this.$refs.enterpriseBoxRef.onReach();
  48. }else if(this.current==1){
  49. this.$refs.masterBoxRef.onReach();
  50. }
  51. },
  52. onPullDownRefresh() {
  53. if(this.current==0){
  54. this.$refs.enterpriseBoxRef.onRefresh();
  55. }else if(this.current==1){
  56. this.$refs.masterBoxRef.onRefresh();
  57. }
  58. },
  59. methods:{
  60. sectionChange(index){
  61. this.current=index
  62. },
  63. goLogin(){
  64. uni.navigateTo({ url: '/pages/auth/index' })
  65. }
  66. }
  67. }
  68. </script>
  69. <style>
  70. </style>