lhl 1 年間 前
コミット
be1da01536
6 ファイル変更129 行追加50 行削除
  1. 24 22
      .hbuilderx/launch.json
  2. 9 3
      manifest.json
  3. 14 16
      pages/index/index.vue
  4. 1 1
      pages/public/register.vue
  5. 3 0
      pages/user/team.vue
  6. 78 8
      pages/zero/ren.vue

+ 24 - 22
.hbuilderx/launch.json

@@ -1,24 +1,26 @@
-{ // launch.json 配置了启动调试时相关设置,configurations下节点名称可为 app-plus/h5/mp-weixin/mp-baidu/mp-alipay/mp-qq/mp-toutiao/mp-360/
-  // launchtype项可配置值为local或remote, local代表前端连本地云函数,remote代表前端连云端云函数
-    "version": "0.0",
-    "configurations": [{
-     	"app-plus" : 
-     	{
-     		"launchtype" : "remote"
-     	},
-     	"default" : 
-     	{
-     		"launchtype" : "remote"
-     	},
-     	"h5" : 
-     	{
-     		"launchtype" : "remote"
-     	},
-     	"mp-weixin" : 
-     	{
-     		"launchtype" : "remote"
-     	},
-     	"type" : "uniCloud"
-     }
+{
+    // launch.json 配置了启动调试时相关设置,configurations下节点名称可为 app-plus/h5/mp-weixin/mp-baidu/mp-alipay/mp-qq/mp-toutiao/mp-360/
+    // launchtype项可配置值为local或remote, local代表前端连本地云函数,remote代表前端连云端云函数
+    "version" : "0.0",
+    "configurations" : [
+        {
+            "app-plus" : {
+                "launchtype" : "remote"
+            },
+            "default" : {
+                "launchtype" : "remote"
+            },
+            "h5" : {
+                "launchtype" : "remote"
+            },
+            "mp-weixin" : {
+                "launchtype" : "remote"
+            },
+            "type" : "uniCloud"
+        },
+        {
+            "playground" : "custom",
+            "type" : "uni-app:app-android"
+        }
     ]
 }

+ 9 - 3
manifest.json

@@ -2,8 +2,8 @@
     "name" : "精联惠选",
     "appid" : "__UNI__991D0D9",
     "description" : "精联惠选",
-    "versionName" : "1.2.2",
-    "versionCode" : 122,
+    "versionName" : "1.2.5",
+    "versionCode" : 125,
     "transformPx" : false,
     "app-plus" : {
         /* 5+App特有相关 */
@@ -59,7 +59,13 @@
                 "share" : {},
                 "speech" : {},
                 "statics" : {},
-                "ad" : {}
+                "ad" : {
+                    "gdt" : {},
+                    "ks" : {},
+                    "sigmob" : {},
+                    "hw" : {},
+                    "bd" : {}
+                }
             },
             "icons" : {
                 "android" : {

+ 14 - 16
pages/index/index.vue

@@ -12,7 +12,7 @@
 		<!-- 顶部logo and 搜索 end-->
 		<view class="jg" style="background-color: #fff;"></view>
 		<!-- 轮播图 start -->
-		<swiper class="top-swiper" autoplay="true" duration="400" interval="5000" @change="swiperChange">
+		<swiper class="top-swiper" autoplay="true" duration="400" interval="5000" >
 			<swiper-item v-for="(item, index) in carouselList" :key="index" class="carousel-item"
 				@click="bannerNavToUrl(item)">
 				<image :src="item.pic" />
@@ -38,7 +38,8 @@
 		<view class="jg">
 		</view>
 		<!-- #ifdef APP-PLUS -->
-		<video src="../../static/video/v1.mp4" controls class="gsjs" :muted="muted" ref="inv" id="myVideo"></video>
+		<video src="../../static/video/v1.mp4" controls class="gsjs" ref="inv" id="myVideo" autoplay></video>
+		<ad adpid="1108185255" @load="onload" @close="onclose" @error="onerror"></ad>
 		<!-- #endif -->
 		<!-- #ifdef H5 -->
 		<video src="https://chat.yiqushangshi.com/wap/video/v1.mp4" controls class="gsjs" :muted="muted" ref="inv" id="myVideo"></video>
@@ -146,11 +147,6 @@
 						img: '../../static/icon/inx3.png',
 						tit: '普惠商城'
 					},
-					// {
-					// 	path: '/pages/index/gift?type=14',
-					// 	img: '../../static/icon/inx4.png',
-					// 	tit: '第三方商城'
-					// },
 					{
 						path: '/pages/index/three',
 						img: '../../static/icon/inx4.png',
@@ -161,11 +157,6 @@
 						img: '../../static/icon/inx5.png',
 						tit: '本地生活'
 					},
-					// {
-					// 	path: '/pages/index/gift?type=13',
-					// 	img: '../../static/icon/inx5.png',
-					// 	tit: '本地生活'
-					// },
 					{
 						path: '/pages/index/gift?type=13',
 						img: '../../static/icon/inx6.png',
@@ -188,9 +179,6 @@
 				loadingType: 'more',
 				current: 0,
 				shareShow: false, //分享海报
-				pageProportion: 0, //保存页面基于750宽度的比例
-				swiperHeight: 0,
-				checkid: 0,
 				titleNViewBackground: '',
 				swiperCurrent: 0,
 				swiperLength: 0,
@@ -299,6 +287,16 @@
 			// this.$refs.inv.pause()
 		},
 		methods: {
+			onload(e) {
+			  console.log("onload--广告加载完成");
+			
+			},
+			onclose(e) {
+			  console.log("广告关闭: " + e);
+			},
+			onerror(e) {
+			  console.log('广告error:',e);
+			},
 			getArtList() {
 				getArtList({
 					page: 1,
@@ -594,7 +592,7 @@
 
 	// 分类
 	.cate-section {
-		justify-content: space-around;
+		justify-content: flex-start;
 		background-color: #fff;
 		padding: 0 0 30rpx;
 		flex-wrap: wrap;

+ 1 - 1
pages/public/register.vue

@@ -20,7 +20,7 @@
 				<view class="login_img"><image src="/static/icon/img04.png"></image></view>
 				<view class="login_name"><input class="uni-input" password v-model="repassword" focus placeholder="请重复输入密码" /></view>
 			</view>
-			<view class="login_input flex">
+			<view class="login_input flex" >
 				<view class="login_img"><image src="/static/icon/img07.png"></image></view>
 				<view class="login_name"><input class="uni-input" type="text" v-model="invitation" focus placeholder="请输入邀请码" /></view>
 			</view>

+ 3 - 0
pages/user/team.vue

@@ -54,6 +54,9 @@
 								<view class="time">
 									<text>{{ item.phone }}  ({{ showLevel(item)}})</text>
 								</view>
+								<view class="time">
+									<text>今日观看视频数量:{{item.day_count}}</text>
+								</view>
 								<view class="time">
 									<text>{{ item.time }}</text>
 								</view>

+ 78 - 8
pages/zero/ren.vue

@@ -1,7 +1,6 @@
 <template>
 	<view class="content">
 		<view class="top-bg">
-
 		</view>
 		<view class="top-wrap">
 			<view class="tit">
@@ -14,7 +13,32 @@
 				累计收益
 			</view>
 		</view>
-		<view class="gg-wrap flex" v-for="(item,index) in ggInfo.day_video_count">
+		<view class="gg-wrap flex" v-for="(item,index) in ggInfo.day_video_count" v-if="!isError">
+			<image src="../../static/icon/jiang.png" mode=""></image>
+			<view class="gg-tit">
+				<view class="tit">
+					观看视频赚阅读积分
+				</view>
+				<view class="">
+					观看可获得阅读积分
+				</view>
+			</view>
+			<view class="gg-btn pass" v-if="ggInfo.valid_bcount*1 > index">
+				已观看
+			</view>
+			<template v-if="ggInfo.valid_bcount < 3 && ggInfo.valid_bcount == index">
+				<ad-rewarded-video adpid="1480651769" :loadnext="true" v-slot:default="{loading, error}"
+					@load="onadload" @close="onadclose" @error="onaderror">
+					<view class="gg-btn">
+						去观看
+					</view>
+				</ad-rewarded-video>
+			</template>
+			<!-- <view class="gg-btn pass" v-if="gInfo.valid_bcount*1 =< index">
+				去观看1
+			</view> -->
+		</view>
+		<view class="gg-wrap flex" v-for="(item,index) in ggInfo.day_video_count" v-if="isError">
 			<image src="../../static/icon/jiang.png" mode=""></image>
 			<view class="gg-tit">
 				<view class="tit">
@@ -24,7 +48,8 @@
 					观看可获得阅读积分
 				</view>
 			</view>
-			<view class="gg-btn" :class="{pass: ggInfo.valid_bcount*1 > index}" @click="ggInfo.valid_bcount*1 > index? '': goLock(index)">
+			<view class="gg-btn" :class="{pass: ggInfo.valid_bcount*1 > index}"
+				@click="ggInfo.valid_bcount*1 > index? '': goLock(index)">
 				{{ggInfo.valid_bcount*1 > index? '已观看': '去观看'}}
 			</view>
 		</view>
@@ -39,7 +64,8 @@
 
 	import {
 		getGG,
-		createGG
+		createGG,
+		ggGive
 	} from '@/api/zero.js'
 	import {
 		getUserInfo,
@@ -48,8 +74,11 @@
 	export default {
 		data() {
 			return {
+				isError: false,
 				ggInfo: {},
-				id: 0
+				id: 0,
+				error: '',
+				isLoading: false,
 			}
 		},
 		computed: {
@@ -70,6 +99,47 @@
 		},
 		methods: {
 			...mapMutations('user', ['setUserInfo']),
+			onadload(e) {
+				console.log('广告数据加载成功',e);
+				let that = this
+				
+			},
+			onadclose(e) {
+				let that = this
+				const detail = e.detail
+				// 用户点击了【关闭广告】按钮
+				console.log('用户点击了【关闭广告】按钮')
+				if (detail && detail.isEnded) {
+					// 正常播放结束
+					console.log("正常播放结束onadclose ", detail, detail.isEnded);
+					createGG({
+						ad_id: 0
+					}).then(res => {
+						ggGive({
+							id: res.data.id
+						}).then(ress => {
+							
+							that.loadBaseData()
+							uni.showToast({
+								title: '奖励发放成功',
+								duration: 2000
+							});
+							that.getGG()
+						})
+						
+					})
+					
+				} else {
+					// 播放中途退出
+					console.log("播放中途退出onadclose ", detail, detail.isEnded);
+				}
+			},
+			onaderror(e) {
+				// 广告加载失败
+				console.log("onaderror: ", e.detail);
+				this.isError = true
+				// this.$api.msg(e.detail.errMsg)
+			},
 			loadBaseData() {
 				const obj = this
 				getUserInfo({})
@@ -82,7 +152,7 @@
 					.catch(e => {
 						console.log(e);
 					});
-			
+
 			},
 			getGG() {
 				getGG().then(res => {
@@ -95,10 +165,10 @@
 					ad_id: 0
 				}).then(res => {
 					uni.navigateTo({
-						url: '/pages/zero/gg?id=' + res.data.id
+						url:'/pages/zero/gg?id=' + res.data.id
 					})
 				})
-
+				
 			}
 		}
 	}