parent
79b6dd46cd
commit
2291551734
@ -0,0 +1,224 @@ |
||||
<template> |
||||
<view class="ss-modal-body" :class="{'ss-modal-active' : animation, 'ss-modal-H5Top': _H5Top, 'ss-modal-H5Bottom': _H5Bottom}" :data-platform="platform"> |
||||
<view class="ss-modal" :class="'ss-modal-' + position +' ' + 'ss-modal-' + mode"> |
||||
<slot></slot> |
||||
</view> |
||||
<view v-if="_mask" class="uni-mask" @touchmove.stop.prevent="moveHandle" catchtouchmove="true" @click.stop="hide()"></view> |
||||
</view> |
||||
</template> |
||||
|
||||
<script> |
||||
const systemInfo = uni.getSystemInfoSync(); |
||||
export default { |
||||
data () { |
||||
return { |
||||
animation: false, |
||||
platform: systemInfo.platform |
||||
} |
||||
}, |
||||
props: { |
||||
/* |
||||
* 参数说明(定位) |
||||
*/ |
||||
position: {//可能值 top left right bottom middle |
||||
type: String, |
||||
default: 'middle' |
||||
}, |
||||
/* |
||||
* 参数说明 |
||||
* full 宽度100% |
||||
* insert 80%宽度内联小框 |
||||
* cover 宽度高度100% |
||||
*/ |
||||
mode: { |
||||
type: String, |
||||
default: 'full' |
||||
}, |
||||
mask: { |
||||
type: [Boolean, String], |
||||
default: true |
||||
}, |
||||
/* |
||||
* H5置顶 |
||||
*/ |
||||
H5Top: { |
||||
type: [Boolean, String], |
||||
default: true |
||||
}, |
||||
/* |
||||
* H5置底 |
||||
*/ |
||||
H5Bottom: { |
||||
type: [Boolean, String], |
||||
default: true |
||||
}, |
||||
}, |
||||
computed: { |
||||
_mask() { |
||||
return String(this.mask) === 'false' ? false : true; |
||||
}, |
||||
_H5Top() { |
||||
return String(this.H5Top) === 'false' ? false : true; |
||||
}, |
||||
_H5Bottom() { |
||||
return String(this.H5Bottom) === 'false' ? false : true; |
||||
} |
||||
}, |
||||
watch: { |
||||
animation(val) { |
||||
this.$emit('change', val); |
||||
} |
||||
}, |
||||
methods: { |
||||
moveHandle() { |
||||
return ; |
||||
}, |
||||
show () { |
||||
this.animation = true; |
||||
return true; |
||||
}, |
||||
hide () { |
||||
this.animation = false; |
||||
return false; |
||||
}, |
||||
toggle () { |
||||
return !this.animation ? this.show() : this.hide() |
||||
} |
||||
} |
||||
} |
||||
</script> |
||||
|
||||
<style lang="scss"> |
||||
// 弹窗公用样式 |
||||
.ss-modal-body{ |
||||
box-sizing: border-box; |
||||
opacity: 0; |
||||
position: fixed; |
||||
top: 44px; |
||||
bottom: 50px; |
||||
left: 0; |
||||
width: 100%; |
||||
pointer-events: none; |
||||
transform: translateX(0); |
||||
transition: all .2s linear; |
||||
z-index: 98; |
||||
&.ss-modal-active{ |
||||
pointer-events: auto; |
||||
opacity: 1; |
||||
} |
||||
} |
||||
|
||||
/* #ifdef H5 */ |
||||
.ss-modal-body.ss-modal-H5Top{ |
||||
top: 0; |
||||
z-index: 999; |
||||
} |
||||
.ss-modal-body.ss-modal-H5Bottom{ |
||||
bottom: 0; |
||||
z-index: 999; |
||||
} |
||||
/* #endif */ |
||||
|
||||
.ss-modal-body .uni-mask{ |
||||
z-index: 1; |
||||
position: fixed; |
||||
top: 0; |
||||
right: 0; |
||||
left: 0; |
||||
bottom: 0; |
||||
background: rgba(0,0,0,.6); |
||||
} |
||||
.ss-modal{ |
||||
position: fixed; |
||||
z-index: 2; |
||||
transition: inherit; |
||||
/deep/ .gmy-float-touch{ |
||||
display: none; |
||||
} |
||||
} |
||||
.ss-modal-middle{ |
||||
top: 50%; |
||||
left: 50%; |
||||
transform: translate(-50%, -50%); |
||||
} |
||||
.ss-modal-cover{ |
||||
width: 100%; |
||||
// width: 100vw; |
||||
width: calc(100% + 3px); |
||||
// width: calc(100vw + 2px);//清除translate带来了计算误差 |
||||
height: 100%; |
||||
// height: 100vw; |
||||
height: calc(100% + 3px); |
||||
// height: calc(100vh + 2px);//清除translate带来了计算误差 |
||||
left: 0; |
||||
top: 0; |
||||
transform: translate(100%, 0); |
||||
} |
||||
.ss-modal-top{ |
||||
left: 50%; |
||||
z-index: 98; |
||||
width: 100%; |
||||
height: auto; |
||||
transform: translate(-50%, -100%); |
||||
& + .uni-mask{ |
||||
z-index: 97; |
||||
} |
||||
} |
||||
.ss-modal-full{ |
||||
width: 100%; |
||||
width: calc(100% + 3px);//清除translate带来了计算误差 |
||||
left: 0; |
||||
transform: translate(0, -100%); |
||||
} |
||||
.ss-modal-full.ss-modal-top{ |
||||
transform: translate(0, -200%); |
||||
} |
||||
.ss-modal-full.ss-modal-bottom{ |
||||
transform: translate(0, 100%); |
||||
transition: inherit; |
||||
} |
||||
.ss-modal-right{ |
||||
right: 0; |
||||
max-width: 80%; |
||||
} |
||||
.ss-modal-left{ |
||||
left: 0; |
||||
max-width: 80%; |
||||
} |
||||
.ss-modal-middle.ss-modal-insert { |
||||
min-width: 380rpx; |
||||
min-height: 380rpx; |
||||
max-width: 102%; |
||||
max-height: 80%; |
||||
transform: translate(-50%, -50%); |
||||
background: none; |
||||
box-shadow: none; |
||||
} |
||||
.ss-modal-body{ |
||||
opacity: 0; |
||||
pointer-events: none; |
||||
} |
||||
.ss-modal-active{ |
||||
opacity: 1; |
||||
pointer-events: auto; |
||||
.ss-modal-top{ |
||||
top: 44px; |
||||
transform: translate(-50%, 0); |
||||
} |
||||
.ss-modal-full{ |
||||
transform: translate(0, -50%); |
||||
} |
||||
.ss-modal-full.ss-modal-top{ |
||||
transform: translate(0, 0); |
||||
} |
||||
.ss-modal-bottom{ |
||||
transform: translate(0, 0); |
||||
} |
||||
.ss-modal-cover{ |
||||
transform: translate(0, 0); |
||||
} |
||||
} |
||||
.ss-modal-bottom{ |
||||
bottom: 0; |
||||
} |
||||
</style> |
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -0,0 +1,103 @@ |
||||
<template> |
||||
<view> |
||||
<view class="logo"> |
||||
<view class="img"> |
||||
<image mode="widthFix" src="../../../static/img/logo2.jpg"> |
||||
</image> |
||||
</view> |
||||
</view> |
||||
<!-- 账号密码输入框 --> |
||||
<view class="form"> |
||||
<view class="password"> |
||||
<image src="../../../static/img/pas.png" style="width: 40rpx;height: 40rpx;"></image><input |
||||
placeholder="请输入旧密码" type="number" maxlength="6" v-model="jpasswd" password=true placeholder-style="color: #333333;" /> |
||||
</view> |
||||
<view class="password"> |
||||
<image src="../../../static/img/pas.png" style="width: 40rpx;height: 40rpx;"></image><input |
||||
placeholder="请输入新密码" type="number" maxlength="6" v-model="xpasswd" password=true placeholder-style="color: #333333;" /> |
||||
</view> |
||||
<view class="btn mart50" @tap="updateUserPayPwd">确 认</view> |
||||
</view> |
||||
</view> |
||||
</template> |
||||
|
||||
<script> |
||||
import { |
||||
updateUserPayPwd |
||||
} from "../../../Utils/Api.js"; |
||||
let app =getApp(); |
||||
export default { |
||||
data() { |
||||
return { |
||||
jpasswd: '', |
||||
xpasswd: '', |
||||
} |
||||
}, |
||||
methods: { |
||||
updateUserPayPwd() { |
||||
uni.hideKeyboard(); |
||||
if (this.jpasswd == '') { |
||||
uni.showToast({ |
||||
title: '请填写旧密码', |
||||
icon: "none" |
||||
}); |
||||
return false; |
||||
} |
||||
if (this.xpasswd == '') { |
||||
uni.showToast({ |
||||
title: '请填写新密码', |
||||
icon: "none" |
||||
}); |
||||
return false; |
||||
} |
||||
uni.showLoading({ |
||||
title: '设置中...' |
||||
}) |
||||
let datas = { |
||||
"password": this.jpasswd, |
||||
"newPassword":this.xpasswd |
||||
} |
||||
updateUserPayPwd(datas).then(res => { |
||||
if (res.return_code == '000000') { |
||||
uni.hideLoading(); |
||||
uni.showToast({ |
||||
title: '修改成功', |
||||
icon: "none", |
||||
duration:2000 |
||||
}); |
||||
app.globalData.userInfo = res.return_data |
||||
.object |
||||
.highUser; |
||||
uni.setStorage({ |
||||
key: "user", |
||||
data: res.return_data |
||||
.object |
||||
.highUser |
||||
}) |
||||
uni.navigateBack({ |
||||
}) |
||||
} else { |
||||
uni.hideLoading(); |
||||
uni.showToast({ |
||||
title: res.return_msg, |
||||
icon: "none" |
||||
}) |
||||
} |
||||
}) |
||||
} |
||||
} |
||||
} |
||||
</script> |
||||
|
||||
<style lang="scss"> |
||||
@import "../../../static/css/login.scss"; |
||||
.form { |
||||
.res { |
||||
display: flex; |
||||
justify-content: space-between; |
||||
align-items: center; |
||||
height: 100upx; |
||||
color: rgba($color: #ffffff, $alpha: 0.8); |
||||
} |
||||
} |
||||
</style> |
@ -0,0 +1,90 @@ |
||||
<template> |
||||
<view> |
||||
<view class="logo"> |
||||
<view class="img"> |
||||
<image mode="widthFix" src="../../../static/img/logo2.jpg"> |
||||
</image> |
||||
</view> |
||||
</view> |
||||
<!-- 账号密码输入框 --> |
||||
<view class="form"> |
||||
<view class="password"> |
||||
<image src="../../../static/img/pas.png" style="width: 40rpx;height: 40rpx;"></image><input |
||||
placeholder="请输入密码" type="number" maxlength="6" v-model="passwd" password=true placeholder-style="color: #333333;" /> |
||||
</view> |
||||
<view class="btn mart50" @tap="setUserPayPwd">确 认</view> |
||||
</view> |
||||
</view> |
||||
</template> |
||||
|
||||
<script> |
||||
import { |
||||
setUserPayPwd |
||||
} from "../../../Utils/Api.js"; |
||||
let app =getApp(); |
||||
export default { |
||||
data() { |
||||
return { |
||||
passwd: '', |
||||
} |
||||
}, |
||||
methods: { |
||||
setUserPayPwd() { |
||||
uni.hideKeyboard(); |
||||
if (this.passwd == '') { |
||||
uni.showToast({ |
||||
title: '请填写密码', |
||||
icon: "none" |
||||
}); |
||||
return false; |
||||
} |
||||
uni.showLoading({ |
||||
title: '设置中...' |
||||
}) |
||||
let datas = { |
||||
"password": this.passwd |
||||
} |
||||
setUserPayPwd(datas).then(res => { |
||||
if (res.return_code == '000000') { |
||||
uni.hideLoading(); |
||||
uni.showToast({ |
||||
title: '设置成功', |
||||
icon: "none", |
||||
duration:2000 |
||||
}); |
||||
app.globalData.userInfo = res.return_data |
||||
.object |
||||
.highUser; |
||||
uni.setStorage({ |
||||
key: "user", |
||||
data: res.return_data |
||||
.object |
||||
.highUser |
||||
}) |
||||
uni.navigateBack({ |
||||
}) |
||||
} else { |
||||
uni.hideLoading(); |
||||
uni.showToast({ |
||||
title: res.return_msg, |
||||
icon: "none" |
||||
}) |
||||
} |
||||
}) |
||||
} |
||||
} |
||||
} |
||||
</script> |
||||
|
||||
<style lang="scss"> |
||||
@import "../../../static/css/login.scss"; |
||||
.form { |
||||
.res { |
||||
display: flex; |
||||
justify-content: space-between; |
||||
align-items: center; |
||||
height: 100upx; |
||||
color: rgba($color: #ffffff, $alpha: 0.8); |
||||
} |
||||
} |
||||
</style> |
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
After Width: | Height: | Size: 824 B |
After Width: | Height: | Size: 1.1 KiB |
Loading…
Reference in new issue