Bläddra i källkod

Merge branch 'ralb' of 39.97.239.116:gyfl/xyzshop into ralb

stanley-king 3 år sedan
förälder
incheckning
499add3ea4

+ 12 - 1
data/config/win/refill.ini.php

@@ -182,6 +182,16 @@ $fetch_zanzan_oil = ['name' => 'fetch_zanzan', 'store_id' => 95, 'qualitys' => '
     ],
     'period' => [], 'refill_type' => 'fetch'];
 
+$fetch_lingzh_oil = ['name' => 'fetch_lingzh', 'store_id' => 96, 'qualitys' => '1',
+    'amount' => [
+        100 => [['goods_id' => 6864, 'price' => 96.5, 'quality' => 1, 'card_type' => 'sinopec,petrochina']],
+        200 => [['goods_id' => 6865, 'price' => 193, 'quality' => 1, 'card_type' => 'sinopec,petrochina']],
+        500 => [['goods_id' => 6866, 'price' => 482.5, 'quality' => 1, 'card_type' => 'sinopec,petrochina']],
+        1000 => [['goods_id' => 6867, 'price' => 965, 'quality' => 1, 'card_type' => 'sinopec,petrochina']],
+        2000 => [['goods_id' => 6868, 'price' => 1930, 'quality' => 1, 'card_type' => 'sinopec,petrochina']]
+    ],
+    'period' => [], 'refill_type' => 'fetch'];
+
 $oil_providers = [
 //    ['name' => 'tianjt', 'cfg' => $tianjt_oil],
 //    ['name' => 'suhctm', 'cfg' => $suhctm_oil],
@@ -198,7 +208,8 @@ $oil_providers = [
     ['name' => 'feinimoshu', 'cfg' => $feinimoshu_oil],
     ['name' => 'xiaoniu', 'cfg' => $xiaoniu_oil],
     ['name' => 'yingdian', 'cfg' => $yingdian_oil],
-    ['name' => 'fetch_zanzan', 'cfg' => $fetch_zanzan_oil]
+    ['name' => 'fetch_zanzan', 'cfg' => $fetch_zanzan_oil],
+    ['name' => 'fetch_lingzh', 'cfg' => $fetch_lingzh_oil]
 ];
 $config['oil_providers'] = $oil_providers;
 

+ 12 - 1
data/config/xyz/refill.ini.php

@@ -182,6 +182,16 @@ $fetch_zanzan_oil = ['name' => 'fetch_zanzan', 'store_id' => 95, 'qualitys' => '
     ],
     'period' => [], 'refill_type' => 'fetch'];
 
+$fetch_lingzh_oil = ['name' => 'fetch_lingzh', 'store_id' => 96, 'qualitys' => '1',
+    'amount' => [
+        100 => [['goods_id' => 6864, 'price' => 96.5, 'quality' => 1, 'card_type' => 'sinopec,petrochina']],
+        200 => [['goods_id' => 6865, 'price' => 193, 'quality' => 1, 'card_type' => 'sinopec,petrochina']],
+        500 => [['goods_id' => 6866, 'price' => 482.5, 'quality' => 1, 'card_type' => 'sinopec,petrochina']],
+        1000 => [['goods_id' => 6867, 'price' => 965, 'quality' => 1, 'card_type' => 'sinopec,petrochina']],
+        2000 => [['goods_id' => 6868, 'price' => 1930, 'quality' => 1, 'card_type' => 'sinopec,petrochina']]
+    ],
+    'period' => [], 'refill_type' => 'fetch'];
+
 $oil_providers = [
 //    ['name' => 'tianjt', 'cfg' => $tianjt_oil],
 //    ['name' => 'suhctm', 'cfg' => $suhctm_oil],
@@ -198,7 +208,8 @@ $oil_providers = [
     ['name' => 'feinimoshu', 'cfg' => $feinimoshu_oil],
     ['name' => 'xiaoniu', 'cfg' => $xiaoniu_oil],
     ['name' => 'yingdian', 'cfg' => $yingdian_oil],
-    ['name' => 'fetch_zanzan', 'cfg' => $fetch_zanzan_oil]
+    ['name' => 'fetch_zanzan', 'cfg' => $fetch_zanzan_oil],
+    ['name' => 'fetch_lingzh', 'cfg' => $fetch_lingzh_oil]
 ];
 $config['oil_providers'] = $oil_providers;
 

+ 12 - 1
data/config/xyzadm/refill.ini.php

@@ -182,6 +182,16 @@ $fetch_zanzan_oil = ['name' => 'fetch_zanzan', 'store_id' => 95, 'qualitys' => '
     ],
     'period' => [], 'refill_type' => 'fetch'];
 
