orderDetail.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. <template>
  2. <view class="content">
  3. <u-cell-group>
  4. <u-cell-item :arrow="false" :title-style="{width: '100%'}">
  5. <view slot="title" style="display: flex;justify-content: center;">
  6. <u-avatar :src="orderInfo.url" size="140"></u-avatar>
  7. </view>
  8. </u-cell-item>
  9. <u-cell-item title="接收人" :value="orderInfo.coachName" :arrow="false"></u-cell-item>
  10. <u-cell-item title="家长姓名" :value="orderInfo.parentsName" :arrow="false"></u-cell-item>
  11. <u-cell-item title="学员姓名" :value="orderInfo.studentName" :arrow="false"></u-cell-item>
  12. <u-cell-item title="学员性别" :value="orderInfo.sex" :arrow="false"></u-cell-item>
  13. <u-cell-item title="学员年龄" :value="orderInfo.age" :arrow="false"></u-cell-item>
  14. <u-cell-item title="学生生日" :value="orderInfo.birthday" :arrow="false"></u-cell-item>
  15. <u-cell-item title="手机号码" :value="orderInfo.phone" :arrow="false"></u-cell-item>
  16. <u-cell-item title="报名班级" :value="orderInfo.className" :arrow="false"></u-cell-item>
  17. <u-cell-item title="课时数" :value="orderInfo.courseNumber" :arrow="false"></u-cell-item>
  18. <u-cell-item title="课时单价" :value="orderInfo.coursePrice" :arrow="false"></u-cell-item>
  19. <u-cell-item title="课时总价" :value="orderInfo.sumPrice" :arrow="false"></u-cell-item>
  20. <u-cell-item title="订单号" :value="orderInfo.orderNo" :arrow="false"></u-cell-item>
  21. <u-cell-item title="赠课数量" :value="orderInfo.lessonsGiveNumber" :arrow="false"></u-cell-item>
  22. <u-cell-item title="赠品" :title-style="{width: '100%'}" :arrow="false">
  23. <text slot="label">{{orderInfo.giftId.map( site => { return site.name } ).join(',')}}</text>
  24. </u-cell-item>
  25. <u-cell-item title="销售员" :value="orderInfo.saleName" :arrow="false"></u-cell-item>
  26. <u-cell-item title="谈单人" :value="orderInfo.talkerName" :arrow="false"></u-cell-item>
  27. <u-cell-item title="支付方式" :value="orderInfo.payTypeValue" :arrow="false"></u-cell-item>
  28. <u-cell-item title="有效期" :value="orderInfo.time" :arrow="false" v-if="orderInfo.other == 1"></u-cell-item>
  29. <u-cell-item title="备注" :label="orderInfo.remark" :arrow="false" :title-style="{width: '100%'}"></u-cell-item>
  30. <u-cell-item title="查看合同协议" @click="checkContract()"></u-cell-item>
  31. </u-cell-group>
  32. <u-top-tips ref="uTips"></u-top-tips>
  33. </view>
  34. </template>
  35. <script>
  36. import {
  37. mapGetters
  38. } from 'vuex'
  39. const NET = require('@/utils/request')
  40. const API = require('@/config/api')
  41. export default {
  42. computed: {
  43. ...mapGetters([
  44. 'mainColor',
  45. 'customStyle',
  46. ])
  47. },
  48. data() {
  49. return {
  50. id: '',
  51. orderInfo: {
  52. url: '',
  53. coachName: '',
  54. parentsName: '',
  55. studentName: '',
  56. sex: '',
  57. age: '',
  58. birthday: '',
  59. phone: '',
  60. className: '',
  61. courseNumber: '',
  62. coursePrice: '',
  63. sumPrice: '',
  64. orderNo: '',
  65. lessonsGiveNumber: '',
  66. giftId: [],
  67. saleName: '',
  68. talkerName: '',
  69. payTypeValue: '',
  70. time: '',
  71. other: '',
  72. remark: '',
  73. contractUrl: '',
  74. },
  75. }
  76. },
  77. onLoad(options) {
  78. this.id = options.id
  79. this.initialize()
  80. },
  81. methods: {
  82. initialize() {
  83. NET.request(API.getOrderInfo, {
  84. id: this.id
  85. }, 'POST').then(res => {
  86. this.orderInfo = res.data
  87. }).catch(error => {
  88. this.$refs.uTips.show({
  89. title: error.message,
  90. type: 'warning',
  91. })
  92. })
  93. },
  94. // 显示合同
  95. checkContract() {
  96. uni.downloadFile({
  97. url: this.orderInfo.contractUrl,
  98. success: (res) => {
  99. uni.openDocument({
  100. filePath: res.tempFilePath,
  101. });
  102. }
  103. })
  104. },
  105. },
  106. }
  107. </script>
  108. <style>
  109. page {
  110. width: 100%;
  111. height: 100%;
  112. position: relative;
  113. }
  114. </style>
  115. <style lang="scss" scoped>
  116. @import "@/static/css/themes.scss";
  117. .content {
  118. width: 100%;
  119. float: left;
  120. box-sizing: border-box;
  121. .scroll-box {
  122. width: 100%;
  123. height: 100vh;
  124. }
  125. }
  126. </style>