goodsList.vue 13 KB

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