Commit 3ec2c0c4 authored by youjie's avatar youjie

no message

parent 36bdd9e9
......@@ -530,13 +530,13 @@
if (this.params.year) this.year = this.years[this.valueArr[i++]];
if (this.params.month) {
this.month = this.months[this.valueArr[i++]];
if(this.day>new Date(this.year, this.month, 0).getDate()){
if(this.day>new Date(this.year, this.month, 0).getDate()&&this.startDay){
this.setDays()
}
}
if (this.params.day) {
this.day = this.days[this.valueArr[i++]];
this.setHours()
if(this.startHours) this.setHours()
}
if (this.params.hour) {
this.hour = this.hours[this.valueArr[i++]];
......
......@@ -203,17 +203,30 @@
data: arrayBuffer, // 直接写入 ArrayBuffer
encoding: 'binary', // 必须指定为 binary
success: () => {
uni.showToast({ title: '临时文件路径:' + filePath });
uni.showToast({ title: '临时文件:' + filePath });
// 可选:保存到相册(需授权)
that.saveFileToPhone(filePath);
},
fail: (err) => {
uni.showToast({ title: '写入失败', icon: 'none' });
console.error('写入错误', err);
uni.showToast({ title: '写入失败', icon: 'none' });
console.error('写入错误', err);
}
});
return
},
saveFileToPhone(tempFilePath) {
uni.saveFile({
tempFilePath: tempFilePath,
success: (saveRes) => {
uni.showToast({ title: '文件已保存至:' + saveRes.savedFilePath });
},
fail: (err) => {
uni.showToast({ title: '保存失败', icon: 'none' });
console.error('保存错误', err);
}
});
},
canvasToTempFilePath(){
uni.canvasToTempFilePath({
canvasId: `firstCanvas_${that.current}`,
success: (res) => {
......@@ -290,31 +303,7 @@
this
);
},
base64ToBlob(base64Data, mimeType) {
// 解码 Base64 数据
const byteString = atob(base64Data);
// 计算字节长度
const arrayBuffer = new ArrayBuffer(byteString.length);
const uintArray = new Uint8Array(arrayBuffer);
// 填充字节数据
for (let i = 0; i < byteString.length; i++) {
uintArray[i] = byteString.charCodeAt(i);
}
// 创建 Blob 对象(指定 MIME 类型)
return new Blob([arrayBuffer], { type: mimeType });
},
saveFileToPhone(tempFilePath) {
uni.saveFile({
tempFilePath: tempFilePath,
success: (saveRes) => {
uni.showToast({ title: '文件已保存至:' + saveRes.savedFilePath });
},
fail: (err) => {
uni.showToast({ title: '保存失败', icon: 'none' });
console.error('保存错误', err);
}
});
},
canvasIdErrorCallback: function(e, index) {
console.error(e.detail.errMsg, '---index', index);
......
......@@ -224,8 +224,9 @@
<view class="PY50"></view>
<singleChoice v-if="optionVisible" :current="optionObj.id" :list="optionList" @close="close"
@change="popupCurrent"></singleChoice>
<u-picker v-model="dateVisible" mode="time" :startMonth="$utils.GetDateFewFaysLater(-1).month"
:params="dateParams" @cancel="setDateHandler" @confirm="setDateHandler" confirmColor="#257BF2"
<u-picker v-model="dateVisible" mode="time"
:params="dateParams"
@cancel="setDateHandler" @confirm="setDateHandler" confirmColor="#257BF2"
:defaultTime="time"></u-picker>
</view>
</template>
......
......@@ -43,14 +43,18 @@
font-size: 32rpx;
color: #FFFFFF;
white-space: nowrap;
margin: 0 22rpx 20rpx;
margin-bottom: 20rpx;
margin-left: 22rpx;
margin-right: 22rpx;
text-align: center;
padding: 5rpx 30rpx;
}
.reimbursementInforText.active {
color: #257BF1;
background: #FFFFFF;
border-radius: 6rpx;
padding: 5rpx 20rpx;
padding: 5rpx 30rpx;
}
.saveBox {
......
......@@ -180,11 +180,12 @@
};
},
onLoad() {
},
onShow() {
this.b2b_user_info = uni.getStorageSync('b2b_user');
this.mall_UserInfo = uni.getStorageSync("mall_UserInfo");
this.showAuth = !this.mall_UserInfo || !this.b2b_user_info;
},
onShow() {
const that = this
uni.getSystemInfo({
success(res) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment