main
Wayne 3 years ago
parent 23b6c592b0
commit 21e89dea55

@ -0,0 +1,20 @@
FROM node:20-alpine3.17
# Install basic development tools
# RUN apt update \
# && apt install -y less sudo \
# && apt install -y php \
# && php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" \
# && php composer-setup.php \
# && php -r "unlink('composer-setup.php');" \
# && mv composer.phar /usr/local/bin/composer
# # Ensure default `node` user has access to `sudo`
# ARG USERNAME=node
# RUN echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \
# && chmod 0440 /etc/sudoers.d/$USERNAME
WORKDIR /app
# Set `DEVCONTAINER` environment variable to help with orientation
ENV DEVCONTAINER=true

@ -0,0 +1,10 @@
// See https://containers.dev/implementors/json_reference/ for configuration reference
{
"name": "Slash Shop H5 Dev",
"build": {
"dockerfile": "Dockerfile"
},
"workspaceMount": "source=${localWorkspaceFolder},target=/app,type=bind",
"workspaceFolder": "/app",
"remoteUser": "root"
}

@ -0,0 +1,9 @@
### Dockerfile in shop-h5
FROM node:20-alpine3.17
# make the 'app' folder the current working directory
WORKDIR /app
# copy both 'package.json' and 'package-lock.json' (if available)
COPY package*.json ./
# install project dependencies
RUN npm install
EXPOSE 8080 #容器建立後,其預設開啟 8080 對外

@ -421,11 +421,6 @@ const showCod = ref(false)
const selectShipping = async (value) => { const selectShipping = async (value) => {
if (shippingData.value.shipping_code === value.shipping_code) return; if (shippingData.value.shipping_code === value.shipping_code) return;
if(value.support_cod === 1){
showCod.value = true
}else{
showCod.value = false
}
switch (value.shipping_code) { switch (value.shipping_code) {
case "shipping": case "shipping":
let resAddr = await getUserDefaultAddress(); let resAddr = await getUserDefaultAddress();
@ -434,6 +429,7 @@ const selectShipping = async (value) => {
orderStore.shipping = { orderStore.shipping = {
shipping_code: value.shipping_code, shipping_code: value.shipping_code,
shipping_id: value.shipping_id, shipping_id: value.shipping_id,
support_cod: value.support_cod,
shipping_fee: 0, shipping_fee: 0,
extra_data: { extra_data: {
zipcode: resAddr.data.zipcode, zipcode: resAddr.data.zipcode,
@ -448,6 +444,7 @@ const selectShipping = async (value) => {
orderStore.shipping = { orderStore.shipping = {
shipping_code: value.shipping_code, shipping_code: value.shipping_code,
shipping_id: value.shipping_id, shipping_id: value.shipping_id,
support_cod: value.support_cod,
shipping_fee: 0, shipping_fee: 0,
extra_data: {}, extra_data: {},
}; };
@ -461,6 +458,7 @@ const selectShipping = async (value) => {
shipping_code: value.shipping_code, shipping_code: value.shipping_code,
shipping_id: value.shipping_id, shipping_id: value.shipping_id,
shipping_fee: 0, shipping_fee: 0,
support_cod: value.support_cod,
extra_data: { extra_data: {
type: res.data.type, type: res.data.type,
store_id: res.data.store_id, store_id: res.data.store_id,
@ -473,6 +471,7 @@ const selectShipping = async (value) => {
orderStore.shipping = { orderStore.shipping = {
shipping_code: value.shipping_code, shipping_code: value.shipping_code,
shipping_id: value.shipping_id, shipping_id: value.shipping_id,
support_cod: value.support_cod,
shipping_fee: 0, shipping_fee: 0,
extra_data: {}, extra_data: {},
}; };
@ -484,6 +483,17 @@ const selectShipping = async (value) => {
} }
}; };
watch(()=>orderStore.shipping,(value)=>{
console.log('va',value)
if(value.support_cod === 1){
showCod.value = true
}else{
showCod.value = false
}
},{
immediate: true
})
const changeShipping = () => { const changeShipping = () => {
switch (shippingData.value.shipping_code) { switch (shippingData.value.shipping_code) {
case "ecpay": case "ecpay":

@ -112,6 +112,7 @@ onMounted(async () => {
orderStore.shipping.shipping_code = res2.shipping_code; orderStore.shipping.shipping_code = res2.shipping_code;
orderStore.shipping.shipping_id = res2.shipping_id; orderStore.shipping.shipping_id = res2.shipping_id;
orderStore.shipping.support_cod = res2.support_cod;
orderStore.shipping.shipping_fee = 0; orderStore.shipping.shipping_fee = 0;
router.replace("/checkout"); router.replace("/checkout");
} }
@ -143,7 +144,6 @@ const handleDeleteLogistic = async (id) => {
const handleGetMap = async (type) => { const handleGetMap = async (type) => {
let res = await getMap({ type }); let res = await getMap({ type });
if (res.code === 200) { if (res.code === 200) {
console.log(formContainer.value);
formContainer.value.innerHTML = res.data; formContainer.value.innerHTML = res.data;
if (showForm.value === "none") { if (showForm.value === "none") {
formContainer.value.querySelector("form").submit(); formContainer.value.querySelector("form").submit();

Loading…
Cancel
Save