更新六个讯飞AI小程序

This commit is contained in:
weipengfei 2023-09-27 11:12:19 +08:00
parent 922ba1b054
commit c507002424

View File

@ -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,35 @@
</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 +98,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 +112,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">
@ -87,48 +133,48 @@
</template> </template>
<script> <script>
import Cache from '@/utils/cache'; import Cache from '@/utils/cache';
import mTabbar from '@/components/m-tabbar/m-tabbar.vue' import mTabbar from '@/components/m-tabbar/m-tabbar.vue'
import zbpSwiper from '@/components/zbpSwiper' import zbpSwiper from '@/components/zbpSwiper'
import { import {
getArea, getArea,
getStreet getStreet
} from '@/api/article.js'; } from '@/api/article.js';
import { import {
mapState, mapState,
mapGetters mapGetters
} from 'vuex' } from 'vuex'
import { import {
getWorkArticleCount, getWorkArticleCount,
getSlideAPI getSlideAPI
} from '@/api/article.js' } from '@/api/article.js'
import { import {
getStoreList, getStoreList,
getUserInfo getUserInfo
} from '@/api/user.js' } from '@/api/user.js'
import { import {
getGeocoder, getGeocoder,
microSeachBarCode, microSeachBarCode,
microEadtProduct microEadtProduct
} from '@/api/store.js' } from '@/api/store.js'
import { import {
Toast Toast
} from '@/libs/uniApi'; } from '@/libs/uniApi';
import { import {
getDiy getDiy
} from '@/api/api.js'; } from '@/api/api.js';
// #ifdef APP-PLUS // #ifdef APP-PLUS
import uniMP from '@/utils/uniMP.js'; import uniMP from '@/utils/uniMP.js';
// #endif // #endif
export default { export default {
components: { components: {
mTabbar, mTabbar,
zbpSwiper zbpSwiper
}, },
data() { data () {
return { return {
locationArr: ({}), locationArr: ({}),
emptyText: '暂无可用应用', emptyText: '暂无可用应用',
@ -146,11 +192,10 @@
// //
editFlag: false, editFlag: false,
// //
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,
}, },
{ {
@ -164,9 +209,54 @@
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: [],
@ -181,13 +271,13 @@
computed: { computed: {
...mapGetters(['userInfo', 'location', 'isLogin']) ...mapGetters(['userInfo', 'location', 'isLogin'])
}, },
created() {}, created () { },
onLoad() { onLoad () {
this.Area() this.Area()
this.initMenu(); this.initMenu();
}, },
onShow() { onShow () {
if (this.isLogin) { if (this.isLogin) {
this.emptyText = '暂无可用应用' this.emptyText = '暂无可用应用'
this.jurisdiction = false this.jurisdiction = false
@ -199,15 +289,15 @@
}, },
onPullDownRefresh() { onPullDownRefresh () {
this.getUserInfo() this.getUserInfo()
uni.stopPullDownRefresh() uni.stopPullDownRefresh()
}, },
beforeDestroy() { beforeDestroy () {
// //
this.$bus.$off('value-updated') this.$bus.$off('value-updated')
}, },
mounted() { mounted () {
if (this.street.length <= 0) { if (this.street.length <= 0) {
this.appLocation() this.appLocation()
} }
@ -223,7 +313,7 @@
}, },
// #ifdef APP-PLUS // #ifdef APP-PLUS
onPageScroll(e) { onPageScroll (e) {
const scrollTop = e.scrollTop; const scrollTop = e.scrollTop;
if (scrollTop <= 20) { if (scrollTop <= 20) {
this.backColor = 'rgba(252, 252, 252, 0)' this.backColor = 'rgba(252, 252, 252, 0)'
@ -239,7 +329,7 @@
// #endif // #endif
methods: { methods: {
scrolling() { scrolling () {
// //
let scrollTop = let scrollTop =
window.pageYOffset || window.pageYOffset ||
@ -281,7 +371,7 @@
}, },
// //
initMenu() { initMenu () {
let now = uni.getStorageSync('gatherNowMenuList'); let now = uni.getStorageSync('gatherNowMenuList');
try { try {
this.nowMenuList = JSON.parse(now); this.nowMenuList = JSON.parse(now);
@ -292,42 +382,35 @@
this.nowMenuList = []; this.nowMenuList = [];
} }
}, },
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) {
this.nowMenuList.push(data); this.nowMenuList.push(data);
this.AllMenuList = this.AllMenuList.filter((item) => { this.AllMenuList = this.AllMenuList.filter((item) => {
return item.name != data.name; return item.name != data.name;
}) })
}, },
// //
removeMenu(data) { removeMenu (data) {
this.AllMenuList.push(data); this.AllMenuList.push(data);
this.nowMenuList = this.nowMenuList.filter((item) => { this.nowMenuList = this.nowMenuList.filter((item) => {
return item.name != data.name; return item.name != data.name;
}) })
}, },
// //
editComfirm() { editComfirm () {
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({
@ -335,7 +418,7 @@
title: 'H5不支持打开小程序' title: 'H5不支持打开小程序'
}) })
}, },
changeHandler(e) { changeHandler (e) {
const { const {
columnIndex, columnIndex,
value, value,
@ -352,7 +435,7 @@
} }
}, },
Area() { Area () {
getArea({ getArea({
city_code: 510500 city_code: 510500
}).then(res => { }).then(res => {
@ -360,17 +443,17 @@
this.Street(res.data[0]['code']); this.Street(res.data[0]['code']);
}); });
}, },
Street(code) { Street (code) {
getStreet({ getStreet({
area_code: code area_code: code
}).then(res => { }).then(res => {
this.$refs.uPicker.setColumnValues(1, res.data); this.$refs.uPicker.setColumnValues(1, res.data);
}); });
}, },
selectLocation() { selectLocation () {
this.showPicker = true this.showPicker = true
}, },
confirm(e) { confirm (e) {
this.street = e.value[1].name this.street = e.value[1].name
this.$nextTick(() => { this.$nextTick(() => {
@ -379,7 +462,7 @@
}) })
this.showPicker = false this.showPicker = false
}, },
appLocation() { appLocation () {
uni.getLocation({ uni.getLocation({
type: 'wgs84', type: 'wgs84',
timeout: '10', timeout: '10',
@ -418,16 +501,17 @@
}, },
navigator(url, t) { navigator (url, t) {
// if (this.userInfoData.is_wsxx === 0 && t != '') return Toast(""); // if (this.userInfoData.is_wsxx === 0 && t != '') return Toast("");
uni.navigateTo({ uni.navigateTo({
url: url url: url
}) })
}, },
getUserInfo: function() { getUserInfo: function () {
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');
@ -444,22 +528,22 @@
}); });
} }
} }
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.gather { .gather {
padding-bottom: 164.91rpx; padding-bottom: 164.91rpx;
background: linear-gradient(180deg, #ffffff 0%, #f6f6f6 100%); background: linear-gradient(180deg, #ffffff 0%, #f6f6f6 100%);
position: relative; position: relative;
} }
.sitebox { .sitebox {
animation-name: fadeIn; animation-name: fadeIn;
animation-duration: 3s; animation-duration: 3s;
animation-fill-mode: forwards; animation-fill-mode: forwards;
} }
@keyframes fadeIn { @keyframes fadeIn {
from { from {
opacity: 0; opacity: 0;
} }
@ -467,9 +551,9 @@
to { to {
opacity: 1; opacity: 1;
} }
} }
.site-box1 { .site-box1 {
width: 706rpx; width: 706rpx;
/* #ifdef MP || APP-PLUS */ /* #ifdef MP || APP-PLUS */
height: 160rpx; height: 160rpx;
@ -499,10 +583,9 @@
.iconfont { .iconfont {
font-size: 35.09rpx; font-size: 35.09rpx;
} }
}
} .site-box {
.site-box {
width: 100%; width: 100%;
/* #ifdef MP || APP-PLUS */ /* #ifdef MP || APP-PLUS */
height: 160rpx; height: 160rpx;
@ -522,7 +605,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;
@ -544,24 +627,24 @@
font-size: 30rpx; font-size: 30rpx;
font-size: 35.09rpx; font-size: 35.09rpx;
} }
} }
.top_box { .top_box {
// padding-top: 180rpx; // padding-top: 180rpx;
background: linear-gradient(#36a2ff, #fff); background: linear-gradient(#36a2ff, #fff);
} }
.com { .com {
margin-left: 50%; margin-left: 50%;
transform: translate(-50%); transform: translate(-50%);
} }
.business { .business {
width: 694.74rpx; width: 694.74rpx;
// margin-bottom: 175rpx; // margin-bottom: 175rpx;
} }
.special_work { .special_work {
// padding: 17.54rpx; // padding: 17.54rpx;
width: 694.74rpx; width: 694.74rpx;
margin-top: 52.63rpx; margin-top: 52.63rpx;
@ -651,10 +734,10 @@
} }
} }
} }
} }
.edit_card { .edit_card {
background-color: #fff; background-color: #fff;
padding-top: 28rpx; padding-top: 28rpx;
} }
</style> </style>