loan.vue 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246
  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 common-view-box flex-direction" ref="commonView" id="commonView">
  13. <LoanItem :task-list="list" @onCalculate="onCalculate" :commonHeight='commonHeight'></LoanItem>
  14. </view>
  15. <Tab class="tabView" :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. commonHeight: ''
  109. }
  110. },
  111. watch: {},
  112. onShow() {
  113. this.getList()
  114. },
  115. onLoad() {},
  116. mounted() {
  117. this.commonViewHeight()
  118. },
  119. methods: {
  120. commonViewHeight() {
  121. this.$nextTick(() => {
  122. let tabView = ''
  123. uni.createSelectorQuery().select('.tabView').boundingClientRect(data => {
  124. // this.commonHeight = data.height;
  125. tabView = data.height
  126. }).exec()
  127. uni.createSelectorQuery().select('.common-view-box').boundingClientRect(data => {
  128. console.log(data.height,tabView,'1111111');
  129. this.commonHeight = data.height - tabView;
  130. console.log(this.commonHeight,'1111111');
  131. }).exec()
  132. });
  133. },
  134. // setMemberData(memberData) {
  135. // this.memberData = memberData
  136. // this.$refs.columnObj.updateMemberData()
  137. // },
  138. startList() {
  139. this.fromData.status = this.current
  140. this.total = 999;
  141. this.list = [];
  142. this.page = 1;
  143. this.isAjax = false;
  144. this.getList();
  145. },
  146. setSearch(text) {
  147. this.fromData.selectStr = text
  148. this.startList()
  149. },
  150. getList() {
  151. this.list = uni.getStorageSync('loanList')
  152. console.log(this.list, '1111111111');
  153. // getLoanList(this.fromData).then((res) => {
  154. // if (res.code === 1) {
  155. // this.list = [...this.list, ...res.data.items]
  156. // this.total = res.data.total
  157. // this.tabsList[1].name = '未完成(' + res.data.noNum + ')'
  158. // this.tabsList[1].is_dot = res.data.noNum > 0;
  159. // } else {
  160. // tools.error(res.msg)
  161. // }
  162. // })
  163. },
  164. tabsChange(index) {
  165. this.current = index;
  166. // this.startList()
  167. },
  168. // 下拉刷新
  169. onRefresh() {
  170. setTimeout(() => {
  171. this.$refs.scroll.onEndPulling()
  172. }, 200)
  173. console.log("下拉刷新");
  174. },
  175. // 滚动到底部
  176. onScrollBottom() {
  177. uni.showLoading({
  178. title: '数据加载中'
  179. })
  180. setTimeout(() => {
  181. uni.showToast({
  182. title: '加载完成',
  183. icon: 'none'
  184. })
  185. }, 1000)
  186. console.log("到底部了");
  187. },
  188. setComputation() {
  189. uni.navigateTo({
  190. url: "/pages/loan/module/rate_compare?loanId=" + this.loanItem.id +
  191. '&interestRate=' + this.loanItem.interest_rate +
  192. '&newInterestRate=' + this.loanItem.new_rate
  193. })
  194. },
  195. onPerfectRate() {
  196. uni.navigateTo({
  197. url: "/pages/loan/module/perfect_rate"
  198. })
  199. },
  200. onCalculate(data) {
  201. this.loanItem.id = data.item.id
  202. if (data.type === 1) {
  203. this.loanItem.interest_rate = data.item.interest_rate
  204. this.$refs.popup.open('bottom')
  205. } else {
  206. this.loanItem.client_id = data.item.client_id
  207. this.$refs.clientPopup.open('bottom')
  208. }
  209. },
  210. onClose() {
  211. this.$refs.popup.close('bottom')
  212. this.$refs.clientPopup.close('bottom')
  213. },
  214. moveHandle() {
  215. return false
  216. }
  217. },
  218. }
  219. </script>
  220. <style lang="scss" scoped>
  221. // .page-box{
  222. // height: 100vh;
  223. // background-image: url("https://wealfavor-1257406827.cos.ap-beijing.myqcloud.com/new-xcx/index/index-bg.png?imageMogr2/quality/20");
  224. // background-repeat: no-repeat;
  225. // background-size: 100% auto;
  226. // display: flex;
  227. // flex-direction: column;
  228. // .top-data{
  229. // flex: 1;
  230. // overflow: hidden;
  231. // .top-row{
  232. // height: 680rpx;
  233. // }
  234. // }
  235. // .bottom-data{
  236. // }
  237. // }
  238. </style>