国产 无码 综合区,色欲AV无码国产永久播放,无码天堂亚洲国产AV,国产日韩欧美女同一区二区

uniapp微信小程序最新獲取昵稱和頭像

這篇具有很好參考價(jià)值的文章主要介紹了uniapp微信小程序最新獲取昵稱和頭像。希望對(duì)大家有所幫助。如果存在錯(cuò)誤或未考慮完全的地方,請(qǐng)大家不吝賜教,您也可以點(diǎn)擊"舉報(bào)違法"按鈕提交疑問(wèn)。

1.微信獲取頭像和昵稱最新需要用戶上傳頭像和手動(dòng)輸入昵稱,否則昵稱默認(rèn)是微信用戶,頭像是灰色頭像 ps(會(huì)提示使用微信頭像和微信昵稱)
uniapp微信小程序最新獲取昵稱和頭像文章來(lái)源地址http://www.zghlxwxcb.cn/news/detail-511840.html

<template>
	<view>
		<view class="cx_content_bill">
			<view class="cx_pile_status">
				<image :src="currentPile.filePath" class="lottery-cover-img"></image>
			</view>
			<view class="cx_pileType">{{currentPile.pileName}}</view>
			<view class="cx_pile_pay">
				家庭充電樁交付突破1,000,000臺(tái)
			</view>
			<view class="cx_pile_titleA">百萬(wàn)成就百萬(wàn)交付</view>
			<view class="cx_nick_img">
				<image :src="avatar" style="width: 100%;height: 100%;"></image>
			</view>
			<view class="cx_pile_titleB">
				<view>我是{{nickname}}</view>
				<view>我正在使用{{currentPile.pileName}}</view>
				<view>如果您的充電樁銘牌上也有 </view>
				<view>您就是正在尋找的百萬(wàn)</view>
			</view>
			<view class="cx_pile_logo"></view>
			<view class="cx_pile_share" @click="showTips">
				<view>馬上分享</view>
				<view class="cx_pile_shareIma"></view>
			</view>
			<!-- 活動(dòng)隱私協(xié)議 -->
			<tui-bottom-popup :zIndex="1002" :maskZIndex="1001" :show="popupShow" @close="popup" disabled shadow>
				<view class="cx_popup">
					<view class="cx_popup_title">
						活動(dòng)隱私協(xié)議
					</view>
					<view class="cx_popup_content">
						1.本人同意為了生成我的個(gè)人充電海報(bào)而查詢,調(diào)用我的微信頭像、昵稱、位置等信息,生成我的專(zhuān)屬活動(dòng)頁(yè)面并向我進(jìn)行信息展示。</view>
					<view class="cx_popup_content">
						2.專(zhuān)屬活動(dòng)頁(yè)面為自動(dòng)生成結(jié)果,可能與實(shí)際情況存在一定誤差。該活動(dòng)頁(yè)面生成后,您的個(gè)人信息將在系統(tǒng)中保留30天后刪除。
					</view>
					<view class="cx_popup_content">
						3.專(zhuān)屬活動(dòng)頁(yè)面包含我的個(gè)人信息。如我轉(zhuǎn)發(fā)、共享該活動(dòng)頁(yè)面,即視為我同意并向接收者提供我的個(gè)人信息。對(duì)該等轉(zhuǎn)發(fā)、共享活動(dòng)而導(dǎo)致的個(gè)人信息泄露承擔(dān)任何直接或間接的責(zé)任。
					</view>
					<view class="cx_popup_content">
						4.在本協(xié)議中未聲明的其他一切權(quán)利,仍歸本公司所有。本公司保留對(duì)本協(xié)議的最終解釋權(quán)利。如果您還有其他問(wèn)題和建議,可以通過(guò)
					</view>
					<view class="cx_popup_content" style="display: flex;justify-content: flex-start;width: 100%;">
						<text style="color: #237FFF;" @click="callPhone">400580</text>聯(lián)系我們
					</view>
					<!-- <view class="cx_popup_btn" @click="agree">已閱讀并同意</view> -->
					<button open-type="getPhoneNumber" @getphonenumber="getPhoneNumber" class="cx_popup_btn"
						v-if="!nickFlag">已閱讀并同意</button>
					<button @click="getUserInfo" class="cx_popup_btn" v-if="nickFlag">用戶授權(quán)</button>
				</view>
			</tui-bottom-popup>
			<!-- 獲取用戶頭像昵稱 -->
			<tui-bottom-popup :zIndex="1002" :maskZIndex="1001" :show="popupShows" @close="popup" disabled shadow>
				<view class="getnickbox">
					<view class="flex_align_center">
						<image src="https://img.cdn.wxzhida.cn/zd-ali-app/zdlogo.png" class="logoimg" mode="aspectFit">
						</image>
						<view class="name">
							活動(dòng)申請(qǐng)
						</view>
					</view>
					<view class="m1 mt30">獲取你的頭像、昵稱</view>
					<view class="m2">展示個(gè)人信息</view>
					<view class="xin1">
						<button type="default" class="flex_spacebetween buttoncss" open-type="chooseAvatar"
							@chooseavatar="chooseavatar">
							<view class="flex_align_center toubox">
								<view class="t1">頭像</view>
								<view v-if="avatar == ''" class="avatarbox">
								</view>
								<image v-else :src="avatar" class="avatarimg"></image>
							</view>
							<tui-icon name="arrowright"></tui-icon>
						</button>
					</view>
					<view class="nick">
						<view class="n1">昵稱:</view>
						<input type="nickname" v-model="nickname" placeholder="請(qǐng)輸入昵稱" maxlength="8">
					</view>
					<view class="fixedBtn wan">
						<view class="user-info" @click="refuse">拒絕</view>
						<view class="user-priamy" @click="getUserInfo">允許</view>
					</view>
				</view>
			</tui-bottom-popup>
			<!-- 分享朋友圈和朋友列表 -->
			<tui-bottom-popup :zIndex="1002" :maskZIndex="1001" :show="popupShowes" @close="popup">
				<view class="cx_popupss">
					<view class="wechatB_A">
						<view class="wechatA" @click="shareFriend">
							<button open-type="share" style="border-color: transparent;" class="wechatA"></button>
						</view>
						<view>發(fā)送朋友</view>
					</view>
					<view class="wechatB_A">
						<view class="wechatB" @click="goShareFri"></view>
						<view>
							分享朋友圈
						</view>
					</view>
				</view>
				<view class="cx_popup_cancle" @click="popupShowes = false">取消</view>
		</tui-bottom-popup>
	</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				popupShow: false,
				nickFlag: false,
				jsCode: '',
				backgroundColor: 'rgba(0, 0, 0, 0.7)',
				modal: false,
				canvasdata: {}, //canvas數(shù)據(jù)
				imagedata: {}, //頭像數(shù)據(jù)
				codeimage: "", //最后生成圖片地址
				posterCover: '',
				popupShows: false,
				avatar: '',
				nickname: '',
				mobile: '',
				currentPile: {},
				popupShowes: false,
			}
		},
		onShareAppMessage(res) {
			return {
				title: '百萬(wàn)好禮派送中',
				path: '/pages/selectPile/index',
				imageUrl: 'https://img.cdn.wxzhida.cn/zd-lottery/xxcc.jpg'
			}
		},
		async onShow() {

			this.getPileDetail()
			if (uni.getStorageSync('userInfo') != '') {
				if (this.showFlags) { //進(jìn)了webview分享頁(yè)面就自動(dòng)跳到抽獎(jiǎng)頁(yè)面
					let res = await this.getLottery()
					console.log('bbbb')
					console.log(res)
					if (res.data.data == null) {
						uni.reLaunch({
							url: '/pages/return-visit/index'
						})
					} else {
						if (res.data.data.isLottery == '01' || res.data.data.isLottery == '' || res.data.data
							.isLottery ==
							undefined || res.data.data.isLottery == null) { //未抽獎(jiǎng)
							uni.reLaunch({
								url: '/pages/return-visit/index'
							})
						} else {
							// uni.showToast({
							// 	title: "您已經(jīng)參與過(guò)抽獎(jiǎng)!",
							// 	icon: "none",
							// 	duration: 3000
							// });
						}
					}
				}

				let user = uni.getStorageSync('userInfo')
				console.log('user=' + JSON.stringify(user))
				this.popupShow = false;
				this.avatar = user.avatar
				this.nickname = user.nickname
			} else {
				this.popupShow = true;
				this.wxLogin()
			}
		},
		mounted() {

		},
		watch: {},
		computed: {
			showFlags() {
				return this.$store.state.showFlag
			},
		},
		created() {

		},
		methods: {
			/*查詢用戶有沒(méi)有抽過(guò)獎(jiǎng)*/
			getLottery() {
				let that = this;
				return new Promise((resolve, reject) => {
					uni.request({
						url: this.$A.lottery.find,
						method: "POST",
						data: {
							userPhone: uni.getStorageSync("userPhone")
						},
						success: (res) => {
							resolve(res)
						},
						fail: (err) => {

							// console.log(err.data)
						},
						complete: (end) => {
							// console.log(end)

						}
					})

				})

			},
			/*拒絕提供用戶信息*/
			refuse() {
				this.popupShows = false;
				this.popupShow = true;
			},
			/*拉去樁詳情*/
			getPileDetail() {
				uni.request({
					url: this.$A.picture.getPicture,
					method: "POST",
					data: {
						erpCode: this.$store.state.currentSelectPile.erpCode
					},
					success: (res) => {
						this.$store.commit('setCurrentPile', res.data.data)
						this.currentPile = res.data.data
					},
					fail: (err) => {

						// console.log(err.data)
					},
					complete: (end) => {
						// console.log(end)

					}
				})
			},
			/*馬上分享*/
			showTips() {
				this.popupShowes = true;
				// uni.navigateTo({ //encodeURIComponent(JSON.stringify(item))
				// 	url: `/pages/bill/web-view?pileName=${this.currentPile.pileName}&pileUrl=${this.currentPile.filePath}&avatar=${this.avatar}&nickname=${this.nickname}`,
				// });
			},
			popup() {

			},
			/*撥打電話*/
			callPhone() {
				uni.makePhoneCall({
					phoneNumber: '4006596580' //僅為示例
				});
			},
			/*同意*/
			agree() {
				this.popupShow = false;
			},
			// 獲取用戶手機(jī)號(hào)
			getPhoneNumber(e, type) { // 參數(shù)encryptedData
				console.log(e)
				this.pageType = type;
				if (e.detail.errMsg == "getPhoneNumber:ok") { // 用戶允許或去手機(jī)號(hào)
					uni.showLoading({
						title: '授權(quán)中...',
						mask: true,
					});
					this.login(e.detail);
				}
			},
			/*獲取手機(jī)號(hào)碼*/
			login(data) {
				uni.request({
					url: this.$A.getPhone.main,
					method: "POST",
					data: {
						encryptedData: data.encryptedData,
						iv: data.iv,
						code: this.jsCode
					},
					success: (res) => {
						let phoneNum = JSON.parse(res.data.data.userPhone).phoneNumber
						uni.setStorageSync('userPhone', phoneNum)
						this.mobile = JSON.parse(res.data.data.userPhone).phoneNumber
						this.nickFlag = true;
					},
					fail: (err) => {
						uni.showToast({
							title: "登錄失?。?,
							icon: "error"
						});
						// console.log(err.data)
					},
					complete: (end) => {
						// console.log(end)
						uni.hideLoading()
					}
				})
			},
			//登錄---目的拿到code
			wxLogin() {
				let _this = this
				// 獲取登錄用戶code
				uni.login({
					provider: 'weixin',
					success: function(res) {
						console.log(res)
						if (res.code) {
							_this.jsCode = res.code;
							console.log('jsCode=' + res.code)
						} else {
							// uni.showToast({
							// 	title: '獲取logon_code失敗',
							// 	duration: 2000
							// })
							_this.wxLogin()
						}
					},
					fail: (res) => {
						// uni.showToast({
						// 	title: '獲取logon_code失敗',
						// 	duration: 2000
						// })
						_this.wxLogin()
					}
				})
			},
			/*選擇頭像*/
			chooseavatar(e) {
				console.log(e)
				let that = this;
				uni.uploadFile({
					url: this.$A.picture.uploadFile, //
					filePath: e.detail.avatarUrl,
					name: 'file',
					formData: {
						mobile: that.mobile
					},
					success: r => {
						let imgData = JSON.parse(r.data)
						this.avatar = imgData.data.headImg;
					}
				});
			},
			/*提交用戶昵稱頭像*/
			getUserInfo() {
				let that = this;
				this.popupShow = false;
				this.popupShows = true;
				if (this.avatar == "") {
					uni.showToast({
						title: '請(qǐng)選擇頭像',
						icon: 'none'
					})
					return
				}
				// 坑,,,點(diǎn)擊昵稱后,開(kāi)發(fā)者工具上 一直提示 昵稱是空,但是 真機(jī)上 是正常的
				if (this.nickname == "") {
					uni.showToast({
						title: '請(qǐng)編輯用戶昵稱',
						icon: 'none'
					})
					return
				}
				uni.setStorageSync("userInfo", {
					avatar: this.avatar,
					nickname: this.nickname
				})
				this.popupShow = false;
				this.popupShows = false;
			},
			/*分享朋友圈*/
			goShareFri() {
				this.$store.commit("setShowFlag", true)
				this.popupShowes = false;
				uni.navigateTo({ //encodeURIComponent(JSON.stringify(item))
					url: `/pages/bill/web-view?pileName=${this.currentPile.pileName}&pileUrl=${this.currentPile.filePath}&avatar=${this.avatar}&nickname=${this.nickname}`,
				});
			},
			/*點(diǎn)擊分享朋友*/
			shareFriend() {
				this.$store.commit("setShowFlag", true)
				this.popupShowes = false;
			}
		}
	}
