Merge branch 'v5.0.0dev' of https://gitee.com/ZhongBangKeJi/CRMEB into v5.0.0dev

This commit is contained in:
evoxwht 2023-05-17 17:04:54 +08:00
commit 3436fd952a
19 changed files with 56 additions and 516 deletions

View File

@ -74,6 +74,8 @@ class SystemStorageDao extends BaseDao
$query->where('type', $where['type']);
})->where('is_delete', 0)->when(isset($where['access_key']), function ($query) use ($where) {
$query->where('access_key', $where['access_key']);
})->when(!empty($where['id']), function ($query) use ($where) {
$query->where('id', $where['id']);
});
}
}

View File

@ -441,7 +441,6 @@ class StoreOrderDeliveryServices extends BaseServices
$orderInfoServices = app()->make(StoreOrderCartInfoServices::class);
$storeName = $orderInfoServices->getCarIdByProductTitle((int)$orderInfo->id);
// 发货信息录入
event('OrderShipping', [$orderInfo, $type, $data['delivery_id'], $data['delivery_name']]);
$res = [];
switch ($type) {
case 1://快递发货
@ -458,6 +457,13 @@ class StoreOrderDeliveryServices extends BaseServices
default:
throw new AdminException(400522);
}
if (!$data['delivery_id'] && !empty($res['kuaidinum'])) {
$data['delivery_id'] = $res['kuaidinum'];
}
if (!$data['delivery_id']) {
$data['delivery_id'] = uniqid();
}
event('OrderShipping', [$orderInfo, $type, $data['delivery_id'], $data['delivery_name']]);
//到期自动收货
event('OrderDeliveryListener', [$orderInfo, $storeName, $data, $type]);
return $res;

View File

