[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: 4453.js
"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[4453],{4453:(e,t,a)=>{a.r(t),a.d(t,{default:()=>U});var r=a(9726),i={class:"text-2xl font-bold mb-7 text-primary"},o={class:"rounded-2xl shadow-card mb-6 bg-white"},s={class:"flex items-center gap-3 p-6 border-b border-gray-200"},n=["src"],l={class:"text-lg font-medium capitalize mb-1.5"},c={key:0,class:"font-bold"},d={key:1,class:"font-bold"},m={class:"p-6"},u={class:"mb-6"},p={class:"capitalize font-semibold mb-3"},g={class:"flex items-center gap-3"},h=["onClick"],f={key:0,class:"db-field-alert"},v={class:"mb-6"},w={class:"capitalize font-semibold mb-3"},b={key:0,class:"db-field-alert"},y={class:"capitalize font-semibold mb-3"},k={class:"flex flex-wrap gap-3"},E=["onClick"],A=["src"],x={key:2,class:"relative rounded-lg w-20 h-20 flex flex-col items-center justify-center gap-1 cursor-pointer bg-[#EFF0F6]"},V=["onChange"],N={class:"text-xs font-medium capitalize cursor-pointer text-text"},$={type:"submit",class:"field-button w-fit font-semibold tracking-wide"};var D=a(1811),R=a(9856),B=a(8655);const C={name:"ProductReviewComponent",components:{LoadingComponent:D.A},data:function(){return{loading:{isActive:!1},activeRate:1,imageUrl:Array(5).fill(null),selectFile:null,productData:{},props:{search:{},form:{star:"",review:""}},images:{},errors:{}}},mounted:function(){this.show(),void 0!==this.$route.params.id&&this.reviewShow()},computed:{product:function(){return this.$store.getters["frontendProduct/show"]}},methods:{handleImageUpload:function(e,t){var a=this;if(void 0!==this.$route.params.id)try{this.loading.isActive=!0;var r=e.target;if(r.files&&r.files[0]){var i=new FileReader;i.onload=function(r){a.imageUrl[t]=URL.createObjectURL(e.target.files[0])},i.readAsDataURL(r.files[0])}var o=new FormData;o.append("image",e.target.files[0]),this.$store.dispatch("frontendProductReview/uploadImage",{id:this.$route.params.id,form:o}).then(function(e){R.A.success(a.$t("message.image_update")),a.loading.isActive=!1}).catch(function(e){a.loading.isActive=!1,R.A.error(e.response.data.errors.image[0])})}catch(e){this.loading.isActive=!1,R.A.error(e.response.data.message)}else{var s=e.target;if(s.files&&s.files[0]){var n=new FileReader;n.onload=function(r){a.imageUrl[t]=URL.createObjectURL(e.target.files[0])},n.readAsDataURL(s.files[0]),this.images[t]=e.target.files[0]}}},removeImage:function(e){var t=this;void 0!==this.$route.params.id?B.A.destroyConfirmation().then(function(a){try{t.loading.isActive=!0,t.imageUrl[e]=null,t.images[e]=null,t.$store.dispatch("frontendProductReview/deleteImage",{id:t.$route.params.id,index:e}).then(function(e){t.loading.isActive=!1,R.A.success(t.$t("message.image_delete"))}).catch(function(e){t.loading.isActive=!1,R.A.error(e.response.data.message)})}catch(e){t.loading.isActive=!1,R.A.error(e.response.data.message)}}).catch(function(e){t.loading.isActive=!1}):(this.imageUrl[e]=null,this.images[e]=null)},changeImage:function(e){this.image=e.target.files[0]},show:function(){var e=this;void 0!==this.$route.params.slug&&(this.loading.isActive=!0,this.props.search.slug=this.$route.params.slug,this.$store.dispatch("frontendProduct/showWithTrashed",this.props.search).then(function(t){e.productData=t.data.data,e.loading.isActive=!1}).catch(function(t){e.loading.isActive=!1}))},reviewShow:function(){var e=this;void 0!==this.$route.params.id&&(this.loading.isActive=!0,this.$store.dispatch("frontendProductReview/show",this.$route.params.id).then(function(t){e.props.form.star=t.data.data.star,e.activeRate=t.data.data.star,e.props.form.review=t.data.data.review,e.images=t.data.data.images,e.images.forEach(function(t,a){e.imageUrl[a]=t}),e.$store.getters["frontendProductReview/temp"].temp_id=t.data.data.id,e.$store.getters["frontendProductReview/temp"].isEditing=!0,e.loading.isActive=!1}).catch(function(t){e.loading.isActive=!1}))},save:function(){var e=this;try{var t=new FormData;if(t.append("star",this.activeRate),t.append("review",this.props.form.review),t.append("product_id",this.productData.id),this.images)for(var a in this.images)Object.hasOwnProperty.call(this.images,a)&&null!==this.images[a]&&t.append("images[]",this.images[a]);var r=this.$store.getters["frontendProductReview/temp"].temp_id;this.loading.isActive=!0,this.$store.dispatch("frontendProductReview/save",{form:t,search:this.search}).then(function(t){e.loading.isActive=!1,R.A.successFlip(null===r?0:1,e.$t("menu.product_review")),e.$store.dispatch("frontendProductReview/reset").then().catch(),e.props.form={star:"",review:""},e.images={},e.errors={},e.$router.push({name:"frontend.account.orderHistory"})}).catch(function(t){e.loading.isActive=!1,e.errors=t.response.data.errors})}catch(e){this.loading.isActive=!1,R.A.error(e)}}}};const U=(0,a(6262).A)(C,[["render",function(e,t,a,D,R,B){var C=(0,r.resolveComponent)("LoadingComponent");return(0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,null,[(0,r.createVNode)(C,{props:R.loading},null,8,["props"]),(0,r.createElementVNode)("h2",i,(0,r.toDisplayString)(e.$t("menu.write_review")),1),(0,r.createElementVNode)("form",{class:"w-full mobile:mb-20",onSubmit:t[1]||(t[1]=(0,r.withModifiers)(function(){return B.save&&B.save.apply(B,arguments)},["prevent"]))},[(0,r.createElementVNode)("div",o,[(0,r.createElementVNode)("div",s,[(0,r.createElementVNode)("img",{src:R.productData.image,alt:"product",class:"w-14 h-14 object-cover rounded-md flex-shrink-0"},null,8,n),(0,r.createElementVNode)("div",null,[(0,r.createElementVNode)("h4",l,(0,r.toDisplayString)(R.productData.name),1),R.productData.is_offer?((0,r.openBlock)(),(0,r.createElementBlock)("h5",c,(0,r.toDisplayString)(R.productData.currency_price),1)):((0,r.openBlock)(),(0,r.createElementBlock)("h5",d,(0,r.toDisplayString)(R.productData.old_currency_price),1))])]),(0,r.createElementVNode)("div",m,[(0,r.createElementVNode)("div",u,[(0,r.createElementVNode)("h4",p,(0,r.toDisplayString)(e.$t("label.your_review"))+" ("+(0,r.toDisplayString)(R.activeRate)+")",1),(0,r.createElementVNode)("nav",g,[((0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)(5,function(e){return(0,r.createElementVNode)("button",{onClick:function(t){return R.activeRate=e},type:"button",class:(0,r.normalizeClass)([{"!text-[#F6A609]":R.activeRate>=e},"lab-fill-star text-4xl text-[#D9DBE9]"])},null,10,h)}),64))]),R.errors.star?((0,r.openBlock)(),(0,r.createElementBlock)("small",f,(0,r.toDisplayString)(R.errors.star[0]),1)):(0,r.createCommentVNode)("",!0)]),(0,r.createElementVNode)("div",v,[(0,r.createElementVNode)("h4",w,[(0,r.createTextVNode)((0,r.toDisplayString)(e.$t("label.review_details"))+" ",1),t[2]||(t[2]=(0,r.createElementVNode)("span",{class:"text-danger"},"*",-1))]),(0,r.withDirectives)((0,r.createElementVNode)("textarea",{class:"field-control","onUpdate:modelValue":t[0]||(t[0]=function(e){return R.props.form.review=e})},null,512),[[r.vModelText,R.props.form.review]]),R.errors.review?((0,r.openBlock)(),(0,r.createElementBlock)("small",b,(0,r.toDisplayString)(R.errors.review[0]),1)):(0,r.createCommentVNode)("",!0)]),(0,r.createElementVNode)("div",null,[(0,r.createElementVNode)("h4",y,(0,r.toDisplayString)(e.$t("label.upload_images")),1),(0,r.createElementVNode)("div",k,[((0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)(5,function(a,i){return(0,r.createElementVNode)("div",{class:"relative",key:i},[R.imageUrl[i]?((0,r.openBlock)(),(0,r.createElementBlock)("button",{key:0,onClick:function(e){return B.removeImage(i)},type:"button",class:"lab-fill-close text-xs w-5 h-5 leading-5 rounded-full shadow absolute -top-1 -right-1 text-danger bg-white"},null,8,E)):(0,r.createCommentVNode)("",!0),R.imageUrl[i]?((0,r.openBlock)(),(0,r.createElementBlock)("img",{key:1,src:R.imageUrl[i],alt:"product",class:"rounded-lg w-20 h-20 object-cover"},null,8,A)):(0,r.createCommentVNode)("",!0),R.imageUrl[i]?(0,r.createCommentVNode)("",!0):((0,r.openBlock)(),(0,r.createElementBlock)("label",x,[(0,r.createElementVNode)("input",{onChange:function(e){return B.handleImageUpload(e,i)},type:"file",class:"absolute inset-0 -z-10 rounded-lg opacity-0"},null,40,V),t[3]||(t[3]=(0,r.createElementVNode)("i",{class:"lab-fill-image text-xl text-text cursor-pointer"},null,-1)),(0,r.createElementVNode)("span",N,(0,r.toDisplayString)(e.$t("label.add_image")),1)]))])}),64))])])])]),(0,r.createElementVNode)("button",$,(0,r.toDisplayString)(e.$t("button.submit_review")),1)],32)],64)}]])}}]);
Save Changes
Cancel / Back
Close ×
Server Info
Hostname: premium320.web-hosting.com
Server IP: 66.29.153.54
PHP Version: 8.2.29
Server Software: LiteSpeed
System: Linux premium320.web-hosting.com 4.18.0-553.50.1.lve.el8.x86_64 #1 SMP Thu Apr 17 19:10:24 UTC 2025 x86_64
HDD Total: 97.87 GB
HDD Free: 76.87 GB
Domains on IP: N/A (Requires external lookup)
System Features
Safe Mode:
Off
disable_functions:
None
allow_url_fopen:
On
allow_url_include:
Off
magic_quotes_gpc:
Off
register_globals:
Off
open_basedir:
None
cURL:
Enabled
ZipArchive:
Enabled
MySQLi:
Enabled
PDO:
Enabled
wget:
Yes
curl (cmd):
Yes
perl:
Yes
python:
Yes (py3)
gcc:
Yes
pkexec:
No
git:
Yes
User Info
Username: aoneqssk
User ID (UID): 1285
Group ID (GID): 1290
Script Owner UID: 1285
Current Dir Owner: 1285