goodsList.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459
  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: 4rpx;
  197. background-color: rgba(225, 86, 22, 0.1);
  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. }
  205. }
  206. }
  207. .productlist{
  208. width: 100%;
  209. height: auto;
  210. border-bottom: 2rpx solid #e1e1e1;
  211. padding: 10rpx;
  212. }
  213. .goods-pros-t{
  214. display: flex;
  215. width: 100%;
  216. height: auto;
  217. margin: 20rpx 0;
  218. .pros-left{
  219. width: 210rpx;
  220. height: 100%;
  221. margin:0 26rpx 0 0;
  222. }
  223. .pros-img{
  224. width: 210rpx;
  225. height: 210rpx;
  226. border-radius: 10rpx;
  227. border:1px solid #f3f3f3;
  228. position: relative;
  229. .tips{
  230. display: inline-block;
  231. width: 80rpx;
  232. height: 40rpx;
  233. background-image: linear-gradient(214deg, #ff4500 0%, #ff5800 53%, #ff4367 100%);
  234. line-height: 40rpx;
  235. text-align: center;
  236. font-size: $font-size-24;
  237. color: #FFFFFF;
  238. border-radius:10rpx 0 10rpx 0 ;
  239. position: absolute;
  240. top:0;
  241. left: 0;
  242. }
  243. image{
  244. width: 210rpx;
  245. height: 210rpx;
  246. border-radius: 10rpx;
  247. }
  248. }
  249. }
  250. .product-info{
  251. // border-top: 2rpx solid #e1e1e1;
  252. padding: 10rpx 0;
  253. .product-view{
  254. font-size:$font-size-24;
  255. color: #999999;
  256. overflow: hidden;
  257. height: 44rpx;
  258. line-height: 44rpx;
  259. .view-num{
  260. float: left;
  261. }
  262. .view-right{
  263. color: #666666;
  264. float: right;
  265. }
  266. }
  267. }
  268. .pros-product{
  269. width: 468rpx;
  270. height: 100%;
  271. line-height: 36rpx;
  272. font-size: $font-size-26;
  273. position: relative;
  274. .product-view{
  275. // width: 50%;
  276. // height: auto;
  277. // display: flex;
  278. // display: inline-block;
  279. &.allPrice{
  280. width: 100%;
  281. }
  282. .view-num{
  283. flex: 1;
  284. text-align: left;
  285. font-size: $font-size-26;
  286. color: #999999;
  287. line-height: 44rpx;
  288. float: left;
  289. &.right{
  290. float: right;
  291. }
  292. &.red{
  293. color: #FF2000;
  294. font-weight: bold;
  295. }
  296. }
  297. }
  298. .producttitle{
  299. width: 100%;
  300. display: inline-block;
  301. height: auto;
  302. text-overflow:ellipsis;
  303. display: -webkit-box;
  304. word-break: break-all;
  305. -webkit-box-orient: vertical;
  306. -webkit-line-clamp: 2;
  307. overflow: hidden;
  308. margin-bottom: 8rpx;
  309. }
  310. .productspec{
  311. height: 44rpx;
  312. color: #999999;
  313. line-height: 44rpx;
  314. margin: 20rpx 0;
  315. }
  316. .productprice{
  317. height: 48rpx;
  318. position: absolute;
  319. width: 100%;
  320. bottom: 0;
  321. .price{
  322. line-height: 48rpx;
  323. font-size: $font-size-28;
  324. width: 48%;
  325. color: #FF2A2A;
  326. float: left;
  327. }
  328. .count{
  329. height: 100%;
  330. float: right;
  331. position: relative;
  332. .small{
  333. color: #666666;
  334. }
  335. }
  336. }
  337. .floor-item-act{
  338. width: 100%;
  339. height: 56rpx;
  340. text-align: center;
  341. box-sizing: border-box;
  342. float: left;
  343. padding:10rpx 0 0 0;
  344. .floor-tags{
  345. float: left;
  346. height: 36rpx;
  347. border-radius: 4rpx;
  348. background-color: rgba(225, 86, 22, 0.1);
  349. line-height: 36rpx;
  350. color: $color-system;
  351. text-align: center;
  352. display: inline-block;
  353. padding:0 16rpx;
  354. font-size: $font-size-20;
  355. }
  356. }
  357. }
  358. .goods-pros-m{
  359. width: 100%;
  360. height: auto;
  361. line-height: 76rpx;
  362. font-size: $font-size-26;
  363. color: $text-color;
  364. float: left;
  365. .m-text{
  366. width: 62rpx;
  367. float: left;
  368. padding-right: 20rpx;
  369. font-weight:bold;
  370. }
  371. .m-input{
  372. display: -webkit-box;
  373. display: -webkit-flex;
  374. display: flex;
  375. -webkit-box-align: center;
  376. -webkit-align-items: center;
  377. align-items: center;
  378. position: relative;
  379. width: 620rpx;
  380. height: auto;
  381. padding: 20rpx 0 10rpx 0;
  382. background: #FFFFFF;
  383. .text{
  384. width: 100%;
  385. height: 100%;
  386. font-size: $font-size-26;
  387. line-height: 36rpx;
  388. color: #333333;
  389. }
  390. }
  391. }
  392. .goods-pros-b{
  393. width:100%;
  394. height: 80rpx;
  395. margin-top: 12rpx;
  396. float: left;
  397. .count{
  398. float: left;
  399. font-size: $font-size-26;
  400. line-height: 80rpx;
  401. color: $text-color;
  402. display: flex;
  403. justify-content: flex-end;
  404. font-weight: bold;
  405. }
  406. .sum{
  407. width: 520rpx;
  408. float: right;
  409. .sum-none{
  410. width: 100%;
  411. height: 40rpx;
  412. line-height: 40rpx;
  413. color: $text-color;
  414. float: left;
  415. text-align: right;
  416. .money{
  417. font-size: $font-size-26;
  418. color: #999999;
  419. text-decoration: line-through;
  420. }
  421. .money-sign{
  422. font-size: $font-size-26;
  423. color: #999999;
  424. text-decoration: line-through;
  425. }
  426. .money-reduced{
  427. margin-left: 10rpx;
  428. font-size: $font-size-26;
  429. color: $color-system;
  430. .iconfont{
  431. font-size: $font-size-34;
  432. }
  433. }
  434. }
  435. .sum-money{
  436. width: 100%;
  437. height: 40rpx;
  438. font-size: $font-size-28;
  439. line-height: 40rpx;
  440. color: $text-color;
  441. display: flex;
  442. justify-content: flex-end;
  443. &.none{
  444. height: 80rpx;
  445. line-height: 80rpx;
  446. }
  447. .money{
  448. color: #FF2A2A;
  449. font-size: $font-size-28;
  450. }
  451. }
  452. }
  453. }
  454. }
  455. }
  456. </style>