info.vue 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198
  1. <template>
  2. <mobile-frame>
  3. <view class="main">
  4. <view class="info" v-if="type=='0'">
  5. <view class="one">
  6. <view class="left">返现金额</view>
  7. <view class="right">+{{info.money}}</view>
  8. </view>
  9. <view class="two">
  10. <view class="left">状态</view>
  11. <view class="right">{{info.zhStatus}}</view>
  12. </view>
  13. <view class="two">
  14. <view class="left">返现时间</view>
  15. <view class="right">{{info.time}}</view>
  16. </view>
  17. <view class="two">
  18. <view class="left">推荐人</view>
  19. <view class="right">{{info.inviter_name}}</view>
  20. </view>
  21. <view class="two">
  22. <view class="left">来源</view>
  23. <view class="right">{{info.zhSource}}</view>
  24. </view>
  25. </view>
  26. <view class="info" v-else>
  27. <view class="one">
  28. <view class="left">提现金额</view>
  29. <view class="right">-{{info.money}}</view>
  30. </view>
  31. <view class="two">
  32. <view class="left">审核处理人</view>
  33. <view class="right">{{info.deal_person}}</view>
  34. </view>
  35. <view class="two">
  36. <view class="left">申请时间</view>
  37. <view class="right">{{info.apply_time}}</view>
  38. </view>
  39. <view class="two">
  40. <view class="left">审核时间</view>
  41. <view class="right">{{info.exam_time}}</view>
  42. </view>
  43. <view class="two">
  44. <view class="left">申请理由</view>
  45. <view class="right">{{info.apply_reason}}</view>
  46. </view>
  47. <view class="two">
  48. <view class="left">审核理由</view>
  49. <view class="right">{{info.exam_reason}}</view>
  50. </view>
  51. <view class="two">
  52. <view class="left">审核状态</view>
  53. <view class="right">{{info.zhStatus}}</view>
  54. </view>
  55. </view>
  56. </view>
  57. </mobile-frame>
  58. </template>
  59. <script>
  60. export default {
  61. data() {
  62. return {
  63. id: '',
  64. // 类型
  65. type: '',
  66. user: {},
  67. info: {},
  68. // 收益状态
  69. statusList: [],
  70. // 提现状态
  71. cashstatusList: [],
  72. // 来源
  73. sourceList: [],
  74. };
  75. },
  76. onLoad: async function(e) {
  77. const that = this;
  78. that.$set(that, `id`, e.id || '');
  79. that.$set(that, `type`, e.type || '');
  80. await that.searchOther();
  81. await that.watchLogin();
  82. },
  83. methods: {
  84. // 查询其他信息
  85. async searchOther() {
  86. const that = this;
  87. let res;
  88. res = await that.$api(`/dictData`, 'GET', {
  89. code: "cashBack_status"
  90. });
  91. if (res.errcode == '0') {
  92. that.$set(that, `statusList`, res.data)
  93. }
  94. res = await that.$api(`/dictData`, 'GET', {
  95. code: "cashBack_source"
  96. });
  97. if (res.errcode == '0') {
  98. that.$set(that, `sourceList`, res.data)
  99. }
  100. res = await that.$api(`/dictData`, 'GET', {
  101. code: "withdrawal_exam_status"
  102. });
  103. if (res.errcode == '0') {
  104. that.$set(that, `cashstatusList`, res.data)
  105. }
  106. },
  107. // 监听用户是否登录
  108. watchLogin() {
  109. const that = this;
  110. uni.getStorage({
  111. key: 'token',
  112. success: async function(res) {
  113. let user = that.$jwt(res.data);
  114. if (user) {
  115. that.$set(that, `user`, user);
  116. if (that.id) {
  117. if (that.type == '0') {
  118. // 收益记录
  119. let arr = await that.$api(`/cashBack/${that.id}`, 'GET')
  120. if (arr.errcode == '0') {
  121. let status = that.statusList.find(i => i.value == arr.data.status)
  122. if (status) arr.data.zhStatus = status.label;
  123. let source = that.sourceList.find(i => i.value == arr.data.source)
  124. if (source) arr.data.zhSource = source.label;
  125. // 查询推荐人信息
  126. let res = await that.$api(`/user/${arr.data.inviter}`, 'GET');
  127. if (res.errcode == '0') arr.data.inviter_name = res.data.name
  128. that.$set(that, `info`, arr.data)
  129. }
  130. } else {
  131. // 提现记录
  132. let arr = await that.$api(`/cashOut/${that.id}`, 'GET')
  133. if (arr.errcode == '0') {
  134. let status = that.cashstatusList.find(i => i.value == arr.data.status)
  135. if (status) arr.data.zhStatus = status.label;
  136. that.$set(that, `info`, arr.data)
  137. }
  138. }
  139. }
  140. }
  141. },
  142. fail: function(err) {
  143. uni.navigateTo({
  144. url: `/pages/login/index`
  145. })
  146. }
  147. });
  148. }
  149. }
  150. }
  151. </script>
  152. <style lang="scss">
  153. .main {
  154. display: flex;
  155. flex-direction: column;
  156. width: 100vw;
  157. height: 100vh;
  158. .info {
  159. padding: 2vw;
  160. .one {
  161. display: flex;
  162. justify-content: space-between;
  163. padding: 10vw 2vw;
  164. border-bottom: 0.5vw solid var(--f1Color);
  165. .left {
  166. color: #696969;
  167. font-size: var(--font14Size);
  168. }
  169. .right {
  170. font-size: var(--font16Size);
  171. font-weight: bold;
  172. }
  173. }
  174. .two {
  175. display: flex;
  176. justify-content: space-between;
  177. padding: 2vw;
  178. .left {
  179. color: #696969;
  180. font-size: var(--font14Size);
  181. }
  182. .right {
  183. color: #A9A9A9;
  184. font-size: var(--font14Size);
  185. }
  186. }
  187. }
  188. }
  189. </style>