feat: 添加新功能和优化现有逻辑,增强用户体验

This commit is contained in:
mkm 2024-09-03 17:14:27 +08:00
parent e665c4ced7
commit 742402180b
13 changed files with 1268 additions and 23 deletions

View File

@ -21,7 +21,12 @@ export const cartListApi = (data) => {
noAuth: true
});
}
//购物车-批发列表
export const cartWholesaleListApi = (data) => {
return request.get('/order/cart/wholesale_lists', data, {
noAuth: true
});
}
//购物车-常买记录
export const frequentlyPurchaseApi = (data) => {
return request.get('/order/order/frequently_purchase', data);

View File

@ -10,4 +10,11 @@ export const goodClassListApi = (data) => {
export const storeProductListApi = (data) => {
return request.get('/product/product/store_lists', data);
}
/**
* 批发商品列表
*/
export const storeProductWholesaleListApi = (data) => {
return request.get('/product/product/wholesale_lists', data);
}

View File

@ -14,7 +14,8 @@
</view>
<view class="row">
<view>商品单位</view>
<view>{{ datas.unit_name }}</view>
<view >{{ datas.unit_name }}
</view>
</view>
<view class="row">
<view>商品价格</view>
@ -37,7 +38,19 @@
<view v-if="datas.is_bulk" class="row" style="height: 100rpx;">
<view>购买重量<text style="color: #F55726;">*</text></view>
<view style="justify-content: end;">
<up-number-box :min="0" v-model="datas.cart_num" @change="valChange"></up-number-box>
<up-input
type="digit"
placeholder="请输入重量"
border="surround"
v-model="datas.cart_num"
@change="valChange"
style="width: 100rpx;"
>
<template #suffix>
<span>{{ datas.unit_name }}</span>
</template>
</up-input>
<!-- <up-number-box :min="0.1" :step="0.1" v-model="datas.cart_num" @change="valChange"></up-number-box> -->
</view>
</view>
<view v-else class="row" style="height: 100rpx;">
@ -78,7 +91,7 @@
})
const valChange = () => {
const valChange = (e) => {
uni.vibrateShort();
}
@ -87,8 +100,11 @@
});
const setData = (e) => {
datas.value = e;
if (Number(e.batch) > 0) datas.value.cart_num = e.batch;
else datas.value.cart_num = 1;
if (Number(e.batch) > 0) {
datas.value.cart_num = e.batch;
} else {
datas.value.cart_num = 1;
}
}
@ -114,6 +130,11 @@
let sell = +datas.value[props.priceKey.off_activity == 1 ? props.priceKey.price : props
.priceKey
.op_price];
if (!sell) {
sell = datas.value.price
num = datas.value.cart_num
}
return Number(num * sell * 100 / 100).toFixed(2)
})

View File

