goodsList.vue 9.9 KB

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