Commit e17eec7b authored by Facius's avatar Facius

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

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