From 7f122c9754184c56156ca980b98b5cb0177b8d6a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E8=B5=B5=E6=AF=85?= <1335909236@qq.com>
Date: Wed, 27 Aug 2025 18:00:04 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=9B=A2=E8=B4=AD=E9=83=A8?=
=?UTF-8?q?=E5=88=86=E7=9A=84bug?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
api/shop.js | 2 +-
packages/health/express/express.vue | 667 ------------------
packages/health/index/index.vue | 611 ----------------
packages/health/reportDesc/reportDesc.vue | 203 ------
packages/health/reportList/reportList.vue | 159 -----
packages/health/selfTest/selfTest.vue | 204 ------
packages/shop/groupPurchase/index.css | 4 +-
packages/shop/groupPurchase/index.vue | 19 +-
packages/shop/groupPurchaseDetail/index.css | 21 +-
packages/shop/groupPurchaseDetail/index.vue | 212 ++++--
packages/shop/groupPurchaseSubmit/index.vue | 51 +-
packages/shop/shopCar/index.css | 4 +-
packages/shop/shopCar/index.vue | 93 ++-
packages/shopEnter/index/index.vue | 157 +++--
pages.json | 83 ++-
pages/user/index.vue | 645 +++++++++--------
uni_modules/car-number-input/changelog.md | 9 +
.../car-number-input/car-number-input.vue | 315 +++++++++
uni_modules/car-number-input/package.json | 26 +
19 files changed, 1119 insertions(+), 2366 deletions(-)
delete mode 100644 packages/health/express/express.vue
delete mode 100644 packages/health/index/index.vue
delete mode 100644 packages/health/reportDesc/reportDesc.vue
delete mode 100644 packages/health/reportList/reportList.vue
delete mode 100644 packages/health/selfTest/selfTest.vue
create mode 100644 uni_modules/car-number-input/changelog.md
create mode 100644 uni_modules/car-number-input/components/car-number-input/car-number-input.vue
create mode 100644 uni_modules/car-number-input/package.json
diff --git a/api/shop.js b/api/shop.js
index 5d4a97c9..e39a092d 100644
--- a/api/shop.js
+++ b/api/shop.js
@@ -17,5 +17,5 @@ export const apiArr = {
queryOrder: '/api/v2/wechat/commodity/order/trade_query', // 查询订单
getComment: '/api/v2/wechat/commodity/review/list', // 获取评论
- mergePreorder: '/api/v2/wechat/commodity/order/merge_preorder', // 商品订单合并预下单
+ mergePreorder: '/api/v2/wechat/commodity/order/preorder', // 商品订单合并预下单
}
\ No newline at end of file
diff --git a/packages/health/express/express.vue b/packages/health/express/express.vue
deleted file mode 100644
index 757a5ef5..00000000
--- a/packages/health/express/express.vue
+++ /dev/null
@@ -1,667 +0,0 @@
-
-
-
-
-
- 基础
信息
-
-
-
-
-
- 病历
信息
-
-
-
-
-
- 生活
方式
-
-
-
-
-
- 授权
用户
-
-
-
-
-
- 姓名
-
-
-
-
-
-
- 电话
-
-
-
-
-
-
- 性别
-
-
- 男
-
-
-
- 女
-
-
-
-
-
- 出生日期
-
-
-
-
-
-
- 身高
-
-
-
-
-
-
- 体重
-
-
-
-
-
- 下一步
-
-
-
-
-
- 血值类型
-
-
-
-
-
-
- 糖尿病类型
-
-
-
-
-
-
- 血压类型
-
-
-
-
-
-
- 既往病史
-
- 胸闷
-
- 心慌
-
- 头晕
-
- 痛风
-
-
- 脑血管疾病
-
- 急性并发症
-
- 心脏疾病
- 其他
-
-
-
-
-
-
- 既往用药
-
- 他汀类降脂药
-
- 中药降脂
-
- 中药降酸药
-
- 其他
-
-
-
-
-
- 用药时间
-
-
- 3年
-
-
- 一年以内
-
-
-
-
- 下一步
-
-
-
-
-
-
-
-
- 吸烟情况
-
-
- 从不
-
-
- 已戒烟
-
-
- 吸烟
-
-
-
-
-
-
- 饮酒情况
-
-
- 从不
-
-
- 偶尔
-
-
- 经常
-
-
- 戒酒
-
-
-
-
-
-
- 日常工作
-
-
- 轻体力劳动
-
-
- 中体力劳动
-
-
- 重体力劳动
-
-
- 休息
-
-
-
-
-
-
- 运动情况
-
-
- ≤2次
-
-
- 3-5次
-
-
- 每天
-
-
- 无运动
-
-
-
-
-
-
- 睡眠情况
-
-
- 规律
-
-
- 熬夜
-
-
- 黑白颠倒
-
-
- 其他
-
-
-
-
-
- 下一步
-
-
-
-
-
-
-
- 档案授权
-
-
- 对所有人员开放
-
-
- 对家庭成员开放
-
-
- 对服务人员开放
-
-
- 只允许自己查看
-
-
-
-
-
- 提交
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/packages/health/index/index.vue b/packages/health/index/index.vue
deleted file mode 100644
index fd576ae4..00000000
--- a/packages/health/index/index.vue
+++ /dev/null
@@ -1,611 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{item.name}}
-
-
-
-
-
-
-
-
- 热门服务
-
-
-
-
- {{service.name}}
- {{service.value}}
-
-
-
-
-
-
-
-
-
-
- 服务列表
- 商户列表
-
-
-
-
-
- {{item.cate_name}}
-
- 更多
-
-
-
-
-
-
-
-
- {{items.title}}
-
- ¥
- {{items.price}}
- /{{items.unit}}
-
-
-
-
-
-
-
-
-
-
-
-
-
- 永训医疗
- 衡阳市石鼓区中山北路1号
- 中国领先的高科技医疗设备研...
- 健康 卫生 先进
-
-
-
- 电话询价
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/packages/health/reportDesc/reportDesc.vue b/packages/health/reportDesc/reportDesc.vue
deleted file mode 100644
index c90b4312..00000000
--- a/packages/health/reportDesc/reportDesc.vue
+++ /dev/null
@@ -1,203 +0,0 @@
-
-
- 血脂
-
- 总胆固醇
-
- 较低
- 正常
- 较高
-
-
-
- 高密度脂
-
- 较低
- 正常
- 较高
-
-
-
- 甘油三脂
-
- 较低
- 正常
- 较高
-
-
-
- 低密度脂
-
- 较低
- 正常
- 较高
-
-
-
- 冠心病指数
-
- 较低
- 正常
- 较高
-
-
-
- 动脉硬化
-
- 较低
- 正常
- 较高
-
-
-
- 常规项目
-
- 体重
-
- 较低
- 正常
- 较高
-
-
-
- 心率
-
- 较低
- 正常
- 较高
-
-
-
- 体温
-
- 较低
- 正常
- 较高
-
-
-
- 尿酸
-
- 尿酸
-
- 较低
- 正常
- 较高
-
-
-
- 血压
-
- 收缩压
-
- 较低
- 正常
- 较高
-
-
-
- 舒张压
-
- 较低
- 正常
- 较高
-
-
-
- 脉搏
-
- 较低
- 正常
- 较高
-
-
-
- 眼科
-
- 左眼视力
-
- 较低
- 正常
- 较高
-
-
-
- 右眼视力
-
- 较低
- 正常
- 较高
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/packages/health/reportList/reportList.vue b/packages/health/reportList/reportList.vue
deleted file mode 100644
index 91c07691..00000000
--- a/packages/health/reportList/reportList.vue
+++ /dev/null
@@ -1,159 +0,0 @@
-
-
-
-
-
-
-
-
-
- {{item.title}}检查报告
- 检测方式:
- 自测
-
-
-
-
- 查看
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/packages/health/selfTest/selfTest.vue b/packages/health/selfTest/selfTest.vue
deleted file mode 100644
index 1d4edc9b..00000000
--- a/packages/health/selfTest/selfTest.vue
+++ /dev/null
@@ -1,204 +0,0 @@
-
-
- 血脂
-
- 总胆固醇
-
- mg/dL
-
-
-
- 高密度脂
-
- mmol/L
-
-
-
- 甘油三脂
-
- mg/L
-
-
-
- 低密度脂
-
- mmol/dL
-
-
-
- 冠心病指数
-
-
-
-
-
- 动脉硬化
-
-
-
-
-
- 常规项目
-
- 体重
-
- Kg
-
-
-
- 心率
-
- 次/分
-
-
-
- 体温
-
- ℃
-
-
-
- 尿酸
-
- 尿酸
-
- μmol/L
-
-
-
- 血压
-
- 收缩压
-
- Kg
-
-
-
- 舒张压
-
- 次/分
-
-
-
- 脉搏
-
- 次/分
-
-
-
- 眼科
-
- 左眼视力
-
-
-
-
-
- 右眼视力
-
-
-
-
-
- 提交
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/packages/shop/groupPurchase/index.css b/packages/shop/groupPurchase/index.css
index adca133c..e9f2bf7e 100644
--- a/packages/shop/groupPurchase/index.css
+++ b/packages/shop/groupPurchase/index.css
@@ -53,6 +53,8 @@
padding: 30rpx 20rpx;
margin-top: -50rpx;
border-radius: 50rpx 50rpx 0 0;
+ height: 60vh;
+ overflow-y: auto;
}
.goods-item {
@@ -204,7 +206,7 @@
height: 140rpx;
position: fixed;
right: 33rpx;
- bottom: 180rpx;
+ bottom: 80rpx;
z-index: 10;
}
diff --git a/packages/shop/groupPurchase/index.vue b/packages/shop/groupPurchase/index.vue
index 2527f10b..733b3b42 100644
--- a/packages/shop/groupPurchase/index.vue
+++ b/packages/shop/groupPurchase/index.vue
@@ -219,8 +219,21 @@ export default {
if (this.goodsList[goodsIndex].group_buy_goods_list[skuIndex].quantity == 0) {
this.goodsList[goodsIndex].group_buy_goods_list[skuIndex].quantity += this.goodsList[goodsIndex].group_buy_goods_list[skuIndex].min_order_quantity
this.carNum += this.goodsList[goodsIndex].group_buy_goods_list[skuIndex].min_order_quantity
-
} else {
+ if (this.goodsList[goodsIndex].group_buy_goods_list[skuIndex].quantity == this.goodsList[goodsIndex].group_buy_goods_list[skuIndex].total_stock) {
+ uni.showToast({
+ title: '库存不足',
+ icon: 'none'
+ });
+ return
+ }
+ if (this.goodsList[goodsIndex].group_buy_goods_list[skuIndex].quantity == this.goodsList[goodsIndex].group_buy_goods_list[skuIndex].max_limit_quantity) {
+ uni.showToast({
+ title: '一次最多购买' + this.goodsList[goodsIndex].group_buy_goods_list[skuIndex].max_limit_quantity + '件',
+ icon: 'none'
+ });
+ return
+ }
this.goodsList[goodsIndex].group_buy_goods_list[skuIndex].quantity++;
this.carNum++;
}
@@ -238,10 +251,10 @@ export default {
// 减少货品数量
decreaseQuantity(goodsIndex, skuIndex) {
if (this.goodsList[goodsIndex].group_buy_goods_list[skuIndex].quantity > 0) {
- if(this.goodsList[goodsIndex].group_buy_goods_list[skuIndex].quantity == this.goodsList[goodsIndex].group_buy_goods_list[skuIndex].min_order_quantity){
+ if (this.goodsList[goodsIndex].group_buy_goods_list[skuIndex].quantity == this.goodsList[goodsIndex].group_buy_goods_list[skuIndex].min_order_quantity) {
this.goodsList[goodsIndex].group_buy_goods_list[skuIndex].quantity = 0
this.carNum = 0
- }else{
+ } else {
this.goodsList[goodsIndex].group_buy_goods_list[skuIndex].quantity--;
this.carNum--;
}
diff --git a/packages/shop/groupPurchaseDetail/index.css b/packages/shop/groupPurchaseDetail/index.css
index cb633889..d1388ecc 100644
--- a/packages/shop/groupPurchaseDetail/index.css
+++ b/packages/shop/groupPurchaseDetail/index.css
@@ -333,6 +333,14 @@ image {
padding-bottom: 10rpx;
}
+.num{
+ color: #808080;
+ font-size: 24rpx;
+ position: absolute;
+ right: 30rpx;
+ font-weight: 400;
+}
+
.oldMoney {
font-size: 40rpx;
color: #C7C7C7;
@@ -565,7 +573,7 @@ image {
}
.shadowBox1 {
- height: 250rpx;
+ height: 300rpx;
width: 100%;
background-color: #fff;
position: absolute;
@@ -584,6 +592,17 @@ image {
color: #000000;
}
+.shadowBox1Item_btn {
+ width: 100%;
+ height: 100%;
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ justify-content: center;
+ border: none;
+ background-color: #ffffff;
+}
+
.shadowBox1Item image {
width: 100rpx;
height: 100rpx;
diff --git a/packages/shop/groupPurchaseDetail/index.vue b/packages/shop/groupPurchaseDetail/index.vue
index b3ac1fb0..78da38c5 100644
--- a/packages/shop/groupPurchaseDetail/index.vue
+++ b/packages/shop/groupPurchaseDetail/index.vue
@@ -49,19 +49,6 @@
{{ endTheCountdownSecond }}
-
-
@@ -70,6 +57,7 @@
¥
{{ currentGG.group_buy_price }}
/{{ currentGG.goods_unit }}
+ 已售{{ soldOutNum }} | 剩余{{ currentGG.total_stock }}
@@ -197,14 +185,18 @@
-
- 微信好友
+
-
- 生成海报
+
@@ -345,30 +337,8 @@ export default {
carOrderList: [],
// 新增评论数据
showReviewPopup: false,
- // comments: [
- // {
- // avatar: "https://wechat-img-file.oss-cn-beijing.aliyuncs.com/test.png",
- // username: "TP",
- // product: "库尔勒香梨 10kg/箱",
- // content:
- // "踏入这家位于街角的餐厅,木质门框与暖黄灯光交织出温馨氛围,墙面上手绘的食材插画画透着文艺气息,开放式厨房的设计让食客能看见厨师处理食材的全过程,第一印象便给人以干净与安心。",
- // images: ["https://wechat-img-file.oss-cn-beijing.aliyuncs.com/test.png"],
- // time: "2025-03-01 11:24:20",
- // },
- // {
- // avatar: "https://wechat-img-file.oss-cn-beijing.aliyuncs.com/test.png",
- // username: "TP",
- // product: "库尔勒香梨 10kg/箱",
- // content:
- // "踏入这家位于街角的餐厅,木质门框与暖黄灯光交织出温馨氛围,墙面上手绘的食材插_draw着文艺气息,开放式厨房的设计让食客能看见厨师处理食材的全过程,第一印象便给人以干净与安心。",
- // images: [
- // "https://wechat-img-file.oss-cn-beijing.aliyuncs.com/test.png",
- // "https://wechat-img-file.oss-cn-beijing.aliyuncs.com/test.png",
- // "https://wechat-img-file.oss-cn-beijing.aliyuncs.com/test.png",
- // ],
- // time: "2025-03-01 11:24:20",
- // },
- // ],
+ soldOutNum: 0,
+
show: false,
showSize: false,
showPurchase: false,
@@ -419,31 +389,139 @@ export default {
delta: 1,
});
},
- // 分享微信
+ // 分享给微信好友方法 - 触发分享给好友的聊天框
shareFriend() {
- this.boxshadow2 = false;
- return;
- // uniapp 分享微信好友
- uni.share({
- provider: "weixin",
- type: "link",
- scene: "session",
- link: "https://uniapp.dcloud.net.cn/",
- title: "商品名称",
- imageUrl: "",
- success: (res) => {
- uni.showToast({
- title: "分享成功",
- icon: "success",
- duration: 2000,
+ this.boxshadow1 = false; // 关闭分享弹窗
+
+ // 获取当前商品的分享信息
+ const shareInfo = {
+ title: this.currentGG.goods_name || '商品分享', // 分享标题
+ desc: this.currentGG.commodity_brief || '快来看看这款商品吧', // 分享描述
+ link: `${window.location.origin}/pages/goodsDetail/index?id=${this.id}`, // 商品详情页链接
+ imageUrl: this.picUrl + (this.currentGG.goods_carousel && this.currentGG.goods_carousel[0] || '') // 分享图片
+ };
+
+ // 判断环境是否支持微信分享
+ if (typeof WeixinJSBridge === 'undefined') {
+ // 尝试使用uni的分享API作为备选方案
+ if (typeof uni.share !== 'undefined') {
+ uni.share({
+ provider: 'weixin',
+ scene: 'WXSceneSession',
+ type: 0,
+ title: shareInfo.title,
+ summary: shareInfo.desc,
+ href: shareInfo.link,
+ imageUrl: shareInfo.imageUrl,
+ success: () => {
+ uni.showToast({
+ title: '分享成功',
+ icon: 'success',
+ duration: 2000
+ });
+ },
+ fail: (err) => {
+ console.error('分享失败', err);
+ uni.showToast({
+ title: '分享失败,请重试',
+ icon: 'none',
+ duration: 2000
+ });
+ }
});
- this.boxshadow1 = false;
- },
- fail: (err) => {
- console.log("分享失败", err);
- this.boxshadow1 = false;
- },
- });
+ } else {
+ uni.showToast({
+ title: '请在微信客户端打开',
+ icon: 'none'
+ });
+ }
+ return;
+ }
+
+ try {
+ // 主动触发微信分享给好友聊天框
+ WeixinJSBridge.invoke('sendAppMessage', {
+ title: shareInfo.title,
+ desc: shareInfo.desc,
+ link: shareInfo.link,
+ img_url: shareInfo.imageUrl,
+ img_width: '120',
+ img_height: '120',
+ type: 'link',
+ data_url: ''
+ }, (res) => {
+ if (res.err_msg === 'sendAppMessage:ok') {
+ uni.showToast({
+ title: '分享成功',
+ icon: 'success',
+ duration: 2000
+ });
+ } else if (res.err_msg === 'sendAppMessage:cancel') {
+ uni.showToast({
+ title: '已取消分享',
+ icon: 'none',
+ duration: 2000
+ });
+ } else {
+ console.error('分享失败', res);
+ uni.showToast({
+ title: '分享失败,请重试',
+ icon: 'none',
+ duration: 2000
+ });
+ }
+ });
+ } catch (error) {
+ console.error('调用微信分享接口失败', error);
+ // 降级处理:使用wx.ready方式作为备选
+ if (typeof wx !== 'undefined') {
+ wx.ready(() => {
+ // 设置分享给微信好友的回调
+ wx.onMenuShareAppMessage({
+ title: shareInfo.title,
+ desc: shareInfo.desc,
+ link: shareInfo.link,
+ imgUrl: shareInfo.imageUrl,
+ type: 'link',
+ success: () => {
+ uni.showToast({
+ title: '分享成功',
+ icon: 'success',
+ duration: 2000
+ });
+ },
+ cancel: () => {
+ uni.showToast({
+ title: '已取消分享',
+ icon: 'none',
+ duration: 2000
+ });
+ },
+ fail: (err) => {
+ console.error('分享失败', err);
+ uni.showToast({
+ title: '分享失败,请重试',
+ icon: 'none',
+ duration: 2000
+ });
+ }
+ });
+ // 提示用户点击右上角分享
+ uni.showToast({
+ title: '请点击右上角分享按钮',
+ icon: 'none'
+ });
+ });
+
+ wx.error((err) => {
+ console.error('微信JS-SDK初始化失败', err);
+ uni.showToast({
+ title: '分享功能加载失败',
+ icon: 'none'
+ });
+ });
+ }
+ }
},
changeShadow() {
this.boxshadow1 = false;
@@ -689,6 +767,8 @@ export default {
})
this.purchaseRecords = record
this.totalCount = res.total_count
+ // 计算所有item.count的总和并赋值给soldOutNum
+ this.soldOutNum = record.reduce((total, item) => total + (item.count || 0), 0)
})
},
formatDate(dateStr) {
diff --git a/packages/shop/groupPurchaseSubmit/index.vue b/packages/shop/groupPurchaseSubmit/index.vue
index 24d78299..24ffd787 100644
--- a/packages/shop/groupPurchaseSubmit/index.vue
+++ b/packages/shop/groupPurchaseSubmit/index.vue
@@ -43,7 +43,7 @@
¥{{ item.commodity_goods_info.sales_price }}/{{
item.commodity_goods_info.goods_unit
- }}
+ }}
运费 ¥{{
item.commodity_goods_info.freight }}
@@ -365,30 +365,39 @@ export default {
},
decreaseQuantity(item) {
if (item.count > 0) {
- item.count--
+ if (item.count == item.commodity_goods_info.min_order_quantity) {
+ uni.showToast({
+ title: '最少购买' + item.commodity_goods_info.min_order_quantity + '件',
+ icon: 'none'
+ });
+ item.count = 0
+ } else {
+ item.count--
+ }
this.changeCart(item)
}
},
increaseQuantity(item) {
- if (item.commodity_goods_info.total_stock > 0) {
- if (item.count < item.commodity_goods_info.total_stock) {
- item.count++;
- this.changeCart(item);
- } else {
+ if (item.count == 0) {
+ item.count += item.commodity_goods_info.min_order_quantity
+ } else {
+ if (item.count == item.commodity_goods_info.total_stock) {
uni.showToast({
title: '库存不足',
icon: 'none'
});
+ return
+ }
+ if (item.count == item.commodity_goods_info.max_limit_quantity) {
+ uni.showToast({
+ title: '一次最多购买' + item.commodity_goods_info.max_limit_quantity + '件',
+ icon: 'none'
+ });
+ return
}
- } else if (item.count < item.commodity_goods_info.stock_quantity) {
- item.count++;
- this.changeCart(item);
- } else {
- uni.showToast({
- title: '库存不足',
- icon: 'none'
- });
}
+ item.count++;
+ this.changeCart(item);
},
// 更改购物车
changeCart(item) {
@@ -469,32 +478,34 @@ export default {
request(apiArr.createOrder, "POST", params).then(res => {
+ console.log("🚀 ~ submitPayment ~ 创建订单接口...")
// 根据平台设置不同的trans_type值
// 小程序: 71, App: 51
const systemInfo = uni.getSystemInfoSync();
let trans_type = 51; // 默认App环境
-
+
// 运行时判断是否为小程序环境
if (systemInfo.platform === 'devtools' || systemInfo.platform === 'unknown') {
trans_type = 71; // 开发工具或未知环境默认为小程序
}
-
+
// 条件编译:针对不同平台设置不同值
// #ifdef MP
trans_type = 71; // 所有小程序平台
// #endif
-
+
// #ifdef APP-PLUS
trans_type = 51; // App平台
// #endif
-
+
const param = {
order_id: res.order_id,
user_id: uni.getStorageSync('userId'),
trans_type: trans_type
}
request(apiArr.mergePreorder, "POST", param).then(res => {
-
+ console.log("🚀 ~ submitPayment ~ 调起微信支付...")
+
if (res && res.timeStamp && res.nonceStr && res.package && res.signType && res.paySign) {
// 调用微信支付
uni.requestPayment({
diff --git a/packages/shop/shopCar/index.css b/packages/shop/shopCar/index.css
index 952bf76c..604fe834 100644
--- a/packages/shop/shopCar/index.css
+++ b/packages/shop/shopCar/index.css
@@ -62,8 +62,8 @@
}
.empty image {
- width: 340rpx;
- height: 253.51rpx;
+ width: 500rpx;
+ height: 500rpx;
}
.empty div {
diff --git a/packages/shop/shopCar/index.vue b/packages/shop/shopCar/index.vue
index 0ac93af3..0b8d0dcb 100644
--- a/packages/shop/shopCar/index.vue
+++ b/packages/shop/shopCar/index.vue
@@ -11,8 +11,10 @@
-
-
+
+
+
+
@@ -75,7 +77,8 @@
-
+
-
+
-
-
-
- 啥也没有
- 赶紧去shopping吧~
-
-
+
@@ -488,38 +486,65 @@ export default {
},
// 减少数量
- minus(carItem, goodsIndex) {
+ minus(carItem, goodsIndex, item) {
let that = this;
- const item = carItem.commodity_cart_and_goods_model;
- if (carItem.count === 1) {
- request(apiArr.deleteCar, "POST", {
- ids: [item.id],
- }).then((res) => {
- carItem.commodity_cart_and_goods_model.splice(goodsIndex, 1);
- // 如果商家没有商品了,移除该商家
- if (carItem.commodity_cart_and_goods_model.length === 0) {
- const carIndex = this.shopCarList.indexOf(carItem);
- if (carIndex !== -1) {
- this.shopCarList.splice(carIndex, 1);
+ if (carItem.count > 0) {
+ if (carItem.count == carItem.commodity_goods_info.min_order_quantity) {
+ uni.showToast({
+ title: '最少购买' + carItem.commodity_goods_info.min_order_quantity + '件',
+ icon: 'none'
+ });
+ request(apiArr.deleteCar, "POST", {
+ ids: [carItem.id],
+ }).then((res) => {
+ item.splice(goodsIndex, 1);
+ // 如果商家没有商品了,移除该商家
+ if (item.length === 0) {
+ const carIndex = this.shopCarList.indexOf(carItem);
+ if (carIndex == -1) {
+ this.shopCarList.splice(carIndex, 1);
+ }
}
- }
- that.calcTotal();
- that.shopCarTotal = that.shopCarTotal - 1;
- });
- } else {
- this.shopCarTotal = this.shopCarTotal - 1;
- carItem.count = carItem.count - 1;
- this.handleQuantityChange(carItem.count, carItem);
+ that.calcTotal();
+ that.shopCarTotal = that.shopCarTotal - 1;
+ });
+ carItem.count = 0
+ that.shopCarTotal = that.shopCarTotal - carItem.commodity_goods_info.min_order_quantity;
+ } else {
+ this.shopCarTotal = this.shopCarTotal - 1;
+ carItem.count = carItem.count - 1;
+ this.handleQuantityChange(carItem.count, carItem);
+ }
this.calcTotal();
}
},
// 添加数量
add(carItem, goodsIndex) {
+ if (carItem.count == 0) {
+ carItem.count = carItem.commodity_goods_info.min_order_quantity
+ this.shopCarTotal += carItem.commodity_goods_info.min_order_quantity;
+ } else {
+ if (carItem.count == carItem.commodity_goods_info.total_stock) {
+ uni.showToast({
+ title: '库存不足',
+ icon: 'none'
+ });
+ return
+ }
+ if (carItem.count == carItem.commodity_goods_info.max_limit_quantity) {
+ uni.showToast({
+ title: '一次最多购买' + carItem.commodity_goods_info.max_limit_quantity + '件',
+ icon: 'none'
+ });
+ return
+ }
+ carItem.count++;
+ this.shopCarTotal++;
+ }
+
const item = carItem.commodity_cart_and_goods_model;
- this.shopCarTotal = this.shopCarTotal + 1;
- carItem.count = carItem.count + 1;
this.handleQuantityChange(carItem.count, carItem);
this.calcTotal();
},
@@ -585,7 +610,6 @@ export default {
},
//商品数量变化
handleQuantityChange(val, item) {
-
const params = {
user_id: uni.getStorageSync("userId"),
goods_id_and_count: [{
@@ -599,6 +623,7 @@ export default {
title: "操作成功!",
success() { },
});
+ return Promise.resolve();
});
},
},
diff --git a/packages/shopEnter/index/index.vue b/packages/shopEnter/index/index.vue
index 30f01d0c..2a54f9bc 100644
--- a/packages/shopEnter/index/index.vue
+++ b/packages/shopEnter/index/index.vue
@@ -1,90 +1,108 @@
-
-
-
-
门店名称
-
+
+
+
+ 门店名称
+
-
-
-
-
所在省
-
+
+
+
+ 所在省
+
-
-
-
-
所在市
-
+
+
+
+ 所在市
+
-
-
-
-
所在区
-
+
+
+
+ 所在区
+
-
-
-
-
详细地址
-
+
+
+
+ 详细地址
+
-
-
-
-
联系人
-
+
+
+
+ 联系人
+
-
-
-
-
手机号
-
+
+
+
+ 手机号
+
-
-
-
+
+
+
+ 银行卡号
+
+
+
+
+
-
-
-
门脸照
-
+
+
+ 门脸照
+
-
+
上传图片
-
+
-
-
+
+
-
-
店内环境
-
+
+ 店内环境
+
-
+
上传图片
-
+
+
+
-
-
-
+
+ 营业执照
+
+
+
+
+ 上传图片
+
+
+
+
+
-
立即入驻
+
立即入驻
-
+
\ No newline at end of file
diff --git a/uni_modules/car-number-input/changelog.md b/uni_modules/car-number-input/changelog.md
new file mode 100644
index 00000000..15131ca3
--- /dev/null
+++ b/uni_modules/car-number-input/changelog.md
@@ -0,0 +1,9 @@
+## 1.0.4(2022-10-13)
+修复支付宝小程序图标显示问题
+## 1.0.3(2022-10-08)
+修复图标显示问题,图片改用base64编码
+## 1.0.2(2022-09-21)
+修复微信小程序新能源图标显示问题
+## 1.0.1(2022-09-19)
+1.修复输入返回值赋值给默认值的问题
+2.修复新能源字体在谷歌浏览器展示问题
diff --git a/uni_modules/car-number-input/components/car-number-input/car-number-input.vue b/uni_modules/car-number-input/components/car-number-input/car-number-input.vue
new file mode 100644
index 00000000..342d56a2
--- /dev/null
+++ b/uni_modules/car-number-input/components/car-number-input/car-number-input.vue
@@ -0,0 +1,315 @@
+
+
+
+
+
+
+
+ {{item}}
+
+
+
+
+
+ 关闭
+
+
+
+
+
+
+
+ 关闭
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/uni_modules/car-number-input/package.json b/uni_modules/car-number-input/package.json
new file mode 100644
index 00000000..d1745803
--- /dev/null
+++ b/uni_modules/car-number-input/package.json
@@ -0,0 +1,26 @@
+{
+ "id": "car-number-input",
+ "displayName": "车牌选择组件+键盘(包含新能源车牌)",
+ "version": "1.0.4",
+ "description": "车牌输入组件+键盘,包含新能源车牌",
+ "keywords": [
+ "车牌",
+ "车牌选择器",
+ "键盘",
+ "车牌键盘",
+ "车牌选择"
+ ],
+ "dcloudext": {
+ "contact": {
+ "qq": ""
+ },
+ "declaration": {
+ "ads": "无",
+ "data": "无",
+ "permissions": "无"
+ },
+ "npmurl": "",
+ "type": "component-vue"
+ },
+ "repository": ""
+}
\ No newline at end of file