Sfoglia il codice sorgente

Merge branch 'master' of iqiyoo:zhuishuyun_quickapp_front

XiaBx 3 anni fa
parent
commit
845ca4b638

BIN
src/assets/imgs/angrey.png


+ 5 - 7
src/assets/less/pay.less

@@ -8,7 +8,7 @@
 
   .wrap-fixed {
     flex-direction: column;
-    
+
     .total-wrap {
       height: 120px;
       flex-shrink: 0;
@@ -68,10 +68,9 @@
 
     .chapter-cost {
       text {
-        font-size: 24px;
+        font-size: 32px;
         color: #666;
       }
-
       .cost {
         color: #ff6060;
         font-weight: bold;
@@ -185,7 +184,7 @@
             color: #fff;
             padding: 0 10px;
           }
-          
+
           .discount-num {
             color: #ff9470;
             background-color: #fff;
@@ -199,7 +198,6 @@
           &__select {
             border-color: #ff393a;
             background-color: #ff393a;
-
           }
         }
 
@@ -249,7 +247,7 @@
     bottom: 0;
     left: 0;
     right: 0;
-    background-color: rgba(0, 0, 0, .6);
+    background-color: rgba(0, 0, 0, 0.6);
     justify-content: center;
     align-items: center;
 
@@ -267,4 +265,4 @@
       }
     }
   }
-}
+}

+ 10 - 1
src/manifest.json

