Ver código fonte

出行和邀请功能调整

vaecebyZ 9 meses atrás
pai
commit
3f99847b8b
5 arquivos alterados com 30 adições e 13 exclusões
  1. 4 2
      invite/index.vue
  2. 15 8
      invite/wallet/withdraw.vue
  3. 1 0
      pages.json
  4. 1 0
      trip/index/index.vue
  5. 9 3
      utils/request.js

+ 4 - 2
invite/index.vue

@@ -6,7 +6,7 @@
     <view class="info-card">
       <view class="header">
         <view class="titile">我的邀请</view>
-        <view class="btn" @click="jump('/invite/wallet/withdraw')">
+        <view class="btn" @click="jump('/invite/wallet/withdraw?amount='+amount)">
           <view>去提现</view>
           <image class="icon" src="/static/right-arrow.png"></image>
         </view>
@@ -54,6 +54,7 @@ export default {
         success: 0,
         totalAmount: 0,
       },
+      amount:0,
       currency: currency
 
     };
@@ -74,7 +75,8 @@ export default {
     getWallet().then(({ content }) => {
       if (content) {
         if (content.id) {
-          uni.setStorageSync('walletId', content.id)
+          uni.setStorageSync('walletId', content.id);
+          this.amount = content.amount
         }
       }
     })

+ 15 - 8
invite/wallet/withdraw.vue

@@ -29,13 +29,13 @@
 
     </view>
     <view class="btn">
-      <u-button color="#1F1F1F" @click="submit" size="large" shape="circle">确定</u-button>
+      <u-button color="#1F1F1F" :loading="loading" @click="submit" size="large" shape="circle">确定</u-button>
     </view>
   </view>
 </template>
 
 <script>
-import { transfer } from '@/api/wallet'
+import { transfer, getWallet } from '@/api/wallet'
 import currency from "@/utils/currency"
 export default {
   data() {
@@ -68,13 +68,12 @@ export default {
               uni.showToast({
                 title: '提现成功',
                 icon: 'success',
-                duration: 2000
+                duration: 5000
               });
-              setTimeout(() => {
-                uni.navigateBack();
-              }, 2000);
+              this.getWallet()
+              this.price = null
             }
-            uni.hideLoading();
+            uni.hideLoading({ noConflict: true });
           }
         )
       } else {
@@ -83,14 +82,22 @@ export default {
           icon: 'none',
           duration: 2000
         });
+        this.price = null
         this.loading = false
-        uni.hideLoading();
+        uni.hideLoading({ noConflict: true });
       }
     },
     getAll() {
       if (this.amount > 0) {
         this.price = this.amount / 100;
       }
+    },
+    getWallet() {
+      getWallet().then(({ content }) => {
+        if (content) {
+          this.amount = content.amount
+        }
+      })
     }
   },
   onShow() {

+ 1 - 0
pages.json

@@ -369,6 +369,7 @@
 					"path": "index/index",
 					"style": {
 						"navigationBarTitleText": "出行",
+						"navigationStyle": "custom",
 						"disableScroll": true
 					}
 				},

+ 1 - 0
trip/index/index.vue

@@ -1,5 +1,6 @@
 <template>
 	<view class="trip">
+		<zs-header title="出行" color="#000" ></zs-header>
 		<map id="Map" class="map" style="width: 100%;" :longitude="longitude" :latitude="latitude" 
 			:includePoints="includePoints" enable-poi :polyline="polyline" show-location :markers="markers"
 			@regionchange="mapChange">

+ 9 - 3
utils/request.js

@@ -24,6 +24,7 @@ export let request = (options) => {
 							return uni.showToast({
 								title: '获取失败',
 								icon: 'error',
+								duration: 5000
 							})
 							// uni.hideLoading()
 						} else if (res.data.msg != '成功') { //接口返回报错
@@ -39,12 +40,14 @@ export let request = (options) => {
 								'AuthenticationCredentialsNotFoundException') {
 									uni.showToast({
 										title: '登录过期',
-										icon: 'error'
+										icon: 'error',
+										duration: 5000
 									})
 								if (uni.getStorageSync('refreshToken') && uni.getStorageSync('token') ) {
 									// 刷新token
 									uni.showLoading({
 										title: '刷新登录中',
+										duration: 5000
 									})
 									uni.request({
 											url: BASE_URL + '/zswl-cloud-bdb/user/refreshToken',
@@ -57,7 +60,8 @@ export let request = (options) => {
 												if (r.data.content == '刷新令牌错误') {
 													uni.showToast({
 														title: '登录失效',
-														icon: 'fail'
+														icon: 'fail',
+														duration: 5000
 													})
 													uni.clearStorageSync()
 													uni.reLaunch({
@@ -114,7 +118,9 @@ export let request = (options) => {
 				//请求失败
 				fail: (err) => {
 					uni.showToast({
-						title: '请求接口失败'
+						title: '请求接口失败',
+						icon:"none",
+						duration: 5000
 					})
 					reject(err)
 				}