更新小程序功能
This commit is contained in:
parent
cb61ea0017
commit
118a3a985b
15
App.vue
15
App.vue
@ -10,6 +10,7 @@
|
|||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// #ifdef APP-PLUS
|
// #ifdef APP-PLUS
|
||||||
let jpushModule = uni.requireNativePlugin("JG-JPush");
|
let jpushModule = uni.requireNativePlugin("JG-JPush");
|
||||||
|
const mp = uni.requireNativePlugin('uniMP');
|
||||||
// #endif
|
// #endif
|
||||||
import {
|
import {
|
||||||
checkLogin
|
checkLogin
|
||||||
@ -74,7 +75,18 @@
|
|||||||
},
|
},
|
||||||
onLaunch: function(option) {
|
onLaunch: function(option) {
|
||||||
this.globalData.statusBarHeight = uni.getSystemInfoSync().statusBarHeight + 'px';
|
this.globalData.statusBarHeight = uni.getSystemInfoSync().statusBarHeight + 'px';
|
||||||
this.globalData.uid = this.$store.state.app.uid
|
this.globalData.uid = this.$store.state.app.uid;
|
||||||
|
|
||||||
|
//监听uni小程序发送的事件
|
||||||
|
mp.onUniMPEventReceive(ret=>{
|
||||||
|
console.log('小程序事件: ', ret);
|
||||||
|
if(ret.event=='closeApp'){
|
||||||
|
mp.closeUniMP(ret.fromAppid, (ret)=>{
|
||||||
|
console.log('closeUniMP: '+JSON.stringify(ret));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
let that = this;
|
let that = this;
|
||||||
// #ifdef MP
|
// #ifdef MP
|
||||||
if (HTTP_REQUEST_URL == '') {
|
if (HTTP_REQUEST_URL == '') {
|
||||||
@ -188,7 +200,6 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
let that = this
|
let that = this
|
||||||
|
@ -9,8 +9,8 @@ let httpApiThree
|
|||||||
// 网络接口修改此字符 小程序域名要求https
|
// 网络接口修改此字符 小程序域名要求https
|
||||||
// let httpApi = 'http://192.168.31.110:8324' // 测试
|
// let httpApi = 'http://192.168.31.110:8324' // 测试
|
||||||
if (process.env.NODE_ENV === "development") {
|
if (process.env.NODE_ENV === "development") {
|
||||||
httpApi = 'https://shop.lihaink.cn' // 生产
|
// httpApi = 'https://shop.lihaink.cn' // 生产
|
||||||
// httpApi = "https://crmeb-test.shop.lihaink.cn"
|
httpApi = "https://crmeb-test.shop.lihaink.cn"
|
||||||
// httpApi = "http://192.168.0.222"
|
// httpApi = "http://192.168.0.222"
|
||||||
// httpApi = "http://192.168.0.108:8325"
|
// httpApi = "http://192.168.0.108:8325"
|
||||||
// httpApi = 'http://192.168.0.108:8325'
|
// httpApi = 'http://192.168.0.108:8325'
|
||||||
|
@ -33,7 +33,7 @@ const loadMP = async (id) => {
|
|||||||
// return ;
|
// return ;
|
||||||
mp.getUniMPVersion(id, (ret) => {
|
mp.getUniMPVersion(id, (ret) => {
|
||||||
console.log('当前版本', ret);
|
console.log('当前版本', ret);
|
||||||
if (0!=ret.code||compareVersions(info.data.version, ret.versionInfo.name) == 1) {
|
if (0!=ret.code||compareVersions(info.data.version, ret.versionInfo.name) == 1||true) {
|
||||||
uni.downloadFile({
|
uni.downloadFile({
|
||||||
url: info.data.version_info?.dow_url,
|
url: info.data.version_info?.dow_url,
|
||||||
success(res) {
|
success(res) {
|
||||||
@ -100,7 +100,10 @@ const doInstallMP = () => {
|
|||||||
|
|
||||||
const open = (id = null) => {
|
const open = (id = null) => {
|
||||||
mp.openUniMP({
|
mp.openUniMP({
|
||||||
appid: id || appid
|
appid: id || appid,
|
||||||
|
extraData: {
|
||||||
|
uniMP: true
|
||||||
|
}
|
||||||
}, (ret) => {
|
}, (ret) => {
|
||||||
uni.hideLoading();
|
uni.hideLoading();
|
||||||
if (0 != ret.code) {
|
if (0 != ret.code) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user