Browse Source

谁是舞王

xiongzhu 7 years ago
parent
commit
2c2b474d54

+ 6 - 1
src/main/java/com/thmodel/jooq/tables/Parttysign.java

@@ -43,7 +43,7 @@ import org.jooq.impl.TableImpl;
 @SuppressWarnings({ "all", "unchecked", "rawtypes" })
 @SuppressWarnings({ "all", "unchecked", "rawtypes" })
 public class Parttysign extends TableImpl<ParttysignRecord> {
 public class Parttysign extends TableImpl<ParttysignRecord> {
 
 
-    private static final long serialVersionUID = -1215992459;
+    private static final long serialVersionUID = -1510185869;
 
 
     /**
     /**
      * The reference instance of <code>thmodel.parttysign</code>
      * The reference instance of <code>thmodel.parttysign</code>
@@ -138,6 +138,11 @@ public class Parttysign extends TableImpl<ParttysignRecord> {
      */
      */
     public final TableField<ParttysignRecord, Integer> OUT = createField("out", org.jooq.impl.SQLDataType.INTEGER.defaultValue(org.jooq.impl.DSL.inline("0", org.jooq.impl.SQLDataType.INTEGER)), this, "");
     public final TableField<ParttysignRecord, Integer> OUT = createField("out", org.jooq.impl.SQLDataType.INTEGER.defaultValue(org.jooq.impl.DSL.inline("0", org.jooq.impl.SQLDataType.INTEGER)), this, "");
 
 
+    /**
+     * The column <code>thmodel.parttysign.pass</code>.
+     */
+    public final TableField<ParttysignRecord, Integer> PASS = createField("pass", org.jooq.impl.SQLDataType.INTEGER.defaultValue(org.jooq.impl.DSL.inline("0", org.jooq.impl.SQLDataType.INTEGER)), this, "");
+
     /**
     /**
      * Create a <code>thmodel.parttysign</code> table reference
      * Create a <code>thmodel.parttysign</code> table reference
      */
      */

+ 60 - 11
src/main/java/com/thmodel/jooq/tables/records/ParttysignRecord.java

@@ -13,8 +13,8 @@ import javax.annotation.Generated;
 
 
 import org.jooq.Field;
 import org.jooq.Field;
 import org.jooq.Record1;
 import org.jooq.Record1;
-import org.jooq.Record16;
-import org.jooq.Row16;
+import org.jooq.Record17;
+import org.jooq.Row17;
 import org.jooq.impl.UpdatableRecordImpl;
 import org.jooq.impl.UpdatableRecordImpl;
 
 
 
 
@@ -29,9 +29,9 @@ import org.jooq.impl.UpdatableRecordImpl;
     comments = "This class is generated by jOOQ"
     comments = "This class is generated by jOOQ"
 )
 )
 @SuppressWarnings({ "all", "unchecked", "rawtypes" })
 @SuppressWarnings({ "all", "unchecked", "rawtypes" })
-public class ParttysignRecord extends UpdatableRecordImpl<ParttysignRecord> implements Record16<Integer, Integer, Integer, Timestamp, String, String, Integer, BigDecimal, Integer, Timestamp, Integer, String, String, String, Integer, Integer> {
+public class ParttysignRecord extends UpdatableRecordImpl<ParttysignRecord> implements Record17<Integer, Integer, Integer, Timestamp, String, String, Integer, BigDecimal, Integer, Timestamp, Integer, String, String, String, Integer, Integer, Integer> {
 
 
-    private static final long serialVersionUID = 259533251;
+    private static final long serialVersionUID = -801991047;
 
 
     /**
     /**
      * Setter for <code>thmodel.parttysign.PK</code>.
      * Setter for <code>thmodel.parttysign.PK</code>.
@@ -257,6 +257,20 @@ public class ParttysignRecord extends UpdatableRecordImpl<ParttysignRecord> impl
         return (Integer) get(15);
         return (Integer) get(15);
     }
     }
 
 
+    /**
+     * Setter for <code>thmodel.parttysign.pass</code>.
+     */
+    public void setPass(Integer value) {
+        set(16, value);
+    }
+
+    /**
+     * Getter for <code>thmodel.parttysign.pass</code>.
+     */
+    public Integer getPass() {
+        return (Integer) get(16);
+    }
+
     // -------------------------------------------------------------------------
     // -------------------------------------------------------------------------
     // Primary key information
     // Primary key information
     // -------------------------------------------------------------------------
     // -------------------------------------------------------------------------
@@ -270,23 +284,23 @@ public class ParttysignRecord extends UpdatableRecordImpl<ParttysignRecord> impl
     }
     }
 
 
     // -------------------------------------------------------------------------
     // -------------------------------------------------------------------------
