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 @@
...
@@ -10,7 +10,7 @@
<scroll-view
class=
"nav-right"
scroll-y
:scroll-top=
"scrollTop"
@
scroll=
"scroll"
@
touchstart=
"openScroll"
<scroll-view
class=
"nav-right"
scroll-y
:scroll-top=
"scrollTop"
@
scroll=
"scroll"
@
touchstart=
"openScroll"
scroll-with-animation
>
scroll-with-animation
>
<view
v-for=
"category in classifyData"
:id=
"category.id"
:key=
"category.id"
class=
"box"
>
<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"
>
<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
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"
/>
<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 @@
...
@@ -74,14 +74,8 @@
<div
class=
"price"
>
总优惠¥
{{
reduction
}}
</div>
<div
class=
"price"
>
总优惠¥
{{
reduction
}}
</div>
</div>
-->
</div>
-->
</div>
</div>
<view
class=
"payment"
@
click=
"messageAndSave"
v-if=
"userms"
>
<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>
<button
v-if=
"!userms"
class=
"payment"
style=
"border-radius: 0;"
open-type=
"getPhoneNumber"
@
getphonenumber=
"getPhoneNumber"
>
付款
</button>
</div>
</div>
</view>
</view>
</
template
>
</
template
>
...
@@ -102,7 +96,6 @@ export default {
...
@@ -102,7 +96,6 @@ export default {
this
.
duration
=
data
.
data
this
.
duration
=
data
.
data
})
})
}
}
},
},
onLoad
(
option
)
{
onLoad
(
option
)
{
// 商品详情页点击立即支付进入
// 商品详情页点击立即支付进入
...
@@ -120,19 +113,19 @@ export default {
...
@@ -120,19 +113,19 @@ export default {
this
.
option
=
JSON
.
stringify
(
option
)
this
.
option
=
JSON
.
stringify
(
option
)
const
{
q
}
=
option
;
const
{
q
}
=
option
;
if
(
q
)
{
if
(
q
)
{
User
.
getLocation
((
location
)
=>
{
User
.
getLocation
((
state
,
params
)
=>
{
uni
.
removeStorageSync
(
'shopCarInfo'
);
uni
.
removeStorageSync
(
'shopCarInfo'
);
$EventBus
.
$emit
(
'updateCar'
);
$EventBus
.
$emit
(
'updateCar'
);
// this.buyType = '1';
// this.buyType = '1';
let
id
=
decodeURIComponent
(
q
).
split
(
'?'
)[
1
].
split
(
'='
)[
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
);
const
data
=
JSON
.
parse
(
res
.
data
.
data
);
console
.
log
(
data
);
console
.
log
(
data
);
this
.
shopData
=
data
.
shop
;
this
.
shopData
=
data
.
shop
;
this
.
buyType
=
data
.
screenNo
;
this
.
buyType
=
data
.
screenNo
;
this
.
goods
=
data
.
goods
.
map
(
item
=>
{
this
.
goods
=
data
.
goods
.
map
(
item
=>
{
const
data
=
{
...
item
,
skuId
:
item
.
sku
.
skuId
,
flag
:
true
}
const
data
=
{
...
item
,
skuId
:
item
.
sku
.
skuId
,
flag
:
true
}
Utils
.
getallNum
(
data
)
Utils
.
getallNum
(
data
,
true
)
// 不校验数量
return
data
return
data
})
})
})
})
...
@@ -153,7 +146,6 @@ export default {
...
@@ -153,7 +146,6 @@ export default {
this
.
duration
=
data
.
data
this
.
duration
=
data
.
data
})
})
if
(
!
this
.
userms
){
if
(
!
this
.
userms
){
User
.
wxLoginAndGetOpenid
(
true
).
then
(
loginInfo
=>
{
User
.
wxLoginAndGetOpenid
(
true
).
then
(
loginInfo
=>
{
this
.
loginInfo
=
loginInfo
this
.
loginInfo
=
loginInfo
...
...
pages/menu/menu.vue
View file @
39db9abf
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
<text
@
click=
"showArea"
class=
"shop-name"
>
{{
shopInfo
.
name
}}
</text>
<text
@
click=
"showArea"
class=
"shop-name"
>
{{
shopInfo
.
name
}}
</text>
<u-icon
name=
"arrow-right"
class=
"arrow-right-select"
color=
"#FFFFFF"
></u-icon>
<u-icon
name=
"arrow-right"
class=
"arrow-right-select"
color=
"#FFFFFF"
></u-icon>
</view>
</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>
<view
class=
"login-area"
>
<view
class=
"login-area"
>
<view
class=
"avatar"
>
<view
class=
"avatar"
>
...
@@ -234,7 +234,7 @@ export default {
...
@@ -234,7 +234,7 @@ export default {
},
},
async
getMenuList
(
id
)
{
async
getMenuList
(
id
)
{
let
{
data
}
=
await
Menu
.
getMenuList
(
id
);
let
{
data
}
=
await
Menu
.
getMenuList
(
id
);
console
.
log
(
"menus:"
+
JSON
.
stringify
(
data
));
//
console.log("menus:"+JSON.stringify(data));
if
(
data
.
code
==
200
)
{
if
(
data
.
code
==
200
)
{
data
.
data
=
data
.
data
;
data
.
data
=
data
.
data
;
this
.
$store
.
commit
(
'setMenuAllInfo'
,
data
.
data
);
this
.
$store
.
commit
(
'setMenuAllInfo'
,
data
.
data
);
...
...
request/user/index.js
View file @
39db9abf
...
@@ -30,7 +30,7 @@ export default {
...
@@ -30,7 +30,7 @@ export default {
getShopInfo
(
params
)
{
getShopInfo
(
params
)
{
return
uni
.
$u
.
http
.
get
(
'/weixin/getShop'
,
{
params
})
return
uni
.
$u
.
http
.
get
(
'/weixin/getShop'
,
{
params
})
.
then
((
res
)
=>
{
.
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
)
{
if
(
res
.
data
.
code
==
200
)
{
Store
.
commit
(
'saveShopInfo'
,
res
.
data
.
data
);
Store
.
commit
(
'saveShopInfo'
,
res
.
data
.
data
);
uni
.
setStorage
({
key
:
'shopData'
,
data
:
res
.
data
.
data
});
uni
.
setStorage
({
key
:
'shopData'
,
data
:
res
.
data
.
data
});
...
...
utils/utils.js
View file @
39db9abf
...
@@ -42,11 +42,13 @@ export default {
...
@@ -42,11 +42,13 @@ export default {
}
}
},
},
// 加入购物车数据
// 加入购物车数据
async
getallNum
(
Obj
,
callback
)
{
async
getallNum
(
Obj
,
unCheckCount
)
{
console
.
log
(
Obj
);
console
.
log
(
Obj
);
let
shopCarInfo
=
uni
.
getStorageSync
(
'shopCarInfo'
)
||
[];
let
shopCarInfo
=
uni
.
getStorageSync
(
'shopCarInfo'
)
||
[];
let
size
=
0
;
let
size
=
0
;
shopCarInfo
.
forEach
((
item
)
=>
(
size
+=
item
.
num
));
shopCarInfo
.
forEach
((
item
)
=>
(
size
+=
item
.
num
));
if
(
!
unCheckCount
)
{
let
countOfOrder
=
uni
.
getStorageSync
(
'countOfOrder'
);
let
countOfOrder
=
uni
.
getStorageSync
(
'countOfOrder'
);
if
(
size
>=
countOfOrder
)
{
if
(
size
>=
countOfOrder
)
{
uni
.
showToast
({
uni
.
showToast
({
...
@@ -55,6 +57,7 @@ export default {
...
@@ -55,6 +57,7 @@ export default {
});
});
return
false
;
return
false
;
}
}
}
if
(
shopCarInfo
)
{
if
(
shopCarInfo
)
{
let
currentGoods
=
shopCarInfo
.
find
((
v
)
=>
v
.
goodsId
==
Obj
.
goodsId
&&
v
.
skuId
==
Obj
.
skuId
);
let
currentGoods
=
shopCarInfo
.
find
((
v
)
=>
v
.
goodsId
==
Obj
.
goodsId
&&
v
.
skuId
==
Obj
.
skuId
);
...
@@ -69,9 +72,9 @@ export default {
...
@@ -69,9 +72,9 @@ export default {
console
.
log
(
Obj
);
console
.
log
(
Obj
);
uni
.
setStorageSync
(
'shopCarInfo'
,
shopCarInfo
);
uni
.
setStorageSync
(
'shopCarInfo'
,
shopCarInfo
);
$EventBus
.
$emit
(
'updateCar'
);
$EventBus
.
$emit
(
'updateCar'
);
if
(
callback
)
{
//
if (callback) {
callback
();
//
callback();
}
//
}
},
},
// 商品详情立即购买
// 商品详情立即购买
async
addGoods
(
Obj
)
{
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