index.vue 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. <template>
  2. <view class="page flex-col">
  3. <view class="group_1 flex-row">
  4. <view class="block_2 flex-col" style="margin: 0px;">
  5. <!-- <view class="input_2 flex-col"><input class="text_3" disabled="" placeholder="请输入手机号码" v-model="data.mobilephone" /></view> -->
  6. <!-- <view class="text-wrapper_1 flex-col"><input class="text_4" password="true" type="safe-password" placeholder="请输入原密码" v-model="data.oldmobilepwd" /></view> -->
  7. <view class="text-wrapper_1 flex-col"><input class="text_4" password="true" type="safe-password" placeholder="请输入登录密码" v-model="data.mobilepwd" /></view>
  8. <!-- <view class="input_3 flex-col"><input class="text_5" password="true" type="safe-password" placeholder="请再输入一次新密码" v-model="data.mobilepwd1" /></view> -->
  9. <view class="input_3 flex-col"><input class="text_5" password="true" type="safe-password" placeholder="请输入支付密码" v-model="data.paypwd" /></view>
  10. <button class="button_1 flex-col" @click="onClick_1"><text class="text_6">提交</text></button>
  11. </view>
  12. </view>
  13. </view>
  14. </template>
  15. <script>
  16. export default {
  17. data() {
  18. return {
  19. constants: {},
  20. data: {
  21. nick_name: '',
  22. mobilephone: '',
  23. oldmobilepwd:'',
  24. mobilepwd: '',
  25. mobilepwd1: '',
  26. paypwd: '',
  27. uid:0,
  28. },
  29. userinfo:{}
  30. };
  31. },
  32. onShow() {
  33. var user = this.$api.getUserinfo();
  34. if (user) {
  35. // console.log(user);
  36. this.userinfo = user;
  37. this.data.mobilephone=user.mobilephone;
  38. this.data.uid=user.id;
  39. } else {
  40. this.userinfo = null;
  41. }
  42. },
  43. onLoad(option) {
  44. },
  45. methods: {
  46. onClick_1() {
  47. var data = new Object();
  48. data.uid=this.data.uid;
  49. data.mm=this.data.mobilepwd;
  50. data.jymm=this.data.paypwd;
  51. if(data.mobilepwd!=data.mobilepwd1){
  52. uni.showToast({
  53. title: "2次登录密码不一致,请确认",
  54. icon: 'none'
  55. });
  56. return;
  57. }
  58. this.$api
  59. .MhPostModel(data,"user/anquan")
  60. .then(res => {
  61. // console.log('user/anquan信息', JSON.stringify(res));
  62. uni.showModal({
  63. title: '提示',
  64. content: res.data.msg,
  65. showCancel:false,
  66. success: function (res) {
  67. if (res.confirm) {
  68. if (res.data.code == 1) {
  69. setTimeout(function() {
  70. uni.navigateTo({
  71. url: '/pages/lanhu_login/index'
  72. });
  73. }, 2000);
  74. }
  75. } else if (res.cancel) {
  76. console.log('用户点击取消');
  77. }
  78. }
  79. });
  80. })
  81. .catch(err => {
  82. // console.log('request fail', JSON.stringify(err));
  83. });
  84. },
  85. onClick_2() {
  86. alert('敬请期待');
  87. }
  88. }
  89. };
  90. </script>
  91. <style lang="css">
  92. @import '../common/common.css';
  93. @import './assets/style/index.rpx.css';
  94. </style>