+$fetch_lingzh_oil = ['name' => 'fetch_lingzh', 'store_id' => 96, 'qualitys' => '1',
+    'amount' => [
+        100 => [['goods_id' => 6864, 'price' => 96.5, 'quality' => 1, 'card_type' => 'sinopec,petrochina']],
+        200 => [['goods_id' => 6865, 'price' => 193, 'quality' => 1, 'card_type' => 'sinopec,petrochina']],
+        500 => [['goods_id' => 6866, 'price' => 482.5, 'quality' => 1, 'card_type' => 'sinopec,petrochina']],
+        1000 => [['goods_id' => 6867, 'price' => 965, 'quality' => 1, 'card_type' => 'sinopec,petrochina']],
+        2000 => [['goods_id' => 6868, 'price' => 1930, 'quality' => 1, 'card_type' => 'sinopec,petrochina']]
+    ],
+    'period' => [], 'refill_type' => 'fetch'];
+
 $oil_providers = [
 //    ['name' => 'tianjt', 'cfg' => $tianjt_oil],
 //    ['name' => 'suhctm', 'cfg' => $suhctm_oil],
@@ -198,7 +208,8 @@ $oil_providers = [
     ['name' => 'feinimoshu', 'cfg' => $feinimoshu_oil],
     ['name' => 'xiaoniu', 'cfg' => $xiaoniu_oil],
     ['name' => 'yingdian', 'cfg' => $yingdian_oil],
-    ['name' => 'fetch_zanzan', 'cfg' => $fetch_zanzan_oil]
+    ['name' => 'fetch_zanzan', 'cfg' => $fetch_zanzan_oil],
+    ['name' => 'fetch_lingzh', 'cfg' => $fetch_lingzh_oil]
 ];
 $config['oil_providers'] = $oil_providers;
 

+ 42 - 0
helper/refill/api/xyz/fetch_lingzh/RefillCallBack.php

@@ -0,0 +1,42 @@
+<?php
+
+
+namespace refill\fetch_lingzh;
+
+require_once(BASE_HELPER_RAPI_PATH . '/fetch_lingzh/config.php');
+
+
+use refill;
+
+class RefillCallBack implements refill\IRefillCallBack
+{
+    public function verify($params): bool
+    {
+        return true;
+    }
+
+    public function notify($params)
+    {
+        $order_sn = $params['order_sn'];
+        $state = $params['state'];
+        $official_sn = $params['official_sn'] ?? '';
+
+
+        $order_info = Model('vr_order')->getOrderInfo(['order_sn' => $order_sn]);
+        if (empty($order_info)) {
+            return [false, false, false,false];
+        }
+        $order_id = $order_info['order_id'];
+
+        if ($state === 'SUCCESS') {
+            Model('refill_order')->edit($order_id, ['official_sn' => $official_sn]);
+            return [$order_id, true, false,true];
+        }
+        elseif ($state === 'CANCEL') {
+            return [$order_id, false, true,true];
+        }
+        else {
+            return [$order_id, false, false,false];
+        }
+    }
+}

+ 51 - 0
helper/refill/api/xyz/fetch_lingzh/RefillOil.php

@@ -0,0 +1,51 @@
+<?php
+
+namespace refill\fetch_lingzh;
+
+require_once(BASE_HELPER_RAPI_PATH . '/fetch_lingzh/config.php');
+
+use refill;
+
+class RefillOil extends refill\IRefillOil
+{
+    public function __construct($cfgs)
+    {
+        parent::__construct($cfgs);
+    }
+
+    public function add($card_no, $card_type, $amount, $params,&$net_errno = 0)
+    {
+        $mod_fetch = Model('fetch_order');
+        $count = $mod_fetch->store_order_count($this->store_id());
+        return [config::PROCESS_ABILITY >= $count, '',false];
+    }
+
+    public function query($refill_info)
+    {
+        $order_sn = $refill_info['order_sn'];
+        $store_id = $this->store_id();
+
+        $mod_fetch = Model('fetch_order');
+        $order = $mod_fetch->order_info(['order_sn' => $order_sn,'store_id' => $store_id],'*',true);
+        if(empty($order)) {
+            return [true, ORDER_STATE_NOEXIST];
+        }
+
+        $fetch_status = intval($order['fetch_status']);
+        $fetch_result = $order['fetch_result'];
+        $official_sn = $order['official_sn'];
+
+        if ($fetch_status == 0) {
+            $order_state = ORDER_STATE_CANCEL;
+        } elseif ($fetch_status == 1 || $fetch_status == 2) {
+            $order_state = ORDER_STATE_SEND;
+        } elseif ($fetch_result == "SUCCESS") {
+            $order_state = ORDER_STATE_SUCCESS;
+            Model('refill_order')->edit($refill_info['order_id'], ['official_sn' => $official_sn]);
+        } else {
+            $order_state = ORDER_STATE_CANCEL;
+        }
+
+        return [true, $order_state];
+    }
+}

+ 9 - 0
helper/refill/api/xyz/fetch_lingzh/config.php

@@ -0,0 +1,9 @@
+<?php
+
+
+namespace refill\fetch_lingzh;
+
+class config
+{
+    const PROCESS_ABILITY = 100;
+}

+ 8 - 0
shop/templates/default/seller/store_refill_order.batch_dispose.php

@@ -11,6 +11,14 @@
     position: relative;
     z-index: 1;
 }