</script>

<style lang="less">
	page {
		width: 100%;
		height: 100vh;
		box-sizing: border-box;
		background: url('https://img.cdn.wxzhida.cn/zd-mini-lottery/billbg.png');
		background-size: 100% 100%;
	}

	.cx_content_bill {
		width: 100%;
		height: 100%;
		box-sizing: border-box;
		display: flex;
		flex-direction: column;
		align-items: center;
		position: relative;
		z-index: 999999;
	}

	.cx_pile_status {
		position: absolute;
		top: 58rpx;
		left: 50%;
		width: 316rpx;
		height: 440rpx;
		transform: translateX(-50%);
		display: flex;
		align-items: center;
		justify-content: center;
	}

	.lottery-cover-img {
		width: 100%;
		height: 100%;
	}

	.cx_pileType {
		height: 44rpx;
		font-size: 32rpx;
		font-weight: 600;
		color: #FFFFFF;
		line-height: 44rpx;
		letter-spacing: 8rpx;
		text-align: center;
		width: 100%;
		position: absolute;
		top: 608rpx;
	}

	.cx_pile_pay {
		font-size: 32rpx;
		font-weight: 400;
		color: #FFFFFF;
		line-height: 26rpx;
		letter-spacing: 2rpx;
		position: absolute;
		top: 724rpx;
		width: 100%;
		text-align: center;
		left: 50%;
		transform: translateX(-50%);
	}

	.cx_pile_titleA {
		width: 100%;
		font-size: 52rpx;
		font-weight: 600;
		color: #FFFFFF;
		text-align: center;
		line-height: 74rpx;
		letter-spacing: 2rpx;
		position: absolute;
		top: 768rpx;
	}

	.cx_pile_titleB {
		width: 100%;
		height: 156rpx;
		font-size: 24rpx;
		font-weight: 400;
		color: #FFFFFF;
		letter-spacing: 4rpx;
		text-align: center;
		position: absolute;
		top: 1002rpx;
		line-height: 38rpx;

	}

	.cx_pile_logo {
		width: 116rpx;
		height: 24rpx;
		background: url('https://img.cdn.wxzhida.cn/zd-mini-lottery/zd.png');
		background-size: 100% 100%;
		position: absolute;
		top: 1336rpx;
		left: 50%;
		transform: translateX(-50%);
	}

	.cx_pile_share {
		width: 200rpx;
		height: 60rpx;
		box-sizing: border-box;
		background: linear-gradient(205deg, #F380F2 0%, #51D2EC 100%);
		border-radius: 29rpx;
		position: absolute;
		top: 1238rpx;
		left: 50%;
		transform: translateX(-50%);
		display: flex;
		align-items: center;
		justify-content: space-between;

		padding: 0 28rpx;
		font-size: 24rpx;
		font-weight: 400;
		color: #FFFFFF;
	}

	.cx_pile_shareIma {
		width: 28rpx;
		height: 30rpx;
		background: url('https://img.cdn.wxzhida.cn/zd-mini-lottery/hy-share.png');
		background-size: 100% 100%;
	}

	.cx_nick_img {
		width: 80rpx;
		height: 80rpx;
		border-radius: 50%;
		position: absolute;
		top: 882rpx;
		left: 50%;
		overflow: hidden;
		transform: translateX(-50%);
	}

	.cx_popup {
		width: 100%;
		padding: 40rpx 50rpx 60rpx 54rpx;
		display: flex;
		flex-direction: column;
		align-items: center;
		box-sizing: border-box;
	}

	.cx_popupss {
		width: 100%;
		padding: 60rpx 180rpx 100rpx 180rpx;
		display: flex;
		justify-content: space-between;
		align-items: center;
		box-sizing: border-box;
		font-size: 24rpx;
		font-weight: 400;
		color: #000000;
		letter-spacing: 2rpx;
	}

	.wechatA {
		width: 118rpx;
		height: 118rpx;
		background: url('https://img.cdn.wxzhida.cn/zd-mini-lottery/wechatC.png');
		background-size: 100% 100%;
	}
	.wechatB_A{
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: space-between;
	}
	.shareBtn {
		width: 100%;
		height: 100%;
		border: 0 rpx solid transparent;
	}

	.wechatB {
		width: 118rpx;
		height: 118rpx;
		background: url('https://img.cdn.wxzhida.cn/zd-mini-lottery/wechatD.png');
		background-size: 100% 100%;
	}

	.cx_popup_cancle {
		width: 100%;
		text-align: center;
		margin-bottom: 30rpx;
	}

	.cx_popup_title {
		height: 50rpx;
		width: 100%;
		text-align: center;
		font-size: 36rpx;
		font-weight: 600;
		color: #000000;
		line-height: 50rpx;
		margin-bottom: 30rpx;
	}

	.cx_popup_content {
		font-size: 28rpx;
		font-weight: 400;
		color: #000000;
		line-height: 40rpx;
	}

	.cx_popup_btn {
		width: 510rpx;
		height: 90rpx;
		background: #000000;
		border-radius: 45rpx;
		font-size: 28rpx;
		font-weight: 400;
		color: #FFFFFF;
		display: flex;
		justify-content: center;
		align-items: center;
		margin-top: 38rpx;
	}

	.tui-modal-custom {
		width: 100%;
		height: 800rpx;
		box-sizing: border-box;
		display: flex;
		justify-content: center;
		align-items: center;
	}

	.getnickbox {
		padding: 40rpx 20rpx;

		.flex_align_center {
			display: flex;
			align-items: center;
		}

		.fixedBtn {
			display: flex;
			justify-content: center;
			align-items: center;
			width: 100%;
			padding-top: 50rpx;

			.user-info {
				color: #07C160;
				width: 180rpx;
				height: 64rpx;
				display: flex;
				justify-content: center;
				align-items: center;
				background-color: #FFFFFF;
				border: 1rpx solid #07C160;
				border-radius: 10rpx;
			}

			.user-priamy {
				width: 180rpx;
				height: 64rpx;
				border-radius: 10rpx;
				margin-left: 50rpx;
				display: flex;
				justify-content: center;
				align-items: center;
				background-color: #07C160;
				color: #FFFFFF;
			}
		}

		.logoimg {
			width: 50rpx;
			height: 50rpx;
		}

		.name {
			margin-left: 20rpx;
		}

		.m1 {
			font-weight: 500;
		}

		.m2 {
			padding-bottom: 30rpx;
			border-bottom: 1rpx solid #f2f2f2;
			color: #999;
			padding-top: 10rpx;
			font-size: 24rpx;
		}

		.xin1 {
			border-bottom: 1rpx solid #f2f2f2;
			margin-bottom: 30rpx;

			.flex_spacebetween {
				display: flex;
				justify-content: space-between;
			}

			.toubox {
				padding: 10rpx 0;

				.t1 {
					font-size: 28rpx;
					margin-right: 30rpx;
				}

				.avatarbox {
					width: 100rpx;
					height: 100rpx;
					border-radius: 20rpx;
				}

				.avatarimg {
					width: 100rpx;
					height: 100rpx;
					border-radius: 20rpx;
				}
			}
		}

		.buttoncss {
			background-color: #fff;
			border-radius: 0px;
			border: 0rpx solid transparent;
		}

		button::after {
			border: 0px solid rgba(0, 0, 0, .2);
		}

		.nick {
			padding-bottom: 30rpx;
			border-bottom: 2rpx solid #f2f2f2;
			display: flex;
			align-items: center;
			padding-left: 14px;
			padding-right: 14px;

			.n1 {
				font-size: 28rpx;
				margin-right: 30rpx;
			}
		}


		.mt30 {
			margin-top: 30rpx;
		}
	}

	button::after {
		border: none;
	}
</style>


到了這里,關(guān)于uniapp微信小程序最新獲取昵稱和頭像的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!

本文來(lái)自互聯(lián)網(wǎng)用戶投稿,該文觀點(diǎn)僅代表作者本人,不代表本站立場(chǎng)。本站僅提供信息存儲(chǔ)空間服務(wù),不擁有所有權(quán),不承擔(dān)相關(guān)法律責(zé)任。如若轉(zhuǎn)載,請(qǐng)注明出處: 如若內(nèi)容造成侵權(quán)/違法違規(guī)/事實(shí)不符,請(qǐng)點(diǎn)擊違法舉報(bào)進(jìn)行投訴反饋,一經(jīng)查實(shí),立即刪除!

領(lǐng)支付寶紅包贊助服務(wù)器費(fèi)用

相關(guān)文章

  • uniapp 微信小程序 獲取用戶頭像和昵稱

    uniapp 微信小程序 獲取用戶頭像和昵稱

    自2022年10月25日后,小程序? wx.getUserProfile 接口? 被收回,通過(guò) wx.getUserInfo 接口獲取用戶頭像將統(tǒng)一返回默認(rèn)灰色頭像,昵稱將統(tǒng)一返回 “微信用戶”。如需獲取用戶頭像昵稱,可以手動(dòng)獲取,具體步驟??「頭像昵稱填寫(xiě)能力」 ??GitHub完整代碼地址??: https://github.com/c

    2024年02月08日
    瀏覽(90)
  • uniapp中微信小程序獲取用戶頭像昵稱

    關(guān)于小程序用戶頭像昵稱獲取規(guī)則調(diào)整的公告 意思就是說(shuō) 從 2022 年 10 月 25 日 24 時(shí)后 wx.getUserProfile 獲取用戶頭像將統(tǒng)一返回默認(rèn)灰色頭像,昵稱將統(tǒng)一返回 “微信用戶” 最新:用戶昵稱,頭像獲取規(guī)則 onChooseAvatar 方法必須使用 this.avatarUrl = \\\'data:image/jpeg;base64,\\\' + wx.getFileS

    2024年02月13日
    瀏覽(92)
  • 微信小程序最新獲取頭像和昵稱的方法 直接用!

    微信小程序最新獲取頭像和昵稱的方法 直接用!

    調(diào)整背景 微信小程序獲取用戶頭像和昵稱一個(gè)開(kāi)放接口是 wx.getUserInfo , 2021年4月5日被廢棄,原因是很多開(kāi)發(fā)者在打開(kāi)小程序時(shí)就通過(guò)組件方式喚起getUserInfo彈窗,如果用戶點(diǎn)擊拒絕,無(wú)法使用小程序,這種做法打斷了用戶正常使用小程序的流程,同時(shí)也不利于小程序獲取新

    2023年04月23日
    瀏覽(26)
  • 微信小程序最新用戶頭像昵稱獲取規(guī)則調(diào)整應(yīng)對(duì)措施(2022)

    微信小程序最新用戶頭像昵稱獲取規(guī)則調(diào)整應(yīng)對(duì)措施(2022)

    小程序用戶頭像昵稱獲取規(guī)則調(diào)整公告 以前通過(guò)wx.getUserProfile獲取用戶信息,用戶點(diǎn)擊同意以后,便可以直接獲取相關(guān)信息,但是官方最近做出了調(diào)整,直接將頭像和昵稱使用默認(rèn)值填充了,所以我們無(wú)法直接獲取用戶的信息了,需要新增一個(gè)頁(yè)面用于用戶自定義頭像和昵稱

    2023年04月14日
    瀏覽(27)
  • 微信小程序獲取用戶頭像和昵稱完美解決方法(最新方法)

    微信小程序獲取用戶頭像和昵稱完美解決方法(最新方法)

    自 2022 年 10 月 25 日 24 時(shí)后,用戶頭像昵稱獲取規(guī)則將進(jìn)行如下調(diào)整 從基礎(chǔ)庫(kù) 2.21.2 開(kāi)始支持 當(dāng)小程序需要讓用戶完善個(gè)人資料時(shí),可以通過(guò)微信提供的頭像昵稱填寫(xiě)能力快速完善。 根據(jù)相關(guān)法律法規(guī),為確保信息安全,由用戶上傳的圖片、昵稱等信息微信側(cè)將進(jìn)行安全檢

    2024年02月08日
    瀏覽(21)
  • 【微信小程序】新版獲取用戶頭像昵稱(uniapp)(完整版附源碼)

    【微信小程序】新版獲取用戶頭像昵稱(uniapp)(完整版附源碼)

    需求 獲取微信用戶頭像和昵稱 問(wèn)題 其實(shí)實(shí)現(xiàn)起來(lái)不復(fù)雜,復(fù)雜的是近幾年微信小程序文檔對(duì)于獲取用戶信息這塊的api一直在更新,而查看了很多帖子基本都是用的舊的api,wx.getUserProfile(Object object) 和 wx.getUserInfo(Object object),舊的api只適用于低版本的基礎(chǔ)庫(kù),對(duì)于當(dāng)下的最新

    2024年01月16日
    瀏覽(110)
  • 微信臨時(shí)文件wxfile://tmp文件處理,微信小程序最新獲取頭像和昵稱

    微信臨時(shí)文件wxfile://tmp文件處理,微信小程序最新獲取頭像和昵稱

    歡迎點(diǎn)擊領(lǐng)取 -《前端開(kāi)發(fā)面試題進(jìn)階秘籍》:前端登頂之巔-最全面的前端知識(shí)點(diǎn)梳理總結(jié) *專(zhuān)享 技術(shù)棧:taro框架 + vue3版本 解決在微信小程序獲取微信頭像時(shí)控制臺(tái)報(bào)錯(cuò): 找不著wxfile://tmp 文件路徑,失敗 ,原因如下:因?yàn)槲⑿盘峁┙o我開(kāi)發(fā)者的是一個(gè)本地的臨時(shí)文件是會(huì)失

    2024年02月09日
    瀏覽(100)
  • uniapp微信小程序獲取用戶頭像和昵稱填寫(xiě)能力調(diào)整解決方案

    微信小程序填充頭像button按鈕開(kāi)放了open-type=\\\"?chooseAvatar\\\"? 微信小程序填充昵稱input按鈕開(kāi)放了type=\\\"nickname\\\"? 小程序 wx.getUserProfile 接口將被收回,「頭像昵稱填寫(xiě)能力」支持獲取用戶頭像昵稱 : 文章目錄 一、調(diào)整背景 二、解決方案 在小程序內(nèi),開(kāi)發(fā)者可以通過(guò) wx.login 接口

    2024年02月11日
    瀏覽(21)
  • 2023年最新微信小程序獲取用戶openid、頭像昵稱的填寫(xiě)能力和方法原生寫(xiě)法

    2023年最新微信小程序獲取用戶openid、頭像昵稱的填寫(xiě)能力和方法原生寫(xiě)法

    大家好,下面是我身為小白分享給小白哈, 不懂就問(wèn)相互學(xué)習(xí)共同進(jìn)步! 親測(cè)自用原生代碼,感謝大神指點(diǎn)賜教鼓勵(lì)勿噴; 只需9個(gè)一鍵復(fù)制粘貼步驟一氣呵成; 先來(lái) 本文最終主要實(shí)現(xiàn)效果 : 獲取微信小程序用戶頭像昵稱的填寫(xiě)能力和方法原生寫(xiě)法 一:先捋一捋思路邏輯

    2024年02月08日
    瀏覽(23)
  • Uniapp寫(xiě)微信小程序時(shí),如何獲取用戶頭像和昵稱使用微信用戶信息登錄?

    Uniapp寫(xiě)微信小程序時(shí),如何獲取用戶頭像和昵稱使用微信用戶信息登錄?

    實(shí)現(xiàn)效果如下: 首先使用uni.login獲取用戶登錄憑證code: 官方代碼: success返回參數(shù)如下: 頭像選擇: 需要將?button?組件? open-type ?的值設(shè)置為? chooseAvatar ,當(dāng)用戶選擇需要使用的頭像之后,可以通過(guò)? bindchooseavatar ?事件回調(diào)獲取到頭像信息的臨時(shí)路徑。 從基礎(chǔ)庫(kù)2.24.4版本

    2024年02月04日
    瀏覽(24)

覺(jué)得文章有用就打賞一下文章作者

支付寶掃一掃打賞

博客贊助

微信掃一掃打賞

請(qǐng)作者喝杯咖啡吧~博客贊助

支付寶掃一掃領(lǐng)取紅包,優(yōu)惠每天領(lǐng)

二維碼1

領(lǐng)取紅包

二維碼2

領(lǐng)紅包