Commit e17eec7b authored by Facius's avatar Facius

feat: app保存图片和push动画适配

parent 8cad988e
Pipeline #3307 canceled with stages
......@@ -378,7 +378,8 @@ export default {
billingCategoryChange(item) {
if (item.id === 'setting') {
uni.navigateTo({
url: '/pages/mine/payments-setting/payments-setting'
url: '/pages/mine/payments-setting/payments-setting',
animationType:'pop-in'
});
uni.$on(this.notification, res => {
this.getBillTypeOptions();
......
......@@ -121,7 +121,7 @@ export default {
},
methods: {
handleCanvasSuccessSave(url) {
handleCanvasSuccessSave(url) {
this.saveUrl = url
this.currentBlock(url)
},
......@@ -138,6 +138,11 @@ export default {
})
},
fail: (err) => {
// #ifdef APP-PLUS
if (err.errCode == 2) {
return
}
// #endif
var str = err && err.errMsg
if (str && str.indexOf('cancel') != -1) {
str = '取消保存'
......
......@@ -43,6 +43,8 @@
<script>
import Card from '@/components/cell-card'
import CardBack from '@/components/cell-card-back'
import { getSetting } from '@/utils/common.js'
export default {
components: {
Card,
......@@ -80,6 +82,16 @@ export default {
this.$emit('update', url)
},
handleCanvasBack(res) {
console.log('------handleCanvasBack------', res)
// #ifdef APP-PLUS
if (res.errCode == 2) {
uni.hideLoading()
getSetting('photoLibrary', '检测到您没打开保存到相册功能权限,是否去设置打开?', (res)=> {
this.$refs.cardBack.saveImage()
})
return
}
// #endif
this.$refs.card.saveImage()
},
handleChange(event) {
......
......@@ -1050,6 +1050,11 @@ export default {
})
},
fail: (err) => {
// #ifdef APP-PLUS
if (err.errCode == 2) {
return
}
// #endif
var str = err && err.errMsg
if (str && str.indexOf('cancel') != -1) {
str = '取消保存'
......
......@@ -64,7 +64,8 @@ export default {
} else {
if (item.path) {
uni.navigateTo({
url: `${item.path}`
url: `${item.path}`,
animationType:'pop-in'
});
}
}
......
......@@ -177,6 +177,7 @@ export default {
// 去开通会员
uni.navigateTo({
url: 'pages/mine/pay/pay',
animationType:'pop-in',
})
}
},
......
......@@ -136,6 +136,7 @@ export default {
toEdit() {
if (this.detail.repairId) {
uni.navigateTo({
animationType:'pop-in',
url: `/pages/maintain-bill/create?billId=${this.detail.repairId}`
});
} else {
......@@ -144,6 +145,7 @@ export default {
},
toRepair(){
uni.navigateTo({
animationType:'pop-in',
url: `/pages/maintain-bill/detail?billId=${this.detail.repairId}`
});
},
......
......@@ -100,6 +100,7 @@ export default {
},
handleSelectCell(id) {
uni.navigateTo({
animationType:'pop-in',
url: `/pages/bill/bill-detail/bill-detail?id=${id}`
});
},
......
......@@ -33,6 +33,7 @@ export default {
methods: {
next(item) {
uni.navigateTo({
animationType:'pop-in',
url: `./choose-category/choose-category?id=${item.id}`
});
},
......
......@@ -97,6 +97,7 @@
toPrice(item,item2){
let {prodCode}=item2
uni.navigateTo({
animationType:'pop-in',
url:`/pages/bill/quoted-price/price/price?serviceType=${this.serviceType}&brandCode=${this.brandCode}&prodCode=${prodCode}`
})
},
......
......@@ -35,6 +35,7 @@ export default {
methods: {
next(item) {
uni.navigateTo({
animationType:'pop-in',
url: `./choose-category/choose-category?serviceType=${item.value}`
});
},
......
......@@ -256,9 +256,11 @@ export default {
.then((res) => {
if (res.data) {
this.info = res.data
this.$nextTick(()=> {
this.$refs.card.updateImage()
})
setTimeout(()=> {
this.$nextTick(()=> {
this.$refs.card.updateImage()
})
}, 500)
}
this.loadingCard = false
})
......@@ -326,9 +328,21 @@ export default {
},
})
} else if (index == 1) {
// #ifdef APP-PLUS
// getSetting('photoLibrary', '检测到您没打开保存到相册功能权限,是否去设置打开?', (res)=> {
this.saveImage()
// })
// #endif
// #ifdef MP-WEIXIN
getSetting('scope.writePhotosAlbum', '检测到您没打开保存到相册功能权限,是否去设置打开?', (res)=> {
this.saveImage()
})
// #endif
// #ifdef MP-TOUTIAO
getSetting('scope.album', '检测到您没打开保存到相册功能权限,是否去设置打开?', (res)=> {
this.saveImage()
})
// #endif
} else if (index == 2) {
}
},
......@@ -350,7 +364,7 @@ export default {
},
handleCanvas(res) {
uni.hideLoading()
console.log('------保存成功-------', res)
console.log('------保存结果-------', res)
},
handleUpdate(url) {
this.shareImage = url
......
......@@ -115,6 +115,7 @@ export default {
},
handleSelectCell(id) {
uni.navigateTo({
animationType:'pop-in',
url: `/pages/bill/bill-detail/bill-detail?id=${id}`
});
},
......
......@@ -422,6 +422,7 @@ export default {
} else {
console.log("navigateTo")
uni.navigateTo({
animationType:'pop-in',
url: item.path
});
}
......@@ -429,11 +430,13 @@ export default {
handleClickOperate(path) {
if (!this.checkVip()) return;
uni.navigateTo({
url: path
url: path,
animationType:'pop-in',
});
},
handleSelectCell(id) {
uni.navigateTo({
animationType:'pop-in',
url: `/pages/bill/bill-detail/bill-detail?id=${id}`
});
},
......
......@@ -52,6 +52,7 @@ export default {
}
}else if (item.path) {
uni.navigateTo({
animationType:'pop-in',
url: item.path
});
}
......
......@@ -65,6 +65,7 @@ export default {
toLogin() {
if (!this.userInfo.id) {
uni.navigateTo({
animationType:'pop-in',
url: '/pages/login/login'
});
}
......@@ -72,12 +73,14 @@ export default {
toUserSetting(){
if (this.userInfo.id) {
uni.navigateTo({
animationType:'pop-in',
url: '/pages/mine/user-setting/user-setting'
});
}
},
toPay(){
uni.navigateTo({
animationType:'pop-in',
url:'/pages/mine/pay/pay'
})
}
......
......@@ -38,6 +38,7 @@ export default {
// this.$emit('hanldClick', item);
if(item.path){
uni.navigateTo({
animationType:'pop-in',
url:item.path
})
}
......
......@@ -34,6 +34,7 @@ export default {
methods:{
toPay(){
uni.navigateTo({
animationType:'pop-in',
url:'/pages/mine/pay/pay'
})
}
......
......@@ -78,6 +78,7 @@ export default {
},
toAdd() {
uni.navigateTo({
animationType:'pop-in',
url: 'pages/schedule/create-schedule/create-schedule'
});
},
......@@ -112,6 +113,7 @@ export default {
},
handleClick(item) {
uni.navigateTo({
animationType:'pop-in',
url: `/pages/schedule/schedule-detail/schedule-detail?id=${item.id}`
});
}
......
......@@ -77,6 +77,7 @@ export default {
methods: {
handleClick(type) {
uni.navigateTo({
animationType:'pop-in',
url: '/pages/login/agreement/agreement?type=' + type
});
},
......@@ -101,6 +102,7 @@ export default {
});
} else {
uni.navigateTo({
animationType:'pop-in',
url: './quick-login/quick-login'
});
}
......
......@@ -412,6 +412,7 @@ export default {
handleClick(e) {
var type = e.currentTarget.dataset.type;
uni.navigateTo({
animationType:'pop-in',
url: '/pages/login/agreement?type=' + type
});
}
......
......@@ -409,6 +409,7 @@ export default {
handleClick(e) {
var type = e.currentTarget.dataset.type;
uni.navigateTo({
animationType:'pop-in',
url: '/pages/login/agreement?type=' + type
});
}
......
......@@ -592,6 +592,15 @@ export default {
})
},
fail: (err) => {
// #ifdef APP-PLUS
if (err.errCode == 2) {
uni.hideLoading()
getSetting('photoLibrary', '检测到您没打开保存到相册功能权限,是否去设置打开?', (res)=> {
this.handleClickSave()
})
return
}
// #endif
var str = err && err.errMsg
if (str && str.indexOf('cancel') != -1) {
str = '取消保存'
......@@ -608,10 +617,23 @@ export default {
},
})
}
getSetting(
'scope.writePhotosAlbum',
'检测到您没打开保存到相册功能权限,是否去设置打开?',
(res) => {
// #ifdef APP-PLUS
// getSetting('photoLibrary', '检测到您没打开保存到相册功能权限,是否去设置打开?', (res)=> {
this.saveBillImage()
// })
// #endif
// #ifdef MP-WEIXIN
getSetting('scope.writePhotosAlbum', '检测到您没打开保存到相册功能权限,是否去设置打开?', (res)=> {
this.saveBillImage()
})
// #endif
// #ifdef MP-TOUTIAO
getSetting('scope.album', '检测到您没打开保存到相册功能权限,是否去设置打开?', (res)=> {
this.saveBillImage()
})
// #endif
},
saveBillImage() {
uni.showLoading({
title: '保存中',
})
......@@ -1132,8 +1154,6 @@ export default {
],
}
}
}
)
},
handleClickScan() {
this.visible = true
......
......@@ -42,6 +42,7 @@ export default {
methods: {
handleClick(type) {
uni.navigateTo({
animationType:'pop-in',
url: '/pages/login/agreement/agreement?type=' + type
});
},
......
......@@ -349,6 +349,7 @@ export default {
handleService() {
uni.navigateTo({
animationType:'pop-in',
url: '../mine/service/service'
});
}
......
......@@ -33,6 +33,7 @@ export default {
// this.$emit('hanldClick', item);
if(item.path){
uni.navigateTo({
animationType:'pop-in',
url:item.path
})
}
......
......@@ -398,6 +398,7 @@ export default {
});
setTimeout(function() {
uni.navigateTo({
animationType:'pop-in',
url:'/pages/login/login'
})
}, 1500);
......@@ -554,12 +555,14 @@ export default {
handleService() {
uni.navigateTo({
animationType:'pop-in',
url: '/pages/mine/service/service'
});
},
handleExchange() {
uni.navigateTo({
animationType:'pop-in',
url: '/pages/mine/cd-key/cd-key'
});
}
......
......@@ -413,6 +413,7 @@ export default {
});
setTimeout(function() {
uni.navigateTo({
animationType:'pop-in',
url: '/pages/login/login'
});
}, 1500);
......@@ -570,12 +571,14 @@ export default {
handleService() {
uni.navigateTo({
animationType:'pop-in',
url: '/pages/mine/service/service'
});
},
handleExchange() {
uni.navigateTo({
animationType:'pop-in',
url: '/pages/mine/cd-key/cd-key'
});
}
......
......@@ -227,6 +227,7 @@ export default {
},
toChooseType() {
uni.navigateTo({
animationType:'pop-in',
url: '/pages/mine/timed/choose-type/choose-type'
});
uni.$once(this.notification, res => {
......
......@@ -115,6 +115,7 @@ export default {
},
toEdit() {
uni.navigateTo({
animationType:'pop-in',
url: `/pages/schedule/create-schedule/create-schedule?id=${this.id}`
});
},
......
......@@ -5,6 +5,9 @@ import {
userinfo,
headName,
} from "./config.js"
import permision from "@/js_sdk/wa-permission/permission.js"
export function setToken(data) {
uni.setStorageSync(token, data);
setTimetamp()
......@@ -140,6 +143,7 @@ export function checkLoginAndVip(callback) {
success() {
setTimeout(() => {
uni.navigateTo({
animationType:'pop-in',
url: '/pages/login/login'
})
}, 1500)
......@@ -242,9 +246,54 @@ export function checkCodeTimetamp() {
return false;
}
}
// 查询权限
export function getSetting(scope, text, block, errBlock = () => {}) {
// #ifdef APP-PLUS
if (uni.getSystemInfoSync().platform === "ios") {
var result = permision.judgeIosPermission(scope)
console.log('------------------', result)
if (result) {
block()
} else {
uni.showModal({
content: text,
confirmText: '去设置',
cancelText: '取消',
showCancel: true,
success: (res) => {
if (res.confirm) {
permision.gotoAppPermissionSetting()
} else {
errBlock(res)
}
},
})
}
} else {
var result = requestAndroidPermission(scope)
// result == 1 "已获得授权"
// result == 0 "未获得授权"
if (result == 1 || result == 0) {
block()
} else {
uni.showModal({
content: text,
confirmText: '去设置',
cancelText: '取消',
showCancel: true,
success: (res) => {
if (res.confirm) {
permision.gotoAppPermissionSetting()
} else {
errBlock(res)
}
},
})
}
}
// #endif
// #ifdef MP
uni.authorize({
scope: scope,
success: () => {
......@@ -280,9 +329,9 @@ export function getSetting(scope, text, block, errBlock = () => {}) {
})
},
})
// #endif
}
// 自定义filter
export function myFilter(value, options) {
if (options && options instanceof Array) {
......
......@@ -82,6 +82,7 @@ function refreshTokenRequst() {
log.error("refreshTokenRequst=>params: " , header)
log.error("refreshTokenRequst=>err: " , err)
uni.navigateTo({
animationType:'pop-in',
url: "/pages/login/login",
})
setTimeout(() => {
......
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