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