当前位置: 首页 > news >正文

郑州企业网站优化网站运营编辑

郑州企业网站优化,网站运营编辑,ps如何制作网页,我的0511镇江网页面布局 提现页面 有一个输入框 一个提现按钮 一段提现全部的文字 首先用v-model 和data内的数据双向绑定 输入框逻辑分析 输入框的逻辑 为了符合日常输出 所以要对输入框加一些条件限制 因为是提现 所以对输入的字符做筛选,只允许出现小数点和数字 这里用正则实现的小数点…页面布局 提现页面 有一个输入框 一个提现按钮 一段提现全部的文字 首先用v-model 和data内的数据双向绑定 输入框逻辑分析 输入框的逻辑 为了符合日常输出 所以要对输入框加一些条件限制 因为是提现 所以对输入的字符做筛选,只允许出现小数点和数字 这里用正则实现的小数点后只能输入两位小数, 超过两位的去除掉 因为提现的最小金额是两位数.前面如果没有数字 就自动补零(首个字符为.的时候)只能输入一个小数点输入的金额要小于等于余额 如果大于,就把余额赋值给提现的金额 点击全部提现,也是把余额赋值给提现金额 参考代码 input typenumber step0.01 min0 v-modelwithdrawMoney inputvalidateInput view classbtn clickapply提现申请/view// 对输入的金额做处理 validateInput(e) {let inputValue e.detail.value;let integerPart parseInt(inputValue); // 整数let decimalPart inputValue - parseInt(inputValue); // 小数// 移除非数字和小数点以外的字符 inputValue inputValue.replace(/[^0-9.]/g, ); // 小数点只能输入两位小数并去除多余的 if (inputValue.includes(.)) { if (inputValue.indexOf(.) inputValue.length - 1) {decimalPart .} else if (inputValue.indexOf(.) inputValue.length - 2) { if (decimalPart 0) {decimalPart .0} else {decimalPart parseFloat(decimalPart);}} else {decimalPart inputValue.substr(inputValue.indexOf(.) 1, 2);decimalPart parseFloat(decimalPart / 100)console.log(decimalPart)} }// 整数部分补0只针对第一位数字为0的情况 if (inputValue.length 1 inputValue 0) { inputValue ; console.log(integerPart)} else if (inputValue[0] .) { integerPart console.log(integerPart, decimalPart, inputValue)} else if (inputValue[0] ! .) { inputValue inputValueconsole.log(integerPart, decimalPart, inputValue)if (integerPart[0] 0 integerPart.length 1) { integerPart integerPart.substr(1); console.log(integerPart)} } // // 整数部分补0只针对没有其他整数的情况 if (integerPart decimalPart ) { integerPart 0; } else if (integerPart decimalPart ! ) { integerPart 0; }// 如果输入的值大于余额则强制转换为余额值 if (parseFloat(inputValue) this.amount) { inputValue this.amount; } else { console.log(integerPart, decimalPart)inputValue integerPart decimalPart; // 重新组合整数部分和小数部分并更新v-model的值 } this.$nextTick(() {console.log(inputValue)this.withdrawMoney inputValue }); },// 全部提现 handleAllWithdraw () {this.withdrawMoney this.amount },// 提现 async apply() {const data {amount: this.withdrawMoney,type: weixin}await takeMoney(data) .then(result { // 成功this.amount this.amount - this.withdrawMoneythis.withdrawMoney uni.showToast({ title: 申请提现成功, icon: success, duration: 1000 }); }) .catch(error { // 失败 this.withdrawMoney uni.showToast({ title: 申请提现失败, icon: none, duration: 2000 }); }) } 然后调后端给的接口 携带需要的数据 发对应的请求就可以了
http://www.hkea.cn/news/14351807/

相关文章:

  • 深圳html5网站建设厦门seo优化
  • 深圳网站策划seo的公司排名
  • 东莞网站建设外包建设工程施工许可证查询网站
  • 网站备案号怎么查德州万企互联网站制作
  • 网站建设平台方案做南美生意做什么网站好
  • 电商网站建设资讯wordpress火车头采集发布失败
  • 温州个人建站模板做网站需不需要购买服务器
  • 网站虚拟机可以自己做吗腾讯云备案网站名称
  • 制作网站域名需要多少钱做直播网站需要那些技术
  • 专门做衬衣的网站亚马逊网站风格
  • 注册网站网高平企业网站
  • 网站后台根据前端做吗网站建设响应技术
  • 手机自适应网站源码wordpress 卸载主题
  • 建设网站装配式建筑楼房wordpress网站数据备份
  • 衡水做淘宝网站广告创意与设计
  • 建网站是什么技术网站开发设计内容
  • 网站快捷按钮以什么方式做视频制作平台
  • 湖北望新建设有限公司网站注册建筑工程公司需要什么条件
  • 烟台优化网站设计模板在哪里找
  • 推客易可以做自己的网站吗深圳h5网站建设
  • 哈尔滨搭建网站推广产品的方式有哪些
  • 物联网 网站开发品牌网线
  • 上海建设厅焊工证查询网站做网站的公司为什么人少了
  • 网站建设与会展淘宝客网站建设平台
  • .php的网站是怎么做的怎么免费建设个人网站
  • 说明设计网站开发方案流程建筑人才网招聘网官网
  • 宠物网站页面设计创意国外微信彩票网站网站建设
  • code snippets wordpress深圳seo网站建设
  • 有哪些高端的网站河南地区建设工程信息网
  • 11免费建网站免费做二建题的网站