From 1344a239c83e535921fb1ce6b1ba1bbd17bb1a07 Mon Sep 17 00:00:00 2001
From: luo <17530855@qq.com>
Date: Sat, 16 Dec 2023 14:04:50 +0800
Subject: [PATCH] 优化
---
components/add_purchase/add_purchase.js | 18 ++++++++++++++++++
packageB/pages/zuhegou/index/index.wxml | 2 +-
pages/goods/goodsList/goodsList.js | 27 +++++++++++++++++++++++++--
pages/goods/goodsList/goodsList.json | 5 +++--
pages/goods/goodsList/goodsList.wxml | 508 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
pages/goods/goodsList/goodsList.wxss | 21 ++++++++++++++++++---
6 files changed, 327 insertions(+), 254 deletions(-)
diff --git a/components/add_purchase/add_purchase.js b/components/add_purchase/add_purchase.js
index 62a26ef..8f9f8b2 100644
--- a/components/add_purchase/add_purchase.js
+++ b/components/add_purchase/add_purchase.js
@@ -120,6 +120,7 @@ Component({
all_pick_list: null, //所有的门店先记录起来
fir_def_store: null, //客户默认的门店的
keyword: '', //门店搜索
+ is_no_new: 1,
},
/**
@@ -3771,6 +3772,7 @@ Component({
},
//-- 选择规格下一步 --
sele_spec_next(that, item, gid, nor) {
+ let th = this;
if (!item.whsle_id && ([1, 2, 4, 6].indexOf(item.prom_type) == -1 || this.data.is_normal == 1))
that.check_is_youhui(gid, that.data.is_normal, 1);
@@ -5162,6 +5164,22 @@ Component({
ob[txt] = this.data.iurl + "/miniapp/images/default_g_img.gif";
this.setData(ob);
},
+ async getUserBuyPromNum(prom_id,is_zh) {
+ var userInfo = getApp().globalData.userInfo;
+ var url = `/api/weshop/ordergoods/getUserBuyPromNum?store_id=${os.stoid}&user_id=${userInfo.user_id}&prom_type=7&prom_id=${prom_id}`;
+ let res = await getApp().request.promiseGet(url, {
+ data: {}
+ });
+ let userbuynum = 0
+ if (res.data.code == 0 && res.data.data) {
+ userbuynum = res.data.data.userbuynum
+ }
+ this.setData({
+ userbuynum
+ })
+ if(is_zh) this.data.user_zh_buy_num=userbuynum;
+ // return userbuynum
+ },
}
diff --git a/packageB/pages/zuhegou/index/index.wxml b/packageB/pages/zuhegou/index/index.wxml
index 209fc57..c8fa98e 100644
--- a/packageB/pages/zuhegou/index/index.wxml
+++ b/packageB/pages/zuhegou/index/index.wxml
@@ -61,7 +61,7 @@
-
+
diff --git a/pages/goods/goodsList/goodsList.js b/pages/goods/goodsList/goodsList.js
index d75dec2..206976b 100644
--- a/pages/goods/goodsList/goodsList.js
+++ b/pages/goods/goodsList/goodsList.js
@@ -6,7 +6,7 @@
var regeneratorRuntime = require('../../../utils/runtime.js');
var com_fil= require('../com_screen.js');
-Page({
+Page({
data: {
url: e.globalData.setting.imghost,
resourceUrl: e.globalData.setting.resourceUrl,
@@ -44,6 +44,7 @@ Page({
limit_num:0,
gr_fir:0, //分组第一次
share_imgurl:'', //分享图片
+ add_purchase:false,
},
onLoad: function(t) {
@@ -601,7 +602,29 @@ Page({
open_more(e){ com_fil.open_more(e,this); },
clear_fil(){ //清空
this.data.gr_fir=0;com_fil.clear_fil(this);
- }
+ },
+ // 加购方法show
+ addPurchase(even){
+ this.setData({
+ add_purchase:true
+ })
+ let gid = even.currentTarget.dataset.gid
+ let prom_id = even.currentTarget.dataset.prom_id
+ let prom_type = even.currentTarget.dataset.prom_type
+ let goods_type= even.currentTarget.dataset.goods_type
+ let add_purchase = this.selectComponent("#add_purchase");
+ if (add_purchase) {
+ add_purchase.init(gid,prom_type,prom_id,goods_type)
+ }
+ },
+ // 加购方法 hide
+ hide_add_purchase(){
+ setTimeout(()=>{
+ this.setData({
+ add_purchase:false
+ })
+ },1000)
+ }
});
\ No newline at end of file
diff --git a/pages/goods/goodsList/goodsList.json b/pages/goods/goodsList/goodsList.json
index 67f1f66..bb0f81f 100644
--- a/pages/goods/goodsList/goodsList.json
+++ b/pages/goods/goodsList/goodsList.json
@@ -2,6 +2,7 @@
"backgroundTextStyle": "dark",
"navigationBarTitleText": "商品列表",
"usingComponents": {
- "share_box": "/components/share_box/share_box"
+ "share_box": "/components/share_box/share_box",
+ "add_purchase": "/components/add_purchase/add_purchase"
}
-}
\ No newline at end of file
+}
\ No newline at end of file
diff --git a/pages/goods/goodsList/goodsList.wxml b/pages/goods/goodsList/goodsList.wxml
index 554ab5a..dfece13 100644
--- a/pages/goods/goodsList/goodsList.wxml
+++ b/pages/goods/goodsList/goodsList.wxml
@@ -1,86 +1,87 @@
+
- 每人限参与{{limit_num}}次;
-
-
- 满{{item.condition}}元 件
- 减{{item.content.money}}元
- 包邮
- 打{{item.content.sale}}折
- 送{{item.content.int}}积分
- 送{{item.content.coupon_money}}元优惠券
- 送{{item.content.zp_mode==1?'多赠品':item.content.gift_name}}
- 送{{item.content.lb_name}}
- 送{{item.content.zxlb_name}}
- 送{{item.content.monthgift_name}}
-
-
-
-
- 阶梯促销:{{jieti_prom}}
+ 每人限参与{{limit_num}}次;
+
+
+ 满{{item.condition}}元 件
+ 减{{item.content.money}}元
+ 包邮
+ 打{{item.content.sale}}折
+ 送{{item.content.int}}积分
+ 送{{item.content.coupon_money}}元优惠券
+ 送{{item.content.zp_mode==1?'多赠品':item.content.gift_name}}
+ 送{{item.content.lb_name}}
+ 送{{item.content.zxlb_name}}
+ 送{{item.content.monthgift_name}}
+
+
+
+
+ 阶梯促销:{{jieti_prom}}
-
-
-
- 请输入商品关键字
-
-
-
-
-
-
-
-
-
-
-
- 新品
- 评论
- 综合
-
-
-
-
-
-
- 销量
-
-
-
-
-
-
-
-
-
-
-
- 价格
-
-
-
-
-
-
-
-
-
-
- 筛选
-
-
-
-
-
+
+ 请输入商品关键字
+
+
+
+
+
+
+
+
+
+
+
+ 新品
+ 评论
+ 综合
+
+
+
+
+
+
+ 销量
+
+
+
+
+
+
+
+
+
+
+
+ 价格
+
+
+
+
+
+
+
+
+
+
+ 筛选
+
+
+
+
+
-
-
-
-
+
+
+
+
@@ -89,24 +90,142 @@
{{item.goods_name}}
-
-
-
- {{item.prom_integral}}积分
- +
- {{item.prom_price}}
-
- {{item.market_price}}
-
-
-
+
+
+
+ {{item.prom_integral}}积分
+ +
+ {{item.prom_price}}
+
+ {{item.market_price}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{item[card_field]}}
+
+
+ {{card_name}}
+
+
+
+
+
+ {{item.shop_price}}
+
+
+
+
+
+
+ {{item.shop_price}}
+ {{item.market_price}}
+
+
+
+
+
+ {{item.shop_price}}
+ {{item.market_price}}
+
+
+
+
+
+
+
+
+ {{item.shop_price}}
+ {{item.market_price}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{item.goods_name}}
+
+
+
+
+
+ {{item.prom_integral}}积分
+ +
+ {{item.prom_price}}
+
+ {{item.market_price}}
+
+
+
+
@@ -125,19 +244,19 @@
{{item.shop_price}}
@@ -156,176 +275,73 @@
- 评论{{item.comment_count}}
- 已售{{item.sales_sum}}
-
+ 评论{{item.comment_count}}
+ 已售{{item.sales_sum}}
+
-
- {{item.shop_price}}
- {{item.market_price}}
-
+
+ {{item.shop_price}}
+ {{item.market_price}}
+
-
- {{item.shop_price}}
- {{item.market_price}}
-
-
+
+ {{item.shop_price}}
+ {{item.market_price}}
+
+
+
+
+
-
-
-
-
-
-
-
-
-
- {{item.goods_name}}
-
-
-
-
-
- {{item.prom_integral}}积分
- +
- {{item.prom_price}}
-
- {{item.market_price}}
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{item[card_field]}}
-
-
- {{card_name}}
-
-
-
-
-
- {{item.shop_price}}
-
-
-
-
-
-
- {{item.shop_price}}
- {{item.market_price}}
-
-
-
-
-
- {{item.shop_price}}
- {{item.market_price}}
-
-
-
-
-
-
-
-
- {{item.shop_price}}
- {{item.market_price}}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 暂无相关商品
- 回到首页
-
+
+
+
+
+
+
+ 暂无相关商品
+ 回到首页
+
+
+
-
-
- {{err_txt}}
- 回到首页
-
-
\ No newline at end of file
+
+
+ {{err_txt}}
+ 回到首页
+
+
+
+
+
+
+
+
+
+
diff --git a/pages/goods/goodsList/goodsList.wxss b/pages/goods/goodsList/goodsList.wxss
index b0752a8..797d93f 100644
--- a/pages/goods/goodsList/goodsList.wxss
+++ b/pages/goods/goodsList/goodsList.wxss
@@ -48,7 +48,7 @@ page {
top: 0;
/* width: 95%; */
background-color: #f0f0f0;
- z-index: 999;
+ z-index: 11;
}
.nav-box {
@@ -56,7 +56,7 @@ page {
top: 114rpx;
/* width: 95%; */
background-color: #f0f0f0;
- z-index: 999;
+ z-index: 11;
}
.ico-dir {
@@ -294,5 +294,20 @@ page {
color: white;
padding: 20rpx 50rpx;
}
-
+.gicon{
+ position: absolute;
+ right: 20rpx;
+ top: 0;
+ bottom: 0;
+ display: flex;
+ align-items: center;
+}
+.gicon2{
+ position: absolute;
+ right: 20rpx;
+ top: 0;
+ bottom: 0;
+ display: flex;
+ align-items: center;
+}
@import '../com_screen.wxss';
\ No newline at end of file
--
libgit2 0.21.4