用工小程序前端代码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

82 lines
2.0 KiB

6 months ago
3 months ago
6 months ago
3 months ago
6 months ago
4 months ago
6 months ago
4 months ago
6 months ago
3 months ago
6 months ago
3 months ago
6 months ago
3 months ago
6 months ago
4 months ago
3 months ago
4 months ago
3 months ago
4 months ago
6 months ago
  1. <template>
  2. <view class="se-m-40">
  3. <u--input v-model="money" type="number" class="se-bgc-f5 se-fs-32" placeholder="请输入充值金额">
  4. <text slot="prefix" class="se-ml-10 se-c-orange se-fs-32"></text>
  5. </u--input>
  6. <view class="se-flex se-flex-v se-pb-20 se-mt-80">
  7. <view class="se-ml-10 se-fs-26 se-c-black se-fw-5">
  8. 充值说明
  9. </view>
  10. <view class="se-flex se-flex-v se-fs-24 se-c-66 se-mt-30">
  11. <u-parse :content="getValueByName('czsm')"></u-parse>
  12. <!-- <text class="se-hl-50">
  13. 1本次充值必须通过银行卡充值暂不支持其他途径</br>
  14. 2如若遇到24小时充值未到账请联系客服</br>
  15. 3充值金额至少不能低于10元
  16. </text> -->
  17. </view>
  18. </view>
  19. <view class="se-pt-80 se-fs-20 se-flex">
  20. <view @click="onRecharge()"
  21. class="se-mx-10 se-flex-1 se-br-40 se-flex-h-c se-h-80 se-lh-80 se-ta-c se-fs-28 se-c-white se-bgc-orange">
  22. <text>立即充值</text>
  23. </view>
  24. </view>
  25. </view>
  26. </template>
  27. <script>
  28. import {
  29. payRecharge
  30. } from "@/common/api.js"
  31. export default{
  32. props:["userId","myMoney"],
  33. data(){
  34. return{
  35. money:"",
  36. sysList:[]
  37. }
  38. },
  39. mounted() {
  40. this.sysList = uni.getStorageSync('sysList')
  41. },
  42. methods:{
  43. getValueByName(name) {
  44. const item = this.sysList.find((item) => item.name == name);
  45. return item ? item.value : "";
  46. },
  47. onRecharge(){
  48. let that = this
  49. let params = {
  50. id:that.userId,
  51. price:that.money
  52. }
  53. payRecharge(params).then(response=>{
  54. uni.requestPayment({
  55. provider: "wxpay",
  56. nonceStr: response.result.nonceStr,
  57. package: response.result.package,
  58. timeStamp: response.result.timeStamp,
  59. signType: response.result.signType,
  60. paySign: response.result.paySign,
  61. success(res) {
  62. that.money="";
  63. that.$u.toast("充值成功!")
  64. that.$emit("onParent")
  65. },
  66. fail(e) {
  67. console.info(e)
  68. }
  69. })
  70. }).catch(error=>{
  71. })
  72. }
  73. }
  74. }
  75. </script>
  76. <style>
  77. </style>