<?php use yii\helpers\Html; use yii\grid\GridView; use callmez\wechat\models\Fans; use callmez\wechat\widgets\PagePanel; use callmez\wechat\assets\WechatAsset; $wechatAsset = WechatAsset::register($this); $this->title = '粉丝列表'; $this->params['breadcrumbs'][] = $this->title; PagePanel::begin(['options' => ['class' => 'fans-update']]); ?> <?php // echo $this->render('_search', ['model' => $searchModel]); ?> <?php echo GridView::widget(['tableOptions' => ['class' => 'table table-hover'], 'dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [['attribute' => 'id', 'options' => ['width' => 75]], ['attribute' => 'user.avatar', 'format' => 'html', 'value' => function ($model) use($wechatAsset) { return Html::img($model->user ? $model->user->avatar : $wechatAsset->baseUrl . '/images/anonymous_avatar.jpg', ['width' => 40, 'class' => 'img-rounded']); }, 'options' => ['width' => 70]], ['attribute' => 'user.nickname', 'value' => function ($model) { return $model->user ? $model->user->nickname : ''; }], ['attribute' => 'open_id', 'options' => ['width' => 200]], ['attribute' => 'status', 'format' => 'html', 'value' => function ($model) { return Html::tag('span', Fans::$statuses[$model->status], ['class' => 'label label-' . ($model->status == Fans::STATUS_SUBSCRIBED ? 'success' : 'info')]); }, 'filter' => Fans::$statuses, 'options' => ['width' => 120]], ['attribute' => 'created_at', 'format' => 'datetime'], ['class' => 'callmez\\wechat\\widgets\\ActionColumn', 'template' => '{history} {update}', 'buttons' => ['history' => function ($url, $model, $key) { return Html::a('发送消息', ['message', 'id' => $key]); }]]]]); PagePanel::end();
<?php use yii\helpers\Html; use callmez\wechat\widgets\PagePanel; use callmez\wechat\widgets\MessageList; $this->title = '发送客服消息'; $this->params['breadcrumbs'][] = $this->title; $name = $model->user ? $model->user->nickname : $model->open_id; ?> <?php PagePanel::begin(['title' => '和' . $name . '的聊天记录', 'options' => ['class' => 'fans-message']]); ?> <div class="row"> <div class="col-sm-12"> <?php echo MessageList::widget(['dataProvider' => $dataProvider]); ?> </div> </div> <hr /> <div class="row"> <div class="col-sm-12"> <?php echo $this->render('_messageForm', ['model' => $message, 'uploadUrl' => ['upload', 'id' => $model->id]]); ?> </div> </div> <?php PagePanel::end();
<?php use yii\helpers\Html; use callmez\wechat\widgets\PagePanel; $this->title = '卸载 ' . $model->name; $this->params['breadcrumbs'][] = ['label' => '模块管理', 'url' => ['index']]; $this->params['breadcrumbs'][] = $this->title; PagePanel::begin(['options' => ['class' => 'addon-module-uninstall']]); ?> <?php echo $this->render('_form', ['model' => $model]); PagePanel::end();
<?php use yii\helpers\Html; use callmez\wechat\models\Module; use callmez\wechat\widgets\GridView; use callmez\wechat\widgets\PagePanel; $this->title = '模块管理'; $this->params['breadcrumbs'][] = $this->title; $wechat = Yii::$app->getModule('wechat'); if ($wechat->canCreateModule()) { $createModule = Html::a('我要设计新模块', ["/{$wechat->giiModuleName}/{$wechat->giiGeneratorName}"], ['class' => 'pull-right']); } else { $createModule = Html::a('想设计新模块?', 'https://github.com/callmez/yii2-wechat/blob/master/docs/addon-module.md', ['class' => 'pull-right']); } PagePanel::begin(['rightHtml' => $createModule, 'options' => ['class' => 'addon-module-index']]); ?> <?php echo GridView::widget(['dataProvider' => $dataProvider, 'columns' => ['name', 'id', ['attribute' => 'type', 'format' => 'html', 'value' => function ($model) use($models) { return Html::tag('span', Module::$types[$model->type], ['class' => 'label label-' . ($model->type == Module::TYPE_CORE ? 'danger' : 'info')]); }], 'version', ['attribute' => 'author', 'format' => 'html', 'value' => function ($model) { $author = $model->author ?: '匿名'; return $model->site ? Html::a($author, $model->site) : Html::encode($author); }, 'options' => ['width' => 80]], 'ability', ['header' => '安装状态', 'format' => 'html', 'value' => function ($model) use($models) { $installed = $model->getIsInstalled(); return Html::tag('span', $installed ? '已安装' : '未安装', ['class' => 'label label-' . ($installed ? 'warning' : 'success')]); }], 'created_at:datetime', ['class' => 'yii\\grid\\ActionColumn', 'template' => '{install}', 'buttons' => ['install' => function ($url, $model, $key) use($models) { if ($model->getIsInstalled()) { return Html::a('卸载模块', ['uninstall', 'id' => $model->id], ['data-confirm' => '确定要卸载此模块?']); } else { return Html::a('安装模块', ['install', 'id' => $model->id]); }
<?php use yii\helpers\Html; use yii\grid\GridView; use callmez\wechat\models\Wechat; use callmez\wechat\widgets\PagePanel; $this->title = '公众号列表'; $this->params['breadcrumbs'][] = $this->title; PagePanel::begin(['options' => ['class' => 'wechat-index']]); ?> <p> <?php echo Html::a('添加公众号', ['create'], ['class' => 'btn btn-success']); ?> </p> <?php echo GridView::widget(['tableOptions' => ['class' => 'table table-hover'], 'dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [['attribute' => 'id', 'options' => ['width' => 75]], 'name', ['attribute' => 'type', 'format' => 'html', 'value' => function ($model) { return Html::tag('span', Wechat::$types[$model->type], ['class' => 'label label-info']); }, 'filter' => Wechat::$types], ['attribute' => 'status', 'format' => 'html', 'value' => function ($model) { return Html::tag('span', Wechat::$statuses[$model->status], ['class' => 'label label-' . ($model->status == Wechat::STATUS_ACTIVE ? 'success' : 'danger')]); }, 'filter' => Wechat::$statuses], 'created_at:datetime', 'updated_at:datetime', ['class' => 'callmez\\wechat\\widgets\\ActionColumn', 'template' => '{manage} {update} {delete}', 'buttons' => ['manage' => function ($url, $model) { return Html::a('管理此公众号', $url, ['class' => 'text-danger', 'data' => ['toggle' => 'tooltip', 'placement' => 'bottom'], 'title' => '管理此公众号']); }]]]]); PagePanel::end(); $this->registerJs(<<<EOF \$('[data-toggle="tooltip"]').tooltip(); EOF );
<?php use yii\helpers\Html; use callmez\wechat\widgets\PagePanel; $this->title = '修改回复规则: ' . $model->name; $this->params['breadcrumbs'][] = ['label' => '回复规则', 'url' => ['index', 'mid' => $model->mid]]; $this->params['breadcrumbs'][] = ['label' => $model->name, 'url' => ['view', 'id' => $model->id]]; $this->params['breadcrumbs'][] = 'Update'; PagePanel::begin(['options' => ['class' => 'reply-update']]); ?> <?php echo $this->render('_form', ['model' => $model, 'ruleKeyword' => $ruleKeyword, 'ruleKeywords' => $ruleKeywords]); ?> <?php PagePanel::end();
<?php use yii\helpers\Html; use callmez\wechat\widgets\GridView; use callmez\wechat\widgets\PagePanel; $this->title = '素材管理'; $this->params['breadcrumbs'][] = $this->title; PagePanel::begin(['options' => ['class' => 'media-index']]); ?> <p> <?php echo Html::a('添加素材', ['create'], ['class' => 'btn btn-success', 'data' => ['toggle' => 'modal', 'target' => '#mediaCreateModal']]); ?> </p> <?php echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [['class' => 'yii\\grid\\SerialColumn'], 'id', 'mediaId', 'post:ntext', 'result:ntext', 'type', 'material', 'created_at:datetime', 'updated_at:datetime', ['class' => 'yii\\grid\\ActionColumn']]]); ?> <?php PagePanel::end();
<?php use Yii; use yii\helpers\Html; use yii\grid\GridView; use callmez\wechat\models\ReplyRule; use callmez\wechat\widgets\PagePanel; $this->title = '回复规则'; $this->params['breadcrumbs'][] = $this->title; PagePanel::begin(['options' => ['class' => 'reply-index']]); ?> <?php // echo $this->render('_search', ['model' => $searchModel]); ?> <p> <?php echo Html::a('添加回复规则', ['create', 'mid' => $mid], ['class' => 'btn btn-success']); ?> </p> <?php echo GridView::widget(['tableOptions' => ['class' => 'table table-hover'], 'dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [['attribute' => 'id', 'options' => ['width' => 75]], 'name', ['attribute' => 'mid', 'value' => function ($model) { $module = Yii::$app->getModule('wechat'); return (($module = $module->getModule($model->mid)) ? $module->name : '') . '(' . $model->mid . ')'; }], ['attribute' => 'status', 'format' => 'html', 'value' => function ($model) { return Html::tag('span', ReplyRule::$statuses[$model->status], ['class' => 'label label-' . ($model->status == ReplyRule::STATUS_ACTIVE ? 'success' : 'info')]); }, 'filter' => ReplyRule::$statuses, 'options' => ['width' => 80]], ['attribute' => 'keywords', 'format' => 'html', 'value' => function ($model) { return implode(' ', array_map(function ($model) { return Html::tag('code', $model->keyword); }, $model->keywords));
<?php use yii\helpers\Html; use callmez\wechat\widgets\PagePanel; $this->title = '修改公账号: ' . ' ' . $model->name; $this->params['breadcrumbs'][] = ['label' => '公众号列表', 'url' => ['index']]; $this->params['breadcrumbs'][] = $this->title; PagePanel::begin(['options' => ['class' => 'wechat-update']]); ?> <?php echo $this->render('_form', ['model' => $model]); PagePanel::end();