12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- //index.js
- //获取应用实例
- const app = getApp()
- Page({
- data: {
- personalInfo: {},
- },
- //事件处理函数
- onLoad: function () {
- let data = app.globalData.userInfo;
- if (data) {
- // 查询省份
- wx.request({
- url: app.globalData.publicUrl + '/api/htyd/xzqh',
- method: "get",
- data: { code: data.province },
- success: (res) => {
- data.province = res.data.data[0].name;
- }
- })
- // 查询市区
- wx.request({
- url: app.globalData.publicUrl + '/api/htyd/xzqh',
- method: "get",
- data: { pcode: data.province },
- success: (res) => {
- let city = res.data.data.find(i => i.code == data.city)
- if (city) data.city = city.name;
- }
- })
- // 查询套餐
- wx.request({
- url: app.globalData.publicUrl + '/api/htyd/set/' + data.set,
- method: "get",
- data: {},
- success: (res) => {
- if (res.data.errcode === 0) {
- data.set = res.data.data.title
- this.setData({ personalInfo: data })
- }
- }
- })
- } else { }
- },
- })
|