shop_address.html
6.3 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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0;" name="viewport" />
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>学考无忧-收货地址</title>
<link rel="stylesheet" href="__TMPL__/public/assets/css/reset.css">
<link rel="stylesheet" href="__TMPL__/public/assets/css/base.css">
<link rel="stylesheet" href="__TMPL__/public/assets/css/log.css">
<style>
.tx_mask_delete {
display: none;
z-index: 2;
width: 100%;
height: 100%;
position: fixed;
background-color: rgba(0, 0, 0, 0.5);
}
.delete_school {
font-size: 0.32rem;
color: #333;
text-align: center;
}
.delete_btn {
display: flex;
display: -webkit-flex;
justify-content: space-around;
align-items: center;
}
.tx_maskcancel {
width: 100%;
height: 0.8rem;
background: #f2f2f2;
border-radius: 0.08rem;
text-align: center;
line-height: 0.8rem;
color: #333;
font-size: 0.32rem;
margin-top: 0.4rem;
margin-right: 0.5rem;
}
.tx_maskYes {
width: 100%;
height: 0.8rem;
background: linear-gradient(338deg, rgba(255, 78, 0, 1) 0%, rgba(255, 157, 45, 1) 100%);
border-radius: 0.08rem;
text-align: center;
line-height: 0.8rem;
color: white;
font-size: 0.32rem;
margin-top: 0.4rem;
margin-left: 0.5rem;
}
</style>
</head>
<body style="background-color:white;">
<div class="address_box">
<!-- 删除弹窗 -->
<div class="tx_mask_delete" onclick="$(this).hide()">
<div class="tx_maskCon" onclick="zZFun(this)">
<div class="tx_maskCon2" style="border-radius: 0.1rem;">
<div class="delete_school">
是否确定删除?
</div>
<div class="delete_btn">
<div class="tx_maskcancel">取消</div>
<div class="tx_maskYes">确定</div>
</div>
</div>
</div>
</div>
<!-- 顶部 -->
<div class="ad_top">
<a href="javascript:history.back(-1)">
<img class="ad_topImg" src="__TMPL__/public/assets/images/left.png" alt="">
</a>
<h1>收货地址</h1>
<a href="{:url('Personalcenter/add_shop_address')}">
<p>新增地址</p>
</a>
</div>
<!-- 内容 -->
<div class="ad_content">
<ul id="ad_contentUl">
<volist name="data" id="vo">
<li ontouchstart="fors()" class="com">
<div class="ad_conBox">
<div class="ad_con1">
<p class="ad_conName">{$vo.name}</p>
<if condition="$vo.default_address eq 1">
<p class="ad_conMo" style="display:block;">默认</p>
<else/>
<p class="ad_conMo">默认</p>
</if>
<p class="ad_conPhone">{$vo.phone}</p>
<img class="ad_conImg" src="__TMPL__/public/assets/images/35.png" ontouchstart="address_edit({$vo.id})" alt="">
</div>
</div>
<div class="jiantou" style="display: flex;display: -webkit-flex;justify-content: space-between;align-items: center">
<div class="jiantou_title"><p class="ad_conAddress">收货地址:{$vo.region}{$vo.detailed}</p></div>
<div class="jiantou_img" style="margin-top: 0.15rem;"><img class="ad_conImg" src="__TMPL__/public/assets/images/zuojiantou.png" alt=""></div>
</div>
<div class="ad_MoRemove">
<div class="ad_mo" ontouchstart="set_default({$vo.id})">设为默认</div>
<!--<div class="ad_move" ontouchstart="address_del({$vo.id})">删除</div>-->
<div class="ad_move" ontouchstart="fun(this)" data-id="{$vo.id}">删除</div>
</div>
</li>
</volist>
</ul>
</div>
</div>
<script src="__TMPL__/public/assets/js/base.js"></script>
<script src="__TMPL__/public/assets/js/address.js"></script>
<script src="__TMPL__/public/assets/js/jquery.js"></script>
<script>
function fors() {
console.log(111)
}
/**
*点击设置默认
*/
function set_default(id){
$.post("{:url('Personalcenter/set_default_address')}",{id:id},function(data){
if(data){
}else{
alert('设置失败!');
}
});
}
/**
* 点击删除地址
*/
var id;
function address_del(id){
$.post("{:url('Personalcenter/address_del')}",{id:id},function(data){
if(data){
}else{
alert('删除失败!');
}
});
}
//删除
let index = ''
function fun(e){
console.log(e)
id=$(e).attr("data-id");
console.log(id)
index = $(e).parents(".com").index();
console.log(index)
$(".tx_mask_delete").css({
display: "block"
});
};
$(".tx_maskYes").click(function() {
console.log(index)
var len = $(".com");
console.log(len)
for(var i = 0; i < len.length; i++) {
if(i == index) {
$(len[i]).remove()
};
$(".tx_mask_delete").css({
display: "none"
});
}
address_del(id)
})
$(".tx_maskcancel").click(function() {
$(".tx_mask_delete").css({
display: "none"
});
})
function zZFun(e) {
window.event ? (window.event.cancelBubble = true) : e.stopPropagation();
}
/**
*编辑地址
*/
function address_edit(id){
window.location.href = "{:url('Personalcenter/address_edit')}?id="+id;
}
</script>
</body>
</html>