Your Name 2 anni fa
parent
commit
508a6c5ca5
5 ha cambiato i file con 14851 aggiunte e 13952 eliminazioni
  1. 14564 13949
      package-lock.json
  2. 8 0
      src/api.js
  3. 16 0
      src/router.js
  4. 22 3
      src/views/signup/index.vue
  5. 241 0
      src/views/sys/Version.vue

File diff suppressed because it is too large
+ 14564 - 13949
package-lock.json


+ 8 - 0
src/api.js

@@ -396,4 +396,12 @@ export default {
     pushArticle: params => {
         return axios.post(`${baseURL}/api/admin/article/push`, params)
     },
+    // 版本列表
+    getVersionList: params => {
+        return axios.get(`${baseURL}/api/admin/version/list`, { params: params })
+    },
+    //退款
+    refundSignupOrder: params => {
+        return axios.post(`${baseURL}/api/admin/wxpay/refund`, params)
+    },
 }

+ 16 - 0
src/router.js

@@ -176,5 +176,21 @@ export default new Router({
                 name: '用户管理'
             }, ]
         },
+        {
+            path: '/sys',
+            name: '系统管理',
+            icon: 'el-icon-trophy-1',
+            component: () =>
+                import ('./views/Home.vue'),
+            show: 1,
+            isLeaf: 0,
+            children: [{
+                    path: '/sys/version',
+                    component: () =>
+                        import ('./views/sys/Version.vue'),
+                    name: '版本管理'
+                }
+            ]
+        }
     ]
 })

+ 22 - 3
src/views/signup/index.vue

@@ -77,12 +77,11 @@
                     <template slot-scope="scope">
                         <!-- <span v-if="scope.row.order_status==1" style="color:#67c23a;">已支付</span> -->
                         <el-button v-if="scope.row.order_status==1" type="success" size="mini">已支付</el-button>
-                        <span v-else>未支付</span>
+                        <el-button v-if="scope.row.order_status==-1" type="warning" size="mini">已退款</el-button>
+                        <span v-if="scope.row.order_status==0">未支付</span>
                         <el-button v-if="scope.row.order_status==0" @click="editOld(scope.row)" size="mini" type="primary">我是老用户</el-button>
                     </template>
                 </el-table-column>
-                <el-table-column prop="out_trade_no" label="订单号" width="180"/>
-                <el-table-column prop="transaction_id" label="微信支付单号" width="180"/>
                 <el-table-column prop="pay_status" label="支付状态" width="150">
                     <template slot-scope="scope">
                         <!-- <span v-if="scope.row.pay_status==1" class="color:green;">已支付</span> -->
@@ -90,6 +89,8 @@
                         <span v-else>未支付</span>
                     </template>
                 </el-table-column>
+                <el-table-column prop="out_trade_no" label="订单号" width="180"/>
+                <el-table-column prop="transaction_id" label="微信支付单号" width="180"/>
                 <el-table-column prop="pay_time" label="支付时间" width="160" show-overflow-tooltip />
                 <el-table-column prop="ctime" label="下单时间" width="160"/>
                 <el-table-column prop="remark" label="备注" width="160"/>
@@ -97,6 +98,7 @@
                     <template slot-scope="scope">
                         <el-button @click="edit(scope.row.id)" size="mini" type="warning">编辑</el-button>
                         <el-button @click="del(scope.row.id)" size="mini" type="danger" :disabled="scope.row.pay_status==1">删除</el-button>
+                        <el-button v-if="scope.row.pay_status==1&scope.row.order_status==1" @click="refund(scope.row.id)" size="mini" type="danger">退款</el-button>
                     </template>
                 </el-table-column>
         </el-table>
@@ -326,6 +328,23 @@ export default {
             });
         });
         },
