选择加入Google客户评论

时间:2018-06-27 09:21:20

标签: javascript

我正在尝试将此选择的交货日期定为今天+ 1个月。

“ estimated_delivery_date”应设置为今天的var数据。

当我尝试调试网站时,它仅显示脚本中编写的"estimated_delivery_date": today

我的代码:

	<script src="https://apis.google.com/js/platform.js?onload=renderOptIn" async defer></script>
<script>
                    window.renderOptIn = function() {
                        window.gapi.load('surveyoptin', function() {
                            var today = new Date();
                            var dd = today.getDate();

                            var mm = today.getMonth()+1; 
                            var yyyy = today.getFullYear();
                            if(dd<10) 
                                {
                                    dd='0'+dd;
                                } 

                            if(mm<10) 
                                {
                                    mm='0'+mm;
                                } 
                                today = yyyy+'-'+mm+'-'+dd;
                            window.gapi.surveyoptin.render(
                                {
                                    // REQUIRED FIELDS
                                    "merchant_id": 123154094,
                                    "order_id": "{$order->Id}",
                                    "email": "{$orderCustomer->Email}",
                                    "delivery_country": "DK",
                                    "estimated_delivery_date": today
                                });
                            });
                        }
                </script>

我该如何解决?

0 个答案:

没有答案