1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495 |
- // pages/tabber/builds/index.js
- const app=getApp();
- Page({
- /**
- * 页面的初始数据
- */
- data: {
- intval:"",
- data:""
- },
- bindinput(e){
- this.setData({
- intval:e.detail.value
- })
- },
- binsubmit(){
- wx.navigateTo({
- url:"/pages/tabber/builds/hand_desc/handDesc?pylon_no="+this.data.intval
- })
- },
- onLoad(){
- this.getdata();
- },
- onShow(){
- this.getdata();
- },
- onPullDownRefresh(){
- this.getdata();
- },
- getScancode: function () {
- var _this = this;
- // 允许从相机和相册扫码
- wx.scanCode({
- onlyFromCamera: true,
- scanType: ['barCode', 'qrCode', 'datamatrix', 'pdf417'],
- success: (res) => {
- console.log(res);
- var result = res.result;
- _this.setData({
- intval: result,
- })
- wx.navigateTo({
- url:"/pages/tabber/builds/hand_desc/handDesc?pylon_no="+result
- })
- },
- fail: (err) => {
-
- console.log(err);
- }
- })
-
- },
- getdata(result=""){
- var that = this;
- app.api.useApi(app.globalData.baseAppUrl + "api/admin/sorting/hand", {
-
- }, "get").then(function (res) {
- console.log(res);
- wx.stopPullDownRefresh()
- if (res.code != 200) {
- wx.showLoading({
- title: res.message.msg,
- })
- setTimeout(function () {
- wx.hideLoading();
- }, 1000);
-
- } else {
- wx.hideLoading();
- let data = res.message.data
- that.setData({
- data
- })
-
- }
- }).catch(function (err) {
-
- console.log(222);
- })
- },
- gourl(e){
- if(e.currentTarget.dataset.sta<=0){
- wx.showModal({
- title: '提示',
- content: "空挂架"
- })
- }else{
- wx.navigateTo({
- url: '/pages/tabber/builds/hand_desc/handDesc?pylon_no='+ e.currentTarget.dataset.id
- })
- }}
- })
|