Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
account-book
Project
Project
Details
Activity
Releases
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
刘文虎
account-book
Commits
2d5a4f8d
Commit
2d5a4f8d
authored
Nov 04, 2022
by
Facius
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 创建订单前店铺检查
parent
07da82e6
Pipeline
#3948
canceled with stages
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
332 additions
and
8 deletions
+332
-8
shop.js
api/mine/shop.js
+2
-2
bill-style.vue
pages/maintain-bill/bill-style.vue
+58
-6
pop-shop.vue
pages/maintain-bill/components/pop-shop.vue
+236
-0
input.vue
pages/mine/input/input.vue
+36
-0
No files found.
api/mine/shop.js
View file @
2d5a4f8d
import
request
from
"@/utils/request.js"
import
request
from
"@/utils/request.js"
export
function
getShopInfo
()
{
export
async
function
getShopInfo
()
{
return
request
({
return
request
({
url
:
`/rest/user/shop`
,
url
:
`/rest/user/shop`
,
method
:
'GET'
,
method
:
'GET'
,
})
})
}
}
export
function
updateShopInfo
(
data
)
{
export
async
function
updateShopInfo
(
data
)
{
return
request
({
return
request
({
url
:
`/rest/user/shop`
,
url
:
`/rest/user/shop`
,
method
:
'POST'
,
method
:
'POST'
,
...
...
pages/maintain-bill/bill-style.vue
View file @
2d5a4f8d
...
@@ -29,28 +29,32 @@
...
@@ -29,28 +29,32 @@
</scroll-view>
</scroll-view>
<!-- #endif -->
<!-- #endif -->
</view>
</view>
<!--
<submit-button
@
handleClick=
"submit"
text=
"下一步"
></submit-button>
-->
<view
class=
"bottom-view"
>
<view
class=
"bottom-view"
>
<u-button
type=
"success"
:
custom-style=
"customCreate"
@
click=
"s
ubmit"
>
<u-button
type=
"success"
:
loading=
"loading"
:custom-style=
"customCreate"
@
click=
"handleClickS
ubmit"
>
<view
class=
"create-view"
>
下一步
</view>
<view
class=
"create-view"
>
下一步
</view>
</u-button>
</u-button>
</view>
</view>
<PopShop
:visible
.
sync=
"showPop"
:info=
"info"
@
cancel=
"handleClickCancel"
@
confirm=
"handleClickConfirm"
/>
</view>
</view>
</
template
>
</
template
>
<
script
>
<
script
>
import
NavbarRight
from
'@/components/navbar-right'
;
import
NavbarRight
from
'@/components/navbar-right'
;
// import SubmitButton from '@/components/submit-button/index
.vue';
import
PopShop
from
'./components/pop-shop
.vue'
;
import
{
billBaseUrl
,
mineBaseUrl
}
from
'@/utils/config.js'
;
import
{
billBaseUrl
,
mineBaseUrl
}
from
'@/utils/config.js'
;
import
{
setMaintainBillType
,
getMaintainBillType
}
from
'@/utils/common.js'
;
import
{
setMaintainBillType
,
getMaintainBillType
}
from
'@/utils/common.js'
;
import
{
reportEvent
}
from
'@/api/bill/index.js'
import
{
reportEvent
}
from
'@/api/bill/index.js'
import
{
getShopInfo
,
updateShopInfo
}
from
"@/api/mine/shop.js"
export
default
{
export
default
{
components
:
{
components
:
{
NavbarRight
,
NavbarRight
,
// SubmitButton
PopShop
},
},
data
()
{
data
()
{
return
{
return
{
showPop
:
false
,
loading
:
false
,
backText
:
'收据记账'
,
backText
:
'收据记账'
,
rightImage
:
mineBaseUrl
+
'dianpushezhi@3x.png'
,
rightImage
:
mineBaseUrl
+
'dianpushezhi@3x.png'
,
previewIcon
:
billBaseUrl
+
'yulanicon@3x.png'
,
previewIcon
:
billBaseUrl
+
'yulanicon@3x.png'
,
...
@@ -93,10 +97,13 @@ export default {
...
@@ -93,10 +97,13 @@ export default {
'border-radius'
:
'16rpx'
,
'border-radius'
:
'16rpx'
,
width
:
'686rpx'
width
:
'686rpx'
},
},
};
info
:
{},
infoKeys
:
[
'name'
,
'address'
,
'phone'
,
'lister'
]
}
},
},
onReady
()
{
onReady
()
{
this
.
type
=
getMaintainBillType
()
||
'receipt'
;
this
.
type
=
getMaintainBillType
()
||
'receipt'
;
this
.
getShopInfo
()
},
},
methods
:
{
methods
:
{
handleClick
(
item
)
{
handleClick
(
item
)
{
...
@@ -115,6 +122,14 @@ export default {
...
@@ -115,6 +122,14 @@ export default {
}
}
});
});
},
},
handleClickSubmit
()
{
this
.
loading
=
true
if
(
!
this
.
checkValue
())
{
this
.
showPop
=
true
}
else
{
this
.
submit
()
}
},
submit
()
{
submit
()
{
setMaintainBillType
(
this
.
type
)
setMaintainBillType
(
this
.
type
)
if
(
this
.
type
==
'collection'
)
{
if
(
this
.
type
==
'collection'
)
{
...
@@ -128,15 +143,52 @@ export default {
...
@@ -128,15 +143,52 @@ export default {
url
:
`/pages/maintain-bill/create?type=
${
this
.
type
}
`
url
:
`/pages/maintain-bill/create?type=
${
this
.
type
}
`
});
});
}
}
this
.
loading
=
false
// #ifdef MP-WEIXIN
// 上报选择类型
// 上报选择类型
reportEvent
(
`selected_bill_
${
this
.
type
}
_type`
);
reportEvent
(
`selected_bill_
${
this
.
type
}
_type`
);
// #endif
},
},
handlClickRight
()
{
handlClickRight
()
{
this
.
$u
.
route
({
this
.
$u
.
route
({
url
:
'/pages/mine/shop-setting/shop-setting'
,
url
:
'/pages/mine/shop-setting/shop-setting'
,
params
:
{}
params
:
{}
});
});
}
},
getShopInfo
()
{
getShopInfo
({})
.
then
(
res
=>
{
this
.
info
=
res
.
data
||
{}
})
.
catch
(
err
=>
{
console
.
log
(
err
);
});
},
updateShopInfo
(
info
)
{
updateShopInfo
(
info
)
.
then
(
res
=>
{
this
.
info
=
res
.
data
||
{}
this
.
submit
()
})
.
catch
(
err
=>
{
this
.
loading
=
false
console
.
log
(
err
);
});
},
handleClickConfirm
(
info
)
{
this
.
info
=
info
this
.
updateShopInfo
(
info
)
},
handleClickCancel
()
{
this
.
submit
()
},
checkValue
()
{
for
(
var
item
of
this
.
infoKeys
)
{
if
(
!
this
.
info
[
item
])
return
false
}
return
true
},
}
}
};
};
</
script
>
</
script
>
...
...
pages/maintain-bill/components/pop-shop.vue
0 → 100644
View file @
2d5a4f8d
<
template
>
<u-popup
v-model=
"show"
safe-area-inset-bottom
border-radius=
"24"
mode=
"center"
width=
"86%"
:closeable=
"false"
@
close=
"handleClose"
:mask-close-able=
"false"
>
<view
class=
"pop-shop"
>
<view
class=
"title-view"
>
完善店铺信息
</view>
<view
class=
"tip-view"
>
为了更好的体验,请先完善以下信息:
</view>
<view
class=
"content-view"
>
<view
class=
"part-view"
v-for=
"(item, key) in infoKeys"
:key=
"key"
hover-class=
"u-hover-class"
@
click=
"handleClick(key)"
>
<view
class=
"label-view"
>
{{
item
.
name
}}
</view>
<view
class=
"value-view"
>
<view
v-if=
"shopInfo[key]"
>
{{
key
==
'phone'
?
showText
(
shopInfo
[
key
])
:
shopInfo
[
key
]
}}
</view>
<view
class=
"no-value"
v-else
>
{{
shopInfo
[
key
]
||
item
.
placeholder
}}
</view>
<u-icon
class=
"icon-view"
name=
"arrow-right"
color=
"#CCCCCC"
size=
"24"
></u-icon>
</view>
</view>
</view>
<view
class=
"bottom-view"
>
<view
class=
"left-view"
>
<u-button
:custom-style=
"customCancel"
@
click=
"handleClickCancel"
>
<view
class=
"cancel-view"
>
下次完善
</view>
</u-button>
</view>
<view
class=
"right-view"
>
<u-button
:loading=
"loading"
:type=
"customConFirm.type"
:custom-style=
"customConFirm"
@
click=
"handleClickConfirm"
>
<view
class=
"confirm-view"
>
保存
</view>
</u-button>
</view>
</view>
</view>
</u-popup>
</
template
>
<
script
>
export
default
{
props
:
{
visible
:
{
type
:
Boolean
,
default
:
false
,
},
info
:
{
type
:
Object
,
default
()
{
return
{}
}
}
},
data
()
{
return
{
show
:
false
,
shopInfo
:
{}
}
},
computed
:
{
infoKeys
()
{
return
{
name
:
{
name
:
"店铺名称"
,
placeholder
:
'填写店铺名称20字以内'
,
},
address
:
{
name
:
'店铺地址'
,
placeholder
:
'填写店铺地址信息'
,
},
phone
:
{
name
:
'联系电话'
,
placeholder
:
'填写联系电话'
,
},
lister
:
{
name
:
'收款人'
,
placeholder
:
'填写收款人'
,
},
}
},
customCancel
()
{
return
{
color
:
'transparent'
,
height
:
'96rpx'
,
width
:
'264rpx'
,
border
:
'2rpx solid #8D8D8D'
,
'border-radius'
:
'16rpx'
,
}
},
customConFirm
()
{
return
{
type
:
'success'
,
color
:
'transparent'
,
'background-color'
:
'#02A074'
,
height
:
'96rpx'
,
width
:
'264rpx'
,
}
},
},
watch
:
{
visible
(
val
)
{
this
.
show
=
val
this
.
loading
=
false
if
(
val
)
{
this
.
shopInfo
=
{...
this
.
info
}
}
},
},
methods
:
{
handleClick
(
key
)
{
let
type
=
`pop-shop-
${
key
}
`
this
.
$u
.
route
({
url
:
'/pages/mine/input/input'
,
params
:
{
type
:
type
,
value
:
this
.
shopInfo
[
key
],
}
});
uni
.
$once
(
`input-sure-
${
type
}
`
,
res
=>
{
this
.
shopInfo
[
key
]
=
res
.
content
});
},
handleClickConfirm
()
{
if
(
!
this
.
checkValue
())
{
return
}
this
.
loading
=
true
this
.
changeVisibleValue
(
false
)
this
.
$emit
(
'confirm'
,
{
...
this
.
shopInfo
})
},
checkValue
()
{
for
(
var
item
in
this
.
infoKeys
)
{
if
(
!
this
.
shopInfo
[
item
])
return
false
}
return
true
},
handleClickCancel
()
{
this
.
changeVisibleValue
(
false
)
this
.
$emit
(
'cancel'
)
},
changeVisibleValue
(
val
)
{
this
.
show
=
val
this
.
$emit
(
'update:visible'
,
val
)
},
handleClose
()
{
this
.
changeVisibleValue
(
false
)
},
showText
(
string
)
{
var
mobile
=
string
?
(
string
.
substring
(
0
,
3
)
+
' '
+
string
.
substring
(
3
,
7
)
+
' '
+
string
.
substring
(
7
,
11
))
:
''
return
mobile
}
},
}
</
script
>
<
style
lang=
"scss"
scoped
>
.pop-shop
{
text-align
:
center
;
padding
:
24rpx
32rpx
;
background-image
:
linear-gradient
(
to
bottom
,
#f4fffc
0%
,
#ffffff
50%
);
.title-view
{
color
:
#333333
;
font-weight
:
bold
;
font-size
:
40rpx
;
margin
:
32rpx
0
24rpx
0
;
}
.tip-view
{
color
:
#8D8D8D
;
font-size
:
28rpx
;
text-align
:
left
;
margin-bottom
:
24rpx
;
}
.content-view
{
margin-bottom
:
32rpx
;
.part-view
{
display
:
flex
;
align-items
:
center
;
justify-content
:
space-between
;
font-size
:
28rpx
;
color
:
#333333
;
padding
:
20rpx
0
;
.label-view
{
height
:
70rpx
;
line-height
:
70rpx
;
}
.value-view
{
display
:
flex
;
align-items
:
center
;
justify-content
:
flex-end
;
height
:
70rpx
;
line-height
:
70rpx
;
font-weight
:
bold
;
.no-value
{
color
:
#CCCCCC
,
}
.icon-view
{
margin-left
:
16rpx
;
}
}
}
}
.bottom-view
{
display
:
flex
;
justify-content
:
space-between
;
align-items
:
center
;
margin-bottom
:
16rpx
;
.left-view
{
.cancel-view
{
color
:
#8D8D8D
;
height
:
96rpx
;
line-height
:
96rpx
;
font-weight
:
bold
;
font-size
:
32rpx
;
display
:
flex
;
justify-content
:
center
;
align-items
:
center
;
}
}
.right-view
{
margin-left
:
30rpx
;
.confirm-view
{
color
:
#ffffff
;
height
:
96rpx
;
line-height
:
96rpx
;
font-weight
:
bold
;
font-size
:
32rpx
;
}
}
}
}
</
style
>
pages/mine/input/input.vue
View file @
2d5a4f8d
...
@@ -187,6 +187,42 @@ export default {
...
@@ -187,6 +187,42 @@ export default {
height
:
240
,
height
:
240
,
empty
:
true
empty
:
true
};
};
case
'pop-shop-name'
:
return
{
title
:
'店铺名称'
,
type
:
'textarea'
,
placeholder
:
'填写店铺名称20字以内'
,
maxlength
:
20
,
height
:
240
,
empty
:
true
};
case
'pop-shop-address'
:
return
{
title
:
'店铺地址'
,
type
:
'textarea'
,
placeholder
:
'填写店铺地址信息'
,
maxlength
:
30
,
height
:
240
,
empty
:
true
};
case
'pop-shop-phone'
:
return
{
title
:
'联系电话'
,
type
:
'number'
,
placeholder
:
'填写联系电话'
,
maxlength
:
11
,
height
:
240
,
empty
:
true
};
case
'pop-shop-phone'
:
return
{
title
:
'收款人'
,
type
:
'textarea'
,
placeholder
:
'填写收款人'
,
maxlength
:
10
,
height
:
240
,
empty
:
true
};
}
}
}
}
},
},
...
...
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