goodsList.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467
  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. box-sizing: border-box;
  202. }
  203. .goods-pros-t{
  204. display: flex;
  205. width: 100%;
  206. height: auto;
  207. margin: 20rpx 0;
  208. .pros-left{
  209. width: 210rpx;
  210. height: 100%;
  211. margin:0 26rpx 0 0;
  212. }
  213. .pros-img{
  214. width: 210rpx;
  215. height: 210rpx;
  216. border-radius: 10rpx;
  217. border:1px solid #f3f3f3;
  218. position: relative;
  219. .tips{
  220. display: inline-block;
  221. width: 80rpx;
  222. height: 40rpx;
  223. background-image: linear-gradient(214deg, #ff4500 0%, #ff5800 53%, #ff4367 100%);
  224. line-height: 40rpx;
  225. text-align: center;
  226. font-size: $font-size-24;
  227. color: #FFFFFF;
  228. border-radius:10rpx 0 10rpx 0 ;
  229. position: absolute;
  230. top:0;
  231. left: 0;
  232. }
  233. image{
  234. width: 210rpx;
  235. height: 210rpx;
  236. border-radius: 10rpx;
  237. }
  238. }
  239. }
  240. .product-info{
  241. padding: 10rpx 0;
  242. .product-view{
  243. font-size:$font-size-24;
  244. color: #999999;
  245. overflow: hidden;
  246. height: 44rpx;
  247. line-height: 44rpx;
  248. .view-num{
  249. float: left;
  250. }
  251. .view-right{
  252. color: #666666;
  253. float: right;
  254. }
  255. }
  256. }
  257. .pros-product{
  258. width: 468rpx;
  259. height: 100%;
  260. line-height: 36rpx;
  261. font-size: $font-size-26;
  262. position: relative;
  263. .product-view{
  264. &.allPrice{
  265. width: 100%;
  266. }
  267. .view-num{
  268. flex: 1;
  269. text-align: left;
  270. font-size: $font-size-26;
  271. color: #999999;
  272. line-height: 44rpx;
  273. float: left;
  274. &.right{
  275. float: right;
  276. }
  277. &.red{
  278. color: #FF2000;
  279. font-weight: bold;
  280. }
  281. }
  282. }
  283. .producttitle{
  284. width: 100%;
  285. display: inline-block;
  286. height: auto;
  287. text-overflow:ellipsis;
  288. display: -webkit-box;
  289. word-break: break-all;
  290. -webkit-box-orient: vertical;
  291. -webkit-line-clamp: 2;
  292. overflow: hidden;
  293. margin-bottom: 8rpx;
  294. }
  295. .productspec{
  296. height: 44rpx;
  297. color: #999999;
  298. line-height: 44rpx;
  299. }
  300. .productprice{
  301. height: 48rpx;
  302. position: absolute;
  303. width: 100%;
  304. bottom: 0;
  305. .price{
  306. line-height: 48rpx;
  307. font-size: $font-size-28;
  308. width: 48%;
  309. color: #FF2A2A;
  310. float: left;
  311. }
  312. .count{
  313. height: 100%;
  314. float: right;
  315. position: relative;
  316. .small{
  317. color: #666666;
  318. }
  319. }
  320. }
  321. .floor-item-act{
  322. width: 100%;
  323. height: 56rpx;
  324. text-align: center;
  325. box-sizing: border-box;
  326. float: left;
  327. padding:10rpx 0 0 0;
  328. .floor-tags{
  329. height: 28rpx;
  330. border-radius: 6rpx;
  331. background-color: #FFFFFF;
  332. line-height: 28rpx;
  333. color: $color-system;
  334. text-align: center;
  335. display: inline-block;
  336. padding:0 16rpx;
  337. font-size: $font-size-20;
  338. border: 1px solid #E15616;
  339. float: left;
  340. }
  341. }
  342. .floor-item-act{
  343. height: 56rpx;
  344. text-align: center;
  345. box-sizing: border-box;
  346. float: left;
  347. padding: 10rpx 0;
  348. margin-right: 12rpx;
  349. .floor-tags{
  350. float: left;
  351. height: 28rpx;
  352. border-radius: 6rpx;
  353. background-color: #FFFFFF;
  354. line-height: 28rpx;
  355. color: $color-system;
  356. text-align: center;
  357. display: inline-block;
  358. padding:0 16rpx;
  359. font-size: $font-size-20;
  360. border: 1px solid #E15616;
  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>