mirror of
https://gitee.com/krxd/shuyuan.git
synced 2026-04-08 05:15:54 +08:00
创建
This commit is contained in:
25
.env.development
Normal file
25
.env.development
Normal file
@@ -0,0 +1,25 @@
|
||||
NODE_ENV = 'development'
|
||||
|
||||
# api请求地址
|
||||
VITE_APP_BASE_URL='https://ttts.keruixinda.com/api/'
|
||||
|
||||
# 图片服务器地址
|
||||
VITE_IMG_DOMAIN='https://ttts.keruixinda.com'
|
||||
|
||||
# 站点id 仅在编译为小程序时生效
|
||||
VITE_SITE_ID = '100002'
|
||||
|
||||
# 本地存储时token的参数名
|
||||
VITE_REQUEST_STORAGE_TOKEN_KEY='wapToken'
|
||||
|
||||
# 请求时header中token的参数名
|
||||
VITE_REQUEST_HEADER_TOKEN_KEY='token'
|
||||
|
||||
# 请求时header中站点的参数名
|
||||
VITE_REQUEST_HEADER_SITEID_KEY='site-id'
|
||||
|
||||
# 请求时header中来源场景的参数名
|
||||
VITE_REQUEST_HEADER_CHANNEL_KEY='channel'
|
||||
|
||||
# 应用版本
|
||||
VITE_APP_VERSION='1.0.1'
|
||||
25
.env.production
Normal file
25
.env.production
Normal file
@@ -0,0 +1,25 @@
|
||||
NODE_ENV = 'production'
|
||||
|
||||
# api请求地址
|
||||
VITE_APP_BASE_URL=''
|
||||
|
||||
# 图片服务器地址
|
||||
VITE_IMG_DOMAIN=''
|
||||
|
||||
# 站点id 仅在编译为小程序时生效
|
||||
VITE_SITE_ID = ''
|
||||
|
||||
# 本地存储时token的参数名
|
||||
VITE_REQUEST_STORAGE_TOKEN_KEY='wapToken'
|
||||
|
||||
# 请求时header中token的参数名
|
||||
VITE_REQUEST_HEADER_TOKEN_KEY='token'
|
||||
|
||||
# 请求时header中站点的参数名
|
||||
VITE_REQUEST_HEADER_SITEID_KEY='site-id'
|
||||
|
||||
# 请求时header中来源场景的参数名
|
||||
VITE_REQUEST_HEADER_CHANNEL_KEY='channel'
|
||||
|
||||
# 应用版本
|
||||
VITE_APP_VERSION='1.0.1'
|
||||
22
.gitignore
vendored
Normal file
22
.gitignore
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
# Logs
|
||||
logs
|
||||
*.log
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
pnpm-debug.log*
|
||||
lerna-debug.log*
|
||||
|
||||
node_modules
|
||||
.DS_Store
|
||||
dist
|
||||
*.local
|
||||
|
||||
# Editor directories and files
|
||||
.idea
|
||||
*.suo
|
||||
*.ntvs*
|
||||
*.njsproj
|
||||
*.sln
|
||||
*.sw?
|
||||
dist.zip
|
||||
16
.hbuilderx/launch.json
Normal file
16
.hbuilderx/launch.json
Normal file
@@ -0,0 +1,16 @@
|
||||
{ // launch.json 配置了启动调试时相关设置,configurations下节点名称可为 app-plus/h5/mp-weixin/mp-baidu/mp-alipay/mp-qq/mp-toutiao/mp-360/
|
||||
// launchtype项可配置值为local或remote, local代表前端连本地云函数,remote代表前端连云端云函数
|
||||
"version": "0.0",
|
||||
"configurations": [{
|
||||
"default" :
|
||||
{
|
||||
"launchtype" : "local"
|
||||
},
|
||||
"mp-weixin" :
|
||||
{
|
||||
"launchtype" : "local"
|
||||
},
|
||||
"type" : "uniCloud"
|
||||
}
|
||||
]
|
||||
}
|
||||
20
index.html
Normal file
20
index.html
Normal file
@@ -0,0 +1,20 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-cn">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<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>
|
||||
<title></title>
|
||||
<!--preload-links-->
|
||||
<!--app-context-->
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"><!--app-html--></div>
|
||||
<script type="module" src="/src/main.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
21894
package-lock.json
generated
Normal file
21894
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
87
package.json
Normal file
87
package.json
Normal file
@@ -0,0 +1,87 @@
|
||||
{
|
||||
"name": "uni-preset-vue",
|
||||
"version": "0.0.0",
|
||||
"scripts": {
|
||||
"dev:app": "uni -p app",
|
||||
"dev:app-android": "uni -p app-android",
|
||||
"dev:app-ios": "uni -p app-ios",
|
||||
"dev:custom": "uni -p",
|
||||
"dev:h5": "uni",
|
||||
"dev:h5:ssr": "uni --ssr",
|
||||
"dev:mp-alipay": "uni -p mp-alipay",
|
||||
"dev:mp-baidu": "uni -p mp-baidu",
|
||||
"dev:mp-jd": "uni -p mp-jd",
|
||||
"dev:mp-kuaishou": "uni -p mp-kuaishou",
|
||||
"dev:mp-lark": "uni -p mp-lark",
|
||||
"dev:mp-qq": "uni -p mp-qq",
|
||||
"dev:mp-toutiao": "uni -p mp-toutiao",
|
||||
"dev:mp-weixin": "uni -p mp-weixin",
|
||||
"dev:quickapp-webview": "uni -p quickapp-webview",
|
||||
"dev:quickapp-webview-huawei": "uni -p quickapp-webview-huawei",
|
||||
"dev:quickapp-webview-union": "uni -p quickapp-webview-union",
|
||||
"build:app": "uni build -p app",
|
||||
"build:app-android": "uni build -p app-android",
|
||||
"build:app-ios": "uni build -p app-ios",
|
||||
"build:custom": "uni build -p",
|
||||
"build:h5": "uni build && node publish.cjs",
|
||||
"build:h5:ssr": "uni build --ssr",
|
||||
"build:mp-alipay": "uni build -p mp-alipay",
|
||||
"build:mp-baidu": "uni build -p mp-baidu",
|
||||
"build:mp-jd": "uni build -p mp-jd",
|
||||
"build:mp-kuaishou": "uni build -p mp-kuaishou",
|
||||
"build:mp-lark": "uni build -p mp-lark",
|
||||
"build:mp-qq": "uni build -p mp-qq",
|
||||
"build:mp-toutiao": "uni build -p mp-toutiao",
|
||||
"build:mp-weixin": "uni build -p mp-weixin",
|
||||
"build:quickapp-webview": "uni build -p quickapp-webview",
|
||||
"build:quickapp-webview-huawei": "uni build -p quickapp-webview-huawei",
|
||||
"build:quickapp-webview-union": "uni build -p quickapp-webview-union",
|
||||
"type-check": "vue-tsc --noEmit"
|
||||
},
|
||||
"dependencies": {
|
||||
"@dcloudio/uni-app": "3.0.0-3080720230703001",
|
||||
"@dcloudio/uni-app-plus": "3.0.0-3080720230703001",
|
||||
"@dcloudio/uni-components": "3.0.0-3080720230703001",
|
||||
"@dcloudio/uni-h5": "3.0.0-3080720230703001",
|
||||
"@dcloudio/uni-mp-alipay": "3.0.0-3080720230703001",
|
||||
"@dcloudio/uni-mp-baidu": "3.0.0-3080720230703001",
|
||||
"@dcloudio/uni-mp-jd": "3.0.0-3080720230703001",
|
||||
"@dcloudio/uni-mp-kuaishou": "3.0.0-3080720230703001",
|
||||
"@dcloudio/uni-mp-lark": "3.0.0-3080720230703001",
|
||||
"@dcloudio/uni-mp-qq": "3.0.0-3080720230703001",
|
||||
"@dcloudio/uni-mp-toutiao": "3.0.0-3080720230703001",
|
||||
"@dcloudio/uni-mp-weixin": "3.0.0-3080720230703001",
|
||||
"@dcloudio/uni-quickapp-webview": "3.0.0-3080720230703001",
|
||||
"html2canvas": "^1.4.1",
|
||||
"image-tools": "^1.4.0",
|
||||
"lodash-es": "^4.17.21",
|
||||
"pinia": "2.0.36",
|
||||
"qrcode": "^1.5.1",
|
||||
"qs": "6.7.0",
|
||||
"sortablejs": "^1.15.0",
|
||||
"uview-plus": "^3.1.29",
|
||||
"vue": "^3.3.0",
|
||||
"vue-i18n": "^9.2.2",
|
||||
"weixin-js-sdk": "^1.6.5",
|
||||
"hls.js": "^1.5.17",
|
||||
"dayjs": "^1.11.13"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@dcasia/mini-program-tailwind-webpack-plugin": "^1.5.6",
|
||||
"@dcloudio/types": "^3.3.2",
|
||||
"@dcloudio/uni-automator": "3.0.0-3080720230703001",
|
||||
"@dcloudio/uni-cli-shared": "3.0.0-3080720230703001",
|
||||
"@dcloudio/uni-stacktracey": "3.0.0-3080720230703001",
|
||||
"@dcloudio/vite-plugin-uni": "3.0.0-3080720230703001",
|
||||
"@rollup/plugin-commonjs": "^24.0.1",
|
||||
"@types/qrcode": "^1.5.0",
|
||||
"@types/sortablejs": "^1.15.0",
|
||||
"@vue/tsconfig": "^0.1.3",
|
||||
"sass": "^1.54.5",
|
||||
"typescript": "^4.9.4",
|
||||
"vite": "4.0.4",
|
||||
"vite-plugin-windicss": "^1.8.10",
|
||||
"vue-tsc": "^1.0.24",
|
||||
"windicss": "^3.5.6"
|
||||
}
|
||||
}
|
||||
51
publish.cjs
Normal file
51
publish.cjs
Normal file
@@ -0,0 +1,51 @@
|
||||
const fs = require('fs')
|
||||
|
||||
const publish = () => {
|
||||
const src = './dist/build/h5'
|
||||
const dest = '../niucloud/public/wap'
|
||||
|
||||
solve()
|
||||
|
||||
// 目标目录不存在停止复制
|
||||
try {
|
||||
const dir = fs.readdirSync(dest)
|
||||
} catch (e) {
|
||||
return
|
||||
}
|
||||
|
||||
// 删除目标目录下文件
|
||||
fs.rm(dest, { recursive: true }, err => {
|
||||
if(err) {
|
||||
console.log(err)
|
||||
return
|
||||
}
|
||||
|
||||
fs.cp(src, dest, { recursive: true }, (err) => {
|
||||
if (err) {
|
||||
console.error(err)
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
const solve = () => {
|
||||
const src = './dist/build/h5/assets'
|
||||
const filemaps = fs.readdirSync(src)
|
||||
|
||||
filemaps.forEach(file => {
|
||||
if (/^(index-)(\w{8})(.js)$/.test(file)) {
|
||||
const path = `${src}/${file}`
|
||||
let content = fs.readFileSync(path, 'utf-8')
|
||||
const first = 'const match = location.href.match(/\\/wap\\/(\\d*)\\//);'
|
||||
|
||||
if (content.indexOf(first) == -1) {
|
||||
content = first + content
|
||||
const replace = 'router:{mode:"history",base: match ? `/wap/${match[1]}/` : "/wap/",assets:"assets",routerBase: match ? `/wap/${match[1]}/` : "/wap/"},darkmode'
|
||||
content = content.replace(/router:{(.*?)},darkmode/s, replace)
|
||||
fs.writeFileSync(path, content, 'utf8')
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
publish()
|
||||
204
src/App.vue
Normal file
204
src/App.vue
Normal file
@@ -0,0 +1,204 @@
|
||||
<script setup lang="ts">
|
||||
import { onLaunch, onShow, onHide } from '@dcloudio/uni-app'
|
||||
import { launchInterceptor } from '@/utils/interceptor'
|
||||
import { getToken, isWeixinBrowser, getSiteId, currRoute, deepClone } from '@/utils/common'
|
||||
import useMemberStore from '@/stores/member'
|
||||
import useConfigStore from '@/stores/config'
|
||||
import useSystemStore from '@/stores/system'
|
||||
import { useLogin } from '@/hooks/useLogin'
|
||||
import { useShare } from '@/hooks/useShare'
|
||||
|
||||
onLaunch((data: any) => {
|
||||
|
||||
// 添加初始化拦截器
|
||||
launchInterceptor()
|
||||
|
||||
// #ifdef H5
|
||||
uni.getSystemInfoSync().platform == 'ios' && (uni.setStorageSync('initUrl', location.href))
|
||||
|
||||
// 传输给后台数据
|
||||
window.parent.postMessage(JSON.stringify({
|
||||
type: 'appOnLaunch',
|
||||
message: '初始化加载完成'
|
||||
}), '*');
|
||||
|
||||
// 监听父页面发来的消息
|
||||
window.addEventListener('message', event => {
|
||||
try {
|
||||
let data = {
|
||||
type: ''
|
||||
};
|
||||
if (typeof event.data == 'string') {
|
||||
data = JSON.parse(event.data)
|
||||
} else if (typeof event.data == 'object') {
|
||||
data = event.data
|
||||
}
|
||||
if (data.type && data.type == 'appOnReady') {
|
||||
window.parent.postMessage(JSON.stringify({
|
||||
type: 'appOnReady',
|
||||
message: '加载完成'
|
||||
}), '*');
|
||||
}
|
||||
} catch (e) {
|
||||
console.log('uni-app App.vue 接受数据错误', e)
|
||||
}
|
||||
}, false);
|
||||
|
||||
// 缺少站点id,拦截
|
||||
if (process.env.NODE_ENV == 'development' && (getSiteId(uni.getStorageSync('wap_site_id') || import.meta.env.VITE_SITE_ID) === '')) return;
|
||||
|
||||
const { wechatInit } = useShare()
|
||||
wechatInit()
|
||||
// #endif
|
||||
|
||||
// #ifdef MP
|
||||
const updateManager = uni.getUpdateManager();
|
||||
updateManager.onCheckForUpdate(function (res) {
|
||||
// 请求完新版本信息的回调
|
||||
});
|
||||
|
||||
updateManager.onUpdateReady(function (res) {
|
||||
uni.showModal({
|
||||
title: '更新提示',
|
||||
content: '新版本已经准备好,是否重启应用?',
|
||||
success(res) {
|
||||
if (res.confirm) {
|
||||
// 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
|
||||
updateManager.applyUpdate();
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
updateManager.onUpdateFailed(function (res) {
|
||||
// 新的版本下载失败
|
||||
});
|
||||
// #endif
|
||||
|
||||
// 获取初始化数据信息
|
||||
useSystemStore().getInitFn(async() => {
|
||||
|
||||
const configStore = useConfigStore()
|
||||
|
||||
let loginConfig = uni.getStorageSync('login_config')
|
||||
if (!loginConfig) {
|
||||
loginConfig = deepClone(configStore.login)
|
||||
}
|
||||
|
||||
// 判断在登录注册页面账号锁定后不进行请求三方登录注册
|
||||
let url: any = currRoute()
|
||||
if ((['app/pages/auth/index', 'app/pages/auth/login', 'app/pages/auth/register', 'app/pages/auth/resetpwd'].indexOf(url) != -1) &&
|
||||
(loginConfig.is_username || loginConfig.is_mobile || loginConfig.is_bind_mobile)) {
|
||||
return false
|
||||
}
|
||||
|
||||
// 判断是否已登录
|
||||
if (getToken()) {
|
||||
const memberStore: any = useMemberStore()
|
||||
memberStore.getUserBtnRole()
|
||||
await memberStore.setToken(getToken(), () => {
|
||||
if (!uni.getStorageSync('openid')) {
|
||||
const memberInfo = useMemberStore().info
|
||||
const login = useLogin()
|
||||
|
||||
// #ifdef MP-WEIXIN
|
||||
if (memberInfo.mobile) uni.setStorageSync('wap_member_mobile', memberInfo.mobile) // 存储会员手机号,防止重复请求微信获取手机号接口
|
||||
if (memberInfo && memberInfo.weapp_openid) {
|
||||
uni.setStorageSync('openid', memberInfo.weapp_openid)
|
||||
} else {
|
||||
login.getAuthCode({ updateFlag: true }) // 更新oppenid
|
||||
}
|
||||
// #endif
|
||||
|
||||
// #ifdef H5
|
||||
if (isWeixinBrowser()) {
|
||||
if (memberInfo && memberInfo.wx_openid) {
|
||||
uni.setStorageSync('openid', memberInfo.wx_openid)
|
||||
} else {
|
||||
if (data.query.code) {
|
||||
// 检测身份是否合法(当前登录的账号是不是我的),openid有效后才能更新登录
|
||||
login.updateOpenid(data.query.code, () => {
|
||||
login.authLogin({ code: data.query.code })
|
||||
})
|
||||
} else {
|
||||
if (loginConfig.is_force_access_user_info) {
|
||||
// 强制获取用户信息
|
||||
login.getAuthCode({ scopes: 'snsapi_userinfo' })
|
||||
} else {
|
||||
// 静默获取
|
||||
login.getAuthCode({ scopes: 'snsapi_base' })
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// #endif
|
||||
|
||||
}
|
||||
|
||||
// 开启强制绑定手机号
|
||||
if (uni.getStorageSync('isbindmobile')) {
|
||||
uni.removeStorageSync('isbindmobile');
|
||||
}
|
||||
|
||||
if (loginConfig.is_bind_mobile && !memberStore.info.mobile) {
|
||||
// 强制绑定手机号
|
||||
uni.setStorageSync('isbindmobile', true)
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
if (!getToken()) {
|
||||
|
||||
// #ifdef MP
|
||||
// 小程序 会员退出后不会自动登录
|
||||
if (uni.getStorageSync('autoLoginLock')) return;
|
||||
// #endif
|
||||
|
||||
const login = useLogin()
|
||||
|
||||
// #ifdef MP
|
||||
// 判断是否开启第三方自动注册登录
|
||||
if (loginConfig.is_auth_register) {
|
||||
// 第三方平台自动登录
|
||||
login.getAuthCode()
|
||||
}
|
||||
// #endif
|
||||
|
||||
// #ifdef H5
|
||||
if (isWeixinBrowser()) {
|
||||
if (uni.getStorageSync('autoLoginLock') && !uni.getStorageSync('wechat_login_back')) return;
|
||||
if (loginConfig.is_auth_register || uni.getStorageSync('wechat_login_back')) {
|
||||
uni.removeStorageSync('wechat_login_back') // 删除微信公众号手动授权登录回调标识
|
||||
if (data.query.code) {
|
||||
login.authLogin({ code: data.query.code })
|
||||
} else {
|
||||
if (loginConfig.is_force_access_user_info) {
|
||||
// 强制获取用户信息
|
||||
login.getAuthCode({ scopes: 'snsapi_userinfo' })
|
||||
} else {
|
||||
// 静默获取
|
||||
login.getAuthCode({ scopes: 'snsapi_base' })
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// #endif
|
||||
}
|
||||
})
|
||||
|
||||
})
|
||||
|
||||
onShow(() => {
|
||||
|
||||
})
|
||||
|
||||
onHide(() => {
|
||||
})
|
||||
</script>
|
||||
|
||||
<style>
|
||||
uni-page-head {
|
||||
display: none !important;
|
||||
}
|
||||
</style>
|
||||
29
src/addon/components/diy/group/index.scss
Normal file
29
src/addon/components/diy/group/index.scss
Normal file
@@ -0,0 +1,29 @@
|
||||
.ignore-draggable-element, .draggable-element {
|
||||
&.decorate {
|
||||
&:hover:before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
border: 4rpx dotted $u-primary;
|
||||
z-index: 10;
|
||||
pointer-events: none;
|
||||
cursor: move;
|
||||
}
|
||||
|
||||
&.selected:before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
border: 4rpx solid $u-primary;
|
||||
z-index: 10;
|
||||
pointer-events: none;
|
||||
cursor: move;
|
||||
}
|
||||
}
|
||||
}
|
||||
177
src/addon/components/diy/group/index.vue
Normal file
177
src/addon/components/diy/group/index.vue
Normal file
@@ -0,0 +1,177 @@
|
||||
<template>
|
||||
<view class="diy-group" id="componentList">
|
||||
<top-tabbar :scrollBool="diyGroup.componentsScrollBool.TopTabbar" v-if="data.global && Object.keys(data.global).length && data.global.topStatusBar && data.global.topStatusBar.isShow" ref="topTabbarRef" :data="data.global" />
|
||||
<view v-for="(component, index) in data.value" :key="component.id"
|
||||
@click="diyStore.changeCurrentIndex(index, component)"
|
||||
:class="diyGroup.getComponentClass(index,component)" :style="component.pageStyle">
|
||||
<view class="relative" :style="{ marginTop : component.margin.top < 0 ? (component.margin.top * 2) + 'rpx' : '0' }">
|
||||
<!-- 装修模式下,设置负上边距后超出的内容,禁止选中设置 -->
|
||||
<view v-if="diyGroup.isShowPlaceHolder(index,component)" class="absolute w-full z-1" :style="{ height : (component.margin.top * 2 * -1) + 'rpx' }" @click.stop="diyGroup.placeholderEvent"></view>
|
||||
<template v-if="component.componentName == 'ActiveCube'">
|
||||
<diy-active-cube :component="component" :global="data.global" :index="index" :pullDownRefreshCount="props.pullDownRefreshCount" :scrollBool="diyGroup.componentsScrollBool.ActiveCube" />
|
||||
</template>
|
||||
<template v-if="component.componentName == 'CarouselSearch'">
|
||||
<diy-carousel-search :component="component" :global="data.global" :index="index" :pullDownRefreshCount="props.pullDownRefreshCount" :scrollBool="diyGroup.componentsScrollBool.CarouselSearch" />
|
||||
</template>
|
||||
<template v-if="component.componentName == 'FloatBtn'">
|
||||
<diy-float-btn :component="component" :global="data.global" :index="index" :pullDownRefreshCount="props.pullDownRefreshCount" :scrollBool="diyGroup.componentsScrollBool.FloatBtn" />
|
||||
</template>
|
||||
<template v-if="component.componentName == 'GraphicNav'">
|
||||
<diy-graphic-nav :component="component" :global="data.global" :index="index" :pullDownRefreshCount="props.pullDownRefreshCount" :scrollBool="diyGroup.componentsScrollBool.GraphicNav" />
|
||||
</template>
|
||||
<template v-if="component.componentName == 'HorzBlank'">
|
||||
<diy-horz-blank :component="component" :global="data.global" :index="index" :pullDownRefreshCount="props.pullDownRefreshCount" :scrollBool="diyGroup.componentsScrollBool.HorzBlank" />
|
||||
</template>
|
||||
<template v-if="component.componentName == 'HorzLine'">
|
||||
<diy-horz-line :component="component" :global="data.global" :index="index" :pullDownRefreshCount="props.pullDownRefreshCount" :scrollBool="diyGroup.componentsScrollBool.HorzLine" />
|
||||
</template>
|
||||
<template v-if="component.componentName == 'HotArea'">
|
||||
<diy-hot-area :component="component" :global="data.global" :index="index" :pullDownRefreshCount="props.pullDownRefreshCount" :scrollBool="diyGroup.componentsScrollBool.HotArea" />
|
||||
</template>
|
||||
<template v-if="component.componentName == 'ImageAds'">
|
||||
<diy-image-ads :component="component" :global="data.global" :index="index" :pullDownRefreshCount="props.pullDownRefreshCount" :scrollBool="diyGroup.componentsScrollBool.ImageAds" />
|
||||
</template>
|
||||
<template v-if="component.componentName == 'MemberInfo'">
|
||||
<diy-member-info :component="component" :global="data.global" :index="index" :pullDownRefreshCount="props.pullDownRefreshCount" :scrollBool="diyGroup.componentsScrollBool.MemberInfo" />
|
||||
</template>
|
||||
<template v-if="component.componentName == 'MemberLevel'">
|
||||
<diy-member-level :component="component" :global="data.global" :index="index" :pullDownRefreshCount="props.pullDownRefreshCount" :scrollBool="diyGroup.componentsScrollBool.MemberLevel" />
|
||||
</template>
|
||||
<template v-if="component.componentName == 'Notice'">
|
||||
<diy-notice :component="component" :global="data.global" :index="index" :pullDownRefreshCount="props.pullDownRefreshCount" :scrollBool="diyGroup.componentsScrollBool.Notice" />
|
||||
</template>
|
||||
<template v-if="component.componentName == 'PictureShow'">
|
||||
<diy-picture-show :component="component" :global="data.global" :index="index" :pullDownRefreshCount="props.pullDownRefreshCount" :scrollBool="diyGroup.componentsScrollBool.PictureShow" />
|
||||
</template>
|
||||
<template v-if="component.componentName == 'RichText'">
|
||||
<diy-rich-text :component="component" :global="data.global" :index="index" :pullDownRefreshCount="props.pullDownRefreshCount" :scrollBool="diyGroup.componentsScrollBool.RichText" />
|
||||
</template>
|
||||
<template v-if="component.componentName == 'RubikCube'">
|
||||
<diy-rubik-cube :component="component" :global="data.global" :index="index" :pullDownRefreshCount="props.pullDownRefreshCount" :scrollBool="diyGroup.componentsScrollBool.RubikCube" />
|
||||
</template>
|
||||
<template v-if="component.componentName == 'Text'">
|
||||
<diy-text :component="component" :global="data.global" :index="index" :pullDownRefreshCount="props.pullDownRefreshCount" :scrollBool="diyGroup.componentsScrollBool.Text" />
|
||||
</template>
|
||||
<template v-if="component.componentName == 'GoodsCoupon'">
|
||||
<diy-goods-coupon :component="component" :global="data.global" :index="index" :pullDownRefreshCount="props.pullDownRefreshCount" :scrollBool="diyGroup.componentsScrollBool.GoodsCoupon" />
|
||||
</template>
|
||||
<template v-if="component.componentName == 'GoodsList'">
|
||||
<diy-goods-list :component="component" :global="data.global" :index="index" :pullDownRefreshCount="props.pullDownRefreshCount" :scrollBool="diyGroup.componentsScrollBool.GoodsList" />
|
||||
</template>
|
||||
<template v-if="component.componentName == 'ManyGoodsList'">
|
||||
<diy-many-goods-list :component="component" :global="data.global" :index="index" :pullDownRefreshCount="props.pullDownRefreshCount" :scrollBool="diyGroup.componentsScrollBool.ManyGoodsList" />
|
||||
</template>
|
||||
<template v-if="component.componentName == 'ShopExchangeGoods'">
|
||||
<diy-shop-exchange-goods :component="component" :global="data.global" :index="index" :pullDownRefreshCount="props.pullDownRefreshCount" :scrollBool="diyGroup.componentsScrollBool.ShopExchangeGoods" />
|
||||
</template>
|
||||
<template v-if="component.componentName == 'ShopExchangeInfo'">
|
||||
<diy-shop-exchange-info :component="component" :global="data.global" :index="index" :pullDownRefreshCount="props.pullDownRefreshCount" :scrollBool="diyGroup.componentsScrollBool.ShopExchangeInfo" />
|
||||
</template>
|
||||
<template v-if="component.componentName == 'ShopGoodsRanking'">
|
||||
<diy-shop-goods-ranking :component="component" :global="data.global" :index="index" :pullDownRefreshCount="props.pullDownRefreshCount" :scrollBool="diyGroup.componentsScrollBool.ShopGoodsRanking" />
|
||||
</template>
|
||||
<template v-if="component.componentName == 'ShopGoodsRecommend'">
|
||||
<diy-shop-goods-recommend :component="component" :global="data.global" :index="index" :pullDownRefreshCount="props.pullDownRefreshCount" :scrollBool="diyGroup.componentsScrollBool.ShopGoodsRecommend" />
|
||||
</template>
|
||||
<template v-if="component.componentName == 'ShopMemberInfo'">
|
||||
<diy-shop-member-info :component="component" :global="data.global" :index="index" :pullDownRefreshCount="props.pullDownRefreshCount" :scrollBool="diyGroup.componentsScrollBool.ShopMemberInfo" />
|
||||
</template>
|
||||
<template v-if="component.componentName == 'ShopNewcomer'">
|
||||
<diy-shop-newcomer :component="component" :global="data.global" :index="index" :pullDownRefreshCount="props.pullDownRefreshCount" :scrollBool="diyGroup.componentsScrollBool.ShopNewcomer" />
|
||||
</template>
|
||||
<template v-if="component.componentName == 'ShopOrderInfo'">
|
||||
<diy-shop-order-info :component="component" :global="data.global" :index="index" :pullDownRefreshCount="props.pullDownRefreshCount" :scrollBool="diyGroup.componentsScrollBool.ShopOrderInfo" />
|
||||
</template>
|
||||
<template v-if="component.componentName == 'ShopSearch'">
|
||||
<diy-shop-search :component="component" :global="data.global" :index="index" :pullDownRefreshCount="props.pullDownRefreshCount" :scrollBool="diyGroup.componentsScrollBool.ShopSearch" />
|
||||
</template>
|
||||
<template v-if="component.componentName == 'SingleRecommend'">
|
||||
<diy-single-recommend :component="component" :global="data.global" :index="index" :pullDownRefreshCount="props.pullDownRefreshCount" :scrollBool="diyGroup.componentsScrollBool.SingleRecommend" />
|
||||
</template>
|
||||
<template v-if="component.componentName == 'FenxiaoGoodsList'">
|
||||
<diy-fenxiao-goods-list :component="component" :global="data.global" :index="index" :pullDownRefreshCount="props.pullDownRefreshCount" :scrollBool="diyGroup.componentsScrollBool.FenxiaoGoodsList" />
|
||||
</template>
|
||||
<template v-if="component.componentName == 'ParentMember'">
|
||||
<diy-parent-member :component="component" :global="data.global" :index="index" :pullDownRefreshCount="props.pullDownRefreshCount" :scrollBool="diyGroup.componentsScrollBool.ParentMember" />
|
||||
</template>
|
||||
<template v-if="component.componentName == 'Poster'">
|
||||
<diy-poster :component="component" :global="data.global" :index="index" :pullDownRefreshCount="props.pullDownRefreshCount" :scrollBool="diyGroup.componentsScrollBool.Poster" />
|
||||
</template>
|
||||
<template v-if="component.componentName == 'TtnGraphicNav'">
|
||||
<diy-ttn-graphic-nav :component="component" :global="data.global" :index="index" :pullDownRefreshCount="props.pullDownRefreshCount" :scrollBool="diyGroup.componentsScrollBool.TtnGraphicNav" />
|
||||
</template>
|
||||
<template v-if="component.componentName == 'GiftcardList'">
|
||||
<diy-giftcard-list :component="component" :global="data.global" :index="index" :pullDownRefreshCount="props.pullDownRefreshCount" :scrollBool="diyGroup.componentsScrollBool.GiftcardList" />
|
||||
</template>
|
||||
<template v-if="component.componentName == 'Dstore'">
|
||||
<diy-dstore :component="component" :global="data.global" :index="index" :pullDownRefreshCount="props.pullDownRefreshCount" :scrollBool="diyGroup.componentsScrollBool.Dstore" />
|
||||
</template>
|
||||
<template v-if="component.componentName == 'XypmActivity'">
|
||||
<diy-xypm-activity :component="component" :global="data.global" :index="index" :pullDownRefreshCount="props.pullDownRefreshCount" :scrollBool="diyGroup.componentsScrollBool.XypmActivity" />
|
||||
</template>
|
||||
<template v-if="component.componentName == 'XypmArticle'">
|
||||
<diy-xypm-article :component="component" :global="data.global" :index="index" :pullDownRefreshCount="props.pullDownRefreshCount" :scrollBool="diyGroup.componentsScrollBool.XypmArticle" />
|
||||
</template>
|
||||
<template v-if="component.componentName == 'ErpMemberInfo'">
|
||||
<diy-erp-member-info :component="component" :global="data.global" :index="index" :pullDownRefreshCount="props.pullDownRefreshCount" :scrollBool="diyGroup.componentsScrollBool.ErpMemberInfo" />
|
||||
</template>
|
||||
</view>
|
||||
</view>
|
||||
<template v-if="diyStore.mode == '' && data.global.bottomTabBarSwitch">
|
||||
<view class="pt-[20rpx]"></view>
|
||||
<tabbar />
|
||||
</template>
|
||||
</view>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import diyGoodsCoupon from '@/addon/shop/components/diy/goods-coupon/index.vue';
|
||||
import diyGoodsList from '@/addon/shop/components/diy/goods-list/index.vue';
|
||||
import diyManyGoodsList from '@/addon/shop/components/diy/many-goods-list/index.vue';
|
||||
import diyShopExchangeGoods from '@/addon/shop/components/diy/shop-exchange-goods/index.vue';
|
||||
import diyShopExchangeInfo from '@/addon/shop/components/diy/shop-exchange-info/index.vue';
|
||||
import diyShopGoodsRanking from '@/addon/shop/components/diy/shop-goods-ranking/index.vue';
|
||||
import diyShopGoodsRecommend from '@/addon/shop/components/diy/shop-goods-recommend/index.vue';
|
||||
import diyShopMemberInfo from '@/addon/shop/components/diy/shop-member-info/index.vue';
|
||||
import diyShopNewcomer from '@/addon/shop/components/diy/shop-newcomer/index.vue';
|
||||
import diyShopOrderInfo from '@/addon/shop/components/diy/shop-order-info/index.vue';
|
||||
import diyShopSearch from '@/addon/shop/components/diy/shop-search/index.vue';
|
||||
import diySingleRecommend from '@/addon/shop/components/diy/single-recommend/index.vue';
|
||||
import diyFenxiaoGoodsList from '@/addon/shop_fenxiao/components/diy/fenxiao-goods-list/index.vue';
|
||||
import diyParentMember from '@/addon/tt_niucloud/components/diy/parent-member/index.vue';
|
||||
import diyPoster from '@/addon/tt_niucloud/components/diy/poster/index.vue';
|
||||
import diyTtnGraphicNav from '@/addon/tt_niucloud/components/diy/ttn-graphic-nav/index.vue';
|
||||
import diyGiftcardList from '@/addon/shop_giftcard/components/diy/giftcard-list/index.vue';
|
||||
import diyDstore from '@/addon/d_store/components/diy/dstore/index.vue';
|
||||
import diyXypmActivity from '@/addon/xypm/components/diy/xypm-activity/index.vue';
|
||||
import diyXypmArticle from '@/addon/xypm/components/diy/xypm-article/index.vue';
|
||||
import diyErpMemberInfo from '@/addon/erp/components/diy/erp-member-info/index.vue';
|
||||
import topTabbar from '@/components/top-tabbar/top-tabbar.vue'
|
||||
import useDiyStore from '@/app/stores/diy';
|
||||
import { useDiyGroup } from './useDiyGroup';
|
||||
import { ref } from 'vue';
|
||||
|
||||
const props = defineProps(['data','pullDownRefreshCount']);
|
||||
const topTabbarRef = ref(null);
|
||||
const diyStore = useDiyStore();
|
||||
const diyGroup = useDiyGroup({
|
||||
...props,
|
||||
getFormRef() {
|
||||
return {
|
||||
topTabbarRef: topTabbarRef.value
|
||||
}
|
||||
}
|
||||
});
|
||||
const data = ref(diyGroup.data);
|
||||
|
||||
// 监听页面加载完成
|
||||
diyGroup.onMounted();
|
||||
|
||||
// 监听滚动事件
|
||||
diyGroup.onPageScroll();
|
||||
defineExpose({
|
||||
refresh: diyGroup.refresh
|
||||
})
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
@import './index.scss';
|
||||
</style>
|
||||
159
src/addon/components/diy/group/useDiyGroup.ts
Normal file
159
src/addon/components/diy/group/useDiyGroup.ts
Normal file
@@ -0,0 +1,159 @@
|
||||
import { ref, onMounted, nextTick, computed } from 'vue';
|
||||
import Sortable from 'sortablejs';
|
||||
import { range } from 'lodash-es';
|
||||
import { onPageScroll, onHide, onShow } from '@dcloudio/uni-app';
|
||||
import useDiyStore from '@/app/stores/diy';
|
||||
|
||||
export function useDiyGroup(params: any = {}) {
|
||||
|
||||
let scrollVal: any = ""; //组件滚动值集合
|
||||
const componentsScrollBool: any = ref({}); //组件是否根据滚动进行相应改变
|
||||
const diyStore = useDiyStore();
|
||||
|
||||
const positionFixed = ref(['fixed', 'top_fixed', 'right_fixed', 'bottom_fixed', 'left_fixed']);
|
||||
|
||||
const data = computed(() => {
|
||||
if (diyStore.mode == 'decorate') {
|
||||
return diyStore;
|
||||
} else {
|
||||
return params.data;
|
||||
}
|
||||
})
|
||||
|
||||
const getComponentClass = (index: any, component: any) => {
|
||||
let obj: any = {
|
||||
relative: true,
|
||||
selected: diyStore.currentIndex == index,
|
||||
decorate: diyStore.mode == 'decorate'
|
||||
}
|
||||
obj['top-fixed-' + diyStore.topFixedStatus] = true;
|
||||
|
||||
if (component.position && positionFixed.value.indexOf(component.position) != -1) {
|
||||
// 找出置顶组件,设置禁止拖动
|
||||
obj['ignore-draggable-element'] = true;
|
||||
} else {
|
||||
obj['draggable-element'] = true;
|
||||
}
|
||||
if(component.componentName == 'ImageAds'){
|
||||
obj['overflow-hidden'] = true
|
||||
}
|
||||
return obj;
|
||||
}
|
||||
|
||||
// 是否显示占位区域,用于禁止选中负上边距的内容
|
||||
const isShowPlaceHolder = (index: any, component: any) => {
|
||||
// #ifdef H5
|
||||
if (diyStore.mode == 'decorate') {
|
||||
let el: any = document.getElementById('componentList');
|
||||
if (el && el.children.length && el.children[index]) {
|
||||
let height = el.children[index].offsetHeight;
|
||||
let top = 0;
|
||||
if (component.margin.top < 0) {
|
||||
top = component.margin.top * 2 * -1;
|
||||
// 若负上边距大于组件的高度,则允许选中进行装修
|
||||
if (top > height) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
// #endif
|
||||
return false;
|
||||
}
|
||||
|
||||
// 监听页面加载完成
|
||||
const onMountedLifeCycle = () => {
|
||||
onMounted(() => {
|
||||
// #ifdef H5
|
||||
if (diyStore.mode == 'decorate') {
|
||||
var el: any = document.getElementById('componentList');
|
||||
const sortable = Sortable.create(el, {
|
||||
draggable: '.draggable-element',
|
||||
animation: 200,
|
||||
// 结束拖拽
|
||||
onEnd: event => {
|
||||
let temp = diyStore.value[event.oldIndex!];
|
||||
diyStore.value.splice(event.oldIndex!, 1);
|
||||
diyStore.value.splice(event.newIndex!, 0, temp);
|
||||
|
||||
nextTick(() => {
|
||||
sortable.sort(range(diyStore.value.length).map((value: any) => {
|
||||
return value.toString();
|
||||
}));
|
||||
|
||||
diyStore.postMessage(event.newIndex, diyStore.value[event.newIndex]);
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
// #endif
|
||||
|
||||
nextTick(() => {
|
||||
setTimeout(() => {
|
||||
|
||||
// 初始化组件滚动值
|
||||
scrollVal = uni.getStorageSync('componentsScrollValGroup');
|
||||
if (scrollVal) {
|
||||
for (let key in scrollVal) {
|
||||
componentsScrollBool.value[key] = -1;
|
||||
}
|
||||
}
|
||||
}, 500)
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
// 页面onShow调用时,也会触发改方法
|
||||
const refresh = () => {
|
||||
|
||||
nextTick(() => {
|
||||
params.getFormRef().topTabbarRef?.refresh();
|
||||
})
|
||||
}
|
||||
|
||||
// 空函数,禁止选中
|
||||
const placeholderEvent = () => {
|
||||
}
|
||||
|
||||
const isPagesHide = ref(false)
|
||||
onShow(() => {
|
||||
isPagesHide.value = false;
|
||||
})
|
||||
onHide(() => {
|
||||
isPagesHide.value = true;
|
||||
})
|
||||
|
||||
// 监听滚动事件
|
||||
const scrollValStr = ref()
|
||||
const onPageScrollLifeCycle = () => {
|
||||
onPageScroll((e) => {
|
||||
if (scrollVal && !isPagesHide.value) {
|
||||
for (let key in scrollVal) {
|
||||
if (e.scrollTop <= 0) {
|
||||
// -1 表示页面滚动值小于零,组件随页面下拉而下来
|
||||
componentsScrollBool.value[key] = -1;
|
||||
} else if (e.scrollTop > scrollVal[key]) {
|
||||
// 1 表示页面滚动值大于传入滚动值,组件随页面上拉背景、文字颜色等采用滚动后的变量
|
||||
componentsScrollBool.value[key] = 1;
|
||||
} else {
|
||||
// 2 表示页面滚动值小于传入滚动值,组件随页面下拉背景、文字颜色等采用滚动前的变量
|
||||
componentsScrollBool.value[key] = 2
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
return {
|
||||
scrollV: scrollValStr.value,
|
||||
data: data.value,
|
||||
componentsScrollBool: componentsScrollBool.value,
|
||||
placeholderEvent,
|
||||
refresh,
|
||||
isShowPlaceHolder,
|
||||
getComponentClass,
|
||||
onPageScroll: onPageScrollLifeCycle,
|
||||
onMounted: onMountedLifeCycle
|
||||
}
|
||||
}
|
||||
0
src/addon/components/fixed/group/index.scss
Normal file
0
src/addon/components/fixed/group/index.scss
Normal file
13
src/addon/components/fixed/group/index.vue
Normal file
13
src/addon/components/fixed/group/index.vue
Normal file
@@ -0,0 +1,13 @@
|
||||
<template>
|
||||
<view class="fixed-group">
|
||||
<template v-if="props.data.global.component == 'demo-index'">
|
||||
<fixed-demo-index :data="props.data" :pullDownRefreshCount="props.pullDownRefreshCount"></fixed-demo-index>
|
||||
</template>
|
||||
</view>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
const props = defineProps(['data','pullDownRefreshCount']);
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
@import './index.scss';
|
||||
</style>
|
||||
8
src/addon/d_store/api/hello_world.ts
Normal file
8
src/addon/d_store/api/hello_world.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
|
||||
import request from '@/utils/request'
|
||||
|
||||
/***************************************************** hello world ****************************************************/
|
||||
export function getHelloWorld() {
|
||||
return request.get(`d_store/hello_world`)
|
||||
}
|
||||
|
||||
10
src/addon/d_store/api/store.ts
Normal file
10
src/addon/d_store/api/store.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
|
||||
import request from '@/utils/request'
|
||||
|
||||
/***************************************************** 经销商门店接口 ****************************************************/
|
||||
export function getStoreLists(param) {
|
||||
return request.get(`d_store/store/lists`, param)
|
||||
}
|
||||
export function getStoreInfo(id) {
|
||||
return request.get(`d_store/store/info/${id}`)
|
||||
}
|
||||
335
src/addon/d_store/components/diy/dstore/index.vue
Normal file
335
src/addon/d_store/components/diy/dstore/index.vue
Normal file
@@ -0,0 +1,335 @@
|
||||
<template>
|
||||
<view :style="warpCss">
|
||||
<view :style="maskLayer">
|
||||
</view>
|
||||
<view v-if="diyComponent.showtitle == 1"
|
||||
class="flex items-center mb-[16rpx] mt-[32rpx] flex-right justify-between mr-2">
|
||||
<view>
|
||||
<view class="ml-4 font-bold text-[32rpx]" :style="{
|
||||
color: diyComponent.titlecolor,
|
||||
fontSize: diyComponent.titlesize + 'rpx',
|
||||
}">{{diyComponent.titlename}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="flex items-center" @click="locationVal.repositionFn()">
|
||||
<view class="text-[#4d5048]" :style="{
|
||||
color: diyComponent.localcolor,
|
||||
fontSize: diyComponent.localsize + 'rpx',
|
||||
}">
|
||||
当前位置:
|
||||
</view>
|
||||
<view class="text-[#4d5048] tk-sltext ml-1" :style="{
|
||||
color: diyComponent.localcolor,
|
||||
fontSize: diyComponent.localsize + 'rpx',
|
||||
}">
|
||||
{{ !systemStore.currShippingAddress ? "选择位置" : systemStore.currShippingAddress.community }}
|
||||
</view>
|
||||
<view>
|
||||
<u-icon name="arrow-right" :color="diyComponent.localcolor" size="16"></u-icon>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="diyComponent.showsearch == 1" class="fl items-center ml-4 mr-4 mb-2 bg-[#fcfcfc] rounded-[16rpx]"
|
||||
:style="{
|
||||
background: diyComponent.searchcolor,
|
||||
}">
|
||||
<u-input clearable v-model="keyword" focus="true" placeholder="输入门店名称快速检索" @change="reload" @blur="reload"
|
||||
suffixIcon="search" suffixIconStyle="color: #909399"></u-input>
|
||||
</view>
|
||||
<view v-if="list&&list.length>0" class="tk-card" :style="{
|
||||
background: diyComponent.cardbackground,padding:diyComponent.paddingsize + 'rpx'
|
||||
}" v-for="(item, index) in list">
|
||||
<view class="flex items-center" @click="redirect({url:'/addon/d_store/pages/detail?id='+item.id})">
|
||||
<view>
|
||||
<image style="
|
||||
width: 140rpx;
|
||||
height: 140rpx;
|
||||
background-color: #eeeeee;
|
||||
border-radius: 8px;
|
||||
" :src="img(item.logo)" mode="aspectFill"></image>
|
||||
</view>
|
||||
|
||||
<view class="flex flex-col ml-2 w-[100%] justify-between mb-2">
|
||||
<view class="font-bold tk-sltext" :style="{
|
||||
color: diyComponent.storetitlecolor,
|
||||
}">{{ item.name }}</view>
|
||||
<view class="text-xs text-slate-500 mb-2 tk-sltext" :style="{
|
||||
color: diyComponent.desctitlecolor,
|
||||
}">{{item.desc}}</view>
|
||||
<view class="flex justify-between">
|
||||
<view class="flex items-center">
|
||||
<u-tag size="mini" :bgColor="diyComponent.tagbgcolor" :borderColor="diyComponent.tagbgcolor"
|
||||
:color="diyComponent.tagtextcolor" :text="item.work_time"></u-tag>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="line-box mt-2 mb-2" :style="{
|
||||
background: diyComponent.linecolor,
|
||||
}"></view>
|
||||
<view @click="openMap(item.lat,item.lng)" class="flex justify-between mt-1">
|
||||
<view class="flex items-center w-[60%]">
|
||||
<view>
|
||||
<u-icon name="map" size="16" :color="diyComponent.othertitlecolor"></u-icon>
|
||||
</view>
|
||||
<view class="ml-1 text-slate-500 tk-sltext" :style="{
|
||||
color: diyComponent.othertitlecolor,
|
||||
}">{{item.address}}</view>
|
||||
</view>
|
||||
<view class="flex items-center text-slate-600 " :style="{
|
||||
color: diyComponent.othertitlecolor,
|
||||
}">
|
||||
距离{{item.distance}}km
|
||||
</view>
|
||||
</view>
|
||||
<view @click="telPhone(item.mobile)" class="flex justify-between mt-1">
|
||||
<view class="flex items-center w-[60%]">
|
||||
<view>
|
||||
<u-icon name="phone" size="16" :color="diyComponent.othertitlecolor"></u-icon>
|
||||
</view>
|
||||
<view class="ml-1 text-slate-500 tk-sltext" :style="{
|
||||
color: diyComponent.othertitlecolor,
|
||||
}">{{item.mobile}}</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
<up-loading-icon class="mt-4 mb-4" :show="loading" mode="circle" timing-function="linear"></up-loading-icon>
|
||||
|
||||
<mescroll-empty :option="{ icon: img('static/resource/images/empty.png') }"
|
||||
v-if="!list.length && loading == false"></mescroll-empty>
|
||||
|
||||
<!-- #ifdef MP-WEIXIN -->
|
||||
<!-- 小程序隐私协议 -->
|
||||
<wx-privacy-popup ref="wxPrivacyPopup"></wx-privacy-popup>
|
||||
<!-- #endif -->
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import {
|
||||
ref,
|
||||
computed,
|
||||
watch,
|
||||
onMounted,
|
||||
nextTick,
|
||||
getCurrentInstance,
|
||||
watchEffect
|
||||
} from "vue";
|
||||
import { img, redirect } from "@/utils/common";
|
||||
import MescrollUni from "@/components/mescroll/mescroll-uni/mescroll-uni.vue";
|
||||
import MescrollBody from "@/components/mescroll/mescroll-body/mescroll-body.vue";
|
||||
import useMescroll from "@/components/mescroll/hooks/useMescroll.js";
|
||||
import MescrollEmpty from "@/components/mescroll/mescroll-empty/mescroll-empty.vue";
|
||||
import { onLoad, onPageScroll, onReachBottom } from "@dcloudio/uni-app";
|
||||
import useDiyStore from "@/app/stores/diy";
|
||||
import useSystemStore from "@/stores/system";
|
||||
import { getStoreLists } from "@/addon/d_store/api/store";
|
||||
import { getLocationData, openMap, telPhone } from "@/addon/d_store/utils/ts/common";
|
||||
import { getAddressByLatlng } from "@/app/api/system";
|
||||
import { useLocation } from '@/hooks/useLocation'
|
||||
const locationVal = useLocation(true);
|
||||
locationVal.onLoad();
|
||||
locationVal.initFn();
|
||||
locationVal.refreshLocationFn();
|
||||
const systemStore = useSystemStore();
|
||||
const currentPosition = ref();
|
||||
let list = ref<Array<Object>>([]);
|
||||
let loading = ref<boolean>(false);
|
||||
const page = ref(1);
|
||||
const planSource = ref(4);
|
||||
const actType = ref([
|
||||
{ name: "所有活动", value: 4 },
|
||||
{ name: "美团", value: 2 },
|
||||
{ name: "饿了么", value: 3 },
|
||||
]);
|
||||
|
||||
const keyword = ref()
|
||||
const reload = (e) => {
|
||||
loading.value = true;
|
||||
keyword.value = e
|
||||
listData.value = []
|
||||
page.value = 1
|
||||
getStoreListFn();
|
||||
}
|
||||
const listData = ref([]);
|
||||
|
||||
const getStoreListFn = () => {
|
||||
let location = getLocationData()
|
||||
if (!location) {
|
||||
location = uni.getStorageSync('location')
|
||||
}
|
||||
loading.value = true;
|
||||
let data : object = {
|
||||
page: page.value,
|
||||
lat: location.latitude,
|
||||
lng: location.longitude,
|
||||
name: keyword.value
|
||||
};
|
||||
getStoreLists(data)
|
||||
.then((res) => {
|
||||
let newArr = res.data.data as Array<Object>;
|
||||
if (newArr.length == 0) {
|
||||
loading.value = false;
|
||||
uni.showToast({
|
||||
title: "已经没有更多数据",
|
||||
icon: "none",
|
||||
});
|
||||
return
|
||||
}
|
||||
loading.value = false;
|
||||
if (page.value == 1) {
|
||||
list.value = newArr;
|
||||
} else {
|
||||
list.value = list.value.concat(newArr);
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
loading.value = false;
|
||||
});
|
||||
};
|
||||
getStoreListFn();
|
||||
watch(() => systemStore.location, (nval, oval) => {
|
||||
if (nval.latitude && nval.longitude) {
|
||||
loading.value = true;
|
||||
listData.value = []
|
||||
page.value = 1
|
||||
getStoreListFn()
|
||||
} else {
|
||||
currentPosition.value = "定位中..."
|
||||
}
|
||||
}, { deep: true })
|
||||
|
||||
onReachBottom(() => {
|
||||
page.value++
|
||||
getStoreListFn();
|
||||
});
|
||||
|
||||
const props = defineProps(["component", "index", "pullDownRefreshCount"]);
|
||||
|
||||
const diyStore = useDiyStore();
|
||||
|
||||
const diyComponent = computed(() => {
|
||||
if (diyStore.mode == "decorate") {
|
||||
return diyStore.value[props.index];
|
||||
} else {
|
||||
return props.component;
|
||||
}
|
||||
});
|
||||
|
||||
const warpCss = computed(() => {
|
||||
var style = "";
|
||||
style += "position:relative;";
|
||||
if (diyComponent.value.componentStartBgColor) {
|
||||
if (
|
||||
diyComponent.value.componentStartBgColor &&
|
||||
diyComponent.value.componentEndBgColor
|
||||
)
|
||||
style += `background:linear-gradient(${diyComponent.value.componentGradientAngle},${diyComponent.value.componentStartBgColor},${diyComponent.value.componentEndBgColor});`;
|
||||
else
|
||||
style +=
|
||||
"background-color:" + diyComponent.value.componentStartBgColor + ";";
|
||||
}
|
||||
|
||||
if (diyComponent.value.componentBgUrl) {
|
||||
style += `background-image:url('${img(
|
||||
diyComponent.value.componentBgUrl
|
||||
)}');`;
|
||||
style += "background-size: cover;background-repeat: no-repeat;";
|
||||
}
|
||||
|
||||
if (diyComponent.value.topRounded)
|
||||
style +=
|
||||
"border-top-left-radius:" + diyComponent.value.topRounded * 2 + "rpx;";
|
||||
if (diyComponent.value.topRounded)
|
||||
style +=
|
||||
"border-top-right-radius:" + diyComponent.value.topRounded * 2 + "rpx;";
|
||||
if (diyComponent.value.bottomRounded)
|
||||
style +=
|
||||
"border-bottom-left-radius:" +
|
||||
diyComponent.value.bottomRounded * 2 +
|
||||
"rpx;";
|
||||
if (diyComponent.value.bottomRounded)
|
||||
style +=
|
||||
"border-bottom-right-radius:" +
|
||||
diyComponent.value.bottomRounded * 2 +
|
||||
"rpx;";
|
||||
return style;
|
||||
});
|
||||
|
||||
// 背景图加遮罩层
|
||||
const maskLayer = computed(() => {
|
||||
var style = "";
|
||||
if (diyComponent.value.componentBgUrl) {
|
||||
style += "position:absolute;top:0;width:100%;";
|
||||
style += `background: rgba(0,0,0,${diyComponent.value.componentBgAlpha / 10
|
||||
});`;
|
||||
style += `height:${height.value}px;`;
|
||||
|
||||
if (diyComponent.value.topRounded)
|
||||
style +=
|
||||
"border-top-left-radius:" + diyComponent.value.topRounded * 2 + "rpx;";
|
||||
if (diyComponent.value.topRounded)
|
||||
style +=
|
||||
"border-top-right-radius:" + diyComponent.value.topRounded * 2 + "rpx;";
|
||||
if (diyComponent.value.bottomRounded)
|
||||
style +=
|
||||
"border-bottom-left-radius:" +
|
||||
diyComponent.value.bottomRounded * 2 +
|
||||
"rpx;";
|
||||
if (diyComponent.value.bottomRounded)
|
||||
style +=
|
||||
"border-bottom-right-radius:" +
|
||||
diyComponent.value.bottomRounded * 2 +
|
||||
"rpx;";
|
||||
}
|
||||
|
||||
return style;
|
||||
});
|
||||
|
||||
watch(
|
||||
() => props.pullDownRefreshCount,
|
||||
(newValue, oldValue) => {
|
||||
// 处理下拉刷新业务
|
||||
}
|
||||
);
|
||||
|
||||
onMounted(() => {
|
||||
refresh();
|
||||
getStoreListFn();
|
||||
// 装修模式下刷新
|
||||
if (diyStore.mode == "decorate") {
|
||||
watch(
|
||||
() => diyComponent.value,
|
||||
(newValue, oldValue) => {
|
||||
if (newValue && newValue.componentName == "RichText") {
|
||||
refresh();
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
const instance = getCurrentInstance();
|
||||
const height = ref(0);
|
||||
|
||||
const refresh = () => {
|
||||
nextTick(() => {
|
||||
const query = uni.createSelectorQuery().in(instance);
|
||||
query
|
||||
.select(".diy-rich-text")
|
||||
.boundingClientRect((data : any) => {
|
||||
height.value = data.height;
|
||||
})
|
||||
.exec();
|
||||
});
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import "@/addon/d_store/utils/styles/common.scss";
|
||||
|
||||
.uni-system-open-location {
|
||||
z-index: 99999999;
|
||||
}
|
||||
</style>
|
||||
1
src/addon/d_store/locale/en.json
Normal file
1
src/addon/d_store/locale/en.json
Normal file
@@ -0,0 +1 @@
|
||||
{}
|
||||
1
src/addon/d_store/locale/zh-Hans.json
Normal file
1
src/addon/d_store/locale/zh-Hans.json
Normal file
@@ -0,0 +1 @@
|
||||
{}
|
||||
@@ -0,0 +1,2 @@
|
||||
{}
|
||||
|
||||
279
src/addon/d_store/pages/detail.vue
Normal file
279
src/addon/d_store/pages/detail.vue
Normal file
@@ -0,0 +1,279 @@
|
||||
<template>
|
||||
|
||||
<view class="bg-[#fafafa] min-h-[100vh] " v-if="detailData">
|
||||
<view class="tk-card1">
|
||||
<u-swiper :list="detailData.banner" :indicator="true" :autoplay="true" height="480rpx" @click="swiperClick"
|
||||
radius="8"></u-swiper>
|
||||
</view>
|
||||
<view class="tk-card">
|
||||
<view class="title">{{detailData.name}}</view>
|
||||
<view class="text-xs text-[#868686]">{{detailData.desc}}</view>
|
||||
<view class="flex justify-between mt-1">
|
||||
<view class="flex items-center">
|
||||
<u-tag size="mini" bgColor="#6e6f59" borderColor="#867d44" :text="detailData.work_time"></u-tag>
|
||||
</view>
|
||||
</view>
|
||||
<view class="line-box mt-2 mb-2"></view>
|
||||
<view class="mt-1" v-if="detailData.contact_name!=''">
|
||||
<view class="font-bold">门店联系人</view>
|
||||
<view class="flex items-center ">
|
||||
<view class="text-slate-500 tk-sltext">{{detailData.contact_name}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view @click="telPhone(detailData.mobile)" class="mt-1">
|
||||
<view class="font-bold">门店电话</view>
|
||||
<view class="flex items-center ">
|
||||
<view class="text-slate-500 tk-sltext">{{detailData.mobile}}</view>
|
||||
<view class="flex items-center ml-2">
|
||||
<view>
|
||||
<u-icon name="phone" size="20" color="#252b34"></u-icon>
|
||||
</view>
|
||||
<view>
|
||||
拨打
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view @click="openMap(detailData.lat,detailData.lng)" class="flex items-center justify-between mt-1">
|
||||
<view class="w-70%">
|
||||
<view class="font-bold">门店地址</view>
|
||||
<view class="text-slate-500 mt-1">{{detailData.address}}</view>
|
||||
</view>
|
||||
<view class="flex w-[30%] justify-end">
|
||||
<view class="flex flex-col items-center ">
|
||||
<view>
|
||||
<u-icon name="map" size="22" color="#000000"></u-icon>
|
||||
</view>
|
||||
<view>地图</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="tk-card">
|
||||
<view class="mb-2 font-bold">门店详情</view>
|
||||
<u-parse :content="detailData.content"
|
||||
:tagStyle="{img: 'vertical-align: top;',p:'overflow: hidden;word-break:break-word;' }"></u-parse>
|
||||
</view>
|
||||
|
||||
<u-safe-bottom></u-safe-bottom>
|
||||
<view class="tab-bar-placeholder"></view>
|
||||
</view>
|
||||
|
||||
<tabbar addon="app" />
|
||||
<!-- #ifdef MP-WEIXIN -->
|
||||
<!-- 小程序隐私协议 -->
|
||||
<wx-privacy-popup ref="wxPrivacyPopup"></wx-privacy-popup>
|
||||
<!-- #endif -->
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, computed } from 'vue'
|
||||
import { useShare } from '@/hooks/useShare'
|
||||
import { getStoreInfo } from '@/addon/d_store/api/store'
|
||||
import { onLoad, onShow } from '@dcloudio/uni-app'
|
||||
import { useLogin } from '@/hooks/useLogin';
|
||||
import { imgListPreview, openMap, telPhone } from '@/addon/d_store/utils/ts/common'
|
||||
import useMemberStore from '@/stores/member'
|
||||
import { img, redirect, handleOnloadParams } from "@/utils/common";
|
||||
const tabshow = ref(true)
|
||||
const memberStore = useMemberStore()
|
||||
const userInfo = computed(() => memberStore.info)
|
||||
const { setShare, onShareAppMessage, onShareTimeline } = useShare()
|
||||
setShare();
|
||||
onShareAppMessage()
|
||||
onShareTimeline()
|
||||
const loading = ref(false)
|
||||
const detailData = ref()
|
||||
const getDetailInfoEvent = async (id) => {
|
||||
const res = await getStoreInfo(id)
|
||||
detailData.value = res.data
|
||||
detailData.value.banner.forEach((item, index) => {
|
||||
detailData.value.banner[index] = img(item)
|
||||
})
|
||||
}
|
||||
const swiperClick = (index) => {
|
||||
if (typeof index == 'number')
|
||||
imgListPreview(detailData.value.banner, index)
|
||||
}
|
||||
//预览图片
|
||||
const imgListPreview = (item : any, index : any) => {
|
||||
if (Array.isArray(item)) {
|
||||
if (!item.length) return false
|
||||
var urlList = item;
|
||||
uni.previewImage({
|
||||
indicator: "number",
|
||||
current: index,
|
||||
loop: true,
|
||||
urls: urlList
|
||||
})
|
||||
} else {
|
||||
if (item === '') return false
|
||||
var urlList = []
|
||||
urlList.push(img(item)) //push中的参数为 :src="item.img_url" 中的图片地址
|
||||
uni.previewImage({
|
||||
indicator: "number",
|
||||
loop: true,
|
||||
urls: urlList
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
onLoad((option) => {
|
||||
if (option.id) {
|
||||
getDetailInfoEvent(option.id)
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import '@/addon/d_store/utils/styles/common.scss';
|
||||
|
||||
|
||||
.b-tabbar {
|
||||
position: fixed;
|
||||
bottom: 12rpx;
|
||||
left: 0;
|
||||
right: 0;
|
||||
margin: 0rpx 24rpx;
|
||||
border-radius: 12rpx;
|
||||
padding: 12rpx;
|
||||
background: rgba(245, 250, 245, 0.8);
|
||||
}
|
||||
|
||||
|
||||
|
||||
.b-tabbar-back {
|
||||
background: rgba(245, 250, 245, 0.9);
|
||||
box-shadow: inset 2px 2px 4px rgba(0, 0, 0, 0.5), 2px 2px 4px rgba(0, 0, 0, 0.5);
|
||||
border-radius: 12rpx;
|
||||
}
|
||||
|
||||
page {
|
||||
background: white;
|
||||
padding-top: 24rpx;
|
||||
padding-bottom: calc((constant(safe-area-inset-bottom) / 2) + 128rpx);
|
||||
padding-bottom: calc((env(safe-area-inset-bottom) / 2) + 128rpx);
|
||||
}
|
||||
|
||||
swiper {
|
||||
margin: 0 30rpx;
|
||||
height: 565rpx;
|
||||
|
||||
swiper-item,
|
||||
image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border-radius: 20rpx;
|
||||
}
|
||||
|
||||
::v-deep .uni-swiper-dots {
|
||||
right: 30rpx;
|
||||
left: unset;
|
||||
transform: unset;
|
||||
}
|
||||
|
||||
::v-deep .uni-swiper-dot {
|
||||
width: 10rpx;
|
||||
height: 10rpx;
|
||||
background: rgba(255, 255, 255, 0.8);
|
||||
}
|
||||
|
||||
::v-deep .uni-swiper-dot-active {
|
||||
width: 27rpx;
|
||||
border-radius: 32rpx;
|
||||
background: white;
|
||||
}
|
||||
}
|
||||
|
||||
.title {
|
||||
color: #333333;
|
||||
font-weight: bold;
|
||||
font-size: 30rpx;
|
||||
}
|
||||
|
||||
.price {
|
||||
font-weight: bold;
|
||||
font-size: 36rpx;
|
||||
color: #FF3D3D;
|
||||
|
||||
&::before {
|
||||
font-size: 24rpx;
|
||||
content: '¥';
|
||||
}
|
||||
|
||||
&::after {
|
||||
font-size: 24rpx;
|
||||
content: '起';
|
||||
}
|
||||
}
|
||||
|
||||
.details {
|
||||
margin: 0 32rpx;
|
||||
padding: 30rpx;
|
||||
background: #F9F9F9;
|
||||
border-radius: 20rpx;
|
||||
font-size: 28rpx;
|
||||
color: #666666;
|
||||
line-height: 42rpx;
|
||||
margin-top: 28rpx;
|
||||
}
|
||||
|
||||
.bottom {
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
gap: 22rpx;
|
||||
width: 100vw;
|
||||
position: fixed;
|
||||
background: white;
|
||||
padding: 0 30rpx;
|
||||
padding-bottom: calc(constant(safe-area-inset-bottom) / 2);
|
||||
padding-bottom: calc(env(safe-area-inset-bottom) / 2);
|
||||
|
||||
.agency,
|
||||
.buy {
|
||||
flex: 1;
|
||||
height: 88rpx;
|
||||
margin: 10rpx 0;
|
||||
border-radius: 16rpx;
|
||||
border: 2rpx solid #2EA7E0;
|
||||
font-weight: bold;
|
||||
font-size: 32rpx;
|
||||
color: #2EA7E0;
|
||||
line-height: 88rpx;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.buy {
|
||||
color: white;
|
||||
background: #2EA7E0;
|
||||
}
|
||||
}
|
||||
|
||||
.tk-card1 {
|
||||
background-color: rgba(255, 255, 255, 0.9);
|
||||
margin: 24rpx;
|
||||
border-radius: 12rpx;
|
||||
|
||||
box-shadow: 0 1px 1px 0 rgba(234, 234, 234, 0.2), 0 2px 2px 0 rgba(231, 231, 231, 0.2);
|
||||
}
|
||||
|
||||
.tk-card {
|
||||
background-color: rgba(255, 255, 255, 0.9);
|
||||
margin: 24rpx;
|
||||
border-radius: 12rpx;
|
||||
padding: 24rpx;
|
||||
box-shadow: 0 1px 1px 0 rgba(234, 234, 234, 0.2), 0 2px 2px 0 rgba(231, 231, 231, 0.2);
|
||||
}
|
||||
|
||||
.tab-bar-placeholder {
|
||||
padding-bottom: calc(constant(safe-area-inset-bottom) + 100rpx);
|
||||
padding-bottom: calc(env(safe-area-inset-bottom) + 100rpx);
|
||||
}
|
||||
|
||||
.map-container {
|
||||
position: relative;
|
||||
z-index: 9999;
|
||||
/* 确保地图容器在最顶层 */
|
||||
}
|
||||
</style>
|
||||
226
src/addon/d_store/pages/index.vue
Normal file
226
src/addon/d_store/pages/index.vue
Normal file
@@ -0,0 +1,226 @@
|
||||
<template>
|
||||
<view class="detail-box">
|
||||
<view class="flex items-center mb-[16rpx] mt-[32rpx] flex-right justify-between mr-2">
|
||||
<view>
|
||||
<view class="ml-4 font-bold text-[36rpx]">附近门店 </view>
|
||||
</view>
|
||||
<view class="flex items-center" @click="locationVal.repositionFn()">
|
||||
<view class="text-[#4d5048]"> 当前位置: </view>
|
||||
<view class="text-[#4d5048] tk-sltext ml-1">
|
||||
{{
|
||||
!systemStore.currShippingAddress
|
||||
? "选择位置"
|
||||
: systemStore.currShippingAddress.community
|
||||
}}
|
||||
</view>
|
||||
<view>
|
||||
<u-icon name="arrow-right" color="#4d5048" size="18"></u-icon>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="tk-card fl items-center">
|
||||
<u-input clearable v-model="keyword" placeholder="输入门店名称快速搜索" @change="reload()"></u-input>
|
||||
</view>
|
||||
<view v-if="list && list.length > 0" class="tk-card" v-for="(item, index) in list">
|
||||
<view class="flex items-center" @click="redirect({ url: '/addon/d_store/pages/detail?id=' + item.id })">
|
||||
<view>
|
||||
<image style="
|
||||
width: 140rpx;
|
||||
height: 140rpx;
|
||||
background-color: #eeeeee;
|
||||
border-radius: 8px;
|
||||
" :src="img(item.logo)" mode="aspectFill"></image>
|
||||
</view>
|
||||
|
||||
<view class="flex flex-col ml-2 w-[100%] justify-between mb-2">
|
||||
<view class="font-bold tk-sltext">{{ item.name }}</view>
|
||||
<view class="text-xs text-slate-500 mb-2 tk-sltext">{{
|
||||
item.desc
|
||||
}}</view>
|
||||
<view class="flex justify-between">
|
||||
<view class="flex items-center">
|
||||
<u-tag size="mini" bgColor="#6e6f59" borderColor="#867d44" :text="item.work_time"></u-tag>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="line-box mt-2 mb-2"></view>
|
||||
<view @click="openMap(item.lat, item.lng)" class="flex justify-between mt-1">
|
||||
<view class="flex items-center w-[60%]">
|
||||
<view>
|
||||
<u-icon name="map" size="16" color="#64748B"></u-icon>
|
||||
</view>
|
||||
<view class="ml-1 text-slate-500 tk-sltext">{{ item.address }}</view>
|
||||
</view>
|
||||
<view class="flex items-center text-slate-600">
|
||||
距离{{ item.distance }}km
|
||||
</view>
|
||||
</view>
|
||||
<view @click="telPhone(item.mobile)" class="flex justify-between mt-1">
|
||||
<view class="flex items-center w-[60%]">
|
||||
<view>
|
||||
<u-icon name="phone" size="16" color="#64748B"></u-icon>
|
||||
</view>
|
||||
<view class="ml-1 text-slate-500 tk-sltext">{{ item.mobile }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<up-loading-icon class="mt-4 mb-4" :show="loading" mode="circle" inactive-color="#6e6f59"
|
||||
timing-function="linear"></up-loading-icon>
|
||||
<mescroll-empty :option="{ icon: img('static/resource/images/empty.png') }"
|
||||
v-if="!list.length && loading == false"></mescroll-empty>
|
||||
|
||||
<!-- #ifdef MP-WEIXIN -->
|
||||
<!-- 小程序隐私协议 -->
|
||||
<wx-privacy-popup ref="wxPrivacyPopup"></wx-privacy-popup>
|
||||
<!-- #endif -->
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, computed, watch } from "vue";
|
||||
import MescrollUni from "@/components/mescroll/mescroll-uni/mescroll-uni.vue";
|
||||
import MescrollBody from "@/components/mescroll/mescroll-body/mescroll-body.vue";
|
||||
import useMescroll from "@/components/mescroll/hooks/useMescroll.js";
|
||||
import MescrollEmpty from "@/components/mescroll/mescroll-empty/mescroll-empty.vue";
|
||||
import { onLoad, onShow, onPageScroll, onReachBottom } from "@dcloudio/uni-app";
|
||||
import useDiyStore from "@/app/stores/diy";
|
||||
import { img, redirect, handleOnloadParams } from "@/utils/common";
|
||||
const { mescrollInit, downCallback, getMescroll } = useMescroll();
|
||||
import { useShare } from "@/hooks/useShare";
|
||||
import { getStoreLists } from "@/addon/d_store/api/store";
|
||||
import {
|
||||
getLocationData,
|
||||
openMap,
|
||||
telPhone,
|
||||
} from "@/addon/d_store/utils/ts/common";
|
||||
const { setShare, onShareAppMessage, onShareTimeline } = useShare();
|
||||
import { useLogin } from "@/hooks/useLogin";
|
||||
import useMemberStore from "@/stores/member";
|
||||
import useSystemStore from "@/stores/system";
|
||||
const memberStore = useMemberStore();
|
||||
const userInfo = computed(() => memberStore.info);
|
||||
const systemStore = useSystemStore();
|
||||
import { getAddressByLatlng } from "@/app/api/system";
|
||||
import { useLocation } from "@/hooks/useLocation";
|
||||
const locationVal = useLocation(true);
|
||||
locationVal.onLoad();
|
||||
locationVal.initFn();
|
||||
const currentPosition = ref("定位中");
|
||||
const keyword = ref()
|
||||
let list = ref<Array<Object>>([]);
|
||||
let loading = ref<boolean>(false);
|
||||
|
||||
const locationData = ref(uni.getStorageSync(""));
|
||||
setShare();
|
||||
onShareAppMessage();
|
||||
onShareTimeline();
|
||||
const page = ref(1);
|
||||
const listData = ref([]);
|
||||
const getStoreListFn = () => {
|
||||
let location = getLocationData();
|
||||
if (!location) {
|
||||
location = uni.getStorageSync("location");
|
||||
}
|
||||
loading.value = true;
|
||||
let data : object = {
|
||||
page: page.value,
|
||||
lat: location.latitude,
|
||||
lng: location.longitude,
|
||||
name: keyword.value
|
||||
};
|
||||
console.log(data)
|
||||
getStoreLists(data)
|
||||
.then((res) => {
|
||||
let newArr = res.data.data as Array<Object>;
|
||||
if (newArr.length == 0) {
|
||||
loading.value = false;
|
||||
uni.showToast({
|
||||
title: "已经没有更多数据",
|
||||
icon: "none",
|
||||
});
|
||||
return;
|
||||
}
|
||||
loading.value = false;
|
||||
if (page.value == 1) {
|
||||
list.value = newArr;
|
||||
} else {
|
||||
list.value = list.value.concat(newArr);
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
loading.value = false;
|
||||
});
|
||||
};
|
||||
watch(
|
||||
() => systemStore.location,
|
||||
(nval, oval) => {
|
||||
if (nval.latitude && nval.longitude) {
|
||||
loading.value = true;
|
||||
listData.value = [];
|
||||
page.value = 1;
|
||||
getStoreListFn();
|
||||
} else {
|
||||
currentPosition.value = "定位中...";
|
||||
}
|
||||
},
|
||||
{ deep: true }
|
||||
);
|
||||
const reload = (e) => {
|
||||
loading.value = true;
|
||||
listData.value = []
|
||||
page.value = 1
|
||||
getStoreListFn();
|
||||
}
|
||||
onReachBottom(() => {
|
||||
page.value++;
|
||||
getStoreListFn();
|
||||
});
|
||||
|
||||
onLoad((option) => {
|
||||
if (uni.getStorageSync("addressByLatlng")) {
|
||||
currentPosition.value =
|
||||
uni.getStorageSync("addressByLatlng").formatted_addresses.recommend;
|
||||
}
|
||||
|
||||
getStoreListFn();
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import "@/addon/d_store/utils/styles/common.scss";
|
||||
|
||||
.tk-sltext {
|
||||
max-width: 200px; //也可以设置最大宽度
|
||||
overflow: hidden; // 溢出隐藏
|
||||
display: -webkit-box; // 自适应布局 弹性伸缩盒子
|
||||
-webkit-box-orient: vertical; //垂直排列子元素 伸缩盒子的子元素排列
|
||||
-webkit-line-clamp: 1; //最多显示几行 多出部分。。。显示
|
||||
text-overflow: ellipsis; // 显示省略号
|
||||
}
|
||||
|
||||
.class-select {
|
||||
position: relative;
|
||||
font-weight: bold;
|
||||
font-size: 28rpx;
|
||||
|
||||
&::after {
|
||||
content: "";
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
height: 8rpx;
|
||||
background-color: #fe6d3a;
|
||||
border-radius: 4rpx;
|
||||
width: 90%;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
}
|
||||
}
|
||||
|
||||
.map-container {
|
||||
position: relative;
|
||||
z-index: 9999;
|
||||
/* 确保地图容器在最顶层 */
|
||||
}
|
||||
</style>
|
||||
215
src/addon/d_store/utils/styles/common.scss
Normal file
215
src/addon/d_store/utils/styles/common.scss
Normal file
@@ -0,0 +1,215 @@
|
||||
page{
|
||||
background-color: #f5f6fa;
|
||||
@apply pt-4;
|
||||
}
|
||||
:root, page {
|
||||
--primary-color:#4277c7;
|
||||
--primary-color-dark: #F26F3E;
|
||||
--primary-color-disabled: #FFB397;
|
||||
--primary-color-light: #FFEAE2;
|
||||
--page-bg-color: #f7f7f7;
|
||||
--price-text-color: #e1251b;
|
||||
}
|
||||
.remove-border{
|
||||
&::after{
|
||||
border: none;
|
||||
}
|
||||
}
|
||||
.line-box {
|
||||
background-color: #e1e1e1;
|
||||
height: 2rpx;
|
||||
width: 100%;
|
||||
}L
|
||||
//css共用样式文件
|
||||
.fl{
|
||||
display: flex;
|
||||
}
|
||||
.fb{
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
.font-price{
|
||||
color: #19d444;
|
||||
font-size: 38rpx;
|
||||
font-weight: bold;
|
||||
}
|
||||
.tk-p{
|
||||
color: #19d444;
|
||||
font-size: 18rpx;
|
||||
}
|
||||
.tk{
|
||||
background: linear-gradient(-90deg, #67c6d0 0%, #19d444 100%);
|
||||
color: #ffffff;
|
||||
padding: 0rpx 38rpx;
|
||||
border-radius: 8rpx;
|
||||
margin-right: 48rpx;
|
||||
line-height:54rpx;
|
||||
}
|
||||
.tk-btgo{
|
||||
background: linear-gradient(-90deg, #67c6d0 0%, #19d444 100%);
|
||||
color: #ffffff;
|
||||
border-radius: 8rpx;
|
||||
margin-right: 48rpx;
|
||||
text-align: center;
|
||||
line-height: 80rpx;
|
||||
}
|
||||
.tk-desc{
|
||||
color: #4b4b4b;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
.tktype-tag{
|
||||
padding: 4rpx 8rpx;
|
||||
background: linear-gradient(-90deg, #2b2b00 0%, #353528 100%);
|
||||
color: aliceblue;
|
||||
border-radius: 8rpx;
|
||||
font-size: 22rpx;
|
||||
}
|
||||
.tk-tag{
|
||||
padding: 4rpx 8rpx;
|
||||
background: linear-gradient(-90deg, #4596ff 30%, #3363e7 100%);
|
||||
color: #ffffff;
|
||||
border-radius: 8rpx;
|
||||
font-size: 22rpx;
|
||||
}
|
||||
.tk-dsale{
|
||||
font-size:24rpx;
|
||||
color: #8f8f8f;
|
||||
}
|
||||
.tk-dtext{
|
||||
font-size:32rpx;
|
||||
font-weight: bold;
|
||||
// width: 640rpx; //设置宽度
|
||||
// // max-width:200px; //也可以设置最大宽度
|
||||
// overflow : hidden; // 溢出隐藏
|
||||
// display: -webkit-box; // 自适应布局 弹性伸缩盒子
|
||||
// -webkit-box-orient: vertical; //垂直排列子元素 伸缩盒子的子元素排列
|
||||
// -webkit-line-clamp: 1; //最多显示几行 多出部分。。。显示
|
||||
// text-overflow: ellipsis; // 显示省略号
|
||||
}
|
||||
.tk-sltext{
|
||||
// max-width:200px; //也可以设置最大宽度
|
||||
overflow : hidden; // 溢出隐藏
|
||||
display: -webkit-box; // 自适应布局 弹性伸缩盒子
|
||||
-webkit-box-orient: vertical; //垂直排列子元素 伸缩盒子的子元素排列
|
||||
-webkit-line-clamp: 1; //最多显示几行 多出部分。。。显示
|
||||
text-overflow: ellipsis; // 显示省略号
|
||||
}
|
||||
.tk-text{
|
||||
width: 420rpx; //设置宽度
|
||||
// max-width:200px; //也可以设置最大宽度
|
||||
overflow : hidden; // 溢出隐藏
|
||||
display: -webkit-box; // 自适应布局 弹性伸缩盒子
|
||||
-webkit-box-orient: vertical; //垂直排列子元素 伸缩盒子的子元素排列
|
||||
-webkit-line-clamp: 1; //最多显示几行 多出部分。。。显示
|
||||
text-overflow: ellipsis; // 显示省略号
|
||||
}
|
||||
.tk-card{
|
||||
background-color: rgba(255, 255, 255, 0.9);
|
||||
margin: 24rpx;
|
||||
border-radius: 12rpx;
|
||||
padding: 24rpx;
|
||||
box-shadow: 0 1px 1px 0 rgba(234, 234, 234, 0.2), 0 2px 2px 0 rgba(231, 231, 231, 0.2);
|
||||
}
|
||||
.tk-bottom{
|
||||
position: fixed;
|
||||
width: 100%;
|
||||
bottom:0px;
|
||||
z-index:9999;
|
||||
padding: 0rpx 0rpx 24rpx 24rpx;
|
||||
padding-bottom: 0;
|
||||
padding-bottom: constant(safe-area-inset-bottom);
|
||||
padding-bottom: env(safe-area-inset-bottom);
|
||||
background-color: rgba(250, 250, 250, 0.96);
|
||||
border-top-left-radius:24rpx;
|
||||
border-top-right-radius:24rpx;
|
||||
}
|
||||
.tk-top{
|
||||
height: 110rpx;
|
||||
background-color: rgba(250, 250, 250, 0.0);
|
||||
}
|
||||
.tk-yc{
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
}
|
||||
.tk-title{
|
||||
font-size: 32rpx;
|
||||
font-weight: bold;
|
||||
text-align: center;
|
||||
}
|
||||
.tk-b-bottom{
|
||||
padding-bottom: 18rpx;
|
||||
border-bottom-style: solid;
|
||||
border-bottom-width: 1rpx;
|
||||
border-bottom-color: rgba(165, 165, 165, 0.2);
|
||||
}
|
||||
.tk-bbut{
|
||||
background: linear-gradient(-90deg, #4d84dc 0%, #3b46e8 100%);
|
||||
text-align: center;
|
||||
width: 680rpx;
|
||||
border-radius: 12rpx;
|
||||
color: #ffffff;
|
||||
font-size: 32rpx;
|
||||
padding: 16rpx;
|
||||
margin-top: 8rpx;
|
||||
margin-bottom: 8rpx;
|
||||
margin-left: 12rpx;
|
||||
}
|
||||
.tk-column{
|
||||
display: flex;flex-direction: column;justify-content: space-between;
|
||||
}
|
||||
.tk-end{
|
||||
justify-content: flex-end;
|
||||
}
|
||||
.tk-orderbtn{
|
||||
padding: 4rpx 8rpx;
|
||||
background: linear-gradient(-90deg, rgba(33, 120, 86, 0.6) 0%, rgba(27, 88, 53, 0.6) 100%);
|
||||
color: aliceblue;
|
||||
border-radius: 8rpx;
|
||||
font-size: 22rpx;
|
||||
}
|
||||
.tagsmall {
|
||||
background: linear-gradient(-90deg, rgba(33, 120, 86, 0.6) 0%, rgba(27, 88, 53, 0.6) 100%);
|
||||
color: #ffffff;
|
||||
padding: 4rpx 8rpx;
|
||||
border-radius: 4rpx;
|
||||
}
|
||||
.tk-left{
|
||||
padding-left: 24rpx;
|
||||
padding-top: 24rpx;
|
||||
padding-right: 24rpx;
|
||||
}
|
||||
.font-weight{
|
||||
font-weight: bold;
|
||||
}
|
||||
.tk-bluecolor{
|
||||
color: #1723cb;
|
||||
}
|
||||
.tk-balackcolor{
|
||||
color: #878787;
|
||||
}
|
||||
.text-center{
|
||||
text-align: center;
|
||||
}
|
||||
.common-button {
|
||||
background: linear-gradient(-90deg, #67c6d0 0%, #19d444 100%);
|
||||
text-align: center;
|
||||
border-radius: 24rpx;
|
||||
color: #ffffff;
|
||||
font-size: 28rpx;
|
||||
padding: 16rpx;
|
||||
margin: 24rpx;
|
||||
margin-top: 48rpx;
|
||||
}
|
||||
.tk-butto {
|
||||
background: linear-gradient(-90deg, #4d84dc 0%, #3b46e8 100%);
|
||||
text-align: center;
|
||||
width: 690rpx;
|
||||
border-radius: 12rpx;
|
||||
color: #ffffff;
|
||||
font-size: 32rpx;
|
||||
padding: 16rpx;
|
||||
margin-top: 48rpx;
|
||||
margin-bottom: 16rpx;
|
||||
margin-left: 12rpx;
|
||||
}
|
||||
9
src/addon/d_store/utils/theme.json
Normal file
9
src/addon/d_store/utils/theme.json
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"--primary-color": "#FF4142",
|
||||
"--primary-help-color": "#FB7939",
|
||||
"--primary-color-dark": "#F26F3E",
|
||||
"--primary-color-disabled": "#FFB397",
|
||||
"--primary-color-light": "#FFF4F4",
|
||||
"--page-bg-color": "#f7f7f7",
|
||||
"--price-text-color": "#FF4142"
|
||||
}
|
||||
132
src/addon/d_store/utils/ts/common.ts
Normal file
132
src/addon/d_store/utils/ts/common.ts
Normal file
@@ -0,0 +1,132 @@
|
||||
import { img, getToken } from '@/utils/common'
|
||||
|
||||
import { getAddressByLatlng } from "@/app/api/system";
|
||||
import useSystemStore from "@/stores/system";
|
||||
const systemStore = useSystemStore();
|
||||
import { useLogin } from "@/hooks/useLogin";
|
||||
/**
|
||||
* 获取定位信息
|
||||
*/
|
||||
const getLocation = (param : any = {}) => {
|
||||
uni.getLocation({
|
||||
type: param.type || 'gcj02',
|
||||
success: res => {
|
||||
const systemStore = useSystemStore()
|
||||
systemStore.setLocation(res);
|
||||
typeof param.success == 'function' && param.success(res);
|
||||
},
|
||||
fail: res => {
|
||||
typeof param.fail == 'function' && param.fail(res);
|
||||
},
|
||||
complete: res => {
|
||||
typeof param.complete == 'function' && param.complete(res);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
export function authLogin() {
|
||||
if (!getToken()) {
|
||||
const login = useLogin();
|
||||
// 第三方平台自动登录
|
||||
// #ifdef MP
|
||||
login.getAuthCode();
|
||||
// #endif
|
||||
// #ifdef H5
|
||||
useLogin().setLoginBack({ url: '/addon/tk_cps/pages/diy' })
|
||||
// #endif
|
||||
}
|
||||
return true //自动进行登录
|
||||
}
|
||||
export function dateChange(date) {
|
||||
return new Date(date).getTime() // 将日期值转换为时间戳
|
||||
}
|
||||
export function timeChange(timestamp) {
|
||||
const date = new Date(timestamp * 1000);
|
||||
const year = date.getFullYear();
|
||||
const month = date.getMonth() + 1;
|
||||
const day = date.getDate();
|
||||
const hours = date.getHours();
|
||||
const minutes = date.getMinutes();
|
||||
const seconds = date.getSeconds();
|
||||
return `${hours}:${minutes}`;
|
||||
}
|
||||
export function timeChangeDay(timestamp) {
|
||||
const date = new Date(timestamp * 1000);
|
||||
const year = date.getFullYear();
|
||||
const month = date.getMonth() + 1;
|
||||
const day = date.getDate();
|
||||
const hours = date.getHours();
|
||||
const minutes = date.getMinutes();
|
||||
const seconds = date.getSeconds();
|
||||
return `${day} ${hours}:${minutes}`;
|
||||
}
|
||||
|
||||
export function getLocationData() {
|
||||
const data = uni.getStorageSync('location')
|
||||
|
||||
if (data) {
|
||||
return data
|
||||
}
|
||||
else {
|
||||
getLocation()
|
||||
let e = uni.getStorageSync('location')
|
||||
let data = {
|
||||
latlng: ''
|
||||
};
|
||||
if (e.latitude && e.longitude) {
|
||||
data.latlng = e.latitude + ',' + e.longitude
|
||||
getAddressByLatlng(data).then((res : any) => {
|
||||
if (res.data && Object.keys(res.data).length) {
|
||||
uni.setStorageSync('addressByLatlng', res.data);
|
||||
return e
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
export function telPhone(phone) {
|
||||
uni.makePhoneCall({
|
||||
phoneNumber: phone
|
||||
})
|
||||
}
|
||||
export function openMap(lat, lng) {
|
||||
uni.openLocation({
|
||||
latitude: parseFloat(lat),
|
||||
longitude: parseFloat(lng),
|
||||
success: function () {
|
||||
console.log('success');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
export function imgListPreview(item, index) {
|
||||
if (Array.isArray(item)) {
|
||||
// 检查数组是否为空
|
||||
if (!item.length) return false;
|
||||
|
||||
// 使用map方法代替forEach,这样可以返回一个新的数组
|
||||
const urlList = item.map(img);
|
||||
|
||||
// 使用uni-app的previewImage方法预览图片
|
||||
uni.previewImage({
|
||||
indicator: "number",
|
||||
current: index, // 确保index在item数组的范围内
|
||||
loop: true,
|
||||
urls: urlList
|
||||
});
|
||||
} else {
|
||||
// 检查item是否为空字符串
|
||||
if (item === '') return false;
|
||||
|
||||
// 创建包含单个图片URL的数组
|
||||
const urlList = [img(item)];
|
||||
|
||||
// 使用uni-app的previewImage方法预览单个图片
|
||||
uni.previewImage({
|
||||
indicator: "number",
|
||||
loop: true,
|
||||
urls: urlList
|
||||
});
|
||||
}
|
||||
}
|
||||
11
src/addon/d_store/utils/ts/goto.ts
Normal file
11
src/addon/d_store/utils/ts/goto.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
export async function goto(url : string) {
|
||||
uni.navigateTo({
|
||||
url: url
|
||||
})
|
||||
}
|
||||
export async function gotourl(url : string) {
|
||||
console.log('goto跳转网站测试')
|
||||
}
|
||||
export async function goback() {
|
||||
uni.navigateBack()
|
||||
}
|
||||
22
src/addon/dailySignIn/api/signin.ts
Normal file
22
src/addon/dailySignIn/api/signin.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 签到是否开启
|
||||
export function getSignState() {
|
||||
return request.get(`dailysignin/isSignInOpen`)
|
||||
}
|
||||
//获取签到规则
|
||||
export function getSignInAwardRules() {
|
||||
return request.get(`dailysignin/rewardRules`)
|
||||
}
|
||||
//获取累加之和
|
||||
export function getAccumulationSum(data : AnyObject) {
|
||||
return request.get(`dailysignin/sum`,data)
|
||||
}
|
||||
//是否已签到
|
||||
export function checkSignInStatusApi(){
|
||||
return request.get(`/dailysignin/checkSignInStatus`)
|
||||
}
|
||||
//签到
|
||||
export function signinApi() {
|
||||
return request.post(`dailysignin/signIn`)
|
||||
}
|
||||
1
src/addon/dailySignIn/locale/en.json
Normal file
1
src/addon/dailySignIn/locale/en.json
Normal file
@@ -0,0 +1 @@
|
||||
{}
|
||||
1
src/addon/dailySignIn/locale/zh-Hans.json
Normal file
1
src/addon/dailySignIn/locale/zh-Hans.json
Normal file
@@ -0,0 +1 @@
|
||||
{}
|
||||
@@ -0,0 +1,2 @@
|
||||
{}
|
||||
|
||||
854
src/addon/dailySignIn/pages/signIn/index.vue
Normal file
854
src/addon/dailySignIn/pages/signIn/index.vue
Normal file
@@ -0,0 +1,854 @@
|
||||
<template>
|
||||
<view class="signin" :style="themeColor()">
|
||||
<u-loading-page :loading="loading" loadingText="" bg-color="#f7f7f7"></u-loading-page>
|
||||
<view v-show="!loading">
|
||||
<block v-if="signInData.signState">
|
||||
<view class="sigin-box">
|
||||
<view class="sigin-bg"></view>
|
||||
<view class="signin-wrap">
|
||||
<view class="member-info">
|
||||
<view class="headimg">
|
||||
<view class="headimg-img" v-if="signInData.headimg">
|
||||
<u-avatar :src="img(signInData.headimg)" :size="'100rpx'" leftIcon="none"></u-avatar>
|
||||
</view>
|
||||
<view v-else class="headimg-img">
|
||||
<u-avatar src="" :size="'100rpx'"></u-avatar>
|
||||
</view>
|
||||
<view class="signin-info">
|
||||
<view>
|
||||
已连续签到
|
||||
<text>{{ signInData.signDaysSeries }}</text>
|
||||
天
|
||||
</view>
|
||||
<view
|
||||
>{{ signInData.hasSign ? "明日" : "今日" }}签到可获得{{
|
||||
pointTomorrow
|
||||
}}积分</view
|
||||
>
|
||||
</view>
|
||||
</view>
|
||||
<view class="point-box" @click="signIn()">
|
||||
<image
|
||||
:src="
|
||||
img(
|
||||
signInData.hasSign == 1
|
||||
? '/addon/dailySignIn/signin/sign-btn-res.png'
|
||||
: '/addon/dailySignIn/signin/sign-btn.png'
|
||||
)
|
||||
"
|
||||
mode="widthFix"
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
<view class="signin-days-wrap">
|
||||
<view class="signin-desc">连续签到领好礼</view>
|
||||
<view class="signin-day-list">
|
||||
<view class="signin-day-con">
|
||||
<view class="signin-day-scroll">
|
||||
<block v-for="(item, index) in signInData.showSignDays">
|
||||
<view
|
||||
v-if="!item.is_last"
|
||||
:id="'id_' + item.day"
|
||||
class="signin-day-item"
|
||||
:class="{
|
||||
signed:
|
||||
item.day < signInData.signDaysSeries ||
|
||||
(item.day == signInData.signDaysSeries &&
|
||||
signInData.hasSign == 0) ||
|
||||
(item.day == signInData.signDaysSeries &&
|
||||
signInData.hasSign == 1),
|
||||
}"
|
||||
>
|
||||
<view class="day">第{{ item.day }}天</view>
|
||||
<image
|
||||
:src="img('/addon/dailySignIn/signin/sign-icon.png')"
|
||||
></image>
|
||||
<view class="point">{{ item.point }}积分</view>
|
||||
</view>
|
||||
<view
|
||||
v-else
|
||||
:id="'id_' + item.day"
|
||||
class="signin-day-item last"
|
||||
:class="{
|
||||
signed:
|
||||
item.day < signInData.signDaysSeries ||
|
||||
(item.day == signInData.signDaysSeries &&
|
||||
signInData.hasSign == 0) ||
|
||||
(item.day == signInData.signDaysSeries &&
|
||||
signInData.hasSign == 1),
|
||||
}"
|
||||
>
|
||||
<view>
|
||||
<view class="day">第{{ item.day }}天</view>
|
||||
<view class="point">{{ item.point }}积分</view>
|
||||
</view>
|
||||
<image
|
||||
:src="img('/addon/dailySignIn/signin/sign-box.png')"
|
||||
mode="widthFix"
|
||||
/>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="my-signin">
|
||||
<view class="my-signin-title">我的签到</view>
|
||||
<view class="my-signin-con">
|
||||
<view class="my-signin-item">
|
||||
<image
|
||||
:src="img('/addon/dailySignIn/signin/sign-bg-yellow.png')"
|
||||
></image>
|
||||
<view class="my-signin-item-num"
|
||||
>积分:{{ signInData.signPoint }}</view
|
||||
>
|
||||
<view>累计获得积分</view>
|
||||
</view>
|
||||
<view class="my-signin-item">
|
||||
<image
|
||||
:src="img('/addon/dailySignIn/signin/sign-bg-pink.png')"
|
||||
></image>
|
||||
<view class="my-signin-item-num"
|
||||
>成长值:{{ signInData.signGrowth }}</view
|
||||
>
|
||||
<view>累计获得成长值</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="signin-rule">
|
||||
<view class="signin-rule-title">签到规则</view>
|
||||
<view class="signin-rule-con">
|
||||
<view
|
||||
class="rule-item"
|
||||
v-for="(item, index) in signInData.rule"
|
||||
:key="index"
|
||||
>
|
||||
<block v-if="index == 0">1. 每日签到奖励:</block>
|
||||
<block v-else>{{
|
||||
index + 1 + ". 连续签到" + item.day + "天额外奖励:"
|
||||
}}</block>
|
||||
<text v-if="item.point">{{ item.point + "积分 " }}</text>
|
||||
<text v-if="item.growth">{{ item.growth + "成长值" }}</text>
|
||||
</view>
|
||||
|
||||
<view class="rule-item">
|
||||
{{ signInData.rule.length + 1 }}.连续签到{{
|
||||
signInData.cycle
|
||||
}}天为一个周期,连续签到天数签满一个周期或者签到中断,将清空连签天数重新计算签到天数
|
||||
</view>
|
||||
<view class="rule-item">
|
||||
{{ signInData.rule.length + 2 }}.
|
||||
用户可在签到页每日签到一次,签到后可获得每日签到奖励;连续签到天数达到连签奖励的当天,可额外获得连签奖励
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view @touchmove.prevent.stop>
|
||||
<up-popup
|
||||
:show="show"
|
||||
@close="close"
|
||||
@open="open"
|
||||
mode="center"
|
||||
:round="20"
|
||||
bgColor="transparent"
|
||||
>
|
||||
<view class="popup-box" @click="close()">
|
||||
<text class="iconfont icon-close" @click="close()"></text>
|
||||
<image
|
||||
class="pic"
|
||||
:src="img('/addon/dailySignIn/signin/bg1.png')"
|
||||
></image>
|
||||
<view class="popup-content">
|
||||
<view class="popup-content-wrap">
|
||||
<view
|
||||
class="title"
|
||||
v-if="
|
||||
signInData.successTip.point || signInData.successTip.growth
|
||||
"
|
||||
>
|
||||
<text>恭喜您获得</text>
|
||||
<text v-if="signInData.successTip.point">
|
||||
<text class="num u-success-dark">{{
|
||||
signInData.successTip.point
|
||||
}}</text>
|
||||
积分
|
||||
</text>
|
||||
<text v-if="signInData.successTip.growth">
|
||||
<text class="num u-success-dark">{{
|
||||
signInData.successTip.growth
|
||||
}}</text>
|
||||
成长值
|
||||
</text>
|
||||
</view>
|
||||
<view class="desc">连续签到可获得更多奖励!</view>
|
||||
</view>
|
||||
<view class="other-info u-success-dark-bg" @click="close()"
|
||||
>知道了</view
|
||||
>
|
||||
</view>
|
||||
</view>
|
||||
</up-popup>
|
||||
</view>
|
||||
</block>
|
||||
<block v-else>
|
||||
<up-empty text="暂未开启签到奖励" class="up-empty"></up-empty>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import {img, isWeixinBrowser, redirect} from "@/utils/common";
|
||||
import useMemberStore from "@/stores/member";
|
||||
import { computed, ref } from "vue";
|
||||
import { onLoad, onShow } from "@dcloudio/uni-app";
|
||||
import { inArray } from "@/addon/dailySignIn/utils/utils";
|
||||
import {
|
||||
checkSignInStatusApi,
|
||||
getAccumulationSum,
|
||||
getSignInAwardRules,
|
||||
getSignState,
|
||||
signinApi,
|
||||
} from "@/addon/dailySignIn/api/signin";
|
||||
const signInData = ref({
|
||||
showSignDays: [{}], // 一共展示的天数
|
||||
rule: [{}],
|
||||
hasSign: 0, //今天是否签到
|
||||
signDaysSeries: 0, //连续签到次数
|
||||
MonthData: [], //本月日期信息
|
||||
signList: [],
|
||||
back: "", //返回页
|
||||
redirect: "", //返回方式
|
||||
successTip: {},
|
||||
startDate: null,
|
||||
endDate: null,
|
||||
isActive: "", //判断点击
|
||||
signState: 1,
|
||||
headimg: "",
|
||||
point: 0,
|
||||
growth: 0,
|
||||
signPoint: 0,
|
||||
signGrowth: 0,
|
||||
rewardRuleDay: [],
|
||||
cycle: 0,
|
||||
reward: {},
|
||||
});
|
||||
//弹出层组件 ref
|
||||
const show = ref(false);
|
||||
|
||||
const loading = ref(false);
|
||||
|
||||
// 会员信息
|
||||
const memberInfo = computed(() => useMemberStore().info);
|
||||
|
||||
const onLoadSignIn = () => {
|
||||
signInData.value.headimg = signInData.value.headimg !="" ?memberInfo.value.headimg:""
|
||||
setTimeout(() => {
|
||||
if (!memberInfo.value) {
|
||||
setTimeout(() => {
|
||||
redirect({ url: "/app/pages/member/index" });
|
||||
}, 1000)
|
||||
}
|
||||
}, 1000)
|
||||
}
|
||||
const onShowSignIn = () => {
|
||||
getSignStateData()
|
||||
getRule();
|
||||
getSignPointData();
|
||||
getSignGrowthData();
|
||||
checkSignInStatus();
|
||||
};
|
||||
|
||||
// 获取签到累积积分
|
||||
const getSignPointData = () => {
|
||||
getAccumulationSum({
|
||||
accountType: "point",
|
||||
fromType: "dailySignIn",
|
||||
}).then((res) => {
|
||||
if (res.code == 1) {
|
||||
signInData.value.signPoint = res.data;
|
||||
}
|
||||
});
|
||||
};
|
||||
// 获取签到累积成长值
|
||||
const getSignGrowthData = () => {
|
||||
getAccumulationSum({
|
||||
accountType: "growth",
|
||||
fromType: "dailySignIn",
|
||||
}).then((res) => {
|
||||
if (res.code == 1) {
|
||||
signInData.value.signGrowth = res.data;
|
||||
}
|
||||
});
|
||||
};
|
||||
//判断当前是否签到
|
||||
const checkSignInStatus = () => {
|
||||
checkSignInStatusApi().then((res) => {
|
||||
if (res.code == 1) {
|
||||
signInData.value.hasSign = res.data.isSign;
|
||||
signInData.value.signDaysSeries = res.data.consecutiveDays;
|
||||
}
|
||||
});
|
||||
};
|
||||
// 签到是否开启
|
||||
const getSignStateData = () => {
|
||||
getSignState().then((res) => {
|
||||
signInData.value.signState = res.data.status
|
||||
getRule();
|
||||
getSignPointData();
|
||||
getSignGrowthData();
|
||||
});
|
||||
};
|
||||
//获取rule
|
||||
const getRule = () => {
|
||||
loading.value = true;
|
||||
getSignInAwardRules().then((res) => {
|
||||
if (res.code == 1) {
|
||||
let default_point = 0;
|
||||
signInData.value.cycle = res.data.cycle || 0;
|
||||
signInData.value.rule = res.data.data || [];
|
||||
if (signInData.value.rule.length > 0) {
|
||||
signInData.value.rule.forEach((item, index) => {
|
||||
if (item.day == 1) {
|
||||
default_point = item.point;
|
||||
} else {
|
||||
signInData.value.rewardRuleDay.push(parseInt(item.day));
|
||||
signInData.value.reward[item.day] = item.point;
|
||||
}
|
||||
});
|
||||
}
|
||||
//展示7天
|
||||
var showSignDays = [];
|
||||
var start_day = 1;
|
||||
var end_day = 7;
|
||||
var total_day = res.data.cycle;
|
||||
if (signInData.value.signDaysSeries > 5) {
|
||||
start_day = signInData.value.signDaysSeries - 5;
|
||||
}
|
||||
if (total_day >= signInData.value.signDaysSeries + 1) {
|
||||
end_day = signInData.value.signDaysSeries + 1;
|
||||
}
|
||||
if (signInData.value.signDaysSeries <= 5) {
|
||||
end_day = 8 - start_day;
|
||||
}
|
||||
if (end_day - start_day < 7 && total_day >= start_day + 6) {
|
||||
end_day = start_day + 6;
|
||||
}
|
||||
if (total_day == signInData.value.signDaysSeries) {
|
||||
start_day = signInData.value.signDaysSeries - 6;
|
||||
end_day = signInData.value.signDaysSeries;
|
||||
}
|
||||
for (let i = 1; i <= res.data.cycle; i++) {
|
||||
if (i >= start_day && i <= end_day) {
|
||||
showSignDays.push({
|
||||
day: i,
|
||||
is_last: 0,
|
||||
point: default_point,
|
||||
});
|
||||
}
|
||||
}
|
||||
if (showSignDays && showSignDays.length) {
|
||||
showSignDays[showSignDays.length - 1]["is_last"] = 1;
|
||||
}
|
||||
for (let i in showSignDays) {
|
||||
let item = showSignDays[i];
|
||||
if (inArray(item.day, signInData.value.rewardRuleDay) != -1) {
|
||||
showSignDays[i]["point"] =
|
||||
parseInt(signInData.value.reward[item.day]) +
|
||||
parseInt(default_point);
|
||||
}
|
||||
}
|
||||
signInData.value.showSignDays = showSignDays;
|
||||
loading.value = false;
|
||||
}
|
||||
});
|
||||
};
|
||||
//签到
|
||||
const signIn = () => {
|
||||
if (signInData.value.signState == 0) {
|
||||
uni.showToast({
|
||||
title: "签到未开启",
|
||||
});
|
||||
return false
|
||||
}
|
||||
if (!signInData.value.hasSign && signInData.value.signState == 1) {
|
||||
signinApi().then((res) => {
|
||||
if (res.code == 1) {
|
||||
signInData.value.successTip = res.data[0];
|
||||
// 打开弹出层
|
||||
show.value = true;
|
||||
getRule();
|
||||
getSignPointData();
|
||||
getSignGrowthData();
|
||||
signInData.value.hasSign = 1;
|
||||
signInData.value.signDaysSeries = signInData.value.signDaysSeries + 1;
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: res.message,
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
const pointTomorrow = computed(() => {
|
||||
var signDaysSeries = signInData.value.signDaysSeries + 1;
|
||||
var point = signInData.value.rule[0].point
|
||||
? parseInt(signInData.value.rule[0].point)
|
||||
: 0;
|
||||
for (let i = 1; i < signInData.value.rule.length; i++) {
|
||||
let reward = signInData.value.rule[i];
|
||||
if (reward.day == signDaysSeries && reward.point)
|
||||
point += parseInt(reward.point);
|
||||
}
|
||||
return point;
|
||||
});
|
||||
const open = () => {
|
||||
show.value = true;
|
||||
};
|
||||
const close = () => {
|
||||
show.value = false;
|
||||
};
|
||||
// const infoFill = ref(false)
|
||||
// const clickAvatar = () => {
|
||||
// // #ifdef MP-WEIXIN
|
||||
// infoFill.value.show = true
|
||||
// // #endif
|
||||
//
|
||||
// // #ifdef H5
|
||||
// if (isWeixinBrowser()) {
|
||||
// useLogin().getAuthCode('snsapi_userinfo')
|
||||
// } else {
|
||||
// redirect({ url: '/app/pages/member/personal' })
|
||||
// }
|
||||
// // #endif
|
||||
// }
|
||||
const onShareAppMessage = ()=>{
|
||||
var path = '/addon/dailySignIn/pages/signIn/index';
|
||||
return {
|
||||
title: '签到有礼,天天签到,积分好礼送不停',
|
||||
imageUrl: '',
|
||||
path: path,
|
||||
success: res => {},
|
||||
fail: res => {},
|
||||
complete: res => {}
|
||||
};
|
||||
}
|
||||
onLoad(() => {
|
||||
onLoadSignIn()
|
||||
onShowSignIn()
|
||||
});
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
uni-page-body,
|
||||
uni-page-refresh {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.signin {
|
||||
position: relative;
|
||||
height: 100%;
|
||||
|
||||
.head-nav {
|
||||
width: 100%;
|
||||
height: var(--status-bar-height);
|
||||
}
|
||||
|
||||
.head-nav.active {
|
||||
padding-top: 40rpx;
|
||||
}
|
||||
|
||||
.sigin-box {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.sigin-bg {
|
||||
width: 100%;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
z-index: 1;
|
||||
background: linear-gradient(136deg, #fe7849 0%, #ff1959 100%);
|
||||
height: 500rpx;
|
||||
border-radius: 0 0 100% 100%/0 0 20% 20%;
|
||||
|
||||
image {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.signin-wrap {
|
||||
padding: 0 30rpx;
|
||||
}
|
||||
|
||||
.member-info {
|
||||
position: relative;
|
||||
z-index: 9;
|
||||
padding: 74rpx 0 55rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
|
||||
.headimg {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
.headimg-img {
|
||||
width: 100rpx;
|
||||
height: 100rpx;
|
||||
background: #fff;
|
||||
border: 0px solid #fff;
|
||||
border-radius: 50%;
|
||||
overflow: hidden;
|
||||
margin-right: 20rpx;
|
||||
|
||||
image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.signin-info {
|
||||
view {
|
||||
color: #ffffff;
|
||||
font-size: 24rpx;
|
||||
line-height: 1;
|
||||
|
||||
&:first-child {
|
||||
margin-bottom: 18rpx;
|
||||
font-size: 32rpx;
|
||||
font-weight: bold;
|
||||
|
||||
text {
|
||||
margin: 0 9rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.point-box {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
height: 68rpx;
|
||||
padding: 13rpx 0 13rpx 0;
|
||||
box-sizing: border-box;
|
||||
|
||||
image {
|
||||
width: 160rpx;
|
||||
height: 68rpx;
|
||||
max-height: 80rpx;
|
||||
margin-bottom: -6rpx;
|
||||
}
|
||||
|
||||
.point {
|
||||
margin-left: 14rpx;
|
||||
font-size: 32rpx;
|
||||
color: #ffffff;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.signin-days-wrap {
|
||||
position: relative;
|
||||
z-index: 9;
|
||||
background-color: #ffffff;
|
||||
border-radius: 18rpx;
|
||||
padding: 30rpx 0 30rpx;
|
||||
height: 468rpx;
|
||||
|
||||
.signin-desc {
|
||||
font-size: 32rpx;
|
||||
font-weight: bold;
|
||||
line-height: 1;
|
||||
padding: 0 30rpx;
|
||||
}
|
||||
|
||||
.signin-day-list {
|
||||
margin-top: 30rpx;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
padding: 0 30rpx;
|
||||
|
||||
.signin-day-con {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.signin-day-scroll {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
width: 100%;
|
||||
flex-direction: row;
|
||||
white-space: nowrap;
|
||||
line-height: 1;
|
||||
|
||||
.signin-day-item {
|
||||
flex-shrink: 0;
|
||||
background: #f5f6fa;
|
||||
margin-right: 30rpx;
|
||||
width: calc((100% - 90rpx) / 4);
|
||||
height: 155rpx;
|
||||
border-radius: 18rpx;
|
||||
margin-bottom: 24rpx;
|
||||
|
||||
&:last-child {
|
||||
margin-right: 0;
|
||||
width: calc((100% - 30rpx) / 2);
|
||||
}
|
||||
|
||||
&:nth-child(4n) {
|
||||
margin-right: 0;
|
||||
}
|
||||
|
||||
image {
|
||||
width: 60rpx;
|
||||
height: 60rpx;
|
||||
margin-top: 10rpx;
|
||||
}
|
||||
|
||||
&.signed {
|
||||
background: linear-gradient(136deg, #fe7849 0%, #ff1959 100%);
|
||||
|
||||
view {
|
||||
color: #ffffff;
|
||||
}
|
||||
}
|
||||
|
||||
&.last {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
|
||||
> view {
|
||||
width: 50%;
|
||||
|
||||
.point {
|
||||
margin: 15rpx;
|
||||
}
|
||||
}
|
||||
|
||||
image {
|
||||
width: 40%;
|
||||
margin-top: 20rpx;
|
||||
max-width: 130rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.reward {
|
||||
image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
margin-top: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.signin-day-item {
|
||||
display: inline-block;
|
||||
width: 85rpx;
|
||||
height: 103rpx;
|
||||
border-radius: 4rpx;
|
||||
text-align: center;
|
||||
background-color: #f6f6fb;
|
||||
flex-shrink: 0;
|
||||
|
||||
.day {
|
||||
font-size: 24rpx;
|
||||
line-height: 1;
|
||||
margin-top: 18rpx;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.point {
|
||||
font-size: 20rpx;
|
||||
line-height: 1;
|
||||
margin-top: -4rpx;
|
||||
color: #abb0c1;
|
||||
}
|
||||
|
||||
image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.signin-btn {
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
height: 80rpx;
|
||||
bottom: 40rpx;
|
||||
text-align: center;
|
||||
|
||||
button {
|
||||
display: inline-block;
|
||||
width: 442rpx;
|
||||
height: 100%;
|
||||
color: #ffffff;
|
||||
background-color: #ff4544;
|
||||
}
|
||||
|
||||
.btn-active {
|
||||
color: #303133;
|
||||
background-color: #e1e1e1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.my-signin {
|
||||
padding: 30rpx;
|
||||
margin-top: 30rpx;
|
||||
background-color: #ffffff;
|
||||
border-radius: 18rpx;
|
||||
|
||||
.my-signin-title {
|
||||
font-size: 32rpx;
|
||||
line-height: 1;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.my-signin-con {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
margin-top: 30rpx;
|
||||
}
|
||||
|
||||
.my-signin-item {
|
||||
width: 300rpx;
|
||||
height: 155rpx;
|
||||
position: relative;
|
||||
|
||||
image {
|
||||
width: 300rpx;
|
||||
height: 155rpx;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
}
|
||||
|
||||
.my-signin-item-num {
|
||||
position: relative;
|
||||
z-index: 9;
|
||||
padding: 44rpx 28rpx 0;
|
||||
line-height: 32rpx;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
view:last-child {
|
||||
position: relative;
|
||||
z-index: 9;
|
||||
color: #abb0c1;
|
||||
padding-left: 28rpx;
|
||||
font-size: 20rpx;
|
||||
line-height: 1;
|
||||
margin-top: 16rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.signin-rule {
|
||||
margin-top: 30rpx;
|
||||
background-color: #ffffff;
|
||||
border-radius: 18rpx;
|
||||
padding: 30rpx;
|
||||
|
||||
.signin-rule-title {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: flex-start;
|
||||
line-height: 32rpx;
|
||||
font-size: 32rpx;
|
||||
font-weight: bold;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.signin-rule-con {
|
||||
margin-top: 30rpx;
|
||||
padding: 0 0;
|
||||
|
||||
.rule-item {
|
||||
font-size: 26rpx;
|
||||
color: #606266;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.popup-box {
|
||||
position: relative;
|
||||
top: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
|
||||
.icon-close::before {
|
||||
content: "\e609";
|
||||
width: 42rpx;
|
||||
height: 42rpx;
|
||||
border: 1px solid #fff;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
border-radius: 50%;
|
||||
color: $u-content-color;
|
||||
position: absolute;
|
||||
top: 70rpx;
|
||||
right: 0;
|
||||
}
|
||||
|
||||
.pic {
|
||||
width: 274rpx;
|
||||
height: 200rpx;
|
||||
position: relative;
|
||||
margin-bottom: -30rpx;
|
||||
}
|
||||
|
||||
.popup-content {
|
||||
background: #fff;
|
||||
width: 70vw;
|
||||
margin-top: -100rpx;
|
||||
border-radius: 20rpx;
|
||||
padding: 0 60rpx;
|
||||
padding-bottom: 40rpx;
|
||||
box-sizing: border-box;
|
||||
background-size: 100% 100rpx;
|
||||
}
|
||||
|
||||
.popup-content-wrap {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
|
||||
.title {
|
||||
font-size: 28rpx;
|
||||
margin-top: 160rpx;
|
||||
color: #999;
|
||||
|
||||
.num {
|
||||
font-size: 32rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.desc {
|
||||
color: #999;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.other-info {
|
||||
width: 300rpx;
|
||||
height: 70rpx;
|
||||
border-radius: 10rpx;
|
||||
margin: 0 auto;
|
||||
color: #fff;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin-top: 40rpx;
|
||||
}
|
||||
}
|
||||
.up-empty{
|
||||
box-sizing: border-box;
|
||||
width: 100%;
|
||||
padding: 100rpx 50rpx;
|
||||
text-align: center;
|
||||
}
|
||||
</style>
|
||||
5
src/addon/dailySignIn/styles/common.scss
Normal file
5
src/addon/dailySignIn/styles/common.scss
Normal file
@@ -0,0 +1,5 @@
|
||||
.remove-border {
|
||||
&::after {
|
||||
border: none;
|
||||
}
|
||||
}
|
||||
17
src/addon/dailySignIn/types/signIn.d.ts
vendored
Normal file
17
src/addon/dailySignIn/types/signIn.d.ts
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
export type SingInData = {
|
||||
showSignDays: Array
|
||||
rule: rule[]
|
||||
signState: number
|
||||
rewardRuleDay: Array
|
||||
cycle: number
|
||||
reward: {}
|
||||
}
|
||||
/** 签到是否开启 */
|
||||
export type BannerItem = {
|
||||
status: number
|
||||
}
|
||||
export type rule = {
|
||||
day: number
|
||||
growth: number
|
||||
point:number
|
||||
}
|
||||
9
src/addon/dailySignIn/utils/theme.json
Normal file
9
src/addon/dailySignIn/utils/theme.json
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"--primary-color": "#FF4142",
|
||||
"--primary-help-color": "#FB7939",
|
||||
"--primary-color-dark": "#F26F3E",
|
||||
"--primary-color-disabled": "#FFB397",
|
||||
"--primary-color-light": "#FFF4F4",
|
||||
"--page-bg-color": "#f7f7f7",
|
||||
"--price-text-color": "#FF4142"
|
||||
}
|
||||
3
src/addon/dailySignIn/utils/utils.ts
Normal file
3
src/addon/dailySignIn/utils/utils.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
export function inArray(elem: any, arr: string | any[] | null) {
|
||||
return arr == null ? -1 : arr.indexOf(elem);
|
||||
}
|
||||
8
src/addon/end.vue
Normal file
8
src/addon/end.vue
Normal file
@@ -0,0 +1,8 @@
|
||||
<template>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
</style>
|
||||
79
src/addon/erp/api/base.ts
Normal file
79
src/addon/erp/api/base.ts
Normal file
@@ -0,0 +1,79 @@
|
||||
|
||||
import request from '@/utils/request'
|
||||
|
||||
/***************************************************** 食堂管理 ****************************************************/
|
||||
// 食堂列表
|
||||
export function getCustomerList(params : Record<string, any>) {
|
||||
return request.get(`erp/base/customer`, params)
|
||||
}
|
||||
// 食堂列表
|
||||
export function getCustomerSelect(params : Record<string, any>) {
|
||||
return request.get(`erp/base/customer/select`, params)
|
||||
}
|
||||
// 食堂详情
|
||||
export function getCustomerInfo(id : number) {
|
||||
return request.get(`erp/base/customer/${id}`)
|
||||
}
|
||||
|
||||
// 添加食堂信息
|
||||
export function addCustomer(data : AnyObject) {
|
||||
return request.post("erp/base/customer", data, { showErrorMessage: true });
|
||||
}
|
||||
|
||||
// 删除食堂信息
|
||||
export function deleteCustomer(id : number) {
|
||||
return request.delete(`erp/base/customer/${id}`, { showErrorMessage: true });
|
||||
}
|
||||
|
||||
/***************************************************** 供应商管理 ****************************************************/
|
||||
// 供应商列表
|
||||
export function getSupplierList(params : Record<string, any>) {
|
||||
return request.get(`erp/base/supplier`, params)
|
||||
}
|
||||
|
||||
// 供应商列表
|
||||
export function getSupplierSelect(params : Record<string, any>) {
|
||||
return request.get(`erp/base/supplier/select`, params)
|
||||
}
|
||||
|
||||
|
||||
// 供应商详情
|
||||
export function getSupplierInfo(id : number) {
|
||||
return request.get(`erp/base/supplier/${id}`)
|
||||
}
|
||||
|
||||
// 添加供应商信息
|
||||
export function addSupplier(data : AnyObject) {
|
||||
return request.post("erp/base/supplier", data, { showErrorMessage: true });
|
||||
}
|
||||
|
||||
// 删除供应商信息
|
||||
export function deleteSupplier(id : number) {
|
||||
return request.delete(`erp/base/supplier/${id}`, { showErrorMessage: true });
|
||||
}
|
||||
|
||||
/***************************************************** 仓库管理 ****************************************************/
|
||||
// 仓库列表
|
||||
export function getWarehouseList(params : Record<string, any>) {
|
||||
return request.get(`erp/base/warehouse`, params)
|
||||
}
|
||||
|
||||
export function getWarehouseSelect(params : Record<string, any>) {
|
||||
return request.get(`erp/base/warehouse/select`, params)
|
||||
}
|
||||
|
||||
|
||||
// 仓库详情
|
||||
export function getWarehouseInfo(id : number) {
|
||||
return request.get(`erp/base/warehouse/${id}`)
|
||||
}
|
||||
|
||||
// 添加仓库信息
|
||||
export function addWarehouse(data : AnyObject) {
|
||||
return request.post("erp/base/warehouse", data, { showErrorMessage: true });
|
||||
}
|
||||
|
||||
// 删除仓库信息
|
||||
export function deleteWarehouse(id : number) {
|
||||
return request.delete(`erp/base/warehouse/${id}`, { showErrorMessage: true });
|
||||
}
|
||||
131
src/addon/erp/api/inventory.ts
Normal file
131
src/addon/erp/api/inventory.ts
Normal file
@@ -0,0 +1,131 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
|
||||
/**
|
||||
* 获取库存盘点单列表
|
||||
* @param params
|
||||
* @returns
|
||||
*/
|
||||
export function getInventoryList(params : Record<string, any>) {
|
||||
return request.get(`erp/inventory/inventory`, params);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取库存盘点单详情
|
||||
* @param id 库存盘点单id
|
||||
* @returns
|
||||
*/
|
||||
export function getInventoryInfo(id : number) {
|
||||
return request.get(`erp/inventory/inventory/${id}`);
|
||||
}
|
||||
/**
|
||||
* 获取库存盘点单状态
|
||||
* @returns
|
||||
*/
|
||||
export function getInventoryTypeList() {
|
||||
return request.get(`erp/inventory/inventory/typeList`);
|
||||
}
|
||||
/**
|
||||
* 获取库存盘点单状态
|
||||
* @returns
|
||||
*/
|
||||
export function getInventoryProduct(params : Record<string, any>) {
|
||||
return request.get(`erp/inventory/inventory/product`, params);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加库存盘点单
|
||||
* @param params
|
||||
* @returns
|
||||
*/
|
||||
export function addInventory(params : Record<string, any>) {
|
||||
return request.post("erp/inventory/inventory", params, {
|
||||
showErrorMessage: true,
|
||||
showSuccessMessage: true,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取库存流水列表
|
||||
* @param params
|
||||
* @returns
|
||||
*/
|
||||
export function getStatementList(params : Record<string, any>) {
|
||||
return request.get(`erp/inventory/statement`, params);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取食材与库存的关联列表
|
||||
* @param params
|
||||
* @returns
|
||||
*/
|
||||
export function getWpRelationshipList(params : Record<string, any>) {
|
||||
return request.get(`erp/inventory/wprelationship`, params);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取食材与库存的关联详情
|
||||
* @param id 食材与库存的关联id
|
||||
* @returns
|
||||
*/
|
||||
export function getWpRelationshipInfo(id : number) {
|
||||
return request.get(`erp/inventory/wprelationship/${id}`);
|
||||
}
|
||||
|
||||
|
||||
/*--------------------------------new------------------------------*/
|
||||
/**
|
||||
* 获取库存盘点单列表
|
||||
* @param params
|
||||
* @returns
|
||||
*/
|
||||
export function getCheckList(params: Record<string, any>) {
|
||||
return request.get(`erp/inventory/check`, params);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取库存盘点单状态
|
||||
* @returns
|
||||
*/
|
||||
export function getCheckTypeList(params: Record<string, any>) {
|
||||
return request.get(`erp/inventory/check/typeList`,params);
|
||||
}
|
||||
/**
|
||||
* 根据库存获取食材
|
||||
* @returns
|
||||
*/
|
||||
export function getCheckProduct(params: Record<string, any>) {
|
||||
return request.get(`erp/inventory/check/product`,params);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加库存盘点单
|
||||
* @param params
|
||||
* @returns
|
||||
*/
|
||||
export function addCheck(params: Record<string, any>) {
|
||||
return request.post("erp/inventory/check", params, {
|
||||
showErrorMessage: true,
|
||||
showSuccessMessage: true,
|
||||
});
|
||||
}
|
||||
|
||||
// 库存盘点-审核
|
||||
export function updateCheckStatus(params: Record<string, any>) {
|
||||
return request.post(`erp/inventory/check/updateStatus/${params.id}`, params, {
|
||||
showErrorMessage: true,
|
||||
showSuccessMessage: true,
|
||||
});
|
||||
}
|
||||
|
||||
// 库存盘点-入库
|
||||
export function putInStorage(id: number) {
|
||||
return request.post(`erp/inventory/check/putInStorage/${id}`, {},
|
||||
{
|
||||
showErrorMessage: true,
|
||||
showSuccessMessage: true,
|
||||
}
|
||||
);
|
||||
}
|
||||
12
src/addon/erp/api/member.ts
Normal file
12
src/addon/erp/api/member.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
|
||||
import request from '@/utils/request'
|
||||
|
||||
/***************************************************** 绑定站点管理员账号 ****************************************************/
|
||||
export function bindAdminAccout(data: Record<string, any>) {
|
||||
return request.post(`erp/member/bind`, data, { showErrorMessage: true })
|
||||
}
|
||||
|
||||
// 获取站点会员
|
||||
export function getMemberInfo() {
|
||||
return request.post(`erp/member/info`)
|
||||
}
|
||||
186
src/addon/erp/api/product.ts
Normal file
186
src/addon/erp/api/product.ts
Normal file
@@ -0,0 +1,186 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
|
||||
/***************************************************** 食材分类管理 ****************************************************/
|
||||
// 食材分类列表
|
||||
export function getProductTypeList(params : Record<string, any>) {
|
||||
return request.get(`erp/product/type`, params)
|
||||
}
|
||||
|
||||
// 食材分类选择列表
|
||||
export function getProductTypeSelect() {
|
||||
return request.get(`erp/product/type/select`)
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取商品分类详情
|
||||
* @param id 商品分类id
|
||||
* @returns
|
||||
*/
|
||||
export function getProductTypeInfo(id : number) {
|
||||
return request.get(`erp/product/type/${id}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加商品分类
|
||||
* @param params
|
||||
* @returns
|
||||
*/
|
||||
export function addProductType(params : Record<string, any>) {
|
||||
return request.post("erp/product/type", params, {
|
||||
showErrorMessage: true,
|
||||
showSuccessMessage: true,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑商品分类
|
||||
* @param id
|
||||
* @param params
|
||||
* @returns
|
||||
*/
|
||||
export function editProductType(params : Record<string, any>) {
|
||||
return request.put(`erp/product/type/${params.id}`, params, {
|
||||
showErrorMessage: true,
|
||||
showSuccessMessage: true,
|
||||
});
|
||||
}
|
||||
|
||||
// 删除食材分类
|
||||
export function deleteProductType(id : number) {
|
||||
return request.delete(`erp/product/type/${id}`, { showErrorMessage: true });
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取商品单位列表
|
||||
* @param params
|
||||
* @returns
|
||||
*/
|
||||
export function getProductUnitList(params : Record<string, any>) {
|
||||
return request.get(`erp/product/unit`, params);
|
||||
}
|
||||
|
||||
export function getProductUnitSelect(params : Record<string, any>) {
|
||||
return request.get(`erp/product/unit/select`, params);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取商品单位详情
|
||||
* @param id 商品单位id
|
||||
* @returns
|
||||
*/
|
||||
export function getProductUnitInfo(id : number) {
|
||||
return request.get(`erp/product/unit/${id}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加商品单位
|
||||
* @param params
|
||||
* @returns
|
||||
*/
|
||||
export function addProductUnit(params : Record<string, any>) {
|
||||
return request.post("erp/product/unit", params, {
|
||||
showErrorMessage: true,
|
||||
showSuccessMessage: true,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑商品单位
|
||||
* @param id
|
||||
* @param params
|
||||
* @returns
|
||||
*/
|
||||
export function editProductUnit(params : Record<string, any>) {
|
||||
return request.put(`erp/product/unit/${params.id}`, params, {
|
||||
showErrorMessage: true,
|
||||
showSuccessMessage: true,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除商品单位
|
||||
* @param id
|
||||
* @returns
|
||||
*/
|
||||
export function deleteProductUnit(id : number) {
|
||||
return request.delete(`erp/product/unit/${id}`, {
|
||||
showErrorMessage: true,
|
||||
showSuccessMessage: true,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取食材信息列表
|
||||
* @param params
|
||||
* @returns
|
||||
*/
|
||||
export function getProductList(params : Record<string, any>) {
|
||||
return request.get(`erp/product/product`, params);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取食材信息列表
|
||||
* @param params
|
||||
* @returns
|
||||
*/
|
||||
export function getProductListByWarehouse(params : Record<string, any>) {
|
||||
return request.get(`erp/product/product/getListsByWarehouse`, params);
|
||||
}
|
||||
/**
|
||||
* 获取食材信息列表-new
|
||||
* @param params
|
||||
* @returns
|
||||
*/
|
||||
export function getProductListByWarehouseNew(params : Record<string, any>) {
|
||||
return request.get(`erp/product/product/getListsByWarehousea`, params);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取食材信息详情
|
||||
* @param id 食材信息id
|
||||
* @returns
|
||||
*/
|
||||
export function getProductInfo(id : number) {
|
||||
return request.get(`erp/product/product/${id}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加食材信息
|
||||
* @param params
|
||||
* @returns
|
||||
*/
|
||||
export function addProduct(params : Record<string, any>) {
|
||||
return request.post("erp/product/product", params, {
|
||||
showErrorMessage: true,
|
||||
showSuccessMessage: true,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑食材信息
|
||||
* @param id
|
||||
* @param params
|
||||
* @returns
|
||||
*/
|
||||
export function editProduct(params : Record<string, any>) {
|
||||
return request.put(`erp/product/product/${params.id}`, params, {
|
||||
showErrorMessage: true,
|
||||
showSuccessMessage: true,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除食材信息
|
||||
* @param id
|
||||
* @returns
|
||||
*/
|
||||
export function deleteProduct(id : number) {
|
||||
return request.delete(`erp/product/product/${id}`, {
|
||||
showErrorMessage: true,
|
||||
showSuccessMessage: true,
|
||||
});
|
||||
}
|
||||
254
src/addon/erp/api/purchase.ts
Normal file
254
src/addon/erp/api/purchase.ts
Normal file
@@ -0,0 +1,254 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
/**
|
||||
* 获取采购订单列表
|
||||
* @param params
|
||||
* @returns
|
||||
*/
|
||||
export function getOrderList(params : Record<string, any>) {
|
||||
return request.get(`erp/purchase/order`, params);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取采购订单详情
|
||||
* @param id 采购订单id
|
||||
* @returns
|
||||
*/
|
||||
export function getOrderInfo(id : number) {
|
||||
return request.get(`erp/purchase/order/${id}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取采购订单状态
|
||||
* @param params
|
||||
* @returns
|
||||
*/
|
||||
export function getOrderStatus() {
|
||||
return request.get(`erp/purchase/order/getStatus`);
|
||||
}
|
||||
/**
|
||||
* 添加采购订单
|
||||
* @param params
|
||||
* @returns
|
||||
*/
|
||||
export function addOrder(params : Record<string, any>) {
|
||||
return request.post("erp/purchase/order", params, {
|
||||
showErrorMessage: true,
|
||||
showSuccessMessage: true,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取入库列表
|
||||
* @param params
|
||||
* @returns
|
||||
*/
|
||||
export function getStorageList(params : Record<string, any>) {
|
||||
return request.get(`erp/purchase/storage`, params);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取入库单状态
|
||||
* @param params
|
||||
* @returns
|
||||
*/
|
||||
export function getStorageStatus() {
|
||||
return request.get(`erp/purchase/storage/getStatus`);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取入库详情
|
||||
* @param id 入库id
|
||||
* @returns
|
||||
*/
|
||||
export function getStorageInfo(id : number) {
|
||||
return request.get(`erp/purchase/storage/${id}`);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取退货列表
|
||||
* @param params
|
||||
* @returns
|
||||
*/
|
||||
export function getRetireList(params : Record<string, any>) {
|
||||
return request.get(`erp/purchase/retire`, params);
|
||||
}
|
||||
/**
|
||||
* 修改
|
||||
* @param params
|
||||
* @returns
|
||||
*/
|
||||
export function updateRetire(id : number,params : Record<string, any>) {
|
||||
return request.post(`erp/purchase/retire/${id}`, params,{
|
||||
showErrorMessage: true,
|
||||
showSuccessMessage: true,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取退货单状态
|
||||
* @param params
|
||||
* @returns
|
||||
*/
|
||||
export function getRetireStatus() {
|
||||
return request.get(`erp/purchase/retire/getStatus`);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取退货详情
|
||||
* @param id 退货id
|
||||
* @returns
|
||||
*/
|
||||
export function getRetireInfo(id : number) {
|
||||
return request.get(`erp/purchase/retire/${id}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加退货
|
||||
* @param params
|
||||
* @returns
|
||||
*/
|
||||
export function addRetire(params : Record<string, any>) {
|
||||
return request.post("erp/purchase/retire", params, {
|
||||
showErrorMessage: true,
|
||||
showSuccessMessage: true,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除退货
|
||||
* @param id
|
||||
* @returns
|
||||
*/
|
||||
export function deleteRetire(id : number) {
|
||||
return request.delete(`erp/purchase/retire/${id}`, {
|
||||
showErrorMessage: true,
|
||||
showSuccessMessage: true,
|
||||
});
|
||||
}
|
||||
|
||||
/*-------------------------------------new-----------------------------------------*/
|
||||
/**
|
||||
* 入库列表
|
||||
* @param params
|
||||
* @returns
|
||||
*/
|
||||
export function getManualList(params: Record<string, any>) {
|
||||
return request.get(`erp/inbound/manual`,params);
|
||||
}
|
||||
/**
|
||||
* 添加入库
|
||||
* @param params
|
||||
* @returns
|
||||
*/
|
||||
export function addManual(params : Record<string, any>) {
|
||||
return request.post("erp/inbound/manual", params, {
|
||||
showErrorMessage: true,
|
||||
showSuccessMessage: true,
|
||||
});
|
||||
}
|
||||
/**
|
||||
* 获取入库单状态
|
||||
* @param params
|
||||
* @returns
|
||||
*/
|
||||
export function getManualStatus(params: Record<string, any>) {
|
||||
return request.get(`erp/inbound/manual/getStatus`, params);
|
||||
}
|
||||
/**
|
||||
* 手工单入库
|
||||
* @param id
|
||||
* @returns
|
||||
*/
|
||||
export function putInStorage(id: any) {
|
||||
return request.put(
|
||||
`erp/inbound/manual/putInStorage/${id}`,
|
||||
{},
|
||||
{
|
||||
showErrorMessage: true,
|
||||
showSuccessMessage: true,
|
||||
}
|
||||
);
|
||||
}
|
||||
/**
|
||||
* 获取入库单详情
|
||||
* @param id 入库单id
|
||||
* @returns
|
||||
*/
|
||||
export function getManualInfo(id: number) {
|
||||
return request.get(`erp/inbound/manual/${id}`);
|
||||
}
|
||||
/**
|
||||
* 获取退货列表
|
||||
* @param params
|
||||
* @returns
|
||||
*/
|
||||
export function getReturnList(params: Record<string, any>) {
|
||||
return request.get(`erp/inventory/return`,params)
|
||||
}
|
||||
|
||||
export function getReturnStatus() {
|
||||
return request.get(`erp/inventory/return/getStatus`)
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取退货详情
|
||||
* @param id 退货id
|
||||
* @returns
|
||||
*/
|
||||
export function getReturnInfo(id: number) {
|
||||
return request.get(`erp/inventory/return/${id}`)
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加退货
|
||||
* @param params
|
||||
* @returns
|
||||
*/
|
||||
export function addReturn(params: Record<string, any>) {
|
||||
return request.post('erp/inventory/return', params, {
|
||||
showErrorMessage: true,
|
||||
showSuccessMessage: true
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 审核退货订单
|
||||
* @param id
|
||||
* @returns
|
||||
*/
|
||||
export function updateReturnStatus(params: Record<string, any>) {
|
||||
return request.post(`erp/inventory/return/updateStatus/${params.id}`, params, {
|
||||
showErrorMessage: true,
|
||||
showSuccessMessage: true
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 确认退货
|
||||
* @param id
|
||||
* @returns
|
||||
*/
|
||||
export function confirmReturned(params: Record<string, any>) {
|
||||
return request.post(`erp/inventory/return/confirm/${params.id}`, params, {
|
||||
showErrorMessage: true,
|
||||
showSuccessMessage: true
|
||||
})
|
||||
}
|
||||
/**
|
||||
* 反审核退货订单
|
||||
* @param id
|
||||
* @returns
|
||||
*/
|
||||
export function antiReturnStatus(id: number) {
|
||||
return request.post(
|
||||
`erp/inventory/return/anti/${id}`,
|
||||
{},
|
||||
{
|
||||
showErrorMessage: true,
|
||||
showSuccessMessage: true
|
||||
}
|
||||
)
|
||||
}
|
||||
287
src/addon/erp/api/sell.ts
Normal file
287
src/addon/erp/api/sell.ts
Normal file
@@ -0,0 +1,287 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
/**
|
||||
* 获取销售订单主列表
|
||||
* @param params
|
||||
* @returns
|
||||
*/
|
||||
export function getSellList(params : Record<string, any>) {
|
||||
return request.get(`erp/sell/sell`, params);
|
||||
}
|
||||
/**
|
||||
* 出库
|
||||
* @param params
|
||||
* @returns
|
||||
*/
|
||||
export function outWarehouseSell(params : Record<string, any>) {
|
||||
return request.get(`erp/sell/sellout`, params);
|
||||
}
|
||||
/**
|
||||
* 获取销售订单主列表
|
||||
* @param params
|
||||
* @returns
|
||||
*/
|
||||
export function getSellSelect(params : Record<string, any>) {
|
||||
return request.get(`erp/sell/sell/select`, params);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取销售订单状态
|
||||
* @param params
|
||||
* @returns
|
||||
*/
|
||||
export function getSellStatus() {
|
||||
return request.get(`erp/sell/sell/getStatus`);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取销售订单主详情
|
||||
* @param id 销售订单主id
|
||||
* @returns
|
||||
*/
|
||||
export function getSellInfo(id : number) {
|
||||
return request.get(`erp/sell/sell/${id}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加销售订单主
|
||||
* @param params
|
||||
* @returns
|
||||
*/
|
||||
export function addSell(params : Record<string, any>) {
|
||||
return request.post("erp/sell/sell", params, {
|
||||
showErrorMessage: true,
|
||||
showSuccessMessage: true,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除销售订单主
|
||||
* @param id
|
||||
* @returns
|
||||
*/
|
||||
export function deleteSell(id : number) {
|
||||
return request.delete(`erp/sell/sell/${id}`, {
|
||||
showErrorMessage: true,
|
||||
showSuccessMessage: true,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取销售出库单列表
|
||||
* @param params
|
||||
* @returns
|
||||
*/
|
||||
export function getDeliveryList(params : Record<string, any>) {
|
||||
return request.get(`erp/sell/delivery`, params);
|
||||
}
|
||||
|
||||
export function getDeliveryStatusList() {
|
||||
return request.get(`erp/sell/delivery/getStatus`);
|
||||
}
|
||||
|
||||
// 获取销售单详情
|
||||
export function getDeliverySellInfo(sell_id : number) {
|
||||
return request.get(`erp/sell/delivery/getSellInfo/${sell_id}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取销售出库单详情
|
||||
* @param id 销售出库单id
|
||||
* @returns
|
||||
*/
|
||||
export function getDeliveryInfo(id : number) {
|
||||
return request.get(`erp/sell/delivery/${id}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加销售出库单
|
||||
* @param params
|
||||
* @returns
|
||||
*/
|
||||
export function addDelivery(params : Record<string, any>) {
|
||||
return request.post("erp/sell/delivery", params, {
|
||||
showErrorMessage: true,
|
||||
showSuccessMessage: true,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取销售退货单列表
|
||||
* @param params
|
||||
* @returns
|
||||
*/
|
||||
export function getSellReturnList(params : Record<string, any>) {
|
||||
return request.get(`erp/sell/sellreturn`, params);
|
||||
}
|
||||
/**
|
||||
* 修改
|
||||
* @param params
|
||||
* @returns
|
||||
*/
|
||||
export function updateSellReturn(id : number,params : Record<string, any>) {
|
||||
return request.post(`erp/sell/sellreturn/${id}`, params,{
|
||||
showErrorMessage: true,
|
||||
showSuccessMessage: true,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取销售退货单详情
|
||||
* @param id 销售退货单id
|
||||
* @returns
|
||||
*/
|
||||
export function getSellReturnInfo(id : number) {
|
||||
return request.get(`erp/sell/sellreturn/${id}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加销售退货单
|
||||
* @param params
|
||||
* @returns
|
||||
*/
|
||||
export function addSellReturn(params : Record<string, any>) {
|
||||
return request.post("erp/sell/sellreturn", params, {
|
||||
showErrorMessage: true,
|
||||
showSuccessMessage: true,
|
||||
});
|
||||
}
|
||||
/*-------------------------------------------------new----------------------------------------------------------*/
|
||||
/**
|
||||
* 出库单列表
|
||||
* @param params
|
||||
* @returns
|
||||
*/
|
||||
export function getManualList(params: Record<string, any>) {
|
||||
return request.get('erp/outbound/manual', params)
|
||||
}
|
||||
/**
|
||||
* 获取出库单详情
|
||||
* @param id 出库单id
|
||||
* @returns
|
||||
*/
|
||||
export function getManualInfo(id: number) {
|
||||
return request.get(`erp/outbound/manual/${id}`);
|
||||
}
|
||||
/**
|
||||
* 添加出库
|
||||
* @param params
|
||||
* @returns
|
||||
*/
|
||||
export function addManual(params: Record<string, any>) {
|
||||
return request.post('erp/outbound/manual', params, {
|
||||
showErrorMessage: true,
|
||||
showSuccessMessage: true
|
||||
})
|
||||
}
|
||||
/**
|
||||
* 出库单出库
|
||||
* @param id 出库id
|
||||
* @returns
|
||||
*/
|
||||
export function takeOutOfStorage(id: any) {
|
||||
return request.post(
|
||||
`erp/outbound/manual/takeOutOfStorage/${id}`,
|
||||
{},
|
||||
{
|
||||
showErrorMessage: true,
|
||||
showSuccessMessage: true,
|
||||
}
|
||||
);
|
||||
}
|
||||
/**
|
||||
* 获取手工出库单列表
|
||||
* @param params
|
||||
* @returns
|
||||
*/
|
||||
export function getOutboundManualSelect(id: number) {
|
||||
return request.get(`erp/outbound/manual/select/${id}`);
|
||||
}
|
||||
export function getOutboundManualInfo(id: number) {
|
||||
return request.get(`erp/outbound/manual/${id}`);
|
||||
}
|
||||
/**
|
||||
* 获取食堂退货单列表
|
||||
* @param params
|
||||
* @returns
|
||||
*/
|
||||
export function getManualReturnList(params: Record<string, any>) {
|
||||
return request.get(`erp/inbound/inbound/return`, params);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取食堂退货订单状态
|
||||
* @param params
|
||||
* @returns
|
||||
*/
|
||||
export function getManualReturnStatus(params: Record<string, any>) {
|
||||
return request.get(`erp/inbound/inbound/return/getStatus`, params);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取食堂退货单详情
|
||||
* @param id 食堂退货单id
|
||||
* @returns
|
||||
*/
|
||||
export function getManualReturnInfo(id: number) {
|
||||
return request.get(`erp/inbound/inbound/return/${id}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加食堂退货单
|
||||
* @param params
|
||||
* @returns
|
||||
*/
|
||||
export function addManualReturn(params: Record<string, any>) {
|
||||
return request.post("erp/inbound/inbound/return", params, {
|
||||
showErrorMessage: true,
|
||||
showSuccessMessage: true,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 审核食堂退货单
|
||||
* @param id
|
||||
* @returns
|
||||
*/
|
||||
export function updateManualReturnStatus(params: Record<string, any>) {
|
||||
return request.put(`erp/inbound/inbound/return/updateStatus/${params.id}`, params, {
|
||||
showErrorMessage: true,
|
||||
showSuccessMessage: true,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 审核食堂退货单
|
||||
* @param id
|
||||
* @returns
|
||||
*/
|
||||
export function updateManualReturnStorageStatus(params: Record<string, any>) {
|
||||
return request.put(
|
||||
`erp/inbound/inbound/return/updateStorageStatus/${params.id}`,
|
||||
params,
|
||||
{
|
||||
showErrorMessage: true,
|
||||
showSuccessMessage: true,
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* 反审核食堂退货订单
|
||||
* @param id
|
||||
* @returns
|
||||
*/
|
||||
export function antiManualReturnStatus(id: number) {
|
||||
return request.put(
|
||||
`erp/inbound/inbound/return/anti/${id}`,
|
||||
{},
|
||||
{
|
||||
showErrorMessage: true,
|
||||
showSuccessMessage: true
|
||||
}
|
||||
)
|
||||
}
|
||||
9
src/addon/erp/api/statistice.ts
Normal file
9
src/addon/erp/api/statistice.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function getBaseInfo() {
|
||||
return request.get(`erp/index/getBaseInfo`);
|
||||
}
|
||||
|
||||
export function getWaitInfo() {
|
||||
return request.get(`erp/index/getWaitInfo`);
|
||||
}
|
||||
207
src/addon/erp/components/diy/erp-member-info/index.vue
Normal file
207
src/addon/erp/components/diy/erp-member-info/index.vue
Normal file
@@ -0,0 +1,207 @@
|
||||
<template>
|
||||
<view :style="warpCss">
|
||||
<view class="py-[34rpx] member-info">
|
||||
<!-- #ifdef MP-WEIXIN -->
|
||||
<!-- 解决fixed定位后导航栏塌陷的问题 -->
|
||||
<view :style="navbarInnerStyle"></view>
|
||||
<!-- #endif -->
|
||||
<view v-if="info" class="flex ml-[32rpx] mr-[52rpx] items-center relative">
|
||||
<!-- 唤起获取微信 -->
|
||||
<u-avatar :src="img(info.headimg)" size="55" leftIcon="none"
|
||||
:default-url="img('static/resource/images/default_headimg.png')" @click="clickAvatar" />
|
||||
<view class="ml-[22rpx]">
|
||||
<view class="text-[#222222] flex pr-[50rpx] flex-wrap items-center">
|
||||
<view class="text-[#222222] truncate max-w-[320rpx] font-bold text-lg mr-[16rpx]"
|
||||
:style="{ color : diyComponent.textColor }">{{ info.nickname }}</view>
|
||||
</view>
|
||||
<view class="text-[#696B70] text-[24rpx] mt-[10rpx]" :style="{ color : diyComponent.textColor }">
|
||||
UID:{{ info.member_no }}</view>
|
||||
</view>
|
||||
<view class="set-icon flex items-center absolute right-0 top-2">
|
||||
<view @click="redirect({ url: '/app/pages/setting/index' })">
|
||||
<text class="nc-iconfont nc-icon-shezhiV6xx-1 text-[40rpx] ml-[10rpx]"
|
||||
:style="{ color : diyComponent.textColor }"></text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-else class="flex ml-[32rpx] mr-[52rpx] items-center relative">
|
||||
<u-avatar :src="img('static/resource/images/default_headimg.png')" size="55" @click="toLogin" />
|
||||
<view class="ml-[22rpx]" @click="toLogin">
|
||||
<view class="text-[#222222] font-bold text-lg" :style="{ color : diyComponent.textColor }">
|
||||
{{ t('login') }}/{{ t('register') }}
|
||||
</view>
|
||||
</view>
|
||||
<view class="set-icon flex items-center absolute right-0 top-2"
|
||||
@click="redirect({ url: '/app/pages/setting/index' })">
|
||||
<view>
|
||||
<text class="nc-iconfont nc-icon-shezhiV6xx-1 text-[40rpx] ml-[10rpx]"
|
||||
:style="{ color : diyComponent.textColor }"></text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- #ifdef MP-WEIXIN -->
|
||||
<information-filling ref="infoFill"></information-filling>
|
||||
<!-- #endif -->
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { computed, ref, watch } from 'vue'
|
||||
import useMemberStore from '@/stores/member'
|
||||
import { useLogin } from '@/hooks/useLogin'
|
||||
import { img, isWeixinBrowser, redirect, urlDeconstruction, moneyFormat, getToken } from '@/utils/common'
|
||||
import { t } from '@/locale'
|
||||
import { wechatSync } from '@/app/api/system'
|
||||
import useDiyStore from '@/app/stores/diy'
|
||||
import useConfigStore from '@/stores/config'
|
||||
|
||||
const props = defineProps(['component', 'index', 'pullDownRefreshCount', 'global']);
|
||||
|
||||
const configStore = useConfigStore()
|
||||
const diyStore = useDiyStore();
|
||||
|
||||
const diyComponent = computed(() => {
|
||||
if (diyStore.mode == 'decorate') {
|
||||
return diyStore.value[props.index];
|
||||
} else {
|
||||
return props.component;
|
||||
}
|
||||
})
|
||||
const warpCss = computed(() => {
|
||||
var style = '';
|
||||
if (diyComponent.value.componentStartBgColor) {
|
||||
if (diyComponent.value.componentStartBgColor && diyComponent.value.componentEndBgColor) style += `background:linear-gradient(${diyComponent.value.componentGradientAngle},${diyComponent.value.componentStartBgColor},${diyComponent.value.componentEndBgColor});`;
|
||||
else style += 'background-color:' + diyComponent.value.componentStartBgColor + ';';
|
||||
}
|
||||
if (diyComponent.value.bgUrl) {
|
||||
style += 'background-image:url(' + img(diyComponent.value.bgUrl) + ');';
|
||||
style += 'background-size: 100%;';
|
||||
style += 'background-repeat: no-repeat;';
|
||||
}
|
||||
if (diyComponent.value.topRounded) style += 'border-top-left-radius:' + diyComponent.value.topRounded * 2 + 'rpx;';
|
||||
if (diyComponent.value.topRounded) style += 'border-top-right-radius:' + diyComponent.value.topRounded * 2 + 'rpx;';
|
||||
if (diyComponent.value.bottomRounded) style += 'border-bottom-left-radius:' + diyComponent.value.bottomRounded * 2 + 'rpx;';
|
||||
if (diyComponent.value.bottomRounded) style += 'border-bottom-right-radius:' + diyComponent.value.bottomRounded * 2 + 'rpx;';
|
||||
|
||||
return style;
|
||||
})
|
||||
|
||||
watch(
|
||||
() => props.pullDownRefreshCount,
|
||||
(newValue, oldValue) => {
|
||||
// 处理下拉刷新业务
|
||||
}
|
||||
)
|
||||
|
||||
const memberStore = useMemberStore()
|
||||
|
||||
// #ifdef H5
|
||||
const { query } = urlDeconstruction(location.href)
|
||||
if (query.code && isWeixinBrowser() && getToken()) {
|
||||
wechatSync({ code: query.code }).then(res => {
|
||||
memberStore.getMemberInfo()
|
||||
})
|
||||
}
|
||||
// #endif
|
||||
|
||||
const info = computed(() => {
|
||||
// 装修模式
|
||||
if (diyStore.mode == 'decorate') {
|
||||
return {
|
||||
headimg: '',
|
||||
nickname: '昵称',
|
||||
balance: 0,
|
||||
point: 0,
|
||||
money: 0,
|
||||
member_no: 'NIU0000021'
|
||||
}
|
||||
} else {
|
||||
return memberStore.info;
|
||||
}
|
||||
})
|
||||
|
||||
const money = computed(() => {
|
||||
if (info.value) {
|
||||
let m = parseFloat(info.value.balance) + parseFloat(info.value.money)
|
||||
return moneyFormat(m.toString());
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
})
|
||||
|
||||
const toLogin = () => {
|
||||
let normalLogin = !configStore.login.is_username && !configStore.login.is_mobile && !configStore.login.is_bind_mobile; // 未开启普通登录
|
||||
let authRegisterLogin = !configStore.login.is_auth_register; // 自动注册登录
|
||||
|
||||
// #ifdef H5
|
||||
if (isWeixinBrowser()) {
|
||||
// 微信浏览器
|
||||
if (normalLogin && authRegisterLogin) {
|
||||
uni.showToast({ title: '商家未开启登录注册', icon: 'none' })
|
||||
} else if (configStore.login.is_username || configStore.login.is_mobile || configStore.login.is_bind_mobile) {
|
||||
useLogin().setLoginBack({ url: '/app/pages/member/index' })
|
||||
} else if (normalLogin && configStore.login.is_auth_register) {
|
||||
// 判断是否开启第三方自动注册登录
|
||||
useLogin().getAuthCode({ scopes: 'snsapi_userinfo' })
|
||||
}
|
||||
} else {
|
||||
// 普通浏览器
|
||||
if (normalLogin) {
|
||||
uni.showToast({ title: '商家未开启登录注册', icon: 'none' })
|
||||
} else if (configStore.login.is_username || configStore.login.is_mobile || configStore.login.is_bind_mobile) {
|
||||
useLogin().setLoginBack({ url: '/app/pages/member/index' })
|
||||
}
|
||||
}
|
||||
// #endif
|
||||
|
||||
// #ifdef MP
|
||||
if (normalLogin && authRegisterLogin) {
|
||||
uni.showToast({ title: '商家未开启登录注册', icon: 'none' })
|
||||
} else if (configStore.login.is_username || configStore.login.is_mobile || configStore.login.is_bind_mobile) {
|
||||
useLogin().setLoginBack({ url: '/app/pages/member/index' })
|
||||
} else if (normalLogin && configStore.login.is_auth_register) {
|
||||
// 判断是否开启第三方自动注册登录
|
||||
useLogin().getAuthCode()
|
||||
}
|
||||
// #endif
|
||||
}
|
||||
|
||||
const infoFill : any = ref(false)
|
||||
const clickAvatar = () => {
|
||||
// #ifdef MP-WEIXIN
|
||||
infoFill.value.show = true
|
||||
// #endif
|
||||
|
||||
// #ifdef H5
|
||||
if (isWeixinBrowser()) {
|
||||
useLogin().getAuthCode({ scopes: 'snsapi_userinfo' })
|
||||
} else {
|
||||
redirect({ url: '/app/pages/member/personal' })
|
||||
}
|
||||
// #endif
|
||||
}
|
||||
let menuButtonInfo : any = {};
|
||||
// 如果是小程序,获取右上角胶囊的尺寸信息,避免导航栏右侧内容与胶囊重叠(支付宝小程序非本API,尚未兼容)
|
||||
// #ifdef MP-WEIXIN || MP-BAIDU || MP-TOUTIAO || MP-QQ
|
||||
menuButtonInfo = uni.getMenuButtonBoundingClientRect();
|
||||
// #endif
|
||||
|
||||
// 导航栏内部盒子的样式
|
||||
const navbarInnerStyle = computed(() => {
|
||||
let style = '';
|
||||
// 导航栏宽度,如果在小程序下,导航栏宽度为胶囊的左边到屏幕左边的距离
|
||||
// #ifdef MP
|
||||
if (props.global.topStatusBar.isShow == false) {
|
||||
style += 'height:' + menuButtonInfo.height + 'px;';
|
||||
style += 'padding-top:' + menuButtonInfo.top + 'px;';
|
||||
}
|
||||
// #endif
|
||||
return style;
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
</style>
|
||||
207
src/addon/erp/components/u-select/index.vue
Normal file
207
src/addon/erp/components/u-select/index.vue
Normal file
@@ -0,0 +1,207 @@
|
||||
<template>
|
||||
<view class="ep-picker-box">
|
||||
<!-- 蒙版区域 开始 -->
|
||||
<view class="ep-mask-box" v-show="show" @click="show=false"></view>
|
||||
<!-- 蒙版区域 结束 -->
|
||||
<!-- 输入框区域 开始 -->
|
||||
<view class="ep-input-box" @click="openOptions" :class="{'disabled':disabled}">
|
||||
<view style="display: flex;align-items: center;min-height: 36px;">{{showLabel}}</view>
|
||||
<text v-if="!show" class="iconfont icon-xiala"></text>
|
||||
<text v-else class="iconfont icon-xialashang"></text>
|
||||
</view>
|
||||
<!-- 输入框区域 结束 -->
|
||||
|
||||
<!-- 弹出的下拉区域 开始 -->
|
||||
<view v-show="show" class="ep-picker-content-wrap">
|
||||
<scroll-view class="ep-picker-content" :scroll-y="true">
|
||||
<!-- 展示下拉项列表 开始 -->
|
||||
<view v-for="item in options" :key="item[value_key]"
|
||||
:class="{'disabled':item.disabled,'active':modelValue==item[value_key]}" class="option-item"
|
||||
@click="itemClick(item)">{{item[label_key]}}</view>
|
||||
<!-- 展示下拉项列表 结束 -->
|
||||
|
||||
<!-- 下拉列表为空 开始 -->
|
||||
<view v-if="options.length==0" class="option-no-data">无数据</view>
|
||||
<!-- 下拉列表为空 结束 -->
|
||||
</scroll-view>
|
||||
<text class="triangle"></text>
|
||||
</view>
|
||||
<!-- 弹出的下拉区域 结束 -->
|
||||
|
||||
</view>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ref, computed } from 'vue';
|
||||
|
||||
const prop = defineProps({
|
||||
modelValue: {
|
||||
type: [String, Number],
|
||||
default: ""
|
||||
},
|
||||
options: {
|
||||
type: Array,
|
||||
default: function () {
|
||||
return []
|
||||
}
|
||||
},
|
||||
value_key: {
|
||||
type: String,
|
||||
default: "value"
|
||||
},
|
||||
label_key: {
|
||||
type: String,
|
||||
default: "label"
|
||||
},
|
||||
disabled: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
})
|
||||
|
||||
const show = ref(false);
|
||||
const emits = defineEmits(['update:modelValue', 'change']);
|
||||
|
||||
//点击选中选项
|
||||
const itemClick = (item) => {
|
||||
if (item.disabled) return
|
||||
//关闭
|
||||
show.value = false
|
||||
//修改v-model的值
|
||||
emits('update:modelValue', item[prop.value_key])
|
||||
//将事件通知父组件
|
||||
emits('change', item[prop.value_key])
|
||||
}
|
||||
//展开选项
|
||||
const openOptions = () => {
|
||||
if (!prop.disabled) {
|
||||
show.value = true
|
||||
}
|
||||
}
|
||||
|
||||
const showLabel = computed(() => {
|
||||
var index = prop.options.findIndex(item => {
|
||||
return item[prop.value_key] == prop.modelValue
|
||||
})
|
||||
if (index != -1) {
|
||||
return prop.options[index][prop.label_key]
|
||||
} else if (!prop.modelValue) {
|
||||
return "请选择"
|
||||
} else {
|
||||
return prop.modelValue
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.ep-picker-box {
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
position: relative;
|
||||
font-size: 14px;
|
||||
color: #333;
|
||||
max-width: 300px;
|
||||
}
|
||||
|
||||
.ep-mask-box {
|
||||
position: fixed;
|
||||
z-index: 999;
|
||||
top: 0;
|
||||
right: 0;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
background: none;
|
||||
}
|
||||
|
||||
.ep-input-box {
|
||||
border: 1px solid rgb(229, 229, 229);
|
||||
border-radius: 4px;
|
||||
padding-left: 10px;
|
||||
position: relative;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
/* 整个下拉组件禁用样式 */
|
||||
.ep-input-box.disabled {
|
||||
cursor: not-allowed;
|
||||
background-color: #f5f7fa;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
/* 展开收起箭头样式 */
|
||||
.ep-input-box .iconfont {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
right: 5px;
|
||||
font-size: 20px;
|
||||
transform: translateY(-50%);
|
||||
color: #B8B8B8;
|
||||
}
|
||||
|
||||
/* 下拉容器样式 外层 */
|
||||
.ep-picker-content-wrap {
|
||||
width: 100%;
|
||||
position: absolute;
|
||||
top: 45px;
|
||||
left: 0;
|
||||
z-index: 9999;
|
||||
padding-top: 6px;
|
||||
}
|
||||
|
||||
/* 下拉容器样式 内层 */
|
||||
.ep-picker-content-wrap .ep-picker-content {
|
||||
background-color: #fff;
|
||||
padding: 3px 0;
|
||||
box-shadow: 0 0 20px 5px rgb(0 0 0 / 30%);
|
||||
border-radius: 5px;
|
||||
max-height: 181px;
|
||||
}
|
||||
|
||||
/* 下拉项通用样式 */
|
||||
.ep-picker-content-wrap .ep-picker-content .option-item {
|
||||
padding: 8px 18px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
/* 无下拉项数据时样式 */
|
||||
.ep-picker-content-wrap .ep-picker-content .option-no-data {
|
||||
padding: 8px 18px;
|
||||
cursor: text;
|
||||
color: #999;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
/* 鼠标移入下拉项样式 */
|
||||
.ep-picker-content-wrap .ep-picker-content .option-item:hover {
|
||||
background-color: #f5f7fa;
|
||||
}
|
||||
|
||||
/* 已选中的下拉项样式 */
|
||||
.ep-picker-content-wrap .ep-picker-content .option-item.active {
|
||||
color: #007AFF;
|
||||
}
|
||||
|
||||
/* 禁用的下拉项样式 */
|
||||
.ep-picker-content-wrap .ep-picker-content .option-item.disabled {
|
||||
color: #c0c4cc;
|
||||
}
|
||||
|
||||
.ep-picker-content-wrap .ep-picker-content .option-item.disabled:hover {
|
||||
cursor: not-allowed;
|
||||
}
|
||||
|
||||
/* 下拉容器指示箭头样式 */
|
||||
.ep-picker-content-wrap .triangle {
|
||||
width: 0;
|
||||
height: 0;
|
||||
border-top: 6px solid rgba(0, 0, 0, 0);
|
||||
border-right: 6px solid rgba(0, 0, 0, 0);
|
||||
border-bottom: 6px solid #fff;
|
||||
border-left: 6px solid rgba(0, 0, 0, 0);
|
||||
position: absolute;
|
||||
top: -6px;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
box-sizing: content-box;
|
||||
}
|
||||
</style>
|
||||
1
src/addon/erp/locale/en.json
Normal file
1
src/addon/erp/locale/en.json
Normal file
@@ -0,0 +1 @@
|
||||
{}
|
||||
31
src/addon/erp/locale/zh-Hans.json
Normal file
31
src/addon/erp/locale/zh-Hans.json
Normal file
@@ -0,0 +1,31 @@
|
||||
{
|
||||
"pages.index": "ERP首页",
|
||||
"pages.member.index": "ERP个人中心",
|
||||
"pages.base.customer.list": "客户管理666",
|
||||
"pages.member.bind": "绑定账号",
|
||||
"pages.statistics": "统计",
|
||||
"pages.base.supplier.list": "供应商管理",
|
||||
"pages.base.warehouse.list": "仓库管理",
|
||||
"pages.product.type.list": "产品分类",
|
||||
"pages.product.unit.list": "产品单位",
|
||||
"pages.product.product.list": "产品列表",
|
||||
"pages.purchase.order.list": "采购单列表",
|
||||
"pages.purchase.order.add": "采购开单",
|
||||
"pages.purchase.order.detail": "采购单详情",
|
||||
"pages.purchase.storage.list": "入库单管理",
|
||||
"pages.purchase.storage.detail": "入库单详情",
|
||||
"pages.purchase.retire.list": "退货单管理",
|
||||
"pages.purchase.retire.detail": "退货单详情",
|
||||
"pages.sell.sell.list": "销售单管理",
|
||||
"pages.sell.sell.add": "添加销售单",
|
||||
"pages.sell.sell.detail": "销售单详情",
|
||||
"pages.sell.delivery.list": "出库单管理",
|
||||
"pages.sell.delivery.add": "添加出库单",
|
||||
"pages.sell.delivery.detail": "出库单详情",
|
||||
"pages.sell.sellreturn.list": "退货单管理",
|
||||
"pages.sell.sellreturn.add": "添加退货单",
|
||||
"pages.sell.sellreturn.detail": "退货单详情",
|
||||
"pages.inventory.inventory.list": "盘点记录",
|
||||
"pages.inventory.inventory.add": "库存盘点",
|
||||
"pages.inventory.statement.list": "库存流水"
|
||||
}
|
||||
48
src/addon/erp/locale/zh-Hans/pages.base.customer.add.json
Normal file
48
src/addon/erp/locale/zh-Hans/pages.base.customer.add.json
Normal file
@@ -0,0 +1,48 @@
|
||||
{
|
||||
"title": "客户管理22222",
|
||||
|
||||
"code": "客户编号",
|
||||
"codePlaceholder": "请输入客户编号",
|
||||
"name": "客户名称",
|
||||
"namePlaceholder": "请输入客户名称",
|
||||
"level": "客户等级",
|
||||
"levelPlaceholder": "请输入客户等级",
|
||||
"contact": "联系人",
|
||||
"contactPlaceholder": "请输入联系人",
|
||||
"phone": "手机号码",
|
||||
"phonePlaceholder": "请输入手机号码",
|
||||
"telephone": "公司电话",
|
||||
"telephonePlaceholder": "请输入公司电话",
|
||||
"fax": "传真",
|
||||
"faxPlaceholder": "请输入传真",
|
||||
"salesmanId": "业务员",
|
||||
"salesmanIdPlaceholder": "请输入业务员",
|
||||
"city": "所属区域",
|
||||
"cityPlaceholder": "请输入所属区域",
|
||||
"address": "详细地址",
|
||||
"addressPlaceholder": "请输入详细地址",
|
||||
"bank": "开户银行",
|
||||
"bankPlaceholder": "请输入开户银行",
|
||||
"banknumber": "银行账户",
|
||||
"banknumberPlaceholder": "请输入银行账户",
|
||||
"period": "账期(天)",
|
||||
"periodPlaceholder": "请输入账期(天)",
|
||||
"idenums": "纳税人识别号",
|
||||
"idenumsPlaceholder": "请输入纳税人识别号",
|
||||
"crecode": "社会信用代码号",
|
||||
"crecodePlaceholder": "请输入社会信用代码号",
|
||||
"amount": "信用额度(元)",
|
||||
"amountPlaceholder": "请输入信用额度(元)",
|
||||
"description": "说明",
|
||||
"descriptionPlaceholder": "请输入说明",
|
||||
"firmid": "企业编号",
|
||||
"firmidPlaceholder": "请输入企业编号",
|
||||
"status": "状态",
|
||||
"statusPlaceholder": "请输入状态",
|
||||
"addCustomer": "添加客户信息",
|
||||
"updateCustomer": "编辑客户信息",
|
||||
"customerDeleteTips": "确定要删除该数据吗?",
|
||||
"customerStatusTips": "确定要变更该数据吗?",
|
||||
"startDate": "请选择开始时间",
|
||||
"endDate": "请选择结束时间"
|
||||
}
|
||||
24
src/addon/erp/locale/zh-Hans/pages.base.customer.detail.json
Normal file
24
src/addon/erp/locale/zh-Hans/pages.base.customer.detail.json
Normal file
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"title": "客户管理77777",
|
||||
"info": "详情",
|
||||
"delete": "删除",
|
||||
"code": "客户编号",
|
||||
"name": "客户名称",
|
||||
"level": "客户等级",
|
||||
"contact": "联系人",
|
||||
"phone": "联系方式",
|
||||
"telephone": "公司电话",
|
||||
"fax": "传真",
|
||||
"salesmanId": "业务员",
|
||||
"city": "所属区域",
|
||||
"address": "详细地址",
|
||||
"bank": "开户银行",
|
||||
"banknumber": "银行账户",
|
||||
"period": "账期(天)",
|
||||
"idenums": "纳税人识别号",
|
||||
"crecode": "社会信用代码号",
|
||||
"amount": "信用额度(元)",
|
||||
"description": "说明",
|
||||
"firmid": "企业编号",
|
||||
"status": "状态"
|
||||
}
|
||||
28
src/addon/erp/locale/zh-Hans/pages.base.customer.list.json
Normal file
28
src/addon/erp/locale/zh-Hans/pages.base.customer.list.json
Normal file
@@ -0,0 +1,28 @@
|
||||
{
|
||||
"title": "客户管理641233333",
|
||||
"info": "详情",
|
||||
"delete": "删除",
|
||||
"code": "客户编号",
|
||||
"name": "客户名称",
|
||||
"level": "客户等级",
|
||||
"contact": "联系人",
|
||||
"phone": "联系方式",
|
||||
"telephone": "公司电话",
|
||||
"fax": "传真",
|
||||
"city": "所属区域",
|
||||
"address": "详细地址",
|
||||
"bank": "开户银行",
|
||||
"banknumber": "银行账户",
|
||||
"period": "账期(天)",
|
||||
"idenums": "纳税人识别号",
|
||||
"crecode": "社会信用代码号",
|
||||
"amount": "信用额度(元)",
|
||||
"description": "说明",
|
||||
"firmid": "企业编号",
|
||||
"status": "状态",
|
||||
"addCustomer": "添加客户信息",
|
||||
"updateCustomer": "编辑客户信息",
|
||||
"Invalid ID": "无效ID",
|
||||
"customerDeleteTips": "确定要删除该数据吗?",
|
||||
"customerStatusTips": "确定要变更该数据吗?"
|
||||
}
|
||||
35
src/addon/erp/locale/zh-Hans/pages.base.supplier.add.json
Normal file
35
src/addon/erp/locale/zh-Hans/pages.base.supplier.add.json
Normal file
@@ -0,0 +1,35 @@
|
||||
{
|
||||
"code": "供应商编码",
|
||||
"codePlaceholder": "请输入供应商编码",
|
||||
"name": "供应商名称",
|
||||
"namePlaceholder": "请输入供应商名称",
|
||||
"contact": "联系人",
|
||||
"contactPlaceholder": "请输入联系人",
|
||||
"phone": "联系方式",
|
||||
"phonePlaceholder": "请输入联系方式",
|
||||
"city": "区域",
|
||||
"cityPlaceholder": "请输入区域",
|
||||
"address": "详细地址",
|
||||
"addressPlaceholder": "请输入详细地址",
|
||||
"mobile": "公司电话",
|
||||
"mobilePlaceholder": "请输入公司电话",
|
||||
"bank": "开户银行",
|
||||
"bankPlaceholder": "请输入开户银行",
|
||||
"banknums": "银行账号",
|
||||
"banknumsPlaceholder": "请输入银行账号",
|
||||
"term": "账期(天)",
|
||||
"termPlaceholder": "请输入账期",
|
||||
"identifier": "纳税人识别号",
|
||||
"identifierPlaceholder": "请输入纳税人识别号",
|
||||
"credit": "社会信用代码",
|
||||
"creditPlaceholder": "请输入社会信用代码",
|
||||
"amount": "信用额度(元)",
|
||||
"amountPlaceholder": "请输入信用额度",
|
||||
"salesmanId": "业务员",
|
||||
"salesmanIdPlaceholder": "请输入业务员",
|
||||
"description": "说明",
|
||||
"descriptionPlaceholder": "请输入说明",
|
||||
"addSupplier": "添加供应商",
|
||||
"updateSupplier": "编辑供应商",
|
||||
"supplierDeleteTips": "确定要删除该数据吗?"
|
||||
}
|
||||
18
src/addon/erp/locale/zh-Hans/pages.base.supplier.detail.json
Normal file
18
src/addon/erp/locale/zh-Hans/pages.base.supplier.detail.json
Normal file
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"code": "供应商编码",
|
||||
"name": "供应商名称",
|
||||
"contact": "联系人",
|
||||
"phone": "联系方式",
|
||||
"city": "区域",
|
||||
"address": "详细地址",
|
||||
"mobile": "公司电话",
|
||||
"bank": "开户银行",
|
||||
"banknums": "银行账号",
|
||||
"term": "账期(天)",
|
||||
"termPlaceholder": "请输入账期",
|
||||
"identifier": "纳税人识别号",
|
||||
"credit": "社会信用代码",
|
||||
"amount": "信用额度(元)",
|
||||
"salesmanId": "业务员",
|
||||
"description": "说明"
|
||||
}
|
||||
22
src/addon/erp/locale/zh-Hans/pages.base.supplier.list.json
Normal file
22
src/addon/erp/locale/zh-Hans/pages.base.supplier.list.json
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"info": "详情",
|
||||
"delete": "删除",
|
||||
"code": "供应商编码",
|
||||
"name": "供应商名称",
|
||||
"contact": "联系人",
|
||||
"phone": "联系方式",
|
||||
"city": "区域",
|
||||
"address": "详细地址",
|
||||
"mobile": "公司电话",
|
||||
"bank": "开户银行",
|
||||
"banknums": "银行账号",
|
||||
"term": "账期(天)",
|
||||
"identifier": "纳税人识别号",
|
||||
"credit": "社会信用代码",
|
||||
"amount": "信用额度(元)",
|
||||
"salesmanId": "业务员",
|
||||
"description": "说明",
|
||||
"addSupplier": "添加供应商",
|
||||
"updateSupplier": "编辑供应商",
|
||||
"supplierDeleteTips": "确定要删除该数据吗?"
|
||||
}
|
||||
24
src/addon/erp/locale/zh-Hans/pages.base.warehouse.add.json
Normal file
24
src/addon/erp/locale/zh-Hans/pages.base.warehouse.add.json
Normal file
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"siteId": "站点ID",
|
||||
"siteIdPlaceholder": "请输入站点ID",
|
||||
"name": "仓库名称",
|
||||
"namePlaceholder": "请输入仓库名称",
|
||||
"number": "仓库编号",
|
||||
"numberPlaceholder": "请输入仓库编号",
|
||||
"remark": "备注",
|
||||
"remarkPlaceholder": "请输入备注",
|
||||
"linkman": "联系人",
|
||||
"linkmanPlaceholder": "请输入联系人",
|
||||
"phone": "联系电话",
|
||||
"phonePlaceholder": "请输入联系电话",
|
||||
"postal": "邮政编码",
|
||||
"postalPlaceholder": "请输入邮政编码",
|
||||
"inventory": "库存",
|
||||
"city": "区域",
|
||||
"cityPlaceholder": "请输入区域",
|
||||
"address": "详细地址",
|
||||
"addressPlaceholder": "请输入详细地址",
|
||||
"addWarehouse": "添加仓库信息",
|
||||
"updateWarehouse": "编辑仓库信息",
|
||||
"warehouseDeleteTips": "确定要删除该数据吗?"
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"name": "仓库名称",
|
||||
"number": "仓库编号",
|
||||
"remark": "备注",
|
||||
"linkman": "联系人",
|
||||
"phone": "联系电话",
|
||||
"postal": "邮政编码",
|
||||
"inventory": "库存",
|
||||
"city": "区域",
|
||||
"address": "详细地址"
|
||||
}
|
||||
16
src/addon/erp/locale/zh-Hans/pages.base.warehouse.list.json
Normal file
16
src/addon/erp/locale/zh-Hans/pages.base.warehouse.list.json
Normal file
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"name": "仓库名称",
|
||||
"number": "仓库编号",
|
||||
"remark": "备注",
|
||||
"linkman": "联系人",
|
||||
"phone": "联系电话",
|
||||
"postal": "邮政编码",
|
||||
"inventory": "库存",
|
||||
"city": "区域",
|
||||
"address": "详细地址",
|
||||
"addWarehouse": "添加仓库信息",
|
||||
"updateWarehouse": "编辑仓库信息",
|
||||
"warehouseDeleteTips": "确定要删除该数据吗?",
|
||||
"info": "详情",
|
||||
"delete": "删除"
|
||||
}
|
||||
48
src/addon/erp/locale/zh-Hans/pages.canteen.return.add.json
Normal file
48
src/addon/erp/locale/zh-Hans/pages.canteen.return.add.json
Normal file
@@ -0,0 +1,48 @@
|
||||
{
|
||||
"code": "退货单号",
|
||||
"codePlaceholderNew": "请输入退货单号",
|
||||
"sellId": "出库单ID",
|
||||
"sellIdPlaceholder": "请输入出库单ID",
|
||||
"sellCode": "出库单单号",
|
||||
"sellCodePlaceholder": "请输入出库单单号",
|
||||
"customerId": "食堂ID",
|
||||
"customerName": "食堂名称",
|
||||
"customerIdPlaceholder": "请输入食堂ID",
|
||||
"customerNamePlaceholder": "请选择食堂",
|
||||
"status": "状态",
|
||||
"statusPlaceholder": "请输入状态",
|
||||
"addSellReturn": "添加退货单",
|
||||
"updateSellReturn": "编辑退货单",
|
||||
"sellReturnDeleteTips": "确定要删除该数据吗?",
|
||||
"startDate": "请选择开始时间",
|
||||
"endDate": "请选择结束时间",
|
||||
"sellList": "出库单",
|
||||
"contact": "联系人",
|
||||
"contactPlaceholder": "请输入联系人",
|
||||
"phone": "联系电话",
|
||||
"phonePlaceholder": "请输入联系电话",
|
||||
"billingTime": "制单时间",
|
||||
"billingTimePlaceholder": "请输入制单时间",
|
||||
"remark": "备注",
|
||||
"remarkPlaceholder": "请输入备注",
|
||||
"productCode": "食材编号",
|
||||
"productList": "食材列表",
|
||||
"warehouseName": "仓库名称",
|
||||
"warehousePlaceholder": "请选择仓库名称",
|
||||
"productName": "食材名称",
|
||||
"productTypeId": "食材分类",
|
||||
"productSpec": "食材规格",
|
||||
"productUnitId": "食材单位",
|
||||
"choose": "选择",
|
||||
"quantity": "数量",
|
||||
"returnQuantity": "退货数量",
|
||||
"sellQuantity": "销售数量",
|
||||
"sellPrice": "单价",
|
||||
"totalPrice": "小计(元)",
|
||||
"total": "合计(元)",
|
||||
"sellDeliveryPlaceholder": "请选择出库单",
|
||||
"reason": "退货原因",
|
||||
"reasonPlaceholder": "请输入退货原因",
|
||||
"inboundImage": "图片",
|
||||
"inboundImagePlaceholder": "请上传图片"
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
{
|
||||
"code": "单据编号",
|
||||
"sellId": "出库单ID",
|
||||
"sellCode": "出库单单号",
|
||||
"customerId": "食堂ID",
|
||||
"customerName": "食堂名称",
|
||||
"status": "状态",
|
||||
"contact": "联系人",
|
||||
"phone": "联系方式",
|
||||
"billingTime": "制单时间",
|
||||
"address": "详细地址",
|
||||
"remark": "备注",
|
||||
"productCode": "食材编号",
|
||||
"warehouseName": "仓库名称",
|
||||
"productName": "食材名称",
|
||||
"productTypeId": "食材分类",
|
||||
"productSpec": "食材规格",
|
||||
"productUnitId": "食材单位",
|
||||
"choose": "选择",
|
||||
"quantity": "数量",
|
||||
"returnQuantity": "退货数量",
|
||||
"sellQuantity": "销售数量",
|
||||
"sellPrice": "单价",
|
||||
"totalPrice": "小计(元)",
|
||||
"total": "合计(元)",
|
||||
"Product List": "食材列表"
|
||||
}
|
||||
26
src/addon/erp/locale/zh-Hans/pages.canteen.return.list.json
Normal file
26
src/addon/erp/locale/zh-Hans/pages.canteen.return.list.json
Normal file
@@ -0,0 +1,26 @@
|
||||
{
|
||||
"code": "单据编号",
|
||||
"sellId": "出库单ID",
|
||||
"sellCode": "出库单单号",
|
||||
"customerId": "食堂ID",
|
||||
"customerName": "食堂名称",
|
||||
"status": "状态",
|
||||
"contact": "联系人",
|
||||
"phone": "联系方式",
|
||||
"billingTime": "制单时间",
|
||||
"address": "详细地址",
|
||||
"remark": "备注",
|
||||
"productCode": "食材编号",
|
||||
"warehouseName": "仓库名称",
|
||||
"productName": "食材名称",
|
||||
"productTypeId": "食材分类",
|
||||
"productSpec": "食材规格",
|
||||
"productUnitId": "食材单位",
|
||||
"choose": "选择",
|
||||
"quantity": "数量",
|
||||
"returnQuantity": "退货数量",
|
||||
"sellQuantity": "销售数量",
|
||||
"sellPrice": "单价",
|
||||
"totalPrice": "小计(元)",
|
||||
"total": "合计(元)"
|
||||
}
|
||||
3
src/addon/erp/locale/zh-Hans/pages.index.json
Normal file
3
src/addon/erp/locale/zh-Hans/pages.index.json
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"warehouseId": "仓库",
|
||||
"warehouseName": "所在仓库",
|
||||
"warehouseNamePlaceholder": "请选择仓库",
|
||||
"productId": "商品ID",
|
||||
"productName": "产品名称",
|
||||
"productSpec": "产品规格",
|
||||
"productUnit": "产品单位",
|
||||
"productNamePlaceholder": "请选择产品",
|
||||
"surfaceNum": "账目数量",
|
||||
"surfaceNumPlaceholder": "请输入账目数量",
|
||||
"number": "盈亏数量",
|
||||
"numberPlaceholder": "请输入盈亏流水数量",
|
||||
"realNum": "实际数量",
|
||||
"realNumPlaceholder": "请输入实际数量",
|
||||
"type": "状态",
|
||||
"typePlaceholder": "请输入状态",
|
||||
"addInventory": "添加库存盘点单",
|
||||
"updateInventory": "编辑库存盘点单",
|
||||
"inventoryDeleteTips": "确定要删除该数据吗?",
|
||||
"updateTime": "更新时间"
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"warehouseId": "仓库",
|
||||
"warehouseName": "所在仓库",
|
||||
"productId": "商品ID",
|
||||
"productName": "产品名称",
|
||||
"productSpec": "产品规格",
|
||||
"productUnit": "产品单位",
|
||||
"surfaceNum": "账目数量",
|
||||
"number": "盈亏数量",
|
||||
"realNum": "实际数量",
|
||||
"type": "状态",
|
||||
"addInventory": "添加库存盘点单",
|
||||
"updateInventory": "编辑库存盘点单",
|
||||
"inventoryDeleteTips": "确定要删除该数据吗?",
|
||||
"updateTime": "更新时间"
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"productId": "商品ID",
|
||||
"productName": "产品名称",
|
||||
"warehouseId": "仓库ID",
|
||||
"warehouseName": "所在仓库",
|
||||
"number": "流水数量",
|
||||
"type": "状态",
|
||||
"addStatement": "添加库存流水",
|
||||
"updateStatement": "编辑库存流水",
|
||||
"statementDeleteTips": "确定要删除该数据吗?",
|
||||
"startDate": "请选择开始时间",
|
||||
"endDate": "请选择结束时间",
|
||||
"updateTime": "更新时间",
|
||||
"productUnit": "产品单位",
|
||||
"productSpec": "产品规格"
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"warehouseId": "仓库id",
|
||||
"warehouseName": "所在仓库",
|
||||
"productId": "产品id",
|
||||
"productName": "产品名称",
|
||||
"productUnit": "产品单位",
|
||||
"productSpec": "产品规格",
|
||||
"inventory": "可用库存",
|
||||
"freeze": "冻结库存",
|
||||
"updateTime": "更新时间"
|
||||
}
|
||||
8
src/addon/erp/locale/zh-Hans/pages.member.bind.json
Normal file
8
src/addon/erp/locale/zh-Hans/pages.member.bind.json
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"bindAdminAccount": "绑定企业账号",
|
||||
"bindAdminTip": "内部系统,请绑定账号使用",
|
||||
"username": "用户名",
|
||||
"usernamePlaceholder": "请输入用户名",
|
||||
"password": "密码",
|
||||
"passwordPlaceholder": "请输入密码"
|
||||
}
|
||||
1
src/addon/erp/locale/zh-Hans/pages.member.index.json
Normal file
1
src/addon/erp/locale/zh-Hans/pages.member.index.json
Normal file
@@ -0,0 +1 @@
|
||||
{}
|
||||
32
src/addon/erp/locale/zh-Hans/pages.product.product.add.json
Normal file
32
src/addon/erp/locale/zh-Hans/pages.product.product.add.json
Normal file
@@ -0,0 +1,32 @@
|
||||
{
|
||||
"code":"产品编号",
|
||||
"codePlaceholder":"请输入产品编号",
|
||||
"name":"产品名称",
|
||||
"namePlaceholder":"请输入产品名称",
|
||||
"productTypeId":"产品类型",
|
||||
"productTypeIdPlaceholder":"请输入产品类型",
|
||||
"spec":"规格",
|
||||
"specPlaceholder":"请输入规格",
|
||||
"inventory":"产品库存",
|
||||
"inventoryPlaceholder":"请输入产品库存",
|
||||
"minWarning":"最低库存预警",
|
||||
"minWarningPlaceholder":"请输入最低库存预警",
|
||||
"maxWarning":"最高库存预警",
|
||||
"maxWarningPlaceholder":"请输入最高库存预警",
|
||||
"raise":"加价费用",
|
||||
"raisePlaceholder":"请输入加价费用",
|
||||
"remark":"备注",
|
||||
"remarkPlaceholder":"请输入备注",
|
||||
"productUnitId":"单位",
|
||||
"productUnitIdPlaceholder":"请输入单位",
|
||||
"unit":"单位值",
|
||||
"unitPlaceholder":"请输入单位值",
|
||||
"image":"图片",
|
||||
"imagePlaceholder":"请输入",
|
||||
"addProduct":"添加产品信息",
|
||||
"updateProduct":"编辑产品信息",
|
||||
"productDeleteTips":"确定要删除该数据吗?",
|
||||
"startDate":"请选择开始时间",
|
||||
"endDate":"请选择结束时间",
|
||||
"createTime":"创建时间"
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"code": "产品编号",
|
||||
"name": "产品名称",
|
||||
"productTypeId": "产品类型",
|
||||
"spec": "规格",
|
||||
"inventory": "产品库存",
|
||||
"minWarning": "最低库存预警",
|
||||
"maxWarning": "最高库存预警",
|
||||
"raise": "加价费用",
|
||||
"remark": "备注",
|
||||
"productUnitId": "单位",
|
||||
"unit": "单位值",
|
||||
"unitPlaceholder": "请输入单位值",
|
||||
"image": "图片",
|
||||
"productDeleteTips": "确定要删除该数据吗?",
|
||||
"createTime": "创建时间"
|
||||
}
|
||||
34
src/addon/erp/locale/zh-Hans/pages.product.product.list.json
Normal file
34
src/addon/erp/locale/zh-Hans/pages.product.product.list.json
Normal file
@@ -0,0 +1,34 @@
|
||||
{
|
||||
"code":"产品编号",
|
||||
"codePlaceholder":"请输入产品编号",
|
||||
"name":"产品名称",
|
||||
"namePlaceholder":"请输入产品名称",
|
||||
"productTypeId":"产品类型",
|
||||
"productTypeIdPlaceholder":"请输入产品类型",
|
||||
"spec":"产品规格",
|
||||
"specPlaceholder":"请输入规格",
|
||||
"inventory":"产品库存",
|
||||
"inventoryPlaceholder":"请输入产品库存",
|
||||
"minWarning":"最低库存预警",
|
||||
"minWarningPlaceholder":"请输入最低库存预警",
|
||||
"maxWarning":"最高库存预警",
|
||||
"maxWarningPlaceholder":"请输入最高库存预警",
|
||||
"raise":"加价费用",
|
||||
"raisePlaceholder":"请输入加价费用",
|
||||
"remark":"备注",
|
||||
"remarkPlaceholder":"请输入备注",
|
||||
"productUnitId":"产品单位",
|
||||
"productUnitIdPlaceholder":"请输入单位",
|
||||
"unit":"单位值",
|
||||
"unitPlaceholder":"请输入单位值",
|
||||
"image":"图片",
|
||||
"imagePlaceholder":"请输入",
|
||||
"addProduct":"添加产品信息",
|
||||
"updateProduct":"编辑产品信息",
|
||||
"productDeleteTips":"确定要删除该数据吗?",
|
||||
"startDate":"请选择开始时间",
|
||||
"endDate":"请选择结束时间",
|
||||
"createTime":"创建时间",
|
||||
"info": "详情",
|
||||
"delete": "删除"
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"code":"产品编号",
|
||||
"name":"产品名称",
|
||||
"productTypeId":"产品类型",
|
||||
"spec":"产品规格",
|
||||
"inventory":"产品库存",
|
||||
"minWarning":"最低库存预警",
|
||||
"maxWarning":"最高库存预警",
|
||||
"raise":"加价费用",
|
||||
"remark":"备注",
|
||||
"productUnitId":"产品单位",
|
||||
"unit":"单位值",
|
||||
"addProduct":"添加产品信息",
|
||||
"updateProduct":"编辑产品信息",
|
||||
"createTime":"创建时间",
|
||||
"choose": "选择",
|
||||
"confirmChoose": "确认选择"
|
||||
}
|
||||
18
src/addon/erp/locale/zh-Hans/pages.product.type.add.json
Normal file
18
src/addon/erp/locale/zh-Hans/pages.product.type.add.json
Normal file
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"pid":"上级分类",
|
||||
"pidPlaceholder":"请选择上级分类",
|
||||
"name":"分类名称",
|
||||
"namePlaceholder":"请输入分类名称",
|
||||
"image":"图片",
|
||||
"imagePlaceholder":"请输入图片",
|
||||
"sort":"排序",
|
||||
"sortPlaceholder":"请输入排序",
|
||||
"addProductType":"添加商品分类",
|
||||
"updateProductType":"编辑商品分类",
|
||||
"productTypeDeleteTips":"确定要删除该数据吗?",
|
||||
"startDate":"请选择开始时间",
|
||||
"endDate":"请选择结束时间",
|
||||
"edit": "详情",
|
||||
"info": "详情",
|
||||
"delete": "删除"
|
||||
}
|
||||
18
src/addon/erp/locale/zh-Hans/pages.product.type.list.json
Normal file
18
src/addon/erp/locale/zh-Hans/pages.product.type.list.json
Normal file
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"pid":"上级分类",
|
||||
"pidPlaceholder":"请选择上级分类",
|
||||
"name":"分类名称",
|
||||
"namePlaceholder":"请输入分类名称",
|
||||
"image":"图片",
|
||||
"imagePlaceholder":"请输入图片",
|
||||
"sort":"排序",
|
||||
"sortPlaceholder":"请输入排序",
|
||||
"addProductType":"添加商品分类",
|
||||
"updateProductType":"编辑商品分类",
|
||||
"productTypeDeleteTips":"确定要删除该数据吗?",
|
||||
"startDate":"请选择开始时间",
|
||||
"endDate":"请选择结束时间",
|
||||
"edit": "编辑",
|
||||
"info": "详情",
|
||||
"delete": "删除"
|
||||
}
|
||||
9
src/addon/erp/locale/zh-Hans/pages.product.unit.add.json
Normal file
9
src/addon/erp/locale/zh-Hans/pages.product.unit.add.json
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"name":"单位名称",
|
||||
"namePlaceholder":"请输入单位名称",
|
||||
"addProductUnit":"添加商品单位",
|
||||
"updateProductUnit":"编辑商品单位",
|
||||
"productUnitDeleteTips":"确定要删除该数据吗?",
|
||||
"startDate":"请选择开始时间",
|
||||
"endDate":"请选择结束时间"
|
||||
}
|
||||
11
src/addon/erp/locale/zh-Hans/pages.product.unit.list.json
Normal file
11
src/addon/erp/locale/zh-Hans/pages.product.unit.list.json
Normal file
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"name":"单位名称",
|
||||
"namePlaceholder":"请输入单位名称",
|
||||
"addProductUnit":"添加商品单位",
|
||||
"updateProductUnit":"编辑商品单位",
|
||||
"productUnitDeleteTips":"确定要删除该数据吗?",
|
||||
"startDate":"请选择开始时间",
|
||||
"endDate":"请选择结束时间",
|
||||
"edit": "编辑",
|
||||
"delete": "删除"
|
||||
}
|
||||
61
src/addon/erp/locale/zh-Hans/pages.purchase.order.add.json
Normal file
61
src/addon/erp/locale/zh-Hans/pages.purchase.order.add.json
Normal file
@@ -0,0 +1,61 @@
|
||||
{
|
||||
"code": "单据编号",
|
||||
"productCode": "产品编号",
|
||||
"codePlaceholder": "请输入单据编号",
|
||||
"supplierId": "供应商",
|
||||
"supplierIdPlaceholder": "请输入供应商",
|
||||
"contact": "联系人",
|
||||
"contactPlaceholder": "请输入联系人",
|
||||
"phone": "联系电话",
|
||||
"phonePlaceholder": "请输入联系电话",
|
||||
"deliveryTime": "交货日期",
|
||||
"deliveryTimePlaceholder": "请输入交货日期",
|
||||
"type": "交货方式",
|
||||
"typePlaceholder": "请输入交货方式",
|
||||
"purmanId": "采购审核人",
|
||||
"purmanIdPlaceholder": "请输入采购审核人",
|
||||
"warehouseId": "仓库",
|
||||
"warehouseIdPlaceholder": "请选择仓库",
|
||||
"billingTime": "制单日期",
|
||||
"billingTimePlaceholder": "请输入制单日期",
|
||||
"waitNums": "待入库数",
|
||||
"waitNumsPlaceholder": "请输入待入库数",
|
||||
"city": "所属区域",
|
||||
"cityPlaceholder": "请输入所属区域",
|
||||
"address": "详细地址",
|
||||
"addressPlaceholder": "请输入详细地址",
|
||||
"totalNums": "总数量",
|
||||
"storageNums": "已入库数",
|
||||
"totalNumsPlaceholder": "请输入总数量",
|
||||
"rate": "税率(%)",
|
||||
"ratePlaceholder": "请输入税率",
|
||||
"money": "税前金额",
|
||||
"moneyPlaceholder": "请输入税前金额",
|
||||
"totalMoney": "应付金额",
|
||||
"totalMoneyPlaceholder": "请输入应付金额",
|
||||
"status": "审核状态",
|
||||
"statusPlaceholder": "请输入",
|
||||
"remark": "备注",
|
||||
"remarkPlaceholder": "请输入备注",
|
||||
"reason": "失败原因",
|
||||
"storageStatus": "入库状态",
|
||||
"addOrder": "添加采购订单",
|
||||
"createTime": "创建时间",
|
||||
"productName": "产品名称",
|
||||
"productTypeId": "产品分类",
|
||||
"productSpec": "产品规格",
|
||||
"productUnitId": "产品单位",
|
||||
"choose": "选择",
|
||||
"purchaseQuantity": "采购数量",
|
||||
"purchasePrice": "采购价格(元)",
|
||||
"totalPrice": "小计(元)",
|
||||
"total": "合计(元)",
|
||||
|
||||
"Enter product": "录入产品",
|
||||
"Add product": "新增",
|
||||
|
||||
"productCode": "产品编号",
|
||||
"spec": "产品规格",
|
||||
"purchasePrice": "采购单价",
|
||||
"purchaseQuantity": "采购数量"
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
{
|
||||
"code": "单据编号",
|
||||
"productCode": "产品编号",
|
||||
"supplierId": "供应商",
|
||||
"contact": "联系人",
|
||||
"phone": "联系电话",
|
||||
"deliveryTime": "交货日期",
|
||||
"type": "交货方式",
|
||||
"purmanId": "采购审核人",
|
||||
"warehouseId": "仓库",
|
||||
"billingTime": "制单日期",
|
||||
"waitNums": "待入库数",
|
||||
"city": "所属区域",
|
||||
"address": "详细地址",
|
||||
"totalNums": "采购数量",
|
||||
"storageNums": "已入库数",
|
||||
"rate": "税率(%)",
|
||||
"money": "税前金额",
|
||||
"totalMoney": "应付金额",
|
||||
"status": "审核状态",
|
||||
"remark": "备注",
|
||||
"reason": "失败原因",
|
||||
"storageStatus": "入库状态",
|
||||
"createTime": "创建时间",
|
||||
"productName": "产品名称",
|
||||
"productTypeId": "产品分类",
|
||||
"productSpec": "产品规格",
|
||||
"productUnitId": "产品单位",
|
||||
"choose": "选择",
|
||||
"purchaseQuantity": "采购数量",
|
||||
"purchasePrice": "采购价格(元)",
|
||||
"totalPrice": "小计(元)",
|
||||
"total": "合计(元)",
|
||||
|
||||
"spec": "产品规格",
|
||||
"info": "详情",
|
||||
"Product List": "产品列表"
|
||||
}
|
||||
35
src/addon/erp/locale/zh-Hans/pages.purchase.order.list.json
Normal file
35
src/addon/erp/locale/zh-Hans/pages.purchase.order.list.json
Normal file
@@ -0,0 +1,35 @@
|
||||
{
|
||||
"code": "单据编号",
|
||||
"productCode": "产品编号",
|
||||
"supplierId": "供应商",
|
||||
"contact": "联系人",
|
||||
"phone": "联系电话",
|
||||
"deliveryTime": "交货日期",
|
||||
"type": "交货方式",
|
||||
"purmanId": "采购审核人",
|
||||
"warehouseId": "仓库",
|
||||
"billingTime": "制单日期",
|
||||
"waitNums": "待入库数",
|
||||
"city": "所属区域",
|
||||
"address": "详细地址",
|
||||
"totalNums": "采购数量",
|
||||
"storageNums": "已入库数",
|
||||
"rate": "税率(%)",
|
||||
"money": "税前金额",
|
||||
"totalMoney": "应付金额",
|
||||
"status": "审核状态",
|
||||
"remark": "备注",
|
||||
"reason": "失败原因",
|
||||
"storageStatus": "入库状态",
|
||||
"createTime": "创建时间",
|
||||
"productName": "产品名称",
|
||||
"productTypeId": "产品分类",
|
||||
"productSpec": "产品规格",
|
||||
"productUnitId": "产品单位",
|
||||
"choose": "选择",
|
||||
"purchaseQuantity": "采购数量",
|
||||
"purchasePrice": "采购价格(元)",
|
||||
"totalPrice": "小计(元)",
|
||||
"total": "合计(元)",
|
||||
"info": "详情"
|
||||
}
|
||||
41
src/addon/erp/locale/zh-Hans/pages.purchase.retire.add.json
Normal file
41
src/addon/erp/locale/zh-Hans/pages.purchase.retire.add.json
Normal file
@@ -0,0 +1,41 @@
|
||||
{
|
||||
"code": "编码",
|
||||
"codePlaceholder": "请输入编码",
|
||||
"supplierId": "供应商ID",
|
||||
"supplierName": "供应商",
|
||||
"supplierIdPlaceholder": "请输入供应商ID",
|
||||
"supplierNamePlaceholder": "请输入供应商",
|
||||
"warehouseId": "仓库ID",
|
||||
"warehouseName": "仓库",
|
||||
"warehouseIdPlaceholder": "请输入仓库ID",
|
||||
"billingTime": "制单时间",
|
||||
"billingTimePlaceholder": "请输入制单时间",
|
||||
"remark": "备注",
|
||||
"remarkPlaceholder": "请输入备注",
|
||||
"reviewerId": "审核人",
|
||||
"reviewerIdPlaceholder": "请输入审核人",
|
||||
"money": "退款金额",
|
||||
"moneyPlaceholder": "请输入退款金额",
|
||||
"totalnums": "总数",
|
||||
"totalnumsPlaceholder": "请输入总数",
|
||||
"why": "审核失败原因",
|
||||
"reason": "未通过审核原因",
|
||||
"status": "状态",
|
||||
"addRetire": "添加",
|
||||
"infoRetire": "退货单详情",
|
||||
"productCode": "产品编号",
|
||||
"productSpec": "产品规格",
|
||||
"productName": "产品名称",
|
||||
"productUnitId": "产品单位",
|
||||
"productTypeId": "产品分类",
|
||||
|
||||
"choose": "选择",
|
||||
"retireQuantity": "退货数量",
|
||||
"retirePrice": "退货价格(元)",
|
||||
"totalPrice": "小计(元)",
|
||||
"total": "合计(元)",
|
||||
"updateTime": "更新时间",
|
||||
|
||||
"Enter product": "录入产品",
|
||||
"Add product": "新增"
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
{
|
||||
"code": "编码",
|
||||
"codePlaceholder": "请输入编码",
|
||||
"supplierId": "供应商ID",
|
||||
"supplierName": "供应商",
|
||||
"contact": "联系人",
|
||||
"phone": "联系电话",
|
||||
"warehouseId": "仓库ID",
|
||||
"warehouseName": "仓库",
|
||||
"billingTime": "制单时间",
|
||||
"remark": "备注",
|
||||
"reviewerId": "审核人",
|
||||
"money": "退款金额",
|
||||
"totalnums": "总数",
|
||||
"why": "审核失败原因",
|
||||
"reason": "未通过审核原因",
|
||||
"status": "状态",
|
||||
"addRetire": "添加",
|
||||
"infoRetire": "退货单详情",
|
||||
"productCode": "产品编号",
|
||||
"productSpec": "产品规格",
|
||||
"productName": "产品名称",
|
||||
"productUnitId": "产品单位",
|
||||
"productTypeId": "产品分类",
|
||||
|
||||
"choose": "选择",
|
||||
"retireQuantity": "退货数量",
|
||||
"retirePrice": "退货价格(元)",
|
||||
"totalPrice": "小计(元)",
|
||||
"total": "合计(元)",
|
||||
"updateTime": "更新时间",
|
||||
|
||||
"Product List": "产品列表"
|
||||
}
|
||||
30
src/addon/erp/locale/zh-Hans/pages.purchase.retire.list.json
Normal file
30
src/addon/erp/locale/zh-Hans/pages.purchase.retire.list.json
Normal file
@@ -0,0 +1,30 @@
|
||||
{
|
||||
"code": "编码",
|
||||
"codePlaceholder": "请输入编码",
|
||||
"supplierId": "供应商ID",
|
||||
"supplierName": "供应商",
|
||||
"warehouseId": "仓库ID",
|
||||
"warehouseName": "仓库",
|
||||
"billingTime": "制单时间",
|
||||
"remark": "备注",
|
||||
"reviewerId": "审核人",
|
||||
"money": "退款金额",
|
||||
"totalnums": "总数",
|
||||
"why": "审核失败原因",
|
||||
"reason": "未通过审核原因",
|
||||
"status": "状态",
|
||||
"addRetire": "添加",
|
||||
"infoRetire": "退货单详情",
|
||||
"productCode": "产品编号",
|
||||
"productSpec": "产品规格",
|
||||
"productName": "产品名称",
|
||||
"productUnitId": "产品单位",
|
||||
"productTypeId": "产品分类",
|
||||
|
||||
"choose": "选择",
|
||||
"retireQuantity": "退货数量",
|
||||
"retirePrice": "退货价格(元)",
|
||||
"totalPrice": "小计(元)",
|
||||
"total": "合计(元)",
|
||||
"updateTime": "更新时间"
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
{
|
||||
"code": "单据编号",
|
||||
"purchaseCode": "采购单号",
|
||||
"supplierName": "供应商",
|
||||
"contact": "联系人",
|
||||
"phone": "联系方式",
|
||||
"billingTime": "制单时间",
|
||||
"deliveryTime": "交货日期",
|
||||
"totalNum": "入库数量",
|
||||
"rate": "税率",
|
||||
"money": "总金额",
|
||||
"partitionId": "库区",
|
||||
"warehouseId": "仓库编号",
|
||||
"theWay": "交货方式",
|
||||
"city": "所属区域",
|
||||
"address": "详细地址",
|
||||
"stromanId": "入库人",
|
||||
"status": "入库单状态",
|
||||
"remark": "备注",
|
||||
"addStorage": "添加入库",
|
||||
"updateStorage": "编辑入库",
|
||||
"infoStorage": "入库单详情",
|
||||
"updateTime": "更新时间",
|
||||
"createTime": "创建时间",
|
||||
"productCode": "产品编号",
|
||||
"productName": "产品名称",
|
||||
"productTypeId": "产品分类",
|
||||
"productSpec": "产品规格",
|
||||
"productUnitId": "产品单位",
|
||||
"purchaseQuantity": "入库数",
|
||||
"purchasePrice": "单价(元)",
|
||||
"totalPrice": "小计(元)",
|
||||
"total": "合计(元)",
|
||||
"Product List": "产品列表"
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
{
|
||||
"code": "单据编号",
|
||||
"codePlaceholder": "请输入单据编号",
|
||||
"purchaseCode": "采购单号",
|
||||
"purchaseIdPlaceholder": "请输入采购单号",
|
||||
"supplierName": "供应商",
|
||||
"supplierIdPlaceholder": "请输入供应商编号",
|
||||
"contact": "联系人",
|
||||
"phone": "联系方式",
|
||||
"adminId": "入库单录入人员",
|
||||
"billingTime": "制单时间",
|
||||
"deliveryTime": "交货日期",
|
||||
"totalNum": "入库数量",
|
||||
"rate": "税率",
|
||||
"money": "总金额",
|
||||
"partitionId": "库区",
|
||||
"warehouseId": "仓库编号",
|
||||
"theWay": "交货方式",
|
||||
"city": "所属区域",
|
||||
"address": "详细地址",
|
||||
"stromanId": "入库人",
|
||||
"status": "入库单状态",
|
||||
"remark": "备注",
|
||||
"createTime": "创建时间",
|
||||
"updateTime": "更新时间",
|
||||
"productCode": "产品编号",
|
||||
"productName": "产品名称",
|
||||
"productTypeId": "产品分类",
|
||||
"productSpec": "产品规格",
|
||||
"productUnitId": "产品单位",
|
||||
"purchaseQuantity": "入库数",
|
||||
"purchasePrice": "单价(元)",
|
||||
"totalPrice": "小计(元)",
|
||||
"total": "合计(元)"
|
||||
}
|
||||
60
src/addon/erp/locale/zh-Hans/pages.sell.delivery.add.json
Normal file
60
src/addon/erp/locale/zh-Hans/pages.sell.delivery.add.json
Normal file
@@ -0,0 +1,60 @@
|
||||
{
|
||||
"code": "单据编号",
|
||||
"codePlaceholder": "请输入单据编号",
|
||||
"sellCode": "销售单单号",
|
||||
"sellCodePlaceholder": "请输入销售单单号",
|
||||
"sellId": "销售单ID",
|
||||
"sellIdPlaceholder": "请输入销售单ID",
|
||||
"customerId": "客户ID",
|
||||
"customerName": "客户名称",
|
||||
"customerIdPlaceholder": "请输入客户ID",
|
||||
"contact": "联系人",
|
||||
"contactPlaceholder": "请输入联系人",
|
||||
"phone": "联系方式",
|
||||
"phonePlaceholder": "请输入联系方式",
|
||||
"billingTime": "制单时间",
|
||||
"billingTimePlaceholder": "请输入制单时间",
|
||||
"deliveryTime": "交货日期",
|
||||
"deliveryTimePlaceholder": "请输入交货日期",
|
||||
"totalNum": "数量",
|
||||
"totalNumPlaceholder": "请输入合计",
|
||||
"type": "交货方式",
|
||||
"typePlaceholder": "请输入交货方式",
|
||||
"city": "所属区域",
|
||||
"cityPlaceholder": "请输入所属区域",
|
||||
"address": "详细地址",
|
||||
"addressPlaceholder": "请输入详细地址",
|
||||
"status": "状态",
|
||||
"statusPlaceholder": "请输入状态",
|
||||
"remark": "备注",
|
||||
"remarkPlaceholder": "请输入备注",
|
||||
"addDelivery": "添加出库单",
|
||||
"updateDelivery": "编辑出库单",
|
||||
"infoDelivery": "出库单详情",
|
||||
"deliveryDeleteTips": "确定要删除该数据吗?",
|
||||
"startDate": "请选择开始时间",
|
||||
"endDate": "请选择结束时间",
|
||||
|
||||
"productCode": "产品编号",
|
||||
"productName": "产品名称",
|
||||
"productList": "产品列表",
|
||||
"productTypeId": "产品分类",
|
||||
"productSpec": "产品规格",
|
||||
"productUnitId": "产品单位",
|
||||
"choose": "选择",
|
||||
"quantity": "数量",
|
||||
"deliveryQuantity": "出库数量",
|
||||
"inventory": "库存",
|
||||
"canUseInventory": "可用库存",
|
||||
"warehouseName": "仓库名称",
|
||||
"warehousePlaceholder": "请选择仓库",
|
||||
"sellPrice": "销售单价(元)",
|
||||
"totalPrice": "小计(元)",
|
||||
"total": "合计(元)",
|
||||
|
||||
|
||||
"delivery": "发货",
|
||||
"sellDelivery": "销售单",
|
||||
"sellDeliveryPlaceholder": "请选择销售单",
|
||||
"sellQuantity": "出库数量"
|
||||
}
|
||||
34
src/addon/erp/locale/zh-Hans/pages.sell.delivery.detail.json
Normal file
34
src/addon/erp/locale/zh-Hans/pages.sell.delivery.detail.json
Normal file
@@ -0,0 +1,34 @@
|
||||
{
|
||||
"code": "单据编号",
|
||||
"sellCode": "销售单号",
|
||||
"sellId": "销售单ID",
|
||||
"customerId": "客户ID",
|
||||
"customerName": "客户名称",
|
||||
"contact": "联系人",
|
||||
"phone": "联系方式",
|
||||
"billingTime": "制单时间",
|
||||
"deliveryTime": "交货日期",
|
||||
"totalNum": "数量",
|
||||
"address": "详细地址",
|
||||
"status": "状态",
|
||||
"remark": "备注",
|
||||
"city": "所属区域",
|
||||
"productCode": "产品编号",
|
||||
"productName": "产品名称",
|
||||
"productTypeId": "产品分类",
|
||||
"productSpec": "产品规格",
|
||||
"productUnitId": "产品单位",
|
||||
"choose": "选择",
|
||||
"quantity": "数量",
|
||||
"deliveryQuantity": "出库数量",
|
||||
"inventory": "库存",
|
||||
"canUseInventory": "可用库存",
|
||||
"warehouseName": "仓库名称",
|
||||
"sellPrice": "销售单价(元)",
|
||||
"totalPrice": "小计(元)",
|
||||
"total": "合计(元)",
|
||||
|
||||
"type": "交货方式",
|
||||
"delivery": "发货",
|
||||
"Product List": "产品列表"
|
||||
}
|
||||
35
src/addon/erp/locale/zh-Hans/pages.sell.delivery.list.json
Normal file
35
src/addon/erp/locale/zh-Hans/pages.sell.delivery.list.json
Normal file
@@ -0,0 +1,35 @@
|
||||
{
|
||||
"code": "单据编号",
|
||||
"sellCode": "销售单号",
|
||||
"sellId": "销售单ID",
|
||||
"customerId": "客户ID",
|
||||
"customerName": "客户名称",
|
||||
"linkman": "联系人",
|
||||
"phone": "联系方式",
|
||||
"billingTime": "制单时间",
|
||||
"deliveryTime": "交货日期",
|
||||
"totalNum": "数量",
|
||||
"address": "详细地址",
|
||||
"status": "状态",
|
||||
"remark": "备注",
|
||||
"productCode": "产品编号",
|
||||
"productName": "产品名称",
|
||||
"productTypeId": "产品分类",
|
||||
"productSpec": "产品规格",
|
||||
"productUnitId": "产品单位",
|
||||
"choose": "选择",
|
||||
"quantity": "数量",
|
||||
"deliveryQuantity": "出库数量",
|
||||
"inventory": "库存",
|
||||
"canUseInventory": "可用库存",
|
||||
"warehouseName": "仓库名称",
|
||||
"sellPrice": "销售单价(元)",
|
||||
"totalPrice": "小计(元)",
|
||||
"total": "合计(元)",
|
||||
|
||||
"contact": "联系人",
|
||||
|
||||
"delivery": "发货",
|
||||
"sellDelivery": "销售单",
|
||||
"sellQuantity": "出库数量"
|
||||
}
|
||||
64
src/addon/erp/locale/zh-Hans/pages.sell.sell.add.json
Normal file
64
src/addon/erp/locale/zh-Hans/pages.sell.sell.add.json
Normal file
@@ -0,0 +1,64 @@
|
||||
{
|
||||
"code": "单据编号",
|
||||
"codePlaceholder": "请输入单据编号",
|
||||
"customerId": "客户名称",
|
||||
"customerIdPlaceholder": "请输入客户",
|
||||
|
||||
"contact": "联系人",
|
||||
"phone": "联系电话",
|
||||
|
||||
"deliveryTime": "交货时间",
|
||||
"deliveryTimePlaceholder": "请输入交货时间",
|
||||
"type": "交货方式",
|
||||
"typePlaceholder": "交货方式",
|
||||
"purmanId": "销售审核人",
|
||||
"purmanIdPlaceholder": "请输入销售审核人",
|
||||
"billingTime": "制单日期",
|
||||
"billingTimePlaceholder": "请输入制单日期",
|
||||
"totalNums": "总数量",
|
||||
"totalNumsPlaceholder": "请输入总数量",
|
||||
"rate": "税率(%)",
|
||||
"ratePlaceholder": "请输入税率",
|
||||
"theoryMoney": "税前金额",
|
||||
"theoryMoneyPlaceholder": "请输入税前金额",
|
||||
"realMoney": "应付金额",
|
||||
"realMoneyPlaceholder": "请输入应付金额",
|
||||
"status": "状态",
|
||||
"statusPlaceholder": "请选择状态",
|
||||
"supplierName": "供应商名称",
|
||||
"remark": "备注",
|
||||
"remarkPlaceholder": "请输入备注",
|
||||
"createBy": "操作员",
|
||||
"createByPlaceholder": "请输入操作员",
|
||||
"addSell": "添加销售单",
|
||||
"addDelivery": "添加发货单",
|
||||
"updateSell": "编辑销售单",
|
||||
"infoSell": "销售单详情",
|
||||
"sellDeleteTips": "确定要删除该数据吗?",
|
||||
"startDate": "请选择开始时间",
|
||||
"endDate": "请选择结束时间",
|
||||
|
||||
"productCode": "产品编号",
|
||||
"productName": "产品名称",
|
||||
"productTypeId": "产品分类",
|
||||
"productSpec": "产品规格",
|
||||
"productUnitId": "产品单位",
|
||||
"choose": "选择",
|
||||
"quantity": "数量",
|
||||
"inventory": "库存",
|
||||
"canUseInventory": "可用库存",
|
||||
"warehouseName": "仓库名称",
|
||||
"sellPrice": "销售单价(元)",
|
||||
"totalPrice": "小计(元)",
|
||||
"total": "合计(元)",
|
||||
|
||||
"city": "所属区域",
|
||||
"address": "详细地址",
|
||||
|
||||
"delivery": "发货",
|
||||
"sellDelivery": "销售单",
|
||||
"sellQuantity": "出库数量",
|
||||
|
||||
"Enter product": "录入产品",
|
||||
"Add product": "新增"
|
||||
}
|
||||
38
src/addon/erp/locale/zh-Hans/pages.sell.sell.detail.json
Normal file
38
src/addon/erp/locale/zh-Hans/pages.sell.sell.detail.json
Normal file
@@ -0,0 +1,38 @@
|
||||
{
|
||||
"code": "单据编号",
|
||||
"customerId": "客户名称",
|
||||
"contact": "联系人",
|
||||
"phone": "联系电话",
|
||||
"deliveryTime": "交货时间",
|
||||
"type": "交货方式",
|
||||
"typePlaceholder": "交货方式",
|
||||
"billingTime": "制单日期",
|
||||
"totalNums": "总数量",
|
||||
"rate": "税率(%)",
|
||||
"theoryMoney": "税前金额",
|
||||
"realMoney": "应付金额",
|
||||
"status": "状态",
|
||||
"supplierName": "供应商名称",
|
||||
"remark": "备注",
|
||||
"productCode": "产品编号",
|
||||
"productName": "产品名称",
|
||||
"productTypeId": "产品分类",
|
||||
"productSpec": "产品规格",
|
||||
"productUnitId": "产品单位",
|
||||
"choose": "选择",
|
||||
"quantity": "数量",
|
||||
"inventory": "库存",
|
||||
"canUseInventory": "可用库存",
|
||||
"warehouseName": "仓库名称",
|
||||
"sellPrice": "销售单价(元)",
|
||||
"totalPrice": "小计(元)",
|
||||
"total": "合计(元)",
|
||||
"updateTime": "更新时间",
|
||||
"city": "所属区域",
|
||||
"address": "详细地址",
|
||||
"completeOrder": "订单完成",
|
||||
"delivery": "发货",
|
||||
"sellDelivery": "销售单",
|
||||
"sellQuantity": "出库数量",
|
||||
"Product List": "产品列表"
|
||||
}
|
||||
39
src/addon/erp/locale/zh-Hans/pages.sell.sell.list.json
Normal file
39
src/addon/erp/locale/zh-Hans/pages.sell.sell.list.json
Normal file
@@ -0,0 +1,39 @@
|
||||
{
|
||||
"code": "单据编号",
|
||||
"customerId": "客户名称",
|
||||
"contact": "联系人",
|
||||
"phone": "联系电话",
|
||||
"deliveryTime": "交货时间",
|
||||
"type": "交货方式",
|
||||
"typePlaceholder": "交货方式",
|
||||
"billingTime": "制单日期",
|
||||
"totalNums": "总数量",
|
||||
"rate": "税率(%)",
|
||||
"theoryMoney": "税前金额",
|
||||
"realMoney": "应付金额",
|
||||
"status": "状态",
|
||||
"supplierName": "供应商名称",
|
||||
"remark": "备注",
|
||||
"productCode": "产品编号",
|
||||
"productName": "产品名称",
|
||||
"productTypeId": "产品分类",
|
||||
"productSpec": "产品规格",
|
||||
"productUnitId": "产品单位",
|
||||
"choose": "选择",
|
||||
"quantity": "数量",
|
||||
"inventory": "库存",
|
||||
"canUseInventory": "可用库存",
|
||||
"warehouseName": "仓库名称",
|
||||
"sellPrice": "销售单价(元)",
|
||||
"totalPrice": "小计(元)",
|
||||
"total": "合计(元)",
|
||||
"updateTime": "更新时间",
|
||||
"city": "所属区域",
|
||||
"address": "详细地址",
|
||||
"completeOrder": "订单完成",
|
||||
"delivery": "发货",
|
||||
"sellDelivery": "销售单",
|
||||
"sellQuantity": "出库数量",
|
||||
"Enter product": "录入产品",
|
||||
"Add product": "新增"
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
{
|
||||
"code": "单据编号",
|
||||
"customerId": "客户名称",
|
||||
"contact": "联系人",
|
||||
"phone": "联系电话",
|
||||
"deliveryTime": "交货时间",
|
||||
"type": "交货方式",
|
||||
"typePlaceholder": "交货方式",
|
||||
"billingTime": "制单日期",
|
||||
"totalNums": "总数量",
|
||||
"rate": "税率(%)",
|
||||
"theoryMoney": "税前金额",
|
||||
"realMoney": "应付金额",
|
||||
"status": "状态",
|
||||
"supplierName": "供应商名称",
|
||||
"remark": "备注",
|
||||
"productCode": "产品编号",
|
||||
"productName": "产品名称",
|
||||
"productTypeId": "产品分类",
|
||||
"productSpec": "产品规格",
|
||||
"productUnitId": "产品单位",
|
||||
"choose": "选择",
|
||||
"quantity": "数量",
|
||||
"inventory": "库存",
|
||||
"canUseInventory": "可用库存",
|
||||
"warehouseName": "仓库名称",
|
||||
"sellPrice": "销售单价(元)",
|
||||
"totalPrice": "小计(元)",
|
||||
"total": "合计(元)",
|
||||
"updateTime": "更新时间",
|
||||
"city": "所属区域",
|
||||
"address": "详细地址",
|
||||
"completeOrder": "订单完成",
|
||||
"delivery": "发货",
|
||||
"sellDelivery": "销售单",
|
||||
"sellQuantity": "出库数量",
|
||||
"Enter product": "录入产品",
|
||||
"Add product": "新增",
|
||||
"choose": "选择",
|
||||
"confirmChoose": "确认选择"
|
||||
}
|
||||
43
src/addon/erp/locale/zh-Hans/pages.sell.sellreturn.add.json
Normal file
43
src/addon/erp/locale/zh-Hans/pages.sell.sellreturn.add.json
Normal file
@@ -0,0 +1,43 @@
|
||||
{
|
||||
"code": "单据编号",
|
||||
"codePlaceholder": "请输入单据编号",
|
||||
"sellId": "销售单ID",
|
||||
"sellIdPlaceholder": "请输入销售单ID",
|
||||
"sellCode": "销售单单号",
|
||||
"sellCodePlaceholder": "请输入销售单单号",
|
||||
"customerId": "客户ID",
|
||||
"customerName": "客户名称",
|
||||
"customerIdPlaceholder": "请输入客户ID",
|
||||
"status": "状态",
|
||||
"statusPlaceholder": "请输入状态",
|
||||
"addSellReturn": "添加退货单",
|
||||
"updateSellReturn": "编辑退货单",
|
||||
"sellReturnDeleteTips": "确定要删除该数据吗?",
|
||||
"startDate": "请选择开始时间",
|
||||
"endDate": "请选择结束时间",
|
||||
"sellList": "销售单",
|
||||
"contact": "联系人",
|
||||
"contactPlaceholder": "请输入联系人",
|
||||
"phone": "联系方式",
|
||||
"phonePlaceholder": "请输入联系方式",
|
||||
"billingTime": "制单时间",
|
||||
"billingTimePlaceholder": "请输入制单时间",
|
||||
"remark": "备注",
|
||||
"remarkPlaceholder": "请输入备注",
|
||||
"productCode": "产品编号",
|
||||
"productList": "产品列表",
|
||||
"warehouseName": "仓库名称",
|
||||
"warehousePlaceholder": "请输入仓库名称",
|
||||
"productName": "产品名称",
|
||||
"productTypeId": "产品分类",
|
||||
"productSpec": "产品规格",
|
||||
"productUnitId": "产品单位",
|
||||
"choose": "选择",
|
||||
"quantity": "数量",
|
||||
"returnQuantity": "退货数量",
|
||||
"sellQuantity": "销售数量",
|
||||
"sellPrice": "单价",
|
||||
"totalPrice": "小计(元)",
|
||||
"total": "合计(元)",
|
||||
"sellDeliveryPlaceholder": "请选择销售单"
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
{
|
||||
"code": "单据编号",
|
||||
"sellId": "销售单ID",
|
||||
"sellCode": "销售单单号",
|
||||
"customerId": "客户ID",
|
||||
"customerName": "客户名称",
|
||||
"status": "状态",
|
||||
"contact": "联系人",
|
||||
"phone": "联系方式",
|
||||
"billingTime": "制单时间",
|
||||
"address": "详细地址",
|
||||
"remark": "备注",
|
||||
"productCode": "产品编号",
|
||||
"warehouseName": "仓库名称",
|
||||
"productName": "产品名称",
|
||||
"productTypeId": "产品分类",
|
||||
"productSpec": "产品规格",
|
||||
"productUnitId": "产品单位",
|
||||
"choose": "选择",
|
||||
"quantity": "数量",
|
||||
"returnQuantity": "退货数量",
|
||||
"sellQuantity": "销售数量",
|
||||
"sellPrice": "单价",
|
||||
"totalPrice": "小计(元)",
|
||||
"total": "合计(元)",
|
||||
"Product List": "产品列表"
|
||||
}
|
||||
26
src/addon/erp/locale/zh-Hans/pages.sell.sellreturn.list.json
Normal file
26
src/addon/erp/locale/zh-Hans/pages.sell.sellreturn.list.json
Normal file
@@ -0,0 +1,26 @@
|
||||
{
|
||||
"code": "单据编号",
|
||||
"sellId": "销售单ID",
|
||||
"sellCode": "销售单单号",
|
||||
"customerId": "客户ID",
|
||||
"customerName": "客户名称",
|
||||
"status": "状态",
|
||||
"contact": "联系人",
|
||||
"phone": "联系方式",
|
||||
"billingTime": "制单时间",
|
||||
"address": "详细地址",
|
||||
"remark": "备注",
|
||||
"productCode": "产品编号",
|
||||
"warehouseName": "仓库名称",
|
||||
"productName": "产品名称",
|
||||
"productTypeId": "产品分类",
|
||||
"productSpec": "产品规格",
|
||||
"productUnitId": "产品单位",
|
||||
"choose": "选择",
|
||||
"quantity": "数量",
|
||||
"returnQuantity": "退货数量",
|
||||
"sellQuantity": "销售数量",
|
||||
"sellPrice": "单价",
|
||||
"totalPrice": "小计(元)",
|
||||
"total": "合计(元)"
|
||||
}
|
||||
20
src/addon/erp/locale/zh-Hans/pages.statistics.json
Normal file
20
src/addon/erp/locale/zh-Hans/pages.statistics.json
Normal file
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"dataSummary": "数据汇总",
|
||||
"updateTime": "更新时间",
|
||||
"todayPurchaseCount": "今日采购订单数",
|
||||
"purchaseCount": "采购订单总数",
|
||||
"yesterday": "昨日",
|
||||
"todayPurchaseSale": "今日采购金额",
|
||||
"purchaseTotal": "采购总额(元)",
|
||||
"todaySellCount": "今日销售订单数",
|
||||
"sellCount": "销售订单总数",
|
||||
"todaySellSale": "今日销售金额",
|
||||
"salesTotal": "销售总额(元)",
|
||||
"agentMatters": "代办事项",
|
||||
"waitApprovePurchase": "待审核采购单",
|
||||
"waitInventoryPurchase": "待入库订单",
|
||||
"waitReturnPurchase": "待退货采购单",
|
||||
"waitSellOrder": "待审核销售单",
|
||||
"waitDeliveryOrder": "待出库销售单",
|
||||
"waitReturnOrder": "待退货销售单"
|
||||
}
|
||||
165
src/addon/erp/pages/base/customer/add.vue
Normal file
165
src/addon/erp/pages/base/customer/add.vue
Normal file
@@ -0,0 +1,165 @@
|
||||
<template>
|
||||
<view class="bg-[var(--page-bg-color)] min-h-[100vh] overflow-hidden form-edit" :style="themeColor()">
|
||||
<u-form labelPosition="left" :model="formData" errorType='toast' :rules="rules" ref="formRef" labelWidth="180rpx">
|
||||
<view class="sidebar-margin card-template mt-[var(--top-m)] py-[20rpx]">
|
||||
<view>
|
||||
<u-form-item :label="t('name')" prop="name" required borderBottom>
|
||||
<u-input fontSize="28rpx" v-model.trim="formData.name" border="none" clearable placeholderStyle="color: #888" :placeholder="t('namePlaceholder')"/>
|
||||
</u-form-item>
|
||||
</view>
|
||||
<view class="mt-[16rpx]">
|
||||
<u-form-item :label="t('contact')" prop="contact" required borderBottom>
|
||||
<u-input fontSize="28rpx" v-model="formData.contact" :placeholder="t('contactPlaceholder')" border="none"></u-input>
|
||||
</u-form-item>
|
||||
</view>
|
||||
<view class="mt-[16rpx]">
|
||||
<u-form-item :label="t('phone')" prop="phone" required borderBottom>
|
||||
<u-input fontSize="28rpx" v-model.trim="formData.phone" type="number" maxlength="11" border="none" clearable :placeholder="t('phonePlaceholder')" placeholderStyle="color: #888"/>
|
||||
</u-form-item>
|
||||
</view>
|
||||
<view class="mt-[16rpx]">
|
||||
<u-form-item :label="t('telephone')" prop="telephone" borderBottom>
|
||||
<u-input fontSize="28rpx" v-model="formData.telephone" :placeholder="t('telephonePlaceholder')" border="none"></u-input>
|
||||
</u-form-item>
|
||||
</view>
|
||||
<view class="mt-[16rpx]">
|
||||
<u-form-item :label="t('city')" prop="cityName" borderBottom>
|
||||
<view class="flex w-full items-center h-[52rpx]" @click="selectArea">
|
||||
<view v-if="!formData.cityName" class="text-[#888] text-[28rpx] flex-1">{{ t('cityPlaceholder') }}</view>
|
||||
<view v-else class="text-[28rpx] flex-1 leading-[1.4]">{{ formData.cityName }}</view>
|
||||
</view>
|
||||
</u-form-item>
|
||||
</view>
|
||||
<view class="mt-[16rpx]">
|
||||
<u-form-item :label="t('address')" prop="address" borderBottom>
|
||||
<u-input fontSize="28rpx" v-model="formData.address" border="none" clearable maxlength="120" :placeholder="t('addressPlaceholder')" placeholderStyle="color: #888"/>
|
||||
</u-form-item>
|
||||
</view>
|
||||
<view class="mt-[16rpx]">
|
||||
<u-form-item :label="t('description')" prop="description">
|
||||
<u-textarea fontSize="28rpx" v-model="formData.description" :placeholder="t('descriptionPlaceholder')" border="none"></u-textarea>
|
||||
</u-form-item>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</u-form>
|
||||
<view class="w-full footer">
|
||||
<view class="py-[var(--top-m)] px-[var(--sidebar-m)] footer w-full fixed bottom-0 left-0 right-0 box-border">
|
||||
<button hover-class="none" class="!bg-[var(--primary-color)] text-[#fff] h-[80rpx] leading-[80rpx] rounded-[100rpx] text-[26rpx] font-500"
|
||||
@click="handSave" :disabled="loading" :class="{'opacity-50': loading}">{{t('save')}}</button>
|
||||
</view>
|
||||
</view>
|
||||
<area-select ref="areaRef" @complete="areaSelectComplete" :area-id="0"/>
|
||||
</view>
|
||||
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, reactive, computed } from 'vue'
|
||||
import { t } from '@/locale'
|
||||
import { addCustomer } from '@/addon/erp/api/base';
|
||||
import { generatedCode } from '@/addon/erp/utils/common';
|
||||
import { redirect } from '@/utils/common';
|
||||
|
||||
const formRef: any = ref(null)
|
||||
const loading = ref(false)
|
||||
|
||||
const areaRef = ref()
|
||||
const isSelectAddress = ref(false)
|
||||
|
||||
const rules = computed(() => {
|
||||
return {
|
||||
'name': {
|
||||
type: 'string',
|
||||
required: true,
|
||||
message: t('namePlaceholder'),
|
||||
trigger: ['blur', 'change'],
|
||||
},
|
||||
'contact': {
|
||||
type: 'string',
|
||||
required: true,
|
||||
message: t('contactPlaceholder'),
|
||||
trigger: ['blur', 'change'],
|
||||
},
|
||||
'phone': [
|
||||
{
|
||||
type: 'string',
|
||||
required: true,
|
||||
message: t('phonePlaceholder'),
|
||||
trigger: ['blur', 'change'],
|
||||
},
|
||||
{
|
||||
validator(rule: any, value: any, callback: any) {
|
||||
let mobile = /^1[3-9]\d{9}$/;
|
||||
if (!mobile.test(value)){
|
||||
callback(new Error(t('mobileError')))
|
||||
} else {
|
||||
callback()
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
})
|
||||
const formData = reactive({
|
||||
code: generatedCode("CT"),
|
||||
name: '',
|
||||
contact: '',
|
||||
phone: '',
|
||||
telephone: '',
|
||||
city: '',
|
||||
cityName: '',
|
||||
address: '',
|
||||
description: ''
|
||||
})
|
||||
|
||||
|
||||
const selectArea = () => {
|
||||
isSelectAddress.value = true
|
||||
areaRef.value.open()
|
||||
}
|
||||
|
||||
const areaSelectComplete = (event: any) => {
|
||||
let cityArr = [] as any[];
|
||||
cityArr = [event.province.id || 0, event.city.id || 0, event.district.id || 0];
|
||||
|
||||
formData.city = cityArr.join(',');
|
||||
formData.cityName = `${event.province.name || ''}${event.city.name || ''}${event.district.name || ''}`
|
||||
isSelectAddress.value = false;
|
||||
}
|
||||
|
||||
// 保存
|
||||
const handSave = () => {
|
||||
formRef.value.validate().then(() => {
|
||||
if (loading.value) return
|
||||
loading.value = true
|
||||
|
||||
addCustomer(formData).then((res: any) => {
|
||||
loading.value = false
|
||||
if(res.code == 1){
|
||||
redirect({ url: '/addon/erp/pages/base/customer/list' })
|
||||
}
|
||||
}).catch((err) => {
|
||||
// 如果是4001,没有绑定企业账号,强制跳转绑定
|
||||
if(err.code == 4001){
|
||||
redirect({ url: '/addon/erp/pages/member/bind' })
|
||||
}
|
||||
loading.value = false
|
||||
})
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.form-edit :deep(.u-form-item__body__left__content__label){
|
||||
font-size: 28rpx !important;
|
||||
}
|
||||
.form-edit :deep(.u-form-item__body__right){
|
||||
display:flex;
|
||||
align-items: center;
|
||||
}
|
||||
.footer{
|
||||
height: calc(100rpx + var(--top-m) + var(--top-m) + constant(safe-area-inset-bottom)) !important;
|
||||
height: calc(100rpx + var(--top-m) + var(--top-m) + env(safe-area-inset-bottom)) !important;
|
||||
}
|
||||
</style>
|
||||
68
src/addon/erp/pages/base/customer/detail.vue
Normal file
68
src/addon/erp/pages/base/customer/detail.vue
Normal file
@@ -0,0 +1,68 @@
|
||||
<template>
|
||||
<view class="bg-[#ffffff] min-h-[100vh]" :style="themeColor()">
|
||||
<view class="mx-[30rpx]">
|
||||
<!-- 注意,如果需要兼容微信小程序,最好通过setRules方法设置rules规则 -->
|
||||
<up-form labelPosition="left" :model="formData" labelWidth="160rpx" ref="formRef">
|
||||
<up-form-item :label="t('code')" borderBottom>
|
||||
{{formData.code}}
|
||||
</up-form-item>
|
||||
<up-form-item :label="t('name')" borderBottom>
|
||||
{{formData.name}}
|
||||
</up-form-item>
|
||||
<up-form-item :label="t('contact')" borderBottom>
|
||||
{{formData.contact}}
|
||||
</up-form-item>
|
||||
<up-form-item :label="t('phone')" borderBottom>
|
||||
{{formData.phone}}
|
||||
</up-form-item>
|
||||
<up-form-item :label="t('telephone')" borderBottom>
|
||||
{{formData.telephone}}
|
||||
</up-form-item>
|
||||
<up-form-item :label="t('city')" borderBottom>
|
||||
{{formData.cityName}}
|
||||
</up-form-item>
|
||||
<up-form-item :label="t('address')" borderBottom>
|
||||
{{formData.address}}
|
||||
</up-form-item>
|
||||
<up-form-item :label="t('description')" borderBottom>
|
||||
{{formData.description}}
|
||||
</up-form-item>
|
||||
</up-form>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, reactive, computed, onMounted } from 'vue'
|
||||
import { t } from '@/locale'
|
||||
import { onLoad } from '@dcloudio/uni-app';
|
||||
import { getCustomerInfo } from '@/addon/erp/api/base';
|
||||
|
||||
const formRef : any = ref(null)
|
||||
|
||||
const formData = reactive({
|
||||
code: "",
|
||||
name: '',
|
||||
contact: '',
|
||||
phone: '',
|
||||
telephone: '',
|
||||
city: '',
|
||||
cityName: '',
|
||||
address: '',
|
||||
description: ''
|
||||
})
|
||||
|
||||
// 加载
|
||||
onLoad((data : any) => {
|
||||
getInfo(data.id);
|
||||
})
|
||||
|
||||
const getInfo = async (id : number) => {
|
||||
const data = await (await getCustomerInfo(id)).data;
|
||||
Object.assign(formData, data);
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
</style>
|
||||
143
src/addon/erp/pages/base/customer/list.vue
Normal file
143
src/addon/erp/pages/base/customer/list.vue
Normal file
@@ -0,0 +1,143 @@
|
||||
<template>
|
||||
<view class="bg-[var(--page-bg-color)] min-h-[100vh]" :style="themeColor()">
|
||||
|
||||
<mescroll-body ref="mescrollRef" @init="mescrollInit" :down="{ use: false }" height="auto" @up="getListFn"
|
||||
:top="mescrollTop">
|
||||
<view class="sidebar-margin body-bottom" v-if="customerList.length">
|
||||
<view class="mb-[15rpx]" v-for="(item,index) in customerList" :key="item.id">
|
||||
|
||||
<view class="bg-[#ffffff] rounded-10rpx">
|
||||
<view class="head border-0 border-b-1 border-solid border-[#ddd]">
|
||||
<view class="flex justify-between p-[20rpx]">
|
||||
<view class="u-body-item-title u-line-2">{{item.name}}</view>
|
||||
<view><up-tag :text="item.level_text" plain size="mini"></up-tag></view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="body">
|
||||
<view class="flex justify-start flex-col p-[20rpx]">
|
||||
<view class="flex justify-start mb-[18rpx] text-[12px] text-[#6a6a6a]">联系人:<text
|
||||
class="ml-[20rpx] text-[var(--primary-color)]">{{item.contact}}</text></view>
|
||||
<view class="flex justify-start mb-[18rpx] text-[12px] text-[#6a6a6a]">联系电话:<text
|
||||
class="ml-[20rpx] text-[var(--primary-color)]">{{item.phone}}</text></view>
|
||||
<view class="flex justify-start mb-[18rpx] text-[12px] text-[#6a6a6a]">创建时间:<text
|
||||
class="ml-[20rpx] text-[var(--primary-color)]">{{item.create_time}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="foot border-0 border-t-1 border-solid border-[#ddd]">
|
||||
<view class="flex justify-end p-[20rpx]">
|
||||
<view><up-button :text="t('info')" size="mini"
|
||||
@click="redirect({ url: '/addon/erp/pages/base/customer/detail',param:{id: item.id} })"></up-button>
|
||||
</view>
|
||||
<view><up-button type="error" @click="hanldeDelete(item.id)" :text="t('delete')"
|
||||
size="mini"></up-button></view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 删除模态框 -->
|
||||
<up-modal :show="show" @confirm="confirm" showCancelButton @cancel="show = false"
|
||||
:title="t('delete')" :content="t('customerDeleteTips')" ref="uModal"></up-modal>
|
||||
</view>
|
||||
</view>
|
||||
<mescroll-empty v-if="!customerList.length && !loading &&!listLoading"></mescroll-empty>
|
||||
|
||||
</mescroll-body>
|
||||
<loading-page :loading="loading"></loading-page>
|
||||
<view class="fixed bottom-4 right-4 z-2">
|
||||
<up-button @click="redirect({ url: '/addon/erp/pages/base/customer/add'})" type="primary" shape="circle"
|
||||
:customStyle="{borderRadius: '50%',padding: 0,width: '50px',height: '50px'}">
|
||||
<u-icon size="30" color="#fff" name="plus-circle-fill"></u-icon>
|
||||
</up-button>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, reactive, computed, nextTick } from 'vue'
|
||||
import { topTabar } from '@/utils/topTabbar';
|
||||
import { t } from '@/locale';
|
||||
import { redirect, pxToRpx } from '@/utils/common';
|
||||
import MescrollBody from '@/components/mescroll/mescroll-body/mescroll-body.vue';
|
||||
import MescrollEmpty from '@/components/mescroll/mescroll-empty/mescroll-empty.vue';
|
||||
import useMescroll from '@/components/mescroll/hooks/useMescroll.js';
|
||||
import { getCustomerList, deleteCustomer } from '@/addon/erp/api/base';
|
||||
import { onShow, onPageScroll, onReachBottom } from '@dcloudio/uni-app';
|
||||
|
||||
const { downCallback, mescrollInit, getMescroll } = useMescroll(onPageScroll, onReachBottom);
|
||||
|
||||
|
||||
const show = ref(false);
|
||||
|
||||
// 获取系统状态栏的高度
|
||||
let menuButtonInfo : any = {};
|
||||
// 如果是小程序,获取右上角胶囊的尺寸信息,避免导航栏右侧内容与胶囊重叠(支付宝小程序非本API,尚未兼容)
|
||||
// #ifdef MP-WEIXIN || MP-BAIDU || MP-TOUTIAO || MP-QQ
|
||||
menuButtonInfo = uni.getMenuButtonBoundingClientRect();
|
||||
// #endif
|
||||
|
||||
const mescrollTop = "20rpx"
|
||||
|
||||
const customerList = ref<Array<any>>([]),
|
||||
loading = ref<boolean>(true),
|
||||
listLoading = ref<boolean>(true),
|
||||
mescrollRef = ref(null);
|
||||
|
||||
interface mescrollStructure {
|
||||
num : number,
|
||||
size : number,
|
||||
endSuccess : Function,
|
||||
[propName : string] : any
|
||||
}
|
||||
|
||||
const getListFn = (mescroll : mescrollStructure) => {
|
||||
listLoading.value = true;
|
||||
let data : Object = {
|
||||
page: mescroll.num,
|
||||
limit: mescroll.size
|
||||
};
|
||||
getCustomerList(data).then((res : any) => {
|
||||
let newArr = res.data.data;
|
||||
mescroll.endSuccess(newArr.length);
|
||||
//设置列表数据
|
||||
if (mescroll.num == 1) {
|
||||
customerList.value = []; //如果是第一页需手动制空列表
|
||||
}
|
||||
customerList.value = customerList.value.concat(newArr);
|
||||
listLoading.value = false;
|
||||
loading.value = false;
|
||||
}).catch((err) => {
|
||||
// 如果是4001,没有绑定企业账号,强制跳转绑定
|
||||
if (err.code == 4001) {
|
||||
redirect({ url: '/addon/erp/pages/member/bind' })
|
||||
}
|
||||
listLoading.value = false;
|
||||
loading.value = false;
|
||||
mescroll.endErr(); // 请求失败, 结束加载
|
||||
})
|
||||
}
|
||||
|
||||
// 删除
|
||||
const del_id = ref<number>(0);
|
||||
const hanldeDelete = (id : number) => {
|
||||
show.value = true;
|
||||
del_id.value = id;
|
||||
};
|
||||
// 确认删除
|
||||
const confirm = () => {
|
||||
if (del_id.value == 0) {
|
||||
uni.showToast({ icon: 'none', title: t("Invalid ID") });
|
||||
return false;
|
||||
}
|
||||
let index = customerList.value.findIndex(item => item.id === del_id.value);
|
||||
deleteCustomer(del_id.value)
|
||||
.then(() => {
|
||||
customerList.value.splice(index, 1);
|
||||
del_id.value = 0;
|
||||
show.value = false;
|
||||
}).catch(() => { });
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
</style>
|
||||
169
src/addon/erp/pages/base/supplier/add.vue
Normal file
169
src/addon/erp/pages/base/supplier/add.vue
Normal file
@@ -0,0 +1,169 @@
|
||||
<template>
|
||||
<view class="bg-[var(--page-bg-color)] min-h-[100vh] overflow-hidden form-edit" :style="themeColor()">
|
||||
<!-- 注意,如果需要兼容微信小程序,最好通过setRules方法设置rules规则 -->
|
||||
<u-form labelPosition="left" :model="formData" errorType='toast' :rules="rules" ref="formRef"
|
||||
labelWidth="160rpx">
|
||||
<view class="sidebar-margin card-template mt-[var(--top-m)] py-[20rpx]">
|
||||
<view>
|
||||
<u-form-item :label="t('name')" prop="name" borderBottom required>
|
||||
<u-input fontSize="28rpx" v-model="formData.name" :placeholder="t('namePlaceholder')" border="none"></u-input>
|
||||
</u-form-item>
|
||||
</view>
|
||||
<view class="mt-[16rpx]">
|
||||
<u-form-item :label="t('contact')" prop="contact" borderBottom required>
|
||||
<u-input fontSize="28rpx" v-model="formData.contact" :placeholder="t('contactPlaceholder')"
|
||||
border="none"></u-input>
|
||||
</u-form-item>
|
||||
</view>
|
||||
<view class="mt-[16rpx]">
|
||||
<u-form-item :label="t('phone')" prop="phone" borderBottom required>
|
||||
<u-input fontSize="28rpx" v-model="formData.phone" type="number" maxlength="11" :placeholder="t('phonePlaceholder')" border="none"></u-input>
|
||||
</u-form-item>
|
||||
</view>
|
||||
<view class="mt-[16rpx]">
|
||||
<u-form-item :label="t('term')" prop="term" borderBottom>
|
||||
<u-input fontSize="28rpx" v-model="formData.term" type="number" :placeholder="t('termPlaceholder')" border="none"></u-input>
|
||||
</u-form-item>
|
||||
</view>
|
||||
<view class="mt-[16rpx]">
|
||||
<u-form-item :label="t('city')" prop="cityName" borderBottom>
|
||||
<view class="flex w-full items-center h-[52rpx]" @click="selectArea">
|
||||
<view v-if="!formData.cityName" class="text-[#888] text-[28rpx] flex-1">
|
||||
{{ t('cityPlaceholder') }}</view>
|
||||
<view v-else class="text-[28rpx] flex-1 leading-[1.4]">{{ formData.cityName }}</view>
|
||||
</view>
|
||||
</u-form-item>
|
||||
</view>
|
||||
<view class="mt-[16rpx]">
|
||||
<u-form-item :label="t('address')" prop="address" borderBottom>
|
||||
<u-input fontSize="28rpx" v-model="formData.address" :placeholder="t('addressPlaceholder')"
|
||||
border="none"></u-input>
|
||||
</u-form-item>
|
||||
</view>
|
||||
<view class="mt-[16rpx]">
|
||||
<u-form-item :label="t('description')" prop="description" borderBottom>
|
||||
<u-textarea fontSize="28rpx" v-model="formData.description" :placeholder="t('descriptionPlaceholder')"
|
||||
border="none"></u-textarea>
|
||||
</u-form-item>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</u-form>
|
||||
<view class="w-full footer">
|
||||
<view class="py-[var(--top-m)] px-[var(--sidebar-m)] footer w-full fixed bottom-0 left-0 right-0 box-border">
|
||||
<button hover-class="none" class="!bg-[var(--primary-color)] text-[#fff] h-[80rpx] leading-[80rpx] rounded-[100rpx] text-[26rpx] font-500"
|
||||
@click="handSave" :disabled="loading" :class="{'opacity-50': loading}">{{t('save')}}</button>
|
||||
</view>
|
||||
</view>
|
||||
<area-select ref="areaRef" @complete="areaSelectComplete" :area-id="0" />
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, reactive, computed } from 'vue'
|
||||
import { t } from '@/locale'
|
||||
import { addSupplier } from '@/addon/erp/api/base';
|
||||
import { generatedCode } from '@/addon/erp/utils/common';
|
||||
import { redirect } from '@/utils/common';
|
||||
|
||||
const formRef : any = ref(null)
|
||||
const loading = ref(false)
|
||||
|
||||
const areaRef = ref()
|
||||
const isSelectAddress = ref(false)
|
||||
|
||||
const rules = computed(() => {
|
||||
return {
|
||||
'name': {
|
||||
type: 'string',
|
||||
required: true,
|
||||
message: t('namePlaceholder'),
|
||||
trigger: ['blur', 'change'],
|
||||
},
|
||||
'contact': {
|
||||
type: 'string',
|
||||
required: true,
|
||||
message: t('contactPlaceholder'),
|
||||
trigger: ['blur', 'change'],
|
||||
},
|
||||
'phone': [
|
||||
{
|
||||
type: 'string',
|
||||
required: true,
|
||||
message: t('phonePlaceholder'),
|
||||
trigger: ['blur', 'change'],
|
||||
},
|
||||
{
|
||||
validator(rule : any, value : any, callback : any) {
|
||||
let mobile = /^1[3-9]\d{9}$/;
|
||||
if (!mobile.test(value)) {
|
||||
callback(new Error(t('mobileError')))
|
||||
} else {
|
||||
callback()
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
})
|
||||
|
||||
const formData = reactive({
|
||||
code: generatedCode("S"),
|
||||
name: '',
|
||||
contact: '',
|
||||
phone: '',
|
||||
term: '',
|
||||
city: '',
|
||||
cityName: '',
|
||||
address: '',
|
||||
description: ''
|
||||
})
|
||||
|
||||
const selectArea = () => {
|
||||
isSelectAddress.value = true
|
||||
areaRef.value.open()
|
||||
}
|
||||
|
||||
const areaSelectComplete = (event : any) => {
|
||||
let cityArr = [] as any[];
|
||||
cityArr = [event.province.id || 0, event.city.id || 0, event.district.id || 0];
|
||||
|
||||
formData.city = cityArr.join(',');
|
||||
formData.cityName = `${event.province.name || ''}${event.city.name || ''}${event.district.name || ''}`
|
||||
isSelectAddress.value = false;
|
||||
}
|
||||
|
||||
// 保存
|
||||
const handSave = () => {
|
||||
formRef.value.validate().then(() => {
|
||||
if (loading.value) return
|
||||
loading.value = true
|
||||
|
||||
addSupplier(formData).then((res : any) => {
|
||||
if (res.code == 1) {
|
||||
redirect({ url: '/addon/erp/pages/base/supplier/list' })
|
||||
}
|
||||
}).catch((err) => {
|
||||
// 如果是4001,没有绑定企业账号,强制跳转绑定
|
||||
if (err.code == 4001) {
|
||||
redirect({ url: '/addon/erp/pages/member/bind' })
|
||||
}
|
||||
loading.value = false
|
||||
})
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.form-edit :deep(.u-form-item__body__left__content__label){
|
||||
font-size: 28rpx !important;
|
||||
}
|
||||
.form-edit :deep(.u-form-item__body__right){
|
||||
display:flex;
|
||||
align-items: center;
|
||||
}
|
||||
.footer{
|
||||
height: calc(100rpx + var(--top-m) + var(--top-m) + constant(safe-area-inset-bottom)) !important;
|
||||
height: calc(100rpx + var(--top-m) + var(--top-m) + env(safe-area-inset-bottom)) !important;
|
||||
}
|
||||
</style>
|
||||
68
src/addon/erp/pages/base/supplier/detail.vue
Normal file
68
src/addon/erp/pages/base/supplier/detail.vue
Normal file
@@ -0,0 +1,68 @@
|
||||
<template>
|
||||
<view class="bg-[#ffffff] min-h-[100vh]" :style="themeColor()">
|
||||
<view class="mx-[30rpx]">
|
||||
<!-- 注意,如果需要兼容微信小程序,最好通过setRules方法设置rules规则 -->
|
||||
<up-form labelPosition="left" :model="formData" labelWidth="160rpx" ref="formRef">
|
||||
<up-form-item :label="t('code')" borderBottom>
|
||||
{{formData.code}}
|
||||
</up-form-item>
|
||||
<up-form-item :label="t('name')" borderBottom>
|
||||
{{formData.name}}
|
||||
</up-form-item>
|
||||
<up-form-item :label="t('contact')" borderBottom>
|
||||
{{formData.contact}}
|
||||
</up-form-item>
|
||||
<up-form-item :label="t('phone')" borderBottom>
|
||||
{{formData.phone}}
|
||||
</up-form-item>
|
||||
<up-form-item :label="t('city')" borderBottom>
|
||||
{{formData.cityName}}
|
||||
</up-form-item>
|
||||
<up-form-item :label="t('address')" borderBottom>
|
||||
{{formData.address}}
|
||||
</up-form-item>
|
||||
<up-form-item :label="t('term')" borderBottom>
|
||||
{{formData.term}}
|
||||
</up-form-item>
|
||||
<up-form-item :label="t('description')" borderBottom>
|
||||
{{formData.description}}
|
||||
</up-form-item>
|
||||
</up-form>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, reactive, computed, onMounted } from 'vue'
|
||||
import { t } from '@/locale'
|
||||
import { onLoad } from '@dcloudio/uni-app';
|
||||
import { getSupplierInfo } from '@/addon/erp/api/base';
|
||||
|
||||
const formRef : any = ref(null)
|
||||
|
||||
const formData = reactive({
|
||||
code: "",
|
||||
name: '',
|
||||
contact: '',
|
||||
phone: '',
|
||||
term: '',
|
||||
city: '',
|
||||
cityName: '',
|
||||
address: '',
|
||||
description: ''
|
||||
})
|
||||
|
||||
// 加载
|
||||
onLoad((data : any) => {
|
||||
getInfo(data.id);
|
||||
})
|
||||
|
||||
const getInfo = async (id : number) => {
|
||||
const data = await (await getSupplierInfo(id)).data;
|
||||
Object.assign(formData, data);
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
</style>
|
||||
142
src/addon/erp/pages/base/supplier/list.vue
Normal file
142
src/addon/erp/pages/base/supplier/list.vue
Normal file
@@ -0,0 +1,142 @@
|
||||
<template>
|
||||
<view class="bg-[var(--page-bg-color)] min-h-[100vh]" :style="themeColor()">
|
||||
|
||||
<mescroll-body ref="mescrollRef" @init="mescrollInit" :down="{ use: false }" height="auto" @up="getListFn"
|
||||
:top="mescrollTop">
|
||||
<view class="sidebar-margin body-bottom" v-if="supplierList.length">
|
||||
<view class="mb-[15rpx]" v-for="(item,index) in supplierList" :key="index">
|
||||
|
||||
<view class="bg-[#ffffff] rounded-10rpx">
|
||||
<view class="head border-0 border-b-1 border-solid border-[#ddd]">
|
||||
<view class="flex justify-between p-[20rpx]">
|
||||
<view class="u-body-item-title u-line-2">{{item.name}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="body">
|
||||
<view class="flex justify-start flex-col p-[20rpx]">
|
||||
<view class="flex justify-start mb-[18rpx] text-[12px] text-[#6a6a6a]">联系人:<text
|
||||
class="ml-[20rpx] text-[var(--primary-color)]">{{item.contact}}</text></view>
|
||||
<view class="flex justify-start mb-[18rpx] text-[12px] text-[#6a6a6a]">联系电话:<text
|
||||
class="ml-[20rpx] text-[var(--primary-color)]">{{item.phone}}</text></view>
|
||||
<view class="flex justify-start mb-[18rpx] text-[12px] text-[#6a6a6a]">创建时间:<text
|
||||
class="ml-[20rpx] text-[var(--primary-color)]">{{item.create_time}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="foot border-0 border-t-1 border-solid border-[#ddd]">
|
||||
<view class="flex justify-end p-[20rpx]">
|
||||
<view><up-button :text="t('info')" size="mini"
|
||||
@click="redirect({ url: '/addon/erp/pages/base/supplier/detail',param:{id: item.id} })"></up-button>
|
||||
</view>
|
||||
<view><up-button type="error" @click="hanldeDelete(item.id)" :text="t('delete')"
|
||||
size="mini"></up-button></view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 删除模态框 -->
|
||||
<up-modal :show="show" @confirm="confirm" showCancelButton @cancel="show = false"
|
||||
:title="t('delete')" :content="t('supplierDeleteTips')" ref="uModal"></up-modal>
|
||||
</view>
|
||||
</view>
|
||||
<mescroll-empty v-if="!supplierList.length && !loading &&!listLoading"></mescroll-empty>
|
||||
|
||||
</mescroll-body>
|
||||
<loading-page :loading="loading"></loading-page>
|
||||
<view class="fixed bottom-4 right-4 z-2">
|
||||
<up-button @click="redirect({ url: '/addon/erp/pages/base/supplier/add'})" type="primary" shape="circle"
|
||||
:customStyle="{borderRadius: '50%',padding: 0,width: '50px',height: '50px'}">
|
||||
<u-icon size="30" color="#fff" name="plus-circle-fill"></u-icon>
|
||||
</up-button>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, reactive, computed, nextTick } from 'vue'
|
||||
import { topTabar } from '@/utils/topTabbar';
|
||||
import { t } from '@/locale';
|
||||
import { redirect, pxToRpx } from '@/utils/common';
|
||||
import MescrollBody from '@/components/mescroll/mescroll-body/mescroll-body.vue';
|
||||
import MescrollEmpty from '@/components/mescroll/mescroll-empty/mescroll-empty.vue';
|
||||
import useMescroll from '@/components/mescroll/hooks/useMescroll.js';
|
||||
import { getSupplierList, deleteSupplier } from '@/addon/erp/api/base';
|
||||
import { onShow, onPageScroll, onReachBottom } from '@dcloudio/uni-app';
|
||||
|
||||
const { downCallback, mescrollInit, getMescroll } = useMescroll(onPageScroll, onReachBottom);
|
||||
|
||||
|
||||
const show = ref(false);
|
||||
|
||||
// 获取系统状态栏的高度
|
||||
let menuButtonInfo : any = {};
|
||||
// 如果是小程序,获取右上角胶囊的尺寸信息,避免导航栏右侧内容与胶囊重叠(支付宝小程序非本API,尚未兼容)
|
||||
// #ifdef MP-WEIXIN || MP-BAIDU || MP-TOUTIAO || MP-QQ
|
||||
menuButtonInfo = uni.getMenuButtonBoundingClientRect();
|
||||
// #endif
|
||||
|
||||
const mescrollTop = "20rpx"
|
||||
|
||||
const supplierList = ref<Array<any>>([]),
|
||||
loading = ref<boolean>(true),
|
||||
listLoading = ref<boolean>(true),
|
||||
mescrollRef = ref(null);
|
||||
|
||||
interface mescrollStructure {
|
||||
num : number,
|
||||
size : number,
|
||||
endSuccess : Function,
|
||||
[propName : string] : any
|
||||
}
|
||||
|
||||
const getListFn = (mescroll : mescrollStructure) => {
|
||||
listLoading.value = true;
|
||||
let data : Object = {
|
||||
page: mescroll.num,
|
||||
limit: mescroll.size
|
||||
};
|
||||
getSupplierList(data).then((res : any) => {
|
||||
let newArr = res.data.data;
|
||||
mescroll.endSuccess(newArr.length);
|
||||
//设置列表数据
|
||||
if (mescroll.num == 1) {
|
||||
supplierList.value = []; //如果是第一页需手动制空列表
|
||||
}
|
||||
supplierList.value = supplierList.value.concat(newArr);
|
||||
listLoading.value = false;
|
||||
loading.value = false;
|
||||
}).catch((err) => {
|
||||
// 如果是4001,没有绑定企业账号,强制跳转绑定
|
||||
if (err.code == 4001) {
|
||||
redirect({ url: '/addon/erp/pages/member/bind' })
|
||||
}
|
||||
listLoading.value = false;
|
||||
loading.value = false;
|
||||
mescroll.endErr(); // 请求失败, 结束加载
|
||||
})
|
||||
}
|
||||
|
||||
// 删除
|
||||
const del_id = ref<number>(0);
|
||||
const hanldeDelete = (id : number) => {
|
||||
show.value = true;
|
||||
del_id.value = id;
|
||||
};
|
||||
// 确认删除
|
||||
const confirm = () => {
|
||||
if (del_id.value == 0) {
|
||||
uni.showToast({ icon: 'none', title: t("Invalid ID") });
|
||||
return false;
|
||||
}
|
||||
let index = supplierList.value.findIndex(item => item.id === del_id.value);
|
||||
deleteSupplier(del_id.value)
|
||||
.then(() => {
|
||||
supplierList.value.splice(index, 1);
|
||||
del_id.value = 0;
|
||||
show.value = false;
|
||||
}).catch(() => { });
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
</style>
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user