├── cart ├── __init__.py ├── migrations │ ├── __init__.py │ ├── __init__.pyc │ └── 0001_initial.pyc ├── urls.pyc ├── admin.pyc ├── models.pyc ├── views.pyc ├── __init__.pyc ├── tests.py ├── urls.py ├── admin.py ├── views.py └── models.py ├── detail ├── __init__.py ├── migrations │ ├── __init__.py │ ├── __init__.pyc │ └── 0001_initial.pyc ├── admin.pyc ├── urls.pyc ├── views.pyc ├── models.pyc ├── tests.py ├── __init__.pyc ├── admin.py ├── urls.py ├── views.py └── models.py ├── index ├── __init__.py ├── migrations │ ├── __init__.py │ ├── __init__.pyc │ ├── 0001_initial.pyc │ └── 0001_initial.py ├── admin.pyc ├── models.pyc ├── urls.pyc ├── views.pyc ├── __init__.pyc ├── tests.py ├── viewSearch.pyc ├── search_indexes.pyc ├── search_indexes.py ├── admin.py ├── urls.py ├── viewSearch.py ├── views.py └── models.py ├── order ├── __init__.py ├── migrations │ ├── __init__.py │ ├── __init__.pyc │ └── 0001_initial.pyc ├── admin.pyc ├── models.pyc ├── urls.pyc ├── views.pyc ├── __init__.pyc ├── tests.py ├── admin.py ├── urls.py ├── views.py └── models.py ├── shop ├── __init__.py ├── urls.pyc ├── wsgi.pyc ├── __init__.pyc ├── settings.pyc ├── wsgi.py ├── urls.py └── settings.py ├── static ├── js │ ├── yz.js │ ├── detail.js │ ├── jquery.fly.min.js │ ├── slide.js │ ├── changekw.js │ ├── register.js │ ├── jquery.cookie.js │ └── jquery.easing.min.js ├── images │ ├── adv01.jpg │ ├── adv02.jpg │ ├── down.png │ ├── fruit.jpg │ ├── goods.jpg │ ├── icons.png │ ├── logo.png │ ├── slide.jpg │ ├── banner01.jpg │ ├── banner02.jpg │ ├── banner03.jpg │ ├── banner04.jpg │ ├── banner05.jpg │ ├── banner06.jpg │ ├── goods02.jpg │ ├── icons02.png │ ├── left_bg.jpg │ ├── logo02.png │ ├── ly-plate.png │ ├── slide02.jpg │ ├── slide03.jpg │ ├── slide04.jpg │ ├── pay_icons.png │ ├── shop_cart.png │ ├── goods_detail.jpg │ ├── interval_line.png │ ├── login_banner.png │ ├── rotate-static.png │ ├── goods │ │ ├── goods001.jpg │ │ ├── goods002.jpg │ │ ├── goods003.jpg │ │ ├── goods004.jpg │ │ ├── goods005.jpg │ │ ├── goods006.jpg │ │ ├── goods007.jpg │ │ ├── goods008.jpg │ │ ├── goods009.jpg │ │ ├── goods010.jpg │ │ ├── goods011.jpg │ │ ├── goods012.jpg │ │ ├── goods013.jpg │ │ ├── goods014.jpg │ │ ├── goods015.jpg │ │ ├── goods016.jpg │ │ ├── goods017.jpg │ │ ├── goods018.jpg │ │ ├── goods019.jpg │ │ ├── goods020.jpg │ │ └── goods021.jpg │ └── register_banner.png ├── uploads │ ├── goods.jpg │ ├── goods02.jpg │ ├── rou_2.jpg │ ├── rou_3.jpg │ ├── rou_4.jpg │ ├── rou_5.jpg │ ├── rou_6.jpg │ ├── rou_7.jpg │ ├── banner01.jpg │ ├── banner02.jpg │ ├── banner03.jpg │ ├── banner04.jpg │ ├── banner05.jpg │ ├── banner06.jpg │ ├── goods001.jpg │ ├── goods002.jpg │ ├── goods003.jpg │ ├── goods004.jpg │ ├── goods005.jpg │ ├── goods006.jpg │ ├── goods007.jpg │ ├── goods008.jpg │ ├── goods010.jpg │ ├── goods011.jpg │ ├── goods012.jpg │ ├── goods013.jpg │ ├── goods017.jpg │ ├── goods018.jpg │ ├── goods019.jpg │ ├── goods020.jpg │ ├── goods021.jpg │ ├── shucai_1.jpg │ ├── shucai_2.jpg │ ├── shucai_3.jpg │ ├── shucai_4.jpg │ ├── shucai_5.jpg │ ├── shucai_6.jpg │ ├── sudong_1.jpg │ ├── sudong_2.jpg │ ├── sudong_3.jpg │ ├── sudong_4.jpg │ ├── sudong_5.jpg │ ├── sudong_6.jpg │ ├── goods_detail.jpg │ ├── goods_qd01.jpg │ ├── goods_qd02.jpg │ ├── goods_qd03.jpg │ ├── goods_qd04.jpg │ ├── goods_qd05.jpg │ ├── goods_qd06.jpg │ ├── goods-haishen.jpg │ ├── goods_ovsvs43.jpg │ ├── goods-niuyouguo.jpg │ ├── goods001_mRZHB0l.jpg │ ├── goods001_mbwh08e.jpg │ ├── goods002_5XFhSXT.jpg │ ├── goods002_V56PX0F.jpg │ ├── goods006_CW86piF.jpg │ ├── goods007_JjqVQBm.jpg │ ├── goods008_24BgoeL.jpg │ ├── goods008_52P1qXv.jpg │ ├── goods010_PetskjP.jpg │ ├── goods020_Kdif4r4.jpg │ └── goods021_vVT4Sfd.jpg └── css │ └── reset.css ├── uwsgi.pid ├── goodslist ├── __init__.py ├── migrations │ ├── __init__.py │ ├── __init__.pyc │ └── 0001_initial.pyc ├── urls.pyc ├── admin.py ├── admin.pyc ├── models.pyc ├── tests.py ├── views.pyc ├── __init__.pyc ├── urls.py ├── views.py └── models.py ├── usercenter ├── __init__.py ├── migrations │ ├── __init__.py │ ├── __init__.pyc │ └── 0001_initial.pyc ├── der.pyc ├── admin.pyc ├── models.pyc ├── tests.py ├── urls.pyc ├── views.pyc ├── __init__.pyc ├── admin.py ├── urls.py ├── der.py ├── models.py └── views.py ├── registerLogin ├── __init__.py ├── migrations │ ├── __init__.py │ ├── __init__.pyc │ └── 0001_initial.pyc ├── admin.py ├── admin.pyc ├── tests.py ├── urls.pyc ├── views.pyc ├── __init__.pyc ├── models.pyc ├── viewsUtils.pyc ├── urls.py ├── viewsUtils.py ├── views.py └── models.py ├── whoosh_index ├── MAIN_WRITELOCK ├── _MAIN_1.toc └── MAIN_w7c598v6yn03isp2.seg ├── README.md ├── templates ├── search │ ├── indexes │ │ └── index │ │ │ └── goods_text.txt │ └── search.html ├── freshFruit │ ├── verify.html │ ├── base_user.html │ ├── base_index.html │ ├── register.html │ ├── changekw.html │ ├── base.html │ ├── login.html │ ├── joinus.html │ ├── user_center_info.html │ ├── callus.html │ ├── index.html │ ├── aboutus.html │ ├── choujiang.html │ ├── list.html │ ├── user_center_site.html │ ├── place_order.html │ ├── user_center_order.html │ ├── cart.html │ └── detail.html └── detail.html ├── uwsgi.ini └── manage.py /cart/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /detail/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /index/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /order/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /shop/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /static/js/yz.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /uwsgi.pid: -------------------------------------------------------------------------------- 1 | 3746 2 | -------------------------------------------------------------------------------- /goodslist/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /usercenter/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /cart/migrations/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /index/migrations/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /order/migrations/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /registerLogin/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /whoosh_index/MAIN_WRITELOCK: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /detail/migrations/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /goodslist/migrations/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /usercenter/migrations/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # shop 2 | django 电商网站 3 | -------------------------------------------------------------------------------- /registerLogin/migrations/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /cart/urls.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/cart/urls.pyc -------------------------------------------------------------------------------- /shop/urls.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/shop/urls.pyc -------------------------------------------------------------------------------- /shop/wsgi.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/shop/wsgi.pyc -------------------------------------------------------------------------------- /cart/admin.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/cart/admin.pyc -------------------------------------------------------------------------------- /cart/models.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/cart/models.pyc -------------------------------------------------------------------------------- /cart/views.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/cart/views.pyc -------------------------------------------------------------------------------- /detail/admin.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/detail/admin.pyc -------------------------------------------------------------------------------- /detail/urls.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/detail/urls.pyc -------------------------------------------------------------------------------- /detail/views.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/detail/views.pyc -------------------------------------------------------------------------------- /index/admin.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/index/admin.pyc -------------------------------------------------------------------------------- /index/models.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/index/models.pyc -------------------------------------------------------------------------------- /index/urls.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/index/urls.pyc -------------------------------------------------------------------------------- /index/views.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/index/views.pyc -------------------------------------------------------------------------------- /order/admin.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/order/admin.pyc -------------------------------------------------------------------------------- /order/models.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/order/models.pyc -------------------------------------------------------------------------------- /order/urls.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/order/urls.pyc -------------------------------------------------------------------------------- /order/views.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/order/views.pyc -------------------------------------------------------------------------------- /cart/__init__.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/cart/__init__.pyc -------------------------------------------------------------------------------- /cart/tests.py: -------------------------------------------------------------------------------- 1 | from django.test import TestCase 2 | 3 | # Create your tests here. 4 | -------------------------------------------------------------------------------- /detail/models.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/detail/models.pyc -------------------------------------------------------------------------------- /detail/tests.py: -------------------------------------------------------------------------------- 1 | from django.test import TestCase 2 | 3 | # Create your tests here. 4 | -------------------------------------------------------------------------------- /goodslist/urls.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/goodslist/urls.pyc -------------------------------------------------------------------------------- /index/__init__.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/index/__init__.pyc -------------------------------------------------------------------------------- /index/tests.py: -------------------------------------------------------------------------------- 1 | from django.test import TestCase 2 | 3 | # Create your tests here. 4 | -------------------------------------------------------------------------------- /order/__init__.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/order/__init__.pyc -------------------------------------------------------------------------------- /order/tests.py: -------------------------------------------------------------------------------- 1 | from django.test import TestCase 2 | 3 | # Create your tests here. 4 | -------------------------------------------------------------------------------- /shop/__init__.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/shop/__init__.pyc -------------------------------------------------------------------------------- /shop/settings.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/shop/settings.pyc -------------------------------------------------------------------------------- /usercenter/der.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/usercenter/der.pyc -------------------------------------------------------------------------------- /detail/__init__.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/detail/__init__.pyc -------------------------------------------------------------------------------- /goodslist/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | # Register your models here. 4 | -------------------------------------------------------------------------------- /goodslist/admin.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/goodslist/admin.pyc -------------------------------------------------------------------------------- /goodslist/models.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/goodslist/models.pyc -------------------------------------------------------------------------------- /goodslist/tests.py: -------------------------------------------------------------------------------- 1 | from django.test import TestCase 2 | 3 | # Create your tests here. 4 | -------------------------------------------------------------------------------- /goodslist/views.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/goodslist/views.pyc -------------------------------------------------------------------------------- /index/viewSearch.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/index/viewSearch.pyc -------------------------------------------------------------------------------- /usercenter/admin.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/usercenter/admin.pyc -------------------------------------------------------------------------------- /usercenter/models.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/usercenter/models.pyc -------------------------------------------------------------------------------- /usercenter/tests.py: -------------------------------------------------------------------------------- 1 | from django.test import TestCase 2 | 3 | # Create your tests here. 4 | -------------------------------------------------------------------------------- /usercenter/urls.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/usercenter/urls.pyc -------------------------------------------------------------------------------- /usercenter/views.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/usercenter/views.pyc -------------------------------------------------------------------------------- /goodslist/__init__.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/goodslist/__init__.pyc -------------------------------------------------------------------------------- /registerLogin/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | # Register your models here. 4 | -------------------------------------------------------------------------------- /registerLogin/admin.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/registerLogin/admin.pyc -------------------------------------------------------------------------------- /registerLogin/tests.py: -------------------------------------------------------------------------------- 1 | from django.test import TestCase 2 | 3 | # Create your tests here. 4 | -------------------------------------------------------------------------------- /registerLogin/urls.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/registerLogin/urls.pyc -------------------------------------------------------------------------------- /registerLogin/views.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/registerLogin/views.pyc -------------------------------------------------------------------------------- /static/images/adv01.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/static/images/adv01.jpg -------------------------------------------------------------------------------- /static/images/adv02.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/static/images/adv02.jpg -------------------------------------------------------------------------------- /static/images/down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/static/images/down.png -------------------------------------------------------------------------------- /static/images/fruit.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/static/images/fruit.jpg -------------------------------------------------------------------------------- /static/images/goods.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/static/images/goods.jpg -------------------------------------------------------------------------------- /static/images/icons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/static/images/icons.png -------------------------------------------------------------------------------- /static/images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/static/images/logo.png -------------------------------------------------------------------------------- /static/images/slide.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/static/images/slide.jpg -------------------------------------------------------------------------------- /usercenter/__init__.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/usercenter/__init__.pyc -------------------------------------------------------------------------------- /index/search_indexes.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/index/search_indexes.pyc -------------------------------------------------------------------------------- /registerLogin/__init__.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/registerLogin/__init__.pyc -------------------------------------------------------------------------------- /registerLogin/models.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/registerLogin/models.pyc -------------------------------------------------------------------------------- /static/images/banner01.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/static/images/banner01.jpg -------------------------------------------------------------------------------- /static/images/banner02.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/static/images/banner02.jpg -------------------------------------------------------------------------------- /static/images/banner03.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/static/images/banner03.jpg -------------------------------------------------------------------------------- /static/images/banner04.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/static/images/banner04.jpg -------------------------------------------------------------------------------- /static/images/banner05.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/static/images/banner05.jpg -------------------------------------------------------------------------------- /static/images/banner06.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/static/images/banner06.jpg -------------------------------------------------------------------------------- /static/images/goods02.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/static/images/goods02.jpg -------------------------------------------------------------------------------- /static/images/icons02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/static/images/icons02.png -------------------------------------------------------------------------------- /static/images/left_bg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/static/images/left_bg.jpg -------------------------------------------------------------------------------- /static/images/logo02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/static/images/logo02.png -------------------------------------------------------------------------------- /static/images/ly-plate.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/static/images/ly-plate.png -------------------------------------------------------------------------------- /static/images/slide02.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/static/images/slide02.jpg -------------------------------------------------------------------------------- /static/images/slide03.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/static/images/slide03.jpg -------------------------------------------------------------------------------- /static/images/slide04.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/static/images/slide04.jpg -------------------------------------------------------------------------------- /static/uploads/goods.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/static/uploads/goods.jpg -------------------------------------------------------------------------------- /static/uploads/goods02.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/static/uploads/goods02.jpg -------------------------------------------------------------------------------- /static/uploads/rou_2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/static/uploads/rou_2.jpg -------------------------------------------------------------------------------- /static/uploads/rou_3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/static/uploads/rou_3.jpg -------------------------------------------------------------------------------- /static/uploads/rou_4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/static/uploads/rou_4.jpg -------------------------------------------------------------------------------- /static/uploads/rou_5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/static/uploads/rou_5.jpg -------------------------------------------------------------------------------- /static/uploads/rou_6.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/static/uploads/rou_6.jpg -------------------------------------------------------------------------------- /static/uploads/rou_7.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/static/uploads/rou_7.jpg -------------------------------------------------------------------------------- /whoosh_index/_MAIN_1.toc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/whoosh_index/_MAIN_1.toc -------------------------------------------------------------------------------- /cart/migrations/__init__.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/cart/migrations/__init__.pyc -------------------------------------------------------------------------------- /registerLogin/viewsUtils.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/registerLogin/viewsUtils.pyc -------------------------------------------------------------------------------- /static/images/pay_icons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/static/images/pay_icons.png -------------------------------------------------------------------------------- /static/images/shop_cart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/static/images/shop_cart.png -------------------------------------------------------------------------------- /static/uploads/banner01.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/static/uploads/banner01.jpg -------------------------------------------------------------------------------- /static/uploads/banner02.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/static/uploads/banner02.jpg -------------------------------------------------------------------------------- /static/uploads/banner03.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/static/uploads/banner03.jpg -------------------------------------------------------------------------------- /static/uploads/banner04.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/static/uploads/banner04.jpg -------------------------------------------------------------------------------- /static/uploads/banner05.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/static/uploads/banner05.jpg -------------------------------------------------------------------------------- /static/uploads/banner06.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/static/uploads/banner06.jpg -------------------------------------------------------------------------------- /static/uploads/goods001.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/static/uploads/goods001.jpg -------------------------------------------------------------------------------- /static/uploads/goods002.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/static/uploads/goods002.jpg -------------------------------------------------------------------------------- /static/uploads/goods003.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/static/uploads/goods003.jpg -------------------------------------------------------------------------------- /static/uploads/goods004.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/static/uploads/goods004.jpg -------------------------------------------------------------------------------- /static/uploads/goods005.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/static/uploads/goods005.jpg -------------------------------------------------------------------------------- /static/uploads/goods006.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/static/uploads/goods006.jpg -------------------------------------------------------------------------------- /static/uploads/goods007.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/static/uploads/goods007.jpg -------------------------------------------------------------------------------- /static/uploads/goods008.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/static/uploads/goods008.jpg -------------------------------------------------------------------------------- /static/uploads/goods010.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/static/uploads/goods010.jpg -------------------------------------------------------------------------------- /static/uploads/goods011.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/static/uploads/goods011.jpg -------------------------------------------------------------------------------- /static/uploads/goods012.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/static/uploads/goods012.jpg -------------------------------------------------------------------------------- /static/uploads/goods013.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/static/uploads/goods013.jpg -------------------------------------------------------------------------------- /static/uploads/goods017.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/static/uploads/goods017.jpg -------------------------------------------------------------------------------- /static/uploads/goods018.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/static/uploads/goods018.jpg -------------------------------------------------------------------------------- /static/uploads/goods019.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/static/uploads/goods019.jpg -------------------------------------------------------------------------------- /static/uploads/goods020.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/static/uploads/goods020.jpg -------------------------------------------------------------------------------- /static/uploads/goods021.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/static/uploads/goods021.jpg -------------------------------------------------------------------------------- /static/uploads/shucai_1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/static/uploads/shucai_1.jpg -------------------------------------------------------------------------------- /static/uploads/shucai_2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/static/uploads/shucai_2.jpg -------------------------------------------------------------------------------- /static/uploads/shucai_3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/static/uploads/shucai_3.jpg -------------------------------------------------------------------------------- /static/uploads/shucai_4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/static/uploads/shucai_4.jpg -------------------------------------------------------------------------------- /static/uploads/shucai_5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/static/uploads/shucai_5.jpg -------------------------------------------------------------------------------- /static/uploads/shucai_6.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/static/uploads/shucai_6.jpg -------------------------------------------------------------------------------- /static/uploads/sudong_1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/static/uploads/sudong_1.jpg -------------------------------------------------------------------------------- /static/uploads/sudong_2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/static/uploads/sudong_2.jpg -------------------------------------------------------------------------------- /static/uploads/sudong_3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/static/uploads/sudong_3.jpg -------------------------------------------------------------------------------- /static/uploads/sudong_4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/static/uploads/sudong_4.jpg -------------------------------------------------------------------------------- /static/uploads/sudong_5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/static/uploads/sudong_5.jpg -------------------------------------------------------------------------------- /static/uploads/sudong_6.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/static/uploads/sudong_6.jpg -------------------------------------------------------------------------------- /detail/migrations/__init__.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/detail/migrations/__init__.pyc -------------------------------------------------------------------------------- /index/migrations/__init__.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/index/migrations/__init__.pyc -------------------------------------------------------------------------------- /order/migrations/__init__.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/order/migrations/__init__.pyc -------------------------------------------------------------------------------- /static/images/goods_detail.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/static/images/goods_detail.jpg -------------------------------------------------------------------------------- /static/images/interval_line.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/static/images/interval_line.png -------------------------------------------------------------------------------- /static/images/login_banner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/static/images/login_banner.png -------------------------------------------------------------------------------- /static/images/rotate-static.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/static/images/rotate-static.png -------------------------------------------------------------------------------- /static/uploads/goods_detail.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/static/uploads/goods_detail.jpg -------------------------------------------------------------------------------- /static/uploads/goods_qd01.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/static/uploads/goods_qd01.jpg -------------------------------------------------------------------------------- /static/uploads/goods_qd02.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/static/uploads/goods_qd02.jpg -------------------------------------------------------------------------------- /static/uploads/goods_qd03.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/static/uploads/goods_qd03.jpg -------------------------------------------------------------------------------- /static/uploads/goods_qd04.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/static/uploads/goods_qd04.jpg -------------------------------------------------------------------------------- /static/uploads/goods_qd05.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/static/uploads/goods_qd05.jpg -------------------------------------------------------------------------------- /static/uploads/goods_qd06.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/static/uploads/goods_qd06.jpg -------------------------------------------------------------------------------- /cart/migrations/0001_initial.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/cart/migrations/0001_initial.pyc -------------------------------------------------------------------------------- /goodslist/migrations/__init__.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/goodslist/migrations/__init__.pyc -------------------------------------------------------------------------------- /index/migrations/0001_initial.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/index/migrations/0001_initial.pyc -------------------------------------------------------------------------------- /order/migrations/0001_initial.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/order/migrations/0001_initial.pyc -------------------------------------------------------------------------------- /static/images/goods/goods001.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/static/images/goods/goods001.jpg -------------------------------------------------------------------------------- /static/images/goods/goods002.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/static/images/goods/goods002.jpg -------------------------------------------------------------------------------- /static/images/goods/goods003.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/static/images/goods/goods003.jpg -------------------------------------------------------------------------------- /static/images/goods/goods004.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/static/images/goods/goods004.jpg -------------------------------------------------------------------------------- /static/images/goods/goods005.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/static/images/goods/goods005.jpg -------------------------------------------------------------------------------- /static/images/goods/goods006.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/static/images/goods/goods006.jpg -------------------------------------------------------------------------------- /static/images/goods/goods007.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/static/images/goods/goods007.jpg -------------------------------------------------------------------------------- /static/images/goods/goods008.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/static/images/goods/goods008.jpg -------------------------------------------------------------------------------- /static/images/goods/goods009.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/static/images/goods/goods009.jpg -------------------------------------------------------------------------------- /static/images/goods/goods010.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/static/images/goods/goods010.jpg -------------------------------------------------------------------------------- /static/images/goods/goods011.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/static/images/goods/goods011.jpg -------------------------------------------------------------------------------- /static/images/goods/goods012.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/static/images/goods/goods012.jpg -------------------------------------------------------------------------------- /static/images/goods/goods013.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/static/images/goods/goods013.jpg -------------------------------------------------------------------------------- /static/images/goods/goods014.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/static/images/goods/goods014.jpg -------------------------------------------------------------------------------- /static/images/goods/goods015.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/static/images/goods/goods015.jpg -------------------------------------------------------------------------------- /static/images/goods/goods016.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/static/images/goods/goods016.jpg -------------------------------------------------------------------------------- /static/images/goods/goods017.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/static/images/goods/goods017.jpg -------------------------------------------------------------------------------- /static/images/goods/goods018.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/static/images/goods/goods018.jpg -------------------------------------------------------------------------------- /static/images/goods/goods019.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/static/images/goods/goods019.jpg -------------------------------------------------------------------------------- /static/images/goods/goods020.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/static/images/goods/goods020.jpg -------------------------------------------------------------------------------- /static/images/goods/goods021.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/static/images/goods/goods021.jpg -------------------------------------------------------------------------------- /static/images/register_banner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/static/images/register_banner.png -------------------------------------------------------------------------------- /static/uploads/goods-haishen.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/static/uploads/goods-haishen.jpg -------------------------------------------------------------------------------- /static/uploads/goods_ovsvs43.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/static/uploads/goods_ovsvs43.jpg -------------------------------------------------------------------------------- /detail/migrations/0001_initial.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/detail/migrations/0001_initial.pyc -------------------------------------------------------------------------------- /static/uploads/goods-niuyouguo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/static/uploads/goods-niuyouguo.jpg -------------------------------------------------------------------------------- /static/uploads/goods001_mRZHB0l.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/static/uploads/goods001_mRZHB0l.jpg -------------------------------------------------------------------------------- /static/uploads/goods001_mbwh08e.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/static/uploads/goods001_mbwh08e.jpg -------------------------------------------------------------------------------- /static/uploads/goods002_5XFhSXT.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/static/uploads/goods002_5XFhSXT.jpg -------------------------------------------------------------------------------- /static/uploads/goods002_V56PX0F.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/static/uploads/goods002_V56PX0F.jpg -------------------------------------------------------------------------------- /static/uploads/goods006_CW86piF.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/static/uploads/goods006_CW86piF.jpg -------------------------------------------------------------------------------- /static/uploads/goods007_JjqVQBm.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/static/uploads/goods007_JjqVQBm.jpg -------------------------------------------------------------------------------- /static/uploads/goods008_24BgoeL.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/static/uploads/goods008_24BgoeL.jpg -------------------------------------------------------------------------------- /static/uploads/goods008_52P1qXv.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/static/uploads/goods008_52P1qXv.jpg -------------------------------------------------------------------------------- /static/uploads/goods010_PetskjP.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/static/uploads/goods010_PetskjP.jpg -------------------------------------------------------------------------------- /static/uploads/goods020_Kdif4r4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/static/uploads/goods020_Kdif4r4.jpg -------------------------------------------------------------------------------- /static/uploads/goods021_vVT4Sfd.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/static/uploads/goods021_vVT4Sfd.jpg -------------------------------------------------------------------------------- /usercenter/migrations/__init__.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/usercenter/migrations/__init__.pyc -------------------------------------------------------------------------------- /goodslist/migrations/0001_initial.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/goodslist/migrations/0001_initial.pyc -------------------------------------------------------------------------------- /registerLogin/migrations/__init__.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/registerLogin/migrations/__init__.pyc -------------------------------------------------------------------------------- /usercenter/migrations/0001_initial.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/usercenter/migrations/0001_initial.pyc -------------------------------------------------------------------------------- /whoosh_index/MAIN_w7c598v6yn03isp2.seg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/whoosh_index/MAIN_w7c598v6yn03isp2.seg -------------------------------------------------------------------------------- /registerLogin/migrations/0001_initial.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaowangwj/shop/HEAD/registerLogin/migrations/0001_initial.pyc -------------------------------------------------------------------------------- /templates/search/indexes/index/goods_text.txt: -------------------------------------------------------------------------------- 1 | #goodsinfo_text.txt,这里列出了要对哪些列的内容进行检索 2 | {{ object.goodsName }} 3 | {{ object.goodsDesc }} 4 | -------------------------------------------------------------------------------- /templates/freshFruit/verify.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 验证码 5 | 6 | 7 | CheckCode 8 | 9 | -------------------------------------------------------------------------------- /goodslist/urls.py: -------------------------------------------------------------------------------- 1 | from django.conf.urls import include, url 2 | from . import views 3 | 4 | urlpatterns = [ 5 | url(r'^list/$', views.list, name='list'), 6 | 7 | ] 8 | # url(r'^list/$',views.list,name='list'), -------------------------------------------------------------------------------- /uwsgi.ini: -------------------------------------------------------------------------------- 1 | [uwsgi] 2 | socket=192.168.13.115:9000 3 | 4 | chdir=/home/python/Desktop/shop 5 | wsgi-file=shop/wsgi.py 6 | processes=4 7 | threads=2 8 | master=True 9 | pidfile=uwsgi.pid 10 | daemonize=uswgi.log -------------------------------------------------------------------------------- /detail/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | from . models import * 3 | 4 | admin.site.register(GoodSort) 5 | admin.site.register(UserInfo) 6 | admin.site.register(AddrInfo) 7 | admin.site.register(Goods) 8 | admin.site.register(RecentSee) 9 | 10 | -------------------------------------------------------------------------------- /manage.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | import os 3 | import sys 4 | 5 | if __name__ == "__main__": 6 | os.environ.setdefault("DJANGO_SETTINGS_MODULE", "shop.settings") 7 | 8 | from django.core.management import execute_from_command_line 9 | 10 | execute_from_command_line(sys.argv) 11 | -------------------------------------------------------------------------------- /detail/urls.py: -------------------------------------------------------------------------------- 1 | from django.conf.urls import include, url 2 | from . import views 3 | 4 | urlpatterns = [ 5 | # url(r'^$',views.index,name='index'), 6 | url(r'^detail/$',views.detail,name='detail'), 7 | url(r'^addcart/$',views.addcart,name='addcart'), 8 | url(r'^comment([0-9]*)/$',views.comment,name='comment'), 9 | ] 10 | 11 | 12 | -------------------------------------------------------------------------------- /index/search_indexes.py: -------------------------------------------------------------------------------- 1 | # coding=utf-8 2 | from haystack import indexes 3 | from .models import Goods 4 | 5 | 6 | class NoteIndex(indexes.SearchIndex, indexes.Indexable): 7 | text = indexes.CharField(document=True, use_template=True) 8 | 9 | def get_model(self): 10 | return Goods 11 | 12 | def index_queryset(self, using=None): 13 | return self.get_model().objects.all() -------------------------------------------------------------------------------- /order/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | from models import * 3 | 4 | admin.site.register(UserInfo) 5 | admin.site.register(AreaInfo) 6 | admin.site.register(AddrInfo) 7 | admin.site.register(GoodSort) 8 | admin.site.register(Goods) 9 | admin.site.register(GoodsComment) 10 | admin.site.register(Cart) 11 | admin.site.register(Orders) 12 | admin.site.register(RecentSee) 13 | -------------------------------------------------------------------------------- /usercenter/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | from models import * 3 | # Register your models here. 4 | 5 | admin.site.register(GoodSort) 6 | admin.site.register(UserInfo) 7 | admin.site.register(AddrInfo) 8 | admin.site.register(Goods) 9 | admin.site.register(RecentSee) 10 | admin.site.register(Orders) 11 | admin.site.register(OrderDetail) 12 | admin.site.register(GoodsComment) -------------------------------------------------------------------------------- /cart/urls.py: -------------------------------------------------------------------------------- 1 | from django.conf.urls import include, url 2 | from django.contrib import admin 3 | from . import views 4 | 5 | urlpatterns = [ 6 | url(r'^cart/$',views.cart,name="cart"), 7 | 8 | url(r'^deleteHander/$',views.deleteHander,name="deleteHander"), 9 | 10 | url(r'^place_order/$',views.place_order,name="place_order"), 11 | url(r'^place_hander/$',views.place_hander,name="place_hander"), 12 | ] 13 | -------------------------------------------------------------------------------- /index/admin.py: -------------------------------------------------------------------------------- 1 | # # coding=utf-8 2 | # from django.contrib import admin 3 | # from . models import * 4 | 5 | # class GoodSortAdmin(admin.ModelAdmin): 6 | # list_dispaly=['sortName','sortPic'] 7 | # class GoodsAdmin(admin.ModelAdmin): 8 | # list_dispaly=['goodsName','goodsDesc','goodsPrice','goodsDetail','imgPath','saleCount','gPubdate'] 9 | # admin.site.register(GoodSort,GoodSortAdmin) 10 | # admin.site.register(Goods,GoodsAdmin) 11 | -------------------------------------------------------------------------------- /shop/wsgi.py: -------------------------------------------------------------------------------- 1 | """ 2 | WSGI config for shop project. 3 | 4 | It exposes the WSGI callable as a module-level variable named ``application``. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/1.8/howto/deployment/wsgi/ 8 | """ 9 | 10 | import os 11 | 12 | from django.core.wsgi import get_wsgi_application 13 | 14 | os.environ.setdefault("DJANGO_SETTINGS_MODULE", "shop.settings") 15 | 16 | application = get_wsgi_application() 17 | -------------------------------------------------------------------------------- /usercenter/urls.py: -------------------------------------------------------------------------------- 1 | from django.conf.urls import include, url 2 | from . import views 3 | 4 | urlpatterns = [ 5 | url(r'^user_center_info/$',views.user_center_info,name='user_center_info'), 6 | url(r'^user_center_order/$',views.user_center_order,name='user_center_order'), 7 | url(r'^user_center_site/$',views.user_center_site,name='user_center_site'), 8 | url(r'^areal/$',views.areal,name='areal'), 9 | url(r'^areal([0-9]+)/$',views.areal2,name='areal2'), 10 | url(r'^pay/$',views.pay,name='pay'), 11 | ] -------------------------------------------------------------------------------- /index/urls.py: -------------------------------------------------------------------------------- 1 | # coding=utf-8 2 | from django.conf.urls import url 3 | from . import views 4 | 5 | urlpatterns = [ 6 | # url(r'^/$',views.index,name='indexPage2'), 7 | url(r'^index/$',views.index,name='indexPage'), 8 | url(r'^aboutus/$',views.aboutus,name='aboutus'), 9 | url(r'^callus/$',views.callus,name='callus'), 10 | url(r'^joinus/$',views.joinus,name='joinus'), 11 | url(r'^loginOut/$',views.loginOut,name='loginOut'), 12 | url(r'^choujiang/$',views.choujiang,name='choujiang'), 13 | 14 | ] 15 | 16 | -------------------------------------------------------------------------------- /order/urls.py: -------------------------------------------------------------------------------- 1 | from django.conf.urls import include, url 2 | from . import views 3 | 4 | urlpatterns = [ 5 | 6 | url(r'^place_order.html/$',views.order,name='place_order'), 7 | url(r'^index.html/$',views.index,name='index'), 8 | url(r'^user_center_order.html/$',views.userorder,name='user_center_order'), 9 | url(r'^user_center_info.html/$',views.userinfo,name='user_center_info'), 10 | url(r'^user_center_site.html/$',views.usersite,name='user_center_site'), 11 | url(r'^test/$',views.test,), 12 | ] -------------------------------------------------------------------------------- /registerLogin/urls.py: -------------------------------------------------------------------------------- 1 | from django.conf.urls import include, url 2 | from . import views 3 | from . import viewsUtils 4 | 5 | urlpatterns = [ 6 | # url(r'^$',views.index,name='index'), 7 | url(r'^register/$',views.register,name='register'), 8 | url(r'^login/$',views.login,name='login'), 9 | url(r'^regcheck/$',views.regcheck,name='regcheck'), 10 | url(r'^changekw/$',views.changekw,name='changekw'), 11 | url(r'^verifycode/$',viewsUtils.verifycode,name='verifycode'), 12 | url(r'^verify/$',views.verify,name='verify'), 13 | ] -------------------------------------------------------------------------------- /cart/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | from models import * 3 | 4 | class GoodsAdmin(admin.ModelAdmin): 5 | list_display = ["id","goodsName","goodsPrice","imgPath"] 6 | class CartAdmin(admin.ModelAdmin): 7 | list_display = ["id","goodsName","buyCount","isDelete","userCart"] 8 | 9 | admin.site.register(UserInfo) 10 | admin.site.register(AreaInfo) 11 | admin.site.register(AddrInfo) 12 | admin.site.register(GoodSort) 13 | admin.site.register(Goods,GoodsAdmin) 14 | admin.site.register(GoodsComment) 15 | admin.site.register(Cart,CartAdmin) 16 | admin.site.register(Orders) 17 | admin.site.register(RecentSee) 18 | 19 | 20 | -------------------------------------------------------------------------------- /static/css/reset.css: -------------------------------------------------------------------------------- 1 | /* 把标签默认的间距设为0 */ 2 | body,ul,ol,p,h1,h2,h3,h4,h5,h6,dl,dd,select,input,textarea,form{margin:0;padding:0} 3 | 4 | /* 让h标签文字大小继承body的文字设置 */ 5 | h1,h2,h3,h4,h5,h6{font-size:100%;font-weight:normal;} 6 | 7 | /* 去掉列表默认的图标 */ 8 | ul,ol{list-style:none;} 9 | 10 | /* 去掉em默认的斜体 */ 11 | em{font-style: normal;} 12 | 13 | /* 去掉a标签默认的下划线 */ 14 | a{text-decoration:none;} 15 | 16 | 17 | /* 去掉加链接时产生的框线 */ 18 | img{border:0;} 19 | 20 | /* 清除浮动 */ 21 | .clearfix:before,.clearfix:after{content:"";display:table} 22 | .clearfix:after{clear:both;} 23 | .clearfix{zoom:1} 24 | 25 | /* 浮动 */ 26 | .fl{float:left} 27 | .fr{float:right} -------------------------------------------------------------------------------- /index/viewSearch.py: -------------------------------------------------------------------------------- 1 | # coding=utf-8 2 | from haystack.generic_views import SearchView 3 | from models import * 4 | from django.http import * 5 | from django.shortcuts import render 6 | 7 | # 重写haystack的视图类,为了在搜索时可以拿到数据,做到搜索页的状态保持 8 | class MySearchView(SearchView): 9 | def get_context_data(self,*args,**kwargs): 10 | context = super(MySearchView, self).get_context_data(*args,**kwargs) 11 | username = self.request.session.get('name', default='') 12 | number=0 13 | user='' 14 | if username: 15 | user=UserInfo.objects.get(uName=username) 16 | number=user.cart_set.filter(isDelete=False).count() 17 | context['user']=user 18 | context['number']=number 19 | SortsMsg=GoodSort.objects.all() 20 | context['SortsMsg']=SortsMsg 21 | return context 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /usercenter/der.py: -------------------------------------------------------------------------------- 1 | from django.shortcuts import * 2 | from models import * 3 | 4 | def login_name(fn): 5 | def fun(request, *args): 6 | username = request.session.get('name', default='') 7 | number=0 8 | user='' 9 | 10 | if username: 11 | user=UserInfo.objects.get(uName=username) 12 | number=user.cart_set.filter(isDelete=False).count() 13 | dic = { 14 | 'user': user, 15 | 'number':number, 16 | 17 | } 18 | result = fn(request, dic, *args) 19 | return result 20 | return fun 21 | 22 | 23 | def login_yz(fn): 24 | def fun(request, *args): 25 | if request.session.has_key('name'): 26 | result = fn(request, *args) 27 | else: 28 | result = redirect('/login/') 29 | return result 30 | return fun -------------------------------------------------------------------------------- /index/views.py: -------------------------------------------------------------------------------- 1 | # coding=utf-8 2 | from django.shortcuts import render 3 | from django.http import * 4 | from models import * 5 | import json 6 | from usercenter import der 7 | from django.core.urlresolvers import reverse 8 | # 首页 9 | # @der.login_yz 10 | @der.login_name 11 | def index(request,dic): 12 | # 拿到产品分类信息 13 | SortsMsg=GoodSort.objects.all() 14 | message=[] 15 | for sort in SortsMsg: 16 | message.append({'sort':sort,'goodMsgList':sort.goods_set.all().order_by('goodsName')[0:4],'goodOtherList':sort.goods_set.all().order_by('goodsName')[4:7]}) 17 | 18 | 19 | dic=dict(dic,**{ 20 | 'message':message, 21 | }) 22 | 23 | return render(request,'freshFruit/index.html',dic) 24 | 25 | def loginOut(request): 26 | del request.session['name'] 27 | return HttpResponseRedirect(reverse('index:indexPage')) 28 | 29 | 30 | # 关于我们页面 31 | def aboutus(request): 32 | return render(request,'freshFruit/aboutus.html') 33 | # 联系我们页面 34 | def callus(request): 35 | return render(request,'freshFruit/callus.html') 36 | # 招聘人才界面 37 | def joinus(request): 38 | return render(request,'freshFruit/joinus.html') 39 | 40 | def choujiang(request): 41 | return render(request,'freshFruit/choujiang.html') 42 | 43 | -------------------------------------------------------------------------------- /templates/freshFruit/base_user.html: -------------------------------------------------------------------------------- 1 | {%extends 'freshFruit/base.html'%} 2 | {% load static from staticfiles %} 3 | {%block title%}天天生鲜-用户中心{%endblock%} 4 | 5 | {%block menu%} 6 | 16 | {%block user_message%} 17 |
18 |
19 |

