123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138 |
- // pages/homePage/homePage.js
- import {
- get,
- post
- } from '../../utils/http.js'
- Page({
- /**
- * 页面的初始数据
- */
- data: {
- list: [{
- id: 0,
- name: '入库',
- icon: 'https://we-spa.oss-cn-shenzhen.aliyuncs.com/wxrep/warehousing.png',
- },
- {
- id: 1,
- name: '出库',
- icon: 'https://we-spa.oss-cn-shenzhen.aliyuncs.com/wxrep/exWarehouse.png',
- },
- {
- id: 2,
- name: '供应商退货',
- icon: 'https://we-spa.oss-cn-shenzhen.aliyuncs.com/wxrep/supplier.png',
- },
- {
- id: 3,
- name: '客户退货',
- icon: 'https://we-spa.oss-cn-shenzhen.aliyuncs.com/wxrep/customer.png',
- },
- ]
- },
- /**
- * 生命周期函数--监听页面加载
- */
- onLoad(options) {
- this.getPhoneInfo()
- wx.getUserProfile({
- desc: '用于展示', // 声明获取用户个人信息后的用途,后续会展示在弹窗中,请谨慎填写
- success: (res) => {
- console.log(res);
- this.setData({
- userInfo: res.userInfo,
- hasUserInfo: true
- })
- }
- })
- },
- /**
- * 生命周期函数--监听页面初次渲染完成
- */
- onReady() {
- },
- /**
- * 生命周期函数--监听页面显示
- */
- onShow() {
- },
- /**
- * 生命周期函数--监听页面隐藏
- */
- onHide() {
- },
- /**
- * 生命周期函数--监听页面卸载
- */
- onUnload() {
- },
- /**
- * 页面相关事件处理函数--监听用户下拉动作
- */
- onPullDownRefresh() {
- },
- /**
- * 页面上拉触底事件的处理函数
- */
- onReachBottom() {
- },
- /**
- * 用户点击右上角分享
- */
- onShareAppMessage() {
- },
- getPhoneInfo(){
- post('get_phone_info', {imei:"356727085900775"}, res => {
- console.log(res);
- })
- },
- onDetails(e){
- let item = e.currentTarget.dataset.item
- if (item!=0) {
- wx.showToast({
- title: '敬请期待!',
- icon: 'none'
- })
- }
- let urls = "/pages/scanCode/scanCode"
- if (item.id==1) {
- urls = ''
- }else if (item.id==2) {
- urls = ''
- }else if (item.id==3) {
- urls = ''
- }
- console.log(item,'eee',urls);
- wx.navigateTo({
- url: urls,
- })
- },
- /**
- * 去入库
- */
- onWarehousing() {
- wx.navigateTo({
- url: '/pages/warehousing/warehousing',
- })
- },
-
- })
|