product.vue 900 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <template>
  2. <view>
  3. <product ref="product" :index="index" :item="fetch.product" :control="control" :bottom="bottom" v-if="fetch.product.goods_id"></product>
  4. </view>
  5. </template>
  6. <script>
  7. import product from "@/pages/dream/view/product.vue";
  8. export default{
  9. data() {
  10. return {
  11. id : '',
  12. table : '',
  13. code : '',
  14. index : -1,
  15. bottom : {},
  16. control : {},
  17. fetch : {
  18. product: {},
  19. }
  20. }
  21. },
  22. onLoad(option) {
  23. this.id = option.id;
  24. this.table = option.table;
  25. this.code = option.code;
  26. this.getData();
  27. },
  28. // 重新加载
  29. onPullDownRefresh: function() {
  30. this.getData();
  31. },
  32. onReachBottom : function() {
  33. this.$refs.product.getData(2);
  34. },
  35. methods:{
  36. getData: function(id, table) {
  37. this.Dever.get(this, 'app/collection/?l=api.getProductOne', {code:this.code, product_id:this.id, table:this.table});
  38. },
  39. },
  40. components:{
  41. product
  42. }
  43. }
  44. </script>
  45. <style>
  46. </style>