Przeglądaj źródła

奖品分类配置

yaoyao 2 miesięcy temu
rodzic
commit
bbfb742954

+ 1 - 1
.env.development

@@ -1,5 +1,5 @@
 # 页面标题
-VUE_APP_TITLE = 若依管理系统
+VUE_APP_TITLE = 掌柜鼎科技
 
 # 开发环境配置
 ENV = 'development'

+ 1 - 1
.env.production

@@ -1,5 +1,5 @@
 # 页面标题
-VUE_APP_TITLE = 若依管理系统
+VUE_APP_TITLE = 掌柜鼎科技
 
 # 生产环境配置
 ENV = 'production'

+ 1 - 1
.env.staging

@@ -1,5 +1,5 @@
 # 页面标题
-VUE_APP_TITLE = 若依管理系统
+VUE_APP_TITLE = 掌柜鼎科技
 
 NODE_ENV = production
 

BIN
public/favicon.ico


+ 46 - 0
src/api/award/awardList.js

@@ -80,3 +80,49 @@ export function delDrawActivity(data) {
     data: data
   })
 }
+
+// 获取二维码
+export function getQrCode(data) {
+  return request({
+    url: '/wechat/getQrCode',
+    method: 'post',
+    data: data
+  })
+}
+
+// 获取奖品分类列表
+export function getAwardTypeList(data) {
+  return request({
+    url: '/market/awardType/getAwardTypeList',
+    method: 'post',
+    data: data
+  })
+}
+
+
+// 修改奖品分类
+export function updateAward(data) {
+  return request({
+    url: '/market/awardType/updateAward',
+    method: 'post',
+    data: data
+  })
+}
+
+// 添加奖品分类
+export function addAwardType(data) {
+  return request({
+    url: '/market/awardType/addAwardType',
+    method: 'post',
+    data: data
+  })
+}
+
+// 删除奖品分类
+export function delAwardType(data) {
+  return request({
+    url: '/market/awardType/delAwardType',
+    method: 'post',
+    data: data
+  })
+}

BIN
src/assets/logo/logo.png


+ 25 - 1
src/views/award/activeList.vue

@@ -10,6 +10,18 @@
           @click="handleAdd"
         >新增</el-button>
       </el-col>
+      <!-- <el-col :span="1.5">
+        <el-button
+          type="primary"
+          plain
+          icon="el-icon-plus"
+          size="mini"
+          @click="handleGetEwm"
+        >二维码</el-button>
+      </el-col>
+      <el-col>
+        <img :src="ewmImg" style="width: 200px; height: 200px">
+      </el-col> -->
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
 
@@ -148,7 +160,8 @@ import {
   addDrawActivity,
   getDrawTemplateList,
   awardList,
-  delDrawActivity
+  delDrawActivity,
+  getQrCode
 } from "@/api/award/awardList"
 
 import imageUpload from "../../components/ImageUpload/index.vue";
