初次提交
This commit is contained in:
114
pages/sys/user/about.vue
Normal file
114
pages/sys/user/about.vue
Normal file
@ -0,0 +1,114 @@
|
||||
<template>
|
||||
<view class="wrap">
|
||||
<u-toast ref="uToast" />
|
||||
|
||||
<view class="u-p-t-30 u-p-b-30 u-flex u-flex-col u-text-center">
|
||||
<!-- <u-avatar size="250" src="/static/aidex/logo200.png"></u-avatar> -->
|
||||
<view class="title">{{this.$t('homePage.mine.hoenergypower')}}</view>
|
||||
<!-- <view class="version">{{vuex_config.productVersion}}</view> -->
|
||||
</view>
|
||||
<u-cell-group class="form" :border="false">
|
||||
<navigator url="" open-type="navigate">
|
||||
<u-cell-item :title="$t('homePage.mine.companyHomepage')">https://www.hoenergypower.cn</u-cell-item>
|
||||
</navigator>
|
||||
<navigator>
|
||||
<u-cell-item :arrow="false" :title="$t('homePage.mine.technicalServices')">15389457063</u-cell-item>
|
||||
</navigator>
|
||||
<navigator url="" open-type="navigate">
|
||||
<u-cell-item :arrow="true" :title="$t('homePage.mine.termsOfService')" @click="tip"></u-cell-item>
|
||||
</navigator>
|
||||
</u-cell-group>
|
||||
<u-row gutter="16" style="margin-top: 20px;">
|
||||
|
||||
</u-row>
|
||||
<view class="copyright">
|
||||
<view> 版权所有</view>
|
||||
<view>Copyright © 2021 hoenergy.com</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
computed: {
|
||||
language(){
|
||||
return this.vuex_language
|
||||
}
|
||||
},
|
||||
watch:{
|
||||
language: {
|
||||
immediate: true,
|
||||
deep:true,
|
||||
handler(val) {
|
||||
uni.setNavigationBarTitle({
|
||||
title: this.$t('homePage.mine.aboutUs')
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
tip(){
|
||||
this.$refs.uToast.show({
|
||||
title: this.$t('homePage.mine.notAva'),
|
||||
type: "warning",
|
||||
});
|
||||
},
|
||||
upgrade(){
|
||||
// #ifdef APP-PLUS
|
||||
this.$u.api.upgradeCheck().then(res => {
|
||||
if (res.result == 'true'){
|
||||
uni.showModal({
|
||||
title: this.$t('homePage.mine.tip'),
|
||||
content: res.message + this.$t('homePage.mine.downUpdate'),
|
||||
showCancel: true,
|
||||
success: function (res2) {
|
||||
if (res2.confirm) {
|
||||
plus.runtime.openURL(res.data.apkUrl);
|
||||
}
|
||||
}
|
||||
});
|
||||
}else{
|
||||
this.$u.toast(res.message);
|
||||
}
|
||||
});
|
||||
// #endif
|
||||
// #ifndef APP-PLUS
|
||||
this.$u.toast(this.$t('homePage.mine.noUpdate'));
|
||||
// #endif
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
page {
|
||||
background-color: #f5f5f5;
|
||||
}
|
||||
.title {
|
||||
display: flex;
|
||||
margin: 30rpx 0 10px;
|
||||
font-size: 50rpx;
|
||||
}
|
||||
.version {
|
||||
margin-bottom: 10rpx;
|
||||
font-size: 40rpx;
|
||||
}
|
||||
.copyright {
|
||||
margin-top: 50rpx;
|
||||
text-align: center;
|
||||
line-height: 60rpx;
|
||||
color: #999;
|
||||
}
|
||||
.cade-box{
|
||||
uni-image{
|
||||
width: 120px;
|
||||
height:120px;
|
||||
border: 1px solid #dcdcdc;
|
||||
padding: 5px;
|
||||
background: #ffffff;
|
||||
}
|
||||
}
|
||||
.cade-text{
|
||||
color: #999999;
|
||||
font-size:12px;
|
||||
}
|
||||
</style>
|
||||
98
pages/sys/user/currency.vue
Normal file
98
pages/sys/user/currency.vue
Normal file
@ -0,0 +1,98 @@
|
||||
<template>
|
||||
<view class="wrap">
|
||||
<u-cell-group :border="false" :title="$t('homePage.mine.messageAlerts')">
|
||||
<u-cell-item :title="$t('homePage.mine.acceptMessageAlerts')" :arrow="false">
|
||||
<u-switch v-model="message" slot="right-icon" class="u-m-l-20"></u-switch>
|
||||
</u-cell-item>
|
||||
<u-cell-item :title="$t('homePage.mine.messageDetail')" :arrow="false">
|
||||
<u-switch v-model="messageBar" slot="right-icon" class="u-m-l-20"></u-switch>
|
||||
<text slot="label">{{this.$t('homePage.mine.closeMessage')}}</text>
|
||||
</u-cell-item>
|
||||
</u-cell-group>
|
||||
<u-cell-group :border="false" :title="$t('homePage.mine.sound')">
|
||||
<u-cell-item :title="$t('homePage.mine.acceptSound')" @click="openSettings">
|
||||
<text slot="label">{{ this.$t('homePage.mine.settingSound') }}</text>
|
||||
</u-cell-item>
|
||||
</u-cell-group>
|
||||
<u-cell-group :border="false" :title="$t('homePage.mine.update')">
|
||||
<u-cell-item :title="$t('homePage.mine.update')" :arrow="false">
|
||||
<u-switch v-model="upgrade" slot="right-icon" class="u-m-l-20"></u-switch>
|
||||
<text slot="label">{{ this.$t('homePage.mine.updateAlerts') }}</text>
|
||||
</u-cell-item>
|
||||
</u-cell-group>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
message: true,
|
||||
messageBar: true,
|
||||
upgrade: true
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
language(){
|
||||
return this.vuex_language
|
||||
}
|
||||
},
|
||||
watch:{
|
||||
language: {
|
||||
immediate: true,
|
||||
deep:true,
|
||||
handler(val) {
|
||||
uni.setNavigationBarTitle({
|
||||
title: this.$t('homePage.mine.general')
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
openSettings() {
|
||||
// #ifdef APP-PLUS
|
||||
uni.getSystemInfo({
|
||||
success(res) {
|
||||
if(res.platform == 'ios'){
|
||||
plus.runtime.openURL("app-settings://");
|
||||
} else if (res.platform == 'android'){
|
||||
var main = plus.android.runtimeMainActivity();
|
||||
var Intent = plus.android.importClass("android.content.Intent");
|
||||
var mIntent = new Intent('android.settings.SOUND_SETTINGS');
|
||||
main.startActivity(mIntent);
|
||||
}
|
||||
}
|
||||
});
|
||||
// #endif
|
||||
// #ifndef APP-PLUS
|
||||
this.$u.toast(this.$t('homePage.mine.noUpdate'));
|
||||
// #endif
|
||||
},
|
||||
logout() {
|
||||
this.$u.api.logout().then(res => {
|
||||
this.$u.toast(res.msg);
|
||||
if (res.code == '200') {
|
||||
let self = this;
|
||||
setTimeout(() => {
|
||||
uni.reLaunch({
|
||||
url: '/pages/sys/login/index'
|
||||
});
|
||||
}, 500);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="scss">
|
||||
|
||||
|
||||
page {
|
||||
background-color: #f8f8f8;
|
||||
}
|
||||
|
||||
/deep/ .u-cell-title {
|
||||
padding: 25rpx 30rpx;
|
||||
font-size: 30rpx;
|
||||
}
|
||||
</style>
|
||||
205
pages/sys/user/info.vue
Normal file
205
pages/sys/user/info.vue
Normal file
@ -0,0 +1,205 @@
|
||||
<template>
|
||||
<view class="wrap" style="padding-bottom: 60px">
|
||||
<u-toast ref="uToast" />
|
||||
|
||||
<u-cell-group :border="false">
|
||||
<u-gap height="20" bg-color="#f5f5f5"></u-gap>
|
||||
<u-cell-item
|
||||
title="头像"
|
||||
:arrow="true"
|
||||
@click="navTo('/pages/sys/user/modify')"
|
||||
>
|
||||
<u-avatar
|
||||
size="60"
|
||||
bg-color="#000;"
|
||||
:src="avatarUrl"
|
||||
@click="chooseAvatar"
|
||||
style="position: absolute; right: 35px; top: 12px"
|
||||
></u-avatar>
|
||||
</u-cell-item>
|
||||
<u-cell-item
|
||||
title="公司"
|
||||
value="科技有限公司"
|
||||
:title-width="180"
|
||||
:arrow="false"
|
||||
></u-cell-item>
|
||||
<u-cell-item
|
||||
title="所属部门"
|
||||
:value="userData.deptName"
|
||||
:title-width="180"
|
||||
:arrow="false"
|
||||
></u-cell-item>
|
||||
<u-cell-item
|
||||
title="岗位"
|
||||
:value="positionList"
|
||||
:title-width="180"
|
||||
:arrow="false"
|
||||
></u-cell-item>
|
||||
<u-cell-item
|
||||
title="手机"
|
||||
:value="userData.phone"
|
||||
:title-width="180"
|
||||
:arrow="false"
|
||||
@click="navTo('/pages/sys/user/modify')"
|
||||
></u-cell-item>
|
||||
|
||||
<u-gap height="20" bg-color="#f5f5f5"></u-gap>
|
||||
</u-cell-group>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
model: {
|
||||
sex: "1",
|
||||
},
|
||||
rules: {},
|
||||
avatarBase64: "",
|
||||
positionList: ''
|
||||
};
|
||||
},
|
||||
onLoad() {
|
||||
// this.$u.api.getUserInfo().then((res) => {
|
||||
// if (res.code == "200") {
|
||||
// this.model = {
|
||||
// id: res.user.id,
|
||||
// name: res.user.name,
|
||||
// sex: res.user.sex,
|
||||
// email: res.user.email,
|
||||
// phonenumber: res.user.phonenumber,
|
||||
// officeTel: res.user.officeTel,
|
||||
// loginDate: res.user.loginDate,
|
||||
// loginIp: res.user.loginIp,
|
||||
// };
|
||||
// } else if (res.result == "login") {
|
||||
// uni.reLaunch({
|
||||
// url: "/pages/sys/login/index",
|
||||
// });
|
||||
// } else {
|
||||
// this.$u.toast(res.message);
|
||||
// }
|
||||
// });
|
||||
// uni.$on("uAvatarCropper", (path) => {
|
||||
// this.avatarBase64 = path;
|
||||
// });
|
||||
},
|
||||
computed: {
|
||||
userData(){
|
||||
return this.vuex_user
|
||||
},
|
||||
avatarUrl() {
|
||||
// if (this.avatarBase64 != "") {
|
||||
// return this.avatarBase64;
|
||||
// }
|
||||
// let url =
|
||||
// this.vuex_config.baseUrl + this.vuex_user.avatar ||
|
||||
// "/static/aidex/tabbar/my_2.png";
|
||||
// url = this.replaceAll(url, "\\", "/");
|
||||
// //url = url.replace('/aidex/', this.vuex_config.baseUrl + '/');
|
||||
// /* alert(url); */
|
||||
// return url;
|
||||
},
|
||||
},
|
||||
onLoad(){
|
||||
const position = []
|
||||
this.userData.positionList.forEach((el) => {
|
||||
position.push(el.name)
|
||||
|
||||
})
|
||||
this.positionList = position.join();
|
||||
},
|
||||
onReady() {
|
||||
// this.$refs.uForm.setRules(this.rules);
|
||||
},
|
||||
methods: {
|
||||
navTo() {
|
||||
this.$refs.uToast.show({
|
||||
title: "此功能暂未开放",
|
||||
type: "warning",
|
||||
});
|
||||
},
|
||||
chooseAvatar() {
|
||||
// this.$u.route({
|
||||
// url: '/uview-ui/components/u-avatar-cropper/u-avatar-cropper',
|
||||
// params: {
|
||||
// destWidth: 200, // 输出图片宽高
|
||||
// rectWidth: 200, // 裁剪框的宽高
|
||||
// fileType: 'jpg', // 输出的图片类型,如果'png'类型发现裁剪的图片太大,改成"jpg"即可
|
||||
// }
|
||||
// })
|
||||
},
|
||||
submit() {
|
||||
this.$refs.uForm.validate((valid) => {
|
||||
if (valid) {
|
||||
// #ifdef MP-WEIXIN || MP-TOUTIAO
|
||||
this.$u.toast("您填写的信息有误,11。");
|
||||
if (
|
||||
this.avatarBase64 != "" &&
|
||||
!this.avatarBase64.startsWith("data:")
|
||||
) {
|
||||
this.avatarBase64 =
|
||||
"data:image/jpeg;base64," +
|
||||
uni
|
||||
.getFileSystemManager()
|
||||
.readFileSync(this.avatarBase64, "base64");
|
||||
}
|
||||
// #endif
|
||||
this.model.avatarBase64 = this.avatarBase64;
|
||||
this.$u.api.user.saveUserInfo(this.model).then((res) => {
|
||||
if (res.code == "200") {
|
||||
this.vuex_user.avatar = res.imgUrl;
|
||||
this.$u.vuex("vuex_user", this.vuex_user);
|
||||
uni.showModal({
|
||||
title: "提示",
|
||||
content: res.msg,
|
||||
showCancel: false,
|
||||
success: function () {
|
||||
uni.navigateBack();
|
||||
},
|
||||
});
|
||||
} else {
|
||||
this.$u.toast(res.msg);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.$u.toast("您填写的信息有误,请根据提示修正。");
|
||||
}
|
||||
});
|
||||
},
|
||||
cancel() {
|
||||
uni.navigateBack();
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style lang="scss">
|
||||
page {
|
||||
background: #f5f5f5;
|
||||
}
|
||||
.u-form {
|
||||
background: #fff;
|
||||
padding: 0 15px;
|
||||
}
|
||||
.u-size-medium {
|
||||
height: 60rpx;
|
||||
line-height: 60rpx;
|
||||
padding: 0 20px;
|
||||
font-size: 28rpx;
|
||||
background-color: rgba(0, 0, 0, 0.1);
|
||||
color: #fff;
|
||||
border: 1px solid #5186e7;
|
||||
}
|
||||
.u-hairline-border:after {
|
||||
border: 1px solid #5186e7 !important;
|
||||
}
|
||||
.input-placeholder {
|
||||
text-align: right;
|
||||
}
|
||||
.u-input {
|
||||
text-align: right !important;
|
||||
}
|
||||
.u-form-item {
|
||||
font-size: 36rpx;
|
||||
}
|
||||
</style>
|
||||
180
pages/sys/user/message.vue
Normal file
180
pages/sys/user/message.vue
Normal file
@ -0,0 +1,180 @@
|
||||
<template>
|
||||
<view class="wrap">
|
||||
<view class="box" v-for="item in messageList" :key="item.messageId">
|
||||
<view class="title">
|
||||
{{item.createTime}}
|
||||
</view>
|
||||
<view class="content">
|
||||
{{item.messageContent}}
|
||||
</view>
|
||||
<u-line color="rgba(238, 238, 238, 1)"></u-line>
|
||||
<view class="bottom" @click="msgDetail(item.messageId)">
|
||||
<text class="detail">{{ this.$t('homePage.mine.lookDetail') }}</text>
|
||||
<u-icon name="arrow-right" color="rgba(0, 156, 119, 1)" size="20"></u-icon>
|
||||
</view>
|
||||
</view>
|
||||
<u-empty v-if="!messageList.length" :text="$t('homePage.mine.noMessage')" mode="messageList" style="height: 100vh;"></u-empty>
|
||||
<u-modal v-model="show" @confirm="confirm" ref="uModal" :show-cancel-button="true" :confirm-text="$t('homePage.mine.sureRead')"
|
||||
:cancel-text="$t('homePage.mine.cancel')" :async-close="true" :title="$t('homePage.mine.messageDetail')">
|
||||
<view style="padding: 20rpx;">
|
||||
<u-input v-model="contentValue" type="textarea" :border="false" disabled :height="100"
|
||||
:auto-height="true" />
|
||||
</view>
|
||||
|
||||
</u-modal>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
stationId: null,
|
||||
userId: null,
|
||||
messageList: [],
|
||||
show: false,
|
||||
contentValue: '',
|
||||
messageId: null,
|
||||
formModel: {},
|
||||
timer: null
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
language(){
|
||||
return this.vuex_language
|
||||
},
|
||||
currentStation() {
|
||||
return this.vuex_currentStation;
|
||||
},
|
||||
userData() {
|
||||
return this.vuex_user
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
language: {
|
||||
immediate: true,
|
||||
deep:true,
|
||||
handler(val) {
|
||||
uni.setNavigationBarTitle({
|
||||
title: this.$t('homePage.mine.messageAlerts')
|
||||
});
|
||||
}
|
||||
},
|
||||
currentStation: {
|
||||
handler(val) {
|
||||
if (val && val.id) {
|
||||
if (this.timer) {
|
||||
clearInterval(this.timer)
|
||||
}
|
||||
this.userId = this.userData.userId
|
||||
this.stationId = val.id
|
||||
if (this.stationId && this.userId) {
|
||||
this.getMessage()
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
deep: true,
|
||||
immediate: true
|
||||
},
|
||||
},
|
||||
onShow() {
|
||||
this.timer = setInterval(() => {
|
||||
this.getMessage()
|
||||
}, 3000)
|
||||
},
|
||||
onUnload() {
|
||||
if (this.timer) {
|
||||
clearInterval(this.timer)
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
confirm() {
|
||||
if (this.formModel.readStatus === 0) {
|
||||
this.$u.api.UpdateMessageStatus({
|
||||
messageId: this.formModel.messageId,
|
||||
stationId: this.stationId,
|
||||
receivingUser: this.userId
|
||||
}).then(() => {
|
||||
this.$u.toast(this.$t('homePage.mine.operateSuccess'));
|
||||
this.getMessage()
|
||||
this.show = false
|
||||
})
|
||||
} else {
|
||||
this.$u.toast(this.$t('homePage.mine.messageReaded'))
|
||||
}
|
||||
},
|
||||
msgDetail(id) {
|
||||
this.show = true
|
||||
this.$u.api.GetMessage({
|
||||
receivingUser: this.userId,
|
||||
stationId: this.stationId,
|
||||
messageId:id
|
||||
}).then((res) => {
|
||||
this.formModel = res.data[0]
|
||||
this.contentValue = this.formModel.messageContent
|
||||
})
|
||||
},
|
||||
getMessage() {
|
||||
this.$u.api.GetMessage({
|
||||
receivingUser: this.userId,
|
||||
stationId: this.stationId,
|
||||
createstatus: 3,
|
||||
readStatus: 0
|
||||
}).then((res) => {
|
||||
this.messageList = res.data
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
page {
|
||||
background: #f5f5f5;
|
||||
}
|
||||
|
||||
/deep/ .u-model__title {
|
||||
padding-top: 20rpx;
|
||||
margin-bottom: 10rpx;
|
||||
}
|
||||
|
||||
.wrap {
|
||||
padding: 10px;
|
||||
height: 100vh;
|
||||
overflow: auto;
|
||||
.box {
|
||||
height: 160rpx;
|
||||
width: 100%;
|
||||
border-radius: 10rpx;
|
||||
box-shadow: 0rpx 4rpx 16rpx 0rpx rgba(0, 0, 0, 0.2);
|
||||
padding: 16rpx 30rpx;
|
||||
margin-bottom: 10rpx;
|
||||
|
||||
.title {
|
||||
color: rgba(153, 153, 153, 1);
|
||||
font-size: 20rpx;
|
||||
}
|
||||
|
||||
.content {
|
||||
margin-top: 8rpx;
|
||||
margin-bottom: 12rpx;
|
||||
font-size: 24rpx;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.bottom {
|
||||
margin-top: 20rpx;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
|
||||
.detail {
|
||||
color: rgba(0, 156, 119, 1);
|
||||
font-size: 20rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
176
pages/sys/user/pwd.vue
Normal file
176
pages/sys/user/pwd.vue
Normal file
@ -0,0 +1,176 @@
|
||||
<template>
|
||||
<view class="wrap">
|
||||
<view class="remind-text"
|
||||
>{{ this.$t('homePage.mine.setPassword') }}<br />
|
||||
{{ this.$t('homePage.mine.passwordService') }}</view
|
||||
>
|
||||
<u-form class="form" :model="model" :rules="rules" ref="uForm">
|
||||
<u-form-item :label="$t('homePage.mine.oldPassword')" prop="oldPassword" label-width="180">
|
||||
<u-input
|
||||
type="password"
|
||||
v-model="model.oldPassword"
|
||||
:placeholder="$t('homePage.mine.inputOldPossword')"
|
||||
></u-input>
|
||||
</u-form-item>
|
||||
<u-form-item :label="$t('homePage.mine.newPassword')" prop="newPassword" label-width="180">
|
||||
<u-input
|
||||
type="password"
|
||||
v-model="model.newPassword"
|
||||
:placeholder="$t('homePage.mine.inputNewPassword')"
|
||||
></u-input>
|
||||
</u-form-item>
|
||||
<u-form-item :label="$t('homePage.mine.surePassword')" prop="confirmPassword" label-width="180">
|
||||
<u-input
|
||||
type="password"
|
||||
v-model="model.confirmPassword"
|
||||
:placeholder="$t('homePage.mine.inputSurePassword')"
|
||||
></u-input>
|
||||
</u-form-item>
|
||||
</u-form>
|
||||
<view class="remind-text">
|
||||
<u-icon name="question-circle" color="#2767dc" size="28"></u-icon>
|
||||
{{ this.$t('homePage.mine.PasswordError') }}</view
|
||||
>
|
||||
<view class="form-footer">
|
||||
<u-button class="btn" @click="submit">{{ this.$t('homePage.mine.submit') }}</u-button>
|
||||
<!-- <u-button class="btn" type="default" @click="cancel">关闭</u-button> -->
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
import { encryptUpdatePsd } from "@/common/common.js";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
model: {
|
||||
oldPassword: "",
|
||||
newPassword: "",
|
||||
confirmNewPassword: "",
|
||||
},
|
||||
rules: {
|
||||
oldPassword: [
|
||||
{
|
||||
required: true,
|
||||
message: this.$t('homePage.mine.oldPassword'),
|
||||
trigger: ["change", "blur"],
|
||||
},
|
||||
],
|
||||
newPassword: [
|
||||
{
|
||||
required: true,
|
||||
message: this.$t('homePage.mine.newPassword'),
|
||||
trigger: ["change", "blur"],
|
||||
},
|
||||
{
|
||||
pattern: /^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]+\S{5,12}$/,
|
||||
message: this.$t('homePage.mine.PasswordError'),
|
||||
trigger: ["change", "blur"],
|
||||
},
|
||||
],
|
||||
confirmPassword: [
|
||||
{
|
||||
required: true,
|
||||
message: this.$t('homePage.mine.resetSubmit'),
|
||||
trigger: ["change", "blur"],
|
||||
},
|
||||
{
|
||||
validator: (rule, value, callback) => {
|
||||
return value === this.model.newPassword;
|
||||
},
|
||||
message: this.$t('homePage.mine.passwordEqual'),
|
||||
trigger: ["change", "blur"],
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
language(){
|
||||
return this.vuex_language
|
||||
}
|
||||
},
|
||||
watch:{
|
||||
language: {
|
||||
immediate: true,
|
||||
deep:true,
|
||||
handler(val) {
|
||||
uni.setNavigationBarTitle({
|
||||
title: this.$t('homePage.mine.accountSec')
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
onReady() {
|
||||
this.$refs.uForm.setRules(this.rules);
|
||||
},
|
||||
methods: {
|
||||
submit() {
|
||||
const self = this
|
||||
this.$refs.uForm.validate((valid) => {
|
||||
if (valid) {
|
||||
const psd = encryptUpdatePsd(this.vuex_iv,this.vuex_psdkey,this.model.oldPassword);
|
||||
const newpsd = encryptUpdatePsd(this.vuex_iv,this.vuex_psdkey,this.model.newPassword);
|
||||
const params = {
|
||||
oldPwd: psd,
|
||||
newPwd: newpsd,
|
||||
};
|
||||
this.$u.api.changePsd(params).then((res) => {
|
||||
if (res.code === 200) {
|
||||
uni.showModal({
|
||||
title: this.$t('homePage.mine.tip'),
|
||||
content: this.$t('homePage.mine.updateSuccess'),
|
||||
showCancel: false,
|
||||
success: function () {
|
||||
self.logout()
|
||||
},
|
||||
});
|
||||
} else {
|
||||
uni.showModal({
|
||||
title: this.$t('homePage.mine.tip'),
|
||||
content: res.msg,
|
||||
showCancel: false,
|
||||
});
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.$u.toast(this.$t('homePage.mine.inputError'));
|
||||
}
|
||||
});
|
||||
},
|
||||
logout() {
|
||||
this.$u.api.logout().then(res => {
|
||||
if (res.code == 200) {
|
||||
uni.reLaunch({
|
||||
url: '/pages/sys/login/index'
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
cancel() {
|
||||
uni.navigateBack();
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style lang="scss">
|
||||
page {
|
||||
background: #f5f5f5;
|
||||
}
|
||||
.u-form {
|
||||
background: #fff;
|
||||
padding: 0px 15px;
|
||||
}
|
||||
.remind-text {
|
||||
padding: 20rpx 30rpx;
|
||||
color: #666666;
|
||||
}
|
||||
.form-footer {
|
||||
padding: 30rpx;
|
||||
.btn {
|
||||
width: 690rpx;
|
||||
background-color:#009C77;
|
||||
border-color: #009C77!important;
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
116
pages/sys/user/setting.vue
Normal file
116
pages/sys/user/setting.vue
Normal file
@ -0,0 +1,116 @@
|
||||
<template>
|
||||
<view class="wrap">
|
||||
<u-toast ref="uToast" />
|
||||
|
||||
<u-gap height="20" bg-color="#f5f5f5"></u-gap>
|
||||
<u-cell-group :border="false">
|
||||
<u-cell-item :title="$t('homePage.mine.general')" @click="navTo('/pages/sys/user/currency')" :arrow="true"></u-cell-item>
|
||||
<u-gap height="20" bg-color="#f5f5f5"></u-gap>
|
||||
<u-cell-item :title="$t('homePage.mine.version')" :arrow="false">{{ innerVer }}</u-cell-item>
|
||||
<!-- <u-cell-item title="版本更新" @click="navTo('')" :arrow="true"></u-cell-item> -->
|
||||
<u-cell-item :title="$t('homePage.mine.Privacy')" @click="navTo('')" :arrow="true"></u-cell-item>
|
||||
<u-cell-item :title="$t('homePage.mine.UserAgreement')" @click="navTo('')" :arrow="true"></u-cell-item>
|
||||
</u-cell-group>
|
||||
<u-gap height="20" bg-color="#f5f5f5"></u-gap>
|
||||
<view>
|
||||
<button class="sign-out" @click="logout" :hair-line="false">
|
||||
{{ this.$t('homePage.mine.logOut') }}
|
||||
</button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
import config from "../../../common/config";
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
config,
|
||||
innerVer: config.productVersion,
|
||||
versionCode: null,
|
||||
};
|
||||
},
|
||||
computed:{
|
||||
language(){
|
||||
return this.vuex_language
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
language: {
|
||||
immediate: true,
|
||||
deep:true,
|
||||
handler(val) {
|
||||
uni.setNavigationBarTitle({
|
||||
title: this.$t('homePage.mine.sysSetting')
|
||||
});
|
||||
}
|
||||
},
|
||||
},
|
||||
onShow() {
|
||||
|
||||
},
|
||||
methods: {
|
||||
navTo(url) {
|
||||
if (url === "") {
|
||||
this.$refs.uToast.show({
|
||||
title: this.$t('homePage.mine.notAva'),
|
||||
type: "warning",
|
||||
});
|
||||
}
|
||||
|
||||
uni.navigateTo({
|
||||
url: url,
|
||||
});
|
||||
},
|
||||
openSettings() {
|
||||
// #ifdef APP-PLUS
|
||||
uni.getSystemInfo({
|
||||
success(res) {
|
||||
if (res.platform == "ios") {
|
||||
plus.runtime.openURL("app-settings://");
|
||||
} else if (res.platform == "android") {
|
||||
var main = plus.android.runtimeMainActivity();
|
||||
var Intent = plus.android.importClass("android.content.Intent");
|
||||
var mIntent = new Intent("android.settings.SOUND_SETTINGS");
|
||||
main.startActivity(mIntent);
|
||||
}
|
||||
},
|
||||
});
|
||||
// #endif
|
||||
// #ifndef APP-PLUS
|
||||
this.$u.toast(this.$t('homePage.mine.noUpdate'));
|
||||
// #endif
|
||||
},
|
||||
|
||||
logout() {
|
||||
this.$u.api.logout().then((res) => {
|
||||
if (res.code == 200) {
|
||||
setTimeout(() => {
|
||||
uni.reLaunch({
|
||||
url: "/pages/login/index",
|
||||
});
|
||||
}, 500);
|
||||
}
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style lang="scss">
|
||||
page {
|
||||
background-color: #f5f5f5;
|
||||
}
|
||||
|
||||
.sign-out {
|
||||
width: 750rpx;
|
||||
height: 100rpx;
|
||||
line-height: 100rpx;
|
||||
font-size: 30rpx;
|
||||
color: #ef2121;
|
||||
}
|
||||
|
||||
/deep/ .u-cell-title {
|
||||
padding: 25rpx 30rpx;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user