소스 검색

结算优化

lishanshan 5 달 전
부모
커밋
f747000f76

+ 1 - 1
components/mescroll-uni/components/mescroll-up.css

@@ -1,7 +1,7 @@
 /* 上拉加载区域 */
 .mescroll-upwarp {
 	min-height: 60rpx;
-	padding: 30rpx 0;
+	padding: 10rpx 0;
 	text-align: center;
 	clear: both;
 }

+ 2 - 2
components/mescroll-uni/mescroll-uni-option.js

@@ -6,14 +6,14 @@ const GlobalOption = {
 		textInOffset: '下拉刷新', // 下拉的距离在offset范围内的提示文本
 		textOutOffset: '释放更新', // 下拉的距离大于offset范围的提示文本
 		textLoading: '加载中 ...', // 加载中的提示文本
-		offset: 80, // 在列表顶部,下拉大于80px,松手即可触发下拉刷新的回调
+		offset: 160, // 在列表顶部,下拉大于80px,松手即可触发下拉刷新的回调
 		native: false // 是否使用系统自带的下拉刷新; 默认false; 仅在mescroll-body生效 (值为true时,还需在pages配置enablePullDownRefresh:true;详请参考mescroll-native的案例)
 	},
 	up: {
 		// 其他up的配置参数也可以写,这里只展示了常用的配置:
 		textLoading: '加载中 ...', // 加载中的提示文本
 		textNoMore: '-- END --', // 没有更多数据的提示文本
-		offset: 80, // 距底部多远时,触发upCallback
+		offset: 50, // 距底部多远时,触发upCallback
 		isBounce: false, // 默认禁止橡皮筋的回弹效果, 必读事项: http://www.mescroll.com/qa.html?v=190725#q25
 		toTop: {
 			// 回到顶部按钮,需配置src才显示

+ 4 - 1
components/mescroll-uni/mescroll-uni.vue

@@ -19,7 +19,10 @@
 
 				<!-- 上拉加载区域 (下拉刷新时不显示, 支付宝小程序子组件传参给子子组件仍报单项数据流的异常,暂时不通过mescroll-up组件实现)-->
 				<!-- <mescroll-up v-if="mescroll.optUp.use && !isDownLoading" :option="mescroll.optUp" :type="upLoadType"></mescroll-up> -->
-				<view v-if="mescroll.optUp.use && !isDownLoading" class="mescroll-upwarp" :style="{'background-color':mescroll.optUp.bgColor,'color':mescroll.optUp.textColor}">
+				<view v-if="mescroll.optUp.use && !isDownLoading && !isShowEmpty" class="mescroll-upwarp" :style="{'background-color':mescroll.optUp.bgColor,'color':mescroll.optUp.textColor}">
+          <view v-show="upLoadType===0">
+						<view class="upwarp-tip">上拉加载更多...</view>
+					</view>
 					<!-- 加载中 (此处不能用v-if,否则android小程序快速上拉可能会不断触发上拉回调) -->
 					<view v-show="upLoadType===1">
 						<view class="upwarp-progress mescroll-rotate" :style="{'border-color':mescroll.optUp.textColor}"></view>

+ 9 - 32
pages/finance/accountRecord.vue

@@ -49,36 +49,13 @@ export default {
   data() {
     return {
       navTitle: '账户明细',
-      // Tab选项
       settlementTabs: ['全部', '结算', '提现'],
       accountMenus,
       params: {},
-      // 当前选中的Tab索引
       currentTab: 0,
-      // 从跳转参数获取的type
       type: '',
-      // 是否显示Tab
       showTab: false,
-      // 列表数据
       accountData: [],
-      mescroll: null,
-      // upOption: {
-      //   use: true,
-      //   auto: true,
-      //   page: {
-      //     num: 1,
-      //     size: 10,
-      //   },
-      //   textLoading: '加载中...',
-      //   textNoMore: '-- 暂无更多数据 --',
-      // },
-      // downOption: {
-      //   use: true,
-      //   auto: false,
-      //   offset: 80,
-      //   textDown: '下拉刷新',
-      //   textLoading: '刷新中...',
-      // },
     };
   },
   onLoad(options) {
@@ -101,15 +78,12 @@ export default {
     }
   },
   methods: {
-    // 初始化mescroll
     mescrollInit(mescroll) {
       this.mescroll = mescroll;
     },
-    // 下拉刷新回调
+    // 下拉刷新
     downCallback() {
-      // 重置页码
       this.mescroll.resetUpScroll();
-      // 清空数据列表
       this.accountData = [];
     },
     // 切换Tab
@@ -125,8 +99,8 @@ export default {
         .getAccountList(params)
         .then((res) => {
           if (res.data.code === 200) {
-            const records = res.data.result.records || [];
-            const total = res.data.result.total || 0;
+            const records = res.data.result.records;
+            const total = res.data.result.total;
 
             // 更新数据列表
             if (page.num === 1) {
@@ -136,8 +110,11 @@ export default {
             }
             // 结束上拉加载
             this.mescroll.endSuccess(records.length, total);
-            uni.showTabBar();
+            if (this.accountData.length < 5) {
+              this.$refs.mescrollRef.upLoadType = 'NO_DATA';
+            }
           } else {
+            this.accountData = [];;
             this.mescroll.endErr();
           }
         })
@@ -282,10 +259,10 @@ export default {
   }
 
   .list-box {
-    height: 100%;
+    height: 80vh;
     flex: 1;
     overflow-y: auto;
-    padding: 0 31rpx;
+    padding: 10rpx 31rpx;
     font-size: 28rpx;
     color: #333;
     margin: 17rpx 31rpx;

+ 19 - 16
pages/finance/balance.vue

@@ -19,7 +19,6 @@
           </view>
         </view>
       </view>
-
       <view class="two-box">
         <u-grid :col="4" :border="false">
           <u-grid-item
@@ -39,7 +38,7 @@
       </view>
 
       <view class="thr-box">
-        <u-sticky :offset-top="20" :customNavHeight="44">
+        <u-sticky :offset-top="20" :customNavHeight="54">
           <view class="section-title">
             <view>
               <text>账户明细</text>
@@ -59,7 +58,7 @@
           @up="getList"
           @down="downCallback"
           @init="mescrollInit"
-          :use="false"
+          :use="{ up: true, down: true }"
         >
           <AccountList :list="accountData"></AccountList>
         </mescroll-uni>
@@ -107,8 +106,6 @@ export default {
     // 账户列表
     getList(page) {
       let params = {
-        // mainType: '', // 结算SETTLE 提现WITHDRAW
-        // subType: '', // 进行中PENDING 已提现DONE
         pageNo: page.num,
         pageSize: page.size,
       };
@@ -116,18 +113,19 @@ export default {
         .getAccountList(params)
         .then((res) => {
           if (res.data.code === 200) {
-            const records = res.data.result.records || [];
-            const total = res.data.result.total || 0;
-            if (page.num === 1) {
-              this.accountData = records;
+            const records = res.data.result.records;
+            const total = res.data.result.total;
+            if (records == null && page.num === 1) {
+              this.accountData = [];
             } else {
-              this.accountData = this.accountData.concat(records);
+              this.accountData = records ? this.accountData.concat(records) : this.accountData;
             }
-
             this.mescroll.endSuccess(records.length, total);
-            uni.showTabBar();
+            if (this.accountData.length < 5) {
+              this.$refs.mescrollRef.upLoadType = 'NO_DATA';
+            }
           } else {
-            this.mescroll.hideUpScroll();
+            this.accountData = [];
             this.mescroll.endErr();
           }
         })
@@ -161,11 +159,12 @@ export default {
 
 <style lang="scss" scoped>
 .container {
-  width: 100vw;
+  width: 100%;
   height: 100vh;
-  overflow: auto;
   background: #f7f8fc;
   font-family: Source Han Sans SC;
+  position: fixed;
+  overflow: hidden;
 
   /*#ifdef APP-PLUS*/
   .top {
@@ -273,9 +272,13 @@ export default {
 
     .thr-box {
       margin: 10rpx 31rpx 40rpx;
-      padding: 0 31rpx;
+      padding: 0 31rpx 31rpx;
       background: #ffffff;
       border-radius: 10rpx 10rpx 10rpx 10rpx;
+      max-height: 65vh;
+      overflow-y: auto;
+      display: flex;
+      flex-direction: column;
 
       .section-title {
         width: 100%;

+ 23 - 16
pages/finance/withdrawal.vue

@@ -18,8 +18,9 @@
             height="80"
             placeholder="请输入提现金额"
             :customStyle="{
-              fontSize: '52rpx',
+              fontSize: '42rpx',
               padding: '0 10rpx',
+              marginTop: '10rpx',
             }"
             v-model="withdrawalAmount"
             @input="handleInput"
@@ -60,7 +61,7 @@
         <text>{{ invoiceInfo.taxNo }}</text>
       </view>
       <view class="invoice-info">
-        <text class="title">地址电话</text>
+        <text class="title">地址详情</text>
         <text class="value">{{ invoiceInfo.address }} {{ invoiceInfo.phone }}</text>
       </view>
       <view class="invoice-info last">
@@ -70,7 +71,7 @@
     </view>
 
     <view class="form-card">
-      <view class="label"><text class="required">*</text>上传发票 <i class="text-bg"></i></view>
+      <view class="label">上传发票 <i class="text-bg"></i></view>
       <u-upload
         ref="uUpload"
         :action="action"
@@ -96,7 +97,7 @@
         type="primary"
         :disabled="!withdrawalAmount || parseFloat(withdrawalAmount) <= 0 || isExceeded"
         @click="applyWithdrawal"
-        >申请提现</u-button
+        >提现</u-button
       >
     </view>
   </view>
@@ -190,13 +191,13 @@ export default {
     },
     // 申请提现
     applyWithdrawal() {
-      if (!this.uploadedFiles.length) {
-        uni.showToast({
-          title: '请上传发票',
-          icon: 'none',
-        });
-        return;
-      }
+      // if (!this.uploadedFiles.length) {
+      //   uni.showToast({
+      //     title: '请上传发票',
+      //     icon: 'none',
+      //   });
+      //   return;
+      // }
       uni.showLoading({ title: '提交中' });
       api
         .applyWithdrawal({
@@ -214,7 +215,7 @@ export default {
                 url: '/pages/finance/submitted',
               });
             }, 1500);
-          }else {
+          } else {
             uni.hideLoading();
             uni.showToast({ title: res.data.message, icon: 'none' });
           }
@@ -240,6 +241,8 @@ export default {
   .fix {
     position: sticky;
     top: 0;
+    z-index: 999;
+
     /*#ifdef APP-PLUS*/
     .top {
       width: 100%;
@@ -403,12 +406,10 @@ export default {
   border-bottom: none;
 }
 
-.required {
-  color: #ff4d4f;
-}
-
 // 底部按钮
 .footer-bar {
+  z-index: 999;
+
   ::v-deep .u-btn {
     width: 100%;
     height: 76rpx;
@@ -419,4 +420,10 @@ export default {
     }
   }
 }
+
+::v-deep {
+  .u-delete-icon {
+    background-color: rgb(0, 0, 0, 0.6) !important;
+  }
+}
 </style>

+ 5 - 75
pages/finance/withdrawalDetails.vue

@@ -40,34 +40,12 @@
           <view class="value">{{ cashInfo.withdrawNo }}</view>
         </view>
 
-        <view class="info">
+        <view v-if="cashInfo.invoiceImgs && cashInfo.invoiceImgs.length" class="info">
           <view class="label">发票</view>
           <view class="value view-btn" @click="openInvoicePopup">查看</view>
         </view>
       </view>
     </view>
-
-    <!-- 查看发票弹窗 -->
-    <u-popup v-model="showInvoicePopup" mode="center" :round="20" closeable>
-      <view class="invoice-popup">
-        <view class="invoice-slider">
-          <swiper
-            :current="currentIndex"
-            @change="onSwiperChange"
-            circular
-            indicator-dots
-            indicator-color="#ffffff"
-            indicator-active-color="#ff0000"
-          >
-            <swiper-item v-for="(item, index) in cashInfo.invoiceImgs" :key="index">
-              <view class="invoice-item">
-                <image :src="item" mode="aspectFit"></image>
-              </view>
-            </swiper-item>
-          </swiper>
-        </view>
-      </view>
-    </u-popup>
   </view>
 </template>
 
@@ -82,7 +60,6 @@ export default {
       cashInfo: {},
       showInvoicePopup: false,
       reviewIcon: 'processing',
-      currentIndex: 0,
     };
   },
   onLoad(options) {
@@ -116,10 +93,10 @@ export default {
       uni.navigateBack();
     },
     openInvoicePopup() {
-      this.showInvoicePopup = true;
-    },
-    onSwiperChange(e) {
-      this.currentIndex = e.detail.current;
+      uni.previewImage({
+        urls: this.cashInfo.invoiceImgs,
+        current: this.cashInfo.invoiceImgs[0],
+      });
     },
   },
 };
@@ -230,51 +207,4 @@ export default {
     color: #449aff;
   }
 }
-
-/* 发票弹窗样式 */
-.invoice-popup {
-  width: 100vw;
-  height: 100vh;
-  background: #000000;
-  border-radius: 10rpx;
-  padding: 20rpx;
-  position: relative;
-}
-
-.close-btn {
-  position: absolute;
-  top: 10rpx;
-  right: 10rpx;
-  width: 40rpx;
-  height: 40rpx;
-  z-index: 10;
-}
-
-.close-btn image {
-  width: 100%;
-  height: 100%;
-}
-
-.invoice-slider {
-  width: 100%;
-  margin-top: 50%;
-}
-
-.invoice-item {
-  width: 100%;
-  display: flex;
-  justify-content: center;
-  align-items: center;
-}
-
-::v-deep {
-  uni-swiper .uni-swiper-wrapper {
-    width: 100vw;
-    height: 100vh;
-  }
-
-  uni-swiper .uni-swiper-dots-horizontal {
-    bottom: 50%;
-}
-}
 </style>

+ 1 - 1
pages/index/index.vue

@@ -22,7 +22,7 @@
 					<span>{{income}}</span>收益
 				</view>
 				<view class="item" @click="goUser">
-					<span>{{newCustomer}}</span>新客
+					<span>{{newCustomer || 0}}</span>新客
 				</view>
 			</view>
 		</view>

BIN
static/tabbar/finance_select_tab.png


BIN
static/tabbar/finance_tab.png