作者 王智

'2'

正在显示 52 个修改的文件 包含 3079 行增加62 行删除
{"license":"regular","licenseto":"10789","licensekey":"6whQVX1ao32NFmiR djBBCaJ38peK6+4\/6Tn0Jw=="}
\ No newline at end of file
... ...
<?php
namespace addons\address;
use think\Addons;
/**
* 地址选择
* @author [MiniLing] <[laozheyouxiang@163.com]>
*/
class Address extends Addons
{
/**
* 插件安装方法
* @return bool
*/
public function install()
{
return true;
}
/**
* 插件卸载方法
* @return bool
*/
public function uninstall()
{
return true;
}
}
... ...
require([], function () {
//绑定data-toggle=addresspicker属性点击事件
$(document).on('click', "[data-toggle='addresspicker']", function () {
var that = this;
var callback = $(that).data('callback');
var input_id = $(that).data("input-id") ? $(that).data("input-id") : "";
var lat_id = $(that).data("lat-id") ? $(that).data("lat-id") : "";
var lng_id = $(that).data("lng-id") ? $(that).data("lng-id") : "";
var lat = lat_id ? $("#" + lat_id).val() : '';
var lng = lng_id ? $("#" + lng_id).val() : '';
var url = "/addons/address/index/select";
url += (lat && lng) ? '?lat=' + lat + '&lng=' + lng : '';
Fast.api.open(url, '位置选择', {
callback: function (res) {
input_id && $("#" + input_id).val(res.address).trigger("change");
lat_id && $("#" + lat_id).val(res.lat).trigger("change");
lng_id && $("#" + lng_id).val(res.lng).trigger("change");
try {
//执行回调函数
if (typeof callback === 'function') {
callback.call(that, res);
}
} catch (e) {
}
}
});
});
});
... ...
<?php
return [
[
'name' => 'maptype',
'title' => '默认地图类型',
'type' => 'radio',
'content' => [
'baidu' => '百度地图',
'amap' => '高德地图',
'tencent' => '腾讯地图',
],
'value' => 'amap',
'rule' => 'required',
'msg' => '',
'tip' => '',
'ok' => '',
'extend' => '',
],
[
'name' => 'location',
'title' => '默认检索城市',
'type' => 'string',
'content' => [],
'value' => '北京',
'rule' => 'required',
'msg' => '',
'tip' => '',
'ok' => '',
'extend' => '',
],
[
'name' => 'zoom',
'title' => '默认缩放级别',
'type' => 'string',
'content' => [],
'value' => '12',
'rule' => 'required',
'msg' => '',
'tip' => '',
'ok' => '',
'extend' => '',
],
[
'name' => 'lat',
'title' => '默认Lat',
'type' => 'string',
'content' => [],
'value' => '39.919990',
'rule' => 'required',
'msg' => '',
'tip' => '',
'ok' => '',
'extend' => '',
],
[
'name' => 'lng',
'title' => '默认Lng',
'type' => 'string',
'content' => [],
'value' => '116.456270',
'rule' => 'required',
'msg' => '',
'tip' => '',
'ok' => '',
'extend' => '',
],
[
'name' => 'baidukey',
'title' => '百度地图KEY',
'type' => 'string',
'content' => [],
'value' => 'hAeMFHmpyHa2ZjaCH9VVridl',
'rule' => 'required',
'msg' => '',
'tip' => '',
'ok' => '',
'extend' => '',
],
[
'name' => 'amapkey',
'title' => '高德地图KEY',
'type' => 'string',
'content' => [],
'value' => '1eb0b50d73fb7782a7adeac9ceb958c8',
'rule' => 'required',
'msg' => '',
'tip' => '',
'ok' => '',
'extend' => '',
],
[
'name' => 'tencentkey',
'title' => '腾讯地图KEY',
'type' => 'string',
'content' => [],
'value' => '608d75903d29ad471362f8c58c550daf',
'rule' => 'required',
'msg' => '',
'tip' => '',
'ok' => '',
'extend' => '',
],
[
'name' => '__tips__',
'title' => '温馨提示',
'type' => '',
'content' => [],
'value' => '请先申请对应地图的Key,配置后再使用',
'rule' => '',
'msg' => '',
'tip' => '',
'ok' => '',
'extend' => 'alert-danger-light',
],
];
... ...
<?php
namespace addons\address\controller;
use think\addons\Controller;
use think\Config;
use think\Hook;
class Index extends Controller
{
public function index()
{
// 语言检测
$lang = strip_tags($this->request->langset());
$site = Config::get("site");
// 配置信息
$config = [
'site' => array_intersect_key($site, array_flip(['name', 'cdnurl', 'version', 'timezone', 'languages'])),
'upload' => null,
'modulename' => 'addons',
'controllername' => 'index',
'actionname' => 'index',
'jsname' => 'addons/address',
'moduleurl' => '',
'language' => $lang
];
$config = array_merge($config, Config::get("view_replace_str"));
// 配置信息后
Hook::listen("config_init", $config);
// 加载当前控制器语言包
$this->view->assign('site', $site);
$this->view->assign('config', $config);
return $this->view->fetch();
}
/**
* 选择地址
* @return string
* @throws \think\Exception
*/
public function select()
{
$config = get_addon_config('address');
$lat = $this->request->get('lat', $config['lat']);
$lng = $this->request->get('lng', $config['lng']);
$this->view->assign('lat', $lat);
$this->view->assign('lng', $lng);
$this->view->assign('location', $config['location']);
return $this->view->fetch('index/' . $config['maptype']);
}
}
... ...
name = address
title = 地址选择
intro = 地图位置选择插件,可返回地址和经纬度
author = FastAdmin
website = https://www.fastadmin.net
version = 1.0.5
state = 1
url = /addons/address
license = regular
licenseto = 10789
... ...
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>地址选择器</title>
<link rel="stylesheet" href="__CDN__/assets/css/bootstrap.min.css"/>
<link rel="stylesheet" href="__CDN__/assets/css/fastadmin.min.css"/>
<link rel="stylesheet" href="__CDN__/assets/libs/font-awesome/css/font-awesome.min.css"/>
<style type="text/css">
body {
margin: 0;
padding: 0;
}
#container {
position: absolute;
left: 0;
top: 0;
right: 0;
bottom: 0;
}
.confirm {
position: absolute;
bottom: 30px;
right: 4%;
z-index: 99;
height: 50px;
width: 50px;
line-height: 50px;
font-size: 15px;
text-align: center;
background-color: white;
background: #1ABC9C;
color: white;
border: none;
cursor: pointer;
border-radius: 50%;
}
.search {
position: absolute;
width: 400px;
top: 0;
left: 50%;
padding: 5px;
margin-left: -200px;
}
.amap-marker-label {
border: 0;
background-color: transparent;
}
.info {
padding: .75rem 1.25rem;
margin-bottom: 1rem;
border-radius: .25rem;
position: fixed;
top: 2rem;
background-color: white;
width: auto;
min-width: 22rem;
border-width: 0;
left: 1.8rem;
box-shadow: 0 2px 6px 0 rgba(114, 124, 245, .5);
}
</style>
</head>
<body>
<div class="search">
<div class="input-group">
<input type="text" id="place" name="q" class="form-control" placeholder="输入地点"/>
<span class="input-group-btn">
<button type="submit" name="search" id="search-btn" class="btn btn-success">
<i class="fa fa-search"></i>
</button>
</span>
</div>
</div>
<div class="confirm">确定</div>
<div id="container"></div>
<script type="text/javascript" src="//webapi.amap.com/maps?v=1.4.11&key={$config.amapkey|default=''}&plugin=AMap.ToolBar,AMap.Autocomplete,AMap.PlaceSearch,AMap.Geocoder"></script>
<!-- UI组件库 1.0 -->
<script src="//webapi.amap.com/ui/1.0/main.js?v=1.0.11"></script>
<script src="__CDN__/assets/libs/jquery/dist/jquery.min.js"></script>
<script type="text/javascript">
$(function () {
var as, address, map, lat, lng, geocoder;
var init = function () {
AMapUI.loadUI(['misc/PositionPicker', 'misc/PoiPicker'], function (PositionPicker, PoiPicker) {
//加载PositionPicker,loadUI的路径参数为模块名中 'ui/' 之后的部分
map = new AMap.Map('container', {
zoom: parseInt('{$config.zoom}')
});
geocoder = new AMap.Geocoder({
radius: 1000 //范围,默认:500
});
var positionPicker = new PositionPicker({
mode: 'dragMarker',//设定为拖拽地图模式,可选'dragMap'、'dragMarker',默认为'dragMap'
map: map//依赖地图对象
});
//输入提示
var autoOptions = {
input: "place"
};
var relocation = function (lnglat) {
lng = lnglat.lng;
lat = lnglat.lat;
map.panTo([lng, lat]);
positionPicker.start(lnglat);
geocoder.getAddress(lng + ',' + lat, function (status, result) {
if (status === 'complete' && result.regeocode) {
var address = result.regeocode.formattedAddress;
var label = '<div class="info">地址:' + address + '<br>经度:' + lng + '<br>纬度:' + lat + '</div>';
positionPicker.marker.setLabel({
content: label //显示内容
});
} else {
console.log(JSON.stringify(result));
}
});
};
var auto = new AMap.Autocomplete(autoOptions);
//构造地点查询类
var placeSearch = new AMap.PlaceSearch({
map: map
});
//注册监听,当选中某条记录时会触发
AMap.event.addListener(auto, "select", function (e) {
placeSearch.setCity(e.poi.adcode);
placeSearch.search(e.poi.name); //关键字查询查询
});
AMap.event.addListener(map, 'click', function (e) {
relocation(e.lnglat);
});
//加载工具条
var tool = new AMap.ToolBar();
map.addControl(tool);
var poiPicker = new PoiPicker({
input: 'place',
placeSearchOptions: {
map: map,
pageSize: 6 //关联搜索分页
}
});
poiPicker.on('poiPicked', function (poiResult) {
poiPicker.hideSearchResults();
$('.poi .nearpoi').text(poiResult.item.name);
$('.address .info').text(poiResult.item.address);
$('#address').val(poiResult.item.address);
$("#place").val(poiResult.item.name);
relocation(poiResult.item.location);
});
positionPicker.on('success', function (positionResult) {
as = positionResult.position;
address = positionResult.address;
lat = as.lat;
lng = as.lng;
});
positionPicker.on('fail', function (positionResult) {
address = '';
});
positionPicker.start();
});
};
//点击确定后执行回调赋值
var close = function (data) {
var index = parent.Layer.getFrameIndex(window.name);
var callback = parent.$("#layui-layer" + index).data("callback");
//再执行关闭
parent.Layer.close(index);
//再调用回传函数
if (typeof callback === 'function') {
callback.call(undefined, data);
}
};
//点击搜索按钮
$(document).on('click', '.confirm', function () {
var zoom = map.getZoom();
var data = {lat: lat, lng: lng, zoom: zoom, address: address};
close(data);
});
init();
});
</script>
</body>
</html>
\ No newline at end of file
... ...
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>地址选择器</title>
<link rel="stylesheet" href="__CDN__/assets/css/bootstrap.min.css"/>
<link rel="stylesheet" href="__CDN__/assets/css/fastadmin.min.css"/>
<link rel="stylesheet" href="__CDN__/assets/libs/font-awesome/css/font-awesome.min.css"/>
<style type="text/css">
body {
margin: 0;
padding: 0;
}
#container {
position: absolute;
left: 0;
top: 0;
right: 0;
bottom: 0;
}
.confirm {
position: absolute;
bottom: 30px;
right: 4%;
z-index: 99;
height: 50px;
width: 50px;
line-height: 50px;
font-size: 15px;
text-align: center;
background-color: white;
background: #1ABC9C;
color: white;
border: none;
cursor: pointer;
border-radius: 50%;
}
.search {
position: absolute;
width: 400px;
top: 0;
left: 50%;
padding: 5px;
margin-left: -200px;
}
label.BMapLabel {
max-width: inherit;
padding: .75rem 1.25rem;
margin-bottom: 1rem;
background-color: white;
width: auto;
min-width: 22rem;
border: none;
box-shadow: 0 2px 6px 0 rgba(114, 124, 245, .5);
}
</style>
</head>
<body>
<div class="search">
<div class="input-group">
<input type="text" id="place" name="q" class="form-control" placeholder="输入地点"/>
<div id="searchResultPanel" style="border:1px solid #C0C0C0;width:150px;height:auto; display:none;"></div>
<span class="input-group-btn">
<button type="button" name="search" id="address" class="btn btn-success">
<i class="fa fa-search"></i>
</button>
</span>
</div>
</div>
<div class="confirm">确定</div>
<div id="container"></div>
<script type="text/javascript" src="//api.map.baidu.com/api?v=2.0&ak={$config.baidukey|default=''}"></script>
<script src="__CDN__/assets/libs/jquery/dist/jquery.min.js"></script>
<script type="text/javascript">
$(function () {
// 百度地图API功能
function G(id) {
return document.getElementById(id);
}
var map, marker, searchService, address = null, lng, lat;
var init = function () {
map = new BMap.Map("container"); // 创建地图实例
var point = new BMap.Point({$lng}, {$lat}); // 创建点坐标
map.enableScrollWheelZoom(true); //开启鼠标滚轮缩放
map.centerAndZoom(point, parseInt("{$config.zoom}")); // 初始化地图,设置中心点坐标和地图级别
var size = new BMap.Size(10, 20);
map.addControl(new BMap.CityListControl({
anchor: BMAP_ANCHOR_TOP_LEFT,
offset: size,
}));
var geoc = new BMap.Geocoder();
var addpoint = function (point) {
//通过点击百度地图,可以获取到对应的point, 由point的lng、lat属性就可以获取对应的经度纬度
var pt = point;
geoc.getLocation(pt, function (rs) {
//对象可以获取到详细的地址信息
address = rs.address;
deletePoint();
var mk = new BMap.Marker(pt);
map.addOverlay(mk);
map.panTo(pt);
var label = new BMap.Label('<div class="info">地址:' + address + '<br>经度:' + pt.lng + '<br>纬度:' + pt.lat + '</div>', {offset: new BMap.Size(16, 20)});
label.setStyle({
border: 'none',
padding: '.75rem 1.25rem'
});
mk.setLabel(label);
//将对应的HTML元素设置值
lng = pt.lng;
lat = pt.lat;
});
};
if ("{$lng}" != '' && "{$lat}" != '') {
addpoint(point);
}
ac = new BMap.Autocomplete({"input": "place", "location": map}); //建立一个自动完成的对象
ac.addEventListener("onhighlight", function (e) { //鼠标放在下拉列表上的事件
var str = "";
var _value = e.fromitem.value;
var value = "";
if (e.fromitem.index > -1) {
value = _value.province + _value.city + _value.district + _value.street + _value.business;
}
str = "FromItem<br />index = " + e.fromitem.index + "<br />value = " + value;
value = "";
if (e.toitem.index > -1) {
_value = e.toitem.value;
value = _value.province + _value.city + _value.district + _value.street + _value.business;
}
str += "<br />ToItem<br />index = " + e.toitem.index + "<br />value = " + value;
G("searchResultPanel").innerHTML = str;
});
ac.addEventListener("onconfirm", function (e) { //鼠标点击下拉列表后的事件
var _value = e.item.value;
myValue = _value.province + _value.city + _value.district + _value.street + _value.business;
G("searchResultPanel").innerHTML = "onconfirm<br />index = " + e.item.index + "<br />myValue = " + myValue;
setPlace();
});
function setPlace() {
map.clearOverlays(); //清除地图上所有覆盖物
function myFun() {
var result = local.getResults().getPoi(0);
var pp = result.point; //获取第一个智能搜索的结果
map.centerAndZoom(pp, 18);
map.addOverlay(new BMap.Marker(pp)); //添加标注
lng = pp.lng;
lat = pp.lat;
address = result.address;
}
var local = new BMap.LocalSearch(map, { //智能搜索
onSearchComplete: myFun
});
local.search(myValue);
}
map.addEventListener("click", function (e) {
//通过点击百度地图,可以获取到对应的point, 由point的lng、lat属性就可以获取对应的经度纬度
var pt = e.point;
addpoint(e.point);
});
/**
* 清除覆盖物
*/
function deletePoint() {
var allOverlay = map.getOverlays();
for (var i = 0; i < allOverlay.length; i++) {
map.removeOverlay(allOverlay[i]);
}
}
};
var close = function (data) {
var index = parent.Layer.getFrameIndex(window.name);
var callback = parent.$("#layui-layer" + index).data("callback");
//再执行关闭
parent.Layer.close(index);
//再调用回传函数
if (typeof callback === 'function') {
callback.call(undefined, data);
}
};
//点击确定后执行回调赋值
$(document).on('click', '.confirm', function () {
var zoom = map.getZoom();
var data = {lat: lat, lng: lng, zoom: zoom, address: address};
close(data);
});
init();
});
</script>
</body>
</html>
\ No newline at end of file
... ...
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/>
<title>地图位置(经纬度)选择插件 - FastAdmin</title>
<!-- Bootstrap Core CSS -->
<link href="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/css/bootstrap.min.css" rel="stylesheet">
<!-- Custom CSS -->
<link href="https://cdn.demo.fastadmin.net/assets/css/frontend.css" rel="stylesheet">
<!-- Plugin CSS -->
<link href="https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/css/font-awesome.min.css" rel="stylesheet">
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="https://cdn.jsdelivr.net/npm/html5shiv@3.7.3/dist/html5shiv.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/respond.js@1.4.2/dest/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="container">
<div class="bs-docs-section clearfix">
<div class="row">
<div class="col-lg-12">
<div class="page-header">
<h2 id="navbar">地图位置(经纬度)选择示例</h2>
</div>
<div class="bs-component">
<form action="" method="post" role="form">
<div class="form-group">
<label for=""></label>
<input type="text" class="form-control" name="" id="address" placeholder="地址">
</div>
<div class="form-group">
<label for=""></label>
<input type="text" class="form-control" name="" id="lng" placeholder="经度">
</div>
<div class="form-group">
<label for=""></label>
<input type="text" class="form-control" name="" id="lat" placeholder="纬度">
</div>
<button type="button" class="btn btn-primary" data-toggle='addresspicker' data-input-id="address" data-lng-id="lng" data-lat-id="lat">点击选择地址获取经纬度</button>
</form>
</div>
<div class="page-header">
<h2 id="code">调用代码</h2>
</div>
<div class="bs-component">
<textarea class="form-control" rows="17">
<form action="" method="post" role="form">
<div class="form-group">
<label for=""></label>
<input type="text" class="form-control" name="" id="address" placeholder="地址">
</div>
<div class="form-group">
<label for=""></label>
<input type="text" class="form-control" name="" id="lng" placeholder="经度">
</div>
<div class="form-group">
<label for=""></label>
<input type="text" class="form-control" name="" id="lat" placeholder="纬度">
</div>
<button type="button" class="btn btn-primary" data-toggle='addresspicker' data-input-id="address" data-lng-id="lng" data-lat-id="lat">点击选择地址获取经纬度</button>
</form>
</textarea>
</div>
<div class="page-header">
<h2 id="navbar">参数说明</h2>
</div>
<div class="bs-component">
<table class="table table-condensed table-hover">
<thead>
<tr>
<th>参数</th>
<th>释义</th>
</tr>
</thead>
<tbody>
<tr>
<td>data-input-id</td>
<td>填充地址的文本框ID</td>
</tr>
<tr>
<td>data-lng-id</td>
<td>填充经度的文本框ID</td>
</tr>
<tr>
<td>data-lat-id</td>
<td>填充纬度的文本框ID</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<script type="text/javascript">
var require = {
config: {$config | json_encode
}
}
;
</script>
<script>
require.callback = function () {
define('addons/address', ['jquery', 'bootstrap', 'frontend', 'template'], function ($, undefined, Frontend, Template) {
var Controller = {
index: function () {
;
}
};
return Controller;
});
define('lang', function () {
return [];
});
}
</script>
<script src="__CDN__/assets/js/require.min.js" data-main="__CDN__/assets/js/require-frontend.min.js?v={$site.version}"></script>
</body>
</html>
\ No newline at end of file
... ...
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>地址选择器</title>
<link rel="stylesheet" href="__CDN__/assets/css/bootstrap.min.css"/>
<link rel="stylesheet" href="__CDN__/assets/css/fastadmin.min.css"/>
<link rel="stylesheet" href="__CDN__/assets/libs/font-awesome/css/font-awesome.min.css"/>
<style type="text/css">
body {
margin: 0;
padding: 0;
}
#container {
position: absolute;
left: 0;
top: 0;
right: 0;
bottom: 0;
}
.confirm {
position: absolute;
bottom: 30px;
right: 4%;
z-index: 99;
height: 50px;
width: 50px;
line-height: 50px;
font-size: 15px;
text-align: center;
background-color: white;
background: #1ABC9C;
color: white;
border: none;
cursor: pointer;
border-radius: 50%;
}
.search {
position: absolute;
width: 400px;
top: 0;
left: 50%;
padding: 5px;
margin-left: -200px;
}
</style>
</head>
<body>
<div class="search">
<div class="input-group">
<input type="text" id="place" name="q" class="form-control" placeholder="输入地点"/>
<span class="input-group-btn">
<button type="submit" name="search" id="search-btn" class="btn btn-success">
<i class="fa fa-search"></i>
</button>
</span>
</div>
</div>
<div class="confirm">确定</div>
<div id="container"></div>
<script charset="utf-8" src="//map.qq.com/api/js?v=2.exp&libraries=place&key={$config.tencentkey|default=''}"></script>
<script src="__CDN__/assets/libs/jquery/dist/jquery.min.js"></script>
<script type="text/javascript">
$(function () {
var map, marker, geocoder, infoWin, searchService, address = null;
var init = function () {
var center = new qq.maps.LatLng({$lat}, {$lng});
map = new qq.maps.Map(document.getElementById('container'), {
center: center,
zoom: parseInt("{$config.zoom}")
});
//初始化marker
initmarker(center);
//实例化信息窗口
infoWin = new qq.maps.InfoWindow({
map: map
});
geocoder = new qq.maps.Geocoder({
complete: function (result) {
infoWin.open();
address = result.detail.addressComponents.province +
result.detail.addressComponents.city +
result.detail.addressComponents.district;
if (result.detail.addressComponents.streetNumber == '') {
address += result.detail.addressComponents.street;
} else {
address += result.detail.addressComponents.streetNumber;
}
infoWin.setContent(address);
infoWin.setPosition(result.detail.location);
}
});
//显示当前marker的位置信息窗口
geocoder.getAddress(center);
var latlngBounds = new qq.maps.LatLngBounds();
//查询poi类信息
searchService = new qq.maps.SearchService({
complete: function (results) {
var pois = results.detail.pois;
for (var i = 0, l = pois.length; i < l; i++) {
var poi = pois[i];
latlngBounds.extend(poi.latLng);
initmarker(poi.latLng);
//显示当前marker的位置信息窗口
geocoder.getAddress(poi.latLng);
}
map.fitBounds(latlngBounds);
}
});
//实例化自动完成
var ap = new qq.maps.place.Autocomplete(document.getElementById('place'));
//添加监听事件
qq.maps.event.addListener(ap, "confirm", function (res) {
searchKeyword();
});
qq.maps.event.addListener(
map,
'click',
function (event) {
try {
infoWin.setContent('<div style="text-align:center;white-space:nowrap;margin:10px;">加载中</div>');
var latLng = event.latLng,
lat = latLng.getLat().toFixed(5),
lng = latLng.getLng().toFixed(5);
var location = new qq.maps.LatLng(lat, lng);
//调用获取位置方法
geocoder.getAddress(location);
infoWin.setPosition(location);
marker.setPosition(location);
} catch (e) {
console.log(e);
}
}
);
};
//实例化marker和监听拖拽结束事件
var initmarker = function (latLng) {
marker = new qq.maps.Marker({
map: map,
position: latLng,
draggable: true,
title: '拖动图标选择位置'
});
//监听拖拽结束
qq.maps.event.addListener(marker, 'dragend', function (event) {
var latLng = event.latLng,
lat = latLng.getLat().toFixed(5),
lng = latLng.getLng().toFixed(5);
var location = new qq.maps.LatLng(lat, lng);
//调用获取位置方法
geocoder.getAddress(location);
});
};
var close = function (data) {
var index = parent.Layer.getFrameIndex(window.name);
var callback = parent.$("#layui-layer" + index).data("callback");
//再执行关闭
parent.Layer.close(index);
//再调用回传函数
if (typeof callback === 'function') {
callback.call(undefined, data);
}
};
//执行搜索方法
var searchKeyword = function () {
searchService.clear();//先清除
marker.setMap(null);
infoWin.close();
var keyword = $("#place").val();
searchService.setLocation("{$location}");//设置默认检索范围(默认为全国),类型可以是坐标或指定的城市名称。
searchService.setPageIndex(0);//设置检索的特定页数。
searchService.setPageCapacity(1);//设置每页返回的结果数量。
searchService.search(keyword);//开始查询
};
//点击确定后执行回调赋值
$(document).on('click', '.confirm', function () {
var as = marker.getPosition();
var x = as.getLat().toFixed(5);
var y = as.getLng().toFixed(5);
var zoom = map.getZoom();
var data = {lat: x, lng: y, zoom: zoom, address: address};
close(data);
});
//点击搜索按钮
$(document).on('click', '#search-btn', function () {
if ($("#place").val() == '')
return;
searchKeyword();
});
init();
});
</script>
</body>
</html>
\ No newline at end of file
... ...
<?php
namespace app\admin\controller;
use app\common\controller\Backend;
/**
* 协议
*
* @icon fa fa-circle-o
*/
class Agreement extends Backend
{
/**
* Agreement模型对象
* @var \app\admin\model\Agreement
*/
protected $model = null;
public function _initialize()
{
parent::_initialize();
$this->model = new \app\admin\model\Agreement;
$this->view->assign("statusList", $this->model->getStatusList());
$this->view->assign("refindStatusList", $this->model->getRefindStatusList());
}
public function import()
{
parent::import();
}
/**
* 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个基础方法、destroy/restore/recyclebin三个回收站方法
* 因此在当前控制器中可不用编写增删改查的代码,除非需要自己控制这部分逻辑
* 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改
*/
/**
* 查看
*/
public function index()
{
//当前是否为关联查询
$this->relationSearch = true;
//设置过滤方法
$this->request->filter(['strip_tags', 'trim']);
if ($this->request->isAjax()) {
//如果发送的来源是Selectpage,则转发到Selectpage
if ($this->request->request('keyField')) {
return $this->selectpage();
}
list($where, $sort, $order, $offset, $limit) = $this->buildparams();
$list = $this->model
->with(['user','seller','batterycode'])
->where($where)
->order($sort, $order)
->paginate($limit);
foreach ($list as $row) {
$row->getRelation('user')->visible(['nickname','avatar']);
$row->getRelation('seller')->visible(['CompanyName']);
$row->getRelation('batterycode')->visible(['title']);
}
$result = array("total" => $list->total(), "rows" => $list->items());
return json($result);
}
return $this->view->fetch();
}
}
... ...
<?php
namespace app\admin\controller;
use app\common\controller\Backend;
/**
* 订单管理
*
* @icon fa fa-circle-o
*/
class Order extends Backend
{
/**
* Order模型对象
* @var \app\admin\model\Order
*/
protected $model = null;
public function _initialize()
{
parent::_initialize();
$this->model = new \app\admin\model\Order;
$this->view->assign("statusList", $this->model->getStatusList());
}
public function import()
{
parent::import();
}
/**
* 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个基础方法、destroy/restore/recyclebin三个回收站方法
* 因此在当前控制器中可不用编写增删改查的代码,除非需要自己控制这部分逻辑
* 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改
*/
/**
* 查看
*/
public function index()
{
//当前是否为关联查询
$this->relationSearch = true;
//设置过滤方法
$this->request->filter(['strip_tags', 'trim']);
if ($this->request->isAjax()) {
//如果发送的来源是Selectpage,则转发到Selectpage
if ($this->request->request('keyField')) {
return $this->selectpage();
}
list($where, $sort, $order, $offset, $limit) = $this->buildparams();
$list = $this->model
->with(['stor','user','batterycode'])
->where($where)
->order($sort, $order)
->paginate($limit);
foreach ($list as $row) {
$row->getRelation('stor')->visible(['name']);
$row->getRelation('user')->visible(['nickname','avatar']);
$row->getRelation('batterycode')->visible(['title']);
}
$result = array("total" => $list->total(), "rows" => $list->items());
return json($result);
}
return $this->view->fetch();
}
}
... ...
<?php
namespace app\admin\controller;
use app\common\controller\Backend;
/**
* 交易流水记录
*
* @icon fa fa-circle-o
*/
class PayOrder extends Backend
{
/**
* PayOrder模型对象
* @var \app\admin\model\PayOrder
*/
protected $model = null;
public function _initialize()
{
parent::_initialize();
$this->model = new \app\admin\model\PayOrder;
$this->view->assign("typeList", $this->model->getTypeList());
$this->view->assign("statusList", $this->model->getStatusList());
}
public function import()
{
parent::import();
}
/**
* 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个基础方法、destroy/restore/recyclebin三个回收站方法
* 因此在当前控制器中可不用编写增删改查的代码,除非需要自己控制这部分逻辑
* 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改
*/
/**
* 查看
*/
public function index()
{
//当前是否为关联查询
$this->relationSearch = true;
//设置过滤方法
$this->request->filter(['strip_tags', 'trim']);
if ($this->request->isAjax()) {
//如果发送的来源是Selectpage,则转发到Selectpage
if ($this->request->request('keyField')) {
return $this->selectpage();
}
list($where, $sort, $order, $offset, $limit) = $this->buildparams();
$list = $this->model
->with(['user'])
->where($where)
->order($sort, $order)
->paginate($limit);
foreach ($list as $row) {
$row->getRelation('user')->visible(['nickname','avatar']);
}
$result = array("total" => $list->total(), "rows" => $list->items());
return json($result);
}
return $this->view->fetch();
}
}
... ...
<?php
namespace app\admin\controller;
use app\common\controller\Backend;
/**
* 退款记录
*
* @icon fa fa-circle-o
*/
class Tuikuan extends Backend
{
/**
* Tuikuan模型对象
* @var \app\admin\model\Tuikuan
*/
protected $model = null;
public function _initialize()
{
parent::_initialize();
$this->model = new \app\admin\model\Tuikuan;
$this->view->assign("statusList", $this->model->getStatusList());
}
public function import()
{
parent::import();
}
/**
* 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个基础方法、destroy/restore/recyclebin三个回收站方法
* 因此在当前控制器中可不用编写增删改查的代码,除非需要自己控制这部分逻辑
* 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改
*/
/**
* 查看
*/
public function index()
{
//当前是否为关联查询
$this->relationSearch = true;
//设置过滤方法
$this->request->filter(['strip_tags', 'trim']);
if ($this->request->isAjax()) {
//如果发送的来源是Selectpage,则转发到Selectpage
if ($this->request->request('keyField')) {
return $this->selectpage();
}
list($where, $sort, $order, $offset, $limit) = $this->buildparams();
$list = $this->model
->with(['user','seller'])
->where($where)
->order($sort, $order)
->paginate($limit);
foreach ($list as $row) {
$row->getRelation('user')->visible(['nickname','avatar']);
$row->getRelation('seller')->visible(['CompanyName']);
}
$result = array("total" => $list->total(), "rows" => $list->items());
return json($result);
}
return $this->view->fetch();
}
}
... ...
<?php
return [
'Id' => 'ID',
'Ordersn' => '协议单号',
'Mobile' => '联系电话',
'User_id' => '用户ID',
'Name' => '姓名',
'Seller_id' => '服务商',
'Battery_id' => '电池类型',
'Upmoney' => '押金',
'Monthmoney' => '月租金',
'Money' => '剩余租金',
'Card_image' => '身份证照',
'Status' => '协议审核状态',
'Status 0' => '待审核',
'Status 1' => '协议中',
'Status 2' => '已终止',
'Status 3' => '已欠费',
'Status 4' => '签约失败',
'Refind_status' => '退款审核状态',
'Refind_status 0' => '待审核',
'Refind_status 1' => '已通过',
'Refind_status 2' => '已拒绝',
'Refind_status 3' => '未发起退款',
'Createtime' => '创建时间',
'Updatetime' => '更改时间',
'Exp_time' => '协议到期时间',
'User.nickname' => '昵称',
'User.avatar' => '头像',
'Seller.companyname' => '公司或商号名称',
'Batterycode.title' => '电池类型名称'
];
... ...
<?php
return [
'Id' => 'ID',
'Ordersn' => '订单号',
'Stor_id' => '门店ID',
'User_id' => '用户ID',
'Battery_id' => '电池类型',
'Battery_code' => '电池编号',
'Manufactor' => '厂家',
'Voltage' => '电压',
'Status' => '订单状态',
'Status 0' => '待换电',
'Status 1' => '已换电',
'Status 2' => '已过期',
'Status 3' => '异常订单',
'Exp_time' => '订单过期时间',
'Createtime' => '创建时间',
'Yes_time' => '商家确认时间',
'Updatetime' => '更改时间',
'Ok_time' => '订单完成时间',
'Stor.name' => '店铺名称',
'User.nickname' => '昵称',
'User.avatar' => '头像',
'Batterycode.title' => '电池类型名称'
];
... ...
<?php
return [
'Payorder' => '支付单号',
'Ordersn' => '订单号',
'Type' => '类型',
'Type 0' => '已退款',
'Type 1' => '支付',
'Status' => '支付状态',
'Status 0' => '进行中',
'Status 1' => '已支付',
'User_id' => '用户',
'Money' => '支付/退款 金额',
'Wechatorder' => '微信订单号',
'Createtime' => '支付生成时间',
'Updatetime' => '订单支付时间',
'User.nickname' => '昵称',
'User.avatar' => '头像'
];
... ...
<?php
return [
'Id' => 'ID',
'User_id' => '用户',
'Ordersn' => '协议单号',
'Status' => '退款审核状态',
'Status 0' => '待审核',
'Status 1' => '已通过',
'Status 2' => '已拒绝',
'Seller_id' => '服务商',
'Createtime' => '创建时间',
'Updatetime' => '更改时间',
'User.nickname' => '昵称',
'User.avatar' => '头像',
'Seller.companyname' => '公司或商号名称'
];
... ...
<?php
namespace app\admin\model;
use think\Model;
class Agreement extends Model
{
// 表名
protected $name = 'agreement';
// 自动写入时间戳字段
protected $autoWriteTimestamp = 'int';
// 定义时间戳字段名
protected $createTime = 'createtime';
protected $updateTime = 'updatetime';
protected $deleteTime = false;
// 追加属性
protected $append = [
'status_text',
'refind_status_text',
'EXP_time_text'
];
public function getStatusList()
{
return ['0' => __('Status 0'), '1' => __('Status 1'), '2' => __('Status 2'), '3' => __('Status 3'), '4' => __('Status 4')];
}
public function getRefindStatusList()
{
return ['0' => __('Refind_status 0'), '1' => __('Refind_status 1'), '2' => __('Refind_status 2'), '3' => __('Refind_status 3')];
}
public function getStatusTextAttr($value, $data)
{
$value = $value ? $value : (isset($data['status']) ? $data['status'] : '');
$list = $this->getStatusList();
return isset($list[$value]) ? $list[$value] : '';
}
public function getRefindStatusTextAttr($value, $data)
{
$value = $value ? $value : (isset($data['refind_status']) ? $data['refind_status'] : '');
$list = $this->getRefindStatusList();
return isset($list[$value]) ? $list[$value] : '';
}
public function getExpTimeTextAttr($value, $data)
{
$value = $value ? $value : (isset($data['EXP_time']) ? $data['EXP_time'] : '');
return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
}
protected function setExpTimeAttr($value)
{
return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
}
public function user()
{
return $this->belongsTo('User', 'user_id', 'id', [], 'LEFT')->setEagerlyType(0);
}
public function seller()
{
return $this->belongsTo('Seller', 'seller_id', 'id', [], 'LEFT')->setEagerlyType(0);
}
public function batterycode()
{
return $this->belongsTo('BatteryCode', 'battery_id', 'id', [], 'LEFT')->setEagerlyType(0);
}
}
... ...
<?php
namespace app\admin\model;
use think\Model;
class Order extends Model
{
// 表名
protected $name = 'order';
// 自动写入时间戳字段
protected $autoWriteTimestamp = 'int';
// 定义时间戳字段名
protected $createTime = 'createtime';
protected $updateTime = 'updatetime';
protected $deleteTime = false;
// 追加属性
protected $append = [
'status_text',
'EXP_time_text',
'yes_time_text',
'ok_time_text'
];
public function getStatusList()
{
return ['0' => __('Status 0'), '1' => __('Status 1'), '2' => __('Status 2'), '3' => __('Status 3')];
}
public function getStatusTextAttr($value, $data)
{
$value = $value ? $value : (isset($data['status']) ? $data['status'] : '');
$list = $this->getStatusList();
return isset($list[$value]) ? $list[$value] : '';
}
public function getExpTimeTextAttr($value, $data)
{
$value = $value ? $value : (isset($data['EXP_time']) ? $data['EXP_time'] : '');
return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
}
public function getYesTimeTextAttr($value, $data)
{
$value = $value ? $value : (isset($data['yes_time']) ? $data['yes_time'] : '');
return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
}
public function getOkTimeTextAttr($value, $data)
{
$value = $value ? $value : (isset($data['ok_time']) ? $data['ok_time'] : '');
return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
}
protected function setExpTimeAttr($value)
{
return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
}
protected function setYesTimeAttr($value)
{
return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
}
protected function setOkTimeAttr($value)
{
return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
}
public function stor()
{
return $this->belongsTo('Stor', 'stor_id', 'id', [], 'LEFT')->setEagerlyType(0);
}
public function user()
{
return $this->belongsTo('User', 'user_id', 'id', [], 'LEFT')->setEagerlyType(0);
}
public function batterycode()
{
return $this->belongsTo('BatteryCode', 'battery_id', 'id', [], 'LEFT')->setEagerlyType(0);
}
}
... ...
<?php
namespace app\admin\model;
use think\Model;
class PayOrder extends Model
{
// 表名
protected $name = 'pay_order';
// 自动写入时间戳字段
protected $autoWriteTimestamp = 'int';
// 定义时间戳字段名
protected $createTime = 'createtime';
protected $updateTime = 'updatetime';
protected $deleteTime = false;
// 追加属性
protected $append = [
'type_text',
'status_text'
];
public function getTypeList()
{
return ['0' => __('Type 0'), '1' => __('Type 1')];
}
public function getStatusList()
{
return ['0' => __('Status 0'), '1' => __('Status 1')];
}
public function getTypeTextAttr($value, $data)
{
$value = $value ? $value : (isset($data['type']) ? $data['type'] : '');
$list = $this->getTypeList();
return isset($list[$value]) ? $list[$value] : '';
}
public function getStatusTextAttr($value, $data)
{
$value = $value ? $value : (isset($data['status']) ? $data['status'] : '');
$list = $this->getStatusList();
return isset($list[$value]) ? $list[$value] : '';
}
public function user()
{
return $this->belongsTo('User', 'user_id', 'id', [], 'LEFT')->setEagerlyType(0);
}
}
... ...
<?php
namespace app\admin\model;
use think\Model;
class Tuikuan extends Model
{
// 表名
protected $name = 'tuikuan';
// 自动写入时间戳字段
protected $autoWriteTimestamp = 'int';
// 定义时间戳字段名
protected $createTime = 'createtime';
protected $updateTime = 'updatetime';
protected $deleteTime = false;
// 追加属性
protected $append = [
'status_text'
];
public function getStatusList()
{
return ['0' => __('Status 0'), '1' => __('Status 1'), '2' => __('Status 2')];
}
public function getStatusTextAttr($value, $data)
{
$value = $value ? $value : (isset($data['status']) ? $data['status'] : '');
$list = $this->getStatusList();
return isset($list[$value]) ? $list[$value] : '';
}
public function user()
{
return $this->belongsTo('User', 'user_id', 'id', [], 'LEFT')->setEagerlyType(0);
}
public function seller()
{
return $this->belongsTo('Seller', 'seller_id', 'id', [], 'LEFT')->setEagerlyType(0);
}
}
... ...
<?php
namespace app\admin\validate;
use think\Validate;
class Agreement extends Validate
{
/**
* 验证规则
*/
protected $rule = [
];
/**
* 提示消息
*/
protected $message = [
];
/**
* 验证场景
*/
protected $scene = [
'add' => [],
'edit' => [],
];
}
... ...
<?php
namespace app\admin\validate;
use think\Validate;
class Order extends Validate
{
/**
* 验证规则
*/
protected $rule = [
];
/**
* 提示消息
*/
protected $message = [
];
/**
* 验证场景
*/
protected $scene = [
'add' => [],
'edit' => [],
];
}
... ...
<?php
namespace app\admin\validate;
use think\Validate;
class PayOrder extends Validate
{
/**
* 验证规则
*/
protected $rule = [
];
/**
* 提示消息
*/
protected $message = [
];
/**
* 验证场景
*/
protected $scene = [
'add' => [],
'edit' => [],
];
}
... ...
<?php
namespace app\admin\validate;
use think\Validate;
class Tuikuan extends Validate
{
/**
* 验证规则
*/
protected $rule = [
];
/**
* 提示消息
*/
protected $message = [
];
/**
* 验证场景
*/
protected $scene = [
'add' => [],
'edit' => [],
];
}
... ...
<form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Ordersn')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-OrderSn" data-rule="required" class="form-control" name="row[OrderSn]" type="text">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Mobile')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-mobile" data-rule="required" class="form-control" name="row[mobile]" type="text">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('User_id')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-user_id" data-rule="required" data-source="user/user/index" data-field="nickname" class="form-control selectpage" name="row[user_id]" type="text" value="">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Name')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-name" data-rule="required" class="form-control" name="row[name]" type="text">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Seller_id')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-seller_id" data-rule="required" data-source="seller/index" class="form-control selectpage" name="row[seller_id]" type="text" value="">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Battery_id')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-battery_id" data-rule="required" data-source="battery/index" class="form-control selectpage" name="row[battery_id]" type="text" value="">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Upmoney')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-UpMoney" data-rule="required" class="form-control" step="0.01" name="row[UpMoney]" type="number">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Monthmoney')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-MonthMoney" data-rule="required" class="form-control" step="0.01" name="row[MonthMoney]" type="number">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Money')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-Money" data-rule="required" class="form-control" step="0.01" name="row[Money]" type="number">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Card_image')}:</label>
<div class="col-xs-12 col-sm-8">
<div class="input-group">
<input id="c-card_image" data-rule="required" class="form-control" size="50" name="row[card_image]" type="text">
<div class="input-group-addon no-border no-padding">
<span><button type="button" id="faupload-card_image" class="btn btn-danger faupload" data-input-id="c-card_image" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp" data-multiple="false" data-preview-id="p-card_image"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
<span><button type="button" id="fachoose-card_image" class="btn btn-primary fachoose" data-input-id="c-card_image" data-mimetype="image/*" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
</div>
<span class="msg-box n-right" for="c-card_image"></span>
</div>
<ul class="row list-inline faupload-preview" id="p-card_image"></ul>
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>
<div class="col-xs-12 col-sm-8">
<div class="radio">
{foreach name="statusList" item="vo"}
<label for="row[status]-{$key}"><input id="row[status]-{$key}" name="row[status]" type="radio" value="{$key}" {in name="key" value="0"}checked{/in} /> {$vo}</label>
{/foreach}
</div>
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Refind_status')}:</label>
<div class="col-xs-12 col-sm-8">
<div class="radio">
{foreach name="refindStatusList" item="vo"}
<label for="row[refind_status]-{$key}"><input id="row[refind_status]-{$key}" name="row[refind_status]" type="radio" value="{$key}" {in name="key" value="0"}checked{/in} /> {$vo}</label>
{/foreach}
</div>
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Exp_time')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-EXP_time" data-rule="required" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[EXP_time]" type="text" value="{:date('Y-m-d H:i:s')}">
</div>
</div>
<div class="form-group layer-footer">
<label class="control-label col-xs-12 col-sm-2"></label>
<div class="col-xs-12 col-sm-8">
<button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
<button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
</div>
</div>
</form>
... ...
<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Ordersn')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-OrderSn" data-rule="required" class="form-control" name="row[OrderSn]" type="text" value="{$row.OrderSn|htmlentities}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Mobile')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-mobile" data-rule="required" class="form-control" name="row[mobile]" type="text" value="{$row.mobile|htmlentities}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('User_id')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-user_id" data-rule="required" data-source="user/index" data-field="nickname" class="form-control selectpage" name="row[user_id]" type="text" value="{$row.user_id|htmlentities}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Name')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-name" data-rule="required" class="form-control" name="row[name]" type="text" value="{$row.name|htmlentities}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Seller_id')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-seller_id" data-rule="required" data-source="seller/index" data-field="CompanyName" class="form-control selectpage" name="row[seller_id]" type="text" value="{$row.seller_id|htmlentities}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Battery_id')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-battery_id" data-rule="required" data-source="battery_code/index" data-field="title" class="form-control selectpage" name="row[battery_id]" type="text" value="{$row.battery_id|htmlentities}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Upmoney')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-UpMoney" data-rule="required" class="form-control" step="0.01" name="row[UpMoney]" type="number" value="{$row.UpMoney|htmlentities}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Monthmoney')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-MonthMoney" data-rule="required" class="form-control" step="0.01" name="row[MonthMoney]" type="number" value="{$row.MonthMoney|htmlentities}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Money')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-Money" data-rule="required" class="form-control" step="0.01" name="row[Money]" type="number" value="{$row.Money|htmlentities}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Card_image')}:</label>
<div class="col-xs-12 col-sm-8">
<div class="input-group">
<input id="c-card_image" data-rule="required" class="form-control" size="50" name="row[card_image]" type="text" value="{$row.card_image|htmlentities}">
<div class="input-group-addon no-border no-padding">
<span><button type="button" id="faupload-card_image" class="btn btn-danger faupload" data-input-id="c-card_image" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp" data-multiple="false" data-preview-id="p-card_image"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
<span><button type="button" id="fachoose-card_image" class="btn btn-primary fachoose" data-input-id="c-card_image" data-mimetype="image/*" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
</div>
<span class="msg-box n-right" for="c-card_image"></span>
</div>
<ul class="row list-inline faupload-preview" id="p-card_image"></ul>
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>
<div class="col-xs-12 col-sm-8">
<div class="radio">
{foreach name="statusList" item="vo"}
<label for="row[status]-{$key}"><input id="row[status]-{$key}" name="row[status]" type="radio" value="{$key}" {in name="key" value="$row.status"}checked{/in} /> {$vo}</label>
{/foreach}
</div>
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Refind_status')}:</label>
<div class="col-xs-12 col-sm-8">
<div class="radio">
{foreach name="refindStatusList" item="vo"}
<label for="row[refind_status]-{$key}"><input id="row[refind_status]-{$key}" name="row[refind_status]" type="radio" value="{$key}" {in name="key" value="$row.refind_status"}checked{/in} /> {$vo}</label>
{/foreach}
</div>
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Exp_time')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-EXP_time" data-rule="required" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[EXP_time]" type="text" value="{:$row.EXP_time?datetime($row.EXP_time):''}">
</div>
</div>
<div class="form-group layer-footer">
<label class="control-label col-xs-12 col-sm-2"></label>
<div class="col-xs-12 col-sm-8">
<button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
<button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
</div>
</div>
</form>
... ...
<div class="panel panel-default panel-intro">
<div class="panel-heading">
{:build_heading(null,FALSE)}
<ul class="nav nav-tabs" data-field="status">
<li class="{:$Think.get.status === null ? 'active' : ''}"><a href="#t-all" data-value="" data-toggle="tab">{:__('All')}</a></li>
{foreach name="statusList" item="vo"}
<li class="{:$Think.get.status === (string)$key ? 'active' : ''}"><a href="#t-{$key}" data-value="{$key}" data-toggle="tab">{$vo}</a></li>
{/foreach}
</ul>
</div>
<div class="panel-body">
<div id="myTabContent" class="tab-content">
<div class="tab-pane fade active in" id="one">
<div class="widget-body no-padding">
<div id="toolbar" class="toolbar">
<a href="javascript:;" class="btn btn-primary btn-refresh" title="{:__('Refresh')}" ><i class="fa fa-refresh"></i> </a>
<!--<a href="javascript:;" class="btn btn-success btn-add {:$auth->check('agreement/add')?'':'hide'}" title="{:__('Add')}" ><i class="fa fa-plus"></i> {:__('Add')}</a>-->
<a href="javascript:;" class="btn btn-success btn-edit btn-disabled disabled {:$auth->check('agreement/edit')?'':'hide'}" title="{:__('Edit')}" ><i class="fa fa-pencil"></i> {:__('Edit')}</a>
<!--<a href="javascript:;" class="btn btn-danger btn-del btn-disabled disabled {:$auth->check('agreement/del')?'':'hide'}" title="{:__('Delete')}" ><i class="fa fa-trash"></i> {:__('Delete')}</a>-->
<!--<a href="javascript:;" class="btn btn-danger btn-import {:$auth->check('agreement/import')?'':'hide'}" title="{:__('Import')}" id="btn-import-file" data-url="ajax/upload" data-mimetype="csv,xls,xlsx" data-multiple="false"><i class="fa fa-upload"></i> {:__('Import')}</a>-->
<!---->
<!--<div class="dropdown btn-group {:$auth->check('agreement/multi')?'':'hide'}">-->
<!--<a class="btn btn-primary btn-more dropdown-toggle btn-disabled disabled" data-toggle="dropdown"><i class="fa fa-cog"></i> {:__('More')}</a>-->
<!--<ul class="dropdown-menu text-left" role="menu">-->
<!--<li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:;" data-params="status=normal"><i class="fa fa-eye"></i> {:__('Set to normal')}</a></li>-->
<!--<li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:;" data-params="status=hidden"><i class="fa fa-eye-slash"></i> {:__('Set to hidden')}</a></li>-->
<!--</ul>-->
<!--</div>-->
</div>
<table id="table" class="table table-striped table-bordered table-hover table-nowrap"
data-operate-edit="{:$auth->check('agreement/edit')}"
width="100%">
</table>
</div>
</div>
</div>
</div>
</div>
... ...
<form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Ordersn')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-OrderSn" data-rule="required" class="form-control" name="row[OrderSn]" type="text">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Stor_id')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-stor_id" data-rule="required" data-source="stor/index" class="form-control selectpage" name="row[stor_id]" type="text" value="">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('User_id')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-user_id" data-rule="required" data-source="user/user/index" data-field="nickname" class="form-control selectpage" name="row[user_id]" type="text" value="">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Battery_id')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-battery_id" data-rule="required" data-source="battery/index" class="form-control selectpage" name="row[battery_id]" type="text" value="">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Battery_code')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-battery_code" data-rule="required" class="form-control" name="row[battery_code]" type="text">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Manufactor')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-manufactor" data-rule="required" class="form-control" name="row[manufactor]" type="text">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Voltage')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-Voltage" data-rule="required" class="form-control" name="row[Voltage]" type="text">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>
<div class="col-xs-12 col-sm-8">
<div class="radio">
{foreach name="statusList" item="vo"}
<label for="row[status]-{$key}"><input id="row[status]-{$key}" name="row[status]" type="radio" value="{$key}" {in name="key" value="0"}checked{/in} /> {$vo}</label>
{/foreach}
</div>
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Exp_time')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-EXP_time" data-rule="required" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[EXP_time]" type="text" value="{:date('Y-m-d H:i:s')}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Yes_time')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-yes_time" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[yes_time]" type="text" value="{:date('Y-m-d H:i:s')}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Ok_time')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-ok_time" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[ok_time]" type="text" value="{:date('Y-m-d H:i:s')}">
</div>
</div>
<div class="form-group layer-footer">
<label class="control-label col-xs-12 col-sm-2"></label>
<div class="col-xs-12 col-sm-8">
<button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
<button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
</div>
</div>
</form>
... ...
<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Ordersn')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-OrderSn" data-rule="required" class="form-control" name="row[OrderSn]" type="text" value="{$row.OrderSn|htmlentities}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Stor_id')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-stor_id" data-rule="required" data-source="stor/index" data-field="name" class="form-control selectpage" name="row[stor_id]" type="text" value="{$row.stor_id|htmlentities}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('User_id')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-user_id" data-rule="required" data-source="user/index" data-field="nickname" class="form-control selectpage" name="row[user_id]" type="text" value="{$row.user_id|htmlentities}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Battery_id')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-battery_id" data-rule="required" data-source="battery_code/index" data-field="title" class="form-control selectpage" name="row[battery_id]" type="text" value="{$row.battery_id|htmlentities}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Battery_code')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-battery_code" data-rule="required" class="form-control" name="row[battery_code]" type="text" value="{$row.battery_code|htmlentities}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Manufactor')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-manufactor" data-rule="required" class="form-control" name="row[manufactor]" type="text" value="{$row.manufactor|htmlentities}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Voltage')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-Voltage" data-rule="required" class="form-control" name="row[Voltage]" type="text" value="{$row.Voltage|htmlentities}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>
<div class="col-xs-12 col-sm-8">
<div class="radio">
{foreach name="statusList" item="vo"}
<label for="row[status]-{$key}"><input id="row[status]-{$key}" name="row[status]" type="radio" value="{$key}" {in name="key" value="$row.status"}checked{/in} /> {$vo}</label>
{/foreach}
</div>
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Exp_time')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-EXP_time" data-rule="required" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[EXP_time]" type="text" value="{:$row.EXP_time?datetime($row.EXP_time):''}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Yes_time')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-yes_time" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[yes_time]" type="text" value="{:$row.yes_time?datetime($row.yes_time):''}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Ok_time')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-ok_time" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[ok_time]" type="text" value="{:$row.ok_time?datetime($row.ok_time):''}">
</div>
</div>
<div class="form-group layer-footer">
<label class="control-label col-xs-12 col-sm-2"></label>
<div class="col-xs-12 col-sm-8">
<button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
<button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
</div>
</div>
</form>
... ...
<div class="panel panel-default panel-intro">
<div class="panel-heading">
{:build_heading(null,FALSE)}
<ul class="nav nav-tabs" data-field="status">
<li class="{:$Think.get.status === null ? 'active' : ''}"><a href="#t-all" data-value="" data-toggle="tab">{:__('All')}</a></li>
{foreach name="statusList" item="vo"}
<li class="{:$Think.get.status === (string)$key ? 'active' : ''}"><a href="#t-{$key}" data-value="{$key}" data-toggle="tab">{$vo}</a></li>
{/foreach}
</ul>
</div>
<div class="panel-body">
<div id="myTabContent" class="tab-content">
<div class="tab-pane fade active in" id="one">
<div class="widget-body no-padding">
<div id="toolbar" class="toolbar">
<a href="javascript:;" class="btn btn-primary btn-refresh" title="{:__('Refresh')}" ><i class="fa fa-refresh"></i> </a>
<!--<a href="javascript:;" class="btn btn-success btn-add {:$auth->check('order/add')?'':'hide'}" title="{:__('Add')}" ><i class="fa fa-plus"></i> {:__('Add')}</a>-->
<a href="javascript:;" class="btn btn-success btn-edit btn-disabled disabled {:$auth->check('order/edit')?'':'hide'}" title="{:__('Edit')}" ><i class="fa fa-pencil"></i> {:__('Edit')}</a>
<!--<a href="javascript:;" class="btn btn-danger btn-del btn-disabled disabled {:$auth->check('order/del')?'':'hide'}" title="{:__('Delete')}" ><i class="fa fa-trash"></i> {:__('Delete')}</a>-->
<!--<a href="javascript:;" class="btn btn-danger btn-import {:$auth->check('order/import')?'':'hide'}" title="{:__('Import')}" id="btn-import-file" data-url="ajax/upload" data-mimetype="csv,xls,xlsx" data-multiple="false"><i class="fa fa-upload"></i> {:__('Import')}</a>-->
<!---->
<!--<div class="dropdown btn-group {:$auth->check('order/multi')?'':'hide'}">-->
<!--<a class="btn btn-primary btn-more dropdown-toggle btn-disabled disabled" data-toggle="dropdown"><i class="fa fa-cog"></i> {:__('More')}</a>-->
<!--<ul class="dropdown-menu text-left" role="menu">-->
<!--<li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:;" data-params="status=normal"><i class="fa fa-eye"></i> {:__('Set to normal')}</a></li>-->
<!--<li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:;" data-params="status=hidden"><i class="fa fa-eye-slash"></i> {:__('Set to hidden')}</a></li>-->
<!--</ul>-->
<!--</div>-->
</div>
<table id="table" class="table table-striped table-bordered table-hover table-nowrap"
data-operate-edit="{:$auth->check('order/edit')}"
width="100%">
</table>
</div>
</div>
</div>
</div>
</div>
... ...
<form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Ordersn')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-OrderSn" data-rule="required" class="form-control" name="row[OrderSn]" type="number">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Type')}:</label>
<div class="col-xs-12 col-sm-8">
<select id="c-type" data-rule="required" class="form-control selectpicker" name="row[type]">
{foreach name="typeList" item="vo"}
<option value="{$key}" {in name="key" value=""}selected{/in}>{$vo}</option>
{/foreach}
</select>
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>
<div class="col-xs-12 col-sm-8">
<div class="radio">
{foreach name="statusList" item="vo"}
<label for="row[status]-{$key}"><input id="row[status]-{$key}" name="row[status]" type="radio" value="{$key}" {in name="key" value="0"}checked{/in} /> {$vo}</label>
{/foreach}
</div>
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('User_id')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-user_id" data-rule="required" data-source="user/user/index" data-field="nickname" class="form-control selectpage" name="row[user_id]" type="text" value="">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Money')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-money" data-rule="required" class="form-control" name="row[money]" type="number">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Wechatorder')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-WeChatOrder" class="form-control" name="row[WeChatOrder]" type="text">
</div>
</div>
<div class="form-group layer-footer">
<label class="control-label col-xs-12 col-sm-2"></label>
<div class="col-xs-12 col-sm-8">
<button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
<button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
</div>
</div>
</form>
... ...
<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Ordersn')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-OrderSn" data-rule="required" class="form-control" name="row[OrderSn]" type="number" value="{$row.OrderSn|htmlentities}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Type')}:</label>
<div class="col-xs-12 col-sm-8">
<select id="c-type" data-rule="required" class="form-control selectpicker" name="row[type]">
{foreach name="typeList" item="vo"}
<option value="{$key}" {in name="key" value="$row.type"}selected{/in}>{$vo}</option>
{/foreach}
</select>
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>
<div class="col-xs-12 col-sm-8">
<div class="radio">
{foreach name="statusList" item="vo"}
<label for="row[status]-{$key}"><input id="row[status]-{$key}" name="row[status]" type="radio" value="{$key}" {in name="key" value="$row.status"}checked{/in} /> {$vo}</label>
{/foreach}
</div>
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('User_id')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-user_id" data-rule="required" data-source="user/index" data-field="nickname" class="form-control selectpage" name="row[user_id]" type="text" value="{$row.user_id|htmlentities}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Money')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-money" data-rule="required" class="form-control" name="row[money]" type="number" value="{$row.money|htmlentities}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Wechatorder')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-WeChatOrder" class="form-control" name="row[WeChatOrder]" type="text" value="{$row.WeChatOrder|htmlentities}">
</div>
</div>
<div class="form-group layer-footer">
<label class="control-label col-xs-12 col-sm-2"></label>
<div class="col-xs-12 col-sm-8">
<button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
<button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
</div>
</div>
</form>
... ...
<div class="panel panel-default panel-intro">
<div class="panel-heading">
{:build_heading(null,FALSE)}
<ul class="nav nav-tabs" data-field="status">
<li class="{:$Think.get.status === null ? 'active' : ''}"><a href="#t-all" data-value="" data-toggle="tab">{:__('All')}</a></li>
{foreach name="statusList" item="vo"}
<li class="{:$Think.get.status === (string)$key ? 'active' : ''}"><a href="#t-{$key}" data-value="{$key}" data-toggle="tab">{$vo}</a></li>
{/foreach}
</ul>
</div>
<div class="panel-body">
<div id="myTabContent" class="tab-content">
<div class="tab-pane fade active in" id="one">
<div class="widget-body no-padding">
<div id="toolbar" class="toolbar">
<a href="javascript:;" class="btn btn-primary btn-refresh" title="{:__('Refresh')}" ><i class="fa fa-refresh"></i> </a>
<!--<a href="javascript:;" class="btn btn-success btn-add {:$auth->check('pay_order/add')?'':'hide'}" title="{:__('Add')}" ><i class="fa fa-plus"></i> {:__('Add')}</a>-->
<a href="javascript:;" class="btn btn-success btn-edit btn-disabled disabled {:$auth->check('pay_order/edit')?'':'hide'}" title="{:__('Edit')}" ><i class="fa fa-pencil"></i> {:__('Edit')}</a>
<!--<a href="javascript:;" class="btn btn-danger btn-del btn-disabled disabled {:$auth->check('pay_order/del')?'':'hide'}" title="{:__('Delete')}" ><i class="fa fa-trash"></i> {:__('Delete')}</a>-->
<!--<a href="javascript:;" class="btn btn-danger btn-import {:$auth->check('pay_order/import')?'':'hide'}" title="{:__('Import')}" id="btn-import-file" data-url="ajax/upload" data-mimetype="csv,xls,xlsx" data-multiple="false"><i class="fa fa-upload"></i> {:__('Import')}</a>-->
<!---->
<!--<div class="dropdown btn-group {:$auth->check('pay_order/multi')?'':'hide'}">-->
<!--<a class="btn btn-primary btn-more dropdown-toggle btn-disabled disabled" data-toggle="dropdown"><i class="fa fa-cog"></i> {:__('More')}</a>-->
<!--<ul class="dropdown-menu text-left" role="menu">-->
<!--<li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:;" data-params="status=normal"><i class="fa fa-eye"></i> {:__('Set to normal')}</a></li>-->
<!--<li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:;" data-params="status=hidden"><i class="fa fa-eye-slash"></i> {:__('Set to hidden')}</a></li>-->
<!--</ul>-->
<!--</div>-->
</div>
<table id="table" class="table table-striped table-bordered table-hover table-nowrap"
data-operate-edit="{:$auth->check('pay_order/edit')}"
width="100%">
</table>
</div>
</div>
</div>
</div>
</div>
... ...
... ... @@ -3,7 +3,7 @@
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('User_id')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-user_id" data-rule="required" data-source="user/user/index" data-field="nickname" class="form-control selectpage" name="row[user_id]" type="text" value="">
<input id="c-user_id" data-rule="required" data-source="user/index" data-field="nickname" class="form-control selectpage" name="row[user_id]" type="text" value="">
</div>
</div>
<div class="form-group">
... ...
... ... @@ -3,7 +3,7 @@
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('User_id')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-user_id" data-rule="required" data-source="user/user/index" data-field="nickname" class="form-control selectpage" name="row[user_id]" type="text" value="{$row.user_id|htmlentities}">
<input id="c-user_id" data-rule="required" data-source="user/index" data-field="nickname" class="form-control selectpage" name="row[user_id]" type="text" value="{$row.user_id|htmlentities}">
</div>
</div>
<div class="form-group">
... ...
... ... @@ -3,7 +3,7 @@
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('User_id')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-user_id" data-rule="required" data-source="user/user/index" data-field="nickname" class="form-control selectpage" name="row[user_id]" type="text" value="">
<input id="c-user_id" data-rule="required" data-source="user/index" data-field="nickname" class="form-control selectpage" name="row[user_id]" type="text" value="">
</div>
</div>
<div class="form-group">
... ... @@ -28,17 +28,18 @@
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Address')}:</label>
<div class="col-xs-12 col-sm-8">
<div class="col-xs-12 col-sm-8" data-toggle="addresspicker" data-input-id="c-address" data-lat-id="c-lat"
data-lng-id="c-lng">
<input id="c-address" data-rule="required" class="form-control" name="row[address]" type="text">
</div>
</div>
<div class="form-group">
<div class="form-group" style="display: none">
<label class="control-label col-xs-12 col-sm-2">{:__('Lng')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-lng" data-rule="required" class="form-control" name="row[lng]" type="text">
</div>
</div>
<div class="form-group">
<div class="form-group" style="display: none">
<label class="control-label col-xs-12 col-sm-2">{:__('Lat')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-lat" data-rule="required" class="form-control" name="row[lat]" type="text">
... ...
... ... @@ -3,7 +3,7 @@
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('User_id')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-user_id" data-rule="required" data-source="user/user/index" data-field="nickname" class="form-control selectpage" name="row[user_id]" type="text" value="{$row.user_id|htmlentities}">
<input id="c-user_id" data-rule="required" data-source="user/index" data-field="nickname" class="form-control selectpage" name="row[user_id]" type="text" value="{$row.user_id|htmlentities}">
</div>
</div>
<div class="form-group">
... ... @@ -28,17 +28,18 @@
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Address')}:</label>
<div class="col-xs-12 col-sm-8">
<div class="col-xs-12 col-sm-8" data-toggle="addresspicker" data-input-id="c-address" data-lat-id="c-lat"
data-lng-id="c-lng">
<input id="c-address" data-rule="required" class="form-control" name="row[address]" type="text" value="{$row.address|htmlentities}">
</div>
</div>
<div class="form-group">
<div class="form-group" style="display: none">
<label class="control-label col-xs-12 col-sm-2">{:__('Lng')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-lng" data-rule="required" class="form-control" name="row[lng]" type="text" value="{$row.lng|htmlentities}">
</div>
</div>
<div class="form-group">
<div class="form-group" style="display: none">
<label class="control-label col-xs-12 col-sm-2">{:__('Lat')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-lat" data-rule="required" class="form-control" name="row[lat]" type="text" value="{$row.lat|htmlentities}">
... ...
... ... @@ -10,21 +10,20 @@
<a href="javascript:;" class="btn btn-success btn-add {:$auth->check('stor/add')?'':'hide'}" title="{:__('Add')}" ><i class="fa fa-plus"></i> {:__('Add')}</a>
<a href="javascript:;" class="btn btn-success btn-edit btn-disabled disabled {:$auth->check('stor/edit')?'':'hide'}" title="{:__('Edit')}" ><i class="fa fa-pencil"></i> {:__('Edit')}</a>
<a href="javascript:;" class="btn btn-danger btn-del btn-disabled disabled {:$auth->check('stor/del')?'':'hide'}" title="{:__('Delete')}" ><i class="fa fa-trash"></i> {:__('Delete')}</a>
<a href="javascript:;" class="btn btn-danger btn-import {:$auth->check('stor/import')?'':'hide'}" title="{:__('Import')}" id="btn-import-file" data-url="ajax/upload" data-mimetype="csv,xls,xlsx" data-multiple="false"><i class="fa fa-upload"></i> {:__('Import')}</a>
<div class="dropdown btn-group {:$auth->check('stor/multi')?'':'hide'}">
<a class="btn btn-primary btn-more dropdown-toggle btn-disabled disabled" data-toggle="dropdown"><i class="fa fa-cog"></i> {:__('More')}</a>
<ul class="dropdown-menu text-left" role="menu">
<li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:;" data-params="status=normal"><i class="fa fa-eye"></i> {:__('Set to normal')}</a></li>
<li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:;" data-params="status=hidden"><i class="fa fa-eye-slash"></i> {:__('Set to hidden')}</a></li>
</ul>
</div>
<!--<a href="javascript:;" class="btn btn-danger btn-import {:$auth->check('stor/import')?'':'hide'}" title="{:__('Import')}" id="btn-import-file" data-url="ajax/upload" data-mimetype="csv,xls,xlsx" data-multiple="false"><i class="fa fa-upload"></i> {:__('Import')}</a>-->
<!---->
<!--<div class="dropdown btn-group {:$auth->check('stor/multi')?'':'hide'}">-->
<!--<a class="btn btn-primary btn-more dropdown-toggle btn-disabled disabled" data-toggle="dropdown"><i class="fa fa-cog"></i> {:__('More')}</a>-->
<!--<ul class="dropdown-menu text-left" role="menu">-->
<!--<li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:;" data-params="status=normal"><i class="fa fa-eye"></i> {:__('Set to normal')}</a></li>-->
<!--<li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:;" data-params="status=hidden"><i class="fa fa-eye-slash"></i> {:__('Set to hidden')}</a></li>-->
<!--</ul>-->
<!--</div>-->
</div>
<table id="table" class="table table-striped table-bordered table-hover table-nowrap"
data-operate-edit="{:$auth->check('stor/edit')}"
data-operate-del="{:$auth->check('stor/del')}"
width="100%">
</table>
</div>
... ...
<form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('User_id')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-user_id" data-rule="required" data-source="user/user/index" data-field="nickname" class="form-control selectpage" name="row[user_id]" type="text" value="">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Ordersn')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-OrderSn" data-rule="required" class="form-control" name="row[OrderSn]" type="text">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>
<div class="col-xs-12 col-sm-8">
<div class="radio">
{foreach name="statusList" item="vo"}
<label for="row[status]-{$key}"><input id="row[status]-{$key}" name="row[status]" type="radio" value="{$key}" {in name="key" value="0"}checked{/in} /> {$vo}</label>
{/foreach}
</div>
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Seller_id')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-seller_id" data-rule="required" data-source="seller/index" class="form-control selectpage" name="row[seller_id]" type="text" value="">
</div>
</div>
<div class="form-group layer-footer">
<label class="control-label col-xs-12 col-sm-2"></label>
<div class="col-xs-12 col-sm-8">
<button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
<button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
</div>
</div>
</form>
... ...
<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('User_id')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-user_id" data-rule="required" data-source="user/index" data-field="nickname" class="form-control selectpage" name="row[user_id]" type="text" value="{$row.user_id|htmlentities}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Ordersn')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-OrderSn" data-rule="required" class="form-control" name="row[OrderSn]" type="text" value="{$row.OrderSn|htmlentities}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>
<div class="col-xs-12 col-sm-8">
<div class="radio">
{foreach name="statusList" item="vo"}
<label for="row[status]-{$key}"><input id="row[status]-{$key}" name="row[status]" type="radio" value="{$key}" {in name="key" value="$row.status"}checked{/in} /> {$vo}</label>
{/foreach}
</div>
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Seller_id')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-seller_id" data-rule="required" data-source="seller/index" data-field="CompanyName" class="form-control selectpage" name="row[seller_id]" type="text" value="{$row.seller_id|htmlentities}">
</div>
</div>
<div class="form-group layer-footer">
<label class="control-label col-xs-12 col-sm-2"></label>
<div class="col-xs-12 col-sm-8">
<button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
<button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
</div>
</div>
</form>
... ...
<div class="panel panel-default panel-intro">
<div class="panel-heading">
{:build_heading(null,FALSE)}
<ul class="nav nav-tabs" data-field="status">
<li class="{:$Think.get.status === null ? 'active' : ''}"><a href="#t-all" data-value="" data-toggle="tab">{:__('All')}</a></li>
{foreach name="statusList" item="vo"}
<li class="{:$Think.get.status === (string)$key ? 'active' : ''}"><a href="#t-{$key}" data-value="{$key}" data-toggle="tab">{$vo}</a></li>
{/foreach}
</ul>
</div>
<div class="panel-body">
<div id="myTabContent" class="tab-content">
<div class="tab-pane fade active in" id="one">
<div class="widget-body no-padding">
<div id="toolbar" class="toolbar">
<a href="javascript:;" class="btn btn-primary btn-refresh" title="{:__('Refresh')}" ><i class="fa fa-refresh"></i> </a>
<!--<a href="javascript:;" class="btn btn-success btn-add {:$auth->check('tuikuan/add')?'':'hide'}" title="{:__('Add')}" ><i class="fa fa-plus"></i> {:__('Add')}</a>-->
<a href="javascript:;" class="btn btn-success btn-edit btn-disabled disabled {:$auth->check('tuikuan/edit')?'':'hide'}" title="{:__('Edit')}" ><i class="fa fa-pencil"></i> {:__('Edit')}</a>
<!--<a href="javascript:;" class="btn btn-danger btn-del btn-disabled disabled {:$auth->check('tuikuan/del')?'':'hide'}" title="{:__('Delete')}" ><i class="fa fa-trash"></i> {:__('Delete')}</a>-->
<!--<a href="javascript:;" class="btn btn-danger btn-import {:$auth->check('tuikuan/import')?'':'hide'}" title="{:__('Import')}" id="btn-import-file" data-url="ajax/upload" data-mimetype="csv,xls,xlsx" data-multiple="false"><i class="fa fa-upload"></i> {:__('Import')}</a>-->
<!---->
<!--<div class="dropdown btn-group {:$auth->check('tuikuan/multi')?'':'hide'}">-->
<!--<a class="btn btn-primary btn-more dropdown-toggle btn-disabled disabled" data-toggle="dropdown"><i class="fa fa-cog"></i> {:__('More')}</a>-->
<!--<ul class="dropdown-menu text-left" role="menu">-->
<!--<li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:;" data-params="status=normal"><i class="fa fa-eye"></i> {:__('Set to normal')}</a></li>-->
<!--<li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:;" data-params="status=hidden"><i class="fa fa-eye-slash"></i> {:__('Set to hidden')}</a></li>-->
<!--</ul>-->
<!--</div>-->
</div>
<table id="table" class="table table-striped table-bordered table-hover table-nowrap"
data-operate-edit="{:$auth->check('tuikuan/edit')}"
width="100%">
</table>
</div>
</div>
</div>
</div>
</div>
... ...
... ... @@ -281,6 +281,32 @@ class Common extends Api
* @ApiReturn ({
'code':'1',
'msg':'返回成功',
"data": {
"Stor": [
{
"id": 2, //服务商ID
"CompanyMain": "混凝土瞬间移动树" //服务商名
}
],
"Battery": [
{
"id": 1, //电池类型id
"title": "电池类型一" //电池类型
},
{
"id": 2,
"title": "电池类型二"
},
{
"id": 3,
"title": "电池类型三"
},
{
"id": 4,
"title": "电池类型四"
}
]
}
)
*/
public function AgreementConfig()
... ... @@ -303,22 +329,22 @@ class Common extends Api
$Battery[$k]['title'] = $v['title'];
}
}
$HoursArr = Db::name('hours')->select();
if (empty($HoursArr)) {
$Hours = [];
} else {
foreach ($HoursArr as $k => $v) {
$Hours[$k]['id'] = $v['id'];
$Hours[$k]['number'] = $v['number'];
}
}
// $HoursArr = Db::name('hours')->select();
// if (empty($HoursArr)) {
// $Hours = [];
// } else {
// foreach ($HoursArr as $k => $v) {
// $Hours[$k]['id'] = $v['id'];
// $Hours[$k]['number'] = $v['number'];
// }
// }
// $MoneyArr = Db::name('money_config')->find();
$data = [
// 'UpMoney' => $MoneyArr['UpMoney'],
// 'MonthMoney' => $MoneyArr['MonthMoney'],
'Stor' => $Seller,
'Battery' => $Battery,
'Hours' => $Hours,
// 'Hours' => $Hours,
];
$this->success('成功', $data);
}
... ... @@ -593,4 +619,45 @@ class Common extends Api
}
$this->res($res);
}
/**
* 公共接口
* @ApiTitle (订单操作)
* @ApiSummary (订单操作)
* @ApiMethod (POST)
* @ApiRoute (/api/Common/OrderOperation)
* @ApiHeaders (name=token, type=string, required=true, description="请求的Token")
* @ApiParams (name="OrderSn", type="string", required=true, description="订单号")
* @ApiParams (name="type", type="string", required=true, description="操作:1=确认无误,3=电池故障")
* @ApiReturnParams (name="code", type="integer", required=true, sample="0")
* @ApiReturnParams (name="msg", type="string", required=true, sample="返回成功")
* @ApiReturn ({
'code':'1',
'msg':'返回成功',
)
*/
public function OrderOperation()
{
$UserId = $this->IsToken($this->request->header());
$params = $this->request->param();
$Arr = Db::name('order')
->alias('o')
->where('o.OrderSn', $params['OrderSn'])
->join('stor s', 's.id=o.stor_id')
->where('s.user_id', $UserId)
->find();
if (empty($Arr)) {
$this->error('身份异常', 0);
die;
}
$res = Db::name('order')->where('OrderSn', $params['OrderSn'])->update(
[
'status' => $params['type'],
'yes_time' => time(),
'ok_time' => time()
]
);
$this->res($res);
}
}
... ...
... ... @@ -32,7 +32,6 @@ class Index extends Api
* @ApiParams (name="LastYearMoney", type="string", required=true, description="上年营业额")
* @ApiParams (name="CompanyPeopleNum", type="string", required=true, description="公司员工数")
* @ApiParams (name="image", type="string", required=true, description="营业执照或负责人身份证照片")
* @ApiParams (name="Status", type="string", required=true, description="审核状态:0=待审核,1=审核通过,2=审核未通过")
* @ApiParams (name="CompanyName", type="string", required=true, description="公司或商号名称")
* @ApiParams (name="fa_address", type="string", required=true, description="法定地址")
* @ApiParams (name="yingye_address", type="string", required=true, description="营业地址")
... ... @@ -83,7 +82,7 @@ class Index extends Api
* @ApiParams (name="address_con", type="string", required=true, description="详细地址")
* @ApiParams (name="mobile", type="string", required=true, description="联系电话")
* @ApiParams (name="hours", type="string", required=true, description="营业时间")
* @ApiParams (name="Battery", type="string", required=true, description="电池分类Json数组['type_id':'1','num':'10']")
* @ApiParams (name="Battery", type="string", required=true, description="电池分类Json数组type_id.num)
* @ApiReturnParams (name="code", type="integer", required=true, sample="0")
* @ApiReturnParams (name="msg", type="string", required=true, sample="返回成功")
* @ApiReturn ({
... ... @@ -144,7 +143,26 @@ class Index extends Api
* @ApiReturn ({
'code':'1',
'msg':'返回成功',
'data':{
"data": {
"avatar": "http://kcd.qiniu.bronet.cn/uploads/20201027/lhOJtzf7HMlBaF2HRJXbDb9OaaZ_.jpg",
"name": "王二蛋的店",
"address": "天津市河东区大直沽街道汇贤里安教小区",
"lng": "117.244942",
"lat": "39.119204",
"address_con": "天津市",
"mobile": "13292442918", //联系方式
"hours": "1213", 营业时间
"Battery": [ //电池分类
{
"type_id": "1",
"num": "10"
},
{
"type_id": "2",
"num": "10"
}
]
}
})
*/
public function UpdateStorBack()
... ... @@ -242,7 +260,7 @@ class Index extends Api
* @ApiRoute (/api/Index/Agreement)
* @ApiHeaders (name=token, type=string, required=true, description="请求的Token")
* @ApiParams (name="name", type="string", required=true, description="姓名")
* @ApiParams (name="seller_id", type="string", required=true, description="门店ID")
* @ApiParams (name="seller_id", type="string", required=true, description="服务商ID")
* @ApiParams (name="battery_id", type="string", required=true, description="电池类型")
* @ApiParams (name="card_image", type="string", required=true, description="身份证照片")
* @ApiParams (name="mobile", type="string", required=true, description="联系方式")
... ... @@ -251,7 +269,7 @@ class Index extends Api
* @ApiReturn ({
'code':'1',
'msg':'返回成功',
'data':{
"data": "202010290928196016917223" //订单号 用订单号去调支付
})
*/
public function Agreement()
... ... @@ -336,7 +354,8 @@ class Index extends Api
->where($mapC)
->order('id desc')
->page($params['pages'], $params['rows'])
->field('o.id,u.nickname,u.avatar,o.createtime');
->field('o.id,u.nickname,u.avatar,o.createtime')
->select();
$Count = Db::name('order')
->alias('o')
->join('stor s', 's.id=o.stor_id')
... ... @@ -347,7 +366,8 @@ class Index extends Api
->where($mapC)
->order('id desc')
->page($params['pages'], $params['rows'])
->field('o.id,u.nickname,u.avatar,o.createtime');
->field('o.id,u.nickname,u.avatar,o.createtime')
->select();
$OrderCount = Db::name('order')
->alias('o')
->join('stor s', 's.id=o.stor_id')
... ... @@ -391,7 +411,21 @@ class Index extends Api
* @ApiReturn ({
'code':'1',
'msg':'返回成功',
'data':{
"data": {
"Count": 1, //数量
"List": [
{
"id": 1, //id
"nickname": "王叨叨",
"avatar": "https://thirdwx.qlogo.cn/mmopen/vi_32/5xl51Ja2tE9bZOVqrntjJX1He1xx6OfCEY6HIep0p4YtDzmM00NB6ia5S50AVLJv0dKHKPjOCF6jXQqhfrlKkyQ/132",
"UpMoney": "300.00", //押金
"Money": "200.00", //剩余租金
"mobile": "13292442918", //联系方式
"status": 0, //协议审核状态:0=待审核,1=协议中,2=已终止,3=已欠费,4=签约失败
"createtime": "2020-10-29" //协议生成时间
}
]
}
})
*/
public function MyCustomer()
... ... @@ -411,7 +445,8 @@ class Index extends Api
->where($map)
->page($params['pages'], $params['rows'])
->order('id desc')
->field('a.id,a.mobile,u.nickname,u.avatar,a.UpMoney,a.Money,a.createtime');
->field('a.id,a.mobile,u.nickname,a.status,u.avatar,a.UpMoney,a.Money,a.createtime')
->select();
$Count = Db::name('agreement')
->alias('a')
->join('seller s', 's.id=a.seller_id')
... ... @@ -419,7 +454,8 @@ class Index extends Api
->join('user u', 'u.id=a.user_id')
->where('a.status', $params['type'])
->order('id desc')
->field('a.id,u.nickname,a.status,u.avatar,a.UpMoney,a.Money,a.createtime');
->field('a.id,a.mobile,u.nickname,a.status,u.avatar,a.UpMoney,a.Money,a.createtime')
->select();
if (empty($Arr)) {
$data = [
'Count' => 0,
... ... @@ -475,7 +511,8 @@ class Index extends Api
->where('a.status', $params['type'])
->page($params['pages'], $params['rows'])
->order('id desc')
->field('a.id,a.OrderSn,u.avatar,u.nickname,a.updatetime,a.status');
->field('a.id,a.OrderSn,u.avatar,u.nickname,a.updatetime,a.status')
->select();
$Count = Db::name('agreement')
->alias('a')
->join('seller s', 's.id=a.seller_id')
... ... @@ -483,7 +520,8 @@ class Index extends Api
->where('s.user_id', $UserId)
->where('a.status', $params['type'])
->order('id desc')
->field('a.id,a.OrderSn,u.avatar,u.nickname,a.updatetime,a.status');
->field('a.id,a.OrderSn,u.avatar,u.nickname,a.updatetime,a.status')
->select();
if (empty($Arr)) {
$data = [
'Count' => 0,
... ... @@ -526,6 +564,10 @@ class Index extends Api
{
$Arr = Db::name('stor')->select();
$Code = input('battery_code');
if (empty($Code) || $Code == '' || $Code == "" || $Code == null) {
$this->error('请先链接蓝牙', 0);
die;
}
$map['BatteryCode'] = ['LIKE', '%' . $Code . '%'];
//用户电池分类ID
$Id = Db::name('battery_code')->where($map)->value('id');
... ... @@ -572,7 +614,7 @@ class Index extends Api
* @ApiReturnParams (name="code", type="integer", required=true, sample="0")
* @ApiReturnParams (name="msg", type="string", required=true, sample="返回成功")
* @ApiReturn ({
'code':'1',
'code':'1', //99998 请先签订协议 跳转签订
'msg':'返回成功',
'data':{
})
... ... @@ -581,7 +623,7 @@ class Index extends Api
{
$UserId = $this->IsToken($this->request->header());
$params = $this->request->param();
$map['BatteryCode'] = ['IN', $params['battery_code']];
$map['BatteryCode'] = ['LIKE', '%' . $params['battery_code'] . '%'];
//用户电池分类ID
$Id = Db::name('battery_code')->where($map)->value('id');
if (empty($Id)) {
... ... @@ -623,6 +665,7 @@ class Index extends Api
* @ApiMethod (POST)
* @ApiRoute (/api/Index/MyOrder)
* @ApiHeaders (name=token, type=string, required=true, description="请求的Token")
* @ApiParams (name="type", type="string", required=true, description="订单状态:0=待换电,1=已换电,9=全部")
* @ApiParams (name="pages", type="string", required=true, description="pages")
* @ApiParams (name="rows", type="string", required=true, description="rows")
* @ApiReturnParams (name="code", type="integer", required=true, sample="0")
... ... @@ -630,29 +673,56 @@ class Index extends Api
* @ApiReturn ({
'code':'1',
'msg':'返回成功',
'data':{
"data": {
"Count": 1, //总数
"List": [
{
"id": 1,
"OrderSn": "202010291005404651432049",
"battery_code": "123", //设备号
"nickname": "王叨叨",
"avatar": "https://thirdwx.qlogo.cn/mmopen/vi_32/5xl51Ja2tE9bZOVqrntjJX1He1xx6OfCEY6HIep0p4YtDzmM00NB6ia5S50AVLJv0dKHKPjOCF6jXQqhfrlKkyQ/132",
"status": 0, 订单状态:0=待换电,1=已换电,2=已过期,3=异常订单
"createtime": 2020-10-27, //下单时间
"ok_time": "", //完成时间
"title": "电池类型一", // 电池类型
"manufactor": "1231", //厂家
"Voltage": "123", // 电压
"yes_time": "" //商家确认时间
}
]
}
})
*/
public function MyOrder()
{
$UserId = $this->IsToken($this->request->header());
$params = $this->request->param();
$Map = [];
if ($params['type'] != 9) {
$Map['o.status'] = ['eq', $params['type']];
}
$Arr = Db::name('order')
->alias('o')
->join('stor s', 's.id=a.stor_id')
->join('stor s', 's.id=o.stor_id')
->where('s.user_id', $UserId)
->page($params['pages'], $params['rows'])
->where($Map)
->join('user u', 'u.id=o.user_id')
->join('battery_code b', 'b.id=o.battery_id')
->order('id desc')
->field('o.id,o.OrderSn,o.battery_code,u.nickname,u.avatar,o.status,o.createtime,o.ok_time,b.title,o.manufactor,o.Voltage,o.yes_time');
->field('o.id,o.OrderSn,o.battery_code,u.nickname,u.avatar,o.status,o.createtime,o.ok_time,b.title,o.manufactor,o.Voltage,o.yes_time')
->select();
$Count = Db::name('order')
->alias('o')
->join('stor s', 's.id=a.stor_id')
->join('stor s', 's.id=o.stor_id')
->where('s.user_id', $UserId)
->where($Map)
->join('user u', 'u.id=o.user_id')
->join('battery_code b', 'b.id=o.battery_id')
->order('id desc')
->field('o.id,o.OrderSn,o.battery_code,u.nickname,u.avatar,o.status,o.createtime,o.ok_time,b.title,o.manufactor,o.Voltage,o.yes_time');
->field('o.id,o.OrderSn,o.battery_code,u.nickname,u.avatar,o.status,o.createtime,o.ok_time,b.title,o.manufactor,o.Voltage,o.yes_time')
->select();
if (empty($Arr)) {
$data = [
'Count' => 0,
... ... @@ -666,12 +736,20 @@ class Index extends Api
$List[$k]['nickname'] = $v['nickname'];
$List[$k]['avatar'] = $v['avatar'];
$List[$k]['status'] = $v['status'];
$List[$k]['createtime'] = $v['createtime'];
$List[$k]['ok_time'] = $v['ok_time'];
$List[$k]['createtime'] = date('Y-m-d H:i:s', $v['createtime']);
if ($v['ok_time'] == null) {
$List[$k]['ok_time'] = '';
} else {
$List[$k]['ok_time'] = date('Y-m-d H:i:s', $v['ok_time']);
}
$List[$k]['title'] = $v['title'];
$List[$k]['manufactor'] = $v['manufactor'];
$List[$k]['Voltage'] = $v['Voltage'];
$List[$k]['yes_time'] = $v['yes_time'];
if ($v['yes_time'] == null) {
$List[$k]['yes_time'] = '';
} else {
$List[$k]['yes_time'] = date('Y-m-d H:i:s', $v['yes_time']);
}
}
$data = [
'Count' => count($Count),
... ... @@ -696,7 +774,20 @@ class Index extends Api
* @ApiReturn ({
'code':'1',
'msg':'返回成功',
'data':{
"data": {
"Count": 1, //总数
"List": [
{
"id": 1,
"OrderSn": "202010290928196016917223", //订单
"UpMoney": "300.00", //押金
"Money": "200.00", //剩余租金
"status": 2, 协议审核状态:0=待审核,1=协议中,2=已终止,3=已欠费,4=签约失败
"refind_status": 3, 退款审核状态:0=待审核,1=已通过,2=已拒绝,3=未发起退款
"CompanyName": "王二蛋的垃圾站"
}
]
}
})
*/
public function MyUpMoney()
... ... @@ -706,14 +797,18 @@ class Index extends Api
$Arr = Db::name('agreement')
->alias('a')
->where('a.user_id', $UserId)
->join('seller s', 's.id=a.seller_id')
->page($params['pages'], $params['rows'])
->order('id desc')
->field('a.id,a.OrderSn,a.UpMoney,a.Money,a.status,a.refind_status,a.CompanyName');
->field('a.id,a.OrderSn,a.UpMoney,a.Money,a.status,a.refind_status,s.CompanyName')
->select();
$Count = Db::name('agreement')
->alias('a')
->join('seller s', 's.id=a.seller_id')
->where('a.user_id', $UserId)
->order('id desc')
->field('a.id,a.OrderSn,a.UpMoney,a.Money,a.status,a.refind_status,a.CompanyName');
->field('a.id,a.OrderSn,a.UpMoney,a.Money,a.status,a.refind_status,s.CompanyName')
->select();
if (empty($Arr)) {
$data = [
'Count' => 0,
... ...
此 diff 太大无法显示。
define([], function () {
//修改上传的接口调用
require([], function () {
//绑定data-toggle=addresspicker属性点击事件
$(document).on('click', "[data-toggle='addresspicker']", function () {
var that = this;
var callback = $(that).data('callback');
var input_id = $(that).data("input-id") ? $(that).data("input-id") : "";
var lat_id = $(that).data("lat-id") ? $(that).data("lat-id") : "";
var lng_id = $(that).data("lng-id") ? $(that).data("lng-id") : "";
var lat = lat_id ? $("#" + lat_id).val() : '';
var lng = lng_id ? $("#" + lng_id).val() : '';
var url = "/addons/address/index/select";
url += (lat && lng) ? '?lat=' + lat + '&lng=' + lng : '';
Fast.api.open(url, '位置选择', {
callback: function (res) {
input_id && $("#" + input_id).val(res.address).trigger("change");
lat_id && $("#" + lat_id).val(res.lat).trigger("change");
lng_id && $("#" + lng_id).val(res.lng).trigger("change");
try {
//执行回调函数
if (typeof callback === 'function') {
callback.call(that, res);
}
} catch (e) {
}
}
});
});
});
//修改上传的接口调用
require(['upload'], function (Upload) {
//初始化中完成判断
... ...
define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
var Controller = {
index: function () {
// 初始化表格参数配置
Table.api.init({
extend: {
index_url: 'agreement/index' + location.search,
add_url: 'agreement/add',
edit_url: 'agreement/edit',
del_url: 'agreement/del',
multi_url: 'agreement/multi',
import_url: 'agreement/import',
table: 'agreement',
}
});
var table = $("#table");
// 初始化表格
table.bootstrapTable({
url: $.fn.bootstrapTable.defaults.extend.index_url,
pk: 'id',
sortName: 'id',
columns: [
[
{checkbox: true},
{field: 'id', title: __('Id')},
{field: 'OrderSn', title: __('Ordersn'), operate: 'LIKE'},
{field: 'mobile', title: __('Mobile'), operate: 'LIKE'},
// {field: 'user.nickname', title: __('User.nickname'), operate: 'LIKE'},
// {field: 'user.avatar', title: __('User.avatar'), operate: 'LIKE', events: Table.api.events.image, formatter: Table.api.formatter.image},
// {field: 'user_id', title: __('User_id')},
{field: 'name', title: __('Name'), operate: 'LIKE'},
// {field: 'seller_id', title: __('Seller_id')},
// {field: 'battery_id', title: __('Battery_id')},
{field: 'batterycode.title', title: __('Batterycode.title'), operate: 'LIKE'},
{field: 'UpMoney', title: __('Upmoney'), operate:'BETWEEN'},
{field: 'MonthMoney', title: __('Monthmoney'), operate:'BETWEEN'},
{field: 'Money', title: __('Money'), operate:'BETWEEN'},
{field: 'card_image', title: __('Card_image'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image},
{field: 'status', title: __('Status'), searchList: {"0":__('Status 0'),"1":__('Status 1'),"2":__('Status 2'),"3":__('Status 3'),"4":__('Status 4')}, formatter: Table.api.formatter.status},
{field: 'refind_status', title: __('Refind_status'), searchList: {"0":__('Refind_status 0'),"1":__('Refind_status 1'),"2":__('Refind_status 2'),"3":__('Refind_status 3')}, formatter: Table.api.formatter.status},
{field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
{field: 'updatetime', title: __('Updatetime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
{field: 'EXP_time', title: __('Exp_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
// {field: 'seller.CompanyName', title: __('Seller.companyname'), operate: 'LIKE'},
{field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
]
]
});
// 为表格绑定事件
Table.api.bindevent(table);
},
add: function () {
Controller.api.bindevent();
},
edit: function () {
Controller.api.bindevent();
},
api: {
bindevent: function () {
Form.api.bindevent($("form[role=form]"));
}
}
};
return Controller;
});
\ No newline at end of file
... ...
define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
var Controller = {
index: function () {
// 初始化表格参数配置
Table.api.init({
extend: {
index_url: 'order/index' + location.search,
add_url: 'order/add',
edit_url: 'order/edit',
del_url: 'order/del',
multi_url: 'order/multi',
import_url: 'order/import',
table: 'order',
}
});
var table = $("#table");
// 初始化表格
table.bootstrapTable({
url: $.fn.bootstrapTable.defaults.extend.index_url,
pk: 'id',
sortName: 'id',
columns: [
[
{checkbox: true},
{field: 'id', title: __('Id')},
{field: 'OrderSn', title: __('Ordersn'), operate: 'LIKE'},
// {field: 'stor_id', title: __('Stor_id')},
// {field: 'user_id', title: __('User_id')},
// {field: 'battery_id', title: __('Battery_id')},
{field: 'stor.name', title: __('Stor.name'), operate: 'LIKE'},
{field: 'user.nickname', title: __('User.nickname'), operate: 'LIKE'},
{field: 'user.avatar', title: __('User.avatar'), operate: 'LIKE', events: Table.api.events.image, formatter: Table.api.formatter.image},
{field: 'batterycode.title', title: __('Batterycode.title'), operate: 'LIKE'},
{field: 'battery_code', title: __('Battery_code'), operate: 'LIKE'},
{field: 'manufactor', title: __('Manufactor'), operate: 'LIKE'},
{field: 'Voltage', title: __('Voltage'), operate: 'LIKE'},
{field: 'status', title: __('Status'), searchList: {"0":__('Status 0'),"1":__('Status 1'),"2":__('Status 2'),"3":__('Status 3')}, formatter: Table.api.formatter.status},
{field: 'EXP_time', title: __('Exp_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
{field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
{field: 'yes_time', title: __('Yes_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
{field: 'updatetime', title: __('Updatetime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
{field: 'ok_time', title: __('Ok_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
{field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
]
]
});
// 为表格绑定事件
Table.api.bindevent(table);
},
add: function () {
Controller.api.bindevent();
},
edit: function () {
Controller.api.bindevent();
},
api: {
bindevent: function () {
Form.api.bindevent($("form[role=form]"));
}
}
};
return Controller;
});
\ No newline at end of file
... ...
define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
var Controller = {
index: function () {
// 初始化表格参数配置
Table.api.init({
extend: {
index_url: 'pay_order/index' + location.search,
add_url: 'pay_order/add',
edit_url: 'pay_order/edit',
// del_url: 'pay_order/del',
multi_url: 'pay_order/multi',
import_url: 'pay_order/import',
table: 'pay_order',
}
});
var table = $("#table");
// 初始化表格
table.bootstrapTable({
url: $.fn.bootstrapTable.defaults.extend.index_url,
pk: 'PayOrder',
sortName: 'PayOrder',
columns: [
[
{checkbox: true},
{field: 'PayOrder', title: __('Payorder'), operate: 'LIKE'},
{field: 'OrderSn', title: __('Ordersn')},
{field: 'user.nickname', title: __('User.nickname'), operate: 'LIKE'},
{field: 'user.avatar', title: __('User.avatar'), operate: 'LIKE', events: Table.api.events.image, formatter: Table.api.formatter.image},
{field: 'type', title: __('Type'), searchList: {"0":__('Type 0'),"1":__('Type 1')}, formatter: Table.api.formatter.normal},
{field: 'status', title: __('Status'), searchList: {"0":__('Status 0'),"1":__('Status 1')}, formatter: Table.api.formatter.status},
// {field: 'user_id', title: __('User_id')},
{field: 'money', title: __('Money')},
{field: 'WeChatOrder', title: __('Wechatorder'), operate: 'LIKE'},
{field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
{field: 'updatetime', title: __('Updatetime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
{field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
]
]
});
// 为表格绑定事件
Table.api.bindevent(table);
},
add: function () {
Controller.api.bindevent();
},
edit: function () {
Controller.api.bindevent();
},
api: {
bindevent: function () {
Form.api.bindevent($("form[role=form]"));
}
}
};
return Controller;
});
\ No newline at end of file
... ...
... ... @@ -26,21 +26,21 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
[
{checkbox: true},
{field: 'id', title: __('Id')},
{field: 'user_id', title: __('User_id')},
// {field: 'user_id', title: __('User_id')},
// {field: 'user.nickname', title: __('User.nickname'), operate: 'LIKE'},
// {field: 'user.avatar', title: __('User.avatar'), operate: 'LIKE', events: Table.api.events.image, formatter: Table.api.formatter.image},
{field: 'avatar', title: __('Avatar'), operate: 'LIKE', events: Table.api.events.image, formatter: Table.api.formatter.image},
{field: 'name', title: __('Name'), operate: 'LIKE'},
{field: 'address', title: __('Address'), operate: 'LIKE'},
{field: 'lng', title: __('Lng'), operate: 'LIKE'},
{field: 'lat', title: __('Lat'), operate: 'LIKE'},
// {field: 'lng', title: __('Lng'), operate: 'LIKE'},
// {field: 'lat', title: __('Lat'), operate: 'LIKE'},
{field: 'address_con', title: __('Address_con'), operate: 'LIKE'},
{field: 'mobile', title: __('Mobile'), operate: 'LIKE'},
{field: 'hours', title: __('Hours'), operate: 'LIKE'},
{field: 'stor_image', title: __('Stor_image'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image},
{field: 'Battery', title: __('Battery'), operate: 'LIKE'},
// {field: 'Battery', title: __('Battery'), operate: 'LIKE'},
{field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
{field: 'updatetime', title: __('Updatetime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
{field: 'user.nickname', title: __('User.nickname'), operate: 'LIKE'},
{field: 'user.avatar', title: __('User.avatar'), operate: 'LIKE', events: Table.api.events.image, formatter: Table.api.formatter.image},
{field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
]
]
... ...
define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
var Controller = {
index: function () {
// 初始化表格参数配置
Table.api.init({
extend: {
index_url: 'tuikuan/index' + location.search,
add_url: 'tuikuan/add',
edit_url: 'tuikuan/edit',
// del_url: 'tuikuan/del',
multi_url: 'tuikuan/multi',
import_url: 'tuikuan/import',
table: 'tuikuan',
}
});
var table = $("#table");
// 初始化表格
table.bootstrapTable({
url: $.fn.bootstrapTable.defaults.extend.index_url,
pk: 'id',
sortName: 'id',
columns: [
[
{checkbox: true},
{field: 'id', title: __('Id')},
// {field: 'user_id', title: __('User_id')},
{field: 'OrderSn', title: __('Ordersn'), operate: 'LIKE'},
{field: 'seller.CompanyName', title: __('Seller.companyname'), operate: 'LIKE'},
{field: 'user.nickname', title: __('User.nickname'), operate: 'LIKE'},
{field: 'user.avatar', title: __('User.avatar'), operate: 'LIKE', events: Table.api.events.image, formatter: Table.api.formatter.image},
{field: 'status', title: __('Status'), searchList: {"0":__('Status 0'),"1":__('Status 1'),"2":__('Status 2')}, formatter: Table.api.formatter.status},
// {field: 'seller_id', title: __('Seller_id')},
{field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
{field: 'updatetime', title: __('Updatetime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
{field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
]
]
});
// 为表格绑定事件
Table.api.bindevent(table);
},
add: function () {
Controller.api.bindevent();
},
edit: function () {
Controller.api.bindevent();
},
api: {
bindevent: function () {
Form.api.bindevent($("form[role=form]"));
}
}
};
return Controller;
});
\ No newline at end of file
... ...