Browse Source

抽奖活动首页

bobo 3 years ago
parent
commit
cda4d49677
5 changed files with 114 additions and 58 deletions
  1. 20 19
      app.json
  2. 4 1
      project.config.json
  3. 47 35
      project.private.config.json
  4. 3 2
      utils/request.js
  5. 40 1
      utils/util.js

+ 20 - 19
app.json

@@ -1,20 +1,21 @@
 {
-  "pages":[
-    
-    "pages/activityList/activityList",
-    "pages/activityInfo/activityInfo",
-    "pages/myCoupons/myCoupons",
-    "pages/index/index",
-    "pages/receiveCoupon/receiveCoupon",
-    "pages/logs/logs"
-    
-  ],
-  "window":{
-    "backgroundTextStyle":"light",
-    "navigationBarBackgroundColor": "#fff",
-    "navigationBarTitleText": "Weixin",
-    "navigationBarTextStyle":"black"
-  },
-  "style": "v2",
-  "sitemapLocation": "sitemap.json"
-}
+    "pages": [
+        "pages/activityList/activityList",
+        "pages/activityInfo/activityInfo",
+        "pages/myCoupons/myCoupons",
+        "pages/index/index",
+        "pages/receiveCoupon/receiveCoupon",
+        "pages/logs/logs",
+        "pages/luckDraw/detail",
+        "pages/luckDraw/index",
+        "pages/luckDraw/profile"
+    ],
+    "window": {
+        "backgroundTextStyle": "light",
+        "navigationBarBackgroundColor": "#fff",
+        "navigationBarTitleText": "Weixin",
+        "navigationBarTextStyle": "black"
+    },
+    "style": "v2",
+    "sitemapLocation": "sitemap.json"
+}

+ 4 - 1
project.config.json

@@ -36,7 +36,10 @@
     "packNpmManually": false,
     "packNpmRelationList": [],
     "minifyWXSS": false,
-    "showES6CompileOption": false
+    "disableUseStrict": false,
+    "showES6CompileOption": false,
+    "useCompilerPlugins": false,
+    "minifyWXML": true
   },
   "compileType": "miniprogram",
   "libVersion": "2.19.4",

+ 47 - 35
project.private.config.json

@@ -1,42 +1,54 @@
 {
-  "setting": {},
-  "condition": {
-    "plugin": {
-      "list": []
-    },
-    "game": {
-      "list": []
-    },
-    "gamePlugin": {
-      "list": []
-    },
-    "miniprogram": {
-      "list": [
-        {
-          "name": "pages/activityInfo/activityInfo",
-          "pathName": "pages/activityInfo/activityInfo",
-          "query": "id=Bg5740r78w&mobile=18636653274",
-          "scene": null
+    "setting": {},
+    "condition": {
+        "plugin": {
+            "list": []
         },
-        {
-          "name": "pages/couponReceive/couponReceive",
-          "pathName": "pages/couponReceive/couponReceive",
-          "query": "codeId=JyZmVzKm0D-47",
-          "scene": null
+        "game": {
+            "list": []
         },
-        {
-          "name": "pages/myCoupons/myCoupons",
-          "pathName": "pages/myCoupons/myCoupons",
-          "query": "mobile=18636653274",
-          "scene": null
+        "gamePlugin": {
+            "list": []
         },
-        {
-          "name": "pages/receiveCoupon/receiveCoupon",
-          "pathName": "pages/receiveCoupon/receiveCoupon",
-          "query": "",
-          "scene": 1013
+        "miniprogram": {
+            "list": [
+                {
+                    "name": "pages/activityInfo/activityInfo",
+                    "pathName": "pages/activityInfo/activityInfo",
+                    "query": "id=Bg5740r78w&mobile=18636653274",
+                    "scene": null
+                },
+                {
+                    "name": "pages/couponReceive/couponReceive",
+                    "pathName": "pages/couponReceive/couponReceive",
+                    "query": "codeId=JyZmVzKm0D-47",
+                    "scene": null
+                },
+                {
+                    "name": "pages/myCoupons/myCoupons",
+                    "pathName": "pages/myCoupons/myCoupons",
+                    "query": "mobile=18636653274",
+                    "scene": null
+                },
+                {
+                    "name": "pages/receiveCoupon/receiveCoupon",
+                    "pathName": "pages/receiveCoupon/receiveCoupon",
+                    "query": "",
+                    "scene": 1013
+                },
+                {
+                    "name": "pages/luckDraw/detail",
+                    "pathName": "pages/luckDraw/detail",
+                    "query": "id=1",
+                    "scene": null
+                },
+                {
+                    "name": "pages/luckDraw/index",
+                    "pathName": "pages/luckDraw/index",
+                    "query": "",
+                    "scene": null
+                }
+            ]
         }
-      ]
     }
-  }
 }

+ 3 - 2
utils/request.js

@@ -2,11 +2,12 @@ import util from './util.js'
 class request {
 
     //本地的
-    //  static BASE_URL = 'http://www.zmh.com:81/'
+ static BASE_URL = 'http://localhost:8014/'
 //   pre环境的
 //   static BASE_URL = 'https://oapi.shpr.top/'
 //   正式的
-  static BASE_URL = 'https://vapi.hsayi.com/'
+//   static BASE_URL = 'https://vapi.hsayi.com/'
+
 //   @todo需要修改正式的域名
 
   static HEAD = {

+ 40 - 1
utils/util.js

@@ -100,11 +100,50 @@ function getQueryVariable(variable,query)
        return(false);
 }
 
+function parseTime(time, cFormat) {
+  if (arguments.length === 0 || !time) {
+    return null
+  }
+  const format = cFormat || '{y}-{m}-{d} {h}:{i}:{s}'
+  let date
+  if (typeof time === 'object') {
+    date = time
+  } else {
+    if ((typeof time === 'string')) {
+      if ((/^[0-9]+$/.test(time))) {
+        time = parseInt(time)
+      } else {
+        time = time.replace(new RegExp(/-/gm), '/')
+      }
+    }
+    if ((typeof time === 'number') && (time.toString().length === 10)) {
+      time = time * 1000
+    }
+    date = new Date(time)
+  }
+  const formatObj = {
+    y: date.getFullYear(),
+    m: date.getMonth() + 1,
+    d: date.getDate(),
+    h: date.getHours(),
+    i: date.getMinutes(),
+    s: date.getSeconds(),
+    a: date.getDay()
+  }
+  const time_str = format.replace(/{([ymdhisa])+}/g, (result, key) => {
+    const value = formatObj[key]
+    if (key === 'a') { return ['日', '一', '二', '三', '四', '五', '六'][value ] }
+    return value.toString().padStart(2, '0')
+  })
+  return time_str
+}
+
 module.exports = {
   formatTime,
   sha1,
   getUnixTime,
   format,
   add0,
-  getQueryVariable
+  getQueryVariable,
+  parseTime
 }