<!-- 账号信息 --> <template> <view class="account-info"> <image src="http://111.198.10.15:11604/png/back_complete.png" style="position:absolute;top: -4rpx;left: 0;z-index: -999; width:100%;height: 300rpx;"></image> <view class="main" v-if="!isShowInfo"> <view class="title">个人信息</view> <view class="info" v-for="item in list" :key="item.id"> <view class="title-icon"> <image :src="item.icon" style="width: 48rpx;height: 48rpx;margin-right: 12rpx;" mode=""></image> <text class="name">{{item.name}}</text> </view> <view style="margin-left: 40rpx;">{{item.value}}</view> </view> </view> <view class="button" @click="changePage('accountBound')">{{isShowInfo ? '绑定' : '重新绑定'}}</view> <view class="button-bottom"> <view class="button button-left" @click="changePage('register')">用户注册</view> <view class="button button-right" @click="changePage('changePassword')">修改密码</view> </view> </view> </template> <script> export default { data() { return { list: [ { id: 'username', name: '用户名:', value: '', icon: '../../static/index/back.png' }, { id: 'name', name: '姓名:', value: '', icon: '../../static/mine/name.png' }, { id: 'sex', name: '性别:', value: '', icon: '../../static/mine/sex.png' }, { id: 'phone', name: '手机号:', value: '', icon: '../../static/mine/phone.png' }, { id: 'email', name: '电子邮箱:', value: '', icon: '../../static/mine/email.png' }, { id: 'region', name: '地区:', value: '', icon: '../../static/mine/region.png' }, { id: 'address', name: '详细地址:', value: '', icon: '../../static/mine/address.png' }, ], isShowInfo: true, } }, mounted() { this.getData(); }, methods: { getData() { this.$set(this.list, 0, { id: 'username', name: '用户名:', value: '123123', icon: '../../static/mine/username.png' }); this.$set(this.list, 1, { id: 'name', name: '姓名:', value: 'ddd', icon: '../../static/mine/name.png' },); this.$set(this.list, 2, { id: 'sex', name: '性别:', value: '女', icon: '../../static/mine/sex.png' },); this.$set(this.list, 3, { id: 'phone', name: '手机号:', value: '12345678978', icon: '../../static/mine/phone.png' },); this.$set(this.list, 4, { id: 'email', name: '电子邮箱:', value: '123123246@qq.com', icon: '../../static/mine/email.png' },); this.$set(this.list, 5, { id: 'region', name: '地区:', value: '北京市海淀区', icon: '../../static/mine/region.png' }); this.$set(this.list, 6, { id: 'address', name: '详细地址:', value: '某街道某小区1号楼6单元102区1号楼6单元1区1号楼6单元1区1号楼6单元1区1号楼6单元1', icon: '../../static/mine/address.png' },); this.isShowInfo = this.list.every(item => { return item.value === ''; }); console.log(this.isShowInfo) }, changePage(val) { let url = `/packageA/${val}/${val}` wx.navigateTo({ url: url }) } } } </script> <style lang="scss" scoped> .account-info { padding: 40rpx 20rpx; padding-top: 186rpx; width: 100%; height: 100%; box-sizing: border-box; .main { padding: 20rpx; box-sizing: border-box; background-color: #fff; border-radius: 16rpx; .title { width: 100%; text-align: center; font-size: 36rpx; font-weight: 600; margin-bottom: 50rpx; } .info { display: flex; justify-content: space-between; align-items: center; margin: 32rpx 0; .title-icon { display: flex; align-items: center; font-size: 30rpx; font-weight: 600; white-space: nowrap; } } } .button { width: 100%; display: flex; justify-content: center; align-items: center; padding: 20rpx; color: #fff; font-weight: 600; letter-spacing: 4rpx; background-color: #408bf6; border: 2rpx solid #408bf6; border-radius: 10rpx; margin: 64rpx 0 32rpx 0; white-space: nowrap; box-sizing: border-box; // &:active { // background-color: #fff; // color: #408bf6; // } } .button-bottom { display: flex; flex-direction: row; justify-content: space-between; align-items: center; .button-left { width: fit-content; padding: 20rpx 40rpx; margin-top: 0; color: #0043ac; background-color: #fff; border: 2rpx solid #0043ac; } .button-right { width: fit-content; padding: 20rpx 40rpx; margin-top: 0; color: #0043ac; background-color: #fff; border: 2rpx solid #0043ac; } } } </style> <style lang="scss"> .account-info { .u-button--primary { font-weight: 600; letter-spacing: 4rpx; background-color: #408bf6 !important; border-color: #408bf6 !important; margin: 64rpx 0 32rpx 0; } .u-button--normal { padding: 0 32rpx !important; } .u-button { width: fit-content !important; } } </style> <style> page { background-color: #f0f0f0; } </style>