ソースを参照

[码参数][增加]:[码参数接口的修改]

tags/江西版6.1.0
meo 6年前
コミット
4b6ef7d4ad
4個のファイルの変更23行の追加1行の削除
  1. +1
    -0
      app.js
  2. +5
    -1
      config/config.js
  3. +3
    -0
      pages/index/index.js
  4. +14
    -0
      pages/user/index.js

+ 1
- 0
app.js ファイルの表示

@@ -105,6 +105,7 @@ App({
} }
}, },
globalData: { globalData: {
scene:"",
// token // token
token: null, token: null,
// user openId // user openId


+ 5
- 1
config/config.js ファイルの表示

@@ -289,7 +289,11 @@ var config = {
/** /**
* 用户更新信息 * 用户更新信息
*/ */
updateUserInfo:"/user/updateUserInfo"
updateUserInfo:"/user/updateUserInfo",
/**
* 用户更新scene
*/
updateScene:"/user/updateScene"
}, },
weapp: { weapp: {
AppId: weappId AppId: weappId


+ 3
- 0
pages/index/index.js ファイルの表示

@@ -28,10 +28,12 @@ Page({
that.setData({ that.setData({
scene: 0 scene: 0
}) })
app.globalData.scene = 0;
} else { } else {
that.setData({ that.setData({
scene: decodeURIComponent(options.scene) scene: decodeURIComponent(options.scene)
}); });
app.globalData.scene = decodeURIComponent(options.scene)
that.setData({ that.setData({
newArr: this.data.scene.split(':') newArr: this.data.scene.split(':')
}) })
@@ -347,6 +349,7 @@ Page({
} }
}); });
}, },

getGameOne: function(token, id) { getGameOne: function(token, id) {
let _this = this; let _this = this;
Http.get({ Http.get({


+ 14
- 0
pages/user/index.js ファイルの表示

@@ -70,6 +70,7 @@ Page({
onLoad() { onLoad() {
this.getLocation(); this.getLocation();
this.updateUserInfo(); this.updateUserInfo();
this.updateScene();
}, },
/** /**
* 获得经纬度 * 获得经纬度
@@ -114,6 +115,19 @@ Page({
} }
}) })
}, },
/**
* 用户更新scene
*/
updateScene(){
Http.post({
url: config.api.updateScene,
data: {
scene: app.globalData.scene
}
}).then(res => {
console.log(res)
})
},
/** /**
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */


読み込み中…
キャンセル
保存