cm-goods-temp.vue 13 KB

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