orderProcess.vue 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. this.$getUrlType()<template>
  2. <view>
  3. <view style="padding: 30rpx;">
  4. <view style="font-size: 30rpx;color: #b8b8b8;">
  5. 下单备注:
  6. </view>
  7. <view style="font-size: 40rpx;color: #9d9d9d;padding: 0 20rpx;">
  8. <view v-if="data.remark">
  9. {{data.remark}}
  10. </view>
  11. <view v-else>
  12. </view>
  13. </view>
  14. </view>
  15. <view style="padding: 30rpx;overflow: auto; height:650rpx;">
  16. <uni-steps :options="list" :active="active" direction="column" active-color="rgb(55,186,189)" />
  17. <view v-if="data.statusText === '已回收'">
  18. <button style="width: 600rpx;" @click="backOd">退单</button>
  19. </view>
  20. <view v-if="data.statusText === '已下单'">
  21. <button style="width: 600rpx;" @click="backOd">退单</button>
  22. </view>
  23. </view>
  24. <view v-if="data.statusText !== '已完成'" style="padding: 0 30rpx 30rpx 30rpx;background-color: #f5f5f5;">
  25. <view style="color: #9a9a9a;padding: 10rpx;">
  26. 问题反馈
  27. </view>
  28. <view style="margin-bottom: 40rpx;">
  29. <u-textarea v-model="form.processDesc" border></u-textarea>
  30. </view>
  31. <u-button text="发送" color="rgb(55,186,189)" @click="clientSubmit"></u-button>
  32. </view>
  33. </view>
  34. </template>
  35. <script>
  36. export default {
  37. data() {
  38. return {
  39. form: {
  40. orderNo: uni.getStorageSync("order").orderNumber,
  41. userCode: uni.getStorageSync("setUserName"),
  42. processDesc: '',
  43. },
  44. list: [],
  45. data: uni.getStorageSync("order"),
  46. active: 0
  47. }
  48. },
  49. onLoad() {
  50. this.getList()
  51. this.newsToOne()
  52. },
  53. onShow() {
  54. this.newsToOne()
  55. },
  56. methods: {
  57. async backOd() {
  58. const {
  59. data: res
  60. } = await this.$httpRequest({
  61. url: '/app/backOd?on=' + this.data.orderNumber,
  62. method: 'get',
  63. urlType: this.$getUrlType()
  64. });
  65. if (res.code === 200) {
  66. this.data.statusText = '已完成'
  67. uni.redirectTo({
  68. url: '../../pages/user/index',
  69. success() {
  70. uni.showModal({
  71. title: "提示",
  72. content: "积分已退还,订单结束",
  73. showCancel: false,
  74. confirmColor: 'rgb(55,186,189)'
  75. })
  76. }
  77. })
  78. }
  79. },
  80. async clientSubmit() {
  81. if (!this.form.processDesc) {
  82. this.$showModal("请填写反馈")
  83. return
  84. }
  85. const {
  86. data: res
  87. } = await this.$httpRequest({
  88. url: '/app/clientSubmit',
  89. method: 'post',
  90. data: this.form,
  91. urlType: 2
  92. });
  93. if (res.code === 200) {
  94. this.form.processDesc = ''
  95. this.getList()
  96. }
  97. },
  98. async newsToOne() {
  99. const {
  100. data: res
  101. } = await this.$httpRequest({
  102. url: '/app/nto?on=' + this.data.orderNumber,
  103. method: 'get',
  104. urlType: this.$getUrlType()
  105. });
  106. },
  107. async getList() {
  108. this.list = []
  109. const {
  110. data: res
  111. } = await this.$httpRequest({
  112. url: '/app/opl?uc=' + uni.getStorageSync("userInfo").userName + "&on=" + this.data
  113. .orderNumber,
  114. method: 'get',
  115. urlType: this.$getUrlType()
  116. });
  117. if (res.code === 200) {
  118. let data = res.data
  119. for (var i = 0; i < data.length; i++) {
  120. if (data[i].processStatus) {
  121. this.list.push({
  122. title: data[i].processStatus + " : " + data[i].processDesc,
  123. desc: data[i].processDate
  124. })
  125. } else {
  126. this.list.push({
  127. title: data[i].processDesc,
  128. desc: data[i].processDate
  129. })
  130. }
  131. if (data[i].processDate) {
  132. this.active = i
  133. }
  134. }
  135. } else {
  136. uni.showToast({
  137. duration: 2500,
  138. title: res.msg,
  139. icon: 'error',
  140. });
  141. }
  142. }
  143. }
  144. }
  145. </script>
  146. <style>
  147. </style>