Commit 3603e586827793b90a30da4fe717b83cab6c157d

Authored by pengye
1 parent c7e7bdc6

小程序分享卡片

... ... @@ -524,14 +524,51 @@ Page({
}
},
// 生成海报
painterBtn(img, sellerName, date, time) {
img = img.replace(/^http:/, "https:");
painterBtn(liteStyle, timeStr) {
let style = liteStyle.split('-');
let type1 = style[0];
let type2 = style[1];
let data = this.data.detail;
let img = data.seller.seller_image.replace(/^http:/, "https:");
let d = data.ddate_solt;
let date1 = util.unixtoTime(data.ddate, 'MM月DD日');
let date2 = util.unixtoTime(data.ddate, 'MM/DD');
let week = ' ' + util.unixtoTime(data.ddate, '周WW');
let timeSlot1 = ' ' + (d == '1' ? '早上' : d == '2' ? '中午' : d == '3' ? '晚上' : '');
let timeSlot2 = ' ' + (d == '1' ? '早餐' : d == '2' ? '午餐' : d == '3' ? '晚餐' : '');
let time = this.data.temp_ddate ? ' ' + this.data.temp_ddate : ' ' + util.unixtoTime(data.ddate, 'HH:II')
time = timeStr ? timeStr : time;
let [day1, day2] = [...util.unixtoTime(data.ddate, '周WW')]
let section = ''
// 老样式1234
if (type1 && !type2) {
section = type1 == '1' ? week + timeSlot1 : type1 == '2' ? week + time : type1 == '3' ? week + timeSlot2 : '';
}
// 新样式
if (type1 && type2) {
if (type1 == '1') {
section = type2 == '1' ? date1 + week + time + timeSlot2 : type2 == '2' ? date1 + week + timeSlot1 : type2 == '3' ? date1 + week + time : type2 == '4' ? date1 + week + timeSlot2 : '';
}
if (type1 == '2') {
section = type2 == '1' ? week + time + timeSlot2 : type2 == '2' ? week + timeSlot1 : type2 == '3' ? week + time : type2 == '4' ? week + timeSlot2 : '';
}
if (type1 == '3' || type1 == '4') {
section = type2 == '1' ? timeSlot2.trim() + time : type2 == '2' ? timeSlot1.trim() : type2 == '3' ? time.trim() : type2 == '4' ? timeSlot2.trim() : '';
}
}
this.setData({
wxml: canvas({
imgUrl: img || 'https://nosqn.colorcun.com/reserve/images/3x/%E6%9A%82%E6%97%A0.png',
sellerName,
date,
time,
info: {
sellerName: data.seller.sellername,
date: util.unixtoTime(data.ddate, 'MM月DD日'),
time: section,
},
type1,
type2,
date2,
week,
day2,
})
})
},
... ... @@ -690,27 +727,13 @@ Page({
}
// 获取转发客人卡片设置
let detailInfo = this.data.detail;
if (data.lite_style == '0') {
let liteStyle = data.lite_style.split('-');
if (liteStyle[0] == '0') {
this.setData({
imgSrc: detailInfo.seller.seller_image
})
} else {
let d = detailInfo.ddate_solt;
let time1 = util.unixtoTime(detailInfo.ddate, '周WW') + ' ' + (d == '1' ? '早上' : d == '2' ? '中午' : d == '3' ? '晚上' : '');
let time2;
if (this.data.temp_ddate) {
time2 = util.unixtoTime(detailInfo.ddate, '周WW') + this.data.temp_ddate
} else {
time2 = util.unixtoTime(detailInfo.ddate, '周WW HH:II')
}
let time3 = util.unixtoTime(detailInfo.ddate, '周WW') + ' ' + (d == '1' ? '早餐' : d == '2' ? '午餐' : d == '3' ? '晚餐' : '');
let time = data.lite_style == '1' ? time1 : data.lite_style == '2' ? time2 : data.lite_style == '3' ? time3 : '';
this.painterBtn(
detailInfo.seller.seller_image,
detailInfo.seller.sellername,
util.unixtoTime(detailInfo.ddate, 'MM月DD日'),
time
);
this.painterBtn(data.lite_style);
}
}).catch(res => {
console.log('GetSellerTemplateConf请求失败');
... ... @@ -1122,12 +1145,13 @@ Page({
temp_ddate: times,
}).then(res => {
if (res.ret == 200) {
if (this.data.lite_style == '2') {
let time = (util.unixtoTime(detailInfo.ddate, '周WW') + temp_ddate) || (util.unixtoTime(detailInfo.ddate, '周WW') + this.data.timeList[index])
let style =this.data.lite_style.split('-');
let type1 =style[0];
let type2 =style[1];
if((type1=='2' && !type2) || (type2 && (type2 == '1' || type2 == '3'))){
let time = temp_ddate || this.data.timeList[index]
this.painterBtn(
detailInfo.seller.seller_image,
detailInfo.seller.sellername,
util.unixtoTime(detailInfo.ddate, 'MM月DD日'),
this.data.lite_style,
time
);
}
... ...
... ... @@ -534,14 +534,51 @@ Page({
}
},
// 生成海报
painterBtn(img, sellerName, date, time) {
img = img.replace(/^http:/, "https:");
painterBtn(liteStyle, timeStr) {
let style = liteStyle.split('-');
let type1 = style[0];
let type2 = style[1];
let data = this.data.detail;
let img = data.seller.seller_image.replace(/^http:/, "https:");
let d = data.ddate_solt;
let date1 = util.unixtoTime(data.ddate, 'MM月DD日');
let date2 = util.unixtoTime(data.ddate, 'MM/DD');
let week = ' ' + util.unixtoTime(data.ddate, '周WW');
let timeSlot1 = ' ' + (d == '1' ? '早上' : d == '2' ? '中午' : d == '3' ? '晚上' : '');
let timeSlot2 = ' ' + (d == '1' ? '早餐' : d == '2' ? '午餐' : d == '3' ? '晚餐' : '');
let time = this.data.temp_ddate ? ' ' + this.data.temp_ddate : ' ' + util.unixtoTime(data.ddate, 'HH:II')
time = timeStr ? timeStr : time;
let [day1, day2] = [...util.unixtoTime(data.ddate, '周WW')]
let section = ''
// 老样式1234
if (type1 && !type2) {
section = type1 == '1' ? week + timeSlot1 : type1 == '2' ? week + time : type1 == '3' ? week + timeSlot2 : '';
}
// 新样式
if (type1 && type2) {
if (type1 == '1') {
section = type2 == '1' ? date1 + week + time + timeSlot2 : type2 == '2' ? date1 + week + timeSlot1 : type2 == '3' ? date1 + week + time : type2 == '4' ? date1 + week + timeSlot2 : '';
}
if (type1 == '2') {
section = type2 == '1' ? week + time + timeSlot2 : type2 == '2' ? week + timeSlot1 : type2 == '3' ? week + time : type2 == '4' ? week + timeSlot2 : '';
}
if (type1 == '3' || type1 == '4') {
section = type2 == '1' ? timeSlot2.trim() + time : type2 == '2' ? timeSlot1.trim() : type2 == '3' ? time.trim() : type2 == '4' ? timeSlot2.trim() : '';
}
}
this.setData({
wxml: canvas({
imgUrl: img || 'https://nosqn.colorcun.com/reserve/images/3x/%E6%9A%82%E6%97%A0.png',
sellerName,
date,
time,
info: {
sellerName: data.seller.sellername,
date: util.unixtoTime(data.ddate, 'MM月DD日'),
time: section,
},
type1,
type2,
date2,
week,
day2,
})
})
},
... ... @@ -707,27 +744,13 @@ Page({
}
// 获取转发客人卡片设置
let detailInfo = this.data.detail;
if (data.lite_style == '0') {
let liteStyle = data.lite_style.split('-');
if (liteStyle[0] == '0') {
this.setData({
imgSrc: detailInfo.seller.seller_image
})
} else {
let d = detailInfo.ddate_solt;
let time1 = util.unixtoTime(detailInfo.ddate, '周WW') + ' ' + (d == '1' ? '早上' : d == '2' ? '中午' : d == '3' ? '晚上' : '');
let time2;
if (this.data.temp_ddate) {
time2 = util.unixtoTime(detailInfo.ddate, '周WW') + this.data.temp_ddate
} else {
time2 = util.unixtoTime(detailInfo.ddate, '周WW HH:II')
}
let time3 = util.unixtoTime(detailInfo.ddate, '周WW') + ' ' + (d == '1' ? '早餐' : d == '2' ? '午餐' : d == '3' ? '晚餐' : '');
let time = data.lite_style == '1' ? time1 : data.lite_style == '2' ? time2 : data.lite_style == '3' ? time3 : '';
this.painterBtn(
detailInfo.seller.seller_image,
detailInfo.seller.sellername,
util.unixtoTime(detailInfo.ddate, 'MM月DD日'),
time
);
this.painterBtn(data.lite_style);
}
}).catch(res => {
console.log('GetSellerTemplateConf请求失败');
... ... @@ -1186,12 +1209,13 @@ Page({
temp_ddate: times,
}).then(res => {
if (res.ret == 200) {
if (this.data.lite_style == '2') {
let time = (util.unixtoTime(detailInfo.ddate, '周WW') + temp_ddate) || (util.unixtoTime(detailInfo.ddate, '周WW') + this.data.timeList[index])
let style =this.data.lite_style.split('-');
let type1 =style[0];
let type2 =style[1];
if((type1=='2' && !type2) || (type2 && (type2 == '1' || type2 == '3'))){
let time = temp_ddate || this.data.timeList[index]
this.painterBtn(
detailInfo.seller.seller_image,
detailInfo.seller.sellername,
util.unixtoTime(detailInfo.ddate, 'MM月DD日'),
this.data.lite_style,
time
);
}
... ...
... ... @@ -549,14 +549,51 @@ Page({
}
},
// 生成海报
painterBtn(img, sellerName, date, time) {
img = img.replace(/^http:/, "https:");
painterBtn(liteStyle, timeStr) {
let style = liteStyle.split('-');
let type1 = style[0];
let type2 = style[1];
let data = this.data.detail;
let img = data.seller.seller_image.replace(/^http:/, "https:");
let d = data.ddate_solt;
let date1 = util.unixtoTime(data.ddate, 'MM月DD日');
let date2 = util.unixtoTime(data.ddate, 'MM/DD');
let week = ' ' + util.unixtoTime(data.ddate, '周WW');
let timeSlot1 = ' ' + (d == '1' ? '早上' : d == '2' ? '中午' : d == '3' ? '晚上' : '');
let timeSlot2 = ' ' + (d == '1' ? '早餐' : d == '2' ? '午餐' : d == '3' ? '晚餐' : '');
let time = this.data.temp_ddate ? ' ' + this.data.temp_ddate : ' ' + util.unixtoTime(data.ddate, 'HH:II')
time = timeStr ? timeStr : time;
let [day1, day2] = [...util.unixtoTime(data.ddate, '周WW')]
let section = ''
// 老样式1234
if (type1 && !type2) {
section = type1 == '1' ? week + timeSlot1 : type1 == '2' ? week + time : type1 == '3' ? week + timeSlot2 : '';
}
// 新样式
if (type1 && type2) {
if (type1 == '1') {
section = type2 == '1' ? date1 + week + time + timeSlot2 : type2 == '2' ? date1 + week + timeSlot1 : type2 == '3' ? date1 + week + time : type2 == '4' ? date1 + week + timeSlot2 : '';
}
if (type1 == '2') {
section = type2 == '1' ? week + time + timeSlot2 : type2 == '2' ? week + timeSlot1 : type2 == '3' ? week + time : type2 == '4' ? week + timeSlot2 : '';
}
if (type1 == '3' || type1 == '4') {
section = type2 == '1' ? timeSlot2.trim() + time : type2 == '2' ? timeSlot1.trim() : type2 == '3' ? time.trim() : type2 == '4' ? timeSlot2.trim() : '';
}
}
this.setData({
wxml: canvas({
imgUrl: img || 'https://nosqn.colorcun.com/reserve/images/3x/%E6%9A%82%E6%97%A0.png',
sellerName,
date,
time,
info: {
sellerName: data.seller.sellername,
date: util.unixtoTime(data.ddate, 'MM月DD日'),
time: section,
},
type1,
type2,
date2,
week,
day2,
})
})
},
... ... @@ -722,27 +759,13 @@ Page({
}
// 获取转发客人卡片设置
let detailInfo = this.data.detail;
if (data.lite_style == '0') {
let liteStyle = data.lite_style.split('-');
if (liteStyle[0] == '0') {
this.setData({
imgSrc: detailInfo.seller.seller_image
})
} else {
let d = detailInfo.ddate_solt;
let time1 = util.unixtoTime(detailInfo.ddate, '周WW') + ' ' + (d == '1' ? '早上' : d == '2' ? '中午' : d == '3' ? '晚上' : '');
let time2;
if (this.data.temp_ddate) {
time2 = util.unixtoTime(detailInfo.ddate, '周WW') + this.data.temp_ddate
} else {
time2 = util.unixtoTime(detailInfo.ddate, '周WW HH:II')
}
let time3 = util.unixtoTime(detailInfo.ddate, '周WW') + ' ' + (d == '1' ? '早餐' : d == '2' ? '午餐' : d == '3' ? '晚餐' : '');
let time = data.lite_style == '1' ? time1 : data.lite_style == '2' ? time2 : data.lite_style == '3' ? time3 : '';
this.painterBtn(
detailInfo.seller.seller_image,
detailInfo.seller.sellername,
util.unixtoTime(detailInfo.ddate, 'MM月DD日'),
time
);
this.painterBtn(data.lite_style);
}
}).catch(res => {
console.log('GetSellerTemplateConf请求失败');
... ... @@ -1201,12 +1224,13 @@ Page({
temp_ddate: times,
}).then(res => {
if (res.ret == 200) {
if (this.data.lite_style == '2') {
let time = (util.unixtoTime(detailInfo.ddate, '周WW') + temp_ddate) || (util.unixtoTime(detailInfo.ddate, '周WW') + this.data.timeList[index])
let style =this.data.lite_style.split('-');
let type1 =style[0];
let type2 =style[1];
if((type1=='2' && !type2) || (type2 && (type2 == '1' || type2 == '3'))){
let time = temp_ddate || this.data.timeList[index]
this.painterBtn(
detailInfo.seller.seller_image,
detailInfo.seller.sellername,
util.unixtoTime(detailInfo.ddate, 'MM月DD日'),
this.data.lite_style,
time
);
}
... ...
... ... @@ -509,17 +509,54 @@ Page({
}
},
// 生成海报
painterBtn(img,sellerName,date,time) {
img = img.replace(/^http:/, "https:");
this.setData({
wxml: canvas({
imgUrl: img || 'https://nosqn.colorcun.com/reserve/images/3x/%E6%9A%82%E6%97%A0.png',
sellerName,
date,
time,
})
})
},
painterBtn(liteStyle, timeStr) {
let style = liteStyle.split('-');
let type1 = style[0];
let type2 = style[1];
let data = this.data.detail;
let img = data.seller.seller_image.replace(/^http:/, "https:");
let d = data.ddate_solt;
let date1 = util.unixtoTime(data.ddate, 'MM月DD日');
let date2 = util.unixtoTime(data.ddate, 'MM/DD');
let week = ' ' + util.unixtoTime(data.ddate, '周WW');
let timeSlot1 = ' ' + (d == '1' ? '早上' : d == '2' ? '中午' : d == '3' ? '晚上' : '');
let timeSlot2 = ' ' + (d == '1' ? '早餐' : d == '2' ? '午餐' : d == '3' ? '晚餐' : '');
let time = this.data.temp_ddate ? ' ' + this.data.temp_ddate : ' ' + util.unixtoTime(data.ddate, 'HH:II')
time = timeStr ? timeStr : time;
let [day1, day2] = [...util.unixtoTime(data.ddate, '周WW')]
let section = ''
// 老样式1234
if (type1 && !type2) {
section = type1 == '1' ? week + timeSlot1 : type1 == '2' ? week + time : type1 == '3' ? week + timeSlot2 : '';
}
// 新样式
if (type1 && type2) {
if (type1 == '1') {
section = type2 == '1' ? date1 + week + time + timeSlot2 : type2 == '2' ? date1 + week + timeSlot1 : type2 == '3' ? date1 + week + time : type2 == '4' ? date1 + week + timeSlot2 : '';
}
if (type1 == '2') {
section = type2 == '1' ? week + time + timeSlot2 : type2 == '2' ? week + timeSlot1 : type2 == '3' ? week + time : type2 == '4' ? week + timeSlot2 : '';
}
if (type1 == '3' || type1 == '4') {
section = type2 == '1' ? timeSlot2.trim() + time : type2 == '2' ? timeSlot1.trim() : type2 == '3' ? time.trim() : type2 == '4' ? timeSlot2.trim() : '';
}
}
this.setData({
wxml: canvas({
imgUrl: img || 'https://nosqn.colorcun.com/reserve/images/3x/%E6%9A%82%E6%97%A0.png',
info: {
sellerName: data.seller.sellername,
date: util.unixtoTime(data.ddate, 'MM月DD日'),
time: section,
},
type1,
type2,
date2,
week,
day2,
})
})
},
onImgOK(e) {
this.setData({
imgSrc: e.detail.path
... ... @@ -720,27 +757,13 @@ Page({
}
// 获取转发客人卡片设置
let detailInfo = this.data.detail;
if (data.lite_style == '0') {
let liteStyle = data.lite_style.split('-');
if (liteStyle[0] == '0') {
this.setData({
imgSrc: detailInfo.seller.seller_image
})
} else {
let d = detailInfo.ddate_solt;
let time1 = util.unixtoTime(detailInfo.ddate, '周WW') + ' ' + (d == '1' ? '早上' : d == '2' ? '中午' : d == '3' ? '晚上' : '');
let time2;
if(this.data.temp_ddate){
time2 = util.unixtoTime(detailInfo.ddate, '周WW') + this.data.temp_ddate
}else{
time2 = util.unixtoTime(detailInfo.ddate, '周WW HH:II')
}
let time3 = util.unixtoTime(detailInfo.ddate, '周WW') + ' ' + (d == '1' ? '早餐' : d == '2' ? '午餐' : d == '3' ? '晚餐' : '');
let time = data.lite_style == '1' ? time1 : data.lite_style == '2' ? time2 : data.lite_style == '3' ? time3 : '';
this.painterBtn(
detailInfo.seller.seller_image,
detailInfo.seller.sellername,
util.unixtoTime(detailInfo.ddate, 'MM月DD日'),
time
);
this.painterBtn(data.lite_style);
}
}).catch(res => {
console.log('GetSellerTemplateConf请求失败');
... ... @@ -1124,12 +1147,13 @@ Page({
temp_ddate:times,
}).then(res => {
if (res.ret == 200) {
if (this.data.lite_style == '2') {
let time = (util.unixtoTime(detailInfo.ddate, '周WW') + temp_ddate) || (util.unixtoTime(detailInfo.ddate, '周WW') + this.data.timeList[index])
let style =this.data.lite_style.split('-');
let type1 =style[0];
let type2 =style[1];
if((type1=='2' && !type2) || (type2 && (type2 == '1' || type2 == '3'))){
let time = temp_ddate || this.data.timeList[index]
this.painterBtn(
detailInfo.seller.seller_image,
detailInfo.seller.sellername,
util.unixtoTime(detailInfo.ddate, 'MM月DD日'),
this.data.lite_style,
time
);
}
... ...
... ... @@ -509,17 +509,54 @@ Page({
}
},
// 生成海报
painterBtn(img,sellerName,date,time) {
img = img.replace(/^http:/, "https:");
this.setData({
wxml: canvas({
imgUrl: img || 'https://nosqn.colorcun.com/reserve/images/3x/%E6%9A%82%E6%97%A0.png',
sellerName,
date,
time,
})
})
},
painterBtn(liteStyle, timeStr) {
let style = liteStyle.split('-');
let type1 = style[0];
let type2 = style[1];
let data = this.data.detail;
let img = data.seller.seller_image.replace(/^http:/, "https:");
let d = data.ddate_solt;
let date1 = util.unixtoTime(data.ddate, 'MM月DD日');
let date2 = util.unixtoTime(data.ddate, 'MM/DD');
let week = ' ' + util.unixtoTime(data.ddate, '周WW');
let timeSlot1 = ' ' + (d == '1' ? '早上' : d == '2' ? '中午' : d == '3' ? '晚上' : '');
let timeSlot2 = ' ' + (d == '1' ? '早餐' : d == '2' ? '午餐' : d == '3' ? '晚餐' : '');
let time = this.data.temp_ddate ? ' ' + this.data.temp_ddate : ' ' + util.unixtoTime(data.ddate, 'HH:II')
time = timeStr ? timeStr : time;
let [day1, day2] = [...util.unixtoTime(data.ddate, '周WW')]
let section = ''
// 老样式1234
if (type1 && !type2) {
section = type1 == '1' ? week + timeSlot1 : type1 == '2' ? week + time : type1 == '3' ? week + timeSlot2 : '';
}
// 新样式
if (type1 && type2) {
if (type1 == '1') {
section = type2 == '1' ? date1 + week + time + timeSlot2 : type2 == '2' ? date1 + week + timeSlot1 : type2 == '3' ? date1 + week + time : type2 == '4' ? date1 + week + timeSlot2 : '';
}
if (type1 == '2') {
section = type2 == '1' ? week + time + timeSlot2 : type2 == '2' ? week + timeSlot1 : type2 == '3' ? week + time : type2 == '4' ? week + timeSlot2 : '';
}
if (type1 == '3' || type1 == '4') {
section = type2 == '1' ? timeSlot2.trim() + time : type2 == '2' ? timeSlot1.trim() : type2 == '3' ? time.trim() : type2 == '4' ? timeSlot2.trim() : '';
}
}
this.setData({
wxml: canvas({
imgUrl: img || 'https://nosqn.colorcun.com/reserve/images/3x/%E6%9A%82%E6%97%A0.png',
info: {
sellerName: data.seller.sellername,
date: util.unixtoTime(data.ddate, 'MM月DD日'),
time: section,
},
type1,
type2,
date2,
week,
day2,
})
})
},
onImgOK(e) {
this.setData({
imgSrc: e.detail.path
... ... @@ -675,27 +712,13 @@ Page({
}
// 获取转发客人卡片设置
let detailInfo = this.data.detail;
if (data.lite_style == '0') {
let liteStyle = data.lite_style.split('-');
if (liteStyle[0] == '0') {
this.setData({
imgSrc: detailInfo.seller.seller_image
})
} else {
let d = detailInfo.ddate_solt;
let time1 = util.unixtoTime(detailInfo.ddate, '周WW') + ' ' + (d == '1' ? '早上' : d == '2' ? '中午' : d == '3' ? '晚上' : '');
let time2;
if(this.data.temp_ddate){
time2 = util.unixtoTime(detailInfo.ddate, '周WW') + this.data.temp_ddate
}else{
time2 = util.unixtoTime(detailInfo.ddate, '周WW HH:II')
}
let time3 = util.unixtoTime(detailInfo.ddate, '周WW') + ' ' + (d == '1' ? '早餐' : d == '2' ? '午餐' : d == '3' ? '晚餐' : '');
let time = data.lite_style == '1' ? time1 : data.lite_style == '2' ? time2 : data.lite_style == '3' ? time3 : '';
this.painterBtn(
detailInfo.seller.seller_image,
detailInfo.seller.sellername,
util.unixtoTime(detailInfo.ddate, 'MM月DD日'),
time
);
this.painterBtn(data.lite_style);
}
}).catch(res => {
console.log('GetSellerTemplateConf请求失败');
... ... @@ -1079,12 +1102,13 @@ Page({
temp_ddate:times,
}).then(res => {
if (res.ret == 200) {
if (this.data.lite_style == '2') {
let time = (util.unixtoTime(detailInfo.ddate, '周WW') + temp_ddate) || (util.unixtoTime(detailInfo.ddate, '周WW') + this.data.timeList[index])
let style =this.data.lite_style.split('-');
let type1 =style[0];
let type2 =style[1];
if((type1=='2' && !type2) || (type2 && (type2 == '1' || type2 == '3'))){
let time = temp_ddate || this.data.timeList[index]
this.painterBtn(
detailInfo.seller.seller_image,
detailInfo.seller.sellername,
util.unixtoTime(detailInfo.ddate, 'MM月DD日'),
this.data.lite_style,
time
);
}
... ...
... ... @@ -509,17 +509,54 @@ Page({
}
},
// 生成海报
painterBtn(img,sellerName,date,time) {
img = img.replace(/^http:/, "https:");
this.setData({
wxml: canvas({
imgUrl: img || 'https://nosqn.colorcun.com/reserve/images/3x/%E6%9A%82%E6%97%A0.png',
sellerName,
date,
time,
})
})
},
painterBtn(liteStyle, timeStr) {
let style = liteStyle.split('-');
let type1 = style[0];
let type2 = style[1];
let data = this.data.detail;
let img = data.seller.seller_image.replace(/^http:/, "https:");
let d = data.ddate_solt;
let date1 = util.unixtoTime(data.ddate, 'MM月DD日');
let date2 = util.unixtoTime(data.ddate, 'MM/DD');
let week = ' ' + util.unixtoTime(data.ddate, '周WW');
let timeSlot1 = ' ' + (d == '1' ? '早上' : d == '2' ? '中午' : d == '3' ? '晚上' : '');
let timeSlot2 = ' ' + (d == '1' ? '早餐' : d == '2' ? '午餐' : d == '3' ? '晚餐' : '');
let time = this.data.temp_ddate ? ' ' + this.data.temp_ddate : ' ' + util.unixtoTime(data.ddate, 'HH:II')
time = timeStr ? timeStr : time;
let [day1, day2] = [...util.unixtoTime(data.ddate, '周WW')]
let section = ''
// 老样式1234
if (type1 && !type2) {
section = type1 == '1' ? week + timeSlot1 : type1 == '2' ? week + time : type1 == '3' ? week + timeSlot2 : '';
}
// 新样式
if (type1 && type2) {
if (type1 == '1') {
section = type2 == '1' ? date1 + week + time + timeSlot2 : type2 == '2' ? date1 + week + timeSlot1 : type2 == '3' ? date1 + week + time : type2 == '4' ? date1 + week + timeSlot2 : '';
}
if (type1 == '2') {
section = type2 == '1' ? week + time + timeSlot2 : type2 == '2' ? week + timeSlot1 : type2 == '3' ? week + time : type2 == '4' ? week + timeSlot2 : '';
}
if (type1 == '3' || type1 == '4') {
section = type2 == '1' ? timeSlot2.trim() + time : type2 == '2' ? timeSlot1.trim() : type2 == '3' ? time.trim() : type2 == '4' ? timeSlot2.trim() : '';
}
}
this.setData({
wxml: canvas({
imgUrl: img || 'https://nosqn.colorcun.com/reserve/images/3x/%E6%9A%82%E6%97%A0.png',
info: {
sellerName: data.seller.sellername,
date: util.unixtoTime(data.ddate, 'MM月DD日'),
time: section,
},
type1,
type2,
date2,
week,
day2,
})
})
},
onImgOK(e) {
this.setData({
imgSrc: e.detail.path
... ... @@ -675,27 +712,14 @@ Page({
}
// 获取转发客人卡片设置
let detailInfo = this.data.detail;
if (data.lite_style == '0') {
let liteStyle = data.lite_style.split('-');
if (liteStyle[0] == '0') {
this.setData({
imgSrc: detailInfo.seller.seller_image
})
} else {
let d = detailInfo.ddate_solt;
let time1 = util.unixtoTime(detailInfo.ddate, '周WW') + ' ' + (d == '1' ? '早上' : d == '2' ? '中午' : d == '3' ? '晚上' : '');
let time2;
if(this.data.temp_ddate){
time2 = util.unixtoTime(detailInfo.ddate, '周WW') + this.data.temp_ddate
}else{
time2 = util.unixtoTime(detailInfo.ddate, '周WW HH:II')
}
let time3 = util.unixtoTime(detailInfo.ddate, '周WW') + ' ' + (d == '1' ? '早餐' : d == '2' ? '午餐' : d == '3' ? '晚餐' : '');
let time = data.lite_style == '1' ? time1 : data.lite_style == '2' ? time2 : data.lite_style == '3' ? time3 : '';
this.painterBtn(
detailInfo.seller.seller_image,
detailInfo.seller.sellername,
util.unixtoTime(detailInfo.ddate, 'MM月DD日'),
time
);
this.painterBtn(data.lite_style);
}
}).catch(res => {
console.log('GetSellerTemplateConf请求失败');
... ... @@ -1079,12 +1103,13 @@ Page({
temp_ddate:times,
}).then(res => {
if (res.ret == 200) {
if (this.data.lite_style == '2') {
let time = (util.unixtoTime(detailInfo.ddate, '周WW') + temp_ddate) || (util.unixtoTime(detailInfo.ddate, '周WW') + this.data.timeList[index])
let style =this.data.lite_style.split('-');
let type1 =style[0];
let type2 =style[1];
if((type1=='2' && !type2) || (type2 && (type2 == '1' || type2 == '3'))){
let time = temp_ddate || this.data.timeList[index]
this.painterBtn(
detailInfo.seller.seller_image,
detailInfo.seller.sellername,
util.unixtoTime(detailInfo.ddate, 'MM月DD日'),
this.data.lite_style,
time
);
}
... ...
... ... @@ -508,17 +508,54 @@ Page({
}
},
// 生成海报
painterBtn(img,sellerName,date,time) {
img = img.replace(/^http:/, "https:");
this.setData({
wxml: canvas({
imgUrl: img || 'https://nosqn.colorcun.com/reserve/images/3x/%E6%9A%82%E6%97%A0.png',
sellerName,
date,
time,
})
})
},
painterBtn(liteStyle, timeStr) {
let style = liteStyle.split('-');
let type1 = style[0];
let type2 = style[1];
let data = this.data.detail;
let img = data.seller.seller_image.replace(/^http:/, "https:");
let d = data.ddate_solt;
let date1 = util.unixtoTime(data.ddate, 'MM月DD日');
let date2 = util.unixtoTime(data.ddate, 'MM/DD');
let week = ' ' + util.unixtoTime(data.ddate, '周WW');
let timeSlot1 = ' ' + (d == '1' ? '早上' : d == '2' ? '中午' : d == '3' ? '晚上' : '');
let timeSlot2 = ' ' + (d == '1' ? '早餐' : d == '2' ? '午餐' : d == '3' ? '晚餐' : '');
let time = this.data.temp_ddate ? ' ' + this.data.temp_ddate : ' ' + util.unixtoTime(data.ddate, 'HH:II')
time = timeStr ? timeStr : time;
let [day1, day2] = [...util.unixtoTime(data.ddate, '周WW')]
let section = ''
// 老样式1234
if (type1 && !type2) {
section = type1 == '1' ? week + timeSlot1 : type1 == '2' ? week + time : type1 == '3' ? week + timeSlot2 : '';
}
// 新样式
if (type1 && type2) {
if (type1 == '1') {
section = type2 == '1' ? date1 + week + time + timeSlot2 : type2 == '2' ? date1 + week + timeSlot1 : type2 == '3' ? date1 + week + time : type2 == '4' ? date1 + week + timeSlot2 : '';
}
if (type1 == '2') {
section = type2 == '1' ? week + time + timeSlot2 : type2 == '2' ? week + timeSlot1 : type2 == '3' ? week + time : type2 == '4' ? week + timeSlot2 : '';
}
if (type1 == '3' || type1 == '4') {
section = type2 == '1' ? timeSlot2.trim() + time : type2 == '2' ? timeSlot1.trim() : type2 == '3' ? time.trim() : type2 == '4' ? timeSlot2.trim() : '';
}
}
this.setData({
wxml: canvas({
imgUrl: img || 'https://nosqn.colorcun.com/reserve/images/3x/%E6%9A%82%E6%97%A0.png',
info: {
sellerName: data.seller.sellername,
date: util.unixtoTime(data.ddate, 'MM月DD日'),
time: section,
},
type1,
type2,
date2,
week,
day2,
})
})
},
onImgOK(e) {
this.setData({
imgSrc: e.detail.path
... ... @@ -674,27 +711,13 @@ Page({
}
// 获取转发客人卡片设置
let detailInfo = this.data.detail;
if (data.lite_style == '0') {
let liteStyle = data.lite_style.split('-');
if (liteStyle[0] == '0') {
this.setData({
imgSrc: detailInfo.seller.seller_image
})
} else {
let d = detailInfo.ddate_solt;
let time1 = util.unixtoTime(detailInfo.ddate, '周WW') + ' ' + (d == '1' ? '早上' : d == '2' ? '中午' : d == '3' ? '晚上' : '');
let time2;
if(this.data.temp_ddate){
time2 = util.unixtoTime(detailInfo.ddate, '周WW') + this.data.temp_ddate
}else{
time2 = util.unixtoTime(detailInfo.ddate, '周WW HH:II')
}
let time3 = util.unixtoTime(detailInfo.ddate, '周WW') + ' ' + (d == '1' ? '早餐' : d == '2' ? '午餐' : d == '3' ? '晚餐' : '');
let time = data.lite_style == '1' ? time1 : data.lite_style == '2' ? time2 : data.lite_style == '3' ? time3 : '';
this.painterBtn(
detailInfo.seller.seller_image,
detailInfo.seller.sellername,
util.unixtoTime(detailInfo.ddate, 'MM月DD日'),
time
);
this.painterBtn(data.lite_style);
}
}).catch(res => {
console.log('GetSellerTemplateConf请求失败');
... ... @@ -1078,12 +1101,13 @@ Page({
temp_ddate:times,
}).then(res => {
if (res.ret == 200) {
if (this.data.lite_style == '2') {
let time = (util.unixtoTime(detailInfo.ddate, '周WW') + temp_ddate) || (util.unixtoTime(detailInfo.ddate, '周WW') + this.data.timeList[index])
let style =this.data.lite_style.split('-');
let type1 =style[0];
let type2 =style[1];
if((type1=='2' && !type2) || (type2 && (type2 == '1' || type2 == '3'))){
let time = temp_ddate || this.data.timeList[index]
this.painterBtn(
detailInfo.seller.seller_image,
detailInfo.seller.sellername,
util.unixtoTime(detailInfo.ddate, 'MM月DD日'),
this.data.lite_style,
time
);
}
... ...
... ... @@ -461,17 +461,54 @@ Page({
}
},
// 生成海报
painterBtn(img,sellerName,date,time) {
img = img.replace(/^http:/, "https:");
this.setData({
wxml: canvas({
imgUrl: img || 'https://nosqn.colorcun.com/reserve/images/3x/%E6%9A%82%E6%97%A0.png',
sellerName,
date,
time,
})
})
},
painterBtn(liteStyle, timeStr) {
let style = liteStyle.split('-');
let type1 = style[0];
let type2 = style[1];
let data = this.data.detail;
let img = data.seller.seller_image.replace(/^http:/, "https:");
let d = data.ddate_solt;
let date1 = util.unixtoTime(data.ddate, 'MM月DD日');
let date2 = util.unixtoTime(data.ddate, 'MM/DD');
let week = ' ' + util.unixtoTime(data.ddate, '周WW');
let timeSlot1 = ' ' + (d == '1' ? '早上' : d == '2' ? '中午' : d == '3' ? '晚上' : '');
let timeSlot2 = ' ' + (d == '1' ? '早餐' : d == '2' ? '午餐' : d == '3' ? '晚餐' : '');
let time = this.data.temp_ddate ? ' ' + this.data.temp_ddate : ' ' + util.unixtoTime(data.ddate, 'HH:II')
time = timeStr ? timeStr : time;
let [day1, day2] = [...util.unixtoTime(data.ddate, '周WW')]
let section = ''
// 老样式1234
if (type1 && !type2) {
section = type1 == '1' ? week + timeSlot1 : type1 == '2' ? week + time : type1 == '3' ? week + timeSlot2 : '';
}
// 新样式
if (type1 && type2) {
if (type1 == '1') {
section = type2 == '1' ? date1 + week + time + timeSlot2 : type2 == '2' ? date1 + week + timeSlot1 : type2 == '3' ? date1 + week + time : type2 == '4' ? date1 + week + timeSlot2 : '';
}
if (type1 == '2') {
section = type2 == '1' ? week + time + timeSlot2 : type2 == '2' ? week + timeSlot1 : type2 == '3' ? week + time : type2 == '4' ? week + timeSlot2 : '';
}
if (type1 == '3' || type1 == '4') {
section = type2 == '1' ? timeSlot2.trim() + time : type2 == '2' ? timeSlot1.trim() : type2 == '3' ? time.trim() : type2 == '4' ? timeSlot2.trim() : '';
}
}
this.setData({
wxml: canvas({
imgUrl: img || 'https://nosqn.colorcun.com/reserve/images/3x/%E6%9A%82%E6%97%A0.png',
info: {
sellerName: data.seller.sellername,
date: util.unixtoTime(data.ddate, 'MM月DD日'),
time: section,
},
type1,
type2,
date2,
week,
day2,
})
})
},
onImgOK(e) {
this.setData({
imgSrc: e.detail.path
... ... @@ -631,27 +668,13 @@ Page({
}
// 获取转发客人卡片设置
let detailInfo = this.data.detail;
if (data.lite_style == '0') {
let liteStyle = data.lite_style.split('-');
if (liteStyle[0] == '0') {
this.setData({
imgSrc: detailInfo.seller.seller_image
})
} else {
let d = detailInfo.ddate_solt;
let time1 = util.unixtoTime(detailInfo.ddate, '周WW') + ' ' + (d == '1' ? '早上' : d == '2' ? '中午' : d == '3' ? '晚上' : '');
let time2;
if(this.data.temp_ddate){
time2 = util.unixtoTime(detailInfo.ddate, '周WW') + this.data.temp_ddate
}else{
time2 = util.unixtoTime(detailInfo.ddate, '周WW HH:II')
}
let time3 = util.unixtoTime(detailInfo.ddate, '周WW') + ' ' + (d == '1' ? '早餐' : d == '2' ? '午餐' : d == '3' ? '晚餐' : '');
let time = data.lite_style == '1' ? time1 : data.lite_style == '2' ? time2 : data.lite_style == '3' ? time3 : '';
this.painterBtn(
detailInfo.seller.seller_image,
detailInfo.seller.sellername,
util.unixtoTime(detailInfo.ddate, 'MM月DD日'),
time
);
this.painterBtn(data.lite_style);
}
}).catch(res => {
console.log('GetSellerTemplateConf请求失败');
... ... @@ -1035,12 +1058,13 @@ Page({
temp_ddate:times,
}).then(res => {
if (res.ret == 200) {
if (this.data.lite_style == '2') {
let time = (util.unixtoTime(detailInfo.ddate, '周WW') + temp_ddate) || (util.unixtoTime(detailInfo.ddate, '周WW') + this.data.timeList[index])
let style =this.data.lite_style.split('-');
let type1 =style[0];
let type2 =style[1];
if((type1=='2' && !type2) || (type2 && (type2 == '1' || type2 == '3'))){
let time = temp_ddate || this.data.timeList[index]
this.painterBtn(
detailInfo.seller.seller_image,
detailInfo.seller.sellername,
util.unixtoTime(detailInfo.ddate, 'MM月DD日'),
this.data.lite_style,
time
);
}
... ...
... ... @@ -509,17 +509,54 @@ Page({
}
},
// 生成海报
painterBtn(img,sellerName,date,time) {
img = img.replace(/^http:/, "https:");
this.setData({
wxml: canvas({
imgUrl: img || 'https://nosqn.colorcun.com/reserve/images/3x/%E6%9A%82%E6%97%A0.png',
sellerName,
date,
time,
})
})
},
painterBtn(liteStyle, timeStr) {
let style = liteStyle.split('-');
let type1 = style[0];
let type2 = style[1];
let data = this.data.detail;
let img = data.seller.seller_image.replace(/^http:/, "https:");
let d = data.ddate_solt;
let date1 = util.unixtoTime(data.ddate, 'MM月DD日');
let date2 = util.unixtoTime(data.ddate, 'MM/DD');
let week = ' ' + util.unixtoTime(data.ddate, '周WW');
let timeSlot1 = ' ' + (d == '1' ? '早上' : d == '2' ? '中午' : d == '3' ? '晚上' : '');
let timeSlot2 = ' ' + (d == '1' ? '早餐' : d == '2' ? '午餐' : d == '3' ? '晚餐' : '');
let time = this.data.temp_ddate ? ' ' + this.data.temp_ddate : ' ' + util.unixtoTime(data.ddate, 'HH:II')
time = timeStr ? timeStr : time;
let [day1, day2] = [...util.unixtoTime(data.ddate, '周WW')]
let section = ''
// 老样式1234
if (type1 && !type2) {
section = type1 == '1' ? week + timeSlot1 : type1 == '2' ? week + time : type1 == '3' ? week + timeSlot2 : '';
}
// 新样式
if (type1 && type2) {
if (type1 == '1') {
section = type2 == '1' ? date1 + week + time + timeSlot2 : type2 == '2' ? date1 + week + timeSlot1 : type2 == '3' ? date1 + week + time : type2 == '4' ? date1 + week + timeSlot2 : '';
}
if (type1 == '2') {
section = type2 == '1' ? week + time + timeSlot2 : type2 == '2' ? week + timeSlot1 : type2 == '3' ? week + time : type2 == '4' ? week + timeSlot2 : '';
}
if (type1 == '3' || type1 == '4') {
section = type2 == '1' ? timeSlot2.trim() + time : type2 == '2' ? timeSlot1.trim() : type2 == '3' ? time.trim() : type2 == '4' ? timeSlot2.trim() : '';
}
}
this.setData({
wxml: canvas({
imgUrl: img || 'https://nosqn.colorcun.com/reserve/images/3x/%E6%9A%82%E6%97%A0.png',
info: {
sellerName: data.seller.sellername,
date: util.unixtoTime(data.ddate, 'MM月DD日'),
time: section,
},
type1,
type2,
date2,
week,
day2,
})
})
},
onImgOK(e) {
this.setData({
imgSrc: e.detail.path
... ... @@ -675,27 +712,13 @@ Page({
}
// 获取转发客人卡片设置
let detailInfo = this.data.detail;
if (data.lite_style == '0') {
let liteStyle = data.lite_style.split('-');
if (liteStyle[0] == '0') {
this.setData({
imgSrc: detailInfo.seller.seller_image
})
} else {
let d = detailInfo.ddate_solt;
let time1 = util.unixtoTime(detailInfo.ddate, '周WW') + ' ' + (d == '1' ? '早上' : d == '2' ? '中午' : d == '3' ? '晚上' : '');
let time2;
if(this.data.temp_ddate){
time2 = util.unixtoTime(detailInfo.ddate, '周WW') + this.data.temp_ddate
}else{
time2 = util.unixtoTime(detailInfo.ddate, '周WW HH:II')
}
let time3 = util.unixtoTime(detailInfo.ddate, '周WW') + ' ' + (d == '1' ? '早餐' : d == '2' ? '午餐' : d == '3' ? '晚餐' : '');
let time = data.lite_style == '1' ? time1 : data.lite_style == '2' ? time2 : data.lite_style == '3' ? time3 : '';
this.painterBtn(
detailInfo.seller.seller_image,
detailInfo.seller.sellername,
util.unixtoTime(detailInfo.ddate, 'MM月DD日'),
time
);
this.painterBtn(data.lite_style);
}
}).catch(res => {
console.log('GetSellerTemplateConf请求失败');
... ... @@ -1079,12 +1102,13 @@ Page({
temp_ddate:times,
}).then(res => {
if (res.ret == 200) {
if (this.data.lite_style == '2') {
let time = (util.unixtoTime(detailInfo.ddate, '周WW') + temp_ddate) || (util.unixtoTime(detailInfo.ddate, '周WW') + this.data.timeList[index])
let style =this.data.lite_style.split('-');
let type1 =style[0];
let type2 =style[1];
if((type1=='2' && !type2) || (type2 && (type2 == '1' || type2 == '3'))){
let time = temp_ddate || this.data.timeList[index]
this.painterBtn(
detailInfo.seller.seller_image,
detailInfo.seller.sellername,
util.unixtoTime(detailInfo.ddate, 'MM月DD日'),
this.data.lite_style,
time
);
}
... ...
... ... @@ -508,17 +508,54 @@ Page({
}
},
// 生成海报
painterBtn(img,sellerName,date,time) {
img = img.replace(/^http:/, "https:");
this.setData({
wxml: canvas({
imgUrl: img || 'https://nosqn.colorcun.com/reserve/images/3x/%E6%9A%82%E6%97%A0.png',
sellerName,
date,
time,
})
})
},
painterBtn(liteStyle, timeStr) {
let style = liteStyle.split('-');
let type1 = style[0];
let type2 = style[1];
let data = this.data.detail;
let img = data.seller.seller_image.replace(/^http:/, "https:");
let d = data.ddate_solt;
let date1 = util.unixtoTime(data.ddate, 'MM月DD日');
let date2 = util.unixtoTime(data.ddate, 'MM/DD');
let week = ' ' + util.unixtoTime(data.ddate, '周WW');
let timeSlot1 = ' ' + (d == '1' ? '早上' : d == '2' ? '中午' : d == '3' ? '晚上' : '');
let timeSlot2 = ' ' + (d == '1' ? '早餐' : d == '2' ? '午餐' : d == '3' ? '晚餐' : '');
let time = this.data.temp_ddate ? ' ' + this.data.temp_ddate : ' ' + util.unixtoTime(data.ddate, 'HH:II')
time = timeStr ? timeStr : time;
let [day1, day2] = [...util.unixtoTime(data.ddate, '周WW')]
let section = ''
// 老样式1234
if (type1 && !type2) {
section = type1 == '1' ? week + timeSlot1 : type1 == '2' ? week + time : type1 == '3' ? week + timeSlot2 : '';
}
// 新样式
if (type1 && type2) {
if (type1 == '1') {
section = type2 == '1' ? date1 + week + time + timeSlot2 : type2 == '2' ? date1 + week + timeSlot1 : type2 == '3' ? date1 + week + time : type2 == '4' ? date1 + week + timeSlot2 : '';
}
if (type1 == '2') {
section = type2 == '1' ? week + time + timeSlot2 : type2 == '2' ? week + timeSlot1 : type2 == '3' ? week + time : type2 == '4' ? week + timeSlot2 : '';
}
if (type1 == '3' || type1 == '4') {
section = type2 == '1' ? timeSlot2.trim() + time : type2 == '2' ? timeSlot1.trim() : type2 == '3' ? time.trim() : type2 == '4' ? timeSlot2.trim() : '';
}
}
this.setData({
wxml: canvas({
imgUrl: img || 'https://nosqn.colorcun.com/reserve/images/3x/%E6%9A%82%E6%97%A0.png',
info: {
sellerName: data.seller.sellername,
date: util.unixtoTime(data.ddate, 'MM月DD日'),
time: section,
},
type1,
type2,
date2,
week,
day2,
})
})
},
onImgOK(e) {
this.setData({
imgSrc: e.detail.path
... ... @@ -674,27 +711,13 @@ Page({
}
// 获取转发客人卡片设置
let detailInfo = this.data.detail;
if (data.lite_style == '0') {
let liteStyle = data.lite_style.split('-');
if (liteStyle[0] == '0') {
this.setData({
imgSrc: detailInfo.seller.seller_image
})
} else {
let d = detailInfo.ddate_solt;
let time1 = util.unixtoTime(detailInfo.ddate, '周WW') + ' ' + (d == '1' ? '早上' : d == '2' ? '中午' : d == '3' ? '晚上' : '');
let time2;
if(this.data.temp_ddate){
time2 = util.unixtoTime(detailInfo.ddate, '周WW') + this.data.temp_ddate
}else{
time2 = util.unixtoTime(detailInfo.ddate, '周WW HH:II')
}
let time3 = util.unixtoTime(detailInfo.ddate, '周WW') + ' ' + (d == '1' ? '早餐' : d == '2' ? '午餐' : d == '3' ? '晚餐' : '');
let time = data.lite_style == '1' ? time1 : data.lite_style == '2' ? time2 : data.lite_style == '3' ? time3 : '';
this.painterBtn(
detailInfo.seller.seller_image,
detailInfo.seller.sellername,
util.unixtoTime(detailInfo.ddate, 'MM月DD日'),
time
);
this.painterBtn(data.lite_style);
}
}).catch(res => {
console.log('GetSellerTemplateConf请求失败');
... ... @@ -1078,12 +1101,13 @@ Page({
temp_ddate:times,
}).then(res => {
if (res.ret == 200) {
if (this.data.lite_style == '2') {
let time = (util.unixtoTime(detailInfo.ddate, '周WW') + temp_ddate) || (util.unixtoTime(detailInfo.ddate, '周WW') + this.data.timeList[index])
let style =this.data.lite_style.split('-');
let type1 =style[0];
let type2 =style[1];
if((type1=='2' && !type2) || (type2 && (type2 == '1' || type2 == '3'))){
let time = temp_ddate || this.data.timeList[index]
this.painterBtn(
detailInfo.seller.seller_image,
detailInfo.seller.sellername,
util.unixtoTime(detailInfo.ddate, 'MM月DD日'),
this.data.lite_style,
time
);
}
... ...
... ... @@ -528,14 +528,51 @@ Page({
}
},
// 生成海报
painterBtn(img, sellerName, date, time) {
img = img.replace(/^http:/, "https:");
painterBtn(liteStyle, timeStr) {
let style = liteStyle.split('-');
let type1 = style[0];
let type2 = style[1];
let data = this.data.detail;
let img = data.seller.seller_image.replace(/^http:/, "https:");
let d = data.ddate_solt;
let date1 = util.unixtoTime(data.ddate, 'MM月DD日');
let date2 = util.unixtoTime(data.ddate, 'MM/DD');
let week = ' ' + util.unixtoTime(data.ddate, '周WW');
let timeSlot1 = ' ' + (d == '1' ? '早上' : d == '2' ? '中午' : d == '3' ? '晚上' : '');
let timeSlot2 = ' ' + (d == '1' ? '早餐' : d == '2' ? '午餐' : d == '3' ? '晚餐' : '');
let time = this.data.temp_ddate ? ' ' + this.data.temp_ddate : ' ' + util.unixtoTime(data.ddate, 'HH:II')
time = timeStr ? timeStr : time;
let [day1, day2] = [...util.unixtoTime(data.ddate, '周WW')]
let section = ''
// 老样式1234
if (type1 && !type2) {
section = type1 == '1' ? week + timeSlot1 : type1 == '2' ? week + time : type1 == '3' ? week + timeSlot2 : '';
}
// 新样式
if (type1 && type2) {
if (type1 == '1') {
section = type2 == '1' ? date1 + week + time + timeSlot2 : type2 == '2' ? date1 + week + timeSlot1 : type2 == '3' ? date1 + week + time : type2 == '4' ? date1 + week + timeSlot2 : '';
}
if (type1 == '2') {
section = type2 == '1' ? week + time + timeSlot2 : type2 == '2' ? week + timeSlot1 : type2 == '3' ? week + time : type2 == '4' ? week + timeSlot2 : '';
}
if (type1 == '3' || type1 == '4') {
section = type2 == '1' ? timeSlot2.trim() + time : type2 == '2' ? timeSlot1.trim() : type2 == '3' ? time.trim() : type2 == '4' ? timeSlot2.trim() : '';
}
}
this.setData({
wxml: canvas({
imgUrl: img || 'https://nosqn.colorcun.com/reserve/images/3x/%E6%9A%82%E6%97%A0.png',
sellerName,
date,
time,
info: {
sellerName: data.seller.sellername,
date: util.unixtoTime(data.ddate, 'MM月DD日'),
time: section,
},
type1,
type2,
date2,
week,
day2,
})
})
},
... ... @@ -708,27 +745,13 @@ Page({
}
// 获取转发客人卡片设置
let detailInfo = this.data.detail;
if (data.lite_style == '0') {
let liteStyle = data.lite_style.split('-');
if (liteStyle[0] == '0') {
this.setData({
imgSrc: detailInfo.seller.seller_image
})
} else {
let d = detailInfo.ddate_solt;
let time1 = util.unixtoTime(detailInfo.ddate, '周WW') + ' ' + (d == '1' ? '早上' : d == '2' ? '中午' : d == '3' ? '晚上' : '');
let time2;
if(this.data.temp_ddate){
time2 = util.unixtoTime(detailInfo.ddate, '周WW') + this.data.temp_ddate
}else{
time2 = util.unixtoTime(detailInfo.ddate, '周WW HH:II')
}
let time3 = util.unixtoTime(detailInfo.ddate, '周WW') + ' ' + (d == '1' ? '早餐' : d == '2' ? '午餐' : d == '3' ? '晚餐' : '');
let time = data.lite_style == '1' ? time1 : data.lite_style == '2' ? time2 : data.lite_style == '3' ? time3 : '';
this.painterBtn(
detailInfo.seller.seller_image,
detailInfo.seller.sellername,
util.unixtoTime(detailInfo.ddate, 'MM月DD日'),
time
);
this.painterBtn(data.lite_style);
}
}).catch(res => {
console.log('GetSellerTemplateConf请求失败');
... ... @@ -1112,12 +1135,13 @@ Page({
temp_ddate:times,
}).then(res => {
if (res.ret == 200) {
if (this.data.lite_style == '2') {
let time = (util.unixtoTime(detailInfo.ddate, '周WW') + temp_ddate) || (util.unixtoTime(detailInfo.ddate, '周WW') + this.data.timeList[index])
let style =this.data.lite_style.split('-');
let type1 =style[0];
let type2 =style[1];
if((type1=='2' && !type2) || (type2 && (type2 == '1' || type2 == '3'))){
let time = temp_ddate || this.data.timeList[index]
this.painterBtn(
detailInfo.seller.seller_image,
detailInfo.seller.sellername,
util.unixtoTime(detailInfo.ddate, 'MM月DD日'),
this.data.lite_style,
time
);
}
... ...
// canvas.js
module.exports = data => {
return ({
"width": "210px",
"height": "168px",
"views": [{
"type": "image",
"url": data.imgUrl,
"css": {
"width": "210px",
"height": "168px",
"top": "0px",
"left": "0px",
"mode": "aspectFill"
}
},
{
"type": "image",
"url": 'https://nosqn.colorcun.com/rectangleBj.png',
"css": {
"width": "210px",
"height": "168px",
"top": "0px",
"left": "0px",
"mode": "aspectFill"
}
},
{
"type": "text",
"text": data.sellerName,
"css": {
"color": "#FFEFC5",
"width": "190px",
"top": "10px",
"left": "10px",
"right": "10px",
"borderColor": "#000000",
"fontSize": "12px",
"fontWeight": "normal",
"maxLines": "2",
"textStyle": "fill",
"textDecoration": "none",
"fontFamily": "PingFang SC",
"textAlign": "center",
}
},
{
"type": "text",
"text": data.date,
"css": {
"color": "#FFEFC5",
"width": "210px",
"height": "168px",
"top": "70px",
"borderColor": "#000000",
"fontSize": "20px",
"fontWeight": "bold",
"maxLines": "3",
"textStyle": "fill",
"textDecoration": "none",
"fontFamily": "PingFang SC",
"textAlign": "center",
}
},
{
"type": "text",
"text": data.time,
"css": {
"color": "#FFEFC5",
"width": "210px",
"height": "168px",
"top": "100px",
"borderColor": "#000000",
"fontSize": "18px",
"fontWeight": "bold",
"maxLines": "3",
"textStyle": "fill",
"textDecoration": "none",
"fontFamily": "PingFang SC",
"textAlign": "center",
}
},
]
});
const views = [{
"type": "image",
"url": data.imgUrl,
"css": {
"width": "210px",
"height": "168px",
"top": "0px",
"left": "0px",
"mode": "aspectFill"
}
}, ]
// 原来的样式1,2,3
if (data.type1 && !data.type2) {
views.push({
"type": "image",
"url": 'https://nosqn.colorcun.com/rectangleBj.png',
"css": {
"width": "210px",
"height": "168px",
"top": "0px",
"left": "0px",
"mode": "aspectFill"
}
}, {
"type": "text",
"text": data.info.sellerName,
"css": {
"color": "#FFEFC5",
"width": "190px",
"top": "10px",
"left": "10px",
"right": "10px",
"borderColor": "#000000",
"fontSize": "12px",
"fontWeight": "normal",
"maxLines": "2",
"textStyle": "fill",
"textDecoration": "none",
"fontFamily": "PingFang SC",
"textAlign": "center",
}
}, {
"type": "text",
"text": data.info.date,
"css": {
"color": "#FFEFC5",
"width": "210px",
"height": "168px",
"top": "70px",
"borderColor": "#000000",
"fontSize": "20px",
"fontWeight": "bold",
"maxLines": "3",
"textStyle": "fill",
"textDecoration": "none",
"fontFamily": "PingFang SC",
"textAlign": "center",
}
}, {
"type": "text",
"text": data.info.time,
"css": {
"color": "#FFEFC5",
"width": "210px",
"height": "168px",
"top": "100px",
"borderColor": "#000000",
"fontSize": "18px",
"fontWeight": "bold",
"maxLines": "3",
"textStyle": "fill",
"textDecoration": "none",
"fontFamily": "PingFang SC",
"textAlign": "center",
}
})
}
// 新的样式1-1至1-4
if (data.type1 == '1' && data.type2) {
views.push({
"type": "image",
"url": 'https://qn.colorcun.com/rectangleBj1.png',
"css": {
"width": "210px",
"height": "26px",
"top": "0px",
"left": "0px",
"mode": "aspectFill"
}
}, {
"type": "image",
"url": 'https://qn.colorcun.com/rectangleBj1.png',
"css": {
"width": "210px",
"height": "26px",
"top": "142px",
"left": "0px",
"mode": "aspectFill"
}
}, {
"type": "text",
"text": data.info.sellerName,
"css": {
"color": "#FFEFC5",
"width": "190px",
"top": "6px",
"left": "10px",
"right": "10px",
"borderColor": "#000000",
"fontSize": "12px",
"fontWeight": "normal",
"maxLines": "2",
"textStyle": "fill",
"textDecoration": "none",
"fontFamily": "PingFang SC",
"textAlign": "center",
}
}, {
"type": "text",
"text": data.info.time,
"css": {
"color": "#FFEFC5",
"width": "210px",
"height": "168px",
"top": "146px",
"borderColor": "#000000",
"fontSize": "12px",
"fontWeight": "bold",
"maxLines": "1",
"textStyle": "fill",
"textDecoration": "none",
"fontFamily": "PingFang SC",
"textAlign": "center",
}
});
}
// 新的样式2-1至2-4
if (data.type1 == '2' && data.type2) {
views.push({
"type": "image",
"url": 'https://qn.colorcun.com/rectangleBj.png',
"css": {
"width": "210px",
"height": "168px",
"top": "0px",
"left": "0px",
"mode": "aspectFill"
}
}, {
"type": "text",
"text": data.info.sellerName,
"css": {
"color": "#FFEFC5",
"width": "190px",
"top": "33px",
"left": "10px",
"right": "10px",
"borderColor": "#000000",
"fontSize": "12px",
"fontWeight": "normal",
"maxLines": "2",
"textStyle": "fill",
"textDecoration": "none",
"fontFamily": "PingFang SC",
"textAlign": "center",
}
}, {
"type": "text",
"text": data.date2,
"css": {
"color": "#FFEFC5",
"width": "190px",
"top": "80px",
"left": "10px",
"right": "10px",
"borderColor": "#000000",
"fontSize": "24px",
"fontWeight": "normal",
"maxLines": "1",
"textStyle": "fill",
"textDecoration": "none",
"fontFamily": "PingFang SC",
"textAlign": "center",
}
}, {
"type": "text",
"text": data.info.time,
"css": {
"color": "#FFEFC5",
"width": "210px",
"height": "168px",
"top": "118px",
"borderColor": "#000000",
"fontSize": "12px",
"fontWeight": "bold",
"maxLines": "1",
"textStyle": "fill",
"textDecoration": "none",
"fontFamily": "PingFang SC",
"textAlign": "center",
}
});
}
// 新的样式3-1至3-4
if (data.type1 == '3' && data.type2) {
views.push({
"type": "image",
"url": 'https://qn.colorcun.com/rectangleBj.png',
"css": {
"width": "210px",
"height": "168px",
"top": "0px",
"left": "0px",
"mode": "aspectFill"
}
}, {
"type": "text",
"text": data.info.sellerName,
"css": {
"color": "#FFEFC5",
"width": "190px",
"top": "20px",
"left": "12px",
"right": "12px",
"borderColor": "#000000",
"fontSize": "12px",
"fontWeight": "normal",
"maxLines": "2",
"textStyle": "fill",
"textDecoration": "none",
"fontFamily": "PingFang SC",
}
}, {
"type": "text",
"text": data.date2,
"css": {
"color": "#FFEFC5",
"width": "85px",
"top": "97px",
"left": "40px",
"right": "10px",
"borderColor": "#000000",
"fontSize": "24px",
"fontWeight": "normal",
"maxLines": "2",
"textStyle": "fill",
"textDecoration": "none",
"fontFamily": "PingFang SC",
}
}, {
"type": "text",
"text": '周',
"css": {
"color": "#FFEFC5",
"width": "10px",
"top": "97px",
"left": "60px",
"right": "10px",
"borderColor": "#000000",
"fontSize": "12px",
"fontWeight": "normal",
"maxLines": "2",
"textStyle": "fill",
"textDecoration": "none",
"fontFamily": "PingFang SC",
}
}, {
"type": "text",
"text": data.day2,
"css": {
"color": "#FFEFC5",
"width": "10px",
"top": "110px",
"left": "60px",
"right": "10px",
"borderColor": "#000000",
"fontSize": "12px",
"fontWeight": "normal",
"maxLines": "2",
"textStyle": "fill",
"textDecoration": "none",
"fontFamily": "PingFang SC",
}
}, {
"type": "text",
"text": data.info.time,
"css": {
"color": "#FFEFC5",
"minWidth": "90px",
"top": "133px",
"lineHeight": "16px",
"right": "18px",
"padding": "2px 6px",
"borderColor": "#000000",
"borderRadius": "3px",
"fontSize": "12px",
"maxLines": "1",
"textStyle": "fill",
"textDecoration": "none",
"fontFamily": "PingFang SC",
'background': 'rgba(255, 239, 197, 0.4)',
"textAlign": "center",
"verticalAlign": "middle",
}
}, );
}
// 新的样式4-1至4-4
if (data.type1 == '4' && data.type2) {
views.push({
"type": "image",
"url": 'https://qn.colorcun.com/rectangleBj2.png',
"css": {
"width": "210px",
"height": "44px",
"top": "124px",
"left": "0px",
"mode": "aspectFill"
}
}, {
"type": "text",
"text": data.info.sellerName,
"css": {
"color": "#FFEFC5",
"width": "124px",
"top": "140px",
"left": "8px",
"borderColor": "#000000",
"fontSize": "12px",
"fontWeight": "normal",
"maxLines": "2",
"textStyle": "fill",
"textDecoration": "none",
"fontFamily": "PingFang SC",
}
}, {
"type": "text",
"text": data.date2 + data.week,
"css": {
"color": "#FFEFC5",
"width": "60px",
"top": "130px",
"right": "14px",
"borderColor": "#000000",
"fontSize": "10px",
"fontWeight": "normal",
"maxLines": "1",
"textStyle": "fill",
"textDecoration": "none",
"fontFamily": "PingFang SC",
}
}, {
"type": "text",
"text": data.info.time,
"css": {
"color": "#FFEFC5",
"width": "60px",
"top": "146px",
"lineHeight": "14px",
"right": "18px",
"padding": "1px 2px",
"borderColor": "#000000",
"borderRadius": "3px",
"fontSize": "10px",
"maxLines": "1",
"textStyle": "fill",
"textDecoration": "none",
"fontFamily": "PingFang SC",
'background': 'rgba(255, 239, 197, 0.4)',
"textAlign": "center",
"verticalAlign": "middle",
}
}, );
}
return {
"width": "210px",
"height": "168px",
"views": views
};
}
\ No newline at end of file
... ...