Browse Source

更新

master
wuwenjie 5 years ago
parent
commit
ab25655c6d
25 changed files with 35 additions and 13 deletions
  1. +10
    -1
      app.js
  2. +0
    -2
      pages/coupon/coupon.js
  3. +4
    -1
      pages/home/home.js
  4. +1
    -2
      pages/home/home.wxml
  5. +8
    -1
      pages/login/login.js
  6. +1
    -1
      pages/login/login.wxml
  7. +6
    -3
      pages/record/record.js
  8. +3
    -0
      pages/store/store.js
  9. +1
    -1
      pages/store/store.wxml
  10. +1
    -1
      project.config.json
  11. BIN
      static/coupon/Coupon1.png
  12. BIN
      static/coupon/couponIcon.png
  13. BIN
      static/coupon/logo.png
  14. BIN
      static/coupon/txt.png
  15. BIN
      static/home/arrow.png
  16. BIN
      static/home/logo.png
  17. BIN
      static/login/logo.png
  18. BIN
      static/store/location.png
  19. BIN
      static/store/phone.png
  20. BIN
      static/tabBar/home0.png
  21. BIN
      static/tabBar/home1.png
  22. BIN
      static/tabBar/record0.png
  23. BIN
      static/tabBar/record1.png
  24. BIN
      static/tabBar/store0.png
  25. BIN
      static/tabBar/store1.png

