|
|
@ -28,7 +28,7 @@ |
|
|
|
<image class="pic" :src="a"></image> |
|
|
|
<image class="pic" :src="a"></image> |
|
|
|
<image class="del" @click="toDel(i)" src="@/static/fabu-cha.png"></image> |
|
|
|
<image class="del" @click="toDel(i)" src="@/static/fabu-cha.png"></image> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="upload" @click="uploadImg()"> |
|
|
|
<view class="upload" @click="chooseAvatar()"> |
|
|
|
<image class="pic" src="@/static/fankui-tianjia.png"></image> |
|
|
|
<image class="pic" src="@/static/fankui-tianjia.png"></image> |
|
|
|
<view class="txt">上传图片</view> |
|
|
|
<view class="txt">上传图片</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
@ -57,14 +57,21 @@ |
|
|
|
<view class="btn" @click="show = false">我知道了</view> |
|
|
|
<view class="btn" @click="show = false">我知道了</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</u-popup> |
|
|
|
</u-popup> |
|
|
|
|
|
|
|
<u-popup v-model="show1" mode="top" :mask-close-able='false' :zIndex="5"> |
|
|
|
|
|
|
|
<view class="permissions_box"> |
|
|
|
|
|
|
|
当您使用APP时,为了提供图片上传的功能,我们需要申请相机/存储权限。 |
|
|
|
|
|
|
|
</view> |
|
|
|
|
|
|
|
</u-popup> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
|
|
<script> |
|
|
|
<script> |
|
|
|
|
|
|
|
import permision from "@/js_sdk/wa-permission/permission.js" |
|
|
|
export default { |
|
|
|
export default { |
|
|
|
data() { |
|
|
|
data() { |
|
|
|
return { |
|
|
|
return { |
|
|
|
show: false, |
|
|
|
show: false, |
|
|
|
|
|
|
|
show1: false, |
|
|
|
imgurl: [], |
|
|
|
imgurl: [], |
|
|
|
content: "", |
|
|
|
content: "", |
|
|
|
tabIndex: 1, |
|
|
|
tabIndex: 1, |
|
|
@ -73,6 +80,56 @@ |
|
|
|
}; |
|
|
|
}; |
|
|
|
}, |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
methods: { |
|
|
|
|
|
|
|
recorderAuthModal: function () { |
|
|
|
|
|
|
|
const that = this; |
|
|
|
|
|
|
|
uni.showModal({ |
|
|
|
|
|
|
|
title: '温馨提示', |
|
|
|
|
|
|
|
content: '为了提供图片上传的功能,我们需要申请相机/存储权限,请您确认授权,否则无法使用该功能~', |
|
|
|
|
|
|
|
cancelText: '关闭', |
|
|
|
|
|
|
|
confirmText: '去授权', |
|
|
|
|
|
|
|
success(res) { |
|
|
|
|
|
|
|
that.show1=false |
|
|
|
|
|
|
|
if (res.confirm) { |
|
|
|
|
|
|
|
permision.gotoAppPermissionSetting() |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
chooseAvatar() { |
|
|
|
|
|
|
|
const that = this; |
|
|
|
|
|
|
|
// APP检查权限 |
|
|
|
|
|
|
|
if(uni.getSystemInfoSync().platform == 'android') { |
|
|
|
|
|
|
|
plus.android.checkPermission( |
|
|
|
|
|
|
|
'android.permission.WRITE_EXTERNAL_STORAGE', |
|
|
|
|
|
|
|
granted => { |
|
|
|
|
|
|
|
if (granted.checkResult==-1){ |
|
|
|
|
|
|
|
that.show1=true |
|
|
|
|
|
|
|
}else{ |
|
|
|
|
|
|
|
that.show1=false |
|
|
|
|
|
|
|
// 此为uView的跳转方法,详见"文档-JS"部分,也可以用uni的uni.navigateTo |
|
|
|
|
|
|
|
that.uploadImg(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
error => { |
|
|
|
|
|
|
|
console.error('Error checking permission:', error.message); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
that.requestAndroidPermission('android.permission.WRITE_EXTERNAL_STORAGE') |
|
|
|
|
|
|
|
return ; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
that.uploadImg(); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
async requestAndroidPermission(permisionID) { |
|
|
|
|
|
|
|
const that = this; |
|
|
|
|
|
|
|
var result = await permision.requestAndroidPermission(permisionID); |
|
|
|
|
|
|
|
if(result != 1){ |
|
|
|
|
|
|
|
that.recorderAuthModal(); |
|
|
|
|
|
|
|
}else{ |
|
|
|
|
|
|
|
that.show1=false |
|
|
|
|
|
|
|
// 此为uView的跳转方法,详见"文档-JS"部分,也可以用uni的uni.navigateTo |
|
|
|
|
|
|
|
that.uploadImg(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
toPage() { |
|
|
|
toPage() { |
|
|
|
uni.navigateTo({ |
|
|
|
uni.navigateTo({ |
|
|
|
url: "/pages/users/feedback/list" |
|
|
|
url: "/pages/users/feedback/list" |
|
|
|