transaction.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  1. <template>
  2. <view class="body_content">
  3. <view class="login_text">
  4. <view class="example-title">修改交易密码</view>
  5. <view class="login_input flex" style="padding-top: 45rpx;">
  6. <view class="login_name">新密码</view>
  7. <view class="login_name"><input class="uni-input" type="text" v-model="username" placeholder="请输入新密码" /></view>
  8. </view>
  9. <view class="login_input flex">
  10. <view class="login_name"><text>重复密码</text></view>
  11. <view class="login_name"><input class="uni-input" type="idcard" v-model="idCard" placeholder="请重复输入密码" /></view>
  12. </view>
  13. <view class="login_input flex" style="border: none;">
  14. <view class="login_name"><text>验证码</text></view>
  15. <view class="login_name flex_item">
  16. <input style="width: 310rpx;" class="uni-input" type="number" v-model="vcode" placeholder="请输入验证码" />
  17. <view class="" style="font-size: 26rpx;color: #0C5AFA;">获取验证码</view>
  18. </view>
  19. </view>
  20. </view>
  21. <view class="submission">
  22. <button class="golden" type="golden" hover-class="none" @click="submission">确认</button>
  23. </view>
  24. </view>
  25. </view>
  26. </template>
  27. <script type="text/javascript">
  28. // import { show_us,attestation } from '@/api/user.js';
  29. export default {
  30. data() {
  31. return {
  32. username:'',
  33. idCard:'',
  34. phone:'',
  35. vcode:''
  36. };
  37. },
  38. onLoad() {
  39. // this.uid = uni.getStorageSync('uid');
  40. // console.log(uni.getStorageSync('uid'),this.uid)
  41. // this.loadData();
  42. },
  43. methods: {
  44. //获取数据
  45. loadData() {
  46. show_us({
  47. uid:this.uid
  48. })
  49. .then(data => {
  50. let obj = this;
  51. obj.list = data.data;
  52. if(data.data.card == null){
  53. obj.number = "";
  54. }else{
  55. obj.number = data.data.card;
  56. }
  57. if(data.data.email == null){
  58. obj.mail = "";
  59. }else{
  60. obj.mail = data.data.email;
  61. }
  62. if( data.data.name == null){
  63. obj.username = '';
  64. }else{
  65. obj.username = data.data.name;
  66. }
  67. })
  68. .catch(err => {
  69. console.log(err);
  70. });
  71. },
  72. // 提交
  73. submission() {
  74. if (this.mail == '') {
  75. this.$api.msg('请输入电子邮箱');
  76. return;
  77. }
  78. if (this.username == '') {
  79. this.$api.msg('请输入真实姓名');
  80. return;
  81. }
  82. if (this.number == '') {
  83. this.$api.msg('请输入身份证号');
  84. return;
  85. }
  86. attestation({
  87. uid:this.uid,
  88. email: this.mail,
  89. name: this.username,
  90. card: this.number,
  91. })
  92. .then(function(e) {
  93. uni.showToast({
  94. title: e.message,
  95. duration: 1500,
  96. mask: false,
  97. icon: 'none'
  98. });
  99. })
  100. .catch(function(e) {
  101. console.log(e);
  102. });
  103. },
  104. //下拉刷新
  105. onPullDownRefresh() {
  106. let obj = this;
  107. //监听下拉刷新动作的执行方法,每次手动下拉刷新都会执行一次
  108. setTimeout(function() {
  109. obj.loadData();
  110. uni.stopPullDownRefresh(); //停止下拉刷新动画
  111. }, 1000);
  112. }
  113. }
  114. };
  115. </script>
  116. <style lang="scss">
  117. .login_text {
  118. width: 100%;
  119. // padding: 25rpx 0rpx;
  120. font-size: 28rpx !important;
  121. background: #1F2A4A;
  122. padding: 0rpx 25rpx;
  123. }
  124. .login_input {
  125. border-bottom: 1px solid #464755;
  126. padding: 35rpx;
  127. }
  128. .uploadText{
  129. padding: 47rpx 40rpx;
  130. color: #ffffff;
  131. }
  132. .imageBox{
  133. width: 100%;
  134. padding: 50rpx 15%;
  135. }
  136. .uni-input{
  137. width:450rpx;
  138. text-align: left !important;
  139. font-size: 26rpx;
  140. }
  141. .width {
  142. width: 265rpx !important;
  143. }
  144. .code {
  145. color: #EEC680;
  146. font-size: 23rpx;
  147. border-left: 1px solid #85858E;
  148. padding-left: 25rpx;
  149. }
  150. .submission{
  151. padding: 80rpx 25rpx;
  152. .golden{
  153. background: #0C5AFA;
  154. color: #ffffff;
  155. }
  156. }
  157. .login_name {
  158. color: #ffffff;
  159. }
  160. .example-title {
  161. display: flex;
  162. justify-content: space-between;
  163. align-items: center;
  164. font-size: 30rpx;
  165. color: #fff;
  166. padding: 30rpx 30rpx 30rpx 50rpx;
  167. position: relative;
  168. background-color: #1F2A4A;
  169. border-bottom: 1rpx solid #464755;
  170. }
  171. .example-title:after {
  172. content: '';
  173. position: absolute;
  174. left: 30rpx;
  175. margin: auto;
  176. top: 0;
  177. bottom: 0;
  178. width: 4rpx;
  179. height: 32rpx;
  180. background-color: #0C5AFA;
  181. }
  182. </style>