Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mayi-mp-shop
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
程默
mayi-mp-shop
Commits
07891c22
Commit
07891c22
authored
May 26, 2020
by
程智春
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
5.26
parent
609814e2
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
31 additions
and
6 deletions
+31
-6
ext.json
+4
-1
src/App.vue
+15
-0
src/pages/index/index.vue
+3
-2
src/pages/liveList/index.vue
+0
-2
src/store/mutations.js
+3
-0
src/store/state.js
+3
-0
src/utils/request.js
+3
-1
No files found.
ext.json
View file @
07891c22
...
...
@@ -2,5 +2,7 @@
{
"extEnable"
:
true
,
"extAppid"
:
"wxae95a07ffdf11548"
,
"directCommit"
:
true
"ext"
:{
"mixid"
:
"antgood"
}
}
\ No newline at end of file
src/App.vue
View file @
07891c22
<
script
>
export
default
{
created
()
{
let
extConfig
=
wx
.
getExtConfigSync
?
wx
.
getExtConfigSync
():
{}
this
.
$store
.
commit
(
"setExtConfig"
,
extConfig
.
mixid
);
// if (wx.getExtConfig) {
// wx.getExtConfig({
// success : (res) => {
// if(res.errMsg == 'getExtConfig: ok'){
// this.$store.commit("setExtConfig", res.extConfig.mixid);
// }
// }
// })
// }
// 调用API从本地缓存中获取数据
/*
* 平台 api 差异的处理方式: api 方法统一挂载到 mpvue 名称空间, 平台判断通过 mpvuePlatform 特征字符串
...
...
src/pages/index/index.vue
View file @
07891c22
...
...
@@ -11,7 +11,7 @@ import { serialize, getQueryVariable, DFSImg } from "@/utils/index";
export
default
{
data
()
{
return
{
shopId
:
process
.
env
.
SHOP_MIXID
,
shopId
:
this
.
$store
.
state
.
mixid
,
options
:
{},
session_key
:
""
,
baseUrl
:
process
.
env
.
BASE_URL
,
...
...
@@ -53,7 +53,8 @@ export default {
"index------"
,
this
.
shopId
,
"-----"
,
wx
.
getStorageSync
(
"openid"
)
wx
.
getStorageSync
(
"openid"
),
this
.
shopId
);
//检测登录态
this
.
checkLogin
();
...
...
src/pages/liveList/index.vue
View file @
07891c22
...
...
@@ -114,8 +114,6 @@ export default {
code
:
''
,
shopId
:
process
.
env
.
SHOP_MIXID
,
baseUrl
:
process
.
env
.
BASE_URL
,
}
...
...
src/store/mutations.js
View file @
07891c22
...
...
@@ -32,6 +32,9 @@ const mutations = {
wx
.
clearStorage
()
state
.
isLogin
=
0
;
state
.
userInfo
=
null
;
},
setExtConfig
(
state
,
obj
){
state
.
mixid
=
obj
}
};
...
...
src/store/state.js
View file @
07891c22
...
...
@@ -20,5 +20,7 @@ const state = {
offlineShopCode
:
""
,
isLogin
,
userInfo
,
mixid
:
''
,
};
export
default
state
\ No newline at end of file
src/utils/request.js
View file @
07891c22
import
store
from
'../store/index'
let
shopMixid
=
process
.
env
.
SHOP_MIXID
;
console
.
log
(
store
.
state
.
mixid
,
'store.state'
)
let
shopMixid
=
store
.
state
.
mixid
;
// wx.getStore
export
async
function
requestGET
(
url
,
options
)
{
...
...
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