+.tabmenu {
+    background-color: #FFF;
+    width: 100%;
+    height: 38px;
+    display: flex;
+    position: relative;
+    z-index: 99;
+}
 </style>
 <?php defined('InShopNC') or exit('Access Invalid!'); ?>
 

+ 37 - 3
shop/templates/default/seller/store_refill_order.index.php

@@ -5,7 +5,7 @@
         padding:0 10px;
     }
     .tabmenu {
-        margin-top: 20px;
+        /* margin-top: 20px; */
         display: flex;
         justify-content: space-between;
     }
@@ -54,6 +54,9 @@ a:nth-child(3) {
     position: relative;
     z-index: 1;
 }
+.topmar {
+    margin-top: 10px;
+}
 </style>
 <?php defined('InShopNC') or exit('Access Invalid!'); ?>
 
@@ -69,7 +72,7 @@ a:nth-child(3) {
     
 </div>
 <div class="tabmenu">
-    <div>
+    <div class="topmar">
     <select name="" id="tabmenuright" class="tabmenuright">
         <option value="0">卡类型</option>
         <option value="<?php echo mtopcard\PetroChinaCard;?>" <?php if($_GET['card_type'] == mtopcard\PetroChinaCard){ echo 'selected';}?>>中石油</option>
@@ -102,6 +105,7 @@ a:nth-child(3) {
         <th class="w150">充值卡号</th>
         <th class="w80">充值面额</th>
         <th class="w150">下单时间</th>
+        <th class="w130">倒计时</th>
         <th class="w150">接单时间</th>
         <th class="w150">流水号填写</th>
 <!--        <th class="w150">凭证上传</th>-->
@@ -117,6 +121,9 @@ a:nth-child(3) {
                 <td class="bdl"><?php echo $order['card_no']; ?></td>
                 <td class="bdl"><?php echo $order['refill_amount']; ?></td>
                 <td class="bdl"><?php echo date('Y-m-d H:i:s', $order['add_time']);?></td>
+                <td class="bdl">
+                    <span class="box" data-time="<?php echo $order['add_time'];?>"></span>
+                </td>
                 <td class="bdl"><?php echo date('Y-m-d H:i:s', $order['fetch_time']);?></td>
                 <td class="bdl"><input class="trade_no" type="text" name="ch_trade_no" style="width: 180px" id="ch_trade_no" /></td>
                 <!-- <td class="bdl">
@@ -178,7 +185,35 @@ a:nth-child(3) {
                 } 
                 })
         })
+        //倒计时
+        let num1 = []
+        $('.box').each(function (index,item) {
+            var datetime = $(this).attr('data-time')
+            // console.log("时间1",datetime);
+            let timestamp = Date.parse(new Date()) / 1000;
+            // console.log('时间2', timestamp);
+            let num = 900 - (timestamp - datetime)
+       
+             
+             console.log(num1.push(num));
+            
+            let timer = setInterval(function () {
+                num--;
+                    $(item).text(num + 's');
+
+           
+                if (num < 180 && num > 0) {
+                    $(item).css('color', 'red')
+                    console.log(180);
+                } else if (num < 0 ) {
+                    $(item).text(0);
+                    $(item).css('color', 'red')
+
+                    console.log(111);
 
+                }
+            }, 1000) 
+        })
 
         //抢单
         $('#queryrob').click(() => {
@@ -270,5 +305,4 @@ a:nth-child(3) {
     //     })
 
     //     }
-    var inputs=	document.getElementsByName("name1");
 </script>