goodsList.vue 10 KB

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