cm-goods-temp.vue 13 KB

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