houwei 4 lat temu
rodzic
commit
bd488de66b

+ 2 - 1
public/index.html

@@ -3,7 +3,8 @@
   <head>
     <meta charset="utf-8">
     <meta http-equiv="X-UA-Compatible" content="IE=edge">
-    <meta name="viewport" content="width=device-width,initial-scale=1.0">
+    <meta name="viewport" content="width=device-width,initial-scale=1.0,minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
+    <!--  <meta name="viewport" content="width=device-width, initial-scale=1.0, " /> -->
     <link rel="icon" href="<%= BASE_URL %>favicon.ico">
     <title><%= htmlWebpackPlugin.options.title %></title>
   </head>

+ 26 - 8
src/api/index.js

@@ -1,16 +1,34 @@
 import ajax from './ajax';
-let openId = 'oeYBv5YNe7H98VMH3kp4qNofgrF4';
+import openId from "../util/getOpenId";
+let openid = 'oeYBv5YNe7H98VMH3kp4qNofgrF4';
+openId.getOpenId(() => {
+    openid = window.localStorage.getItem("openId");
+});
 // 获取表单项
-export const getForm = params => ajax(`/wx/member/${openId}/options`, params, 'GET');
+export const getForm = params => ajax(`/wx/member/${openid}/options`, params, 'GET');
 // 获取首页活动列表
-export const getActives = params => ajax(`/wx/member/${openId}/actives`, params, 'GET');
+export const getActives = params => ajax(`/wx/member/${openid}/actives`, params, 'GET');
 // 我的 获取心动次数显示
-export const getHeartTimes = params => ajax(`/wx/actives/${openId}/0/myHearts`, params, 'GET');
+export const getHeartTimes = params => ajax(`/wx/actives/${openid}/0/myHearts`, params, 'GET');
 // 我的 获取被心动次数显示
-export const getHeartedTimes = params => ajax(`/wx/actives/${openId}/0/myHearted`, params, 'GET');
+export const getHeartedTimes = params => ajax(`/wx/actives/${openid}/0/myHearted`, params, 'GET');
 //获取我的活动
-export const getMyActives = params => ajax(`/wx/member/${openId}/myActive`, params, 'GET');
+export const getMyActives = params => ajax(`/wx/member/${openid}/myActive`, params, 'GET');
 // 判断个人信息是否填写
-export const getPersonInfo = params => ajax(`/wx/member/${openId}/info`, params, 'GET');
+export const getPersonInfo = params => ajax(`/wx/member/${openid}/info`, params, 'GET');
+// 个人信息提交
+export const postPersonInfo = params => ajax(`/wx/member/${openid}/info`, params, 'POST');
 // 获取活动详情
-export const getActiveDetails = (params, id) => ajax(`/wx/actives/${openId}/${id}/detail`, params, 'GET');
+export const getActiveDetails = (params, id) => ajax(`/wx/actives/${openid}/${id}/detail`, params, 'GET');
+// 报名活动
+export const baoming = (params, id) => ajax(`/wx/actives/${openid}/${id}/enter`, params, 'GET');
+// 获取本场活动人员列表
+export const getMember = (params, id) => ajax(`/wx/actives/${openid}/${id}/members`, params, 'GET');
+// 获取本场活动心动上限
+export const getMostTimes = (params, id) => ajax(`/wx/actives/${openid}/${id}/detail`, params, 'GET');
+// 获取我目前的心动次数
+export const getMyTimes = (params, id) => ajax(`/wx/actives/${openid}/${id}/myHearts`, params, 'GET');
+// 心动heartbeat
+export const heartbeat = (params, id) => ajax(`/wx/actives/${openid}/${id}/heartbeat`, params, 'GET');
+//取消心动unfollow
+export const unfollow = (params, id) => ajax(`/wx/actives/${openid}/${id}/unfollow`, params, 'GET');

+ 36 - 19
src/pages/activeDetails.vue

@@ -3,14 +3,14 @@
     <div style="background: #fff">
       <img
         src="../assets/activeimg.png"
-        style="width: 94%; height: 180px; margin-left: 3%"
+        style="width: 94%; height: 180px; margin-left: 3%; margin-top: 10px"
       />
       <div class="line">
         <van-icon
           name="like-o"
           size="20px"
           color="#906cff"
-          style="margin-left: 17px; margin-bottom: 17px"
+          style="margin-left: 17px; margin-top: 15px"
         />
         <p style="margin-left: 17px">已报名{{ actualCount }}/{{ planCount }}</p>
       </div>
@@ -20,7 +20,7 @@
           name="clock-o"
           size="20px"
           color="#906cff"
-          style="margin-left: 17px; margin-bottom: 17px"
+          style="margin-left: 17px; margin-top: 15px"
         />
         <p style="margin-left: 17px">活动时间:{{ activeStart }}</p>
       </div>
@@ -29,7 +29,7 @@
           name="location-o"
           size="20px"
           color="#906cff"
-          style="margin-left: 17px; margin-bottom: 17px"
+          style="margin-left: 17px; margin-top: 15px"
         />
         <p style="margin-left: 17px">地址:{{ address }}</p>
       </div>
@@ -53,45 +53,62 @@
       <img
         src="../assets/remarked.png"
         class="remarkImg"
-        v-if="isInit && activeOpenid != 'null'"
+        v-if="isInit && activeOpenid != null"
       />
-      <div
-        class="btn_area"
-        v-if="isInit && (!activeOpenid || activeOpenid == 'null')"
-      >
-        <div class="btn" bindtap="isOk">报名</div>
+      <div class="btn_area" v-if="isInit && !activeOpenid">
+        <div class="btn" @click="isOk">报名</div>
       </div>
     </div>
   </div>
 </template>
 <script>
