|
@@ -119,7 +119,6 @@ class CloudVodView(View):
|
|
|
<!DOCTYPE html>
|
|
|
<html lang="en">
|
|
|
<head>
|
|
|
- <meta charset="UTF-8">
|
|
|
<meta charset="UTF-8">
|
|
|
<meta name="viewport"
|
|
|
content="width=device-width,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
|
|
@@ -141,106 +140,12 @@ class CloudVodView(View):
|
|
|
'''
|
|
|
return response
|
|
|
|
|
|
-
|
|
|
- def d2o_pay_error(self):
|
|
|
- response = HttpResponse()
|
|
|
- response.status_code = 200
|
|
|
- # response.content = '''
|
|
|
- # <!DOCTYPE html>
|
|
|
- # <html lang="en">
|
|
|
- # <head>
|
|
|
- # <meta charset="UTF-8">
|
|
|
- # <title>Title</title>
|
|
|
- # </head>
|
|
|
- # <body>
|
|
|
- # <div class="content"
|
|
|
- # style="text-align:center;overflow: hidden;padding:20% 10% 10% 10%;margin:0 10%;background-color: #fff;box-shadow:0 4px 20px rgba(0,0,0,0.1);word-break: break-all;min-height: 300px">
|
|
|
- # <span style="padding: 10px 20px; font-size: 48px;background-color: #EB6F5A;border-radius:4px;color:#fff;">付款失败</span>
|
|
|
- # </div>
|
|
|
- # </body>
|
|
|
- # </html>
|
|
|
- # '''
|
|
|
- response.content = '''
|
|
|
- <!DOCTYPE html>
|
|
|
-<html>
|
|
|
-<head>
|
|
|
- <title>拦截跳转实现通信</title>
|
|
|
- <meta charset="UTF-8">
|
|
|
- <meta name="viewport"
|
|
|
- content="width=device-width,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
|
|
|
- <script type="text/javascript" src="https://cdn.staticfile.org/jquery/1.12.4/jquery.js"></script>
|
|
|
-
|
|
|
- <style type="text/css">
|
|
|
- .btn {
|
|
|
- background-color: #aaa;
|
|
|
- height: 40px;
|
|
|
- display: flex;
|
|
|
- justify-content: center;
|
|
|
- align-items: center;
|
|
|
- color: #444444;
|
|
|
- text-decoration: none;
|
|
|
- margin-top: 10px;
|
|
|
- }
|
|
|
-
|
|
|
- #response {
|
|
|
- background: #eeeeee;
|
|
|
- word-wrap: break-word;
|
|
|
- display: block;
|
|
|
- outline: 1px solid #ccc;
|
|
|
- padding: 5px;
|
|
|
- margin: 5px;
|
|
|
- }
|
|
|
- </style>
|
|
|
-</head>
|
|
|
-<body>
|
|
|
-<p style="color: red">嵌入页区域</p>
|
|
|
-<p>以拦截跳转链接的方式实现</p>
|
|
|
-<input type="text" id="loginInputID">
|
|
|
-<button class="btn" id="login">发起APP登录</button>
|
|
|
-<input type="text" id="shareInputID">
|
|
|
-<button class="btn" id="share">发起社交化分享</button>
|
|
|
-
|
|
|
-<pre id="response"></pre>
|
|
|
-<script>
|
|
|
-
|
|
|
- /**
|
|
|
- * 显示响应信息
|
|
|
- * @param response 响应信心
|
|
|
- */
|
|
|
- function showResponse(response) {
|
|
|
- $('#response').text(response);
|
|
|
- return response;
|
|
|
- }
|
|
|
-
|
|
|
- $(function () {
|
|
|
- $('#login').click(function () {
|
|
|
- let loginInputVal = $('#loginInputID').val()
|
|
|
- alert(loginInputVal)
|
|
|
- window.location = loginInputVal;
|
|
|
- //window.location = 'app://login?account=13011112222&password=123456';
|
|
|
- });
|
|
|
-
|
|
|
- $('#share').click(function () {
|
|
|
- let shareInputVal = $('#shareInputID').val()
|
|
|
- alert(shareInputVal)
|
|
|
- window.location = shareInputVal
|
|
|
- //window.location = 'app://share?title=分享的标题&desc=分享的描述'
|
|
|
- });
|
|
|
- });
|
|
|
-</script>
|
|
|
-</body>
|
|
|
-</html>
|
|
|
-
|
|
|
- '''
|
|
|
- return response
|
|
|
-
|
|
|
def do_pay_ok(self):
|
|
|
response = HttpResponse()
|
|
|
response.content = '''
|
|
|
<!DOCTYPE html>
|
|
|
<html lang="en">
|
|
|
<head>
|
|
|
- <meta charset="UTF-8">
|
|
|
<meta charset="UTF-8">
|
|
|
<meta name="viewport"
|
|
|
content="width=device-width,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
|
|
@@ -262,90 +167,6 @@ class CloudVodView(View):
|
|
|
'''
|
|
|
return response
|
|
|
|
|
|
- def d2o_pay_ok(self):
|
|
|
- response = HttpResponse()
|
|
|
- # response.status_code = 200
|
|
|
- # response.content = '''
|
|
|
- # <!DOCTYPE html>
|
|
|
- # <html lang="en">
|
|
|
- # <head>
|
|
|
- # <meta charset="UTF-8">
|
|
|
- # <title>Title</title>
|
|
|
- # </head>
|
|
|
- # <body>
|
|
|
- # <div class="content"
|
|
|
- # style="text-align:center;overflow: hidden;padding:20% 10% 10% 10%;margin:0 10%;background-color: #fff;box-shadow:0 4px 20px rgba(0,0,0,0.1);word-break: break-all;min-height: 300px">
|
|
|
- # <span style="padding: 10px 20px; font-size: 48px;background-color: #EB6F5A;border-radius:4px;color:#fff;">付款成功</span>
|
|
|
- # </div>
|
|
|
- # </body>
|
|
|
- # </html>
|
|
|
- # '''
|
|
|
- response.content = '''
|
|
|
- <!DOCTYPE html>
|
|
|
- <html>
|
|
|
- <head>
|
|
|
- <title>拦截跳转实现通信</title>
|
|
|
- <meta charset="UTF-8">
|
|
|
- <meta name="viewport"
|
|
|
- content="width=device-width,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
|
|
|
- <script type="text/javascript" src="https://cdn.staticfile.org/jquery/1.12.4/jquery.js"></script>
|
|
|
-
|
|
|
- <style type="text/css">
|
|
|
- .btn {
|
|
|
- background-color: #aaa;
|
|
|
- height: 40px;
|
|
|
- display: flex;
|
|
|
- justify-content: center;
|
|
|
- align-items: center;
|
|
|
- color: #444444;
|
|
|
- text-decoration: none;
|
|
|
- margin-top: 10px;
|
|
|
- }
|
|
|
-
|
|
|
- #response {
|
|
|
- background: #eeeeee;
|
|
|
- word-wrap: break-word;
|
|
|
- display: block;
|
|
|
- outline: 1px solid #ccc;
|
|
|
- padding: 5px;
|
|
|
- margin: 5px;
|
|
|
- }
|
|
|
- </style>
|
|
|
- </head>
|
|
|
- <body>
|
|
|
- <p style="color: red">嵌入页区域</p>
|
|
|
- <p>以拦截跳转链接的方式实现</p>
|
|
|
- <button class="btn" id="login">发起APP登录</button>
|
|
|
- <button class="btn" id="share">发起社交化分享</button>
|
|
|
-
|
|
|
- <pre id="response"></pre>
|
|
|
- <script>
|
|
|
-
|
|
|
- /**
|
|
|
- * 显示响应信息
|
|
|
- * @param response 响应信心
|
|
|
- */
|
|
|
- function showResponse(response) {
|
|
|
- $('#response').text(response);
|
|
|
- return response;
|
|
|
- }
|
|
|
-
|
|
|
- $(function () {
|
|
|
- $('#login').click(function () {
|
|
|
- window.location = 'app://login?account=13011112222&password=123456';
|
|
|
- });
|
|
|
-
|
|
|
- $('#share').click(function () {
|
|
|
- window.location = 'app://share?title=分享的标题&desc=分享的描述'
|
|
|
- });
|
|
|
- });
|
|
|
- </script>
|
|
|
- </body>
|
|
|
- </html>
|
|
|
-
|
|
|
- '''
|
|
|
- return response
|
|
|
-
|
|
|
# next
|
|
|
def do_create_order(self, request_dict, userID, response):
|
|
|
did = request_dict.get('did', None)
|
|
@@ -398,7 +219,7 @@ class CloudVodView(View):
|
|
|
print(payment.error)
|
|
|
return response.json(10, payment.error)
|
|
|
print(payment)
|
|
|
- nowTime = int(time.time())
|
|
|
+ nowTime = CommonService.get_utc()
|
|
|
for link in payment.links:
|
|
|
if link.rel == "approval_url":
|
|
|
approval_url = str(link.href)
|
|
@@ -431,11 +252,11 @@ class CloudVodView(View):
|
|
|
res = {'code': 403}
|
|
|
return JsonResponse(status=200, data=res)
|
|
|
# return response.json(10, '设备未购买')
|
|
|
- now_time = int(time.time())
|
|
|
+ now_time = CommonService.get_utc()
|
|
|
if now_time > ubqs[0]['endTime']:
|
|
|
res = {'code': 403}
|
|
|
return JsonResponse(status=200, data=res)
|
|
|
- now_time_stamp = int(time.time())
|
|
|
+ now_time_stamp = CommonService.get_utc()
|
|
|
oc_qs = OssCrdModel.objects.filter(uid=UID, channel=channel).values("addTime", "data")
|
|
|
if oc_qs.exists():
|
|
|
endTime = int(oc_qs[0]["addTime"]) + 3500
|
|
@@ -575,7 +396,7 @@ class CloudVodView(View):
|
|
|
return response.json(10, payment.error)
|
|
|
print("Payment execute successfully")
|
|
|
order_qs = Order_Model.objects.filter(orderID=orderID)
|
|
|
- order_qs.update(status=1, updTime=int(time.time()))
|
|
|
+ order_qs.update(status=1, updTime=CommonService.get_utc())
|
|
|
order_list = order_qs.values("UID", "rank_id", "channel")
|
|
|
rank_id = order_list[0]['rank_id']
|
|
|
UID = order_list[0]['UID']
|
|
@@ -586,7 +407,7 @@ class CloudVodView(View):
|
|
|
return response.json(0, '套餐已删除')
|
|
|
addTime = int(smqs[0]["day"]) * 24 * 3600
|
|
|
ubqs = UID_Bucket.objects.filter(uid=UID, channel=channel).values("bucket_id", "endTime", "bucket__storeDay")
|
|
|
- nowTime = int(time.time())
|
|
|
+ nowTime = CommonService.get_utc()
|
|
|
if ubqs.exists():
|
|
|
# 判断是否过期了
|
|
|
if nowTime > ubqs[0]['endTime']:
|
|
@@ -631,7 +452,7 @@ class CloudVodView(View):
|
|
|
ubqs = UID_Bucket.objects.filter(channel=channel, uid=UID)
|
|
|
if not ubqs.exists():
|
|
|
return response.json(10, '未购买')
|
|
|
- now_time = int(time.time())
|
|
|
+ now_time = CommonService.get_utc()
|
|
|
if now_time > ubqs[0].endTime:
|
|
|
return response.json(10, '已过期')
|
|
|
ubqs.update(status=status)
|