surePay.vue 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. <template>
  2. <view>
  3. <view class="box">
  4. <view class="item">
  5. <view class="l">订单号:</view>
  6. <view class="r">
  7. {{form.no}}
  8. </view>
  9. </view>
  10. <view class="item">
  11. <view class="l">业务费用:</view>
  12. <view class="r">
  13. {{form.itemPrice}}元
  14. </view>
  15. </view>
  16. <view class="item">
  17. <view class="l">停车费用:</view>
  18. <view class="r">
  19. <text >{{form.partMoney+form.chinaPartMoney}}元</text>
  20. </view>
  21. </view>
  22. <view class="item">
  23. <view class="l">合计费用:</view>
  24. <view class="r">
  25. {{form.totalMoney}}元
  26. </view>
  27. </view>
  28. <view class="item">
  29. <view class="l">支付凭据:</view>
  30. <view class="r">
  31. <view class="img">
  32. <uni-file-picker v-model="imageValue" fileMediatype="image" mode="grid" limit="1"
  33. @select="select" @progress="progress" @success="success" @fail="fail"
  34. @delete="form.payTicket=''" :image-styles="imageStyles" />
  35. </view>
  36. </view>
  37. </view>
  38. </view>
  39. <u-button type="primary" @click="confirmFn">确认</u-button>
  40. </view>
  41. </template>
  42. <script>
  43. import request from '../../utils/request.js'
  44. export default {
  45. data() {
  46. return {
  47. id: '',
  48. imageValue: [],
  49. imageStyles: {
  50. width: 150,
  51. height: 100,
  52. border: {
  53. color: "#eee",
  54. width: 1,
  55. style: 'dashed',
  56. radius: '5px'
  57. }
  58. },
  59. form: {
  60. partMoney: 0
  61. },
  62. imgList: [],
  63. uploadImageUrl: request.server + '/upload/image',
  64. }
  65. },
  66. onLoad(options) {
  67. this.id = options.id;
  68. },
  69. onShow() {
  70. this.getBusinessById();
  71. },
  72. methods: {
  73. // 获取上传状态
  74. select(e) {
  75. let that = this;
  76. uni.uploadFile({
  77. url: that.uploadImageUrl,
  78. filePath: e.tempFilePaths[0],
  79. name: 'file',
  80. success: (resp => {
  81. that.form.payTicket=JSON.parse(resp.data).data;
  82. })
  83. })
  84. },
  85. deleteFn(v){
  86. console.log(v)
  87. },
  88. // 获取上传进度
  89. progress(e) {
  90. console.log('上传进度:', e)
  91. },
  92. // 上传成功
  93. success(e) {
  94. console.log('上传成功')
  95. },
  96. // 上传失败
  97. fail(e) {
  98. console.log('上传失败:', e)
  99. },
  100. getBusinessById() {
  101. this.$api.getBusinessById({
  102. id: this.id
  103. }).then(resp => {
  104. this.form = resp.data;
  105. if(this.form.payTicket){
  106. this.imageValue=[{
  107. 'name':'payTicket.png',
  108. 'extname':'.png',
  109. 'url':this.form.payTicket
  110. }]
  111. }
  112. })
  113. },
  114. confirmFn(){
  115. this.$api.confirmPay(this.$common.removeNull(this.form)).then(Resp=>{
  116. this.$common.toast('已支付');
  117. setTimeout(()=>{
  118. this.$common.back()
  119. },500)
  120. })
  121. }
  122. }
  123. }
  124. </script>
  125. <style lang="scss">
  126. page {
  127. background-color: #fff;
  128. }
  129. @import '@/common/common.scss'
  130. </style>