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

Merge branch 'master' of git.huaml.com:zhh/front-end

zhengxin 5 лет назад
Родитель
Сommit
69bf9af7ea
3 измененных файлов с 41 добавлено и 17 удалено
  1. 32 15
      ghs/src/admin/home/me.vue
  2. 3 0
      ghs/src/api/home/index.js
  3. 6 2
      ghs/src/components/module/dorpdownSelect.vue

+ 32 - 15
ghs/src/admin/home/me.vue

@@ -31,7 +31,7 @@
                         </view>
                         <button 
                             v-if="loginInfo.super"
-                            @click="changeShop"
+                            @click="shopShow"
                             class="admin-button-com default chang-shop_btn">
                             <i class="iconfont iconqiehuan1"></i>
                             切换店铺
@@ -67,7 +67,7 @@
                             可提现余额 ¥ {{infoData.txBalance}}
                         </view>
                     </view>
-                    <button class="admin-button-com default" >提现</button>
+                    <button @click="applyCach" class="admin-button-com default" >提现</button>
                 </view>
                 <view class="module-com content_box user-open_bx">
                     <view class="input-line-wrap">
@@ -82,14 +82,21 @@
                     </view>
                 </view>
             </view>
-        </template>  
-    </view>
+        </template>
+        <DorpdownSelect 
+        ref="dorpdownSelect"
+        :menuObj.sync="menuObj"  
+        top="0px"
+        :isShowTit="false"
+        :selectItemId.sync="shopId"
+        @selectSussess="selectSussess"></DorpdownSelect>
+</view>
 </template>
 
 <script>
     import AppAvatarModule from '@/components/module/app-avatar'
     import TuiListCell from '@/components/plugin/list-cell'
-    import { mainMy } from '@/api/home'
+    import { mainMy,applyCash } from '@/api/home'
     import { toggleShop } from '@/api/common'
     import DorpdownSelect from "@/components/module/dorpdownSelect";
     import { selectShop } from '@/mixins'
@@ -113,6 +120,11 @@
             }
         },
         methods:{
+            shopShow(){
+                this.shopId = this.getLoginInfo.shopId
+                this.$refs.dorpdownSelect.dropdownShow = true;
+                
+            },
            async init(){
                 try {
                     const { data } = await mainMy()
@@ -121,12 +133,12 @@
 
                 }
             },
-            async selectSussess(shopId){
+            async selectSussess(){
                 uni.showLoading({
                     title: '加载中'
                 });
               try {
-                  let {data} = await toggleShop({ shopId});
+                  let {data} = await toggleShop({ shopId:this.shopId});
                   this.$store.commit('setLoginInfo', {
                         ...this.getLoginInfo,
                         shopId: data.shopId, // 门店id
@@ -139,15 +151,20 @@
               }
               
             },
-            changeShop(){
-              let idx = this.userShopAll.findIndex(i=>i.id == this.getLoginInfo.shopId)
-              let shopId = null
-              if(idx === this.userShopAll.length - 1) {
-                  shopId = this.userShopAll[0].id
-              }else{
-                  shopId = this.userShopAll[idx+1].id
+           async applyCach(){
+                uni.showLoading({
+                    title: '加载中'
+                });
+                
+               try {
+                   const { data } = await applyCash({})
+                   uni.showToast({
+                    title: '提现成功',
+                    duration: 2000
+                });
+               }finally {
+                 uni.hideLoading(); 
               }
-              this.selectSussess(shopId)
             }
         }
     }

+ 3 - 0
ghs/src/api/home/index.js

@@ -10,3 +10,6 @@ export const getMainIndex = data => {
 export const mainMy = async (data) => {
 	return https.get("/main/my", data);
 };
+export const applyCash = async (data) => {
+	return https.get("/cash/apply", data);
+};

+ 6 - 2
ghs/src/components/module/dorpdownSelect.vue

@@ -1,6 +1,7 @@
 <template>
     <view class="select-bg_bx">
         <view
+            v-if="isShowTit"
             @click="switchCut"
             :class="['select-title',dropdownShow?'select_corlor':'']">
             {{menuObj.title}}
@@ -76,6 +77,10 @@
             selectItemId:{
                 type:[String,Number],
                 default:''
+            },
+            isShowTit:{
+                type: Boolean,
+                default: true
             }
         },
         data(){
@@ -148,7 +153,6 @@
         .select-title {
             color: #666666;
             font-size: 26px;
-            
             & .iconsanjiao_xia {
                 margin-left: 10px;
             }
@@ -176,7 +180,7 @@
             left: 0;
             z-index: 999;
             // box-shadow: 0 6px 10px #cccccc;
-            padding:40px 30px 40px;
+            padding:120px 30px 40px;
             border-radius: 0px 0px 20px 20px;
             transition: all 0.5s ease-in-out;
             // top: 100px;