goodsList.vue 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395
  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">
  41. :¥{{ pros.productPromotion == null ? '0.00' : pros.productPromotion.touchPrice | NumFormat}}
  42. </text>
  43. </view>
  44. <view v-else 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 | 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. align-items: center;
  183. width: 100%;
  184. height: auto;
  185. padding: 12rpx 0;
  186. .pros-left{
  187. width: 210rpx;
  188. height: 100%;
  189. margin:0 26rpx 0 0;
  190. }
  191. .pros-img{
  192. width: 210rpx;
  193. height: 210rpx;
  194. border-radius: 10rpx;
  195. border:1px solid #f3f3f3;
  196. position: relative;
  197. .tips{
  198. display: inline-block;
  199. width: 80rpx;
  200. height: 40rpx;
  201. background-image: linear-gradient(214deg, #ff4500 0%, #ff5800 53%, #ff4367 100%);
  202. line-height: 40rpx;
  203. text-align: center;
  204. font-size: $font-size-24;
  205. color: #FFFFFF;
  206. border-radius:10rpx 0 10rpx 0 ;
  207. position: absolute;
  208. top:0;
  209. left: 0;
  210. }
  211. image{
  212. width: 210rpx;
  213. height: 210rpx;
  214. border-radius: 10rpx;
  215. }
  216. }
  217. }
  218. .pros-product{
  219. width: 468rpx;
  220. height: 100%;
  221. line-height: 36rpx;
  222. font-size: $font-size-26;
  223. position: relative;
  224. .product-view{
  225. width: 100%;
  226. height: auto;
  227. display: flex;
  228. .view-num{
  229. flex: 1;
  230. text-align: left;
  231. font-size: $font-size-26;
  232. color: #666666;
  233. line-height: 44rpx;
  234. }
  235. }
  236. .producttitle{
  237. width: 100%;
  238. display: inline-block;
  239. height: auto;
  240. text-overflow:ellipsis;
  241. display: -webkit-box;
  242. word-break: break-all;
  243. -webkit-box-orient: vertical;
  244. -webkit-line-clamp: 2;
  245. overflow: hidden;
  246. margin-bottom: 8rpx;
  247. }
  248. .productspec{
  249. height: 44rpx;
  250. color: #666666;
  251. line-height: 44rpx;
  252. }
  253. .productprice{
  254. height: 48rpx;
  255. position: absolute;
  256. width: 100%;
  257. bottom: 0;
  258. .price{
  259. line-height: 48rpx;
  260. font-size: $font-size-28;
  261. width: 48%;
  262. color: #FF2A2A;
  263. float: left;
  264. }
  265. .count{
  266. height: 100%;
  267. float: right;
  268. position: relative;
  269. .small{
  270. color: #666666;
  271. }
  272. }
  273. }
  274. .floor-item-act{
  275. width: 100%;
  276. height: 56rpx;
  277. text-align: center;
  278. box-sizing: border-box;
  279. float: left;
  280. padding:10rpx 0 0 0;
  281. .floor-tags{
  282. float: left;
  283. height: 36rpx;
  284. border-radius: 4rpx;
  285. background-color: rgba(225, 86, 22, 0.1);
  286. line-height: 36rpx;
  287. color: $color-system;
  288. text-align: center;
  289. display: inline-block;
  290. padding:0 16rpx;
  291. font-size: $font-size-20;
  292. }
  293. }
  294. }
  295. .goods-pros-m{
  296. width: 100%;
  297. height: auto;
  298. line-height: 76rpx;
  299. font-size: $font-size-26;
  300. color: $text-color;
  301. float: left;
  302. .m-text{
  303. width: 62rpx;
  304. float: left;
  305. padding-right: 20rpx;
  306. font-weight:bold;
  307. }
  308. .m-input{
  309. display: -webkit-box;
  310. display: -webkit-flex;
  311. display: flex;
  312. -webkit-box-align: center;
  313. -webkit-align-items: center;
  314. align-items: center;
  315. position: relative;
  316. width: 620rpx;
  317. height: auto;
  318. padding: 20rpx 0 10rpx 0;
  319. background: #FFFFFF;
  320. .text{
  321. width: 100%;
  322. height: 100%;
  323. font-size: $font-size-26;
  324. line-height: 36rpx;
  325. color: #333333;
  326. }
  327. }
  328. }
  329. .goods-pros-b{
  330. width:100%;
  331. height: 80rpx;
  332. margin-top: 12rpx;
  333. float: left;
  334. .count{
  335. float: left;
  336. font-size: $font-size-28;
  337. line-height: 80rpx;
  338. color: $text-color;
  339. display: flex;
  340. justify-content: flex-end;
  341. }
  342. .sum{
  343. width: 530rpx;
  344. float: right;
  345. .sum-none{
  346. width: 100%;
  347. height: 40rpx;
  348. line-height: 40rpx;
  349. color: $text-color;
  350. float: left;
  351. text-align: right;
  352. .money{
  353. font-size: $font-size-26;
  354. color: #999999;
  355. text-decoration: line-through;
  356. }
  357. .money-sign{
  358. font-size: $font-size-26;
  359. color: #999999;
  360. text-decoration: line-through;
  361. }
  362. .money-reduced{
  363. margin-left: 10rpx;
  364. font-size: $font-size-26;
  365. color: $color-system;
  366. .iconfont{
  367. font-size: $font-size-34;
  368. }
  369. }
  370. }
  371. .sum-money{
  372. width: 100%;
  373. height: 40rpx;
  374. font-size: $font-size-28;
  375. line-height: 40rpx;
  376. color: $text-color;
  377. display: flex;
  378. justify-content: flex-end;
  379. &.none{
  380. height: 80rpx;
  381. line-height: 80rpx;
  382. }
  383. .money{
  384. color: #FF2A2A;
  385. font-size: $font-size-28;
  386. }
  387. }
  388. }
  389. }
  390. }
  391. }
  392. </style>