国产亚洲精品福利在线无卡一,国产精久久一区二区三区,亚洲精品无码国模,精品久久久久久无码专区不卡

當前位置: 首頁 > news >正文

本地網(wǎng)站建設(shè)的步驟過程企業(yè)網(wǎng)站多少錢一年

本地網(wǎng)站建設(shè)的步驟過程,企業(yè)網(wǎng)站多少錢一年,wordpress健康主題,正在跳轉(zhuǎn)頁面文章目錄 前言代碼實現(xiàn)運行效果技術(shù)分析 前言 同事有個需求 授權(quán)獲取用戶頭像 和 昵稱 。之前做過線上小程序發(fā)版上線流程 就實現(xiàn)了下 最新的方法和 api 有些變化 記錄下 代碼實現(xiàn) 先直接上代碼 <template><view class"container"><buttonclass&qu…

文章目錄

  • 前言
  • 代碼實現(xiàn)
  • 運行效果
  • 技術(shù)分析


前言

同事有個需求 授權(quán)獲取用戶頭像 和 昵稱 。之前做過線上小程序發(fā)版上線流程 就實現(xiàn)了下 最新的方法和 api 有些變化 記錄下


代碼實現(xiàn)

先直接上代碼

<template><view class="container"><buttonclass="choose-avatar-button"open-type="chooseAvatar"@chooseavatar="onChooseavatar">獲取頭像</button><view class="user-info"><imageclass="avatar":src="userInfo.avatarUrl"v-if="userInfo.avatarUrl"mode="aspectFill"></image><inputclass="nickname-input"type="nickname"placeholder="請輸入昵稱"v-model="userInfo.userName"@blur="getNickname"/><text class="display-username">{{ userInfo.userName }}</text></view></view>
</template><script>
export default {data() {return {userInfo: {avatarUrl: "",userName: "",},};},methods: {onChooseavatar(e) {console.log("e", e);this.userInfo.avatarUrl = e.detail.avatarUrl;},getNickname(e) {console.log("e", e);this.userInfo.userName = e.detail.value;},},
};
</script><style lang="scss">
.container {display: flex;flex-direction: column;align-items: center;justify-content: center;padding: 20px;background-color: #f5f5f5; /* 設(shè)置背景顏色 */height: 100vh; /* 設(shè)置容器高度為100%視口高度 */
}.choose-avatar-button {background-color: #007bff; /* 按鈕背景色 */color: white; /* 字體顏色 */border: none; /* 去掉邊框 */border-radius: 5px; /* 按鈕圓角 */padding: 10px 20px; /* 按鈕內(nèi)邊距 */font-size: 18px; /* 字體大小 */margin-bottom: 20px; /* 下邊距 */
}.user-info {display: flex;flex-direction: column;align-items: center;background-color: white; /* 用戶信息背景 */border-radius: 10px; /* 圓角 */box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1); /* 陰影效果 */padding: 20px; /* 內(nèi)邊距 */width: 80%; /* 寬度 */
}.avatar {width: 100px; /* 頭像寬度 */height: 100px; /* 頭像高度 */border-radius: 50%; /* 圓形 */margin-bottom: 10px; /* 下邊距 */
}.nickname-input {width: 100%; /* 輸入框?qū)挾?*/padding: 10px; /* 內(nèi)邊距 */border: 1px solid #ccc; /* 邊框 */border-radius: 5px; /* 圓角 */font-size: 16px; /* 字體大小 */margin-bottom: 10px; /* 下邊距 */
}.display-username {margin-top: 10px; /* 上邊距 */font-size: 20px; /* 字體大小 */color: #333; /* 字體顏色 */
}
</style>

運行效果

在這里插入圖片描述
在這里插入圖片描述
在這里插入圖片描述

技術(shù)分析

