Ver Fonte

fix:六格连环可滑动

wsc há 6 meses atrás
pai
commit
3153fb7ba8

+ 4 - 0
application/controllers/Activity.php

@@ -2330,6 +2330,8 @@ class Activity extends MY_Controller
                 }
                 $data['extra_reward'] = json_encode($data['superSerialConfig'],256);
                 $data['reward_info'] = json_encode(['scoreCGType' => 3]);
+                $data['extraData'] = $data['superSerialPackExtraConfig'] ?? [];
+                unset($data['superSerialPackExtraConfig']);
                 unset($data['superSerialConfig']);
                 unset($data['scoreCGType']);
                 break;
@@ -2370,6 +2372,8 @@ class Activity extends MY_Controller
                 }
                 $data['extra_reward'] = json_encode($data['superSerialProgressConfig'],JSON_NUMERIC_CHECK);
                 $data['reward_info'] = json_encode(['scoreCGType' => 3]);
+                $data['extraData'] = $data['superSerialPackExtraConfig'] ?? [];
+                unset($data['superSerialPackExtraConfig']);
                 unset($data['superSerialProgressConfig']);
                 unset($data['scoreCGType']);
                 break;

+ 36 - 0
application/models/ActivityModel.php

@@ -314,6 +314,9 @@ class ActivityModel extends CI_Model
             case SUPER_SERIAL_PACK7:  // 有进度连环礼包2
             case SUPER_SERIAL_PACK9:  // 有进度有广告六格连环礼包
                 $baseConfig['superSerialProgressConfig'] = ActivityModel::superSerialProgressConfig($aType, $activity, $stagesRewardsArray, $stagesRewardsMoreArray, $activityConf, $idxMapping);
+                $extraConfig = self::parseBasicConfig2(SUPER_SERIAL_PACK3, $dataArray[0]);
+                $extraConfig['canSwipe'] = $extraConfig['canSwipe'] == '是' ? 1 : 0;
+                $baseConfig['superSerialPackExtraConfig'] = $extraConfig;
                 break;
             case TIME_LIMITED_CARD:  // 限时卡组
                 $baseConfig['timeLimitedCards'] = ActivityModel::timeLimitedCards($activity, $basicConfArray, $dataArray[1] ?? []);
@@ -1349,6 +1352,39 @@ class ActivityModel extends CI_Model
         $sql = 'select * from '.$tb;
         return oo::commonOprDb('slavedb')->getAll($sql);
     }
+    public static function parseBasicConfig2($type, $basicConfArray): array
+    {
+        $baseConfig = [];
+        $filterPrefixArr = [
+            TREASURE => [
+                '开放等级' => 'treasureOpenLv',
+                '体力存量系数(整数)' => 'spinsRatio',
+                '难度系数' => 'difficultyDegree',
+                '任务值系数' => 'taskDegree',
+            ],
+            BUILD_RANK => [
+                '上榜门槛积分' => 'buildScoreSettingMinScore',
+                '分区类型' => 'setType',
+            ],
+            RANK => [
+                '分区类型' => 'setType',
+            ],
+//            TIME_LIMITED_ISLAND => [
+//                '每个建筑的星星数' => 'stars',
+//                '开放主题' => 'theme',
+//            ],
+            SUPER_SERIAL_PACK3 => [
+                '是否可滑动' => 'canSwipe',
+            ],
+        ];
+        foreach ($basicConfArray as $lineKey => $line) {
+            if (!empty($filterPrefixArr[$type][$line[0]])) {
+                $baseConfig[$filterPrefixArr[$type][$line[0]]] = $line[1];
+            }
+
+        }
+        return $baseConfig;
+    }
 }
 
 

+ 30 - 0
static/activity/js/common.js

@@ -5095,4 +5095,34 @@ getCommonPrizeOprHtml = (name)=>{
                     <button type="button" class="btn btn-outline btn-success" onclick="setPrize(this,'setCommonPrize',1)">奖励配置</button>
                 </td> 
         `
+}
+
+
+// 连环礼包是否可滑动
+function appendSerialSwiperSelector(){
+    let swipSerialPacks = [
+        // 'super_serial_pack',//连环礼包
+        // 'super_serial_pack2',//连环礼包2
+        // 'super_serial_pack6',//有进度连环礼包1
+        // 'super_serial_pack7',//有进度连环礼包2
+        'super_serial_pack3',//六格连环礼包
+        'super_serial_pack4',//六格连环礼包
+        'super_serial_pack5',//有进度六格连环礼包
+        'super_serial_pack8',//有进度六格连环礼包2
+    ]
+    if (!swipSerialPacks.includes(act_type))return
+    let basicConfHtml = `
+            <table class="table table-bordered ">
+                <tr class="commonStageRewardTr">
+                    <td>是否可滑动</td>
+                    <td>
+                        <select class="form-control" name="superSerialPackExtraConfig[canSwipe]">
+                           <option value="0">否</option>
+                           <option value="1">是</option>
+                        </select>
+                    </td>
+                </tr>
+            </table>
+    `
+    $("#reward_info").append(basicConfHtml);
 }

+ 2 - 0
static/activity/js/superSerialPack.js

@@ -8,6 +8,7 @@ function initReward_superSerialPack(type){
     changeTypeTo_superSerialPack(type)
     // 奖励回写
     console.log('reward_info',reward_info)
+    activity_extra_data &&  $('select[name="superSerialPackExtraConfig[canSwipe]"]').val(activity_extra_data.canSwipe)
     if(extra_reward){
         $.each(extra_reward, function (i, o) {
             $('#addSerialLvWrapBtn').click()
@@ -226,6 +227,7 @@ function initSerialWrap(){
     serialLvCnt = 0;
     serialShushuStages = {}
     serialRewardStages = {}
+    appendSerialSwiperSelector()
     var html = ''
     html +=serialWrapStageTable();
     $("#reward_info").append(html);

+ 2 - 1
static/activity/js/super_serial_pack5.js

@@ -9,6 +9,7 @@ function initReward_superSerialProgressPack(type) {
     changeTypeTo_superSerialProgressPack(type)
     // 奖励回写
     console.log('extra_reward', JSON.stringify(extra_reward))
+    activity_extra_data &&  $('select[name="superSerialPackExtraConfig[canSwipe]"]').val(activity_extra_data.canSwipe)
     if (extra_reward) {
         $.each(extra_reward, function (i, o) {
             $('#addSerialProgressLvWrapBtn').click()
@@ -79,7 +80,7 @@ function initSerialProgressWrap() {
     serialProgressCollectRewardStages = {}
 
     $('#reward_info').empty()
-
+    appendSerialSwiperSelector()
     var html = serialProgressWrapStageTable();
     $("#reward_info").append(html);
 }