| | |
| | | </template> |
| | | <script setup lang="ts"> |
| | | import { ajaxPost } from '@/utils/axios' |
| | | import { Toast } from 'vant' |
| | | import { Toast } from 'vant' |
| | | import { watch } from 'vue' |
| | | import { computed } from 'vue' |
| | | import { ref } from 'vue' |
| | | import dizhi from '../components/dizhi.vue' |
| | | import { userInfoStore } from '@/stores/userInfo' |
| | | const userInfo = userInfoStore() |
| | | const emit = defineEmits(['fanhuiFun']) |
| | | const AllChecked=ref(false) |
| | | const loading = ref(false) |
| | | const isAdmin=ref(false) |
| | |
| | | Toast.success('删除成功') |
| | | console.log(re) |
| | | isAdmin.value=false |
| | | emit('fanhuiFun') |
| | | getPages() |
| | | }) |
| | | |
| | | } |
| | | |
| | | const jieshuan=()=>{ |
| | | alert('结算') |
| | | console.log(gwcList.value,defaultDizhi.value) |
| | | const listCode: any[]=[] |
| | | gwcList.value.forEach((el:any)=>{ |
| | | if (el.checked){ |
| | | listCode.push(el.code) |
| | | } |
| | | }) |
| | | if (listCode.length===0){ |
| | | Toast('没有选中要结算的商品') |
| | | return false |
| | | } |
| | | if (defaultDizhi.value.id===0){ |
| | | Toast('请先选择你的地址') |
| | | return false |
| | | } |
| | | const pasm=`cartCodes=${listCode.toString()}&addressCode=${defaultDizhi.value.code}` |
| | | console.log(pasm) |
| | | ajaxPost('/eshop/order/checkout',pasm) |
| | | .then((re:any)=>{ |
| | | console.log(re) |
| | | if (re==='OK'){ |
| | | Toast.success('您已经兑换成功') |
| | | emit('fanhuiFun') |
| | | show.value=false |
| | | } else { |
| | | Toast('兑换失败') |
| | | } |
| | | |
| | | }).catch((error)=>{ |
| | | console.log(error) |
| | | Toast('兑换失败') |
| | | }) |
| | | |
| | | } |
| | | const getDefDizhi=()=>{ |
| | | const pasm=`page=0&size=0&wherecondition=patient_is_default=1 and patient_code="${userInfo.patient.patientInfo.code}"` |