-import { getActiveDetails } from "../api";
+import { getActiveDetails, baoming } from "../api";
 export default {
   data() {
     return {
       isInit: false,
+      actualCount: "",
+      planCount: "",
+      activeStart: "",
+      address: "",
+      remark: "",
+      activeOpenid: "",
+      id: "", //活动id
     };
   },
   computed: {},
   watch: {},
   methods: {
-    async getDetails() {
-      const result = await getActiveDetails();
+    async getDetails(id) {
+      const result = await getActiveDetails({}, id);
+      (this.actualCount = result.activeRoll.actualCount),
+        (this.planCount = result.activeRoll.planCount),
+        (this.activeStart = result.activeRoll.activeStart),
+        (this.address = result.activeRoll.address),
+        (this.remark = result.activeRoll.remark),
+        (this.id = result.activeRoll.id),
+        (this.isInit = true);
+    },
+    async isOk() {
+      const result = await baoming({}, this.id);
+      if (result.code == 0) {
+        this.$router.push({ name: "registrationSuccess" });
+      }
       console.log(result);
     },
   },
   created() {},
   mounted() {
-      this.getDetails();
+    console.log(this.$route.params.openId);
+    this.activeOpenid = this.$route.params.openId;
+    this.getDetails(this.$route.params.id);
   },
 };
 </script>
-<style>
-/* pages/activeDetail/activeDetail.wxss */
+<style scoped>
 .line {
   display: flex;
   color: #999999;
-  margin-top: 15px;
 }
 
 .title {
@@ -104,7 +121,7 @@ export default {
   width: 100%;
   height: 75px;
   /* border: 1px solid red; */
-  box-shadow: 0px 0px 5px rgba(0, 0, 0, .2);
+  box-shadow: 0px 0px 5px rgba(0, 0, 0, 0.2);
   position: fixed;
   bottom: 0;
   left: 0;
@@ -124,7 +141,7 @@ export default {
   top: 17px;
   left: 17px;
 }
-.remarkImg{
+.remarkImg {
   width: 122px;
   height: 122px;
   position: fixed;

+ 0 - 408
src/pages/details.vue

@@ -1,408 +0,0 @@
-<template>
-  <div class="main">
-    <el-form
-      label-position="left"
-      :model="ruleForm"
-      :rules="rules"
-      ref="ruleForm"
-      label-width="250px"
-    >
-      <el-form-item label="咋联系你呢" prop="phone">
-        <el-input v-model="ruleForm.phone" placeholder="请输入"></el-input>
-      </el-form-item>
-      <el-form-item label="你得有一米八吧" prop="height" label-width="240px">
-        <el-select v-model="ruleForm.height" placeholder="未选择">
-          <el-option
-            v-for="(item, i) in height"
-            :key="i"
-            :label="item.dictLabel"
-            :value="item.dictValue"
-          ></el-option>
-        </el-select>
-      </el-form-item>
-      <el-form-item label="你咋那么瘦呢" prop="weight">
-        <el-select v-model="ruleForm.weight" placeholder="未选择">
-          <el-option
-            v-for="(item, i) in weight"
-            :key="i"
-            :label="item.dictLabel"
-            :value="item.dictValue"
-          ></el-option>
-        </el-select>
-      </el-form-item>
-      <el-form-item label="当初没选清华北大是你不想吗" prop="education">
-        <el-select v-model="ruleForm.education" placeholder="未选择">
-          <el-option
-            v-for="(item, i) in education"
-            :key="i"
-            :label="item.dictLabel"
-            :value="item.dictValue"
-          ></el-option>
-        </el-select>
-      </el-form-item>
-      <el-form-item label="一月能挣多少米" prop="income">
-        <el-select v-model="ruleForm.income" placeholder="未选择">
-          <el-option
-            v-for="(item, i) in income"
-            :key="i"
-            :label="item.dictLabel"
-            :value="item.dictValue"
-          ></el-option>
-        </el-select>
-      </el-form-item>
-      <el-form-item label="关于小红本本" prop="marriage">
-        <el-select v-model="ruleForm.marriage" placeholder="未选择">
-          <el-option
-            v-for="(item, i) in marriage"
-            :key="i"
-            :label="item.dictLabel"
-            :value="item.dictValue"
-          ></el-option>
-        </el-select>
-      </el-form-item>
-      <el-form-item label="亲生的小祖宗" prop="children">
-        <el-select v-model="ruleForm.children" placeholder="未选择">
-          <el-option
-            v-for="(item, i) in children"
-            :key="i"
-            :label="item.dictLabel"
-            :value="item.dictValue"
-          ></el-option>
-        </el-select>
-      </el-form-item>
-      <el-form-item label="这些年没少攒吧(房)" prop="assetHouse">
-        <el-select v-model="ruleForm.assetHouse" placeholder="未选择" @change="assetHouseChange">
-          <el-option
-            v-for="(item, i) in assetHouse"
-            :key="i"
-            :label="item.dictLabel"
-            :value="item.dictValue"
-          ></el-option>
-        </el-select>
-      </el-form-item>
-      <el-form-item v-if="assetHouse.dictValue=='2' || assetHouseShow" label="房屋面积" prop="assetHouseArea">
-        <el-select v-model="ruleForm.assetHouseArea" placeholder="未选择">
-          <el-option
-            v-for="(item, i) in assetHouseArea"
-            :key="i"
-            :label="item.dictLabel"
-            :value="item.dictValue"
-          ></el-option>
-        </el-select>
-      </el-form-item>
-      <el-form-item v-if="assetHouse.dictValue=='2' || assetHouseShow" label="有无房贷" prop="assetHouseLoan">
-        <el-select v-model="ruleForm.assetHouseLoan" placeholder="未选择">
-          <el-option
-            v-for="(item, i) in assetHouseLoan"
-            :key="i"
-            :label="item.dictLabel"
-            :value="item.dictValue"
-          ></el-option>
-        </el-select>
-      </el-form-item>
-      <el-form-item label="这些年没少攒吧(车)" prop="assetCar">
-        <el-select v-model="ruleForm.assetCar" placeholder="未选择" @change="assetCarChange">
-          <el-option
-            v-for="(item, i) in assetCar"
-            :key="i"
-            :label="item.dictLabel"
-            :value="item.dictValue"
-          ></el-option>
-        </el-select>
-      </el-form-item>
-      <el-form-item v-if="assetCar.dictValue=='2' || assetCarShow" label="车辆价值" prop="assetCarValue">
-        <el-select v-model="ruleForm.assetCarValue" placeholder="未选择">
-          <el-option
-            v-for="(item, i) in assetCarValue"
-            :key="i"
-            :label="item.dictLabel"
-            :value="item.dictValue"
-          ></el-option>
-        </el-select>
-      </el-form-item>
-      <el-form-item v-if="assetCar.dictValue=='2' || assetCarShow" label="车贷情况" prop="assetCarLoan">
-        <el-select v-model="ruleForm.assetCarLoan" placeholder="未选择">
-          <el-option
-            v-for="(item, i) in assetCarLoan"
-            :key="i"
-            :label="item.dictLabel"
-            :value="item.dictValue"
-          ></el-option>
-        </el-select>
-      </el-form-item>
-
-      <el-form-item
-        label="啥时候方便我给你介绍个对象(多选)"
-        prop="controlTime"
-        class="controlTime"
-      >
-        <el-checkbox-group v-model="ruleForm.controlTime">
-          <el-checkbox
-            v-for="(item, i) in controlTime"
-            :key="i"
-            :label="item"
-          ></el-checkbox>
-        </el-checkbox-group>
-      </el-form-item>
-      <el-form-item
-        label="卖命主旋律(多选)"
-        prop="workStatus"
-        class="workStatus"
-      >
-        <el-checkbox-group v-model="ruleForm.workStatus">
-          <el-checkbox
-            v-for="(item, i) in workStatus"
-            :key="i"
-            :label="item"
-          ></el-checkbox>
-        </el-checkbox-group>
-      </el-form-item>
-
-      <el-form-item>
-        <el-button type="primary" @click="submitForm('ruleForm')"
-          >立即创建</el-button
-        >
-      </el-form-item>
-    </el-form>
-  </div>
-</template>
-
-<script>
-// import tabbaar from '../components/tabbar'
-import { getForm ,getPersonInfo} from "../api";
-export default {
-  name: "Home",
-  components: {},
-  data() {
-    return {
-      assetHouseShow:false,
-      assetCarShow:false,
-      phone: [], //手机号
-      height: [], //身高
-      weight: [], //体重
-      education: [], //学历
-      income: [], //收入
-      marriage: [], //婚姻状况
-      children: [], //子女
-      assetHouse: [], //房
-      assetHouseArea: [], //房屋面积
-      assetHouseLoan: [], //贷款
-      assetCar: [], //车
-      assetCarValue: [], //车多钱
-      assetCarLoan: [], //车贷款
-      isCommon: [], //跟父母一起住
-      controlTime: ["43355654", "15gf11", "1df11"], //空闲时间
-      workStatus: ["0000", "1111", "保护壳"], //工作状态
-      companyNature: [], //公司性质
-      company: [], //公司名
-      parents: [], //父母状态
-      fatherWork: [], //
-      matherWork: [],
-      parentAssets: [], //父母资产
-      composition: [], //兄弟姐妹
-      motionState: [], //星座
-      hobby: [], //爱好
-      ruleForm: {
-        phone: "", //手机号
-        height: "", //身高
-        weight: "", //体重
-        education: "", //学历
-        income: "", //收入
-        marriage: "", //婚姻状况
-        children: "", //子女
-        assetHouse: "", //房
-        assetHouseArea: "", //房屋面积
-        assetHouseLoan: "", //贷款
-        assetCar: "", //车
-        assetCarValue: "", //车多钱
-        assetCarLoan: "", //车贷款
-        isCommon: "", //跟父母一起住
-        controlTime: [], //空闲时间
-        workStatus: [], //工作状态
-        companyNature: "", //公司性质
-        company: "", //公司名
-        parents: "", //父母状态
-        fatherWork: "", //
-        matherWork: "",
-        parentAssets: "", //父母资产
-        composition: "", //兄弟姐妹
-        motionState: "", //星座
-        hobby: "", //爱好
-      },
-      rules: {
-        phone: [{ required: true, message: "请输入手机号", trigger: "blur" }],
-        height: [{ required: true, message: "请选择", trigger: "change" }],
-        weight: [{ required: true, message: "请选择", trigger: "change" }],
-        education: [
-          { required: true, message: "请选择", trigger: "change" },
-        ],
-        income: [{ required: true, message: "请选择", trigger: "change" }],
-        marriage: [
-          { required: true, message: "请选择", trigger: "change" },
-        ],
-        children: [{ required: true, message: "请选择", trigger: "change" }],
-        assetHouse: [{ required: true, message: "请选择", trigger: "change" }],
-        assetHouseArea: [
-          { required: true, message: "请选择", trigger: "change" },
-        ],
-        assetHouseLoan: [
-          { required: true, message: "请选择", trigger: "change" },
-        ],
-        assetCar: [{ required: true, message: "请选择", trigger: "change" }],
-        assetCarValue: [
-          { required: true, message: "请选择", trigger: "change" },
-        ],
-        assetCarLoan: [
-          { required: true, message: "请选择", trigger: "change" },
-        ],
-        controlTime: [
-          {
-            type: "array",
-            required: true,
-            message: "请至少选择一个活动性质",
-            trigger: "change",
-          },
-        ],
-        workStatus: [
-          {
-            type: "array",
-            required: true,
-            message: "请至少选择一个活动性质",
-            trigger: "change",
-          },
-        ],
-        
-      },
-    };
-  },
-  methods: {
-    async getHeight() {
-      const result = await getForm({ type: "he_body_height" });
-      if (result.code == 0) {
-        this.height = result.options
-      }
-    },
-    async getWeight() {
-      const result = await getForm({ type: "he_body_weight" });
-      if (result.code == 0) {
-        this.weight = result.options
-      }
-    },
-    async getEducation() {
-      const result = await getForm({ type: "he_education" });
-      if (result.code == 0) {
-        this.education = result.options
-      }
-    },
-    async getIncome() {
-      const result = await getForm({ type: "he_income" });
-      if (result.code == 0) {
-        this.income = result.options
-      }
-    },
-    async getMarriage() {
-      const result = await getForm({ type: "he_marriage" });
-      if (result.code == 0) {
-        this.marriage = result.options
-      }
-    },
-    async getChildren() {
-      const result = await getForm({ type: "he_children" });
-      if (result.code == 0) {
-        this.children = result.options
-      }
-    },
-    async getAssetHouse() {
-      const result = await getForm({ type: "he_asset_house" });
-      if (result.code == 0) {
-        console.log(result);
-        this.assetHouse = result.options
-      }
-    },
-    async getAssetHouseArea() {
-      const result = await getForm({ type: "he_asset_house_area" });
-      if (result.code == 0) {
-        console.log(result);
-        this.assetHouseArea = result.options
-      }
-    },
-    async getAssetCar() {
-      const result = await getForm({ type: "he_asset_car" });
-      if (result.code == 0) {
-        console.log(result);
-        this.assetCar = result.options
-      }
-    },
-    
-    async getPersonInfo(){
-      const result = await getPersonInfo();
-      console.log(result.info,'222')
-      if (result.info.height) {
-        this.ruleForm=result.info
-      }
-    },
-    //监测房产
-    assetHouseChange(val){
-      if (val==2) {
-        this.assetHouseShow = true
-      }else{
-        this.assetHouseShow = false
-        }
-    },
-    //监测车产
-    assetCarChange(val){
-      if (val==2) {
-        this.assetCarShow = true
-      }else{
-        this.assetCarShow = false
-      }
-    },
-    submitForm(formName) {
-      this.$refs[formName].validate((valid) => {
-        if (valid) {
-          alert('submit!');
-        } else {
-          console.log('error submit!!');
-          return false;
-        }
-      });
-    },
-  },
-  mounted() {
-    this.getHeight();
-    this.getWeight();
-    this.getEducation();
-    this.getIncome();
-    this.getMarriage();
-    this.getChildren();
-    this.getAssetHouse();
-    this.getAssetHouseArea();
-    this.getAssetCar();
-    this.getPersonInfo();
-  },
-};
-</script>
-<style scoped>
-.main {
-  width: 90%;
-  margin: auto 5%;
-}
-/deep/.controlTime .el-form-item__label {
-  width: 100% !important;
-}
-/deep/.controlTime .el-form-item__content {
-  margin-left: 0 !important;
-}
-/deep/.workStatus .el-form-item__label {
-  width: 100% !important;
-}
-/deep/.workStatus .el-form-item__content {
-  margin-left: 0 !important;
-}
-/deep/.el-input__inner {
-  border: 0 !important;
-}
-/deep/.el-form-item__error {
-  margin-left: -250px;
-}
-</style>

+ 15 - 1
src/pages/index.vue

@@ -68,7 +68,13 @@
       近期还没有活动呦
     </div>
     <div style="margin-bottom: 70px">
-      <div v-for="item in activesArr" :key="item.name" class="box">
+      <div
+        v-for="item in activesArr"
+        :key="item.name"
+        class="box"
+        @click="goActive(item.id, item.openId)"
+        style="position: relative"
+      >
         <div class="top">
           <img
             src="../assets/activephoto.png"
@@ -98,12 +104,14 @@
 </template>
 <script>
 import { getActives } from "../api";
+import openId from "../util/getOpenId";
 export default {
   name: "index",
   data() {
     return {
       showNull: false,
       activesArr: [],
+      openid:""
     };
   },
   methods: {
@@ -128,10 +136,16 @@ export default {
       window.location.href =
         "https://hzkhcs.qiyukf.com/client?k=de9c471949df00adb71be66e0ac85978&wp=1&robotShuntSwitch=1&robotId=5217545&qtype=4486102";
     },
+    goActive(id, openId) {
+      this.$router.push({ name: "activeDetails", params: { openId, id } });
+    },
   },
   computed: {},
   mounted() {
     this.getActives();
+    openId.getOpenId(() => {
+      this.openid = window.localStorage.getItem("openId");
+    });
   },
 };
 </script>

+ 696 - 0
src/pages/infoDetails.vue

@@ -0,0 +1,696 @@
+<template>
+  <div class="main">
+    <el-form
+      label-position="left"
+      :model="ruleForm"
+      :rules="rules"
+      ref="ruleForm"
+      label-width="210px"
+    >
+      <el-form-item label="咋联系你呢" prop="phone" class="error_info">
+        <el-input v-model="ruleForm.phone" placeholder="请输入"></el-input>
+      </el-form-item>
+      <el-form-item label="你得有一米八吧" prop="height" class="error_info">
+        <el-select v-model="ruleForm.height" placeholder="未选择">
+          <el-option
+            v-for="(item, i) in height"
+            :key="i"
+            :label="item.dictLabel"
+            :value="item.dictValue"
+          ></el-option>
+        </el-select>
+      </el-form-item>
+      <el-form-item label="你咋那么瘦呢" prop="weight" class="error_info">
+        <el-select v-model="ruleForm.weight" placeholder="未选择">
+          <el-option
+            v-for="(item, i) in weight"
+            :key="i"
+            :label="item.dictLabel"
+            :value="item.dictValue"
+          ></el-option>
+        </el-select>
+      </el-form-item>
+      <el-form-item
+        label="当初没选清华北大是你不想吗"
+        prop="education"
+        label-width="210px"
+        class="education_error"
+      >
+        <el-select v-model="ruleForm.education" placeholder="未选择">
+          <el-option
+            v-for="(item, i) in education"
+            :key="i"
+            :label="item.dictLabel"
+            :value="item.dictValue"
+          ></el-option>
+        </el-select>
+      </el-form-item>
+      <el-form-item label="一月能挣多少米" prop="income" class="error_info">
+        <el-select v-model="ruleForm.income" placeholder="未选择">
+          <el-option
+            v-for="(item, i) in income"
+            :key="i"
+            :label="item.dictLabel"
+            :value="item.dictValue"
+          ></el-option>
+        </el-select>
+      </el-form-item>
+      <el-form-item label="关于小红本本" prop="marriage" class="error_info">
+        <el-select v-model="ruleForm.marriage" placeholder="未选择">
+          <el-option
+            v-for="(item, i) in marriage"
+            :key="i"
+            :label="item.dictLabel"
+            :value="item.dictValue"
+          ></el-option>
+        </el-select>
+      </el-form-item>
+      <el-form-item label="亲生的小祖宗" prop="children" class="error_info">
+        <el-select v-model="ruleForm.children" placeholder="未选择">
+          <el-option
+            v-for="(item, i) in children"
+            :key="i"
+            :label="item.dictLabel"
+            :value="item.dictValue"
+          ></el-option>
+        </el-select>
+      </el-form-item>
+      <el-form-item
+        label="这些年没少攒吧(房)"
+        prop="assetHouse"
+        class="error_info"
+      >
+        <el-select
+          v-model="ruleForm.assetHouse"
+          placeholder="未选择"
+          @change="assetHouseChange"
+        >
+          <el-option
+            v-for="(item, i) in assetHouse"
+            :key="i"
+            :label="item.dictLabel"
+            :value="item.dictValue"
+          ></el-option>
+        </el-select>
+      </el-form-item>
+      <el-form-item
+        v-if="assetHouse.dictValue == '2' || assetHouseShow"
+        label="房屋面积"
+        prop="assetHouseArea"
+        class="error_info"
+      >
+        <el-select v-model="ruleForm.assetHouseArea" placeholder="未选择">
+          <el-option
+            v-for="(item, i) in assetHouseArea"
+            :key="i"
+            :label="item.dictLabel"
+            :value="item.dictValue"
+          ></el-option>
+        </el-select>
+      </el-form-item>
+      <el-form-item
+        v-if="assetHouse.dictValue == '2' || assetHouseShow"
+        label="有无房贷"
+        prop="assetHouseLoan"
+        class="error_info"
+      >
+        <el-select v-model="ruleForm.assetHouseLoan" placeholder="未选择">
+          <el-option
+            v-for="(item, i) in assetHouseLoan"
+            :key="i"
+            :label="item.dictLabel"
+            :value="item.dictValue"
+          ></el-option>
+        </el-select>
+      </el-form-item>
+      <el-form-item
+        label="这些年没少攒吧(车)"
+        prop="assetCar"
+        class="error_info"
+      >
+        <el-select
+          v-model="ruleForm.assetCar"
+          placeholder="未选择"
+          @change="assetCarChange"
+        >
+          <el-option
+            v-for="(item, i) in assetCar"
+            :key="i"
+            :label="item.dictLabel"
+            :value="item.dictValue"
+          ></el-option>
+        </el-select>
+      </el-form-item>
+      <el-form-item
+        v-if="assetCar.dictValue == '2' || assetCarShow"
+        label="车辆价值"
+        prop="assetCarValue"
+        class="error_info"
+      >
+        <el-select v-model="ruleForm.assetCarValue" placeholder="未选择">
+          <el-option
+            v-for="(item, i) in assetCarValue"
+            :key="i"
+            :label="item.dictLabel"
+            :value="item.dictValue"
+          ></el-option>
+        </el-select>
+      </el-form-item>
+      <el-form-item
+        v-if="assetCar.dictValue == '2' || assetCarShow"
+        label="车贷情况"
+        prop="assetCarLoan"
+        class="error_info"
+      >
+        <el-select v-model="ruleForm.assetCarLoan" placeholder="未选择">
+          <el-option
+            v-for="(item, i) in assetCarLoan"
+            :key="i"
+            :label="item.dictLabel"
+            :value="item.dictValue"
+          ></el-option>
+        </el-select>
+      </el-form-item>
+
+      <el-form-item
+        label="啥时候方便我给你介绍个对象(多选)"
+        prop="controlTime"
+        class="checkbox"
+      >
+        <el-checkbox-group v-model="ruleForm.controlTime">
+          <el-checkbox
+            v-for="item in controlTime"
+            :key="item.dictValue"
+            :label="item.dictValue"
+            >{{ item.dictLabel }}</el-checkbox
+          >
+        </el-checkbox-group>
+      </el-form-item>
+      <el-form-item label="卖命主旋律(多选)" prop="workStatus" class="checkbox">
+        <el-checkbox-group v-model="ruleForm.workStatus">
+          <el-checkbox
+            v-for="item in workStatus"
+            :key="item.dictValue"
+            :label="item.dictValue"
+            >{{ item.dictLabel }}</el-checkbox
+          >
+        </el-checkbox-group>
+      </el-form-item>
+      <el-form-item label="卖命主阵地" prop="companyNature" class="error_info">
+        <el-select v-model="ruleForm.companyNature" placeholder="未选择">
+          <el-option
+            v-for="(item, i) in companyNature"
+            :key="i"
+            :label="item.dictLabel"
+            :value="item.dictValue"
+          ></el-option>
+        </el-select>
+      </el-form-item>
+      <el-form-item label="具体卖命单位" prop="company" class="error_info">
+        <el-input v-model="ruleForm.company" placeholder="请输入"></el-input>
+      </el-form-item>
+      <el-form-item label="爹妈情况" prop="parents" class="error_info">
+        <el-select v-model="ruleForm.parents" placeholder="未选择">
+          <el-option
+            v-for="(item, i) in parents"
+            :key="i"
+            :label="item.dictLabel"
+            :value="item.dictValue"
+          ></el-option>
+        </el-select>
+      </el-form-item>
+      <el-form-item label="和父母一起住没" prop="isCommon" class="error_info">
+        <el-select v-model="ruleForm.isCommon" placeholder="未选择">
+          <el-option
+            v-for="(item, i) in isCommon"
+            :key="i"
+            :label="item.dictLabel"
+            :value="item.dictValue"
+          ></el-option>
+        </el-select>
+      </el-form-item>
+      <el-form-item label="爸比在哪高就" prop="fatherWork" class="error_info">
+        <el-select v-model="ruleForm.fatherWork" placeholder="未选择">
+          <el-option
+            v-for="(item, i) in fatherWork"
+            :key="i"
+            :label="item.dictLabel"
+            :value="item.dictValue"
+          ></el-option>
+        </el-select>
+      </el-form-item>
+      <el-form-item label="那么妈咪呢" prop="matherWork" class="error_info">
+        <el-select v-model="ruleForm.matherWork" placeholder="未选择">
+          <el-option
+            v-for="(item, i) in matherWork"
+            :key="i"
+            :label="item.dictLabel"
+            :value="item.dictValue"
+          ></el-option>
+        </el-select>
+      </el-form-item>
+      <el-form-item label="爹妈有工资没" prop="parentAssets" class="error_info">
+        <el-select v-model="ruleForm.parentAssets" placeholder="未选择">
+          <el-option
+            v-for="(item, i) in parentAssets"
+            :key="i"
+            :label="item.dictLabel"
+            :value="item.dictValue"
+          ></el-option>
+        </el-select>
+      </el-form-item>
+      <el-form-item
+        label="家里有跟你争宠的没(多选)"
+        prop="composition"
+        class="checkbox"
+      >
+        <el-checkbox-group v-model="ruleForm.composition">
+          <el-checkbox
+            v-for="item in composition"
+            :key="item.dictValue"
+            :label="item.dictValue"
+            >{{ item.dictLabel }}</el-checkbox
+          >
+        </el-checkbox-group>
+      </el-form-item>
+      <el-form-item label="你这身材可以呀" prop="sports" class="error_info">
+        <el-select v-model="ruleForm.sports" placeholder="未选择">
+          <el-option
+            v-for="(item, i) in sports"
+            :key="i"
+            :label="item.dictLabel"
+            :value="item.dictValue"
+          ></el-option>
+        </el-select>
+      </el-form-item>
+      <el-form-item label="喜欢铜鼓点啥(多选)" prop="hobby" class="checkbox">
+        <el-checkbox-group v-model="ruleForm.hobby">
+          <el-checkbox
+            v-for="item in hobby"
+            :key="item.dictValue"
+            :label="item.dictValue"
+            >{{ item.dictLabel }}</el-checkbox
+          >
+        </el-checkbox-group>
+      </el-form-item>
+      <!-- <el-form-item> -->
+      <el-button
+        class="confirm_button"
+        type="primary"
+        @click="submitForm('ruleForm')"
+        >确认</el-button
+      >
+      <!-- </el-form-item> -->
+    </el-form>
+  </div>
+</template>
+
+<script>
+// import tabbaar from '../components/tabbar'
+import { getForm, getPersonInfo, postPersonInfo } from "../api";
+export default {
+  name: "Home",
+  components: {},
+  data() {
+    return {
+      assetHouseShow: false,
+      assetCarShow: false,
+      phone: [], //手机号
+      height: [], //身高
+      weight: [], //体重
+      education: [], //学历
+      income: [], //收入
+      marriage: [], //婚姻状况
+      children: [], //子女
+      assetHouse: [], //房
+      assetHouseArea: [], //房屋面积
+      assetHouseLoan: [], //贷款
+      assetCar: [], //车
+      assetCarValue: [], //车多钱
+      assetCarLoan: [], //车贷款
+      isCommon: [
+        { dictLabel: "没有", dictValue: "0" },
+        { dictLabel: "一起", dictValue: "1" },
+      ], //跟父母一起住
+      controlTime: [], //空闲时间
+      workStatus: [], //工作状态
+      companyNature: [], //公司性质
+      company: [], //公司名
+      parents: [], //父母状态
+      fatherWork: [], //
+      matherWork: [],
+      parentAssets: [], //父母资产
+      composition: [], //兄弟姐妹
+      motionState: [], //星座
+      sports: "", //运动情况
+      hobby: [], //爱好
+      ruleForm: {
+        phone: "", //手机号
+        height: "", //身高
+        weight: "", //体重
+        education: "", //学历
+        income: "", //收入
+        marriage: "", //婚姻状况
+        children: "", //子女
+        assetHouse: "", //房
+        assetHouseArea: "", //房屋面积
+        assetHouseLoan: "", //贷款
+        assetCar: "", //车
+        assetCarValue: "", //车多钱
+        assetCarLoan: "", //车贷款
+        isCommon: [], //跟父母一起住
+        controlTime: [], //空闲时间
+        workStatus: [], //工作状态
+        companyNature: "", //公司性质
+        company: "", //公司名
+        parents: "", //父母状态
+        fatherWork: "", //
+        matherWork: "",
+        parentAssets: "", //父母资产
+        composition: [], //兄弟姐妹
+        sports: "", //运动情况
+        motionState: "", //星座
+        hobby: [], //爱好
+      },
+      rules: {
+        phone: [{ required: true, message: "请输入", trigger: "blur" }],
+        height: [{ required: true, message: "请选择", trigger: "change" }],
+        weight: [{ required: true, message: "请选择", trigger: "change" }],
+        education: [{ required: true, message: "请选择", trigger: "change" }],
+        income: [{ required: true, message: "请选择", trigger: "change" }],
+        marriage: [{ required: true, message: "请选择", trigger: "change" }],
+        children: [{ required: true, message: "请选择", trigger: "change" }],
+        assetHouse: [{ required: true, message: "请选择", trigger: "change" }],
+        assetHouseArea: [
+          { required: true, message: "请选择", trigger: "change" },
+        ],
+        assetHouseLoan: [
+          { required: true, message: "请选择", trigger: "change" },
+        ],
+        assetCar: [{ required: true, message: "请选择", trigger: "change" }],
+        assetCarValue: [
+          { required: true, message: "请选择", trigger: "change" },
+        ],
+        assetCarLoan: [
+          { required: true, message: "请选择", trigger: "change" },
+        ],
+        controlTime: [
+          {
+            type: "array",
+            required: true,
+            message: "请至少选择一个",
+            trigger: "change",
+          },
+        ],
+        workStatus: [
+          {
+            type: "array",
+            required: true,
+            message: "请至少选择一个",
+            trigger: "change",
+          },
+        ],
+        companyNature: [
+          { required: true, message: "请选择", trigger: "change" },
+        ],
+        company: [{ required: true, message: "请输入", trigger: "blur" }],
+        parents: [{ required: true, message: "请选择", trigger: "change" }],
+        isCommon: [{ required: true, message: "请选择", trigger: "change" }],
+        fatherWork: [{ required: true, message: "请选择", trigger: "change" }],
+        matherWork: [{ required: true, message: "请选择", trigger: "change" }],
+        parentAssets: [
+          { required: true, message: "请选择", trigger: "change" },
+        ],
+        composition: [
+          {
+            type: "array",
+            required: true,
+            message: "请至少选择一个",
+            trigger: "change",
+          },
+        ],
+        sports: [{ required: true, message: "请选择", trigger: "change" }],
+        hobby: [
+          {
+            type: "array",
+            required: true,
+            message: "请至少选择一个",
+            trigger: "change",
+          },
+        ],
+      },
+    };
+  },
+  methods: {
+    //获取是否填写过
+    async getPersonInfo() {
+      const result = await getPersonInfo();
+      console.log(result.info, "222");
+      if (result.info.height) {
+        this.ruleForm = result.info;
+        this.ruleForm.hobby = result.info.hobby.split(",");
+        this.ruleForm.controlTime = result.info.controlTime.split(",");
+        this.ruleForm.workStatus = result.info.workStatus.split(",");
+        this.ruleForm.composition = result.info.composition.split(",");
+      }
+    },
+    async getHeight() {
+      const result = await getForm({ type: "he_body_height" });
+      if (result.code == 0) {
+        this.height = result.options;
+      }
+    },
+    async getWeight() {
+      const result = await getForm({ type: "he_body_weight" });
+      if (result.code == 0) {
+        this.weight = result.options;
+      }
+    },
+    async getEducation() {
+      const result = await getForm({ type: "he_education" });
+      if (result.code == 0) {
+        this.education = result.options;
+      }
+    },
+    async getIncome() {
+      const result = await getForm({ type: "he_income" });
+      if (result.code == 0) {
+        this.income = result.options;
+      }
+    },
+    async getMarriage() {
+      const result = await getForm({ type: "he_marriage" });
+      if (result.code == 0) {
+        this.marriage = result.options;
+      }
+    },
+    async getChildren() {
+      const result = await getForm({ type: "he_children" });
+      if (result.code == 0) {
+        this.children = result.options;
+      }
+    },
+    async getAssetHouse() {
+      const result = await getForm({ type: "he_asset_house" });
+      if (result.code == 0) {
+        this.assetHouse = result.options;
+      }
+    },
+    async getAssetHouseArea() {
+      const result = await getForm({ type: "he_asset_house_area" });
+      if (result.code == 0) {
+        this.assetHouseArea = result.options;
+      }
+    },
+    async getAssetHouseLoan() {
+      const result = await getForm({ type: "he_asset_house_loan" });
+      if (result.code == 0) {
+        this.assetHouseLoan = result.options;
+      }
+    },
+    async getAssetCar() {
+      const result = await getForm({ type: "he_asset_car" });
+      if (result.code == 0) {
+        this.assetCar = result.options;
+      }
+    },
+    async getAssetCarValue() {
+      const result = await getForm({ type: "he_asset_car_value" });
+      if (result.code == 0) {
+        this.assetCarValue = result.options;
+      }
+    },
+    async getAssetCarLoan() {
+      const result = await getForm({ type: "he_asset_car_loan" });
+      if (result.code == 0) {
+        this.assetCarLoan = result.options;
+      }
+    },
+    async getControlTime() {
+      const result = await getForm({ type: "he_control_time" });
+      if (result.code == 0) {
+        this.controlTime = result.options;
+      }
+    },
+    async getWorkStatus() {
+      const result = await getForm({ type: "he_work_status" });
+      if (result.code == 0) {
+        this.workStatus = result.options;
+      }
+    },
+    async getCompanyNature() {
+      const result = await getForm({ type: "he_company_nature" });
+      if (result.code == 0) {
+        this.companyNature = result.options;
+        this.fatherWork = result.options;
+        this.matherWork = result.options;
+      }
+    },
+    async getParents() {
+      const result = await getForm({ type: "he_parents" });
+      if (result.code == 0) {
+        this.parents = result.options;
+      }
+    },
+    async getParentAssets() {
+      const result = await getForm({ type: "he_parent_assets" });
+      if (result.code == 0) {
+        this.parentAssets = result.options;
+      }
+    },
+    async getComposition() {
+      const result = await getForm({ type: "he_composition" });
+      if (result.code == 0) {
+        this.composition = result.options;
+      }
+    },
+    async getSports() {
+      const result = await getForm({ type: "he_sports" });
+      if (result.code == 0) {
+        this.sports = result.options;
+      }
+    },
+    async getHobby() {
+      const result = await getForm({ type: "he_hobby" });
+      if (result.code == 0) {
+        this.hobby = result.options;
+      }
+    },
+    //监测房产改变
+    assetHouseChange(val) {
+      if (val == 2) {
+        this.assetHouseShow = true;
+      } else {
+        this.assetHouseShow = false;
+      }
+    },
+    //监测车产改变
+    assetCarChange(val) {
+      if (val == 2) {
+        this.assetCarShow = true;
+      } else {
+        this.assetCarShow = false;
+      }
+    },
+    submitForm(formName) {
+      this.$refs[formName].validate(async (valid) => {
+        if (valid) {
+          console.log(this.ruleForm);
+          const submitList = this.ruleForm;
+          submitList.controlTime = submitList.controlTime.join(",");
+          submitList.workStatus = submitList.workStatus.join(",");
+          submitList.composition = submitList.composition.join(",");
+          submitList.hobby = submitList.hobby.join(",");
+          console.log(submitList, "submitList");
+          const res = await postPersonInfo(submitList);
+          console.log(res, "提交返回结果");
+          if (res.code == 0) {
+            this.$message.success("提交成功");
+          } else {
+            this.$message.error(res.msg);
+          }
+        } else {
+          console.log("error submit!!");
+          return false;
+        }
+      });
+    },
+  },
+  mounted() {
+    this.getHeight();
+    this.getWeight();
+    this.getEducation();
+    this.getIncome();
+    this.getMarriage();
+    this.getChildren();
+    this.getAssetHouse();
+    this.getAssetHouseArea();
+    this.getAssetHouseLoan();
+    this.getAssetCar();
+    this.getAssetCarValue();
+    this.getAssetCarLoan();
+    this.getControlTime();
+    this.getWorkStatus();
+    this.getCompanyNature();
+    this.getParents();
+    this.getParentAssets();
+    this.getComposition();
+    this.getSports();
+    this.getHobby();
+    this.getPersonInfo();
+  },
+};
+</script>
+<style scoped>
+.main {
+  width: 90%;
+  margin: auto 5%;
+  text-align: left;
+}
+/deep/.checkbox .el-form-item__label {
+  width: 100% !important;
+}
+/deep/.checkbox .el-form-item__content {
+  margin-left: 0 !important;
+}
+/deep/.el-input__inner {
+  border: 0 !important;
+  text-align: right;
+  padding-left: 0;
+}
+/deep/.error_info .el-form-item__error {
+  margin-left: -200px;
+}
+/deep/.education_error .el-form-item__error {
+  margin-left: -210px;
+}
+/deep/.el-checkbox__input {
+  display: none;
+}
+/deep/.el-checkbox__label {
+  border-radius: 15px;
+  border: 1px solid #dcdfe6;
+  padding: 5px 12px 4px;
+}
+/deep/.el-checkbox__input.is-checked + .el-checkbox__label {
+  background: linear-gradient(to right, #bc65ff, #8973ff);
+  color: #fff;
+  border: 1px solid #dcdfe6;
+  padding: 5px 12px 4px;
+}
+.confirm_button {
+  font-size: 18px;
+  background: linear-gradient(to right, #bc65ff, #8973ff);
+  color: #fff;
+  border: none;
+  padding: 15px 30px;
+  width: 80%;
+  margin: 10px 10% 40px;
+  border-radius: 25px;
+}
+/* @media (min-device-width :  375px) and (max-device-width : 667px) and (-webkit-min-device-pixel-ratio : 2){
+        
+.elForm .el-form-item__label{width: 190px;}
+        
+} */
+</style>

+ 16 - 3
src/pages/infoType.vue

@@ -1,21 +1,34 @@
 
 <template>
   <div class="container1">
-    <div class="a1" bindtap="goMyinfo">
+    <div class="a1" @click="goMyinfo()">
       <div class="left">我的个人信息</div>
       <van-icon name="arrow" class="right" />
     </div>
-    <div class="a1" bindtap="goMyinfoDetail">
+    <div class="a1" @clic="goMyinfoDetail()">
       <div class="left">我的个人详细信息</div>
       <van-icon name="arrow" class="right" />
     </div>
-    <div class="a1" bindtap="goMyTargetInfo">
+    <div class="a1" @clic="goMyTargetInfo()">
       <div class="left">我的择偶信息</div>
       <van-icon name="arrow" class="right" />
     </div>
   </div>
 </template>
 
+<script>
+export default {
+  data() {
+    return {};
+  },
+  methods: {
+    goMyinfoDetail() {
+      this.$router.push({ name: "infoDetails" });
+    }
+  },
+  computed() {},
+};
+</script>
 <style scoped>
 .container1 {
   background: #fafafa;

+ 222 - 0
src/pages/onSiteActivity.vue

@@ -0,0 +1,222 @@
+<template>
+  <div>
+    <div class="container">
+      <div class="title">本场编号为{{ myNum }}</div>
+      <div class="subtitle">
+        请给你喜欢的嘉宾点击心动,心动上限为{{ planHeart }}个
+      </div>
+      <div class="heartbox">
+        <div v-for="index of heartCount" :key="index" style="z-index: 10">
+          <img src="../assets/heart.png" style="width: 25px; height: 25px" />
+        </div>
+        <div
+          v-for="index of planHeart - heartCount"
+          :key="index"
+          style="z-index: 10"
+        >
+          <img src="../assets/gray.png" style="width: 17px; height: 17px" />
+        </div>
+        <div class="line"></div>
+      </div>
+      <div class="num">
+        <div class="allnum">嘉宾: {{ members.length }}名</div>
+        <div class="tousu" bindtap="goTousu">投诉反馈</div>
+      </div>
+    </div>
+    <div class="photobox">
+      <div
+        v-for="item in members"
+        :key="item.id"
+        @click="love(index, item.openId)"
+        style="text-align: center; width: 70px; position: relative"
+      >
+        <img
+          :src="item.memberAvatar"
+          style="
+            width: 55px;
+            height: 55px;
+            border-radius: 50%;
+            margin-top: 10px;
+          "
+        />
+        <div style="color: #4d4d4d; font-size: 14px; margin-top: 2px">
+          {{ item.activeNumber }}
+        </div>
+        <div style="color: #4d4d4d; font-size: 14px; padding-bottom: 17px">
+          {{ item.memberName }}
+        </div>
+        <div class="grayCircle"></div>
+        <img
+          src="../assets/love.png"
+          class="loveCircle"
+          v-if="item.hearted == 0"
+        />
+      </div>
+    </div>
+  </div>
+</template>
+<script>
+import {
+  getMember,
+  getMostTimes,
+  getMyTimes,
+  heartbeat,
+  unfollow,
+} from "../api";
+import {Message} from 'element-ui';
+export default {
+  name: "onSite",
+  data() {
+    return {
+      activeId:'',
+      members: [],
+      planHeart: "",
+      myNum: "",
+      openid: "oeYBv5YNe7H98VMH3kp4qNofgrF4",
+      heartCount: "",
+    };
+  },
+  methods: {
+    async getMember() {
+      const result = await getMember({},this.activeId);
+      console.log(result);
+      if (result.code == 0) {
+        for (let i = 0; i < result.members.length; i++) {
+          if (result.members[i].openId == this.openid) {
+            this.myNum = result.members[i].activeNumber;
+            result.members.splice(i, 1);
+          }
+        }
+        this.members = result.members;
+        console.log(this.members);
+      }
+    },
+    async getMostTimes() {
+      const result = await getMostTimes({}, this.activeId);
+      this.planHeart = result.activeRoll.planHeart;
+      console.log(this.planHeart, "我的的心动上限");
+    },
+    async getMyTimes() {
+      const result = await getMyTimes({}, this.activeId);
+      if (result.code == 0) {
+        this.heartCount = result.heartCount;
+      }
+      console.log(result, "我的的心动次数");
+    },
+    async love(index, HeOpenid) {
+      let status = this.members[index].hearted;
+      //   let status1 =;
+      if (status == 0) {
+        const result = await unfollow({ targetId: HeOpenid }, this.activeId);
+        console.log(result, "我取消心动了");
+        if (result.code == 0) {
+          this.members[index].hearted = false;
+        }
+      } else {
+        if (this.heartCount < this.planHeart) {
+          const result = await heartbeat({ targetId: HeOpenid }, this.activeId);
+          console.log(result, "我心动了");
+          if (result.code == 0) {
+            this.members[index].hearted = true;
+          }
+        } else {
+          Message({
+            message: "您已达到心动上限咯",
+            type: "warning",
+            duration: 3000,
+          });
+        }
+      }
+    },
+  },
+  computed: {},
+  mounted() {
+    this.activeId= this.$route.query.activeId;
+    this.getMember();
+    this.getMostTimes();
+    this.getMyTimes();
+  },
+};
+</script>
+<style scoped>
+.container {
+  margin: 25px 25px;
+}
+.title {
+  color: #333333;
+  font-size: 17px;
+  font-weight: bold;
+}
+
+.subtitle {
+  color: #999999;
+  margin-top: 10px;
+  font-size: 14px;
+}
+
+.heartbox {
+  width: 100%;
+  height: 50px;
+  /* border: 1px solid red; */
+  position: relative;
+  display: flex;
+  align-items: center;
+  justify-content: space-around;
+  overflow-x: auto;
+}
+
+.line {
+  width: 100%;
+  height: 2px;
+  background: #d8d8d8;
+  position: absolute;
+  top: 22px;
+  left: 0;
+  z-index: 0;
+}
+.num {
+  width: 100%;
+  height: 50px;
+  /* border: 1px solid red; */
+}
+.allnum {
+  line-height: 50px;
+  color: #4d4d4d;
+  float: left;
+}
+.tousu {
+  width: 77px;
+  color: #9d69ff;
+  height: 20px;
+  border: 1px solid #9d69ff;
+  border-radius: 10px;
+  float: right;
+  line-height: 22px;
+  text-align: center;
+  margin-top: 12px;
+  font-size: 14px;
+}
+.photobox {
+  display: flex;
+  flex-wrap: wrap;
+  margin-left: 10px;
+}
+.grayCircle {
+  width: 65px;
+  height: 65px;
+  border-radius: 50%;
+  border: 1px solid #d8d8d8;
+  position: absolute;
+  top: 4px;
+  left: 1px;
+}
+.loveCircle {
+  width: 65px;
+  height: 65px;
+  /* border-radius: 50%; */
+  /* border:2px solid #d8d8d8; */
+  position: absolute;
+  top: 5px;
+  left: 2px;
+}
+</style>

+ 38 - 0
src/pages/registrationSuccess.vue

@@ -0,0 +1,38 @@
+<template>
+  <div style="text-align: center; line-height: 60rpx">
+    <img src="../assets/gou.png" class="img1"/>
+    <div>报名成功</div>
+    <div>请留意审核消息</div>
+    <img src="../assets/di.png" class="img2"/>
+  </div>
+</template>
+<script>
+export default {
+  name: "registrationSuccess",
+  data() {
+    return {
+
+    };
+  },
+  methods: {
+
+  },
+  computed: {},
+  mounted() {
+  },
+};
+</script>
+<style scoped>
+.img1{
+  width: 262px;
+  height: 262px;
+  margin:0px 57px
+}
+.img2{
+  position: fixed;
+  bottom: 0;
+  left: 0;
+  width: 100%;
+  height: 150px;
+}
+</style>

+ 16 - 1
src/router/index.js

@@ -36,9 +36,24 @@ const routes = [
     path: '/activeDetails',
     name: 'activeDetails',
     component: getComponent('activeDetails')
+  },
+  {
+    path: '/registrationSuccess',
+    name: 'registrationSuccess',
+    component: getComponent('registrationSuccess')
+  },
+  {
+    path: '/onSiteActivity',
+    name: 'onSiteActivity',
+    component: getComponent('onSiteActivity')
+  },
+  {
+    path: '/infoDetails',
+    name: 'infoDetails',
+    component: getComponent('infoDetails')
   }
+  // 
 ]
-
 const router = new VueRouter({
   routes
 })

+ 66 - 0
src/util/getOpenId.js

@@ -0,0 +1,66 @@
+import {Loading} from 'element-ui';
+import { getOpenId, getAppID} from '../api'
+
+export default {
+    getOpenId(callback) {
+        let  loading = Loading.service();
+        if (window.localStorage.getItem('openId')) {
+            loading.close();
+            callback();
+        } else {
+            this.getAppid(loading,callback);
+        }
+
+    },
+    async getAppid (loading,callback){
+        let result = await getAppID({cid: 'oauth'}, "GET");
+        if (result.code === 0) {
+            this.getCode(result.data.appid,loading,callback);
+        }else{
+            loading.close();
+        }
+    },
+    getCode(appid,loading,callback) { // 非静默授权,第一次有弹框
+        let local = window.location.href; // 获取页面url
+        let code = this.getUrlCode().code;// 截取code
+        if (code && code !== '') { // 如果有code
+            // 拿到code去请求openId并存在本地 ?appid=APPID&secret=SECRET&code=CODE&grant_type=authorization_code
+            this.requestNet(code,loading,callback);
+        } else {
+            loading.close();
+            // window.location.href = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${appid}&redirect_uri=${encodeURIComponent(local)}&response_type=code&scope=snsapi_userinfo&state=123#wechat_redirect`
+            window.location.href = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${appid}&redirect_uri=${encodeURIComponent(local)}&response_type=code&scope=snsapi_base&state=123#wechat_redirect`
+        }
+    },
+    getUrlCode() { // 截取url中的code方法
+        let url = location.search;
+        let theRequest = {};
+        if (url.indexOf("?") !== -1) {
+            let str = url.substr(1);
+            let strs = str.split("&");
+            for (let i = 0; i < strs.length; i++) {
+                theRequest[strs[i].split("=")[0]] = (strs[i].split("=")[1])
+            }
+        }
+        return theRequest
+    },
+    async requestNet(code,loading,callback) {
+        let result = await getOpenId({cid: 'oauth', code: code}, "GET");
+        if (!result.data.errcode && result.data.openid && result.data.openid !== 'null') {
+            window.localStorage.setItem("openId", result.data.openid);
+            callback();
+            loading.close();
+        }else{
+            loading.close();
+        }
+    },
+
+
+}
+
+
+
+
+
+
+