Browse Source

业主购买2月10号

guojing 5 years ago
parent
commit
c561b8bafa

+ 24 - 13
whepi-ui/templates/home/buy.ftl

@@ -29,9 +29,9 @@
         <div class="weui-form-preview"
              id="buyListGroup">
             <div style="display: flex; flex-direction: row; color: grey; font-size: medium;">
-                <div style="width: 40%; text-align: center;color: #0a001f">标题</div>
-                <div style="width: 15%; text-align: center;color: #0a001f">已团</div>
-                <div style="width: 30%; text-align: center;color: #0a001f">截止时间</div>
+                <div style="width: 30%; text-align: center;color: #0a001f">标题</div>
+                <div style="width: 20%; text-align: center;color: #0a001f">已团</div>
+                <div style="width: 35%; text-align: center;color: #0a001f">截止时间</div>
                 <div style="width: 15%; text-align: center;color: #0a001f">状态</div>
             </div>
         </div>
@@ -87,12 +87,12 @@
         function buyList(v) {
             $('#buyAll').append(' <a href="javascript:void(0);" style="color: grey;font-size: large" data-id="form"\n' +
                     '                                             onclick=\'myBuyClick(' + JSON.stringify(v) + ')\'>\n' +
-                    '                <div style="display: flex; flex-direction: row; text-align: center; font-size: x-small; line-height: 5vh;">\n' +
-                    '                    <div style="width: 40%; overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size: 12px">' + v.tgTitle + '</div>\n' +
-                    '                    <div style="width: 15%; overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size: 12px">\n' + v.count + '/' + v.tgMinNum + '</div>\n' +
-                    '                    <div style="width: 30%; overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size: 12px">' + timestampToTime(v.tgEndTime) + '</div>\n' +
-                    '                    <div style="width: 15%; overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size: 12px">' + getStatus(v.tgStatus) + '</div>\n' +
-                    '                </div>\n' +
+                    '                <div style="display: flex; flex-direction: row; text-align: center; font-size: x-small; line-height: 4vh;">\n' +
+                    '                    <div style="width: 30%; overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size: 14px">' + v.tgTitle + '</div>\n' +
+                    '                    <div style="width: 20%; overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size: 14px">\n' + v.count + '/' + v.tgMinNum + '</div>\n' +
+                    '                    <div style="width: 35%; overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size: 14px">' + timestampY(v.tgEndTime) + '</div>\n' +
+                    '                    <div style="width: 15%; overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size: 14px">' + getStatus(v.tgStatus) + '</div>\n' +
+                    '                <div class="weui-textarea-counter">\n' + '</div></div>\n' +
                     '            </a>');
         }
 
@@ -127,10 +127,10 @@
 
         function MybuyList(v) {
             $('#MyBuyAll').append('<a href="javascript:void(0);" style="color: grey;font-size: large" data-id="form" onclick=\'myBuyClick2(' + JSON.stringify(v) + ')\'>\n' +
-                    '                        <div style="display: flex; flex-direction: row; text-align: center; font-size: x-small; line-height: 5vh;">\n' +
-                    '                            <div style="width: 33%; overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size: 12px">' + v.tgTitle + '</div>\n' +
-                    '                            <div style="width: 33%; overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size: 12px">' + timestampToTime(v.timeCreate) + '</div>\n' +
-                    '                            <div style="width: 33%; overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size: 12px">' + getStatus(v.tgStatus) + '</div>\n' +
+                    '                        <div style="display: flex; flex-direction: row; text-align: center; font-size: x-small; line-height: 4vh;">\n' +
+                    '                            <div style="width: 33%; overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size: 14px">' + v.tgTitle + '</div>\n' +
+                    '                            <div style="width: 33%; overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size: 14px">' + timestampY(v.timeCreate) + '</div>\n' +
+                    '                            <div style="width: 33%; overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size: 14px">' + getStatus(v.tgStatus) + '</div>\n' +
                     '                        </div>\n' + '                    </a>')
         }
 
@@ -170,4 +170,15 @@
                 return "<span style='color:red;'>取消</span>";
             }
         }
+
+        function timestampY(timestamp) {
+            var date = new Date(timestamp); //时间戳为10位需*1000,时间戳为13位的话不需乘1000
+            var Y = date.getFullYear() + '/';
+            var M = ((date.getMonth() + 1) < 10) ? ('0' + (date.getMonth() + 1) + '/') : ((date.getMonth() + 1) + '/');
+            var D = (date.getDate() < 10) ? ('0' + date.getDate() + ' ') : (date.getDate() + ' ');
+            var h = (date.getHours() < 10) ? ('0' + date.getHours() + ':') : (date.getHours() + ':');
+            var m = (date.getMinutes() < 10) ? ('0' + date.getMinutes() + ':') : (date.getMinutes() + ':');
+            var s = (date.getSeconds() < 10) ? ('0' + date.getSeconds()) : (date.getSeconds());
+            return  M + D + h + m + s;
+        }
     </script>

+ 7 - 7
whepi-ui/templates/home/buyClient.ftl

@@ -8,7 +8,7 @@
 
     <div class="weui-flex__item">
         <div style="display: inline;align-items: flex-end">状&nbsp;&nbsp;&nbsp;&nbsp;态:</div>
-        <div style="display: inline;" id="myStatus"></div>
+        <div style="display: inline;margin-top: 1vh;" id="myStatus"></div>
     </div>
 
     <div class="weui-flex" style="display:flex; flex-direction: row; justify-content: space-between">
