XiaBx 3 år sedan
förälder
incheckning
6023690b43
2 ändrade filer med 109 tillägg och 81 borttagningar
  1. 2 2
      src/views/My/index.ux
  2. 107 79
      src/views/Pay/index.ux

+ 2 - 2
src/views/My/index.ux

@@ -123,7 +123,7 @@ export default {
     if(user.phone) user.dtel = user.phone.replace(reg, '$1****$2')
     this.user = user;
     let haslogin = (await storage.get({ key: "hasLogin" })).data;
-    this.loginPhone = (await storage.get({ key: "loginPhone" })).data || user.phone;
+    this.loginPhone = (await storage.get({ key: "loginPhone" })).data;
     this.haslogin = haslogin;
     if(!this.send_order_id) this.send_order_id = user.send_order_id;
   },
@@ -148,7 +148,7 @@ export default {
       return false;
     }
     if (page == 'Pay' ) {
-      if (this.send_order_id || ( this.haslogin && this.loginPhone) ) {
+      if ( this.send_order_id || ( this.haslogin && this.loginPhone) ) {
         router.push({
           uri: `/views/${page}`
         })

+ 107 - 79
src/views/Pay/index.ux

@@ -1,80 +1,106 @@
 <template>
-	<div class="pay-wrap">
-		<tabs class="wrap-relative">
-			<tab-content>
-				<div class="wrap-relative">
-					<div class="top-user__wrap">
-						<div class="user-balance">
-							<text>您的余额:</text>
-							<text class="balance">{{balance}}</text>
-							<text>书币</text>
-						</div>
-						<div class="chapter-cost" if="fee">
-							<text>当前需要消耗</text>
-							<text class="cost">{{fee}}</text>
-							<text>书币</text>
-						</div>
-					</div>
-					<div class="charge-wrap">
-						<div class="title">
-							<text class="border"></text>
-							<text>支付方式</text>
-						</div>
-						<div class="pay-type">
-							<block for="item in payType">
-								<div class="pay-type__item {{curPayType === item.value ? 'pay-type__item--cur' : ''}}" @click="changePayType(item)">
-									<image src="{{item.icon}}"></image>
-									<text>{{item.name}}</text>
-								</div>
-							</block>
-						</div>
-						<div class="recharge-list">
-							<block for="charge in rechargeList">
-								<stack class="stack-wrap" @click="changeCharge($idx)">
-									<div class="recharge-item {{curSelect === $idx ? 'recharge-item__select' : ''}}">
-										<text class="price {{curSelect === $idx ? 'price__select' : ''}}">{{charge.price}}</text>
-										<text class="send {{curSelect === $idx ? 'send__select' : ''}}">{{charge.text}}</text>
-										<div class="discount {{curSelect === $idx ? 'discount__select' : ''}}" if="charge.save_text">
-											<block if="!charge.is_year_order">
-												<text>省</text>
-											</block>
-											<block else>
-												<image src="../../assets/imgs/year_pay.png"></image>
-											</block>
-											<text class="discount-num {{curSelect === $idx ? 'discount-num__select' : ''}}">{{charge.save_text}}</text>
-										</div>
-									</div>
-									<image if="charge.today_special" class="recharge-recommend" src="../../assets/imgs/jinri.png"></image>
-								</stack>
-							</block>
-						</div>
-					</div>
-					<div class="notice-wrap">
-						<text class="title">提示:</text>
-						<text class="notice-item">1.书币属虚拟商品,一经购买不得退换</text>
-						<text class="notice-item">2.充值后书币到账可能有延迟,1小时内未到账请到个人中心联系客服</text>
-						<text class="notice-item">3.工作时间:周一 周四 周五 9:00-21:00,周二 周三 周六 周日 9:00-18:00</text>
-					</div>
-				</div>
-			</tab-content>
-		</tabs>
-		<div class="wrap-fixed">
-			<image src="../../assets/imgs/shadow.png" class="shadow"></image>
-			<div class="total-wrap">
-				<div class="total-cost">
-					<text>合计:{{total}}</text>
-					<text class="notice">选择充值金额(1元=100书币)</text>
-				</div>
-				<text class="go-to-pay" @click="toPay">立即充值</text>
-			</div>
-		</div>
-		<div class="loading-wrap" if="showLoading">
-			<div class="loading-content">
-				<progress type="circular"></progress>
-				<text class="loading-text">{{loadingText}}</text>
-			</div>
-		</div>
-	</div>
+  <div class="pay-wrap">
+    <tabs class="wrap-relative">
+      <tab-content>
+        <div class="wrap-relative">
+          <div class="top-user__wrap">
+            <div class="user-balance">
+              <text>您的余额:</text>
+              <text class="balance">{{ balance }}</text>
+              <text>书币</text>
+            </div>
+            <div class="chapter-cost" if="fee">
+              <text>当前需要消耗</text>
+              <text class="cost">{{ fee }}</text>
+              <text>书币</text>
+            </div>
+          </div>
+          <div class="charge-wrap">
+            <div class="title">
+              <text class="border"></text>
+              <text>支付方式</text>
+            </div>
+            <div class="pay-type">
+              <block for="item in payType">
+                <div
+                  class="pay-type__item {{curPayType === item.value ? 'pay-type__item--cur' : ''}}"
+                  @click="changePayType(item)"
+                >
+                  <image src="{{item.icon}}"></image>
+                  <text>{{ item.name }}</text>
+                </div>
+              </block>
+            </div>
+            <div class="recharge-list">
+              <block for="charge in rechargeList">
+                <stack class="stack-wrap" @click="changeCharge($idx)">
+                  <div
+                    class="recharge-item {{curSelect === $idx ? 'recharge-item__select' : ''}}"
+                  >
+                    <text
+                      class="price {{curSelect === $idx ? 'price__select' : ''}}"
+                      >{{ charge.price }}</text
+                    >
+                    <text
+                      class="send {{curSelect === $idx ? 'send__select' : ''}}"
+                      >{{ charge.text }}</text
+                    >
+                    <div
+                      class="discount {{curSelect === $idx ? 'discount__select' : ''}}"
+                      if="charge.save_text"
+                    >
+                      <block if="!charge.is_year_order">
+                        <text>省</text>
+                      </block>
+                      <block else>
+                        <image src="../../assets/imgs/year_pay.png"></image>
+                      </block>
+                      <text
+                        class="discount-num {{curSelect === $idx ? 'discount-num__select' : ''}}"
+                        >{{ charge.save_text }}</text
+                      >
+                    </div>
+                  </div>
+                  <image
+                    if="charge.today_special"
+                    class="recharge-recommend"
+                    src="../../assets/imgs/jinri.png"
+                  ></image>
+                </stack>
+              </block>
+            </div>
+          </div>
+          <div class="notice-wrap">
+            <text class="title">提示:</text>
+            <text class="notice-item">1.书币属虚拟商品,一经购买不得退换</text>
+            <text class="notice-item"
+              >2.充值后书币到账可能有延迟,1小时内未到账请到个人中心联系客服</text
+            >
+            <text class="notice-item"
+              >3.工作时间:周一 周四 周五 9:00-21:00,周二 周三 周六 周日
+              9:00-18:00</text
+            >
+          </div>
+        </div>
+      </tab-content>
+    </tabs>
+    <div class="wrap-fixed">
+      <image src="../../assets/imgs/shadow.png" class="shadow"></image>
+      <div class="total-wrap">
+        <div class="total-cost">
+          <text>合计:{{ total }}</text>
+          <text class="notice">选择充值金额(1元=100书币)</text>
+        </div>
+        <text class="go-to-pay" @click="toPay">立即充值</text>
+      </div>
+    </div>
+    <div class="loading-wrap" if="showLoading">
+      <div class="loading-content">
+        <progress type="circular"></progress>
+        <text class="loading-text">{{ loadingText }}</text>
+      </div>
+    </div>
+  </div>
 </template>
 
 <script>
@@ -84,7 +110,7 @@ import storage from "@system.storage";
 
 import { getChargeList, getUserInfo, checkWxOrder } from "../../api";
 import { configWxPay, configAliPay } from "../../helper";
-import {  getAppConfig } from '../../api/utils.js';
+import { getAppConfig } from '../../api/utils.js';
 let getConfig;
 
 export default {
@@ -108,6 +134,7 @@ export default {
 		showLoading: false,
 		checked: false,
 		phone: '',
+		haslogin: '',
 		isVip: '',
 		last: null,
 		payType: [
@@ -147,7 +174,8 @@ export default {
 		this.balance = userinfo.balance;
 		this.send_order_id = userinfo.send_order_id;
 		this.checked = userinfo.is_check;
-		this.phone = userinfo.phone;
+		this.phone = (await storage.get({ key: "loginPhone" })).data;
+		this.haslogin = (await storage.get({ key: "hasLogin" })).data;
 		this.isVip = userinfo.is_vip;
 		if (userinfo.pay_mode_default == 'weixin') {
 			this.curPayType = 2;
@@ -174,7 +202,7 @@ export default {
 		this.initChargeList();
 	},
 	toPay() {
-		if (this.checked && !this.phone) {
+		if (!(this.send_order_id || (this.haslogin && this.loginPhone))) {
 			prompt.showDialog({
 				title: '友情提示',
 				message: '您还未绑定手机号,请绑定手机号后在进行相关操作',