-    // Record16 type implementation
+    // Record17 type implementation
     // -------------------------------------------------------------------------
     // -------------------------------------------------------------------------
 
 
     /**
     /**
      * {@inheritDoc}
      * {@inheritDoc}
      */
      */
     @Override
     @Override
-    public Row16<Integer, Integer, Integer, Timestamp, String, String, Integer, BigDecimal, Integer, Timestamp, Integer, String, String, String, Integer, Integer> fieldsRow() {
-        return (Row16) super.fieldsRow();
+    public Row17<Integer, Integer, Integer, Timestamp, String, String, Integer, BigDecimal, Integer, Timestamp, Integer, String, String, String, Integer, Integer, Integer> fieldsRow() {
+        return (Row17) super.fieldsRow();
     }
     }
 
 
     /**
     /**
      * {@inheritDoc}
      * {@inheritDoc}
      */
      */
     @Override
     @Override
-    public Row16<Integer, Integer, Integer, Timestamp, String, String, Integer, BigDecimal, Integer, Timestamp, Integer, String, String, String, Integer, Integer> valuesRow() {
-        return (Row16) super.valuesRow();
+    public Row17<Integer, Integer, Integer, Timestamp, String, String, Integer, BigDecimal, Integer, Timestamp, Integer, String, String, String, Integer, Integer, Integer> valuesRow() {
+        return (Row17) super.valuesRow();
     }
     }
 
 
     /**
     /**
@@ -417,6 +431,14 @@ public class ParttysignRecord extends UpdatableRecordImpl<ParttysignRecord> impl
         return Parttysign.PARTTYSIGN.OUT;
         return Parttysign.PARTTYSIGN.OUT;
     }
     }
 
 
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public Field<Integer> field17() {
+        return Parttysign.PARTTYSIGN.PASS;
+    }
+
     /**
     /**
      * {@inheritDoc}
      * {@inheritDoc}
      */
      */
@@ -545,6 +567,14 @@ public class ParttysignRecord extends UpdatableRecordImpl<ParttysignRecord> impl
         return getOut();
         return getOut();
     }
     }
 
 
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public Integer component17() {
+        return getPass();
+    }
+
     /**
     /**
      * {@inheritDoc}
      * {@inheritDoc}
      */
      */
@@ -673,6 +703,14 @@ public class ParttysignRecord extends UpdatableRecordImpl<ParttysignRecord> impl
         return getOut();
         return getOut();
     }
     }
 
 
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public Integer value17() {
+        return getPass();
+    }
+
     /**
     /**
      * {@inheritDoc}
      * {@inheritDoc}
      */
      */
@@ -821,7 +859,16 @@ public class ParttysignRecord extends UpdatableRecordImpl<ParttysignRecord> impl
      * {@inheritDoc}
      * {@inheritDoc}
      */
      */
     @Override
     @Override
