123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118 |
- // pages/tabber/news/index.js
- const app = getApp()
- Page({
- /**
- * 页面的初始数据
- */
- data: {
- isselect: false,
- selectitem: '',
- selectInfo: "",
- show:false,
- networkid: 0,
- ordernum: 0,
- sealno: '',
- cftext: '',
- externalcabinet: 0,
- spotid: 0,
- },
- /**
- * 生命周期函数--监听页面加载
- */
- onLoad: function (options) {
- this.setData({
- networkid:options.networkid,ordernum:options.ordernum
- })
- class Select {
- in = 1
- getSelet(){
- console.log(2);
- return 10
- }
- }
- var b = new Select();
- console.log(b.getSelet());
- },
- onShow(){
- this.getinfo()
- },
- /**
- * 生命周期函数--监听页面初次渲染完成
- */
- onReady: function () {
-
- },
- gonext(){
- let that = this
- console.log(that.data.cftext)
- wx.navigateTo({
- url: '/pages/signFor/storagenext?network_id='+that.data.selectitem.id+'&device_id='+that.data.ordernum+'&seal_no='+that.data.sealno+'&spout_device_id='+that.data.spotid+'&remark='+that.data.cftext,
- })
- },
- goshow:function(){
- let that = this
- if(this.data.show){
- this.setData({
- show:false
- })
- }else{
- wx.showLoading()
- if(that.data.selectitem!=''){
- app.api.useApi(app.globalData.baseAppUrl + "api/admin/temporary", {
- device_id: that.data.ordernum,
- seal_no:that.data.sealno,
- network_id:that.data.selectitem.id
- }, "post").then(function (res) {
- wx.hideLoading();
- wx.showToast({
- title: res.message.msg,
- icon: 'none'
- })
- if (res.code== 200) {
- that.setData({
- show:true
- })
- that.setData({externalcabinet: res.message.data.external_cabinet,spotid:res.message.data.spot_id})
- }
- }).catch(function (err) {
- console.log(222);
- })
- }else{
- wx.showToast({
- title: '请选择目的地',
- icon: 'none'
- })
- }
- }
- },
- changeisselect(){
- this.setData({isselect: !this.data.isselect})
- },
- chooseselect(e){
- this.setData({selectitem: e.currentTarget.dataset.item})
- this.changeisselect()
- },
- changesealno(e){
- this.setData({sealno:e.detail.value})
- },
- changecftext(e){
- this.setData({cftext:e.detail.value})
- },
- getinfo(){
- let that = this
- app.api.useApi(app.globalData.baseAppUrl + "api/admin/shop_list", {}, "get").then(function (res) {
- wx.hideLoading();
- if (res.code== 200) {
- that.setData({selectInfo:res.message.data})
- }else{
- }
- }).catch(function (err) {
- console.log(222);
- })
- },
- })
|