Beispiel #1
0
	def get(request):
		"""
		响应GET
		"""
		cert_setting = WxCertSettings.objects.filter(owner_id=request.manager.id)

		if not cert_setting.count() > 0:
			return HttpResponseRedirect("/mall2/weixin_certificate/")

		if 'id' in request.GET:
			project_id = 'new_app:group:%s' % request.GET.get('related_page_id', 0)
			#处理删除异常
			try:
				group = app_models.Group.objects.get(id=request.GET['id'])
			except:
				c = RequestContext(request, {
					'first_nav_name': FIRST_NAV,
					'second_navs': mall_export.get_promotion_and_apps_second_navs(request),
					'second_nav_name': mall_export.MALL_APPS_SECOND_NAV,
					'third_nav_name': "groups",
					'is_deleted_data': True
				})

				return render_to_response('group/templates/editor/workbench.html', c)

			is_create_new_data = False
		else:
			group = None
			is_create_new_data = True
			project_id = 'new_app:group:0'

		_, app_name, real_project_id = project_id.split(':')
		if real_project_id != '0':
			pagestore = pagestore_manager.get_pagestore('mongo')
			pages = pagestore.get_page_components(real_project_id)
			if not pages:
				c = RequestContext(request, {
					'first_nav_name': FIRST_NAV,
					'second_navs': mall_export.get_promotion_and_apps_second_navs(request),
					'second_nav_name': mall_export.MALL_APPS_SECOND_NAV,
					'third_nav_name': "groups",
					'is_deleted_data': True
				})

				return render_to_response('group/templates/editor/workbench.html', c)

		c = RequestContext(request, {
			'first_nav_name': FIRST_NAV,
			'second_navs': mall_export.get_promotion_and_apps_second_navs(request),
			'second_nav_name': mall_export.MALL_APPS_SECOND_NAV,
			'third_nav_name': "groups",
			'group': group,
			'is_create_new_data': is_create_new_data,
			'project_id': project_id,
		})

		return render_to_response('group/templates/editor/workbench.html', c)
Beispiel #2
0
    def get(request):
        promotion_id = request.GET.get('id', None)
        if promotion_id:
            promotion = promotion_models.Promotion.objects.get(owner=request.manager, type=promotion_models.PROMOTION_TYPE_INTEGRAL_SALE, id=promotion_id)
            promotion_models.Promotion.fill_details(request.manager, [promotion], {
                'with_product': True,
                'with_concrete_promotion': True
            })
            promotion.products = sorted(promotion.products, key=lambda x: x.id)
            for product in promotion.products:
                product.models = product.models[1:]

            if promotion.member_grade_id:
                try:
                    promotion.member_grade_name = MemberGrade.objects.get(id=promotion.member_grade_id).name
                except:
                    promotion.member_grade_name = MemberGrade.get_default_grade(request.manager_profile.webapp_id).name


            jsons = [{
                "name": "product_models",
                # "content": promotion.products[0].models
                "content": [p.models for p in promotion.products]
            }]

            for rule in promotion.detail['rules']:
                if rule['member_grade_id'] > 0:
                    try:
                        rule['member_grade_name'] = MemberGrade.objects.get(id=rule['member_grade_id']).name
                    except:
                        pass
                else:
                    rule['member_grade_name'] = '全部等级'

            c = RequestContext(request, {
                'first_nav_name': export.MALL_PROMOTION_AND_APPS_FIRST_NAV,
                'second_navs': export.get_promotion_and_apps_second_navs(request),
                'second_nav_name': export.MALL_PROMOTION_SECOND_NAV,
                'third_nav_name': export.MALL_PROMOTION_INTEGRAL_SALE_NAV,
                'promotion': promotion,
                'jsons': jsons
            })

            return render_to_response('mall/editor/promotion/integral_sale_detail.html', c)
        else:
            member_grades = MemberGrade.get_all_grades_list(request.user_profile.webapp_id)
            c = RequestContext(request, {
                'member_grades': member_grades,
                'first_nav_name': export.MALL_PROMOTION_AND_APPS_FIRST_NAV,
                'second_navs': export.get_promotion_and_apps_second_navs(request),
                'second_nav_name': export.MALL_PROMOTION_SECOND_NAV,
                'third_nav_name': export.MALL_PROMOTION_INTEGRAL_SALE_NAV,
            })

            return render_to_response('mall/editor/promotion/create_integral_sale.html', c)
