Kaynağa Gözat

Merge branch 'ui-refactor-phase-2' of guanli/ngfrontend into develop

bill001 15 saat önce
ebeveyn
işleme
ce891ac834

+ 86 - 0
src/ui-refactor/components/DeliveryNotice.vue

@@ -0,0 +1,86 @@
+<script>
+export default {
+  name: 'DeliveryNotice'
+}
+</script>
+
+<template>
+  <div class="ng-delivery-notice" role="note">
+    <div class="ng-delivery-notice-panel ng-delivery-notice-fees">
+      <el-avatar :size="34" shape="square" icon="el-icon-truck" class="ng-delivery-notice-icon" aria-hidden="true" />
+      <div>
+        <h3 class="ng-delivery-notice-title">Important Delivery Information</h3>
+        <p>
+          Product prices exclude delivery fees. The exact delivery fee will be determined based on your shipping address
+          and communicated to you once your order is processed and confirmed.
+        </p>
+      </div>
+    </div>
+    <div class="ng-delivery-notice-panel ng-delivery-notice-time">
+      <h3 class="ng-delivery-notice-title">
+        <i class="el-icon-time" aria-hidden="true" />
+        Delivery Time
+      </h3>
+      <ul>
+        <li><strong>Abuja and Lagos:</strong> 1–5 working days.</li>
+        <li><strong>Other locations within Nigeria:</strong> 3–7 working days.</li>
+        <li><strong>Remote locations:</strong> Delivery may take up to 14 working days.</li>
+      </ul>
+    </div>
+  </div>
+</template>
+
+<style scoped>
+.ng-delivery-notice {
+  margin: 12px 0 16px;
+  color: #283650;
+  font-size: 13px;
+  line-height: 1.55;
+}
+
+.ng-delivery-notice-panel {
+  padding: 14px 16px;
+  border-left: 4px solid #202259;
+  border-radius: 0 10px 10px 0;
+}
+
+.ng-delivery-notice-fees {
+  display: flex;
+  align-items: flex-start;
+  gap: 12px;
+  background: #e6f1fd;
+}
+
+.ng-delivery-notice-icon {
+  flex: none;
+  border-radius: 8px;
+  color: #fff;
+  background: #202259;
+}
+
+.ng-delivery-notice-time {
+  margin-top: 10px;
+  background: #f2f7fd;
+}
+
+.ng-delivery-notice-title {
+  margin: 0 0 4px;
+  color: #202259;
+  font-size: 15px;
+  line-height: 1.4;
+}
+
+.ng-delivery-notice-title i {
+  margin-right: 4px;
+}
+
+.ng-delivery-notice p,
+.ng-delivery-notice ul {
+  margin: 0;
+}
+
+.ng-delivery-notice ul {
+  padding-left: 16px;
+  list-style: disc;
+}
+</style>

+ 86 - 0
src/ui-refactor/components/StockistSelect.vue