@@ -62,7 +62,7 @@
     "logLevel": "debug"
   },
   "router": {
-    "entry": "views/Index",
+    "entry": "views/Cancellation",
     "pages": {
       "views/Index": {
         "component": "index"
@@ -133,6 +133,9 @@
       "views/Agreement": {
         "component": "index"
       },
+      "views/Cancellation": {
+        "component": "index"
+      },
       "views/Privacy": {
         "component": "index"
       },
@@ -193,6 +196,12 @@
           "menubar": false
         }
       },
+      "views/Cancellation": {
+        "titleBarText": "注销账户",
+        "menubarData": {
+          "menubar": false
+        }
+      },
       "views/Share": {
         "titleBarText": "分享",
         "menubarData": {

+ 137 - 0
src/views/Cancellation/index.ux

@@ -0,0 +1,137 @@
+<template>
+  <div class="cancellation-page">
+    <div class="cancellation-page-wrap">
+      <image
+        src="../../assets/imgs/angrey.png"
+        class="cancellation-img"
+      ></image>
+      <text class="issure">
+        确定注销当前账号吗
+      </text>
+      <text class="issure_msg">
+        注销后你将无法使用当前账号,相关数据也将被删除
+      </text>
+      <text class="issure_msg">
+        无法找回
+      </text>
+      <div class="current_account">
+        <text>当前账号:{{ 1123 }}</text>
+      </div>
+    </div>
+    <div class="notify-things">
+      <text>注销前需要注意以下事项</text>
+    </div>
+    <div class="clean_money">
+      <div class="clean_money_wrap">
+        <text>账户书币余额清零</text>
+        <text>当前书币余额{{ 12 }}</text>
+      </div>
+      <div class="handle-button">
+        <text>
+          去处理
+        </text>
+      </div>
+    </div>
+    <div class="cancellation-button">
+      <text class="cancellation-button-wrap" @click="signToday">
+        立即注销
+      </text>
+    </div>
+  </div>
+</template>
+
+<script>
+export default {
+  private: {}
+}
+</script>
+
+<style lang="less">
+.cancellation-page {
+  flex-direction: column;
+  background-color: #f2f2f2;
+  .cancellation-page-wrap {
+    margin-top: 10px;
+    padding-bottom: 50px;
+    width: 100%;
+    flex-direction: column;
+    align-items: center;
+    background-color: #fff;
+    .cancellation-img {
+      margin-top: 60px;
+      margin-bottom: 30px;
+    }
+    .issure {
+      font-size: 32px;
+      font-weight: 600;
+      margin-bottom: 30px;
+    }
+    .issure_msg {
+      font-size: 26px;
+    }
+    .current_account {
+      margin-top: 20px;
+      flex-direction: row;
+      background-color: #f5f5f5;
+      border-radius: 10px;
+      color: #000000;
+      font-size: 26px;
+      width: 339px;
+      padding: 10px;
+      border-radius: 30px;
+      text {
+        margin: 0 auto;
+      }
+    }
+  }
+  .notify-things {
+    margin-top: 30px;
+    margin-bottom: 2px;
+    background-color: #fff;
+    padding: 30px;
+    text {
+      padding: 20px;
+      font-size: 30px;
+      font-weight: 500;
+    }
+  }
+  .clean_money {
+    padding: 30px;
+    background-color: #fff;
+    margin-top: 2px;
+    justify-content: space-between;
+    .clean_money_wrap {
+      flex-direction: column;
+    }
+    .handle-button {
+      background-color: #f34d2c;
+      border-radius: 30px;
+      width: 120px;
+      height: 50px;
+      text {
+        color: #ffffff;
+        text-align: center;
+        margin: 0 auto;
+      }
+    }
+  }
+  .cancellation-button {
+    padding: 30px;
+    flex-direction: row;
+    margin-top: 50px;
+    border-radius: 10px;
+    color: #000000;
+    align-items: center;
+    padding: 10px;
+    .cancellation-button-wrap {
+      font-size: 26px;
+      background-color: #cccccc;
+      border-radius: 70px;
+      height: 70px;
+      width: 550px;
+      margin: 0 auto;
+      text-align: center;
+    }
+  }
+}
+</style>

+ 54 - 48
src/views/My/index.ux

@@ -2,31 +2,36 @@
   <div class="user-wrap">
     <stack>
       <div class="user-info__wrap">
-        <image src="../../assets/imgs/user_login.png" if="{{haslogin && loginPhone}}"></image>
-        <image src="../../assets/imgs/user_logo.png" else ></image>
+        <image
+          src="../../assets/imgs/user_login.png"
+          if="{{haslogin && loginPhone}}"
+        ></image>
+        <image src="../../assets/imgs/user_logo.png" else></image>
         <div class="uesr-info__message">
-          <text class="user-name" if="{{haslogin && loginPhone}}">书友{{user.id}}</text>
+          <text class="user-name" if="{{haslogin && loginPhone}}"
+            >书友{{ user.id }}</text
+          >
           <text class="un-Login" else>未登录</text>
           <text>ID:{{ user.id }}</text>
           <!-- <text class="vip-card" if="{{user.is_vip}}">免费阅读卡还剩{{ user.vip_days }}</text> -->
         </div>
-        
       </div>
-        <div class="my-collect">
-            <div class="collect-content">
-              <text class="collect-info"><span class="title">我的账户</span><span class="vip-card" if="{{user.is_vip}}">免费阅读卡还剩{{ user.vip_days }}天</span></text>
-              <text class="book_coin">书币:{{ user.balance }}</text>
-            </div>
-            <text  class="pay-btn" @click="pageChange('Pay')">充值</text>
+      <div class="my-collect">
+        <div class="collect-content">
+          <text class="collect-info"
+            ><span class="title">我的账户</span
+            ><span class="vip-card" if="{{user.is_vip}}"
+              >免费阅读卡还剩{{ user.vip_days }}天</span
+            ></text
+          >
+          <text class="book_coin">书币:{{ user.balance }}</text>
         </div>
+        <text class="pay-btn" @click="pageChange('Pay')">充值</text>
+      </div>
     </stack>
-   
 
     <div class="operator-item__wrap">
-      <div
-        class="operator-item"
-        @click="pageChange('Task')"
-      >
+      <div class="operator-item" @click="pageChange('Task')">
         <div class="item-name">
           <image src="../../assets/imgs/task.png"></image>
           <text class="orange">每日做任务,小说免费读</text>
@@ -71,7 +76,7 @@
           <image class="arrow" src="../../assets/imgs/arrow-right.png"></image>
         </div>
       </div>
-     
+
       <div class="operator-item" @click="pageChange('Phone')">
         <div class="item-name">
           <image src="../../assets/imgs/binding.png"></image>
@@ -87,16 +92,20 @@
     </div>
 
     <div class="bottom-info">
-      <text  @click="pageChange('Agreement')">用户协议</text><text class="line">|</text><text  @click="pageChange('Privacy')">隐私协议</text>
+      <text @click="pageChange('Agreement')">用户协议</text
+      ><text class="line">|</text
+      ><text @click="pageChange('Privacy')">隐私协议</text
+      ><text class="line">|</text
+      ><text @click="pageChange('Cancellation')">用户注销</text>
     </div>
   </div>
 </template>
 
 <script>
-import router from "@system.router";
-import { getUserInfo } from "../../api/index";
-import prompt from '@system.prompt';
-import storage from '@system.storage';
+import router from '@system.router'
+import { getUserInfo } from '../../api/index'
+import prompt from '@system.prompt'
+import storage from '@system.storage'
 export default {
   props: {
     tabindex: {
@@ -109,25 +118,25 @@ export default {
       user: {},
       haslogin: undefined,
       loginPhone: undefined,
-      send_order_id: '',
+      send_order_id: ''
     }
   },
   async onInit() {
-    this.$watch('tabindex', 'watchPropsChange');
-    this.$on('refreshData', this.broadevt);
+    this.$watch('tabindex', 'watchPropsChange')
+    this.$on('refreshData', this.broadevt)
   },
   async getUser() {
-    let user = await getUserInfo();
-    this.user = user;
-    this.haslogin = (await storage.get({ key: "hasLogin" })).data;
-    this.loginPhone = (await storage.get({ key: "loginPhone" })).data;
-    if (!this.send_order_id) this.send_order_id = user.send_order_id;
+    let user = await getUserInfo()
+    this.user = user
+    this.haslogin = (await storage.get({ key: 'hasLogin' })).data
+    this.loginPhone = (await storage.get({ key: 'loginPhone' })).data
+    if (!this.send_order_id) this.send_order_id = user.send_order_id
   },
   async watchPropsChange(v) {
     if (v === 2) {
-      let s = (await storage.get({ key: "send_order_id" })).data;
-      if (s) this.send_order_id = s;
-      this.getUser();
+      let s = (await storage.get({ key: 'send_order_id' })).data
+      if (s) this.send_order_id = s
+      this.getUser()
     }
   },
   broadevt(evt) {
@@ -136,12 +145,12 @@ export default {
     }
   },
   showCustomerQrcode() {
-    this.$emit('customer');
+    this.$emit('customer')
   },
   pageChange(page) {
     if (page == 'Phone' && this.haslogin) {
-      this.loginOut();
-      return false;
+      this.loginOut()
+      return false
     }
     if (page == 'Pay') {
       if (this.send_order_id || (this.haslogin && this.loginPhone)) {
@@ -158,8 +167,6 @@ export default {
         uri: `/views/${page}`
       })
     }
-
-
   },
   toUrl(url) {
     router.push({
@@ -167,7 +174,7 @@ export default {
     })
   },
   loginOut() {
-    let self = this;
+    let self = this
     prompt.showDialog({
       title: '提示',
       message: '确认是否要退出登录?',
@@ -181,7 +188,7 @@ export default {
           color: '#9900FF'
         }
       ],
-      success: function (data) {
+      success: function(data) {
         if (data.index == 1) {
           prompt.showToast({
             message: '取消操作'
@@ -193,31 +200,31 @@ export default {
           console.log(data)
           storage.delete({
             key: 'hasLogin',
-            success: function (data) {
-              self.getUser();
+            success: function(data) {
+              self.getUser()
               console.log('handling success')
             },
-            fail: function (data, code) {
+            fail: function(data, code) {
               console.log(`handling fail, code = ${code}`)
             }
           })
           storage.delete({
             key: 'loginPhone',
-            success: function (data) {
+            success: function(data) {
               console.log('handling success')
             },
-            fail: function (data, code) {
+            fail: function(data, code) {
               console.log(`handling fail, code = ${code}`)
             }
           })
         }
       },
-      cancel: function () {
+      cancel: function() {
         prompt.showToast({
           message: '取消操作'
         })
       },
-      fail: function (data, code) {
+      fail: function(data, code) {
         console.log(`handling fail, code = ${code}`)
       }
     })
@@ -226,6 +233,5 @@ export default {
 </script>
 
 <style lang="less">
-@import "../../assets/less/my.less";
+@import '../../assets/less/my.less';
 </style>
-

+ 254 - 229
src/views/Pay/index.ux

@@ -4,16 +4,16 @@
       <tab-content>
         <div class="wrap-relative">
           <div class="top-user__wrap">
+            <div class="chapter-cost" if="fee">
+              <text>当前需要消耗:</text>
+              <text class="cost">{{ fee }}</text>
+              <text>书币</text>
+            </div>
             <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">
@@ -104,235 +104,260 @@
 </template>
 
 <script>
-import router from '@system.router';
-import prompt from '@system.prompt';
-import storage from "@system.storage";
+import router from '@system.router'
+import prompt from '@system.prompt'
+import storage from '@system.storage'
 
-import { getChargeList, getUserInfo, checkWxOrder } from "../../api";
-import { configWxPay, configAliPay } from "../../helper";
-import { getAppConfig } from '../../api/utils.js';
-let getConfig;
+import { getChargeList, getUserInfo, checkWxOrder } from '../../api'
+import { configWxPay, configAliPay } from '../../helper'
+import { getAppConfig } from '../../api/utils.js'
+let getConfig
 
 export default {
-	public: {
-		push_id: "",
-	},
-	protected: {
-		bid: "",
-		code: "",
-		fee: ""
-	},
-	private: {
-		pay_back: 0,
-		curPayType: 2,
-		curSelect: 0,
-		balance: 0,
-		send_order_id: 0,
-		total: "0元",
-		loadingText: "订单查询中...",
-		isInPay: false,
-		showLoading: false,
-		checked: false,
-		loginPhone: '',
-		haslogin: '',
-		isVip: '',
-		last: null,
-		payType: [
-			{
-				name: "支付宝",
-				icon: "http://newycsd.oss-cn-hangzhou.aliyuncs.com/images/base/logo/zhifubao.jpg",
-				value: 1
-			},
-			{
-				name: "微信",
-				icon: "http://newycsd.oss-cn-hangzhou.aliyuncs.com/images/base/logo/weixin.jpg",
-				value: 2
-			}
-		],
-		rechargeList: []
-	},
-	//函数节流
-	throttle(fun, delay) {
-		let last = this.last;
-		const now = + new Date();
-		if (now - last > delay) {
-			fun();
-			this.last = now;
-		} else {
-			console.log('间隔太短了')
-		}
-	},
-	changePayType(type) {
-		this.curPayType = type.value;
-	},
-	changeCharge(key) {
-		this.curSelect = key;
-		this.total = this.rechargeList[key].price;
-	},
-	async getUserInfo() {
-		let userinfo = await getUserInfo();
-		this.balance = userinfo.balance;
-		this.send_order_id = userinfo.send_order_id;
-		this.checked = userinfo.is_check;
-		this.loginPhone = (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;
-		} else {
-			this.curPayType = 1;
-		}
-	},
-	async initChargeList() {
-		this.rechargeList = await getChargeList();
-		this.rechargeList.forEach((p, k) => {
-			if (p.today_special) {
-				this.curSelect = k;
-				this.total = this.rechargeList[k].price;
-			}
-		})
-	},
-	async onInit() {
-		if (this.push_id) {
-			await storage.set({ key: "push_id", value: this.push_id });
-		}
-		getConfig = getAppConfig(this);
-		let { pay_back_alert_show } = await getConfig('task_center');
-		this.pay_back = pay_back_alert_show;
-		this.initChargeList();
-	},
-	toPay() {
-		if (!(this.send_order_id || (this.haslogin && this.loginPhone))) {
-			prompt.showDialog({
-				title: '友情提示',
-				message: '您还未绑定手机号,请绑定手机号后在进行相关操作',
-				buttons: [
-					{
-						text: '前往绑定',
-						color: '#33dd44'
-					}
-				],
-				success: function (data) {
-					router.push({
-						uri: '/views/Phone'
-					})
-				},
-				cancel: function () {
-					console.log('取消绑定')
-				},
-			})
-		} else {
-			this.throttle(() => { this.payFunc() }, 1000)
-		}
-	},
-	async payFunc() {
-		let cur_pay_type = this.curPayType;
-		let product_id = this.rechargeList[this.curSelect].product_id;
-		let ret = null;
-		if (cur_pay_type === 1) {
-			ret = await configAliPay({ product_id: product_id, bid: this.bid, send_order_id: this.send_order_id });
-		}
-		else {
-			ret = await configWxPay({ product_id: product_id, bid: this.bid, send_order_id: this.send_order_id });
-		}
-		// 成功支付后的回调操作
-		if (ret.code === "9000") this.showWaitingWrap(ret);
-		else this.showToastByCode(ret.code);
-	},
-	checkOrder(order_info) {
-		this.showLoading = true;
-		let { data, order } = order_info;
-		let times = 10;
-		this.loadingText = `订单查询中...${times}s`;
-		this.timer = setInterval(async () => {
-			if (times === 0) clearInterval(this.timer), this.showToastByCode("6004");
-			else {
-				times--;
-				this.loadingText = `订单查询中...${times}s`;
-				let fb = await checkWxOrder(order);
-				if (fb && typeof fb === "object") clearInterval(this.timer), this.showToastByCode("9000");
-			}
-		}, 1000);
-	},
-	showWaitingWrap(order) {
-		prompt.showDialog({
-			title: "支付结果",
-			message: "请确认支付结果",
-			buttons: [
-				{
-					text: "已支付",
-					color: "#EF5952"
-				},
-				{
-					text: "重新选择金额",
-					color: "#999"
-				}
-			],
-			success: (data) => {
-				if (data.index === 0) this.checkOrder(order);
-			},
-			cancel: () => {
-				console.log("cancel");
-			}
-		});
-	},
-	showToastByCode(code) {
-		this.showLoading = false;
-		let msg = "支付成功!";
-		switch (code) {
-			case "9000": (msg = "支付成功!", router.back()); break;
-			case "8000": msg = "订单已提交,请等待结果"; break;
-			case "4000": msg = "订单支付失败!"; break;
-			case "5000": msg = "订单重复!"; break;
-			case "6001": msg = "您已取消支付"; break;
-			case "6002": msg = "网络错误!"; break;
-			case "6004": msg = "请联系客服查询订单"; break;
-			default: msg = "请联系客服" + code;
-		}
-		prompt.showToast({ message: msg });
-	},
-	onShow() {
-		this.getUserInfo();
-	},
-	onHide() {
-		//this.$app.$def.createShortcut(true);
-	},
-	onBackPress() {
-		if (this.pay_back) {
-			prompt.showDialog({
-				title: '温馨提示',
-				message: '每日完成任务,可以免费获取书币~',
-				buttons: [
-					{
-						text: '去做任务',
-						color: '#EF5952'
-					},
-					{
-						text: '我知道了',
-						color: '#999'
-					}
-				],
-				success: function (data) {
-					if (data.index === 1) {
-						router.back();
-					} else {
-						router.push({
-							uri: '/views/Task'
-						})
-					}
-
-				},
-				cancel: function () {
-					console.log('取消前往')
-				},
-			})
-			return true;
-		}
-
-	}
+  public: {
+    push_id: ''
+  },
+  protected: {
+    bid: '',
+    code: '',
+    fee: ''
+  },
+  private: {
+    pay_back: 0,
+    curPayType: 2,
+    curSelect: 0,
+    balance: 0,
+    send_order_id: 0,
+    total: '0元',
+    loadingText: '订单查询中...',
+    isInPay: false,
+    showLoading: false,
+    checked: false,
+    loginPhone: '',
+    haslogin: '',
+    isVip: '',
+    last: null,
+    payType: [
+      {
+        name: '支付宝',
+        icon:
+          'http://newycsd.oss-cn-hangzhou.aliyuncs.com/images/base/logo/zhifubao.jpg',
+        value: 1
+      },
+      {
+        name: '微信',
+        icon:
+          'http://newycsd.oss-cn-hangzhou.aliyuncs.com/images/base/logo/weixin.jpg',
+        value: 2
+      }
+    ],
+    rechargeList: []
+  },
+  //函数节流
+  throttle(fun, delay) {
+    let last = this.last
+    const now = +new Date()
+    if (now - last > delay) {
+      fun()
+      this.last = now
+    } else {
+      console.log('间隔太短了')
+    }
+  },
+  changePayType(type) {
+    this.curPayType = type.value
+  },
+  changeCharge(key) {
+    this.curSelect = key
+    this.total = this.rechargeList[key].price
+  },
+  async getUserInfo() {
+    let userinfo = await getUserInfo()
+    this.balance = userinfo.balance
+    this.send_order_id = userinfo.send_order_id
+    this.checked = userinfo.is_check
+    this.loginPhone = (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
+    } else {
+      this.curPayType = 1
+    }
+  },
+  async initChargeList() {
+    this.rechargeList = await getChargeList()
+    this.rechargeList.forEach((p, k) => {
+      if (p.today_special) {
+        this.curSelect = k
+        this.total = this.rechargeList[k].price
+      }
+    })
+  },
+  async onInit() {
+    if (this.push_id) {
+      await storage.set({ key: 'push_id', value: this.push_id })
+    }
+    getConfig = getAppConfig(this)
+    let { pay_back_alert_show } = await getConfig('task_center')
+    this.pay_back = pay_back_alert_show
+    this.initChargeList()
+  },
+  toPay() {
+    if (!(this.send_order_id || (this.haslogin && this.loginPhone))) {
+      prompt.showDialog({
+        title: '友情提示',
+        message: '您还未绑定手机号,请绑定手机号后在进行相关操作',
+        buttons: [
+          {
+            text: '前往绑定',
+            color: '#33dd44'
+          }
+        ],
+        success: function(data) {
+          router.push({
+            uri: '/views/Phone'
+          })
+        },
+        cancel: function() {
+          console.log('取消绑定')
+        }
+      })
+    } else {
+      this.throttle(() => {
+        this.payFunc()
+      }, 1000)
+    }
+  },
+  async payFunc() {
+    let cur_pay_type = this.curPayType
+    let product_id = this.rechargeList[this.curSelect].product_id
+    let ret = null
+    if (cur_pay_type === 1) {
+      ret = await configAliPay({
+        product_id: product_id,
+        bid: this.bid,
+        send_order_id: this.send_order_id
+      })
+    } else {
+      ret = await configWxPay({
+        product_id: product_id,
+        bid: this.bid,
+        send_order_id: this.send_order_id
+      })
+    }
+    // 成功支付后的回调操作
+    if (ret.code === '9000') this.showWaitingWrap(ret)
+    else this.showToastByCode(ret.code)
+  },
+  checkOrder(order_info) {
+    this.showLoading = true
+    let { data, order } = order_info
+    let times = 10
+    this.loadingText = `订单查询中...${times}s`
+    this.timer = setInterval(async () => {
+      if (times === 0) clearInterval(this.timer), this.showToastByCode('6004')
+      else {
+        times--
+        this.loadingText = `订单查询中...${times}s`
+        let fb = await checkWxOrder(order)
+        if (fb && typeof fb === 'object')
+          clearInterval(this.timer), this.showToastByCode('9000')
+      }
+    }, 1000)
+  },
+  showWaitingWrap(order) {
+    prompt.showDialog({
+      title: '支付结果',
+      message: '请确认支付结果',
+      buttons: [
+        {
+          text: '已支付',
+          color: '#EF5952'
+        },
+        {
+          text: '重新选择金额',
+          color: '#999'
+        }
+      ],
+      success: data => {
+        if (data.index === 0) this.checkOrder(order)
+      },
+      cancel: () => {
+        console.log('cancel')
+      }
+    })
+  },
+  showToastByCode(code) {
+    this.showLoading = false
+    let msg = '支付成功!'
+    switch (code) {
+      case '9000':
+        ;(msg = '支付成功!'), router.back()
+        break
+      case '8000':
+        msg = '订单已提交,请等待结果'
+        break
+      case '4000':
+        msg = '订单支付失败!'
+        break
+      case '5000':
+        msg = '订单重复!'
+        break
+      case '6001':
+        msg = '您已取消支付'
+        break
+      case '6002':
+        msg = '网络错误!'
+        break
+      case '6004':
+        msg = '请联系客服查询订单'
+        break
+      default:
+        msg = '请联系客服' + code
+    }
+    prompt.showToast({ message: msg })
+  },
+  onShow() {
+    this.getUserInfo()
+  },
+  onHide() {
+    //this.$app.$def.createShortcut(true);
+  },
+  onBackPress() {
+    if (this.pay_back) {
+      prompt.showDialog({
+        title: '温馨提示',
+        message: '每日完成任务,可以免费获取书币~',
+        buttons: [
+          {
+            text: '去做任务',
+            color: '#EF5952'
+          },
+          {
+            text: '我知道了',
+            color: '#999'
+          }
+        ],
+        success: function(data) {
+          if (data.index === 1) {
+            router.back()
+          } else {
+            router.push({
+              uri: '/views/Task'
+            })
+          }
+        },
+        cancel: function() {
+          console.log('取消前往')
+        }
+      })
+      return true
+    }
+  }
 }
 </script>
 
 <style lang="less">
-@import "../../assets/less/pay.less";
+@import '../../assets/less/pay.less';
 </style>