球星卡微信小程序
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.

247 lines
5.6 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" ref="myCollapse2" :value="['other expenses']">
  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(()=>{
  108. this.$refs.myCollapse.init();
  109. this.$refs.myCollapse2.init();
  110. });
  111. }
  112. }
  113. };
  114. </script>
  115. <style scoped lang="scss">
  116. .center-section {
  117. margin-top: 30rpx;
  118. padding: 40rpx 30rpx 40rpx 32rpx;
  119. background-color: rgb(255, 255, 255);
  120. }
  121. .image_6 {
  122. margin-left: 8rpx;
  123. align-self: center;
  124. width: 26rpx;
  125. height: 16rpx;
  126. }
  127. .text_6 {
  128. color: rgb(51, 51, 51);
  129. font-size: 32rpx;
  130. font-weight: 500;
  131. line-height: 44rpx;
  132. white-space: nowrap;
  133. }
  134. .right-group {
  135. color: rgb(231, 162, 63);
  136. font-size: 32rpx;
  137. font-weight: 600;
  138. line-height: 44rpx;
  139. white-space: nowrap;
  140. }
  141. .group_9 {
  142. margin-top: 40rpx;
  143. color: rgb(119, 119, 119);
  144. font-size: 28rpx;
  145. font-weight: 500;
  146. line-height: 40rpx;
  147. white-space: nowrap;
  148. }
  149. .page {
  150. background-color: #f6f6f6;
  151. width: 100%;
  152. overflow-y: auto;
  153. height: 100%;
  154. }
  155. .group_4 {
  156. padding: 2rpx 0 16rpx;
  157. flex: 1 1 auto;
  158. overflow-y: auto;
  159. }
  160. .section_2 {
  161. padding: 40rpx 32rpx;
  162. background-color: rgb(255, 255, 255);
  163. }
  164. .group_7 {
  165. margin-top: 50rpx;
  166. }
  167. .group_10 {
  168. margin-top: 30rpx;
  169. color: rgb(119, 119, 119);
  170. font-size: 28rpx;
  171. font-weight: 500;
  172. line-height: 40rpx;
  173. white-space: nowrap;
  174. }
  175. .group_11 {
  176. margin-top: 30rpx;
  177. color: rgb(119, 119, 119);
  178. font-size: 28rpx;
  179. font-weight: 500;
  180. line-height: 40rpx;
  181. white-space: nowrap;
  182. }
  183. .text_2 {
  184. color: rgb(51, 51, 51);
  185. font-size: 32rpx;
  186. font-weight: 500;
  187. line-height: 44rpx;
  188. white-space: nowrap;
  189. }
  190. .text_3 {
  191. color: rgb(231, 162, 63);
  192. font-size: 32rpx;
  193. font-weight: 600;
  194. line-height: 44rpx;
  195. white-space: nowrap;
  196. }
  197. .text_4 {
  198. color: rgb(51, 51, 51);
  199. font-size: 32rpx;
  200. font-weight: 500;
  201. line-height: 44rpx;
  202. white-space: nowrap;
  203. }
  204. .text_5 {
  205. color: rgb(51, 51, 51);
  206. font-size: 32rpx;
  207. font-weight: 600;
  208. line-height: 44rpx;
  209. white-space: nowrap;
  210. }
  211. .text_18 {
  212. margin-left: 116rpx;
  213. }
  214. .text_19 {
  215. margin-left: 118rpx;
  216. }
  217. .text_20 {
  218. margin-left: 116rpx;
  219. }
  220. .card{
  221. width: 750rpx;
  222. height: auto;
  223. background-color: #FFFFFF;
  224. margin-top: 30rpx;
  225. }
  226. .collapse-item-content{
  227. padding: 12rpx 0;
  228. &>view:nth-child(1){
  229. width: 80%;
  230. }
  231. &>view:nth-child(2){
  232. width: 20%;
  233. text-align: right;
  234. }
  235. }
  236. /deep/.u-cell__value{
  237. font-size: 32rpx !important;
  238. color: #E7A23F !important;
  239. }
  240. </style>