goodsInformation.vue 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262
  1. <template>
  2. <view class="detail" @click="$emit('toDetail', itemInfo)" :style="isPadding">
  3. <view class="content">
  4. <image :src="itemInfo.image" mode="" class="content-img"></image>
  5. <view
  6. class="mask"
  7. v-if="
  8. productAndCommodity == 'product' &&
  9. (itemInfo.review_status != 1 || itemInfo.status != 'normal')
  10. "
  11. >
  12. <view class="text-1" v-if="itemInfo.review_status == 0"> 审核中 </view>
  13. <view class="text-1" v-else-if="itemInfo.review_status == 2">
  14. 审核失败
  15. </view>
  16. <view class="text-1" v-else-if="itemInfo.status == 'down'">
  17. 已下架
  18. </view>
  19. </view>
  20. <view class="content-right">
  21. <view class="goods-title">
  22. <view
  23. class="_label"
  24. v-if="!productAndCommodity && itemInfo.source == 2"
  25. >
  26. 供应商
  27. </view>
  28. <view
  29. class="_label"
  30. style="background-color: #f83224"
  31. v-if="!productAndCommodity && itemInfo.source == 1"
  32. >
  33. 自营
  34. </view>
  35. <view
  36. class="_label"
  37. v-if="!productAndCommodity && itemInfo.source == 0"
  38. >
  39. 团长
  40. </view>
  41. <view class="title" v-if="productAndCommodity == 'product'">
  42. {{ itemInfo.name_cn }}
  43. </view>
  44. <view class="title" v-else>{{ itemInfo.name_cn }}</view>
  45. </view>
  46. <view class="inventory" v-if="productAndCommodity">
  47. <text>库存:</text>
  48. <text>222</text>
  49. </view>
  50. <view class="inventory" v-else>
  51. <text>{{ itemInfo.labels.join(" | ") }} </text>
  52. </view>
  53. <!-- <view class="commodity-price">
  54. <text style="font-size: 20rpx">¥</text>
  55. <text>{{ itemInfo.price.split(".")[0] }}</text
  56. >.
  57. <text style="font-size: 20rpx">{{
  58. itemInfo.price.split(".")[1]
  59. }}</text>
  60. </view> -->
  61. </view>
  62. </view>
  63. <view class="btn-list" v-if="!batch && productAndCommodity == 'product'">
  64. <button
  65. class="btn-1"
  66. v-if="itemInfo.review_status == 1 && itemInfo.status == 'normal'"
  67. >
  68. 下架商品
  69. </button>
  70. <button class="btn-1" v-if="itemInfo.review_status == 0">查看详情</button>
  71. <!-- <button class="btn-2" v-if="itemInfo.review_status == 2">重新提交</button> -->
  72. <!-- <button class="btn-1" v-if="itemInfo.status == 'down'">编辑</button> -->
  73. <button class="btn-1" v-if="itemInfo.status == 'down'">上架商品</button>
  74. </view>
  75. <view class="btn-list" v-if="!batch && productAndCommodity == 'commodity'">
  76. <button
  77. class="btn-1"
  78. v-if="status == 1"
  79. @click.stop="$emit('openDiscountsPopup', obj)"
  80. >
  81. 我要打折
  82. </button>
  83. <button class="btn-1" v-if="status == 1">下架</button>
  84. <button class="btn-1" v-if="status == 4">删除</button>
  85. <button class="btn-1" v-if="status == 4">商家</button>
  86. <button class="btn-2" v-if="status == 3">编辑</button>
  87. </view>
  88. </view>
  89. </template>
  90. <script>
  91. export default {
  92. props: {
  93. status: {
  94. typeof: String,
  95. default: "",
  96. },
  97. itemInfo: {
  98. typeof: Object,
  99. default: () => {
  100. return {};
  101. },
  102. },
  103. productAndCommodity: {
  104. typeof: String,
  105. default: "",
  106. },
  107. batch: {
  108. typeof: Boolean,
  109. default: false,
  110. },
  111. },
  112. watch: {},
  113. data() {
  114. return {
  115. obj: {
  116. url: "https://img11.360buyimg.com/jdcms/s460x460_jfs/t1/136953/20/42322/162799/665e6a6cF32604c1e/b9586c7ae52dc284.jpg.avif",
  117. title: "La Chapelle Sport拉夏贝尔高…",
  118. price: "75.00",
  119. },
  120. lebelList: [],
  121. };
  122. },
  123. computed: {
  124. isPadding() {
  125. if (this.productAndCommodity == "product") {
  126. return "padding: 28rpx 20rpx 20rpx;";
  127. }
  128. },
  129. },
  130. };
  131. </script>
  132. <style lang="scss" scoped>
  133. .detail {
  134. background-color: #fff;
  135. border-radius: 16rpx;
  136. margin: 10rpx 0;
  137. width: 96%;
  138. .content {
  139. display: flex;
  140. position: relative;
  141. flex-shrink: 0;
  142. justify-content: flex-start;
  143. width: 100%;
  144. .content-img {
  145. width: 164rpx;
  146. height: 164rpx;
  147. border-radius: 12rpx;
  148. margin-right: 20rpx;
  149. flex-shrink: 0;
  150. }
  151. .mask {
  152. width: 164rpx;
  153. height: 164rpx;
  154. border-radius: 12rpx;
  155. position: absolute;
  156. background-color: rgba(255, 255, 255, 0.3);
  157. z-index: 100;
  158. display: flex;
  159. justify-content: center;
  160. align-items: center;
  161. .text-1 {
  162. width: 108rpx;
  163. height: 44rpx;
  164. text-align: center;
  165. line-height: 44rpx;
  166. color: #fff;
  167. background-color: rgba(0, 0, 0, 0.4);
  168. border-radius: 22rpx;
  169. font-size: 20rpx;
  170. }
  171. }
  172. .content-right {
  173. width: 80%;
  174. .goods-title {
  175. color: #333;
  176. margin-bottom: 20rpx;
  177. width: 88%;
  178. overflow: hidden;
  179. text-overflow: ellipsis;
  180. white-space: nowrap;
  181. word-break: break-word;
  182. display: flex;
  183. justify-content: flex-start;
  184. align-items: center;
  185. .title {
  186. width: 75%;
  187. overflow: hidden;
  188. text-overflow: ellipsis;
  189. white-space: nowrap;
  190. word-break: break-word;
  191. }
  192. ._label {
  193. color: #fff;
  194. background-color: #ffb111;
  195. width: 72rpx;
  196. height: 32rpx;
  197. text-align: center;
  198. line-height: 32rpx;
  199. height: 32rpx;
  200. border-radius: 4rpx;
  201. font-size: 20rpx;
  202. margin-right: 10rpx;
  203. }
  204. }
  205. .inventory {
  206. color: rgba(54, 54, 54, 0.5);
  207. font-size: 24rpx;
  208. margin-bottom: 30rpx;
  209. }
  210. .commodity-price {
  211. color: #f83224;
  212. font-size: 32rpx;
  213. font-weight: 600;
  214. }
  215. }
  216. }
  217. .btn-list {
  218. display: flex;
  219. justify-content: flex-end;
  220. .btn-1 {
  221. width: 152rpx;
  222. height: 60rpx;
  223. margin: 0;
  224. padding: 0;
  225. font-size: 26rpx;
  226. color: #333;
  227. border: 2rpx solid rgba(151, 151, 151, 0.3);
  228. border-radius: 30rpx;
  229. background-color: #fff;
  230. line-height: 60rpx;
  231. margin-left: 20rpx;
  232. }
  233. .btn-2 {
  234. width: 152rpx;
  235. height: 60rpx;
  236. margin: 0;
  237. padding: 0;
  238. font-size: 26rpx;
  239. color: #f83224;
  240. border: 2rpx solid #f83224;
  241. border-radius: 30rpx;
  242. background-color: #fff;
  243. line-height: 60rpx;
  244. }
  245. }
  246. }
  247. </style>