Beispiel #3
0
	def get(request):
		"""
		响应GET
		"""
		rebate = None
		if 'id' in request.GET:
			try:
				rebate = app_models.Rebate.objects.get(id=request.GET['id'])
			except:
				c = RequestContext(request, {
					'first_nav_name': FIRST_NAV,
					'second_navs': mall_export.get_promotion_and_apps_second_navs(request),
					'second_nav_name': mall_export.MALL_APPS_SECOND_NAV,
					'third_nav_name': mall_export.MALL_APPS_REBATE_NAV,
					'is_deleted_data': True,
				})
				return render_to_response('rebate/templates/editor/create_rebate_rule.html', c)
			answer_content = {}
			if rebate.reply_type == 2:
				answer_content['type'] = 'news'
				answer_content['newses'] = []
				answer_content['content'] = rebate.reply_material_id
				newses = News.get_news_by_material_id(rebate.reply_material_id)
				for news in newses:
					news_dict = {}
					news_dict['id'] = news.id
					news_dict['title'] = news.title
					answer_content['newses'].append(news_dict)
			else:
				answer_content['type'] = 'text'
				answer_content['content'] = emotion.change_emotion_to_img(rebate.reply_detail)
			jsons = [{
				"name": "qrcode_answer",
				"content": answer_content
			}]
			card_stock = AppsWeizoomCard.objects(belong_to=request.GET['id'],status=0).count()
			c = RequestContext(request, {
				'first_nav_name': FIRST_NAV,
				'second_navs': mall_export.get_promotion_and_apps_second_navs(request),
				'second_nav_name': mall_export.MALL_APPS_SECOND_NAV,
				'third_nav_name': mall_export.MALL_APPS_REBATE_NAV,
				'rebate_rule': rebate,
				'card_stock': card_stock,
				'jsons': jsons
			})
			return render_to_response('rebate/templates/editor/create_rebate_rule.html', c)
		else:
			c = RequestContext(request, {
				'first_nav_name': FIRST_NAV,
				'second_navs': mall_export.get_promotion_and_apps_second_navs(request),
				'second_nav_name': mall_export.MALL_APPS_SECOND_NAV,
				'third_nav_name': mall_export.MALL_APPS_REBATE_NAV,
				'rebate_rule': rebate
			})
			return render_to_response('rebate/templates/editor/create_rebate_rule.html', c)
Beispiel #4
0
	def get(request):
		"""
		响应GET
		"""
		if 'id' in request.GET:
			project_id = 'new_app:event:%s' % request.GET.get('related_page_id', 0)
			try:
				event = app_models.event.objects.get(id=request.GET['id'])
			except:
				c = RequestContext(request, {
					'first_nav_name': FIRST_NAV,
					'second_navs': export.get_promotion_and_apps_second_navs(request),
					'second_nav_name': export.MALL_APPS_SECOND_NAV,
					'third_nav_name': export.MALL_APPS_EVENT_NAV,
					'is_deleted_data': True
				})
				return render_to_response('event/templates/editor/workbench.html', c)
			is_create_new_data = False

		else:
			event = None
			is_create_new_data = True
			project_id = 'new_app:event:0'

		_, app_name, real_project_id = project_id.split(':')
		if real_project_id != '0':
			pagestore = pagestore_manager.get_pagestore('mongo')
			pages = pagestore.get_page_components(real_project_id)
			if not pages:
				c = RequestContext(request, {
					'first_nav_name': FIRST_NAV,
					'second_navs': export.get_promotion_and_apps_second_navs(request),
					'second_nav_name': export.MALL_APPS_SECOND_NAV,
					'third_nav_name': export.MALL_APPS_EVENT_NAV,
					'is_deleted_data': True
				})
				return render_to_response('event/templates/editor/workbench.html', c)
		
		c = RequestContext(request, {
			'first_nav_name': FIRST_NAV,
			'second_navs': export.get_promotion_and_apps_second_navs(request),
			'second_nav_name': export.MALL_APPS_SECOND_NAV,
            'third_nav_name': export.MALL_APPS_EVENT_NAV,
			'event': event,
			'is_create_new_data': is_create_new_data,
			'project_id': project_id,
			'app_name': 'event'
		});
		
		return render_to_response('event/templates/editor/workbench.html', c)
