cm-goods-temp.vue 13 KB

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