cm-goods-temp.vue 9.3 KB

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