This commit is contained in:
parent
b53fefd79f
commit
810944474d
|
@ -20,20 +20,20 @@
|
|||
<view>小计</view>
|
||||
<view style="color: #F55726;">¥ {{subtotal}}</view>
|
||||
</view>
|
||||
<view v-if="datas.is_bulk" class="row">
|
||||
<view v-if="datas.is_bulk" class="row" style="margin-bottom: 60rpx;">
|
||||
<view>商品重量<text style="color: #F55726;">*</text></view>
|
||||
<view><up-input v-model="datas.cart_num" border="none" placeholder="请输入重量" inputAlign="right"></up-input></view>
|
||||
<view><up-input v-model="datas.cart_num" border="none" placeholder="请输入重量" inputAlign="right"></up-input></view>
|
||||
</view>
|
||||
<view v-else class="row">
|
||||
<view v-else class="row" style="margin-bottom: 60rpx;">
|
||||
<view>商品数量<text style="color: #F55726;">*</text></view>
|
||||
<view><up-input v-model="datas.cart_num" border="none" placeholder="请输入数量" inputAlign="right"></up-input></view>
|
||||
</view>
|
||||
<view class="row">
|
||||
<view style="width: 30%;margin-right: 30rpx;">
|
||||
<up-button @click="close" color="#f7f7f7"><text style="color: #333;">取消</text></up-button>
|
||||
<up-button @click="close" type="number" color="#f7f7f7"><text style="color: #333;">取消</text></up-button>
|
||||
</view>
|
||||
<view style="flex: 1;">
|
||||
<up-button @click="change" color="#20b128">确定</up-button>
|
||||
<up-button @click="change" type="number" color="#20b128">确定</up-button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
|
|
@ -96,8 +96,8 @@
|
|||
</view>
|
||||
</viewPopup>
|
||||
<scroll-view class="list" scroll-y @scrolltolower="loadMoreGood" @scroll='hideHeadView'>
|
||||
<view class="shop-item" v-for="(item, index) in goodList" :key="item.id">
|
||||
<view class="shop-img" @tap="navTo(`/pageQuota/goodDetail/index`)">
|
||||
<view class="shop-item" v-for="(item, index) in goodList" :key="item.id" @click="openGoodPopup(item)">
|
||||
<view class="shop-img">
|
||||
<up-image width="160rpx" height="160rpx" :src="item.imgs"></up-image>
|
||||
</view>
|
||||
<view class="shop-content">
|
||||
|
@ -111,7 +111,7 @@
|
|||
</view>
|
||||
<view class="price-btn">
|
||||
<view class="price">¥{{item.sell}}</view>
|
||||
<view class="btn" @click="openGoodPopup(item)">
|
||||
<view class="btn">
|
||||
<u--icon name="plus-circle-fill" size="20" color="#20b128"></u--icon>
|
||||
</view>
|
||||
</view>
|
||||
|
@ -215,29 +215,17 @@
|
|||
getGoodList();
|
||||
}
|
||||
|
||||
const cartList = reactive(new Map());
|
||||
const addCart = (id, cart_num) => { //加入购物车
|
||||
cartCreateApi({
|
||||
cart_num: cart_num,
|
||||
is_new: 0, // 是否直接购买0否1是
|
||||
goods_id: id
|
||||
}).then(res => {
|
||||
console.log(res);
|
||||
let now = cartList.get(id) || 0;
|
||||
cartList.set(id, now + 1);
|
||||
getCartList();
|
||||
})
|
||||
}
|
||||
const removeCart = (id) => {
|
||||
let num = cartList.get(id) || 0;
|
||||
if (num == 0) return;
|
||||
cartChangeApi({
|
||||
goods_id: id,
|
||||
cart_num: num--
|
||||
}).then(res => {
|
||||
console.log(res);
|
||||
cartList.set(id, num)
|
||||
})
|
||||
}).catch(err=>{
|
||||
console.log(err);
|
||||
uni.$u.toast('添加失败')
|
||||
})
|
||||
}
|
||||
|
||||
const keyword = ref('');
|
||||
|
|
|
@ -24,14 +24,9 @@
|
|||
<view class="badge" v-if="orderCount.no_pay">{{orderCount.no_pay}}</view>
|
||||
</view>
|
||||
<view class="list-item" @click="navTo(2)">
|
||||
<image src="https://lihai001.oss-cn-chengdu.aliyuncs.com/def/53747202405061509465296.png"></image>
|
||||
<view class="">待发货</view>
|
||||
<view class="badge" v-if="orderCount.waiting">{{orderCount.waiting}}</view>
|
||||
</view>
|
||||
<view class="list-item" @click="navTo(3)">
|
||||
<image src="https://lihai001.oss-cn-chengdu.aliyuncs.com/def/45241202404261403353935.png"></image>
|
||||
<view class="">待收货</view>
|
||||
<view class="badge" v-if="orderCount.receiving">{{orderCount.receiving}}</view>
|
||||
<view class="badge" v-if="orderCount.waiting">{{orderCount.waiting}}</view>
|
||||
</view>
|
||||
<!-- <view class="list-item">
|
||||
<image src="https://lihai001.oss-cn-chengdu.aliyuncs.com/def/96915202404261403582769.png"></image>
|
||||
|
|
|
@ -54,7 +54,6 @@
|
|||
const tablist = ref([
|
||||
{ name: '全部' },
|
||||
{ name: '待付款' },
|
||||
{ name: '待发货' },
|
||||
{ name: '待收货' },
|
||||
// { name: '退款/售后' },
|
||||
]);
|
||||
|
@ -66,7 +65,6 @@
|
|||
if (swiperCurrent.value == 0 && orderList.value[0].length == 0) getOrderList(0);
|
||||
if (swiperCurrent.value == 1 && orderList.value[1].length == 0) getOrderList(1, '', 0);
|
||||
if (swiperCurrent.value == 2 && orderList.value[2].length == 0) getOrderList(2, 0);
|
||||
if (swiperCurrent.value == 3 && orderList.value[3].length == 0) getOrderList(3, 1);
|
||||
}
|
||||
|
||||
const showCancel = ref(false);
|
||||
|
@ -132,12 +130,6 @@
|
|||
loading: false,
|
||||
loadend: false
|
||||
},
|
||||
{
|
||||
page_no: 1,
|
||||
page_size: 25,
|
||||
loading: false,
|
||||
loadend: false
|
||||
},
|
||||
{
|
||||
page_no: 1,
|
||||
page_size: 25,
|
||||
|
@ -150,13 +142,13 @@
|
|||
[],
|
||||
[],
|
||||
[],
|
||||
[],
|
||||
])
|
||||
const getOrderList = (type = 0, status = '', paid = 1) => {
|
||||
if(where.value[type].loadend) return ;
|
||||
where.value[type].loading = true;
|
||||
orderListApi({
|
||||
...where.value[type],
|
||||
page_no: where.value[type].page_no,
|
||||
page_size: where.value[type].page_size,
|
||||
keyword: keyword.value,
|
||||
status: status,
|
||||
paid: paid
|
||||
|
@ -175,7 +167,6 @@
|
|||
if (swiperCurrent.value == 0) getOrderList(0);
|
||||
if (swiperCurrent.value == 1) getOrderList(1, '', 0);
|
||||
if (swiperCurrent.value == 2) getOrderList(2, 0);
|
||||
if (swiperCurrent.value == 3) getOrderList(3, 1);
|
||||
}
|
||||
|
||||
// 搜索
|
||||
|
@ -185,7 +176,6 @@
|
|||
if (swiperCurrent.value == 0) getOrderList(0);
|
||||
if (swiperCurrent.value == 1) getOrderList(1, '', 0);
|
||||
if (swiperCurrent.value == 2) getOrderList(2, 0);
|
||||
if (swiperCurrent.value == 3) getOrderList(3, 1);
|
||||
}
|
||||
|
||||
onLoad((options) => {
|
||||
|
@ -197,14 +187,12 @@
|
|||
// getOrderList(0);
|
||||
// getOrderList(1, '', 0);
|
||||
// getOrderList(2, 0);
|
||||
// getOrderList(3, 1);
|
||||
|
||||
uni.$on('reLoadOrderList', () => { //对订单进行操作时刷新页面
|
||||
where.value.forEach(item=>item.page_no=1);
|
||||
getOrderList(1, '', 0);
|
||||
getOrderList(0);
|
||||
getOrderList(2, 0);
|
||||
getOrderList(3, 1);
|
||||
});
|
||||
})
|
||||
</script>
|
||||
|
|
|
@ -20,7 +20,7 @@ const useUserStore = defineStore("user", () => {
|
|||
}
|
||||
|
||||
// #ifdef H5
|
||||
token.value = "f9421a985006bf3f73bbaff6193da353"
|
||||
token.value = "fe46d0ca2dd4dcabcbd3b4777aa35c22"
|
||||
userInfo.value = {
|
||||
avatar: "https://lihaiim.oss-cn-chengdu.aliyuncs.com/image/admin/default_avatar.png",
|
||||
id: 9,
|
||||
|
@ -29,7 +29,7 @@ const useUserStore = defineStore("user", () => {
|
|||
mobile: "19330904744",
|
||||
nickname: "用户1714964250",
|
||||
supplier: null,
|
||||
token: "f9421a985006bf3f73bbaff6193da353"
|
||||
token: "fe46d0ca2dd4dcabcbd3b4777aa35c22"
|
||||
}
|
||||
// #endif
|
||||
|
||||
|
|
Loading…
Reference in New Issue