shish 1 год назад
Родитель
Сommit
5496a7ae44

+ 1 - 1
ghsApp/src/admin/item/detail.vue

@@ -561,7 +561,7 @@ export default {
     },
     },
     clearBuyCache(){
     clearBuyCache(){
       let that = this
       let that = this
-      that.$util.confirmModal({content:'确认清除已购?清除后客户可再次下单'},() => {
+      that.$util.confirmModal({content:'确认清除?清除后全部客户重新计算限购数'},() => {
         clearLimitBuy({id:this.productData.id}).then(res=>{
         clearLimitBuy({id:this.productData.id}).then(res=>{
           if(res.code == 1){
           if(res.code == 1){
             this.$msg('已清除')
             this.$msg('已清除')

+ 26 - 3
ghsApp/src/admin/item/hasLimitBuyCustom.vue

@@ -2,7 +2,7 @@
   <div class="app-main app-content">
   <div class="app-main app-content">
     <block v-if="!$util.isEmpty(customList)">
     <block v-if="!$util.isEmpty(customList)">
       <block v-for="(item, index) in customList" :key="index">
       <block v-for="(item, index) in customList" :key="index">
-        <tui-list-cell :arrow="true" @click="pageTo({url:'/pagesClient/member/detail?id='+item.id})">
+        <tui-list-cell>
           <div class="tui-msg-box">
           <div class="tui-msg-box">
             <img :src="item.smallAvatar" class="tui-msg-pic" mode="widthFix" />
             <img :src="item.smallAvatar" class="tui-msg-pic" mode="widthFix" />
             <div class="tui-msg-item">
             <div class="tui-msg-item">
@@ -14,8 +14,11 @@
               </div>
               </div>
               <div class="tui-msg-content">
               <div class="tui-msg-content">
                 <span>{{ item.visitTime.substr(5,11) }}</span>
                 <span>{{ item.visitTime.substr(5,11) }}</span>
+                <span style="color:black;margin-left:20upx;">已购 {{ item.hasLimitBuyNum }}</span>
+                <span style="color:black;margin-left:20upx;color:red;font-weight:bold;" v-if="item.hasReachLimitBuyNum == 1">已不能购买</span>
               </div>
               </div>
             </div>
             </div>
+            <button class="admin-button-com blue middle" @click="clearBuy(item)">清空已购</button>
           </div>
           </div>
         </tui-list-cell>
         </tui-list-cell>
       </block>
       </block>
@@ -33,7 +36,7 @@ import appVipModule from "@/components/module/app-vip";
 import AppTag from "@/components/module/app-tag.vue";
 import AppTag from "@/components/module/app-tag.vue";
 import AppSearchModule from "@/components/module/app-search";
 import AppSearchModule from "@/components/module/app-search";
 import { list } from "@/mixins";
 import { list } from "@/mixins";
-import { hasLimitBuyCustomList } from "@/api/item";
+import { hasLimitBuyCustomList,clearOneLimitBuy } from "@/api/item";
 export default {
 export default {
   name: "hasLimitBuyCustom",
   name: "hasLimitBuyCustom",
   components: {
   components: {
@@ -57,6 +60,16 @@ export default {
           this.customList = res.data.customList?res.data.customList:[]
           this.customList = res.data.customList?res.data.customList:[]
         }
         }
       })
       })
+    },
+    clearBuy(info){
+      this.$util.confirmModal({content:'确认清空?清空后客户可重新下单'},() => {
+          clearOneLimitBuy({customId:info.id,productId:this.option.id}).then(res=>{
+            if(res.code == 1){
+              this.$msg('清空成功')
+              this.init()
+            }
+          })
+      })
     }
     }
   }
   }
 };
 };
@@ -91,10 +104,14 @@ export default {
       flex: 1;
       flex: 1;
     }
     }
   }
   }
+.tui-list-cell {
+  width: 100%;
+}
 .tui-msg-box {
 .tui-msg-box {
+  width: 100%;
   display: flex;
   display: flex;
   align-items: center;
   align-items: center;
-
+  justify-content: space-between;
   .tui-msg-pic {
   .tui-msg-pic {
     width: 80upx;
     width: 80upx;
     height: 80upx;
     height: 80upx;
@@ -103,6 +120,8 @@ export default {
   }
   }
 
 
   .tui-msg-item {
   .tui-msg-item {
+    flex: 1;
+    min-width: 0;
     max-width: 500upx;
     max-width: 500upx;
     min-height: 80upx;
     min-height: 80upx;
     overflow: hidden;
     overflow: hidden;
@@ -196,6 +215,10 @@ export default {
       }
       }
     }
     }
   }
   }
+  .admin-button-com {
+    margin-left: 20upx;
+    white-space: nowrap;
+  }
 }
 }
 .tui-msg-right {
 .tui-msg-right {
   max-width: 120upx;
   max-width: 120upx;

+ 4 - 0
ghsApp/src/api/item/index.js

@@ -5,6 +5,10 @@ export const hasLimitBuyCustomList = data => {
 	return https.get('/item/has-limit-buy-custom-list', data)
 	return https.get('/item/has-limit-buy-custom-list', data)
 }
 }
 
 
+export const clearOneLimitBuy = data => {
+	return https.get('/item/clear-one-limit-buy', data)
+}
+
 export const clearLimitBuy = data => {
 export const clearLimitBuy = data => {
 	return https.get('/item/clear-limit-buy', data)
 	return https.get('/item/clear-limit-buy', data)
 }
 }