shish 4 лет назад
Родитель
Сommit
83330f18c0
2 измененных файлов с 14 добавлено и 18 удалено
  1. 13 17
      ghsApp/src/admin/home/member.vue
  2. 1 1
      ghsApp/src/api/custom/index.js

+ 13 - 17
ghsApp/src/admin/home/member.vue

@@ -5,7 +5,7 @@
         <AppSearchModule placeholder="输入拼音首字母搜索" @input="searchFn"/>
       </view>
       <view style="padding:0 10upx 0 20upx;" >
-        		<button v-if="myShopInfo.default!=1 && myShopInfo.join == 0" class="admin-button-com middle blue" style="margin-right:10upx;" @click="syncFromDefaultShop()">从首店同步</button>
+        <button class="admin-button-com middle blue" style="margin-right:10upx;" @click="showAllShop()">从分店同步</button>
 				<button class="admin-button-com middle blue" @click="pageTo({ url: '/pagesClient/member/addCustomer' })">添加</button>
 			</view>
     </view>
@@ -44,9 +44,9 @@
     </block>
     </div>
     <NotLogin></NotLogin>
+    <ShopSelect ref="shopSelectComponent" class="bar" :isShowTit="false" top="0upx" @selectShopFn="selectShopFn" />
   </view>
 </template>
-
 <script>
 import AppTabs from "@/components/plugin/tabs";
 import NotLogin from "@/components/not-login";
@@ -58,10 +58,11 @@ import AppTag from "@/components/module/app-tag.vue";
 import AppSearchModule from "@/components/module/app-search";
 import { copyCumtomer } from '@/api/custom'
 import { list } from "@/mixins";
-import { getClass, getList } from "@/api/member";
+import { getList } from "@/api/member";
+import ShopSelect from "@/components/module/shopSelect";
 import { mapGetters } from "vuex"
 export default {
-  name: "admin-memebr",
+  name: "memebr",
   components: {
     AppTabs,
     TuiListCell,
@@ -70,7 +71,8 @@ export default {
     appVipModule,
     AppTag,
     AppSearchModule,
-    NotLogin
+    NotLogin,
+    ShopSelect
   },
   mixins: [list],
   data() {
@@ -109,7 +111,6 @@ export default {
       this._list().then((res) => {
         uni.stopPullDownRefresh();
       }).catch(err => {
-        console.log('error', err); //打印捕获的异常是什么
         this.$msg('网络异常,重新加载');
         this.resetList();
         this._list()
@@ -126,14 +127,13 @@ export default {
 		uni.removeStorageSync('newClient');
 	},
   methods: {
-    // init() {
-    //   if(!this.no_shop_show_model) {
-    //     this._list();
-    //   }
-    // },
-    syncFromDefaultShop(){
+    showAllShop () {
+      this.$refs.shopSelectComponent.dropdownShow = true;
+    },
+    selectShopFn(val){
+      let fromShopId = val.id
       uni.showLoading({mask:true})
-      copyCumtomer().then(res => {
+      copyCumtomer({fromShopId}).then(res => {
         this.$msg(res.msg);
       });
     },
@@ -154,9 +154,6 @@ export default {
             return false;
           }
           this.tabs[this.tabIndex].value = res.data.totalNum || 0;
-          // this.tabs[0].value = res.data.totalUser || 0;
-          // this.tabs[1].value = res.data.totalUser || 0;
-          // this.tabs[2].value = res.data.mayGatheringNum || 0;
         }).catch(err => {
           this.$msg('网络异常,重新加载');
           this.resetList();
@@ -243,7 +240,6 @@ export default {
     border-radius: 50%;
     margin-right: 20upx;
   }
-
   .tui-msg-item {
     max-width: 500upx;
     min-height: 80upx;

+ 1 - 1
ghsApp/src/api/custom/index.js

@@ -32,5 +32,5 @@ export const createCumtomer = data => {
 }
 
 export const copyCumtomer = data => {
-	return https.post('/custom/copy-customers', data)
+	return https.get('/custom/copy-customers', data)
 }