xcx/pages/washer/index/index.js
(开头部分) 1KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
// pages/business/index/index.js
var util = require('../../../utils/util.js');
var api = require('../../../config/api.js');
var user = require('../../../utils/user.js');
var app = getApp();
Page({
/**
* 页面的初始数据
*/
data: {
role: '', //角色
userInfo: {
nickName: '点击登录',
avatarUrl: '../../../image/user/user_img.jpg'
},
hasLogin: false,
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.setData({
role: options.role
});
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
//获取用户的登录信息
if (app.globalData.hasLogin) {
let userInfo = wx.getStorageSync('userInfo');
this.setData({
userInfo: userInfo,
hasLogin: true
});
let that = this;
util.request(api.UserIndex).then(function (res) {
if (res.code === 0) {
console.log(res.data.userWasher)
if(res.data.userWasher==undefined||res.data.userWasher.status===1){
wx.redirectTo({
url: '/pages/washer/apply/apply',
});
}
that.setData({
user: res.data.user,
userWasher: res.data.userWasher,
});
后面还有 40 行代码,购买后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。
