pinCode.vue 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. <template>
  2. <view :style="colorStyle">
  3. <form @submit="recharge">
  4. <view class="ChangePassword">
  5. <view class="list">
  6. <view class="item">
  7. <view class="name">
  8. 卡号:
  9. </view>
  10. <input class="inputItem" type='number' placeholder='填写卡号' placeholder-class='placeholder'
  11. v-model="phone"></input>
  12. </view>
  13. <view class="item">
  14. <view class="name">
  15. 卡密:
  16. </view>
  17. <input class="inputItem" type='number' placeholder='填写卡密' placeholder-class='placeholder'
  18. v-model="pwd"></input>
  19. </view>
  20. </view>
  21. <button form-type="submit" class="confirmBnt bg-color">确认激活</button>
  22. </view>
  23. </form>
  24. <!-- #ifdef MP -->
  25. <!-- <authorize v-if="isShowAuth" @authColse="authColse" @onLoadFun="onLoadFun"></authorize> -->
  26. <!-- #endif -->
  27. </view>
  28. </template>
  29. <script>
  30. import {
  31. recharge
  32. } from '@/api/new.js';
  33. import {
  34. toLogin
  35. } from '@/libs/login.js';
  36. import {
  37. mapGetters
  38. } from "vuex";
  39. import colors from '@/mixins/color.js';
  40. export default {
  41. mixins: [colors],
  42. data() {
  43. return {
  44. phone: '',
  45. pwd: '',
  46. };
  47. },
  48. computed: mapGetters(['isLogin']),
  49. onLoad(options) {
  50. if (!this.isLogin) {
  51. toLogin();
  52. }
  53. },
  54. onShow() {},
  55. methods: {
  56. onLoadFun: function() {
  57. this.isShowAuth = false
  58. },
  59. // 授权关闭
  60. authColse: function(e) {
  61. this.isShowAuth = e
  62. },
  63. recharge: function() {
  64. let that = this;
  65. if (!that.phone) return that.$util.Tips({
  66. title: '请填写卡号!'
  67. });
  68. if (!that.pwd) return that.$util.Tips({
  69. title: '请填写卡密'
  70. });
  71. uni.showLoading({
  72. title: '激活中',
  73. mask: true
  74. });
  75. recharge({
  76. no: that.phone,
  77. pwd: that.pwd,
  78. }).then(res => {
  79. return that.$util.Tips({
  80. title: res.msg,
  81. icon: 'success'
  82. }, {
  83. tab: 4,
  84. url: '/pages/user/user'
  85. });
  86. }).catch(error => {
  87. return that.$util.Tips({
  88. title: error,
  89. });
  90. })
  91. },
  92. }
  93. }
  94. </script>
  95. <style lang="scss">
  96. page {
  97. background-color: #fff !important;
  98. }
  99. .ChangePassword {
  100. .confirmBnt {
  101. font-size: 32rpx;
  102. width: 580rpx;
  103. height: 90rpx;
  104. border-radius: 45rpx;
  105. color: #fff;
  106. margin: 92rpx auto 0 auto;
  107. text-align: center;
  108. line-height: 90rpx;
  109. }
  110. .phone {
  111. font-size: 32rpx;
  112. font-weight: bold;
  113. text-align: center;
  114. margin-top: 55rpx;
  115. }
  116. .list {
  117. width: 580rpx;
  118. margin: 53rpx auto 0 auto;
  119. .item {
  120. width: 100%;
  121. height: 110rpx;
  122. border-bottom: 2rpx solid #f0f0f0;
  123. display: flex;
  124. justify-content: flex-start;
  125. .name{
  126. flex-shrink: 0;
  127. line-height: 110rpx;
  128. padding-right: 20rpx;
  129. font-size: 32rpx;
  130. font-weight: bold;
  131. }
  132. input {
  133. flex-grow: 1;
  134. width: 100%;
  135. height: 100%;
  136. font-size: 32rpx;
  137. }
  138. .placeholder {
  139. color: #b9b9bc;
  140. }
  141. }
  142. }
  143. }
  144. </style>