goodsList.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503
  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)">{{item.shopPromotion.name}}</view>
  9. </view>
  10. <view class="title-text" v-if="information.secondHandOrderFlag==1">{{item.shopName}}
  11. <label class="paymenttext" v-if="information.affirmPaymentFlag==1">已确认打款供应商</label>
  12. </view>
  13. <view class="title-text" v-else @click="goShophome(item.shopId)">
  14. {{item.shopName}}
  15. <label class="iconfont icon-jinrudianpu"></label>
  16. </view>
  17. </view>
  18. <view class="productlist" v-for="(pros,idx) in item.orderProductList" :key="idx">
  19. <view class="goods-pros-t " @click="details(pros)">
  20. <view class="pros-left">
  21. <view class="pros-img">
  22. <image :src="pros.image" alt="" />
  23. <text class="tips" v-if="pros.productType ==2 || pros.productType ==1">赠品</text>
  24. </view>
  25. </view>
  26. <view class="pros-product">
  27. <view class="producttitle">{{pros.name}}</view>
  28. <view class="productspec product-view" v-if="pros.productCategory != 2">规格:{{pros.productUnit ? pros.productUnit : ''}}</view>
  29. <view class="product-view">
  30. <view class="view-num red">¥{{ pros.price | NumFormat }}</view>
  31. </view>
  32. <view class="floor-item-act" v-if="pros.productPromotion!=null" >
  33. <view v-if="PromotionsFormat(pros.productPromotion)" class="floor-tags" @click.stop="clickPopupShow(pros.productPromotion)">
  34. {{pros.productPromotion.name}}
  35. <text v-if ="pros.productPromotion!=null && pros.productPromotion.type !=3">
  36. :¥{{ pros.productPromotion == null ? '0.00' : pros.productPromotion.touchPrice | NumFormat}}
  37. </text>
  38. </view>
  39. <view v-else-if="pros.productPromotion.type !=3" class="floor-tags" @click.stop="clickPopupShow(pros.productPromotion)">{{pros.productPromotion.name}}</view>
  40. </view>
  41. <view class="product-view">
  42. <view class="view-num right">x {{pros.num}}</view>
  43. </view>
  44. </view>
  45. </view>
  46. <view class=" product-info">
  47. <view class="product-view" v-if="pros.returnedNum>0 || pros.actualCancelNum>0">
  48. <view class="view-num">已退货/已取消</view>
  49. <view class="view-right">{{pros.returnedNum}}/{{pros.actualCancelNum}}</view>
  50. </view>
  51. <view class="product-view">
  52. <view class="view-num">折扣</view>
  53. <view class="view-right">{{pros.discount == null ? '0' : pros.discount}}%</view>
  54. </view>
  55. <view class="product-view">
  56. <view class="view-num">税率</view>
  57. <view class="view-right">{{pros.taxRate}}%</view>
  58. </view>
  59. <view class="product-view">
  60. <view class="view-num">折后单价</view>
  61. <view class="view-right">¥{{pros.discountPrice | NumFormat}}</view>
  62. </view>
  63. <view class="product-view allPrice">
  64. <view class="view-num">合计</view>
  65. <view class="view-right">¥{{pros.totalFee | NumFormat}}</view>
  66. </view>
  67. </view>
  68. </view>
  69. <view class="goods-pros-m" v-if="item.note">
  70. <view class="m-text">留言:</view>
  71. <view class="m-input">
  72. <view class="text">{{item.note ? item.note : ''}}</view>
  73. </view>
  74. </view>
  75. <view class="goods-pros-b">
  76. <view class="count">共{{item.itemCount}}件商品</view>
  77. <view class="sum">
  78. <view class="sum-none" v-if="item.promotionFullReduction>0">
  79. <text class="money-sign">¥</text>
  80. <text class="money">{{ (item.totalAmount+item.promotionFullReduction) | NumFormat }}</text>
  81. <text class="money-reduced">减<text>¥{{ (item.promotionFullReduction) | NumFormat}}</text></text>
  82. </view>
  83. <view class="sum-money" :class="item.promotionFullReduction == 0 ? 'none' : ''">
  84. 商品总额:<text class="money">¥{{item.totalAmount | NumFormat}}</text>
  85. </view>
  86. </view>
  87. </view>
  88. </view>
  89. </view>
  90. </view>
  91. </template>
  92. <script>
  93. export default{
  94. name:'goods',
  95. props:{
  96. shopOrderData:{
  97. type:Array
  98. },
  99. information:{
  100. type:Object
  101. }
  102. },
  103. data() {
  104. return{
  105. initData:[],
  106. }
  107. },
  108. created(){
  109. this.initData = this.shopOrderData
  110. },
  111. filters:{
  112. NumFormat(value) {//处理金额
  113. return Number(value).toFixed(2)
  114. },
  115. formatIncludedTax(value) {
  116. if (value === '1') {
  117. return '不含税 '
  118. } else if (value === '2') {
  119. return '含税'
  120. } else {
  121. return ''
  122. }
  123. },
  124. },
  125. computed: {
  126. },
  127. methods:{
  128. goShophome(id){
  129. this.$api.navigateTo(`/pages/supplier/user/my-shop?shopId=${id}`)
  130. },
  131. details(pros){
  132. if(pros.validFlag == 9){
  133. return
  134. }else{
  135. this.$api.navigateTo(`/pages/goods/product?id=${pros.productId}`)
  136. }
  137. },
  138. clickPopupShow(pros){
  139. console.log(pros)
  140. this.$emit('popupClick',pros)
  141. },
  142. PromotionsFormat(promo){//促销活动类型数据处理
  143. if(promo!=null){
  144. if(promo.type == 1 && promo.mode == 1){
  145. return true
  146. }else{
  147. return false
  148. }
  149. }
  150. return false
  151. },
  152. }
  153. }
  154. </script>
  155. <style lang="scss">
  156. .goods-template{
  157. width: 100%;
  158. height: auto;
  159. background: #FFFFFF;
  160. float: left;
  161. margin-top: 24rpx;
  162. .goods-list{
  163. width: 100%;
  164. height: auto;
  165. background: #F7F7F7;
  166. .goods-item{
  167. width: 702rpx;
  168. padding:24rpx;
  169. height: auto;
  170. background: #FFFFFF;
  171. margin-bottom: 24rpx;
  172. &:last-child{
  173. margin-bottom: 0;
  174. }
  175. }
  176. .shoptitle{
  177. width: 100%;
  178. float: left;
  179. height: 56rpx;
  180. line-height: 56rpx;
  181. margin-bottom: 12rpx;
  182. .floor-item-act{
  183. height: 56rpx;
  184. text-align: center;
  185. box-sizing: border-box;
  186. float: left;
  187. padding: 10rpx 0;
  188. margin-right: 12rpx;
  189. .floor-tags{
  190. height: 28rpx;
  191. border-radius: 6rpx;
  192. background-color: #FFFFFF;
  193. line-height: 28rpx;
  194. color: $color-system;
  195. text-align: center;
  196. display: inline-block;
  197. padding:0 6rpx;
  198. font-size: $font-size-20;
  199. border: 1px solid #E15616;
  200. float: left;
  201. }
  202. }
  203. .title-text{
  204. width: 400rpx;
  205. overflow: hidden;
  206. text-overflow:ellipsis;
  207. white-space: nowrap;
  208. float: left;
  209. font-size: $font-size-28;
  210. color: $text-color;
  211. text-align: left;
  212. line-height: 56rpx;
  213. font-weight: bold;
  214. .iconfont{
  215. color: #999999;
  216. font-size: 28rpx;
  217. margin-left: 10rpx;
  218. }
  219. .paymenttext{
  220. color: #f9a94b;
  221. font-size: $font-size-22;
  222. margin-left: 20rpx;
  223. }
  224. }
  225. }
  226. .productlist{
  227. width: 100%;
  228. height: auto;
  229. border-bottom: 2rpx solid #e1e1e1;
  230. padding: 10rpx;
  231. box-sizing: border-box;
  232. }
  233. .goods-pros-t{
  234. display: flex;
  235. width: 100%;
  236. height: auto;
  237. margin: 20rpx 0;
  238. .pros-left{
  239. width: 210rpx;
  240. height: 100%;
  241. margin:0 26rpx 0 0;
  242. }
  243. .pros-img{
  244. width: 210rpx;
  245. height: 210rpx;
  246. border-radius: 10rpx;
  247. border:1px solid #f3f3f3;
  248. position: relative;
  249. .tips{
  250. display: inline-block;
  251. width: 80rpx;
  252. height: 40rpx;
  253. background-image: linear-gradient(214deg, #ff4500 0%, #ff5800 53%, #ff4367 100%);
  254. line-height: 40rpx;
  255. text-align: center;
  256. font-size: $font-size-24;
  257. color: #FFFFFF;
  258. border-radius:10rpx 0 10rpx 0 ;
  259. position: absolute;
  260. top:0;
  261. left: 0;
  262. }
  263. image{
  264. width: 210rpx;
  265. height: 210rpx;
  266. border-radius: 10rpx;
  267. }
  268. }
  269. }
  270. .product-info{
  271. padding: 10rpx 0;
  272. .product-view{
  273. font-size:$font-size-24;
  274. color: #999999;
  275. overflow: hidden;
  276. height: 44rpx;
  277. line-height: 44rpx;
  278. .view-num{
  279. float: left;
  280. }
  281. .view-right{
  282. color: #666666;
  283. float: right;
  284. }
  285. }
  286. }
  287. .pros-product{
  288. width: 468rpx;
  289. height: 100%;
  290. line-height: 36rpx;
  291. font-size: $font-size-26;
  292. position: relative;
  293. .product-view{
  294. &.allPrice{
  295. width: 100%;
  296. }
  297. .view-num{
  298. flex: 1;
  299. text-align: left;
  300. font-size: $font-size-26;
  301. color: #999999;
  302. line-height: 44rpx;
  303. float: left;
  304. &.right{
  305. float: right;
  306. }
  307. &.red{
  308. color: #FF2000;
  309. font-weight: bold;
  310. }
  311. }
  312. }
  313. .producttitle{
  314. width: 100%;
  315. display: inline-block;
  316. height: auto;
  317. text-overflow:ellipsis;
  318. display: -webkit-box;
  319. word-break: break-all;
  320. -webkit-box-orient: vertical;
  321. -webkit-line-clamp: 2;
  322. overflow: hidden;
  323. margin-bottom: 8rpx;
  324. }
  325. .productspec{
  326. height: 44rpx;
  327. color: #999999;
  328. line-height: 44rpx;
  329. text-overflow:ellipsis;
  330. display: -webkit-box;
  331. word-break: break-all;
  332. -webkit-box-orient: vertical;
  333. -webkit-line-clamp: 1;
  334. overflow: hidden;
  335. }
  336. .productprice{
  337. height: 48rpx;
  338. position: absolute;
  339. width: 100%;
  340. bottom: 0;
  341. .price{
  342. line-height: 48rpx;
  343. font-size: $font-size-28;
  344. width: 48%;
  345. color: #FF2A2A;
  346. float: left;
  347. }
  348. .count{
  349. height: 100%;
  350. float: right;
  351. position: relative;
  352. .small{
  353. color: #666666;
  354. }
  355. }
  356. }
  357. .floor-item-act{
  358. width: 100%;
  359. height: 56rpx;
  360. text-align: center;
  361. box-sizing: border-box;
  362. float: left;
  363. padding:10rpx 0 0 0;
  364. .floor-tags{
  365. height: 28rpx;
  366. border-radius: 6rpx;
  367. background-color: #FFFFFF;
  368. line-height: 28rpx;
  369. color: $color-system;
  370. text-align: center;
  371. display: inline-block;
  372. padding:0 16rpx;
  373. font-size: $font-size-20;
  374. border: 1px solid #E15616;
  375. float: left;
  376. }
  377. }
  378. .floor-item-act{
  379. height: 56rpx;
  380. text-align: center;
  381. box-sizing: border-box;
  382. float: left;
  383. padding: 10rpx 0;
  384. margin-right: 12rpx;
  385. .floor-tags{
  386. float: left;
  387. height: 28rpx;
  388. border-radius: 6rpx;
  389. background-color: #FFFFFF;
  390. line-height: 28rpx;
  391. color: $color-system;
  392. text-align: center;
  393. display: inline-block;
  394. padding:0 16rpx;
  395. font-size: $font-size-20;
  396. border: 1px solid #E15616;
  397. }
  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>