Commit fbd22347 authored by 刘文虎's avatar 刘文虎

权限弹框

parent b12f6a1e
Pipeline #7838 canceled with stages
......@@ -27,7 +27,7 @@
default: true
},
//是否是原生头部
isNativeHead:{
isNativeHead: {
type: Boolean,
default: true
},
......@@ -40,38 +40,43 @@
return {
ani: '',
showPopup: false,
StatusBar:'',
refuseNum:'',//拒绝次数,
StatusBar: '',
refuseNum: '', //拒绝次数,
authList: {
'WRITE_EXTERNAL_STORAGE': {
scopeText:"存储空间/照片",
title: "扳手快查对存储空间/照片权限申请说明",
content: "便于您使用该功能上传您的照片/图片/视频/文件及用于更换头像、意见反馈、保存相册、上传资料/分享、下载与客服沟通等场景中读取和写入相册和文件内容。"
scopeText: "存储空间/照片",
title: "扳手记账对存储空间/照片权限申请说明",
content: "便于您使用该功能上传您的照片/图片/视频/文件及用于更换头像、意见反馈、保存相册、上传资料/分享、下载、与客服沟通等场景中读取和写入相册和文件内容。"
},
'READ_EXTERNAL_STORAGE': {
scopeText:"读取设备上的照片及文件",
title: "扳手快查对读取设备上的照片及文件权限申请说明",
content: "便于您使用该功能上传您的照片/图片/视频/文件及用于更换头像、意见反馈、保存相册、上传资料/分享、下载与客服沟通等场景中读取相册和文件内容。"
scopeText: "读取设备上的照片及文件",
title: "扳手记账对读取设备上的照片及文件权限申请说明",
content: "便于您使用该功能上传您的照片/图片/视频/文件及用于更换头像、意见反馈、保存相册、上传资料/分享、下载、与客服沟通等场景中读取相册和文件内容。"
},
'ACCESS_FINE_LOCATION': {
scopeText:"地理位置",
title: "扳手快查对地理位置权限申请说明",
scopeText: "地理位置",
title: "扳手记账对地理位置权限申请说明",
content: "便于应用程序可以提供基于位置的服务、定位导航、附近搜索等功能。"
},
'CAMERA':{
scopeText:"相机/摄像头",
title: "扳手快查对相机/摄像头权限申请说明",
'CAMERA': {
scopeText: "相机/摄像头",
title: "扳手记账对相机/摄像头权限申请说明",
content: "便于您使用该功能拍照上传您的照片/视频及用于更换头像、意见反馈、保存相册、上传资料/动态、下载与客服沟通等场景中使用"
},
'RECORD_AUDIO':{
scopeText:"麦克风",
title: "扳手快查对麦克风权限申请说明",
'RECORD_AUDIO': {
scopeText: "麦克风",
title: "扳手记账对麦克风权限申请说明",
content: "便于您使用该功能进行录音、语音通话、发布语音、与客服语音沟通等场景中使用"
},
'CALL_PHONE': {
scopeText:"拨打/管理电话",
title: "扳手快查对拨打/管理电话权限申请说明",
scopeText: "拨打/管理电话",
title: "扳手记账对拨打/管理电话权限申请说明",
content: "便于您使用该功能联系客服、讲师等场景下使用"
},
'WRITE_CONTACTS':{
scopeText: "通讯录",
title: "扳手记账对通讯录权限申请说明",
content: "便于您使用该功能保存到通讯录、使用通讯录等场景下使用"
}
}
}
......@@ -87,7 +92,8 @@
let _this = this;
uni.getSystemInfo({
success: function(e) {
_this.StatusBar = e.statusBarHeight + 'px'; //用于自定义头部时,给手机状态栏留出位置,可通过isNativeHead这个参数控制
_this.StatusBar = 44 + e.statusBarHeight +
'px'; //用于自定义头部时,给手机状态栏留出位置,可通过isNativeHead这个参数控制
}
})
},
......@@ -117,7 +123,7 @@
_this.$nextTick(() => {
setTimeout(() => {
_this.ani = 'uni-' + _this.type
},30)
}, 30)
})
}
},
......@@ -134,7 +140,7 @@
_this.showPopup = false
}, 0)
})
console.log(e,'kkkkk')
console.log(e, 'kkkkk')
if (e.granted.length > 0) {
//当前查询权限已授权,此时可以通知页面执行接下来的操作
_this.$emit('changeAuth');
......@@ -185,11 +191,11 @@
} else if (permissionID == 'CAMERA') {
//IOS检测相机/摄像头权限
let avCaptureDevice = plus.ios.importClass("AVCaptureDevice"),
authStatus = avCaptureDevice.authorizationStatusForMediaType("vide");
authStatus = avCaptureDevice.authorizationStatusForMediaType("vide");
if (authStatus === 3) {
result = 1;
result = 1;
} else {
result = 0;
result = 0;
}
plus.ios.deleteObject(avCaptureDevice);
} else if (permissionID == 'CALL_PHONE') {
......@@ -202,15 +208,15 @@
result = 0;
}
plus.ios.deleteObject(contactStore);
}else if(permissionID == 'RECORD_AUDIO'){
} else if (permissionID == 'RECORD_AUDIO') {
//IOS检测麦克风权限
let aVAudioSession = plus.ios.importClass("AVAudioSession"),
aVAudio = aVAudioSession.sharedInstance(),
authStatus = aVAudio.recordPermission();
aVAudio = aVAudioSession.sharedInstance(),
authStatus = aVAudio.recordPermission();
if ([1684369017, 1970168948].includes(authStatus)) {
result = 0;
result = 0;
} else {
result = 1;
result = 1;
}
plus.ios.deleteObject(aVAudioSession);
}
......@@ -272,34 +278,39 @@
right: 0;
z-index: 99999;
overflow: hidden;
&__wrapper {
position: absolute;
z-index: 999;
/* #ifndef APP-NVUE */
box-sizing: border-box;
/* #endif */
&.ani {
/* #ifndef APP-NVUE */
transition: all 0.3s;
/* #endif */
}
&.top {
top: 0;
width:705rpx;
width: 705rpx;
/* #ifdef APP-NVUE */
left:22.5rpx;
left: 22.5rpx;
/* #endif */
/* #ifndef APP-NVUE */
left:0;
left: 0;
transform: translateY(-705rpx);
/* #endif */
}
&-box {
position: relative;
/* #ifndef APP-NVUE */
box-sizing: border-box;
/* #endif */
}
&.uni-custom {
& .uni-popup__wrapper-box {
width: 705rpx;
......@@ -313,22 +324,26 @@
box-sizing: border-box;
/* #endif */
border-radius: 16rpx;
.title{
.title {
font-size: 32rpx;
font-weight: bold;
}
.content{
.content {
margin-top: 16rpx;
line-height: 1.6;
}
}
&.top{
&.top {
& .uni-popup__wrapper-box {
width: 705rpx;
}
}
}
&.uni-top{
&.uni-top {
transform: translateY(0);
}
}
......
This diff is collapsed.
<template>
<u-action-sheet :list="list" @click="click" border-radius="24" v-model="show"></u-action-sheet>
<u-action-sheet :list="list" @click="click" border-radius="24" safe-area-inset-bottom v-model="show"></u-action-sheet>
</template>
<script>
......@@ -26,7 +26,7 @@
},
click(e) {
if(this.list[e]&&this.list[e].sourceType){
this.$emit("choose",this.list[e].sourceType)
this.$emit("change",this.list[e].sourceType)
}
},
handleClose() {
......
<template>
<u-popup v-model="show" mode="bottom" safe-area-inset-bottom @close="handleClose" border-radius="16">
<view class="pop-view">
<view class="item-view" v-for="(item, index) in list" :key="index" @click.stop="handleClick(item)">
<text>{{item.title}}</text>
<u-line color="#e3e3e3" />
</view>
<view class="line">
</view>
<view class="item-view" @click="handleClose">
取消
</view>
</view>
</u-popup>
</template>
<script>
export default {
name: "choose-image-source-type",
props: {
visible: {
type: Boolean,
default: false,
},
},
data() {
return {
show: false,
list: [{
title: '拍照',
source: 'camera',
},
{
title: '从相册选择',
source: 'album'
},
]
};
},
watch: {
visible(val) {
this.show = val
},
},
methods: {
handleClick(item) {
this.handleClose()
this.$emit('change', item.source)
},
changeVisibleValue(val) {
this.$emit('update:visible', val)
},
handleClose() {
this.changeVisibleValue(false)
},
}
}
</script>
<style lang="scss" scoped>
.pop-view {
overflow: hidden;
background-color: #FFFFFF;
padding: 0rpx 0 24rpx 0;
color: #333333;
font-size: 32rpx;
.item-view {
text-align: center;
height: 80rpx;
line-height: 80rpx;
font-size: 28rpx;
}
.line{
height: 8rpx;
background: #f7f7f7;
}
}
</style>
\ No newline at end of file
......@@ -247,7 +247,8 @@ export default {
// 若iOS端服务端处理不了跨域就将hybrid目录内的html放到服务端去,并将此处path改成服务器上的地址
// let path = '/uni_modules/lsj-upload/hybrid/html/uploadFile.html';
// let path = '/components/lsj-upload/hybrid/html/uploadFile.html';
let path = 'https://api-book-test.banshouhui.com/hybrid/uploadFile.html';
// let path = 'https://api-book-test.banshouhui.com/hybrid/uploadFile.html';
let path = 'https://api-book.kaying.cc/hybrid/uploadFile.html';
let dom = this.lsjFile.create(path);
// #ifdef H5
this.$refs.lsj.$el.appendChild(dom);
......
<template>
<UploadImages ref="upload-images" :max-count="maxCount" :width="width" :height="height" custom-btn
:file-list="fileList" :auto-upload="autoUpload" :show-progress="false" :show-add="showAdd" :sourceType="sourceType" @openSource="openSource"
:file-list="fileList" :auto-upload="autoUpload" :isNativeHead="isNativeHead" :show-progress="false" :show-add="showAdd" :sourceType="sourceType" @openSource="openSource"
@on-list-change="handleListChange">
<view slot="addBtn" class="slot-btn" hover-class="slot-btn__hover" :style="slotStyle" hover-stay-time="150">
<u-icon name="plus" :size="addSize" color="#D8D8D8"></u-icon>
<ChooseImageSourceType :visible.sync="sourceTypeVisible" @change="sourceTypeChange" />
<BottomChoose ref="bottom-choose" @change="sourceTypeChange" />
</view>
</UploadImages>
</template>
<script>
import ChooseImageSourceType from '@/components/choose-image-source-type'
import BottomChoose from '@/components/bottom-choose'
import upload from '@/utils/upload'
import UploadImages from '@/components/upload/u-upload'
import {
......@@ -23,7 +23,7 @@
export default {
components: {
UploadImages,
ChooseImageSourceType
BottomChoose
},
props: {
// 给fileList赋初始值用
......@@ -65,12 +65,15 @@
type: Boolean,
default: true
},
isNativeHead:{
type: Boolean,
default: true
}
},
data() {
return {
fileList: [],
qiniuToken: '',
sourceTypeVisible: false,
sourceType: ['album', 'camera']
}
},
......@@ -109,8 +112,7 @@
},
methods: {
openSource() {
this.sourceTypeVisible = true
console.log("openSource")
this.$refs['bottom-choose'].open()
},
sourceTypeChange(source) {
this.sourceType = [source]
......
This diff is collapsed.
......@@ -48,6 +48,7 @@
<view class="u-add-tips">{{ uploadText }}</view>
</view>
</view>
<AuthPopup ref="authpup" type="top" :isNativeHead="isNativeHead" @changeAuth="changeAuth" :permissionID="permissionID" />
</view>
</template>
......@@ -267,6 +268,10 @@ export default {
index: {
type: [Number, String],
default: ''
},
isNativeHead:{
type: Boolean,
default: true
}
},
mounted() {
......@@ -332,7 +337,6 @@ export default {
},
// 选择图片
selectFile() {
console.log("stratChoose")
// #ifdef APP-PLUS
this.$emit("openSource")
// #endif
......
......@@ -30,7 +30,8 @@
"Push" : {},
"Share" : {},
"Contacts" : {},
"Camera" : {}
"Camera" : {},
"Record" : {}
},
"safearea" : {
"bottom" : {
......@@ -64,7 +65,8 @@
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
"<uses-permission android:name=\"android.permission.WRITE_CONTACTS\"/>",
"<uses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\"/>",
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>",
"<uses-permission android:name=\"android.permission.RECORD_AUDIO\"/>"
],
"abiFilters" : [ "armeabi-v7a", "arm64-v8a", "x86" ],
"autoSdkPermissions" : false,
......@@ -130,10 +132,10 @@
},
"geolocation" : {
"amap" : {
"name" : "amap5kOhMYHO",
"__platform__" : [ "ios", "android" ],
"appkey_ios" : "a808d665af78906c3e2f0b1b28ea17ed",
"appkey_android" : "6f92327cbdcd93ca769a62676ba69e78",
"name" : "amap5kOhMYHO"
"appkey_android" : "6f92327cbdcd93ca769a62676ba69e78"
}
},
"push" : {
......@@ -231,6 +233,7 @@
"optimization" : {
"subPackages" : true
},
"libVersion" : "latest",
"__usePrivacyCheck__" : true
},
"mp-alipay" : {
......
This diff is collapsed.
......@@ -63,10 +63,12 @@
</view>
<u-toast ref="uToast" />
<BottomShare :visible.sync="showShare" @click="handleClickShare" />
<AuthPopup ref="authpup" type="top" :isNativeHead="false" @changeAuth="changeAuth" :permissionID="permissionID" />
</view>
</template>
<script>
import AuthPopup from '@/components/auth-popup'
import NavbarRight from '@/components/navbar-right';
import NoData from '@/components/no-data';
import CardSwiper from '@/components/cell-card-swiper';
......@@ -79,6 +81,7 @@ import { checkPermision } from '@/utils/app-plus-auth.js';
export default {
components: {
AuthPopup,
NavbarRight,
NoData,
CardSwiper,
......@@ -101,7 +104,8 @@ export default {
loadingCard: false,
currentIndex: 0,
shareImage: '',
showShare: false
showShare: false,
permissionID:'WRITE_EXTERNAL_STORAGE'
};
},
computed: {
......@@ -275,6 +279,18 @@ export default {
this.currentIndex = index;
this.reloadList();
},
//打开自定义权限目的弹框
openAuth() {
setTimeout(() => {
this.$refs['authpup'].open();
}, 500)
},
//用户授权权限后的回调
changeAuth() {
//这里是权限通过后执行自己的代码逻辑
console.log('权限已授权,可执行自己的代码逻辑了');
this.saveImage()
},
handleClickTool(index) {
if (index == 0) {
this.$u.route({
......@@ -285,17 +301,10 @@ export default {
});
} else if (index == 1) {
// #ifdef APP-PLUS
// checkPermision({
// permissionID: 'photoLibrary'
// }).then(() => {
// this.saveImage();
// }).catch(()=>{})
if(this.isIOS){
this.saveImage();
}else{
getSetting('android.permission.WRITE_EXTERNAL_STORAGE', '检测到您没打开保存到相册功能权限,是否去设置打开?', res => {
this.saveImage();
});
this.openAuth()
}
// #endif
// #ifdef MP-WEIXIN
......
......@@ -55,13 +55,16 @@
<!-- </view> -->
<view class="loading-view" v-if="loading"><u-loading mode="flower"></u-loading></view>
<u-toast ref="uToast" />
<bottom-choose ref="bottom-choose" @choose="bottomChoose"></bottom-choose>
<view class="upload-images">
<SingleImages ref="single-images" :isNativeHead="false" :max-count="1" :uploading.sync="uploading" :width="72" :height="72" :list="fileList"
@on-list-change="handlePicturesChange">
</SingleImages>
</view>
</view>
</template>
<script>
import BottomChoose from '@/components/common/ab-upload/components/bottom-choose.vue';
import chooseImageMixin from '@/components/common/ab-upload/js/chooseImageMixin.js';
import SingleImages from '@/components/upload/single.vue';
import NavbarRight from '@/components/navbar-right';
import upload from '@/utils/upload';
import { getQiNiuToken } from '@/api/common/index.js';
......@@ -75,9 +78,8 @@ export default {
components: {
NavbarRight,
PayeeImages,
BottomChoose
SingleImages
},
mixins: [chooseImageMixin],
data() {
return {
info: {
......@@ -88,6 +90,8 @@ export default {
currentIndex: 0,
value: '',
loading: false,
uploading: false,
fileList: [],
list: []
};
},
......@@ -227,56 +231,25 @@ export default {
formatCount(count) {
return formatCount(count);
},
handlePicturesChange(lists) {
if (lists && lists.length) {
console.log(lists);
let url = lists[0];
// this.form.attach = url;
this.info[this.currentSetting.type].url = url;
this.setCollectionCode(url);
this.initList();
}
this.fileList = [];
},
handleClickCodeImage() {
if (this.info[this.currentSetting.type].url) {
this.addCode();
}
},
beforeChooseImage() {
if (uni.$u.platform === '4') {
this.openChoose();
} else {
this.chooseImage();
}
},
openChoose() {
this.$refs['bottom-choose'].open();
},
bottomChoose(sourceType) {
this.sculpture(sourceType);
this.$refs['single-images'].selectFile()
},
async chooseImage(e) {
console.log(e);
try {
let type = e === 'camera' ? 0 : e === 'album' ? 1 : 2; // 0:相机 1:相册 2: [相机,相册]
// 上传图片
let res = await upload.getPhoto(this.qiniuToken, type);
uni.hideLoading();
var url = UPLOAD_FILE_HOST + res.key;
this.info[this.currentSetting.type].url = url;
this.setCollectionCode(url);
this.initList();
} catch (e) {
uni.hideLoading();
//TODO handle the exception
}
},
// addCode() {
// // 上传图片
// upload.getPhoto(this.qiniuToken).then((res) => {
// uni.hideLoading()
// this.$refs.uToast.show({
// title: '上传成功',
// type: 'success',
// duration: 1500,
// callback: () => {},
// })
// var url = UPLOAD_FILE_HOST + res.key
// this.info[this.currentSetting.type].url = url
// this.setCollectionCode(url)
// this.initList()
// })
// },
initList() {
var array = [];
for (var key in this.info) {
......@@ -299,7 +272,12 @@ export default {
flex-direction: column;
height: 100vh;
background-color: #f6f7fa;
overflow: hidden;
.upload-images{
position: fixed;
left: -200%;
top: 0;
}
// .content-view {
// margin: 24rpx 24rpx 0rpx 24rpx;
// border-radius: 16rpx;
......
......@@ -2,36 +2,28 @@
<view class="u-swiper-wrap" :style="{
borderRadius: `${borderRadius}rpx`
}">
<swiper :current="elCurrent" @change="change" @animationfinish="animationfinish" :interval="interval" :circular="circular" :duration="duration" :autoplay="autoplay"
:previous-margin="effect3d ? effect3dPreviousMargin + 'rpx' : '0'" :next-margin="effect3d ? effect3dPreviousMargin + 'rpx' : '0'"
:style="{
<swiper :current="elCurrent" @change="change" @animationfinish="animationfinish" :interval="interval"
:circular="circular" :duration="duration" :autoplay="autoplay"
:previous-margin="effect3d ? effect3dPreviousMargin + 'rpx' : '0'"
:next-margin="effect3d ? effect3dPreviousMargin + 'rpx' : '0'" :style="{
height: height + 'rpx',
backgroundColor: bgColor
}">
<swiper-item class="u-swiper-item" v-for="(item, index) in list" :key="index">
<view class="u-list-image-wrap" @tap.stop.prevent="listClick(index)" :class="[uCurrent != index ? 'u-list-scale' : '']" :style="{
<view class="u-list-image-wrap" @tap.stop.prevent="listClick(index)"
:class="[uCurrent != index ? 'u-list-scale' : '']" :style="{
borderRadius: `${borderRadius}rpx`,
transform: effect3d && uCurrent != index ? 'scaleY(0.9)' : 'scaleY(1)',
margin: effect3d && uCurrent != index ? '0 20rpx' : 0,
}">
<view class="code-view">
<view
class="code-image-view"
hover-class="u-hover-class"
@click.stop.prevent="$u.throttle(addCode, 500)"
>
<image
mode="widthFix"
:src="item.url || item.default"
></image>
<view class="code-image-view" hover-class="u-hover-class"
@click.stop.prevent="$u.throttle(addCode, 500)">
<image mode="widthFix" :src="item.url || item.default"></image>
</view>
<view class="middle-view">
<view
v-if="!item.url"
class="add-view"
hover-class="u-hover-class"
@click.stop.prevent="$u.throttle(addCode, 500)"
>
<view v-if="!item.url" class="add-view" hover-class="u-hover-class"
@click.stop.prevent="$u.throttle(addCode, 500)">
<image class="add-view-image" :src="item.addUrl"></image>
</view>
</view>
......@@ -46,16 +38,16 @@
padding: `0 ${effect3d ? '74rpx' : '24rpx'}`
}">
<block v-if="mode == 'rect'">
<view class="u-indicator-item-rect" :class="{ 'u-indicator-item-rect-active': index == uCurrent }" v-for="(item, index) in list"
:key="index"></view>
<view class="u-indicator-item-rect" :class="{ 'u-indicator-item-rect-active': index == uCurrent }"
v-for="(item, index) in list" :key="index"></view>
</block>
<block v-if="mode == 'dot'">
<view class="u-indicator-item-dot" :class="{ 'u-indicator-item-dot-active': index == uCurrent }" v-for="(item, index) in list"
:key="index"></view>
<view class="u-indicator-item-dot" :class="{ 'u-indicator-item-dot-active': index == uCurrent }"
v-for="(item, index) in list" :key="index"></view>
</block>
<block v-if="mode == 'round'">
<view class="u-indicator-item-round" :class="{ 'u-indicator-item-round-active': index == uCurrent }" v-for="(item, index) in list"
:key="index"></view>
<view class="u-indicator-item-round" :class="{ 'u-indicator-item-round-active': index == uCurrent }"
v-for="(item, index) in list" :key="index"></view>
</block>
<block v-if="mode == 'number'">
<view class="u-indicator-item-number">{{ uCurrent + 1 }}/{{ list.length }}</view>
......@@ -181,7 +173,7 @@
// 标题的样式,对象形式
titleStyle: {
type: Object,
default() {
default () {
return {}
}
}
......@@ -189,7 +181,7 @@
watch: {
// 如果外部的list发生变化,判断长度是否被修改,如果前后长度不一致,重置uCurrent值,避免溢出
list(nVal, oVal) {
if(nVal.length !== oVal.length) this.uCurrent = 0;
if (nVal.length !== oVal.length) this.uCurrent = 0;
},
// 监听外部current的变化,实时修改内部依赖于此测uCurrent值,如果更新了current,而不是更新uCurrent,
// 就会错乱,因为指示器是依赖于uCurrent的
......@@ -211,9 +203,11 @@
titlePaddingBottom() {
let tmp = 0;
if (this.mode == 'none') return '12rpx';
if (['bottomLeft', 'bottomCenter', 'bottomRight'].indexOf(this.indicatorPos) >= 0 && this.mode == 'number') {
if (['bottomLeft', 'bottomCenter', 'bottomRight'].indexOf(this.indicatorPos) >= 0 && this.mode ==
'number') {
tmp = '60rpx';
} else if (['bottomLeft', 'bottomCenter', 'bottomRight'].indexOf(this.indicatorPos) >= 0 && this.mode != 'number') {
} else if (['bottomLeft', 'bottomCenter', 'bottomRight'].indexOf(this.indicatorPos) >= 0 && this.mode !=
'number') {
tmp = '40rpx';
} else {
tmp = '12rpx';
......@@ -237,15 +231,15 @@
this.uCurrent = current;
// 发出change事件,表示当前自动切换的index,从0开始
this.$emit('change', current);
this.$nextTick(()=> {
const query = uni.createSelectorQuery().in(this)
query
.select('.code-image-view')
.boundingClientRect( (data) => {
console.log('-------------', data)
})
.exec()
})
this.$nextTick(() => {
const query = uni.createSelectorQuery().in(this)
query
.select('.code-image-view')
.boundingClientRect((data) => {
console.log('-------------', data)
})
.exec()
})
},
// 头条小程序不支持animationfinish事件,改由change事件
// 暂不监听此事件,因为不再给swiper绑定uCurrent属性
......@@ -261,11 +255,12 @@
<style lang="scss" scoped>
// @import "../../libs/css/style.components.scss";
@mixin vue-flex($direction: row) {
/* #ifndef APP-NVUE */
display: flex;
flex-direction: $direction;
/* #endif */
}
/* #ifndef APP-NVUE */
display: flex;
flex-direction: $direction;
/* #endif */
}
.u-swiper-wrap {
position: relative;
overflow: hidden;
......@@ -370,29 +365,32 @@
overflow: hidden;
align-items: center;
}
.code-view {
height: 100%;
overflow-y:auto;
overflow-y: auto;
}
.code-image-view {
position: relative;
width: 702rpx;
// height: 956rpx;
border-radius: 16rpx;
overflow: hidden;
}
.code-image-view {
position: relative;
width: 702rpx;
// height: 956rpx;
border-radius: 16rpx;
overflow: hidden;
}
.middle-view {
position: absolute;
display: flex;
justify-content: center;
align-items: center;
top: 196rpx;
left: 0;
right: 0;
.add-view-image {
width: 440rpx;
height: 440rpx;
}
}
</style>
.middle-view {
position: absolute;
display: flex;
justify-content: center;
align-items: center;
top: 196rpx;
left: 0;
right: 0;
.add-view-image {
width: 440rpx;
height: 440rpx;
}
}
</style>
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
......@@ -114,7 +114,7 @@
:custom-style="customStyle"
:placeholder-style="placeholderStyle"
v-model="form.address"
placeholder="选择地址"
:placeholder="platform==='4'?'输入地址':'选择地址'"
/>
</view>
<view class="location-view" hover-class="u-hover-class" @click="$u.throttle(getAddress, 500)">
......@@ -616,14 +616,14 @@ export default {
this.chooseLocation();
});
} else {
try {
await checkOpenService();
await checkOpenPermission();
this.chooseLocation();
} catch (e) {
console.log(e);
//TODO handle the exception
}
// try {
// await checkOpenService();
// await checkOpenPermission();
// this.chooseLocation();
// } catch (e) {
// console.log(e);
// //TODO handle the exception
// }
}
},
chooseLocation() {
......
......@@ -22,10 +22,13 @@
分享
</u-button>
</view>
<AuthPopup ref="authpup" type="top" :isNativeHead="false" @changeAuth="changeAuth"
:permissionID="permissionID" />
</view>
</template>
<script>
import AuthPopup from '@/components/auth-popup'
import NavbarRight from '@/components/navbar-right';
import {
wxMiniId,
......@@ -39,6 +42,7 @@
} from 'vuex';
export default {
components: {
AuthPopup,
NavbarRight,
},
data() {
......@@ -63,6 +67,7 @@
},
printer: null, // 打印
fromShare:false,
permissionID: ''
};
},
computed: {
......@@ -129,19 +134,37 @@
url: ""
})
},
//打开自定义权限目的弹框
openAuth(permissionID) {
this.permissionID = permissionID
setTimeout(() => {
this.$refs['authpup'].open();
}, 500)
},
//用户授权权限后的回调
changeAuth() {
//这里是权限通过后执行自己的代码逻辑
console.log('权限已授权,可执行自己的代码逻辑了');
if(this.permissionID==='WRITE_EXTERNAL_STORAGE'){
this.openAuth('READ_EXTERNAL_STORAGE')
}else if(this.permissionID==='READ_EXTERNAL_STORAGE'){
this.permissionID=''
this.savePrint()
}
this.addPhoneContact()
},
handleClickPrint() {
getSetting('android.permission.WRITE_EXTERNAL_STORAGE', '检测到您没打开文件写入权限,是否去设置打开?', res => {
getSetting('android.permission.READ_EXTERNAL_STORAGE', '检测到您没打开文件读取权限,是否去设置打开?', res => {
uni.getImageInfo({
src: this.printUrl,
success: (image) => {
const path = plus.io.convertLocalFileSystemURL(image.path)
this.printer.print(path, (res) => {
console.log("res", res)
});
}
this.openAuth('WRITE_EXTERNAL_STORAGE')
},
savePrint(){
uni.getImageInfo({
src: this.printUrl,
success: (image) => {
const path = plus.io.convertLocalFileSystemURL(image.path)
this.printer.print(path, (res) => {
console.log("res", res)
});
});
}
});
},
handleClickShare() {
......
......@@ -187,15 +187,19 @@
</view>
</template>
</view>
<!-- #ifdef MP-WEIXIN -->
<zero-privacy color="#02a074" :onNeed="false" :hideTabBar="false" @agree="handleAgree"></zero-privacy>
<!-- #endif -->
<PopImage :visible.sync="visible" :title="shareTitle" :url="path" @confirm="handleClickConform" />
<QRCodeView :url="shareUrl" @canvas="handleCanvas" />
<u-toast ref="uToast" />
<l-painter :board="poster" isCanvasToTempFilePath @success="handleCanvasSuccess" @fail="handleCanvasFail" custom-style="position: fixed; left: 200%" />
<AuthPopup ref="authpup" type="top" :isNativeHead="false" @changeAuth="changeAuth" :permissionID="permissionID" />
</view>
</template>
<script>
import AuthPopup from '@/components/auth-popup'
import NavbarRight from '@/components/navbar-right';
import PopImage from '@/components/pop-qrCode-image';
import QRCodeView from '@/components/qr-code-view';
......@@ -212,6 +216,7 @@ import { tableOptions } from '@/utils/options/maintain-bill/index.js';
export default {
components: {
AuthPopup,
NavbarRight,
PopImage,
QRCodeView,
......@@ -233,7 +238,8 @@ export default {
currentBlock: () => {},
billImageUrl: '',
customerId: '',
canvasType: 'save'
canvasType: 'save',
permissionID:'WRITE_EXTERNAL_STORAGE'
};
},
computed: {
......@@ -426,6 +432,9 @@ export default {
},
onShow() {},
methods: {
handleAgree() {
uni.setStorageSync("PRIVACY-AGREE", 'YES');
},
initOptions(q) {
var array = q.split('?');
if (array.length > 1) {
......@@ -597,6 +606,18 @@ export default {
type: 'switchTab'
});
},
//打开自定义权限目的弹框
openAuth() {
setTimeout(() => {
this.$refs['authpup'].open();
}, 500)
},
//用户授权权限后的回调
changeAuth() {
//这里是权限通过后执行自己的代码逻辑
console.log('权限已授权,可执行自己的代码逻辑了');
this.saveBillImage()
},
handleClickSave() {
this.canvasType = 'save';
this.currentBlock = url => {
......@@ -640,9 +661,7 @@ export default {
if (this.isIOS) {
this.saveBillImage();
} else {
getSetting('android.permission.WRITE_EXTERNAL_STORAGE', '检测到您没打开保存到相册功能权限,是否去设置打开?', res => {
this.saveBillImage();
});
this.openAuth()
}
// #endif
......
......@@ -23,7 +23,7 @@ export default {
data() {
return {
downloadImg: mineBaseUrl + 'XISX1@3x.png',
filePath: 'https://api-book-test.banshouhui.com/%E8%B4%A6%E5%8D%95%E5%AF%BC%E5%85%A5%E6%A8%A1%E6%9D%BF.xlsx'
filePath: 'https://api-book.kaying.cc/%E8%B4%A6%E5%8D%95%E5%AF%BC%E5%85%A5%E6%A8%A1%E6%9D%BF.xlsx'
};
},
computed: {
......
......@@ -33,7 +33,7 @@
</template>
<script>
import PopInput from '@/components/pop-input-view';
import PopInput from '@/components/pop-input-view';
import LsjUpload from '@/components/lsj-upload/lsj-upload.vue';
import { mineBaseUrl } from '@/utils/config.js';
import { getToken } from '@/utils/common.js';
......
This diff is collapsed.
......@@ -394,7 +394,7 @@
}
};
</script>
<style>
<style lang="scss">
.lime-painter,
.lime-painter__canvas {
// #ifndef APP-NVUE
......@@ -404,4 +404,4 @@
flex: 1;
// #endif
}
</style>
</style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment