Display of small tourism projects
- The project adopts Vant UI as the UI of the project. The rapid prototyping interface, Vant's official address:
- https://vant-contrib.gitee.io/vant/#/zh-CN/home
- The front-end page is formed by Vue cli, and the back-end relies on Django and uses Api communication to complete it quickly
Front page display
Main page
Search page
My page
Other pages
Back end page display
PDManORM modeling
- system module
- sight module
- accounts module
- order module
Relation diagram
API interface
accounts module interface
####User login api
/account/user/api/login/
Parameter value | type | describe |
---|
username | Required | user name |
password | Required | password |
{
"user": {
"nickname": "Li Si",
"avatar": "http://localhost:8000/medias/avatar/202105/%E4%B8%BB%E4%BA%A7%E5%93%81.png",
"username": "17083430700"
},
"profile": {
"real_name": "ZRR",
"sex": 1,
"sex_display": "male"
}
}
User logout api
/account/user/api/logout/
- Return status code status=201
User registration api
/account/user/api/register/
- Request parameters (verification code interface required)
Parameter value | type | describe |
---|
username | Required | cell-phone number |
password | Required | password |
nickname | Required | nickname |
sms_code | Required | Verification Code |
{
"user": {
"nickname": "Zhang San",
"avatar": "",
"username": "17083430701"
},
"profile": {
"real_name": "",
"sex": 1,
"sex_display": "male"
}
}
User details api
/account/user/api/info/
{
"user": {
"nickname": "Zhang San",
"avatar": "",
"username": "17083430701"
},
"profile": {
"real_name": "",
"sex": 1,
"sex_display": "male"
}
}
system module interface
Rotation map api
/system/slider/list/
{
"meta": {},
"objects": [
{
"id": 1,
"img_url": "http://localhost:8000/medias/202105/slider/banner2.png",
"target_url": null,
"name": "Sinus doctor Temple"
},
{
"id": 2,
"img_url": "http://localhost:8000/medias/202105/slider/banner1.png",
"target_url": null,
"name": "Erlong mountain"
},
{
"id": 3,
"img_url": "http://localhost:8000/medias/202105/slider/banner3.png",
"target_url": null,
"name": "Juiwei mountain"
}
]
}
smsCodeapi
/system/send/sms/
Parameter value | type | describe |
---|
phone_num | Required | cell-phone number |
{
"phone_num": "17083430701",
"sms_code": 397702,
"timeout": 300
}
sight module interface
Attraction list api
/sight/sight/list/
Parameter value | type | describe |
---|
page | Optional filling | Page number |
is_hot | Optional filling | Is it popular |
is_top | Optional filling | Select or not |
name | Optional filling | name |
{
"meta": {
"total_count": 6,
"page_count": 2,
"current_page": 2
},
"objects": [
{
"id": 27,
"name": "yingze park ",
"main_img": "http://localhost:8000/medias/202105/sight/wKgE2l1bTouAHckxACFKt8kMMXs85.jpg",
"score": 5.0,
"city": "Taiyuan",
"min_price": 10.0,
"province": "Shanxi",
"comment_count": 0
}
]
}
redis list
/sight/sight/list/cache/
- Same as the attraction list api
Attraction details api
/sight/sight/detail/<int:pk>/
{
"id": 1,
"name": "Erlong mountain",
"desc": "Erlong mountain",
"img": "http://localhost:8000/medias/202105/sight/04f1842f6cea4753aebde62e9b680a97.jpg",
"score": 5.0,
"content": "<h1>Located in the northwest of Taiyuan, in the campus of Zhongbei University, the mountain is more than 100 meters high, with beautiful scenery, flowers blooming all over the mountain, and scenic spots such as beneficial foot path, love forest, pleasant platform, Longshan waterfall, love platform, corridor and large grass painting, which are built for work study students of Zhongbei University.</h1>\r\n\r\n<hr />\r\n<p><span class=\"marker\">traffic</span></p>\r\n\r\n<p>835 Zhongbei University Station</p>\r\n\r\n<p><span class=\"marker\">admission ticket</span></p>\r\n\r\n<p>Please consult the scenic spot for specific details</p>\r\n\r\n<p><span class=\"marker\">Opening Hours</span></p>\r\n\r\n<p>all day (1 January 1-12 Monday, March 31-Sunday)</p>\r\n\r\n<hr />\r\n<h2>Location of scenic spots</h2>\r\n\r\n<p>Shanglan village, Jiancaoping District, Taiyuan City, Shanxi Province (on the campus of Zhongbei University)</p>",
"province": "Shanxi",
"city": "Taiyuan",
"area": "Pointed lawn",
"town": "Shanglan Village",
"min_price": 10.0,
"comment_count": 1,
"image_count": 1
}
Attraction comment list api
/comment/list/<int:pk>/
Parameter value | type | describe |
---|
page | Optional filling | Page number |
{
"meta": {
"total_count": 1,
"page_count": 1,
"current_page": 1
},
"objects": [
{
"user": {
"pk": 2,
"nickname": "Li Si"
},
"pk": 2,
"content": "Erlong mountain, also known as Lieshi mountain, is close to Fenhe River in the West. The terrain is dangerous. It is the north gate of Taiyuan. During the war of liberation, Yan Xishan's army built a large number of military facilities on Lieshi mountain. Now there are three blockhouses and one underground passage. Erlong mountain, in the campus of Zhongbei University in the northwest corner of Taiyuan, is a rare scenic spot relying on the campus. The mountain is not too high, but the scenery is beautiful, with flowers all over the mountain and many scenic spots. Erlong mountain scenic spot in Taiyuan is one of the few summer resorts in Taiyuan.",
"love_count": 65,
"score": 5.0,
"is_public": 1,
"images": [
{
"img": "http://localhost:8000/medias/202105/file/c711f75cfc1f4f3d8c009bbb21919a2e.jpg",
"summary": "Erlongshan review"
},
{
"img": "http://localhost:8000/medias/202105/file/2427bc6964aa48b08ec3b6fc56de6552.jpg",
"summary": "Erlongshan review"
},
{
"img": "http://localhost:8000/medias/202105/file/019f654a568044a5ae091043923c378c.jpg",
"summary": "Erlongshan review"
}
],
"created_at": "2021-04-15"
}
]
}
Ticket list api under scenic spots
/ticket/list/<int:pk>/
Parameter value | type | describe |
---|
page | Optional filling | Page number |
{
"meta": {
"total_count": 1,
"page_count": 1,
"current_page": 1
},
"objects": [
{
"pk": 1,
"name": "Erlong mountain ticket",
"desc": "23:52 You can book tomorrow before tomorrow",
"types": 11,
"price": 10.0,
"discount": 10.0,
"total_stock": 100000,
"remain_stock": 99976,
"sell_price": 10.0
}
]
}
####Scenic spot introduction api
/sight/info/<int:pk>/
{
"pk": 1,
"entry_explain": "<h1>Located in the northwest of Taiyuan, in the campus of Zhongbei University, the mountain is more than 100 meters high, with beautiful scenery, flowers blooming all over the mountain, and scenic spots such as beneficial foot path, love forest, pleasant platform, Longshan waterfall, love platform, corridor and large grass painting, which are built for work study students of Zhongbei University.</h1>\r\n\r\n<hr />\r\n<p>traffic</p>\r\n\r\n<p>835 Zhongbei University Station</p>\r\n\r\n<p>admission ticket</p>\r\n\r\n<p>Please consult the scenic spot for specific details</p>\r\n\r\n<p>Opening Hours</p>\r\n\r\n<p>all day (1 January 1-12 Monday, March 31-Sunday)</p>\r\n\r\n<hr />\r\n<h2>Location of scenic spots</h2>\r\n\r\n<p>Shanglan village, Jiancaoping District, Taiyuan City, Shanxi Province (on the campus of Zhongbei University)</p>",
"play_way": "<h3>Erlong mountain, also known as Lieshi mountain, is close to Fenhe River in the West. The terrain is dangerous. It is the north gate of Taiyuan. During the war of liberation, Yan Xishan's army built a large number of military facilities on Lieshi mountain. Now there are three blockhouses and one underground passage. Erlong mountain, in the campus of Zhongbei University in the northwest corner of Taiyuan, is a rare scenic spot relying on the campus. The mountain is not too high, but the scenery is beautiful, with flowers all over the mountain and many scenic spots. Erlong mountain scenic spot in Taiyuan is one of the few summer resorts in Taiyuan.</h3>\r\n\r\n<p><img src=\"https://ss2.meipian.me/users/418550/2340c93ebce0477b82788c24318edabb.jpg?imageView2/2/w/750/h/1400/q/80\" /></p>\r\n\r\n<p><img src=\"https://ss2.meipian.me/users/418550/719ec2d7ebce4ac88f286ea863e243d7.jpg?imageView2/2/w/750/h/1400/q/80\" /></p>\r\n\r\n<p><img src=\"https://ss2.meipian.me/users/418550/9a7d9bb6b64d427d871efb3619d8bfd9.jpg?imageView2/2/w/750/h/1400/q/80\" /></p>\r\n\r\n<p><img src=\"https://ss2.meipian.me/users/418550/0b7568fc46794e778ac4204cfff7c403.jpg?imageView2/2/w/750/h/1400/q/80\" /></p>\r\n\r\n<p><img src=\"https://ss2.meipian.me/users/418550/887b1678c5c84c11a0fd34439abdb8ba.jpg?imageView2/2/w/750/h/1400/q/80\" /></p>\r\n\r\n<p><img src=\"https://ss2.meipian.me/users/418550/fb1d4c4aa4f94fe48f6a5f59f35e4c8d.jpg?imageView2/2/w/750/h/1400/q/80\" /></p>\r\n\r\n<p><img src=\"https://ss2.meipian.me/users/418550/0f48ef1e3f94444d86a871eafa69f47e.jpg?imageView2/2/w/750/h/1400/q/80\" /></p>\r\n\r\n<p><img src=\"https://ss2.meipian.me/users/418550/019f654a568044a5ae091043923c378c.jpg?imageView2/2/w/750/h/1400/q/80\" /></p>\r\n\r\n<p><img src=\"https://ss2.meipian.me/users/418550/2427bc6964aa48b08ec3b6fc56de6552.jpg?imageView2/2/w/750/h/1400/q/80\" /></p>\r\n\r\n<p><img src=\"https://ss2.meipian.me/users/418550/2ffe0923eedc4765888ce1ff6cda71a4.jpg?imageView2/2/w/750/h/1400/q/80\" /></p>\r\n\r\n<p><img src=\"https://ss2.meipian.me/users/418550/20c36e99210f41e9a3706d05e4ea6cc8.jpg?imageView2/2/w/750/h/1400/q/80\" /></p>\r\n\r\n<p><img src=\"https://ss2.meipian.me/users/418550/ed7886c77b0b42e3b7d7c32fe60805ef.jpg?imageView2/2/w/750/h/1400/q/80\" /></p>\r\n\r\n<p><img src=\"https://ss2.meipian.me/users/418550/c711f75cfc1f4f3d8c009bbb21919a2e.jpg?imageView2/2/w/750/h/1400/q/80\" /></p>\r\n\r\n<p><img src=\"https://ss2.meipian.me/users/418550/04f1842f6cea4753aebde62e9b680a97.jpg?imageView2/2/w/750/h/1400/q/80\" /></p>\r\n\r\n<p><img src=\"https://ss2.meipian.me/users/418550/12e2e1a4def4490dae87237799a55ee8.jpg?imageView2/2/w/750/h/1400/q/80\" /></p>\r\n\r\n<p><img src=\"https://ss2.meipian.me/users/418550/10651892dc234bc7b63dab3263dccf85.jpg?imageView2/2/w/750/h/1400/q/80\" /></p>\r\n\r\n<p><img src=\"https://ss2.meipian.me/users/418550/7b0c11d676f749478e827ca7b35d54ac.jpg?imageView2/2/w/750/h/1400/q/80\" /></p>\r\n\r\n<p><img src=\"https://ss2.meipian.me/users/418550/2f47940515ed4d06bcf4ecc29bbcffc4.jpg?imageView2/2/w/750/h/1400/q/80\" /></p>\r\n\r\n<p><img src=\"https://ss2.meipian.me/users/418550/32920e45f036419fa09a7c9c51cfbbd3.jpg?imageView2/2/w/750/h/1400/q/80\" /></p>\r\n\r\n<p><img src=\"https://ss2.meipian.me/users/418550/bef9359ad2354ef88a49453c02ced182.jpg?imageView2/2/w/750/h/1400/q/80\" /></p>\r\n\r\n<p><img src=\"https://ss2.meipian.me/users/418550/e64328fb06cf40d1b9288924f4af3dc8.jpg?imageView2/2/w/750/h/1400/q/80\" /></p>\r\n\r\n<p><img src=\"https://ss2.meipian.me/users/418550/f2f1c116018d43e59c5ed55f6940be7a.jpg?imageView2/2/w/750/h/1400/q/80\" /></p>\r\n\r\n<p><img src=\"https://ss2.meipian.me/users/418550/232bf0fa1d0d475c9704e8c29dc41147.jpg?imageView2/2/w/750/h/1400/q/80\" /></p>\r\n\r\n<p><img src=\"https://ss2.meipian.me/users/418550/6253aa30173e454bb78bb9f79756f191.jpg?imageView2/2/w/750/h/1400/q/80\" /></p>",
"tips": "<h4><strong>Tips </strong></h4>\r\n\r\n<p>traffic</p>\r\n\r\n<p>835 Zhongbei University Station</p>\r\n\r\n<p>admission ticket</p>\r\n\r\n<p>Please consult the scenic spot for specific details</p>\r\n\r\n<p>Opening Hours</p>\r\n\r\n<p>all day (1 January 1-12 Monday, March 31-Sunday)</p>",
"traffic": "<h2>Location of scenic spots</h2>\r\n\r\n<p>Shanglan village, Jiancaoping District, Taiyuan City, Shanxi Province (on the campus of Zhongbei University)</p>"
}
Scenic spot details picture list api
/sight/image/list/<int:pk>
Parameter value | type | describe |
---|
page | Optional filling | Page number |
{
"meta": {
"total_count": 1,
"page_count": 1,
"current_page": 1
},
"objects": [
{
"image": "http://localhost:8000/medias/202105/file/2ffe0923eedc4765888ce1ff6cda71a4.jpg",
"summary": "Erlong mountain Foundation"
}
]
}
Ticket details api
/sight/ticket/detail/<int:pk>
{
"pk": 1,
"name": "Erlong mountain ticket",
"desc": "23:52 You can book tomorrow before tomorrow",
"types": 11,
"price": 10.0,
"sell_price": 10.0,
"discount": 10.0,
"expire_date": 7,
"return_policy": "Contact administrator",
"has_invoice": true,
"entry_way": "SMS ticket exchange",
"tips": "<div>Located in the northwest of Taiyuan, in the campus of Zhongbei University, the mountain is more than 100 meters high, with beautiful scenery, flowers blooming all over the mountain, and scenic spots such as beneficial foot path, love forest, pleasant platform, Longshan waterfall, love platform, corridor and large grass painting, which are built for work study students of Zhongbei University.</div>\r\n\r\n<hr />\r\n<p>traffic</p>\r\n\r\n<p>835 Zhongbei University Station</p>\r\n\r\n<p>admission ticket</p>\r\n\r\n<p>Please consult the scenic spot for specific details</p>\r\n\r\n<p>Opening Hours</p>\r\n\r\n<p>all day (1 January 1-12 Monday, March 31-Sunday)</p>\r\n\r\n<hr />\r\n<h2>Location of scenic spots</h2>\r\n\r\n<p>Shanglan village, Jiancaoping District, Taiyuan City, Shanxi Province (on the campus of Zhongbei University)</p>",
"remark": "<p>There are no small here<span class=\"marker\">tips</span></p>"
}
order module interface
Order submission api
/order/ticket/submit/
Parameter value | type | describe |
---|
ticket_id | Required | Ticket ID |
play_date | Required | Travel time |
to_user | Required | User nickname |
to_phone | Required | User mobile number |
buy_count | Required | Total purchase price |
{
"sn": "202105171247379691779086"
}
####Order details api
/order/order/detail/<int:sn>
{
"sn": "202105171247379691779086",
"buy_count": 20,
"buy_amount": 200.0,
"types": 10,
"status": 11,
"created_at": "2021-05-17",
"remark": null,
"to_user": "Li Si",
"to_area": "",
"to_address": "",
"to_phone": "17083430700",
"express_type": null,
"express_no": null,
"items": [
{
"pk": 21,
"flash_name": "Erlong mountain ticket",
"flash_price": 10.0,
"flash_img": "http://localhost:8000/medias/202105/sight/7b0c11d676f749478e827ca7b35d54ac.jpg",
"flash_origin_price": 10.0,
"flash_discount": 10.0,
"count": 20,
"amount": 200.0,
"remark": "Travel time 2021-05-20",
"object_id": 1,
"app_label": "sight",
"model": "ticket"
}
]
}
Order list
/order/order/list/
Parameter value | type | describe |
---|
page | Optional filling | describe |
{
"meta": {
"total_count": 1,
"page_count": 1,
"current_page": 1
},
"objects": [
{
"sn": "202105171247379691779086",
"buy_amount": 200.0,
"buy_count": 20,
"types": 10,
"status": 11,
"remark": null,
"created_at": "2021-05-17",
"item_first": {
"pk": 21,
"flash_name": "Erlong mountain ticket",
"flash_price": 10.0,
"flash_img": "http://localhost:8000/medias/202105/sight/7b0c11d676f749478e827ca7b35d54ac.jpg",
"flash_origin_price": 10.0,
"flash_discount": 10.0,
"count": 20,
"amount": 200.0,
"remark": "Travel time 2021-05-20",
"object_id": 1,
"app_label": "sight",
"model": "ticket"
}
}
]
}
Global status Code
status | Code | describe |
---|
404 | 4004000 | The content you accessed does not exist or has been deleted |
400 | 4000000 | parameter format not correct |
405 | 4050000 | Form request method error |
401 | 4010000 | Please login |
500 | 5000000 | The server is busy, please try again later |