findpass.vue 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285
  1. <template>
  2. <view>
  3. <view class="content">
  4. <view class="pageTop x-c">
  5. <view class="loginBox">
  6. <view class="login-item">
  7. <view class="input-account">
  8. <input v-model="userName" placeholder="手机号" type="text" />
  9. </view>
  10. <view class="line"></view>
  11. </view>
  12. <view class="login-item">
  13. <view class="input-pwd">
  14. <input v-model="password" placeholder="密码(6-15个字符)" type="password" />
  15. </view>
  16. <view class="line"></view>
  17. </view>
  18. <view class="login-item">
  19. <view class="input-yzcode x-bc">
  20. <input v-model="yzcode" placeholder="验证码" type="number" />
  21. <view style="color:#666">获取验证码</view>
  22. </view>
  23. <view class="line"></view>
  24. </view>
  25. <view class="btns">
  26. <view class="login-btn" @click="login">设置新密码</view>
  27. </view>
  28. </view>
  29. </view>
  30. </view>
  31. </view>
  32. </template>
  33. <script>
  34. // import { login,getUserInfo } from '@/api/login.js'
  35. import { loginByApp } from '@/api/login.js'
  36. export default {
  37. data() {
  38. return {
  39. userName:"",
  40. password:"",
  41. password1:"",
  42. registrationID:"",
  43. yzcode:""
  44. }
  45. },
  46. onLoad(option) {
  47. let that=this;
  48. uni.$on('getRegistrationID', function(data) {
  49. that.registrationID=data;
  50. });
  51. this.$getRegistrationID();
  52. },
  53. onShow() {
  54. },
  55. onUnload() {
  56. uni.$off('getRegistrationID');
  57. },
  58. mounted() {
  59. },
  60. methods: {
  61. login(){
  62. if (this.$isEmpty(this.userName)) {
  63. uni.showToast({
  64. title: "请输入帐号",
  65. icon: 'none',
  66. });
  67. return
  68. }
  69. if (this.$isEmpty(this.password)) {
  70. uni.showToast({
  71. title: "请输入密码",
  72. icon: 'none',
  73. });
  74. return
  75. }
  76. var data = {
  77. userName:this.userName,
  78. password: this.password,
  79. jpushId:this.registrationID || uni.getStorageSync("registrationID")
  80. };
  81. var that=this;
  82. uni.showLoading({
  83. title:"处理中..."
  84. });
  85. login(data).then(res => {
  86. uni.hideLoading()
  87. if(res.code==200){
  88. // #ifdef APP-PLUS
  89. //const jyJPush = uni.requireNativePlugin('JY-JPush');
  90. // #endif
  91. uni.setStorageSync('AppToken',res.data.token);
  92. this.$Router.pushTab({name: 'home'});
  93. }
  94. else{
  95. uni.showToast({title: res.msg,icon: 'none'});
  96. }
  97. },
  98. rej => {}
  99. );
  100. },
  101. goToRegister(){
  102. this.$navTo('./register');
  103. },
  104. goToFindPass(){
  105. this.$navTo('./findPass');
  106. },
  107. getRegistrationID(){
  108. // #ifdef APP-PLUS
  109. // #endif
  110. }
  111. },
  112. }
  113. </script>
  114. <style lang="scss">
  115. page{
  116. background-color: #ffffff;
  117. }
  118. .content{
  119. display: flex;
  120. flex-direction: column;
  121. align-items: center;
  122. height: calc(100vh);
  123. width: 100%;
  124. justify-content: space-between;
  125. }
  126. .pageTop{
  127. display: flex;
  128. flex-direction: column;
  129. width: 100%;
  130. }
  131. .content .head{
  132. text-align: center;
  133. width: 100%;
  134. height: 522rpx;
  135. // background:url(/static/image/login/top_bg.png) no-repeat 0 center;
  136. background-size: cover;
  137. box-sizing: border-box;
  138. }
  139. .content .head image{
  140. width: 150rpx;
  141. height: 150rpx;
  142. border-radius: 10rpx;
  143. box-shadow:0px 0px 20rpx rgba(0,0,0,0.2);
  144. }
  145. .title{
  146. color: #141414;
  147. margin:50upx 0upx 30upx 0rpx;
  148. font-size: 38rpx;
  149. font-weight: 500;
  150. }
  151. .desc{
  152. color: #686866;
  153. padding:0 0 30rpx 0rpx;
  154. font-size: 28rpx;
  155. }
  156. .loginBox{
  157. padding:10px 10px 30rpx;
  158. width: calc(100% - 20px) ;
  159. margin-top: 0rpx;
  160. background: #FDFDFD;
  161. border-radius: 7rpx;
  162. }
  163. .line{
  164. height: 0.5rpx;
  165. background-color: #efefef;
  166. margin-top: 10rpx;
  167. }
  168. .input-account{
  169. margin-top: 20rpx;
  170. margin-bottom: 0rpx;
  171. border-radius:40rpx;
  172. border:solid 0rpx #efefef;
  173. height: 80rpx;
  174. width: 100%;
  175. // background:url(/static/account.png) no-repeat 0 center;
  176. background-size: 30rpx 30rpx;
  177. background-position: 30rpx;
  178. }
  179. .input-yzcode{
  180. margin-top: 20rpx;
  181. margin-bottom: 0rpx;
  182. border-radius:40rpx;
  183. border:solid 0rpx #efefef;
  184. height: 80rpx;
  185. width: 100%;
  186. // background:url(/static/image/login/cz_icon.png) no-repeat 0 center;
  187. background-size: 30rpx 30rpx;
  188. background-position: 30rpx;
  189. }
  190. .input-pwd{
  191. margin-top: 40rpx;
  192. margin-bottom: 20rpx;
  193. border-radius:40rpx;
  194. border:solid 0rpx #efefef;
  195. height: 80rpx;
  196. width: 100%;
  197. // background:url(/static/password.png) no-repeat 0 center;
  198. background-size: 30rpx 30rpx;
  199. background-position: 30rpx;
  200. }
  201. input{
  202. margin-left: 80rpx;
  203. height: 80rpx;
  204. line-height: 80rpx
  205. }
  206. .footer{
  207. color: #686866;
  208. width: 100%;
  209. position: fixed;
  210. text-align: center;
  211. bottom: 60upx;
  212. font-size: 28rpx;
  213. }
  214. .btns{
  215. margin: 60rpx 0rpx;
  216. }
  217. .login-btn {
  218. display: flex;
  219. align-items: center;
  220. justify-content: center;
  221. width: 100%;
  222. height: 80rpx;
  223. background: linear-gradient(to right, #FF5C03 0%, #FF5C03 100%);
  224. background: -moz-linear-gradient(to right, #FF5C03 0%, #FF5C03 100%);
  225. box-shadow: 0px 7rpx 6rpx 0px rgba(229, 138, 0, 0.22);
  226. border-radius: 40rpx;
  227. font-size: 30rpx;
  228. font-family: PingFang SC;
  229. font-weight: 500;
  230. color: rgba(255, 255, 255, 1);
  231. }
  232. .reg-box {
  233. padding-bottom:20rpx;
  234. margin:0 10px;
  235. .reg-btn{
  236. font-size:16px ;
  237. color: #FF5C03;
  238. }
  239. }
  240. .pageBottom{
  241. height: 260rpx;
  242. width: 75%;
  243. display: flex;
  244. flex-direction: column;
  245. }
  246. .tips{
  247. color: #999;
  248. font-size: 36rpx;
  249. }
  250. .menu{
  251. margin-top: 30rpx;
  252. image{
  253. width: 78rpx;
  254. height: 78rpx;
  255. }
  256. }
  257. </style>