@@ -206,6 +219,7 @@ export default {
       templateList: [],
       awardList: [],
       awardOptionNum: 0, // 奖品数量
+      ewmImg: '',
     };
   },
   created() {
@@ -296,6 +310,16 @@ export default {
       this.resetForm("queryForm");
       this.handleQuery();
     },
+    // 二维码
+    handleGetEwm() {
+      getQrCode({
+        userId: '1',
+        activityId: '1816742797954846720'
+      }).then((res) => {
+        let result = res.replace(/[\r\n]/g, "");
+        this.ewmImg = `data:image/png;base64,${result}`;
+      })
+    },
     /** 新增按钮操作 */
     handleAdd() {
       this.reset();

+ 96 - 25
src/views/award/awardTypeTemp.vue

@@ -3,28 +3,34 @@
   <div class="app-container">
     <el-row :gutter="10" class="mb8">
       <el-col :span="1.5">
-        <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="dialogVisible = true">新增</el-button>
+        <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd">新增</el-button>
       </el-col>
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="findpage"></right-toolbar>
     </el-row>
     <!-- 模板内容 -->
     <el-table :data="tableData" style="width: 100%" v-loading="loading">
-      <el-table-column align="center" prop="companyName" label="公司名称" width="180">
-      </el-table-column>
-      <el-table-column align="center" prop="companyDesc" label="公司描述" width="180">
-      </el-table-column>
-      <el-table-column align="center" prop="advertisingProbability" label="广告权重" width="180">
-      </el-table-column>
-      <el-table-column align="center" prop="createTime" label="创建时间">
+      <el-table-column align="center" prop="typeName" label="奖品类型名称"></el-table-column>
+      <el-table-column align="center" prop="typeAttr" label="奖品字段属性">
+        <template slot-scope="scope">
+          <span>{{ scope.row.typeAttr }}</span>
+        </template>
       </el-table-column>
       <el-table-column fixed="right" align="center" label="操作" width="200">
         <template slot-scope="scope">
-          <el-button type="text" size="small" @click="Marketupdate(scope.row)">编辑</el-button>
-          <el-button @click="Marketdel(scope.row)" type="text" size="small" style="color: red;">删除</el-button>
+          <el-button type="text" size="small" @click="handleEdit(scope.row)">编辑</el-button>
+          <el-button @click="handleDelete(scope.row)" type="text" size="small" style="color: red;">删除</el-button>
         </template>
       </el-table-column>
     </el-table>
-    <pagination :total="pagetotal" :page.sync="pageRequest.pageNum" :limit.sync="pageRequest.pageSize"
-      @pagination="MarketList" />
+    <!-- <pagination :total="pagetotal" :page.sync="pageRequest.pageNum" :limit.sync="pageRequest.pageSize"
+      @pagination="MarketList" /> -->
+      <pagination
+      v-show="pagetotal>0"
+      :total="pagetotal"
+      :page.sync="pageRequest.pageNum"
+      :limit.sync="pageRequest.pageSize"
+      @pagination="findpage"
+    />
     <el-dialog :title="dilogtitle" :visible.sync="dialogVisible" width="1000px">
       <el-form class="demo-ruleForm wrap-scrollbar scroll-style" :model="attributionform" ref="attributionform"
         label-width="130px" size="small">
@@ -45,7 +51,7 @@
                 <el-input v-model="configureitem.attrKey" class="widths1" placeholder="请输入字段名"></el-input>
               </el-form-item>
               <el-form-item label="标签:">
-                <el-input v-model="configureitem.atrName" class="widths1" placeholder="标签名"></el-input>
+                <el-input v-model="configureitem.attrName" class="widths1" placeholder="标签名"></el-input>
               </el-form-item>
             </el-col>
             <el-col :span="10">
@@ -64,7 +70,7 @@
       </el-form>
       <span slot="footer" class="dialog-footer">
         <el-button size="small" @click="configuration">新增配置</el-button>
-        <el-button size="small" @click="dialogVisible = false">取 消</el-button>
+        <el-button size="small" @click="handleClose">取 消</el-button>
         <el-button size="small" type="primary" @click="submitForm">提 交</el-button>
       </span>
     </el-dialog>
@@ -76,7 +82,8 @@
 import {
   addAwardType,
   updateAward,
-  getAwardTypeList
+  getAwardTypeList,
+  delAwardType
 } from "@/api/award/awardList"
 
 export default {
@@ -90,6 +97,7 @@ export default {
         pageNum: 1,
         pageSize: 20,
       },
+      showSearch: true,
       loading: false,
       tableData: [],
       attributionform: {
@@ -107,22 +115,85 @@ export default {
   },
   // 生命周期函数
   created() {
+    this.findpage()
   },
   // 方法函数
   methods: {
+    // 删除
+    handleDelete(row) {
+      const awardName = row.typeName
+      this.$confirm('是否确认名称为"' + awardName + '"的奖品类型?', '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        }).then(() => {
+          delAwardType({id: row.id}).then((res) => {
+            if (res.code == 200) {
+              this.$message.success(res.msg)
+              this.findpage()
+            } else {
+              this.$message.error(res.msg)
+            }
+          })
+        }).catch(() => {
+          this.$message.info('已取消删除')
+        });
+    },
+    // 编辑
+    handleEdit(row) {
+      this.attributionform = row
+      this.attributionform.typeAttr = row.typeAttr
+      this.dilogtitle = '编辑'
+      this.dialogVisible = true
+    },
+    handleAdd() {
+      this.dilogtitle = '新增'
+      this.dialogVisible = true
+    },
     submitForm() {
-      addAwardType(this.attributionform).then((res) => {
-        if (res.code == "200") {
-          this.$message({ message: "新增成功", type: "success" });
-          this.findpage();
-          this.dialogVisible = false;
-        } else {
-          this.$message({ message: res.msg, type: "success" });
-        }
-      });
+      if (this.attributionform.id) {
+        updateAward(this.attributionform).then((res) => {
+          if (res.code == "200") {
+            this.$message({ message: "修改成功", type: "success" });
+            this.findpage();
+            this.handleClose()
+          } else {
+            this.$message({ message: res.msg, type: "success" });
+          }
+        });
+      } else {  
+        addAwardType(this.attributionform).then((res) => {
+          if (res.code == "200") {
+            this.$message({ message: "新增成功", type: "success" });
+            this.findpage();
+            this.handleClose()
+          } else {
+            this.$message({ message: res.msg, type: "success" });
+          }
+        });
+      }
     },
     findpage(){
-
+      getAwardTypeList(this.pageRequest).then((res) => {
+        this.tableData = res.data.records
+        this.pagetotal = res.data.total
+        this.pageRequest.pageNum = res.data.current
+        this.pageRequest.pageSize = res.data.size
+      })
+    },
+    handleClose() {
+      this.attributionform = {
+        typeAttr: [
+          {
+            attrKey: "",
+            atrName: "",
+            type: "",
+            value: "",
+          },
+        ],
+        typeName: "",
+      }
+      this.dialogVisible = false
     },
     removeDomain(item) {
       var index = this.attributionform.typeAttr.indexOf(item);