This commit is contained in:
杨鹏
2025-09-23 22:27:41 +08:00
parent 232cea0f7e
commit aed85c92df
19 changed files with 238 additions and 374 deletions
+2 -2
View File
@@ -2,10 +2,10 @@
SHOPRO_VERSION=v2.4.1 SHOPRO_VERSION=v2.4.1
# 后端接口 - 正式环境(通过 process.env.NODE_ENV 非 development # 后端接口 - 正式环境(通过 process.env.NODE_ENV 非 development
SHOPRO_BASE_URL=http://api-dashboard.yudao.iocoder.cn SHOPRO_BASE_URL=https://puton.huimeimeta.com
# 后端接口 - 测试环境(通过 process.env.NODE_ENV = development # 后端接口 - 测试环境(通过 process.env.NODE_ENV = development
SHOPRO_DEV_BASE_URL=http://114.215.197.144:8080 SHOPRO_DEV_BASE_URL=https://puton.huimeimeta.com
# SHOPRO_DEV_BASE_URL=http://127.0.0.1:48080 # SHOPRO_DEV_BASE_URL=http://127.0.0.1:48080
### SHOPRO_DEV_BASE_URL=http://10.171.1.188:48080 ### SHOPRO_DEV_BASE_URL=http://10.171.1.188:48080
### SHOPRO_DEV_BASE_URL = http://yunai.natapp1.cc ### SHOPRO_DEV_BASE_URL = http://yunai.natapp1.cc
+3 -3
View File
@@ -1,6 +1,6 @@
{ {
"name": "商城", "name": "美搭",
"appid": "__UNI__460BC4C", "appid": "__UNI__085F6F7",
"description": "基于 uni-app + Vue3 技术驱动的在线商城系统,内含诸多功能与丰富的活动,期待您的使用和反馈。", "description": "基于 uni-app + Vue3 技术驱动的在线商城系统,内含诸多功能与丰富的活动,期待您的使用和反馈。",
"versionName": "2025.09", "versionName": "2025.09",
"versionCode": "183", "versionCode": "183",
@@ -182,7 +182,7 @@
"versionCode": 100 "versionCode": 100
}, },
"mp-weixin": { "mp-weixin": {
"appid": "wx66186af0759f47c9", "appid": "wx736793c30c956243",
"setting": { "setting": {
"urlCheck": false, "urlCheck": false,
"minified": true, "minified": true,
+4 -15
View File
@@ -55,13 +55,13 @@
} }
}, },
{ {
"path": "pages/index/chat", "path": "pages/index/cart",
"style": { "style": {
"navigationBarTitleText": "聊天" "navigationBarTitleText": "购物车"
}, },
"meta": { "meta": {
"sync": true, "sync": true,
"title": "聊天", "title": "购物车",
"group": "商城" "group": "商城"
} }
}, },
@@ -76,17 +76,6 @@
"group": "商城" "group": "商城"
} }
}, },
{
"path": "pages/index/cart",
"style": {
"navigationBarTitleText": "购物车"
},
"meta": {
"sync": true,
"title": "购物车",
"group": "商城"
}
},
{ {
"path": "pages/index/login", "path": "pages/index/login",
"style": { "style": {
@@ -739,7 +728,7 @@
"pagePath": "pages/index/room" "pagePath": "pages/index/room"
}, },
{ {
"pagePath": "pages/index/chat" "pagePath": "pages/index/cart"
}, },
{ {
"pagePath": "pages/index/user" "pagePath": "pages/index/user"
+1 -2
View File
@@ -54,10 +54,9 @@
}, },
set(newValue) { set(newValue) {
emits(`update:modelValue`, newValue); emits(`update:modelValue`, newValue);
} },
}); });
// 打开工具菜单 // 打开工具菜单
function onTools(mode) { function onTools(mode) {
emits('onTools', mode); emits('onTools', mode);
-223
View File
@@ -1,223 +0,0 @@
<template>
<s-layout
class="chat-wrap"
:title="!isReconnecting ? '连接客服成功' : '会话重连中'"
navbar="inner"
tabbar="/pages/index/chat"
>
<!-- 覆盖头部导航栏背景颜色 -->
<view class="page-bg" :style="{ height: sys_navBar + 'px' }"></view>
<!-- 聊天区域 -->
<MessageList ref="messageListRef">
<template #bottom>
<message-input
v-model="chat.msg"
@on-tools="onTools"
@send-message="onSendMessage"
:auto-focus="false"
:show-char-count="true"
:max-length="500"
></message-input>
</template>
</MessageList>
<!-- 聊天工具 -->
<tools-popup
:show-tools="chat.showTools"
:tools-mode="chat.toolsMode"
@close="handleToolsClose"
@on-emoji="onEmoji"
@image-select="onSelect"
@on-show-select="onShowSelect"
>
<message-input
v-model="chat.msg"
@on-tools="onTools"
@send-message="onSendMessage"
:auto-focus="false"
:show-char-count="true"
:max-length="500"
></message-input>
</tools-popup>
<!-- 商品订单选择 -->
<SelectPopup
:mode="chat.selectMode"
:show="chat.showSelect"
@select="onSelect"
@close="chat.showSelect = false"
/>
</s-layout>
</template>
<script setup>
import MessageList from '@/pages/chat/components/messageList.vue';
import { reactive, ref, toRefs } from 'vue';
import sheep from '@/sheep';
import ToolsPopup from '@/pages/chat/components/toolsPopup.vue';
import MessageInput from '@/pages/chat/components/messageInput.vue';
import SelectPopup from '@/pages/chat/components/select-popup.vue';
import {
KeFuMessageContentTypeEnum,
WebSocketMessageTypeConstants,
} from '@/pages/chat/util/constants';
import FileApi from '@/sheep/api/infra/file';
import KeFuApi from '@/sheep/api/promotion/kefu';
import { useWebSocket } from '@/pages/chat/util/useWebSocket';
import { jsonParse } from '@/sheep/helper/utils';
const sys_navBar = sheep.$platform.navbar;
const chat = reactive({
msg: '',
scrollInto: '',
showTools: false,
toolsMode: '',
showSelect: false,
selectMode: '',
});
// 发送消息
async function onSendMessage() {
if (!chat.msg) return;
try {
const data = {
contentType: KeFuMessageContentTypeEnum.TEXT,
content: JSON.stringify({ text: chat.msg }),
};
await KeFuApi.sendKefuMessage(data);
chat.msg = '';
} finally {
chat.showTools = false;
}
}
const messageListRef = ref();
//======================= 聊天工具相关 start =======================
function handleToolsClose() {
chat.showTools = false;
chat.toolsMode = '';
}
function onEmoji(item) {
chat.msg += item.name;
}
// 点击工具栏开关
function onTools(mode) {
if (isReconnecting.value) {
sheep.$helper.toast('您已掉线!请返回重试');
return;
}
// 第二次点击关闭
if (chat.showTools && chat.toolsMode === mode) {
handleToolsClose();
return;
}
// 切换工具栏
if (chat.showTools && chat.toolsMode !== mode) {
chat.showTools = false;
chat.toolsMode = '';
}
// 延迟打开等一下过度效果
setTimeout(() => {
chat.toolsMode = mode;
chat.showTools = true;
}, 200);
}
function onShowSelect(mode) {
chat.showTools = false;
chat.showSelect = true;
chat.selectMode = mode;
}
async function onSelect({ type, data }) {
let msg;
switch (type) {
case 'image':
const res = await FileApi.uploadFile(data.tempFiles[0].path);
msg = {
contentType: KeFuMessageContentTypeEnum.IMAGE,
content: JSON.stringify({ picUrl: res.data }),
};
break;
case 'goods':
msg = {
contentType: KeFuMessageContentTypeEnum.PRODUCT,
content: JSON.stringify(data),
};
break;
case 'order':
msg = {
contentType: KeFuMessageContentTypeEnum.ORDER,
content: JSON.stringify(data),
};
break;
}
if (msg) {
// 发送消息
// scrollBottom();
await KeFuApi.sendKefuMessage(msg);
await messageListRef.value.refreshMessageList();
chat.showTools = false;
chat.showSelect = false;
chat.selectMode = '';
}
}
//======================= 聊天工具相关 end =======================
const { options } = useWebSocket({
// 连接成功
onConnected: async () => {},
// 收到消息
onMessage: async (data) => {
const type = data.type;
if (!type) {
console.error('未知的消息类型:' + data);
return;
}
// 2.2 消息类型:KEFU_MESSAGE_TYPE
if (type === WebSocketMessageTypeConstants.KEFU_MESSAGE_TYPE) {
// 刷新消息列表
await messageListRef.value.refreshMessageList(jsonParse(data.content));
return;
}
// 2.3 消息类型:KEFU_MESSAGE_ADMIN_READ
if (type === WebSocketMessageTypeConstants.KEFU_MESSAGE_ADMIN_READ) {
console.log('管理员已读消息');
// 更新消息已读状态
sheep.$helper.toast('客服已读您的消息');
}
},
});
const isReconnecting = toRefs(options).isReconnecting; // 重连状态
</script>
<style scoped lang="scss">
.chat-wrap {
.page-bg {
width: 100%;
position: absolute;
top: 0;
left: 0;
background-color: var(--ui-BG-Main);
z-index: 1;
}
.status {
position: relative;
box-sizing: border-box;
z-index: 3;
height: 70rpx;
padding: 0 30rpx;
background: var(--ui-BG-Main-opacity-1);
display: flex;
align-items: center;
font-size: 30rpx;
font-weight: 400;
color: var(--ui-BG-Main);
}
}
</style>
@@ -0,0 +1,75 @@
<template>
<cover-view class="cover-view-ctn">
<cover-view
class="cover-tabbar-item"
v-for="(item, index) in tabbar.items"
:key="item.text"
@tap="sheep.$router.go(item.url)"
>
<cover-view class="content-box">
<cover-image class="tabbar-icon" :src="sheep.$url.cdn(item.iconUrl)" />
<cover-view class="active-line" v-show="activeUrl === item.url" />
</cover-view>
</cover-view>
</cover-view>
</template>
<script setup>
import { computed, unref } from 'vue';
import sheep from '@/sheep';
import SuTabbar from '@/sheep/ui/su-tabbar/su-tabbar.vue';
const tabbar = computed(() => {
return sheep.$store('app').template.basic?.tabbar;
});
const props = defineProps({
activeUrl: {
type: String,
default: '',
},
});
</script>
<style lang="scss" scoped>
.cover-view-ctn {
width: 100%;
height: 50px;
position: fixed;
left: 0;
bottom: -1px;
display: flex;
justify-content: space-around;
align-items: center;
box-shadow: 0px -2px 4px 0px rgba(51, 51, 51, 0.06);
z-index: 9999;
padding-bottom: env(safe-area-inset-bottom);
background: #fff;
.cover-tabbar-item {
flex: 1;
.content-box {
display: flex;
flex-direction: column;
align-items: center;
position: relative;
height: 32px;
.tabbar-icon {
width: 25px;
height: 25px;
}
.active-line {
width: 20rpx;
height: 1rpx;
background: #000;
position: absolute;
left: calc(50% - 10rpx);
bottom: 0rpx;
}
}
}
}
</style>
+58 -94
View File
@@ -1,94 +1,58 @@
<!-- 这里是模板原来的首页代码 --> <template>
<!-- 首页支持店铺装修 --> <view>
<template> <s-layout title="首页" navbar="custom" tabbar="" :bgStyle="{ color: '#fff' }">
<view v-if="template"> <web-view :src="url">
<s-layout <cover-view-tabbar activeUrl="/pages/index/index" />
title="首页" </web-view>
navbar="custom" </s-layout>
tabbar="/pages/index/index" </view>
:bgStyle="template.page" </template>
:navbarStyle="template.navigationBar"
onShareAppMessage <script setup>
> import { computed, ref } from 'vue';
<s-block import { onLoad, onPageScroll, onPullDownRefresh } from '@dcloudio/uni-app';
v-for="(item, index) in template.components" import sheep from '@/sheep';
:key="index" import $share from '@/sheep/platform/share';
:styles="item.property.style" import CoverViewTabbar from '@/pages/index/components/cover-view-tabbar.vue';
>
<s-block-item :type="item.id" :data="item.property" :styles="item.property.style" /> // 隐藏原生tabBar
</s-block> uni.hideTabBar({
</s-layout> fail: () => {},
</view> });
</template>
const tabbar = computed(() => {
<script setup> return sheep.$store('app').template.basic?.tabbar;
import { computed } from 'vue'; });
import { onLoad, onPageScroll, onPullDownRefresh } from '@dcloudio/uni-app';
import sheep from '@/sheep'; const template = computed(() => sheep.$store('app').template?.home);
import $share from '@/sheep/platform/share';
// 隐藏原生tabBar onLoad((options) => {
uni.hideTabBar({ // #ifdef MP
fail: () => {}, // 小程序识别二维码
}); if (options.scene) {
const sceneParams = decodeURIComponent(options.scene).split('=');
const template = computed(() => sheep.$store('app').template?.home); console.log('sceneParams=>', sceneParams);
// 在此处拦截改变一下首页轮播图 此处先写死后期复活 放到启动函数里 options[sceneParams[0]] = sceneParams[1];
// (async function() { }
// console.log('原代码首页定制化数据',template) // #endif
// let {
// data // 预览模板
// } = await index2Api.decorate(); if (options.templateId) {
// console.log('首页导航配置化过高无法兼容',JSON.parse(data[1].value)) sheep.$store('app').init(options.templateId);
// 改变首页底部数据 但是没有通过数组id获取商品数据接口 }
// let {
// data: datas // 解析分享信息
// } = await index2Api.spids(); if (options.spm) {
// template.value.data[9].data.goodsIds = datas.list.map(item => item.id); $share.decryptSpm(options.spm);
// template.value.data[0].data.list = JSON.parse(data[0].value).map(item => { }
// return {
// src: item.picUrl, // 进入指定页面(完整页面路径)
// url: item.url, if (options.page) {
// title: item.name, sheep.$router.go(decodeURIComponent(options.page));
// type: "image" }
// } });
// })
// }()) const url = ref('https://www.baidu.com');
</script>
onLoad((options) => {
// #ifdef MP <style lang="scss" scoped></style>
// 小程序识别二维码
if (options.scene) {
const sceneParams = decodeURIComponent(options.scene).split('=');
console.log('sceneParams=>', sceneParams);
options[sceneParams[0]] = sceneParams[1];
}
// #endif
// 预览模板
if (options.templateId) {
sheep.$store('app').init(options.templateId);
}
// 解析分享信息
if (options.spm) {
$share.decryptSpm(options.spm);
}
// 进入指定页面(完整页面路径)
if (options.page) {
sheep.$router.go(decodeURIComponent(options.page));
}
});
// 下拉刷新
onPullDownRefresh(() => {
sheep.$store('app').init();
setTimeout(function () {
uni.stopPullDownRefresh();
}, 800);
});
onPageScroll(() => {});
</script>
<style></style>
+4 -1
View File
@@ -27,7 +27,7 @@
> >
{{ sortState.sortList[0].name }} {{ sortState.sortList[0].name }}
<image <image
src="https://3d.aidigitalfield.com/imgs/down-icon.png" src="https://puton.huimeimeta.com/imgs/down-icon.png"
style="width: 36rpx; height: 36rpx" style="width: 36rpx; height: 36rpx"
/> />
</view> </view>
@@ -130,6 +130,8 @@
onLoad(async (params) => { onLoad(async (params) => {
await getCategoryList(); await getCategoryList();
getList(); getList();
// await CategoryApi.getCategoryTree();
}); });
const categoryState = reactive({ const categoryState = reactive({
@@ -155,6 +157,7 @@
sort: 0, sort: 0,
order: false, order: false,
}); });
console.log(categoryState.categoryList, 'categoryState.categoryList');
} }
const sortState = reactive({ const sortState = reactive({
+45 -5
View File
@@ -17,9 +17,14 @@
<s-block-item :type="item.id" :data="item.property" :styles="item.property.style" /> <s-block-item :type="item.id" :data="item.property" :styles="item.property.style" />
</s-block> </s-block>
<userTryOn /> <userTryOn />
<view class="logout-box" v-if="isLogin">
<button class="ss-rest-button logout-btn" @click="handleLayout">退出登录</button>
</view>
<!-- 购物车 --> <!-- 购物车 -->
<view class="cart-box" @click="sheep.$router.go('/pages/index/cart')"> <view class="chat-box" @click="sheep.$router.go('/pages/chat/index')">
<uni-icons type="cart" size="28" color="#fff" /> <uni-icons type="chat" size="28" color="#fff" />
</view> </view>
</s-layout> </s-layout>
</template> </template>
@@ -30,6 +35,7 @@
import sheep from '@/sheep'; import sheep from '@/sheep';
import userAvatarCard from './components/user-avatar-card.vue'; import userAvatarCard from './components/user-avatar-card.vue';
import userTryOn from './components/user-tryOn.vue'; import userTryOn from './components/user-tryOn.vue';
import AuthUtil from '@/sheep/api/member/auth';
// 隐藏原生tabBar // 隐藏原生tabBar
uni.hideTabBar({ uni.hideTabBar({
@@ -37,6 +43,7 @@
}); });
const template = computed(() => sheep.$store('app').template.user); const template = computed(() => sheep.$store('app').template.user);
const isLogin = computed(() => sheep.$store('user').isLogin);
onShow(() => { onShow(() => {
sheep.$store('user').updateUserData(); sheep.$store('user').updateUserData();
@@ -54,18 +61,51 @@
const pattern = reactive({ const pattern = reactive({
icon: 'uni-icons-heart', icon: 'uni-icons-heart',
}); });
const handleLayout = () => {
uni.showModal({
title: '提示',
content: '确认注销账号?',
success: async function (res) {
if (!res.confirm) {
return;
}
const { code } = await AuthUtil.logout();
if (code !== 0) {
return;
}
sheep.$store('user').logout();
sheep.$router.go('/pages/login/index');
},
});
};
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.cart-box { .chat-box {
width: 80rpx; width: 80rpx;
height: 80rpx; height: 80rpx;
border-radius: 50%; border-radius: 50%;
background: red; background: #000;
position: fixed; position: fixed;
bottom: 80px; bottom: 100px;
right: 10px; right: 10px;
text-align: center; text-align: center;
line-height: 80rpx; line-height: 80rpx;
} }
.logout-box {
width: 100%;
box-sizing: border-box;
margin: 24rpx 0;
background: #fff;
.logout-btn {
width: 710rpx;
height: 80rpx;
background: linear-gradient(90deg, #000, #000);
border-radius: 40rpx;
font-size: 30rpx;
font-weight: 500;
color: $white;
}
}
</style> </style>
+2 -2
View File
@@ -2,7 +2,7 @@
<view class="login-page-wrapper"> <view class="login-page-wrapper">
<view class="mask" /> <view class="mask" />
<view class="login-ctn"> <view class="login-ctn">
<image class="login-logo-image" src="/static/imgs/login-logo.png" /> <image class="login-logo-image" src="https://puton.huimeimeta.com/imgs/login-logo.png" />
<view class="formItem-box mobile-formItem"> <view class="formItem-box mobile-formItem">
<view class="prefix">+86</view> <view class="prefix">+86</view>
@@ -106,7 +106,7 @@
width: 100%; width: 100%;
height: 100%; height: 100%;
box-sizing: border-box; box-sizing: border-box;
background-image: url('/static/imgs/login-bg.jpg'); background-image: url('https://puton.huimeimeta.com/imgs/login-bg.jpg');
background-size: cover; background-size: cover;
background-position: center; background-position: center;
position: relative; position: relative;
+15
View File
@@ -16,6 +16,21 @@ const CategoryApi = {
params: { ids }, params: { ids },
}); });
}, },
// 查询可用分类 --- 新加的接口
getCategoryTree: () => {
return request({
url: '/product/category/tree',
method: 'GET',
});
},
// 测试
test: (data) => {
return request({
url: '/cloth/list',
method: 'POST',
data,
});
},
}; };
export default CategoryApi; export default CategoryApi;
@@ -163,7 +163,8 @@
.icon-box { .icon-box {
background: #ffffff; background: #ffffff;
box-shadow: 0px 0px 4rpx rgba(51, 51, 51, 0.08), 0px 4rpx 6rpx 2rpx rgba(102, 102, 102, 0.12); box-shadow: 0px 0px 4rpx rgba(51, 51, 51, 0.08),
0px 4rpx 6rpx 2rpx rgba(102, 102, 102, 0.12);
border-radius: 30rpx; border-radius: 30rpx;
width: 134rpx; width: 134rpx;
height: 56rpx; height: 56rpx;
+2 -2
View File
@@ -6,7 +6,7 @@
<image class="icon" :src="state.liveStatus[data.status].img"></image> <image class="icon" :src="state.liveStatus[data.status].img"></image>
<view class="title ss-m-l-16">{{ state.liveStatus[data.status].title }}</view> <view class="title ss-m-l-16">{{ state.liveStatus[data.status].title }}</view>
</view> </view>
<img class="md-img-box" :src="sheep.$url.cdn(data.feeds_img)" referrerpolicy="no-referrer"> <img class="md-img-box" :src="sheep.$url.cdn(data.feeds_img)" referrerpolicy="no-referrer" />
<view class="md-goods-content"> <view class="md-goods-content">
<view class="md-goods-title ss-line-1" :style="[{ color: titleColor }]"> <view class="md-goods-title ss-line-1" :style="[{ color: titleColor }]">
{{ data.name }} {{ data.name }}
@@ -22,7 +22,7 @@
<image class="icon" :src="state.liveStatus[data.status].img"></image> <image class="icon" :src="state.liveStatus[data.status].img"></image>
<view class="title ss-m-l-16">{{ state.liveStatus[data.status].title }}</view> <view class="title ss-m-l-16">{{ state.liveStatus[data.status].title }}</view>
</view> </view>
<img class="sl-img-box" :src="sheep.$url.cdn(data.feeds_img)" referrerpolicy="no-referrer"> <img class="sl-img-box" :src="sheep.$url.cdn(data.feeds_img)" referrerpolicy="no-referrer" />
<view class="sl-goods-content"> <view class="sl-goods-content">
<view class="sl-goods-title ss-line-1" :style="[{ color: titleColor }]"> <view class="sl-goods-title ss-line-1" :style="[{ color: titleColor }]">
{{ data.name }} {{ data.name }}
+1
View File
@@ -87,6 +87,7 @@ function uniReadPagesV3Plugin({ pagesJsonDir, includes }) {
pagesJsonDir, pagesJsonDir,
includes, includes,
}); });
return { return {
name: 'uni-read-pages-v3', name: 'uni-read-pages-v3',
config(config) { config(config) {
+12 -12
View File
@@ -199,32 +199,32 @@ const adaptTemplate = async (appTemplate, templateId) => {
appTemplate.basic.tabbar.items = [ appTemplate.basic.tabbar.items = [
{ {
activeIconUrl: "https://3d.aidigitalfield.com/imgs/home.png", activeIconUrl: "https://puton.huimeimeta.com/imgs/home.png",
iconUrl: "https://3d.aidigitalfield.com/imgs/home.png", iconUrl: "https://puton.huimeimeta.com/imgs/home.png",
text: "首页", text: "首页",
url: "/pages/index/index", url: "/pages/index/index",
}, },
{ {
activeIconUrl: "https://3d.aidigitalfield.com/imgs/list.png", activeIconUrl: "https://puton.huimeimeta.com/imgs/list.png",
iconUrl: "https://3d.aidigitalfield.com/imgs/list.png", iconUrl: "https://puton.huimeimeta.com/imgs/list.png",
text: "商品列表", text: "商品列表",
url: "/pages/index/list", url: "/pages/index/list",
}, },
{ {
activeIconUrl: "https://3d.aidigitalfield.com/imgs/room.png", activeIconUrl: "https://puton.huimeimeta.com/imgs/room.png",
iconUrl: "https://3d.aidigitalfield.com/imgs/room.png", iconUrl: "https://puton.huimeimeta.com/imgs/room.png",
text: "试衣间", text: "试衣间",
url: "/pages/index/room", url: "/pages/index/room",
}, },
{ {
activeIconUrl: "https://3d.aidigitalfield.com/imgs/chat.png", activeIconUrl: "https://puton.huimeimeta.com/imgs/cart.png",
iconUrl: "https://3d.aidigitalfield.com/imgs/chat.png", iconUrl: "https://puton.huimeimeta.com/imgs/cart.png",
text: "聊天", text: "购物车",
url: "/pages/index/chat", url: "/pages/index/cart",
}, },
{ {
activeIconUrl: "https://3d.aidigitalfield.com/imgs/my.png", activeIconUrl: "https://puton.huimeimeta.com/imgs/my.png",
iconUrl: "https://3d.aidigitalfield.com/imgs/my.png", iconUrl: "https://puton.huimeimeta.com/imgs/my.png",
text: "我的", text: "我的",
url: "/pages/index/user", url: "/pages/index/user",
}, },
+10 -11
View File
@@ -26,17 +26,7 @@
</uni-badge> </uni-badge>
<!-- 选中的当前tabbar加上下横线 --> <!-- 选中的当前tabbar加上下横线 -->
<view <view class="active-line" :style="{ display: isActive ? 'inline-block' : 'none' }" />
:style="{
width: '20rpx',
height: '1rpx',
background: '#000',
position: 'absolute',
left: 'calc(50% - 10rpx)',
bottom: '-5rpx',
display: isActive ? 'inline-block' : 'none',
}"
/>
</view> </view>
<!-- 底部tabbar不要文字 --> <!-- 底部tabbar不要文字 -->
<!-- <slot name="text"> <!-- <slot name="text">
@@ -231,6 +221,15 @@
position: relative; position: relative;
width: 150rpx; width: 150rpx;
justify-content: center; justify-content: center;
.active-line {
width: 20rpx;
height: 1rpx;
background: #000;
position: absolute;
left: calc(50% - 10rpx);
bottom: -5rpx;
}
} }
&__text { &__text {
+2 -1
View File
@@ -156,7 +156,8 @@
}, },
getRect(selector, all) { getRect(selector, all) {
return new Promise((resolve) => { return new Promise((resolve) => {
uni.createSelectorQuery() uni
.createSelectorQuery()
.in(this) .in(this)
[all ? 'selectAll' : 'select'](selector) [all ? 'selectAll' : 'select'](selector)
.boundingClientRect((rect) => { .boundingClientRect((rect) => {
Binary file not shown.

Before

Width:  |  Height:  |  Size: 458 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.3 KiB