goodsList.vue 13 KB

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