|
@@ -0,0 +1,214 @@
|
|
|
+<!DOCTYPE html>
|
|
|
+<html lang="zh-cmn-Hans" xmlns:th="http://www.thymeleaf.org">
|
|
|
+<head>
|
|
|
+ <meta charset="UTF-8">
|
|
|
+ <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0">
|
|
|
+ <title>订单管理</title>
|
|
|
+ <script th:include="weixin/common/includeJS_CSS" th:remove="tag" ></script>
|
|
|
+ <link href="style/sale.css" th:href="@{/static/style/sale.css(version=1003)}" rel="stylesheet"/>
|
|
|
+ <link href="style/administrator.css" th:href="@{/static/style/administrator.css(version=${#dates.format(#calendars.createNow(),'yyyyMMdd')})}" rel="stylesheet"/>
|
|
|
+ <link href="style/jquery-weui.css" th:href="@{/static/style/jquery-weui.css(version=${#dates.format(#calendars.createNow(),'yyyyMMdd')})}" rel="stylesheet"/>
|
|
|
+ <script src="js/jquery-weui.js" th:src="@{/static/js/jquery-weui.js}"></script>
|
|
|
+ <link rel="stylesheet" type="text/css" th:href="@{/static/style/mui.picker.min.css}" />
|
|
|
+ <script th:src="@{/static/js/mui/mui.picker.min.js}"></script>
|
|
|
+</head>
|
|
|
+<style>
|
|
|
+
|
|
|
+</style>
|
|
|
+<body class="bg_f2">
|
|
|
+ <nav class="mui-bar mui-bar-nav">
|
|
|
+ <div class="mui-date">
|
|
|
+ <div class="mui-gray" id="showTotal"></div>
|
|
|
+ <div class="mui-date-content" id="dateStr" data-options='{"type":"month","beginYear":2014,"endYear":2025}'>全部订单</div>
|
|
|
+ </div>
|
|
|
+ </nav>
|
|
|
+ <!--内容-->
|
|
|
+ <div id="pullrefresh" class="mui-content mui-scroll-wrapper">
|
|
|
+ <div class="mui-content">
|
|
|
+ <div class="salebox">
|
|
|
+ <div class="buy_fuwu_item" id="list">
|
|
|
+ <!-- 数据显示 -->
|
|
|
+ </div>
|
|
|
+ <div class="weui-loadmore weui-loadmore_line">
|
|
|
+ <span class="weui-loadmore__tips">已经到底啦</span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <script type="text/javascript">
|
|
|
+ (function($) {
|
|
|
+ $.init();
|
|
|
+ var result = $('.mui-date-content');
|
|
|
+ var btns = $('.mui-date-content');
|
|
|
+ btns.each(function(i, btn) {
|
|
|
+
|
|
|
+ btn.addEventListener('tap', function() {
|
|
|
+ var _self = this;
|
|
|
+ result[i].className += ' active';
|
|
|
+ if(_self.picker) {
|
|
|
+ _self.picker.show(function (rs) {
|
|
|
+ result[i].innerText = rs.text.split('-').join('年') + '月';
|
|
|
+ result[i].className = result[i].className.replace('active', '');
|
|
|
+ _self.picker.dispose();
|
|
|
+ _self.picker = null;
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ var optionsJson = this.getAttribute('data-options') || '{}';
|
|
|
+ var options = JSON.parse(optionsJson);
|
|
|
+ var id = this.getAttribute('id');
|
|
|
+ /*
|
|
|
+ * 首次显示时实例化组件
|
|
|
+ * 示例为了简洁,将 options 放在了按钮的 dom 上
|
|
|
+ * 也可以直接通过代码声明 optinos 用于实例化 DtPicker
|
|
|
+ */
|
|
|
+ _self.picker = new $.DtPicker(options);
|
|
|
+ _self.picker.show(function(rs) {
|
|
|
+ /*
|
|
|
+ * rs.value 拼合后的 value
|
|
|
+ * rs.text 拼合后的 text
|
|
|
+ * rs.y 年,可以通过 rs.y.vaue 和 rs.y.text 获取值和文本
|
|
|
+ * rs.m 月,用法同年
|
|
|
+ * rs.d 日,用法同年
|
|
|
+ * rs.h 时,用法同年
|
|
|
+ * rs.i 分(minutes 的第二个字母),用法同年
|
|
|
+ */
|
|
|
+ result[i].innerText = rs.text;
|
|
|
+ result[i].className = result[i].className.replace('active', '');
|
|
|
+ showNew();
|
|
|
+ /*
|
|
|
+ * 返回 false 可以阻止选择框的关闭
|
|
|
+ * return false;
|
|
|
+ */
|
|
|
+ /*
|
|
|
+ * 释放组件资源,释放后将将不能再操作组件
|
|
|
+ * 通常情况下,不需要示放组件,new DtPicker(options) 后,可以一直使用。
|
|
|
+ * 当前示例,因为内容较多,如不进行资原释放,在某些设备上会较慢。
|
|
|
+ * 所以每次用完便立即调用 dispose 进行释放,下次用时再创建新实例。
|
|
|
+ */
|
|
|
+ _self.picker.dispose();
|
|
|
+ _self.picker = null;
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ }, false);
|
|
|
+ });
|
|
|
+ })(mui);
|
|
|
+ </script>
|
|
|
+<script id="list_tpl" type="text/html">
|
|
|
+{{# if(d.list!=null && d.list.length > 0){ }}
|
|
|
+{{# for(var i = 0, len = d.list.length; i < len; i++){ }}
|
|
|
+<div class="list">
|
|
|
+ <p class="type">{{=d.list[i].details}}</p>
|
|
|
+ <p class="txt">孩子姓名:{{=d.list[i].child_name}}</p>
|
|
|
+ {{# if(d.list[i].invoice_state == 1) { }}
|
|
|
+ <p class="txt buy_fuwu_item_edit">订单金额:{{=d.list[i].price}} <span class="edit" >已开票</span></p>
|
|
|
+ {{# }else if(d.list[i].invoice_state == 2){ }}
|
|
|
+ <p class="txt buy_fuwu_item_edit">订单金额:{{=d.list[i].price}} <span class="edit" >开票中</span></p>
|
|
|
+ {{# }else{}}
|
|
|
+ <p class="txt buy_fuwu_item_edit">订单金额:{{=d.list[i].price}} <span class="edit" onclick="editFp('{{=d.list[i].id}}')" >申请开票<span class="arrow_right"></span></span></p>
|
|
|
+ {{# } }}
|
|
|
+ <p class="txt buy_fuwu_item_edit">购买时间:{{=d.list[i].create_time}}<span class="edit" onclick="editDetai('{{=d.list[i].id}}')" >详情<span class="arrow_right"></span></span></p>
|
|
|
+</div>
|
|
|
+{{# } }}
|
|
|
+{{# } }}
|
|
|
+</script>
|
|
|
+
|
|
|
+ <script type="text/javascript">
|
|
|
+ mui.init({
|
|
|
+ pullRefresh: {
|
|
|
+ container: '#pullrefresh',
|
|
|
+ up: {
|
|
|
+ contentrefresh: '正在加载...',
|
|
|
+ callback: pullupRefresh
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ var pageVal = 0;
|
|
|
+ var totalPage = 1;
|
|
|
+ var countVal = 10;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 上拉加载具体业务实现
|
|
|
+ */
|
|
|
+ function pullupRefresh() {
|
|
|
+ var dateStr = $("#dateStr").html();
|
|
|
+ setTimeout(function() {
|
|
|
+ mui('#pullrefresh').pullRefresh().endPullupToRefresh((pageVal++ > totalPage -1)); //参数为true代表没有更多数据了。
|
|
|
+
|
|
|
+
|
|
|
+ var paramVal = {pageNo:pageVal,pageSize:countVal,dateStr:dateStr};
|
|
|
+
|
|
|
+
|
|
|
+ loadData(paramVal);
|
|
|
+
|
|
|
+ }, 1000);
|
|
|
+ }
|
|
|
+
|
|
|
+ function showNew(){
|
|
|
+ pageVal = 1;
|
|
|
+ totalPage = 1;
|
|
|
+ countVal = 10;
|
|
|
+ var dateStr = $("#dateStr").html();
|
|
|
+ var paramVal = {pageNo:pageVal,pageSize:countVal,dateStr:dateStr};
|
|
|
+ loadData(paramVal);
|
|
|
+ }
|
|
|
+ mui.ready(function() {
|
|
|
+ mui('#pullrefresh').pullRefresh().pullupLoading();
|
|
|
+ });
|
|
|
+
|
|
|
+ function editDetai(id){
|
|
|
+ window.location.href = "[[${sysUrl}]]/weixin/adminsale/userServiceDetail.html?detailId="+id;
|
|
|
+ }
|
|
|
+ function editFp(id){
|
|
|
+ window.location.href = "[[${sysUrl}]]/weixin/adminsale/addInvoice.html?detailId="+id;
|
|
|
+ }
|
|
|
+ mui("body").on('tap','.list span',function(event){
|
|
|
+ this.click();
|
|
|
+ });
|
|
|
+ //加载数据
|
|
|
+ function loadData(params){
|
|
|
+ setTimeout(function () {
|
|
|
+ mui.ajax('[[@{/weixin/adminsale/userOrderList}]]',{
|
|
|
+ data:params,
|
|
|
+ dataType:'json',
|
|
|
+ type:'POST',
|
|
|
+ success:function(data){
|
|
|
+ if(data && data.code == 999){
|
|
|
+ if(data.data.totalSize > 0){
|
|
|
+ var table = document.getElementById("list")
|
|
|
+ var listTpl = document.getElementById("list_tpl").innerHTML;
|
|
|
+
|
|
|
+ if(data.data.pageNo == 1){
|
|
|
+ $("#showTotal").html("共"+data.data.totalSize+"条订单数据");
|
|
|
+ laytpl(listTpl).render(data.data, function(html){
|
|
|
+ table.innerHTML = html;
|
|
|
+ });
|
|
|
+ }else{
|
|
|
+ laytpl(listTpl).render(data.data, function(html){
|
|
|
+ table.insertAdjacentHTML('beforeEnd', html);
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ var rowCount = data.data.totalSize;
|
|
|
+
|
|
|
+ if ((rowCount % countVal) == 0) {
|
|
|
+ totalPage = rowCount / countVal;
|
|
|
+ } else {
|
|
|
+ totalPage = parseInt((rowCount / countVal)) + 1;
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+
|
|
|
+ }
|
|
|
+ },
|
|
|
+ error : function() {
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }, 200);
|
|
|
+ }
|
|
|
+ </script>
|
|
|
+</body>
|
|
|
+</html>
|