mixin.js 1013 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. import { directive, Swiper, SwiperSlide } from 'vue-awesome-swiper'
  2. import 'swiper/css/swiper.css'
  3. import api from '../../config/api'
  4. import {funMixin} from '../../config/mixin'
  5. export const commonMixin = {
  6. name: 'productList',
  7. mixins: [funMixin],
  8. props: {
  9. terminal: {
  10. type: Number,
  11. default: 4
  12. },
  13. typeId: {
  14. type: Number,
  15. default: 1
  16. },
  17. shopId: {
  18. type: Number,
  19. default: 0
  20. },
  21. componentContent: {
  22. type: Object
  23. }
  24. },
  25. components: {
  26. Swiper,
  27. SwiperSlide
  28. },
  29. directives: {
  30. swiper: directive
  31. },
  32. data () {
  33. return {
  34. productData: []
  35. }
  36. },
  37. mounted() {
  38. this.getData()
  39. },
  40. methods: {
  41. getData() {
  42. this.beforeGetData()
  43. const _ = this
  44. _.sendReq({
  45. url: `${api.getMemberProducts}?page=1&pageSize=20`,
  46. method: 'GET'
  47. }, (proRes) => {
  48. _.afterGetData()
  49. _.productData = proRes.data.list
  50. },(err)=>{
  51. _.afterGetData()
  52. })
  53. }
  54. }
  55. }