|
@@ -82,17 +82,33 @@ Page({
|
|
|
if (url) {
|
|
if (url) {
|
|
|
// 看下是否包括http,http就跳转到product页面
|
|
// 看下是否包括http,http就跳转到product页面
|
|
|
if (url.indexOf('http') >= 0) {
|
|
if (url.indexOf('http') >= 0) {
|
|
|
- toUrl = '/pages/product/product'
|
|
|
|
|
|
|
+ // toUrl = '/pages/product/product'
|
|
|
|
|
+ wx.downloadFile({
|
|
|
|
|
+ url: url,
|
|
|
|
|
+ success(e){
|
|
|
|
|
+ wx.openDocument({
|
|
|
|
|
+ filePath: e.tempFilePath,
|
|
|
|
|
+ showMenu: true,
|
|
|
|
|
+ fileType: 'pdf',
|
|
|
|
|
+ success(e) {
|
|
|
|
|
+ console.log('success', e);
|
|
|
|
|
+ },
|
|
|
|
|
+ fail(e){
|
|
|
|
|
+ console.log('fail', e);
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
} else {
|
|
} else {
|
|
|
// 说明是跳本产品
|
|
// 说明是跳本产品
|
|
|
toUrl = url;
|
|
toUrl = url;
|
|
|
|
|
+ wx.navigateTo({
|
|
|
|
|
+ url: toUrl,
|
|
|
|
|
+ success: function (res) {
|
|
|
|
|
+ res.eventChannel.emit('url', url);
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
}
|
|
}
|
|
|
- wx.navigateTo({
|
|
|
|
|
- url: toUrl,
|
|
|
|
|
- success: function (res) {
|
|
|
|
|
- res.eventChannel.emit('url', url);
|
|
|
|
|
- }
|
|
|
|
|
- })
|
|
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
/**
|
|
/**
|
|
@@ -107,17 +123,33 @@ Page({
|
|
|
if (url) {
|
|
if (url) {
|
|
|
// 看下是否包括http,http就跳转到product页面
|
|
// 看下是否包括http,http就跳转到product页面
|
|
|
if (url.indexOf('http') >= 0) {
|
|
if (url.indexOf('http') >= 0) {
|
|
|
- toUrl = '/pages/product/product'
|
|
|
|
|
|
|
+ // toUrl = '/pages/product/product'
|
|
|
|
|
+ wx.downloadFile({
|
|
|
|
|
+ url: url,
|
|
|
|
|
+ success(e){
|
|
|
|
|
+ wx.openDocument({
|
|
|
|
|
+ filePath: e.tempFilePath,
|
|
|
|
|
+ showMenu: true,
|
|
|
|
|
+ fileType: 'pdf',
|
|
|
|
|
+ success(e) {
|
|
|
|
|
+ console.success('openFile', e);
|
|
|
|
|
+ },
|
|
|
|
|
+ fail(e){
|
|
|
|
|
+ console.fail('openFile', e);
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
} else {
|
|
} else {
|
|
|
// 说明是跳本产品
|
|
// 说明是跳本产品
|
|
|
toUrl = url;
|
|
toUrl = url;
|
|
|
|
|
+ wx.navigateTo({
|
|
|
|
|
+ url: toUrl,
|
|
|
|
|
+ success: function (res) {
|
|
|
|
|
+ res.eventChannel.emit('url', url);
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
}
|
|
}
|
|
|
- wx.navigateTo({
|
|
|
|
|
- url: toUrl,
|
|
|
|
|
- success: function (res) {
|
|
|
|
|
- res.eventChannel.emit('url', url);
|
|
|
|
|
- }
|
|
|
|
|
- })
|
|
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
/**
|
|
/**
|