Browse Source

* 小程序变更

chen.cheng 10 months ago
parent
commit
d3dec11223

+ 43 - 0
common/EnumConst.js

@@ -14,6 +14,7 @@ export const CONTENT_TYPE = {
   theme: 4,
   conferenceMaterials: 5
 };
+
 export const FILE_ICON = {
   doc: '/profile/upload/2024/08/20/word_20240820110735A012.svg',
   docx: '/profile/upload/2024/08/20/word_20240820110735A012.svg',
@@ -28,3 +29,45 @@ export const FILE_ICON = {
   mp4: '/profile/upload/2024/08/20/video_20240820110721A011.svg',
   defIcon: '/profile/upload/2024/08/17/file_icon_20240817121536A002.svg'
 };
+export const SYS_YES_NO = {
+  '0': {
+    name: '是',
+    value: 0,
+  },
+  '1': {
+    name: '否',
+    value: 1,
+  },
+};
+export const REVIEW_STATUS = {
+  '0': {
+    name: '审核通过',
+    value: 0,
+    tag: 'success',
+  },
+  '1': {
+    name: '审核不通过',
+    value: 1,
+    tag: 'danger',
+  },
+  '2': {
+    name: '待审核',
+    value: 2,
+    tag: 'warning',
+  },
+  'pass': {
+    name: '审核通过',
+    value: 0,
+    tag: 'success',
+  },
+  'noPass': {
+    name: '审核不通过',
+    value: 1,
+    tag: 'danger',
+  },
+  'wait': {
+    name: '待审核',
+    value: 2,
+    tag: 'warning',
+  },
+};

+ 12 - 0
common/api.js

@@ -16,6 +16,18 @@ export const fetchUsrContentInfo = (params) => {
     });
 };
 
+
+export const fetchUsrMeetingInfo = (params) => {
+  return http.get(`/cp/usrApply/info/meeting`,
+    {
+      params,
+      header: {
+        Authorization: `Bearer ${getToken()}`,
+      },
+    });
+};
+
+
 export const fetchContentDetail = (id) => http.get(`/cp/contentInfo/${id}`);
 
 export const fetchMsgList = (params) => http.get('/cp/msg/list',

+ 2 - 2
package.json

@@ -38,8 +38,8 @@
 				"title": "微信开发版",
 				"env": {
 					"UNI_PLATFORM": "mp-weixin",
-					"UNI_FILE_PREFIX": "http://127.0.0.1:18080/tfc",
-					"UNI_API_PREFIX": "http://127.0.0.1:18080/tfc"
+					"UNI_FILE_PREFIX": "http://172.192.13.80:18080/tfc",
+					"UNI_API_PREFIX": "http://172.192.13.80:18080/tfc"
 				},
 				"define": {
 					"MP-WEIXIN": true

+ 14 - 8
pages.json

@@ -7,12 +7,6 @@
       }
     },
     {
-      "path": "pages/tabbar/news/index",
-      "style": {
-        "navigationBarTitleText": "资讯"
-      }
-    },
-    {
       "path": "pages/tabbar/my/index",
       "style": {
         "navigationBarTitleText": "我的"
@@ -39,7 +33,7 @@
         {
           "path": "pages/file/index",
           "style": {
-            "navigationBarTitleText": "交流材料汇编"
+            "navigationBarTitleText": "大会材料"
           }
         }
       ]
@@ -75,7 +69,7 @@
         {
           "path": "pages/meeting-info/index",
           "style": {
-            "navigationBarTitleText": "大会介绍"
+            "navigationBarTitleText": "大会调研"
           }
         }
       ]
@@ -103,6 +97,18 @@
           }
         }
       ]
+    },
+    {
+      "root": "pasbrg",
+      "name": "regmeeting",
+      "pages": [
+        {
+          "path": "pages/regmeeting/index",
+          "style": {
+            "navigationBarTitleText": "我的报名"
+          }
+        }
+      ]
     }
   ],
   "globalStyle": {

+ 5 - 5
pages/tabbar/index/index.vue

@@ -123,11 +123,11 @@ export default {
         });
       }
     },
-    onSearch(val) {
-      uni.reLaunch({
-        url: `/pages/tabbar/news/index?keyword=${val}`,
-      });
-    },
+    // onSearch(val) {
+    //   uni.reLaunch({
+    //     url: `/pages/tabbar/news/index?keyword=${val}`,
+    //   });
+    // },
     onItemClick(item) {
       if (item.url) {
         uni.navigateTo({

+ 0 - 10
pages/tabbar/news/index.scss

@@ -1,10 +0,0 @@
-@import "../../../common/common.scss";
-.fui-wrap {
-  box-sizing: border-box;
-  padding: 20rpx;
-  .search-content{
-    background-color: #fefefe;
-  }
-}
-
-

+ 0 - 73
pages/tabbar/news/index.vue

@@ -1,73 +0,0 @@
-<template>
-  <view class="fui-wrap">
-    <view class="search-content">
-      <u-search placeholder="请输入关键字" v-model="keyword"></u-search>
-    </view>
-
-    <view class="u-page">
-      <view class="u-page-title">
-        <view class="line"></view>
-        <view class="rectangle"></view>
-        <view class="rectangle"></view>
-        <view class="title-content">最新资讯</view>
-        <view class="rectangle"></view>
-        <view class="rectangle"></view>
-        <view class="line"></view>
-      </view>
-      <item-list :ds="indexList" :onItemClick="onContentClick" />
-    </view>
-  </view>
-</template>
-
-<script>
-import { fetchContentInfo } from '@/common/api';
-import { CONTENT_TYPE } from '@/common/EnumConst';
-import ItemList from '@/components/ItemList/index.vue';
-import { getImageUrl } from '@/util';
-
-export default {
-  components: {
-    ItemList,
-  },
-  data() {
-    return {
-      keyword: '',
-      indexList: [],
-    };
-  },
-  onLoad(option) {
-    this.keyword = option?.keyword || '';
-    this.loadmore();
-  },
-  methods: {
-    async loadmore() {
-      let result = [];
-      const res = await fetchContentInfo({
-        pageNum: 1,
-        pageSize: 99,
-        contentType: CONTENT_TYPE.news,
-        title: this.keyword,
-      });
-      if (res.rows.length > 0) {
-        result = res.rows.map(item => {
-          return {
-            id: item.id,
-            imgUrl: getImageUrl(item.thumbnail),
-            title: item.title,
-            date: item.createTime,
-          };
-        });
-      }
-      this.indexList = result;
-    },
-    onContentClick(item) {
-      uni.navigateTo({
-        url: `/pasb/pages/detail/index?id=${item.id}`,
-      });
-    },
-  },
-
-};
-</script>
-
-<style lang="scss" src="./index.scss" />

+ 2 - 2
pasb/pages/file/index.vue

@@ -71,8 +71,8 @@ export default {
     loadmore() {
       this.loadStatus = 'loading';
       fetchContentInfo({
-        pageNum: 1,
-        pageSize: 99,
+        pageNum: page,
+        pageSize: 10,
         contentType: CONTENT_TYPE.conferenceMaterials,
         title: this.keyword,
       }).then(res => {

+ 5 - 6
pasb/pages/regist/index.vue

@@ -155,9 +155,7 @@
 
 <script>
 
-import {
-  fetchContentInfo, fetchEnterpriseList, fetchEnterpriseTripList, fetchUsrInfo, putUsrRegist,
-} from '@/common/api';
+import { fetchContentInfo, fetchUsrInfo, putUsrRegist } from '@/common/api';
 import { CONTENT_TYPE, ICON_CFG } from '@/common/EnumConst';
 import AuthWrap from '@/components/AuthComp/index.vue';
 import SingleDropList from '@/components/SingleDropList/index.vue';
@@ -284,9 +282,11 @@ export default {
     onSubmit() {
       this.loading = true;
       this.$refs.uForm.validate().then(async (res) => {
-        debugger
-        await putUsrRegist(this.model1.userInfo);
+        const { code } = await putUsrRegist(this.model1.userInfo);
         this.loading = false;
+        if (code !== 200) {
+          return;
+        }
         uni.showToast({
           mask: true,
           title: '报名完成',
@@ -303,7 +303,6 @@ export default {
           },
         });
       }).catch(errors => {
-        debugger
         this.loading = false;
       });
     },

+ 8 - 0
pasbrg/pages/regmeeting/index.scss

@@ -0,0 +1,8 @@
+.regmeeting-content-info-container {
+  width: 90%;
+  margin: 20rpx auto;
+  padding: 0 0 100rpx 0;
+  /deep/ .u-tag-wrapper{
+    flex-direction: row !important;
+  }
+}

+ 97 - 0
pasbrg/pages/regmeeting/index.vue

@@ -0,0 +1,97 @@
+<template>
+  <auth-wrap class="regmeeting-content-info-container" ref="authWrap">
+    <template slot="content">
+      <u-cell-group>
+        <u-cell title="姓名" :label="meetingInfo.usrName">
+        </u-cell>
+      </u-cell-group>
+      <u-cell-group>
+        <u-cell title="单位名称" :label="meetingInfo.orgUnitName">
+        </u-cell>
+      </u-cell-group>
+      <u-cell-group>
+        <u-cell title="职务" :label="meetingInfo.uniLevel">
+        </u-cell>
+      </u-cell-group>
+      <u-cell-group>
+        <u-cell title="联系电话" :label="meetingInfo.tel">
+        </u-cell>
+      </u-cell-group>
+      <u-cell-group>
+        <u-cell title="邮箱" :label="meetingInfo.email">
+        </u-cell>
+      </u-cell-group>
+      <u-cell-group>
+        <u-cell title="是否参加现场调研">
+          <view
+              slot="label"
+          >
+            <u-tag
+                plain size="mini"
+                :text="SYS_YES_NO[meetingInfo.conferenceFlag].name"
+                :type="meetingInfo.conferenceFlag == SYS_YES_NO['0'].value ? 'success' : 'warning'"
+                shape="circle">
+            </u-tag>
+          </view>
+        </u-cell>
+      </u-cell-group>
+      <u-cell-group v-if="meetingInfo.conferenceFlag == SYS_YES_NO['0'].value">
+        <u-cell title="调研会场" :label="meetingInfo.usrName">
+        </u-cell>
+      </u-cell-group>
+      <u-cell-group>
+        <u-cell title="审核状态">
+          <view
+              slot="label"
+          >
+            <u-tag
+                plain size="mini"
+                :text="REVIEW_STATUS[meetingInfo.reviewState].name"
+                :type="REVIEW_STATUS[meetingInfo.reviewState].tag"
+                shape="circle">
+            </u-tag>
+          </view>
+        </u-cell>
+      </u-cell-group>
+      <u-cell-group v-if="REVIEW_STATUS.noPass.value == meetingInfo.reviewState">
+        <u-cell title="不通过原因" :label="meetingInfo.reviewMsg">
+        </u-cell>
+      </u-cell-group>
+    </template>
+  </auth-wrap>
+</template>
+
+<script>
+import { fetchUsrMeetingInfo } from '@/common/api';
+import { REVIEW_STATUS, SYS_YES_NO } from '@/common/EnumConst';
+import AuthWrap from '@/components/AuthComp/index.vue';
+
+export default {
+  name: 'content',
+  components: { AuthWrap },
+  props: {},
+  data() {
+    return {
+      SYS_YES_NO,
+      REVIEW_STATUS,
+      meetingInfo: {},
+    };
+  },
+  created() {
+  },
+  onLoad(res) {
+    // 登录返回之后的页面
+    if (res) {
+      this.queryParams = res;
+    }
+    this.getUsrMeetingInfo();
+  },
+  methods: {
+    async getUsrMeetingInfo() {
+      const { data } = await fetchUsrMeetingInfo();
+      this.meetingInfo = data;
+    },
+  },
+};
+</script>
+<style lang="scss" src="./index.scss" />;

+ 59 - 0
pasbrg/pages/regtheme/index.scss

@@ -0,0 +1,59 @@
+.content-info-container {
+  width: 90%;
+  margin: 20rpx auto;
+  padding: 0 0 100rpx 0;
+  .title-container {
+    width: 100%;
+
+    .title-content-text {
+      font-size: 22px;
+      line-height: 1.4;
+      margin-bottom: 14px;
+      color: #000;
+    }
+    .title-content-date{
+      display: inline-block;
+      vertical-align: middle;
+      margin: 0 10px 10px 0;
+      font-size: 15px;
+      -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
+    }
+  }
+
+  /deep/ .ql-align-center {
+    display: flex;
+    align-items: center;
+    justify-content: center;
+  }
+
+  .content-like-col{
+    width: 100%;
+    height: 80rpx;
+    display: flex;
+    align-items: center;
+    justify-content: flex-end;
+    background-color: #fefefe;
+    position: fixed;
+    bottom: 0;
+    left: 0;
+    box-sizing: border-box;
+    padding: 10rpx 50rpx 10rpx 0;
+    .icon-wrap{
+      display: flex;
+      align-items: center;
+      justify-content: center;
+      min-width: 30rpx;
+      margin-right: 20rpx;
+      .icon-base text{
+        font-size: 25px !important;
+        line-height:25px !important;
+        &[class*='fill']{
+          color: #548cf7 !important;
+        }
+      }
+      .icon-base{
+        margin-right: 10rpx;
+      }
+    }
+  }
+}

+ 134 - 0
pasbrg/pages/regtheme/index.vue

@@ -0,0 +1,134 @@
+<template>
+  <view class="content-info-container">
+    <view class="title-container">
+      <view class="title-content-text">{{ title }}</view>
+      <view class="title-content-date">{{ date }}</view>
+    </view>
+    <rich-text :content="content"></rich-text>
+    <view class="content-like-col" v-if="CONTENT_TYPE.news === contentType">
+      <view class="icon-wrap">
+        <u-icon
+            :name="`${likeFlag ? 'thumb-up-fill':'thumb-up'}`"
+            class="icon-base"
+            @click="$u.throttle(onLikeClick,500)"
+        ></u-icon>
+        {{ likeCnt && likeCnt }}
+      </view>
+      <view class="icon-wrap">
+        <u-icon
+            :name="`${collectFlag ? 'star-fill':'star' }`"
+            class="icon-base"
+            @click="$u.throttle(onCollectClick,500)"
+        ></u-icon>
+        {{ collectCnt && collectCnt }}
+      </view>
+    </view>
+  </view>
+</template>
+
+<script>
+import { fetchContentDetail, fetchUsrContent, usrCollect, usrLike, usrUnCollect, usrUnLike } from '@/common/api';
+import { CONTENT_TYPE } from '@/common/EnumConst';
+import RichText from '@/pasb/pages/component/RichText/index.vue';
+import { authLogin, getUserInfo } from '@/util';
+
+export default {
+  name: 'content',
+  components: { RichText },
+  props: {},
+  data() {
+    return {
+      CONTENT_TYPE,
+      content: '',
+      queryParams: {},
+      title: '',
+      date: '',
+      contentType: '',
+      likeCnt: 0,
+      collectCnt: 0,
+      likeFlag: false,
+      collectFlag: false,
+      id: '',
+    };
+  },
+  created() {
+  },
+  onLoad(res) {
+    // 登录返回之后的页面
+    if (res) {
+      this.queryParams = res;
+    }
+    this.getContentInfo();
+    this.getUsrContent();
+  },
+  methods: {
+    async getContentInfo() {
+      const {
+        data: {
+          content,
+          title,
+          createTime,
+          contentType,
+          id,
+          likeCnt,
+          collectedCnt,
+        },
+      } = await fetchContentDetail(this.queryParams.id);
+      this.content = content;
+      this.title = title;
+      this.contentType = contentType;
+      this.id = id;
+      this.likeCnt = likeCnt;
+      this.collectCnt = collectedCnt;
+      uni.setNavigationBarTitle({
+        title
+      })
+      this.date = uni.$u.timeFormat(createTime, 'yyyy-mm-dd');
+    },
+    async getUsrContent() {
+      const contentId = this.queryParams.id;
+      const usrInfo = getUserInfo();
+      if (usrInfo && usrInfo.openId) {
+        const { data } = await fetchUsrContent(contentId, usrInfo.openId);
+        if (data) {
+          this.collectFlag = data[0]?.collectFlag === '0';
+          this.likeFlag = data[0]?.likeFlag === '0';
+        }
+      }
+    },
+    onCollectClick() {
+      this.collectFlag = !this.collectFlag;
+      authLogin(async (usr) => {
+        if (this.collectFlag) {
+          this.collectCnt += 1;
+          await usrCollect({
+            id: this.queryParams.id,
+          });
+          return;
+        }
+        this.collectCnt -= 1;
+        await usrUnCollect({
+          id: this.queryParams.id,
+        });
+      });
+    },
+    onLikeClick() {
+      this.likeFlag = !this.likeFlag;
+      authLogin(async (usr) => {
+        if (this.likeFlag) {
+          this.likeCnt += 1;
+          await usrLike({
+            id: this.queryParams.id,
+          });
+          return;
+        }
+        this.likeCnt -= 1;
+        await usrUnLike({
+          id: this.queryParams.id,
+        });
+      });
+    },
+  },
+};
+</script>
+<style lang="scss" src="./index.scss" />;

+ 1 - 1
util/request/responseInterceptors.js

@@ -17,7 +17,7 @@ module.exports = (vm) => {
                 return Promise.reject(data)
             } else {
                 // 否则返回一个pending中的promise
-                return new Promise(() => { })
+                return data;
             }
         }
         return data || {};