index.html 19.2 KB
Newer Older
D
v1.2.0  
devil_gong 已提交
1 2 3 4 5 6
{{include file="public/header" /}}

<!-- right content start  -->
<div class="content-right">
	<div class="content">
		<!-- form start -->
G
gongfuxiang 已提交
7 8 9 10 11 12 13 14 15 16
		<form class="am-form form-validation form-search" method="post" action="{{:MyUrl('admin/answer/index')}}" request-type="form">
			<div class="thin">
                <div class="am-input-group am-input-group-sm am-fl so">
                    <input type="text" autocomplete="off" name="keywords" class="am-radius" placeholder="联系人/内容" value="{{if !empty($params.keywords)}}{{$params.keywords}}{{/if}}" />
                    <span class="am-input-group-btn">
                        <button class="am-btn am-btn-default am-radius" type="submit" data-am-loading="{spinner:'circle-o-notch', loadingText:'搜索中...'}">搜索</button>
                    </span>
                </div>
                <label class="am-fl thin_sub more-submit">
                    更多筛选条件
D
devil_gong 已提交
17 18 19 20 21 22 23
                    {{if isset($params['is_more']) and $params['is_more'] eq 1}}
                        <input type="checkbox" name="is_more" value="1" id="is_more" checked />
                        <i class="am-icon-angle-up"></i>
                    {{else /}}
                        <input type="checkbox" name="is_more" value="1" id="is_more" />
                        <i class="am-icon-angle-down"></i>
                    {{/if}}
G
gongfuxiang 已提交
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67
                </label>
            </div>
            <table class="so-list more-where {{if !isset($params['is_more'])}}none{{/if}}">
                <tbody>
                	<tr>
                		<td>
                			<span>显隐:</span>
							<select name="is_show" class="chosen-select" data-placeholder="是否显示...">
								<option value="-1">是否显示...</option>
								{{foreach $common_is_show_list as $v}}
									<option value="{{$v.id}}" {{if isset($params['is_show']) and $params['is_show'] eq $v['id']}}selected{{/if}}>{{$v.name}}</option>
								{{/foreach}}
							</select>
                		</td>
                		<td>
                			<span>回复:</span>
							<select name="is_reply" class="chosen-select" data-placeholder="是否回复...">
		                        <option value="-1">是否回复...</option>
		                        {{if !empty($common_is_text_list)}}
		                            {{foreach $common_is_text_list as $v}}
		                                <option value="{{$v.id}}" {{if isset($params['is_reply']) and $params['is_reply'] eq $v['id']}}selected{{/if}}>{{$v.name}}</option>
		                            {{/foreach}}
		                        {{/if}}
		                    </select>
                		</td>
                	</tr>
                    <tr>
                        <td class="time">
							<span>时间:</span>
                            <span>
                                <input type="text" autocomplete="off" name="time_start" class="am-form-field am-input-sm am-radius Wdate" placeholder="起始时间" value="{{if !empty($params.time_start)}}{{$params.time_start}}{{/if}}" data-validation-message="日期格式有误" onclick="WdatePicker({firstDayOfWeek:1,dateFmt:'yyyy-MM-dd'})" autocomplete="off" /><i class="am-icon-calendar"></i>
                            </span>
                            <em class="text-grey">~</em>
                            <span>
                                <input type="text" autocomplete="off" name="time_end" class="am-form-field am-input-sm am-radius Wdate" placeholder="结束时间" value="{{if !empty($params.time_end)}}{{$params.time_end}}{{/if}}" pattern="^[0-9]{4}-[0-9]{2}-[0-9]{2}$" data-validation-message="日期格式有误" onclick="WdatePicker({firstDayOfWeek:1,dateFmt:'yyyy-MM-dd'})" autocomplete="off" /><i class="am-icon-calendar"></i>
                            </span>
                        </td>
                        <td>
                            <button type="submit" class="am-btn am-btn-primary am-radius am-btn-xs btn-loading-example" data-am-loading="{spinner:'circle-o-notch', loadingText:'搜索中...'}">搜索</button>
                            <a href="{{:MyUrl('admin/answer/index')}}" class="am-btn am-btn-warning am-radius am-btn-sm reset-submit">清除条件</a>
                        </td>
                    </tr>
                </tbody>
			</table>
