AI销管
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

Setthepassword.vue 7.6 KiB

2 anos atrás
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414
  1. <template>
  2. <view>
  3. <!-- <view style="width: 100%;height: 180rpx;"></view> -->
  4. <view class="input">
  5. <!-- <view class="zcasfdasf">设置密码</view>
  6. <view class="tejHdgasd">设置密码后,就可以使用手机号码与密码登录了~</view> -->
  7. <view class="cwjs-cells item-flex" style="margin-top: 80rpx;">
  8. <view class="cwjs-item center" style="margin-left:30rpx;">
  9. <input type="text" v-model="phone" placeholder="请输入手机号码" maxlength="11"
  10. placeholder-style='color:#AAAAAA;' />
  11. </view>
  12. </view>
  13. <view class="cwjs-cells item-flex" style="margin-top:30rpx;">
  14. <view class="cwjs-item center" style="margin-left:30rpx;display: flex;">
  15. <input type="text" v-model="msg" placeholder="请输入验证码" maxlength="4"
  16. placeholder-style='color:#AAAAAA;' />
  17. <view class="mamay">
  18. <view class="sada" v-if="sendAuthCode" style="font-size: 30rpx;" @click="getAuthCode">获取验证码
  19. </view>
  20. <text class="sada" v-if="!sendAuthCode">
  21. 重新发送({{ auth_time }})
  22. <!-- <text></text> -->
  23. </text>
  24. </view>
  25. </view>
  26. </view>
  27. <view style="margin-top:30rpx" class="cwjs-cells item-flex">
  28. <view class="cwjs-item center" style="margin-left:30rpx;">
  29. <input class="cwjs-item cwjs-input" v-model="username" password="true" placeholder="请设置6~12位的登录密码"
  30. placeholder-style='color:#AAAAAA' maxlength="12" />
  31. </view>
  32. </view>
  33. </view>
  34. <view class="button" @tap="bindWxBLogin">确认</view>
  35. </view>
  36. </template>
  37. <script>
  38. var util = require("../../utils/util.js");
  39. var config = require("../../config");
  40. var app = getApp();
  41. var WXB_SESSION_LOGIN_DATA = 'weapp_session_login_data';
  42. export default {
  43. data() {
  44. return {
  45. username: '', //获取到的密码
  46. phone: '',
  47. auth_time: 0,
  48. sendAuthCode: true,
  49. msg: '',
  50. code:''
  51. }
  52. },
  53. onLoad: function(options) {
  54. // this.phone = options.username
  55. },
  56. methods: {
  57. bindWxBLogin() {
  58. if(this.code!=this.msg){
  59. util.showNone("验证码错误");
  60. return false;
  61. }
  62. if (this.username.length < 6) {
  63. util.showNone("密码小于6位,请重试");
  64. return false;
  65. } else {
  66. var loginParams = {
  67. username: this.phone, //手机号
  68. newpassword: this.username, //密码
  69. }
  70. uni.request({
  71. url: config.service.forgotPassword,
  72. header: {
  73. 'content-type': 'application/json'
  74. },
  75. data: loginParams,
  76. method: "POST",
  77. success: function(result) {
  78. if (result.data.code == 10000) {
  79. uni.reLaunch({
  80. url: '/pages/login/index',
  81. })
  82. } else {
  83. util.showNone(result.data.message);
  84. return false;
  85. }
  86. }
  87. })
  88. }
  89. },
  90. //获取验证码
  91. getAuthCode() {
  92. if (this.phone == '') {
  93. uni.showToast({
  94. title: '手机号不能为空',
  95. icon: 'none'
  96. });
  97. return
  98. }
  99. this.code=''
  100. uni.request({
  101. url: config.service.sendCode + "/" + this.phone,
  102. method: "GET",
  103. header: {
  104. 'content-type': 'application/json',
  105. },
  106. success: (data) => {
  107. console.log(data)
  108. // 成功地响应会话信息
  109. if (data.data.code == 0) {
  110. util.showSuccess('发送成功');
  111. this.code=data.data.data
  112. this.sendAuthCode = false;
  113. this.auth_time = 60;
  114. var auth_timetimer = setInterval(() => {
  115. this.auth_time--;
  116. if (this.auth_time <= 0) {
  117. this.sendAuthCode = true;
  118. clearInterval(auth_timetimer);
  119. }
  120. }, 1000);
  121. } else {
  122. util.showNone(data.data.msg);
  123. return false;
  124. }
  125. },
  126. })
  127. },
  128. }
  129. };
  130. </script>
  131. <style lang="scss">
  132. .cwjs-logo {
  133. display: block;
  134. width: 219rpx;
  135. height: 158rpx;
  136. margin: 54rpx auto 66rpx;
  137. }
  138. .cwjs-tips {
  139. font-size: 24rpx;
  140. padding: 80rpx 0;
  141. color: #8a8a8a;
  142. }
  143. .cwjs-form {
  144. position: relative;
  145. margin: 0;
  146. background-color: #fff;
  147. border-radius: 10px;
  148. padding: 20rpx 40rpx 113rpx;
  149. }
  150. .zcasfdasf {
  151. height: 48rpx;
  152. font-size: 48rpx;
  153. font-weight: 400;
  154. color: #303030;
  155. line-height: 48rpx;
  156. margin-top: 80rpx;
  157. }
  158. .tejHdgasd {
  159. height: 28rpx;
  160. font-size: 26rpx;
  161. font-weight: 400;
  162. color: #303030;
  163. line-height: 28rpx;
  164. margin-top: 28rpx;
  165. }
  166. .cwjs-cells {
  167. width: 600rpx;
  168. display: flex;
  169. flex-direction: row;
  170. justify-content: space-between;
  171. align-items: center;
  172. margin: 0 auto;
  173. height: 88rpx;
  174. overflow: hidden;
  175. border: 1rpx solid #BFC7D3;
  176. position: relative;
  177. border-radius: 12rpx;
  178. padding-left: 20rpx;
  179. }
  180. .center {
  181. flex: 1;
  182. display: flex;
  183. }
  184. .texteasda {
  185. height: 88rpx;
  186. line-height: 88rpx;
  187. font-size: 28rpx;
  188. color: #000;
  189. }
  190. .cwjs-input {
  191. width: 100%;
  192. height: 88rpx;
  193. line-height: 88rpx;
  194. font-size: 28rpx;
  195. color: #000;
  196. }
  197. .images {
  198. display: block;
  199. width: 40rpx;
  200. height: 21rpx;
  201. margin-right: 30rpx;
  202. margin-top: 33.5rpx;
  203. }
  204. .mod-btn {
  205. position: absolute;
  206. bottom: -80rpx;
  207. left: 50%;
  208. margin-left: -80rpx;
  209. }
  210. .mod-btn .button {
  211. width: 160rpx;
  212. height: 160rpx;
  213. background: linear-gradient(180deg, rgba(116, 197, 230, 1) 0%, rgba(64, 147, 201, 1) 100%);
  214. border: 10rpx solid rgba(255, 255, 255, 1);
  215. border-radius: 100%;
  216. font-size: 36rpx;
  217. color: #fff;
  218. display: flex;
  219. justify-content: center;
  220. align-items: center;
  221. }
  222. .mod-btn .button::after {
  223. content: ""
  224. }
  225. .retPassword {
  226. display: inline;
  227. width: auto;
  228. font-size: 28rpx;
  229. color: rgba(64, 147, 201, 1);
  230. line-height: 40rpx;
  231. float: right;
  232. }
  233. .retPassword:active {
  234. background-color: #fff;
  235. }
  236. .appliyAdmin {
  237. position: absolute;
  238. left: 50%;
  239. margin-left: -57rpx;
  240. bottom: 100rpx;
  241. width: 114rpx;
  242. font-size: 28rpx;
  243. color: rgba(255, 255, 255, 1);
  244. line-height: 40rpx;
  245. }
  246. /* 头部 */
  247. .head {
  248. width: 750rpx;
  249. height: 355rpx;
  250. }
  251. .background {
  252. width: 750rpx;
  253. height: 400rpx;
  254. position: absolute;
  255. top: -3rpx;
  256. left: 0;
  257. }
  258. .logo {
  259. width: 123rpx;
  260. height: 107rpx;
  261. display: block;
  262. position: absolute;
  263. top: 84rpx;
  264. left: 313.5rpx;
  265. }
  266. .head text {
  267. font-size: 34rpx;
  268. font-family: PingFangSC-Medium, PingFang SC;
  269. font-weight: 500;
  270. color: #2343BD;
  271. position: absolute;
  272. top: 222rpx;
  273. left: 203rpx;
  274. }
  275. /* 输入框 */
  276. .input {
  277. width: 100%;
  278. height: auto;
  279. padding: 0 90rpx;
  280. box-sizing: border-box;
  281. }
  282. .logo_input {
  283. width: 34rpx;
  284. height: 38rpx;
  285. position: absolute;
  286. top: 25rpx;
  287. left: 0;
  288. }
  289. /* 登录 */
  290. .button {
  291. width: 630rpx;
  292. height: 86rpx;
  293. background: #2671E2;
  294. box-shadow: 0px 2rpx 20rpx 0px rgba(38, 113, 226, 0.5);
  295. border-radius: 49rpx;
  296. text-align: center;
  297. line-height: 89rpx;
  298. color: #fff;
  299. margin: 0 auto;
  300. margin-top: 239rpx;
  301. font-size: 34rpx;
  302. }
  303. .footer {
  304. width: 100%;
  305. height: 157rpx;
  306. position: absolute;
  307. bottom: 0;
  308. left: 0;
  309. }
  310. .agreeBox {
  311. font-size: 28rpx;
  312. color: #88909E;
  313. margin: 0 auto;
  314. margin-top: 30rpx;
  315. position: relative;
  316. display: flex;
  317. }
  318. checkbox {
  319. transform: scale(0.5);
  320. }
  321. checkbox-group {
  322. display: inline;
  323. }
  324. navigator {
  325. display: inline
  326. }
  327. .agreeBox image {
  328. width: 26rpx;
  329. height: 26rpx;
  330. display: block;
  331. position: absolute;
  332. top: 9rpx;
  333. left: 18rpx;
  334. margin-right: 19rpx;
  335. }
  336. .imagesBox {
  337. width: 80rpx;
  338. height: 88rpx;
  339. }
  340. .chooseBox {
  341. width: 60rpx;
  342. height: 60rpx;
  343. }
  344. .login {
  345. text-decoration: underline;
  346. text-align: center;
  347. margin-top: 40px;
  348. color: #88909E;
  349. font-size: 28rpx;
  350. }
  351. .textbox {
  352. width: 569rpx;
  353. display: flex;
  354. margin-top: 40rpx;
  355. }
  356. .textbox-1 {
  357. width: 30%;
  358. font-size: 30rpx;
  359. color: #999999;
  360. }
  361. .textbox-11 {
  362. width: 30%;
  363. text-align: right;
  364. font-size: 30rpx;
  365. color: #999999;
  366. }
  367. .textbox-2 {
  368. width: 40%;
  369. }
  370. </style>