|
|
|
@ -144,8 +144,23 @@ |
|
|
|
|
<view class="" v-for="(item,index) in form.work_img" :key="index"> |
|
|
|
|
<image :src="item.path" mode=""></image> |
|
|
|
|
</view> |
|
|
|
|
<view class="flex-between mt-sm"> |
|
|
|
|
<upload @upload="imgUpload" imgtype="work_img" text="上传图片" |
|
|
|
|
<view class="flex-between mt-sm" @click="checkquanxian" > |
|
|
|
|
<view class="flex-warp" v-if="xianshi==2" > |
|
|
|
|
<view class="radius-16 flex-center flex-column item-child upload-item fill-body radius-16 margin" style="width: 216rpx;height: 216rpx;background: #F7F7F7;"> |
|
|
|
|
<view class="upload-icon flex-center c-title radius-10" style="display: contents;width:41px;height:39px;background:#FFFFFF;align-items:center;justify-content:center;"> |
|
|
|
|
<view class="iconfont icon-camera _i"> |
|
|
|
|
|
|
|
|
|
</view> |
|
|
|
|
<view class="f-caption c-caption mt-sm"> |
|
|
|
|
上传视频 |
|
|
|
|
</view> |
|
|
|
|
<view class="cur-imgsize f-caption c-caption"> |
|
|
|
|
0/3 |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
<upload @upload="imgUpload" v-if="xianshi==1" imgtype="work_img" text="上传图片" |
|
|
|
|
:imgsize="1" imgclass="apply"> |
|
|
|
|
</upload> |
|
|
|
|
</view> |
|
|
|
@ -156,6 +171,11 @@ |
|
|
|
|
<view class="sbubtn" @click="submit"> |
|
|
|
|
提交 |
|
|
|
|
</view> |
|
|
|
|
<uni-popup ref="perpopup" type="top" :mask-click='false'> |
|
|
|
|
<view class="permissions_box"> |
|
|
|
|
当您使用APP时,为了提供图片上传的功能,我们需要申请相机/存储权限。 |
|
|
|
|
</view> |
|
|
|
|
</uni-popup> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
</template> |
|
|
|
@ -167,6 +187,7 @@ |
|
|
|
|
mapActions, |
|
|
|
|
mapMutations |
|
|
|
|
} from "vuex" |
|
|
|
|
import permision from '@/utils/permission.js' |
|
|
|
|
export default { |
|
|
|
|
components: { |
|
|
|
|
wPicker |
|
|
|
@ -238,6 +259,7 @@ |
|
|
|
|
max_level: 0, |
|
|
|
|
authTime: 0, |
|
|
|
|
timer: null, |
|
|
|
|
xianshi:2, |
|
|
|
|
form: { |
|
|
|
|
id: 0, |
|
|
|
|
admin_id: 0, |
|
|
|
@ -321,9 +343,72 @@ |
|
|
|
|
onUnload() { |
|
|
|
|
if (this.timer) clearInterval(this.timer) |
|
|
|
|
}, |
|
|
|
|
onShow(){ |
|
|
|
|
plus.android.checkPermission('android.permission.WRITE_EXTERNAL_STORAGE', |
|
|
|
|
granted => { |
|
|
|
|
if (granted.checkResult==-1){ |
|
|
|
|
this.xianshi=2 |
|
|
|
|
}else{ |
|
|
|
|
this.xianshi=1 |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
error => { |
|
|
|
|
console.error('Error checking permission:', error.message); |
|
|
|
|
} |
|
|
|
|
); |
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
|
...mapActions(['getConfigInfo', 'getUserInfo', 'updateCommonOptions']), |
|
|
|
|
...mapMutations(['updateUserItem']), |
|
|
|
|
async checkquanxian(){ |
|
|
|
|
let that = this; |
|
|
|
|
if(uni.getSystemInfoSync().platform == 'android') { |
|
|
|
|
plus.android.checkPermission('android.permission.WRITE_EXTERNAL_STORAGE', |
|
|
|
|
granted => { |
|
|
|
|
console.log(1,granted.checkResult) |
|
|
|
|
if (granted.checkResult==-1){ |
|
|
|
|
that.$refs.perpopup.open('top') |
|
|
|
|
}else{ |
|
|
|
|
that.xianshi=1 |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
error => { |
|
|
|
|
console.error('Error checking permission:', error.message); |
|
|
|
|
} |
|
|
|
|
); |
|
|
|
|
that.requestAndroidPermission('android.permission.WRITE_EXTERNAL_STORAGE') |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
async requestAndroidPermission(permisionID) { |
|
|
|
|
let that = this; |
|
|
|
|
console.log(permision) |
|
|
|
|
var result = await permision.requestAndroidPermission(permisionID); |
|
|
|
|
if(result != 1){ |
|
|
|
|
this.recorderAuthModal(); |
|
|
|
|
}else{ |
|
|
|
|
this.$refs.perpopup.close() |
|
|
|
|
if(that.open_update_info == 0){ |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
recorderAuthModal: function () { |
|
|
|
|
const that = this; |
|
|
|
|
uni.showModal({ |
|
|
|
|
title: '温馨提示', |
|
|
|
|
content: '为了提供图片上传的功能,我们需要申请相机/存储权限,请您确认授权,否则无法使用该功能~', |
|
|
|
|
cancelText: '关闭', |
|
|
|
|
confirmText: '去授权', |
|
|
|
|
success(res) { |
|
|
|
|
if (res.confirm) { |
|
|
|
|
that.$refs.perpopup.close(); |
|
|
|
|
permision.gotoAppPermissionSetting() |
|
|
|
|
}else{ |
|
|
|
|
that.$refs.perpopup.close(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
async initIndex(refresh = false) { |
|
|
|
|
// #ifdef H5 |
|
|
|
|
if (!refresh && this.$jweixin.isWechat()) { |
|
|
|
@ -802,4 +887,10 @@ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
.permissions_box{ |
|
|
|
|
padding: 100rpx 30rpx; |
|
|
|
|
font-size: 30rpx; |
|
|
|
|
line-height: 50rpx; |
|
|
|
|
background-color: #fff; |
|
|
|
|
} |
|
|
|
|
</style> |