warehouse-application-adjustQuota.html 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <title>仓库管理-调整额度-创业帮</title>
  6. <meta name="keywords" content="仓库管理-调整额度-创业帮">
  7. <meta name="description" content="仓库管理-调整额度-创业帮">
  8. <meta content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,shrink-to-fit=no,user-scalable=no" name="viewport" viewport="cover">
  9. <meta name="apple-mobile-web-app-capable" content="yes">
  10. <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
  11. <meta content="telephone=no" name="format-detection">
  12. <meta content="email=no" name="format-detection">
  13. <meta name="apple-mobile-web-app-title" content="仓库管理-调整额度-创业帮">
  14. <meta http-equiv="Cache-Control" content="no-siteapp">
  15. <link rel="stylesheet" href="./static/css/main.css">
  16. <style>
  17. .van-field__right-icon i{
  18. transform:rotate(90deg);
  19. }
  20. .van-goods-action{height:1.5467rem;}
  21. .merchant-verification .van-button{height:1.28rem;}
  22. .adjustQuota .line{border:0.2px solid #F1F1F1;}
  23. .warehouse-application .topline{border-top:1px solid #f2f2f2;}
  24. </style>
  25. </head>
  26. <body class="pb0 ovh pt0" style="padding-top:0;">
  27. <div class="warehouse rel merchant-verification warehouse-application adjustQuota" id="app" v-cloak style="height:100vh;background-color:#f6f6f6">
  28. <van-nav-bar class="user_rank_explan_title user_title_normal titlef16 rightc333" left-arrow title="调低临额" v-if="toptitleisshow" @click-left="goback">
  29. <template #left><img src="./static/images/left.png" alt=""></template>
  30. </van-nav-bar>
  31. <div class="bgcfff topline">
  32. <div class="f15 c333"><span>当前额度</span><span class="f16 ml20">¥</span><span class="f28">{{curQuota}}</span></div>
  33. <div class="f15 c333 df aic mt24"><span>调低临额</span>
  34. <van-stepper class="ml20" v-model="reductQuota" button-size="28" disable-input min="0" step="1000" :max="least"></van-stepper><span class="ml10 c999 f12">最多可调低¥{{least}}</span>
  35. </div>
  36. <div class="line mt24"></div>
  37. <div class="f15 c333 mt24"><span>返还押金</span><span class="ml20">{{returnDeposit}} 元</span></div>
  38. <div class="f12 c999 mt20">调整提示</div>
  39. <div class="f12 c999 mt6">仅可调低1000的整倍数,正在使用的临时额度不可调低,调整后的返还金额将返还至您的创客余额中。</div>
  40. </div>
  41. <div class="van-goods-action">
  42. <van-goods-action-button color="#FDD500" type="danger" text="确认调整" style="width:80%" @click="submit"></van-goods-action-button>
  43. </div>
  44. <van-popup v-model="applicationFaild" :close-on-click-overlay="false" style="border-radius:.4267rem;width:83%;">
  45. <div class="warp-box" style="height:4.8533rem">
  46. <div class="f16 c333 tc b">申请失败</div>
  47. <div class="f14 mt8 c333">{{errInfo}}</div>
  48. <van-button class="btn" round color="#FDD500" block @click="applicationFaild = false">确定</van-button>
  49. </div>
  50. </van-popup>
  51. <van-popup v-model="applicationSuccess" :close-on-click-overlay="false" style="border-radius:.4267rem;width:83%;">
  52. <div class="warp-box" style="height:4.4133rem">
  53. <div class="f16 c333 tc b">{{resInfo}}</div>
  54. <van-button class="btn" round color="#FDD500" block @click="applicationSuccessclose">好的</van-button>
  55. </div>
  56. </van-popup>
  57. </div>
  58. <script src="./static/js/klm-vv.min.js"></script>
  59. <script src="./static/js/appfunc.min.js"></script>
  60. <script src="./static/js/klm-axios-config.js"></script>
  61. <script src="./static/js/publicfn.js"></script>
  62. <script>
  63. Vue.use(vant.Lazyload);
  64. // 在 #app 标签下渲染一个按钮组件
  65. let app = new Vue({
  66. el: '#app',
  67. data(){
  68. return{
  69. curQuota:0,
  70. reductQuota:0,
  71. //- returnDeposit:0,
  72. toptitleisshow,
  73. applicationFaild:false,
  74. errInfo:'',
  75. applicationSuccess:false,
  76. least:0,
  77. resInfo:'',
  78. }
  79. },
  80. computed:{
  81. returnDeposit:function(){
  82. return this.reductQuota/2
  83. }
  84. },
  85. created(){
  86. this.getMyamount()
  87. },
  88. methods:{
  89. applicationSuccessclose(){
  90. this.getMyamount();
  91. this.applicationSuccess = false;
  92. },
  93. submit(){
  94. if(this.reductQuota === 0) return tips('请先选择调整额度')
  95. vant.Dialog.confirm({
  96. message: `确认将临时额度调低${this.reductQuota}元?`,
  97. })
  98. .then(() => {
  99. const UserId = PublicLib.getCookieInfo('userId');
  100. const Amount = this.reductQuota;
  101. postRequest('api/v1/storehouseamountrecord/downamount',JSON.stringify({UserId,Amount}))
  102. .then((res)=>{
  103. if(res.status !== '1'){
  104. this.errInfo = res.info;
  105. this.applicationFaild = true;
  106. };
  107. if(res.status === '1'){
  108. this.resInfo = res.info;
  109. this.applicationSuccess = true;
  110. this.reductQuota = 0;
  111. setTimeout(()=>{
  112. this.getMyamount();
  113. },3000)
  114. };
  115. });
  116. });
  117. },
  118. goback(){
  119. PublicLib.GoBack({Level:1});
  120. },
  121. async getMyamount(){
  122. const UserId = PublicLib.getCookieInfo('userId');
  123. const res = await getRequest('api/v1/useraccount/myamount?='+Math.random(6),JSON.stringify({UserId}));
  124. if(res.status === '1'){
  125. this.curQuota = res.data.TempAmount;
  126. if(res.data.OkTempAmount){
  127. this.least = (Math.floor(res.data.OkTempAmount / 1000))*1000;
  128. };
  129. }else{
  130. tips('初始化失败!请重试')
  131. }
  132. },
  133. }
  134. })
  135. </script>
  136. </body>
  137. </html>