20
This commit is contained in:
+30
-11
@@ -1,13 +1,14 @@
|
||||
|
||||
//import i18n from '@/locales'
|
||||
import base from '@/common/config';
|
||||
//import store from "@/store";
|
||||
import store from "@/store";
|
||||
import IMSDK from "openim-uniapp-polyfill";
|
||||
|
||||
import CryptoJS from 'crypto-js';
|
||||
import md5 from "md5";
|
||||
|
||||
// #ifdef APP
|
||||
import {downloadFile} from "@/uni_modules/network-manage";
|
||||
// #endif
|
||||
const isString = (v)=> {
|
||||
return typeof v === 'string' || v instanceof String;
|
||||
},
|
||||
@@ -144,20 +145,31 @@ const scan = ()=>{
|
||||
barCode 扫描条形码时返回条形码数据 支付宝小程序
|
||||
imageChannel 来源 支付宝小程序
|
||||
*/
|
||||
if(res.result){
|
||||
if(res.result.indexOf('blackcatp:/')){
|
||||
if(res.scanType == "QR_CODE"){
|
||||
const user_prefix = `${store.getters.config.website}/u/`;
|
||||
console.log(res.result,user_prefix)
|
||||
if(res.result.startsWith(user_prefix)){
|
||||
return uni.navigateTo({
|
||||
url:"/pages/common/userCard/index?sourceID="+res.result.replace(user_prefix,'')
|
||||
});
|
||||
}
|
||||
const group_prefix = `${store.getters.config.website}/g/`;
|
||||
console.log(res.result,group_prefix)
|
||||
if(res.result.startsWith(group_prefix)){
|
||||
return uni.navigateTo({
|
||||
url:"/pages/common/groupCard/index?sourceID="+res.result.replace(group_prefix,'')
|
||||
});
|
||||
}
|
||||
if(res.result.startsWith("http")){
|
||||
uni.navigateTo({
|
||||
url:res.result.substring(11)
|
||||
})
|
||||
}else{
|
||||
success(res.result)
|
||||
url:"/pages/common/webview?url="+encodeURIComponent(res.result)
|
||||
});
|
||||
//res.result;
|
||||
return ;
|
||||
}
|
||||
}
|
||||
},
|
||||
fail(res){
|
||||
|
||||
},
|
||||
complete(res){
|
||||
console.log(res)
|
||||
}
|
||||
});
|
||||
@@ -234,6 +246,11 @@ const get_absolute_path = (fn)=>{
|
||||
}
|
||||
const pendingDownloads = new Map();
|
||||
const cacheFile = (url, saveDir,progressCallback) => {
|
||||
// #ifndef APP
|
||||
return new Promise(async (resolve, reject) => {
|
||||
resolve(url);
|
||||
});
|
||||
// #endif
|
||||
return new Promise(async (resolve, reject) => {
|
||||
try {
|
||||
if(!url || !url.startsWith('http')){
|
||||
@@ -443,7 +460,9 @@ export default{
|
||||
cacheFile,
|
||||
fileExsit,
|
||||
get_absolute_path,
|
||||
// #ifdef APP
|
||||
downloadFile,
|
||||
// #endif
|
||||
isString :isString,
|
||||
isNumber :isNumber,
|
||||
isInteger :isInteger,
|
||||
|
||||
Reference in New Issue
Block a user