goodsList.vue 11 KB

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