LAPTOP-FO2T5SIU\35838 10 月之前
父節點
當前提交
698f44daf4

+ 24 - 0
js_sdk/http.js

@@ -633,6 +633,30 @@ export function getHomeCommunityActivityById(data) {
     )
 }
 
+// 查询企业是否报名
+export function isRegistration(data) {
+    return $http.post(
+        '/wx/homeActivity/isRegistration',
+        data, {}
+    )
+}
+
+//查询企业报名信息
+export function getRegistrationInfo(data) {
+    return $http.post(
+        '/wx/homeActivity/getRegistrationInfo',
+        data, {}
+    )
+}
+
+//签到
+export function updateSignIn(data) {
+    return $http.post(
+        '/wx/homeActivity/updateSignIn',
+        data, {}
+    )
+}
+
 export function isFinishComInfo(data) {
     return $http.post(
         '/wx/company/isFinishComInfo',

+ 63 - 31
pages/subPackages/parkActivity/activeApplication.vue

@@ -8,7 +8,7 @@
       </div>
       <div @tap.stop="clickColl()" class="joinBox">
         <span class="joinName">{{ form.registrationNumbers }}参加</span>
-        <span class="shoucang"><img :src="isColl ? heartSel : heart" class="scImg"/> 收藏</span>
+        <span class="shoucang"><img :src="form.collectorsStatus==='2' ? heartSel : heart" class="scImg"/> 收藏</span>
       </div>
       <div class="contactBox">
           <span class="contackLeft">
@@ -53,21 +53,23 @@
       <div class="secondBoxItem">
         <span class="secondBoxTitle">活动参与</span>
         <span class="secondBoxInfo">
-             {{form.activityQuota}}
+             {{ form.activityQuota }}
            </span>
       </div>
     </div>
-    <button class="bmBtn" @tap="toApplication">我要报名</button>
+    <button v-if="!registrationFlag" class="bmBtn" @tap="toApplication">我要报名</button>
+    <button v-if="registrationFlag" class="bmBtn2" @tap="toApplication">已报名</button>
   </div>
 </template>
 
 <script>
-import {getHomeCommunityActivityById, getByCodes} from "../../../js_sdk/http";
+import {getHomeCommunityActivityById, getByCodes, isRegistration, getUserLocalStorageInfo, homeActivityClickCollect} from "../../../js_sdk/http";
 
 export default {
   name: "activeApplication",
   data() {
     return {
+      getUserLocalStorageInfo: getUserLocalStorageInfo(),
       dc_key: ['activity_stat'],
       heartSel: "https://www.idea-co-sf.com/gardenProduct/image/heartSel.png",
       heart: "https://www.idea-co-sf.com/gardenProduct/image/heart.png",
@@ -75,40 +77,47 @@ export default {
       form: {},
       dic_SelectList: [],
       statusList: [],
-      id: ''
+      activityId: '',
+      registrationFlag: false
     }
   },
   created() {
     this.getByCodes()
   },
-  onShow(){
-    getHomeCommunityActivityById({id: this.id}).then(res => {
-      if (res.errno === 0) {
-        this.form = res.data
-        this.statusList.forEach(item => {
-          if (this.form.status == item.value) {
-            this.form.statusName = item.label
-          }
-        })
-      }
-    })
+  onShow() {
+    this.getById()
   },
   onLoad(options) {
-    this.id = options.activityId
-    getHomeCommunityActivityById({id: options.activityId}).then(res => {
-      if (res.errno === 0) {
-        this.form = res.data
-        this.statusList.forEach(item => {
-          if (this.form.status == item.value) {
-            this.form.statusName = item.label
-          }
-        })
-      }
-
-
-    })
+    this.activityId = options.activityId
+    this.getById()
   },
   methods: {
+    getById(){
+      const data = {
+        id : this.activityId,
+        createdBy: getUserLocalStorageInfo().userId,
+      }
+      getHomeCommunityActivityById(data).then(res => {
+        if (res.errno === 0) {
+          this.form = res.data
+          this.statusList.forEach(item => {
+            if (this.form.status == item.value) {
+              this.form.statusName = item.label
+            }
+          })
+
+          const data = {
+            activityId: this.activityId,
+            companyId: getUserLocalStorageInfo().userId
+          }
+          isRegistration(data).then(res => {
+            if (res.errno === 0) {
+              this.registrationFlag = res.data
+            }
+          })
+        }
+      })
+    },
     async getByCodes() {
       let data = await getByCodes(JSON.stringify(this.dc_key));
       this.dic_SelectList = this.$common.handleDicList(data);
@@ -116,11 +125,22 @@ export default {
       console.log('this.statusList', this.statusList)
     },
     clickColl() {
-      this.isColl = !this.isColl
+      if (this.form.collectorsStatus==='2'){
+        this.form.collectorsStatus='1'
+      }else{
+        this.form.collectorsStatus='2'
+      }
+
+      homeActivityClickCollect({
+        id: this.activityId,
+        createdBy: getUserLocalStorageInfo().userId,
+        collectorsStatus: this.form.collectorsStatus
+      }).then(res => {
+      });
     },
     toApplication() {
       uni.navigateTo({
-        url: '/pages/subPackages/parkActivity/applicationInfo?activityId=' + this.form.id
+        url: '/pages/subPackages/parkActivity/applicationInfo?activityId=' + this.form.id + "&registrationFlag=" + this.registrationFlag
       })
     }
   }
@@ -257,5 +277,17 @@ export default {
     border-radius: 8rpx;
     margin: 48rpx 48rpx 0rpx 48rpx;
   }
+
+  .bmBtn2 {
+    width: 654rpx;
+    height: 96rpx;
+    display: flex;
+    align-items: center;
+    justify-content: center;
+    color: white;
+    background: #9f9e9e;
+    border-radius: 8rpx;
+    margin: 48rpx 48rpx 0rpx 48rpx;
+  }
 }
 </style>

+ 165 - 15
pages/subPackages/parkActivity/activityCheckIn.vue

@@ -3,56 +3,161 @@
     <div class="appFirstBox">
       <img src="https://www.idea-co-sf.com/gardenProduct/image/img1.png" class="firstImg"/>
       <div class="appTitle">
-        <span class="titleName">互联网私募如何入门?</span>
-<!--        <span class="titleType">进行中</span>-->
+        <span class="titleName">{{ form.activityName }}</span>
+        <span class="titleType">{{ form.statusName }}</span>
       </div>
       <div @tap.stop="clickColl()" class="joinBox">
-        <span class="joinName">2024-06-15  09:00  ~  17:00</span>
-        <span class="joinName">26人参加</span>
+        <span class="joinName">{{ form.registrationNumbers }}参加</span>
+        <span class="shoucang"><img :src="form.collectorsStatus==='2' ? heartSel : heart" class="scImg"/> 收藏</span>
       </div>
       <div class="contactBox">
-        <span class="contactName">活动内容</span>
-        <span class="contactInfo">这是活动内容,这是活动内容,这是活动内容,这是活动内容,这是活动内容,这是活动内容。这是活动内容动内容,这是活动内容。</span>
+          <span class="contackLeft">
+            <span style="color: #666666;font-size: 28rpx">联系电话:</span>
+            <span style="color: #18172A;font-size: 36rpx;font-weight: 600">{{ form.activityPhone }}</span>
+          </span>
+        <img src="https://www.idea-co-sf.com/gardenProduct/image/phoneIcon.png" class="phoneIcon">
+      </div>
+    </div>
+    <div class="appSecondBox">
+      <div class="secondBoxItem">
+        <span class="secondBoxTitle">活动举办</span>
+        <span class="secondBoxInfo">{{ form.activitiesNotice }}</span>
+      </div>
+      <div class="secondBoxItem">
+        <span class="secondBoxTitle">活动内容</span>
+        <span class="secondBoxInfo">{{ form.activityContent }}</span>
+      </div>
+      <div class="secondBoxItem">
+        <span class="secondBoxTitle">活动时间</span>
+        <span class="secondBoxInfo">{{ form.activityStartTime }}  ~  {{ form.activityEndTime }}</span>
+      </div>
+      <div class="secondBoxItem">
+        <span class="secondBoxTitle">活动地址</span>
+        <span class="secondBoxInfo dhInfo">
+             <span>{{ form.activityAddress }} - {{ form.activityAddressDetail }}</span>
+             <img src="./image/dhIcon.png" class="dhIcon">
+           </span>
+      </div>
+      <div class="secondBoxItem">
+        <span class="secondBoxTitle">报名条件</span>
+        <span class="secondBoxInfo">
+             {{ form.registrationConditions }}
+           </span>
+      </div>
+      <div class="secondBoxItem">
+        <span class="secondBoxTitle">报名时间</span>
+        <span class="secondBoxInfo">
+             {{ form.registrationStartTime }}  ~  {{ form.registrationEndTime }}
+           </span>
+      </div>
+      <div class="secondBoxItem">
+        <span class="secondBoxTitle">活动参与</span>
+        <span class="secondBoxInfo">
+             {{ form.activityQuota }}
+           </span>
       </div>
     </div>
     <div class="checkInLastBox">
-      <span class="contactName">活动内容</span>
+      <span class="contactName">请填写报名信息</span>
       <ul class="appInfoBox">
         <li class="appInfoLi">
              <span class="appInfoLiTitle">
                <span class="liName">请选择企业</span>
              </span>
-          <input type="text" name="" id="" class="appInfoIpt" placeholder="请输入">
+          <input type="text" name="" id="" class="appInfoIpt" v-model="form.companyName" placeholder="请输入">
         </li>
         <li class="appInfoLi" style="border-bottom: none">
              <span class="appInfoLiTitle">
                <span class="liName">请填写姓名</span>
              </span>
-          <input type="text" name="" id="" class="appInfoIpt" placeholder="请输入">
+          <input type="text" name="" id="" v-model="form.name" class="appInfoIpt" placeholder="请输入">
         </li>
       </ul>
     </div>
-    <button class="bmBtn" @tap="toApplication">提交签到</button>
+    <button class="bmBtn" @tap="submit">提交签到</button>
   </div>
 </template>
 
 <script>
+import { getHomeCommunityActivityById, getUserLocalStorageInfo,updateSignIn } from "@/js_sdk/http";
+import {homeActivityClickCollect} from "../../../js_sdk/http";
+
 export default {
   name: "activeApplication",
   data(){
     return{
+      getUserLocalStorageInfo: getUserLocalStorageInfo(),
       heartSel: "https://www.idea-co-sf.com/gardenProduct/image/heartSel.png",
       heart: "https://www.idea-co-sf.com/gardenProduct/image/heart.png",
       isColl: true,
+      form:{
+        companyId: getUserLocalStorageInfo().userId,
+      },
+      activityId: ''
     }
   },
+  onShow() {
+
+  },
+  onLoad(options){
+    this.activityId = options.activityId
+    this.getById()
+  },
   methods:{
-    clickColl(){
-      this.isColl = !this.isColl
+    getById(){
+      const data = {
+        id : this.activityId,
+        createdBy: getUserLocalStorageInfo().userId,
+      }
+      getHomeCommunityActivityById(data).then(res => {
+        if (res.errno === 0) {
+          this.form = res.data
+          this.statusList.forEach(item => {
+            if (this.form.status == item.value) {
+              this.form.statusName = item.label
+            }
+          })
+        }
+      })
+    },
+    clickColl() {
+      if (this.form.collectorsStatus==='2'){
+        this.form.collectorsStatus='1'
+      }else{
+        this.form.collectorsStatus='2'
+      }
+
+      homeActivityClickCollect({
+        id: this.activityId,
+        createdBy: getUserLocalStorageInfo().userId,
+        collectorsStatus: this.form.collectorsStatus
+      }).then(res => {
+      });
     },
     toApplication(){
       uni.navigateTo({
-        url:'/pages/subPackages/parkActivity/applicationInfo'
+        url:'pages/index/index'
+      })
+    },
+    submit(){
+      this.form.communityActivityId = this.activityId
+      updateSignIn(this.form).then((res) => {
+        if (res.errno === 0){
+          uni.showToast({
+            title: '签到成功',
+            icon: 'success',
+            mask: true,
+            duration: 1000
+          });
+          this.toApplication
+        }else {
+          uni.showToast({
+            title: res.msg,
+            icon: 'success',
+            mask: true,
+            duration: 1000
+          });
+        }
       })
     }
   }
@@ -115,8 +220,9 @@ export default {
     }
     .contactBox{
       display: flex;
-      flex-direction: column;
-      padding:24rpx 0;
+      align-items: center;
+      justify-content: space-between;
+      padding: 24rpx 0;
       border-top: 1px solid #E6E6E6;
       .contactInfo{
         color: #666666;
@@ -124,6 +230,49 @@ export default {
         line-height: 40rpx;
         margin-top: 16rpx;
       }
+      .contackLeft {
+        display: flex;
+        align-items: center;
+      }
+      .phoneIcon {
+        width: 64rpx;
+        height: 64rpx;
+      }
+    }
+  }
+  .appSecondBox {
+    padding: 32rpx;
+    background: white;
+
+    .secondBoxItem {
+      display: flex;
+      flex-direction: column;
+      margin-bottom: 48rpx;
+
+      .secondBoxTitle {
+        color: #222222;
+        font-size: 32rpx;
+        font-weight: 600;
+        margin-bottom: 16rpx;
+      }
+
+      .secondBoxInfo {
+        font-size: 28rpx;
+        color: #666666;
+        line-height: 40rpx;
+      }
+
+      .dhInfo {
+        display: flex;
+        justify-content: space-between;
+
+        .dhIcon {
+          width: 36rpx;
+          height: 36rpx;
+          padding-left: 20rpx;
+          border-left: 1px solid #E6E6E6;
+        }
+      }
     }
   }
   .contactName{
@@ -145,6 +294,7 @@ export default {
   .checkInLastBox{
     background: white;
     padding: 32rpx 32rpx 0 32rpx;
+    margin-top: 24rpx;
   }
   .appInfoBox{
     margin: 16rpx 0;

+ 36 - 25
pages/subPackages/parkActivity/applicationInfo.vue

@@ -46,12 +46,13 @@
            </li>
          </ul>
       </div>
-      <button class="bmBtn" @tap="submit">提交报名</button>
+      <button v-if="!registrationFlag" class="bmBtn" @tap="submit">提交报名</button>
     </div>
 </template>
 
 <script>
 import { updateRegistration,getUserLocalStorageInfo } from "@/js_sdk/http";
+import {getRegistrationInfo} from "../../../js_sdk/http";
 
 export default {
   name: "applicationInfo",
@@ -63,39 +64,49 @@ export default {
       form:{
         companyId: getUserLocalStorageInfo().userId,
         companyName: getUserLocalStorageInfo().username,
-      }
+      },
+      registrationFlag: false
     }
   },
   onLoad(options){
     this.activityId = options.activityId
+    this.registrationFlag = options.registrationFlag
+    // 如果已报名则回显
+    if(this.registrationFlag){
+      this.getById()
+    }
   },
   methods:{
+    getById(){
+      const data = {
+        activityId: this.activityId,
+        companyId: getUserLocalStorageInfo().userId,
+      }
+      getRegistrationInfo(data).then((res)=>{
+        this.form = res.data
+      })
+    },
     submit(e){
       this.form.communityActivityId = this.activityId
-      console.log(111111)
-      uni.navigateBack({
-        // url:'pages/subPackages/parkActivity/activeApplication?activityId=' + this.activityId
+      updateRegistration(this.form).then((res) => {
+        if (res.errno === 0){
+          uni.showToast({
+            title: '报名成功',
+            icon: 'success',
+            mask: true,
+            duration: 1000
+          });
+          uni.navigateBack({
+          })
+        }else {
+          uni.showToast({
+            title: res.msg,
+            icon: 'success',
+            mask: true,
+            duration: 1000
+          });
+        }
       })
-      // updateRegistration(this.form).then((res) => {
-      //   if (res.errno === 0){
-      //     uni.showToast({
-      //       title: '报名成功',
-      //       icon: 'success',
-      //       mask: true,
-      //       duration: 1000
-      //     });
-      //     uni.redirectTo({
-      //       url:'pages/subPackages/parkActivity/activeApplication?activityId=' + this.activityId
-      //     })
-      //   }else {
-      //     uni.showToast({
-      //       title: res.msg,
-      //       icon: 'success',
-      //       mask: true,
-      //       duration: 1000
-      //     });
-      //   }
-      // })
     },
   }
 }

+ 1 - 1
pages/utils/constant.js

@@ -4,7 +4,7 @@
 // export const BASE_URI = "http://192.168.3.94:9010"; // 老潘本地
 // export const BASE_URI = "http://192.168.2.107:9011"; // 洮洮本地
 // export const BASE_URI = "http://192.168.2.103:9010"; // 老崔本地
-export const BASE_URI = "http://192.168.2.105:9015"; // 许峰本地
+export const BASE_URI = "http://localhost:9011"; // 许峰本地
 // export const BASE_URI = "http://192.168.2.112:9010"; // 陈凡本地
 
 export default {