Beispiel #5
0
    def get(request):
        """
        红包规则创建、查看页面
        """

        rule_id = request.GET.get('id', None)
        if rule_id:
            red_envelope_rule = promotion_models.RedEnvelopeRule.objects.get(
                id=rule_id)
            coupon_rule = promotion_models.CouponRule.objects.get(
                id=red_envelope_rule.coupon_rule_id)
            c = RequestContext(
                request, {
                    'first_nav_name':
                    FIRST_NAV_NAME,
                    'second_navs':
                    export.get_promotion_and_apps_second_navs(request),
                    'second_nav_name':
                    export.MALL_APPS_SECOND_NAV,
                    'third_nav_name':
                    export.MALL_PROMOTION_ORDER_RED_ENVELOPE,
                    'coupon_rule':
                    coupon_rule,
                    'red_envelope_rule':
                    red_envelope_rule,
                })
            return render_to_response(
                'mall/editor/create_red_envelope_rule.html', c)
        else:
            coupon_rules = promotion_models.CouponRule.objects.filter(
                owner=request.manager,
                is_active=True,
                end_date__gt=datetime.now(),
                limit_counts=-1)
            c = RequestContext(
                request, {
                    'first_nav_name':
                    FIRST_NAV_NAME,
                    'second_navs':
                    export.get_promotion_and_apps_second_navs(request),
                    'second_nav_name':
                    export.MALL_APPS_SECOND_NAV,
                    'third_nav_name':
                    export.MALL_PROMOTION_ORDER_RED_ENVELOPE,
                    'coupon_rules':
                    coupon_rules
                })
            return render_to_response(
                'mall/editor/create_red_envelope_rule.html', c)
Beispiel #6
0
    def get(request):
        """
		响应GET
		"""
        has_data = app_models.RedPacket.objects.count()
        cert_ready = False
        cert_setting = app_models.RedPacketCertSettings.objects(
            owner_id=str(request.webapp_owner_id))
        if cert_setting.count() > 0:
            cert_setting = cert_setting.first()
            if '' != cert_setting.cert_path and '' != cert_setting.key_path:
                cert_ready = True

        c = RequestContext(
            request, {
                'first_nav_name': FIRST_NAV,
                'second_navs':
                export.get_promotion_and_apps_second_navs(request),
                'second_nav_name': export.MALL_APPS_SECOND_NAV,
                'third_nav_name': export.MALL_APPS_REDPACKET_NAV,
                'has_data': has_data,
                'cert_ready': cert_ready
            })

        return render_to_response(
            'red_packet/templates/editor/red_packets.html', c)
Beispiel #7
0
    def get(request):
        """
		响应GET
		"""
        cert_name = key_name = False
        cert_setting = app_models.RedPacketCertSettings.objects(
            owner_id=str(request.webapp_owner_id))
        if cert_setting.count() > 0:
            cert_setting = cert_setting.first()
            cert_name = u'  (文件名:apiclient_cert.pem)' if cert_setting.cert_path != '' else ''
            key_name = u'  (文件名:apiclient_key.pem)' if cert_setting.key_path != '' else ''
        c = RequestContext(
            request, {
                'first_nav_name':
                FIRST_NAV,
                'second_navs':
                mall_export.get_promotion_and_apps_second_navs(request),
                'second_nav_name':
                mall_export.MALL_APPS_SECOND_NAV,
                'third_nav_name':
                mall_export.MALL_APPS_REDPACKET_NAV,
                'cert_name':
                cert_name,
                'key_name':
                key_name
            })
        return render_to_response(
            'red_packet/templates/editor/red_packet_cert_setting.html', c)
