Bladeren bron

更新

master
wuwenjie 5 jaren geleden
bovenliggende
commit
ab25655c6d
25 gewijzigde bestanden met toevoegingen van 35 en 13 verwijderingen
  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 Bestand weergeven

@@ -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;
}

+ 0
- 2
pages/coupon/coupon.js Bestand weergeven

@@ -84,8 +84,6 @@ Page({
state: state
})
})

},
/**
* 添加优惠券

+ 4
- 1
pages/home/home.js Bestand weergeven

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

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

/**

+ 1
- 2
pages/home/home.wxml Bestand weergeven

@@ -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>

+ 8
- 1
pages/login/login.js Bestand weergeven

@@ -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
- 1
pages/login/login.wxml Bestand weergeven

@@ -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">

+ 6
- 3
pages/record/record.js Bestand weergeven

@@ -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)
})
}

+ 3
- 0
pages/store/store.js Bestand weergeven

@@ -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
})
},
/**

+ 1
- 1
pages/store/store.wxml Bestand weergeven

@@ -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>

+ 1
- 1
project.config.json Bestand weergeven

@@ -4,7 +4,7 @@
"ignore": []
},
"setting": {
"urlCheck": false,
"urlCheck": true,
"es6": true,
"postcss": true,
"minified": true,

BIN
static/coupon/Coupon1.png Bestand weergeven

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

BIN
static/coupon/couponIcon.png Bestand weergeven

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

BIN
static/coupon/logo.png Bestand weergeven

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

BIN
static/coupon/txt.png Bestand weergeven

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

BIN
static/home/arrow.png Bestand weergeven

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

BIN
static/home/logo.png Bestand weergeven

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

BIN
static/login/logo.png Bestand weergeven

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

BIN
static/store/location.png Bestand weergeven

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

BIN
static/store/phone.png Bestand weergeven

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

BIN
static/tabBar/home0.png Bestand weergeven

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

BIN
static/tabBar/home1.png Bestand weergeven

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

BIN
static/tabBar/record0.png Bestand weergeven

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

BIN
static/tabBar/record1.png Bestand weergeven

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

BIN
static/tabBar/store0.png Bestand weergeven

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

BIN
static/tabBar/store1.png Bestand weergeven

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

Laden…
Annuleren
Opslaan