Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
纵之格
shopxo-uniapp
提交
1cc83bc4
S
shopxo-uniapp
项目概览
纵之格
/
shopxo-uniapp
通知
102
Star
3
Fork
4
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
S
shopxo-uniapp
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
1cc83bc4
编写于
4月 13, 2024
作者:
G
gongfuxiang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
批发,批量下单优化
上级
8612cffa
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
301 addition
and
167 deletion
+301
-167
App.vue
App.vue
+2
-4
components/goods-batch-buy/goods-batch-buy.vue
components/goods-batch-buy/goods-batch-buy.vue
+83
-34
components/goods-buy/goods-buy.vue
components/goods-buy/goods-buy.vue
+11
-0
components/wholesale-rules/wholesale-rules.vue
components/wholesale-rules/wholesale-rules.vue
+160
-0
lang/en.json
lang/en.json
+2
-1
lang/zh.json
lang/zh.json
+2
-1
pages/goods-detail/goods-detail.css
pages/goods-detail/goods-detail.css
+0
-48
pages/goods-detail/goods-detail.vue
pages/goods-detail/goods-detail.vue
+38
-76
pages/index/index.vue
pages/index/index.vue
+3
-3
未找到文件。
App.vue
浏览文件 @
1cc83bc4
...
...
@@ -7,12 +7,10 @@
data
:
{
// 基础配置
// 数据接口请求地址
request_url
:
'
https://new.shopxo.vip/
'
,
// request_url: 'https://new.shopxo.vip/',
request_url
:
'
http://shopxo.com/
'
,
// 静态资源地址(如系统根目录不在public目录下面请在静态地址后面加public目录、如:https://d1.shopxo.vip/public/)
static_url
:
'
https://new.shopxo.vip/
'
,
// static_url: 'https://new.shopxo.vip/',
static_url
:
'
http://shopxo.com/
'
,
// 系统类型(默认default、如额外独立小程序、可与程序分身插件实现不同主体小程序及支付独立)
system_type
:
'
default
'
,
...
...
components/goods-batch-buy/goods-batch-buy.vue
浏览文件 @
1cc83bc4
...
...
@@ -7,15 +7,20 @@
<iconfont
name=
"icon-close-o"
size=
"28rpx"
color=
"#999"
></iconfont>
</view>
</view>
<view
class=
"plugins-batchbuy-container oh"
>
<block
v-if=
"(goods || null) != null && (batchbuy_data || null) != null && (batchbuy_data.goods_spec_data || null) != null && batchbuy_data.goods_spec_data.length > 0"
>
<view
class=
"plugins-batchbuy-container"
>
<!-- 批发规则 -->
<view
v-if=
"(plugins_wholesale_data || null) != null"
class=
"padding-main br-b-f5"
>
<component-wholesale-rules
:propCurrencySymbol=
"propCurrencySymbol"
:propData=
"plugins_wholesale_data"
></component-wholesale-rules>
</view>
<!-- 下单规格选择 -->
<view
v-if=
"(goods || null) != null && (batchbuy_data || null) != null && (batchbuy_data.goods_spec_data || null) != null && batchbuy_data.goods_spec_data.length > 0"
:class=
"'spec-data-content oh '+((plugins_wholesale_data || null) != null ? 'wholesale' : '')"
>
<block
v-if=
"batchbuy_data.is_only_level_one == 0"
>
<view
class=
"left-nav
pa bg-base
"
>
<view
class=
"left-nav
ht-auto bg-base fl
"
>
<scroll-view
:scroll-y=
"true"
class=
"ht-auto"
>
<block
v-for=
"(item, index) in batchbuy_data.goods_spec_data"
:key=
"index"
>
<view
:class=
"'padding-
top-xxl padding-bottom-xxl
tc cp oh pr ' + (nav_active_index == index ? 'bg-white cr-main' : '')"
:data-index=
"index"
@
tap=
"nav_event"
>
<image
v-if=
"(item.images || null) != null"
class=
"dis-inline-block
va-m radius margin-right
spec-images"
:src=
"item.images"
mode=
"widthFix"
></image>
<
text
class=
"text-size-xs cr-base va-m"
>
{{
item
.
name
}}
</text
>
<view
:class=
"'padding-
vertical-main
tc cp oh pr ' + (nav_active_index == index ? 'bg-white cr-main' : '')"
:data-index=
"index"
@
tap=
"nav_event"
>
<image
v-if=
"(item.images || null) != null"
class=
"dis-inline-block
br-f5 radius dis-block
spec-images"
:src=
"item.images"
mode=
"widthFix"
></image>
<
view
class=
"cr-base"
>
{{
item
.
name
}}
</view
>
<view
v-if=
"(item.badge_total || 0) > 0"
class=
"badge-icon pa"
>
<component-badge
:propNumber=
"item.badge_total"
></component-badge>
</view>
...
...
@@ -23,15 +28,16 @@
</block>
</scroll-view>
</view>
<view
class=
"right-conent ht-auto
fr padding-main bs-bb
"
>
<view
class=
"right-conent ht-auto
bs-bb fr
"
>
<scroll-view
:scroll-y=
"true"
class=
"ht-auto"
>
<block
v-for=
"(item, index) in batchbuy_data.goods_spec_data[nav_active_index]['data']"
:key=
"index"
>
<view
:class=
"'oh padding-vertical-main ' + (index > 0 ? 'br-t' : '')
"
>
<view
class=
"padding-main oh
"
>
<view
class=
"fl item-left"
>
<view
class=
"text-size-xs"
>
{{
item
.
name
}}
</view>
<view
class=
"sales-price text-size-xs"
>
{{
currency_s
ymbol
}}{{
item
.
base
.
price
}}
</view>
<view
class=
"sales-price text-size-xs"
>
{{
propCurrencyS
ymbol
}}{{
item
.
base
.
price
}}
</view>
</view>
<view
class=
"tc oh round fr item-right text-size-xs"
>
<text
v-if=
"(item.base.inventory || 0) == 0"
class=
"fr text-size-xs cr-grey"
>
{{
$t
(
'
goods-batch-buy.goods-batch-buy.dsfd98
'
)
}}
</text>
<view
v-else
class=
"tc oh round fr item-right text-size-xs"
>
<view
@
tap=
"batchbuy_goods_buy_number_event"
class=
"number-submit tc cr-grey fl va-m"
data-type=
"0"
:data-index=
"index"
>
-
</view>
<input
@
blur=
"batchbuy_goods_buy_number_blur"
class=
"tc cr-grey bg-white fl va-m radius-0"
type=
"number"
:value=
"item.buy_number || 0"
:data-index=
"index"
/>
<view
@
tap=
"batchbuy_goods_buy_number_event"
class=
"number-submit tc cr-grey fl va-m"
data-type=
"1"
:data-index=
"index"
>
+
</view>
...
...
@@ -45,15 +51,16 @@
<view
class=
"right-conent ht-auto padding-main bs-bb right-conent-only-level-one"
>
<scroll-view
:scroll-y=
"true"
class=
"ht-auto"
>
<block
v-for=
"(item, index) in batchbuy_data.goods_spec_data"
:key=
"index"
>
<view
:class=
"'oh padding-vertical-main ' + (index > 0 ? 'br-t' : '')
"
>
<view
class=
"oh padding-vertical-main
"
>
<view
class=
"fl item-left"
>
<view>
<image
v-if=
"(item.images || null) != null"
class=
"dis-inline-block va-m
radius margin-right
spec-images"
:src=
"item.images"
mode=
"widthFix"
></image>
<image
v-if=
"(item.images || null) != null"
class=
"dis-inline-block va-m
br-f5 radius margin-right-sm
spec-images"
:src=
"item.images"
mode=
"widthFix"
></image>
<text
class=
"text-size-xs va-m"
>
{{
item
.
name
}}
</text>
</view>
<view
class=
"sales-price text-size-xs
"
>
{{
currency_s
ymbol
}}{{
item
.
base
.
price
}}
</view>
<view
class=
"sales-price text-size-xs
margin-top-xs"
>
{{
propCurrencyS
ymbol
}}{{
item
.
base
.
price
}}
</view>
</view>
<view
class=
"tc oh round fr item-right text-size-xs margin-top-xs"
>
<text
v-if=
"(item.base.inventory || 0) == 0"
class=
"fr text-size-xs cr-grey"
>
{{
$t
(
'
goods-batch-buy.goods-batch-buy.dsfd98
'
)
}}
</text>
<view
v-else
:class=
"'tc oh round fr item-right text-size-xs margin-top'+((item.images || null) == null ? 'xs' : '')"
>
<view
@
tap=
"batchbuy_goods_buy_number_event"
class=
"number-submit tc cr-grey fl va-m"
data-type=
"0"
:data-index=
"index"
>
-
</view>
<input
@
blur=
"batchbuy_goods_buy_number_blur"
class=
"tc cr-grey bg-white fl va-m radius-0"
type=
"number"
:value=
"item.buy_number || 0"
:data-index=
"index"
/>
<view
@
tap=
"batchbuy_goods_buy_number_event"
class=
"number-submit tc cr-grey fl va-m"
data-type=
"1"
:data-index=
"index"
>
+
</view>
...
...
@@ -63,7 +70,7 @@
</scroll-view>
</view>
</block>
<view
class=
"confirm-submit pa wh-auto bottom-line-exclude bg-white padding-top-main"
>
<view
class=
"confirm-submit pa wh-auto bottom-line-exclude bg-white padding-top-main
br-t-f5
"
>
<view
class=
"oh padding-horizontal-main padding-bottom-main cr-grey"
>
<text
class=
"text-size-xs"
>
<text>
{{
$t
(
'
buy.buy.g2vt78
'
)
}}
</text>
...
...
@@ -72,7 +79,7 @@
<text
class=
"cr-red padding-left-xs padding-right-xs"
>
{{
base_data
.
quantity
}}
</text>
<text>
{{
goods
.
inventory_unit
}}
</text>
</text>
<text
class=
"text-size-xs fr"
>
{{
$t
(
'
goods-batch-buy.goods-batch-buy.geq82x
'
)
}}
<text
class=
"fw-b sales-price"
>
{{
currency_s
ymbol
}}{{
base_data
.
amount_money
}}
</text></text>
<text
class=
"text-size-xs fr"
>
{{
$t
(
'
goods-batch-buy.goods-batch-buy.geq82x
'
)
}}
<text
class=
"fw-b sales-price"
>
{{
propCurrencyS
ymbol
}}{{
base_data
.
amount_money
}}
</text></text>
</view>
<view
v-if=
"(opt_button || null) != null && opt_button.length > 0"
class=
"padding-bottom-main"
>
<view
:class=
"'oh buy-nav-btn-number-' + (opt_button.length || 0)"
>
...
...
@@ -84,7 +91,7 @@
</view>
</view>
</view>
</
block
>
</
view
>
<block
v-else
>
<view
class=
"cr-grey tc padding-top-xl padding-bottom-xxxl"
>
{{
$t
(
'
goods-batch-buy.goods-batch-buy.ypby1k
'
)
}}
</view>
</block>
...
...
@@ -95,14 +102,14 @@
</
template
>
<
script
>
const
app
=
getApp
();
import
base64
from
"
../..
/common/js/lib/base64.js
"
;
import
base64
from
"
@
/common/js/lib/base64.js
"
;
import
componentPopup
from
"
@/components/popup/popup
"
;
import
componentBadge
from
"
../../components/badge/badge
"
;
import
componentBadge
from
"
@/components/badge/badge
"
;
import
componentWholesaleRules
from
'
@/components/wholesale-rules/wholesale-rules
'
;
export
default
{
data
()
{
return
{
theme_view
:
app
.
globalData
.
get_theme_value_view
(),
currency_symbol
:
app
.
globalData
.
currency_symbol
(),
popup_status
:
false
,
nav_active_index
:
0
,
goods
:
null
,
...
...
@@ -114,25 +121,48 @@ export default {
quantity
:
0
,
amount_money
:
"
0.00
"
,
},
// 批发数据
plugins_wholesale_data
:
null
,
};
},
components
:
{
componentPopup
,
componentBadge
,
componentWholesaleRules
},
props
:
{
// 价格符号
propCurrencySymbol
:
{
type
:
String
,
default
:
app
.
globalData
.
currency_symbol
(),
},
// 批发数据
propPluginsWholesaleData
:
{
type
:
[
Array
,
Object
],
default
:
null
,
}
},
created
:
function
()
{},
// 页面被展示
created
:
function
()
{
this
.
setData
({
plugins_wholesale_data
:
this
.
propPluginsWholesaleData
,
});
console
.
log
(
this
.
plugins_wholesale_data
)
},
methods
:
{
// 初始化
init
(
goods
=
null
,
batchbuy_data
=
null
,
buy_button
=
null
,
back_data
=
null
)
{
init
(
params
=
{}
)
{
if
(
!
app
.
globalData
.
is_single_page_check
())
{
return
false
;
}
// 购买按钮处理,仅展示购买和购物车
var
opt_button
=
[];
var
buy_button
=
params
.
buy_button
||
null
;
if
(
buy_button
!=
null
&&
(
buy_button
.
data
||
null
)
!=
null
&&
buy_button
.
data
.
length
>
0
)
{
var
arr
=
[
'
plugins-batchbuy-button-cart
'
,
'
plugins-batchbuy-button-buy
'
];
for
(
var
i
in
buy_button
.
data
)
{
...
...
@@ -145,10 +175,11 @@ export default {
// 设置数据
this
.
setData
({
popup_status
:
true
,
goods
:
goods
||
null
,
batchbuy_data
:
batchbuy_data
||
null
,
opt_button
:
opt_button
,
back_data
:
back_data
,
goods
:
params
.
goods
||
null
,
batchbuy_data
:
params
.
batchbuy_data
||
null
,
back_data
:
params
.
back_data
||
null
,
plugins_wholesale_data
:
params
.
plugins_wholesale_data
||
null
});
},
...
...
@@ -299,8 +330,14 @@ export default {
dataType
:
"
json
"
,
success
:
(
res
)
=>
{
if
(
res
.
data
.
code
==
0
)
{
var
plugins_wholesale_data
=
null
;
res
.
data
.
data
.
forEach
((
item
)
=>
{
if
(
item
.
code
==
0
)
{
// 批发数据
if
((
item
.
data
.
plugins_wholesale_data
||
null
)
!=
null
&&
temp_spec_data
.
base_id
==
item
.
data
.
spec_base
.
id
)
{
plugins_wholesale_data
=
item
.
data
.
plugins_wholesale_data
;
}
// 规格数据处理
for
(
var
i1
in
temp_data
.
goods_spec_data
)
{
if
(
parseInt
(
temp_data
.
is_only_level_one
||
0
)
==
1
)
{
if
(
temp_data
.
goods_spec_data
[
i1
].
base
.
id
==
item
.
data
.
spec_base
.
id
)
{
...
...
@@ -322,6 +359,15 @@ export default {
});
this
.
setData
({
batchbuy_data
:
temp_data
,
plugins_wholesale_data
:
plugins_wholesale_data
,
});
// 调用父级
this
.
$emit
(
"
BatchStockSuccessEvent
"
,
{
current_spec
:
temp_spec_data
,
goods_data
:
goods_data
,
back_data
:
res
.
data
.
data
,
plugins_wholesale_data
:
plugins_wholesale_data
,
});
}
else
{
app
.
globalData
.
showToast
(
res
.
data
.
msg
);
...
...
@@ -431,25 +477,28 @@ export default {
</
script
>
<
style
>
.plugins-batchbuy-container
{
height
:
6
0vh
;
height
:
7
0vh
;
padding-bottom
:
160
rpx
;
}
.plugins-batchbuy-container
.spec-data-content
{
height
:
calc
(
100%
-
15
rpx
);
}
.plugins-batchbuy-container
.spec-data-content.wholesale
{
height
:
calc
(
100%
-
160
rpx
);
}
.plugins-batchbuy-container
.left-nav
{
width
:
200
rpx
;
top
:
0
;
left
:
0
;
height
:
calc
(
100%
-
160
rpx
);
}
.plugins-batchbuy-container
.left-nav
.badge-icon
{
top
:
8
rpx
;
right
:
36
rpx
;
}
.plugins-batchbuy-container
.left-nav
.spec-images
{
width
:
5
0
rpx
;
height
:
5
0
rpx
!important
;
width
:
10
0
rpx
;
height
:
10
0
rpx
!important
;
}
.plugins-batchbuy-container
.right-conent
{
width
:
calc
(
100%
-
2
0
0
rpx
);
width
:
calc
(
100%
-
2
1
0
rpx
);
}
.plugins-batchbuy-container
.right-conent
.item-left
{
width
:
calc
(
100%
-
290
rpx
);
...
...
@@ -475,8 +524,8 @@ export default {
width
:
100%
;
}
.plugins-batchbuy-container
.right-conent-only-level-one
.spec-images
{
width
:
34
rpx
;
height
:
34
rpx
!important
;
width
:
100
rpx
;
height
:
100
rpx
!important
;
}
.plugins-batchbuy-container
.confirm-submit
{
left
:
0
;
...
...
components/goods-buy/goods-buy.vue
浏览文件 @
1cc83bc4
...
...
@@ -567,6 +567,17 @@
goods_spec_base_buy_max_number
:
spec_buy_max_number
,
buy_number
:
buy_number
,
});
// 调用父级
this
.
$emit
(
"
BackSuccessEvent
"
,
{
buy_number
:
this
.
buy_number
,
base_price
:
this
.
goods_spec_base_price
,
base_original_price
:
this
.
goods_spec_base_original_price
,
base_inventory
:
this
.
goods_spec_base_inventory
,
base_buy_min_number
:
this
.
goods_spec_base_buy_min_number
,
base_buy_max_number
:
this
.
goods_spec_base_buy_max_number
,
back_data
:
data
});
},
// 已选的商品规格
...
...
components/wholesale-rules/wholesale-rules.vue
0 → 100644
浏览文件 @
1cc83bc4
<
template
>
<view
:class=
"theme_view"
>
<!-- 批发规则展示 -->
<view
v-if=
"(data || null) != null"
class=
"scroll-view-horizontal"
>
<scroll-view
scroll-x=
"true"
>
<view
class=
"plugins-wholesale-container-rules-view wh-auto"
@
tap=
"popup_wholesale_event"
>
<view
v-for=
"(item, index) in data.rules"
:key=
"index"
class=
"item"
>
<view
class=
"price"
>
<text
v-if=
"item.arr.type == 1"
class=
"cr-red text-size-xs"
>
{{
propCurrencySymbol
}}
</text>
<text
class=
"sales-price text-size-lg"
>
{{
item
.
range_val
}}
</text>
<text
v-if=
"item.arr.type == 0"
class=
"unit text-size-xsss"
>
{{
item
.
arr
.
unit
}}
</text>
</view>
<view
class=
"msg cr-black text-size-sm cr-base margin-top-xs"
>
{{
item
.
range_msg
}}
</view>
</view>
</view>
</scroll-view>
</view>
<!-- 批发规则弹层 -->
<block
v-if=
"propIsPopup"
>
<component-popup
:propShow=
"popup_status"
propPosition=
"bottom"
@
onclose=
"popup_wholesale_close_event"
>
<view
class=
"padding-horizontal-main padding-top-main bg-white"
>
<view
class=
"close oh"
>
<view
class=
"fr"
@
tap.stop=
"popup_wholesale_close_event"
>
<iconfont
name=
"icon-close-o"
size=
"28rpx"
color=
"#999"
></iconfont>
</view>
</view>
<view
class=
"plugins-wholesale-container-rules"
>
<block
v-if=
"(data || null) != null"
>
<view
class=
"oh flex-row flex-warp"
>
<block
v-for=
"(item, index) in data.rules"
:key=
"index"
>
<view
class=
"item flex-width-half margin-bottom"
>
<view
class=
"item-content padding-main bg-base border-radius-main oh tc"
>
<text
class=
"cr-base"
>
{{
item
.
range_msg
}}
</text>
<text
v-if=
"item.arr.type == 1"
class=
"cr-main text-size-xs"
>
{{
propCurrencySymbol
}}
</text>
<text
class=
"cr-main fw-b text-size-lg"
>
{{
item
.
range_val
}}
</text>
<text
v-if=
"item.arr.type == 0"
class=
"cr-grey text-size-xsss"
>
{{
item
.
arr
.
unit
}}
</text>
</view>
</view>
</block>
</view>
</block>
<block
v-else
>
<view
class=
"cr-grey tc padding-top-xl padding-bottom-xxxl"
>
{{
$t
(
'
goods-detail.goods-detail.m3op38
'
)
}}
</view>
</block>
</view>
</view>
</component-popup>
</block>
</view>
</
template
>
<
script
>
const
app
=
getApp
();
import
componentPopup
from
"
@/components/popup/popup
"
;
export
default
{
data
()
{
return
{
theme_view
:
app
.
globalData
.
get_theme_value_view
(),
data
:
null
,
popup_status
:
false
,
};
},
components
:
{
componentPopup
},
props
:
{
// 是否展示弹窗
propIsPopup
:
{
type
:
Boolean
,
default
:
false
,
},
// 价格符号
propCurrencySymbol
:
{
type
:
String
,
default
:
app
.
globalData
.
currency_symbol
(),
},
// 列表数据
propData
:
{
type
:
[
Array
,
Object
,
String
],
default
:
{},
}
},
// 属性值改变监听
watch
:
{
// 数据
propData
(
value
,
old_value
)
{
this
.
setData
({
data
:
value
,
});
console
.
log
(
value
)
}
},
// 页面被展示
created
:
function
()
{
this
.
setData
({
data
:
this
.
propData
,
});
},
methods
:
{
// 批发开启弹层
popup_wholesale_event
(
e
)
{
if
(
this
.
propIsPopup
)
{
this
.
setData
({
popup_status
:
true
,
});
}
},
// 批发弹层关闭
popup_wholesale_close_event
(
e
)
{
this
.
setData
({
popup_status
:
false
,
});
},
}
}
</
script
>
<
style
>
/**
* 批发 - 插件
*/
.plugins-wholesale-container-rules-view
{
display
:
flex
;
justify-content
:
flex-start
;
gap
:
60
rpx
;
}
.plugins-wholesale-container-rules-view
.item
{
margin-bottom
:
0
!important
;
}
.plugins-wholesale-container-rules-view
.item
.price
>
.unit
{
border
:
0.05rem
solid
#cdcdcd
;
color
:
#969696
;
border-radius
:
50%
;
padding
:
1
rpx
6
rpx
;
vertical-align
:
middle
;
margin-left
:
5
rpx
;
}
.plugins-wholesale-container-rules
{
max-height
:
50vh
;
overflow-y
:
scroll
;
overflow-x
:
hidden
;
margin-top
:
20
rpx
;
}
.plugins-wholesale-container-rules
.item
:nth-child
(
2
n
)>
.item-content
{
margin-left
:
10
rpx
;
}
.plugins-wholesale-container-rules
.item
:nth-child
(
2
n
+
1
)>
.item-content
{
margin-right
:
10
rpx
;
}
.plugins-wholesale-container-rules
.spec-tips
{
color
:
#ffbf00
;
border
:
1px
solid
#333
;
background
:
#333
;
padding
:
2
rpx
10
rpx
;
top
:
22
rpx
;
left
:
20
rpx
;
}
</
style
>
\ No newline at end of file
lang/en.json
浏览文件 @
1cc83bc4
...
...
@@ -1547,7 +1547,8 @@
"9ectyf"
:
"species"
,
"geq82x"
:
"Amount:"
,
"ypby1k"
:
"No relevant information available"
,
"7tp1tc"
:
"Incorrect operation event type"
"7tp1tc"
:
"Incorrect operation event type"
,
"dsfd98"
:
"Out of stock"
}
},
"goods-buy"
:
{
...
...
lang/zh.json
浏览文件 @
1cc83bc4
...
...
@@ -1539,7 +1539,8 @@
"9ectyf"
:
"种"
,
"geq82x"
:
"金额:"
,
"ypby1k"
:
"无相关信息"
,
"7tp1tc"
:
"操作事件类型有误"
"7tp1tc"
:
"操作事件类型有误"
,
"dsfd98"
:
"无库存"
}
},
"goods-buy"
:
{
...
...
pages/goods-detail/goods-detail.css
浏览文件 @
1cc83bc4
...
...
@@ -522,54 +522,6 @@
font-size
:
46
rpx
;
}
/**
* 批发 - 插件
*/
.plugins-wholesale-container-view
{
display
:
flex
;
justify-content
:
space-around
;
}
.plugins-wholesale-container-view
.item
{
margin-bottom
:
0
!important
;
}
.plugins-wholesale-container-view
.item
.price
>
.unit
{
border
:
0.05rem
solid
#cdcdcd
;
color
:
#969696
;
border-radius
:
50%
;
padding
:
1
rpx
6
rpx
;
vertical-align
:
top
;
margin-left
:
5
rpx
;
}
.plugins-wholesale-container-view
.spec-tips
{
color
:
#ffefc0
;
border
:
1
rpx
solid
#ff9800
;
background
:
#FF9800
;
padding
:
0
16
rpx
;
position
:
absolute
;
top
:
0
;
right
:
0
;
}
.plugins-wholesale-container
{
max-height
:
50vh
;
overflow-y
:
scroll
;
overflow-x
:
hidden
;
margin-top
:
20
rpx
;
}
.plugins-wholesale-container
.item
:nth-child
(
2
n
)>
view
{
margin-left
:
10
rpx
;
}
.plugins-wholesale-container
.item
:nth-child
(
2
n
+
1
)>
view
{
margin-right
:
10
rpx
;
}
.plugins-wholesale-container
.spec-tips
{
color
:
#ffbf00
;
border
:
1px
solid
#333
;
background
:
#333
;
padding
:
2
rpx
10
rpx
;
top
:
22
rpx
;
left
:
20
rpx
;
}
/**
* 标签 - 插件
*/
...
...
pages/goods-detail/goods-detail.vue
浏览文件 @
1cc83bc4
...
...
@@ -80,36 +80,34 @@
<!-- 价格信息 -->
<view
class=
"goods-base-price bg-white oh spacing-mb"
:class=
"(plugins_seckill_data || null) != null && plugins_seckill_data.time.status == 1 ? 'goods-base-price-countdown' : ''"
>
<!-- 批发规则、未隐藏商品售价的时候独立行展示 -->
<view
v-if=
"(plugins_wholesale_data || null) != null && (plugins_wholesale_data.is_hide_goods_price || 0) != 1"
class=
"padding-horizontal-main padding-top-main"
>
<component-wholesale-rules
:propIsPopup=
"true"
:propCurrencySymbol=
"currency_symbol"
:propData=
"plugins_wholesale_data"
></component-wholesale-rules>
</view>
<!-- 价格 -->
<view
class=
"price-content padding-vertical-main padding-left-main bs-bb fl"
:style=
"(plugins_seckill_data || null) != null && plugins_seckill_data.time.status == 1 ? 'background-image: url(' + plugins_seckill_data.goods_detail_header + ')' : ''"
>
<!-- 批发 -->
<block
v-if=
"(plugins_wholesale_data || null) != null"
>
<view
class=
"plugins-wholesale-container-view wh-auto item"
@
tap=
"popup_wholesale_event"
>
<view
v-for=
"(item, index) in plugins_wholesale_data.rules"
:key=
"index"
class=
"item"
>
<view
class=
"price"
>
<text
v-if=
"item.arr.type == 1"
class=
"cr-red text-size-xs"
>
{{
currency_symbol
}}
</text>
<text
class=
"sales-price"
>
{{
item
.
range_val
}}
</text>
<text
v-if=
"item.arr.type == 0"
class=
"unit text-size-xsss"
>
{{
item
.
arr
.
unit
}}
</text>
</view>
<view
class=
"msg cr-black text-size-sm cr-grey"
>
{{
item
.
range_msg
}}
</view>
</view>
<!-- 批发规则、隐藏商品售价的时候在这里展示 -->
<view
v-if=
"(plugins_wholesale_data || null) != null && (plugins_wholesale_data.is_hide_goods_price || 0) == 1"
class=
"item"
>
<component-wholesale-rules
:propIsPopup=
"true"
:propCurrencySymbol=
"currency_symbol"
:propData=
"plugins_wholesale_data"
></component-wholesale-rules>
</view>
<!-- 批发插件是否开启隐藏价格信息 -->
<block
v-if=
"(plugins_wholesale_data || null) == null || (plugins_wholesale_data.is_hide_goods_price || 0) != 1"
>
<!-- 售价 -->
<view
v-if=
"(goods.show_field_price_status || 0) == 1"
class=
"item single-text"
>
<!-- 图标 -->
<text
v-if=
"(show_field_price_text || null) != null"
:class=
"'price-icon round va-m margin-right-xs '+(((plugins_seckill_data || null) != null && plugins_seckill_data.time.status == 1) ? 'seckill' : '')"
>
{{
show_field_price_text
}}
</text>
<!-- 售价 -->
<text
class=
"sales-price va-m"
>
{{
goods
.
show_price_symbol
}}{{
goods_spec_base_price
}}
</text>
<text
class=
"text-size-xs cr-grey va-m"
>
{{
goods
.
show_price_unit
}}
</text>
</view>
<!-- 原价 -->
<view
v-if=
"(goods.show_field_original_price_status || 0) == 1 && (goods_spec_base_original_price || null) != null && goods_spec_base_original_price != 0"
class=
"item original-price single-text"
>
{{
goods
.
show_original_price_symbol
}}{{
goods_spec_base_original_price
}}{{
goods
.
show_original_price_unit
}}
</view>
<!-- 积分兑换 -->
<view
v-if=
"(goods.plugins_points_data || null) != null && (goods.plugins_points_data.is_goods_detail_show || 0) == 1"
class=
"item"
>
<text
class=
"text-size-lg cr-base va-m"
>
{{
goods
.
plugins_points_data
.
points_value
}}
</text>
<text
class=
"text-size-xs cr-grey va-m margin-left-xs"
>
{{
goods
.
plugins_points_data
.
points_unit
}}
</text>
</view>
</block>
<!-- 售价 -->
<view
v-if=
"(goods.show_field_price_status || 0) == 1"
class=
"item single-text"
>
<!-- 图标 -->
<text
v-if=
"(show_field_price_text || null) != null"
:class=
"'price-icon round va-m margin-right-xs '+(((plugins_seckill_data || null) != null && plugins_seckill_data.time.status == 1) ? 'seckill' : '')"
>
{{
show_field_price_text
}}
</text>
<!-- 售价 -->
<text
class=
"sales-price va-m"
>
{{
goods
.
show_price_symbol
}}{{
goods_spec_base_price
}}
</text>
<text
class=
"text-size-xs cr-grey va-m"
>
{{
goods
.
show_price_unit
}}
</text>
</view>
<!-- 原价 -->
<view
v-if=
"(goods.show_field_original_price_status || 0) == 1 && (goods_spec_base_original_price || null) != null && goods_spec_base_original_price != 0"
class=
"item original-price single-text"
>
{{
goods
.
show_original_price_symbol
}}{{
goods_spec_base_original_price
}}{{
goods
.
show_original_price_unit
}}
</view>
<!-- 积分兑换 -->
<view
v-if=
"(goods.plugins_points_data || null) != null && (goods.plugins_points_data.is_goods_detail_show || 0) == 1"
class=
"item"
>
<text
class=
"text-size-lg cr-base va-m"
>
{{
goods
.
plugins_points_data
.
points_value
}}
</text>
<text
class=
"text-size-xs cr-grey va-m margin-left-xs"
>
{{
goods
.
plugins_points_data
.
points_unit
}}
</text>
</view>
</view>
<block
v-if=
"(plugins_seckill_data || null) != null && plugins_seckill_data.time.status == 1"
>
<view
class=
"countdown-content padding-top-lg padding-bottom-lg padding-left-xs padding-right-xs fr tc"
>
...
...
@@ -499,36 +497,6 @@
</view>
</component-popup>
<!-- 批发弹层 -->
<component-popup
:propShow=
"popup_wholesale_status"
propPosition=
"bottom"
@
onclose=
"popup_wholesale_close_event"
>
<view
class=
"padding-horizontal-main padding-top-main bg-white"
>
<view
class=
"close oh"
>
<view
class=
"fr"
@
tap.stop=
"popup_wholesale_close_event"
>
<iconfont
name=
"icon-close-o"
size=
"28rpx"
color=
"#999"
></iconfont>
</view>
</view>
<view
class=
"plugins-wholesale-container"
>
<block
v-if=
"(plugins_wholesale_data || null) != null"
>
<text
v-if=
"(plugins_wholesale_data.spec_tips || null) != null"
class=
"spec-tips pa round"
>
{{
plugins_wholesale_data
.
spec_tips
}}
</text>
<view
class=
"oh flex-row flex-warp"
>
<block
v-for=
"(item, index) in plugins_wholesale_data.rules"
:key=
"index"
>
<view
class=
"item flex-width-half margin-bottom"
>
<view
class=
"padding-main bg-base border-radius-main oh tc"
>
<text
class=
"cr-base"
>
{{
item
.
range_msg
}}
</text>
<text
class=
"margin-left-sm cr-main fw-b text-size-lg"
>
{{
item
.
range_val
}}
</text>
<text
class=
"cr-grey margin-left-xs"
>
{{
item
.
arr
.
unit
}}
</text>
</view>
</view>
</block>
</view>
</block>
<block
v-else
>
<view
class=
"cr-grey tc padding-top-xl padding-bottom-xxxl"
>
{{
$t
(
'
goods-detail.goods-detail.m3op38
'
)
}}
</view>
</block>
</view>
</view>
</component-popup>
<!-- 优惠券弹层 -->
<component-popup
:propShow=
"popup_coupon_status"
propPosition=
"bottom"
@
onclose=
"popup_coupon_close_event"
>
<view
class=
"padding-horizontal-main padding-top-main bg-white"
>
...
...
@@ -612,7 +580,7 @@
<component-share-popup
ref=
"share"
></component-share-popup>
<!-- 商品购买 -->
<component-goods-buy
ref=
"goods_buy"
:propParams=
"params"
:propCurrencySymbol=
"currency_symbol"
v-on:CartSuccessEvent=
"goods_cart_back_event"
v-on:SpecChoiceEvent=
"goods_spec_back_event"
></component-goods-buy>
<component-goods-buy
ref=
"goods_buy"
:propParams=
"params"
:propCurrencySymbol=
"currency_symbol"
v-on:
BackSuccessEvent=
"goods_buy_back_success_event"
v-on:
CartSuccessEvent=
"goods_cart_back_event"
v-on:SpecChoiceEvent=
"goods_spec_back_event"
></component-goods-buy>
<!-- 商品批量下单 -->
<component-goods-batch-buy
ref=
"goods_batch_buy"
v-on:BatchCartSuccessEvent=
"batch_goods_cart_back_event"
></component-goods-batch-buy>
...
...
@@ -641,6 +609,7 @@
import
componentCouponCard
from
'
@/components/coupon-card/coupon-card
'
;
import
componentRealstoreCart
from
'
@/components/realstore-cart/realstore-cart
'
;
import
componentGoodsList
from
'
@/components/goods-list/goods-list
'
;
import
componentWholesaleRules
from
'
@/components/wholesale-rules/wholesale-rules
'
;
var
common_static_url
=
app
.
globalData
.
get_static_url
(
'
common
'
);
var
ask_static_url
=
app
.
globalData
.
get_static_url
(
'
ask
'
,
true
)
+
'
app/
'
;
...
...
@@ -751,9 +720,6 @@
plugins_salerecords_tips_ent
:
''
,
// 多商户插件
plugins_shop_data
:
null
,
// 批发插件
plugins_wholesale_data
:
null
,
popup_wholesale_status
:
false
,
// 标签插件
plugins_label_data
:
null
,
// 智能工具插件
...
...
@@ -794,7 +760,8 @@
componentAskCommentsGoods
,
componentCouponCard
,
componentRealstoreCart
,
componentGoodsList
componentGoodsList
,
componentWholesaleRules
},
onLoad
(
params
)
{
...
...
@@ -1179,7 +1146,7 @@
// 商品批量下单-加入购物车
case
'
plugins-batchbuy-button-cart
'
:
if
((
this
.
$refs
.
goods_batch_buy
||
null
)
!=
null
)
{
this
.
$refs
.
goods_batch_buy
.
init
(
this
.
goods
,
this
.
plugins_batchbuy_data
,
this
.
buy_button
);
this
.
$refs
.
goods_batch_buy
.
init
(
{
goods
:
this
.
goods
,
batchbuy_data
:
this
.
plugins_batchbuy_data
,
buy_button
:
this
.
buy_button
,
plugins_wholesale_data
:
this
.
plugins_wholesale_data
}
);
}
break
;
// 默认
...
...
@@ -1188,6 +1155,15 @@
}
},
// 数量和规格详情回调成功
goods_buy_back_success_event
(
e
)
{
if
((
e
.
back_data
.
plugins_wholesale_data
||
null
)
!=
null
)
{
this
.
setData
({
plugins_wholesale_data
:
e
.
back_data
.
plugins_wholesale_data
});
}
},
// 加入购物车成功回调
goods_cart_back_event
(
e
)
{
this
.
goods_spec_back_event
(
e
);
...
...
@@ -1449,20 +1425,6 @@
});
},
// 批发开启弹层
popup_wholesale_event
(
e
)
{
this
.
setData
({
popup_wholesale_status
:
true
,
});
},
// 批发弹层关闭
popup_wholesale_close_event
(
e
)
{
this
.
setData
({
popup_wholesale_status
:
false
,
});
},
// 商品服务开启弹层
popup_goodsservice_event
(
e
)
{
this
.
setData
({
...
...
pages/index/index.vue
浏览文件 @
1cc83bc4
...
...
@@ -488,11 +488,11 @@
// 获取数据
init
(
params
=
{})
{
// 还没有数据则读取缓存
var
cache_key
=
app
.
globalData
.
data
.
cache_index_data_key
;
if
(
this
.
load_status
==
0
)
{
// 本地缓存数据
var
key
=
app
.
globalData
.
data
.
cache_index_data_key
;
var
upd_data
=
uni
.
getStorageSync
(
key
)
||
null
;
var
upd_data
=
uni
.
getStorageSync
(
cache_key
)
||
null
;
if
(
upd_data
!=
null
)
{
// 先使用缓存数据展示
this
.
setData
(
upd_data
);
...
...
@@ -556,7 +556,7 @@
this
.
setData
(
upd_data
);
// 存储缓存
uni
.
setStorageSync
(
key
,
upd_data
);
uni
.
setStorageSync
(
cache_
key
,
upd_data
);
// 弹屏广告插件处理
this
.
plugins_popupscreen_handle
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录