feat: remove backbtn and create weixin adapter
parent
bc74f4a11a
commit
aa8239bc3d
|
|
@ -1,12 +1,12 @@
|
||||||
<template>
|
<template>
|
||||||
<nut-drag direction="y" attract :style="{bottom:'15vh'}" class="rounded-full bg-[#fff] border-solid border-black border-[3rpx] left-[30rpx]" style="z-index: 999 !important;">
|
<nut-drag direction="y" attract :style="{bottom:'15vh'}" class="rounded-full bg-[#fff] border-solid border-black border-[3rpx] left-[30rpx]" style="z-index: 999 !important;">
|
||||||
<ChevronLeft class="w-[88rpx] h-[88rpx] text-black" :stroke-width="2" @click="goBack"/>
|
<ChevronLeft class="w-[88rpx] h-[88rpx] text-black" :stroke-width="2" @click="adapterHandleBack"/>
|
||||||
</nut-drag>
|
</nut-drag>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { ChevronLeft } from 'lucide-vue-next';
|
import { ChevronLeft } from 'lucide-vue-next';
|
||||||
import { useRouter } from 'vue-router';
|
import { adapterHandleBack } from '@/utils/adapterWX';
|
||||||
|
|
||||||
defineProps({
|
defineProps({
|
||||||
bottom:{
|
bottom:{
|
||||||
|
|
@ -19,9 +19,6 @@ defineProps({
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
const router = useRouter()
|
|
||||||
|
|
||||||
const goBack = () => {
|
|
||||||
router.back();
|
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,17 @@
|
||||||
|
import { useRouter } from "vue-router";
|
||||||
|
|
||||||
|
export const adapterHandleBack = () => {
|
||||||
|
const router = useRouter();
|
||||||
|
if (typeof uni !== "undefined") {
|
||||||
|
uni.getEnv((res) => {
|
||||||
|
if (res.miniprogram) {
|
||||||
|
uni.navigateBack({delta:1});
|
||||||
|
} else {
|
||||||
|
router.back();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
router.back();
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
};
|
||||||
|
|
@ -78,7 +78,7 @@
|
||||||
<div class="rounded-[20rpx] bg-[#28BEBB] text-[44rpx] text-white font-600 flex items-center justify-center py-[28rpx]">保存地址</div>
|
<div class="rounded-[20rpx] bg-[#28BEBB] text-[44rpx] text-white font-600 flex items-center justify-center py-[28rpx]">保存地址</div>
|
||||||
<div
|
<div
|
||||||
class="rounded-[20rpx] bg-white text-[44rpx] text-[#28BEBB] font-600 flex items-center justify-center py-[28rpx] border-[#28BEBB] border-[4rpx] border-solid mt-[38rpx]"
|
class="rounded-[20rpx] bg-white text-[44rpx] text-[#28BEBB] font-600 flex items-center justify-center py-[28rpx] border-[#28BEBB] border-[4rpx] border-solid mt-[38rpx]"
|
||||||
@click="goBack">
|
@click="adapterHandleBack">
|
||||||
返回
|
返回
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -88,6 +88,7 @@
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { Check } from "lucide-vue-next";
|
import { Check } from "lucide-vue-next";
|
||||||
|
import {adapterHandleBack} from '@/utils/adapterWX'
|
||||||
import { useRouter } from "vue-router";
|
import { useRouter } from "vue-router";
|
||||||
|
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
|
@ -107,9 +108,7 @@
|
||||||
router.push({ path: "/location/map" });
|
router.push({ path: "/location/map" });
|
||||||
};
|
};
|
||||||
|
|
||||||
const goBack = () => {
|
|
||||||
router.back();
|
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|
|
||||||
|
|
@ -79,7 +79,7 @@
|
||||||
<div class="rounded-[20rpx] bg-[#28BEBB] text-[44rpx] text-white font-600 flex items-center justify-center py-[28rpx]">保存</div>
|
<div class="rounded-[20rpx] bg-[#28BEBB] text-[44rpx] text-white font-600 flex items-center justify-center py-[28rpx]">保存</div>
|
||||||
<div
|
<div
|
||||||
class="rounded-[20rpx] bg-white text-[44rpx] text-[#28BEBB] font-600 flex items-center justify-center py-[28rpx] border-[#28BEBB] border-[4rpx] border-solid mt-[38rpx]"
|
class="rounded-[20rpx] bg-white text-[44rpx] text-[#28BEBB] font-600 flex items-center justify-center py-[28rpx] border-[#28BEBB] border-[4rpx] border-solid mt-[38rpx]"
|
||||||
@click="goBack">
|
@click="adapterHandleBack">
|
||||||
返回
|
返回
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -89,9 +89,8 @@
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { Check } from "lucide-vue-next";
|
import { Check } from "lucide-vue-next";
|
||||||
import { useRouter } from "vue-router";
|
import {adapterHandleBack} from '@/utils/adapterWX'
|
||||||
|
|
||||||
const router = useRouter();
|
|
||||||
const formData = reactive<Record<string, any>>({
|
const formData = reactive<Record<string, any>>({
|
||||||
name: "",
|
name: "",
|
||||||
gender: 1,
|
gender: 1,
|
||||||
|
|
@ -125,9 +124,6 @@
|
||||||
// router.push({ path: "/location/map" });
|
// router.push({ path: "/location/map" });
|
||||||
// };
|
// };
|
||||||
|
|
||||||
const goBack = () => {
|
|
||||||
router.back();
|
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,7 @@
|
||||||
</nut-radio-group>
|
</nut-radio-group>
|
||||||
</ul>
|
</ul>
|
||||||
<div class="flex items-center text-[44rpx] font-600 px-[30rpx] py-[16rpx] justify-between bg-white">
|
<div class="flex items-center text-[44rpx] font-600 px-[30rpx] py-[16rpx] justify-between bg-white">
|
||||||
<div class="rounded-[20rpx] border-[4rpx] border-solid border-[#28BEBB] px-[46rpx] py-[24rpx] text-[#28BEBB]" @click="handleBack">返回</div>
|
<div class="rounded-[20rpx] border-[4rpx] border-solid border-[#28BEBB] px-[46rpx] py-[24rpx] text-[#28BEBB]" @click="adapterHandleBack">返回</div>
|
||||||
<div class="flex items-center justify-between bg-[#28BEBB] rounded-[20rpx] px-[80rpx] py-[28rpx]" @click="toAddAddressPage">
|
<div class="flex items-center justify-between bg-[#28BEBB] rounded-[20rpx] px-[80rpx] py-[28rpx]" @click="toAddAddressPage">
|
||||||
<CirclePlus class="text-white mr-[16rpx]" />
|
<CirclePlus class="text-white mr-[16rpx]" />
|
||||||
<span class="text-white">新增收货地址</span>
|
<span class="text-white">新增收货地址</span>
|
||||||
|
|
@ -60,15 +60,13 @@
|
||||||
import { setUserDefaultAddress } from "@/api/interfaceDocument";
|
import { setUserDefaultAddress } from "@/api/interfaceDocument";
|
||||||
import { showToast } from "@nutui/nutui";
|
import { showToast } from "@nutui/nutui";
|
||||||
import { useUserStore } from "@/store/user";
|
import { useUserStore } from "@/store/user";
|
||||||
|
import { adapterHandleBack } from "@/utils/adapterWX";
|
||||||
|
|
||||||
useGetUserAddressList();
|
useGetUserAddressList();
|
||||||
|
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const userStore = useUserStore();
|
const userStore = useUserStore();
|
||||||
|
|
||||||
const handleBack = () => {
|
|
||||||
router.back();
|
|
||||||
};
|
|
||||||
|
|
||||||
const handleRemoveAddress = (index: number) => {
|
const handleRemoveAddress = (index: number) => {
|
||||||
address.value.splice(index, 1);
|
address.value.splice(index, 1);
|
||||||
|
|
@ -89,7 +87,7 @@
|
||||||
postRequest(setUserDefaultAddress()).then(() => {
|
postRequest(setUserDefaultAddress()).then(() => {
|
||||||
userStore.setDefaultAddress(item);
|
userStore.setDefaultAddress(item);
|
||||||
showToast.text("修改成功");
|
showToast.text("修改成功");
|
||||||
handleBack();
|
adapterHandleBack();
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
|
|
@ -33,27 +33,24 @@
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<div class="button-group px-[30rpx] grid gap-[40rpx] mt-[40rpx]">
|
<div class="button-group px-[30rpx] grid gap-[40rpx] mt-[40rpx]">
|
||||||
<nut-button class="w-full! submit-btn rounded-[20rpx]!" shape="square" @click="handleCancel">提交</nut-button>
|
<nut-button class="w-full! submit-btn rounded-[20rpx]!" shape="square" @click="adapterHandleBack">提交</nut-button>
|
||||||
<nut-button class="w-full! cancel-btn rounded-[20rpx]!" shape="square" @click="handleCancel">返回</nut-button>
|
<nut-button class="w-full! cancel-btn rounded-[20rpx]!" shape="square" @click="adapterHandleBack">返回</nut-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { Camera, Mars, Venus } from "lucide-vue-next";
|
import { Camera, Mars, Venus } from "lucide-vue-next";
|
||||||
import { useRouter } from "vue-router";
|
import { adapterHandleBack } from "@/utils/adapterWX";
|
||||||
|
|
||||||
const gender = ref("male");
|
const gender = ref("male");
|
||||||
const router = useRouter();
|
|
||||||
|
|
||||||
const formData = ref({
|
const formData = ref({
|
||||||
name: "",
|
name: "",
|
||||||
identify: "",
|
identify: "",
|
||||||
});
|
});
|
||||||
|
|
||||||
const handleCancel = () => {
|
|
||||||
router.go(-1);
|
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue