goodsList.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465
  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="product-view">
  28. <view class="view-num right">x {{pros.num}}</view>
  29. </view>
  30. </view>
  31. </view>
  32. <view class=" product-info">
  33. <view class="product-view" v-if="pros.returnedNum>0 || pros.actualCancelNum>0">
  34. <view class="view-num">已退货/已取消</view>
  35. <view class="view-right">{{pros.returnedNum}}/{{pros.actualCancelNum}}</view>
  36. </view>
  37. <view class="product-view">
  38. <view class="view-num">折扣</view>
  39. <view class="view-right">{{pros.discount == null ? '0' : pros.discount}}%</view>
  40. </view>
  41. <view class="product-view">
  42. <view class="view-num">税率</view>
  43. <view class="view-right">{{pros.taxRate}}%</view>
  44. </view>
  45. <view class="product-view">
  46. <view class="view-num">折后单价</view>
  47. <view class="view-right">¥{{pros.discountPrice | NumFormat}}</view>
  48. </view>
  49. <view class="floor-item-act" v-if="pros.productPromotion!=null" >
  50. <view v-if="PromotionsFormat(pros.productPromotion)" class="floor-tags" @click.stop="clickPopupShow(pros.productPromotion)">
  51. {{pros.productPromotion.name}}
  52. <text v-if ="pros.productPromotion!=null && pros.productPromotion.type !=3">
  53. :¥{{ pros.productPromotion == null ? '0.00' : pros.productPromotion.touchPrice | NumFormat}}
  54. </text>
  55. </view>
  56. <view v-else-if="pros.productPromotion.type !=3" class="floor-tags" @click.stop="clickPopupShow(pros.productPromotion)">{{pros.productPromotion.name}}</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. .floor-item-act{
  191. height: 56rpx;
  192. text-align: center;
  193. box-sizing: border-box;
  194. float: left;
  195. padding: 10rpx 0;
  196. margin-right: 12rpx;
  197. .floor-tags{
  198. float: left;
  199. height: 36rpx;
  200. border-radius: 6rpx;
  201. background-color: #FFFFFF;
  202. line-height: 36rpx;
  203. color: $color-system;
  204. text-align: center;
  205. display: inline-block;
  206. padding:0 16rpx;
  207. font-size: $font-size-20;
  208. margin-left: 15rpx;
  209. border: 1px solid #E15616;
  210. }
  211. }
  212. }
  213. .productlist{
  214. width: 100%;
  215. height: auto;
  216. border-bottom: 2rpx solid #e1e1e1;
  217. padding: 10rpx;
  218. }
  219. .goods-pros-t{
  220. display: flex;
  221. width: 100%;
  222. height: auto;
  223. margin: 20rpx 0;
  224. .pros-left{
  225. width: 210rpx;
  226. height: 100%;
  227. margin:0 26rpx 0 0;
  228. }
  229. .pros-img{
  230. width: 210rpx;
  231. height: 210rpx;
  232. border-radius: 10rpx;
  233. border:1px solid #f3f3f3;
  234. position: relative;
  235. .tips{
  236. display: inline-block;
  237. width: 80rpx;
  238. height: 40rpx;
  239. background-image: linear-gradient(214deg, #ff4500 0%, #ff5800 53%, #ff4367 100%);
  240. line-height: 40rpx;
  241. text-align: center;
  242. font-size: $font-size-24;
  243. color: #FFFFFF;
  244. border-radius:10rpx 0 10rpx 0 ;
  245. position: absolute;
  246. top:0;
  247. left: 0;
  248. }
  249. image{
  250. width: 210rpx;
  251. height: 210rpx;
  252. border-radius: 10rpx;
  253. }
  254. }
  255. }
  256. .product-info{
  257. // border-top: 2rpx solid #e1e1e1;
  258. padding: 10rpx 0;
  259. .product-view{
  260. font-size:$font-size-24;
  261. color: #999999;
  262. overflow: hidden;
  263. height: 44rpx;
  264. line-height: 44rpx;
  265. .view-num{
  266. float: left;
  267. }
  268. .view-right{
  269. color: #666666;
  270. float: right;
  271. }
  272. }
  273. }
  274. .pros-product{
  275. width: 468rpx;
  276. height: 100%;
  277. line-height: 36rpx;
  278. font-size: $font-size-26;
  279. position: relative;
  280. .product-view{
  281. // width: 50%;
  282. // height: auto;
  283. // display: flex;
  284. // display: inline-block;
  285. &.allPrice{
  286. width: 100%;
  287. }
  288. .view-num{
  289. flex: 1;
  290. text-align: left;
  291. font-size: $font-size-26;
  292. color: #999999;
  293. line-height: 44rpx;
  294. float: left;
  295. &.right{
  296. float: right;
  297. }
  298. &.red{
  299. color: #FF2000;
  300. font-weight: bold;
  301. }
  302. }
  303. }
  304. .producttitle{
  305. width: 100%;
  306. display: inline-block;
  307. height: auto;
  308. text-overflow:ellipsis;
  309. display: -webkit-box;
  310. word-break: break-all;
  311. -webkit-box-orient: vertical;
  312. -webkit-line-clamp: 2;
  313. overflow: hidden;
  314. margin-bottom: 8rpx;
  315. }
  316. .productspec{
  317. height: 44rpx;
  318. color: #999999;
  319. line-height: 44rpx;
  320. margin: 20rpx 0;
  321. }
  322. .productprice{
  323. height: 48rpx;
  324. position: absolute;
  325. width: 100%;
  326. bottom: 0;
  327. .price{
  328. line-height: 48rpx;
  329. font-size: $font-size-28;
  330. width: 48%;
  331. color: #FF2A2A;
  332. float: left;
  333. }
  334. .count{
  335. height: 100%;
  336. float: right;
  337. position: relative;
  338. .small{
  339. color: #666666;
  340. }
  341. }
  342. }
  343. .floor-item-act{
  344. width: 100%;
  345. height: 56rpx;
  346. text-align: center;
  347. box-sizing: border-box;
  348. float: left;
  349. padding:10rpx 0 0 0;
  350. .floor-tags{
  351. float: left;
  352. height: 36rpx;
  353. border-radius: 4rpx;
  354. background-color: rgba(225, 86, 22, 0.1);
  355. line-height: 36rpx;
  356. color: $color-system;
  357. text-align: center;
  358. display: inline-block;
  359. padding:0 16rpx;
  360. font-size: $font-size-20;
  361. }
  362. }
  363. }
  364. .goods-pros-m{
  365. width: 100%;
  366. height: auto;
  367. line-height: 76rpx;
  368. font-size: $font-size-26;
  369. color: $text-color;
  370. float: left;
  371. .m-text{
  372. width: 62rpx;
  373. float: left;
  374. padding-right: 20rpx;
  375. font-weight:bold;
  376. }
  377. .m-input{
  378. display: -webkit-box;
  379. display: -webkit-flex;
  380. display: flex;
  381. -webkit-box-align: center;
  382. -webkit-align-items: center;
  383. align-items: center;
  384. position: relative;
  385. width: 620rpx;
  386. height: auto;
  387. padding: 20rpx 0 10rpx 0;
  388. background: #FFFFFF;
  389. .text{
  390. width: 100%;
  391. height: 100%;
  392. font-size: $font-size-26;
  393. line-height: 36rpx;
  394. color: #333333;
  395. }
  396. }
  397. }
  398. .goods-pros-b{
  399. width:100%;
  400. height: 80rpx;
  401. margin-top: 12rpx;
  402. float: left;
  403. .count{
  404. float: left;
  405. font-size: $font-size-26;
  406. line-height: 80rpx;
  407. color: $text-color;
  408. display: flex;
  409. justify-content: flex-end;
  410. font-weight: bold;
  411. }
  412. .sum{
  413. width: 520rpx;
  414. float: right;
  415. .sum-none{
  416. width: 100%;
  417. height: 40rpx;
  418. line-height: 40rpx;
  419. color: $text-color;
  420. float: left;
  421. text-align: right;
  422. .money{
  423. font-size: $font-size-26;
  424. color: #999999;
  425. text-decoration: line-through;
  426. }
  427. .money-sign{
  428. font-size: $font-size-26;
  429. color: #999999;
  430. text-decoration: line-through;
  431. }
  432. .money-reduced{
  433. margin-left: 10rpx;
  434. font-size: $font-size-26;
  435. color: $color-system;
  436. .iconfont{
  437. font-size: $font-size-34;
  438. }
  439. }
  440. }
  441. .sum-money{
  442. width: 100%;
  443. height: 40rpx;
  444. font-size: $font-size-28;
  445. line-height: 40rpx;
  446. color: $text-color;
  447. display: flex;
  448. justify-content: flex-end;
  449. &.none{
  450. height: 80rpx;
  451. line-height: 80rpx;
  452. }
  453. .money{
  454. color: #FF2A2A;
  455. font-size: $font-size-28;
  456. }
  457. }
  458. }
  459. }
  460. }
  461. }
  462. </style>