Browse Source

bug修改

yuwenjun1997 2 years ago
parent
commit
f0b7d8c0ad

+ 6 - 5
.env.development

@@ -2,12 +2,12 @@
 EVN = 'development'
 
 # 网站地址
-# LOCALHOSE = 'https://zp-b.caimei365.com'
-LOCALHOSE = 'http://192.168.2.92:8888'
+LOCALHOSE = 'https://zp-b.caimei365.com'
+# LOCALHOSE = 'http://192.168.2.92:8888'
 
 # 接口api地址
-# BASE_URL = 'https://zplma-b.caimei365.com'
-BASE_URL = 'http://192.168.2.200:8012'
+BASE_URL = 'https://zplma-b.caimei365.com'
+# BASE_URL = 'http://192.168.2.200:8012'
 # BASE_URL = 'http://192.168.2.67:8012'
 
 # 静态资源文件地址
@@ -17,7 +17,8 @@ STATIC_URL = 'https://static.caimei365.com/www/authentic'
 CIMEI_LOCAL = 'https://www-b.caimei365.com'
 
 # 项目运行地址
-HOST = '192.168.2.92'
+# HOST = '192.168.2.92'
+HOST = '192.168.2.93'
 # HOST = '192.168.1.102'
 
 # 项目端口号

+ 11 - 22
apis/module/common.js