@ -2,10 +2,10 @@ let BASE_URL
let WSS_URL
import store from "@/store/user.js"
// 环境
let env = "dev"
// let env = "dev"
// let env = "prod"
// let env = "release";
// let env = "local";
let env = "local";
switch (env) {
case 'dev':
@ -33,6 +33,7 @@ let config = {
WSS_URL: WSS_URL,
HEADER: {
'content-type': 'application/json',
'accept':'json',
//#ifdef MP
'Form-type': 'routine',
//#endif

View File

@ -121,6 +121,13 @@
{
"navigationBarTitleText" : "提现申请记录"
}
},
{
"path" : "pages/wholesale/index",
"style" :
{
"navigationBarTitleText" : "批发"
}
}
],
"subPackages": [{

View File

@ -29,7 +29,7 @@
</view>
<view class="afterSales-goods-right-info">
<text class="goods_desc">{{item.unit}}</text>
<text class="goods_num">x5</text>
<text class="goods_num">x{{item.cart_num}}</text>
</view>
</view>
</view>

View File

@ -9,7 +9,7 @@
<view class="login-box">
<image class="logo" src="https://lihai001.oss-cn-chengdu.aliyuncs.com/def/35adb202404271727457954.png" @click="test()">
</image>
<view class="tips">欢迎登录优采</view>
<view class="tips">欢迎登录优采</view>
<block v-if="showWeixin">
<up-transition :show="showWeixin">
<view class="btn">

View File

@ -3,7 +3,7 @@
<view style="text-align: center;">
<image class="logo" src="https://lihai001.oss-cn-chengdu.aliyuncs.com/def/35adb202404271727457954.png">
</image>
<view class="tips">欢迎登录优采</view>
<view class="tips">欢迎登录优采</view>
</view>
<view class='card'>

View File

@ -125,6 +125,7 @@
<up-cell title="商品列表" :isLink="true" url="pages/product/product" v-if="userInfo.system_store_id>0"></up-cell>
<up-cell title="订单列表" :isLink="true" url="pagesOrder/delivery/index" v-if="userInfo.system_store_id>0"></up-cell>
<up-cell title="采购列表" :isLink="true" url="pageQuota/purchase_product_offer/index" v-if="userInfo.delivery_service_id>0"></up-cell>
<up-cell title="我要批发" :isLink="true" url="pages/wholesale/index" v-if="userInfo.label_id==99"></up-cell>
</up-cell-group>
</view>

1167
pages/wholesale/index.vue Normal file

File diff suppressed because it is too large Load Diff

View File

@ -9,7 +9,7 @@
@click="callPhone(store_info.phone)">
<view class="top" style="align-items: flex-start;">
<view style="color: #333;display: flex;align-items: center;flex-shrink: 0;">
<text style="margin: 0 10rpx;color:#20B128">自提</text>
<text style="margin: 0 10rpx;color:#20B128">配送</text>
</view>
<view>
<view style="color: #333;">

View File

@ -1,8 +1,37 @@
<template>
<view class="">
<view class="">
<view class="m-card m-address" style="margin-top: 20rpx;">
<view class="address-info"
style='display: flex;justify-content: space-between;width: 690rpx;align-items: center;'>
<view class="top" style="align-items: flex-start;">
<!-- <view style="color: #333;width: 200rpx;">
<view style="margin: 0 10rpx;color:#20B128;width: 150rpx;">配送点</view>
<view class="isreser"> {{reservation?"次日可提":"当日可提" }}
</view>
</view> -->
<view>
<view style="color: #333;">
{{shop_Info.name}}
</view>
<view style="font-size: 24rpx;color: #333;margin: 10rpx 0;">
{{shop_Info.detailed_address}}
</view>
<view>
<view>
<text>{{shop_Info.phone}}</text>
</view>
</view>
</view>
</view>
<view style="padding: 20rpx;background-color:#20B128;color: white;border-radius: 40rpx;flex-shrink: 0;"
@click="navgo(`/multipleShop/index/index?event=settle&cart_id=${cartStore.cartList.join(',')}`)">
切换配送点
</view>
</view>
</view>
<view class="m-card good-info">
<view class="head-title">商品明细</view>
<view class="m-good" v-for="(item, index) in cartList" :key="index">
<view class="image">
<up-image width="160rpx" height="160rpx" :src="item.imgs"></up-image>
@ -22,7 +51,7 @@
{{ orderInfo.delivery_msg }}
</view>
</view>
</view>
</view>
</view>
@ -59,8 +88,8 @@
<up-skeleton :loading="true" :animate="true"></up-skeleton>
</view>
</view>
<up-alert v-if="timeContent!=''" type = "error" :description = "timeContent"></up-alert>
<up-notice-bar text= "门店切换已移动到首页,若切换店铺,购物车商品将跟随门店一起切换"></up-notice-bar>
<up-alert v-if="timeContent!=''" type="error" :description="timeContent"></up-alert>
<!-- <up-notice-bar text="门店切换已移动到首页,若切换店铺,购物车商品将跟随门店一起切换"></up-notice-bar> -->
</view>
@ -201,9 +230,10 @@
//
let STORE_INFO = uni.getStorageSync('STORE_INFO');
console.log(STORE_INFO)
if (STORE_INFO) {
shop_Info.value = JSON.parse(STORE_INFO)
}else{
} else {
uni.$u.toast('获取门店信息失败,请在首页选择门店')
}
@ -211,8 +241,8 @@
const reservation_time = ref('')
const is_storage = ref(0)
const LocationShow = ref(false)
const timeShow=ref(false)
const timeContent=ref('')
const timeShow = ref(false)
const timeContent = ref('')
const formData = ref({
remark: ""
})
@ -354,9 +384,9 @@
cartList.value = res.data.cart_list;
orderInfo.value = res.data.order;
shop_Info.value = res.data.shopInfo || {}
if(res.data.alert!=''){
timeShow.value=true
timeContent.value=res.data.alert
if (res.data.alert != '') {
timeShow.value = true
timeContent.value = res.data.alert
}
checkInventoryApi({
cart_id: cartStore.cartList,
@ -494,6 +524,11 @@
onShow(() => {
getAddressList();
})
uni.$on('settle', function(data) {
let datas = JSON.parse(data)
shop_Info.value = datas
})
</script>
<style lang="scss">

View File

@ -22,6 +22,7 @@ function baseRequest(url, method, data, {
url: Url + '/api' + url,
method: method || 'GET',
header: {
accept:'json',
...header
},
data: method != 'GET' ? data || {} : {},