goods-detail.vue 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. <template>
  2. <uni-popup ref="more-detail" type="bottom" :mask-click="false" height="30px">
  3. <view class="more-detail">
  4. <view class="more-detail-close" @click="$refs['more-detail'].close()">
  5. <image src="/static/image/home/guanbi@2x.png" mode=""></image>
  6. </view>
  7. <view class="more-detail-head">商品详情</view>
  8. <view class="content">
  9. <view>{{goods.goods_name}}</view>
  10. <view class="props">
  11. <view>
  12. <view class="label">参考价:</view>
  13. <view class="value">¥{{goods.price}}</view>
  14. </view>
  15. <view>
  16. <view class="label">参考概率:</view>
  17. <view class="value">{{rate.value}}</view>
  18. </view>
  19. </view>
  20. </view>
  21. <view class="goods.xiangqing">
  22. <!-- 产品多图 -->
  23. <image v-for="xq in goods.xiangqing" :src="xq" mode="widthFix"></image>
  24. <!-- 产品单图 -->
  25. <!-- <image :src="goods.image" @click="lookImg()" mode="widthFix"></image> -->
  26. </view>
  27. </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. .more-detail {
  83. max-height: 70vh;
  84. overflow: auto;
  85. background: #FFFFFF;
  86. border-radius: 20rpx 20rpx 0rpx 0rpx;
  87. position: relative;
  88. .more-detail-close {
  89. top: 30rpx;
  90. right: 30rpx;
  91. width: 44rpx;
  92. height: 44rpx;
  93. position: absolute;
  94. }
  95. .content{
  96. padding: 0 50rpx 30rpx 50rpx;
  97. }
  98. .more-detail-head {
  99. padding: 0 50rpx 150rpx 50rpx;
  100. text-align: center;
  101. font-size: 30rpx;
  102. font-weight: bold;
  103. padding: 40rpx 0 50rpx 0;
  104. }
  105. .props{
  106. display: flex;
  107. margin: 16rpx 0;
  108. >view{
  109. display: flex;
  110. flex: 1;
  111. align-items: center;
  112. }
  113. .label{
  114. font-size: 28rpx;
  115. color: #959595;
  116. }
  117. .value{
  118. margin-left: 10rpx;
  119. font-size: 32rpx;
  120. font-weight: bold;
  121. }
  122. }
  123. }
  124. </style>