index.vue 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282
  1. <template>
  2. <view class="main">
  3. <view class="tips">
  4. <text class="icon">&#xe694;</text>
  5. <text>账户余额保障中</text>
  6. </view>
  7. <view class="mcard">
  8. <view class="money">{{ money }}</view>
  9. <view class="desc">账户余额(元)</view>
  10. <view class="flex">
  11. <view class="f">
  12. <button class="btn" style="background-color: #607d8b" @click="go('/pages/user/money/cash_out')">
  13. <text class="icon">&#xe612;</text>
  14. <text>提现</text>
  15. </button>
  16. </view>
  17. <view class="f">
  18. <button class="btn" @click="go('/pages/user/money/add')">
  19. <text class="icon">&#xe7c4;</text>
  20. <text>充值</text>
  21. </button>
  22. </view>
  23. </view>
  24. </view>
  25. <view class="tab">
  26. <u-tabs :list="type" @click="click($event, 'type')"></u-tabs>
  27. </view>
  28. <view class="list">
  29. <view class="item" v-for="(item, index) in list" :key="index" @click="popup(item)">
  30. <view class="title">{{ item.title }}</view>
  31. <view class="desc">
  32. <text v-if="item.state == 0 && item.type == 0 && item.payWay == 0" style="color: #f44336">未支付</text>
  33. <text v-if="item.state == 0 && item.type == 0 && item.payWay == 1" style="color: #f44336">待审核</text>
  34. <text v-if="item.state == 1 && item.type == 0" style="color: #4caf50">充值成功</text>
  35. <text v-if="item.state == 1 && item.type == 1" style="color: #4caf50">兼职支出</text>
  36. <text v-if="item.state == 0 && item.type == 2" style="color: #f44336">提现审核中...</text>
  37. <text v-if="item.state == 1 && item.type == 2" style="color: #4caf50">提现成功</text>
  38. <text v-if="item.state == 1 && item.type == 3" style="color: #4caf50">兼职收入</text>
  39. <text v-if="item.state == 2 && item.type == 2" style="color: #f44336">
  40. <text class="icon" style="padding-right: 5px">&#xe610;</text>
  41. <text>提现失败,退回余额</text>
  42. </text>
  43. <text v-if="item.state == 2 && item.payWay == 1" style="color: #f44336">
  44. <text class="icon" style="padding-right: 5px">&#xe610;</text>
  45. <text>审核失败</text>
  46. </text>
  47. <text v-if="item.state == 1 && item.type == 4" style="color: #4caf50">退款成功</text>
  48. <text>{{ item.createTime }}</text>
  49. </view>
  50. <view class="price">
  51. <text v-if="item.type == 0 || item.type == 3 || item.type == 4" style="color: orangered">+{{ item.money }}元</text>
  52. <text v-if="item.type == 1" style="color: darkgray">-{{ item.money }}元</text>
  53. <text v-if="item.type == 2 && item.state == 0" style="color: darkgray">-{{ item.money }}元</text>
  54. <text v-if="item.type == 2 && item.state == 1" style="color: darkgray">-{{ item.money }}元</text>
  55. <text v-if="item.type == 2 && item.state == 2" style="color: #f44336">+{{ item.money }}元</text>
  56. </view>
  57. </view>
  58. <view class="loading" v-if="loadMore"><u-loadmore :status="loadMore ? 'loading' : 'nomore'" /></view>
  59. <u-empty v-if="!loadMore && list.length == 0"></u-empty>
  60. </view>
  61. <u-popup :show="show" round="15" mode="center" :closeable="true" :customStyle="{ width: '95%' }" @close="show = false">
  62. <view class="popup">
  63. <view class="mtt" v-if="item.type == 0 && item.payWay == 0">微信充值</view>
  64. <view class="mtt" v-if="item.type == 0 && item.payWay == 1">转账充值</view>
  65. <view class="mtt" v-if="item.type == 1">兼职支出</view>
  66. <view class="mtt" v-if="item.type == 2">余额提现</view>
  67. <view class="mtt" v-if="item.type == 3">兼职收入</view>
  68. <view class="mtt" v-if="item.type == 4">余额退款</view>
  69. <view>
  70. <view class="item">
  71. <text class="tt">操作内容</text>
  72. <text class="la">{{ item.title }}</text>
  73. </view>
  74. <view class="item" v-if="item.type == 0">
  75. <text class="tt">充值金额</text>
  76. <text class="la">¥{{ item.money }}</text>
  77. </view>
  78. <view class="item" v-if="item.type == 1">
  79. <text class="tt">兼职金额</text>
  80. <text class="la">¥{{ (item.money - item.serviceMoney).toFixed(2) }}</text>
  81. </view>
  82. <view class="item" v-if="item.type == 2">
  83. <text class="tt">提现金额</text>
  84. <text class="la">¥{{ item.money }}</text>
  85. </view>
  86. <view class="item" v-if="item.type == 3">
  87. <text class="tt">收入金额</text>
  88. <text class="la">¥{{ item.money }}</text>
  89. </view>
  90. <view class="item" v-if="item.type == 4">
  91. <text class="tt">兼职金额</text>
  92. <text class="la">¥{{ item.money }}</text>
  93. </view>
  94. <view class="item" v-if="item.serviceMoney">
  95. <text class="tt">服务费</text>
  96. <text class="la">¥{{ item.serviceMoney }}</text>
  97. </view>
  98. <view class="item" v-if="item.rate">
  99. <text class="tt">{{ item.type == 1 ? '兼职费率' : '提现费率' }}</text>
  100. <text class="la">{{ item.rate }}%</text>
  101. </view>
  102. <view class="item" v-if="item.type == 1">
  103. <text class="tt">实际扣除</text>
  104. <text class="la">¥{{ item.money }}</text>
  105. </view>
  106. <view class="item" v-if="item.type == 2">
  107. <text class="tt">实际到账</text>
  108. <text class="la">¥{{ (item.money - item.serviceMoney).toFixed(2) }}</text>
  109. </view>
  110. <view class="item">
  111. <text class="tt">操作状态</text>
  112. <text class="la" v-if="item.state == 0 && item.type == 0 && item.payWay == 0" style="color: #f44336">未支付</text>
  113. <text class="la" v-if="item.state == 0 && item.type == 0 && item.payWay == 1" style="color: #f44336">待审核</text>
  114. <text class="la" v-if="item.state == 2 && item.type == 0 && item.payWay == 1" style="color: #f44336">审核不通过</text>
  115. <text class="la" v-if="item.state == 1 && item.type == 0" style="color: #4caf50">充值成功</text>
  116. <text class="la" v-if="item.state == 1 && item.type == 1" style="color: #4caf50">支出成功</text>
  117. <text class="la" v-if="item.state == 0 && item.type == 2" style="color: #f44336">提现审核中...</text>
  118. <text class="la" v-if="item.state == 1 && item.type == 2" style="color: #4caf50">提现成功</text>
  119. <text class="la" v-if="item.state == 1 && item.type == 3" style="color: #4caf50">入账成功</text>
  120. <text class="la" v-if="item.state == 2 && item.type == 2" style="color: #f44336">提现失败,退回余额</text>
  121. <text class="la" v-if="item.state == 1 && item.type == 4" style="color: #4caf50">退款成功</text>
  122. </view>
  123. <view class="item" v-if="item.type == 0 && item.payWay == 1">
  124. <text class="tt">转账凭证</text>
  125. <view class="la">
  126. <image :src="ip + item.certificate" mode="aspectFill" @click="preview(item.certificate)"></image>
  127. </view>
  128. </view>
  129. <view class="item" v-if="item.state == 2 && item.msg">
  130. <text class="tt">失败原因</text>
  131. <text class="la" style="color: #f44336">{{ item.msg }}</text>
  132. </view>
  133. <view class="item">
  134. <text class="tt">创建时间</text>
  135. <text class="la">{{ item.createTime }}</text>
  136. </view>
  137. <view class="item" v-if="item.completeTime">
  138. <text class="tt">审核时间</text>
  139. <text class="la">{{ item.completeTime }}</text>
  140. </view>
  141. </view>
  142. </view>
  143. </u-popup>
  144. </view>
  145. </template>
  146. <script>
  147. export default {
  148. data() {
  149. return {
  150. ip: this.http.ip,
  151. money: 0,
  152. current: 0,
  153. type: [
  154. { name: '全部', value: '' },
  155. { name: '充值', value: 0 },
  156. { name: '支出', value: 1 },
  157. { name: '提现', value: 2 },
  158. { name: '收入', value: 3 },
  159. { name: '退款', value: 4 }
  160. ],
  161. list: [],
  162. param: { pageNum: 1, pageSize: 10 },
  163. loadMore: true,
  164. show: false,
  165. item: {}
  166. };
  167. },
  168. onLoad(e) {
  169. this.getInfo();
  170. this.getData();
  171. uni.$on('payMoney', (res) => {
  172. this.getInfo();
  173. this.refresh();
  174. });
  175. },
  176. methods: {
  177. getInfo() {
  178. this.http.request({
  179. url: '/app/user/info',
  180. success: (res) => {
  181. this.money = res.data.data.money;
  182. uni.setStorageSync('money', res.data.data.money || 0);
  183. }
  184. });
  185. },
  186. getData() {
  187. this.http.request({
  188. url: '/app/pay/list',
  189. data: this.param,
  190. loading: 'false',
  191. success: (res) => {
  192. this.loadMore = res.data.pages > this.param.pageNum ? true : false;
  193. this.list.push(...res.data.rows);
  194. }
  195. });
  196. },
  197. click(e) {
  198. this.param.type = e.value;
  199. this.refresh();
  200. },
  201. popup(item) {
  202. this.item = item;
  203. this.show = true;
  204. },
  205. go(url) {
  206. uni.navigateTo({ url: url });
  207. },
  208. preview(certificate) {
  209. uni.previewImage({
  210. urls: [this.ip + certificate],
  211. current: this.ip + certificate,
  212. success: (res) => {}
  213. });
  214. },
  215. //刷新数据
  216. refresh() {
  217. this.loadMore = true;
  218. this.param.pageNum = 1;
  219. this.list = [];
  220. this.getData();
  221. }
  222. },
  223. //下拉刷新
  224. onPullDownRefresh() {
  225. setTimeout(() => {
  226. this.refresh();
  227. this.getInfo();
  228. uni.stopPullDownRefresh();
  229. }, 1000);
  230. },
  231. //上拉加载
  232. onReachBottom() {
  233. if (this.loadMore) {
  234. this.param.pageNum++;
  235. this.getData();
  236. }
  237. }
  238. };
  239. </script>
  240. <style lang="scss">
  241. .main {
  242. padding-top: 5px;
  243. }
  244. .tips {
  245. border-radius: 5px;
  246. margin-bottom: 8px;
  247. }
  248. .list {
  249. background-color: white;
  250. border-radius: 8px;
  251. padding: 15px 15px 15px 15px;
  252. .item {
  253. padding: 15px 0px 15px 0px;
  254. border-bottom: 1px solid $line;
  255. padding-bottom: 10px;
  256. &:first-child {
  257. padding-top: 0px;
  258. }
  259. &:last-child {
  260. border: 0px;
  261. padding-bottom: 5px;
  262. }
  263. .title {
  264. width: 70%;
  265. }
  266. .desc {
  267. font-size: 14px;
  268. padding-top: 5px;
  269. color: $font-c;
  270. text {
  271. padding-right: 15px;
  272. }
  273. }
  274. .price {
  275. float: right;
  276. margin-top: -48px;
  277. }
  278. }
  279. }
  280. </style>