menc преди 2 години
родител
ревизия
57cabf65ed
променени са 4 файла, в които са добавени 53 реда и са изтрити 56 реда
  1. 2 2
      base/httputil.js
  2. 42 43
      pages/denglu/denglu.js
  3. 7 9
      pages/search/search.js
  4. 2 2
      project.private.config.json

+ 2 - 2
base/httputil.js

@@ -1,6 +1,6 @@
 // let BASE_Server = "http://127.0.0.1:8329"
-    // let BASE_Server = "https://192.168.1.114:18080"
-let BASE_Server = "https://sookajs.top:18080"
+    let BASE_Server = "https://192.168.1.114:18080"
+// let BASE_Server = "https://sookajs.top:18080"
 
 
 

+ 42 - 43
pages/denglu/denglu.js

@@ -7,55 +7,55 @@ Page({
    * 页面的初始数据
    */
   data: {
-    userName:"",
-    password:"",
-    wxCode:"",
-    openid:"",
+    userName: "",
+    password: "",
+    wxCode: "",
+    openid: "",
   },
-   /**
-   * 生命周期函数--监听页面加载
-   */
+  /**
+  * 生命周期函数--监听页面加载
+  */
   onLoad(options) {
-    app.isLoginSuccess=false;
-    let that=this;
+    app.isLoginSuccess = false;
+    let that = this;
     wx.login({
       success(res) {
         that.data.wxCode = res.code
-      
+
         that.getOpenIdBywxCode()
       },
       fail(res) {
-     
+
       }
     })
   },
-  bindViewlogin(){
-    if(this.data.userName==null||this.data.userName==''){
+  bindViewlogin() {
+    if (this.data.userName == null || this.data.userName == '') {
       wx.showToast({
         title: '请输入用户名',
-        icon:'none',
-        duration:2000
+        icon: 'none',
+        duration: 2000
       })
       return
     }
-    if(this.data.password==null||this.data.password==''){
+    if (this.data.password == null || this.data.password == '') {
       wx.showToast({
         title: '请输入密码',
-        icon:'none',
-        duration:2000
+        icon: 'none',
+        duration: 2000
       })
       return
     }
-    let that=this;
-  
+    let that = this;
+
     var data = {
-      userName:this.data.userName,
-      password:this.data.password,
-      openid:this.data.openid,
+      userName: this.data.userName,
+      password: this.data.password,
+      openid: this.data.openid,
     }
     http.post_token("/system/minapp/AppLoginController/bindWxUser", data, that.bindSuccess)
   },
-  
+
   bindSuccess(res) {
     let that = this
     if (res.code != 200) {
@@ -66,16 +66,15 @@ Page({
       // that.setData({
       //   isShowAccoutDialog : true
       // })
-      
+
     } else {
       // that.data.openid = res.openid
-      app.globalToken = res.data.access_token
-      ("登陆成功的令牌:",app.globalToken)
-      wx.setStorageSync('userName', that.data.userName)
-      wx.setStorageSync('password', that.data.password)
-      app.isLoginSuccess=true;
+      app.globalToken = res.data.access_token,
+      wx.setStorageSync('userName', that.data.userName),
+      wx.setStorageSync('password', that.data.password),
+      app.isLoginSuccess = true
       this.setData({
-        isBindSuccess : true
+        isBindSuccess: true,
       })
       wx.reLaunch({
         url: '../index/index',
@@ -83,30 +82,30 @@ Page({
     }
 
   },
-  bindViewUserName(e){
-    this.data.userName = e.detail.value;
+  bindViewUserName(e) {
+    this.data.userName = e.detail.value
   },
-  
-  bindViewPassword(e){
+
+  bindViewPassword(e) {
     this.data.password = e.detail.value
   },
 
-  getOpenIdBywxCode(){
-    let that=this
+  getOpenIdBywxCode() {
+    let that = this
     var data = {
       wxCode: that.data.wxCode,
-    }  
+    }
     http.post_token("/system/minapp/AppLoginController/getSessionKeyOropenid", data, this.openIdSuccess)
   },
-  openIdSuccess(res){
+  openIdSuccess(res) {
     let that = this
-    if (res!=null&&res.openid!=null) {
+    if (res != null && res.openid != null) {
       that.data.openid = res.openid
-     
+
       // wx.setStorageSync('openid', res.openid)
     }
   },
- 
+
 
   /**
    * 生命周期函数--监听页面初次渲染完成
@@ -119,7 +118,7 @@ Page({
    * 生命周期函数--监听页面显示
    */
   onShow() {
-    
+
   },
 
   /**

+ 7 - 9
pages/search/search.js

@@ -13,14 +13,12 @@ Page({
   onLoad() {
   },
   onShow(){
-    this.list(null)
-  },
-  // 搜索结果跳页
-  bindViewSearchEnd() {
-    // wx.navigateTo({
-      // url: '../search/search'
-    // })
+    var obj = new Object()
+    // obj.businessName = e.detail.value
+    obj.searchValue=this.data.keyword,
+    this.list(obj)
   },
+ 
   // 企业详细页
   bindViewDetails(e) {
     let busEnterpriseId = e.currentTarget.dataset.enterpriseid
@@ -31,8 +29,8 @@ Page({
 
   searchEnterprise(e) {
     var obj = new Object()
-    // obj.businessName = e.detail.value
-    obj.searchValue=e.detail.value
+    this.data.keyword=e.detail.value,
+    obj.searchValue=e.detail.value,
     this.list(obj)
   },
 

+ 2 - 2
project.private.config.json

@@ -1,9 +1,9 @@
 {
   "projectname": "sooka_edyj_minapp",
   "setting": {
-    "compileHotReLoad": true,
+    "compileHotReLoad": false,
     "urlCheck": false
   },
   "description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
-  "libVersion": "2.10.4"
+  "libVersion": "2.30.0"
 }