goodsList.vue 11 KB

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