detail.vue 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <template>
  2. <page-loading :loading="loading">
  3. <view class="product-detail">
  4. <u-parse :content="info.detail" />
  5. </view>
  6. </page-loading>
  7. </template>
  8. <script>
  9. import { mapState } from 'vuex'
  10. import PageLoading from '@/components/PageLoading'
  11. export default {
  12. name: 'CaseDetail',
  13. components: { PageLoading },
  14. data() {
  15. return {
  16. id: '',
  17. loading: true,
  18. intoView: '',
  19. info: {},
  20. specs: []
  21. }
  22. },
  23. computed: {
  24. ...mapState({
  25. userInfo: seate => seate.user.info
  26. })
  27. },
  28. methods: {
  29. getDetail() {
  30. this.$api.cases.detail(this.id).then(res => {
  31. wx.setNavigationBarTitle({
  32. title: res.data.name
  33. })
  34. this.loading = false
  35. this.info = res.data
  36. })
  37. },
  38. viewer() {
  39. this.$api.cases.viewer(this.id).then(res => {
  40. })
  41. }
  42. },
  43. onLoad(options) {
  44. this.id = options.id
  45. this.getDetail()
  46. this.viewer()
  47. }
  48. }
  49. </script>
  50. <style>
  51. image,video{
  52. margin-bottom: -10rpx;
  53. }
  54. </style>
  55. <style lang="scss" scoped>
  56. .product-detail {
  57. padding: 0 30rpx 30rpx;
  58. }
  59. </style>