D
v1.2.0  
devil_gong 已提交
68 69 70
        </form>
        <!-- form end -->

D
devil 已提交
71
        <!-- top operation start -->
D
devil_gong 已提交
72
        <div class="am-g am-margin-top-sm">
G
gongfuxiang 已提交
73
            <a href="{{:MyUrl('admin/answer/saveinfo')}}" class="am-btn am-btn-secondary am-radius am-btn-xs am-icon-plus"> 新增</a>
D
devil 已提交
74 75 76 77

            <!-- 顶部操作钩子 -->
            {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}}
                <div class="plugins-tag">
78
                    <span>plugins_view_admin_answer_top_operate</span>
D
devil 已提交
79 80 81
                </div>
            {{/if}}
            {{php}}
82
                $hook_name = 'plugins_view_admin_answer_top_operate';
D
devil 已提交
83 84 85 86 87 88 89 90 91 92 93 94
                $hook_data = Hook::listen($hook_name, ['hook_name'=>$hook_name, 'is_backend'=>true]);
                if(!empty($hook_data) && is_array($hook_data))
                {
                    foreach($hook_data as $hook)
                    {
                        if(is_string($hook) || is_int($hook))
                        {
                            echo htmlspecialchars_decode($hook);
                        }
                    }
                }
            {{/php}}
G
gongfuxiang 已提交
95
        </div>
D
devil 已提交
96
        <!-- top operation end -->
G
gongfuxiang 已提交
97

D
v1.2.0  
devil_gong 已提交
98
		<!-- list start -->
