diff --git a/Orange_lala/.gitignore b/Orange_lala/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..e2d25360b0a8d055baf3fd8b9b014842d3c9abe6 --- /dev/null +++ b/Orange_lala/.gitignore @@ -0,0 +1,106 @@ +# 自己写的 +.idea +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +wheels/ +*.egg-info/ +.installed.cfg +*.egg +MANIFEST + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*.cover +.hypothesis/ +.pytest_cache/ + +# Translations +*.mo +*.pot + +# Django stuff: +*.log +local_settings.py +db.sqlite3 + +# Flask stuff: +instance/ +.webassets-cache + +# Scrapy stuff: +.scrapy + +# Sphinx documentation +docs/_build/ + +# PyBuilder +target/ + +# Jupyter Notebook +.ipynb_checkpoints + +# pyenv +.python-version + +# celery beat schedule file +celerybeat-schedule + +# SageMath parsed files +*.sage.py + +# Environments +.env +.venv +env/ +venv/ +ENV/ +env.bak/ +venv.bak/ + +# Spyder project settings +.spyderproject +.spyproject + +# Rope project settings +.ropeproject + +# mkdocs documentation +/site + +# mypy +.mypy_cache/ diff --git a/Orange_lala/Orange_lala/__pycache__/__init__.cpython-37.pyc b/Orange_lala/Orange_lala/__pycache__/__init__.cpython-37.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d791b5a3b19f6112f7c8d70b5a57b149d0f20ae5 Binary files /dev/null and b/Orange_lala/Orange_lala/__pycache__/__init__.cpython-37.pyc differ diff --git a/Orange_lala/Orange_lala/__pycache__/settings.cpython-37.pyc b/Orange_lala/Orange_lala/__pycache__/settings.cpython-37.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a8f135812e57699903350e9d54fbdd5302b7c9e7 Binary files /dev/null and b/Orange_lala/Orange_lala/__pycache__/settings.cpython-37.pyc differ diff --git a/Orange_lala/Orange_lala/__pycache__/urls.cpython-37.pyc b/Orange_lala/Orange_lala/__pycache__/urls.cpython-37.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0602a540846659345f8aa30e9a80f9d0d39f5c18 Binary files /dev/null and b/Orange_lala/Orange_lala/__pycache__/urls.cpython-37.pyc differ diff --git a/Orange_lala/Orange_lala/settings.py b/Orange_lala/Orange_lala/settings.py index 226c79ba601aa9785085bfcae6f1f994437a2eb3..bd2edc531a88337320fdadb24d02cf57f7008e63 100644 --- a/Orange_lala/Orange_lala/settings.py +++ b/Orange_lala/Orange_lala/settings.py @@ -37,6 +37,7 @@ INSTALLED_APPS = [ 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', + 'haystack', #全文检索框架的注册 'oneself', 'home' ] @@ -92,19 +93,8 @@ DATABASES = { 'PASSWORD': 'WwW.django.cn123', } } -# AUTH_USER_MODEL = 'oneself.User' -# DATABASES = { -# 'default': { -# 'ENGINE': 'django.db.backends.mysql', -# 'NAME': 'aaaaaa', -# 'HOST': '129.28.172.210', -# 'POST': '3306', -# 'USER': 'root', -# 'PASSWORD': 'HOU.junjie.123', -# } -# } - +# AUTH_USER_MODEL = 'oneself.User' # Password validation # https://docs.djangoproject.com/en/2.1/ref/settings/#auth-password-validators @@ -143,3 +133,51 @@ USE_TZ = True STATIC_URL = '/static/' STATICFILES_DIRS = [os.path.join(BASE_DIR, 'static')] + +# django-redis缓存 +CACHES = { + "default": { + "BACKEND": "django_redis.cache.RedisCache", + "LOCATION": "redis://129.28.172.210:6379", + "OPTIONS": { + "CLIENT_CLASS": "django_redis.client.DefaultClient", + } + } +} + +# 将session缓存在Redis中 +SESSION_ENGINE = "django.contrib.sessions.backends.cache" +SESSION_CACHE_ALIAS = "default" +# session 设置(可以不写) +SESSION_COOKIE_AGE = 60 * 60 * 12 # 12小时 +SESSION_SAVE_EVERY_REQUEST = True +SESSION_EXPIRE_AT_BROWSER_CLOSE = True # 关闭浏览器,则COOKIE失效 + +# 发送邮件配置 +EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend' +EMAIL_HOST = 'smtp.qq.com' +EMAIL_PORT = 25 +#发送邮件的邮箱 +EMAIL_HOST_USER = '1668030512@qq.com' +#在邮箱中设置的客户端授权密码 +EMAIL_HOST_PASSWORD = 'zcttmkclshkpbifg' +#收件人看到的发件人 +EMAIL_FROM = '悦桔拉拉<1668030512@qq.com>' +EMAIL_USE_TLS = True # 这里必须是 True,否则发送不成功 + +# 全文检索框架 Whoosh 相关配置 +HAYSTACK_CONNECTIONS = { + 'default': { + # 使用whoosh引擎 + 'ENGINE':'haystack.backends.whoosh_backend.WhooshEngine', + # 索引文件路径 + 'PATH': os.path.join(BASE_DIR, 'whoosh_index'), + # 'PATH': os.path.join(os.path.dirname(__file__), 'whoosh_index'), + } +} +# 当添加、修改、删除数据时, 自动生成索引 +HAYSTACK_SIGNAL_PROCESSOR = 'haystack.signals.RealtimeSignalProcessor' + + +# 指定每页显示的商品数目 +HAYSTACK_SEARCH_RESULTS_PER_PAGE = 6 \ No newline at end of file diff --git a/Orange_lala/Orange_lala/urls.py b/Orange_lala/Orange_lala/urls.py index b93a684291255976bd4653072d6a1928eef850a7..adddd0712191897edd9f1e9dca566b5b5abaf2a0 100644 --- a/Orange_lala/Orange_lala/urls.py +++ b/Orange_lala/Orange_lala/urls.py @@ -19,7 +19,9 @@ from home import views urlpatterns = [ path('admin/', admin.site.urls), - path('', include('oneself.urls')), - path('', include('home.urls')), - path('', views.homepage, name='home') + path('search/', include('haystack.urls')), # 全文检索框架 + path('myself/', include('oneself.urls')), + path('home/', include('home.urls')), + path('', views.homepage, name='home'), + path('accounts/login/', views.login_handle), ] diff --git a/Orange_lala/home/Encrypt_with_password/__init__.py b/Orange_lala/home/Encrypt_with_password/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/Orange_lala/home/Encrypt_with_password/zhi_password_Md5.py b/Orange_lala/home/Encrypt_with_password/zhi_password_Md5.py new file mode 100644 index 0000000000000000000000000000000000000000..3f6dd724982839e9edbf47ec93bd79c7dba336df --- /dev/null +++ b/Orange_lala/home/Encrypt_with_password/zhi_password_Md5.py @@ -0,0 +1,49 @@ +import hashlib +# # md = hashlib.md5()#构造一个md5 +# # md.update('123456'.encode()) +# # +# +# # print(md.hexdigest())#加密后的字符串 +# class Encrrypt(object): +# def md5_passwd(self,str,salt='123456'): +# #satl是盐值,默认是123456 +# str=str+salt +# # import hashlib +# md = hashlib.md5() # 构造一个md5对象 +# md.update(str.encode()) +# res = md.hexdigest() +# return res +# +# x=Encrrypt() +# info=x.md5_passwd('147258') +# print(info) + + + + +# import math +# +# import random +# +# nums = math.floor(1e5 * random.random()) + +import random +class Random_Email(object): + def ran(self): + L = [] + M = [] + #通过遍历5次,生成五个元素,并插入列表L + for i in range(5): + L.append(random.randint(0,9)) + if len(L) >= 5: + break + + #通过遍历将L的五个元素由数字转为字符串,导入空列表M,并使用join方法合成为字符串 + for d in L: + M.append(str(d)) + S = '' .join(M) + + return S + +info=Random_Email().ran() +# print(info) \ No newline at end of file diff --git a/Orange_lala/home/__pycache__/__init__.cpython-37.pyc b/Orange_lala/home/__pycache__/__init__.cpython-37.pyc new file mode 100644 index 0000000000000000000000000000000000000000..41eaae1bce2a9688521bb2bed8967cae949d25b8 Binary files /dev/null and b/Orange_lala/home/__pycache__/__init__.cpython-37.pyc differ diff --git a/Orange_lala/home/__pycache__/admin.cpython-37.pyc b/Orange_lala/home/__pycache__/admin.cpython-37.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9a4a500ce58c6bbe68ca5108f2c651ef991a72ad Binary files /dev/null and b/Orange_lala/home/__pycache__/admin.cpython-37.pyc differ diff --git a/Orange_lala/home/__pycache__/models.cpython-37.pyc b/Orange_lala/home/__pycache__/models.cpython-37.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c6f26f06492695190aef208a0a0816c125551bf8 Binary files /dev/null and b/Orange_lala/home/__pycache__/models.cpython-37.pyc differ diff --git a/Orange_lala/home/__pycache__/urls.cpython-37.pyc b/Orange_lala/home/__pycache__/urls.cpython-37.pyc new file mode 100644 index 0000000000000000000000000000000000000000..cf10948256f2a0f324c9ccd46f66786a3fbe58cb Binary files /dev/null and b/Orange_lala/home/__pycache__/urls.cpython-37.pyc differ diff --git a/Orange_lala/home/__pycache__/views.cpython-37.pyc b/Orange_lala/home/__pycache__/views.cpython-37.pyc new file mode 100644 index 0000000000000000000000000000000000000000..351afef96421151a24d01b64f872f0d7dfd82420 Binary files /dev/null and b/Orange_lala/home/__pycache__/views.cpython-37.pyc differ diff --git a/Orange_lala/home/ask/__init__.py b/Orange_lala/home/ask/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/Orange_lala/home/ask/aliyunsms.py b/Orange_lala/home/ask/aliyunsms.py new file mode 100644 index 0000000000000000000000000000000000000000..b3ce8e346e30c3c0bf61f46b89708d6143782038 --- /dev/null +++ b/Orange_lala/home/ask/aliyunsms.py @@ -0,0 +1,62 @@ +''' +短信下发核心方法 +1. send_sms 发短信 +2. get_code 生成验证码 +''' +#coding=utf-8 +import random +from aliyunsdkcore.client import AcsClient +from aliyunsdkcore.request import CommonRequest +'''发送短信(手机,6位验证码)''' +def send_sms(phone,code): + client = AcsClient('LTAI5wu2FYZmzBOw', 'Qr065vLzBTCw2gW2UOkDlAmrzAA2ww', 'cn-hangzhou') + # client = AcsClient('LTAIAaCA44Jg65FU', 'LVgHdqyMN0GRTh5DrwXDlpWQItSt2I', 'cn-hangzhou') + #phone = '17600950805' + #aa= '222222' + code = "{'code':%s}"%(code) + request = CommonRequest() + request = CommonRequest() + request.set_accept_format('json') + request.set_domain('dysmsapi.aliyuncs.com') + request.set_method('POST') + request.set_protocol_type('https') # https | http + request.set_version('2017-05-25') + request.set_action_name('SendSms') + + request.add_query_param('RegionId', "cn-hangzhou") + # request.add_query_param('PhoneNumbers', "18835917407") + request.add_query_param('PhoneNumbers', phone) + # request.add_query_param('SignName', "十里故清风") + # request.add_query_param('TemplateCode', "SMS_172206356") + request.add_query_param('SignName', "电院") + request.add_query_param('TemplateCode', "SMS_172223517") + request.add_query_param('TemplateParam', code) + + # response = client.do_action(request) + # python2: print(response) + # print(str(response, encoding='utf-8')) + + response = client.do_action(request) + # python2: print(response) + print(str(response, encoding = 'utf-8')) + + return str(response, encoding = 'utf-8') +'''生成随机验证码: 数字表示生成几位,  True表示生成带有字母的 False不带字母的''' +def get_code(n=6,alpha=True): + s = '' # 创建字符串变量,存储生成的验证码 + for i in range(n): # 通过for循环控制验证码位数 + num = random.randint(0,9) # 生成随机数字0-9 + if alpha: # 需要字母验证码,不用传参,如果不需要字母的,关键字alpha=False + upper_alpha = chr(random.randint(65,90)) + lower_alpha = chr(random.randint(97,122)) + num = random.choice([num,upper_alpha,lower_alpha]) + s = s + str(num) + return s +if __name__ == '__main__': + # 调用下发短信方法 + # send_sms('15503617874', get_code(6,False)) + send_sms('15735945032', get_code(6,False)) + # print(get_code(6,False)) # 打印6位数字验证码 + # print(get_code(6,True)) # 打印6位数字字母混合验证码 + # print(get_code(4, False)) # 打印4位数字验证码 + # print(get_code(4, True)) # 打印4位数字字母混合验证码 \ No newline at end of file diff --git a/Orange_lala/home/migrations/__pycache__/__init__.cpython-37.pyc b/Orange_lala/home/migrations/__pycache__/__init__.cpython-37.pyc new file mode 100644 index 0000000000000000000000000000000000000000..cbe8237601e604378a870bd93be0b06be1d683fa Binary files /dev/null and b/Orange_lala/home/migrations/__pycache__/__init__.cpython-37.pyc differ diff --git a/Orange_lala/home/random_username.py b/Orange_lala/home/random_username.py new file mode 100644 index 0000000000000000000000000000000000000000..87fdb514c353c9145330158f39564d6b8811cda6 --- /dev/null +++ b/Orange_lala/home/random_username.py @@ -0,0 +1,26 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +import random +import string +#第一种方法 +import time + + +class UserRange: + def RangeUsername(self): + # seed = "1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!@#$%^&*()_+=-" + # sa = [] + # for i in range(8): + # sa.append(random.choice(seed)) + # salt = ''.join(sa) + # print(salt) + #第二种方法 + salt = ''.join(random.sample(string.ascii_letters + string.digits, 8)) + return salt + + def current_time(self): + return time.strftime('%Y-%m-%d',time.localtime(time.time())) + + +# info=UserRange() +# print(info.current_time()) \ No newline at end of file diff --git a/Orange_lala/home/restful.py b/Orange_lala/home/restful.py new file mode 100644 index 0000000000000000000000000000000000000000..5e0f1a40530a7e1384e901198c6dd4924dd74f07 --- /dev/null +++ b/Orange_lala/home/restful.py @@ -0,0 +1,38 @@ +#encoding: utf-8 +from django.http import JsonResponse + + +class HttpCode(object): + ok = 200 + paramserror = 400 + methoderror = 405 + servererror = 500 + +# {"code":400,"message":"","data":{}} +def result1(code=HttpCode.ok,message="",data=None,kwargs=None): + json_dict = {"code":code,"message":message,"result":data} + if kwargs and isinstance(kwargs,dict) and kwargs.keys(): + json_dict.update(kwargs) + # print(json_dict) + # print(JsonResponse(json_dict,json_dumps_params={'ensure_ascii': False})['status_code']) + return JsonResponse(json_dict, json_dumps_params={'ensure_ascii': False}) + + +def ok(message,data=None): + return result1(code=HttpCode.ok, message=message, data=data) + + +def params_error(message="",data=None): + return result1(code=HttpCode.paramserror,message=message,data=data) + + +def method_error(message='',data=None): + return result1(code=HttpCode.methoderror,message=message,data=data) + + +def server_error(message='',data=None): + return result1(code=HttpCode.servererror,message=message,data=data) + + + + diff --git a/Orange_lala/home/search_indexes.py b/Orange_lala/home/search_indexes.py new file mode 100644 index 0000000000000000000000000000000000000000..82ac396435a961216a0d3f654fd3885e34d6e6c7 --- /dev/null +++ b/Orange_lala/home/search_indexes.py @@ -0,0 +1,30 @@ +# 定义索引类 +from haystack import indexes + +# 导入我们的模型类 +from oneself.models import Goods +from oneself.models import Images + +# 指定对于某个类的某些数据建立索引 +# 索引类名格式:模型类名+Index +class GoodsIndex(indexes.SearchIndex, indexes.Indexable): + + # 索引字段 use_template=True指定根据表里的哪些字段建立索引文件 并将说明放在一个文件中 + text = indexes.CharField(document=True, use_template=True) + def get_model(self): + # 返回模型类 + return Goods + # 建立索引的数据 + def index_queryset(self, using=None): + return self.get_model().objects.all() + +class ImagesIndex(indexes.SearchIndex, indexes.Indexable): + + # 索引字段 use_template=True指定根据表里的哪些字段建立索引文件 并将说明放在一个文件中 + text = indexes.CharField(document=True, use_template=True) + def get_model(self): + # 返回模型类 + return Images + # 建立索引的数据 + def index_queryset(self, using=None): + return self.get_model().objects.all() diff --git a/Orange_lala/home/urls.py b/Orange_lala/home/urls.py index dc115de27a8c50b691761d5baee43857ea6e30f8..6c249182269adc842572a208a0091b13a2f76fb7 100644 --- a/Orange_lala/home/urls.py +++ b/Orange_lala/home/urls.py @@ -1,16 +1,34 @@ +from django.conf.urls import url from django.urls import path from home import views +from django.urls import path +from django.contrib.auth.decorators import login_required +from home import views +from django.urls import converters +from django.contrib.auth import views as auth_views app_name = "home" urlpatterns = [ - path('home/', views.homepage, name='homepage'), - path('home/register/', views.register, name='register'), - path('home/login/', views.login, name='login'), - path('home/sort/', views.sort, name='sort'), - path('home/introduction/', views.introduction, name='introduction'), - path('home/search/', views.search, name='search'), - path('home/shopcart/', views.shopcart, name='shopcart'), - path('home/pay/', views.pay, name='pay'), - path('home/success/', views.success, name='success'), -] \ No newline at end of file + path('', views.homepage, name='homepage'), # 首页 + path('register/', views.register, name='register'), # 注册 + path('register_handle/', views.register_handle, name='register_handle'), # 注册处理 + path('sms_send/', views.sms_send, name='sms_send'), # 发短信 + path('sms_check/', views.sms_check, name='sms_check'), # 检验短信 + path('login/', views.login_handle, name='login'), # 登录及登录处理 + path('logout/', views.my_logout, name='logout'), # 退出登录 + path('sort/', views.sort, name='sort'),# 全部商品分类 + path('province/', views.province, name="province"), #获取省/直辖市 + url(r'^city_(\d+)/$', views.city, name="city"), #获取市/区 + url(r'^county_(\d+)/$', views.county, name="county"), #获取县/区 + # path('introduction/', views.introduction, name='introduction'), + path('introduction_handle/', views.introduction_handle, name='introduction_handle'),# 商品详情 + path('search/', views.search, name='search'), # 搜索 + path('shopcart/', views.shopcart, name='shopcart'),# 购物车 + path('pay/', views.pay, name='pay'),# 购物车支付 + path('pay2/',views.pay2,name='pay2'),#订单支付 + path('pay3////',views.pay3,name='pay3'),#商品支付 + path('success//', views.success, name='success'),#支付成功 + path('into_shopcart////',views.into_shopcart,name='into_shopcart'),#加入购物车 + path('remove_shopcart//',views.remove_shopcart,name='remove_shopcart'),#移出购物车 +] diff --git a/Orange_lala/home/views.py b/Orange_lala/home/views.py new file mode 100644 index 0000000000000000000000000000000000000000..77d8cf15630f77a49a6498eb5699c352bc5f43c0 --- /dev/null +++ b/Orange_lala/home/views.py @@ -0,0 +1,513 @@ +from django.contrib.auth.decorators import login_required +from django.shortcuts import render +from oneself.models import * +from django.db.models import Q +from django.http import JsonResponse +from django.contrib.auth.models import AbstractUser +import re +import time + +from django.utils import timezone +import redis +from django.db.models import Q +from django.contrib.sessions.models import Session +from django.http import HttpResponse +from django.shortcuts import render,redirect,reverse +from django.contrib.auth import authenticate,login,logout +from django.core.cache import cache +from oneself import models +from oneself.models import UserMenber +from home import restful +from oneself.models import User +from home.ask import aliyunsms +from home.random_username import UserRange +# Create your views here. + + +#首页 +def homepage(request): + username = request.COOKIES.get('username') + print('username****=====****', username) + if username is not None: + print("username==", username) + member_id = User.objects.get(username=username).member_id + print("member_id=====", member_id) + member = UserMenber.objects.get(id=member_id).rember + print("a===", member) + all = AllTrade.objects.all() + goodclass = Goodclass.objects.all() + goodss = Goods.objects.all() + + trades_all = AllTrade.objects.all() + for trade in trades_all: + current_goods_image = [] + current_goodsinfo = [] + goods = trade.goods_set.all() + for good1 in goods: + image = Images.objects.filter(goods_id=good1.id).first() + current_goods_image.append(image) + current_goodsinfo.append(good1) + trade.images = current_goods_image + trade.goodsinfo = current_goodsinfo + + context = { + "all": all, + "goodclass": goodclass, + "goodss": goodss, + "trades_all": trades_all, + "member":member + } + return render(request, "home/home3.html", context) + else: + all = AllTrade.objects.all() + goodclass = Goodclass.objects.all() + goodss = Goods.objects.all() + + trades_all = AllTrade.objects.all() + for trade in trades_all: + current_goods_image = [] + current_goodsinfo = [] + goods = trade.goods_set.all() + for good1 in goods: + image = Images.objects.filter(goods_id=good1.id).first() + current_goods_image.append(image) + current_goodsinfo.append(good1) + trade.images = current_goods_image + trade.goodsinfo = current_goodsinfo + + context = { + "all": all, + "goodclass": goodclass, + "goodss": goodss, + "trades_all": trades_all, + } + return render(request, "home/home3.html", context) + + +#注册 +# 阿里云短信下发 验证 +def test_redis(request): + #存储数据 + cache.set('name','tom',360000) # 该值的的有效期为20S + # 判断redis中是否存在 + print(cache.has_kay('name')) # 包含true + # 获取 + print(cache.get('name')) # 返回: tom 无返回null + return HttpResponse('测试redis') + +# 发短信接口 +def sms_send(request): + # http://localhost:8000/duanxin/duanxin/sms_send/?phone=18434288349 + # 1 获取手机号 + phone = request.GET.get('phone') + # 2 生成6位验证码 + code = aliyunsms.get_code(6, False) + # 3 缓存到Redis + cache.set(phone,code,360000) #60s有效期 + print('判断缓存中是否有:',cache.has_key(phone)) + print('获取Redis验证码:',cache.get(phone)) + # 4 发短信 + result = aliyunsms.send_sms(phone, code) + return HttpResponse(result) + +# 短信验证码校验 +def sms_check(request): + # /duanxin/sms_check/?phone=xxx&code=xxx + # 1. 电话和手动输入的验证码 + phone = request.GET.get('phone') + code = request.GET.get('code') + + # 2. 获取redis中保存的code + print('缓存中是否包含:',cache.has_key(phone)) + print('取值:',cache.get(phone)) + cache_code = cache.get(phone) + # 3. 判断 + if code == cache_code: + # 格式统一调整后的 + # return HttpResponse(json.dumps({'result':'OK'})) + return restful.ok('Ok', data=None) + else: + # 格式统一调整后的 + # return HttpResponse(json.dumps({'result':'False'})) + return restful.params_error('验证码错误', data=None) + +# 338923 + +def register(request): + return render(request,'home/register.html') +def register_handle(request,hid): + print('HID=',hid) + if hid=="0": + if request.method.lower()=='post': + email=request.POST.get('email') + print("email====",email) + password=request.POST.get('pwd') + password2=request.POST.get('cpwd') + allow=request.POST.get('allow') + if not all([email,password,password2,allow]): + return render(request,'home/register.html',{"error_msg":"1数据不完整"}) + if not re.match(r'^[a-z0-9][\w.\-]*@[a-z0-9]+(\.[a-z]{2,5}){1,2}$', email): + return render(request, "home/register.html", {"error_msg": "邮箱格式不正确"}) + if allow != "on": + return render(request, "home/register.html", {"error_msg": "请勾选同意协议"}) + try: + user = User.objects.get(email=email) + print("***user=====****",user) + except User.DoesNotExist: + user=None + if user: + return render(request, 'home/register.html', {"error_msg": "邮箱已经存在"}) + print("email",email) + print(password2) + username=UserRange().RangeUsername() + birth=UserRange().current_time() + print(username) + print(birth) + # print(User) + User.objects.create_user(username=username,email=email,password=password2,birth=birth) + + return render(request,'home/login.html') + + elif hid=="1": + if request.method.lower()=='post': + phone=request.POST.get('phone') + code=request.POST.get('code') + password1=request.POST.get('pwdd') + password22=request.POST.get("cpwd1") + allow1=request.POST.get('allow1') + if not all([phone,code,password1,password22,allow1]): + return render(request, 'home/register.html', {"error_msg1": "数据不完整"}) + if not re.match(r'^1[35678]\d{9}$',phone): + return render(request,'home/register.html',{'error_msg1': "输入的电话号码有误"}) + if allow1 != "on": + return render(request,'home/register.html',{"error_msg1": "请勾选同意协议"}) + try: + user = User.objects.get(phone=phone) + except User.DoesNotExist: + """如果出现该异常说明用户名不存在,则让user对象为空""" + user = None + if user: + return render(request, 'home/register.html', {"error_msg1": "手机号码已经存在"}) + print(user) + username = UserRange().RangeUsername() + birth = UserRange().current_time() + User.objects.create_user(phone=phone, password=password22,username=username,birth=birth) + + return render(request,'home/login.html') + +#登录 + +def verify(account): + print("account=========",account) + try: + if re.match(r'^[a-z0-9][\w.\-]*@[a-z0-9]+(\.[a-z]{2,5}){1,2}$', account): + user=User.objects.get(email=account) + if user: + return account + elif re.match(r'^1[35678]\d{9}$',account): + user=User.objects.get(phone=account) + if user: + return account + else: + user = User.objects.get(username=account) + if user: + return account + except User.DoesNotExist: + return None + +def login_handle(request): + if request.method.lower()=='get': + return render(request,'home/login.html') + + + + if request.method.lower()=='post': + username=request.POST.get('uname') + password=request.POST.get('password') + remember_me=request.POST.get('rember_me') + # print("username:======",username) + # print("password:======",password) + # print(remember_me) + if not all([username,password,remember_me]): + return render(request,'home/login.html',{'error_msg':'数据不完整'}) + username = verify(username) + print("useranme=====yjdjdtjdtjdtjdtyjd",username) + if username is None: + return render(request,'home/login.html',{"error_msg":"用户名不存在"}) + user=User.objects.filter(Q(email=username) | Q(phone=username) | Q(username=username)).values_list("username",flat=True) + print('aq====',user) + if user: + # print("user====*********", user[0]) + user=authenticate(username=user[0],password=password) + print('user=*****//===',user) + if user is not None: + print("*************************", user) + # 调用login函数,实现对request进行操作,将用户信息、session、cookies等写入了request中,再用render将request进行返回 + login(request,user) + print('sessionid====',request.session.session_key) + response=redirect(reverse('home:homepage')) + if remember_me or not remember_me: + response.set_cookie("username",user,max_age=7 * 24 * 3600) + # request.session['is_login'] = 'True' + return response + else: + response.delete_cookie('username') + return response + else: + return render(request,'home/login.html',{"error_msg":"您的用户名、邮箱、手机号错误或密码错误,请检查后再次登录"}) + else: + return render(request,'home/login.html',{"error_msg":"用户名不存在"}) + + +# 退出登录 +def my_logout(request): + logout(request) + response = redirect(reverse('home:homepage')) + # response.delete_cookie('username') + return response + + +#全部分类 +def sort(request): + return render(request, "home/sort.html") + +#商品页面 +def introduction_handle(request): + + username = request.COOKIES.get('username') + if username is not None: + host_list = [] + # global host_list + user_member = User.objects.get(username=username).id + shop_number = Shopcart.objects.filter(user=user_member).count() + user_member = User.objects.get(username=username).member.rember + print(username) + good_name = request.GET.get("good_name") #前端传递过来的商品名 + # pindex = request.GET.get("pindex")/ + # print(good_name) + good = Goods.objects.get(name=good_name).id #根据商品名找到商品对应的id + goods = Goods.objects.filter(id=good) #根据商品对应的id 找到商品所在行 + good2 = Goods.objects.get(name=good_name).good_class.id + good3 = Goods.objects.get(name=good_name).good_class.all_trade.id + goodss = Goods.objects.filter(~Q(id=good) & Q(good_class=good2)) #找到同类型商品 + goodss2 = Goods.objects.filter(~Q(id=good) & Q(good_class__all_trade=good3)) #找到大类相同的商品 + images = Images.objects.filter(goods_id=good) #找到外键id与商品id相同的 + images2 = Images.objects.filter(Q(assistant=good) & Q(goods_id=good)) #找到副id与外键相同 且 外键和关联表id相同的 + images3 = Images.objects.filter(Q(goods_id=good) & ~Q(assistant=good)).first().name #找到副id与商品id不同同的第一个 + images4 = Images.objects.filter(goods_id=good).first().name #找到副id与商品id相同的第一个 + images5 = [] #存放同类型商品图片 + images5_2 = [] #存放大类型相同的商品 + for i in goodss: + image5 = Images.objects.filter(Q(goods_id=i.id) & ~Q(assistant=i.id)).first() + images5.append(image5) + for i in goodss2: + image5 = Images.objects.filter(Q(goods_id=i.id) & ~Q(assistant=i.id)).first() + images5_2.append(image5) + # paginator = Paginator(images5_2, 4) + # if pindex == "": + # pindex = '1' + # else: + # str(pindex) + # page = paginator.page(int(pindex)) + + context = { + "id": good, + "shop_number": shop_number, + "images": images, + "images2": images2, + "images3": images3, + "images4": images4, + "goods": goods, + "good": good, + "goodss": goodss, + "goodss2": goodss2, + "images5": images5, + "images5_2": images5_2, + "username": username, + "user_member": user_member + # "page": page + } + user = User.objects.get(username=username) + if user: + cache.set(user.id, host_list) + history = cache.get(user.id) + if good in history: + return render(request, "home/introduction.html", context) + else: + host_list.append(good) + cache.set(user.id, host_list, 36000) + return render(request, "home/introduction.html", context) + else: + good_name = request.GET.get("good_name") # 前端传递过来的商品名 + # pindex = request.GET.get("pindex")/ + # print(good_name) + good = Goods.objects.get(name=good_name).id # 根据商品名找到商品对应的id + goods = Goods.objects.filter(id=good) # 根据商品对应的id 找到商品所在行 + good2 = Goods.objects.get(name=good_name).good_class.id + good3 = Goods.objects.get(name=good_name).good_class.all_trade.id + goodss = Goods.objects.filter(~Q(id=good) & Q(good_class=good2)) # 找到同类型商品 + goodss2 = Goods.objects.filter(~Q(id=good) & Q(good_class__all_trade=good3)) # 找到大类相同的商品 + images = Images.objects.filter(goods_id=good) # 找到外键id与商品id相同的 + images2 = Images.objects.filter(Q(assistant=good) & Q(goods_id=good)) # 找到副id与外键相同 且 外键和关联表id相同的 + images3 = Images.objects.filter(Q(goods_id=good) & ~Q(assistant=good)).first().name # 找到副id与商品id不同同的第一个 + images4 = Images.objects.filter(goods_id=good).first().name # 找到副id与商品id相同的第一个 + images5 = [] # 存放同类型商品图片 + images5_2 = [] # 存放大类型相同的商品 + for i in goodss: + image5 = Images.objects.filter(Q(goods_id=i.id) & ~Q(assistant=i.id)).first() + images5.append(image5) + for i in goodss2: + image5 = Images.objects.filter(Q(goods_id=i.id) & ~Q(assistant=i.id)).first() + images5_2.append(image5) + # paginator = Paginator(images5_2, 4) + # if pindex == "": + # pindex = '1' + # else: + # str(pindex) + # page = paginator.page(int(pindex)) + + context = { + "id": good, + "images": images, + "images2": images2, + "images3": images3, + "images4": images4, + "goods": goods, + "good": good, + "goodss": goodss, + "goodss2": goodss2, + "images5": images5, + "images5_2": images5_2, + # "page": page + } + return render(request, "home/introduction.html", context) + +#加入购物车 +def into_shopcart(request,id,good_num,newprice): + + username = request.COOKIES.get('username') + user = User.objects.filter(username=username) + if username and user: + # good_num = request.GET.get('good_num') + # print(good_num) + + Shopcart.objects.create(good_id=id, user_id=user.id, good_num=good_num, good_price=newprice) + return redirect('home:shopcart') + else: + return redirect('home:login') + +#从购物车删除 +def del_shopcart(request,id): + username = request.session.get('username') + user = User.objects.get(username=username) + if username and user: + Shopcart.objects.filter(user_id=user.id,good_id=id).delete() + return HttpResponse('删除成功') + + +# 获取省数据 +def province(request): + provinceList = BaseArea.objects.filter(parentid=0) + list1 = [] + for item in provinceList: + list1.append([item.base_areaid, item.name]) + # print(item.name) + return JsonResponse({'data': list1}) + + +# 获取市数据 +def city(request, pid): + print(pid) + cityList = BaseArea.objects.filter(parentid=pid) + list1 = [] + for item in cityList: + # print(item.name) + list1.append([item.base_areaid, item.name]) + return JsonResponse({'data': list1}) + + +# 获取区县数据 +def county(request, pid): + print(pid) + countyList = BaseArea.objects.filter(parentid=pid) + list1 = [] + for item in countyList: + # print(item.name) + list1.append([item.base_areaid, item.name]) + return JsonResponse({'data': list1}) + +#搜索 +def search(request): + return render(request, "home/search.html") + +#购物车 +@login_required +def shopcart(request): + username = request.COOKIES.get('username') + if username is not None: + user = User.objects.get(username=username).id + shop = Shopcart.objects.filter(user_id=user) + goods = Goods.objects.all() + img = Images.objects.all()[::4] + return render(request,'home/shopcart.html',{"goods":goods,"shop":shop,"img":img}) + else: + return redirect('home:login') + +#移出购物车 +def remove_shopcart(request,id): + a = Shopcart.objects.filter(user_id=8,good_id=id) + a.delete() + return redirect('home:shopcart') + +#购物车结算 +def pay(request): + username = request.COOKIES.get('username') + user = User.objects.get(username=username).id + # addr = Adress.objects.filter(user_id=user.id) + # shopcar = Shopcart.objects.filter(user_id=user.id) + shopcar = Shopcart.objects.filter(user_id=user) + goods = Goods.objects.all() + img = Images.objects.all()[::4] + addr = Adress.objects.filter(user_id=user) + choose_addr = Adress.objects.get(user_id=user,is_choose=1) + order_price = 0 + for x in shopcar: + order_price += x.good_price + a = Order.objects.create(user_id=user,is_ok=0,is_pay=0,is_send=0,order_price=order_price) + order_id = a.id + for i in shopcar: + new_order = OrderGood.objects.create(order_id=a.id,good_id=i.id,good_num=i.good_num,good_price=i.good_price) + return render(request, "home/pay.html",{'shopcar':shopcar,"addr":addr,"goods":goods,"choose_addr":choose_addr,"img":img,"order_id":order_id}) + + +#订单结算 +def pay2(request,id): + order = Order.objects.get(id=id) + order_good = OrderGood.objects.all() + goods = Goods.objects.all() + img = Images.objects.all()[::4] + addr = Adress.objects.filter(user_id=8) + choose_addr = Adress.objects.get(user_id=8, is_choose=1) + return render(request,'home/pay2.html',{'order':order,"order_good":order_good,"goods":goods,"img":img,"addr":addr,"choose_addr":choose_addr}) + +#商品结算 +def pay3(request,id,good_num,good_price): + print(id) + good = Goods.objects.get(id=id) + a = Order.objects.create(user_id=8, is_ok=0, is_pay=0, is_send=0, order_price=int(good_num)*float(good_price)) + OrderGood.objects.create(order_id=a.id, good_id=id, good_num=good_num, good_price=good_price) + order_id = a.id + order = OrderGood.objects.get(order_id=order_id) + img = Images.objects.all()[::4] + addr = Adress.objects.filter(user_id=8) + choose_addr = Adress.objects.get(user_id=8, is_choose=1) + return render(request,'home/pay3.html',{"img":img,"addr":addr,"choose_addr":choose_addr,"order":order,"good":good}) + +#结算成功 +def success(request,id): + a = Order.objects.get(id=id) + a.is_pay = 1 + a.save() + b = Shopcart.objects.filter(user_id=8) + b.delete() + return render(request, "home/success.html") \ No newline at end of file diff --git a/Orange_lala/oneself/Send/__init__.py b/Orange_lala/oneself/Send/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/Orange_lala/oneself/Send/send_emial.py b/Orange_lala/oneself/Send/send_emial.py new file mode 100644 index 0000000000000000000000000000000000000000..6e5afb488100f30a9d04dd1db63e6ea96e2955bf --- /dev/null +++ b/Orange_lala/oneself/Send/send_emial.py @@ -0,0 +1,23 @@ +from Orange_lala import settings +from django.core.mail import send_mail + + +import os,django +os.environ.setdefault("DJANGO_SETTINGS_MODULE", "Orange_lala.settings")# project_name 项目名称 +django.setup() + +def sent_maill(toemail,username,code): + subject = "悦桔拉拉欢迎您" # 邮件标题 + message = "how are you" # 邮件正文 + sender = settings.EMAIL_FROM # 发件人 + receiver = [toemail] # 收件人 + # send_mail(subject, message, sender, receiver) + html_message = """ +      

