Compare commits

...

4 Commits

Author SHA1 Message Date
赵毅
414ea79463 优化首页搜索框跳转逻辑 2025-10-22 14:44:06 +08:00
赵毅
d3c1ab9a99 修改我的小区文字显示 2025-10-22 10:55:47 +08:00
赵毅
fad29dd656 完成商家模块小程序部分的修改 2025-10-22 10:55:11 +08:00
赵毅
7d6cff8a62 完成商品买一赠一的功能 2025-10-21 16:40:41 +08:00
8 changed files with 119 additions and 64 deletions

View File

@ -43,7 +43,7 @@
<view class="group-price"> <view class="group-price">
<view>{{ item.commodity_goods_info.sales_price }}/{{ <view>{{ item.commodity_goods_info.sales_price }}/{{
item.commodity_goods_info.goods_unit item.commodity_goods_info.goods_unit
}}</view> }}</view>
<!-- 运费 --> <!-- 运费 -->
<view class="goods-desc" style="margin-top: 10rpx;">运费 {{ <view class="goods-desc" style="margin-top: 10rpx;">运费 {{
item.commodity_goods_info.freight }}</view> item.commodity_goods_info.freight }}</view>
@ -462,10 +462,10 @@ export default {
}); });
item.count = 0 item.count = 0
} else { } else {
item.count-- item.count -= item.is_one_one === 1 ? 2 : 1;
} }
} else { } else {
item.count-- item.count -= item.is_one_one === 1 ? 2 : 1;
} }
// 0carList // 0carList
@ -496,11 +496,11 @@ export default {
if (currentTime >= startTime && currentTime <= endTime) { if (currentTime >= startTime && currentTime <= endTime) {
if (item.count == 0) { if (item.count == 0) {
item.count += item.commodity_goods_info.min_order_quantity item.count += item.is_one_one === 1 ? 2 : 1;
} else { } else {
if (item.count >= item.commodity_goods_info.stock_quantity) { if (item.count >= item.purchase_limit) {
uni.showToast({ uni.showToast({
title: '库存不足', title: '您选择的数量已达到最大限购量',
icon: 'none' icon: 'none'
}); });
return return
@ -514,7 +514,7 @@ export default {
} }
} }
} }
item.count++; item.count += item.is_one_one === 1 ? 2 : 1;
this.changeCart(item); this.changeCart(item);
}, },
// //
@ -543,15 +543,15 @@ export default {
let total = 0; let total = 0;
this.orderList1.forEach(goods => { this.orderList1.forEach(goods => {
// 使item.price // 使item.price
total += goods.price * goods.count; total += goods.price * (goods.is_one_one === 1 ? goods.count / 2 : goods.count);
}); });
// //
return total.toFixed(2); return total.toFixed(2);
} else { } else {
let total = 0; let total = 0;
this.orderList2.forEach(goods => { this.orderList2.forEach(goods => {
// 使item.price // 使item.price
total += goods.price * goods.count; total += goods.price * (goods.is_one_one === 1 ? goods.count / 2 : goods.count);
this.totalPrice = total.toFixed(2); this.totalPrice = total.toFixed(2);
}); });
// //
@ -666,7 +666,7 @@ export default {
goods_and_count: group.map(item => { goods_and_count: group.map(item => {
return { return {
goods_id: item.goods_id, goods_id: item.goods_id,
count: item.count, count: item.is_one_one === 1 ? item.count / 2 : item.count,
price: item.price, price: item.price,
freight: item.commodity_goods_info.freight, freight: item.commodity_goods_info.freight,
} }

View File

@ -147,25 +147,23 @@ export default {
increaseQuantity(index) { increaseQuantity(index) {
const item = this.goodsList[index] const item = this.goodsList[index]
if (item.quantity == 0) { if (item.quantity == 0) {
item.quantity += item.min_order_quantity || 1 if (item.one_one === 1) {
this.carNum += item.min_order_quantity || 1 item.quantity += 2
this.carNum += 2
} else {
item.quantity += 1
this.carNum += 1
}
} else { } else {
if (item.quantity == item.total_stock) { if (item.quantity == (item.one_one === 1 ? item.purchase_limit * 2 : item.purchase_limit)) {
uni.showToast({ uni.showToast({
title: '库存不足', title: '您选择的数量已达到最大限购量',
icon: 'none' icon: 'none'
}); });
return return
} }
if (item.quantity == item.max_limit_quantity) { item.quantity = item.one_one === 1 ? item.quantity + 2 : item.quantity + 1;
uni.showToast({ this.carNum = item.one_one === 1 ? this.carNum + 2 : this.carNum + 1;
title: '一次最多购买' + item.max_limit_quantity + '件',
icon: 'none'
});
return
}
item.quantity++;
this.carNum++;
} }
const params = { const params = {
goods_id_and_count: [ goods_id_and_count: [
@ -173,6 +171,8 @@ export default {
goods_id: item.goods_id, goods_id: item.goods_id,
count: item.quantity, count: item.quantity,
price: item.promotional_price, price: item.promotional_price,
is_one_one: item.one_one,
purchase_limit: item.purchase_limit,
}, },
], ],
adver_id: item.adver_id adver_id: item.adver_id
@ -183,9 +183,9 @@ export default {
decreaseQuantity(index) { decreaseQuantity(index) {
const item = this.goodsList[index] const item = this.goodsList[index]
if (item.quantity > 0) { if (item.quantity > 0) {
if (item.quantity == (item.min_order_quantity || 1)) { if (item.one_one === 1) {
item.quantity = 0 item.quantity = item.quantity - 2
this.carNum = 0 this.carNum = this.carNum - 2
} else { } else {
item.quantity--; item.quantity--;
this.carNum--; this.carNum--;
@ -197,6 +197,8 @@ export default {
goods_id: item.goods_id, goods_id: item.goods_id,
count: item.quantity, count: item.quantity,
price: item.promotional_price, price: item.promotional_price,
is_one_one: item.one_one,
purchase_limit: item.purchase_limit,
}, },
], ],
adver_id: item.adver_id adver_id: item.adver_id

View File

@ -516,7 +516,12 @@ export default {
// } else { // } else {
// total += goods.commodity_goods_info.sales_price * goods.count; // total += goods.commodity_goods_info.sales_price * goods.count;
// } // }
total += goods.price * goods.count
if(goods.is_one_one === 1) {
total += goods.price * (goods.count / 2)
} else {
total += goods.price * goods.count
}
} }
}); });
}); });
@ -593,8 +598,8 @@ export default {
that.deleteCarItem(carItem, goodsIndex, item); that.deleteCarItem(carItem, goodsIndex, item);
} else { } else {
// //
this.shopCarTotal = Math.max(0, this.shopCarTotal - 1); this.shopCarTotal = carItem.is_one_one === 1 ? Math.max(0, that.shopCarTotal - 2) : Math.max(0, that.shopCarTotal - 1);
carItem.count = carItem.count - 1; carItem.count = carItem.is_one_one === 1 ? carItem.count - 2 : carItem.count - 1;
this.handleQuantityChange(carItem.count, carItem); this.handleQuantityChange(carItem.count, carItem);
// 0 // 0
@ -617,12 +622,12 @@ export default {
currentTime <= new Date(carItem.commodity_goods_info.group_buy_activity_info?.end_time).getTime(); currentTime <= new Date(carItem.commodity_goods_info.group_buy_activity_info?.end_time).getTime();
if (isGroupBuyActive) { if (isGroupBuyActive) {
if (carItem.count == 0) { if (carItem.count == 0) {
carItem.count = carItem.commodity_goods_info.min_order_quantity carItem.count = carItem.is_one_one === 1 ? 2 : 1
this.shopCarTotal += carItem.commodity_goods_info.min_order_quantity; this.shopCarTotal += carItem.is_one_one === 1 ? 2 : 1;
} else { } else {
if (carItem.count == carItem.commodity_goods_info.total_stock) { if (carItem.count == carItem.purchase_limit) {
uni.showToast({ uni.showToast({
title: '库存不足', title: '您选择的数量已达到最大限购量',
icon: 'none' icon: 'none'
}); });
return return
@ -634,19 +639,19 @@ export default {
}); });
return return
} }
carItem.count++; carItem.count += carItem.is_one_one === 1 ? 2 : 1;
this.shopCarTotal++; this.shopCarTotal += carItem.is_one_one === 1 ? 2 : 1;
} }
} else { } else {
if (carItem.count >= carItem.commodity_goods_info.stock_quantity) { if (carItem.count >= carItem.purchase_limit) {
uni.showToast({ uni.showToast({
title: '库存不足', title: '您选择的数量已达到最大限购量',
icon: 'none' icon: 'none'
}); });
return return
} }
carItem.count++; carItem.count += carItem.is_one_one === 1 ? 2 : 1;
this.shopCarTotal++; this.shopCarTotal += carItem.is_one_one === 1 ? 2 : 1;
} }
const item = carItem.commodity_cart_and_goods_model; const item = carItem.commodity_cart_and_goods_model;

View File

@ -231,7 +231,7 @@ export default {
}, },
{ {
nav_icon: 'https://wechat-img-file.oss-cn-beijing.aliyuncs.com/noValFunction1.png', nav_icon: 'https://wechat-img-file.oss-cn-beijing.aliyuncs.com/noValFunction1.png',
nav_name: "物业修", nav_name: "物业修",
}, },
{ {
nav_icon: 'https://wechat-img-file.oss-cn-beijing.aliyuncs.com/noValFunction4.png', nav_icon: 'https://wechat-img-file.oss-cn-beijing.aliyuncs.com/noValFunction4.png',

View File

@ -130,7 +130,7 @@ export default {
localHeight: "", localHeight: "",
roomList: [], roomList: [],
columns: [], columns: [],
category: {}, // category: {}, //
repairInfo: '', // repairInfo: '', //
contactName: '', // contactName: '', //
contactPhone: '', // contactPhone: '', //

View File

@ -46,6 +46,13 @@
<input type="text" v-model="contact_phone" placeholder="请输入联系方式"> <input type="text" v-model="contact_phone" placeholder="请输入联系方式">
</view> </view>
</view> </view>
<view class="row">
<view class="row_label">商家分类</view>
<view class="row_con" @click="chooseClassify">
<input type="text" disabled v-model="confirmClassify.short_name" placeholder="请选择商家分类">
<u-icon name="arrow-right" color="#999999" size="28"></u-icon>
</view>
</view>
<view class="row"> <view class="row">
<view class="row_label">银行卡号</view> <view class="row_label">银行卡号</view>
<view class="row_con nonebor"> <view class="row_con nonebor">
@ -61,7 +68,9 @@
<u-upload :fileList="imgList" @afterRead="afterReadImg" @delete="deletePic" name="1" multiple <u-upload :fileList="imgList" @afterRead="afterReadImg" @delete="deletePic" name="1" multiple
:maxCount="10"> :maxCount="10">
<view class="imgCon"> <view class="imgCon">
<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/com_imageImg.png" mode="widthFix"></image> <image
src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/com_imageImg.png"
mode="widthFix"></image>
上传图片 上传图片
</view> </view>
</u-upload> </u-upload>
@ -74,7 +83,9 @@
<u-upload :fileList="imgList3" @afterRead="afterReadImg2" @delete="deletePic2" name="1" multiple <u-upload :fileList="imgList3" @afterRead="afterReadImg2" @delete="deletePic2" name="1" multiple
:maxCount="10"> :maxCount="10">
<view class="imgCon"> <view class="imgCon">
<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/com_imageImg.png" mode="widthFix"></image> <image
src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/com_imageImg.png"
mode="widthFix"></image>
上传图片 上传图片
</view> </view>
</u-upload> </u-upload>
@ -87,7 +98,9 @@
<u-upload :fileList="imgList5" @afterRead="afterReadImg3" @delete="deletePic3" name="1" multiple <u-upload :fileList="imgList5" @afterRead="afterReadImg3" @delete="deletePic3" name="1" multiple
:maxCount="1"> :maxCount="1">
<view class="imgCon"> <view class="imgCon">
<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/com_imageImg.png" mode="widthFix"></image> <image
src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/com_imageImg.png"
mode="widthFix"></image>
上传图片 上传图片
</view> </view>
</u-upload> </u-upload>
@ -102,6 +115,8 @@
@cancel="cancelCity"></u-picker> @cancel="cancelCity"></u-picker>
<u-picker :show="show3" :columns="[buss]" keyName="short_name" @confirm="clickBuss" <u-picker :show="show3" :columns="[buss]" keyName="short_name" @confirm="clickBuss"
@cancel="cancelBuss"></u-picker> @cancel="cancelBuss"></u-picker>
<u-picker :show="show4" :columns="[classify]" keyName="short_name" @confirm="clickClassify"
@cancel="cancelClassify"></u-picker>
</view> </view>
</template> </template>
@ -140,15 +155,18 @@ export default {
store_name: "", store_name: "",
address: "", address: "",
confirmProv:"", confirmProv: "",
confirmCity:"", confirmCity: "",
confirmBusiness:"", confirmBusiness: "",
confirmClassify: "",
pro: [], pro: [],
show: false, show: false,
city: [], city: [],
show2: false, show2: false,
buss: [], buss: [],
show3: false, show3: false,
classify: [],
show4: false,
} }
}, },
methods: { methods: {
@ -181,6 +199,14 @@ export default {
this.getCity(e.value[0].ad_code) this.getCity(e.value[0].ad_code)
this.confirmProv = e.value[0] this.confirmProv = e.value[0]
}, },
cancelClassify() {
this.show4 = false;
},
clickClassify(e) {
this.show4 = false;
this.confirmClassify = e.value[0]
console.log("🚀 ~ this.confirmClassify:", this.confirmClassify)
},
chooseCity() { chooseCity() {
this.show = true; this.show = true;
}, },
@ -190,6 +216,9 @@ export default {
chooseCity3() { chooseCity3() {
this.show3 = true; this.show3 = true;
}, },
chooseClassify() {
this.show4 = true;
},
afterReadImg(e) { afterReadImg(e) {
e.file.forEach(item => { e.file.forEach(item => {
upload(item.url, res => { upload(item.url, res => {
@ -254,24 +283,30 @@ export default {
duration: 2000 duration: 2000
}); });
} }
if(!that.confirmProv.ad_code){ if (!that.confirmProv.ad_code) {
return uni.showToast({ return uni.showToast({
title: '请选择所在省', title: '请选择所在省',
duration: 2000 duration: 2000
}); });
} }
if(!that.confirmCity.ad_code){ if (!that.confirmCity.ad_code) {
return uni.showToast({ return uni.showToast({
title: '请选择所在市', title: '请选择所在市',
duration: 2000 duration: 2000
}); });
} }
if(!that.confirmBusiness.ad_code){ if (!that.confirmBusiness.ad_code) {
return uni.showToast({ return uni.showToast({
title: '请选择所在区', title: '请选择所在区',
duration: 2000 duration: 2000
}); });
} }
if (!that.confirmClassify.ad_code) {
return uni.showToast({
title: '请选择商家分类',
duration: 2000
});
}
if (!that.imgList6.length) { if (!that.imgList6.length) {
return uni.showToast({ return uni.showToast({
title: '请上传营业执照', title: '请上传营业执照',
@ -288,10 +323,11 @@ export default {
bank_card: that.bank_card, bank_card: that.bank_card,
store_name: that.store_name, store_name: that.store_name,
address: that.address, address: that.address,
ad_code:that.confirmBusiness.ad_code, ad_code: that.confirmBusiness.ad_code,
facade_photo, facade_photo,
interior_photo, interior_photo,
license_photo, license_photo,
classify_code: that.confirmClassify.ad_code,
}).then(res => { }).then(res => {
that.contact_name = '' that.contact_name = ''
that.contact_phone = '' that.contact_phone = ''
@ -307,6 +343,7 @@ export default {
that.imgList4 = [] that.imgList4 = []
that.imgList5 = [] that.imgList5 = []
that.imgList6 = [] that.imgList6 = []
that.confirmClassify = ''
NavgateTo("../sucess/index") NavgateTo("../sucess/index")
}) })
}, },
@ -332,10 +369,27 @@ export default {
this.buss = res.rows this.buss = res.rows
}) })
}, },
getClassify(e) {
this.classify = [
{
ad_code: "1",
short_name: "111"
},
{
ad_code: "2",
short_name: "222"
},
{
ad_code: "3",
short_name: "333"
},
]
},
}, },
onLoad() { onLoad() {
this.getPro() this.getPro()
this.getClassify()
} }
} }
</script> </script>

View File

@ -49,7 +49,7 @@ page {
} }
.hot-word-container { .hot-word-container {
width: 60%; width: 90%;
height: 50rpx; height: 50rpx;
overflow: hidden; overflow: hidden;
position: relative; position: relative;
@ -73,7 +73,7 @@ page {
background-color: #f5f5f5; background-color: #f5f5f5;
} }
.search_input{ .search_input {
width: 55%; width: 55%;
height: 50rpx; height: 50rpx;
line-height: 50rpx; line-height: 50rpx;
@ -81,11 +81,6 @@ page {
color: #666; color: #666;
} }
.searchBox2 {
display: flex;
align-items: center;
}
.white_container { .white_container {
background: #FFFFFF; background: #FFFFFF;
padding: 0 20rpx; padding: 0 20rpx;
@ -170,6 +165,8 @@ page {
} }
.searchBox2 { .searchBox2 {
display: flex;
align-items: center;
width: 100%; width: 100%;
height: 60rpx; height: 60rpx;
background-color: #f6f7fb; background-color: #f6f7fb;
@ -183,7 +180,7 @@ page {
} }
.searchBox2 image { .searchBox2 image {
width: 40rpx; width: 30rpx;
height: 28rpx; height: 28rpx;
margin-right: 16rpx; margin-right: 16rpx;
} }

View File

@ -21,7 +21,7 @@
<!-- 搜索框 --> <!-- 搜索框 -->
<view class="search2" v-if="isShowSearch"> <view class="search2" v-if="isShowSearch">
<view class="searchBox2"> <view class="searchBox2" @click="goSearchView">
<image <image
src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/com_communitySearchIcon.png" src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/com_communitySearchIcon.png"
mode="aspectFill"></image> mode="aspectFill"></image>
@ -33,9 +33,6 @@
</view> </view>
</view> </view>
</view> </view>
<view class="search_input" @click="goSearchView">
请输入内容
</view>
<!-- <input class="search_input" placeholder='请输入内容' confirm-type='search' @input="searchInput" <!-- <input class="search_input" placeholder='请输入内容' confirm-type='search' @input="searchInput"
@confirm="searchInput" :value="selectKeyWord" @click="goSearchView"/> --> @confirm="searchInput" :value="selectKeyWord" @click="goSearchView"/> -->
</view> </view>