99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194
		<div class="am-scrollable-horizontal am-table-scrollable-horizontal am-margin-top-sm">
            <table class="am-table am-table-striped am-table-hover am-table-bordered am-text-nowrap am-table-td-fixed-last">
    			<thead>
    				<tr>
    					<th class="am-grid-sm">用户信息</th>
    					<th class="am-grid-sm">联系信息</th>
    					<th class="am-grid-sm">标题</th>
    					<th class="am-grid-lg">内容</th>
    					<th class="am-grid-lg">回复内容</th>
    					<th>访问次数</th>
    					<th>回复时间</th>
    					<th>创建时间</th>
    					<th class="am-text-center">是否显示</th>
    					<th class="am-text-center">更多</th>
                        <th class="am-text-center">操作</th>
    				</tr>
    			</thead>
    			<tbody>
    				{{if !empty($data_list)}}
    					{{foreach $data_list as $v}}
    						<tr id="data-list-{{$v.id}}" {{if $v['is_show'] eq 0}}class="am-active"{{/if}}>
    							<td class="am-text-middle user-info">
                                    {{if !empty($v['user'])}}
                                        <img src="{{$v.user.avatar}}" alt="{{$v.user.user_name_view}}" class="am-img-thumbnail am-radius am-align-left" />
                                        <ul class="user-base">
                                            <li>名称:{{if empty($v['user']['username'])}}<span class="cr-ccc">未填写</span>{{else /}}{{$v.user.username}}{{/if}}</li>
                                            <li>昵称:{{if empty($v['user']['nickname'])}}<span class="cr-ccc">未填写</span>{{else /}}{{$v.user.nickname}}{{/if}}</li>
                                            <li>手机:{{if empty($v['user']['mobile'])}}<span class="cr-ccc">未填写</span>{{else /}}{{$v.user.mobile}}{{/if}}</li>
                                            <li>邮箱:{{if empty($v['user']['email'])}}<span class="cr-ccc">未填写</span>{{else /}}{{$v.user.email}}{{/if}}</li>
                                        </ul>
                                    {{else /}}
                                        用户信息异常
                                    {{/if}}
                                </td>
    							<td class="am-text-middle">
    								{{if !empty($v['name']) and !empty($v['tel'])}}
    									{{$v.name}}
    									<br />
    									{{$v.tel}}
    								{{elseif !empty($v['name']) }}
    									{{$v.name}}
    								{{elseif !empty($v['tel']) /}}
    									{{$v.tel}}
    								{{else /}}
    									<span class="cr-ddd">未填写</span>
    								{{/if}}
    							</td>
    							<td class="am-text-middle am-nowrap-initial">{{$v.title}}</td>
    							<td class="content-info">
    								<div class="am-scrollable-vertical am-nowrap-initial reply-content">
    									{{$v.content|raw}}
    								</div>
    							</td>
    							<td class="am-text-middle">
    								{{if !empty($v['reply'])}}
    									<div class="am-scrollable-vertical am-nowrap-initial reply-content">
    	                                    {{$v.reply|raw}}
    	                                </div>
                                    {{else /}}
                                        <span class="cr-ddd">未回复</span>
                                    {{/if}}
    							</td>
    							<td class="am-text-middle">{{$v.access_count}}</td>
    							<td class="am-text-middle">{{$v.reply_time}}</td>
    							<td class="am-text-middle">{{$v.add_time}}</td>
    							<td class="am-text-middle am-text-center">
    								<a href="javascript:;" class="am-icon-btn am-icon-check submit-state {{if $v['is_show'] eq 1}}am-success{{else /}}am-default{{/if}}" data-url="{{:MyUrl('admin/answer/statusupdate')}}" data-id="{{$v.id}}" data-state="{{$v['is_show']}}" data-is-update-status="1"></a>
    							</td>
    							<td class="am-text-middle">
    								<p class="am-text-center xo-cursor-pr">
                                        <i class="am-icon-caret-down"></i>
                                        <span data-am-modal="{target: '#my-popup{{$v.id}}'}"> 查看更多</span>
                                    </p>
    								<div class="am-popup am-radius" id="my-popup{{$v.id}}">
    									<div class="am-popup-inner">
    										<div class="am-popup-hd">
    											<h4 class="am-popup-title">详情内容</h4>
    											<span data-am-modal-close
    											class="am-close">&times;</span>
    										</div>
    										<div class="am-popup-bd">
    											<dl class="dl-content">
    												<dt>用户信息</dt>
    												<dd class="user-info">
    													{{if !empty($v['user'])}}
                                                            <img src="{{$v.user.avatar}}" alt="{{$v.user.user_name_view}}" class="am-img-thumbnail am-radius am-align-left" />
                                                            <ul class="user-base">
                                                                <li>名称:{{if empty($v['user']['username'])}}<span class="cr-ccc">未填写</span>{{else /}}{{$v.user.username}}{{/if}}</li>
                                                                <li>昵称:{{if empty($v['user']['nickname'])}}<span class="cr-ccc">未填写</span>{{else /}}{{$v.user.nickname}}{{/if}}</li>
                                                                <li>手机:{{if empty($v['user']['mobile'])}}<span class="cr-ccc">未填写</span>{{else /}}{{$v.user.mobile}}{{/if}}</li>
                                                                <li>邮箱:{{if empty($v['user']['email'])}}<span class="cr-ccc">未填写</span>{{else /}}{{$v.user.email}}{{/if}}</li>
                                                            </ul>
                                                        {{else /}}
                                                            用户信息异常
                                                        {{/if}}
    												</dd>
D
v1.2.0  
devil_gong 已提交
195

196 197 198 199 200 201 202 203 204 205 206 207 208 209
    												<dt>联系人</dt>
    												<dd>
    													{{if !empty($v['name']) and !empty($v['tel'])}}
    														{{$v.name}}
    														<br />
    														{{$v.tel}}
    													{{elseif !empty($v['name']) }}
    														{{$v.name}}
    													{{elseif !empty($v['tel']) /}}
    														{{$v.tel}}
    													{{else /}}
    														<span class="cr-ddd">未填写</span>
    													{{/if}}
    												</dd>
