goodsList.vue 11 KB

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