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

权限弹框

parent b12f6a1e
Pipeline #7838 canceled with stages
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
default: true default: true
}, },
//是否是原生头部 //是否是原生头部
isNativeHead:{ isNativeHead: {
type: Boolean, type: Boolean,
default: true default: true
}, },
...@@ -40,38 +40,43 @@ ...@@ -40,38 +40,43 @@
return { return {
ani: '', ani: '',
showPopup: false, showPopup: false,
StatusBar:'', StatusBar: '',
refuseNum:'',//拒绝次数, refuseNum: '', //拒绝次数,
authList: { authList: {
'WRITE_EXTERNAL_STORAGE': { 'WRITE_EXTERNAL_STORAGE': {
scopeText:"存储空间/照片", scopeText: "存储空间/照片",
title: "扳手快查对存储空间/照片权限申请说明", title: "扳手记账对存储空间/照片权限申请说明",
content: "便于您使用该功能上传您的照片/图片/视频/文件及用于更换头像、意见反馈、保存相册、上传资料/分享、下载与客服沟通等场景中读取和写入相册和文件内容。" content: "便于您使用该功能上传您的照片/图片/视频/文件及用于更换头像、意见反馈、保存相册、上传资料/分享、下载、与客服沟通等场景中读取和写入相册和文件内容。"
}, },
'READ_EXTERNAL_STORAGE': { 'READ_EXTERNAL_STORAGE': {
scopeText:"读取设备上的照片及文件", scopeText: "读取设备上的照片及文件",
title: "扳手快查对读取设备上的照片及文件权限申请说明", title: "扳手记账对读取设备上的照片及文件权限申请说明",
content: "便于您使用该功能上传您的照片/图片/视频/文件及用于更换头像、意见反馈、保存相册、上传资料/分享、下载与客服沟通等场景中读取相册和文件内容。" content: "便于您使用该功能上传您的照片/图片/视频/文件及用于更换头像、意见反馈、保存相册、上传资料/分享、下载、与客服沟通等场景中读取相册和文件内容。"
}, },
'ACCESS_FINE_LOCATION': { 'ACCESS_FINE_LOCATION': {
scopeText:"地理位置", scopeText: "地理位置",
title: "扳手快查对地理位置权限申请说明", title: "扳手记账对地理位置权限申请说明",
content: "便于应用程序可以提供基于位置的服务、定位导航、附近搜索等功能。" content: "便于应用程序可以提供基于位置的服务、定位导航、附近搜索等功能。"
}, },
'CAMERA':{ 'CAMERA': {
scopeText:"相机/摄像头", scopeText: "相机/摄像头",
title: "扳手快查对相机/摄像头权限申请说明", title: "扳手记账对相机/摄像头权限申请说明",
content: "便于您使用该功能拍照上传您的照片/视频及用于更换头像、意见反馈、保存相册、上传资料/动态、下载与客服沟通等场景中使用" content: "便于您使用该功能拍照上传您的照片/视频及用于更换头像、意见反馈、保存相册、上传资料/动态、下载与客服沟通等场景中使用"
}, },
'RECORD_AUDIO':{ 'RECORD_AUDIO': {
scopeText:"麦克风", scopeText: "麦克风",
title: "扳手快查对麦克风权限申请说明", title: "扳手记账对麦克风权限申请说明",
content: "便于您使用该功能进行录音、语音通话、发布语音、与客服语音沟通等场景中使用" content: "便于您使用该功能进行录音、语音通话、发布语音、与客服语音沟通等场景中使用"
}, },
'CALL_PHONE': { 'CALL_PHONE': {
scopeText:"拨打/管理电话", scopeText: "拨打/管理电话",
title: "扳手快查对拨打/管理电话权限申请说明", title: "扳手记账对拨打/管理电话权限申请说明",
content: "便于您使用该功能联系客服、讲师等场景下使用" content: "便于您使用该功能联系客服、讲师等场景下使用"
},
'WRITE_CONTACTS':{
scopeText: "通讯录",
title: "扳手记账对通讯录权限申请说明",
content: "便于您使用该功能保存到通讯录、使用通讯录等场景下使用"
} }
} }
} }
...@@ -87,7 +92,8 @@ ...@@ -87,7 +92,8 @@
let _this = this; let _this = this;
uni.getSystemInfo({ uni.getSystemInfo({
success: function(e) { success: function(e) {
_this.StatusBar = e.statusBarHeight + 'px'; //用于自定义头部时,给手机状态栏留出位置,可通过isNativeHead这个参数控制 _this.StatusBar = 44 + e.statusBarHeight +
'px'; //用于自定义头部时,给手机状态栏留出位置,可通过isNativeHead这个参数控制
} }
}) })
}, },
...@@ -117,7 +123,7 @@ ...@@ -117,7 +123,7 @@
_this.$nextTick(() => { _this.$nextTick(() => {
setTimeout(() => { setTimeout(() => {
_this.ani = 'uni-' + _this.type _this.ani = 'uni-' + _this.type
},30) }, 30)
}) })
} }
}, },
...@@ -134,7 +140,7 @@ ...@@ -134,7 +140,7 @@
_this.showPopup = false _this.showPopup = false
}, 0) }, 0)
}) })
console.log(e,'kkkkk') console.log(e, 'kkkkk')
if (e.granted.length > 0) { if (e.granted.length > 0) {
//当前查询权限已授权,此时可以通知页面执行接下来的操作 //当前查询权限已授权,此时可以通知页面执行接下来的操作
_this.$emit('changeAuth'); _this.$emit('changeAuth');
...@@ -202,7 +208,7 @@ ...@@ -202,7 +208,7 @@
result = 0; result = 0;
} }
plus.ios.deleteObject(contactStore); plus.ios.deleteObject(contactStore);
}else if(permissionID == 'RECORD_AUDIO'){ } else if (permissionID == 'RECORD_AUDIO') {
//IOS检测麦克风权限 //IOS检测麦克风权限
let aVAudioSession = plus.ios.importClass("AVAudioSession"), let aVAudioSession = plus.ios.importClass("AVAudioSession"),
aVAudio = aVAudioSession.sharedInstance(), aVAudio = aVAudioSession.sharedInstance(),
...@@ -272,34 +278,39 @@ ...@@ -272,34 +278,39 @@
right: 0; right: 0;
z-index: 99999; z-index: 99999;
overflow: hidden; overflow: hidden;
&__wrapper { &__wrapper {
position: absolute; position: absolute;
z-index: 999; z-index: 999;
/* #ifndef APP-NVUE */ /* #ifndef APP-NVUE */
box-sizing: border-box; box-sizing: border-box;
/* #endif */ /* #endif */
&.ani { &.ani {
/* #ifndef APP-NVUE */ /* #ifndef APP-NVUE */
transition: all 0.3s; transition: all 0.3s;
/* #endif */ /* #endif */
} }
&.top { &.top {
top: 0; top: 0;
width:705rpx; width: 705rpx;
/* #ifdef APP-NVUE */ /* #ifdef APP-NVUE */
left:22.5rpx; left: 22.5rpx;
/* #endif */ /* #endif */
/* #ifndef APP-NVUE */ /* #ifndef APP-NVUE */
left:0; left: 0;
transform: translateY(-705rpx); transform: translateY(-705rpx);
/* #endif */ /* #endif */
} }
&-box { &-box {
position: relative; position: relative;
/* #ifndef APP-NVUE */ /* #ifndef APP-NVUE */
box-sizing: border-box; box-sizing: border-box;
/* #endif */ /* #endif */
} }
&.uni-custom { &.uni-custom {
& .uni-popup__wrapper-box { & .uni-popup__wrapper-box {
width: 705rpx; width: 705rpx;
...@@ -313,22 +324,26 @@ ...@@ -313,22 +324,26 @@
box-sizing: border-box; box-sizing: border-box;
/* #endif */ /* #endif */
border-radius: 16rpx; border-radius: 16rpx;
.title{
.title {
font-size: 32rpx; font-size: 32rpx;
font-weight: bold; font-weight: bold;
} }
.content{
.content {
margin-top: 16rpx; margin-top: 16rpx;
line-height: 1.6; line-height: 1.6;
} }
} }
&.top{
&.top {
& .uni-popup__wrapper-box { & .uni-popup__wrapper-box {
width: 705rpx; width: 705rpx;
} }
} }
} }
&.uni-top{
&.uni-top {
transform: translateY(0); transform: translateY(0);
} }
} }
......
This diff is collapsed.
<template> <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> </template>
<script> <script>
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
}, },
click(e) { click(e) {
if(this.list[e]&&this.list[e].sourceType){ if(this.list[e]&&this.list[e].sourceType){
this.$emit("choose",this.list[e].sourceType) this.$emit("change",this.list[e].sourceType)
} }
}, },
handleClose() { 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 { ...@@ -247,7 +247,8 @@ export default {
// 若iOS端服务端处理不了跨域就将hybrid目录内的html放到服务端去,并将此处path改成服务器上的地址 // 若iOS端服务端处理不了跨域就将hybrid目录内的html放到服务端去,并将此处path改成服务器上的地址
// let path = '/uni_modules/lsj-upload/hybrid/html/uploadFile.html'; // let path = '/uni_modules/lsj-upload/hybrid/html/uploadFile.html';
// let path = '/components/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); let dom = this.lsjFile.create(path);
// #ifdef H5 // #ifdef H5
this.$refs.lsj.$el.appendChild(dom); this.$refs.lsj.$el.appendChild(dom);
......
<template> <template>
<UploadImages ref="upload-images" :max-count="maxCount" :width="width" :height="height" custom-btn <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"> @on-list-change="handleListChange">
<view slot="addBtn" class="slot-btn" hover-class="slot-btn__hover" :style="slotStyle" hover-stay-time="150"> <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> <u-icon name="plus" :size="addSize" color="#D8D8D8"></u-icon>
<ChooseImageSourceType :visible.sync="sourceTypeVisible" @change="sourceTypeChange" /> <BottomChoose ref="bottom-choose" @change="sourceTypeChange" />
</view> </view>
</UploadImages> </UploadImages>
</template> </template>
<script> <script>
import ChooseImageSourceType from '@/components/choose-image-source-type' import BottomChoose from '@/components/bottom-choose'
import upload from '@/utils/upload' import upload from '@/utils/upload'
import UploadImages from '@/components/upload/u-upload' import UploadImages from '@/components/upload/u-upload'
import { import {
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
export default { export default {
components: { components: {
UploadImages, UploadImages,
ChooseImageSourceType BottomChoose
}, },
props: { props: {
// 给fileList赋初始值用 // 给fileList赋初始值用
...@@ -65,12 +65,15 @@ ...@@ -65,12 +65,15 @@
type: Boolean, type: Boolean,
default: true default: true
}, },
isNativeHead:{
type: Boolean,
default: true
}
}, },
data() { data() {
return { return {
fileList: [], fileList: [],
qiniuToken: '', qiniuToken: '',
sourceTypeVisible: false,
sourceType: ['album', 'camera'] sourceType: ['album', 'camera']
} }
}, },
...@@ -109,8 +112,7 @@ ...@@ -109,8 +112,7 @@
}, },
methods: { methods: {
openSource() { openSource() {
this.sourceTypeVisible = true this.$refs['bottom-choose'].open()
console.log("openSource")
}, },
sourceTypeChange(source) { sourceTypeChange(source) {
this.sourceType = [source] this.sourceType = [source]
......
<template> <template>
<UploadImages <UploadImages ref="upload-images" :max-count="maxCount" :width="width" :height="height" custom-btn
ref="upload-images" :file-list="fileList" :auto-upload="autoUpload" :show-progress="false" :show-add="showAdd"
:max-count="maxCount" :isNativeHead="isNativeHead" :show-upload-list="showUploadList" :sourceType="sourceType"
:width="width" @openSource="openSource" @on-list-change="handleListChange" @on-choose-fail="onChooseFail">
:height="height" <view slot="addBtn">
custom-btn <view v-if="$slots.addBtn" class="slot-view" hover-class="slot-btn__hover">
:file-list="fileList" <slot name="addBtn" />
:auto-upload="autoUpload" </view>
:show-progress="false" <view v-else class="slot-btn" hover-class="slot-btn__hover" :style="slotStyle" hover-stay-time="150">
:show-add="showAdd"
:show-upload-list="showUploadList"
:sourceType="sourceType"
@openSource="openSource"
@on-list-change="handleListChange"
@on-choose-fail="onChooseFail"
>
<view v-if="$slots.addBtn" slot="addBtn" class="slot-view" hover-class="slot-btn__hover"><slot name="addBtn" /></view>
<view v-else 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> <u-icon name="plus" :size="addSize" color="#D8D8D8"></u-icon>
</view> </view>
<PopInput <BottomChoose ref="bottom-choose" @change="sourceTypeChange" />
title="提醒" </view>
type="text" <PopInput title="提醒" type="text" sureText="前往设置" cancelText="返回" :showCancel="true" :content="uploadConent"
sureText="前往设置" :visible.sync="showConfirm" @cancel="handleCancel" @click="handleConfirm" />
cancelText="返回"
:showCancel="true"
:content="uploadConent"
:visible.sync="showConfirm"
@cancel="handleCancel"
@click="handleConfirm"
/>
<ChooseImageSourceType :visible.sync="sourceTypeVisible" @change="sourceTypeChange" />
</UploadImages> </UploadImages>
</template> </template>
<script> <script>
import PopInput from '@/components/pop-input-view'; import PopInput from '@/components/pop-input-view';
import ChooseImageSourceType from '@/components/choose-image-source-type' import BottomChoose from '@/components/bottom-choose'
import upload from '@/utils/upload'; import upload from '@/utils/upload';
import UploadImages from '@/components/upload/u-upload'; import UploadImages from '@/components/upload/u-upload';
import { getQiNiuToken } from '@/api/common/index.js'; import {
import { UPLOAD_FILE_HOST } from '@/utils/config.js'; getQiNiuToken
import permision from '@/js_sdk/wa-permission/permission.js'; } from '@/api/common/index.js';
import { mapGetters } from 'vuex'; import {
import { showModal } from '@/utils/auth.js'; UPLOAD_FILE_HOST
} from '@/utils/config.js';
import permision from '@/js_sdk/wa-permission/permission.js';
import {
mapGetters
} from 'vuex';
import {
showModal
} from '@/utils/auth.js';
export default { export default {
components: { components: {
UploadImages, UploadImages,
PopInput, PopInput,
ChooseImageSourceType BottomChoose
}, },
props: { props: {
// 给fileList赋初始值用 // 给fileList赋初始值用
list: { list: {
type: Array, type: Array,
default() { default () {
return []; return [];
} }
}, },
...@@ -90,6 +81,10 @@ export default { ...@@ -90,6 +81,10 @@ export default {
showAdd: { showAdd: {
type: Boolean, type: Boolean,
default: true default: true
},
isNativeHead: {
type: Boolean,
default: true
} }
}, },
data() { data() {
...@@ -99,7 +94,6 @@ export default { ...@@ -99,7 +94,6 @@ export default {
showUploadList: false, showUploadList: false,
uploadConent: '需要使用相机权限,请前往设置。', uploadConent: '需要使用相机权限,请前往设置。',
showConfirm: false, showConfirm: false,
sourceTypeVisible: false,
sourceType: ['album', 'camera'] sourceType: ['album', 'camera']
}; };
}, },
...@@ -139,11 +133,12 @@ export default { ...@@ -139,11 +133,12 @@ export default {
}, },
methods: { methods: {
openSource() { openSource() {
this.sourceTypeVisible = true this.$refs['bottom-choose'].open()
}, },
sourceTypeChange(source) { sourceTypeChange(source) {
console.log("sourceTypeChange", source)
this.sourceType = [source] this.sourceType = [source]
this.$refs['upload-images'].appStratChoose() this.$refs['upload-images'].appStratChoose(this.sourceType)
}, },
filterList(listA, listB) { filterList(listA, listB) {
listA = listA || []; listA = listA || [];
...@@ -194,11 +189,13 @@ export default { ...@@ -194,11 +189,13 @@ export default {
// 触发选择图片;不能改文件名,外部要调 // 触发选择图片;不能改文件名,外部要调
this.$refs['upload-images'].selectFile(); this.$refs['upload-images'].selectFile();
}, },
onChooseFail(error){ onChooseFail(error) {
console.log("onChooseFail:",error); console.log("onChooseFail:", error);
let {errCode}=error let {
if(errCode===11){ errCode
if (this.platform === '4' ) { } = error
if (errCode === 11) {
if (this.platform === '4') {
this.appAskAuth() this.appAskAuth()
} }
} }
...@@ -207,18 +204,18 @@ export default { ...@@ -207,18 +204,18 @@ export default {
async appAskAuth() { async appAskAuth() {
console.log('appAskAuth'); console.log('appAskAuth');
try { try {
if(this.isIOS){ if (this.isIOS) {
let res =await permision.judgeIosPermissionPhotoLibrary(); let res = await permision.judgeIosPermissionPhotoLibrary();
if (!res) { if (!res) {
this.showConfirm = true; this.showConfirm = true;
} }
}else{ } else {
let res=await permision.requestAndroidPermission('android.permission.CAMERA'); let res = await permision.requestAndroidPermission('android.permission.CAMERA');
console.log('appAskAuth:res',res); console.log('appAskAuth:res', res);
if (res!==1) { if (res !== 1) {
showModal({ showModal({
content:this.uploadConent, content: this.uploadConent,
callback:()=>{ callback: () => {
this.handleConfirm() this.handleConfirm()
} }
}) })
...@@ -232,19 +229,19 @@ export default { ...@@ -232,19 +229,19 @@ export default {
handleConfirm() { handleConfirm() {
permision.gotoAppPermissionSetting(); permision.gotoAppPermissionSetting();
}, },
handleCancel() { handleCancel() {}
}
} }
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
/deep/.u-add-tips { /deep/.u-add-tips {
height: 0 !important; height: 0 !important;
margin-top: 0 !important; margin-top: 0 !important;
overflow: hidden; overflow: hidden;
} }
.slot-btn {
.slot-btn {
width: 160rpx; width: 160rpx;
height: 160rpx; height: 160rpx;
display: flex; display: flex;
...@@ -253,9 +250,9 @@ export default { ...@@ -253,9 +250,9 @@ export default {
background: #f6f7fa; background: #f6f7fa;
border-radius: 10rpx; border-radius: 10rpx;
// margin: 10rpx; // margin: 10rpx;
} }
.slot-btn__hover { .slot-btn__hover {
background-color: rgb(235, 236, 238); background-color: rgb(235, 236, 238);
} }
</style> </style>
\ No newline at end of file
...@@ -48,6 +48,7 @@ ...@@ -48,6 +48,7 @@
<view class="u-add-tips">{{ uploadText }}</view> <view class="u-add-tips">{{ uploadText }}</view>
</view> </view>
</view> </view>
<AuthPopup ref="authpup" type="top" :isNativeHead="isNativeHead" @changeAuth="changeAuth" :permissionID="permissionID" />
</view> </view>
</template> </template>
...@@ -267,6 +268,10 @@ export default { ...@@ -267,6 +268,10 @@ export default {
index: { index: {
type: [Number, String], type: [Number, String],
default: '' default: ''
},
isNativeHead:{
type: Boolean,
default: true
} }
}, },
mounted() { mounted() {
...@@ -332,7 +337,6 @@ export default { ...@@ -332,7 +337,6 @@ export default {
}, },
// 选择图片 // 选择图片
selectFile() { selectFile() {
console.log("stratChoose")
// #ifdef APP-PLUS // #ifdef APP-PLUS
this.$emit("openSource") this.$emit("openSource")
// #endif // #endif
......
...@@ -30,7 +30,8 @@ ...@@ -30,7 +30,8 @@
"Push" : {}, "Push" : {},
"Share" : {}, "Share" : {},
"Contacts" : {}, "Contacts" : {},
"Camera" : {} "Camera" : {},
"Record" : {}
}, },
"safearea" : { "safearea" : {
"bottom" : { "bottom" : {
...@@ -64,7 +65,8 @@ ...@@ -64,7 +65,8 @@
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>", "<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
"<uses-permission android:name=\"android.permission.WRITE_CONTACTS\"/>", "<uses-permission android:name=\"android.permission.WRITE_CONTACTS\"/>",
"<uses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\"/>", "<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" ], "abiFilters" : [ "armeabi-v7a", "arm64-v8a", "x86" ],
"autoSdkPermissions" : false, "autoSdkPermissions" : false,
...@@ -130,10 +132,10 @@ ...@@ -130,10 +132,10 @@
}, },
"geolocation" : { "geolocation" : {
"amap" : { "amap" : {
"name" : "amap5kOhMYHO",
"__platform__" : [ "ios", "android" ], "__platform__" : [ "ios", "android" ],
"appkey_ios" : "a808d665af78906c3e2f0b1b28ea17ed", "appkey_ios" : "a808d665af78906c3e2f0b1b28ea17ed",
"appkey_android" : "6f92327cbdcd93ca769a62676ba69e78", "appkey_android" : "6f92327cbdcd93ca769a62676ba69e78"
"name" : "amap5kOhMYHO"
} }
}, },
"push" : { "push" : {
...@@ -231,6 +233,7 @@ ...@@ -231,6 +233,7 @@
"optimization" : { "optimization" : {
"subPackages" : true "subPackages" : true
}, },
"libVersion" : "latest",
"__usePrivacyCheck__" : true "__usePrivacyCheck__" : true
}, },
"mp-alipay" : { "mp-alipay" : {
......
This diff is collapsed.
...@@ -63,10 +63,12 @@ ...@@ -63,10 +63,12 @@
</view> </view>
<u-toast ref="uToast" /> <u-toast ref="uToast" />
<BottomShare :visible.sync="showShare" @click="handleClickShare" /> <BottomShare :visible.sync="showShare" @click="handleClickShare" />
<AuthPopup ref="authpup" type="top" :isNativeHead="false" @changeAuth="changeAuth" :permissionID="permissionID" />
</view> </view>
</template> </template>
<script> <script>
import AuthPopup from '@/components/auth-popup'
import NavbarRight from '@/components/navbar-right'; import NavbarRight from '@/components/navbar-right';
import NoData from '@/components/no-data'; import NoData from '@/components/no-data';
import CardSwiper from '@/components/cell-card-swiper'; import CardSwiper from '@/components/cell-card-swiper';
...@@ -79,6 +81,7 @@ import { checkPermision } from '@/utils/app-plus-auth.js'; ...@@ -79,6 +81,7 @@ import { checkPermision } from '@/utils/app-plus-auth.js';
export default { export default {
components: { components: {
AuthPopup,
NavbarRight, NavbarRight,
NoData, NoData,
CardSwiper, CardSwiper,
...@@ -101,7 +104,8 @@ export default { ...@@ -101,7 +104,8 @@ export default {
loadingCard: false, loadingCard: false,
currentIndex: 0, currentIndex: 0,
shareImage: '', shareImage: '',
showShare: false showShare: false,
permissionID:'WRITE_EXTERNAL_STORAGE'
}; };
}, },
computed: { computed: {
...@@ -275,6 +279,18 @@ export default { ...@@ -275,6 +279,18 @@ export default {
this.currentIndex = index; this.currentIndex = index;
this.reloadList(); this.reloadList();
}, },
//打开自定义权限目的弹框
openAuth() {
setTimeout(() => {
this.$refs['authpup'].open();
}, 500)
},
//用户授权权限后的回调
changeAuth() {
//这里是权限通过后执行自己的代码逻辑
console.log('权限已授权,可执行自己的代码逻辑了');
this.saveImage()
},
handleClickTool(index) { handleClickTool(index) {
if (index == 0) { if (index == 0) {
this.$u.route({ this.$u.route({
...@@ -285,17 +301,10 @@ export default { ...@@ -285,17 +301,10 @@ export default {
}); });
} else if (index == 1) { } else if (index == 1) {
// #ifdef APP-PLUS // #ifdef APP-PLUS
// checkPermision({
// permissionID: 'photoLibrary'
// }).then(() => {
// this.saveImage();
// }).catch(()=>{})
if(this.isIOS){ if(this.isIOS){
this.saveImage(); this.saveImage();
}else{ }else{
getSetting('android.permission.WRITE_EXTERNAL_STORAGE', '检测到您没打开保存到相册功能权限,是否去设置打开?', res => { this.openAuth()
this.saveImage();
});
} }
// #endif // #endif
// #ifdef MP-WEIXIN // #ifdef MP-WEIXIN
......
...@@ -55,13 +55,16 @@ ...@@ -55,13 +55,16 @@
<!-- </view> --> <!-- </view> -->
<view class="loading-view" v-if="loading"><u-loading mode="flower"></u-loading></view> <view class="loading-view" v-if="loading"><u-loading mode="flower"></u-loading></view>
<u-toast ref="uToast" /> <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> </view>
</template> </template>
<script> <script>
import BottomChoose from '@/components/common/ab-upload/components/bottom-choose.vue'; import SingleImages from '@/components/upload/single.vue';
import chooseImageMixin from '@/components/common/ab-upload/js/chooseImageMixin.js';
import NavbarRight from '@/components/navbar-right'; import NavbarRight from '@/components/navbar-right';
import upload from '@/utils/upload'; import upload from '@/utils/upload';
import { getQiNiuToken } from '@/api/common/index.js'; import { getQiNiuToken } from '@/api/common/index.js';
...@@ -75,9 +78,8 @@ export default { ...@@ -75,9 +78,8 @@ export default {
components: { components: {
NavbarRight, NavbarRight,
PayeeImages, PayeeImages,
BottomChoose SingleImages
}, },
mixins: [chooseImageMixin],
data() { data() {
return { return {
info: { info: {
...@@ -88,6 +90,8 @@ export default { ...@@ -88,6 +90,8 @@ export default {
currentIndex: 0, currentIndex: 0,
value: '', value: '',
loading: false, loading: false,
uploading: false,
fileList: [],
list: [] list: []
}; };
}, },
...@@ -227,56 +231,25 @@ export default { ...@@ -227,56 +231,25 @@ export default {
formatCount(count) { formatCount(count) {
return 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() { handleClickCodeImage() {
if (this.info[this.currentSetting.type].url) { if (this.info[this.currentSetting.type].url) {
this.addCode(); this.addCode();
} }
}, },
beforeChooseImage() { beforeChooseImage() {
if (uni.$u.platform === '4') { this.$refs['single-images'].selectFile()
this.openChoose();
} else {
this.chooseImage();
}
},
openChoose() {
this.$refs['bottom-choose'].open();
}, },
bottomChoose(sourceType) {
this.sculpture(sourceType);
},
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() { initList() {
var array = []; var array = [];
for (var key in this.info) { for (var key in this.info) {
...@@ -299,7 +272,12 @@ export default { ...@@ -299,7 +272,12 @@ export default {
flex-direction: column; flex-direction: column;
height: 100vh; height: 100vh;
background-color: #f6f7fa; background-color: #f6f7fa;
overflow: hidden;
.upload-images{
position: fixed;
left: -200%;
top: 0;
}
// .content-view { // .content-view {
// margin: 24rpx 24rpx 0rpx 24rpx; // margin: 24rpx 24rpx 0rpx 24rpx;
// border-radius: 16rpx; // border-radius: 16rpx;
......
...@@ -2,36 +2,28 @@ ...@@ -2,36 +2,28 @@
<view class="u-swiper-wrap" :style="{ <view class="u-swiper-wrap" :style="{
borderRadius: `${borderRadius}rpx` borderRadius: `${borderRadius}rpx`
}"> }">
<swiper :current="elCurrent" @change="change" @animationfinish="animationfinish" :interval="interval" :circular="circular" :duration="duration" :autoplay="autoplay" <swiper :current="elCurrent" @change="change" @animationfinish="animationfinish" :interval="interval"
:previous-margin="effect3d ? effect3dPreviousMargin + 'rpx' : '0'" :next-margin="effect3d ? effect3dPreviousMargin + 'rpx' : '0'" :circular="circular" :duration="duration" :autoplay="autoplay"
:style="{ :previous-margin="effect3d ? effect3dPreviousMargin + 'rpx' : '0'"
:next-margin="effect3d ? effect3dPreviousMargin + 'rpx' : '0'" :style="{
height: height + 'rpx', height: height + 'rpx',
backgroundColor: bgColor backgroundColor: bgColor
}"> }">
<swiper-item class="u-swiper-item" v-for="(item, index) in list" :key="index"> <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`, borderRadius: `${borderRadius}rpx`,
transform: effect3d && uCurrent != index ? 'scaleY(0.9)' : 'scaleY(1)', transform: effect3d && uCurrent != index ? 'scaleY(0.9)' : 'scaleY(1)',
margin: effect3d && uCurrent != index ? '0 20rpx' : 0, margin: effect3d && uCurrent != index ? '0 20rpx' : 0,
}"> }">
<view class="code-view"> <view class="code-view">
<view <view class="code-image-view" hover-class="u-hover-class"
class="code-image-view" @click.stop.prevent="$u.throttle(addCode, 500)">
hover-class="u-hover-class" <image mode="widthFix" :src="item.url || item.default"></image>
@click.stop.prevent="$u.throttle(addCode, 500)"
>
<image
mode="widthFix"
:src="item.url || item.default"
></image>
</view> </view>
<view class="middle-view"> <view class="middle-view">
<view <view v-if="!item.url" class="add-view" hover-class="u-hover-class"
v-if="!item.url" @click.stop.prevent="$u.throttle(addCode, 500)">
class="add-view"
hover-class="u-hover-class"
@click.stop.prevent="$u.throttle(addCode, 500)"
>
<image class="add-view-image" :src="item.addUrl"></image> <image class="add-view-image" :src="item.addUrl"></image>
</view> </view>
</view> </view>
...@@ -46,16 +38,16 @@ ...@@ -46,16 +38,16 @@
padding: `0 ${effect3d ? '74rpx' : '24rpx'}` padding: `0 ${effect3d ? '74rpx' : '24rpx'}`
}"> }">
<block v-if="mode == 'rect'"> <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" <view class="u-indicator-item-rect" :class="{ 'u-indicator-item-rect-active': index == uCurrent }"
:key="index"></view> v-for="(item, index) in list" :key="index"></view>
</block> </block>
<block v-if="mode == 'dot'"> <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" <view class="u-indicator-item-dot" :class="{ 'u-indicator-item-dot-active': index == uCurrent }"
:key="index"></view> v-for="(item, index) in list" :key="index"></view>
</block> </block>
<block v-if="mode == 'round'"> <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" <view class="u-indicator-item-round" :class="{ 'u-indicator-item-round-active': index == uCurrent }"
:key="index"></view> v-for="(item, index) in list" :key="index"></view>
</block> </block>
<block v-if="mode == 'number'"> <block v-if="mode == 'number'">
<view class="u-indicator-item-number">{{ uCurrent + 1 }}/{{ list.length }}</view> <view class="u-indicator-item-number">{{ uCurrent + 1 }}/{{ list.length }}</view>
...@@ -181,7 +173,7 @@ ...@@ -181,7 +173,7 @@
// 标题的样式,对象形式 // 标题的样式,对象形式
titleStyle: { titleStyle: {
type: Object, type: Object,
default() { default () {
return {} return {}
} }
} }
...@@ -189,7 +181,7 @@ ...@@ -189,7 +181,7 @@
watch: { watch: {
// 如果外部的list发生变化,判断长度是否被修改,如果前后长度不一致,重置uCurrent值,避免溢出 // 如果外部的list发生变化,判断长度是否被修改,如果前后长度不一致,重置uCurrent值,避免溢出
list(nVal, oVal) { list(nVal, oVal) {
if(nVal.length !== oVal.length) this.uCurrent = 0; if (nVal.length !== oVal.length) this.uCurrent = 0;
}, },
// 监听外部current的变化,实时修改内部依赖于此测uCurrent值,如果更新了current,而不是更新uCurrent, // 监听外部current的变化,实时修改内部依赖于此测uCurrent值,如果更新了current,而不是更新uCurrent,
// 就会错乱,因为指示器是依赖于uCurrent的 // 就会错乱,因为指示器是依赖于uCurrent的
...@@ -211,9 +203,11 @@ ...@@ -211,9 +203,11 @@
titlePaddingBottom() { titlePaddingBottom() {
let tmp = 0; let tmp = 0;
if (this.mode == 'none') return '12rpx'; 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'; 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'; tmp = '40rpx';
} else { } else {
tmp = '12rpx'; tmp = '12rpx';
...@@ -237,11 +231,11 @@ ...@@ -237,11 +231,11 @@
this.uCurrent = current; this.uCurrent = current;
// 发出change事件,表示当前自动切换的index,从0开始 // 发出change事件,表示当前自动切换的index,从0开始
this.$emit('change', current); this.$emit('change', current);
this.$nextTick(()=> { this.$nextTick(() => {
const query = uni.createSelectorQuery().in(this) const query = uni.createSelectorQuery().in(this)
query query
.select('.code-image-view') .select('.code-image-view')
.boundingClientRect( (data) => { .boundingClientRect((data) => {
console.log('-------------', data) console.log('-------------', data)
}) })
.exec() .exec()
...@@ -265,7 +259,8 @@ ...@@ -265,7 +259,8 @@
display: flex; display: flex;
flex-direction: $direction; flex-direction: $direction;
/* #endif */ /* #endif */
} }
.u-swiper-wrap { .u-swiper-wrap {
position: relative; position: relative;
overflow: hidden; overflow: hidden;
...@@ -370,10 +365,12 @@ ...@@ -370,10 +365,12 @@
overflow: hidden; overflow: hidden;
align-items: center; align-items: center;
} }
.code-view { .code-view {
height: 100%; height: 100%;
overflow-y:auto; overflow-y: auto;
} }
.code-image-view { .code-image-view {
position: relative; position: relative;
width: 702rpx; width: 702rpx;
...@@ -381,6 +378,7 @@ ...@@ -381,6 +378,7 @@
border-radius: 16rpx; border-radius: 16rpx;
overflow: hidden; overflow: hidden;
} }
.middle-view { .middle-view {
position: absolute; position: absolute;
display: flex; display: flex;
......
...@@ -7,9 +7,7 @@ ...@@ -7,9 +7,7 @@
</view> </view>
<CardBack :info="info" /> <CardBack :info="info" />
</view> </view>
<view class="loading-view" v-if="loading" <view class="loading-view" v-if="loading"><u-loading mode="flower"></u-loading></view>
><u-loading mode="flower"></u-loading
></view>
<view class="bottom-view" v-if="cardId"> <view class="bottom-view" v-if="cardId">
<view class="left-view"> <view class="left-view">
<u-button :custom-style="customCall" @click="handleClickCall"> <u-button :custom-style="customCall" @click="handleClickCall">
...@@ -20,12 +18,8 @@ ...@@ -20,12 +18,8 @@
</u-button> </u-button>
</view> </view>
<view class="right-view"> <view class="right-view">
<u-button <u-button type="success" :custom-style="customConFirm" @click="handleClickConfirm"
type="success" class="confirm-button">
:custom-style="customConFirm"
@click="handleClickConfirm"
class="confirm-button"
>
<view class="image-view"> <view class="image-view">
<image :src="cunrutongxunluImage"></image> <image :src="cunrutongxunluImage"></image>
</view> </view>
...@@ -33,25 +27,33 @@ ...@@ -33,25 +27,33 @@
</u-button> </u-button>
</view> </view>
</view> </view>
<AuthPopup ref="authpup" type="top" :isNativeHead="false" @changeAuth="changeAuth"
:permissionID="permissionID" />
<u-toast ref="uToast" /> <u-toast ref="uToast" />
</view> </view>
</template> </template>
<script> <script>
import NavbarRight from '@/components/navbar-right' import AuthPopup from '@/components/auth-popup'
import Card from '@/components/cell-card' import NavbarRight from '@/components/navbar-right'
import CardBack from '@/components/cell-card-back' import Card from '@/components/cell-card'
import { getSetting } from '@/utils/common.js'; import CardBack from '@/components/cell-card-back'
import { import {
getSetting
} from '@/utils/common.js';
import {
getBusinessCard, getBusinessCard,
getBusinessCardSelf, getBusinessCardSelf,
operateCall, operateCall,
operateView, operateView,
operateJoinList, operateJoinList,
} from '@/api/card/index.js' } from '@/api/card/index.js'
import { mapGetters } from 'vuex' import {
export default { mapGetters
} from 'vuex'
export default {
components: { components: {
AuthPopup,
NavbarRight, NavbarRight,
Card, Card,
CardBack, CardBack,
...@@ -61,10 +63,11 @@ export default { ...@@ -61,10 +63,11 @@ export default {
cardId: '', cardId: '',
info: {}, info: {},
loading: false, loading: false,
permissionID: 'WRITE_EXTERNAL_STORAGE'
} }
}, },
computed: { computed: {
...mapGetters(['userInfo','isIOS']), ...mapGetters(['userInfo', 'isIOS']),
baseUrl() { baseUrl() {
return process.uniEnv.qn_base_url return process.uniEnv.qn_base_url
}, },
...@@ -107,13 +110,14 @@ export default { ...@@ -107,13 +110,14 @@ export default {
// 扫码进的 // 扫码进的
const q = decodeURIComponent(options.q) const q = decodeURIComponent(options.q)
this.getCardId(q) this.getCardId(q)
this.operateView()
} else { } else {
if (options && options.cardId) { if (options && options.cardId) {
this.cardId = options.cardId this.cardId = options.cardId
this.operateView()
} }
} }
this.getBusinessCard() this.getBusinessCard()
this.operateView()
}, },
onShow() {}, onShow() {},
methods: { methods: {
...@@ -132,7 +136,9 @@ export default { ...@@ -132,7 +136,9 @@ export default {
getBusinessCard() { getBusinessCard() {
this.loading = true this.loading = true
if (this.cardId) { if (this.cardId) {
getBusinessCard({ id: this.cardId }) getBusinessCard({
id: this.cardId
})
.then((res) => { .then((res) => {
if (res.data) { if (res.data) {
this.info = res.data this.info = res.data
...@@ -192,21 +198,48 @@ export default { ...@@ -192,21 +198,48 @@ export default {
}) })
}, },
handleClickCall() { handleClickCall() {
// #ifdef APP-PLUS
if (this.isIOS) {
this.makePhoneCall();
} else {
this.openAuth('CALL_PHONE')
}
// #endif
// #ifndef APP-PLUS
this.makePhoneCall()
// #endif
},
makePhoneCall(){
if (this.info.phone) { if (this.info.phone) {
this.operateCall()
uni.makePhoneCall({ uni.makePhoneCall({
phoneNumber: this.info.phone, phoneNumber: this.info.phone
}) })
} }
this.operateCall() },
//打开自定义权限目的弹框
openAuth(permissionID) {
this.permissionID = permissionID
setTimeout(() => {
this.$refs['authpup'].open();
}, 500)
},
//用户授权权限后的回调
changeAuth() {
//这里是权限通过后执行自己的代码逻辑
console.log('权限已授权,可执行自己的代码逻辑了');
if(this.permissionID==='CALL_PHONE'){
this.makePhoneCall()
}else if(this.permissionID==='WRITE_CONTACTS'){
this.addPhoneContact()
}
}, },
handleClickConfirm() { handleClickConfirm() {
// #ifdef APP-PLUS // #ifdef APP-PLUS
if(this.isIOS){ if (this.isIOS) {
this.addPhoneContact(); this.addPhoneContact();
}else{ } else {
getSetting('android.permission.WRITE_CONTACTS', '检测到您没打开添加到通讯录功能权限,是否去设置打开?', res => { this.openAuth('WRITE_CONTACTS')
this.addPhoneContact();
});
} }
// #endif // #endif
// #ifdef MP-WEIXIN // #ifdef MP-WEIXIN
...@@ -236,8 +269,9 @@ export default { ...@@ -236,8 +269,9 @@ export default {
fail: (err) => { fail: (err) => {
console.log('----fail----', err) console.log('----fail----', err)
// #ifdef APP-PLUS // #ifdef APP-PLUS
if(this.isIOS){ if (this.isIOS) {
getSetting('android.permission.WRITE_CONTACTS', '检测到您没打开添加到通讯录功能权限,是否去设置打开?', res => { getSetting('contact', '检测到您没打开添加到通讯录功能权限,是否去设置打开?',
res => {
this.addPhoneContact(); this.addPhoneContact();
}); });
} }
...@@ -263,37 +297,43 @@ export default { ...@@ -263,37 +297,43 @@ export default {
} }
}, },
}, },
} }
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.card-share { .card-share {
/deep/.u-btn { /deep/.u-btn {
padding: 0 !important; padding: 0 !important;
} }
position: relative; position: relative;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
height: 100vh; height: 100vh;
background-color: #f6f7fa; background-color: #f6f7fa;
.content-view { .content-view {
position: relative; position: relative;
height: 100%; height: 100%;
overflow: auto; overflow: auto;
padding: 24rpx 24rpx 44rpx 24rpx; padding: 24rpx 24rpx 44rpx 24rpx;
.card-view { .card-view {
margin-bottom: 24rpx; margin-bottom: 24rpx;
} }
} }
.bottom-view { .bottom-view {
position: relative; position: relative;
margin: 16rpx 24rpx 36rpx 24rpx; margin: 16rpx 24rpx 36rpx 24rpx;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
.left-view { .left-view {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
.image-view { .image-view {
width: 32rpx; width: 32rpx;
height: 32rpx; height: 32rpx;
...@@ -302,6 +342,7 @@ export default { ...@@ -302,6 +342,7 @@ export default {
align-items: center; align-items: center;
justify-content: center; justify-content: center;
} }
.scan-view { .scan-view {
color: #02a074; color: #02a074;
height: 104rpx; height: 104rpx;
...@@ -317,6 +358,7 @@ export default { ...@@ -317,6 +358,7 @@ export default {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
.image-view { .image-view {
width: 32rpx; width: 32rpx;
height: 32rpx; height: 32rpx;
...@@ -325,6 +367,7 @@ export default { ...@@ -325,6 +367,7 @@ export default {
align-items: center; align-items: center;
justify-content: center; justify-content: center;
} }
.confirm-view { .confirm-view {
color: #ffffff; color: #ffffff;
height: 104rpx; height: 104rpx;
...@@ -334,6 +377,7 @@ export default { ...@@ -334,6 +377,7 @@ export default {
} }
} }
} }
.loading-view { .loading-view {
width: 100%; width: 100%;
background-color: transparent; background-color: transparent;
...@@ -344,5 +388,5 @@ export default { ...@@ -344,5 +388,5 @@ export default {
left: 0; left: 0;
position: fixed; position: fixed;
} }
} }
</style> </style>
\ No newline at end of file
This diff is collapsed.
...@@ -114,7 +114,7 @@ ...@@ -114,7 +114,7 @@
:custom-style="customStyle" :custom-style="customStyle"
:placeholder-style="placeholderStyle" :placeholder-style="placeholderStyle"
v-model="form.address" v-model="form.address"
placeholder="选择地址" :placeholder="platform==='4'?'输入地址':'选择地址'"
/> />
</view> </view>
<view class="location-view" hover-class="u-hover-class" @click="$u.throttle(getAddress, 500)"> <view class="location-view" hover-class="u-hover-class" @click="$u.throttle(getAddress, 500)">
...@@ -616,14 +616,14 @@ export default { ...@@ -616,14 +616,14 @@ export default {
this.chooseLocation(); this.chooseLocation();
}); });
} else { } else {
try { // try {
await checkOpenService(); // await checkOpenService();
await checkOpenPermission(); // await checkOpenPermission();
this.chooseLocation(); // this.chooseLocation();
} catch (e) { // } catch (e) {
console.log(e); // console.log(e);
//TODO handle the exception // //TODO handle the exception
} // }
} }
}, },
chooseLocation() { chooseLocation() {
......
...@@ -22,10 +22,13 @@ ...@@ -22,10 +22,13 @@
分享 分享
</u-button> </u-button>
</view> </view>
<AuthPopup ref="authpup" type="top" :isNativeHead="false" @changeAuth="changeAuth"
:permissionID="permissionID" />
</view> </view>
</template> </template>
<script> <script>
import AuthPopup from '@/components/auth-popup'
import NavbarRight from '@/components/navbar-right'; import NavbarRight from '@/components/navbar-right';
import { import {
wxMiniId, wxMiniId,
...@@ -39,6 +42,7 @@ ...@@ -39,6 +42,7 @@
} from 'vuex'; } from 'vuex';
export default { export default {
components: { components: {
AuthPopup,
NavbarRight, NavbarRight,
}, },
data() { data() {
...@@ -63,6 +67,7 @@ ...@@ -63,6 +67,7 @@
}, },
printer: null, // 打印 printer: null, // 打印
fromShare:false, fromShare:false,
permissionID: ''
}; };
}, },
computed: { computed: {
...@@ -129,9 +134,29 @@ ...@@ -129,9 +134,29 @@
url: "" 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() { handleClickPrint() {
getSetting('android.permission.WRITE_EXTERNAL_STORAGE', '检测到您没打开文件写入权限,是否去设置打开?', res => { this.openAuth('WRITE_EXTERNAL_STORAGE')
getSetting('android.permission.READ_EXTERNAL_STORAGE', '检测到您没打开文件读取权限,是否去设置打开?', res => { },
savePrint(){
uni.getImageInfo({ uni.getImageInfo({
src: this.printUrl, src: this.printUrl,
success: (image) => { success: (image) => {
...@@ -141,8 +166,6 @@ ...@@ -141,8 +166,6 @@
}); });
} }
}); });
});
});
}, },
handleClickShare() { handleClickShare() {
if (this.platform === '4') { if (this.platform === '4') {
......
...@@ -187,15 +187,19 @@ ...@@ -187,15 +187,19 @@
</view> </view>
</template> </template>
</view> </view>
<!-- #ifdef MP-WEIXIN -->
<zero-privacy color="#02a074" :onNeed="false" :hideTabBar="false" @agree="handleAgree"></zero-privacy> <zero-privacy color="#02a074" :onNeed="false" :hideTabBar="false" @agree="handleAgree"></zero-privacy>
<!-- #endif -->
<PopImage :visible.sync="visible" :title="shareTitle" :url="path" @confirm="handleClickConform" /> <PopImage :visible.sync="visible" :title="shareTitle" :url="path" @confirm="handleClickConform" />
<QRCodeView :url="shareUrl" @canvas="handleCanvas" /> <QRCodeView :url="shareUrl" @canvas="handleCanvas" />
<u-toast ref="uToast" /> <u-toast ref="uToast" />
<l-painter :board="poster" isCanvasToTempFilePath @success="handleCanvasSuccess" @fail="handleCanvasFail" custom-style="position: fixed; left: 200%" /> <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> </view>
</template> </template>
<script> <script>
import AuthPopup from '@/components/auth-popup'
import NavbarRight from '@/components/navbar-right'; import NavbarRight from '@/components/navbar-right';
import PopImage from '@/components/pop-qrCode-image'; import PopImage from '@/components/pop-qrCode-image';
import QRCodeView from '@/components/qr-code-view'; import QRCodeView from '@/components/qr-code-view';
...@@ -212,6 +216,7 @@ import { tableOptions } from '@/utils/options/maintain-bill/index.js'; ...@@ -212,6 +216,7 @@ import { tableOptions } from '@/utils/options/maintain-bill/index.js';
export default { export default {
components: { components: {
AuthPopup,
NavbarRight, NavbarRight,
PopImage, PopImage,
QRCodeView, QRCodeView,
...@@ -233,7 +238,8 @@ export default { ...@@ -233,7 +238,8 @@ export default {
currentBlock: () => {}, currentBlock: () => {},
billImageUrl: '', billImageUrl: '',
customerId: '', customerId: '',
canvasType: 'save' canvasType: 'save',
permissionID:'WRITE_EXTERNAL_STORAGE'
}; };
}, },
computed: { computed: {
...@@ -426,6 +432,9 @@ export default { ...@@ -426,6 +432,9 @@ export default {
}, },
onShow() {}, onShow() {},
methods: { methods: {
handleAgree() {
uni.setStorageSync("PRIVACY-AGREE", 'YES');
},
initOptions(q) { initOptions(q) {
var array = q.split('?'); var array = q.split('?');
if (array.length > 1) { if (array.length > 1) {
...@@ -597,6 +606,18 @@ export default { ...@@ -597,6 +606,18 @@ export default {
type: 'switchTab' type: 'switchTab'
}); });
}, },
//打开自定义权限目的弹框
openAuth() {
setTimeout(() => {
this.$refs['authpup'].open();
}, 500)
},
//用户授权权限后的回调
changeAuth() {
//这里是权限通过后执行自己的代码逻辑
console.log('权限已授权,可执行自己的代码逻辑了');
this.saveBillImage()
},
handleClickSave() { handleClickSave() {
this.canvasType = 'save'; this.canvasType = 'save';
this.currentBlock = url => { this.currentBlock = url => {
...@@ -640,9 +661,7 @@ export default { ...@@ -640,9 +661,7 @@ export default {
if (this.isIOS) { if (this.isIOS) {
this.saveBillImage(); this.saveBillImage();
} else { } else {
getSetting('android.permission.WRITE_EXTERNAL_STORAGE', '检测到您没打开保存到相册功能权限,是否去设置打开?', res => { this.openAuth()
this.saveBillImage();
});
} }
// #endif // #endif
......
...@@ -23,7 +23,7 @@ export default { ...@@ -23,7 +23,7 @@ export default {
data() { data() {
return { return {
downloadImg: mineBaseUrl + 'XISX1@3x.png', 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: { computed: {
......
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
</template> </template>
<script> <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 LsjUpload from '@/components/lsj-upload/lsj-upload.vue';
import { mineBaseUrl } from '@/utils/config.js'; import { mineBaseUrl } from '@/utils/config.js';
import { getToken } from '@/utils/common.js'; import { getToken } from '@/utils/common.js';
......
...@@ -32,10 +32,12 @@ ...@@ -32,10 +32,12 @@
<QRCodeView :url="shareUrl" @canvas="handleCanvas" /> <QRCodeView :url="shareUrl" @canvas="handleCanvas" />
<SavePosterPopup ref="save-poster-popup" :imageIndex.sync="imageIndex" :qrcode="qrcode" @save="handleClickSave"></SavePosterPopup> <SavePosterPopup ref="save-poster-popup" :imageIndex.sync="imageIndex" :qrcode="qrcode" @save="handleClickSave"></SavePosterPopup>
<l-painter :board="poster" isCanvasToTempFilePath @success="handleCanvasSuccess" @fail="handleCanvasFail" custom-style="position: fixed; left: 400%" /> <l-painter :board="poster" isCanvasToTempFilePath @success="handleCanvasSuccess" @fail="handleCanvasFail" custom-style="position: fixed; left: 400%" />
<AuthPopup ref="authpup" type="top" :isNativeHead="false" @changeAuth="changeAuth" :permissionID="permissionID" />
</view> </view>
</template> </template>
<script> <script>
import AuthPopup from '@/components/auth-popup'
import NavbarRight from '@/components/navbar-right'; import NavbarRight from '@/components/navbar-right';
import QRCodeView from '@/components/qr-code-view'; import QRCodeView from '@/components/qr-code-view';
import SavePosterPopup from './components/save-poster-popup.vue'; import SavePosterPopup from './components/save-poster-popup.vue';
...@@ -46,6 +48,7 @@ import { getSetting } from '@/utils/common.js'; ...@@ -46,6 +48,7 @@ import { getSetting } from '@/utils/common.js';
export default { export default {
components: { components: {
AuthPopup,
NavbarRight, NavbarRight,
SavePosterPopup, SavePosterPopup,
QRCodeView QRCodeView
...@@ -59,7 +62,8 @@ export default { ...@@ -59,7 +62,8 @@ export default {
currentBlock: () => {}, currentBlock: () => {},
billImageUrl: '', billImageUrl: '',
customerId: '', customerId: '',
imageIndex: 0 imageIndex: 0,
permissionID:'WRITE_EXTERNAL_STORAGE'
}; };
}, },
computed: { computed: {
...@@ -138,6 +142,18 @@ export default { ...@@ -138,6 +142,18 @@ export default {
callback: () => {} callback: () => {}
}); });
}, },
//打开自定义权限目的弹框
openAuth() {
setTimeout(() => {
this.$refs['authpup'].open();
}, 500)
},
//用户授权权限后的回调
changeAuth() {
//这里是权限通过后执行自己的代码逻辑
console.log('权限已授权,可执行自己的代码逻辑了');
this.saveBillImage()
},
handleClickSave() { handleClickSave() {
this.currentBlock = url => { this.currentBlock = url => {
uni.saveImageToPhotosAlbum({ uni.saveImageToPhotosAlbum({
...@@ -180,11 +196,8 @@ export default { ...@@ -180,11 +196,8 @@ export default {
if (this.isIOS) { if (this.isIOS) {
this.saveBillImage(); this.saveBillImage();
} else { } else {
getSetting('android.permission.WRITE_EXTERNAL_STORAGE', '检测到您没打开保存到相册功能权限,是否去设置打开?', res => { this.openAuth()
this.saveBillImage();
});
} }
// #endif // #endif
// #ifdef MP-WEIXIN // #ifdef MP-WEIXIN
getSetting('scope.writePhotosAlbum', '检测到您没打开保存到相册功能权限,是否去设置打开?', res => { getSetting('scope.writePhotosAlbum', '检测到您没打开保存到相册功能权限,是否去设置打开?', res => {
......
...@@ -22,19 +22,19 @@ ...@@ -22,19 +22,19 @@
<!-- #endif --> <!-- #endif -->
<view class="getCropperImage" @tap="getCropperImage(false)">确定</view> <view class="getCropperImage" @tap="getCropperImage(false)">确定</view>
</view> </view>
<ChooseImageSourceType :visible.sync="sourceTypeVisible" @change="sourceTypeChange" /> <BottomChoose ref="bottom-choose" @change="sourceTypeChange" />
<AuthPopup ref="authpup" type="top" @changeAuth="changeAuth" :permissionID="permissionID" /> <AuthPopup ref="authpup" type="top" @changeAuth="changeAuth" :permissionID="permissionID" />
</view> </view>
</template> </template>
<script> <script>
import ChooseImageSourceType from '@/components/choose-image-source-type' import BottomChoose from '@/components/bottom-choose'
import AuthPopup from '@/components/auth-popup' import AuthPopup from '@/components/auth-popup'
import {getSetting} from '@/utils/common.js' import {getSetting} from '@/utils/common.js'
import WeCropper from './weCropper.js'; import WeCropper from './weCropper.js';
export default { export default {
components: { components: {
ChooseImageSourceType, BottomChoose,
AuthPopup AuthPopup
}, },
props: { props: {
...@@ -84,7 +84,6 @@ ...@@ -84,7 +84,6 @@
}, },
data() { data() {
return { return {
sourceTypeVisible: false,
sourceType: ['album', 'camera'], sourceType: ['album', 'camera'],
// 底部导航的高度 // 底部导航的高度
bottomNavHeight: 50, bottomNavHeight: 50,
...@@ -213,7 +212,7 @@ ...@@ -213,7 +212,7 @@
}); });
}, },
openSource() { openSource() {
this.sourceTypeVisible = true this.$refs['bottom-choose'].open()
}, },
sourceTypeChange(source) { sourceTypeChange(source) {
this.sourceType = [source] this.sourceType = [source]
......
...@@ -58,11 +58,13 @@ ...@@ -58,11 +58,13 @@
<calendar-popup :date="form.createdTime" ref="calendar-popup" @confirm="calculatorChange"></calendar-popup> <calendar-popup :date="form.createdTime" ref="calendar-popup" @confirm="calculatorChange"></calendar-popup>
<u-picker confirm-color="#02A074" v-model="timeShow" mode="time" :default-time="defaultTime" :params="timeParams" @confirm="timePickerConfirm"></u-picker> <u-picker confirm-color="#02A074" v-model="timeShow" mode="time" :default-time="defaultTime" :params="timeParams" @confirm="timePickerConfirm"></u-picker>
<PopInput title="提醒" type="text" sureText="删除" content="确定删除此行程吗?" :visible.sync="showConfirm" @click="handleConfirm" /> <PopInput title="提醒" type="text" sureText="删除" content="确定删除此行程吗?" :visible.sync="showConfirm" @click="handleConfirm" />
<AuthPopup ref="authpup" type="top" :isNativeHead="false" @changeAuth="changeAuth" :permissionID="permissionID" />
<u-toast ref="uToast" /> <u-toast ref="uToast" />
</view> </view>
</template> </template>
<script> <script>
import AuthPopup from '@/components/auth-popup'
import NavbarRight from '@/components/navbar-right'; import NavbarRight from '@/components/navbar-right';
import PopInput from '@/components/pop-input-view'; import PopInput from '@/components/pop-input-view';
import SoundRecording from '@/components/sound-recording/sound-recording.vue'; import SoundRecording from '@/components/sound-recording/sound-recording.vue';
...@@ -71,14 +73,14 @@ import CheckboxGroups from '@/components/checkbox-groups/checkbox-groups.vue'; ...@@ -71,14 +73,14 @@ import CheckboxGroups from '@/components/checkbox-groups/checkbox-groups.vue';
import CalendarPopup from '@/components/calendar-popup/calendar-popup.vue'; import CalendarPopup from '@/components/calendar-popup/calendar-popup.vue';
import SoundPlayer from './components/sound-player.vue'; import SoundPlayer from './components/sound-player.vue';
import { authorize, openSetting, showModal } from '@/utils/auth.js'; import { authorize, openSetting, showModal } from '@/utils/auth.js';
import { getChannel } from '@/utils/common.js'; import { getChannel,getSetting } from '@/utils/common.js';
import { baseUrl } from '@/utils/config.js'; import { baseUrl } from '@/utils/config.js';
import { scheduleTypeOptions, scheduleSettingOptions } from '@/utils/options/schedule'; import { scheduleTypeOptions, scheduleSettingOptions } from '@/utils/options/schedule';
import { get, add, deleteById, saveTripSubscribe } from '@/api/schedule/index.js'; import { get, add, deleteById, saveTripSubscribe } from '@/api/schedule/index.js';
import subscribeMixin from '@/mixins/subscribeMixin'; import subscribeMixin from '@/mixins/subscribeMixin';
export default { export default {
components: { NavbarRight, PopInput, SoundRecording, CheckboxGroups, CalendarPopup, SoundPlayer, AbButton }, components: { AuthPopup,NavbarRight, PopInput, SoundRecording, CheckboxGroups, CalendarPopup, SoundPlayer, AbButton },
mixins: [subscribeMixin], mixins: [subscribeMixin],
data() { data() {
return { return {
...@@ -121,7 +123,8 @@ export default { ...@@ -121,7 +123,8 @@ export default {
createdTime: [{ required: true, message: '请选择计划日期', trigger: ['change', 'blur'] }], createdTime: [{ required: true, message: '请选择计划日期', trigger: ['change', 'blur'] }],
time: [{ required: true, message: '请选择计划时间', trigger: ['change', 'blur'] }], time: [{ required: true, message: '请选择计划时间', trigger: ['change', 'blur'] }],
name: [{ required: true, message: '请输入计划标题', trigger: ['blur'] }] name: [{ required: true, message: '请输入计划标题', trigger: ['blur'] }]
} },
permissionID:'RECORD_AUDIO'
}; };
}, },
computed: { computed: {
...@@ -220,7 +223,27 @@ export default { ...@@ -220,7 +223,27 @@ export default {
url: '/pages/index/schedule/schedule' url: '/pages/index/schedule/schedule'
}); });
}, },
//打开自定义权限目的弹框
openAuth() {
setTimeout(() => {
this.$refs['authpup'].open();
}, 500)
},
//用户授权权限后的回调
changeAuth() {
//这里是权限通过后执行自己的代码逻辑
console.log('权限已授权,可执行自己的代码逻辑了');
this.openSound()
},
startRecording() { startRecording() {
// #ifdef APP-PLUS
if (this.isIOS) {
this.openSound();
} else {
this.openAuth()
}
// #endif
// #ifndef APP-PLUS
authorize('scope.record') authorize('scope.record')
.then(() => { .then(() => {
this.openSound(); this.openSound();
...@@ -228,6 +251,8 @@ export default { ...@@ -228,6 +251,8 @@ export default {
.catch(() => { .catch(() => {
this.showModal(); this.showModal();
}); });
// #endif
}, },
showModal() { showModal() {
showModal({ showModal({
......
...@@ -394,7 +394,7 @@ ...@@ -394,7 +394,7 @@
} }
}; };
</script> </script>
<style> <style lang="scss">
.lime-painter, .lime-painter,
.lime-painter__canvas { .lime-painter__canvas {
// #ifndef APP-NVUE // #ifndef APP-NVUE
......
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