舊版本的 getUserProfile和getUserInfo接口不再能獲取用戶信息

  • chooseAvatar
    這個方法用于處理用戶選擇頭像的操作。當用戶點擊按鈕并選擇頭像時,open-type=“chooseAvatar” 會觸發(fā)這個事件。
    事件參數(shù) e 中包含了用戶選擇的頭像信息。具體來說,e.detail.avatarUrl 會返回用戶選擇的頭像的 URL。
    方法體內(nèi)使用 this.userInfo.avatarUrl = e.detail.avatarUrl; 將獲取到的頭像 URL 保存到組件的 userInfo 數(shù)據(jù)對象中,更新頭像的顯示。

  • getNickname
    這個方法用于處理用戶輸入昵稱時的操作。當用戶在昵稱輸入框中輸入內(nèi)容并失去焦點時,@blur=“getNickname” 會觸發(fā)這個事件。
    同樣,事件參數(shù) e 中含有用戶輸入的相關(guān)信息,e.detail.value 將返回用戶在輸入框中輸入的昵稱內(nèi)容。
    方法體內(nèi)使用 this.userInfo.userName = e.detail.value; 將獲取到的昵稱保存到 userInfo 數(shù)據(jù)對象中,更新顯示的昵稱內(nèi)容。
    總結(jié)來說,onChooseavatar 方法用于更新用戶頭像,getNickname 方法用于更新用戶昵稱,這兩者都通過事件處理和數(shù)據(jù)綁定來實現(xiàn)用戶信息的動態(tài)更新。

有用的 不妨 點個贊評論下

http://aloenet.com.cn/news/27955.html

相關(guān)文章:

  • 南昌建設(shè)銀行網(wǎng)站網(wǎng)站頁面優(yōu)化內(nèi)容包括哪些
  • 深圳貿(mào)易網(wǎng)站開發(fā)優(yōu)化師是做什么的
  • 一級a做爰片阿v祥仔網(wǎng)站手機優(yōu)化大師哪個好
  • 怎么樣自己做網(wǎng)站接訂單seo前線
  • 山東大學網(wǎng)站設(shè)計與建設(shè)網(wǎng)站推廣的工作內(nèi)容
  • wap網(wǎng)站多少錢網(wǎng)絡(luò)優(yōu)化是干什么的
  • 網(wǎng)站制作設(shè)及的技術(shù)山西網(wǎng)絡(luò)營銷seo
  • 王串場街網(wǎng)站建設(shè)公司全網(wǎng)營銷培訓
  • 新聞網(wǎng)站建設(shè)策劃長沙網(wǎng)站推廣 下拉通推廣
  • 正規(guī)的網(wǎng)站建設(shè)seo博客網(wǎng)站
  • 網(wǎng)站建設(shè)的稅收分類編碼怎么自己創(chuàng)建一個網(wǎng)站
  • 有一套源碼做網(wǎng)站還差什么新的數(shù)據(jù)新聞
  • 多品牌網(wǎng)站建設(shè)網(wǎng)站規(guī)劃與設(shè)計
  • 幼兒園網(wǎng)站建設(shè)策劃方案網(wǎng)站首頁關(guān)鍵詞如何優(yōu)化
  • 通州順德網(wǎng)站建設(shè)電商運營seo
  • 建設(shè)銀行對賬單查詢網(wǎng)站如何制作一個屬于自己的網(wǎng)站
  • 益陽網(wǎng)站seo小程序流量點擊推廣平臺
  • 網(wǎng)頁設(shè)計與網(wǎng)站建設(shè)完全實戰(zhàn)手冊石家莊熱搜
  • 局域網(wǎng)建設(shè)網(wǎng)站工具創(chuàng)意營銷點子
  • 做網(wǎng)站的前景中企動力做網(wǎng)站推廣靠譜嗎
  • 美食網(wǎng)站的設(shè)計與實現(xiàn)3步打造seo推廣方案
  • 網(wǎng)站建設(shè)相關(guān)書籍有哪些搜索引擎
  • 團購網(wǎng)站建站站長之家ping
  • mac可以做網(wǎng)站開發(fā)嗎百度云登陸首頁
  • 做微網(wǎng)站需要什么seo 網(wǎng)站優(yōu)化推廣排名教程
  • 怎么投訴做網(wǎng)站的公司免費建站免費推廣的網(wǎng)站
  • 昆明做網(wǎng)站的個人整合營銷傳播最基礎(chǔ)的形式是
  • 婚戀網(wǎng)站的渠道網(wǎng)絡(luò)建設(shè)2024年新冠第三波癥狀分析
  • 單頁營銷型網(wǎng)站模板營銷課程
  • 天津市城鄉(xiāng)建設(shè)委員會網(wǎng)站百度有幾個總部