%s 欢迎您


您的换绑邮箱验证码是 : %s


请您不要把验证码泄露给他人,以免造成您的财产损失

+

验证码1小时内有效,请您及时使用

+ """ % (username,code) + send_mail(subject, message, sender, receiver, html_message=html_message) + + +if __name__=='__main__': + sent_maill('1668030512@qq.com','15615615','147258') \ No newline at end of file diff --git a/Orange_lala/oneself/__pycache__/__init__.cpython-37.pyc b/Orange_lala/oneself/__pycache__/__init__.cpython-37.pyc new file mode 100644 index 0000000000000000000000000000000000000000..dd8c51e88d2b4215c6321b1263fdbaf1620e7d5b Binary files /dev/null and b/Orange_lala/oneself/__pycache__/__init__.cpython-37.pyc differ diff --git a/Orange_lala/oneself/__pycache__/admin.cpython-37.pyc b/Orange_lala/oneself/__pycache__/admin.cpython-37.pyc new file mode 100644 index 0000000000000000000000000000000000000000..03e361855517440352fe8909b4aabe2219f5775a Binary files /dev/null and b/Orange_lala/oneself/__pycache__/admin.cpython-37.pyc differ diff --git a/Orange_lala/oneself/__pycache__/models.cpython-37.pyc b/Orange_lala/oneself/__pycache__/models.cpython-37.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5fd28e831e4e97aff0269f964d3778c6e78db54b Binary files /dev/null and b/Orange_lala/oneself/__pycache__/models.cpython-37.pyc differ diff --git a/Orange_lala/oneself/__pycache__/urls.cpython-37.pyc b/Orange_lala/oneself/__pycache__/urls.cpython-37.pyc new file mode 100644 index 0000000000000000000000000000000000000000..15fda23c260c2b0e359840734b65ec7605e824aa Binary files /dev/null and b/Orange_lala/oneself/__pycache__/urls.cpython-37.pyc differ diff --git a/Orange_lala/oneself/__pycache__/views.cpython-37.pyc b/Orange_lala/oneself/__pycache__/views.cpython-37.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d1edabc35d7cca18b39606542f386dae08688a92 Binary files /dev/null and b/Orange_lala/oneself/__pycache__/views.cpython-37.pyc differ diff --git a/Orange_lala/oneself/migrations/0001_initial.py b/Orange_lala/oneself/migrations/0001_initial.py index a249179bf49cde05d19a6e33e9dbad2ddb9225a0..a678b118713716bdfe9690575fed076433ce4e9a 100644 --- a/Orange_lala/oneself/migrations/0001_initial.py +++ b/Orange_lala/oneself/migrations/0001_initial.py @@ -1,11 +1,9 @@ -# Generated by Django 2.1.3 on 2019-09-10 00:20 +# Generated by Django 2.2.4 on 2019-09-26 02:20 from django.conf import settings import django.contrib.auth.models -import django.contrib.auth.validators from django.db import migrations, models import django.db.models.deletion -import django.utils.timezone class Migration(migrations.Migration): @@ -13,7 +11,7 @@ class Migration(migrations.Migration): initial = True dependencies = [ - ('auth', '0012_auto_20190730_0914'), + ('auth', '0011_update_proxy_permissions'), ] operations = [ @@ -21,28 +19,28 @@ class Migration(migrations.Migration): name='User', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('password', models.CharField(max_length=128, verbose_name='password')), - ('last_login', models.DateTimeField(blank=True, null=True, verbose_name='last login')), - ('is_superuser', models.BooleanField(default=False, help_text='Designates that this user has all permissions without explicitly assigning them.', verbose_name='superuser status')), - ('username', models.CharField(error_messages={'unique': 'A user with that username already exists.'}, help_text='Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.', max_length=150, unique=True, validators=[django.contrib.auth.validators.UnicodeUsernameValidator()], verbose_name='username')), - ('first_name', models.CharField(blank=True, max_length=30, verbose_name='first name')), - ('last_name', models.CharField(blank=True, max_length=150, verbose_name='last name')), - ('email', models.EmailField(blank=True, max_length=254, verbose_name='email address')), - ('is_staff', models.BooleanField(default=False, help_text='Designates whether the user can log into this admin site.', verbose_name='staff status')), - ('is_active', models.BooleanField(default=True, help_text='Designates whether this user should be treated as active. Unselect this instead of deleting accounts.', verbose_name='active')), - ('date_joined', models.DateTimeField(default=django.utils.timezone.now, verbose_name='date joined')), - ('nickname', models.CharField(blank=True, max_length=255, null=True, verbose_name='昵称')), - ('sex', models.CharField(blank=True, max_length=1, null=True, verbose_name='性别')), - ('name', models.CharField(blank=True, max_length=255, null=True, verbose_name='真实姓名')), - ('birth', models.DateField(verbose_name='生日/年/月/日')), - ('idcard', models.CharField(blank=True, max_length=18, null=True, verbose_name='身份证号')), + ('password', models.CharField(blank=True, max_length=128, null=True)), + ('last_login', models.DateTimeField(blank=True, null=True)), + ('is_superuser', models.IntegerField(blank=True, null=True)), + ('username', models.CharField(blank=True, max_length=150, null=True, unique=True)), + ('first_name', models.CharField(blank=True, max_length=30, null=True)), + ('last_name', models.CharField(blank=True, max_length=150, null=True)), + ('email', models.CharField(blank=True, max_length=254, null=True, unique=True)), + ('is_staff', models.IntegerField(blank=True, null=True)), + ('is_active', models.IntegerField(blank=True, null=True)), + ('date_joined', models.DateTimeField(blank=True, null=True)), + ('nickname', models.CharField(blank=True, max_length=255, null=True, unique=True)), + ('sex', models.CharField(blank=True, max_length=8, null=True)), + ('name', models.CharField(blank=True, max_length=255, null=True, unique=True)), + ('phone', models.CharField(blank=True, max_length=11, null=True, unique=True)), + ('address', models.CharField(blank=True, max_length=255, null=True)), + ('birth', models.DateField(blank=True, null=True)), + ('idcard', models.CharField(blank=True, max_length=18, null=True)), ('groups', models.ManyToManyField(blank=True, help_text='The groups this user belongs to. A user will get all permissions granted to each of their groups.', related_name='user_set', related_query_name='user', to='auth.Group', verbose_name='groups')), - ('user_permissions', models.ManyToManyField(blank=True, help_text='Specific permissions for this user.', related_name='user_set', related_query_name='user', to='auth.Permission', verbose_name='user permissions')), ], options={ - 'verbose_name': '用户表', - 'verbose_name_plural': '用户表', 'db_table': 'user', + 'managed': True, }, managers=[ ('objects', django.contrib.auth.models.UserManager()), @@ -53,127 +51,311 @@ class Migration(migrations.Migration): fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('clname', models.CharField(max_length=255)), + ('climage', models.CharField(blank=True, max_length=255, null=True)), + ('image', models.CharField(blank=True, max_length=255, null=True)), + ('words', models.CharField(blank=True, max_length=255, null=True)), ], options={ - 'verbose_name': '商品大分类表', 'db_table': 'all_trade', + 'managed': True, }, ), migrations.CreateModel( name='BaseArea', fields=[ - ('base_areaid', models.AutoField(primary_key=True, serialize=False, verbose_name='id')), - ('name', models.CharField(blank=True, max_length=50, null=True, verbose_name='地区名字')), - ('parentid', models.PositiveIntegerField(verbose_name='上级id')), - ('vieworder', models.PositiveSmallIntegerField(verbose_name='顺序')), + ('base_areaid', models.AutoField(primary_key=True, serialize=False)), + ('name', models.CharField(max_length=50)), + ('parentid', models.PositiveIntegerField()), + ('vieworder', models.PositiveSmallIntegerField()), ], options={ - 'verbose_name': '省市县', 'db_table': 'base_area', + 'managed': True, }, ), migrations.CreateModel( name='BrandHome', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('nick', models.CharField(blank=True, db_column='Nick', max_length=255, null=True)), + ('nick', models.CharField(db_column='Nick', max_length=255)), ], options={ - 'verbose_name': '实力商家', 'db_table': 'brand_home', + 'managed': True, }, ), migrations.CreateModel( name='Goodclass', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('good_class_name', models.CharField(blank=True, max_length=255, null=True, verbose_name='商品细分')), - ('all_trade', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='oneself.AllTrade', verbose_name='关联商品大分类')), + ('good_class_name', models.CharField(max_length=255)), + ('all_trade', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='oneself.AllTrade')), ], options={ - 'verbose_name': '商品细分类表', 'db_table': 'goodclass', + 'managed': True, }, ), migrations.CreateModel( name='Goods', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('image', models.TextField(verbose_name='商品图片')), - ('name', models.CharField(blank=True, max_length=255, null=True, verbose_name='商品名称')), - ('brand', models.CharField(blank=True, max_length=255, null=True, verbose_name='商品品牌')), - ('pack', models.CharField(blank=True, max_length=255, null=True, verbose_name='商品包装')), - ('is_sugar', models.CharField(blank=True, max_length=255, null=True, verbose_name='商品是否含糖')), - ('taste', models.CharField(blank=True, max_length=255, null=True, verbose_name='商品口味')), - ('address', models.CharField(blank=True, max_length=255, null=True, verbose_name='商品的产地')), - ('specification', models.CharField(blank=True, max_length=255, null=True, verbose_name='商品的规格,也就是蛋糕的净含量')), - ('materials', models.CharField(blank=True, max_length=255, null=True, verbose_name='商品的配料')), - ('production_certificate', models.CharField(blank=True, max_length=255, null=True, verbose_name='商品的生产许可证号')), - ('storage_method', models.CharField(blank=True, max_length=255, null=True, verbose_name='商品存储方法')), - ('expiration_date', models.CharField(blank=True, max_length=255, null=True, verbose_name='商品保质期')), - ('import_domestic', models.CharField(blank=True, max_length=255, null=True, verbose_name='商品是进口(import),还是国产(domestic)')), - ('weight', models.CharField(blank=True, max_length=255, null=True, verbose_name='商品的重量')), - ('product_standard', models.CharField(blank=True, db_column='Product_standard', max_length=255, null=True, verbose_name='产品执行标准')), - ('repertory', models.IntegerField(verbose_name='库存')), - ('all_trade', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='oneself.AllTrade', verbose_name='商品总分类id')), - ('brand_home', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='oneself.BrandHome', verbose_name='实力商家的id')), - ('good_class', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='oneself.Goodclass', verbose_name='商品细分类id')), - ], - options={ - 'verbose_name': '商品表', + ('image', models.CharField(blank=True, max_length=100, null=True)), + ('name', models.CharField(max_length=255, unique=True)), + ('brand', models.CharField(max_length=255)), + ('pack', models.CharField(max_length=255)), + ('is_sugar', models.CharField(max_length=255)), + ('taste', models.CharField(max_length=255)), + ('address', models.CharField(max_length=255)), + ('specification', models.CharField(max_length=255)), + ('materials', models.CharField(max_length=255)), + ('production_certificate', models.CharField(max_length=255)), + ('storage_method', models.CharField(max_length=255)), + ('expiration_date', models.CharField(max_length=255)), + ('import_domestic', models.CharField(max_length=255)), + ('weight', models.CharField(max_length=255)), + ('product_standard', models.CharField(db_column='Product_standard', max_length=255)), + ('repertory', models.IntegerField()), + ('prices', models.CharField(blank=True, max_length=255, null=True)), + ('all_trade', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='oneself.AllTrade')), + ('brand_home', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='oneself.BrandHome')), + ('good_class', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='oneself.Goodclass')), + ], + options={ 'db_table': 'goods', + 'managed': True, }, ), migrations.CreateModel( name='HomeLun', fields=[ - ('lun_id', models.AutoField(primary_key=True, serialize=False, verbose_name='首页轮播图片的id')), - ('lun_name', models.CharField(max_length=255, verbose_name='首页轮播图的名字')), - ('lun_image', models.TextField(verbose_name='首页轮播的图片')), + ('lun_id', models.AutoField(primary_key=True, serialize=False)), + ('lun_name', models.CharField(max_length=255)), + ('lun_image', models.CharField(max_length=100)), ], options={ - 'verbose_name': '首页轮播图表', 'db_table': 'home_lun', + 'managed': True, }, ), migrations.CreateModel( - name='Shopcart', + name='News', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('good_image', models.TextField(verbose_name='商品的图片')), - ('good_name', models.CharField(blank=True, max_length=255, null=True, verbose_name='商品的名字')), - ('good_color', models.CharField(blank=True, max_length=255, null=True, verbose_name='商品的颜色')), - ('good_pack', models.CharField(blank=True, max_length=255, null=True, verbose_name='商品的包装')), - ('good_price', models.FloatField(verbose_name='商品的单价')), - ('good_count', models.ForeignKey(db_column='good_count', on_delete=django.db.models.deletion.CASCADE, to='oneself.Goods', verbose_name='商品的库存id')), + ('new', models.CharField(blank=True, max_length=255, null=True)), + ('new_img', models.CharField(blank=True, max_length=255, null=True)), + ('new_title', models.CharField(blank=True, max_length=255, null=True)), ], options={ - 'verbose_name': '商品详情表', - 'db_table': 'shopcart', + 'db_table': 'news', + 'managed': True, + }, + ), + migrations.CreateModel( + name='OneselfQuestionsafety', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('question', models.CharField(max_length=225, unique=True)), + ], + options={ + 'db_table': 'oneself_questionsafety', + 'managed': True, + }, + ), + migrations.CreateModel( + name='OneselfQuestionsafetytwo', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('question', models.CharField(max_length=225, unique=True)), + ], + options={ + 'db_table': 'oneself_questionsafetytwo', + 'managed': True, + }, + ), + migrations.CreateModel( + name='Order', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('is_ok', models.IntegerField(blank=True, null=True)), + ('is_pay', models.IntegerField(blank=True, null=True)), + ('ok_time', models.CharField(blank=True, max_length=255, null=True)), + ('is_send', models.IntegerField(blank=True, null=True)), + ('is_recive', models.IntegerField(blank=True, null=True)), + ('recive_time', models.CharField(blank=True, max_length=255, null=True)), + ('order_price', models.CharField(blank=True, max_length=255, null=True)), + ('user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), + ], + options={ + 'db_table': 'order', + 'managed': True, }, ), migrations.CreateModel( - name='UserAddress', + name='SafetyAccount', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('address', models.CharField(blank=True, max_length=255, null=True, verbose_name='收货地址')), - ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL, verbose_name='用户表id')), + ('question', models.CharField(max_length=255)), ], options={ - 'verbose_name': '收货地址表', - 'db_table': 'user_address', + 'db_table': 'safety_account', + 'managed': True, }, ), migrations.CreateModel( name='UserMenber', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('rember', models.CharField(blank=True, max_length=255, null=True, verbose_name='会员等级')), - ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL, verbose_name='用户表id')), + ('rember', models.CharField(max_length=255)), ], options={ - 'verbose_name': '用户等级表', 'db_table': 'user_menber', + 'managed': True, + }, + ), + migrations.CreateModel( + name='Shopcart', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('good_num', models.IntegerField(blank=True, null=True)), + ('good_price', models.FloatField(blank=True, null=True)), + ('good', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='oneself.Goods')), + ('user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), + ], + options={ + 'db_table': 'shopcart', + 'managed': True, + }, + ), + migrations.CreateModel( + name='OrderGood', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('good_num', models.IntegerField(blank=True, null=True)), + ('good_price', models.DecimalField(blank=True, decimal_places=0, max_digits=10, null=True)), + ('good', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='oneself.Goods')), + ('order', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='oneself.Order')), + ], + options={ + 'db_table': 'order_good', + 'managed': True, + }, + ), + migrations.CreateModel( + name='OneselfSafetyanswertwo', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('answertwo', models.CharField(blank=True, max_length=225, null=True)), + ('questiontwoid', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='oneself.OneselfQuestionsafetytwo')), + ('userid', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), + ], + options={ + 'db_table': 'oneself_safetyanswertwo', + 'managed': True, + }, + ), + migrations.CreateModel( + name='OneselfSafetyanswer', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('answer', models.CharField(blank=True, max_length=225, null=True)), + ('questionid', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='oneself.OneselfQuestionsafety')), + ('userid', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), + ], + options={ + 'db_table': 'oneself_safetyanswer', + 'managed': True, + }, + ), + migrations.CreateModel( + name='NewUser', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('news', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='oneself.News')), + ('user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), + ], + options={ + 'db_table': 'new_user', + 'managed': True, }, ), + migrations.CreateModel( + name='Images', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('name', models.CharField(blank=True, max_length=255, null=True)), + ('assistant', models.IntegerField(blank=True, null=True)), + ('goods', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='oneself.Goods')), + ], + options={ + 'db_table': 'images', + 'managed': True, + }, + ), + migrations.CreateModel( + name='GroupH', + fields=[ + ('id', models.IntegerField(primary_key=True, serialize=False)), + ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), + ('user_member', models.ForeignKey(db_column='user_member', on_delete=django.db.models.deletion.CASCADE, to='oneself.UserMenber')), + ], + options={ + 'db_table': 'group_h', + 'managed': True, + }, + ), + migrations.CreateModel( + name='Comments', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('comment', models.CharField(blank=True, max_length=255, null=True)), + ('comment_img', models.CharField(blank=True, max_length=255, null=True)), + ('good', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='oneself.Goods')), + ('user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), + ], + options={ + 'db_table': 'comments', + 'managed': True, + }, + ), + migrations.CreateModel( + name='Collection', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('good', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='oneself.Goods')), + ('user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), + ], + options={ + 'db_table': 'collection', + 'managed': True, + }, + ), + migrations.CreateModel( + name='Adress', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('recipients', models.CharField(blank=True, max_length=255, null=True)), + ('tel', models.CharField(blank=True, max_length=255, null=True)), + ('province', models.CharField(blank=True, max_length=255, null=True)), + ('city', models.CharField(blank=True, max_length=255, null=True)), + ('county', models.CharField(blank=True, max_length=255, null=True)), + ('detail_addr', models.CharField(blank=True, max_length=255, null=True)), + ('is_choose', models.CharField(blank=True, max_length=255, null=True)), + ('user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), + ], + options={ + 'db_table': 'adress', + 'managed': True, + }, + ), + migrations.AddField( + model_name='user', + name='member', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='oneself.UserMenber'), + ), + migrations.AddField( + model_name='user', + name='user_permissions', + field=models.ManyToManyField(blank=True, help_text='Specific permissions for this user.', related_name='user_set', related_query_name='user', to='auth.Permission', verbose_name='user permissions'), + ), ] diff --git a/Orange_lala/oneself/migrations/0002_auto_20190926_1100.py b/Orange_lala/oneself/migrations/0002_auto_20190926_1100.py new file mode 100644 index 0000000000000000000000000000000000000000..cbb258fd496f3f237744a8dc7b06e63e4231f36b --- /dev/null +++ b/Orange_lala/oneself/migrations/0002_auto_20190926_1100.py @@ -0,0 +1,18 @@ +# Generated by Django 2.2.4 on 2019-09-26 03:00 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('oneself', '0001_initial'), + ] + + operations = [ + migrations.AlterField( + model_name='adress', + name='is_choose', + field=models.CharField(blank=True, default='0', max_length=255, null=True), + ), + ] diff --git a/Orange_lala/oneself/migrations/__pycache__/0001_initial.cpython-37.pyc b/Orange_lala/oneself/migrations/__pycache__/0001_initial.cpython-37.pyc new file mode 100644 index 0000000000000000000000000000000000000000..32e1d16b510dc91abfdde5bb14acbf21ed005491 Binary files /dev/null and b/Orange_lala/oneself/migrations/__pycache__/0001_initial.cpython-37.pyc differ diff --git a/Orange_lala/oneself/migrations/__pycache__/__init__.cpython-37.pyc b/Orange_lala/oneself/migrations/__pycache__/__init__.cpython-37.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4e8d2a86ef52acaf49915ca5888d513bf5f3586f Binary files /dev/null and b/Orange_lala/oneself/migrations/__pycache__/__init__.cpython-37.pyc differ diff --git a/Orange_lala/oneself/models.py b/Orange_lala/oneself/models.py index 1b0f7fd803f8d131df35978d447e0801e9be932e..d1b44bf51b7b8a223f46de1b6048b3b749e182b3 100644 --- a/Orange_lala/oneself/models.py +++ b/Orange_lala/oneself/models.py @@ -5,44 +5,35 @@ # * Make sure each ForeignKey has `on_delete` set to the desired behavior. # * Remove `managed = False` lines if you wish to allow Django to create, modify, and delete the table # Feel free to rename the models, but don't rename db_table values or field names. +from django.contrib.auth.models import AbstractUser from django.db import models -class AllTrade(models.Model): - clname = models.CharField(max_length=255) - - class Meta: - managed = False - db_table = 'all_trade' - -class AuthGroup(models.Model): - name = models.CharField(unique=True, max_length=150) +class Adress(models.Model): + recipients = models.CharField(max_length=255, blank=True, null=True) + tel = models.CharField(max_length=255, blank=True, null=True) + province = models.CharField(max_length=255, blank=True, null=True) + city = models.CharField(max_length=255, blank=True, null=True) + county = models.CharField(max_length=255, blank=True, null=True) + user = models.ForeignKey('User', models.CASCADE, blank=True, null=True) + detail_addr = models.CharField(max_length=255, blank=True, null=True) + is_choose = models.CharField(max_length=255, blank=True, null=True,default="0") class Meta: - managed = False - db_table = 'auth_group' - + managed = True + db_table = 'adress' -class AuthGroupPermissions(models.Model): - group = models.ForeignKey(AuthGroup, models.DO_NOTHING) - permission = models.ForeignKey('AuthPermission', models.DO_NOTHING) - - class Meta: - managed = False - db_table = 'auth_group_permissions' - unique_together = (('group', 'permission'),) - -class AuthPermission(models.Model): - name = models.CharField(max_length=255) - content_type = models.ForeignKey('DjangoContentType', models.DO_NOTHING) - codename = models.CharField(max_length=100) +class AllTrade(models.Model): + clname = models.CharField(max_length=255) + climage = models.CharField(max_length=255, blank=True, null=True) + image = models.CharField(max_length=255, blank=True, null=True) + words = models.CharField(max_length=255, blank=True, null=True) class Meta: - managed = False - db_table = 'auth_permission' - unique_together = (('content_type', 'codename'),) + managed = True + db_table = 'all_trade' class BaseArea(models.Model): @@ -52,7 +43,7 @@ class BaseArea(models.Model): vieworder = models.PositiveSmallIntegerField() class Meta: - managed = False + managed = True db_table = 'base_area' @@ -60,65 +51,42 @@ class BrandHome(models.Model): nick = models.CharField(db_column='Nick', max_length=255) # Field name made lowercase. class Meta: - managed = False + managed = True db_table = 'brand_home' -class DjangoAdminLog(models.Model): - action_time = models.DateTimeField() - object_id = models.TextField(blank=True, null=True) - object_repr = models.CharField(max_length=200) - action_flag = models.PositiveSmallIntegerField() - change_message = models.TextField() - content_type = models.ForeignKey('DjangoContentType', models.DO_NOTHING, blank=True, null=True) - user = models.ForeignKey('User', models.DO_NOTHING) - - class Meta: - managed = False - db_table = 'django_admin_log' - - -class DjangoContentType(models.Model): - app_label = models.CharField(max_length=100) - model = models.CharField(max_length=100) +class Collection(models.Model): + user = models.ForeignKey('User', models.CASCADE, blank=True, null=True) + good = models.ForeignKey('Goods', models.CASCADE, blank=True, null=True) class Meta: - managed = False - db_table = 'django_content_type' - unique_together = (('app_label', 'model'),) + managed = True + db_table = 'collection' -class DjangoMigrations(models.Model): - app = models.CharField(max_length=255) - name = models.CharField(max_length=255) - applied = models.DateTimeField() +class Comments(models.Model): + user = models.ForeignKey('User', models.CASCADE, blank=True, null=True) + good = models.ForeignKey('Goods', models.CASCADE, blank=True, null=True) + comment = models.CharField(max_length=255, blank=True, null=True) + comment_img = models.CharField(max_length=255, blank=True, null=True) class Meta: - managed = False - db_table = 'django_migrations' + managed = True + db_table = 'comments' -class DjangoSession(models.Model): - session_key = models.CharField(primary_key=True, max_length=40) - session_data = models.TextField() - expire_date = models.DateTimeField() - - class Meta: - managed = False - db_table = 'django_session' - class Goodclass(models.Model): good_class_name = models.CharField(max_length=255) - all_trade = models.ForeignKey(AllTrade, models.DO_NOTHING) + all_trade = models.ForeignKey(AllTrade, models.CASCADE) class Meta: - managed = False + managed = True db_table = 'goodclass' class Goods(models.Model): - image = models.CharField(max_length=100) + image = models.CharField(max_length=100, blank=True, null=True) name = models.CharField(unique=True, max_length=255) brand = models.CharField(max_length=255) pack = models.CharField(max_length=255) @@ -134,22 +102,23 @@ class Goods(models.Model): weight = models.CharField(max_length=255) product_standard = models.CharField(db_column='Product_standard', max_length=255) # Field name made lowercase. repertory = models.IntegerField() - all_trade = models.ForeignKey(AllTrade, models.DO_NOTHING) - brand_home = models.ForeignKey(BrandHome, models.DO_NOTHING) - good_class = models.ForeignKey(Goodclass, models.DO_NOTHING) + all_trade = models.ForeignKey(AllTrade, models.CASCADE) + brand_home = models.ForeignKey(BrandHome, models.CASCADE) + good_class = models.ForeignKey(Goodclass, models.CASCADE) + prices = models.CharField(max_length=255, blank=True, null=True) class Meta: - managed = False + managed = True db_table = 'goods' class GroupH(models.Model): id = models.IntegerField(primary_key=True) - user = models.ForeignKey('User', models.DO_NOTHING) - user_member = models.ForeignKey('UserMenber', models.DO_NOTHING, db_column='user_member') + user = models.ForeignKey('User', models.CASCADE) + user_member = models.ForeignKey('UserMenber', models.CASCADE, db_column='user_member') class Meta: - managed = False + managed = True db_table = 'group_h' @@ -159,70 +128,153 @@ class HomeLun(models.Model): lun_image = models.CharField(max_length=100) class Meta: - managed = False + managed = True db_table = 'home_lun' +class Images(models.Model): + name = models.CharField(max_length=255, blank=True, null=True) + goods = models.ForeignKey(Goods, models.CASCADE, blank=True, null=True) + assistant = models.IntegerField(blank=True, null=True) + + class Meta: + managed = True + db_table = 'images' + + +class NewUser(models.Model): + news = models.ForeignKey('News', models.CASCADE, blank=True, null=True) + user = models.ForeignKey('User', models.CASCADE, blank=True, null=True) + + class Meta: + managed = True + db_table = 'new_user' + + +class News(models.Model): + new = models.CharField(max_length=255, blank=True, null=True) + new_img = models.CharField(max_length=255, blank=True, null=True) + new_title = models.CharField(max_length=255, blank=True, null=True) + + class Meta: + managed = True + db_table = 'news' + + +class OneselfQuestionsafety(models.Model): + question = models.CharField(unique=True, max_length=225) + + class Meta: + managed = True + db_table = 'oneself_questionsafety' + + +class OneselfQuestionsafetytwo(models.Model): + question = models.CharField(unique=True, max_length=225) + + class Meta: + managed = True + db_table = 'oneself_questionsafetytwo' + + +class OneselfSafetyanswer(models.Model): + answer = models.CharField(max_length=225, blank=True, null=True) + questionid = models.ForeignKey(OneselfQuestionsafety, models.CASCADE, blank=True, null=True) + userid = models.ForeignKey('User', models.CASCADE, blank=True, null=True) + + class Meta: + managed = True + db_table = 'oneself_safetyanswer' + + +class OneselfSafetyanswertwo(models.Model): + answertwo = models.CharField(max_length=225, blank=True, null=True) + questiontwoid = models.ForeignKey(OneselfQuestionsafetytwo, models.CASCADE, blank=True, null=True) + userid = models.ForeignKey('User', models.CASCADE, blank=True, null=True) + + class Meta: + managed = True + db_table = 'oneself_safetyanswertwo' + + +class Order(models.Model): + user = models.ForeignKey('User', models.CASCADE, blank=True, null=True) + is_ok = models.IntegerField(blank=True, null=True) + is_pay = models.IntegerField(blank=True, null=True) + ok_time = models.CharField(max_length=255, blank=True, null=True) + is_send = models.IntegerField(blank=True, null=True) + is_recive = models.IntegerField(blank=True, null=True) + recive_time = models.CharField(max_length=255, blank=True, null=True) + + class Meta: + managed = True + db_table = 'order' + + +class OrderGood(models.Model): + order = models.ForeignKey(Order, models.CASCADE, blank=True, null=True) + good = models.ForeignKey(Goods, models.CASCADE, blank=True, null=True) + good_num = models.IntegerField(blank=True, null=True) + good_price = models.DecimalField(max_digits=10, decimal_places=0, blank=True, null=True) + + class Meta: + managed = True + db_table = 'order_good' + + +class SafetyAccount(models.Model): + question = models.CharField(max_length=255) + + class Meta: + managed = True + db_table = 'safety_account' + + class Shopcart(models.Model): - good_image = models.TextField() - good_name = models.CharField(max_length=255) - good_color = models.CharField(max_length=255) - good_pack = models.CharField(max_length=255) - good_price = models.FloatField() - good_count = models.ForeignKey(Goods, models.DO_NOTHING, db_column='good_count') + good = models.ForeignKey(Goods, models.CASCADE, blank=True, null=True) + user = models.ForeignKey('User', models.CASCADE, blank=True, null=True) + good_num = models.IntegerField(blank=True, null=True) + good_price = models.FloatField(blank=True, null=True) class Meta: - managed = False + managed = True db_table = 'shopcart' -class User(models.Model): - password = models.CharField(max_length=128) +class User(AbstractUser): + password = models.CharField(max_length=128, blank=True, null=True) last_login = models.DateTimeField(blank=True, null=True) is_superuser = models.IntegerField(blank=True, null=True) username = models.CharField(unique=True, max_length=150, blank=True, null=True) first_name = models.CharField(max_length=30, blank=True, null=True) last_name = models.CharField(max_length=150, blank=True, null=True) - email = models.CharField(max_length=254) + email = models.CharField(max_length=254, blank=True, null=True,unique=True) is_staff = models.IntegerField(blank=True, null=True) is_active = models.IntegerField(blank=True, null=True) date_joined = models.DateTimeField(blank=True, null=True) - nickname = models.CharField(max_length=255, blank=True, null=True) - sex = models.CharField(max_length=1, blank=True, null=True) - name = models.CharField(max_length=255, blank=True, null=True) - phone = models.CharField(max_length=11) + nickname = models.CharField(max_length=255, blank=True, null=True,unique=True) + sex = models.CharField(max_length=8, blank=True, null=True) + name = models.CharField(max_length=255, blank=True, null=True,unique=True) + phone = models.CharField(max_length=11, blank=True, null=True,unique=True) address = models.CharField(max_length=255, blank=True, null=True) birth = models.DateField(blank=True, null=True) idcard = models.CharField(max_length=18, blank=True, null=True) + member = models.ForeignKey('UserMenber', models.CASCADE, blank=True, null=True) class Meta: - managed = False + managed = True db_table = 'user' -class UserGroups(models.Model): - user = models.ForeignKey(User, models.DO_NOTHING) - group = models.ForeignKey(AuthGroup, models.DO_NOTHING) - class Meta: - managed = False - db_table = 'user_groups' - unique_together = (('user', 'group'),) + + class UserMenber(models.Model): rember = models.CharField(max_length=255) class Meta: - managed = False + managed = True db_table = 'user_menber' - -class UserUserPermissions(models.Model): - user = models.ForeignKey(User, models.DO_NOTHING) - permission = models.ForeignKey(AuthPermission, models.DO_NOTHING) - - class Meta: - managed = False - db_table = 'user_user_permissions' - unique_together = (('user', 'permission'),) diff --git a/Orange_lala/oneself/urls.py b/Orange_lala/oneself/urls.py index eb449f13fd1e89f0356f06f089d6fd2eb28329dd..6191b4a90f815eeb46f321589526f14b03479b69 100644 --- a/Orange_lala/oneself/urls.py +++ b/Orange_lala/oneself/urls.py @@ -1,33 +1,51 @@ +from django.conf.urls import url from django.urls import path from oneself import views +from django.contrib.auth.decorators import login_required app_name = 'myself' urlpatterns = [ - path('myself/', views.myself_index, name='index'), - path('myself/myself_information/', views.myself_information, name='myself_information'), - path('myself/myself_safety/', views.myself_safety, name='myself_safety'), - path('myself/myself_setpay/', views.myself_setpay, name='myself_setpay'), - path('myself/myself_password/', views.myself_password, name='myself_password'), - path('myself/myself_bindphone/', views.myself_bindphone, name='myself_bindphone'), - path('myself/myself_email/', views.myself_email, name='myself_email'), - path('myself/myself_idcard/', views.myself_idcard, name='myself_idcard'), - path('myself/myself_question/', views.myself_question, name='myself_question'), - path('myself/address/', views.myself_address, name='address'), - path('myself/myself_order/', views.myself_order, name='myself_order'), - path('myself/myself_orderinfo/', views.myself_orderinfo, name='myself_orderinfo'), - path('myself/myself_refund/', views.myself_refund, name='myself_refund'), - path('myself/myself_logistics/', views.myself_logistics, name='myself_logistics'), - path('myself/myself_commentlist/', views.myself_commentlist, name='myself_commentlist'), - path('myself/myself_change/', views.myself_change, name='myself_change'), - path('myself/myself_record/', views.myself_record, name='myself_record'), - path('myself/myself_coupon/', views.myself_coupon, name='myself_coupon'), - path('myself/myself_bonus/', views.myself_bonus, name='myself_bonus'), - path('myself/myself_bill/', views.myself_bill, name='myself_bill'), - path('myself/myself_billlist/', views.myself_billlist, name='myself_billlist'), - path('myself/myself_collection/', views.myself_collection, name='myself_collection'), - path('myself/myself_foot/', views.myself_foot, name='myself_foot'), - path('myself/myself_comment/', views.myself_comment, name='myself_comment'), - path('myself/myself_news/', views.myself_news, name='myself_news'), - path('myself/myself_blog/', views.myself_blog, name='myself_blog'), - ] \ No newline at end of file + path('myself/', login_required(views.myself_index), name='index'), # 个人中心首页 + path('myself_information/', login_required(views.myself_information), name='myself_information'), # 我的信息 + path('myself_information_handle/',login_required(views.myself_information_handle), name='myself_information_handle'), # 个人信息修改 + path('myself_safety/', login_required(views.myself_safety), name='myself_safety'), + path('myself_setpay/', login_required(views.myself_setpay), name='myself_setpay'), # 设置支付密码 + path('myself_setpay_handle/', login_required(views.myself_setpay_handle), name='myself_setpay_handle'), # 设置支付密码处理 + path('myself_password/', login_required(views.myself_password), name='myself_password'), # 在用户知道旧密码的情况下修改密码 + path('myself_bindphone/', login_required(views.myself_bindphone), name='myself_bindphone'), # 绑定新的手机 + path('myself_bindphone/',login_required(views.myself_bindphone), name='myself_bindphone'), # 绑定新的手机处理函数 + path('myself_email/', login_required(views.myself_email), name='myself_email'), # 绑定邮箱 + path('myself_email_handle/',login_required(views.myself_email_handle), name='myself_email_handle'), # 绑定邮箱处理函数 + path('check_email_user/',login_required(views.check_email_user), name='check_email_user'), # 验证邮箱发送的验证码 + url('send_email/', login_required(views.send_email_user), name='send_email'), # 发送邮件 + path('myself_idcard/',login_required(views.myself_idcard), name='myself_idcard'), # 实名认证 + path('myself_question/',login_required(views.myself_question), name='myself_question'), # 设置安全问题 + path('myself_question_handle/', login_required(views.myself_question_handle), name='myself_question_handle'), # 设置安全问题处理函数 + path('address/', login_required(views.myself_address), name='address'), # 我的收货地址 + path('user_address_delete///',login_required(views.user_address_delete),name='user_address_delete'), # 删除收货地址 + path('user_update_address///',login_required(views.user_update_address),name='user_update_address'), # 更新收货地址 + path('user_update_address_handle//',login_required(views.user_update_address_handle),name='user_update_address_handle'), # 编辑收货地址 + + path('myself_order/', login_required(views.myself_order), name='myself_order'), # 我的订单 + path('close_order//',views.close_order,name='close_order'),#取消订单 + path('myself_orderinfo//', login_required(views.myself_orderinfo), name='myself_orderinfo'), # 订单详情 + + path('myself_refund/', login_required(views.myself_refund), name='myself_refund'), # 退换货管理 + path('myself_logistics//', login_required(views.myself_logistics), name='myself_logistics'), # 物流 + path('myself_commentlist/', login_required(views.myself_commentlist), name='myself_commentlist'), # 对商品发表评价 + + path('myself_change/', login_required(views.myself_change), name='myself_change'), # 退款售后 + path('myself_record/', login_required(views.myself_record), name='myself_record'), # 退货后欠款去向 + path('myself_coupon/', login_required(views.myself_coupon), name='myself_coupon'), # 我的优惠 + + path('myself_bonus/', login_required(views.myself_bonus), name='myself_bonus'), # 我的红包 + path('myself_bill/', login_required(views.myself_bill), name='myself_bill'), # 我的账单明细 + path('myself_billlist/', login_required(views.myself_billlist), name='myself_billlist'), # 我的账单列表 + + path('myself_collection/', login_required(views.myself_collection), name='myself_collection'), # 我的收藏 + path('myself_foot/', login_required(views.myself_foot), name='myself_foot'), # 我的足迹 + path('myself_comment/', login_required(views.myself_comment), name='myself_comment'), # 我的评价 + path('myself_news/', login_required(views.myself_news), name='myself_news'), # 我的消息 + path('myself_blog/', login_required(views.myself_blog), name='myself_blog'), # 消息详情 +] \ No newline at end of file diff --git a/Orange_lala/oneself/views.py b/Orange_lala/oneself/views.py index c32e286ba846643c89bb634056a2233a35532913..102932623103022691d2419642ebfb86184a1e52 100644 --- a/Orange_lala/oneself/views.py +++ b/Orange_lala/oneself/views.py @@ -1,64 +1,471 @@ -from django.shortcuts import render +import json +import re -# Create your views here. +from django.conf import settings +from django.shortcuts import render, HttpResponse, redirect + +# from django.contrib.auth.decorators import login_required +from django.shortcuts import render,HttpResponse,redirect +from django.urls import reverse + +from oneself.models import * +from django.http.response import JsonResponse +from django.urls import reverse +from oneself.models import User,UserMenber +from django.contrib.auth import authenticate, logout +from django.core.cache import cache +from oneself.Send.send_emial import sent_maill +from django.core.mail import send_mail +from home.Encrypt_with_password.zhi_password_Md5 import Random_Email +from home import restful +from oneself.models import Adress,BaseArea +from oneself.models import OneselfQuestionsafety,OneselfQuestionsafetytwo,OneselfSafetyanswer,OneselfSafetyanswertwo +# from home.Encrypt_with_password.zhi_password_Md5 import Encrypt +# Create your views here. +from django.contrib.auth.decorators import login_required #个人中心 def myself_index(request): - return render(request, "person/index.html") + # username = request.session.get('username') + # user = User.objects.get(username=username) + goods = Goods.objects.all() + collect = Collection.objects.filter(user_id=8) + not_send = len(Order.objects.filter(is_ok=0, is_pay=1, is_send=0)) + not_pay = len(Order.objects.filter(is_ok=0, is_pay=0, is_send=0)) + ok_order = len(Order.objects.filter(is_ok=0, is_pay=1, is_send=1)) + order = Order.objects.filter(is_ok=0, is_pay=1, is_send=1) + post = OrderGood.objects.all() + img = Images.objects.all()[::4] + username = request.COOKIES.get('username') + print('username****=====****', username) + if username is not None: + print("username==", username) + member_id = User.objects.get(username=username).member_id + print("member_id=====", member_id) + # user = User.objects.filter(username=username).all() + member = UserMenber.objects.get(id=member_id).rember + print("a===", member) + return render(request, "person/index.html",{"member":member, + 'goods':goods, + 'collect':collect, + "not_send":not_send, + "not_pay":not_pay, + "ok_order":ok_order, + "order":order, + "posts":post, + "img":img}) #个人资料 #个人信息 def myself_information(request): - return render(request, "person/information.html") + username = request.COOKIES.get('username') + print('username****=====****', username) + if username is not None: + print("username==", username) + member_id = User.objects.get(username=username).member_id + print("member_id=====", member_id) + user=User.objects.filter(username=username).all() + member = UserMenber.objects.get(id=member_id).rember + print("a===", member) + return render(request, "person/information.html", {"member": member,"user1111":user}) + # return render(request, "person/information.html") + + +# 个人信息修改 +def myself_information_handle(request): + if request.method.lower()=='post': + nick_name=request.POST.get('nickname') + name=request.POST.get('tusername') + sex = request.POST.get('radio10') + birth = request.POST.get('birth') + phone= request.POST.get('phone') + email=request.POST.get('email') + print('nicename===',nick_name) + print('name===',name) + print('sex===',sex) + print('birth===',birth) + print('phone===',phone) + print('email===',email) + if not all([nick_name,name,sex,birth,phone,email]): + return render(request,'person/information.html',{"success":"信息不完整,请将信息填写完整后再进行修改"}) + username=request.COOKIES.get('username') + user=User.objects.get(username=username) + user.username=nick_name + user.name=name + user.sex=sex + user.birth=birth + user.phone=phone + user.email=email + user.save() + # member_id = User.objects.get(username=nick_name).member_id + # user = User.objects.filter(username=nick_name).all() + # member = UserMenber.objects.get(id=member_id).rember + + response = redirect(reverse('home:homepage')) + response.delete_cookie('username') + logout(request) + return response + #安全设置 def myself_safety(request): - return render(request, "person/safety.html") + username = request.COOKIES.get('username') + print('username****=====****', username) + if username is not None: + print("username==", username) + member_id = User.objects.get(username=username).member_id + print("member_id=====", member_id) + user = User.objects.filter(username=username).all() + member = UserMenber.objects.get(id=member_id).rember + print("a===", member) + user_all_info=User.objects.filter(username=username).all() + return render(request, "person/safety.html",{"member":member,"user_info":user_all_info}) #支付密码 def myself_setpay(request): - return render(request, "person/setpay.html") + username=request.COOKIES.get('username') + info=User.objects.get(username=username).phone + return render(request, "person/setpay.html",{'phone':info}) + + +def myself_setpay_handle(request): + if request.method.lower()=='post': + zpwd=request.POST.get('zpwd') + zcpwd=request.POST.get('czpwd') + username=request.COOKIES.get('username') + user=User.objects.get(username=username) + if zpwd!=zcpwd: + return render(request,'person/setpay.html',{"suc":"您输入的两次密码不一致"}) + else: + # info=Encrypt() + # zcpwd=info.decrypt(key=15,s=zcpwd) + user.nickname=zcpwd + user.save() + phone=User.objects.get(username=username).phone + return render(request,'person/setpay.html',{"suc":"您的支付密码设置成功","phone":phone}) #修改密码 def myself_password(request): - return render(request, "person/password.html") + if request.method.lower()=='get': + return render(request,'person/password.html') + + if request.method.lower()=='post': + ypwd=request.POST.get('ypwd') + npwd=request.POST.get('npwd') + ncpwd=request.POST.get('ncpwd') + uname=request.COOKIES.get('username') + # user = authenticate(username=uname, password=ypwd) + # if user: + if not all([ypwd,npwd,ncpwd]): + return render(request,'person/password.html',{"bai":"请您把信息填写完整"}) + if npwd!=ncpwd: + print('两次输入的密码不一致') + return render(request, 'person/password.html', {"bai": "两次输入的新密码不一致"}) + print("执行此处") + print('hua===',User.objects.get(username=uname)) + print('ii==',User.objects.get(username=uname).password) + user=User.objects.get(username=uname) + user.set_password(ncpwd) + user.save() + response = redirect(reverse('home:homepage')) + response.delete_cookie('username') + logout(request) + return response #绑定手机 def myself_bindphone(request): - return render(request, "person/bindphone.html") + username=request.COOKIES.get('username') + phone=User.objects.get(username=username).phone + return render(request, "person/bindphone.html",{"phone":phone}) + + +def myself_bindphone_handle(request): + username=request.COOKIES.get('username') + phone=User.objects.get(username=username).phone + if request.method.lower()=='post': + code=request.POST.get('code') + nccode=request.POST.get('nccode') + newphone=request.POST.get('newphone') + if not all([code,nccode,newphone]): + return render(request, "person/bindphone.html",{"phone":phone,"erop":"请将原手机号码下发的验证码、新的手机号码与新的手机号码下发的验证码填写完整!!"}) + username = request.COOKIES.get("username") + if newphone==User.objects.get(username).phone: + return render(request, 'person/bindphone.html', {"phone": phone, "erop": "该电话号码是您换绑前的电话号码,请不要重复绑定!!"}) + phone = User.objects.filter(username=username).all().values_list('phone',flat=True)[0] + if newphone==phone: + return render(request,'person/bindphone.html',{"phone":phone,"erop":"您绑定的电话号码已经存在,请您检查后再进行换绑!!"}) + user=User.objects.get(username=username) + user.phone = newphone + user.save() + return render(request,'person/bindphone.html',{"phone":phone,"erop":"绑定新的手机号码成功"}) + #绑定邮箱 def myself_email(request): return render(request, "person/email.html") + +def send_email_user(request): + username=request.COOKIES.get('username') + print(username) + code=Random_Email().ran() + cache.set("code",code,36000) + print("code:",cache.get('code')) + email=request.GET.get("email") + if email is None: + print("发送失败") + cache.set('email',email,36000) + print('email',cache.get("email")) + print('发送成功') + sent_maill(email,username,code) + return HttpResponse(json.dumps({"msg": "OK"})) + + +def check_email_user(request): + email=request.GET.get('email') + code=request.GET.get('code') + print('缓存中是否包含:', cache.get("email")) + print('取值:', cache.get("code")) + cache_email=cache.get('email') + codeaa=cache.get('code') + if email==cache_email and code==codeaa: + return restful.ok('Ok', data=None) + else: + return restful.params_error('验证码错误', data=None) + + +def myself_email_handle(request): + if request.method.lower()=="post": + email=request.POST.get('useremail') + code=request.POST.get('yancode') + if not all([email,code]): + return render(request,'person/email.html',{'error':'请将邮箱和验证码填写完整'}) + + username=request.COOKIES.get("username") + email_u=User.objects.filter(email=email).all().values_list('email',flat=True)[0] + print(email_u) + if email==User.objects.get(username=username).email: + return render(request,'person/email.html',{'error':'该邮箱您已经绑定过了,请你不要重复绑定'}) + if email_u==email: + return render(request,'person/email.html',{'error':'邮箱已经存在,请你重新绑定'}) + user=User.objects.get(username=username) + user.email=email + user.save() + return render(request,'person/email.html',{'error':'邮箱绑定成功'}) + + # return render(request, "person/email.html") + #实名认证 def myself_idcard(request): return render(request, "person/idcard.html") #设置安全问题 def myself_question(request): - return render(request, "person/question.html") + question=OneselfQuestionsafety.objects.all() + questiontwo=OneselfQuestionsafetytwo.objects.all() + return render(request, "person/question.html",{"question":question,"questiontwo":questiontwo}) + + +def myself_question_handle(request): + question=OneselfQuestionsafety.objects.all() + questiontwo=OneselfQuestionsafetytwo.objects.all() + if request.method.lower()=="post": + ques=request.POST.get('s1') + ques2=request.POST.get('s2') + answer=request.POST.get('answer1') + answer2=request.POST.get('answer2') + if not all([ques,ques2,answer,answer2]): + return render(request, "person/question.html", {"question": question, "questiontwo": questiontwo,"error":"请将问题和信息填写完整"}) + print("ques",ques) + print("ques2",ques2) + print("answer",answer) + print("answer2",answer2) + username=request.COOKIES.get('username') + userid=User.objects.get(username=username).id + OneselfSafetyanswer.objects.create(answer=answer,questionid_id=ques,userid_id=userid) + OneselfSafetyanswertwo.objects.create(answertwo=answer2,questiontwoid_id=ques2,userid_id=userid) + return render(request, "person/question.html",{"question":question,"questiontwo":questiontwo,"error":"安全问题设置成功"}) #收货地址 def myself_address(request): - return render(request, "person/address.html") + if request.method.lower()=='get': + user=request.COOKIES.get('username') + user=User.objects.get(username=user) + useraddress=Adress.objects.filter(user_id=user.id).all() + print(useraddress) + if not useraddress.exists(): + print(useraddress) + return render(request, "person/address.html",{"useraddress":useraddress,"uk":"您还没有添加收货地址"}) + else: + return render(request, "person/address.html", {"useraddress": useraddress}) + + if request.method.lower()=='post': + shou_uname=request.POST.get("shou_uname") + shou_phone=request.POST.get("shou_phone") + shou_pro=request.POST.get("pro") + shou_city=request.POST.get("city") + shou_county=request.POST.get("county") + shou_detail=request.POST.get("shou_detail") + user_aa = request.COOKIES.get('username') + user = User.objects.get(username=user_aa) + useraddress =Adress.objects.filter(user_id=user.id).all() + if not all([shou_uname,shou_phone,shou_pro,shou_city,shou_county]): + return render(request,'person/address.html',{"error":"请你把您的地址信息填写完整!!"}) + if re.match(r"^(?:\\+?86)?1(?:3\\d{3}|5[^4\\D]\\d{2}|8\\d{3}|7(?:[01356789]\\d{2}|4(?:0\\d|1[0-2]|9\\d))|9[189]\\d{2}|6[567]\\d{2}|4(?:[14]0\\d{3}|[68]\\d{4}|[579]\\d{2}))\\d{6}$",shou_phone): + return render(request,'person/address.html',{"error":"您的手机号码不符合,请您检查后重新填写!!"}) + provice=BaseArea.objects.get(base_areaid=shou_pro).name + city=BaseArea.objects.get(base_areaid=shou_city).name + county=BaseArea.objects.get(base_areaid=shou_county).name + # detail_address_all="%s(省|市)%s(市|区)%s(区|县)%s"%(provice,city,county,shou_detail) + userid=User.objects.get(username=user_aa).id + Adress.objects.create(recipients=shou_uname,tel=shou_phone,province=provice, + city=city,county=county,user_id=userid,detail_addr=shou_detail) + print(shou_uname) + print(shou_phone) + print(provice) + print(city) + print(county) + # print(detail_address_all) + return render(request,'person/address.html',{"error":"恭喜您地址添加成功","useraddress":useraddress}) + +# 删除地址 +def user_address_delete(request,useraddressid,userid): + # print(useraddressid,userid) + username=request.COOKIES.get("username") + user=User.objects.get(username=username).id + print(userid) + print(type(userid)) + print(user) + print(type(user)) + useraddress = Adress.objects.filter(user_id=user).all() + # useraddress1 = UserAddress.objects.filter(userid_id=user).all() + if not useraddress.exists(): + print(useraddress) + return render(request, "person/address.html", {"useraddress": useraddress, "uk": "您还没有添加收货地址"}) + if str(User.objects.get(username=username).id)==userid: + Adress.objects.get(id=useraddressid).delete() + return render(request,'person/address.html',{"haik":"恭喜您删除成功","useraddress":useraddress}) + else: + return render(request, 'person/address.html', {"haik": "删除失败", "useraddress": useraddress}) + +# 编辑地址 +def user_update_address(request,useraddressid,userid): + username=request.COOKIES.get("username") + user=User.objects.get(username=username).id + print(userid) + print(type(userid)) + print(user) + print(type(user)) + # useraddress_hdsv = UserAddress.objects.filter(id=useraddressid).all() + if str(User.objects.get(username=username).id)==userid: + useraddress_hdsv=Adress.objects.filter(id=useraddressid).all() + return render(request,'person/address2.html',{"useraddress":useraddress_hdsv}) + +def user_update_address_handle(request,useraddressid): + if request.method.lower()=='post': + shou_uname=request.POST.get("shou_uname") + shou_phone=request.POST.get("shou_phone") + shou_pro=request.POST.get("pro") + shou_city=request.POST.get("city") + shou_county=request.POST.get("county") + shou_detail=request.POST.get("shou_detail") + user_aa = request.COOKIES.get('username') + user = User.objects.get(username=user_aa) + useraddress = Adress.objects.filter(user_id=user.id).all() + if not all([shou_uname,shou_phone,shou_pro,shou_city,shou_county]): + return render(request,'person/address2.html',{"useraddress":useraddress,"error":"请你把您的地址信息填写完整!!"}) + if re.match(r"^(?:\\+?86)?1(?:3\\d{3}|5[^4\\D]\\d{2}|8\\d{3}|7(?:[01356789]\\d{2}|4(?:0\\d|1[0-2]|9\\d))|9[189]\\d{2}|6[567]\\d{2}|4(?:[14]0\\d{3}|[68]\\d{4}|[579]\\d{2}))\\d{6}$",shou_phone): + return render(request,'person/address2.html',{"useraddress":useraddress,"error":"您的手机号码不符合,请您检查后重新填写!!"}) + provice=BaseArea.objects.get(base_areaid=shou_pro).name + city=BaseArea.objects.get(base_areaid=shou_city).name + county=BaseArea.objects.get(base_areaid=shou_county).name + detail_address_all="%s(省|市)%s(市|区)%s(区|县)%s"%(provice,city,county,shou_detail) + # userid=User.objects.get(username=user_aa).id + # print(type(UserAddress.id)) + u_address=Adress.objects.get(id=useraddressid) + # u_address.userid=user.id + u_address.username=shou_uname + u_address.phone=shou_phone + u_address.useraddress=detail_address_all + u_address.save() + # print(shou_uname) + # print(shou_phone) + # print(provice) + # print(city) + # print(county) + # print(detail_address_all) + return render(request,'person/address.html',{"error":"恭喜您地址重新编辑成功成功","useraddress":useraddress}) + #我的交易 #订单管理 def myself_order(request): - return render(request, "person/order.html") + + # 取消订单 + not_ok_order = Order.objects.filter(user_id=8, is_ok=1) + # 未支付订单 + not_pay_order = Order.objects.filter(user_id=8, is_pay=0,is_ok=0) + # 已支付订单 + ok_order = Order.objects.filter(user_id=8, is_pay=1) + # 未发货订单 + not_send_order = Order.objects.filter(user_id=8, is_ok=0, is_pay=1, is_send=0) + # 已发货订单 + send_order = Order.objects.filter(user_id=8, is_ok=0, is_pay=1, is_send=1) + + orders = OrderGood.objects.all() + + goods = Goods.objects.all() + img = Images.objects.all()[::4] + + goods = Goods.objects.all() + return render(request, "person/order.html",{'not_ok_order':not_ok_order, + 'not_pay_order':not_pay_order, + 'ok_order':ok_order, + "not_send_order":not_send_order, + "send_order":send_order, + "goods":goods, + "orders":orders, + "img":img}) + # else: + # redirect('home:login') + +#取消订单 +def close_order(request,id): + close = Order.objects.get(id=id) + close.is_ok = 1 + close.save() + return redirect('myself:myself_order') #订单详情 -def myself_orderinfo(request): - return render(request, "person/orderinfo.html") +def myself_orderinfo(request,id): + # username = request.session.get('username') + # user = User.objects.get(username=username) + # address = Adress.objects.filter(user_id=user.id,is_choose=1) + address = Adress.objects.get(user_id=8, is_choose=1) + order = Order.objects.get(id=id) + goods = Goods.objects.all() + img = Images.objects.all()[::4] + order_good = OrderGood.objects.all() + return render(request, "person/orderinfo.html",{'order':order,'order_good':order_good,"goods":goods,"address":address,"img":img}) #退换货 def myself_refund(request): return render(request, "person/refund.html") +#确认收货 +def recive_good(request,id): + a = Order.objects.get(id=id) + a.is_recive = 1 + a.save() + return redirect('myself:myself_order') + #查看物流 -def myself_logistics(request): - return render(request, "person/logistics.html") +def myself_logistics(request,id): + order = Order.objects.get(id=id) + order_good = OrderGood.objects.filter(order_id=id) + goods = Goods.objects.all() + + return render(request, "person/logistics.html",{"order":order,"goods":goods}) #发表评价 def myself_commentlist(request): @@ -66,7 +473,18 @@ def myself_commentlist(request): #退款售后 def myself_change(request): - return render(request, "person/change.html") + # username = request.session.get('username') + # user = User.objects.get(username=username) + # if username and user: + back_order = Order.objects.filter(user_id=8, is_ok=1) + recive_order = Order.objects.filter(user_id=8,is_recive=1) + ordergoods = OrderGood.objects.all() + goods = Goods.objects.all() + img = Images.objects.all()[::4] + # for i in back_order: + # ordergood = OrderGood.objects.filter(order_id=i.id) + # ordergoods.append(ordergood) + return render(request, "person/change.html",{'back_order':back_order,"recive_order":recive_order,"ordergoods":ordergoods,"goods":goods,"img":img}) #钱款去向 def myself_record(request): @@ -85,25 +503,88 @@ def myself_bonus(request): def myself_bill(request): return render(request, "person/bill.html") + def myself_billlist(request): return render(request, "person/billlist.html") #我的小屋 + +#移入收藏夹 +def into_collect(request,id): + # username = request.session.get('username') + # user = User.objects.get(username=username) + # if username and user: + # Collection.objects.create(user_id=user.id,good_id=id) + Collection.objects.create(user_id=8, good_id=id) + return HttpResponse('收藏成功') + # else: + # redirect('home:login') + #收藏 def myself_collection(request): - return render(request, "person/collection.html") + # username = request.session.get('username') + # user = User.objects.get(username=username) + # if username and user: + # collect = Collection.objects.filter(user_id=user.id) + + collect = Collection.objects.filter(user_id=8) + goods = [] + img = Images.objects.all()[::4] + for i in collect: + good = Goods.objects.get(id=i.good_id) + goods.insert(0,good) + return render(request, "person/collection.html",{'collect':collect,"good":goods,"img":img}) + # else: + # return redirect('home:login') #足迹 def myself_foot(request): - return render(request, "person/foot.html") + # username = request.session.get('username') + # user = User.objects.get(username=username) + # history = cache.get(user.id) + # goods = [] + # for i in history: + # good = Goods.objects.get(id=i) + # goods.append(good) + goods = [] + img = Images.objects.all()[::4] + for i in range(1,10): + good = Goods.objects.get(id=i) + goods.append(good) + return render(request, "person/foot.html",{'goods':goods,"img":img}) #评价 def myself_comment(request): - return render(request, "person/comment.html") + # username = request.session.get('username') + # user = User.objects.get(username=username) + # if username and user: + # collect = Collection.objects.filter(user_id=user.id) + + comment = Comments.objects.filter(user_id=8) + goods = Goods.objects.all() + img = Images.objects.all()[::4] + return render(request, "person/comment.html",{"comment":comment,"goods":goods,"img":img}) #消息 def myself_news(request): - return render(request, "person/news.html") + # username = request.session.get('username') + # user = User.objects.get(username=username) + # if username and user: + news = News.objects.filter(id__lte = 5) + recive_order_news = Order.objects.filter(is_recive=1) + recive_orders = [] + imgs = [] + for i in recive_order_news: + recive_order = OrderGood.objects.filter(order_id=i.id) + recive_orders.append(recive_order) + for x in recive_order: + img = Images.objects.filter(goods_id=x.good_id)[::4] + imgs.append(img) + print(imgs) + + goods = Goods.objects.all() + + return render(request, "person/news.html",{"news":news,"recive_order":recive_order_news,"goods":goods,"recive_orders":recive_orders,"imgs":imgs}) #消息详情 def myself_blog(request): diff --git a/Orange_lala/static/css/banner.css b/Orange_lala/static/css/banner.css new file mode 100644 index 0000000000000000000000000000000000000000..90062d2906f419699492becfb66da0f76af4c142 --- /dev/null +++ b/Orange_lala/static/css/banner.css @@ -0,0 +1,28 @@ +*{ +margin: 0; +padding: 0; +} +#father{ +position: absolute; +/*外层div的宽高应等于图片的宽高*/ +width: 1185px; +height: 407px; +/*超出部分隐藏*/ +overflow: hidden; +} +#son{ +/*内层div的宽应>=图片的数量*每一个图片的宽度,如本次图片的宽度308*/ +width: 2300px; +height: 240px; +/*定位*/ +position: absolute; +left: 50px; +top: 130px; +} +#son img{ +float: left; +width: 180px; +height: 180px; + /*图片间距*/ + margin-left: 50px; +} \ No newline at end of file diff --git a/Orange_lala/static/css/demo.css b/Orange_lala/static/css/demo.css new file mode 100644 index 0000000000000000000000000000000000000000..a67054a0a030993643b8cbe9f344b34706efa134 --- /dev/null +++ b/Orange_lala/static/css/demo.css @@ -0,0 +1,539 @@ +/* Logo 字体 */ +@font-face { + font-family: "iconfont logo"; + src: url('https://at.alicdn.com/t/font_985780_km7mi63cihi.eot?t=1545807318834'); + src: url('https://at.alicdn.com/t/font_985780_km7mi63cihi.eot?t=1545807318834#iefix') format('embedded-opentype'), + url('https://at.alicdn.com/t/font_985780_km7mi63cihi.woff?t=1545807318834') format('woff'), + url('https://at.alicdn.com/t/font_985780_km7mi63cihi.ttf?t=1545807318834') format('truetype'), + url('https://at.alicdn.com/t/font_985780_km7mi63cihi.svg?t=1545807318834#iconfont') format('svg'); +} + +.logo { + font-family: "iconfont logo"; + font-size: 160px; + font-style: normal; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} + +/* tabs */ +.nav-tabs { + position: relative; +} + +.nav-tabs .nav-more { + position: absolute; + right: 0; + bottom: 0; + height: 42px; + line-height: 42px; + color: #666; +} + +#tabs { + border-bottom: 1px solid #eee; +} + +#tabs li { + cursor: pointer; + width: 100px; + height: 40px; + line-height: 40px; + text-align: center; + font-size: 16px; + border-bottom: 2px solid transparent; + position: relative; + z-index: 1; + margin-bottom: -1px; + color: #666; +} + + +#tabs .active { + border-bottom-color: #f00; + color: #222; +} + +.tab-container .content { + display: none; +} + +/* 页面布局 */ +.main { + padding: 30px 100px; + width: 960px; + margin: 0 auto; +} + +.main .logo { + color: #333; + text-align: left; + margin-bottom: 30px; + line-height: 1; + height: 110px; + margin-top: -50px; + overflow: hidden; + *zoom: 1; +} + +.main .logo a { + font-size: 160px; + color: #333; +} + +.helps { + margin-top: 40px; +} + +.helps pre { + padding: 20px; + margin: 10px 0; + border: solid 1px #e7e1cd; + background-color: #fffdef; + overflow: auto; +} + +.icon_lists { + width: 100% !important; + overflow: hidden; + *zoom: 1; +} + +.icon_lists li { + width: 100px; + margin-bottom: 10px; + margin-right: 20px; + text-align: center; + list-style: none !important; + cursor: default; +} + +.icon_lists li .code-name { + line-height: 1.2; +} + +.icon_lists .icon { + display: block; + height: 100px; + line-height: 100px; + font-size: 42px; + margin: 10px auto; + color: #333; + -webkit-transition: font-size 0.25s linear, width 0.25s linear; + -moz-transition: font-size 0.25s linear, width 0.25s linear; + transition: font-size 0.25s linear, width 0.25s linear; +} + +.icon_lists .icon:hover { + font-size: 100px; +} + +.icon_lists .svg-icon { + /* 通过设置 font-size 来改变图标大小 */ + width: 1em; + /* 图标和文字相邻时,垂直对齐 */ + vertical-align: -0.15em; + /* 通过设置 color 来改变 SVG 的颜色/fill */ + fill: currentColor; + /* path 和 stroke 溢出 viewBox 部分在 IE 下会显示 + normalize.css 中也包含这行 */ + overflow: hidden; +} + +.icon_lists li .name, +.icon_lists li .code-name { + color: #666; +} + +/* markdown 样式 */ +.markdown { + color: #666; + font-size: 14px; + line-height: 1.8; +} + +.highlight { + line-height: 1.5; +} + +.markdown img { + vertical-align: middle; + max-width: 100%; +} + +.markdown h1 { + color: #404040; + font-weight: 500; + line-height: 40px; + margin-bottom: 24px; +} + +.markdown h2, +.markdown h3, +.markdown h4, +.markdown h5, +.markdown h6 { + color: #404040; + margin: 1.6em 0 0.6em 0; + font-weight: 500; + clear: both; +} + +.markdown h1 { + font-size: 28px; +} + +.markdown h2 { + font-size: 22px; +} + +.markdown h3 { + font-size: 16px; +} + +.markdown h4 { + font-size: 14px; +} + +.markdown h5 { + font-size: 12px; +} + +.markdown h6 { + font-size: 12px; +} + +.markdown hr { + height: 1px; + border: 0; + background: #e9e9e9; + margin: 16px 0; + clear: both; +} + +.markdown p { + margin: 1em 0; +} + +.markdown>p, +.markdown>blockquote, +.markdown>.highlight, +.markdown>ol, +.markdown>ul { + width: 80%; +} + +.markdown ul>li { + list-style: circle; +} + +.markdown>ul li, +.markdown blockquote ul>li { + margin-left: 20px; + padding-left: 4px; +} + +.markdown>ul li p, +.markdown>ol li p { + margin: 0.6em 0; +} + +.markdown ol>li { + list-style: decimal; +} + +.markdown>ol li, +.markdown blockquote ol>li { + margin-left: 20px; + padding-left: 4px; +} + +.markdown code { + margin: 0 3px; + padding: 0 5px; + background: #eee; + border-radius: 3px; +} + +.markdown strong, +.markdown b { + font-weight: 600; +} + +.markdown>table { + border-collapse: collapse; + border-spacing: 0px; + empty-cells: show; + border: 1px solid #e9e9e9; + width: 95%; + margin-bottom: 24px; +} + +.markdown>table th { + white-space: nowrap; + color: #333; + font-weight: 600; +} + +.markdown>table th, +.markdown>table td { + border: 1px solid #e9e9e9; + padding: 8px 16px; + text-align: left; +} + +.markdown>table th { + background: #F7F7F7; +} + +.markdown blockquote { + font-size: 90%; + color: #999; + border-left: 4px solid #e9e9e9; + padding-left: 0.8em; + margin: 1em 0; +} + +.markdown blockquote p { + margin: 0; +} + +.markdown .anchor { + opacity: 0; + transition: opacity 0.3s ease; + margin-left: 8px; +} + +.markdown .waiting { + color: #ccc; +} + +.markdown h1:hover .anchor, +.markdown h2:hover .anchor, +.markdown h3:hover .anchor, +.markdown h4:hover .anchor, +.markdown h5:hover .anchor, +.markdown h6:hover .anchor { + opacity: 1; + display: inline-block; +} + +.markdown>br, +.markdown>p>br { + clear: both; +} + + +.hljs { + display: block; + background: white; + padding: 0.5em; + color: #333333; + overflow-x: auto; +} + +.hljs-comment, +.hljs-meta { + color: #969896; +} + +.hljs-string, +.hljs-variable, +.hljs-template-variable, +.hljs-strong, +.hljs-emphasis, +.hljs-quote { + color: #df5000; +} + +.hljs-keyword, +.hljs-selector-tag, +.hljs-type { + color: #a71d5d; +} + +.hljs-literal, +.hljs-symbol, +.hljs-bullet, +.hljs-attribute { + color: #0086b3; +} + +.hljs-section, +.hljs-name { + color: #63a35c; +} + +.hljs-tag { + color: #333333; +} + +.hljs-title, +.hljs-attr, +.hljs-selector-id, +.hljs-selector-class, +.hljs-selector-attr, +.hljs-selector-pseudo { + color: #795da3; +} + +.hljs-addition { + color: #55a532; + background-color: #eaffea; +} + +.hljs-deletion { + color: #bd2c00; + background-color: #ffecec; +} + +.hljs-link { + text-decoration: underline; +} + +/* 代码高亮 */ +/* PrismJS 1.15.0 +https://prismjs.com/download.html#themes=prism&languages=markup+css+clike+javascript */ +/** + * prism.js default theme for JavaScript, CSS and HTML + * Based on dabblet (http://dabblet.com) + * @author Lea Verou + */ +code[class*="language-"], +pre[class*="language-"] { + color: black; + background: none; + text-shadow: 0 1px white; + font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace; + text-align: left; + white-space: pre; + word-spacing: normal; + word-break: normal; + word-wrap: normal; + line-height: 1.5; + + -moz-tab-size: 4; + -o-tab-size: 4; + tab-size: 4; + + -webkit-hyphens: none; + -moz-hyphens: none; + -ms-hyphens: none; + hyphens: none; +} + +pre[class*="language-"]::-moz-selection, +pre[class*="language-"] ::-moz-selection, +code[class*="language-"]::-moz-selection, +code[class*="language-"] ::-moz-selection { + text-shadow: none; + background: #b3d4fc; +} + +pre[class*="language-"]::selection, +pre[class*="language-"] ::selection, +code[class*="language-"]::selection, +code[class*="language-"] ::selection { + text-shadow: none; + background: #b3d4fc; +} + +@media print { + + code[class*="language-"], + pre[class*="language-"] { + text-shadow: none; + } +} + +/* Code blocks */ +pre[class*="language-"] { + padding: 1em; + margin: .5em 0; + overflow: auto; +} + +:not(pre)>code[class*="language-"], +pre[class*="language-"] { + background: #f5f2f0; +} + +/* Inline code */ +:not(pre)>code[class*="language-"] { + padding: .1em; + border-radius: .3em; + white-space: normal; +} + +.token.comment, +.token.prolog, +.token.doctype, +.token.cdata { + color: slategray; +} + +.token.punctuation { + color: #999; +} + +.namespace { + opacity: .7; +} + +.token.property, +.token.tag, +.token.boolean, +.token.number, +.token.constant, +.token.symbol, +.token.deleted { + color: #905; +} + +.token.selector, +.token.attr-name, +.token.string, +.token.char, +.token.builtin, +.token.inserted { + color: #690; +} + +.token.operator, +.token.entity, +.token.url, +.language-css .token.string, +.style .token.string { + color: #9a6e3a; + background: hsla(0, 0%, 100%, .5); +} + +.token.atrule, +.token.attr-value, +.token.keyword { + color: #07a; +} + +.token.function, +.token.class-name { + color: #DD4A68; +} + +.token.regex, +.token.important, +.token.variable { + color: #e90; +} + +.token.important, +.token.bold { + font-weight: bold; +} + +.token.italic { + font-style: italic; +} + +.token.entity { + cursor: help; +} diff --git a/Orange_lala/static/css/iconfont.css b/Orange_lala/static/css/iconfont.css new file mode 100644 index 0000000000000000000000000000000000000000..3f5c702fba420cc18d81dae0848622b170c362f1 --- /dev/null +++ b/Orange_lala/static/css/iconfont.css @@ -0,0 +1,81 @@ +@font-face {font-family: "iconfont"; + src: url('iconfont.eot?t=1568098635179'); /* IE9 */ + src: url('iconfont.eot?t=1568098635179#iefix') format('embedded-opentype'), /* IE6-IE8 */ + url('data:application/x-font-woff2;charset=utf-8;base64,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') format('woff2'), + url('iconfont.woff?t=1568098635179') format('woff'), + url('iconfont.ttf?t=1568098635179') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+ */ + url('iconfont.svg?t=1568098635179#iconfont') format('svg'); /* iOS 4.1- */ +} + +.iconfont { + font-family: "iconfont" !important; + font-size: 16px; + font-style: normal; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} + +.icon-naifen:before { + content: "\e761"; +} + +.icon-shuiguo:before { + content: "\35b8"; +} + +.icon-qita:before { + content: "\e60a"; +} + +.icon-qiaokeli:before { + content: "\e61c"; +} + +.icon-jiulei:before { + content: "\e696"; +} + +.icon-chaye:before { + content: "\e614"; +} + +.icon-wheat__easyic:before { + content: "\e63b"; +} + +.icon-lengdongyinpin:before { + content: "\e6b4"; +} + +.icon-yinliao:before { + content: "\e60d"; +} + +.icon-mianbao_:before { + content: "\e602"; +} + +.icon-tubiao-:before { + content: "\e606"; +} + +.icon-shucai:before { + content: "\e8f5"; +} + +.icon-ziyuan:before { + content: "\e62b"; +} + +.icon-haiweihexian:before { + content: "\e603"; +} + +.icon--:before { + content: "\e6ef"; +} + +.icon-roulei:before { + content: "\e613"; +} + diff --git a/Orange_lala/static/image1/Special_nutritious_food.png b/Orange_lala/static/image1/Special_nutritious_food.png new file mode 100644 index 0000000000000000000000000000000000000000..c677345416650499e5b84a9ed5def7c0b83f8867 Binary files /dev/null and b/Orange_lala/static/image1/Special_nutritious_food.png differ diff --git a/Orange_lala/static/image1/The_beverage_category.jpg b/Orange_lala/static/image1/The_beverage_category.jpg new file mode 100644 index 0000000000000000000000000000000000000000..60d5300cd8e6012f7d283f14b3eb68ad5322465b Binary files /dev/null and b/Orange_lala/static/image1/The_beverage_category.jpg differ diff --git a/Orange_lala/static/image1/baked_food.jpg b/Orange_lala/static/image1/baked_food.jpg new file mode 100644 index 0000000000000000000000000000000000000000..08157f1d2b1662cf181f7e3c67026a118a268c0b Binary files /dev/null and b/Orange_lala/static/image1/baked_food.jpg differ diff --git a/Orange_lala/static/image1/cereal_product.jpg b/Orange_lala/static/image1/cereal_product.jpg new file mode 100644 index 0000000000000000000000000000000000000000..7a07cb78775cdf99a7f00a30c502b172e99b1535 Binary files /dev/null and b/Orange_lala/static/image1/cereal_product.jpg differ diff --git a/Orange_lala/static/image1/chocolate.jpg b/Orange_lala/static/image1/chocolate.jpg new file mode 100644 index 0000000000000000000000000000000000000000..c427b413caa094e39a3e7873d93bdb40b0c53fd7 Binary files /dev/null and b/Orange_lala/static/image1/chocolate.jpg differ diff --git a/Orange_lala/static/image1/drink.jpg b/Orange_lala/static/image1/drink.jpg new file mode 100644 index 0000000000000000000000000000000000000000..a7edb67cd67e0d01e0eb94a06ced205a8efa0a56 Binary files /dev/null and b/Orange_lala/static/image1/drink.jpg differ diff --git a/Orange_lala/static/image1/fruit.jpg b/Orange_lala/static/image1/fruit.jpg new file mode 100644 index 0000000000000000000000000000000000000000..bf5cfbb5425ff8d45b241105ec48c309d4b8dfc6 Binary files /dev/null and b/Orange_lala/static/image1/fruit.jpg differ diff --git a/Orange_lala/static/image1/instant_noodles.jpg b/Orange_lala/static/image1/instant_noodles.jpg new file mode 100644 index 0000000000000000000000000000000000000000..7e89db2222aa05e9e80d43b520658c61f8b3586a Binary files /dev/null and b/Orange_lala/static/image1/instant_noodles.jpg differ diff --git a/Orange_lala/static/image1/liquor.jpg b/Orange_lala/static/image1/liquor.jpg new file mode 100644 index 0000000000000000000000000000000000000000..5ec3ac4cd2c3f49a9f625bae21f435d627d77ff5 Binary files /dev/null and b/Orange_lala/static/image1/liquor.jpg differ diff --git a/Orange_lala/static/image1/meat_product.jpg b/Orange_lala/static/image1/meat_product.jpg new file mode 100644 index 0000000000000000000000000000000000000000..dfa44cb767bb42214cff4c3b868ed64f21ebfa39 Binary files /dev/null and b/Orange_lala/static/image1/meat_product.jpg differ diff --git a/Orange_lala/static/image1/milk.jpg b/Orange_lala/static/image1/milk.jpg new file mode 100644 index 0000000000000000000000000000000000000000..4fb7b30afb9626e1693a0179bc56a495e3782090 Binary files /dev/null and b/Orange_lala/static/image1/milk.jpg differ diff --git a/Orange_lala/static/image1/nut.jpg b/Orange_lala/static/image1/nut.jpg new file mode 100644 index 0000000000000000000000000000000000000000..8ffcde9646400c6286efbd781eb4cf7c6e281fbd Binary files /dev/null and b/Orange_lala/static/image1/nut.jpg differ diff --git a/Orange_lala/static/image1/seafood_tree.jpg b/Orange_lala/static/image1/seafood_tree.jpg new file mode 100644 index 0000000000000000000000000000000000000000..326a2c42bc084b5dbb34ab4b823964f4344340db Binary files /dev/null and b/Orange_lala/static/image1/seafood_tree.jpg differ diff --git a/Orange_lala/static/image1/seasoner.jpg b/Orange_lala/static/image1/seasoner.jpg new file mode 100644 index 0000000000000000000000000000000000000000..c20ecf10334dd491f8afa3f3487628c9c0a6a692 Binary files /dev/null and b/Orange_lala/static/image1/seasoner.jpg differ diff --git a/Orange_lala/static/image1/tea.jpg b/Orange_lala/static/image1/tea.jpg new file mode 100644 index 0000000000000000000000000000000000000000..fcf999437482f560f05366a0893d4383ae09eee2 Binary files /dev/null and b/Orange_lala/static/image1/tea.jpg differ diff --git a/Orange_lala/static/image1/vegetables.jfif b/Orange_lala/static/image1/vegetables.jfif new file mode 100644 index 0000000000000000000000000000000000000000..94b5e4a55913082f42677936b859592a6f2caf44 Binary files /dev/null and b/Orange_lala/static/image1/vegetables.jfif differ diff --git a/Orange_lala/static/js/iconfont.js b/Orange_lala/static/js/iconfont.js new file mode 100644 index 0000000000000000000000000000000000000000..bfcb05a6f4736e5e2edbe280321fa75d5a7d6a62 --- /dev/null +++ b/Orange_lala/static/js/iconfont.js @@ -0,0 +1 @@ +!function(h){var c,t='',l=(c=document.getElementsByTagName("script"))[c.length-1].getAttribute("data-injectcss");if(l&&!h.__iconfont__svg__cssinject__){h.__iconfont__svg__cssinject__=!0;try{document.write("")}catch(c){console&&console.log(c)}}!function(c){if(document.addEventListener)if(~["complete","loaded","interactive"].indexOf(document.readyState))setTimeout(c,0);else{var l=function(){document.removeEventListener("DOMContentLoaded",l,!1),c()};document.addEventListener("DOMContentLoaded",l,!1)}else document.attachEvent&&(e=c,a=h.document,i=!1,(o=function(){try{a.documentElement.doScroll("left")}catch(c){return void setTimeout(o,50)}t()})(),a.onreadystatechange=function(){"complete"==a.readyState&&(a.onreadystatechange=null,t())});function t(){i||(i=!0,e())}var e,a,i,o}(function(){var c,l;(c=document.createElement("div")).innerHTML=t,t=null,(l=c.getElementsByTagName("svg")[0])&&(l.setAttribute("aria-hidden","true"),l.style.position="absolute",l.style.width=0,l.style.height=0,l.style.overflow="hidden",function(c,l){l.firstChild?function(c,l){l.parentNode.insertBefore(c,l)}(c,l.firstChild):l.appendChild(c)}(l,document.body))})}(window); \ No newline at end of file diff --git a/Orange_lala/static/js/pay.js b/Orange_lala/static/js/pay.js new file mode 100644 index 0000000000000000000000000000000000000000..5db3f6f9319184fa5b8d223fd8f7f2129047649f --- /dev/null +++ b/Orange_lala/static/js/pay.js @@ -0,0 +1,36 @@ +function get_price() { + var count1 = 0; + count2 = 0; + $('.J_ItemSum').each(function () { + count1 += parseFloat($(this).html()); + count1 += parseFloat($('.sys_item_freprice').html()) + }); + count2 = count1 - parseFloat($('.yhq').val()) - parseFloat($('.hb').val()); + $('.pay-sum').html(count1); + $('#J_ActualFee').html(count2) + +} + +function get_new_price(){ + var hb_option = document.getElementById('hb');//获取选中的项 + var hb_index = myselect.selectedIndex; + var hb_value = myselect.options[hb_index].value; + + var yhq_option = document.getElementById('yhq'); + var yhq_index = myselect.selectedIndex; + var yhq_value = myselect.options[yhq_index].value; + $('#J_ActualFee').html($('.pay-sum').html()-parseFloat(hb_value)-parseFloat(yhq_value)); +} + +$(document).ready(function () { + get_price() +}); + + +$('#hb').change(function () { + get_new_price() +}); + +$('#yhq').change(function () { + get_new_price() +}); \ No newline at end of file diff --git a/Orange_lala/static/js/shopcart.js b/Orange_lala/static/js/shopcart.js new file mode 100644 index 0000000000000000000000000000000000000000..8c66f41e0b511705d5f4f5285616d5d11f875771 --- /dev/null +++ b/Orange_lala/static/js/shopcart.js @@ -0,0 +1,24 @@ +function get_num() { + var count = 0; + $('.good_num').each(function () { + count += parseInt($(this).html()) + }); + + $('#J_SelectedItemsCount').html(count); + +} + +function get_price() { + var price = 0; + $('.J_ItemSum').each(function () { + price += parseFloat($(this).html()) + }); + + $('#J_Total').html(price+'元') +} + + +$(document).ready(function () { + get_num(); + get_price() +}) \ No newline at end of file diff --git a/Orange_lala/templates/home/header.html b/Orange_lala/templates/home/header.html new file mode 100644 index 0000000000000000000000000000000000000000..050ab672006b1828aa75c3ed5185424b43285017 --- /dev/null +++ b/Orange_lala/templates/home/header.html @@ -0,0 +1,67 @@ +{% load static %} + + + + + 头部 + + + + + + + + +
+ +
+ + +
+ + + + + +
+
+ + \ No newline at end of file diff --git a/Orange_lala/templates/home/home1.html b/Orange_lala/templates/home/home1.html index c5f7fed0cb8ac96fcdcd78d4b4ff326948b7472c..4c572c6600eca2eda7f371ad6e195520e0f00f18 100644 --- a/Orange_lala/templates/home/home1.html +++ b/Orange_lala/templates/home/home1.html @@ -6,6 +6,8 @@ 首页 +{# 引入图标#} + @@ -105,7 +107,7 @@ @@ -452,7 +478,7 @@
  • - + 猜你喜欢
  • @@ -467,16 +493,18 @@

    产品参数:

      -
    • 产品类型: 烘炒类
    • -
    • 原料产地: 巴基斯坦
    • -
    • 产地: 湖北省武汉市
    • -
    • 配料表: 进口松子、食用盐
    • -
    • 产品规格: 210g
    • -
    • 保质期: 180天
    • -
    • 产品标准号: GB/T 22165
    • -
    • 生产许可证编号: QS4201 1801 0226
    • -
    • 储存方法: 请放置于常温、阴凉、通风、干燥处保存
    • -
    • 食用方法: 开袋去壳即食
    • + {% for good in goods %} +
    • 产品类型: {{ good.good_class.good_class_name }}
    • +
    • 原料产地: {{ good.import_domestic }}
    • +
    • 产地: {{ good.address }}
    • +
    • 配料表: {{ good.materials }}
    • +
    • 产品规格: {{ good.specification }}
    • +
    • 保质期: {{ good.expiration_date }}
    • +
    • 产品标准号: {{ good.product_standard }}
    • +
    • 生产许可证编号: {{ good.production_certificate }}
    • +
    • 储存方法: {{ good.storage_method }}
    • +
    • 是否含糖: {{ good.is_sugar }}
    • + {% endfor %}
    @@ -486,13 +514,9 @@

    商品细节

    - - - - - - - + {% for image in images2 %} + + {% endfor %}
    @@ -525,6 +549,7 @@
    • + 全部评价 (32)
      @@ -558,346 +583,7 @@
    • - - - - -
      - -
      - -
      - - b***1 (匿名) - - 评论于 - -
      -
      - -
      -
      -
      - 摸起来丝滑柔软,不厚,没色差,颜色好看!买这个衣服还接到诈骗电话,我很好奇他们是怎么知道我买了这件衣服,并且还知道我的电话的! -
      -
      - 颜色分类:柠檬黄  尺码:S -
      -
      - -
      - -
      -
    • -
    • - - - - - - -
      - -
      - -
      - - l***4 (匿名) - - 评论于 - -
      -
      - -
      -
      -
      - 没有色差,很暖和……美美的 -
      -
      - 颜色分类:蓝调灰  尺码:2XL -
      -
      - -
      - -
      -
    • -
    • - - - - - - -
      - -
      - -
      - - b***1 (匿名) - - 评论于 - -
      -
      - -
      -
      -
      - 摸起来丝滑柔软,不厚,没色差,颜色好看!买这个衣服还接到诈骗电话,我很好奇他们是怎么知道我买了这件衣服,并且还知道我的电话的! -
      -
      - 颜色分类:柠檬黄  尺码:S -
      -
      - -
      - -
      -
    • -
    • - - - - - - -
      - -
      - -
      - - h***n (匿名) - - 评论于 - -
      -
      - -
      -
      -
      - 式样不错,初冬穿 -
      -
      - 颜色分类:柠檬黄  尺码:L -
      -
      -
      - -
      -
    • - -
    • - - - - - - -
      - -
      - -
      - - b***1 (匿名) - - 评论于 - -
      -
      - -
      -
      -
      - 摸起来丝滑柔软,不厚,没色差,颜色好看!买这个衣服还接到诈骗电话,我很好奇他们是怎么知道我买了这件衣服,并且还知道我的电话的! -
      -
      - 颜色分类:柠檬黄  尺码:S -
      -
      - -
      - -
      -
    • -
    • - - - - - - -
      - -
      - -
      - - l***4 (匿名) - - 评论于 - -
      -
      - -
      -
      -
      - 没有色差,很暖和……美美的 -
      -
      - 颜色分类:蓝调灰  尺码:2XL -
      -
      - -
      - -
      -
    • -
    • - - - - - - -
      - -
      - -
      - - b***1 (匿名) - - 评论于 - -
      -
      - -
      -
      -
      - 摸起来丝滑柔软,不厚,没色差,颜色好看!买这个衣服还接到诈骗电话,我很好奇他们是怎么知道我买了这件衣服,并且还知道我的电话的! -
      -
      - 颜色分类:柠檬黄  尺码:S -
      -
      - -
      - -
      -
    • -
    • - - - - - - -
      - -
      - -
      - - h***n (匿名) - - 评论于 - -
      -
      - -
      -
      -
      - 式样不错,初冬穿 -
      -
      - 颜色分类:柠檬黄  尺码:L -
      -
      -
      - -
      -
    • -
    • - - - - - - -
      - -
      - -
      - - b***1 (匿名) - - 评论于 - -
      -
      - -
      -
      -
      - 摸起来丝滑柔软,不厚,没色差,颜色好看!买这个衣服还接到诈骗电话,我很好奇他们是怎么知道我买了这件衣服,并且还知道我的电话的! -
      -
      - 颜色分类:柠檬黄  尺码:S -
      -
      - -
      - -
      -
    • -
    • - - - - - - -
      - -
      - -
      - - l***4 (匿名) - - 评论于 - -
      -
      - -
      -
      -
      - 没有色差,很暖和……美美的 -
      -
      - 颜色分类:蓝调灰  尺码:2XL -
      -
      - -
      - -
      -
    • -
    • - - - + @@ -928,39 +614,6 @@
    • -
    • - - - - - - -
      - -
      - -
      - - h***n (匿名) - - 评论于 - -
      -
      - -
      -
      -
      - 式样不错,初冬穿 -
      -
      - 颜色分类:柠檬黄  尺码:L -
      -
      -
      - -
      -
    @@ -968,13 +621,25 @@
      -
    • «
    • -
    • 1
    • -
    • 2
    • -
    • 3
    • -
    • 4
    • -
    • 5
    • -
    • »
    • + {% if page.has_previous %} +
    • «
    • + {% endif %} + {% for num in page.paginator.page_range%} # 循环遍历页码列表,并展示到底部           + {%if pindex == page.number%}               +
    • {{ num }}
    •               + {%else%}                     +
    • {{ num }}
    •               + {%endif%}             + {% endfor %} + +{#
    • 1
    • #} +{#
    • 2
    • #} +{#
    • 3
    • #} +{#
    • 4
    • #} +{#
    • 5
    • #} + {% if page.has_next %} +
    • »
    • + {% endif %}
    @@ -987,151 +652,58 @@
      -
    • «
    • -
    • 1
    • -
    • 2
    • -
    • 3
    • -
    • 4
    • -
    • 5
    • -
    • »
    • + {% if page.has_previous %} +
    • «
    • + {% endif %} + {% for num in page.paginator.page_range%}         + {%if pindex == page.number%}               +
    • {{ num }}
    •               + {%else%}                     +
    • {{ num }}
    •               + {%endif%}             + {% endfor %} + {% if page.has_next %} +
    • »
    • + {% endif %} +{#
    • «
    • #} +{#
    • 1
    • #} +{#
    • 2
    • #} +{#
    • 3
    • #} +{#
    • 4
    • #} +{#
    • 5
    • #} +{#
    • »
    • #}
    @@ -1181,26 +753,32 @@

    - + +

    购物车

    -

    0

    +

    {{ shop_number }}

    @@ -55,9 +57,13 @@ @@ -82,11 +88,11 @@ - - + +
    -
    +
    相关搜索: 坚果 @@ -110,9 +116,9 @@
  • -
    品牌
    - -
    +
    品牌
    + + - +
  • @@ -148,7 +154,7 @@
  • - +
    @@ -159,6 +165,8 @@
  • 价格优先
  • 评价为主
  • + + {% block main_content %}
      @@ -177,7 +185,7 @@
    • - +

      手剥松子218g 坚果炒货零食新货巴西松子包邮

      @@ -191,7 +199,7 @@

    • - +

      【良品铺子旗舰店】手剥松子218g 坚果炒货零食新货巴西松子包邮

      @@ -205,7 +213,7 @@

    • - +

      手剥松子218g 坚果炒货零食新货巴西松子包邮

      @@ -219,7 +227,7 @@

    • - +

      【良品铺子旗舰店】手剥松子218g 坚果炒货零食新货巴西松子包邮

      @@ -233,7 +241,7 @@

    • - +

      【良品铺子旗舰店】手剥松子218g 坚果炒货零食新货巴西松子包邮

      @@ -247,7 +255,7 @@

    • - +

      【良品铺子旗舰店】手剥松子218g 坚果炒货零食新货巴西松子包邮

      @@ -261,7 +269,7 @@

    • - +

      【良品铺子旗舰店】手剥松子218g 坚果炒货零食新货巴西松子包邮

      @@ -275,7 +283,7 @@

    • - +

      【良品铺子旗舰店】手剥松子218g 坚果炒货零食新货巴西松子包邮

      @@ -289,7 +297,7 @@

    • - +

      【良品铺子旗舰店】手剥松子218g 坚果炒货零食新货巴西松子包邮

      @@ -303,7 +311,7 @@

    • - +

      【良品铺子旗舰店】手剥松子218g 坚果炒货零食新货巴西松子包邮

      @@ -317,7 +325,7 @@

    • - +

      【良品铺子旗舰店】手剥松子218g 坚果炒货零食新货巴西松子包邮

      @@ -364,6 +372,7 @@

    • +

      萨拉米 1+1小鸡腿

      @@ -378,6 +387,7 @@
    +
      @@ -417,7 +427,7 @@
    - +{% endblock main_content %}
    @@ -93,85 +93,25 @@
    -
    -
    -
    已享优惠:省¥19.50  
    - - -
    -
    +{#
    #} +{#
    #} +{#
    已享优惠:省¥19.50  
    #} +{# #} +{# #} +{#
    #} +{#
    #}
    - - - - - -
      + + {% for l in shop %} + {% for i in goods %} + {% for m in img %} + {% if m.goods_id == i.id %} + + {% if i.id == l.good_id %} +
      • @@ -180,20 +120,24 @@
      • - - +
        + + + + +
      • - 颜色:12#川南玛瑙 - 包装:裸装 - + 口味:{{ i.taste }} + 包装:{{ i.pack }} +{# #}
      • @@ -201,10 +145,10 @@
        - 78.00 + {{ i.prices }}
        - 39.00 + {{ i.prices }}
        @@ -213,29 +157,45 @@
        - - - +{# #} + {{ l.good_num }} +{# #}
        +
      • - 117.00 + {{ l.good_price }}
      - - + {% endif %} + {% endif %} + {% endfor %} + {% endfor %} + + {% endfor %} +
    @@ -243,85 +203,6 @@
    - -
    -
    -
    -
    已享优惠:省¥19.50  
    - - -
    -
    -
    -
    - -
    -
    -
    @@ -351,7 +232,7 @@ ¥0.00
    diff --git a/Orange_lala/templates/person/address.html b/Orange_lala/templates/person/address.html index 8b55fed5d8ffb8c3bae4954e55b72c4d85fb2099..2d055a3cb1eacc1b0c1c92dcc0a2f4d437cb74f7 100644 --- a/Orange_lala/templates/person/address.html +++ b/Orange_lala/templates/person/address.html @@ -14,6 +14,50 @@ + + + @@ -33,129 +77,96 @@
      -
    • - 默认地址 -

      - 小叮当 - 159****1622 -

      -
      -

      - 地址: - 湖北省 - 武汉市 - 洪山区 - 雄楚大道666号(中南财经政法大学)

      -
      -
      - 编辑 - | - 删除 -
      -
    • + {% if uk is not Null %} +

      {{ uk }}!!

      + {% else %} + {% for useraddress in useraddress %} +
    • + 默认地址 +

      + {{ useraddress.recipients }} + {{ useraddress.tel }} +

      +
      +

      + 地址: + {{ useraddress.province }}省/市 + {{ useraddress.city }}市 + {{ useraddress.county }}区 + {{ useraddress.detail_addr }}

      +
      +
      + 编辑 + | +{# 删除#} + 删除 + +
      +
    • + {{ haik }} + {% endfor %} + {% endif %} -
    • - 设为默认 -

      - 小叮当 - 159****1622 -

      -
      -

      - 地址: - 湖北省 - 武汉市 - 洪山区 - 雄楚大道666号(中南财经政法大学)

      -
      -
      - 编辑 - | - 删除 -
      -
    • -
    • - 设为默认 -

      - 小叮当 - 159****1622 -

      -
      -

      - 地址: - 湖北省 - 武汉市 - 洪山区 - 雄楚大道666号(中南财经政法大学)

      -
      -
      - 编辑 - | - 删除 -
      -
    添加新地址
    - -
    - - -
    -
    新增地址 / Add address
    -
    -
    - -
    -
    - -
    - -
    - -
    -
    - -
    - -
    - -
    -
    -
    - -
    - - - +
    + +
    +
    新增地址 / Add address
    +
    +
    +
    + + {% csrf_token %} +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + + +
    - + 100字以内写出你的详细地址...
    - 保存 - 取消 +{# #} + +{# #} +{# #} + +{# #}
    + {{ error }}
    diff --git a/Orange_lala/templates/person/address2.html b/Orange_lala/templates/person/address2.html new file mode 100644 index 0000000000000000000000000000000000000000..de1513e6632885386b7caf4df2ba99101d203fb3 --- /dev/null +++ b/Orange_lala/templates/person/address2.html @@ -0,0 +1,268 @@ + + + {% load static %} + + + + + 地址管理 + + + + + + + + + + + + + + + + + {% include 'person/top.html' %} + +
    +
    +
    + +
    + +
    +
    地址管理 / Address list
    +
    +
    +
      + + {% if uk is not Null %} +

      {{ uk }}!!

      + {% else %} + {% for useraddress in useraddress %} +
    • + 默认地址 +

      + {{ useraddress.recipients }} + {{ useraddress.tel }} +

      +
      +

      + 地址: + {{ useraddress.province }}省/市 + {{ useraddress.city }}市 + {{ useraddress.county }}区 + {{ useraddress.detail_addr }}

      +
      +
      + 编辑 + | +{# 删除#} + 删除 + +
      +
    • + {{ haik }} + {% endfor %} + {% endif %} + +
    +
    + 添加新地址 + +
    +
    + +
    +
    编辑地址 / Edit address
    +
    +
    +
    + {% for useraddress in useraddress %} +
    + {% csrf_token %} +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + + + +
    +
    + +
    + +
    + + 100字以内写出你的详细地址... +
    +
    + {% endfor %} +
    +
    +{# #} + +{# #} +{# #} + +{# #} +
    +
    + {{ error }} +
    +
    + +
    + +
    + +
    + + + +
    + +
    + + +
    + + +
    + + + + \ No newline at end of file diff --git a/Orange_lala/templates/person/bindphone.html b/Orange_lala/templates/person/bindphone.html index 4110afedcf45d1f242b2dab8043db4121d85530e..a24f7b3acaf98ac7f8605d570dbc46421c4ad89f 100644 --- a/Orange_lala/templates/person/bindphone.html +++ b/Orange_lala/templates/person/bindphone.html @@ -15,77 +15,213 @@ + + + + + + -{# #} -{#
    #} -{#
    #} -{# #} -{#
    #} -{# #} -{# #} -{# #} -{# #} {% include 'person/top.html' %}
    @@ -114,41 +250,50 @@
    -
    +
    - 186XXXX0531 -
    -
    -
    - -
    - -
    - -
    验证码
    -
    -
    -
    - -
    - + {% if user.is_authenticated %} + {% if phone is None %} + 请您完善资料! + {% else %} + {{ phone }} + {% endif %} + {% else %} + 请您登录!!! + {% endif %}
    - -
    - -
    - + +
    + +
    +
    验证码
    -
    + +
    +{# ///////////////////////////////////////////////////////////////////////////////////////////#} +
    + +
    + +
    +
    +
    + +
    + +
    + +
    验证码
    +
    -
    保存修改
    +
    - + {{ erop }}
    diff --git a/Orange_lala/templates/person/change.html b/Orange_lala/templates/person/change.html index 315ec52c7ac714e593df4ba803d0902145f9b9ba..2c97abaef3ec7cfb1ffa9523bcc6fa1b333c0e29 100644 --- a/Orange_lala/templates/person/change.html +++ b/Orange_lala/templates/person/change.html @@ -129,26 +129,33 @@
    -
    -
    退款编号:1601430
    + {% for a in back_order %} +
    +
    退款编号:{{ a.id }}
    申请时间:2015-12-20
    -
    + {% for b in ordergoods %} + {% if b.order_id == a.id %} + {% for c in goods %} + {% if b.good_id == c.id %} + {% for d in img %} + {% if d.goods_id == c.id %} +
    + {% endif %} + {% endfor %} + {% endif %} + {% endfor %} + + {% endif %} + {% endfor %} + + {% endfor %} + + +
    @@ -212,26 +231,33 @@
    + {% for a in recive_order %}
    -
    退款编号:1601430
    +
    订单编号:{{ a.id }}
    申请时间:2015-12-20
    + {% for b in ordergoods %} + {% if b.order_id == a.id %} + {% for c in goods %} + {% if b.good_id == c.id %} + {% for d in img %} + {% if d.goods_id == c.id %}
    @@ -255,20 +277,29 @@
  • -

    退款成功

    +

    已签收

  • - +
    - 钱款去向
    + 订单详情
  • + {% endif %} + {% endfor %} + {% endif %} + {% endfor %} + + {% endif %} + {% endfor %} + + {% endfor %}
    diff --git a/Orange_lala/templates/person/collection.html b/Orange_lala/templates/person/collection.html index 1c553469497a295e752835b7a790178b0fed52ad..2b0dbd4812e78af521ab59f9c14fc5d9ed77d922 100644 --- a/Orange_lala/templates/person/collection.html +++ b/Orange_lala/templates/person/collection.html @@ -102,146 +102,31 @@ 下架
    -
    -
    - -
    - - 包邮s925纯银项链女吊坠短款锁骨链颈链日韩猫咪银饰简约夏配饰 - -
    -
    - -
    - ¥42.50 - ¥68.00 -
    -
    - 好评: 98.03% - 月销: 219 -
    -
    -
    - 找相似 - - 加入购物车 -

    - 取消收藏 -

    -
    -
    -
    - -
    -
    - -
    - - s925纯银千纸鹤锁骨链短款简约时尚韩版素银项链小清新秋款女配饰 - -
    -
    - -
    - ¥49.90 - ¥88.00 -
    -
    - 好评: 99.74% - 月销: 69 -
    -
    -
    - 找相似 - - 加入购物车 -

    - 取消收藏 -

    -
    -
    -
    - -
    -
    - - -
    - -
    - ¥378.00 - ¥1888.00 -
    -
    - 好评: 99.93% - 月销: 278 -
    -
    -
    - 找相似 - - 进入店铺 -

    - 取消收藏 -

    -
    -
    -
    + {% for x in collect %} + {% for y in good %} + {% if y.id == x.good_id %} + {% for z in img %} + {% if z.goods_id == y.id %} -
    +
    - +
    - ¥42.50 - ¥68.00 + ¥{{ y.prices }} + ¥{{ y.prices }}
    好评: 98.03% 月销: 219
    -
    - 找相似 - - 加入购物车 -

    - 取消收藏 -

    -
    -
    -
    - -
    -
    - -
    - - s925纯银千纸鹤锁骨链短款简约时尚韩版素银项链小清新秋款女配饰 - -
    -
    - -
    - ¥49.90 - ¥88.00 -
    -
    - 好评: 99.74% - 月销: 69 -
    -
    找相似 @@ -252,36 +137,164 @@
    + {% endif %} + {% endfor %} + {% endif %} + {% endfor %} + {% endfor %} -
    -
    -
    - - 4折抢购!十二生肖925银女戒指,时尚开口女戒 - -
    -
    - -
    - ¥378.00 - ¥1888.00 -
    -
    - 好评: 99.93% - 月销: 278 -
    -
    -
    - 找相似 - - 加入购物车 -

    - 取消收藏 -

    -
    -
    -
    + +{#
    #} +{#
    #} +{##} +{#
    #} +{# #} +{# s925纯银千纸鹤锁骨链短款简约时尚韩版素银项链小清新秋款女配饰#} +{# #} +{#
    #} +{#
    #} +{# #} +{#
    #} +{# ¥49.90#} +{# ¥88.00#} +{#
    #} +{#
    #} +{# 好评: 99.74%#} +{# 月销: 69#} +{#
    #} +{#
    #} +{#
    #} +{# 找相似#} +{# #} +{# 加入购物车#} +{#

    #} +{# 取消收藏#} +{#

    #} +{#
    #} +{#
    #} +{#
    #} +{##} +{#
    #} +{#
    #} +{##} +{# #} +{#
    #} +{# #} +{#
    #} +{# ¥378.00#} +{# ¥1888.00#} +{#
    #} +{#
    #} +{# 好评: 99.93%#} +{# 月销: 278#} +{#
    #} +{#
    #} +{#
    #} +{# 找相似#} +{# #} +{# 进入店铺#} +{#

    #} +{# 取消收藏#} +{#

    #} +{#
    #} +{#
    #} +{#
    #} +{##} +{#
    #} +{#
    #} +{##} +{#
    #} +{# #} +{# 包邮s925纯银项链女吊坠短款锁骨链颈链日韩猫咪银饰简约夏配饰#} +{# #} +{#
    #} +{#
    #} +{# #} +{#
    #} +{# ¥42.50#} +{# ¥68.00#} +{#
    #} +{#
    #} +{# 好评: 98.03%#} +{# 月销: 219#} +{#
    #} +{#
    #} +{#
    #} +{# 找相似#} +{# #} +{# 加入购物车#} +{#

    #} +{# 取消收藏#} +{#

    #} +{#
    #} +{#
    #} +{#
    #} +{##} +{#
    #} +{#
    #} +{##} +{#
    #} +{# #} +{# s925纯银千纸鹤锁骨链短款简约时尚韩版素银项链小清新秋款女配饰#} +{# #} +{#
    #} +{#
    #} +{# #} +{#
    #} +{# ¥49.90#} +{# ¥88.00#} +{#
    #} +{#
    #} +{# 好评: 99.74%#} +{# 月销: 69#} +{#
    #} +{#
    #} +{#
    #} +{# 找相似#} +{# #} +{# 加入购物车#} +{#

    #} +{# 取消收藏#} +{#

    #} +{#
    #} +{#
    #} +{#
    #} +{##} +{#
    #} +{#
    #} +{##} +{#
    #} +{# #} +{# 4折抢购!十二生肖925银女戒指,时尚开口女戒#} +{# #} +{#
    #} +{#
    #} +{# #} +{#
    #} +{# ¥378.00#} +{# ¥1888.00#} +{#
    #} +{#
    #} +{# 好评: 99.93%#} +{# 月销: 278#} +{#
    #} +{#
    #} +{#
    #} +{# 找相似#} +{# #} +{# 加入购物车#} +{#

    #} +{# 取消收藏#} +{#

    #} +{#
    #} +{#
    #} +{#
    #}
    diff --git a/Orange_lala/templates/person/comment.html b/Orange_lala/templates/person/comment.html index 255aabba0d055d45a9badfb07f76f9165c41a7d4..1ffbf1a4760f899f0672dbd85595464c7b5d95cc 100644 --- a/Orange_lala/templates/person/comment.html +++ b/Orange_lala/templates/person/comment.html @@ -111,21 +111,26 @@
    -
      + {% for x in comment %} + {% for y in goods %} + {% if y.id == x.good_id and x.comment_img == None %} + {% for pic in img %} + {% if y.id == pic.goods_id %} +
        + -
        评价
        商品 -
        +
  • @@ -135,17 +140,17 @@
    好评
    - 宝贝非常漂亮,超级喜欢!!! 口红颜色很正呐,还有第两支半价,买三支免单一支的活动,下次还要来买。就是物流太慢了,还要我自己去取快递,店家不考虑换个物流么? + {{ x.comment }}
    -

    颜色:12#玛瑙 包装:裸装

    +

    口味:{{ y.taste }} 包装:{{ y.pack }}

    2015-12-24

    @@ -153,6 +158,16 @@ + {% endif %} + {% endfor %} + + + {% endif %} + {% endfor %} + + {% endfor %} + +
    @@ -162,42 +177,47 @@
    -
      - - + {% for a in comment %} + {% for b in goods %} + {% if b.id == a.good_id and a.comment_img != None %} + {% for pic in img %} + {% if b.id == pic.goods_id %} +
        + +
        评价
        商品 -
        +
  • -
  • - + +
  • - 宝贝非常漂亮,超级喜欢!!! 口红颜色很正呐,还有第两支半价,买三支免单一支的活动,下次还要来买。就是物流太慢了,还要我自己去取快递,店家不考虑换个物流么? + {{ a.comment }}
    -

    颜色:12#玛瑙 包装:裸装

    +

    口味:{{ b.taste }} 包装:{{ b.pack }}

    2015-12-24

    @@ -205,6 +225,16 @@
  • + {% endif %} + {% endfor %} + + + {% endif %} + {% endfor %} + + {% endfor %} + +
    diff --git a/Orange_lala/templates/person/email.html b/Orange_lala/templates/person/email.html index 4a66c2db542d708525813a8727d5d41327133826..be759d13ddcf04ece9623ca9df29449ddf4816de 100644 --- a/Orange_lala/templates/person/email.html +++ b/Orange_lala/templates/person/email.html @@ -15,77 +15,113 @@ + + -{# #} -{#
    #} -{#
    #} -{# #} -{#
    #} -{# #} -{# #} -{# #} -{# #} + {% include 'person/top.html' %}
    @@ -114,26 +150,28 @@
    -
    + + {% csrf_token %}
    - +
    - +
    - +{# #} +
    验证码
    -
    保存修改
    +
    - + {{ error }}
    diff --git a/Orange_lala/templates/person/foot.html b/Orange_lala/templates/person/foot.html index bd8d848fcab9bc45e3706238fd71f0c6f29d20d1..f69b4ed3cfca138b62d08f801c9561127f4101b9 100644 --- a/Orange_lala/templates/person/foot.html +++ b/Orange_lala/templates/person/foot.html @@ -97,97 +97,21 @@
    - -
    -
    - 12.21今天 - - -
    + {% for x in goods %} + {% for pic in img %} + {% if x.id == pic.goods_id %} +
    +{#
    #} +{# 12.21今天#} +{# #} +{# #} +{#
    #}
    - -
    - -
    宝贝已下架
    -
    - - -
    -
    - -
    -
    - -
    - -
    -
    -
    - - -
    - -
    宝贝已下架
    -
    - - -
    -
    - -
    -
    - -
    - -
    -
    -
    - - +
    宝贝已下架
    @@ -195,14 +119,14 @@
    - - ¥71 + + ¥{{ x.prices }} - - ¥142 + + ¥{{ x.prices }}
    @@ -216,126 +140,13 @@
    + {% endif %} + {% endfor %} -
    -
    - -
    -
    -
    -
    - - -
    - -
    宝贝已下架
    -
    + {% endfor %} - -
    -
    - - -
    -
    - -
    - -
    -
    -
    - - -
    - -
    宝贝已下架
    -
    - - -
    -
    -
    -
    - 一周内 - - -
    -
    -
    -
    - - -
    - -
    宝贝已下架
    -
    - - -
    -
    -
    diff --git a/Orange_lala/templates/person/index.html b/Orange_lala/templates/person/index.html index 275ba22ee8be13dc6513caa9817516e44dadafc8..77c93ad9b2907a5a4201855a0d34ad209336d1c4 100644 --- a/Orange_lala/templates/person/index.html +++ b/Orange_lala/templates/person/index.html @@ -15,74 +15,7 @@ -{# #} -{#
    #} -{#
    #} -{# #} -{#
    #} -{# #} -{# #} -{# #} {% include 'person/top.html' %} -
    @@ -96,16 +29,21 @@ - (小叮当) + {% if user.is_authenticated %} + ({{ user.username }}) + {% else %} + 请登录!! + {% endif %}
    - 会员福利
    + 会员福利 +
    @@ -116,21 +54,21 @@ 个人资产

    - + 红包 2

    - + 优惠券 2

    - + 钱包 2 @@ -159,11 +97,11 @@ 全部订单

    @@ -172,12 +110,11 @@ 我的常用 @@ -535,10 +472,10 @@ diff --git a/Orange_lala/templates/person/information.html b/Orange_lala/templates/person/information.html index 436fccec39fdbd07ef33bab8fe679908696be64c..052dae98d926a553b405f8f139f29149230f8a16 100644 --- a/Orange_lala/templates/person/information.html +++ b/Orange_lala/templates/person/information.html @@ -18,74 +18,8 @@ -{# #} -{#
    #} -{#
    #} -{# #} -{# #} -{#
    #} -{#
    #} -{# #} -{# #} -{% include 'person/top.html' %} + + {% include 'person/top.html' %}
    @@ -96,7 +30,7 @@
    个人资料 / Personal information

    - + {% if user.is_authenticated %}
    @@ -107,38 +41,61 @@

    头像

    -
    -
    用户名:小叮当
    -
    - - 铜牌会员 - -
    - -
    +
    +
    用户名:{{ user.username }}
    +
    + + {{ member }} + +
    + +
    + {% else %} +
    +
    用户名:请登录!!
    +
    + + 用户等级 + +
    + +
    + {% endif %}
    -
    - -
    - -
    - - -
    -
    - + + {% csrf_token %} + {% if user.is_authenticated %} +
    + +
    + +
    +
    + {% else %} +
    + +
    + +
    +
    + {% endif %}
    - +
    @@ -147,56 +104,77 @@
    +
    -
    - - -
    -
    - -
    -
    - -
    +
    -
    - -
    - - -
    -
    -
    - -
    - - -
    -
    + {% if user.is_authenticated %} + {% for foo in user1111 %} + {% if foo.phone is None %} +
    + +
    + +
    +
    + {% else %} +
    + +
    + +
    +
    + {% endif %} + {% endfor %} + {% else %} +
    + +
    + +
    +
    + {% endif %} + {% if user.is_authenticated %} + {% for foo in user1111 %} + {% if foo.email is None %} +
    + +
    + +
    +
    + {% else %} +
    + +
    + +
    +
    + {% endif %} + {% endfor %} + {% else %} +
    + +
    + +
    +
    + {% endif %}
    @@ -224,9 +202,9 @@
    -
    保存修改
    +
    - + {{ success }}
    diff --git a/Orange_lala/templates/person/logistics.html b/Orange_lala/templates/person/logistics.html index 082fcc63afde3e741c0bbea9b34b04e371bdf112..41f1df50db9282b89274d7113aba321f6c93f5fe 100644 --- a/Orange_lala/templates/person/logistics.html +++ b/Orange_lala/templates/person/logistics.html @@ -101,7 +101,7 @@

    物流状态:已签收

    承运公司:天天物流

    -

    快递单号:373269427868

    +

    快递单号:{{ order.id }}

    官方电话:4001-888-888

    diff --git a/Orange_lala/templates/person/news.html b/Orange_lala/templates/person/news.html index e6efd61aa126b105003dc6737cc10250effb8fbf..0b490b7ccead4cc35813eb3cf672c15b26fbc9b4 100644 --- a/Orange_lala/templates/person/news.html +++ b/Orange_lala/templates/person/news.html @@ -116,14 +116,15 @@ -
    -
    每日新鲜事
    + {% for i in news %} +
    @@ -142,19 +146,21 @@
    订单已签收
    - diff --git a/Orange_lala/templates/person/order.html b/Orange_lala/templates/person/order.html index ff4bba62b2e456a09a21743a54c5144960cfae70..a7537fb96a3e5339b718ee1cc8b370969129e52f 100644 --- a/Orange_lala/templates/person/order.html +++ b/Orange_lala/templates/person/order.html @@ -102,723 +102,17 @@
    -
    -
    -
    - 商品 -
    -
    - 单价 -
    -
    - 数量 -
    -
    - 商品操作 -
    -
    - 合计 -
    -
    - 交易状态 -
    -
    - 交易操作 -
    -
    - -
    -
    - - -
    -
    -
    订单编号:1601430
    - 成交时间:2015-12-20 - -
    -
    - -
    -
  • -
    - 合计:676.00 -

    含运费:10.00

    -
    -
  • -
    -
  • -
    -

    交易成功

    -

    订单详情

    -

    查看物流

    -
    -
  • -
  • -
    - 删除订单
    -
  • -
    -
    -
    -
    - - - - -
    -
    -
    订单编号:1601430
    - 成交时间:2015-12-20 - -
    -
    - -
    -
  • -
    - 合计:676.00 -

    含运费:10.00

    -
    -
  • -
    -
  • -
    -

    交易关闭

    -
    -
  • -
  • -
    - 删除订单
    -
  • -
    -
    -
    -
    - - -
    -
    -
    订单编号:1601430
    - 成交时间:2015-12-20 - -
    -
    - -
    -
  • -
    - 合计:676.00 -

    含运费:10.00

    -
    -
  • -
    -
  • -
    -

    买家已付款

    -

    订单详情

    -
    -
  • -
  • -
    - 提醒发货
    -
  • -
    -
    -
    -
    - - -
    -
    -
    订单编号:1601430
    - 成交时间:2015-12-20 - -
    -
    - -
    -
  • -
    - 合计:676.00 -

    含运费:10.00

    -
    -
  • -
    -
  • -
    -

    卖家已发货

    -

    订单详情

    -

    查看物流

    -

    延长收货

    -
    -
  • -
  • -
    - 确认收货
    -
  • -
    -
    -
    - -
    - -
    - -
    - -
    -
    - -
    -
    - 商品 -
    -
    - 单价 -
    -
    - 数量 -
    -
    - 商品操作 -
    -
    - 合计 -
    -
    - 交易状态 -
    -
    - 交易操作 -
    -
    - -
    -
    -
    -
    -
    订单编号:1601430
    - 成交时间:2015-12-20 - -
    -
    - -
    -
  • -
    - 合计:676.00 -

    含运费:10.00

    -
    -
  • -
    -
  • -
    -

    等待买家付款

    -

    取消订单

    - -
    -
  • -
  • - -
    - 一键支付
    -
  • -
    -
    -
    -
    -
    +
    -
    -
    -
    商品 @@ -845,142 +139,96 @@
    -
    -
    -
    订单编号:1601430
    +
    + {% for a in not_pay_order %} +
    +
    订单编号:{{ a.id }}
    成交时间:2015-12-20
    -
    -
    -
    +
    + + + {% endif %} + {% endfor %} +
    +
    + {% endfor %} +
    +
    +
    -
    +
    商品 @@ -1007,112 +255,92 @@
    -
    -
    -
    订单编号:1601430
    +
    + {% for a in not_send_order %} +
    +
    订单编号:{{ a.id }}
    成交时间:2015-12-20
    -
    +
    - + {% for l in orders %} + {% if l.order_id == a.id %} + + {% for x in goods %} + {% if l.good_id == x.id %} + {% for i in img %} + {% if i.goods_id == x.id %} -
    -
    -
  • -
    - 合计:676.00 -

    含运费:10.00

    -
    -
  • -
    -
  • -
    -

    卖家已发货

    -

    订单详情

    -

    查看物流

    -

    延长收货

    -
    -
  • -
  • -
    - 确认收货
    -
  • -
    -
    -
    + {% endif %} + {% endfor %} + {% endif %} + {% endfor %} + +
    +
  • +
    + 合计:{{ a.order_price }} +

    含运费:10.00

    +
    +
  • +
    +
  • +
    +

    买家已付款

    +

    订单详情

    +
    +
  • +
  • +
    + 提醒发货
    +
  • +
    +
    + + {% endif %} + {% endfor %} +
    +
    + {% endfor %}
    - -
    +
    商品 @@ -1139,178 +367,48 @@
    - -
    -
    -
    订单编号:1601430
    - 成交时间:2015-12-20 - -
    -
    - -
    -
  • -
    - 合计:676.00 -

    含运费:10.00

    -
    -
  • -
    -
  • -
    -

    交易成功

    -

    订单详情

    -

    查看物流

    -
    -
  • -
  • - -
    - 评价商品
    -
    -
  • -
    -
    -
    -
    - - -
    -
    -
    订单编号:1601430
    +
    + {% for a in send_order %} +
    +
    订单编号:{{ a.id }}
    成交时间:2015-12-20
    -
    +
    - - - -
    - - -
    -
    + {% endif %} + {% endfor %} + {% endif %} + {% endfor %} +
  • - 合计:676.00 + 合计:{{ a.order_price }}

    含运费:10.00

  • -
    + {% endif %} + {% endfor %} +
    +
    + {% endfor %}
    - -
    -
    -
    + +
    diff --git a/Orange_lala/templates/person/orderinfo.html b/Orange_lala/templates/person/orderinfo.html index 049e8651bc5aa12f0b699a2954b11716eb48cce2..79d99cb3e5ea6fc5410bb7bd3a1a9a7b5dc32823 100644 --- a/Orange_lala/templates/person/orderinfo.html +++ b/Orange_lala/templates/person/orderinfo.html @@ -155,16 +155,16 @@

    - 小叮当 - 159****1622 + {{ address.recipients }} + {{ address.tel }}

    收货地址: - 湖北省 - 武汉市 - 洪山区 - 雄楚大道666号(中南财经政法大学)

    + {{ address.province }}省 + {{ address.city }}市 + {{ address.county }}区 + {{ address.detail_addr }}

    @@ -196,74 +196,46 @@
    -
    -
    订单编号:1601430
    - 成交时间:2015-12-20 +
    订单编号:{{ order.id }}
    + 成交时间:
    - -
    + {% endif %} + {% endfor %} + + {% endif %} + {% endfor %} + + {% endif %} + {% endfor %}
  • - 合计:676.00 -

    含运费:10.00

    + 合计:676.00元 +{#

    含运费:10.00

    #}
  • 卖家已发货

    -

    查看物流

    +

    查看物流

    延长收货

  • - 确认收货
    + + 确认收货
  • diff --git a/Orange_lala/templates/person/password.html b/Orange_lala/templates/person/password.html index 47362f362b9ea9c06fff3ccd9958b84a2adc3cdc..c25651b24e00047f44c1be3675d309e84d88576d 100644 --- a/Orange_lala/templates/person/password.html +++ b/Orange_lala/templates/person/password.html @@ -114,29 +114,30 @@
    -
    + + {% csrf_token %}
    - +
    - +
    - +
    -
    保存修改
    +
    - + {{ bai }}
    diff --git a/Orange_lala/templates/person/question.html b/Orange_lala/templates/person/question.html index b310a015525f56c3e78eb3056bdf111a66993a02..9693d6783d9b51658b77859fbfc62084ddff6af1 100644 --- a/Orange_lala/templates/person/question.html +++ b/Orange_lala/templates/person/question.html @@ -15,77 +15,9 @@ - -{# #} -{#
    #} -{#
    #} -{# #} -{#
    #} -{# #} -{# #} -{# #} -{# #} {% include 'person/top.html' %}
    @@ -114,43 +46,51 @@
    -
    + + {% csrf_token %}
    - - - + {% for foo in question %} + + {% endfor %} + +{# #} +{# #}
    - +
    - + + {% for foo in questiontwo %} + + {% endfor %} +{# #} +{# #}
    - +
    -
    保存修改
    +
    - + {{ error }}
    diff --git a/Orange_lala/templates/person/safety.html b/Orange_lala/templates/person/safety.html index 634820f0c17abec4b65f50ad2b22336efd0c9e2e..5878583f0ca78361bcdcb87c142b40551a57d80b 100644 --- a/Orange_lala/templates/person/safety.html +++ b/Orange_lala/templates/person/safety.html @@ -102,21 +102,38 @@

    头像

    + {% if user.is_authenticated %} +
    +
    用户名:{{ user.username }}
    +
    + + {{ member }} + +
    + +
    + {% else %} +
    +
    用户名:请登录!!
    +
    + + 会员等级 + +
    + +
    + {% endif %} -
    -
    用户名:小叮当
    -
    - - 铜牌会员 - -
    - -
    @@ -149,8 +166,14 @@
    手机验证
    -
    您验证的手机:186XXXXXXXX 若已丢失或停用,请立即更换
    -
    + {% if user.is_authenticated %} + {% for foo in user_info %} + {% if foo.phone is None %} +
    您验证的手机:请您完善您的信息!!! 若已丢失或停用,请立即更换
    + {% else %} +
    您验证的手机:{{ foo.phone }} 若已丢失或停用,请立即更换
    + {% endif %} +
    换绑
    @@ -161,8 +184,15 @@
    邮箱验证
    -
    您验证的邮箱:5831XXX@qq.com 可用于快速找回登录密码
    + {% if foo.email is None %} +
    您验证的邮箱:请您完善您的信息!!! 可用于快速找回登录密码
    + {% else %} +
    您验证的邮箱:{{ foo.email }} 可用于快速找回登录密码
    + {% endif %} +
    + {% endfor %} + {% endif %}
    换绑
    diff --git a/Orange_lala/templates/person/setpay.html b/Orange_lala/templates/person/setpay.html index 329c072b84f05a9a354ec8d11a85e1d8c2ece003..b84b0dfe17406cbbbc72c74e7949cc9d253cd368 100644 --- a/Orange_lala/templates/person/setpay.html +++ b/Orange_lala/templates/person/setpay.html @@ -14,78 +14,115 @@ - + + + -{# #} -{#
    #} -{#
    #} -{# #} -{# #} -{# #} -{# #} {% include 'person/top.html' %}
    @@ -114,38 +151,49 @@
    -
    + + {% csrf_token %}
    - 186XXXX0531 + {% if user.is_authenticated %} + {% if phone is None %} + 请您在个人信息中完善资料!! + {% else %} + {{ phone }} + {% endif %} + {% else %} + 请您登录 + {% endif %}
    - +
    - +{# #} +
    验证码
    +{#
    #}
    - +
    - +
    -
    保存修改
    +
    - + {{ suc }}
    diff --git a/Orange_lala/templates/person/top.html b/Orange_lala/templates/person/top.html index 9cabf22c52eb5fb18c03fcb95d8ce825376a266f..5ace0092ef6731d754fa02e888db928f67b3f352 100644 --- a/Orange_lala/templates/person/top.html +++ b/Orange_lala/templates/person/top.html @@ -11,15 +11,21 @@
    -
    +