-    public ParttysignRecord values(Integer value1, Integer value2, Integer value3, Timestamp value4, String value5, String value6, Integer value7, BigDecimal value8, Integer value9, Timestamp value10, Integer value11, String value12, String value13, String value14, Integer value15, Integer value16) {
+    public ParttysignRecord value17(Integer value) {
+        setPass(value);
+        return this;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public ParttysignRecord values(Integer value1, Integer value2, Integer value3, Timestamp value4, String value5, String value6, Integer value7, BigDecimal value8, Integer value9, Timestamp value10, Integer value11, String value12, String value13, String value14, Integer value15, Integer value16, Integer value17) {
         value1(value1);
         value1(value1);
         value2(value2);
         value2(value2);
         value3(value3);
         value3(value3);
@@ -838,6 +885,7 @@ public class ParttysignRecord extends UpdatableRecordImpl<ParttysignRecord> impl
         value14(value14);
         value14(value14);
         value15(value15);
         value15(value15);
         value16(value16);
         value16(value16);
+        value17(value17);
         return this;
         return this;
     }
     }
 
 
@@ -855,7 +903,7 @@ public class ParttysignRecord extends UpdatableRecordImpl<ParttysignRecord> impl
     /**
     /**
      * Create a detached, initialised ParttysignRecord
      * Create a detached, initialised ParttysignRecord
      */
      */
-    public ParttysignRecord(Integer pk, Integer parttypk, Integer memberpk, Timestamp enrolldate, String people, String tel, Integer pcount, BigDecimal fee, Integer issign, Timestamp signdate, Integer accflag, String pic, String video, String text, Integer view, Integer out) {
+    public ParttysignRecord(Integer pk, Integer parttypk, Integer memberpk, Timestamp enrolldate, String people, String tel, Integer pcount, BigDecimal fee, Integer issign, Timestamp signdate, Integer accflag, String pic, String video, String text, Integer view, Integer out, Integer pass) {
         super(Parttysign.PARTTYSIGN);
         super(Parttysign.PARTTYSIGN);
 
 
         set(0, pk);
         set(0, pk);
@@ -874,5 +922,6 @@ public class ParttysignRecord extends UpdatableRecordImpl<ParttysignRecord> impl
         set(13, text);
         set(13, text);
         set(14, view);
         set(14, view);
         set(15, out);
         set(15, out);
+        set(16, pass);
     }
     }
 }
 }

+ 69 - 14
src/main/webapp/dancer/index.jsp

@@ -11,6 +11,8 @@
 <%@ page import="com.thmodel.util.DBRecordsPack" %>
 <%@ page import="com.thmodel.util.DBRecordsPack" %>
 <%@ page import="net.sf.json.JSONObject" %>
 <%@ page import="net.sf.json.JSONObject" %>
 <%@ page import="java.util.List" %>
 <%@ page import="java.util.List" %>
+<%@ page import="org.apache.commons.lang.StringUtils" %>
+<%@ page import="org.jooq.Record" %>
 <%@ page contentType="text/html;charset=UTF-8" language="java" %>
 <%@ page contentType="text/html;charset=UTF-8" language="java" %>
 <%
 <%
     int activitypk = JspUtils.getInt(request, session, "activitypk");
     int activitypk = JspUtils.getInt(request, session, "activitypk");
@@ -35,6 +37,7 @@
                 .join(MEMBERINFO).on(PARTTYSIGN.MEMBERPK.equal(MEMBERINFO.PK))
                 .join(MEMBERINFO).on(PARTTYSIGN.MEMBERPK.equal(MEMBERINFO.PK))
                 .join(MODELINFO).on(MODELINFO.MEMBERPK.equal(PARTTYSIGN.MEMBERPK))
                 .join(MODELINFO).on(MODELINFO.MEMBERPK.equal(PARTTYSIGN.MEMBERPK))
                 .where(PARTTYSIGN.PARTTYPK.equal(activitypk))
                 .where(PARTTYSIGN.PARTTYPK.equal(activitypk))
+                .and(PARTTYSIGN.PASS.equal(1))
                 .orderBy(PARTTYSIGN.PK.desc())
                 .orderBy(PARTTYSIGN.PK.desc())
                 .limit(20 * (pageIndex - 1), 20)
                 .limit(20 * (pageIndex - 1), 20)
                 .fetch();
                 .fetch();
@@ -54,6 +57,21 @@
             .fetchOne(0, int.class));
             .fetchOne(0, int.class));
     List<JSONObject> ads = DBRecordsPack.Pack(ctx.select().from(ADS).where(ADS.PARTTYPK.equal(activitypk)).fetch());
     List<JSONObject> ads = DBRecordsPack.Pack(ctx.select().from(ADS).where(ADS.PARTTYPK.equal(activitypk)).fetch());
 
 
+    String userAgent = request.getHeader("user-agent");
+    int signState = -1;
+    if (memberpk > 0) {
+        Record record = ctx.select().from(PARTTYSIGN).where(PARTTYSIGN.MEMBERPK.equal(memberpk)).fetchAny();
+        if (record != null) {
+            signState = record.get(PARTTYSIGN.PASS);
+        }
+
+        Record record1 = ctx.select().from(MODELINFO).where(MODELINFO.MEMBERPK.equal(memberpk)).fetchAny();
+        if (record1 != null) {
+            modelpk = record1.get(MODELINFO.PK);
+        }
+    }
+
+    ctx.close();
 %>
 %>
 <html>
 <html>
 <head>
 <head>
