Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
7
7-Eleven
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
高淑倩
7-Eleven
Commits
0f157558
Commit
0f157558
authored
Apr 11, 2020
by
谢中龙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改加入购物车初始价格和库存
parent
773ae075
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
28 additions
and
51 deletions
+28
-51
personCenter.js
src/component/personCenter/personCenter.js
+0
-3
skuPopup.js
src/component/skuPopup/skuPopup.js
+22
-46
skuPopup.wxml
src/component/skuPopup/skuPopup.wxml
+2
-1
skuPopup.wxss
src/component/skuPopup/skuPopup.wxss
+3
-1
productDetail.wxml
src/pages/productDetail/productDetail.wxml
+1
-0
No files found.
src/component/personCenter/personCenter.js
View file @
0f157558
...
...
@@ -93,7 +93,6 @@ Component({
wxService
.
get
(
`/merchant/brandSwitchSetting/getOpenStatus?businessType=2`
).
then
(
res
=>
{
const
{
result
,
data
}
=
res
.
data
if
(
result
==
0
)
{
console
.
log
(
data
)
if
(
data
){
this
.
getLevelList
();
}
...
...
@@ -110,7 +109,6 @@ Component({
//获取等级列表
getLevelList
(){
wxService
.
post
(
'/merchant/settingLevel/get'
).
then
(
res
=>
{
console
.
log
(
res
)
if
(
res
){
let
levelList
=
res
.
data
.
data
?
res
.
data
.
data
:
[];
if
(
levelList
.
length
==
0
){
...
...
@@ -119,7 +117,6 @@ Component({
})
}
else
{
console
.
log
(
this
.
data
)
let
index
=
this
.
data
.
baseUserInfo
.
member
.
level
?
this
.
data
.
baseUserInfo
.
member
.
level
:
0
;
let
filterLevel
=
levelList
.
filter
(
item
=>
item
.
index
==
index
);
if
(
filterLevel
.
length
>
0
){
...
...
src/component/skuPopup/skuPopup.js
View file @
0f157558
...
...
@@ -93,21 +93,14 @@ Component({
productStock
:{
type
:
Number
,
value
:
0
},
productPrice
:{
type
:
Number
,
value
:
0
}
},
attached
()
{
// let price = this.data.showPrice
// if (!price) {
// if (this.data.curSku.promotion_price) {
// price = this._setExchangePrice(this.data.curSku.promotion_price)
// }
// }
// console.log(this.data)
// this.setData({
// price
// })
},
/**
...
...
@@ -117,7 +110,7 @@ Component({
curSpec
:
[],
// 当前选中的规格值
curSku
:
{},
// 当前选中的sku信息
// price: 0, // 页面上展示的价格
skuText
:
''
,
skuText
:
[]
,
skuStock
:
0
,
skuId
:
''
,
btnText
:
'确定'
,
// 确定 缺货 缺货订阅
...
...
@@ -133,33 +126,26 @@ Component({
this
.
_skuInfosChange
=
null
},
//监听函数
observers
:{
productStock
(
val
){
this
.
data
.
skuStock
=
val
;
this
.
setData
({
skuStock
:
this
.
data
.
skuStock
});
},
productPrice
(
val
){
this
.
data
.
salePrice
=
val
;
this
.
setData
({
salePrice
:
this
.
data
.
salePrice
});
}
},
/**
* 组件的方法列表
*/
methods
:
{
// _skuInfosChange () {
// var curSpec = []
// if (this.data.initSku) {
// console.log(this.data.initSku)
// curSpec = this.data.initSku.spec.split('###')
// }
// this.setData({
// curSpec: curSpec, // 当前选中的规格值
// curSku: {}, // 当前选中的sku信息
// skuText: '',
// skuStock: 0,
// salePrice:0
// })
// this._setCurSku()
// },
// _showPriceChange (newV, oldV) {
// if (newV !== oldV) {
// this.setData({
// showPrice: newV,
// price: newV
// })
// }
// },
confirm
()
{
if
(
this
.
data
.
curSpec
.
length
<
1
){
wx
.
showToast
({
...
...
@@ -203,7 +189,7 @@ Component({
this
.
setData
({
curSpec
:
[],
// 当前选中的规格值
curSku
:
{},
// 当前选中的sku信息
skuStock
:
0
,
skuStock
:
this
.
data
.
productStock
,
});
// this.triggerEvent('skuselect', {
// selectSku: this.data.curSku,
...
...
@@ -308,16 +294,6 @@ Component({
}
},
// _setExchangePrice (price) {
// let exprice = price
// if (this.data.exchangePrice > 0) {
// let exchangePrice = this.data.exchangePrice// 积分数
// let bwtPrice = ((exchangePrice * this.data.integralRole - price) / 100)// 差额
// exprice = bwtPrice < 0 ? ((exchangePrice) + '积分+¥' + Math.abs(bwtPrice)) : (exchangePrice + '积分')
// }
// return exprice
// },
_setCurSku
:
function
()
{
// 显示选中的sku信息
if
(
!
this
.
data
.
skuInfos
)
{
return
false
...
...
src/component/skuPopup/skuPopup.wxml
View file @
0f157558
...
...
@@ -25,7 +25,8 @@
<view class="price-text">¥{{utils.numberFormat(salePrice /100)}}</view>
<view class="stock-text">库存:{{skuStock}}</view>
<view class="sku-text">规格:
<block wx:for="{{skuText}}" wx:key="*this">{{item}} </block>
<block wx:if="{{skuText.length == 0}}">请选择规格</block>
<block wx:esle wx:for="{{skuText}}" wx:key="*this">{{item}} </block>
</view>
</view>
</view>
...
...
src/component/skuPopup/skuPopup.wxss
View file @
0f157558
...
...
@@ -107,8 +107,10 @@
padding: 0 39rpx;
display: inline-block;
border-radius: 10rpx;
background-color: rgba(238, 238, 238, 1);
/* background-color: rgba(238, 238, 238, 1); */
background: #ffffff;
margin: 25rpx 23rpx 25rpx 0;
border: solid 1rpx #dddddd;
}
.mid-info .sku-info .spec-value.disabled {
...
...
src/pages/productDetail/productDetail.wxml
View file @
0f157558
...
...
@@ -190,6 +190,7 @@
good-type="{{productInfo.productType}}"
index-img="{{productInfo.indexUrl}}"
sku-infos="{{productInfo.productSku}}"
product-price="{{productInfo.plusPrice ? productInfo.plusPrice : productInfo.minSalePrice}}"
show="{{showSkuPopup}}"
bind:skuselect="confirmClick"
btn-text="{{btnText}}"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment