You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

98 lines
1.6 KiB
JavaScript

// pages/production/production.js
import {request} from '../../utils/request'
const app = getApp()
Page({
data: {
optionsRow:[],
options: [],
selectedIndex: 0
},
onChange(e) {
this.setData({
selectedIndex: e.detail.value
})
let id = this.data.optionsRow.map(e=>e.processName = this.data.options[e.detail.value])
console.log(id);
},
onLoad(options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
async onShow() {
const tabBar = this.getTabBar?.()
if (tabBar) {
tabBar.setData({
nowPage: getCurrentPages().at(-1)?.route
})
}
await request({
url: '/auth/login',
method: 'post',
headers: {
isToken: false,
isEncrypt: true,
repeatSubmit: false
},
data: {
username:'admin',
password:'admin123',
clientId:'428a8310cd442757ae699df5d894f051',
grantType: 'password',
rememberMe: false,
tenantId: "000000",
}
}).then(e=>{
app.globalData.token = e.data.access_token
})
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})