Merge branch 'v4.7.0dev' of https://gitee.com/ZhongBangKeJi/CRMEB into v4.7.0dev

This commit is contained in:
吴昊天 2023-02-24 19:07:18 +08:00
commit 468ca89467
12 changed files with 86 additions and 65 deletions

View File

@ -11,7 +11,7 @@ abstract class AbstractDecoder
/**
* Initiates new image from path in filesystem
*
* @param string $path
* @param string $path
* @return \Intervention\Image\Image
*/
abstract public function initFromPath($path);
@ -19,7 +19,7 @@ abstract class AbstractDecoder
/**
* Initiates new image from binary data
*
* @param string $data
* @param string $data
* @return \Intervention\Image\Image
*/
abstract public function initFromBinary($data);
@ -27,7 +27,7 @@ abstract class AbstractDecoder
/**
* Initiates new image from GD resource
*
* @param Resource $resource
* @param Resource $resource
* @return \Intervention\Image\Image
*/
abstract public function initFromGdResource($resource);
@ -60,30 +60,30 @@ abstract class AbstractDecoder
/**
* Init from given URL
*
* @param string $url
* @param string $url
* @return \Intervention\Image\Image
*/
public function initFromUrl($url)
{
$options = [
'http' => [
'method'=>"GET",
'protocol_version'=>1.1, // force use HTTP 1.1 for service mesh environment with envoy
'header'=>"Accept-language: en\r\n".
"User-Agent: Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36\r\n"
]
'method' => "GET",
'protocol_version' => 1.1, // force use HTTP 1.1 for service mesh environment with envoy
'header' => "Accept-language: en\r\n" .
"User-Agent: Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36\r\n"
]
];
$context = stream_context_create($options);
$context = stream_context_create($options);
if ($data = @file_get_contents($url, false, $context)) {
return $this->initFromBinary($data);
}
throw new NotReadableException(
"Unable to init from given url (".$url.")."
"Unable to init from given url (" . $url . ")."
);
}
@ -213,7 +213,7 @@ abstract class AbstractDecoder
*/
public function isUrl()
{
return (bool) filter_var($this->data, FILTER_VALIDATE_URL);
return (bool)filter_var($this->data, FILTER_VALIDATE_URL);
}
/**
@ -238,8 +238,8 @@ abstract class AbstractDecoder
public function isBinary()
{
if (is_string($this->data)) {
$mime = finfo_buffer(finfo_open(FILEINFO_MIME_TYPE), $this->data);
return (substr($mime, 0, 4) != 'text' && $mime != 'application/x-empty');
$mime = getimagesize($this->data)['mime'] ?? '';
return !in_array($mime, ['image/jpeg', 'image/png', 'image/gif']);
}
return false;
@ -274,7 +274,7 @@ abstract class AbstractDecoder
/**
* Initiates new Image from Intervention\Image\Image
*
* @param Image $object
* @param Image $object
* @return \Intervention\Image\Image
*/
public function initFromInterventionImage($object)
@ -285,7 +285,7 @@ abstract class AbstractDecoder
/**
* Parses and decodes binary image data from data-url
*
* @param string $data_url
* @param string $data_url
* @return string
*/
private function decodeDataUrl($data_url)
@ -307,7 +307,7 @@ abstract class AbstractDecoder
/**
* Initiates new image from mixed data
*
* @param mixed $data
* @param mixed $data
* @return \Intervention\Image\Image
*/
public function init($data)
@ -359,6 +359,6 @@ abstract class AbstractDecoder
*/
public function __toString()
{
return (string) $this->data;
return (string)$this->data;
}
}

View File

@ -53,7 +53,7 @@ class File
$this->filename = array_key_exists('filename', $info) ? $info['filename'] : null;
if (file_exists($path) && is_file($path)) {
$this->mime = finfo_file(finfo_open(FILEINFO_MIME_TYPE), $path);
$this->mime = getimagesize($path)['mime'] ?? '';
}
return $this;
@ -61,7 +61,7 @@ class File
/**
* Get file size
*
*
* @return mixed
*/
public function filesize()
@ -71,7 +71,7 @@ class File
if (file_exists($path) && is_file($path)) {
return filesize($path);
}
return false;
}

