diff --git a/electronice/.idea/electronice.iml b/electronice/.idea/electronice.iml deleted file mode 100644 index 5f8dd46ab16c3d7dbf0e305fd010846bbc8aad98..0000000000000000000000000000000000000000 --- a/electronice/.idea/electronice.iml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/electronice/.idea/misc.xml b/electronice/.idea/misc.xml deleted file mode 100644 index 19fb4905b178e94da2732232df271241eb627e4e..0000000000000000000000000000000000000000 --- a/electronice/.idea/misc.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/electronice/.idea/workspace.xml b/electronice/.idea/workspace.xml deleted file mode 100644 index bc0a50920b25f3e05fe57091cb02aff463dd29a2..0000000000000000000000000000000000000000 --- a/electronice/.idea/workspace.xml +++ /dev/null @@ -1,468 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +{#
#} +{# #} +{# -#} +{# #} +{# #} +{#
#} @@ -167,9 +167,9 @@ 爆款推荐
- {% for fiddsh in fiddsh %} - {{ fiddsh.name }}¥{{ fiddsh.price }} + {% for fidd in fiddsh %} + {{ fidd.name }}¥{{ fidd.price }} {% endfor %}
diff --git a/electronice/goods/templates/goods/item_sale_page.html b/electronice/goods/templates/goods/item_sale_page.html index ce54b82f5d4ce716068a0688fc56886e76184018..9720f5a824fd0e6142c8388689b2bb3296e49916 100644 --- a/electronice/goods/templates/goods/item_sale_page.html +++ b/electronice/goods/templates/goods/item_sale_page.html @@ -3,16 +3,12 @@ {% block aa %}
- - {% endfor %}
- -
- - - - {% for foo in page_num %} - {{ foo }} - {% endfor %} - - - -
-{#
#} -{# 上一页#} -{# 1#} -{# 2#} -{# 3#} -{# 4#} -{# 5#} -{# 6#} -{# 7#} -{# 8#} -{# 下一页#} -{# 1/60页#} +
+ {% if page_obj.has_previous %} + + + {% endif %} + {% for foo in page_num %} + {% if foo == page_obj.number %} + {{ foo }} + {% else %} + {{ foo }} + {% endif %} + {% endfor %} + {% if page_obj.has_next %} + + + {% endif %} +
-
爆款推荐
- ¥134.99 - ¥134.99 - ¥134.99 - ¥134.99 - ¥134.99 - ¥134.99 - ¥134.99 - ¥134.99 - ¥134.99 - ¥134.99 + {% for good in goodss %} + ¥{{ good.price }} + {% endfor %}
diff --git a/electronice/goods/templates/goods/item_show.html b/electronice/goods/templates/goods/item_show.html index a3951e79650a8bb3632e49a0a0541385dc147934..494ef07e1f9141e4026d817ee9e25d3556d59efe 100644 --- a/electronice/goods/templates/goods/item_show.html +++ b/electronice/goods/templates/goods/item_show.html @@ -126,6 +126,9 @@
  • XL
  • +
  • + XXL +
  • @@ -181,8 +184,6 @@ $('.size li a').removeClass('on'); $(this).addClass('on'); }); - - @@ -227,7 +228,6 @@ }) - diff --git a/electronice/goods/templates/goods/static_index.html b/electronice/goods/templates/goods/static_index.html new file mode 100644 index 0000000000000000000000000000000000000000..f4913c77c04c95803664d4536b0c2e7db0ae8b7e --- /dev/null +++ b/electronice/goods/templates/goods/static_index.html @@ -0,0 +1,615 @@ +{% load static %} +{% load cache %} + + + + + + 时尚服装箱包商城网店 + + + + + + + + + + + + + + +
    +
    +
    +
    欢迎{{ request.session.phone }}来到风神科技
    + 网店代销 + 帮助中心 +
    + +
    +
    + + + +
    + +
    + + + + + + +
    +
    +
    +
    + 爆款推荐 + +
    + +
    + +
    +
    +
    + 女装 + +
    +
    + + + +
    + {% for girl in girls %} + +
    + {{ girl.name }} +
    +
    + ¥{{ girl.price }} + 进货价 +
    +
    {{ girl.name }}
    +
    + {% endfor %} +
    +
    +
    +
    +
    + 男装 + +
    +
    + + + +
    + {% for boy in boys %} + +
    + {{ boy.name }} +
    +
    + ¥{{ boy.price }} + 进货价 +
    +
    {{ boy.name }}
    +
    + {% endfor %} +
    +
    +
    +
    +
    + 活力童装 + +
    +
    + + + +
    + {% for kid in kids %} + +
    + {{ kid.name }} +
    +
    + ¥{{ kid.price }} + 进货价 +
    +
    {{ kid.name }}
    +
    + {% endfor %} +
    +
    +
    +
    +
    + 时尚包包 + +
    +
    + + + +
    + {% for bag in bags %} + +
    + {{ bag.name }} +
    +
    + ¥{{ bag.price }} + 进货价 +
    +
    {{ bag.name }}
    +
    + {% endfor %} +
    +
    +
    +
    +
    + 鞋靴 + +
    +
    + + + +
    + {% for shoe in shoes %} + +
    + {{ shoe.name }} +
    +
    + ¥{{ shoe.price }} + 进货价 +
    +
    {{ shoe.name }}
    +
    + {% endfor %} +
    +
    +
    +
    + + + + + + diff --git a/electronice/goods/views.py b/electronice/goods/views.py index 1d3800a0a15fac6c07ea7ea1e653f94e076f2192..1cad1e64f4a24ce5f1c4d2a33ca9bc24e65c7884 100644 --- a/electronice/goods/views.py +++ b/electronice/goods/views.py @@ -9,7 +9,6 @@ from django_redis import get_redis_connection from utils.login_verify import verify - def index(request): """ 展示五类商品(按照每个商品的类型以及上下架),主页面每次随机8个 @@ -39,9 +38,9 @@ def index(request): a = random.sample(list(girl), 3) b = random.sample(list(boy), 3) - #购物车商品数量 + # 购物车商品数量 user = request.user - print(user) + # print(user) if user.is_authenticated: cart_key = 'cart_%d' % user.id conn = get_redis_connection('default') @@ -58,8 +57,7 @@ def index(request): 'bags': bags, 'shoes': shoes, 'a': a, 'b': b, - 'cart_num':cart_num} - + 'cart_num': cart_num} # 用户信息 try: @@ -70,7 +68,8 @@ def index(request): user = User.objects.get(phone=phone) context = {'boys': boys, 'girls': girls, 'kids': kids, 'bags': bags, 'shoes': shoes, 'a': a, 'b': b, - 'user_info': user,'cart_num':cart_num} + 'user_info': user, 'cart_num': cart_num} + # 设置缓存 # key value timeout @@ -144,14 +143,22 @@ def item_category(request, gid): def item_sale_page(request): good = Goods.objects.all() - goods = random.sample(list(good), len(good)) - length = len(good) + goods = random.sample(list(good), 300) + length = len(goods) + goodss = random.sample(list(good), 10) # 分页 page = request.GET.get('page') - page_obj, page_num = get_page(page, good, 20) + page_obj, page_num = get_page(page, goods, 20) page_num = list(range(1, page_num + 1)) - - return render(request, 'goods/item_sale_page.html', locals()) + context = { + 'goods': goods, + 'length': length, + 'page': page, + 'page_obj': page_obj, + 'page_num': page_num, + 'goodss': goodss, + } + return render(request, 'goods/item_sale_page.html', context) def item_remove(request): diff --git a/electronice/login/__pycache__/__init__.cpython-37.pyc b/electronice/login/__pycache__/__init__.cpython-37.pyc index 48f78b46b5bf8876c3df1454975a7ec74ada5e89..9f6743f67305d04f81bc1466ed1301019345a1b2 100644 Binary files a/electronice/login/__pycache__/__init__.cpython-37.pyc and b/electronice/login/__pycache__/__init__.cpython-37.pyc differ diff --git a/electronice/login/__pycache__/admin.cpython-37.pyc b/electronice/login/__pycache__/admin.cpython-37.pyc index e8abb5d00fb7f1c1613d694e434b6de8cf2b1168..58045a1702d9e4b17d19308802bbe07bda85bec4 100644 Binary files a/electronice/login/__pycache__/admin.cpython-37.pyc and b/electronice/login/__pycache__/admin.cpython-37.pyc differ diff --git a/electronice/login/__pycache__/apps.cpython-37.pyc b/electronice/login/__pycache__/apps.cpython-37.pyc index 8abb459e89314d200ead01767a344d5f895f48ec..c428d32892437f94f0760af65343467fc08a3c00 100644 Binary files a/electronice/login/__pycache__/apps.cpython-37.pyc and b/electronice/login/__pycache__/apps.cpython-37.pyc differ diff --git a/electronice/login/__pycache__/models.cpython-37.pyc b/electronice/login/__pycache__/models.cpython-37.pyc index 6a4aed2d395c6465c1a75881c839032cd7654b29..a9e3c9df32a4f82032740f2a8d35da4e3bda9080 100644 Binary files a/electronice/login/__pycache__/models.cpython-37.pyc and b/electronice/login/__pycache__/models.cpython-37.pyc differ diff --git a/electronice/login/__pycache__/urls.cpython-37.pyc b/electronice/login/__pycache__/urls.cpython-37.pyc index 181fb3702cdb8e1dde6501acb68ca7243ddfd8c7..3a076e3b8faa7d937245cb3e3870b5990781d9de 100644 Binary files a/electronice/login/__pycache__/urls.cpython-37.pyc and b/electronice/login/__pycache__/urls.cpython-37.pyc differ diff --git a/electronice/login/__pycache__/views.cpython-37.pyc b/electronice/login/__pycache__/views.cpython-37.pyc index c96948b3dca23cfd6c9389af2c589e368c8b61ce..e437da6f20e1c5e2b507f62c1cddce16d69eefc8 100644 Binary files a/electronice/login/__pycache__/views.cpython-37.pyc and b/electronice/login/__pycache__/views.cpython-37.pyc differ diff --git a/electronice/login/migrations/__pycache__/__init__.cpython-37.pyc b/electronice/login/migrations/__pycache__/__init__.cpython-37.pyc index 58037f49cbaf92a4d39efcf6009de629d97b7900..2c35307988c1d6b9be050015d3ce1fd59569d1e5 100644 Binary files a/electronice/login/migrations/__pycache__/__init__.cpython-37.pyc and b/electronice/login/migrations/__pycache__/__init__.cpython-37.pyc differ diff --git a/electronice/login/views.py b/electronice/login/views.py index 19c3210f7dd2eff15e1b77d56e908adb4549b037..40ca36c4c0fb1a204ea96877ee44c728c30ccfb4 100644 --- a/electronice/login/views.py +++ b/electronice/login/views.py @@ -68,7 +68,7 @@ def register(request): phone = request.GET.get('phone') pwd = request.GET.get('pwd') email = request.GET.get('email') - print(email,'邮箱...........') + print(email, '邮箱...........') cache_code = cache.get(phone) if cache_code: user = User.objects.create_user(phone=phone, password=pwd, username=phone, ) @@ -81,9 +81,9 @@ def register(request): serializer = Serializer(settings.SECRET_KEY, 3600) print(serializer, 'bbbbbbbbbbbbb') info = {'confirm': user.id} - print(info, '55555555555') + # print(info, '55555555555') token = serializer.dumps(info).decode('utf-8') - print(token, '*********') + # print(token, '*********') # 发送邮件注意改成自己的邮箱;不然或报错 send_register_active_email.delay([email], user.username, token) return HttpResponse(json.dumps({'result': 'OK'})) @@ -91,7 +91,6 @@ def register(request): return HttpResponse(json.dumps({'result': 'NO'})) - def login_check_phone(request): """ 登录检查手机号 @@ -99,7 +98,7 @@ def login_check_phone(request): phone = request.GET.get('phone') pwd = request.GET.get('pwd') print(phone, 'check_phone') - print(pwd) + # print(pwd) user_info = User.objects.filter(phone=phone).values() user_list = [] @@ -117,8 +116,8 @@ def login_check_pwd(request): phone = request.GET.get('phone') pwd = request.GET.get('pwd') - print(phone, 'check_phone') - print(pwd) + # print(phone, 'check_phone') + # print(pwd) user_info = User.objects.filter(phone=phone).values() user = User.objects.filter(phone=phone)[0] print(user_info[0]['password']) @@ -126,7 +125,7 @@ def login_check_pwd(request): return HttpResponse(json.dumps({'result': 'False'})) user_pwd = check_password(pwd, user_info[0]['password']) - print(user_pwd) + # print(user_pwd) if user_info[0]['status_id'] == 1: if user_pwd == True: diff --git a/electronice/order/__pycache__/__init__.cpython-37.pyc b/electronice/order/__pycache__/__init__.cpython-37.pyc new file mode 100644 index 0000000000000000000000000000000000000000..07494d1e8e6dd001cfdb48cc3d26bacf6d1f485d Binary files /dev/null and b/electronice/order/__pycache__/__init__.cpython-37.pyc differ diff --git a/electronice/order/__pycache__/admin.cpython-37.pyc b/electronice/order/__pycache__/admin.cpython-37.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4313a6494d21504f8d8d5eb061c6ee70dd7af7bd Binary files /dev/null and b/electronice/order/__pycache__/admin.cpython-37.pyc differ diff --git a/electronice/order/__pycache__/apps.cpython-37.pyc b/electronice/order/__pycache__/apps.cpython-37.pyc new file mode 100644 index 0000000000000000000000000000000000000000..12ea0e2c93ae189f6901adf5e4b363b6a0be36ce Binary files /dev/null and b/electronice/order/__pycache__/apps.cpython-37.pyc differ diff --git a/electronice/order/__pycache__/models.cpython-37.pyc b/electronice/order/__pycache__/models.cpython-37.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0f15f6d6cde6f66cdbfdb9cfc87ec06c2caf2b20 Binary files /dev/null and b/electronice/order/__pycache__/models.cpython-37.pyc differ diff --git a/electronice/order/__pycache__/urls.cpython-37.pyc b/electronice/order/__pycache__/urls.cpython-37.pyc new file mode 100644 index 0000000000000000000000000000000000000000..dfff0c00b7f2cd11ee3a2cfdd38bb996b8f62c18 Binary files /dev/null and b/electronice/order/__pycache__/urls.cpython-37.pyc differ diff --git a/electronice/order/__pycache__/views.cpython-37.pyc b/electronice/order/__pycache__/views.cpython-37.pyc index e0bfc28a4231262bcf740a3e4d0d5aa63ea24a68..cea42412c3fed48d8de3131de359d0bfb9195d7d 100644 Binary files a/electronice/order/__pycache__/views.cpython-37.pyc and b/electronice/order/__pycache__/views.cpython-37.pyc differ diff --git a/electronice/order/migrations/__pycache__/__init__.cpython-37.pyc b/electronice/order/migrations/__pycache__/__init__.cpython-37.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8d8901bd66d1ad1790e5b9107df2fcb26de5fe35 Binary files /dev/null and b/electronice/order/migrations/__pycache__/__init__.cpython-37.pyc differ diff --git a/electronice/order/views.py b/electronice/order/views.py index 523b9f0d6a7abcdda90d7f8cd3c947f5fc962085..7c8192120611537baf770104ca8491264252d05c 100644 --- a/electronice/order/views.py +++ b/electronice/order/views.py @@ -1,6 +1,5 @@ - from django.shortcuts import render, redirect -from django.http import request, HttpResponse, HttpResponseRedirect,JsonResponse +from django.http import request, HttpResponse, HttpResponseRedirect, JsonResponse from db.models import * from django.core.paginator import Paginator @@ -12,13 +11,11 @@ from utils.pay import AliPay import json -#分页展示 - -def udai_order(request,pindex): - +# 分页展示 - a = Order.objects.filter(is_delete =0,user_id=request.user) - b=[] +def udai_order(request, pindex): + a = Order.objects.filter(is_delete=0, user_id=request.user) + b = [] for i in a: b.append(i) b.reverse() @@ -30,19 +27,20 @@ def udai_order(request,pindex): page = paginator.page(pindex) - context = {'message':a, "page": page} + context = {'message': a, "page": page} return render(request, 'order/udai_order.html', context) -#删除订单 + +# 删除订单 def del_order(request): a = request.POST - #订单id + # 订单id b = a['order_id'] try: - c = Order.objects.get(id =b) + c = Order.objects.get(id=b) except Order.DoesNotExist: - content = {'mse':'订单号有误'} + content = {'mse': '订单号有误'} return HttpResponse(json.dumps(content), content_type='application/json') else: c.is_delete = 1 @@ -51,7 +49,6 @@ def del_order(request): return HttpResponse(json.dumps(content), content_type='application/json') - @transaction.atomic def create_order(request): """ @@ -66,42 +63,44 @@ def create_order(request): order_good = a['sku'] addr = a['addr'][0] print(addr) - address = Address.objects.get(id = addr) + address = Address.objects.get(id=addr) conn = get_redis_connection("default") - cart_key = 'cart_%d'%request.user.id + cart_key = 'cart_%d' % request.user.id for i in order_good: save_id = transaction.savepoint() orders = eval(conn.hget(cart_key, i).decode('utf-8')) - good = Goods.objects.get(id = i) + good = Goods.objects.get(id=i) if good.inventory - int(orders[0]) < 0: - content = {'message':'库存不足'} + content = {'message': '库存不足'} return HttpResponse(json.dumps(content), content_type='application/json') else: - order_code = str(time.strftime('%Y%m%d%H%M%S', time.localtime(time.time()))) + str(time.time()).replace('.','')[-7:] - Order.objects.create(code=order_code,user=request.user,goods=good,num=int(orders[0]),status=0,address=address) - good.inventory -=int(orders[0]) + order_code = str(time.strftime('%Y%m%d%H%M%S', time.localtime(time.time()))) + str(time.time()).replace('.', + '')[ + -7:] + Order.objects.create(code=order_code, user=request.user, goods=good, num=int(orders[0]), status=0, + address=address) + good.inventory -= int(orders[0]) bd = int(good.code[:-1]) - good.code = str(bd+int(orders[0])) + good.code = str(bd + int(orders[0])) good.save() return redirect('http://127.0.0.1:8000/order/udai_order/1/') + def ali(): # 沙箱环境地址:https://openhome.alipay.com/platform/appDaily.htm?tab=info app_id = "2016101000656431" # POST请求,用于最后的检测 notify_url = "http://127.0.0.1:8000/order/page2" - # GET请求,用于页面的跳转展示 - return_url ="http://127.0.0.1:8000/order/page2/" - + return_url = "http://127.0.0.1:8000/order/page2/" - merchant_private_key_path = "keys/应用私钥2048.txt" #app私钥路径 - alipay_public_key_path = "keys/应用公钥2048.txt" #支付宝公钥路径 - print(merchant_private_key_path,'*************') - print(alipay_public_key_path,'2222222222222222') + merchant_private_key_path = "keys/应用私钥2048.txt" # app私钥路径 + alipay_public_key_path = "keys/应用公钥2048.txt" # 支付宝公钥路径 + print(merchant_private_key_path, '*************') + print(alipay_public_key_path, '2222222222222222') alipay = AliPay( appid=app_id, app_notify_url=notify_url, @@ -114,11 +113,11 @@ def ali(): def pay(request): - info =dict(request.POST) + info = dict(request.POST) order_id = info['order_id'][0] - a = Order.objects.get(id = order_id) - context = {'message':a} - return render(request,'order/udai_shopcart_pay.html',context) + a = Order.objects.get(id=order_id) + context = {'message': a} + return render(request, 'order/udai_shopcart_pay.html', context) def page1(request): @@ -127,8 +126,8 @@ def page1(request): else: money = float(request.POST.get('money')) good = request.POST.get('shangping') - go = Goods.objects.get(name=good) - print(go.id,'eeeeeeeeeeeeeeeeeeeee') + go = Goods.objects.get(name=good) + print(go.id, 'eeeeeeeeeeeeeeeeeeeee') code = Order.objects.get(goods_id=go.id).code # print(money,'aaaaaaaaaa') @@ -169,13 +168,11 @@ def page2(request): params = request.GET.dict() sign = params.pop('sign', None) status = alipay.verify(params, sign) - print(params,'22222222') + print(params, '22222222') code = params['out_trade_no'] - print(code,'code') + print(code, 'code') goods = Order.objects.filter(code=code) - print(goods,'ddddddddddd') - goods.update(status = 1) + print(goods, 'ddddddddddd') + goods.update(status=1) print('GET验证', status) return redirect('http://127.0.0.1:8000/order/udai_order/1/') - - diff --git a/electronice/regenerate_index_html.py b/electronice/regenerate_index_html.py deleted file mode 100644 index 712b130212f478b5210064b1fc91230ffe59ccd3..0000000000000000000000000000000000000000 --- a/electronice/regenerate_index_html.py +++ /dev/null @@ -1,17 +0,0 @@ -import sys -sys.path.insert(0, '../') -sys.path.insert(0, '../apps') - -import os -if not os.getenv('DJANGO_SETTINGS_MODULE'): - os.environ['DJANGO_SETTINGS_MODULE'] = 'mall.settings' - - # 让django进行初始化设置 -import django -django.setup() - -from crons import generate_static_index_html - - -if __name__ == '__main__': - generate_static_index_html() diff --git a/electronice/shippingcart/__pycache__/__init__.cpython-37.pyc b/electronice/shippingcart/__pycache__/__init__.cpython-37.pyc index e614fc3bcc57a7a5865ad167c5bd2749f8073a0b..16c5ceb9abcaf3e0a3dc65f09f87c351575f0d39 100644 Binary files a/electronice/shippingcart/__pycache__/__init__.cpython-37.pyc and b/electronice/shippingcart/__pycache__/__init__.cpython-37.pyc differ diff --git a/electronice/shippingcart/__pycache__/admin.cpython-37.pyc b/electronice/shippingcart/__pycache__/admin.cpython-37.pyc index d3b8937e925c3eaef2da5186a3fa84eb8f8b1599..7d2735de05e7af8bb889c1cca60e5721c826bbb7 100644 Binary files a/electronice/shippingcart/__pycache__/admin.cpython-37.pyc and b/electronice/shippingcart/__pycache__/admin.cpython-37.pyc differ diff --git a/electronice/shippingcart/__pycache__/apps.cpython-37.pyc b/electronice/shippingcart/__pycache__/apps.cpython-37.pyc index 69d384a5d241f3e64678850560c733fe46e60adc..8fb88ac218bee6a9893004289fb940e34b29fb34 100644 Binary files a/electronice/shippingcart/__pycache__/apps.cpython-37.pyc and b/electronice/shippingcart/__pycache__/apps.cpython-37.pyc differ diff --git a/electronice/shippingcart/__pycache__/models.cpython-37.pyc b/electronice/shippingcart/__pycache__/models.cpython-37.pyc index 2502355677783de7118733ed659bf0955bf20544..8a737678cb91f839858f492bf06008f1256b1756 100644 Binary files a/electronice/shippingcart/__pycache__/models.cpython-37.pyc and b/electronice/shippingcart/__pycache__/models.cpython-37.pyc differ diff --git a/electronice/shippingcart/__pycache__/urls.cpython-37.pyc b/electronice/shippingcart/__pycache__/urls.cpython-37.pyc index 5d234e9dd5bd8b0db1643c9261fca8d4ea0c79a4..c7e644754ce47fec46c0e7eaf8a1338cec54a0f6 100644 Binary files a/electronice/shippingcart/__pycache__/urls.cpython-37.pyc and b/electronice/shippingcart/__pycache__/urls.cpython-37.pyc differ diff --git a/electronice/shippingcart/__pycache__/views.cpython-37.pyc b/electronice/shippingcart/__pycache__/views.cpython-37.pyc index ae1e2811e560ae0de10744bf4af6f1e135bdf34c..14bf8f5d7fb0bb2914ed9cc5d17f1cb8ae5079cc 100644 Binary files a/electronice/shippingcart/__pycache__/views.cpython-37.pyc and b/electronice/shippingcart/__pycache__/views.cpython-37.pyc differ diff --git a/electronice/shippingcart/migrations/__pycache__/__init__.cpython-37.pyc b/electronice/shippingcart/migrations/__pycache__/__init__.cpython-37.pyc index 6d7b444b1afae3d725a76627cc39398e49e090b8..68aacedb4c8454b5be9e45530333c00bb68a07d7 100644 Binary files a/electronice/shippingcart/migrations/__pycache__/__init__.cpython-37.pyc and b/electronice/shippingcart/migrations/__pycache__/__init__.cpython-37.pyc differ diff --git a/electronice/shopping.py b/electronice/shopping.py new file mode 100644 index 0000000000000000000000000000000000000000..bc720ffd38ab81faa4d9ae8a79bf2c0f8ddad954 --- /dev/null +++ b/electronice/shopping.py @@ -0,0 +1,65 @@ +import re +import requests +import pymysql + +""" +
    +[\s\S]*? +?.*?[\S\s]*? +[\s\S]*? +月成交 (.*?) +""" + +def take_info(url): + headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.100 Safari/537.36'} + r = requests.get(url, headers=headers) + r.encoding = r.apparent_encoding + html = r.text + regex = '
    [\S\s]*?' \ + '[\s\S]*?' \ + '.*?.*?[\S\s]*?' \ + '[\S\s]*?' \ + '月成交 (.*?)[\S\s]*?' \ + '评价 (.*?)' + # regex1 = '' + # regex2 = '.*?.*?' + # regex3 = '' + # regex4 = '月成交 (.*?)' + info = re.findall(regex, html) + # print(info) + # image_url = ['http:' + i[0] for i in info] + # price = [i[1] for i in info] + # name = [i[2] for i in info] + # dindan = [i[3] for i in info] + # for i in info: + # try: + # conn = pymysql.connect('www.ccpython.cn', 'root', 'root', 'cloth', 3306) + # cursor = conn.cursor() + # cursor.execute("""insert into goods values(null, now(), now(), 0, '%s', '%s', 1, '%s', '%s', '%s', '%s', 4, 5, 4)""" % (i[2], 'http:' + i[0], 1650, i[3], i[1], i[4])) + # conn.commit() + # print('保存成功!!!') + # except Exception as e: + # print(e) +if __name__ == '__main__': + # 男装 + # url = 'https://list.tmall.com/search_product.htm?q=%C4%D0%D7%B0&type=p&vmarket=&spm=875.7931836%2FB.a2227oh.d100&from=mallfp..pc_1_searchbutton' + # url = 'https://list.tmall.com/search_product.htm?spm=a220m.1000858.1000724.9.45931602ej1Vzo&s=60&q=%C4%D0%D7%B0&sort=s&style=g&from=.list.pc_1_searchbutton&type=pc#J_Filter' + + # 女装 + # url = 'https://list.tmall.com/search_product.htm?q=%C5%AE%D7%B0&type=p&spm=a220m.1000858.a2227oh.d100&from=.list.pc_1_searchbutton' + # url = 'https://list.tmall.com/search_product.htm?spm=a220m.1000858.1000724.9.79165c21VbsHPV&s=60&q=%C5%AE%D7%B0&sort=s&style=g&from=.list.pc_1_searchbutton&type=pc#J_Filter' + + # 童装 + # url = 'https://list.tmall.com/search_product.htm?q=%CD%AF%D7%B0&type=p&spm=a220m.1000858.a2227oh.d100&from=.list.pc_1_searchbutton' + # url = 'https://list.tmall.com/search_product.htm?spm=a220m.1000858.1000724.9.599c65a9k9sTC3&s=60&q=%CD%AF%D7%B0&sort=s&style=g&from=.list.pc_1_searchbutton&type=pc#J_Filter' + + # 包包 + # url = 'https://list.tmall.com/search_product.htm?q=%CA%B1%C9%D0%B0%FC%B0%FC&type=p&spm=a220m.1000858.a2227oh.d100&from=.list.pc_1_searchbutton' + # url = 'https://list.tmall.com/search_product.htm?spm=a220m.1000858.1000724.9.bc972b9fDdYQzX&s=60&q=%B0%FC%B0%FC&sort=s&style=g&from=.list.pc_1_searchbutton&type=pc#J_Filter' + + # 鞋靴 + # url = 'https://list.tmall.com/search_product.htm?q=%D0%AC%D1%A5&type=p&spm=a220m.1000858.a2227oh.d100&from=.list.pc_1_searchbutton' + url = 'https://list.tmall.com/search_product.htm?spm=a220m.1000858.1000724.9.39381be2994gug&s=60&q=%D0%AC%D1%A5&sort=s&style=g&from=.list.pc_1_searchbutton&type=pc#J_Filter' + + take_info(url) + diff --git a/electronice/static/index.html b/electronice/static/index.html new file mode 100644 index 0000000000000000000000000000000000000000..725ed3b678dcdc946267786b1f91346b35a1abe7 --- /dev/null +++ b/electronice/static/index.html @@ -0,0 +1,1043 @@ + + + + + + + + 时尚服装箱包商城网店 + + + + + + + + + + + + + + + + + + +
    + +
    + + + + + + +
    +
    + + +
    +
    +
    + 女装 + +
    + +
    +
    +
    + 男装 + +
    + +
    +
    +
    + 活力童装 + +
    + +
    +
    +
    + 时尚包包 + +
    + +
    +
    +
    + 鞋靴 + +
    + +
    +
    + + + + + + diff --git a/electronice/user/__pycache__/__init__.cpython-37.pyc b/electronice/user/__pycache__/__init__.cpython-37.pyc index 9a6f0cbfc1a7145cb38b0d25affebca86bb53936..a24a2d6b432bd5704a5fab341a9d70cf9e646d37 100644 Binary files a/electronice/user/__pycache__/__init__.cpython-37.pyc and b/electronice/user/__pycache__/__init__.cpython-37.pyc differ diff --git a/electronice/user/__pycache__/admin.cpython-37.pyc b/electronice/user/__pycache__/admin.cpython-37.pyc index ce293386615ad425945e5be3b40a2109c11c5122..32f4bc21d303e86b73952bc3fff80cd30f6859bb 100644 Binary files a/electronice/user/__pycache__/admin.cpython-37.pyc and b/electronice/user/__pycache__/admin.cpython-37.pyc differ diff --git a/electronice/user/__pycache__/apps.cpython-37.pyc b/electronice/user/__pycache__/apps.cpython-37.pyc index 50438cb23cbff9ebebd107ec979eaf1e92887565..875d646255d7f997592e0e447ff919df66046a55 100644 Binary files a/electronice/user/__pycache__/apps.cpython-37.pyc and b/electronice/user/__pycache__/apps.cpython-37.pyc differ diff --git a/electronice/user/__pycache__/models.cpython-37.pyc b/electronice/user/__pycache__/models.cpython-37.pyc index a6ea412db3c0436f9d51d9b161f21a8f5d905fae..b05c5139a46b60a0087287746bbe867b7c9a6505 100644 Binary files a/electronice/user/__pycache__/models.cpython-37.pyc and b/electronice/user/__pycache__/models.cpython-37.pyc differ diff --git a/electronice/user/__pycache__/urls.cpython-37.pyc b/electronice/user/__pycache__/urls.cpython-37.pyc index 18b66f753a495240dc1c6bcc45b2216e3bbe7ad7..049ae2f55f5ca929729b51021a7d96af48ab07f5 100644 Binary files a/electronice/user/__pycache__/urls.cpython-37.pyc and b/electronice/user/__pycache__/urls.cpython-37.pyc differ diff --git a/electronice/user/__pycache__/views.cpython-37.pyc b/electronice/user/__pycache__/views.cpython-37.pyc index 3b21658bc8ce7dd810a45b7ca55d33d75c542b66..f8acb9270531e7e3e3d659765713c55dbcb2544c 100644 Binary files a/electronice/user/__pycache__/views.cpython-37.pyc and b/electronice/user/__pycache__/views.cpython-37.pyc differ diff --git a/electronice/user/migrations/__pycache__/__init__.cpython-37.pyc b/electronice/user/migrations/__pycache__/__init__.cpython-37.pyc index c8de4d5095d8f3ba4c0a1bf72cfa076655b2cf6d..a18bff6d71f0a45a71c5c82f46f7358acd305fd1 100644 Binary files a/electronice/user/migrations/__pycache__/__init__.cpython-37.pyc and b/electronice/user/migrations/__pycache__/__init__.cpython-37.pyc differ diff --git a/electronice/utils/__pycache__/__init__.cpython-37.pyc b/electronice/utils/__pycache__/__init__.cpython-37.pyc index d73f04c1e069b6e575056a4b142674b772191597..82c8b743abab8a52e25c82f6596197e391ff1ad7 100644 Binary files a/electronice/utils/__pycache__/__init__.cpython-37.pyc and b/electronice/utils/__pycache__/__init__.cpython-37.pyc differ diff --git a/electronice/utils/__pycache__/aliyunsms.cpython-37.pyc b/electronice/utils/__pycache__/aliyunsms.cpython-37.pyc index 83706cc20e1086c82ebb61aa4d38058c9a46d48f..16641d9549c0711b3c34c07f894b99bc24f59af5 100644 Binary files a/electronice/utils/__pycache__/aliyunsms.cpython-37.pyc and b/electronice/utils/__pycache__/aliyunsms.cpython-37.pyc differ diff --git a/electronice/utils/__pycache__/base_model.cpython-37.pyc b/electronice/utils/__pycache__/base_model.cpython-37.pyc index 3c6b1f787b968a1b95b8b57fe4a80a1c38ef2180..4684ba82b4af66dd50a3d4b907bdfd7817b5a2f6 100644 Binary files a/electronice/utils/__pycache__/base_model.cpython-37.pyc and b/electronice/utils/__pycache__/base_model.cpython-37.pyc differ diff --git a/electronice/utils/__pycache__/django_redis_cc.cpython-37.pyc b/electronice/utils/__pycache__/django_redis_cc.cpython-37.pyc index 9b6b7d7068437feaa1c3bbeeae8e0f55f40cf4b5..4ed83329e83501550a8bd269d2f69bb987a88b9c 100644 Binary files a/electronice/utils/__pycache__/django_redis_cc.cpython-37.pyc and b/electronice/utils/__pycache__/django_redis_cc.cpython-37.pyc differ diff --git a/electronice/utils/__pycache__/forms.cpython-37.pyc b/electronice/utils/__pycache__/forms.cpython-37.pyc index b72677c0be5feae8060b344d3c1d5e82db5cafde..a13f46e209b2104f24aa6d0888a2f70d6e429b5f 100644 Binary files a/electronice/utils/__pycache__/forms.cpython-37.pyc and b/electronice/utils/__pycache__/forms.cpython-37.pyc differ diff --git a/electronice/utils/__pycache__/login_verify.cpython-37.pyc b/electronice/utils/__pycache__/login_verify.cpython-37.pyc index 88807e82ca128b6a2096ac9c8b5d942bdea92aa7..63e1353fa630d4db10a4bd5ed3aa8bc1e4754c05 100644 Binary files a/electronice/utils/__pycache__/login_verify.cpython-37.pyc and b/electronice/utils/__pycache__/login_verify.cpython-37.pyc differ diff --git a/electronice/utils/__pycache__/pay.cpython-37.pyc b/electronice/utils/__pycache__/pay.cpython-37.pyc new file mode 100644 index 0000000000000000000000000000000000000000..af8649b3f2a9e5415ca24970958da7f9dc217f15 Binary files /dev/null and b/electronice/utils/__pycache__/pay.cpython-37.pyc differ diff --git a/electronice/utils/__pycache__/restful.cpython-37.pyc b/electronice/utils/__pycache__/restful.cpython-37.pyc index 5ddce1a97339a2b7f4c9285584a62cccd4fb2598..e575cb8f14c4c6bda2b714af2cc4a24559e3f06c 100644 Binary files a/electronice/utils/__pycache__/restful.cpython-37.pyc and b/electronice/utils/__pycache__/restful.cpython-37.pyc differ diff --git "a/electronice/\347\256\241\347\220\206\345\221\230\346\200\273\347\273\223\346\226\207\346\241\243.md" "b/electronice/\347\237\245\350\257\206\347\202\271\346\200\273\347\273\223/\347\256\241\347\220\206\345\221\230\346\200\273\347\273\223\346\226\207\346\241\243.md" similarity index 100% rename from "electronice/\347\256\241\347\220\206\345\221\230\346\200\273\347\273\223\346\226\207\346\241\243.md" rename to "electronice/\347\237\245\350\257\206\347\202\271\346\200\273\347\273\223/\347\256\241\347\220\206\345\221\230\346\200\273\347\273\223\346\226\207\346\241\243.md" diff --git "a/electronice/\357\277\245438.0" "b/electronice/\357\277\245438.0" new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391