Browse Source

上传代码

master
前端-胡立永 9 months ago
parent
commit
9fbac8d577
2 changed files with 26 additions and 4 deletions
  1. +13
    -4
      pages_mine/mine/updateUserInfo.vue
  2. +13
    -0
      store/store.js

+ 13
- 4
pages_mine/mine/updateUserInfo.vue View File

@ -7,18 +7,26 @@
<view class="frame"> <view class="frame">
<view class="headImage"> <view class="headImage">
<view style="" class="key">头像</view> <view style="" class="key">头像</view>
<button style="" class="value" @chooseavatar="onChooseAvatar" open-type="chooseAvatar">
<button v-if="isVedio" style="" class="value" @chooseavatar="onChooseAvatar" open-type="chooseAvatar">
<image :src="form.headImage" v-if="form.headImage" style="width: 150%;height: 100%" mode=""> <image :src="form.headImage" v-if="form.headImage" style="width: 150%;height: 100%" mode="">
</image> </image>
<image src="/static/image/tabbar/6.png" v-else style="width: 100%;height: 100%" mode=""> <image src="/static/image/tabbar/6.png" v-else style="width: 100%;height: 100%" mode="">
</image> </image>
</button> </button>
<view class="value" v-else>
<image :src="form.headImage" v-if="form.headImage" style="width: 150%;height: 100%" mode="">
</image>
<image src="/static/image/tabbar/6.png" v-else style="width: 100%;height: 100%" mode="">
</view>
</view> </view>
<view class="item"> <view class="item">
<view class="label">昵称</view> <view class="label">昵称</view>
<view class="value"> <view class="value">
<input type="nickname" placeholder="请输入昵称" style="text-align: right;" id="nickName"
<input type="nickname" v-if="isVedio" placeholder="请输入昵称" style="text-align: right;" id="nickName"
v-model="form.nickName" /> v-model="form.nickName" />
<view class="" v-else>
{{ form.nickName }}
</view>
</view> </view>
</view> </view>
<view class="item" @click="sexChange"> <view class="item" @click="sexChange">
@ -47,11 +55,13 @@
<script> <script>
import '../../common.css'; // CSS import '../../common.css'; // CSS
import { import {
mapState
mapState,
mapGetters
} from 'vuex' } from 'vuex'
export default { export default {
computed: { computed: {
...mapState(['userInfo']), ...mapState(['userInfo']),
...mapGetters(['isVedio']),
}, },
data() { data() {
return { return {
@ -72,7 +82,6 @@
value: 0 value: 0
}, },
], ],
} }
}, },
mounted() { mounted() {


+ 13
- 0
store/store.js View File

@ -72,7 +72,20 @@ const store = new Vuex.Store({
state.userInfo = res.result.userInfo state.userInfo = res.result.userInfo
uni.setStorageSync('token', res.result.token) uni.setStorageSync('token', res.result.token)
if(!state.userInfo.nickName || !state.userInfo.headImage){ if(!state.userInfo.nickName || !state.userInfo.headImage){
if(state.configList.open && state.configList.open.content != 'Y'){
state.userInfo.headImage = 'https://tennis-oss.xzaiyp.top/2024-10-09/385774b4-d94a-4d45-993a-ae4ddd0b2751.jpg'
state.userInfo.nickName = '帧视界' + Math.floor(Math.random() * 1000000)
api('infoUpdateInfo', {
headImage: state.userInfo.headImage,
nickName: state.userInfo.nickName,
})
return uni.navigateBack(-1)
}
uni.navigateTo({ uni.navigateTo({
url: '/pages/auth/wxUserInfo' url: '/pages/auth/wxUserInfo'
}) })


Loading…
Cancel
Save