findpass.vue 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287
  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. .login-item p{
  164. text-align: left;
  165. }
  166. .line{
  167. height: 0.5rpx;
  168. background-color: #efefef;
  169. margin-top: 10rpx;
  170. }
  171. .input-account{
  172. margin-top: 20rpx;
  173. margin-bottom: 0rpx;
  174. border-radius:40rpx;
  175. border:solid 0rpx #efefef;
  176. height: 80rpx;
  177. width: 100%;
  178. // background:url(/static/account.png) no-repeat 0 center;
  179. background-size: 30rpx 30rpx;
  180. background-position: 30rpx;
  181. }
  182. .input-yzcode{
  183. margin-top: 20rpx;
  184. margin-bottom: 0rpx;
  185. border-radius:40rpx;
  186. border:solid 0rpx #efefef;
  187. height: 80rpx;
  188. width: 100%;
  189. // background:url(/static/image/login/cz_icon.png) no-repeat 0 center;
  190. background-size: 30rpx 30rpx;
  191. background-position: 30rpx;
  192. }
  193. .input-pwd{
  194. margin-top: 40rpx;
  195. margin-bottom: 20rpx;
  196. border-radius:40rpx;
  197. border:solid 0rpx #efefef;
  198. height: 80rpx;
  199. width: 100%;
  200. // background:url(/static/password.png) no-repeat 0 center;
  201. background-size: 30rpx 30rpx;
  202. background-position: 30rpx;
  203. }
  204. input{
  205. margin-left: 80rpx;
  206. height: 80rpx;
  207. line-height: 80rpx
  208. }
  209. .footer{
  210. color: #686866;
  211. width: 100%;
  212. position: fixed;
  213. text-align: center;
  214. bottom: 60upx;
  215. font-size: 28rpx;
  216. }
  217. .btns{
  218. margin: 60rpx 0rpx;
  219. }
  220. .login-btn {
  221. display: flex;
  222. align-items: center;
  223. justify-content: center;
  224. width: 100%;
  225. height: 80rpx;
  226. background: linear-gradient(to right, #FF5C03 0%, #FF5C03 100%);
  227. background: -moz-linear-gradient(to right, #FF5C03 0%, #FF5C03 100%);
  228. box-shadow: 0px 7rpx 6rpx 0px rgba(229, 138, 0, 0.22);
  229. border-radius: 40rpx;
  230. font-size: 30rpx;
  231. font-family: PingFang SC;
  232. font-weight: 500;
  233. color: rgba(255, 255, 255, 1);
  234. }
  235. .reg-box {
  236. padding-bottom:20rpx;
  237. margin:0 10px;
  238. .reg-btn{
  239. font-size:16px ;
  240. color: #FF5C03;
  241. }
  242. }
  243. .pageBottom{
  244. height: 260rpx;
  245. width: 75%;
  246. display: flex;
  247. flex-direction: column;
  248. }
  249. .tips{
  250. color: #999;
  251. font-size: 36rpx;
  252. }
  253. .menu{
  254. margin-top: 30rpx;
  255. image{
  256. width: 78rpx;
  257. height: 78rpx;
  258. }
  259. }
  260. </style>