goods-detail.vue 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. <template>
  2. <uni-popup ref="more-detail" type="bottom" :mask-click="false" height="30px">
  3. <scroll-view class="scrolllist" scroll-y="true">
  4. <view class="more-detail">
  5. <view class="more-detail-close" @click="$refs['more-detail'].close()"><image src="https://www.chaomangdao.com/image/home/guanbi@2x.png" mode=""></image></view>
  6. <view class="more-detail-head">商品详情</view>
  7. <view class="content">
  8. <view>{{ goods.goods_name }}</view>
  9. <view class="props">
  10. <view>
  11. <view class="label">参考价:</view>
  12. <view class="value">¥{{ goods.price }}</view>
  13. </view>
  14. <view>
  15. <view class="label">参考概率:</view>
  16. <view class="value">{{ rate.value }}</view>
  17. </view>
  18. </view>
  19. </view>
  20. <view class="goods.xiangqing">
  21. <!-- 产品多图 -->
  22. <image v-for="xq in goods.xiangqing" :src="xq.indexOf('http') == -1 ? 'https://www.chaomangdao.com' + xq : xq" mode="widthFix"></image>
  23. <!-- 产品单图 -->
  24. <!-- <image :src="goods.image" @click="lookImg()" mode="widthFix"></image> -->
  25. </view>
  26. </view>
  27. </scroll-view>
  28. </uni-popup>
  29. </template>
  30. <script>
  31. export default {
  32. name: 'payment',
  33. props: {
  34. //盒子id
  35. boxId: Number
  36. },
  37. data() {
  38. return {
  39. goods: {},
  40. rate: {},
  41. boxDetail: {}
  42. };
  43. },
  44. methods: {
  45. /**
  46. * 打开页面
  47. *
  48. */
  49. open(goods, rate) {
  50. this.goods = goods;
  51. this.rate = rate || {};
  52. this.$refs['more-detail'].open();
  53. },
  54. lookImg() {
  55. uni.previewImage({
  56. urls: [this.goods.image],
  57. longPressActions: {
  58. itemList: ['发送给朋友', '保存图片', '收藏'],
  59. success: function(data) {
  60. console.log('选中了第' + (data.tapIndex + 1) + '个按钮,第' + (data.index + 1) + '张图片');
  61. },
  62. fail: function(err) {
  63. console.log(err.errMsg);
  64. }
  65. }
  66. });
  67. },
  68. //获取详情
  69. getDetails() {
  70. this.$api.boxDetail({ box_id: this.boxId }).then(res => {
  71. if (res.code === 1) {
  72. this.boxDetail = res.data;
  73. this.record3 = res.data.record.slice(0, 3);
  74. console.log(this.boxDetail);
  75. }
  76. });
  77. }
  78. }
  79. };
  80. </script>
  81. <style lang="scss">
  82. .scrolllist {
  83. max-height: 70vh;
  84. }
  85. .more-detail {
  86. max-height: 70vh;
  87. background: #ffffff;
  88. border-radius: 20rpx 20rpx 0rpx 0rpx;
  89. position: relative;
  90. .more-detail-close {
  91. top: 30rpx;
  92. right: 30rpx;
  93. width: 44rpx;
  94. height: 44rpx;
  95. position: absolute;
  96. }
  97. .content {
  98. padding: 0 50rpx 30rpx 50rpx;
  99. }
  100. .more-detail-head {
  101. padding: 0 50rpx 150rpx 50rpx;
  102. text-align: center;
  103. font-size: 30rpx;
  104. font-weight: bold;
  105. padding: 40rpx 0 50rpx 0;
  106. }
  107. .props {
  108. display: flex;
  109. margin: 16rpx 0;
  110. > view {
  111. display: flex;
  112. flex: 1;
  113. align-items: center;
  114. }
  115. .label {
  116. font-size: 28rpx;
  117. color: #959595;
  118. }
  119. .value {
  120. margin-left: 10rpx;
  121. font-size: 32rpx;
  122. font-weight: bold;
  123. }
  124. }
  125. }
  126. </style>