钱新宇 2 месяцев назад
Родитель
Сommit
cb06b771aa
3 измененных файлов с 67 добавлено и 43 удалено
  1. 36 36
      pages/activity/index.vue
  2. 2 2
      pages/user/index.vue
  3. 29 5
      pages/video/detail.vue

+ 36 - 36
pages/activity/index.vue

@@ -25,7 +25,7 @@
     <view class="page-2" v-if="pageIndex == 2">
       <!-- 题干区域 -->
       <view class="question">
-        <text style="font-weight: bold">猜灯谜:{{ question.title }}</text>
+        <text style="font-weight: bold">{{ question.title }}</text>
         <br />
         <view style="margin-top: 20rpx">(请从下面选择正确答案提交)</view>
       </view>
@@ -98,11 +98,11 @@
 </template>
 
 <script setup>
-import { ref, getCurrentInstance } from "vue";
+import { ref, getCurrentInstance } from 'vue';
 
-import { onShareAppMessage, onLoad, onShow } from "@dcloudio/uni-app";
+import { onShareAppMessage, onLoad, onShow } from '@dcloudio/uni-app';
 
-import http from "@/utils/request";
+import http from '@/utils/request';
 
 const { appContext } = getCurrentInstance();
 const $checkAccess = appContext.config.globalProperties.$checkAccess;
@@ -110,7 +110,7 @@ const $checkAccess = appContext.config.globalProperties.$checkAccess;
 const pageIndex = ref(1);
 
 const question = ref({
-  title: "",
+  title: '',
   answer_list: [],
 });
 
@@ -124,7 +124,7 @@ const answer_id = ref(null);
 
 const is_answer = ref(false);
 
-const lottery_list = ref("还没有人中奖,快来参与吧!");
+const lottery_list = ref('还没有人中奖,快来参与吧!');
 
 const isFromIndex = ref(false);
 
