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

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