{"id":68964,"student_id":10,"content":"{\"html\":\"\u003c!DOCTYPE html\u003e\\n\u003chtml\u003e\\n\u003chead\u003e\\n\\t\u003ctitle\u003eDocument\u003c/title\u003e\\n\\t\u003cscript src=\\\"https://code.jquery.com/jquery-3.4.1.min.js\\\"\u003e\u003c/script\u003e\\n\u003c/head\u003e\\n\u003cbody\u003e\\n \u003cbutton id=\\\"front-btn\\\"\u003e前台\u003c/button\u003e\\n \u003cbutton id=\\\"admin-btn\\\"\u003e後台\u003c/button\u003e\\n \\n \\n \u003cdiv id=\\\"front\\\"\u003e\\n \u003ch1\u003e叩叩購物平台\u003c/h1\u003e\\n \u003cdiv\u003e\\n \u003ch2\u003e商品A - 玩具車車\u003c/h2\u003e\\n \u003cp\u003e$ 500 NTD\u003c/p\u003e\\n \u003cbutton id=\\\"buy-btn-a\\\"\u003e購買\u003c/button\u003e\\n \u003c/div\u003e\\n \\n \u003cdiv\u003e\\n \u003ch2\u003e商品B - 超酷炫鉛筆\u003c/h2\u003e\\n \u003cp\u003e$ 300 NTD\u003c/p\u003e\\n \u003cbutton id=\\\"buy-btn-b\\\"\u003e購買\u003c/button\u003e\\n \u003c/div\u003e\\n \\n \u003cdiv\u003e\\n \u003ch2\u003e商品C - 無敵鐵金剛\u003c/h2\u003e\\n \u003cp\u003e$ 1200 NTD\u003c/p\u003e\\n \u003cbutton id=\\\"buy-btn-c\\\"\u003e購買\u003c/button\u003e\\n \u003c/div\u003e\\n \\n \u003cbutton id=\\\"search\\\"\u003e訂單查詢\u003c/button\u003e\\n \u003ctable\u003e\\n \u003cthead\u003e\\n \u003ctr\u003e\\n \u003cth\u003e訂單編號\u003c/th\u003e\\n \u003cth\u003e商品名稱\u003c/th\u003e\\n \u003cth\u003e商品數量\u003c/th\u003e\\n \u003cth\u003e訂單總價\u003c/th\u003e\\n \u003cth\u003e聯絡電話\u003c/th\u003e\\n \u003cth\u003e運送地址\u003c/th\u003e\\n \u003cth\u003e狀態\u003c/th\u003e\\n \u003c/tr\u003e\\n \u003c/thead\u003e\\n \u003ctbody\u003e\u003c/tbody\u003e\\n \u003c/table\u003e\\n \u003c/div\u003e\\n\\n \u003cdiv id=\\\"admin\\\"\u003e\\n \u003ch1\u003e訂單後台\u003c/h1\u003e\\n \u003cbutton id=\\\"updateAdminTable\\\"\u003e更新列表\u003c/button\u003e\\n \u003ctable\u003e\\n \u003cthead\u003e\\n \u003ctr\u003e\\n \u003cth\u003e訂單編號\u003c/th\u003e\\n \u003cth\u003e商品名稱\u003c/th\u003e\\n \u003cth\u003e商品數量\u003c/th\u003e\\n \u003cth\u003e訂單總價\u003c/th\u003e\\n \u003cth\u003e聯絡電話\u003c/th\u003e\\n \u003cth\u003e運送地址\u003c/th\u003e\\n \u003cth\u003e狀態\u003c/th\u003e\\n \u003c/tr\u003e\\n \u003c/thead\u003e\\n \u003ctbody\u003e\u003c/tbody\u003e\\n \u003c/table\u003e\\n \u003c/div\u003e\\n\u003c/body\u003e\\n\u003c/html\u003e\",\"css\":\"#admin {\\n display: none;\\n}\",\"js\":\"var order = DB.table('order');\\n\\n$('#front-btn').click(function () {\\n $('#front').show();\\n $('#admin').hide();\\n});\\n\\n$('#admin-btn').click(function () {\\n $('#front').hide();\\n $('#admin').show();\\n});\\n\\n$('#admin table').on('click', '.updateState', updateState);\\n\\n$('#search').click(search);\\n$('#updateAdminTable').click(showAllorders);\\n\\n$('#buy-btn-a').click(function () {\\n buy('商品A - 玩具車車', 500); \\n});\\n\\n$('#buy-btn-b').click(function () {\\n buy('商品B - 超酷炫鉛', 300); \\n});\\n\\n$('#buy-btn-c').click(function () {\\n buy('商品C - 無敵鐵金剛', 1200); \\n});\\n\\nfunction buy (item, cost) {\\n var count = Number(prompt('購買數量?'));\\n var phone = prompt('聯絡電話?');\\n var address = prompt('運送地址?');\\n\\n var text = `\\n 請確認以下資訊\\n 您購買${item}商品${count}個,總計${cost*count}元\\n 聯絡電話: ${phone}\\n 運送地址: ${address}\\n `\\n if (confirm(text)) {\\n order.create({\\n item: item,\\n count: count,\\n price: cost*count,\\n phone: phone,\\n address: address,\\n status: '處理中' // 處理中 -\u003e 出貨中 -\u003e 配送 -\u003e 已送達門市\\n });\\n } else {\\n alert('放棄訂單!');\\n }\\n}\\n\\nfunction showAllorders () {\\n order.find({}, function (data) {\\n $('#admin tbody').empty();\\n for (var i=0; i\u003cdata.length; i++) {\\n var d = data[i];\\n var o = `\\n \u003ctr\u003e\\n \u003ctd class=\\\"id\\\"\u003e${d.id}\u003c/td\u003e\\n \u003ctd\u003e${d.item}\u003c/td\u003e\\n \u003ctd\u003e${d.count}\u003c/td\u003e\\n \u003ctd\u003e${d.price}\u003c/td\u003e\\n \u003ctd\u003e${d.phone}\u003c/td\u003e\\n \u003ctd\u003e${d.address}\u003c/td\u003e\\n \u003ctd class=\\\"updateState\\\"\u003e${d.status}\u003c/td\u003e\\n \u003c/tr\u003e\\n `\\n $('#admin tbody').append(o);\\n }\\n });\\n}\\n\\nfunction search () {\\n var phone = prompt('電話號碼');\\n order.find({ phone: phone }, function (data) {\\n $('#front tbody').empty();\\n for (var i=0; i\u003cdata.length; i++) {\\n var d = data[i];\\n var o = `\\n \u003ctr\u003e\\n \u003ctd\u003e${d.id}\u003c/td\u003e\\n \u003ctd\u003e${d.item}\u003c/td\u003e\\n \u003ctd\u003e${d.count}\u003c/td\u003e\\n \u003ctd\u003e${d.price}\u003c/td\u003e\\n \u003ctd\u003e${d.phone}\u003c/td\u003e\\n \u003ctd\u003e${d.address}\u003c/td\u003e\\n \u003ctd\u003e${d.status}\u003c/td\u003e\\n \u003c/tr\u003e\\n `\\n $('#front tbody').append(o);\\n }\\n });\\n}\\n\\nfunction updateState () {\\n var status = $(this).text();\\n var id = $(this).parent().find('.id').text();\\n \\n if (status == '處理中') status = '出貨中';\\n else if (status == '出貨中') status = '配送中';\\n else if (status == '配送中') status = '已送達門市';\\n else status = '處理中';\\n \\n order.update({ id: id }, { status: status });\\n showAllorders();\\n}\\n\"}","created_at":"2019-05-22T17:25:57.328+08:00","updated_at":"2019-11-05T11:35:04.164+08:00","name":"購物大平台","language":"web","screenshot":{"url":"/uploads/project/screenshot/68964/6d1c963b6544b0e75b37164c0ef1663f.jpg"},"parent_id":3,"plugin":"","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":596,"hashid":"meys5yn4","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[]
Orange Apple Learning Platform
My Projects
View Project Page
Export
Remix
Import
Delete
Download Android APP (APK)
Screenshot
Open Web Site
繁中
简中
English
日本語
1:1:1
1:1
Full Width
Scan the QRCode below with your phone to install
Or you can
download APK
to this computer
Scan the QRCode below with your phone to install
Or you can
download APK
to this computer