goodsList.vue 11 KB

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