goodsList.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451
  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)">
  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(pros){
  127. if(pros.validFlag == 9){
  128. return
  129. }else{
  130. console.log(pros)
  131. this.$api.navigateTo(`/pages/goods/product?id=${pros.organizeProductId}`)
  132. }
  133. },
  134. clickPopupShow(pros){
  135. console.log(pros)
  136. this.$emit('popupClick',pros)
  137. },
  138. PromotionsFormat(promo){//促销活动类型数据处理
  139. if(promo!=null){
  140. if(promo.type == 1 && promo.mode == 1){
  141. return true
  142. }else{
  143. return false
  144. }
  145. }
  146. return false
  147. },
  148. }
  149. }
  150. </script>
  151. <style lang="scss">
  152. .goods-template{
  153. width: 100%;
  154. height: auto;
  155. background: #FFFFFF;
  156. float: left;
  157. margin-top: 24rpx;
  158. .goods-list{
  159. width: 100%;
  160. height: auto;
  161. background: #F7F7F7;
  162. .goods-item{
  163. width: 702rpx;
  164. padding:24rpx;
  165. height: auto;
  166. background: #FFFFFF;
  167. margin-bottom: 24rpx;
  168. &:last-child{
  169. margin-bottom: 0;
  170. }
  171. }
  172. .shoptitle{
  173. width: 100%;
  174. float: left;
  175. height: 56rpx;
  176. line-height: 56rpx;
  177. margin-bottom: 12rpx;
  178. .title-text{
  179. width: 400rpx;
  180. overflow: hidden;
  181. text-overflow:ellipsis;
  182. white-space: nowrap;
  183. float: left;
  184. font-size: $font-size-28;
  185. color: $text-color;
  186. text-align: left;
  187. line-height: 56rpx;
  188. font-weight: bold;
  189. .iconfont{
  190. color: #999999;
  191. font-size: 28rpx;
  192. margin-left: 10rpx;
  193. }
  194. .paymenttext{
  195. color: #f9a94b;
  196. font-size: $font-size-22;
  197. margin-left: 20rpx;
  198. }
  199. }
  200. }
  201. .productlist{
  202. width: 100%;
  203. height: auto;
  204. border-bottom: 2rpx solid #e1e1e1;
  205. padding: 10rpx;
  206. box-sizing: border-box;
  207. }
  208. .goods-pros-t{
  209. display: flex;
  210. width: 100%;
  211. height: auto;
  212. margin: 20rpx 0;
  213. .pros-left{
  214. width: 210rpx;
  215. height: 100%;
  216. margin:0 26rpx 0 0;
  217. }
  218. .pros-img{
  219. width: 210rpx;
  220. height: 210rpx;
  221. border-radius: 10rpx;
  222. border:1px solid #f3f3f3;
  223. position: relative;
  224. .tips{
  225. display: inline-block;
  226. width: 80rpx;
  227. height: 40rpx;
  228. background-image: linear-gradient(214deg, #ff4500 0%, #ff5800 53%, #ff4367 100%);
  229. line-height: 40rpx;
  230. text-align: center;
  231. font-size: $font-size-24;
  232. color: #FFFFFF;
  233. border-radius:10rpx 0 10rpx 0 ;
  234. position: absolute;
  235. top:0;
  236. left: 0;
  237. }
  238. image{
  239. width: 210rpx;
  240. height: 210rpx;
  241. border-radius: 10rpx;
  242. }
  243. }
  244. }
  245. .product-info{
  246. padding: 10rpx 0;
  247. .product-view{
  248. font-size:$font-size-24;
  249. color: #999999;
  250. overflow: hidden;
  251. height: 44rpx;
  252. line-height: 44rpx;
  253. .view-num{
  254. float: left;
  255. }
  256. .view-right{
  257. color: #666666;
  258. float: right;
  259. }
  260. }
  261. }
  262. .pros-product{
  263. width: 468rpx;
  264. height: 100%;
  265. line-height: 36rpx;
  266. font-size: $font-size-26;
  267. position: relative;
  268. .product-view{
  269. &.allPrice{
  270. width: 100%;
  271. }
  272. .view-num{
  273. flex: 1;
  274. text-align: left;
  275. font-size: $font-size-26;
  276. color: #999999;
  277. line-height: 44rpx;
  278. float: left;
  279. &.right{
  280. float: right;
  281. }
  282. &.red{
  283. color: #FF2000;
  284. font-weight: bold;
  285. }
  286. }
  287. }
  288. .producttitle{
  289. width: 100%;
  290. display: inline-block;
  291. height: auto;
  292. text-overflow:ellipsis;
  293. display: -webkit-box;
  294. word-break: break-all;
  295. -webkit-box-orient: vertical;
  296. -webkit-line-clamp: 2;
  297. overflow: hidden;
  298. margin-bottom: 8rpx;
  299. }
  300. .productspec{
  301. height: 44rpx;
  302. color: #999999;
  303. line-height: 44rpx;
  304. }
  305. .productprice{
  306. height: 48rpx;
  307. position: absolute;
  308. width: 100%;
  309. bottom: 0;
  310. .price{
  311. line-height: 48rpx;
  312. font-size: $font-size-28;
  313. width: 48%;
  314. color: #FF2A2A;
  315. float: left;
  316. }
  317. .count{
  318. height: 100%;
  319. float: right;
  320. position: relative;
  321. .small{
  322. color: #666666;
  323. }
  324. }
  325. }
  326. .floor-item-act{
  327. width: 100%;
  328. height: 56rpx;
  329. text-align: center;
  330. box-sizing: border-box;
  331. float: left;
  332. padding:0 0 10rpx 0;
  333. .floor-tags{
  334. height: 28rpx;
  335. border-radius: 6rpx;
  336. background-color: #FFFFFF;
  337. line-height: 28rpx;
  338. color: #ff2a2a;
  339. text-align: center;
  340. display: inline-block;
  341. padding:0 16rpx;
  342. font-size: $font-size-20;
  343. border: 1px solid #ff2a2a;
  344. float: left;
  345. }
  346. }
  347. }
  348. .goods-pros-m{
  349. width: 100%;
  350. height: auto;
  351. line-height: 76rpx;
  352. font-size: $font-size-26;
  353. color: $text-color;
  354. float: left;
  355. .m-text{
  356. width: 62rpx;
  357. float: left;
  358. padding-right: 20rpx;
  359. font-weight:bold;
  360. }
  361. .m-input{
  362. display: -webkit-box;
  363. display: -webkit-flex;
  364. display: flex;
  365. -webkit-box-align: center;
  366. -webkit-align-items: center;
  367. align-items: center;
  368. position: relative;
  369. width: 620rpx;
  370. height: auto;
  371. padding: 20rpx 0 10rpx 0;
  372. background: #FFFFFF;
  373. .text{
  374. width: 100%;
  375. height: 100%;
  376. font-size: $font-size-26;
  377. line-height: 36rpx;
  378. color: #333333;
  379. }
  380. }
  381. }
  382. .goods-pros-b{
  383. width:100%;
  384. height: 80rpx;
  385. margin-top: 12rpx;
  386. float: left;
  387. .count{
  388. float: left;
  389. font-size: $font-size-26;
  390. line-height: 80rpx;
  391. color: $text-color;
  392. display: flex;
  393. justify-content: flex-end;
  394. font-weight: bold;
  395. }
  396. .sum{
  397. width: 520rpx;
  398. float: right;
  399. .sum-none{
  400. width: 100%;
  401. height: 40rpx;
  402. line-height: 40rpx;
  403. color: $text-color;
  404. float: left;
  405. text-align: right;
  406. .money{
  407. font-size: $font-size-26;
  408. color: #999999;
  409. text-decoration: line-through;
  410. }
  411. .money-sign{
  412. font-size: $font-size-26;
  413. color: #999999;
  414. text-decoration: line-through;
  415. }
  416. .money-reduced{
  417. margin-left: 10rpx;
  418. font-size: $font-size-26;
  419. color: $color-system;
  420. .iconfont{
  421. font-size: $font-size-34;
  422. }
  423. }
  424. }
  425. .sum-money{
  426. width: 100%;
  427. height: 40rpx;
  428. font-size: $font-size-28;
  429. line-height: 40rpx;
  430. color: $text-color;
  431. display: flex;
  432. justify-content: flex-end;
  433. &.none{
  434. height: 80rpx;
  435. line-height: 80rpx;
  436. }
  437. .money{
  438. color: #FF2A2A;
  439. font-size: $font-size-28;
  440. }
  441. }
  442. }
  443. }
  444. }
  445. }
  446. </style>