Răsfoiți Sursa

Merge branch 'main' of https://gitlab.com/tea28/client

DaMoWang 3 ani în urmă
părinte
comite
56a462ee98

+ 46 - 0
src/main.js

@@ -35,6 +35,52 @@ Vue.prototype.tidyTpye = (da) => {
     }
 }
 
+Number.prototype.toFixed = function (n) {
+ 
+    if (n > 20 || n < 0) {
+        throw new RangeError('toFixed() digits argument must be between 0 and 20');
+    }
+    const number = this;
+    if (isNaN(number) || number >= Math.pow(10, 21)) {
+        return number.toString();
+    }
+  
+    if (typeof (n) == 'undefined' || n == 0) {
+        return (Math.round(number)).toString();
+    }
+    let result = number.toString();
+    const arr = result.split('.');
+    // 整数的情况
+    if (arr.length < 2) {
+        result += '.';
+        for (let i = 0; i < n; i += 1) {
+            result += '0';
+        }
+        return result;
+    }
+    const integer = arr[0];
+    const decimal = arr[1];
+    if (decimal.length == n) {
+        return result;
+    }
+  
+    if (decimal.length < n) {
+        for (let i = 0; i < n - decimal.length; i += 1) {
+            result += '0';
+        }
+        return result;
+    }
+    result = integer + '.' + decimal.substr(0, n);
+    const last = decimal.substr(n, 1);
+    // 四舍五入,转换为整数再处理,避免浮点数精度的损失
+    if (parseInt(last, 10) >= 5) {
+        const x = Math.pow(10, n);
+        result = (Math.round((parseFloat(result) * x)) + 1) / x;
+        result = result.toFixed(n);
+    }
+    return result;
+  }
+
 // 自动适配接口域名
 import hosts from "@/request/config";
 Vue.prototype.$hosts = hosts;

+ 2 - 2
src/pages/my/index.vue

@@ -47,8 +47,8 @@
 				<view class="acc_head flex_r flex_ac flex_jb">
 					<view class="acc_price">账号余额¥<text>{{ userinfo.user_money }}</text></view>
 					<view class="C flex_r flex_ac">
-						<navigator class="recharge flex_r flex_ac flex_jc" url="/pages/top-up/index" hover-class="none">
-							充值</navigator>
+						<!-- <navigator class="recharge flex_r flex_ac flex_jc" url="/pages/top-up/index" hover-class="none">
+							充值</navigator> -->
 						<view class="withdraw flex_r flex_ac flex_jc" @tap="getToCash">提现</view>
 					</view>
 				</view>

+ 2 - 0
src/pagesB/invoice/Billingresult.vue

@@ -35,6 +35,8 @@
 </template>
 <script>
 import { get, post } from '@/request/api.js';
+let app=getApp();
+var appEv = app.$vm.$options;
 export default {
   name: 'Billing-result',
   data () {

+ 12 - 1
src/pagesB/invoice/editinvoice.vue

@@ -1,7 +1,11 @@
 <template>
   <div class="editinvoice">
     <div class="top">
-      <span>本次共选择{{ list.length }}个订单,合计¥{{ money }}</span>
+      <span
+        >本次共选择{{ list.length }}个订单,合计¥{{
+          (money * 1).toFixed(2)
+        }}</span
+      >
     </div>
     <div class="tit">发票详情</div>
     <div class="formBar">
@@ -115,6 +119,8 @@
 <script>
 import uniPopup from "@/components/uni-popup/uni-popup.vue";
 import { get, post } from "@/request/api.js";
+let app = getApp();
+var appEv = app.$vm.$options;
 export default {
   name: "editinvoice",
   components: {
@@ -142,6 +148,10 @@ export default {
   onHide() {},
   methods: {
     onsubmitBtn() {
+      if (!this.email || !this.gmf_nsrsbh || !this.gmf_mc) {
+        appEv.errTips("请完整填写资料");
+        return;
+      }
       this.$refs.uniPopup.open();
     },
     // 点击关闭弹窗
@@ -233,6 +243,7 @@ page {
     .ico {
       width: 32rpx;
       height: 32rpx;
+      margin-right: 6rpx;
     }
     .txt,
     .ico {

+ 1 - 1
src/pagesB/invoice/invoiceList.vue

@@ -9,7 +9,7 @@
             </div>
             <div class="p2 flex_r flex_jb">
                 <div class="tit ellipsis1">电子发票</div>
-                <span class="money">金额{{ item.money }}</span>
+                <span class="money">金额{{ item.money.toFixed(2) }}</span>
             </div>
         </div>
       </div>

+ 2 - 2
src/pagesB/my/assistant.vue

@@ -32,7 +32,7 @@
                 <div class="tit ellipsis1">{{ item.goods_name }}</div>
                 <div class="num">数量 x{{ item.goods_num }}</div>
                 <div class="money flex_r flex_jb">
-                  <span>金额{{ item.total_amount }}</span>
+                  <span>金额{{ item.order_amount }}</span>
                   <!-- <span>奖励茶宝36</span> -->
                 </div>
               </div>
@@ -125,7 +125,7 @@ export default {
       for (let i of this.list) {
         if (i.isclick) {
           this.trueTotal++;
-          this.money = this.money + i.total_amount * 1;
+          this.money = this.money + i.order_amount * 1;
         }
       }
     },