goodsList.vue 11 KB

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