AI销管
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Setthepassword.vue 7.7 KiB

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