goodsList.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413
  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">
  51. <view class="view-num">合计:¥{{pros.totalFee | NumFormat}}</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. .view-num{
  242. flex: 1;
  243. text-align: left;
  244. font-size: $font-size-26;
  245. color: #999999;
  246. line-height: 44rpx;
  247. .red{
  248. color: #FF2000;
  249. }
  250. }
  251. }
  252. .producttitle{
  253. width: 100%;
  254. display: inline-block;
  255. height: auto;
  256. text-overflow:ellipsis;
  257. display: -webkit-box;
  258. word-break: break-all;
  259. -webkit-box-orient: vertical;
  260. -webkit-line-clamp: 2;
  261. overflow: hidden;
  262. margin-bottom: 8rpx;
  263. }
  264. .productspec{
  265. height: 44rpx;
  266. color: #999999;
  267. line-height: 44rpx;
  268. }
  269. .productprice{
  270. height: 48rpx;
  271. position: absolute;
  272. width: 100%;
  273. bottom: 0;
  274. .price{
  275. line-height: 48rpx;
  276. font-size: $font-size-28;
  277. width: 48%;
  278. color: #FF2A2A;
  279. float: left;
  280. }
  281. .count{
  282. height: 100%;
  283. float: right;
  284. position: relative;
  285. .small{
  286. color: #666666;
  287. }
  288. }
  289. }
  290. .floor-item-act{
  291. width: 100%;
  292. height: 56rpx;
  293. text-align: center;
  294. box-sizing: border-box;
  295. float: left;
  296. padding:10rpx 0 0 0;
  297. .floor-tags{
  298. float: left;
  299. height: 36rpx;
  300. border-radius: 4rpx;
  301. background-color: rgba(225, 86, 22, 0.1);
  302. line-height: 36rpx;
  303. color: $color-system;
  304. text-align: center;
  305. display: inline-block;
  306. padding:0 16rpx;
  307. font-size: $font-size-20;
  308. }
  309. }
  310. }
  311. .goods-pros-m{
  312. width: 100%;
  313. height: auto;
  314. line-height: 76rpx;
  315. font-size: $font-size-26;
  316. color: $text-color;
  317. float: left;
  318. .m-text{
  319. width: 62rpx;
  320. float: left;
  321. padding-right: 20rpx;
  322. font-weight:bold;
  323. }
  324. .m-input{
  325. display: -webkit-box;
  326. display: -webkit-flex;
  327. display: flex;
  328. -webkit-box-align: center;
  329. -webkit-align-items: center;
  330. align-items: center;
  331. position: relative;
  332. width: 620rpx;
  333. height: auto;
  334. padding: 20rpx 0 10rpx 0;
  335. background: #FFFFFF;
  336. .text{
  337. width: 100%;
  338. height: 100%;
  339. font-size: $font-size-26;
  340. line-height: 36rpx;
  341. color: #333333;
  342. }
  343. }
  344. }
  345. .goods-pros-b{
  346. width:100%;
  347. height: 80rpx;
  348. margin-top: 12rpx;
  349. float: left;
  350. border-top: 2rpx solid #e1e1e1;
  351. .count{
  352. float: left;
  353. font-size: $font-size-28;
  354. line-height: 80rpx;
  355. color: $text-color;
  356. display: flex;
  357. justify-content: flex-end;
  358. }
  359. .sum{
  360. width: 530rpx;
  361. float: right;
  362. .sum-none{
  363. width: 100%;
  364. height: 40rpx;
  365. line-height: 40rpx;
  366. color: $text-color;
  367. float: left;
  368. text-align: right;
  369. .money{
  370. font-size: $font-size-26;
  371. color: #999999;
  372. text-decoration: line-through;
  373. }
  374. .money-sign{
  375. font-size: $font-size-26;
  376. color: #999999;
  377. text-decoration: line-through;
  378. }
  379. .money-reduced{
  380. margin-left: 10rpx;
  381. font-size: $font-size-26;
  382. color: $color-system;
  383. .iconfont{
  384. font-size: $font-size-34;
  385. }
  386. }
  387. }
  388. .sum-money{
  389. width: 100%;
  390. height: 40rpx;
  391. font-size: $font-size-28;
  392. line-height: 40rpx;
  393. color: $text-color;
  394. display: flex;
  395. justify-content: flex-end;
  396. &.none{
  397. height: 80rpx;
  398. line-height: 80rpx;
  399. }
  400. .money{
  401. color: #FF2A2A;
  402. font-size: $font-size-28;
  403. }
  404. }
  405. }
  406. }
  407. }
  408. }
  409. </style>