Explorar el Código

Merge remote-tracking branch 'origin/branch_qxy_dev' into liuxiangxin

liuxiangxin hace 2 meses
padre
commit
5e30c9f27c
Se han modificado 6 ficheros con 908 adiciones y 213 borrados
  1. 1 1
      pages.json
  2. 36 36
      pages/activity/index.vue
  3. 707 0
      pages/recruitment/lottery_new.vue
  4. 26 22
      pages/user/index.vue
  5. 124 102
      pages/video/detail.vue
  6. 14 52
      pages/video/index.vue

+ 1 - 1
pages.json

@@ -151,7 +151,7 @@
       }
     },
     {
-      "path": "pages/recruitment/lottery",
+      "path": "pages/recruitment/lottery_new",
       "style": {
         "navigationBarTitleText": "新人抽奖"
       }

+ 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>

+ 707 - 0
pages/recruitment/lottery_new.vue

@@ -0,0 +1,707 @@
+<template>
+  <view class="lottery_new">
+    <view class="welcome" :style="pageIndex == 1 ? 'height:auto' : ''">
+      <!-- logo与跑马灯 -->
+      <view class="header">
+        <img :src="lotteryInfo.logo" class="logo" mode="widthFix" />
+        <view class="barrage-box">
+          <view class="text">{{ lottery_list.length == 0 ? '还没有人中奖,快来参与吧!' : lottery_list }}</view>
+        </view>
+      </view>
+
+      <!-- 立即参与页面 -->
+      <view class="page-1" style="padding: 0 16rpx" v-if="pageIndex == 0">
+        <view class="activity-info">
+          <!-- <text class="title">{{ acticve_detail?.name }}</text> -->
+          <view class="active-rule">
+            <rich-text :nodes="lotteryInfo.rule" class="rich_text" style="font-size: 36rpx; font-weight: 300"></rich-text>
+          </view>
+        </view>
+        <view class="activity-btn" @click="_handleChangePage(1)"></view>
+      </view>
+    </view>
+    <view class="lottery" v-if="pageIndex == 1">
+      <view class="lottery_box">
+        <view class="lottery_rule_btn" @click="showRule">活动规则</view>
+        <l-dialer
+          :customStyle="'width: 500rpx;height: 500rpx;margin: 0rpx auto;'"
+          @click="onClick"
+          dial-style="color: rgba(60,48,158,0.7); padding: 32rpx;background-image: url(https://kailin-mp.oss-cn-shenzhen.aliyuncs.com/static/lottery/lottery_bg.png)"
+          :prizeList="prizeList"
+          :turns="5"
+          :duration="3"
+          @done="onDone"
+          ref="dialer"
+        />
+        <view class="lottery_bottom">
+          <view class="lottery_btn" @click="onClick"></view>
+          <view class="lottery_number">可用次数:{{ lotteryInfo.number }}</view>
+        </view>
+        <!-- <view class="lottery_need_score">  </view> -->
+        <view class="lottery_record_title"></view>
+        <view class="lottery_record">
+          <view class="lottery_record_none" v-if="!recordList.length">这里还是空的哦~</view>
+          <scroll-view class="lottery_record_list" scroll-y="true">
+            <view class="lottery_record_item" v-for="(item, index) in recordList" :key="index">
+              <view class="reward_name">获得{{ item.reward_name }}</view>
+              <view class="reward_time">{{ item.insert_time }}</view>
+            </view>
+          </scroll-view>
+        </view>
+      </view>
+      <uni-popup ref="lotteryRule" type="center">
+        <view class="lottery_rule_box">
+          <view class="active-rule">
+            <rich-text :nodes="lotteryInfo.rule" class="rich_text" style="font-size: 36rpx; font-weight: 300"></rich-text>
+          </view>
+          <view class="close-btn" @click="closeRule"></view>
+        </view>
+      </uni-popup>
+      <uni-popup ref="lotteryReward" type="center">
+        <view class="lottery_reward_box">
+          <view class="reward_box">
+            <view :class="['reward_title', reward_info.id == 0 ? 'noGet' : 'get']">{{ reward_info.id == 0 ? '很遗憾' : '恭喜您' }}</view>
+            <view>
+              <img class="reward_image" v-if="reward_info.reward_type == 5" :src="reward_info.img" />
+              <view v-else :class="['reward_image', reward_info.id == 0 ? 'noget' : reward_enum[reward_info.reward_type]]"></view>
+              <view class="reward_name"> {{ reward_info.id == 0 ? '谢谢参与' : reward_info.name }}</view>
+            </view>
+            <view class="reward_btn" @click="closeReward">{{ reward_info.id == 0 ? '我知道了' : '开心收下' }}</view>
+          </view>
+          <view class="close-btn" @click="closeReward"></view>
+        </view>
+      </uni-popup>
+    </view>
+  </view>
+</template>
+
+<script>
+export default {
+  data() {
+    return {
+      lottery_list: '',
+      pageIndex: 0,
+      height: '',
+      // 奖项列表,
+      prizeList: [],
+      // 中奖记录
+      recordList: [],
+      // 地址列表
+      addrList: [],
+      // 抽奖信息
+      lotteryInfo: {
+        id: 0,
+        name: '',
+        logo: '',
+        number: '0',
+        start_date: '',
+        end_date: '',
+        start_time: '',
+        end_time: '',
+        rule: '',
+      },
+      recordId: 0,
+      // 请求参数
+      requestParam: {
+        id: 0,
+        activity_id: 0,
+      },
+      reward_info: {
+        id: 0,
+      },
+      reward_enum: {
+        1: 'score',
+        2: 'coupon',
+        3: 'redpacket',
+        4: 'virtual_good',
+        5: 'goods',
+        6: 'others',
+      },
+    };
+  },
+  onLoad(param) {
+    //未登陆提醒用户登陆
+    try {
+      // 接收参数
+      console.log(param, 'onload  param');
+
+      this.requestParam.id = param.id;
+      this.requestParam.activity_id = param.activity_id;
+      this.pageIndex = param.pageIndex || 0;
+      // 如果有scene参数的话,获取其中的ID
+      if (param.scene) {
+        // 转键值对参数
+        let scene = this.$http.strToParam(param.scene);
+        // 如果没有传入ID,但是传入了场景ID,获取场景ID
+        if (!param.id && scene.id) this.requestParam.id = scene.id;
+      }
+      // 窗口信息
+      var sysinfo = uni.getWindowInfo();
+      // 获取屏幕可用高度
+      this.height = 'height:' + sysinfo.windowHeight + 'px;';
+      // 监听地址变动
+      uni.$on('addr_list_change', (data) => {
+        // 地址列表
+        this.addrList = data.list;
+      });
+      // #ifdef MP-WEIXIN
+      //分享按钮
+      uni.showShareMenu({
+        withShareTicket: true,
+        menus: ['shareAppMessage', 'shareTimeline'],
+      });
+      // #endif
+    } catch (e) {
+      console.log(e);
+    }
+  },
+  onShareAppMessage(obj) {
+    // if (obj) {
+    //   this.shareRequest();
+    // }
+    return {
+      title: '999智控终端平台\n新人抽奖',
+      path: `/pages/recruitment/lottery_new?id=${this.requestParam.id}&activity_id=${this.requestParam.activity_id}`,
+      imageUrl: 'https://kailin-mp.oss-cn-shenzhen.aliyuncs.com/static/lottery/20250210-143021.jpg',
+      promise: new Promise((resolve, reject) => {
+        this.$http.request('api/share_message/get_item', { item_id: this.requestParam.id, pages: '/pages/recruitment/lottery_new' }).then((callback) => {
+          console.log(callback, 'api/share_message/get_item');
+          let obj = {
+            title: callback.data?.title == '' ? this.lotteryInfo.name : callback.data.title,
+            path: '/pages/recruitment/lottery_new?id=' + this.requestParam.id,
+            imageUrl: callback.data?.image_url == '' ? this.lotteryInfo.logo : callback.data.image_url,
+          };
+          resolve(obj);
+        });
+      }),
+    };
+  },
+  onShow() {
+    console.log(this.requestParam, 'onshow  requestParam');
+
+    if (!this.$checkAccess.checkLogin()) {
+      uni.showModal({
+        title: '温馨提示',
+        content: '请先登录',
+        confirmText: '去登录',
+        cancelText: '取消',
+        success: (res) => {
+          if (res.confirm) {
+            uni.redirectTo({
+              url: `/pages/login/index?redirect=/pages/recruitment/lottery_new&id=${this.requestParam.id}`,
+            });
+          }
+        },
+      });
+      return;
+    }
+    // 没有数据的话,或者请求中,不允许刷新
+    if (this.isReqing) return;
+    // 登录提示
+    // if (!this.$checkAccess.alterLogin()) return;
+    // 如果存在产品ID的话
+    if (this.requestParam.id > 0) {
+      // 设置请求中
+      this.isReqing = true;
+      // 请求
+      this.$http.request('api/lottery_recruitment/get_detail', this.requestParam).then((re) => {
+        // 设置非请求中
+        this.isReqing = false;
+        // 成功结果
+        if (re.code == 'success') {
+          this.lotteryInfo = re.data;
+          this.prizeList = re.data.reward_list;
+          this._getRecordList();
+        } else {
+          if (re.code != 'no_login') {
+            uni.showModal({
+              content: re.msg,
+              showCancel: false,
+            });
+          }
+        }
+      });
+      this.showRecord();
+    } else {
+      uni.showModal({
+        content: '未知的活动ID',
+        showCancel: false,
+      });
+    }
+  },
+  methods: {
+    _getRecordList() {
+      this.$http.request('api/lottery_recruitment_record/get_list_all', { lottery_id: this.requestParam.id }).then((res) => {
+        if (res.code == 'success') {
+          if (res.data?.length > 0) {
+            let str = '';
+
+            res.data.forEach((item) => {
+              str += `用户${item.username}已获得${item.reward_name};`;
+            });
+            this.lottery_list = str;
+          }
+        }
+      });
+    },
+    _handleChangePage(index) {
+      this.pageIndex = index;
+    },
+    onDone(index) {
+      this.reward_info = this.prizeList[index];
+      this.$refs.lotteryReward.open('center');
+      this.showRecord();
+      this._getRecordList();
+    },
+    onClick() {
+      // 活动是否开始
+      if (!this.lotteryInfo.id) {
+        uni.showToast({
+          title: '暂无可参与活动',
+          icon: 'none',
+        });
+        return;
+      }
+      // 活动是否开始
+      if (this.lotteryInfo.start_time * 1000 > new Date().getTime()) {
+        uni.showToast({
+          title: '活动还没开始哦',
+          icon: 'none',
+        });
+        return;
+      }
+      // 活动是否结束
+      if (this.lotteryInfo.end_time * 1000 <= new Date().getTime()) {
+        uni.showToast({
+          title: '活动已结束了哦',
+          icon: 'none',
+        });
+        return;
+      }
+      // 次数已用完了
+      if (this.lotteryInfo.number <= 0) {
+        uni.showToast({
+          title: '次数已用完了',
+          icon: 'none',
+        });
+        return;
+      }
+      // if (!this.$checkAccess.getHasFollow()) {
+      //   this.$refs.addFollow.open('center');
+      //   return;
+      // }
+      // 次数操作
+      this.lotteryInfo.number = this.lotteryInfo.number - 1;
+      // 请求列表
+      this.$http.request('/api/lottery_recruitment/get_reward', { lottery_id: this.lotteryInfo.id }).then((re) => {
+        // 设置非请求中
+        this.isReqing = false;
+        // 成功结果
+        if (re.code == 'success') {
+          // 奖品列表更新
+          this.prizeList = re.data.reward_list;
+          // 奖品的索引
+          return this.$refs.dialer.run(re.data.reward_index);
+        } else {
+          uni.showToast({
+            title: re.msg,
+            icon: 'none',
+          });
+          return;
+        }
+      });
+    },
+
+    closePopup() {
+      this.$refs.addFollow.close();
+    },
+    closeReward() {
+      this.$refs.lotteryReward.close();
+      this.reward_info = {};
+    },
+    showRule() {
+      this.$refs.lotteryRule.open('center');
+    },
+    closeRule() {
+      this.$refs.lotteryRule.close();
+    },
+    showRecord() {
+      // 活动是否开始
+      // 请求列表
+      this.$http.request('/api/lottery_recruitment_record/get_list', { lottery_id: this.requestParam.id }).then((re) => {
+        // 设置非请求中
+        this.isReqing = false;
+        // 成功结果
+        if (re.code == 'success') {
+          this.recordList = re.data;
+        } else {
+          this.recordList = [];
+        }
+      });
+    },
+    openAddr(index) {
+      // 选择的下标
+      this.recordIndex = index;
+      // 地址列表
+      this.getAddrList(true);
+    },
+    // 选择地址
+    checkedAddrItem(item) {
+      // 判断数据
+      this.$http.request('api/lottery_recruitment_record/set_addr', { id: this.recordList[this.recordIndex].id, addr_id: item.id }, 'post').then((callback) => {
+        // 获取成功
+        if (callback.code == 'success') {
+          this.recordList[this.recordIndex].status = 1;
+          this.recordList[this.recordIndex].state = '进行中';
+        }
+        this.$refs.addrPopup.close();
+      });
+    },
+    getAddrList(showPopup = false) {
+      // 判断数据
+      this.$http.request('api/custom_addr/get_list').then((callback) => {
+        // 获取成功
+        if (callback.code == 'success') {
+          this.addrList = callback.data;
+          // 如果有的话
+          if (this.addrList.length) {
+            // 获取默认的
+            for (let i in this.addrList) {
+              // 如果是默认的
+              if (this.addrList[i].is_default) this.checkedAddr = this.addrList[i];
+            }
+            // 如果没有默认的话
+            if (!this.checkedAddr.id) {
+              this.checkedAddr = this.addrList[this.addrList.length - 1];
+            }
+          }
+          // 弹出地址层
+          if (showPopup) this.$refs.addrPopup.open('bottom');
+        }
+      });
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped>
+.lottery_new {
+  box-sizing: border-box;
+  position: relative;
+  height: 100vh;
+  .welcome {
+    width: 100vw;
+    height: 100%;
+    display: flex;
+    flex-direction: column;
+    box-sizing: border-box;
+    background: linear-gradient(to bottom, #fedc9f, #ff9861);
+    .header {
+      .logo {
+        width: 100%;
+      }
+      .barrage-box {
+        padding: 10rpx;
+        width: 100%;
+        transform-origin: 65vw 75vw;
+        transform: rotate(0deg);
+        white-space: nowrap;
+        display: flex;
+        justify-content: center;
+        align-items: center;
+        z-index: 3;
+        box-sizing: border-box;
+        background-color: #ff8b37;
+        opacity: 0.8;
+        overflow-x: hidden;
+        margin-top: -6rpx;
+      }
+
+      .text {
+        width: 200vw; //调整文字显示
+        font-size: 16px;
+        color: #333;
+        animation: aniMove 8s linear infinite;
+        animation-fill-mode: forwards;
+      }
+
+      /* 文字滚动 */
+      @keyframes aniMove {
+        0% {
+          transform: translateX(100%);
+        }
+        100% {
+          transform: translateX(-100%);
+        }
+      }
+    }
+
+    .page-1 {
+      width: 100%;
+      display: flex;
+      align-items: center;
+      flex-direction: column;
+      box-sizing: border-box;
+      height: 100%;
+      .activity-info {
+        padding-top: 60rpx;
+        display: flex;
+        flex-direction: column;
+        align-items: center;
+        justify-content: center;
+        width: 100%;
+        .title {
+          font-size: 46rpx;
+          font-weight: bold;
+          color: #fff;
+          text-align: center;
+          margin-bottom: 40rpx;
+        }
+        .active-rule {
+          display: block;
+          font-size: 30rpx;
+          line-height: 40rpx;
+          box-sizing: border-box;
+          margin-bottom: 32rpx;
+          width: 670rpx;
+          height: 609rpx;
+          overflow-y: auto;
+          background-image: url('https://kailin-mp.oss-cn-shenzhen.aliyuncs.com/static/lottery/rule.png');
+          background-repeat: no-repeat;
+          background-size: 100% 100%;
+          padding: 93rpx 48rpx;
+          .rich_text {
+            white-space: break-spaces;
+          }
+        }
+      }
+      .activity-btn {
+        width: 368rpx;
+        height: 108rpx;
+        background-image: url('https://kailin-mp.oss-cn-shenzhen.aliyuncs.com/static/lottery/join.png');
+        background-size: 100% 100%;
+        background-repeat: no-repeat;
+        // background: url('https://kailin-mp.oss-cn-shenzhen.aliyuncs.com/static/lottery/join.png') no-repeat center 100% 100%;
+      }
+    }
+  }
+  .lottery {
+    background-image: url('https://kailin-mp.oss-cn-shenzhen.aliyuncs.com/static/lottery/lottery_background.png');
+    background-size: 100% 100%;
+    background-repeat: no-repeat;
+    width: 100vw;
+    min-height: 100vh;
+    padding-top: 150rpx;
+    .lottery_box {
+      display: block;
+      width: 750rpx;
+      margin: 0 auto;
+      position: relative;
+      .lottery_bottom {
+        background-image: url('https://kailin-mp.oss-cn-shenzhen.aliyuncs.com/static/lottery/lottery_bottom.png');
+        background-size: 100% 100%;
+        background-repeat: no-repeat;
+        width: 512rpx;
+        height: 220rpx;
+        margin: 0 auto;
+        display: flex;
+        flex-direction: column;
+        align-items: center;
+        padding-top: 80rpx;
+        box-sizing: border-box;
+        .lottery_number {
+          color: #fff;
+          font-size: 22rpx;
+          margin-top: 10rpx;
+        }
+        .lottery_btn {
+          width: 285rpx;
+          height: 78rpx;
+          background-image: url('https://kailin-mp.oss-cn-shenzhen.aliyuncs.com/static/lottery/lottery_btn.png');
+          background-repeat: no-repeat;
+          background-size: 100% 100%;
+          animation: pulse 1.5s infinite; /* 添加动画 */
+        }
+        /* 定义动画 */
+        @keyframes pulse {
+          0% {
+            transform: scale(1); /* 初始大小 */
+          }
+          50% {
+            transform: scale(1.2); /* 变大 */
+          }
+          100% {
+            transform: scale(1); /* 恢复原始大小 */
+          }
+        }
+      }
+      .lottery_rule_btn {
+        width: 140rpx;
+        height: 60rpx;
+        background: #fef7db;
+        color: #ff7f00;
+        border-radius: 500rpx 0rpx 0rpx 500rpx;
+        position: absolute;
+        right: 0;
+        top: 0;
+        z-index: inherit;
+        font-size: 26rpx;
+        text-align: center;
+        line-height: 60rpx;
+      }
+      //   .lottery_need_score {
+      //     width: 453rpx;
+      //     height: 35rpx;
+      //     background: #d4430e;
+      //     border-radius: 0rpx 0rpx 0rpx 0rpx;
+      //     font-size: 24rpx;
+      //     color: #fff;
+      //     border-radius: 20rpx;
+      //     text-align: center;
+      //     margin: 20rpx auto 0;
+      //     opacity: 0.5;
+      //   }
+      .lottery_record_title {
+        background-image: url('https://kailin-mp.oss-cn-shenzhen.aliyuncs.com/static/lottery/lottery_record_title.png');
+        background-size: 100% 100%;
+        background-repeat: no-repeat;
+        width: 516rpx;
+        height: 61rpx;
+        margin: 60rpx auto 24rpx;
+      }
+      .lottery_record {
+        background-image: url('https://kailin-mp.oss-cn-shenzhen.aliyuncs.com/static/lottery/lettery_record.png');
+        background-size: 100% 100%;
+        background-repeat: no-repeat;
+        width: 682rpx;
+        height: 456rpx;
+        margin: 0 auto;
+        overflow-y: auto;
+        padding: 56rpx 48rpx;
+        box-sizing: border-box;
+        .lottery_record_none {
+          width: 100%;
+          height: 100%;
+          display: flex;
+          align-items: center;
+          justify-content: center;
+          color: #deb887;
+        }
+        .lottery_record_item {
+          width: 586rpx;
+          height: 93rpx;
+          border-radius: 0rpx 0rpx 0rpx 0rpx;
+          border-bottom: 1rpx solid #e3e3e3;
+          display: flex;
+          justify-content: space-between;
+          align-items: center;
+          .reward_name {
+            color: #333;
+          }
+          .reward_time {
+            font-size: 24rpx;
+            color: #999999;
+          }
+        }
+      }
+    }
+  }
+  .lottery_rule_box {
+    display: flex;
+    flex-direction: column;
+    justify-content: center;
+    align-items: center;
+    .active-rule {
+      display: block;
+      font-size: 30rpx;
+      line-height: 40rpx;
+      box-sizing: border-box;
+      margin-bottom: 32rpx;
+      width: 670rpx;
+      height: 609rpx;
+      overflow-y: auto;
+      background-image: url('https://kailin-mp.oss-cn-shenzhen.aliyuncs.com/static/lottery/rule.png');
+      background-repeat: no-repeat;
+      background-size: 100% 100%;
+      padding: 93rpx 48rpx;
+      .rich_text {
+        white-space: break-spaces;
+      }
+    }
+  }
+  .lottery_reward_box {
+    display: flex;
+    flex-direction: column;
+    justify-content: center;
+    align-items: center;
+    .reward_box {
+      width: 548rpx;
+      height: 658rpx;
+      border-radius: 20rpx;
+      background: linear-gradient(to bottom, #fedc9f, #ff9861);
+      padding: 40rpx 0;
+      box-sizing: border-box;
+      display: flex;
+      flex-direction: column;
+      align-items: center;
+      justify-content: space-between;
+      .reward_title {
+        font-size: 68rpx;
+        font-weight: 400;
+        &.get {
+          color: #ff0000;
+        }
+        &.noGet {
+          color: #fe7b2b;
+        }
+      }
+      .reward_btn {
+        width: 272rpx;
+        height: 77rpx;
+        color: #fff;
+        text-align: center;
+        line-height: 77rpx;
+        background: linear-gradient(180deg, #ff211a 0%, #ffb883 100%);
+        box-shadow: inset 0rpx -2rpx 1rpx 0rpx #fff6b6, inset 0rpx 4rpx 6rpx 0rpx rgba(255, 255, 255, 0.6);
+        border-radius: 50rpx 50rpx 50rpx 50rpx;
+      }
+      .reward_image {
+        width: 208rpx;
+        height: 208rpx;
+        background-size: 100% 100%;
+        background-repeat: no-repeat;
+        &.noget {
+          background-image: url('https://kailin-mp.oss-cn-shenzhen.aliyuncs.com/static/lottery/noget.png');
+        }
+        &.score {
+          background-image: url('https://kailin-mp.oss-cn-shenzhen.aliyuncs.com/static/lottery/score.png');
+        }
+        &.redpacket {
+          background-image: url('https://kailin-mp.oss-cn-shenzhen.aliyuncs.com/static/lottery/redpacket.png');
+        }
+        &.coupon {
+          background-image: url('https://kailin-mp.oss-cn-shenzhen.aliyuncs.com/static/lottery/coupon.png');
+        }
+        &.virtual_good {
+          background-image: url('https://kailin-mp.oss-cn-shenzhen.aliyuncs.com/static/lottery/virtual_good.png');
+        }
+        &.others {
+          background-image: url('https://kailin-mp.oss-cn-shenzhen.aliyuncs.com/static/lottery/others.png');
+        }
+      }
+      .reward_name {
+        color: #333;
+        text-align: center;
+      }
+    }
+  }
+  .close-btn {
+    background-image: url('https://kailin-mp.oss-cn-shenzhen.aliyuncs.com/static/lottery/close_btn.png');
+    background-repeat: no-repeat;
+    background-size: 100% 100%;
+    width: 62rpx;
+    height: 62rpx;
+    margin-top: 32rpx;
+  }
+}
+</style>

+ 26 - 22
pages/user/index.vue

@@ -57,6 +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" 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> 
     </view>
     <view class="alter_info">本程序暂不提供在线交易以及支付功能,您所提交的预约,我们将验证您的购药资质并交由有售卖药品资质的商业公司与您联系确认并提供线下后续服务。</view>
     <view class="packet_content" v-if="show_packet">
@@ -71,9 +75,9 @@ export default {
   data() {
     return {
       userInfo: {
-        username: "请登录",
-        userpic: "https://kailin-mp.oss-cn-shenzhen.aliyuncs.com/static/icon/doctor.png",
-        phone: "kailin",
+        username: '请登录',
+        userpic: 'https://kailin-mp.oss-cn-shenzhen.aliyuncs.com/static/icon/doctor.png',
+        phone: 'kailin',
         status: 0,
         city_id: 0,
       },
@@ -84,36 +88,36 @@ export default {
   onLoad(param) {
     // 存储分享标识
     if (param.share_uid) {
-      uni.setStorageSync("share_uid", param.share_uid);
-      console.log("share_uid", param.share_uid);
+      uni.setStorageSync('share_uid', param.share_uid);
+      console.log('share_uid', param.share_uid);
     }
     // #ifdef MP-WEIXIN
     //分享按钮
     uni.showShareMenu({
       withShareTicket: true,
-      menus: ["shareAppMessage", "shareTimeline"],
+      menus: ['shareAppMessage', 'shareTimeline'],
     });
     // #endif
   },
   onShareAppMessage(obj) {
     //获取当前用户信息
-    let userInfo = uni.getStorageSync("userInfo");
-    let param = "";
+    let userInfo = uni.getStorageSync('userInfo');
+    let param = '';
     if (userInfo.uid) {
-      param = "?share_uid=" + userInfo.uid;
+      param = '?share_uid=' + userInfo.uid;
     }
     // 获取分享信息
     let shareList = getApp().globalData.shareList;
     // 获取分享信息
     let shareObj = {
-      title: "999智控终端平台\n药优惠 得积分 兑豪礼",
+      title: '999智控终端平台\n药优惠 得积分 兑豪礼',
       //path: '/pages/score/lottery',
-      path: "/pages/user/index",
-      imageUrl: "",
+      path: '/pages/user/index',
+      imageUrl: '',
     };
     // 循环列表
     for (let i in shareList) {
-      if (shareList[i].pages == "pages/user/index") {
+      if (shareList[i].pages == 'pages/user/index') {
         shareObj.path = shareList[i].path ? shareList[i].path : shareObj.path;
         shareObj.title = shareList[i].title ? `999智控终端平台\n${shareList[i].title}` : shareObj.title;
         shareObj.imageUrl = shareList[i].image_url ? shareList[i].image_url : shareObj.imageUrl;
@@ -129,20 +133,20 @@ export default {
     // 登录提示
     if (!this.$checkAccess.alterLogin()) return;
     // 判断数据
-    this.$http.request("api/custom/get_info").then((callback) => {
-      if (callback.code == "success") {
-        if (!callback.data.userpic) callback.data.userpic = "https://kailin-mp.oss-cn-shenzhen.aliyuncs.com/static/icon/doctor.png";
+    this.$http.request('api/custom/get_info').then((callback) => {
+      if (callback.code == 'success') {
+        if (!callback.data.userpic) callback.data.userpic = 'https://kailin-mp.oss-cn-shenzhen.aliyuncs.com/static/icon/doctor.png';
         // 赋值
         this.userInfo = callback.data;
         // 存储登录标识
-        uni.setStorageSync("userInfo", callback.data);
+        uni.setStorageSync('userInfo', callback.data);
       }
     });
     this._getPacketNum();
   },
   methods: {
     _getredpacket() {
-      let url = "/pages/redpacket/list";
+      let url = '/pages/redpacket/list';
       if (this.packetList.length == 1) {
         url = `/pages/redpacket/index?packet_id=${this.packetList[0].custom_redpacket_id}`;
       }
@@ -152,18 +156,18 @@ export default {
     },
     _goWithdraw() {
       uni.navigateTo({
-        url: "/pages/user/withdraw",
+        url: '/pages/user/withdraw',
       });
     },
     _goBalance() {
       uni.navigateTo({
-        url: "/pages/balance/index",
+        url: '/pages/balance/index',
       });
     },
     //获取红包数量是否展示红包领取页面
     _getPacketNum() {
-      this.$http.request("api/redpacket/get_list").then((callback) => {
-        if (callback.code == "success") {
+      this.$http.request('api/redpacket/get_list').then((callback) => {
+        if (callback.code == 'success') {
           this.packetList = callback.data.data || [];
           if (callback.data.data.length > 0) {
             this.show_packet = true;

+ 124 - 102
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"
@@ -15,15 +15,17 @@
         @ended="_videoEnd"
         @fullscreenchange="screenChange"
       ></video>
-      <cover-view
-        v-if="videoInfo.learn_status == 0"
-        :class="bigsScreen ? 'bigScreen' : 'cover'"
-      ></cover-view>
+      <cover-view v-if="videoInfo.learn_status == 0" :class="bigsScreen ? 'bigScreen' : 'cover'"></cover-view>
     </view>
     <view class="video_title">{{ videoInfo.name }}</view>
     <view class="rich_text">
       <rich-text :nodes="videoInfo.content"></rich-text>
     </view>
+    <view class="contact_follow" v-if="videoInfo.service?.url">
+      <button class="contact_btn" @click.stop="openCustomer()">
+        <uni-icons type="headphones" size="30" color="#FFFFFF"></uni-icons>
+      </button>
+    </view>
     <uni-popup ref="questionRef" type="center" :is-mask-click="false">
       <view class="popup_content">
         <!-- 答题区域 -->
@@ -32,49 +34,34 @@
           <view class="question_content">{{ questinInfo.question_title }}</view>
           <!-- 问题选项 -->
           <view class="question_options">
-            <view
-              v-for="(option, index) in questinInfo.answer_list"
-              :key="index"
-              :class="['question_answer', { active: answer_id == option.id }]"
-              @click="_selectAnswer(option.id)"
-            >
+            <view v-for="(option, index) in questinInfo.answer_list" :key="index" :class="['question_answer', { active: answer_id == option.id }]" @click="_selectAnswer(option.id)">
               {{ option.value }}
             </view>
           </view>
-          <view
-            :class="['submit_btn', { active: answer_id }]"
-            @click="_submitAnswer"
-            >提交</view
-          >
+          <view :class="['submit_btn', { active: answer_id }]" @click="_submitAnswer">提交</view>
         </view>
         <!-- 结果区域 -->
         <view class="content" v-else>
-          <icon
-            :type="answerInfo.is_answer == 1 ? 'success' : 'cancel'"
-            size="64"
-          />
-          <view class="title">{{
-            answerInfo.is_answer == 1 ? "恭喜您,答对啦!" : "很遗憾,答错了"
-          }}</view>
-          <view class="tip">{{
-            answerInfo.is_answer == 1
-              ? "继续保持,你正在进步!"
-              : "别灰心,再接再厉!"
-          }}</view>
+          <icon :type="answerInfo.is_answer == 1 ? 'success' : 'cancel'" size="64" />
+          <view class="title">{{ answerInfo.is_answer == 1 ? '恭喜您,答对啦!' : '很遗憾,答错了' }}</view>
+          <view class="tip">{{ answerInfo.is_answer == 1 ? '继续保持,你正在进步!' : '别灰心,再接再厉!' }}</view>
           <view class="score_content">
             <view>得分</view>
-            <view
-              :style="answerInfo.get_score == 0 ? 'color:red' : 'color:green'"
-              >+{{ answerInfo.get_score }}</view
-            >
+            <view :style="answerInfo.get_score == 0 ? 'color:red' : 'color:green'">+{{ answerInfo.get_score }}</view>
           </view>
-          <view class="submit_btn active" @click="_goPlayVedio"
-            >继续学习视频</view
-          >
+          <view class="submit_btn active" @click="_goPlayVedio">继续学习视频</view>
         </view>
       </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,9 +70,9 @@ export default {
     return {
       videoInfo: {
         id: 0,
-        name: "",
-        content: "",
-        video_src: "",
+        name: '',
+        content: '',
+        video_src: '',
       },
       // 请求参数
       requestParam: {
@@ -104,6 +91,7 @@ export default {
       answeredQuestions: new Set(), // 新增变量用于存储已回答的问题
       countdown: 0, // 新增变量用于存储倒计时时间
       bigsScreen: false,
+      isVip: true,
     };
   },
   onLoad(param) {
@@ -113,43 +101,40 @@ export default {
     //分享按钮
     uni.showShareMenu({
       withShareTicket: true,
-      menus: ["shareAppMessage", "shareTimeline"],
+      menus: ['shareAppMessage', 'shareTimeline'],
     });
     // #endif
     uni.enableAlertBeforeUnload({
-      message: "您确定要退出学习吗?",
+      message: '您确定要退出学习吗?',
       success: function (res) {
-        console.log("方法注册成功:", res);
+        console.log('方法注册成功:', res);
       },
       fail: function (errMsg) {
-        console.log("方法注册失败:", errMsg);
+        console.log('方法注册失败:', errMsg);
       },
     });
   },
   onUnload() {
-    console.log("页面卸载");
+    console.log('页面卸载');
     clearInterval(this.timer);
   },
   onShareAppMessage(obj) {
     return {
       title: `999智控终端平台\n${this.videoInfo.title}`,
-      path: "/pages/video/detail?id=" + this.videoInfo.id,
+      path: '/pages/video/detail?id=' + this.videoInfo.id,
       promise: new Promise((resolve, reject) => {
         this.$http
-          .request("api/share_message/get_item", {
+          .request('api/share_message/get_item', {
             item_id: this.videoInfo.id,
-            pages: "/pages/video/detail",
+            pages: '/pages/video/detail',
           })
           .then((callback) => {
-            console.log(callback, "api/share_message/get_item");
+            console.log(callback, 'api/share_message/get_item');
             let obj = {
-              title:
-                callback.data?.title == ""
-                  ? `999智控终端平台\n${this.videoInfo.title}`
-                  : callback.data.title,
-              path: "/pages/video/detail?id=" + this.videoInfo.id,
+              title: callback.data?.title == '' ? `999智控终端平台\n${this.videoInfo.title}` : callback.data.title,
+              path: '/pages/video/detail?id=' + this.videoInfo.id,
             };
-            if (callback.data?.image_url !== "") {
+            if (callback.data?.image_url !== '') {
               obj.imageUrl = callback.data.image_url;
             }
             resolve(obj);
@@ -162,34 +147,41 @@ export default {
     // 如果存在产品ID的话
     if (this.requestParam.id > 0) {
       // 请求详情
-      this.$http
-        .request("api/video_course/get_detail", this.requestParam)
-        .then((re) => {
-          // 成功渲染数据
-          if (re.code == "success") {
-            // 刷新数据
-            this.videoInfo = re.data;
-            if (re.data.question_list) {
-              this.questionTime_list = re.data?.question_list.map(
-                (item) => item.play_time
-              );
-            }
-            // 获取视频容器的上下文
-            this.videoContext = uni.createVideoContext("myVideo");
-            // 暂停播放
-            this.videoContext.stop();
-          } else {
-            if (re.code != "no_login") {
-              uni.showModal({
-                content: re.msg,
-                showCancel: false,
-              });
-            }
+      this.$http.request('api/video_course/get_detail', this.requestParam).then((re) => {
+        // 成功渲染数据
+        if (re.code == 'success') {
+          // 刷新数据
+          this.videoInfo = re.data;
+          if (re.data.question_list) {
+            this.questionTime_list = re.data?.question_list.map((item) => item.play_time);
           }
-        });
+          // 获取视频容器的上下文
+          this.videoContext = uni.createVideoContext('myVideo');
+          // 暂停播放
+          this.videoContext.stop();
+        } else {
+          if (re.code != 'no_login') {
+            this.isVip = false;
+            // uni.showModal({
+            //   content: re.msg,
+            //   showCancel: false,
+            // });
+          }
+        }
+      });
     }
   },
   methods: {
+    openCustomer() {
+      // #ifdef MP-WEIXIN
+      console.log(1);
+      wx.openCustomerServiceChat({
+        extInfo: { url: this.videoInfo.service?.url },
+        corpId: this.videoInfo.service?.corpid,
+        success(res) {},
+      });
+      // #endif
+    },
     timeUpdate(event) {
       this.currentTime = event.detail.currentTime; // 更新当前播放时间
 
@@ -204,23 +196,15 @@ export default {
           this._postVideoDuration(this.currentTime, 1);
         }
         // 判断当前时间是否接近答题时间,并且该问题尚未回答
-        if (
-          this.questionTime_list.includes(parseInt(this.currentTime) + 3) &&
-          !this.answeredQuestions.has(parseInt(this.currentTime) + 3)
-        ) {
+        if (this.questionTime_list.includes(parseInt(this.currentTime) + 3) && !this.answeredQuestions.has(parseInt(this.currentTime) + 3)) {
           this.countdown = 3;
           this._startCountdown();
         }
-        if (
-          this.questionTime_list.includes(parseInt(this.currentTime)) &&
-          !this.answeredQuestions.has(parseInt(this.currentTime))
-        ) {
-          this.questinInfo = this.videoInfo.question_list.find(
-            (item) => item.play_time == parseInt(this.currentTime)
-          );
+        if (this.questionTime_list.includes(parseInt(this.currentTime)) && !this.answeredQuestions.has(parseInt(this.currentTime))) {
+          this.questinInfo = this.videoInfo.question_list.find((item) => item.play_time == parseInt(this.currentTime));
           this.videoContext.pause();
           this.videoContext.exitFullScreen();
-          this.$refs.questionRef.open("center");
+          this.$refs.questionRef.open('center');
           //答题时间停止上报
           clearInterval(this.timer);
           this.timer = null;
@@ -228,7 +212,7 @@ export default {
       }
     },
     _videoPlay() {
-      console.log("开始播放");
+      console.log('开始播放');
       this.videoContext.requestFullScreen();
     },
     //上报视频播放时间
@@ -238,14 +222,14 @@ export default {
         this.timer = null;
       }
       this.$http
-        .request("api/video_learn_record/update_playtime", {
+        .request('api/video_learn_record/update_playtime', {
           record_id: this.videoInfo.record_id,
           video_playtime,
           status,
         })
         .then((re) => {
-          if (re.code == "success") {
-            console.log("上报成功", video_playtime, status);
+          if (re.code == 'success') {
+            console.log('上报成功', video_playtime, status);
           }
         });
     },
@@ -254,14 +238,14 @@ export default {
     },
     _submitAnswer() {
       this.$http
-        .request("api/video_learn_answer/play_exam", {
+        .request('api/video_learn_answer/play_exam', {
           record_id: this.videoInfo.record_id,
           course_id: this.questinInfo.course_id,
           question_id: this.questinInfo.question_id,
           answer_id: this.answer_id,
         })
         .then((re) => {
-          if (re.code == "success") {
+          if (re.code == 'success') {
             this.show_answer = true;
             this.answerInfo = re.data;
             // 将当前问题标记为已回答
@@ -274,8 +258,8 @@ export default {
       this.show_answer = false;
       this.$refs.questionRef.close();
       uni.showToast({
-        title: "2秒后切换横屏",
-        icon: "none",
+        title: '2秒后切换横屏',
+        icon: 'none',
         duration: 2000,
       });
       setTimeout(() => {
@@ -287,7 +271,7 @@ export default {
         if (this.countdown > 0) {
           uni.showToast({
             title: `${this.countdown}秒后进入答题`,
-            icon: "none",
+            icon: 'none',
             duration: 1000,
           });
           this.countdown--;
@@ -302,9 +286,9 @@ export default {
       this.videoContext.exitFullScreen();
       this._postVideoDuration(this.currentTime, 1);
       uni.showModal({
-        title: "学习结束",
-        content: "恭喜您学习结束,是否查看报告?",
-        cancelText: "重新学习",
+        title: '学习结束',
+        content: '恭喜您学习结束,是否查看报告?',
+        cancelText: '重新学习',
         success: (res) => {
           if (res.confirm) {
             uni.redirectTo({
@@ -323,7 +307,7 @@ export default {
     },
     screenChange(event) {
       let fullScreen = event.detail.fullScreen;
-      console.log("fullScreen", fullScreen);
+      console.log('fullScreen', fullScreen);
       this.bigsScreen = fullScreen;
     },
   },
@@ -527,4 +511,42 @@ export default {
     }
   }
 }
+.contact_follow {
+  bottom: 30%;
+  right: 20rpx;
+  width: 100rpx;
+  height: 100rpx;
+  display: block;
+  position: fixed;
+  border-radius: 50%;
+  background-color: #1296db;
+  .contact_btn {
+    border: none;
+    width: 100rpx;
+    color: #ffffff;
+    height: 100rpx;
+    padding: 0rpx 0rpx;
+    line-height: 100rpx;
+    text-align: center;
+    border-radius: 50%;
+    background-color: #1296db;
+  }
+  .contact_btn::after {
+    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>

+ 14 - 52
pages/video/index.vue

@@ -16,18 +16,13 @@
         </view>
         <view class="video_btn">
           <button class="after_exam" @click="goExam(item.id, item.report_id, item.learn_status)">
-            {{ item.report_id > 0 ? "查看报告" : "课后评测" }}
+            {{ item.report_id > 0 ? '查看报告' : '课后评测' }}
           </button>
           <button class="to_learn" @click.stop="goDetail(item.id)">开始学习</button>
         </view>
       </view>
     </view>
     <view class="to_bottom" v-if="!videoList.length"> -----您还没有可学习课程-----</view>
-    <view class="contact_follow">
-      <button class="contact_btn" @click.stop="openCustomer()">
-        <uni-icons type="headphones" size="30" color="#FFFFFF"></uni-icons>
-      </button>
-    </view>
   </view>
 </template>
 
@@ -59,11 +54,11 @@ export default {
     // 设置请求中
     this.isReqing = true;
     // 请求列表
-    this.$http.request("api/video_course/get_list", this.requestParam).then((re) => {
+    this.$http.request('api/video_course/get_list', this.requestParam).then((re) => {
       // 设置非请求中
       this.isReqing = false;
       // 成功结果
-      if (re.code == "success") {
+      if (re.code == 'success') {
         if (re.data.last_page <= this.requestParam.page) this.isLast = true;
         this.videoList = re.data.data;
       }
@@ -79,11 +74,11 @@ export default {
     // 设置请求中
     this.isReqing = true;
     // 请求列表
-    this.$http.request("api/video_course/get_list", this.requestParam).then((re) => {
+    this.$http.request('api/video_course/get_list', this.requestParam).then((re) => {
       // 设置非请求中
       this.isReqing = false;
       // 成功结果
-      if (re.code == "success") {
+      if (re.code == 'success') {
         if (re.data.last_page <= this.requestParam.page) this.isLast = true;
         this.videoList = re.data.data;
       }
@@ -102,11 +97,11 @@ export default {
     // 设置请求中
     this.isReqing = true;
     // 请求列表
-    this.$http.request("api/video_course/get_list", this.requestParam).then((re) => {
+    this.$http.request('api/video_course/get_list', this.requestParam).then((re) => {
       // 设置非请求中
       this.isReqing = false;
       // 成功结果
-      if (re.code == "success") {
+      if (re.code == 'success') {
         // 数据
         if (re.data.last_page <= this.requestParam.page) this.isLast = true;
         // 追加数据
@@ -117,36 +112,27 @@ export default {
   methods: {
     goDetail(id) {
       uni.navigateTo({
-        url: "/pages/video/detail?id=" + id,
+        url: '/pages/video/detail?id=' + id,
       });
     },
-	openCustomer(){
-		// #ifdef MP-WEIXIN
-		console.log(1);
-		wx.openCustomerServiceChat({
-		  extInfo: {url: 'https://work.weixin.qq.com/kfid/kfc5de89f024f0b8678'},
-		  corpId: 'wwcdbc686326b51a89',
-		  success(res) {}
-		})
-		// #endif
-	},
+
     goExam(id, report_id, status) {
-      if (status < 0) {
+      if (status !== 1) {
         uni.showToast({
-          title: "请先完成课程再来答题吧",
-          icon: "none",
+          title: '请先完成课程再来答题吧',
+          icon: 'none',
           duration: 2000,
         });
         return;
       }
       if (report_id > 0) {
         uni.navigateTo({
-          url: "/pages/video/record?type=exam&record_id=" + report_id,
+          url: '/pages/video/record?type=exam&record_id=' + report_id,
         });
         return;
       }
       uni.navigateTo({
-        url: "/pages/video/exam?id=" + id,
+        url: '/pages/video/exam?id=' + id,
       });
     },
   },
@@ -244,28 +230,4 @@ export default {
     }
   }
 }
-.contact_follow {
-  bottom: 30%;
-  right: 20rpx;
-  width: 100rpx;
-  height: 100rpx;
-  display: block;
-  position: fixed;
-  border-radius: 50%;
-  background-color: #1296db;
-  .contact_btn {
-    border: none;
-    width: 100rpx;
-    color: #ffffff;
-    height: 100rpx;
-    padding: 0rpx 0rpx;
-    line-height: 100rpx;
-    text-align: center;
-    border-radius: 50%;
-    background-color: #1296db;
-  }
-  .contact_btn::after {
-    border: none;
-  }
-}
 </style>