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.
 

109 lines
2.1 KiB

// pages/order/joinOrder/history/index.js
import commonApi from "../../../../utils/https/common"
Page({
/**
* 页面的初始数据
*/
data: {
oid:null,
id:null,
info:null,
user_id:null
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
commonApi.user_post("team_order/get_team_detail",{
order_id:options.oid
}).then(res=>{
res.data.list.members.reverse()
res.data.list.members.map(item=>{
item.idNew = item.id_number.replace(/^(.{6})(?:\d+)(.{4})$/,"\$1********\$2");
})
this.setData({
info:res.data,
id:options.id,
oid:options.oid,
user_id:wx.getStorageSync('jstrip_userid')
})
})
},
delItem(e){
let item = e.currentTarget.dataset.item,index = e.currentTarget.dataset.index,info = this.data.info,that = this
wx.showModal({
title:"提示",
content:"确定删除该团员吗?",
success:function(res){
if(res.confirm){
commonApi.user_post("team_order/del",{
team_id:item.team_id,
member_id:item.id
}).then(res=>{
if(res.code==1){
wx.showToast({
title: '删除成功',
icon:'success'
})
info.list.members.splice(index,1)
that.setData({
info:info
})
}
})
}
}
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})