ソースを参照

免费的模式1

JXDS18FUJT 1 年間 前
コミット
b5246b6408

+ 1 - 1
src/api/request.js

@@ -12,7 +12,7 @@ const service = axios.create({
 	// axios中请求配置有baseURL选项,表示请求URL公共部分
 	//#ifdef MP-WEIXIN
 	//baseURL: process.env.NODE_ENV === 'development' ? 'https://jpcj-admin1.zzxcx.net/stage-api' : 'https://jpcj-admin.zzxcx.net/prod-api',
-	baseURL: process.env.NODE_ENV === 'development' ? 'https://107j18o08.vicp.fun/' : 'https://nbjk.zzxcx.net/nbjk-admin/',
+	baseURL: process.env.NODE_ENV === 'development' ? 'https://nbjk1.zzxcx.net/nbjk-admin/' : 'https://nbjk.zzxcx.net/nbjk-admin/',
 	
 	//#endif
 	//#ifdef MP-TOUTIAO

+ 157 - 42
src/otherPages/courseCatalog/components/courseCatalog.vue

@@ -1,5 +1,25 @@
 <template>
   <view class="bg">
+    <van-popup round close-on-click-overlay safe-area-tab-bar @close="() => {
+      wxadWatchTip = false
+    }" :show="wxadWatchTip">
+      <view class="adtip">
+        <image style="width: 580rpx;" src="https://ndata.zzxcx.net/ctjk/mp-wx/courseCatalog/wxad_bg@2x.png"
+          mode="widthFix"></image>
+        <view  class="buttons">
+          <view @click="watchWxAd(listItem)" class="button1">
+            <van-icon custom-style="margin-right:10rpx;" name="video-o" /> 看广告免费看视频
+          </view>
+          <view @click="() => {
+            wxadWatchTip = false
+          }" class="button2">
+            <van-icon custom-style="margin-right:10rpx;" name="close" /> 取消
+          </view>
+        </view>
+      </view>
+
+
+    </van-popup>
     <view class="video">
       <view @click="playRoadExamVideo(item)" v-for="(item, index) in list" :key="index" class="video-item">
         <image v-if="item.permission == 1" class="video-item-angle" :src="try_angle"></image>
