goodsList.vue 11 KB

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