YY 2 年之前
父節點
當前提交
3a1aa4f053

+ 3 - 7
src/views/platActivi/coupon/detail.vue

@@ -162,7 +162,7 @@ const { mapActions: goodsTags } = createNamespacedHelpers('goodsTags');
 const { mapActions: shop } = createNamespacedHelpers('shop');
 export default {
   name: 'form-1',
-  props: {},
+  props: { id: { type: String } },
   components: {},
   data: function () {
     return {
@@ -298,14 +298,10 @@ export default {
     },
     // 返回
     toBack() {
-      window.history.go('-1');
-    },
-  },
-  computed: {
-    id() {
-      return this.$route.query.id;
+      this.$emit('toBack');
     },
   },
+  computed: {},
   metaform() {
     return { title: this.$route.meta.title };
   },

+ 42 - 33
src/views/platActivi/coupon/index.vue

@@ -2,36 +2,39 @@
   <div id="card-1">
     <el-row>
       <el-col :span="24" class="main animate__animated animate__backInRight">
-        <el-col :span="24" class="one"> <span>优惠券管理</span> </el-col>
-        <el-col :span="24" class="two">
-          <search-1
-            :form="searchForm"
-            :statusList="statusList"
-            @onSubmit="search"
-            @toReset="toClose"
-            @querySearch="querySearch"
-            :shopList="shopList"
-            :discount_typeList="discount_typeList"
-          ></search-1>
-        </el-col>
-        <el-col :span="24" class="thr">
-          <el-button type="primary" size="mini" @click="toAdd()">新增</el-button>
-        </el-col>
-        <el-col :span="24" class="four">
-          <data-table
-            :select="true"
-            :selected="selected"
-            @handleSelect="handleSelect"
-            :fields="fields"
-            :opera="opera"
-            @query="search"
-            :data="list"
-            :total="total"
-            @edit="toEdit"
-            @del="toDel"
-          >
-          </data-table>
-        </el-col>
+        <span v-show="view === 'list'">
+          <el-col :span="24" class="one"> <span>优惠券管理</span> </el-col>
+          <el-col :span="24" class="two">
+            <search-1
+              :form="searchForm"
+              :statusList="statusList"
+              @onSubmit="search"
+              @toReset="toClose"
+              @querySearch="querySearch"
+              :shopList="shopList"
+              :discount_typeList="discount_typeList"
+            ></search-1>
+          </el-col>
+          <el-col :span="24" class="thr">
+            <el-button type="primary" size="mini" @click="toAdd()">新增</el-button>
+          </el-col>
+          <el-col :span="24" class="four">
+            <data-table
+              :select="true"
+              :selected="selected"
+              @handleSelect="handleSelect"
+              :fields="fields"
+              :opera="opera"
+              @query="search"
+              :data="list"
+              :total="total"
+              @edit="toEdit"
+              @del="toDel"
+            >
+            </data-table>
+          </el-col>
+        </span>
+        <detail v-if="view === 'info'" :id="id" @toBack="toBack"></detail>
       </el-col>
     </el-row>
   </div>
@@ -47,10 +50,11 @@ const { mapActions: shop } = createNamespacedHelpers('shop');
 export default {
   name: 'card-1',
   props: {},
-  components: { search1: () => import('./parts/search-1.vue') },
+  components: { search1: () => import('./parts/search-1.vue'), detail: () => import('./detail.vue') },
   data: function () {
     const that = this;
     return {
+      view: 'list',
       // 查询
       searchForm: {},
       list: [],
@@ -101,6 +105,7 @@ export default {
       shopList: [],
       // 减免方式
       discount_typeList: [],
+      id: '',
     };
   },
   async created() {
@@ -122,11 +127,15 @@ export default {
     },
     // 新增
     toAdd() {
-      this.$router.push({ path: '/platActivi/coupon/detail' });
+      this.$set(this, `view`, 'info');
+    },
+    toBack() {
+      this.view = 'list';
     },
     // 修改
     async toEdit({ data }) {
-      this.$router.push({ path: '/platActivi/coupon/detail', query: { id: data.id } });
+      this.$set(this, `id`, data.id);
+      this.$set(this, `view`, 'info');
     },
     // 删除
     async toDel({ data }) {

+ 12 - 2
src/views/platmanag/goodsRate/detail.vue

@@ -12,8 +12,8 @@
           <el-col :span="24" class="one_2">
             <el-col :span="24" class="cont" v-for="(item, index) in list" :key="index">
               <el-col :span="3" class="name">
-                <el-image class="icon" :src="item.customer.icon[0].url"></el-image>
-                <el-col>{{ item.customer.name }}</el-col>
+                <el-image class="icon" :src="getCheck()"></el-image>
+                <el-col>{{ getName() }}</el-col>
               </el-col>
               <el-col :span="21">
                 <el-col :span="24">
@@ -110,6 +110,16 @@ export default {
         this.$set(this, 'total', res.total);
       }
     },
+    getCheck() {
+      for (const p1 of this.list) {
+        return _.get(p1.customer, 'icon[0].url');
+      }
+    },
+    getName() {
+      for (const p1 of this.list) {
+        return _.get(p1.customer, 'name');
+      }
+    },
     // 分页
     currentChange(val) {
       this.search({ skip: (val - 1) * this.limit });

+ 1 - 0
src/views/platmanag/goodsRate/index.vue

@@ -56,6 +56,7 @@ export default {
       searchForm: {},
       // 多选值
       selected: [],
+      id: '',
     };
   },
   async created() {

+ 14 - 16
src/views/platmanag/goodsTags/index.vue

@@ -1,6 +1,6 @@
 <template>
   <div id="index">
-    <template v-if="view === 'list'">
+    <span v-if="view === 'list'">
       <el-row>
         <el-col :span="24" class="btn" v-if="levelList.length > 0">
           <el-col :span="2">
@@ -24,21 +24,19 @@
           <el-link type="primary" @click="toData(row)">{{ row[item.model] }}</el-link>
         </template>
       </data-table>
-    </template>
-    <template v-else>
-      <el-row>
-        <el-col :span="24">
-          <el-button size="mini" type="primary" @click="toBack()">返回</el-button>
-        </el-col>
-        <el-col :span="24">
-          <data-form :span="12" :fields="infoFields" :rules="rules" v-model="form" labelWidth="150px" @save="toSave">
-            <template #status>
-              <el-option v-for="i in statusList" :key="i.model" :label="i.label" :value="i.value"></el-option>
-            </template>
-          </data-form>
-        </el-col>
-      </el-row>
-    </template>
+    </span>
+    <el-row v-if="view === 'info'">
+      <el-col :span="24">
+        <el-button size="mini" type="primary" @click="toBack()">返回</el-button>
+      </el-col>
+      <el-col :span="24">
+        <data-form :span="12" :fields="infoFields" :rules="rules" v-model="form" labelWidth="150px" @save="toSave">
+          <template #status>
+            <el-option v-for="i in statusList" :key="i.model" :label="i.label" :value="i.value"></el-option>
+          </template>
+        </data-form>
+      </el-col>
+    </el-row>
   </div>
 </template>
 

+ 12 - 2
src/views/selfShop/goodsRate/detail.vue

@@ -12,8 +12,8 @@
           <el-col :span="24" class="one_2">
             <el-col :span="24" class="cont" v-for="(item, index) in list" :key="index">
               <el-col :span="3" class="name">
-                <el-image class="icon" :src="item.customer.icon[0].url"></el-image>
-                <el-col>{{ item.customer.name }}</el-col>
+                <el-image class="icon" :src="getCheck()"></el-image>
+                <el-col>{{ getName() }}</el-col>
               </el-col>
               <el-col :span="21">
                 <el-col :span="24">
@@ -119,6 +119,16 @@ export default {
         this.$set(this, 'total', res.total);
       }
     },
+    getCheck() {
+      for (const p1 of this.list) {
+        return _.get(p1.customer, 'icon[0].url');
+      }
+    },
+    getName() {
+      for (const p1 of this.list) {
+        return _.get(p1.customer, 'name');
+      }
+    },
     // 分页
     currentChange(val) {
       this.search({ skip: (val - 1) * this.limit });

+ 1 - 0
src/views/selfShop/goodsRate/index.vue

@@ -56,6 +56,7 @@ export default {
       searchForm: {},
       // 多选值
       selected: [],
+      id: '',
     };
   },
   async created() {

+ 1 - 1
vue.config.js

@@ -21,7 +21,7 @@ module.exports = {
         target: 'http://broadcast.waityou24.cn',
       },
       '/dev/point/v1/api': {
-        target: 'http://127.0.0.1', // 127.0.0.1:13003
+        target: 'https://broadcast.waityou24.cn', // 127.0.0.1:13003
         changeOrigin: true,
         ws: false,
       },