goodsList.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411
  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">
  25. 单价:¥{{pros.price | NumFormat}}
  26. <text class="red" v-show="pros.includedTaxFlag ==='1' || pros.includedTaxFlag === '2'">({{ pros.includedTaxFlag | formatIncludedTax }})</text>
  27. </view>
  28. </view>
  29. <view class="product-view">
  30. <view class="view-num">数量:{{pros.num}}</view>
  31. </view>
  32. <view class="product-view" v-if="pros.returnedNum>0 || pros.actualCancelNum>0">
  33. <view class="view-num">已退货/已取消:{{pros.returnedNum}}/{{pros.actualCancelNum}}</view>
  34. </view>
  35. <view class="product-view">
  36. <view class="view-num">税率:{{pros.taxRate}}%</view>
  37. <view class="view-num">折扣:{{pros.discount == null ? '0' : pros.discount}}%</view>
  38. </view>
  39. <view class="product-view">
  40. <view class="view-num">折后单价:¥{{pros.discountPrice | NumFormat}}</view>
  41. </view>
  42. <view class="floor-item-act" v-if="pros.productPromotion!=null" >
  43. <view v-if="PromotionsFormat(pros.productPromotion)" class="floor-tags" @click.stop="clickPopupShow(pros.productPromotion)">
  44. {{pros.productPromotion.name}}
  45. <text v-if ="pros.productPromotion!=null && pros.productPromotion.type !=3">
  46. :¥{{ pros.productPromotion == null ? '0.00' : pros.productPromotion.touchPrice | NumFormat}}
  47. </text>
  48. </view>
  49. <view v-else-if="pros.productPromotion.type !=3" class="floor-tags" @click.stop="clickPopupShow(pros.productPromotion)">{{pros.productPromotion.name}}</view>
  50. </view>
  51. <view class="product-view">
  52. <view class="view-num">合计:¥{{pros.totalFee | NumFormat}}</view>
  53. </view>
  54. </view>
  55. </view>
  56. </view>
  57. <view class="goods-pros-m" v-if="item.note!=''">
  58. <view class="m-text">留言:</view>
  59. <view class="m-input">
  60. <view class="text">{{item.note ? item.note : ''}}</view>
  61. </view>
  62. </view>
  63. <view class="goods-pros-b">
  64. <view class="count">共{{item.itemCount}}件商品</view>
  65. <view class="sum">
  66. <view class="sum-none" v-if="item.promotionFullReduction>0">
  67. <text class="money-sign">¥</text>
  68. <text class="money">{{ (item.totalAmount+item.promotionFullReduction) | NumFormat }}</text>
  69. <text class="money-reduced">减<text>¥{{ (item.promotionFullReduction) | NumFormat}}</text></text>
  70. </view>
  71. <view class="sum-money" :class="item.promotionFullReduction == 0 ? 'none' : ''">
  72. 商品总额:<text class="money">¥{{item.totalAmount | NumFormat}}</text>
  73. </view>
  74. </view>
  75. </view>
  76. </view>
  77. </view>
  78. </view>
  79. </template>
  80. <script>
  81. export default{
  82. name:"goods",
  83. props:{
  84. shopOrderData:{
  85. type:Array
  86. }
  87. },
  88. data() {
  89. return{
  90. initData:[],
  91. }
  92. },
  93. created(){
  94. this.initData = this.shopOrderData
  95. },
  96. filters:{
  97. NumFormat(value) {//处理金额
  98. return Number(value).toFixed(2);
  99. },
  100. formatIncludedTax(value) {
  101. if (value === '1') {
  102. return '不含税 ';
  103. } else if (value === '2') {
  104. return '含税';
  105. } else {
  106. return '';
  107. }
  108. },
  109. },
  110. computed: {
  111. },
  112. methods:{
  113. clickPopupShow(pros){
  114. console.log(pros)
  115. this.$emit('popupClick',pros)
  116. },
  117. PromotionsFormat(promo){//促销活动类型数据处理
  118. if(promo!=null){
  119. if(promo.type == 1 && promo.mode == 1){
  120. return true
  121. }else{
  122. return false
  123. }
  124. }
  125. return false
  126. },
  127. }
  128. }
  129. </script>
  130. <style lang="scss">
  131. .goods-template{
  132. width: 100%;
  133. height: auto;
  134. background: #FFFFFF;
  135. float: left;
  136. margin-top: 24rpx;
  137. .goods-list{
  138. width: 100%;
  139. height: auto;
  140. background: #F7F7F7;
  141. .goods-item{
  142. width: 702rpx;
  143. padding:24rpx;
  144. height: auto;
  145. background: #FFFFFF;
  146. margin-bottom: 24rpx;
  147. &:last-child{
  148. margin-bottom: 0;
  149. }
  150. }
  151. .shoptitle{
  152. width: 100%;
  153. float: left;
  154. height: 56rpx;
  155. line-height: 56rpx;
  156. margin-bottom: 12rpx;
  157. .title-text{
  158. width: 400rpx;
  159. overflow: hidden;
  160. text-overflow:ellipsis;
  161. white-space: nowrap;
  162. float: left;
  163. font-size: $font-size-28;
  164. color: $text-color;
  165. text-align: left;
  166. line-height: 56rpx;
  167. font-weight: bold;
  168. }
  169. .floor-item-act{
  170. height: 56rpx;
  171. text-align: center;
  172. box-sizing: border-box;
  173. float: left;
  174. padding: 10rpx 0;
  175. margin-right: 12rpx;
  176. .floor-tags{
  177. float: left;
  178. height: 36rpx;
  179. border-radius: 4rpx;
  180. background-color: rgba(225, 86, 22, 0.1);
  181. line-height: 36rpx;
  182. color: $color-system;
  183. text-align: center;
  184. display: inline-block;
  185. padding:0 16rpx;
  186. font-size: $font-size-20;
  187. }
  188. }
  189. }
  190. .productlist{
  191. width: 100%;
  192. height: auto;
  193. }
  194. .goods-pros-t{
  195. display: flex;
  196. width: 100%;
  197. height: auto;
  198. padding: 12rpx 0;
  199. .pros-left{
  200. width: 210rpx;
  201. height: 100%;
  202. margin:0 26rpx 0 0;
  203. }
  204. .pros-img{
  205. width: 210rpx;
  206. height: 210rpx;
  207. border-radius: 10rpx;
  208. border:1px solid #f3f3f3;
  209. position: relative;
  210. .tips{
  211. display: inline-block;
  212. width: 80rpx;
  213. height: 40rpx;
  214. background-image: linear-gradient(214deg, #ff4500 0%, #ff5800 53%, #ff4367 100%);
  215. line-height: 40rpx;
  216. text-align: center;
  217. font-size: $font-size-24;
  218. color: #FFFFFF;
  219. border-radius:10rpx 0 10rpx 0 ;
  220. position: absolute;
  221. top:0;
  222. left: 0;
  223. }
  224. image{
  225. width: 210rpx;
  226. height: 210rpx;
  227. border-radius: 10rpx;
  228. }
  229. }
  230. }
  231. .pros-product{
  232. width: 468rpx;
  233. height: 100%;
  234. line-height: 36rpx;
  235. font-size: $font-size-26;
  236. position: relative;
  237. .product-view{
  238. width: 100%;
  239. height: auto;
  240. display: flex;
  241. .view-num{
  242. flex: 1;
  243. text-align: left;
  244. font-size: $font-size-26;
  245. color: #666666;
  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: #666666;
  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. .count{
  351. float: left;
  352. font-size: $font-size-28;
  353. line-height: 80rpx;
  354. color: $text-color;
  355. display: flex;
  356. justify-content: flex-end;
  357. }
  358. .sum{
  359. width: 530rpx;
  360. float: right;
  361. .sum-none{
  362. width: 100%;
  363. height: 40rpx;
  364. line-height: 40rpx;
  365. color: $text-color;
  366. float: left;
  367. text-align: right;
  368. .money{
  369. font-size: $font-size-26;
  370. color: #999999;
  371. text-decoration: line-through;
  372. }
  373. .money-sign{
  374. font-size: $font-size-26;
  375. color: #999999;
  376. text-decoration: line-through;
  377. }
  378. .money-reduced{
  379. margin-left: 10rpx;
  380. font-size: $font-size-26;
  381. color: $color-system;
  382. .iconfont{
  383. font-size: $font-size-34;
  384. }
  385. }
  386. }
  387. .sum-money{
  388. width: 100%;
  389. height: 40rpx;
  390. font-size: $font-size-28;
  391. line-height: 40rpx;
  392. color: $text-color;
  393. display: flex;
  394. justify-content: flex-end;
  395. &.none{
  396. height: 80rpx;
  397. line-height: 80rpx;
  398. }
  399. .money{
  400. color: #FF2A2A;
  401. font-size: $font-size-28;
  402. }
  403. }
  404. }
  405. }
  406. }
  407. }
  408. </style>