cm-goods-temp.vue 11 KB

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