details-no-share.vue 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <template>
  2. <app-layout>
  3. <view>
  4. <app-card-detail :list="list"></app-card-detail>
  5. </view>
  6. </app-layout>
  7. </template>
  8. <script>
  9. import appCardDetail from '../components/app-card-detail.vue';
  10. export default {
  11. components: {appCardDetail},
  12. data() {
  13. return {
  14. list: null,
  15. }
  16. },
  17. methods: {
  18. getList(id) {
  19. let that = this;
  20. that.$showLoading({
  21. text: '加载中...'
  22. });
  23. that.$request({
  24. url: that.$api.card.detailsp,
  25. data: {
  26. cardId: id,
  27. },
  28. }).then(response=>{
  29. that.$hideLoading();
  30. if(response.code === 0) {
  31. that.list = response.data.card;
  32. } else {
  33. uni.showToast({
  34. title: response.msg,
  35. icon: 'none',
  36. duration: 1000,
  37. });
  38. }
  39. }).catch(() => {
  40. that.$hideLoading();
  41. });
  42. },
  43. },
  44. onLoad(options) {
  45. this.getList(options.id);
  46. }
  47. }
  48. </script>