用户中心

20 | 30 |
31 | {%endblock %} 32 | 33 | 34 | {%endblock%} -------------------------------------------------------------------------------- /shop/urls.py: -------------------------------------------------------------------------------- 1 | """shop URL Configuration 2 | 3 | The `urlpatterns` list routes URLs to views. For more information please see: 4 | https://docs.djangoproject.com/en/1.8/topics/http/urls/ 5 | Examples: 6 | Function views 7 | 1. Add an import: from my_app import views 8 | 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') 9 | Class-based views 10 | 1. Add an import: from other_app.views import Home 11 | 2. Add a URL to urlpatterns: url(r'^$', Home.as_view(), name='home') 12 | Including another URLconf 13 | 1. Add an import: from blog import urls as blog_urls 14 | 2. Add a URL to urlpatterns: url(r'^blog/', include(blog_urls)) 15 | """ 16 | from django.conf.urls import include, url 17 | from django.contrib import admin 18 | from index import viewSearch 19 | from haystack.views import SearchView 20 | urlpatterns = [ 21 | url(r'^admin/', include(admin.site.urls)), 22 | url(r'^tinymce/', include('tinymce.urls')), 23 | # url(r'^search/', include('haystack.urls')), 24 | url(r'^',include('registerLogin.urls',namespace='registerLogin')), 25 | url(r'^',include('usercenter.urls',namespace='usercenter')), 26 | url(r'^',include('goodslist.urls',namespace='goodslist')), 27 | url(r'^',include('index.urls',namespace='index')), 28 | url(r'^',include('detail.urls',namespace='detail')), 29 | url(r'^',include('cart.urls',namespace='cart')), 30 | url(r'^search/', viewSearch.MySearchView.as_view(), name='search_view'), 31 | ] 32 | -------------------------------------------------------------------------------- /static/js/detail.js: -------------------------------------------------------------------------------- 1 | $(function(){ 2 | 3 | $(".add").click(function(){ 4 | 5 | var t=$(this).parent().find('input[class*="num_show"]'); 6 | t.val(parseInt(t.val())+1); 7 | $(".num_show").trigger("change"); 8 | setTotal(); 9 | }); 10 | 11 | $(".minus").click(function(){ 12 | $(".num_show").trigger("change"); 13 | var t=$(this).parent().find('input[class*="num_show"]'); 14 | t.val(parseInt(t.val())-1) 15 | if(parseInt(t.val()-1)<1){ 16 | t.val(1); 17 | } 18 | setTotal(); 19 | $(".num_show").trigger("change"); 20 | }); 21 | 22 | function setTotal(){ 23 | var s=0; 24 | s=(parseInt($(".num_show").val())*parseFloat($(".show_pirze > em").html())).toFixed(2); 25 | $(".total").children(":first").html(s); 26 | 27 | } 28 | 29 | $('.num_show').change(function(){ 30 | $('.buy_btn').attr({href:$('.buy_btn').attr('href').split('?')[0]+'?id='+$('.add_cart').attr('value')+'&&count='+$('.num_show').val()}) 31 | }) 32 | 33 | 34 | $('#add_cart').click(function(){ 35 | $.ajax({ 36 | url: '/addcart/', 37 | type: 'POST', 38 | dataType: 'json', 39 | data:{'goodsName':$('.add_cart').attr('value'),'buyCount':$('.num_show').val()} 40 | }) 41 | .done(function(data) { 42 | $('#show_count').html(data.number); 43 | 44 | } 45 | ) 46 | .fail(function() { 47 | // error_name = 'True'; 48 | window.location.href='/login/' 49 | // alert('服务器超时,请重试!'); 50 | }); 51 | } 52 | ) 53 | 54 | $(".num_show").trigger("change"); 55 | }) -------------------------------------------------------------------------------- /templates/freshFruit/base_index.html: -------------------------------------------------------------------------------- 1 | {%extends 'freshFruit/base.html'%} 2 | {% load static from staticfiles %} 3 | {%block title%}天天生鲜-用户中心{%endblock%} 4 | 5 | {%block menu%} 6 | 21 | 22 | {%block navlist%} 23 | 46 | {%endblock%} 47 | {%endblock%} 48 | 49 | -------------------------------------------------------------------------------- /registerLogin/viewsUtils.py: -------------------------------------------------------------------------------- 1 | # coding=utf-8 2 | from django.http import * 3 | # 引入绘图模块 4 | from PIL import Image, ImageDraw, ImageFont 5 | import random 6 | import cStringIO 7 | 8 | def verifycode(request): 9 | # 定义一个变量用于画布打背景色和宽高 10 | bgcolor = (random.randrange(20, 100), random.randrange( 11 | 20, 100), 255) 12 | width = 100 13 | height = 33 14 | # 创建画布对象 15 | im=Image.new('RGB',(width,height),bgcolor) 16 | # 创建画笔对象 17 | draw=ImageDraw.Draw(im) 18 | # 调用画笔打point()函数绘制噪点 19 | for i in range(0,100): 20 | xy=(random.randrange(0,width),random.randrange(0,height)) 21 | fill=(random.randrange(0,255),255,random.randrange(0,255)) 22 | draw.point(xy,fill=fill) 23 | # 定义产生验证码的素材字符 24 | str1='ABCD123EFGHIJK456LMNOPQRS789TUVWXYZ0' 25 | # 随机选择4个值作为验证码 26 | rand_str='' 27 | for i in range(0,4): 28 | rand_str+=str1[random.randrange(0,len(str1))] 29 | # 构造字体对象 30 | font=ImageFont.truetype('FreeMono.ttf',27) 31 | # 构造字体颜色 32 | fontcolor=(255,random.randrange(0,255),random.randrange(0,255)) 33 | # 绘制4个字[第一个参数表示距离左边的位置] 34 | draw.text((5,2),rand_str[0],font=font,fill=fontcolor) 35 | draw.text((25,2),rand_str[1],font=font,fill=fontcolor) 36 | draw.text((50,2),rand_str[2],font=font,fill=fontcolor) 37 | draw.text((75,2),rand_str[3],font=font,fill=fontcolor) 38 | # 释放画笔 39 | del draw 40 | # 存入session用于做进一步验证 41 | request.session['verifycode']=rand_str 42 | # 内存文件操作 43 | buf=cStringIO 44 | buf=cStringIO.StringIO() 45 | # 将图片保存在内存中,文件类型为png 46 | im.save(buf,'png') 47 | # 将内存中的图片数据返回给客户端,MIME类型为图片png 48 | return HttpResponse(buf.getvalue(),'image/png') -------------------------------------------------------------------------------- /static/js/jquery.fly.min.js: -------------------------------------------------------------------------------- 1 | /*! fly - v1.0.0 - 2014-12-22 2 | * https://github.com/amibug/fly 3 | * Copyright (c) 2014 wuyuedong; Licensed MIT */ 4 | !function(a){a.fly=function(b,c){var d={version:"1.0.0",autoPlay:!0,vertex_Rtop:20,speed:1.2,start:{},end:{},onEnd:a.noop},e=this,f=a(b);e.init=function(a){this.setOptions(a),!!this.settings.autoPlay&&this.play()},e.setOptions=function(b){this.settings=a.extend(!0,{},d,b);var c=this.settings,e=c.start,g=c.end;f.css({marginTop:"0px",marginLeft:"0px",position:"fixed"}).appendTo("body"),null!=g.width&&null!=g.height&&a.extend(!0,e,{width:f.width(),height:f.height()});var h=Math.min(e.top,g.top)-Math.abs(e.left-g.left)/3;hd?0:(d-j)/(e-j)*Math.PI/2),l=g.height-(g.height-c.height)*Math.cos(j>d?0:(d-j)/(e-j)*Math.PI/2);f.css({width:k+"px",height:l+"px","font-size":Math.min(k,l)+"px"})}f.css({left:h+"px",top:i+"px"}),b.count++;var m=window.requestAnimationFrame(a.proxy(this.move,this));d==e&&(window.cancelAnimationFrame(m),b.onEnd.apply(this))},e.destory=function(){f.remove()},e.init(c)},a.fn.fly=function(b){return this.each(function(){void 0==a(this).data("fly")&&a(this).data("fly",new a.fly(this,b))})}}(jQuery); -------------------------------------------------------------------------------- /templates/freshFruit/register.html: -------------------------------------------------------------------------------- 1 | {%extends 'freshFruit/base.html'%} 2 | {% load static from staticfiles %} 3 | 4 | {%block title%}天天生鲜-注册{%endblock%} 5 | {%block top%} 6 | 7 | 8 | {%endblock%} 9 | 10 | 11 | {%block content%} 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 | {%endblock%} -------------------------------------------------------------------------------- /detail/views.py: -------------------------------------------------------------------------------- 1 | # coding=utf-8 2 | from django.shortcuts import render 3 | from django.http import * 4 | from models import * 5 | from datetime import datetime 6 | from usercenter import der 7 | from django.core.urlresolvers import reverse 8 | 9 | 10 | @der.login_name 11 | def detail(request,dic): 12 | ''' 13 | 商品详情页呈现 14 | ''' 15 | goodsId=request.GET.get('goodsId') 16 | if goodsId: 17 | good = Goods.objects.get(pk=goodsId) 18 | newgoodslist=good.goodSort.goods_set.all().order_by("-gPubdate")[0:2] 19 | 20 | GoodsComment=good.goodscomment_set.all().order_by("-commentDate")[0:2] 21 | if dic['user']: 22 | flag=False 23 | rece= dic['user'].recentsee_set.all().order_by('-id')[0:5] 24 | for i in rece: 25 | if i.goodsName==goodsId: 26 | flag=True 27 | if not flag: 28 | rec=RecentSee() 29 | rec.goodsName=goodsId 30 | rec.user_id=dic['user'].id 31 | rec.save() 32 | 33 | SortsMsg=GoodSort.objects.all() 34 | dic2 ={ 35 | 'SortsMsg':SortsMsg, 36 | 'goodSort':good.goodSort, 37 | 'good':good, 38 | 'newgoodslist':newgoodslist, 39 | 'GoodsComment':GoodsComment, 40 | } 41 | dic=dict(dic, **dic2) 42 | return render(request,'freshFruit/detail.html',dic) 43 | 44 | @der.login_yz 45 | def comment(request,gid): 46 | ''' 47 | 商品评论 48 | ''' 49 | comment=request.POST.get('comment',None) 50 | if comment and gid: 51 | goodc=GoodsComment() 52 | goodc.userName=request.session['name'] 53 | goodc.commentDate=datetime.now() 54 | goodc.comment=comment 55 | goodc.goods_id=int(gid) 56 | goodc.save() 57 | 58 | return HttpResponseRedirect('/detail/?goodsId='+gid) 59 | @der.login_yz 60 | def addcart(request): 61 | ''' 62 | 加入购物车操作,写入数据库 63 | ''' 64 | goodsID=request.POST.get('goodsName',None) 65 | buyCount=request.POST.get('buyCount',None) 66 | if goodsID and buyCount: 67 | name=request.session['name'] 68 | user=UserInfo.objects.get(uName=name) 69 | cart=Cart() 70 | cart.goodsName=goodsID #goodsName存储商品id 字符串类型,待修改 71 | cart.buyCount=int(buyCount) 72 | cart.userCart_id=user.pk 73 | cart.save() 74 | number=user.cart_set.filter(isDelete=False).count() 75 | return JsonResponse({'number':number}) 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | -------------------------------------------------------------------------------- /templates/search/search.html: -------------------------------------------------------------------------------- 1 | {%extends 'freshFruit/base_index.html'%} 2 | {% load static from staticfiles %} 3 | {%block title%}天天生鲜-搜索展示页{%endblock%} 4 | {%block content%} 5 | 8 |
9 | 10 |
35 | {% endif %} 36 | 37 | 38 |
39 | 40 | 41 | 68 | {%endblock%} -------------------------------------------------------------------------------- /templates/freshFruit/changekw.html: -------------------------------------------------------------------------------- 1 | {%extends 'freshFruit/base.html'%} 2 | {% load static from staticfiles %} 3 | 4 | {%block title%}天天生鲜-密码修改{%endblock%} 5 | {%block top%} 6 | 7 | 8 | {%endblock%} 9 | 10 | 11 | {%block content%} 12 |
13 |
14 | 15 |
足不出户 · 新鲜每一天
16 |
17 |
18 | 19 |
20 |
21 |

密码修改

22 | 登录 23 |
24 |
25 |
26 |
    27 |
  • 28 | 29 | 30 | 提示信息 31 |
  • 32 |
  • 33 | 34 | 35 |
    {{error.email}}
    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 | 66 | {%endblock%} 67 | -------------------------------------------------------------------------------- /templates/freshFruit/base.html: -------------------------------------------------------------------------------- 1 | {% load static from staticfiles %} 2 | 3 | 4 | 5 | {%block title%}{%endblock%} 6 | 7 | 8 | 9 | 10 | {%block top%} 11 |
12 |
13 |
欢迎来到天天生鲜!
14 |
15 | 18 | 23 | 24 | 25 | 29 | 30 | 38 |
39 |
40 |
41 | 42 | 57 | 58 | {%endblock%} 59 | 60 | {%block menu%}{%endblock%} 61 | 62 | {%block content%}{%endblock%} 63 | 64 | {%block class%} 78 | 79 | -------------------------------------------------------------------------------- /goodslist/views.py: -------------------------------------------------------------------------------- 1 | # coding=utf-8 2 | from django.shortcuts import render 3 | from django.http import * 4 | from models import * 5 | from datetime import datetime 6 | from django.core.urlresolvers import reverse 7 | from django.core.paginator import Paginator 8 | from usercenter import der 9 | 10 | @der.login_name 11 | def list(request,dic): 12 | ''' 13 | 商品列表呈现,默认以id排序,可以接收参数按照价格以及购买数量排序,新品推荐取出最新两个种类的商品 14 | ''' 15 | sort = request.GET.get('sort', None) 16 | if sort == '' or sort == None: 17 | sort = 1 18 | sort = int(sort) 19 | goodsort = GoodSort.objects.get(id=sort) 20 | 21 | goodslist = goodsort.goods_set.all() 22 | 23 | newgoodslist = goodslist.order_by("-gPubdate")[0:2] # 新品推荐 24 | 25 | order = request.GET.get('order', None) 26 | if order == '' or order == None: 27 | order = 'id' 28 | if order == 'price': 29 | orderlist = goodslist.order_by('goodsPrice') # 排序后的集合 30 | active = {'price': 'active'} 31 | elif order == 'id': 32 | orderlist = goodslist.order_by('id') 33 | active = {'id': 'active'} 34 | elif order == 'count': 35 | orderlist = goodslist.order_by('-saleCount') 36 | active = {'count': 'active'} 37 | else: 38 | return HttpResponse('404') 39 | 40 | pIndex = request.GET.get('page', None) 41 | orderlist2, plist, pIndex = pagTab(orderlist, pIndex, 5) # 分页 42 | if len(plist)>=3: #页码显示页数 43 | if len(plist)==pIndex: 44 | plist=plist[pIndex-3:pIndex] 45 | elif pIndex==1: 46 | plist=plist[0:pIndex+2] 47 | else: 48 | plist=plist[pIndex-2:pIndex+1] 49 | SortsMsg=GoodSort.objects.all() 50 | data = {'goodslist': { 51 | 'newgoodslist': newgoodslist, 52 | 'orderlist': orderlist2, 53 | 'active': active, 54 | 'plist': plist, 55 | 'pIndex': pIndex, 56 | 'ordertype': order, 57 | 'pIndex': pIndex, 58 | 'goodsort': goodsort 59 | }, 60 | 'SortsMsg':SortsMsg 61 | } 62 | dic=dict(dic,**data) 63 | 64 | return render(request, 'freshFruit/list.html', dic) 65 | 66 | 67 | def pagTab(list1, pIndex, num): 68 | ''' 69 | 分页函数 70 | ''' 71 | p = Paginator(list1, num) 72 | if pIndex == '' or pIndex == None: 73 | pIndex = '1' 74 | pIndex = int(pIndex) 75 | list2 = p.page(pIndex) 76 | plist = p.page_range 77 | return list2, plist, pIndex 78 | -------------------------------------------------------------------------------- /templates/freshFruit/login.html: -------------------------------------------------------------------------------- 1 | {%extends 'freshFruit/base.html'%} 2 | {% load static from staticfiles %} 3 | 4 | {%block title%}天天生鲜-登录{%endblock%} 5 | {%block top%}{%endblock%} 6 | 7 | 8 | {%block content%} 9 | 10 | 17 | 18 |
19 | 20 |
21 | 22 |
23 |
24 | 25 |
日夜兼程 · 急速送达
26 | 53 |
54 |
55 | 56 | 60 | {%endblock%} 61 | {%block class%} 43 | 75 | 76 | 77 | {%endblock%} -------------------------------------------------------------------------------- /templates/freshFruit/callus.html: -------------------------------------------------------------------------------- 1 | {% load static from staticfiles %} 2 | 3 | 4 | 5 | 6 | 联系我们 7 | 8 | 9 | 10 | 11 | 26 | 27 | 68 | 69 | 70 |
12 | 13 | 14 | 15 | 16 | 17 | 20 | 21 | 22 | 23 | 24 |
18 | 19 |
call us:
654388888
daydayfresh@163.com
25 |
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 |
公司大事记
2008.09-2011.06 公司挂牌成立
2011.06-2012.09 公司推出互联网平台
58 |
59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 |
公司位置
公司位于美丽的海淀区,地理位置优越,欢迎前来进行洽谈。
67 |
71 | 72 | -------------------------------------------------------------------------------- /templates/freshFruit/index.html: -------------------------------------------------------------------------------- 1 | {%extends 'freshFruit/base_index.html'%} 2 | 3 | {% load static from staticfiles %} 4 | 5 | {%block title%}天天生鲜首页{%endblock%} 6 | 7 | 8 | {%block content%} 9 | 10 | 11 | 23 |
24 | 29 | 30 |
31 | 37 | 38 | 39 | 40 |
41 |
42 | 43 | 44 |
45 |
46 | 47 | 48 | 49 | {%for i in message %} 50 |
51 |
52 | 53 |

{{i.sort.sortName}}

54 |
55 | | 56 | 57 | {%for ogood in i.goodOtherList%} 58 | {{ogood.goodsName}} 59 | {%endfor%} 60 | 61 |
62 | 查看更多 > 63 |
64 |
65 |
66 | 76 |
77 | {%endfor%} 78 | 79 | 80 | {%endblock%} 81 | 82 | {% block navlist %} 83 | {% endblock %} -------------------------------------------------------------------------------- /templates/freshFruit/aboutus.html: -------------------------------------------------------------------------------- 1 | {% load static from staticfiles %} 2 | 3 | 4 | 5 | 6 | 关于我们 7 | 8 | 9 | 10 | 11 | 26 | 27 | 71 | 72 | 73 |
12 | 13 | 14 | 15 | 16 | 17 | 20 | 21 | 22 | 23 | 24 |
18 | 19 |
call us:
654388888
daydayfresh@163.com
25 |
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 |
公司大事记
2008.09-2011.06 公司挂牌成立
2011.06-2012.09 公司推出互联网平台
58 |
59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 |
所获荣誉
2009年:荣获"健康肉类"证书
2009年:荣获"可靠放心产品"证书
70 |
74 | 75 | -------------------------------------------------------------------------------- /templates/freshFruit/choujiang.html: -------------------------------------------------------------------------------- 1 | {%extends 'freshFruit/base_index.html'%} {% load static from staticfiles %} {% block top %} {% endblock top %} {% block menu %} {% endblock menu %} {%block title%}天天生鲜-抽奖系统{%endblock%} {%block content%}
{%endblock%} {% block navlist %} {% endblock %} -------------------------------------------------------------------------------- /static/js/slide.js: -------------------------------------------------------------------------------- 1 | $(function(){ 2 | var $slides = $('.slide_pics li'); 3 | var len = $slides.length; 4 | var nowli = 0; 5 | var prevli = 0; 6 | var $prev = $('.prev'); 7 | var $next = $('.next'); 8 | var ismove = false; 9 | var timer = null; 10 | $slides.not(':first').css({left:760}); 11 | $slides.each(function(index, el) { 12 | var $li = $('
  • '); 13 | 14 | if(index==0) 15 | { 16 | $li.addClass('active'); 17 | } 18 | 19 | $li.appendTo($('.points')); 20 | }); 21 | $points = $('.points li'); 22 | timer = setInterval(autoplay,4000); 23 | 24 | $('.slide').mouseenter(function() { 25 | clearInterval(timer); 26 | }); 27 | 28 | $('.slide').mouseleave(function() { 29 | timer = setInterval(autoplay,4000); 30 | }); 31 | 32 | function autoplay(){ 33 | nowli++; 34 | move(); 35 | $points.eq(nowli).addClass('active').siblings().removeClass('active'); 36 | } 37 | 38 | $points.click(function(event) { 39 | if(ismove) 40 | { 41 | return; 42 | } 43 | nowli = $(this).index(); 44 | 45 | if(nowli==prevli) 46 | { 47 | return; 48 | } 49 | 50 | $(this).addClass('active').siblings().removeClass('active'); 51 | move(); 52 | 53 | }); 54 | 55 | $prev.click(function() { 56 | if(ismove) 57 | { 58 | return; 59 | } 60 | nowli--; 61 | move(); 62 | $points.eq(nowli).addClass('active').siblings().removeClass('active'); 63 | 64 | }); 65 | 66 | $next.click(function() { 67 | if(ismove) 68 | { 69 | return; 70 | } 71 | nowli++; 72 | move(); 73 | $points.eq(nowli).addClass('active').siblings().removeClass('active'); 74 | 75 | }); 76 | 77 | 78 | function move(){ 79 | 80 | ismove = true; 81 | 82 | if(nowli<0) 83 | { 84 | nowli=len-1; 85 | prevli = 0 86 | $slides.eq(nowli).css({left:-760}); 87 | $slides.eq(nowli).animate({left:0},800,'easeOutExpo'); 88 | $slides.eq(prevli).animate({left:760},800,'easeOutExpo',function(){ 89 | ismove = false; 90 | }); 91 | prevli=nowli; 92 | return; 93 | } 94 | 95 | if(nowli>len-1) 96 | { 97 | nowli = 0; 98 | prevli = len-1; 99 | $slides.eq(nowli).css({left:760}); 100 | $slides.eq(nowli).animate({left:0},800,'easeOutExpo'); 101 | $slides.eq(prevli).animate({left:-760},800,'easeOutExpo',function(){ 102 | ismove = false; 103 | }); 104 | prevli=nowli; 105 | return; 106 | } 107 | 108 | 109 | if(prevli20) 45 | { 46 | $('#user_name').next().html('请输入5-20个字符的用户名') 47 | $('#user_name').next().show(); 48 | error_name = true; 49 | } 50 | else 51 | { 52 | regcheck(); 53 | // $('#user_name').next().hide(); 54 | // error_name = false; 55 | } 56 | } 57 | 58 | function regcheck(){ 59 | $.ajax({ 60 | url: '/regcheck/', 61 | type: 'GET', 62 | dataType: 'json', 63 | data:{'name':$('#user_name').val()} 64 | }) 65 | .done(function(data) { 66 | if (data.find=='False'){ 67 | $('#user_name').next().html('用户名不存在'); 68 | $('#user_name').next().show(); 69 | error_name = true; 70 | } 71 | else{ 72 | error_name = false; 73 | $('#user_name').next().hide(); 74 | } 75 | }) 76 | .fail(function() { 77 | error_name = true; 78 | alert('服务器超时,请重试!'); 79 | }); 80 | } 81 | 82 | 83 | function check_pwd(){ 84 | var len = $('#pwd').val().length; 85 | if(len<8||len>20) 86 | { 87 | $('#pwd').next().html('密码最少8位,最长20位') 88 | $('#pwd').next().show(); 89 | error_password = true; 90 | } 91 | else 92 | { 93 | $('#pwd').next().hide(); 94 | error_password = false; 95 | } 96 | } 97 | 98 | 99 | 100 | function check_cpwd(){ 101 | var pass = $('#pwd').val(); 102 | var cpass = $('#cpwd').val(); 103 | 104 | if(pass!=cpass) 105 | { 106 | $('#cpwd').next().html('两次输入的密码不一致') 107 | $('#cpwd').next().show(); 108 | error_check_password = true; 109 | } 110 | else 111 | { 112 | $('#cpwd').next().hide(); 113 | error_check_password = false; 114 | } 115 | 116 | } 117 | 118 | function check_email(){ 119 | var re = /^[a-z0-9][\w\.\-]*@[a-z0-9\-]+(\.[a-z]{2,5}){1,2}$/; 120 | 121 | if(re.test($('#email').val())) 122 | { 123 | $('#email').next().hide(); 124 | error_email = false; 125 | } 126 | else 127 | { 128 | $('#email').next().html('你输入的邮箱格式不正确') 129 | $('#email').next().show(); 130 | error_check_password = true; 131 | } 132 | 133 | } 134 | 135 | 136 | $('#reg_form').submit(function() { 137 | check_user_name(); 138 | check_pwd(); 139 | check_cpwd(); 140 | check_email(); 141 | 142 | if(error_name == false && error_password == false && error_check_password == false && error_email == false && error_check == false ) 143 | { 144 | return true; 145 | } 146 | else 147 | { 148 | return false; 149 | } 150 | 151 | }); 152 | 153 | 154 | }) -------------------------------------------------------------------------------- /templates/freshFruit/list.html: -------------------------------------------------------------------------------- 1 | {%extends 'freshFruit/base_index.html'%} 2 | {% load static from staticfiles %} 3 | {%block title%}天天生鲜-商品列表{%endblock%} 4 | 5 | {%block content%} 6 | 11 | 12 |
    13 |
    14 |
    15 |

    新品推荐

    16 |
      17 | {% for i in goodslist.newgoodslist%} 18 |
    • 19 | 20 |

      {{i.goodsName}}

      21 |
      ¥{{i.goodsPrice}}
      22 |
    • 23 | {%endfor%} 24 | 25 |
    26 |
    27 |
    28 | 29 |
    30 |
    31 | 默认 32 | 价格 33 | 人气 34 |
    35 | 36 |
      37 | {% for i in goodslist.orderlist%} 38 |
    • 39 | 40 |

      {{i.goodsName}}

      41 |
      42 | ¥{{i.goodsPrice}} 43 | {{i.goodsPrice}}/500g 44 | 45 |
      46 |
    • 47 | {%endfor%} 48 | 49 |
    50 | 51 |
    52 | <上一页 53 | {%for i in goodslist.plist%} 54 | {{i}} 55 | {%endfor%} 56 | 下一页> 57 |
    58 |
    59 |
    60 | 61 | 99 | {%endblock%} -------------------------------------------------------------------------------- /static/js/register.js: -------------------------------------------------------------------------------- 1 | $(function(){ 2 | 3 | var error_name = false; 4 | var error_password = false; 5 | var error_check_password = false; 6 | var error_email = false; 7 | var error_check = false; 8 | 9 | 10 | 11 | $('#user_name').blur(function() { 12 | check_user_name(); 13 | }); 14 | 15 | $('#pwd').blur(function() { 16 | check_pwd(); 17 | }); 18 | 19 | $('#cpwd').blur(function() { 20 | check_cpwd(); 21 | }); 22 | 23 | $('#email').blur(function() { 24 | check_email(); 25 | }); 26 | 27 | $('#allow').click(function() { 28 | if($(this).is(':checked')) 29 | { 30 | error_check = false; 31 | $(this).siblings('span').hide(); 32 | } 33 | else 34 | { 35 | error_check = true; 36 | $(this).siblings('span').html('请勾选同意'); 37 | $(this).siblings('span').show(); 38 | } 39 | }); 40 | 41 | 42 | function check_user_name(){ 43 | var len = $('#user_name').val().length; 44 | if(len<5||len>20) 45 | { 46 | $('#user_name').next().html('请输入5-20个字符的用户名') 47 | $('#user_name').next().show(); 48 | error_name = true; 49 | } 50 | else 51 | { 52 | regcheck(); 53 | // $('#user_name').next().hide(); 54 | // error_name = false; 55 | } 56 | } 57 | 58 | function regcheck(){ 59 | $.ajax({ 60 | url: '/regcheck/', 61 | type: 'GET', 62 | dataType: 'json', 63 | data:{'name':$('#user_name').val()} 64 | }) 65 | .done(function(data) { 66 | if (data.find=='False'){ 67 | error_name = false; 68 | $('#user_name').next().hide(); 69 | } 70 | else{ 71 | $('#user_name').next().html('用户名已存在'); 72 | $('#user_name').next().show(); 73 | error_name = true; 74 | } 75 | }) 76 | .fail(function() { 77 | error_name = true; 78 | alert('服务器超时,请重试!'); 79 | }); 80 | } 81 | 82 | 83 | function check_pwd(){ 84 | var len = $('#pwd').val().length; 85 | if(len<8||len>20) 86 | { 87 | $('#pwd').next().html('密码最少8位,最长20位') 88 | $('#pwd').next().show(); 89 | error_password = true; 90 | } 91 | else 92 | { 93 | $('#pwd').next().hide(); 94 | error_password = false; 95 | } 96 | } 97 | 98 | 99 | 100 | function check_cpwd(){ 101 | var pass = $('#pwd').val(); 102 | var cpass = $('#cpwd').val(); 103 | 104 | if(pass!=cpass) 105 | { 106 | $('#cpwd').next().html('两次输入的密码不一致') 107 | $('#cpwd').next().show(); 108 | error_check_password = true; 109 | } 110 | else 111 | { 112 | $('#cpwd').next().hide(); 113 | error_check_password = false; 114 | } 115 | 116 | } 117 | 118 | function check_email(){ 119 | var re = /^[a-z0-9][\w\.\-]*@[a-z0-9\-]+(\.[a-z]{2,5}){1,2}$/; 120 | 121 | if(re.test($('#email').val())) 122 | { 123 | $('#email').next().hide(); 124 | error_email = false; 125 | } 126 | else 127 | { 128 | $('#email').next().html('你输入的邮箱格式不正确') 129 | $('#email').next().show(); 130 | error_check_password = true; 131 | } 132 | 133 | } 134 | 135 | 136 | $('#reg_form').submit(function() { 137 | check_user_name(); 138 | check_pwd(); 139 | check_cpwd(); 140 | check_email(); 141 | 142 | if(error_name == false && error_password == false && error_check_password == false && error_email == false && error_check == false ) 143 | { 144 | return true; 145 | } 146 | else 147 | { 148 | return false; 149 | } 150 | 151 | }); 152 | 153 | 154 | }) -------------------------------------------------------------------------------- /static/js/jquery.cookie.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * jQuery Cookie Plugin v1.4.1 3 | * https://github.com/carhartl/jquery-cookie 4 | * 5 | * Copyright 2013 Klaus Hartl 6 | * Released under the MIT license 7 | */ 8 | (function (factory) { 9 | if (typeof define === 'function' && define.amd) { 10 | // AMD 11 | define(['jquery'], factory); 12 | } else if (typeof exports === 'object') { 13 | // CommonJS 14 | factory(require('jquery')); 15 | } else { 16 | // Browser globals 17 | factory(jQuery); 18 | } 19 | }(function ($) { 20 | 21 | var pluses = /\+/g; 22 | 23 | function encode(s) { 24 | return config.raw ? s : encodeURIComponent(s); 25 | } 26 | 27 | function decode(s) { 28 | return config.raw ? s : decodeURIComponent(s); 29 | } 30 | 31 | function stringifyCookieValue(value) { 32 | return encode(config.json ? JSON.stringify(value) : String(value)); 33 | } 34 | 35 | function parseCookieValue(s) { 36 | if (s.indexOf('"') === 0) { 37 | // This is a quoted cookie as according to RFC2068, unescape... 38 | s = s.slice(1, -1).replace(/\\"/g, '"').replace(/\\\\/g, '\\'); 39 | } 40 | 41 | try { 42 | // Replace server-side written pluses with spaces. 43 | // If we can't decode the cookie, ignore it, it's unusable. 44 | // If we can't parse the cookie, ignore it, it's unusable. 45 | s = decodeURIComponent(s.replace(pluses, ' ')); 46 | return config.json ? JSON.parse(s) : s; 47 | } catch(e) {} 48 | } 49 | 50 | function read(s, converter) { 51 | var value = config.raw ? s : parseCookieValue(s); 52 | return $.isFunction(converter) ? converter(value) : value; 53 | } 54 | 55 | var config = $.cookie = function (key, value, options) { 56 | 57 | // Write 58 | 59 | if (value !== undefined && !$.isFunction(value)) { 60 | options = $.extend({}, config.defaults, options); 61 | 62 | if (typeof options.expires === 'number') { 63 | var days = options.expires, t = options.expires = new Date(); 64 | t.setTime(+t + days * 864e+5); 65 | } 66 | 67 | return (document.cookie = [ 68 | encode(key), '=', stringifyCookieValue(value), 69 | options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE 70 | options.path ? '; path=' + options.path : '', 71 | options.domain ? '; domain=' + options.domain : '', 72 | options.secure ? '; secure' : '' 73 | ].join('')); 74 | } 75 | 76 | // Read 77 | 78 | var result = key ? undefined : {}; 79 | 80 | // To prevent the for loop in the first place assign an empty array 81 | // in case there are no cookies at all. Also prevents odd result when 82 | // calling $.cookie(). 83 | var cookies = document.cookie ? document.cookie.split('; ') : []; 84 | 85 | for (var i = 0, l = cookies.length; i < l; i++) { 86 | var parts = cookies[i].split('='); 87 | var name = decode(parts.shift()); 88 | var cookie = parts.join('='); 89 | 90 | if (key && key === name) { 91 | // If second argument (value) is a function it's a converter... 92 | result = read(cookie, value); 93 | break; 94 | } 95 | 96 | // Prevent storing a cookie that we couldn't decode. 97 | if (!key && (cookie = read(cookie)) !== undefined) { 98 | result[name] = cookie; 99 | } 100 | } 101 | 102 | return result; 103 | }; 104 | 105 | config.defaults = {}; 106 | 107 | $.removeCookie = function (key, options) { 108 | if ($.cookie(key) === undefined) { 109 | return false; 110 | } 111 | 112 | // Must not alter options, thus extending a fresh object... 113 | $.cookie(key, '', $.extend({}, options, { expires: -1 })); 114 | return !$.cookie(key); 115 | }; 116 | 117 | })); 118 | -------------------------------------------------------------------------------- /templates/freshFruit/user_center_site.html: -------------------------------------------------------------------------------- 1 | {%extends 'freshFruit/base_user.html'%} 2 | {% load static from staticfiles %} 3 | {%block option%}用户中心{%endblock%} 4 | {%block tab_site%}
  • · 收货地址
  • {%endblock %} 5 | 6 | {%block content%} 7 | 8 |
    9 |

    收货地址

    10 |
    11 |
    12 | {% for i in addrinfo%} 13 |
    {{ i.aProvince }} {{ i.aCity }} {%if i.aDis != None %}{{ i.aDis }}{%endif%} {{i.aDetaAddr}}({{ i.aAddressee }} 收) {{i.aPhoneNumber}} 14 | {% if i.default %} 15 |
    默认地址
    16 | {% else %} 17 | 设为默认 18 | 删除 19 | {% endif %} 20 |
    21 | {%endfor%} 22 |
    23 |
    24 | 25 |

    编辑地址

    26 |
    27 |
    28 |
    29 | 30 | 31 |
    32 | 33 |
    34 | 35 | 38 | 41 | 44 |
    45 |
    46 | 47 | 48 |
    49 |
    50 | 51 | 52 |
    53 |
    54 | 55 | 56 |
    57 | 58 | 59 |
    60 |
    61 |
    62 | 63 | 64 | 65 | 100 | {%endblock%} -------------------------------------------------------------------------------- /cart/views.py: -------------------------------------------------------------------------------- 1 | #coding=utf-8 2 | from django.shortcuts import render,redirect 3 | from django.core.urlresolvers import reverse 4 | from django.http import * 5 | from models import * 6 | from django.db.models import * 7 | from datetime import datetime 8 | import time 9 | from usercenter import der 10 | @der.login_yz 11 | @der.login_name 12 | def cart(request,dic): 13 | ''' 14 | 从数据库读取购物信息 15 | ''' 16 | cartlist = dic['user'].cart_set.all().filter(isDelete=False) 17 | car_good_list=[] 18 | for car in cartlist: 19 | car_good_list.append({'cart':car,'good':Goods.objects.get(id=int(car.goodsName))}) 20 | dic=dict(dic,**{'lis':car_good_list}) 21 | 22 | return render(request,"freshFruit/cart.html",dic) 23 | 24 | @der.login_yz 25 | def deleteHander(request): 26 | ''' 27 | 购物车删除操作,逻辑删除 28 | ''' 29 | cartId=request.POST.get('cartId',None) 30 | print cartId 31 | if cartId: 32 | cart=Cart.objects.get(id=int(cartId)) 33 | cart.isDelete=True 34 | cart.save() 35 | return JsonResponse({'response':'1'}) 36 | 37 | 38 | @der.login_yz 39 | @der.login_name 40 | def place_order(request,dic): 41 | ''' 42 | 订单信息,取出购物车信息,或者立即购买的信息 43 | ''' 44 | cartId=[] 45 | if request.method == 'GET': 46 | count=request.GET.get('count',None) 47 | goodId=request.GET.get('id',None) 48 | goodId=[goodId] 49 | elif request.method == 'POST': 50 | count=request.POST.getlist('count',None) 51 | cartId=request.POST.getlist('id',None) 52 | goodId=[] 53 | j=0 54 | for i in cartId: 55 | cart=Cart.objects.get(id=int(i)) 56 | goodId.append(cart.goodsName) 57 | if int(count[j]) != cart.buyCount: 58 | cart.buyCount=int(count[j]) 59 | cart.save() 60 | j += 1 61 | else: 62 | pass 63 | 64 | orderlist=[] 65 | freight = 10 66 | sumprice=0 67 | for i in range(len(goodId)): 68 | goods = Goods.objects.get(id=int(goodId[i])) 69 | orderdic={'goods':goods,'count':i+1,'sumtotal':goods.goodsPrice*int(count[i]),'goodscount':count[i]} 70 | if len(cartId)>0: 71 | orderdic['cartId']=cartId[i] 72 | orderlist.append(orderdic) 73 | sumprice += goods.goodsPrice*int(count[i]) 74 | # area = AddrInfo.objects.filter(aUser_id=user.id).get(aDefaultAddr=True) 75 | AddrList=dic['user'].addrinfo_set.all() 76 | 77 | dic=dict(dic,**{ 78 | 'AddrList':AddrList, 79 | 'orderlist':orderlist, 80 | 'allprice':sumprice+freight, 81 | 'freight':freight, 82 | 'goodsamount':len(goodId), 83 | 'alltotal': sumprice, 84 | 'cartId':cartId, 85 | }) 86 | return render(request,"freshFruit/place_order.html",dic) 87 | 88 | @der.login_yz 89 | @der.login_name 90 | def place_hander(request,dic): 91 | ''' 92 | 订单处理,提交订单后删除购物车信息,生成订单,转向用户订单页 93 | ''' 94 | addr= request.POST.get('addr') 95 | goodscount=request.POST.get('goodscount') 96 | goodsId= request.POST.get('goodsId') #如果是立即购买的获取物品id 97 | cartIdList= request.POST.getlist('cartId') #如果是购物车结算的的获取购物车id 98 | 99 | orders=Orders() 100 | orders.orderTime=datetime.now() 101 | orders.orderNumber=str(int(time.time())) 102 | orders.userOrder_id=dic['user'].id 103 | orders.addr=int(addr) 104 | orders.save() 105 | if cartIdList[0]: 106 | for i in cartIdList: 107 | cart=Cart.objects.get(id=int(i)) 108 | goods=Goods.objects.get(id=int(cart.goodsName)) 109 | OrderDetail=orders.orderdetail_set.create(goodsName=goods.goodsName,goodsPrice=goods.goodsPrice,buyCount=cart.buyCount,good_id_id=goods.id) 110 | OrderDetail.save() 111 | cart.isDelete=True 112 | cart.save() 113 | else: 114 | goods=Goods.objects.get(id=int(goodsId)) 115 | orders.orderdetail_set.create(goodsName=goods.goodsName,goodsPrice=goods.goodsPrice,buyCount=int(goodscount),good_id_id=goods.id) 116 | return HttpResponseRedirect(reverse('usercenter:user_center_order')) 117 | 118 | 119 | 120 | -------------------------------------------------------------------------------- /templates/freshFruit/place_order.html: -------------------------------------------------------------------------------- 1 | {%extends 'freshFruit/base_user.html'%} 2 | {% load static from staticfiles %} 3 | {%block title%}天天生鲜-提交订单{%endblock%} 4 | {%block option%}提交订单{%endblock%} 5 | {%block user_message%}{%endblock%} 6 | 7 | {%block content%} 8 |

    确认收货地址

    9 |
    10 |
    11 |
    12 |
    寄送到:
    13 | {% for area in AddrList %} 14 |
    {{area.aProvince}} {{area.aCity}} {{area.aDis}} {{area.aDetaAddr}}({{area.aAddressee}} 收) {%for i in area.aPhoneNumber%}{%if forloop.counter <= 3 or forloop.counter > 7%}{{i}}{%else%}*{%endif%}{%endfor%}
    15 | {% endfor %} 16 |
    17 | 编辑收货地址 18 | 19 |
    20 | 21 |

    支付方式

    22 |
    23 |
    24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 |
    33 |
    34 | 35 |

    商品列表

    36 | 37 |
    38 | 45 | {% for i in orderlist %} 46 | 47 | 48 | 49 | 58 | {% endfor %} 59 |
    60 | 61 |

    总金额结算

    62 | 63 |
    64 |
    65 |
    {{goodsamount}}件商品,总金额{{alltotal}}元
    66 |
    运费:{{freight}}元
    67 |
    实付款:{{allprice}}元
    68 |
    69 |
    70 | 71 |
    72 | 73 | 74 |
    75 |
    76 | 106 | {%endblock%} -------------------------------------------------------------------------------- /registerLogin/views.py: -------------------------------------------------------------------------------- 1 | 2 | # coding=utf-8 3 | from django.shortcuts import render 4 | from django.http import * 5 | from models import * 6 | from datetime import datetime 7 | from usercenter import der 8 | import hashlib 9 | 10 | # 验证码测试页 11 | def verify(request): 12 | return render(request,'freshFruit/verify.html') 13 | 14 | def index(request): 15 | return render(request, 'freshFruit/index.html') 16 | 17 | def register(request): 18 | if request.method == 'GET': 19 | return render(request, 'freshFruit/register.html') 20 | elif request.method == 'POST': 21 | user_name = request.POST.get('user_name', None) 22 | password = request.POST.get('pwd', None) 23 | email = request.POST.get('email', None) 24 | if user_name and len(password)>=8 and email: 25 | try: 26 | if UserInfo.objects.get(uName=user_name): 27 | pass 28 | except Exception, e: 29 | user = UserInfo() 30 | user.uName = user_name 31 | n=hashlib.md5() 32 | n.update(password) 33 | user.uPassword = n.hexdigest() 34 | user.uEmail = email 35 | user.uRegDate = datetime.now() 36 | user.save() 37 | print '写入完成' 38 | return HttpResponseRedirect('/login/') 39 | else: 40 | print 'user has exis:不允许注册' 41 | return render(request, 'freshFruit/register.html') 42 | finally: 43 | pass 44 | 45 | 46 | def regcheck(request): 47 | name = request.GET.get('name', None) 48 | if name: 49 | try: 50 | if UserInfo.objects.get(uName=name): 51 | pass 52 | except Exception, e: 53 | print 'exception:注册用户不存在可以注册' 54 | return JsonResponse({'find': 'False'}) 55 | else: 56 | print 'user has exis:不允许注册' 57 | return JsonResponse({'find': 'True'}) 58 | finally: 59 | pass 60 | else: 61 | return HttpResponse('未接受到数据') 62 | 63 | @der.login_name 64 | def login(request,dic): 65 | if request.method == 'GET': 66 | return render(request, 'freshFruit/login.html',dic) 67 | elif request.method == 'POST': 68 | name=request.POST.get('username',None) 69 | password=request.POST.get('pwd',None) 70 | vecode=request.POST.get('ucode') 71 | #先验证验证码防止暴力破解 72 | if vecode.upper()!=request.session['verifycode']: 73 | return render(request, 'freshFruit/login.html',{'error':{'password':'验证码错误'}}) 74 | if name and password: 75 | try: 76 | user = UserInfo.objects.get(uName=name) 77 | # 如果用户密码和验证都正确,登陆成功 78 | n=hashlib.md5() 79 | n.update(password) 80 | if user.uPassword==n.hexdigest(): 81 | if request.POST.get('check', None) == 'on': 82 | request.session['name'] = name 83 | # request.session['password'] = password #状态保持 84 | else: 85 | request.session['name'] = name 86 | request.session.set_expiry(0) #超时测试 87 | return HttpResponseRedirect('/index/') 88 | else: 89 | return render(request, 'freshFruit/login.html',{'error':{'password':'密码输入有误,请重新输入'}}) 90 | except Exception, e: 91 | return render(request, 'freshFruit/login.html',{'error':{'name':'用户名不存在,请重新输入'}}) 92 | else: 93 | pass 94 | else: 95 | return render(request, 'freshFruit/login.html',{'error':{'name':'请输入用户名','password':'请输入密码'}}) 96 | 97 | # 密码修改 98 | def changekw(request): 99 | if request.method == 'GET': 100 | return render(request, 'freshFruit/changekw.html') 101 | elif request.method == 'POST': 102 | user_name = request.POST.get('user_name', None) 103 | password = request.POST.get('pwd', None) 104 | email = request.POST.get('email', None) 105 | if user_name and len(password)>=8 and email: 106 | auser = UserInfo.objects.get(uName=user_name) 107 | if auser.uEmail == email: 108 | n=hashlib.md5() 109 | n.update(password) 110 | auser.uPassword = n.hexdigest() 111 | auser.save() 112 | return HttpResponseRedirect('/login/') 113 | else: 114 | return render(request, 'freshFruit/changekw.html',{'error':{'email':'邮箱错误,请重新输入'}}) 115 | 116 | return render(request, 'freshFruit/changekw.html') 117 | -------------------------------------------------------------------------------- /shop/settings.py: -------------------------------------------------------------------------------- 1 | """ 2 | Django settings for shop project. 3 | 4 | Generated by 'django-admin startproject' using Django 1.8.2. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/1.8/topics/settings/ 8 | 9 | For the full list of settings and their values, see 10 | https://docs.djangoproject.com/en/1.8/ref/settings/ 11 | """ 12 | # coding=utf-8 13 | # Build paths inside the project like this: os.path.join(BASE_DIR, ...) 14 | import os 15 | 16 | BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) 17 | 18 | 19 | # Quick-start development settings - unsuitable for production 20 | # See https://docs.djangoproject.com/en/1.8/howto/deployment/checklist/ 21 | 22 | # SECURITY WARNING: keep the secret key used in production secret! 23 | SECRET_KEY = 'ohdd@qol#)x&)5&h_jq1@e&)5#=f3+37kq0cwv=kq(=f%x#nsx' 24 | 25 | # SECURITY WARNING: don't run with debug turned on in production! 26 | DEBUG = False 27 | 28 | ALLOWED_HOSTS = ['*',] 29 | 30 | 31 | # Application definition 32 | 33 | INSTALLED_APPS = ( 34 | 'django.contrib.admin', 35 | 'django.contrib.auth', 36 | 'django.contrib.contenttypes', 37 | 'django.contrib.sessions', 38 | 'django.contrib.messages', 39 | 'django.contrib.staticfiles', 40 | 'tinymce', 41 | 'registerLogin', 42 | 'usercenter', 43 | 'goodslist', 44 | 'index', 45 | 'detail', 46 | 'cart', 47 | 'haystack', 48 | ) 49 | 50 | MIDDLEWARE_CLASSES = ( 51 | 'django.contrib.sessions.middleware.SessionMiddleware', 52 | 'django.middleware.common.CommonMiddleware', 53 | # 'django.middleware.csrf.CsrfViewMiddleware', 54 | 'django.contrib.auth.middleware.AuthenticationMiddleware', 55 | 'django.contrib.auth.middleware.SessionAuthenticationMiddleware', 56 | 'django.contrib.messages.middleware.MessageMiddleware', 57 | 'django.middleware.clickjacking.XFrameOptionsMiddleware', 58 | 'django.middleware.security.SecurityMiddleware', 59 | ) 60 | 61 | ROOT_URLCONF = 'shop.urls' 62 | 63 | TEMPLATES = [ 64 | { 65 | 'BACKEND': 'django.template.backends.django.DjangoTemplates', 66 | 'DIRS': [os.path.join(BASE_DIR,'templates')], 67 | 'APP_DIRS': True, 68 | 'OPTIONS': { 69 | 'context_processors': [ 70 | 'django.template.context_processors.debug', 71 | 'django.template.context_processors.request', 72 | 'django.contrib.auth.context_processors.auth', 73 | 'django.contrib.messages.context_processors.messages', 74 | ], 75 | }, 76 | }, 77 | ] 78 | 79 | WSGI_APPLICATION = 'shop.wsgi.application' 80 | 81 | 82 | # Database 83 | # https://docs.djangoproject.com/en/1.8/ref/settings/#databases 84 | 85 | DATABASES = { 86 | 'default': { 87 | 'ENGINE': 'django.db.backends.mysql', 88 | 'NAME': 'shopping', 89 | 'HOST':'localhost', 90 | 'PORT':'3306', 91 | 'USER':'root', 92 | 'PASSWORD':'mysql', 93 | } 94 | } 95 | 96 | 97 | # Internationalization 98 | # https://docs.djangoproject.com/en/1.8/topics/i18n/ 99 | 100 | LANGUAGE_CODE = 'zh-Hans' 101 | 102 | TIME_ZONE = 'Asia/Shanghai' 103 | 104 | USE_I18N = True 105 | 106 | USE_L10N = True 107 | 108 | USE_TZ = True 109 | 110 | 111 | # Static files (CSS, JavaScript, Images) 112 | # https://docs.djangoproject.com/en/1.8/howto/static-files/ 113 | 114 | STATIC_URL = '/static/' 115 | MEDIA_ROOT=os.path.join(BASE_DIR,"static") 116 | STATICFILES_DIRS = [ 117 | os.path.join(BASE_DIR, 'static'), 118 | ] 119 | STATIC_ROOT='/var/www/shop/static/' 120 | STATIC_URL='/static/' 121 | 122 | 123 | TINYMCE_DEFAULT_CONFIG = { 124 | 'theme': 'advanced', 125 | 'width': 600, 126 | 'height': 400, 127 | } 128 | 129 | HAYSTACK_CONNECTIONS = { 130 | 'default': { 131 | 'ENGINE': 'haystack.backends.whoosh_cn_backend.WhooshEngine', 132 | 'PATH': os.path.join(BASE_DIR, 'whoosh_index'), 133 | } 134 | } 135 | 136 | 137 | HAYSTACK_SIGNAL_PROCESSOR = 'haystack.signals.RealtimeSignalProcessor' -------------------------------------------------------------------------------- /templates/freshFruit/user_center_order.html: -------------------------------------------------------------------------------- 1 | {%extends 'freshFruit/base_user.html'%} 2 | {% load static from staticfiles %} 3 | {%block option%}用户中心{%endblock%} 4 | {%block tab_order%}
  • · 全部订单
  • {%endblock %} 5 | 6 | {%block content%} 7 | 8 |
    9 | 10 |

    全部订单

    11 | {%for orde in orderlist%} 12 | 17 | 18 | 19 | 20 | 31 | 32 | 33 | 42 | 43 | 44 |
    21 | {% for i in orde.orderdetail %}: 22 |
      23 |
    • 24 |
    • {{i.od.goodsName}}{{i.od.goodsPrice}}元/500g
    • 25 |
    • {{i.od.buyCount}}
    • 26 |
    • {{i.od.goodsPrice}}元
    • 27 |
    28 | {% endfor %} 29 | 30 |
    {%if orde.order.isFinish == 1%}已付款{%else%}待付款{%endif%} 34 | {%if orde.order.isFinish == 1%} 35 | 查看物流 36 | {%else%} 37 | 去付款 38 | {%endif%} 39 | 40 | 41 |
    45 | 46 |

    {{orde.addr.aProvince}} {{orde.addr.aCity}} {{orde.addr.aDis}} {{orde.addr.aDetaAddr}}({{orde.addr.aAddressee}} 收) {%for i in orde.addr.aPhoneNumber%}{%if forloop.counter <= 3 or forloop.counter > 7%}{{i}}{%else%}*{%endif%}{%endfor%}

    47 | {%endfor%} 48 |
    49 | <上一页 50 | {%for index in plist%} 51 | {{index}} 52 | {%endfor%} 53 | 下一页> 54 |
    55 |
    56 | 57 | 58 | 116 | {% endblock %} 117 | -------------------------------------------------------------------------------- /order/views.py: -------------------------------------------------------------------------------- 1 | # coding=utf-8 2 | from django.shortcuts import render, redirect 3 | from django.http import * 4 | from models import * 5 | from datetime import datetime 6 | import random 7 | 8 | 9 | def order(request): 10 | list1 = AddrInfo.objects.filter(isDelete=False).filter(aName='张三').filter(aDefaultAddr=True) 11 | list2=[] 12 | for area in list1: 13 | phone = area.aPhoneNumber[0:3]+'****'+area.aPhoneNumber[7:] 14 | list2.append({'id': area.id, 'province': area.aProvince,'city':area.aCity,'dis':area.aDis,'addressee':area.aAddressee,'phonenumber':phone,'detail':area.aDetaAddr}) 15 | return render(request, 'freshFruit/place_order.html',{'addr':list2}) 16 | 17 | def userorder(request): 18 | #获取页面的位置 19 | pIndex = request.GET.get('page', None) 20 | if pIndex == '' or pIndex == None: 21 | pIndex = '1' 22 | pIndex=int(pIndex) 23 | 24 | #获得总页面数量 25 | userlist = Orders.objects.filter(isDelete=False).filter(userOrder=1).order_by("-id") 26 | listlen = len(userlist) 27 | i=0 28 | sumpage=2 29 | while i < listlen: 30 | sumpage+=1 31 | #获得订单中的物品总类数 32 | orderlist3 = Orders.objects.filter(extra=userlist[i].extra).count() 33 | print 'orderlist3',orderlist3 34 | i+=orderlist3 35 | if sumpage%2 >0: 36 | sumpage = (sumpage/2) + 1 37 | 38 | else: 39 | sumpage = sumpage/2 40 | print 'sumpage',sumpage 41 | sumpage = list(range(1,sumpage)) 42 | 43 | #获得页面上第一个应该显示的物品是第几个物品(i) 44 | i = 0 45 | for temp in range((pIndex-1)*2): 46 | orderlist3 = Orders.objects.filter(extra=userlist[i].extra).count() 47 | i+=orderlist3 48 | print i 49 | #构造页面上第一个订单 50 | list1 = [] 51 | time1 = userlist[i].orderTime 52 | sumPrice1 = 10 53 | extra1 = userlist[i].extra 54 | if userlist[i].isFinish: 55 | isfinish1 = '已' 56 | ispay1 = '查物流' 57 | else: 58 | isfinish1 = '未' 59 | ispay1 = '去付款' 60 | for temp in range(Orders.objects.filter(extra=userlist[i].extra).count()): 61 | temp = userlist[temp+i] 62 | sumPrice1+=temp.goodsPrice 63 | goodPrice = '%.2f'%(temp.goodsPrice/temp.buyCount) 64 | path = Goods.objects.get(goodsName=temp.goodsName).imgPath 65 | i+=1 66 | list1.append({ 67 | 'goodsPrice': temp.goodsPrice, 68 | 'goodsName':temp.goodsName, 69 | 'buyCount':temp.buyCount, 70 | 'orderTime':temp.orderTime, 71 | 'price':goodPrice, 72 | 'img':path, 73 | }) 74 | 75 | #构造页面上的第二个订单 76 | list2 = [] 77 | time2 = userlist[i].orderTime 78 | sumPrice2 = 10 79 | extra2 = userlist[i].extra 80 | if userlist[i].isFinish: 81 | isfinish2 = '已' 82 | ispay2 = '查物流' 83 | else: 84 | isfinish2 = '未' 85 | ispay2 = '去付款' 86 | for temp in range(Orders.objects.filter(extra=userlist[i].extra).count()): 87 | temp = userlist[temp+i] 88 | sumPrice2+=temp.goodsPrice 89 | goodPrice = '%.2f'%(temp.goodsPrice/temp.buyCount) 90 | path = Goods.objects.get(goodsName=temp.goodsName).imgPath 91 | list2.append({ 92 | 'goodsPrice': temp.goodsPrice, 93 | 'goodsName':temp.goodsName, 94 | 'buyCount':temp.buyCount, 95 | 'orderTime':temp.orderTime, 96 | 'price':goodPrice, 97 | 'img':path, 98 | }) 99 | 100 | return render(request, 'freshFruit/user_center_order.html',{ 101 | 'pIndex':pIndex, 102 | 'sumpage':sumpage, 103 | 104 | 'ispay1':ispay1, 105 | 'isFinish1':isfinish1, 106 | 'time1':time1, 107 | 'ordernumb1':extra1, 108 | 'list1':list1, 109 | 'sumPrice1':sumPrice1, 110 | 111 | 'ispay2':ispay2, 112 | 'isFinish2':isfinish2, 113 | 'time2':time2, 114 | 'ordernumb2':extra2, 115 | 'list2':list2, 116 | 'sumPrice2':sumPrice2, 117 | }) 118 | def userinfo(request): 119 | return render(request, 'freshFruit/user_center_info.html') 120 | def usersite(request): 121 | return render(request, 'freshFruit/user_center_site.html') 122 | def test(request): 123 | 124 | return render(request, 'freshFruit/user_center_info.html',{'list':list1}) 125 | 126 | 127 | 128 | # goodsName = models.CharField(max_length=30) 129 | # goodsPrice = models.DecimalField(max_digits=7, decimal_places=2) 130 | # buyCount = models.IntegerField() 131 | # isFinish = models.BooleanField(default=False) 132 | # isDelete = models.BooleanField(default=False) 133 | # orderTime = models.DateTimeField() 134 | # extra = models.CharField(max_length=20,null=True,blank=True) #预留 135 | # userOrder = models.ForeignKey('UserInfo') -------------------------------------------------------------------------------- /templates/freshFruit/cart.html: -------------------------------------------------------------------------------- 1 | {%extends 'freshFruit/base_user.html'%} 2 | {% load static from staticfiles %} 3 | {%block option%}购物车{%endblock%} 4 | {%block user_message%}{%endblock%} 5 | {%block content%} 6 |
    全部商品2
    7 | 15 |
    16 | {%for i in lis%} 17 | 33 | {%endfor%} 34 | 35 | 42 |
    43 | 44 | 148 | {%endblock%} -------------------------------------------------------------------------------- /detail/models.py: -------------------------------------------------------------------------------- 1 | # coding=utf-8 2 | from django.db import models 3 | from datetime import datetime 4 | from tinymce.models import HTMLField 5 | 6 | 7 | # 用户表 8 | 9 | class UserInfo(models.Model): 10 | uName = models.CharField(max_length=30) 11 | uPassword = models.CharField(max_length=20) 12 | uEmail = models.CharField(max_length=30) 13 | uPhoneNumber = models.CharField(max_length=15, null=True) 14 | uAddr = models.CharField(max_length=50, null=True, blank=True) 15 | uRegDate = models.DateTimeField() 16 | isDelete = models.BooleanField(default=False) 17 | extra = models.CharField(max_length=20,null=True,blank=True) #预留 18 | 19 | class Meta(): 20 | db_table = 'userinfo' 21 | 22 | def __str__(self): 23 | return self.uName.encode('utf-8') 24 | 25 | # 省市区表 26 | 27 | 28 | class AreaInfo(models.Model): 29 | aTitle = models.CharField(max_length=20) 30 | aParent = models.ForeignKey('self', null=True, blank=True) 31 | 32 | class Meta(): 33 | db_table = 'areainfo' 34 | 35 | def __str__(self): 36 | return self.aTitle.encode('utf-8') 37 | 38 | # 地址信息表 39 | 40 | 41 | class AddrInfo(models.Model): 42 | # aName = models.CharField(max_length=30) #账户名 43 | aProvince = models.CharField(max_length=15) 44 | aCity = models.CharField(max_length=15) 45 | aDis = models.CharField(max_length=15, null=True, blank=True) 46 | aAddressee = models.CharField(max_length=20) # 收信人 47 | aDetaAddr = models.CharField(max_length=30) 48 | aPostCode = models.CharField(max_length=10, null=True, blank=True) 49 | aPhoneNumber = models.CharField(max_length=15) 50 | isDelete = models.BooleanField(default=False) 51 | aDefaultAddr = models.BooleanField(default=False) # 默认地址 52 | extra = models.CharField(max_length=20,null=True,blank=True) #预留 53 | aUser = models.ForeignKey('UserInfo') 54 | 55 | class Meta(): 56 | db_table = 'addrinfo' 57 | 58 | def __str__(self): 59 | return self.aPhoneNumber.encode('utf-8') 60 | 61 | # 商品种类表 62 | 63 | 64 | class GoodSort(models.Model): 65 | sortName = models.CharField(max_length=10) 66 | sortPic = models.ImageField(upload_to='uploads/') 67 | sortClass = models.CharField(max_length=20 )#预留 68 | 69 | class Meta(): 70 | db_table = 'goodsort' 71 | 72 | def __str__(self): 73 | return self.sortName.encode('utf-8') 74 | 75 | # 商品表 76 | 77 | 78 | class Goods(models.Model): 79 | goodsName = models.CharField(max_length=30) 80 | goodsDesc = models.CharField(max_length=80) 81 | goodsPrice = models.DecimalField(max_digits=7, decimal_places=2) 82 | goodsDetail = HTMLField() 83 | imgPath = models.ImageField(upload_to='uploads/') 84 | saleCount = models.IntegerField(default=0) 85 | goodSort = models.ForeignKey('GoodSort') 86 | gPubdate=models.DateTimeField() 87 | extra = models.CharField(max_length=20,null=True,blank=True) #预留 88 | 89 | class Meta(): 90 | db_table = 'goods' 91 | 92 | def __str__(self): 93 | return self.goodsName.encode('utf-8') 94 | 95 | # 商品评论 96 | 97 | 98 | class GoodsComment(models.Model): 99 | userName = models.CharField(max_length=30) 100 | commentDate = models.DateTimeField() 101 | comment = HTMLField() 102 | goods = models.ForeignKey('Goods') 103 | extra = models.CharField(max_length=20,null=True,blank=True) #预留 104 | 105 | class Meta(): 106 | db_table = 'goodscomment' 107 | 108 | def __str__(self): 109 | return self.userName.encode('utf-8') 110 | 111 | # 购物车表 112 | 113 | 114 | class Cart(models.Model): 115 | goodsName = models.CharField(max_length=30) 116 | buyCount = models.IntegerField(default=1) 117 | isDelete = models.BooleanField(default=False) 118 | userCart = models.ForeignKey('UserInfo') 119 | extra = models.CharField(max_length=20,null=True,blank=True) #预留 120 | 121 | class Meta(): 122 | db_table = 'cart' 123 | 124 | def __str__(self): 125 | return self.goodsName.encode('utf-8') 126 | 127 | # 订单表 128 | 129 | 130 | class Orders(models.Model): 131 | 132 | isFinish = models.BooleanField(default=False) 133 | isDelete = models.BooleanField(default=False) 134 | orderTime = models.DateTimeField() 135 | orderNumber = models.CharField(max_length=20,null=True,blank=True) #预留 136 | userOrder = models.ForeignKey('UserInfo') 137 | 138 | class Meta(): 139 | db_table = 'orders' 140 | 141 | def __str__(self): 142 | return self.orderNumber.encode('utf-8') 143 | #订单详细表 144 | class OrderDetail(models.Model): 145 | goodsName = models.CharField(max_length=30) 146 | goodsPrice = models.DecimalField(max_digits=7, decimal_places=2) 147 | buyCount = models.IntegerField() 148 | orders_id = models.ForeignKey('Orders') 149 | good_id = models.ForeignKey('Goods') 150 | 151 | class Meta(): 152 | db_table = 'orderdetail' 153 | 154 | def __str__(self): 155 | return self.goodsName.encode('utf-8') 156 | 157 | #最近浏览 158 | class RecentSee(models.Model): 159 | goodsName=models.CharField(max_length=30) 160 | extra = models.CharField(max_length=20,null=True,blank=True) #预留 161 | user=models.ForeignKey('UserInfo') 162 | class Meta(): 163 | db_table='recentsee' 164 | def __str__(self): 165 | return self.goodsName.encode('utf-8') 166 | 167 | 168 | 169 | -------------------------------------------------------------------------------- /index/models.py: -------------------------------------------------------------------------------- 1 | # coding=utf-8 2 | from django.db import models 3 | from datetime import datetime 4 | from tinymce.models import HTMLField 5 | 6 | 7 | # 用户表 8 | 9 | class UserInfo(models.Model): 10 | uName = models.CharField(max_length=30) 11 | uPassword = models.CharField(max_length=20) 12 | uEmail = models.CharField(max_length=30) 13 | uPhoneNumber = models.CharField(max_length=15, null=True) 14 | uAddr = models.CharField(max_length=50, null=True, blank=True) 15 | uRegDate = models.DateTimeField() 16 | isDelete = models.BooleanField(default=False) 17 | extra = models.CharField(max_length=20,null=True,blank=True) #预留 18 | 19 | class Meta(): 20 | db_table = 'userinfo' 21 | 22 | def __str__(self): 23 | return self.uName.encode('utf-8') 24 | 25 | # 省市区表 26 | 27 | 28 | class AreaInfo(models.Model): 29 | aTitle = models.CharField(max_length=20) 30 | aParent = models.ForeignKey('self', null=True, blank=True) 31 | 32 | class Meta(): 33 | db_table = 'areainfo' 34 | 35 | def __str__(self): 36 | return self.aTitle.encode('utf-8') 37 | 38 | # 地址信息表 39 | 40 | 41 | class AddrInfo(models.Model): 42 | # aName = models.CharField(max_length=30) #账户名 43 | aProvince = models.CharField(max_length=15) 44 | aCity = models.CharField(max_length=15) 45 | aDis = models.CharField(max_length=15, null=True, blank=True) 46 | aAddressee = models.CharField(max_length=20) # 收信人 47 | aDetaAddr = models.CharField(max_length=30) 48 | aPostCode = models.CharField(max_length=10, null=True, blank=True) 49 | aPhoneNumber = models.CharField(max_length=15) 50 | isDelete = models.BooleanField(default=False) 51 | aDefaultAddr = models.BooleanField(default=False) # 默认地址 52 | extra = models.CharField(max_length=20,null=True,blank=True) #预留 53 | aUser = models.ForeignKey('UserInfo') 54 | 55 | class Meta(): 56 | db_table = 'addrinfo' 57 | 58 | def __str__(self): 59 | return self.aPhoneNumber.encode('utf-8') 60 | 61 | # 商品种类表 62 | 63 | 64 | class GoodSort(models.Model): 65 | sortName = models.CharField(max_length=10) 66 | sortPic = models.ImageField(upload_to='uploads/') 67 | sortClass = models.CharField(max_length=20 )#预留 68 | 69 | class Meta(): 70 | db_table = 'goodsort' 71 | 72 | def __str__(self): 73 | return self.sortName.encode('utf-8') 74 | 75 | # 商品表 76 | 77 | 78 | class Goods(models.Model): 79 | goodsName = models.CharField(max_length=30) 80 | goodsDesc = models.CharField(max_length=80) 81 | goodsPrice = models.DecimalField(max_digits=7, decimal_places=2) 82 | goodsDetail = HTMLField() 83 | imgPath = models.ImageField(upload_to='uploads/') 84 | saleCount = models.IntegerField(default=0) 85 | goodSort = models.ForeignKey('GoodSort') 86 | gPubdate=models.DateTimeField() 87 | extra = models.CharField(max_length=20,null=True,blank=True) #预留 88 | 89 | class Meta(): 90 | db_table = 'goods' 91 | 92 | def __str__(self): 93 | return self.goodsName.encode('utf-8') 94 | 95 | # 商品评论 96 | 97 | 98 | class GoodsComment(models.Model): 99 | userName = models.CharField(max_length=30) 100 | commentDate = models.DateTimeField() 101 | comment = HTMLField() 102 | goods = models.ForeignKey('Goods') 103 | extra = models.CharField(max_length=20,null=True,blank=True) #预留 104 | 105 | class Meta(): 106 | db_table = 'goodscomment' 107 | 108 | def __str__(self): 109 | return self.userName.encode('utf-8') 110 | 111 | # 购物车表 112 | 113 | 114 | class Cart(models.Model): 115 | goodsName = models.CharField(max_length=30) 116 | buyCount = models.IntegerField(default=1) 117 | isDelete = models.BooleanField(default=False) 118 | userCart = models.ForeignKey('UserInfo') 119 | extra = models.CharField(max_length=20,null=True,blank=True) #预留 120 | 121 | class Meta(): 122 | db_table = 'cart' 123 | 124 | def __str__(self): 125 | return self.goodsName.encode('utf-8') 126 | 127 | # 订单表 128 | 129 | 130 | class Orders(models.Model): 131 | 132 | isFinish = models.BooleanField(default=False) 133 | isDelete = models.BooleanField(default=False) 134 | orderTime = models.DateTimeField() 135 | orderNumber = models.CharField(max_length=20,null=True,blank=True) #预留 136 | userOrder = models.ForeignKey('UserInfo') 137 | 138 | class Meta(): 139 | db_table = 'orders' 140 | 141 | def __str__(self): 142 | return self.orderNumber.encode('utf-8') 143 | #订单详细表 144 | class OrderDetail(models.Model): 145 | goodsName = models.CharField(max_length=30) 146 | goodsPrice = models.DecimalField(max_digits=7, decimal_places=2) 147 | buyCount = models.IntegerField() 148 | orders_id = models.ForeignKey('Orders') 149 | good_id = models.ForeignKey('Goods') 150 | 151 | class Meta(): 152 | db_table = 'orderdetail' 153 | 154 | def __str__(self): 155 | return self.goodsName.encode('utf-8') 156 | 157 | #最近浏览 158 | class RecentSee(models.Model): 159 | goodsName=models.CharField(max_length=30) 160 | extra = models.CharField(max_length=20,null=True,blank=True) #预留 161 | user=models.ForeignKey('UserInfo') 162 | class Meta(): 163 | db_table='recentsee' 164 | def __str__(self): 165 | return self.goodsName.encode('utf-8') 166 | 167 | 168 | 169 | -------------------------------------------------------------------------------- /order/models.py: -------------------------------------------------------------------------------- 1 | # coding=utf-8 2 | from django.db import models 3 | from datetime import datetime 4 | from tinymce.models import HTMLField 5 | 6 | 7 | # 用户表 8 | 9 | class UserInfo(models.Model): 10 | uName = models.CharField(max_length=30) 11 | uPassword = models.CharField(max_length=20) 12 | uEmail = models.CharField(max_length=30) 13 | uPhoneNumber = models.CharField(max_length=15, null=True) 14 | uAddr = models.CharField(max_length=50, null=True, blank=True) 15 | uRegDate = models.DateTimeField() 16 | isDelete = models.BooleanField(default=False) 17 | extra = models.CharField(max_length=20,null=True,blank=True) #预留 18 | 19 | class Meta(): 20 | db_table = 'userinfo' 21 | 22 | def __str__(self): 23 | return self.uName.encode('utf-8') 24 | 25 | # 省市区表 26 | 27 | 28 | class AreaInfo(models.Model): 29 | aTitle = models.CharField(max_length=20) 30 | aParent = models.ForeignKey('self', null=True, blank=True) 31 | 32 | class Meta(): 33 | db_table = 'areainfo' 34 | 35 | def __str__(self): 36 | return self.aTitle.encode('utf-8') 37 | 38 | # 地址信息表 39 | 40 | 41 | class AddrInfo(models.Model): 42 | # aName = models.CharField(max_length=30) #账户名 43 | aProvince = models.CharField(max_length=15) 44 | aCity = models.CharField(max_length=15) 45 | aDis = models.CharField(max_length=15, null=True, blank=True) 46 | aAddressee = models.CharField(max_length=20) # 收信人 47 | aDetaAddr = models.CharField(max_length=30) 48 | aPostCode = models.CharField(max_length=10, null=True, blank=True) 49 | aPhoneNumber = models.CharField(max_length=15) 50 | isDelete = models.BooleanField(default=False) 51 | aDefaultAddr = models.BooleanField(default=False) # 默认地址 52 | extra = models.CharField(max_length=20,null=True,blank=True) #预留 53 | aUser = models.ForeignKey('UserInfo') 54 | 55 | class Meta(): 56 | db_table = 'addrinfo' 57 | 58 | def __str__(self): 59 | return self.aPhoneNumber.encode('utf-8') 60 | 61 | # 商品种类表 62 | 63 | 64 | class GoodSort(models.Model): 65 | sortName = models.CharField(max_length=10) 66 | sortPic = models.ImageField(upload_to='uploads/') 67 | sortClass = models.CharField(max_length=20 )#预留 68 | 69 | class Meta(): 70 | db_table = 'goodsort' 71 | 72 | def __str__(self): 73 | return self.sortName.encode('utf-8') 74 | 75 | # 商品表 76 | 77 | 78 | class Goods(models.Model): 79 | goodsName = models.CharField(max_length=30) 80 | goodsDesc = models.CharField(max_length=80) 81 | goodsPrice = models.DecimalField(max_digits=7, decimal_places=2) 82 | goodsDetail = HTMLField() 83 | imgPath = models.ImageField(upload_to='uploads/') 84 | saleCount = models.IntegerField(default=0) 85 | goodSort = models.ForeignKey('GoodSort') 86 | gPubdate=models.DateTimeField() 87 | extra = models.CharField(max_length=20,null=True,blank=True) #预留 88 | 89 | class Meta(): 90 | db_table = 'goods' 91 | 92 | def __str__(self): 93 | return self.goodsName.encode('utf-8') 94 | 95 | # 商品评论 96 | 97 | 98 | class GoodsComment(models.Model): 99 | userName = models.CharField(max_length=30) 100 | commentDate = models.DateTimeField() 101 | comment = HTMLField() 102 | goods = models.ForeignKey('Goods') 103 | extra = models.CharField(max_length=20,null=True,blank=True) #预留 104 | 105 | class Meta(): 106 | db_table = 'goodscomment' 107 | 108 | def __str__(self): 109 | return self.userName.encode('utf-8') 110 | 111 | # 购物车表 112 | 113 | 114 | class Cart(models.Model): 115 | goodsName = models.CharField(max_length=30) 116 | buyCount = models.IntegerField(default=1) 117 | isDelete = models.BooleanField(default=False) 118 | userCart = models.ForeignKey('UserInfo') 119 | extra = models.CharField(max_length=20,null=True,blank=True) #预留 120 | 121 | class Meta(): 122 | db_table = 'cart' 123 | 124 | def __str__(self): 125 | return self.goodsName.encode('utf-8') 126 | 127 | # 订单表 128 | 129 | 130 | class Orders(models.Model): 131 | 132 | isFinish = models.BooleanField(default=False) 133 | isDelete = models.BooleanField(default=False) 134 | orderTime = models.DateTimeField() 135 | orderNumber = models.CharField(max_length=20,null=True,blank=True) #预留 136 | userOrder = models.ForeignKey('UserInfo') 137 | 138 | class Meta(): 139 | db_table = 'orders' 140 | 141 | def __str__(self): 142 | return self.orderNumber.encode('utf-8') 143 | #订单详细表 144 | class OrderDetail(models.Model): 145 | goodsName = models.CharField(max_length=30) 146 | goodsPrice = models.DecimalField(max_digits=7, decimal_places=2) 147 | buyCount = models.IntegerField() 148 | orders_id = models.ForeignKey('Orders') 149 | good_id = models.ForeignKey('Goods') 150 | 151 | class Meta(): 152 | db_table = 'orderdetail' 153 | 154 | def __str__(self): 155 | return self.goodsName.encode('utf-8') 156 | 157 | #最近浏览 158 | class RecentSee(models.Model): 159 | goodsName=models.CharField(max_length=30) 160 | extra = models.CharField(max_length=20,null=True,blank=True) #预留 161 | user=models.ForeignKey('UserInfo') 162 | class Meta(): 163 | db_table='recentsee' 164 | def __str__(self): 165 | return self.goodsName.encode('utf-8') 166 | 167 | 168 | 169 | -------------------------------------------------------------------------------- /registerLogin/models.py: -------------------------------------------------------------------------------- 1 | # coding=utf-8 2 | from django.db import models 3 | from datetime import datetime 4 | from tinymce.models import HTMLField 5 | 6 | 7 | # 用户表 8 | 9 | class UserInfo(models.Model): 10 | uName = models.CharField(max_length=30) 11 | uPassword = models.CharField(max_length=50) 12 | uEmail = models.CharField(max_length=30) 13 | uPhoneNumber = models.CharField(max_length=15, null=True) 14 | uAddr = models.CharField(max_length=50, null=True, blank=True) 15 | uRegDate = models.DateTimeField() 16 | isDelete = models.BooleanField(default=False) 17 | extra = models.CharField(max_length=20,null=True,blank=True) #预留 18 | 19 | class Meta(): 20 | db_table = 'userinfo' 21 | 22 | def __str__(self): 23 | return self.uName.encode('utf-8') 24 | 25 | # 省市区表 26 | 27 | 28 | class AreaInfo(models.Model): 29 | aTitle = models.CharField(max_length=20) 30 | aParent = models.ForeignKey('self', null=True, blank=True) 31 | 32 | class Meta(): 33 | db_table = 'areainfo' 34 | 35 | def __str__(self): 36 | return self.aTitle.encode('utf-8') 37 | 38 | # 地址信息表 39 | 40 | 41 | class AddrInfo(models.Model): 42 | # aName = models.CharField(max_length=30) #账户名 43 | aProvince = models.CharField(max_length=15) 44 | aCity = models.CharField(max_length=15) 45 | aDis = models.CharField(max_length=15, null=True, blank=True) 46 | aAddressee = models.CharField(max_length=20) # 收信人 47 | aDetaAddr = models.CharField(max_length=30) 48 | aPostCode = models.CharField(max_length=10, null=True, blank=True) 49 | aPhoneNumber = models.CharField(max_length=15) 50 | isDelete = models.BooleanField(default=False) 51 | aDefaultAddr = models.BooleanField(default=False) # 默认地址 52 | extra = models.CharField(max_length=20,null=True,blank=True) #预留 53 | aUser = models.ForeignKey('UserInfo') 54 | 55 | class Meta(): 56 | db_table = 'addrinfo' 57 | 58 | def __str__(self): 59 | return self.aPhoneNumber.encode('utf-8') 60 | 61 | # 商品种类表 62 | 63 | 64 | class GoodSort(models.Model): 65 | sortName = models.CharField(max_length=10) 66 | sortPic = models.ImageField(upload_to='uploads/') 67 | sortClass = models.CharField(max_length=20 )#预留 68 | 69 | class Meta(): 70 | db_table = 'goodsort' 71 | 72 | def __str__(self): 73 | return self.sortName.encode('utf-8') 74 | 75 | # 商品表 76 | 77 | 78 | class Goods(models.Model): 79 | goodsName = models.CharField(max_length=30) 80 | goodsDesc = models.CharField(max_length=80) 81 | goodsPrice = models.DecimalField(max_digits=7, decimal_places=2) 82 | goodsDetail = HTMLField() 83 | imgPath = models.ImageField(upload_to='uploads/') 84 | saleCount = models.IntegerField(default=0) 85 | goodSort = models.ForeignKey('GoodSort') 86 | gPubdate=models.DateTimeField() 87 | extra = models.CharField(max_length=20,null=True,blank=True) #预留 88 | 89 | class Meta(): 90 | db_table = 'goods' 91 | 92 | def __str__(self): 93 | return self.goodsName.encode('utf-8') 94 | 95 | # 商品评论 96 | 97 | 98 | class GoodsComment(models.Model): 99 | userName = models.CharField(max_length=30) 100 | commentDate = models.DateTimeField() 101 | comment = HTMLField() 102 | goods = models.ForeignKey('Goods') 103 | extra = models.CharField(max_length=20,null=True,blank=True) #预留 104 | 105 | class Meta(): 106 | db_table = 'goodscomment' 107 | 108 | def __str__(self): 109 | return self.userName.encode('utf-8') 110 | 111 | # 购物车表 112 | 113 | 114 | class Cart(models.Model): 115 | goodsName = models.CharField(max_length=30) 116 | buyCount = models.IntegerField(default=1) 117 | isDelete = models.BooleanField(default=False) 118 | userCart = models.ForeignKey('UserInfo') 119 | extra = models.CharField(max_length=20,null=True,blank=True) #预留 120 | 121 | class Meta(): 122 | db_table = 'cart' 123 | 124 | def __str__(self): 125 | return self.goodsName.encode('utf-8') 126 | 127 | # 订单表 128 | 129 | 130 | class Orders(models.Model): 131 | 132 | isFinish = models.BooleanField(default=False) 133 | isDelete = models.BooleanField(default=False) 134 | orderTime = models.DateTimeField() 135 | orderNumber = models.CharField(max_length=20,null=True,blank=True) #预留 136 | userOrder = models.ForeignKey('UserInfo') 137 | 138 | class Meta(): 139 | db_table = 'orders' 140 | 141 | def __str__(self): 142 | return self.orderNumber.encode('utf-8') 143 | #订单详细表 144 | class OrderDetail(models.Model): 145 | goodsName = models.CharField(max_length=30) 146 | goodsPrice = models.DecimalField(max_digits=7, decimal_places=2) 147 | buyCount = models.IntegerField() 148 | orders_id = models.ForeignKey('Orders') 149 | good_id = models.ForeignKey('Goods') 150 | 151 | class Meta(): 152 | db_table = 'orderdetail' 153 | 154 | def __str__(self): 155 | return self.goodsName.encode('utf-8') 156 | 157 | #最近浏览 158 | class RecentSee(models.Model): 159 | goodsName=models.CharField(max_length=30) 160 | extra = models.CharField(max_length=20,null=True,blank=True) #预留 161 | user=models.ForeignKey('UserInfo') 162 | class Meta(): 163 | db_table='recentsee' 164 | def __str__(self): 165 | return self.goodsName.encode('utf-8') 166 | 167 | 168 | 169 | -------------------------------------------------------------------------------- /cart/models.py: -------------------------------------------------------------------------------- 1 | # coding=utf-8 2 | from django.db import models 3 | from datetime import datetime 4 | from tinymce.models import HTMLField 5 | 6 | 7 | # 用户表 8 | 9 | class UserInfo(models.Model): 10 | uName = models.CharField(max_length=30) 11 | uPassword = models.CharField(max_length=20) 12 | uEmail = models.CharField(max_length=30) 13 | uPhoneNumber = models.CharField(max_length=15, null=True) 14 | uAddr = models.CharField(max_length=50, null=True, blank=True) 15 | uRegDate = models.DateTimeField() 16 | isDelete = models.BooleanField(default=False) 17 | extra = models.CharField(max_length=20,null=True,blank=True) #预留 18 | 19 | class Meta(): 20 | db_table = 'userinfo' 21 | 22 | def __str__(self): 23 | return self.uName.encode('utf-8') 24 | 25 | # 省市区表 26 | 27 | 28 | class AreaInfo(models.Model): 29 | aTitle = models.CharField(max_length=20) 30 | aParent = models.ForeignKey('self', null=True, blank=True) 31 | 32 | class Meta(): 33 | db_table = 'areainfo' 34 | 35 | def __str__(self): 36 | return self.atitle.encode('utf-8') 37 | 38 | # 地址信息表 39 | 40 | 41 | class AddrInfo(models.Model): 42 | # aName = models.CharField(max_length=30) 43 | aProvince = models.CharField(max_length=15) 44 | aCity = models.CharField(max_length=15) 45 | aDis = models.CharField(max_length=15, null=True, blank=True) 46 | aAddressee = models.CharField(max_length=20) # 收信人 47 | aDetaAddr = models.CharField(max_length=30) 48 | aPostCode = models.CharField(max_length=10, null=True, blank=True) 49 | aPhoneNumber = models.CharField(max_length=15) 50 | isDelete = models.BooleanField(default=False) 51 | aDefaultAddr = models.BooleanField(default=False) # 默认地址 52 | extra = models.CharField(max_length=20,null=True,blank=True) #预留 53 | aUser = models.ForeignKey('UserInfo') 54 | 55 | class Meta(): 56 | db_table = 'addrinfo' 57 | 58 | def __str__(self): 59 | return self.aPhoneNumber.encode('utf-8') 60 | 61 | # 商品种类表 62 | 63 | 64 | class GoodSort(models.Model): 65 | sortName = models.CharField(max_length=10) 66 | sortPic = models.ImageField(upload_to='uploads/') 67 | extra = models.CharField(max_length=20,null=True,blank=True) #预留 68 | 69 | class Meta(): 70 | db_table = 'goodsort' 71 | 72 | def __str__(self): 73 | return self.sortName.encode('utf-8') 74 | 75 | # 商品表 76 | 77 | 78 | class Goods(models.Model): 79 | goodsName = models.CharField(max_length=30) 80 | goodsDesc = models.CharField(max_length=80) 81 | goodsPrice = models.DecimalField(max_digits=7, decimal_places=2) 82 | goodsDetail = HTMLField() 83 | imgPath = models.ImageField(upload_to='uploads/') 84 | saleCount = models.IntegerField(default=0) 85 | goodSort = models.ForeignKey('GoodSort') 86 | gPubdate=models.DateTimeField() 87 | extra = models.CharField(max_length=20,null=True,blank=True) #预留 88 | 89 | class Meta(): 90 | db_table = 'goods' 91 | 92 | def __str__(self): 93 | return self.goodsName.encode('utf-8') 94 | 95 | # 商品评论 96 | 97 | 98 | class GoodsComment(models.Model): 99 | userName = models.CharField(max_length=30) 100 | commentDate = models.DateTimeField() 101 | comment = HTMLField() 102 | goods = models.ForeignKey('Goods') 103 | extra = models.CharField(max_length=20,null=True,blank=True) #预留 104 | 105 | class Meta(): 106 | db_table = 'goodscomment' 107 | 108 | def __str__(self): 109 | return self.userName.encode('utf-8') 110 | 111 | # 购物车表 112 | 113 | 114 | class Cart(models.Model): 115 | goodsName = models.CharField(max_length=30) 116 | buyCount = models.IntegerField(default=1) 117 | isDelete = models.BooleanField(default=False) 118 | userCart = models.ForeignKey('UserInfo') 119 | extra = models.CharField(max_length=20,null=True,blank=True) #预留 120 | 121 | class Meta(): 122 | db_table = 'cart' 123 | 124 | def __str__(self): 125 | return self.goodsName.encode('utf-8') 126 | 127 | # 订单表 128 | 129 | 130 | class Orders(models.Model): 131 | 132 | isFinish = models.BooleanField(default=False) 133 | isDelete = models.BooleanField(default=False) 134 | orderTime = models.DateTimeField() 135 | orderNumber = models.CharField(max_length=20,null=True,blank=True) #预留 136 | userOrder = models.ForeignKey('UserInfo') 137 | addr = models.IntegerField(null=True,blank=True) 138 | class Meta(): 139 | db_table = 'orders' 140 | 141 | def __str__(self): 142 | return self.orderNumber.encode('utf-8') 143 | #订单详细表 144 | class OrderDetail(models.Model): 145 | goodsName = models.CharField(max_length=30) 146 | goodsPrice = models.DecimalField(max_digits=7, decimal_places=2) 147 | buyCount = models.IntegerField() 148 | orders_id = models.ForeignKey('Orders') 149 | good_id = models.ForeignKey('Goods') 150 | 151 | class Meta(): 152 | db_table = 'orderdetail' 153 | 154 | def __str__(self): 155 | return self.goodsName.encode('utf-8') 156 | 157 | #最近浏览 158 | class RecentSee(models.Model): 159 | goodsName=models.CharField(max_length=30) 160 | extra = models.CharField(max_length=20,null=True,blank=True) #预留 161 | user=models.ForeignKey('UserInfo') 162 | class Meta(): 163 | db_table='recentsee' 164 | def __str__(self): 165 | return self.goodsName.encode('utf-8') 166 | 167 | 168 | 169 | -------------------------------------------------------------------------------- /goodslist/models.py: -------------------------------------------------------------------------------- 1 | # coding=utf-8 2 | from django.db import models 3 | from datetime import datetime 4 | from tinymce.models import HTMLField 5 | 6 | 7 | # 用户表 8 | 9 | class UserInfo(models.Model): 10 | uName = models.CharField(max_length=30) 11 | uPassword = models.CharField(max_length=20) 12 | uEmail = models.CharField(max_length=30) 13 | uPhoneNumber = models.CharField(max_length=15, null=True) 14 | uAddr = models.CharField(max_length=50, null=True, blank=True) 15 | uRegDate = models.DateTimeField() 16 | isDelete = models.BooleanField(default=False) 17 | extra = models.CharField(max_length=20,null=True,blank=True) #预留 18 | 19 | class Meta(): 20 | db_table = 'userinfo' 21 | 22 | def __str__(self): 23 | return self.uName.encode('utf-8') 24 | 25 | # 省市区表 26 | 27 | 28 | class AreaInfo(models.Model): 29 | aTitle = models.CharField(max_length=20) 30 | aParent = models.ForeignKey('self', null=True, blank=True) 31 | 32 | class Meta(): 33 | db_table = 'areainfo' 34 | 35 | def __str__(self): 36 | return self.aTitle.encode('utf-8') 37 | 38 | # 地址信息表 39 | 40 | 41 | class AddrInfo(models.Model): 42 | # aName = models.CharField(max_length=30) #账户名 43 | aProvince = models.CharField(max_length=15) 44 | aCity = models.CharField(max_length=15) 45 | aDis = models.CharField(max_length=15, null=True, blank=True) 46 | aAddressee = models.CharField(max_length=20) # 收信人 47 | aDetaAddr = models.CharField(max_length=30) 48 | aPostCode = models.CharField(max_length=10, null=True, blank=True) 49 | aPhoneNumber = models.CharField(max_length=15) 50 | isDelete = models.BooleanField(default=False) 51 | aDefaultAddr = models.BooleanField(default=False) # 默认地址 52 | extra = models.CharField(max_length=20,null=True,blank=True) #预留 53 | aUser = models.ForeignKey('UserInfo') 54 | 55 | class Meta(): 56 | db_table = 'addrinfo' 57 | 58 | def __str__(self): 59 | return self.aPhoneNumber.encode('utf-8') 60 | 61 | # 商品种类表 62 | 63 | 64 | class GoodSort(models.Model): 65 | sortName = models.CharField(max_length=10) 66 | sortPic = models.ImageField(upload_to='uploads/') 67 | sortClass = models.CharField(max_length=20 )#预留 68 | 69 | class Meta(): 70 | db_table = 'goodsort' 71 | 72 | def __str__(self): 73 | return self.sortName.encode('utf-8') 74 | 75 | # 商品表 76 | 77 | 78 | class Goods(models.Model): 79 | goodsName = models.CharField(max_length=30) 80 | goodsDesc = models.CharField(max_length=80) 81 | goodsPrice = models.DecimalField(max_digits=7, decimal_places=2) 82 | goodsDetail = HTMLField() 83 | imgPath = models.ImageField(upload_to='uploads/') 84 | saleCount = models.IntegerField(default=0) 85 | goodSort = models.ForeignKey('GoodSort') 86 | gPubdate=models.DateTimeField() 87 | extra = models.CharField(max_length=20,null=True,blank=True) #预留 88 | 89 | class Meta(): 90 | db_table = 'goods' 91 | 92 | def __str__(self): 93 | return self.goodsName.encode('utf-8') 94 | 95 | # 商品评论 96 | 97 | 98 | class GoodsComment(models.Model): 99 | userName = models.CharField(max_length=30) 100 | commentDate = models.DateTimeField() 101 | comment = HTMLField() 102 | goods = models.ForeignKey('Goods') 103 | extra = models.CharField(max_length=20,null=True,blank=True) #预留 104 | 105 | class Meta(): 106 | db_table = 'goodscomment' 107 | 108 | def __str__(self): 109 | return self.userName.encode('utf-8') 110 | 111 | # 购物车表 112 | 113 | 114 | class Cart(models.Model): 115 | goodsName = models.CharField(max_length=30) 116 | buyCount = models.IntegerField(default=1) 117 | isDelete = models.BooleanField(default=False) 118 | userCart = models.ForeignKey('UserInfo') 119 | extra = models.CharField(max_length=20,null=True,blank=True) #预留 120 | 121 | class Meta(): 122 | db_table = 'cart' 123 | 124 | def __str__(self): 125 | return self.goodsName.encode('utf-8') 126 | 127 | # 订单表 128 | 129 | 130 | class Orders(models.Model): 131 | 132 | isFinish = models.BooleanField(default=False) 133 | isDelete = models.BooleanField(default=False) 134 | orderTime = models.DateTimeField() 135 | orderNumber = models.CharField(max_length=20,null=True,blank=True) #预留 136 | addr = models.IntegerField(null=True,blank=True) 137 | userOrder = models.ForeignKey('UserInfo') 138 | 139 | class Meta(): 140 | db_table = 'orders' 141 | 142 | def __str__(self): 143 | return self.orderNumber.encode('utf-8') 144 | #订单详细表 145 | class OrderDetail(models.Model): 146 | goodsName = models.CharField(max_length=30) 147 | goodsPrice = models.DecimalField(max_digits=7, decimal_places=2) 148 | buyCount = models.IntegerField() 149 | orders_id = models.ForeignKey('Orders') 150 | good_id = models.ForeignKey('Goods') 151 | 152 | class Meta(): 153 | db_table = 'orderdetail' 154 | 155 | def __str__(self): 156 | return self.goodsName.encode('utf-8') 157 | 158 | #最近浏览 159 | class RecentSee(models.Model): 160 | goodsName=models.CharField(max_length=30) 161 | extra = models.CharField(max_length=20,null=True,blank=True) #预留 162 | user=models.ForeignKey('UserInfo') 163 | class Meta(): 164 | db_table='recentsee' 165 | def __str__(self): 166 | return self.goodsName.encode('utf-8') 167 | 168 | 169 | 170 | -------------------------------------------------------------------------------- /usercenter/models.py: -------------------------------------------------------------------------------- 1 | # coding=utf-8 2 | from django.db import models 3 | from datetime import datetime 4 | from tinymce.models import HTMLField 5 | 6 | 7 | # 用户表 8 | 9 | class UserInfo(models.Model): 10 | uName = models.CharField(max_length=30) 11 | uPassword = models.CharField(max_length=20) 12 | uEmail = models.CharField(max_length=30) 13 | uPhoneNumber = models.CharField(max_length=15, null=True) 14 | uAddr = models.CharField(max_length=50, null=True, blank=True) 15 | uRegDate = models.DateTimeField() 16 | isDelete = models.BooleanField(default=False) 17 | extra = models.CharField(max_length=20,null=True,blank=True) #预留 18 | 19 | class Meta(): 20 | db_table = 'userinfo' 21 | 22 | def __str__(self): 23 | return self.uName.encode('utf-8') 24 | 25 | # 省市区表 26 | 27 | 28 | class AreaInfo(models.Model): 29 | aTitle = models.CharField(max_length=20) 30 | aParent = models.ForeignKey('self', null=True, blank=True) 31 | 32 | class Meta(): 33 | db_table = 'areainfo' 34 | 35 | def __str__(self): 36 | return self.aTitle.encode('utf-8') 37 | 38 | # 地址信息表 39 | 40 | 41 | class AddrInfo(models.Model): 42 | # aName = models.CharField(max_length=30) #账户名 43 | aProvince = models.CharField(max_length=15) 44 | aCity = models.CharField(max_length=15) 45 | aDis = models.CharField(max_length=15, null=True, blank=True) 46 | aAddressee = models.CharField(max_length=20) # 收信人 47 | aDetaAddr = models.CharField(max_length=30) 48 | aPostCode = models.CharField(max_length=10, null=True, blank=True) 49 | aPhoneNumber = models.CharField(max_length=15) 50 | isDelete = models.BooleanField(default=False) 51 | aDefaultAddr = models.BooleanField(default=False) # 默认地址 52 | extra = models.CharField(max_length=20,null=True,blank=True) #预留 53 | aUser = models.ForeignKey('UserInfo') 54 | 55 | class Meta(): 56 | db_table = 'addrinfo' 57 | 58 | def __str__(self): 59 | return self.aPhoneNumber.encode('utf-8') 60 | 61 | # 商品种类表 62 | 63 | 64 | class GoodSort(models.Model): 65 | sortName = models.CharField(max_length=10) 66 | sortPic = models.ImageField(upload_to='uploads/') 67 | sortClass = models.CharField(max_length=20 )#预留 68 | 69 | class Meta(): 70 | db_table = 'goodsort' 71 | 72 | def __str__(self): 73 | return self.sortName.encode('utf-8') 74 | 75 | # 商品表 76 | 77 | 78 | class Goods(models.Model): 79 | goodsName = models.CharField(max_length=30) 80 | goodsDesc = models.CharField(max_length=80) 81 | goodsPrice = models.DecimalField(max_digits=7, decimal_places=2) 82 | goodsDetail = HTMLField() 83 | imgPath = models.ImageField(upload_to='uploads/') 84 | saleCount = models.IntegerField(default=0) 85 | goodSort = models.ForeignKey('GoodSort') 86 | gPubdate=models.DateTimeField() 87 | extra = models.CharField(max_length=20,null=True,blank=True) #预留 88 | 89 | class Meta(): 90 | db_table = 'goods' 91 | 92 | def __str__(self): 93 | return self.goodsName.encode('utf-8') 94 | 95 | # 商品评论 96 | 97 | 98 | class GoodsComment(models.Model): 99 | userName = models.CharField(max_length=30) 100 | commentDate = models.DateTimeField() 101 | comment = HTMLField() 102 | goods = models.ForeignKey('Goods') 103 | extra = models.CharField(max_length=20,null=True,blank=True) #预留 104 | 105 | class Meta(): 106 | db_table = 'goodscomment' 107 | 108 | def __str__(self): 109 | return self.userName.encode('utf-8') 110 | 111 | # 购物车表 112 | 113 | 114 | class Cart(models.Model): 115 | goodsName = models.CharField(max_length=30) 116 | buyCount = models.IntegerField(default=1) 117 | isDelete = models.BooleanField(default=False) 118 | userCart = models.ForeignKey('UserInfo') 119 | extra = models.CharField(max_length=20,null=True,blank=True) #预留 120 | 121 | class Meta(): 122 | db_table = 'cart' 123 | 124 | def __str__(self): 125 | return self.goodsName.encode('utf-8') 126 | 127 | # 订单表 128 | 129 | 130 | class Orders(models.Model): 131 | 132 | isFinish = models.BooleanField(default=False) 133 | isDelete = models.BooleanField(default=False) 134 | orderTime = models.DateTimeField() 135 | orderNumber = models.CharField(max_length=20,null=True,blank=True) #预留 136 | addr = models.IntegerField(null=True,blank=True) 137 | userOrder = models.ForeignKey('UserInfo') 138 | 139 | class Meta(): 140 | db_table = 'orders' 141 | 142 | def __str__(self): 143 | return self.orderNumber.encode('utf-8') 144 | #订单详细表 145 | class OrderDetail(models.Model): 146 | goodsName = models.CharField(max_length=30) 147 | goodsPrice = models.DecimalField(max_digits=7, decimal_places=2) 148 | buyCount = models.IntegerField() 149 | orders_id = models.ForeignKey('Orders') 150 | good_id = models.ForeignKey('Goods') 151 | 152 | class Meta(): 153 | db_table = 'orderdetail' 154 | 155 | def __str__(self): 156 | return self.goodsName.encode('utf-8') 157 | 158 | #最近浏览 159 | class RecentSee(models.Model): 160 | goodsName=models.CharField(max_length=30) 161 | extra = models.CharField(max_length=20,null=True,blank=True) #预留 162 | user=models.ForeignKey('UserInfo') 163 | class Meta(): 164 | db_table='recentsee' 165 | def __str__(self): 166 | return self.goodsName.encode('utf-8') 167 | 168 | 169 | 170 | -------------------------------------------------------------------------------- /static/js/jquery.easing.min.js: -------------------------------------------------------------------------------- 1 | /* 2 | * jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/ 3 | * 4 | * Uses the built in easing capabilities added In jQuery 1.1 5 | * to offer multiple easing options 6 | * 7 | * TERMS OF USE - EASING EQUATIONS 8 | * 9 | * Open source under the BSD License. 10 | * 11 | * Copyright © 2001 Robert Penner 12 | * All rights reserved. 13 | * 14 | * TERMS OF USE - jQuery Easing 15 | * 16 | * Open source under the BSD License. 17 | * 18 | * Copyright © 2008 George McGinley Smith 19 | * All rights reserved. 20 | * 21 | * Redistribution and use in source and binary forms, with or without modification, 22 | * are permitted provided that the following conditions are met: 23 | * 24 | * Redistributions of source code must retain the above copyright notice, this list of 25 | * conditions and the following disclaimer. 26 | * Redistributions in binary form must reproduce the above copyright notice, this list 27 | * of conditions and the following disclaimer in the documentation and/or other materials 28 | * provided with the distribution. 29 | * 30 | * Neither the name of the author nor the names of contributors may be used to endorse 31 | * or promote products derived from this software without specific prior written permission. 32 | * 33 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 34 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 35 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 36 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 37 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE 38 | * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 39 | * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 40 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 41 | * OF THE POSSIBILITY OF SUCH DAMAGE. 42 | * 43 | */ 44 | jQuery.easing.jswing=jQuery.easing.swing;jQuery.extend(jQuery.easing,{def:"easeOutQuad",swing:function(e,f,a,h,g){return jQuery.easing[jQuery.easing.def](e,f,a,h,g)},easeInQuad:function(e,f,a,h,g){return h*(f/=g)*f+a},easeOutQuad:function(e,f,a,h,g){return -h*(f/=g)*(f-2)+a},easeInOutQuad:function(e,f,a,h,g){if((f/=g/2)<1){return h/2*f*f+a}return -h/2*((--f)*(f-2)-1)+a},easeInCubic:function(e,f,a,h,g){return h*(f/=g)*f*f+a},easeOutCubic:function(e,f,a,h,g){return h*((f=f/g-1)*f*f+1)+a},easeInOutCubic:function(e,f,a,h,g){if((f/=g/2)<1){return h/2*f*f*f+a}return h/2*((f-=2)*f*f+2)+a},easeInQuart:function(e,f,a,h,g){return h*(f/=g)*f*f*f+a},easeOutQuart:function(e,f,a,h,g){return -h*((f=f/g-1)*f*f*f-1)+a},easeInOutQuart:function(e,f,a,h,g){if((f/=g/2)<1){return h/2*f*f*f*f+a}return -h/2*((f-=2)*f*f*f-2)+a},easeInQuint:function(e,f,a,h,g){return h*(f/=g)*f*f*f*f+a},easeOutQuint:function(e,f,a,h,g){return h*((f=f/g-1)*f*f*f*f+1)+a},easeInOutQuint:function(e,f,a,h,g){if((f/=g/2)<1){return h/2*f*f*f*f*f+a}return h/2*((f-=2)*f*f*f*f+2)+a},easeInSine:function(e,f,a,h,g){return -h*Math.cos(f/g*(Math.PI/2))+h+a},easeOutSine:function(e,f,a,h,g){return h*Math.sin(f/g*(Math.PI/2))+a},easeInOutSine:function(e,f,a,h,g){return -h/2*(Math.cos(Math.PI*f/g)-1)+a},easeInExpo:function(e,f,a,h,g){return(f==0)?a:h*Math.pow(2,10*(f/g-1))+a},easeOutExpo:function(e,f,a,h,g){return(f==g)?a+h:h*(-Math.pow(2,-10*f/g)+1)+a},easeInOutExpo:function(e,f,a,h,g){if(f==0){return a}if(f==g){return a+h}if((f/=g/2)<1){return h/2*Math.pow(2,10*(f-1))+a}return h/2*(-Math.pow(2,-10*--f)+2)+a},easeInCirc:function(e,f,a,h,g){return -h*(Math.sqrt(1-(f/=g)*f)-1)+a},easeOutCirc:function(e,f,a,h,g){return h*Math.sqrt(1-(f=f/g-1)*f)+a},easeInOutCirc:function(e,f,a,h,g){if((f/=g/2)<1){return -h/2*(Math.sqrt(1-f*f)-1)+a}return h/2*(Math.sqrt(1-(f-=2)*f)+1)+a},easeInElastic:function(f,h,e,l,k){var i=1.70158;var j=0;var g=l;if(h==0){return e}if((h/=k)==1){return e+l}if(!j){j=k*0.3}if(g 8 | 9 | 10 | 11 | 19 | 20 | 21 | 28 | 29 | 30 |
    31 |
    32 | 33 |
    34 |

    {{good.goodsName}}

    35 |

    {{good.goodsDesc}}

    36 |
    37 | ¥{{good.goodsPrice}} 38 | 单 位:500g 39 |
    40 |
    41 |
    数 量:
    42 |
    43 | 44 | + 45 | - 46 |
    47 |
    48 |
    总价:{{good.goodsPrice}}元
    49 |
    50 | 立即购买 51 | 加入购物车 52 |
    53 |
    54 |
    55 | 56 |
    57 |
    58 |
    59 |

    新品推荐

    60 |
      61 | {%for i in newgoodslist %} 62 |
    • 63 | 64 |

      {{i.goodsName}}

      65 |
      ¥{{i.goodsPrice}}
      66 |
    • 67 | {%endfor%} 68 | 69 |
    70 |
    71 |
    72 | 73 |
    74 |
      75 |
    • 商品介绍
    • 76 | 77 |
    • 商品评论
    • 78 |
    79 | 80 |
    81 |
    82 |
    83 |
    {{good.goodsDetail|safe}}
    84 |
    85 | 95 |
    96 |
    97 |
    98 | 99 |
    100 |
    101 | 102 | 103 |
    104 | 105 | 124 | 162 | 174 | 175 | {%endblock%} 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | -------------------------------------------------------------------------------- /usercenter/views.py: -------------------------------------------------------------------------------- 1 | # coding=utf-8 2 | from django.shortcuts import render 3 | from django.http import * 4 | from models import * 5 | from datetime import datetime 6 | from django.core.urlresolvers import reverse 7 | from . import der 8 | from django.core.paginator import Paginator 9 | 10 | @der.login_yz 11 | @der.login_name 12 | def user_center_info(request,dic): 13 | # name = request.session.get('name') 14 | # user = UserInfo.objects.get(uName=name) 15 | # user = UserInfo.objects.get(uName='wangchao') 16 | if request.method == 'GET': 17 | recentsee = dic['user'].recentsee_set.all() 18 | goodlist = [] 19 | for i in recentsee: 20 | goodlist.append(Goods.objects.get(id=int(i.goodsName))) 21 | # goodlist.append(Goods.objects.get(goodsName=i.goodsName)) 22 | recv=goodlist[-5:] 23 | recv.reverse() 24 | dic=dict(dic,**{ 'recentsee': recv}) 25 | return render(request, 'freshFruit/user_center_info.html',dic ) 26 | elif request.method == 'POST': 27 | addr = request.POST.get('addr', None) 28 | phonenumber = request.POST.get('phonenumber', None) 29 | if addr and str(phonenumber).isdigit() and len(phonenumber) == 11: 30 | dic['user'].uPhoneNumber = phonenumber 31 | dic['user'].uAddr = addr 32 | dic['user'].save() 33 | return HttpResponseRedirect(reverse('usercenter:user_center_info')) 34 | 35 | @der.login_yz 36 | @der.login_name 37 | def user_center_site(request,dic): 38 | if request.method == 'GET': 39 | # user = UserInfo.objects.get(uName='wangchao') 40 | user=dic['user'] 41 | addrinfo = user.addrinfo_set.all().filter(isDelete=False) 42 | list2 = [] 43 | 44 | for i in addrinfo: 45 | a = i.aPhoneNumber[0:] 46 | list2.append({'id': i.id, 47 | 'aProvince': i.aProvince, 48 | 'aCity': i.aCity, 49 | 'aDis': i.aDis, 50 | 'aAddressee': i.aAddressee, 51 | 'aPhoneNumber': a[0:3] + u'****' + a[7:], 52 | 'default':i.aDefaultAddr 53 | }) 54 | dic=dict(dic,**{'addrinfo': list2}) 55 | udelete = request.GET.get('delete', None) 56 | uchange = request.GET.get('change', None) 57 | if udelete: 58 | dAddr = AddrInfo.objects.get(id=udelete) 59 | dAddr.isDelete = True 60 | dAddr.save() 61 | return HttpResponseRedirect(reverse('usercenter:user_center_site')) 62 | if uchange: 63 | dAddr = AddrInfo.objects.get(id=uchange) 64 | try: 65 | deFault = AddrInfo.objects.filter(aUser=user.id).get(aDefaultAddr=True) 66 | 67 | except Exception, e: 68 | pass 69 | else: 70 | deFault.aDefaultAddr=False 71 | deFault.save() 72 | dAddr.aDefaultAddr = True 73 | dAddr.save() 74 | return HttpResponseRedirect(reverse('usercenter:user_center_site')) 75 | return render(request, 'freshFruit/user_center_site.html', dic) 76 | 77 | elif request.method == 'POST': 78 | addressee = request.POST.get('addressee', None) 79 | province = request.POST.get('province', None) 80 | city = request.POST.get('city', None) 81 | dis = request.POST.get('dis', None) 82 | detaaddr = request.POST.get('detaaddr', None) 83 | postcode = request.POST.get('postcode', None) 84 | phonenumber = request.POST.get('phonenumber', None) 85 | 86 | if addressee and province and city and detaaddr and str(phonenumber).isdigit() and len(phonenumber) == 11: 87 | addrinfo = AddrInfo() 88 | addrinfo.aProvince = AreaInfo.objects.get(id__exact=province) 89 | addrinfo.aCity = AreaInfo.objects.get(id__exact=city) 90 | 91 | if dis: 92 | addrinfo.aDis = AreaInfo.objects.get(id__exact=dis) 93 | 94 | addrinfo.aAddressee = addressee 95 | addrinfo.aDetaAddr = detaaddr 96 | addrinfo.aPostCode = postcode 97 | addrinfo.aPhoneNumber = phonenumber 98 | # user = UserInfo.objects.get(uName__exact='wangchao') 99 | 100 | addrinfo.aUser = dic['user'] 101 | addrinfo.save() 102 | print '写入完成' 103 | # addrinfo.aDefaultAddr = 104 | return HttpResponseRedirect(reverse('usercenter:user_center_site')) 105 | # return render(request,'usercenter/user_center_site.html') 106 | else: 107 | return HttpResponseRedirect(reverse('usercenter:user_center_site')) 108 | # return render(request,'usercenter/user_center_site.html') 109 | 110 | def areal(request): 111 | 112 | list1 = AreaInfo.objects.filter(aParent__isnull=True) 113 | 114 | list2 = [] 115 | for a in list1: 116 | list2.append({'id': a.id, 'title': a.aTitle}) 117 | return JsonResponse({'data': list2}) 118 | 119 | def areal2(request, pid): 120 | # list1=AreaInfo.objects.filter(aParent_id=pid) 121 | list1 = AreaInfo.objects.get(pk=pid).areainfo_set.all() 122 | list2 = [] 123 | for a in list1: 124 | list2.append({'id': a.id, 'title': a.aTitle}) 125 | return JsonResponse({'data': list2}) 126 | 127 | @der.login_yz 128 | @der.login_name 129 | def user_center_order(request,dic): 130 | orderList=Orders.objects.filter(isDelete=False).filter(userOrder_id=dic['user'].id).order_by("-id").order_by("isFinish") 131 | 132 | # orderList=Orders.objects.filter(isDelete=False).filter(userOrder_id=dic['user'].id).filter(isFinish=False).order_by("id")+Orders.objects.filter(isDelete=False).filter(userOrder_id=dic['user'].id).filter(isFinish=True).order_by("id") 133 | pIndex = request.GET.get('page', None) #获取页面index 134 | orderlist2, plist, pIndex = pagTab(orderList, pIndex, 2) # 分页 135 | if len(plist)>=3: #页码显示页数 136 | if len(plist)==pIndex: 137 | plist=plist[pIndex-3:pIndex] 138 | elif pIndex==1: 139 | plist=plist[0:pIndex+2] 140 | else: 141 | plist=plist[pIndex-2:pIndex+1] 142 | 143 | orders=[] 144 | for order in orderlist2: 145 | detaillist=[] 146 | addr=AddrInfo.objects.get(id=order.addr) 147 | for i in order.orderdetail_set.all(): 148 | detaillist.append({'od':i,'good':i.good_id}) 149 | orders.append({'order':order,'orderdetail':detaillist,'addr':addr}) 150 | 151 | dic=dict(dic,**{ 152 | 'orderlist':orders , 153 | 'plist':plist, 154 | 'pIndex':pIndex 155 | }) 156 | 157 | return render(request, 'freshFruit/user_center_order.html',dic) 158 | 159 | @der.login_yz 160 | @der.login_name 161 | def pay(request,dic): 162 | orderId=request.GET.get('order',None) 163 | order=Orders.objects.get(id=int(orderId)) 164 | order.isFinish=True 165 | order.save() 166 | return HttpResponseRedirect(reverse('usercenter:user_center_order')) 167 | 168 | def pagTab(list1, pIndex, num): 169 | # print pIndex 170 | p = Paginator(list1, num) 171 | if pIndex == '' or pIndex == None: 172 | pIndex = '1' 173 | pIndex = int(pIndex) 174 | list2 = p.page(pIndex) 175 | plist = p.page_range 176 | return list2, plist, pIndex 177 | 178 | -------------------------------------------------------------------------------- /templates/detail.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 天天生鲜-商品详情 6 | 7 | 8 | 9 | 10 | 20 | 42 | 43 | 44 |
    45 |
    46 |
    欢迎来到天天生鲜!
    47 |
    48 | 51 | 56 | 64 |
    65 |
    66 |
    67 | 68 | 80 | 81 | 104 | 105 | 112 | 113 |
    114 |
    115 | 116 |
    117 |

    大兴大棚草莓

    118 |

    草莓浆果柔软多汁,味美爽口,适合速冻保鲜贮藏。草莓速冻后,可以保持原有的色、香、味,既便于贮藏,又便于外销。

    119 |
    120 | ¥16.80 121 | 单 位:500g 122 |
    123 |
    124 |
    数 量:
    125 |
    126 | 127 | + 128 | - 129 |
    130 |
    131 |
    总价:16.80元
    132 | 138 | 139 |
    140 |
    141 | 142 |
    143 |
    144 |
    145 |

    新品推荐

    146 | 158 |
    159 |
    160 | 161 |
    162 |
      163 |
    • 商品介绍
    • 164 |
    • 评论
    • 165 |
    166 | 167 |
    168 |
    169 |
    商品详情:
    170 |
    草莓采摘园位于北京大兴区 庞各庄镇四各庄村 ,每年1月-6月面向北京以及周围城市提供新鲜草莓采摘和精品礼盒装草莓,草莓品种多样丰富,个大香甜。所有草莓均严格按照有机标准培育,不使用任何化肥和农药。草莓在采摘期间免洗可以直接食用。欢迎喜欢草莓的市民前来采摘,也欢迎各大单位选购精品有机草莓礼盒,有机草莓礼盒是亲朋馈赠、福利送礼的最佳选择。
    171 |
    172 |
    173 | 174 |
    175 |
    176 | 177 | 190 |
    191 | 192 | 193 | 213 | 214 | 215 | -------------------------------------------------------------------------------- /index/migrations/0001_initial.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | from __future__ import unicode_literals 3 | 4 | from django.db import models, migrations 5 | import tinymce.models 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | dependencies = [ 11 | ] 12 | 13 | operations = [ 14 | migrations.CreateModel( 15 | name='AddrInfo', 16 | fields=[ 17 | ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), 18 | ('aProvince', models.CharField(max_length=15)), 19 | ('aCity', models.CharField(max_length=15)), 20 | ('aDis', models.CharField(max_length=15, null=True, blank=True)), 21 | ('aAddressee', models.CharField(max_length=20)), 22 | ('aDetaAddr', models.CharField(max_length=30)), 23 | ('aPostCode', models.CharField(max_length=10, null=True, blank=True)), 24 | ('aPhoneNumber', models.CharField(max_length=15)), 25 | ('isDelete', models.BooleanField(default=False)), 26 | ('aDefaultAddr', models.BooleanField(default=False)), 27 | ('extra', models.CharField(max_length=20, null=True, blank=True)), 28 | ], 29 | options={ 30 | 'db_table': 'addrinfo', 31 | }, 32 | ), 33 | migrations.CreateModel( 34 | name='AreaInfo', 35 | fields=[ 36 | ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), 37 | ('aTitle', models.CharField(max_length=20)), 38 | ('aParent', models.ForeignKey(blank=True, to='index.AreaInfo', null=True)), 39 | ], 40 | options={ 41 | 'db_table': 'areainfo', 42 | }, 43 | ), 44 | migrations.CreateModel( 45 | name='Cart', 46 | fields=[ 47 | ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), 48 | ('goodsName', models.CharField(max_length=30)), 49 | ('buyCount', models.IntegerField(default=1)), 50 | ('isDelete', models.BooleanField(default=False)), 51 | ('extra', models.CharField(max_length=20, null=True, blank=True)), 52 | ], 53 | options={ 54 | 'db_table': 'cart', 55 | }, 56 | ), 57 | migrations.CreateModel( 58 | name='Goods', 59 | fields=[ 60 | ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), 61 | ('goodsName', models.CharField(max_length=30)), 62 | ('goodsDesc', models.CharField(max_length=80)), 63 | ('goodsPrice', models.DecimalField(max_digits=7, decimal_places=2)), 64 | ('goodsDetail', tinymce.models.HTMLField()), 65 | ('imgPath', models.ImageField(upload_to=b'uploads/')), 66 | ('saleCount', models.IntegerField(default=0)), 67 | ('gPubdate', models.DateTimeField()), 68 | ('extra', models.CharField(max_length=20, null=True, blank=True)), 69 | ], 70 | options={ 71 | 'db_table': 'goods', 72 | }, 73 | ), 74 | migrations.CreateModel( 75 | name='GoodsComment', 76 | fields=[ 77 | ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), 78 | ('userName', models.CharField(max_length=30)), 79 | ('commentDate', models.DateTimeField()), 80 | ('comment', tinymce.models.HTMLField()), 81 | ('extra', models.CharField(max_length=20, null=True, blank=True)), 82 | ('goods', models.ForeignKey(to='index.Goods')), 83 | ], 84 | options={ 85 | 'db_table': 'goodscomment', 86 | }, 87 | ), 88 | migrations.CreateModel( 89 | name='GoodSort', 90 | fields=[ 91 | ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), 92 | ('sortName', models.CharField(max_length=10)), 93 | ('sortPic', models.ImageField(upload_to=b'uploads/')), 94 | ('sortClass', models.CharField(max_length=20)), 95 | ], 96 | options={ 97 | 'db_table': 'goodsort', 98 | }, 99 | ), 100 | migrations.CreateModel( 101 | name='OrderDetail', 102 | fields=[ 103 | ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), 104 | ('goodsName', models.CharField(max_length=30)), 105 | ('goodsPrice', models.DecimalField(max_digits=7, decimal_places=2)), 106 | ('buyCount', models.IntegerField()), 107 | ('good_id', models.ForeignKey(to='index.Goods')), 108 | ], 109 | options={ 110 | 'db_table': 'orderdetail', 111 | }, 112 | ), 113 | migrations.CreateModel( 114 | name='Orders', 115 | fields=[ 116 | ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), 117 | ('isFinish', models.BooleanField(default=False)), 118 | ('isDelete', models.BooleanField(default=False)), 119 | ('orderTime', models.DateTimeField()), 120 | ('orderNumber', models.CharField(max_length=20, null=True, blank=True)), 121 | ], 122 | options={ 123 | 'db_table': 'orders', 124 | }, 125 | ), 126 | migrations.CreateModel( 127 | name='RecentSee', 128 | fields=[ 129 | ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), 130 | ('goodsName', models.CharField(max_length=30)), 131 | ('extra', models.CharField(max_length=20, null=True, blank=True)), 132 | ], 133 | options={ 134 | 'db_table': 'recentsee', 135 | }, 136 | ), 137 | migrations.CreateModel( 138 | name='UserInfo', 139 | fields=[ 140 | ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), 141 | ('uName', models.CharField(max_length=30)), 142 | ('uPassword', models.CharField(max_length=20)), 143 | ('uEmail', models.CharField(max_length=30)), 144 | ('uPhoneNumber', models.CharField(max_length=15, null=True)), 145 | ('uAddr', models.CharField(max_length=50, null=True, blank=True)), 146 | ('uRegDate', models.DateTimeField()), 147 | ('isDelete', models.BooleanField(default=False)), 148 | ('extra', models.CharField(max_length=20, null=True, blank=True)), 149 | ], 150 | options={ 151 | 'db_table': 'userinfo', 152 | }, 153 | ), 154 | migrations.AddField( 155 | model_name='recentsee', 156 | name='user', 157 | field=models.ForeignKey(to='index.UserInfo'), 158 | ), 159 | migrations.AddField( 160 | model_name='orders', 161 | name='userOrder', 162 | field=models.ForeignKey(to='index.UserInfo'), 163 | ), 164 | migrations.AddField( 165 | model_name='orderdetail', 166 | name='orders_id', 167 | field=models.ForeignKey(to='index.Orders'), 168 | ), 169 | migrations.AddField( 170 | model_name='goods', 171 | name='goodSort', 172 | field=models.ForeignKey(to='index.GoodSort'), 173 | ), 174 | migrations.AddField( 175 | model_name='cart', 176 | name='userCart', 177 | field=models.ForeignKey(to='index.UserInfo'), 178 | ), 179 | migrations.AddField( 180 | model_name='addrinfo', 181 | name='aUser', 182 | field=models.ForeignKey(to='index.UserInfo'), 183 | ), 184 | ] 185 | --------------------------------------------------------------------------------