提交 40809de5 authored 作者: 刘旭's avatar 刘旭

今日份提交

上级 4680ed98
...@@ -36,6 +36,9 @@ export const orderDetail = (data: any) => request('/wx/order/detail', 'GET', dat ...@@ -36,6 +36,9 @@ export const orderDetail = (data: any) => request('/wx/order/detail', 'GET', dat
// 提交订单详细信息 // 提交订单详细信息
export const getOrderData = (data: any) => request('/wx/order/list', 'GET', data); export const getOrderData = (data: any) => request('/wx/order/list', 'GET', data);
// 删除订单 /wx/order/delete
export const orderDelete = (data: any) => request('/wx/order/delete', 'POST', data);
// 收藏详细信息 // 收藏详细信息
export const getCollectList = (data: any) => request('/wx/collect/list', 'GET', data); export const getCollectList = (data: any) => request('/wx/collect/list', 'GET', data);
......
...@@ -93,7 +93,9 @@ ...@@ -93,7 +93,9 @@
</view> </view>
<view class="bottom"> <view class="bottom">
<view class=""></view> <view class=""></view>
<view class="evaluate btn">删除订单</view> <view class="evaluate btn" @tap="orderDel(res.id)">
删除订单
</view>
</view> </view>
</view> </view>
<u-loadmore <u-loadmore
...@@ -126,16 +128,20 @@ ...@@ -126,16 +128,20 @@
</swiper> </swiper>
</view> </view>
</view> </view>
<u-modal v-model="show" :content="content" show-cancel-button @confirm="onConfirm"></u-modal>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { ref, computed } from 'vue' import { ref, computed } from 'vue'
import { getOrderData } from '@/api/index' import { getOrderData, orderDelete } from '@/api/index'
import { onLoad } from '@dcloudio/uni-app' import { onLoad } from '@dcloudio/uni-app'
import config from '@/utils/config'; import config from '@/utils/config';
let baseUrl = config.baseUrl; let baseUrl = config.baseUrl;
let show = ref(false)
let content = ref('确认删除该订单')
let listQuery = ref({ let listQuery = ref({
showType: 0, showType: 0,
page: 1, page: 1,
...@@ -154,6 +160,7 @@ let list = ref([ ...@@ -154,6 +160,7 @@ let list = ref([
let current = ref(0) let current = ref(0)
let swiperCurrent = ref(0) let swiperCurrent = ref(0)
let status = ref('loadmore') let status = ref('loadmore')
let orderIds = ref(0) //删除的订单id
onLoad((options?: any) => { onLoad((options?: any) => {
if(options) { if(options) {
...@@ -164,6 +171,8 @@ onLoad((options?: any) => { ...@@ -164,6 +171,8 @@ onLoad((options?: any) => {
getOrderList() getOrderList()
}) })
// 价格小数 // 价格小数
let priceDecimal = computed(() => { let priceDecimal = computed(() => {
return (val: any) => { return (val: any) => {
...@@ -223,7 +232,22 @@ let animationfinish = (data: any) => { ...@@ -223,7 +232,22 @@ let animationfinish = (data: any) => {
swiperTabs.value?.setFinishCurrent(currentNum); swiperTabs.value?.setFinishCurrent(currentNum);
swiperCurrent.value = currentNum; swiperCurrent.value = currentNum;
current.value = currentNum; current.value = currentNum;
} }
let orderDel = (orderId: number) => {
show.value = true
orderIds.value = orderId
}
let onConfirm = () => {
orderDelete({ orderId: orderIds.value }).then((res: any) => {
if(res.data.code === 200) {
orderData.value = []
listQuery.value.page = 1
getOrderList()
}
})
}
// 页面数据 // 页面数据
let getOrderList = () => { let getOrderList = () => {
......
...@@ -179,6 +179,11 @@ let addressSave = () => { ...@@ -179,6 +179,11 @@ let addressSave = () => {
title: '请输入收货人', title: '请输入收货人',
icon: 'none', icon: 'none',
}); });
if (!addressData.value.contactName)
return uni.showToast({
title: '请输入联系人',
icon: 'none',
});
let reg = /^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/; let reg = /^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/;
if (!reg.test(addressData.value.tel)) if (!reg.test(addressData.value.tel))
return uni.showToast({ return uni.showToast({
......
...@@ -2,7 +2,7 @@ const CONFIG: any = { ...@@ -2,7 +2,7 @@ const CONFIG: any = {
// 开发环境配置 // 开发环境配置
development: { development: {
assetsPath: 'http://192.168.0.23', // 静态资源路径 assetsPath: 'http://192.168.0.23', // 静态资源路径
baseUrl: 'http://192.168.0.9:8089', // 后台接口请求地址 baseUrl: 'http://192.168.0.23', // 后台接口请求地址
hostUrl: 'http://192.168.0.23', // H5地址(前端运行地址) hostUrl: 'http://192.168.0.23', // H5地址(前端运行地址)
websocketUrl: '', // websocket服务端地址 websocketUrl: '', // websocket服务端地址
}, },
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论