ソースを参照

注销和字条放大功能

XiaBx 3 年 前
コミット
4ba02ffc43
6 ファイル変更419 行追加285 行削除
  1. 6 7
      src/api/config.js
  2. 92 87
      src/api/index.js
  3. 3 3
      src/manifest.json
  4. 67 7
      src/views/Cancellation/index.ux
  5. 14 7
      src/views/My/index.ux
  6. 237 174
      src/views/Privacy/index.ux

+ 6 - 7
src/api/config.js

@@ -6,11 +6,10 @@
  * @Description: api配置文件
  */
 const apiConfig = {
-    baseURL: "https://quickapp.leyuee.com/api",
-    //baseURL:"https://quickapptestnew.leyuee.com/api",
-    //baseURL: "https://quickapptest.leyuee.com/api",
-    package:'com.beidao.kuaiying.zsy'
-};
+  //baseURL: "https://quickapp.leyuee.com/api",
+  baseURL: 'https://quickapptestnew.leyuee.com/api',
+  //baseURL: "https://quickapptest.leyuee.com/api",
+  package: 'com.beidao.kuaiying.zsy'
+}
 
-export default apiConfig;
-    
+export default apiConfig

+ 92 - 87
src/api/index.js

@@ -5,50 +5,50 @@
  * @LastEditTime: 2019-10-15 14:05:59
  * @Description: api
  */
-import fly from "./fly";
+import fly from './fly'
 
 // 获取首页数据
 export const getHomeList = sex => {
-  console.log(sex);
-  return fly.get(`/books/${sex}/index`);
-};
+  console.log(sex)
+  return fly.get(`/books/${sex}/index`)
+}
 
 //充值记录
 export const rechargeApi = params => {
-  return fly.get("/order/chargeRecordLists", params);
-};
+  return fly.get('/order/chargeRecordLists', params)
+}
 
 // 获取分类
 export const getCategory = () => {
-  return fly.get("/books/getCategory");
-};
+  return fly.get('/books/getCategory')
+}
 
 // 获取书库
 export const getBooksList = params => {
-  return fly.get("/books/library", params);
-};
+  return fly.get('/books/library', params)
+}
 
 // 获取图书详情
 export const getBooksInfo = bid => {
-  return fly.get(`/book/${bid}`);
-};
+  return fly.get(`/book/${bid}`)
+}
 
 // 获取详情页相似数据
 export const getSimilarBooks = (category_id, bid) => {
-  return fly.get("/books/similar", {
+  return fly.get('/books/similar', {
     category_id,
     bid
-  });
-};
+  })
+}
 
 //获取章节消费记录
 export const chapterApi = params => {
-  return fly.get("/order/chapterOrderList", params);
-};
+  return fly.get('/order/chapterOrderList', params)
+}
 //获取全本消费记录
 export const bookApi = params => {
-  return fly.get("/order/bookOrderList", params);
-};
+  return fly.get('/order/bookOrderList', params)
+}
 
 // 获取详情页中的目录
 export const getShortCatalog = bid => {
@@ -57,170 +57,175 @@ export const getShortCatalog = bid => {
       page_size: 10,
       page: 1
     })
