xy 11 сар өмнө
parent
commit
ba7e2df3db

+ 46 - 54
xs-app/App.vue

@@ -2,20 +2,13 @@
     import { config } from './config/config';
 	import { sdkUtil } from './framework/sdkUtil';
 	import { tools } from './framework/tools';
-
 	import { UserStatus } from './stores/userStatusManager';
+	// #ifdef MP-WEIXIN
 	const novelPlugin = requirePlugin('novel-plugin');
+	// #endif
 	export default {
 		onLaunch: function() {
 			console.log('App Launch')
-			switch (tools.platform){
-				case config.Platform.WEIXIN:
-					wx.showShareMenu({
-								withShareTicket: true,
-								menus: ['shareAppMessage', 'shareTimeline']
-							});
-				break;
-			}
 			tools.requestLogin(()=>{
 				// tools.requestRechargeOrderBuy(config.pay_type.WEI_XIN,1,(order_id,data)=>{
 				// 	console.log("order_id",order_id)
@@ -30,16 +23,18 @@
 				// 	})
 				// })
 			})
-		   // 订阅小程序初始化成功的事件
-		   
-		      novelPlugin.setLoggerConfig({
-		         info:false,
-		         debug: false,
-		         log:false,
-		         warn:true,
-		         error:true})
-			novelPlugin.onPageLoad(onNovelPluginLoad);
-			console.log("novelPlugin",novelPlugin)
+		    // 订阅小程序初始化成功的事件
+			if(tools.getCurPlatform()==config.Platform.WEIXIN) {
+				// 订阅小程序初始化成功的事件
+				novelPlugin.setLoggerConfig({
+				    info:false,
+				    debug: false,
+				    log:false,
+				    warn:true,
+				    error:true})
+				novelPlugin.onPageLoad(onNovelPluginLoad);
+				console.log("novelPlugin",novelPlugin)
+			}
 		},
 		onShow: function() {
 			console.log('App Show')
@@ -50,46 +45,43 @@
 	}
 	
 	function onNovelPluginLoad(data) {
-	  // data.id 句柄 用来获取novelManager实例
-	  const novelManager = novelPlugin.getNovelManager(data.id);
-	 console.log(novelManager.getPluginInfo())
-	  // getId() 返回当前manager对应的Id(即句柄)
-	  console.log('id:', novelManager.getId());
-
-	  // getBookId() 返回当前manager对应的bookId
-	  console.log('bookId:', novelManager.getBookId());
-	  
-	  // novelManager.onUserTriggerEvent((params)=>{
-		 //  console.log("params",params)
-	  // })
-	  
-	  novelManager.setClosePluginInfo({  //关闭后跳转的界面
-		  url: '/pages/bookstore/bookstore',
-		  mode: 'switchTab'  // 'redirectTo'
-	  })
-	  // console.log('novelManager:', novelManager);
-	  // setBookshelfStatus(Object params)
-	  // params.bookshelfStatus number类型 0 代表用户取消添加书架 1 代表用户添加书架
-	  // 因为是否添加书架的情况阅读器并不记录 所以需要接入方在接入的时候设置书架的状态
-	  // 默认情况该值为0 即未添加
-	  // 注:此处直接设置了未添加的状态 但实际情况应是接入方去拉取存储于接入方的用户数据
+		// data.id 句柄 用来获取novelManager实例
+		const novelManager = novelPlugin.getNovelManager(data.id);
+		console.log(novelManager.getPluginInfo())
+		// getId() 返回当前manager对应的Id(即句柄)
+		console.log('id:', novelManager.getId());
+		// getBookId() 返回当前manager对应的bookId
+		console.log('bookId:', novelManager.getBookId());
+		// novelManager.onUserTriggerEvent((params)=>{
+		// 	console.log("params",params)
+		// })
+		novelManager.setClosePluginInfo({  //关闭后跳转的界面
+			url: '/pages/bookstore/bookstore',
+			mode: 'switchTab'  // 'redirectTo'
+		})
+		// console.log('novelManager:', novelManager);
+		// setBookshelfStatus(Object params)
+		// params.bookshelfStatus number类型 0 代表用户取消添加书架 1 代表用户添加书架
+		// 因为是否添加书架的情况阅读器并不记录 所以需要接入方在接入的时候设置书架的状态
+		// 默认情况该值为0 即未添加
+		// 注:此处直接设置了未添加的状态 但实际情况应是接入方去拉取存储于接入方的用户数据
 		tools.getBookIdByWxBookId(novelManager.getBookId(),(book_id)=>{
 			tools.checkBookOnBookshelf(book_id,(is_on)=>{
-				  novelManager.setBookshelfStatus({
+				novelManager.setBookshelfStatus({
 					bookshelfStatus: is_on==true?1:0,
-				  });
+				});
 			})
 		})
-	  // var wx_book_id = novelManager.getBookId()
-	  // 监听用户点击书架的事件
-	  // params.bookshelfStatus number类型 0 代表用户取消添加书架 1 代表用户添加书架
-	  novelManager.onClickBookshelf((params) => {
-		// 此处逻辑应是接入方将用户设置的数据存储下来
-		// 之后将书架状态改变
-		// 如果接入方不去主动设置该状态 那么用户点击加入书架后 则不会有任何响应
-		// novelManager.setBookshelfStatus({
-		//   bookshelfStatus: params.bookshelfStatus === 0 ? 1 : 0,
-		// });
+		// var wx_book_id = novelManager.getBookId()
+		// 监听用户点击书架的事件
+		// params.bookshelfStatus number类型 0 代表用户取消添加书架 1 代表用户添加书架
+		novelManager.onClickBookshelf((params) => {
+			// 此处逻辑应是接入方将用户设置的数据存储下来
+			// 之后将书架状态改变
+			// 如果接入方不去主动设置该状态 那么用户点击加入书架后 则不会有任何响应
+			// novelManager.setBookshelfStatus({
+			//   bookshelfStatus: params.bookshelfStatus === 0 ? 1 : 0,
+			// });
 			tools.getBookIdByWxBookId(novelManager.getBookId(),(book_id)=>{
 				console.log("book_id:",book_id)
 				if(params.bookshelfStatus === 0 ){

+ 3 - 3
xs-app/framework/sdkUtil.ts

@@ -14,7 +14,7 @@ import { util } from "./util";
 export class sdkUtil {
 		
 	public static login(cb:Function) {
-		switch (tools.platform){
+		switch (tools.getCurPlatform()){
 			case config.Platform.H5:
 			    cb && cb(null)
 			    break
@@ -46,7 +46,7 @@ export class sdkUtil {
 	}
 	
 	public static showPayment(data:wx_pay_data,cb:Function){
-		switch (tools.platform){
+		switch (tools.getCurPlatform()){
 			case config.Platform.WEIXIN:
 				let wx_Info = wx.getSystemInfoSync()
 				if(wx_Info.platform == 'ios'){
@@ -86,7 +86,7 @@ export class sdkUtil {
 	 * 添加桌面
 	 */
 	public static addShortcut(cb:Function) {
-		switch (tools.platform){
+		switch (tools.getCurPlatform()){
 			case config.Platform.WEIXIN:
 			    wx.addShortcut({
 					success() {

+ 7 - 2
xs-app/framework/tools.ts

@@ -17,6 +17,11 @@ export class tools {
 		// #ifdef  MP-WEIXIN
 			config.applet_id = config.applet_id_config.wx
 			tools.platform = config.Platform.WEIXIN
+			//微信初始化设置显示分享弹窗,右上角'···'才可以转发给朋友,复制链接
+			wx.showShareMenu({
+				withShareTicket: true,
+				menus: ['shareAppMessage', 'shareTimeline']
+			});
 		// #endif
 		
 		// #ifdef  MP-TOUTIAO
@@ -99,8 +104,8 @@ export class tools {
 	public static value_gotoBookdetails_data = null
 	public static gotoBookdetails(book_id:number,wx_book_id:string, cb:Function=null) {
 		if(book_id) {
+			tools.value_gotoBookdetails_data = {'book_id':book_id}
 			if(tools.getCurPlatform()==config.Platform.WEIXIN){
-				tools.value_gotoBookdetails_data = {'book_id':book_id}
 				util.showLoading()
 				let url = config.url_confg.Static.book_details(book_id)
 				http.StaticRequest(url,(err=null,data=null)=>{
@@ -121,7 +126,7 @@ export class tools {
 			
 			}else{
 				uni.navigateTo({
-					url:'/pages/bookdetails/bookdetails',
+					url:'/pagesA/bookdetails/bookdetails',
 					success: (res) => {
 						res.eventChannel.emit('data',{'book_id':book_id})
 						cb && cb()					

+ 1 - 1
xs-app/pages/bookstore/bookstore.vue

@@ -30,7 +30,7 @@
 	let H3_data_list = ref<Array<Array<book_item_data>>>([])
 	
 	let content_paddingTop = ref(0)
-	if(tools.platform == config.Platform.WEIXIN) {
+	if(tools.getCurPlatform() == config.Platform.WEIXIN) {
 		content_paddingTop.value = uni.getSystemInfoSync().safeArea.top + 40
 	}
 		

+ 1 - 1
xs-app/pages/bookstore/template/template-book-V-3.vue

@@ -8,7 +8,7 @@
 		</view>
 		<view class="book-content">
 			<view class="book-content__box" v-for="(item,index) in templateData.list" :key="index"
-			@click="clickBook(item,index)">
+			@click="clickBook(item)">
 			    <view class="book-content__box__book-cover">
 			    	<image class="image" :src="item.book_cover" mode="aspectFill"></image>
 			    </view>

+ 1 - 0
xs-app/pages/bookstore/template/template-book-list.vue

@@ -112,6 +112,7 @@
 					margin: 0px 20rpx;
 					margin-bottom: 20rpx;
 					height: 70rpx;
+					line-height: 35rpx;
 					display: -webkit-box;
 					-webkit-line-clamp: 2;
 					-webkit-box-orient: vertical;

+ 41 - 26
xs-app/pagesA/recharge/rechargeCoin.vue

@@ -2,13 +2,13 @@
 	<view class="coin_content">
 		<view class="top">
 			<view class="top__bg">
-				<image class="image" src="../../static/imgs/public/img_top_bg_2.png" mode="aspectFit"></image>
+				<image class="image" src="@/static/imgs/public/img_top_bg_2.png" mode="aspectFit"></image>
 			</view>
 			<view class="top__container">
 				<view class="top__container__title">
 					<view class="top__container__title__name">我的书币</view>
 					<view class="top__container__title__icon">
-						<image class="image" src="../../static/imgs/public/img_coin.png" mode="aspectFill"></image>
+						<image class="image" src="@/static/imgs/public/img_coin.png" mode="aspectFill"></image>
 					</view>
 				</view>
 				<view class="top__container__coins">
@@ -23,32 +23,32 @@
 		</view>
 	    <view class="list">
 	    	<view class="list__item"  v-for="(item,index) in data_list" :key="index" @click="clickItem(index)">
-				<image v-if="current_index==index" class="image" src="../../static/imgs/read/img_buy_onselect_bi_status.png"></image>
-	    		<image v-else class="image" src="../../static/imgs/read/img_buy_unselect_bi_status.png" mode=""></image>
-	    	    <view class="list__item__container">
+				<image v-if="current_index==index" class="image" src="@/static/imgs/read/img_buy_onselect_bi_status.png"></image>
+	    		<image v-else class="image" src="@/static/imgs/read/img_buy_unselect_bi_status.png"></image>
+				<view class="list__item__container">
 	    	    	<view class="list__item__container__image-info">
 						<view class="list__item__container__image-info__song">
-							<image class="image" src="../../static/imgs/read/img_song_db.png"></image>
+							<image class="image" src="@/static/imgs/read/img_song_db.png" mode="aspectFit"></image>
 							<text v-if="item.give_coin>0" class="list__item__container__image-info__song__name">
 								送\n{{item.give_coin}}
 							</text>
 						</view>
 						<view class="list__item__container__image-info__icon">
-							<image class="image" src="../../static/imgs/read/img_coin.png" mode=""></image>
+							<image class="image" src="@/static/imgs/read/img_coin.png" mode="aspectFit"></image>
 						</view>
-	    	    	</view>
-	    	    	<view class="list__item__container__coin">
+	    	    	</view> 
+	    	    	<view class="list__item__container__coin" :style="{color:current_index==index?color_des:color_default}">
 	    	    		{{item.name}}
 	    	    	</view>
-	    	    	<view class="list__item__container__rmb">
-	    	    		¥ {{item.amount/100}}
+	    	    	<view class="list__item__container__rmb" :style="{color:current_index==index?color_rmb:color_default}">
+	    	    		<text style="font-size: 13px;">¥</text> {{item.amount/100}}
 	    	    	</view>
 	    	    </view>
 	    	</view>
 	    </view>
 	    <view class="bottom" @click="clickLjgm">
 	    	<view class="bottom__button-ljgm">
-	    		<image class="image" src="../../static/imgs/public/img_ljgm.png" mode=""></image>
+	    		<image class="image" src="@/static/imgs/public/img_ljgm.png" mode=""></image>
 	    	</view>
 	    </view>
 	</view>
@@ -64,6 +64,10 @@
     import { tools } from '../../framework/tools';
 	import { sdkUtil } from '../../framework/sdkUtil';
 		
+	let color_default = '#000000'
+	let color_des = '#EB3737'	
+	let color_rmb = '#FF5E00'
+		
 	let data_list = ref([])
 	let current_index = ref(-1)
 		
@@ -216,43 +220,53 @@
 		.list{
 			display: flex;
 			flex-flow: row wrap; //横向排列、换行排列
-			padding: 40rpx 20rpx;
+			padding: 20px 10px;
 			&__item{
 				display: flex;
 				flex-direction: column;
 				align-items: center;
 				width: 50%;
-				height: 246rpx;	
-				position: relative;
+				height: 140px;  //246rpx;
+				position: relative;		
 				// background-color: green;
+				
 				.image{
+					flex-shrink: 0;
+					position: absolute;
+					top: 0;
+					left: 0;
 					width: 100%;
 					height: 100%;
+					// background-color: blue;
 				}
 				&__container{
-					position: absolute;
+					z-index: 9;
 					display: flex;
 					flex-direction: column;
 					// justify-content: center;
 					align-items: center;
+					height: 100%;
+					// background-color: red;
 					
 					&__image-info{
-						margin-top: 30rpx;
+						margin-top: 20px;
 						display: flex;
 						align-items: center;
-						height: 90rpx;
+						height: 45px; //90rpx;
 						position: relative;
-						// background-color: green;
+
 						&__song{
 							position: absolute;
 							left: -95rpx;
-							top: 10rpx;
-							width: 80rpx;
-							height: 70rpx;
+							top: 3px;//10rpx;
+							width: 45px; //80rpx;
+							height: 40px; //70rpx;
 							flex-shrink: 0;
 							display: flex;
 							align-items: center;
 							justify-content: center;
+							flex-shrink: 0;
+							
 							.image {
 								width: 100%;
 								height: 100%;
@@ -272,7 +286,7 @@
 						&__icon{
 							flex-shrink: 0;
 							width: 74rpx;
-							height: 57rpx;
+							height: 29px; //57rpx;
 							.image{
 								width: 100%;
 								height: 100%;
@@ -280,13 +294,14 @@
 						}
 					}
 					&__coin{
-						margin-top: 0rpx;
+						margin-top: 3px;
+						height: 25px;
 						font-size: 19px;
 						color: #6D6D82;
 					}
 					&__rmb{
-						position: absolute;
-						bottom: -33%;
+						margin-top: 10px;
+						height: 25px;
 						font-size: 17px;
 					}
 				}

+ 26 - 17
xs-app/pagesA/recharge/rechargeVIP.vue

@@ -2,7 +2,7 @@
 	<view class="vip_content">
 		<view class="top">
 			<view class="top__bg">
-				<image class="image" src="../../static/imgs/public/img_top_bg_2.png" mode="aspectFit"></image>
+				<image class="image" src="@/static/imgs/public/img_top_bg_2.png" mode="aspectFit"></image>
 			</view>
 			<view class="top__container">
 				<view class="top__container__kaitong" v-if="user_data.is_vip">已开通</view>
@@ -26,14 +26,14 @@
 		</view>
 	    <view class="list">
 	    	<view class="list__item"  v-for="(item,index) in data_list" :key="index" @click="clickItem(index)">
-				<image v-if="current_index==index" class="image" src="../../static/imgs/read/img_buy_onselect_bi_status.png"></image>
-	    		<image v-else class="image" src="../../static/imgs/read/img_buy_unselect_bi_status.png"></image>
+				<image v-if="current_index==index" class="image" src="@/static/imgs/read/img_buy_onselect_bi_status.png"></image>
+	    		<image v-else class="image" src="@/static/imgs/read/img_buy_unselect_bi_status.png"></image>
 	    	    <view class="list__item__container">
 					<view class="list__item__container__prompt" :style="{color:current_index==index?color_prompt_s:color_prompt_n}">
 						{{item.prompt1}}
 					</view>
 					<view class="list__item__container__rmb" :style="{color:current_index==index?color_rmb:color_black}">
-						¥ {{(item.amount/100).toFixed(1)}}
+						<text style="font-size: 13px;">¥</text> {{(item.amount/100).toFixed(1)}}
 					</view>
 					<view class="list__item__container__des" :style="{color:current_index==index?color_des:color_black}">
 						{{item.base_angle}}
@@ -43,7 +43,7 @@
 	    </view>
 	    <view class="bottom">
 	    	<view class="bottom__button-ljgm" @click="clickLjgm">
-	    		<image class="image" src="../../static/imgs/public/img_ljgm.png" mode=""></image>
+	    		<image class="image" src="@/static/imgs/public/img_ljgm.png" mode=""></image>
 	    	</view>
 	    </view>
 	</view>
@@ -57,7 +57,7 @@
     import { UserData } from '../../stores/userDataManager';
     import { util } from '../../framework/util';
     import { tools } from '../../framework/tools';
-import { sdkUtil } from '../../framework/sdkUtil';
+    import { sdkUtil } from '../../framework/sdkUtil';
 		
 	let user_data = UserData().getData()
 	let data_list = ref([])
@@ -75,7 +75,7 @@ import { sdkUtil } from '../../framework/sdkUtil';
 		let url = config.url_confg.Static.get_recharge_list(2)
 		http.StaticRequest(url,(err,data)=>{
 			if(!err) {
-				console.log('vip-',data)
+				// console.log('vip-',data)
 				if(data.code==config.url_confg.StatesCode.SUCCESS){
 					data_list.value = data.content
 				}
@@ -245,43 +245,52 @@ import { sdkUtil } from '../../framework/sdkUtil';
 		.list{
 			display: flex;
 			flex-flow: row wrap; //横向排列、换行排列
-			padding: 40rpx 20rpx;
+			padding: 10px 10px;
 			&__item{
 				display: flex;
 				flex-direction: column;
 				align-items: center;
 				width: 50%;
-				height: 246rpx;	
+				height: 150px; //246rpx;	
 				flex-shrink: 0;
 				position: relative;
 				// background-color: green;
+				
 				.image{
+					position: absolute;
+					flex-shrink: 0;
+					left: 0;
+					top: 0;
 					width: 100%;
 					height: 100%;
 				}
 				&__container{
-					position: absolute;
+					z-index: 9;
 					display: flex;
 					flex-direction: column;
 					justify-content: center;
 					align-items: center;
-					
+					// background-color: red;
 					&__prompt{
-						margin-top: 50rpx;
+						margin-top: 30px; //50rpx;						
 						font-size: 20px;
 						color: #6D6D82;
+						height: 30px;
+						// background-color: red;
 					}
 					&__rmb{
-						margin-top: 10rpx;
-						font-size: 20px;
+						margin-top: 8px;//10rpx;
+						font-size: 22px;
 						font-weight: 500;
+						height: 25px;
+						// background-color: red;
 					}
 					&__des{
-						position: absolute;
-						bottom: -33%;
+						margin-top: 20px;
 						font-size: 13px;
+						height: 18px;
+						// background-color: red;
 					}
-					
 				}
 			}
 		}