浏览代码

商品分类提示,上下架商品弹窗提示

zhengjinyi 5 年之前
父节点
当前提交
752b862b54

+ 1 - 1
src/views/club/editForm.vue

@@ -102,7 +102,7 @@ export default {
           {
             required: true,
             pattern: /^\d{11}|\d{13}$/,
-            message: '联系电话格式不正确',
+            message: '手机号格式不正确',
             trigger: 'blur'
           }
         ],

+ 1 - 1
src/views/club/form.vue

@@ -98,7 +98,7 @@ export default {
           {
             required: true,
             pattern: /^\d{11}|\d{13}$/,
-            message: '联系电话格式不正确',
+            message: '手机号格式不正确',
             trigger: 'blur'
           }
         ],

+ 12 - 1
src/views/club/list.vue

@@ -162,7 +162,15 @@ export default {
       },
       rules: {
         linkName: [{ required: true, message: '姓名不能为空', trigger: 'blur' }],
-        mobile: [{ required: true, message: '手机号码不能为空', trigger: 'blur' }]
+        mobile: [
+          { required: true, message: '手机号码不能为空', trigger: 'blur' },
+          {
+            required: true,
+            pattern: /^\d{11}|\d{13}$/,
+            message: '手机号格式不正确',
+            trigger: 'blur'
+          }
+        ]
       }
     }
   },
@@ -207,6 +215,9 @@ export default {
             this.dialogFormVisible = false
             this.loadingbut = false
             this.loadingbuttext = '保存'
+          }).catch(() => {
+            this.loadingbut = false
+            this.loadingbuttext = '保存'
           })
         }
       })

+ 18 - 14
src/views/club/operateList.vue

@@ -194,7 +194,14 @@ export default {
       },
       rules: {
         linkName: [{ required: true, message: '姓名不能为空', trigger: 'blur' }],
-        mobile: [{ required: true, message: '手机号不能为空', trigger: 'blur' }]
+        mobile: [
+          { required: true, message: '手机号不能为空', trigger: 'blur' },
+          {
+            required: true,
+            pattern: /^\d{11}|\d{13}$/,
+            message: '手机号格式不正确',
+            trigger: 'blur'
+          }]
       }
     }
   },
@@ -310,19 +317,16 @@ export default {
           this.loadingbut = true
           this.loadingbuttext = '保存中...'
           preservOperator(params).then(response => {
-            if (response.code === '1') {
-              this.$message({ message: response.msg, type: 'success', center: true })
-              this.dialogFormVisible = false
-              this.loadingbut = false
-              this.loadingbuttext = '确定'
-              setTimeout(() => {
-                this.initOperatorListData()
-              }, 3000)
-            } else {
-              this.$message.error(response.msg)
-              this.loadingbut = false
-              this.loadingbuttext = '确定'
-            }
+            this.$message({ message: response.msg, type: 'success', center: true })
+            this.dialogFormVisible = false
+            this.loadingbut = false
+            this.loadingbuttext = '确定'
+            setTimeout(() => {
+              this.initOperatorListData()
+            }, 3000)
+          }).catch(() => {
+            this.loadingbut = false
+            this.loadingbuttext = '保存'
           })
         }
       })

+ 16 - 1
src/views/goods/category.vue

@@ -1,9 +1,12 @@
 <template>
   <div class="app-container">
-    <div class="filter-container">
+    <div class="filter-container" style="padding-bottom:0;">
       <router-link to="/goods/category/create"><el-button class="filter-item" type="primary" icon="el-icon-circle-plus-outline">添加分类</el-button></router-link>
       <el-button class="filter-item" type="primary" icon="el-icon-sort" @click="batchSaveSort">批量更新排序</el-button>
     </div>
+    <div class="filter-title">
+      <p>商品分类的排序值是指本页面和星范商城小程序首页分类的排列顺序,数值越小排序越靠前,排序值允许重复。</p>
+    </div>
     <el-table
       v-loading="listLoading"
       :data="list"
@@ -125,3 +128,15 @@ export default {
 }
 
 </script>
+<style lang="scss" scoped>
+.filter-title{
+  float: left;
+  font-size: 12px;
+  line-height: 18px;
+  text-align: left;
+  color: #2E3748;
+}
+.filter-title p{
+  margin:5px 0;
+}
+</style>

+ 21 - 3
src/views/goods/list-commonly.vue

@@ -1,6 +1,5 @@
 <template>
   <div class="app-container" style="padding: 0 20px;padding-bottom: 0;">
-
     <el-menu :default-active="activeIndex" class="el-menu-demo" mode="horizontal">
       <el-menu-item index="0"><router-link to="/goods/list">全部商品</router-link></el-menu-item>
       <el-menu-item v-if="modules && modules.firstModulesName" index="1"><router-link to="/goods/list/preferred">{{ modules.firstModulesName }}</router-link></el-menu-item>
@@ -8,7 +7,7 @@
       <el-menu-item v-if="modules && modules.thirdModulesName" index="3"><router-link to="/goods/list/commonly">{{ modules.thirdModulesName }}</router-link></el-menu-item>
     </el-menu>
 
-    <div class="filter-container" style="margin-top:20px;">
+    <div class="filter-container">
       <el-form class="demo-form-inline goods-list">
         <el-form-item label="商品ID:" style="width:225px;float: left;margin-bottom: 8px;">
           <el-input v-model="listQuery.id" placeholder="请输入商品ID" maxlength="30" style="width: 150px;" class="filter-item" @keyup.enter.native="handleFilter" />
