bding 1 year ago
parent
commit
7abfb0c23c

+ 2 - 2
config/api.js

@@ -7,8 +7,9 @@ import { User } from "./modules/User";
 import { Report } from "./modules/ReportArticle";
 import { Research } from "./modules/Research";
 import { MsgTemplate } from "./modules/Msg";
+import { purchaserApi } from "./modules/purchaser";
 
-export { Reports, activity, Home, User, Report, Research, MsgTemplate };
+export { Reports, activity, Home, User, Report, Research, MsgTemplate, purchaserApi };
 
 /* 上传 */
 export const uploadurl = baseUrl + "/resource/image/upload";
@@ -55,7 +56,6 @@ export const Mine = {
   report_selectionAddStopTime: (params) => {
     return postHttp("/report_selection/addStopTime", params);
   },
-  
 };
 /* 搜索 */
 export const Search = {

+ 55 - 20
config/modules/purchaser.js

@@ -2,23 +2,58 @@ import { getHttp, postHttp } from "../request.js";
 
 /* 研选  */
 export const purchaserApi = {
-    /* 获取研选banner列表*/
-    getPurchaserBanner: () => {
-      return getHttp("/banner/listYx");
-    },
-		/**
-		 * 调研提交
-		 * params:{string Content:Content}
-		 */
-		purchaserSurveySubmit: (params) => {
-		  return postHttp("/banner/add/yxSurvey",params);
-		},
-		/**
-		 * 调研详情
-		 * params:{number SuveryId:SuveryId}
-		 */
-		purchaserSurveyDetail: (params) => {
-		  return getHttp("/banner/yxSurvey/detail",params);
-		},
-  };
-	
+  /* 获取研选banner列表*/
+  getPurchaserBanner: () => {
+    return getHttp("/banner/listYx");
+  },
+  /**
+   * 调研提交
+   * params:{string Content:Content}
+   */
+  purchaserSurveySubmit: (params) => {
+    return postHttp("/banner/add/yxSurvey", params);
+  },
+  /**
+   * 调研详情
+   * params:{number SuveryId:SuveryId}
+   */
+  purchaserSurveyDetail: (params) => {
+    return getHttp("/banner/yxSurvey/detail", params);
+  },
+  // 专栏列表
+  yanxuanSpecialList: (params) => {
+    return getHttp("/yanxuan_special/list", params);
+  },
+  // 研选专栏作者详情
+  yanxuanSpecialAuthorDetail: (params) => {
+    return getHttp("/yanxuan_special/author/detail", params);
+  },
+  // 研选专栏详情
+  yanxuanSpecialDetail: (params) => {
+    return getHttp("/yanxuan_special/detail", params);
+  },
+  // 研选专栏作者详情
+  yanxuanSpecialAuthorSave: (params) => {
+    return postHttp("/yanxuan_special/author/save", params);
+  },
+  // 行业搜索
+  yanxuanSpecialIndustrySearch: (params) => {
+    return getHttp("/yanxuan_special/industrySearch", params);
+  },
+  // 公司搜索
+  yanxuanSpecialCompanySearch: (params) => {
+    return getHttp("/yanxuan_special/companySearch", params);
+  },
+  // 专栏保存
+  yanxuanSpecialSave: (params) => {
+    return postHttp("/yanxuan_special/save", params);
+  },
+  // 专栏内容中心
+  yanxuanSpecialCenter: (params) => {
+    return getHttp("/yanxuan_special/center", params);
+  },
+  // 取消发布
+  yanxuanSpecialCancel: (params) => {
+    return postHttp("/yanxuan_special/cancel", params);
+  },
+};

+ 33 - 26
pages-purchaser/components/columnListContent.vue

@@ -3,36 +3,35 @@
     <view class="introduce-content">
       <view class="introduce"></view>
       <view :class="['introduce-detail', item.isExpand && 'expand']" :style="{ height: isExpand ? 'auto' : richTextHeight + 'px' }">
-        {{ content }}
+        {{ authorDetail.Introduction }}
         <view class="expan-btn-sl" v-if="isShowBtn && !isExpand">......</view>
       </view>
 
       <view class="expan-btn" @click.stop="handleExpand" v-if="isShowBtn">{{ isExpand ? "收起" : "展开" }}</view>
     </view>
     <view class="content-item">
-      <view class="type-time">
-        <view class="type"> 笔 记</view>
-        <view class="time"> 2023.08.24 13:13:13</view>
-      </view>
-      <view class="title-item"> 标题标题标题标题标题标题标题标题标题标题标题标题</view>
-      <view class="text-conten">
-        有专栏详情页面,内容详情页面,暂时都不设置行业权限。专栏详情页未登录也可查看,收藏操作需先登录
-        内容详情页面也需要登录后才查看,登录也可查看,收藏操作需先登录,内容详情页面也需要登录后才查专栏介绍:有专栏详情页面,内容详情页面,暂时都不设置行业权限。专栏详情页未登录也可查看,收藏操作需先登录,
-      </view>
-      <view class="look-all"> 查看全文 </view>
-      <view class="file-item"> 文档名称.docx </view>
-      <view class="image-conten">
-        <image src="https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/Maskgroupbg.png" @click="previewImageMediahandler"></image>
-        <image src="https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/Maskgroupbg.png"></image>
-      </view>
-      <view class="lable-conten">
-        <text>石头科技</text>
-        <text>公司调研电话会</text>
-      </view>
-      <view class="collect-conten">
-        <image src="https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/czbk/collect_icon.png"></image>
-        <image src="https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/czbk/collect_act.png"></image> 88
-      </view>
+      <block v-for="item in mySpecialList" :key="item.Id">
+        <view class="type-time">
+          <view class="type">{{ item.Type == 1 ? "笔 记" : "观 点" }} </view>
+          <view class="time"> {{ item.PublishTime }}</view>
+        </view>
+        <view class="title-item"> {{ item.Title }}</view>
+        <view class="text-conten">
+          {{ item.Content }}
+        </view>
+        <view class="look-all"> 查看全文 </view>
+        <view class="file-item"> 文档名称.docx </view>
+        <view class="image-conten">
+          <image v-for="key in item.ImgUrl.split(',')" :key="key" src="https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/Maskgroupbg.png" @click="previewImageMediahandler"></image>
+        </view>
+        <view class="lable-conten">
+          <text v-for="key in item.Tags.split(',')" :key="key">{{key}}</text>
+        </view>
+        <view class="collect-conten">
+          <image v-if="item.Status == 1" src="https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/czbk/collect_icon.png"></image>
+          <image v-else src="https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/czbk/collect_act.png"></image> 88
+        </view>
+      </block>
       <view class="introduce-detail-one" v-show="showText">
         有专栏详情页面,情页面,暂时都不设置行业权限。专栏详情页未登录也可查看,收藏操作需先登录,内容详情页面也需要登录后才查容详情页面也需要登录后
       </view>
