Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
U
user
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
hooloo
mp
user
Commits
8973d4c0
Commit
8973d4c0
authored
Apr 24, 2023
by
songbingqi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复部分bug
parent
55ed3236
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
59 additions
and
37 deletions
+59
-37
menuSubPackage/pages/goodsDetail/goodsDetail.vue
+1
-0
orderSubPackage/pages/settlement/index.vue
+55
-34
pages/menu/menu.vue
+2
-1
utils/utils.js
+1
-2
No files found.
menuSubPackage/pages/goodsDetail/goodsDetail.vue
View file @
8973d4c0
...
...
@@ -372,6 +372,7 @@ export default {
this
.
canUse
=
true
const
{
category
,
...
goods
}
=
this
.
goodInfo
;
goods
.
skus
=
[
sku
];
goods
.
origDiscount
=
sku
.
origDiscount
goods
.
sku
=
sku
;
goods
.
flag
=
true
;
goods
.
skuId
=
selectedSku
;
...
...
orderSubPackage/pages/settlement/index.vue
View file @
8973d4c0
...
...
@@ -62,7 +62,7 @@
<div
class=
"goods_name"
>
<div
class=
"name"
>
{{
item
.
name
}}
</div>
<div
class=
"price"
>
¥
{{
Utils
.
isInteger
(
setPrice
(
item
.
sku
.
discount
))
}}
¥
{{
Utils
.
isInteger
(
setPrice
(
hasCoupon
?
item
.
sku
.
origDiscount
:
item
.
sku
.
discount
))
}}
</div>
</div>
<div
class=
"goods_psce"
>
...
...
@@ -145,7 +145,7 @@
<div
class=
"price"
>
总优惠¥
{{
reduction
}}
</div>
</div>
-->
</div>
<view
v-if=
"userms"
class=
"payment"
@
click=
"messageAndSave"
>
付款
</view>
<view
v-if=
"userms"
class=
"payment"
@
click=
"messageAndSave"
:style=
"
{'background-color':submitLoading?'gray':''}"
>付款
</view>
<button
v-if=
"!userms"
class=
"payment"
...
...
@@ -368,6 +368,7 @@ export default {
sendMsgFlag3
:
false
,
},
optionDecode
:
{},
submitLoading
:
false
};
},
computed
:
{
...
...
@@ -389,45 +390,61 @@ export default {
});
return
totalNum
;
},
reduction
()
{
if
(
JSON
.
stringify
(
this
.
goods
)
==
"{}"
)
return
0
;
let
price
=
0
;
let
discountNum
=
0
;
this
.
goods
.
forEach
((
item
)
=>
{
const
sku
=
item
.
sku
;
if
(
item
.
flag
)
{
discountNum
+=
item
.
num
*
sku
.
discount
;
price
+=
item
.
num
*
sku
.
price
;
}
else
{
discountNum
+=
0
;
price
+=
0
;
}
});
return
(
price
-
discountNum
).
toFixed
(
2
);
},
//
reduction() {
//
if (JSON.stringify(this.goods) == "{}") return 0;
//
let price = 0;
//
let discountNum = 0;
//
this.goods.forEach((item) => {
//
const sku = item.sku;
//
if (item.flag) {
//
discountNum += item.num * sku.discount;
//
price += item.num * sku.price;
//
} else {
//
discountNum += 0;
//
price += 0;
//
}
//
});
//
return (price - discountNum).toFixed(2);
//
},
amountOld
()
{
if
(
JSON
.
stringify
(
this
.
goods
)
==
"{}"
)
return
0
;
let
totalPrice
=
0
;
this
.
goods
.
forEach
((
item
)
=>
{
const
sku
=
item
.
sku
;
item
.
flag
?
(
totalPrice
+=
item
.
num
*
sku
.
discount
)
:
(
totalPrice
+=
0
);
});
if
(
this
.
hasCoupon
)
{
this
.
goods
.
forEach
((
item
)
=>
{
const
sku
=
item
.
sku
;
item
.
flag
?
(
totalPrice
+=
item
.
num
*
sku
.
origDiscount
)
:
(
totalPrice
+=
0
);
});
}
else
{
this
.
goods
.
forEach
((
item
)
=>
{
const
sku
=
item
.
sku
;
item
.
flag
?
(
totalPrice
+=
item
.
num
*
sku
.
discount
)
:
(
totalPrice
+=
0
);
});
}
return
totalPrice
.
toFixed
(
2
);
},
totalPrice
()
{
if
(
JSON
.
stringify
(
this
.
goods
)
==
"{}"
)
return
0
;
let
totalPrice
=
0
;
console
.
log
(
this
.
goods
,
'goods'
)
this
.
goods
.
forEach
((
item
)
=>
{
const
sku
=
item
.
sku
;
item
.
flag
?
(
totalPrice
+=
item
.
num
*
sku
.
discount
)
:
(
totalPrice
+=
0
);
});
totalPrice
-=
this
.
selectCoupon
.
couponAmount
||
0
;
if
(
this
.
hasCoupon
)
{
this
.
goods
.
forEach
((
item
)
=>
{
const
sku
=
item
.
sku
;
item
.
flag
?
(
totalPrice
+=
item
.
num
*
sku
.
origDiscount
)
:
(
totalPrice
+=
0
);
});
totalPrice
-=
this
.
selectCoupon
.
couponAmount
||
0
;
}
else
{
this
.
goods
.
forEach
((
item
)
=>
{
const
sku
=
item
.
sku
;
item
.
flag
?
(
totalPrice
+=
item
.
num
*
sku
.
discount
)
:
(
totalPrice
+=
0
);
});
totalPrice
-=
this
.
selectCoupon
.
couponAmount
||
0
;
}
return
totalPrice
.
toFixed
(
2
);
},
hasCoupon
()
{
const
{
selectCoupon
}
=
this
const
{
couponAmount
}
=
selectCoupon
return
(
couponAmount
!=
null
&&
couponAmount
!=
undefined
)
}
},
methods
:
{
goHome
()
{
...
...
@@ -499,9 +516,9 @@ export default {
});
},
itemReduction
(
discount
,
price
,
num
)
{
return
((
price
-
discount
)
*
num
).
toFixed
(
2
);
},
//
itemReduction(discount, price, num) {
//
return ((price - discount) * num).toFixed(2);
//
},
// 手机号授权登录
getPhoneNumber
(
e
)
{
if
(
e
.
detail
.
errMsg
==
"getPhoneNumber:ok"
)
{
...
...
@@ -532,6 +549,8 @@ export default {
"Fu_CPIXa0cnJ4EDdVKqFQ3qqKJccMqt2oorI5mfNq74"
,
];
const
val
=
{};
if
(
this
.
submitLoading
)
return
this
.
submitLoading
=
true
wx
.
requestSubscribeMessage
({
tmplIds
:
tmpid
,
success
:
(
res
)
=>
{
...
...
@@ -649,8 +668,10 @@ export default {
this
.
buyType
,
this
.
agreeTerms
);
this
.
submitLoading
=
false
this
.
cleanFlag
=
true
;
}
else
{
this
.
submitLoading
=
false
}
}
},
...
...
pages/menu/menu.vue
View file @
8973d4c0
...
...
@@ -191,7 +191,7 @@ export default {
if
(
q
)
{
const
optionDecode
=
Utils
.
getUrlParams2
(
decodeURIComponent
(
q
));
console
.
log
(
Utils
.
getUrlParams2
(
decodeURIComponent
(
q
)),
this
.
userInfo
);
const
{
num
,
serial_no
,
source
}
=
optionDecode
;
const
{
num
,
serial_no
,
source
,
serials
}
=
optionDecode
;
if
(
source
&&
this
.
userms
)
{
const
sendData
=
{
phone
:
this
.
userInfo
.
phoneNumber
,
...
...
@@ -200,6 +200,7 @@ export default {
param
:
JSON
.
stringify
({
serial_no
,
num
,
serials
}),
};
Menu
.
sendUserCoupon
(
sendData
);
...
...
utils/utils.js
View file @
8973d4c0
...
...
@@ -12,6 +12,7 @@ export default {
let
item
=
shopCarInfo
[
i
];
let
res
=
{
origDiscount
:
item
.
origDiscount
,
// sku金额
goodsId
:
item
.
goodsId
,
//商品id
goodsName
:
item
.
name
,
//商品名称
machineId
:
undefined
,
//点单屏机器ID
...
...
@@ -44,7 +45,6 @@ export default {
},
// 加入购物车数据
async
getallNum
(
Obj
,
unCheckCount
)
{
console
.
log
(
Obj
);
let
shopCarInfo
=
uni
.
getStorageSync
(
"shopCarInfo"
)
||
[];
let
size
=
0
;
shopCarInfo
.
forEach
((
item
)
=>
(
size
+=
item
.
num
));
...
...
@@ -72,7 +72,6 @@ export default {
}
else
{
shopCarInfo
=
[
Obj
];
}
console
.
log
(
Obj
);
uni
.
setStorageSync
(
"shopCarInfo"
,
shopCarInfo
);
$EventBus
.
$emit
(
"updateCar"
);
// if (callback) {
...
...
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