diff --git a/App.vue b/App.vue index c0b2923..e748f77 100644 --- a/App.vue +++ b/App.vue @@ -72,6 +72,17 @@ }, onLaunch: function(option) { uni.hideTabBar(); + uni.setTabBarItem({ + index: 1, + visible: false + }) + // #ifdef H5 + uni.setTabBarItem({ + index: 2, + visible: false + }) + // #endif + this.globalData.statusBarHeight = uni.getSystemInfoSync().statusBarHeight + 'px'; this.globalData.uid = this.$store.state.app.uid; @@ -192,6 +203,7 @@ that.getConfigData(); }, onShow() { + let that = this that.$store.commit('SETUUID', uni.getStorageSync('uuid') || that.randomString()); // 记录H5和公众号 diff --git a/api/user.js b/api/user.js index 4dd6776..41cb19c 100644 --- a/api/user.js +++ b/api/user.js @@ -253,6 +253,12 @@ export function getBrokerageRank(q) { export function extractCash(data) { return request.post('user/extract/create', data) } +/** + * 申请提现 + */ +export function getAdminApplyAPI(merId, data) { + return request.get(`admin/${merId}/apply`, data); +} /** * 提现银行/提现最低金额 * diff --git a/manifest.json b/manifest.json index 84e4e98..9c647ac 100644 --- a/manifest.json +++ b/manifest.json @@ -2,8 +2,8 @@ "name" : "惠农生活", "appid" : "__UNI__3A527D1", "description" : "", - "versionName" : "2.0.0", - "versionCode" : 200, + "versionName" : "2.0.02", + "versionCode" : 2002, "transformPx" : false, /* 5+App特有相关 */ "app-plus" : { diff --git a/pages/index/index.vue b/pages/index/index.vue index 6740888..a50d9d8 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -372,6 +372,7 @@ import { HTTP_REQUEST_URL } from '@/config/app'; + import {showTab} from "@/utils/showTab.js"; export default { computed: configMap({ hide_mer_status: 0, @@ -581,12 +582,15 @@ that.isScrolled = res[0].top <= -60 }) }) + if (this.isLogin) { + this.getUserInfo(); + } }, onHide() { uni.setStorageSync('isIntegral', false) }, onReady() { - + }, watch: { globalDatas(nVal, oVal) { @@ -686,7 +690,7 @@ }, getNav() { getNavigation().then(res => { - this.newData = res.data + this.newData = res.data; if (this.newData.status && this.newData.status.status) { uni.hideTabBar() } else { @@ -942,6 +946,7 @@ getUserInfo: function() { let that = this; getUserInfo().then(res => { + showTab(res.data); that.userInfo = res.data; this.$store.commit('SET_USERINFO', res.data); }); diff --git a/pages/user/index.vue b/pages/user/index.vue index fae42fd..98ade27 100644 --- a/pages/user/index.vue +++ b/pages/user/index.vue @@ -82,7 +82,7 @@ --> - + + + + + + + 我的余额 (元) + + + + + ¥{{userInfo.now_money||"0.00"}} + + @@ -291,6 +304,7 @@ import { toLogin } from '@/libs/login.js'; + import {showTab} from "@/utils/showTab.js"; const app = getApp(); export default { components: { @@ -621,6 +635,7 @@ getUserInfo: function() { let that = this; getUserInfo().then(res => { + showTab(res.data); that.userInfo = res.data; that.is_promoter = res.data.is_promoter; that.extension_status = res.data.extension_status; diff --git a/pages/users/order_confirm/index.vue b/pages/users/order_confirm/index.vue index f8f9fb9..4e0cc0a 100644 --- a/pages/users/order_confirm/index.vue +++ b/pages/users/order_confirm/index.vue @@ -374,6 +374,9 @@ {{userInfo.now_money}} + + {{moneyInfo.extract_money}} + @@ -388,7 +391,10 @@ {{item.title}} - {{userInfo.now_money}} + {{userInfo.now_money}} + + + {{moneyInfo.extract_money}} @@ -502,6 +508,7 @@ getAddressDetail, getAddressList, getUserInfo, + getAdminApplyAPI, getAgreementApi } from '@/api/user.js'; import { @@ -596,13 +603,21 @@ title: '可用余额:', payStatus: this.$store.getters.globalData.yue_pay_status, }, + { + "name": "商户余额", + "icon": "icon-yue2", + value: 'merBalance', + title: '可用余额:', + payStatus: 2, + }, { "name": "线下支付", "icon": "icon-yinhangqia", value: 'offline', title: '线下支付', payStatus: 2, - }, { + }, + { "name": "对公转账", "icon": "icon-yinhangqia", value: 'public', @@ -614,7 +629,8 @@ img: 'width:100%;display:block;', video: 'width:100%;' }, - radioList: [{ + radioList: [ + { title: this.deliveryName, check: true }, @@ -728,6 +744,7 @@ addressInfoArea: [], timeranges: [], isShow: false, + moneyInfo: {} }; }, computed: { @@ -785,7 +802,7 @@ this.getaddressInfo(); this.$nextTick(function() { this.$refs.addressWindow.getAddressList(); - this.getUserInfo() + this.getUserInfo(); }) } uni.setStorage({ @@ -798,6 +815,7 @@ * 生命周期函数--监听页面显示 */ onShow: function() { + let that = this; uni.$on("handClick", res => { if (res) { @@ -876,7 +894,14 @@ // 获取个人信息 getUserInfo() { getUserInfo().then(res => { - this.userInfo = res.data + this.userInfo = res.data; + //获取账户金额以及冻结金额 重新调了一次接口 + if(this.userInfo.service&&this.userInfo.service.mer_id) getAdminApplyAPI(this.userInfo.service.mer_id).then(res => { + this.moneyInfo = res.data; + this.cartArr.forEach(item=>{ + if(item.value=='merBalance') item.payStatus=1; + }) + }) }) }, /*获取发票说明*/ diff --git a/utils/showTab.js b/utils/showTab.js new file mode 100644 index 0000000..75b98f8 --- /dev/null +++ b/utils/showTab.js @@ -0,0 +1,23 @@ +// 控制tabbar是否显示 +import store from "@/store/index.js" + +export const showTab = (data)=>{ + let user = data || store.state.app.userInfo; + if(user.mer_info&&user.mer_info.mer_settlement_agree_status){ + uni.setTabBarItem({ + index: 1, + visible: true, + fail:(e)=>{ + console.log(e); + } + }) + }else { + uni.setTabBarItem({ + index: 1, + visible: false, + fail:(e)=>{ + console.log(e); + } + }) + } +} \ No newline at end of file