@@ -0,0 +1,86 @@
+<template>
+  <el-select
+    v-bind="$attrs"
+    :value="value"
+    :disabled="disabled"
+    class="ng-stockist-select"
+    placeholder="Select stockist"
+    filterable
+    clearable
+    v-on="$listeners"
+  >
+    <el-option
+      v-for="stockist in options"
+      :key="stockist.id"
+      :label="`${stockist.name} (${stockist.id})`"
+      :value="stockist.id"
+    >
+      <span class="ng-stockist-option">
+        <span class="ng-stockist-option-name">{{ stockist.name }}</span>
+        <span class="ng-stockist-option-id">{{ stockist.id }}</span>
+      </span>
+    </el-option>
+  </el-select>
+</template>
+
+<script>
+const testStockists = {
+  '620699181539139625': [{ id: 'NG48655323', name: 'S4' }],
+  '620699181539139643': [{ id: 'AE28801941', name: 'ZAIDI ASRAF BIN IDRIS' }]
+}
+
+const productionStockists = {
+  '620699181539139625': [
+    { id: 'NG576513886', name: 'Elken Onyx Shop' },
+    { id: 'NG538666436', name: 'Shalom Shop' },
+    { id: 'NG662021398', name: 'Elken Great Achievers' },
+    { id: 'NG87440247', name: 'De Wellness Centre' },
+    { id: 'NG92944313', name: 'Elken JC Solution Centre' }
+  ],
+  '620699181539139643': [{ id: 'AE000000001', name: 'AETOP' }]
+}
+
+export default {
+  name: 'StockistSelect',
+  inheritAttrs: false,
+  props: {
+    value: { type: String, default: '' },
+    countryId: { type: String, default: '' },
+    disabled: Boolean
+  },
+  computed: {
+    options() {
+      // Staging also uses NODE_ENV=production, but points to the UAT API.
+      const production = process.env.VUE_APP_BASE_DO_API === 'https://ng-frontend-api.elken.com'
+      const stockists = production ? productionStockists : testStockists
+      return stockists[this.countryId] || []
+    }
+  },
+  watch: {
+    countryId(countryId, previousCountryId) {
+      if (previousCountryId && this.value && !this.disabled) this.$emit('input', '')
+    }
+  }
+}
+</script>
+
+<style scoped>
+.ng-stockist-select {
+  width: 100%;
+}
+.ng-stockist-option {
+  display: flex;
+  justify-content: space-between;
+  gap: 12px;
+  max-width: calc(100vw - 72px);
+}
+.ng-stockist-option-name {
+  overflow: hidden;
+  text-overflow: ellipsis;
+}
+.ng-stockist-option-id {
+  flex-shrink: 0;
+  font-size: 12px;
+  color: #606266;
+}
+</style>

+ 3 - 2
src/ui-refactor/views/guest-shop/GuestPurchaseFlow.vue

@@ -107,6 +107,7 @@
         <el-col :xs="24" :lg="8" class="ng-guest-summary-column">
           <order-summary
             :checkout="stage === 'checkout'"
+            :show-delivery-notice="market === 'ng'"
             :show-bv="false"
             :items="cartRows"
             :payment-method="paymentMethod"
@@ -118,8 +119,8 @@
             :tax="totals.tax"
             :currency="currency"
             :shipping="
-              stage === 'cart'
-                ? 'Calculated at checkout'
+              stage === 'cart' || (settingsReady && Number(freight) === 0)
+                ? 'To be determined'
                 : currency + ' ' + totals.shipping.toFixed(2)
             "
           >

+ 7 - 1
src/ui-refactor/views/purchase/CheckoutFields.vue

@@ -26,10 +26,12 @@
         :required="!stockist"
         for="ng-purchase-stockist"
       >
-        <el-input
+        <stockist-select
           id="ng-purchase-stockist"
           :value="self ? model.recUserName : model.decUserName"
+          :country-id="stockistCountryId"
           :disabled="disabled || stockist"
+          popper-class="ng-refactor-popper"
           @input="change(self ? 'recUserName' : 'decUserName', $event)"
         />
       </el-form-item>
@@ -171,13 +173,17 @@
 </template>
 
 <script>