-    .then(r => r.list);
-};
+    .then(r => r.list)
+}
 
 // 获取充值列表
 export const getChargeList = () => {
-  return fly.get("/order/chargeList");
-};
+  return fly.get('/order/chargeList')
+}
 
 // 添加书籍进书架
 export const postUserShelfBooks = params => {
-  return fly.post(`/userShelfBooks`, params);
-};
+  return fly.post(`/userShelfBooks`, params)
+}
 
 // 获取书架数据
 export const getUserShelfBooks = () => {
-  return fly.get(`/userShelfBooks`);
-};
+  return fly.get(`/userShelfBooks`)
+}
 
 // 获取章节
 export const getCatalog = params => {
-  return fly.get(`/books/${params.bid}/catalog`, params);
-};
+  return fly.get(`/books/${params.bid}/catalog`, params)
+}
 //获取签到记录
 
 export const getSignRecord = params => {
-  return fly.get(`/user/sign_record`, params);
-};
+  return fly.get(`/user/sign_record`, params)
+}
 // 获取章节内容
 export const getChapters = params => {
-  return fly.get(`/books/${params.bid}/chapters/${params.chapter_id}`);
-};
+  return fly.get(`/books/${params.bid}/chapters/${params.chapter_id}`)
+}
 
 // 获取书籍是否在书架
 export const getIsonshelf = params => {
-  return fly.get(`/userShelfBooks/isonshelf`, params);
-};
+  return fly.get(`/userShelfBooks/isonshelf`, params)
+}
 
 // 删除书架书籍
 export const deleteShelfBook = params => {
-  return fly.get(`/userShelfBooks/delete`, params);
-};
+  return fly.get(`/userShelfBooks/delete`, params)
+}
 
 // 充值h5
 export const getConfigOfWxH5Pay = params => {
-  return fly.get("/goToH5Pay", params);
-};
+  return fly.get('/goToH5Pay', params)
+}
 
 // 充值app
 export const getConfigOfWxAppPay = params => {
-  return fly.get("/goToPay", params);
-};
+  return fly.get('/goToPay', params)
+}
 
 // 支付宝充值
 export const getConfigOfAliPay = params => {
-  return fly.get("/goToAliPay", params);
-};
+  return fly.get('/goToAliPay', params)
+}
 
 //获取用户信息
 export const getUserInfo = () => {
-  return fly.get(`/userinfo`);
-};
+  return fly.get(`/userinfo`)
+}
 
 //发送短信
 export const sendCode = params => {
-  return fly.post(`/user/sendCode`, params);
-};
+  return fly.post(`/user/sendCode`, params)
+}
 
 //用户绑定
 export const userBind = params => {
-  return fly.post(`/user/bindPhone`, params);
-};
+  return fly.post(`/user/bindPhone`, params)
+}
 
 //用户签到
 export const userSign = () => {
-  return fly.get(`/sign`);
-};
+  return fly.get(`/sign`)
+}
 
 // 查询微信支付订单的成功性 - h5
 export const checkWxOrder = order => {
-  return fly.get("/checkOrder", { order: order });
-};
+  return fly.get('/checkOrder', { order: order })
+}
 //用户签到
 export const chapterOrders = params => {
   return fly.get(
     `/books/${params.bid}/balance/chapterOrders/${params.chapter_id}`
-  );
-};
+  )
+}
 //用户客服二维码
 export const getCustomQrcode = () => {
-  return fly.get(`/customer_img`);
-};
+  return fly.get(`/customer_img`)
+}
 
 // 尾页推荐
 export const readOverRecommend = params => {
-  return fly.get("/books/readOverRecommend", params);
-};
+  return fly.get('/books/readOverRecommend', params)
+}
 
 //催更
 export const urgeUpdate = params => {
-  return fly.post(`/user/urgeUpdate`, params);
-};
+  return fly.post(`/user/urgeUpdate`, params)
+}
 
 //更新派单ID
 export const setSendOrderId = id => {
-  return fly.get("/user/setSendOrder", { id: id });
-};
+  return fly.get('/user/setSendOrder', { id: id })
+}
 
 //用户加桌
 export const userAddDsktop = statu => {
-  return fly.get("/user/addDesktop", { status: statu });
-};
+  return fly.get('/user/addDesktop', { status: statu })
+}
 
 //用户任务列表
 export const userTaskList = () => {
-  return fly.get("/user/task");
-};
+  return fly.get('/user/task')
+}
 
 //完成任务
 export const getTaskAward = id => {
-  return fly.get(`/user/task/get/${id}`);
-};
+  return fly.get(`/user/task/get/${id}`)
+}
 
 //获取签到信息
 export const getSignInfo = () => {
-  return fly.get("/sign/info");
-};
+  return fly.get('/sign/info')
+}
 
 //非VIP用户签到
 export const noVipSign = () => {
-  return fly.get("/sign/new");
-};
+  return fly.get('/sign/new')
+}
 
 //任务页面书籍位置
 export const taskBook = () => {
-  return fly.get("/books/recommen");
-};
+  return fly.get('/books/recommen')
+}
 
 //获取全局变量
 export const userOptions = () => {
-  return fly.get("/options");
-};
+  return fly.get('/options')
+}
 
 //获取排行榜
 export const getRank = sex => {
-  return fly.get("/books/rank", { sex: sex });
-};
+  return fly.get('/books/rank', { sex: sex })
+}
 
 //获取活动详情
 export const getAcitivity = token => {
-  return fly.get("/activity/detail", { token: token });
+  return fly.get('/activity/detail', { token: token })
 }
 
 //获取热词
 
