Browse Source

红头文件

tiaosheng-ms
xuesinan 4 years ago
parent
commit
a9bb2c2e36
  1. 86
      index.html

86
index.html

@ -105,12 +105,6 @@
</div> --> </div> -->
<div class="formulate-plan"> <div class="formulate-plan">
<!-- <div class="flex justify-between">
<div class="text-sm">生成红头文件</div>
<button class="train-plan-btn px-2.5 h-6 bg-blue-500 text-sm rounded text-white" onclick="p1449927427387301888.submit()">提交</button>
<div class="train-plan-status text-sm" style="display: none;">待审核</div>
</div> -->
<div class="mt-2.5 p-2 border border-gray-200 rounded-sm text-sm"> <div class="mt-2.5 p-2 border border-gray-200 rounded-sm text-sm">
<div class="temp flex justify-between items-center w-full"> <div class="temp flex justify-between items-center w-full">
<p class="w-20 flex-shrink-0 text-gray-400">选择模板</p> <p class="w-20 flex-shrink-0 text-gray-400">选择模板</p>
@ -121,7 +115,15 @@
</div> </div>
<div class="mt-2 temp-list flex items-center"> <div class="mt-2 temp-list flex items-center">
<div class="temp-item border border-blue-400 flex justify-center items-center" style="width: 30%; height: 100px; margin-right: 5%;" onclick="p1449927427387301888.selTemp(1)">
<img style="max-width: 100%; max-height: 100%;" src="http://test.tall.wiki/staticrec/plan.png" />
</div>
<div class="temp-item border border-gray-200 flex justify-center items-center" style="width: 30%; height: 100px; margin-right: 5%;" onclick="p1449927427387301888.selTemp(2)">
<img style="max-width: 100%; max-height: 100%;" src="http://test.tall.wiki/staticrec/plan.png" />
</div>
<div class="temp-item border border-gray-200 flex justify-center items-center" style="width: 30%; height: 100px;" onclick="p1449927427387301888.selTemp(3)">
<img style="max-width: 100%; max-height: 100%;" src="http://test.tall.wiki/staticrec/plan.png" />
</div>
</div> </div>
</div> </div>
@ -314,46 +316,46 @@
*/ */
getAllTemp() { getAllTemp() {
var that = this; var that = this;
fetch(`https://test.tall.wiki/gateway/sports/training/template`, { // fetch(`https://test.tall.wiki/gateway/sports/training/template`, {
headers: new Headers({ // headers: new Headers({
'Authorization': 'Bearer ' + that.token, // 'Authorization': 'Bearer ' + that.token,
'Content-Type': 'application/json; charset=utf-8' // 'Content-Type': 'application/json; charset=utf-8'
}), // }),
method: 'POST', // method: 'POST',
body: JSON.stringify({ // body: JSON.stringify({
param: {projectId: that.projectId} // param: {projectId: that.projectId}
}) // })
}) // })
.then(function(response) { // .then(function(response) {
return response.json(); // return response.json();
}) // })
.then(function(res) { // .then(function(res) {
const { success, code, data, msg } = res; // const { success, code, data, msg } = res;
if (success && code === 200) { // if (success && code === 200) {
for (let i = 0; i < data.length; i++) { // for (let i = 0; i < data.length; i++) {
if (data[i].type === 0) { // if (data[i].type === 0) {
that.tempList = data[i].templateList; // that.tempList = data[i].templateList;
} // }
} // }
let html = ''; // let html = '';
for (let j = 0; j < that.tempList.length; j++) { // for (let j = 0; j < that.tempList.length; j++) {
html += `<div class="temp-item border border-blue-400 flex justify-center items-center" style="width: 30%; height: 100px; ${j % 3 == 2 ? '' : 'margin-right: 5%;'}" onclick="p1449927427387301888.selTemp(${j}, ${that.tempList[j]}}})"> // html += `<div class="temp-item border border-blue-400 flex justify-center items-center" style="width: 30%; height: 100px; ${j % 3 == 2 ? '' : 'margin-right: 5%;'}" onclick="p1449927427387301888.selTemp(${j}, ${that.tempList[j]}}})">
<img style="max-width: 100%; max-height: 100%;" src="${that.tempList[j].path}" /> // <img style="max-width: 100%; max-height: 100%;" src="${that.tempList[j].path}" />
</div>`; // </div>`;
} // }
that.dom.querySelector('.temp-list').html = html; // that.dom.querySelector('.temp-list').html = html;
html += `<div class="temp-item border border-blue-400 flex justify-center items-center" style="width: 30%; height: 100px;" onclick="p1449927427387301888.selTemp(1)"> // html += `<div class="temp-item border border-blue-400 flex justify-center items-center" style="width: 30%; height: 100px;" onclick="p1449927427387301888.selTemp(1)">
<img style="max-width: 100%; max-height: 100%;" src="http://test.tall.wiki/staticrec/plan.png" /> // <img style="max-width: 100%; max-height: 100%;" src="http://test.tall.wiki/staticrec/plan.png" />
</div>`; // </div>`;
} else { // } else {
console.log('msg: ', msg); // console.log('msg: ', msg);
} // }
}); // });
}, },
/** /**

Loading…
Cancel
Save