View File

@ -23,7 +23,7 @@ class Decoder extends \Intervention\Image\AbstractDecoder
}
// get mime type of file
$mime = finfo_file(finfo_open(FILEINFO_MIME_TYPE), $path);
$mime = getimagesize($path)['mime'] ?? '';
// define core
switch (strtolower($mime)) {

View File

@ -133,10 +133,10 @@ class ImageManager
*/
private function checkRequirements()
{
if ( ! function_exists('finfo_buffer')) {
throw new MissingDependencyException(
"PHP Fileinfo extension must be installed/enabled to use Intervention Image."
);
}
// if ( ! function_exists('finfo_buffer')) {
// throw new MissingDependencyException(
// "PHP Fileinfo extension must be installed/enabled to use Intervention Image."
// );
// }
}
}

View File

@ -6,7 +6,7 @@
<Icon type="ios-notifications-outline" size="24"></Icon>
</Badge>
</div>
<DropdownMenu slot="list">
<DropdownMenu slot="list" v-show="needList.length">
<DropdownItem :name="item.url" v-for="(item, index) in needList" :key="index"
><Icon :type="item.icon" :style="'background-color:' + item.iconColor" class="iconImg" />{{
item.title

View File

@ -6,6 +6,7 @@
placeholder="菜单搜索"
filterable
remote
clearable
:remote-method="remoteMethod"
:loading="loading"
>

View File

@ -153,12 +153,12 @@ export default {
},
},
watch: {
openedNames() {
this.$nextTick(() => {
this.$refs.menu.updateOpened();
this.$refs.childMenu.updateActiveName();
});
},
// openedNames() {
// this.$nextTick(() => {
// this.$refs.menu.updateOpened();
// this.$refs.childMenu.updateActiveName();
// });
// },
activePath() {
this.$nextTick(() => {
this.$refs.childMenu.updateOpened();

View File

@ -198,20 +198,29 @@ new Vue({
const path = to.path;
let menus = this.$store.state.menus.menusName;
const menuSider = menus;
this.$store.commit('menu/setActivePath', path);
const openNames = getSiderSubmenu(to, menuSider);
this.$store.commit('menu/setOpenNames', openNames);
// 设置顶栏菜单 后台添加一个接口,设置顶部菜单
const headerSider = getHeaderSider(menuSider);
this.$store.commit('menu/setHeader', headerSider);
// 指定当前侧边栏隶属顶部菜单名称。如果你没有使用顶部菜单,则设置为默认的(一般为 home)名称即可
const headerName = getHeaderName(to, menuSider);
this.$store.commit('menu/setHeaderName', headerName);
// 获取侧边栏菜单
const filterMenuSider = getMenuSider(menuSider, headerName);
// 指定当前显示的侧边菜单
this.$store.commit('menu/setOpenMenuName', filterMenuSider[0].title);
this.$store.commit('menu/setSider', filterMenuSider[0]?.children || []);
if (headerName !== null) {
this.$store.commit('menu/setActivePath', path);
const openNames = getSiderSubmenu(to, menuSider);
this.$store.commit('menu/setOpenNames', openNames);
// 设置顶栏菜单 后台添加一个接口,设置顶部菜单
const headerSider = getHeaderSider(menuSider);
this.$store.commit('menu/setHeader', headerSider);
// 指定当前侧边栏隶属顶部菜单名称。如果你没有使用顶部菜单,则设置为默认的(一般为 home)名称即可
this.$store.commit('menu/setHeaderName', headerName);
// 获取侧边栏菜单
const filterMenuSider = getMenuSider(menuSider, headerName);
// 指定当前显示的侧边菜单
this.$store.commit('menu/setOpenMenuName', filterMenuSider[0].title);
this.$store.commit('menu/setSider', filterMenuSider[0]?.children || []);
} else {
//子路由给默认 如果你没有使用顶部菜单,则设置为默认的(一般为 home)名称即可
// this.$store.commit('menu/setHeaderName', 'home');
// 指定当前显示的侧边菜单
// this.$store.commit('menu/setSider', menuSider);
}
if (to.meta.kefu) {
document.getElementsByTagName('body')[0].className = 'kf_mobile';
} else {
@ -228,7 +237,7 @@ new Vue({
return;
}
// 在 404 时,是没有 headerName 的
// });
},
},

View File

@ -228,37 +228,37 @@ export default {
],
cardLists: [
{
col: 6,
col: 8,
count: 0,
name: '活动参与人数(人)',
className: 'ios-speedometer-outline',
},
{
col: 6,
col: 8,
count: 0,
name: '推广人数(人)',
className: 'ios-speedometer-outline',
},
{
col: 6,
col: 8,
count: 0,
name: '发起砍价数',
className: 'ios-speedometer-outline',
},
{
col: 6,
col: 8,
count: 0,
name: '砍价成功数',
className: 'ios-speedometer-outline',
},
{
col: 6,
col: 8,
count: 0,
name: '支付订单额(元)',
className: 'ios-speedometer-outline',
},
{
col: 6,
col: 8,
count: 0,
name: '支付人数(人)',
className: 'ios-speedometer-outline',

View File

@ -59,6 +59,7 @@ export default {
},
mounted() {
this.account = this.$store.state.userInfo.userInfo.account;
this.formValidate.real_name = this.$store.state.userInfo.userInfo.real_name;
},
methods: {
handleSubmit(name) {
@ -66,6 +67,7 @@ export default {
if (valid) {
updtaeAdmin(this.formValidate)
.then((res) => {
this.$store.commit('userInfo/userRealName', this.formValidate.real_name);
this.$Message.success(res.msg);
})
.catch((res) => {

View File

@ -56,6 +56,9 @@ export default {
userInfo(state, userInfo) {
state.userInfo = userInfo;
},
userRealName(state, realName) {
state.userInfo.real_name = realName;
},
uniqueAuth(state, uniqueAuth) {
state.uniqueAuth = uniqueAuth;
},

View File

@ -241,7 +241,8 @@
sysHeight: sysHeight,
newData: {},
activeRouter: '',
is_diy_set: false
is_diy_set: false,
adding: false
};
},
computed: mapGetters(['isLogin']),
@ -700,28 +701,32 @@
that.cartList.valid[index] = item;
that.getCartNum();
that.switchSelect();
});
}).catch(err => {
item.cart_num = Number(item.cart_num) + 1
})
}
},
addCart: function(index) {
let that = this;
if (this.adding) return
let item = that.cartList.valid[index];
let lastnum = Number(item.cart_num) + 1
item.cart_num = Number(item.cart_num) + 1
let productInfo = item.productInfo;
if (productInfo.hasOwnProperty('attrInfo') && lastnum >= item.productInfo.attrInfo.stock) {
lastnum = item.productInfo.attrInfo.stock;
if (productInfo.hasOwnProperty('attrInfo') && item.cart_num >= item.productInfo.attrInfo.stock) {
item.cart_num = item.productInfo.attrInfo.stock;
item.numAdd = true;
item.numSub = false;
} else {
item.numAdd = false;
item.numSub = false;
}
that.setCartNum(item.id, lastnum, (data) => {
that.setCartNum(item.id, item.cart_num, (data) => {
that.cartList.valid[index] = item;
item.cart_num = Number(item.cart_num) + 1;
that.getCartNum();
that.switchSelect();
});
}).catch(err => {
item.cart_num = Number(item.cart_num) - 1
})
},
setCartNum(cartId, cartNum, successCallback) {
let that = this;
@ -737,6 +742,7 @@
let that = this;
getCartCounts().then(res => {
that.cartCount = res.data.count;
this.adding = false
this.$store.commit('indexData/setCartNum', res.data.count > 99 ? '..' : res.data.count)
if (res.data.count > 0) {
wx.setTabBarBadge({