Commit 0b087857 authored by 王炽's avatar 王炽

666666

parents 75038782 760d19ba
......@@ -13,6 +13,7 @@ export default {
</script>
<style lang="less">
@import '/wxcomponents/vant/common/index.wxss';
/*每个页面公共css */
::-webkit-scrollbar {
display: none;
......@@ -20,4 +21,16 @@ export default {
height: 0;
color: transparent;
}
::-ms-scrollbar {
display: none;
width: 0;
height: 0;
color: transparent;
}
::-moz-scrollbar {
display: none;
width: 0;
height: 0;
color: transparent;
}
</style>
// request.js
// 通常可以吧 baseUrl 单独放在一个 js 文件了
const baseUrl = "http://xxx.xxx.4.xxxx:8093/chemApp";
const request = (options = {}) => {
// 在这里可以对请求头进行一些设置
// 例如:
// options.header = {
// "Content-Type": "application/x-www-form-urlencoded"
// }
return new Promise((resolve, reject) => {
uni
.request({
url: baseUrl + options.url || "",
method: options.type || "GET",
data: options.data || {},
header: options.header || {},
})
.then((data) => {
let [err, res] = data;
resolve(res);
})
.catch((error) => {
reject(error);
});
});
};
const get = (url, data, options = {}) => {
options.type = "GET";
options.data = data;
options.url = url;
return request(options);
};
const post = (url, data, options = {}) => {
options.type = "POST";
options.data = data;
options.url = url;
return request(options);
};
export default {
request,
api: {
get,
post,
},
};
import {
useGlobalStore
} from '../stores/global.js';
import {
storeToRefs
} from 'pinia';
import {
HTTP_STATUS
} from './config.js'
const globalStore = useGlobalStore();
const {
cuk
} = storeToRefs(globalStore);
// request.js
// 通常可以吧 baseUrl 单独放在一个 js 文件了
const baseUrl = "http://172.16.230.108:7777/pmall";
const request = (options = {}) => {
// 在这里可以对请求头进行一些设置
// 例如:
// options.header = {
// "Content-Type": "application/x-www-form-urlencoded"
// }
return new Promise((resolve, reject) => {
uni
.request({
url: baseUrl + options.url || "",
method: options.type || "GET",
data: options.data || {},
header: {
...options.header,
cuk: cuk.value || undefined
},
})
.then((data) => {
// console.log('request data ===>', data);
if (data.statusCode !== HTTP_STATUS.SUCCESS) {
uni.showToast({
title: data.errMsg,
icon: 'error'
});
reject(data);
} else if (!data.data?.ok) {
uni.showToast({
title: data.data?.message,
icon: 'error'
});
reject(data.data);
} else {
resolve(data.data);
}
})
.catch((error) => {
reject(error);
});
});
};
const get = (url, data, options = {}) => {
options.type = "GET";
options.data = data;
options.url = url;
return request(options);
};
const post = (url, data, options = {}) => {
options.type = "POST";
options.data = data;
options.url = url;
return request(options);
};
export default {
request,
api: {
get,
post
}
};
\ No newline at end of file
import requestModule from './request.js';
const {
api
} = requestModule;
/**
* 获取用户信息
* @returns
*/
export const fetchUserInfo = () => api.get('/c/user/memberInfo');
/**
* 获取宝宝信息
* @returns
*/
export const fetchBabyInfo = () => api.get('/c/user/babyInfo');
/**
* 根据wx.login接口返回的code完成登录
* @param {*} code
* @returns
*/
export const autoLoginByCode = (code) => api.get('/c/login/autologin', {
code,
});
/**
* 手机号授权,调用微信手机号快速验证组件,获取encryptedData、iv、code
* 通过此接口完成手机号授权,注册新用户
* @param {*} data : {phoneEncryptedData, phoneIv, code, codeLogin}
* @returns
*/
export const fetchAutoPhone = (data) => api.post('/c/login/authPhone', data);
\ No newline at end of file
export const PRIVACY_URL = "https://secret.feihe.com/secret.html";
export const MEMBER_URL = "https://secret.feihe.com/index.html";
export const WHEEL_OPTIONS_YL = [
{ label: "1月龄", desc: "宝宝开始对外界产生兴趣,会追视物体" },
{ label: "2月龄", desc: "能发出咿咿呀呀的声音,会对妈妈微笑" },
{ label: "3月龄", desc: "抬头能力增强,喜欢玩自己的小手" },
{ label: "4月龄", desc: "会翻身了,对周围事物充满好奇" },
{ label: "5月龄", desc: "手眼协调能力提升,喜欢抓取玩具" },
{ label: "6月龄", desc: "可以独自坐立,开始尝试固体食物" },
{ label: "7月龄", desc: "会爬行了,语言能力逐渐发展" },
{ label: "8月龄", desc: "能扶物站立,认知能力显著提升" },
{ label: "9月龄", desc: "开始学步,能说简单的词语" },
{ label: "10月龄", desc: "独立行走能力增强,喜欢模仿大人" },
{ label: "11月龄", desc: "语言理解能力提高,会简单互动" },
{ label: "12月龄", desc: "基本能独立行走,表达欲望增强" },
{ label: "13月龄", desc: "动作更加协调,喜欢探索新事物" },
{ label: "14月龄", desc: "语言表达更丰富,独立意识增强" },
{ label: "15月龄", desc: "手部精细动作发展,创造力萌芽" },
{ label: "16月龄", desc: "记忆力提升,开始学习分类概念" },
{ label: "17月龄", desc: "想象力丰富,喜欢角色扮演游戏" },
{ label: "18月龄", desc: "语言交流更流畅,社交能力发展" },
{ label: "19月龄", desc: "运动技能全面发展,好奇心旺盛" },
{ label: "20月龄", desc: "逻辑思维初步形成,会简单推理" },
{ label: "21月龄", desc: "情感表达更丰富,记忆力增强" },
{ label: "22月龄", desc: "独立性增强,生活技能提升" },
{ label: "23月龄", desc: "语言组织能力提高,喜欢提问" },
{ label: "24月龄", desc: "社交圈子扩大,懂得分享" },
{ label: "25月龄", desc: "创造性思维发展,喜欢音乐" },
{ label: "26月龄", desc: "注意力更集中,会完成简单任务" },
{ label: "27月龄", desc: "空间认知能力提升,喜欢拼图" },
{ label: "28月龄", desc: "语言表达更准确,理解能力增强" },
{ label: "29月龄", desc: "自我意识增强,情绪管理提升" },
{ label: "30月龄", desc: "逻辑思维更成熟,会简单计数" },
{ label: "31月龄", desc: "艺术创造力发展,喜欢绘画" },
{ label: "32月龄", desc: "记忆力显著提升,会讲简单故事" },
{ label: "33月龄", desc: "运动协调性好,喜欢户外活动" },
{ label: "34月龄", desc: "社交技能成熟,懂得合作" },
{ label: "35月龄", desc: "思维更加灵活,解决问题能力增强" },
{ label: "36月龄", desc: "全面发展,准备进入幼儿园阶段" },
];
export const WHEEL_OPTIONS_YZ = [
{ label: "孕1周", desc: "胚胎开始着床,激素水平发生变化,胚胎开始着床,激素水平发生变化,胚胎开始着床,激素水平发生变化,胚胎开始着床,激素水平发生变化,胚胎开始着床,激素水平发生变化,胚胎开始着床,激素水平发生变化" },
{ label: "孕2周", desc: "胎盘开始形成,为胎儿提供营养" },
{ label: "孕3周", desc: "胎儿心脏开始跳动,神经系统发育" },
{ label: "孕4周", desc: "胎儿大小如花生,开始形成四肢" },
{ label: "孕5周", desc: "胎儿面部开始发育,可见眼睛雏形" },
{ label: "孕6周", desc: "胎儿开始运动,脊椎继续发育" },
{ label: "孕7周", desc: "胎儿手指脚趾形成,大脑发育加快" },
{ label: "孕8周", desc: "胎儿所有器官雏形完成,开始生长" },
{ label: "孕9周", desc: "胎儿开始吞咽羊水,肌肉发育" },
{ label: "孕10周", desc: "胎儿指甲开始生长,性别特征显现" },
{ label: "孕11周", desc: "胎儿可以做出简单动作,头部变圆" },
{ label: "孕12周", desc: "胎儿开始产生尿液,骨骼继续钙化" },
{ label: "孕13周", desc: "胎儿vocal cords形成,可发声" },
{ label: "孕14周", desc: "胎儿开始产生胎动,母体可感知" },
{ label: "孕15周", desc: "胎儿皮下脂肪开始形成,体型增大" },
{ label: "孕16周", desc: "胎儿听力开始发育,对声音敏感" },
{ label: "孕17周", desc: "胎儿免疫系统开始发育,产生抗体" },
{ label: "孕18周", desc: "胎儿睡眠周期形成,活动规律" },
{ label: "孕19周", desc: "胎儿肺部发育,为呼吸做准备" },
{ label: "孕20周", desc: "胎儿听力继续发育,对外界声音反应" },
{ label: "孕21周", desc: "胎儿眉毛睫毛生长,面部特征明显" },
{ label: "孕22周", desc: "胎儿皮肤变厚,开始长出胎毛" },
{ label: "孕23周", desc: "胎儿体重快速增长,运动更频繁" },
{ label: "孕24周", desc: "胎儿肺部继续发育,产生肺表面活性物质" },
{ label: "孕25周", desc: "胎儿脂肪积累加快,体型继续增大" },
{ label: "孕26周", desc: "胎儿眼睛可以睁开,对光有反应" },
{ label: "孕27周", desc: "胎儿大脑快速发育,神经系统成熟" },
{ label: "孕28周", desc: "胎儿各器官功能逐渐完善" },
{ label: "孕29周", desc: "胎儿骨骼继续钙化,头部下降" },
{ label: "孕30周", desc: "胎儿体重持续增加,活动空间减少" },
{ label: "孕31周", desc: "胎儿消化系统发育成熟,可消化羊水" },
{ label: "孕32周", desc: "胎儿皮下脂肪继续积累,体温调节能力增强" },
{ label: "孕33周", desc: "胎儿免疫系统继续发育,获得母体抗体" },
{ label: "孕34周", desc: "胎儿肺部发育接近成熟,准备独立呼吸" },
{ label: "孕35周", desc: "胎儿体重快速增加,为出生做准备" },
{ label: "孕36周", desc: "胎儿头部继续下降,为分娩做准备" },
{ label: "孕37周", desc: "胎儿各器官发育完善,可以安全出生" },
{ label: "孕38周", desc: "胎儿继续增重,准备出生" },
{ label: "孕39周", desc: "胎儿位置固定,随时可能出生" },
{ label: "孕40周", desc: "胎儿发育完全成熟,即将出生" },
];
......@@ -3,7 +3,7 @@
@color-gold-cover: #B27C1E; // 真诚棕,用于覆盖主题色等上层或其他场景重点高亮颜色
// 辅助色
@color-gold-light: #5FDE0A5; // 闪耀金,用于辅助色
@color-gold-light: #FDE0A5; // 闪耀金,用于辅助色
@color-white-soft: #FEF7F2; // 柔和白,用于辅助色
@color-purple-energy: #A68DBB; // 能量紫,用于辅助色
@color-pink-cute: #E5C5DB; // 可爱粉,用于辅助色
......
<template>
<view class="baby-switcher-container">
<view class="baby-switcher-mask" @click.self="onClose"> </view>
<view class="baby-switcher-popup">
<view
v-for="baby in babyList"
:key="baby.id"
class="baby-item"
@click="selectBaby(baby)"
>
<text>{{ baby.babyName || "暂无昵称" }}</text>
<view
class="selected-icon"
:style="{ backgroundColor: baby.selected ? '#d3a358' : '#E8E8E8' }"
/>
</view>
<view v-if="babyList.length < 3" class="baby-item add-item" @click="onAdd">
<image :src="addIcon" class="add-icon" />
</view>
</view>
</view>
</template>
<script setup>
import { defineProps, defineEmits } from "vue";
const props = defineProps({
show: Boolean,
babyList: {
type: Array,
default: () => [],
},
addIcon: {
type: String,
default: "", // 传入新增icon路径
},
});
const emits = defineEmits(["close", "select", "add"]);
function onClose() {
emits("close");
}
function selectBaby(baby) {
emits("select", baby);
}
function onAdd() {
emits("add");
}
</script>
<style lang="less" scoped>
.baby-switcher-container {
touch-action: none;
}
.baby-switcher-mask {
position: fixed;
left: 0;
top: 0;
right: 0;
bottom: 0;
z-index: 1;
}
.baby-switcher-popup {
position: absolute;
left: 0;
top: 40rpx;
z-index: 2;
background: #fff;
border-radius: 16rpx;
padding: 10rpx 36rpx 22rpx 36rpx;
box-shadow: 0 0 30rpx rgba(204, 204, 204, 0.8);
box-sizing: border-box;
min-width: 247rpx;
}
.baby-item {
display: flex;
align-items: center;
justify-content: center;
padding: 20rpx 25rpx;
font-size: 26rpx;
font-weight: 500;
color: #1d1e25;
flex-wrap: nowrap;
border-bottom: 1px solid #eee;
&:nth-child(3) {
border-bottom: none;
}
}
.selected-icon {
width: 12rpx;
height: 12rpx;
margin-left: 17rpx;
background-color: #e8e8e8;
border-radius: 50%;
}
.add-item {
margin-top: 10rpx;
padding-top: 20rpx;
padding: 10rpx 0;
border-bottom: none;
}
.add-icon {
width: 96rpx;
height: 36rpx;
display: block;
}
</style>
\ No newline at end of file
<template>
<view class="Layer-custom">
<!-- 遮罩层 -->
<view v-if="visible" class="layer-mask" @click="onMaskClick"></view>
<!-- 底部弹出层 -->
<view v-if="visible" class="layer-popup">
<view class="layer-panel">
<!-- 头部插槽或默认头部 -->
<slot name="header">
<view class="layer-header" v-if="!customHeader">
<text v-if="showCancel" @click="onCancel" class="layer-cancel"
>取消</text
>
<text v-if="title" class="layer-title">{{ title }}</text>
<text v-if="showConfirm" @click="onConfirm" class="layer-confirm"
>确定</text
>
</view>
</slot>
<!-- 内容插槽 -->
<view class="layer-content">
<slot></slot>
</view>
<!-- 底部插槽 -->
<slot name="footer"></slot>
</view>
</view>
</view>
</template>
<script setup>
import { ref, watch, defineEmits, defineProps } from "vue";
const props = defineProps({
modelValue: { type: Boolean, default: false },
title: { type: String, default: "" },
showCancel: { type: Boolean, default: true },
showConfirm: { type: Boolean, default: true },
maskClosable: { type: Boolean, default: true },
customHeader: { type: Boolean, default: false },
});
const emit = defineEmits([
"update:modelValue",
"confirm",
"cancel",
"open",
"close",
]);
const visible = ref(props.modelValue);
watch(
() => props.modelValue,
(val) => {
visible.value = val;
if (val) emit("open");
else emit("close");
}
);
function open() {
visible.value = true;
emit("update:modelValue", true);
emit("open");
}
function close() {
visible.value = false;
emit("update:modelValue", false);
emit("close");
}
function onConfirm() {
emit("confirm");
close();
}
function onCancel() {
emit("cancel");
close();
}
function onMaskClick() {
if (props.maskClosable) {
onCancel();
}
}
defineExpose({ open, close });
</script>
<style lang="less" scoped>
.layer-mask {
position: fixed;
left: 0;
right: 0;
top: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.5);
z-index: 3999;
}
.layer-popup {
position: fixed;
left: 0;
right: 0;
bottom: 0;
z-index: 4000;
display: flex;
flex-direction: column;
align-items: center;
animation: layer-up 0.3s;
}
@keyframes layer-up {
from {
transform: translateY(100%);
}
to {
transform: translateY(0);
}
}
.layer-panel {
width: 100vw;
min-height: 20vh;
background: #f6f8fa;
border-top-left-radius: 48rpx;
border-top-right-radius: 48rpx;
overflow: hidden;
display: flex;
flex-direction: column;
}
.layer-header {
display: flex;
justify-content: space-between;
align-items: center;
height: 140rpx;
box-sizing: border-box;
background: #f6f8fa;
padding: 0 32rpx;
.layer-cancel {
color: #6f6d67;
font-size: 28rpx;
width: 136rpx;
height: 74rpx;
border-radius: 20rpx;
background: #ffffff;
display: flex;
align-items: center;
justify-content: center;
}
.layer-confirm {
color: #ffffff;
font-size: 28rpx;
width: 136rpx;
height: 74rpx;
border-radius: 20rpx;
background: #d3a358;
display: flex;
align-items: center;
justify-content: center;
}
.layer-title {
color: #222;
font-size: 32rpx;
font-weight: bold;
flex: 1;
text-align: center;
}
}
.layer-content {
flex: 1;
padding: 32rpx;
box-sizing: border-box;
}
</style>
\ No newline at end of file
<template>
<view class="picker-custom">
<!-- 插槽内容,点击触发弹层 -->
<view @click="open">
<slot></slot>
</view>
<!-- 遮罩层 -->
<view v-if="show" class="picker-layer-mask" @click="close"></view>
<!-- 底部弹出层 -->
<view v-if="show" class="picker-layer-popup">
<view class="picker-layer-panel">
<!-- 可自定义头部 -->
<view class="picker-layer-header">
<text @click="close" class="picker-layer-cancel">取消</text>
<text @click="confirm" class="picker-layer-confirm">确定</text>
</view>
<view class="picker-layer-view-mask-top"></view>
<view class="picker-layer-view-mask-bottom"></view>
<!-- 多列picker-view -->
<picker-view
class="picker-layer-view"
mask-style="background: rgb(246, 248, 250); z-index: 0;"
indicator-style="border-radius: 10px; height: 50px;background:#ffffff; z-index:0"
:value="pickerValue"
@change="onChange"
>
<template v-if="mode === 'date'">
<picker-view-column>
<view
v-for="(item, idx) in years"
:key="idx"
class="picker-layer-item"
>
{{ item }}
</view>
</picker-view-column>
<picker-view-column>
<view
v-for="(item, idx) in months"
:key="idx"
class="picker-layer-item"
>
{{ item }}
</view>
</picker-view-column>
<picker-view-column>
<view
v-for="(item, idx) in days"
:key="idx"
class="picker-layer-item"
>
{{ item === "请选择" ? item : `${item}日` }}
</view>
</picker-view-column>
</template>
<template v-else>
<picker-view-column v-for="(col, colIdx) in columns" :key="colIdx">
<view
v-for="(item, idx) in col"
:key="idx"
class="picker-layer-item"
>
{{ item }}
</view>
</picker-view-column>
</template>
</picker-view>
</view>
</view>
</view>
</template>
<script setup>
import { ref, computed, watch } from "vue";
const props = defineProps({
mode: {
type: String,
default: "custom", // 'date' | 'custom'
},
range: {
type: Array,
default: () => [],
},
value: {
type: [Number, Array],
default: 0,
},
onPickerChange: {
type: Function,
default: () => {},
},
onLayerVisibleChange: {
type: Function,
default: () => {},
},
onStatusChange: {
type: Function,
default: () => {},
},
disabled: {
type: Boolean,
default: false,
},
});
const show = ref(false);
// date模式相关
const today = new Date();
const currentYear = today.getFullYear();
const currentMonth = today.getMonth() + 1;
const currentDay = today.getDate();
// 计算未来280天的日期
const futureDate = new Date();
futureDate.setDate(futureDate.getDate() + 280);
const futureYear = futureDate.getFullYear();
const futureMonth = futureDate.getMonth() + 1;
const futureDay = futureDate.getDate();
const years = computed(() => {
const arr = [];
const startYear = currentYear - 3;
const endYear = futureYear;
for (let i = startYear; i <= endYear; i++) {
arr.push(i);
}
return arr;
});
const months = computed(() => {
const [yearIdx] = pickerValue.value;
const selectedYear = years.value[yearIdx];
const arr = [];
let startMonth = 1;
let endMonth = 12;
if (selectedYear === currentYear - 3) {
startMonth = currentMonth;
}
if (selectedYear === futureYear) {
endMonth = futureMonth;
}
for (let i = startMonth; i <= endMonth; i++) {
arr.push(i);
}
return arr;
});
const days = computed(() => {
const [yearIdx, monthIdx] = pickerValue.value;
const selectedYear = years.value[yearIdx];
const selectedMonth = months.value[monthIdx];
const dayCount = new Date(selectedYear, selectedMonth, 0).getDate();
const arr = ["请选择"];
let startDay = 1;
let endDay = dayCount;
if (selectedYear === currentYear - 3 && selectedMonth === currentMonth) {
startDay = currentDay;
}
if (selectedYear === futureYear && selectedMonth === futureMonth) {
endDay = futureDay;
}
for (let i = startDay; i <= endDay; i++) {
arr.push(i);
}
return arr;
});
// custom模式相关
const columns = computed(() => {
if (Array.isArray(props.range[0])) {
return props.range;
} else {
return [props.range];
}
});
const defaultValue = computed(() => {
if (props.mode === "date") {
// 默认选中今年1月1日
return [years.value.length - 1, 0, 0];
} else if (Array.isArray(props.value)) {
return props.value;
} else {
return [props.value];
}
});
const pickerValue = ref([...defaultValue.value]);
watch(
() => props.value,
(val) => {
if (props.mode === "date") {
pickerValue.value = [...val];
} else if (Array.isArray(val)) {
pickerValue.value = [...val];
} else {
pickerValue.value = [val];
}
}
);
function open() {
if (props.disabled) return;
pickerValue.value = [...defaultValue.value];
show.value = true;
props.onLayerVisibleChange(true);
}
function close() {
show.value = false;
props.onLayerVisibleChange(false);
}
function confirm() {
close();
if (props.mode === "date") {
const [yIdx, mIdx, dIdx] = pickerValue.value;
if (dIdx === 0) {
props.onPickerChange("");
return;
}
const year = years.value[yIdx];
const month = months.value[mIdx];
const day = days.value[dIdx];
const dateStr = `${year}-${String(month).padStart(2, "0")}-${String(
day
).padStart(2, "0")}`;
props.onPickerChange(dateStr);
// 新增:判断状态并回调
const today = new Date();
const selectedDate = new Date(year, month - 1, day);
// 清除时分秒
today.setHours(0, 0, 0, 0);
selectedDate.setHours(0, 0, 0, 0);
let status = -1;
if (selectedDate.getTime() <= today.getTime()) {
status = 2;
} else {
status = 1;
}
props.onStatusChange(status);
} else {
// 单列时只返回索引,否则返回数组
if (columns.value.length === 1) {
props.onPickerChange(pickerValue.value[0]);
} else {
props.onPickerChange([...pickerValue.value]);
}
}
}
function onChange(e) {
let val = e.detail.value;
if (props.mode === "date") {
// 如果天数溢出,自动修正到最大天数
const maxDay = days.value.length;
if (val[2] >= maxDay) val[2] = maxDay - 1;
pickerValue.value = val;
} else {
pickerValue.value = val;
}
}
</script>
<style lang="less" scoped>
.picker-layer-mask {
position: fixed;
left: 0;
right: 0;
top: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.5);
z-index: 3999;
}
.picker-layer-popup {
position: fixed;
left: 0;
right: 0;
bottom: 0;
z-index: 4000;
display: flex;
flex-direction: column;
align-items: center;
animation: picker-layer-up 0.3s;
}
@keyframes picker-layer-up {
from {
transform: translateY(100%);
}
to {
transform: translateY(0);
}
}
.picker-layer-panel {
width: 100vw;
height: 50vh;
background: #f6f8fa;
border-top-left-radius: 24rpx;
border-top-right-radius: 24rpx;
overflow: hidden;
display: flex;
flex-direction: column;
}
.picker-layer-header {
display: flex;
justify-content: space-between;
align-items: center;
height: 140rpx;
box-sizing: border-box;
background: #f6f8fa;
padding: 0 32rpx;
.picker-layer-cancel {
color: #6f6d67;
font-size: 28rpx;
width: 136rpx;
height: 74rpx;
border-radius: 20rpx;
background: #ffffff;
display: flex;
align-items: center;
justify-content: center;
}
.picker-layer-confirm {
color: #ffffff;
font-size: 28rpx;
width: 136rpx;
height: 74rpx;
border-radius: 20rpx;
background: #d3a358;
display: flex;
align-items: center;
justify-content: center;
}
.picker-layer-title {
color: #222;
font-size: 32rpx;
font-weight: bold;
}
}
.picker-layer-view {
flex: 1;
width: 100%;
}
.picker-layer-item {
height: 100rpx;
line-height: 100rpx;
text-align: center;
font-size: 32rpx;
color: #1d1e25;
}
.picker-layer-view-mask-top {
position: absolute;
top: 140rpx;
left: 0;
width: 100%;
height: calc(50% - 100rpx);
z-index: 1;
background: linear-gradient(
to bottom,
rgb(246, 248, 250) 0%,
rgba(255, 255, 255, 0.5) 100%
);
pointer-events: none;
}
.picker-layer-view-mask-bottom {
position: absolute;
bottom: 0rpx;
left: 0;
width: 100%;
height: calc(50% - 100rpx);
z-index: 1;
background: linear-gradient(
to top,
rgb(246, 248, 250) 0%,
rgba(255, 255, 255, 0.5) 100%
);
pointer-events: none;
}
.picker-custom[disabled] {
opacity: 0.5;
pointer-events: none;
}
</style>
\ No newline at end of file
This diff is collapsed.
......@@ -19,34 +19,37 @@
</template>
<script setup>
import { ref } from "vue";
import { ref, getCurrentInstance,onMounted } from "vue";
import {useUserStore} from '@/stores/user.js';
const userStore = useUserStore();
const props = defineProps({
tabList: {
type: Array,
default: () => [
{
text: "首页",
iconPath: "/static/tabBar/icon_tab_home_normal.png",
selectedIconPath: "/static/tabBar/icon_tab_home_selected.png",
},
{
text: "品牌故事",
iconPath: "/static/tabBar/icon_tab_brand_normal.png",
selectedIconPath: "/static/tabBar/icon_tab_brand_selected.png",
},
{
text: "积分服务",
iconPath: "/static/tabBar/icon_tab_gift_normal.png",
selectedIconPath: "/static/tabBar/icon_tab_gift_selected.png",
},
{
text: "我的",
iconPath: "/static/tabBar/icon_tab_person_normal.png",
selectedIconPath: "/static/tabBar/icon_tab_person_selected.png",
},
],
const { proxy } = getCurrentInstance();
const $baseUrl = proxy.$baseUrl;
const tabList = ref([
{
text: "首页",
iconPath: $baseUrl + "tabBar/icon_tab_home_normal.png",
selectedIconPath: $baseUrl + "tabBar/icon_tab_home_selected.png",
},
{
text: "品牌故事",
iconPath: $baseUrl + "tabBar/icon_tab_brand_normal.png",
selectedIconPath: $baseUrl + "tabBar/icon_tab_brand_selected.png",
},
{
text: "积分服务",
iconPath: $baseUrl + "tabBar/icon_tab_gift_normal.png",
selectedIconPath: $baseUrl + "tabBar/icon_tab_gift_selected.png",
},
{
text: "我的",
iconPath: $baseUrl + "tabBar/icon_tab_person_normal.png",
selectedIconPath: $baseUrl + "tabBar/icon_tab_person_selected.png",
},
]);
const props = defineProps({
curTabIndex: {
type: Number,
default: 0,
......@@ -61,6 +64,10 @@ const handleTabClick = (index, item) => {
currentIndex.value = index;
emit("tabClick", { index, item });
};
onMounted(() => {
userStore.wxAutoLogin();
})
</script>
<style lang="less" scoped>
......
<template>
<view class="wheel-selector">
<image class="wheel-bg" :src="bgImg" mode="aspectFit" />
<view
class="wheel-options"
@touchstart="onTouchStart"
@touchmove.prevent="onTouchMove"
@touchend="onTouchEnd"
>
<view
v-for="opt in visibleOptions"
:key="opt.idx + '-' + opt.pos"
class="wheel-option"
:class="{ selected: opt.pos === 0 }"
:style="getOptionStyle(opt)"
>
<image
class="wheel-icon"
:class="{ 'wheel-icon-selected': opt.pos === 0 }"
:src="opt.pos === 0 ? iconSelected : iconNormal"
mode="aspectFit"
/>
<text class="wheel-label">{{ opt.item.label }}</text>
</view>
</view>
</view>
</template>
<script setup>
import { ref, watch, computed } from "vue";
const props = defineProps({
options: { type: Array, required: true }, // [{label: '七月龄'}, ...]
selectedIndex: { type: Number, default: 0 },
bgImg: { type: String, required: true },
iconNormal: { type: String, required: true },
iconSelected: { type: String, required: true },
});
const emits = defineEmits(["update:selectedIndex", "change"]);
const currentIndex = ref(props.selectedIndex);
// 计算最多展示三个 option
const visibleOptions = computed(() => {
const total = props.options.length;
const arr = [];
for (let i = 0; i < 3; i++) {
if (currentIndex.value + i < total) {
arr.push({
item: props.options[currentIndex.value + i],
idx: currentIndex.value + i,
pos: i,
});
}
}
return arr;
});
watch(
() => props.selectedIndex,
(val) => {
currentIndex.value = val;
}
);
let startY = 0;
function onTouchStart(e) {
startY = e.touches[0].clientY;
}
function onTouchMove(e) {
const deltaY = e.touches[0].clientY - startY;
if (Math.abs(deltaY) > 30) {
// 滑动阈值
if (deltaY > 0 && currentIndex.value > 0) {
currentIndex.value -= 1;
startY = e.touches[0].clientY;
} else if (
deltaY < 0 &&
currentIndex.value < props.options.length - 1
) {
currentIndex.value += 1;
startY = e.touches[0].clientY;
}
emits("update:selectedIndex", currentIndex.value);
emits("change", currentIndex.value);
}
}
function onTouchEnd() {
// nothing
}
function getOptionStyle(opt) {
const positions = [
{ x: 34, y: 94 },
{ x: 118, y: 278 },
{ x: 50, y: 446 },
];
const pos = positions[opt.pos] || positions[positions.length - 1];
const _oo = {
position: "absolute",
left: `${pos.x}rpx`,
top: `${pos.y}rpx`,
opacity: 1,
zIndex: 10 - opt.pos,
}
return _oo;
}
</script>
<style scoped lang="less">
.wheel-selector {
position: absolute;
top: 128rpx;
left: 0;
width: 340rpx;
height: 540rpx;
}
.wheel-bg {
position: absolute;
left: 0;
top: 94rpx;
width: 143rpx;
height: 436rpx;
z-index: 0;
display: block;
}
.wheel-options {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
z-index: 1;
display: flex;
flex-direction: column;
align-items: flex-start;
justify-content: center;
pointer-events: auto;
touch-action: none;
}
.wheel-option {
position: absolute;
width: 220rpx;
height: 60rpx;
display: flex;
align-items: center;
transition: all 0.7s, opacity 0.2s;
.wheel-icon {
width: 24rpx;
height: 24rpx;
display: block;
}
.wheel-icon-selected {
width: 56rpx;
height: 56rpx;
display: block;
}
.wheel-label {
font-size: 28rpx;
color: #FFFFFF;
text-shadow: 0 2rpx 8rpx #333333;
font-weight: bold;
}
}
</style>
\ No newline at end of file
import App from "./App";
import apiRequest from "@/api/request.js";
// import apiRequest from "@/api/request.js";
import * as Pinia from 'pinia';
const BASE_URL = 'https://duiba.oss-cn-hangzhou.aliyuncs.com/fh/';
// #ifndef VUE3
import Vue from "vue";
import "./uni.promisify.adaptor";
// 全局挂载后使用
Vue.prototype.$api = apiRequest.api;
// Vue.prototype.$api = apiRequest.api;
Vue.prototype.$baseUrl = BASE_URL;
Vue.config.productionTip = false;
App.mpType = "app";
......@@ -23,7 +28,8 @@ import { createSSRApp } from "vue";
export function createApp() {
const app = createSSRApp(App);
app.use(Pinia.createPinia());
app.config.globalProperties.$api = apiRequest.api;
// app.config.globalProperties.$api = apiRequest.api;
app.config.globalProperties.$baseUrl = BASE_URL;
return {
app,
Pinia
......
{
"name" : "20250528_FHQ1",
"appid" : "",
"appid" : "__UNI__CE986B7",
"description" : "",
"versionName" : "1.0.0",
"versionCode" : "100",
......
export const homeObj = {
swiperList: [{
url: 'homepage/banner1.jpg',
link: {
type: 1,
url: '/pages/product/product?id:1-1'
}
},
{
url: 'homepage/banner2.jpg',
link: {
type: 2,
url: 'pages/product/product?id:1-1',
extra: {
appId: 'wx1234567890abcdef',
envVersion: 'release'
}
}
},
{
url: 'homepage/banner3.jpg',
link: {
type: 3,
url: 'https://www.baidu.com',
extra: {
}
}
},
],
vipCardList: [{
level: "钻石会员",
subTitle: "育儿课程权益",
btnTitle: "12类系列课程",
btnSubTitle: "立即领取",
showCornerTxt: "待领取",
link: "www.baidu.com",
bgUrl: "homepage/cardbg1.png"
},
{
level: "北纬47°系列",
subTitle: "来自万年黑土的健康食品",
btnTitle: "",
btnSubTitle: "",
showCornerTxt: "",
link: "",
bgUrl: "homepage/cardbg2.png"
},
{
level: "育儿宝典",
subTitle: "专家文章、育儿知识、饮食知识",
btnTitle: "",
btnSubTitle: "",
showCornerTxt: "",
link: "",
bgUrl: "homepage/cardbg3.png"
},
],
contentImgList: [{
bgUrl: 'homepage/content_1.png',
link: 'www.baidu.com',
_style: 'width:311rpx;height: 324rpx;left: 40rpx;top: 0;'
},
{
bgUrl: 'homepage/content_2.png',
link: 'www.baidu.com',
_style: 'width:263rpx;height: 324rpx;right: 40rpx;top: 400rpx;'
},
{
bgUrl: 'homepage/content_3.png',
link: 'www.baidu.com',
_style: 'width:418rpx;height: 345rpx;left: 40rpx;top: 750rpx;'
},
{
bgUrl: 'homepage/content_4.png',
link: 'www.baidu.com',
_style: 'width:263rpx;height: 324rpx;right: 40rpx;top: 1120rpx;'
}
],
channelTabList: ["凯叔讲故事", "哄睡故事", "知识科普", "安全意识", "社交能力"],
changelInfoList: [
[{
bgUrl: "homepage/channel_0_1.png",
title: "凯叔·金子美铃童诗:【星星和蒲公英】",
link: "www.baidu.com"
},
{
bgUrl: "homepage/channel_0_1.png",
title: "凯叔·金子美铃童诗:【天空和海】",
link: "www.baidu.com"
}
],
[{
bgUrl: "homepage/channel_1_1.png",
title: "凯叔-小睡仙:【睡吧睡吧,香香的】",
link: "www.baidu.com"
},
{
bgUrl: "homepage/channel_1_1.png",
title: "凯叔-小睡仙:【睡觉仙气,3,2,1,】",
link: "www.baidu.com"
}
],
[{
bgUrl: "homepage/channel_2_1.png",
title: "教宝宝认识人体:【守护眼睛的睫毛】",
link: "www.baidu.com"
},
{
bgUrl: "homepage/channel_2_1.png",
title: "教宝宝认识人体:【为什么肚子会咕咕叫?】",
link: "www.baidu.com"
}
],
[{
bgUrl: "homepage/channel_3_1.png",
title: "教宝宝不乱吃东西:【这个不能吃】",
link: "www.baidu.com"
},
{
bgUrl: "homepage/channel_3_1.png",
title: "培养宝宝不摸插座的安全意识:【电线插座不好玩】",
link: "www.baidu.com"
}
],
[{
bgUrl: "homepage/channel_4_1.png",
title: "教会宝宝不嘲笑别人:【鹤鸟】",
link: "www.baidu.com"
},
{
bgUrl: "homepage/channel_4_1.png",
title: "培养宝宝尊重别人的习惯:【爱嘲笑人的斑斑】",
link: "www.baidu.com"
}
]
],
childrenInfoList: [{
bgUrl: "homepage/children_0.png",
title: "1+3 育儿妙招大揭秘,带娃从此不“蕉绿”",
link: "www.baidu.com"
},
{
bgUrl: "homepage/children_1.png",
title: "已有儿童中招,严重可瘫痪夏季防蜱虫最全指南速看",
link: "www.baidu.com"
},
{
bgUrl: "homepage/children_2.png",
title: "99% 家长忽略的脑发育关键动作",
link: "www.baidu.com"
}
]
, bottomLinkList: [{
bgUrl: "homepage/iconwx.png",
link: "www.baidu.com",
_style: "width:70rpx;height:109rpx;"
},
{
bgUrl: "homepage/iconqw.png",
link: "www.baidu.com",
_style: "width:95rpx;height:109rpx;"
},
{
bgUrl: "homepage/iconsph.png",
link: "www.baidu.com",
_style: "width:70rpx;height:109rpx;"
},
{
bgUrl: "homepage/iconxhs.png",
link: "www.baidu.com",
_style: "width:88rpx;height:99rpx;"
}
],
qrInfoList: [{
title: "公众号",
desc: "扫码关注<span style:'color:#D3A358;'>星妈会</span>公众号,了解更多专业育儿资讯",
qrUrl: "homepage/qrcode_gzh.png"
},
{
title: "企业微信",
desc: "扫码添加<span style:'color:#D3A358;'>星妈管家</span>企微,了解更多专业育儿资讯",
qrUrl: "homepage/qrcode_qw.png"
},
{
title: "视频号",
desc: "扫码关注<span style:'color:#D3A358;'>星妈会</span>视频号,了解更多专业育儿资讯",
qrUrl: "homepage/qrcode_sph.png"
},
]
}
\ No newline at end of file
{
"pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
"pages": [
{
"path": "pages/index/index",
"style": {
"navigationBarTitleText": "首页"
"navigationBarTitleText": "首页",
"navigationStyle": "custom"
}
},
{
"path": "pages/person/person",
"style": {
"navigationBarTitleText": "",
"navigationStyle": "custom"
}
},
{
"path": "pages/webview/webview",
"style": {
"navigationBarTitleText": "",
"navigationStyle": "custom"
}
},
{
"path": "pages/search/search",
"style": {
"navigationStyle": "custom"
}
},
{
"path" : "pages/product/product",
"style" :
{
"navigationBarTitleText": "商品详情",
"navigationBarBackgroundColor": "#ffffff",
"navigationBarTextStyle": "black"
}
}
],
"globalStyle": {
"navigationBarTextStyle": "black",
"navigationBarTitleText": "uni-app",
"navigationBarBackgroundColor": "#F8F8F8",
"backgroundColor": "#F8F8F8",
"navigationStyle": "custom"
"navigationStyle": "default",
"usingComponents": {
"van-tab": "wxcomponents/vant/tab/index",
"van-tabs": "wxcomponents/vant/tabs/index"
}
},
"uniIdRouter": {}
}
}
\ No newline at end of file
......@@ -18,7 +18,7 @@
export default {
data() {
return {
curTabIndex: 0,
curTabIndex: 3,
};
},
onLoad() {},
......
This diff is collapsed.
<template>
<view class="container">
<image mode="widthFix" class="productimg" :src="$baseUrl + 'brandpage/products/' + productId + '.jpg'"></image>
<view class="btnbox">
<image @tap="buyHandler" class="btnbuy" :src="$baseUrl + 'brandpage/btnbuy.png'"></image>
<button class="btnshare" open-type="share" style="background: none; border: none; padding: 0;">
<image class="btnshare" :src="$baseUrl + 'brandpage/btnshare.png'"></image>
</button>
</view>
</view>
</template>
<script>
export default {
data() {
return {
productId: ''
}
},
onLoad(options) {
// options 就是跳转时传递的参数对象
console.log('页面参数:', options);
this.productId = options.id;
},
methods: {
buyHandler() {
uni.navigateToMiniProgram({
appId: 'wx1234567890abcdef',
path: 'pages/index/index',
envVersion: 'release',
success(res) {
console.log('跳转成功', res)
},
fail(err) {
console.error('跳转失败', err)
}
})
},
shareHandler() {
}
},
onShareAppMessage() {
return {
title: '商品详情',
path: '/pages/product/product?id=123',
imageUrl: 'https://你的图片链接.jpg'
}
},
}
</script>
<style lang="less" scoped>
.container {
.productimg {
width: 750rpx;
}
.btnbox {
position: fixed;
left: 0;
width: 100%;
bottom: 0;
height: 150rpx;
display: flex;
justify-content: space-between;
.btnbuy {
width: 350rpx;
height: 75rpx;
margin-left: 20rpx;
}
.btnshare {
width: 350rpx;
height: 75rpx;
}
}
}
</style>
<template>
<view class="container">
<view class="searchBar" :style="`top:${statusBarHeight}px`">
<image @tap="backHandler" class="btnback" :src="$baseUrl+'searchpage/btnback.png'"></image>
<view class="input-view">
<view class="flexinput">
<image class="icon_search_yellow" :src="$baseUrl+'searchpage/icon_search_yellow.png'">
</image>
<input confirm-type="search" maxlength="50" class="nav-bar-input" type="text" placeholder="输入搜索关键词"
@confirm="confirm" />
</view>
</view>
</view>
<view class="topbox" :style="`margin-top:${statusBarHeight+10}px`">
<view v-if="step === 1" class="recentbox">
<image class="icon_trash" :src="$baseUrl+'searchpage/icon_trash.png'"></image>
<view class="title">最近搜索</view>
<view class="tagbox">
<view @tap="searchHandler(item)" :key="index" v-for="(item,index) in recentTagsList" class="tag">{{item}}</view>
</view>
</view>
<view v-if="step === 1" class="recentbox">
<view class="title">大家都在搜</view>
<view class="tagbox">
<view @tap="searchHandler(item)" :key="index" v-for="(item,index) in oftenTagsList" class="tag">{{item}}</view>
</view>
</view>
<view v-if="step !== 1" class="tabbox">
<van-tabs :color="`#d3a358`" line-width="15px" :active="tabIndex" @click="onTabChange">
<van-tab title="内容" name="a"></van-tab>
<van-tab title="工具" name="b"></van-tab>
<van-tab title="商品" name="c"></van-tab>
</van-tabs>
</view>
<view v-if="step !== 1" class="cardbox">
<view class="card" v-for="(item,index) in resultList[tabIndex]" :key="index">
<image class="pic" :src="$baseUrl+item.bgUrl"></image>
<view class="desc">
{{item.desc}}
</view>
<view class="timestr">{{item.timeStr}}</view>
</view>
</view>
</view>
</view>
</template>
<script>
const recentTagsList=[
"功能营养","母婴","功能营养","母婴","功能营养","母婴","功能营养","母婴","功能营养","母婴"
]
const oftenTagsList=[
"功能营养","母婴","功能营养","母婴","功能营养","母婴","功能营养","母婴","功能营养","母婴"
]
const resultList = [
[
{
bgUrl:"searchpage/test.png",
desc:"宝宝出生必做6件事,90 %爸妈漏掉第3条",
timeStr:"2025-03-10",
link:"www.baidu.com"
},
{
bgUrl:"searchpage/test.png",
desc:"宝宝出生必做6件事,90 %爸妈漏掉第3条",
timeStr:"2025-03-10",
link:"www.baidu.com"
},
{
bgUrl:"searchpage/test.png",
desc:"宝宝出生必做6件事,90 %爸妈漏掉第3条",
timeStr:"2025-03-10",
link:"www.baidu.com"
},
{
bgUrl:"searchpage/test.png",
desc:"宝宝出生必做6件事,90 %爸妈漏掉第3条",
timeStr:"2025-03-10",
link:"www.baidu.com"
},
{
bgUrl:"searchpage/test.png",
desc:"宝宝出生必做6件事,90 %爸妈漏掉第3条",
timeStr:"2025-03-10",
link:"www.baidu.com"
},
{
bgUrl:"searchpage/test.png",
desc:"宝宝出生必做6件事,90 %爸妈漏掉第3条",
timeStr:"2025-03-10",
link:"www.baidu.com"
},
{
bgUrl:"searchpage/test.png",
desc:"宝宝出生必做6件事,90 %爸妈漏掉第3条",
timeStr:"2025-03-10",
link:"www.baidu.com"
},
{
bgUrl:"searchpage/test.png",
desc:"宝宝出生必做6件事,90 %爸妈漏掉第3条",
timeStr:"2025-03-10",
link:"www.baidu.com"
}
],
[
{
bgUrl:"searchpage/test2.png",
desc:"秋风渐凉,宝宝的免疫力 也进入 “换季挑战期”",
timeStr:"2025-03-10",
link:"www.baidu.com"
},
{
bgUrl:"searchpage/test2.png",
desc:"秋风渐凉,宝宝的免疫力 也进入 “换季挑战期”",
timeStr:"2025-03-10",
link:"www.baidu.com"
},
{
bgUrl:"searchpage/test2.png",
desc:"秋风渐凉,宝宝的免疫力 也进入 “换季挑战期”",
timeStr:"2025-03-10",
link:"www.baidu.com"
},
{
bgUrl:"searchpage/test2.png",
desc:"秋风渐凉,宝宝的免疫力 也进入 “换季挑战期”",
timeStr:"2025-03-10",
link:"www.baidu.com"
},
{
bgUrl:"searchpage/test2.png",
desc:"秋风渐凉,宝宝的免疫力 也进入 “换季挑战期”",
timeStr:"2025-03-10",
link:"www.baidu.com"
},
],
[
{
bgUrl:"searchpage/test3.png",
desc:"3 个 0 成本游戏,让宝宝 越玩越聪明~",
timeStr:"2025-03-10",
link:"www.baidu.com"
},
{
bgUrl:"searchpage/test3.png",
desc:"3 个 0 成本游戏,让宝宝 越玩越聪明~",
timeStr:"2025-03-10",
link:"www.baidu.com"
},
{
bgUrl:"searchpage/test3.png",
desc:"3 个 0 成本游戏,让宝宝 越玩越聪明~",
timeStr:"2025-03-10",
link:"www.baidu.com"
},
{
bgUrl:"searchpage/test3.png",
desc:"3 个 0 成本游戏,让宝宝 越玩越聪明~",
timeStr:"2025-03-10",
link:"www.baidu.com"
},
{
bgUrl:"searchpage/test3.png",
desc:"3 个 0 成本游戏,让宝宝 越玩越聪明~",
timeStr:"2025-03-10",
link:"www.baidu.com"
},
]
]
export default {
data() {
return {
statusBarHeight: 38,
recentTagsList:recentTagsList,
oftenTagsList:oftenTagsList,
step:1,
resultList:resultList,
tabIndex:0,
searchValue:''
}
},
mounted() {
const menuButtonInfo = wx.getMenuButtonBoundingClientRect();
this.statusBarHeight = menuButtonInfo.top;
},
methods: {
backHandler() {
uni.navigateBack();
},
onTabChange(evt)
{
this.tabIndex = evt.detail.index;
},
confirm(evt){
this.searchHandler(evt.detail.value);
},
searchHandler(_searchValue){
if(_searchValue){
this.searchValue=_searchValue;
}
this.step=2;
}
}
}
</script>
<style lang="less" scoped>
@import '@/common.less';
:root{
--tab-font-size:28rpx;
--tabs-line-height:60rpx;
--tab-active-text-color:#1d1e25;
--tab-text-color:#a2a3a6;
}
.container {
background-color: #f6f8fa;
min-height: 100vh;
.tabbox{
width: 600rpx;
margin: 0 auto;
}
.searchBar {
display: flex;
position: relative;
align-items: center;
.btnback {
width: 50rpx;
height: 50rpx;
left: 38rpx;
position: relative;
}
.flexinput {
position: relative;
left: 50rpx;
height: 68rpx;
line-height: 68rpx;
width: 449rpx;
border-radius: 33rpx;
border: 2px solid @color-gold-main;
display: flex;
align-items: center;
.icon_search_yellow {
width: 30rpx;
height: 30rpx;
position: absolute;
left: 20rpx;
}
.nav-bar-input {
padding: 0 5px;
font-size: 28rpx;
background-color: rgba(0, 0, 0, 0);
position: absolute;
left: 70rpx;
color: black;
}
}
}
.recentbox {
margin-top: 32rpx;
padding-left: 32rpx;
padding-right: 32rpx;
.icon_trash {
width: 36rpx;
height: 36rpx;
position: absolute;
right: 32rpx;
}
.title {
font-size: 28rpx;
color: @color-black-deep;
}
.tagbox {
display: flex;
flex-wrap: wrap;
.tag{
background-color: white;
padding: 10rpx 20rpx;
border-radius: 27rpx;
font-size: 24rpx;
margin: 15rpx;
color: @color-black-deep;
}
}
}
.cardbox
{
display: flex;
width: 750rpx;
padding-left: 24rpx;
padding-right: 24rpx;
background-color: white;
flex-wrap: wrap;
.card{
margin-top: 25rpx;
margin-right: 25rpx;
.pic{
width: 343rpx;
height: 343rpx;
}
.desc{
font-size: 26rpx;
width: 330rpx;
color: @color-black-deep;
}
.timestr{
font-size: 24rpx;
color: @color-black-medium;
margin-top: 10rpx;
}
}
}
}
</style>
\ No newline at end of file
<template>
<web-view :src="src" />
</template>
<script setup>
import { ref } from "vue";
import { onLoad } from "@dcloudio/uni-app";
import * as CFG from "@/cfg";
let src = ref("");
onLoad((options) => {
let url = "";
if (options.type) {
const type = options.type;
url = CFG[type];
} else {
url = decodeURIComponent(options.url) || "";
}
src.value = url;
});
</script>
\ No newline at end of file
import {
defineStore
} from 'pinia';
const cuk = uni.getStorageSync('cuk')
export const useGlobalStore = defineStore('global', {
state: () => {
return {
cuk: cuk, // 用户登录后获取的凭证,调用接口时headers中携带
};
},
actions: {
/**
* 设置用户cuk
* @param {Object} cuk
*/
setCuk(cuk) {
this.cuk = cuk;
uni.setStorageSync('cuk', cuk);
}
},
});
\ No newline at end of file
import { defineStore } from "pinia";
import {
autoLoginByCode,
fetchUserInfo,
fetchBabyInfo,
fetchAutoPhone,
} from "../api/user.js";
import { useGlobalStore } from "./global.js";
const globalStore = useGlobalStore();
export const useUserStore = defineStore("userInfo", {
state: () => {
return {
userInfo: null,
babyInfo: null,
};
},
actions: {
/**
* 更新用户信息
* @param {Object} userInfo
*/
setUserInfo(userInfo) {
this.userInfo = userInfo;
},
/**
* 更新宝宝信息
* @param {Object} babyInfo
*/
setBabyInfo(babyInfo) {
this.babyInfo = babyInfo;
},
/**
* 用户手机号验证的回调方法,用于获取encryptedData、iv、code,然后调用fetchAutoPhone接口完成手机号授权
* @param {Object} data : {encryptedData, iv, code}
* @returns
*/
async phoneCallback(data) {
uni.login({
provider: "weixin",
success: async (res) => {
// console.log('wxAutoLogin', res);
if (res.errMsg === "login:ok") {
// 用户手机授权
await fetchAutoPhone({
phoneEncryptedData: data.encryptedData,
phoneIv: data.iv,
code: data.code,
codeLogin: res.code,
});
// 授权注册成功后做一次登录
this.wxAutoLogin();
} else {
uni.showToast({
title: res.errMsg,
icon: "error",
});
}
},
});
},
/**
* 获取用户信息
*/
async loadUserInfo() {
const { data } = await fetchUserInfo();
console.log("userInfo", data);
if (data?.memberId !== "not_login") {
this.userInfo = data;
}
},
/**
* 获取宝宝信息
*/
async loadBabyInfo() {
const { data } = await fetchBabyInfo();
console.log("babyInfo", data);
if (data?.memberId !== "not_login") {
this.babyInfo = data;
}
},
/**
* wx.login 获取code后,调用此方法完成登录
* @param {String} code
*/
async autoLoginByCode(code) {
const { data } = await autoLoginByCode(code);
console.log("autoLoginByCode", data);
// 如果登录成功,获取用户信息和宝宝信息,更新到state中,方便全局使用
if (data && data.cuk) {
globalStore.setCuk(data.cuk);
this.loadUserInfo();
this.loadBabyInfo();
}
},
/**
* 用户自动登录
*/
async wxAutoLogin() {
uni.login({
provider: "weixin",
success: (res) => {
console.log("wxAutoLogin", res);
if (res.errMsg === "login:ok") {
this.autoLoginByCode(res.code);
} else {
uni.showToast({
title: res.errMsg,
icon: "error",
});
}
},
});
},
},
});
## 2.0.10(2024-06-07)
- 优化 uni-app x 中,size 属性的类型
## 2.0.9(2024-01-12)
fix: 修复图标大小默认值错误的问题
## 2.0.8(2023-12-14)
- 修复 项目未使用 ts 情况下,打包报错的bug
## 2.0.7(2023-12-14)
- 修复 size 属性为 string 时,不加单位导致尺寸异常的bug
## 2.0.6(2023-12-11)
- 优化 兼容老版本icon类型,如 top ,bottom 等
## 2.0.5(2023-12-11)
- 优化 兼容老版本icon类型,如 top ,bottom 等
## 2.0.4(2023-12-06)
- 优化 uni-app x 下示例项目图标排序
## 2.0.3(2023-12-06)
- 修复 nvue下引入组件报错的bug
## 2.0.2(2023-12-05)
-优化 size 属性支持单位
## 2.0.1(2023-12-05)
- 新增 uni-app x 支持定义图标
## 1.3.5(2022-01-24)
- 优化 size 属性可以传入不带单位的字符串数值
## 1.3.4(2022-01-24)
- 优化 size 支持其他单位
## 1.3.3(2022-01-17)
- 修复 nvue 有些图标不显示的bug,兼容老版本图标
## 1.3.2(2021-12-01)
- 优化 示例可复制图标名称
## 1.3.1(2021-11-23)
- 优化 兼容旧组件 type 值
## 1.3.0(2021-11-19)
- 新增 更多图标
- 优化 自定义图标使用方式
- 优化 组件UI,并提供设计资源,详见:[https://uniapp.dcloud.io/component/uniui/resource](https://uniapp.dcloud.io/component/uniui/resource)
- 文档迁移,详见:[https://uniapp.dcloud.io/component/uniui/uni-icons](https://uniapp.dcloud.io/component/uniui/uni-icons)
## 1.1.7(2021-11-08)
## 1.2.0(2021-07-30)
- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834)
## 1.1.5(2021-05-12)
- 新增 组件示例地址
## 1.1.4(2021-02-05)
- 调整为uni_modules目录规范
<template>
<text class="uni-icons" :style="styleObj">
<slot>{{unicode}}</slot>
</text>
</template>
<script>
import { fontData, IconsDataItem } from './uniicons_file'
/**
* Icons 图标
* @description 用于展示 icon 图标
* @tutorial https://ext.dcloud.net.cn/plugin?id=28
* @property {Number,String} size 图标大小
* @property {String} type 图标图案,参考示例
* @property {String} color 图标颜色
* @property {String} customPrefix 自定义图标
* @event {Function} click 点击 Icon 触发事件
*/
export default {
name: "uni-icons",
props: {
type: {
type: String,
default: ''
},
color: {
type: String,
default: '#333333'
},
size: {
type: [Number, String],
default: 16
},
fontFamily: {
type: String,
default: ''
}
},
data() {
return {};
},
computed: {
unicode() : string {
let codes = fontData.find((item : IconsDataItem) : boolean => { return item.font_class == this.type })
if (codes !== null) {
return codes.unicode
}
return ''
},
iconSize() : string {
const size = this.size
if (typeof size == 'string') {
const reg = /^[0-9]*$/g
return reg.test(size as string) ? '' + size + 'px' : '' + size;
// return '' + this.size
}
return this.getFontSize(size as number)
},
styleObj() : UTSJSONObject {
if (this.fontFamily !== '') {
return { color: this.color, fontSize: this.iconSize, fontFamily: this.fontFamily }
}
return { color: this.color, fontSize: this.iconSize }
}
},
created() { },
methods: {
/**
* 字体大小
*/
getFontSize(size : number) : string {
return size + 'px';
},
},
}
</script>
<style scoped>
@font-face {
font-family: UniIconsFontFamily;
src: url('./uniicons.ttf');
}
.uni-icons {
font-family: UniIconsFontFamily;
font-size: 18px;
font-style: normal;
color: #333;
}
</style>
<template>
<!-- #ifdef APP-NVUE -->
<text :style="styleObj" class="uni-icons" @click="_onClick">{{unicode}}</text>
<!-- #endif -->
<!-- #ifndef APP-NVUE -->
<text :style="styleObj" class="uni-icons" :class="['uniui-'+type,customPrefix,customPrefix?type:'']" @click="_onClick">
<slot></slot>
</text>
<!-- #endif -->
</template>
<script>
import { fontData } from './uniicons_file_vue.js';
const getVal = (val) => {
const reg = /^[0-9]*$/g
return (typeof val === 'number' || reg.test(val)) ? val + 'px' : val;
}
// #ifdef APP-NVUE
var domModule = weex.requireModule('dom');
import iconUrl from './uniicons.ttf'
domModule.addRule('fontFace', {
'fontFamily': "uniicons",
'src': "url('" + iconUrl + "')"
});
// #endif
/**
* Icons 图标
* @description 用于展示 icons 图标
* @tutorial https://ext.dcloud.net.cn/plugin?id=28
* @property {Number} size 图标大小
* @property {String} type 图标图案,参考示例
* @property {String} color 图标颜色
* @property {String} customPrefix 自定义图标
* @event {Function} click 点击 Icon 触发事件
*/
export default {
name: 'UniIcons',
emits: ['click'],
props: {
type: {
type: String,
default: ''
},
color: {
type: String,
default: '#333333'
},
size: {
type: [Number, String],
default: 16
},
customPrefix: {
type: String,
default: ''
},
fontFamily: {
type: String,
default: ''
}
},
data() {
return {
icons: fontData
}
},
computed: {
unicode() {
let code = this.icons.find(v => v.font_class === this.type)
if (code) {
return code.unicode
}
return ''
},
iconSize() {
return getVal(this.size)
},
styleObj() {
if (this.fontFamily !== '') {
return `color: ${this.color}; font-size: ${this.iconSize}; font-family: ${this.fontFamily};`
}
return `color: ${this.color}; font-size: ${this.iconSize};`
}
},
methods: {
_onClick() {
this.$emit('click')
}
}
}
</script>
<style lang="scss">
/* #ifndef APP-NVUE */
@import './uniicons.css';
@font-face {
font-family: uniicons;
src: url('./uniicons.ttf');
}
/* #endif */
.uni-icons {
font-family: uniicons;
text-decoration: none;
text-align: center;
}
</style>
.uniui-cart-filled:before {
content: "\e6d0";
}
.uniui-gift-filled:before {
content: "\e6c4";
}
.uniui-color:before {
content: "\e6cf";
}
.uniui-wallet:before {
content: "\e6b1";
}
.uniui-settings-filled:before {
content: "\e6ce";
}
.uniui-auth-filled:before {
content: "\e6cc";
}
.uniui-shop-filled:before {
content: "\e6cd";
}
.uniui-staff-filled:before {
content: "\e6cb";
}
.uniui-vip-filled:before {
content: "\e6c6";
}
.uniui-plus-filled:before {
content: "\e6c7";
}
.uniui-folder-add-filled:before {
content: "\e6c8";
}
.uniui-color-filled:before {
content: "\e6c9";
}
.uniui-tune-filled:before {
content: "\e6ca";
}
.uniui-calendar-filled:before {
content: "\e6c0";
}
.uniui-notification-filled:before {
content: "\e6c1";
}
.uniui-wallet-filled:before {
content: "\e6c2";
}
.uniui-medal-filled:before {
content: "\e6c3";
}
.uniui-fire-filled:before {
content: "\e6c5";
}
.uniui-refreshempty:before {
content: "\e6bf";
}
.uniui-location-filled:before {
content: "\e6af";
}
.uniui-person-filled:before {
content: "\e69d";
}
.uniui-personadd-filled:before {
content: "\e698";
}
.uniui-arrowthinleft:before {
content: "\e6d2";
}
.uniui-arrowthinup:before {
content: "\e6d3";
}
.uniui-arrowthindown:before {
content: "\e6d4";
}
.uniui-back:before {
content: "\e6b9";
}
.uniui-forward:before {
content: "\e6ba";
}
.uniui-arrow-right:before {
content: "\e6bb";
}
.uniui-arrow-left:before {
content: "\e6bc";
}
.uniui-arrow-up:before {
content: "\e6bd";
}
.uniui-arrow-down:before {
content: "\e6be";
}
.uniui-arrowthinright:before {
content: "\e6d1";
}
.uniui-down:before {
content: "\e6b8";
}
.uniui-bottom:before {
content: "\e6b8";
}
.uniui-arrowright:before {
content: "\e6d5";
}
.uniui-right:before {
content: "\e6b5";
}
.uniui-up:before {
content: "\e6b6";
}
.uniui-top:before {
content: "\e6b6";
}
.uniui-left:before {
content: "\e6b7";
}
.uniui-arrowup:before {
content: "\e6d6";
}
.uniui-eye:before {
content: "\e651";
}
.uniui-eye-filled:before {
content: "\e66a";
}
.uniui-eye-slash:before {
content: "\e6b3";
}
.uniui-eye-slash-filled:before {
content: "\e6b4";
}
.uniui-info-filled:before {
content: "\e649";
}
.uniui-reload:before {
content: "\e6b2";
}
.uniui-micoff-filled:before {
content: "\e6b0";
}
.uniui-map-pin-ellipse:before {
content: "\e6ac";
}
.uniui-map-pin:before {
content: "\e6ad";
}
.uniui-location:before {
content: "\e6ae";
}
.uniui-starhalf:before {
content: "\e683";
}
.uniui-star:before {
content: "\e688";
}
.uniui-star-filled:before {
content: "\e68f";
}
.uniui-calendar:before {
content: "\e6a0";
}
.uniui-fire:before {
content: "\e6a1";
}
.uniui-medal:before {
content: "\e6a2";
}
.uniui-font:before {
content: "\e6a3";
}
.uniui-gift:before {
content: "\e6a4";
}
.uniui-link:before {
content: "\e6a5";
}
.uniui-notification:before {
content: "\e6a6";
}
.uniui-staff:before {
content: "\e6a7";
}
.uniui-vip:before {
content: "\e6a8";
}
.uniui-folder-add:before {
content: "\e6a9";
}
.uniui-tune:before {
content: "\e6aa";
}
.uniui-auth:before {
content: "\e6ab";
}
.uniui-person:before {
content: "\e699";
}
.uniui-email-filled:before {
content: "\e69a";
}
.uniui-phone-filled:before {
content: "\e69b";
}
.uniui-phone:before {
content: "\e69c";
}
.uniui-email:before {
content: "\e69e";
}
.uniui-personadd:before {
content: "\e69f";
}
.uniui-chatboxes-filled:before {
content: "\e692";
}
.uniui-contact:before {
content: "\e693";
}
.uniui-chatbubble-filled:before {
content: "\e694";
}
.uniui-contact-filled:before {
content: "\e695";
}
.uniui-chatboxes:before {
content: "\e696";
}
.uniui-chatbubble:before {
content: "\e697";
}
.uniui-upload-filled:before {
content: "\e68e";
}
.uniui-upload:before {
content: "\e690";
}
.uniui-weixin:before {
content: "\e691";
}
.uniui-compose:before {
content: "\e67f";
}
.uniui-qq:before {
content: "\e680";
}
.uniui-download-filled:before {
content: "\e681";
}
.uniui-pyq:before {
content: "\e682";
}
.uniui-sound:before {
content: "\e684";
}
.uniui-trash-filled:before {
content: "\e685";
}
.uniui-sound-filled:before {
content: "\e686";
}
.uniui-trash:before {
content: "\e687";
}
.uniui-videocam-filled:before {
content: "\e689";
}
.uniui-spinner-cycle:before {
content: "\e68a";
}
.uniui-weibo:before {
content: "\e68b";
}
.uniui-videocam:before {
content: "\e68c";
}
.uniui-download:before {
content: "\e68d";
}
.uniui-help:before {
content: "\e679";
}
.uniui-navigate-filled:before {
content: "\e67a";
}
.uniui-plusempty:before {
content: "\e67b";
}
.uniui-smallcircle:before {
content: "\e67c";
}
.uniui-minus-filled:before {
content: "\e67d";
}
.uniui-micoff:before {
content: "\e67e";
}
.uniui-closeempty:before {
content: "\e66c";
}
.uniui-clear:before {
content: "\e66d";
}
.uniui-navigate:before {
content: "\e66e";
}
.uniui-minus:before {
content: "\e66f";
}
.uniui-image:before {
content: "\e670";
}
.uniui-mic:before {
content: "\e671";
}
.uniui-paperplane:before {
content: "\e672";
}
.uniui-close:before {
content: "\e673";
}
.uniui-help-filled:before {
content: "\e674";
}
.uniui-paperplane-filled:before {
content: "\e675";
}
.uniui-plus:before {
content: "\e676";
}
.uniui-mic-filled:before {
content: "\e677";
}
.uniui-image-filled:before {
content: "\e678";
}
.uniui-locked-filled:before {
content: "\e668";
}
.uniui-info:before {
content: "\e669";
}
.uniui-locked:before {
content: "\e66b";
}
.uniui-camera-filled:before {
content: "\e658";
}
.uniui-chat-filled:before {
content: "\e659";
}
.uniui-camera:before {
content: "\e65a";
}
.uniui-circle:before {
content: "\e65b";
}
.uniui-checkmarkempty:before {
content: "\e65c";
}
.uniui-chat:before {
content: "\e65d";
}
.uniui-circle-filled:before {
content: "\e65e";
}
.uniui-flag:before {
content: "\e65f";
}
.uniui-flag-filled:before {
content: "\e660";
}
.uniui-gear-filled:before {
content: "\e661";
}
.uniui-home:before {
content: "\e662";
}
.uniui-home-filled:before {
content: "\e663";
}
.uniui-gear:before {
content: "\e664";
}
.uniui-smallcircle-filled:before {
content: "\e665";
}
.uniui-map-filled:before {
content: "\e666";
}
.uniui-map:before {
content: "\e667";
}
.uniui-refresh-filled:before {
content: "\e656";
}
.uniui-refresh:before {
content: "\e657";
}
.uniui-cloud-upload:before {
content: "\e645";
}
.uniui-cloud-download-filled:before {
content: "\e646";
}
.uniui-cloud-download:before {
content: "\e647";
}
.uniui-cloud-upload-filled:before {
content: "\e648";
}
.uniui-redo:before {
content: "\e64a";
}
.uniui-images-filled:before {
content: "\e64b";
}
.uniui-undo-filled:before {
content: "\e64c";
}
.uniui-more:before {
content: "\e64d";
}
.uniui-more-filled:before {
content: "\e64e";
}
.uniui-undo:before {
content: "\e64f";
}
.uniui-images:before {
content: "\e650";
}
.uniui-paperclip:before {
content: "\e652";
}
.uniui-settings:before {
content: "\e653";
}
.uniui-search:before {
content: "\e654";
}
.uniui-redo-filled:before {
content: "\e655";
}
.uniui-list:before {
content: "\e644";
}
.uniui-mail-open-filled:before {
content: "\e63a";
}
.uniui-hand-down-filled:before {
content: "\e63c";
}
.uniui-hand-down:before {
content: "\e63d";
}
.uniui-hand-up-filled:before {
content: "\e63e";
}
.uniui-hand-up:before {
content: "\e63f";
}
.uniui-heart-filled:before {
content: "\e641";
}
.uniui-mail-open:before {
content: "\e643";
}
.uniui-heart:before {
content: "\e639";
}
.uniui-loop:before {
content: "\e633";
}
.uniui-pulldown:before {
content: "\e632";
}
.uniui-scan:before {
content: "\e62a";
}
.uniui-bars:before {
content: "\e627";
}
.uniui-checkbox:before {
content: "\e62b";
}
.uniui-checkbox-filled:before {
content: "\e62c";
}
.uniui-shop:before {
content: "\e62f";
}
.uniui-headphones:before {
content: "\e630";
}
.uniui-cart:before {
content: "\e631";
}
This diff is collapsed.
{
"id": "uni-icons",
"displayName": "uni-icons 图标",
"version": "2.0.10",
"description": "图标组件,用于展示移动端常见的图标,可自定义颜色、大小。",
"keywords": [
"uni-ui",
"uniui",
"icon",
"图标"
],
"repository": "https://github.com/dcloudio/uni-ui",
"engines": {
"HBuilderX": "^3.2.14"
},
"directories": {
"example": "../../temps/example_temps"
},
"dcloudext": {
"sale": {
"regular": {
"price": "0.00"
},
"sourcecode": {
"price": "0.00"
}
},
"contact": {
"qq": ""
},
"declaration": {
"ads": "无",
"data": "无",
"permissions": "无"
},
"npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui",
"type": "component-vue"
},
"uni_modules": {
"dependencies": ["uni-scss"],
"encrypt": [],
"platforms": {
"cloud": {
"tcb": "y",
"aliyun": "y",
"alipay": "n"
},
"client": {
"App": {
"app-vue": "y",
"app-nvue": "y",
"app-uvue": "y"
},
"H5-mobile": {
"Safari": "y",
"Android Browser": "y",
"微信浏览器(Android)": "y",
"QQ浏览器(Android)": "y"
},
"H5-pc": {
"Chrome": "y",
"IE": "y",
"Edge": "y",
"Firefox": "y",
"Safari": "y"
},
"小程序": {
"微信": "y",
"阿里": "y",
"百度": "y",
"字节跳动": "y",
"QQ": "y",
"钉钉": "y",
"快手": "y",
"飞书": "y",
"京东": "y"
},
"快应用": {
"华为": "y",
"联盟": "y"
},
"Vue": {
"vue2": "y",
"vue3": "y"
}
}
}
}
}
## Icons 图标
> **组件名:uni-icons**
> 代码块: `uIcons`
用于展示 icons 图标 。
### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-icons)
#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839
## 1.3.14(2024-10-15)
- 修复 微信小程序中的getSystemInfo警告
## 1.3.13(2024-10-12)
- 修复 微信小程序中的getSystemInfo警告
## 1.3.12(2024-10-12)
- 修复 微信小程序中的getSystemInfo警告
## 1.3.11(2023-03-29)
- 修复 自定义状态栏高度闪动BUG
## 1.3.10(2023-03-29)
- 修复 暗黑模式下边线颜色错误的bug
## 1.3.9(2022-10-13)
- 修复 条件编译错误的bug
## 1.3.8(2022-10-12)
- 修复 nvue 环境 fixed 为 true 的情况下,无法置顶的 bug
## 1.3.7(2022-08-11)
- 修复 nvue 环境下 fixed 为 true 的情况下,无法置顶的 bug
## 1.3.6(2022-06-30)
- 修复 组件示例中插槽用法无法显示内容的bug
## 1.3.5(2022-05-24)
- 新增 stat 属性 ,可开启统计title 上报 ,仅使用了title 属性且项目开启了uni统计生效
## 1.3.4(2022-01-24)
- 更新 组件示例
## 1.3.3(2022-01-24)
- 新增 left-width/right-width属性 ,可修改左右两侧的宽度
## 1.3.2(2022-01-18)
- 修复 在vue下,标题不垂直居中的bug
## 1.3.1(2022-01-18)
- 修复 height 属性类型错误
## 1.3.0(2022-01-18)
- 新增 height 属性,可修改组件高度
- 新增 dark 属性可可开启暗黑模式
- 优化 标题字数过多显示省略号
- 优化 插槽,插入内容可完全覆盖
## 1.2.1(2022-01-10)
- 修复 color 属性不生效的bug
## 1.2.0(2021-11-19)
- 优化 组件UI,并提供设计资源,详见:[https://uniapp.dcloud.io/component/uniui/resource](https://uniapp.dcloud.io/component/uniui/resource)
- 文档迁移,详见:[https://uniapp.dcloud.io/component/uniui/uni-nav-bar](https://uniapp.dcloud.io/component/uniui/uni-nav-bar)
## 1.1.0(2021-07-30)
- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834)
## 1.0.11(2021-05-12)
- 新增 组件示例地址
## 1.0.10(2021-04-30)
- 修复 在nvue下fixed为true,宽度不能撑满的Bug
## 1.0.9(2021-04-21)
- 优化 添加依赖 uni-icons, 导入后自动下载依赖
## 1.0.8(2021-04-14)
- uni-ui 修复 uni-nav-bar 当 fixed 属性为 true 时铺不满屏幕的 bug
## 1.0.7(2021-02-25)
- 修复 easycom 下,找不到 uni-status-bar 的bug
## 1.0.6(2021-02-05)
- 优化 组件引用关系,通过uni_modules引用组件
## 1.0.5(2021-02-05)
- 调整为uni_modules目录规范
This diff is collapsed.
<template>
<view :style="{ height: statusBarHeight }" class="uni-status-bar">
<slot />
</view>
</template>
<script>
export default {
name: 'UniStatusBar',
data() {
return {
// #ifdef MP-WEIXIN
statusBarHeight: uni.getWindowInfo().statusBarHeight + 'px',
// #endif
// #ifndef MP-WEIXIN
statusBarHeight: uni.getSystemInfoSync().statusBarHeight + 'px',
// #endif
}
}
}
</script>
<style lang="scss" >
.uni-status-bar {
// width: 750rpx;
height: 20px;
// height: var(--status-bar-height);
}
</style>
{
"id": "uni-nav-bar",
"displayName": "uni-nav-bar 自定义导航栏",
"version": "1.3.14",
"description": "自定义导航栏组件,主要用于头部导航。",
"keywords": [
"uni-ui",
"导航",
"导航栏",
"自定义导航栏"
],
"repository": "https://github.com/dcloudio/uni-ui",
"engines": {
"HBuilderX": ""
},
"directories": {
"example": "../../temps/example_temps"
},
"dcloudext": {
"sale": {
"regular": {
"price": "0.00"
},
"sourcecode": {
"price": "0.00"
}
},
"contact": {
"qq": ""
},
"declaration": {
"ads": "无",
"data": "无",
"permissions": "无"
},
"npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui",
"type": "component-vue"
},
"uni_modules": {
"dependencies": [
"uni-scss",
"uni-icons"
],
"encrypt": [],
"platforms": {
"cloud": {
"tcb": "y",
"aliyun": "y",
"alipay": "n"
},
"client": {
"App": {
"app-vue": "y",
"app-nvue": "y"
},
"H5-mobile": {
"Safari": "y",
"Android Browser": "y",
"微信浏览器(Android)": "y",
"QQ浏览器(Android)": "y"
},
"H5-pc": {
"Chrome": "y",
"IE": "y",
"Edge": "y",
"Firefox": "y",
"Safari": "y"
},
"小程序": {
"微信": "y",
"阿里": "y",
"百度": "y",
"字节跳动": "y",
"QQ": "y"
},
"快应用": {
"华为": "u",
"联盟": "u"
},
"Vue": {
"vue2": "y",
"vue3": "y"
}
}
}
}
}
## NavBar 导航栏
> **组件名:uni-nav-bar**
> 代码块: `uNavBar`
导航栏组件,主要用于头部导航。
### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-nav-bar)
#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839
This diff is collapsed.
This diff is collapsed.
{
"uni-popup.cancel": "cancel",
"uni-popup.ok": "ok",
"uni-popup.placeholder": "pleace enter",
"uni-popup.title": "Hint",
"uni-popup.shareTitle": "Share to"
}
import en from './en.json'
import zhHans from './zh-Hans.json'
import zhHant from './zh-Hant.json'
export default {
en,
'zh-Hans': zhHans,
'zh-Hant': zhHant
}
{
"uni-popup.cancel": "取消",
"uni-popup.ok": "确定",
"uni-popup.placeholder": "请输入",
"uni-popup.title": "提示",
"uni-popup.shareTitle": "分享到"
}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment