jiaqingjiayi-xiaochengxu/甲情_甲意/miniprogram/pages/kehubiaodan/kehubiaodan.js
2024-11-10 15:01:22 +08:00

101 lines
1.7 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

Page({
data: {
array: ['中国', '美国', '巴西', '日本'],
objectArray: [
{
id: 0,
name: '美国',
},
{
id: 1,
name: '中国',
},
{
id: 2,
name: '巴西',
},
{
id: 3,
name: '日本',
},
],
arrIndex: 0,
index: 0,
NAME:'',
NUMBER:'',
ADDRESS:'',
XIANGMU:'',
PERSON:''
},
bindPickerChange(e) {
console.log('picker发送选择改变携带值为', e.detail.value);
this.setData({
index: e.detail.value,
});
},
bindObjPickerChange(e) {
console.log('picker发送选择改变携带值为', e.detail.value);
this.setData({
arrIndex: e.detail.value,
});
},
NAME(e)
{
this.setData({
NAME:e.detail.value
})
},
NUMBER(e)
{
this.setData({
NUMBER:e.detail.value
})
},
ADDRESS(e)
{
this.setData({
ADDRESS:e.detail.value
})
},
XIANGMU(e)
{
this.setData({
XIANGMU:e.detail.value
})
},
PERSON(e)
{
this.setData({
PERSON:e.detail.value
})
},
sumbit(){
my.demo.callFunction({
name:"add01",
data:{
name:this.data.NAME,
number:this.data.NUMBER,
address:this.data.ADDRESS,
type:this.data.type,
person:this.data.type
},
success:function(res){
my.alert({
title: '提交成功',
});
if(res.success === true){
my.navigateTo({
url: '/pages/wodeyuyue/wodeyuyue'
})
}else{
my.alert({
title: '未知错误稍后重试',
});
}
},
})
}
});