This commit is contained in:
weipengfei 2024-05-07 19:02:43 +08:00
parent a73d525e18
commit af10285e87
6 changed files with 38 additions and 11 deletions

View File

@ -21,15 +21,15 @@
<view style="color: #F55726;">¥ {{subtotal}}</view> <view style="color: #F55726;">¥ {{subtotal}}</view>
</view> </view>
<view v-if="datas.is_bulk" class="row"> <view v-if="datas.is_bulk" class="row">
<view>商品重量<text style="color: #F55726;">*</text></view> <view>购买重量<text style="color: #F55726;">*</text></view>
<view style="flex: 1;"> <view style="flex: 1;">
<up-input v-model="datas.cart_num" type="number" border="none" placeholder="请输入量" inputAlign="right"></up-input> <up-input v-model="datas.cart_num" type="number" border="none" placeholder="请输入购买重量" inputAlign="right"></up-input>
</view> </view>
</view> </view>
<view v-else class="row"> <view v-else class="row">
<view>商品数量<text style="color: #F55726;">*</text></view> <view>购买数量<text style="color: #F55726;">*</text></view>
<view style="flex: 1;"> <view style="flex: 1;">
<up-input v-model="datas.cart_num" type="number" border="none" placeholder="请输入数量" inputAlign="right"></up-input> <up-input v-model="datas.cart_num" type="number" border="none" placeholder="请输入购买数量" inputAlign="right"></up-input>
</view> </view>
</view> </view>
<view class="row" style="padding-top: 30px;padding-bottom: 30rpx;"> <view class="row" style="padding-top: 30px;padding-bottom: 30rpx;">
@ -46,6 +46,7 @@
<script setup> <script setup>
import { computed, ref } from "vue" import { computed, ref } from "vue"
import { toast } from "../uni_modules/uview-plus";
const props = defineProps({ const props = defineProps({
show: { show: {
@ -67,6 +68,11 @@
} }
const change = () => { const change = () => {
if(subtotal.value<=0) {
uni.$u.toast('金额不可小于等于0');
datas.value.cart_num = '';
return ;
}
emit('change', datas.value); emit('change', datas.value);
} }

View File

@ -49,7 +49,8 @@
"path": "order/order", "path": "order/order",
"style": { "style": {
"navigationBarTitleText": "我的订单", "navigationBarTitleText": "我的订单",
"enablePullDownRefresh": false "enablePullDownRefresh": false,
"navigationStyle": "custom"
} }
}, },
{ {

View File

@ -6,7 +6,7 @@
<text>待付款</text> <text>待付款</text>
</view> </view>
<view v-else> <view v-else>
<text v-if="datas.status==0"></text> <text v-if="datas.status==0"></text>
<text v-if="datas.status==1">待收货</text> <text v-if="datas.status==1">待收货</text>
<text v-if="datas.status==2||datas.status==3">已完成</text> <text v-if="datas.status==2||datas.status==3">已完成</text>
</view> </view>

View File

@ -1,5 +1,10 @@
<template> <template>
<view> <view>
<up-navbar placeholder style="z-index: 10080;" @leftClick="navBack">
<template #center>
<view>订单</view>
</template>
</up-navbar>
<up-sticky bgColor="#fff"> <up-sticky bgColor="#fff">
<view style="padding: 10rpx 20rpx 0 20rpx;"> <view style="padding: 10rpx 20rpx 0 20rpx;">
<up-search shape="round" v-model="keyword" @custom="searchOn" @search="searchOn" @clear="searchOn" <up-search shape="round" v-model="keyword" @custom="searchOn" @search="searchOn" @clear="searchOn"
@ -149,7 +154,7 @@
orderListApi({ orderListApi({
page_no: where.value[type].page_no, page_no: where.value[type].page_no,
page_size: where.value[type].page_size, page_size: where.value[type].page_size,
keyword: keyword.value, number: keyword.value,
status: status, status: status,
paid: paid paid: paid
}).then(res => { }).then(res => {
@ -173,17 +178,26 @@
const searchOn = () => { const searchOn = () => {
orderList.value[+swiperCurrent.value] = []; orderList.value[+swiperCurrent.value] = [];
where.value[+swiperCurrent.value].page_no = 1; where.value[+swiperCurrent.value].page_no = 1;
where.value[+swiperCurrent.value].loadend = false;
if (swiperCurrent.value == 0) getOrderList(0); if (swiperCurrent.value == 0) getOrderList(0);
if (swiperCurrent.value == 1) getOrderList(1, '', 0); if (swiperCurrent.value == 1) getOrderList(1, '', 0);
if (swiperCurrent.value == 2) getOrderList(2, 0); if (swiperCurrent.value == 2) getOrderList(2, 0);
} }
let back = 0;
const navBack = ()=>{
uni.navigateBack({
delta: back ? +back : 0
})
}
onLoad((options) => { onLoad((options) => {
if (options.type) { if (options.type) {
tabsActive.value = +options.type; tabsActive.value = +options.type;
swiperCurrent.value = +options.type; swiperCurrent.value = +options.type;
searchOn(); searchOn();
} }
if(options.back) back = options.back;
// getOrderList(0); // getOrderList(0);
// getOrderList(1, '', 0); // getOrderList(1, '', 0);
// getOrderList(2, 0); // getOrderList(2, 0);
@ -195,6 +209,7 @@
getOrderList(2, 0); getOrderList(2, 0);
}); });
}) })
</script> </script>
<style lang="scss"> <style lang="scss">

View File

@ -213,7 +213,7 @@
} }
}) })
} }
getMerchantList(''); getMerchantList();
// //
const LoadAddress = () => { const LoadAddress = () => {
uni.getLocation({ uni.getLocation({
@ -253,6 +253,10 @@
// //
const submitOrder = () => { const submitOrder = () => {
if (!shopInfo.value.mer_id) {
uni.$u.toast('请先选择提货点');
return shopListShow.value = true;
}
if (!isAddress.value) return toastAddressShow.value = true; if (!isAddress.value) return toastAddressShow.value = true;
createOrder(); createOrder();
} }
@ -289,8 +293,8 @@
confirmText: '查看订单', confirmText: '查看订单',
cancelText: '继续购买', cancelText: '继续购买',
success: (e) => { success: (e) => {
if (e.confirm) uni.navigateTo({ if (e.confirm) uni.redirectTo({
url: '/pagesOrder/order/order' url: '/pagesOrder/order/order?back=-1&type=2'
}) })
else uni.navigateBack(); else uni.navigateBack();
} }

View File

@ -24,7 +24,8 @@ const useUserStore = defineStore("user", () => {
} }
// #ifdef H5 // #ifdef H5
token.value = "95b24dd6d2dda836fe07854b08ba0944" token.value = "0f680a9bc1cdccd7ce588a2a58029411"
// token.value = "95b24dd6d2dda836fe07854b08ba0944"
userInfo.value = { userInfo.value = {
avatar: "https://lihaiim.oss-cn-chengdu.aliyuncs.com/image/admin/default_avatar.png", avatar: "https://lihaiim.oss-cn-chengdu.aliyuncs.com/image/admin/default_avatar.png",
id: 9, id: 9,