更新
This commit is contained in:
parent
dbe08640e9
commit
bc87f30948
@ -320,4 +320,4 @@ export function intention(data) {
|
|||||||
*/
|
*/
|
||||||
export function intentionbus(data) {
|
export function intentionbus(data) {
|
||||||
return request.post(`intention/business`, data);
|
return request.post(`intention/business`, data);
|
||||||
}
|
}
|
||||||
|
@ -141,4 +141,12 @@ export function getNavigation(data) {
|
|||||||
return request.get("navigation", data, {
|
return request.get("navigation", data, {
|
||||||
noAuth: true
|
noAuth: true
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
小程序 -- 小程序列表
|
||||||
|
*/
|
||||||
|
export function applet(data) {
|
||||||
|
return request.get(`applet`, data);
|
||||||
}
|
}
|
@ -39,9 +39,9 @@
|
|||||||
<block v-if="nowMenuList.length > 0">
|
<block v-if="nowMenuList.length > 0">
|
||||||
<u-transition v-for="(item, index) in nowMenuList" :key="item.name" show>
|
<u-transition v-for="(item, index) in nowMenuList" :key="item.name" show>
|
||||||
<view class="examine" @click="
|
<view class="examine" @click="
|
||||||
editFlag ? removeMenu(item) : clickMenu(item.type, item.data)
|
editFlag ? removeMenu(item) : clickMenu(item)
|
||||||
">
|
">
|
||||||
<image class="icon_img" :src="item.icon" mode="aspectFit">
|
<image class="icon_img" :src="item.pic" mode="aspectFit">
|
||||||
</image>
|
</image>
|
||||||
<u-icon v-if="editFlag" class="icon" name="minus-circle-fill" color="red"></u-icon>
|
<u-icon v-if="editFlag" class="icon" name="minus-circle-fill" color="red"></u-icon>
|
||||||
<text class="text">{{ item.name }}</text>
|
<text class="text">{{ item.name }}</text>
|
||||||
@ -60,7 +60,7 @@
|
|||||||
<view class="content">
|
<view class="content">
|
||||||
<u-transition v-for="(item, index) in AllMenuList" :key="item.name" show>
|
<u-transition v-for="(item, index) in AllMenuList" :key="item.name" show>
|
||||||
<view class="examine" @click="pushMenu(item)">
|
<view class="examine" @click="pushMenu(item)">
|
||||||
<image class="icon_img" :src="item.icon" mode="aspectFit"> </image>
|
<image class="icon_img" :src="item.pic" mode="aspectFit"> </image>
|
||||||
<u-icon class="icon" name="plus-circle-fill"></u-icon>
|
<u-icon class="icon" name="plus-circle-fill"></u-icon>
|
||||||
<text class="text">{{ item.name }}</text>
|
<text class="text">{{ item.name }}</text>
|
||||||
</view>
|
</view>
|
||||||
@ -116,6 +116,9 @@
|
|||||||
import {
|
import {
|
||||||
getDiy
|
getDiy
|
||||||
} from '@/api/api.js';
|
} from '@/api/api.js';
|
||||||
|
import {
|
||||||
|
applet
|
||||||
|
} from '@/api/public.js';
|
||||||
import {
|
import {
|
||||||
ENV
|
ENV
|
||||||
} from "@/config/app.js"
|
} from "@/config/app.js"
|
||||||
@ -147,139 +150,11 @@
|
|||||||
// 编辑中标记
|
// 编辑中标记
|
||||||
editFlag: false,
|
editFlag: false,
|
||||||
// 所有菜单的按钮
|
// 所有菜单的按钮
|
||||||
AllMenuList: [{
|
AllMenuList: [],
|
||||||
name: '商户平台',
|
|
||||||
icon: '/static/applet/shop_app.png',
|
|
||||||
data: "__UNI__1EE148C",
|
|
||||||
type: 2,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: '供销平台',
|
|
||||||
icon: '/static/applet/gx_app.png',
|
|
||||||
data: '__UNI__B5B1EDD',
|
|
||||||
type: 1,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: '农业咨询',
|
|
||||||
icon: '/static/applet/ny.png',
|
|
||||||
data: {
|
|
||||||
id: '__UNI__9620511',
|
|
||||||
url: 'https://ceshi-worker-task.lihaink.cn/api/common/getMiniProgramInfo?name=nongye',
|
|
||||||
},
|
|
||||||
type: 3,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: '教育咨询',
|
|
||||||
icon: '/static/applet/jy.png',
|
|
||||||
data: {
|
|
||||||
id: '__UNI__7AA205C',
|
|
||||||
url: 'https://ceshi-worker-task.lihaink.cn/api/common/getMiniProgramInfo?name=jiaoyu',
|
|
||||||
},
|
|
||||||
type: 3,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: '法律咨询',
|
|
||||||
icon: '/static/applet/fl.png',
|
|
||||||
data: {
|
|
||||||
id: '__UNI__358D505',
|
|
||||||
url: 'https://ceshi-worker-task.lihaink.cn/api/common/getMiniProgramInfo?name=falv',
|
|
||||||
},
|
|
||||||
type: 3,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: '情感咨询',
|
|
||||||
icon: '/static/applet/qg.png',
|
|
||||||
data: {
|
|
||||||
id: '__UNI__8080F14',
|
|
||||||
url: 'https://ceshi-worker-task.lihaink.cn/api/common/getMiniProgramInfo?name=qinggan',
|
|
||||||
},
|
|
||||||
type: 3,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: '种植分析',
|
|
||||||
icon: '/static/applet/zz.png',
|
|
||||||
data: {
|
|
||||||
id: '__UNI__9EDFE40',
|
|
||||||
url: 'https://ceshi-worker-task.lihaink.cn/api/common/getMiniProgramInfo?name=zhongzhi',
|
|
||||||
},
|
|
||||||
type: 3,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: '养殖分析',
|
|
||||||
icon: '/static/applet/yz.png',
|
|
||||||
data: {
|
|
||||||
id: '__UNI__EEA7DC9',
|
|
||||||
url: 'https://ceshi-worker-task.lihaink.cn/api/common/getMiniProgramInfo?name=yangzhi',
|
|
||||||
},
|
|
||||||
type: 3,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: '里海直播',
|
|
||||||
icon: '/static/applet/live.png',
|
|
||||||
data: {
|
|
||||||
id: "__UNI__0E46DAD",
|
|
||||||
url: "https://lihai001.oss-cn-chengdu.aliyuncs.com/app/__UNI__0E46DAD.wgt",
|
|
||||||
|
|
||||||
},
|
|
||||||
type: 4,
|
|
||||||
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'oa小程序',
|
|
||||||
icon: '/static/applet/oa.png',
|
|
||||||
data: {
|
|
||||||
id: "__UNI__40723E1",
|
|
||||||
url: "https://lihai001.oss-cn-chengdu.aliyuncs.com/app/__UNI__40723E1.wgt",
|
|
||||||
},
|
|
||||||
type: 4
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: '种植溯源',
|
|
||||||
icon: '/static/applet/icons.png',
|
|
||||||
data: {
|
|
||||||
// id: "__UNI__9B6D67A",
|
|
||||||
// url: "https://lihai001.oss-cn-chengdu.aliyuncs.com/def/ce21c202312251443415370.wgt",
|
|
||||||
id: "__UNI__D087881",
|
|
||||||
url: "https://lihai001.oss-cn-chengdu.aliyuncs.com/def/3b1b1202312230957197588.wgt",
|
|
||||||
},
|
|
||||||
type: 4
|
|
||||||
}
|
|
||||||
// {
|
|
||||||
// name: '农业智能感知平台',
|
|
||||||
// icon: '/static/applet/icons.png',
|
|
||||||
// data: {
|
|
||||||
// id: '__UNI__3A527D1',
|
|
||||||
// url: 'https://ceshi-worker-task.lihaink.cn/uploads/files/20231019/20231019151519e8f484737.wgt',
|
|
||||||
// },
|
|
||||||
// type: 4,
|
|
||||||
// },
|
|
||||||
|
|
||||||
// {
|
|
||||||
// name: '里海直播',
|
|
||||||
// icon: '/static/applet/live.png',
|
|
||||||
// data: {
|
|
||||||
// id: "__UNI__0E46DAD",
|
|
||||||
// url:'https://lihai001.oss-cn-chengdu.aliyuncs.com/app/__UNI__0E46DAD.wgt',
|
|
||||||
|
|
||||||
// },
|
|
||||||
// type: 4,
|
|
||||||
|
|
||||||
// }
|
|
||||||
// {
|
|
||||||
// name: '大屏控制',
|
|
||||||
// icon: '/static/applet/dp.png',
|
|
||||||
// data: {
|
|
||||||
// id: '__UNI__83ABA97',
|
|
||||||
// url: 'https://ceshi-worker-task.lihaink.cn/uploads/files/20231016/20231016112144fac6d9128.wgt',
|
|
||||||
// },
|
|
||||||
// type: 4,
|
|
||||||
// }
|
|
||||||
],
|
|
||||||
nowMenuList: [],
|
nowMenuList: [],
|
||||||
street: '',
|
street: '',
|
||||||
showPicker: false,
|
showPicker: false,
|
||||||
columnData: [],
|
columnData: [],
|
||||||
|
|
||||||
isFshow: false,
|
isFshow: false,
|
||||||
backColor: 'rgba(252, 252, 252, 0)'
|
backColor: 'rgba(252, 252, 252, 0)'
|
||||||
};
|
};
|
||||||
@ -289,20 +164,8 @@
|
|||||||
},
|
},
|
||||||
created() {},
|
created() {},
|
||||||
onLoad() {
|
onLoad() {
|
||||||
if(ENV=='prod'){
|
this.initAllAppLet();
|
||||||
this.AllMenuList = this.AllMenuList.filter(item=>{
|
|
||||||
return item.name!='里海直播'&&item.name!='oa小程序'
|
|
||||||
})
|
|
||||||
// 正式
|
|
||||||
this.AllMenuList.forEach(item=>{
|
|
||||||
if(item.name=='种植溯源'){
|
|
||||||
item.data.url = 'https://lihai001.oss-cn-chengdu.aliyuncs.com/def/97568202312201457561882.wgt'
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
this.showControllerAllLet();
|
|
||||||
this.Area();
|
this.Area();
|
||||||
this.initMenu();
|
|
||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
if (this.isLogin) {
|
if (this.isLogin) {
|
||||||
@ -408,6 +271,15 @@
|
|||||||
|
|
||||||
|
|
||||||
},
|
},
|
||||||
|
initAllAppLet(){
|
||||||
|
applet().then(res=>{
|
||||||
|
this.AllMenuList = res.data;
|
||||||
|
this.initMenu();
|
||||||
|
this.showControllerAllLet();
|
||||||
|
}).catch(e=>{
|
||||||
|
console.log(e);
|
||||||
|
})
|
||||||
|
},
|
||||||
// 根据类型来判断是否显示
|
// 根据类型来判断是否显示
|
||||||
showControllerAllLet() {
|
showControllerAllLet() {
|
||||||
let user;
|
let user;
|
||||||
@ -438,8 +310,8 @@
|
|||||||
this.nowMenuList = [];
|
this.nowMenuList = [];
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
clickMenu(e, data) {
|
clickMenu(data) {
|
||||||
this.getUniMp(e, data);
|
this.getUniMp(data);
|
||||||
},
|
},
|
||||||
// 添加菜单
|
// 添加菜单
|
||||||
pushMenu(data) {
|
pushMenu(data) {
|
||||||
@ -460,28 +332,23 @@
|
|||||||
this.editFlag = false;
|
this.editFlag = false;
|
||||||
uni.setStorageSync('gatherNowMenuList', JSON.stringify(this.nowMenuList));
|
uni.setStorageSync('gatherNowMenuList', JSON.stringify(this.nowMenuList));
|
||||||
},
|
},
|
||||||
getUniMp(type, data) {
|
getUniMp(data) {
|
||||||
let that = this;
|
let that = this;
|
||||||
|
|
||||||
// #ifdef APP-PLUS
|
// #ifdef APP-PLUS
|
||||||
switch (type) {
|
if(data.version) return uniMP.loadAppletMP(data);
|
||||||
|
else switch (data.type) {
|
||||||
case 1:
|
case 1:
|
||||||
uniMP.loadMP(data);
|
uniMP.loadMP(data.data);
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
uniMP.loadMPx(data);
|
uniMP.loadMPx(data.data);
|
||||||
break;
|
break;
|
||||||
// case 2:
|
|
||||||
// // this.navigator(data);
|
|
||||||
// // uniMP.loadMPx(data);
|
|
||||||
// that.navigator(`/pages/moreProject/moreProject`);
|
|
||||||
// break;
|
|
||||||
|
|
||||||
case 3:
|
case 3:
|
||||||
uniMP.loadMPurl(data);
|
uniMP.loadMPurl(data.data);
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
uniMP.loadMPdns(data);
|
uniMP.loadMPdns(data.data);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
@ -962,7 +962,6 @@ import { Toast } from '../../../libs/uniApi';
|
|||||||
that.validate = true;
|
that.validate = true;
|
||||||
}, 1000)
|
}, 1000)
|
||||||
}
|
}
|
||||||
|
|
||||||
}).catch(res => {
|
}).catch(res => {
|
||||||
this.isshow = false
|
this.isshow = false
|
||||||
that.validate = true;
|
that.validate = true;
|
||||||
|
@ -3,7 +3,7 @@ import {
|
|||||||
miniapp
|
miniapp
|
||||||
} from "@/api/uniMP.js";
|
} from "@/api/uniMP.js";
|
||||||
import {
|
import {
|
||||||
HTTP_REQUEST_URL
|
ENV
|
||||||
} from '@/config/app';
|
} from '@/config/app';
|
||||||
const mp = uni.requireNativePlugin('uniMP');
|
const mp = uni.requireNativePlugin('uniMP');
|
||||||
import store from "@/store/modules/app.js"
|
import store from "@/store/modules/app.js"
|
||||||
@ -33,13 +33,12 @@ const loadMP = async (id) => {
|
|||||||
appid = id;
|
appid = id;
|
||||||
let info = await getGXconfig();
|
let info = await getGXconfig();
|
||||||
console.log('最新版本', info.data);
|
console.log('最新版本', info.data);
|
||||||
console.log(mp, uni);
|
|
||||||
// return ;
|
// return ;
|
||||||
uni.$emit('showLoading', true, '初始化中');
|
uni.$emit('showLoading', true, '初始化中');
|
||||||
mp.getUniMPVersion(id, (ret) => {
|
mp.getUniMPVersion(id, (ret) => {
|
||||||
console.log('当前版本', ret);
|
console.log('当前版本', ret);
|
||||||
let flag;
|
let flag;
|
||||||
if (HTTP_REQUEST_URL == 'https://shop.lihaink.cn') {
|
if (ENV == 'prod') {
|
||||||
flag = false
|
flag = false
|
||||||
} else {
|
} else {
|
||||||
flag = true
|
flag = true
|
||||||
@ -94,7 +93,7 @@ const loadMPx = async (id) => {
|
|||||||
mp.getUniMPVersion(id, (ret) => {
|
mp.getUniMPVersion(id, (ret) => {
|
||||||
console.log('当前版本', ret);
|
console.log('当前版本', ret);
|
||||||
let flag;
|
let flag;
|
||||||
if (HTTP_REQUEST_URL == 'https://shop.lihaink.cn') {
|
if (ENV == 'prod') {
|
||||||
flag = false
|
flag = false
|
||||||
} else {
|
} else {
|
||||||
flag = true
|
flag = true
|
||||||
@ -151,7 +150,7 @@ const loadMPurl = async (e) => {
|
|||||||
mp.getUniMPVersion(appid, (ret) => {
|
mp.getUniMPVersion(appid, (ret) => {
|
||||||
console.log('当前版本', ret);
|
console.log('当前版本', ret);
|
||||||
let flag;
|
let flag;
|
||||||
if (HTTP_REQUEST_URL == 'https://shop.lihaink.cn') {
|
if (ENV == 'prod') {
|
||||||
flag = false
|
flag = false
|
||||||
} else {
|
} else {
|
||||||
flag = true
|
flag = true
|
||||||
@ -201,6 +200,56 @@ const loadMPurl = async (e) => {
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// 商城配置的小程序
|
||||||
|
const loadAppletMP = async (data) => {
|
||||||
|
appid = data.app_id;
|
||||||
|
// return ;
|
||||||
|
uni.$emit('showLoading', true, '初始化中');
|
||||||
|
mp.getUniMPVersion(appid, (ret) => {
|
||||||
|
let flag;
|
||||||
|
if (ENV == 'prod') {
|
||||||
|
flag = false
|
||||||
|
} else {
|
||||||
|
flag = true
|
||||||
|
}
|
||||||
|
if (0 != ret.code || compareVersions(data.version, ret.versionInfo.name) == 1 || flag ==
|
||||||
|
true) {
|
||||||
|
let count = 0;
|
||||||
|
timer = setInterval(() => {
|
||||||
|
if (count < 100 && count > 0) uni.$emit('showLoading', true, `初始化中... ${count}%`)
|
||||||
|
else uni.$emit('showLoading', true, `初始化中... 99%`)
|
||||||
|
}, 200)
|
||||||
|
let downloadTask = uni.downloadFile({
|
||||||
|
url: data.url,
|
||||||
|
success(res) {
|
||||||
|
wgtFile = res.tempFilePath;
|
||||||
|
console.log('初始化完成', wgtFile);
|
||||||
|
setTimeout(()=>{
|
||||||
|
installMP();
|
||||||
|
clearInterval(timer);
|
||||||
|
timer = null;
|
||||||
|
}, 700)
|
||||||
|
},
|
||||||
|
fail(res) {
|
||||||
|
clearInterval(timer);
|
||||||
|
timer = null;
|
||||||
|
uni.hideLoading();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
downloadTask.onProgressUpdate((res) => {
|
||||||
|
// console.log('初始化进度' + res.progress);
|
||||||
|
if (res.progress > count) count += 10;
|
||||||
|
if (count >= 90) {
|
||||||
|
clearInterval(timer);
|
||||||
|
timer = null;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
open()
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
// 按远程文件地址加载小程序
|
// 按远程文件地址加载小程序
|
||||||
const loadMPdns = async (e) => {
|
const loadMPdns = async (e) => {
|
||||||
appid = e.id;
|
appid = e.id;
|
||||||
@ -310,6 +359,7 @@ export default {
|
|||||||
loadMPx,
|
loadMPx,
|
||||||
loadMPdns,
|
loadMPdns,
|
||||||
installMP,
|
installMP,
|
||||||
|
loadAppletMP,
|
||||||
doInstallMP,
|
doInstallMP,
|
||||||
getVersion,
|
getVersion,
|
||||||
open
|
open
|
||||||
|
Loading…
x
Reference in New Issue
Block a user