添加状态判断,添加绑定逻辑,调整界面,修改出出账号逻辑.

main
YXQ 2 years ago
parent 99620be5f3
commit 38df1c43bb
  1. 16
      app.js
  2. 72
      pages/about/about.js
  3. 2
      pages/about/about.wxml
  4. 2
      pages/feedback/feedback.wxml
  5. 384
      pages/freiLogistics/freiLogistics.js
  6. 50
      pages/freiLogistics/freiLogistics.wxml
  7. 10
      pages/freiLogistics/freiLogistics.wxss
  8. 18
      pages/handover/handover.js
  9. 6
      pages/handover/handover.wxml
  10. 8
      pages/handover/handover.wxss
  11. 103
      pages/index/index.js
  12. 9
      pages/index/index.wxml
  13. 8
      pages/login/login.js
  14. 34
      pages/meLogistics/meLogistics.js
  15. 4
      pages/meLogistics/meLogistics.wxml
  16. 8
      pages/meLogistics/meLogistics.wxss
  17. 127
      pages/queryfrei/queryfrei.js
  18. 73
      pages/queryfrei/queryfrei.wxml
  19. 14
      pages/queryfrei/queryfrei.wxss
  20. 57
      pages/queryme/queryme.js
  21. 44
      pages/queryme/queryme.wxml
  22. 5
      pages/queryme/queryme.wxss
  23. 127
      pages/querythree/querythree.js
  24. 50
      pages/querythree/querythree.wxml
  25. 13
      pages/querythree/querythree.wxss
  26. 357
      pages/threeLogistics/threeLogistics.js
  27. 45
      pages/threeLogistics/threeLogistics.wxml
  28. 6
      pages/threeLogistics/threeLogistics.wxss
  29. 15
      utils/dateSetting.js
  30. 37
      utils/login.js

