goodsList.vue 11 KB

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