| @@ -16,7 +16,6 @@ App({ | |||
| }, | |||
| success(res) { | |||
| res = res.data; | |||
| console.log(res) | |||
| if (res.code == 200) { | |||
| that.globalData.baseInfo = res.data; | |||
| wx.setStorageSync('laomenkuangBaseInfo', res.data) | |||
| @@ -58,11 +57,21 @@ App({ | |||
| } | |||
| }) | |||
| }, | |||
| setUserInfo(userInfo){ | |||
| userInfo.nickname = userInfo.nickName | |||
| userInfo.headimgurl = userInfo.avatarUrl | |||
| return userInfo | |||
| }, | |||
| getInfo: function() { | |||
| this.requestGet('getinfo', "", res => { | |||
| if (res.code == 200) { | |||
| this.globalData.userState = 1; | |||
| this.globalData.storeData=res.data; | |||
| if (res.data.user_info){ | |||
| res.data.user_info.nickName = res.data.user_info.nickname | |||
| res.data.user_info.avatarUrl = res.data.user_info.headimgurl | |||
| } | |||
| this.globalData.userInfo = res.data.user_info; | |||
| } else { | |||
| this.globalData.userState = 0; | |||
| } | |||
| @@ -84,8 +84,6 @@ Page({ | |||
| state: state | |||
| }) | |||
| }) | |||
| }, | |||
| /** | |||
| * 添加优惠券 | |||
| @@ -6,6 +6,7 @@ Page({ | |||
| * 页面的初始数据 | |||
| */ | |||
| data: { | |||
| phone:'',//手机号 | |||
| isQuerying: false, | |||
| storeName: '', //店名 | |||
| }, | |||
| @@ -102,7 +103,9 @@ Page({ | |||
| * 生命周期函数--监听页面显示 | |||
| */ | |||
| onShow: function() { | |||
| this.setData({ | |||
| phone:'' | |||
| }) | |||
| }, | |||
| /** | |||
| @@ -6,8 +6,7 @@ | |||
| <view class="fromBox"> | |||
| <image class="arrow" src="../../static/home/arrow.png"></image> | |||
| <form bindsubmit="check"> | |||
| <!-- <input name="code" maxlength="6" placeholder="请输入券码" placeholder-class="inputPlaceholder" style="margin-top:138rpx;" disabled="true" /> --> | |||
| <input name="phone" maxlength="11" placeholder="手机号核销" placeholder-class="inputPlaceholder" style="margin-top:132rpx;" type="number" /> | |||
| <input name="phone" maxlength="11" value="{{phone}}" placeholder="手机号核销" placeholder-class="inputPlaceholder" style="margin-top:132rpx;" type="number" /> | |||
| <button class="btn query {{isQuerying?'select':''}}" form-type="submit">查询</button> | |||
| <button class="btn scanning" bindtap="scanCode">点击扫描核销</button> | |||
| </form> | |||
| @@ -6,6 +6,7 @@ Page({ | |||
| * 页面的初始数据 | |||
| */ | |||
| data: { | |||
| showLogin:false, | |||
| isLoginIng: false, | |||
| canIUse: wx.canIUse('button.open-type.getUserInfo'), | |||
| hasUserInfo: false, | |||
| @@ -65,6 +66,7 @@ Page({ | |||
| * 生命周期函数--监听页面加载 | |||
| */ | |||
| onLoad: function(options) { | |||
| var that=this; | |||
| wx.hideShareMenu(); | |||
| if (app.globalData.userInfo) { | |||
| this.setData({ | |||
| @@ -99,6 +101,10 @@ Page({ | |||
| wx.switchTab({ | |||
| url: '../home/home' | |||
| }) | |||
| }else{ | |||
| that.setData({ | |||
| showLogin:true | |||
| }) | |||
| } | |||
| } | |||
| } | |||
| @@ -112,7 +118,8 @@ Page({ | |||
| hasUserInfo: true | |||
| }) | |||
| if (e.detail.userInfo){ | |||
| app.requestPost('submit', e.detail.userInfo,res=>{ | |||
| var userInfo = app.setUserInfo(e.detail.userInfo) | |||
| app.requestPost('submit', userInfo,res=>{ | |||
| console.log(res) | |||
| }) | |||
| } | |||
| @@ -1,5 +1,5 @@ | |||
| <!--pages/login/login.wxml--> | |||
| <view class="container"> | |||
| <view class="container" wx:if="{{showLogin}}"> | |||
| <image class="bg" src="../../static/login/bg.jpg" mode="aspectFill"></image> | |||
| <image class="logo" src="../../static/login/logo.png"></image> | |||
| <view class="fromBox"> | |||
| @@ -9,7 +9,7 @@ Page({ | |||
| userInfo: null, | |||
| canIUse: wx.canIUse('button.open-type.getUserInfo'), | |||
| hasUserInfo: false, | |||
| userNo: '000001', //员工编号 | |||
| userNo: '', //员工编号 | |||
| showIndex: 1, | |||
| data: [], | |||
| }, | |||
| @@ -56,7 +56,9 @@ Page({ | |||
| } | |||
| }) | |||
| } | |||
| // console.log(app.globalData.userInfo) | |||
| this.setData({ | |||
| userNo: app.globalData.storeData.account_id | |||
| }) | |||
| }, | |||
| /** | |||
| * 获取头像昵称 | |||
| @@ -68,7 +70,8 @@ Page({ | |||
| userInfo: e.detail.userInfo, | |||
| hasUserInfo: true | |||
| }) | |||
| app.requestPost('submit', e.detail.userInfo, res => { | |||
| var userInfo = app.setUserInfo(e.detail.userInfo) | |||
| app.requestPost('submit', userInfo, res => { | |||
| console.log(res) | |||
| }) | |||
| } | |||
| @@ -28,6 +28,7 @@ Page({ | |||
| this.setData({ | |||
| key: "" | |||
| }) | |||
| this.search() | |||
| }, | |||
| /** | |||
| * 输入内容改变 | |||
| @@ -60,10 +61,12 @@ Page({ | |||
| openLocation(e){ | |||
| var latitude = parseFloat(e.currentTarget.dataset.latitude); | |||
| var longitude = parseFloat(e.currentTarget.dataset.longitude); | |||
| var shopName = e.currentTarget.dataset.name; | |||
| wx.openLocation({ | |||
| latitude: latitude, | |||
| longitude: longitude, | |||
| scale: 18, | |||
| name: shopName | |||
| }) | |||
| }, | |||
| /** | |||
| @@ -23,7 +23,7 @@ | |||
| </view> | |||
| </view> | |||
| <view class="name">{{item.shop_name}}</view> | |||
| <view class="infoBox" data-latitude="{{item.shop_latitude}}" data-longitude="{{item.shop_longtitude}}" bindtap="openLocation"> | |||
| <view class="infoBox" data-name="{{item.shop_name}}" data-latitude="{{item.shop_latitude}}" data-longitude="{{item.shop_longtitude}}" bindtap="openLocation"> | |||
| <image class="icon" src="../../static/store/location.png"></image> | |||
| <text>{{item.shop_addr}}</text> | |||
| </view> | |||
| @@ -4,7 +4,7 @@ | |||
| "ignore": [] | |||
| }, | |||
| "setting": { | |||
| "urlCheck": false, | |||
| "urlCheck": true, | |||
| "es6": true, | |||
| "postcss": true, | |||
| "minified": true, | |||