password.vue 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. <template>
  2. <view class="container">
  3. <view class="page-title">设置登录密码</view>
  4. <form @submit="onSubmit">
  5. <view class="cell flex-row-between">
  6. <input type="text" name="pass"
  7. maxlength="16" placeholder="请输入6位-16位字符"></input>
  8. </view>
  9. <view class="cell flex-row-between">
  10. <input type="text" name="repass" maxlength="16" placeholder="请再次输入登录密码"></input>
  11. </view>
  12. <button form-type="submit" class="login-btn">设置</button>
  13. <button class="login-btn" @click="setup" style="background:#FFBE2C;margin-top: 70rpx;">暂时不设置密码</button>
  14. </form>
  15. </view>
  16. </template>
  17. <script>
  18. export default {
  19. data() {
  20. return {
  21. }
  22. },
  23. onLoad(e) {
  24. this.tel=e.tel;
  25. },
  26. methods:{
  27. setup(e){
  28. uni.reLaunch({
  29. url: "../index/index"
  30. })
  31. },
  32. onSubmit(e) {
  33. let data = e.detail.value;
  34. data.tel=this.tel;
  35. data.token=uni.getStorageSync("token");
  36. data.type=2;
  37. this.request({
  38. url: "user/edit_pass",
  39. data,
  40. }).then(res => {
  41. console.log(res, "res")
  42. if (res.code === '200') {
  43. uni.showToast({
  44. title: "设置成功",
  45. icon: 'none',
  46. duration: 2000
  47. })
  48. setTimeout(() => {
  49. uni.reLaunch({
  50. url: "../index/index"
  51. })
  52. }, 1500)
  53. }
  54. }).catch((res) => {
  55. uni.showToast({
  56. title: res.message,
  57. icon: 'none',
  58. duration: 2000
  59. })
  60. });
  61. },
  62. }
  63. }
  64. </script>
  65. <style>
  66. .container {
  67. padding: 0 60rpx;
  68. }
  69. .page-title {
  70. padding: 160rpx 0 90rpx;
  71. font-size: 54rpx;
  72. line-height: 1;
  73. font-weight: 700;
  74. color: #242424;
  75. }
  76. .cell {
  77. height: 90rpx;
  78. border-bottom: 2rpx solid #ededed;
  79. margin-bottom: 55rpx;
  80. }
  81. .cell .iconquchu {
  82. flex: none;
  83. font-size: 23rpx;
  84. color: #cbcbcb;
  85. }
  86. .cell .code-btn {
  87. flex: none;
  88. width: 170rpx;
  89. height: 60rpx;
  90. border-radius: 30rpx;
  91. background-color: #3387FF;
  92. text-align: center;
  93. line-height: 60rpx;
  94. color: #fff;
  95. font-size: 24rpx;
  96. }
  97. .cell input {
  98. flex: auto;
  99. margin-right: 40rpx;
  100. }
  101. .login-btn {
  102. width: 630rpx;
  103. height: 98rpx;
  104. background: linear-gradient(315deg, #3387ff 2%, #569bff 99%);
  105. border-radius: 8rpx;
  106. box-shadow: 0px 0px 8rpx 0px rgba(51, 135, 255, 0.2);
  107. font-size: 32rpx;
  108. font-weight: 500;
  109. text-align: center;
  110. color: #fff;
  111. line-height: 98rpx;
  112. margin: 100rpx auto 0;
  113. }
  114. </style>