فهرست منبع

适配微服务版本

yinzhipeng 3 سال پیش
والد
کامیت
10678e1d32
5فایلهای تغییر یافته به همراه267 افزوده شده و 219 حذف شده
  1. 1 1
      app.js
  2. 1 1
      pages/charging/charging.js
  3. 108 83
      pages/register/register.js
  4. 1 1
      pages/register/register.wxml
  5. 156 133
      project.config.json

+ 1 - 1
app.js

@@ -3,7 +3,7 @@ let wechat = require('./utils/wechat.js');
 let log = require('./utils/log.js');
 App({
   globalData: {
-    postHeadAgreement: 'http://cdgl.pjnes.com',
+    postHeadAgreement: 'https://jqcs.pjnes.com/cloud/chargapi',
     helpPhoneNum: '18211188302',
     version:'2.0'
   },

+ 1 - 1
pages/charging/charging.js

@@ -229,7 +229,7 @@ Page({
               }
             }
           });
-          //console.log(chargingOrder.chargPileStatus);
+          console.log("chargingOrder.chargPileStatus   " + chargingOrder.chargPileStatus);
           if (chargingOrder.chargPileStatus == 1) { //启动中,继续轮训
             log.info('[充电中]', '[初次订单状态判定]', '[chargPileStatus状态1启动中,继续轮训]', data)
             that.setData({

+ 108 - 83
pages/register/register.js

@@ -44,65 +44,90 @@ Page({
   bindGetUserInfo(e) {
     //console.log(e);
     //console.log(e.detail.userInfo)
-    let that = this;
-    if (e.detail.userInfo) {
-      let {
-        nickName: userName,
-        gender: sex,
-        avatarUrl: avatar
-      } = e.detail.userInfo;
-      let {
-        userName: loginName,
-        password,
-        phone,
-        carNum,
-        email
-      } = this.data;
-      wx.login({
-        success(res) {
-          //console.log(res);
-          if (res.code) {
-            wx.request({
-              url: getApp().globalData.postHeadAgreement + '/restapi/wechat/register',
-              data: {
-                userName,
-                sex,
-                avatar,
-                loginName,
-                password,
-                phonenumber: phone,
-                email,
-                license_number: carNum,
-                code: res.code
-              },
-              method: 'POST',
-              success(res1) {
-                //console.log(res1);
-                //console.log(res1.data.code == 1);
-                if (res1.data.code == 1) {
-                  that.setData({
-                    errorMsg: res1.data.msg
-                  })
-                } else {
-                  //返回该用户
-                  //跳转到上一页
-                  wx.setStorageSync("userInfo", res1.data);
-                  wx.setStorageSync("isLogin", true);
-                  wx.navigateBack();
-                  //let url = `/pages/ucenter/index/index`;
-                  //wx.redirectTo({
-                  //url
-                  //});
-                }
-              }
-            });
-          } else {
-            console.log('登录失败!' + res.errMsg)
-          }
-        }
-      });
 
+
+    if (wx.getUserProfile) {
+      console.info("11111111111111111")
     }
+    console.info("2222222222222222222222222222")
+
+    wx.getUserProfile({
+      desc: '用于获取用户昵称以及头像', // 声明获取用户个人信息后的用途,后续会展示在弹窗中,请谨慎填写
+      success: (res) => {
+        // this.setData({
+        //   userInfo: res.userInfo,
+        //   hasUserInfo: true
+        // })
+        console.info("sssssssssssssssssssssssssssss")
+        console.info(res)
+          let {
+            nickName: userName,
+            gender: sex,
+            avatarUrl: avatar
+          } = res.userInfo;
+          let {
+            userName: loginName,
+            password,
+            phone,
+            carNum,
+            email
+          } = this.data;
+          wx.login({
+            success(res) {
+              //console.log(res);
+              if (res.code) {
+                wx.request({
+                  url: getApp().globalData.postHeadAgreement + '/restapi/wechat/register',
+                  data: {
+                    userName,
+                    sex,
+                    avatar,
+                    loginName,
+                    password,
+                    phonenumber: phone,
+                    email,
+                    license_number: carNum,
+                    code: res.code
+                  },
+                  method: 'POST',
+                  success(res1) {
+                    //console.log(res1);
+                    //console.log(res1.data.code == 1);
+                    if (res1.data.code == 1) {
+                      that.setData({
+                        errorMsg: res1.data.msg
+                      })
+                    } else {
+                      //返回该用户
+                      //跳转到上一页
+                      wx.setStorageSync("userInfo", res1.data);
+                      wx.setStorageSync("isLogin", true);
+                      wx.navigateBack();
+                      //let url = `/pages/ucenter/index/index`;
+                      //wx.redirectTo({
+                      //url
+                      //});
+                    }
+                  }
+                });
+              } else {
+                console.log('登录失败!' + res.errMsg)
+              }
+            }
+          });
+    
+
+
+
+
+      }})
+
+
+
+
+
+    let that = this;
+
   },
   inputAccount(e) {
     this.setData({
@@ -209,19 +234,19 @@ Page({
         errorMsg: ''
       });
     }
-    if (!this.checkMail()) {
-      this.setData({
-        errorMsg: '邮箱输入有误,请重新输入'
-      });
-      this.setData({
-        checkPass: false
-      });
-      return;
-    } else {
-      this.setData({
-        errorMsg: ''
-      });
-    }
+    // if (!this.checkMail()) {
+    //   this.setData({
+    //     errorMsg: '邮箱输入有误,请重新输入'
+    //   });
+    //   this.setData({
+    //     checkPass: false
+    //   });
+    //   return;
+    // } else {
+    //   this.setData({
+    //     errorMsg: ''
+    //   });
+    // }
     if (!this.checkCarNum()) {
       this.setData({
         errorMsg: '车牌号输入有误,请重新输入'
@@ -244,19 +269,19 @@ Page({
       });
       return;
     }
-    if (!this.checkPassword()) {
-      this.setData({
-        errorMsg: '两次密码输入不一致,请重新输入'
-      });
-      this.setData({
-        checkPass: false
-      });
-      return;
-    } else {
-      this.setData({
-        errorMsg: ''
-      });
-    }
+    // if (!this.checkPassword()) {
+    //   this.setData({
+    //     errorMsg: '两次密码输入不一致,请重新输入'
+    //   });
+    //   this.setData({
+    //     checkPass: false
+    //   });
+    //   return;
+    // } else {
+    //   this.setData({
+    //     errorMsg: ''
+    //   });
+    // }
     this.setData({
       checkPass: true
     });

+ 1 - 1
pages/register/register.wxml

@@ -38,7 +38,7 @@
       </view> -->
     </view>
     <view class="errorMsg"><text>{{errorMsg}}</text></view>
-    <button class='{{checkPass?"login_button":"login_button_disable"}}' open-type="getUserInfo" bindgetuserinfo="{{checkPass?'bindGetUserInfo':''}}">
+    <button class='{{checkPass?"login_button":"login_button_disable"}}' bindtap="{{checkPass?'bindGetUserInfo':''}}">
       注册
     </button>
 

+ 156 - 133
project.config.json

@@ -1,135 +1,158 @@
 {
-	"description": "项目配置文件。",
-	"setting": {
-		"urlCheck": false,
-		"es6": true,
-		"postcss": true,
-		"minified": true,
-		"newFeature": true,
-		"autoAudits": false
-	},
-	"compileType": "miniprogram",
-	"libVersion": "2.14.1",
-	"appid": "wx6e03e5ada030b1aa",
-	"projectname": "充电桩",
-	"isGameTourist": false,
-	"simulatorType": "wechat",
-	"simulatorPluginLibVersion": {},
-	"condition": {
-		"search": {
-			"current": -1,
-			"list": []
-		},
-		"conversation": {
-			"current": -1,
-			"list": []
-		},
-		"plugin": {
-			"current": -1,
-			"list": []
-		},
-		"game": {
-			"currentL": -1,
-			"list": []
-		},
-		"gamePlugin": {
-			"current": -1,
-			"list": []
-		},
-		"miniprogram": {
-			"current": -1,
-			"list": [
-				{
-					"id": -1,
-					"name": "登录",
-					"pathName": "pages/login/login",
-					"query": "",
-					"scene": null
-				},
-				{
-					"id": -1,
-					"name": "忘记密码",
-					"pathName": "pages/forget/forget",
-					"query": "",
-					"scene": null
-				},
-				{
-					"id": 2,
-					"name": "找回密码",
-					"pathName": "pages/reset_password/reset_password",
-					"query": "loginName=1234444",
-					"scene": null
-				},
-				{
-					"id": -1,
-					"name": "注册",
-					"pathName": "pages/register/register",
-					"query": "",
-					"scene": null
-				},
-				{
-					"id": 4,
-					"name": "我的",
-					"pathName": "pages/ucenter/index/index",
-					"query": "",
-					"scene": null
-				},
-				{
-					"id": -1,
-					"name": "充值记录",
-					"pathName": "pages/ucenter/chargemoneylog/chargemoneylog",
-					"query": "",
-					"scene": null
-				},
-				{
-					"id": -1,
-					"name": "充值",
-					"pathName": "pages/chargemoney/chargemoney",
-					"query": "",
-					"scene": null
-				},
-				{
-					"id": 7,
-					"name": "充电中",
-					"pathName": "pages/charging/charging",
-					"query": "",
-					"scene": null
-				},
-				{
-					"id": -1,
-					"name": "客服中心",
-					"pathName": "pages/ucenter/help/help",
-					"query": "",
-					"scene": null
-				},
-				{
-					"id": -1,
-					"name": "我的钱包",
-					"pathName": "pages/ucenter/purse/purse",
-					"query": "",
-					"scene": null
-				},
-				{
-					"id": -1,
-					"name": "充电记录",
-					"pathName": "pages/ucenter/charginglog/charginglog",
-					"query": "",
-					"scene": null
-				},
-				{
-					"id": -1,
-					"name": "终端详情",
-					"pathName": "pages/scan_result/scan_result",
-					"query": "",
-					"scene": null
-				},
-				{
-					"id": -1,
-					"name": "去支付",
-					"pathName": "pages/order/order",
-					"scene": null
-				}
-			]
-		}
-	}
+  "description": "项目配置文件。",
+  "setting": {
+    "urlCheck": false,
+    "es6": true,
+    "enhance": false,
+    "postcss": true,
+    "preloadBackgroundData": false,
+    "minified": true,
+    "newFeature": true,
+    "coverView": true,
+    "nodeModules": false,
+    "autoAudits": false,
+    "showShadowRootInWxmlPanel": true,
+    "scopeDataCheck": false,
+    "uglifyFileName": false,
+    "checkInvalidKey": true,
+    "checkSiteMap": true,
+    "uploadWithSourceMap": true,
+    "compileHotReLoad": false,
+    "useMultiFrameRuntime": true,
+    "useApiHook": true,
+    "useApiHostProcess": true,
+    "babelSetting": {
+      "ignore": [],
+      "disablePlugins": [],
+      "outputPath": ""
+    },
+    "enableEngineNative": false,
+    "bundle": false,
+    "useIsolateContext": true,
+    "useCompilerModule": true,
+    "userConfirmedUseCompilerModuleSwitch": false,
+    "userConfirmedBundleSwitch": false,
+    "packNpmManually": false,
+    "packNpmRelationList": [],
+    "minifyWXSS": true
+  },
+  "compileType": "miniprogram",
+  "libVersion": "2.16.1",
+  "appid": "wx6e03e5ada030b1aa",
+  "projectname": "%E5%85%85%E7%94%B5%E6%A1%A9",
+  "isGameTourist": false,
+  "simulatorType": "wechat",
+  "simulatorPluginLibVersion": {},
+  "condition": {
+    "search": {
+      "list": []
+    },
+    "conversation": {
+      "list": []
+    },
+    "plugin": {
+      "list": []
+    },
+    "game": {
+      "currentL": -1,
+      "list": []
+    },
+    "gamePlugin": {
+      "list": []
+    },
+    "miniprogram": {
+      "list": [
+        {
+          "id": -1,
+          "name": "登录",
+          "pathName": "pages/login/login",
+          "query": "",
+          "scene": null
+        },
+        {
+          "id": -1,
+          "name": "忘记密码",
+          "pathName": "pages/forget/forget",
+          "query": "",
+          "scene": null
+        },
+        {
+          "id": 2,
+          "name": "找回密码",
+          "pathName": "pages/reset_password/reset_password",
+          "query": "loginName=1234444",
+          "scene": null
+        },
+        {
+          "id": -1,
+          "name": "注册",
+          "pathName": "pages/register/register",
+          "query": "",
+          "scene": null
+        },
+        {
+          "id": 4,
+          "name": "我的",
+          "pathName": "pages/ucenter/index/index",
+          "query": "",
+          "scene": null
+        },
+        {
+          "id": -1,
+          "name": "充值记录",
+          "pathName": "pages/ucenter/chargemoneylog/chargemoneylog",
+          "query": "",
+          "scene": null
+        },
+        {
+          "id": -1,
+          "name": "充值",
+          "pathName": "pages/chargemoney/chargemoney",
+          "query": "",
+          "scene": null
+        },
+        {
+          "id": 7,
+          "name": "充电中",
+          "pathName": "pages/charging/charging",
+          "query": "",
+          "scene": null
+        },
+        {
+          "id": -1,
+          "name": "客服中心",
+          "pathName": "pages/ucenter/help/help",
+          "query": "",
+          "scene": null
+        },
+        {
+          "id": -1,
+          "name": "我的钱包",
+          "pathName": "pages/ucenter/purse/purse",
+          "query": "",
+          "scene": null
+        },
+        {
+          "id": -1,
+          "name": "充电记录",
+          "pathName": "pages/ucenter/charginglog/charginglog",
+          "query": "",
+          "scene": null
+        },
+        {
+          "id": -1,
+          "name": "终端详情",
+          "pathName": "pages/scan_result/scan_result",
+          "query": "",
+          "scene": null
+        },
+        {
+          "id": -1,
+          "name": "去支付",
+          "pathName": "pages/order/order",
+          "scene": null
+        }
+      ]
+    }
+  }
 }