You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This file contains invisible Unicode characters that may be processed differently from what appears below. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to reveal hidden characters.
// home/pages/dispatch/dispatch.js
const { dispatch , getTenantList } = require ( "../../../api/api" ) ;
Page ( {
data : {
radio : '' ,
name : '' , //名称
listData : [ ] , //列表
} ,
onLoad ( options ) {
this . setData ( {
tenantType : options . tenantType
} ) ;
this . getList ( ) ;
} ,
onReady ( ) {
} ,
onShow ( ) {
} ,
/** 搜索输入事件 **/
keyWordsChange ( e ) {
this . setData ( {
name : e . detail ,
} ) ;
} ,
/** 搜索 **/
keyWordsSearch ( e ) {
this . getList ( ) ;
} ,
/** 客户列表 **/
getList ( ) {
getTenantList ( {
userId : wx . getStorageSync ( 'userId' ) ,
tenantType : this . data . tenantType
} ) . then ( res => {
if ( res . code == 200 ) {
this . setData ( {
listData : JSON . parse ( res . data )
} ) ;
} else {
wx . showToast ( {
title : res . msg ,
icon : 'none'
} )
}
} ) ;
} ,
/** 单选 **/
onChange ( event ) {
this . setData ( {
radio : event . detail ,
} ) ;
console . log ( "执行" , event . detail ) ;
} ,
/** 单行点击 **/
onClick ( event ) {
const { name } = event . currentTarget . dataset ;
this . setData ( {
radio : name ,
} ) ;
} ,
/** 返回 **/
back ( e ) {
wx . navigateBack ( ) ;
} ,
/** 提交 **/
submit ( ) {
if ( ! this . data . radio ) {
wx . showToast ( {
title : '请选择客户' ,
icon : 'none'
} )
return
}
var pages = getCurrentPages ( ) ; // 获取页面栈
var currPage = pages [ pages . length - 1 ] ; // 当前页面
var prevPage = pages [ pages . length - 2 ] ; // 上一个页面
prevPage . setData ( {
// 要设置的值
customId : this . data . radio
} )
prevPage . getCustomDetail ( )
wx . navigateBack ( { delta : 1 } )
// dispatch({
// userId:wx.getStorageSync('userId'),
// entryId:this.data.entryId,
// engineerIds:this.data.radio,
// }).then(res=>{
// if(res.code==200){
// wx.showToast({
// title: '选择成功',
// icon:'none'
// })
// setTimeout(()=>{
// wx.navigateBack();
// },1500);
// }else{
// wx.showToast({
// title: res.msg,
// icon:'none'
// })
// }
// });
} ,
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh ( ) {
} ,
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom ( ) {
} ,
} )