Beispiel #8
0
	def get(request):
		"""
		响应GET
		"""
		if 'id' in request.GET:
			survey_id = request.GET['id']
			total_participance = app_models.surveyParticipance.objects(belong_to=request.GET['id']).count()
			all_participances = surveyStatistics.get_survey_title_select_datas(request)

			for participance in all_participances:
				if participance['type'] == 'appkit.textlist':
					all_participances.remove(participance)

			project_id = 'new_app:survey:%s' % request.GET.get('related_page_id', 0)
		else:
			total_participance = 0
			all_participances = None
			project_id = 'new_app:survey:0'
			survey_id = 0

		c = RequestContext(request, {
			'first_nav_name': FIRST_NAV,
			'second_navs': export.get_promotion_and_apps_second_navs(request),
			'second_nav_name': export.MALL_APPS_SECOND_NAV,
            'third_nav_name': export.MALL_APPS_SURVEY_NAV,
			'titles': all_participances,
			'total_participance': total_participance,
			'project_id': project_id,
			'survey_id':survey_id

		})

		return render_to_response('survey/templates/editor/survey_statistics.html', c)
Beispiel #9
0
    def get(request):
        """
		响应GET
		"""
        has_data = app_models.ShvoteParticipance.objects(
            belong_to=request.GET['id']).count()  #count<->是否有数据

        c = RequestContext(
            request, {
                'first_nav_name':
                FIRST_NAV,
                'second_navs':
                mall_export.get_promotion_and_apps_second_navs(request),
                'second_nav_name':
                mall_export.MALL_APPS_SECOND_NAV,
                'third_nav_name':
                "shvotes",
                'has_data':
                has_data,
                'activity_id':
                request.GET['id']
            })

        return render_to_response(
            'shvote/templates/editor/shvote_registrators.html', c)
Beispiel #10
0
	def get(request):
		"""
		响应GET
		"""
		has_data = app_models.Group.objects.count()
		#从数据库中获取模板配置
		templates = UserHasTemplateMessages.objects(owner_id=request.manager.id)
		um = UserappHasTemplateMessages.objects(owner_id=request.manager.id, apps_type="group")
		control_data = 0
		tem_list = []
		if um.count() > 0:
			um = um.first()
			control_data = um.data_control
		for t in templates:
			tem_list.append({
				"template_id": t.template_id,
				"template_title": t.title
			})
		c = RequestContext(request, {
			'first_nav_name': FIRST_NAV,
			'second_navs': mall_export.get_promotion_and_apps_second_navs(request),
			'second_nav_name': mall_export.MALL_APPS_SECOND_NAV,
			'third_nav_name': "groups",
			'has_data': has_data,
			'template_data': json.dumps({"hasData": 0 if len(tem_list) <= 0 else 1, "templates": tem_list, "control_data": control_data})
		})

		return render_to_response('group/templates/editor/groups.html', c)
Beispiel #11
0
    def get(request):
        """
		响应GET
		"""
        has_data = app_models.RebateParticipance.objects(
            belong_to=request.GET['id']).count()

        c = RequestContext(
            request, {
                'first_nav_name':
                FIRST_NAV,
                'second_navs':
                mall_export.get_promotion_and_apps_second_navs(request),
                'second_nav_name':
                mall_export.MALL_APPS_SECOND_NAV,
                'third_nav_name':
                mall_export.MALL_APPS_REBATE_NAV,
                'has_data':
                has_data,
                'record_id':
                request.GET['id']
            })

        return render_to_response(
            'rebate/templates/editor/rebate_participances.html', c)
