Просмотр исходного кода

1、装修页面丰富页面类型

huangmp 2 лет назад
Родитель
Сommit
5bae37ecb4

+ 17 - 2
src/views/modules/shop/feature/list/index.vue

@@ -19,7 +19,10 @@
             <template slot-scope="scope">
             <div>
               {{scope.row.name}}
-              <el-tag v-if="scope.row.homeStatus===1" effect="dark" size="mini" style="margin-left: 10px;">{{$t('shopFeature.list.shopHomePage')}}</el-tag>
+              <el-tag v-if="scope.row.homeStatus===1 || scope.row.pageType === 1" effect="dark" size="mini" style="margin-left: 10px;">{{$t('shopFeature.list.shopHomePage')}}</el-tag>
+              <el-tag v-if="scope.row.pageType === 2" type="success" effect="dark" size="mini" style="margin-left: 10px;">周边页</el-tag>
+              <el-tag v-if="scope.row.pageType === 3" type="danger" effect="dark" size="mini" style="margin-left: 10px;">团购页</el-tag>
+              <el-tag v-if="scope.row.pageType === 4" type="warning" effect="dark" size="mini" style="margin-left: 10px;">商品推荐页</el-tag>
             </div>
           </template>
           </el-table-column>
@@ -43,7 +46,19 @@
               <div class="text-btn-con">
                 <div class="default-btn text-btn" v-if="isAuth('shop:shopRenovation:update')" @click="handleEdit(scope.row)" size="small">{{$t('shopFeature.list.edit')}}</div>
                 <div class="default-btn text-btn" v-if="isAuth('shop:shopRenovation:delete')" @click="handleDelete(scope.row)" size="small">{{$t('shopFeature.list.delete')}}</div>
-                <div class="default-btn text-btn" v-if="isAuth('shop:shopRenovation:updateHome')" @click="handleSetHomePage(scope.row.renovationId)" size="small">{{ scope.row.homeStatus!=1 ? $t('shopFeature.list.setHomePage'): $t('shopFeature.list.cancelHomePage')}}</div>
+<!--                <div class="default-btn text-btn" v-if="isAuth('shop:shopRenovation:updateHome')" @click="handleSetHomePage(scope.row.renovationId)" size="small">{{ scope.row.homeStatus!=1 ? $t('shopFeature.list.setHomePage'): $t('shopFeature.list.cancelHomePage')}}</div>-->
+                <div class="default-btn text-btn" v-if="isAuth('shop:shopRenovation:updateHome')" size="small">
+                  <el-dropdown trigger="hover" @command="(command) => handleSetPageType(scope.row.renovationId, command)">
+                    <span style="color: #447cdd;">页面设置</span>
+                    <el-dropdown-menu slot="dropdown">
+                      <el-dropdown-item command="0">无属性页面</el-dropdown-item>
+                      <el-dropdown-item command="1">店铺主页</el-dropdown-item>
+                      <el-dropdown-item command="2">周边页</el-dropdown-item>
+                      <el-dropdown-item command="3">团购页</el-dropdown-item>
+                      <el-dropdown-item command="4">商品推荐页</el-dropdown-item>
+                    </el-dropdown-menu>
+                  </el-dropdown>
+                </div>
               </div>
             </template>
           </el-table-column>

+ 16 - 0
src/views/modules/shop/feature/list/list.js

@@ -118,6 +118,22 @@ export default {
       }).catch((error) => {
         console.log('err', error)
       })
+    },
+
+    /**
+     * 设置页面类型
+     */
+    handleSetPageType (renovationId, pageType) {
+      this.$http({
+        url: this.$http.adornUrl('/shop/shopRenovation/updatePageType'),
+        method: 'put',
+        data: this.$http.adornData({renovationId: renovationId, pageType: pageType})
+      }).then(({ data }) => {
+        this.$message.success("更新页面类型成功")
+        this.getMiniPagesList()
+      }).catch((error) => {
+        console.log('err', error)
+      })
     }
   }
 }