sunlupeng 1 рік тому
батько
коміт
cfcf3d1910
1 змінених файлів з 29 додано та 4 видалено
  1. 29 4
      src/views/HomeView/PointsMall.vue

+ 29 - 4
src/views/HomeView/PointsMall.vue

@@ -27,6 +27,13 @@
             <el-tabs style="padding: 0 20px 40px 20px;" v-model="activeName" @tab-click="handleClick">
                 <el-tab-pane label="积分兑换" name="goodsNotice">
                     <el-input clearable style="width: 200px;" size="small" v-model="goodsName" placeholder="物品名称"></el-input>
+                    <el-select clearable style="width: 200px; margin-left: 30px;" size="small" v-model="productAttribute"
+                            placeholder="物品类型">
+                            <el-option v-for="item in options" :key="item.dictValue" :label="item.dictLabel" :value="item.dictValue">
+                            </el-option>
+                    </el-select>
+                    <el-button size="small" style="margin-left: 30px;" type="primary" round @click="changeOrderByClause('asc')" icon="el-icon-top">积分</el-button>
+                    <el-button size="small" style="margin-left: 30px;" type="primary" round @click="changeOrderByClause('desc')" icon="el-icon-bottom">积分</el-button>
                     <el-button size="small" style="margin-left: 30px;" type="primary" @click="getList('goodsNotice')">查询</el-button>
                     <div class="list-container">
                         <el-empty v-if="goodsList.length==0" :image-size="200"></el-empty>
@@ -56,8 +63,8 @@
                     </div>
                 </el-tab-pane>
                 <el-tab-pane label="礼品兑换" name="giftNotice">
-                    <el-input clearable style="width: 200px;" size="small" v-model="giftName" placeholder="物品名称"></el-input>
-                    <el-button size="small" style="margin-left: 30px;" type="primary" @click="getList('giftNotice')">查询</el-button>
+                    <!-- <el-input clearable style="width: 200px;" size="small" v-model="giftName" placeholder="物品名称"></el-input>
+                    <el-button size="small" style="margin-left: 30px;" type="primary" @click="getList('giftNotice')">查询</el-button> -->
                     <el-empty v-if="goodsList.length==0" :image-size="200"></el-empty>
                     <div v-else>
                         <div class="tab-list">
@@ -100,12 +107,15 @@
     </div>
 </template>
 <script>
-import { integralList, festivalList, notice, welfareType } from "@/api/allApi";
+import { integralList, festivalList, notice, welfareType, integralTypes } from "@/api/allApi";
 export default {
     data() {
         return {
             // tab 列表
+            options: [],
             goodsName:'',
+            productAttribute:'',
+            orderByClause:'asc',
             giftName:'',
             choseList: [],
             curChosed: '',
@@ -115,11 +125,21 @@ export default {
         };
     },
     created() {
+        this.getIntegralTypes();
         this.getWelfareList();
         this.getList(this.activeName);
         this.getNotice(this.activeName);
     },
     methods: {
+        changeOrderByClause(val){
+            this.orderByClause = val;
+            this.getList('goodsNotice');
+        },
+        getIntegralTypes(){
+            integralTypes({dictType:'mall_sku_attribute'}).then(response=>{
+                this.options = response.data.data; 
+            })
+        },
         getWelfareList() {
             welfareType({}).then(response => {
                 console.log(response.data.data);
@@ -159,7 +179,12 @@ export default {
         },
         getList(val) {
             if (val == 'goodsNotice') {
-                integralList({name:this.goodsName}).then(response => {
+                let params = {
+                    name:this.goodsName,
+                    productAttribute:this.productAttribute,
+                    orderByClause:this.orderByClause
+                }
+                integralList(params).then(response => {
                     console.log(response.data.data);
                     this.goodsList = response.data.data
                 }).catch(() => {