@@ -2,48 +2,37 @@ export default ($axios) => {
   const commonApis = {}
 
   // 订阅号用户登录
-  commonApis.customLogin = (data) =>
-    $axios.post('/wx/user/login/subscribe/verify/code', data)
+  commonApis.customLogin = (data) => $axios.post('/wx/user/login/subscribe/verify/code', data)
 
   // 订阅号用户绑定邀请码登录
-  commonApis.customLoginWithCode = (data) =>
-    $axios.post('/wx/user/login/subscribe/invitation/code', data)
+  commonApis.customLoginWithCode = (data) => $axios.post('/wx/user/login/subscribe/invitation/code', data)
 
   // 服务号微信授权登录
-  commonApis.wechatLogin = (data) =>
-    $axios.post('/wx/user/login/authorization', data)
+  commonApis.wechatLogin = (data) => $axios.post('/wx/user/login/authorization', data)
 
   // 服务号微信授权绑定邀请码登录
-  commonApis.wechatLoginWithCode = (data) =>
-    $axios.post('/wx/user/login/service/invitation/code', data)
+  commonApis.wechatLoginWithCode = (data) => $axios.post('/wx/user/login/service/invitation/code', data)
 
   // 公众号类型
-  commonApis.checkAccountType = (params = {}) =>
-    $axios.get('/wx/sdk/account/type', { params })
+  commonApis.checkAccountType = (params = {}) => $axios.get('/wx/sdk/account/type', { params })
 
   // 获取jssdk配置参数
-  commonApis.initWxConfig = (params = {}) =>
-    $axios.get('/wx/sdk/config/data', { params })
+  commonApis.initWxConfig = (params = {}) => $axios.get('/wx/sdk/config/data', { params })
 
   // 发送验证码
-  commonApis.sendVerifyCode = (data = {}) =>
-    $axios.post('/wx/user/login/verify/code/send', data)
+  commonApis.sendVerifyCode = (data = {}) => $axios.post('/wx/user/login/verify/code/send', data)
 
   // 用户反馈
-  commonApis.feedback = (data = {}) =>
-    $axios.post('/wx/data/feedback/submit', data)
+  commonApis.feedback = (data = {}) => $axios.post('/wx/data/feedback/submit', data)
 
   // 验证token是否到期
-  commonApis.checkToken = (params = {}) =>
-    $axios.get('/wx/user/login/token/check', params)
+  commonApis.checkToken = (params = {}) => $axios.get('/wx/user/login/token/check', params)
 
   // 校验token并返回用户信息
-  commonApis.checkTokenResult = (params) =>
-    $axios.get('/wx/data/token/check', params)
+  commonApis.checkTokenResult = (params) => $axios.get('/wx/data/token/check', params)
 
   // 获取城市列表(树状)
-  commonApis.fetchCityList = (params = {}) =>
-    $axios.get('/wx/address/select', { params })
+  commonApis.fetchCityList = (params = {}) => $axios.get('/wx/address/select', { params })
 
   // 获取城市列表(列表)
   commonApis.fetchAllCityList = () => $axios.get('/wx/address/select/all')

+ 3 - 0
components/GeneralDialog/index.vue

@@ -59,6 +59,9 @@ export default {
     value(val) {
       this.$nextTick(() => {
         val ? document.body.classList.add('scroll-none') : document.body.classList.remove('scroll-none')
+        if (!val) {
+          this.$emit('closed')
+        }
       })
     },
   },

+ 1 - 0
components/SimpleParamList/index.vue

@@ -42,6 +42,7 @@ export default {
         padding-right: 32px;
         white-space: nowrap;
         border-right: 1px solid #d8d8d8;
+        text-align: right;
       }
 
       &.param__row-content {

+ 5 - 1
components/SimpleUploadImage/index.vue

@@ -19,7 +19,7 @@
       <div v-if="tip" slot="tip" class="el-upload__tip">{{ tip }}</div>
       <i slot="default" class="el-icon-plus" />
     </el-upload>
-    <el-dialog :visible.sync="dialogVisible">
+    <el-dialog :visible.sync="dialogVisible" v-if="showDetail">
       <img width="100%" :src="dialogImageUrl" />
     </el-dialog>
   </div>
@@ -66,6 +66,10 @@ export default {
       type: Boolean,
       default: false,
     },
+    showDetail: {
+      type: Boolean,
+      default: true,
+    },
   },
   data() {
     return {

+ 22 - 5
components/SimpleVideoList/index.vue

@@ -3,7 +3,8 @@
     <div class="video-list">
       <div class="video" v-for="(item, index) in list" :key="index" @click="onPlay(item)">
         <div class="cover">
-          <video :src="item.ossUrl"></video>
+          <!-- <video :src="item.ossUrl" :poster="item.cover" crossorigin="anonlymous" autoplay="true"></video> -->
+          <img :src="item.cover" alt="item.title" />
           <div class="name">
             <span>{{ item.title }}</span>
           </div>
@@ -86,11 +87,17 @@ export default {
         height: 248px;
         position: relative;
 
-        video {
+        // video {
+        //   display: block;
+        //   width: 100%;
+        //   height: 100%;
+        //   background: #000;
+        // }
+        img {
           display: block;
           width: 100%;
           height: 100%;
-          background: #fff;
+          background: #000;
         }
 
         .play {
@@ -136,6 +143,7 @@ export default {
           @include ellipsis(1);
           cursor: pointer;
           height: 18px;
+          line-height: 18px;
         }
         .mobile {
           font-size: 14px;
@@ -218,11 +226,18 @@ export default {
         height: 64.4vw;
         position: relative;
 
-        video {
+        // video {
+        //   display: block;
+        //   width: 100%;
+        //   height: 100%;
+        //   background: #000;
+        // }
+
+        img {
           display: block;
           width: 100%;
           height: 100%;
-          background: #fff;
+          background: #000;
         }
 
         .play {
@@ -268,6 +283,7 @@ export default {
           @include ellipsis(1);
           cursor: pointer;
           height: 3.6vw;
+          line-height: 3.6vw;
         }
         .mobile {
           font-size: 3vw;
@@ -286,6 +302,7 @@ export default {
         margin: 0 2.4vw;
         padding-top: 2.4vw;
         line-height: 3.6vw;
+        font-size: 2.6vw;
 
         .praise {
           flex-shrink: 0;

+ 35 - 10
pages/_template/ross/activity/challenge/index.vue

@@ -3,13 +3,13 @@
     <div class="page-top">
       <div class="top-tip-container">
         <transition name="fade">
-          <div class="top-tip" v-show="showMobileStatus">{{ showMobile }} 已报名参赛!</div>
+          <div class="top-tip" v-show="showMobileStatus && activityState === 1">{{ showMobile }} 已报名参赛!</div>
         </transition>
       </div>
     </div>
     <div class="page-content">
       <!-- 视频列表 -->
-      <template v-if="videoList.length > 0">
+      <template v-if="videoListFilter.length > 0">
         <div class="section-title">
           <div class="title">视频排名</div>
           <div class="more" @click="onMoreClick">
@@ -17,11 +17,11 @@
             <span class="iconfont icon-arrow-right"></span>
           </div>
         </div>
-        <SimpleVideoList :list="videoList" @praise="onPraise" />
+        <SimpleVideoList :list="videoListFilter" @praise="onPraise" />
       </template>
       <!-- 活动介绍 -->
       <div class="section-title">
-        <div class="title">活动介绍</div>
+        <!-- <div class="title">活动介绍</div> -->
       </div>
       <div class="activity-content">
         <div class="title">赛事活动介绍</div>
@@ -54,9 +54,20 @@
     </div>
 
     <!-- 资质上传框 -->
-    <GeneralDialog v-model="showDialog" title="上传营业执照" @confirm="onConfirm">
+    <GeneralDialog
+      v-model="showDialog"
+      title="上传营业执照"
+      @confirm="onConfirm"
+      confirmText="提交报名"
+      @closed="onClosed"
+    >
       <div class="general-content">
-        <SimpleUploadImage @success="onImageSuccess" @remove="onImageRemove" :imageList="imageList" />
+        <SimpleUploadImage
+          @success="onImageSuccess"
+          @remove="onImageRemove"
+          :imageList="imageList"
+          :showDetail="false"
+        />
         <div class="tip">提示:请上传您的真实营业执照,以免影响 您的评奖结果!</div>
       </div>
     </GeneralDialog>
@@ -125,7 +136,7 @@ export default {
     }
   },
   computed: {
-    ...mapGetters(['routePrefix', 'authUserId', 'accessToken', 'userInfo', 'authId']),
+    ...mapGetters(['routePrefix', 'authUserId', 'accessToken', 'userInfo', 'authId', 'isPc']),
     // 提示框内容
     promptContent() {
       return this.promptContentMap[this.promptStatus]
@@ -138,11 +149,18 @@ export default {
     signInClubMobileList() {
       return this.singInClubList.map((item) => item.userName.replace(/^(\w{3})\w+(\w{4})$/, '$1****$2'))
     },
+    videoListFilter() {
+      return this.videoList.filter((item, index) => {
+        return index < (this.isPc ? 6 : 4)
+      })
+    },
   },
   created() {
     this.fetchActivityStatus()
     this.fetchVideoList()
-    this.fetchSignInClubList()
+    if (this.activityState === 1) {
+      this.fetchSignInClubList()
+    }
   },
   mounted() {
     // 分享当前页面
@@ -283,10 +301,18 @@ export default {
 
     // 提交资质文件
     onConfirm() {
+      if (!this.formData.licenseOssUrl) {
+        this.$toast('请上传营业执照')
+        return
+      }
       this.showDialog = false
       this.clubSignUpActivity()
     },
 
+    onClosed() {
+      this.imageList = []
+    },
+
     // 文件上传成功
     onImageSuccess({ response, fileList }) {
       this.imageList = fileList
@@ -336,7 +362,6 @@ export default {
         this.listQuery.authUserId = this.authUserId
         this.listQuery.clubUserId = this.userInfo.clubUserId
         const res = await this.$http.api.fetchClubVideoList(this.listQuery)
-        console.log(res)
         this.videoList = res.data.list
       } catch (error) {
         console.log(error)
@@ -346,7 +371,7 @@ export default {
     // 获取用户活动报名状态
     async fetchContestInfo() {
       try {
-        const res = await this.$http.api.checkContestInfo({ mobile: this.userInfo.mobile })
+        const res = await this.$http.api.checkContestInfo({ mobile: this.userInfo.mobile, authUserId: this.authUserId })
         this.signUpStatus = res.data.contestStatus
       } catch (error) {
         console.log(error)

+ 3 - 2
pages/_template/ross/activity/challenge/list.vue

@@ -15,7 +15,7 @@
             <el-input
               placeholder="搜索手机号后四位或机构名称"
               @keyup.enter.native="getList"
-              v-model="listQuery.clubUserName"
+              v-model="listQuery.mobileOrAuthpart"
               clearable
               @clear="getList"
             >
@@ -68,8 +68,8 @@ export default {
       finished: true, // 列表加载是否完毕(加载完了所有数据)
       loadingMore: false, // 是否正在加载
       listQuery: {
+        mobileOrAuthpart: '',
         clubUserId: '',
-        clubUserName: '',
         authUserId: '',
         pageNum: 1,
         pageSize: 20,
@@ -369,6 +369,7 @@ export default {
       text-align: center;
       font-size: 3.6vw;
       line-height: 12vw;
+      z-index: 9;
     }
 
     .page-content {

+ 55 - 23
pages/_template/ross/activity/challenge/publish.vue

@@ -39,7 +39,8 @@
       <div class="video-list">
         <div class="video" v-for="(item, index) in videoList" :key="index" @click="onPlay(item)">
           <div class="cover">
-            <video :src="item.ossUrl"></video>
+            <!-- <video :src="item.ossUrl" :poster="item.cover" crossorigin="anonlymous" autoplay="autoplay"></video> -->
+            <img :src="item.cover" alt="item.title" />
             <div class="name">
               <span>{{ item.title }}</span>
             </div>
@@ -64,6 +65,7 @@
 
 <script>
 import { mapGetters } from 'vuex'
+import { getVideoBase64 } from '~/utils'
 export default {
   layout: 'app-ross',
   data() {
@@ -99,7 +101,11 @@ export default {
     async fetchVideoList() {
       try {
         const { clubUserId, mobile } = this.userInfo
-        const res = await this.$http.api.fetchOwnerVideoList({ mobile: mobile, clubUserId: clubUserId })
+        const res = await this.$http.api.fetchOwnerVideoList({
+          mobile: mobile,
+          clubUserId: clubUserId,
+          authUserId: this.authUserId,
+        })
         this.videoList = res.data
       } catch (error) {
         console.log(error)
@@ -114,6 +120,18 @@ export default {
       }
       try {
         await this.$refs.form.validate()
+        // 生成封面
+        const imageUrl = process.env.EVN === 'development' ? '/flower.mp4' : this.formData.ossUrl
+        const cover = await getVideoBase64(imageUrl)
+        const file = new File([cover], 'cover.jpg', { type: 'image/jpeg' })
+        const formData = new FormData()
+        formData.append('file', file)
+        const res = await fetch(`${process.env.BASE_URL}/wx/upload/image`, {
+          method: 'post',
+          body: formData,
+        })
+        const result = await res.json()
+        this.formData.cover = result.data
         this.publishVideoSave()
       } catch (error) {
         console.log(error)
@@ -156,27 +174,27 @@ export default {
 </script>
 
 <style lang="scss" scoped>
-@media screen and (min-width: 768px) {
-  ::v-deep {
-    .el-form-item__label {
-      font-size: 16px;
-    }
-    .el-textarea .el-input__count {
-      bottom: -32px;
-      background: transparent;
-    }
+::v-deep {
+  .el-form-item__label {
+    font-size: 16px;
+  }
+  .el-textarea .el-input__count {
+    bottom: -32px;
+    background: transparent;
   }
+}
 
-  ::v-deep {
-    .el-input.is-active .el-input__inner,
-    .el-input__inner:focus,
-    .el-textarea__inner:focus,
-    .el-upload--picture-card:hover,
-    .el-upload:focus {
-      border-color: #f3920d;
-    }
+::v-deep {
+  .el-input.is-active .el-input__inner,
+  .el-input__inner:focus,
+  .el-textarea__inner:focus,
+  .el-upload--picture-card:hover,
+  .el-upload:focus {
+    border-color: #f3920d;
   }
+}
 
+@media screen and (min-width: 768px) {
   .page {
     background: #fff;
     padding: 40px 0;
@@ -218,11 +236,18 @@ export default {
             height: 248px;
             position: relative;
 
-            video {
+            // video {
+            //   display: block;
+            //   width: 100%;
+            //   height: 100%;
+            //   background: #000;
+            // }
+
+            img {
               display: block;
               width: 100%;
               height: 100%;
-              background: #fff;
+              background: #000;
             }
 
             .play {
@@ -361,11 +386,18 @@ export default {
             height: 64.4vw;
             position: relative;
 
-            video {
+            // video {
+            //   display: block;
+            //   width: 100%;
+            //   height: 100%;
+            //   background: #000;
+            // }
+
+            img {
               display: block;
               width: 100%;
               height: 100%;
-              background: #fff;
+              background: #000;
             }
 
             .play {

+ 14 - 47
pages/_template/ross/index.vue

@@ -9,14 +9,8 @@
     >
       <div class="page-top flex flex-col justify-center items-center"></div>
       <div class="page-content">
-        <div
-          class="navbar flex items-center flex-col"
-          :style="{ top: offsetTop }"
-        >
-          <nuxt-link
-            :to="routePrefix + '/approve/device'"
-            class="link flex items-center flex-col"
-          >
+        <div class="navbar flex items-center flex-col" :style="{ top: offsetTop }">
+          <nuxt-link :to="routePrefix + '/approve/device'" class="link flex items-center flex-col">
             <span class="icon icon-device"></span>
             <span class="text">设备认证</span>
           </nuxt-link>
@@ -31,11 +25,7 @@
 
         <div class="filter">
           <div class="search">
-            <el-input
-              placeholder="搜索机构"
-              v-model="listQuery.authParty"
-              @change="filterClubList"
-            >
+            <el-input placeholder="搜索机构" v-model="listQuery.authParty" @change="filterClubList">
               <i slot="prefix" class="el-input__icon el-icon-search"></i>
             </el-input>
           </div>
@@ -48,22 +38,13 @@
         <template v-if="starList.length > 0">
           <div class="title flex justify-between px-4 pt-8 pb-6 md:px-0">
             <div>明星机构</div>
-            <nuxt-link :to="routePrefix + '/approve/club/star-list'"
-              >更多<i class="el-icon-arrow-right"></i
-            ></nuxt-link>
+            <nuxt-link :to="routePrefix + '/approve/club/star-list'">更多<i class="el-icon-arrow-right"></i></nuxt-link>
           </div>
           <!-- 列表 -->
           <div class="list">
             <template v-for="item in starList">
-              <div
-                class="section flex justify-between mb-4"
-                :key="item.authId"
-                @click="toDetail(item)"
-              >
-                <img
-                  class="cover"
-                  :src="item.logo || drawLogo(item.authParty)"
-                />
+              <div class="section flex justify-between mb-4" :key="item.authId" @click="toDetail(item)">
+                <img class="cover" :src="item.logo || drawLogo(item.authParty)" />
                 <div class="info">
                   <div class="name" v-text="item.authParty"></div>
                   <div class="mobile">{{ item.mobile || '暂无' }}</div>
@@ -84,11 +65,7 @@
         <!-- 列表 -->
         <div class="list">
           <template v-for="item in list">
-            <div
-              class="section flex justify-between mb-4"
-              :key="item.authId"
-              @click="toDetail(item)"
-            >
+            <div class="section flex justify-between mb-4" :key="item.authId" @click="toDetail(item)">
               <img class="cover" :src="item.logo || drawLogo(item.authParty)" />
               <div class="info">
                 <div class="name" v-text="item.authParty"></div>
@@ -106,11 +83,7 @@
           </template>
         </div>
         <!-- 列表为空 -->
-        <SimpleEmpty
-          v-if="!total && !isRequest"
-          name="icon-empty-club.png"
-          description="敬请期待~"
-        ></SimpleEmpty>
+        <SimpleEmpty v-if="!total && !isRequest" name="icon-empty-club.png" description="敬请期待~"></SimpleEmpty>
       </div>
     </van-list>
   </div>
@@ -249,14 +222,12 @@ export default {
             &:hover {
               .icon {
                 &.icon-device {
-                  background: url(~assets/theme-images/ross/pc-nav-entry-device-active.png)
-                      no-repeat center center,
+                  background: url(~assets/theme-images/ross/pc-nav-entry-device-active.png) no-repeat center center,
                     linear-gradient(180deg, #ffba63 0%, #f3920d 100%);
                   background-size: 48px, 100%;
                 }
                 &.icon-doctor {
-                  background: url(~assets/theme-images/ross/pc-nav-entry-doctor-active.png)
-                      no-repeat center center,
+                  background: url(~assets/theme-images/ross/pc-nav-entry-doctor-active.png) no-repeat center center,
                     linear-gradient(180deg, #ffba63 0%, #f3920d 100%);
                   background-size: 48px, 100%;
                 }
@@ -278,14 +249,12 @@ export default {
               border-radius: 12px;
 
               &.icon-device {
-                background: url(~assets/theme-images/ross/pc-nav-entry-device.png)
-                  no-repeat center center #f6f6f7;
+                background: url(~assets/theme-images/ross/pc-nav-entry-device.png) no-repeat center center #f6f6f7;
                 background-size: 48px;
               }
 
               &.icon-doctor {
-                background: url(~assets/theme-images/ross/pc-nav-entry-doctor.png)
-                  no-repeat center center #f6f6f7;
+                background: url(~assets/theme-images/ross/pc-nav-entry-doctor.png) no-repeat center center #f6f6f7;
                 background-size: 48px;
               }
             }
@@ -468,15 +437,13 @@ export default {
 
             &.icon-device {
               &::after {
-                background: url(~assets/theme-images/ross/pc-nav-entry-device-active.png)
-                  no-repeat center;
+                background: url(~assets/theme-images/ross/pc-nav-entry-device-active.png) no-repeat center;
               }
             }
 
             &.icon-doctor {
               &::after {
-                background: url(~assets/theme-images/ross/pc-nav-entry-doctor-active.png)
-                  no-repeat center;
+                background: url(~assets/theme-images/ross/pc-nav-entry-doctor-active.png) no-repeat center;
               }
             }
           }

BIN
static/flower.mp4


+ 24 - 8
utils/index.js

@@ -53,17 +53,11 @@ export function dateFormat(date = new Date(), format = 'yyyy-MM-dd hh:mm:ss') {
     S: date.getMilliseconds(), // millisecond
   }
   if (/(y+)/.test(format)) {
-    format = format.replace(
-      RegExp.$1,
-      (date.getFullYear() + '').substr(4 - RegExp.$1.length)
-    )
+    format = format.replace(RegExp.$1, (date.getFullYear() + '').substr(4 - RegExp.$1.length))
   }
   for (var k in o) {
     if (new RegExp('(' + k + ')').test(format)) {
-      format = format.replace(
-        RegExp.$1,
-        RegExp.$1.length === 1 ? o[k] : ('00' + o[k]).substr(('' + o[k]).length)
-      )
+      format = format.replace(RegExp.$1, RegExp.$1.length === 1 ? o[k] : ('00' + o[k]).substr(('' + o[k]).length))
     }
   }
   return format
@@ -137,3 +131,25 @@ export function objectCover(target, source) {
   }
   return target
 }
+
+// 获取视频封面
+export function getVideoBase64(url) {
+  return new Promise((resolve, reject) => {
+    const video = document.createElement('video')
+    video.setAttribute('crossOrigin', 'anonlymous')
+    video.setAttribute('preload', 'auto')
+    video.setAttribute('src', url)
+    video.onloadeddata = () => {
+      const canvas = document.createElement('canvas')
+      const width = video.videoWidth
+      const height = video.videoHeight
+      canvas.width = width
+      canvas.height = height
+      canvas.getContext('2d').drawImage(video, 0, 0, width, height)
+      // dataUrl = canvas.toDataURL('image/jpeg')
+      canvas.toBlob((data) => {
+        resolve(data)
+      })
+    }
+  })
+}