-
Notifications
You must be signed in to change notification settings - Fork 28
/
order.html
273 lines (269 loc) · 7.41 KB
/
order.html
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
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
<!DOCTYPE html>
<html>
<head>
<title>华为商城</title>
<meta charset="UTF-8" />
<link rel="stylesheet" type="text/css" href="static/css/normalize.css" />
<link rel="stylesheet" type="text/css" href="static/css/public.css" />
<link rel="stylesheet" type="text/css" href="static/css/swiper.min.css">
<link rel="stylesheet" type="text/css" href="static/css/elementui.css" />
<link rel="shortcut icon" href="favicon.ico">
<script src="static/js/jquery-3.1.1.min.js" type="text/javascript" charset="utf-8"></script>
<script src="static/js/swiper.min.js" type="text/javascript" charset="utf-8"></script>
<script src="static/js/vue.js"></script>
<script src="static/js/elementui.js" type="text/javascript" charset="utf-8"></script>
</head>
<body>
<div id="pdetail">
<!-- <div id="" class="top_gg">
<a href="">
<img src="static/image/top_gg.jpg" />
</a>
</div> -->
<div id="" class="shortcut">
<div class="layout">
<div class="s-sub">
<ul>
<li>
<a href="index.html">首页</a>
</li>
<li>
<a href="systemInfo.html">商城简介</a>
</li>
<!-- <li>
<a href="">帮助中心 用户反馈</a>
</li> -->
<li>
<a href="baoxiu.html">保修政策</a>
</li>
<li>
<a href="problem.html">热门问题</a>
</li>
</ul>
</div>
<div class="s-right">
<ul>
<li>
<a href="index.html" v-if="!userInfo.userName">未登录</a>
<a href="userInfo.html" v-else>{{userInfo.userName}}</a>
</li>
<!-- <li v-if="userInfo.userName">
<a href="javascript:void(0)">积分:{{userInfo.jifen}}</a>
</li> -->
<!--<li>
<a href="javascript:void(0)" @click="dialogFormVisible = true">注册</a>
</li>-->
<li>
<a href="javascript:void(0)" @click="car">| 购物车</a>
</li>
<li>
<a href="javascript:void(0)">| 订单</a>
</li>
</ul>
</div>
</div>
</div>
<!--header-->
<div class="header">
<div id="" class="layout">
<div class="left">
<div class="logo">
<img src="static/image/logo.png" />
</div>
<div class="naver">
<ul id="naver-list">
<li id="huawei" class="">
<a href="ry.html" target="_blank">
<span>荣耀</span>
</a>
</li>
<li id="huawei" class="">
<a href="p.html" target="_blank">
<span>HUAWEI P系列</span>
</a>
</li>
<li id="honor" class="">
<a href="rycw.html" target="_blank">
<span>华为畅享系列</span>
</a>
</li>
<li id="honor" class="">
<a href="mate.html" target="_blank">
<span>HUAWEI Mate系列</span>
</a>
</li>
<li id="honor" class="">
<a href="nova.html" target="_blank">
<span>HUAWEI nova系列</span>
</a>
</li>
</ul>
</div>
</div>
<!--导航右边部分-->
<div class="right">
<input type="text" v-model="searchVal" placeholder="荣耀10降价" class="search-text">
<el-button class="search-btn" icon="el-icon-search" @click="onsearchVal" style="padding: 12.5px;"
circle></el-button>
<!-- <input type="submit" class="search-btn" @click="onsearchVal" value="搜索"> -->
</div>
</div>
</div>
<div id="car-table" class="layout">
<p style="color:#666"><a href="index.html" style="color:#666">首页</a> > 订单</p>
<!-- <table border cellspacing="0" v-if="jsonData.length">
<tr>
<th>主图</th>
<th>手机名称</th>
<th>价格</th>
<th>简介</th>
<th>操作</th>
</tr>
<tr v-for="(item,index) in jsonData" :key="index">
<td><img :src="'sas/upload/'+item.img" alt="" srcset=""> </td>
<td>{{item.name}}</td>
<td>{{item.price}}</td>
<td>{{item.jianJie}}</td>
<td class="table-delete" @click="delet(item.id)">删除</td>
</tr>
</table> -->
<el-table :data="jsonData" style="width: 100%">
<el-table-column label="主图" width="90">
<template slot-scope="scope">
<a :href="`detail.html?id=${scope.row.id}`">
<img :src="'sas/upload/'+scope.row.img" alt=""></a>
</template>
</el-table-column>
<el-table-column prop="p_name" label="手机名称" width="100">
</el-table-column>
<el-table-column prop="shifu" label="实付">
</el-table-column>
<el-table-column prop="jianJie" label="简介">
</el-table-column>
<el-table-column prop="p_version" label="版本">
</el-table-column>
<el-table-column prop="p_color" label="颜色">
</el-table-column>
<el-table-column prop="orderDate" label="下单时间">
</el-table-column>
<el-table-column prop="orderCode" label="订单编号">
</el-table-column>
<!-- <el-table-column
prop="my_address"
label="收货地址">
</el-table-column>
<el-table-column
prop="user_name"
label="收货人">
</el-table-column>
<el-table-column
prop="user_mobile"
label="手机号">
</el-table-column> -->
<el-table-column label="操作" width="100">
<template slot-scope="scope">
<a href="javascript:void(0)" style="color:#1989fa" @click="delet(scope.row.id)">删除</a>
</template>
</el-table-column>
</el-table>
</div>
<!--底部footer版权-->
<div id="footer">
<div class="foot">
<!--<p class="foot_logo"><img src="static/image/flogo.png" /></p>-->
<p class="">Designed and developed by chenwei huo.<br /> Copyright © 2010-2019 chenwei.com. All Rights Reserved.</p>
<p class=""></p>
</div>
</div>
</div>
</body>
<script type="text/javascript">
// 注册
Vue.component('my-component', {});
var WEITUOSERVER = new Vue({
el: '#pdetail',
data: {
jsonData: [],
dialogTableVisible: false,
dialogFormVisible: false,
searchVal:"",
pid: "",
radio_color: "1",
radio_v: "1",
userInfo: JSON.parse(window.sessionStorage.user),
},
created() {
this.gatData();
},
methods: {
gatData() {
var that = this;
$.ajax({
type: "GET",
url: "php/order.php",
data: { "userId": JSON.parse(window.sessionStorage.user).userId },
dataType: "json",
success: function (data) {
that.jsonData = data.data;
},
});
},
delet(id) {
var that = this;
$.ajax({
type: "GET",
url: "php/order.php",
data: { "pid": id, "del": "del" },
dataType: "json",
success: function (data) {
that.$message({
message: "删除成功",
type: 'success'
});
that.gatData();
},
error: function (data) {
console.log(data.responseText)
that.$message({
message: data.responseText,
type: 'success'
});
window.location.reload();
}
});
},
xiadan() {
this.$message({
message: '恭喜你,下单成功',
type: 'success'
});
},
addCar() {
var user = window.sessionStorage.user ? JSON.parse(window.sessionStorage.user) : "";
if (!!user) {
} else {
this.$message({
message: '请先登录',
type: 'warning'
});
}
},
car() {
if (window.sessionStorage.user) {
window.location.href = "car.html"
} else {
this.$message({
message: '请先登录',
type: 'warning'
});
}
},
// 搜索
onsearchVal() {
var arg = encodeURI(encodeURI(this.searchVal));
window.location.href = "index_search.html?arg=" + arg;
},
}
})
</script>
</html>