灏忕▼搴忕煭瑙嗛椤圭洰鈥斺€斺€斿紑鍙戠敤鎴蜂俊鎭箣鐢ㄦ埛閫€鍑烘敞閿€
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了灏忕▼搴忕煭瑙嗛椤圭洰鈥斺€斺€斿紑鍙戠敤鎴蜂俊鎭箣鐢ㄦ埛閫€鍑烘敞閿€相关的知识,希望对你有一定的参考价值。
鏍囩锛?a href='http://www.mamicode.com/so/1/play' title='play'>play
class .com wrap width user page lex login鍦ㄧ敤鎴风櫥闄嗘垚鍔熸垨鑰呮敞鍐屾垚鍔熶箣鍚庯紝搴旇璁╃敤鎴疯烦杞埌涓汉淇℃伅椤甸潰銆傛墍浠ユ帴涓嬫潵杩涜涓汉淇℃伅鍔熻兘鐨勫紑鍙戣杞?/p>
涓€銆佺敤鎴蜂釜浜轰俊鎭晫闈㈢殑鍒濆鍖?/p>
mine.wxml
<view> <view class=鈥榗ontainer鈥?/span>> <block wx:if="{{isMe}}"> <image src="{{faceUrl}}" class="face" bindtap=鈥榗hangeFace鈥?/span>></image> </block> <block wx:if="{{!isMe}}"> <image src="{{faceUrl}}" class="face"></image> </block> <label class=鈥榥ickname鈥?/span>>{{nickname}}</label> <button size=鈥榤ini鈥?class=鈥榩rimary鈥?bindtap=鈥榰ploadVideo鈥?/span>> 涓婁紶浣滃搧</button> <button size=鈥榤ini鈥?type=鈥樷€?class=鈥榣ogout鈥?bindtap=鈥榣ogout鈥?/span>>娉ㄩ攢</button> <view class=鈥榗ontainer-row鈥?/span>> <label class=鈥榠nfo-items鈥?/span>>{{fansCounts}} 绮変笣</label> <label class=鈥榠nfo-items鈥?/span>>{{followCounts}} 鍏虫敞</label> <label class=鈥榠nfo-items鈥?/span>>{{receiveLikeCounts}} 鑾疯禐</label> </view> </view> </view> <view class="line"></view>
mine.wxss
page { font-size: 14px; } .container { background-color: whitesmoke; display: flex; flex-direction: column; align-items: center; } .container-row { display: flex; flex-direction: row; margin-bottom: 10px; margin-top: 10px; } .info-items { margin-left: 30px; } .face { width: 180rpx; height: 180rpx; border-radius: 50%; margin-top: 20px; } .nickname { margin-top: 5px; font-weight: bold; font-size: 18px; } .logout { margin-top: 3px; float: right; } .follow { margin-top: 3px; } .line { width: 100%; height: 1px; background-color: gainsboro; margin-top: 1px; } .container-video { display: flex; flex-direction: row; margin-top: 20px; text-align: center; border: solid 1px; line-height: 30px; } .video-info { width: 100%; } .video-info-selected { background-color: gainsboro; } .container-video-list { display: flex; flex-direction: row; flex-wrap: wrap; } .videoImage { width: 250rpx; height: 180px; }
浜屻€佸紑鍙戞敞閿€鎺ュ彛
鍦≧egistLoginController绫讳腑鏂板缓娉ㄩ攢鏂规硶
涓夈€佸皬绋嬪簭娉ㄩ攢涓庡悗绔仈璋?/p>
鍦ㄥ皬绋嬪簭mine.js涓婃柊澧炴敞閿€鎸夐挳鐨勭粦瀹氫簨浠?/p>
const app = getApp() Page({ data: { faceUrl: "../resource/images/noneface.png", }, onLoad: function(params){ }, logout: function(){ var user = app.userInfo; var serverUrl = app.serverUrl; wx.showLoading({ title: 鈥樿绛夊緟...鈥?span style="color: #000000">, }); // 璋冪敤鍚庣 wx.request({ url: serverUrl + 鈥?logout?userId=鈥?+ user.id, method: "POST", header: { 鈥榗ontent-type鈥? 鈥榓pplication/json鈥?// 榛樿鍊?/span> }, success: function (res) { console.log(res.data); wx.hideLoading(); if (res.data.status == 200) { //鐧诲綍鎴愬姛璺宠浆 wx.showToast({ title: 鈥樻敞閿€鎴愬姛鈥?span style="color: #000000">, icon: 鈥榮uccess鈥?span style="color: #000000">, duration: 2000 }); app.userInfo = null; //椤甸潰璺宠浆 wx.navigateTo({ url: 鈥?./userLogin/login鈥?span style="color: #000000">, }) } } }) } })
以上是关于灏忕▼搴忕煭瑙嗛椤圭洰鈥斺€斺€斿紑鍙戠敤鎴蜂俊鎭箣鐢ㄦ埛閫€鍑烘敞閿€的主要内容,如果未能解决你的问题,请参考以下文章