Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
yoho-miniapp-eshop
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
李奇
7 years ago
Commit
8d94f477fdeafe970535463fa7949d772f75e23b
1 parent
18b52c4d
webview逻辑修改
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
72 additions
and
23 deletions
app/common/api.js
app/models/account/index.js
app/models/cart/cart.js
app/models/cart/ensure.js
app/models/common.js
app/models/home/address.js
app/models/home/index.js
app/models/home/order.js
app/models/index/index.js
app/models/pay/pay.js
app/models/product/detail.js
app/models/product/list.js
app/models/product/search.js
app/models/product/shop.js
app/models/resources/index.js
app/models/shop/category.js
app/pages/webview/webview.js
app/project.config.json
app/common/api.js
View file @
8d94f47
...
...
@@ -174,4 +174,7 @@ const api = {
}
};
export
default
api
;
module
.
exports
=
{
api
,
verify
};
...
...
app/models/account/index.js
View file @
8d94f47
import
api
from
'../../common/api'
;
import
config
from
'../../config'
;
import
{
api
}
from
'../../common/api'
;
export
default
{
/**
...
...
app/models/cart/cart.js
View file @
8d94f47
import
api
from
'../../common/api'
;
import
{
api
}
from
'../../common/api'
;
export
default
{
/**
...
...
app/models/cart/ensure.js
View file @
8d94f47
import
api
from
'../../common/api'
;
import
{
api
}
from
'../../common/api'
;
export
default
{
/**
...
...
app/models/common.js
View file @
8d94f47
import
api
from
'../common/api'
;
import
{
api
}
from
'../common/api'
;
export
default
{
/**
...
...
@@ -26,5 +26,19 @@ export default {
method
:
'app.shops.union'
},
params
)
});
},
/**
* 通过AppId查绑定店铺
* @param params
* @returns {*}
*/
getMiniAppRealParam
(
code
)
{
return
api
.
get
({
url
:
'/wechat/miniapp/getMiniAppRealParam'
,
data
:
{
code
}
});
}
};
...
...
app/models/home/address.js
View file @
8d94f47
import
api
from
'../../common/api'
;
import
{
api
}
from
'../../common/api'
;
export
default
{
/**
...
...
app/models/home/index.js
View file @
8d94f47
import
api
from
'../../common/api'
;
import
{
api
}
from
'../../common/api'
;
export
default
{
/**
...
...
app/models/home/order.js
View file @
8d94f47
import
api
from
'../../common/api'
;
import
{
api
}
from
'../../common/api'
;
export
default
{
/**
...
...
app/models/index/index.js
View file @
8d94f47
import
api
from
'../../common/api'
;
import
{
api
}
from
'../../common/api'
;
export
default
{
/**
...
...
app/models/pay/pay.js
View file @
8d94f47
import
api
from
'../../common/api'
;
import
{
api
}
from
'../../common/api'
;
export
default
{
/**
...
...
app/models/product/detail.js
View file @
8d94f47
import
api
from
'../../common/api'
;
import
{
api
}
from
'../../common/api'
;
export
default
{
/**
...
...
app/models/product/list.js
View file @
8d94f47
import
api
from
'../../common/api'
;
import
{
api
}
from
'../../common/api'
;
export
default
{
/**
...
...
app/models/product/search.js
View file @
8d94f47
import
api
from
'../../common/api'
;
import
{
api
}
from
'../../common/api'
;
export
default
{
/**
...
...
app/models/product/shop.js
View file @
8d94f47
import
api
from
'../../common/api'
;
import
{
api
}
from
'../../common/api'
;
export
default
{
shopList
()
{
...
...
app/models/resources/index.js
View file @
8d94f47
import
api
from
'../../common/api'
;
import
{
api
}
from
'../../common/api'
;
export
default
{
getContent
(
content_code
)
{
...
...
app/models/shop/category.js
View file @
8d94f47
import
api
from
'../../common/api'
;
import
{
api
}
from
'../../common/api'
;
export
default
{
shopSort
(
params
)
{
...
...
app/pages/webview/webview.js
View file @
8d94f47
import
config
from
'../../config'
;
import
{
verify
}
from
'../../common/api'
;
import
commonModel
from
'../../models/common'
;
Page
({
data
:
{
url
:
''
,
...
...
@@ -5,8 +9,19 @@ Page({
},
onLoad
:
function
(
options
)
{
this
.
loadElement
(
options
);
if
(
options
&&
options
.
scene
&&
options
.
scene
.
length
>
0
)
{
let
code
=
options
.
scene
;
return
commonModel
.
getMiniAppRealParam
(
code
)
.
then
(
json
=>
{
if
(
json
)
{
this
.
load
(
json
);
}
})
.
catch
(()
=>
{});
}
this
.
load
(
options
);
},
onShareAppMessage
:
function
()
{
...
...
@@ -16,11 +31,28 @@ Page({
};
},
loadElement
:
function
(
options
)
{
this
.
setData
({
title
:
options
.
title
,
url
:
decodeURIComponent
(
options
.
url
)
});
load
:
function
(
options
)
{
let
app
=
getApp
();
let
url
=
options
.
url
;
if
(
options
&&
options
.
url
)
{
let
params
=
{};
let
sys
=
wx
.
getSystemInfoSync
();
params
.
uid
=
app
.
getUid
();
params
.
udid
=
app
.
_getSync
(
'udid'
);
params
.
session_key
=
app
.
_getSync
(
'sessionKey'
);
params
.
app_version
=
config
.
apiParams
.
app_version
;
params
.
client_type
=
config
.
apiParams
.
client_type
;
params
.
screen_size
=
`
$
{
sys
.
windowWidth
}
x$
{
sys
.
windowHeight
}
`
;
params
.
os_version
=
sys
.
version
;
verify
.
sign
(
params
);
this
.
setData
({
url
:
decodeURIComponent
(
`
$
{
url
}
`
)
});
}
},
bindGetMsg
:
function
(
e
)
{
...
...
app/project.config.json
View file @
8d94f47
...
...
@@ -29,7 +29,7 @@
"list"
:
[]
},
"miniprogram"
:
{
"current"
:
1
,
"current"
:
-
1
,
"list"
:
[
{
"id"
:
-1
,
...
...
Please
register
or
login
to post a comment