orderEit.vue 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  1. <template>
  2. <view class="home-getOrder">
  3. <form class="form" @submit="orderSubmit">
  4. <view class="select-input">
  5. <input class="input" style="display:none;" />
  6. <text>账户余额:</text><input class="input" name="altAvilBalance" disabled :value="altAvilBalance"/>
  7. </view>
  8. <view class="select-input">
  9. <input class="input" style="display:none;" />
  10. <text>订单编号:</text><input class="input" name="sn" disabled :value="sn"/>
  11. </view>
  12. <view class="select-input">
  13. <input class="input" style="display:none;" />
  14. <text>设备编码:</text><input class="input" name="clientId" :value="clientId" />
  15. </view>
  16. <view class="select-input">
  17. <input class="input" style="display:none;" />
  18. <text>商品名称:</text><input class="input" name="productName" disabled :value="productName" />
  19. </view>
  20. <view class="select-input">
  21. <input class="input" style="display:none;" />
  22. <text>商品价格:</text><input class="input" name="price" disabled :value="price" />
  23. </view>
  24. <view class="select-input">
  25. <input class="input" style="display:none;" />
  26. <text>支付时间:</text><input class="input" name="payDate" disabled :value="payDate"/>
  27. </view>
  28. <view class="select-input">
  29. <input class="input" style="display:none;" />
  30. <text>退款时间:</text><input class="input" name="refundDate" disabled :value="refundDate"/>
  31. </view>
  32. <view class="select-input">
  33. <input class="input" style="display:none;" />
  34. <text>订单状态:</text><input class="input" name="status" disabled :value="status==1?('已支付'):(status==2?'退款中':'已退款')" />
  35. </view>
  36. <view class="btn-area">
  37. <button type="primary" formType="submit" >退款</button>
  38. </view>
  39. </form>
  40. </view>
  41. </template>
  42. <script>
  43. export default {
  44. data(){
  45. return{
  46. order:null,
  47. sn:null,
  48. clientId:null,
  49. productName:null,
  50. price:null,
  51. payDate:null,
  52. refundDate:null,
  53. status:null,
  54. altAvilBalance:null
  55. }
  56. },
  57. onLoad: function(option) {
  58. const order = JSON.parse(decodeURIComponent(option.order));
  59. this.order = order;
  60. this.sn = order.sn;
  61. this.clientId = order.clientId;
  62. this.productName = order.productName;
  63. this.price = order.price;
  64. this.payDate = order.payDate;
  65. this.refundDate = order.refundDate;
  66. this.status = order.status;
  67. },
  68. onShow() {
  69. this.mch();
  70. // console.log("订单详情")
  71. },
  72. methods: {
  73. orderSubmit(e) {
  74. uni.showModal({
  75. title: '退款',
  76. content: '确定执行退款操作?',
  77. success: (res) => {
  78. if (res.confirm) {
  79. var order = this.order;
  80. var token = uni.getStorageSync("token");
  81. uni.request({
  82. url: this.serverurl + '/TOrder/refund',
  83. data: {
  84. "sn": order.sn,
  85. "id": order.id,
  86. },
  87. header: {
  88. 'token': token
  89. },
  90. method: "POST",
  91. success: (res) => {
  92. var message = res.data.message;
  93. if(res.data.code){
  94. this.status = 2;
  95. }
  96. uni.showToast({
  97. title: message,
  98. duration: 3000
  99. });
  100. },
  101. });
  102. } else if (res.cancel) {
  103. // console.log('用户点击取消');
  104. }
  105. }
  106. });
  107. },
  108. mch(){
  109. var token = uni.getStorageSync("token");
  110. var globalUser = uni.getStorageSync("globalUser");
  111. uni.request({
  112. url: this.serverurl + '/TJoinpayMch/getMch',
  113. data: {
  114. "adminId": globalUser.id,
  115. },
  116. header: {
  117. 'token': token
  118. },
  119. method: "POST",
  120. success: (res) => {
  121. var date = res.data.data;
  122. this.altAvilBalance = date.altAvilBalance;
  123. },
  124. });
  125. }
  126. }
  127. }
  128. </script>
  129. <style lang="scss">
  130. .home-getOrder {
  131. padding-top: 50upx;
  132. }
  133. .select-input {
  134. display: flex;
  135. flex-direction: row;
  136. justify-content: flex-start;
  137. font-size: 16px;
  138. border-bottom: 1px solid;
  139. margin: 20upx 30upx 30upx 30upx;
  140. // box-shadow: 0upx 0upx 20upx #D3D3D3;
  141. text {
  142. margin-left: 30upx;
  143. }
  144. input {
  145. padding-left: 20upx;
  146. background-color: #FFFFFF;
  147. width: 400upx;
  148. height: 50upx;
  149. // box-shadow: 0upx 0upx 20upx #D3D3D3;
  150. // border-radius: 5upx;
  151. }
  152. }
  153. .form {
  154. width: calc(100% - 100upx);
  155. padding: 50upx;
  156. // .section{
  157. // margin:50upx 0;
  158. // }
  159. .btn-area {
  160. margin-top: 50upx;
  161. padding: 50upx;
  162. button {
  163. background-color: #007AFF;
  164. }
  165. }
  166. }
  167. </style>