+import StockistSelect from '@/ui-refactor/components/StockistSelect.vue'
+
 export default {
   name: 'PurchaseCheckoutFields',
+  components: { StockistSelect },
   props: {
     model: { type: Object, required: true },
     self: Boolean,
     upgrade: Boolean,
     stockist: Boolean,
+    stockistCountryId: { type: String, default: '' },
     guest: Boolean,
     country: { type: Object, default: () => ({}) },
     disabled: Boolean,

+ 7 - 2
src/ui-refactor/views/purchase/OrderSummary.vue

@@ -50,7 +50,7 @@
         {{ currency }} {{ total | toThousandFilter }}
         <template v-if="showBv">({{ bv | toThousandFilter }} BV)</template>
       </el-descriptions-item>
-      <el-descriptions-item label="Shipping">{{ shipping }}</el-descriptions-item>
+      <el-descriptions-item label="Delivery Fee">{{ shipping }}</el-descriptions-item>
       <!-- <el-descriptions-item label="Tax">{{ currency }} {{ tax | toThousandFilter }}</el-descriptions-item> -->
       <el-descriptions-item label="Method">{{ paymentMethod || '—' }}</el-descriptions-item>
     </el-descriptions>
@@ -59,7 +59,7 @@
       <el-descriptions-item
         label="Subtotal"
       >{{ currency }} {{ subtotal | toThousandFilter }}</el-descriptions-item>
-      <el-descriptions-item label="Shipping">{{ shipping }}</el-descriptions-item>
+      <el-descriptions-item label="Delivery Fee">{{ shipping }}</el-descriptions-item>
       <el-descriptions-item
         v-if="showBv"
         label="Total BV"
@@ -69,6 +69,7 @@
         {{ currency }} {{ total | toThousandFilter }}
       </el-descriptions-item>
     </el-descriptions>
+    <delivery-notice v-if="showDeliveryNotice" />
     <el-card
       v-if="maintenance"
       shadow="never"
@@ -120,10 +121,14 @@
 </template>
 
 <script>
+import DeliveryNotice from '@/ui-refactor/components/DeliveryNotice.vue'
+
 export default {
   name: 'PurchaseOrderSummary',
+  components: { DeliveryNotice },
   props: {
     checkout: { type: Boolean, default: false },
+    showDeliveryNotice: { type: Boolean, default: false },
     showBv: { type: Boolean, default: true },
     items: { type: Array, default: () => [] },
     paymentMethod: { type: String, default: '' },

+ 13 - 2
src/ui-refactor/views/purchase/PurchaseFlow.vue

@@ -118,6 +118,7 @@
           @details="handleProduct"
         >
           <template v-if="!isSelf" #footer>
+            <delivery-notice v-if="showDeliveryNotice" />
             <div class="ng-purchase-cart-hint" role="note">
               <span class="ng-purchase-cart-hint-icon" aria-hidden="true">
                 <i class="el-icon-shopping-cart-2" />
@@ -192,6 +193,7 @@
                 :self="isSelf"
                 :upgrade="isUpgrade"
                 :stockist="!isUpgrade && Number(isDec) === 1"
+                :stockist-country-id="stockistCountryId"
                 :member-name="memberName || ''"
                 :regions="regionData || []"
                 :addresses="shippingAddressList"
@@ -273,6 +275,7 @@
         <order-summary
           v-if="!isEmptyCart"
           :checkout="stage === 'checkout'"
+          :show-delivery-notice="showDeliveryNotice"
           :items="summaryItems"
           :payment-method="selectedPaymentName"
           :channels="activePayType === 'pay_stack' ? channels : []"
@@ -283,8 +286,8 @@
           :total="stage === 'cart' ? sellPriceSum : orderTotal"
           :currency="currencyUnitCode"
           :shipping="
-            stage === 'cart'
-              ? 'Calculated at checkout'
+            stage === 'cart' || (!isUpgrade && settingsReady && Number(freight) === 0)
+              ? 'To be determined'
               : currencyUnitCode + ' ' + (isUpgrade ? '0.00' : pointFreight)
           "
           :maintenance="isMaintenance && stage === 'cart'"
@@ -367,6 +370,7 @@ import SignupProducts from '../signup/components/SignupProducts.vue'
 import OrderSummary from './OrderSummary.vue'
 import CheckoutFields from './CheckoutFields.vue'
 import CartItems from './CartItems.vue'
+import DeliveryNotice from '@/ui-refactor/components/DeliveryNotice.vue'
 import OrderSuccessDialog from '@/ui-refactor/components/OrderSuccessDialog.vue'
 import { getPaymentSummary } from '@/ui-refactor/utils/paymentSummary'
 import UiSectionCard from '@/components/ui/UiSectionCard.vue'
@@ -382,6 +386,7 @@ export default {
     OrderSummary,
     CheckoutFields,
     CartItems,
+    DeliveryNotice,
     OrderSuccessDialog,
     UiSectionCard,
     ProductDetailsDialog,
@@ -390,10 +395,16 @@ export default {
     UpgradeLevelFields
   },
   computed: {
+    stockistCountryId() {
+      return this.isSelf ? this.accountCountryId : this.memberDetails?.countryId
+    },
     ...behavior.computed,
     isEmptyCart() {
       return this.stage === 'cart' && !this.cartItems.length
     },
+    showDeliveryNotice() {
+      return this.currencyUnitCode === 'NGN' && (this.stage !== 'catalog' || (!this.isSelf && !this.isUpgrade))
+    },
     maintenanceLimitLabel() {
       return this.ampDivideLine == null ? '—' : this.ampDivideLine
     },

+ 3 - 1
src/ui-refactor/views/signup/SignupPage.vue

@@ -45,6 +45,7 @@
             @quantity="changeProductQuantity"
             @details="handleProduct"
           />
+          <delivery-notice v-if="countryName === 'Nigeria' && form.way !== 'pickup'" />
         </ui-section-card>
       </welcome-pack-fields>
       <payment-methods
@@ -98,6 +99,7 @@
 
 <script>
 import UiSectionCard from '@/components/ui/UiSectionCard.vue'
+import DeliveryNotice from '@/ui-refactor/components/DeliveryNotice.vue'
 import PaymentMethods from '@/ui-refactor/components/PaymentMethods.vue'
 import { getPaymentSummary } from '@/ui-refactor/utils/paymentSummary'
 import tool from '@/utils/tool'
@@ -108,7 +110,7 @@ import WelcomePackDialogs from '@/ui-refactor/views/welcome-pack/WelcomePackDial
 
 export default {
   name: 'WelcomePackFlow',
-  components: { UiSectionCard, SignupProducts, WelcomePackFields, PaymentMethods, WelcomePackDialogs, RegistrationSuccessDialog },
+  components: { UiSectionCard, SignupProducts, DeliveryNotice, WelcomePackFields, PaymentMethods, WelcomePackDialogs, RegistrationSuccessDialog },
   data() {
     return { active: true }
   },

+ 5 - 2
src/ui-refactor/views/welcome-pack/WelcomePackFields.vue

@@ -100,11 +100,13 @@
           for="ng-welcome-center"
           :required="!guest && !stockist"
         >
-          <el-input
+          <stockist-select
             id="ng-welcome-center"
             autocomplete="ng-registration"
             :value="form.decUserName"
+            :country-id="form.countryId"
             :disabled="stockist"
+            popper-class="ng-refactor-popper"
             @input="change('decUserName', $event)"
           />
         </el-form-item>
@@ -229,10 +231,11 @@
 
 <script>
 import UiSectionCard from '@/components/ui/UiSectionCard.vue'
+import StockistSelect from '@/ui-refactor/components/StockistSelect.vue'
 
 export default {
   name: 'WelcomePackFields',
-  components: { UiSectionCard },
+  components: { UiSectionCard, StockistSelect },
   props: {
     form: { type: Object, required: true },
     guest: { type: Boolean, default: false },

+ 5 - 5
src/views/login/index.vue

@@ -7,19 +7,19 @@
 
       <div class="ng-login-brand-content">
         <p class="ng-login-eyebrow">WELCOME BACK</p>
-        <h1 class="ng-login-brand-title"><em>Clean water,</em> one tap away.</h1>
+        <h1 class="ng-login-brand-title"><em>Your Elken Experience,</em> Made Simpler.</h1>
         <p class="ng-login-brand-description">
-          Manage your orders, track water quality, and pay with ease — wherever you are in Nigeria.
+          Manage your orders, access your purchase history, and shop your favourite Elken products with ease — anytime, anywhere in Nigeria.
         </p>
         <ul class="ng-login-benefits">
           <li>
-            <i class="el-icon-check" aria-hidden="true" /> Free installation &amp; filter changes
+            <i class="el-icon-check" aria-hidden="true" /> Free Installation
           </li>
           <li>
-            <i class="el-icon-check" aria-hidden="true" /> Smart reminders — stay on top of payments
+            <i class="el-icon-check" aria-hidden="true" /> Smart Reminders – Stay on Top of Your Payment
           </li>
           <li>
-            <i class="el-icon-check" aria-hidden="true" /> Exclusive rewards on every purchase
+            <i class="el-icon-check" aria-hidden="true" /> Discover exclusive rewards and special offers on selected purchases.
           </li>
         </ul>
       </div>