goodsList.vue 11 KB

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