// pages/boss/boss.js
var Api = require('../../utils/api.js');
Page({
data:{
name: '',
address: ''
},
onLoad:function(options){
// 页面初始化 options为页面跳转所带来的参数
this.setData({
token: wx.getStorageSync('token')
})
},
onReady:function(){
// 页面渲染完成
},
onShow:function(){
// 页面显示
this.getInformation()
},
onHide:function(){
// 页面隐藏
},
onUnload:function(){
// 页面关闭
},
//获取公司信息
getInformation: function() {
wx.request({
url: Api.information + this.data.token,
data: {},
method: 'POST',
success: (res) => {
// success
console.log(res)
this.setData({
name: res.data.name,
address: res.data.address,
latitude: res.data.coordinate_latitude,
longitude: res.data.coordinate_longitude
})
},
fail: function() {
// fail
},
complete: function() {
// complete
}
})
},
//去修改公司名称
toCompanyName: function() {
wx.navigateTo({
url: '/pages/name/name?name=' + this.data.name,
})
},
//去修改公司地理位置
toAddress: function() {
wx.navigateTo({
url: '/pages/address/address?address=' + this.data.address,
})
},
//去修改考勤时间
toAttendance: function() {
wx.navigateTo({
url: '/pages/attendance/attendance',
})
},
//精准定位
handleUpdateLocation: function() {
this.updateLocation(() => {
wx.showToast({
title: '更新成功',
icon: 'success'
})
this.getInformation()
})
},
//更新地理位置信息
updateLocation: function(cb) {
wx.getLocation({
type: 'wgs84', // 默认为 wgs84 返回 gps 坐标,gcj02 返回可用于 wx.openLocation 的坐标
success: (res) => {
// 更新经度纬度
wx.request({
url: Api.information + this.data.token,
data: {
latitude: res.latitude,
longitude: res.longitude
},
method: 'POST',
success: (res) => {
typeof cb == 'function' && cb()
}
})
}
})
},
//生产二维码
getQRCode: function() {
wx.showModal({
title: '提示',
content: '请在公司打卡位置生成二维码',
success: (res) => {
if (res.confirm) {
console.log('用户点击确定')
this.updateLocation(() => {
wx.request({
url: Api.qrcode + this.data.token,
data: {},
method: 'GET',
success: (res) => {
wx.navigateTo({
url: '/pages/qrcode/qrcode?QRCodeUrl=' + res.data.QRCodeUrl
+ '&name=' + this.data.name
+ '&address=' + this.data.address,
})
}
})
})
}
}
})
},
//申请列表
toApplyList: function() {
wx.navigateTo({
url: '/pages/applylist/applylist',
})
},
//解散企业
dissolveCompany: function() {
wx.showModal({
title: '警告',
content: '解散企业会清空所有信息,您确定要解散企业吗?',
success: (res) => {
if (res.confirm) {
wx.request({
url: Api.deleteCompany + this.data.token,
data: {},
method: 'DELETE',
success: function(res){
// success
console.log(res)
if(res.statusCode == 200) {
wx.showToast({
title: '解散成功',
icon: 'success'
})
wx.setStorage({
key: 'userType',
data: res.data.types,
success: function(res){
// success
wx.redirectTo({ url: '/pages/select/select', })
}
})
}
else {
wx.showModal({
title: '提示',
content: '解散企业失败,请稍后再试'
})
}
}
})
}
}
})
},
feedback: function() {
wx.navigateTo({
url: '/pages/feedback/feedback',
})
}
})
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
微信小程序开发-打卡签到案例源码.zip (118个子文件)
boss.js 4KB
scan.js 4KB
signMemo.js 3KB
create.js 3KB
util.js 3KB
api.js 3KB
self.js 2KB
login.js 2KB
workers.js 2KB
attendance.js 2KB
code.js 2KB
confirm.js 2KB
applylist.js 2KB
address.js 1KB
name.js 1KB
list.js 1011B
success.js 996B
fail.js 663B
feedback.js 547B
select.js 527B
qrcode.js 515B
audit.js 486B
editName.js 418B
unAuth.js 335B
app.js 69B
app.json 1KB
audit.json 45B
address.json 2B
success.json 2B
login.json 2B
feedback.json 2B
signMemo.json 2B
editName.json 2B
applylist.json 2B
unAuth.json 2B
confirm.json 2B
fail.json 2B
workers.json 2B
qrcode.json 2B
attendance.json 2B
select.json 2B
self.json 2B
code.json 2B
list.json 2B
boss.json 2B
scan.json 2B
name.json 2B
create.json 2B
background.png 138KB
error.png 93KB
wechat.png 51KB
staff.png 40KB
noquick.png 36KB
signoff.png 31KB
signOk.png 30KB
company.png 21KB
sent.png 18KB
nosign.png 12KB
homeHL.png 4KB
home.png 3KB
location.png 3KB
business-HL.png 2KB
time.png 2KB
code.png 2KB
check-HL.png 2KB
bussiness.png 2KB
check.png 2KB
go.png 1KB
more.png 862B
down.png 792B
boss.wxml 2KB
workers.wxml 1KB
attendance.wxml 1KB
applylist.wxml 1KB
signMemo.wxml 1KB
create.wxml 973B
scan.wxml 846B
self.wxml 828B
success.wxml 806B
login.wxml 550B
qrcode.wxml 488B
select.wxml 461B
confirm.wxml 433B
list.wxml 417B
fail.wxml 352B
address.wxml 328B
wokers-item.wxml 325B
name.wxml 309B
editName.wxml 308B
unAuth.wxml 298B
audit.wxml 249B
feedback.wxml 131B
company-item.wxml 106B
code.wxml 30B
signMemo.wxss 3KB
create.wxss 2KB
workers.wxss 1KB
scan.wxss 1KB
applylist.wxss 1KB
success.wxss 1KB
共 118 条
- 1
- 2
芝麻粒儿
- 粉丝: 5w+
- 资源: 2万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
- 3
- 4
- 5
- 6
前往页