+ 10
- 1
app.js View File

}, },
success(res) { success(res) {
res = res.data; res = res.data;
console.log(res)
if (res.code == 200) { if (res.code == 200) {
that.globalData.baseInfo = res.data; that.globalData.baseInfo = res.data;
wx.setStorageSync('laomenkuangBaseInfo', res.data) wx.setStorageSync('laomenkuangBaseInfo', res.data)
} }
}) })
}, },
setUserInfo(userInfo){
userInfo.nickname = userInfo.nickName
userInfo.headimgurl = userInfo.avatarUrl
return userInfo
},
getInfo: function() { getInfo: function() {
this.requestGet('getinfo', "", res => { this.requestGet('getinfo', "", res => {
if (res.code == 200) { if (res.code == 200) {
this.globalData.userState = 1; this.globalData.userState = 1;
this.globalData.storeData=res.data; 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 { } else {
this.globalData.userState = 0; this.globalData.userState = 0;
} }

+ 0
- 2
pages/coupon/coupon.js View File

state: state state: state
}) })
}) })

}, },
/** /**
* 添加优惠券 * 添加优惠券

+ 4
- 1
pages/home/home.js View File

* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
phone:'',//手机号
isQuerying: false, isQuerying: false,
storeName: '', //店名 storeName: '', //店名
}, },
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow: function() { onShow: function() {

this.setData({
phone:''
})
}, },


/** /**

+ 1
- 2
pages/home/home.wxml View File

<view class="fromBox"> <view class="fromBox">
<image class="arrow" src="../../static/home/arrow.png"></image> <image class="arrow" src="../../static/home/arrow.png"></image>
<form bindsubmit="check"> <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 query {{isQuerying?'select':''}}" form-type="submit">查询</button>
<button class="btn scanning" bindtap="scanCode">点击扫描核销</button> <button class="btn scanning" bindtap="scanCode">点击扫描核销</button>
</form> </form>

+ 8
- 1
pages/login/login.js View File

* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
showLogin:false,
isLoginIng: false, isLoginIng: false,
canIUse: wx.canIUse('button.open-type.getUserInfo'), canIUse: wx.canIUse('button.open-type.getUserInfo'),
hasUserInfo: false, hasUserInfo: false,
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function(options) { onLoad: function(options) {
var that=this;
wx.hideShareMenu(); wx.hideShareMenu();
if (app.globalData.userInfo) { if (app.globalData.userInfo) {
this.setData({ this.setData({
wx.switchTab({ wx.switchTab({
url: '../home/home' url: '../home/home'
}) })
}else{
that.setData({
showLogin:true
})
} }
} }
} }
hasUserInfo: true hasUserInfo: true
}) })
if (e.detail.userInfo){ 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) console.log(res)
}) })
} }

+ 1
- 1
pages/login/login.wxml View File

<!--pages/login/login.wxml--> <!--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="bg" src="../../static/login/bg.jpg" mode="aspectFill"></image>
<image class="logo" src="../../static/login/logo.png"></image> <image class="logo" src="../../static/login/logo.png"></image>
<view class="fromBox"> <view class="fromBox">

+ 6
- 3
pages/record/record.js View File

userInfo: null, userInfo: null,
canIUse: wx.canIUse('button.open-type.getUserInfo'), canIUse: wx.canIUse('button.open-type.getUserInfo'),
hasUserInfo: false, hasUserInfo: false,
userNo: '000001', //员工编号
userNo: '', //员工编号
showIndex: 1, showIndex: 1,
data: [], data: [],
}, },
} }
}) })
} }
// console.log(app.globalData.userInfo)
this.setData({
userNo: app.globalData.storeData.account_id
})
}, },
/** /**
* 获取头像昵称 * 获取头像昵称
userInfo: e.detail.userInfo, userInfo: e.detail.userInfo,
hasUserInfo: true hasUserInfo: true
}) })
app.requestPost('submit', e.detail.userInfo, res => {
var userInfo = app.setUserInfo(e.detail.userInfo)
app.requestPost('submit', userInfo, res => {
console.log(res) console.log(res)
}) })
} }

+ 3
- 0
pages/store/store.js View File

this.setData({ this.setData({
key: "" key: ""
}) })
this.search()
}, },
/** /**
* 输入内容改变 * 输入内容改变
openLocation(e){ openLocation(e){
var latitude = parseFloat(e.currentTarget.dataset.latitude); var latitude = parseFloat(e.currentTarget.dataset.latitude);
var longitude = parseFloat(e.currentTarget.dataset.longitude); var longitude = parseFloat(e.currentTarget.dataset.longitude);
var shopName = e.currentTarget.dataset.name;
wx.openLocation({ wx.openLocation({
latitude: latitude, latitude: latitude,
longitude: longitude, longitude: longitude,
scale: 18, scale: 18,
name: shopName
}) })
}, },
/** /**

+ 1
- 1
pages/store/store.wxml View File

</view> </view>
</view> </view>
<view class="name">{{item.shop_name}}</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> <image class="icon" src="../../static/store/location.png"></image>
<text>{{item.shop_addr}}</text> <text>{{item.shop_addr}}</text>
</view> </view>

+ 1
- 1
project.config.json View File

"ignore": [] "ignore": []
}, },
"setting": { "setting": {
"urlCheck": false,
"urlCheck": true,
"es6": true, "es6": true,
"postcss": true, "postcss": true,
"minified": true, "minified": true,

BIN
static/coupon/Coupon1.png View File

Before After
Width: 750  |  Height: 300  |  Size: 86KB Width: 750  |  Height: 300  |  Size: 86KB

BIN
static/coupon/couponIcon.png View File

Before After
Width: 513  |  Height: 200  |  Size: 9.9KB Width: 513  |  Height: 200  |  Size: 5.9KB

BIN
static/coupon/logo.png View File

Before After
Width: 155  |  Height: 110  |  Size: 4.8KB Width: 155  |  Height: 110  |  Size: 4.7KB

BIN
static/coupon/txt.png View File

Before After
Width: 34  |  Height: 70  |  Size: 1.8KB Width: 34  |  Height: 70  |  Size: 705B

BIN
static/home/arrow.png View File

Before After
Width: 33  |  Height: 12  |  Size: 1.0KB Width: 33  |  Height: 12  |  Size: 291B

BIN
static/home/logo.png View File

Before After
Width: 314  |  Height: 221  |  Size: 16KB Width: 314  |  Height: 221  |  Size: 10.0KB

BIN
static/login/logo.png View File

Before After
Width: 445  |  Height: 486  |  Size: 11KB Width: 445  |  Height: 486  |  Size: 11KB

BIN
static/store/location.png View File

Before After
Width: 24  |  Height: 24  |  Size: 1.6KB Width: 24  |  Height: 24  |  Size: 811B

BIN
static/store/phone.png View File

Before After
Width: 41  |  Height: 40  |  Size: 1.7KB Width: 41  |  Height: 40  |  Size: 1.2KB

BIN
static/tabBar/home0.png View File

Before After
Width: 81  |  Height: 81  |  Size: 5.4KB Width: 81  |  Height: 81  |  Size: 4.7KB

BIN
static/tabBar/home1.png View File

Before After
Width: 81  |  Height: 81  |  Size: 5.4KB Width: 81  |  Height: 81  |  Size: 4.7KB

BIN
static/tabBar/record0.png View File

Before After
Width: 81  |  Height: 81  |  Size: 3.8KB Width: 81  |  Height: 81  |  Size: 3.5KB

BIN
static/tabBar/record1.png View File

Before After
Width: 81  |  Height: 81  |  Size: 3.8KB Width: 81  |  Height: 81  |  Size: 3.5KB

BIN
static/tabBar/store0.png View File

Before After
Width: 81  |  Height: 81  |  Size: 4.3KB Width: 81  |  Height: 81  |  Size: 3.9KB

BIN
static/tabBar/store1.png View File

Before After
Width: 81  |  Height: 81  |  Size: 4.3KB Width: 81  |  Height: 81  |  Size: 3.9KB

Loading…
Cancel
Save