Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
L
Lesson49
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
2
Issues
2
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Пасько Виталий
Lesson49
Commits
36b278bd
Commit
36b278bd
authored
Aug 31, 2022
by
Пасько Виталий
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- поправил скрипт на странице кабинета пользователя.
parent
7b80aff7
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
23 deletions
+18
-23
Index.cshtml
PhoneStore/Views/PersonalArea/Index.cshtml
+18
-23
No files found.
PhoneStore/Views/PersonalArea/Index.cshtml
View file @
36b278bd
...
@@ -41,33 +41,28 @@
...
@@ -41,33 +41,28 @@
{
{
<script >
<script >
$('.tab-pane').click(function (e){
$('.tab-pane').click(
async
function (e){
e.preventDefault();
e.preventDefault();
let userId = $('h2').attr('userId');
let userId = $('h2').attr('userId');
fetch("https://localhost:5001/Orders/GetAllByUserId/" + userId)
.then((response) => {
let resp = await fetch("https://localhost:5001/Orders/GetAllByUserId/" + userId);
return response.json();
if (resp.ok){
})
.then((orders) => {
if (orders.length === 0){
$(this).html('<h3>Заказов нет</h3>');
}
else{
let content;
let content;
$.each(orders, (order) => {
let orders = await resp.json();
$.each( orders, (i) => {
content += `<tr>
content += `<tr>
<td>order.id
</td>
<td>${orders[i].userId}
</td>
<td>order.address
</td>
<td>${orders[i].address}
</td>
<td>order.contactPhone
</td>
<td>${orders[i].contactPhone}
</td>
<td>order.user.Name
</td>
<td>${orders[i].user.name}
</td>
<td>order.phone.Name
</td>
<td>${orders[i].phone.name}
</td>
</tr>`
</tr>`
});
});
$('#orders').html(content);
$('#orders').html(content);
}else{
alert("Ошибка HTTP: " + response.status);
}
}
});
});
});
let makeTabs = function (){
let makeTabs = function (){
let tabs = $(".tabs").find(".tab-items a");
let tabs = $(".tabs").find(".tab-items a");
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment