goodsList.vue 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329
  1. <template name="goods">
  2. <view class="goods-template">
  3. <!-- 商品列表 -->
  4. <view class="goods-list">
  5. <view class="goods-list-title">商品信息</view>
  6. <view v-for="(item, index) in initData.orderItemList" :key="index" class="goods-item">
  7. <view class="productlist">
  8. <view class="goods-pros-t">
  9. <view class="pros-img"><image :src="item.productPic" alt="" mode="scaleToFill"/></view>
  10. <view class="pros-product">
  11. <view class="producttitle">{{item.productName}}</view>
  12. <view class="productspec" v-for="(attr,idx) in JSON.parse(item.productAttr)" :key="idx">
  13. <text>{{attr.key}}:</text>
  14. <text>{{attr.value}}</text>
  15. </view>
  16. <view class="productprice">
  17. <view class="count">
  18. <text class="small">x</text>{{item.productQuantity}}
  19. </view>
  20. <view class="price">
  21. <text><text class="small">¥</text>{{ item.productPrice | NumFormat }}</text>
  22. </view>
  23. </view>
  24. </view>
  25. </view>
  26. </view>
  27. </view>
  28. </view>
  29. <view class="information-content">
  30. <view class="information-view">
  31. <view class="view-num time">
  32. <view class="view-num-label">商品合计:</view>
  33. <view class="view-num-text">
  34. ¥{{ initData.totalAmount | NumFormat }}
  35. </view>
  36. </view>
  37. <view class="view-num time">
  38. <view class="view-num-label">运费(快递):</view>
  39. <view class="view-num-text">
  40. ¥{{ initData.freightAmount | NumFormat }}
  41. </view>
  42. </view>
  43. </view>
  44. <view class="information-view">
  45. <view class="view-num time">
  46. <view class="view-num-label">优惠券:</view>
  47. <view class="view-num-text">
  48. ¥{{ initData.couponAmount | NumFormat }}
  49. </view>
  50. </view>
  51. <view class="view-num time">
  52. <view class="view-num-label">积分抵扣:</view>
  53. <view class="view-num-text">
  54. ¥{{ initData.integrationAmount | NumFormat }}
  55. </view>
  56. </view>
  57. </view>
  58. <view class="information-view">
  59. <view class="view-num time">
  60. <view class="view-num-label">活动优惠:</view>
  61. <view class="view-num-text">
  62. ¥{{ initData.promotionAmount | NumFormat }}
  63. </view>
  64. </view>
  65. <view class="view-num time">
  66. <view class="view-num-label">折扣金额:</view>
  67. <view class="view-num-text">
  68. ¥{{ initData.discountAmount | NumFormat }}
  69. </view>
  70. </view>
  71. </view>
  72. <view class="information-view">
  73. <view class="view-num time">
  74. <view class="view-num-label">订单总金额:</view>
  75. <view class="view-num-text">
  76. ¥{{ (initData.totalAmount + initData.freightAmount) | NumFormat }}
  77. </view>
  78. </view>
  79. <view class="view-num time">
  80. <view class="view-num-label">应付款金额:</view>
  81. <view class="view-num-text">
  82. ¥{{ (initData.payAmount + initData.freightAmount - initData.discountAmount) | NumFormat }}
  83. </view>
  84. </view>
  85. </view>
  86. </view>
  87. </view>
  88. </template>
  89. <script>
  90. export default{
  91. name:"goods",
  92. props:{
  93. orderInfo:{
  94. type:Object
  95. }
  96. },
  97. data() {
  98. return{
  99. initData:{}
  100. }
  101. },
  102. filters: {
  103. NumFormat:function(text) {//处理金额
  104. return Number(text).toFixed(2);
  105. },
  106. },
  107. created(){
  108. this.initData = this.orderInfo
  109. },
  110. computed: {
  111. },
  112. methods:{
  113. toFixedFn(text){//处理小数点后两位数
  114. return Number(text).toFixed(2);
  115. },
  116. }
  117. }
  118. </script>
  119. <style lang="scss">
  120. .goods-template{
  121. width: 100%;
  122. height: auto;
  123. background: #FFFFFF;
  124. float: left;
  125. margin-top: 16rpx;
  126. .goods-list{
  127. width: 100%;
  128. height: auto;
  129. background:#F7F7F7;
  130. border-bottom: 1px solid #EBEBEB;
  131. .goods-list-title{
  132. background-color: #FFFFFF;
  133. font-size: $font-size-28;
  134. color: $text-color;
  135. line-height: 60rpx;
  136. width: 100%;
  137. padding: 0 20rpx;
  138. font-weight: bold;
  139. }
  140. .goods-item{
  141. width: 100%;
  142. padding:10rpx 20rpx;
  143. background: #FFFFFF;
  144. margin-bottom: 16rpx;
  145. &:last-child{
  146. margin-bottom: 0;
  147. }
  148. }
  149. .shoptitle{
  150. display: flex;
  151. align-items: center;
  152. height: 80rpx;
  153. line-height: 80rpx;
  154. .title-logo{
  155. width: 48rpx;
  156. height: 48rpx;
  157. float: left;
  158. image{
  159. width: 48rpx;
  160. height: 48rpx;
  161. }
  162. }
  163. .title-text{
  164. float: left;
  165. margin-left: 16rpx;
  166. font-size: $font-size-28;
  167. color: $text-color;
  168. text-align: left;
  169. line-height: 56rpx;
  170. font-weight: bold;
  171. }
  172. }
  173. .productlist{
  174. width: 100%;
  175. height: auto;
  176. }
  177. .goods-pros-t{
  178. display: flex;
  179. align-items: center;
  180. width: 100%;
  181. height: auto;
  182. .pros-img{
  183. width: 100rpx;
  184. height: 100rpx;
  185. border-radius: 10rpx;
  186. margin:0 26rpx 0 0;
  187. border:1px solid #f3f3f3;
  188. image{
  189. width: 100%;
  190. height: 100%;
  191. border-radius: 10rpx;
  192. }
  193. }
  194. }
  195. .pros-product{
  196. width: 600rpx;
  197. height: 100%;
  198. line-height: 36rpx;
  199. font-size: $font-size-26;
  200. position: relative;
  201. padding: 6rpx 0;
  202. box-sizing: border-box;
  203. .producttitle{
  204. width: 100%;
  205. display: inline-block;
  206. height: auto;
  207. text-overflow:ellipsis;
  208. display: -webkit-box;
  209. word-break: break-all;
  210. -webkit-box-orient: vertical;
  211. -webkit-line-clamp: 2;
  212. overflow: hidden;
  213. margin-bottom: 8rpx;
  214. }
  215. .productspec{
  216. height: 36rpx;
  217. color: #999999;
  218. }
  219. .productprice{
  220. height: 48rpx;
  221. width: 100%;
  222. .price{
  223. line-height: 48rpx;
  224. font-size: $font-size-28;
  225. width: 48%;
  226. color: #FF5000;
  227. float: right;
  228. text-align: right;
  229. .small{
  230. font-size: $font-size-22;
  231. }
  232. }
  233. .count{
  234. height: 100%;
  235. float: left;
  236. position: relative;
  237. .small{
  238. color: #666666;
  239. }
  240. }
  241. }
  242. }
  243. .goods-pros-m{
  244. height: 76rpx;
  245. line-height: 76rpx;
  246. font-size: $font-size-26;
  247. color: $text-color;
  248. margin-top: 12rpx;
  249. .m-text{
  250. width: 90rpx;
  251. float: left;
  252. padding-right: 20rpx;
  253. }
  254. .m-input{
  255. position: relative;
  256. float: left;
  257. width: 620rpx;
  258. height: 70rpx;
  259. padding: 20rpx 40rpx;
  260. background: #F7F7F7;
  261. border-radius: 50rpx;
  262. input{
  263. width: 100%;
  264. height: 100%;
  265. background: #F7F7F7;
  266. font-size: $font-size-26;
  267. line-height: 36rpx;
  268. color: #333333;
  269. min-height: 36rpx;
  270. }
  271. }
  272. }
  273. .goods-pros-b{
  274. width:100%;
  275. height: auto;
  276. .sum{
  277. font-size: $font-size-28;
  278. line-height: 60rpx;
  279. color: $text-color;
  280. display: flex;
  281. justify-content: flex-end;
  282. .money{
  283. color: #FF2A2A;
  284. font-size: $font-size-28;
  285. }
  286. }
  287. }
  288. }
  289. .information-content{
  290. width: 100%;
  291. box-sizing: border-box;
  292. padding: 20rpx;
  293. .information-view{
  294. height: 50rpx;
  295. line-height: 50rpx;
  296. font-size: $font-size-24;
  297. color: $text-color;
  298. margin: 4rpx 0;
  299. display: flex;
  300. .view-num{
  301. flex: 1;
  302. color: $text-color;
  303. .view-num-label{
  304. text-align: left;
  305. float: left;
  306. color: $text-color;
  307. }
  308. .view-num-text{
  309. float: left;
  310. text-align: left;
  311. color: #999999;
  312. }
  313. }
  314. .red{
  315. color: #FF2A2A;
  316. }
  317. .view-type{
  318. float: right;
  319. text-align: right;
  320. color: #FF2A2A;
  321. flex: 2;
  322. }
  323. }
  324. }
  325. }
  326. </style>