首页 > 编程知识 正文

抽签指定 小程序,随机抽签的微信小程序

时间:2023-05-04 03:50:05 阅读:279341 作者:1296

微信小程序-001-抽签功能-005-查找房间

目录 一、wxml二、js
pages.chouqian.searchroom.searchroom

一、wxml <form bindsubmit="croom" bindreset="formReset"><text>n</text><text>n</text><view class="center"><view >搜索活动ID:</view><text>n</text><text>n</text></view><view class="center"><text>n</text> <input maxlength="9999" placeholder=" 活动ID " name="rid" placeholder-style="color:#4169E1" placeholder-class="placeholderStyle" style='box-shadow: 0 0 2rpx #272727' /></view><text>n</text><text>n</text><button formType="submit">提交</button></form><text>n</text><text>n</text> 二、js Page({ /** * 页面的初始数据 */ data: { items: [], rid: '', }, onShareAppMessage: function () {}, croom: function (e) { var that = this; var rid = e.detail.value.rid; wx.setStorageSync('rid', rid) var value = wx.getStorageSync('wid') if (!value) { var that = this wx.showModal({ title: '提示', content: '你的登录信息过期了,请重新登录', }) //调用登录接口 } else { wx.request({ url: 'https://ancientcloud.club/wx/croom', method: 'GET', data: { rid: rid, }, header: { 'Content-Type': 'application/x-www-form-urlencoded' }, success: function (res) { console.log(res) console.log(res.data) that.setData({ errors: res.data, }) if (res.data == 1) { wx.navigateTo({ url: '../kroom/kroom?rid=' + rid }) } else { wx.showModal({ title: '提示', content: '活动不存在', }) } }, fail: function (e) { wx.showToast({ title: '服务器错误', duration: 2000 }); } }) } }})

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。