@@ -16,7 +16,7 @@
             <div style="display: inline;align-items: flex-start">我的团购:</div>
             <div style="display: inline;">
                 <input type="text" id="buyCount"
-                       style="border: 1px solid rgba(0,0,0,.2);box-sizing:border-box; border-radius: 5px; height: 5vh; width: 20%;"
+                       style="border: 1px solid rgba(0,0,0,.2);box-sizing:border-box; border-radius: 5px; height: 5vh; width: 50%;font-size: 16px;margin-top: 1vh;"
                        maxlength="3" onkeyup="this.value=this.value.replace(/[^0-9-]+/,'');" min="1"
                        onchange="changeBuy()">
             </div>
@@ -24,7 +24,7 @@
     </div>
     <div class="weui-flex__item">
         <div style="display: inline;">金&nbsp;&nbsp;&nbsp;&nbsp;额¥:</div>
-        <div style="display: inline;" id="myMenory"></div>
+        <div style="display: inline;font-size: 16px" id="myMenory"></div>
     </div>
     <div class="weui-flex">
         <div class="weui-flex__item">
@@ -32,14 +32,14 @@
             <div class="weui-flex__item" style="display: inline;">
                 <input type="text" maxlength="11" id="myPhone" onkeyup="value=value.replace(/[^\d]/g,'')"
                        maxlength=11
-                       style="border: 1px solid rgba(0,0,0,.2);box-sizing:border-box; border-radius: 5px; height: 5vh; width: 50%;"">
+                       style="border: 1px solid rgba(0,0,0,.2);box-sizing:border-box; border-radius: 5px; height: 5vh; width: 50%;font-size: 16px;margin-top: 1vh;">
             </div>
         </div>
     </div>
-    <div style="display:flex; flex-direction: row; justify-content: space-between; margin-top: 1vh;">
-        <div style="color:#1e282c;height: 5vh; line-height: 5vh;margin-right: 2vw;width: 13%;">备注:</div>
+    <div style=" flex-direction: row; justify-content: space-between;">
+        <div style="display: inline;align-items: flex-start"">备&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;注:</div>
         <textarea id="Myremarks" class="weui-textarea" placeholder="输入内容(200字内)" rows="3"
-                  style="border: 1px solid rgba(0,0,0,.2);box-sizing:border-box; border-radius: 5px; margin-top: 1vh;"></textarea>
+                  style="border: 1px solid rgba(0,0,0,.2);box-sizing:border-box; border-radius: 5px; margin-top: 1vh;" ></textarea>
     </div>
     <div style="display:flex; flex-direction: row; justify-content: space-between; margin-top: 1vh; margin-bottom: 5vh;">
     <#if type==1>

+ 4 - 4
whepi-ui/templates/home/home.ftl

@@ -18,13 +18,13 @@
             <div class="weui-tabbar__icon"><img src="/static/images/wx/order.png" alt=""></div>
             <p class="weui-tabbar__label">健康日报</p>
         </a>
-        <a href="#tab2" class="weui-tabbar__item">
+        <a href="#tab2" class="weui-tabbar__item" onclick="familyClick()">
             <div class="weui-tabbar__icon"><img src="/static/images/wx/customer_service.png" alt=""></div>
-            <p class="weui-tabbar__label" onclick="familyClick()">家庭求助</p>
+            <p class="weui-tabbar__label">家庭求助</p>
         </a>
-        <a href="#tab3" class="weui-tabbar__item">
+        <a href="#tab3" class="weui-tabbar__item" onclick="buyGroup()">
             <div class="weui-tabbar__icon"><img src="/static/images/wx/upload.png" alt=""></div>
-            <p class="weui-tabbar__label" onclick="buyGroup()">商品团购</p>
+            <p class="weui-tabbar__label">商品团购</p>
         </a>
     <#--<a href="#tab4" class="weui-tabbar__item">-->
     <#--<div class="weui-tabbar__icon"> <img src="./images/icon_nav_cell.png" alt=""> </div>-->

+ 4 - 4
whepi-web/src/main/java/com/bofeng/wx/controller/UserOpenController.java

@@ -64,10 +64,10 @@ public class UserOpenController {
                              @RequestParam(value = "userType", required = false, defaultValue = "0") Integer userType) throws JsonProcessingException {
         List<UserRole> list = new ArrayList<>();
         if (userId == 0) {
-            UserOpen userOpen = homeService.getUserOpen();
-            list = userRoleMapper.getUserRoleByUserId(userOpen.getUserId());
-//            list = userRoleMapper.getUserRoleByUserId(1225321682867105793L);
-//            UserOpen userOpen = userOpenMapper.selectByUserId(1225321682867105793L);
+            /*UserOpen userOpen = homeService.getUserOpen();
+            list = userRoleMapper.getUserRoleByUserId(userOpen.getUserId());*/
+            list = userRoleMapper.getUserRoleByUserId(1225321682867105793L);
+            UserOpen userOpen = userOpenMapper.selectByUserId(1225321682867105793L);
             userId = userOpen.getUserId();
             model.put("user", userOpen);
             model.put("user_id", "\"" + userOpen.getUserId() + "\"");

+ 1 - 1
whepi-web/src/main/resources/mapper/BuyMapper.xml

@@ -22,7 +22,7 @@
         select DISTINCT a.tg_title,b.time_create,a.tg_status,a.jm_id,b.buy_status
         from  jm_tuangou a
         INNER JOIN jm_buy b on a.jm_id=b.jm_id
-        where a.user_id=#{userId} and buy_status=1
+        where b.user_id=#{userId} and buy_status=1
     </select>