Commit 3ec2c0c4 authored by youjie's avatar youjie

no message

parent 36bdd9e9
...@@ -530,13 +530,13 @@ ...@@ -530,13 +530,13 @@
if (this.params.year) this.year = this.years[this.valueArr[i++]]; if (this.params.year) this.year = this.years[this.valueArr[i++]];
if (this.params.month) { if (this.params.month) {
this.month = this.months[this.valueArr[i++]]; 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() this.setDays()
} }
} }
if (this.params.day) { if (this.params.day) {
this.day = this.days[this.valueArr[i++]]; this.day = this.days[this.valueArr[i++]];
this.setHours() if(this.startHours) this.setHours()
} }
if (this.params.hour) { if (this.params.hour) {
this.hour = this.hours[this.valueArr[i++]]; this.hour = this.hours[this.valueArr[i++]];
......
...@@ -203,17 +203,30 @@ ...@@ -203,17 +203,30 @@
data: arrayBuffer, // 直接写入 ArrayBuffer data: arrayBuffer, // 直接写入 ArrayBuffer
encoding: 'binary', // 必须指定为 binary encoding: 'binary', // 必须指定为 binary
success: () => { success: () => {
uni.showToast({ title: '临时文件路径:' + filePath }); uni.showToast({ title: '临时文件:' + filePath });
// 可选:保存到相册(需授权) // 可选:保存到相册(需授权)
that.saveFileToPhone(filePath); that.saveFileToPhone(filePath);
}, },
fail: (err) => { fail: (err) => {
uni.showToast({ title: '写入失败', icon: 'none' }); uni.showToast({ title: '写入失败', icon: 'none' });
console.error('写入错误', err); 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({ uni.canvasToTempFilePath({
canvasId: `firstCanvas_${that.current}`, canvasId: `firstCanvas_${that.current}`,
success: (res) => { success: (res) => {
...@@ -290,31 +303,7 @@ ...@@ -290,31 +303,7 @@
this 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) { canvasIdErrorCallback: function(e, index) {
console.error(e.detail.errMsg, '---index', index); console.error(e.detail.errMsg, '---index', index);
......
...@@ -224,8 +224,9 @@ ...@@ -224,8 +224,9 @@
<view class="PY50"></view> <view class="PY50"></view>
<singleChoice v-if="optionVisible" :current="optionObj.id" :list="optionList" @close="close" <singleChoice v-if="optionVisible" :current="optionObj.id" :list="optionList" @close="close"
@change="popupCurrent"></singleChoice> @change="popupCurrent"></singleChoice>
<u-picker v-model="dateVisible" mode="time" :startMonth="$utils.GetDateFewFaysLater(-1).month" <u-picker v-model="dateVisible" mode="time"
:params="dateParams" @cancel="setDateHandler" @confirm="setDateHandler" confirmColor="#257BF2" :params="dateParams"
@cancel="setDateHandler" @confirm="setDateHandler" confirmColor="#257BF2"
:defaultTime="time"></u-picker> :defaultTime="time"></u-picker>
</view> </view>
</template> </template>
......
...@@ -43,14 +43,18 @@ ...@@ -43,14 +43,18 @@
font-size: 32rpx; font-size: 32rpx;
color: #FFFFFF; color: #FFFFFF;
white-space: nowrap; white-space: nowrap;
margin: 0 22rpx 20rpx; margin-bottom: 20rpx;
margin-left: 22rpx;
margin-right: 22rpx;
text-align: center;
padding: 5rpx 30rpx;
} }
.reimbursementInforText.active { .reimbursementInforText.active {
color: #257BF1; color: #257BF1;
background: #FFFFFF; background: #FFFFFF;
border-radius: 6rpx; border-radius: 6rpx;
padding: 5rpx 20rpx; padding: 5rpx 30rpx;
} }
.saveBox { .saveBox {
......
...@@ -180,11 +180,12 @@ ...@@ -180,11 +180,12 @@
}; };
}, },
onLoad() { onLoad() {
},
onShow() {
this.b2b_user_info = uni.getStorageSync('b2b_user'); this.b2b_user_info = uni.getStorageSync('b2b_user');
this.mall_UserInfo = uni.getStorageSync("mall_UserInfo"); this.mall_UserInfo = uni.getStorageSync("mall_UserInfo");
this.showAuth = !this.mall_UserInfo || !this.b2b_user_info; this.showAuth = !this.mall_UserInfo || !this.b2b_user_info;
},
onShow() {
const that = this const that = this
uni.getSystemInfo({ uni.getSystemInfo({
success(res) { 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