Bläddra i källkod

* 小程序变更

chen.cheng 10 månader sedan
förälder
incheckning
0ea7debcfb

+ 53 - 16
common/EnumConst.js

@@ -12,9 +12,46 @@ export const CONTENT_TYPE = {
   news: 1,
   conference: 6,
   theme: 4,
-  conferenceMaterials: 5
+  conferenceMaterials: 5,
 };
 
+export const MEETING_TYPE = {
+  1: {
+    name: '澶т細鎶ュ悕',
+    value: '1',
+  },
+  2: {
+    name: '浼氬満璋冪爺',
+    value: '2',
+  },
+  3: {
+    name: '涓婚�鐮旇�',
+    value: '3',
+  },
+  meeting: {
+    name: '浼氳�鎶ュ悕',
+    value: '1',
+  },
+  theme: {
+    name: '涓婚�鐮旇�',
+    value: '3',
+  },
+  conference: {
+    name: '浼氬満璋冪爺',
+    value: '2',
+  },
+};
+
+export const USR_TYPE_LIST = [
+  {
+    value: '1',
+    name: '澶т細浠h〃',
+  },
+  {
+    value: '2',
+    name: '闅忚�浜哄憳',
+  },
+];
 export const FILE_ICON = {
   doc: '/profile/upload/2024/08/20/word_20240820110735A012.svg',
   docx: '/profile/upload/2024/08/20/word_20240820110735A012.svg',
@@ -27,47 +64,47 @@ export const FILE_ICON = {
   pdf: '/profile/upload/2024/08/20/pdf_20240820110643A008.svg',
   png: '/profile/upload/2024/08/20/image_20240820110632A007.svg',
   mp4: '/profile/upload/2024/08/20/video_20240820110721A011.svg',
-  defIcon: '/profile/upload/2024/08/17/file_icon_20240817121536A002.svg'
+  defIcon: '/profile/upload/2024/08/17/file_icon_20240817121536A002.svg',
 };
 export const SYS_YES_NO = {
   '0': {
-    name: '',
+    name: '鏄�',
     value: 0,
   },
   '1': {
-    name: '',
+    name: '鍚�',
     value: 1,
   },
 };
 export const REVIEW_STATUS = {
   '0': {
-    name: '审核通过',
-    value: 0,
+    name: '瀹℃牳閫氳繃',
+    value: '0',
     tag: 'success',
   },
   '1': {
-    name: '审核不通过',
-    value: 1,
+    name: '瀹℃牳涓嶉€氳繃',
+    value: '1',
     tag: 'danger',
   },
   '2': {
-    name: '待审核',
-    value: 2,
+    name: '寰呭�鏍�',
+    value: '2',
     tag: 'warning',
   },
   'pass': {
-    name: '审核通过',
-    value: 0,
+    name: '瀹℃牳閫氳繃',
+    value: '0',
     tag: 'success',
   },
   'noPass': {
-    name: '审核不通过',
-    value: 1,
+    name: '瀹℃牳涓嶉€氳繃',
+    value: '1',
     tag: 'danger',
   },
   'wait': {
-    name: '待审核',
-    value: 2,
+    name: '寰呭�鏍�',
+    value: '2',
     tag: 'warning',
   },
 };

+ 11 - 2
common/api.js

@@ -27,6 +27,15 @@ export const fetchUsrMeetingInfo = (params) => {
     });
 };
 
+export const fetchUsrThemeMeetingInfo = (params, type) => {
+  return http.get(`/cp/usrApply/info/meeting/${type}`,
+    {
+      params,
+      header: {
+        Authorization: `Bearer ${getToken()}`,
+      },
+    });
+};
 
 export const fetchContentDetail = (id) => http.get(`/cp/contentInfo/${id}`);
 
