新增了农业咨询小程序
This commit is contained in:
parent
5934f3b81a
commit
c225f36309
@ -141,7 +141,6 @@
|
|||||||
},
|
},
|
||||||
prefix: 'https://lihai001.oss-cn-chengdu.aliyuncs.com/public/kk/luzhou/static4/11/',
|
prefix: 'https://lihai001.oss-cn-chengdu.aliyuncs.com/public/kk/luzhou/static4/11/',
|
||||||
isShow: false,
|
isShow: false,
|
||||||
|
|
||||||
isFshow: false,
|
isFshow: false,
|
||||||
street: '',
|
street: '',
|
||||||
// 编辑中标记
|
// 编辑中标记
|
||||||
@ -162,7 +161,10 @@
|
|||||||
{
|
{
|
||||||
name: '农业咨询',
|
name: '农业咨询',
|
||||||
icon: '/static/applet/ny.png',
|
icon: '/static/applet/ny.png',
|
||||||
data: '__UNI__9620511',
|
data: {
|
||||||
|
id: '__UNI__9620511',
|
||||||
|
url: '/static/wgt/__UNI__9620511.wgt',
|
||||||
|
},
|
||||||
type: 1,
|
type: 1,
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@ -295,7 +297,6 @@
|
|||||||
this.getUniMp(data);
|
this.getUniMp(data);
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
|
|
||||||
this.navigator(data);
|
this.navigator(data);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -319,10 +320,13 @@
|
|||||||
this.editFlag = false;
|
this.editFlag = false;
|
||||||
uni.setStorageSync('gatherNowMenuList', JSON.stringify(this.nowMenuList));
|
uni.setStorageSync('gatherNowMenuList', JSON.stringify(this.nowMenuList));
|
||||||
},
|
},
|
||||||
getUniMp(appid) {
|
getUniMp(data) {
|
||||||
console.log('点击供销平台');
|
|
||||||
// #ifdef APP-PLUS
|
// #ifdef APP-PLUS
|
||||||
uniMP.loadMP(appid);
|
console.log(data, typeof data == 'string');
|
||||||
|
if(typeof data == 'string') uniMP.loadMP(data);
|
||||||
|
else uniMP.loadMPurl(data);
|
||||||
|
// uniMP.loadMPurl(data);
|
||||||
|
// uniMP.open(data.id);
|
||||||
return;
|
return;
|
||||||
// #endif
|
// #endif
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
|
@ -594,6 +594,7 @@
|
|||||||
that.is_promoter = res.data.is_promoter;
|
that.is_promoter = res.data.is_promoter;
|
||||||
that.extension_status = res.data.extension_status;
|
that.extension_status = res.data.extension_status;
|
||||||
that.getMyMenus();
|
that.getMyMenus();
|
||||||
|
that.$store.commit('SET_USERINFO', that.userInfo);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 订单数字
|
// 订单数字
|
||||||
|
BIN
static/wgt/__UNI__9620511.wgt
Normal file
BIN
static/wgt/__UNI__9620511.wgt
Normal file
Binary file not shown.
@ -4,12 +4,10 @@ import {
|
|||||||
} from "../../api/user.js";
|
} from "../../api/user.js";
|
||||||
import {
|
import {
|
||||||
LOGIN_STATUS,
|
LOGIN_STATUS,
|
||||||
UID
|
UID,
|
||||||
|
USER_INFO
|
||||||
} from '../../config/cache';
|
} from '../../config/cache';
|
||||||
import Cache from '../../utils/cache';
|
import Cache from '../../utils/cache';
|
||||||
import {
|
|
||||||
USER_INFO
|
|
||||||
} from '../../config/cache';
|
|
||||||
// #ifdef APP-PLUS
|
// #ifdef APP-PLUS
|
||||||
import Updater from '@/uni_modules/guyue-updater/index';
|
import Updater from '@/uni_modules/guyue-updater/index';
|
||||||
// #endif
|
// #endif
|
||||||
@ -18,7 +16,7 @@ const state = {
|
|||||||
location: Cache.get('LOCATION_DATA', true) || {},
|
location: Cache.get('LOCATION_DATA', true) || {},
|
||||||
token: Cache.get(LOGIN_STATUS) || null,
|
token: Cache.get(LOGIN_STATUS) || null,
|
||||||
backgroundColor: "#fff",
|
backgroundColor: "#fff",
|
||||||
userInfo: null,
|
userInfo: Cache.get(USER_INFO)||null,
|
||||||
uid: Cache.get(UID) || null,
|
uid: Cache.get(UID) || null,
|
||||||
globalData: uni.getStorageSync('GLOBAL_DATA') || {},
|
globalData: uni.getStorageSync('GLOBAL_DATA') || {},
|
||||||
homeActive: false,
|
homeActive: false,
|
||||||
@ -39,6 +37,10 @@ const mutations = {
|
|||||||
Cache.set(LOGIN_STATUS, opt.token, opt.time);
|
Cache.set(LOGIN_STATUS, opt.token, opt.time);
|
||||||
uni.removeStorageSync('auth_token');
|
uni.removeStorageSync('auth_token');
|
||||||
},
|
},
|
||||||
|
SET_USERINFO(state, opt){
|
||||||
|
state.userInfo = opt;
|
||||||
|
Cache.set(USER_INFO, opt);
|
||||||
|
},
|
||||||
SETUID(state, val) {
|
SETUID(state, val) {
|
||||||
state.uid = val;
|
state.uid = val;
|
||||||
Cache.set(UID, val);
|
Cache.set(UID, val);
|
||||||
|
@ -5,6 +5,7 @@ import {
|
|||||||
HTTP_REQUEST_URL
|
HTTP_REQUEST_URL
|
||||||
} from '@/config/app';
|
} from '@/config/app';
|
||||||
const mp = uni.requireNativePlugin('uniMP');
|
const mp = uni.requireNativePlugin('uniMP');
|
||||||
|
import store from "@/store/modules/app.js"
|
||||||
|
|
||||||
let appid = ''; // 应用id
|
let appid = ''; // 应用id
|
||||||
let wgtFile = ''; // 应用文件地址
|
let wgtFile = ''; // 应用文件地址
|
||||||
@ -84,6 +85,23 @@ const loadMP = async (id) => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// 按URL加载小程序
|
||||||
|
const loadMPurl = async (e) => {
|
||||||
|
appid = e.id;
|
||||||
|
mp.getUniMPVersion(appid, (ret) => {
|
||||||
|
console.log('当前版本', ret);
|
||||||
|
wgtFile = e.url;
|
||||||
|
doInstallMP();
|
||||||
|
// if (0 != ret.code) {
|
||||||
|
// wgtFile = e.url;
|
||||||
|
// installMP();
|
||||||
|
// } else {
|
||||||
|
// open()
|
||||||
|
// }
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
// 小程序版本信息
|
// 小程序版本信息
|
||||||
const getVersion = (id) => {
|
const getVersion = (id) => {
|
||||||
appid = id;
|
appid = id;
|
||||||
@ -117,7 +135,7 @@ const doInstallMP = () => {
|
|||||||
showCancel: false
|
showCancel: false
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
console.log('初始化供销: ' + JSON.stringify(r));
|
console.log('初始化: ' + JSON.stringify(r));
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -127,11 +145,13 @@ const open = (id = null) => {
|
|||||||
icon: 'none',
|
icon: 'none',
|
||||||
title: '请先登录'
|
title: '请先登录'
|
||||||
})
|
})
|
||||||
|
let avatar = store?.state?.userInfo?.avatar;
|
||||||
mp.openUniMP({
|
mp.openUniMP({
|
||||||
appid: id || appid,
|
appid: id || appid,
|
||||||
extraData: {
|
extraData: {
|
||||||
uniMP: true,
|
uniMP: true,
|
||||||
token: token,
|
token: token,
|
||||||
|
avatar: avatar,
|
||||||
}
|
}
|
||||||
}, (ret) => {
|
}, (ret) => {
|
||||||
uni.hideLoading();
|
uni.hideLoading();
|
||||||
@ -148,6 +168,7 @@ const open = (id = null) => {
|
|||||||
|
|
||||||
export default {
|
export default {
|
||||||
loadMP,
|
loadMP,
|
||||||
|
loadMPurl,
|
||||||
installMP,
|
installMP,
|
||||||
doInstallMP,
|
doInstallMP,
|
||||||
getVersion,
|
getVersion,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user