goodsList.vue 12 KB

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