cm-goods-temp.vue 9.5 KB

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