goodsList.vue 9.6 KB

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