Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
U
uniapp_scan
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
android
uniapp_scan
Commits
1d45664b
Commit
1d45664b
authored
Jun 11, 2024
by
mengcuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
代码优化
parent
35777462
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
142 additions
and
15 deletions
+142
-15
kefu-popup.vue
scan/components/kefu-popup/kefu-popup.vue
+129
-0
my.vue
scan/components/my/my.vue
+11
-13
vipPay.vue
scan/pagesA/vipPay/vipPay.vue
+2
-2
No files found.
scan/components/kefu-popup/kefu-popup.vue
0 → 100644
View file @
1d45664b
<
template
>
<view>
<uni-popup
type=
"bottom"
ref=
"kefuPop"
:maskClick=
"false"
:isMaskClick=
"false"
>
<view
class=
"container"
>
<image
@
click=
"onClose"
style=
"width: 50rpx; height: 50rpx;margin-left:auto;margin-right: 30rpx;
margin-bottom: 30rpx;"
src=
"https://mints-web.oss-cn-beijing.aliyuncs.com/images/ic_close_white.png"
></image>
<view
class=
"content"
>
<button
class=
"button1"
type=
"default"
size=
"default"
@
click=
"tapMakePhoneCall"
>
客服电话
</button>
<button
class=
"button2"
open-type=
"im"
data-im-id=
"dy1d1fub8mqd"
>
客服在线
</button>
</view>
</view>
</uni-popup>
</view>
</
template
>
<
script
>
export
default
{
name
:
'kefuPopup'
,
props
:
{
show
:
{
type
:
Boolean
,
default
:
false
,
}
},
data
()
{
return
{
imId
:
"dy1d1fub8mqd"
};
},
methods
:
{
handleShow
()
{
this
.
$refs
.
kefuPop
.
open
(
'bottom'
);
},
onClose
()
{
this
.
$refs
.
kefuPop
.
close
(
'bottom'
);
this
.
$emit
(
'close'
);
},
tapMakePhoneCall
()
{
let
that
=
this
tt
.
makePhoneCall
({
phoneNumber
:
"4000969950"
,
success
(
res
)
{
// 调用成功 makePhoneCall:ok
that
.
onClose
()
console
.
log
(
"调用成功"
,
res
.
errMsg
);
},
fail
(
res
)
{
that
.
onClose
()
// 调用失败 makePhoneCall:fail
console
.
log
(
"调用失败"
,
res
.
errMsg
);
},
});
},
imCallback
(
e
)
{
console
.
log
(
"跳转IM客服成功"
,
e
.
detail
);
this
.
onClose
()
},
onimError
(
e
)
{
console
.
log
(
"拉起IM客服失败"
,
e
.
detail
);
this
.
onClose
()
}
},
watch
:
{
show
:
{
handler
:
function
(
newVal
,
oldVal
)
{
if
(
newVal
)
{
this
.
handleShow
();
}
},
immediate
:
true
}
}
};
</
script
>
<
style
lang=
"scss"
>
.container
{
width
:
100%
;
height
:
100%
;
position
:
relative
;
display
:
flex
;
flex-direction
:
column
;
justify-content
:
center
;
}
.content
{
border-radius
:
20rpx
;
background-color
:
white
;
display
:
flex
;
width
:
100%
;
padding
:
30rpx
0
;
flex-direction
:
column
;
align-items
:
center
;
.title
{
color
:
black
;
font-size
:
40rpx
;
font-weight
:
bold
;
margin-bottom
:
30rpx
;
}
.button1
{
width
:
600rpx
;
height
:
80rpx
;
line-height
:
80rpx
;
text-align
:
center
;
margin
:
20rpx
20rpx
;
border-radius
:
10rpx
;
background-color
:
orange
;
color
:
white
;
font-size
:
36rpx
;
box-shadow
:
0
0
2px
0px
rgba
(
255
,
255
,
255
,
0
.1
);
}
.button2
{
width
:
600rpx
;
height
:
80rpx
;
line-height
:
80rpx
;
text-align
:
center
;
margin
:
20rpx
20rpx
;
border-radius
:
10rpx
;
background-color
:
white
;
border
:
1px
orange
solid
;
color
:
orange
;
font-size
:
36rpx
;
box-shadow
:
0
0
2px
0px
rgba
(
255
,
255
,
255
,
0
.1
);
}
}
</
style
>
\ No newline at end of file
scan/components/my/my.vue
View file @
1d45664b
...
...
@@ -80,11 +80,13 @@
</view>
</view>
</scroll-view>
<kefu-popup
:show=
"showKefuPop"
@
close=
"showKefuPop = false"
/>
</view>
</
template
>
<
script
>
import
common
from
'@/mixins/common'
;
import
kefuPopup
from
'@/components/kefu-popup/kefu-popup.vue'
;
import
{
navigateTo
,
message
,
...
...
@@ -96,10 +98,14 @@
export
default
{
name
:
'my'
,
mixins
:
[
common
],
components
:
{
kefuPopup
},
data
()
{
return
{
statusBarHeight
:
app
.
globalData
.
statusBarHeight
,
userBean
:
{},
showKefuPop
:
false
,
backgroundImg
:
'https://mints-pkg.oss-cn-beijing.aliyuncs.com/pkg/img/ic_banner_vip.png'
};
},
...
...
@@ -128,15 +134,7 @@
navigateTo
(
`/pagesA/vipPay/vipPay`
)
},
handlePhone
()
{
tt
.
makePhoneCall
({
phoneNumber
:
'4000969950'
,
success
:
function
(
res
)
{
console
.
log
(
'拨打电话成功!'
);
},
fail
:
function
(
res
)
{
console
.
log
(
'拨打电话失败!'
);
}
})
this
.
showKefuPop
=
true
}
}
};
...
...
scan/pagesA/vipPay/vipPay.vue
View file @
1d45664b
...
...
@@ -54,7 +54,7 @@
</view>
<view
class=
"section"
>
<button
class=
"apply-button"
@
click=
"handlePay"
>
立即
开通
</button>
<button
class=
"apply-button"
@
click=
"handlePay"
>
立即
试用
</button>
</view>
<image
@
click=
"handlePay"
style=
"width: 100%;"
...
...
@@ -176,7 +176,7 @@
that
.
ttPay
(
largeType
,
res
.
orderId
,
ttData
);
},
fail
(
res
)
{
message
.
notify
(
res
.
errMsg
);
//
message.notify(res.errMsg);
console
.
log
(
'requestOrder res.errMsg'
,
res
)
},
});
...
...
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