多语言词条

This commit is contained in:
sl 2022-08-19 15:50:44 +08:00
parent 393d0416d2
commit 1f81608fed
4 changed files with 42 additions and 68 deletions

View File

@ -1,32 +0,0 @@
<?php
/**
* common.php
*
* @copyright 2022 opencart.cn - All Rights Reserved
* @link http://www.guangdawangluo.com
* @author Edward Yang <yangjin@opencart.cn>
* @created 2022-08-17 23:10:20
* @modified 2022-08-17 23:10:20
*/
return [
'index' => '购物车',
'added_to_cart' => '已加入购物车',
'select_all' => '全选',
'commodity' => '商品',
'quantity' => '数量',
'subtotal' => '小计',
'operate' => '操作',
'product_total' => '商品总计',
'all' => '全部',
'selected' => '已选',
'total_price' => '总价',
'to_checkout' => '去结账',
'cart_empty' => '您的购物车是空的',
'go_buy' => '您可以去看看有哪些想买的',
'go_shopping' => '去逛逛',
'must_select' => '请选择至少一个商品',
'mini' => '您的购物车',
'delete' => '删除',
'check_cart' => '查看购物车',
];

View File

@ -10,6 +10,9 @@
@section('content')
<div class="container" id="app-cart" v-cloak>
<x-shop-breadcrumb type="static" value="carts.index" />
<div class="row mt-5 justify-content-center">
<div class="col-12 col-md-9">@include('shared.steps', ['steps' => 1])</div>
</div>
@ -23,13 +26,13 @@
<th width="130">
<input class="form-check-input" type="checkbox" value="" id="check-all" v-model="allSelected">
<label class="form-check-label ms-1" for="check-all">
{{ __('shop/cart.select_all') }}
{{ __('shop/carts.select_all') }}
</label>
</th>
<th>{{ __('shop/cart.index') }}</th>
<th width="170">{{ __('shop/cart.commodity') }}</th>
<th width="170">{{ __('shop/cart.subtotal') }}</th>
<th class="text-end">{{ __('shop/cart.operate') }}</th>
<th>{{ __('shop/carts.index') }}</th>
<th width="170">{{ __('shop/carts.commodity') }}</th>
<th width="170">{{ __('shop/carts.subtotal') }}</th>
<th class="text-end">{{ __('shop/carts.operate') }}</th>
</tr>
</thead>
<tbody>
@ -67,15 +70,15 @@
</div>
<div class="col-12 col-md-3">
<div class="card total-wrap fixed-top-line">
<div class="card-header"><h5 class="mb-0">{{ __('shop/cart.product_total') }}</h5></div>
<div class="card-header"><h5 class="mb-0">{{ __('shop/carts.product_total') }}</h5></div>
<div class="card-body">
<ul class="list-group list-group-flush">
<li class="list-group-item"><span>{{ __('shop/cart.all') }}</span><span>@{{ products.length }}</span></li>
<li class="list-group-item"><span>{{ __('shop/cart.selected') }}</span><span>@{{ total_quantity }}</span></li>
<li class="list-group-item border-bottom-0"><span>{{ __('shop/cart.total_price') }}</span><span class="total-price">@{{ amount_format }}</span></li>
<li class="list-group-item"><span>{{ __('shop/carts.all') }}</span><span>@{{ products.length }}</span></li>
<li class="list-group-item"><span>{{ __('shop/carts.selected') }}</span><span>@{{ total_quantity }}</span></li>
<li class="list-group-item border-bottom-0"><span>{{ __('shop/carts.total_price') }}</span><span class="total-price">@{{ amount_format }}</span></li>
<li class="list-group-item d-grid gap-2 mt-3 border-bottom-0">
{{-- <a href="{{ shop_route('checkout.index', 'checkout') }}" class="btn btn-primary">去结账</a> --}}
<button type="button" class="btn btn-primary" @click="checkedBtnToCheckout">{{ __('shop/cart.to_checkout') }}</button>
<button type="button" class="btn btn-primary" @click="checkedBtnToCheckout">{{ __('shop/carts.to_checkout') }}</button>
</li>
</ul>
</div>
@ -88,11 +91,11 @@
<i class="bi bi-cart fs-1"></i>
</div>
<div class="empty-cart-text mb-3">
<h5>{{ __('shop/cart.cart_empty') }}</h5>
<p class="text-muted">{{ __('shop/cart.go_buy') }}</p>
<h5>{{ __('shop/carts.cart_empty') }}</h5>
<p class="text-muted">{{ __('shop/carts.go_buy') }}</p>
</div>
<div class="empty-cart-action">
<a href="{{ shop_route('home.index') }}" class="btn btn-primary">{{ __('shop/cart.go_shopping') }}</a>
<a href="{{ shop_route('home.index') }}" class="btn btn-primary">{{ __('shop/carts.go_shopping') }}</a>
</div>
</div>
</div>
@ -130,7 +133,7 @@
methods: {
checkedBtnToCheckout() {
if (!this.products.some(e => e.selected)) {
layer.msg('{{ __('shop/cart.nust_select') }}', ()=>{})
layer.msg('{{ __('shop/carts.nust_select') }}', ()=>{})
return
}

View File

@ -1,5 +1,5 @@
<div class="offcanvas-header">
<h5 id="offcanvasRightLabel" class="mx-auto mb-0">{{ __('shop/cart.mini') }}</h5>
<h5 id="offcanvasRightLabel" class="mx-auto mb-0">{{ __('shop/carts.mini') }}</h5>
<button type="button" class="btn-close text-reset" data-bs-dismiss="offcanvas" aria-label="Close"></button>
</div>
<div class="offcanvas-body">
@ -14,7 +14,7 @@
<div class="price">{{ $cart['price_format'] }} <span class="text-muted">x {{ $cart['quantity'] }}<span>
</div>
<span class="offcanvas-products-delete" data-id="{{ $cart['cart_id'] }}"><i class="bi bi-x-lg"></i>
{{ __('shop/cart.delete') }}</span>
{{ __('shop/carts.delete') }}</span>
</div>
</div>
</div>
@ -27,11 +27,11 @@
<i class="bi bi-cart fs-1"></i>
</div>
<div class="empty-cart-text mb-3">
<h5>{{ __('shop/cart.cart_empty') }}</h5>
<p class="text-muted">{{ __('shop/cart.go_buy') }}</p>
<h5>{{ __('shop/carts.cart_empty') }}</h5>
<p class="text-muted">{{ __('shop/carts.go_buy') }}</p>
</div>
<div class="empty-cart-action">
<a href="{{ shop_route('home.index') }}" class="btn btn-primary">{{ __('shop/cart.go_shopping') }}</a>
<a href="{{ shop_route('home.index') }}" class="btn btn-primary">{{ __('shop/carts.go_shopping') }}</a>
</div>
</div>
</div>
@ -45,8 +45,8 @@
<strong class="ms-auto offcanvas-right-cart-amount">{{ $amount_format }}</strong>
</div>
<div class="p-4">
<a href="{{ shop_route('checkout.index') }}" class="btn w-100 btn-dark">{{ __('shop/cart.to_checkout') }}</a>
<a href="{{ shop_route('carts.index') }}" class="btn w-100 btn-outline-dark mt-2">{{ __('shop/cart.check_cart') }}</a>
<a href="{{ shop_route('checkout.index') }}" class="btn w-100 btn-dark">{{ __('shop/carts.to_checkout') }}</a>
<a href="{{ shop_route('carts.index') }}" class="btn w-100 btn-outline-dark mt-2">{{ __('shop/carts.check_cart') }}</a>
</div>
</div>
@endif

View File

@ -10,6 +10,9 @@
@section('content')
<div class="container" id="checkout-app" v-cloak>
<x-shop-breadcrumb type="static" value="checkout.index" />
<div class="row mt-5 justify-content-center">
<div class="col-12 col-md-9">@include('shared.steps', ['steps' => 2])</div>
</div>
@ -18,7 +21,7 @@
<div class="col-12 col-md-8">
<div class="checkout-black">
<div class="checkout-title">
<h5 class="mb-0">地址</h5>
<h5 class="mb-0">{{ __('shop/checkout.address') }}</h5>
<button class="btn btn-sm icon" v-if="isAllAddress" @click="isAllAddress = false"><i class="bi bi-x-lg"></i></button>
</div>
<div class="addresses-wrap">
@ -32,15 +35,15 @@
<div class="zipcode">@{{ address.zipcode }}</div>
<div class="address-info">@{{ address.country }} @{{ address.zone }} @{{ address.city }} @{{ address.address_1 }}</div>
<div class="address-bottom">
<span class="badge bg-success" v-if="form.shipping_address_id == address.id">已选择</span>
<a class="" @click.stop="editAddress(index)">编辑</a>
<span class="badge bg-success" v-if="form.shipping_address_id == address.id">{{ __('shop/checkout.chosen') }}</span>
<a class="" @click.stop="editAddress(index)">{{ __('shop/checkout.edit') }}</a>
</div>
</div>
</div>
<div class="col-6" v-if="!isAllAddress">
<div class="item address-right">
<button class="btn btn-outline-dark w-100 mb-3" v-if="source.addresses.length > 1" @click="isAllAddress = true">选择其他地址</button>
<button class="btn btn-outline-dark w-100" @click="editAddress"><i class="bi bi-plus-square-dotted"></i> 添加新地址</button>
<button class="btn btn-outline-dark w-100 mb-3" v-if="source.addresses.length > 1" @click="isAllAddress = true">{{ __('shop/checkout.choose_another_address') }}</button>
<button class="btn btn-outline-dark w-100" @click="editAddress"><i class="bi bi-plus-square-dotted"></i> {{ __('shop/checkout.add_new_address') }}</button>
</div>
</div>
</div>
@ -48,7 +51,7 @@
</div>
<div class="checkout-black">
<h5 class="checkout-title">支付方式</h5>
<h5 class="checkout-title">{{ __('shop/checkout.payment_method') }}</h5>
<div class="radio-line-wrap">
<div :class="['radio-line-item', payment.code == form.payment_method_code ? 'active' : '']" v-for="payment, index in source.payment_methods" :key="index" @click="updateCheckout(payment.code, 'payment_method_code')">
<div class="left">
@ -64,7 +67,7 @@
</div>
<div class="checkout-black">
<h5 class="checkout-title">配送方式</h5>
<h5 class="checkout-title">{{ __('shop/checkout.delivery_method') }}</h5>
<div class="radio-line-wrap">
<div :class="['radio-line-item', shipping.code == form.shipping_method_code ? 'active' : '']" v-for="shipping, index in source.shipping_methods" :key="index" @click="updateCheckout(shipping.code, 'shipping_method_code')">
<div class="left">
@ -83,7 +86,7 @@
<div class="col-12 col-md-4 right-column">
<div class="card total-wrap fixed-top-line">
<div class="card-header d-flex align-items-center justify-content-between">
<h5 class="mb-0">CART TOTALS</h5>
<h5 class="mb-0">{{ __('shop/checkout.cart_totals') }}</h5>
<span class="rounded-circle bg-primary">@{{ source.carts.quantity }}</span>
</div>
<div class="card-body">
@ -107,7 +110,7 @@
@endforeach
</ul>
<div class="d-grid gap-2 mt-3">
<button class="btn btn-primary" type="button" :disabled="!isSubmit" @click="checkedBtnCheckoutConfirm">提交订单</button>
<button class="btn btn-primary" type="button" :disabled="!isSubmit" @click="checkedBtnCheckoutConfirm">{{ __('shop/checkout.submit_order') }}</button>
</div>
</div>
</div>
@ -158,11 +161,11 @@
},
addressRules: {
name: [{required: true, message: '请输入姓名', trigger: 'blur'}, ],
phone: [{required: true, message: '请输入联系电话', trigger: 'blur'}, ],
address_1: [{required: true, message: '请输入详细地址 1', trigger: 'blur'}, ],
zone_id: [{required: true, message: '请选择省份', trigger: 'blur'}, ],
city: [{required: true, message: '请填写 city', trigger: 'blur'}, ],
name: [{required: true, message: '{{ __('shop/checkout.enter_name') }}', trigger: 'blur'}, ],
phone: [{required: true, message: '{{ __('shop/checkout.enter_phone') }}', trigger: 'blur'}, ],
address_1: [{required: true, message: '{{ __('shop/checkout.enter_address') }}', trigger: 'blur'}, ],
zone_id: [{required: true, message: '{{ __('shop/checkout.select_province') }}', trigger: 'blur'}, ],
city: [{required: true, message: '{{ __('shop/checkout.enter_city') }}', trigger: 'blur'}, ],
}
},
@ -199,7 +202,7 @@
this.$refs[form].validate((valid) => {
if (!valid) {
this.$message.error('请检查表单是否填写正确');
this.$message.error('{{ __('shop/checkout.check_form') }}');
return;
}