gettemplatelist.html 5.58 KB
<include file="public/layout" />
<body style="background-color: rgb(255, 255, 255); overflow: auto; cursor: default; -moz-user-select: inherit;">
<div id="append_parent"></div>
<div id="ajaxwaitid"></div>
<div class="page" style="padding-top: 10px;">


	<div class="flexigrid">

		<div class="hDiv">
			<div class="hDivBox">
				<table cellspacing="0" cellpadding="0">
					<thead>
					<tr>

						<th align="left" abbr="ac_id" axis="col4" class="w90">
							<div style="text-align: left;" class="">版本号</div>
						</th>

						<th align="left" abbr="ac_id" axis="col4" class="w300">
							<div style="text-align: left;" class="">描述</div>
						</th>
						<th align="left" abbr="ac_id" axis="col4" class="w120">
							<div style="text-align: center;" class="">TemplateID</div>
						</th>
						<th align="center" abbr="article_time" axis="col4" class="w140">
							<div style="text-align: center;" class="">添加到模版库时间</div>
						</th>
						<th align="center" axis="col1" class="handle w150">
							<div style="text-align: center;">操作</div>
						</th>

					</tr>
					</thead>
				</table>
			</div>
		</div>

		<div class="bDiv" style="height: auto;">
			<div id="flexigrid" cellpadding="0" cellspacing="0" border="0">
				<table>
					<tbody>

					<foreach name="list" item="vo" key="k" >
						<tr>

							<td align="center" class="w90">
								<div style="text-align: left;">{$vo.user_version}</div>
							</td>


							<td align="center" class="user_desc" class="w300">
								<div style="text-align: left;width: 300px; ">{$vo.user_desc}</div>
							</td>
							<td align="center" class="w120">
								<div style="text-align: center; ">{$vo.template_id}</div>
							</td>


							<td align="center" class="w140">
								<div style="text-align: center;">{$vo.create_time|date="Y-m-d H:i:s",###}</div>
							</td>



							<td align="center" class="handle w150">
								<div style="text-align: center;">

									<a class="btn red"  href="javascript:void(0)" data-url="{:U('Weapp/sumbitcode')}" data-id="{$stoid}" data-user_version="{$vo.user_version}" data-user_desc="{$vo.user_desc}" data-template_id="{$vo.template_id}" onClick="sumbitcode(this)"><i class="fa fa-th-list">选择提交</i></a>

									<a class="btn red"  href="javascript:void(0)" data-url="{:U('Weapp/deletetemplate')}" data-id="{$stoid}" data-template_id="{$vo.template_id}" onClick="deletetemplate(this)"><i class="fa fa-del">删除</i></a>

								</div>
							</td>

						</tr>
					</foreach>
					</tbody>
				</table>
			</div>
			<div class="iDiv" style="display: none;"></div>
		</div>
	 </div>
</div>
</div>
<script>
	$(document).ready(function(){
		// 表格行点击选中切换
		$('#flexigrid > table>tbody >tr').click(function(){
			$(this).toggleClass('trSelected');
		});
		// 点击刷新数据
		$('.fa-refresh').click(function(){
			location.href = location.href;
		});

	});


    // 提交
	function sumbitcode(obj) {




		layer.confirm('确认提交至体验版?', {
			btn: ['营销版', '取消'] //按钮
		}, function () {
//			$.ajax({
//				type: 'post',
//				url: $(obj).attr('data-url'),
//				data : {stoid:$(obj).attr('data-id'),user_version:$(obj).attr('data-user_version'),user_desc:$(obj).attr('data-user_desc'),template_id:$(obj).attr('data-template_id')},
//				dataType: 'json',
//				success: function (data) {
//
//					if (data.errcode == 0) {
//                        layer.alert('提交成功', {icon: 1});
//
//                    } else {
//                        layer.alert('提交失败'+data.errmsg, {icon: 2});
//                    }
//				}
//			})
            var ii=layer.msg('处理中...', {icon: 16, shade: [0.5, '#f5f5f5'], scrollbar: false, offset: '200px', time: 100000});
			var getbatchtype="{$batchtype}";
			var sumbiturl=$(obj).attr('data-url');
			if (getbatchtype==1)
			{
                sumbiturl="/index.php/manager/Weapp/batchsubmit_audit.html";
			}

            $.ajax({
                type: 'post',
                url: sumbiturl,
                data : {stoid:$(obj).attr('data-id'),user_version:$(obj).attr('data-user_version'),user_desc:$(obj).attr('data-user_desc'),template_id:$(obj).attr('data-template_id'),type:2,batchtype:getbatchtype},
                dataType: 'json',
                success: function (data) {
                    layer.close(ii);
                    if (data.errcode == 0) {
                        layer.alert('提交成功', {icon: 1});

                    } else {
                        layer.alert('提交失败'+data.errmsg, {icon: 2});
                    }
                },
				error:function () {
                    layer.close(ii);
                }

            })
		}, function () {

		}, function () {
        });
	}
    // 删除指定小程序代码模版
    function deletetemplate(obj) {

        layer.confirm('确认删除该模版?', {
            btn: ['确定', '取消'] //按钮
        }, function () {
            $.ajax({
                type: 'post',
                url: $(obj).attr('data-url'),
                data : {stoid:$(obj).attr('data-id'),template_id:$(obj).attr('data-template_id')},
                dataType: 'json',
                success: function (data) {
                    if (data.errcode == 0) {
                        layer.alert('删除成功', {icon: 1});
                        setTimeout(function () {
							location.href=location.href;
                        },1000)
                    } else {
                        layer.alert('删除失败'+data.errmsg, {icon: 2});
                    }
                }
            })
        }, function () {
        });
    }



</script>
</body>
</html>