goodsInformation.vue 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311
  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">
  13. {{ i18n.inReview }}
  14. </view>
  15. <view class="text-1" v-else-if="itemInfo.review_status == 2">
  16. {{ i18n.auditFailed }}
  17. </view>
  18. <view class="text-1" v-else-if="itemInfo.status == 'down'">
  19. {{ i18n.removed }}
  20. </view>
  21. </view>
  22. <view class="content-right">
  23. <view class="goods-title">
  24. <view
  25. class="_label"
  26. v-if="!productAndCommodity && itemInfo.source == 2"
  27. >
  28. {{ i18n.supplier }}
  29. </view>
  30. <view
  31. class="_label"
  32. style="background-color: #f83224"
  33. v-if="!productAndCommodity && itemInfo.source == 1"
  34. >
  35. {{ i18n.selfSupport }}
  36. </view>
  37. <view
  38. class="_label"
  39. v-if="!productAndCommodity && itemInfo.source == 0"
  40. >
  41. {{ i18n.team }}
  42. </view>
  43. <view class="title" v-if="productAndCommodity == 'product'">
  44. <text v-if="language == 'zh-CN'"> {{ itemInfo.name_cn }}</text>
  45. <text v-if="language == 'en-US'"> {{ itemInfo.name_en }}</text>
  46. <text v-if="language == 'es-ES'"> {{ itemInfo.name_es }}</text>
  47. <text v-if="language == 'it-IT'"> {{ itemInfo.name_ita }}</text>
  48. </view>
  49. <view class="title" v-else>
  50. <text v-if="language == 'zh-CN'"> {{ itemInfo.name_cn }}</text>
  51. <text v-if="language == 'en-US'"> {{ itemInfo.name_en }}</text>
  52. <text v-if="language == 'es-ES'"> {{ itemInfo.name_es }}</text>
  53. <text v-if="language == 'it-IT'">
  54. {{ itemInfo.name_ita }}</text
  55. ></view
  56. >
  57. </view>
  58. <view class="inventory" v-if="productAndCommodity">
  59. <text>{{ i18n.inventory }}:</text>
  60. <text>{{ itemInfo.stock }}</text>
  61. </view>
  62. <view class="inventory" v-else>
  63. <text>{{ itemInfo.labels.join(" | ") }} </text>
  64. </view>
  65. <view class="commodity-price" v-if="productAndCommodity == 'product'">
  66. <text style="font-size: 20rpx">¥</text>
  67. <text>{{ itemInfo.discount_price.split(".")[0] }}</text
  68. >.
  69. <text style="font-size: 20rpx">{{
  70. itemInfo.discount_price.split(".")[1]
  71. }}</text>
  72. <text
  73. style="
  74. font-size: 24rpx;
  75. color: #ccc;
  76. text-decoration-line: line-through;
  77. "
  78. >¥{{ itemInfo.price }}</text
  79. >
  80. </view>
  81. <view v-else class="commodity-price">
  82. <text style="font-size: 20rpx">¥</text>
  83. <text>{{ itemInfo.price.split(".")[0] }}</text
  84. >.
  85. <text style="font-size: 20rpx">{{
  86. itemInfo.price.split(".")[1]
  87. }}</text>
  88. </view>
  89. </view>
  90. </view>
  91. <view class="btn-list" v-if="!batch && productAndCommodity == 'product'">
  92. <button
  93. class="btn-1"
  94. @click.stop="$emit('goodsUpDown', 'down', itemInfo)"
  95. v-if="itemInfo.review_status == 1 && itemInfo.status == 'normal'"
  96. >
  97. {{ i18n.removeProducts }}
  98. </button>
  99. <button class="btn-1" v-if="itemInfo.review_status == 0">
  100. {{ i18n.details }}
  101. </button>
  102. <!-- <button class="btn-2" v-if="itemInfo.review_status == 2">重新提交</button> -->
  103. <!-- <button class="btn-1" v-if="itemInfo.status == 'down'">编辑</button> -->
  104. <button
  105. class="btn-1"
  106. @click.stop="$emit('goodsUpDown', 'normal', itemInfo)"
  107. v-if="
  108. itemInfo.review_status != '0' &&
  109. itemInfo.review_status != '2' &&
  110. itemInfo.status == 'down'
  111. "
  112. >
  113. {{ i18n.listingProducts }}
  114. </button>
  115. </view>
  116. <view class="btn-list" v-if="!batch && productAndCommodity == 'commodity'">
  117. <button
  118. class="btn-1"
  119. v-if="status == 1"
  120. @click.stop="$emit('openDiscountsPopup', obj)"
  121. >
  122. {{ i18n.wantDiscount }}
  123. </button>
  124. <button class="btn-1" v-if="status == 1">{{ i18n.offShelf }}</button>
  125. <button class="btn-1" v-if="status == 4">{{ i18n.delete }}</button>
  126. <button class="btn-1" v-if="status == 4">{{ i18n.business }}</button>
  127. <button class="btn-2" v-if="status == 3">{{ i18n.edit }}</button>
  128. </view>
  129. </view>
  130. </template>
  131. <script>
  132. export default {
  133. props: {
  134. status: {
  135. typeof: String,
  136. default: "",
  137. },
  138. itemInfo: {
  139. typeof: Object,
  140. default: () => {
  141. return {};
  142. },
  143. },
  144. productAndCommodity: {
  145. typeof: String,
  146. default: "",
  147. },
  148. batch: {
  149. typeof: Boolean,
  150. default: false,
  151. },
  152. //语言
  153. language: {
  154. typeof: String,
  155. default: "",
  156. },
  157. },
  158. watch: {},
  159. data() {
  160. return {
  161. obj: {
  162. url: "https://img11.360buyimg.com/jdcms/s460x460_jfs/t1/136953/20/42322/162799/665e6a6cF32604c1e/b9586c7ae52dc284.jpg.avif",
  163. title: "La Chapelle Sport拉夏贝尔高…",
  164. price: "75.00",
  165. },
  166. lebelList: [],
  167. };
  168. },
  169. computed: {
  170. isPadding() {
  171. if (this.productAndCommodity == "product") {
  172. return "padding: 28rpx 20rpx 20rpx;";
  173. }
  174. },
  175. i18n() {
  176. return this.$t("index");
  177. },
  178. },
  179. };
  180. </script>
  181. <style lang="scss" scoped>
  182. .detail {
  183. background-color: #fff;
  184. border-radius: 16rpx;
  185. margin: 10rpx 0;
  186. width: 96%;
  187. .content {
  188. display: flex;
  189. position: relative;
  190. flex-shrink: 0;
  191. justify-content: flex-start;
  192. width: 100%;
  193. .content-img {
  194. width: 164rpx;
  195. height: 164rpx;
  196. border-radius: 12rpx;
  197. margin-right: 20rpx;
  198. flex-shrink: 0;
  199. }
  200. .mask {
  201. width: 164rpx;
  202. height: 164rpx;
  203. border-radius: 12rpx;
  204. position: absolute;
  205. background-color: rgba(255, 255, 255, 0.3);
  206. z-index: 100;
  207. display: flex;
  208. justify-content: center;
  209. align-items: center;
  210. .text-1 {
  211. width: 108rpx;
  212. height: 44rpx;
  213. text-align: center;
  214. line-height: 44rpx;
  215. color: #fff;
  216. background-color: rgba(0, 0, 0, 0.4);
  217. border-radius: 22rpx;
  218. font-size: 20rpx;
  219. }
  220. }
  221. .content-right {
  222. width: 80%;
  223. .goods-title {
  224. color: #333;
  225. margin-bottom: 20rpx;
  226. width: 88%;
  227. overflow: hidden;
  228. text-overflow: ellipsis;
  229. white-space: nowrap;
  230. word-break: break-word;
  231. display: flex;
  232. justify-content: flex-start;
  233. align-items: center;
  234. .title {
  235. width: 75%;
  236. overflow: hidden;
  237. text-overflow: ellipsis;
  238. white-space: nowrap;
  239. word-break: break-word;
  240. }
  241. ._label {
  242. color: #fff;
  243. background-color: #ffb111;
  244. width: 72rpx;
  245. height: 32rpx;
  246. text-align: center;
  247. line-height: 32rpx;
  248. height: 32rpx;
  249. border-radius: 4rpx;
  250. font-size: 20rpx;
  251. margin-right: 10rpx;
  252. }
  253. }
  254. .inventory {
  255. color: rgba(54, 54, 54, 0.5);
  256. font-size: 24rpx;
  257. margin-bottom: 30rpx;
  258. }
  259. .commodity-price {
  260. color: #f83224;
  261. font-size: 32rpx;
  262. font-weight: 600;
  263. }
  264. }
  265. }
  266. .btn-list {
  267. display: flex;
  268. justify-content: flex-end;
  269. .btn-1 {
  270. width: 152rpx;
  271. height: 60rpx;
  272. margin: 0;
  273. padding: 0;
  274. font-size: 26rpx;
  275. color: #333;
  276. border: 2rpx solid rgba(151, 151, 151, 0.3);
  277. border-radius: 30rpx;
  278. background-color: #fff;
  279. line-height: 60rpx;
  280. margin-left: 20rpx;
  281. }
  282. .btn-2 {
  283. width: 152rpx;
  284. height: 60rpx;
  285. margin: 0;
  286. padding: 0;
  287. font-size: 26rpx;
  288. color: #f83224;
  289. border: 2rpx solid #f83224;
  290. border-radius: 30rpx;
  291. background-color: #fff;
  292. line-height: 60rpx;
  293. }
  294. }
  295. }
  296. </style>