From 4e852bb4dd9cb6a0e69e7cd22abae4dd8678e608 Mon Sep 17 00:00:00 2001 From: lizehui <936573478@qq.com> Date: Tue, 10 Sep 2019 10:25:27 +0800 Subject: [PATCH 01/62] =?UTF-8?q?=E6=96=B0=E5=BB=BA=E6=96=87=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../__pycache__/__init__.cpython-37.pyc | Bin 0 -> 214 bytes .../__pycache__/settings.cpython-37.pyc | Bin 0 -> 2462 bytes .../Orange_lala/__pycache__/urls.cpython-37.pyc | Bin 0 -> 1090 bytes .../home/__pycache__/__init__.cpython-37.pyc | Bin 0 -> 158 bytes .../home/__pycache__/admin.cpython-37.pyc | Bin 0 -> 199 bytes .../home/__pycache__/models.cpython-37.pyc | Bin 0 -> 196 bytes Orange_lala/home/__pycache__/urls.cpython-37.pyc | Bin 0 -> 666 bytes .../home/__pycache__/views.cpython-37.pyc | Bin 0 -> 1405 bytes .../__pycache__/__init__.cpython-37.pyc | Bin 0 -> 169 bytes .../oneself/__pycache__/__init__.cpython-37.pyc | Bin 0 -> 161 bytes .../oneself/__pycache__/admin.cpython-37.pyc | Bin 0 -> 202 bytes .../oneself/__pycache__/models.cpython-37.pyc | Bin 0 -> 9187 bytes .../oneself/__pycache__/urls.cpython-37.pyc | Bin 0 -> 1841 bytes .../oneself/__pycache__/views.cpython-37.pyc | Bin 0 -> 3731 bytes .../__pycache__/0001_initial.cpython-37.pyc | Bin 0 -> 5871 bytes .../__pycache__/__init__.cpython-37.pyc | Bin 0 -> 172 bytes ...\207\346\234\254\346\226\207\346\241\243.txt" | 1 + 17 files changed, 1 insertion(+) create mode 100644 Orange_lala/Orange_lala/__pycache__/__init__.cpython-37.pyc create mode 100644 Orange_lala/Orange_lala/__pycache__/settings.cpython-37.pyc create mode 100644 Orange_lala/Orange_lala/__pycache__/urls.cpython-37.pyc create mode 100644 Orange_lala/home/__pycache__/__init__.cpython-37.pyc create mode 100644 Orange_lala/home/__pycache__/admin.cpython-37.pyc create mode 100644 Orange_lala/home/__pycache__/models.cpython-37.pyc create mode 100644 Orange_lala/home/__pycache__/urls.cpython-37.pyc create mode 100644 Orange_lala/home/__pycache__/views.cpython-37.pyc create mode 100644 Orange_lala/home/migrations/__pycache__/__init__.cpython-37.pyc create mode 100644 Orange_lala/oneself/__pycache__/__init__.cpython-37.pyc create mode 100644 Orange_lala/oneself/__pycache__/admin.cpython-37.pyc create mode 100644 Orange_lala/oneself/__pycache__/models.cpython-37.pyc create mode 100644 Orange_lala/oneself/__pycache__/urls.cpython-37.pyc create mode 100644 Orange_lala/oneself/__pycache__/views.cpython-37.pyc create mode 100644 Orange_lala/oneself/migrations/__pycache__/0001_initial.cpython-37.pyc create mode 100644 Orange_lala/oneself/migrations/__pycache__/__init__.cpython-37.pyc create mode 100644 "Orange_lala/\346\226\260\345\273\272\346\226\207\346\234\254\346\226\207\346\241\243.txt" 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 GIT binary patch literal 214 zcmZ?b<>g`kf?XWtu{uEdF^B^LOhASM5EqL8i4=wu#vFzyhE#?Hj0+hUfxKV_O{SMX z83sR1rYQD;%G}E0!kj3f%)H`~#GIV?#Nv40%HTksl%$mmMIfWV#4kT*tC-N@)S}{; zl+>J@7?;%I?2`O~nEax|y!6x6s&cPSz zS@;sZ0s+2;Z{Q}}f^R?MX;z(w+i(ZvZo}P#E++II&6=Eg4(_Yx;emPq{kn+XCHyYK zl6vLPrWo5)7a*r(7R&l_Hj^pV_jJc}1xA8^IwlkPt}nEGSS+p+ zhxmFxKK}rer@Q`ee!%9V40c zL&7lzks3+zr4*+ZF^OARd2)NwIau(=3{uNHX<&k{a&=4a>wpA6=h?cc<}=%ZNaF zLo>X00!g2|#gYla`(xR|^o_&&8RR(ZVRcIQFr=SRn9MD5QDIf8y^>pXm8&;8O2kWB zTUyd9w70sAc1sCwq@%abOe*T0hhb0lG%5h;>q9FD7smFXcN9$ffW5U;o(){j!wm}O zD$9?>%0qlB;!5S2%2lh&kE6Uz>>lyM`JMfp@d+dvPGzOKn2+*uYrWBuBd#TFBHd^! zU6tEH8gbi-+==)tNl|v%ow^_2HsQup5R!!SbjJ2wA2d9QC?sx++l=^95FZM|fGE_a zmL3<}>yd=(hc8Zwv`HOm5A7y#%wTY&|HDc3NA2IF3*V2TL0| zo>C==QN64T@QxYiG~~;8dtgzP)%>Wlcr_|$8eRaJ7Uf(Pah@IwaA&FSU_C_zy~h#` zuW9iKrfDj_Dk*ZDCs9$6YaO|(y^?>5PSxer?e(Z6HJj}nxvs^#r9^X$meNHQGBCN6 zsJPjv*PHT=)RChzop!scZFicrc55x-_FU>jvt4;}t0{G5C7Rz+)*G=_vr&`cY>Z~> zQdf$NE75|q-QCb8`>(y0nhl(6V-lB|Qfqx%T9>t2yDlSOV^h}DHl`7eNuxC?Pg|p2 zv$EWZ@-eTg;!3(`qZWG;&5!zPji#(5G0W|~QXBX~EBR1&o-Gy((^DvA(DKsV8#)Qvqe8SFT+J(PCaHD_SW z6*x+^thfRzzTHd}kdSIA&Uf5@8;Chy`@W{MBf+edR;E#fCJz@^0eMO&qQwx=o|6 zgGG>!>G(ZLVq$!R-YQZrSiuP=_~hMdd?@RAwOA`+Dp^O-hb6LOy0q%9(>l`q6hEaDlNwi|k;+Ul zo+~M^xF|@|bRT>8gAVUXh5~vO!d57DxjUKcb#*PJV0*YGf<2npc#=eioM?Uj3<{$? z*8i!HX33Nlk~*U{a$W+LQ-4b}7M~JbSd!i3A4SJ?$=9^17hrGJy9d^%|a%;6`TrM&&aFc0bKRDh=l0?6t$x-69LqbJW zCw?1P$J?+&+ds~z%Pj}UT67u9nrX)8j^lFM9)ksqJ?s@SbhIj1! E0W&91IRF3v literal 0 HcmV?d00001 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 GIT binary patch literal 158 zcmZ?b<>g`kf?XWtu^{>}h=2h`Aj1KOi&=m~3PUi1CZpdI zlaiW~6XTLvoL!P%5R+e&n3tX!;}53da}skB<1LVRF&X)}sWI{KnR%Hd@$q^EmA5!- Ra`RJ4b5iX<78C<90|4+)C-(pV literal 0 HcmV?d00001 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 GIT binary patch literal 199 zcmZ?b<>g`kf?XWtu}(nxF^B^LOhASM5Elyoi4=wu#vF!R#wbQch7_h?22JLdKv4!w z##^k3DY=<>ews{Cd?{IpdFlCj$@zIDMVU!OAOlu16fpxSF!9U9*(xTqIJKxaCM7i| zC&neUIJ+djASS;Es4X?dA56vPB<3W>TOjjdGV*g%W5Cwv6;$5hu*uC&Da}c>V+0yp H48#loWi>NI literal 0 HcmV?d00001 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 GIT binary patch literal 196 zcmZ?b<>g`kf?XWtu{J>ZF^B^LOhASM5Elyoi4=wu#vF!R#wbQch7_h?22JLdKv4!w z##?N;`6;P6#eSMhw>VR>67$mY^-_|GK$=%F6tMs)F!9UP*(xTqIJKxa2BWyT5QRxgvL)*$soSQ#f;Z7N2#TUevQ8I4Hiim=&=9gxS`+qPtun zN8vWBTp_E>$TE;p(3|&hhSZ3>NYgpP@f6mkjMrVx%4A8fsW7YwnV4|7(VE_XhKelg6{O=mRh%C6Q}oV>?A*{_kpl$+d5 z?O?|5+Kp~YLA!+q+ebrvD;{#^q4w#1{jMyfwYi(wy}Mo>xft$5Q|Z&4QP$uEGUJnY zC@vIjyQW_>0nN=wLXwDt?%l*B2?<@c$xvL3d*K1%Sv2;MnFS?CUN0}ti(4y=EkG(& zTuJ-8(`}&*b|8zNLs%=J#QN+#71Vt}4W70SF8sE|V^Z=v$1Uv%O2U(g?`8b|=M8z_ Bx!nK& literal 0 HcmV?d00001 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..01f766817865726274bcd8d021f71218fbbad6a1 GIT binary patch literal 1405 zcmb7^y^hmB5P;XQ6FZ5W4bp0`X~@hWOVX*R*AvRn%Om{Lv-*m zyaJDsmWo%PVrEUGz0TRlJ2TE`zM1jtzDbgip!F-d{jl+c_|3*{^+0N!D zu2m&Zd3(NCo2s09$i+~&5as7aYV%WIpWghvyf{lavQ9ykWqK*~C!^|AVYXSx^sN=w zWmaa_FI+3-*y)!--s(ktw~g4Wvy}`vA4UleS?`+gp-mX&s?bK_{hTqNKsMWU8<4q; zcD`e>cEo58V%wrpt%^+tT;DoQ9oBFU*2Gq)6`BsHfc=gf5`W&VeLS(GVq;K2lbb?y zDK2*XA39|2ZCCQFtx;x}uRByZ(AM*@LyPyIwezCas?M`cU5$3WPaI;h2Qjhr)!AK# z;(T&@>To7|a1Po&HhC_!?!XFl>-x;$@tj`GljRIP(lJ&GsvS+<7;SHX?W6y%b47Df z+$^%jtQVD{3qT`ZD)!_eA134}M;<`rSwQ|o$X!D&37O*@OukUCJ)P$it|{e9zNhpt MZLt^kqu~DUA63-_Q~&?~ literal 0 HcmV?d00001 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 GIT binary patch literal 169 zcmZ?b<>g`kf?XWtu^{>}h=2h`Aj1KOi&=m~3PUi1CZpdI zlaiW~6XTLvoL!P%5R+e&n3tX!;}53da}skB<1LVRF&X)}sWG{k=|zbpnfZCeG4b)4 cd6^~g@p=W7w>WHa^HWN5Qtd!?6$3E?0P{#Jn*aa+ literal 0 HcmV?d00001 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 GIT binary patch literal 161 zcmZ?b<>g`kf?XWtu^{>}h=2h`Aj1KOi&=m~3PUi1CZpdI zlaiW~6XTLvoL!P%5R+e&n3tX!;}53da}skB<1LVRG5L9^#i==IG4b)4d6^~g@p=W7 Uw>WHa^HWN5Qtd!?6az5>0C+elJpcdz literal 0 HcmV?d00001 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 GIT binary patch literal 202 zcmZ?b<>g`kf?XWtu}(nxF^B^LOhASM5Elyoi4=wu#vF!R#wbQch7_h?22JLdKv4!w z##^k3DY=<>ews{Cd?{IpdFlCj$@zIDMVU!OAOlu16fpxSF!9UX*(xTqIJKxaCM7i| zC&neUIJ+djASS;Es4X?dA56vPB<3W>TOjjd^7B%QQ*+W{z&7a>RNmsS$<0qG%}KRm K1e#q8#0&rqr!mq58>DP2%5iz}d9v6LlH zUJzG7xoRoPpu8xqfpX1KRzP`4ybQ|Ama+=UE8!hp|-g9=0Fu-I4L5BpU8T${!rcz4!Hx7y6;^y*1g|iv}{5 z;lZ9^+l}Fqw8Ag!V&a&J>=Y|S#n#SNUDdgq!=k~Wgd%O+KJwMwK!(Dt_4LQ;;n}B| zT8A%C5G_1*=5|R_a?BhX&zl%GEh|xeTGG<8Mx&)w1B2^n87MKia?c?8xS&u1j&HhnDM9dZSTY?>AH28vsoxo`4s6VJIgs+KS^tx)Xq zIk}86YuSw5k|HIy%P}XvgPx3&UsPljx?lUUtjBA zAXPtz;~*Nuspd{b$gMl(?!}39GjnjOX6DZ>&6?RVdoyFUH_X=EDnhJPErYa~(Ra3L zbLEjP87=UV=ujp{Qq2|6HL|mYf+{~&`sVb^TIrj2BPD~w!MpN_W_;Sb^S-z9{_g#E zcJ3)kT3uj4xzAjWp5h7~yI!{l0g{$ueLRk*?f1hIfc=M}tHTlHDgmc`DGI`-t;ObB)r>G{VYp zNy{;llonvSXBPAlte84IIBY8WSyEKgrJ0;0i@%2FS;@6#NlqJ=qUESdEH1OS$^udR z41tk%uj7g7{hVUE*e$|)k(%RH8H8;-@hudyMRp94i3*|)t?0S5Lf0^2zBpv4oXm?iu^>|+(r$1)4~HhP$8 z-`1JMe(k0s6D?ZfH3N}}C0+j@ii0HhM7{&9Jd`%HI758gAPGczY1IF)j~JR8)c7Qj zpGHc+$md!ft^6DOTzYH@vR!nFPDzoTW8>KR{?|Zs3$a$*kNVQB>;%0>#^Oq817W)t zg(v;Nf&pnfuaQ~W+~-2x5ms7AXg?$uxXb5-cr6^aGT>(B@|DK%{cJ|~Gg5LKrElHl zkO7L!IKHSr`E^JF93vppf$7+>W->MpdOM74!_Reqm&?apJHFyBp|2xqq`?y|!;tF2 zf%kLZ{Z>Q+-mjTjWIyx=j}U54!tnG@_$X^mimo}W5KiSba30HA z%P(VPwJfx!^?a`Gh0)YH0g(!9 zjxLn8S6pZGV{eYxWe~RU#PoBSwoFF9ah)fk48Ye7fY(w~FW~Jnz2tLH%H}gM(u#D= zigYrV>G0O@heIIkeHo@zjj9(9Y#(y}&p;AqmdK3<{VrZmZ?TwbsMPHrXY;}VmNchk zGyiRjd>->*e03Nm@na^0hCM|s8~!~A4wX+Gj3*IDZq4&p*T(d0Mi?-1V_*I8G7A~l zN94_ zAnOdr7y`V{&O}XN&O{xBM5@;)}pEX4R@e9|=I z=i|4uW!EAOQjF$ldqfd_;wy?HZOO;OKuHgjGY(RWS(2+8k#r3jAa%A#zNN=Mn?j&K zB*by-AOaD8XQt4!rqH+-MWPq_@mI5f?syuj{EfrWybJL@=I*DIem?KrC9dY_ZRn(h zi2`LzV!$-r)qD%MiQb3{8m|T%T~egYW_ATWVOsy0uK}BpSfR!PEHLa>P-iBG0vOeE z2cijjbE4jws1sO>-tA1(yAyQ)jq#Y}iTcV!eO1?M_@X+#ZVigD4)3^u-%WV|eHWo1 zmvrm0ZC%l=7i{Y)l*cCg0AF4dO~98{TBX$E$#Ax7k)>KC$EzsZdmqEJkGYMm$XV&rP$+z6znO!U|PYh&5dDc6-OL^3!c&3s>Zl!W$5=FxlRy! z@yVgD+-l;-iA?Lh5DH$$?ZiXb3l4&w4l!<{Pm>S)Fm^YGh9g8jJ*g5iNV?rPL2686 zndB%EK#+76`gQFv+@+vDj8x)@2xun>dT#Ag9QcnCciGN3=5gB2A3^}0uu!C)%(M)m zV)X_Ks=eFHtZBZ{@G$upPfQ1H51;zv!qZFskNykU1ez7!%E_E6vW+Lci(E<)y2Bb0C`6XY2&ZRfpfV#vMDVA8)un;A z24S1Scnq5@jLA#^>d2eH!x3fK3j&>`bKo5sX`ScI_f7_5DR6_M(+nYSZte4MylrQ+ zEO&U!^um+DLOlPH8=d0$Y+UsUM!GeuGdh#F4jar5xeZO$&S5V1-^KgC=4u(j0=^|R z$APgae1x8i`?;g&D4x{xp%k2lDU9k9htlJ=WVGlq9>GX>^^s+9mPc8fhey${=c{BA z{ifFVqmx0hs9|(Q6OZH++l3aA)9=W+DLJjo^wb1h)_ECs&7`%fk%$r2Xm4SpESWw$ zZQczd-<&?}>qu$AF>4c}$1)(|0c&%G%yaN>@WdR!6QuEh4h@ZcIZ@X@*v1pDL+vwB zBaGY2A1&6h7GIWmpfG{s&_|$A#Z!h4thfd|)OFi|xD9|X{cIZ$(a>OoYQZdqnTs$Y zYY|8=5or1hlxXTUXEAW1HEtV7k@W*q;Jey-m33Xu`T#VJH^(y*a8yKRJkv#}r@a@1 z`?w^Q;XYOrefH_kP*|6Nc9CG)##L-=9JeW zrvxcExtzxdH5f*WW-Gehg_Qb_cyU^(FV9qJeer@!V;nP!XigDL;Pr$Vn_!@HKxk_e zf)LNJmO3oyozmt(pfFO`8~P<(t;)V1gsH|ZiGOgAHt;^vF`vk^#iNOL90da@T!;BJ z?dQs|e5~P5S{)wYeop-eJ4hQ$>6pxEbw5zaky{G{T*?{8O^WsR-2H1P3~oR$DlX%X z32gqc&ek&PC9McKDN%~soZ{?DB&nUFJ^8?{kb5gZzo3=SuZn>KI)vvhX2&}4oFvQ= z^}xJu{hR?68VAJ8x@h&#H!q84TmHg*(p}^(fMy?sw7(*Mjla^kfO#!*`7_sZ`55wN zJa!q4(@4wlybQuN2VF-o%VWWY;WzTv)#^S5PezyAlw(GpaVMaeY%p7n$$bsu7BaoR zaTinZWacfhNio-y28r_>Klk|8Y)(XWQgS=}|0wJl6^>7KqqUgkUYs$Jor(c|UYb z0}XVkS$ap;X}%yAtW+n3^He7-bV!TT$s#Pm()Scn25AYhOv^|aSYgT`Wg*X0Kw5@X zrXtb`l$gp$Iap(=AmyRTR6{C2ooO9u6&g%Uq$0GKHjqlN$+U%3hHa)Dq&3)Ox`b4L z%S?MnRk*@*6{!Z-n64w$;RaJ1X&r7d-9l=>ZKgX&P1t8LkXmq;=^oMs+-G`#v93SJj_+=zcz0Q(#<_S6UGtp=Siz6Gv zS8}vXOZY9eM?-I94;^Khc89{+vBfj7z#;$qZD`bCtK9*~G z-l?O&2#Opnw)l;C&py`R9y_)$f)cwoqkccfi20EMbo&{$aKQ&KZ*#4316v2pbWvUBpQ*B?ef-%q!xg*T9*$wDG2~ zLQbw>-?1lHN!-y8{mOjT`y+`>&rLUnl*w+AM^t3o&Di2M=VJ{VDa9b_e3>K8Y{@$h z9S0XKzB7?uPsR&Z*a%jq!9qhal8w*rED}-DqmNyjc@VvA?*=(I!In7t6D2*hfTu!` z!AFHo0hJ=kny%ZUhrbgqVR$5{CA_FIBzW{|YMF#y2P#LBCn=zG;%k{U^!WSyiz(j;k-Y>;e{Y?07ACdgspc!-UKvb~?0+M^33f8V@1?0)cs^12|T z?7kM>r?KO99Ys5^`z{=M(v)WJ;5>D?`YtWVzIzsApIHt}qoH&V{*v{`CKq0iLn>J9OEv+Ji3KD%G2q7ed97UI#b#kzGYi7@+ zLAdg7}vO#^=jV=4@JMH+hyE8j8_j9v39nkB~`pN!}^y_cF zFs~~8ct{`p7kxnh6&WOz*Of{DRT%p{cwL2YsF9Ar1Wb~SLmj3_YcLHnq!ZA9Cg~*1 z!W?NGTF@q)f)31+PQwB$lFq;qER!~11y)I$um?ayEe?1%Xk8uj$1)MxRIY(Y#w(@R2s-w<;M`_dc`-0<}tS#bosB&T*E= zZUuSk=&vSGyc-Ig{Sn|e-TC*)qn~;&HI46qkh1q!=(m{~^c05ak?1|kAk4{M&Wr%jL}b3X?F4ReEv$$ji=WKKiQB z3Z9)-5=D+!byPh)BX%I)F`V=i{$g z(1r)pgjNhu=(N=)v_=M-7PjeuH9pQyz1w**J~k#>7JAkLJzw}Z1VEv+!$!{*9xg1l zEifM~U;k1_3v|F5|K{UwThNvV)I@atCvnE& z^M%g*e>+>VRvsQ($g7t?9#X>fK=Sa!LUP-)*WEa4!5hkUYDXU{%%WkY^CyeE%SZ0C zk^5fcE)=;RMDELw`y}M91-XAfuI0$J6}iSCR~+QbkDPsxb0KnOLe3M&=N9=SA;&aw zWFh++dEb$D0(oxMLjgb7VE$xK-%S(@rFg(kOqz>pqgJog$3J;ryfeBQJ0JHSeR9E9 literal 0 HcmV?d00001 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..9b7e462611c56357074e8c6aadfc55d9d560ce58 GIT binary patch literal 5871 zcma)AX?qjb71n68B-_{+W0oXjvb05o$c7|MNNI{$vjCxB(nfVM9qU}nBSte~7L3&m z64nIABrGA|1PBQxr7Q_#GfDX$_iK?X|Al^Nd+s88Ox)+G=F#Zhcg{WM+_T=%+UDj| z2tVVA!Phq|4~728CiPDg2W#-_ZpRyhKrur_C95cG95%z*2>*@p--sD2#n`3nKkBWme_;pk9P>6)G3WTy@P*7SpuVkYnR)|9cqNJga00plY#Gzq0+8>4l zVo69s0#d_aoHyb;#c7(Lc{qZ|97Gy%MGLgTT#mHyHS?g|P+&fEfI^xI&4oFImJ6*H zLwN<-V8L)4S1#mq3M_)f@Bm-=phP<0A&D$OWG>2k7*vTof(VoMC_E{G7{@VtV?1m0(2`S_9SBS;VF1}SV7Hy zAt|20RnJO_RfyqU;W_vvtcG8~DtMmn^4Ahy!|`rdEAV_9tix+HtRIcQ25F&&3kxoW z`q3w_aaed|)2v>3fy-Y8FEVZNVR#8%hRvg4*fJd9zT670AO-Vf45Mfpw{3k_zd>}n z)OiO|ErcGqtDQJo1h0x&J_^5u-_79q+N`={xh@L)p4+vTSrs*U9p0F+R-1M0ALLr* z5nbx^GGdF-9uE{63J(?@f@Ar_&hX436?H=f*jI5WDQ3#8Q_NM@(>>osEgFFI z>%QsH#-5MJautlc;o*iXP}g*3I+t}m(W$AnWe#N~ zPcy5==^WxXwxbn^>*{&pIvof*t?agt+jtN926WGMTxs-v!$GSv?I)KYMLER*l>zC9 z(>Ar7yC}(B#GaM;kdx6EDe8tf`ERzonU7T+z(Eygg89kQ`}@nQ0zMiXAZTWX*;?2s zr(4X~s$qGyaGnlD!%|(tBbjm&=O7(HlgJV+Wb7ejGAqxz>s@rR32GlvJrSwsWmT-q zs5>o}m?S4d#jsoty`tLvDjuQ;J76JY&h{;I5siyQv=I$Qw1RC|1j>A(ib*=`%x8w; zHcD7VZWp)be-QKWoE-`(!4jvnd6aas`y#0|*lm}iWNv#5<Y7H>N89vEGoieu zjoZo?X@O)eKenSpaz?+An~~!Em^@QOAX9GPlDAFOfHLP3T;V6VO|Mjsd{eu41tXt} zn-?r$TFLYs-J}WV(>%S;B(%ZqD_{({=-D*eNW9-5Cb)=~#GyP<)GbUy2NR*&GNiJW>3p$Ufd+vnKcuYXNbeT;`Tz?dXA**4^`)VQ=Ik3)@*c_fI1 z+*}iP4xzcqt+qulmHRVw1N$r$D+h1Y_Mg1Zu2{p9wx#h5Cl0d+w@ttWf@j?YOtw%X z#x!zi4EtPOq@`qi?jI9J4+oS&yJDtep0eEp@e}(ejvk}YlAhZYgpVDpT{$U5t{ussX2oIP-FdS9jIRTe)+xc&R1@Jfud^X-kG>{YU1pH%He$|bMo*AO%^dHSub~Ia-TdnTs{3E z?I<}m_*jS0qB-JtECq3a|3FX-7AaJwcKzGR$PHP4=D3*4Xhm#M*o7gm(M=xVuCP`I;bwDY-&1DrWdiOF4|*Xs!Dx7|V#ka7sW6;Gok?<5Jb74l2I*MLi7aCMD)Ggssh!yA|0uBlHC;n&j5tdd+++)RD%rP20K8@1Km;j(#bZ^IV;| zT%@a5j;G#SFf7?dhELtQ^G)3s?DSA>t~-$V!VUTX$+_pTT1OooCoiD^0%d7hbnV9F z>RSi7G4N2sO^|KeiJh=p9J6>ush<40cAF)B<)eK*tNs%wWj8|~GG0Lf7Q^QCSQdJWA`#Q3wYF^%-4e4n6m%PSkIn7^;10nl>-V&M zn~i5zJfpsdMq20Y+07;pW; z35%x@7J(Ul1QmbMIzwoa?2_3Crr*!-;3QZ=A5RRC3yY?}jNp~22TFFne8eL+Qx9CO f;IzxdXawcc#A=b9&$G01*-^1cN#NDW?veij#nuD& literal 0 HcmV?d00001 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 GIT binary patch literal 172 zcmZ?b<>g`kf?XWtu^{>}h=2h`Aj1KOi&=m~3PUi1CZpdI zlaiW~6XTLvoL!P%5R+e&n3tX!;}53da}skB<1LVRG5L9^#i==IF}a!PMTsSu`FX`L f@$s2?nI-Y@dIgoYIBatBQ%ZAE?LgKQ12F>tiBm1% literal 0 HcmV?d00001 diff --git "a/Orange_lala/\346\226\260\345\273\272\346\226\207\346\234\254\346\226\207\346\241\243.txt" "b/Orange_lala/\346\226\260\345\273\272\346\226\207\346\234\254\346\226\207\346\241\243.txt" new file mode 100644 index 0000000..85df507 --- /dev/null +++ "b/Orange_lala/\346\226\260\345\273\272\346\226\207\346\234\254\346\226\207\346\241\243.txt" @@ -0,0 +1 @@ +abcd \ No newline at end of file -- Gitee From e7d5d7b026c403b982b44348e7e15dadb60382b0 Mon Sep 17 00:00:00 2001 From: liuyiming <1010652133@qq.com> Date: Tue, 10 Sep 2019 19:22:45 +0800 Subject: [PATCH 02/62] =?UTF-8?q?ok=EF=BC=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Orange_lala/static/css/demo.css | 539 ++++++++++++++++++++++++++ Orange_lala/static/css/iconfont.css | 81 ++++ Orange_lala/static/js/iconfont.js | 1 + Orange_lala/templates/home/home1.html | 34 +- 4 files changed, 639 insertions(+), 16 deletions(-) create mode 100644 Orange_lala/static/css/demo.css create mode 100644 Orange_lala/static/css/iconfont.css create mode 100644 Orange_lala/static/js/iconfont.js diff --git a/Orange_lala/static/css/demo.css b/Orange_lala/static/css/demo.css new file mode 100644 index 0000000..a67054a --- /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 0000000..3f5c702 --- /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,d09GMgABAAAAABXgAAsAAAAAJNgAABWRAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHEIGVgCFKgq5NKxAATYCJANECyQABCAFhG0HgUsbdx2zAzVsHEDMHh+V7P+SwI0h+hpq9QABWxbVmj7MjFy2jA7hjqubgkBZkI5wmXjFskcKKeLLZPxbOP3XnJdfMo6zxzZDKeGhH3Pvy0QlwRLSxJu4leKJhY54yIQimrjukSNyG57f5v+598Itoq0AsbCQ6cJ4IGEiiChWTWKFrnQlxtxXF2kuXOjWuqhwf3P1ykXUiwqAMP//92dMXwPQn1OdT1/N4sVHnFCAbTvmMWPBNqGSZWr29xNNq6tIaGxTXfR2u6ffUmBk/bbXlVOMbIsU5R2Z1gMACTHv+80K9hwypy2rJsjIiQv8wm9VN5AZhySzJgrNux/nei2R+hu7Txm7L8xAmDmZd5w2vTX9mMP2c+9GvRsQK1ATekI149wwAwQ5+2fchHNfySk9qDn1QHd4sYm2jl3GpsNXYBY4jH7m3SEAK0khoBZNWx9mNFQTsMaadXEac6ATzWkSmOPGhGtqRBEDZrkvb1twYP158dOqCAeJQUGv2LXQOkdD9aHPb2pdWo+tbg6L48BEBAooAOiJ8ZZovgJ0sZqIYF1fcwZJbPLozupD78hgMt95SGLa9334mH75VyrxquFFbneVckFSqfZZmFAZILHixIbCghuKxoGJQfkfDxcCOwgjRLcbxmOAue2NkIaQ8D4PVnhH5sEJ7+g82OCd1OBRBjAsQHnAcAPlg0YW6gEMDVQCGkBjgGEC2g4MA9B9wDAD/QDz4IKP0nkQ8Pkt3JFKzzWyAJtgGQHYrqHGlpU3ojAfERjiNzCuxIBDC8DFDTU4w00weBXQ3eh0Co0xKUQoAgqbwlFsnE5xe5dxIyk0Qt4HdWwJ6cyAiNC/LxNyiioQ0rkec2aEciPpq0NEjORUyIlJgegxde50jE73cxbwObOh7hP+cO9tFf3CXSGy6ZgL6N/jtfFe4rq9AdC6swHrYno2i6H67W1bAdjc53rYs++0J+jb7Xn+ju/qwUqy9Rig1Z/IIsnWLY6tNFrb9vptWUURehGqcNdxMWPzSXeytbu+p22rY0t2a7cT1OFeCQDHlqmtY7atdbsrcqcZLkwfQ0pfGJUAPKTm6a2NiY/DiNTG50AFouSzIpb80Jp9U84tyGV8ZBlS5EDl0GAYbelPkUktJfs1JPlkAjzA+yuQA0MHcnxiY6AOcSa5LodUJ+hSJuKv/EPFF+X/rH5a2jFDDl9TN6ipkbb1KG3ffPzpR8SZ4tgT53PpM0cEZOdi17acz7TrtEya7y7dvcKxrcUhd1lFFnjUXjx2P8eQ/xZX/mn5z7GP/vXuWsCniD+oG7MQuxL5N6HXW65vflRJex2GGGCTVnOA8deRQuj4an5ZMg7nw6Huq+LXr2nMFkXqEq84l6wMlTnls/N6YIAd/4T6krlVZv7R9Ha4qwyvrZFHRTmzFSF3HittubBAefcWgSi3J1dZpf27tYv/k0+k7ciMyjq1opOtimxRgVMlg3st2YmlEaybZWuPlKHSG7/Hx8+2mEtSG7nuyhoTot2JM22qMQwndu4OZc+lYB8+rnc3P43UIH4n859lzkZuViCi8aBo/1gjkF6F1p2XAbQBPcXE1BwXTDO8pOvmLQ690Ks0DwwjECuB2/64XDn51PvcvcFUZ/VrPsGaTjzxfAxANMRQ6rov3CAPzfOVPVdmWmRAosufE+KnvHx61fQ6+A1HMMkAkNq2AUDf8dBsSsHanIKg+Ed1fcGMrmewKo5hG84XlVazBZHyULLWpua/hp2RNTzvrJOvu1dksdVl/9rG3AaLlkr75e7cgkJiVq8ypW6NLxQB7yQzXDcuLKYPUChmNY20aP2uZ7Vw3xA9OdhS5sva6Nhq3tC0szp5ovC0CGpPgjYWSdOsn/PPcYF3ZlyIVAMwOhXoPdLURei2/WFKLFzBYKA1zpshd+1BCJhcShaftjWvx6wApuCHXg9cBhKGLobN0JjENpoFc1zJBbGwr/4vOeTQxbVycDK/a7CokbJWW0j8g4ztHQspEUzUakw0IiLG16Y2ugchDWL4wZvphqjWFp7XaG1sOrSdIgXQvEXQGBQXV5RPMw7NcEeBHtDiG/+dy2eKSzjoStEMzw1Bmt2J7XPkhHODu36UdYpxXOfVPi5zkCMO9FDuOzUOOwggl+dsMjQCCLN7JQIg3RvTwBCgsYQ11qlEpCGvD5fCyoOZ2DuW1c6SdFiQkmgaRJhxm/gYuEKVmiw7BwvmdzKRsIOfYEmJGCEHWwCJBHHQTh6AYT4cG1w/NISiWc+QELBO53EgSe9grPP6iLA24I4vJdvLa7S+ZEmVyhPjsDCCTcfyRikBDaNck8wgxgYGQMtVn8fD4eGaZ9WONqJQ1WrMP8dzcfZKyRUomwsj0NmQaqlcsqCufMq+cXW0kVf3wQ4MsqE83kG8XGQUPQI0I9AgqnV2vDgRk8D+siMCp8VjSloPeconIJdD+AMsHBmmSGYyaSUOB4gQzNKDgKQ0XocZpeGEA7MeuxoQfSCXSl6V2BpQckAANB1UaBwnKcnVthOOMSB1n/M5etCfMFmvpgt2ssZ9NvnisIE+eqowoxocbwNCLotcipPBcZKooFK8v8BZeE4uVfGo2kqO/ZNiPhU3ZZVXdd9BPioeVniI1SHVsoU0PT8VPgKtp53A2fGiBuTwydmCDZb82s1mYukazWThiV51kqRGDLIWfj12aAhmcQTIT2UUDw8EpCfOaNH98F9B3n+oAnI7RoE4U9TKjFX6MW9UcyCvgFIq0zVPn2TnJJbZ7EYCLzeV6t4jKMXGK2XkcOinBbrb70uB4kSpwugaGboHYO4UjknIWAnjQq5LSUv+OIIZAJoNxmhhOIyOqnsIXHpy8d0eAup97tVCSqSTEDm/UFw1Ge8r69ziYmfXuQlmuIlagAfSRu6ZRf2TLABvOtIjo9bTkLrdM4mz0Mj1kOw/cBOOCO50io381+rKhO0dXwlSLzNNuxliOr3ncIqstrYg0cGoBIK3OWaIxDJarh0geCzaXumPgpvJh8qvZ7RnUcHnUxPuabmglCHeKYuvi3TubSB++BEgEleQA/cseoAWnCpj5cmrK2LpET86Pv/kxSFdJbI7DoxIdHosOe4Ep6N+emfM5dX1FsTZ8bWRVcVTa2E7FqVSmZb469VJs8NtMQ/8cf9eBnwbcOvcf369nfeMBwNEMOJl7wbul/9hzWaX+ZZ5V9a4Wo7HuHHc9s6BH2Z63VxrHwxh2h4cWipZCuFmAljwhOkyPrp+dEs06TM3p+2jT2OM9bIB/81/s8fuKFrq+wgYOT5+8L3zB3oi/YPz+8H6QWxVPlNRMg4CS3BrK2SGLI1YxkA+lgVoM2uUHs6F7pecDOl1DBVdP1bhEWV48WPQqfqUVBeXlJT6+tQUXMRMygyOSqqVQlqLJR1K22yBtIZ7ffFby6yNELMe0xoAePKrIhgG6Yi2yWkCQA4q3rgS2ZMDoH4H8g54P6Gcp2AYGb2AoeepiQ1vfPlgGL188XHK339TKnbczeNIRry+7raiqLumOmEv3X7JYF8PGOLzK82KbGGOcIRR0tdfSVdlsbJMJhXLmL308+f+vlmz+vp5vP6+urqpzpl8dckLtGukC8/v68/JXU+RqZRqptpkSi9RKtUsVYZhfW4On9/fj1yvn6w2Mo3x8cx6h8OMiyuhcfj6r9tGJppMRpaKjrLUpuwsgjn0a0pGuhJZFjMfQA2aTGqW47F+Hur6dSIMMI0qVVmNxofrqUFnAsknI7WNpIGR+qMhR/VG3xmvwPTnrOh+6Ds9Ad546OcWpGHwjiXcvg/D93hNUyD7//+xm+LYsY/jCq9pe4ohfZB+pW4CUprgjDJ6NAcjzsQuIvkHeI30/WNtHiCSpzpwSZfskeT85AQ6wNhqazPuXGOYFt3omhyTFV3gOn6ZeMrm3HTBn0OLY2JzHZLk0WvOtQVGvnbW0ZKZpnikb5VM0FXVUJEiNNkntd3iLzwl8f0S7C0s+HXvP86FgT/+eMbuVxms8U4RxvoErloDRBzQV8Zow9UfH6px2gK/TXG3ksQuaZEDo66k06sZRv3FJD8Xrb/i6mJZ+jNqUxnGmCXpjFFXBiJdtEl++iCGsUIoOFkb2WvGmB58tF5WhZgFxASXXE17albAKvgoRqI6mam6uStUes75LFc5w1/59N4/0WFN7tHmH6VyUh9hEQ8pQgrDNeRdqZzQy2v8huR9KEKDDXMqrt9jor0xlT9/vZQ3IQPJQ5wNVpo3qZeOJmo4ljJ+Bdy3lZ5mXRt8cINOhvIZYnQi51UHTEziuP7iO+xYAyRfHIk3Xs5uwOj1epT+xT2XjciU95YdJ5I8Mww3yvN9tvkEausUlN3MyPAM8iwvQ9ZPjpCB8CXycz4vw9T2RnsWJnPE5wM5w+PFFhbTQ2RXY4d4vSPkXvK+033aXtrIoufke1oX7b3AyC2h3Se74gPw8sDrc/Vpaa6uWu1SfYqy4iJjGrn8UWxpX0hexr1xtPHTSrrQ+EJ0AVrpD0ONuAN9OXWUTmvdQJqxlhJrZb1zDW2ikD7Rm1uzkBOb4pND9lh8JdRmPcBqUd8Aj68YxCneF6qDlYH7g3/db+LjV+gvXzMnRyOuV14StnVz5qwdRNb2ew3zhtdOjwUz42LKN/oVxiRzC9zjms7SuMVj0mOMZllpvyS06ZY7r1JuoI1rF4fkLws+GisjRK3h6jbGlMeBmSC6qhzrwlxRYcmjEiF6Zlh+JpcPKIx/dCWH+NfI++Sv/BESFxwVeLFUrE/yH1h4J7MTZ2YaHsGwFzYTI+wsKbA/sAMpy04OETB+lMhISkTPUDQa+SN5fSyKK9b1MAPoPCZ5TnHebP8oF+9CbaUURojbHLdSl0ucQ4HO+fzp6ObHNtRzh/OWNNp+7H+sTmyodrFasgm8BduFteBxWBezCwtZg7aUNVPblfwvEUxhSFUxuxmqNLVynIrRekOVItdgLWDs7hu2Ep1H6pTMHa+Wn25btRtN5c0tUbhQfbn7DtyKr+HLsijC3V8MJ8LXIJs2FvHqxyRSpDF1BYZZOf/uOUiW+KB8dcvS+QOmhmkDNLeFL4eQoEyxgcGdc62B9GcIbV63uH4od4qijkuNYtZ57tpb1OAdiXAZvzb21zVP+sosOB9zjIlPn5jDcGx4LYcI2LFVqN+z9FMnTHyeN8fFw/T6ZPZQ+eYN2IG5CejMDUvNxg1zRRBCqdFn+ULySirvz+b6ahdI69V/Cit3oSyfO6nxD6huY8uBuMd/enSRGuvZhNGqk5wNcB0bvJTVfRjlrAqh9ZqXMw+/ZT8sxJ47jSoZNqjGMsVg2pO90kaKfDJb1CShZrCpFRR5Q5tpOdZrTXUiHloC+Hxxo3BMVBpzok1eHbrh1KViKrnsq/TJPGSsTUxLHiW162uoC6VAWEwe2JewyQEq5oF1DdaSetI7oiygmYtFXloA2Ci0d5BDeP2j3CeKoDKaPEOem3IDAFaVxVh+LZTpcsfAMJz2d7+SGSk0EpDfcgopYrMUlYcvvRwYD9kIp1dlvH3PtDei25PtN+dUUhoTAtsv1dCoWVQCsfqHUmVeXh6i5qjkiPCYhBaUeFPtb3PlnL4Ueoato52e3tbTtOOjdM84Q++TGmhvhs1+6LKi6gctJESpw6er7t466G96WbUhVZCg1IUH/qhO/yTneZw1dVbpqIqDrbCg9XGJk2wCmG7SiMU8abVvxRl2DozUyNZAQWqIk1UR1NA2JHMySwSyXYu/4FzE0DQcAflxPDJnYOjfe5iwMILiCpArKw3Rkb3fM6HM71G/ZUIJWFmvCPKLZ6bzKhhzziJC3m1Xesn2gNsqLSaILw7N5Fr0bLgc9XIvuFxlnHRXxGv6rnqbVzOqIlePVEUw+EGJSO3Zz+BB0EUyzcen+/+RJjpZFxB/NcFORBnR3l1+95nkpfNev/Yv+yanNfGEYHs1VSAYe7YXGryjO8P5UVlHd6ql9RJJ9+R8cYC67MhwT3N768KqCbeQ2ZF3REGKwoVMni8V5BGHuyH2fIUCw6r6J4yRngn634xzmaKxBtfBAWqDN/wT7adffYrLqJXXY/Xyo1CFxW2ftyp3dsDKsIOlXtQvKAxBwTcTWkHTm2+069dpKtV1Gu36t6Y3ILpqPpQtTgKTZkdodSFNLiovHcC1WGDThtK+KpOb/ap1a/CYyQm+ikyseJGR5TTiCiOqVX0kC9XsEWfnhqW0FxZQelmPwMNh4HBbfzbgFLskeBAuyUXZxY9YuyR0WG+ldn56JJXQEL2VSrH5FdsjDaAsLlolduvYM8o16rSxY1GFJMyRNLba42Jo7cQM3/Kvaw6G3cQSLkmTyke5N1Mxdap5uvd2nVmlDG7DqNLxyjFjZkhms/QWTDJYywxU1VlCfRAiSTDOUBkSea2zM0Ujo7fQlRrlObkbeFSqH3BrDZvbbfoYSmc5s+i+3pt0A2FzerI/hviYeuYs2KhdS5UBFRqC1lDT1rqdHEZrKc61O8QsM3GUe5QwE1e5V/F5ZuIo5xhhJnzjLMDW+r13TKca6LG5tHib3O+WOM/TdtHI+yOXoRZB+FHuMQJJq5Rl015lcvsnDK8QpTv87jvaKZmgBZn7eugk9Sz0X/OszbCuJCKDeJEnuHdcJej2v9YzdvSXXyUmz6HfX+uYX3XEWkYjbnhq2wZtotzYiViPxPjQ5obNvTTBO51haLsaEyDofJK5HBPOkTwt2PsEXN+z548MONVXdA7U/bcOgP8mmA+/s1p6HYGPtBQaRigtC31Bqlsc7Iij5bhqRJ2s8fs22SYDPA9MRbwBdZC/4R1kwlG1A//N95aXmGeaDJCwwC9hAH4Gvw+mT8Mdf1UuRFHs/IvFrNhvOO3nyxk/rbGlygP/FSbRIHvSjGSlBPwxCSH30esI7fJMy72nBQts8wx/80Nf5WG6D39Jsl73qzUC6ND/ISPgIYmJBFKYyZfr6gIyYKMKGTFTj6yUS7y+DZ9qFEJbgDLzJSRwG0ASJzdI4TaEwVSPIANB75ARdwiyMiB4t2jj1V6iyatHEDyr7KFIc2XUIxN7zS+0oQDvj1jNf+gbGlb7OA0v/8QKfRGS5moPIkYZz6X6kO4Ni4JV7fmCWmInUh+TxCRJY81la9J69QhizH5WskdH0lyZ08skMvZfaEMBnrPDVcc/9A2dvbIXSxHln3qF2mFT1m+u9kAIN0rb3HOpfBCOhZJnpU4+3wW1xFwGtz5KyIEMVo+rN8rDXufg2yn9eJ46jU3NLa1t7R2dXd09vX3QGtqAQQVksBo2LpAN3PsngVEpAudY0OBCoUDqawcPnN/cnjdPJ8zmwcqLAit75mk/qKpFhiYpMohHJUGVAZ+GErIgiwa5KmmgwZMeAaqZA7ohObynybUj1HPRVqsFAAA=') 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/js/iconfont.js b/Orange_lala/static/js/iconfont.js new file mode 100644 index 0000000..bfcb05a --- /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/templates/home/home1.html b/Orange_lala/templates/home/home1.html index c5f7fed..4c572c6 100644 --- a/Orange_lala/templates/home/home1.html +++ b/Orange_lala/templates/home/home1.html @@ -6,6 +6,8 @@ 首页 +{# 引入图标#} + @@ -105,7 +107,7 @@ @@ -91,7 +114,7 @@
- +
全部分类
- +
@@ -135,6 +158,7 @@
- - - + + + - +{# 限时秒杀的轮播#} + + {# 限时秒杀倒计时#} + + +{# 搜索框#} + + \ No newline at end of file -- Gitee From ddedc98d3297119d01972eb94a8ead35b0422be7 Mon Sep 17 00:00:00 2001 From: junjiehou <1904318367@qq.com> Date: Sun, 22 Sep 2019 19:37:22 +0800 Subject: [PATCH 06/62] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=96=87=E4=BB=B6=20Or?= =?UTF-8?q?ange=5Flala/templates/home/home3.html?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Orange_lala/templates/home/home3.html | 874 -------------------------- 1 file changed, 874 deletions(-) delete mode 100644 Orange_lala/templates/home/home3.html diff --git a/Orange_lala/templates/home/home3.html b/Orange_lala/templates/home/home3.html deleted file mode 100644 index fecc9b5..0000000 --- a/Orange_lala/templates/home/home3.html +++ /dev/null @@ -1,874 +0,0 @@ - - - {% load static %} - - - - - 首页 -{# 引入图标#} - -{#引入轮播的css#} - -{# 搜素框#} - - - - - - - - - - - - - - - - - - -
- -
- - -
- - - - - -
-
- -
-
- -
全部分类
- - -
- -
-
    -
  • -
  • -
  • -
  • -
-
-
-
- - - - - - - - - - - - -
-
  • -
  • -
  • -
  • -
    -
    - - - -
    - -
    - - - - -
    -
    -
    - - - -
    - -
    - - 限时秒杀 - 距离抢购结束还有: -{#
    #} -{# 01#} -{# 20#} -{# 59#} -{#
    #} -{#
    #} -
    -{#
    #} -{#
    #} -{# #} -{# #} -{# #} -{# #} -{# #} -{# #} -{# #} -{# #} -{# #} -{# #} -{#
    #} -{#
    #} -
    - -
    -
    - -
    -{#
    #} -{#

    ZEK 原味海苔

    #} -{#
    #} -{# ¥9.90#} -{# 秒杀#} -{#
    #} -{#
    #} -
    -{# #} -{#
    #} -{#
    #} -{# #} -{#
    #} -{#
    #} -{#

    ZEK 原味海苔

    #} -{#
    9.90#} -{# 秒杀#} -{#
    #} -{#
    #} -{#
    #} -{# #} -{#
    #} -{#
    #} -{# #} -{#
    #} -{#
    #} -{#

    ZEK 原味海苔

    #} -{#
    9.90#} -{# 秒杀#} -{#
    #} -{#
    #} -{#
    #} -{# #} -{#
    #} -{#
    #} -{# #} -{#
    #} -{#
    #} -{#

    ZEK 原味海苔

    #} -{#
    9.90#} -{# 秒杀#} -{#
    #} -{#
    #} -{#
    #} - -
    -
    -
    - {% for b in all0 %} -{# {% if b.id%2 = 0 %}#} -
    - - -
    -
    -

    {{ b.clname }}

    -

    {{ b.words }}

    -
    - -
    -
    -
    - -
    - -
    -{# {% for c in goods %}#} -
    - {% for c in goods %} - {% if c.all_trade.id == b.id %} - {{ c.name }} - {% endif %} - {% endfor %} -
    - -
    -
    -{# 甜品大礼包开抢啦!#} -
    -
    -{# 当小鱼儿恋上软豆腐#} -
    -
    - -{# {% endfor %}#} -
    -
    - - -
    - {% for f in goods %} - {% if f.id == b.id %} -
    - -
    - {{ f.name}} -
    -
    - {{ f.prices }} -
    - {% endif %} - {% endfor %} -
    - {% for d in images %} - {% if d.goods_id == b.id %} - - - {% endif %} - {% endfor %} - -
    - -
  • - - - -{# {% endfor %}#} -
  • - - - - -
  • - - - - - - - - -
  • -
  • - -
  • -
  • - -
  • -
  • - -
  • -
    - -
    - -
    -{# {% endif %}#} - {% endfor %} - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    -
    - - - - - -
    - - - - - - - -
    - - - -{# 限时秒杀的轮播#} - - {# 限时秒杀倒计时#} - - -{# 搜索框#} - - - \ No newline at end of file -- Gitee From baab338a1c49d49abb08c3743fd112e805f48bac Mon Sep 17 00:00:00 2001 From: junjiehou <1904318367@qq.com> Date: Mon, 23 Sep 2019 09:02:47 +0800 Subject: [PATCH 07/62] =?UTF-8?q?=E5=95=86=E5=93=81=E8=AF=A6=E6=83=851.0?= =?UTF-8?q?=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Orange_lala/Orange_lala/settings.py | 30 +- Orange_lala/Orange_lala/urls.py | 2 +- Orange_lala/home/urls.py | 6 +- Orange_lala/home/views.py | 71 ++- Orange_lala/oneself/models.py | 141 +++++- Orange_lala/templates/home/introduction.html | 472 +++++++++---------- Orange_lala/templates/s.html | 46 ++ 7 files changed, 461 insertions(+), 307 deletions(-) create mode 100644 Orange_lala/templates/s.html diff --git a/Orange_lala/Orange_lala/settings.py b/Orange_lala/Orange_lala/settings.py index 4389749..226c79b 100644 --- a/Orange_lala/Orange_lala/settings.py +++ b/Orange_lala/Orange_lala/settings.py @@ -82,27 +82,27 @@ WSGI_APPLICATION = 'Orange_lala.wsgi.application' # 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), # } # } -# DATABASES = { -# 'default': { -# 'ENGINE': 'django.db.backends.mysql', -# 'NAME': 'shopping', -# 'HOST': '106.14.141.219', -# 'POST': '3306', -# 'USER': 'member', -# 'PASSWORD': 'WwW.django.cn123', -# } -# } -# AUTH_USER_MODEL = 'oneself.User' DATABASES = { 'default': { 'ENGINE': 'django.db.backends.mysql', - 'NAME': 'aaaaaa', - 'HOST': '129.28.172.210', + 'NAME': 'shopping', + 'HOST': '106.14.141.219', 'POST': '3306', - 'USER': 'root', - 'PASSWORD': 'HOU.junjie.123', + 'USER': 'member', + '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', +# } +# } # Password validation diff --git a/Orange_lala/Orange_lala/urls.py b/Orange_lala/Orange_lala/urls.py index 95a7510..9e43977 100644 --- a/Orange_lala/Orange_lala/urls.py +++ b/Orange_lala/Orange_lala/urls.py @@ -21,5 +21,5 @@ urlpatterns = [ path('admin/', admin.site.urls), path('myself/', include('oneself.urls')), path('home/', include('home.urls')), - path('', views.homepage, name='home') + path('', views.homepage, name='home'), ] diff --git a/Orange_lala/home/urls.py b/Orange_lala/home/urls.py index 3a2628c..f7b75dc 100644 --- a/Orange_lala/home/urls.py +++ b/Orange_lala/home/urls.py @@ -1,6 +1,6 @@ from django.urls import path from home import views - +from django.conf.urls import url app_name = "home" urlpatterns = [ @@ -10,6 +10,10 @@ urlpatterns = [ path('sort/', views.sort, name='sort'), # path('introduction/', views.introduction, name='introduction'), path('introduction_handle/', views.introduction_handle, name='introduction_handle'), + # path('introduction_handle/', views.introduction_handle, name='introduction_handle'), + path('province/', views.province, name='province'), #省 直辖市 + url(r'^city_(\d+)/$', views.city, name='city'), #城市 区 + url(r'^county_(\d+)/$', views.county, name='county'), #县 path('search/', views.search, name='search'), path('shopcart/', views.shopcart, name='shopcart'), path('pay/', views.pay, name='pay'), diff --git a/Orange_lala/home/views.py b/Orange_lala/home/views.py index 79cecc1..9212ced 100644 --- a/Orange_lala/home/views.py +++ b/Orange_lala/home/views.py @@ -31,22 +31,83 @@ def sort(request): #商品页面 def introduction_handle(request): - good_name = request.GET.get("good_name") - good = Goods.objects.get(name=good_name).id #找到商品对应的id - goods = Goods.objects.filter(name=good_name) + 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相同的第一个 + 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 = [] #存放大类型相同的商品 + # images5 = Images.objects.filter(Q(goods_id=[i["id"] for i in goodss]) & ~Q(assistant=[i["id"] for i in goodss])).first() #存放同类型商品图片 + # print(images5) + for i in goodss: + image5 = Images.objects.filter(Q(goods_id=i.id) & ~Q(assistant=i.id)).first() + # print(image5.name) + images5.append(image5) + for i in goodss2: + image5 = Images.objects.filter(Q(goods_id=i.id) & ~Q(assistant=i.id)).first() + # print(image5.name) + images5_2.append(image5) + # paginator = Paginator(images5_2, 4) + # if pindex == "": + # pindex = '1' + # else: + # str(pindex) + # page = paginator.page(int(pindex)) + context = { "images": images, "images2": images2, "images3": images3, "images4": images4, - "goods": goods + "goods": goods, + "goodss": goodss, + "goodss2": goodss2, + "images5": images5, + "images5_2": images5_2, + # "page": page } return render(request, "home/introduction.html", context) +# 获取省数据 +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") diff --git a/Orange_lala/oneself/models.py b/Orange_lala/oneself/models.py index 1a6f02c..1a04857 100644 --- a/Orange_lala/oneself/models.py +++ b/Orange_lala/oneself/models.py @@ -8,10 +8,26 @@ from django.db import models +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.DO_NOTHING, 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) + + class Meta: + managed = False + db_table = 'adress' + + 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 @@ -19,7 +35,7 @@ class AllTrade(models.Model): class AuthGroup(models.Model): - name = models.CharField(unique=True, max_length=80) + name = models.CharField(unique=True, max_length=150) class Meta: managed = False @@ -59,13 +75,33 @@ class BaseArea(models.Model): class BrandHome(models.Model): - nick = models.CharField(db_column='Nick', max_length=255, blank=True, null=True) # Field name made lowercase. + nick = models.CharField(db_column='Nick', max_length=255) # Field name made lowercase. class Meta: managed = False db_table = 'brand_home' +class Collection(models.Model): + user = models.ForeignKey('User', models.DO_NOTHING, blank=True, null=True) + good = models.ForeignKey('Goods', models.DO_NOTHING, blank=True, null=True) + + class Meta: + managed = False + db_table = 'collection' + + +class Comments(models.Model): + user = models.ForeignKey('User', models.DO_NOTHING, blank=True, null=True) + good = models.ForeignKey('Goods', models.DO_NOTHING, 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 = 'comments' + + class DjangoAdminLog(models.Model): action_time = models.DateTimeField() object_id = models.TextField(blank=True, null=True) @@ -146,10 +182,20 @@ class Goods(models.Model): 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') + + class Meta: + managed = False + db_table = 'group_h' + + class HomeLun(models.Model): lun_id = models.AutoField(primary_key=True) lun_name = models.CharField(max_length=255) - lun_image = models.TextField() + lun_image = models.CharField(max_length=100) class Meta: managed = False @@ -158,7 +204,7 @@ class HomeLun(models.Model): class Images(models.Model): name = models.CharField(max_length=255, blank=True, null=True) - goods_id = models.IntegerField(blank=True, null=True) + goods = models.ForeignKey(Goods, models.DO_NOTHING, blank=True, null=True) assistant = models.IntegerField(blank=True, null=True) class Meta: @@ -166,13 +212,55 @@ class Images(models.Model): db_table = 'images' +class NewUser(models.Model): + news = models.ForeignKey('News', models.DO_NOTHING, blank=True, null=True) + user = models.ForeignKey('User', models.DO_NOTHING, blank=True, null=True) + + class Meta: + managed = False + 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 = False + db_table = 'news' + + +class Order(models.Model): + user = models.ForeignKey('User', models.DO_NOTHING, 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 = False + db_table = 'order' + + +class OrderGood(models.Model): + order = models.ForeignKey(Order, models.DO_NOTHING, blank=True, null=True) + good = models.ForeignKey(Goods, models.DO_NOTHING, 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 = False + db_table = 'order_good' + + class Shopcart(models.Model): - good_image = models.TextField() - good_name = models.CharField(max_length=255, blank=True, null=True) - good_color = models.CharField(max_length=255, blank=True, null=True) - good_pack = models.CharField(max_length=255, blank=True, null=True) - good_price = models.FloatField() - good_count = models.ForeignKey(Goods, models.DO_NOTHING, db_column='good_count') + good = models.ForeignKey(Goods, models.DO_NOTHING, blank=True, null=True) + user = models.ForeignKey('User', models.DO_NOTHING, blank=True, null=True) + good_num = models.IntegerField(blank=True, null=True) + good_price = models.FloatField(blank=True, null=True) class Meta: managed = False @@ -180,21 +268,24 @@ class Shopcart(models.Model): class User(models.Model): - password = models.CharField(max_length=128) + password = models.CharField(max_length=128, blank=True, null=True) last_login = models.DateTimeField(blank=True, null=True) - is_superuser = models.IntegerField() - username = models.CharField(unique=True, max_length=150) - first_name = models.CharField(max_length=30) - last_name = models.CharField(max_length=150) - email = models.CharField(max_length=254) - is_staff = models.IntegerField() - is_active = models.IntegerField() - date_joined = models.DateTimeField() + 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, blank=True, null=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) + sex = models.CharField(max_length=8, blank=True, null=True) name = models.CharField(max_length=255, blank=True, null=True) - birth = models.DateField() + phone = models.CharField(max_length=11, blank=True, null=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.DO_NOTHING, blank=True, null=True) class Meta: managed = False @@ -202,8 +293,9 @@ class User(models.Model): class UserAddress(models.Model): - address = models.CharField(max_length=255, blank=True, null=True) - user = models.ForeignKey(User, models.DO_NOTHING) + id = models.IntegerField(primary_key=True) + useraddress = models.CharField(max_length=255) + user = models.ForeignKey(User, models.DO_NOTHING, blank=True, null=True) class Meta: managed = False @@ -221,8 +313,7 @@ class UserGroups(models.Model): class UserMenber(models.Model): - rember = models.CharField(max_length=255, blank=True, null=True) - user = models.ForeignKey(User, models.DO_NOTHING) + rember = models.CharField(max_length=255) class Meta: managed = False diff --git a/Orange_lala/templates/home/introduction.html b/Orange_lala/templates/home/introduction.html index f42f2fe..0f45139 100644 --- a/Orange_lala/templates/home/introduction.html +++ b/Orange_lala/templates/home/introduction.html @@ -20,7 +20,50 @@ - + + + @@ -107,17 +150,6 @@
    -{#
      #} -{#
    • #} -{# #} -{#
    • #} -{#
    • #} -{# #} -{#
    • #} -{#
    • #} -{# #} -{#
    • #} -{#
    #}
    @@ -139,7 +171,7 @@ });
    - 细节展示放大镜特效 + 细节展示放大镜特效
      {% for image in images2 %} @@ -178,14 +210,16 @@
      + {% for good in goods %}
    • 促销价
      -
      ¥56.90
      +
      ¥--
    • 原价
      -
      ¥98.00
      +
      ¥{{ good.prices }}
    • + {% endfor %}
      @@ -194,21 +228,18 @@
      配送至
      - + - + - +
      - 快递10元 +{# 快递10元#}
      @@ -249,46 +280,70 @@
      口味
        -
      • 原味
      • -
      • 奶油
      • -
      • 炭烧
      • -
      • 咸香
      • + {% for good in goods %} +
      • {{ good.taste }}
      • + {% endfor %}
      包装
        -
      • 手袋单人份
      • -
      • 礼盒双人份
      • -
      • 全家福礼包
      • + {% for good in goods %} +
      • {{ good.pack }}
      • + {% endfor %}
      数量
      - - - - 库存1000 + + + + + {% for good in goods %} + 库存{{ good.repertory }} + {% endfor %}
      -
      -
      确认
      -
      取消
      -
      -
      - + @@ -302,7 +357,7 @@
      店铺优惠
      -

      购物满2件打8折,满3件7折点击领券

      +

      购物满2件及以上打8折点击领券

      @@ -381,58 +436,34 @@

      看了又看

      - -
    • -
      - -
      - -
      ¥35.90
      -
    • -
    • -
      - -
      - -
      ¥35.90
      -
    • -
    • -
      - -
      - -
      ¥35.90
      -
    • -
    • -
      - -
      - -
      ¥35.90
      -
    • -
    • -
      - -
      - -
      ¥35.90
      -
    • - + {% for g in goodss %} +
    • +
      + {% for i in images5 %} +{# {% for image in i %}#} + {% if i.goods.id == g.id %} +
      +{# #} + + + {{ i.goods.name }} + +
      + {% endif %} +{# {% endfor %}#} + {% endfor %} +
      + +
      ¥{{ g.prices }}
      +
    • + {% endfor %}
    @@ -454,7 +485,7 @@
  • - + 猜你喜欢
  • @@ -469,16 +500,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 %}
    @@ -970,13 +1003,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 %}
    @@ -989,151 +1034,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
    • #} +{#
    • »
    • #}
    diff --git a/Orange_lala/templates/s.html b/Orange_lala/templates/s.html new file mode 100644 index 0000000..a0c04a2 --- /dev/null +++ b/Orange_lala/templates/s.html @@ -0,0 +1,46 @@ + + + + + 测试代码 + + +-- +40 + + + + + + -- Gitee From 369586ceb6e20b3ddb615ce14e64c169ce85b7cd Mon Sep 17 00:00:00 2001 From: junjiehou <1904318367@qq.com> Date: Mon, 23 Sep 2019 09:15:09 +0800 Subject: [PATCH 08/62] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=96=87=E4=BB=B6=20Or?= =?UTF-8?q?ange=5Flala/templates/home/home3(1).html?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Orange_lala/templates/home/home3(1).html | 1 - 1 file changed, 1 deletion(-) delete mode 100644 Orange_lala/templates/home/home3(1).html diff --git a/Orange_lala/templates/home/home3(1).html b/Orange_lala/templates/home/home3(1).html deleted file mode 100644 index b3de2f7..0000000 --- a/Orange_lala/templates/home/home3(1).html +++ /dev/null @@ -1 +0,0 @@ - {% load static %} 首页 {# 引入图标#} {#引入轮播的css#} {# 搜素框#}
    全部分类
  • 限时秒杀 距离抢购结束还有: {#
    #} {# 01#} {# 20#} {# 59#} {#
    #} {#
    #}
    {#
    #} {#

    ZEK 原味海苔

    #} {#
    #} {# ¥9.90#} {# 秒杀#} {#
    #} {#
    #}
    {# #} {#
    #} {#
    #} {# #} {#
    #} {#
    #} {#

    ZEK 原味海苔

    #} {#
    9.90#} {# 秒杀#} {#
    #} {#
    #} {#
    #} {# #} {#
    #} {#
    #} {# #} {#
    #} {#
    #} {#

    ZEK 原味海苔

    #} {#
    9.90#} {# 秒杀#} {#
    #} {#
    #} {#
    #} {# #} {#
    #} {#
    #} {# #} {#
    #} {#
    #} {#

    ZEK 原味海苔

    #} {#
    9.90#} {# 秒杀#} {#
    #} {#
    #} {#
    #}
    {% for trade in trades_all %}

    {{ trade.clname }}

    {{ trade.words }}

    {% for good in trade.goods_set.all %} {{ good.name }}| {% endfor %}
    {% for goodclass in trade.goodclass_set.all %} {{ goodclass.good_class_name }} {% endfor %}
    {{ trade.words }}
    {{ trade.words }}
    {{ trade.goodsinfo.0.name }}
    ¥{{ trade.goodsinfo.0.prices }}
  • {{ trade.goodsinfo.1.name }}
    ¥{{ trade.goodsinfo.1.prices }}
  • {{ trade.goodsinfo.2.name }}
    ¥{{ trade.goodsinfo.2.prices }}
  • {{ trade.goodsinfo.3.name }}
    ¥{{ trade.goodsinfo.3.prices }}
  • {{ trade.goodsinfo.4.name }}
    ¥{{ trade.goodsinfo.4.prices }}
  • {{ trade.goodsinfo.5.name }}
    ¥{{ trade.goodsinfo.5.prices }}
  • {% endfor %}
    {# 限时秒杀的轮播#} {# 限时秒杀倒计时#} {# 搜索框#} \ No newline at end of file -- Gitee From e74ef965e5dfa01663b0f4cec4965f489de14b8d Mon Sep 17 00:00:00 2001 From: junjiehou <1904318367@qq.com> Date: Mon, 23 Sep 2019 09:16:37 +0800 Subject: [PATCH 09/62] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=96=87=E4=BB=B6=20Or?= =?UTF-8?q?ange=5Flala/home/views.py?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Orange_lala/home/views.py | 154 -------------------------------------- 1 file changed, 154 deletions(-) delete mode 100644 Orange_lala/home/views.py diff --git a/Orange_lala/home/views.py b/Orange_lala/home/views.py deleted file mode 100644 index 0ebf034..0000000 --- a/Orange_lala/home/views.py +++ /dev/null @@ -1,154 +0,0 @@ -from django.shortcuts import render -from oneself.models import * -from django.db.models import Q -from django.contrib.auth.models import AbstractUser -# Create your views here. - - -#首页 -def homepage(request): - trades_all = AllTrade.objects.all() - for trade in trades_all: - current_goods_image = [] - current_goodsinfo = [] - goods = trade.goods_set.all() - for good in goods: - image = Images.objects.filter(goods_id=good.id).first() - current_goods_image.append(image) - current_goodsinfo.append(good) - trade.images = current_goods_image - trade.goodsinfo = current_goodsinfo - - # all = AllTrade.objects.all() - # - # # good = Goods.objects.get(name=good_name).id - # goods = Goods.objects.all() - # all0 = AllTrade.objects.filter(id__lt=7) - # all1 = AllTrade.objects.filter(id__lt=7).values("id") - # # print(all1) - # goodclass = Goodclass.objects.all() - # goodsslist = [] - # goodss = 0 - # for i in all1: - # print(i["id"]) - # goodss = Goods.objects.filter(all_trade=i["id"])[:6] - # print(goodss) - # # for g in goodss: - # # print(g["name"]) - # goodsslist.append(goodss) - # # print(goodsslist) - # images = Images.objects.all() - - - context = { - "trades_all":trades_all, - - } - return render(request, "home/home3(1).html", context) - -#注册 -def register(request): - return render(request, "home/register.html") - -#登录 -def login(request): - return render(request, "home/login.html") - -#全部分类 -def sort(request): - return render(request, "home/sort.html") - -#商品页面 -def introduction_handle(request): - 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 = [] #存放大类型相同的商品 - # images5 = Images.objects.filter(Q(goods_id=[i["id"] for i in goodss]) & ~Q(assistant=[i["id"] for i in goodss])).first() #存放同类型商品图片 - # print(images5) - for i in goodss: - image5 = Images.objects.filter(Q(goods_id=i.id) & ~Q(assistant=i.id)).first() - # print(image5.name) - images5.append(image5) - for i in goodss2: - image5 = Images.objects.filter(Q(goods_id=i.id) & ~Q(assistant=i.id)).first() - # print(image5.name) - images5_2.append(image5) - # paginator = Paginator(images5_2, 4) - # if pindex == "": - # pindex = '1' - # else: - # str(pindex) - # page = paginator.page(int(pindex)) - - context = { - "images": images, - "images2": images2, - "images3": images3, - "images4": images4, - "goods": goods, - "goodss": goodss, - "goodss2": goodss2, - "images5": images5, - "images5_2": images5_2, - # "page": page - } - return render(request, "home/introduction.html", context) - -# 获取省数据 -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") - -#购物车 -def shopcart(request): - return render(request, "home/shopcart.html") - -#结算 -def pay(request): - return render(request, "home/pay.html") - -#结算成功 -def success(request): - return render(request, "home/success.html") \ No newline at end of file -- Gitee From 142e4da592c390f5d804181ab579419381f609b3 Mon Sep 17 00:00:00 2001 From: junjiehou <1904318367@qq.com> Date: Mon, 23 Sep 2019 09:43:06 +0800 Subject: [PATCH 10/62] =?UTF-8?q?=E9=A6=96=E9=A1=B5=E7=9A=84=E5=88=86?= =?UTF-8?q?=E7=B1=BB=E5=92=8C=E5=95=86=E5=93=81=E8=AF=A6=E6=83=851.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Orange_lala/home/views.py | 41 +- Orange_lala/oneself/models.py | 10 +- Orange_lala/templates/home/home3.html | 1889 +++++++++++++++++++++++++ 3 files changed, 1911 insertions(+), 29 deletions(-) create mode 100644 Orange_lala/templates/home/home3.html diff --git a/Orange_lala/home/views.py b/Orange_lala/home/views.py index 0ebf034..0d9bb7c 100644 --- a/Orange_lala/home/views.py +++ b/Orange_lala/home/views.py @@ -1,51 +1,36 @@ 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 # Create your views here. #首页 def homepage(request): + 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 good in goods: - image = Images.objects.filter(goods_id=good.id).first() + for good1 in goods: + image = Images.objects.filter(goods_id=good1.id).first() current_goods_image.append(image) - current_goodsinfo.append(good) + current_goodsinfo.append(good1) trade.images = current_goods_image trade.goodsinfo = current_goodsinfo - # all = AllTrade.objects.all() - # - # # good = Goods.objects.get(name=good_name).id - # goods = Goods.objects.all() - # all0 = AllTrade.objects.filter(id__lt=7) - # all1 = AllTrade.objects.filter(id__lt=7).values("id") - # # print(all1) - # goodclass = Goodclass.objects.all() - # goodsslist = [] - # goodss = 0 - # for i in all1: - # print(i["id"]) - # goodss = Goods.objects.filter(all_trade=i["id"])[:6] - # print(goodss) - # # for g in goodss: - # # print(g["name"]) - # goodsslist.append(goodss) - # # print(goodsslist) - # images = Images.objects.all() - - context = { - "trades_all":trades_all, - + "all": all, + "goodclass": goodclass, + "goodss": goodss, + "trades_all": trades_all, } - return render(request, "home/home3(1).html", context) - + return render(request, "home/home3.html", context) #注册 def register(request): return render(request, "home/register.html") diff --git a/Orange_lala/oneself/models.py b/Orange_lala/oneself/models.py index 1a04857..401c8b0 100644 --- a/Orange_lala/oneself/models.py +++ b/Orange_lala/oneself/models.py @@ -35,7 +35,7 @@ class AllTrade(models.Model): class AuthGroup(models.Model): - name = models.CharField(unique=True, max_length=150) + name = models.CharField(unique=True, max_length=80) class Meta: managed = False @@ -256,6 +256,14 @@ class OrderGood(models.Model): db_table = 'order_good' +class SafetyAccount(models.Model): + question = models.CharField(max_length=255) + + class Meta: + managed = False + db_table = 'safety_account' + + class Shopcart(models.Model): good = models.ForeignKey(Goods, models.DO_NOTHING, blank=True, null=True) user = models.ForeignKey('User', models.DO_NOTHING, blank=True, null=True) diff --git a/Orange_lala/templates/home/home3.html b/Orange_lala/templates/home/home3.html new file mode 100644 index 0000000..ab77d30 --- /dev/null +++ b/Orange_lala/templates/home/home3.html @@ -0,0 +1,1889 @@ + + + {% load static %} + + + + + 首页 +{# 引入图标#} + +{#引入轮播的css#} + + + + + + + + + + + + + + + + +
    + +
    + + +
    + + + + + +
    +
    + +
    +
    + + + + +
    + +
    +
      +
    • +
    • +
    • +
    • +
    +
    +
    +
    + + + + + + + + + + + + +
    +
  • +
  • +
  • +
  • +
    +
    + + + +
    + +
    + + + + +
    +
    +
    + + + +
    + +
    + + 限时秒杀 + 距离抢购结束还有: +{#
    #} +{# 01#} +{# 20#} +{# 59#} +{#
    #} +{#
    #} +
    +
    +
    + + + + + + + + + + +
    +
    +
    + +
    +
    + +{#
    #} +{# #} +{#
    #} +
    +{#
    #} +{#

    ZEK 原味海苔

    #} +{#
    #} +{# ¥9.90#} +{# 秒杀#} +{#
    #} +{#
    #} +
    +{# #} +{#
    #} +{#
    #} +{# #} +{#
    #} +{#
    #} +{#

    ZEK 原味海苔

    #} +{#
    9.90#} +{# 秒杀#} +{#
    #} +{#
    #} +{#
    #} +{# #} +{#
    #} +{#
    #} +{# #} +{#
    #} +{#
    #} +{#

    ZEK 原味海苔

    #} +{#
    9.90#} +{# 秒杀#} +{#
    #} +{#
    #} +{#
    #} +{# #} +{#
    #} +{#
    #} +{# #} +{#
    #} +{#
    #} +{#

    ZEK 原味海苔

    #} +{#
    9.90#} +{# 秒杀#} +{#
    #} +{#
    #} +{#
    #} + +
    +
    +
    + + {% for trade in trades_all %} +
    + + +
    +
    +

    {{ trade.clname }}

    +

    {{ trade.words }}

    +
    + {% for good in trade.goods_set.all %} + {{ good.name }}| + {% endfor %} +
    + +
    +
    + +
    +
    +
    + {% for goodclass in trade.goodclass_set.all %} + {{ goodclass.good_class_name }} + {% endfor %} +
    + + +
    +
    + {{ trade.words }} +
    +
    + {{ trade.words }} +
    +
    +
    +
    +
    + +
    + +
    +
    + {{ trade.goodsinfo.0.name }} +
    +
    + ¥{{ trade.goodsinfo.0.prices }} +
    + +
    + +
    + +
  • +
    +
    +
    +
    + {{ trade.goodsinfo.1.name }} +
    +
    + ¥{{ trade.goodsinfo.1.prices }} +
    + +
    + +
    +
  • +
  • +
    +
    +
    +
    + {{ trade.goodsinfo.2.name }} +
    +
    + ¥{{ trade.goodsinfo.2.prices }} +
    + +
    + +
    +
  • +
  • +
    +
    +
    +
    + {{ trade.goodsinfo.3.name }} +
    +
    + ¥{{ trade.goodsinfo.3.prices }} +
    + +
    + +
    +
  • +
  • +
    +
    +
    +
    + {{ trade.goodsinfo.4.name }} +
    +
    + ¥{{ trade.goodsinfo.4.prices }} +
    + +
    + +
    +
  • +
  • +
    +
    +
    +
    + {{ trade.goodsinfo.5.name }} +
    +
    + ¥{{ trade.goodsinfo.5.prices }} +
    + +
    + +
    +
  • +
    + +
    +
    + {% endfor %} + +{#
    #} +{# #} +{# #} +{#
    #} +{#
    #} +{#

    甜品

    #} +{#

    每一道甜品都有一个故事

    #} +{#
    #} +{# 桂花糕|#} +{# 奶皮酥|#} +{# 栗子糕 |#} +{# 马卡龙|#} +{# 铜锣烧|#} +{# 豌豆黄#} +{#
    #} +{##} +{#
    #} +{#
    #} +{# #} +{#
    #} +{# #} +{# #} +{# #} +{#
    #} +{# #} +{#
    #} +{#
    #} +{# 雪之恋和风大福#} +{#
    #} +{#
    #} +{# ¥13.8#} +{#
    #} +{# #} +{#
    #} +{# #} +{#
    #} +{##} +{#
  • #} +{#
    #} +{#
    #} +{#
    #} +{#
    #} +{# 小优布丁#} +{#
    #} +{#
    #} +{# ¥4.8#} +{#
    #} +{# #} +{#
    #} +{# #} +{#
    #} +{#
  • #} +{#
  • #} +{#
    #} +{#
    #} +{#
    #} +{#
    #} +{# 小优布丁#} +{#
    #} +{#
    #} +{# ¥4.8#} +{#
    #} +{# #} +{#
    #} +{# #} +{#
    #} +{#
  • #} +{#
  • #} +{#
    #} +{#
    #} +{#
    #} +{#
    #} +{# 小优布丁#} +{#
    #} +{#
    #} +{# ¥4.8#} +{#
    #} +{# #} +{#
    #} +{# #} +{#
    #} +{#
  • #} +{#
  • #} +{#
    #} +{#
    #} +{#
    #} +{#
    #} +{# 小优布丁#} +{#
    #} +{#
    #} +{# ¥4.8#} +{#
    #} +{# #} +{#
    #} +{# #} +{#
    #} +{#
  • #} +{#
  • #} +{#
    #} +{#
    #} +{#
    #} +{#
    #} +{# 小优布丁#} +{#
    #} +{#
    #} +{# ¥4.8#} +{#
    #} +{# #} +{#
    #} +{# #} +{#
    #} +{#
  • #} +{#
    #} +{#
    #} +{#
    #} +{#
    #} +{##} +{# #} +{#
    #} +{#
    #} +{#

    坚果

    #} +{#

    酥酥脆脆,回味无穷

    #} +{#
    #} +{# 腰果|#} +{# 松子|#} +{# 夏威夷果 |#} +{# 碧根果|#} +{# 开心果|#} +{# 核桃仁#} +{#
    #} +{#
    #} +{#
    #} +{#
    #} +{# #} +{# #} +{#
    #} +{# #} +{#
    #} +{#
    #} +{# 雪之恋和风大福#} +{#
    #} +{#
    #} +{# ¥13.8#} +{#
    #} +{# #} +{#
    #} +{# #} +{# #} +{#
    #} +{# #} +{#
  • #} +{#
    #} +{#
    #} +{#
    #} +{#
    #} +{# 雪之恋和风大福#} +{#
    #} +{#
    #} +{# ¥13.8#} +{#
    #} +{# #} +{#
    #} +{# #} +{#
    #} +{#
  • #} +{#
  • #} +{#
    #} +{#
    #} +{#
    #} +{#
    #} +{# 小优布丁#} +{#
    #} +{#
    #} +{# ¥4.8#} +{#
    #} +{# #} +{#
    #} +{# #} +{#
    #} +{#
  • #} +{#
  • #} +{#
    #} +{#
    #} +{#
    #} +{#
    #} +{# 小优布丁#} +{#
    #} +{#
    #} +{# ¥4.8#} +{#
    #} +{# #} +{#
    #} +{# #} +{#
    #} +{#
  • #} +{#
  • #} +{#
    #} +{#
    #} +{#
    #} +{#
    #} +{# 小优布丁#} +{#
    #} +{#
    #} +{# ¥4.8#} +{#
    #} +{# #} +{#
    #} +{# #} +{#
    #} +{#
  • #} +{#
  • #} +{#
    #} +{#
    #} +{#
    #} +{#
    #} +{# 小优布丁#} +{#
    #} +{#
    #} +{# ¥4.8#} +{#
    #} +{# #} +{#
    #} +{# #} +{#
    #} +{#
  • #} +{#
    #} +{#
    #} +{#
    #} +{# #} +{#
    #} +{# #} +{# #} +{#
    #} +{#
    #} +{#

    甜品

    #} +{#

    每一道甜品都有一个故事

    #} +{#
    #} +{# 桂花糕|#} +{# 奶皮酥|#} +{# 栗子糕 |#} +{# 马卡龙|#} +{# 铜锣烧|#} +{# 豌豆黄#} +{#
    #} +{##} +{#
    #} +{#
    #} +{# #} +{#
    #} +{# #} +{# #} +{# #} +{#
    #} +{# #} +{#
    #} +{#
    #} +{# 雪之恋和风大福#} +{#
    #} +{#
    #} +{# ¥13.8#} +{#
    #} +{# #} +{#
    #} +{# #} +{#
    #} +{##} +{#
  • #} +{#
    #} +{#
    #} +{#
    #} +{#
    #} +{# 小优布丁#} +{#
    #} +{#
    #} +{# ¥4.8#} +{#
    #} +{# #} +{#
    #} +{# #} +{#
    #} +{#
  • #} +{#
  • #} +{#
    #} +{#
    #} +{#
    #} +{#
    #} +{# 小优布丁#} +{#
    #} +{#
    #} +{# ¥4.8#} +{#
    #} +{# #} +{#
    #} +{# #} +{#
    #} +{#
  • #} +{#
  • #} +{#
    #} +{#
    #} +{#
    #} +{#
    #} +{# 小优布丁#} +{#
    #} +{#
    #} +{# ¥4.8#} +{#
    #} +{# #} +{#
    #} +{# #} +{#
    #} +{#
  • #} +{#
  • #} +{#
    #} +{#
    #} +{#
    #} +{#
    #} +{# 小优布丁#} +{#
    #} +{#
    #} +{# ¥4.8#} +{#
    #} +{# #} +{#
    #} +{# #} +{#
    #} +{#
  • #} +{#
  • #} +{#
    #} +{#
    #} +{#
    #} +{#
    #} +{# 小优布丁#} +{#
    #} +{#
    #} +{# ¥4.8#} +{#
    #} +{# #} +{#
    #} +{# #} +{#
    #} +{#
  • #} +{#
    #} +{#
    #} +{#
    #} +{#
    #} +{##} +{# #} +{#
    #} +{#
    #} +{#

    坚果

    #} +{#

    酥酥脆脆,回味无穷

    #} +{#
    #} +{# 腰果|#} +{# 松子|#} +{# 夏威夷果 |#} +{# 碧根果|#} +{# 开心果|#} +{# 核桃仁#} +{#
    #} +{#
    #} +{#
    #} +{#
    #} +{# #} +{# #} +{#
    #} +{# #} +{#
    #} +{#
    #} +{# 雪之恋和风大福#} +{#
    #} +{#
    #} +{# ¥13.8#} +{#
    #} +{# #} +{#
    #} +{# #} +{# #} +{#
    #} +{# #} +{#
  • #} +{#
    #} +{#
    #} +{#
    #} +{#
    #} +{# 雪之恋和风大福#} +{#
    #} +{#
    #} +{# ¥13.8#} +{#
    #} +{# #} +{#
    #} +{# #} +{#
    #} +{#
  • #} +{#
  • #} +{#
    #} +{#
    #} +{#
    #} +{#
    #} +{# 小优布丁#} +{#
    #} +{#
    #} +{# ¥4.8#} +{#
    #} +{# #} +{#
    #} +{# #} +{#
    #} +{#
  • #} +{#
  • #} +{#
    #} +{#
    #} +{#
    #} +{#
    #} +{# 小优布丁#} +{#
    #} +{#
    #} +{# ¥4.8#} +{#
    #} +{# #} +{#
    #} +{# #} +{#
    #} +{#
  • #} +{#
  • #} +{#
    #} +{#
    #} +{#
    #} +{#
    #} +{# 小优布丁#} +{#
    #} +{#
    #} +{# ¥4.8#} +{#
    #} +{# #} +{#
    #} +{# #} +{#
    #} +{#
  • #} +{#
  • #} +{#
    #} +{#
    #} +{#
    #} +{#
    #} +{# 小优布丁#} +{#
    #} +{#
    #} +{# ¥4.8#} +{#
    #} +{# #} +{#
    #} +{# #} +{#
    #} +{#
  • #} +{#
    #} +{#
    #} +{#
    #} +{##} +{#
    #} +{# #} +{# #} +{#
    #} +{#
    #} +{#

    甜品

    #} +{#

    每一道甜品都有一个故事

    #} +{#
    #} +{# 桂花糕|#} +{# 奶皮酥|#} +{# 栗子糕 |#} +{# 马卡龙|#} +{# 铜锣烧|#} +{# 豌豆黄#} +{#
    #} +{##} +{#
    #} +{#
    #} +{# #} +{#
    #} +{# #} +{# #} +{# #} +{#
    #} +{# #} +{#
    #} +{#
    #} +{# 雪之恋和风大福#} +{#
    #} +{#
    #} +{# ¥13.8#} +{#
    #} +{# #} +{#
    #} +{# #} +{#
    #} +{##} +{#
  • #} +{#
    #} +{#
    #} +{#
    #} +{#
    #} +{# 小优布丁#} +{#
    #} +{#
    #} +{# ¥4.8#} +{#
    #} +{# #} +{#
    #} +{# #} +{#
    #} +{#
  • #} +{#
  • #} +{#
    #} +{#
    #} +{#
    #} +{#
    #} +{# 小优布丁#} +{#
    #} +{#
    #} +{# ¥4.8#} +{#
    #} +{# #} +{#
    #} +{# #} +{#
    #} +{#
  • #} +{#
  • #} +{#
    #} +{#
    #} +{#
    #} +{#
    #} +{# 小优布丁#} +{#
    #} +{#
    #} +{# ¥4.8#} +{#
    #} +{# #} +{#
    #} +{# #} +{#
    #} +{#
  • #} +{#
  • #} +{#
    #} +{#
    #} +{#
    #} +{#
    #} +{# 小优布丁#} +{#
    #} +{#
    #} +{# ¥4.8#} +{#
    #} +{# #} +{#
    #} +{# #} +{#
    #} +{#
  • #} +{#
  • #} +{#
    #} +{#
    #} +{#
    #} +{#
    #} +{# 小优布丁#} +{#
    #} +{#
    #} +{# ¥4.8#} +{#
    #} +{# #} +{#
    #} +{# #} +{#
    #} +{#
  • #} +{#
    #} +{#
    #} +{#
    #} +{#
    #} +{##} +{# #} +{#
    #} +{#
    #} +{#

    坚果

    #} +{#

    酥酥脆脆,回味无穷

    #} +{#
    #} +{# 腰果|#} +{# 松子|#} +{# 夏威夷果 |#} +{# 碧根果|#} +{# 开心果|#} +{# 核桃仁#} +{#
    #} +{#
    #} +{#
    #} +{#
    #} +{# #} +{# #} +{#
    #} +{# #} +{#
    #} +{#
    #} +{# 雪之恋和风大福#} +{#
    #} +{#
    #} +{# ¥13.8#} +{#
    #} +{# #} +{#
    #} +{# #} +{# #} +{#
    #} +{# #} +{#
  • #} +{#
    #} +{#
    #} +{#
    #} +{#
    #} +{# 雪之恋和风大福#} +{#
    #} +{#
    #} +{# ¥13.8#} +{#
    #} +{# #} +{#
    #} +{# #} +{#
    #} +{#
  • #} +{#
  • #} +{#
    #} +{#
    #} +{#
    #} +{#
    #} +{# 小优布丁#} +{#
    #} +{#
    #} +{# ¥4.8#} +{#
    #} +{# #} +{#
    #} +{# #} +{#
    #} +{#
  • #} +{#
  • #} +{#
    #} +{#
    #} +{#
    #} +{#
    #} +{# 小优布丁#} +{#
    #} +{#
    #} +{# ¥4.8#} +{#
    #} +{# #} +{#
    #} +{# #} +{#
    #} +{#
  • #} +{#
  • #} +{#
    #} +{#
    #} +{#
    #} +{#
    #} +{# 小优布丁#} +{#
    #} +{#
    #} +{# ¥4.8#} +{#
    #} +{# #} +{#
    #} +{# #} +{#
    #} +{#
  • #} +{#
  • #} +{#
    #} +{#
    #} +{#
    #} +{#
    #} +{# 小优布丁#} +{#
    #} +{#
    #} +{# ¥4.8#} +{#
    #} +{# #} +{#
    #} +{# #} +{#
    #} +{#
  • #} +{#
    #} +{#
    #} +{#
    #} +{# #} +{#
    #} +{# #} +{# #} +{#
    #} +{#
    #} +{#

    甜品

    #} +{#

    每一道甜品都有一个故事

    #} +{#
    #} +{# 桂花糕|#} +{# 奶皮酥|#} +{# 栗子糕 |#} +{# 马卡龙|#} +{# 铜锣烧|#} +{# 豌豆黄#} +{#
    #} +{##} +{#
    #} +{#
    #} +{# #} +{#
    #} +{# #} +{# #} +{# #} +{#
    #} +{# #} +{#
    #} +{#
    #} +{# 雪之恋和风大福#} +{#
    #} +{#
    #} +{# ¥13.8#} +{#
    #} +{# #} +{#
    #} +{# #} +{#
    #} +{##} +{#
  • #} +{#
    #} +{#
    #} +{#
    #} +{#
    #} +{# 小优布丁#} +{#
    #} +{#
    #} +{# ¥4.8#} +{#
    #} +{# #} +{#
    #} +{# #} +{#
    #} +{#
  • #} +{#
  • #} +{#
    #} +{#
    #} +{#
    #} +{#
    #} +{# 小优布丁#} +{#
    #} +{#
    #} +{# ¥4.8#} +{#
    #} +{# #} +{#
    #} +{# #} +{#
    #} +{#
  • #} +{#
  • #} +{#
    #} +{#
    #} +{#
    #} +{#
    #} +{# 小优布丁#} +{#
    #} +{#
    #} +{# ¥4.8#} +{#
    #} +{# #} +{#
    #} +{# #} +{#
    #} +{#
  • #} +{#
  • #} +{#
    #} +{#
    #} +{#
    #} +{#
    #} +{# 小优布丁#} +{#
    #} +{#
    #} +{# ¥4.8#} +{#
    #} +{# #} +{#
    #} +{# #} +{#
    #} +{#
  • #} +{#
  • #} +{#
    #} +{#
    #} +{#
    #} +{#
    #} +{# 小优布丁#} +{#
    #} +{#
    #} +{# ¥4.8#} +{#
    #} +{# #} +{#
    #} +{# #} +{#
    #} +{#
  • #} +{#
    #} +{#
    #} +{#
    #} +{#
    #} +{##} +{# #} +{#
    #} +{#
    #} +{#

    坚果

    #} +{#

    酥酥脆脆,回味无穷

    #} +{#
    #} +{# 腰果|#} +{# 松子|#} +{# 夏威夷果 |#} +{# 碧根果|#} +{# 开心果|#} +{# 核桃仁#} +{#
    #} +{#
    #} +{#
    #} +{#
    #} +{# #} +{# #} +{#
    #} +{# #} +{#
    #} +{#
    #} +{# 雪之恋和风大福#} +{#
    #} +{#
    #} +{# ¥13.8#} +{#
    #} +{# #} +{#
    #} +{# #} +{# #} +{#
    #} +{# #} +{#
  • #} +{#
    #} +{#
    #} +{#
    #} +{#
    #} +{# 雪之恋和风大福#} +{#
    #} +{#
    #} +{# ¥13.8#} +{#
    #} +{# #} +{#
    #} +{# #} +{#
    #} +{#
  • #} +{#
  • #} +{#
    #} +{#
    #} +{#
    #} +{#
    #} +{# 小优布丁#} +{#
    #} +{#
    #} +{# ¥4.8#} +{#
    #} +{# #} +{#
    #} +{# #} +{#
    #} +{#
  • #} +{#
  • #} +{#
    #} +{#
    #} +{#
    #} +{#
    #} +{# 小优布丁#} +{#
    #} +{#
    #} +{# ¥4.8#} +{#
    #} +{# #} +{#
    #} +{# #} +{#
    #} +{#
  • #} +{#
  • #} +{#
    #} +{#
    #} +{#
    #} +{#
    #} +{# 小优布丁#} +{#
    #} +{#
    #} +{# ¥4.8#} +{#
    #} +{# #} +{#
    #} +{# #} +{#
    #} +{#
  • #} +{#
  • #} +{#
    #} +{#
    #} +{#
    #} +{#
    #} +{# 小优布丁#} +{#
    #} +{#
    #} +{# ¥4.8#} +{#
    #} +{# #} +{#
    #} +{# #} +{#
    #} +{#
  • #} +{#
    #} +{#
    #} +{#
    #} + + + + +
    + + + + + + + +
    + + + + + + + +
    + + + +{# 限时秒杀的轮播#} + + {# 限时秒杀倒计时#} + + + + + \ No newline at end of file -- Gitee From f6a00210305da862021117a8a78a4e19e1f5fdbe Mon Sep 17 00:00:00 2001 From: junjiehou <1904318367@qq.com> Date: Mon, 23 Sep 2019 10:02:04 +0800 Subject: [PATCH 11/62] =?UTF-8?q?=E9=A6=96=E9=A1=B5=E7=9A=84=E5=88=86?= =?UTF-8?q?=E7=B1=BB=E5=92=8C=E5=95=86=E5=93=81=E8=AF=A6=E6=83=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Orange_lala/static/css/banner.css | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 Orange_lala/static/css/banner.css diff --git a/Orange_lala/static/css/banner.css b/Orange_lala/static/css/banner.css new file mode 100644 index 0000000..90062d2 --- /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 -- Gitee From 08fb828ad6bb26bdaf3097d3dc4b5df7ff074ea4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=97=A0=E6=80=A8=E6=97=A0=E6=82=94?= <1668030512@qq.com> Date: Mon, 23 Sep 2019 14:14:48 +0800 Subject: [PATCH 12/62] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=BA=86=E7=99=BB?= =?UTF-8?q?=E5=BD=95=E3=80=81=E6=B3=A8=E5=86=8C=E4=BB=A5=E5=8F=8A=E5=AE=89?= =?UTF-8?q?=E5=85=A8=E4=B8=AD=E5=BF=83=E7=9A=84=E4=B8=AA=E4=BA=BA=E8=B5=84?= =?UTF-8?q?=E6=96=99=E7=9A=84=E6=B7=BB=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Orange_lala/Orange_lala/settings.py | 44 ++- .../home/Encrypt_with_password/__init__.py | 0 .../Encrypt_with_password/zhi_password_Md5.py | 49 +++ Orange_lala/home/ask/__init__.py | 0 Orange_lala/home/ask/aliyunsms.py | 62 ++++ Orange_lala/home/random_username.py | 26 ++ Orange_lala/home/restful.py | 38 ++ Orange_lala/home/urls.py | 35 +- Orange_lala/home/views.py | 270 ++++++++++++-- Orange_lala/oneself/Send/__init__.py | 0 Orange_lala/oneself/Send/send_emial.py | 23 ++ .../oneself/migrations/0001_initial.py | 324 +++++++++++++---- Orange_lala/oneself/models.py | 223 +++++------- Orange_lala/oneself/urls.py | 63 ++-- Orange_lala/oneself/views.py | 223 +++++++++++- Orange_lala/templates/home/header.html | 67 ++++ Orange_lala/templates/home/home3.html | 48 +-- Orange_lala/templates/home/login.html | 13 +- Orange_lala/templates/home/register.html | 137 +++++++- Orange_lala/templates/person/bindphone.html | 331 +++++++++++++----- Orange_lala/templates/person/email.html | 184 ++++++---- Orange_lala/templates/person/index.html | 11 +- Orange_lala/templates/person/information.html | 266 +++++++------- Orange_lala/templates/person/password.html | 13 +- Orange_lala/templates/person/question.html | 100 ++---- Orange_lala/templates/person/safety.html | 64 +++- Orange_lala/templates/person/setpay.html | 200 +++++++---- Orange_lala/templates/person/top.html | 12 +- 28 files changed, 1965 insertions(+), 861 deletions(-) create mode 100644 Orange_lala/home/Encrypt_with_password/__init__.py create mode 100644 Orange_lala/home/Encrypt_with_password/zhi_password_Md5.py create mode 100644 Orange_lala/home/ask/__init__.py create mode 100644 Orange_lala/home/ask/aliyunsms.py create mode 100644 Orange_lala/home/random_username.py create mode 100644 Orange_lala/home/restful.py create mode 100644 Orange_lala/oneself/Send/__init__.py create mode 100644 Orange_lala/oneself/Send/send_emial.py create mode 100644 Orange_lala/templates/home/header.html diff --git a/Orange_lala/Orange_lala/settings.py b/Orange_lala/Orange_lala/settings.py index 226c79b..7ae3438 100644 --- a/Orange_lala/Orange_lala/settings.py +++ b/Orange_lala/Orange_lala/settings.py @@ -92,19 +92,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 +132,34 @@ 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://127.0.0.1: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,否则发送不成功 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 0000000..e69de29 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 0000000..22a3a5d --- /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/ask/__init__.py b/Orange_lala/home/ask/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/Orange_lala/home/ask/aliyunsms.py b/Orange_lala/home/ask/aliyunsms.py new file mode 100644 index 0000000..b3ce8e3 --- /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/random_username.py b/Orange_lala/home/random_username.py new file mode 100644 index 0000000..87fdb51 --- /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 0000000..5e0f1a4 --- /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/urls.py b/Orange_lala/home/urls.py index f7b75dc..8c6d169 100644 --- a/Orange_lala/home/urls.py +++ b/Orange_lala/home/urls.py @@ -1,21 +1,26 @@ from django.urls import path from home import views -from django.conf.urls import url +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('', views.homepage, name='homepage'), - path('register/', views.register, name='register'), - path('login/', views.login, name='login'), - path('sort/', views.sort, name='sort'), + 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('introduction/', views.introduction, name='introduction'), - path('introduction_handle/', views.introduction_handle, name='introduction_handle'), - # path('introduction_handle/', views.introduction_handle, name='introduction_handle'), - path('province/', views.province, name='province'), #省 直辖市 - url(r'^city_(\d+)/$', views.city, name='city'), #城市 区 - url(r'^county_(\d+)/$', views.county, name='county'), #县 - path('search/', views.search, name='search'), - path('shopcart/', views.shopcart, name='shopcart'), - path('pay/', views.pay, name='pay'), - path('success/', views.success, name='success'), -] \ No newline at end of file + 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('success/', views.success, name='success'), # 支付成功 +] diff --git a/Orange_lala/home/views.py b/Orange_lala/home/views.py index 0d9bb7c..d786de0 100644 --- a/Orange_lala/home/views.py +++ b/Orange_lala/home/views.py @@ -3,41 +3,261 @@ 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.core.cache import cache +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): - 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 + 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) + - 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") + 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 login(request): - 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) + elif re.match(r'^1[35678]\d{9}$',account): + user=User.objects.get(phone=account) + else: + user = User.objects.get(username=account) + except User.DoesNotExist: + return None + return user +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=====",username) + 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): + response = redirect(reverse('home:homepage')) + response.delete_cookie('username') + logout(request) + return response + #全部分类 def sort(request): diff --git a/Orange_lala/oneself/Send/__init__.py b/Orange_lala/oneself/Send/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/Orange_lala/oneself/Send/send_emial.py b/Orange_lala/oneself/Send/send_emial.py new file mode 100644 index 0000000..6e5afb4 --- /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/migrations/0001_initial.py b/Orange_lala/oneself/migrations/0001_initial.py index a249179..d1e2a58 100644 --- a/Orange_lala/oneself/migrations/0001_initial.py +++ b/Orange_lala/oneself/migrations/0001_initial.py @@ -1,4 +1,4 @@ -# Generated by Django 2.1.3 on 2019-09-10 00:20 +# Generated by Django 2.2.4 on 2019-09-23 03:19 from django.conf import settings import django.contrib.auth.models @@ -13,7 +13,7 @@ class Migration(migrations.Migration): initial = True dependencies = [ - ('auth', '0012_auto_20190730_0914'), + ('auth', '0011_update_proxy_permissions'), ] operations = [ @@ -31,17 +31,18 @@ class Migration(migrations.Migration): ('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='身份证号')), + ('nickname', models.CharField(blank=True, max_length=255, null=True)), + ('sex', models.CharField(blank=True, max_length=8, null=True)), + ('name', models.CharField(blank=True, max_length=255, null=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': '用户表', + 'verbose_name': '用户', + 'verbose_name_plural': '用户', 'db_table': 'user', }, managers=[ @@ -53,127 +54,322 @@ 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='UserAddress', + name='OneselfQuestionsafety', 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=225, unique=True)), ], options={ - 'verbose_name': '收货地址表', - 'db_table': 'user_address', + '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)), + ('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='SafetyAccount', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('question', models.CharField(max_length=255)), + ], + options={ + '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='UserAddress', + fields=[ + ('id', models.IntegerField(primary_key=True, serialize=False)), + ('useraddress', models.CharField(max_length=255)), + ('user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), + ], + options={ + 'db_table': 'user_address', + '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/models.py b/Orange_lala/oneself/models.py index 401c8b0..d82e967 100644 --- a/Orange_lala/oneself/models.py +++ b/Orange_lala/oneself/models.py @@ -5,21 +5,23 @@ # * 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 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.DO_NOTHING, 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) class Meta: - managed = False + managed = True db_table = 'adress' @@ -30,39 +32,10 @@ class AllTrade(models.Model): words = models.CharField(max_length=255, blank=True, null=True) class Meta: - managed = False + managed = True db_table = 'all_trade' -class AuthGroup(models.Model): - name = models.CharField(unique=True, max_length=80) - - class Meta: - managed = False - db_table = 'auth_group' - - -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 Meta: - managed = False - db_table = 'auth_permission' - unique_together = (('content_type', 'codename'),) - - class BaseArea(models.Model): base_areaid = models.AutoField(primary_key=True) name = models.CharField(max_length=50) @@ -70,7 +43,7 @@ class BaseArea(models.Model): vieworder = models.PositiveSmallIntegerField() class Meta: - managed = False + managed = True db_table = 'base_area' @@ -78,80 +51,37 @@ 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 Collection(models.Model): - user = models.ForeignKey('User', models.DO_NOTHING, blank=True, null=True) - good = models.ForeignKey('Goods', models.DO_NOTHING, blank=True, null=True) + user = models.ForeignKey('User', models.CASCADE, blank=True, null=True) + good = models.ForeignKey('Goods', models.CASCADE, blank=True, null=True) class Meta: - managed = False + managed = True db_table = 'collection' class Comments(models.Model): - user = models.ForeignKey('User', models.DO_NOTHING, blank=True, null=True) - good = models.ForeignKey('Goods', models.DO_NOTHING, blank=True, null=True) + 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 + managed = True db_table = 'comments' -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 Meta: - managed = False - db_table = 'django_content_type' - unique_together = (('app_label', 'model'),) - - -class DjangoMigrations(models.Model): - app = models.CharField(max_length=255) - name = models.CharField(max_length=255) - applied = models.DateTimeField() - - class Meta: - managed = False - db_table = 'django_migrations' - - -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' @@ -172,23 +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' @@ -198,26 +128,26 @@ 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.DO_NOTHING, blank=True, null=True) + goods = models.ForeignKey(Goods, models.CASCADE, blank=True, null=True) assistant = models.IntegerField(blank=True, null=True) class Meta: - managed = False + managed = True db_table = 'images' class NewUser(models.Model): - news = models.ForeignKey('News', models.DO_NOTHING, blank=True, null=True) - user = models.ForeignKey('User', models.DO_NOTHING, blank=True, null=True) + news = models.ForeignKey('News', models.CASCADE, blank=True, null=True) + user = models.ForeignKey('User', models.CASCADE, blank=True, null=True) class Meta: - managed = False + managed = True db_table = 'new_user' @@ -227,12 +157,48 @@ class News(models.Model): new_title = models.CharField(max_length=255, blank=True, null=True) class Meta: - managed = False + 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.DO_NOTHING, blank=True, null=True) + 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) @@ -241,18 +207,18 @@ class Order(models.Model): recive_time = models.CharField(max_length=255, blank=True, null=True) class Meta: - managed = False + managed = True db_table = 'order' class OrderGood(models.Model): - order = models.ForeignKey(Order, models.DO_NOTHING, blank=True, null=True) - good = models.ForeignKey(Goods, models.DO_NOTHING, blank=True, null=True) + 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 = False + managed = True db_table = 'order_good' @@ -260,79 +226,54 @@ class SafetyAccount(models.Model): question = models.CharField(max_length=255) class Meta: - managed = False + managed = True db_table = 'safety_account' class Shopcart(models.Model): - good = models.ForeignKey(Goods, models.DO_NOTHING, blank=True, null=True) - user = models.ForeignKey('User', models.DO_NOTHING, blank=True, null=True) + 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, 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, blank=True, null=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) +class User(AbstractUser): nickname = models.CharField(max_length=255, blank=True, null=True) sex = models.CharField(max_length=8, blank=True, null=True) name = models.CharField(max_length=255, blank=True, null=True) - phone = models.CharField(max_length=11, blank=True, null=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.DO_NOTHING, blank=True, null=True) + member = models.ForeignKey('UserMenber', models.CASCADE, blank=True, null=True,default=1) class Meta: - managed = False db_table = 'user' + verbose_name = '用户' + verbose_name_plural = verbose_name class UserAddress(models.Model): id = models.IntegerField(primary_key=True) useraddress = models.CharField(max_length=255) - user = models.ForeignKey(User, models.DO_NOTHING, blank=True, null=True) + user = models.ForeignKey('User', models.CASCADE, blank=True, null=True) class Meta: - managed = False + managed = True db_table = 'user_address' -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 1eedae3..57b3139 100644 --- a/Orange_lala/oneself/urls.py +++ b/Orange_lala/oneself/urls.py @@ -1,33 +1,42 @@ +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('', views.myself_index, name='index'), - path('myself_information/', views.myself_information, name='myself_information'), - path('myself_safety/', views.myself_safety, name='myself_safety'), - path('myself_setpay/', views.myself_setpay, name='myself_setpay'), - path('myself_password/', views.myself_password, name='myself_password'), - path('myself_bindphone/', views.myself_bindphone, name='myself_bindphone'), - path('myself_email/', views.myself_email, name='myself_email'), - path('myself_idcard/', views.myself_idcard, name='myself_idcard'), - path('myself_question/', views.myself_question, name='myself_question'), - path('address/', views.myself_address, name='address'), - path('myself_order/', views.myself_order, name='myself_order'), - path('myself_orderinfo/', views.myself_orderinfo, name='myself_orderinfo'), - path('myself_refund/', views.myself_refund, name='myself_refund'), - path('myself_logistics/', views.myself_logistics, name='myself_logistics'), - path('myself_commentlist/', views.myself_commentlist, name='myself_commentlist'), - path('myself_change/', views.myself_change, name='myself_change'), - path('myself_record/', views.myself_record, name='myself_record'), - path('myself_coupon/', views.myself_coupon, name='myself_coupon'), - path('myself_bonus/', views.myself_bonus, name='myself_bonus'), - path('myself_bill/', views.myself_bill, name='myself_bill'), - path('myself_billlist/', views.myself_billlist, name='myself_billlist'), - path('myself_collection/', views.myself_collection, name='myself_collection'), - path('myself_foot/', views.myself_foot, name='myself_foot'), - path('myself_comment/', views.myself_comment, name='myself_comment'), - path('myself_news/', views.myself_news, name='myself_news'), - path('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('myself_order/', login_required(views.myself_order), name='myself_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 cc0be06..51cb990 100644 --- a/Orange_lala/oneself/views.py +++ b/Orange_lala/oneself/views.py @@ -1,44 +1,249 @@ -from django.shortcuts import render +import json +from django.conf import settings +from django.shortcuts import render,HttpResponse + +from django.http.response import JsonResponse +from oneself.models import User,UserMenber +from django.contrib.auth import authenticate +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 OneselfQuestionsafety,OneselfQuestionsafetytwo,OneselfSafetyanswer,OneselfSafetyanswertwo +# from home.Encrypt_with_password.zhi_password_Md5 import Encrypt # Create your views here. #个人中心 def myself_index(request): - - return render(request, "person/index.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/index.html",{"member":member}) #个人资料 #个人信息 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=username + user.name=name + user.sex=sex + user.birth=birth + user.phone=phone + user.email=email + user.save() + member_id = User.objects.get(username=username).member_id + user = User.objects.filter(username=username).all() + member = UserMenber.objects.get(id=member_id).rember + return render(request,'person/information.html',{"success":"修改资料成功","member": member,"user1111":user}) #安全设置 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]): + print("user===/////==",user) + return render(request,'person/password.html',{"bai":"请您把信息填写完整"}) + if npwd!=ncpwd: + print('两次输入的密码不一致') + return render(request, 'person/password.html', {"bai": "两次输入的新密码不一致"}) + else: + 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() + return render(request, "person/password.html",{"bai":"密码修改成功"}) #绑定手机 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): diff --git a/Orange_lala/templates/home/header.html b/Orange_lala/templates/home/header.html new file mode 100644 index 0000000..af65f23 --- /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/home3.html b/Orange_lala/templates/home/home3.html index ab77d30..7ed05c8 100644 --- a/Orange_lala/templates/home/home3.html +++ b/Orange_lala/templates/home/home3.html @@ -72,53 +72,7 @@ -
    - -
    - - -
    - - - - - -
    -
    - +{% include "home/header.html" %}
    diff --git a/Orange_lala/templates/home/login.html b/Orange_lala/templates/home/login.html index 4bfe1a2..a38eab6 100644 --- a/Orange_lala/templates/home/login.html +++ b/Orange_lala/templates/home/login.html @@ -31,27 +31,30 @@
    diff --git a/Orange_lala/templates/home/register.html b/Orange_lala/templates/home/register.html index d7793c0..aa2803a 100644 --- a/Orange_lala/templates/home/register.html +++ b/Orange_lala/templates/home/register.html @@ -1,7 +1,6 @@ -{% load static %} - + {% load static %} 注册 @@ -15,7 +14,106 @@ + + @@ -37,57 +135,59 @@
    -
    + {% csrf_token %}
    - +
    - + +
    - +
    -

    点击同意商城《服务协议》

    +

    点击同意商城《服务协议》

    + {{ error_msg }}
    -
    + + {% csrf_token %}
    - +
    - - - 获取 + + 获取验证码 +
    - +
    - +
    -{# #} +

    点击同意商城《服务协议》

    + {{ error_msg1 }}

    @@ -114,7 +214,7 @@ | 支付宝 | - 物流 + 物流

    +
    \ No newline at end of file diff --git a/Orange_lala/templates/person/bindphone.html b/Orange_lala/templates/person/bindphone.html index 4110afe..a24f7b3 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/email.html b/Orange_lala/templates/person/email.html index 4a66c2d..be759d1 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/index.html b/Orange_lala/templates/person/index.html index 275ba22..ea845fc 100644 --- a/Orange_lala/templates/person/index.html +++ b/Orange_lala/templates/person/index.html @@ -82,7 +82,7 @@ {# #} {# #} {% include 'person/top.html' %} - +{#{% include 'home/header.html' %}#}
    @@ -96,9 +96,14 @@ - (小叮当) + {% if user.is_authenticated %} + ({{ user.username }}) + {% else %} + 请登录!! + {% endif %}
    - 会员福利
    + 会员福利 +
    diff --git a/Orange_lala/templates/person/information.html b/Orange_lala/templates/person/information.html index 5fea390..052dae9 100644 --- a/Orange_lala/templates/person/information.html +++ b/Orange_lala/templates/person/information.html @@ -1,9 +1,10 @@ - - + + {% load static %} -{# #} - + + + 个人资料 @@ -13,10 +14,12 @@ + -{% include 'person/top.html' %} + + {% include 'person/top.html' %}
    @@ -27,7 +30,7 @@
    个人资料 / Personal information

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

    头像

    -
    -
    用户名:小叮当
    -
    - - 铜牌会员 - -
    - -
    +
    +
    用户名:{{ user.username }}
    +
    + + {{ member }} + +
    + +
    + {% else %} +
    +
    用户名:请登录!!
    +
    + + 用户等级 + +
    + +
    + {% endif %}
    -
    - -
    - -
    - - -
    -
    - + + {% csrf_token %} + {% if user.is_authenticated %} +
    + +
    + +
    +
    + {% else %} +
    + +
    + +
    +
    + {% endif %}
    - +
    @@ -78,67 +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 %}
    @@ -166,75 +202,10 @@
    -
    保存修改
    +
    - + {{ success }} -
    @@ -308,6 +279,7 @@
    - + + \ No newline at end of file diff --git a/Orange_lala/templates/person/password.html b/Orange_lala/templates/person/password.html index 47362f3..c25651b 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 b310a01..9693d67 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 634820f..5878583 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 329c072..b84b0df 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 9cabf22..5ace009 100644 --- a/Orange_lala/templates/person/top.html +++ b/Orange_lala/templates/person/top.html @@ -11,15 +11,21 @@
    -
    +
    {# 限时秒杀的轮播#} {# 限时秒杀倒计时#} {# 搜索框#} \ No newline at end of file diff --git a/Orange_lala/templates/home/home3.html b/Orange_lala/templates/home/home3.html index 7ed05c8..fd8fd61 100644 --- a/Orange_lala/templates/home/home3.html +++ b/Orange_lala/templates/home/home3.html @@ -10,6 +10,13 @@ {#引入轮播的css#} +{# 搜素框#} + + + + +{#引入轮播的css#} + @@ -51,6 +58,22 @@ top: 785px; position: absolute; } + #time{ + left: 1080px; + top: 785px; + position: absolute; + } + .lvse{ + position: absolute; + width: 245px; + height: 270px; + } + .time_title{ + color: red; + left: 950px; + top: 785px; + position: absolute; + } #time{ left: 1080px; top: 785px; @@ -72,11 +95,60 @@ +
    + +
    + + +
    + + + + + +
    +
    + {% include "home/header.html" %}
    + +
    全部分类
    - +
    @@ -130,7 +202,7 @@ {% if foo.all_trade.id == a.id %}
    {{ foo.good_class_name }}
    - {% for good in goodss %} + {% for good in goods %} {% if good.good_class.id == foo.id %}
    {#
    {{ good.name }}
    #} @@ -198,7 +270,7 @@
    - +
  • @@ -206,7 +278,7 @@
  • -
    +
    - + - - - + + + +{# 限时秒杀的轮播#} + + {# 限时秒杀倒计时#} + + +{# 搜索框#} + + {# 限时秒杀的轮播#} - - -{# 限时秒杀的轮播#} - - {# 限时秒杀倒计时#} - - -{# 搜索框#} - - -{# 限时秒杀的轮播#} - - {# 限时秒杀倒计时#} - - - - - \ No newline at end of file -- Gitee From ce10dd623159d05bdb8df7c999cddfa7bbc81ee2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=97=A0=E6=80=A8=E6=97=A0=E6=82=94?= <1668030512@qq.com> Date: Mon, 23 Sep 2019 16:44:47 +0800 Subject: [PATCH 17/62] =?UTF-8?q?=E5=BE=80dev=E5=88=86=E6=94=AF=E6=8F=90?= =?UTF-8?q?=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Orange_lala/Orange_lala/settings.py | 11 - .../home/Encrypt_with_password/__init__.py | 0 .../Encrypt_with_password/zhi_password_Md5.py | 49 +++ Orange_lala/home/ask/__init__.py | 0 Orange_lala/home/ask/aliyunsms.py | 62 +++ Orange_lala/home/random_username.py | 26 ++ Orange_lala/home/restful.py | 38 ++ Orange_lala/home/urls.py | 10 - Orange_lala/oneself/models.py | 229 ++++------ Orange_lala/templates/home/home3.html | 415 +++++------------- 10 files changed, 365 insertions(+), 475 deletions(-) create mode 100644 Orange_lala/home/Encrypt_with_password/__init__.py create mode 100644 Orange_lala/home/Encrypt_with_password/zhi_password_Md5.py create mode 100644 Orange_lala/home/ask/__init__.py create mode 100644 Orange_lala/home/ask/aliyunsms.py create mode 100644 Orange_lala/home/random_username.py create mode 100644 Orange_lala/home/restful.py diff --git a/Orange_lala/Orange_lala/settings.py b/Orange_lala/Orange_lala/settings.py index becf504..7ae3438 100644 --- a/Orange_lala/Orange_lala/settings.py +++ b/Orange_lala/Orange_lala/settings.py @@ -92,17 +92,6 @@ 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 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 0000000..e69de29 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 0000000..22a3a5d --- /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/ask/__init__.py b/Orange_lala/home/ask/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/Orange_lala/home/ask/aliyunsms.py b/Orange_lala/home/ask/aliyunsms.py new file mode 100644 index 0000000..b3ce8e3 --- /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/random_username.py b/Orange_lala/home/random_username.py new file mode 100644 index 0000000..87fdb51 --- /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 0000000..5e0f1a4 --- /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/urls.py b/Orange_lala/home/urls.py index e3ff21a..8c6d169 100644 --- a/Orange_lala/home/urls.py +++ b/Orange_lala/home/urls.py @@ -1,6 +1,5 @@ from django.urls import path from home import views -from django.conf.urls import url from django.urls import path from django.contrib.auth.decorators import login_required from home import views @@ -19,15 +18,6 @@ urlpatterns = [ path('logout/', views.my_logout, name='logout'), # 退出登录 path('sort/', views.sort, name='sort'),# 全部商品分类 # path('introduction/', views.introduction, name='introduction'), - path('introduction_handle/', views.introduction_handle, name='introduction_handle'), - # path('introduction_handle/', views.introduction_handle, name='introduction_handle'), - path('province/', views.province, name='province'), #省 直辖市 - url(r'^city_(\d+)/$', views.city, name='city'), #城市 区 - url(r'^county_(\d+)/$', views.county, name='county'), #县 - path('search/', views.search, name='search'), - path('shopcart/', views.shopcart, name='shopcart'), - path('pay/', views.pay, name='pay'), - path('success/', views.success, name='success'), path('introduction_handle/', views.introduction_handle, name='introduction_handle'),# 商品详情 path('search/', views.search, name='search'), # 搜索 path('shopcart/', views.shopcart, name='shopcart'),# 购物车 diff --git a/Orange_lala/oneself/models.py b/Orange_lala/oneself/models.py index 1a04857..d82e967 100644 --- a/Orange_lala/oneself/models.py +++ b/Orange_lala/oneself/models.py @@ -5,21 +5,23 @@ # * 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 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.DO_NOTHING, 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) class Meta: - managed = False + managed = True db_table = 'adress' @@ -30,39 +32,10 @@ class AllTrade(models.Model): words = models.CharField(max_length=255, blank=True, null=True) class Meta: - managed = False + managed = True db_table = 'all_trade' -class AuthGroup(models.Model): - name = models.CharField(unique=True, max_length=150) - - class Meta: - managed = False - db_table = 'auth_group' - - -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 Meta: - managed = False - db_table = 'auth_permission' - unique_together = (('content_type', 'codename'),) - - class BaseArea(models.Model): base_areaid = models.AutoField(primary_key=True) name = models.CharField(max_length=50) @@ -70,7 +43,7 @@ class BaseArea(models.Model): vieworder = models.PositiveSmallIntegerField() class Meta: - managed = False + managed = True db_table = 'base_area' @@ -78,80 +51,37 @@ 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 Collection(models.Model): - user = models.ForeignKey('User', models.DO_NOTHING, blank=True, null=True) - good = models.ForeignKey('Goods', models.DO_NOTHING, blank=True, null=True) + user = models.ForeignKey('User', models.CASCADE, blank=True, null=True) + good = models.ForeignKey('Goods', models.CASCADE, blank=True, null=True) class Meta: - managed = False + managed = True db_table = 'collection' class Comments(models.Model): - user = models.ForeignKey('User', models.DO_NOTHING, blank=True, null=True) - good = models.ForeignKey('Goods', models.DO_NOTHING, blank=True, null=True) + 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 + managed = True db_table = 'comments' -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 Meta: - managed = False - db_table = 'django_content_type' - unique_together = (('app_label', 'model'),) - - -class DjangoMigrations(models.Model): - app = models.CharField(max_length=255) - name = models.CharField(max_length=255) - applied = models.DateTimeField() - - class Meta: - managed = False - db_table = 'django_migrations' - - -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' @@ -172,23 +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' @@ -198,26 +128,26 @@ 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.DO_NOTHING, blank=True, null=True) + goods = models.ForeignKey(Goods, models.CASCADE, blank=True, null=True) assistant = models.IntegerField(blank=True, null=True) class Meta: - managed = False + managed = True db_table = 'images' class NewUser(models.Model): - news = models.ForeignKey('News', models.DO_NOTHING, blank=True, null=True) - user = models.ForeignKey('User', models.DO_NOTHING, blank=True, null=True) + news = models.ForeignKey('News', models.CASCADE, blank=True, null=True) + user = models.ForeignKey('User', models.CASCADE, blank=True, null=True) class Meta: - managed = False + managed = True db_table = 'new_user' @@ -227,12 +157,48 @@ class News(models.Model): new_title = models.CharField(max_length=255, blank=True, null=True) class Meta: - managed = False + 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.DO_NOTHING, blank=True, null=True) + 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) @@ -241,90 +207,73 @@ class Order(models.Model): recive_time = models.CharField(max_length=255, blank=True, null=True) class Meta: - managed = False + managed = True db_table = 'order' class OrderGood(models.Model): - order = models.ForeignKey(Order, models.DO_NOTHING, blank=True, null=True) - good = models.ForeignKey(Goods, models.DO_NOTHING, blank=True, null=True) + 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 = False + 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 = models.ForeignKey(Goods, models.DO_NOTHING, blank=True, null=True) - user = models.ForeignKey('User', models.DO_NOTHING, blank=True, null=True) + 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, 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, blank=True, null=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) +class User(AbstractUser): nickname = models.CharField(max_length=255, blank=True, null=True) sex = models.CharField(max_length=8, blank=True, null=True) name = models.CharField(max_length=255, blank=True, null=True) - phone = models.CharField(max_length=11, blank=True, null=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.DO_NOTHING, blank=True, null=True) + member = models.ForeignKey('UserMenber', models.CASCADE, blank=True, null=True,default=1) class Meta: - managed = False db_table = 'user' + verbose_name = '用户' + verbose_name_plural = verbose_name class UserAddress(models.Model): id = models.IntegerField(primary_key=True) useraddress = models.CharField(max_length=255) - user = models.ForeignKey(User, models.DO_NOTHING, blank=True, null=True) + user = models.ForeignKey('User', models.CASCADE, blank=True, null=True) class Meta: - managed = False + managed = True db_table = 'user_address' -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/templates/home/home3.html b/Orange_lala/templates/home/home3.html index 27d83e6..7ed05c8 100644 --- a/Orange_lala/templates/home/home3.html +++ b/Orange_lala/templates/home/home3.html @@ -10,13 +10,6 @@ {#引入轮播的css#} -{# 搜素框#} - - - - -{#引入轮播的css#} - @@ -58,22 +51,6 @@ top: 785px; position: absolute; } - #time{ - left: 1080px; - top: 785px; - position: absolute; - } - .lvse{ - position: absolute; - width: 245px; - height: 270px; - } - .time_title{ - color: red; - left: 950px; - top: 785px; - position: absolute; - } #time{ left: 1080px; top: 785px; @@ -95,60 +72,11 @@ -
    - -
    - - -
    - - - - - -
    -
    - {% include "home/header.html" %}
    - + - -
    全部分类
    - +
    @@ -202,7 +130,7 @@ {% if foo.all_trade.id == a.id %}
    {{ foo.good_class_name }}
    - {% for good in goods %} + {% for good in goodss %} {% if good.good_class.id == foo.id %}
    {#
    {{ good.name }}
    #} @@ -270,7 +198,7 @@
    - +
  • @@ -278,7 +206,7 @@
  • -
    +
    - + - - - + + + + + +{# 限时秒杀的轮播#} + + {# 限时秒杀倒计时#} + + + + + \ No newline at end of file -- Gitee From c01d8fed3a2f61988e1c1ef226ca7ffe3e6be3b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=97=A0=E6=80=A8=E6=97=A0=E6=82=94?= <1668030512@qq.com> Date: Mon, 23 Sep 2019 16:57:35 +0800 Subject: [PATCH 18/62] =?UTF-8?q?=E5=BE=80dev=E5=88=86=E6=94=AF=E6=8F=90?= =?UTF-8?q?=E4=BA=A4=EF=BC=8C=E6=B7=BB=E5=8A=A0=E4=BA=86=E5=BF=85=E9=A1=BB?= =?UTF-8?q?=E7=99=BB=E5=BD=95=E6=89=8D=E8=83=BD=E8=AE=BF=E9=97=AE=E7=9A=84?= =?UTF-8?q?=E9=99=90=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Orange_lala/Orange_lala/urls.py | 1 + 1 file changed, 1 insertion(+) diff --git a/Orange_lala/Orange_lala/urls.py b/Orange_lala/Orange_lala/urls.py index 9e43977..1e40281 100644 --- a/Orange_lala/Orange_lala/urls.py +++ b/Orange_lala/Orange_lala/urls.py @@ -22,4 +22,5 @@ urlpatterns = [ path('myself/', include('oneself.urls')), path('home/', include('home.urls')), path('', views.homepage, name='home'), + path('accounts/login/', views.login_handle), ] -- Gitee From 789d52a1db6dbf2700c419f5dc61ccefce266a23 Mon Sep 17 00:00:00 2001 From: junjiehou <1904318367@qq.com> Date: Mon, 23 Sep 2019 19:24:49 +0800 Subject: [PATCH 19/62] =?UTF-8?q?=E7=9C=81=E5=B8=82=E5=8E=BF=E8=B7=AF?= =?UTF-8?q?=E7=94=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .idea/Orange_lala_8.iml | 19 +++++++++++++++++++ .idea/misc.xml | 7 +++++++ .idea/modules.xml | 8 ++++++++ .idea/vcs.xml | 6 ++++++ 4 files changed, 40 insertions(+) create mode 100644 .idea/Orange_lala_8.iml create mode 100644 .idea/misc.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/vcs.xml diff --git a/.idea/Orange_lala_8.iml b/.idea/Orange_lala_8.iml new file mode 100644 index 0000000..ef3a7c5 --- /dev/null +++ b/.idea/Orange_lala_8.iml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..7390deb --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,7 @@ + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..c779272 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file -- Gitee From ca06d99bbab9655f76fe82da26be23c9383a8401 Mon Sep 17 00:00:00 2001 From: junjiehou <1904318367@qq.com> Date: Mon, 23 Sep 2019 19:41:01 +0800 Subject: [PATCH 20/62] =?UTF-8?q?=E7=9C=81=E5=B8=82=E5=8E=BF=E8=B7=AF?= =?UTF-8?q?=E7=94=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../home/Encrypt_with_password/zhi_password_Md5.py | 2 +- Orange_lala/home/urls.py | 4 ++++ Orange_lala/templates/home/introduction.html | 10 +++++----- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/Orange_lala/home/Encrypt_with_password/zhi_password_Md5.py b/Orange_lala/home/Encrypt_with_password/zhi_password_Md5.py index 22a3a5d..3f6dd72 100644 --- a/Orange_lala/home/Encrypt_with_password/zhi_password_Md5.py +++ b/Orange_lala/home/Encrypt_with_password/zhi_password_Md5.py @@ -46,4 +46,4 @@ class Random_Email(object): return S info=Random_Email().ran() -print(info) \ No newline at end of file +# print(info) \ No newline at end of file diff --git a/Orange_lala/home/urls.py b/Orange_lala/home/urls.py index 8c6d169..8d11aa0 100644 --- a/Orange_lala/home/urls.py +++ b/Orange_lala/home/urls.py @@ -1,3 +1,4 @@ +from django.conf.urls import url from django.urls import path from home import views from django.urls import path @@ -17,6 +18,9 @@ urlpatterns = [ 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'), # 搜索 diff --git a/Orange_lala/templates/home/introduction.html b/Orange_lala/templates/home/introduction.html index 0f45139..35f24cc 100644 --- a/Orange_lala/templates/home/introduction.html +++ b/Orange_lala/templates/home/introduction.html @@ -213,7 +213,7 @@ {% for good in goods %}
  • 促销价
    -
    ¥--
    +
    ¥{{ good.prices }}
  • 原价
    @@ -296,9 +296,9 @@
    数量
    - + - +
    全部分类
  • 限时秒杀 距离抢购结束还有: {#
    #} {# 01#} {# 20#} {# 59#} {#
    #} {#
    #}
    {#
    #} {#

    ZEK 原味海苔

    #} {#
    #} {# ¥9.90#} {# 秒杀#} {#
    #} {#
    #}
    {# #} {#
    #} {#
    #} {# #} {#
    #} {#
    #} {#

    ZEK 原味海苔

    #} {#
    9.90#} {# 秒杀#} {#
    #} {#
    #} {#
    #} {# #} {#
    #} {#
    #} {# #} {#
    #} {#
    #} {#

    ZEK 原味海苔

    #} {#
    9.90#} {# 秒杀#} {#
    #} {#
    #} {#
    #} {# #} {#
    #} {#
    #} {# #} {#
    #} {#
    #} {#

    ZEK 原味海苔

    #} {#
    9.90#} {# 秒杀#} {#
    #} {#
    #} {#
    #}
    {% for trade in trades_all %}

    {{ trade.clname }}

    {{ trade.words }}

    {% for good in trade.goods_set.all %} {{ good.name }}| {% endfor %}
    {% for goodclass in trade.goodclass_set.all %} {{ goodclass.good_class_name }} {% endfor %}
    {{ trade.words }}
    {{ trade.words }}
    {{ trade.goodsinfo.0.name }}
    ¥{{ trade.goodsinfo.0.prices }}
  • {{ trade.goodsinfo.1.name }}
    ¥{{ trade.goodsinfo.1.prices }}
  • {{ trade.goodsinfo.2.name }}
    ¥{{ trade.goodsinfo.2.prices }}
  • {{ trade.goodsinfo.3.name }}
    ¥{{ trade.goodsinfo.3.prices }}
  • {{ trade.goodsinfo.4.name }}
    ¥{{ trade.goodsinfo.4.prices }}
  • {{ trade.goodsinfo.5.name }}
    ¥{{ trade.goodsinfo.5.prices }}
  • {% endfor %}
  • 首页
  • 分类
  • 购物车
  • 我的
  • {# 限时秒杀的轮播#} {# 限时秒杀倒计时#} {# 搜索框#} \ No newline at end of file -- Gitee From f1f04324669573a144e8ea9183c917b1c52035fd Mon Sep 17 00:00:00 2001 From: liuyiming <1010652133@qq.com> Date: Tue, 24 Sep 2019 19:16:36 +0800 Subject: [PATCH 28/62] =?UTF-8?q?=E6=90=9C=E7=B4=A2=E6=A1=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Orange_lala/Orange_lala/settings.py | 18 ++ Orange_lala/Orange_lala/urls.py | 1 + Orange_lala/home/search_indexes.py | 30 +++ .../oneself/migrations/0001_initial.py | 240 ++++++++++-------- Orange_lala/templates/home/home3.html | 54 +++- Orange_lala/templates/home/search.html | 56 ++-- .../search/indexes/oneself/goods_text.txt | 5 + .../search/indexes/oneself/images_text.txt | 2 + Orange_lala/templates/search/search.html | 69 +++++ Orange_lala/whoosh_index/MAIN_WRITELOCK | 0 .../whoosh_index/MAIN_r4b8bk52dh9k2r9c.seg | Bin 0 -> 297005 bytes .../whoosh_index/MAIN_uovaz3fwreg5vfe7.seg | Bin 0 -> 1463769 bytes Orange_lala/whoosh_index/_MAIN_2.toc | Bin 0 -> 2280 bytes 13 files changed, 338 insertions(+), 137 deletions(-) create mode 100644 Orange_lala/home/search_indexes.py create mode 100644 Orange_lala/templates/search/indexes/oneself/goods_text.txt create mode 100644 Orange_lala/templates/search/indexes/oneself/images_text.txt create mode 100644 Orange_lala/templates/search/search.html create mode 100644 Orange_lala/whoosh_index/MAIN_WRITELOCK create mode 100644 Orange_lala/whoosh_index/MAIN_r4b8bk52dh9k2r9c.seg create mode 100644 Orange_lala/whoosh_index/MAIN_uovaz3fwreg5vfe7.seg create mode 100644 Orange_lala/whoosh_index/_MAIN_2.toc diff --git a/Orange_lala/Orange_lala/settings.py b/Orange_lala/Orange_lala/settings.py index 68ea991..8ad2063 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' ] @@ -163,3 +164,20 @@ 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 1e40281..adddd07 100644 --- a/Orange_lala/Orange_lala/urls.py +++ b/Orange_lala/Orange_lala/urls.py @@ -19,6 +19,7 @@ from home import views urlpatterns = [ path('admin/', admin.site.urls), + path('search/', include('haystack.urls')), # 全文检索框架 path('myself/', include('oneself.urls')), path('home/', include('home.urls')), path('', views.homepage, name='home'), diff --git a/Orange_lala/home/search_indexes.py b/Orange_lala/home/search_indexes.py new file mode 100644 index 0000000..82ac396 --- /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/oneself/migrations/0001_initial.py b/Orange_lala/oneself/migrations/0001_initial.py index d1e2a58..2692d6d 100644 --- a/Orange_lala/oneself/migrations/0001_initial.py +++ b/Orange_lala/oneself/migrations/0001_initial.py @@ -1,4 +1,4 @@ -# Generated by Django 2.2.4 on 2019-09-23 03:19 +# Generated by Django 2.1.8 on 2019-09-24 09:25 from django.conf import settings import django.contrib.auth.models @@ -13,7 +13,7 @@ class Migration(migrations.Migration): initial = True dependencies = [ - ('auth', '0011_update_proxy_permissions'), + ('auth', '0009_alter_user_last_name_max_length'), ] operations = [ @@ -49,6 +49,24 @@ class Migration(migrations.Migration): ('objects', django.contrib.auth.models.UserManager()), ], ), + 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.CreateModel( name='AllTrade', fields=[ @@ -87,6 +105,28 @@ class Migration(migrations.Migration): 'managed': True, }, ), + migrations.CreateModel( + name='Collection', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ], + options={ + 'db_table': 'collection', + '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)), + ], + options={ + 'db_table': 'comments', + 'managed': True, + }, + ), migrations.CreateModel( name='Goodclass', fields=[ @@ -130,128 +170,98 @@ class Migration(migrations.Migration): }, ), migrations.CreateModel( - name='HomeLun', + name='GroupH', fields=[ - ('lun_id', models.AutoField(primary_key=True, serialize=False)), - ('lun_name', models.CharField(max_length=255)), - ('lun_image', models.CharField(max_length=100)), + ('id', models.IntegerField(primary_key=True, serialize=False)), + ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), ], options={ - 'db_table': 'home_lun', + 'db_table': 'group_h', 'managed': True, }, ), migrations.CreateModel( - name='News', + name='HomeLun', fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, 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)), + ('lun_id', models.AutoField(primary_key=True, serialize=False)), + ('lun_name', models.CharField(max_length=255)), + ('lun_image', models.CharField(max_length=100)), ], options={ - 'db_table': 'news', + 'db_table': 'home_lun', 'managed': True, }, ), migrations.CreateModel( - name='OneselfQuestionsafety', + name='Images', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('question', models.CharField(max_length=225, unique=True)), + ('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': 'oneself_questionsafety', + 'db_table': 'images', 'managed': True, }, ), migrations.CreateModel( - name='OneselfQuestionsafetytwo', + name='News', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('question', models.CharField(max_length=225, unique=True)), + ('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={ - 'db_table': 'oneself_questionsafetytwo', + 'db_table': 'news', 'managed': True, }, ), migrations.CreateModel( - name='Order', + name='NewUser', 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)), + ('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': 'order', - 'managed': True, - }, - ), - migrations.CreateModel( - name='SafetyAccount', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('question', models.CharField(max_length=255)), - ], - options={ - 'db_table': 'safety_account', + 'db_table': 'new_user', 'managed': True, }, ), migrations.CreateModel( - name='UserMenber', + name='OneselfQuestionsafety', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('rember', models.CharField(max_length=255)), - ], - options={ - 'db_table': 'user_menber', - 'managed': True, - }, - ), - migrations.CreateModel( - name='UserAddress', - fields=[ - ('id', models.IntegerField(primary_key=True, serialize=False)), - ('useraddress', models.CharField(max_length=255)), - ('user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), + ('question', models.CharField(max_length=225, unique=True)), ], options={ - 'db_table': 'user_address', + 'db_table': 'oneself_questionsafety', 'managed': True, }, ), migrations.CreateModel( - name='Shopcart', + name='OneselfQuestionsafetytwo', 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)), + ('question', models.CharField(max_length=225, unique=True)), ], options={ - 'db_table': 'shopcart', + 'db_table': 'oneself_questionsafetytwo', 'managed': True, }, ), migrations.CreateModel( - name='OrderGood', + name='OneselfSafetyanswer', 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')), + ('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': 'order_good', + 'db_table': 'oneself_safetyanswer', 'managed': True, }, ), @@ -269,103 +279,113 @@ class Migration(migrations.Migration): }, ), 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', + name='Order', 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')), + ('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)), ('user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), ], options={ - 'db_table': 'new_user', + 'db_table': 'order', 'managed': True, }, ), migrations.CreateModel( - name='Images', + name='OrderGood', 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')), + ('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': 'images', + 'db_table': 'order_good', 'managed': True, }, ), migrations.CreateModel( - name='GroupH', + name='SafetyAccount', 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')), + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('question', models.CharField(max_length=255)), ], options={ - 'db_table': 'group_h', + 'db_table': 'safety_account', 'managed': True, }, ), migrations.CreateModel( - name='Comments', + name='Shopcart', 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_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': 'comments', + 'db_table': 'shopcart', 'managed': True, }, ), migrations.CreateModel( - name='Collection', + name='UserAddress', 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')), + ('id', models.IntegerField(primary_key=True, serialize=False)), + ('useraddress', models.CharField(max_length=255)), ('user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), ], options={ - 'db_table': 'collection', + 'db_table': 'user_address', 'managed': True, }, ), migrations.CreateModel( - name='Adress', + name='UserMenber', 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)), + ('rember', models.CharField(max_length=255)), ], options={ - 'db_table': 'adress', + 'db_table': 'user_menber', 'managed': True, }, ), + migrations.AddField( + model_name='grouph', + name='user_member', + field=models.ForeignKey(db_column='user_member', on_delete=django.db.models.deletion.CASCADE, to='oneself.UserMenber'), + ), + migrations.AddField( + model_name='comments', + name='good', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='oneself.Goods'), + ), + migrations.AddField( + model_name='comments', + name='user', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL), + ), + migrations.AddField( + model_name='collection', + name='good', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='oneself.Goods'), + ), + migrations.AddField( + model_name='collection', + name='user', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL), + ), migrations.AddField( model_name='user', name='member', - field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='oneself.UserMenber'), + field=models.ForeignKey(blank=True, default=1, null=True, on_delete=django.db.models.deletion.CASCADE, to='oneself.UserMenber'), ), migrations.AddField( model_name='user', diff --git a/Orange_lala/templates/home/home3.html b/Orange_lala/templates/home/home3.html index 2236539..d55df4c 100644 --- a/Orange_lala/templates/home/home3.html +++ b/Orange_lala/templates/home/home3.html @@ -72,10 +72,56 @@ -{% include "home/header.html" %} +
    + +
    + + +
    + + + + + +
    +
    +
    - +
    - +
    @@ -133,7 +179,7 @@ {% for good in goodss %} {% if good.good_class.id == foo.id %}
    -{# #} +{#
    {{ good.name }}
    #}
    {% endif %} diff --git a/Orange_lala/templates/home/search.html b/Orange_lala/templates/home/search.html index b332db5..e3b9187 100644 --- a/Orange_lala/templates/home/search.html +++ b/Orange_lala/templates/home/search.html @@ -20,6 +20,7 @@ +
      @@ -42,6 +43,7 @@
    @@ -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 %} diff --git a/Orange_lala/templates/home/pay.html b/Orange_lala/templates/home/pay.html index d0225d1..0b46b3a 100644 --- a/Orange_lala/templates/home/pay.html +++ b/Orange_lala/templates/home/pay.html @@ -14,7 +14,9 @@ + + @@ -35,13 +37,13 @@ @@ -73,24 +75,25 @@
      + {% for x in addr %}
      -
    • +
    • - - 艾迪 - 15871145629 + + {{ x.recipients }} + {{ x.tel }}
      收货地址: - 湖北省 - 武汉市 - 洪山区 - 雄楚大道666号(中南财经政法大学) + {{ x.province }}省 + {{ x.city }}市 + {{ x.county }}区 + {{ x.detail_addr }} @@ -112,43 +115,7 @@
    • -
      -
    • -
      -
      - - - 艾迪 - 15871145629 - -
      -
      - 收货地址: - - 湖北省 - 武汉市 - 武昌区 - 东湖路75号众环大厦2栋9层902 - - - -
      - -
      -
      - -
      -
      - -
      - 设为默认 - | - 编辑 - | - 删除 -
      - -
    • + {% endfor %}
    @@ -207,18 +174,22 @@
    - -
    + {% for x in shopcar %} + {% for a in goods %} + {% if x.good_id == a.id %} + {% for pic in img %} + {% if a.id == pic.goods_id %} +
    - -
    -
    + {% endif %} + {% endfor %} + - -
    -
    -
      -
      -
    • -
      - - -
      - -
    • -
    • -
      - 颜色:10#蜜橘色+17#樱花粉 - 包装:两支手袋装(送彩带) -
      -
    • -
    • -
      -
      - 39.00 -
      -
      -
    • -
      + {% endif %} + {% endfor %} -
    • -
      -
      - 购买数量 -
      - - - -
      -
      -
      -
    • -
    • -
      - 117.00 -
      -
    • -
    • -
      - 配送方式 -
      - 包邮 -
      -
      -
    • + {% endfor %} -
    -
    -
    +
    +
    @@ -349,12 +267,13 @@
    +
  • 优惠券 - +
  • -
    -
    +
    + + +
    diff --git a/Orange_lala/templates/home/pay2.html b/Orange_lala/templates/home/pay2.html new file mode 100644 index 0000000..42c90d1 --- /dev/null +++ b/Orange_lala/templates/home/pay2.html @@ -0,0 +1,469 @@ + + + {% load static %} + + + + + 结算页面 + + + + + + + + + + + + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +

    确认收货地址

    +
    + +
    +
    +
      + {% for x in addr %} +
      +
    • + +
      +
      + + + {{ x.recipients }} + {{ x.tel }} + +
      +
      + 收货地址: + + {{ x.province }}省 + {{ x.city }}市 + {{ x.county }}区 + {{ x.detail_addr }} + + +
      + 默认地址 +
      +
      + + +
      +
      + +
      + + + 编辑 + | + 删除 +
      + +
    • + {% endfor %} + +
    + +
    +
    + +
    +

    选择物流方式

    +
      +
    • 圆通
    • +
    • 申通
    • +
    • 韵达
    • +
    • 中通
    • +
    • 顺丰
    • +
    +
    +
    + + +
    +

    选择支付方式

    +
      +
    • 银联
    • +
    • 微信
    • +
    • 支付宝
    • +
    +
    +
    + + +
    +
    +

    确认订单信息

    +
    +
    + +
    +
    商品信息
    +
    +
    +
    单价
    +
    +
    +
    数量
    +
    +
    +
    金额
    +
    +
    +
    配送方式
    +
    + +
    +
    +
    + + +
    + {% for y in order_good %} + {% if y.order_id == order.id %} + {% for z in goods %} + {% if y.good_id == z.id %} + {% for i in img %} + {% if i.goods_id == z.id %} +
    +
      +
      +
    • +
      + + +
      +
      + +
      +
    • +
    • +
      + 颜色:{{ z.taste }} + 包装:{{ z.pack }} +
      +
    • +
    • +
      +
      + {{ z.prices }} +
      +
      +
    • +
      +
    • +
      +
      + 购买数量 +
      +{# #} + {{ y.good_num }} +{# #} +
      +
      +
      +
    • +
    • +
      + {{ x.good_price }} +
      +
    • +
    • +
      + 配送方式 +
      + 快递10元 +
      +
      +
    • + +
    +
    + +
    + {% endif %} + {% endfor %} + {% endif %} + {% endfor %} + {% endif %} + {% endfor %} + + + + + + + +
    +
    + +
    +
    + +
    + + +
    + + +
    +
  • + + 优惠券 + +
  • + +
  • + + 红包 + + +
  • + +
    +
    +
    + +
    +

    + 合计(含运费) ¥244.00 +

    +
    + + +
    +
    +
    +
    实付款: + + ¥ 244.00 + +
    + +
    + + + +
    + + + +
    + +
    + +
    +
    +
    +
    +
    + +
    +
    +
    + +
    +
    +
    + + +
    +
    新增地址 / Add address
    +
    +
    + +
    +
    + +
    + +
    + +
    +
    + +
    + +
    + +
    +
    + +
    + +
    + + + +
    +
    + +
    + +
    + + 100字以内写出你的详细地址... +
    +
    + +
    +
    +
    保存
    +
    取消
    +
    +
    +
    +
    + +
    + +
    + + + \ No newline at end of file diff --git a/Orange_lala/templates/home/shopcart.html b/Orange_lala/templates/home/shopcart.html index 373664b..223da56 100644 --- a/Orange_lala/templates/home/shopcart.html +++ b/Orange_lala/templates/home/shopcart.html @@ -13,6 +13,7 @@ + @@ -36,7 +37,7 @@
    @@ -93,85 +94,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 %} + - - + {% endif %} + {% endif %} + {% endfor %} + {% endfor %} + + {% endfor %} +
    @@ -243,85 +189,6 @@
    - -
    -
    -
    -
    已享优惠:省¥19.50  
    - - -
    -
    -
    -
    - -
    -
    -
    @@ -351,7 +218,7 @@ ¥0.00
    diff --git a/Orange_lala/templates/person/change.html b/Orange_lala/templates/person/change.html index 315ec52..2c97aba 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 1c55346..2b0dbd4 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 255aabb..1ffbf1a 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/foot.html b/Orange_lala/templates/person/foot.html index bd8d848..f69b4ed 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/logistics.html b/Orange_lala/templates/person/logistics.html index 082fcc6..41f1df5 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 e6efd61..0b490b7 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 ff4bba6..a7537fb 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 049e865..79d99cb 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

    #}
  • 卖家已发货

    -

    查看物流

    +

    查看物流

    延长收货

  • - 确认收货
    + + 确认收货
  • -- Gitee From 66def6e682b63c30bae3ed4472a2fdc702a57327 Mon Sep 17 00:00:00 2001 From: lizehui <936573478@qq.com> Date: Wed, 25 Sep 2019 15:03:05 +0800 Subject: [PATCH 33/62] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E4=BA=86js=E6=96=87?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Orange_lala/static/js/pay.js | 36 +++++++++++++++++++++++++++++++ Orange_lala/static/js/shopcart.js | 24 +++++++++++++++++++++ 2 files changed, 60 insertions(+) create mode 100644 Orange_lala/static/js/pay.js create mode 100644 Orange_lala/static/js/shopcart.js diff --git a/Orange_lala/static/js/pay.js b/Orange_lala/static/js/pay.js new file mode 100644 index 0000000..5db3f6f --- /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 0000000..8c66f41 --- /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 -- Gitee From 6bbb43963f4776907184992abf4f830c06c11bba Mon Sep 17 00:00:00 2001 From: lizehui <936573478@qq.com> Date: Wed, 25 Sep 2019 19:27:13 +0800 Subject: [PATCH 34/62] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BA=86=E5=8A=A0?= =?UTF-8?q?=E5=85=A5=E8=B4=AD=E7=89=A9=E8=BD=A6=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Orange_lala/home/views.py | 6 ++++++ Orange_lala/templates/home/introduction.html | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Orange_lala/home/views.py b/Orange_lala/home/views.py index 10b8544..49c09e6 100644 --- a/Orange_lala/home/views.py +++ b/Orange_lala/home/views.py @@ -327,8 +327,14 @@ def into_shopcart(request,id): # user = User.objects.get(username=username) # if username and user: # Shopcart.objects.create(good_id=id,user_id=user.id) + good_num = request.POST.get('good_num') print(good_num) + a = Shopcart.objects.filter(good_id=id, user_id=8) + if a: + for i in a: + i.good_num += good_num + i.save() Shopcart.objects.create(good_id=id, user_id=8,good_num=good_num) return redirect('home:introduction_handle') # else: diff --git a/Orange_lala/templates/home/introduction.html b/Orange_lala/templates/home/introduction.html index 505eb58..cdafb6b 100644 --- a/Orange_lala/templates/home/introduction.html +++ b/Orange_lala/templates/home/introduction.html @@ -273,7 +273,7 @@ ×
    -
    diff --git a/Orange_lala/templates/home/home3.html b/Orange_lala/templates/home/home3.html index d55df4c..e1344a0 100644 --- a/Orange_lala/templates/home/home3.html +++ b/Orange_lala/templates/home/home3.html @@ -62,62 +62,12 @@ position: relative; float: left; } - {#.s-img_2{#} - {# right: 4px;#} - {# position: relative;#} - {# float: left;#} - {#}#} -
    - -
    - - -
    - - - - - -
    -
    + {% include "home/header.html" %}
    diff --git a/Orange_lala/templates/home/introduction.html b/Orange_lala/templates/home/introduction.html index 505eb58..5098634 100644 --- a/Orange_lala/templates/home/introduction.html +++ b/Orange_lala/templates/home/introduction.html @@ -63,6 +63,53 @@ }) }); }); + + @@ -70,29 +117,6 @@ -
    - - -
    @@ -103,9 +127,9 @@
    @@ -299,53 +323,6 @@ - {% for good in goods %} 库存{{ good.repertory }} {% endfor %} @@ -398,11 +375,20 @@
  • +
    -
    @@ -411,27 +397,9 @@
    -
    优惠套装
    @@ -601,143 +569,7 @@
  • - - - - -
    - -
    - -
    - - b***1 (匿名) - - 评论于 - -
    -
    - -
    -
    -
    - 摸起来丝滑柔软,不厚,没色差,颜色好看!买这个衣服还接到诈骗电话,我很好奇他们是怎么知道我买了这件衣服,并且还知道我的电话的! -
    -
    - 颜色分类:柠檬黄  尺码:S -
    -
    - -
    - -
    -
  • -
  • - - - - - - -
    - -
    - -
    - - l***4 (匿名) - - 评论于 - -
    -
    - -
    -
    -
    - 没有色差,很暖和……美美的 -
    -
    - 颜色分类:蓝调灰  尺码:2XL -
    -
    - -
    - -
    -
  • -
  • - - - - - - -
    - -
    - -
    - - b***1 (匿名) - - 评论于 - -
    -
    - -
    -
    -
    - 摸起来丝滑柔软,不厚,没色差,颜色好看!买这个衣服还接到诈骗电话,我很好奇他们是怎么知道我买了这件衣服,并且还知道我的电话的! -
    -
    - 颜色分类:柠檬黄  尺码:S -
    -
    - -
    - -
    -
  • -
  • - - - - - - -
    - -
    - -
    - - h***n (匿名) - - 评论于 - -
    -
    - -
    -
    -
    - 式样不错,初冬穿 -
    -
    - 颜色分类:柠檬黄  尺码:L -
    -
    -
    - -
    -
  • - -
  • - - - + @@ -768,242 +600,6 @@
  • -
  • - - - - - - -
    - -
    - -
    - - l***4 (匿名) - - 评论于 - -
    -
    - -
    -
    -
    - 没有色差,很暖和……美美的 -
    -
    - 颜色分类:蓝调灰  尺码:2XL -
    -
    - -
    - -
    -
  • -
  • - - - - - - -
    - -
    - -
    - - b***1 (匿名) - - 评论于 - -
    -
    - -
    -
    -
    - 摸起来丝滑柔软,不厚,没色差,颜色好看!买这个衣服还接到诈骗电话,我很好奇他们是怎么知道我买了这件衣服,并且还知道我的电话的! -
    -
    - 颜色分类:柠檬黄  尺码:S -
    -
    - -
    - -
    -
  • -
  • - - - - - - -
    - -
    - -
    - - h***n (匿名) - - 评论于 - -
    -
    - -
    -
    -
    - 式样不错,初冬穿 -
    -
    - 颜色分类:柠檬黄  尺码:L -
    -
    -
    - -
    -
  • -
  • - - - - - - -
    - -
    - -
    - - b***1 (匿名) - - 评论于 - -
    -
    - -
    -
    -
    - 摸起来丝滑柔软,不厚,没色差,颜色好看!买这个衣服还接到诈骗电话,我很好奇他们是怎么知道我买了这件衣服,并且还知道我的电话的! -
    -
    - 颜色分类:柠檬黄  尺码:S -
    -
    - -
    - -
    -
  • -
  • - - - - - - -
    - -
    - -
    - - l***4 (匿名) - - 评论于 - -
    -
    - -
    -
    -
    - 没有色差,很暖和……美美的 -
    -
    - 颜色分类:蓝调灰  尺码:2XL -
    -
    - -
    - -
    -
  • -
  • - - - - - - -
    - -
    - -
    - - b***1 (匿名) - - 评论于 - -
    -
    - -
    -
    -
    - 摸起来丝滑柔软,不厚,没色差,颜色好看!买这个衣服还接到诈骗电话,我很好奇他们是怎么知道我买了这件衣服,并且还知道我的电话的! -
    -
    - 颜色分类:柠檬黄  尺码:S -
    -
    - -
    - -
    -
  • -
  • - - - - - - -
    - -
    - -
    - - h***n (匿名) - - 评论于 - -
    -
    - -
    -
    -
    - 式样不错,初冬穿 -
    -
    - 颜色分类:柠檬黄  尺码:L -
    -
    -
    - -
    -
  • @@ -1143,8 +739,8 @@

    - + +

    购物车

    -

    0

    +

    {{ shop_number }}

    @@ -155,9 +158,18 @@
    {# #} - {{ l.good_num }} + {{ l.good_num }} {# #}
    +
    -- Gitee From 796c8e77d12ab4ea63b236ef4637fbe7cf34c7e0 Mon Sep 17 00:00:00 2001 From: junjiehou <1904318367@qq.com> Date: Thu, 26 Sep 2019 10:13:51 +0800 Subject: [PATCH 36/62] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=96=87=E4=BB=B6=20Or?= =?UTF-8?q?ange=5Flala/Orange=5Flala/=5F=5Fpycache=5F=5F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../__pycache__/__init__.cpython-37.pyc | Bin 214 -> 0 bytes .../__pycache__/settings.cpython-37.pyc | Bin 2462 -> 0 bytes .../Orange_lala/__pycache__/urls.cpython-37.pyc | Bin 1090 -> 0 bytes 3 files changed, 0 insertions(+), 0 deletions(-) delete mode 100644 Orange_lala/Orange_lala/__pycache__/__init__.cpython-37.pyc delete mode 100644 Orange_lala/Orange_lala/__pycache__/settings.cpython-37.pyc delete mode 100644 Orange_lala/Orange_lala/__pycache__/urls.cpython-37.pyc diff --git a/Orange_lala/Orange_lala/__pycache__/__init__.cpython-37.pyc b/Orange_lala/Orange_lala/__pycache__/__init__.cpython-37.pyc deleted file mode 100644 index d791b5a3b19f6112f7c8d70b5a57b149d0f20ae5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 214 zcmZ?b<>g`kf?XWtu{uEdF^B^LOhASM5EqL8i4=wu#vFzyhE#?Hj0+hUfxKV_O{SMX z83sR1rYQD;%G}E0!kj3f%)H`~#GIV?#Nv40%HTksl%$mmMIfWV#4kT*tC-N@)S}{; zl+>J@7?;%I?2`O~nEax|y!6xd$B}dGgp< z!;k%i1X4;0(vUIJN}8niGr!FwC`ZnGOh--0!iSt!6+IA`RQ z0u*5m&ci%hfQxX+$SG&xvT_ct#Arp5g{vPkMjAM{1`BWcP3yUas7w*M$DW>;n+TfH6@Ibi;50y*k*Jb>!;CB_4 zm1{>fg~+C|02w*8RMJ+`sZ^o1ui1vfGvfQyHWczoMK9#Kur)Ogo(_KEHbg~BGW ziKqDl`2Hck2(jL>1{Sq>=4+lmmR#hA43YRT@TyQ2DyY4IxR&D)p4w=_(tPUJJih*b zqETv+hv)+-41C{ZFG?kFbS8{!OgzvXt3>P)0+xKor8+B3oGy*v{Q=?khNj7zl=-}~ zcf2Ug1~f#d$G_9eAz}Z=mPhsyhW^GBNwtDi1HKRL_0@e{U-6bzqw@Zj=a#+p$aW9! z3@Ux?u%d$XG_Zolj}4}}PjBCU*9$I>)+6YS?R&H@#IXx5O>>9-Ahxtd^fET&1$|B+OdG>Ju-R-#OSBpFo0cmscxG*)S`$HtQ`ZW7u`0&)>IJUgmg8=4jd0uJc=m9ZVTItc%mO23PYdB)S{*q z72NBQgyRJ-Pm9!~HnoOUgV=^YIM)B+wECm^>x_Lo23R{SKx=3bkLo88a=~DEOT$yD zC^D**1C0jx65bwIlqDrQ>MUIkbE=9LfU1TWhlQN0`2*Zp>e*ONVNUC_n3Gr4 z=mb+$CBH7pQj{lQL6)jrsi(e@ehSajr1kC1uqZYf?H#G6M!O}4bM=HY)$Nm zk#RX(5Vw0<>SX`b*J7iNlWk1mVnb|gZi}0eT5Z=P1gtkDRcT`y+H)Mv@jC;iDyD!7MX{yWQop-EnzMHB2-BwQvxb1TQqa2YO}Nhe#D`(!l3;dm~C b&sb_M%M~a6=wG;!orzi@k65FY<G0W|~QXBX~EBR1&o-Gy((^DvA(DKsV8#)Qvqe8SFT+J(PCaHD_SW z6*x+^thfRzzTHd}kdSIA&Uf5@8;Chy`@W{MBf+edR;E#fCJz@^0eMO&qQwx=o|6 zgGG>!>G(ZLVq$!R-YQZrSiuP=_~hMdd?@RAwOA`+Dp^O-hb6LOy0q%9(>l`q6hEaDlNwi|k;+Ul zo+~M^xF|@|bRT>8gAVUXh5~vO!d57DxjUKcb#*PJV0*YGf<2npc#=eioM?Uj3<{$? z*8i!HX33Nlk~*U{a$W+LQ-4b}7M~JbSd!i3A4SJ?$=9^17hrGJy9d^%|a%;6`TrM&&aFc0bKRDh=l0?6t$x-69LqbJW zCw?1P$J?+&+ds~z%Pj}UT67u9nrX)8j^lFM9)ksqJ?s@SbhIj1! E0W&91IRF3v -- Gitee From c9722f18ed68b1195e419428c891f6e82c5f4699 Mon Sep 17 00:00:00 2001 From: junjiehou <1904318367@qq.com> Date: Thu, 26 Sep 2019 10:14:12 +0800 Subject: [PATCH 37/62] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=96=87=E4=BB=B6=20Or?= =?UTF-8?q?ange=5Flala/home/=5F=5Fpycache=5F=5F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../home/__pycache__/__init__.cpython-37.pyc | Bin 158 -> 0 bytes .../home/__pycache__/admin.cpython-37.pyc | Bin 199 -> 0 bytes .../home/__pycache__/models.cpython-37.pyc | Bin 196 -> 0 bytes Orange_lala/home/__pycache__/urls.cpython-37.pyc | Bin 666 -> 0 bytes .../home/__pycache__/views.cpython-37.pyc | Bin 1405 -> 0 bytes 5 files changed, 0 insertions(+), 0 deletions(-) delete mode 100644 Orange_lala/home/__pycache__/__init__.cpython-37.pyc delete mode 100644 Orange_lala/home/__pycache__/admin.cpython-37.pyc delete mode 100644 Orange_lala/home/__pycache__/models.cpython-37.pyc delete mode 100644 Orange_lala/home/__pycache__/urls.cpython-37.pyc delete mode 100644 Orange_lala/home/__pycache__/views.cpython-37.pyc diff --git a/Orange_lala/home/__pycache__/__init__.cpython-37.pyc b/Orange_lala/home/__pycache__/__init__.cpython-37.pyc deleted file mode 100644 index 41eaae1bce2a9688521bb2bed8967cae949d25b8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 158 zcmZ?b<>g`kf?XWtu^{>}h=2h`Aj1KOi&=m~3PUi1CZpdI zlaiW~6XTLvoL!P%5R+e&n3tX!;}53da}skB<1LVRF&X)}sWI{KnR%Hd@$q^EmA5!- Ra`RJ4b5iX<78C<90|4+)C-(pV diff --git a/Orange_lala/home/__pycache__/admin.cpython-37.pyc b/Orange_lala/home/__pycache__/admin.cpython-37.pyc deleted file mode 100644 index 9a4a500ce58c6bbe68ca5108f2c651ef991a72ad..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 199 zcmZ?b<>g`kf?XWtu}(nxF^B^LOhASM5Elyoi4=wu#vF!R#wbQch7_h?22JLdKv4!w z##^k3DY=<>ews{Cd?{IpdFlCj$@zIDMVU!OAOlu16fpxSF!9U9*(xTqIJKxaCM7i| zC&neUIJ+djASS;Es4X?dA56vPB<3W>TOjjdGV*g%W5Cwv6;$5hu*uC&Da}c>V+0yp H48#loWi>NI diff --git a/Orange_lala/home/__pycache__/models.cpython-37.pyc b/Orange_lala/home/__pycache__/models.cpython-37.pyc deleted file mode 100644 index c6f26f06492695190aef208a0a0816c125551bf8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 196 zcmZ?b<>g`kf?XWtu{J>ZF^B^LOhASM5Elyoi4=wu#vF!R#wbQch7_h?22JLdKv4!w z##?N;`6;P6#eSMhw>VR>67$mY^-_|GK$=%F6tMs)F!9UP*(xTqIJKxa2B1%3DZct`3)eoNCi!}0OM(_J}X><__Vq-eh4Yk#8v1FqPXuQ(?^ zQIoB=^3Z!LUvluJcOO6i(_bFa3~37CNDnfPAD|9}1g DUg)`R diff --git a/Orange_lala/home/__pycache__/views.cpython-37.pyc b/Orange_lala/home/__pycache__/views.cpython-37.pyc deleted file mode 100644 index 351afef96421151a24d01b64f872f0d7dfd82420..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1405 zcmb7^&5qMR41gzX)240Gc7IqTIB-B{)k_dJgb)ID&&vUEse)G7c+>{cPVr23wFrp= zybQ0@D<@uo6ZV8kv$x4q8QZDl&vrcXHc3W;*6EY)A2(egezUP(9a3J?qk%RM5L99v zEP{abPSsg=7hTf3(EBMCJqV#sGK2v{B>OOg5y=6JAto6?0uz!$n8J+Y2oB(oOQr_rvd%KI++~!L;;CvV*0%YAc;X|7+%4MmI#Jf3Tj{@0jo2^gg zF53H!$=Va67R07Sm0Fe?4_s&+rw(h_f;F+#X@$lE)nmUShs2-Pw~r^5RBj9^s0&jn zpW Date: Thu, 26 Sep 2019 10:14:29 +0800 Subject: [PATCH 38/62] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=96=87=E4=BB=B6=20Or?= =?UTF-8?q?ange=5Flala/oneself/=5F=5Fpycache=5F=5F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../oneself/__pycache__/__init__.cpython-37.pyc | Bin 161 -> 0 bytes .../oneself/__pycache__/admin.cpython-37.pyc | Bin 202 -> 0 bytes .../oneself/__pycache__/models.cpython-37.pyc | Bin 9187 -> 0 bytes .../oneself/__pycache__/urls.cpython-37.pyc | Bin 1841 -> 0 bytes .../oneself/__pycache__/views.cpython-37.pyc | Bin 3731 -> 0 bytes 5 files changed, 0 insertions(+), 0 deletions(-) delete mode 100644 Orange_lala/oneself/__pycache__/__init__.cpython-37.pyc delete mode 100644 Orange_lala/oneself/__pycache__/admin.cpython-37.pyc delete mode 100644 Orange_lala/oneself/__pycache__/models.cpython-37.pyc delete mode 100644 Orange_lala/oneself/__pycache__/urls.cpython-37.pyc delete mode 100644 Orange_lala/oneself/__pycache__/views.cpython-37.pyc diff --git a/Orange_lala/oneself/__pycache__/__init__.cpython-37.pyc b/Orange_lala/oneself/__pycache__/__init__.cpython-37.pyc deleted file mode 100644 index dd8c51e88d2b4215c6321b1263fdbaf1620e7d5b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 161 zcmZ?b<>g`kf?XWtu^{>}h=2h`Aj1KOi&=m~3PUi1CZpdI zlaiW~6XTLvoL!P%5R+e&n3tX!;}53da}skB<1LVRG5L9^#i==IG4b)4d6^~g@p=W7 Uw>WHa^HWN5Qtd!?6az5>0C+elJpcdz diff --git a/Orange_lala/oneself/__pycache__/admin.cpython-37.pyc b/Orange_lala/oneself/__pycache__/admin.cpython-37.pyc deleted file mode 100644 index 03e361855517440352fe8909b4aabe2219f5775a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 202 zcmZ?b<>g`kf?XWtu}(nxF^B^LOhASM5Elyoi4=wu#vF!R#wbQch7_h?22JLdKv4!w z##^k3DY=<>ews{Cd?{IpdFlCj$@zIDMVU!OAOlu16fpxSF!9UX*(xTqIJKxaCM7i| zC&neUIJ+djASS;Es4X?dA56vPB<3W>TOjjd^7B%QQ*+W{z&7a>RNmsS$<0qG%}KRm K1e#q8#0&rqr!j$<2@g~TdOS7ocJ5}E8bt(>JuBrM}bye5z`PHv{ ztJ7%~@bCK7pZ=uua-r}KHb(y{sBGhj9~BD)Q4qzj&@Z~hV&PsvltlUG1yPp8qtfSP zw+u=}R6(g)N(GdfsDo0slqx8WXn@kNlo}{a(E_DqDRofVq613DQXEjaVhNNbOKE_z zELK2Sv6Ln#t6~k5HA`uMvMx42*|3y0D4XIODCaDt1Il@E0h9}t(go$BxCF{2OIZTt zC2<*)%a*bX%FE&kC|4|H1(a9BtDwAUDXXBoCSC{SbxTq zvLW7lSlHS+A@{e6X{{d#8OA*}NB_#GY~zWqp^yc)C<<;#mX9i;C`!+YE?Ha_6--+B zyyVtI6%*D{=Vlo0DqqNxf8#Yw-R%2Myig7flEd8ekg}P6ePVi1bjzaTRzw+-RX*#C zCcE)KCjQ;D;fJA@aQ2<8YU+62!0$`XOPijD4IGE8w>|IUV?VS#^}avw52Q#PvF|1R zekgxiP;IQJi+|p~{r296u~hLMwjb`@k@4ds8tz5P9~{WN_w|n#`l0W=HQCyW1~Qi6 zqdmj68^fn*g5tXJvrjX% z4qu=kT6pZt?UJVCm^n6{H!*HnR-*i@q@`tzMoX&(2G`TZ&Ew?oo{El#yC=WIt6QbC zc033^K9;JAW^RqM2&_Av&q&N|`dGj_;0h4gG%M&06t^~W-{jvWo-=V&En#F@q1fkh zav5XRvKhN2MM`d$V@`exJsBszsK_dGzxHLxt;_NkumRhm%dqYVd~Jvd_*zZZ$9(ue zs(uj1K{SX{&7F*pTX)Re^Aqc4=HOP%%%5GDHM3>*X2xu9n60~2gjlOu25B>+?`+lP z$|GGeTHqzoflLmink%3yWM>TpRer4W&FPu7(l_r$N(KjmAIhhi@oDqU``*s`yZ7JS zxu+;;b&dt)K65>Kic5Ixdfg%fNLr4OV*zfXClg@iwjjP5VoCX^4q-alp;fd)qpz=u z8XQ^;qHKyfMCqsvOrtpIR#DqTx^m|T-XXdj4H7v>cApOAi9mPmBhD(#HA*wn2rI`W zEyqk!T7d1IS2}IAZ=)IhWNNa5{UG|sQ+OfF*G-*@kt;* zjg)|q&$T>S`PcZl^w<<+yXX|1k|I6F##g)BzBWGByu-JB)0@&vk&8%ST;1zTz&SuOn)t!4odSkm|yL z_jBO=Rzw5dubFm@v%4w!!Qj2>5 z{Ug~+JZpey%eIvqD)k1LFnaS*=pUrr-XYPX*Oze&C_3dq)5bAZ+7_>E|+SnT&qpI!{CyfUg?>ucfG7!rP~M$rqrM&F5mI73rE4 z>0~g|;jQ5hhd|ok~VlmfHsoOuw=7j?+X->^% z{@WP&BId*R>M%^=$4m$fdx}~%{Cf}_D4#kQPa=@qnrE@Djp^BpFks}yzWU>37BaAp z$d@Stn+X6lx6?8tZLq`*yy(`^3NGq)5$if?u$WC#EE)xo^%u z))|g51bCmFiJHQki8_W`4`Ht0{O$>DY^$VR!OvnbXf-#XHH5C^eQcIli1A1Gq-n;_ z$8TxNu0THpGLyvzxg+PHw zh~vmX1S0;Z#YL@)H?|IG%v<7uq&Hx5SgF2wtoyPs0}`Mh_RxSFT8p_3LS z3Y0O40n>C>^DW>edLu4qyc%$HNs%_2*%kPNY5ixu25d%Rg&GgAz_4FIotYd8U{uc? zh$iUGiF#|IPGB*5w=+@iPSgQ3#$%Qz>MIlVRb8*)i|Y8gH7Le9yyFIbH|06>ori*4 z(5;KMbxF5gvaQQd9-Ht3e0f>A)v zto_=kH^<_$INPRP(kfY%VviS6uxI#!X$8A7H-@EE9B}|Hct&%p8snywq2GJ#IzjBk z#|OT0tBD^cGOhbUD0m&W6AxuCcog(>h;bWzntb4gvAa1m93lGYNtKvE((T3xQezs+ zB!`gzf~2$1uWN_lE(QHzq!Ld=Ks!m$OKYFvz<-#y%XY>wkJEPk5CZUog(CHIrezQn ztLrSN_HHw?rujz0!{ie@F&(%)eCm@6PcQjD`Y&V?XjXhHCv&REHlFw{irHp0l}~^Y zLn(o$MD1Bwd$kN#H!ZHN>7?6z98XPP`6?z)o5ao!Zn}V=_~KI`U@la70=5fRBuRgLY&hjXW^YAbl_I#C0 zqTkdSe{?)Z7B!5{XyTEaV!O~na{3)PHzlW)nVy=U%Q`RPu9>uUH4-tx8tpBNlqJ)L zr_H-zrnel z)ClAD@<)rcti_jQ9wS^x< z;XW>iWw?(OMW220GZfZkAUUG8&{WKWed#T3@^%(-_ChBAQb~6L>vg#wHjj9T3_Y zg&@Q;tfdZ1dZ)DcC{P%w>ka*qu2yB=55iPqm&AYcC~e?GJ$L^G3WFOEjEc+n zV*;Chth2SudPyrnPD+&GHm5lK5=m<3Xiq+{E9Blv&@X5u^s8dvfDYmLi`lUbydVj) zL_IL?TR&$&g~kCfvo2aa^v%oS*_JfoU*oSdE?{2ET>i}UT;%Pa z@YrQEP9rVH^D+qA9CQuEERO{nhTq6vSF3k1crv==rW`Z+lsf^!GYvgv<{9 diff --git a/Orange_lala/oneself/__pycache__/urls.cpython-37.pyc b/Orange_lala/oneself/__pycache__/urls.cpython-37.pyc deleted file mode 100644 index 15fda23c260c2b0e359840734b65ec7605e824aa..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1841 zcmb7_OLG!I5XW}|2_!&(@CcBn#uq-azKto%vefdZ2g?hEMJ@D@5N99Gf-!sdXq8{X zui!`7t0%vLC%bohA#6@U@t^tiHoe``v$HP?g%u4yzp|$vzhyP;H$nW_#>or(c|UYb z0}XVkS$ap;X}%yAtW+n3^He7-bV!TT$s#Pm()Scn25AYhOv^|aSYgT`Wg*X0Kw5@X zrXtb`l$gp$Iap(=AmyRTR6{C2ooO9u6&g%Uq$0GKHjqlN$+U%3hHa)Dq&3)Ox`b4L z%S?MnRk*@*6{!Z-n64w$;RaJ1X&r7d-9l=>ZKgX&P1t8LkXmq;=^oMs+-G`#v93SJj_+=zcz0Q(#<_S6UGtp=Siz6Gv zS8}vXOZY9eM?-I94;^Khc89{+vBfj7z#;$qZD`bCtK9*~G z-l?O&2#Opnw)l;C&py`R9y_)$f)cwoqkccfi20EMbo&{$aKQ&KZ*#4316v2pbWvUBpQ*B?ef-%q!xg*T9*$wDG2~ zLQbw>-?1lHN!-y8{mOjT`y+`>&rLUnl*w+AM^t3o&Di2M=VJ{VDa9b_e3>K8Y{@$h z9S0XKzB7?uPsR&Z*a%jq!9qhal8w*rED}-DqmNyjc@VvA?*=(I!In7t6D2*hfTu!` z!AFHo0hJ=kny%ZUhrbgqVR$5{CA_FIBzW{|YMF#y2P#LBCn=zG;%k{U^!WSyiz(j;k-Y>;e{Y?07ACdgspc!-UKvb~?0+M^33f8V@1?0)cs^12|T z?7kM>r?KO99Ys5^`z{=M(v)WJ;5>D?`YtWVzIzsApIHt}qL329IJ6*y5fo*p_Y4&AY3|2?BF|GK-Xt7;xLo6`ZkHZQz?ahHDm%NOQV zr5_LIqd(IZ1W=JdQrWFk0;s~+$6&V#<4_|Vg9(@<9fvwhk=9@uW=JQX0Zr0Ln1wmg zI<%loIt3k=C!K}`SR|c+C0HhHzzVFAHen6cNoQdLPLa;RX*fgLg0parv<*MNdD0I2 z2p34_;V0N6U4Vs~v<|zflMd z>zymsYfP3cG)JPVrxy$KKE=!6fTGEP-746n&AJ6=kGsOn0TD?UO9!xt?R@+h3)=92 zn$U_N3Z1svgx1L5yoGIgV2zLSQ}1@3jE{}UriGsMK+hLG4gpYT?Xc0ag@+4^%NCfA zmal&)qy;))jeqm;*DYwv18O2V|C2cFD+jQN=+fqv1#f%6O>m*;4^x+OY=UcKaL2-S zJg{cXQoW3I7Dp~VHft_z?ptuqWUgK|#UfHkBGOFK3>>!H6bsAhfi-~zj|rGfj}Ew4 zIAj|?7J*u@iIQA89s9@vq=6AQa^0&Jv)1E;cFt~NJ#YGJu(xO&;->V1_CUBb(p z<$V0_7Ieh}+A6D)bg2(BWnq$X$3m`pAWfd$kEL`BWs|3k$)6T_%>%tutTs|oipa6) zY8Pw%X7s|sb7gk*u-WXsQZ5JBY&H)ME#!s=(p07*2{@b~Q<(}2VS!J1fX!M{?wXHv z=HKmX&02YQY#~pd0J%>I*8|DJ6AQ_0&$I5vQ49W}Y^S#Lfx;{rW;%be$h&;xP8+%J zMeah8`$6Qs47pE2?pl!h2jp6gTw9TA9CF1$&iu&P7daOqXC~x4fqZU}PZDxWBS#jp xuaWm1c_)zPW<3<}gAL|S2KD=if}s?@@e`Bg;@YUyYxVK}y^r4+U5$Mk_Z2-c!07-0 -- Gitee From bc55313c2fcd8a0f6f5a8b8831d06727440f9faa Mon Sep 17 00:00:00 2001 From: junjiehou <1904318367@qq.com> Date: Thu, 26 Sep 2019 10:56:34 +0800 Subject: [PATCH 39/62] =?UTF-8?q?=E8=B4=AD=E7=89=A9=E8=BD=A6js=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E3=80=81=E7=BC=93=E5=AD=98=E5=9C=B0=E5=9D=80=E6=9B=B4?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Orange_lala/Orange_lala/settings.py | 4 ++-- Orange_lala/templates/home/shopcart.html | 8 +++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Orange_lala/Orange_lala/settings.py b/Orange_lala/Orange_lala/settings.py index d2e7c72..ad26207 100644 --- a/Orange_lala/Orange_lala/settings.py +++ b/Orange_lala/Orange_lala/settings.py @@ -138,8 +138,8 @@ STATICFILES_DIRS = [os.path.join(BASE_DIR, 'static')] CACHES = { "default": { "BACKEND": "django_redis.cache.RedisCache", - # "LOCATION": "redis://129.28.172.210:6379", - "LOCATION": "redis://127.0.0.1:6379", + "LOCATION": "redis://129.28.172.210:6379", + # "LOCATION": "redis://127.0.0.1:6379", "OPTIONS": { "CLIENT_CLASS": "django_redis.client.DefaultClient", } diff --git a/Orange_lala/templates/home/shopcart.html b/Orange_lala/templates/home/shopcart.html index f00b97a..d5aa002 100644 --- a/Orange_lala/templates/home/shopcart.html +++ b/Orange_lala/templates/home/shopcart.html @@ -145,10 +145,10 @@
    - {{ i.prices }} + {{ i.prices }}
    - {{ i.prices }} + {{ i.prices }}
    @@ -166,8 +166,10 @@ numbers = $(this).text() if(numbers > 1){ price = $("#{{ m.goods.name }}1").text() * 0.8 + }else{ + price = $("#{{ m.goods.name }}1").text() } - $("#{{ m.goods.name }}1").text(price) + $("#{{ m.goods.name }}2").text(price) })
    -- Gitee From 203ea90fa98f8bf72db4b168e1120d969032955c Mon Sep 17 00:00:00 2001 From: lizehui <936573478@qq.com> Date: Thu, 26 Sep 2019 11:24:51 +0800 Subject: [PATCH 40/62] =?UTF-8?q?=E5=AE=8C=E5=96=84=E4=BA=86=E5=95=86?= =?UTF-8?q?=E5=93=81=E7=9B=B4=E6=8E=A5=E8=B4=AD=E4=B9=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Orange_lala/Orange_lala/settings.py | 2 +- Orange_lala/home/urls.py | 3 +- Orange_lala/home/views.py | 35 +- Orange_lala/oneself/models.py | 209 ++++++--- Orange_lala/templates/home/introduction.html | 12 +- Orange_lala/templates/home/pay3.html | 457 +++++++++++++++++++ 6 files changed, 649 insertions(+), 69 deletions(-) create mode 100644 Orange_lala/templates/home/pay3.html diff --git a/Orange_lala/Orange_lala/settings.py b/Orange_lala/Orange_lala/settings.py index 8ad2063..bd2edc5 100644 --- a/Orange_lala/Orange_lala/settings.py +++ b/Orange_lala/Orange_lala/settings.py @@ -94,7 +94,7 @@ DATABASES = { } } -AUTH_USER_MODEL = 'oneself.User' +# AUTH_USER_MODEL = 'oneself.User' # Password validation # https://docs.djangoproject.com/en/2.1/ref/settings/#auth-password-validators diff --git a/Orange_lala/home/urls.py b/Orange_lala/home/urls.py index 1e9a020..7de4021 100644 --- a/Orange_lala/home/urls.py +++ b/Orange_lala/home/urls.py @@ -12,7 +12,7 @@ app_name = "home" urlpatterns = [ path('', views.homepage, name='homepage'), # 首页 path('register/', views.register, name='register'), # 注册 - path('register_handle/', views.register_handle, name='register_handle'), # 注册处理 + 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'), # 登录及登录处理 @@ -27,6 +27,7 @@ urlpatterns = [ 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 index 49c09e6..0175513 100644 --- a/Orange_lala/home/views.py +++ b/Orange_lala/home/views.py @@ -265,9 +265,9 @@ def sort(request): #商品页面 def introduction_handle(request): - global host_list - username = request.session.get('username') - user = User.objects.get(username=username) + # global host_list + # username = request.session.get('username') + # user = User.objects.get(username=username) good_name = request.GET.get("good_name") #前端传递过来的商品名 # pindex = request.GET.get("pindex") # print(good_name) @@ -313,13 +313,13 @@ def introduction_handle(request): "images5_2": images5_2, # "page": page } - 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) + # 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) #加入购物车 def into_shopcart(request,id): @@ -418,8 +418,10 @@ def pay(request): order_price = 0 for x in shopcar: order_price += x.good_price + a = Order.objects.create(user_id=8,is_ok=0,is_pay=0,is_send=0,order_price=order_price) order_id = a.id + print(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}) @@ -435,6 +437,19 @@ def pay2(request,id): 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) diff --git a/Orange_lala/oneself/models.py b/Orange_lala/oneself/models.py index d82e967..9e9461f 100644 --- a/Orange_lala/oneself/models.py +++ b/Orange_lala/oneself/models.py @@ -5,23 +5,21 @@ # * 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 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) + user = models.ForeignKey('User', models.DO_NOTHING, 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) class Meta: - managed = True + managed = False db_table = 'adress' @@ -32,10 +30,39 @@ class AllTrade(models.Model): words = models.CharField(max_length=255, blank=True, null=True) class Meta: - managed = True + managed = False db_table = 'all_trade' +class AuthGroup(models.Model): + name = models.CharField(unique=True, max_length=80) + + class Meta: + managed = False + db_table = 'auth_group' + + +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 Meta: + managed = False + db_table = 'auth_permission' + unique_together = (('content_type', 'codename'),) + + class BaseArea(models.Model): base_areaid = models.AutoField(primary_key=True) name = models.CharField(max_length=50) @@ -43,7 +70,7 @@ class BaseArea(models.Model): vieworder = models.PositiveSmallIntegerField() class Meta: - managed = True + managed = False db_table = 'base_area' @@ -51,37 +78,80 @@ class BrandHome(models.Model): nick = models.CharField(db_column='Nick', max_length=255) # Field name made lowercase. class Meta: - managed = True + managed = False db_table = 'brand_home' class Collection(models.Model): - user = models.ForeignKey('User', models.CASCADE, blank=True, null=True) - good = models.ForeignKey('Goods', models.CASCADE, blank=True, null=True) + user = models.ForeignKey('User', models.DO_NOTHING, blank=True, null=True) + good = models.ForeignKey('Goods', models.DO_NOTHING, blank=True, null=True) class Meta: - managed = True + managed = False db_table = 'collection' class Comments(models.Model): - user = models.ForeignKey('User', models.CASCADE, blank=True, null=True) - good = models.ForeignKey('Goods', models.CASCADE, blank=True, null=True) + user = models.ForeignKey('User', models.DO_NOTHING, blank=True, null=True) + good = models.ForeignKey('Goods', models.DO_NOTHING, 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 = True + managed = False db_table = 'comments' +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 Meta: + managed = False + db_table = 'django_content_type' + unique_together = (('app_label', 'model'),) + + +class DjangoMigrations(models.Model): + app = models.CharField(max_length=255) + name = models.CharField(max_length=255) + applied = models.DateTimeField() + + class Meta: + managed = False + db_table = 'django_migrations' + + +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.CASCADE) + all_trade = models.ForeignKey(AllTrade, models.DO_NOTHING) class Meta: - managed = True + managed = False db_table = 'goodclass' @@ -102,23 +172,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.CASCADE) - brand_home = models.ForeignKey(BrandHome, models.CASCADE) - good_class = models.ForeignKey(Goodclass, models.CASCADE) + all_trade = models.ForeignKey(AllTrade, models.DO_NOTHING) + brand_home = models.ForeignKey(BrandHome, models.DO_NOTHING) + good_class = models.ForeignKey(Goodclass, models.DO_NOTHING) prices = models.CharField(max_length=255, blank=True, null=True) class Meta: - managed = True + managed = False db_table = 'goods' class GroupH(models.Model): id = models.IntegerField(primary_key=True) - user = models.ForeignKey('User', models.CASCADE) - user_member = models.ForeignKey('UserMenber', models.CASCADE, db_column='user_member') + user = models.ForeignKey('User', models.DO_NOTHING) + user_member = models.ForeignKey('UserMenber', models.DO_NOTHING, db_column='user_member') class Meta: - managed = True + managed = False db_table = 'group_h' @@ -128,26 +198,26 @@ class HomeLun(models.Model): lun_image = models.CharField(max_length=100) class Meta: - managed = True + managed = False 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) + goods = models.ForeignKey(Goods, models.DO_NOTHING, blank=True, null=True) assistant = models.IntegerField(blank=True, null=True) class Meta: - managed = True + managed = False 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) + news = models.ForeignKey('News', models.DO_NOTHING, blank=True, null=True) + user = models.ForeignKey('User', models.DO_NOTHING, blank=True, null=True) class Meta: - managed = True + managed = False db_table = 'new_user' @@ -157,7 +227,7 @@ class News(models.Model): new_title = models.CharField(max_length=255, blank=True, null=True) class Meta: - managed = True + managed = False db_table = 'news' @@ -165,7 +235,7 @@ class OneselfQuestionsafety(models.Model): question = models.CharField(unique=True, max_length=225) class Meta: - managed = True + managed = False db_table = 'oneself_questionsafety' @@ -173,52 +243,53 @@ class OneselfQuestionsafetytwo(models.Model): question = models.CharField(unique=True, max_length=225) class Meta: - managed = True + managed = False 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) + questionid = models.ForeignKey(OneselfQuestionsafety, models.DO_NOTHING, blank=True, null=True) + userid = models.ForeignKey('User', models.DO_NOTHING, blank=True, null=True) class Meta: - managed = True + managed = False 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) + questiontwoid = models.ForeignKey(OneselfQuestionsafetytwo, models.DO_NOTHING, blank=True, null=True) + userid = models.ForeignKey('User', models.DO_NOTHING, blank=True, null=True) class Meta: - managed = True + managed = False db_table = 'oneself_safetyanswertwo' class Order(models.Model): - user = models.ForeignKey('User', models.CASCADE, blank=True, null=True) + user = models.ForeignKey('User', models.DO_NOTHING, 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) + order_price = models.CharField(max_length=255, blank=True, null=True) class Meta: - managed = True + managed = False 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) + order = models.ForeignKey(Order, models.DO_NOTHING, blank=True, null=True) + good = models.ForeignKey(Goods, models.DO_NOTHING, 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 + managed = False db_table = 'order_good' @@ -226,54 +297,80 @@ class SafetyAccount(models.Model): question = models.CharField(max_length=255) class Meta: - managed = True + managed = False db_table = 'safety_account' class Shopcart(models.Model): - good = models.ForeignKey(Goods, models.CASCADE, blank=True, null=True) - user = models.ForeignKey('User', models.CASCADE, blank=True, null=True) + good = models.ForeignKey(Goods, models.DO_NOTHING, blank=True, null=True) + user = models.ForeignKey('User', models.DO_NOTHING, blank=True, null=True) good_num = models.IntegerField(blank=True, null=True) good_price = models.FloatField(blank=True, null=True) class Meta: - managed = True + managed = False db_table = 'shopcart' -class User(AbstractUser): +class User(models.Model): + 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, blank=True, null=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=8, blank=True, null=True) name = models.CharField(max_length=255, blank=True, null=True) - phone = models.CharField(max_length=11, blank=True, null=True,unique=True) + phone = models.CharField(max_length=11, blank=True, null=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,default=1) + member = models.ForeignKey('UserMenber', models.DO_NOTHING, blank=True, null=True) class Meta: + managed = False db_table = 'user' - verbose_name = '用户' - verbose_name_plural = verbose_name class UserAddress(models.Model): - id = models.IntegerField(primary_key=True) - useraddress = models.CharField(max_length=255) - user = models.ForeignKey('User', models.CASCADE, blank=True, null=True) + useraddress = models.CharField(max_length=255, blank=True, null=True) + userid = models.ForeignKey(User, models.DO_NOTHING, blank=True, null=True) + phone = models.CharField(max_length=11, blank=True, null=True) + username = models.CharField(max_length=64, blank=True, null=True) class Meta: - managed = True + managed = False db_table = 'user_address' +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 = True + managed = False 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/templates/home/introduction.html b/Orange_lala/templates/home/introduction.html index cdafb6b..f9db6cc 100644 --- a/Orange_lala/templates/home/introduction.html +++ b/Orange_lala/templates/home/introduction.html @@ -393,9 +393,19 @@
  • +
  • +
    + + +
    + +
    +
    + +
    +
    +

    确认收货地址

    +
    + +
    +
    +
      + {% for x in addr %} +
      +
    • + +
      +
      + + + {{ x.recipients }} + {{ x.tel }} + +
      +
      + 收货地址: + + {{ x.province }}省 + {{ x.city }}市 + {{ x.county }}区 + {{ x.detail_addr }} + + + +
      + 默认地址 +
      +
      + + +
      +
      + +
      + + + 编辑 + | + 删除 +
      + +
    • + {% endfor %} + +
    + +
    +
    + +
    +

    选择物流方式

    +
      +
    • 圆通
    • +
    • 申通
    • +
    • 韵达
    • +
    • 中通
    • +
    • 顺丰
    • +
    +
    +
    + + +
    +

    选择支付方式

    +
      +
    • 银联
    • +
    • 微信
    • +
    • 支付宝
    • +
    +
    +
    + + +
    +
    +

    确认订单信息

    +
    +
    + +
    +
    商品信息
    +
    +
    +
    单价
    +
    +
    +
    数量
    +
    +
    +
    金额
    +
    +
    +
    配送方式
    +
    + +
    +
    +
    + + +
    + {% for pic in img %} + {% if good.id == pic.goods_id %} +
    +
      +
      +
    • +
      + + +
      +
      + +
      +
    • +
    • +
      + 颜色:{{ good.taste }} + 包装:{{ good.pack }} +
      +
    • +
    • +
      +
      + {{ good.prices }} +
      +
      +
    • +
      +
    • +
      +
      + 购买数量 +
      +{# #} + {{ order.good_num }} +{# #} +
      +
      +
      +
    • +
    • +
      + {{ order.good_price }} +
      +
    • +
    • +
      + 配送方式 +
      + 快递10元 +
      +
      +
    • + +
    +
    + +
    + {% endif %} + {% endfor %} + + +
    +
    + +
    +
    + +
    + + +
    + + +
    +
  • + + 优惠券 + +
  • + +
  • + + 红包 + + +
  • + +
    +
    +
    + +
    +

    + 合计(含运费) ¥244.00 +

    +
    + + +
    +
    +
    +
    实付款: + + ¥ 244.00 + +
    + +
    + + + +
    + + + +
    + +
    + +
    +
    +
    +
    +
    + +
    +
    +
    + +
    +
    +
    + + +
    +
    新增地址 / Add address
    +
    +
    + +
    +
    + +
    + +
    + +
    +
    + +
    + +
    + +
    +
    + +
    + +
    + + + +
    +
    + +
    + +
    + + 100字以内写出你的详细地址... +
    +
    + +
    +
    +
    保存
    +
    取消
    +
    +
    +
    +
    + +
    + +
    + + + \ No newline at end of file -- Gitee From 0affa135f4957e7584de58e3c8e5bf7c3b54aea2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=97=A0=E6=80=A8=E6=97=A0=E6=82=94?= <1668030512@qq.com> Date: Thu, 26 Sep 2019 11:36:42 +0800 Subject: [PATCH 41/62] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=BA=86=E6=94=B6?= =?UTF-8?q?=E8=B4=A7=E5=9C=B0=E5=9D=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Orange_lala/Orange_lala/settings.py | 1 - Orange_lala/home/views.py | 18 +- .../oneself/migrations/0001_initial.py | 361 ++++++++++++++++++ .../migrations/0002_auto_20190926_1100.py | 18 + Orange_lala/oneself/models.py | 35 +- Orange_lala/oneself/urls.py | 20 +- Orange_lala/oneself/views.py | 158 +++++++- Orange_lala/templates/home/introduction.html | 15 +- Orange_lala/templates/person/address.html | 217 ++++++----- Orange_lala/templates/person/address2.html | 268 +++++++++++++ Orange_lala/templates/person/index.html | 106 +---- 11 files changed, 981 insertions(+), 236 deletions(-) create mode 100644 Orange_lala/oneself/migrations/0001_initial.py create mode 100644 Orange_lala/oneself/migrations/0002_auto_20190926_1100.py create mode 100644 Orange_lala/templates/person/address2.html diff --git a/Orange_lala/Orange_lala/settings.py b/Orange_lala/Orange_lala/settings.py index ad26207..8ad2063 100644 --- a/Orange_lala/Orange_lala/settings.py +++ b/Orange_lala/Orange_lala/settings.py @@ -139,7 +139,6 @@ CACHES = { "default": { "BACKEND": "django_redis.cache.RedisCache", "LOCATION": "redis://129.28.172.210:6379", - # "LOCATION": "redis://127.0.0.1:6379", "OPTIONS": { "CLIENT_CLASS": "django_redis.client.DefaultClient", } diff --git a/Orange_lala/home/views.py b/Orange_lala/home/views.py index 4d54ba6..1a6b307 100644 --- a/Orange_lala/home/views.py +++ b/Orange_lala/home/views.py @@ -1,3 +1,4 @@ +from django.contrib.auth.decorators import login_required from django.shortcuts import render from oneself.models import * from django.db.models import Q @@ -201,13 +202,19 @@ def verify(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 - return user + def login_handle(request): if request.method.lower()=='get': return render(request,'home/login.html') @@ -222,7 +229,9 @@ def login_handle(request): if not all([username,password,remember_me]): return render(request,'home/login.html',{'error_msg':'数据不完整'}) username = verify(username) - # print("useranme=====",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: @@ -250,9 +259,9 @@ def login_handle(request): # 退出登录 def my_logout(request): - response = redirect(reverse('home:homepage')) - response.delete_cookie('username') logout(request) + response = redirect(reverse('home:homepage')) + # response.delete_cookie('username') return response @@ -430,6 +439,7 @@ def search(request): return render(request, "home/search.html") #购物车 +@login_required def shopcart(request): username = request.COOKIES.get('username') if username is not None: diff --git a/Orange_lala/oneself/migrations/0001_initial.py b/Orange_lala/oneself/migrations/0001_initial.py new file mode 100644 index 0000000..a678b11 --- /dev/null +++ b/Orange_lala/oneself/migrations/0001_initial.py @@ -0,0 +1,361 @@ +# Generated by Django 2.2.4 on 2019-09-26 02:20 + +from django.conf import settings +import django.contrib.auth.models +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + ('auth', '0011_update_proxy_permissions'), + ] + + operations = [ + migrations.CreateModel( + name='User', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('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')), + ], + options={ + 'db_table': 'user', + 'managed': True, + }, + managers=[ + ('objects', django.contrib.auth.models.UserManager()), + ], + ), + migrations.CreateModel( + name='AllTrade', + 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={ + 'db_table': 'all_trade', + 'managed': True, + }, + ), + migrations.CreateModel( + name='BaseArea', + fields=[ + ('base_areaid', models.AutoField(primary_key=True, serialize=False)), + ('name', models.CharField(max_length=50)), + ('parentid', models.PositiveIntegerField()), + ('vieworder', models.PositiveSmallIntegerField()), + ], + options={ + '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(db_column='Nick', max_length=255)), + ], + options={ + '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(max_length=255)), + ('all_trade', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='oneself.AllTrade')), + ], + options={ + '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.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)), + ('lun_name', models.CharField(max_length=255)), + ('lun_image', models.CharField(max_length=100)), + ], + options={ + 'db_table': 'home_lun', + 'managed': True, + }, + ), + migrations.CreateModel( + name='News', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, 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={ + '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='SafetyAccount', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('question', models.CharField(max_length=255)), + ], + options={ + '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(max_length=255)), + ], + options={ + '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 0000000..cbb258f --- /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/models.py b/Orange_lala/oneself/models.py index d82e967..6e42447 100644 --- a/Orange_lala/oneself/models.py +++ b/Orange_lala/oneself/models.py @@ -18,7 +18,7 @@ class Adress(models.Model): 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) + is_choose = models.CharField(max_length=255, blank=True, null=True,default="0") class Meta: managed = True @@ -36,6 +36,8 @@ class AllTrade(models.Model): db_table = 'all_trade' + + class BaseArea(models.Model): base_areaid = models.AutoField(primary_key=True) name = models.CharField(max_length=50) @@ -76,6 +78,8 @@ class Comments(models.Model): + + class Goodclass(models.Model): good_class_name = models.CharField(max_length=255) all_trade = models.ForeignKey(AllTrade, models.CASCADE) @@ -205,6 +209,7 @@ class Order(models.Model): 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) + order_price = models.CharField(max_length=255, blank=True, null=True) class Meta: managed = True @@ -242,29 +247,30 @@ class Shopcart(models.Model): class User(AbstractUser): - nickname = models.CharField(max_length=255, blank=True, null=True) + 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, 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,unique=True) sex = models.CharField(max_length=8, blank=True, null=True) - name = models.CharField(max_length=255, 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,default=1) + member = models.ForeignKey('UserMenber', models.CASCADE, blank=True, null=True) class Meta: + managed = True db_table = 'user' - verbose_name = '用户' - verbose_name_plural = verbose_name -class UserAddress(models.Model): - id = models.IntegerField(primary_key=True) - useraddress = models.CharField(max_length=255) - user = models.ForeignKey('User', models.CASCADE, blank=True, null=True) - - class Meta: - managed = True - db_table = 'user_address' @@ -277,3 +283,4 @@ class UserMenber(models.Model): managed = True db_table = 'user_menber' + diff --git a/Orange_lala/oneself/urls.py b/Orange_lala/oneself/urls.py index d1eb6e2..6191b4a 100644 --- a/Orange_lala/oneself/urls.py +++ b/Orange_lala/oneself/urls.py @@ -8,33 +8,41 @@ app_name = 'myself' urlpatterns = [ 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_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_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'), # 验证邮箱发送的验证码 + 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_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'), # 我的评价 diff --git a/Orange_lala/oneself/views.py b/Orange_lala/oneself/views.py index 7702c84..1029326 100644 --- a/Orange_lala/oneself/views.py +++ b/Orange_lala/oneself/views.py @@ -1,12 +1,17 @@ import json +import re 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 @@ -14,12 +19,12 @@ 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 #个人中心 -# @login_required def myself_index(request): # username = request.session.get('username') # user = User.objects.get(username=username) @@ -64,6 +69,8 @@ def myself_information(request): 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': @@ -90,11 +97,16 @@ def myself_information_handle(request): 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): username = request.COOKIES.get('username') @@ -115,6 +127,7 @@ def myself_setpay(request): 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') @@ -141,31 +154,31 @@ def myself_password(request): 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]): - # print("user===/////==",user) return render(request,'person/password.html',{"bai":"请您把信息填写完整"}) if npwd!=ncpwd: print('两次输入的密码不一致') return render(request, 'person/password.html', {"bai": "两次输入的新密码不一致"}) - else: - 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() - # return render(request, "person/password.html",{"bai":"密码修改成功"}) - response = redirect(reverse('home:homepage')) - response.delete_cookie('username') - logout(request) - return response + 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): 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 @@ -191,6 +204,7 @@ def myself_bindphone_handle(request): def myself_email(request): return render(request, "person/email.html") + def send_email_user(request): username=request.COOKIES.get('username') print(username) @@ -219,6 +233,7 @@ def check_email_user(request): else: return restful.params_error('验证码错误', data=None) + def myself_email_handle(request): if request.method.lower()=="post": email=request.POST.get('useremail') @@ -250,6 +265,7 @@ def myself_question(request): 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() @@ -272,7 +288,114 @@ def myself_question_handle(request): #收货地址 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}) + #我的交易 #订单管理 @@ -380,6 +503,7 @@ def myself_bonus(request): def myself_bill(request): return render(request, "person/bill.html") + def myself_billlist(request): return render(request, "person/billlist.html") diff --git a/Orange_lala/templates/home/introduction.html b/Orange_lala/templates/home/introduction.html index 5098634..5c11a9c 100644 --- a/Orange_lala/templates/home/introduction.html +++ b/Orange_lala/templates/home/introduction.html @@ -327,8 +327,10 @@ 库存{{ good.repertory }} {% endfor %} +
    +
    @@ -739,13 +741,18 @@

    diff --git a/Orange_lala/templates/person/address.html b/Orange_lala/templates/person/address.html index 8b55fed..2d055a3 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 0000000..de1513e --- /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/index.html b/Orange_lala/templates/person/index.html index ea845fc..77c93ad 100644 --- a/Orange_lala/templates/person/index.html +++ b/Orange_lala/templates/person/index.html @@ -15,74 +15,7 @@ -{# #} -{#
    #} -{#
    #} -{# #} -{#
    #} -{#
    #} -{#
    #} -{# #} {% include 'person/top.html' %} -{#{% include 'home/header.html' %}#}
    @@ -107,10 +40,10 @@
    @@ -121,21 +54,21 @@ 个人资产

    - + 红包 2

    - + 优惠券 2

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

    @@ -177,12 +110,11 @@ 我的常用 @@ -540,10 +472,10 @@ -- Gitee From 3b0ddb94a335fcf6eb5aecf629da2f98ac907b50 Mon Sep 17 00:00:00 2001 From: junjiehou <1904318367@qq.com> Date: Thu, 26 Sep 2019 14:05:04 +0800 Subject: [PATCH 42/62] 1 --- .../oneself/migrations/0001_initial.py | 395 ++++++++++++++++++ 1 file changed, 395 insertions(+) create mode 100644 Orange_lala/oneself/migrations/0001_initial.py diff --git a/Orange_lala/oneself/migrations/0001_initial.py b/Orange_lala/oneself/migrations/0001_initial.py new file mode 100644 index 0000000..b6b8d79 --- /dev/null +++ b/Orange_lala/oneself/migrations/0001_initial.py @@ -0,0 +1,395 @@ +# Generated by Django 2.1.3 on 2019-09-24 11:35 + +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): + + initial = True + + dependencies = [ + ('auth', '0012_auto_20190730_0914'), + ] + + operations = [ + migrations.CreateModel( + 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)), + ('sex', models.CharField(blank=True, max_length=8, null=True)), + ('name', models.CharField(blank=True, max_length=255, null=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')), + ], + options={ + 'verbose_name': '用户', + 'verbose_name_plural': '用户', + 'db_table': 'user', + }, + managers=[ + ('objects', django.contrib.auth.models.UserManager()), + ], + ), + 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.CreateModel( + name='AllTrade', + 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={ + 'db_table': 'all_trade', + 'managed': True, + }, + ), + migrations.CreateModel( + name='BaseArea', + fields=[ + ('base_areaid', models.AutoField(primary_key=True, serialize=False)), + ('name', models.CharField(max_length=50)), + ('parentid', models.PositiveIntegerField()), + ('vieworder', models.PositiveSmallIntegerField()), + ], + options={ + '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(db_column='Nick', max_length=255)), + ], + options={ + 'db_table': 'brand_home', + 'managed': True, + }, + ), + migrations.CreateModel( + name='Collection', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ], + options={ + 'db_table': 'collection', + '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)), + ], + options={ + 'db_table': 'comments', + '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(max_length=255)), + ('all_trade', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='oneself.AllTrade')), + ], + options={ + '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.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='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)), + ], + options={ + 'db_table': 'group_h', + 'managed': True, + }, + ), + migrations.CreateModel( + name='HomeLun', + fields=[ + ('lun_id', models.AutoField(primary_key=True, serialize=False)), + ('lun_name', models.CharField(max_length=255)), + ('lun_image', models.CharField(max_length=100)), + ], + options={ + 'db_table': 'home_lun', + '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='News', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, 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={ + 'db_table': 'news', + '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='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='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='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='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)), + ('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='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='SafetyAccount', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('question', models.CharField(max_length=255)), + ], + options={ + 'db_table': 'safety_account', + '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='UserAddress', + fields=[ + ('id', models.IntegerField(primary_key=True, serialize=False)), + ('useraddress', models.CharField(max_length=255)), + ('user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), + ], + options={ + 'db_table': 'user_address', + 'managed': True, + }, + ), + migrations.CreateModel( + name='UserMenber', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('rember', models.CharField(max_length=255)), + ], + options={ + 'db_table': 'user_menber', + 'managed': True, + }, + ), + migrations.AddField( + model_name='grouph', + name='user_member', + field=models.ForeignKey(db_column='user_member', on_delete=django.db.models.deletion.CASCADE, to='oneself.UserMenber'), + ), + migrations.AddField( + model_name='comments', + name='good', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='oneself.Goods'), + ), + migrations.AddField( + model_name='comments', + name='user', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL), + ), + migrations.AddField( + model_name='collection', + name='good', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='oneself.Goods'), + ), + migrations.AddField( + model_name='collection', + name='user', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL), + ), + migrations.AddField( + model_name='user', + name='member', + field=models.ForeignKey(blank=True, default=1, 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'), + ), + ] -- Gitee From 6608212b8fc50340376a4740c6bb2bfd0c6448d3 Mon Sep 17 00:00:00 2001 From: junjiehou <1904318367@qq.com> Date: Thu, 26 Sep 2019 14:08:43 +0800 Subject: [PATCH 43/62] =?UTF-8?q?=E5=88=A0=E9=99=A4=E5=BF=BD=E7=95=A5?= =?UTF-8?q?=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .idea/Orange_lala_8.iml | 19 + .idea/misc.xml | 7 + .idea/modules.xml | 8 + .idea/vcs.xml | 6 + .idea/workspace.xml | 662 ++++++++++++++++++ .../__pycache__/__init__.cpython-37.pyc | Bin 169 -> 0 bytes .../__pycache__/0001_initial.cpython-37.pyc | Bin 5871 -> 0 bytes .../__pycache__/__init__.cpython-37.pyc | Bin 172 -> 0 bytes 8 files changed, 702 insertions(+) create mode 100644 .idea/Orange_lala_8.iml create mode 100644 .idea/misc.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/vcs.xml create mode 100644 .idea/workspace.xml delete mode 100644 Orange_lala/home/migrations/__pycache__/__init__.cpython-37.pyc delete mode 100644 Orange_lala/oneself/migrations/__pycache__/0001_initial.cpython-37.pyc delete mode 100644 Orange_lala/oneself/migrations/__pycache__/__init__.cpython-37.pyc diff --git a/.idea/Orange_lala_8.iml b/.idea/Orange_lala_8.iml new file mode 100644 index 0000000..ef3a7c5 --- /dev/null +++ b/.idea/Orange_lala_8.iml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..7390deb --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,7 @@ + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..c779272 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml new file mode 100644 index 0000000..9dc00f0 --- /dev/null +++ b/.idea/workspace.xml @@ -0,0 +1,662 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + DEFINITION_ORDER + + + + + + + + + + + + + + + + + + + + + + - - - - + {% include "home/header.html" %}
    @@ -166,10 +126,18 @@ numbers = $(this).text() if(numbers > 1){ price = $("#{{ m.goods.name }}1").text() * 0.8 + pr = price.toFixed(2) }else{ price = $("#{{ m.goods.name }}1").text() + pr = price.toFixed(2) } - $("#{{ m.goods.name }}2").text(price) + + $("#{{ m.goods.name }}2").text(pr) + }) + $("#all_p").text(function () { + a_p = $(this).text() * 1 + a_p2 = a_p.toFixed(2) + document.getElementById("all_p").innerHTML = a_p2 }) @@ -177,14 +145,14 @@
  • - {{ l.good_price }}元 + {{ l.good_price }}
  • diff --git a/Orange_lala/templates/person/address.html b/Orange_lala/templates/person/address.html index 2d055a3..a98ef54 100644 --- a/Orange_lala/templates/person/address.html +++ b/Orange_lala/templates/person/address.html @@ -82,7 +82,7 @@ {% else %} {% for useraddress in useraddress %}
  • - 默认地址 + 设为默认

    {{ useraddress.recipients }} {{ useraddress.tel }} -- Gitee From 778f26e12709ba5516388b2514d0987bd6001135 Mon Sep 17 00:00:00 2001 From: junjiehou <1904318367@qq.com> Date: Thu, 26 Sep 2019 20:44:42 +0800 Subject: [PATCH 49/62] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=96=87=E4=BB=B6=20.i?= =?UTF-8?q?dea?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .idea/Orange_lala_8.iml | 19 -- .idea/misc.xml | 7 - .idea/modules.xml | 8 - .idea/vcs.xml | 6 - .idea/workspace.xml | 662 ---------------------------------------- 5 files changed, 702 deletions(-) delete mode 100644 .idea/Orange_lala_8.iml delete mode 100644 .idea/misc.xml delete mode 100644 .idea/modules.xml delete mode 100644 .idea/vcs.xml delete mode 100644 .idea/workspace.xml diff --git a/.idea/Orange_lala_8.iml b/.idea/Orange_lala_8.iml deleted file mode 100644 index ef3a7c5..0000000 --- a/.idea/Orange_lala_8.iml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml deleted file mode 100644 index 7390deb..0000000 --- a/.idea/misc.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml deleted file mode 100644 index c779272..0000000 --- a/.idea/modules.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml deleted file mode 100644 index 94a25f7..0000000 --- a/.idea/vcs.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml deleted file mode 100644 index 9dc00f0..0000000 --- a/.idea/workspace.xml +++ /dev/null @@ -1,662 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - true - DEFINITION_ORDER - - - - - - - - - - - - - - - - - - - - - - #} +{# #} +{# #} +

    + + +
    + + + +
    + +
  • 综合排序
  • +
  • 销量排序
  • +
  • 价格优先
  • +
  • 评价为主
  • + + +{# {% block main_content %}#} +{#
    #} +{##} +{#
      #} +{#
    • #} +{#
      #} +{# #} +{#

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

      #} +{#

      #} +{# ¥#} +{# 56.90#} +{#

      #} +{#

      #} +{# 销量1110#} +{#

      #} +{#
      #} +{#
    • #} +{#
    • #} +{#
      #} +{##} +{# #} +{#

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

      #} +{#

      #} +{# ¥#} +{# 56.90#} +{#

      #} +{#

      #} +{# 销量1110#} +{#

      #} +{#
      #} +{#
    • #} +{#
    • #} +{#
      #} +{##} +{# #} +{#

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

      #} +{#

      #} +{# ¥#} +{# 56.90#} +{#

      #} +{#

      #} +{# 销量1110#} +{#

      #} +{#
      #} +{#
    • #} +{#
    • #} +{#
      #} +{##} +{# #} +{#

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

      #} +{#

      #} +{# ¥#} +{# 56.90#} +{#

      #} +{#

      #} +{# 销量1110#} +{#

      #} +{#
      #} +{#
    • #} +{#
    • #} +{#
      #} +{##} +{# #} +{#

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

      #} +{#

      #} +{# ¥#} +{# 56.90#} +{#

      #} +{#

      #} +{# 销量1110#} +{#

      #} +{#
      #} +{#
    • #} +{#
    • #} +{#
      #} +{##} +{# #} +{#

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

      #} +{#

      #} +{# ¥#} +{# 56.90#} +{#

      #} +{#

      #} +{# 销量1110#} +{#

      #} +{#
      #} +{#
    • #} +{#
    • #} +{#
      #} +{##} +{# #} +{#

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

      #} +{#

      #} +{# ¥#} +{# 56.90#} +{#

      #} +{#

      #} +{# 销量1110#} +{#

      #} +{#
      #} +{#
    • #} +{#
    • #} +{#
      #} +{##} +{# #} +{#

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

      #} +{#

      #} +{# ¥#} +{# 56.90#} +{#

      #} +{#

      #} +{# 销量1110#} +{#

      #} +{#
      #} +{#
    • #} +{#
    • #} +{#
      #} +{##} +{# #} +{#

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

      #} +{#

      #} +{# ¥#} +{# 56.90#} +{#

      #} +{#

      #} +{# 销量1110#} +{#

      #} +{#
      #} +{#
    • #} +{#
    • #} +{#
      #} +{##} +{# #} +{#

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

      #} +{#

      #} +{# ¥#} +{# 56.90#} +{#

      #} +{#

      #} +{# 销量1110#} +{#

      #} +{#
      #} +{#
    • #} +{#
    • #} +{#
      #} +{##} +{# #} +{#

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

      #} +{#

      #} +{# ¥#} +{# 56.90#} +{#

      #} +{#

      #} +{# 销量1110#} +{#

      #} +{#
      #} +{#
    • #} +{#
    • #} +{#
      #} +{##} +{# #} +{#

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

      #} +{#

      #} +{# ¥#} +{# 56.90#} +{#

      #} +{#

      #} +{# 销量1110#} +{#

      #} +{#
      #} +{#
    • #} +{#
    #} +{# #} +{#
    #} +{##} +{#
    #} +{# 经典搭配#} +{#
    #} +{##} +{#
  • #} +{#
    #} +{# #} +{#

    萨拉米 1+1小鸡腿

    #} +{#

    #} +{# ¥#} +{# 29.90#} +{#

    #} +{#

    #} +{# 销量1110#} +{#

    #} +{#
    #} +{#
  • #} +{#
  • #} +{#
    #} +{# #} +{#

    ZEK 原味海苔

    #} +{#

    #} +{# ¥#} +{# 8.90#} +{#

    #} +{#

    #} +{# 销量1110#} +{#

    #} +{#
    #} +{#
  • #} +{#
  • #} +{##} +{#
    #} +{# #} +{#

    萨拉米 1+1小鸡腿

    #} +{#

    #} +{# ¥#} +{# 29.90#} +{#

    #} +{#

    #} +{# 销量1110#} +{#

    #} +{#
    #} +{#
  • #} +{##} +{#
    #} +{##} +{#
    #} +{# #} +{#
      #} +{#
    • «
    • #} +{#
    • 1
    • #} +{#
    • 2
    • #} +{#
    • 3
    • #} +{#
    • 4
    • #} +{#
    • 5
    • #} +{#
    • »
    • #} +{#
    #} +{##} +{# #} +{# #} + + + + +{#{% endblock main_content %}#} + + + + +
    + + + + + + + +
    + + + +
    + + + + \ No newline at end of file diff --git a/Orange_lala/templates/search/search.html b/Orange_lala/templates/search/search.html index 368a1b8..e60f05a 100644 --- a/Orange_lala/templates/search/search.html +++ b/Orange_lala/templates/search/search.html @@ -3,6 +3,7 @@ {% block title %}悦桔拉拉-商品搜索结果列表{% endblock title %} {% block main_content %}
    @@ -392,7 +409,6 @@
    -
    优惠套装
    - - + +
    -
    -
      -
      -

      看了又看

      +
      +
        +
        +

        看了又看

        {% for g in goodss %}
      • @@ -439,7 +455,7 @@
        ¥{{ g.prices }}
      • {% endfor %} -
      +
    @@ -506,13 +522,13 @@
    - +
    -
    - 100%
    好评度 +
    + 100%
    好评度
    -
    -
    买家印象
    +
    +
    买家印象
    味道不错(2177) 颗粒饱满(1860) @@ -522,10 +538,10 @@ 个个开口(1392) 价格便宜(1119) 特价买的(865) - 皮很薄(831) -
    -
    -
    + 皮很薄(831) + + +
      @@ -562,41 +578,44 @@
        -
      • - - - - - - -
        - -
        - -
        - - b***1 (匿名) - - 评论于 - -
        -
        - -
        -
        -
        - 摸起来丝滑柔软,不厚,没色差,颜色好看!买这个衣服还接到诈骗电话,我很好奇他们是怎么知道我买了这件衣服,并且还知道我的电话的! -
        -
        - 颜色分类:柠檬黄  尺码:S -
        -
        - -
        - -
        -
      • + {% for comment in comments %} + {% if comment.good.id == good %} +
      • + + + + + +
        + +
        + +
        + + {{ comment.user.username }} + + 评论于 + +
        +
        + +
        +
        +
        + {{ comment.comment }} +
        +
        + +
        +
        + +
        + +
        +
      • + {% endif %} + {% endfor %}
      diff --git a/Orange_lala/templates/person/order.html b/Orange_lala/templates/person/order.html index a7537fb..6d7989f 100644 --- a/Orange_lala/templates/person/order.html +++ b/Orange_lala/templates/person/order.html @@ -439,7 +439,7 @@
    diff --git a/Orange_lala/templates/person/orderinfo.html b/Orange_lala/templates/person/orderinfo.html index 79d99cb..4accc53 100644 --- a/Orange_lala/templates/person/orderinfo.html +++ b/Orange_lala/templates/person/orderinfo.html @@ -271,7 +271,7 @@
  • -- Gitee From f353c99b5a08178a2eee45f3d74e170b03f70e18 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=97=A0=E6=80=A8=E6=97=A0=E6=82=94?= <1668030512@qq.com> Date: Sat, 28 Sep 2019 20:13:26 +0800 Subject: [PATCH 61/62] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=94=B6=E8=B4=A7?= =?UTF-8?q?=E5=9C=B0=E5=9D=80=E7=9A=84=E5=A2=9E=E5=88=A0=E6=94=B9=E4=BB=A5?= =?UTF-8?q?=E5=8F=8A=E9=BB=98=E8=AE=A4=E5=9C=B0=E5=9D=80=E7=9A=84=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Orange_lala/Orange_lala/settings.py | 14 +- Orange_lala/home/views.py | 22 +- .../oneself/migrations/0001_initial.py | 259 ++++++++---------- Orange_lala/oneself/models.py | 2 +- Orange_lala/oneself/urls.py | 2 + Orange_lala/oneself/views.py | 26 +- Orange_lala/templates/home/shopcart.html | 14 +- Orange_lala/templates/person/address.html | 9 +- 8 files changed, 181 insertions(+), 167 deletions(-) diff --git a/Orange_lala/Orange_lala/settings.py b/Orange_lala/Orange_lala/settings.py index 5d92030..83b7a21 100644 --- a/Orange_lala/Orange_lala/settings.py +++ b/Orange_lala/Orange_lala/settings.py @@ -55,7 +55,7 @@ MIDDLEWARE = [ 'django.middleware.cache.FetchFromCacheMiddleware', # 放在最后面 ] # 全局配置: -CACHE_MIDDLEWARE_SECONDS=60*10 #缓存缓存60*10秒 +CACHE_MIDDLEWARE_SECONDS=10 #缓存缓存60*10秒 ROOT_URLCONF = 'Orange_lala.urls' @@ -91,7 +91,7 @@ WSGI_APPLICATION = 'Orange_lala.wsgi.application' DATABASES = { 'default': { 'ENGINE': 'django.db.backends.mysql', - 'NAME': 'shopping', + 'NAME': 'nuhua', 'HOST': '106.14.141.219', 'POST': '3306', 'USER': 'member', @@ -139,17 +139,22 @@ USE_TZ = True STATIC_URL = '/static/' STATICFILES_DIRS = [os.path.join(BASE_DIR, 'static')] +# django-redis缓存 # django-redis缓存 CACHES = { "default": { "BACKEND": "django_redis.cache.RedisCache", - "LOCATION": "redis://129.28.172.210:6379", + # "LOCATION": "redis://129.28.172.210:6379", + "LOCATION": "redis://127.0.0.1:6379", "OPTIONS": { "CLIENT_CLASS": "django_redis.client.DefaultClient", } } } + + + # 将session缓存在Redis中 SESSION_ENGINE = "django.contrib.sessions.backends.cache" SESSION_CACHE_ALIAS = "default" @@ -185,4 +190,5 @@ HAYSTACK_SIGNAL_PROCESSOR = 'haystack.signals.RealtimeSignalProcessor' # 指定每页显示的商品数目 -HAYSTACK_SEARCH_RESULTS_PER_PAGE = 6 \ No newline at end of file +HAYSTACK_SEARCH_RESULTS_PER_PAGE = 6 + diff --git a/Orange_lala/home/views.py b/Orange_lala/home/views.py index 914c931..ab14291 100644 --- a/Orange_lala/home/views.py +++ b/Orange_lala/home/views.py @@ -22,6 +22,7 @@ from oneself.models import UserMenber from home import restful from oneself.models import User from home.ask import aliyunsms +from oneself.models import Comments from home.random_username import UserRange # Create your views here. @@ -243,13 +244,19 @@ def verify(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 - return user + def login_handle(request): if request.method.lower()=='get': return render(request,'home/login.html') @@ -266,7 +273,9 @@ def login_handle(request): if not all([username,password,remember_me]): return render(request,'home/login.html',{'error_msg':'数据不完整'}) username = verify(username) - # print("useranme=====",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: @@ -295,7 +304,7 @@ def login_handle(request): # 退出登录 def my_logout(request): response = redirect(reverse('home:homepage')) - response.delete_cookie('username') + # response.delete_cookie('username') logout(request) return response @@ -330,7 +339,6 @@ def introduction_handle(request): images4 = Images.objects.filter(goods_id=good).first().name #找到副id与商品id相同的第一个 images5 = [] #存放同类型商品图片 images5_2 = [] #存放大类型相同的商品 - comments = Comments.objects.filter(good=good) #找到该商品的评论 for i in goodss: image5 = Images.objects.filter(Q(goods_id=i.id) & ~Q(assistant=i.id)).first() images5.append(image5) @@ -343,7 +351,7 @@ def introduction_handle(request): # else: # str(pindex) # page = paginator.page(int(pindex)) - + comments=Comments.objects.filter(good=good) context = { "id": good, "shop_number": shop_number, @@ -512,9 +520,9 @@ def shopcart(request): def remove_shopcart(request,id): username = request.COOKIES.get('username') user = User.objects.get(username=username).id - a = Shopcart.objects.filter(user_id=user, good_id=id) + a = Shopcart.objects.filter(user_id=user, id=id) a.delete() - return redirect('home:shopcart') + return redirect(reverse('home:shopcart')) #购物车结算 def pay(request): diff --git a/Orange_lala/oneself/migrations/0001_initial.py b/Orange_lala/oneself/migrations/0001_initial.py index 52dc630..4a5479e 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.8 on 2019-09-25 02:14 +# Generated by Django 2.2.4 on 2019-09-28 11:14 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', '0009_alter_user_last_name_max_length'), + ('auth', '0011_update_proxy_permissions'), ] operations = [ @@ -21,19 +19,19 @@ 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)), + ('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)), + ('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)), @@ -41,32 +39,13 @@ class Migration(migrations.Migration): ('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')), ], options={ - 'verbose_name': '用户', - 'verbose_name_plural': '用户', 'db_table': 'user', + 'managed': True, }, managers=[ ('objects', django.contrib.auth.models.UserManager()), ], ), - 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.CreateModel( name='AllTrade', fields=[ @@ -105,28 +84,6 @@ class Migration(migrations.Migration): 'managed': True, }, ), - migrations.CreateModel( - name='Collection', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ], - options={ - 'db_table': 'collection', - '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)), - ], - options={ - 'db_table': 'comments', - 'managed': True, - }, - ), migrations.CreateModel( name='Goodclass', fields=[ @@ -170,98 +127,117 @@ class Migration(migrations.Migration): }, ), migrations.CreateModel( - name='GroupH', + name='HomeLun', fields=[ - ('id', models.IntegerField(primary_key=True, serialize=False)), - ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), + ('lun_id', models.AutoField(primary_key=True, serialize=False)), + ('lun_name', models.CharField(max_length=255)), + ('lun_image', models.CharField(max_length=100)), ], options={ - 'db_table': 'group_h', + 'db_table': 'home_lun', 'managed': True, }, ), migrations.CreateModel( - name='HomeLun', + name='News', fields=[ - ('lun_id', models.AutoField(primary_key=True, serialize=False)), - ('lun_name', models.CharField(max_length=255)), - ('lun_image', models.CharField(max_length=100)), + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, 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={ - 'db_table': 'home_lun', + 'db_table': 'news', 'managed': True, }, ), migrations.CreateModel( - name='Images', + name='OneselfQuestionsafety', 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')), + ('question', models.CharField(max_length=225, unique=True)), ], options={ - 'db_table': 'images', + 'db_table': 'oneself_questionsafety', 'managed': True, }, ), migrations.CreateModel( - name='News', + name='OneselfQuestionsafetytwo', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, 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)), + ('question', models.CharField(max_length=225, unique=True)), ], options={ - 'db_table': 'news', + 'db_table': 'oneself_questionsafetytwo', 'managed': True, }, ), migrations.CreateModel( - name='NewUser', + name='Order', 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')), + ('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.FloatField(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': 'new_user', + 'db_table': 'order', 'managed': True, }, ), migrations.CreateModel( - name='OneselfQuestionsafety', + name='SafetyAccount', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('question', models.CharField(max_length=225, unique=True)), + ('question', models.CharField(max_length=255)), ], options={ - 'db_table': 'oneself_questionsafety', + 'db_table': 'safety_account', 'managed': True, }, ), migrations.CreateModel( - name='OneselfQuestionsafetytwo', + name='UserMenber', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('question', models.CharField(max_length=225, unique=True)), + ('rember', models.CharField(max_length=255)), ], options={ - 'db_table': 'oneself_questionsafetytwo', + 'db_table': 'user_menber', 'managed': True, }, ), migrations.CreateModel( - name='OneselfSafetyanswer', + name='Shopcart', 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)), + ('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': 'oneself_safetyanswer', + '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, }, ), @@ -279,113 +255,104 @@ class Migration(migrations.Migration): }, ), migrations.CreateModel( - name='Order', + name='OneselfSafetyanswer', 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)), - ('user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), + ('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': 'order', + 'db_table': 'oneself_safetyanswer', 'managed': True, }, ), migrations.CreateModel( - name='OrderGood', + name='NewUser', 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')), + ('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': 'order_good', + 'db_table': 'new_user', 'managed': True, }, ), migrations.CreateModel( - name='SafetyAccount', + name='Images', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('question', models.CharField(max_length=255)), + ('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': 'safety_account', + 'db_table': 'images', 'managed': True, }, ), migrations.CreateModel( - name='Shopcart', + 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')), - ('good_num', models.IntegerField(blank=True, null=True)), - ('good_price', models.FloatField(blank=True, null=True)), + ('comment', models.CharField(blank=True, max_length=255, null=True)), + ('comment_img', models.CharField(blank=True, max_length=255, null=True)), + ('comment_time', models.DateTimeField(auto_now_add=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', + 'db_table': 'comments', 'managed': True, }, ), migrations.CreateModel( - name='UserAddress', + name='Collection', fields=[ - ('id', models.IntegerField(primary_key=True, serialize=False)), - ('useraddress', models.CharField(max_length=255)), + ('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': 'user_address', + 'db_table': 'collection', 'managed': True, }, ), migrations.CreateModel( - name='UserMenber', + name='Adress', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('rember', models.CharField(max_length=255)), + ('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, default='0', 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': 'user_menber', + 'db_table': 'adress', 'managed': True, }, ), - migrations.AddField( - model_name='grouph', - name='user_member', - field=models.ForeignKey(db_column='user_member', on_delete=django.db.models.deletion.CASCADE, to='oneself.UserMenber'), - ), - migrations.AddField( - model_name='comments', - name='good', - field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='oneself.Goods'), - ), - migrations.AddField( - model_name='comments', - name='user', - field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL), - ), - migrations.AddField( - model_name='collection', - name='good', - field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='oneself.Goods'), - ), - migrations.AddField( - model_name='collection', - name='user', - field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL), - ), migrations.AddField( model_name='user', name='member', - field=models.ForeignKey(blank=True, default=1, null=True, on_delete=django.db.models.deletion.CASCADE, to='oneself.UserMenber'), + field=models.ForeignKey(blank=True, default='1', null=True, on_delete=django.db.models.deletion.CASCADE, to='oneself.UserMenber'), ), migrations.AddField( model_name='user', diff --git a/Orange_lala/oneself/models.py b/Orange_lala/oneself/models.py index 5ba6650..04620e7 100644 --- a/Orange_lala/oneself/models.py +++ b/Orange_lala/oneself/models.py @@ -261,7 +261,7 @@ class User(AbstractUser): 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, default='1') + member = models.ForeignKey('UserMenber', models.CASCADE, blank=True, null=True,default='1') class Meta: managed = True diff --git a/Orange_lala/oneself/urls.py b/Orange_lala/oneself/urls.py index 35ffa9f..f4dd52f 100644 --- a/Orange_lala/oneself/urls.py +++ b/Orange_lala/oneself/urls.py @@ -26,6 +26,8 @@ urlpatterns = [ 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('alert_is_choose///',login_required(views.alert_is_choose),name='alert_is_choose'), # 设置默认地址 + path('recive_good/', login_required(views.recive_good), name='recive_good'), path('myself_order/', login_required(views.myself_order), name='myself_order'), # 我的订单 path('close_order//',views.close_order,name='close_order'),#取消订单 diff --git a/Orange_lala/oneself/views.py b/Orange_lala/oneself/views.py index 1029326..2a34b34 100644 --- a/Orange_lala/oneself/views.py +++ b/Orange_lala/oneself/views.py @@ -3,7 +3,7 @@ import re from django.conf import settings from django.shortcuts import render, HttpResponse, redirect - +from home.restful import method_error # from django.contrib.auth.decorators import login_required from django.shortcuts import render,HttpResponse,redirect from django.urls import reverse @@ -396,6 +396,30 @@ def user_update_address_handle(request,useraddressid): # print(detail_address_all) return render(request,'person/address.html',{"error":"恭喜您地址重新编辑成功成功","useraddress":useraddress}) +# 默认地址的is_choose变为 1 +def alert_is_choose(request,useraddressid,userid): + # if request.is_ajax(): + # print("执行") + # user_address_id=request.GET.get('addressid') + # userid=request.GET.get('userid') + address=Adress.objects.get(id=useraddressid,user_id=userid) + address.is_choose="1" + address.save() + if Adress.objects.get(id=useraddressid,user_id=userid).is_choose=="1": + address_a = Adress.objects.filter(user_id=userid).exclude(id=useraddressid)[0].id + addressss=Adress.objects.get(id=address_a) + addressss.is_choose='0' + addressss.save() + print('44444444444777777777777',address_a) + print("==================================",address) + # address.is_choose="0" + # address.update() + # return JsonResponse({"msg":"OK"}) + return redirect('myself:address') + else: + return HttpResponse("出错") + + #我的交易 #订单管理 diff --git a/Orange_lala/templates/home/shopcart.html b/Orange_lala/templates/home/shopcart.html index 4f38b56..c16c58b 100644 --- a/Orange_lala/templates/home/shopcart.html +++ b/Orange_lala/templates/home/shopcart.html @@ -7,18 +7,18 @@ 购物车页面 - - - - + + + + - - + + - {% include "home/header.html" %} +{% include 'home/header.html' %}
    diff --git a/Orange_lala/templates/person/address.html b/Orange_lala/templates/person/address.html index a98ef54..f0f8a6d 100644 --- a/Orange_lala/templates/person/address.html +++ b/Orange_lala/templates/person/address.html @@ -82,7 +82,12 @@ {% else %} {% for useraddress in useraddress %}
  • - 设为默认 + + + + 默认地址 + +

    {{ useraddress.recipients }} {{ useraddress.tel }} @@ -94,6 +99,8 @@ {{ useraddress.city }}{{ useraddress.county }}{{ useraddress.detail_addr }}

    + +
  • 编辑 -- Gitee From 223a1ab5252c875785a1628bdf567df794453cc2 Mon Sep 17 00:00:00 2001 From: lizehui <936573478@qq.com> Date: Sun, 29 Sep 2019 16:39:46 +0800 Subject: [PATCH 62/62] =?UTF-8?q?2019/9/29=20=E5=A2=9E=E5=8A=A0=E4=BA=86?= =?UTF-8?q?=E5=8F=91=E8=A1=A8=E8=AF=84=E8=AE=BA=E7=9A=84=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Orange_lala/Orange_lala/settings.py | 4 +- Orange_lala/oneself/models.py | 5 +- Orange_lala/oneself/urls.py | 10 +- Orange_lala/oneself/views.py | 43 ++++- Orange_lala/templates/person/commentlist.html | 149 +++++++----------- Orange_lala/templates/person/order.html | 116 +++++++++++++- 6 files changed, 222 insertions(+), 105 deletions(-) diff --git a/Orange_lala/Orange_lala/settings.py b/Orange_lala/Orange_lala/settings.py index 4354ecc..314b19c 100644 --- a/Orange_lala/Orange_lala/settings.py +++ b/Orange_lala/Orange_lala/settings.py @@ -48,7 +48,7 @@ MIDDLEWARE = [ 'django.middleware.security.SecurityMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', - 'django.middleware.csrf.CsrfViewMiddleware', + # 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', @@ -143,7 +143,7 @@ STATICFILES_DIRS = [os.path.join(BASE_DIR, 'static')] CACHES = { "default": { "BACKEND": "django_redis.cache.RedisCache", - "LOCATION": "redis://129.28.172.210:6379", + "LOCATION": "redis://127.0.0.1:6379", "OPTIONS": { "CLIENT_CLASS": "django_redis.client.DefaultClient", } diff --git a/Orange_lala/oneself/models.py b/Orange_lala/oneself/models.py index f3e0eff..8150c66 100644 --- a/Orange_lala/oneself/models.py +++ b/Orange_lala/oneself/models.py @@ -96,6 +96,8 @@ class Comments(models.Model): good = models.ForeignKey('Goods', models.DO_NOTHING, 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) + comment_time = models.DateTimeField(blank=True, null=True) + comment_type = models.CharField(max_length=255, blank=True, null=True) class Meta: managed = False @@ -275,7 +277,8 @@ class Order(models.Model): 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) - order_price = models.CharField(max_length=255, blank=True, null=True) + order_price = models.FloatField(blank=True, null=True) + is_comment = models.IntegerField(blank=True, null=True) class Meta: managed = False diff --git a/Orange_lala/oneself/urls.py b/Orange_lala/oneself/urls.py index 6191b4a..6ab3b71 100644 --- a/Orange_lala/oneself/urls.py +++ b/Orange_lala/oneself/urls.py @@ -26,15 +26,17 @@ urlpatterns = [ 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('myself_order/', views.myself_order, name='myself_order'), + # path('myself_order/', login_required(views.myself_order), name='myself_order'), # 我的订单 + path('recive_order//',views.recive_good,name='recive_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_commentlist/', login_required(views.myself_commentlist), name='myself_commentlist'), # 对商品发表评价 + path('myself_commentlist/', views.myself_commentlist, name='myself_commentlist'), # 对商品发表评价 + path('save_comment/',views.Save_comment.as_view(),name='save_comment'), 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'), # 我的优惠 diff --git a/Orange_lala/oneself/views.py b/Orange_lala/oneself/views.py index aedbddc..8a57189 100644 --- a/Orange_lala/oneself/views.py +++ b/Orange_lala/oneself/views.py @@ -1,6 +1,7 @@ import json import re - +from django.core.paginator import Paginator +from django import views from django.conf import settings from django.shortcuts import render, HttpResponse, redirect @@ -411,6 +412,8 @@ def myself_order(request): 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) + #未评价订单 + not_comment_order = Order.objects.filter(user_id=8,is_recive=1,is_comment=0) orders = OrderGood.objects.all() @@ -423,6 +426,7 @@ def myself_order(request): 'ok_order':ok_order, "not_send_order":not_send_order, "send_order":send_order, + "not_comment_order":not_comment_order, "goods":goods, "orders":orders, "img":img}) @@ -464,13 +468,42 @@ 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): - # Comments.objects.create(user_id=8,good_id=id,comment=comment) - return render(request,'person/commentlist.html') +def myself_commentlist(request,id): + comment_order = Order.objects.get(id=id) + order_good = OrderGood.objects.filter(order_id=id) + paginator = Paginator(order_good,2) + page1 = paginator.page(1) + current_page = request.GET.get('page', 1) + current_page_content = paginator.page(current_page) + goods = Goods.objects.all() + img = Images.objects.all()[::4] + return render(request,'person/commentlist.html',{"comment_order":comment_order,"order_good":order_good, + "current_page_content":current_page_content, + "goods":goods,"img":img, + "paginator":paginator}) + +#保存评价 +class Save_comment(views.View): + def get(self,request): + pass + + def post(self,request): + username = request.COOKIES.get('username') + user = User.objects.filter(username=username) + if username and user: + for user in user: + good_id = request.POST.get('good_id') + comment = request.POST.get('good_comment') + evaluate = request.POST.get('evaluate') + option = request.POST.get('option') + Comments.objects.create(good_id=good_id,comment=comment,user_id=user.id,comment_type=option) + return redirect('myself:myself_order') + else: + return redirect('home:login') + #退款售后 def myself_change(request): diff --git a/Orange_lala/templates/person/commentlist.html b/Orange_lala/templates/person/commentlist.html index e3ee03c..0290ab6 100644 --- a/Orange_lala/templates/person/commentlist.html +++ b/Orange_lala/templates/person/commentlist.html @@ -7,6 +7,15 @@ 发表评论 + + + + + + + + + @@ -87,7 +96,6 @@
    -
    @@ -96,10 +104,17 @@
    -
    + {% for a in current_page_content %} + {% for b in goods %} + {% if a.good_id == b.id %} + {% for c in img %} + {% if c.goods_id == b.id %} +
    + {% csrf_token %} +
    @@ -107,130 +122,80 @@
    - 颜色:洛阳牡丹 - 包装:裸装 + 颜色:{{ b.taste }} + 包装:{{ b.pack }}
    - 价格:19.88元 + 价格:{{ b.prices }}元
    - + + +
    晒照片(0/5) - +
    -
  • 好评
  • -
  • 中评
  • -
  • 差评
  • +
  • 好评
  • +
  • 中评
  • +
  • 差评
  • -
    - -
    -
    - - - +
    +
    +
    发表评论
    + + {% endif %} + {% endfor %} -
    + {% endif %} + {% endfor %} - -
    -
    - 颜色:洛阳牡丹 - 包装:裸装 -
    -
    - 价格:19.88元 -
    -
    -
    -
    -
    - -
    -
    - - 晒照片(0/5) - -
    -
    -
  • 好评
  • -
  • 中评
  • -
  • 差评
  • -
    -
    + {% endfor %} -
    -
    - - - -
    -
    - -
    -
    - 颜色:洛阳牡丹 - 包装:裸装 -
    -
    - 价格:19.88元 -
    -
    -
    -
    -
    - -
    -
    - - 晒照片(0/5) - -
    -
    -
  • 好评
  • -
  • 中评
  • -
  • 差评
  • -
    -
    -
    -
    发表评论
    -
    - +
    diff --git a/Orange_lala/templates/person/order.html b/Orange_lala/templates/person/order.html index a7537fb..c2f318b 100644 --- a/Orange_lala/templates/person/order.html +++ b/Orange_lala/templates/person/order.html @@ -106,7 +106,7 @@
  • 待付款
  • 待发货
  • 待收货
  • -{#
  • 待评价
  • #} +
  • 待评价
  • @@ -453,8 +453,122 @@
    +
    +
    +
    + 商品 +
    +
    + 单价 +
    +
    + 数量 +
    +
    + 商品操作 +
    +
    + 合计 +
    +
    + 交易状态 +
    +
    + 交易操作 +
    +
    + +
    +
    + + +
    + {% for a in not_comment_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 %} + + {% endif %} + {% endfor %} + {% endif %} + {% endfor %} +
    +
  • +
    + 合计:{{ a.order_price }} +

    含运费:10.00

    +
    +
  • +
    +
  • +
    +

    交易成功

    +

    订单详情

    +

    查看物流

    +
    +
  • +
  • + +
    + 评价商品
    +
    +
  • +
    +
    + {% endif %} + {% endfor %} +
    +
    + + {% endfor %} +
    +
    +
    +
    -- Gitee