更新讯飞六个AI小程序,优化小程序调用逻辑,修复小程序内头像未出现的bug
This commit is contained in:
parent
3a8691c0d9
commit
5cf28341eb
@ -1,38 +1,58 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="gather">
|
<view class="gather">
|
||||||
|
|
||||||
|
|
||||||
<view v-if="isFshow">
|
<view v-if="isFshow">
|
||||||
<view class="site-box flex_a_c_j_sb" :style="{ 'opacity': backColor,}" @click="selectLocation">
|
<view
|
||||||
<view :class="['place_wrapper', 'flex_a_c', isFshow ? 'sitebox' : '']" @click="selectLocation">
|
class="site-box flex_a_c_j_sb"
|
||||||
<view :class="['iconfont', 'icon-weizhi', isFshow ? 'sitebox' : '']" style=" margin-left: 20rpx">
|
:style="{ opacity: backColor }"
|
||||||
|
@click="selectLocation"
|
||||||
|
>
|
||||||
|
<view
|
||||||
|
:class="['place_wrapper', 'flex_a_c', isFshow ? 'sitebox' : '']"
|
||||||
|
@click="selectLocation"
|
||||||
|
>
|
||||||
|
<view
|
||||||
|
:class="['iconfont', 'icon-weizhi', isFshow ? 'sitebox' : '']"
|
||||||
|
style="margin-left: 20rpx"
|
||||||
|
>
|
||||||
</view>
|
</view>
|
||||||
<view class="town_name">{{ street }}</view>
|
<view class="town_name">{{ street }}</view>
|
||||||
</view>
|
</view>
|
||||||
<navigator url="/pages/chat/customer_list/index?type=0" hover-class="none">
|
<navigator
|
||||||
<view :class="['iconfont', 'icon-xiaoxi', isFshow ? 'sitebox' : '']"></view>
|
url="/pages/chat/customer_list/index?type=0"
|
||||||
|
hover-class="none"
|
||||||
|
>
|
||||||
|
<view
|
||||||
|
:class="['iconfont', 'icon-xiaoxi', isFshow ? 'sitebox' : '']"
|
||||||
|
></view>
|
||||||
</navigator>
|
</navigator>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
<view class="" v-if="!isFshow">
|
<view class="" v-if="!isFshow">
|
||||||
<view class="site-box1 flex_a_c_j_sb">
|
<view class="site-box1 flex_a_c_j_sb">
|
||||||
|
|
||||||
<view class="place_wrapper flex_a_c" @click="selectLocation">
|
<view class="place_wrapper flex_a_c" @click="selectLocation">
|
||||||
<view class="iconfont icon-weizhi"></view>
|
<view class="iconfont icon-weizhi"></view>
|
||||||
<view class="town_name">{{ street }}</view>
|
<view class="town_name">{{ street }}</view>
|
||||||
</view>
|
</view>
|
||||||
<navigator url="/pages/chat/customer_list/index?type=0" hover-class="none">
|
<navigator
|
||||||
<view class="iconfont icon-xiaoxi" style="color:#fff;"> </view>
|
url="/pages/chat/customer_list/index?type=0"
|
||||||
|
hover-class="none"
|
||||||
|
>
|
||||||
|
<view class="iconfont icon-xiaoxi" style="color: #fff"> </view>
|
||||||
</navigator>
|
</navigator>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
<zbpSwiper
|
||||||
|
:isSelectPlace="true"
|
||||||
<zbpSwiper :isSelectPlace="true" :location_Arr="locationArr" :town="street" ></zbpSwiper>
|
:location_Arr="locationArr"
|
||||||
<u-empty :show="jurisdiction" mode="permission" :text="emptyText"
|
:town="street"
|
||||||
icon="http://cdn.uviewui.com/uview/empty/permission.png"></u-empty>
|
></zbpSwiper>
|
||||||
|
<u-empty
|
||||||
|
:show="jurisdiction"
|
||||||
|
mode="permission"
|
||||||
|
:text="emptyText"
|
||||||
|
icon="http://cdn.uviewui.com/uview/empty/permission.png"
|
||||||
|
></u-empty>
|
||||||
<view class="business com special_work" v-if="jurisdiction == false">
|
<view class="business com special_work" v-if="jurisdiction == false">
|
||||||
<view class="title project">
|
<view class="title project">
|
||||||
<view>更多功能</view>
|
<view>更多功能</view>
|
||||||
@ -41,19 +61,36 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="content">
|
<view class="content">
|
||||||
<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
|
||||||
<view class="examine" @click="
|
v-for="(item, index) in nowMenuList"
|
||||||
|
:key="item.name"
|
||||||
|
show
|
||||||
|
>
|
||||||
|
<view
|
||||||
|
class="examine"
|
||||||
|
@click="
|
||||||
editFlag ? removeMenu(item) : clickMenu(item.type, item.data)
|
editFlag ? removeMenu(item) : clickMenu(item.type, item.data)
|
||||||
">
|
"
|
||||||
|
>
|
||||||
<image class="icon_img" :src="item.icon" mode="aspectFit">
|
<image class="icon_img" :src="item.icon" 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>
|
||||||
</view>
|
</view>
|
||||||
</u-transition>
|
</u-transition>
|
||||||
</block>
|
</block>
|
||||||
<view v-else-if="!editFlag" @click="editFlag = true"
|
<view
|
||||||
style="text-align: center; width: 100%; color: #aaa">还没有应用,点我添加应用</view>
|
v-else-if="!editFlag"
|
||||||
|
@click="editFlag = true"
|
||||||
|
style="text-align: center; width: 100%; color: #aaa"
|
||||||
|
>
|
||||||
|
还没有应用,点我添加应用</view
|
||||||
|
>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view v-if="editFlag" class="business com special_work edit_card">
|
<view v-if="editFlag" class="business com special_work edit_card">
|
||||||
@ -62,10 +99,13 @@
|
|||||||
<view class="edit2" @click="editComfirm">完成</view>
|
<view class="edit2" @click="editComfirm">完成</view>
|
||||||
</view>
|
</view>
|
||||||
<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 class="icon_img" :src="item.icon" mode="aspectFit"> </image>
|
||||||
</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>
|
||||||
@ -73,9 +113,16 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
<u-picker
|
||||||
<u-picker :defaultIndex="[0,0]" :show="showPicker" ref="uPicker" :columns="columnData" @confirm="confirm"
|
:defaultIndex="[0, 0]"
|
||||||
@cancel="showPicker = false" @change="changeHandler" keyName="name"></u-picker>
|
:show="showPicker"
|
||||||
|
ref="uPicker"
|
||||||
|
:columns="columnData"
|
||||||
|
@confirm="confirm"
|
||||||
|
@cancel="showPicker = false"
|
||||||
|
@change="changeHandler"
|
||||||
|
keyName="name"
|
||||||
|
></u-picker>
|
||||||
<!-- <m-tabbar native>
|
<!-- <m-tabbar native>
|
||||||
<template v-slot:tabbar_index_2>
|
<template v-slot:tabbar_index_2>
|
||||||
<view class="custom_style">
|
<view class="custom_style">
|
||||||
@ -149,7 +196,7 @@
|
|||||||
AllMenuList: [{
|
AllMenuList: [{
|
||||||
name: '商户平台',
|
name: '商户平台',
|
||||||
icon: '/static/applet/shop_app.png',
|
icon: '/static/applet/shop_app.png',
|
||||||
data: '/pages/moreProject/moreProject',
|
data: "__UNI__1EE148C",
|
||||||
type: 2,
|
type: 2,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -163,16 +210,60 @@
|
|||||||
icon: '/static/applet/ny.png',
|
icon: '/static/applet/ny.png',
|
||||||
data: {
|
data: {
|
||||||
id: '__UNI__9620511',
|
id: '__UNI__9620511',
|
||||||
url: '/static/wgt/__UNI__9620511.wgt',
|
url: 'https://ceshi-worker-task.lihaink.cn/api/common/getMiniProgramInfo?name=nongye',
|
||||||
},
|
},
|
||||||
type: 1,
|
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,
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
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)'
|
||||||
};
|
};
|
||||||
@ -273,17 +364,16 @@
|
|||||||
} else if (scrollTop > 100) {
|
} else if (scrollTop > 100) {
|
||||||
this.backColor = 'rgba(252, 252, 252, 1)'
|
this.backColor = 'rgba(252, 252, 252, 1)'
|
||||||
this.isFshow = true
|
this.isFshow = true
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
},
|
},
|
||||||
// 初始化菜单
|
// 初始化菜单
|
||||||
initMenu () {
|
initMenu () {
|
||||||
let now = uni.getStorageSync('gatherNowMenuList');
|
let now = uni.getStorageSync('gatherNowMenuList');
|
||||||
try {
|
try {
|
||||||
this.nowMenuList = JSON.parse(now);
|
let arr = JSON.parse(now);
|
||||||
|
this.nowMenuList = this.AllMenuList.filter((item) => {
|
||||||
|
return arr.find(t => t.name == item.name)?.name == item.name;
|
||||||
|
})
|
||||||
this.AllMenuList = this.AllMenuList.filter((item) => {
|
this.AllMenuList = this.AllMenuList.filter((item) => {
|
||||||
return this.nowMenuList.find(t => t.name == item.name)?.name != item.name;
|
return this.nowMenuList.find(t => t.name == item.name)?.name != item.name;
|
||||||
})
|
})
|
||||||
@ -292,14 +382,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
clickMenu (e, data) {
|
clickMenu (e, data) {
|
||||||
switch (e) {
|
this.getUniMp(e, data);
|
||||||
case 1:
|
|
||||||
this.getUniMp(data);
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
this.navigator(data);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
// 添加菜单
|
// 添加菜单
|
||||||
pushMenu (data) {
|
pushMenu (data) {
|
||||||
@ -320,13 +403,13 @@
|
|||||||
this.editFlag = false;
|
this.editFlag = false;
|
||||||
uni.setStorageSync('gatherNowMenuList', JSON.stringify(this.nowMenuList));
|
uni.setStorageSync('gatherNowMenuList', JSON.stringify(this.nowMenuList));
|
||||||
},
|
},
|
||||||
getUniMp(data) {
|
getUniMp (type, data) {
|
||||||
// #ifdef APP-PLUS
|
// #ifdef APP-PLUS
|
||||||
console.log(data, typeof data == 'string');
|
switch (type) {
|
||||||
if(typeof data == 'string') uniMP.loadMP(data);
|
case 1: uniMP.loadMP(data); break;
|
||||||
else uniMP.loadMPurl(data);
|
case 2: uniMP.loadMPx(data); break;
|
||||||
// uniMP.loadMPurl(data);
|
case 3: uniMP.loadMPurl(data); break;
|
||||||
// uniMP.open(data.id);
|
}
|
||||||
return;
|
return;
|
||||||
// #endif
|
// #endif
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
@ -350,6 +433,22 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
changeHandler (e) {
|
||||||
|
const {
|
||||||
|
columnIndex,
|
||||||
|
value,
|
||||||
|
values,
|
||||||
|
index,
|
||||||
|
picker = this.$refs.uPicker
|
||||||
|
} = e;
|
||||||
|
if (columnIndex === 0) {
|
||||||
|
getStreet({
|
||||||
|
area_code: value[0]['code']
|
||||||
|
}).then(res => {
|
||||||
|
this.$refs.uPicker.setColumnValues(1, res.data);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
Area () {
|
Area () {
|
||||||
getArea({
|
getArea({
|
||||||
@ -427,6 +526,7 @@
|
|||||||
let that = this;
|
let that = this;
|
||||||
getUserInfo().then(res => {
|
getUserInfo().then(res => {
|
||||||
that.userInfoData = res.data;
|
that.userInfoData = res.data;
|
||||||
|
that.$store.commit('SET_USERINFO', res.data);
|
||||||
// console.log(res.data.service);
|
// console.log(res.data.service);
|
||||||
if (res.data.service == null) {
|
if (res.data.service == null) {
|
||||||
// console.log('123');
|
// console.log('123');
|
||||||
@ -496,7 +596,6 @@
|
|||||||
.iconfont {
|
.iconfont {
|
||||||
font-size: 35.09rpx;
|
font-size: 35.09rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
.site-box {
|
.site-box {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
@ -518,7 +617,7 @@
|
|||||||
padding-top: 25rpx;
|
padding-top: 25rpx;
|
||||||
/* #endif */
|
/* #endif */
|
||||||
// background-color: #e5e5e5;
|
// background-color: #e5e5e5;
|
||||||
background: url('@/static/images/bg2.png') no-repeat;
|
background: url("@/static/images/bg2.png") no-repeat;
|
||||||
background-size: 100% 100%;
|
background-size: 100% 100%;
|
||||||
padding-right: 20rpx;
|
padding-right: 20rpx;
|
||||||
|
|
||||||
|
@ -152,17 +152,68 @@ const loadMPx = async (id) => {
|
|||||||
// 按URL加载小程序
|
// 按URL加载小程序
|
||||||
const loadMPurl = async (e) => {
|
const loadMPurl = async (e) => {
|
||||||
appid = e.id;
|
appid = e.id;
|
||||||
|
let FURL = e.url;
|
||||||
|
uni.showLoading({
|
||||||
|
title: '初始化中...',
|
||||||
|
mask: true
|
||||||
|
})
|
||||||
|
uni.request({
|
||||||
|
url: FURL,
|
||||||
|
method: 'GET',
|
||||||
|
success: (fileInfo) => {
|
||||||
mp.getUniMPVersion(appid, (ret) => {
|
mp.getUniMPVersion(appid, (ret) => {
|
||||||
console.log('当前版本', ret);
|
console.log('当前版本', ret);
|
||||||
wgtFile = e.url;
|
let flag;
|
||||||
doInstallMP();
|
if (HTTP_REQUEST_URL == 'https://shop.lihaink.cn') {
|
||||||
// if (0 != ret.code) {
|
flag = false
|
||||||
// wgtFile = e.url;
|
} else {
|
||||||
// installMP();
|
flag = true
|
||||||
// } else {
|
}
|
||||||
// open()
|
if (0 != ret.code || compareVersions(fileInfo.data?.data?.version, ret.versionInfo.name) == 1 || flag ==
|
||||||
// }
|
true) {
|
||||||
|
let count = 0;
|
||||||
|
timer = setInterval(() => {
|
||||||
|
if (count < 100) uni.showLoading({
|
||||||
|
title: `初始化中... ${count}%`,
|
||||||
|
mask: true
|
||||||
|
})
|
||||||
|
else uni.showLoading({
|
||||||
|
title: '初始化中...100%',
|
||||||
|
mask: true
|
||||||
|
})
|
||||||
|
}, 600)
|
||||||
|
let downloadTask = uni.downloadFile({
|
||||||
|
url: fileInfo.data?.data?.down_url,
|
||||||
|
success(res) {
|
||||||
|
wgtFile = res.tempFilePath;
|
||||||
|
console.log('初始化完成', wgtFile);
|
||||||
|
installMP();
|
||||||
|
},
|
||||||
|
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()
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
},
|
||||||
|
fail:(err)=> {
|
||||||
|
console.log('错误:', err);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// 小程序版本信息
|
// 小程序版本信息
|
||||||
|
Loading…
x
Reference in New Issue
Block a user