|
@@ -0,0 +1,223 @@
|
|
|
+<!DOCTYPE html>
|
|
|
+<html lang="en">
|
|
|
+<head>
|
|
|
+ <meta charset="UTF-8">
|
|
|
+ <meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
|
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
|
+ <title></title>
|
|
|
+ <!-- 引入样式 -->
|
|
|
+ <link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
|
|
|
+ <!-- 引入组件库 -->
|
|
|
+ <script src="https://code.jquery.com/jquery-3.6.0.js" integrity="sha256-H+K7U5CnXl1h5ywQfKtSj8PCmoN9aaq30gDh27Xc0jk=" crossorigin="anonymous"></script>
|
|
|
+</head>
|
|
|
+<style>
|
|
|
+ *{
|
|
|
+ padding: 0;
|
|
|
+ margin: 0;
|
|
|
+ box-sizing: border-box;
|
|
|
+ }
|
|
|
+
|
|
|
+ #upload{
|
|
|
+ width: 500px;
|
|
|
+ max-width: 100%;
|
|
|
+ min-height: 100vh;
|
|
|
+ margin: auto;
|
|
|
+
|
|
|
+ background: url(bg.png) no-repeat;
|
|
|
+ background-size: 100%;
|
|
|
+ background-color: #FF7716;
|
|
|
+ padding: 10px;
|
|
|
+ }
|
|
|
+ .form{
|
|
|
+ width: 100%;
|
|
|
+ margin-top: 34vh;
|
|
|
+ background: #fff;
|
|
|
+ border-radius: 8px;
|
|
|
+ padding: 20px 10px;
|
|
|
+ }
|
|
|
+ .del{
|
|
|
+ font-size: 20px;
|
|
|
+ }
|
|
|
+ input{
|
|
|
+ padding: 0 10px !important;
|
|
|
+ }
|
|
|
+ .el-input-group__append{
|
|
|
+ padding: 0 5px;
|
|
|
+ }
|
|
|
+ .el-form-item__label{
|
|
|
+ color: #333;
|
|
|
+ font-size: 14px;
|
|
|
+ font-weight: 500;
|
|
|
+ padding: 0 !important;
|
|
|
+ }
|
|
|
+ .el-button--danger{
|
|
|
+ background-color: #FF5151;
|
|
|
+ border-top: #FF5151;
|
|
|
+ height: 44px;
|
|
|
+ border-radius: 8px;
|
|
|
+ }
|
|
|
+ .tips{
|
|
|
+ font-size: 12px;
|
|
|
+ color: #666;
|
|
|
+ line-height: 24px;
|
|
|
+ }
|
|
|
+</style>
|
|
|
+<body>
|
|
|
+ <div id="upload">
|
|
|
+ <!-- <h1>数据上传</h1> -->
|
|
|
+ <el-form class="form" ref="form" label-position='top' :model="form" :rules="rules">
|
|
|
+ <el-form-item label="" style="margin-bottom: 0;">
|
|
|
+ <span style="font-weight: 500;">赛事名称 {{form.name}}</span>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="" prop="stock_date" style="margin-bottom: 10px;">
|
|
|
+ <span style="font-weight: 500;">持仓日期 {{form.stock_date}}</span>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="用户代码" prop="usercode">
|
|
|
+ <el-input v-model="form.usercode"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="今日资产" prop="today_fund">
|
|
|
+ <el-input clearable v-model="form.today_fund" placeholder="请输入今日资产">
|
|
|
+ <template slot="append">万元</template>
|
|
|
+ </el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="股票名称" prop="today_stock">
|
|
|
+ <div v-for="(item,index) in form.today_stock" :key='index' style="margin-bottom:5px;width:100%;">
|
|
|
+ <el-input style="width:45%;display:inline-block" v-model="item.name" placeholder="名称/代码" :disabled="form.is_markt==true"></el-input>
|
|
|
+ <el-input style="width:40%" clearable v-model="item.fund" placeholder="资金" :disabled="form.is_markt==true">
|
|
|
+ <template slot="append">万元</template>
|
|
|
+ </el-input>
|
|
|
+ <i @click="form.today_stock.splice(index,1)" style="margin-top:5px;" class="el-icon-circle-close del"></i>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item>
|
|
|
+ <el-button @click="addCode" type="danger" size="small">新增代码</el-button><br>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item>
|
|
|
+ 开超市 <el-switch active-color="#13ce66" v-model="form.is_markt"> </el-switch>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="股票截图" prop="today_stock_img">
|
|
|
+ <div class="imgs" v-for="(item,index) in form.today_stock_img" :key='index'>
|
|
|
+ <img width="150" :src="item" alt="">
|
|
|
+ <i @click="form.today_stock_img.splice(index,1)" class="el-icon-circle-close del"></i>
|
|
|
+ </div>
|
|
|
+ <img v-if='form.today_stock_img.length == 0' width="110" src="upload.png" alt="">
|
|
|
+ <el-upload
|
|
|
+ class="upload-demo"
|
|
|
+ :show-file-list ='false'
|
|
|
+ :on-success="handleSuccess"
|
|
|
+ action="https://test.scxjc.club/api/wx/player/record/topic/uploadfile">
|
|
|
+ <el-button size="small" type="danger">上传图片</el-button>
|
|
|
+ </el-upload>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item>
|
|
|
+ <div class="tips">
|
|
|
+ 交作业须知:<br>
|
|
|
+ 1、当天下午收盘后30分钟内交作业,逾期不候,如空仓无操作可提前交。 <br>
|
|
|
+ 2、当天有资金进出和其它特殊情况,请联系副主编QQ修改调整。 <br>
|
|
|
+ 3、当天持股太多,超过六支以上,可以选择开超市。 <br>
|
|
|
+ 4、帐户截图需包括:净资产-持股名称-持股金额,可多张图片,以备查验核对。 <br>
|
|
|
+ 5、帐户截图请屏蔽:股东帐户-开户名-股东代码等个人信息。 <br>
|
|
|
+ 6、比赛每日仅公布前三选手交割单,其余不公开,请放心提交。
|
|
|
+ </div>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item style="text-align:center;">
|
|
|
+ <el-button style="width: 80%;" type="danger" @click="submitForm">确 定</el-button>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ </div>
|
|
|
+ <script src="https://unpkg.com/vue/dist/vue.js"></script>
|
|
|
+ <script src="https://unpkg.com/element-ui/lib/index.js"></script>
|
|
|
+ <script>
|
|
|
+ var app = new Vue({
|
|
|
+ el: '#upload',
|
|
|
+ data: {
|
|
|
+ form:{
|
|
|
+ today_stock_img:[],
|
|
|
+ today_stock:[{code: "", name:"",fund:''}],
|
|
|
+ stock_date:'',
|
|
|
+ name:'',
|
|
|
+ is_markt:0
|
|
|
+ },
|
|
|
+ rules:{
|
|
|
+ usercode: [
|
|
|
+ { required: true, message: '请输入用户代码', trigger: 'blur' }
|
|
|
+ ],
|
|
|
+ today_fund: [
|
|
|
+ { required: true, message: '请输入今日资产', trigger: 'blur' }
|
|
|
+ ],
|
|
|
+ today_stock_img: [
|
|
|
+ { required: true, message: '请输入股票截图', trigger: 'blur' }
|
|
|
+ ],
|
|
|
+
|
|
|
+ }
|
|
|
+ },
|
|
|
+ methods:{
|
|
|
+ handleSuccess(res, file) {
|
|
|
+ this.form.today_stock_img.push(res.data.url);
|
|
|
+ },
|
|
|
+ getNowDate(){
|
|
|
+ var y=new Date().getFullYear()
|
|
|
+ var m=Number(new Date().getMonth() + 1)
|
|
|
+ var d = new Date().getDate()
|
|
|
+ m=m>9?m:'0'+m;
|
|
|
+ d=d>9?d:'0'+d
|
|
|
+ this.form.stock_date=y+'-'+m+'-'+d
|
|
|
+ },
|
|
|
+ addCode(){
|
|
|
+ this.form.today_stock.push({code: "", name:"",fund:''})
|
|
|
+ },
|
|
|
+ submitForm() {
|
|
|
+ var form={...this.form}
|
|
|
+ form.is_markt=Number(form.is_markt)
|
|
|
+ this.$refs["form"].validate(valid => {
|
|
|
+ if (valid) {
|
|
|
+ if(!this.form.is_markt){
|
|
|
+ if(this.form.today_stock.length<=0){
|
|
|
+ this.$message('请添加股票');
|
|
|
+ return
|
|
|
+ }else{
|
|
|
+ if((!this.form.today_stock[0].name || !this.form.today_stock[0].fund) && !this.form.is_markt){
|
|
|
+ this.$message('请选择股票并输入资金额');
|
|
|
+ return
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ $.ajax({
|
|
|
+ type: 'POST',
|
|
|
+ url: 'https://test.scxjc.club/api/wx/player/record/topic',
|
|
|
+ data: JSON.stringify(this.form),
|
|
|
+ contentType: "application/json",
|
|
|
+ dataType: 'json',
|
|
|
+ success:res=>{
|
|
|
+ if(res.data.code != 0){
|
|
|
+ this.$message(res.data.message);
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.$message({
|
|
|
+ message: '上传成功',
|
|
|
+ type: 'success'
|
|
|
+ });
|
|
|
+ setTimeout(()=>{
|
|
|
+ window.location.href=window.location.href
|
|
|
+ },500)
|
|
|
+ },
|
|
|
+
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ },
|
|
|
+ created(){
|
|
|
+ this.getNowDate()
|
|
|
+ var id=window.location.search.split('=')[1]
|
|
|
+ $.get('https://test.scxjc.club/api/wx/player/record/topic/match',{id:id},(res=>{
|
|
|
+ var match=res.data.match
|
|
|
+ this.form.name=match.name
|
|
|
+ this.form.match_id=match.id
|
|
|
+ }))
|
|
|
+ }
|
|
|
+ })
|
|
|
+ </script>
|
|
|
+</body>
|
|
|
+</html>
|