+        refund(id) {
+        this.$confirm("确定退款吗?", "提示", {
+            type: "warning",
+        }).then(() => {
+            this.$api.refundSignupOrder({ id: id }).then((res) => {
+            if(res.data.code==0){
+                this.$message({
+                    message: "退款成功!",
+                    type: "success",
+                });
+            }else{
+                this.$message.error(res.data.message);
+            }
+            this.getData();
+            });
+        });
+        },
         gopage(size) {
             if (size) {
                 this.queryParams.page_size = size;

+ 241 - 0
src/views/sys/Version.vue

@@ -0,0 +1,241 @@
+<style lang="scss" scoped>
+.blue {
+  background: red !important;
+}
+</style>
+<template>
+  <section class="content">
+    <h4>版本管理</h4>
+    <el-divider></el-divider>
+    <el-form label-width="80px" class="filter-form">
+      <el-row>
+        <el-col :span="4">
+          <el-form-item label-width="10" style="margin-left: 10px">
+            <el-button
+              type="primary"
+              plain
+              icon="el-icon-plus"
+              size="mini"
+              @click="handleAdd"
+              >新增版本</el-button
+            >
+          </el-form-item>
+        </el-col>
+      </el-row>
+    </el-form>
+    <el-table
+      v-loading="loading"
+      :data="list"
+      style="width: 100%; margin-top: 10px"
+      height="50vh"
+    >
+      <el-table-column align="center" prop="version" label="版本号" />
+      <el-table-column align="center" prop="android_version" label="android版本" />
+      <el-table-column align="center" prop="android_url" label="andorid安装包地址" />
+      <el-table-column align="center" prop="ios_url" label="ios安装包地址" />
+      <el-table-column align="center" prop="force" label="状态">
+        <template slot-scope="scope">
+            <span v-if="scope.row.force==0">待发布</span>
+            <span>已发布</span>
+        </template>
+      </el-table-column>
+      <el-table-column align="center" prop="ctime" label="创建时间" />
+      <el-table-column align="center" prop="date" label="操作" width="150">
+        <template slot-scope="scope">
+          <el-button @click="edit(scope.row)" size="mini" type="warning"
+            >编辑</el-button
+          >
+          <el-button @click="del(scope.row.id)" size="mini" type="danger"
+            >删除</el-button
+          >
+        </template>
+      </el-table-column>
+    </el-table>
+    <Page
+      ref="pageButton"
+      :current="form.page"
+      :page_size="form.page_size"
+      :total="total"
+      @pageChange="gopage"
+    />
+    <el-dialog :title="title" :visible.sync="open" width="800px" append-to-body>
+      <el-form ref="form" :model="form" label-width="80px">
+        <el-form-item label="比赛名称" prop="name">
+          <el-input
+            clearable
+            v-model="form.name"
+            placeholder="请输入比赛名称"
+          ></el-input>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitForm">确 定</el-button>
+        <el-button @click="open = false">取 消</el-button>
+      </div>
+    </el-dialog>
+  </section>
+</template>
+<script>
+import Page from "../../components/Page";
+import { FullCalendar } from "vue-fullcalendar";
+export default {
+  components: {
+    Page,
+    "full-calendar": require("vue-fullcalendar"),
+  },
+  data() {
+    return {
+      monthData: [],
+      dateRange: ["2021-12-01", "2022-01-02"],
+      loading: false,
+      queryParams: {
+        page: 1,
+      },
+      form: {monthData:[]},
+      list: [{}, {}],
+      total: 0,
+      title: "新增版本",
+      open: false,
+      matchList: [],
+      groupList: [],
+      userList: [],
+      matchStatus:[{
+        label:"待发布",
+        value:1,
+      },{
+        label:"开始报名",
+        value:2,
+      },{
+        label:"比赛中",
+        value:3,
+      },{
+        label:"已结束",
+        value:4,
+      }]
+    };
+  },
+  methods: {
+    del(id) {
+      this.$confirm("确定删除吗?", "提示", {
+        type: "warning",
+      }).then(() => {
+        this.$api.delMatch({ id: id }).then((res) => {
+          this.$message({
+            message: "删除成功",
+            type: "success",
+          });
+          this.getData();
+        });
+      });
+    },
+    edit(row) {
+      this.open = true;
+      this.form = row;
+      this.monthData = JSON.parse(row.calendar);
+    },
+    gopage(size) {
+      if (size) {
+        this.queryParams.page_size = size;
+      }
+      this.queryParams.page = this.$refs.pageButton.page;
+      this.getData();
+    },
+    getData() {
+      this.loading = true;
+      //
+      this.$api.getVersionList(this.queryParams).then((res) => {
+        this.list = res.data.data.list;
+        this.total = res.data.data.total;
+        this.loading = false;
+      });
+    },
+    handleAdd() {
+      this.open = true;
+      this.title = "新增赛事";
+      this.form = {};
+    },
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate((valid) => {
+        if (valid) {
+          if (this.monthData.length == 0) {
+            this.$message.error("请设置报单日历!");
+            return;
+          }
+          this.form.calendar = JSON.stringify(this.monthData);
+          let valid_dates = [];
+          this.monthData.forEach((item) => {
+            valid_dates.push(item.start);
+          });
+          this.form.valid_dates = valid_dates;
+          this.valid_dates = JSON.stringify(valid_dates);
+          if (this.form.id != null) {
+            this.$api.updateMatch(this.form).then((response) => {
+              this.msgSuccess("修改成功");
+              this.open = false;
+              this.getData();
+            });
+          } else {
+            this.$api.addMatch(this.form).then((response) => {
+              this.msgSuccess("新增成功");
+              this.open = false;
+              this.getData();
+            });
+          }
+        }
+      });
+    },
+    formatDate(date) {
+      var y = date.getFullYear();
+      var m = date.getMonth() + 1;
+      m = m < 10 ? "0" + m : m;
+      var d = date.getDate();
+      d = d < 10 ? "0" + d : d;
+      return y + "-" + m + "-" + d;
+    },
+    // 选择月份
+    changeMonth(start, end, current) {
+      console.log("changeMonth", start, end, current);
+    },
+    // 点击事件
+    eventClick(event, jsEvent, pos) {
+      console.log("eventClick", event, jsEvent, pos);
+    },
+    // 点击当天
+    dayClick(day, jsEvent) {
+      let curDate = this.formatDate(new Date(day));
+      let selDate = { title: "报单", start: curDate, end: curDate };
+      if (this.monthData.filter((item) => item.start == curDate).length == 0) {
+        this.monthData.push(selDate);
+      } else {
+        this.removeAaary(this.monthData,selDate)
+      }
+    },
+    // 查看更多
+    moreClick(day, events, jsEvent) {
+      console.log("moreCLick", day, events, jsEvent);
+    },
+    removeAaary(_arr, _obj) {
+      var length = _arr.length;
+      for (var i = 0; i < length; i++) {
+        
+        if (_arr[i].start === _obj.start) {
+          if (i == 0) {
+            _arr.shift(); //删除并返回数组的第一个元素
+            return _arr;
+          } else if (i == length - 1) {
+            _arr.pop(); //删除并返回数组的最后一个元素
+            return _arr;
+          } else {
+            _arr.splice(i, 1); //删除下标为i的元素
+            return _arr;
+          }
+        }
+      }
+    },
+  },
+  created() {
+    this.getData();
+  },
+};
+</script>