在线观看不卡亚洲电影_亚洲妓女99综合网_91青青青亚洲娱乐在线观看_日韩无码高清综合久久

鍍金池/ 問答
淺淺 回答

Unable to locate element: {"method":"id","selector":"kw"}

無(wú)法定位元素

局外人 回答

因?yàn)槎假x值為同一個(gè){},也就是數(shù)組的3個(gè)元素都指向同一個(gè)引用。

糖果果 回答

js拼接轉(zhuǎn)json提交。

浪婳 回答

找到原因了,使用翻譯語(yǔ)言的原因,arc diff 表單的單詞不能翻譯

慢半拍 回答

你先綁定事件后往頁(yè)面加元素

$("tbody").on("click",".handle",function(){
    alert(1)
})
誮惜顏 回答

報(bào)錯(cuò)了:

 Cannot read property 'currentAuthority' of undefined 
at changeLoginStatus

在index.js第76488行,99列,你看看

this.props.form.validateFields((err, values) => {
  if (!err) {
    const data = new URLSearchParams(values);
    }
})



if (newOptions.method === "POST" || newOptions.method === "PUT") {
if (!(newOptions.body instanceof FormData) && !(newOptions.body instanceof URLSearchParams)) {
  newOptions.headers = {
    Accept: "application/json",
    "Content-Type": "application/json; charset=utf-8",
    ...newOptions.headers
  };
  newOptions.body = JSON.stringify(newOptions.body);
} else {
  // newOptions.body is FormData
  newOptions.headers = {
    Accept: "application/json",
    "Content-Type": "application/x-www-form-urlencoded;charset=utf-8",
    ...newOptions.headers
  };
}

}

久不遇 回答

你的代碼不貼出來(lái) 誰(shuí)能看懂啊

你的瞳 回答

你看看這個(gè)行不行, 大概也就這樣思路.

/**
 * 紅包分配算法
 *
 * example
 *      $coupon = new Coupon(200, 5);
 *      $res = $coupon->handle();
 *      print_r($res);
 *
 * @author Flc <2018-04-06 20:09:53>
 * @see http://flc.ren | http://flc.io | https://github.com/flc1125
 */
class Coupon
{
    /**
     * 紅包金額
     *
     * @var float
     */
    protected $amount;

    /**
     * 紅包個(gè)數(shù)
     *
     * @var int
     */
    protected $num;

    /**
     * 領(lǐng)取的紅包最小金額
     *
     * @var float
     */
    protected $coupon_min;

    /**
     * 紅包分配結(jié)果
     *
     * @var array
     */
    protected $items = [];

    /**
     * 初始化
     *
     * @param float $amount     紅包金額(單位:元)最多保留2位小數(shù)
     * @param int   $num        紅包個(gè)數(shù)
     * @param float $coupon_min 每個(gè)至少領(lǐng)取的紅包金額
     */
    public function __construct($amount, $num = 1, $coupon_min = 0.01)
    {
        $this->amount = $amount;
        $this->num = $num;
        $this->coupon_min = $coupon_min;
    }

    /**
     * 處理返回
     *
     * @return array
     */
    public function handle()
    {
        // A. 驗(yàn)證
        if ($this->amount < $validAmount = $this->coupon_min * $this->num) {
            throw new Exception('紅包總金額必須≥'.$validAmount.'元');
        }

        // B. 分配紅包
        $this->apportion();

        return [
            'items' => $this->items,
        ];
    }

    /**
     * 分配紅包
     */
    protected function apportion()
    {
        $num = $this->num;  // 剩余可分配的紅包個(gè)數(shù)
        $amount = $this->amount;  //剩余可領(lǐng)取的紅包金額

        while ($num >= 1) {
            // 剩余一個(gè)的時(shí)候,直接取剩余紅包
            if ($num == 1) {
                $coupon_amount = $this->decimal_number($amount);
            } else {
                $avg_amount = $this->decimal_number($amount / $num);  // 剩余的紅包的平均金額

                $coupon_amount = $this->decimal_number(
                    $this->calcCouponAmount($avg_amount, $amount, $num)
                );
            }

            $this->items[] = $coupon_amount; // 追加分配

            $amount -= $coupon_amount;
            --$num;
        }

        shuffle($this->items);  //隨機(jī)打亂
    }

    /**
     * 計(jì)算分配的紅包金額
     *
     * @param float $avg_amount 每次計(jì)算的平均金額
     * @param float $amount     剩余可領(lǐng)取金額
     * @param int   $num        剩余可領(lǐng)取的紅包個(gè)數(shù)
     *
     * @return float
     */
    protected function calcCouponAmount($avg_amount, $amount, $num)
    {
        // 如果平均金額小于等于最低金額,則直接返回最低金額
        if ($avg_amount <= $this->coupon_min) {
            return $this->coupon_min;
        }

        // 浮動(dòng)計(jì)算
        $coupon_amount = $this->decimal_number($avg_amount * (1 + $this->apportionRandRatio()));

        // 如果低于最低金額或超過(guò)可領(lǐng)取的最大金額,則重新獲取
        if ($coupon_amount < $this->coupon_min
            || $coupon_amount > $this->calcCouponAmountMax($amount, $num)
        ) {
            return $this->calcCouponAmount($avg_amount, $amount, $num);
        }

        return $coupon_amount;
    }

    /**
     * 計(jì)算分配的紅包金額-可領(lǐng)取的最大金額
     *
     * @param float $amount
     * @param int   $num
     */
    protected function calcCouponAmountMax($amount, $num)
    {
        return $this->coupon_min + $amount - $num * $this->coupon_min;
    }

