接单部分完成

This commit is contained in:
Ling53666
2025-05-15 09:40:36 +08:00
parent bb84973913
commit 9b8553930b
37 changed files with 611 additions and 265 deletions

View File

@ -1,66 +1,66 @@
// pages/woyaojiedan/woyaojiedan.js
import {url} from '../../request'
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
onLoad(options){
const id = options.id
this.setData({
id:id
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
name(e){
this.setData({
name:e.detail.value
})
console.log(e.detail.value);
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
phone(e){
this.setData({
phone:e.detail.value
})
console.log(e.detail.value);
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
submit(){
const that = this
wx.getStorage({
key: "logmessage",
success(res) {
const userinfo = res.data.Authorization
wx.request({
url: url + '/promoCodeApply/apply',
method: 'POST',
data: {
"salespersonName": that.data.name,
"salespersonPhone": that.data.phone,
"projectId": that.data.id
},
header: {
'content-type': 'application/json',
'Authorization': userinfo
},
success(res) {
console.log('提交成功', res);
if(res.data.code==1){
wx.showToast({
title: res.data.message,
icon: 'sucess',
duration: 2000
})
}else{
wx.showToast({
title: res.data.message,
icon: 'error',
duration: 2000
})
}
},
fail(err) {
console.error('请求失败', err);
}
});
}
})
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})