@@ -99,48 +119,16 @@ export default {
       try_angle,
       userAgreement: [],
       userAgree: false,
+      wxadWatchTip: false,
+      listItem:{
+
+      }
     };
   },
   methods: {
-    changeUserAgreement(e) {
-      console.log(e, "..");
-      this.userAgreement = e.detail;
-      console.log(this.userAgreement);
-    },
-    playRoadExamVideo(item) {
-      //播放试看的视频
-      if (item.permission == 1) {
-        uni.setStorageSync("storageWebSrc", item.videoUrl);
-        uni.navigateTo({
-          url: "/otherPages/playStorageWebSrc/index",
-        });
-        return
-      }
-      if (this.isVideoFree == "0") {
-        if (!this.roadExamIds.includes(this.examId)) {
-          uni.showToast({
-            title: "请购买",
-            icon: "none",
-          });
-          return;
-        }
-        else {
-          uni.setStorageSync("storageWebSrc", item.videoUrl);
-          uni.navigateTo({
-            url: "/otherPages/playStorageWebSrc/index",
-          });
-        }
-      }
-      if (this.isVideoFree == "1") {
-        wx.showModal({
-          title: '看广告免费观看',
-          content: '是否观看激励广告',
-          success(res) {
-
-            if (res.confirm) {
-              console.log('用户点击确定')
-              let videoAd = null;
-              if (wx.createRewardedVideoAd) {
+    watchWxAd(item){
+      let videoAd = null;
+      if (wx.createRewardedVideoAd) {
                 videoAd = wx.createRewardedVideoAd({
                   adUnitId: "adunit-f0e94618f34d4baf",
                 });
@@ -172,11 +160,94 @@ export default {
               } else if (res.cancel) {
                 console.log('用户点击取消')
               }
-            }
-          }
+            
+          
 
-        })
+    },
+    changeUserAgreement(e) {
+      console.log(e, "..");
+      this.userAgreement = e.detail;
+      console.log(this.userAgreement);
+    },
+    playRoadExamVideo(item) {
+      //播放试看的视频
+      if (item.permission == 1) {
+        uni.setStorageSync("storageWebSrc", item.videoUrl);
+        uni.navigateTo({
+          url: "/otherPages/playStorageWebSrc/index",
+        });
+        return
       }
+      //已经购买的也可以看
+      if (this.roadExamIds.includes(this.examId)) {
+        uni.setStorageSync("storageWebSrc", item.videoUrl);
+        uni.navigateTo({
+          url: "/otherPages/playStorageWebSrc/index",
+        });
+      }
+      if (this.isVideoFree == "0") {
+        if (!this.roadExamIds.includes(this.examId)) {
+          uni.showToast({
+            title: "请购买",
+            icon: "none",
+          });
+          return;
+        }
+
+      }
+      if (this.isVideoFree == "1") {
+        this.wxadWatchTip = true
+        this.listItem = item
+        return
+        // wx.showModal({
+        //   title: '看广告免费观看',
+        //   content: '是否观看激励广告',
+        //   success(res) {
+
+        //     if (res.confirm) {
+        //       console.log('用户点击确定')
+        //       let videoAd = null;
+        //       if (wx.createRewardedVideoAd) {
+        //         videoAd = wx.createRewardedVideoAd({
+        //           adUnitId: "adunit-f0e94618f34d4baf",
+        //         });
+        //         videoAd.onLoad(() => { });
+        //         videoAd.onError((err) => {
+        //           console.log(err)
+        //         });
+        //         videoAd.offClose();
+        //         videoAd.onClose((res) => {
+        //           if (!res.isEnded) {
+        //             return
+        //           }
+        //           uni.setStorageSync("storageWebSrc", item.videoUrl);
+        //           uni.navigateTo({
+        //             url: "/otherPages/playStorageWebSrc/index",
+        //           });
+        //         });
+
+        //         videoAd.show().catch(() => {
+        //           // 失败重试
+        //           videoAd
+        //             .load()
+        //             .then(() => videoAd.show())
+        //             .catch((err) => {
+        //               console.log("激励视频 广告显示失败");
+        //             });
+        //         });
+
+        //       } else if (res.cancel) {
+        //         console.log('用户点击取消')
+        //       }
+        //     }
+        //   }
+
+        // })
+      }
+      uni.setStorageSync("storageWebSrc", item.videoUrl);
+      uni.navigateTo({
+        url: "/otherPages/playStorageWebSrc/index",
+      });
 
 
 
@@ -245,6 +316,9 @@ export default {
       isVideoFree: (state) => {
         return state.user.isVideoFree;
       },
+      baziispay: (state) => {
+        return state.user.baziispay
+      }
     }),
     ...mapGetters(["roadExamIds"]),
   },
@@ -257,6 +331,47 @@ export default {
   display: inline-block;
   height: 100%;
 
+  .adtip {
+    width: 580rpx;
+
+    .buttons {
+      width: 580rpx;
+      height: 380rpx;
+      display: flex;
+      align-items: center;
+      align-content: center;
+      flex-wrap: wrap;
+      justify-content: center;
+
+      .button1 {
+        width: 480rpx;
+        height: 90rpx;
+        line-height: 90rpx;
+        border-radius: 50rpx 50rpx 50rpx 50rpx;
+        opacity: 1;
+        font-size: 34rpx;
+        color: #fff;
+        text-align: center;
+        background-image: linear-gradient(#FF9FBC, #FF4848);
+      }
+
+      .button2 {
+        width: 480rpx;
+        height: 90rpx;
+        line-height: 90rpx;
+        background: #fff;
+        opacity: 1;
+        border: 2rpx solid #5C6066;
+        margin-top: 40rpx;
+        border-radius: 50rpx 50rpx 50rpx 50rpx;
+        font-size: 38rpx;
+        text-align: center;
+        color: #5C6066;
+      }
+
+    }
+  }
+
   .video {
     white-space: normal;
     padding: 0 30rpx;

+ 1 - 1
src/pages.json

@@ -699,7 +699,7 @@
       },
       {
         "name": "运势",
-        "path": "pages/fortune/index",
+        "path": "pages/future/index",
         "query": ""
       },
       {

+ 162 - 56
src/pages/future/index.vue

@@ -11,13 +11,13 @@
 			</view>
 		</view>
 		<image class="bg" src="https://ndata.zzxcx.net/xpgx-xcx/index/bg1.png"></image>
-		<image mode="widthFix" class="logo" src="https://ndata.zzxcx.net/xpgx-xcx/index/bg5.png"></image>
+		<image mode="widthFix" class="logo" src="https://ndata.zzxcx.net/xpgx-xcx/index/bg6.png"></image>
 		<view class="form">
 			<view class="content">
 				<image class="content-title" mode="widthFix" src="https://ndata.zzxcx.net/xpgx-xcx/index/title.png"></image>
 				<view class="content-inputs">
 					<view class="content-inputs-row">
-						<view class="content-inputs-row-label">命主姓名</view>
+						<view class="content-inputs-row-label">姓名</view>
 						<view>
 							<input v-model="form.username" class="content-inputs-row-input" />
 						</view>
@@ -72,7 +72,7 @@
 						</view>
 					</view>
 					<view class="content-inputs-row" style="flex-wrap: wrap;">
-						<view class="content-inputs-row-label">命主性别</view>
+						<view class="content-inputs-row-label">性别</view>
 						<view @click="selectRadioByForm" class="content-inputs-row-radioGroup">
 
 							<view data-field="sex" data-value="1" class="content-inputs-row-radioUnchecked"
@@ -87,20 +87,20 @@
 						<view style="color: red;text-align: right;width: 100%;font-size: 24rpx;padding-right: 90rpx;">
 							排盘结果男女有别,请正确选择</view>
 					</view>
-					<view class="content-inputs-row">
+					<!-- <view class="content-inputs-row">
 						<view class="content-inputs-row-label">是否保存</view>
 						<view @click="selectRadioByForm" class="content-inputs-row-radioGroup">
 
 							<view data-field="isSave" data-value="1" class="content-inputs-row-radioUnchecked"
 								:class="{ 'content-inputs-row-radioChecked': form.isSave == 1 }" checked="true">
-								是 <!-- <view style="width: 100%;height: 100%;"></view> -->
+								是 
 							</view>
 							<view data-field="isSave" data-value="0" class="content-inputs-row-radioUnchecked"
 								:class="{ 'content-inputs-row-radioChecked': form.isSave == 0 }" checked="true">
-								否 <!-- <view style="width: 100%;height: 100%;"></view> -->
+								否 
 							</view>
 						</view>
-					</view>
+					</view> -->
 					<view class="content-button">
 						<!-- <navigator url="/pages/forecast/index"> -->
 						<view @click="submitForm" class="content-button-submit">开始排盘</view>
@@ -112,7 +112,23 @@
 			</view>
 
 		</view>
+		<van-popup round close-on-click-overlay safe-area-tab-bar  :show="wxadWatchTip">
+			<view class="wxad">
+				<image src="https://ndata.zzxcx.net/ctjk/mp-wx/future/wxad_bg@2x.png" mode="widthFix"></image>
+				<view class="buttons">
+					<view @click="watchWxAd()" class="button1">
+						<van-icon custom-style="margin-right:10rpx;" color="#A21D0F" name="video-o" /><text>看广告免费领取</text>
+					</view>
+					<view @click="()=>{
+						wxadWatchTip=false
+					}" class="button2">
+						<van-icon custom-style="margin-right:10rpx;" color="#B35B23" name="close" />取消
+					</view>
+				</view>
+			</view>
+
 
+		</van-popup>
 		<custom-tab-bar></custom-tab-bar>
 		<view style="height: 48px;width: 100%;">
 
@@ -123,9 +139,12 @@
 <script>
 import Vue from 'vue';
 import calendar from 'js-calendar-converter'
+import { mapGetters, mapState } from "vuex";
 export default {
 	data() {
 		return {
+
+			wxadWatchTip: true,
 			videoSrc: "https://ndata.zzxcx.net/xpgx-xcx/video/8zi.mp4",
 			videoTime: 0,
 			isWatchFutureVideo: uni.getStorageSync("isWatchFutureVideo") || "0",
@@ -196,58 +215,96 @@ export default {
 			// this.videoSrc = "https://ndata.zzxcx.net/xpgx-xcx/video/8zi.mp4"
 
 		},
-		submitForm() {
+		watchWxAd() {
 			let that = this
-
-			wx.showModal({
-				title: '看广告免费测算',
-				content: '是否观看激励广告',
-				success(res) {
-
-					if (res.confirm) {
-						console.log('用户点击确定')
-						let videoAd = null;
-						if (wx.createRewardedVideoAd) {
-							videoAd = wx.createRewardedVideoAd({
-								adUnitId: "adunit-f0e94618f34d4baf",
-							});
-							videoAd.onLoad(() => { });
-							videoAd.onError((err) => {
-								console.log(err)
-							});
-							videoAd.offClose();
-							videoAd.onClose((res) => {
-								if (!res.isEnded) {
-									return
-								}
-								uni.navigateTo({
-									url: `/pages/forecast/index?birthday=${that.form.birthday + ' ' + that.form.birthHour+':00'}&sex=${that.form.sex}&username=${that.form.username}`
-								})
-							});
-
-							videoAd.show().catch(() => {
-								// 失败重试
-								videoAd
-									.load()
-									.then(() => videoAd.show())
-									.catch((err) => {
-										console.log("激励视频 广告显示失败");
-									});
-							});
-
-						} else if (res.cancel) {
-							console.log('用户点击取消')
-						}
+			let videoAd = null;
+			if (wx.createRewardedVideoAd) {
+				videoAd = wx.createRewardedVideoAd({
+					adUnitId: "adunit-f0e94618f34d4baf",
+				});
+				videoAd.onLoad(() => { });
+				videoAd.onError((err) => {
+					console.log(err)
+				});
+				videoAd.offClose();
+				videoAd.onClose((res) => {
+					if (!res.isEnded) {
+						return
 					}
-				}
+					uni.navigateTo({
+						url: `/pages/forecast/index?birthday=${that.form.birthday + ' ' + that.form.birthHour + ':00'}&sex=${that.form.sex}&username=${that.form.username}`
+					})
+				});
+
+				videoAd.show().catch(() => {
+					// 失败重试
+					videoAd
+						.load()
+						.then(() => videoAd.show())
+						.catch((err) => {
+							console.log("激励视频 广告显示失败");
+						});
+				});
+
+			} else if (res.cancel) {
+				console.log('用户点击取消')
+			}
+		},
+		submitForm() {
+			let that = this
+			if (this.baZiIsPay == '0') {
+				this.wxadWatchTip = true
+				return
+			}
+			// wx.showModal({
+			// 	title: '看广告免费测算',
+			// 	content: '是否观看激励广告',
+			// 	success(res) {
+
+			// 		if (res.confirm) {
+			// 			console.log('用户点击确定')
+			// 			let videoAd = null;
+			// 			if (wx.createRewardedVideoAd) {
+			// 				videoAd = wx.createRewardedVideoAd({
+			// 					adUnitId: "adunit-f0e94618f34d4baf",
+			// 				});
+			// 				videoAd.onLoad(() => { });
+			// 				videoAd.onError((err) => {
+			// 					console.log(err)
+			// 				});
+			// 				videoAd.offClose();
+			// 				videoAd.onClose((res) => {
+			// 					if (!res.isEnded) {
+			// 						return
+			// 					}
+			// 					uni.navigateTo({
+			// 						url: `/pages/forecast/index?birthday=${that.form.birthday + ' ' + that.form.birthHour + ':00'}&sex=${that.form.sex}&username=${that.form.username}`
+			// 					})
+			// 				});
+
+			// 				videoAd.show().catch(() => {
+			// 					// 失败重试
+			// 					videoAd
+			// 						.load()
+			// 						.then(() => videoAd.show())
+			// 						.catch((err) => {
+			// 							console.log("激励视频 广告显示失败");
+			// 						});
+			// 				});
+
+			// 			} else if (res.cancel) {
+			// 				console.log('用户点击取消')
+			// 			}
+			// 		}
+			// 	}
 
-			})
-			// api.openApi.openApiBirthdayLog({
-			// 	name:this.form.name,
-			// 	sex:this.form.sex,
-			// 	birthday:this.form.birthday+' '+this.form.birthHour+':00',
-			// 	isPay:this.form.isPay
 			// })
+			api.openApi.openApiBirthdayLog({
+				name:this.form.name,
+				sex:this.form.sex,
+				birthday:this.form.birthday+' '+this.form.birthHour+':00',
+				isPay:this.form.isPay
+			})
 
 
 
@@ -279,7 +336,15 @@ export default {
 			}
 
 		}
-	}
+	},
+	computed: {
+		...mapState({
+			baZiIsPay: (state) => {
+				return state.user.baZiIsPay
+			}
+		})
+
+	},
 };
 </script>
 
@@ -291,6 +356,47 @@ export default {
 	position: relative;
 	height: 1500rpx;
 
+	.wxad {
+		width: 580rpx;
+		position: relative;
+
+		.buttons {
+			position: absolute;
+			top: 478rpx;
+			display: flex;
+			justify-content: center;
+			height: 202rpx;
+			width: 100%;
+			flex-wrap: wrap;
+
+			.button1 {
+				width: 412rpx;
+				background-image: url('https://ndata.zzxcx.net/ctjk/mp-wx/future/wxad_button1_bg@2x.png');
+				height: 80rpx;
+				background-size: 100% 100%;
+				line-height: 80rpx;
+				font-size: 34rpx;
+				text-align: center;
+				color: #A21D0F;
+				font-weight: bold;
+				border-radius: 20rpx;
+			}
+
+			.button2 {
+				width: 412rpx;
+				height: 80rpx;
+				background-color: #F8D5BA;
+				color: #B35B23;
+				font-size: 34rpx;
+				font-weight: bold;
+				line-height: 80rpx;
+				text-align: center;
+				border-radius: 20rpx;
+
+			}
+		}
+	}
+
 	.video {
 		position: absolute;
 		top: 10vh;

+ 3 - 3
src/store/modules/user.js

@@ -11,7 +11,7 @@ const user = {
 
 		},
 		isVideoFree:"0",
-		baziispay:'0',
+		baZiIsPay:'0',
 		roadExamList:[],
 		openExamRoom: [],
 		userInfo: '',
@@ -32,8 +32,8 @@ const user = {
 		}
 	},
 	mutations: {
-		SET_BAZIISPAY:(state,baziispay)=>{
-			state.baziispay = baziispay
+		SET_BAZIISPAY:(state,baZiIsPay)=>{
+			state.baZiIsPay = baZiIsPay
 		},
 		SET_ISVIDEOFREE:(state,isVideoFree)=>{
 			state.isVideoFree = isVideoFree