goodsList.vue 11 KB

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