bding 10 mesiacov pred
rodič
commit
d925ea7bcf

+ 6 - 0
App.vue

@@ -25,6 +25,12 @@
 				fail:function(res){
 				}
 			})
+			
+			// 用户通过分享看看有没有code
+			if (options.query && options.query.InviteShareCode) {
+				console.log('进来了没有?');
+				this.$store.commit("getInviteShareCode", options.query.InviteShareCode);
+			}
 
 			// 开启ios静音也行播放语音
 			wx.setInnerAudioOption({

+ 16 - 0
api/report.js

@@ -183,4 +183,20 @@ export const apiPublicBannerMark = params=>{
  */
 export const apiPublicBannerList = params=>{
     return httpGet('/public/banner/list',params)
+}
+
+/**
+ * banner图获取报名二维码
+ * @returns 
+ */
+export const bannerGetQrcode = params=>{
+    return httpGet('/public/banner/get_qrcode',params)
+}
+/**
+ * 报名调研活动
+
+ * @returns 
+ */
+export const bannerSignup = params=>{
+    return httpGet('/public/banner/signup',params)
 }

+ 198 - 9
pages-report/disseminatePage/disseminatePage.vue

@@ -1,20 +1,47 @@
 <template>
   <view class="poster-img-content">
-    <image v-if="imgBg" show-menu-by-longpress mode="widthFix" :src="imgBg"></image>
+    <image v-if="enable==1" @click="canvasGet" src="https://hzstatic.hzinsights.com/yb_xcx/download-img.png" class="download-img">
+    <image @click="detailGo" src="https://hzstatic.hzinsights.com/static/icon/hzyb/default_avatar.png" class="download-img download-img-two">
+    <image v-if="imgBg" mode="widthFix" :src="imgBg"></image>
+    <view class="code">
+      <image v-if="imgBg" show-menu-by-longpress mode="widthFix" :src="qrcodeImg"></image>
+    </view>
+
+    <canvas
+      class="canvas-bg"
+      canvas-id="canvasDom"
+      id="canvasDom"
+      bindtouchstart=""
+      bindtouchmove=""
+      bindtouchend=""
+      bindtouchcancel=""
+      bindlongtap=""
+      binderror=""
+      :style="{ width: canvasW + 'px', height: canvasH + 'px' }"
+    ></canvas>
   </view>
 </template>
 
 <script>
+import { bannerGetQrcode } from "@/api/report";
 export default {
   data() {
     return {
       imgBg: "",
       title: "",
+      canvasH: 0,
+      canvasW: 0,
+      bannerId: "",
+      qrcodeImg: "",
+      enable: 0,
     };
   },
   onLoad(op) {
-    this.imgBg = op.imgHb;
+    this.imgBg = decodeURIComponent(op.imgHb);
     this.title = op.title;
+    this.bannerId = op.id;
+    this.enable = op.enable;
+    this.enable == 1 && this.getQrcCode();
     uni.setNavigationBarTitle({
       title: this.title,
     });
@@ -22,24 +49,186 @@ export default {
   onShareAppMessage() {
     return {
       title: this.title,
-      path: "/pages-report/disseminatePage/disseminatePage?imgHb=" + this.imgBg + "&title=" + this.title,
+      path:
+        "/pages-report/disseminatePage/disseminatePage?imgHb=" +
+        this.imgBg +
+        "&title=" +
+        this.title +
+        "&id=" +
+        this.bannerId +
+        "&InviteShareCode=" +
+        this.userInfo.user_id +
+        "&enable=" +
+        item.enable,
     };
   },
+  methods: {
+    // 背景图的canvas
+    renderCanvas() {
+      const SystemInfo = uni.getSystemInfoSync();
+      wx.getImageInfo({
+        src: this.imgBg,
+        success: (res) => {
+          const temPath = res.path;
+          this.canvasW = SystemInfo.windowWidth * 2;
+          this.canvasH = res.height / (res.width / this.canvasW);
+          this.drawImg(temPath);
+        },
+        fail(err) {
+          reject(err);
+        },
+      });
+    },
+    // 二维码的canvas
+    drawImg(path) {
+      let ctx = uni.createCanvasContext("canvasDom", this);
+      ctx.drawImage(path, 0, 0, this.canvasW, this.canvasH);
+      wx.getImageInfo({
+        src: this.qrcodeImg,
+        success: (res) => {
+          ctx.drawImage(
+            res.path,
+            this.canvasW * 0.5 - res.width / 2,
+            this.canvasH - 430,
+            res.width,
+            res.height
+          );
+          ctx.draw();
+        },
+        fail(err) {
+          reject(err);
+        },
+      });
+    },
+
+    // 上线前删除
+    detailGo() {
+      const title = encodeURIComponent("迪拜&阿布扎比");
+
+      uni.navigateTo({
+        url:
+          "/pages-report/signUpPage/signUpPage?RealName=席子文&CompanyName=杭州大式数字科技有限公司&Mobile=15906624664&BannerId=4&Title=" +
+          title,
+      });
+
+      return;
+    },
+    // 保存二维码到本地
+    canvasGet() {
+      uni.canvasToTempFilePath({
+        canvasId: "canvasDom",
+        success: (res) => {
+          wx.saveImageToPhotosAlbum({
+            filePath: res.tempFilePath,
+            success: function (data) {
+              uni.showToast({
+                title: "保存成功",
+                duration: 2000,
+              });
+            },
+            fail: function (err) {
+              if (
+                err.errMsg === "saveImageToPhotosAlbum:fail:auth denied" ||
+                err.errMsg === "saveImageToPhotosAlbum:fail auth deny" ||
+                err.errMsg ===
+                  "saveImageToPhotosAlbum:fail authorize no response"
+              ) {
+                // 这边微信做过调整,必须要在按钮中触发,因此需要在弹框回调中进行调用
+                wx.showModal({
+                  title: "提示",
+                  content: "需要您授权保存相册",
+                  showCancel: false,
+                  success: (modalSuccess) => {
+                    wx.openSetting({
+                      success(settingdata) {
+                        if (settingdata.authSetting["scope.writePhotosAlbum"]) {
+                          wx.showModal({
+                            title: "提示",
+                            content: "获取权限成功,再次点击图片即可保存",
+                            showCancel: false,
+                          });
+                        } else {
+                          wx.showModal({
+                            title: "提示",
+                            content: "获取权限失败,将无法保存到相册哦~",
+                            showCancel: false,
+                          });
+                        }
+                      },
+                      fail(failData) {
+                        // console.log("failData", failData);
+                      },
+                      complete(finishData) {
+                        // console.log("finishData", finishData);
+                      },
+                    });
+                  },
+                });
+              }
+            },
+          });
+        },
+        fail: () => {
+          // console.log("下载失败");
+        },
+      });
+    },
+
+    // 获取code 二维码
+    async getQrcCode() {
+      const res = await bannerGetQrcode({
+        UserId: this.userInfo.user_id,
+        BannerId: this.bannerId,
+        Remark: this.title,
+      });
+      if (res.code == 200) {
+        this.qrcodeImg = res.data;
+      }
+    },
+  },
+  onShow() {
+    this.enable == 1 && this.renderCanvas();
+  },
 };
 </script>
-
+<style>
+page {
+  padding: 0;
+}
+</style>
 <style lang="scss" scoped>
 .poster-img-content {
   width: 100%;
   overflow: hidden;
+  position: relative;
   image {
     width: 100%;
     height: 100%;
   }
+  .code {
+    position: absolute;
+    width: 300rpx;
+    height: 300rpx;
+    left: 50%;
+    bottom: 180rpx;
+    transform: translateX(-50%);
+  }
+  .canvas-bg {
+    position: absolute;
+    left: 10000rpx;
+  }
+  .download-img {
+    position: fixed;
+    display: block;
+    width: 100rpx;
+    height: 100rpx;
+    right: 35rpx;
+    bottom: 200rpx;
+    z-index: 99;
+  }
+  .download-img-two {
+    bottom: 300rpx;
+  }
 }
 </style>
-<style>
-page {
-  padding: 0;
-}
-</style>
+

+ 234 - 0
pages-report/signUpPage/signUpPage.vue

@@ -0,0 +1,234 @@
+<template>
+  <view class="sign-up-page" v-if="!isSignStatus">
+    <block>
+      <view class="content-sign">
+        <view class="sign-title">{{ dataInfo.Title }}</view>
+        <view class="sign-info-txt">报名信息</view>
+        <view class="sign-info">
+          <view class="lable">公司名称</view>
+          <van-field
+            class="input-custom-class"
+            clearable
+            :value="form.name"
+            placeholder="请输入姓名"
+            @change="inputChange('name', $event)"
+          />
+          <view class="lable">姓名</view>
+          <van-field
+            class="input-custom-class"
+            clearable
+            :value="form.companyName"
+            placeholder="请输入公司名"
+            @change="inputChange('companyName', $event)"
+          />
+          <view class="lable">手机号</view>
+          <van-field
+            class="input-custom-class"
+            clearable
+            type="number"
+            :value="form.mobile"
+            placeholder="请输入手机号"
+            @change="inputChange('mobile', $event)"
+          />
+        </view>
+      </view>
+      <view class="content-share-user">
+        <view class="user-info-txt">分享人信息</view>
+        <view class="user-item">姓名:{{ dataInfo.RealName }} </view>
+        <view class="user-item">联系方式:{{ dataInfo.Mobile }}</view>
+      </view>
+      <image
+        class="sign-up-logo"
+        src="https://hzstatic.hzinsights.com/yb_xcx/sign-up-logo.png"
+      ></image>
+      <view class="sign-button">
+        <view class="button" @click="submit">提交报名</view>
+      </view>
+    </block>
+  </view>
+  <view class="status-sign-box" v-else>
+    <image
+      class="sign-success"
+      src="https://hzstatic.hzinsights.com/yb_xcx/sign-success.png"
+    ></image>
+    <view class="success-txt">报名成功</view>
+    <view>对口销售会尽快联系您!</view>
+  </view>
+</template>
+
+<script>
+import { bannerSignup } from "@/api/report";
+
+export default {
+  data() {
+    return {
+      form: {
+        name: "",
+        companyName: "",
+        mobile: "",
+      },
+      isSignStatus: false,
+      dataInfo: {
+        BannerId: "",
+        CompanyName: "",
+        Mobile: "",
+        RealName: "",
+        Title: "",
+      },
+    };
+  },
+  methods: {
+    // 双向绑定输入框
+    inputChange(key, event) {
+      this.form[key] = event.detail;
+    },
+    // 提交报名信息
+    async submit() {
+      let params = {
+        RealName: this.dataInfo.RealName,
+        CompanyName: this.dataInfo.CompanyName,
+        Mobile: this.dataInfo.Mobile,
+        BannerId: this.dataInfo.BannerId,
+        CustomName: this.form.name,
+        CustomMobile: this.form.mobile,
+        CustomCompanyName: this.form.companyName,
+      };
+      if (!params.CustomCompanyName) {
+        uni.showToast({
+          title: "请填写公司名",
+          icon: "none",
+        });
+        return;
+      }
+      if (!params.CustomName) {
+        uni.showToast({
+          title: "请填写姓名",
+          icon: "none",
+        });
+        return;
+      }
+      if (!params.CustomMobile) {
+        uni.showToast({
+          title: "请填写手机号",
+          icon: "none",
+        });
+        return;
+      }
+      const res = await bannerSignup(params);
+      if (res.code == 200) {
+        this.isSignStatus = true;
+      }
+    },
+  },
+  onLoad(op) {
+    this.dataInfo = op;
+    this.dataInfo.Title = decodeURIComponent(op.Title);
+    this.dataInfo.CompanyName = decodeURIComponent(op.CompanyName);
+  },
+};
+</script>
+<style>
+page {
+  padding: 0;
+}
+.input-custom-class .van-cell {
+  border: 1rpx solid #dcdfe6;
+  border-radius: 8rpx;
+  margin-bottom: 40rpx;
+}
+</style>
+<style lang="scss" scoped>
+.sign-up-page {
+  position: relative;
+  background: #f4f5fa;
+  padding: 70rpx 34rpx 0;
+  height: 100vh;
+  .content-sign {
+    background-color: #fff;
+    padding: 40rpx;
+    border-radius: 16rpx;
+    color: #333;
+    .sign-title {
+      width: 100%;
+      font-size: 34rpx;
+      font-weight: 500;
+      text-align: center;
+    }
+    .sign-info-txt {
+      font-size: 28rpx;
+      font-weight: 500;
+      margin: 40rpx 0 20rpx;
+    }
+    .sign-info {
+      .lable {
+        font-size: 28rpx;
+        line-height: 36rpx;
+        margin-bottom: 20rpx;
+      }
+    }
+  }
+  .content-share-user {
+    margin-top: 30rpx;
+    background-color: #fff;
+    color: #333333;
+    width: 100%;
+    height: 208rpx;
+    padding: 40rpx;
+    border-radius: 8rpx;
+    .user-info-txt {
+      font-size: 28rpx;
+      font-weight: 500;
+      margin-bottom: 20rpx;
+    }
+  }
+  .sign-up-logo {
+    display: block;
+    width: 588rpx;
+    height: 305rpx;
+    margin: 0 auto;
+  }
+  view {
+    box-sizing: border-box;
+  }
+  .sign-button {
+    position: sticky;
+    left: 0;
+    bottom: 0;
+    display: flex;
+    align-items: center;
+    justify-content: center;
+    width: calc(100% + 80rpx);
+    margin-left: -40rpx;
+    height: 176rpx;
+    color: #fff;
+    background-color: #fff;
+    z-index: 9;
+    .button {
+      width: 654rpx;
+      height: 80rpx;
+      line-height: 80rpx;
+      text-align: center;
+      border-radius: 12rpx;
+      background-color: #0052d9;
+    }
+  }
+}
+.status-sign-box {
+  width: 100%;
+  height: 100vh;
+  background-color: #fff;
+  padding-top: 333rpx;
+  text-align: center;
+  color: #333;
+  font-size: 34rpx;
+  font-weight: 600;
+  .sign-success {
+    width: 200rpx;
+    height: 200rpx;
+  }
+  .success-txt {
+    margin: 40rpx 0 50rpx;
+  }
+}
+</style>
+s

+ 8 - 0
pages.json

@@ -329,6 +329,14 @@
                 		"navigationBarTitleText" : "调研列表",
                 		"enablePullDownRefresh" : false
                 	}
+                },
+                {
+                	"path" : "signUpPage/signUpPage",
+                	"style" : 
+                	{
+                		"navigationBarTitleText" : "报名",
+                		"enablePullDownRefresh" : false
+                	}
                 }
             ]
 		},

+ 341 - 350
pages/report/report.vue

@@ -1,74 +1,67 @@
 <template>
   <view class="report-page">
     <view class="top-sticky" style="background: #fff">
-    <!-- 导航 -->
-    <view class="nav-bar-wrap" :style="{height:navBarStyle.height,paddingTop:navBarStyle.paddingTop,paddingBottom:navBarStyle.paddingBottom}">
-      <view class="content">
-		  <view class="avatar" @click="goUser">
-			<image style="width:100%;height:100%;border-radius: 50%" :src="userInfo.head_img_url" mode="aspectFill"/>
-		  </view>
-      <view class="search-box" @click="goSearch">
-         <van-icon custom-class="search-icon" name="search" size="20px" />
-         搜索
-      </view>
+      <!-- 导航 -->
+      <view class="nav-bar-wrap" :style="{ height: navBarStyle.height, paddingTop: navBarStyle.paddingTop, paddingBottom: navBarStyle.paddingBottom }">
+        <view class="content">
+          <view class="avatar" @click="goUser">
+            <image style="width: 100%; height: 100%; border-radius: 50%" :src="userInfo.head_img_url" mode="aspectFill" />
+          </view>
+          <view class="search-box" @click="goSearch">
+            <van-icon custom-class="search-icon" name="search" size="20px" />
+            搜索
+          </view>
+        </view>
       </view>
-    </view>
-    <!-- swiper -->
-	    <view class="content-swiper" v-if="bannerDataList.length">
-        <swiper autoplay :interval="4000" circular >
+      <!-- swiper -->
+      <view class="content-swiper" v-if="bannerDataList.length">
+        <swiper autoplay :interval="4000" circular>
           <view v-for="item in bannerDataList" :key="item.id" @click="bannerSwiperHandler(item)">
             <swiper-item>
-              <image  mode="widthFix" :src="item.image_url_mobile"></image>
+              <image mode="widthFix" :src="item.image_url_mobile"></image>
             </swiper-item>
           </view>
-      </swiper>
-      </view>
-    <!-- card -->
-    <view class="tab-card">
-      <view 
-        class="card-item" 
-        v-for="(tab,index) in tabCards" 
-        :key="index" 
-        @click="linkPage(tab)"
-      >
-        <image :src="tab.icon+'?t='+new Date().getDay()" mode="aspectFill" class="card-ico"/>
-        <view class="title">{{tab.tab}}</view>
+        </swiper>
       </view>
-    </view>
-	
-    <!-- 分类 -->
-    <view class="type-wrap">
-      <view class="flex first-type-box">
-        <view :class="['item',{ act: selectTopFirstId==item.classify_name }]" v-for="(item,index) in topFirstList" :key="item.classify_name" @click="handleClickTopFirst(item,index)">
-          <view>{{item.classify_name}}</view>
+      <!-- card -->
+      <view class="tab-card">
+        <view class="card-item" v-for="(tab, index) in tabCards" :key="index" @click="linkPage(tab)">
+          <image :src="tab.icon + '?t=' + new Date().getDay()" mode="aspectFill" class="card-ico" />
+          <view class="title">{{ tab.tab }}</view>
         </view>
       </view>
-      <view class="flex sub-type-box">
-        <view 
-          :class="['item',item.chart_permission_id==selectTopSubId&&'active']" 
-          v-for="item in topSubList" :key="item.chart_permission_id"
-          @click="handleClickTopSub(item)"
-        >{{item.chart_permission_name}}</view>
+
+      <!-- 分类 -->
+      <view class="type-wrap">
+        <view class="flex first-type-box">
+          <view :class="['item', { act: selectTopFirstId == item.classify_name }]" v-for="(item, index) in topFirstList" :key="item.classify_name" @click="handleClickTopFirst(item, index)">
+            <view>{{ item.classify_name }}</view>
+          </view>
+        </view>
+        <view class="flex sub-type-box">
+          <view :class="['item', item.chart_permission_id == selectTopSubId && 'active']" v-for="item in topSubList" :key="item.chart_permission_id" @click="handleClickTopSub(item)">{{
+            item.chart_permission_name
+          }}</view>
+        </view>
       </view>
     </view>
-    </view>
-    <view class="report-empty-box" v-if="finished&&list.length==0">
+    <view class="report-empty-box" v-if="finished && list.length == 0">
       <image :src="globalImgUrls.chartEmpty" mode="widthFix" />
       <view>暂无报告</view>
     </view>
     <view class="list-wrap" v-else>
       <view class="list-item" v-for="item in list" :key="item.date">
-        <view class="time">{{getReportListDate(item.date)}}</view>
+        <view class="time">{{ getReportListDate(item.date) }}</view>
         <view class="content-list">
-          <view class="content-item" v-for="(citem,index) in item.sub_list" :key="index">
+          <view class="content-item" v-for="(citem, index) in item.sub_list" :key="index">
             <view class="content-box" @click="goDetail(citem)">
               <view class="all-btn">全部</view>
-              <view class="c-time">{{citem.publish_time|getListTime}}</view>
-              <view class="c-title">{{citem.title}}</view>
+              <view class="c-time">{{ citem.publish_time | getListTime }}</view>
+              <view class="c-title">{{ citem.title }}</view>
               <view class="desc" v-html="citem.content_sub"></view>
               <view class="tags">
-                <text style="margin-right:15px" v-if="citem.classify_name_first">#{{citem.classify_name_first}}</text>
-                <text style="margin-right:15px" v-if="citem.classify_name_second">#{{citem.classify_name_second}}</text>
+                <text style="margin-right: 15px" v-if="citem.classify_name_first">#{{ citem.classify_name_first }}</text>
+                <text style="margin-right: 15px" v-if="citem.classify_name_second">#{{ citem.classify_name_second }}</text>
               </view>
             </view>
           </view>
@@ -77,334 +70,335 @@
     </view>
 
     <!-- 联系销售弹窗 -->
-    <van-popup :show="authData.show" @close="authData.show=false" :close-on-click-overlay="false">
+    <van-popup :show="authData.show" @close="authData.show = false" :close-on-click-overlay="false">
       <view class="global-pup">
-          <view class="content">
-            <view style="width:100%">
-              <view>您暂无该品种权限,若想查看请联系</view>
-              <view>对口销售{{authData.contactInfo.name}}:{{authData.contactInfo.mobile}}</view>
-            </view>
+        <view class="content">
+          <view style="width: 100%">
+            <view>您暂无该品种权限,若想查看请联系</view>
+            <view>对口销售{{ authData.contactInfo.name }}:{{ authData.contactInfo.mobile }}</view>
           </view>
-          <view class="flex bot">
-            <view @click="authData.show=false" style="color:#A9AFB8">取消</view>
-            <view @click="handleCallPhone(authData.contactInfo.mobile)">拨号</view>
-          </view>    
+        </view>
+        <view class="flex bot">
+          <view @click="authData.show = false" style="color: #a9afb8">取消</view>
+          <view @click="handleCallPhone(authData.contactInfo.mobile)">拨号</view>
+        </view>
       </view>
-    </van-popup>  
+    </van-popup>
   </view>
 </template>
 
 <script>
-const dayjs=require('@/utils/dayjs.min')
-dayjs.locale('zh-cn') 
-import {apiReportIndexPageAuthList,apiReportIndexPageList,apiPublicBannerMark,apiPublicBannerList} from '@/api/report'
-import { apiHomeTab } from '@/api/user.js';
+const dayjs = require("@/utils/dayjs.min");
+dayjs.locale("zh-cn");
+import { apiReportIndexPageAuthList, apiReportIndexPageList, apiPublicBannerMark, apiPublicBannerList } from "@/api/report";
+import { apiHomeTab } from "@/api/user.js";
 export default {
   filters: {
-    getListTime(e){
-      return dayjs(e).format('HH:mm:ss')
-    }
+    getListTime(e) {
+      return dayjs(e).format("HH:mm:ss");
+    },
   },
-  data () {
+  data() {
     return {
-      navBarStyle:{
-        height:60+'px',
-        paddingTop:40+'px',
-        paddingBottom:'4px'
+      navBarStyle: {
+        height: 60 + "px",
+        paddingTop: 40 + "px",
+        paddingBottom: "4px",
       },
-      authData:{
-        show:false,
-        isBuy:false,//是否为已购客户
-        contactInfo:''
-      },//如果是已购客户 并且点击了没有开通的品种则弹窗联系销售
-      topFirstList:[],
-      selectTopFirstId:0,
-      topSubList:[],
-      selectTopSubId:0,
-      
-      list:[],
-      dateArr:[],
-      page:1,
-      pageSize:20,
-      finished:false,
-	  
+      authData: {
+        show: false,
+        isBuy: false, //是否为已购客户
+        contactInfo: "",
+      }, //如果是已购客户 并且点击了没有开通的品种则弹窗联系销售
+      topFirstList: [],
+      selectTopFirstId: 0,
+      topSubList: [],
+      selectTopSubId: 0,
+
+      list: [],
+      dateArr: [],
+      page: 1,
+      pageSize: 20,
+      finished: false,
+
       tabPathMap: new Map([
-        ['report','/pages-report/classify'],
-        ['chart','/pages/chart/chart'],
-        ['sandbox','/pages-sandTable/sandTable'],
-        ['activity','/pages/activity/activity'],
-        ['pricedriven','/pages/pricedriven/pricedriven'],
-        ['video','/pages/video/videoList'],
-        ['position_analysis','/pages/positionAnalysis/index'],
-        ['calendar_matter','/pages/forexCalendar/index']
+        ["report", "/pages-report/classify"],
+        ["chart", "/pages/chart/chart"],
+        ["sandbox", "/pages-sandTable/sandTable"],
+        ["activity", "/pages/activity/activity"],
+        ["pricedriven", "/pages/pricedriven/pricedriven"],
+        ["video", "/pages/video/videoList"],
+        ["position_analysis", "/pages/positionAnalysis/index"],
+        ["calendar_matter", "/pages/forexCalendar/index"],
       ]),
       tabCards: [],
-      bannerDataList:[]
-    }
+      bannerDataList: [],
+    };
   },
-  onLoad(){ 
-    this.initNavBar()
-    this.getTopAuthList()
-	  this.getTopTab();
+  onLoad() {
+    this.initNavBar();
+    this.getTopAuthList();
+    this.getTopTab();
     this.getBannerList();
   },
   onShow() {
     uni.getSystemInfo({
-			success: function (res) {
-				if (res.windowWidth > 750||['windows','mac'].includes(res.platform)) {
-					console.log('跳转启动页判断进入pc');
-					uni.reLaunch({
-						url: "/pages/pc",
-					});
-				}
-			},
-		})
-  },
-  onReady() {
+      success: function (res) {
+        if (res.windowWidth > 750 || ["windows", "mac"].includes(res.platform)) {
+          // console.log("跳转启动页判断进入pc");
+          uni.reLaunch({
+            url: "/pages/pc",
+          });
+        }
+      },
+    });
   },
+  onReady() {},
   onPullDownRefresh() {
-    this.getTopAuthList()
+    this.getTopAuthList();
     setTimeout(() => {
-      uni.stopPullDownRefresh()
+      uni.stopPullDownRefresh();
     }, 1500);
   },
   onReachBottom() {
-    if(this.finished) return
-    this.page++
-    this.getReportList()
+    if (this.finished) return;
+    this.page++;
+    this.getReportList();
   },
   onShareAppMessage() {
     return {
-      title:"FICC研报"
-    }
+      title: "FICC研报",
+    };
   },
   methods: {
     // banner 点击事件
-   async bannerSwiperHandler(item){
-    if(item.id == 9999){
-       uni.navigateTo({
-          url:"/pages-report/surveyHistory/surveyHistory"
-        })
-    }else{
-      const res = await apiPublicBannerMark({
-        banner_url: item.image_url_mobile,
-        first_source: 1, //一级来源 1小程序移动 2小程序pc 3研报官网
-        second_source: 1, //二级来源 1首页 2研报详情页
-        id:item.id
-      })
-      if(res.code===200){
+    async bannerSwiperHandler(item) {
+      await this.checkUserIsBind()
+      if (item.id == 9999) {
         uni.navigateTo({
-          url:"/pages-report/disseminatePage/disseminatePage?imgHb="+item.jump_url_mobile+'&title='+item.remark
-        })
+          url: "/pages-report/surveyHistory/surveyHistory",
+        });
+      } else {
+        const res = await apiPublicBannerMark({
+          banner_url: item.image_url_mobile,
+          first_source: 1, //一级来源 1小程序移动 2小程序pc 3研报官网
+          second_source: 1, //二级来源 1首页 2研报详情页
+          id: item.id,
+        });
+        if (res.code === 200) {
+          uni.navigateTo({
+            url: "/pages-report/disseminatePage/disseminatePage?imgHb=" + encodeURIComponent(item.jump_url_mobile) + "&title=" + item.remark + "&id=" + item.id + "&enable="+item.enable,
+          });
+        }
       }
-    }
-    
     },
-    initNavBar(){
-      let menuButtonInfo = uni.getMenuButtonBoundingClientRect()
-      this.navBarStyle={
-        height:(menuButtonInfo.height+menuButtonInfo.top+8)+'px',
-        paddingTop:(menuButtonInfo.top-4)+'px',
-        paddingBottom:'4px'
-      }
+    initNavBar() {
+      let menuButtonInfo = uni.getMenuButtonBoundingClientRect();
+      this.navBarStyle = {
+        height: menuButtonInfo.height + menuButtonInfo.top + 8 + "px",
+        paddingTop: menuButtonInfo.top - 4 + "px",
+        paddingBottom: "4px",
+      };
     },
     //顶部权限数据
-    async getTopAuthList(){
-      const res=await apiReportIndexPageAuthList()
-      if(res.code===200){
-        this.authData.isBuy=res.data.check_flag
-        this.authData.contactInfo=res.data.contact_info
-        this.topFirstList=res.data.permission_list.filter(item => item.sort != 100000)
-        this.handleClickTopFirst(this.topFirstList[0],0)
+    async getTopAuthList() {
+      const res = await apiReportIndexPageAuthList();
+      if (res.code === 200) {
+        this.authData.isBuy = res.data.check_flag;
+        this.authData.contactInfo = res.data.contact_info;
+        this.topFirstList = res.data.permission_list.filter((item) => item.sort != 100000);
+        this.handleClickTopFirst(this.topFirstList[0], 0);
       }
     },
-	 
-	/* 顶部tab */
-	 async getTopTab() {
-		const { code,data } = await apiHomeTab()
-		
-		if(code !== 200) return
-		this.tabCards = data;
-	 },
+
+    /* 顶部tab */
+    async getTopTab() {
+      const { code, data } = await apiHomeTab();
+
+      if (code !== 200) return;
+      this.tabCards = data;
+    },
 
     //点击顶部一级分类
-    handleClickTopFirst(item,index){
-      if(item.sort==100000){
-        this.goClassify()
-        return
+    handleClickTopFirst(item, index) {
+      if (item.sort == 100000) {
+        this.goClassify();
+        return;
       }
-      this.selectTopFirstId=item.classify_name
-      this.topSubList=this.topFirstList[index].list
-      this.handleClickTopSub(this.topSubList[0])
-      this.handleShowAuthData(this.topSubList[0])
+      this.selectTopFirstId = item.classify_name;
+      this.topSubList = this.topFirstList[index].list;
+      this.handleClickTopSub(this.topSubList[0]);
+      this.handleShowAuthData(this.topSubList[0]);
     },
 
     //点击顶部二级分类
-    handleClickTopSub(item){
-      this.selectTopSubId=item.chart_permission_id
-      this.list=[]
-      this.dateArr=[]
-      this.page=1
-      this.finished=false
-      this.getReportList()
-      this.handleShowAuthData(item)
+    handleClickTopSub(item) {
+      this.selectTopSubId = item.chart_permission_id;
+      this.list = [];
+      this.dateArr = [];
+      this.page = 1;
+      this.finished = false;
+      this.getReportList();
+      this.handleShowAuthData(item);
     },
 
     // 判断是否要为已购用户且点击的品种没有权限
-    handleShowAuthData(e){
-      if(this.authData.isBuy){
-        if(!e.auth_ok){
-          this.authData.show=true
+    handleShowAuthData(e) {
+      if (this.authData.isBuy) {
+        if (!e.auth_ok) {
+          this.authData.show = true;
         }
       }
     },
 
     //获取报告列表
-    async getReportList(){
-      const res=await apiReportIndexPageList({
-        chart_permission_id:this.selectTopSubId,
-        current_index:this.page,
-        page_size:this.pageSize
-      })
-      if(res.code===200){
-        if(res.data.list){
-          if(this.list.length==0){
-            this.list=res.data.list
-            res.data.list.forEach(item=>{
-              this.dateArr.push(item.date)
-            })
-          }else{
+    async getReportList() {
+      const res = await apiReportIndexPageList({
+        chart_permission_id: this.selectTopSubId,
+        current_index: this.page,
+        page_size: this.pageSize,
+      });
+      if (res.code === 200) {
+        if (res.data.list) {
+          if (this.list.length == 0) {
+            this.list = res.data.list;
+            res.data.list.forEach((item) => {
+              this.dateArr.push(item.date);
+            });
+          } else {
             //判断是否前面已经有相同日期数据 有的话添加合并
-            let arr=[]
-            let temTimearr=[]
-            res.data.list.forEach(item => {
-              if(this.dateArr.includes(item.date)){
-                this.list.forEach(_item=>{
-                  if(item.date===_item.date){
-                    _item.sub_list=[..._item.sub_list,...item.sub_list]
+            let arr = [];
+            let temTimearr = [];
+            res.data.list.forEach((item) => {
+              if (this.dateArr.includes(item.date)) {
+                this.list.forEach((_item) => {
+                  if (item.date === _item.date) {
+                    _item.sub_list = [..._item.sub_list, ...item.sub_list];
                   }
-                })
-              }else{
-                arr.push(item)
-                temTimearr.push(item.date)
+                });
+              } else {
+                arr.push(item);
+                temTimearr.push(item.date);
               }
             });
-            this.list=[...this.list,...arr]
-            this.dateArr=[...this.dateArr,...temTimearr]
+            this.list = [...this.list, ...arr];
+            this.dateArr = [...this.dateArr, ...temTimearr];
           }
         }
-        if(res.data.paging.is_end){
-          this.finished=true
+        if (res.data.paging.is_end) {
+          this.finished = true;
         }
       }
     },
 
     //跳转
-    linkPage({mark}) {
+    linkPage({ mark }) {
       const url = this.tabPathMap.get(mark);
-      uni.navigateTo({ url,
-        fail () {
+      uni.navigateTo({
+        url,
+        fail() {
           uni.switchTab({
             url,
-          })
-        } 
-      })
+          });
+        },
+      });
     },
-	
+
     // 跳转分类
-    goClassify(){
-      uni.navigateTo({ url: '/pages-report/classify' })
+    goClassify() {
+      uni.navigateTo({ url: "/pages-report/classify" });
     },
 
     //跳转搜索
-    goSearch(){
-      uni.navigateTo({url:'/pages-report/search'})
+    goSearch() {
+      uni.navigateTo({ url: "/pages-report/search" });
     },
-    
+
     //跳转我的
-    async goUser(){
-      await this.checkUserIsBind()
+    async goUser() {
+      await this.checkUserIsBind();
       uni.navigateTo({
-        url: '/pages/user/user',
-        fail () {
+        url: "/pages/user/user",
+        fail() {
           uni.switchTab({
-            url:'/pages/user/user',
-          })
-        }
-      })
+            url: "/pages/user/user",
+          });
+        },
+      });
     },
 
     //跳转报告详情
-    async goDetail(item){
-      if(['晨报','周报'].includes(item.classify_name_first)){
-        uni.navigateTo({url: `/pages-report/chapterDetail?chapterId=${item.report_chapter_id}&fromPage=home`})
-      }else{
-        uni.navigateTo({url:'/pages-report/reportDetail?reportId='+item.report_id})
+    async goDetail(item) {
+      if (["晨报", "周报"].includes(item.classify_name_first)) {
+        uni.navigateTo({ url: `/pages-report/chapterDetail?chapterId=${item.report_chapter_id}&fromPage=home` });
+      } else {
+        uni.navigateTo({ url: "/pages-report/reportDetail?reportId=" + item.report_id });
       }
     },
 
     // 拨打电话
-    handleCallPhone(tel){
+    handleCallPhone(tel) {
       uni.makePhoneCall({
         phoneNumber: tel,
-        success:()=>{
-          this.authData.show=false
-        }
+        success: () => {
+          this.authData.show = false;
+        },
       });
     },
 
     //设置列表日期显示
-    getReportListDate(e){
-      const isSameYear=dayjs(e).isSame(new Date(), 'year');
-      if(isSameYear){//今年
-        return dayjs(e).format('MM.DD')+' '+ dayjs(e).format('ddd')
-      }else{
-        return dayjs(e).format('YY.MM.DD')+' '+dayjs(e).format('ddd')
+    getReportListDate(e) {
+      const isSameYear = dayjs(e).isSame(new Date(), "year");
+      if (isSameYear) {
+        //今年
+        return dayjs(e).format("MM.DD") + " " + dayjs(e).format("ddd");
+      } else {
+        return dayjs(e).format("YY.MM.DD") + " " + dayjs(e).format("ddd");
       }
     },
 
     // 获取banner 列表
-    async getBannerList(){
+    async getBannerList() {
       const res = await apiPublicBannerList({
-        is_homepage:1
-      })
-        if(res.code===200){
-          this.bannerDataList = res.data
-        }
+        is_homepage: 1,
+      });
+      if (res.code === 200) {
+        this.bannerDataList = res.data;
+      }
     },
-  }
-}
+  },
+};
 </script>
 
 <style lang="scss">
-.van-sticky-wrap--fixed{
+.van-sticky-wrap--fixed {
   background-color: #fff;
 }
-.nav-bar-wrap{
-  .content{
+.nav-bar-wrap {
+  .content {
     position: relative;
     height: 100%;
-    .search-icon{
+    .search-icon {
       position: absolute;
       left: 25rpx;
       top: 50%;
       transform: translateY(-50%);
     }
-	.avatar {
-		width: 60rpx;
-		height: 60rpx;
-		border-radius: 50%;
-		position: absolute;
-		left: 34rpx;
-		top: 50%;
-		transform: translateY(-50%);
-	}
+    .avatar {
+      width: 60rpx;
+      height: 60rpx;
+      border-radius: 50%;
+      position: absolute;
+      left: 34rpx;
+      top: 50%;
+      transform: translateY(-50%);
+    }
   }
   .search-box {
     position: absolute;
     left: 110rpx;
     top: 50%;
-    transform: translate(0,-50%);
+    transform: translate(0, -50%);
     width: 422rpx;
     height: 64rpx;
     font-size: 28rpx;
@@ -413,13 +407,12 @@ export default {
     border-radius: 100rpx;
     background-color: #f2f2f2;
     color: #999999;
-    
   }
 }
 </style>
 
 <style lang="scss" scoped>
-movable-area{
+movable-area {
   position: fixed;
   top: 50%;
   left: 0;
@@ -427,223 +420,221 @@ movable-area{
   height: calc(50% - 100rpx);
   pointer-events: none;
   z-index: 3;
-  movable-view{
-    width:fit-content;
-    height:fit-content;
+  movable-view {
+    width: fit-content;
+    height: fit-content;
     pointer-events: auto;
   }
 }
-.top-sticky{
+.top-sticky {
   position: sticky;
   top: 0;
   left: 0;
   z-index: 99;
 }
-.nav-bar-wrap{
+.nav-bar-wrap {
   border-bottom: 1px solid $global-border-color;
-  .content{
-    .text{
+  .content {
+    .text {
       text-align: center;
       width: 50vw;
       position: absolute;
       left: 50%;
       top: 50%;
-      transform: translate(-50%,-50%);
+      transform: translate(-50%, -50%);
       font-weight: bold;
       font-size: 16px;
     }
   }
-  
 }
-.type-wrap{
+.type-wrap {
   // border-bottom: 1px solid $global-border-color;
   padding: 20rpx 34rpx 0 34rpx;
   box-shadow: 0px 4rpx 4rpx 1px rgba(198, 198, 198, 0.25);
-  .avatar{
-    width:78rpx;
-    height:78rpx;
+  .avatar {
+    width: 78rpx;
+    height: 78rpx;
     border-radius: 50%;
     overflow: hidden;
     margin-right: 30rpx;
   }
-  .first-type-box{
+  .first-type-box {
     justify-content: space-between;
     overflow-x: auto;
     gap: 0 10rpx;
-    &::-webkit-scrollbar{
+    &::-webkit-scrollbar {
       width: 0;
       height: 0;
       display: none;
     }
-    .item{
-		 min-width: 150rpx;
+    .item {
+      min-width: 150rpx;
       flex-shrink: 0;
       text-align: center;
-		padding: 16rpx 0;
-		text-align: center;
-		background-color: #F5F5F5;
-		border-radius: 8rpx;
+      padding: 16rpx 0;
+      text-align: center;
+      background-color: #f5f5f5;
+      border-radius: 8rpx;
       // font-size: $global-font-size-sm;
-      image{
+      image {
         width: 100rpx;
         height: 100rpx;
         display: block;
         margin: 0 auto 15rpx auto;
       }
     }
-	 .act {
-		background: #FDF8F2;
-		color: #E3B377;
-	 }
+    .act {
+      background: #fdf8f2;
+      color: #e3b377;
+    }
   }
-  .sub-type-box{
+  .sub-type-box {
     margin-top: 40rpx;
     font-size: 28rpx;
     color: #666666;
     overflow-x: auto;
-    &::-webkit-scrollbar{
+    &::-webkit-scrollbar {
       width: 0;
       height: 0;
       display: none;
     }
-    .item{
+    .item {
       padding-bottom: 16rpx;
       margin-right: 50rpx;
       flex-shrink: 0;
     }
-    .active{
-      color: #E3B377;
-      border-bottom: 2px solid #E3B377;
+    .active {
+      color: #e3b377;
+      border-bottom: 2px solid #e3b377;
     }
   }
 }
 
-.list-wrap{
+.list-wrap {
   padding: 20rpx 34rpx;
-  .list-item{
+  .list-item {
     margin-bottom: 40rpx;
-    .time{
+    .time {
       margin-bottom: 32rpx;
     }
   }
-  .content-list{
-    .content-box{
+  .content-list {
+    .content-box {
       padding: 0 0rpx 20rpx 20rpx;
       position: relative;
-      .all-btn{
+      .all-btn {
         position: absolute;
         right: 20rpx;
         bottom: 20rpx;
         width: 95rpx;
         height: 34rpx;
-        background: linear-gradient(100deg, #E3B377 0%, #FFDDB1 100%);
+        background: linear-gradient(100deg, #e3b377 0%, #ffddb1 100%);
         border-radius: 17rpx;
         color: #fff;
         font-size: 24rpx;
         text-align: center;
       }
     }
-    .content-item{
-      padding:0 0 50rpx 20rpx;
-      border-left: 1px solid #F4E1C9;
+    .content-item {
+      padding: 0 0 50rpx 20rpx;
+      border-left: 1px solid #f4e1c9;
       position: relative;
-      &:last-child{
+      &:last-child {
         border-bottom: none;
         padding-bottom: 0rpx;
       }
-      &::before{
-        content: '';
+      &::before {
+        content: "";
         display: block;
         box-sizing: border-box;
         width: 24rpx;
         height: 24rpx;
         border-radius: 50%;
-        border: 6rpx solid #F4E1C9;
+        border: 6rpx solid #f4e1c9;
         position: absolute;
         left: 0;
         top: 0;
-        background: #E3B377;
-        transform: translate(-50%,-50%);
+        background: #e3b377;
+        transform: translate(-50%, -50%);
         z-index: 2;
       }
-      &::after{
-        content:'';
+      &::after {
+        content: "";
         display: block;
         width: 34rpx;
         height: 1rpx;
-        background-color: #F4E1C9;
+        background-color: #f4e1c9;
         position: absolute;
         top: 0;
         left: 0;
         z-index: 1;
       }
-      .c-time{
+      .c-time {
         position: relative;
         top: -17rpx;
         font-size: 24rpx;
         color: #333333;
       }
-      .c-title{
+      .c-title {
         font-size: $global-font-size-lg;
         font-weight: bold;
         word-wrap: break-word;
         white-space: normal;
         word-break: break-all;
       }
-      .desc{
+      .desc {
         line-height: 1.5;
         margin-top: 10rpx;
         color: #666666;
       }
-      .tags{
+      .tags {
         margin-top: 20rpx;
-        color: #E3B377;
+        color: #e3b377;
         min-height: 40rpx;
       }
     }
   }
 }
-.quesion-btn{
-  width:100rpx;
-  height:100rpx;
+.quesion-btn {
+  width: 100rpx;
+  height: 100rpx;
   background-color: red;
   border-radius: 50%;
   z-index: 50;
 }
 
 .tab-card {
-	display: flex;
-	padding:  40rpx 34rpx 20rpx;
-	align-items: center;
-	justify-content: space-between;
-	.card-item {
-		// margin-right: 40rpx;
-		// &:last-child { margin-right: 0; }
-		.card-ico {
-			width: 60rpx;
-			height: 60rpx;
-			display: block;
+  display: flex;
+  padding: 40rpx 34rpx 20rpx;
+  align-items: center;
+  justify-content: space-between;
+  .card-item {
+    // margin-right: 40rpx;
+    // &:last-child { margin-right: 0; }
+    .card-ico {
+      width: 60rpx;
+      height: 60rpx;
+      display: block;
       margin-left: auto;
       margin-right: auto;
-		}
-		.title {
-			text-align: center;
-		}
-	}
+    }
+    .title {
+      text-align: center;
+    }
+  }
 }
 .content-swiper {
   width: 100%;
   padding: 30rpx 34rpx 0 34rpx;
-  height:auto;
+  height: auto;
   overflow: hidden;
   swiper {
     width: 100%;
-   image {
-    object-fit: cover; /* 按比例缩放图像,直到完全覆盖容器 */
-    width: 100%;
-    height: 100%;
-   }
-}
+    image {
+      object-fit: cover; /* 按比例缩放图像,直到完全覆盖容器 */
+      width: 100%;
+      height: 100%;
+    }
+  }
 }
-
-</style>
+</style>

+ 7 - 3
store/modules/report.js

@@ -6,8 +6,8 @@ const reportModules={
             index:0,//当前是播放第几个
             reportId:0,//当前是哪个报告的音频
             paused:true,//当前是否音频正在播放 true暂停状态
-
-        }
+        },
+        inviteShareCode:''
     },
     mutations: {
         addAudio(state,e){
@@ -37,8 +37,12 @@ const reportModules={
         // 关闭弹窗
         closePopAudio(state){
             state.audioData.show=false
+        },
+        // 分享来源
+        getInviteShareCode(state, payload) {
+            state.inviteShareCode = payload;
+        },
         }
-    }
 }
 
 export default reportModules;