@@ -39,6 +38,9 @@
         </el-form-item>
       </el-form>
     </div>
+    <div class="filter-title">
+      <p>排序值是指本页面和商城小程序对应商品列表的排列顺序,数值越小排序越靠前,排序值允许重复。</p>
+    </div>
 
     <el-table
       v-loading="listLoading"
@@ -80,7 +82,7 @@
       </el-table-column>
       <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
         <template slot-scope="{row}">
-          <el-button type="primary" size="small" @click="cancelGoods(row.id)">取消</el-button>
+          <el-button type="primary" size="mini" style="width: 80px;margin:5px 0 0 0;" @click="cancelGoods(row.id)">取消</el-button>
         </template>
       </el-table-column>
     </el-table>
@@ -178,6 +180,22 @@ export default {
 </script>
 
 <style scoped>
+.filter-container{
+  width: 100%;
+  float: left;
+  margin-top:20px;
+  padding-bottom: 0;
+}
+.filter-title{
+  float: left;
+  font-size: 12px;
+  line-height: 18px;
+  text-align: left;
+  color: #2E3748;
+}
+.filter-title p{
+  margin:5px 0;
+}
 .goods-list .el-form-item{
   margin-bottom: 8px;
 }

+ 14 - 1
src/views/goods/list-preferential.vue

@@ -39,6 +39,9 @@
         </el-form-item>
       </el-form>
     </div>
+    <div class="filter-title">
+      <p>排序值是指本页面和商城小程序对应商品列表的排列顺序,数值越小排序越靠前,排序值允许重复。</p>
+    </div>
 
     <el-table
       v-loading="listLoading"
@@ -80,7 +83,7 @@
       </el-table-column>
       <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
         <template slot-scope="{row}">
-          <el-button type="primary" size="small" @click="cancelGoods(row.id)">取消</el-button>
+          <el-button type="primary" size="mini" style="width: 80px;margin:5px 0 0 0;" @click="cancelGoods(row.id)">取消</el-button>
         </template>
       </el-table-column>
     </el-table>
@@ -178,6 +181,16 @@ export default {
 </script>
 
 <style scoped>
+.filter-title{
+  float: left;
+  font-size: 12px;
+  line-height: 18px;
+  text-align: left;
+  color: #2E3748;
+}
+.filter-title p{
+  margin:5px 0;
+}
 .goods-list .el-form-item{
   margin-bottom: 8px;
 }

+ 14 - 1
src/views/goods/list-preferred.vue

@@ -39,6 +39,9 @@
         </el-form-item>
       </el-form>
     </div>
+    <div class="filter-title">
+      <p>排序值是指本页面和商城小程序对应商品列表的排列顺序,数值越小排序越靠前,排序值允许重复。</p>
+    </div>
 
     <el-table
       v-loading="listLoading"
@@ -80,7 +83,7 @@
       </el-table-column>
       <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
         <template slot-scope="{row}">
-          <el-button type="primary" size="small" @click="cancelGoods(row.id)">取消</el-button>
+          <el-button type="primary" size="mini" style="width: 80px;margin:5px 0 0 0;" @click="cancelGoods(row.id)">取消</el-button>
         </template>
       </el-table-column>
     </el-table>
@@ -178,6 +181,16 @@ export default {
 </script>
 
 <style lang="scss" scoped>
+.filter-title{
+  float: left;
+  font-size: 12px;
+  line-height: 18px;
+  text-align: left;
+  color: #2E3748;
+}
+.filter-title p{
+  margin:5px 0;
+}
 .goods-list .el-form-item{
     margin-bottom: 8px;
   }

+ 23 - 4
src/views/goods/list.vue

@@ -120,8 +120,8 @@
       </el-table-column>
       <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
         <template slot-scope="{row}">
-          <el-button type="primary" size="small" @click="handleEdit(row)">编辑</el-button>
-          <el-button :type="row.validFlag*1 === 1 ? 'danger' : 'success'" size="small" style="margin:5px 0 0 0;" @click="handleSwitch(row.id)">{{ row.validFlag*1 === 1 ? '下架' : '上架' }}</el-button>
+          <el-button type="primary" size="mini" style="width: 80px;margin:5px 0 0 0;" @click="handleEdit(row)">编辑</el-button>
+          <el-button :type="row.validFlag*1 === 1 ? 'danger' : 'success'" size="mini" style="width: 80px;margin:5px 0 0 0;" @click="handleSwitch(row)">{{ row.validFlag*1 === 1 ? '下架' : '上架' }}</el-button>
         </template>
       </el-table-column>
     </el-table>
@@ -252,8 +252,27 @@ export default {
     handleFilter() {
       this.fetchData()
     },
-    handleSwitch(id) {
-      switchGoods({ id: id }).then(() => {
+    handleSwitch(row) {
+      if (row.validFlag === '1') {
+        this.$confirm('确定下架该商品吗?下架后该商品将不会再出现在星范商城,若该商品设置为了星范优惠,热销商品或星范精品,则该商品也会从这三种商品中删除。', '系统提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        }).then(() => {
+          this.handSwithGoods(row)
+        })
+      } else {
+        this.$confirm('确定上架该商品吗?', '系统提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        }).then(() => {
+          this.handSwithGoods(row)
+        })
+      }
+    },
+    handSwithGoods(row) {
+      switchGoods({ id: row.id }).then(() => {
         this.fetchData()
       }).catch(() => {
         this.fetchData()