Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
singleStore
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
CI / CD Analytics
Repository Analytics
Value Stream Analytics
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Max
singleStore
Commits
d487ee16
Commit
d487ee16
authored
Sep 03, 2021
by
June
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:弹窗异步问题以及登录失效bug
parent
ac968755
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
53 additions
and
30 deletions
+53
-30
App.vue
App.vue
+2
-3
components/uni-popup/index.vue
components/uni-popup/index.vue
+5
-4
lib/service/index.js
lib/service/index.js
+4
-0
pages/category/index.vue
pages/category/index.vue
+3
-2
pages/goods/components/bottom_bar.vue
pages/goods/components/bottom_bar.vue
+10
-2
pages/goods/detail.vue
pages/goods/detail.vue
+18
-1
pages/home/components/goods-module.vue
pages/home/components/goods-module.vue
+3
-3
pages/home/index.vue
pages/home/index.vue
+3
-3
pages/mine/index.vue
pages/mine/index.vue
+1
-7
pages/search/list.vue
pages/search/list.vue
+4
-5
No files found.
App.vue
View file @
d487ee16
...
...
@@ -5,6 +5,7 @@ import dayjs from 'dayjs'
import
{
removeStorage
}
from
'
@/lib/storage/index.js
'
export
default
{
onLaunch
:
async
function
()
{
await
this
.
checkUpdate
()
// 检查更新
this
.
setMobileData
()
// 获取系统信息和胶囊信息
const
extConfig
=
wx
.
getExtConfigSync
?
wx
.
getExtConfigSync
():
{}
this
.
$store
.
state
.
user
.
appid
=
extConfig
.
appid
...
...
@@ -23,9 +24,7 @@ export default {
removeStorage
(
'
search-history
'
)
}
}
})
this
.
checkUpdate
()
// 检查更新
})
},
globalData
:
{
...
...
components/uni-popup/index.vue
View file @
d487ee16
...
...
@@ -127,10 +127,11 @@
open
()
{
this
.
showPopup
=
true
this
.
$nextTick
(()
=>
{
clearTimeout
(
this
.
timer
)
this
.
timer
=
setTimeout
(()
=>
{
this
.
showTrans
=
true
},
50
);
this
.
showTrans
=
true
// clearTimeout(this.timer)
// this.timer = setTimeout(() => {
// this.showTrans = true
// }, 50);
})
this
.
$emit
(
'
popchange
'
,
{
show
:
true
...
...
lib/service/index.js
View file @
d487ee16
...
...
@@ -4,6 +4,7 @@ import { isObeject, isFunction } from "@/utils/types.js"
import
Validator
from
"
@/utils/validate.js
"
import
{
login_slilen
}
from
'
@/utils/modules/login.js
'
import
store
from
'
@/store/index.js
'
import
{
removeStorage
}
from
'
@/lib/storage
'
/**
* @desc 请求 所有的状态码都在这里处理
...
...
@@ -54,6 +55,9 @@ async function successRes(res, options, resolve, reject) {
return
Toast
({
title
:
data
.
rep_msg
})
break
;
case
-
3
:
store
.
state
.
user
.
token
=
''
store
.
state
.
userInfo
=
{}
removeStorage
(
'
token
'
)
Toast
({
title
:
'
登录已失效,请重新登录
'
,
cb
:
()
=>
uni
.
navigateTo
({
...
...
pages/category/index.vue
View file @
d487ee16
...
...
@@ -138,6 +138,7 @@ import { searchGoods, goodsSku } from '@/apis/goods.js'
import
{
baseUrl
}
from
'
@/config/index.js
'
import
common_share
from
'
@/mixins/setting_share.js
'
import
{
mapState
,
mapActions
}
from
'
vuex
'
import
{
debounce
}
from
'
@/utils/common.js
'
let
cat_id
=
0
export
default
{
...
...
@@ -245,7 +246,7 @@ export default {
// },
// 点击拉起弹窗
async
handlePop
(
goods
)
{
handlePop
:
debounce
(
async
function
(
goods
)
{
try
{
uni
.
showLoading
({
title
:
'
加载中...
'
,
...
...
@@ -272,7 +273,7 @@ export default {
uni
.
hideLoading
()
//TODO handle the exception
}
}
}
,
800
)
}
}
// disableScroll: true
...
...
pages/goods/components/bottom_bar.vue
View file @
d487ee16
...
...
@@ -61,9 +61,17 @@
this
.
$checkLogin
(
makePhoneCall
)
},
changePopup
:
throttle
(
function
()
{
changePopup
()
{
uni
.
showLoading
({
title
:
'
加载中...
'
,
mask
:
true
})
this
.
$parent
.
handlePopup
()
}),
let
timer
=
setTimeout
(()
=>
{
clearTimeout
(
timer
)
uni
.
hideLoading
()
},
300
)
},
// 收藏商品
changeCollect
()
{
...
...
pages/goods/detail.vue
View file @
d487ee16
...
...
@@ -330,7 +330,24 @@ export default {
res
.
eventChannel
.
emit
(
'
acceptDataFromOpenerPage
'
,
{
detail
:
this
.
detail
,
skuData
:
this
.
skuData
})
}
})
}
},
// sku弹窗
// handlePopup: debounce(function() {
// const skuData = this.skuData
// const detail = this.detail
// if(!skuData || !skuData.length) return this.$toast({title: '该商品暂无库存'})
// const params = {
// goodsInfo: {
// cover: `${this.baseUrl}/${detail.goods_thumb}`,
// title: detail.goods_name,
// is_inquiry: detail.is_inquiry,
// unit: skuData[0].unit
// },
// skuData: skuData
// }
// this.$refs.popup.show(params)
// }, 800)
}
}
</
script
>
...
...
pages/home/components/goods-module.vue
View file @
d487ee16
...
...
@@ -41,6 +41,7 @@
import
price
from
'
@/components/price/index.vue
'
import
{
goodsSku
}
from
'
@/apis/goods.js
'
import
{
baseUrl
}
from
'
@/config/index.js
'
import
{
debounce
}
from
'
@/utils/common.js
'
export
default
{
props
:
{
title
:
{
...
...
@@ -64,7 +65,7 @@ export default {
},
methods
:
{
async
handlePop
(
goods
)
{
handlePop
:
debounce
(
async
function
(
goods
)
{
try
{
uni
.
showLoading
({
title
:
'
加载中...
'
,
...
...
@@ -91,7 +92,7 @@ export default {
uni
.
hideLoading
()
//TODO handle the exception
}
}
}
,
800
)
}
}
</
script
>
...
...
@@ -116,7 +117,6 @@ export default {
.cart-btn
{
width
:
34rpx
;
height
:
32rpx
;
padding
:
0
20rpx
;
}
}
}
...
...
pages/home/index.vue
View file @
d487ee16
...
...
@@ -193,7 +193,7 @@ import LoadMore from '@/utils/load-more.js'
import
{
checkLogin
}
from
'
@/utils/modules/login.js
'
import
indexModule
from
'
./index.js
'
import
{
baseUrl
}
from
'
@/config/index.js
'
import
{
makePhoneCall
,
throttle
}
from
'
@/utils/common.js
'
import
{
makePhoneCall
,
throttle
,
debounce
}
from
'
@/utils/common.js
'
import
{
goodsSku
}
from
'
@/apis/goods.js
'
import
{
mapState
,
mapActions
}
from
'
vuex
'
import
common_share
from
'
@/mixins/setting_share.js
'
...
...
@@ -334,7 +334,7 @@ export default {
},
// 点击拉起弹窗
async
handlePop
(
goods
)
{
handlePop
:
debounce
(
async
function
(
goods
)
{
try
{
uni
.
showLoading
({
title
:
'
加载中...
'
,
...
...
@@ -359,7 +359,7 @@ export default {
uni
.
hideLoading
()
//TODO handle the exception
}
}
}
,
800
)
}
}
</
script
>
...
...
pages/mine/index.vue
View file @
d487ee16
...
...
@@ -126,8 +126,7 @@ export default {
wait_receive
:
0
,
wait_send
:
0
},
commentCounts
:
0
,
version
:
''
commentCounts
:
0
}
},
...
...
@@ -138,11 +137,6 @@ export default {
})
},
created
()
{
const
accountInfo
=
uni
.
getAccountInfoSync
()
this
.
version
=
accountInfo
.
miniProgram
.
version
},
onShow
()
{
// 获取更新用户信息
this
.
init
()
},
...
...
pages/search/list.vue
View file @
d487ee16
...
...
@@ -137,12 +137,11 @@ import price from '@/components/price/index.vue'
import
{
searchGoods
,
goodsSku
}
from
'
@/apis/goods.js
'
import
LoadMore
from
'
@/utils/load-more.js
'
import
{
baseUrl
}
from
'
@/config/index
.js
'
import
{
debounce
}
from
'
@/utils/common
.js
'
export
default
{
data
()
{
return
{
baseUrl
,
searchList
:
[],
current_tab
:
1
,
// sort参数从1开始,为了方便
searchParams
:
{
...
...
@@ -243,7 +242,7 @@ export default {
},
// 点击拉起弹窗
async
handlePop
(
goods
)
{
handlePop
:
debounce
(
async
function
(
goods
)
{
try
{
uni
.
showLoading
({
title
:
'
加载中...
'
,
...
...
@@ -268,7 +267,7 @@ export default {
uni
.
hideLoading
()
//TODO handle the exception
}
}
}
,
800
)
}
}
</
script
>
...
...
@@ -392,7 +391,7 @@ export default {
.cart-icon
{
width
:
44rpx
;
height
:
42rpx
;
padding
:
5rpx
20rpx
;
padding
:
5rpx
0
;
}
}
}
...
...
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