-export const getHotMain = (pages) => {
-  return fly.get("/books/hotwords", { page: pages});
+export const getHotMain = pages => {
+  return fly.get('/books/hotwords', { page: pages })
 }
 
 //限免书籍
-export const getFreeBook = (sex) => {
-  return fly.get(`/books/free/${sex}`);
+export const getFreeBook = sex => {
+  return fly.get(`/books/free/${sex}`)
 }
 
 //阅读记录
-export const getReadrecord = () =>{
-  return fly.get('readrecord');
-}
+export const getReadrecord = () => {
+  return fly.get('readrecord')
+}
+
+//注销账户
+export const logOff = () => {
+  return fly.get(`user/logOff`)
+}

+ 3 - 3
src/manifest.json

@@ -1,8 +1,8 @@
 {
   "package": "com.beidao.kuaiying.zsy",
   "name": "追书云",
-  "versionName": "1.1.0",
-  "versionCode": 43,
+  "versionName": "1.1.1",
+  "versionCode": 44,
   "minPlatformVersion": 1070,
   "icon": "/assets/imgs/logo.png",
   "features": [
@@ -62,7 +62,7 @@
     "logLevel": "debug"
   },
   "router": {
-    "entry": "views/Cancellation",
+    "entry": "views/Index",
     "pages": {
       "views/Index": {
         "component": "index"

+ 67 - 7
src/views/Cancellation/index.ux

@@ -15,7 +15,7 @@
         无法找回
       </text>
       <div class="current_account">
-        <text>当前账号:{{ 1123 }}</text>
+        <text>当前账号:{{ loginPhone }}</text>
       </div>
     </div>
     <div class="notify-things">
@@ -24,16 +24,16 @@
     <div class="clean_money">
       <div class="clean_money_wrap">
         <text>账户书币余额清零</text>
-        <text>当前书币余额{{ 12 }}</text>
+        <text>当前书币余额{{ fee }}</text>
       </div>
       <div class="handle-button">
-        <text>
+        <text @click="handleBack">
           去处理
         </text>
       </div>
     </div>
     <div class="cancellation-button">
-      <text class="cancellation-button-wrap" @click="signToday">
+      <text class="cancellation-button-wrap" @click="logOut">
         立即注销
       </text>
     </div>
@@ -41,8 +41,69 @@
 </template>
 
 <script>
+import storage from '@system.storage'
+import { logOff } from '../../api/index'
+import router from '@system.router'
+import prompt from '@system.prompt'
+
 export default {
-  private: {}
+  public: {
+    haslogin: '',
+    loginPhone: '',
+    fee: 0
+  },
+  async onReady() {
+    this.haslogin = (await storage.get({ key: 'hasLogin' })).data
+    this.loginPhone = (await storage.get({ key: 'loginPhone' })).data
+  },
+  handleBack() {
+    router.replace({ uri: '/views/Index' })
+  },
+  logOut() {
+    prompt.showDialog({
+      title: '温馨提示',
+      message: '你确认要注销账户吗,注销将丢失之前的用户数据哦~',
+      buttons: [
+        {
+          text: '确定注销',
+          color: '#EF5952'
+        },
+        {
+          text: '我再想想',
+          color: '#999'
+        }
+      ],
+
+      success: data => {
+        if (data.index === 0) {
+          console.log('开始注销---------')
+          logOff().then(res => {
+            storage.delete({
+              key: 'hasLogin',
+              success: function(data) {
+                console.log('handling success')
+              }
+            })
+            storage.delete({
+              key: 'loginPhone',
+              success: function(data) {
+                console.log('handling success')
+              }
+            })
+
+            prompt.showToast({
+              message: '注销成功!即将回到首页'
+            })
+
+            router.replace({ uri: '/views/Index' })
+          })
+        }
+      },
+      cancel: () => {
+        console.log('cancel')
+      }
+    })
+  }
 }
 </script>
 
@@ -76,8 +137,7 @@ export default {
       border-radius: 10px;
       color: #000000;
       font-size: 26px;
-      width: 339px;
-      padding: 10px;
+      padding: 10px 30px;
       border-radius: 30px;
       text {
         margin: 0 auto;

+ 14 - 7
src/views/My/index.ux

@@ -92,11 +92,17 @@
     </div>
 
     <div class="bottom-info">
-      <text @click="pageChange('Agreement')">用户协议</text
-      ><text class="line">|</text
-      ><text @click="pageChange('Privacy')">隐私协议</text
-      ><text class="line">|</text
-      ><text @click="pageChange('Cancellation')">用户注销</text>
+      <text @click="pageChange('Agreement')">用户协议</text>
+      <text class="line">|</text>
+      <text @click="pageChange('Privacy')">隐私协议</text>
+      <text if="{{!send_order_id &&  haslogin && loginPhone}}" class="line"
+        >|</text
+      >
+      <text
+        if="{{!send_order_id && haslogin && loginPhone}}"
+        @click="pageChange('Cancellation', { fee: user.balance })"
+        >注销账号</text
+      >
     </div>
   </div>
 </template>
@@ -147,7 +153,7 @@ export default {
   showCustomerQrcode() {
     this.$emit('customer')
   },
-  pageChange(page) {
+  pageChange(page, params) {
     if (page == 'Phone' && this.haslogin) {
       this.loginOut()
       return false
@@ -164,7 +170,8 @@ export default {
       }
     } else {
       router.push({
-        uri: `/views/${page}`
+        uri: `/views/${page}`,
+        params: params ? params : {}
       })
     }
   },

ファイルの差分が大きいため隠しています
+ 237 - 174
src/views/Privacy/index.ux