新增水滴兑换

This commit is contained in:
2023-07-21 17:22:10 +08:00
parent bcf9fee131
commit d7d54f5009
19 changed files with 732 additions and 207 deletions

View File

@@ -0,0 +1,84 @@
/*
* 手太欠
* 愿这世界都如故事里一样 美好而动人~
*/
Page({
/**
* 页面的初始数据
*/
data: {
barHeight : getApp().globalData.barHeight, // 状态栏高度
address : '', // 地址
addressId : '', // 地址id
dataShow : '', // 数据
exchangesHide: false
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {},
onShow() {
// 水滴兑换商品前置
this.createInfo();
// 水滴兑换商品展示
// this.ShowInfo();
},
/**
* 水滴兑换商品前置
*/
createInfo (){
wx.$api.recruit.exchangesCreate().then(res => {
this.setData({
address : res.data.address,
addressId : res.data.address.address_id
})
}).catch(err => { })
},
/**
* 水滴兑换商品展示
*/
ShowInfo (){
wx.$api.recruit.exchangesShow().then(res => {
this.setData({
dataShow: res.data
})
}).catch(err => { })
},
/**
* 水滴兑换提交
*/
createGo (){
wx.$api.recruit.exchangesPost({address_id: this.data.addressId}).then(res => {
this.setData({
exchangesHide: true
})
}).catch(err => { })
},
// 返回上一页
returnGo() {
wx.navigateBack({
delta: 1
})
},
/**
* 关闭弹框
*/
refertoTap() {
this.setData({
exchangesHide: false
})
wx.redirectTo({
url: '/pages/user/index'
})
}
})