修改设备详情
This commit is contained in:
parent
73536a9cc1
commit
164138577c
@ -3,4 +3,6 @@
|
||||
export const BASE_API_URL = "https://online.totustec.com/api";
|
||||
|
||||
// 静态数据
|
||||
export const BASE_IMG_URL = "https://online.totustec.com/upload";
|
||||
export const BASE_IMG_URL = "https://online.totustec.com/upload";
|
||||
|
||||
export const BASE_STOKECT_URL = "ws://online.totustec.com/webSocket/vue"
|
File diff suppressed because it is too large
Load Diff
@ -17,9 +17,7 @@
|
||||
<view class="profile_item">
|
||||
<text class="item_label">头像</text>
|
||||
<view class="avatar_wrapper" @click="changeAvatar">
|
||||
<image class="avatar"
|
||||
:src="userInfo.avatar || user"
|
||||
mode="aspectFill"></image>
|
||||
<image class="avatar" :src="userInfo.avatar || user" mode="aspectFill"></image>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@ -30,23 +28,26 @@
|
||||
</view>
|
||||
<!-- Save Button -->
|
||||
<button class="save_btn" @click="saveProfile">保存修改</button>
|
||||
|
||||
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { BASE_API_URL,BASE_IMG_URL } from "@/config.js";
|
||||
import {
|
||||
BASE_API_URL,
|
||||
BASE_IMG_URL
|
||||
} from "@/config.js";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
back:BASE_IMG_URL + "/minePage/back.png", //返回图标
|
||||
user:BASE_IMG_URL + "/minePage/user.png", //用户默认图标
|
||||
back: BASE_IMG_URL + "/minePage/back.png", //返回图标
|
||||
user: BASE_IMG_URL + "/minePage/user.png", //用户默认图标
|
||||
statusBarHeight: 0,
|
||||
userInfo: {
|
||||
nikename: "",
|
||||
avatar:"",
|
||||
phone:""
|
||||
avatar: "",
|
||||
phone: ""
|
||||
}
|
||||
};
|
||||
},
|
||||
@ -66,7 +67,7 @@
|
||||
const userInfo = uni.getStorageSync("userInfo");
|
||||
if (userInfo) {
|
||||
this.userInfo.nikename = userInfo.nikeName;
|
||||
this.userInfo.avatar = BASE_IMG_URL + userInfo.avatar;
|
||||
this.userInfo.avatar = BASE_IMG_URL + userInfo.avatar;
|
||||
}
|
||||
},
|
||||
changeAvatar() {
|
||||
@ -86,11 +87,12 @@
|
||||
},
|
||||
success: (uploadRes) => {
|
||||
console.log(uploadRes)
|
||||
this.userInfo.avatar=
|
||||
"https://online.totustec.com/upload/file/image/" + uploadRes.data;
|
||||
this.userInfo.avatar =
|
||||
"https://online.totustec.com/upload/file/image/" + uploadRes
|
||||
.data;
|
||||
uni.showToast({
|
||||
title: "头像上传成功"
|
||||
});
|
||||
});
|
||||
console.log(this.userInfo.avatar)
|
||||
},
|
||||
fail: () => {
|
||||
@ -182,6 +184,7 @@
|
||||
position: relative;
|
||||
z-index: 5;
|
||||
}
|
||||
|
||||
.back_icon {
|
||||
position: absolute;
|
||||
left: 20rpx;
|
||||
|
Loading…
Reference in New Issue
Block a user