|
|
@@ -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)
|
|
|
}
|
|
|
}
|
|
|
}
|