cm-goods-temp.vue 13 KB

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