findpass.vue 5.5 KB

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