resetPsw.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349
  1. <template>
  2. <div class="family text-[14px] leading-[1.42857143] text-[#333] bg-[#fff]">
  3. <div class="header h-80px">
  4. <nav
  5. class="nav-header-password col-md-12 leading-[80px] relative min-h-1px px-15px"
  6. >
  7. <div class="logo p-0">
  8. <!-- 此处a需不需要改 -->
  9. <nuxt-link to="/" class="text-[#666] text-[24px] no-underline bg-transparent">
  10. <span class="logo-img m-0 py-20px pl-170px"></span>
  11. <span>17PDF Reader</span>
  12. </nuxt-link>
  13. </div>
  14. </nav>
  15. </div>
  16. <div class="pc-container px-15px mx-auto sm:w-750px">
  17. <section class="password-reset-form py-72px px-0">
  18. <div class="px-15px mx-auto sm:w-750px">
  19. <div class="row mx-[-15px]">
  20. <div class="col-md-3 relative min-h-1px px-15px"></div>
  21. <div class="col-md-6 relative min-h-1px px-15px tiny:w-[70%] tiny:my-0 tiny:mx-auto">
  22. <h2 class="text-center text-[#00bbd3] text-[30px] mb-32px text-center mt-20px leading-[1.1] font-medium">
  23. 设置新密码
  24. </h2>
  25. </div>
  26. </div>
  27. <div class="row form-wrapper mx-[-15px]">
  28. <div class="col-md-3 relative min-h-1px px-15px"></div>
  29. <div class="col-md-6 relative min-h-1px px-15px tiny:w-[70%] tiny:my-0 tiny:mx-auto">
  30. <h3 v-show = " showError " class="warning text-[24px] mt-20px mb-10px font-medium laeding-[1.1]">
  31. 密码重置失败,请确认两次密码一致!
  32. </h3>
  33. <input type="hidden" name="_method" value="put" /><input
  34. type="hidden"
  35. name="authenticity_token"
  36. value="QBgQOkuMzY9y68DxLhdc/7SYTXa5vCi1AOwaPmWairZQEy8t4DnUteFfBA8cJWji/bkgBGwDpQrcSnHum6baJQ=="
  37. />
  38. <div class="form-group mb-34px">
  39. <label
  40. for="password"
  41. class="text-[#333] text-[14px] font-normal max-w-full mb-5px"
  42. >请输入新密码</label
  43. >
  44. <input
  45. id="password"
  46. v-model="newPassword"
  47. type="password"
  48. class="form-control h-40px w-full py-6px px-12px text-[14px] leading-[1.42857143] text-[#555] bg-[#fff] border border-solid border-gray-[#ccc] m-0"
  49. @input="changeErr"
  50. @keydown="keydown($event)"
  51. @keydown.enter="resetPassword"
  52. />
  53. </div>
  54. <div class="form-group mb-34px">
  55. <label
  56. for="password-confirmation"
  57. class="text-[#666] text-[14px] font-normal max-w-full mb-5px"
  58. >请再次输入新密码</label
  59. >
  60. <input
  61. id="password-confirmation"
  62. v-model="confirm_newPassword"
  63. type="password"
  64. class="form-control h-40px w-full py-6px px-12px text-[14px] leading-[1.42857143] text-[#555] bg-[#fff] border border-solid border-gray-[#ccc] m-0"
  65. @input="changeErr"
  66. @keydown="keydown($event)"
  67. @keydown.enter="resetPassword"
  68. />
  69. </div>
  70. <div v-show="errMsg !== ''" class="error-mess error-mess-signup mb-5px">
  71. <span id="error-message error-tip ">{{errMsg}}</span>
  72. </div>
  73. <button
  74. class="btn btn-block bg-[#fdc656] text-[#fff] h-50px w-full py-6px px-12px mb-0 text-[14px] m-0 font-normal leading-[1.42857143] text-center whitespace-nowrap align-middle cursor-pointer border border-solid border-transparent"
  75. type="submit"
  76. @click="resetPassword"
  77. >
  78. 确认修改
  79. </button>
  80. </div>
  81. </div>
  82. </div>
  83. </section>
  84. </div>
  85. <footer class="footer-password">
  86. <div
  87. class="container-password footer-container w-full bg-[#222] text-[#fff] text-[18px] text-center px-15px mx-auto"
  88. >
  89. <div class="row footer-row py-50px px-100px text-left mx-[-15px]">
  90. <div
  91. class="col-xs-2 w-[16.66666667%] float-left relative min-h-1px px-15px"
  92. ></div>
  93. <div class="col-xs-3 w-[25%] float-left relative min-h-1px px-15px">
  94. <h4 class="title text-[18px] my-10px font-medium leading-[1.1]">
  95. PDF
  96. </h4>
  97. <ul class="p-0 mt-0 mb-10px">
  98. <li class="list-none text-[16px] mt-24px">
  99. <nuxt-link to="/" class="opacity-30 text-[#fff] no-underline bg-transparent">产品</nuxt-link>
  100. </li>
  101. <li class="list-none text-[16px] mt-24px">
  102. <nuxt-link to="/sdk" class="opacity-30 text-[#fff] no-underline bg-transparent">SDK介绍</nuxt-link>
  103. </li>
  104. </ul>
  105. </div>
  106. <div class="col-xs-3 w-[25%] float-left relative min-h-1px px-15px">
  107. <h4 class="title text-[18px] my-10px font-medium leading-[1.1]">
  108. 下载
  109. </h4>
  110. <ul class="p-0 mt-0 mb-10px">
  111. <li class="list-none text-[16px] mt-24px">
  112. <a
  113. target="_blank"
  114. href="https://www.kdanmobile.com/zh-cn/pdf-reader/"
  115. class="opacity-30 text-[#fff] no-underline bg-transparent"
  116. >PDF Reader</a
  117. >
  118. </li>
  119. <li class="list-none text-[16px] mt-24px">
  120. <a
  121. target="_blank"
  122. href="https://markups.kdanmobile.com/"
  123. class="opacity-30 text-[#fff] no-underline bg-transparent"
  124. >Markup</a
  125. >
  126. </li>
  127. <li class="list-none text-[16px] mt-24px">
  128. <a
  129. target="_blank"
  130. href="https://www.kdanmobile.com/zh-cn/pdf-reader/"
  131. class="opacity-30 text-[#fff] no-underline bg-transparent"
  132. >Connoisser</a
  133. >
  134. </li>
  135. <li class="list-none text-[16px] mt-24px">
  136. <a
  137. target="_blank"
  138. href="https://chrome.google.com/webstore/detail/pdf-markup-my-web-markups/cbjngbfjehiofmihfpodinolkcokdojp"
  139. class="opacity-30 text-[#fff] no-underline bg-transparent"
  140. >网页插件</a
  141. >
  142. </li>
  143. </ul>
  144. </div>
  145. <div class="col-xs-3 w-[25%] float-left relative min-h-1px px-15px">
  146. <h4 class="title text-[18px] my-10px font-medium leading-[1.1]">
  147. 联系我们
  148. </h4>
  149. <div class="icon mt-28px">
  150. <a
  151. class="call mt-20px mr-20px no-underline"
  152. title="0731-84225961"
  153. ></a>
  154. <a
  155. target="_blank"
  156. href="http://weibo.com/kdanmobilesoftware"
  157. class="weibo mt-20px mr-20px no-underline"
  158. ></a>
  159. <a
  160. class="qq mt-20px mr-20px no-underline"
  161. href="tencent://message/?uin=231368992&amp;Site"
  162. ></a>
  163. </div>
  164. </div>
  165. </div>
  166. <p class="text-muted text-[14px] text-[#777] mb-10px mt-0 mx-0">
  167. <a target="_blank" href="/terms" class="text-muted"
  168. >服务条款</a
  169. >
  170. |
  171. <a target="_blank" href="/privacy" class="text-muted"
  172. >隐私政策</a
  173. >
  174. | ©2022 Kdanmobile All Rights Reserved.
  175. </p>
  176. <p class="text-muted text-[14px] text-[#777] mb-10px mt-0 mx-0">
  177. 凯钿公司 版权所有
  178. </p>
  179. </div>
  180. </footer>
  181. </div>
  182. </template>
  183. <script>
  184. import qs from 'qs'
  185. export default {
  186. layout(){
  187. return 'custom'
  188. },
  189. middleware:'user',
  190. head(){
  191. return {
  192. title:'17PDF Reader - 账号管理'
  193. }
  194. },
  195. data() {
  196. return {
  197. confirm_newPassword: '',
  198. newPassword: '',
  199. showError: false,
  200. errMsg: ''
  201. }
  202. },
  203. mounted() {
  204. this.isTheLinkVaild()
  205. },
  206. methods: {
  207. resetPassword() {
  208. this.isTheLinkVaild()
  209. if(this.newPassword === '' || this.confirm_newPassword === '') {
  210. this.errMsg = "密码不能为空"
  211. return
  212. } else if (this.newPassword.length < 6){
  213. this.errMsg = "密码不能少于六位"
  214. return
  215. } else if(this.confirm_newPassword !== this.newPassword){
  216. this.errMsg = "密码不一致"
  217. return
  218. }
  219. const data = qs.parse(location.href.split('?')[1])
  220. const params = {
  221. account: data.account,
  222. verifyCode: data.verifyCode,
  223. type: '0',
  224. newPassword: this.newPassword
  225. }
  226. this.$axios.post('members/resetPassword', params).then((res) => {
  227. if(res.code === 200) {
  228. this.$router.push('/')
  229. }
  230. })
  231. },
  232. changeErr(){
  233. this.errMsg = ''
  234. },
  235. keydown(event){
  236. if(event.keyCode == 32){
  237. event.returnValue = false
  238. this.errMsg = '请勿输入空格'
  239. }
  240. },
  241. isTheLinkVaild(){
  242. const data = qs.parse(location.href.split('?')[1])
  243. const params = {
  244. account: data.account,
  245. code: data.verifyCode
  246. }
  247. this.$axios.post('members/checkResetPasswordValid',qs.stringify(params)).then((res)=>{
  248. if(res.code !== 200) {
  249. this.$router.push('/edit')
  250. }
  251. })
  252. }
  253. }
  254. }
  255. </script>
  256. <style>
  257. /* 字体 */
  258. .family {
  259. font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  260. }
  261. /* 头部边框 */
  262. .nav-header-password {
  263. border-bottom: 1px solid #dadada;
  264. }
  265. /* logo背景图 */
  266. .logo-img {
  267. background: url(~/assets/images/password/logo_pdf_top_red-f4311f231ebc70c4ba5ac8e1e6af907a48ea69f1f159c501a277ade70dfd7022.png)
  268. no-repeat 85% 50%;
  269. }
  270. /* input被focus */
  271. .form-control:focus {
  272. border-color: #66afe9;
  273. outline: 0;
  274. -webkit-box-shadow: inset 0 1px 1px rgb(0 0 0 / 8%),
  275. 0 0 8px rgb(102 175 233 / 60%);
  276. box-shadow: inset 0 1px 1px rgb(0 0 0 / 8%), 0 0 8px rgb(102 175 233 / 60%);
  277. }
  278. .btn:hover {
  279. background-color: #fab93d;
  280. }
  281. .container-password::before,
  282. .container-password::after,
  283. .row::before,
  284. .row::after {
  285. content: ' ';
  286. display: table;
  287. clear: both;
  288. }
  289. /* windi css不能实现的 */
  290. .form-control {
  291. -webkit-box-shadow: inset 0 1px 1px rgb(0 0 0 / 8%);
  292. box-shadow: inset 0 1px 1px rgb(0 0 0 / 8%);
  293. -webkit-transition: border-color ease-in-out 0.15s,
  294. -webkit-box-shadow ease-in-out 0.15s;
  295. -o-transition: border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s;
  296. transition: border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s;
  297. }
  298. /* 确认按钮 */
  299. .btn {
  300. -ms-touch-action: manipulation;
  301. touch-action: manipulation;
  302. -webkit-user-select: none;
  303. -moz-user-select: none;
  304. -ms-user-select: none;
  305. user-select: none;
  306. }
  307. /* 底部图标 */
  308. .call:before {
  309. content: url(~/assets/images/password/ic_foot_phone_normal-6c4b69f54ec3fd9ba9c181a1a776c0ea4695c2c4f26c134b88f41796d14c72af.png);
  310. }
  311. .weibo:before {
  312. content: url(~/assets/images/password/ic_foot_weibo_normal-c0b566a8cc73aa0577487c8f179327856e74b0572a787211917c3a2e671f8628.png);
  313. }
  314. .qq:before {
  315. content: url(~/assets/images/password/ic_foot_qq_normal-e67510e549266f75e77757d308306b01185370fffc5a105438d91601b6a486ec.png);
  316. }
  317. .error-mess {
  318. position: relative;
  319. font-size: 14px;
  320. text-align: center;
  321. }
  322. .error-mess-signup {
  323. position: initial;
  324. clear: both;
  325. margin-top: 15px;
  326. }
  327. .error-mess span{
  328. display: inline-block;
  329. background: #808080;
  330. color: rgb(255, 255, 255);
  331. padding: 5px 15px;
  332. border-radius: 4px;
  333. }
  334. </style>