Beispiel #12
0
    def get(request):
        """
		卡兑换配置页
		"""
        webapp_id = request.user_profile.webapp_id
        card_exchange_dic = CardExchange.get_can_exchange_cards(webapp_id)
        if card_exchange_dic:
            prize_list = card_exchange_dic['prize']
            for prize in prize_list:
                card_number = prize['card_number']
                s_num = card_number.split('-')[0]
                end_num = card_number.split('-')[1]
                prize['s_num'] = s_num
                prize['end_num'] = end_num

        c = RequestContext(
            request, {
                'first_nav_name': FIRST_NAV_NAME,
                'second_navs':
                export.get_promotion_and_apps_second_navs(request),
                'second_nav_name': export.MALL_PROMOTION_SECOND_NAV,
                'third_nav_name': export.MALL_PROMOTION_CARD_EXCHANGE_NAV,
                'card_exchange_dic': card_exchange_dic
            })
        return render_to_response('mall/editor/promotion/card_exchange.html',
                                  c)
Beispiel #13
0
    def get(request):
        c = RequestContext(
            request, {
                'first_nav_name': export.MALL_PROMOTION_AND_APPS_FIRST_NAV,
                'second_navs':
                export.get_promotion_and_apps_second_navs(request),
                'second_nav_name': export.MALL_PROMOTION_SECOND_NAV,
                'third_nav_name': export.MALL_PROMOTION_PROMOTIONS_NAV
            })

        return render_to_response('mall/editor/promotion/promotions.html', c)
Beispiel #14
0
	def get(request):
		"""
		卡兑换详情页
		"""
		c = RequestContext(request, {
			'first_nav_name': FIRST_NAV,
			'second_navs': mall_export.get_promotion_and_apps_second_navs(request),
			'second_nav_name': mall_export.MALL_APPS_SECOND_NAV,
			'third_nav_name': mall_export.MALL_APPS_REBATE_NAV,
			'record_id': request.GET['id']
		})
		return render_to_response('rebate/templates/editor/card_rebate_details.html', c)
    def get(request):
        """
        红包分析页面
        """
        rule_id = request.GET.get('id', None)
        redEnvelope2Order_data = promotion_models.RedEnvelopeToOrder.objects.filter(red_envelope_rule_id=rule_id)
        received_count = redEnvelope2Order_data.count() #领取人数
        rule_data = promotion_models.RedEnvelopeRule.objects.get(id=rule_id)
        coupon_rule = promotion_models.CouponRule.objects.get(id=rule_data.coupon_rule_id)
        relations = promotion_models.RedEnvelopeParticipences.objects.filter(red_envelope_rule_id=rule_id)
        coupon_ids = [r.coupon_id for r in relations]
        coupons = promotion_models.Coupon.objects.filter(id__in=coupon_ids)
        coupon_id2coupon = dict([c.id, c] for c in coupons)
        new_member_count = 0         #新关注人数
        consumption_sum = 0          #产生消费额
        total_use_count = relations.filter(coupon__status=COUPON_STATUS_USED).count()     #使用人数

        #加上引入的数字
        orders = Order.objects.filter(coupon_id__in=coupon_ids, status=5)
        coupon_id2order = {}
        for order in orders:
            cur_coupon_id = order.coupon_id
            coupon_id2order[cur_coupon_id] = order
        for relation in relations:
            #求用优惠券的情况下,该红包规则下的总消费额
            cur_coupon = coupon_id2coupon[relation.coupon_id]
            if cur_coupon.status == 1 and relation.introduced_by == 0:
                if cur_coupon.id in coupon_id2order:
                    order = coupon_id2order[cur_coupon.id]
                    consumption_sum = consumption_sum + order.final_price + order.postage
            new_member_count += relation.introduce_new_member
            received_count += relation.introduce_received_number
            consumption_sum += relation.introduce_sales_number
        c = RequestContext(request, {
            'first_nav_name': FIRST_NAV_NAME,
            'second_navs': export.get_promotion_and_apps_second_navs(request),
            'second_nav_name': export.MALL_APPS_SECOND_NAV,
            'third_nav_name': export.MALL_APPS_RED_ENVELOPE_NAV,
            'new_member_count': new_member_count,
            'received_count': received_count,
            'consumption_sum': '%.2f' % consumption_sum,
            'total_use_count': total_use_count,
            'red_envelope_id': rule_id,
            'red_envelope_name': rule_data.name,
            'red_envelope_start_time': rule_data.start_time.strftime("%Y-%m-%d"),
            'red_envelope_end_time': rule_data.end_time.strftime("%Y-%m-%d"),
            'limit_time': rule_data.limit_time,
            'is_timeout': False if rule_data.end_time > datetime.now() else True,
            'receive_method': rule_data.receive_method,
            'coupon_rule_id': coupon_rule.id
        })
        return render_to_response('red_envelope/templates/editor/red_envelope_participances.html', c)