@@ -136,10 +136,10 @@ onLoad((options) => {
   //未登陆提醒用户登陆
   if (!$checkAccess.checkLogin()) {
     uni.showModal({
-      title: "温馨提示",
-      content: "请先登录",
-      confirmText: "去登录",
-      cancelText: "取消",
+      title: '温馨提示',
+      content: '请先登录',
+      confirmText: '去登录',
+      cancelText: '取消',
       success: (res) => {
         if (res.confirm) {
           uni.redirectTo({
@@ -160,23 +160,23 @@ onLoad((options) => {
   //分享按钮
   uni.showShareMenu({
     withShareTicket: true,
-    menus: ["shareAppMessage", "shareTimeline"],
+    menus: ['shareAppMessage', 'shareTimeline'],
   });
   // #endif
 });
 
 onShow(() => {
-  console.log("回到小程序");
+  console.log('回到小程序');
 
   if (detialId.value) {
     _getDeatail(detialId.value);
   }
 
   if ($checkAccess.checkLogin()) {
-    http.request("api/custom/get_info").then((callback) => {
-      if (callback.code == "success") {
+    http.request('api/custom/get_info').then((callback) => {
+      if (callback.code == 'success') {
         // 存储登录标识
-        uni.setStorageSync("userInfo", callback.data);
+        uni.setStorageSync('userInfo', callback.data);
       }
     });
   }
@@ -192,12 +192,12 @@ onShareAppMessage((res) => {
     path: `/pages/activity/index?id=${detialId.value}`,
     imageUrl: acticve_detail.value.logo,
     promise: new Promise((resolve, reject) => {
-      http.request("api/share_message/get_item", { item_id: detialId.value, pages: "/pages/activity/index" }).then((callback) => {
-        console.log(callback, "api/share_message/get_item");
+      http.request('api/share_message/get_item', { item_id: detialId.value, pages: '/pages/activity/index' }).then((callback) => {
+        console.log(callback, 'api/share_message/get_item');
         resolve({
-          title: callback.data?.title == "" ? acticve_detail.value.name : callback.data.title,
+          title: callback.data?.title == '' ? acticve_detail.value.name : callback.data.title,
           path: `/pages/activity/index?id=${detialId.value}`,
-          imageUrl: callback.data?.image_url == "" ? acticve_detail.value.logo : callback.data.image_url,
+          imageUrl: callback.data?.image_url == '' ? acticve_detail.value.logo : callback.data.image_url,
         });
       });
     }),
@@ -210,9 +210,9 @@ const _handleCloseLottery = () => {
 
 const _getDeatail = (id) => {
   if (!id) return;
-  http.request("api/riddle_active/get_detail", { id }).then((response) => {
+  http.request('api/riddle_active/get_detail', { id }).then((response) => {
     console.log(response);
-    if (response.code == "success") {
+    if (response.code == 'success') {
       uni.setNavigationBarTitle({
         title: response.data.name,
       });
@@ -221,10 +221,10 @@ const _getDeatail = (id) => {
         _getQuestion();
         pageIndex.value = 1;
       }
-      http.request("api/lottery_riddle_record/get_list_all", { lottery_id: response.data.lottery_id }).then((res) => {
-        if (res.code == "success") {
+      http.request('api/lottery_riddle_record/get_list_all', { lottery_id: response.data.lottery_id }).then((res) => {
+        if (res.code == 'success') {
           if (res.data?.length > 0) {
-            let str = "";
+            let str = '';
 
             res.data.forEach((item) => {
               str += `用户${item.username}已获得${item.reward_name};`;
@@ -238,15 +238,15 @@ const _getDeatail = (id) => {
       console.log(response);
       uni.showToast({
         title: response.msg,
-        icon: "none",
+        icon: 'none',
       });
     }
   });
 };
 
 const _getQuestion = () => {
-  http.request("api/riddle_question/get_question").then((response) => {
-    if (response.code == "success") {
+  http.request('api/riddle_question/get_question').then((response) => {
+    if (response.code == 'success') {
       question.value = response.data;
     }
   });
@@ -263,31 +263,31 @@ const _handleSubmitAnswer = () => {
     question_id: question.value.id,
     answer_id: answer_id.value,
   };
-  http.request("api/riddle_answer/check_answer", _param).then((response) => {
-    if (response.code == "success") {
+  http.request('api/riddle_answer/check_answer', _param).then((response) => {
+    if (response.code == 'success') {
       pageIndex.value = 3;
       //   _getDeatail(detialId.value);
       is_answer.value = response.data.is_answer;
     } else {
       uni.showToast({
         title: response.msg,
-        icon: "none",
+        icon: 'none',
       });
     }
   });
 };
 
 const _addShare = () => {
-  http.request("api/riddle_active_share/add", { active_id: detialId.value }).then((response) => {});
+  http.request('api/riddle_active_share/add', { active_id: detialId.value }).then((response) => {});
 };
 
 const _goLottery = () => {
   if (!$checkAccess.checkLogin()) {
     uni.showModal({
-      title: "温馨提示",
-      content: "请先登录",
-      confirmText: "去登录",
-      cancelText: "取消",
+      title: '温馨提示',
+      content: '请先登录',
+      confirmText: '去登录',
+      cancelText: '取消',
       success: (res) => {
         if (res.confirm) {
           uni.redirectTo({
@@ -319,7 +319,7 @@ const _handleChangePage = (index) => {
 };
 
 const _handleChangeRule = (type) => {
-  if (type == "show") lotteryRule.value.open("center");
+  if (type == 'show') lotteryRule.value.open('center');
   else lotteryRule.value.close();
 };
 </script>

+ 2 - 2
pages/user/index.vue

@@ -57,10 +57,10 @@
         <image class="navigator_image" src="https://kailin-mp.oss-cn-shenzhen.aliyuncs.com/static/user/article.png" mode=""></image>
         <view class="navigator_title">资讯</view>
       </navigator>
-<!--      <navigator class="navigator_item" url="/pages/video/index">
+	  <navigator class="navigator_item" url="/pages/video/index" v-if="userInfo.is_video_vip == 1">
         <image class="navigator_image" src="https://kailin-mp.oss-cn-shenzhen.aliyuncs.com/static/user/video.png" mode=""></image>
         <view class="navigator_title">学习</view>
-      </navigator> -->
+      </navigator> 
     </view>
     <view class="alter_info">本程序暂不提供在线交易以及支付功能,您所提交的预约,我们将验证您的购药资质并交由有售卖药品资质的商业公司与您联系确认并提供线下后续服务。</view>
     <view class="packet_content" v-if="show_packet">

+ 29 - 5
pages/video/detail.vue

@@ -1,5 +1,5 @@
 <template>
-  <view>
+  <view v-if="isVip">
     <view class="video_play" v-if="videoInfo.video_src">
       <video
         id="myVideo"
@@ -54,6 +54,14 @@
       </view>
     </uni-popup>
   </view>
+  <view v-else>
+    <view class="not_vip">
+      <image src="https://kailin-mp.oss-cn-shenzhen.aliyuncs.com/static/icon/is_no_vip.png" style="width: 300rpx; height: 252rpx" />
+      <view class="content">
+        <text>您还不是会员,暂时无法观看视频,请联系客服。</text>
+      </view>
+    </view>
+  </view>
 </template>
 
 <script>
@@ -83,6 +91,7 @@ export default {
       answeredQuestions: new Set(), // 新增变量用于存储已回答的问题
       countdown: 0, // 新增变量用于存储倒计时时间
       bigsScreen: false,
+      isVip: true,
     };
   },
   onLoad(param) {
@@ -152,10 +161,11 @@ export default {
           this.videoContext.stop();
         } else {
           if (re.code != 'no_login') {
-            uni.showModal({
-              content: re.msg,
-              showCancel: false,
-            });
+            this.isVip = false;
+            // uni.showModal({
+            //   content: re.msg,
+            //   showCancel: false,
+            // });
           }
         }
       });
@@ -525,4 +535,18 @@ export default {
     border: none;
   }
 }
+.not_vip {
+  background-color: #ddd;
+  width: 100vw;
+  height: 100vh;
+  display: flex;
+  align-items: center;
+  flex-direction: column;
+  justify-content: center;
+  .content {
+    width: 70%;
+    margin-top: 20rpx;
+    text-align: center;
+  }
+}
 </style>