index.html
4.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
<html ng-app="myApp">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题</title>
<link rel="stylesheet" type="text/css" href="../spm_modules/bootstrap-css/1.0.0/bootstrap.css">
<link href="../spm_modules/xn-icon-common/1.0.0/iconfont.css" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="./base.css">
<link rel="stylesheet" type="text/css" href="../directive/style.css">
<link rel="stylesheet" type="text/css" href="../spm_modules/xn-directive-img/0.2.2/directive/style.css">
<script type="text/javascript" src="../spm_modules/jquery/1.7.2/jquery.js"></script>
<script type="text/javascript" src="../spm_modules/xn-angular/1.0.0/angular.js"></script>
<script type="text/javascript" src="../spm_modules/angular-ui/1.0.0/bootstraptpls.js"></script>
<script type="text/javascript" src="../spm_modules/xn-filter-common/1.0.0/filter/commons.js"></script>
<script type="text/javascript" src="../spm_modules/xn-service-common/1.0.0/service/commons.js"></script>
<script type="text/javascript" src="../spm_modules/xn-service-foundation/1.0.0/service/foundations.js"></script>
<script type="text/javascript" src="../spm_modules/xn-directive-img/0.2.2/directive/imgdisk.js"></script>
<script type="text/javascript" src="../directive/positions.js"></script>
</head>
<body ng-controller="MyController">
{{logistics}}
<div ng-repeat="log1 in logistics.items">{{log1}}</div>
<!--电子订单打印模板 从外面传入需要的字段-->
<div class="auto xn-width clearfix" style="width: 1000px ;margin:20px auto">
<div typesetting ng-model="logistics" data-logistics-old="logisticsOld"
data-create-method="doCreate(data)"
data-edit-method="doEdit(data)"
data-delete-method="doDelete(data)"
></div>
</div>
<div class=""></div>
<!--查看-->
<div class="auto xn-width clearfix" style="width: 1000px ;margin:20px auto">
<div typesetting-view ng-model="logisticsView" data-edit-method="doEdit(data)" ></div>
</div>
<button ng-click="doSave()">保存</button>
</body>
<script type="text/javascript">
angular.module("myApp", ["ng","xn.directive.positions","xn.directive.imgDisk","xn.service.common"])
.controller("MyController", ["$scope","$timeout","toolsService", function($scope,$timeout,toolsService){
$scope.logistics={};
$timeout(function(){
$scope.logisticsOld={
pictureId:"",
pictureUrl:"http://img-dev.xiniunet.com/762931939895545856/762931940382085120/828834243844378624.jpg",
items:[
{id:"item"+new Date().getTime(),"value":"1","offsetX":10,"offsetY":10 ,"rotate":0,"width":64,"height":64},
{id:"item"+new Date().getTime(),"value":"2","offsetX":20,"offsetY":70 ,"rotate":0,"width":64,"height":64},
{id:"item"+new Date().getTime(),"value":"3","offsetX":80,"offsetY":120 ,"rotate":0,"width":64,"height":64}
]
};
$scope.logisticsView={
pictureId:"",
pictureUrl:"http://img-dev.xiniunet.com/762931939895545856/762931940382085120/828834243844378624.jpg",
items:[
{id:"item"+new Date().getTime(),"value":"1","offsetX":10,"offsetY":10 ,"rotate":0,"width":64,"height":64},
{id:"item"+new Date().getTime(),"value":"2","offsetX":20,"offsetY":70 ,"rotate":0,"width":64,"height":64},
{id:"item"+new Date().getTime(),"value":"3","offsetX":80,"offsetY":120 ,"rotate":0,"width":64,"height":64}
]
}
},1000);
$scope.doCreate=function(deferred){
console.log(deferred);
console.log(3333333333);
$timeout(function () {
deferred.deferred.resolve({id:"11111111111111111"});
},1000);
};
$scope.doEdit=function(data){
console.log(11111111111);
console.log(data);
}
$scope.doDelete=function(data){
console.log(222222222);
console.log(data);
}
$scope.doSave=function(){
}
}]);
</script>
</html>