@@ -243,6 +261,14 @@
             bottom: 10px;
             bottom: 10px;
             text-align: center;
             text-align: center;
         }
         }
+
+        .btn-apply.pending {
+            background: rgba(102, 102, 102, 1);
+            box-shadow: none;
+        }
+
+        .btn-apply.pass {
+        }
     </style>
     </style>
 </head>
 </head>
 <body>
 <body>
@@ -315,7 +341,7 @@
             <img src="${pageContext.request.contextPath}/image/dancer/icon_paihang.png" class="ranking" alt=""
             <img src="${pageContext.request.contextPath}/image/dancer/icon_paihang.png" class="ranking" alt=""
                  :style="{bottom: isModel ? '60px' : '5px'}">
                  :style="{bottom: isModel ? '60px' : '5px'}">
         </a>
         </a>
-        <div class="btn-apply" v-if="isModel" @click="signUp">我要报名</div>
+        <div class="btn-apply" v-if="isModel" @click="signUp" :class="btnClass">{{btnText}}</div>
     </template>
     </template>
 </div>
 </div>
 
 
@@ -349,7 +375,9 @@
                 notJoin: [],
                 notJoin: [],
                 joinFlag: true,
                 joinFlag: true,
                 notFlag: true,
                 notFlag: true,
-                isModel: /chmoModel/i.test(navigator.userAgent)
+                isModel: /chmoModel/i.test(navigator.userAgent),
+                signState: <%=signState%>,
+                modelpk: ''
             }
             }
         },
         },
         mounted() {
         mounted() {
@@ -357,14 +385,36 @@
                 autoplay: true,//可选选项,自动滑动
                 autoplay: true,//可选选项,自动滑动
                 pagination: {
                 pagination: {
                     el: '.swiper-pagination',
                     el: '.swiper-pagination',
-                    clickable: true,
-                },
-            })
+                    clickable: true
+                }
+            });
             this.getJoinPlayer()
             this.getJoinPlayer()
         },
         },
         components: {
         components: {
             'player-item': playerComponent
             'player-item': playerComponent
         },
         },
+        computed: {
+            btnText: function () {
+                switch (this.signState) {
+                    case -1:
+                        return '我要报名';
+                    case 0:
+                        return '审核中';
+                    case 1:
+                        return '我的主页';
+                }
+            },
+            btnClass: function () {
+                switch (this.signState) {
+                    case -1:
+                        return '';
+                    case 0:
+                        return 'pending';
+                    case 1:
+                        return 'pass';
+                }
+            }
+        },
         methods: {
         methods: {
             getJoinPlayer() {
             getJoinPlayer() {
                 if (!this.joinFlag) {
                 if (!this.joinFlag) {
@@ -395,22 +445,27 @@
             menu() {
             menu() {
                 if ($('#app').scrollTop() + $('#app').height() + 50 >= document.getElementById('app').scrollHeight) {
                 if ($('#app').scrollTop() + $('#app').height() + 50 >= document.getElementById('app').scrollHeight) {
                     if (this.joinFlag) {
                     if (this.joinFlag) {
-                        this.currentPage++
+                        this.currentPage++;
                         this.getJoinPlayer()
                         this.getJoinPlayer()
                     } else if (this.notFlag) {
                     } else if (this.notFlag) {
                         this.getNot()
                         this.getNot()
                     }
                     }
-
                 }
                 }
             },
             },
             signUp: function () {
             signUp: function () {
-                try {
-                    window.webkit.messageHandlers.chmo.postMessage({
-                        action: 'signUp',
-                        activitypk: <%=activitypk%>
-                    })
-                } catch (e) {
-                    console.log(e)
+                if (this.signState === -1) {
+                    try {
+                        window.webkit.messageHandlers.chmo.postMessage({
+                            action: 'signUp',
+                            activitypk: <%=activitypk%>
+                        })
+                    } catch (e) {
+                        console.log(e)
+                    }
+                } else if (this.signState === 1) {
+                    if ('<%=modelpk%>' > 0) {
+                        window.location.href = '${pageContext.request.contextPath}/dancer/modelDetail.jsp?memberpk=<%=memberpk%>' + '&activitypk=<%=activitypk%>' + '&modelpk=<%=modelpk%>';
+                    }
                 }
                 }
             }
             }
         }
         }