@@ -39,12 +48,12 @@ export const fetchViewCfgList = (params) => http.get('/cp/viewcfg/list',
 export const fetchFileList = (params) => http.get('/cp/fileInfo/list',
   { params });
 
-export const putUsrRegist = (params) => {
+export const putUsrRegist = (params, type) => {
   const token = getToken();
   if (!token) {
     return Promise.reject('未登录');
   }
-  return http.post(`/cp/usr/regist/${1}`, params, {
+  return http.post(`/cp/usr/regist/${type}`, params, {
     header: {
       Authorization: `Bearer ${token}`,
     },

+ 0 - 0
pasb/pages/component/RichText/index.scss → components/RichText/index.scss


+ 0 - 0
pasb/pages/component/RichText/index.vue → components/RichText/index.vue


+ 2 - 2
package.json

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

+ 12 - 0
pages.json

@@ -107,6 +107,18 @@
           "style": {
             "navigationBarTitleText": "我的报名"
           }
+        },
+        {
+          "path": "pages/regtheme/index",
+          "style": {
+            "navigationBarTitleText": "报名"
+          }
+        },
+        {
+          "path": "pages/regtheme/mytheme",
+          "style": {
+            "navigationBarTitleText": "我的报名"
+          }
         }
       ]
     }

+ 7 - 3
pages/tabbar/index/index.vue

@@ -42,9 +42,9 @@
 
 <script>
 import { fetchContentInfo, fetchMsgList, fetchViewCfgList } from '@/common/api';
-import { COMP_CODE } from '@/common/EnumConst';
+import { COMP_CODE, MEETING_TYPE } from '@/common/EnumConst';
 import ItemList from '@/components/ItemList/index.vue';
-import { getImageUrl } from '@/util';
+import { getImageUrl, setStorageObj, storageKey } from '@/util';
 
 export default {
   components: {
@@ -72,8 +72,12 @@ export default {
 
     },
     onContentClick(item) {
+      setStorageObj(storageKey.regtheme, {
+        type: MEETING_TYPE.theme.value,
+        id: item.id,
+      });
       uni.navigateTo({
-        url: `/pasb/pages/detail/index?id=${item.id}`,
+        url: `/pasbrg/pages/regtheme/index?type=${MEETING_TYPE.theme.value}&id=${item.id}`,
       });
     },
     async loadmore() {

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

@@ -43,7 +43,7 @@
 import { fetchViewCfgList } from '@/common/api';
 import { COMP_CODE } from '@/common/EnumConst';
 import AuthWrap from '@/components/AuthComp/index.vue';
-import { authLogin, exit, getImageUrl, getUserInfo } from '@/util';
+import { authLogin, exit, getImageUrl, getUrlParams, getUserInfo, setStorageObj } from '@/util';
 
 export default {
   components: { AuthWrap },
@@ -93,6 +93,10 @@ export default {
     },
     onItemClick(item) {
       if (item.url) {
+        const reqs = getUrlParams(item.url);
+        if (reqs && reqs.storage) {
+          setStorageObj(reqs.storage, reqs);
+        }
         uni.navigateTo({
           url: item.url,
         });

+ 1 - 1
pasb/pages/detail/index.vue

@@ -29,7 +29,7 @@
 <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 RichText from '@/components/RichText/index.vue';
 import { authLogin, getUserInfo } from '@/util';
 
 export default {

+ 7 - 3
pasb/pages/meeting-info/index.vue

@@ -8,9 +8,9 @@
 
 <script>
 import { fetchContentInfo } from '@/common/api';
-import { CONTENT_TYPE } from '@/common/EnumConst';
+import { CONTENT_TYPE, MEETING_TYPE } from '@/common/EnumConst';
 import ItemList from '@/components/ItemList/index.vue';
-import { getImageUrl } from '@/util';
+import { getImageUrl, setStorageObj, storageKey } from '@/util';
 
 export default {
   components: {
@@ -27,8 +27,12 @@ export default {
   },
   methods: {
     onContentClick(item) {
+      setStorageObj(storageKey.regtheme, {
+        type: MEETING_TYPE.conference.value,
+        id: item.id,
+      });
       uni.navigateTo({
-        url: `/pasb/pages/detail/index?id=${item.id}`,
+        url: `/pasbrg/pages/regtheme/index?type=${MEETING_TYPE.conference.value}&id=${item.id}`,
       });
     },
     async loadmore(keyword = '') {

+ 10 - 16
pasb/pages/regist/index.vue

@@ -83,7 +83,7 @@
                   :style="{
                   marginRight: '20rpx'
                 }"
-                  v-for="(item, index) in usrTypeList"
+                  v-for="(item, index) in USR_TYPE_LIST"
                   :key="index"
                   :label="item.name"
                   :name="item.value"
@@ -156,7 +156,7 @@
 <script>
 
 import { fetchContentInfo, fetchUsrInfo, putUsrRegist } from '@/common/api';
-import { CONTENT_TYPE, ICON_CFG } from '@/common/EnumConst';
+import { CONTENT_TYPE, ICON_CFG, MEETING_TYPE, USR_TYPE_LIST } from '@/common/EnumConst';
 import AuthWrap from '@/components/AuthComp/index.vue';
 import SingleDropList from '@/components/SingleDropList/index.vue';
 import { getImageUrl, getUserInfo, setUserInfo } from '@/util';
@@ -171,24 +171,15 @@ export default {
   data() {
     return {
       ICON_CFG,
+      USR_TYPE_LIST,
       showEnterprise: false,
       loading: false,
       model1: {
         userInfo: {
           usrName: '',
-          conferenceFlag: 'N',
+          conferenceFlag: '1',
         },
       },
-      usrTypeList: [
-        {
-          value: '1',
-          name: '大会代表',
-        },
-        {
-          value: '2',
-          name: '随行人员',
-        },
-      ],
       conferenceHall: [],
       tripList: [],
       rules: {
@@ -231,7 +222,7 @@ export default {
           trigger: ['blur', 'change'],
         },
         'userInfo.contentId': {
-          type: 'string',
+          type: 'number',
           required: true,
           message: '请选择会场',
           trigger: ['blur', 'change'],
@@ -259,8 +250,9 @@ export default {
   methods: {
     getImageUrl,
     conferenceSelect(item) {
+      debugger
       this.model1.userInfo.contentId = item.value;
-      this.$refs.uForm.validateField('userInfo.contentId');
+      this.$refs.uForm.clearValidate('userInfo.contentId');
     },
     async init() {
       const {
@@ -281,8 +273,9 @@ export default {
     },
     onSubmit() {
       this.loading = true;
+      this.model1.userInfo;
       this.$refs.uForm.validate().then(async (res) => {
-        const { code } = await putUsrRegist(this.model1.userInfo);
+        const { code } = await putUsrRegist(this.model1.userInfo, MEETING_TYPE.meeting.value);
         this.loading = false;
         if (code !== 200) {
           return;
@@ -303,6 +296,7 @@ export default {
           },
         });
       }).catch(errors => {
+        debugger
         this.loading = false;
       });
     },

+ 1 - 1
pasb/pages/usr-trip/index.vue

@@ -17,7 +17,7 @@
 import { fetchUsrTrip } from '@/common/api';
 import AuthWrap from '@/components/AuthComp/index.vue';
 import ItemList from '@/components/ItemList/index.vue';
-import RichText from '@/pasb/pages/component/RichText/index.vue';
+import RichText from '@/components/RichText/index.vue';
 
 export default {
   components: {

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

@@ -1,8 +1,19 @@
+@import "common/common.scss";
 .regmeeting-content-info-container {
   width: 90%;
   margin: 20rpx auto;
   padding: 0 0 100rpx 0;
   /deep/ .u-tag-wrapper{
     flex-direction: row !important;
+    margin-top: 12rpx;
+  }
+  .u-page__button-item{
+    position: fixed;
+    bottom: 110rpx;
+    width: 90%;
+    left: 0;
+    left: 0;
+    right: 0;
+    margin: auto;
   }
 }

+ 26 - 20
pasbrg/pages/regmeeting/index.vue

@@ -1,63 +1,69 @@
 <template>
-  <auth-wrap class="regmeeting-content-info-container" ref="authWrap">
-    <template slot="content">
-      <u-cell-group>
+  <auth-wrap ref="authWrap">
+    <view class="regmeeting-content-info-container" slot="content">
+      <u-cell-group :border="false">
         <u-cell title="姓名" :label="meetingInfo.usrName">
         </u-cell>
       </u-cell-group>
-      <u-cell-group>
+      <u-cell-group :border="false">
         <u-cell title="单位名称" :label="meetingInfo.orgUnitName">
         </u-cell>
       </u-cell-group>
-      <u-cell-group>
+      <u-cell-group :border="false">
         <u-cell title="职务" :label="meetingInfo.uniLevel">
         </u-cell>
       </u-cell-group>
-      <u-cell-group>
+      <u-cell-group :border="false">
         <u-cell title="联系电话" :label="meetingInfo.tel">
         </u-cell>
       </u-cell-group>
-      <u-cell-group>
+      <u-cell-group :border="false">
         <u-cell title="邮箱" :label="meetingInfo.email">
         </u-cell>
       </u-cell-group>
-      <u-cell-group>
+      <u-cell-group :border="false">
         <u-cell title="是否参加现场调研">
           <view
               slot="label"
           >
             <u-tag
-                plain size="mini"
+                plain
                 :text="SYS_YES_NO[meetingInfo.conferenceFlag].name"
-                :type="meetingInfo.conferenceFlag == SYS_YES_NO['0'].value ? 'success' : 'warning'"
-                shape="circle">
+                :type="meetingInfo.conferenceFlag == SYS_YES_NO['0'].value ? 'success' : 'warning'">
             </u-tag>
           </view>
         </u-cell>
       </u-cell-group>
-      <u-cell-group v-if="meetingInfo.conferenceFlag == SYS_YES_NO['0'].value">
+      <u-cell-group :border="false" 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-group :border="false">
         <u-cell title="审核状态">
           <view
               slot="label"
           >
             <u-tag
-                plain size="mini"
+                plain
                 :text="REVIEW_STATUS[meetingInfo.reviewState].name"
-                :type="REVIEW_STATUS[meetingInfo.reviewState].tag"
-                shape="circle">
+                :type="REVIEW_STATUS[meetingInfo.reviewState].tag">
             </u-tag>
           </view>
         </u-cell>
       </u-cell-group>
-      <u-cell-group v-if="REVIEW_STATUS.noPass.value == meetingInfo.reviewState">
+      <u-cell-group :border="false" v-if="REVIEW_STATUS.noPass.value == meetingInfo.reviewState">
         <u-cell title="不通过原因" :label="meetingInfo.reviewMsg">
         </u-cell>
       </u-cell-group>
-    </template>
+      <view class="u-page__button-item">
+        <u-button
+            :disabled="[REVIEW_STATUS.pass.value].includes(meetingInfo.reviewState)"
+            text="重新申请"
+            size="normal"
+            type="primary"
+        ></u-button>
+      </view>
+    </view>
   </auth-wrap>
 </template>
 
@@ -88,8 +94,8 @@ export default {
   },
   methods: {
     async getUsrMeetingInfo() {
-      const { data } = await fetchUsrMeetingInfo();
-      this.meetingInfo = data;
+      const { content,...apply } = await fetchUsrMeetingInfo();
+      this.meetingInfo = apply;
     },
   },
 };

+ 46 - 7
pasbrg/pages/regtheme/index.scss

@@ -1,7 +1,7 @@
-.content-info-container {
+.theme-regist-content-info-container {
   width: 90%;
   margin: 20rpx auto;
-  padding: 0 0 100rpx 0;
+  padding: 0 0 120rpx 0;
   .title-container {
     width: 100%;
 
@@ -26,18 +26,33 @@
     justify-content: center;
   }
 
-  .content-like-col{
+  .review-msg {
     width: 100%;
+    margin-top: 20rpx;
+    display: flex;
+    align-items: center;
+    justify-content: flex-start;
+
+    &::before {
+      content: '*';
+      color: red;
+      margin-right: 5px;
+      display: flex;
+      align-items: center;
+      justify-content: center;
+    }
+  }
+  .regist-btn{
+    width: 90%;
     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;
+    bottom: 80rpx;
+    transform: translateX(-50%);
+    left: 50%;
     .icon-wrap{
       display: flex;
       align-items: center;
@@ -56,4 +71,28 @@
       }
     }
   }
+  /deep/ .pop-form-content{
+    padding: 20rpx;
+    height: 1000rpx;
+    display: flex;
+    align-items: center;
+    justify-content: flex-start;
+    flex-direction: column;
+    box-sizing: border-box;
+    .u-form {
+      width: 100%;
+      .u-form-item {
+        .u-form-item__body__left {
+          width: auto !important;
+        }
+        .u-form-item__body__right__message{
+          margin-left: 0 !important;
+        }
+        .u-form-item__body__left__content__label{
+          font-weight: bold !important;
+        }
+      }
+    }
+
+  }
 }

+ 216 - 77
pasbrg/pages/regtheme/index.vue

@@ -1,67 +1,234 @@
 <template>
-  <view class="content-info-container">
+  <view class="theme-regist-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 }}
+    <u-popup :show="show" :round="5" mode="bottom" :closeOnClickOverlay="true" :overlay="true" @close="popClose">
+      <view class="pop-form-content">
+        <u--form
+            labelPosition="left"
+            :model="model1"
+            :rules="rules"
+            ref="uForm"
+            @submit="onSubmit"
+        >
+          <u-form-item
+              label="姓名"
+              prop="userInfo.usrName"
+              borderBottom
+          >
+            <u--input
+                placeholder="输入姓名"
+                v-model="model1.userInfo.usrName"
+                border="none"
+            ></u--input>
+          </u-form-item>
+          <u-form-item
+              label="单位名称"
+              prop="userInfo.orgUnitName"
+              borderBottom
+          >
+            <u--input
+                placeholder="输入单位名称"
+                v-model="model1.userInfo.orgUnitName"
+                border="none"
+            ></u--input>
+          </u-form-item>
+          <u-form-item
+              label="职务"
+              prop="userInfo.uniLevel"
+              borderBottom
+          >
+            <u--input
+                placeholder="输入职务"
+                v-model="model1.userInfo.uniLevel"
+                border="none"
+            ></u--input>
+          </u-form-item>
+          <u-form-item
+              label="联系电话"
+              prop="userInfo.tel"
+              borderBottom
+          >
+            <u--input
+                placeholder="输入联系电话"
+                border="none"
+                type="number"
+                maxlength="11"
+                v-model="model1.userInfo.tel"
+            ></u--input>
+          </u-form-item>
+          <u-form-item
+              label="邮箱"
+              prop="userInfo.email"
+              borderBottom
+          >
+            <u--input
+                placeholder="输入邮箱"
+                border="none"
+                type="number"
+                v-model="model1.userInfo.email"
+            ></u--input>
+          </u-form-item>
+          <u-form-item
+              label="人员类型"
+              prop="userInfo.usrType"
+              borderBottom
+          >
+            <u-radio-group
+                v-model="model1.userInfo.usrType"
+                placement="row"
+            >
+              <u-radio
+                  :style="{
+                  marginRight: '20rpx'
+                }"
+                  v-for="(item, index) in USR_TYPE_LIST"
+                  :key="index"
+                  :label="item.name"
+                  :name="item.value"
+              >
+              </u-radio>
+            </u-radio-group>
+          </u-form-item>
+        </u--form>
+        <u-button
+            :style="{
+              marginTop: 'auto',
+             marginBottom: '80rpx'
+            }"
+            type="primary"
+            text="提交"
+            :disabled="loading"
+            :loading="loading"
+            loadingText="正在提交..."
+            @click="onSubmit"
+        >
+        </u-button>
       </view>
+    </u-popup>
+    <view class="regist-btn">
+      <u-button
+          text="报名"
+          size="normal"
+          type="primary"
+          @click="onRegistClick"
+      ></u-button>
     </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';
+import { fetchContentDetail,  putUsrRegist } from '@/common/api';
+import { CONTENT_TYPE, USR_TYPE_LIST } from '@/common/EnumConst';
+import RichText from '@/components/RichText/index.vue';
+import { authLogin, getStorageObj, getUserInfo, storageKey } from '@/util';
 
 export default {
   name: 'content',
-  components: { RichText },
+  components: {
+    RichText,
+  },
   props: {},
   data() {
     return {
       CONTENT_TYPE,
-      content: '',
+      content: null,
       queryParams: {},
       title: '',
       date: '',
       contentType: '',
-      likeCnt: 0,
-      collectCnt: 0,
-      likeFlag: false,
-      collectFlag: false,
+      show: false,
       id: '',
+      USR_TYPE_LIST,
+      loading: false,
+      model1: {
+        userInfo: {
+          usrName: '',
+          conferenceFlag: '1',
+        },
+      },
+      rules: {
+        'userInfo.usrName': {
+          type: 'string',
+          required: true,
+          message: '请填写姓名',
+          trigger: ['blur', 'change'],
+        },
+        'userInfo.tel': {
+          type: 'string',
+          len: 11,
+          required: true,
+          message: '请填写11位手机号',
+          trigger: ['blur', 'change'],
+        },
+        'userInfo.email': {
+          type: 'string',
+          required: true,
+          message: '请填写邮箱',
+          pattern: /\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/,
+          trigger: ['blur', 'change'],
+        },
+        'userInfo.orgUnitName': {
+          type: 'string',
+          required: true,
+          message: '请填写单位名称',
+          trigger: ['blur', 'change'],
+        },
+        'userInfo.uniLevel': {
+          type: 'string',
+          required: true,
+          message: '请填写职务',
+          trigger: ['blur', 'change'],
+        },
+        'userInfo.usrType': {
+          type: 'string',
+          required: true,
+          message: '请填写人员类型',
+          trigger: ['blur', 'change'],
+        },
+      },
     };
   },
   created() {
   },
   onLoad(res) {
     // 登录返回之后的页面
-    if (res) {
-      this.queryParams = res;
-    }
+    this.queryParams = getStorageObj(storageKey.regtheme);
     this.getContentInfo();
-    this.getUsrContent();
+    this.restForm();
+    //如果需要兼容微信小程序,并且校验规则中含有方法等,只能通过setRules方法设置规则。
+    this.$refs.uForm.setRules(this.rules);
   },
   methods: {
+    onSubmit() {
+      this.loading = true;
+      this.$refs.uForm.validate().then(async (res) => {
+        const { code } = await putUsrRegist({
+          ...this.model1.userInfo,
+          contentId: this.queryParams.id,
+        }, this.queryParams.type);
+        this.loading = false;
+        if (code !== 200) {
+          return;
+        }
+        uni.showToast({
+          mask: true,
+          title: '报名完成',
+          icon: 'success',
+          success: async () => {
+            this.show = false;
+          },
+        });
+      }).catch(errors => {
+        this.loading = false;
+      });
+    },
+    popClose() {
+      this.show = false;
+    },
     async getContentInfo() {
       const {
         data: {
@@ -70,65 +237,37 @@ export default {
           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
-      })
+        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';
-        }
+    restForm() {
+      this.model1 = {
+        userInfo: {
+          usrName: '',
+        },
+      };
+      const user = getUserInfo();
+      if (user) {
+        this.model1.userInfo.usrName = user.usrName;
+        this.model1.userInfo.tel = user.tel;
       }
     },
-    onCollectClick() {
-      this.collectFlag = !this.collectFlag;
+    onRegistClick() {
       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,
-        });
+        this.show = true;
+        this.restForm();
+        this.$refs.uForm.clearValidate();
       });
-    },
-    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" />;

+ 313 - 0
pasbrg/pages/regtheme/mytheme.vue

@@ -0,0 +1,313 @@
+<template>
+  <view class="theme-regist-content-info-container">
+    <u-empty
+        mode="data"
+        text="暂未报名,前去报名"
+        v-if="isEmpty"
+    >
+    </u-empty>
+    <template v-else>
+      <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>
+      <u-popup :show="show" :round="5" mode="bottom" :closeOnClickOverlay="true" :overlay="true" @close="popClose">
+        <view class="pop-form-content">
+          <u--form
+              labelPosition="left"
+              :model="model1"
+              :rules="rules"
+              ref="uForm"
+              @submit="onSubmit"
+          >
+            <u-form-item
+                label="姓名"
+                prop="userInfo.usrName"
+                borderBottom
+            >
+              <u--input
+                  placeholder="输入姓名"
+                  v-model="model1.userInfo.usrName"
+                  border="none"
+              ></u--input>
+            </u-form-item>
+            <u-form-item
+                label="单位名称"
+                prop="userInfo.orgUnitName"
+                borderBottom
+            >
+              <u--input
+                  placeholder="输入单位名称"
+                  v-model="model1.userInfo.orgUnitName"
+                  border="none"
+              ></u--input>
+            </u-form-item>
+            <u-form-item
+                label="职务"
+                prop="userInfo.uniLevel"
+                borderBottom
+            >
+              <u--input
+                  placeholder="输入职务"
+                  v-model="model1.userInfo.uniLevel"
+                  border="none"
+              ></u--input>
+            </u-form-item>
+            <u-form-item
+                label="联系电话"
+                prop="userInfo.tel"
+                borderBottom
+            >
+              <u--input
+                  placeholder="输入联系电话"
+                  border="none"
+                  type="number"
+                  maxlength="11"
+                  v-model="model1.userInfo.tel"
+              ></u--input>
+            </u-form-item>
+            <u-form-item
+                label="邮箱"
+                prop="userInfo.email"
+                borderBottom
+            >
+              <u--input
+                  placeholder="输入邮箱"
+                  border="none"
+                  type="number"
+                  v-model="model1.userInfo.email"
+              ></u--input>
+            </u-form-item>
+            <u-form-item
+                label="人员类型"
+                prop="userInfo.usrType"
+                borderBottom
+            >
+              <u-radio-group
+                  v-model="model1.userInfo.usrType"
+                  placement="row"
+              >
+                <u-radio
+                    :style="{
+                  marginRight: '20rpx'
+                }"
+                    v-for="(item, index) in USR_TYPE_LIST"
+                    :key="index"
+                    :label="item.name"
+                    :name="item.value"
+                >
+                </u-radio>
+              </u-radio-group>
+            </u-form-item>
+          </u--form>
+          <view class="review-msg" v-if="REVIEW_STATUS.noPass.value === model1.userInfo.reviewState">
+            审核备注:{{ model1.userInfo.reviewMsg }}
+          </view>
+          <u-button
+              :style="{
+              marginTop: 'auto',
+             marginBottom: '80rpx'
+            }"
+              type="primary"
+              text="提交"
+              :disabled="loading"
+              :loading="loading"
+              loadingText="正在提交..."
+              @click="onSubmit"
+          >
+          </u-button>
+        </view>
+      </u-popup>
+      <view class="regist-btn">
+        <u-button
+            :text="REVIEW_STATUS[model1.userInfo.reviewState].name"
+            size="normal"
+            type="primary"
+            :disabled="REVIEW_STATUS.pass.value === model1.userInfo.reviewState"
+            @click="onRegistClick"
+        ></u-button>
+      </view>
+    </template>
+    <view class="regist-btn" v-if="isEmpty">
+      <u-button
+          text="我要报名"
+          size="normal"
+          type="primary"
+          throttle-time="500"
+          @click="toRegistClick"
+      ></u-button>
+    </view>
+  </view>
+</template>
+
+<script>
+import { fetchUsrThemeMeetingInfo, putUsrRegist } from '@/common/api';
+import { CONTENT_TYPE, MEETING_TYPE, REVIEW_STATUS, USR_TYPE_LIST } from '@/common/EnumConst';
+import RichText from '@/components/RichText/index.vue';
+import SingleDropList from '@/components/SingleDropList/index.vue';
+import { authLogin, getStorageObj, storageKey } from '@/util';
+
+export default {
+  name: 'content',
+  computed: {
+    REVIEW_STATUS() {
+      return REVIEW_STATUS;
+    },
+  },
+  components: {
+    SingleDropList,
+    RichText,
+  },
+  props: {},
+  data() {
+    return {
+      CONTENT_TYPE,
+      content: null,
+      queryParams: {},
+      title: '',
+      date: '',
+      contentType: '',
+      show: false,
+      isEmpty: false,
+      id: '',
+      USR_TYPE_LIST,
+      loading: false,
+      model1: {
+        userInfo: {
+          usrName: '',
+          conferenceFlag: '1',
+        },
+      },
+      rules: {
+        'userInfo.usrName': {
+          type: 'string',
+          required: true,
+          message: '请填写姓名',
+          trigger: ['blur', 'change'],
+        },
+        'userInfo.tel': {
+          type: 'string',
+          len: 11,
+          required: true,
+          message: '请填写11位手机号',
+          trigger: ['blur', 'change'],
+        },
+        'userInfo.email': {
+          type: 'string',
+          required: true,
+          message: '请填写邮箱',
+          pattern: /\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/,
+          trigger: ['blur', 'change'],
+        },
+        'userInfo.orgUnitName': {
+          type: 'string',
+          required: true,
+          message: '请填写单位名称',
+          trigger: ['blur', 'change'],
+        },
+        'userInfo.uniLevel': {
+          type: 'string',
+          required: true,
+          message: '请填写职务',
+          trigger: ['blur', 'change'],
+        },
+        'userInfo.usrType': {
+          type: 'string',
+          required: true,
+          message: '请填写人员类型',
+          trigger: ['blur', 'change'],
+        },
+      },
+    };
+  },
+  created() {
+  },
+  onLoad(res) {
+    // 登录返回之后的页面
+    this.queryParams = getStorageObj(storageKey.regtheme);
+    this.getUsrContent();
+    //如果需要兼容微信小程序,并且校验规则中含有方法等,只能通过setRules方法设置规则。
+    this.$refs.uForm.setRules(this.rules);
+  },
+  methods: {
+    onSubmit() {
+      this.loading = true;
+      this.$refs.uForm.validate().then(async (res) => {
+        const { code } = await putUsrRegist({
+          ...this.model1.userInfo,
+          contentId: this.id,
+        }, this.queryParams.type);
+        this.loading = false;
+        if (code !== 200) {
+          return;
+        }
+        uni.showToast({
+          mask: true,
+          title: '报名完成',
+          icon: 'success',
+          success: async () => {
+            this.show = false;
+          },
+        });
+      }).catch(errors => {
+        this.loading = false;
+      });
+    },
+    popClose() {
+      this.show = false;
+    },
+    async getUsrContent() {
+      const {
+        data,
+      } = await fetchUsrThemeMeetingInfo({}, this.queryParams.type);
+      if (!data) {
+        this.isEmpty = true;
+        return;
+      }
+      const {
+        content: {
+          title,
+          content,
+          createTime,
+          id,
+          contentType,
+        },
+        ...usrInfoApply
+      } = data;
+      this.content = content;
+      this.title = title;
+      this.contentType = contentType;
+      this.model1 = {
+        userInfo: { ...usrInfoApply },
+      };
+      this.id = id;
+      uni.setNavigationBarTitle({
+        title,
+      });
+      this.date = uni.$u.timeFormat(createTime, 'yyyy-mm-dd');
+    },
+    onRegistClick() {
+      authLogin(async (usr) => {
+        this.show = true;
+        this.$refs.uForm.clearValidate();
+      });
+    },
+    toRegistClick() {
+      if (this.queryParams.type == MEETING_TYPE.theme.value) {
+        uni.$u.route({
+          type: 'reLaunch',
+          url: '/pages/tabbar/index/index',
+        });
+      }
+      if (this.queryParams.type == MEETING_TYPE.conference.value) {
+        uni.$u.route({
+          type: 'navigateTo',
+          url: '/pasb/pages/meeting-info/index',
+        });
+      }
+    },
+  },
+};
+</script>
+<style lang="scss" src="./index.scss" />;

+ 19 - 0
util/index.js

@@ -148,3 +148,22 @@ export const fileIcon = (fileSuffix) => {
   }
   return getImageUrl(FILE_ICON.defIcon);
 };
+
+export const storageKey = {
+  USER_INFO: 'userInfo',
+  TOKEN: 'token',
+  regtheme: 'regtheme',
+};
+
+export const getUrlParams = (url) => {
+  if (!url || url.indexOf('?') < 0 || !url.split('?')[1]) {
+    return {};
+  }
+  const paramsArray = url.split('?')[1].split('&');
+  const params = paramsArray.reduce((acc, param) => {
+    const [key, value = ''] = param.split('=');
+    acc[decodeURIComponent(key)] = decodeURIComponent(value);
+    return acc;
+  }, {});
+  return params;
+};