@ -217,7 +217,7 @@ class SystemStorageServices extends BaseServices
$make->update('tengxun_appid', ['value' => json_encode($appid)], 'menu_name');
break;
}
\crmeb\services\CacheService::clear();
$make->cacheDriver()->clear();
}
}
@ -315,6 +315,11 @@ class SystemStorageServices extends BaseServices
case 4:// cos 腾讯云
$upload = UploadService::init($type);
$list = $upload->listbuckets();
if (!empty($list['Name'])) {
$newList = $list;
$list = [];
$list[] = $newList;
}
$config = $this->getStorageConfig($type);
foreach ($list as $item) {
if (!$this->dao->count(['name' => $item['Name'], 'access_key' => $config['accessKey']])) {
@ -438,6 +443,9 @@ class SystemStorageServices extends BaseServices
//是否添加过域名不存在需要绑定域名
$domainList = $upload->getDomian($info->name, $info->region);
$domainParse = parse_url($domain);
if (false === $domainParse) {
throw new AdminException('域名输入有误');
}
if (!in_array($domainParse['host'], $domainList)) {
//绑定域名到云储存桶
$res = $upload->bindDomian($info->name, $domain, $info->region);

View File

@ -478,7 +478,9 @@ class Cos extends BaseUpload
'Type' => 'REST',
'ForcedReplacement' => 'CNAME'
]);
$res = $res->toArray();
if (method_exists($res, 'toArray')) {
$res = $res->toArray();
}
if ($res['RequestId'] ?? null) {
return true;
}

View File

@ -1,37 +0,0 @@
import Vue from 'vue';
import VueI18n from 'vue-i18n';
import { localRead } from '@/libs/util';
import customZhCn from './lang/zh-CN';
import customZhTw from './lang/zh-TW';
import customEnUs from './lang/en-US';
import zhCnLocale from 'iview/src/locale/lang/zh-CN';
import enUsLocale from 'iview/src/locale/lang/en-US';
import zhTwLocale from 'iview/src/locale/lang/zh-TW';
Vue.use(VueI18n);
// 自动根据浏览器系统语言设置语言
const navLang = navigator.language;
const localLang = navLang === 'zh-CN' || navLang === 'en-US' ? navLang : false;
let lang = localLang || localRead('local') || 'zh-CN';
Vue.config.lang = lang;
// vue-i18n 6.x+写法
Vue.locale = () => {};
const messages = {
'zh-CN': Object.assign(zhCnLocale, customZhCn),
'zh-TW': Object.assign(zhTwLocale, customZhTw),
'en-US': Object.assign(enUsLocale, customEnUs),
};
const i18n = new VueI18n({
locale: lang,
messages,
});
export default i18n;
// vue-i18n 5.x写法
// Vue.locale('zh-CN', Object.assign(zhCnLocale, customZhCn))
// Vue.locale('en-US', Object.assign(zhTwLocale, customZhTw))
// Vue.locale('zh-TW', Object.assign(enUsLocale, customEnUs))

View File

@ -1,47 +0,0 @@
export default {
home: 'Home',
login: 'Login',
components: 'Components',
count_to_page: 'Count-to',
tables_page: 'Table',
split_pane_page: 'Split-pane',
markdown_page: 'Markdown-editor',
editor_page: 'Rich-Text-Editor',
icons_page: 'Custom-icon',
img_cropper_page: 'Image-editor',
update: 'Update',
doc: 'Document',
join_page: 'QQ Group',
update_table_page: 'Update .CSV',
update_paste_page: 'Paste Table Data',
multilevel: 'multilevel',
directive_page: 'Directive',
level_1: 'Level-1',
level_2: 'Level-2',
level_2_1: 'Level-2-1',
level_2_3: 'Level-2-3',
level_2_2: 'Level-2-2',
level_2_2_1: 'Level-2-2-1',
level_2_2_2: 'Level-2-2-2',
excel: 'Excel',
'upload-excel': 'Upload Excel',
'export-excel': 'Export Excel',
tools_methods_page: 'Tools Methods',
drag_list_page: 'Drag-list',
i18n_page: 'Internationalization',
modalTitle: 'Modal Title',
content: 'This is the modal box content.',
buttonText: 'Show Modal',
'i18n-tip':
'Note: Only this page is multi-language, other pages do not add language content to the multi-language package.',
error_store_page: 'Error Collection',
error_logger_page: 'Error Logger',
query: 'Query',
params: 'Params',
cropper_page: 'Cropper',
message_page: 'Message Center',
tree_table_page: 'Tree Table',
org_tree_page: 'Org Tree',
drag_drawer_page: 'Draggable Drawer',
tree_select_page: 'Tree Selector',
};

View File

@ -1,46 +0,0 @@
export default {
home: '首页问问',
login: '登录',
components: '组件',
count_to_page: '数字渐变',
tables_page: '多功能表格',
split_pane_page: '分割窗口',
markdown_page: 'Markdown编辑器',
editor_page: '富文本编辑器',
icons_page: '自定义图标',
img_cropper_page: '图片编辑器',
update: '上传数据',
join_page: 'QQ群问问',
doc: '文档',
update_table_page: '上传CSV文件',
update_paste_page: '粘贴表格数据',
multilevel: '多级菜单',
directive_page: '指令',
level_1: 'Level-1',
level_2: 'Level-2',
level_2_1: 'Level-2-1',
level_2_3: 'Level-2-3',
level_2_2: 'Level-2-2',
level_2_2_1: 'Level-2-2-1',
level_2_2_2: 'Level-2-2-2',
excel: 'Excel',
'upload-excel': '上传excel',
'export-excel': '导出excel',
tools_methods_page: '工具函数',
drag_list_page: '拖拽列表',
i18n_page: '多语言',
modalTitle: '模态框题目',
content: '这是模态框内容',
buttonText: '显示模态框',
'i18n-tip': '注:仅此页做了多语言,其他页面没有在多语言包中添加语言内容',
error_store_page: '错误收集',
error_logger_page: '错误日志',
query: '带参路由',
params: '动态路由',
cropper_page: '图片裁剪',
message_page: '消息中心',
tree_table_page: '树状表格',
org_tree_page: '组织结构树',
drag_drawer_page: '可拖动抽屉',
tree_select_page: '树状下拉选择器2',
};

View File

@ -1,46 +0,0 @@
export default {
home: '首頁',
login: '登錄',
components: '组件',
count_to_page: '数字渐变',
tables_page: '多功能表格',
split_pane_page: '分割窗口',
markdown_page: 'Markdown編輯器',
editor_page: '富文本編輯器',
icons_page: '自定義圖標',
img_cropper_page: '圖片編輯器',
update: '上傳數據',
join_page: 'QQ群',
doc: '文檔',
update_table_page: '上傳CSV文件',
update_paste_page: '粘貼表格數據',
multilevel: '多级菜单',
directive_page: '指令',
level_1: 'Level-1',
level_2: 'Level-2',
level_2_1: 'Level-2-1',
level_2_3: 'Level-2-3',
level_2_2: 'Level-2-2',
level_2_2_1: 'Level-2-2-1',
level_2_2_2: 'Level-2-2-2',
excel: 'Excel',
'upload-excel': '上傳excel',
'export-excel': '導出excel',
tools_methods_page: '工具函數',
drag_list_page: '拖拽列表',
i18n_page: '多語言',
modalTitle: '模態框題目',
content: '這是模態框內容',
buttonText: '顯示模態框',
'i18n-tip': '注:僅此頁做了多語言,其他頁面沒有在多語言包中添加語言內容',
error_store_page: '錯誤收集',
error_logger_page: '錯誤日誌',
query: '帶參路由',
params: '動態路由',
cropper_page: '圖片裁剪',
message_page: '消息中心',
tree_table_page: '樹狀表格',
org_tree_page: '組織結構樹',
drag_drawer_page: '可拖動抽屜',
tree_select_page: '樹狀下拉選擇器',
};

View File

@ -16,13 +16,11 @@ import router from './router';
import store from './store';
import ViewUI from 'view-design';
// import ViewUI from 'view-design'
Vue.prototype.bus = new Vue();
import Router from 'vue-router';
import Auth from '@/libs/wechat';
import 'view-design/dist/styles/iview.css';
import { i18n } from '@/i18n/index.js';
// import i18n from '@/locale';
import config from '@/config';
import importDirective from '@/directive';
@ -31,7 +29,6 @@ import installPlugin from '@/plugin';
import './index.less';
import '@/assets/icons/iconfont.css';
import '@/assets/iconfont/iconfont.css';
import './assets/iconfont/iconfont.css';
import '@/theme/index.scss';
import Element from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
@ -73,8 +70,6 @@ import timeOptions from '@/libs/timeOptions';
import scroll from '@/libs/loading';
import * as tools from '@/libs/tools';
import VueTreeList from 'vue-tree-list';
import { getHeaderName, getHeaderSider, getMenuSider, getSiderSubmenu } from '@/libs/system';
import { getMenuopen } from '@/libs/util';
// 复制到粘贴板插件
import VueClipboard from 'vue-clipboard2';
@ -101,9 +96,6 @@ import settings from '@/setting';
Vue.prototype.$routeProStr = settings.routePre;
// 实际打包时应该不引入mock
/* eslint-disable */
if (process.env.NODE_ENV !== 'production') require('@/mock');
window.Promise = Promise;
Vue.prototype.$modalForm = modalForm;
Vue.prototype.$modalSure = modalSure;
@ -168,7 +160,7 @@ import vuescroll from 'vuescroll';
Vue.use(vuescroll);
// register global utility filters
// 注册全局 过滤器
Object.keys(filters).forEach((key) => {
Vue.filter(key, filters[key]);
});
@ -204,8 +196,15 @@ new Vue({
}
});
}
if (to.name == 'product_productAdd') {
console.log(to.name);
if (
[
'product_productAdd',
'marketing_bargainCreate',
'marketing_storeSeckillCreate',
'marketing_storeIntegralCreate',
].includes(to.name)
) {
let route = to.matched[1].path.split(':')[0];
this.$store.state.menus.oneLvRoutes.map((e) => {
if (route.indexOf(e.path) != -1) {

View File

@ -1,44 +0,0 @@
import Mock from 'mockjs';
import { doCustomTimes } from '@/libs/util';
import orgData from './data/org-data';
import { treeData } from './data/tree-select';
const Random = Mock.Random;
export const getTableData = (req) => {
let tableData = [];
doCustomTimes(5, () => {
tableData.push(
Mock.mock({
name: '@name',
email: '@email',
createTime: '@date',
}),
);
});
return tableData;
};
export const getDragList = (req) => {
let dragList = [];
doCustomTimes(5, () => {
dragList.push(
Mock.mock({
name: Random.csentence(10, 13),
id: Random.increment(10),
}),
);
});
return dragList;
};
export const uploadImage = (req) => {
return Promise.resolve();
};
export const getOrgData = (req) => {
return orgData;
};
export const getTreeSelectData = (req) => {
return treeData;
};

View File

@ -1,50 +0,0 @@
export default {
id: 0,
label: 'XXX科技有限公司',
children: [
{
id: 2,
label: '产品研发部',
children: [
{
id: 5,
label: '研发-前端',
},
{
id: 6,
label: '研发-后端',
},
{
id: 9,
label: 'UI设计',
},
{
id: 10,
label: '产品经理',
},
],
},
{
id: 3,
label: '销售部',
children: [
{
id: 7,
label: '销售一部',
},
{
id: 8,
label: '销售二部',
},
],
},
{
id: 4,
label: '财务部',
},
{
id: 11,
label: 'HR人事',
},
],
};

View File

@ -1,82 +0,0 @@
export const treeData = [
{
id: 1,
title: '1',
children: [
{
id: 11,
title: '1-1',
loading: false,
children: [
// {
// id: 111,
// title: '1-1-1'
// },
// {
// id: 112,
// title: '1-1-2'
// },
// {
// id: 113,
// title: '1-1-3'
// },
// {
// id: 114,
// title: '1-1-4'
// }
],
},
{
id: 12,
title: '1-2',
children: [
{
id: 121,
title: '1-2-1',
},
],
},
],
},
];
export const newTreeData = [
{
id: 'a',
title: 'a',
children: [
{
id: 'a1',
title: 'a-1',
children: [
{
id: 112,
title: '1-1-2',
},
{
id: 'a12',
title: 'a-1-2',
},
{
id: 'a13',
title: 'a-1-3',
},
{
id: 'a14',
title: 'a-1-4',
},
],
},
{
id: 'a2',
title: 'a-2',
children: [
{
id: 'a21',
title: 'b-2-1',
},
],
},
],
},
];

View File

@ -1,28 +0,0 @@
import Mock from 'mockjs';
// import { login, logout, getUserInfo } from './login'
import { getTableData, getDragList, uploadImage, getOrgData, getTreeSelectData } from './data';
import { getMessageInit, getContentByMsgId, hasRead, removeReaded, restoreTrash, messageCount } from './user';
// 配置Ajax请求延时,可用来测试网络延迟大时项目中一些效果
// Mock.setup({
// timeout: 1000
// });
//
// // 登录相关和获取用户信息
// Mock.mock(/\/login/, login);
// Mock.mock(/\/get_info/, getUserInfo);
// Mock.mock(/\/logout/, logout);
// Mock.mock(/\/get_table_data/, getTableData);
// Mock.mock(/\/get_drag_list/, getDragList);
// Mock.mock(/\/save_error_logger/, 'success');
// Mock.mock(/\/image\/upload/, uploadImage);
// Mock.mock(/\/message\/init/, getMessageInit);
// Mock.mock(/\/message\/content/, getContentByMsgId);
// Mock.mock(/\/message\/has_read/, hasRead);
// Mock.mock(/\/message\/remove_readed/, removeReaded);
// Mock.mock(/\/message\/restore/, restoreTrash);
// Mock.mock(/\/message\/count/, messageCount);
// Mock.mock(/\/get_org_data/, getOrgData);
// Mock.mock(/\/get_tree_select_data/, getTreeSelectData);
//
// export default Mock

View File

@ -1,31 +0,0 @@
// import { getParams } from '@/libs/util'
// const USER_MAP = {
// super_admin: {
// name: 'super_admin',
// user_id: '1',
// access: ['super_admin', 'admin'],
// token: 'super_admin',
// avatar: 'https://file.iviewui.com/dist/a0e88e83800f138b94d2414621bd9704.png'
// },
// admin: {
// name: 'admin',
// user_id: '2',
// access: ['admin'],
// token: 'admin',
// avatar: 'https://avatars0.githubusercontent.com/u/20942571?s=460&v=4'
// }
// }
//
// export const login = req => {
// req = JSON.parse(req.body)
// return { token: USER_MAP[req.userName].token }
// }
//
// export const getUserInfo = req => {
// const params = getParams(req.url)
// return USER_MAP[params.token]
// }
//
// export const logout = req => {
// return null
// }

View File

@ -1,64 +0,0 @@
import Mock from 'mockjs';
import { doCustomTimes } from '@/libs/util';
const Random = Mock.Random;
export const getMessageInit = () => {
let unreadList = [];
doCustomTimes(3, () => {
unreadList.push(
Mock.mock({
title: Random.cword(10, 15),
create_time: '@date',
msg_id: Random.increment(100),
}),
);
});
let readedList = [];
doCustomTimes(4, () => {
readedList.push(
Mock.mock({
title: Random.cword(10, 15),
create_time: '@date',
msg_id: Random.increment(100),
}),
);
});
let trashList = [];
doCustomTimes(2, () => {
trashList.push(
Mock.mock({
title: Random.cword(10, 15),
create_time: '@date',
msg_id: Random.increment(100),
}),
);
});
return {
unread: unreadList,
readed: readedList,
trash: trashList,
};
};
export const getContentByMsgId = () => {
return `<divcourier new',="" monospace;font-weight:="" normal;font-size:="" 12px;line-height:="" 18px;white-space:="" pre;"=""><div>&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="font-size: medium;">这是消息内容,这个内容是使用<span style="color: rgb(255, 255, 255); background-color: rgb(28, 72, 127);">富文本编辑器</span>编辑的,所以你可以看到一些<span style="text-decoration-line: underline; font-style: italic; color: rgb(194, 79, 74);">格式</span></span></div><ol><li>你可以查看Mock返回的数据格式,和api请求的接口,来确定你的后端接口的开发</li><li>使用你的真实接口后,前端页面基本不需要修改即可满足基本需求</li><li>快来试试吧</li></ol><p>${Random.csentence(
100,
200,
)}</p></divcourier>`;
};
export const hasRead = () => {
return true;
};
export const removeReaded = () => {
return true;
};
export const restoreTrash = () => {
return true;
};
export const messageCount = () => {
return 3;
};

View File

@ -83,9 +83,9 @@
</i-switch>
</template>
<template slot-scope="{ row, index }" slot="action">
<a v-if="row.stop_status === 0" @click="edit(row)">编辑</a>
<a v-if="row.stop_status === 0" @click="edit(row, 0)">编辑</a>
<Divider v-if="row.stop_status === 0" type="vertical" />
<a @click="copy(row)">复制</a>
<a @click="edit(row, 1)">复制</a>
<Divider type="vertical" />
<a @click="del(row, '删除砍价商品', index)">删除</a>
<Divider type="vertical" />
@ -234,9 +234,8 @@ export default {
methods: {
// 添加
add() {
this.$router.push({ path: this.$routeProStr + '/marketing/store_bargain/create/0/0' });
this.$router.push({ path: this.$routeProStr + '/marketing/store_bargain/create' });
},
// 导出
// 用户导出
async exportList() {
this.tableFrom.status = this.tableFrom.status || '';
@ -267,16 +266,10 @@ export default {
});
});
},
// 编辑
edit(row) {
// 编辑 / 复制 type 0 编辑 1 复制
edit(row, type) {
this.$router.push({
path: this.$routeProStr + '/marketing/store_bargain/create/' + row.id + '/0',
});
},
// 一键复制
copy(row) {
this.$router.push({
path: this.$routeProStr + '/marketing/store_bargain/create/' + row.id + '/1',
path: this.$routeProStr + `/marketing/store_bargain/create/${row.id}/${type}`,
});
},
// 删除

View File

@ -334,6 +334,9 @@ export default {
this.$store.commit('mobildConfig/SETEMPTY');
},
created() {
window.onbeforeunload = () => {
return '刷新页面将丢失内容,是否继续?';
};
this.categoryList();
this.getUrlList();
this.pageId = this.$route.query.id;
@ -371,9 +374,6 @@ export default {
});
},
methods: {
beforeUnload() {
return '确认是否保存?';
},
saveModal() {
if (!this.saveName) return this.$Message.warning('请先输入模板名称');
this.saveConfig(1, this.saveName);
@ -409,7 +409,7 @@ export default {
closeWindow() {
this.$Modal.confirm({
title: '确定关闭当前页吗?',
content: '离开前请确认保存您的设计',
content: '关闭页面前请先保存数据,未保存的话数据会丢失',
okText: '确定',
cancelText: '取消',
loading: true,

View File

@ -384,7 +384,7 @@
<div class="confignv"><span class="configtit">记录类型:</span>CNAME</div>
<div class="confignv">
<span class="configtit">记录值:</span>{{ configData.cname }}
<span class="copy copy-data" :data-clipboard-text="configData.cname">复制</span>
<span class="copy copy-data" @click="insertCopy(configData.cname)">复制</span>
</div>
</div>
<div slot="footer"></div>
@ -559,15 +559,16 @@ export default {
this.changeTab(res.data.type.toString());
});
},
mounted: function () {
this.$nextTick(function () {
const clipboard = new ClipboardJS('.copy-data');
clipboard.on('success', () => {
this.$Message.success('复制成功');
});
});
},
methods: {
insertCopy(text) {
this.$copyText(text)
.then((message) => {
this.$Message.success('复制成功');
})
.catch((err) => {
this.$Message.error('复制失败');
});
},
changeSave(type) {
saveType(type)
.then((res) => {

View File

@ -1039,6 +1039,9 @@
// #ifdef MP
if (wx.openBusinessView && this.orderInfo.order_shipping_open && this.orderInfo
.trade_no) {
uni.showLoading({
title: this.$t(`加载中`)
});
wx.openBusinessView({
businessType: 'weappOrderConfirm',
extraData: {
@ -1046,12 +1049,13 @@
},
success() {},
fail(err) {
uni.hideLoading();
return that.$util.Tips({
title: err.errMsg
});
},
complete() {
//dosomething
uni.hideLoading();
}
});
} else {