xiabx hace 5 años
padre
commit
d4aa019807

+ 0 - 3
src/api/index.js

@@ -114,11 +114,8 @@ export const sendCode = params => {
 export const userBind = params => {
   return fly.post(`/user/bindPhone`, params);
 };
-<<<<<<< HEAD
-=======
 
 //用户签到
 export const userSign = () => {
   return fly.get(`/sign`);
 };
->>>>>>> b1966ec5a5d917c8387553d039eab48982d3f544

+ 7 - 0
src/assets/less/index.less

@@ -88,4 +88,11 @@
 
     }
   }
+}
+.sign-icon{
+  position: fixed;
+  width:150px;
+  height:150px;
+  right:20px;
+  bottom: 300px;
 }

+ 48 - 0
src/components/short/index.ux

@@ -0,0 +1,48 @@
+<template>
+	<div class="short-wrap">
+		<div class="short-content" @click="createShortcut">
+			<text class="short-text">保存到手机方便下次阅读>></text>
+		</div>
+	</div>
+</template>
+<script>
+
+export default {
+	data: {
+		
+	},
+	onInit() {
+		
+	},
+	createShortcut(){
+		// 创建快捷方式
+    this.$app.$def.createShortcut()
+	}
+}
+</script>
+
+
+<style lang="less" scoped>
+	.short{
+		&-wrap{
+			position: fixed;
+			bottom: 140px;
+			height: 80px;
+			justify-content: center;
+			width: 100%;
+		}
+		&-content{
+			background-color: #EF5952;
+			border-radius: 40px;
+			width: 600px;
+			align-items: center;
+			justify-content: center;
+		}
+		&-text {
+			color:#fff;
+			font-size: 30px;
+			font-weight: bold;
+			text-align: center;
+		}
+	}
+</style>

+ 9 - 9
src/components/sign/index.ux

@@ -29,23 +29,22 @@ export default {
 			{ day: 6, iconType: 'coin', fee: 50 },
 			{ day: 7, iconType: 'gift', fee: 150 },
 		],
-		signData:{
-			days:0,
-			fee:0
+		signData: {
+			days: 0,
+			fee: 0
 		}
 	},
 	onInit() {
 		this.sign();
 	},
 	async sign() {
-		let res =	await userSign();
-		this.signData=res;
+		let res = await userSign();
+		this.signData = res;
 		this.signList.forEach(item => {
-			if(item.day<=res.days){
-				item.iconType='checked';
+			if (item.day <= res.days) {
+				item.iconType = 'checked';
 			}
 		});
-		setStore('SIGN_DATE',{isSign:true});
 	},
 	setSignPop() {
 		this.$dispatch('dispathEvt')
@@ -62,7 +61,8 @@ export default {
     right: 0;
     background-color: rgba(0, 0, 0, 0.56);
     flex-direction: column;
-    align-items: center;
+		align-items: center;
+		z-index: 2;
   }
   &-content {
     width: 650px;

+ 16 - 11
src/views/Index/index.ux

@@ -2,7 +2,8 @@
 <import name="category-page" src="../Category/index.ux"></import>
 <import name="shelf-page" src="../Shelf/index.ux"></import>
 <import name="my-page" src="../My/index.ux"></import>
- <import name="sign-page" src="../../components/sign/index.ux"></import>
+<import name="sign-page" src="../../components/sign/index.ux"></import>
+<import name="short-page" src="../../components/short/index.ux"></import>
 <template>
   <stack class="stack-wrap">
     <div class="index-wrap">
@@ -26,7 +27,9 @@
         </div>
       </div>
     </div>
-    <sign-page if="{{showSignPop}}" onemitEvt="emitEvt"></sign-page>
+    <image src="../../assets/imgs/sign_show.png" class="sign-icon" @click="changeSignPop"> </image>
+    <sign-page if="{{showSignPop}}" ></sign-page>
+    <short-page if="{{showShortPop}}"></short-page>
     <div class="stack-popup" @click="closeWrap" if="showPopup">
       <div class="customer-popup">
         <text class="title">联系客服</text>
@@ -43,8 +46,7 @@
 <script>
 import clipboard from '@system.clipboard';
 import prompt from '@system.prompt';
-import {downImg,getStore} from '../../api/utils.js';
-import storage from "@system.storage";
+import { downImg, getStore } from '../../api/utils.js';
 export default {
   private: {
     tabbar: [
@@ -79,14 +81,17 @@ export default {
     ],
     current: 1,
     showPopup: false,
-    showSignPop:true
+    showSignPop: false,
+    showShortPop:false
   },
-  async onInit(){
-    this.$on('dispathEvt',this.changeSignPop);
+   onInit() {
+    this.$on('dispathEvt', this.changeSignPop);
     //今日已签到过不在弹框签到
-    let signData = await getStore('SIGN_DATE',1);
-    if(signData && signData.isSign) this.showSignPop=false;
-    },
+    if(this.$app.$def.data.backClickCount === 0){
+      this.showShortPop=true;
+    }
+
+  },
   onBackPress() {
     // 退出逻辑
     if (this.$app.$def.data.backClickCount === 0) {
@@ -110,7 +115,7 @@ export default {
     this.current = 1;
   },
   changeSignPop() {
-    this.showSignPop = false;
+    this.showSignPop = !this.showSignPop;
   },
   closeWrap() {
     this.showPopup = false;

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

@@ -11,7 +11,7 @@
           <text>您还剩<span class="red">{{user.balance}}</span>书币</text>
         </div>
         <text class="operator-button" @click="pageChange('Pay')">
-         充值
+          充值
         </text>
       </div>
       <div class="operator-item" @click="toUrl('https://sitenlp5w4yepme7xrqz.zhuishuyun.com/sign')">
@@ -66,7 +66,7 @@
 
 <script>
 import router from "@system.router";
-import {  getUserInfo } from "../../api/index";
+import { getUserInfo } from "../../api/index";
 export default {
   props: {},
   data() {
@@ -77,9 +77,9 @@ export default {
   onInit() {
     this.getUser();
   },
-  async getUser(){
-  let user =await getUserInfo();
-    this.user=user;
+  async getUser() {
+    let user = await getUserInfo();
+    this.user = user;
   },
   showCustomerQrcode() {
     this.$emit('customer');