#!coding=utf-8
'''
Created on 2014-10-28
@author: Administrator
'''
from django.shortcuts import render_to_response
from django.template.context import RequestContext
from django.http.response import HttpResponse
from django.core.exceptions import ObjectDoesNotExist
from nanjingzto.models import PackageInfo, StoreInfo,CustPostAdr, CustPostInfo,\
postadmin, Town, Suggest, News, Transfee, Advantage, City
import base64
import hashlib
from nanjingzto import settings
import json
import requests
from weixin.api.common import getWebAccToken, calcDistance, sedTempMsg
from django.core import serializers
import datetime
from weixin.models import User
def index(request):
template='index.html'
return render_to_response(template,context_instance=RequestContext(request))
def wuliuinfo(request):
p1 = request.GET.get('wldh')
p2 = request.GET.get('openid')
wuliuinfo=getBillInfo(p1);
if wuliuinfo!=0:
pro_step=0;
pro_name="";
if(u"签收" in wuliuinfo):
pro_name="sign";
pro_step=3;
elif(u"派件" in wuliuinfo):
pro_name="delivery";
pro_step=2;
elif(u"到达" in wuliuinfo):
pro_name="transport";
pro_step=1;
else:
pro_name="pick-up";
pro_step=0;
#
try:
p=PackageInfo.objects.get(pg_id=p1,wx_id=p2) # @UndefinedVariable
p.pg_step=pro_step;
p.pg_sts=pro_name;
p.save();
except ObjectDoesNotExist:
params={'errormsg':'error'}
return render_to_response("query.html",params,context_instance=RequestContext(request))
template='wuliuinfo.html';
params={'wldh':p1,'wuliuinfo':wuliuinfo,'pro_name':pro_name,'pro_step':pro_step}
return render_to_response(template,params,context_instance=RequestContext(request))
else:
params={'errormsg':'error'}
return render_to_response("query.html",params,context_instance=RequestContext(request))
def query(request):
template='query.html'
return render_to_response(template,context_instance=RequestContext(request))
def ditupath(request):
template='ditupath.html'
return render_to_response(template,context_instance=RequestContext(request))
def getstoreinfo(request):
p1 = request.GET.get('LX')
p2 = request.GET.get('LY')
list=getStroe(p1,p2)
return HttpResponse(list)
def getdata(request):
p1 = request.GET.get('code')
p2 = request.GET.get('wldh')
openid=request.session.get('openid',False)
if openid == False:
print "put session"
openid=getWebAccToken(p1)
request.session['openid']=openid
try:
PackageInfo.objects.get(pg_id=p2,wx_id=openid) # @UndefinedVariable
except ObjectDoesNotExist:
pginfo=PackageInfo(pg_id=p2,wx_id=openid);
pginfo.save();
return HttpResponse(openid);
def storeinfo(request):
return render_to_response("storeinfo.html",context_instance=RequestContext(request))
def addadress(request):
return render_to_response("addadress.html",context_instance=RequestContext(request))
def addadr(request):
ContactName=request.POST.get('ContactName')
Mobile=request.POST.get('Mobile')
Sender=request.POST.get('Sender')
Address=request.POST.get('Address')
openid=request.POST.get('openid')
try:
CustPostAdr.objects.get(wx_id=openid,phoneno=Mobile,detailAdrinfo=Address) # @UndefinedVariable
except ObjectDoesNotExist:
pginfo=CustPostAdr(wx_id=openid,custname=ContactName,phoneno=Mobile,cityname=Sender,detailAdrinfo=Address);
pginfo.save();
return HttpResponse("true")
def getadress(request):
openid=request.GET.get('openid')
adrlist=CustPostAdr.objects.filter(wx_id=openid);
params={'adrlist':adrlist,'openid':openid}
return render_to_response("manadr.html",params,context_instance=RequestContext(request))
def postorder(request):
return render_to_response("postorder.html",context_instance=RequestContext(request))
def orderview(request):
return render_to_response("orderview.html",context_instance=RequestContext(request))
def orderinfo(request):
# topenid=request.session.get('openid',False)
torderid = request.GET.get('orderid')
tmporder=None;
try:
tmporder=CustPostInfo.objects.get(orderid=torderid); # @UndefinedVariable
except ObjectDoesNotExist:
return HttpResponse("订单已被取消")
params={'tmporder':tmporder}
return render_to_response("orderinfo.html",params,context_instance=RequestContext(request))
def ordercancel(request):
id = request.POST.get('id')
topenid=request.session.get('openid',False)
# ckReason = request.POST.get('ckReason')
try:
tmporder=CustPostInfo.objects.get(id=int(id),wx_id=topenid); # @UndefinedVariable
tmporder.delete();
user=User.objects.get(openid=topenid)
user.post_times=int(user.post_times)-1
user.save()
except ObjectDoesNotExist:
return HttpResponse("error")
return HttpResponse("true")
def getorderfee(request):
# Sender = request.POST.get('Sender')
JSender = request.POST.get('JSender')
Weight = request.POST.get('Weight')
code = request.POST.get('code')
topenid=request.session.get('openid',False)
if topenid == False:
topenid=getWebAccToken(code)
request.session['openid']=topenid
fee=0
prov=JSender[0:JSender.index('-')][0:2]
queryset=Transfee.objects.filter(province__startswith=prov)
for tmpset in queryset:
if Weight == "1" :
try:
user=User.objects.get(openid=topenid);
if user.post_times=="":
fee=(float(tmpset.first_weight_fee))
return HttpResponse(fee)
else:
fee=(float(tmpset.first_weight_fee))
return HttpResponse(fee)
except ObjectDoesNotExist:
fee=(float(tmpset.first_weight_fee))
return HttpResponse(fee)
else:
fee=(float(tmpset.first_weight_fee)+(float(Weight)-1)*float(tmpset.goon_weight_fee))
return HttpResponse(fee)
def order(request):
p1 = request.GET.get('code')
openid=request.session.get('openid',False)
if openid == False:
openid=getWebAccToken(p1)
request.session['openid']=openid
#
adrlist=CustPostAdr.objects.filter(wx_id=openid) # @UndefinedVariable
params={'adrlist':adrlist,'openid':openid}
return render_to_response("order.html",params,context_instance=RequestContext(request))
def addorder(request):
orderfee = request.POST.get('orderfee')
ContactName = request.POST.get('ContactName')
Mobile = request.POST.get('Mobile')
Sender = request.POST.get('Sender')
Address = request.POST.get('Address')
JContactName = request.POST.get('JContactName')
JMobile = request.POST.get('JMobile')
JSender = request.POST.get('JSender')
JAddress = request.POST.get('JAddress')
Weight = request.POST.get('Weight')
Category = request.POST.get('Category')
Remark = request.POST.get('Remark')
code = request.POST.get('code')
Orderid= request.POST.get('orderid')
openid=request.session.get('openid',False)
if openid == False:
openid=getWebAccToken(code)
request.session['openid']=openid
#新增用户的寄件地址信息
try:
CustPostAdr.objects.get(wx_id=openid,detailAdrinfo=Address,phoneno=Mobile,custname=ContactName); # @UndefinedVariable
except ObjectDoesNotExist:
postAdr=CustPostAdr(wx_id=openid,custname=ContactName,phoneno=Mobile,cityname=Sender,detailAdrinfo=Address);
postAdr.save()
#防止页面订单金额为0的情况
if orderfee=="0":
prov=JSender[0:JSender.index('-')][0:
没有合适的资源?快使用搜索试试~ 我知道了~
基于南京中通物流的Python开发框架设计源码
共1383个文件
js:1032个
png:124个
css:89个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 198 浏览量
2024-10-05
15:13:15
上传
评论
收藏 8.76MB ZIP 举报
温馨提示
该Python开发框架源码,针对南京中通物流设计,包含1380个文件,涵盖1032个JavaScript文件、124个PNG图片、89个CSS样式、60个GIF图片、26个Python脚本、23个HTML页面、11个Markdown文档、5个文本文件、2个JPG图片和1个项目配置文件。支持前端和后端开发,涉及JavaScript、CSS、Python和HTML等多种编程语言和技术。
资源推荐
资源详情
资源评论
收起资源包目录
基于南京中通物流的Python开发框架设计源码 (1383个子文件)
api 238B
jquery-weui.css 66KB
zto.css 51KB
weui.min.css 46KB
editor_ie7.css 45KB
af.ui.css 45KB
editor_iequirks.css 43KB
editor_ie8.css 43KB
editor_ie.css 43KB
editor_gecko.css 42KB
editor.css 42KB
style1.css 37KB
icons.css 22KB
dialog_ie7.css 15KB
dialog_ie8.css 14KB
dialog_iequirks.css 14KB
dialog_ie.css 14KB
base.css 14KB
dialog.css 13KB
widgets.css 10KB
wdStatus.css 7KB
base.css 6KB
forms.css 6KB
style.css 5KB
express.css 5KB
changelists.css 5KB
iconfont.css 5KB
rtl.css 4KB
galleriffic-5.css 3KB
galleriffic-4.css 3KB
galleriffic-1.css 3KB
galleriffic-2.css 3KB
galleriffic-3.css 3KB
default.css 3KB
railscasts.css 2KB
yui.css 2KB
arta.css 2KB
monokai_sublime.css 2KB
obsidian.css 2KB
xcode.css 2KB
sunburst.css 2KB
googlecode.css 2KB
monokai.css 2KB
school_book.css 2KB
magula.css 2KB
far.css 2KB
zenburn.css 2KB
jush.css 2KB
contents.css 2KB
brown_paper.css 2KB
docco.css 2KB
atelier-lakeside.light.css 2KB
atelier-lakeside.dark.css 2KB
atelier-seaside.light.css 2KB
dark.css 2KB
atelier-seaside.dark.css 2KB
atelier-forest.light.css 2KB
atelier-forest.dark.css 2KB
atelier-heath.light.css 2KB
idea.css 2KB
atelier-heath.dark.css 2KB
atelier-dune.light.css 2KB
atelier-dune.dark.css 2KB
github.css 2KB
pojoaque.css 2KB
tomorrow-night-blue.css 2KB
solarized_dark.css 2KB
solarized_light.css 2KB
tomorrow-night.css 2KB
rainbow.css 2KB
foundation.css 2KB
vs.css 2KB
tomorrow-night-eighties.css 2KB
tomorrow-night-bright.css 1KB
font.css 1KB
paraiso.light.css 1KB
paraiso.dark.css 1KB
templates.css 1KB
ir_black.css 1KB
tomorrow.css 1KB
toolbar.css 1KB
wsc.css 1KB
ie.css 1KB
basic.css 971B
login.css 940B
mono-blue.css 899B
black.css 846B
white.css 831B
ascetic.css 803B
dashboard.css 434B
getscript 159KB
loader.gif 10KB
loaderWhite.gif 10KB
spinner.gif 3KB
selector-icons.gif 3KB
angel_smile.gif 1KB
devil_smile.gif 1KB
shades_smile.gif 1KB
angry_smile.gif 1KB
tongue_smile.gif 1KB
共 1383 条
- 1
- 2
- 3
- 4
- 5
- 6
- 14
资源评论
xyq2024
- 粉丝: 2502
- 资源: 5461
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功