D
v1.2.0  
devil_gong 已提交
210

211 212
    												<dt>标题</dt>
    												<dd class="am-nowrap-initial">{{if empty($v['title'])}}<span class="cr-ddd">未填写</span>{{else /}}{{$v.title}}{{/if}}</dd>
D
devil_gong 已提交
213

214 215 216 217
    												<dt>内容</dt>
    												<dd>
                                                        <div class="am-scrollable-vertical am-nowrap-initial">{{$v.content|raw}}</div>
                                                    </dd>
D
v1.2.0  
devil_gong 已提交
218

219 220
    												<dt>是否显示</dt>
    												<dd>{{if empty($v['is_show_text'])}}<span class="cr-ddd">未填写</span>{{else /}}{{$v.is_show_text}}{{/if}}</dd>
D
v1.2.0  
devil_gong 已提交
221

222 223 224 225 226 227 228 229
    												<dt>回复内容</dt>
    												<dd>
    													{{if !empty($v['reply'])}}
                                                            <div class="am-scrollable-vertical am-nowrap-initial">{{$v.reply|raw}}</div>
    			                                        {{else /}}
    			                                            <span class="cr-ddd">未回复</span>
    			                                        {{/if}}
    			                                    </dd>
D
devil_gong 已提交
230

231 232
    												<dt>回复时间</dt>
    												<dd>{{$v.reply_time}}</dd>
D
v1.2.0  
devil_gong 已提交
233

234 235
    												<dt>创建时间</dt>
    												<dd>{{$v.add_time}}</dd>
D
v1.2.0  
devil_gong 已提交
236

237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259
    												<dt>更新时间</dt>
    												<dd>{{$v.upd_time}}</dd>
    											</dl>
    										</div>
    									</div>
    								</div>
    							</td>
    							<td class="am-operate-grid">
                                    <div class="am-scrollable-vertical">
        								<a href="{{:MyUrl('admin/answer/saveinfo', array_merge($params, ['id'=>$v['id']]))}}" class="am-btn am-btn-secondary am-btn-xs am-radius am-btn-block">
                                            <i class="am-icon-edit"></i>
                                            <span>编辑</span>
                                        </a>
        								{{if $v['is_reply'] eq 0}}
        									<button class="am-btn am-btn-success am-btn-xs am-radius am-btn-block submit-reply" data-am-modal="{target: '#my-popup-reply'}" data-json='{{:str_replace("'", '', json_encode($v))}}'>
                                                <i class="am-icon-gavel"></i>
                                                <span>回复</span>
                                            </button>
        								{{/if}}
        								<button class="am-btn am-btn-danger am-btn-xs am-radius am-btn-block submit-delete" data-url="{{:MyUrl('admin/answer/delete')}}" data-id="{{$v.id}}">
                                            <i class="am-icon-trash-o"></i>
                                            <span>删除</span>
                                        </button>
D
devil_gong 已提交
260

261 262 263 264 265 266 267 268 269 270
                                        <!-- 问答列表操作钩子 -->
                                        {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}}
                                            <div class="plugins-tag">
                                                <span>plugins_view_admin_answer_list_operate</span>
                                            </div>
                                        {{/if}}
                                        {{php}}
                                            $hook_name = 'plugins_view_admin_answer_list_operate';
                                            $hook_data = Hook::listen($hook_name, ['hook_name'=>$hook_name, 'is_backend'=>true, 'id'=>$v['id'], 'data'=>$v]);
                                            if(!empty($hook_data) && is_array($hook_data))
D
devil_gong 已提交
271
                                            {
272 273 274 275 276 277 278
                                                foreach($hook_data as $hook)
                                                {
                                                    if(is_string($hook) || is_int($hook))
                                                    {
                                                        echo htmlspecialchars_decode($hook);
                                                    }
                                                }
D
devil_gong 已提交
279
                                            }
