Commit 453e1b90 by 张立顺

fix:页面input确实软键盘收起问题

1 parent 631e79fe
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
2测试 2测试
3生产 3生产
*/ */
const index = 3 const index = 2
const secretKey_items = { const secretKey_items = {
ip: { ip: {
appKey: '48e5e13229b82c1b4e6e8c96151f0637', appKey: '48e5e13229b82c1b4e6e8c96151f0637',
......
...@@ -18,6 +18,39 @@ Component({ ...@@ -18,6 +18,39 @@ Component({
*/ */
methods: { methods: {
noScroll() {}, noScroll() {},
/** 日期手动改 */
resetData(date) {
// let _this = this[_CalendarObject_]
let { monthList, current } = this.data
console.log(monthList)
console.log(date)
// return
monthList.map(x => {
x.data.map(i => (i.active = false))
})
monthList.map((item, index) => {
item.data.map(ele => {
if (ele.data == date) {
console.log(ele.data)
console.log(current)
ele.active = true
current = index
}
})
})
this.setData({
monthList,
current
})
},
// resetData(date) {
// // console.log(this.resetData)
// // this.getUserDayReport(n)[CalendarFunction]
// // this[CalendarFunction].resetData(date)
// // console.log(date)
// // console.log(this[CalendarFunction].setCalenderBodyHeight)
// },
setCalenderBodyHeight() { setCalenderBodyHeight() {
this[CalendarFunction].setCalenderBodyHeight() this[CalendarFunction].setCalenderBodyHeight()
}, },
......
...@@ -162,6 +162,7 @@ class Calendar { ...@@ -162,6 +162,7 @@ class Calendar {
let months = (parseInt(year2) - parseInt(year1)) * 12 + (parseInt(month2) - parseInt(month1)) let months = (parseInt(year2) - parseInt(year1)) * 12 + (parseInt(month2) - parseInt(month1))
return months return months
} }
/**单选 */ /**单选 */
single(e) { single(e) {
let _this = this[_CalendarObject_] let _this = this[_CalendarObject_]
......
...@@ -76,6 +76,13 @@ export default { ...@@ -76,6 +76,13 @@ export default {
/**隐藏水印 */ /**隐藏水印 */
hideMark: Boolean, hideMark: Boolean,
isComponents: Boolean isComponents: Boolean
// dataDateStr: {
// type: String,
// observer: function (n) {
// // console.log(n)
// this.resetData(n)
// }
// } //日期变化
// forceFullSucreen: { // forceFullSucreen: {
// // 兼容isFullSucreen 属性不准确的情况 // // 兼容isFullSucreen 属性不准确的情况
// type: Boolean, // type: Boolean,
......
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.useChildren = exports.useParent = void 0;
function useParent(name, onEffect) {
var _a;
var path = "../" + name + "/index";
return {
relations: (_a = {},
_a[path] = {
type: 'ancestor',
linked: function () {
onEffect && onEffect.call(this);
},
linkChanged: function () {
onEffect && onEffect.call(this);
},
unlinked: function () {
onEffect && onEffect.call(this);
},
},
_a),
mixin: Behavior({
created: function () {
var _this = this;
Object.defineProperty(this, 'parent', {
get: function () { return _this.getRelationNodes(path)[0]; },
});
Object.defineProperty(this, 'index', {
// @ts-ignore
get: function () { var _a, _b; return (_b = (_a = _this.parent) === null || _a === void 0 ? void 0 : _a.children) === null || _b === void 0 ? void 0 : _b.indexOf(_this); },
});
},
}),
};
}
exports.useParent = useParent;
function useChildren(name, onEffect) {
var _a;
var path = "../" + name + "/index";
return {
relations: (_a = {},
_a[path] = {
type: 'descendant',
linked: function (target) {
onEffect && onEffect.call(this, target);
},
linkChanged: function (target) {
onEffect && onEffect.call(this, target);
},
unlinked: function (target) {
onEffect && onEffect.call(this, target);
},
},
_a),
mixin: Behavior({
created: function () {
var _this = this;
Object.defineProperty(this, 'children', {
get: function () { return _this.getRelationNodes(path) || []; },
});
},
}),
};
}
exports.useChildren = useChildren;
// tabOperating/pages/index/component/business/business.js // tabOperating/pages/index/component/business/business.js
import api from '../../../../api' import api from '../../../../api'
const app = getApp()
Component({ Component({
/** /**
* 组件的属性列表 * 组件的属性列表
...@@ -48,6 +49,7 @@ Component({ ...@@ -48,6 +49,7 @@ Component({
* 组件的初始数据 * 组件的初始数据
*/ */
data: { data: {
scrollTop: 0,
tipsShow: false, tipsShow: false,
startX: 0, //开始坐标 startX: 0, //开始坐标
startY: 0, startY: 0,
...@@ -145,7 +147,47 @@ Component({ ...@@ -145,7 +147,47 @@ Component({
* 组件的方法列表 * 组件的方法列表
*/ */
methods: { methods: {
inputFocus(e) {
this.setTimeout(() => {
wx.hideKeyboard()
}, 1000)
// let thisPage = wx.$router.getPageInstance()
// // console.log(thisPage.data)
// let { statusBarHeight } = thisPage.data
// console.log(e, '键盘弹起', statusBarHeight)
// this.setData({
// scrollTop: 1000
// })
// wx.pageScrollTo({
// scrollTop: 271,
// duration: 300
// })
// var inputHeight = 0
// setTimeout(() => {
// thisPage.setData({
// statusBarHeight: -271
// })
// }, 1000)
// console.log(e.detail.height)
// thisPage.setData({
// statusBarHeight: -271
// })
// if (e.detail.height) {
// inputHeight = e.detail.height
// thisPage.setData({
// statusBarHeight: -parseInt(inputHeight)
// })
// }
},
inputBlur(e) { inputBlur(e) {
// let statusBarHeight = app.globalData.statusBarHeight + 43
// let thisPage = wx.$router.getPageInstance()
// thisPage.setData({
// statusBarHeight
// })
// console.log('confirm')
// console.log(statusBarHeight)
let { index } = e.currentTarget.dataset let { index } = e.currentTarget.dataset
let { list, dataDateStr } = this.data let { list, dataDateStr } = this.data
if (!list[index].value) return if (!list[index].value) return
...@@ -257,7 +299,7 @@ Component({ ...@@ -257,7 +299,7 @@ Component({
}) })
this.getUserDayReport() this.getUserDayReport()
}else{ } else {
wx.$util.showToast('新增字段失败') wx.$util.showToast('新增字段失败')
} }
}) })
......
...@@ -105,6 +105,7 @@ ...@@ -105,6 +105,7 @@
.num { .num {
font-weight: 600; font-weight: 600;
position: relative;
} }
} }
...@@ -151,7 +152,10 @@ ...@@ -151,7 +152,10 @@
font-weight: 600; font-weight: 600;
font-size: 28rpx; font-size: 28rpx;
color: #333333; color: #333333;
position: absolute;
right: 0;
top: 50%;
transform: translateY(-50%);
} }
} }
...@@ -277,6 +281,11 @@ ...@@ -277,6 +281,11 @@
text-align: right; text-align: right;
font-size: 28rpx; font-size: 28rpx;
max-width: 240rpx; max-width: 240rpx;
width: 240rpx;
height: 40rpx;
// line-height: 122rpx;
// height: 100%;
// width: 100%;
} }
.placeholder-class { .placeholder-class {
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
bindrefresherrefresh="refreshList" bindrefresherrefresh="refreshList"
refresher-threshold="104" refresher-threshold="104"
style="height:100%;" style="height:100%;"
scroll-top="{{scrollTop}}"
class="businessPage list" class="businessPage list"
refresher-triggered="{{triggered}}"> refresher-triggered="{{triggered}}">
<view class=" title"> <view class=" title">
...@@ -119,7 +120,7 @@ ...@@ -119,7 +120,7 @@
{{item['fieldValue']}} {{item['fieldValue']}}
</view> </view>
<!-- <view class="placeholder" >输入数字</view> --> <!-- <view class="placeholder" >输入数字</view> -->
<input <!-- <input
wx:else wx:else
placeholder="输入数字" placeholder="输入数字"
class="input" class="input"
...@@ -129,8 +130,24 @@ ...@@ -129,8 +130,24 @@
type="text" type="text"
bindblur="inputBlur" bindblur="inputBlur"
bindinput="input" bindinput="input"
bindfocus="inputFocus"
data-index="{{index}}" data-index="{{index}}"
always-embed></input> always-embed></input> -->
<textarea
wx:else
placeholder="输入数字"
class="input"
value="{{item['value']}}"
placeholder-class="placeholder-class"
maxlength="10"
type="text"
bindblur="inputBlur"
bindinput="input"
bindfocus="inputFocus"
bindconfirm="inputBlur"
data-index="{{index}}"
always-embed></textarea>
<!-- adjust-position="{{inputUp}}" adjust-position="" -->
</view> </view>
</view> </view>
</view> </view>
......
.businessPage .title{display:flex;justify-content:space-between;align-items:center;height:80rpx;padding:0 20rpx}.businessPage .title .addFields{font-size:24rpx;color:#333;display:flex;align-items:center;height:100%}.businessPage .title .addIcon{width:24rpx;height:24rpx;margin-right:6rpx}.businessPage .title .tips{display:flex;margin-left:auto;align-items:center;height:100%;color:#999;font-size:24rpx}.businessPage .title .tipsIcon{width:24rpx;height:24rpx;margin-left:8rpx}.businessPage .cell{margin:20rpx;padding-bottom:20rpx;font-size:24rpx;background-color:#fff;border-bottom:.5px solid #d8d4d4}.businessPage .cell .todayData{display:flex;justify-content:space-between;margin-bottom:10rpx;font-size:28rpx;color:#333333}.businessPage .cell .todayData .num{font-weight:600;display:flex;align-items:center}.businessPage .cell .todayData .num image{width:10rpx;height:6rpx}.businessPage .cell .monthData{display:flex;justify-content:space-between;color:#999999;font-size:24rpx}.businessPage .cell .monthData .num{display:flex;align-items:center}.businessPage .cell .monthData .num image{width:15rpx;height:9rpx;margin:4rpx 6rpx 0 10rpx}.businessPage .otherCell{display:flex;justify-content:space-between;margin:40rpx 20rpx 0;padding-bottom:40rpx;font-size:28rpx;color:#333;background-color:#fff;border-bottom:.5px solid #d8d4d4}.businessPage .otherCell .num{font-weight:600}.businessPage .otherAdd{height:122rpx;display:flex;align-items:center;justify-content:space-between;background-color:#fff}.businessPage .otherAdd .otherData{display:flex;align-items:center}.businessPage .otherAdd .label{font-size:28rpx;margin-right:32rpx}.businessPage .otherAdd .check{display:flex;align-items:center;color:#3582EE;font-size:24rpx}.businessPage .otherAdd .check .checkIcon{width:24rpx;height:24rpx;margin-right:8rpx}.businessPage .otherAdd .placeholder{color:#C3C3C3;font-size:28rpx}.businessPage .otherAdd .placeholder.num{font-weight:600;font-size:28rpx;color:#333333}.businessPage .touch-item{margin:0 20rpx;display:flex;justify-content:space-between;width:calc(100% - 40rpx);overflow:hidden;border-bottom:.5px solid #d8d4d4}.businessPage .content{width:100%;margin-right:0;-webkit-transition:all 0.4s;transition:all 0.4s;-webkit-transform:translateX(90px);transform:translateX(90px);margin-left:-90px}.businessPage .content .item{display:flex}.businessPage .touch-item:nth-last-child(1){border-radius:0 0 16rpx 16rpx;border-bottom:0}.businessPage .del{width:90px;display:flex;flex-direction:column;align-items:center;justify-content:center;color:#fff;background-color:#f1554c;-webkit-transform:translateX(90px);transform:translateX(90px);-webkit-transition:all 0.4s;transition:all 0.4s;font-size:28rpx}.businessPage .confirm{animation-duration:.5s;animation-name:fadein}@keyframes fadein{0%{opacity:0;transform:translateX(90px)}100%{opacity:1;transform:translateX(0px)}}.businessPage .touch-move-active .content,.businessPage .touch-move-active .del{-webkit-transform:translateX(0);transform:translateX(0)}.cellContainer view:last-child{border-bottom:none}.bottomTips{height:92rpx;line-height:92rpx;text-align:center;font-size:20rpx;color:#666666;background:#F8F9F9}.input{text-align:right;font-size:28rpx;max-width:240rpx}.placeholder-class{color:#C3C3C3}.cellContainer{border-radius:12rpx 12rpx 0 0;background-color:#fff;overflow:hidden} .businessPage .title{display:flex;justify-content:space-between;align-items:center;height:80rpx;padding:0 20rpx}.businessPage .title .addFields{font-size:24rpx;color:#333;display:flex;align-items:center;height:100%}.businessPage .title .addIcon{width:24rpx;height:24rpx;margin-right:6rpx}.businessPage .title .tips{display:flex;margin-left:auto;align-items:center;height:100%;color:#999;font-size:24rpx}.businessPage .title .tipsIcon{width:24rpx;height:24rpx;margin-left:8rpx}.businessPage .cell{margin:20rpx;padding-bottom:20rpx;font-size:24rpx;background-color:#fff;border-bottom:.5px solid #d8d4d4}.businessPage .cell .todayData{display:flex;justify-content:space-between;margin-bottom:10rpx;font-size:28rpx;color:#333333}.businessPage .cell .todayData .num{font-weight:600;display:flex;align-items:center}.businessPage .cell .todayData .num image{width:10rpx;height:6rpx}.businessPage .cell .monthData{display:flex;justify-content:space-between;color:#999999;font-size:24rpx}.businessPage .cell .monthData .num{display:flex;align-items:center}.businessPage .cell .monthData .num image{width:15rpx;height:9rpx;margin:4rpx 6rpx 0 10rpx}.businessPage .otherCell{display:flex;justify-content:space-between;margin:40rpx 20rpx 0;padding-bottom:40rpx;font-size:28rpx;color:#333;background-color:#fff;border-bottom:.5px solid #d8d4d4}.businessPage .otherCell .num{font-weight:600;position:relative}.businessPage .otherAdd{height:122rpx;display:flex;align-items:center;justify-content:space-between;background-color:#fff}.businessPage .otherAdd .otherData{display:flex;align-items:center}.businessPage .otherAdd .label{font-size:28rpx;margin-right:32rpx}.businessPage .otherAdd .check{display:flex;align-items:center;color:#3582EE;font-size:24rpx}.businessPage .otherAdd .check .checkIcon{width:24rpx;height:24rpx;margin-right:8rpx}.businessPage .otherAdd .placeholder{color:#C3C3C3;font-size:28rpx}.businessPage .otherAdd .placeholder.num{font-weight:600;font-size:28rpx;color:#333333;position:absolute;right:0;top:50%;transform:translateY(-50%)}.businessPage .touch-item{margin:0 20rpx;display:flex;justify-content:space-between;width:calc(100% - 40rpx);overflow:hidden;border-bottom:.5px solid #d8d4d4}.businessPage .content{width:100%;margin-right:0;-webkit-transition:all 0.4s;transition:all 0.4s;-webkit-transform:translateX(90px);transform:translateX(90px);margin-left:-90px}.businessPage .content .item{display:flex}.businessPage .touch-item:nth-last-child(1){border-radius:0 0 16rpx 16rpx;border-bottom:0}.businessPage .del{width:90px;display:flex;flex-direction:column;align-items:center;justify-content:center;color:#fff;background-color:#f1554c;-webkit-transform:translateX(90px);transform:translateX(90px);-webkit-transition:all 0.4s;transition:all 0.4s;font-size:28rpx}.businessPage .confirm{animation-duration:.5s;animation-name:fadein}@keyframes fadein{0%{opacity:0;transform:translateX(90px)}100%{opacity:1;transform:translateX(0px)}}.businessPage .touch-move-active .content,.businessPage .touch-move-active .del{-webkit-transform:translateX(0);transform:translateX(0)}.cellContainer view:last-child{border-bottom:none}.bottomTips{height:92rpx;line-height:92rpx;text-align:center;font-size:20rpx;color:#666666;background:#F8F9F9}.input{text-align:right;font-size:28rpx;max-width:240rpx;width:240rpx;height:40rpx}.placeholder-class{color:#C3C3C3}.cellContainer{border-radius:12rpx 12rpx 0 0;background-color:#fff;overflow:hidden}
...@@ -215,11 +215,13 @@ Page({ ...@@ -215,11 +215,13 @@ Page({
let { type } = e.currentTarget.dataset let { type } = e.currentTarget.dataset
console.log(type) console.log(type)
let { dateObj } = this.data let { dateObj } = this.data
this.calendar = this.selectComponent('#calender')
if (type == 'before') { if (type == 'before') {
this.setTimeList(dateObj.beforeDay) this.setTimeList(dateObj.beforeDay)
} else { } else {
this.setTimeList(dateObj.nextDay) this.setTimeList(dateObj.nextDay)
} }
this.calendar.resetData(type == 'before'?dateObj.beforeDay:dateObj.nextDay)
}, },
// 获取选中天数 // 获取选中天数
rangeSelect(e) { rangeSelect(e) {
......
...@@ -78,6 +78,7 @@ ...@@ -78,6 +78,7 @@
minDate="2020-10-01" minDate="2020-10-01"
maxDate="{{dateObj.maxDate}}" maxDate="{{dateObj.maxDate}}"
isComponents> isComponents>
<!-- dataDateStr="{{dateObj.todayShow}}" -->
<view class="item text-center dateNum"> <view class="item text-center dateNum">
{{dateObj.todayShow}} {{dateObj.todayShow}}
<image class="solidArrow" src="../../images/solidArrow.png" /> <image class="solidArrow" src="../../images/solidArrow.png" />
...@@ -114,7 +115,7 @@ ...@@ -114,7 +115,7 @@
id="businessCell" id="businessCell"
wx:if="{{activeTab==0}}" wx:if="{{activeTab==0}}"
canRemark="{{canRemark}}" canRemark="{{canRemark}}"
today ="{{dateObj.maxDate}}" today="{{dateObj.maxDate}}"
dataDateStr="{{dateObj.today}}" /> dataDateStr="{{dateObj.today}}" />
<staffCell id="staffCell" wx:if="{{activeTab==1}}" dataDateStr="{{dateObj.today}}" /> <staffCell id="staffCell" wx:if="{{activeTab==1}}" dataDateStr="{{dateObj.today}}" />
<conquestCell id="conquestCell" wx:if="{{activeTab==2}}" date="{{dateObj.today}}" /> <conquestCell id="conquestCell" wx:if="{{activeTab==2}}" date="{{dateObj.today}}" />
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!