PageSourceSearch

https://saigoncafe.ru/var/cache/asset20_494e70914a6c64b4f48f2f8952f3f1b7.js

js saigoncafe.ru collected 2026-10-08 22:48:12 UTC 15,554 bytes, 220 lines download raw bytes

1app.timerComponent={props:['value'],data(){return{timer:null,finishUnixTime:null,}},computed:{seconds:{get(){return this.value},set(val){this.$emit('input',val)}},time(){return `${ Math.trunc(this.seconds / 60) }:${ ('0' + (this.seconds % 60)).slice(-2) }`}},created(){if(!this.seconds){return}
2this.finishUnixTime=this.seconds*1000+Date.now();this.timer=setInterval(()=>{const secondDelta=Math.trunc((this.finishUnixTime-Date.now())/1000);if(secondDelta<=0){this.seconds=0;clearInterval(this.timer);return}
3this.seconds=secondDelta},1000)},template:'<div class="timer">{{ time }}</div>'};app.orderInfoComponent={props:['info','loc'],computed:{statusName(){return this.info.status.name},statusSlug(){return this.info.status.slug},title(){return `${this.loc['history/order']}${this.info.number}`},date(){return this.info.date},preorderDate(){return this.info.preorderDate},typeName(){return this.info.type.name},address(){return this.info.address},company(){return this.info.company},locCompany(){return this.loc['review/company']}},template:`
4        <div class="hOrder">
5            <div class="hOrder__status"
6                 :class="'hOrder__status--' + statusSlug"
7                 v-html="statusName">
8            </div>
9            <div class="hOrder__wrapper">
10                <div class="hOrder__title">{{title}}</div>
11                <div class="hOrder__date">{{date}}</div>
12                <div v-if="preorderDate"
13                     class="hOrder__preorderDate">
14                     {{preorderDate}}
15                </div>
16            </div>
17            <div v-if="company" class="hOrder__wrapper">
18                <div class="hOrder__type">{{locCompany}}:</div>
19                <div class="hOrder__address">{{company}}</div>
20            </div>
21            <div v-if="address" class="hOrder__wrapper">
22                <div class="hOrder__type">{{typeName}}:</div>
23                <div class="hOrder__address">{{address}}</div>
24            </div>
25        </div>
26    `};app.orderCommentComponent={props:['comment','loc'],computed:{locCommentCaption(){return this.loc['history/comment']}},template:`
27        <div class="hComment">
28            <div class="hComment__caption">{{locCommentCaption}}</div>
29            <div class="hComment__text">{{comment}}</div>
30        </div>
31    `};app.orderDishComponent={props:['dish','loc'],computed:{weight(){return this.formatWeight(this.dish.weight)},nameFormatted(){return this.dish.name.split('+')[0].trim()},toppings(){const dishes=this.dish.topping&&this.dish.topping.dishes;if(!dishes||!dishes.length){return null}
32return dishes}},methods:{formatWeight(weight){if(!weight){return''}
33if(isNaN(weight)){return weight}
34return weight>0?`${weight} ${this.loc['common/unit/gr']}`:''},formatTopping(topping){return `+ ${topping.name} × ${topping.count} ${this.loc['order/piece/name']}`}},template:`
35        <div class="hDish">
36
37           <div v-if="dish.src" class="hDish__wrap">
38              <template v-if="dish.src.type === 'video'">
39                <video class="hDish__img"
40                       :src="dish.src.preview"
41                       muted loop playsinline webkit-playsinline autoplay>
42              </template>
43              <img v-else class="hDish__img" :src="dish.src.preview"/>
44           </div>
45
46           <div v-else class="hDish__imgEmpty">
47                <svg width="24" height="17" viewBox="0 0 24 17" fill="none" xmlns="http://www.w3.org/2000/svg">
48                <path d="M0 16C0 15.4477 0.447715 15 1 15H23C23.5523 15 24 15.4477 24 16C24 16.5523 23.5523 17 23 17H1C0.447716 17 0 16.5523 0 16Z" fill="#DEDEDE"/>
49                <path d="M2 13C2 7.47715 6.47715 3 12 3C17.5228 3 22 7.47715 22 13V13.4762C22 13.7655 21.7655 14 21.4762 14H2.52381C2.23452 14 2 13.7655 2 13.4762V13Z" fill="#DEDEDE"/>
50                <path d="M13 1C13 1.55228 12.5523 2 12 2C11.4477 2 11 1.55228 11 1C11 0.447715 11.4477 0 12 0C12.5523 0 13 0.447715 13 1Z" fill="#DEDEDE"/>
51                </svg>
52           </div>
53
54           <div class="hDish__wrapper">
55                <div class="hDish__title">
56                    <span class="hDish__name">{{ nameFormatted }}</span><span v-if="weight" class="hDish__weight"> {{ weight }}</span>
57                </div>
58
59                <div v-if="toppings" class="hDish__toppings">
60                    <div v-for="topping in toppings" class="hDish__topping">{{ formatTopping(topping) }}</div>
61                </div>
62
63                <div v-if="dish.gift" class="hDish__price">{{ dish.giftText }}</div>
64                <div v-else class="hDish__price">{{dish.price}} × {{dish.quantity}}</div>
65           </div>
66
67        </div>
68    `};app.orderBonusComponent={props:['bonus','loc'],template:`
69        <div class="hBonus">
70            <div class="hBonus__caption">{{loc['order/pointsGain/title']}}</div>
71            <div class="hBonus__count">
72                {{bonus}}
73                <svg class="hBonus__countIco" width="15" height="12" viewBox="0 0 15 12" fill="none" xmlns="http://www.w3.org/2000/svg">
74                <path d="M6 0.75C8.89948 0.750007 11.25 3.10051 11.25 6C11.25 8.89949 8.89948 11.25 6 11.25C3.10051 11.25 0.75 8.8995 0.75 6C0.75 3.1005 3.10051 0.75 6 0.75Z" stroke="currentColor" stroke-width="1.5"/>
75                <path d="M10.2339 11.6921C12.0389 10.3949 13.2151 8.27249 13.2151 5.8744C13.2151 3.44104 12.004 1.29156 10.1538 0C12.6484 0.770764 14.4614 3.10224 14.4614 5.85872C14.4614 8.58562 12.6871 10.8966 10.2339 11.6921Z" fill="currentColor"/>
76                </svg>
77            </div>
78        </div>
79    `};app.summaryItem={props:['item'],template:`
80        <div class="sItem" :class="'sItem--' + item.type">
81            <div class="sItem__name">{{item.name}}</div>
82            <div class="sItem__value">{{item.value}}</div>
83        </div>
84    `};app.orderSummaryComponent={components:{summaryItem:app.summaryItem},props:['summary'],template:`
85        <div class="hSummary">
86            
87            <summaryItem v-for="(item, index) in summary" 
88                         :key="index" 
89                         :item="item"></summaryItem>
90            
91        </div>
92    `};app.orderContactsComponent={props:['contacts'],computed:{logo(){return this.contacts.logo},name(){return this.contacts.name},phone(){return this.contacts.phone}},template:`
93        <div class="hContacts">
94            <img :src="logo" class="hContacts__img" />
95            <div class="hContacts__info">
96                <div class="hContacts__name">{{name}}</div>
97                <a class="hContacts__phone" :href="'tel:' + phone">{{phone}}</a>
98            </div>
99        </div>
100    `};app.orderActionComponent={props:['isLoading'],methods:{onClick(){this.$emit('click')}},template:`
101        <div class="orderAction" @click="onClick">
102        
103            <transition name="orderAction__fade" mode="out-in">
104            
105                <div v-if="isLoading" class="orderAction__spinner">
106                    <i class="orderAction__circle"></i>
107                    <i class="orderAction__circle"></i>
108                    <i class="orderAction__circle"></i>
109                </div>
110                <div v-else class="orderAction__content">
111                    <slot></slot>
112                </div>
113    
114            </transition>
115 
116        </div>
117    `};app.orderDetailsComponent={components:{profileHeader:app.profileHeaderComponent,orderInfo:app.orderInfoComponent,orderComment:app.orderCommentComponent,orderDish:app.orderDishComponent,orderBonus:app.orderBonusComponent,orderSummary:app.orderSummaryComponent,orderContacts:app.orderContactsComponent,orderTimer:app.timerComponent,orderAction:app.orderActionComponent,progressComponent:app.progressComponent,spinner:app.commonSpinnerComponent,},props:['loc','company','orderId','isKiosk',],data(){return{info:null,timer:null,comment:'',dishes:null,bonus:null,summary:null,contacts:null,progress:null,successText:null,isReady:!1,isLoading:!1,}},computed:{isStatusEnquiry(){return this.isReady&&this.info.status.slug==='enquiry'},summaryCash(){return this.summary&&this.summary.find(item=>item.type==='cash')},cashValue(){if(!this.summaryCash){return''}
118return this.summaryCash.value},summaryTotal(){return this.summary&&this.summary.find(item=>item.type==='total')},totalValue(){return this.summaryTotal.value},locTitle(){return this.isStatusEnquiry?this.loc['cart/thanks']:this.loc['profile/order/details']},isVisibleContacts(){return this.contacts&&this.contacts.logo&&this.contacts.phone},isVisibleRepeat(){return this.isReady&&this.info.status.slug==='cancelled'||this.info.status.slug==='checked'},detailInfo(){return `${this.loc['history/order']}${this.info.number} ${this.loc['menu/dish/price/fromAlias']} ${this.info.date}`},locCancelBtn(){return this.loc['history/btn-cancel']},locRepeatBtn(){return this.loc['history/btn-repeat']},locReviewBtn(){return this.loc['history/btn-review']},isVisibleReview(){return this.isReady&&this.info.showReviewButton},payUrl(){return this.info&&this.info.payUrl},locPayBtn(){return this.loc['profile/order/pay']},},mounted(){this.getData()},destroyed(){clearTimeout(this.timer)},methods:{getData(){const payload={meta:{company:this.company.id,},orderId:this.orderId,}
119app.fetch('/profile/orders/getDetail',payload,(res)=>{if(res.error){app.growl(res.message,'danger');return}
120this.info=res.info;this.comment=res.comment;this.dishes=res.dishes;this.bonus=res.bonus;this.summary=res.summary;this.contacts=res.contacts;this.progress=res.progress;this.successText=res.successText;if(this.progress){this.timer=setTimeout(()=>{this.getData()},60000)}
121this.isReady=!0})},closeAll(){PubSub.publish('closeOrderDetails');PubSub.publish('closeProfileOrders');PubSub.publish('closeProfile')},onConfirmCancelOrder(orderId){app.viewerConfirm(this.loc['profile/order/confirm/question'],this.loc['profile/order/confirm/success'],this.loc['profile/order/confirm/cancel'],()=>{this.cancelOrder(orderId)})}
121,cancelOrder(id){if(this.isLoading){return}
122this.isLoading=!0;let payload={meta:{company:this.company,},cart:{id}}
123app.fetch('/cart/cancel',payload,(res)=>{this.isLoading=!1;if(res.error){app.growl(res.message,'danger');return}
124PubSub.publish('closeOrderDetails');PubSub.publish('refetchOrders')})},repeatOrder(id){if(this.isLoading){return}
125this.isLoading=!0;let payload={meta:{company:this.company,},repeatCartId:id}
126app.fetch('/cart/recalc3',payload,(response)=>{this.isLoading=!1;if(response.error){app.growl(response.message,'danger');return}
127this.closeAll();app.updateStore({cart:response.cart});PubSub.publish('showCart')})},openReviewForm(){PubSub.publish('showCartReviewForm',{cartId:this.orderId,loc:this.loc,})},refetchProgress(){clearTimeout(this.timer);this.getData()},openPayUrl(){if(this.payUrl){window.location.href=this.payUrl}}},template:`
128        <div v-if="isReady" class="hDetails">
129            <profileHeader :title="locTitle"/>
130            
131            <div v-if="isStatusEnquiry" class="hDetails__info">
132                <div class="hDetails__infoDate">{{ detailInfo }}</div>
133                <div v-if="successText"
134                     v-html="successText"
135                     class="hDetails__infoSuccess"></div>
136            </div>
137            
138            <progressComponent v-if="progress" 
139                               :visible="!!progress" 
140                               :steps="progress.steps" 
141                               :finishUnixTime="progress.finishUnixTime" 
142                               :timerLoc="progress.timerLoc" 
143                               :statusLoc="progress.statusLoc" 
144                               :isDelay="progress.isDelay" 
145                               @refetch="refetchProgress" />
146            
147            <orderInfo v-else class="hDetails__item" 
148                       :info="info"
149                       :loc="loc"/>
150                          
151            <orderComment v-if="comment"
152                          class="hDetails__item" 
153                          :comment="comment" 
154                          :loc="loc"/>          
155            
156            <div class="hDishes hDetails__item">
157                <orderDish v-for="dish in dishes" 
158                           :key="dish.id" 
159                           :dish="dish" 
160                           :loc="loc" />    
161<!--                      пока не понимаю зачем нам тут тотал, если тотал есть в summary-->
162<!--                <div v-if="isStatusEnquiry" class="hDishes__total">{{loc['profile/order/payment']}} {{cashValue}}: {{totalValue}}</div>      -->
163            </div>              
164                           
165            <orderBonus v-if="bonus"
166                        class="hDetails__item"
167                        :bonus="bonus"
168                        :loc="loc"/>      
169                          
170            <orderSummary 
171                v-if="summary"
172                class="hDetails__item" 
173                :summary="summary"/>     
174
175            <orderContacts 
176                v-if="isVisibleContacts"
177                class="hDetails__item" 
178                :contacts="contacts"/>
179                
180            <template v-if="!isKiosk">
181                <orderAction v-if="info.cancelTimer " 
182                             class="niOrder__action" 
183                             :isLoading="isLoading" 
184                             @click="onConfirmCancelOrder(orderId)">
185                    {{ locCancelBtn }}
186                    <orderTimer v-model="info.cancelTimer"></orderTimer>
187                </orderAction>
188                <orderAction v-else-if="isVisibleRepeat"
189                             :isLoading="isLoading"
190                             @click="repeatOrder(orderId)">
191                    {{ locRepeatBtn }}
192                </orderAction>
193                <orderAction v-if="payUrl"
194                             class="hDetails__payBtn"
195                             @click="openPayUrl">
196                    {{ locPayBtn }}
197                </orderAction>
198                <orderAction v-if="isVisibleReview"
199                             class="hDetails__reviewBtn"
200                             @click="openReviewForm()">
201                    {{ locReviewBtn }}
202                </orderAction>
203
204            </template>
205                 
206        </div>
207        <div v-else 
208             class="spinner">
209            <spinner />
210        </div>
211    `};app.addModule(()=>{PubSub.subscribe('showOrderDetails',(e,params)=>
211{const reloadPageOnClose=params&&params.reloadPageOnClose;const navigatePageOnClose=params&&params.navigatePageOnClose;app.openViewer({mobile:{withTick:!0,maxHeight:'calc(95dvh - 10px)',backgroundColor:'var(--profileViewerBg)'},desktop:{maxWidth:'400px',backgroundColor:'var(--profileViewerBg)'},onClose(){if(navigatePageOnClose){window.location.assign(navigatePageOnClose)}else if(reloadPageOnClose){window.location.reload()}},component:{components:{orderDetails:app.orderDetailsComponent,},computed:{...Vuex.mapState(['loc','company','isKiosk']),orderId(){return params.orderId},},created(){PubSub.subscribe('closeOrderDetails',this.close)},destroyed(){PubSub.unsubscribe('closeOrderDetails')},methods:{close(){this.$emit('close')},onError(message){app.growl(message,'danger');this.close()},},store:app.store,template:`
212            <div>
213                <orderDetails :loc="loc"
214                              :company="company"
215                              :orderId="orderId"
216                              :isKiosk="isKiosk"
217                              @close="close"
218                              @error="onError"/>
219            </div>
220            `}})})});

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.