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
075ab1a1
Commit
075ab1a1
authored
Jun 09, 2022
by
weijiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改bug
parent
4c23005f
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
168 additions
and
33 deletions
+168
-33
components/menuAssembly/index.vue
+2
-1
components/shopCar/shopCar.vue
+29
-23
menuSubPackage/pages/goodsDetail/goodsDetail.vue
+1
-2
mineSubPackage/pages/msg/index.vue
+48
-0
orderSubPackage/pages/settlement/index.vue
+3
-1
package-lock.json
+17
-1
pages/order/order.vue
+63
-2
request/user/index.js
+5
-3
static/imgs/none_content.png
+0
-0
No files found.
components/menuAssembly/index.vue
View file @
075ab1a1
...
...
@@ -23,7 +23,8 @@
</view>
<view
class=
"dis-box"
>
<view
class=
"dis"
>
{{
item
.
desc
||
''
}}
</view>
<view
class=
"add-btn"
@
click
.
stop=
"getallNum(item, category)"
>
+
</view>
<!--
<view
class=
"add-btn"
@
click
.
stop=
"getallNum(item, category)"
>
+
</view>
-->
<u-icon
name=
"plus-circle-fill"
color=
"#2979ff"
@
click
.
stop=
"getallNum(item, category)"
size=
"22"
></u-icon>
</view>
<view
class=
"mon"
>
<view
class=
"discount"
>
¥
{{
getPrice
(
item
).
discount
||
item
.
discount
}}
</view>
...
...
components/shopCar/shopCar.vue
View file @
075ab1a1
...
...
@@ -43,9 +43,11 @@
</view>
</view>
<view
class=
"detail-right"
>
<text
class=
"subtract"
@
click=
"reduce(item, index)"
>
-
</text>
<!--
<text
class=
"subtract"
@
click=
"reduce(item, index)"
>
-
</text>
-->
<u-icon
class=
"subtract"
name=
"minus-circle"
@
click=
"reduce(item, index)"
color=
"#2979ff"
size=
"22"
></u-icon>
<text
class=
"num"
>
{{
item
.
num
}}
</text>
<text
@
click=
"add(item)"
class=
"add"
>
+
</text>
<!--
<text
@
click=
"add(item)"
class=
"add"
>
+
</text>
-->
<u-icon
class=
"add"
name=
"plus-circle-fill"
color=
"#2979ff"
@
click=
"add(item)"
size=
"22"
></u-icon>
</view>
</view>
</view>
...
...
@@ -71,8 +73,6 @@
@
getphonenumber=
"saveReserve"
>
付款
</button>
</view>
</view>
</
template
>
...
...
@@ -329,27 +329,33 @@ export default {
}
.detail-right
{
text
{
width
:
40
rpx
;
line-height
:
40
rpx
;
text-align
:
center
;
display
:
inline-block
;
margin-right
:
10
rpx
;
display
:
flex
;
//
text
{
//
width
:
40
rpx
;
//
line-height
:
40
rpx
;
//
text-align
:
center
;
//
display
:
inline-block
;
//
margin-right
:
10
rpx
;
//
color
:
#000000
;
//
}
//
.subtract
{
//
float
:
left
;
//
position
:
relative
;
//
}
.num
{
//
float
:
left
;
//
position
:
relative
;
margin-left
:
15
rpx
;
margin-right
:
15
rpx
;
color
:
#000000
;
//
font-size
:
28
rpx
;
font-weight
:
bold
;
}
.add
{
color
:
#FFFFFF
;
border-radius
:
40
rpx
;
margin-right
:
20
rpx
;
background
:
#006ECF
;
}
.subtract
{
border
:
1
rpx
solid
#006ECF
;
border-radius
:
40
rpx
;
color
:
#006ECF
;
}
//
.add
{
//
float
:
left
;
//
position
:
relative
;
//
}
}
}
}
...
...
menuSubPackage/pages/goodsDetail/goodsDetail.vue
View file @
075ab1a1
...
...
@@ -54,8 +54,7 @@
</div>
<div
v-if=
"!size > 0"
>
已售罄
</div>
<div
v-else
class=
"set_size"
>
<u-icon
name=
"minus-circle"
@
click=
"reduceGood"
color=
"#2979ff"
size=
"22"
>
</u-icon>
<u-icon
name=
"minus-circle"
@
click=
"reduceGood"
color=
"#2979ff"
size=
"22"
></u-icon>
<span>
{{
size
}}
</span>
<u-icon
name=
"plus-circle-fill"
color=
"#2979ff"
@
click=
"addGood"
size=
"22"
></u-icon>
</div>
...
...
mineSubPackage/pages/msg/index.vue
View file @
075ab1a1
<
template
>
<scroll-view
class=
"msg"
scroll-y
>
<view
class=
"empty"
v-show=
"empty == true"
>
<image
class=
"empty_icon"
src=
"/static/imgs/none_content.png"
></image>
<view
class=
"empty_text"
>
---暂无消息,去品尝杯咖啡吧---
</view>
<button
class=
"empty_button"
@
click=
"goHome"
>
去品尝
</button>
</view>
<view
class=
"msg_item"
v-for=
"item in list"
@
click=
"toRead(item)"
:key=
"item.id"
>
<view
class=
"msg_item_title_time"
>
<view
v-if=
"item.isRead == 1"
class=
"sign"
></view>
...
...
@@ -16,6 +21,7 @@ import Mine from '@/request/mine'
export
default
{
data
()
{
return
{
empty
:
false
,
list
:
[]
}
},
...
...
@@ -27,6 +33,11 @@ export default {
async
getList
()
{
const
{
data
}
=
await
Mine
.
getMsg
();
this
.
list
=
data
.
rows
if
(
this
.
list
&&
this
.
list
.
length
>
0
)
{
this
.
empty
=
false
;
}
else
{
this
.
empty
=
true
;
}
},
async
toRead
(
item
)
{
const
{
id
}
=
item
...
...
@@ -34,6 +45,9 @@ export default {
if
(
res
)
{
this
.
getList
()
}
},
goHome
()
{
uni
.
switchTab
({
url
:
'/pages/menu/menu'
});
}
}
...
...
@@ -41,6 +55,40 @@ export default {
</
script
>
<
style
lang=
"scss"
scoped
>
.empty
{
position
:
fixed
;
/* 居中对齐begin */
left
:
50%
;
/* 兼容老版本的方法 */
-webkit-transform
:
translateX
(
-50%
);
transform
:
translateX
(
-50%
);
margin-top
:
200
rpx
;
.empty_icon
{
width
:
325
rpx
;
height
:
296
rpx
;
}
.empty_text
{
font-size
:
20
rpx
;
margin-top
:
10
rpx
;
font-family
:
ArialMT
;
color
:
#666666
;
text-align
:
center
;
}
.empty_button
{
width
:
128
rpx
;
height
:
46
rpx
;
margin-top
:
10
rpx
;
background
:
#006ECF
;
border-radius
:
10
rpx
;
text-align
:
center
;
font-size
:
20
rpx
;
color
:
#fff
;
}
}
.msg_item
{
width
:
100%
;
height
:
116
rpx
;
...
...
orderSubPackage/pages/settlement/index.vue
View file @
075ab1a1
...
...
@@ -120,11 +120,13 @@ export default {
User
.
getLocation
((
location
)
=>
{
uni
.
removeStorageSync
(
'shopCarInfo'
);
$EventBus
.
$emit
(
'updateCar'
);
this
.
buyType
=
'A
'
;
// this.buyType = '1
';
let
id
=
decodeURIComponent
(
q
).
split
(
'?'
)[
1
].
split
(
'='
)[
1
];
Menu
.
getScreenShopCar
(
id
,
location
).
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
)
...
...
package-lock.json
View file @
075ab1a1
{
"name"
:
"user"
,
"lockfileVersion"
:
2
,
"requires"
:
true
,
"lockfileVersion"
:
1
,
"packages"
:
{
""
:
{
"dependencies"
:
{
"uview-ui"
:
"^2.0.31"
}
},
"node_modules/uview-ui"
:
{
"version"
:
"2.0.31"
,
"resolved"
:
"https://registry.npmmirror.com/uview-ui/-/uview-ui-2.0.31.tgz"
,
"integrity"
:
"sha512-I/0fGuvtiKHH/mBb864SGYk+SJ7WaF32tsBgYgeBOsxlUp+Th+Ac2tgz2cTvsQJl6eZYWsKZ3ixiSXCAcxZ8Sw=="
,
"engines"
:
{
"HBuilderX"
:
"^3.1.0"
}
}
},
"dependencies"
:
{
"uview-ui"
:
{
"version"
:
"2.0.31"
,
...
...
pages/order/order.vue
View file @
075ab1a1
<
template
>
<view
class=
"pages"
>
<view
v-show=
"false"
>
{{
userms
}}
</view>
<view
class=
"empty"
v-show=
"userms && empty == true"
>
<image
class=
"empty_icon"
src=
"/static/imgs/none_content.png"
></image>
<view
class=
"empty_text"
>
---您还未下单,下单品尝一下吧---
</view>
<button
class=
"empty_button"
@
click=
"goHome"
>
去品尝
</button>
</view>
<view
class=
"empty"
v-show=
"!userms"
>
<image
class=
"empty_icon"
src=
"/static/imgs/none_content.png"
></image>
<view
class=
"empty_text"
>
---您还未登录,请先登录---
</view>
<button
class=
"empty_button"
open-type=
"getPhoneNumber"
@
getphonenumber=
"getPhoneNumber"
>
去登录
</button>
</view>
<view
class=
"orders"
>
<view
class=
"order_item"
v-for=
"item in list"
:key=
"item.id"
@
click=
"openInfo(item)"
>
<view
class=
"order_header"
>
...
...
@@ -65,12 +76,14 @@
import
order
from
'@/request/order'
import
Menu
from
'@/request/menu'
;
import
Utils
from
'@/utils/utils'
import
User
from
'@/request/user'
import
{
$EventBus
}
from
"@/utils/EventBus"
;
export
default
{
name
:
'order'
,
data
()
{
return
{
empty
:
false
,
list
:
[]
}
},
...
...
@@ -105,7 +118,12 @@ export default {
if
(
!
this
.
userms
)
return
const
{
data
}
=
await
order
.
getMyOrder
();
if
(
data
)
{
this
.
list
=
data
.
rows
this
.
list
=
data
.
rows
;
if
(
this
.
list
&&
this
.
list
.
length
>
0
)
{
this
.
empty
=
false
;
}
else
{
this
.
empty
=
true
;
}
}
else
{
uni
.
showToast
({
title
:
'请登录!'
,
icon
:
'error'
})
}
...
...
@@ -119,11 +137,21 @@ export default {
}
}
},
goHome
()
{
uni
.
switchTab
({
url
:
'/pages/menu/menu'
});
},
// 手机号授权登录
getPhoneNumber
(
e
)
{
if
(
e
.
detail
.
errMsg
==
'getPhoneNumber:ok'
)
{
User
.
getPhoneNumber
(
e
,
this
.
getList
);
}
else
if
(
e
.
detail
.
errMsg
==
"getPhoneNumber:fail user deny"
)
{
uni
.
showToast
({
title
:
'已拒绝手机号授权'
,
icon
:
'error'
})
}
},
openInfo
(
data
)
{
uni
.
setStorageSync
(
'orderInfo'
,
data
);
let
url
=
'/orderSubPackage/pages/orderInfo/index'
uni
.
navigateTo
({
url
})
},
jsonParse
(
json
)
{
const
data
=
json
||
{}
...
...
@@ -144,6 +172,39 @@ export default {
</
script
>
<
style
lang=
"scss"
scoped
>
.empty
{
position
:
fixed
;
/* 居中对齐begin */
left
:
50%
;
/* 兼容老版本的方法 */
-webkit-transform
:
translateX
(
-50%
);
transform
:
translateX
(
-50%
);
margin-top
:
200
rpx
;
.empty_icon
{
width
:
325
rpx
;
height
:
296
rpx
;
}
.empty_text
{
font-size
:
20
rpx
;
margin-top
:
10
rpx
;
font-family
:
ArialMT
;
color
:
#666666
;
text-align
:
center
;
}
.empty_button
{
width
:
128
rpx
;
height
:
46
rpx
;
margin-top
:
10
rpx
;
background
:
#006ECF
;
border-radius
:
10
rpx
;
text-align
:
center
;
font-size
:
20
rpx
;
color
:
#fff
;
}
}
.orders
{
padding
:
1
rpx
;
...
...
request/user/index.js
View file @
075ab1a1
...
...
@@ -45,7 +45,7 @@ export default {
return
err
;
});
},
uniLogin
(
res
)
{
uniLogin
(
res
,
callback
)
{
uni
.
login
({
provider
:
'weixin'
,
success
:
function
(
data
)
{
...
...
@@ -66,6 +66,8 @@ export default {
uni
.
setStorage
({
key
:
'userInfo'
,
data
:
data
});
Store
.
commit
(
'setUserInfo'
,
data
);
Store
.
commit
(
'setAuthorization'
,
token
);
if
(
callback
)
callback
();
}
})
.
catch
((
err
)
=>
{
...
...
@@ -85,11 +87,11 @@ export default {
});
},
// 手机号授权登录
getPhoneNumber
(
res
)
{
getPhoneNumber
(
res
,
callback
)
{
uni
.
setStorage
({
key
:
'userPhoneInfo'
,
data
:
res
});
Store
.
commit
(
'setUserPhoneInfo'
,
res
);
uni
.
setStorage
({
key
:
'phoneInfo'
,
data
:
res
});
this
.
uniLogin
(
res
.
detail
);
this
.
uniLogin
(
res
.
detail
,
callback
);
},
setAllow
(
allow
)
{
uni
.
$u
.
http
...
...
static/imgs/none_content.png
0 → 100644
View file @
075ab1a1
60 KB
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