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
39db9abf
Commit
39db9abf
authored
Jun 10, 2022
by
weijiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复bug
parent
4bf5da33
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
16 additions
and
21 deletions
+16
-21
components/menuAssembly/index.vue
+1
-1
orderSubPackage/pages/settlement/index.vue
+5
-13
pages/menu/menu.vue
+2
-2
request/user/index.js
+1
-1
utils/utils.js
+7
-4
No files found.
components/menuAssembly/index.vue
View file @
39db9abf
...
...
@@ -10,7 +10,7 @@
<scroll-view
class=
"nav-right"
scroll-y
:scroll-top=
"scrollTop"
@
scroll=
"scroll"
@
touchstart=
"openScroll"
scroll-with-animation
>
<view
v-for=
"category in classifyData"
:id=
"category.id"
:key=
"category.id"
class=
"box"
>
<view
:style=
"loads"
class=
"right-title"
>
{{
category
.
name
}}
</view>
<view
v-if=
"category.goods && category.goods.length>0"
:style=
"loads"
class=
"right-title"
>
{{
category
.
name
}}
</view>
<view
class=
"nav-right-item"
v-for=
"item in category.goods"
:key=
"item.goodsId"
>
<image
src=
"../../static/imgs/isRecommend.png"
v-if=
"item.isRecommend == 1"
class=
"isRecommend"
/>
<image
@
click=
"cart(item, category)"
class=
"thumbnail"
v-if=
"item.pics.thumbnailApplet"
:src=
"item.pics.thumbnailApplet"
/>
...
...
orderSubPackage/pages/settlement/index.vue
View file @
39db9abf
...
...
@@ -74,14 +74,8 @@
<div
class=
"price"
>
总优惠¥
{{
reduction
}}
</div>
</div>
-->
</div>
<view
class=
"payment"
@
click=
"messageAndSave"
v-if=
"userms"
>
付款
</view>
<button
v-if=
"!userms"
class=
"payment"
style=
"border-radius: 0;"
open-type=
"getPhoneNumber"
@
getphonenumber=
"getPhoneNumber"
>
付款
</button>
<view
class=
"payment"
@
click=
"messageAndSave"
v-if=
"userms"
>
付款
</view>
<button
v-if=
"!userms"
class=
"payment"
style=
"border-radius: 0;"
open-type=
"getPhoneNumber"
@
getphonenumber=
"getPhoneNumber"
>
付款
</button>
</div>
</view>
</
template
>
...
...
@@ -102,7 +96,6 @@ export default {
this
.
duration
=
data
.
data
})
}
},
onLoad
(
option
)
{
// 商品详情页点击立即支付进入
...
...
@@ -120,19 +113,19 @@ export default {
this
.
option
=
JSON
.
stringify
(
option
)
const
{
q
}
=
option
;
if
(
q
)
{
User
.
getLocation
((
location
)
=>
{
User
.
getLocation
((
state
,
params
)
=>
{
uni
.
removeStorageSync
(
'shopCarInfo'
);
$EventBus
.
$emit
(
'updateCar'
);
// this.buyType = '1';
let
id
=
decodeURIComponent
(
q
).
split
(
'?'
)[
1
].
split
(
'='
)[
1
];
Menu
.
getScreenShopCar
(
id
,
location
).
then
(
res
=>
{
Menu
.
getScreenShopCar
(
id
,
params
).
then
(
res
=>
{
const
data
=
JSON
.
parse
(
res
.
data
.
data
);
console
.
log
(
data
);
this
.
shopData
=
data
.
shop
;
this
.
buyType
=
data
.
screenNo
;
this
.
goods
=
data
.
goods
.
map
(
item
=>
{
const
data
=
{
...
item
,
skuId
:
item
.
sku
.
skuId
,
flag
:
true
}
Utils
.
getallNum
(
data
)
Utils
.
getallNum
(
data
,
true
)
// 不校验数量
return
data
})
})
...
...
@@ -153,7 +146,6 @@ export default {
this
.
duration
=
data
.
data
})
if
(
!
this
.
userms
){
User
.
wxLoginAndGetOpenid
(
true
).
then
(
loginInfo
=>
{
this
.
loginInfo
=
loginInfo
...
...
pages/menu/menu.vue
View file @
39db9abf
...
...
@@ -7,7 +7,7 @@
<text
@
click=
"showArea"
class=
"shop-name"
>
{{
shopInfo
.
name
}}
</text>
<u-icon
name=
"arrow-right"
class=
"arrow-right-select"
color=
"#FFFFFF"
></u-icon>
</view>
<view
v-if=
"shopInfo.distance"
class=
"distance"
>
距您
{{
shopInfo
.
distance
}}
</view>
<view
v-if=
"shopInfo.distance
&& shopInfo.distance!=-1
"
class=
"distance"
>
距您
{{
shopInfo
.
distance
}}
</view>
</view>
<view
class=
"login-area"
>
<view
class=
"avatar"
>
...
...
@@ -234,7 +234,7 @@ export default {
},
async
getMenuList
(
id
)
{
let
{
data
}
=
await
Menu
.
getMenuList
(
id
);
console
.
log
(
"menus:"
+
JSON
.
stringify
(
data
));
//
console.log("menus:"+JSON.stringify(data));
if
(
data
.
code
==
200
)
{
data
.
data
=
data
.
data
;
this
.
$store
.
commit
(
'setMenuAllInfo'
,
data
.
data
);
...
...
request/user/index.js
View file @
39db9abf
...
...
@@ -30,7 +30,7 @@ export default {
getShopInfo
(
params
)
{
return
uni
.
$u
.
http
.
get
(
'/weixin/getShop'
,
{
params
})
.
then
((
res
)
=>
{
console
.
log
(
"get shop:"
+
JSON
.
stringify
(
res
.
data
.
data
));
//
console.log("get shop:"+JSON.stringify(res.data.data));
if
(
res
.
data
.
code
==
200
)
{
Store
.
commit
(
'saveShopInfo'
,
res
.
data
.
data
);
uni
.
setStorage
({
key
:
'shopData'
,
data
:
res
.
data
.
data
});
...
...
utils/utils.js
View file @
39db9abf
...
...
@@ -42,11 +42,13 @@ export default {
}
},
// 加入购物车数据
async
getallNum
(
Obj
,
callback
)
{
async
getallNum
(
Obj
,
unCheckCount
)
{
console
.
log
(
Obj
);
let
shopCarInfo
=
uni
.
getStorageSync
(
'shopCarInfo'
)
||
[];
let
size
=
0
;
shopCarInfo
.
forEach
((
item
)
=>
(
size
+=
item
.
num
));
if
(
!
unCheckCount
)
{
let
countOfOrder
=
uni
.
getStorageSync
(
'countOfOrder'
);
if
(
size
>=
countOfOrder
)
{
uni
.
showToast
({
...
...
@@ -55,6 +57,7 @@ export default {
});
return
false
;
}
}
if
(
shopCarInfo
)
{
let
currentGoods
=
shopCarInfo
.
find
((
v
)
=>
v
.
goodsId
==
Obj
.
goodsId
&&
v
.
skuId
==
Obj
.
skuId
);
...
...
@@ -69,9 +72,9 @@ export default {
console
.
log
(
Obj
);
uni
.
setStorageSync
(
'shopCarInfo'
,
shopCarInfo
);
$EventBus
.
$emit
(
'updateCar'
);
if
(
callback
)
{
callback
();
}
//
if (callback) {
//
callback();
//
}
},
// 商品详情立即购买
async
addGoods
(
Obj
)
{
...
...
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