@ -3,7 +3,6 @@ App({
onLaunch() {
// 展示本地存储能力
const logs = wx.getStorageSync('logs') || []
logs.unshift(Date.now())
wx.setStorageSync('logs', logs)
// 登录
@ -16,19 +15,21 @@ App({
globalData: {
// 本地环境
baseUrl:'http://192.168.51.22:8201/mall-portal',
baseUrl: 'http://192.168.51.200:8201/mall-portal',
// 线上环境
// baseUrl:'https://portal-api.macrozheng.com',
token: '',
userInfo:{},
bindvx:null
userInfo: {},
bindvx: false,
openid: ''
},
judLogin(){
//如果未登录提示跳转到等级界面
judLogin() {
wx.showModal({
title: '提示',
content: '尊敬的用户您还未登录,请先登录',
confirmText:'去登陆',
content: '您还未登录,请先登录',
confirmText: '去登陆',
complete: (res) => {
if (res.confirm) {
wx.navigateTo({
@ -41,5 +42,4 @@ App({
}
})
},
})

@ -1,25 +1,42 @@
// pages/about/about.js
var request = require('../../utils/http')
var login = require('../../utils/login')
var app = getApp();
Page({
/**
* 页面的初始数据
*/
data: {
username: '立即登录'
username: '立即登录',
isLogin: false, //是否登录
},
//绑定微信
bindWx() {
var isBindWx = ''
var content = ''
if (app.globalData.bindvx) {
//解绑
isBindWx = '解除绑定'
content = '平台账号已经与您微信账号绑定,是否进行解绑定?'
} else {
//绑定
isBindWx = '立刻绑定'
content = '平台账号将与您微信账号绑定,是否进行绑定?'
}
wx.showModal({
title: '绑定微信',
content: '平台账号与微信账号绑定后,可以直接用微信进行登录,是否进行绑定?',
confirmText: '绑定',
content: content,
confirmText: isBindWx,
complete: (res) => {
if (res.confirm) {
wx.login({
success: (res) => {
console.log(res);
},
login.bindWechat({
openid: app.globalData.openid
}).then(res1 => {
console.log('res=' + JSON.stringify(res1));
this.onLoad()
})
}
if (res.cancel) {
@ -27,6 +44,7 @@ Page({
}
}
})
},
//查询跳转
@ -67,12 +85,50 @@ Page({
})
},
//退出登录
outLogin() {
wx.showModal({
title: '提示',
content: '是否确定退出?',
complete: (res) => {
if (res.cancel) {
}
if (res.confirm) {
app.globalData.token = ''
app.globalData.userInfo = {}
this.setData({
isLogin: false,
username: '立即登录'
})
this.onLoad()
}
}
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
request.post('/sso/checkBind/' + app.globalData.openid).then(res2 => {
console.log('检查是否绑定=' + JSON.stringify(res2.data.data));
app.globalData.bindvx = res2.data.data
})
var userInfo = app.globalData.userInfo
console.log('userInfo' + JSON.stringify(app.globalData.userInfo));
if (userInfo != undefined && JSON.stringify(userInfo) != '{}') {
this.setData({
username: userInfo.nickname,
isLogin: true
})
}
},
/**

@ -34,6 +34,6 @@
</view>
</view>
<view class="out">退出登录</view>
<view wx:if="{{isLogin}}" class="out" bindtap="outLogin">退出登录</view>
</view>

@ -15,7 +15,7 @@
<view><text style="color: red;">*</text> 上传图片/截图</view>
<view class="addimg">
<block wx:for="{{imageArr}}">
<block wx:for="{{imageArr}}" wx:key="index">
<view wx:if="{{item.isBtn}}" bindtap="{{item.func}}">{{item.text}}</view>
<view wx:else style="display: flex;">
<image bindlongtap="{{item.func}}" src="{{item.text}}" />

@ -1,95 +1,100 @@
//货运物流
var datePicker = require('../../utils/dateSetting')
var request = require('../../utils/http')
var dateUtils = require('../../utils/dateUtils')
Page({
data: {
list:[
{
'id':1,
'number':'2023050002',
'time':'2023-5-12 11:32',
'status':'已签收',
'name':'张三',
'num':'M2023055568'
},
{
'id':2,
'number':'2023050002',
'time':'2023-5-12 11:32',
'status':'已签收',
'name':'李四',
'num':'M2023055568'
selfOrderCode: '', //物流单号
sampleList: [{
'id': 1,
'number': '2023050002',
'time': '2023-5-12 11:32',
'status': '已签收',
'name': '张三',
'num': 'M2023055568'
}
],
pipenum:'',
ins: ['私家车','大巴',],
pipenum: '',
ins: [], //转运方式
insIdx: 0, //转运方式下标
date: '',
start:'2020-01-01',
end:'',
start: '2023-07-01',
end: '',
potoSrc: '../../images/addPoto.png', //默认图片
poto: [], //车辆&转运箱照片 最大长度 4
time: '',
multiArray: [],
multiIndex: [0, 0, 0, 0, 0],
choose_year: "",
srcArray:[]
srcArray: [],
phone: '', //物流电话
boxNum: '', //转运箱号
cost: '', //物流费用
numberplate: '', //车牌号
logisticsMen: '', //物流员
notes: '', //备注
sampleCount: '0', //样本数量
//样本列表
sampleList: [{
'id': 1,
'number': '2023050002',
'time': '2023-5-12 11:32',
'status': '已签收',
'name': '张三',
'num': 'M2023055568'
}],
},
scacode(){
scacode() {
wx.scanCode({
success:(res)=>{
success: (res) => {
console.log(res.result);
this.setData({
pipenum:res.result
pipenum: res.result
})
}
})
},
phot(){
phot() {
wx.chooseMedia({
count: 1,
mediaType: ['image','video'],
mediaType: ['image', 'video'],
sourceType: ['album', 'camera'],
maxDuration: 30,
camera: 'back',
success: res=>{
success: res => {
console.log(this.data.srcI)
console.log(res.tempFiles[0].tempFilePath)
// this.up();
}
})
},
//上传图片接口地址
// up(){
// console.log(this.data.srcI)
// wx.uploadFile({
// filePath: this.data.srcI,
// name: 'file',
// url: '',
// })
// },
bushPhot(){
bushPhot() {
wx.chooseMedia({
count: 1,
mediaType: ['image','video'],
mediaType: ['image', 'video'],
sourceType: ['album', 'camera'],
maxDuration: 30,
camera: 'back',
success: res=>{
success: res => {
// this.up();
}
})
},
boxPhot(){
boxPhot() {
wx.chooseMedia({
count: 1,
mediaType: ['image','video'],
mediaType: ['image', 'video'],
sourceType: ['album', 'camera'],
maxDuration: 30,
camera: 'back',
success: res=>{
success: res => {
// this.up();
}
})
@ -103,10 +108,10 @@ Page({
},
//日期
bindDateChange(e){
bindDateChange(e) {
// console.log(e.detail.value)
this.setData({
date:e.detail.value
date: e.detail.value
})
},
@ -153,12 +158,263 @@ Page({
goDetail(){
goDetail() {
wx.navigateTo({
url: '../details/details',
})
},
//物流车拍照
bushPhot() {
wx.chooseMedia({
count: 1,
mediaType: ['image', 'video'],
sourceType: ['album', 'camera'],
maxDuration: 30,
camera: 'back',
success: res => {
// this.up();
}
})
},
//转运箱拍照
boxPhot(e) {
console.log(e.target.dataset.id);
wx.chooseMedia({
count: 1,
mediaType: ['image', 'video'],
sourceType: ['album', 'camera'],
maxDuration: 30,
camera: 'back',
success: res => {
// this.up();
}
})
},
//物流车、转运箱拍照
photograph(e) {
var potoIdx = 0;
if (e.target.dataset.id == 'car_1') potoIdx = 0
if (e.target.dataset.id == 'car_2') potoIdx = 1
if (e.target.dataset.id == 'box_1') potoIdx = 2
if (e.target.dataset.id == 'box_2') potoIdx = 3
//回显所拍摄照片
var _this = this;
wx.chooseMedia({
count: 1,
mediaType: ['image', 'video'],
sourceType: ['camera'],
sizeType: ['compressed'],
camera: 'back',
success: res => {
_this.upImg(res.tempFiles[0].tempFilePath, potoIdx) //上传照片
}
})
},
//上传照片 imageSrc照片临时路径 potoIdx 点击的哪一个图片框
upImg(imageSrc, potoIdx) {
var _this = this;
request.upImgFile(`/feedBack/upload`, imageSrc).then(res => {
var resObj = JSON.parse(res.data)
console.log('upImgFile data =' + resObj.data.url);
console.log('upImgFile res=' + JSON.stringify(res.data));
if (resObj.code > 400) {
wx.showModal({
title: '提示',
content: resObj.message,
complete: (res) => {
if (res.cancel) {}
if (res.confirm) {}
//上传失败后移除图片
}
})
} else {
//保存图片路径到数组
// this.data.upImageArr.push(resObj.data.url);
_this.data.poto[potoIdx] = resObj.data.url
_this.setData({
poto: _this.data.poto
})
}
});
},
//显示回调图片
addCallBackImage(imageSrc) {
var temp = {
isBtn: false,
imgUrl: imageSrc,
text: imageSrc,
func: "delImage"
};
this.data.imageArr.unshift(temp);
this.setData({
imageArr: this.data.imageArr
});
},
//保存样本信息
saveInfo() {
var temp = this.data;
//处理到达时间
var endTime = dateUtils.customizeDateFormat(temp.time);
if (this.showErrInfo(endTime, '到过时间不可为空')) return
//处理物流车拍照
var carPoto = []
var boxPoto = []
var array = this.data.poto;
for (let index = 0; index < array.length; index++) {
if (index < 2 && array[index] != this.data.potoSrc) {
carPoto.push(array[index])
} else if (array[index] != this.data.potoSrc) {
boxPoto.push(array[index])
}
}
var tempData = {
"barCode": temp.pipenum, //样本条码
"barCodeImg": "", //物流拍照图
"boxNum": temp.boxNum, //转运箱号
"carPics": carPoto.toString(), //物流车图片 逗号分隔
"boxPics": boxPoto.toString(), // 转运箱图片 逗号分隔
"cost": 0, // 物流费用 自建没有
"driverMen": temp.driverMen, //驾驶员
"entryDate": temp.date, // 录入日期
"endDate": '', //startTime
"expectedEndTime": endTime, //预计到达时间 endTime
"institutionName": temp.ins[temp.insIdx].orgName, //送检机构名称
"institutionNo": temp.ins[temp.insIdx].id, //送检机构编号
"logisticsMen": temp.logisticsMen, //物流员
"logisticsNo": temp.selfOrderCode, //物流编号
"logisticsWay": 1, //物流方式 1自建 2第三方 3货运
"notes": temp.notes, // 物流备注
"number": temp.number, // 数量
"numberplate": "", // 车牌号
"phone": "", //物流电话
"startTime": '', //出发时间
"tranType": "1", //物流方式
"unitType": "", //物流单位 1.顺丰 2.京东(自建物流没有该字段)
"updateBy": 0,
"updateTime": ""
}
request.post(`/batch/addTranLogistics`, tempData).then(res => {
console.log(JSON.stringify(res.data));
if (res.data.code == 200) {
//保存成功后,查询底部列表
this.selSampleList();
} else {
wx.showModal({
title: '错误',
content: res.data.message,
showCancel: false,
complete: (res) => {
if (res.confirm) {}
}
})
}
})
},
//查询底部列表数据
selSampleList() {
var reqData = {
'logisticsNo': this.data.selfOrderCode
}
request.post(`/logistics/selectTranLogistics`, reqData).then(res => {
console.log(res.data);
this.setData({
sampleList: res.data.data,
sampleCount: res.data.data.length
})
})
},
//显示必选项为空提示
showErrInfo(field, errInfo) {
if (field === undefined || field.length == 0) {
wx.showToast({
icon: 'error',
title: errInfo,
})
return true;
}
},
//文本输入信息
inputTextInfo(e) {
var data_id = e.target.dataset.id; //组件tag
var value = e.detail.value; //输入的文本
//样本编号
if (data_id == 'barCode') {
this.setData({
pipenum: value
})
}
//数量
if (data_id == 'number') {
this.setData({
number: value
})
}
//转运箱号
if (data_id == 'boxNum') {
this.setData({
boxNum: value
})
}
//车牌号
if (data_id == 'numberplate') {
this.setData({
numberplate: value
})
}
if(data_id == 'phone'){
this.setData({
phone: value
})
}
//物流费用
if (data_id == 'cost') {
this.setData({
cost: value
})
}
//物流员
if (data_id == 'logisticsMen') {
this.setData({
logisticsMen: value
})
}
//驾驶员
if (data_id == 'driverMen') {
this.setData({
driverMen: value
})
}
//备注
if (data_id == 'notes') {
this.setData({
notes: value
})
}
},
/**
* 生命周期函数--监听页面加载
*/
@ -167,11 +423,10 @@ Page({
let year = now.getFullYear(); //获取当前年
let month = now.getMonth() + 1; //获取当前月份
this.setData({
end: '' + year + '-' + (Array(2).join(0) + month).slice(-2) + '-' + (Array(2).join(0) + now.getDate()).slice(-2),//当前的时间
end: '' + year + '-' + (Array(2).join(0) + month).slice(-2) + '-' + (Array(2).join(0) + now.getDate()).slice(-2), //当前的时间
//开始
multiArray:
[
multiArray: [
[year + "年", year + 1 + "年", year + 2 + "年"],
datePicker.determineMonth(),
datePicker.determineDay(year, month),
@ -179,6 +434,37 @@ Page({
datePicker.determineMinute()
],
})
//获取物流单号 1.自建物流 2.第三方物流 3.货运物流
request.get(`/batch/getBatchsNumber?logisticsWay=3`).then(res => {
console.log('getBatchsNumber=' + JSON.stringify(res.data))
if (res.data.code == 200) {
this.setData({
selfOrderCode: res.data.data
})
}
})
//获取送检机构列表
request.get(`/dict/type/tran_method`).then(res => {
var array = res.data.data
var tempArr = []
for (let index = 0; index < array.length; index++) {
tempArr.push(array[index].dictLabel)
}
this.setData({
ins: tempArr
})
//查询物流批次列表
this.selSampleList();
})
//初始化照片按钮
var tempSrc = [this.data.potoSrc, this.data.potoSrc, this.data.potoSrc, this.data.potoSrc]
this.setData({
poto: tempSrc
})
},
/**

@ -1,49 +1,54 @@
<view class="box">
<view class="back">
<view class="top">
<input type="text" value="{{pipenum}}"/>
<input type="number" value="{{pipenum}}" />
<view style="background-color: #eee;" bindtap="scacode">扫 码</view>
<view style="background-color: #23c559; color: #fff;" bindtap="phot">拍 照</view>
<!-- <view style="background-color: #23c559; color: #fff;" bindtap="phot">拍 照</view> -->
</view>
<view class="form">
<view class="from-con">
<label>物流单号:</label>
<input type="text" placeholder="物流单号" disabled="false" placeholder-class="place" value="{{selfOrderCode}}" />
</view>
<picker class="from-con" bindchange="bindPickerChange" value="{{index}}" range="{{ins}}">
<label>转运方式:</label>
<input type="text" disabled="true" placeholder="请选择转运方式" placeholder-class="place" value="{{ins[index]}}"/>
<input type="text" disabled="true" placeholder="请选择转运方式" placeholder-class="place" value="{{ins[index]}}" />
</picker>
<view class="from-con">
<label>转运箱号</label>
<input type="text" placeholder="转运箱号" placeholder-class="place" value=""/>
<input type="text" placeholder="转运箱号" placeholder-class="place" value="" />
</view>
<picker mode="date" value="date" start="start" end="end" bindchange="bindDateChange" class="from-con">
<label>日 期:</label>
<input type="text" disabled="true" placeholder="请选择日期" placeholder-class="place" value="{{date}}"/>
<input type="text" disabled="true" placeholder="请选择日期" placeholder-class="place" value="{{date}}" />
</picker>
<view class="from-con">
<label>物流电话:</label>
<input type="text" placeholder="物流电话" placeholder-class="place"/>
<input type="text" placeholder="物流电话" placeholder-class="place" bindinput="inputTextInfo" data-id="phone" value="{{phone}}"/>
</view>
<view class="from-con">
<label>物流费用:</label>
<input type="text" placeholder="物流费用" placeholder-class="place" value=""/>
<input type="number" placeholder="物流费用" placeholder-class="place" bindinput="inputTextInfo" data-id="cost" value="{{cost}}" />
</view>
<picker class="from-con" mode="multiSelector" bindchange="bindMultiPickerChange" bindcolumnchange="bindMultiPickerColumnChange" value="{{multiIndex}}" range="{{multiArray}}">
<label>到达时间:</label>
<input value='{{time}}' placeholder='请选择到达时间' placeholder-class="place" disabled="true"/>
<input value='{{time}}' placeholder='请选择到达时间' placeholder-class="place" disabled="true" />
</picker>
<view class="from-con">
<label>车牌号:</label>
<input type="text" placeholder="车牌号" placeholder-class="place" value=""/>
<input type="text" placeholder="车牌号" placeholder-class="place" bindinput="inputTextInfo" data-id="numberplate" value="{{numberplate}}" />
</view>
<view class="from-con">
<label>物流员:</label>
<input type="text" placeholder="物流员" placeholder-class="place" value=""/>
<input type="text" bindinput="inputTextInfo" data-id="logisticsMen" placeholder="物流员" placeholder-class="place" value="{{logistician}}" />
</view>
<view class="from-con">
<label>备 注:</label>
<input type="text" placeholder="备注" placeholder-class="place" value=""/>
<input type="text" bindinput="inputTextInfo" data-id="notes" placeholder="备注" placeholder-class="place" value="{{notes}}" />
</view>
</view>
@ -52,30 +57,30 @@
<view class="back">
<view class="bush">
<view style="flex: 1;">物流车拍照</view>
<button bindtap="bushPhot">拍 照</button>
<button bindtap="bushPhot" hidden="true">拍 照</button>
</view>
<view class="bush-img">
<image src="../../images/bush.png"></image>
<image src="../../images/bush.png"></image>
<image bindtap="photograph" src="{{poto[0]}}" data-id="car_1"></image>
<image bindtap="photograph" src="{{poto[1]}}" data-id="car_2"></image>
</view>
</view>
<view class="back">
<view class="bush">
<view style="flex: 1;">转运箱拍照</view>
<button bindtap="boxPhot">拍 照</button>
<button bindtap="boxPhot" hidden="true">拍 照</button>
</view>
<view class="bush-img">
<image src="../../images/bush.png"></image>
<image src="../../images/bush.png"></image>
<image bindtap="photograph" src="{{poto[2]}}" data-id="box_1"></image>
<image bindtap="photograph" src="{{poto[3]}}" data-id="box_2"></image>
</view>
</view>
<view class="back">
<view class="con">
<view style="flex: 1;">总计:200/管数</view>
<button style="background-color: #ddd;">修 改</button>
<button style="color: #fff;">保 存</button>
<view style="flex: 1;">总计:{{sampleCount}}/管数</view>
<button style="background-color: #ddd;" hidden="true">修 改</button>
<button style="color: #fff;" bindtap="saveInfo">保 存</button>
</view>
<scroll-view scroll-x class="tabel">
@ -87,7 +92,7 @@
<view class="td">物流员</view>
<view class="td">物流单号</view>
</view>
<view class="tr" wx:for="{{list}}" wx:key="index" bindtap="goDetail">
<view class="tr" wx:for="{{sampleList}}" wx:key="index" bindtap="goDetail">
<view class="td1">{{item.id}}</view>
<view class="td">{{item.number}}</view>
<view class="td">{{item.time}}</view>
@ -97,5 +102,4 @@
</view>
</scroll-view>
</view>
</view>

@ -2,16 +2,18 @@
.top{
display: flex;
justify-content: center;
justify-content: left;
font-size: 28rpx;
}
.top input{
border: 1rpx #333 solid;
border-radius: 10rpx;
height: 60rpx;
width: 700rpx;
border-radius: 5rpx;
padding: 5rpx 10rpx;
}
.top view{
width: 135rpx;
width: 305rpx;
margin-left: 20rpx;
background-color: #eee;
display: flex;
@ -75,7 +77,7 @@
height: 230rpx;
margin-top: 10rpx;
border: 1rpx solid #999;
/* border-radius: 15rpx; */
border-radius: 15rpx;
}
.back{
margin-top: 15rpx;

@ -17,8 +17,7 @@ Page({
//刷新按钮
refresh() {
this.onLoad()
console.log("123");
this.selTranLogistics()
},
bindDateChange(e) {
@ -35,11 +34,18 @@ Page({
pageSize: 100
}
request.post(`/batch/selectTranLogistics`, reqData).then(res => {
console.log(JSON.stringify(res));
// console.log(JSON.stringify(res));
// this.data.logisticsCodeList = res.data.data
if (res.data.data.length == 0) {
wx.showToast({
title: '物流单列表无数据',
icon: 'error'
})
} else {
this.setData({
logisticsCodeList: res.data.data
})
}
})
},
@ -120,10 +126,14 @@ Page({
let now = new Date(); //获取时间
let year = now.getFullYear(); //获取当前年
let month = now.getMonth() + 1; //获取当前月份
var tempDate = '' + year + '-' + (Array(2).join(0) + month).slice(-2) + '-' + (Array(2).join(0) + now.getDate()).slice(-2);
this.setData({
end: '' + year + '-' + (Array(2).join(0) + month).slice(-2) + '-' + (Array(2).join(0) + now.getDate()).slice(-2),
end: tempDate
}) //当前的时间
this.setData({
date: tempDate
})
this.selTranLogistics()
},

@ -30,9 +30,9 @@
<view class="td">交接人</view>
<view class="td">状态</view>
</view>
<block wx:for="{{sampleList}}" wx:key="idx">
<block wx:for="{{sampleList}}" wx:key="index">
<view class="tr">
<view class="td td1">{{idx+1}}</view>
<view class="td td1">{{index+1}}</view>
<view class="td">{{item.barCode}}</view>
<view class="td">{{item.institutionName}}</view>
<view class="td td2">{{item.entryDate}}</view>
@ -51,7 +51,7 @@
<view class="zan-dialog {{ showDialog ? 'zan-dialog--show' : 'pop_hidden' }}">
<view class="zan-dialog__mask" bindtap="toggleDialog" />
<view class="zan-dialog__container">
<view style='padding:80rpx;'>
<view style='padding:40rpx;'>
<canvas type="2d" class="canvas" id="myQrcode"></canvas>
</view>
</view>

@ -106,7 +106,7 @@
right: 0;
bottom: 0;
z-index: 10;
background: rgba(0, 0, 0, 0);
background: rgba(0, 0, 0, 0.05);
/* 设置阴影半透明背景如: background: rgba(0, 0, 0, 0.4); */
display: none;
}
@ -114,11 +114,11 @@
.zan-dialog__container {
position: fixed;
bottom: 200rpx;
width: 350rpx;
width: 280rpx;
/* 弹窗布局宽 */
height: 300rpx;
height: 280rpx;
/* 弹窗布局高,与下面弹出距离transform有关 */
margin-left: 180rpx;
margin-left: 220rpx;
background: #f8f8f8;
transform: translateY(300%);
/* 弹框弹出距离,与弹框布局高度有关,如300%表示弹起距离为3倍弹窗高度 */

@ -1,5 +1,8 @@
// pages/index/index.js
var request = require('../../utils/http')
import * as echarts from "../../components/echarts/echarts";
var app = getApp();
function initChart(canvas, width, height, dpr) {
const chart = echarts.init(canvas, null, {
width: width,
@ -25,14 +28,13 @@ function initChart(canvas, width, height, dpr) {
xAxis: {
type: 'category',
data: ['一月', '二月', '三月', '四月', '五月', '六月','七月','八月','九月','十一月','十二月']
data: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十一月', '十二月']
},
yAxis: {
type: 'value',
boundaryGap: [0, 0.01]
},
series: [
{
series: [{
name: '核收数',
type: 'bar',
data: [10, 20, 46, 120, 90, 80]
@ -58,30 +60,30 @@ Page({
ec: {
onInit: initChart
},
msg:[], //首页中间消息列表
msg: [], //首页中间消息列表
},
//跳转对应界面
goLogisticsType(e){
goLogisticsType(e) {
var tag = e.currentTarget.dataset.id
var url
//自建物流
if(tag == 'goMelogistics'){
if (tag == 'goMelogistics') {
url = '../meLogistics/meLogistics'
}
//第三方
if(tag == 'goThreelogistics'){
if (tag == 'goThreelogistics') {
url = '../threeLogistics/threeLogistics'
}
//货运
if(tag == 'goLogistics'){
if (tag == 'goLogistics') {
url = '../freiLogistics/freiLogistics'
}
//物流交接
if(tag == 'goHandover'){
if (tag == 'goHandover') {
url = '../handover/handover'
}
wx.navigateTo({
@ -89,13 +91,96 @@ Page({
})
},
//判读是否有token
isHaveToken() {
var token = app.globalData.token
if (token == undefined || token == '') {
app.judLogin();
} else {
console.log('用户已经登录');
console.log(JSON.stringify(token));
}
},
//判断是否绑定了微信
isBindWx(openid) {
request.post(`/sso/checkBind/${openid}`).then(res => {
console.log("是否绑定" + JSON.stringify(res));
if (res.data.data == true) {
//已绑定 获取用户信息
request.get('/sso/info').then(res1 => {
console.log('res1.data.data =' + JSON.stringify(res1.data.data));
app.globalData.userInfo = res1.data.data
// console.log(app.globalData.userInfo);
})
} else {
//未绑定 提示登录
app.judLogin();
}
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
if (app.globalData.userInfo == undefined) {
//获取code
wx.login({
success: res => {
// 发送 res.code 到后台换取 openId
request.get(`/wx/getOpenid?code=${res.code}`).then(res1 => {
//记录OpenID
app.globalData.openid = res1.data.openid
this.isBindWx(res1.data.openid)
})
}
})
//检查是否绑定
// request.post('/sso/checkBind/' + app.globalData.openid).then(res2 => {
// console.log('检查是否绑定=' + JSON.stringify(res2.data.data));
// app.globalData.bindvx = res2.data.data
// })
}
wx.login({
success: res => {
// 发送 res.code 到后台换取 openId, sessionKey, unionId
request.get(`/wx/getOpenid?code=${res.code}`).then(res1 => {
//记录OpenID
app.globalData.openid = res1.data.openid
this.isBindWx(res1.data.openid)
})
// console.log(JSON.stringify(res));
// if (res.errMsg == 'login:ok') {
// request.post(`/sso/checkBind/` + res.code).then(res => {
// console.log('res=' + JSON.stringify(res));
// if (res.data.code != 200) {
// //未绑定
// app.judLogin();
// } else {
// //已绑定 设置token 与 用户信息
// }
// })
// } else {
// wx.showToast({
// title: res.errMsg,
// icon: 'error'
// })
// }
}
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/

@ -1,8 +1,5 @@
<!--pages/index/index.wxml-->
<swiper class="banner" autoplay="true" interval="4000" circular="true" indicator-dots='true'>
<swiper-item>
<image src="../../images/banner.png" />
</swiper-item>
<swiper hidden="true" class="banner" autoplay="true" interval="4000" circular="true" indicator-dots='true'>
<swiper-item>
<image src="../../images/banner.png" />
</swiper-item>
@ -12,7 +9,7 @@
<view style="padding: 20rpx;">
<view class="back">
<view class="produck-type" >
<view class="produck-type">
<view class="item" bindtap="goLogisticsType" data-id="goMelogistics">
<image src="../../images/自建物流.png"></image>
<view>自建物流</view>
@ -33,6 +30,4 @@
<view class="ec-container">
<ec-canvas canvas-id="echart-pie" ec="{{ec}}"></ec-canvas>
</view>
</view>

@ -8,8 +8,8 @@ Page({
* 页面的初始数据
*/
data: {
username: "member", //账号
userpwd: "member123", //密码
username: "yuexiangqian", //账号
userpwd: "123456", //密码
},
getUsername(e) {
this.setData({
@ -27,14 +27,14 @@ Page({
console.log(res);
if (res.data.code == 200) {
app.globalData.token = res.data.data.tokenHead + res.data.data.token;
request.get('/sso/info').then(res2 => {
app.globalData.userInfo = res2.data.data
wx.showToast({
title: '登陆成功'
})
wx.reLaunch({
url: '../about/about'
});
request.get('/sso/info').then(res2 => {
app.globalData.userInfo = res2.data.data
})
}
})

@ -1,7 +1,8 @@
// pages/meLogistics/meLogistics.js
const datePicker = require('../../utils/dateSetting')
const request = require('../../utils/http')
const dateUtils = require('../../utils/dateUtils')
//自建物流
var datePicker = require('../../utils/dateSetting')
var request = require('../../utils/http')
var dateUtils = require('../../utils/dateUtils')
//设定当前的时间,将其设定为常量
Page({
@ -33,7 +34,7 @@ Page({
number: '', //数量
notes: '', //备注
driverMen: '', //驾驶员
srcArray: [], //样本组?
// srcArray: [], //样本组?
potoSrc: '../../images/addPoto.png', //默认图片
poto: [], //车辆&转运箱照片 最大长度 4
tableArr: [], //扫码表数据
@ -46,24 +47,7 @@ Page({
'status': '已签收',
'name': '张三',
'num': 'M2023055568'
},
{
'id': 2,
'number': '2023050002',
'time': '2023-5-12 11:32',
'status': '已签收',
'name': '李四',
'num': 'M2023055568'
},
{
'id': 3,
'number': '2023050002',
'time': '2023-5-12 11:32',
'status': '已签收',
'name': '李四',
'num': 'M2023055568'
}
],
}],
},
//调用摄像头
@ -355,7 +339,7 @@ Page({
},
//显示必选项为空提示
showErrInfo(field, errInfo){
showErrInfo(field, errInfo) {
if (field === undefined || field.length == 0) {
wx.showToast({
icon: 'error',
@ -373,8 +357,8 @@ Page({
//处理到达时间
var endTime = dateUtils.customizeDateFormat(temp.time1);
if(this.showErrInfo(startTime, '出发时间不可为空')) return
if(this.showErrInfo(endTime, '到过时间不可为空')) return
if (this.showErrInfo(startTime, '出发时间不可为空')) return
if (this.showErrInfo(endTime, '到过时间不可为空')) return
//处理物流车拍照
var carPoto = []

@ -5,7 +5,7 @@
<view class="top">
<input type="text" bindinput="inputTextInfo" data-id="barCode" value="{{pipenum}}" />
<view style="background-color: #eee;" bindtap="scacode">扫 码</view>
<view style="background-color: #23c559; color: #fff;" bindtap="phot">拍 照</view>
<!-- <view style="background-color: #23c559; color: #fff;" bindtap="phot" hidden="true">拍 照</view> -->
</view>
<view class="form">
@ -86,7 +86,7 @@
<view class="back">
<view class="con">
<view style="flex: 1;">总计:{{sampleCount}}/管数</view>
<button style="background-color: #ddd;">修 改</button>
<button style="background-color: #ddd;" hidden="ture">修 改</button>
<button style="color: #fff;" bindtap="saveInfo">保 存</button>
</view>

@ -2,16 +2,18 @@
.top{
display: flex;
justify-content: center;
justify-content: left;
font-size: 28rpx;
}
.top input{
border: 1rpx #333 solid;
border-radius: 10rpx;
height: 60rpx;
width: 700rpx;
border-radius: 5rpx;
padding: 5rpx 10rpx;
}
.top view{
width: 135rpx;
width: 305rpx;
margin-left: 20rpx;
background-color: #eee;
display: flex;

@ -1,53 +1,140 @@
// pages/queryfrei/queryfrei.js
var app = getApp();
//货运物流查询
const request = require('../../utils/http')
Page({
/**
* 页面的初始数据
*/
data: {
date: '',
endDate:'',
start:'2020-01-01',
end:'',
array: ['全部','xx卫生院','xx门诊',],
date: '', //开始时间
endDate: '',
start: '2023-01-01',
end: '',
logisticsNo: '', //物流单号
ins: [],
insName: '', //机构名称
insIdx: '', //默认机构所选下标
logisticsMen: '', //物流员
boxNum: '', //转运箱号
sampleList: [], //查询列表
sampleCount: '', //查询记录总数
},
//开始时间
bindDateChange(e){
bindDateChange(e) {
// console.log(e.detail.value)
this.setData({
date:e.detail.value
date: e.detail.value
})
},
//结束时间
bindDateChangeend(e){
bindDateChangeend(e) {
// console.log(e.detail.value)
this.setData({
endDate:e.detail.value
endDate: e.detail.value
})
},
bindPickerChange (e) {
// console.log( e.detail.value)
//物流员
bindLogisticsMen(e) {
this.setData({
index: e.detail.value
logisticsMen: e.detail.value
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
//转运箱号
bindBoxNum(e) {
this.setData({
boxNum: e.detail.value
})
},
//送检机构
bindPickerChange(e) {
this.setData({
insName: this.data.ins[e.detail.value],
insIdx: e.detail.value
})
},
//获取物流单号
getLogisticsNo(e) {
this.setData({
logisticsNo: e.detail.value
})
},
//查询底部列表数据
selSampleList() {
var reqData = {
'startDate': this.data.date,
'endDate': this.data.endDate,
'logisticsNo': this.data.logisticsNo,
'institutionNo': this.data.ins[this.data.insIdx],
'logisticsMen': this.data.logisticsMen,
'boxNum': this.data.boxNum
}
request.post(`/logistics/selectTranLogistics`, reqData).then(res => {
if(res.data.data.length == 0){
wx.showToast({
title: '无查询结果',
icon: 'error'
})
} else {
this.setData({
sampleList: res.data.data,
sampleCount: res.data.data.length
})
}
})
},
//重置查询条件
resetting() {
this.currentTime()
this.setData({
logisticsNo: '',
insName: '',
logisticsMen: '',
boxNum: ''
})
},
//设置当前时间
currentTime() {
let now = new Date(); //获取时间
let year = now.getFullYear(); //获取当前年
let month = now.getMonth() + 1; //获取当前月份
this.setData({
end: '' + year + '-' + (Array(2).join(0) + month).slice(-2) + '-' + (Array(2).join(0) + now.getDate()).slice(-2),
date: '' + year + '-' + (Array(2).join(0) + month).slice(-2) + '-' + (Array(2).join(0) + now.getDate()).slice(-2),
endDate: '' + year + '-' + (Array(2).join(0) + month).slice(-2) + '-' + (Array(2).join(0) + now.getDate()).slice(-2),
}) //当前的时间
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
this.currentTime()
//获取送检机构列表
request.post(`/institution/selectInstitution`).then(res => {
var array = res.data.data
var tempArr = []
for (let index = 0; index < array.length; index++) {
tempArr.push(array[index].orgName)
}
this.setData({
ins: tempArr
})
//查询物流批次列表
// this.selSampleList();
})
},
/**
* 生命周期函数--监听页面初次渲染完成

@ -1,67 +1,74 @@
<!--pages/queryfrei/queryfrei.wxml-->
<view style="background: -webkit-linear-gradient(top,#27adb0,#ebf7f7,#f1f1f1);min-height: 1300rpx;padding: 20rpx;">
<view class="form">
<view class="form">
<picker mode="date" value="date" start="start" end="end" bindchange="bindDateChange" class="from-con">
<label>选择日期:</label>
<input type="text" disabled="true" placeholder="请选择开始日期" placeholder-class="place" value="{{date}}"/>
<input type="text" disabled="true" placeholder="请选择开始日期" placeholder-class="place" value="{{date}}" />
</picker>
<picker mode="date" value="date" start="start" end="end" bindchange="bindDateChangeend" class="from-con">
<label> </label>
<input type="text" disabled="true" placeholder="请选择结束日期" placeholder-class="place" value="{{endDate}}"/>
<input type="text" disabled="true" placeholder="请选择结束日期" placeholder-class="place" value="{{endDate}}" />
</picker>
<view class="from-con">
<label>物流单号:</label>
<input type="text" placeholder="物流单号" placeholder-class="place"/>
<input type="text" placeholder="物流单号" placeholder-class="place" bindinput="getLogisticsNo" value="{{logisticsNo}}"/>
</view>
<picker class="from-con" bindchange="bindPickerChange" value="{{index}}" range="{{array}}">
<picker class="from-con" bindchange="bindPickerChange" value="{{insName}}" range="{{ins}}">
<label>送检机构:</label>
<input type="text" disabled="true" placeholder="请选择送检机构" placeholder-class="place" value="{{array[index]}}"/>
<input type="text" disabled="true" placeholder="请选择送检机构" placeholder-class="place" value="{{insName}}" />
</picker>
<view class="from-con">
<label>物流员:</label>
<input type="text" placeholder="物流员" placeholder-class="place"/>
<input type="text" placeholder="物流员" placeholder-class="place" bindinput="bindLogisticsMen" value="{{logisticsMen}}" />
</view>
<view class="from-con">
<label>转运箱号:</label>
<input type="text" placeholder="转运箱号" placeholder-class="place"/>
<input type="text" placeholder="转运箱号" placeholder-class="place" bindinput="bindBoxNum" value="{{boxNum}}" />
</view>
<view class="from-button">
<button style="background-color: #ddd;">重 置</button>
<button style="background-color: #54b4b6; color: #fff;">查 询</button>
<button style="background-color: #ddd;" bindtap="resetting">重 置</button>
<button style="background-color: #54b4b6; color: #fff;" bindtap="selSampleList">查 询</button>
</view>
</view>
</view>
<view style="background-color: #fff;border-radius: 15rpx;margin-top: 15rpx; padding: 30rpx 10rpx 50rpx 10rpx;">
<scroll-view scroll-x style="width: 100%; border: 1rpx #ddd solid;">
<view class="tr top" >
<view style="background-color: #fff;border-radius: 15rpx;margin-top: 15rpx; padding: 30rpx 10rpx 50rpx 10rpx;">
<scroll-view scroll-x style="width: 100%;">
<view class="tr top">
<view class="td td1">序号</view>
<view class="td">物流单号</view>
<view class="td">送检机构</view>
<view class="td td2">日期</view>
<view class="td">物流费用</view>
<view class="td td_date">日期</view>
<view class="td">样本管数</view>
<view class="td">转运方式</view>
<view class="td">转运箱号</view>
<view class="td td_time">出发时间</view>
<view class="td td_time">到达时间</view>
<view class="td">车牌号</view>
<view class="td">备注</view>
</view>
<view class="tr" >
<view class="td td1">1</view>
<view class="td">JD56549856</view>
<view class="td">XX卫生院</view>
<view class="td td2">2023-5-12 14:32</view>
<view class="td">10.00</view>
<view class="td">私家车</view>
</view>
<view class="tr" >
<view class="td td1">2</view>
<view class="td">JD56549856</view>
<view class="td">XX卫生院</view>
<view class="td td2">2023-5-12 14:32</view>
<view class="td">10.00</view>
<view class="td">私家车</view>
<block wx:for="{{sampleList}}" wx:key="index">
<view class="tr">
<view class="td td1">{{index + 1}}</view>
<view class="td">{{item.logisticsNo}}</view>
<view class="td">{{item.institutionName}}</view>
<view class="td td_date">{{item.entryDate}}</view>
<view class="td">{{item.number}}</view>
<block>
<view class="td" wx:if="{{item.tranType == 1}}">私家车</view>
<view class="td" wx:else>其他</view>
</block>
<view class="td">{{item.boxNum}}</view>
<view class="td td_time">{{item.startTime}}</view>
<view class="td td_time">{{item.endTime}}</view>
<view class="td">{{itme.numberplate}}</view>
<view class="td">{{itme.notes}}</view>
</view>
</block>
</scroll-view>
<!-- <view style="text-align: right; font-size: 26rpx;margin-top: 30rpx;padding: 0 20rpx;">共 2 条</view> -->
</view>
</view>
</view>

@ -1,4 +1,4 @@
/* pages/queryfrei/queryfrei.wxss */
page{
background: -webkit-linear-gradient(top,#27adb0,#ebf7f7,#f1f1f1)
}
@ -33,6 +33,7 @@ page{
display: flex;
margin-top: 20rpx;
}
.from-button button{
display: flex;
align-items: center;
@ -48,8 +49,10 @@ page{
}
.tr .td{
border-right:#ddd solid 1rpx ;
/* border-right:#ddd solid 1rpx ;
border-top: #ddd solid 1rpx;
border-bottom: #ddd solid 1rpx; */
border: 1rpx #ddd solid;
padding: 15rpx 0;
font-size: 22rpx;
display: flex;
@ -66,6 +69,11 @@ page{
.td1{
min-width: 100rpx !important;
}
.td2{
.td_date{
min-width: 200rpx !important;
}
.td_time{
min-width: 300rpx !important;
}

@ -1,5 +1,5 @@
//自建物流查询
const request = require('../../utils/http')
var app = getApp();
Page({
/**
@ -8,16 +8,16 @@ Page({
data: {
date: '', //开始时间
endDate: '',
start: '2020-01-01',
start: '2023-01-01',
end: '',
logisticsNo: '', //物流单号
ins: [],
insName: '', //机构名称
insIdx: '', //默认机构所选下标
logisticsMen:'', //物流员
boxNum:'', //转运箱号
sampleList:[], //查询列表
sampleCount:'', //查询记录总数
logisticsMen: '', //物流员
boxNum: '', //转运箱号
sampleList: [], //查询列表
sampleCount: '', //查询记录总数
},
//开始时间
@ -36,14 +36,14 @@ Page({
},
//物流员
bindLogisticsMen(e){
bindLogisticsMen(e) {
this.setData({
logisticsMen: e.detail.value
})
},
//转运箱号
bindBoxNum(e){
bindBoxNum(e) {
this.setData({
boxNum: e.detail.value
})
@ -51,10 +51,9 @@ Page({
//送检机构
bindPickerChange(e) {
console.log('bindPickerChange=' + e.detail.value)
this.setData({
insName: this.data.ins[e.detail.value],
insIdx:e.detail.value
insIdx: e.detail.value
})
},
@ -70,25 +69,40 @@ Page({
var reqData = {
'startDate': this.data.date,
'endDate' : this.data.endDate,
'endDate': this.data.endDate,
'logisticsNo': this.data.logisticsNo,
'institutionNo': this.data.ins[this.data.insIdx],
'logisticsMen':this.data.logisticsMen,
'boxNum':this.data.boxNum
'logisticsMen': this.data.logisticsMen,
'boxNum': this.data.boxNum
}
request.post(`/logistics/selectTranLogistics`, reqData).then(res => {
console.log(res.data);
if(res.data.data.length == 0){
wx.showToast({
title: '无查询结果',
icon: 'error'
})
} else {
this.setData({
sampleList: res.data.data,
sampleCount: res.data.data.length
})
}
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
//重置查询条件
resetting() {
this.currentTime()
this.setData({
logisticsNo: '',
insName: '',
logisticsMen: '',
boxNum: ''
})
},
//设置当前时间
currentTime() {
let now = new Date(); //获取时间
let year = now.getFullYear(); //获取当前年
let month = now.getMonth() + 1; //获取当前月份
@ -96,6 +110,13 @@ Page({
date: '' + year + '-' + (Array(2).join(0) + month).slice(-2) + '-' + (Array(2).join(0) + now.getDate()).slice(-2),
endDate: '' + year + '-' + (Array(2).join(0) + month).slice(-2) + '-' + (Array(2).join(0) + now.getDate()).slice(-2),
}) //当前的时间
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
this.currentTime()
//获取送检机构列表

@ -11,7 +11,7 @@
</picker>
<view class="from-con">
<label>物流单号:</label>
<input type="text" placeholder="物流单号" placeholder-class="place" bindinput="getLogisticsNo" />
<input type="text" placeholder="物流单号" placeholder-class="place" bindinput="getLogisticsNo" value="{{logisticsNo}}"/>
</view>
<picker class="from-con" bindchange="bindPickerChange" value="{{insName}}" range="{{ins}}">
<label>送检机构:</label>
@ -26,7 +26,7 @@
<input type="text" placeholder="转运箱号" placeholder-class="place" bindinput="bindBoxNum" value="{{boxNum}}" />
</view>
<view class="from-button">
<button style="background-color: #ddd;">重 置</button>
<button style="background-color: #ddd;" bindtap="resetting">重 置</button>
<button style="background-color: #54b4b6; color: #fff;" bindtap="selSampleList">查 询</button>
</view>
@ -38,26 +38,32 @@
<view class="td td1">序号</view>
<view class="td">物流单号</view>
<view class="td">送检机构</view>
<view class="td td2">日期</view>
<view class="td td_date">日期</view>
<view class="td">样本管数</view>
<view class="td">送检机构</view>
</view>
<view class="tr">
<view class="td td1">1</view>
<view class="td">JD56549856</view>
<view class="td">XX卫生院</view>
<view class="td td2">2023-5-12 14:32</view>
<view class="td">10</view>
<view class="td">私家车</view>
<view class="td">转运方式</view>
<view class="td">转运箱号</view>
<view class="td td_time">出发时间</view>
<view class="td td_time">到达时间</view>
<view class="td">车牌号</view>
<view class="td">备注</view>
</view>
<block wx:for="{{selSampleList}}" wx:key="idx">
<block wx:for="{{sampleList}}" wx:key="index">
<view class="tr">
<view class="td td1">2</view>
<view class="td">JD56549856</view>
<view class="td">XX卫生院</view>
<view class="td td2">2023-5-12 14:32</view>
<view class="td">10</view>
<view class="td">私家车</view>
<view class="td td1">{{index + 1}}</view>
<view class="td">{{item.logisticsNo}}</view>
<view class="td">{{item.institutionName}}</view>
<view class="td td_date">{{item.entryDate}}</view>
<view class="td">{{item.number}}</view>
<block>
<view class="td" wx:if="{{item.tranType == 1}}">私家车</view>
<view class="td" wx:else>其他</view>
</block>
<view class="td">{{item.boxNum}}</view>
<view class="td td_time">{{item.startTime}}</view>
<view class="td td_time">{{item.endTime}}</view>
<view class="td">{{itme.numberplate}}</view>
<view class="td">{{itme.notes}}</view>
</view>
</block>
</scroll-view>

@ -69,8 +69,11 @@ page{
.td1{
min-width: 100rpx !important;
}
.td2{
.td_date{
min-width: 200rpx !important;
}
.td_time{
min-width: 300rpx !important;
}

@ -1,53 +1,140 @@
// pages/querythree/querythree.js
var app = getApp();
//自建物流查询
const request = require('../../utils/http')
Page({
/**
* 页面的初始数据
*/
data: {
date: '',
endDate:'',
start:'2020-01-01',
end:'',
array: ['全部','xx卫生院','xx门诊',],
date: '', //开始时间
endDate: '',
start: '2023-01-01',
end: '',
logisticsNo: '', //物流单号
ins: [],
insName: '', //机构名称
insIdx: '', //默认机构所选下标
logisticsMen: '', //物流员
boxNum: '', //转运箱号
sampleList: [], //查询列表
sampleCount: '', //查询记录总数
},
//开始时间
bindDateChange(e){
bindDateChange(e) {
// console.log(e.detail.value)
this.setData({
date:e.detail.value
date: e.detail.value
})
},
//结束时间
bindDateChangeend(e){
bindDateChangeend(e) {
// console.log(e.detail.value)
this.setData({
endDate:e.detail.value
endDate: e.detail.value
})
},
bindPickerChange (e) {
// console.log( e.detail.value)
//物流员
bindLogisticsMen(e) {
this.setData({
index: e.detail.value
logisticsMen: e.detail.value
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
//转运箱号
bindBoxNum(e) {
this.setData({
boxNum: e.detail.value
})
},
//送检机构
bindPickerChange(e) {
this.setData({
insName: this.data.ins[e.detail.value],
insIdx: e.detail.value
})
},
//获取物流单号
getLogisticsNo(e) {
this.setData({
logisticsNo: e.detail.value
})
},
//查询底部列表数据
selSampleList() {
var reqData = {
'startDate': this.data.date,
'endDate': this.data.endDate,
'logisticsNo': this.data.logisticsNo,
'institutionNo': this.data.ins[this.data.insIdx],
'logisticsMen': this.data.logisticsMen,
'boxNum': this.data.boxNum
}
request.post(`/logistics/selectTranLogistics`, reqData).then(res => {
if(res.data.data.length == 0){
wx.showToast({
title: '无查询结果',
icon: 'error'
})
} else {
this.setData({
sampleList: res.data.data,
sampleCount: res.data.data.length
})
}
})
},
//重置查询条件
resetting() {
this.currentTime()
this.setData({
logisticsNo: '',
insName: '',
logisticsMen: '',
boxNum: ''
})
},
//设置当前时间
currentTime() {
let now = new Date(); //获取时间
let year = now.getFullYear(); //获取当前年
let month = now.getMonth() + 1; //获取当前月份
this.setData({
end: '' + year + '-' + (Array(2).join(0) + month).slice(-2) + '-' + (Array(2).join(0) + now.getDate()).slice(-2),
date: '' + year + '-' + (Array(2).join(0) + month).slice(-2) + '-' + (Array(2).join(0) + now.getDate()).slice(-2),
endDate: '' + year + '-' + (Array(2).join(0) + month).slice(-2) + '-' + (Array(2).join(0) + now.getDate()).slice(-2),
}) //当前的时间
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
this.currentTime()
//获取送检机构列表
request.post(`/institution/selectInstitution`).then(res => {
var array = res.data.data
var tempArr = []
for (let index = 0; index < array.length; index++) {
tempArr.push(array[index].orgName)
}
this.setData({
ins: tempArr
})
//查询物流批次列表
// this.selSampleList();
})
},
/**
* 生命周期函数--监听页面初次渲染完成

@ -1,41 +1,40 @@
<!--pages/querythree/querythree.wxml-->
<view style="background: -webkit-linear-gradient(top,#27adb0,#ebf7f7,#f1f1f1);min-height: 1300rpx;padding: 20rpx;">
<view class="form">
<picker mode="date" value="date" start="start" end="end" bindchange="bindDateChange" class="from-con">
<label>选择日期:</label>
<input type="text" disabled="true" placeholder="请选择开始日期" placeholder-class="place" value="{{date}}"/>
<input type="text" disabled="true" placeholder="请选择开始日期" placeholder-class="place" value="{{date}}" />
</picker>
<picker mode="date" value="date" start="start" end="end" bindchange="bindDateChangeend" class="from-con">
<label> </label>
<input type="text" disabled="true" placeholder="请选择结束日期" placeholder-class="place" value="{{endDate}}"/>
<input type="text" disabled="true" placeholder="请选择结束日期" placeholder-class="place" value="{{endDate}}" />
</picker>
<view class="from-con">
<label>物流单号:</label>
<input type="text" placeholder="物流单号" placeholder-class="place"/>
<input type="text" placeholder="物流单号" placeholder-class="place" bindinput="getLogisticsNo" />
</view>
<picker class="from-con" bindchange="bindPickerChange" value="{{index}}" range="{{array}}">
<picker class="from-con" bindchange="bindPickerChange" value="{{insName}}" range="{{ins}}">
<label>送检机构:</label>
<input type="text" disabled="true" placeholder="请选择送检机构" placeholder-class="place" value="{{array[index]}}"/>
<input type="text" disabled="true" placeholder="请选择送检机构" placeholder-class="place" value="{{insName}}" />
</picker>
<view class="from-con">
<label>物流员:</label>
<input type="text" placeholder="物流员" placeholder-class="place"/>
<input type="text" placeholder="物流员" placeholder-class="place" bindinput="bindLogisticsMen" value="{{logisticsMen}}" />
</view>
<view class="from-con">
<label>转运箱号:</label>
<input type="text" placeholder="转运箱号" placeholder-class="place"/>
<input type="text" placeholder="转运箱号" placeholder-class="place" bindinput="bindBoxNum" value="{{boxNum}}" />
</view>
<view class="from-button">
<button style="background-color: #ddd;">重 置</button>
<button style="background-color: #54b4b6; color: #fff;">查 询</button>
<button style="background-color: #ddd;" bindtap="resetting">重 置</button>
<button style="background-color: #54b4b6; color: #fff;" bindtap="selSampleList">查 询</button>
</view>
</view>
<view style="background-color: #fff;border-radius: 15rpx;margin-top: 15rpx; padding: 30rpx 10rpx 50rpx 10rpx;">
<scroll-view scroll-x style="width: 100%; ">
<view class="tr top" >
<view class="tr top">
<view class="td td1">序号</view>
<view class="td">物流单号</view>
<view class="td">送检机构</view>
@ -43,22 +42,19 @@
<view class="td">物流费用</view>
<view class="td">转运方式</view>
</view>
<view class="tr" >
<view class="td td1">1</view>
<view class="td">JD56549856</view>
<view class="td">XX卫生院</view>
<view class="td td2">2023-5-12 14:32</view>
<view class="td">10.00</view>
<view class="td">私家车</view>
</view>
<view class="tr" >
<view class="td td1">2</view>
<view class="td">JD56549856</view>
<view class="td">XX卫生院</view>
<view class="td td2">2023-5-12 14:32</view>
<view class="td">10.00</view>
<view class="td">私家车</view>
</view>
<block wx:for="{{sampleList}}" wx:key="index">
<view class="tr">
<view class="td td1">{{index + 1}}</view>
<view class="td">{{item.logisticsNo}}</view>
<view class="td">{{item.institutionName}}</view>
<view class="td td_date">{{item.entryDate}}</view>
<view class="td">{{item.cost}}</view>
<block>
<view class="td" wx:if="{{item.tranType == 1}}">私家车</view>
<view class="td" wx:else>其他</view>
</block>
</view>
</block>
</scroll-view>
<!-- <view style="text-align: right; font-size: 26rpx;margin-top: 30rpx;padding: 0 20rpx;">共 2 条</view> -->
</view>

@ -1,4 +1,4 @@
/* pages/querythree/querythree.wxss */
page{
background: -webkit-linear-gradient(top,#27adb0,#ebf7f7,#f1f1f1)
}
@ -33,6 +33,7 @@ page{
display: flex;
margin-top: 20rpx;
}
.from-button button{
display: flex;
align-items: center;
@ -49,7 +50,8 @@ page{
}
.tr .td{
/* border-right:#ddd solid 1rpx ;
border-top: #ddd solid 1rpx; */
border-top: #ddd solid 1rpx;
border-bottom: #ddd solid 1rpx; */
border: 1rpx #ddd solid;
padding: 15rpx 0;
font-size: 22rpx;
@ -67,6 +69,11 @@ page{
.td1{
min-width: 100rpx !important;
}
.td2{
.td_date{
min-width: 200rpx !important;
}
.td_time{
min-width: 300rpx !important;
}

@ -1,95 +1,216 @@
//第三方物流
var datePicker = require('../../utils/dateSetting')
var request = require('../../utils/http')
var dateUtils = require('../../utils/dateUtils')
Page({
data: {
list:[
{
'id':1,
'number':'2023050002',
'time':'2023-5-12 11:32',
'status':'已签收',
'name':'张三',
'num':'M2023055568'
},
{
'id':2,
'number':'2023050002',
'time':'2023-5-12 11:32',
'status':'已签收',
'name':'李四',
'num':'M2023055568'
}
],
pipenum:'',
ins: ['顺丰','京东',],
selfOrderCode: '', //物流单号
list: [{
'id': 1,
'number': '2023050002',
'time': '2023-5-12 11:32',
'status': '已签收',
'name': '张三',
'num': 'M2023055568'
}],
pipenum: '',
ins: [],
insIdx: 0, //物流所选下标
date: '',
start:'2020-01-01',
end:'',
start: '2023-07-01', // 时间选择器开始时间
end: '', // 时间选择器结束时间
time: '',
potoSrc: '../../images/addPoto.png', //默认图片
poto: [], //车辆&转运箱照片 最大长度 4
expectedEndTime: '', //预计到达时间
multiArray: [],
multiIndex: [0, 0, 0, 0, 0],
choose_year: "",
srcArray:[]
srcArray: [],
phone: '', //物流电话
boxNum: '', //转运箱号
cost: '', //物流费用
logisticsMen: '', //物流员
notes: '', //备注
sampleCount: '0', //样本数量
//样本列表
sampleList: [{
'id': 1,
'number': '2023050002',
'time': '2023-5-12 11:32',
'status': '已签收',
'name': '张三',
'num': 'M2023055568'
}],
},
//物流车、转运箱拍照
photograph(e) {
var potoIdx = 0;
if (e.target.dataset.id == 'car_1') potoIdx = 0
if (e.target.dataset.id == 'car_2') potoIdx = 1
if (e.target.dataset.id == 'box_1') potoIdx = 2
if (e.target.dataset.id == 'box_2') potoIdx = 3
//回显所拍摄照片
var _this = this;
wx.chooseMedia({
count: 1,
mediaType: ['image', 'video'],
sourceType: ['camera'],
sizeType: ['compressed'],
camera: 'back',
success: res => {
_this.upImg(res.tempFiles[0].tempFilePath, potoIdx) //上传照片
}
})
},
//上传照片 imageSrc照片临时路径 potoIdx 点击的哪一个图片框
upImg(imageSrc, potoIdx) {
var _this = this;
request.upImgFile(`/feedBack/upload`, imageSrc).then(res => {
var resObj = JSON.parse(res.data)
console.log('upImgFile data =' + resObj.data.url);
console.log('upImgFile res=' + JSON.stringify(res.data));
if (resObj.code > 400) {
wx.showModal({
title: '提示',
content: resObj.message,
complete: (res) => {
if (res.cancel) {}
if (res.confirm) {}
//上传失败后移除图片
}
})
} else {
//保存图片路径到数组
// this.data.upImageArr.push(resObj.data.url);
_this.data.poto[potoIdx] = resObj.data.url
_this.setData({
poto: _this.data.poto
})
}
});
},
//显示回调图片
addCallBackImage(imageSrc) {
var temp = {
isBtn: false,
imgUrl: imageSrc,
text: imageSrc,
func: "delImage"
};
this.data.imageArr.unshift(temp);
this.setData({
imageArr: this.data.imageArr
});
},
//文本输入信息
inputTextInfo(e) {
var data_id = e.target.dataset.id; //组件tag
var value = e.detail.value; //输入的文本
//样本编号
if (data_id == 'barCode') {
this.setData({
pipenum: value
})
}
//物流电话
if (data_id == 'phone') {
this.setData({
phone: value
})
}
//转运箱号
if (data_id == 'boxNum') {
this.setData({
boxNum: value
})
}
//物流费用
if (data_id == 'cost') {
this.setData({
cost: value
})
}
//物流员
if (data_id == 'logisticsMen') {
this.setData({
logisticsMen: value
})
}
//驾驶员
if (data_id == 'driverMen') {
this.setData({
driverMen: value
})
}
//备注
if (data_id == 'notes') {
this.setData({
notes: value
})
}
},
scacode(){
scacode() {
wx.scanCode({
success:(res)=>{
success: (res) => {
console.log(res.result);
this.setData({
pipenum:res.result
pipenum: res.result
})
}
})
},
phot(){
phot() {
wx.chooseMedia({
count: 1,
mediaType: ['image','video'],
mediaType: ['image', 'video'],
sourceType: ['album', 'camera'],
maxDuration: 30,
camera: 'back',
success: res=>{
success: res => {
console.log(this.data.srcI)
console.log(res.tempFiles[0].tempFilePath)
// this.up();
}
})
},
//上传图片接口地址
// up(){
// console.log(this.data.srcI)
// wx.uploadFile({
// filePath: this.data.srcI,
// name: 'file',
// url: '',
// })
// },
bushPhot(){
bushPhot() {
wx.chooseMedia({
count: 1,
mediaType: ['image','video'],
mediaType: ['image', 'video'],
sourceType: ['album', 'camera'],
maxDuration: 30,
camera: 'back',
success: res=>{
success: res => {
// this.up();
}
})
},
boxPhot(){
boxPhot() {
wx.chooseMedia({
count: 1,
mediaType: ['image','video'],
mediaType: ['image', 'video'],
sourceType: ['album', 'camera'],
maxDuration: 30,
camera: 'back',
success: res=>{
success: res => {
// this.up();
}
})
@ -97,16 +218,18 @@ Page({
//送检机构
bindPickerChange(e) {
console.log('bindPickerChange = ' + JSON.stringify(e));
this.setData({
index: e.detail.value
index: e.detail.value,
insIdx:e.detail.value
})
},
//日期
bindDateChange(e){
bindDateChange(e) {
// console.log(e.detail.value)
this.setData({
date:e.detail.value
date: e.detail.value
})
},
@ -118,7 +241,7 @@ Page({
this.data.multiArray[3][this.data.multiIndex[3]] +
this.data.multiArray[4][this.data.multiIndex[4]];
this.setData({
time: dateStr
expectedEndTime: dateStr
})
},
@ -150,15 +273,106 @@ Page({
})
},
//查询底部列表数据
selSampleList() {
var reqData = {
'logisticsNo': this.data.selfOrderCode
}
request.post(`/logistics/selectTranLogistics`, reqData).then(res => {
console.log(res.data);
this.setData({
sampleList: res.data.data,
sampleCount: res.data.data.length
})
})
},
goDetail(){
goDetail() {
wx.navigateTo({
url: '../details/details',
})
},
//保存样本信息
saveInfo() {
var temp = this.data;
//处理出发时间
// var startTime = dateUtils.customizeDateFormat(temp.time);
//处理到达时间
var endTime = dateUtils.customizeDateFormat(temp.expectedEndTime);
// if (this.showErrInfo(startTime, '出发时间不可为空')) return
if (this.showErrInfo(endTime, '到过时间不可为空')) return
//处理物流车拍照
var carPoto = []
var boxPoto = []
var array = this.data.poto;
for (let index = 0; index < array.length; index++) {
if (index < 2 && array[index] != this.data.potoSrc) {
carPoto.push(array[index])
} else if (array[index] != this.data.potoSrc) {
boxPoto.push(array[index])
}
}
var tempData = {
"barCode": temp.pipenum, //样本条码
"barCodeImg": "", //物流拍照图
"boxNum": temp.boxNum, //转运箱号
"carPics": carPoto.toString(), //物流车图片 逗号分隔
"boxPics": boxPoto.toString(), // 转运箱图片 逗号分隔
"cost": 0, // 物流费用
"driverMen": temp.driverMen, //驾驶员
"entryDate": temp.date, // 录入日期
"endDate": '2023-07-06 14:52:53', //startTime
"expectedEndTime": endTime, //预计到达时间 endTime
"institutionName": temp.ins[temp.insIdx].orgName, //送检机构名称
"institutionNo": temp.ins[temp.insIdx].id, //送检机构编号
"logisticsMen": temp.logisticsMen, //物流员
"logisticsNo": temp.selfOrderCode, //物流编号
"logisticsWay": 2, //物流方式 1自建 2第三方 3货运
"notes": temp.notes, // 物流备注
"number": temp.number, // 数量
"numberplate": "", // 车牌号
"phone": temp.phone, //物流电话
"startTime": "", //出发时间
"tranType": "", //物流方式
"unitType": temp.insIdx, //物流单位 1.顺丰 2.京东
"updateBy": 0,
"updateTime": ""
}
request.post(`/batch/addTranLogistics`, tempData).then(res => {
console.log(JSON.stringify(res.data));
if (res.data.code == 200) {
//保存成功后,查询底部列表
this.selSampleList();
} else {
wx.showModal({
title: '错误',
content: res.data.message,
showCancel: false,
complete: (res) => {
if (res.confirm) {}
}
})
}
})
},
//显示必选项为空提示
showErrInfo(field, errInfo) {
if (field === undefined || field.length == 0) {
wx.showToast({
icon: 'error',
title: errInfo,
})
return true;
}
},
/**
* 生命周期函数--监听页面加载
*/
@ -167,11 +381,10 @@ Page({
let year = now.getFullYear(); //获取当前年
let month = now.getMonth() + 1; //获取当前月份
this.setData({
end: '' + year + '-' + (Array(2).join(0) + month).slice(-2) + '-' + (Array(2).join(0) + now.getDate()).slice(-2),//当前的时间
end: '' + year + '-' + (Array(2).join(0) + month).slice(-2) + '-' + (Array(2).join(0) + now.getDate()).slice(-2), //当前的时间
//开始
multiArray:
[
multiArray: [
[year + "年", year + 1 + "年", year + 2 + "年"],
datePicker.determineMonth(),
datePicker.determineDay(year, month),
@ -179,6 +392,40 @@ Page({
datePicker.determineMinute()
],
})
//获取物流单号 1.自建物流 2.第三方物流 3.货运物流
request.get(`/batch/getBatchsNumber?logisticsWay=2`).then(res => {
console.log('getBatchsNumber=' + JSON.stringify(res.data))
if (res.data.code == 200) {
this.setData({
selfOrderCode: res.data.data
})
}
})
//获取物流机构列表 /dict/type/{dictType}
request.get(`/dict/type/unit_type`).then(res => {
var array = res.data.data
var tempArr = []
for (let index = 0; index < array.length; index++) {
tempArr.push(array[index].dictLabel)
}
this.setData({
ins: tempArr
})
//查询物流批次列表
this.selSampleList()
})
//初始化照片按钮
var tempSrc = [this.data.potoSrc, this.data.potoSrc, this.data.potoSrc, this.data.potoSrc]
this.setData({
poto: tempSrc
})
},
/**

@ -1,48 +1,47 @@
<view class="box">
<view class="back">
<view class="top">
<input type="text" value="{{pipenum}}"/>
<input type="text" value="{{pipenum}}" />
<view style="background-color: #eee;" bindtap="scacode">扫 码</view>
<view style="background-color: #23c559; color: #fff;" bindtap="phot">拍 照</view>
<!-- <view style="background-color: #23c559; color: #fff;" bindtap="phot">拍 照</view> -->
</view>
<view class="form">
<view class="from-con">
<label>物流单号:</label>
<input type="text" placeholder="物流单号" placeholder-class="place" value=""/>
<input type="text" placeholder="物流单号" disabled="false" placeholder-class="place" value="{{selfOrderCode}}" />
</view>
<picker class="from-con" bindchange="bindPickerChange" value="{{index}}" range="{{ins}}">
<label>物流单位:</label>
<input type="text" disabled="true" placeholder="请选择物流单位" placeholder-class="place" value="{{ins[index]}}"/>
<input type="text" disabled="true" placeholder="请选择物流单位" placeholder-class="place" value="{{ins[index]}}" />
</picker>
<picker mode="date" value="date" start="start" end="end" bindchange="bindDateChange" class="from-con">
<picker mode="date" value="date" start="{{start}}" end="{{end}}" bindchange="bindDateChange" class="from-con">
<label>日期:</label>
<input type="text" disabled="true" placeholder="请选择日期" placeholder-class="place" value="{{date}}"/>
<input type="text" disabled="true" placeholder="请选择日期" placeholder-class="place" value="{{date}}" />
</picker>
<view class="from-con">
<label>物流电话:</label>
<input type="text" placeholder="物流电话" placeholder-class="place"/>
<input type="text" placeholder="物流电话" placeholder-class="place" bindinput="inputTextInfo" data-id="phone" value="{{phone}}"/>
</view>
<view class="from-con">
<label>物流费用:</label>
<input type="text" placeholder="物流费用" placeholder-class="place" value=""/>
<input type="text" placeholder="物流费用" placeholder-class="place" bindinput="inputTextInfo" data-id="cost" value="{{cost}}" />
</view>
<view class="from-con">
<label>转运箱号:</label>
<input type="text" placeholder="驾驶员" placeholder-class="place" value=""/>
<input type="text" placeholder="转运箱号" placeholder-class="place" bindinput="inputTextInfo" data-id="boxNum" value="{{boxNum}}" />
</view>
<picker class="from-con" mode="multiSelector" bindchange="bindMultiPickerChange" bindcolumnchange="bindMultiPickerColumnChange" value="{{multiIndex}}" range="{{multiArray}}">
<label>到达时间:</label>
<input value='{{time}}' placeholder='请选择到达时间' placeholder-class="place" disabled="true"/>
<label>预计到达时间:</label>
<input value='{{expectedEndTime}}' placeholder='请选择到达时间' placeholder-class="place" disabled="true" />
</picker>
<view class="from-con">
<label>物流员:</label>
<input type="text" placeholder="物流员" placeholder-class="place" value=""/>
<input type="text" bindinput="inputTextInfo" data-id="logisticsMen" placeholder="物流员" placeholder-class="place" value="{{logisticsMen}}" />
</view>
<view class="from-con">
<label>备注:</label>
<input type="text" placeholder="备注" placeholder-class="place" value=""/>
<input type="text" placeholder="备注" placeholder-class="place" bindinput="inputTextInfo" data-id="notes" value="{{notes}}" />
</view>
</view>
@ -51,30 +50,30 @@
<view class="back">
<view class="bush">
<view style="flex: 1;">物流车拍照</view>
<button bindtap="bushPhot">拍 照</button>
<!-- <button bindtap="bushPhot">拍 照</button> -->
</view>
<view class="bush-img">
<image src="../../images/bush.png"></image>
<image src="../../images/bush.png"></image>
<image bindtap="photograph" src="{{poto[0]}}" data-id="car_1"></image>
<image bindtap="photograph" src="{{poto[1]}}" data-id="car_2"></image>
</view>
</view>
<view class="back">
<view class="bush">
<view style="flex: 1;">转运箱拍照</view>
<button bindtap="boxPhot">拍 照</button>
<!-- <button bindtap="boxPhot">拍 照</button> -->
</view>
<view class="bush-img">
<image src="../../images/bush.png"></image>
<image src="../../images/bush.png"></image>
<image bindtap="photograph" src="{{poto[2]}}" data-id="box_1"></image>
<image bindtap="photograph" src="{{poto[3]}}" data-id="box_2"></image>
</view>
</view>
<view class="back">
<view class="con">
<view style="flex: 1;">总计:200/管数</view>
<button style="background-color: #ddd;">修 改</button>
<button style="color: #fff;">保 存</button>
<button style="background-color: #ddd;" hidden="true">修 改</button>
<button style="color: #fff;" bindtap="saveInfo">保 存</button>
</view>
<scroll-view scroll-x class="tabel">
@ -86,7 +85,7 @@
<view class="td">物流员</view>
<view class="td">物流单号</view>
</view>
<view class="tr" wx:for="{{list}}" wx:key="index" bindtap="goDetail">
<view class="tr" wx:for="{{sampleList}}" wx:key="index" bindtap="goDetail">
<view class="td1" bindtap="goDetail">{{item.id}}</view>
<view class="td">{{item.number}}</view>
<view class="td">{{item.time}}</view>

@ -7,11 +7,13 @@
}
.top input{
border: 1rpx #333 solid;
border-radius: 10rpx;
height: 60rpx;
width: 700rpx;
border-radius: 5rpx;
padding: 5rpx 10rpx;
}
.top view{
width: 135rpx;
width: 305rpx;
margin-left: 20rpx;
background-color: #eee;
display: flex;

@ -1,10 +1,9 @@
//将当前日期写成常量
// 测试
const date = new Date();
const year = date.getFullYear();
const month = date.getMonth() + 1;
const day = date.getDay()+1;
const day = date.getDay() + 9; //不知道为什么 + 1 的话,时间不是当前日
const hour = date.getHours();
const minute = date.getMinutes();
//确定月份呈现
@ -43,12 +42,14 @@ function determineDay(year, month) {
days = 28
} else days = 29;
}
for (let i = day; i <= days; i++) {
dayDates.push(i + "日");
}
for (let i = 1; i <= day; i++) {
dayDates.push(i + "日");
}
return dayDates;
}
//确定小时的呈现
@ -65,7 +66,7 @@ function determineHour() {
//确定分的呈现
function determineMinute() {
let minuteDates = [];
let minuteNum=0;
let minuteNum = 0;
if (parseInt(minute) % 10 >= 5) {
minuteNum = (parseInt(minute / 10) + 1) * 10;
} else {
@ -81,8 +82,8 @@ function determineMinute() {
}
//将上述函数导出,这样引入文件后可以直接使用导出的函数
module.exports = {
determineMonth:determineMonth,
determineDay:determineDay,
determineHour:determineHour,
determineMinute:determineMinute,
determineMonth: determineMonth,
determineDay: determineDay,
determineHour: determineHour,
determineMinute: determineMinute,
}

@ -0,0 +1,37 @@
const request = require('../utils/http')
var app = getApp();
const openidLogin = function(){
wx.login({
success: (res) => {
request.get('/wx/getOpenid?code='+res.code).then(res => {
getTokenByOpenld({openid: res.data.openid}).then(res1 => {
// console.log('=============',res1);
if(res1.data.code == 200){
app.globalData.token = res1.data.data.tokenHead + res1.data.data.token;
// console.log(app.globalData.token);
wx.showToast({
title: '登陆成功'
});
request.get('/sso/info').then(res2 => {
// console.log(res2);
app.globalData.userInfo=res2.data.data
// console.log(app.globalData.userInfo);
})
}
})
})
}
})
}
const getTokenByOpenld = function(params){
return request.post('/sso/getTokenByOpenId', params, {'content-type':'application/x-www-form-urlencoded'})
}
module.exports = {
//绑定微信
bindWechat(params){
return request.post('/sso/bindWechat',params, {'content-type':'application/x-www-form-urlencoded'})
},
}
Loading…
Cancel
Save