修改设备详情
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_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">
|
<view class="profile_item">
|
||||||
<text class="item_label">头像</text>
|
<text class="item_label">头像</text>
|
||||||
<view class="avatar_wrapper" @click="changeAvatar">
|
<view class="avatar_wrapper" @click="changeAvatar">
|
||||||
<image class="avatar"
|
<image class="avatar" :src="userInfo.avatar || user" mode="aspectFill"></image>
|
||||||
:src="userInfo.avatar || user"
|
|
||||||
mode="aspectFill"></image>
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
@ -30,23 +28,26 @@
|
|||||||
</view>
|
</view>
|
||||||
<!-- Save Button -->
|
<!-- Save Button -->
|
||||||
<button class="save_btn" @click="saveProfile">保存修改</button>
|
<button class="save_btn" @click="saveProfile">保存修改</button>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { BASE_API_URL,BASE_IMG_URL } from "@/config.js";
|
import {
|
||||||
|
BASE_API_URL,
|
||||||
|
BASE_IMG_URL
|
||||||
|
} from "@/config.js";
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
back:BASE_IMG_URL + "/minePage/back.png", //返回图标
|
back: BASE_IMG_URL + "/minePage/back.png", //返回图标
|
||||||
user:BASE_IMG_URL + "/minePage/user.png", //用户默认图标
|
user: BASE_IMG_URL + "/minePage/user.png", //用户默认图标
|
||||||
statusBarHeight: 0,
|
statusBarHeight: 0,
|
||||||
userInfo: {
|
userInfo: {
|
||||||
nikename: "",
|
nikename: "",
|
||||||
avatar:"",
|
avatar: "",
|
||||||
phone:""
|
phone: ""
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
@ -66,7 +67,7 @@
|
|||||||
const userInfo = uni.getStorageSync("userInfo");
|
const userInfo = uni.getStorageSync("userInfo");
|
||||||
if (userInfo) {
|
if (userInfo) {
|
||||||
this.userInfo.nikename = userInfo.nikeName;
|
this.userInfo.nikename = userInfo.nikeName;
|
||||||
this.userInfo.avatar = BASE_IMG_URL + userInfo.avatar;
|
this.userInfo.avatar = BASE_IMG_URL + userInfo.avatar;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
changeAvatar() {
|
changeAvatar() {
|
||||||
@ -86,11 +87,12 @@
|
|||||||
},
|
},
|
||||||
success: (uploadRes) => {
|
success: (uploadRes) => {
|
||||||
console.log(uploadRes)
|
console.log(uploadRes)
|
||||||
this.userInfo.avatar=
|
this.userInfo.avatar =
|
||||||
"https://online.totustec.com/upload/file/image/" + uploadRes.data;
|
"https://online.totustec.com/upload/file/image/" + uploadRes
|
||||||
|
.data;
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: "头像上传成功"
|
title: "头像上传成功"
|
||||||
});
|
});
|
||||||
console.log(this.userInfo.avatar)
|
console.log(this.userInfo.avatar)
|
||||||
},
|
},
|
||||||
fail: () => {
|
fail: () => {
|
||||||
@ -182,6 +184,7 @@
|
|||||||
position: relative;
|
position: relative;
|
||||||
z-index: 5;
|
z-index: 5;
|
||||||
}
|
}
|
||||||
|
|
||||||
.back_icon {
|
.back_icon {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
left: 20rpx;
|
left: 20rpx;
|
||||||
|
Loading…
Reference in New Issue
Block a user