Beispiel #16
0
 def get(request):
     """
     红包分析页面
     """
     rule_id = request.GET.get('id', None)
     has_data = promotion_models.GetRedEnvelopeRecord.objects.filter(
         red_envelope_rule_id=rule_id).count()
     rule_data = promotion_models.RedEnvelopeRule.objects.get(id=rule_id)
     coupon_rule = promotion_models.CouponRule.objects.get(
         id=rule_data.coupon_rule_id)
     #TODO 传递正确的数字
     new_member_count = 152
     received_count = 3000
     consumption_sum = 13000.00
     total_use_count = 300
     c = RequestContext(
         request, {
             'first_nav_name':
             FIRST_NAV_NAME,
             'second_navs':
             export.get_promotion_and_apps_second_navs(request),
             'second_nav_name':
             export.MALL_APPS_SECOND_NAV,
             'third_nav_name':
             export.MALL_PROMOTION_ORDER_RED_ENVELOPE,
             'has_data':
             has_data,
             'new_member_count':
             new_member_count,
             'received_count':
             received_count,
             'consumption_sum':
             consumption_sum,
             'total_use_count':
             total_use_count,
             'red_envelope_id':
             rule_id,
             'red_envelope_name':
             rule_data.name,
             'red_envelope_start_time':
             rule_data.start_time.strftime("%Y-%m-%d"),
             'red_envelope_end_time':
             rule_data.end_time.strftime("%Y-%m-%d"),
             'receive_method':
             rule_data.receive_method,
             'coupon_rule_id':
             coupon_rule.id
         })
     return render_to_response(
         'mall/editor/red_envelope_participences.html', c)
Beispiel #17
0
    def get(request):
        """
		卡兑换详情页
		"""
        c = RequestContext(
            request, {
                'first_nav_name': FIRST_NAV_NAME,
                'second_navs':
                export.get_promotion_and_apps_second_navs(request),
                'second_nav_name': export.MALL_PROMOTION_SECOND_NAV,
                'third_nav_name': export.MALL_PROMOTION_CARD_EXCHANGE_NAV,
            })
        return render_to_response(
            'mall/editor/promotion/card_exchange_details.html', c)
Beispiel #18
0
    def get(request):
        """
		浏览虚拟商品(福利卡券)列表
		"""
        c = RequestContext(
            request, {
                'first_nav_name': export.MALL_PROMOTION_AND_APPS_FIRST_NAV,
                'second_navs':
                export.get_promotion_and_apps_second_navs(request),
                'second_nav_name': export.MALL_PROMOTION_SECOND_NAV,
                'third_nav_name': export.MALL_PROMOTION_VIRTUAL_PRODUCTS_NAV
            })

        return render_to_response(
            'mall/editor/promotion/virtual_products.html', c)
Beispiel #19
0
	def get(request):
		"""
		响应GET
		"""
		has_data = app_models.{{resource.item_class_name}}.objects.count()
		__STRIPPER_TAG__
		c = RequestContext(request, {
			'first_nav_name': FIRST_NAV,
			'second_navs': mall_export.get_promotion_and_apps_second_navs(request),
			'second_nav_name': mall_export.MALL_APPS_SECOND_NAV,
			'third_nav_name': "{{resource.second_nav}}",
			'has_data': has_data
		});
		__STRIPPER_TAG__
		return render_to_response('{{app_name}}/templates/editor/{{resource.lower_name}}.html', c)
