@@ -19,6 +19,7 @@ Page({ | |||
getVcodeTime:0,//获取验证码倒计时 | |||
getCodeTimeKey:null, | |||
photoList:[],//图片列表 | |||
photoListShow:[], | |||
agree:false,//是否同意本协议 | |||
getphone:"",//手机号 | |||
maskShow: false, | |||
@@ -224,13 +225,17 @@ Page({ | |||
* 上传照片 | |||
*/ | |||
chooseImage(e){ | |||
var list=this.data.photoList; | |||
var list = this.data.photoList; | |||
wx.chooseImage({ | |||
count: 3-this.data.photoList.length, | |||
count: 3 - this.data.photoListShow.length, | |||
sizeType: ['original'], //可选择原图 | |||
sourceType: ['album', 'camera'], //可选择性开放访问相册、相机 | |||
success: res => { | |||
for (let i = 0; i < res.tempFilePaths.length; i++) { | |||
this.data.photoListShow.push(res.tempFilePaths[i]); | |||
this.setData({ | |||
photoListShow: this.data.photoListShow | |||
}) | |||
wx.uploadFile({ | |||
url: app.globalData.urlRoot + "upload/uploadImage", | |||
header: { | |||
@@ -435,9 +440,11 @@ Page({ | |||
}, | |||
deleteImg:function(e){ | |||
var index = e.currentTarget.dataset.index; | |||
this.data.photoList.splice(index,1); | |||
this.data.photoList.splice(index, 1); | |||
this.data.photoListShow.splice(index, 1); | |||
this.setData({ | |||
photoList: this.data.photoList | |||
photoList: this.data.photoList, | |||
photoListShow: this.data.photoListShow | |||
}) | |||
} | |||
}) |
@@ -45,11 +45,11 @@ | |||
</picker> | |||
<image class="registerMainPic" src="{{imgUrl+'/images/registerMainPic.png?v=002'}}"></image> | |||
<view class="upPhonoBox"> | |||
<view class="phontBox" wx:for="{{photoList}}" wx:key="*this" wx:if="{{photoList.length>0}}" data-value="{{index}}"> | |||
<view class="phontBox" wx:for="{{photoListShow}}" wx:key="*this" wx:if="{{photoListShow.length>0}}" data-value="{{index}}"> | |||
<image src="{{item}}" mode="aspectFill" ></image> | |||
<image bindtap="deleteImg" data-index="{{index}}" class="gameRuleClose" src="{{imgUrl+'/images/gameRuleClose.png'}}"></image> | |||
</view> | |||
<image class="upPhontBtn" wx:if="{{photoList.length<3}}" src="{{imgUrl+'/star/scout/register/upBtn.png'}}" bindtap="chooseImage"></image> | |||
<image class="upPhontBtn" wx:if="{{photoListShow.length<3}}" src="{{imgUrl+'/star/scout/register/upBtn.png'}}" bindtap="chooseImage"></image> | |||
</view> | |||
<image class="photoNotes" src="{{imgUrl+'/images/registerTip2.png'}}" ></image> | |||
<button class="submitBtn" style="padding:0;margin:20rpx auto 0;min-height:0;" formType="submit"> |
@@ -21,6 +21,7 @@ Component({ | |||
district: "",//地区 | |||
addressDetail: ""//详细 | |||
}, | |||
avatarUrlShow:"", | |||
userData:{ | |||
avatarUrl:"", | |||
nickName:"" | |||
@@ -49,7 +50,8 @@ Component({ | |||
this.data.userData.avatarUrl = app.globalData.userInfoData.avatarUrl; | |||
this.data.userData.nickName = app.globalData.userInfoData.nickName; | |||
this.setData({ | |||
userData: this.data.userData | |||
userData: this.data.userData, | |||
avatarUrlShow: app.globalData.userInfoData.avatarUrl | |||
}) | |||
} | |||
this.getAddress(); | |||
@@ -209,9 +211,8 @@ Component({ | |||
wx.chooseImage({ | |||
count:1, | |||
success:(res)=>{ | |||
wx.showLoading({ | |||
title: '上传中', | |||
mask: true | |||
this.setData({ | |||
avatarUrlShow: res.tempFilePaths[0] | |||
}) | |||
wx.uploadFile({ | |||
url: app.globalData.urlRoot + "upload/uploadImage", | |||
@@ -225,7 +226,6 @@ Component({ | |||
filePath:"avatar" | |||
}, | |||
success: option => { | |||
wx.hideLoading(); | |||
var json = JSON.parse(option.data); | |||
if (json.code==200){ | |||
this.data.userData.avatarUrl = json.data[0].url; |
@@ -8,7 +8,7 @@ | |||
<view class="headGroup"> | |||
<view class="headTitle">头像</view> | |||
<view class="selectGroup"> | |||
<image class="avatarUrl" bindtap="changeHeadImg" src="{{userData.avatarUrl}}"></image> | |||
<image class="avatarUrl" bindtap="changeHeadImg" src="{{avatarUrlShow}}"></image> | |||
<image src="{{imgUrl+'/images/selectIcon.png'}}" class="selectIcon"></image> | |||
</view> | |||
</view> |
@@ -147,30 +147,30 @@ | |||
"pathName": "pages/placingOrder/placingOrder", | |||
"query": "" | |||
}, | |||
{ | |||
"id": -1, | |||
"name": "补充资料", | |||
"pathName": "pages/supplement/supplement", | |||
"query": "" | |||
}, | |||
{ | |||
"id": -1, | |||
"name": "奖品详情", | |||
"pathName": "pages/prizeDetail/prizeDetail", | |||
"query": "" | |||
}, | |||
{ | |||
"id": -1, | |||
"name": "认证", | |||
"pathName": "pages/scout/register/register", | |||
"query": "" | |||
}, | |||
{ | |||
"id": -1, | |||
"name": "星探规则", | |||
"pathName": "pages/scoutRule/scoutRule", | |||
"query": "" | |||
} | |||
{ | |||
"id": -1, | |||
"name": "补充资料", | |||
"pathName": "pages/supplement/supplement", | |||
"query": "" | |||
}, | |||
{ | |||
"id": -1, | |||
"name": "奖品详情", | |||
"pathName": "pages/prizeDetail/prizeDetail", | |||
"query": "" | |||
}, | |||
{ | |||
"id": -1, | |||
"name": "认证", | |||
"pathName": "pages/scout/register/register", | |||
"query": "" | |||
}, | |||
{ | |||
"id": -1, | |||
"name": "星探规则", | |||
"pathName": "pages/scoutRule/scoutRule", | |||
"query": "" | |||
} | |||
] | |||
} | |||
} |