twt 2 vuotta sitten
vanhempi
commit
3e7c152cd8
2 muutettua tiedostoa jossa 32 lisäystä ja 4 poistoa
  1. 2 2
      pages/shop/confirm.vue
  2. 30 2
      pages/user/user.vue

+ 2 - 2
pages/shop/confirm.vue

@@ -389,13 +389,13 @@
 }
 .topBox{
 	height: 140rpx;
-	background: #D53533;
+	background: #FF0000;
 	width: 750rpx;
 }
 .yuanhu{
 	width: 750rpx;
 	height: 30rpx;
-	background: #D53533;
+	background: #FF0000;
 	border-radius: 0 0 100% 100%;
 }
 .goodsBox{

+ 30 - 2
pages/user/user.vue

@@ -3,8 +3,8 @@
 
 		<view class="top">
 			<view class="customerMes">
-				<image v-if="headImg" :src="headImg" mode="" style="width: 88rpx;height: 88rpx;border-radius: 44rpx;"></image>
-				<image v-else src="../../static/img/icon_me.png" mode="" style="width: 88rpx;height: 88rpx;border-radius: 44rpx;"></image>
+				<image @click="updateUserInfo" v-if="headImg" :src="headImg" mode="" style="width: 88rpx;height: 88rpx;border-radius: 44rpx;"></image>
+				<image @click="updateUserInfo" v-else src="../../static/img/icon_me.png" mode="" style="width: 88rpx;height: 88rpx;border-radius: 44rpx;"></image>
 				<view class="mes">
 					<view class="nick">
 						<view class="nickName" v-if="nickName">{{nickName}}</view>
@@ -234,6 +234,8 @@
 			this.iStatusBarHeight = uni.getSystemInfoSync().statusBarHeight;
 			//const wxOpenData = uni.getStorageSync("wxOpenData");
 			const wxOpenData = this.$store.state.wxOpenData;
+			this.wxOpenData=wxOpenData
+			//console.log()
 			if (wxOpenData) {
 				this.headImg = wxOpenData.loginInfo.customerInfo.headImgurl;
 				this.nickName = wxOpenData.loginInfo.customerInfo.wxNickName;
@@ -254,6 +256,32 @@
 
 		},
 		methods: {
+			updateUserInfo(){
+				var that=this;
+				uni.getUserProfile({
+					lang:'zh_CN',
+					desc:'登录',
+					success:(res)=>{
+						console.log(res);
+						that.headImg=res.userInfo.avatarUrl;
+						that.nickName=res.userInfo.nickName;
+						that.$http('miniApp2/sys/updateUserInfo', {
+							nickName:res.userInfo.nickName,
+							unionId:that.ext.unionId,
+							headImg: res.userInfo.avatarUrl,
+							openId: that.wxOpenData.openid
+						}, 'POST').then(res => {
+							
+						})
+					},
+					fail:(res)=>{
+						console.log(res)
+					}
+				});
+				
+					
+					
+			},
 			decryptPhoneNumber: function(e) {
 				console.log(e);
 				this.code = e.detail.code