withdraw.vue 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344
  1. <template>
  2. <view>
  3. <u-navbar title="提现"></u-navbar>
  4. <view class="withdraw">
  5. <view class="withdraw-head">
  6. <b>提现至</b><span>{{code}}</span>
  7. </view>
  8. <view class="withdraw-head">
  9. <b>选择提现站点</b>
  10. <span >
  11. <picker @change="bindPickerChange" range-key="name" :range="stationList">
  12. <view class="uni-input">{{stationObj.name?stationObj.name:'无站点'}}<text class="iconfont more">
  13. &#xe600;
  14. </text></view>
  15. </picker>
  16. </span>
  17. </view>
  18. <view class="withdraw-head">
  19. <b>上次提现时间</b><span>{{info.startTime}}</span>
  20. </view>
  21. <view class="withdraw-head">
  22. <b>本次提现时间</b><span>{{info.endTime}}</span>
  23. </view>
  24. <view class="withdraw-head">
  25. <b>此期间累计产生订单数</b><span>{{info.total}}笔</span>
  26. </view>
  27. <view class="withdraw-head">
  28. <b>此期间总分润金额</b><span class="whthdraw-price">{{info.amount?info.amount:0}}元</span>
  29. </view>
  30. <view class="withdraw-head">
  31. <b>此期间累计产生包月卡分润数</b><span>10笔</span>
  32. </view>
  33. <view class="withdraw-head">
  34. <b>此期间把偶月卡分润金额</b><span class="whthdraw-price">102.00元</span>
  35. </view>
  36. <view class="withdraw-main" v-if="false">
  37. <p>申请提现金额(元)</p>
  38. <view class="withdraw-input">
  39. <span>¥</span>
  40. <u-input v-model="value" :type="type" placeholder-style="font-size:28px;height:40px;line-height:40px;color:#ccc;" />
  41. </view>
  42. </view>
  43. <view class="withdraw-head">
  44. <b>是否开票</b><span >
  45. <u-radio-group v-model="invoiceRequired" >
  46. <u-radio v-for="(item, index) in list2"
  47. style="margin-right: 16px;"
  48. :key="index+'a'" :name="item.value"
  49. :disabled="item.disabled" active-color="#00b962">
  50. {{item.name}}
  51. </u-radio>
  52. </u-radio-group>
  53. </span>
  54. </view>
  55. <view class="withdraw-head">
  56. <b>发票类型</b><span >
  57. <u-radio-group v-model="invoiceType" >
  58. <u-radio v-for="(item, index) in list1" :key="index+'a'" :name="item.value"
  59. :disabled="item.disabled" active-color="#00b962">
  60. {{item.name}}
  61. </u-radio>
  62. </u-radio-group>
  63. </span>
  64. </view>
  65. <view class="withdraw-head" >
  66. <b>开票税率(%)</b>
  67. <span class="withdraw-input">
  68. <u-input
  69. height="20px"
  70. placeholder="请输入内容"
  71. input-align="right"
  72. type="digit"
  73. v-model="taxRate"
  74. ></u-input>
  75. </span>
  76. </view>
  77. </view>
  78. <view class="applyBtn">
  79. <u-button :class="{
  80. 'applyBtn-btn':!info.amount
  81. }" @click="submit()" type="primary">申请提现,等待财务转账</u-button>
  82. </view>
  83. <view class="withdraw-tips">
  84. <h4>提现说明:</h4>
  85. <p>由于银行清算,提现申请将于次日内到账。如遇高峰期,可能延时到账,请耐心等待。</p>
  86. </view>
  87. </view>
  88. </template>
  89. <script>
  90. import * as API from '@/apis/finance.js'
  91. import {
  92. parseUnixTime,
  93. substrMb
  94. } from '@/utils'
  95. export default {
  96. data() {
  97. return {
  98. info:{},
  99. code:"",
  100. value: '',
  101. type: 'number',
  102. nowTime:"",
  103. taxRate:"",
  104. invo:"",
  105. invoiceRequired:"1",
  106. invoiceType:"1",
  107. stationList:[],
  108. stationObj:{},
  109. list1: [{
  110. name: '普票',
  111. value:"1"
  112. }, {
  113. name: '专票',
  114. value:"2"
  115. }],
  116. list2: [{
  117. name: '是',
  118. value:"1"
  119. }, {
  120. name: '否 ',
  121. value:"0"
  122. }],
  123. home:{
  124. accountBalance:0
  125. },
  126. }
  127. },
  128. onReady() {
  129. //this.getHomePage()
  130. },
  131. onShow(){
  132. this.nowTime=parseUnixTime(new Date())
  133. this.getHomePage()
  134. },
  135. methods: {
  136. bindPickerChange(e){
  137. console.log(e)
  138. if(this.stationList[e.detail.value]){
  139. this.stationObj=this.stationList[e.detail.value];
  140. this.queryWithdrawInfo(this.stationObj.id)
  141. }
  142. },
  143. selectStation(){},
  144. submit(){
  145. //this.value=this.info.amount
  146. if(!this.stationObj.id){
  147. uni.showToast({
  148. title: "请选择站点"
  149. })
  150. return
  151. }
  152. if(!this.info.amount){
  153. uni.showToast({
  154. title: "可提现金额为0"
  155. })
  156. return
  157. }
  158. uni.showLoading({
  159. title: "加载中",
  160. mask: true,
  161. })
  162. this.info.invoiceRequired=this.invoiceRequired
  163. this.info.invoiceType=this.invoiceType
  164. this.info.taxRate=this.taxRate
  165. this.info.stationId=this.stationObj.id;
  166. API.applyWithdraw(this.info).then((res) => {
  167. uni.redirectTo({
  168. url:"/pagesFinance/user/applyResult?value="+this.info.amount
  169. })
  170. }).catch(error => {
  171. uni.showModal({
  172. title:"提示",
  173. content:error,
  174. showCancel:false
  175. })
  176. })
  177. },
  178. queryWithdrawInfo(id){
  179. uni.showLoading({
  180. title: "加载中",
  181. mask: true,
  182. })
  183. API.queryWithdrawInfo({
  184. stationId:id
  185. }).then((res) => {
  186. this.info=res.data;
  187. uni.hideLoading()
  188. }).catch(error => {
  189. uni.showToast({
  190. title: error
  191. })
  192. })
  193. },
  194. getStationList(){
  195. uni.showLoading({
  196. title: "加载中",
  197. mask: true,
  198. })
  199. API.stationList().then((res) => {
  200. this.stationList=res.data.stationList;
  201. if(this.stationList.length){
  202. this.stationObj=this.stationList[0];
  203. this.queryWithdrawInfo(this.stationList[0].id)
  204. }
  205. uni.hideLoading()
  206. }).catch(error => {
  207. uni.showToast({
  208. title: error
  209. })
  210. })
  211. },
  212. getHomePage(){
  213. uni.showLoading({
  214. title: "加载中",
  215. mask: true,
  216. })
  217. API.homePage().then((res) => {
  218. this.home = res.data
  219. var bankCard="";
  220. if(this.home.bankCard){
  221. bankCard=substrMb(this.home.bankCard,0,4)+"****"+substrMb(this.home.bankCard,8,4)
  222. }
  223. this.code=this.home.bank+":"+bankCard;
  224. if(this.home.bank==null&&this.home.bankCard==null){
  225. this.code="未绑定"
  226. }
  227. uni.hideLoading()
  228. this.getStationList()
  229. }).catch(error => {
  230. uni.showToast({
  231. title: error
  232. })
  233. })
  234. }
  235. }
  236. }
  237. </script>
  238. <style>
  239. page{
  240. background-color: #F7F7F7;
  241. }
  242. </style>
  243. <style lang="scss" scoped>
  244. .withdraw-tips{
  245. margin:24px 16px;
  246. p{
  247. color:#999;
  248. margin-top: 4px;
  249. }
  250. }
  251. .withdraw{
  252. margin: 16px;
  253. background-color: #fff;
  254. padding: 16px 16px 0 16px;
  255. .withdraw-head{
  256. // margin: 16px 0;
  257. padding: 16px 0;
  258. border-bottom: 1px solid #f7f7f7;
  259. line-height: 20px;
  260. align-items: center;
  261. .whthdraw-price{
  262. font-size: 18px;
  263. color: #101010;
  264. font-weight: 600;
  265. }
  266. b{
  267. color:#999;
  268. }
  269. span{
  270. margin-left: 12px;
  271. float: right;
  272. }
  273. }
  274. .withdraw-main{
  275. border-top: 1px solid #f7f7f7;
  276. border-bottom: 1px solid #f7f7f7;
  277. margin: 16px 0;
  278. padding: 16px 0;
  279. .withdraw-input{
  280. margin-top: 32px;
  281. display: flex;
  282. align-items: center;
  283. font-size: 28px;
  284. /deep/.uni-input-input{
  285. font-size: 28px;
  286. }
  287. }
  288. }
  289. .withdraw-foot{
  290. display: flex;
  291. align-items: center;
  292. p{
  293. color:#999
  294. }
  295. span{
  296. color:#2979FF;
  297. margin-left: 16px;
  298. }
  299. }
  300. }
  301. .applyBtn{
  302. margin: 16px;
  303. }
  304. .applyBtn-btn{
  305. background-color: #185AC6;
  306. opacity: 0.5;
  307. border-color:#185AC6 ;
  308. border-radius: 8px;
  309. }
  310. </style>