123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141 |
- <template>
- <view class="content">
- <view class="cell-group">
- <view class="hflex acenter jbetween cell">
- <view class="left">手机号码</view>
- <view class="hflex acenter">
- <view class="right">{{user.phone}}</view>
- <!-- <u-icon name="arrow-right" color="#000" size="10"></u-icon> -->
- </view>
- </view>
- <view class="hflex acenter jbetween cell" @click="bindEmail">
- <view class="left">邮箱</view>
- <view class="hflex acenter">
- <view class="right">{{user.email?user.email:''}}</view>
- <u-icon name="arrow-right" color="#000" size="10"></u-icon>
- </view>
- </view>
- </view>
- <view class="cell-group">
- <view class="hflex acenter jbetween cell" @click="editPwd">
- <view class="left">密码</view>
- <view class="hflex acenter">
- <view class="right">修改密码</view>
- <u-icon name="arrow-right" color="#000" size="10"></u-icon>
- </view>
- </view>
- <view class="hflex acenter jbetween cell" @click="cancellation">
- <view class="left">账号注销</view>
- <view class="hflex acenter">
- <u-icon name="arrow-right" color="#000" size="10"></u-icon>
- </view>
- </view>
- </view>
- <u-modal :show="show" title="账号注销" content='您确定要注销此账号吗?' :showCancelButton="true" @cancel="close" @confirm="sure"></u-modal>
- </view>
- </template>
- <script>
- import $api from '@/static/js/api.js'
- var that = ''
- export default {
- data() {
- return {
- user: {},
- show: false,
- }
- },
- onLoad() {
- that = this
- },
- onShow() {
- that.getUser()
- },
- methods: {
- // 获取账户信息
- getUser() {
- $api.req({
- url: '/data/api.auth.Center/get',
- method: 'POST'
- }, function(res) {
- if(res.code == 1) {
- that.user = res.data
- }
- })
- },
- // 绑定邮箱
- bindEmail() {
- $api.jump('/page_shop/pages/setting/bindeMail?type=email')
- },
- // 修改密码
- editPwd() {
- $api.jump('/page_shop/pages/setting/editpwd')
- },
- cancellation() {
- $api.jump('/page_shop/pages/setting/log_off')
- },
- close() {
- that.show = false
- },
- sure() {
- $api.req({
- url: '/data/api.auth.Center/cancellation',
- method: 'POST'
- }, function(res) {
- if(res.code == 1) {
- uni.removeStorageSync("token")
- uni.removeStorageSync("address_id")
- uni.removeStorageSync("HXtoken")
- uni.removeStorageSync("id")
- uni.WebIM.conn.close();
- $api.jump('/pages/tabbar/mine/mine', 3)
-
- }
- })
- }
- },
- }
- </script>
- <style lang="scss" scoped>
- .content {
- background-color: #f5f5f5;
- .cell-group {
- width: 100%;
- background-color: #fff;
- margin-top: 20rpx;
- padding: 0 30rpx;
- box-sizing: border-box;
- .cell {
- box-sizing: border-box;
- padding: 36rpx 0;
- border-bottom: 1rpx solid #f5f5f5;
- .left {
- font-size: 30rpx;
- color: #222;
- }
- .right {
- padding: 0 5rpx;
- font-size: 30rpx;
- color: #444;
- }
- .red {
- width: 12rpx;
- height: 12rpx;
- border-radius: 50%;
- background-color: #fb3e32;
- }
- .avatar {
- width: 88rpx;
- height: 88rpx;
- border-radius: 50%;
- }
- }
- .button {
- font-size: 36rpx;
- color: #506dff;
- padding: 20rpx 0;
- }
- }
- }
- </style>
|