goodsList.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530
  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(shopId) {
  169. if(shopId == 1161){
  170. return
  171. }
  172. this.$api.navigateTo(`/pages/supplier/user/my-shop?shopId=${shopId}`)
  173. },
  174. details(pros) {
  175. if (pros.validFlag == 9) {
  176. return
  177. } else {
  178. this.$api.navigateTo(`/pages/goods/product?id=${pros.productId}`)
  179. }
  180. },
  181. clickPopupShow(pros) {
  182. console.log(pros)
  183. this.$emit('popupClick', pros)
  184. },
  185. PromotionsFormat(promo) {
  186. //促销活动类型数据处理
  187. if (promo != null) {
  188. if (promo.type == 1 && promo.mode == 1) {
  189. return true
  190. } else {
  191. return false
  192. }
  193. }
  194. return false
  195. }
  196. }
  197. }
  198. </script>
  199. <style lang="scss">
  200. .goods-template {
  201. width: 100%;
  202. height: auto;
  203. background: #ffffff;
  204. float: left;
  205. margin-top: 24rpx;
  206. .goods-list {
  207. width: 100%;
  208. height: auto;
  209. background: #f7f7f7;
  210. .goods-item {
  211. width: 702rpx;
  212. padding: 24rpx;
  213. height: auto;
  214. background: #ffffff;
  215. margin-bottom: 24rpx;
  216. &:last-child {
  217. margin-bottom: 0;
  218. }
  219. }
  220. .shoptitle {
  221. width: 100%;
  222. float: left;
  223. height: 56rpx;
  224. line-height: 56rpx;
  225. margin-bottom: 12rpx;
  226. .floor-item-act{
  227. height: 56rpx;
  228. text-align: center;
  229. box-sizing: border-box;
  230. float: left;
  231. padding: 10rpx 0;
  232. margin-right: 12rpx;
  233. .floor-tags{
  234. height: 28rpx;
  235. border-radius: 6rpx;
  236. background-color: #FFFFFF;
  237. line-height: 28rpx;
  238. color: $color-system;
  239. text-align: center;
  240. display: inline-block;
  241. padding:0 6rpx;
  242. font-size: $font-size-20;
  243. border: 1px solid #E15616;
  244. float: left;
  245. }
  246. }
  247. .title-text {
  248. width: 400rpx;
  249. overflow: hidden;
  250. text-overflow: ellipsis;
  251. white-space: nowrap;
  252. float: left;
  253. font-size: $font-size-28;
  254. color: $text-color;
  255. text-align: left;
  256. line-height: 56rpx;
  257. font-weight: bold;
  258. .iconfont {
  259. color: #999999;
  260. font-size: 28rpx;
  261. margin-left: 10rpx;
  262. }
  263. .paymenttext {
  264. color: #f9a94b;
  265. font-size: $font-size-22;
  266. margin-left: 20rpx;
  267. }
  268. }
  269. }
  270. .productlist {
  271. width: 100%;
  272. height: auto;
  273. border-bottom: 2rpx solid #e1e1e1;
  274. padding: 10rpx;
  275. box-sizing: border-box;
  276. }
  277. .goods-pros-t {
  278. display: flex;
  279. width: 100%;
  280. height: auto;
  281. margin: 20rpx 0;
  282. .pros-left {
  283. width: 210rpx;
  284. height: 100%;
  285. margin: 0 26rpx 0 0;
  286. }
  287. .pros-img {
  288. width: 210rpx;
  289. height: 210rpx;
  290. border-radius: 10rpx;
  291. border: 1px solid #f3f3f3;
  292. position: relative;
  293. .tips {
  294. display: inline-block;
  295. width: 80rpx;
  296. height: 40rpx;
  297. background-image: linear-gradient(214deg, #ff4500 0%, #ff5800 53%, #ff4367 100%);
  298. line-height: 40rpx;
  299. text-align: center;
  300. font-size: $font-size-24;
  301. color: #ffffff;
  302. border-radius: 10rpx 0 10rpx 0;
  303. position: absolute;
  304. top: 0;
  305. left: 0;
  306. }
  307. image {
  308. width: 210rpx;
  309. height: 210rpx;
  310. border-radius: 10rpx;
  311. }
  312. }
  313. }
  314. .product-info {
  315. padding: 10rpx 0;
  316. .product-view {
  317. font-size: $font-size-24;
  318. color: #999999;
  319. overflow: hidden;
  320. height: 44rpx;
  321. line-height: 44rpx;
  322. .view-num {
  323. float: left;
  324. }
  325. .view-right {
  326. color: #666666;
  327. float: right;
  328. }
  329. }
  330. }
  331. .pros-product {
  332. width: 468rpx;
  333. height: 100%;
  334. line-height: 36rpx;
  335. font-size: $font-size-26;
  336. position: relative;
  337. .product-view {
  338. &.allPrice {
  339. width: 100%;
  340. }
  341. .view-num {
  342. flex: 1;
  343. text-align: left;
  344. font-size: $font-size-26;
  345. color: #999999;
  346. line-height: 44rpx;
  347. float: left;
  348. &.right {
  349. float: right;
  350. }
  351. &.red {
  352. color: #ff2000;
  353. font-weight: bold;
  354. &.none {
  355. text-decoration: line-through;
  356. color: #999999;
  357. }
  358. }
  359. }
  360. }
  361. .producttitle {
  362. width: 100%;
  363. display: inline-block;
  364. height: auto;
  365. text-overflow: ellipsis;
  366. display: -webkit-box;
  367. word-break: break-all;
  368. -webkit-box-orient: vertical;
  369. -webkit-line-clamp: 2;
  370. overflow: hidden;
  371. margin-bottom: 8rpx;
  372. }
  373. .productspec {
  374. height: 44rpx;
  375. color: #999999;
  376. line-height: 44rpx;
  377. text-overflow: ellipsis;
  378. display: -webkit-box;
  379. word-break: break-all;
  380. -webkit-box-orient: vertical;
  381. -webkit-line-clamp: 1;
  382. overflow: hidden;
  383. }
  384. .productprice {
  385. height: 48rpx;
  386. position: absolute;
  387. width: 100%;
  388. bottom: 0;
  389. .price {
  390. line-height: 48rpx;
  391. font-size: $font-size-28;
  392. width: 48%;
  393. color: #ff2a2a;
  394. float: left;
  395. .price {
  396. line-height: 48rpx;
  397. font-size: $font-size-28;
  398. width: 48%;
  399. color: #ff2a2a;
  400. float: left;
  401. font-weight: bold;
  402. }
  403. }
  404. .count {
  405. height: 100%;
  406. float: right;
  407. position: relative;
  408. .small {
  409. color: #666666;
  410. }
  411. }
  412. }
  413. .floor-item-act {
  414. width: 100%;
  415. height: 56rpx;
  416. text-align: center;
  417. box-sizing: border-box;
  418. float: left;
  419. padding: 10rpx 0 0 0;
  420. }
  421. .floor-item-act {
  422. height: 56rpx;
  423. text-align: center;
  424. box-sizing: border-box;
  425. float: left;
  426. padding: 10rpx 0;
  427. margin-right: 12rpx;
  428. }
  429. }
  430. .goods-pros-m {
  431. width: 100%;
  432. height: auto;
  433. line-height: 76rpx;
  434. font-size: $font-size-26;
  435. color: $text-color;
  436. float: left;
  437. .m-text {
  438. width: 62rpx;
  439. float: left;
  440. padding-right: 20rpx;
  441. font-weight: bold;
  442. }
  443. .m-input {
  444. display: -webkit-box;
  445. display: -webkit-flex;
  446. display: flex;
  447. -webkit-box-align: center;
  448. -webkit-align-items: center;
  449. align-items: center;
  450. position: relative;
  451. width: 620rpx;
  452. height: auto;
  453. padding: 20rpx 0 10rpx 0;
  454. background: #ffffff;
  455. .text {
  456. width: 100%;
  457. height: 100%;
  458. font-size: $font-size-26;
  459. line-height: 36rpx;
  460. color: #333333;
  461. }
  462. }
  463. }
  464. .goods-pros-b {
  465. width: 100%;
  466. height: 80rpx;
  467. margin-top: 12rpx;
  468. float: left;
  469. .count {
  470. float: left;
  471. font-size: $font-size-26;
  472. line-height: 80rpx;
  473. color: $text-color;
  474. display: flex;
  475. justify-content: flex-end;
  476. font-weight: bold;
  477. }
  478. .sum {
  479. width: 520rpx;
  480. float: right;
  481. .sum-none {
  482. width: 100%;
  483. height: 40rpx;
  484. line-height: 40rpx;
  485. color: $text-color;
  486. float: left;
  487. text-align: right;
  488. .money {
  489. font-size: $font-size-26;
  490. color: #999999;
  491. text-decoration: line-through;
  492. }
  493. .money-sign {
  494. font-size: $font-size-26;
  495. color: #999999;
  496. text-decoration: line-through;
  497. }
  498. .money-reduced {
  499. margin-left: 10rpx;
  500. font-size: $font-size-26;
  501. color: $color-system;
  502. .iconfont {
  503. font-size: $font-size-34;
  504. }
  505. }
  506. }
  507. .sum-money {
  508. width: 100%;
  509. height: 40rpx;
  510. font-size: $font-size-28;
  511. line-height: 40rpx;
  512. color: $text-color;
  513. display: flex;
  514. justify-content: flex-end;
  515. &.none {
  516. height: 80rpx;
  517. line-height: 80rpx;
  518. }
  519. .money {
  520. color: #ff2a2a;
  521. font-size: $font-size-28;
  522. }
  523. }
  524. }
  525. }
  526. }
  527. }
  528. </style>