afterInfo.vue 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. <template>
  2. <mobile-frame>
  3. <view class="main">
  4. <view class="info">
  5. <view class="one">
  6. <view class="left">售后状态</view>
  7. <view class="right">{{info.zhStatus||'暂无'}}</view>
  8. </view>
  9. <view class="one">
  10. <view class="left">售后类型</view>
  11. <view class="right">{{info.zhType||'暂无'}}</view>
  12. </view>
  13. <view class="one">
  14. <view class="left">申请时间</view>
  15. <view class="right">{{info.apply_time||'暂无'}}</view>
  16. </view>
  17. <view class="one">
  18. <view class="left">售后结束时间</view>
  19. <view class="right">{{info.end_time||'暂无'}}</view>
  20. </view>
  21. <view class="one">
  22. <view class="left">售后描述</view>
  23. <view class="right">{{info.desc||'暂无'}}</view>
  24. </view>
  25. <view class="one">
  26. <view class="left">申请理由</view>
  27. <view class="right">{{info.zhReason||'暂无'}}</view>
  28. </view>
  29. <view class="one" v-if="info.type!='3'">
  30. <view class="left">退款金额</view>
  31. <view class="right">¥{{info.money||0}}</view>
  32. </view>
  33. <view class="one" v-if="info.type!='1'">
  34. <view class="left">用户退货单号</view>
  35. <view class="right">{{info.transport.customer_transport_no||'暂无'}}</view>
  36. </view>
  37. <view class="one" v-if="info.type=='3'">
  38. <view class="left">商家退货单号</view>
  39. <view class="right">{{info.transport.shop_transport_no||'暂无'}}</view>
  40. </view>
  41. <view class="one">
  42. <view class="left">售后处理人</view>
  43. <view class="right">{{info.deal_person.name||'暂无'}}</view>
  44. </view>
  45. <view class="one" v-if="status!= '0'">
  46. <view class="left">团长建议</view>
  47. <view class="right">{{info.leader_suggest==true?'同意':info.leader_suggest==false?'不同意':'暂无'}}</view>
  48. </view>
  49. </view>
  50. </view>
  51. </mobile-frame>
  52. </template>
  53. <script>
  54. export default {
  55. data() {
  56. return {
  57. id: '',
  58. status: '',
  59. user: {},
  60. info: {},
  61. // 售后状态
  62. statusList: [],
  63. // 售后类型
  64. typeList: [],
  65. // 申请理由
  66. reasonList: [],
  67. };
  68. },
  69. onLoad: async function(e) {
  70. const that = this;
  71. that.$set(that, `id`, e.id || '');
  72. that.$set(that, `status`, e.status || '');
  73. await that.searchOther();
  74. await that.watchLogin();
  75. },
  76. methods: {
  77. // 查询其他信息
  78. async searchOther() {
  79. const that = this;
  80. let res;
  81. res = await that.$api(`/dictData`, 'GET', {
  82. code: "afterSale_status"
  83. });
  84. if (res.errcode == '0') that.$set(that, `statusList`, res.data)
  85. res = await that.$api(`/dictData`, 'GET', {
  86. code: "afterSale_type"
  87. });
  88. if (res.errcode == '0') that.$set(that, `typeList`, res.data)
  89. res = await that.$api(`/dictData`, 'GET', {
  90. code: "afterSale_reason"
  91. });
  92. if (res.errcode == '0') that.$set(that, `reasonList`, res.data)
  93. },
  94. // 监听用户是否登录
  95. watchLogin() {
  96. const that = this;
  97. uni.getStorage({
  98. key: 'token',
  99. success: async function(res) {
  100. let user = that.$jwt(res.data);
  101. if (user) {
  102. that.$set(that, `user`, user);
  103. if (that.id) {
  104. //售后详情
  105. let arr;
  106. if (that.status == '0') arr = await that.$api(`/afterSale/${that.id}`, 'GET')
  107. else arr = await that.$api(`/groupAfterSale/${that.id}`, 'GET', {}, 'group')
  108. if (arr.errcode == '0') {
  109. let status = that.statusList.find(i => i.value == arr.data.status)
  110. if (status) arr.data.zhStatus = status.label;
  111. let type = that.typeList.find(i => i.value == arr.data.type)
  112. if (type) arr.data.zhType = type.label;
  113. let reason = that.reasonList.find(i => i.value == arr.data.reason)
  114. if (reason) arr.data.zhReason = reason.label;
  115. that.$set(that, `info`, arr.data)
  116. }
  117. }
  118. }
  119. },
  120. fail: function(err) {
  121. uni.navigateTo({
  122. url: `/pages/login/index`
  123. })
  124. }
  125. });
  126. }
  127. }
  128. }
  129. </script>
  130. <style lang="scss">
  131. .main {
  132. display: flex;
  133. flex-direction: column;
  134. width: 100vw;
  135. height: 100vh;
  136. .info {
  137. padding: 2vw;
  138. .one {
  139. display: flex;
  140. justify-content: space-between;
  141. padding: 2vw;
  142. .left {
  143. color: #696969;
  144. font-size: var(--font14Size);
  145. }
  146. .right {
  147. width: 60vw;
  148. text-align: right;
  149. color: #A9A9A9;
  150. font-size: var(--font14Size);
  151. }
  152. }
  153. }
  154. }
  155. </style>