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 noAuth: true
}); });
} }
//购物车-批发列表
export const cartWholesaleListApi = (data) => {
return request.get('/order/cart/wholesale_lists', data, {
noAuth: true
});
}
//购物车-常买记录 //购物车-常买记录
export const frequentlyPurchaseApi = (data) => { export const frequentlyPurchaseApi = (data) => {
return request.get('/order/order/frequently_purchase', data); return request.get('/order/order/frequently_purchase', data);

View File

@ -10,4 +10,11 @@ export const goodClassListApi = (data) => {
export const storeProductListApi = (data) => { export const storeProductListApi = (data) => {
return request.get('/product/product/store_lists', 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>
<view class="row"> <view class="row">
<view>商品单位</view> <view>商品单位</view>
<view>{{ datas.unit_name }}</view> <view >{{ datas.unit_name }}
</view>
</view> </view>
<view class="row"> <view class="row">
<view>商品价格</view> <view>商品价格</view>
@ -37,7 +38,19 @@
<view v-if="datas.is_bulk" class="row" style="height: 100rpx;"> <view v-if="datas.is_bulk" class="row" style="height: 100rpx;">
<view>购买重量<text style="color: #F55726;">*</text></view> <view>购买重量<text style="color: #F55726;">*</text></view>
<view style="justify-content: end;"> <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> </view>
<view v-else class="row" style="height: 100rpx;"> <view v-else class="row" style="height: 100rpx;">
@ -78,7 +91,7 @@
}) })
const valChange = () => { const valChange = (e) => {
uni.vibrateShort(); uni.vibrateShort();
} }
@ -87,8 +100,11 @@
}); });
const setData = (e) => { const setData = (e) => {
datas.value = e; datas.value = e;
if (Number(e.batch) > 0) datas.value.cart_num = e.batch; if (Number(e.batch) > 0) {
else datas.value.cart_num = 1; 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 let sell = +datas.value[props.priceKey.off_activity == 1 ? props.priceKey.price : props
.priceKey .priceKey
.op_price]; .op_price];
if (!sell) {
sell = datas.value.price
num = datas.value.cart_num
}
return Number(num * sell * 100 / 100).toFixed(2) return Number(num * sell * 100 / 100).toFixed(2)
}) })

View File

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

View File

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

View File

@ -29,7 +29,7 @@
</view> </view>
<view class="afterSales-goods-right-info"> <view class="afterSales-goods-right-info">
<text class="goods_desc">{{item.unit}}</text> <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>
</view> </view>

View File

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

View File

@ -3,7 +3,7 @@
<view style="text-align: center;"> <view style="text-align: center;">
<image class="logo" src="https://lihai001.oss-cn-chengdu.aliyuncs.com/def/35adb202404271727457954.png"> <image class="logo" src="https://lihai001.oss-cn-chengdu.aliyuncs.com/def/35adb202404271727457954.png">
</image> </image>
<view class="tips">欢迎登录优采</view> <view class="tips">欢迎登录优采</view>
</view> </view>
<view class='card'> <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="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="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="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> </up-cell-group>
</view> </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)"> @click="callPhone(store_info.phone)">
<view class="top" style="align-items: flex-start;"> <view class="top" style="align-items: flex-start;">
<view style="color: #333;display: flex;align-items: center;flex-shrink: 0;"> <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> <view>
<view style="color: #333;"> <view style="color: #333;">

View File

@ -1,8 +1,37 @@
<template> <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="m-card good-info">
<view class="head-title">商品明细</view> <view class="head-title">商品明细</view>
<view class="m-good" v-for="(item, index) in cartList" :key="index"> <view class="m-good" v-for="(item, index) in cartList" :key="index">
<view class="image"> <view class="image">
<up-image width="160rpx" height="160rpx" :src="item.imgs"></up-image> <up-image width="160rpx" height="160rpx" :src="item.imgs"></up-image>
@ -22,7 +51,7 @@
{{ orderInfo.delivery_msg }} {{ orderInfo.delivery_msg }}
</view> </view>
</view> </view>
</view> </view>
</view> </view>
@ -59,8 +88,8 @@
<up-skeleton :loading="true" :animate="true"></up-skeleton> <up-skeleton :loading="true" :animate="true"></up-skeleton>
</view> </view>
</view> </view>
<up-alert v-if="timeContent!=''" type = "error" :description = "timeContent"></up-alert> <up-alert v-if="timeContent!=''" type="error" :description="timeContent"></up-alert>
<up-notice-bar text= "门店切换已移动到首页,若切换店铺,购物车商品将跟随门店一起切换"></up-notice-bar> <!-- <up-notice-bar text="门店切换已移动到首页,若切换店铺,购物车商品将跟随门店一起切换"></up-notice-bar> -->
</view> </view>
@ -201,9 +230,10 @@
// //
let STORE_INFO = uni.getStorageSync('STORE_INFO'); let STORE_INFO = uni.getStorageSync('STORE_INFO');
console.log(STORE_INFO)
if (STORE_INFO) { if (STORE_INFO) {
shop_Info.value = JSON.parse(STORE_INFO) shop_Info.value = JSON.parse(STORE_INFO)
}else{ } else {
uni.$u.toast('获取门店信息失败,请在首页选择门店') uni.$u.toast('获取门店信息失败,请在首页选择门店')
} }
@ -211,8 +241,8 @@
const reservation_time = ref('') const reservation_time = ref('')
const is_storage = ref(0) const is_storage = ref(0)
const LocationShow = ref(false) const LocationShow = ref(false)
const timeShow=ref(false) const timeShow = ref(false)
const timeContent=ref('') const timeContent = ref('')
const formData = ref({ const formData = ref({
remark: "" remark: ""
}) })
@ -354,9 +384,9 @@
cartList.value = res.data.cart_list; cartList.value = res.data.cart_list;
orderInfo.value = res.data.order; orderInfo.value = res.data.order;
shop_Info.value = res.data.shopInfo || {} shop_Info.value = res.data.shopInfo || {}
if(res.data.alert!=''){ if (res.data.alert != '') {
timeShow.value=true timeShow.value = true
timeContent.value=res.data.alert timeContent.value = res.data.alert
} }
checkInventoryApi({ checkInventoryApi({
cart_id: cartStore.cartList, cart_id: cartStore.cartList,
@ -494,6 +524,11 @@
onShow(() => { onShow(() => {
getAddressList(); getAddressList();
}) })
uni.$on('settle', function(data) {
let datas = JSON.parse(data)
shop_Info.value = datas
})
</script> </script>
<style lang="scss"> <style lang="scss">

View File

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