| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175 |
- <template>
- <view>
- <scroll-view scroll-y class="page">
- <cu-custom bgColor="bg-luohu" :isBack="true">
- <block slot="backText">返回</block>
- <block slot="content">修改密码</block>
- <!-- <view slot="right" @tap="rightClick">编辑</view> -->
- </cu-custom>
- <view class="example-body " style="display: flex;justify-content: center; margin-top: 80rpx;">
- <uni-file-picker readonly :value="fileLists" :imageStyles="imageStyles" file-mediatype="image">
- </uni-file-picker>
- </view>
- <!-- list列表 -->
- <uni-card>
- <view class="cu-list menu">
- <view class="cu-form-group">
- <view class="title">密码</view>
- <input placeholder="请输入六位以上密码" name="input" type="password" v-model="password"></input>
- </view>
- <view class="cu-form-group">
- <view class="title">确认</view>
- <input placeholder="请再输入一遍密码" name="input" type="password" v-model="again"></input>
- </view>
- </view>
- </uni-card>
- <view class="padding flex flex-direction" style="margin-bottom: 100rpx;">
- <button class="cu-btn bg-blue lg" @click="submit">确认修改</button>
- </view>
- </scroll-view>
- </view>
- </template>
- <script>
- import {
- ACCESS_TOKEN,
- USER_NAME,
- USER_INFO
- } from "@/common/util/constants"
- import api from '@/api/api.js'
- export default {
- data() {
- return {
- imageStyles: {
- width: 84,
- height: 84,
- border: {
- radius: '50%'
- }
- },
- listStyles: {
- // 是否显示边框
- border: true,
- // 是否显示分隔线
- dividline: true,
- // 线条样式
- borderStyle: {
- width: 1,
- color: 'blue',
- style: 'dashed',
- radius: 2
- }
- },
- fileLists: [{
- //url: 'https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/b7c7f970-517d-11eb-97b7-0dc4655d6e68.jpg',
- url: '/static/touxiang.jpg',
- extname: 'png',
- name: 'shuijiao.png'
- }],
- password: "",
- again: "",
- };
- },
- onLoad() {
- this.user = uni.getStorageSync(USER_INFO);
- //this.loadinfo()
- console.log(this.user)
- },
- methods: {
- submit() {
- if (!this.password || this.password.length < 6) {
- this.$tip.alert('正确输入密码');
- return false
- }
- if (this.password != this.again) {
- this.$tip.alert('两次输入不一致');
- return false
- }
- let data = {
- "userIds": [
- this.user.employee.id,
- ],
- "newPassword": this.password,
- "repeatPassword": this.again,
- "primitivePassword": "",
- "reset": 1
- };
- let that = this;
- this.$http.post("/ibps/platform/v3/user/change/passwd", data).then(res => {
- if (res.data.state == 200) {
- that.$tip.toast("修改成功")
- uni.navigateTo({
- url: "/pages/index/index"
- })
- } else {
- this.$tip.toast("发送异常");
- }
- });
- }
- }
- }
- </script>
- <style>
- .page {
- height: 100Vh;
- width: 100vw;
- }
- .page.show {
- overflow: hidden;
- }
- .switch-sex::after {
- content: "\e716";
- }
- .switch-sex::before {
- content: "\e7a9";
- }
- .switch-music::after {
- content: "\e66a";
- }
- .switch-music::before {
- content: "\e6db";
- }
- .example-body {
- padding: 10px;
- padding-top: 0;
- }
- .custom-image-box {
- /* #ifndef APP-NVUE */
- display: flex;
- /* #endif */
- flex-direction: row;
- justify-content: space-between;
- align-items: center;
- }
- .text {
- font-size: 14px;
- color: #333;
- }
- </style>
|