Beispiel #20
0
	def get(request):
		"""
		响应GET
		"""
		has_data = app_models.survey.objects.count()
		
		c = RequestContext(request, {
			'first_nav_name': FIRST_NAV,
			'second_navs': export.get_promotion_and_apps_second_navs(request),
			'second_nav_name': export.MALL_APPS_SECOND_NAV,
            'third_nav_name': export.MALL_APPS_SURVEY_NAV,
			'has_data': has_data
		});
		
		return render_to_response('survey/templates/editor/surveies.html', c)
Beispiel #21
0
	def get(request):
		"""
		响应GET
		"""
		has_data = app_models.Exlottery.objects.count()
		
		c = RequestContext(request, {
			'first_nav_name': FIRST_NAV,
			'second_navs': mall_export.get_promotion_and_apps_second_navs(request),
			'second_nav_name': mall_export.MALL_APPS_SECOND_NAV,
			'third_nav_name': "exlotteries",
			'has_data': has_data
		})
		
		return render_to_response('exlottery/templates/editor/exlotteries.html', c)
	def get(request):
		"""
		响应GET
		"""
		has_data = app_models.ExlotteryParticipance.objects(belong_to=request.GET['id']).count()

		c = RequestContext(request, {
			'first_nav_name': FIRST_NAV,
			'second_navs': export.get_promotion_and_apps_second_navs(request),
			'second_nav_name': export.MALL_APPS_SECOND_NAV,
            'third_nav_name': export.MALL_APPS_EXLOTTERY_NAV,
			'has_data': has_data,
			'activity_id': request.GET['id']
		})

		return render_to_response('exlottery/templates/editor/exlottery_participances.html', c)
Beispiel #23
0
    def get(request):
        """
		创建福利卡券活动
		"""
        id = int(request.GET.get('id', 0))
        virtual_product = None
        if id:
            _virtual_product = promotion_models.VirtualProduct.objects.get(
                id=id)
            product = _virtual_product.product
            product.fill_standard_model()
            _product = {
                'id': product.id,
                'name': product.name,
                'bar_code': product.bar_code,
                'price': product.price,
                'stocks': product.stocks,
                'thumbnails_url': product.thumbnails_url,
                'detail_link':
                '/mall2/product/?id=%d&source=onshelf' % product.id,
                'created_at': product.created_at.strftime('%Y-%m-%d %H:%M')
            }

            virtual_product = {
                'id':
                _virtual_product.id,
                'name':
                _virtual_product.name,
                'product':
                _product,
                'created_at':
                _virtual_product.created_at.strftime('%Y-%m-%d %H:%M')
            }

        c = RequestContext(
            request, {
                'first_nav_name': export.MALL_PROMOTION_AND_APPS_FIRST_NAV,
                'second_navs':
                export.get_promotion_and_apps_second_navs(request),
                'second_nav_name': export.MALL_PROMOTION_SECOND_NAV,
                'third_nav_name': export.MALL_PROMOTION_VIRTUAL_PRODUCTS_NAV,
                'virtual_product': virtual_product
            })

        return render_to_response('mall/editor/promotion/virtual_product.html',
                                  c)
Beispiel #24
0
	def get(request):
		"""
		响应GET
		"""
		has_data = app_models.GroupRelations.objects(belong_to=request.GET['id']).count()

		c = RequestContext(request, {
			'first_nav_name': FIRST_NAV,
			'second_navs': mall_export.get_promotion_and_apps_second_navs(request),
			'second_nav_name': mall_export.MALL_APPS_SECOND_NAV,
			'third_nav_name': "groups",
			'has_data': has_data,

			'activity_id': request.GET['id']
		});

		return render_to_response('group/templates/editor/group_participances.html', c)
