123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362 |
- function formatTime(date) {
- var year = date.getFullYear()
- var month = date.getMonth() + 1
- var day = date.getDate()
- var hour = date.getHours()
- var minute = date.getMinutes()
- var second = date.getSeconds()
- return [year, month, day].map(formatNumber).join('-') + ' ' + [hour, minute, second].map(formatNumber).join(':')
- }
- function formatNumber(n) {
- n = n.toString()
- return n[1] ? n : '0' + n
- }
- function changeCup(e) {
-
- let dataPositionObj = null,
- propSize = null;
- switch (e) {
- case '1':
-
- dataPositionObj = {
- top: 42,
- left: 256,
- width: 334,
- height: 450
- };
- propSize = {
- top: '6cm',
- right: '9.5cm',
- bottom: '6cm',
- left: '9.5cm',
- };
- break;
- case '2':
- dataPositionObj = {
- top: 42,
- left: 154,
- width: 334,
- height: 450
- };
- propSize = {
- top: '6cm',
- right: '9.5cm',
- bottom: '6cm',
- left: '9.5cm',
- };
-
- break;
- case '3':
- dataPositionObj = {
- top: 172,
- left: 346,
- width: 70,
- height: 246
- };
- propSize = {
- top: '1cm',
- right: '5cm',
- bottom: '1cm',
- left: '5cm',
- };
-
- break;
- case '4':
- dataPositionObj = {
- top: 138,
- left: 178,
- width: 304,
- height: 304
- };
- propSize = {
- top: '5cm',
- right: '5cm',
- bottom: '5cm',
- left: '5cm',
- };
-
- break;
- case '5':
- dataPositionObj = {
- top: 74,
- left: 104,
- width: 536,
- height: 712
- };
- propSize = {
- top: '',
- right: '',
- bottom: '',
- left: '',
- };
-
- break;
- case '6':
- dataPositionObj = {
- top: 128,
- left: 109,
- width: 534,
- height: 654
- };
- propSize = {
- top: '',
- right: '',
- bottom: '',
- left: '',
- };
- break;
- case '7':
- dataPositionObj = {
- top: 74,
- left: 104,
- width: 536,
- height: 712
- };
- propSize = {
- top: '',
- right: '',
- bottom: '',
- left: '',
- };
-
- break;
- case '8':
- dataPositionObj = {
- top: 128,
- left: 109,
- width: 534,
- height: 654
- };
- propSize = {
- top: '',
- right: '',
- bottom: '',
- left: '',
- };
- break;
- case '9':
- dataPositionObj = {
- top: 254,
- left: 204,
- width: 368,
- height: 440
- };
- propSize = {
- top: '',
- right: '',
- bottom: '',
- left: '',
- };
- break;
- case '10':
- dataPositionObj = {
- top: 254,
- left: 204,
- width: 368,
- height: 440
- };
- propSize = {
- top: '',
- right: '',
- bottom: '',
- left: '',
- };
- break;
- case '11':
- dataPositionObj = {
- top: 310,
- left: 274,
- width: 210,
- height: 464
- };
- propSize = {
- top: '',
- right: '',
- bottom: '',
- left: '',
- };
- break;
- case '12':
- dataPositionObj = {
- top: 244,
- left: 274,
- width: 202,
- height: 528
- };
- propSize = {
- top: '',
- right: '',
- bottom: '',
- left: '',
- };
- break;
- default:
- break;
- }
- return {
- dataPositionObj: dataPositionObj,
- propSize: propSize
- }
- }
- let uploadLocation = {
- '1': '正面',
- '2': '反面',
- '3': '左侧',
- '4': '右侧',
- '5': '顶部',
- '6': '底部'
- }
- let url = 'https://dlz.info666.com';
- let changeImg = {
- '5': url + '/temp/box_silvery1.png',
- '5_1': url + '/temp/box_silvery1_1.png',
- '5_2': url + '/temp/box_silvery1_2.png',
- '6': url + '/temp/box_silvery2.png',
- '6_1': url + '/temp/box_silvery2_1.png',
- '6_2': url + '/temp/box_silvery2_2.png',
- '7': url + '/temp/box_white1.png',
- '7_1': url + '/temp/box_white1_1.png',
- '7_2': url + '/temp/box_white1_2.png',
- '8': url + '/temp/box_white2.png',
- '8_1': url + '/temp/box_white2_1.png',
- '8_2': url + '/temp/box_white2_2.png',
- '9': url + '/temp/shirt1.png',
- '9_1': url + '/temp/shirt1_1.png',
- '9_2': url + '/temp/shirt1_2.png',
- '10': url + '/temp/shirt2.png',
- '10_1': url + '//temp/shirt2_1.png',
- '10_2': url + '/temp/shirt2_2.png',
- '11': url + '/temp/cup1.png',
- '11_1': url + '/temp/cup1_1.png',
- '11_2': url + '/temp/cup1_2.png',
- '12': url + '/temp/cup2.png',
- '12_1': url + '/temp/cup2_1.png',
- '12_2': url + '/temp/cup2_2.png',
- }
- module.exports = {
- formatTime: formatTime,
- changeCup: changeCup,
- changeImg: changeImg
- }
|