| | |
| | | </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' |
| | |
| | | } |
| | | |
| | | 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 |
| | | } |
| | | 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('您已经兑换成功') |
| | | } 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}"` |