|
|
@ -9,7 +9,7 @@ |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="edit-user"> |
|
|
|
<view class="edit-user"> |
|
|
|
<view class="user"> |
|
|
|
<view class="user"> |
|
|
|
<view class="pic" @click="toNext(userInfo.faceImage?1:3)"> |
|
|
|
<view class="pic" @click="chooseAvatar(1,userInfo.faceImage?1:3)"> |
|
|
|
<image class="avatar" v-if="userInfo.faceImage" :src="userInfo.faceImage"></image> |
|
|
|
<image class="avatar" v-if="userInfo.faceImage" :src="userInfo.faceImage"></image> |
|
|
|
<image class="avatar" v-else :src="userInfo.img"></image> |
|
|
|
<image class="avatar" v-else :src="userInfo.img"></image> |
|
|
|
<image class="xiangji" src="@/static/xiangji.png"></image> |
|
|
|
<image class="xiangji" src="@/static/xiangji.png"></image> |
|
|
@ -134,7 +134,7 @@ |
|
|
|
<image class="del" @click.stop="toDel(i)" src="@/static/icon-del.png"></image> |
|
|
|
<image class="del" @click.stop="toDel(i)" src="@/static/icon-del.png"></image> |
|
|
|
<image class="pic" :src="a"></image> |
|
|
|
<image class="pic" :src="a"></image> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="upload" @click="uploadImg(2)"> |
|
|
|
<view class="upload" @click="chooseAvatar(2,2)"> |
|
|
|
<image src="@/static/jia.png"></image> |
|
|
|
<image src="@/static/jia.png"></image> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
@ -147,18 +147,26 @@ |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="btn" @click="toClick()">确认</view> |
|
|
|
<view class="btn" @click="toClick()">确认</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
</u-popup> |
|
|
|
|
|
|
|
<u-popup v-model="show3" mode="top" :mask-close-able='false' :zIndex="5"> |
|
|
|
|
|
|
|
<view class="permissions_box" :style="{'padding-top': (statusBarHeight+64)+'px'}"> |
|
|
|
|
|
|
|
当您使用APP时,为了提供图片上传的功能,我们需要申请相机/存储权限。 |
|
|
|
|
|
|
|
</view> |
|
|
|
</u-popup> |
|
|
|
</u-popup> |
|
|
|
<u-picker mode="region" v-model="show1" :defaultRegion="defaultRegion" @cancel="cancel" @confirm="confirm" ></u-picker> |
|
|
|
<u-picker mode="region" v-model="show1" :defaultRegion="defaultRegion" @cancel="cancel" @confirm="confirm" ></u-picker> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
|
|
<script> |
|
|
|
<script> |
|
|
|
|
|
|
|
const systemInfoSync = uni.getSystemInfoSync() |
|
|
|
|
|
|
|
import permision from "@/js_sdk/wa-permission/permission.js" |
|
|
|
export default { |
|
|
|
export default { |
|
|
|
data() { |
|
|
|
data() { |
|
|
|
return { |
|
|
|
return { |
|
|
|
show1: false, |
|
|
|
show1: false, |
|
|
|
tabIndex: 1, |
|
|
|
tabIndex: 1, |
|
|
|
show: false, |
|
|
|
show: false, |
|
|
|
|
|
|
|
show3: false, |
|
|
|
background: { |
|
|
|
background: { |
|
|
|
"background": "#ffffff" |
|
|
|
"background": "#ffffff" |
|
|
|
}, |
|
|
|
}, |
|
|
@ -180,7 +188,10 @@ |
|
|
|
pickerIndex6: 0, |
|
|
|
pickerIndex6: 0, |
|
|
|
cityType: 1, |
|
|
|
cityType: 1, |
|
|
|
defaultRegion: [], |
|
|
|
defaultRegion: [], |
|
|
|
uploadType: 1 |
|
|
|
uploadType: 1, |
|
|
|
|
|
|
|
chooseType: 1, |
|
|
|
|
|
|
|
chooseIndex: 1, |
|
|
|
|
|
|
|
statusBarHeight: 0 |
|
|
|
}; |
|
|
|
}; |
|
|
|
}, |
|
|
|
}, |
|
|
|
computed: { |
|
|
|
computed: { |
|
|
@ -269,9 +280,74 @@ |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
that.statusBarHeight = systemInfoSync.statusBarHeight; |
|
|
|
}, |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
methods: { |
|
|
|
|
|
|
|
recorderAuthModal: function () { |
|
|
|
|
|
|
|
const that = this; |
|
|
|
|
|
|
|
uni.showModal({ |
|
|
|
|
|
|
|
title: '温馨提示', |
|
|
|
|
|
|
|
content: '为了提供图片上传的功能,我们需要申请相机/存储权限,请您确认授权,否则无法使用该功能~', |
|
|
|
|
|
|
|
cancelText: '关闭', |
|
|
|
|
|
|
|
confirmText: '去授权', |
|
|
|
|
|
|
|
success(res) { |
|
|
|
|
|
|
|
that.show3=false |
|
|
|
|
|
|
|
if (res.confirm) { |
|
|
|
|
|
|
|
permision.gotoAppPermissionSetting() |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
chooseAvatar(type,index) { |
|
|
|
|
|
|
|
const that = this; |
|
|
|
|
|
|
|
that.chooseType = type; |
|
|
|
|
|
|
|
that.chooseIndex = index; |
|
|
|
|
|
|
|
// APP检查权限 |
|
|
|
|
|
|
|
if(uni.getSystemInfoSync().platform == 'android') { |
|
|
|
|
|
|
|
plus.android.checkPermission( |
|
|
|
|
|
|
|
'android.permission.WRITE_EXTERNAL_STORAGE', |
|
|
|
|
|
|
|
granted => { |
|
|
|
|
|
|
|
if (granted.checkResult==-1){ |
|
|
|
|
|
|
|
that.show3=true |
|
|
|
|
|
|
|
}else{ |
|
|
|
|
|
|
|
that.show3=false |
|
|
|
|
|
|
|
// 此为uView的跳转方法,详见"文档-JS"部分,也可以用uni的uni.navigateTo |
|
|
|
|
|
|
|
if(that.chooseType==1){ |
|
|
|
|
|
|
|
that.toNext(that.chooseIndex) |
|
|
|
|
|
|
|
}else{ |
|
|
|
|
|
|
|
that.uploadImg(that.chooseIndex); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
error => { |
|
|
|
|
|
|
|
console.error('Error checking permission:', error.message); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
that.requestAndroidPermission('android.permission.WRITE_EXTERNAL_STORAGE') |
|
|
|
|
|
|
|
return ; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if(that.chooseType==1){ |
|
|
|
|
|
|
|
that.toNext(that.chooseIndex) |
|
|
|
|
|
|
|
}else{ |
|
|
|
|
|
|
|
that.uploadImg(that.chooseIndex); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
async requestAndroidPermission(permisionID) { |
|
|
|
|
|
|
|
const that = this; |
|
|
|
|
|
|
|
var result = await permision.requestAndroidPermission(permisionID); |
|
|
|
|
|
|
|
if(result != 1){ |
|
|
|
|
|
|
|
that.recorderAuthModal(); |
|
|
|
|
|
|
|
}else{ |
|
|
|
|
|
|
|
that.show3=false |
|
|
|
|
|
|
|
// 此为uView的跳转方法,详见"文档-JS"部分,也可以用uni的uni.navigateTo |
|
|
|
|
|
|
|
if(that.chooseType==1){ |
|
|
|
|
|
|
|
that.toNext(that.chooseIndex) |
|
|
|
|
|
|
|
}else{ |
|
|
|
|
|
|
|
that.uploadImg(that.chooseIndex); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
//上传图片 |
|
|
|
//上传图片 |
|
|
|
uploadImg() { |
|
|
|
uploadImg() { |
|
|
|
const that = this |
|
|
|
const that = this |
|
|
|