Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cauchy-ui
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
ui
cauchy-ui
Commits
1ff2ddb7
Commit
1ff2ddb7
authored
Jul 16, 2021
by
郭志伟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 问题修复
parent
7791f6fc
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
127 additions
and
31 deletions
+127
-31
App.vue
src/App.vue
+49
-2
tips.js
src/api/tips.js
+0
-8
main.js
src/main.js
+8
-0
routerStorage.js
src/service/routerStorage.js
+24
-0
validation.service.js
src/service/validation.service.js
+1
-1
index.vue
src/views/home/index.vue
+1
-1
index.vue
src/views/orderDetail/index.vue
+10
-5
extends.js
src/views/pay/extends.js
+1
-1
payWaiting.vue
src/views/pay/payWaiting.vue
+2
-2
SpuList.vue
src/views/vipLife/components/SpuList.vue
+19
-7
index.vue
src/views/vipLife/index.vue
+12
-4
No files found.
src/App.vue
View file @
1ff2ddb7
...
@@ -2,7 +2,9 @@
...
@@ -2,7 +2,9 @@
<div
id=
"app"
>
<div
id=
"app"
>
<cr-nav-bar
v-if=
"header"
:title=
"title"
left-text=
""
@
click-left=
"backFun"
/>
<cr-nav-bar
v-if=
"header"
:title=
"title"
left-text=
""
@
click-left=
"backFun"
/>
<div
class=
"app"
>
<div
class=
"app"
>
<router-view
/>
<transition
:name=
"transitionName"
>
<router-view
/>
</transition>
</div>
</div>
<div
v-if=
"loading"
class=
"loading-container"
>
<div
v-if=
"loading"
class=
"loading-container"
>
<cr-loading
class=
"loading"
size=
"24px"
>
加载中...
</cr-loading>
<cr-loading
class=
"loading"
size=
"24px"
>
加载中...
</cr-loading>
...
@@ -13,13 +15,16 @@
...
@@ -13,13 +15,16 @@
<
script
>
<
script
>
import
{
mapState
}
from
'
vuex
'
;
import
{
mapState
}
from
'
vuex
'
;
import
NetError
from
'
@/components/NetError
'
;
import
NetError
from
'
@/components/NetError
'
;
import
{
routerStorage
}
from
'
@/service/routerStorage
'
;
export
default
{
export
default
{
name
:
'
App
'
,
name
:
'
App
'
,
components
:
{
components
:
{
NetError
NetError
},
},
data
()
{
data
()
{
return
{};
return
{
transitionName
:
'
slide-right
'
};
},
},
computed
:
{
computed
:
{
...
mapState
({
...
mapState
({
...
@@ -36,6 +41,19 @@ export default {
...
@@ -36,6 +41,19 @@ export default {
document
.
body
.
className
=
val
?
'
has-header
'
:
''
;
document
.
body
.
className
=
val
?
'
has-header
'
:
''
;
}
}
}
}
},
$route
(
to
,
from
)
{
routerStorage
(
to
.
path
,
from
.
path
);
const
firstPath
=
[
'
/home
'
,
'
/orderDetail
'
,
'
/payWaiting
'
];
if
(
[
to
.
path
,
from
.
path
].
every
(
v
=>
firstPath
.
includes
(
v
))
||
[
to
.
path
,
from
.
path
].
includes
(
'
/
'
)
)
{
this
.
transitionName
=
''
;
return
;
}
this
.
transitionName
=
this
.
$router
.
isBack
?
'
slide-right
'
:
'
slide-left
'
;
this
.
$router
.
isBack
=
false
;
}
}
},
},
methods
:
{
methods
:
{
...
@@ -95,4 +113,33 @@ export default {
...
@@ -95,4 +113,33 @@ export default {
.b-t:after {
.b-t:after {
top: 0;
top: 0;
}
}
.slide-right-enter-active,
.slide-right-leave-active,
.slide-left-enter-active,
.slide-left-leave-active {
will-change: transform;
transition: all 500ms;
position: absolute;
}
.slide-right-enter {
opacity: 0;
transform: translate3d(-100%, 0, 0);
}
.slide-right-leave-active {
opacity: 0;
transform: translate3d(100%, 0, 0);
}
.slide-left-enter {
opacity: 0;
transform: translate3d(100%, 0, 0);
}
.slide-left-leave-active {
opacity: 0;
transform: translate3d(-100%, 0, 0);
}
</
style
>
</
style
>
src/api/tips.js
View file @
1ff2ddb7
export
default
{
export
default
{
1
:
{
title
:
'
温馨提示
'
,
content
:
`<p>充值类商品售出后无法进行退换,非充值用户请谨慎购买。</p>`
},
2
:
{
title
:
'
温馨提示
'
,
content
:
`<p>充值类商品售出后无法进行退换,非充值用户请谨慎购买。</p>`
},
401
:
{
401
:
{
title
:
'
使用方法
'
,
title
:
'
使用方法
'
,
content
:
`<p>1. 进入猫眼APP,登陆后打开“我的”,点击“优惠券”;</p>
content
:
`<p>1. 进入猫眼APP,登陆后打开“我的”,点击“优惠券”;</p>
...
...
src/main.js
View file @
1ff2ddb7
...
@@ -26,6 +26,14 @@ saService.init(router);
...
@@ -26,6 +26,14 @@ saService.init(router);
Vue
.
config
.
productionTip
=
false
;
Vue
.
config
.
productionTip
=
false
;
window
.
addEventListener
(
'
popstate
'
,
()
=>
{
router
.
isBack
=
true
;
},
false
);
new
Vue
({
new
Vue
({
router
,
router
,
store
,
store
,
...
...
src/service/routerStorage.js
0 → 100644
View file @
1ff2ddb7
import
localStorage
from
'
@/service/localStorage.service
'
;
export
function
routerStorage
(
toPath
,
fromPath
)
{
let
storage
=
localStorage
.
get
(
'
history
'
)
||
{
isBack
:
false
,
paths
:
[],
fromPath
:
''
};
// 初始化
if
(
fromPath
===
'
/
'
)
storage
.
paths
=
[];
if
(
storage
.
paths
.
includes
(
toPath
))
{
const
toPathIndex
=
storage
.
paths
.
indexOf
(
toPath
);
storage
=
{
...
storage
,
isBack
:
true
,
fromPath
};
storage
.
paths
.
splice
(
toPathIndex
+
1
);
}
else
{
storage
=
{
...
storage
,
isBack
:
false
,
fromPath
};
storage
.
paths
.
push
(
toPath
);
}
localStorage
.
set
(
'
history
'
,
storage
);
}
export
function
isBack
(
excludeFromPath
=
''
)
{
let
storage
=
localStorage
.
get
(
'
history
'
)
||
{
isBack
:
false
,
paths
:
[],
fromPath
:
''
};
if
(
storage
.
isBack
&&
excludeFromPath
!==
storage
.
fromPath
)
{
return
true
;
}
return
false
;
}
src/service/validation.service.js
View file @
1ff2ddb7
...
@@ -298,7 +298,7 @@ export const isIOS = /iphone|ipad|ipod/.test(ua);
...
@@ -298,7 +298,7 @@ export const isIOS = /iphone|ipad|ipod/.test(ua);
export
const
isAndroid
=
/android/
.
test
(
ua
);
export
const
isAndroid
=
/android/
.
test
(
ua
);
// 判断
// 判断
export
const
appVersion
=
ua
.
match
(
/xyqb
\/([\d
|.
]
+
)
/
)
;
export
const
appVersion
=
ua
.
match
(
/xyqb
\/([\d
|.
]
+
)
/
)
&&
ua
.
match
(
/xyqb
\/([\d
|.
]
+
)
/
)[
1
]
;
export
const
isQQ
=
ua
.
match
(
/QQ/i
)
==
'
qq
'
;
export
const
isQQ
=
ua
.
match
(
/QQ/i
)
==
'
qq
'
;
...
...
src/views/home/index.vue
View file @
1ff2ddb7
...
@@ -50,7 +50,7 @@ export default {
...
@@ -50,7 +50,7 @@ export default {
phoneRecharge
:
{
}
,
phoneRecharge
:
{
}
,
userPhoneInfo
:
{
}
,
userPhoneInfo
:
{
}
,
rechargeType
:
'
recharge
'
,
rechargeType
:
'
recharge
'
,
historyRecordList
:
[
'
17611682272
'
,
'
222222222
'
],
historyRecordList
:
[],
rechargePhoneInfo
:
{
}
,
rechargePhoneInfo
:
{
}
,
selectedRechargeInfo
:
{
}
selectedRechargeInfo
:
{
}
}
;
}
;
...
...
src/views/orderDetail/index.vue
View file @
1ff2ddb7
...
@@ -61,7 +61,7 @@
...
@@ -61,7 +61,7 @@
微信支付金额:
<span>
{{
orderInfo
.
payDetail
.
wxPayAmt
||
''
}}
</span>
微信支付金额:
<span>
{{
orderInfo
.
payDetail
.
wxPayAmt
||
''
}}
</span>
</div>
</div>
<div
v-if=
"orderInfo.orderDetail.payType"
class=
"Od__info-item"
>
<div
v-if=
"orderInfo.orderDetail.payType"
class=
"Od__info-item"
>
支付方式:
<span>
{{
payType
}}
</span>
支付方式:
<span>
{{
orderInfo
.
orderDetail
.
payType
}}
</span>
</div>
</div>
</div>
</div>
<div
class=
"Od__bottom"
>
<div
class=
"Od__bottom"
>
...
@@ -106,7 +106,7 @@
...
@@ -106,7 +106,7 @@
提醒发货
提醒发货
</cr-button>
</cr-button>
<cr-button
<cr-button
v-if=
"orderInfo.orderStatusInfo.orderStatus ===
3
1"
v-if=
"orderInfo.orderStatusInfo.orderStatus ===
4
1"
size=
"small"
size=
"small"
plain
plain
type=
"primary"
type=
"primary"
...
@@ -121,6 +121,7 @@
...
@@ -121,6 +121,7 @@
<
script
>
<
script
>
import
ListItem
from
'
../orderList/components/ListItem.vue
'
;
import
ListItem
from
'
../orderList/components/ListItem.vue
'
;
import
{
setClipboardData
}
from
'
@/service/utils.service
'
;
import
{
setClipboardData
}
from
'
@/service/utils.service
'
;
import
{
isBack
}
from
'
@/service/routerStorage
'
;
import
orderApi
from
'
@/api/order.api
'
;
import
orderApi
from
'
@/api/order.api
'
;
import
img11
from
'
@/assets/images/order/11.png
'
;
import
img11
from
'
@/assets/images/order/11.png
'
;
import
img21
from
'
@/assets/images/order/21.png
'
;
import
img21
from
'
@/assets/images/order/21.png
'
;
...
@@ -162,13 +163,17 @@ export default {
...
@@ -162,13 +163,17 @@ export default {
orderNo
:
this
.
orderNo
orderNo
:
this
.
orderNo
};
};
},
},
payType
()
{
return
this
.
orderInfo
.
orderDetail
.
payType
===
1
?
'
微信
'
:
'
支付宝
'
;
},
isKeyChange
()
{
isKeyChange
()
{
return
this
.
currentOrder
.
virtualChargeAttrs
&&
this
.
currentOrder
.
virtualChargeAttrs
.
cardKey
;
return
this
.
currentOrder
.
virtualChargeAttrs
&&
this
.
currentOrder
.
virtualChargeAttrs
.
cardKey
;
}
}
},
},
beforeRouteLeave
(
from
,
to
,
next
)
{
if
(
isBack
()
||
from
.
path
.
indexOf
(
'
pay
'
)
>
-
1
)
{
window
.
location
.
href
=
window
.
location
.
origin
;
}
else
{
next
();
}
},
mounted
()
{
mounted
()
{
this
.
orderNo
=
this
.
$route
.
query
.
orderNo
;
this
.
orderNo
=
this
.
$route
.
query
.
orderNo
;
this
.
getDetail
();
this
.
getDetail
();
...
...
src/views/pay/extends.js
View file @
1ff2ddb7
...
@@ -27,7 +27,7 @@ export const goUrlExtends = {
...
@@ -27,7 +27,7 @@ export const goUrlExtends = {
window
.
location
.
replace
=
`
${
toBHost
}
/orderDetail?orderNo=
${
orderNo
}
`
;
window
.
location
.
replace
=
`
${
toBHost
}
/orderDetail?orderNo=
${
orderNo
}
`
;
return
;
return
;
}
}
this
.
$router
.
replace
({
this
.
$router
.
push
({
name
:
'
orderDetail
'
,
name
:
'
orderDetail
'
,
query
:
{
orderNo
}
query
:
{
orderNo
}
});
});
...
...
src/views/pay/payWaiting.vue
View file @
1ff2ddb7
...
@@ -73,7 +73,7 @@ export default {
...
@@ -73,7 +73,7 @@ export default {
},
},
goSuccess
()
{
goSuccess
()
{
// 支付成功
// 支付成功
this
.
$router
.
replace
({
name
:
'
paySuccess
'
});
this
.
$router
.
push
({
name
:
'
paySuccess
'
});
},
},
goPay
()
{
goPay
()
{
this
.
$router
.
replace
({
name
:
'
pay
'
,
query
:
{
orderNo
:
this
.
orderNo
}
});
this
.
$router
.
replace
({
name
:
'
pay
'
,
query
:
{
orderNo
:
this
.
orderNo
}
});
...
@@ -81,7 +81,7 @@ export default {
...
@@ -81,7 +81,7 @@ export default {
async
query
()
{
async
query
()
{
const
[
data
,
error
]
=
await
queryPayStatus
({
orderNo
:
this
.
orderNo
});
const
[
data
,
error
]
=
await
queryPayStatus
({
orderNo
:
this
.
orderNo
});
if
(
error
)
{
if
(
error
)
{
this
.
$router
.
replace
({
this
.
$router
.
push
({
name
:
'
payFail
'
,
name
:
'
payFail
'
,
query
:
{
reason
:
error
.
message
,
orderNo
:
this
.
orderNo
}
query
:
{
reason
:
error
.
message
,
orderNo
:
this
.
orderNo
}
});
});
...
...
src/views/vipLife/components/SpuList.vue
View file @
1ff2ddb7
...
@@ -4,6 +4,7 @@
...
@@ -4,6 +4,7 @@
<div
<div
v-for=
"(item, index) in list"
v-for=
"(item, index) in list"
:key=
"index"
:key=
"index"
ref=
"spuItem"
class=
"Vl__spu-item"
class=
"Vl__spu-item"
:class=
"
{ 'Vl__spu-item_active': info.spuNos === item.spuNos }"
:class=
"
{ 'Vl__spu-item_active': info.spuNos === item.spuNos }"
@click="handleSpuClick($event, item, index)"
@click="handleSpuClick($event, item, index)"
...
@@ -48,15 +49,26 @@ export default {
...
@@ -48,15 +49,26 @@ export default {
},
},
computed
:
{
computed
:
{
contentWidth
()
{
contentWidth
()
{
return
ITEM_WIDTH
*
(
this
.
list
.
length
+
2.34
);
this
.
listWrapper
&&
this
.
$nextTick
(()
=>
{
this
.
listWrapper
.
scrollTo
(
0
,
0
);
this
.
listWrapper
.
refresh
();
});
return
ITEM_WIDTH
*
(
this
.
list
.
length
+
2.28
);
}
}
},
},
watch
:
{
watch
:
{
contentWidth
()
{
info
:
{
this
.
$nextTick
(()
=>
{
deep
:
true
,
this
.
listWrapper
.
scrollTo
(
0
,
0
);
handler
(
val
)
{
this
.
listWrapper
.
refresh
();
if
(
Object
.
hasOwnProperty
.
call
(
val
,
'
index
'
))
{
});
const
itemIndex
=
this
.
list
.
findIndex
(
item
=>
item
.
index
===
val
.
index
);
if
(
itemIndex
===
-
1
)
return
;
this
.
$nextTick
(()
=>
{
this
.
handleSpuClick
(
this
.
$refs
.
spuItem
[
itemIndex
],
val
,
itemIndex
);
});
}
}
}
}
},
},
...
@@ -84,7 +96,7 @@ export default {
...
@@ -84,7 +96,7 @@ export default {
},
},
handleSpuClick
(
e
,
item
,
index
)
{
handleSpuClick
(
e
,
item
,
index
)
{
this
.
$parent
.
handleSpuSelected
(
item
,
index
);
this
.
$parent
.
handleSpuSelected
(
item
,
index
);
const
target
=
e
.
path
.
find
(
item
=>
item
.
className
.
indexOf
(
'
Vl__spu-item
'
)
>
-
1
)
;
const
target
=
e
.
path
?
e
.
path
.
find
(
item
=>
item
.
className
.
indexOf
(
'
Vl__spu-item
'
)
>
-
1
)
:
e
;
this
.
listWrapper
.
scrollToElement
(
target
,
500
,
-
10
,
0
);
this
.
listWrapper
.
scrollToElement
(
target
,
500
,
-
10
,
0
);
}
}
}
}
...
...
src/views/vipLife/index.vue
View file @
1ff2ddb7
...
@@ -18,6 +18,10 @@
...
@@ -18,6 +18,10 @@
<div
class=
"Vl__panel-title"
>
{{
tips
.
title
}}
</div>
<div
class=
"Vl__panel-title"
>
{{
tips
.
title
}}
</div>
<div
class=
"Vl__panel-tips"
v-html=
"tips.content"
/>
<div
class=
"Vl__panel-tips"
v-html=
"tips.content"
/>
</
template
>
</
template
>
<div
class=
"Vl__panel-title"
>
温馨提示
</div>
<div
class=
"Vl__panel-tips"
>
<p>
充值类商品售出后无法进行退换,非充值用户请谨慎购买。
</p>
</div>
</div>
</div>
<div
class=
"Vl__bottom"
>
<div
class=
"Vl__bottom"
>
<cr-button
type=
"primary"
block
shape=
"circle"
:disabled=
"disabled"
@
click=
"goOrder"
>
<cr-button
type=
"primary"
block
shape=
"circle"
:disabled=
"disabled"
@
click=
"goOrder"
>
...
@@ -61,12 +65,15 @@ export default {
...
@@ -61,12 +65,15 @@ export default {
return
(
this
.
spuInfo
.
rechargeAccountType
!==
2
&&
!
this
.
account
)
||
!
this
.
skuList
.
length
;
return
(
this
.
spuInfo
.
rechargeAccountType
!==
2
&&
!
this
.
account
)
||
!
this
.
skuList
.
length
;
},
},
spuList
()
{
spuList
()
{
return
this
.
spuData
[
this
.
currentTab
-
1
]
?
this
.
spuData
[
this
.
currentTab
-
1
].
itemList
:
[];
let
spuList
=
[];
this
.
spuData
.
forEach
((
item
,
index
)
=>
{
item
.
itemList
[
0
].
index
=
index
;
spuList
=
[...
spuList
,
...
item
.
itemList
];
});
return
spuList
;
},
},
tips
()
{
tips
()
{
return
this
.
spuInfo
.
type
return
this
.
spuInfo
.
type
?
tipsData
[
this
.
spuInfo
.
type
]
:
{};
?
tipsData
[
this
.
spuInfo
.
type
]
||
tipsData
[
+
(
''
+
this
.
spuInfo
.
type
)[
0
]]
||
{}
:
{};
}
}
},
},
mounted
()
{
mounted
()
{
...
@@ -104,6 +111,7 @@ export default {
...
@@ -104,6 +111,7 @@ export default {
async
getList
()
{
async
getList
()
{
const
[
res
]
=
await
rechargeApi
.
getSpuList
();
const
[
res
]
=
await
rechargeApi
.
getSpuList
();
if
(
res
)
{
if
(
res
)
{
this
.
account
=
res
.
userPhoneInfo
.
phoneNo
;
this
.
spuData
=
res
.
vipLife
;
this
.
spuData
=
res
.
vipLife
;
this
.
updateSpuInfo
(
this
.
spuData
[
this
.
currentTab
-
1
].
itemList
[
0
]);
this
.
updateSpuInfo
(
this
.
spuData
[
this
.
currentTab
-
1
].
itemList
[
0
]);
this
.
getSkuListDebounce
();
this
.
getSkuListDebounce
();
...
...
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