280 281 282 283 284 285 286 287
                                        {{/php}}
                                    </div>
    							</td>
    						</tr>
    					{{/foreach}}
    				{{/if}}
    			</tbody>
    		</table>
D
devil 已提交
288 289 290
            {{if empty($data_list)}}
                <div class="table-no"><i class="am-icon-warning"></i> 没有相关数据</div>
            {{/if}}
291
        </div>
D
v1.2.0  
devil_gong 已提交
292 293
		<!-- list end -->

D
devil 已提交
294 295 296 297 298
        <!-- bottom operation start -->
        <div class="am-g am-margin-top-sm">
            <!-- 底部操作钩子 -->
            {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}}
                <div class="plugins-tag">
299
                    <span>plugins_view_admin_answer_bottom_operate</span>
D
devil 已提交
300 301 302
                </div>
            {{/if}}
            {{php}}
303
                $hook_name = 'plugins_view_admin_answer_bottom_operate';
D
devil 已提交
304 305 306 307 308 309 310 311 312 313 314 315 316 317 318
                $hook_data = Hook::listen($hook_name, ['hook_name'=>$hook_name, 'is_backend'=>true]);
                if(!empty($hook_data) && is_array($hook_data))
                {
                    foreach($hook_data as $hook)
                    {
                        if(is_string($hook) || is_int($hook))
                        {
                            echo htmlspecialchars_decode($hook);
                        }
                    }
                }
            {{/php}}
        </div>
        <!-- bottom operation end -->

D
v1.2.0  
devil_gong 已提交
319 320 321 322 323 324 325 326 327
		<!-- 处理窗口 -->
		<div class="am-popup am-radius" id="my-popup-reply">
			<div class="am-popup-inner">
				<div class="am-popup-hd">
					<h4 class="am-popup-title">回复</h4>
					<span data-am-modal-close class="am-close">&times;</span>
				</div>
				<div class="am-popup-bd">
					<dl class="dl-content">
D
devil_gong 已提交
328 329 330 331 332 333 334 335 336 337
						<dt>用户信息</dt>
						<dd class="user-info">
                            <img src="{{$attachment_host}}/static/common/images/user-img-sm.gif" class="am-img-thumbnail am-radius am-align-left" />
                            <ul class="user-base">
                                <li class="username">名称:<span>...</span></li>
                                <li class="nickname">昵称:<span>...</span></li>
                                <li class="mobile">手机:<span>...</span></li>
                                <li class="email">邮箱:<span>...</span></li>
                            </ul>
                        </dd>
D
v1.2.0  
devil_gong 已提交
338 339
					</dl>

D
devil_gong 已提交
340
					<form class="am-form form-validation-reply" action="{{:MyUrl('admin/answer/reply')}}" method="POST" request-type="ajax-reload" enctype="multipart/form-data">
D
v1.2.0  
devil_gong 已提交
341 342
						<div class="am-form-group">
							<label>回复内容</label>
D
devil_gong 已提交
343
							<textarea name="reply" rows="5" class="am-radius" placeholder="回复内容格式 2~230 个字符" data-validation-message="回复内容格式 2~230 个字符" minlength="2" maxlength="230" required></textarea>
D
v1.2.0  
devil_gong 已提交
344 345
						</div>

G
gongfuxiang 已提交
346
						<div class="am-form-group reply-submit am-form-group-refreshing t-c">
347
							<input type="hidden" name="id" value=" />
D
devil_gong 已提交
348
							<button type="submit" class="am-btn am-btn-success am-radius am-btn-sm" data-am-loading="{loadingText:'处理中...'}">回复</button>
D
v1.2.0  
devil_gong 已提交
349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366
						</div>
					</form>
				</div>
			</div>
		</div>

		<!-- page start -->
		{{if !empty($data_list)}}
			{{$page_html|raw}}
		{{/if}}
		<!-- page end -->
	</div>
</div>
<!-- right content end  -->
		
<!-- footer start -->
{{include file="public/footer" /}}
<!-- footer end -->