@@ -43,6 +42,16 @@
 
 <script>
 export default {
+  props: {
+    authorDetail: {
+      type: Object,
+      default: {},
+    },
+    mySpecialList: {
+      type: Array,
+      default: [],
+    },
+  },
   data() {
     return {
       loadTimeLine: true, //时间线的遮罩
@@ -50,8 +59,6 @@ export default {
       isExpand: true,
       isShowBtn: true,
       showText: true,
-      content:
-        "情页面,有专栏详情页面,内容详情页面,有专栏详情页面,内容详情页面,有专栏详情页面,内容详情页面,暂时都不设置行业权限。专栏详情页未登录也可查看,收藏操作需先登录,内容详情页面也需要登录后才查容详情页面也需要登录后",
     };
   },
   mounted() {

+ 12 - 25
pages-purchaser/components/imageUpload.vue

@@ -1,7 +1,7 @@
 <template>
   <view class="imageUploadContainer">
     <view class="imageUploadList">
-      <view class="imageItem" v-bind:key="index" v-for="(path, index) in imageListData">
+      <view class="imageItem" v-bind:key="index" v-for="(path, index) in imageList">
         <image
           :src="path"
           :class="{ dragging: isDragging(index) }"
@@ -21,6 +21,8 @@
 </template>
 
 <script>
+import { uploadurl } from "@/config/api";
+import { get } from "@/config/db";
 export default {
   name: "robby-image-upload",
   props: ["value", "enableDel", "enableAdd", "enableDrag", "serverUrl", "formData", "header", "limit", "fileKeyName", "showUploadProgress", "serverUrlDeleteImage"],
@@ -80,7 +82,7 @@ export default {
         return false;
       }
 
-      if (this.limit && this.imageList.length >= this.limit) {
+      if (this.limit && this.imageList && this.imageList.length >= this.limit) {
         return false;
       }
 
@@ -140,12 +142,13 @@ export default {
                 new Promise((resolve, reject) => {
                   let remoteUrlIndex = remoteIndexStart + i;
                   uni.uploadFile({
-                    url: _self.serverUrl,
-                    fileType: "image",
-                    header: _self.header,
-                    formData: _self.formData,
+                    url: uploadurl,
+                    header: {
+                      "Content-Type": "multipart/form-data",
+                      Authorization: get("access_token"),
+                    },
                     filePath: imagePathArr[i],
-                    name: keyname,
+                    name: "file",
                     success: function (res) {
                       if (res.statusCode === 200) {
                         if (_self.isDestroyed) {
@@ -162,15 +165,12 @@ export default {
                             duration: 500,
                           });
                         }
-                        console.log("success to upload image: " + res.data);
                         resolve(res.data);
                       } else {
-                        console.log("fail to upload image:" + res.data);
                         reject("fail to upload image:" + remoteUrlIndex);
                       }
                     },
                     fail: function (res) {
-                      console.log("fail to upload image:" + res);
                       reject("fail to upload image:" + remoteUrlIndex);
                     },
                   });
@@ -183,7 +183,7 @@ export default {
               }
 
               for (let i = 0; i < result.length; i++) {
-                _self.imageList.push(result[i]);
+                _self.imageList.push(JSON.parse(result[i]).Data.ResourceUrl);
               }
 
               _self.$emit("add", {
@@ -192,16 +192,6 @@ export default {
               });
               _self.$emit("input", _self.imageList);
             });
-          } else {
-            for (let i = 0; i < imagePathArr.length; i++) {
-              _self.imageList.push(imagePathArr[i]);
-            }
-
-            _self.$emit("add", {
-              currentImages: imagePathArr,
-              allImages: _self.imageList,
-            });
-            _self.$emit("input", _self.imageList);
           }
         },
       });
@@ -219,9 +209,7 @@ export default {
           data: {
             imagePath: deletedImagePath,
           },
-          success: (res) => {
-            console.log(res.data);
-          },
+          success: (res) => {},
         });
       }
 
