球星卡微信小程序
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

243 lines
5.5 KiB

  1. <template>
  2. <view class="flex-col page">
  3. <view class="flex-col group_4">
  4. <view class="flex-col">
  5. <view class="flex-col section_2">
  6. <view class="justify-between">
  7. <text class="text_2">费用合计</text>
  8. <text class="text_3">¥{{ details.total }}</text>
  9. </view>
  10. <view class="justify-between group_7">
  11. <text class="text_4">订单折扣</text>
  12. <text class="text_5">{{ details.discount && details.discount > 0 ? details.discount +'折' : '无' }}</text>
  13. </view>
  14. </view>
  15. <view class="card">
  16. <!-- <u-collapse @change="change" @close="close" @open="open" ref="myCollapse" > -->
  17. <u-collapse :border="false" ref="myCollapse" :value="['Rating fee']">
  18. <u-collapse-item title="评级费用" :value="ratingFeeTotal" name="Rating fee" >
  19. <view class="u-collapse-content lf-row-between collapse-item-content" v-for="(item, index) in details.grading_cost" :key="index">
  20. <view>{{ item.title }}</view>
  21. <view>¥{{ item.amount }}</view>
  22. </view>
  23. </u-collapse-item>
  24. </u-collapse>
  25. </view>
  26. <view class="card">
  27. <u-collapse :border="false">
  28. <u-collapse-item title="其他费用" :value="otherFeeTotal" name="other expenses" >
  29. <lf-table :Header="header" :Content="details.other" height="auto" width="100%" :showNumber="false" :border="false" headBgColor="transparent" v-if="$isRight(details.other)"></lf-table>
  30. </u-collapse-item>
  31. </u-collapse>
  32. </view>
  33. <view style="width: 100%; height: 30rpx;"></view>
  34. </view>
  35. </view>
  36. </view>
  37. </template>
  38. <script>
  39. import lfTable from '@/components/lf-table.vue';
  40. import { gradingPayment } from '@/service/grading.js';
  41. import Bigc from '@/common/bigc.js';
  42. export default {
  43. components: {
  44. lfTable
  45. },
  46. data() {
  47. return {
  48. header: [{
  49. text: '费用名称',
  50. width: 171,
  51. key: 'title'
  52. },{
  53. text: '价格',
  54. width: 171,
  55. key: 'amount'
  56. },{
  57. text: '数量',
  58. width: 171,
  59. key: 'num'
  60. },{
  61. text: '合计',
  62. width: 171,
  63. key: 'total'
  64. }],
  65. id: '',
  66. details: {}
  67. };
  68. },
  69. computed: {
  70. ratingFeeTotal(){
  71. if(this.$valueType(this.details.grading_cost) === 'undefined' || this.details.grading_cost.length === 0){
  72. return '';
  73. }else{
  74. let total = new Bigc(0);
  75. this.details.grading_cost.map(item => {
  76. total = total.plus(item.amount);
  77. });
  78. let value = '¥'+ total.round(2, 0);
  79. return value;
  80. }
  81. },
  82. otherFeeTotal(){
  83. if(this.$valueType(this.details.other) === 'undefined' || this.details.other.length === 0){
  84. return '';
  85. }else{
  86. let total = new Bigc(0);
  87. this.details.other.map(item => {
  88. total = total.plus(item.total);
  89. });
  90. let value = '¥'+ total.round(2, 0);
  91. return value;
  92. }
  93. }
  94. },
  95. onLoad(options){
  96. this.id = options.id;
  97. this.getGradingPayment();
  98. },
  99. methods: {
  100. async getGradingPayment(){
  101. let res = await gradingPayment(this.id);
  102. let details = res.data.datas;
  103. details.other.forEach(item => {
  104. item.total = new Bigc(item.num).times(item.amount).round(2, 0);
  105. })
  106. this.details = details;
  107. this.$nextTick(() => this.$refs.myCollapse.init());
  108. }
  109. }
  110. };
  111. </script>
  112. <style scoped lang="scss">
  113. .center-section {
  114. margin-top: 30rpx;
  115. padding: 40rpx 30rpx 40rpx 32rpx;
  116. background-color: rgb(255, 255, 255);
  117. }
  118. .image_6 {
  119. margin-left: 8rpx;
  120. align-self: center;
  121. width: 26rpx;
  122. height: 16rpx;
  123. }
  124. .text_6 {
  125. color: rgb(51, 51, 51);
  126. font-size: 32rpx;
  127. font-weight: 500;
  128. line-height: 44rpx;
  129. white-space: nowrap;
  130. }
  131. .right-group {
  132. color: rgb(231, 162, 63);
  133. font-size: 32rpx;
  134. font-weight: 600;
  135. line-height: 44rpx;
  136. white-space: nowrap;
  137. }
  138. .group_9 {
  139. margin-top: 40rpx;
  140. color: rgb(119, 119, 119);
  141. font-size: 28rpx;
  142. font-weight: 500;
  143. line-height: 40rpx;
  144. white-space: nowrap;
  145. }
  146. .page {
  147. background-color: #f6f6f6;
  148. width: 100%;
  149. overflow-y: auto;
  150. height: 100%;
  151. }
  152. .group_4 {
  153. padding: 2rpx 0 16rpx;
  154. flex: 1 1 auto;
  155. overflow-y: auto;
  156. }
  157. .section_2 {
  158. padding: 40rpx 32rpx;
  159. background-color: rgb(255, 255, 255);
  160. }
  161. .group_7 {
  162. margin-top: 50rpx;
  163. }
  164. .group_10 {
  165. margin-top: 30rpx;
  166. color: rgb(119, 119, 119);
  167. font-size: 28rpx;
  168. font-weight: 500;
  169. line-height: 40rpx;
  170. white-space: nowrap;
  171. }
  172. .group_11 {
  173. margin-top: 30rpx;
  174. color: rgb(119, 119, 119);
  175. font-size: 28rpx;
  176. font-weight: 500;
  177. line-height: 40rpx;
  178. white-space: nowrap;
  179. }
  180. .text_2 {
  181. color: rgb(51, 51, 51);
  182. font-size: 32rpx;
  183. font-weight: 500;
  184. line-height: 44rpx;
  185. white-space: nowrap;
  186. }
  187. .text_3 {
  188. color: rgb(231, 162, 63);
  189. font-size: 32rpx;
  190. font-weight: 600;
  191. line-height: 44rpx;
  192. white-space: nowrap;
  193. }
  194. .text_4 {
  195. color: rgb(51, 51, 51);
  196. font-size: 32rpx;
  197. font-weight: 500;
  198. line-height: 44rpx;
  199. white-space: nowrap;
  200. }
  201. .text_5 {
  202. color: rgb(51, 51, 51);
  203. font-size: 32rpx;
  204. font-weight: 600;
  205. line-height: 44rpx;
  206. white-space: nowrap;
  207. }
  208. .text_18 {
  209. margin-left: 116rpx;
  210. }
  211. .text_19 {
  212. margin-left: 118rpx;
  213. }
  214. .text_20 {
  215. margin-left: 116rpx;
  216. }
  217. .card{
  218. width: 750rpx;
  219. height: auto;
  220. background-color: #FFFFFF;
  221. margin-top: 30rpx;
  222. }
  223. .collapse-item-content{
  224. padding: 12rpx 0;
  225. &>view:nth-child(1){
  226. width: 80%;
  227. }
  228. &>view:nth-child(2){
  229. width: 20%;
  230. text-align: right;
  231. }
  232. }
  233. /deep/.u-cell__value{
  234. font-size: 32rpx !important;
  235. color: #E7A23F !important;
  236. }
  237. </style>