提交 d19716a2 authored 作者: 刘旭's avatar 刘旭

初次提交代码

上级
# Windows
[Dd]esktop.ini
Thumbs.db
$RECYCLE.BIN/
# macOS
.DS_Store
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
# Node.js
node_modules/
dist
.git
.idea
.hbuilderx
*.iml
pnpm-lock.yaml
# 默认忽略的文件
/shelf/
/workspace.xml
# 基于编辑器的 HTTP 客户端请求
/httpRequests/
FROM nginx
VOLUME /tmp
ENV LANG en_US.UTF-8
RUN echo "\
# gzip config\
gzip on;\
gzip_min_length 1k;\
gzip_comp_level 9;\
gzip_types text/plain application/javascript application/x-javascript text/css application/xml text/javascript application/x-httpd-php image/jpeg image/gif image/png;\
gzip_vary on;\
gzip_disable "MSIE [1-6]\.";\
server { \
listen 80; \
client_max_body_size 20m; \
fastcgi_buffers 256 128k; \
chunked_transfer_encoding off; \
#listen 443 ssl; \
#ssl on;\
#ssl_certificate /etc/nginx/ssl/7278703_blueelephant.es-erp.com.pem;\
#ssl_certificate_key /etc/nginx/ssl/7278703_blueelephant.es-erp.com.key;\
#ssl_session_timeout 5m;\
location /admin { \
proxy_pass http://yongxingda; \
proxy_set_header Host yongxingda; \
proxy_set_header X-Real-IP \$remote_addr; \
proxy_set_header X-Forwarded-For \$proxy_add_x_forwarded_for; \
} \
location /wx { \
proxy_pass http://yongxingda; \
proxy_set_header Host yongxingda; \
proxy_set_header X-Real-IP \$remote_addr; \
proxy_set_header X-Forwarded-For \$proxy_add_x_forwarded_for; \
} \
#解决Router(mode: 'history')模式下,刷新路由地址不能找到页面的问题 \
location / { \
root /var/www/html/; \
index index.html index.htm; \
if (!-e \$request_filename) { \
rewrite ^(.*)\$ /index.html?s=\$1 last; \
break; \
} \
} \
access_log /var/log/nginx/access.log ; \
} " > /etc/nginx/conf.d/default.conf \
&& mkdir -p /var/www \
&& mkdir -p /var/www/html
ADD dist/build/h5 /var/www/html/
EXPOSE 80
# mini-shop
#### Description
基于uniapp构建的小程序商城
#### Software Architecture
Software architecture description
#### Installation
1. xxxx
2. xxxx
3. xxxx
#### Instructions
1. xxxx
2. xxxx
3. xxxx
#### Contribution
1. Fork the repository
2. Create Feat_xxx branch
3. Commit your code
4. Create Pull Request
# mini-shop
#### 介绍
永兴达h5商城项目
#### 软件架构
uniapp(vue3) + vite + typescript + uni-ui
#### 安装教程
1. xxxx
2. xxxx
3. xxxx
#### 使用说明
1. xxxx
2. xxxx
3. xxxx
#### 参与贡献
1. Fork 本仓库
2. 新建 Feat_xxx 分支
3. 提交代码
4. 新建 Pull Request
[core]
bare = true
repositoryformatversion = 0
filemode = false
symlinks = false
ignorecase = true
Unnamed repository; edit this file 'description' to name the repository.
version: '3'
services:
yongxinda-h5:
build:
context: ../
image: 192.168.0.26:5000/yongxinda-h5
\ No newline at end of file
version: '3'
services:
yongxinda-h5:
image: 1ar8696937.iok.la:22594/yongxinda-h5
container_name: yongxinda-h5
ports:
- "81:80"
- "444:443"
environment:
- TZ=Asia/Shanghai
restart: always
\ No newline at end of file
version: '3'
services:
yongxinda-h5:
build:
context: ../
image: dockerprivatestorage:80/yongxinda-h5
\ No newline at end of file
cd ../
yarn install
yarn run build:h5
cd docker
docker-compose -f docker-extranet-compose-build.yml build
docker-compose -f docker-extranet-compose-build.yml push
cd ../
yarn install
yarn run build:h5
cd docker
docker-compose -f docker-compose-build.yml build
docker-compose -f docker-compose-build.yml push
\ No newline at end of file
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" href="" type="png/x-icon" />
<link rel="stylesheet" href="./src/static/iconfont/iconfont.css" />
<script>
var coverSupport =
'CSS' in window &&
typeof CSS.supports === 'function' &&
(CSS.supports('top: env(a)') || CSS.supports('top: constant(a)'))
document.write(
'<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' +
(coverSupport ? ', viewport-fit=cover' : '') +
'" />'
)
</script>
</head>
<body>
<div id="app"><!--app-html--></div>
<script type="module" src="/src/main.ts"></script>
<script src="./src/static/iconfont/iconfont.js"></script>
</body>
</html>
<style></style>
This source diff could not be displayed because it is too large. You can view the blob instead.
{
"name": "uni-preset-vue",
"version": "0.0.0",
"scripts": {
"dev:h5": "uni preview --open",
"dev:h5:ssr": "uni --ssr",
"dev:mp-weixin": "uni -p mp-weixin",
"build:app": "uni build -p app",
"build:h5": "uni build",
"build:h5:ssr": "uni build --ssr",
"build:mp-weixin": "uni build -p mp-weixin"
},
"dependencies": {
"@daadad":"sadsadasdasdasdasdasds",
"@dcloudio/uni-app": "3.0.0-alpha-3061620221230002",
"@dcloudio/uni-app-plus": "3.0.0-alpha-3061620221230002",
"@dcloudio/uni-components": "3.0.0-alpha-3061620221230002",
"@dcloudio/uni-h5": "3.0.0-alpha-3061620221230002",
"@dcloudio/uni-mp-alipay": "3.0.0-alpha-3061620221230002",
"@dcloudio/uni-mp-baidu": "3.0.0-alpha-3061620221230002",
"@dcloudio/uni-mp-kuaishou": "3.0.0-alpha-3061620221230002",
"@dcloudio/uni-mp-lark": "3.0.0-alpha-3061620221230002",
"@dcloudio/uni-mp-qq": "3.0.0-alpha-3061620221230002",
"@dcloudio/uni-mp-toutiao": "3.0.0-alpha-3061620221230002",
"@dcloudio/uni-mp-weixin": "3.0.0-alpha-3061620221230002",
"@dcloudio/uni-quickapp-webview": "3.0.0-alpha-3061620221230002",
"node-sass": "^7.0.1",
"pinia": "^2.0.21",
"pinia-plugin-persistedstate": "^3.1.0",
"vk-uview-ui": "^1.4.4",
"vue": "^3.2.45",
"vue-i18n": "^9.1.9"
},
"devDependencies": {
"@dcloudio/types": "^3.2.7",
"@dcloudio/uni-automator": "3.0.0-alpha-3061620221230002",
"@dcloudio/uni-cli-shared": "3.0.0-alpha-3061620221230002",
"@dcloudio/uni-stacktracey": "3.0.0-alpha-3061620221230002",
"@dcloudio/uni-ui": "^1.4.20",
"@dcloudio/vite-plugin-uni": "3.0.0-alpha-3061620221230002",
"@types/node": "^18.7.14",
"@vue/tsconfig": "^0.1.3",
"sass": "^1.54.8",
"sass-loader": "^13.0.2",
"typescript": "^4.9.4",
"vite": "4.0.4",
"vite-plugin-svg-icons": "^2.0.1"
}
}
<script setup lang="ts">
import { onLaunch, onShow, onHide } from '@dcloudio/uni-app';
</script>
<style lang="scss" scoped>
@import 'vk-uview-ui/index.scss';
// @import '@/static/iconfont/iconfont.css';
page {
background-color: #f6f6f6;
}
.uni-tabbar {
max-width: 420px;
margin: 0 auto;
border-left: #f6f6f6 solid 1px;
border-right: #f6f6f6 solid 1px;
}
</style>
import request from '@/utils/request'
// 获取发布菜单
export const getMenuTree = () => request('/LowCodePlatform/center/permission/getMenuTree', 'GET')
export const getMenuList = () => request('/LowCodePlatform/user/getMenuList', 'POST')
export const getBusinessList = (data: any) => request('/LowCodePlatform/center/business/list', 'GET', data)
export const getMetadataList = () => request('/LowCodePlatform/center/metadata/list', 'GET')
\ No newline at end of file
import request from '@/utils/request'
// 登录
export const login = (data: any) => request('/LowCodePlatform/auth/login/app', 'POST', data)
<template>
<u-navbar back-text="" :title="title" :back-icon-name="backIconName" title-color="#000000"
:background="{ background: '#f8f8f8' }">
<template #right>
<u-icon :name="iconName" :size="44" style="padding: 14rpx 14rpx 14rpx 24rpx;" />
</template>
</u-navbar>
</template>
<script setup lang='ts'>
import { ref } from 'vue'
const props = defineProps({
title: {
type: String,
default: ''
},
backIconName: {
type: String,
default: ''
},
iconName: {
type: String,
default: ''
}
})
</script>
<style lang = "scss" scoped>
:deep(.u-line-1) {
font-weight: bold;
}
// #ifdef APP-PLUS
:deep(.uicon-nav-back:before) {
font-size: 44rpx;
}
/* #endif */
</style>
\ No newline at end of file
<template>
<svg :style="iconStyle" aria-hidden="true" :fill="iconColor">
<use :xlink:href="symbolId" />
</svg>
</template>
<script lang="ts" setup>
import { computed, CSSProperties } from 'vue';
interface SvgProps {
name: string; // 图标名称 ==> 必传
prefix?: string, // 图标的前缀 ==> 非必传(默认为"icon")
iconStyle?: CSSProperties, // 图标的样式 ==> 非必传
iconColor?: string
}
// 接收父组件参数并设置默认值
// withDefaults 作用是给defineProps绑定默认值的api
const props = withDefaults(defineProps<SvgProps>(), {
prefix: 'icon',
iconStyle: () => ({ width: '23px', height: '23px' }),
iconColor: 'pink'
})
const symbolId = computed(() => `#${props.prefix}-${props.name}`)
</script>
\ No newline at end of file
/// <reference types="vite/client" />
declare module '*.vue' {
import { DefineComponent } from 'vue'
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/ban-types
const component: DefineComponent<{}, {}, any>
export default component
}
import { createSSRApp } from 'vue'
import { broadcastScan } from './utils/scanCode'
import App from './App.vue'
import Model from '@/utils/util'
import uView from 'vk-uview-ui'
import config from '@/utils/config'
import pinia from './store/useStore'
import 'virtual:svg-icons-register'
export function createApp() {
const app = createSSRApp(App)
app.config.globalProperties.$baseUrl = config.baseUrl
app.config.globalProperties.$model = Model
app.config.globalProperties.$broadcastScan = broadcastScan
app.use(uView)
app.use(pinia)
return {
app,
}
}
{
"name" : "pda测试",
"appid" : "__UNI__6D85B85",
"description" : "",
"versionName" : "1.0.0",
"versionCode" : "100",
"transformPx" : false,
/* 5+App特有相关 */
"app-plus" : {
"usingComponents" : true,
"nvueStyleCompiler" : "uni-app",
"compilerVersion" : 3,
"splashscreen" : {
"alwaysShowBeforeRender" : true,
"waiting" : true,
"autoclose" : true,
"delay" : 0
},
"compatible" : {
"ignoreVersion" : true
},
/* 模块配置 */
"modules" : {
"Barcode" : {},
"Bluetooth" : {}
},
/* 应用发布信息 */
"distribute" : {
/* android打包配置 */
"android" : {
"permissions" : [
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
"<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.CAMERA\"/>",
"<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
"<uses-feature android:name=\"android.hardware.camera\"/>",
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
],
"minSdkVersion" : 21
},
/* ios打包配置 */
"ios" : {
"dSYMs" : false
},
/* SDK配置 */
"sdkConfigs" : {
"ad" : {}
}
}
},
/* 快应用特有相关 */
"quickapp" : {},
/* 小程序特有相关 */
"mp-weixin" : {
"appid" : "wx3c4c615b24d3b72b",
"setting" : {
"urlCheck" : false
},
"usingComponents" : true
},
"mp-alipay" : {
"usingComponents" : true
},
"mp-baidu" : {
"usingComponents" : true
},
"mp-toutiao" : {
"usingComponents" : true
},
"uniStatistics" : {
"enable" : false,
"version" : "2"
},
"vueVersion" : "3",
"h5" : {
"template" : "index.html"
}
}
{
"easycom": {
"autoscan": true,
"custom": {
"^uni-(.*)": "@dcloudio/uni-ui/lib/uni-$1/uni-$1.vue",
"^u-(.*)": "vk-uview-ui/components/u-$1/u-$1.vue"
}
},
"pages": [
{
"path": "pages/login/index",
"style": {
"navigationBarTitleText": "登录"
}
},
{
"path": "pages/home/index",
"style": {
"navigationBarTitleText": "主页"
}
},
{
"path": "pages/apply/index",
"style": {
"navigationBarTitleText": "应用"
}
},
{
"path": "pages/setting/index",
"style": {
"navigationBarTitleText": "设置",
"navigationBarBackgroundColor": "#f6f6f6"
}
},
{
"path": "pages/apply/formDataPage",
"style": {
"navigationBarBackgroundColor": "#f6f6f6",
"navigationStyle": "custom"
}
},
{
"path": "pages/apply/formDetail",
"style": {
"navigationBarBackgroundColor": "#f6f6f6",
"navigationStyle": "custom"
}
}
],
"tabBar": {
"selectedColor": "#333",
"color": "#707070",
"backgroundColor": "#f6f6f6",
"borderStyle": "white",
"height": "50px",
"list": [
{
"pagePath": "pages/home/index",
"iconPath": "/static/tabbar/home.png",
"selectedIconPath": "/static/tabbar/home_fill.png",
"text": "主页"
},
{
"pagePath": "pages/apply/index",
"iconPath": "/static/tabbar/apply.png",
"selectedIconPath": "/static/tabbar/apply_fill.png",
"text": "应用"
},
{
"pagePath": "pages/setting/index",
"iconPath": "/static/tabbar/setting.png",
"selectedIconPath": "/static/tabbar/setting_fill.png",
"text": "设置"
}
]
},
"globalStyle": {
"navigationBarTextStyle": "black",
"navigationBarTitleText": "uni-app",
"navigationBarBackgroundColor": "#F8F8F8",
"backgroundColor": "#F8F8F8"
}
}
<template>
<view class="card">
<u-row :gutter="12" class="box-list">
<u-col :span="10">
<u-row>
<block v-for="(item, index) in list" :key="index">
<u-col :span="6" class="text-box">
<text class="label">{{ item.label }}</text>
<text class="value">{{ item.value }}</text>
</u-col>
</block>
</u-row>
</u-col>
<u-col :span="1" style="text-align: center;">
<!-- #ifdef APP-PLUS -->
<u-checkbox @change="checkboxChange" v-model="checked" size="17" />
<!-- #endif -->
<!-- #ifdef H5 -->
<u-checkbox @change="checkboxChange" v-model="checked" />
<!-- #endif -->
</u-col>
</u-row>
</view>
</template>
<script setup lang='ts'>
import { ref } from 'vue'
let list = [
{ label: '领料单号', value: 'SCLL2023031184' },
{ label: '来源单号', value: '暂无' },
{ label: '备注', value: '林继锋 (样品组)' },
{ label: '创建时间', value: '2023-03-14 13:56:42.797' },
{ label: '创建人', value: '刘国辉' },
{ label: '源单类型', value: '暂无' },
]
const checked = ref(false)
const checkboxChange = (val: boolean) => {
console.log(val);
}
</script>
<style lang = "scss" scoped>
.card {
box-sizing: border-box;
margin: 16rpx;
padding: 16rpx;
border-radius: 8rpx;
border: 1px solid #e4e7ed;
background-color: #ffffff;
overflow: hidden;
color: #303133;
transition: .3s;
box-shadow: 0px 0px 12px rgba(0, 0, 0, .05);
.box-list {
display: flex;
flex-direction: row;
.text-box {
box-sizing: border-box;
display: flex;
flex-direction: column;
font-size: 14px;
margin-bottom: 10rpx;
// width: 50%;
.label,
.value {
display: inline-block;
width: 100%;
}
}
}
}
:deep(.u-checkbox__label) {
display: none;
}
</style>
\ No newline at end of file
<template>
// #ifdef APP-PLUS
<u-form :model="formData" label-width="75" :border-bottom="true">
<u-form-item label="领料单号" prop="oddNumbers">
<u-input v-model="formData.oddNumbers" />
</u-form-item>
<u-line />
<u-form-item label="备注" prop="remarks">
<u-input v-model="formData.remarks" />
</u-form-item>
</u-form>
// #endif
// #ifdef H5
<u-form :model="formData" label-width="155" :border-bottom="true">
<u-form-item label="领料单号" prop="oddNumbers">
<u-input v-model="formData.oddNumbers" />
</u-form-item>
<u-line />
<u-form-item label="备注" prop="remarks">
<u-input v-model="formData.remarks" />
</u-form-item>
</u-form>
// #endif
</template>
<script setup lang='ts'>
import { reactive } from 'vue'
const formData = reactive({
oddNumbers: 'SCLL2023031156',
remarks: ''
})
</script>
<style lang = "scss" scoped>
// #ifdef APP-PLUS
// :deep(.u-form-item) {
// padding: 0;
// }
// #endif
:deep(.u-form-item) {
padding: 0;
}
</style>
\ No newline at end of file
<template>
<input class="inputSty" v-model="wuValue" :focus="focusType" @blur="setfocus" @confirm="searchWu" placeholder="请扫码"
placeholder-style="font-size:12px" />
</template>
<script setup lang="ts">
import { ref, nextTick } from "vue";
import { onLoad, onUnload, onHide, onBackPress } from "@dcloudio/uni-app";
const focusType = ref(true)
const wuValue = ref()
//只要操作代码在这里
const keypress = (e: any) => {
console.log(e, "按键码");
// 102 左侧 103 右侧 104 中间按键
if (e.keyCode === 102 || e.keyCode === 103 || e.keyCode === 104) {
//这里按键成功
}
if (e.keyCode == 66) { //enter按键
//这里input已经拿到数据了,在这里把拿到的数据,通过接口数据联调起来
}
}
onLoad((val) => {
// #ifdef APP-PLUS
plus.key.addEventListener("keyup", keypress);
// #endif
// #ifdef H5
document.addEventListener("keyup", keypress);
// #endif
})
onUnload(() => {
// #ifdef APP-PLUS
plus.key.removeEventListener("keyup", keypress);
// #endif
// #ifdef H5
document.removeEventListener("keyup", keypress);
// #endif
})
onHide(() => {
// #ifdef APP-PLUS
plus.key.removeEventListener("keyup", keypress);
// #endif
// #ifdef H5
document.removeEventListener("keyup", keypress);
// #endif
})
onBackPress(() => {
// #ifdef APP-PLUS
plus.key.removeEventListener("keyup", keypress);
// #endif
// #ifdef H5
document.removeEventListener("keyup", keypress);
// #endif
})
//解决焦点自动丢失,无法再次自动聚焦
const setfocus = () => {
focusType.value = false
nextTick(() => {
focusType.value = true
})
}
const searchWu = () => {
//这里是调接口,传递数据,等一些列操作
}
</script>
<style lang = "scss" scoped>
</style>
\ No newline at end of file
<template>
<vk-header :title="title" back-icon-name="nav-back" />
<form-list-item @tap="toDetail" />
</template>
<script setup lang='ts'>
import { ref } from 'vue'
import { onLoad } from '@dcloudio/uni-app';
import { getBusinessList } from '@/api/apply'
import { useFormData } from '@/store/modules/formData';
import vkHeader from '@/components/header/index.vue'
import FormListItem from './component/FormListItem.vue';
const title = ref('')
const store = useFormData()
onLoad(async (options: any) => {
const option = JSON.parse(options.data)
// console.log(option);
const { permTag: formId, subSystem, title: t } = option
title.value = t
const { data: res } = await getBusinessList({ formId, subSystem })
if (res.code === 200) handleLoadData(res.data)
})
const handleLoadData = (data: any) => {
console.log(data);
let list: any[] = []
data.dataList.map((item: any) => {
data.fieldList.map((field: any) => {
for (const d in item) {
if (field.key === d) {
list.push({
})
}
}
})
})
}
const toDetail = () => {
uni.navigateTo({ url: '/pages/apply/formDetail' })
}
</script>
<style lang = "scss" scoped>
</style>
\ No newline at end of file
<template>
<vk-header :title="title" back-icon-name="nav-back" />
<view class="header">
<view class="scan-input">
<scanInput />
<!-- #ifdef APP-PLUS -->
<u-icon name="scan" size="22" style="padding: 14rpx" />
<!-- #endif -->
<!-- #ifdef H5 -->
<u-icon name="scan" size="44" style="padding: 14rpx" />
<!-- #endif -->
</view>
<view style="text-align: right;">
<!-- #ifdef APP-PLUS -->
<u-icon name="list" size="22" style="padding: 14rpx" />
<!-- #endif -->
<!-- #ifdef H5 -->
<u-icon name="list" size="44" style="padding: 14rpx" />
<!-- #endif -->
</view>
</view>
<!-- rgb(218,222,224) -->
<view class="line" />
<view class="detail-content">
<view v-show="show">
<block v-for="item in list">
<view class="list">
<view class="label">{{ item.label }}</view>
<view class="value">{{ item.value }}</view>
</view>
</block>
<view class="label1">规格:</view>
<view class="specifications">
<u-row :gutter="12">
<u-col v-for="item in specList" :span="5.5" style="white-space: nowrap;">
<view class="list">
<view class="label">{{ item.label }}</view>
<view class="value">{{ item.value }}</view>
</view>
</u-col>
</u-row>
</view>
</view>
<view class="footer">
<view>
<view @tap="
() => {
show = !show;
if (show) scanIcon = 'arrow-up-fill';
else scanIcon = 'arrow-down-fill';
}
">
<u-icon :name="scanIcon"></u-icon>
关闭扫描详情
</view>
</view>
<view>未备够</view>
</view>
</view>
<view class="footer-form">
<detail-form />
</view>
</template>
<script setup lang="ts">
import { ref, nextTick } from 'vue';
import vkHeader from '@/components/header/index.vue';
import detailForm from './component/detailForm.vue';
import scanInput from './component/scanInput.vue'
const title = ref('业务组');
const show = ref(true);
const scanIcon = ref('arrow-up-fill');
const list = ref([
{ label: '备料单号:', value: 'RQ202303140551' },
{ label: '来源单号:', value: ' Z23027438-1' },
{ label: '物料编码:', value: '21.32092' },
{ label: '助记码:', value: 'RD020V3-201' },
{ label: '物料名称:', value: '镜座' },
{ label: '助记码:', value: 'RQ202303140551' },
]);
const specList = ref([
{ label: '仓库:', value: '装配仓' },
{ label: '储位:', value: '5F-A06-21-1' },
{ label: '需求:', value: '2304' },
{ label: '应发:', value: '2350.08' },
{ label: '数量:', value: '0.000' },
]);
</script>
<style lang="scss" scoped>
.header {
padding: 20rpx 20rpx;
display: flex;
justify-content: space-between;
align-items: center;
.scan-input {
width: 80%;
box-sizing: border-box;
display: flex;
justify-content: space-between;
align-items: center;
border-radius: 4px;
border: 1px solid #dcdfe6;
padding: 0 20rpx;
input {
width: 80%;
}
}
}
.line {
width: 100%;
height: 4rpx;
background: linear-gradient(#cccccc, #cccccc08, #cccccc);
}
.detail-content {
margin: 20rpx;
background-color: rgb(218, 222, 224);
padding: 30rpx;
border-radius: 5rpx;
.list {
display: flex;
flex-direction: row;
padding: 10rpx 0;
.label {
width: 200rpx;
text-align: right;
}
.value {}
}
.label1 {
width: 200rpx;
text-align: right;
padding: 10rpx 0;
}
.specifications {
width: 100%;
display: flex;
flex-direction: row;
.list {
display: flex;
flex-direction: row;
}
.label {
width: 165rpx;
text-align: right;
}
.list:nth-last-child(1) .value {
color: rgb(0, 31, 158);
font-weight: 500;
}
}
.footer {
display: flex;
justify-content: space-around;
color: rgb(0, 31, 158);
font-weight: 900;
padding: 10rpx 0;
}
}
.footer-form {
box-sizing: border-box;
// position: fixed;
// bottom: 0;
width: 100%;
padding: 0 20rpx;
border-top: 1rpx solid #ccc;
border-bottom: 1rpx solid #ccc;
}
</style>
<template>
<block v-for="res in menuList" :key="res.path">
<view class="card" v-show="res.children?.length">
<h3 class="card-text">{{ res.title }}</h3>
<u-grid :col="4" :border="false">
<u-grid-item v-for="item in res.children" :custom-style="{ 'text-align': 'center' }"
@tap="tapGridItem(item)">
<!-- <svg-icon name="dayin" /> -->
<p class="iconfont icon-dayin" style="color: pink;"></p>
<!-- <svg-icon name="dayin" /> -->
<!-- <i class="iconfont">&#xe609;</i> -->
<view class="grid-text">{{ item.title }}</view>
</u-grid-item>
</u-grid>
</view>
</block>
</template>
<script setup lang='ts'>
import { ref } from 'vue'
import svgIcon from '@/components/svgIcon/index.vue'
import { getMenuTree } from '@/api/apply';
const menuList = ref()
const tapGridItem = (row: any) => {
uni.navigateTo({ url: '/pages/apply/formDataPage?data=' + encodeURIComponent(JSON.stringify(row)), })
}
// 过滤未发布的菜单
const handleMenuTree = (list: any[]) => {
let newList: any[] = []
list.map((item: any) => {
if (item.publish) {
let childCpoy = JSON.parse(JSON.stringify(item.children))
let arr = handleMenuTree(childCpoy)
item.children = [...arr]
newList.push(item)
}
})
return newList
}
const init = async () => {
const { data: res } = await getMenuTree()
if (res.code === 200) {
menuList.value = handleMenuTree(res.data)
}
}
init()
</script>
<style lang = "scss" scoped>
.card {
box-sizing: border-box;
margin: 16rpx;
border-radius: 8rpx;
border: 1px solid #e4e7ed;
background-color: #ffffff;
overflow: hidden;
color: #303133;
transition: .3s;
box-shadow: 0px 0px 12px rgba(0, 0, 0, .05);
.card-text {
padding: 20rpx;
}
.grid-text {
font-size: 28rpx;
margin-top: 4rpx;
color: #303133;
padding: 0 10rpx;
white-space: 'nowrap';
text-overflow: 'ellipsis';
overflow: 'hidden';
}
}
</style>
\ No newline at end of file
<template>
<view class="wrap">
<u-swiper :list="list" :height="swiperHeight"></u-swiper>
</view>
{{ config.baseUrl }}
</template>
<script setup lang='ts'>
import { ref, onMounted } from 'vue'
import config from '@/utils/config'
const list = [{
image: 'https://cdn.uviewui.com/uview/swiper/1.jpg',
title: '昨夜星辰昨夜风,画楼西畔桂堂东'
},
{
image: 'https://cdn.uviewui.com/uview/swiper/2.jpg',
title: '身无彩凤双飞翼,心有灵犀一点通'
},
{
image: 'https://cdn.uviewui.com/uview/swiper/3.jpg',
title: '谁念西风独自凉,萧萧黄叶闭疏窗,沉思往事立残阳'
}]
let swiperHeight = ref('250')
onMounted(() => {
// #ifdef APP-PLUS
swiperHeight.value = '250'
// #endif
// #ifdef H5
swiperHeight.value = '500'
// #endif
})
</script>
<style lang = "scss" scoped>
</style>
\ No newline at end of file
<template>
<u-form :model="loginForm" ref="loginFormRef" :rules="loginFormRules" style="margin-top: 40rpx;" label-posi>
// #ifdef APP-PLUS
<u-form-item :leftIconStyle="{ color: '#888', fontSize: '20rpx' }" left-icon="account" label-width="75"
label-position="left" label="用户名" prop="username">
<u-input placeholder="请输入用户名" v-model="loginForm.username" type="text" />
</u-form-item>
<u-form-item label="密码" :leftIconStyle="{ color: '#888', fontSize: '20rpx' }" left-icon="lock" label-width="75"
prop="password">
<u-input type="password" v-model="loginForm.password" placeholder="请输入密码" />
</u-form-item>
// #endif
// #ifdef H5
<u-form-item :leftIconStyle="{ color: '#888', fontSize: '32rpx' }" left-icon="account" label-width="150"
label-position="left" label="用户名" prop="username">
<u-input placeholder="请输入用户名" v-model="loginForm.username" type="text" />
</u-form-item>
<u-form-item label="密码" :leftIconStyle="{ color: '#888', fontSize: '32rpx' }" left-icon="lock"
label-width="150rpx" prop="password">
<u-input type="password" v-model="loginForm.password" placeholder="请输入密码" />
</u-form-item>
// #endif
</u-form>
<button @tap="tapLogin" class="getCaptcha">登录</button>
</template>
<script setup lang="ts">
import { ref, reactive, onMounted } from 'vue'
import { Login } from '../interface';
import { login } from '@/api/login'
import { useGlobalStore } from '@/store/useStore';
const globalStore = useGlobalStore()
const loginFormRef = ref()
const loginForm = reactive<Login.LoginForm>({
username: 'admin',
password: '123456'
})
const loginFormRules = reactive({
username: [{ required: true, message: '请输入用户名', trigger: 'blur' }],
password: [{ required: true, message: '请输入密码', trigger: 'blur' }],
})
let tapLogin = () => {
loginFormRef.value?.validate(async (valid: boolean) => {
if (valid) {
const { data: res } = await login(loginForm)
console.log(res);
if (res.code === 200) {
globalStore.setToken(res.data.token)
uni.reLaunch({
url: '/pages/home/index'
})
}
} else {
console.log('验证失败');
}
});
};
onMounted(() => loginFormRef.value?.setRules(loginFormRules))
</script>
<style lang="scss" scoped>
.getCaptcha {
width: 400rpx;
background-color: rgb(253, 243, 208);
color: $u-tips-color;
border: none;
font-size: 30rpx;
margin-top: 20rpx;
&::after {
border: none;
}
}
// #ifdef APP-PLUS
:deep(.uicon-eye:before) {
font-size: 40rpx;
}
:deep(.uicon-eye-fill:before) {
font-size: 40rpx;
}
:deep(.u-input) {
justify-content: center;
align-items: center;
}
// #endif
</style>
<template>
<view style="box-sizing: border-box;">
<view class="login-container">
<text class="login-text">欢迎登陆</text>
<loginForm />
</view>
</view>
</template>
<script setup lang="ts">
import loginForm from './components/loginForm.vue';
</script>
<style lang="scss" scoped>
:deep(uni-page-wrapper) {
background-color: #fff;
}
:deep(uni-page) {
padding: 0 6rpx;
box-sizing: border-box;
}
.login-container {
box-sizing: border-box;
margin: 20% auto 0;
padding: 0 10%;
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
background-color: #fff;
.login-text {
margin-top: 10%;
font-weight: 700;
font-size: 40rpx;
color: #1d2b5f;
}
}
</style>
export namespace Login {
export interface LoginForm {
username: string,
password: string
}
}
\ No newline at end of file
<template>
<u-button type="primary" @click="logout">退出登录</u-button>
</template>
<script lang="ts" setup>
import { ref } from 'vue';
import { useGlobalStore } from '@/store/useStore';
const golbalStore = useGlobalStore()
const logout = () => {
uni.reLaunch({
url: '/pages/login/index', success() {
golbalStore.setToken('')
}
})
}
</script>
<style lang="scss" scoped>
</style>
差异被折叠。
{
"id": "3968711",
"name": "wms",
"font_family": "iconfont",
"css_prefix_text": "icon-",
"description": "",
"glyphs": [
{
"icon_id": "2325947",
"name": "移入文件夹",
"font_class": "yiruwenjianjia",
"unicode": "e648",
"unicode_decimal": 58952
},
{
"icon_id": "2325948",
"name": "移出文件夹",
"font_class": "yichuwenjianjia",
"unicode": "e647",
"unicode_decimal": 58951
},
{
"icon_id": "3247660",
"name": "其他出库",
"font_class": "qitachuku",
"unicode": "e613",
"unicode_decimal": 58899
},
{
"icon_id": "3247663",
"name": "其他入库",
"font_class": "qitaruku",
"unicode": "e614",
"unicode_decimal": 58900
},
{
"icon_id": "3703010",
"name": "库存盘点单",
"font_class": "navicon-kcpdd",
"unicode": "e65f",
"unicode_decimal": 58975
},
{
"icon_id": "4178310",
"name": "打印",
"font_class": "dayin",
"unicode": "e609",
"unicode_decimal": 58889
},
{
"icon_id": "4464995",
"name": "出库",
"font_class": "chuku",
"unicode": "e601",
"unicode_decimal": 58881
},
{
"icon_id": "4465007",
"name": "入库",
"font_class": "ruku",
"unicode": "e606",
"unicode_decimal": 58886
},
{
"icon_id": "5044396",
"name": "打印机",
"font_class": "dayinji",
"unicode": "e618",
"unicode_decimal": 58904
},
{
"icon_id": "6941969",
"name": "库存盘点",
"font_class": "kucunpandian-",
"unicode": "e646",
"unicode_decimal": 58950
},
{
"icon_id": "7404458",
"name": "打勾",
"font_class": "dagou",
"unicode": "e782",
"unicode_decimal": 59266
},
{
"icon_id": "11019850",
"name": "出库",
"font_class": "chuku1",
"unicode": "e60a",
"unicode_decimal": 58890
},
{
"icon_id": "11239051",
"name": "退货",
"font_class": "tuihuo",
"unicode": "e649",
"unicode_decimal": 58953
},
{
"icon_id": "11957186",
"name": "星途学堂-打印/打印机",
"font_class": "xingtuxuetang-dayin-",
"unicode": "e605",
"unicode_decimal": 58885
},
{
"icon_id": "12538472",
"name": "打印",
"font_class": "dayin1",
"unicode": "e718",
"unicode_decimal": 59160
},
{
"icon_id": "17121524",
"name": "原材料退料上架",
"font_class": "yuancailiaotuiliaoshangjia",
"unicode": "e600",
"unicode_decimal": 58880
},
{
"icon_id": "17620090",
"name": "销售出库",
"font_class": "tubiaozhizuomoban-01",
"unicode": "e636",
"unicode_decimal": 58934
},
{
"icon_id": "20154005",
"name": "自助打印",
"font_class": "zizhudayindayin",
"unicode": "e607",
"unicode_decimal": 58887
},
{
"icon_id": "20389229",
"name": "生产退料",
"font_class": "shengchantuiliaobeifen2x",
"unicode": "e604",
"unicode_decimal": 58884
},
{
"icon_id": "20671376",
"name": "菜单栏-生产-生产入库",
"font_class": "caidanlan-shengchan-shengchanruku",
"unicode": "e661",
"unicode_decimal": 58977
},
{
"icon_id": "23291105",
"name": "退料记录",
"font_class": "tuiliaojilu",
"unicode": "e651",
"unicode_decimal": 58961
},
{
"icon_id": "23291883",
"name": "生产领料",
"font_class": "shengchanlingliao",
"unicode": "e657",
"unicode_decimal": 58967
},
{
"icon_id": "24272078",
"name": "检验单",
"font_class": "jianyandan",
"unicode": "e68b",
"unicode_decimal": 59019
},
{
"icon_id": "24732473",
"name": "打印",
"font_class": "dayin2",
"unicode": "eca6",
"unicode_decimal": 60582
},
{
"icon_id": "33177972",
"name": "订料入库",
"font_class": "dingliaoruku",
"unicode": "e6f9",
"unicode_decimal": 59129
},
{
"icon_id": "33178017",
"name": "采购入库",
"font_class": "caigouruku",
"unicode": "e6fa",
"unicode_decimal": 59130
},
{
"icon_id": "34263593",
"name": "条码查询",
"font_class": "tiaomachaxun",
"unicode": "e617",
"unicode_decimal": 58903
}
]
}
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1678935189442" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="915" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M289.07 733.58c4.7 23.41 13.49 46.42 26.65 67.99 60.36 98.95 189.5 130.23 288.44 69.88 93.63-57.11 126.62-175.8 78.76-272.24 13.15-4.98 26.08-11.27 38.6-18.9 100.21-61.12 135.93-185.28 79.8-277.3-56.13-92.03-182.87-117.08-283.08-55.96-22.64 13.81-41.95 30.85-57.69 50-68.8-23.25-155.14-13.45-231.44 33.09C106.84 404.71 56.65 545.39 117 644.34c35.12 57.57 99.93 88.27 172.07 89.24z" fill="#EDE4F9" p-id="916"></path><path d="M551.6 872.76h-93.95c-29.07 0-52.64-23.57-52.64-52.65v-61.64h199.23v61.64c-0.01 29.08-23.57 52.65-52.64 52.65" fill="#9EA5FF" p-id="917"></path><path d="M660.29 215.01c3.27-50.46-36.8-93.19-87.37-93.19H436.33c-50.57 0-90.63 42.73-87.36 93.19l31.53 487.43h248.25l31.54-487.43z" fill="#5151D6" p-id="918"></path><path d="M380.5 702.45l3.63 56.05h241l3.63-56.05z" fill="" p-id="919"></path></svg>
\ No newline at end of file
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1678935936796" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="909" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M641.01 952.98c9.49 9.49 60.92 59.02 142.5 59.02 51.57 0 103.15-19.67 142.5-59.02l71.25-71.25c19.67-19.67 19.67-51.57 0-71.25l-142.5-142.5c-19.67-19.67-51.57-19.67-71.25 0l-74.25 74.25c-18.02 18.02-47.23 18.02-65.25 0L461.79 560.01c-60.01-60-120.02-120.01-180.02-180.02-2.17-2.17-13.51-13.95-13.51-32.62 0-11.81 4.5-23.61 13.51-32.62l74.25-74.25c19.67-19.67 19.67-51.57 0-71.25l-142.5-142.5c-19.67-19.67-51.57-19.67-71.25 0L71.02 98c-78.7 78.7-78.7 206.29 0 284.99" fill="" p-id="910"></path></svg>
\ No newline at end of file
import { PersistedStateOptions } from 'pinia-plugin-persistedstate'
const piniaPersistOption = (key: string, paths?: any[]) => {
const persist: PersistedStateOptions = {
key,
storage: localStorage,
paths
}
return persist
}
export default piniaPersistOption
\ No newline at end of file
import { defineStore } from "pinia";
import { getMetadataList } from '@/api/apply'
export const useFormData = defineStore({
id: 'formData',
state: () => ({
metadataList: []
}),
getters: {
metaListGet: (state) => state.metadataList
},
actions: {
async getMetaList() {
const { data: res } = await getMetadataList()
this.metadataList = res.records
}
}
})
\ No newline at end of file
import { defineStore, createPinia } from 'pinia'
import piniaPluginPersistedstate from 'pinia-plugin-persistedstate'
import piniaPersistOption from './config/piniaPersist'
export const useGlobalStore = defineStore({
id: 'globalStore',
state() {
return {
token: '',
}
},
getters: {
},
actions: {
setToken(token: string) {
this.token = token
},
},
persist: piniaPersistOption('globalStore')
})
const pinia = createPinia()
pinia.use(piniaPluginPersistedstate)
export default pinia
/**
* 根据system提取对应的formID
*/
\ No newline at end of file
declare module 'vk-uview-ui'
\ No newline at end of file
@import '../node_modules/@dcloudio/uni-ui/lib/uni-scss/variables.scss';
@import "vk-uview-ui/theme.scss";
/**
* 这里是uni-app内置的常用样式变量
*
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
*
*/
/**
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
*
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
*/
/* 颜色变量 */
/* 行为相关颜色 */
$uni-color-primary: #007aff;
$uni-color-success: #4cd964;
$uni-color-warning: #f0ad4e;
$uni-color-error: #dd524d;
/* 文字基本颜色 */
$uni-text-color:#333;//基本色
$uni-text-color-inverse:#fff;//反色
$uni-text-color-grey:#999;//辅助灰色,如加载更多的提示信息
$uni-text-color-placeholder: #808080;
$uni-text-color-disable:#c0c0c0;
/* 背景颜色 */
$uni-bg-color:#ffffff;
$uni-bg-color-grey:#f8f8f8;
$uni-bg-color-hover:#f1f1f1;//点击状态颜色
$uni-bg-color-mask:rgba(0, 0, 0, 0.4);//遮罩颜色
/* 边框颜色 */
$uni-border-color:#c8c7cc;
/* 尺寸变量 */
/* 文字尺寸 */
$uni-font-size-sm:24rpx;
$uni-font-size-base:28rpx;
$uni-font-size-lg:32rpx;
/* 图片尺寸 */
$uni-img-size-sm:40rpx;
$uni-img-size-base:52rpx;
$uni-img-size-lg:80rpx;
/* Border Radius */
$uni-border-radius-sm: 4rpx;
$uni-border-radius-base: 6rpx;
$uni-border-radius-lg: 12rpx;
$uni-border-radius-circle: 50%;
/* 水平间距 */
$uni-spacing-row-sm: 10px;
$uni-spacing-row-base: 20rpx;
$uni-spacing-row-lg: 30rpx;
/* 垂直间距 */
$uni-spacing-col-sm: 8rpx;
$uni-spacing-col-base: 16rpx;
$uni-spacing-col-lg: 24rpx;
/* 透明度 */
$uni-opacity-disabled: 0.3; // 组件禁用态的透明度
/* 文章场景相关 */
$uni-color-title: #2C405A; // 文章标题颜色
$uni-font-size-title:40rpx;
$uni-color-subtitle: #555555; // 二级标题颜色
$uni-font-size-subtitle:36rpx;
$uni-color-paragraph: #3F536E; // 文章段落颜色
$uni-font-size-paragraph:30rpx;
## 1.0.3(2022-01-21)
- 优化 组件示例
## 1.0.2(2021-11-22)
- 修复 / 符号在 vue 不同版本兼容问题引起的报错问题
## 1.0.1(2021-11-22)
- 修复 vue3中scss语法兼容问题
## 1.0.0(2021-11-18)
- init
@import './styles/index.scss';
{
"id": "uni-scss",
"displayName": "uni-scss 辅助样式",
"version": "1.0.3",
"description": "uni-sass是uni-ui提供的一套全局样式 ,通过一些简单的类名和sass变量,实现简单的页面布局操作,比如颜色、边距、圆角等。",
"keywords": [
"uni-scss",
"uni-ui",
"辅助样式"
],
"repository": "https://github.com/dcloudio/uni-ui",
"engines": {
"HBuilderX": "^3.1.0"
},
"dcloudext": {
"category": [
"JS SDK",
"通用 SDK"
],
"sale": {
"regular": {
"price": "0.00"
},
"sourcecode": {
"price": "0.00"
}
},
"contact": {
"qq": ""
},
"declaration": {
"ads": "无",
"data": "无",
"permissions": "无"
},
"npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui"
},
"uni_modules": {
"dependencies": [],
"encrypt": [],
"platforms": {
"cloud": {
"tcb": "y",
"aliyun": "y"
},
"client": {
"App": {
"app-vue": "y",
"app-nvue": "u"
},
"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"
},
"快应用": {
"华为": "n",
"联盟": "n"
},
"Vue": {
"vue2": "y",
"vue3": "y"
}
}
}
}
}
`uni-sass``uni-ui`提供的一套全局样式 ,通过一些简单的类名和`sass`变量,实现简单的页面布局操作,比如颜色、边距、圆角等。
### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-sass)
#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839
\ No newline at end of file
@import './setting/_variables.scss';
@import './setting/_border.scss';
@import './setting/_color.scss';
@import './setting/_space.scss';
@import './setting/_radius.scss';
@import './setting/_text.scss';
@import './setting/_styles.scss';
.uni-border {
border: 1px $uni-border-1 solid;
}
\ No newline at end of file
// TODO 暂时不需要 class ,需要用户使用变量实现 ,如果使用类名其实并不推荐
// @mixin get-styles($k,$c) {
// @if $k == size or $k == weight{
// font-#{$k}:#{$c}
// }@else{
// #{$k}:#{$c}
// }
// }
$uni-ui-color:(
// 主色
primary: $uni-primary,
primary-disable: $uni-primary-disable,
primary-light: $uni-primary-light,
// 辅助色
success: $uni-success,
success-disable: $uni-success-disable,
success-light: $uni-success-light,
warning: $uni-warning,
warning-disable: $uni-warning-disable,
warning-light: $uni-warning-light,
error: $uni-error,
error-disable: $uni-error-disable,
error-light: $uni-error-light,
info: $uni-info,
info-disable: $uni-info-disable,
info-light: $uni-info-light,
// 中性色
main-color: $uni-main-color,
base-color: $uni-base-color,
secondary-color: $uni-secondary-color,
extra-color: $uni-extra-color,
// 背景色
bg-color: $uni-bg-color,
// 边框颜色
border-1: $uni-border-1,
border-2: $uni-border-2,
border-3: $uni-border-3,
border-4: $uni-border-4,
// 黑色
black:$uni-black,
// 白色
white:$uni-white,
// 透明
transparent:$uni-transparent
) !default;
@each $key, $child in $uni-ui-color {
.uni-#{"" + $key} {
color: $child;
}
.uni-#{"" + $key}-bg {
background-color: $child;
}
}
.uni-shadow-sm {
box-shadow: $uni-shadow-sm;
}
.uni-shadow-base {
box-shadow: $uni-shadow-base;
}
.uni-shadow-lg {
box-shadow: $uni-shadow-lg;
}
.uni-mask {
background-color:$uni-mask;
}
@mixin radius($r,$d:null ,$important: false){
$radius-value:map-get($uni-radius, $r) if($important, !important, null);
// Key exists within the $uni-radius variable
@if (map-has-key($uni-radius, $r) and $d){
@if $d == t {
border-top-left-radius:$radius-value;
border-top-right-radius:$radius-value;
}@else if $d == r {
border-top-right-radius:$radius-value;
border-bottom-right-radius:$radius-value;
}@else if $d == b {
border-bottom-left-radius:$radius-value;
border-bottom-right-radius:$radius-value;
}@else if $d == l {
border-top-left-radius:$radius-value;
border-bottom-left-radius:$radius-value;
}@else if $d == tl {
border-top-left-radius:$radius-value;
}@else if $d == tr {
border-top-right-radius:$radius-value;
}@else if $d == br {
border-bottom-right-radius:$radius-value;
}@else if $d == bl {
border-bottom-left-radius:$radius-value;
}
}@else{
border-radius:$radius-value;
}
}
@each $key, $child in $uni-radius {
@if($key){
.uni-radius-#{"" + $key} {
@include radius($key)
}
}@else{
.uni-radius {
@include radius($key)
}
}
}
@each $direction in t, r, b, l,tl, tr, br, bl {
@each $key, $child in $uni-radius {
@if($key){
.uni-radius-#{"" + $direction}-#{"" + $key} {
@include radius($key,$direction,false)
}
}@else{
.uni-radius-#{$direction} {
@include radius($key,$direction,false)
}
}
}
}
@mixin fn($space,$direction,$size,$n) {
@if $n {
#{$space}-#{$direction}: #{$size*$uni-space-root}px
} @else {
#{$space}-#{$direction}: #{-$size*$uni-space-root}px
}
}
@mixin get-styles($direction,$i,$space,$n){
@if $direction == t {
@include fn($space, top,$i,$n);
}
@if $direction == r {
@include fn($space, right,$i,$n);
}
@if $direction == b {
@include fn($space, bottom,$i,$n);
}
@if $direction == l {
@include fn($space, left,$i,$n);
}
@if $direction == x {
@include fn($space, left,$i,$n);
@include fn($space, right,$i,$n);
}
@if $direction == y {
@include fn($space, top,$i,$n);
@include fn($space, bottom,$i,$n);
}
@if $direction == a {
@if $n {
#{$space}:#{$i*$uni-space-root}px;
} @else {
#{$space}:#{-$i*$uni-space-root}px;
}
}
}
@each $orientation in m,p {
$space: margin;
@if $orientation == m {
$space: margin;
} @else {
$space: padding;
}
@for $i from 0 through 16 {
@each $direction in t, r, b, l, x, y, a {
.uni-#{$orientation}#{$direction}-#{$i} {
@include get-styles($direction,$i,$space,true);
}
.uni-#{$orientation}#{$direction}-n#{$i} {
@include get-styles($direction,$i,$space,false);
}
}
}
}
\ No newline at end of file
/* #ifndef APP-NVUE */
$-color-white:#fff;
$-color-black:#000;
@mixin base-style($color) {
color: #fff;
background-color: $color;
border-color: mix($-color-black, $color, 8%);
&:not([hover-class]):active {
background: mix($-color-black, $color, 10%);
border-color: mix($-color-black, $color, 20%);
color: $-color-white;
outline: none;
}
}
@mixin is-color($color) {
@include base-style($color);
&[loading] {
@include base-style($color);
&::before {
margin-right:5px;
}
}
&[disabled] {
&,
&[loading],
&:not([hover-class]):active {
color: $-color-white;
border-color: mix(darken($color,10%), $-color-white);
background-color: mix($color, $-color-white);
}
}
}
@mixin base-plain-style($color) {
color:$color;
background-color: mix($-color-white, $color, 90%);
border-color: mix($-color-white, $color, 70%);
&:not([hover-class]):active {
background: mix($-color-white, $color, 80%);
color: $color;
outline: none;
border-color: mix($-color-white, $color, 50%);
}
}
@mixin is-plain($color){
&[plain] {
@include base-plain-style($color);
&[loading] {
@include base-plain-style($color);
&::before {
margin-right:5px;
}
}
&[disabled] {
&,
&:active {
color: mix($-color-white, $color, 40%);
background-color: mix($-color-white, $color, 90%);
border-color: mix($-color-white, $color, 80%);
}
}
}
}
.uni-btn {
margin: 5px;
color: #393939;
border:1px solid #ccc;
font-size: 16px;
font-weight: 200;
background-color: #F9F9F9;
// TODO 暂时处理边框隐藏一边的问题
overflow: visible;
&::after{
border: none;
}
&:not([type]),&[type=default] {
color: #999;
&[loading] {
background: none;
&::before {
margin-right:5px;
}
}
&[disabled]{
color: mix($-color-white, #999, 60%);
&,
&[loading],
&:active {
color: mix($-color-white, #999, 60%);
background-color: mix($-color-white,$-color-black , 98%);
border-color: mix($-color-white, #999, 85%);
}
}
&[plain] {
color: #999;
background: none;
border-color: $uni-border-1;
&:not([hover-class]):active {
background: none;
color: mix($-color-white, $-color-black, 80%);
border-color: mix($-color-white, $-color-black, 90%);
outline: none;
}
&[disabled]{
&,
&[loading],
&:active {
background: none;
color: mix($-color-white, #999, 60%);
border-color: mix($-color-white, #999, 85%);
}
}
}
}
&:not([hover-class]):active {
color: mix($-color-white, $-color-black, 50%);
}
&[size=mini] {
font-size: 16px;
font-weight: 200;
border-radius: 8px;
}
&.uni-btn-small {
font-size: 14px;
}
&.uni-btn-mini {
font-size: 12px;
}
&.uni-btn-radius {
border-radius: 999px;
}
&[type=primary] {
@include is-color($uni-primary);
@include is-plain($uni-primary)
}
&[type=success] {
@include is-color($uni-success);
@include is-plain($uni-success)
}
&[type=error] {
@include is-color($uni-error);
@include is-plain($uni-error)
}
&[type=warning] {
@include is-color($uni-warning);
@include is-plain($uni-warning)
}
&[type=info] {
@include is-color($uni-info);
@include is-plain($uni-info)
}
}
/* #endif */
@mixin get-styles($k,$c) {
@if $k == size or $k == weight{
font-#{$k}:#{$c}
}@else{
#{$k}:#{$c}
}
}
@each $key, $child in $uni-headings {
/* #ifndef APP-NVUE */
.uni-#{$key} {
@each $k, $c in $child {
@include get-styles($k,$c)
}
}
/* #endif */
/* #ifdef APP-NVUE */
.container .uni-#{$key} {
@each $k, $c in $child {
@include get-styles($k,$c)
}
}
/* #endif */
}
// @use "sass:math";
@import '../tools/functions.scss';
// 间距基础倍数
$uni-space-root: 2 !default;
// 边框半径默认值
$uni-radius-root:5px !default;
$uni-radius: () !default;
// 边框半径断点
$uni-radius: map-deep-merge(
(
0: 0,
// TODO 当前版本暂时不支持 sm 属性
// 'sm': math.div($uni-radius-root, 2),
null: $uni-radius-root,
'lg': $uni-radius-root * 2,
'xl': $uni-radius-root * 6,
'pill': 9999px,
'circle': 50%
),
$uni-radius
);
// 字体家族
$body-font-family: 'Roboto', sans-serif !default;
// 文本
$heading-font-family: $body-font-family !default;
$uni-headings: () !default;
$letterSpacing: -0.01562em;
$uni-headings: map-deep-merge(
(
'h1': (
size: 32px,
weight: 300,
line-height: 50px,
// letter-spacing:-0.01562em
),
'h2': (
size: 28px,
weight: 300,
line-height: 40px,
// letter-spacing: -0.00833em
),
'h3': (
size: 24px,
weight: 400,
line-height: 32px,
// letter-spacing: normal
),
'h4': (
size: 20px,
weight: 400,
line-height: 30px,
// letter-spacing: 0.00735em
),
'h5': (
size: 16px,
weight: 400,
line-height: 24px,
// letter-spacing: normal
),
'h6': (
size: 14px,
weight: 500,
line-height: 18px,
// letter-spacing: 0.0125em
),
'subtitle': (
size: 12px,
weight: 400,
line-height: 20px,
// letter-spacing: 0.00937em
),
'body': (
font-size: 14px,
font-weight: 400,
line-height: 22px,
// letter-spacing: 0.03125em
),
'caption': (
'size': 12px,
'weight': 400,
'line-height': 20px,
// 'letter-spacing': 0.03333em,
// 'text-transform': false
)
),
$uni-headings
);
// 主色
$uni-primary: #2979ff !default;
$uni-primary-disable:lighten($uni-primary,20%) !default;
$uni-primary-light: lighten($uni-primary,25%) !default;
// 辅助色
// 除了主色外的场景色,需要在不同的场景中使用(例如危险色表示危险的操作)。
$uni-success: #18bc37 !default;
$uni-success-disable:lighten($uni-success,20%) !default;
$uni-success-light: lighten($uni-success,25%) !default;
$uni-warning: #f3a73f !default;
$uni-warning-disable:lighten($uni-warning,20%) !default;
$uni-warning-light: lighten($uni-warning,25%) !default;
$uni-error: #e43d33 !default;
$uni-error-disable:lighten($uni-error,20%) !default;
$uni-error-light: lighten($uni-error,25%) !default;
$uni-info: #8f939c !default;
$uni-info-disable:lighten($uni-info,20%) !default;
$uni-info-light: lighten($uni-info,25%) !default;
// 中性色
// 中性色用于文本、背景和边框颜色。通过运用不同的中性色,来表现层次结构。
$uni-main-color: #3a3a3a !default; // 主要文字
$uni-base-color: #6a6a6a !default; // 常规文字
$uni-secondary-color: #909399 !default; // 次要文字
$uni-extra-color: #c7c7c7 !default; // 辅助说明
// 边框颜色
$uni-border-1: #F0F0F0 !default;
$uni-border-2: #EDEDED !default;
$uni-border-3: #DCDCDC !default;
$uni-border-4: #B9B9B9 !default;
// 常规色
$uni-black: #000000 !default;
$uni-white: #ffffff !default;
$uni-transparent: rgba($color: #000000, $alpha: 0) !default;
// 背景色
$uni-bg-color: #f7f7f7 !default;
/* 水平间距 */
$uni-spacing-sm: 8px !default;
$uni-spacing-base: 15px !default;
$uni-spacing-lg: 30px !default;
// 阴影
$uni-shadow-sm:0 0 5px rgba($color: #d8d8d8, $alpha: 0.5) !default;
$uni-shadow-base:0 1px 8px 1px rgba($color: #a5a5a5, $alpha: 0.2) !default;
$uni-shadow-lg:0px 1px 10px 2px rgba($color: #a5a4a4, $alpha: 0.5) !default;
// 蒙版
$uni-mask: rgba($color: #000000, $alpha: 0.4) !default;
// 合并 map
@function map-deep-merge($parent-map, $child-map){
$result: $parent-map;
@each $key, $child in $child-map {
$parent-has-key: map-has-key($result, $key);
$parent-value: map-get($result, $key);
$parent-type: type-of($parent-value);
$child-type: type-of($child);
$parent-is-map: $parent-type == map;
$child-is-map: $child-type == map;
@if (not $parent-has-key) or ($parent-type != $child-type) or (not ($parent-is-map and $child-is-map)){
$result: map-merge($result, ( $key: $child ));
}@else {
$result: map-merge($result, ( $key: map-deep-merge($parent-value, $child) ));
}
}
@return $result;
};
// 间距基础倍数
$uni-space-root: 2;
// 边框半径默认值
$uni-radius-root:5px;
// 主色
$uni-primary: #2979ff;
// 辅助色
$uni-success: #4cd964;
// 警告色
$uni-warning: #f0ad4e;
// 错误色
$uni-error: #dd524d;
// 描述色
$uni-info: #909399;
// 中性色
$uni-main-color: #303133;
$uni-base-color: #606266;
$uni-secondary-color: #909399;
$uni-extra-color: #C0C4CC;
// 背景色
$uni-bg-color: #f5f5f5;
// 边框颜色
$uni-border-1: #DCDFE6;
$uni-border-2: #E4E7ED;
$uni-border-3: #EBEEF5;
$uni-border-4: #F2F6FC;
// 常规色
$uni-black: #000000;
$uni-white: #ffffff;
$uni-transparent: rgba($color: #000000, $alpha: 0);
@import './styles/setting/_variables.scss';
// 间距基础倍数
$uni-space-root: 2;
// 边框半径默认值
$uni-radius-root:5px;
// 主色
$uni-primary: #2979ff;
$uni-primary-disable:mix(#fff,$uni-primary,50%);
$uni-primary-light: mix(#fff,$uni-primary,80%);
// 辅助色
// 除了主色外的场景色,需要在不同的场景中使用(例如危险色表示危险的操作)。
$uni-success: #18bc37;
$uni-success-disable:mix(#fff,$uni-success,50%);
$uni-success-light: mix(#fff,$uni-success,80%);
$uni-warning: #f3a73f;
$uni-warning-disable:mix(#fff,$uni-warning,50%);
$uni-warning-light: mix(#fff,$uni-warning,80%);
$uni-error: #e43d33;
$uni-error-disable:mix(#fff,$uni-error,50%);
$uni-error-light: mix(#fff,$uni-error,80%);
$uni-info: #8f939c;
$uni-info-disable:mix(#fff,$uni-info,50%);
$uni-info-light: mix(#fff,$uni-info,80%);
// 中性色
// 中性色用于文本、背景和边框颜色。通过运用不同的中性色,来表现层次结构。
$uni-main-color: #3a3a3a; // 主要文字
$uni-base-color: #6a6a6a; // 常规文字
$uni-secondary-color: #909399; // 次要文字
$uni-extra-color: #c7c7c7; // 辅助说明
// 边框颜色
$uni-border-1: #F0F0F0;
$uni-border-2: #EDEDED;
$uni-border-3: #DCDCDC;
$uni-border-4: #B9B9B9;
// 常规色
$uni-black: #000000;
$uni-white: #ffffff;
$uni-transparent: rgba($color: #000000, $alpha: 0);
// 背景色
$uni-bg-color: #f7f7f7;
/* 水平间距 */
$uni-spacing-sm: 8px;
$uni-spacing-base: 15px;
$uni-spacing-lg: 30px;
// 阴影
$uni-shadow-sm:0 0 5px rgba($color: #d8d8d8, $alpha: 0.5);
$uni-shadow-base:0 1px 8px 1px rgba($color: #a5a5a5, $alpha: 0.2);
$uni-shadow-lg:0px 1px 10px 2px rgba($color: #a5a4a4, $alpha: 0.5);
// 蒙版
$uni-mask: rgba($color: #000000, $alpha: 0.4);
export const TokenKey: string = 'X-Litemall-Admin-Token';
// 获取指定缓存
export const getCache = (key: string) => {
uni.getStorage({
key: key,
success: (res: any) => {
return res.data;
}
});
};
// 获取缓存信息
export const getAllCache = () => {
uni.getStorageInfo({
success: (res: any) => {
return res;
}
});
};
// 修改指定缓存
export const setCache = (key: string, data: any) => {
uni.setStorage({
key: key,
data
});
};
// 移除制定缓存
export const renoveCache = (key: any) => {
uni.removeStorage({
key
});
};
// 清除本地缓存
export const clearCache = () => {
uni.clearStorage();
};
\ No newline at end of file
const CONFIG: any = {
// 开发环境配置
development: {
assetsPath: 'http://192.168.60:81', // 静态资源路径
baseUrl: 'http://192.168.0.38:8089', // 后台接口请求地址
// baseUrl: 'http://192.168.0.60:81', // 后台接口请求地址
hostUrl: 'http://192.168.0.60:81', // H5地址(前端运行地址)
websocketUrl: '', // websocket服务端地址
},
// 生产环境配置
production: {
assetsPath: '', // 静态资源路径
baseUrl: 'http://192.168.0.38:8089', // 后台接口请求地址
// baseUrl: 'https://api.test.siccat.com/api/graphql',
hostUrl: '', // H5地址(前端运行地址)
websocketUrl: '', // websocket服务端地址
},
}
export default CONFIG[process.env.NODE_ENV]
//判断两个对象是否相同(包含绝对相等和他们是否有相同的形状)
function looseEqual(a: any, b: any): any {
if (a === b) {
//如果是绝对相等就直接返回true
return true
}
//如果不是绝对相等就哦按的他们是否有相同的形状
var isObjectA = isObject(a)
var isObjectB = isObject(b)
if (isObjectA && isObjectB) {
//两个均是对象
try {
var isArrayA = Array.isArray(a)
var isArrayB = Array.isArray(b)
if (isArrayA && isArrayB) {
//如果都是数组
if (a.length === b.length) {
//如果长度相等
return a.every(function (e: any, i: any) {
//用every和递归来比对a数组和b数组的每个元素,并返回
return looseEqual(e, b[i])
})
}
//长度都不等直接返回false
return false
} else if (a instanceof Date && b instanceof Date) {
//如果是Date 则直接getTime 比较
return a.getTime() === b.getTime()
} else if (!isArrayA && !isArrayB) {
//对象的比较
//拿到两个对象的key
var keysA = Object.keys(a)
var keysB = Object.keys(b)
if (keysA.length === keysB.length) {
//如果keys相等
return keysA.every(function (key: any) {
//用every和递归来比对a对象和b对象的每个元素值,并返回
return looseEqual(a[key], b[key])
})
}
//长度都不等直接返回false
return false
} else {
return false
}
} catch (e) {
return false
}
} else if (!isObjectA && !isObjectB) {
//如果都不是对象则按String来处理
return String(a) === String(b)
} else {
return false
}
}
function isObject(obj: any) {
return obj !== null && typeof obj === 'object'
}
export { looseEqual }
import config from './config';
import { useGlobalStore } from '@/store/useStore';
const baseUrl = config.baseUrl;
// 封装公共申请办法
function request(
url: string,
method: 'GET' | 'POST' | 'PUT' | 'DELETE',
data?: object | any,
responseType?: string
) {
return new Promise<any>(function (resolve, reject) {
let header: any;
const globalStore = useGlobalStore();
uni.showLoading({
title: '加载中...',
});
if (globalStore.token) {
header = {
'content-type': 'application/json',
Authorization: globalStore.token,
};
}
// #ifdef APP-PLUS
url = baseUrl + url; // 在app上不需要跨域
// #endif
uni.request({
url,
method,
data,
header,
responseType,
success(res: any) {
uni.hideLoading();
// 判断是否存在token
if (res.data.code == 200) {
const pages = getCurrentPages();
let currentRoute = pages[pages.length - 1].route;
if (!globalStore.token && currentRoute !== 'pages/login/index')
return uni.reLaunch({ url: '/pages/login/index' });
resolve(res);
} else if (res.data.code == 500 || res.data.code === 401) {
uni.showToast({
title: res.data.msg,
icon: 'none',
});
reject(res);
} else if (res.data.code == 501 || res.data.code == 911) {
uni.reLaunch({
url: '/pages/login/index',
success() {
globalStore.setToken('');
uni.showToast({
title: '请登录',
icon: 'none',
});
},
});
} else {
console.log(res, '非200错误');
//其余异样
reject(res);
}
},
fail(err: any) {
uni.hideLoading();
//申请失败
uni.showToast({
title: '连接服务器失败',
icon: 'none',
});
reject(err);
},
});
});
}
export default request;
let main: any;
let filter: any;
let receiver: any;
let tag = false;
/**
* 开始广播监听扫码
*/
const start = () => {
/* #ifdef APP-PLUS */
main.registerReceiver(receiver, filter);
/* #endif */
}
/**
* 停止广播监听扫码
* that:传this;
*/
const stop = () => {
/* #ifdef APP-PLUS */
main.unregisterReceiver(receiver);
/* #endif */
}
/** 剩余下个变量已经做了全局变量
*
* 定义广播
* that:传this;
*/
const init = (onReceive: any) => {
/* #ifdef APP-PLUS */
//获取activity
main = plus.android.runtimeMainActivity();
const IntentFilter: any = plus.android.importClass('android.content.IntentFilter');
filter = new IntentFilter();
// 扫描设置的广播名称A(上面指代了)
filter.addAction("android.intent.ACTION_DECODE_DATA");
receiver = plus.android.implements('io.dcloud.feature.internal.reflect.BroadcastReceiver', {
onReceive: function (context: any, intent: any) {
plus.android.importClass(intent);
// 扫描设置的标签名称B(上面指代了)
const code = intent.getStringExtra("barcode_string");
if (tag) return;
tag = true;
setTimeout(function () {
tag = false;
}, 150);
//到这里扫描成功了,可以调用自己的业务逻辑,code就是扫描的结果 return出code进行业务处理
onReceive && onReceive(code);
}
});
/* #endif */
}
export const broadcastScan = {
init,
start,
stop,
};
function zconfirm(msg: string, callBackFun?: any) {
uni.showModal({
content: msg,
success: function (res) {
if (res.confirm) {
callBackFun(true)
} else if (res.cancel) {
callBackFun(false)
}
},
})
}
function zalert(msg: string, callBackFun?: any) {
uni.showModal({
title: '提示',
content: msg,
showCancel: false,
success: function () {
if (callBackFun) {
callBackFun()
}
},
})
}
function toast(msg: string) {
uni.showToast({
title: msg,
duration: 2000,
mask: false,
icon: 'none',
})
}
const deepClone = function (origin: any, target: object = {}) {
for (const prop in target) {
if (target[prop] !== null && typeof target[prop] === 'object') {
origin[prop] = Object.prototype.toString.call(target[prop]) === '[object Array]' ? [] : {}
deepClone(origin[prop], target[prop])
} else {
origin[prop] = target[prop]
}
}
}
export default {
zconfirm,
zalert,
toast,
deepClone
}
{
"compilerOptions": {
"target": "esnext",
"useDefineForClassFields": true,
"module": "esnext",
"moduleResolution": "node",
"strict": true,
"jsx": "preserve",
"sourceMap": true,
"resolveJsonModule": true,
"esModuleInterop": true,
"lib": ["esnext", "dom"],
"types": ["@dcloudio/types"],
"baseUrl": ".",
"paths": {
"@/*": ["src/*"]
}
},
"include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue"]
}
import { defineConfig } from 'vite'
// import pxtovw from 'postcss-px-to-viewport'
import { resolve } from 'path'
import { createSvgIconsPlugin } from 'vite-plugin-svg-icons'
import uni from '@dcloudio/vite-plugin-uni'
export default defineConfig({
plugins: [
uni(),
createSvgIconsPlugin({
iconDirs: [resolve(process.cwd(), 'src/static/svg')],
symbolId: 'icon-[dir]-[name]',
}),
],
resolve: {
alias: {
'@': resolve(__dirname, './src'),
},
},
css: {
preprocessorOptions: {
scss: {
additionalData: `@import "@/uni.scss";`,
},
},
postcss: {
// plugins: [loder_pxtovw]
},
},
assetsInclude: '@dcloudio/uni-ui',
build: {
minify: 'terser',
terserOptions: {
compress: {
drop_console: true, // 生产环境移除console
drop_debugger: true, // 生产环境移除debugger
},
},
},
server: {
host: '0.0.0.0',
port: 7878,
open: true,
strictPort: false, // 端口被占用直接退出
https: false, // 默认用http方式
proxy: {
'/LowCodePlatform': {
target: 'http://192.168.0.38:8089',
},
},
},
})
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论