Beispiel #25
0
    def get(request):
        """
		响应GET
		"""
        has_data = app_models.PowerMe.objects.count()

        c = RequestContext(
            request, {
                'first_nav_name': FIRST_NAV,
                'second_navs':
                export.get_promotion_and_apps_second_navs(request),
                'second_nav_name': export.MALL_APPS_SECOND_NAV,
                'third_nav_name': export.MALL_APPS_POWERME_NAV,
                'has_data': has_data
            })

        return render_to_response('powerme/templates/editor/powermes.html', c)
Beispiel #26
0
    def get(request):
        """
        添加库存页面
        """
        rule_id = request.GET.get('rule_id', '0')
        rules = CouponRule.objects.filter(owner=request.manager, id=rule_id)

        c = RequestContext(
            request, {
                'first_nav_name': FIRST_NAV_NAME,
                'second_navs':
                export.get_promotion_and_apps_second_navs(request),
                'second_nav_name': export.MALL_PROMOTION_SECOND_NAV,
                'third_nav_name': export.MALL_PROMOTION_COUPON_NAV,
                'rule': rules[0]
            })
        return render_to_response('mall/editor/promotion/create_coupon.html',
                                  c)
Beispiel #27
0
 def get(request):
     """
     优惠券规则列表页面
     """
     endDate = request.GET.get('endDate', '')
     if endDate:
         endDate += ' 00:00'
     c = RequestContext(
         request, {
             'first_nav_name': FIRST_NAV_NAME,
             'second_navs':
             export.get_promotion_and_apps_second_navs(request),
             'second_nav_name': export.MALL_PROMOTION_SECOND_NAV,
             'third_nav_name': export.MALL_PROMOTION_COUPON_NAV,
             'endDate': endDate,
             'promotion_status': request.GET.get('status', '-1')
         })
     return render_to_response('mall/editor/promotion/coupon_rules.html', c)
Beispiel #28
0
    def get(request):
        """获得限时抢购列表.
        """
        endDate = request.GET.get('endDate', '')
        if endDate:
            endDate += ' 00:00'
        c = RequestContext(
            request, {
                'first_nav_name': export.MALL_PROMOTION_AND_APPS_FIRST_NAV,
                'second_navs':
                export.get_promotion_and_apps_second_navs(request),
                'second_nav_name': export.MALL_PROMOTION_SECOND_NAV,
                'third_nav_name': export.MALL_PROMOTION_FLASH_SALE_NAV,
                'endDate': endDate,
                'promotion_status': request.GET.get('status', '-1')
            })

        return render_to_response('mall/editor/promotion/flash_sales.html', c)
Beispiel #29
0
    def get(request):
        """获得限时抢购列表.
        """
        endDate = request.GET.get('endDate', '')
        if endDate:
            endDate +=' 00:00'
        integral_strategy = IntegralStrategySttings.objects.get(webapp_id=request.user_profile.webapp_id)
        c = RequestContext(request, {
            'first_nav_name': export.MALL_PROMOTION_AND_APPS_FIRST_NAV,
            'second_navs': export.get_promotion_and_apps_second_navs(request),
            'second_nav_name': export.MALL_PROMOTION_SECOND_NAV,
            'third_nav_name': export.MALL_PROMOTION_INTEGRAL_SALE_NAV,
            'is_order_integral_open': integral_strategy.use_ceiling > 0,
            'endDate': endDate,
            'promotion_status': request.GET.get('status', '-1')
        })

        return render_to_response('mall/editor/promotion/integral_sales.html', c)
Beispiel #30
0
    def put(request):
        """添加限时抢购
        """
        member_grades = MemberGrade.get_all_grades_list(
            request.user_profile.webapp_id)

        c = RequestContext(
            request, {
                'member_grades': member_grades,
                'first_nav_name': export.MALL_PROMOTION_AND_APPS_FIRST_NAV,
                'second_navs':
                export.get_promotion_and_apps_second_navs(request),
                'second_nav_name': export.MALL_PROMOTION_SECOND_NAV,
                'third_nav_name': export.MALL_PROMOTION_FLASH_SALE_NAV
            })

        return render_to_response(
            'mall/editor/promotion/create_flash_sale.html', c)