纸板小程序:订单/送货单:列表与详情功能

This commit is contained in:
2026-06-11 11:26:40 +08:00
commit ef9ede1605
2317 changed files with 61642 additions and 0 deletions
+120
View File
@@ -0,0 +1,120 @@
import { getAppInstance } from '../../utils/app'
import { loginWx } from '../../api/index'
import { getCustomerData, getSupplierData } from '../../utils/index'
const app = getAppInstance()
Page({
/**
* 页面的初始数据
*/
data: {
phone: '',
password: '',
showPassword: false
},
/**
* 生命周期函数--监听页面加载
*/
onLoad() {
// this.setData({
// inputWidth: app.globalData.inputWidth,
// inputWidthW: app.globalData.inputWidthW
// })
},
// 登录
async loginFun() {
const { phone, password } = this.data;
if (!phone) {
wx.showToast({title: '请输入手机号',icon: 'none',duration: 1500});
return;
}
if (!password) {
wx.showToast({title: '请输入密码',icon: 'none',duration: 1500});
return;
}
const deviceCode = wx.getStorageSync('deviceCode');
const res = await loginWx({ phone:phone,password:password,deviceCode: deviceCode }).catch( () => {});
console.log(res);
if (res && res.data && res.data.dto) {
let userInfo = res.data.dto;
const deviceInfo = userInfo.listOnlineDevice.find( item => item.code == deviceCode);
userInfo.accesstoken = deviceInfo?deviceInfo.accesstoken:'';
wx.showToast({title: '登录成功',icon: 'none',duration: 1500});
wx.setStorageSync('userInfo',userInfo);
await getCustomerData();
await getSupplierData();
setTimeout(() => {
wx.switchTab({url: '/pages/cardBoardOrder/cardBoardOrder'})
}, 1000);
}
},
// 输入手机号
handlePhoneChange(e: any) {
const value = e.detail.value || '';
this.setData({
phone: value
});
},
// 密码
onPasswordInput(e: any) {
const value = e.detail.value || '';
this.setData({
password: value
});
},
onPasswordIconClick() {
this.setData({
showPassword: !this.data.showPassword
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})