123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235 |
- <!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;
- background-position-y:-10vh;
- padding: 10px;
- }
- .form{
- width: 100%;
- margin-top: 18vh;
- 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" v-loading='showloading'>
- <!-- <h1>数据上传</h1> -->
- <el-form v-if='!loading' 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>
- <span style="font-size:12px;color:#666;">(交作业时间:13:00-15:30)</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 type='digit' v-model="form.today_fund" placeholder="请输入今日资产">
- <template slot="append">万元</template>
- </el-input>
- </el-form-item>
- <el-form-item label="股票名称(空仓请留空不填)" prop="today_stock" v-show='!form.is_markt'>
- <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 type='digit' 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>
- 开超市(持股超5支可选)<el-switch active-color="#13ce66" v-model="form.is_markt"> </el-switch>
- </el-form-item>
- <el-form-item label="股票截图(截图需包括:净资产-股票名-持股金额,请屏蔽账户-开户名-股东代码等个人信息)">
- <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://www.hunanwanzhu.com/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、用户代码为系统身份认证,请牢记并严格保密。 <br>
- 2、帐户有资金进出,请联系副主编2号调整除权。 <br>
- 3、为方便交流学习,选手间交割单系统内互相可见。 <br>
- 4、有特殊原因不能公开持仓截图,请跟副主编2号备注。 <br>
- 5、连续3天未交作业,无特殊原因将被视为退赛。 <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: {
- loading:true,
- showloading:false,
- 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' },
- ],
-
-
- }
- },
- 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(isNaN(Number(form.today_fund)) || Number(form.today_fund)<=0){
- this.$message('请输入今日资产');
- return
- }
- if(!this.form.is_markt){
- // if(this.form.today_stock.length<=0){
- // this.$message('请添加股票');
- // return
- // }else{
- // for (let i = 0; i < form.today_stock.length;i++){
- // if (!form.today_stock[i].name || isNaN(Number(form.today_stock[i].fund)) || Number(form.today_stock[i].fund)<=0) {
- // this.$message('请输入股票代码并输入资金额');
- // return;
- // // break;
- // }
- // }
- // }
- }else{
- form.today_stock=[]
- }
- $.ajax({
- type: 'POST',
- url: 'https://www.hunanwanzhu.com/api/wx/player/record/topic',
- data: JSON.stringify(form),
- contentType: "application/json",
- dataType: 'json',
- success:res=>{
- if(res.code != 0){
- this.$message(res.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]
- console.log(id)
- $.get('https://www.hunanwanzhu.com/api/wx/player/record/topic/match',{id:id},(res=>{
- this.loading=false
- var match=res.data.match
- this.form.name=match.name
- this.form.match_id=match.id
-
- }))
- }
- })
- </script>
- </body>
- </html>
|