index.vue 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <template>
  2. <view>
  3. <template1 v-if="level == 3" :userId="userId" :touristId="touristId" ref="classOne"></template1>
  4. <template2 v-if="level == 2" :userId="userId" :touristId="touristId" ref="classTwo"></template2>
  5. </view>
  6. </template>
  7. <script>
  8. import { mapGetters } from 'vuex';
  9. import template1 from './template/template1.vue';
  10. import template2 from './template/template2.vue';
  11. export default {
  12. name:'behalfGoodsList',
  13. data() {
  14. return {
  15. userId:0,
  16. touristId:0
  17. }
  18. },
  19. components: {
  20. template1,
  21. template2
  22. },
  23. computed:{
  24. ...mapGetters(['isLogin', 'uid', 'diyCategory']),
  25. level(){
  26. return this.diyCategory.level
  27. },
  28. },
  29. onLoad(e) {
  30. this.userId = e.uid || 0;
  31. if(e.uid == 0 && !this.$Cache.get('touristId')){
  32. let tid = Math.floor(Math.random() * 90000) + 10000;
  33. this.$Cache.set('touristId', tid)
  34. this.touristId = tid;
  35. }else if(e.uid == 0 && this.$Cache.get('touristId')){
  36. this.touristId = this.$Cache.get('touristId');
  37. }else if(e.uid != 0){
  38. this.touristId = 0;
  39. }
  40. },
  41. methods: {
  42. }
  43. }
  44. </script>
  45. <style lang="scss" scoped>
  46. /deep/.font-num{
  47. color: #2A7EFB !important;
  48. }
  49. /deep/.bg-color{
  50. background: #2A7EFB !important;
  51. }
  52. </style>