goodsList.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500
  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" :class="pros.svipPriceFlag == 1 ? 'none' : ''">¥{{ 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. &.none{
  325. text-decoration: line-through;
  326. color: #999999;
  327. }
  328. }
  329. }
  330. }
  331. .producttitle {
  332. width: 100%;
  333. display: inline-block;
  334. height: auto;
  335. text-overflow: ellipsis;
  336. display: -webkit-box;
  337. word-break: break-all;
  338. -webkit-box-orient: vertical;
  339. -webkit-line-clamp: 2;
  340. overflow: hidden;
  341. margin-bottom: 8rpx;
  342. }
  343. .productspec {
  344. height: 44rpx;
  345. color: #999999;
  346. line-height: 44rpx;
  347. text-overflow: ellipsis;
  348. display: -webkit-box;
  349. word-break: break-all;
  350. -webkit-box-orient: vertical;
  351. -webkit-line-clamp: 1;
  352. overflow: hidden;
  353. }
  354. .productprice {
  355. height: 48rpx;
  356. position: absolute;
  357. width: 100%;
  358. bottom: 0;
  359. .price {
  360. line-height: 48rpx;
  361. font-size: $font-size-28;
  362. width: 48%;
  363. color: #ff2a2a;
  364. float: left;
  365. .price {
  366. line-height: 48rpx;
  367. font-size: $font-size-28;
  368. width: 48%;
  369. color: #ff2a2a;
  370. float: left;
  371. font-weight: bold;
  372. }
  373. }
  374. .count {
  375. height: 100%;
  376. float: right;
  377. position: relative;
  378. .small {
  379. color: #666666;
  380. }
  381. }
  382. }
  383. .floor-item-act {
  384. width: 100%;
  385. height: 56rpx;
  386. text-align: center;
  387. box-sizing: border-box;
  388. float: left;
  389. padding: 10rpx 0 0 0;
  390. }
  391. .floor-item-act {
  392. height: 56rpx;
  393. text-align: center;
  394. box-sizing: border-box;
  395. float: left;
  396. padding: 10rpx 0;
  397. margin-right: 12rpx;
  398. }
  399. }
  400. .goods-pros-m {
  401. width: 100%;
  402. height: auto;
  403. line-height: 76rpx;
  404. font-size: $font-size-26;
  405. color: $text-color;
  406. float: left;
  407. .m-text {
  408. width: 62rpx;
  409. float: left;
  410. padding-right: 20rpx;
  411. font-weight: bold;
  412. }
  413. .m-input {
  414. display: -webkit-box;
  415. display: -webkit-flex;
  416. display: flex;
  417. -webkit-box-align: center;
  418. -webkit-align-items: center;
  419. align-items: center;
  420. position: relative;
  421. width: 620rpx;
  422. height: auto;
  423. padding: 20rpx 0 10rpx 0;
  424. background: #ffffff;
  425. .text {
  426. width: 100%;
  427. height: 100%;
  428. font-size: $font-size-26;
  429. line-height: 36rpx;
  430. color: #333333;
  431. }
  432. }
  433. }
  434. .goods-pros-b {
  435. width: 100%;
  436. height: 80rpx;
  437. margin-top: 12rpx;
  438. float: left;
  439. .count {
  440. float: left;
  441. font-size: $font-size-26;
  442. line-height: 80rpx;
  443. color: $text-color;
  444. display: flex;
  445. justify-content: flex-end;
  446. font-weight: bold;
  447. }
  448. .sum {
  449. width: 520rpx;
  450. float: right;
  451. .sum-none {
  452. width: 100%;
  453. height: 40rpx;
  454. line-height: 40rpx;
  455. color: $text-color;
  456. float: left;
  457. text-align: right;
  458. .money {
  459. font-size: $font-size-26;
  460. color: #999999;
  461. text-decoration: line-through;
  462. }
  463. .money-sign {
  464. font-size: $font-size-26;
  465. color: #999999;
  466. text-decoration: line-through;
  467. }
  468. .money-reduced {
  469. margin-left: 10rpx;
  470. font-size: $font-size-26;
  471. color: $color-system;
  472. .iconfont {
  473. font-size: $font-size-34;
  474. }
  475. }
  476. }
  477. .sum-money {
  478. width: 100%;
  479. height: 40rpx;
  480. font-size: $font-size-28;
  481. line-height: 40rpx;
  482. color: $text-color;
  483. display: flex;
  484. justify-content: flex-end;
  485. &.none {
  486. height: 80rpx;
  487. line-height: 80rpx;
  488. }
  489. .money {
  490. color: #ff2a2a;
  491. font-size: $font-size-28;
  492. }
  493. }
  494. }
  495. }
  496. }
  497. }
  498. </style>