| xqd
@@ -58,27 +58,22 @@
|
|
|
</div>
|
|
|
<table class="layui-table">
|
|
|
<tr>
|
|
|
- <td>课程ID</td>
|
|
|
+ <td align="center">课程ID</td>
|
|
|
<td>图片</td>
|
|
|
<td>名称</td>
|
|
|
<td>类型</td>
|
|
|
- <td>单价</td>
|
|
|
- <td>操作</td>
|
|
|
+ <td align="center">单价</td>
|
|
|
+ <td align="center">操作</td>
|
|
|
</tr>
|
|
|
<tr v-for="(item, index) in courselist" :key="index">
|
|
|
- <td>{{item.id}}</td>
|
|
|
- <td>{{item.id}}</td>
|
|
|
- <td>{{item.id}}</td>
|
|
|
- <td>{{item.id}}</td>
|
|
|
- <td>{{item.money}}</td>
|
|
|
- <td>{{item.id}}</td>
|
|
|
+ <td align="center">{{item.id}}</td>
|
|
|
+ <td><img :src="item.image" height="50" /></td>
|
|
|
+ <td>{{item.title}}</td>
|
|
|
+ <td>课程</td>
|
|
|
+ <td align="center">¥{{item.money}}</td>
|
|
|
+ <td align="center"><a @click="delitem(item.id)" href="javascript:void(0);" style="color:red;"><i class="iconfont icon-shanchu"></i>删除</a></td>
|
|
|
</tr>
|
|
|
</table>
|
|
|
- <script type="text/html" id="act">
|
|
|
- <a href="javascript:void(0)" @click="delitem(this)">
|
|
|
- <i class="iconfont icon-shanchu"></i> 删除
|
|
|
- </a>
|
|
|
- </ul>
|
|
|
</script>
|
|
|
<div class="layui-form-item submit">
|
|
|
<div class="layui-input-block">
|
| xqd
@@ -144,8 +139,8 @@
|
|
|
that.courselist.push(coursechecked[i]);
|
|
|
that.formData.courseids.push(i);
|
|
|
}
|
|
|
- console.log(that.formData.courseids);
|
|
|
- return false;
|
|
|
+ //console.log(that.courselist);
|
|
|
+ //return false;
|
|
|
},
|
|
|
btn2: function (index, layero) {
|
|
|
coursechecked = {};
|
| xqd
@@ -170,8 +165,15 @@
|
|
|
// );
|
|
|
|
|
|
},
|
|
|
- delitem:function (data){
|
|
|
- alert('ok');
|
|
|
+ delitem:function (id){
|
|
|
+ that = this
|
|
|
+ that.formData.courseids = []
|
|
|
+ that.courselist = []
|
|
|
+ delete coursechecked[id];
|
|
|
+ for(i in coursechecked){
|
|
|
+ that.courselist.push(coursechecked[i]);
|
|
|
+ that.formData.courseids.push(i);
|
|
|
+ }
|
|
|
},
|
|
|
clone_form: function () {
|
|
|
var that = this;
|