Explorar o código

支付成功,体验成功,兑换成功返回显示字段

chenshibin %!s(int64=4) %!d(string=hai) anos
pai
achega
323bef582d
Modificáronse 1 ficheiros con 14 adicións e 5 borrados
  1. 14 5
      Controller/CloudStorage.py

+ 14 - 5
Controller/CloudStorage.py

@@ -92,7 +92,7 @@ class CloudStorageView(View):
         elif operation == 'signplaym3u8':
             return self.do_sign_play_m3u8(request_dict, response)
         elif operation == 'payOK':
-            return self.do_pay_ok()
+            return self.do_pay_ok(request_dict)
         else:
             token = request_dict.get('token', None)
             # 设备主键uid
@@ -745,8 +745,15 @@ class CloudStorageView(View):
                 '''
         return response
 
-    def do_pay_ok(self):
+    def do_pay_ok(self,request_dict):
         response = HttpResponse()
+        paytype = request_dict.get('paytype', None)
+        showtitle = "支付成功"
+        if paytype == "10":
+            showtitle = "成功体验云存"
+
+        if paytype == "11":
+            showtitle = "兑换成功"
         response.content = '''
 <html>
 <head>
@@ -806,7 +813,7 @@ class CloudStorageView(View):
             <p>
 					<img src="https://test.dvema.com/web/images/success.png" class="content_img">
                     <br>
-                    支付成功
+                    '''+showtitle+'''
             </p>
     </div>
     <center class="bottom">
@@ -1183,21 +1190,23 @@ class CloudStorageView(View):
         order_qs.update(status=1, updTime=nowTime, uid_bucket_id=uid_bucket_id)
 
         # return response.json(0)
+        returnurl = "{SERVER_DOMAIN}cloudstorage/payOK".format(SERVER_DOMAIN=SERVER_DOMAIN)
         if pay_type == 10:
             ExperienceContextModel.objects.create(
                 experience_type=0,
                 uid=uid,
                 do_time=nowTime
-
             )
+            returnurl = "{SERVER_DOMAIN}cloudstorage/payOK?paytype=10".format(SERVER_DOMAIN=SERVER_DOMAIN)
 
         if pay_type== 11:
             update_dict = {}
             update_dict['is_activate'] = 1
             update_dict['order'] = orderID
             CDKcontextModel.objects.filter(cdk=cdk).update(**update_dict)
+            returnurl = "{SERVER_DOMAIN}cloudstorage/payOK?paytype=11".format(SERVER_DOMAIN=SERVER_DOMAIN)
 
-        result = "{SERVER_DOMAIN}cloudstorage/payOK".format(SERVER_DOMAIN=SERVER_DOMAIN)
+        result = returnurl
         return response.json(0, result)
         # red_url =
         # return JsonResponse(status=200, data={'red_url': red_url})