mirror of
https://github.com/crmeb/CRMEB.git
synced 2025-12-19 17:02:55 +00:00
修改bug
This commit is contained in:
parent
f7d594406f
commit
6726f2b98c
@ -36,4 +36,18 @@ class UserNotice extends ModelBasic
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取用户通知
|
||||||
|
* @param array $where
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public static function getUserList($where = array()){
|
||||||
|
$model = new self;
|
||||||
|
if(isset($where['title']) && $where['title'] != '') $model = $model->where('title','LIKE',"%".$where['title']."%");
|
||||||
|
$model = $model->where('type',2);
|
||||||
|
$model = $model->where('is_send',0);
|
||||||
|
$model = $model->order('id desc');
|
||||||
|
return self::page($model,$where);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
220
application/admin/view/ump/store_bargain/index.php
Normal file
220
application/admin/view/ump/store_bargain/index.php
Normal file
@ -0,0 +1,220 @@
|
|||||||
|
{extend name="public/container"}
|
||||||
|
{block name="head_top"}
|
||||||
|
<script type="text/javascript" src="{__PLUG_PATH}jquery.downCount.js"></script>
|
||||||
|
{/block}
|
||||||
|
{block name="content"}
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-sm-12">
|
||||||
|
<div class="ibox float-e-margins">
|
||||||
|
<div class="ibox-title">
|
||||||
|
<h5>砍价产品搜索</h5>
|
||||||
|
<div class="ibox-tools">
|
||||||
|
<a class="collapse-link">
|
||||||
|
<i class="fa fa-chevron-up"></i>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="ibox-content">
|
||||||
|
<div class="alert alert-success alert-dismissable">
|
||||||
|
<button aria-hidden="true" data-dismiss="alert" class="close" type="button">×</button>
|
||||||
|
目前拥有{$countBargain}个砍价产品
|
||||||
|
</div>
|
||||||
|
<form class="layui-form">
|
||||||
|
<div class="layui-form-item">
|
||||||
|
<div class="layui-inline">
|
||||||
|
<label class="layui-form-label">搜 索:</label>
|
||||||
|
<div class="layui-input-inline">
|
||||||
|
<input type="text" name="store_name" lay-verify="store_name" style="width: 100%" autocomplete="off" placeholder="请输入产品名称,编号" class="layui-input">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="layui-inline">
|
||||||
|
<label class="layui-form-label">砍价状态:</label>
|
||||||
|
<div class="layui-input-inline">
|
||||||
|
<select name="status" lay-verify="status">
|
||||||
|
<option value="">全部</option>
|
||||||
|
<option value="1">开启</option>
|
||||||
|
<option value="0">关闭</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="layui-form-item">
|
||||||
|
<label class="layui-form-label">
|
||||||
|
<button class="layui-btn layui-btn-sm" lay-submit="" lay-filter="search" style="font-size:14px;line-height: 9px;">
|
||||||
|
<i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>搜索</button>
|
||||||
|
<button lay-submit="export" lay-filter="export" class="layui-btn layui-btn-primary layui-btn-sm">
|
||||||
|
<i class="layui-icon layui-icon-delete layuiadmin-button-btn" ></i> Excel导出</button>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-sm-12">
|
||||||
|
<div class="ibox float-e-margins">
|
||||||
|
<div class="ibox-content">
|
||||||
|
<div class="table-responsive" style="margin-top: 20px;">
|
||||||
|
<!-- <div class="layui-btn-group conrelTable">-->
|
||||||
|
<!-- <button class="layui-btn layui-btn-sm layui-btn-danger" type="button" onclick="$eb.createModalFrame(this.innerText,'{:Url('create')}')"><i class="fa fa-check-circle-o"></i>添加砍价</button>-->
|
||||||
|
<!-- </div>-->
|
||||||
|
<table class="layui-hide" id="bargainList" lay-filter="bargainList"></table>
|
||||||
|
<script type="text/html" id="status">
|
||||||
|
<input type='checkbox' name='status' lay-skin='switch' value="{{d.id}}" lay-filter='status' lay-text='开启|关闭' {{ d.status == 1 ? 'checked' : '' }}>
|
||||||
|
</script>
|
||||||
|
<script type="text/html" id="statusCn">
|
||||||
|
{{ d.status == 1 ? d.start_name : '关闭' }}
|
||||||
|
</script>
|
||||||
|
<script type="text/html" id="stopTime">
|
||||||
|
<div class="count-time-{{d.id}}" data-time="{{d._stop_time}}">
|
||||||
|
<span class="days">00</span>
|
||||||
|
:
|
||||||
|
<span class="hours">00</span>
|
||||||
|
:
|
||||||
|
<span class="minutes">00</span>
|
||||||
|
:
|
||||||
|
<span class="seconds">00</span>
|
||||||
|
</div>
|
||||||
|
</script>
|
||||||
|
<script type="text/html" id="barDemo">
|
||||||
|
<button type="button" class="layui-btn layui-btn-xs" onclick="dropdown(this)"><i class="layui-icon layui-icon-util"></i>操作</button>
|
||||||
|
<ul class="layui-nav-child layui-anim layui-anim-upbit">
|
||||||
|
<li>
|
||||||
|
<a href="javascript:void(0);" onclick="$eb.createModalFrame('{{d.title}}-编辑','{:Url('edit')}?id={{d.id}}')"><i class="layui-icon layui-icon-edit"></i> 编辑</a>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<a href="javascript:void(0);" onclick="$eb.createModalFrame('{{d.title}}-编辑内容','{:Url('edit_content')}?id={{d.id}}')"><i class="fa fa-pencil"></i> 编辑内容</a>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<a href="javascript:void(0);" onclick="$eb.createModalFrame('{{d.title}}-编辑规则','{:Url('edit_rule')}?id={{d.id}}')"><i class="layui-icon layui-icon-edit"></i>编辑规则</a>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<a href="javascript:void(0);" class="delstor" lay-event='delstor'><i class="layui-icon layui-icon-delete"></i> 删除</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</script>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{/block}
|
||||||
|
{block name="script"}
|
||||||
|
<script src="{__ADMIN_PATH}js/layuiList.js"></script>
|
||||||
|
<script src="{__FRAME_PATH}js/content.min.js?v=1.0.0"></script>
|
||||||
|
<script>
|
||||||
|
layList.form.render();
|
||||||
|
window.$bargainId = <?php echo json_encode($bargainId);?>;
|
||||||
|
$(document).on('click','#time',function () {
|
||||||
|
var arr = $('#time').text().split(' - ');
|
||||||
|
var reg = new RegExp("-","g");//g,表示全部替换。
|
||||||
|
var newArr = [];
|
||||||
|
if(arr.length >1){
|
||||||
|
$.each(arr,function (index,item) {
|
||||||
|
newArr.push(item.replace(reg,"/"));
|
||||||
|
})
|
||||||
|
$('#time').data('value',newArr.join(' - '));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
layList.tableList('bargainList',"{:Url('get_bargain_list')}",function () {
|
||||||
|
return [
|
||||||
|
{field: 'id', title: '编号', sort: true,width:'5%',event:'id',unresize:true},
|
||||||
|
{field: 'image', title: '砍价图片',event:'open_image',unresize:true, width: '8%',templet: '<p><img src="{{d.image}}" alt="{{d.title}}"></p>'},
|
||||||
|
{field: 'title', title: '砍价名称',width:'15%',unresize:true},
|
||||||
|
{field: 'price', title: '砍价价格',width:'6%',unresize:true},
|
||||||
|
{field: 'bargain_min_price', title: '砍价区间',unresize:true,width:'8%',templet: '<span>{{d.bargain_min_price}}~{{d.bargain_max_price}}</span>'},
|
||||||
|
{field: 'min_price', title: '最低价',width:'5%',unresize:true},
|
||||||
|
{field: 'status', title: '砍价状态',width:'8%',unresize:true,templet:"#status"},
|
||||||
|
{field: 'right', title: '活动状态',width:'8%',unresize:true,templet:"#statusCn"},
|
||||||
|
{field: 'count_people_all', title: '参与人数',unresize:true,width:'6%',templet: '<span>【{{d.count_people_all}}】人</span>'},
|
||||||
|
{field: 'count_people_help', title: '帮忙砍价人数',unresize:true,width:'6%',templet: '<span>【{{d.count_people_help}}】人</span>'},
|
||||||
|
{field: 'count_people_success', title: '砍价成功人数',unresize:true,width:'6%',templet: '<span>【{{d.count_people_success}}】人</span>'},
|
||||||
|
{field: 'look', title: '浏览量',width:'6%',unresize:true},
|
||||||
|
{field: 'stock', title: '库存',width:'4%',unresize:true},
|
||||||
|
{fixed: 'right', title: '结束时间', width: '10%',toolbar: '#stopTime',unresize:true},
|
||||||
|
{fixed: 'right', title: '操作', width: '5%', align: 'center', toolbar: '#barDemo'}
|
||||||
|
]
|
||||||
|
});
|
||||||
|
// layList.date('time');
|
||||||
|
layList.laydate.render({
|
||||||
|
elem:'#time',
|
||||||
|
trigger:'click',
|
||||||
|
eventElem:'#zdy_time',
|
||||||
|
range:true,
|
||||||
|
});
|
||||||
|
setTime();
|
||||||
|
function setTime(){
|
||||||
|
setTimeout(function () {
|
||||||
|
$.each($bargainId,function (index,item) {
|
||||||
|
console.log($('.count-time-'+item).attr('data-time'));
|
||||||
|
$('.count-time-'+item).downCount({
|
||||||
|
date: $('.count-time-'+item).attr('data-time'),
|
||||||
|
offset: +8
|
||||||
|
});
|
||||||
|
})
|
||||||
|
},3000);
|
||||||
|
}
|
||||||
|
layList.search('search',function(where){
|
||||||
|
layList.reload(where);
|
||||||
|
setTime();
|
||||||
|
});
|
||||||
|
layList.search('export',function(where){
|
||||||
|
location.href=layList.U({c:'ump.store_bargain',a:'get_bargain_list',q:{
|
||||||
|
store_name:where.store_name,
|
||||||
|
status:where.status,
|
||||||
|
export:1,
|
||||||
|
}});
|
||||||
|
})
|
||||||
|
layList.switch('status',function (odj,value,name){
|
||||||
|
if(odj.elem.checked==true){
|
||||||
|
layList.baseGet(layList.Url({c:'ump.store_bargain',a:'set_bargain_status',p:{status:1,id:value}}),function (res) {
|
||||||
|
layList.msg(res.msg);
|
||||||
|
});
|
||||||
|
}else{
|
||||||
|
layList.baseGet(layList.Url({c:'ump.store_bargain',a:'set_bargain_status',p:{status:0,id:value}}),function (res) {
|
||||||
|
layList.msg(res.msg);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
layList.tool(function (event,data,obj) {
|
||||||
|
switch (event) {
|
||||||
|
case 'delstor':
|
||||||
|
var url=layList.U({c:'ump.store_bargain',a:'delete',q:{id:data.id}});
|
||||||
|
$eb.$swal('delete',function(){
|
||||||
|
$eb.axios.get(url).then(function(res){
|
||||||
|
if(res.status == 200 && res.data.code == 200) {
|
||||||
|
$eb.$swal('success',res.data.msg);
|
||||||
|
obj.del();
|
||||||
|
}else
|
||||||
|
return Promise.reject(res.data.msg || '删除失败')
|
||||||
|
}).catch(function(err){
|
||||||
|
$eb.$swal('error',err);
|
||||||
|
});
|
||||||
|
})
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
$(document).click(function (e) {
|
||||||
|
$('.layui-nav-child').hide();
|
||||||
|
})
|
||||||
|
function dropdown(that) {
|
||||||
|
var oEvent = arguments.callee.caller.arguments[0] || event;
|
||||||
|
oEvent.stopPropagation();
|
||||||
|
var offset = $(that).offset();
|
||||||
|
var index = $(that).parents('tr').data('index');
|
||||||
|
$('.layui-nav-child').each(function (key) {
|
||||||
|
if (key != index) {
|
||||||
|
$(this).hide();
|
||||||
|
}
|
||||||
|
})
|
||||||
|
$(that).next('ul').css({
|
||||||
|
'padding': 10,
|
||||||
|
'top': offset.top + 30,
|
||||||
|
'min-width': 'inherit',
|
||||||
|
'left': offset.left - $(that).width() / 2,
|
||||||
|
'position': 'fixed'
|
||||||
|
}).toggle();
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
{/block}
|
||||||
371
application/admin/view/ump/store_combination/attr.php
Normal file
371
application/admin/view/ump/store_combination/attr.php
Normal file
@ -0,0 +1,371 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="zh-CN">
|
||||||
|
<head>
|
||||||
|
{include file="public/head"}
|
||||||
|
<title>{$title|default=''}</title>
|
||||||
|
<style>
|
||||||
|
.demo-upload{
|
||||||
|
display: block;
|
||||||
|
height: 33px;
|
||||||
|
text-align: center;
|
||||||
|
border: 1px solid transparent;
|
||||||
|
border-radius: 4px;
|
||||||
|
overflow: hidden;
|
||||||
|
background: #fff;
|
||||||
|
position: relative;
|
||||||
|
box-shadow: 0 1px 1px rgba(0,0,0,.2);
|
||||||
|
margin-right: 4px;
|
||||||
|
}
|
||||||
|
.demo-upload img{
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
.demo-upload-cover{
|
||||||
|
display: none;
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
bottom: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
background: rgba(0,0,0,.6);
|
||||||
|
}
|
||||||
|
.demo-upload:hover .demo-upload-cover{
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
.demo-upload-cover i{
|
||||||
|
color: #fff;
|
||||||
|
font-size: 20px;
|
||||||
|
cursor: pointer;
|
||||||
|
margin: 0 2px;
|
||||||
|
}
|
||||||
|
.check{color: #f00}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="store-attr" class="mp-form" v-cloak="">
|
||||||
|
<i-Form :label-width="80" style="width: 100%" v-show="hidden == false">
|
||||||
|
<Form-Item>
|
||||||
|
<Row>
|
||||||
|
<i-Col span="5">
|
||||||
|
<i-Button type="dashed" long @click="hiddenBool" icon="plus-round">添加新规则</i-Button>
|
||||||
|
</i-Col>
|
||||||
|
</Row>
|
||||||
|
</Form-Item>
|
||||||
|
</i-Form>
|
||||||
|
<i-Form :label-width="80" style="width: 100%" v-show="hidden == true">
|
||||||
|
<Form-Item
|
||||||
|
:label="'规则名称:'">
|
||||||
|
<Row>
|
||||||
|
<i-Col style="position: relative;margin-right: 6px" span="5"
|
||||||
|
v-for="(item, index) in items"
|
||||||
|
:key="index">
|
||||||
|
<i-Input type="text" v-model="item.value" placeholder="设置名称"></i-Input>
|
||||||
|
<i-Button style="position: absolute;top:0;right:0;margin-top:1px;border: none;font-size: 8px;line-height: 1.8" type="ghost" @click="handleRemove(index)" v-show="item.attrHidden == true"><Icon type="close-round" /></i-Button>
|
||||||
|
<i-Button style="position: absolute;top:0;right:0;margin-top:1px;border: none;font-size: 8px;line-height: 1.8" type="ghost" @click="attrHiddenBool(item)" v-show="item.attrHidden == false"><Icon type="checkmark-round"></Icon></i-Button>
|
||||||
|
</i-Col>
|
||||||
|
<i-Col span="5">
|
||||||
|
<i-Button type="dashed" long @click="handleAdd" icon="plus-round">添加新规则</i-Button>
|
||||||
|
</i-Col>
|
||||||
|
</Row>
|
||||||
|
</Form-Item>
|
||||||
|
<Form-Item v-show="item.attrHidden == true"
|
||||||
|
v-for="(item, index) in items"
|
||||||
|
:key="index"
|
||||||
|
:label="''+item.value+':'" >
|
||||||
|
<Row>
|
||||||
|
<i-Col span="3"
|
||||||
|
v-for="(attr,k) in item.detail"
|
||||||
|
:key="attr"
|
||||||
|
:name="attr">
|
||||||
|
<Tag type="border" closable color="blue" @on-close="attrRemove(item,k)">{{ attr }}</Tag>
|
||||||
|
</i-Col>
|
||||||
|
<i-Col span="5">
|
||||||
|
<i-Input type="text" v-model="item.detailValue" placeholder="设置属性"></i-Input>
|
||||||
|
</i-Col>
|
||||||
|
<i-Col span="5">
|
||||||
|
<i-Button type="primary" style="margin-left: 6px" @click="attrAdd(item)">添加</i-Button>
|
||||||
|
</i-Col>
|
||||||
|
</Row>
|
||||||
|
</Form-Item>
|
||||||
|
<Form-Item v-show="hidden == true" style="width: 100%;">
|
||||||
|
<Row style="margin: 0 88px 0 20px">
|
||||||
|
<i-Col span="24">
|
||||||
|
<i-Button type="primary" long @click="addGoods(true)">生成</i-Button>
|
||||||
|
</i-Col>
|
||||||
|
</Row>
|
||||||
|
</Form-Item>
|
||||||
|
|
||||||
|
<template v-if="items[0].value!='' && items[0].detail.length>0 && attrs.length">
|
||||||
|
<template v-for="(attr,index) in attrs">
|
||||||
|
<Form-Item>
|
||||||
|
<Row>
|
||||||
|
<template v-for="(item,index) in attr.detail">
|
||||||
|
<i-Col span="3" style="margin-right: 3px">
|
||||||
|
{{index}}:{{item}}
|
||||||
|
</i-Col>
|
||||||
|
</template>
|
||||||
|
<i-Col span="5" style="margin-right: 3px">
|
||||||
|
<span :class="attr.check ? 'check':''">金额:</span><i-Input placeholder="请输入金额" v-model="attr.price" style="width: 68%"
|
||||||
|
:number="true"></i-Input>
|
||||||
|
</i-Col>
|
||||||
|
<i-Col span="5" style="margin-right: 3px">
|
||||||
|
<span :class="attr.check ? 'check':''">库存:</span><i-Input placeholder="请输入库存" v-model="attr.sales" style="width: 68%"
|
||||||
|
:number="true"></i-Input>
|
||||||
|
</i-Col>
|
||||||
|
<i-Col span="2" offset="1" style="margin-right: 3px">
|
||||||
|
<div class="demo-upload">
|
||||||
|
<img :src="attr.pic">
|
||||||
|
<div class="demo-upload-cover">
|
||||||
|
<Icon type="ios-eye-outline" @click.native="openPic(attr.pic)" ></Icon>
|
||||||
|
<Upload
|
||||||
|
:show-upload-list="false"
|
||||||
|
:on-success="uploadSuccess(attr)"
|
||||||
|
:on-error="uploadError"
|
||||||
|
:format="['jpg','jpeg','png']"
|
||||||
|
:max-size="2048"
|
||||||
|
accept="image/*"
|
||||||
|
:on-format-error="uploadFormatError"
|
||||||
|
action="{:Url('upload')}"
|
||||||
|
style="display: inline-block"
|
||||||
|
:goods="attr"
|
||||||
|
>
|
||||||
|
<Icon type="ios-cloud-upload-outline"></Icon>
|
||||||
|
</Upload>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</i-Col>
|
||||||
|
<i-Col span="2" style="margin-right: 3px">
|
||||||
|
<i-Button type="ghost" @click="removeGoods(index)">删除</i-Button>
|
||||||
|
</i-Col>
|
||||||
|
</Row>
|
||||||
|
</Form-Item>
|
||||||
|
</template>
|
||||||
|
<Form-Item>
|
||||||
|
<Row>
|
||||||
|
<!-- <i-Col span="10">-->
|
||||||
|
<!-- <i-Button type="dashed" long @click="addGoods" icon="plus-round">添加新商品</i-Button>-->
|
||||||
|
<!-- </i-Col>-->
|
||||||
|
<i-Col span="2" offset="2">
|
||||||
|
<i-Button type="primary" @click="submit">提交</i-Button>
|
||||||
|
</i-Col>
|
||||||
|
<i-Col span="2" offset="1">
|
||||||
|
<i-Button type="error" @click="clear">清空所有属性</i-Button>
|
||||||
|
</i-Col>
|
||||||
|
</Row>
|
||||||
|
</Form-Item>
|
||||||
|
</template>
|
||||||
|
</i-Form>
|
||||||
|
<Spin fix v-show="submiting == true">保存中...</Spin>
|
||||||
|
</div>
|
||||||
|
<script>
|
||||||
|
var _vm ;
|
||||||
|
mpFrame.start(function(Vue){
|
||||||
|
new Vue({
|
||||||
|
data () {
|
||||||
|
return {
|
||||||
|
hidden:false,
|
||||||
|
submiting :false,
|
||||||
|
items: <?php echo $result && isset($result['attr']) && !empty($result['attr']) ? json_encode($result['attr']) : 'false'; ?> || [
|
||||||
|
{
|
||||||
|
value: '',
|
||||||
|
detailValue:'',
|
||||||
|
attrHidden:false,
|
||||||
|
detail:[]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
attrs:<?php echo $result && isset($result['value']) && !empty($result['value']) ? json_encode($result['value']) : '[]'; ?>
|
||||||
|
}
|
||||||
|
},
|
||||||
|
watch:{
|
||||||
|
items:{
|
||||||
|
handler:function(){
|
||||||
|
// this.attrs = [];
|
||||||
|
},
|
||||||
|
deep:true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
attrHiddenBool(item){
|
||||||
|
if(item.value == ''){
|
||||||
|
$eb.message('error','请填写规则名称');
|
||||||
|
}else{
|
||||||
|
item.attrHidden = true;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
hiddenBool(){
|
||||||
|
this.hidden = true;
|
||||||
|
},
|
||||||
|
handleAdd () {
|
||||||
|
if(!this.checkAttr())return ;
|
||||||
|
this.items.push({
|
||||||
|
value: '',
|
||||||
|
detailValue:'',
|
||||||
|
attrHidden:false,
|
||||||
|
detail:[]
|
||||||
|
});
|
||||||
|
},
|
||||||
|
checkAttr(){
|
||||||
|
var bool = true;
|
||||||
|
this.items.map(function(item){
|
||||||
|
if(!bool) return;
|
||||||
|
if(!item.value){
|
||||||
|
$eb.message('error','请填写规则名称');
|
||||||
|
bool = false;
|
||||||
|
}else if(!item.detail.length){
|
||||||
|
$eb.message('error','请设置规则属性');
|
||||||
|
bool = false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return bool;
|
||||||
|
},
|
||||||
|
attrAdd (item) {
|
||||||
|
if(!item.detailValue) return false;
|
||||||
|
item.detail.push(item.detailValue);
|
||||||
|
item.detailValue = '';
|
||||||
|
},
|
||||||
|
handleRemove (index) {
|
||||||
|
if(this.items.length > 1)
|
||||||
|
this.items.splice(index,1);
|
||||||
|
else
|
||||||
|
$eb.message('error','请设置至少一个规则');
|
||||||
|
},
|
||||||
|
attrRemove(item,k){
|
||||||
|
if(1==item.detail.length){
|
||||||
|
$eb.message('error','请设置至少一个属性');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
item.detail.splice(k,1);
|
||||||
|
},
|
||||||
|
removeGoods(index){
|
||||||
|
this.attrs.splice(index,1);
|
||||||
|
},
|
||||||
|
checkGoods(){
|
||||||
|
var bool = true;
|
||||||
|
this.attrs.map(function(attr){
|
||||||
|
if(!bool) return ;
|
||||||
|
if(!Object.keys(attr.detail).length){
|
||||||
|
$eb.message('error','请选择至少一个属性');
|
||||||
|
bool = false;
|
||||||
|
}else if(attr.price != parseFloat(attr.price) || attr.price < 0){
|
||||||
|
$eb.message('error','请输入正确的商品价格');
|
||||||
|
bool = false;
|
||||||
|
}else if(attr.sales != parseInt(attr.sales) || attr.sales < 0){
|
||||||
|
$eb.message('error','请输入正确的商品库存');
|
||||||
|
bool = false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return bool;
|
||||||
|
},
|
||||||
|
addGoods(type){
|
||||||
|
var that = this;
|
||||||
|
if(this.attrs.length){
|
||||||
|
if(!this.checkGoods())return ;
|
||||||
|
}
|
||||||
|
$eb.axios.post("{:Url('is_format_attr',array('id'=>$id))}",{items:this.items,attrs:this.attrs}).then(function(res){
|
||||||
|
if(res.data.code == 200){
|
||||||
|
that.attrs = res.data.data
|
||||||
|
}else{
|
||||||
|
$eb.message('error',res.data.msg);
|
||||||
|
}
|
||||||
|
}).catch(function(err){
|
||||||
|
if(res.data.code == 200){
|
||||||
|
that.attrs = res.data.data
|
||||||
|
}else{
|
||||||
|
$eb.message('error',res.data.msg);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
// if(type === true){
|
||||||
|
// this.attrs = [{
|
||||||
|
// detail:{},
|
||||||
|
// price:'',
|
||||||
|
// sales:'',
|
||||||
|
// pic:'{$image}'
|
||||||
|
// }];
|
||||||
|
// }else{
|
||||||
|
// this.attrs.push({
|
||||||
|
// detail:{},
|
||||||
|
// price:'',
|
||||||
|
// sales:'',
|
||||||
|
// pic:'{$image}'
|
||||||
|
// });
|
||||||
|
// }
|
||||||
|
},
|
||||||
|
openPic(src){
|
||||||
|
$eb.openImage(src);
|
||||||
|
},
|
||||||
|
uploadSuccess(data){
|
||||||
|
return function(response, file, fileList){
|
||||||
|
if(response.code == 200){
|
||||||
|
data.pic = response.data.url;
|
||||||
|
}else{
|
||||||
|
$eb.message('error',response.data.msg || '图片上传失败!');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
uploadError(error, file, fileList){
|
||||||
|
$eb.message('error',error);
|
||||||
|
},
|
||||||
|
uploadFormatError(file, fileList){
|
||||||
|
$eb.message('error','图片格式错误');
|
||||||
|
},
|
||||||
|
submit(){
|
||||||
|
var that = this;
|
||||||
|
that.submiting = true;
|
||||||
|
if(!this.checkAttr() || !this.checkGoods()) return ;
|
||||||
|
for(let attr in that.attrs){
|
||||||
|
that.attrs[attr].check = false;
|
||||||
|
}
|
||||||
|
$eb.axios.post("{:Url('set_attr',array('id'=>$id))}",{items:this.items,attrs:this.attrs}).then(function(res){
|
||||||
|
that.submiting = false;
|
||||||
|
if(res.status == 200 && res.data.code == 200){
|
||||||
|
$eb.message('success',res.data.msg || '编辑成功!');
|
||||||
|
$eb.closeModalFrame(window.name);
|
||||||
|
}else{
|
||||||
|
$eb.message('error',res.data.msg || '请求失败!');
|
||||||
|
}
|
||||||
|
}).catch(function(err){
|
||||||
|
$eb.message('error',err);
|
||||||
|
})
|
||||||
|
},
|
||||||
|
clear(){
|
||||||
|
var that = this;
|
||||||
|
requirejs(['sweetalert'], function (swel) {
|
||||||
|
swel({
|
||||||
|
title: "您确定要清空产品属性吗",
|
||||||
|
text: "删除后将无法恢复,请谨慎操作!",
|
||||||
|
type: "warning",
|
||||||
|
showCancelButton: true,
|
||||||
|
confirmButtonColor: "#DD6B55",
|
||||||
|
confirmButtonText: "是的,我要清空!",
|
||||||
|
cancelButtonText: "让我再考虑一下…",
|
||||||
|
closeOnConfirm: false,
|
||||||
|
closeOnCancel: false
|
||||||
|
}).then(function () {
|
||||||
|
$eb.axios.post("{:Url('clear_attr',array('id'=>$id))}", {
|
||||||
|
items: that.items,
|
||||||
|
attrs: that.attrs
|
||||||
|
}).then(function (res) {
|
||||||
|
if (res.status == 200 && res.data.code == 200) {
|
||||||
|
$eb.message('success', res.data.msg || '清空成功!');
|
||||||
|
window.location.reload();
|
||||||
|
} else {
|
||||||
|
$eb.message('error', res.data.msg || '清空失败!');
|
||||||
|
}
|
||||||
|
}).catch(function (err) {
|
||||||
|
$eb.message('error', err);
|
||||||
|
})
|
||||||
|
}).catch(console.log);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted (){
|
||||||
|
_vm = this;
|
||||||
|
var resultAdmin = <?php echo $result && isset($result['attr']) && !empty($result['attr']) ? json_encode($result['attr']) : 'false'; ?>;
|
||||||
|
if(resultAdmin) this.hidden = true;
|
||||||
|
}
|
||||||
|
}).$mount(document.getElementById('store-attr'));
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
212
application/admin/view/ump/store_combination/combina_list.php
Normal file
212
application/admin/view/ump/store_combination/combina_list.php
Normal file
@ -0,0 +1,212 @@
|
|||||||
|
{extend name="public/container"}
|
||||||
|
{block name="head_top"}
|
||||||
|
<script src="{__PLUG_PATH}sweetalert2/sweetalert2.all.min.js"></script>
|
||||||
|
<script src="{__PLUG_PATH}moment.js"></script>
|
||||||
|
<link rel="stylesheet" href="{__PLUG_PATH}daterangepicker/daterangepicker.css">
|
||||||
|
<script src="{__PLUG_PATH}daterangepicker/daterangepicker.js"></script>
|
||||||
|
{/block}
|
||||||
|
{block name="content"}
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-sm-12">
|
||||||
|
<div class="ibox">
|
||||||
|
<div class="ibox-content">
|
||||||
|
<div class="row">
|
||||||
|
<div class="m-b m-l">
|
||||||
|
<form action="" class="form-inline">
|
||||||
|
<div class="input-group datepicker">
|
||||||
|
<input style="width: 188px;" type="text" id="data" class="input-sm form-control" name="data" value="{$where.data}" placeholder="请选择日期" >
|
||||||
|
</div>
|
||||||
|
<select name="status" aria-controls="editable" class="form-control input-sm">
|
||||||
|
<option value="">全部</option>
|
||||||
|
<option value="1" {eq name="where.status" value="1"}selected="selected"{/eq}>进行中</option>
|
||||||
|
<option value="2" {eq name="where.status" value="2"}selected="selected"{/eq}>已完成</option>
|
||||||
|
<option value="3" {eq name="where.status" value="3"}selected="selected"{/eq}>未完成</option>
|
||||||
|
</select>
|
||||||
|
<div class="input-group">
|
||||||
|
<span class="input-group-btn">
|
||||||
|
<button type="submit" id="no_export" class="btn btn-sm btn-primary"> <i class="fa fa-search" ></i> 搜索</button>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<script>
|
||||||
|
$('#export').on('click',function(){
|
||||||
|
$('input[name=export]').val(1);
|
||||||
|
});
|
||||||
|
$('#no_export').on('click',function(){
|
||||||
|
$('input[name=export]').val(0);
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="table-responsive" style="overflow:visible">
|
||||||
|
<table class="table table-striped table-bordered">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th class="text-center">开团团长</th>
|
||||||
|
<th class="text-center">开团时间</th>
|
||||||
|
<th class="text-center">拼团产品</th>
|
||||||
|
<th class="text-center">几人团</th>
|
||||||
|
<th class="text-center">几人参加</th>
|
||||||
|
<th class="text-center">结束时间</th>
|
||||||
|
<th class="text-center">状态</th>
|
||||||
|
<th class="text-center">操作</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody class="">
|
||||||
|
{volist name="list" id="vo"}
|
||||||
|
<tr>
|
||||||
|
<td class="text-center">
|
||||||
|
{$vo.uid|getUserNickname}/{$vo.uid}
|
||||||
|
</td>
|
||||||
|
<td class="text-center">
|
||||||
|
{$vo.add_time|date='Y-m-d H:i:s',###}
|
||||||
|
</td>
|
||||||
|
<td class="text-center">
|
||||||
|
{$vo.title}/{$vo.cid}
|
||||||
|
</td>
|
||||||
|
<td class="text-center">
|
||||||
|
{$vo.people}人
|
||||||
|
</td>
|
||||||
|
<td class="text-center">
|
||||||
|
{$vo.count_people}人
|
||||||
|
</td>
|
||||||
|
<td class="text-center">
|
||||||
|
{$vo.stop_time|date='Y-m-d H:i:s',###}
|
||||||
|
</td>
|
||||||
|
<td class="text-center">
|
||||||
|
{if condition="$vo['status'] eq 1"}
|
||||||
|
<span style="color: #00a0e9">进行中</span>
|
||||||
|
{elseif condition="$vo['status'] eq 2"}
|
||||||
|
<span style="color: #e933ce">已完成</span>
|
||||||
|
{elseif condition="$vo['status'] eq 3"}
|
||||||
|
<span style="color: #2725e9">未完成</span>
|
||||||
|
{/if}
|
||||||
|
</td>
|
||||||
|
<td class="text-center">
|
||||||
|
<p><button class="btn btn-default btn-xs btn-outline" type="button" onclick="$eb.createModalFrame('查看详情','{:Url('order_pink',array('id'=>$vo['id']))}')"><i class="fa fa-newspaper-o"></i>查看详情</button></p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
{/volist}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
{include file="public/inner_page"}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{/block}
|
||||||
|
{block name="script"}
|
||||||
|
<script>
|
||||||
|
$(".open_image").on('click',function (e) {
|
||||||
|
var image = $(this).data('image');
|
||||||
|
$eb.openImage(image);
|
||||||
|
})
|
||||||
|
$('.btn-danger').on('click',function (e) {
|
||||||
|
window.t = $(this);
|
||||||
|
var _this = $(this),url =_this.data('url');
|
||||||
|
$eb.$swal('delete',function(){
|
||||||
|
$eb.axios.get(url).then(function(res){
|
||||||
|
if(res.status == 200 && res.data.code == 200) {
|
||||||
|
$eb.$swal('success',res.data.msg);
|
||||||
|
}else
|
||||||
|
return Promise.reject(res.data.msg || '收货失败')
|
||||||
|
}).catch(function(err){
|
||||||
|
$eb.$swal('error',err);
|
||||||
|
});
|
||||||
|
},{'title':'您确定要修改收货状态吗?','text':'修改后将无法恢复,请谨慎操作!','confirm':'是的,我要修改'})
|
||||||
|
})
|
||||||
|
$('.offline_btn').on('click',function (e) {
|
||||||
|
window.t = $(this);
|
||||||
|
var _this = $(this),url =_this.data('url'),pay_price =_this.data('pay');
|
||||||
|
$eb.$swal('delete',function(){
|
||||||
|
$eb.axios.get(url).then(function(res){
|
||||||
|
if(res.status == 200 && res.data.code == 200) {
|
||||||
|
$eb.$swal('success',res.data.msg);
|
||||||
|
}else
|
||||||
|
return Promise.reject(res.data.msg || '收货失败')
|
||||||
|
}).catch(function(err){
|
||||||
|
$eb.$swal('error',err);
|
||||||
|
});
|
||||||
|
},{'title':'您确定要修改已支付'+pay_price+'元的状态吗?','text':'修改后将无法恢复,请谨慎操作!','confirm':'是的,我要修改'})
|
||||||
|
})
|
||||||
|
|
||||||
|
$('.add_mark').on('click',function (e) {
|
||||||
|
var _this = $(this),url =_this.data('url'),id=_this.data('id');
|
||||||
|
$eb.$alert('textarea',{},function (result) {
|
||||||
|
if(result){
|
||||||
|
$.ajax({
|
||||||
|
url:url,
|
||||||
|
data:'remark='+result+'&id='+id,
|
||||||
|
type:'post',
|
||||||
|
dataType:'json',
|
||||||
|
success:function (res) {
|
||||||
|
console.log(res);
|
||||||
|
if(res.code == 200) {
|
||||||
|
$eb.$swal('success',res.msg);
|
||||||
|
}else
|
||||||
|
$eb.$swal('error',res.msg);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}else{
|
||||||
|
$eb.$swal('error','请输入要备注的内容');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
})
|
||||||
|
$('.save_mark').on('click',function (e) {
|
||||||
|
var _this = $(this),url =_this.data('url'),id=_this.data('id'),make=_this.data('make');
|
||||||
|
$eb.$alert('textarea',{title:'请修改内容',value:make},function (result) {
|
||||||
|
if(result){
|
||||||
|
$.ajax({
|
||||||
|
url:url,
|
||||||
|
data:'remark='+result+'&id='+id,
|
||||||
|
type:'post',
|
||||||
|
dataType:'json',
|
||||||
|
success:function (res) {
|
||||||
|
console.log(res);
|
||||||
|
if(res.code == 200) {
|
||||||
|
$eb.$swal('success',res.msg);
|
||||||
|
}else
|
||||||
|
$eb.$swal('error',res.msg);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}else{
|
||||||
|
$eb.$swal('error','请输入要备注的内容');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
})
|
||||||
|
var dateInput =$('.datepicker');
|
||||||
|
dateInput.daterangepicker({
|
||||||
|
autoUpdateInput: false,
|
||||||
|
"opens": "center",
|
||||||
|
"drops": "down",
|
||||||
|
"ranges": {
|
||||||
|
'今天': [moment(), moment().add(1, 'days')],
|
||||||
|
'昨天': [moment().subtract(1, 'days'), moment()],
|
||||||
|
'上周': [moment().subtract(6, 'days'), moment()],
|
||||||
|
'前30天': [moment().subtract(29, 'days'), moment()],
|
||||||
|
'本月': [moment().startOf('month'), moment().endOf('month')],
|
||||||
|
'上月': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')]
|
||||||
|
},
|
||||||
|
"locale" : {
|
||||||
|
applyLabel : '确定',
|
||||||
|
cancelLabel : '清空',
|
||||||
|
fromLabel : '起始时间',
|
||||||
|
toLabel : '结束时间',
|
||||||
|
format : 'YYYY/MM/DD',
|
||||||
|
customRangeLabel : '自定义',
|
||||||
|
daysOfWeek : [ '日', '一', '二', '三', '四', '五', '六' ],
|
||||||
|
monthNames : [ '一月', '二月', '三月', '四月', '五月', '六月',
|
||||||
|
'七月', '八月', '九月', '十月', '十一月', '十二月' ],
|
||||||
|
firstDay : 1
|
||||||
|
}
|
||||||
|
});
|
||||||
|
dateInput.on('cancel.daterangepicker', function(ev, picker) {
|
||||||
|
$("#data").val('');
|
||||||
|
});
|
||||||
|
dateInput.on('apply.daterangepicker', function(ev, picker) {
|
||||||
|
$("#data").val(picker.startDate.format('YYYY/MM/DD') + ' - ' + picker.endDate.format('YYYY/MM/DD'));
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
{/block}
|
||||||
260
application/admin/view/ump/store_combination/index.php
Normal file
260
application/admin/view/ump/store_combination/index.php
Normal file
@ -0,0 +1,260 @@
|
|||||||
|
{extend name="public/container"}
|
||||||
|
{block name="head_top"}
|
||||||
|
<script type="text/javascript" src="{__PLUG_PATH}jquery.downCount.js"></script>
|
||||||
|
{/block}
|
||||||
|
{block name="content"}
|
||||||
|
<div class="layui-fluid">
|
||||||
|
<div class="layui-row layui-col-space15" id="app">
|
||||||
|
<div class="layui-col-md12">
|
||||||
|
<div class="layui-card">
|
||||||
|
<div class="layui-card-header">拼团产品搜索</div>
|
||||||
|
<div class="layui-card-body">
|
||||||
|
<div class="alert alert-success alert-dismissable">
|
||||||
|
<button aria-hidden="true" data-dismiss="alert" class="close" type="button">×</button>
|
||||||
|
目前拥有{$countCombination}个拼团产品
|
||||||
|
</div>
|
||||||
|
<form class="layui-form">
|
||||||
|
<div class="layui-form-item">
|
||||||
|
<div class="layui-inline">
|
||||||
|
<label class="layui-form-label">搜 索:</label>
|
||||||
|
<div class="layui-input-inline">
|
||||||
|
<input type="text" name="store_name" lay-verify="store_name" style="width: 100%" autocomplete="off" placeholder="请输入产品名称,关键字,编号" class="layui-input">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="layui-inline">
|
||||||
|
<label class="layui-form-label">拼团状态:</label>
|
||||||
|
<div class="layui-input-inline">
|
||||||
|
<select name="is_show" lay-verify="is_show">
|
||||||
|
<option value="">全部</option>
|
||||||
|
<option value="1">开启</option>
|
||||||
|
<option value="0">关闭</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="layui-form-item">
|
||||||
|
<label class="layui-form-label">
|
||||||
|
<button class="layui-btn layui-btn-sm" lay-submit="" lay-filter="search" style="font-size:14px;line-height: 9px;">
|
||||||
|
<i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>搜索</button>
|
||||||
|
<button lay-submit="export" lay-filter="export" class="layui-btn layui-btn-primary layui-btn-sm">
|
||||||
|
<i class="layui-icon layui-icon-delete layuiadmin-button-btn" ></i> Excel导出</button>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="layui-col-sm6 layui-col-md3">
|
||||||
|
<div class="layui-card">
|
||||||
|
<div class="layui-card-header">
|
||||||
|
总展现量
|
||||||
|
<span class="layui-badge layuiadmin-badge">量</span>
|
||||||
|
</div>
|
||||||
|
<div class="layui-card-body">
|
||||||
|
<p class="layuiadmin-big-font">{$statistics.browseCount}</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="layui-col-sm6 layui-col-md3">
|
||||||
|
<div class="layui-card">
|
||||||
|
<div class="layui-card-header">
|
||||||
|
访客人数
|
||||||
|
<span class="layui-badge layuiadmin-badge">人</span>
|
||||||
|
</div>
|
||||||
|
<div class="layui-card-body">
|
||||||
|
<p class="layuiadmin-big-font">{$statistics.visitCount}</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="layui-col-sm6 layui-col-md3">
|
||||||
|
<div class="layui-card">
|
||||||
|
<div class="layui-card-header">
|
||||||
|
参与人数
|
||||||
|
<span class="layui-badge layuiadmin-badge">人</span>
|
||||||
|
</div>
|
||||||
|
<div class="layui-card-body">
|
||||||
|
<p class="layuiadmin-big-font">{$statistics.partakeCount}</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="layui-col-sm6 layui-col-md3">
|
||||||
|
<div class="layui-card">
|
||||||
|
<div class="layui-card-header">
|
||||||
|
成团数量
|
||||||
|
<span class="layui-badge layuiadmin-badge">量</span>
|
||||||
|
</div>
|
||||||
|
<div class="layui-card-body">
|
||||||
|
<p class="layuiadmin-big-font">{$statistics.pinkCount}</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- end-->
|
||||||
|
<div class="layui-col-md12">
|
||||||
|
<div class="layui-card">
|
||||||
|
<div class="layui-card-header">拼团产品列表</div>
|
||||||
|
<div class="layui-card-body">
|
||||||
|
<table class="layui-hide" id="combinationList" lay-filter="combinationList"></table>
|
||||||
|
<script type="text/html" id="status">
|
||||||
|
<input type='checkbox' name='status' lay-skin='switch' value="{{d.id}}" lay-filter='status' lay-text='开启|关闭' {{ d.is_show == 1 ? 'checked' : '' }}>
|
||||||
|
</script>
|
||||||
|
<script type="text/html" id="stopTime">
|
||||||
|
<div class="count-time-{{d.id}}" data-time="{{d._stop_time}}">
|
||||||
|
<span class="days">00</span>
|
||||||
|
:
|
||||||
|
<span class="hours">00</span>
|
||||||
|
:
|
||||||
|
<span class="minutes">00</span>
|
||||||
|
:
|
||||||
|
<span class="seconds">00</span>
|
||||||
|
</div>
|
||||||
|
</script>
|
||||||
|
<script type="text/html" id="barDemo">
|
||||||
|
<button type="button" class="layui-btn layui-btn-xs" onclick="dropdown(this)"><i class="layui-icon layui-icon-edit"></i>操作</button>
|
||||||
|
<ul class="layui-nav-child layui-anim layui-anim-upbit">
|
||||||
|
<li>
|
||||||
|
<a href="javascript:void(0);" onclick="$eb.createModalFrame('{{d.title}}-编辑','{:Url('edit')}?id={{d.id}}')"><i class="layui-icon layui-icon-edit"></i> 编辑</a>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<a href="javascript:void(0);" onclick="$eb.createModalFrame('{{d.title}}-编辑内容','{:Url('edit_content')}?id={{d.id}}')"><i class="fa fa-pencil"></i> 编辑内容</a>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<a href="javascript:void(0);" class="delstor" lay-event='delstor'><i class="layui-icon layui-icon-delete"></i> 删除</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</script>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{/block}
|
||||||
|
{block name="script"}
|
||||||
|
<script src="{__ADMIN_PATH}js/layuiList.js"></script>
|
||||||
|
<script>
|
||||||
|
layList.form.render();
|
||||||
|
layList.tableList('combinationList',"{:Url('get_combination_list')}",function () {
|
||||||
|
return [
|
||||||
|
{field: 'id', title: '编号', sort: true,event:'id'},
|
||||||
|
{field: 'image', title: '拼团图片',templet: '<p><img src="{{d.image}}" alt="{{d.title}}" class="open_image" data-image="{{d.image}}"></p>'},
|
||||||
|
{field: 'title', title: '拼团名称'},
|
||||||
|
{field: 'ot_price', title: '原价'},
|
||||||
|
{field: 'price', title: '拼团价'},
|
||||||
|
{field: 'stock', title: '库存'},
|
||||||
|
{field: 'people', title: '拼团人数',templet: '<span>【{{d.people}}】人</span>'},
|
||||||
|
{field: 'count_people_browse', title: '访客人数'},
|
||||||
|
{field: 'browse', title: '展现量'},
|
||||||
|
{field: 'count_people_all', title: '参与人数',templet: '<span>【{{d.count_people_all}}】人</span>'},
|
||||||
|
{field: 'count_people_pink', title: '成团数量',templet: '<span>【{{d.count_people_pink}}】团</span>'},
|
||||||
|
{field: 'browse', title: '浏览量'},
|
||||||
|
{field: 'is_show', title: '产品状态',templet:"#status"},
|
||||||
|
{field: '_stop_time', title: '结束时间',width:'8%',toolbar: '#stopTime'},
|
||||||
|
{fixed: 'right', title: '操作', align: 'center', toolbar: '#barDemo'}
|
||||||
|
]
|
||||||
|
});
|
||||||
|
layList.search('search',function(where){
|
||||||
|
layList.reload(where);
|
||||||
|
setTime();
|
||||||
|
});
|
||||||
|
layList.search('export',function(where){
|
||||||
|
location.href=layList.U({c:'ump.store_combination',a:'save_excel',q:{
|
||||||
|
is_show:where.is_show,
|
||||||
|
store_name:where.store_name
|
||||||
|
}});
|
||||||
|
})
|
||||||
|
setTime();
|
||||||
|
window.$combinationId = <?php echo json_encode($combinationId);?>;
|
||||||
|
function setTime() {
|
||||||
|
setTimeout(function () {
|
||||||
|
$.each($combinationId,function (index,item) {
|
||||||
|
$('.count-time-'+item).downCount({
|
||||||
|
date: $('.count-time-'+item).attr('data-time'),
|
||||||
|
offset: +8
|
||||||
|
});
|
||||||
|
})
|
||||||
|
},3000);
|
||||||
|
}
|
||||||
|
layList.switch('status',function (odj,value,name) {
|
||||||
|
if (odj.elem.checked == true) {
|
||||||
|
layList.baseGet(layList.Url({
|
||||||
|
c: 'ump.store_combination',
|
||||||
|
a: 'set_combination_status',
|
||||||
|
p: {status: 1, id: value}
|
||||||
|
}), function (res) {
|
||||||
|
layList.msg(res.msg);
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
layList.baseGet(layList.Url({
|
||||||
|
c: 'ump.store_combination',
|
||||||
|
a: 'set_combination_status',
|
||||||
|
p: {status: 0, id: value}
|
||||||
|
}), function (res) {
|
||||||
|
layList.msg(res.msg);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
})
|
||||||
|
layList.tool(function (event,data,obj) {
|
||||||
|
switch (event) {
|
||||||
|
case 'delstor':
|
||||||
|
var url=layList.U({c:'ump.store_combination',a:'delete',q:{id:data.id}});
|
||||||
|
console.log(url);
|
||||||
|
$eb.$swal('delete',function(){
|
||||||
|
$eb.axios.get(url).then(function(res){
|
||||||
|
if(res.status == 200 && res.data.code == 200) {
|
||||||
|
$eb.$swal('success',res.data.msg);
|
||||||
|
obj.del();
|
||||||
|
}else
|
||||||
|
return Promise.reject(res.data.msg || '删除失败')
|
||||||
|
}).catch(function(err){
|
||||||
|
$eb.$swal('error',err);
|
||||||
|
});
|
||||||
|
})
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
$(document).click(function (e) {
|
||||||
|
$('.layui-nav-child').hide();
|
||||||
|
})
|
||||||
|
function dropdown(that) {
|
||||||
|
var oEvent = arguments.callee.caller.arguments[0] || event;
|
||||||
|
oEvent.stopPropagation();
|
||||||
|
var offset = $(that).offset();
|
||||||
|
var index = $(that).parents('tr').data('index');
|
||||||
|
$('.layui-nav-child').each(function (key) {
|
||||||
|
if (key != index) {
|
||||||
|
$(this).hide();
|
||||||
|
}
|
||||||
|
})
|
||||||
|
$(that).next('ul').css({
|
||||||
|
'padding': 10,
|
||||||
|
'top': offset.top + 30,
|
||||||
|
'min-width': 'inherit',
|
||||||
|
'left': offset.left - $(that).width() / 2,
|
||||||
|
'position': 'fixed'
|
||||||
|
}).toggle();
|
||||||
|
}
|
||||||
|
$('.js-group-btn').on('click',function(){
|
||||||
|
$('.js-group-btn').css({zIndex:1});
|
||||||
|
$(this).css({zIndex:2});
|
||||||
|
});
|
||||||
|
$('.delstor').on('click',function(){
|
||||||
|
window.t = $(this);
|
||||||
|
var _this = $(this),url =_this.data('url');
|
||||||
|
$eb.$swal('delete',function(){
|
||||||
|
$eb.axios.get(url).then(function(res){
|
||||||
|
console.log(res);
|
||||||
|
if(res.status == 200 && res.data.code == 200) {
|
||||||
|
$eb.$swal('success',res.data.msg);
|
||||||
|
_this.parents('tr').remove();
|
||||||
|
}else
|
||||||
|
return Promise.reject(res.data.msg || '删除失败')
|
||||||
|
}).catch(function(err){
|
||||||
|
$eb.$swal('error',err);
|
||||||
|
});
|
||||||
|
})
|
||||||
|
});
|
||||||
|
$(document).on('click',".open_image",function (e) {
|
||||||
|
var image = $(this).data('image');
|
||||||
|
$eb.openImage(image);
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
{/block}
|
||||||
173
application/admin/view/ump/store_combination/order_pink.php
Normal file
173
application/admin/view/ump/store_combination/order_pink.php
Normal file
@ -0,0 +1,173 @@
|
|||||||
|
{extend name="public/container"}
|
||||||
|
{block name="head_top"}
|
||||||
|
<script src="{__PLUG_PATH}sweetalert2/sweetalert2.all.min.js"></script>
|
||||||
|
<script src="{__PLUG_PATH}moment.js"></script>
|
||||||
|
<link rel="stylesheet" href="{__PLUG_PATH}daterangepicker/daterangepicker.css">
|
||||||
|
<script src="{__PLUG_PATH}daterangepicker/daterangepicker.js"></script>
|
||||||
|
{/block}
|
||||||
|
{block name="content"}
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-sm-12">
|
||||||
|
<div class="ibox">
|
||||||
|
<div class="ibox-content">
|
||||||
|
<div class="row">
|
||||||
|
</div>
|
||||||
|
<div class="table-responsive" style="overflow:visible">
|
||||||
|
<table class="table table-striped table-bordered">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th class="text-center">编号</th>
|
||||||
|
<th class="text-center">用户名称</th>
|
||||||
|
<th class="text-center">用户头像</th>
|
||||||
|
<th class="text-center">订单编号</th>
|
||||||
|
<th class="text-center">金额</th>
|
||||||
|
<th class="text-center">订单状态</th>
|
||||||
|
</thead>
|
||||||
|
<tbody class="">
|
||||||
|
{volist name="list" id="vo"}
|
||||||
|
<tr>
|
||||||
|
<td class="text-center">
|
||||||
|
{$vo.id}
|
||||||
|
</td>
|
||||||
|
<td class="text-center">
|
||||||
|
{$vo.nickname}/{$vo.uid}
|
||||||
|
</td>
|
||||||
|
<td class="text-center">
|
||||||
|
<img class="open_image" style="max-width: 80px;" data-image="{$vo.avatar}" src="{$vo.avatar}" alt="{$vo.nickname}">
|
||||||
|
</td>
|
||||||
|
<td class="text-center">
|
||||||
|
<a href="{:Url('order.storeOrder/index')}?real_name={$vo.order_id_key|getOrderId}">{$vo.order_id}</a>
|
||||||
|
</td>
|
||||||
|
<td class="text-center">
|
||||||
|
¥{$vo.price}
|
||||||
|
</td>
|
||||||
|
<td class="text-center">
|
||||||
|
{if condition="$vo['is_refund']"}
|
||||||
|
已退款
|
||||||
|
{else/}
|
||||||
|
未退款
|
||||||
|
{/if}
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
{/volist}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{/block}
|
||||||
|
{block name="script"}
|
||||||
|
<script>
|
||||||
|
$(".open_image").on('click',function (e) {
|
||||||
|
var image = $(this).data('image');
|
||||||
|
$eb.openImage(image);
|
||||||
|
})
|
||||||
|
$('.btn-danger').on('click',function (e) {
|
||||||
|
window.t = $(this);
|
||||||
|
var _this = $(this),url =_this.data('url');
|
||||||
|
$eb.$swal('delete',function(){
|
||||||
|
$eb.axios.get(url).then(function(res){
|
||||||
|
if(res.status == 200 && res.data.code == 200) {
|
||||||
|
$eb.$swal('success',res.data.msg);
|
||||||
|
}else
|
||||||
|
return Promise.reject(res.data.msg || '收货失败')
|
||||||
|
}).catch(function(err){
|
||||||
|
$eb.$swal('error',err);
|
||||||
|
});
|
||||||
|
},{'title':'您确定要修改收货状态吗?','text':'修改后将无法恢复,请谨慎操作!','confirm':'是的,我要修改'})
|
||||||
|
})
|
||||||
|
$('.offline_btn').on('click',function (e) {
|
||||||
|
window.t = $(this);
|
||||||
|
var _this = $(this),url =_this.data('url'),pay_price =_this.data('pay');
|
||||||
|
$eb.$swal('delete',function(){
|
||||||
|
$eb.axios.get(url).then(function(res){
|
||||||
|
if(res.status == 200 && res.data.code == 200) {
|
||||||
|
$eb.$swal('success',res.data.msg);
|
||||||
|
}else
|
||||||
|
return Promise.reject(res.data.msg || '收货失败')
|
||||||
|
}).catch(function(err){
|
||||||
|
$eb.$swal('error',err);
|
||||||
|
});
|
||||||
|
},{'title':'您确定要修改已支付'+pay_price+'元的状态吗?','text':'修改后将无法恢复,请谨慎操作!','confirm':'是的,我要修改'})
|
||||||
|
})
|
||||||
|
|
||||||
|
$('.add_mark').on('click',function (e) {
|
||||||
|
var _this = $(this),url =_this.data('url'),id=_this.data('id');
|
||||||
|
$eb.$alert('textarea',{},function (result) {
|
||||||
|
if(result){
|
||||||
|
$.ajax({
|
||||||
|
url:url,
|
||||||
|
data:'remark='+result+'&id='+id,
|
||||||
|
type:'post',
|
||||||
|
dataType:'json',
|
||||||
|
success:function (res) {
|
||||||
|
console.log(res);
|
||||||
|
if(res.code == 200) {
|
||||||
|
$eb.$swal('success',res.msg);
|
||||||
|
}else
|
||||||
|
$eb.$swal('error',res.msg);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}else{
|
||||||
|
$eb.$swal('error','请输入要备注的内容');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
})
|
||||||
|
$('.save_mark').on('click',function (e) {
|
||||||
|
var _this = $(this),url =_this.data('url'),id=_this.data('id'),make=_this.data('make');
|
||||||
|
$eb.$alert('textarea',{title:'请修改内容',value:make},function (result) {
|
||||||
|
if(result){
|
||||||
|
$.ajax({
|
||||||
|
url:url,
|
||||||
|
data:'remark='+result+'&id='+id,
|
||||||
|
type:'post',
|
||||||
|
dataType:'json',
|
||||||
|
success:function (res) {
|
||||||
|
console.log(res);
|
||||||
|
if(res.code == 200) {
|
||||||
|
$eb.$swal('success',res.msg);
|
||||||
|
}else
|
||||||
|
$eb.$swal('error',res.msg);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}else{
|
||||||
|
$eb.$swal('error','请输入要备注的内容');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
})
|
||||||
|
var dateInput =$('.datepicker');
|
||||||
|
dateInput.daterangepicker({
|
||||||
|
autoUpdateInput: false,
|
||||||
|
"opens": "center",
|
||||||
|
"drops": "down",
|
||||||
|
"ranges": {
|
||||||
|
'今天': [moment(), moment().add(1, 'days')],
|
||||||
|
'昨天': [moment().subtract(1, 'days'), moment()],
|
||||||
|
'上周': [moment().subtract(6, 'days'), moment()],
|
||||||
|
'前30天': [moment().subtract(29, 'days'), moment()],
|
||||||
|
'本月': [moment().startOf('month'), moment().endOf('month')],
|
||||||
|
'上月': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')]
|
||||||
|
},
|
||||||
|
"locale" : {
|
||||||
|
applyLabel : '确定',
|
||||||
|
cancelLabel : '清空',
|
||||||
|
fromLabel : '起始时间',
|
||||||
|
toLabel : '结束时间',
|
||||||
|
format : 'YYYY/MM/DD',
|
||||||
|
customRangeLabel : '自定义',
|
||||||
|
daysOfWeek : [ '日', '一', '二', '三', '四', '五', '六' ],
|
||||||
|
monthNames : [ '一月', '二月', '三月', '四月', '五月', '六月',
|
||||||
|
'七月', '八月', '九月', '十月', '十一月', '十二月' ],
|
||||||
|
firstDay : 1
|
||||||
|
}
|
||||||
|
});
|
||||||
|
dateInput.on('cancel.daterangepicker', function(ev, picker) {
|
||||||
|
$("#data").val('');
|
||||||
|
});
|
||||||
|
dateInput.on('apply.daterangepicker', function(ev, picker) {
|
||||||
|
$("#data").val(picker.startDate.format('YYYY/MM/DD') + ' - ' + picker.endDate.format('YYYY/MM/DD'));
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
{/block}
|
||||||
@ -140,7 +140,8 @@
|
|||||||
$('.layui-nav-child').hide();
|
$('.layui-nav-child').hide();
|
||||||
})
|
})
|
||||||
function dropdown(that) {
|
function dropdown(that) {
|
||||||
event.stopPropagation();
|
var oEvent = arguments.callee.caller.arguments[0] || event;
|
||||||
|
oEvent.stopPropagation();
|
||||||
var offset = $(that).offset();
|
var offset = $(that).offset();
|
||||||
var index = $(that).parents('tr').data('index');
|
var index = $(that).parents('tr').data('index');
|
||||||
$('.layui-nav-child').each(function (key) {
|
$('.layui-nav-child').each(function (key) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user