@@ -266,7 +254,6 @@ export default {
       return this.dragIndex === indx;
     },
     start: function (e) {
-      console.log(this.isDragable);
       if (!this.isDragable) {
         return;
       }

+ 20 - 15
pages-purchaser/components/infoCard.vue

@@ -1,31 +1,27 @@
 <template>
-  <view class="info-card-detail">
+  <view class="info-card-detail" :style="{ 'background-image': pagesType == '专栏详情' ? 'url(' + authorDetail.BgImg + ')' : '' }">
     <view class="name-author">
       <view class="author-img">
         <view class="img-box">
-          <image src="https://hzchart.oss-cn-shanghai.aliyuncs.com/T2ddwIIaULVdkGM6gVMuNxBSft8Y.png"></image>
+          <image :src="authorDetail.HeadImg"></image>
         </view>
-        <view class="set-btn"> + 关注</view>
+        <view class="set-btn" v-if="pagesType == '专栏详情'"> 编辑专栏</view>
+        <view class="set-btn" v-else> + 关注</view>
       </view>
       <view class="name-box">
-        <text>专栏名称专栏名称专栏名称</text>
-        <text>作者昵称作者昵称</text>
+        <text>{{ authorDetail.SpecialName }}</text>
+        <text>{{ authorDetail.NickName }}</text>
       </view>
     </view>
     <view class="info-card-lable">
-      <text>专栏名称专1</text>
-      <text>专栏名称专2</text>
-      <text>专栏名称专3</text>
-      <text>专栏名称专3</text>
-      <text>专栏名称专3</text>
-      <text>专栏名称专3</text>
+      <text v-for="item in authorDetail.Label.split(',')" :key="item">{{ item }}</text>
     </view>
     <view class="info-card-fans">
-      <text>12</text>
+      <text>{{ authorDetail.SpecialArticleNum }}</text>
       <text>文章</text>
-      <text>24</text>
+      <text>{{ authorDetail.CollectNum }}</text>
       <text>被收藏</text>
-      <text>36</text>
+      <text>{{ authorDetail.FollowNum }}</text>
       <text>粉丝</text>
     </view>
   </view>
@@ -33,6 +29,16 @@
 
 <script>
 export default {
+  props: {
+    authorDetail: {
+      type: Object,
+      default: {},
+    },
+    pagesType: {
+      type: String,
+      default: "",
+    },
+  },
   data() {
     return {};
   },
@@ -43,7 +49,6 @@ export default {
 <style lang="scss" scope>
 .info-card-detail {
   border-radius: 16rpx;
-  background-image: url(https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/Maskgroupbg.png);
   background-size: 100% 100%;
   // 上面的那个盒子用就把上面的样式去掉
   width: 100%;

+ 67 - 10
pages-purchaser/contentAllPage/contentAllPage.vue

@@ -7,16 +7,16 @@
       </view>
     </view>
     <view class="content-ul">
-      <view class="content-li">
+      <view class="content-li" v-for="item in specialCenter" :key="item.Id">
         <view class="type-time">
-          <view class="type"> 笔 记</view>
-          <view class="time"> 2023.08.24 13:13:13</view>
+          <view class="type"> {{ item.Type == 1 ? "笔 记" : "观 点" }} </view>
+          <view class="time"> {{ item.PublishTime }}</view>
         </view>
-        <view class="title-item"> 标题标题标题标题标题标题标题标题标题标题标题标题</view>
+        <view class="title-item"> {{ item.Title }}</view>
         <view class="btn-box">
-          <view class="cancell-box"> 取消发布</view>
-          <view class="reject-box"> 驳回理由</view>
-          <view class="edit-box"> 修改 </view>
+          <view class="cancell-box" v-if="tabActive == 3" @click="unpublishHandler(item)"> 取消发布</view>
+          <view class="reject-box" v-if="tabActive == 4" @click="rejectHandler(item)"> 驳回理由</view>
+          <view class="edit-box" v-if="tabActive != 2" @click="modifyHandler(item)"> 修改 </view>
         </view>
       </view>
     </view>
@@ -24,23 +24,80 @@
 </template>
 
 <script>
+import { purchaserApi } from "@/config/api";
 export default {
   data() {
     return {
       tabList: [
         { name: "草稿箱", value: "1" },
-        { name: "已发布", value: "2" },
-        { name: "审核中", value: "3" },
+        { name: "已发布", value: "3" },
+        { name: "审核中", value: "2" },
         { name: "已驳回", value: "4" },
       ],
       tabActive: "1",
+      specialCenter: [],
     };
   },
   methods: {
     // top标签点击事件
     tabClickHandler(item) {
+      if (this.tabActive === item.value) return;
       this.tabActive = item.value;
+      this.getDataList();
     },
+    // 获取内容中心的数据
+    async getDataList() {
+      const res = await purchaserApi.yanxuanSpecialCenter({
+        Status: this.tabActive,
+      });
+      if (res.Ret === 200) {
+        console.log(res);
+        this.specialCenter = res.Data || [];
+      }
+    },
+    // 点击了修改
+    modifyHandler(item) {
+      uni.navigateTo({
+        url: "/pages-purchaser/writeNote/writeNote?id=" + item.Id,
+      });
+    },
+    // 点击驳回
+    rejectHandler(item) {
+      uni.showModal({
+        title: "驳回理由",
+        content: item.Reason,
+        confirmColor: "#3385FF",
+        confirmText: "知道了",
+        showCancel: false,
+        cancelColor: "#606266",
+      });
+    },
+    // 取消发布
+    unpublishHandler(item) {
+      uni.showModal({
+        title: "提醒",
+        content: "取消发布后,内容将进入草稿箱想要重新发布需重新提交审核,确定要取消发布吗?",
+        confirmColor: "#3385FF",
+        cancelColor: "#606266",
+        success: async (res) => {
+          if (res.confirm) {
+            const resCancel = await purchaserApi.yanxuanSpecialCancel({
+              Id: item.Id,
+            });
+            if (resCancel.Ret == 200) {
+              uni.showToast({
+                title: "已取消发布",
+                duration: 2000,
+              });
+              this.getDataList();
+            }
+          }
+        },
+      });
+    },
+  },
+  onLoad() {
+    this.getDataList();
   },
 };
 </script>
@@ -111,7 +168,7 @@ export default {
         view {
           padding: 4rpx 24rpx 4rpx 24rpx;
           border-radius: 150rpx;
-		  margin-left: 10rpx;
+          margin-left: 10rpx;
         }
         .cancell-box {
           color: #376cbb;

+ 77 - 33
pages-purchaser/specialColumn/specialColumn.vue

@@ -1,50 +1,56 @@
 <template>
   <view class="container special-column">
-    <view class="tab-content">
+    <view class="tab-content" v-if="isAuthor">
       <view class="item" v-for="item in tabList" :key="item.value" @click="tabClickHandler(item)">
         {{ item.name }}
         <view class="line-active" v-if="tabActive == item.value"> </view>
       </view>
     </view>
     <view class="item-ul" v-if="tabActive == 1">
-      <view class="item-li">
-        <view class="item-title"> 专栏名称</view>
+      <view class="item-li" v-for="item in specialList" :key="item.Id">
+        <view class="item-title"> {{ item.Title }}</view>
         <view class="item-name-time">
-          <view class="name"> 作者昵称作者昵称</view>
-          <view class="time"> 2023.08.24更新</view>
+          <view class="name"> {{ item.RealName }}</view>
+          <view class="time"> {{ item.PublishTime.slice(0, 10) }}更新</view>
         </view>
         <view class="item-content">
-          专栏介绍:有专栏详情页面,内容详情页面,暂时都不设置行业权限。专栏详情页未登录也可查看,收藏操作需先登录,内容详情页面也需要登录后才查看,登录也可查看,收藏操作需先登录,内容详情页面也需要登录后才查专栏介绍:有专栏详情页面,内容详情页面,暂时都不设置行业权限。专栏详情页未登录也可查看,收藏操作需先登录,内容详情页面也需要登录后才查看,登录也可查看,收藏操作需先登录,内容详情页面也需要登录后才
+          {{ item.Content }}
         </view>
       </view>
     </view>
     <view class="set-up-info" v-if="tabActive == 2">
-      <view class="info-name info-box">
-        <text class="seting-txt">首次进入我的专栏</text>
-        <text class="seting-txt">请设置您的专栏信息</text>
-        <input v-model="columnName" placeholder="请输入专栏名称" />
-        <input v-model="columnNickname" placeholder="请输入昵称" />
-      </view>
-      <view class="set-up-lable info-box">
-        <view class="top-box">
-          <view class="lable-txt">
-            专栏标签
-            <text>(选填)</text>
-          </view>
-          <view v-if="columnLableList.length < 6" class="new-lable" @click="addlableShow = true">+ 新建标签</view>
+      <block v-if="authorDetail.NickName || authorDetail.SpecialName">
+        <info-card :authorDetail="authorDetail" pagesType="专栏详情" />
+        <column-list-content :authorDetail="authorDetail" :mySpecialList="mySpecialList"/>
+      </block>
+      <block v-else>
+        <view class="info-name info-box">
+          <text class="seting-txt">首次进入我的专栏</text>
+          <text class="seting-txt">请设置您的专栏信息</text>
+          <input v-model="columnName" placeholder="请输入专栏名称" />
+          <input v-model="columnNickname" placeholder="请输入昵称" />
         </view>
-        <view class="column-lable">
-          <view class="lable-item" v-for="(item, index) in columnLableList" :key="index">
-            <text>{{ item }}</text>
-            <van-icon name="cross" @click="deleteLablehandle(index)" />
+        <view class="set-up-lable info-box">
+          <view class="top-box">
+            <view class="lable-txt">
+              专栏标签
+              <text>(选填)</text>
+            </view>
+            <view v-if="columnLableList.length < 6" class="new-lable" @click="addlableShow = true">+ 新建标签</view>
+          </view>
+          <view class="column-lable">
+            <view class="lable-item" v-for="(item, index) in columnLableList" :key="index">
+              <text>{{ item }}</text>
+              <van-icon name="cross" @click="deleteLablehandle(index)" />
+            </view>
           </view>
         </view>
-      </view>
-      <view class="set-up-info info-box">
-        <view class="lable-txt"> 专栏介绍 </view>
-        <u-input v-model="columnIntroduce" type="textarea" :clearable="false" placeholder="请输入专栏介绍 " height="300" class="ipt" />
-      </view>
-      <view class="my-btn" @click="infoDetermineHandler"> 进入我的专栏 </view>
+        <view class="set-up-info info-box">
+          <view class="lable-txt"> 专栏介绍 </view>
+          <u-input v-model="columnIntroduce" type="textarea" :clearable="false" placeholder="请输入专栏介绍 " height="300" class="ipt" />
+        </view>
+        <view class="my-btn" @click="infoDetermineHandler"> 进入我的专栏 </view>
+      </block>
     </view>
     <u-modal
       v-model="addlableShow"
@@ -63,14 +69,13 @@
         <input v-model="addLableName" placeholder="请输入标签名称(最多8个字)" :maxlength="8" />
       </view>
     </u-modal>
-    <!-- <info-card /> -->
-    <!-- <column-list-content /> -->
   </view>
 </template>
 
 <script>
 import ColumnListContent from "../components/columnListContent.vue";
 import infoCard from "../components/infoCard.vue";
+import { purchaserApi } from "@/config/api";
 export default {
   components: { infoCard, ColumnListContent },
   data() {
@@ -79,7 +84,11 @@ export default {
         { name: "专栏列表", value: "1" },
         { name: "我的专栏", value: "2" },
       ],
-      tabActive: "2",
+      specialList: [], // 专栏列表
+      mySpecialList: [], // 专栏列表
+      isAuthor: false, // 是否是作者
+      authorDetail: {}, // 作者的详情信息
+      tabActive: "1",
       addlableShow: false,
       columnName: "",
       columnNickname: "",
@@ -106,8 +115,18 @@ export default {
       console.log("cancel");
     },
     // 信息填写完成 进入我的专栏
-    infoDetermineHandler() {
+    async infoDetermineHandler() {
       if (this.columnName && this.columnNickname && this.columnIntroduce) {
+        const res = await purchaserApi.yanxuanSpecialAuthorSave({
+          SpecialName: this.columnNickname,
+          NickName: this.columnName,
+          Introduction: this.columnIntroduce,
+          Label: this.columnLableList.join(","),
+          UserId: this.authorDetail.UserId,
+        });
+        if (res.Ret === 200) {
+          this.getAuthorDetail();
+        }
       } else {
         let str = !this.columnName ? "专栏名称" : !this.columnNickname ? "专栏昵称" : !this.columnIntroduce ? "专栏介绍" : "";
         this.$util.toast("请输入" + str);
@@ -117,6 +136,31 @@ export default {
     deleteLablehandle(index) {
       this.columnLableList.splice(index, 1);
     },
+    async getColumnList() {
+      const res = await purchaserApi.yanxuanSpecialList();
+      if (res.Ret === 200) {
+        this.specialList = res.Data.List || [];
+        this.isAuthor = res.Data.IsAuthor;
+        this.isAuthor && this.getAuthorDetail();
+      }
+    },
+    async getAuthorDetail() {
+      const res = await purchaserApi.yanxuanSpecialAuthorDetail();
+      if (res.Ret === 200) {
+        this.authorDetail = res.Data || {};
+
+        const myRes = await purchaserApi.yanxuanSpecialList({
+          UserId: this.authorDetail.UserId,
+        });
+        if (myRes.Ret === 200) {
+          this.mySpecialList = res.Data.List || [];
+          console.log(myRes,'myRes');
+        }
+      }
+    },
+  },
+  onLoad() {
+    this.getColumnList();
   },
 };
 </script>

+ 221 - 0
pages-purchaser/toExamine/toExamine.vue

@@ -0,0 +1,221 @@
+<template>
+  <!-- 笔记审核 -->
+  <view class="container to-examine">
+    <view class="content-item">
+      <view class="author-name">
+        <view class="img-box">
+          <image src="https://hzchart.oss-cn-shanghai.aliyuncs.com/T2ddwIIaULVdkGM6gVMuNxBSft8Y.png"></image>
+        </view>
+        <text style="margin-left: 10rpx">作者昵称作者昵称</text>
+      </view>
+      <view class="type-time">
+        <view class="type"> 笔 记</view>
+        <view class="time"> 2023.08.24 13:13:13</view>
+      </view>
+      <view class="title-item"> 标题标题标题标题标题标题标题标题标题标题标题标题</view>
+      <view class="text-conten">
+        有专栏详情页面,内容详情页面,暂时都不设置行业权限。专栏详情页未登录也可查看,收藏操作需先登录
+        内容详情页面也需要登录后才查看,登录也可查看,收藏操作需先登录,内容详情页面也需要登录后才查专栏介绍:有专栏详情页面,内容详情页面,暂时都不设置行业权限。专栏详情页未登录也可查看,收藏操作需先登录,
+      </view>
+      <view class="file-item"> 文档名称.docx </view>
+      <view class="image-conten">
+        <image src="https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/Maskgroupbg.png" @click="previewImageMediahandler"></image>
+        <image src="https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/Maskgroupbg.png"></image>
+      </view>
+      <view class="lable-conten">
+        <text>石头科技</text>
+        <text>公司调研电话会</text>
+      </view>
+      <view class="collect-conten">
+        <image src="https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/czbk/collect_icon.png"></image>
+        <image src="https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/czbk/collect_act.png"></image> 88
+      </view>
+    </view>
+    <view class="bottom-btn">
+      <view @click="rejectTextShow = true">驳回</view>
+      <view @click="passRhrouhg">通过</view>
+    </view>
+    <u-modal
+      v-model="rejectTextShow"
+      :show-title="false"
+      show-cancel-button
+      confirm-text="确定"
+      cancel-text="取消"
+      :content-style="{ fontSize: '32rpx' }"
+      :cancel-style="{ borderRight: '1rpx solid #EBEBEB' }"
+      :confirm-style="{ fontWeight: '700' }"
+      @confirm="confirmModal"
+      @cancel="cancelModal"
+    >
+      <view class="slot-content slot-content-text">
+        <text class="add-lable-txt">驳回理由</text>
+        <input v-model="rejectText" placeholder="请输入驳回理由" />
+      </view>
+    </u-modal>
+  </view>
+</template>
+
+<script>
+export default {
+  data() {
+    return {
+      rejectTextShow: false,
+      rejectText: "",
+    };
+  },
+  methods: {
+    previewImageMediahandler() {
+      uni.previewImage({
+        urls: ["https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/Maskgroupbg.png"], //查看图片的数组
+      });
+    },
+	passRhrouhg(){
+		 uni.showModal({
+          title: "提醒",
+          content: "确定通过此内容在小程序展示吗?",
+          confirmColor: "#3385FF",
+          cancelColor: "#606266",
+          success(res) {
+            if (res.confirm) {
+              console.log(22);
+            } else {
+              console.log(11);
+            }
+          },
+        });
+	},
+  },
+};
+</script>
+
+<style lang="scss" scope>
+.to-examine {
+  padding: 30rpx;
+  background: #f3f5f9;
+  .content-item {
+    padding: 40rpx;
+    background-color: #fff;
+    .type-time {
+      display: flex;
+      align-items: center;
+      justify-content: space-between;
+      color: #666666;
+      .type {
+        width: 110rpx;
+        height: 42rpx;
+        line-height: 42rpx;
+        text-align: center;
+        border-radius: 38rpx;
+        color: #928563;
+        background-color: #fff6de;
+        font-weight: 500;
+      }
+    }
+    .title-item {
+      margin: 10rpx 0 20rpx;
+      color: #333;
+      font-size: 32rpx;
+      font-weight: 500;
+      line-height: 46rpx;
+    }
+    .file-item {
+      width: 100%;
+      height: 42rpx;
+      margin: 20rpx 0;
+      display: flex;
+      align-items: center;
+      background-color: #f8f8fa;
+      color: #376cbb;
+    }
+    .image-conten {
+      display: flex;
+      flex-wrap: wrap;
+      image {
+        width: 144rpx;
+        height: 144rpx;
+        margin-right: 20rpx;
+      }
+    }
+    .lable-conten {
+      display: flex;
+      margin: 20rpx 0;
+      font-size: 24rpx;
+      text {
+        height: 34rpx;
+        border-radius: 44rpx;
+        padding: 3rpx 35rpx 3rpx 35rpx;
+        background-color: #f0f1f3;
+        margin-right: 20rpx;
+      }
+    }
+    .collect-conten {
+      display: flex;
+      justify-content: flex-end;
+      align-items: center;
+      color: #666666;
+      image {
+        width: 27rpx;
+        height: 26rpx;
+        margin-right: 8rpx;
+      }
+    }
+    .author-name {
+      display: flex;
+      align-items: center;
+      margin-bottom: 50rpx;
+      .img-box {
+        width: 48rpx;
+        height: 48rpx;
+        overflow: hidden;
+        font-size: 28rpx;
+        color: #333;
+        image {
+          width: 100%;
+          height: 100%;
+        }
+      }
+    }
+  }
+  .bottom-btn {
+    position: fixed;
+    bottom: 0;
+    left: 0;
+    width: 100%;
+    background-color: #fff;
+    padding: 48rpx 25rpx;
+    padding-bottom: constant(safe-area-inset-bottom);
+    padding-bottom: env(safe-area-inset-bottom);
+    display: flex;
+    view {
+      width: 345rpx;
+      height: 84rpx;
+      display: flex;
+      align-items: center;
+      justify-content: center;
+      border-radius: 9rpx;
+      background-color: #2ba471;
+      color: #fff;
+      font-weight: 600;
+    }
+    view:nth-child(1) {
+      background-color: #d54941;
+      margin-right: 12rpx;
+    }
+  }
+  .add-lable-txt {
+    color: #000;
+    font-size: 36rpx;
+    flex-wrap: 600;
+    margin-bottom: 30rpx;
+    width: 100%;
+    text-align: center;
+  }
+  .slot-content-text {
+    text-align: left;
+    input {
+      height: 96rpx;
+      background-color: #f8f8fa;
+    }
+  }
+}
+</style>

+ 209 - 58
pages-purchaser/writeNote/writeNote.vue

@@ -12,14 +12,20 @@
       <view @click="topLableHandler(item)" :class="['write-text', topLableActive == item.value && 'act-top-lable']" v-for="item in topLableList" :key="item.value"> {{ item.name }}</view>
     </view>
     <view class="write-note-content">
-      <view class="title-note"> <input placeholder="请输入标题" /></view>
+      <view class="title-note"> <input v-model="articleTitle" placeholder="请输入标题" /></view>
       <view class="content-note">
-        <editor v-model="advice_content" placeholder="请输入正文(更轻松的创作,上传文档,请先登录查研观向网页版)" @input="contentChange" />
-        <view class="new-lable" @click="showPopup = true">+ 标签(至少添加一个)</view>
+        <editor id="editor" @ready="onEditorReady" v-model="advice_content" placeholder="请输入正文(更轻松的创作,上传文档,请先登录查研观向网页版)" @input="contentChange" />
+        <view class="new-lable" @click="showPopup = true">
+          <view style="flex-shrink: 0">+ 标签(至少添加一个)</view>
+          <view v-for="item in industryCompanyLable" :key="item" class="lable-li active">
+            {{ item }}
+            <van-icon name="cross" style="margin-left: 8rpx" />
+          </view>
+        </view>
       </view>
     </view>
     <view class="write-note-img">
-      <robbyImageUpload class="image-add-upload" :value="fileList" :limit="6" />
+      <robbyImageUpload ref="robbyImageUpload" class="image-add-upload" @delete="deleteImage" @add="addImage" :value="ImgUrl" :server-url="uploadUrl" :header="header" :limit="6" />
     </view>
     <view class="write-note-button">
       <view class="draft" @click="draftBtnHandler"> 草稿箱</view>
@@ -27,26 +33,26 @@
     </view>
     <van-popup :show="showPopup" position="bottom" custom-style="height: 85%;" round custom-class="lable-class-popup">
       <viwe class="add-lable-box">
-        <view class="add-txt"> 添加标签 <view> 完成 </view></view>
+        <view class="add-txt"> 添加标签 <view @click="addCompleteHandler"> 完成 </view></view>
         <view class="select-item">
           <view @click="industryOfCompanyHanler(item)" v-for="item in lableList" :key="item.value" :class="['item', lableActive == item.value && 'act-item']"> {{ item.name }}</view>
         </view>
         <view class="input-box">
           <icon type="search" size="15" class="sea_ico" />
-          <input v-model="columnName" placeholder="专栏名称" />
+          <input v-model="columnName" placeholder="专栏名称" @confirm="searchHandle" />
           <view v-if="lableActive == 2" style="color: #376cbb" @click="addCompanyLableHandler">+ &nbsp;创建</view>
         </view>
         <view class="text-box"> 已选标签 <view class="one-lable-text"> 至少添加一个标签 </view></view>
         <view class="lable-ul">
           <block v-if="lableActive == 1">
-            <view :class="['lable-li', item.isActive && 'active']" v-for="item in selectedLableList" :key="item.name">
-              {{ item.name }}
+            <view :class="['lable-li', 'active']" v-for="item in selectedLableList" :key="item">
+              {{ item }}
               <van-icon name="cross" style="margin-left: 8rpx" @click="selectedLableHandle(item)" />
             </view>
           </block>
           <block v-else>
-            <view :class="['lable-li', item.isActive && 'active']" v-for="item in companySelectedLable" :key="item.name">
-              {{ item.name }}
+            <view :class="['lable-li', 'active']" v-for="item in companySelectedLable" :key="item">
+              {{ item }}
               <van-icon name="cross" style="margin-left: 8rpx" @click="selectedLableHandle(item)" />
             </view>
           </block>
@@ -55,12 +61,12 @@
         <view class="lable-ul">
           <!-- 这里就不用计算属性了 不知道会不会有隐藏的问题 -->
           <block v-if="lableActive == 1">
-            <view :class="['lable-li', item.isActive && 'active']" @click="industryLabelHandler(item)" v-for="item in industryLabel" :key="item.name">{{ item.name }}</view>
+            <view :class="['lable-li']" @click="industryLabelHandler(item)" v-for="item in industryLabel" :key="item">{{ item }}</view>
           </block>
           <block v-else>
-            <block v-for="item in companyLable" :key="item.name">
-              <view :class="['lable-li', item.isActive && 'active']" @click="industryLabelHandler(item)" v-if="!item.search">
-                {{ item.name }}
+            <block v-for="item in companyLable" :key="item">
+              <view :class="['lable-li']" @click="industryLabelHandler(item)" v-if="!item.search">
+                {{ item }}
               </view>
             </block>
           </block>
@@ -72,6 +78,7 @@
 
 <script>
 import robbyImageUpload from "../components/imageUpload.vue";
+import { purchaserApi, uploadurl } from "@/config/api";
 export default {
   components: { robbyImageUpload },
   data() {
@@ -83,8 +90,10 @@ export default {
       },
       showPopup: false,
       fileList: [],
+      articleTitle: "", // 标题
       advice_content: "",
       columnName: "",
+      industryCompanyLable: [], //添加的标签
       lableList: [
         { name: "行业标签", value: 1 },
         { name: "公司标签", value: 2 },
@@ -95,25 +104,22 @@ export default {
         { name: "观点", value: 2 },
       ], // 笔记或者观点的标签
       topLableActive: 1, // 笔记或者观点的选中
-      industryLabel: [
-        { name: "笔记1", value: 1 },
-        { name: "笔记2", value: 2 },
-        { name: "笔记3", value: 3 },
-        { name: "笔记4", value: 4 },
-        { name: "笔记5", value: 5 },
-      ], // 行业标签
+      industryLabel: [], // 行业标签
       selectedLableList: [], // 行业标签已选项
-      companyLable: [
-        { name: "笔记11", value: 1 },
-        { name: "笔记22", value: 2 },
-        { name: "笔记33", value: 3 },
-        { name: "笔记44", value: 4 },
-        { name: "笔记55", value: 5 },
-      ], // 公司标签
+      companyLable: [], // 公司标签
       companySelectedLable: [], // 公司标签已选项
+      detailId: 0,
+      detailDataForm: {},
+      editorCtx: null,
     };
   },
+  computed: {
+    uploadUrl() {
+      return uploadurl;
+    },
+  },
   methods: {
+    // 初始获取导航栏
     initNavBar() {
       let menuButtonInfo = uni.getMenuButtonBoundingClientRect();
       this.navBarStyle = {
@@ -122,11 +128,60 @@ export default {
         paddingBottom: "4px",
       };
     },
+    // 添加标签完成事件
+    addCompleteHandler() {
+      this.industryCompanyLable = [...this.selectedLableList, ...this.companySelectedLable];
+      this.showPopup = false;
+      this.$nextTick(() => {
+        this.selectedLableList = [];
+        this.companySelectedLable = [];
+      });
+    },
+    // 左上角的返回按钮
+    goHandler() {
+      let { Title, Content, ImgUrl, Tags } = this.detailDataForm;
+      if (Title && Tags && (Title != this.articleTitle || (this.advice_content != Content && this.fileList.join(",") != ImgUrl) || this.industryCompanyLable.join(",") != Tags)) {
+        uni.showModal({
+          title: "是否保存当前修改",
+          content: "保存的草稿可在【内容中心】查看",
+          confirmColor: "#3385FF",
+          cancelColor: "#606266",
+          cancelText: "不保存",
+          confirmText: "保存",
+          success(res) {
+            if (res.confirm) {
+              uni.navigateBack();
+            } else {
+              console.log(11);
+            }
+          },
+        });
+        return;
+      }
+      if (this.articleTitle || this.advice_content || this.fileList > 0 || this.industryCompanyLable.length > 0) {
+        uni.showModal({
+          title: "是否保存当前修改",
+          content: "保存的草稿可在【内容中心】查看",
+          confirmColor: "#3385FF",
+          cancelColor: "#606266",
+          cancelText: "不保存",
+          confirmText: "保存",
+          success(res) {
+            if (res.confirm) {
+              uni.navigateBack();
+            } else {
+              console.log(11);
+            }
+          },
+        });
+      } else {
+        uni.navigateBack();
+      }
+    },
     // 创建标签公司Lable
     addCompanyLableHandler() {
       if (!this.columnName) return;
-      this.companyLable.push({ name: this.columnName, value: this.companyLable.length + 1, search: true, isActive: true });
-      this.companySelectedLable = this.companyLable.filter((key) => key.isActive);
+      this.companySelectedLable.push(this.columnName);
     },
     // 行业公司标签的点击事件
     industryOfCompanyHanler(item) {
@@ -142,34 +197,30 @@ export default {
     },
     // 行业的标签点击事件
     industryLabelHandler(item) {
-      this.$set(item, "isActive", !item.isActive);
       if (this.lableActive == 1) {
-        this.selectedLableList = this.industryLabel.filter((key) => key.isActive);
+        if (this.selectedLableList.includes(item)) {
+          let index = this.selectedLableList.findIndex((key) => key == item);
+          this.selectedLableList.splice(index, 1);
+        } else {
+          this.selectedLableList.push(item);
+        }
       } else {
-        this.companySelectedLable = this.companyLable.filter((key) => key.isActive);
+        if (this.companySelectedLable.includes(item)) {
+          let index = this.companySelectedLable.findIndex((key) => key == item);
+          this.companySelectedLable.splice(index, 1);
+        } else {
+          this.companySelectedLable.push(item);
+        }
       }
     },
     // 点击取消标签的事件
     selectedLableHandle(item) {
       if (this.lableActive == 1) {
-        this.industryLabel.forEach((key) => {
-          if (key.value === item.value) {
-            item.isActive = !item.isActive;
-          }
-        });
-        this.selectedLableList = this.industryLabel.filter((key) => key.isActive);
+        let index = this.selectedLableList.findIndex((key) => key == item);
+        this.selectedLableList.splice(index, 1);
       } else {
-        if (item.search) {
-          let index = this.companyLable.findIndex((key) => key.value === item.value);
-          this.companyLable.splice(index, 1);
-        } else {
-          this.companyLable.forEach((key) => {
-            if (key.value === item.value) {
-              item.isActive = !item.isActive;
-            }
-          });
-        }
-        this.companySelectedLable = this.companyLable.filter((key) => key.isActive);
+        let index = this.companySelectedLable.findIndex((key) => key == item);
+        this.companySelectedLable.splice(index, 1);
       }
     },
     // 草稿箱
@@ -181,9 +232,17 @@ export default {
         cancelColor: "#606266",
         cancelText: "不保存",
         confirmText: "保存",
-        success(res) {
+        success: async (res) => {
           if (res.confirm) {
-            console.log(22);
+            const resSave = await purchaserApi.yanxuanSpecialSave({
+              Content: this.advice_content,
+              title: this.articleTitle,
+              Type: this.topLableActive,
+              Tags: this.industryCompanyLable.join(","),
+              ImgUrl: this.$refs.robbyImageUpload.imageList.join(","),
+              DoType: 1,
+              Id: 0,
+            });
           } else {
             console.log(11);
           }
@@ -197,20 +256,90 @@ export default {
         content: "内容将提交给管理员审核后发布,确定要提交审核吗?",
         confirmColor: "#3385FF",
         cancelColor: "#606266",
-        // cancelText: "不保存",
-        // confirmText: "保存",
-        success(res) {
+        success: async (res) => {
           if (res.confirm) {
-            console.log(22);
+            const resSave = await purchaserApi.yanxuanSpecialSave({
+              Content: this.advice_content,
+              title: this.articleTitle,
+              Type: this.topLableActive,
+              Tags: this.industryCompanyLable.join(","),
+              ImgUrl: this.$refs.robbyImageUpload.imageList.join(","),
+              DoType: 2,
+              Id: 0,
+            });
+            if(resSave.Ret===200){
+              
+            }
           } else {
             console.log(11);
           }
         },
       });
     },
+    searchHandle() {
+      this.lableActive == 1 ? this.getIndustryList() : this.getCompanySearch();
+    },
+
+    // 获取行业标签
+    async getIndustryList() {
+      const res = await purchaserApi.yanxuanSpecialIndustrySearch({
+        Keyword: this.columnName,
+      });
+      if (res.Ret === 200) {
+        this.industryLabel = res.Data;
+      }
+    },
+
+    // 获取公司标签
+    async getCompanySearch() {
+      const res = await purchaserApi.yanxuanSpecialCompanySearch({
+        Keyword: this.columnName,
+      });
+      if (res.Ret === 200) {
+        this.companyLable = res.Data;
+      }
+    },
+    deleteImage(e) {
+      this.fileList = [...e.allImages];
+    },
+    addImage(e) {
+      // console.log(e);
+      this.fileList = [...e.allImages];
+    },
+    // 获取专栏详情
+    async getDetaliData() {
+      const res = await purchaserApi.yanxuanSpecialDetail({
+        Id: this.detailId,
+      });
+      if (res.Ret === 200) {
+        this.detailDataForm = res.Data;
+        this.articleTitle = this.detailDataForm.Title;
+        this.advice_content = this.detailDataForm.Content;
+        this.$nextTick(() => {
+          this.editorCtx.insertText({
+            text: this.detailDataForm.Content,
+          });
+        });
+        this.fileList = this.detailDataForm.ImgUrl ? this.detailDataForm.ImgUrl.split(",") : [];
+        this.industryCompanyLable = this.detailDataForm.Tags.split(",");
+      }
+    },
+    onEditorReady() {
+      uni
+        .createSelectorQuery()
+        .select("#editor")
+        .context((res) => {
+          this.editorCtx = res.context;
+        })
+        .exec();
+    },
   },
-  onLoad() {
+  onLoad(options) {
+    this.detailId = options.id || 0;
+    console.log(this.detailId);
+    this.detailId > 0 && this.getDetaliData();
     this.initNavBar();
+    this.getIndustryList();
   },
 };
 </script>
@@ -218,7 +347,7 @@ export default {
 <style lang="scss" scope>
 .write-note {
   .nav-bar-wrap {
-    position:sticky;
+    position: sticky;
     top: 0;
     left: 0;
     width: 100%;
@@ -271,6 +400,25 @@ export default {
       .new-lable {
         margin-top: 20px;
         color: #376cbb;
+        display: flex;
+        width: 100%;
+        overflow: hidden;
+        overflow-x: auto;
+
+        .lable-li {
+          flex-shrink: 0;
+          display: flex;
+          align-items: center;
+          margin: 0 20rpx 30rpx 0;
+          height: 56rpx;
+          padding: 0 24rpx;
+          border-radius: 153rpx;
+          background-color: #f8f8fa;
+        }
+        .active {
+          background-color: #376cbb;
+          color: #fff;
+        }
       }
     }
   }
@@ -394,6 +542,9 @@ export default {
     .lable-ul {
       display: flex;
       flex-wrap: wrap;
+      max-height: 500rpx;
+      overflow: hidden;
+      overflow-y: auto;
       .lable-li {
         flex-shrink: 0;
         display: flex;

+ 10 - 1
pages.json

@@ -537,7 +537,16 @@
             "navigationStyle": "custom"
           }
         }
-      ]
+          ,{
+                    "path" : "toExamine/toExamine",
+                    "style" :                                                                                    
+                {
+                    "navigationBarTitleText": "笔记详情",
+                    "enablePullDownRefresh": false
+                }
+                
+                }
+            ]
     },
     {
       "root": "pages-message",