Authored by 李奇

webview逻辑修改

... ... @@ -174,4 +174,7 @@ const api = {
}
};
export default api;
module.exports = {
api,
verify
};
... ...
import api from '../../common/api';
import config from '../../config';
import { api } from '../../common/api';
export default {
/**
... ...
import api from '../../common/api';
import { api } from '../../common/api';
export default {
/**
... ...
import api from '../../common/api';
import { api } from '../../common/api';
export default {
/**
... ...
import api from '../common/api';
import { api } from '../common/api';
export default {
/**
... ... @@ -26,5 +26,19 @@ export default {
method: 'app.shops.union'
}, params)
});
},
/**
* 通过AppId查绑定店铺
* @param params
* @returns {*}
*/
getMiniAppRealParam(code) {
return api.get({
url: '/wechat/miniapp/getMiniAppRealParam',
data: {
code
}
});
}
};
... ...
import api from '../../common/api';
import { api } from '../../common/api';
export default {
/**
... ...
import api from '../../common/api';
import { api } from '../../common/api';
export default {
/**
... ...
import api from '../../common/api';
import { api } from '../../common/api';
export default {
/**
... ...
import api from '../../common/api';
import { api } from '../../common/api';
export default {
/**
... ...
import api from '../../common/api';
import { api } from '../../common/api';
export default {
/**
... ...
import api from '../../common/api';
import { api } from '../../common/api';
export default {
/**
... ...
import api from '../../common/api';
import { api } from '../../common/api';
export default {
/**
... ...
import api from '../../common/api';
import { api } from '../../common/api';
export default {
/**
... ...
import api from '../../common/api';
import { api } from '../../common/api';
export default {
shopList() {
... ...
import api from '../../common/api';
import { api } from '../../common/api';
export default {
getContent(content_code) {
... ...
import api from '../../common/api';
import { api } from '../../common/api';
export default {
shopSort(params) {
... ...
import config from '../../config';
import { verify } from '../../common/api';
import commonModel from '../../models/common';
Page({
data: {
url: '',
... ... @@ -5,8 +9,19 @@ Page({
},
onLoad: function(options) {
this.loadElement(options);
if (options && options.scene && options.scene.length > 0) {
let code = options.scene;
return commonModel.getMiniAppRealParam(code)
.then(json => {
if (json) {
this.load(json);
}
})
.catch(() => {});
}
this.load(options);
},
onShareAppMessage: function() {
... ... @@ -16,11 +31,28 @@ Page({
};
},
loadElement: function(options) {
this.setData({
title: options.title,
url: decodeURIComponent(options.url)
});
load: function(options) {
let app = getApp();
let url = options.url;
if (options && options.url) {
let params = {};
let sys = wx.getSystemInfoSync();
params.uid = app.getUid();
params.udid = app._getSync('udid');
params.session_key = app._getSync('sessionKey');
params.app_version = config.apiParams.app_version;
params.client_type = config.apiParams.client_type;
params.screen_size = `${sys.windowWidth}x${sys.windowHeight}`;
params.os_version = sys.version;
verify.sign(params);
this.setData({
url: decodeURIComponent(`${url}`)
});
}
},
bindGetMsg: function(e) {
... ...
... ... @@ -29,7 +29,7 @@
"list": []
},
"miniprogram": {
"current": 1,
"current": -1,
"list": [
{
"id": -1,
... ...