    /**
     * 紅包金額浮動(dòng)比例
     */
    protected function apportionRandRatio()
    {
        // 60%機(jī)率獲取剩余平均值的大幅度紅包(可能正數(shù)、可能負(fù)數(shù))
        if (rand(1, 100) <= 60) {
            return rand(-70, 70) / 100; // 上下幅度70%
        }

        return rand(-30, 30) / 100; // 其他情況,上下浮動(dòng)30%;
    }

    /**
     * 格式化金額,保留2位
     *
     * @param float $amount
     *
     * @return float
     */
    protected function decimal_number($amount)
    {
        return sprintf('%01.2f', round($amount, 2));
    }
}

此代碼轉(zhuǎn)載至PHPhuo.org用戶葉子坑, 侵刪!
PHP 實(shí)現(xiàn)微信紅包拆分算法

命于你 回答
  • 從去年10月份開始,更新頻率明顯下降。
  • 3/4曾今的主力都沒有維護(hù)了。
深記你 回答

vue-cli 官方腳本搭建不是可以選擇是否要eslint嗎,選到的話直接幫你配置好了

clipboard.png

淚染裳 回答

<div>
<label><input type="checkbox" [(ngModel)]="checked" (change)="selectAll()">全選</label>
<div style="padding-left:1em" *ngFor="let item of datas; let j = index;">

<input id="checkbox6{{j}}" type="checkbox" [(ngModel)]="item.checked" (change)="selectItemAll(item)">
<label for="checkbox6{{j}}">{{item.title}}</label>

<div style="padding-left:1em" *ngFor="let item1 of item.items">
  <label><input type="checkbox" [(ngModel)]="item1.checked" (change)="selectItem(item1,item)">選擇</label>
  名稱:{{item1.name}} 價(jià)格:{{item1.price}}
</div>

</div>
</div>

瘋子范 回答

你的數(shù)據(jù)應(yīng)該是按照時(shí)間順序的,先計(jì)算出今天昨天前天一周前你需要的分組時(shí)間,然后遍歷數(shù)組比較

var data = data;
var flagn = 0;
var flagb1 = 0;
var flagb3 = 0;
var flagb7 = 0;
var flagb9 = 0;
for (var i = 0; i < data.length; i++) {
    data[i].date = null;
    var secondTime = data[i].time;
    //獲取 0:0 的時(shí)間戳
    var nowDate = new Date(new Date().setHours(0, 0, 0, 0));
    var before1Date = new Date(new Date(new Date().setDate(new Date().getDate() - 1)).setHours(0, 0, 0, 0));
    var before3Date = new Date(new Date(new Date().setDate(new Date().getDate() - 3)).setHours(0, 0, 0, 0));
    var before7Date = new Date(new Date(new Date().setDate(new Date().getDate() - 7)).setHours(0, 0, 0, 0));
    if (secondTime >= nowDate) {
      if (flagn == 0) {  //第一個(gè)就加入一個(gè)標(biāo)志  用來(lái)在渲染的時(shí)候判斷顯示今天
        data[i].date = '今天';
        flagn = 1;
      }
    } else if (secondTime >= before1Date) {
      if (flagb1 == 0) {
        data[i].date = '昨天';
        flagb1 = 1;
      }
    } else if (secondTime >= before3Date) {
      if (flagb3 == 0) {
        data[i].date = '三天前';
        flagb3 = 1;
      }
    } else if (secondTime >= before7Date) {
      if (flagb7 == 0) {
        data[i].date = '一周前';
        flagb7 = 1;
      }
    } else {
      if (flagb9 == 0) {
        data[i].date = '很久以前';
        flagb9 = 1;
      }
    }
 }
 return data;
慢半拍 回答

先搞個(gè)數(shù)據(jù)結(jié)構(gòu)出來(lái),大體結(jié)構(gòu)就是下面這樣,把每個(gè)選中的都放在對(duì)應(yīng)的分類下。然后第二頁(yè)就是吧select弄出來(lái)就好了。也可以用index。

data = [
    {
        title: 'new',
        select: '',
        children: ['股票','科技' ,'產(chǎn)業(yè)']//單選的話,這樣就蠻好的
    },
    {
        title: 'hot',
        select: '',
        children: ['營(yíng)改增','申報(bào)辦稅' ,'出口退稅']
    },
]
<ul>
    <li  v-for="item of data">
        <h4>{{item.title}}</h4>
        <span v-for="c of item" :class="{'select': c.select == c}" @click="c.select = c">{{c}}</span>
    </li>
</ul>

陌上花 回答

不可編輯灰色這個(gè)是屬于繼承樣式 并不是你所選中的元素所帶有的樣式

夕顏 回答

clipboard.png
嘗試改變數(shù)據(jù)交互方式 ,比如:v-model 替換成 v-bind.

冷咖啡 回答

客戶端輪詢
如果客戶端是瀏覽器,起一個(gè)定時(shí)器,每隔一段時(shí)間去請(qǐng)求下服務(wù)端數(shù)據(jù),知道處理完為止。app的話,起一個(gè)線程去干。。
長(zhǎng)連接推送
http2或者websocket甚至js實(shí)現(xiàn)的comet都可以。

巴扎嘿 回答

http://idea.iteblog.com/key.php
我用的是這個(gè),用的2017.3.2版本
另外講真這東西百度一搜一大堆,為啥會(huì)有搜不到的情況
本機(jī)實(shí)拍。。