goodsList.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485
  1. <template name="goods">
  2. <view class="goods-template">
  3. <!-- 商品列表 -->
  4. <view class="goods-list">
  5. <view v-for="(item, index) in shopOrderData" :key="index" class="goods-item clearfix">
  6. <view class="shoptitle">
  7. <view v-if="item.shopPromotion" class="floor-item-act">
  8. <view class="floor-tags" @click.stop="clickPopupShow(item.shopPromotion)">{{
  9. item.shopPromotion.name
  10. }}</view>
  11. </view>
  12. <view class="title-text" v-if="information.secondHandOrderFlag == 1"
  13. >{{ item.shopName }}
  14. <label class="paymenttext" v-if="information.affirmPaymentFlag == 1">已确认打款供应商</label>
  15. </view>
  16. <view class="title-text" v-else @click="goShophome(item.shopId)">
  17. {{ item.shopName }} <label class="iconfont icon-jinrudianpu"></label>
  18. </view>
  19. </view>
  20. <view class="productlist" v-for="(pros, idx) in item.orderProductList" :key="idx">
  21. <view class="goods-pros-t " @click="details(pros)">
  22. <view class="pros-left">
  23. <view class="pros-img">
  24. <image :src="pros.image" alt="" />
  25. <text class="tips" v-if="pros.productType == 2 || pros.productType == 1">赠品</text>
  26. </view>
  27. </view>
  28. <view class="pros-product">
  29. <view class="producttitle">{{ pros.name }}</view>
  30. <view class="productspec product-view" v-if="pros.productCategory != 2"
  31. >规格:{{ pros.productUnit ? pros.productUnit : '' }}</view
  32. >
  33. <view class="product-view">
  34. <view class="view-num red">¥{{ pros.price | NumFormat }}</view>
  35. </view>
  36. <view class="floor-item-act">
  37. <template v-if="pros.productPromotion">
  38. <view
  39. v-if="PromotionsFormat(pros.productPromotion)"
  40. class="floor-tags"
  41. @click.stop="clickPopupShow(pros.productPromotion)"
  42. >
  43. {{ pros.productPromotion.name }}
  44. <text v-if="pros.productPromotion != null && pros.productPromotion.type != 3">
  45. :¥{{
  46. pros.productPromotion == null
  47. ? '0.00'
  48. : pros.productPromotion.touchPrice | NumFormat
  49. }}
  50. </text>
  51. </view>
  52. <view
  53. v-else-if="pros.productPromotion.type != 3"
  54. class="floor-tags"
  55. @click.stop="clickPopupShow(pros.productPromotion)"
  56. >{{ pros.productPromotion.name }}</view
  57. >
  58. </template>
  59. <template v-else>
  60. <view class="svip-tags" v-if="pros.ladderPriceFlag == 1">
  61. <view class="tags">SVIP</view> <view class="price">8折</view>
  62. </view>
  63. <view class="svip-tags" v-if="pros.ladderPriceFlag == 0">
  64. <view class="tags">SVIP</view>
  65. <view class="price">¥{{ pros.price | NumFormat }}</view>
  66. </view>
  67. </template>
  68. </view>
  69. <view class="product-view">
  70. <view class="view-num right">x {{ pros.num }}</view>
  71. </view>
  72. </view>
  73. </view>
  74. <view class=" product-info">
  75. <view class="product-view" v-if="pros.returnedNum > 0 || pros.actualCancelNum > 0">
  76. <view class="view-num">已退货/已取消</view>
  77. <view class="view-right">{{ pros.returnedNum }}/{{ pros.actualCancelNum }}</view>
  78. </view>
  79. <view class="product-view">
  80. <view class="view-num">折扣</view>
  81. <view class="view-right">{{ pros.discount == null ? '0' : pros.discount }}%</view>
  82. </view>
  83. <view class="product-view">
  84. <view class="view-num">税率</view> <view class="view-right">{{ pros.taxRate }}%</view>
  85. </view>
  86. <view class="product-view">
  87. <view class="view-num">折后单价</view>
  88. <view class="view-right">¥{{ pros.discountPrice | NumFormat }}</view>
  89. </view>
  90. <view class="product-view allPrice">
  91. <view class="view-num">合计</view>
  92. <view class="view-right">¥{{ pros.totalFee | NumFormat }}</view>
  93. </view>
  94. </view>
  95. </view>
  96. <view class="goods-pros-m" v-if="item.note">
  97. <view class="m-text">留言:</view>
  98. <view class="m-input">
  99. <view class="text">{{ item.note ? item.note : '' }}</view>
  100. </view>
  101. </view>
  102. <view class="goods-pros-b">
  103. <view class="count">共{{ item.itemCount }}件商品</view>
  104. <view class="sum">
  105. <view class="sum-none" v-if="item.promotionFullReduction > 0">
  106. <text class="money-sign">¥</text>
  107. <text class="money">{{
  108. (item.totalAmount + item.promotionFullReduction) | NumFormat
  109. }}</text>
  110. <text class="money-reduced"
  111. >减<text>¥{{ item.promotionFullReduction | NumFormat }}</text></text
  112. >
  113. </view>
  114. <view class="sum-money" :class="item.promotionFullReduction == 0 ? 'none' : ''">
  115. 商品总额:<text class="money">¥{{ item.totalAmount | NumFormat }}</text>
  116. </view>
  117. </view>
  118. </view>
  119. </view>
  120. </view>
  121. </view>
  122. </template>
  123. <script>
  124. export default {
  125. name: 'goods',
  126. props: {
  127. shopOrderData: {
  128. type: Array
  129. },
  130. information: {
  131. type: Object
  132. }
  133. },
  134. data() {
  135. return {
  136. initData: []
  137. }
  138. },
  139. created() {
  140. this.initData = this.shopOrderData
  141. },
  142. filters: {
  143. NumFormat(value) {
  144. //处理金额
  145. return Number(value).toFixed(2)
  146. },
  147. formatIncludedTax(value) {
  148. if (value === '1') {
  149. return '不含税 '
  150. } else if (value === '2') {
  151. return '含税'
  152. } else {
  153. return ''
  154. }
  155. }
  156. },
  157. computed: {},
  158. methods: {
  159. goShophome(id) {
  160. this.$api.navigateTo(`/pages/supplier/user/my-shop?shopId=${id}`)
  161. },
  162. details(pros) {
  163. if (pros.validFlag == 9) {
  164. return
  165. } else {
  166. this.$api.navigateTo(`/pages/goods/product?id=${pros.productID}`)
  167. }
  168. },
  169. clickPopupShow(pros) {
  170. console.log(pros)
  171. this.$emit('popupClick', pros)
  172. },
  173. PromotionsFormat(promo) {
  174. //促销活动类型数据处理
  175. if (promo != null) {
  176. if (promo.type == 1 && promo.mode == 1) {
  177. return true
  178. } else {
  179. return false
  180. }
  181. }
  182. return false
  183. }
  184. }
  185. }
  186. </script>
  187. <style lang="scss">
  188. .goods-template {
  189. width: 100%;
  190. height: auto;
  191. background: #ffffff;
  192. float: left;
  193. margin-top: 24rpx;
  194. .goods-list {
  195. width: 100%;
  196. height: auto;
  197. background: #f7f7f7;
  198. .goods-item {
  199. width: 702rpx;
  200. padding: 24rpx;
  201. height: auto;
  202. background: #ffffff;
  203. margin-bottom: 24rpx;
  204. &:last-child {
  205. margin-bottom: 0;
  206. }
  207. }
  208. .shoptitle {
  209. width: 100%;
  210. float: left;
  211. height: 56rpx;
  212. line-height: 56rpx;
  213. margin-bottom: 12rpx;
  214. .title-text {
  215. width: 400rpx;
  216. overflow: hidden;
  217. text-overflow: ellipsis;
  218. white-space: nowrap;
  219. float: left;
  220. font-size: $font-size-28;
  221. color: $text-color;
  222. text-align: left;
  223. line-height: 56rpx;
  224. font-weight: bold;
  225. .iconfont {
  226. color: #999999;
  227. font-size: 28rpx;
  228. margin-left: 10rpx;
  229. }
  230. .paymenttext {
  231. color: #f9a94b;
  232. font-size: $font-size-22;
  233. margin-left: 20rpx;
  234. }
  235. }
  236. }
  237. .productlist {
  238. width: 100%;
  239. height: auto;
  240. border-bottom: 2rpx solid #e1e1e1;
  241. padding: 10rpx;
  242. box-sizing: border-box;
  243. }
  244. .goods-pros-t {
  245. display: flex;
  246. width: 100%;
  247. height: auto;
  248. margin: 20rpx 0;
  249. .pros-left {
  250. width: 210rpx;
  251. height: 100%;
  252. margin: 0 26rpx 0 0;
  253. }
  254. .pros-img {
  255. width: 210rpx;
  256. height: 210rpx;
  257. border-radius: 10rpx;
  258. border: 1px solid #f3f3f3;
  259. position: relative;
  260. .tips {
  261. display: inline-block;
  262. width: 80rpx;
  263. height: 40rpx;
  264. background-image: linear-gradient(214deg, #ff4500 0%, #ff5800 53%, #ff4367 100%);
  265. line-height: 40rpx;
  266. text-align: center;
  267. font-size: $font-size-24;
  268. color: #ffffff;
  269. border-radius: 10rpx 0 10rpx 0;
  270. position: absolute;
  271. top: 0;
  272. left: 0;
  273. }
  274. image {
  275. width: 210rpx;
  276. height: 210rpx;
  277. border-radius: 10rpx;
  278. }
  279. }
  280. }
  281. .product-info {
  282. padding: 10rpx 0;
  283. .product-view {
  284. font-size: $font-size-24;
  285. color: #999999;
  286. overflow: hidden;
  287. height: 44rpx;
  288. line-height: 44rpx;
  289. .view-num {
  290. float: left;
  291. }
  292. .view-right {
  293. color: #666666;
  294. float: right;
  295. }
  296. }
  297. }
  298. .pros-product {
  299. width: 468rpx;
  300. height: 100%;
  301. line-height: 36rpx;
  302. font-size: $font-size-26;
  303. position: relative;
  304. .product-view {
  305. &.allPrice {
  306. width: 100%;
  307. }
  308. .view-num {
  309. flex: 1;
  310. text-align: left;
  311. font-size: $font-size-26;
  312. color: #999999;
  313. line-height: 44rpx;
  314. float: left;
  315. &.right {
  316. float: right;
  317. }
  318. &.red {
  319. color: #ff2000;
  320. font-weight: bold;
  321. }
  322. }
  323. }
  324. .producttitle {
  325. width: 100%;
  326. display: inline-block;
  327. height: auto;
  328. text-overflow: ellipsis;
  329. display: -webkit-box;
  330. word-break: break-all;
  331. -webkit-box-orient: vertical;
  332. -webkit-line-clamp: 2;
  333. overflow: hidden;
  334. margin-bottom: 8rpx;
  335. }
  336. .productspec {
  337. height: 44rpx;
  338. color: #999999;
  339. line-height: 44rpx;
  340. text-overflow: ellipsis;
  341. display: -webkit-box;
  342. word-break: break-all;
  343. -webkit-box-orient: vertical;
  344. -webkit-line-clamp: 1;
  345. overflow: hidden;
  346. }
  347. .productprice {
  348. height: 48rpx;
  349. position: absolute;
  350. width: 100%;
  351. bottom: 0;
  352. .price {
  353. line-height: 48rpx;
  354. font-size: $font-size-28;
  355. width: 48%;
  356. color: #ff2a2a;
  357. float: left;
  358. }
  359. .count {
  360. height: 100%;
  361. float: right;
  362. position: relative;
  363. .small {
  364. color: #666666;
  365. }
  366. }
  367. }
  368. .floor-item-act {
  369. width: 100%;
  370. height: 56rpx;
  371. text-align: center;
  372. box-sizing: border-box;
  373. float: left;
  374. padding: 10rpx 0 0 0;
  375. }
  376. .floor-item-act {
  377. height: 56rpx;
  378. text-align: center;
  379. box-sizing: border-box;
  380. float: left;
  381. padding: 10rpx 0;
  382. margin-right: 12rpx;
  383. }
  384. }
  385. .goods-pros-m {
  386. width: 100%;
  387. height: auto;
  388. line-height: 76rpx;
  389. font-size: $font-size-26;
  390. color: $text-color;
  391. float: left;
  392. .m-text {
  393. width: 62rpx;
  394. float: left;
  395. padding-right: 20rpx;
  396. font-weight: bold;
  397. }
  398. .m-input {
  399. display: -webkit-box;
  400. display: -webkit-flex;
  401. display: flex;
  402. -webkit-box-align: center;
  403. -webkit-align-items: center;
  404. align-items: center;
  405. position: relative;
  406. width: 620rpx;
  407. height: auto;
  408. padding: 20rpx 0 10rpx 0;
  409. background: #ffffff;
  410. .text {
  411. width: 100%;
  412. height: 100%;
  413. font-size: $font-size-26;
  414. line-height: 36rpx;
  415. color: #333333;
  416. }
  417. }
  418. }
  419. .goods-pros-b {
  420. width: 100%;
  421. height: 80rpx;
  422. margin-top: 12rpx;
  423. float: left;
  424. .count {
  425. float: left;
  426. font-size: $font-size-26;
  427. line-height: 80rpx;
  428. color: $text-color;
  429. display: flex;
  430. justify-content: flex-end;
  431. font-weight: bold;
  432. }
  433. .sum {
  434. width: 520rpx;
  435. float: right;
  436. .sum-none {
  437. width: 100%;
  438. height: 40rpx;
  439. line-height: 40rpx;
  440. color: $text-color;
  441. float: left;
  442. text-align: right;
  443. .money {
  444. font-size: $font-size-26;
  445. color: #999999;
  446. text-decoration: line-through;
  447. }
  448. .money-sign {
  449. font-size: $font-size-26;
  450. color: #999999;
  451. text-decoration: line-through;
  452. }
  453. .money-reduced {
  454. margin-left: 10rpx;
  455. font-size: $font-size-26;
  456. color: $color-system;
  457. .iconfont {
  458. font-size: $font-size-34;
  459. }
  460. }
  461. }
  462. .sum-money {
  463. width: 100%;
  464. height: 40rpx;
  465. font-size: $font-size-28;
  466. line-height: 40rpx;
  467. color: $text-color;
  468. display: flex;
  469. justify-content: flex-end;
  470. &.none {
  471. height: 80rpx;
  472. line-height: 80rpx;
  473. }
  474. .money {
  475. color: #ff2a2a;
  476. font-size: $font-size-28;
  477. }
  478. }
  479. }
  480. }
  481. }
  482. }
  483. </style>