loan.vue 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228
  1. <template>
  2. <view class="flex-common-css page-box task-bg">
  3. <Nav title="" :back="false" :is_fixed="true" :justify="'left'" :color="'#fff'">
  4. <view class="p-20">
  5. <IndexPersonal ref="memberObj" @setMemberData="setMemberData"></IndexPersonal>
  6. <IndexColumn ref="columnObj"></IndexColumn>
  7. </view>
  8. </Nav>
  9. <!-- <EnScroll ref="scroll" :navHeight="100" is_tabHeight @onRefresh="onRefresh"
  10. @onScrollBottom="onScrollBottom">
  11. </EnScroll> -->
  12. <view class="common-view-css flex-direction">
  13. <LoanItem :task-list="list" @onCalculate="onCalculate"></LoanItem>
  14. </view>
  15. <Tab :tab-index="0"></Tab>
  16. <uni-popup ref="popup" type="bottom" @touchmove.stop.prevent="moveHandle">
  17. <view class="page-env-160 sys-background-fff r-20">
  18. <view class="row-justify-sb center p-lr30 p-t30">
  19. <view class="wh-25"></view>
  20. <text class="size-30 sys-weight-600">核算年利率</text>
  21. <image class="wh-25"
  22. src="https://wealfavor-1257406827.cos.ap-beijing.myqcloud.com/new-xcx/task-details/close.png"
  23. mode="aspectFill" @click="onClose">
  24. </image>
  25. </view>
  26. <view class="p-30 size-28 m-b50">
  27. <view class="">
  28. <text>当前年利率</text><text
  29. class="sys-weight-600 color-FF730E m-l10">{{(loanItem.interest_rate*1).toFixed(2)}}%</text>
  30. </view>
  31. <view class="row-justify-sb center r-10 sys-from-background-color p-30 m-t30">
  32. <input class="flex" type="text" placeholder="请输入新年利率" v-model="loanItem.new_rate" />
  33. <text class="text-color-12">%</text>
  34. </view>
  35. </view>
  36. <EnButton text="确认核算" @onSubmit="setComputation"></EnButton>
  37. </view>
  38. </uni-popup>
  39. <!-- <EnButton :is_both="1" leftText="利率对比" rightText="完善贷后" @onLeftSubmit="onRateCompare" @onSubmit="onPerfectRate">-->
  40. <!-- </EnButton>-->
  41. <uni-popup background-color="#fff" ref="clientPopup" type="bottom" border-radius="10px"
  42. @touchmove.stop.prevent="moveHandle">
  43. <view>
  44. <client-type :client-id="loanItem.client_id" @endTaskSet="onClose"></client-type>
  45. </view>
  46. </uni-popup>
  47. </view>
  48. </template>
  49. <script>
  50. // 任务列表
  51. import LoanItem from "@/common/task/loan-item.vue";
  52. import {
  53. getLoanList
  54. } from "@/api/task";
  55. import tools from "@/service/tools";
  56. import loanItem from "@/common/task/loan-item.vue";
  57. import EnSelect from "@/components/en-utils/en-select/en-select.vue";
  58. import ClientType from "@/pages/loan/components/clientType.vue";
  59. // 个人信息
  60. import IndexColumn from "@/pages/index/module/index_column.vue"
  61. // 顶部栏目
  62. import IndexPersonal from "@/pages/index/module/index_personal.vue"
  63. export default {
  64. components: {
  65. ClientType,
  66. EnSelect,
  67. LoanItem,
  68. IndexColumn,
  69. IndexPersonal
  70. },
  71. data() {
  72. return {
  73. current: 0,
  74. tabsList: [{
  75. name: '全部',
  76. disabled: false
  77. }, {
  78. name: '未完成(0)',
  79. dot_color: 'red',
  80. is_dot: false,
  81. disabled: false
  82. }, {
  83. name: '已完成',
  84. dot_color: 'red',
  85. is_dot: false,
  86. disabled: false
  87. }],
  88. searchText: "",
  89. fromData: {
  90. status: 0,
  91. interest_rate: '', //利率区间 数组或者字符串,连接
  92. residue_num: '', //剩余期数
  93. product_name: '', //产品名称
  94. phone: '', //电话号码
  95. selectStr: '', //电话号码
  96. name: '', //客户名称
  97. productId: '', //产品ID
  98. page: 1,
  99. },
  100. total: 0,
  101. list: [],
  102. loanItem: {
  103. interest_rate: 0,
  104. id: 0,
  105. new_rate: '',
  106. client_id: '',
  107. }
  108. }
  109. },
  110. watch: {},
  111. onShow() {
  112. this.getList()
  113. },
  114. onLoad() {},
  115. mounted() {},
  116. methods: {
  117. // setMemberData(memberData) {
  118. // this.memberData = memberData
  119. // this.$refs.columnObj.updateMemberData()
  120. // },
  121. startList() {
  122. this.fromData.status = this.current
  123. this.total = 999;
  124. this.list = [];
  125. this.page = 1;
  126. this.isAjax = false;
  127. this.getList();
  128. },
  129. setSearch(text) {
  130. this.fromData.selectStr = text
  131. this.startList()
  132. },
  133. getList() {
  134. this.list = uni.getStorageSync('loanList')
  135. console.log(this.list, '1111111111');
  136. // getLoanList(this.fromData).then((res) => {
  137. // if (res.code === 1) {
  138. // this.list = [...this.list, ...res.data.items]
  139. // this.total = res.data.total
  140. // this.tabsList[1].name = '未完成(' + res.data.noNum + ')'
  141. // this.tabsList[1].is_dot = res.data.noNum > 0;
  142. // } else {
  143. // tools.error(res.msg)
  144. // }
  145. // })
  146. },
  147. tabsChange(index) {
  148. this.current = index;
  149. // this.startList()
  150. },
  151. // 下拉刷新
  152. onRefresh() {
  153. setTimeout(() => {
  154. this.$refs.scroll.onEndPulling()
  155. }, 200)
  156. console.log("下拉刷新");
  157. },
  158. // 滚动到底部
  159. onScrollBottom() {
  160. uni.showLoading({
  161. title: '数据加载中'
  162. })
  163. setTimeout(() => {
  164. uni.showToast({
  165. title: '加载完成',
  166. icon: 'none'
  167. })
  168. }, 1000)
  169. console.log("到底部了");
  170. },
  171. setComputation() {
  172. uni.navigateTo({
  173. url: "/pages/loan/module/rate_compare?loanId=" + this.loanItem.id +
  174. '&interestRate=' + this.loanItem.interest_rate +
  175. '&newInterestRate=' + this.loanItem.new_rate
  176. })
  177. },
  178. onPerfectRate() {
  179. uni.navigateTo({
  180. url: "/pages/loan/module/perfect_rate"
  181. })
  182. },
  183. onCalculate(data) {
  184. this.loanItem.id = data.item.id
  185. if (data.type === 1) {
  186. this.loanItem.interest_rate = data.item.interest_rate
  187. this.$refs.popup.open('bottom')
  188. } else {
  189. this.loanItem.client_id = data.item.client_id
  190. this.$refs.clientPopup.open('bottom')
  191. }
  192. },
  193. onClose() {
  194. this.$refs.popup.close('bottom')
  195. this.$refs.clientPopup.close('bottom')
  196. },
  197. moveHandle() {
  198. return false
  199. }
  200. },
  201. }
  202. </script>
  203. <style lang="scss" scoped>
  204. // .page-box{
  205. // height: 100vh;
  206. // background-image: url("https://wealfavor-1257406827.cos.ap-beijing.myqcloud.com/new-xcx/index/index-bg.png?imageMogr2/quality/20");
  207. // background-repeat: no-repeat;
  208. // background-size: 100% auto;
  209. // display: flex;
  210. // flex-direction: column;
  211. // .top-data{
  212. // flex: 1;
  213. // overflow: hidden;
  214. // .top-row{
  215. // height: 680rpx;
  216. // }
  217. // }
  218. // .bottom-data{
  219. // }
  220. // }
  221. </style>