goods-doc-detail.vue 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. <!-- 自定义页面 -->
  2. <template>
  3. <view class="goods-doc-detail" :style="{ paddingBottom: tipStatus ? '80rpx' : '0' }">
  4. <view class="cm-header">
  5. <image
  6. class="cm-cover"
  7. :src="productImage ? productImage : 'https://static.caimei365.com/app/img/icon2/placeholder.png'"
  8. ></image>
  9. <view class="cm-title"> {{ productName }} </view>
  10. <view class="cm-params"><text>供应商:</text>{{ shopName || '暂无' }}</view>
  11. <view class="cm-params"><text>商品属性:</text>{{ productType === 1 ? '商品' : '仪器' }}</view>
  12. </view>
  13. <cm-product-doc
  14. v-if="archiveId !== 0"
  15. :archiveId="archiveId"
  16. :bottom="isIphoneX ? '60rpx' : '10rpx'"
  17. @tipStatus="getTipStatus"
  18. ></cm-product-doc>
  19. </view>
  20. </template>
  21. <script>
  22. import { mapState } from 'vuex'
  23. import cmProductDoc from './components/cm-product-doc.vue'
  24. export default {
  25. components: {
  26. cmProductDoc
  27. },
  28. computed: {
  29. ...mapState(['isIphoneX'])
  30. },
  31. onLoad(e) {
  32. this.userId = uni.getStorageSync('userInfo').userId || -1
  33. this.archiveId = e.id || 0
  34. this.getDetail()
  35. },
  36. data() {
  37. return {
  38. userId: -1,
  39. archiveId: 0,
  40. archiveProductInfo: {},
  41. productImage: '',
  42. productName: '',
  43. productType: 0,
  44. shopName: '',
  45. tipStatus: ''
  46. }
  47. },
  48. methods: {
  49. // 获取商品资料详情
  50. getDetail() {
  51. console.log(this.userId)
  52. this.BeautyArchive.GetProdcutArchiveDetails({
  53. userId: this.userId,
  54. archiveId: this.archiveId
  55. }).then(res => {
  56. console.log(res)
  57. if (res.code) return
  58. this.productImage = res.data.productImage
  59. this.productName = res.data.productName
  60. this.productType = res.data.productType
  61. this.shopName = res.data.shopName
  62. })
  63. },
  64. // 获取权限tip
  65. getTipStatus(status) {
  66. this.tipStatus = status
  67. }
  68. }
  69. }
  70. </script>
  71. <style lang="scss" scoped>
  72. .goods-doc-detail {
  73. background: #f7f7f7;
  74. }
  75. .cm-header {
  76. background: #fff;
  77. margin-bottom: 16rpx;
  78. overflow: hidden;
  79. .cm-cover {
  80. width: 750rpx;
  81. height: 750rpx;
  82. }
  83. .cm-title,
  84. .cm-params {
  85. padding: 0 24rpx;
  86. }
  87. .cm-title {
  88. margin: 32rpx 0;
  89. font-size: 34rpx;
  90. line-height: 1.6;
  91. color: #333333;
  92. }
  93. .cm-params {
  94. margin: 16rpx 0;
  95. font-size: 24rpx;
  96. line-height: 1.6;
  97. color: #333333;
  98. text {
  99. font-size: #999999;
  100. }
  101. }
  102. }
  103. </style>