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
bb91e74b
Commit
bb91e74b
authored
Jan 04, 2020
by
程默
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
init
parent
f9fb9378
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
102 additions
and
38 deletions
+102
-38
config/dev.env.js
+1
-0
project.config.json
+13
-2
src/pages/address/index.vue
+21
-9
src/pages/index/index.vue
+67
-27
No files found.
config/dev.env.js
View file @
bb91e74b
...
@@ -6,6 +6,7 @@ module.exports = merge(prodEnv, {//zjgyl
...
@@ -6,6 +6,7 @@ module.exports = merge(prodEnv, {//zjgyl
SHOP_MIXID
:
"'antgood'"
,
SHOP_MIXID
:
"'antgood'"
,
NODE_ENV
:
'"development"'
,
NODE_ENV
:
'"development"'
,
// BASE_URL:"'https://shop.mayi888.com'",
// BASE_URL:"'https://shop.mayi888.com'",
// BASE_URL:"'http://192.168.1.146:3005'",
BASE_URL
:
"'https://test-m-shop.mayi888.cn'"
,
BASE_URL
:
"'https://test-m-shop.mayi888.cn'"
,
OLSHOP_URL
:
'"https://test-m-shop.mayi888.cn/innerApi/shopApiService"'
,
OLSHOP_URL
:
'"https://test-m-shop.mayi888.cn/innerApi/shopApiService"'
,
...
...
project.config.json
View file @
bb91e74b
...
@@ -20,7 +20,7 @@
...
@@ -20,7 +20,7 @@
},
},
"miniprogramRoot"
:
"dist/wx/"
,
"miniprogramRoot"
:
"dist/wx/"
,
"compileType"
:
"miniprogram"
,
"compileType"
:
"miniprogram"
,
"appid"
:
"wx
ae95a07ffdf11548
"
,
"appid"
:
"wx
dec983ee91e2422a
"
,
"projectname"
:
"mayi-mp-shop"
,
"projectname"
:
"mayi-mp-shop"
,
"simulatorType"
:
"wechat"
,
"simulatorType"
:
"wechat"
,
"simulatorPluginLibVersion"
:
{},
"simulatorPluginLibVersion"
:
{},
...
@@ -41,8 +41,12 @@
...
@@ -41,8 +41,12 @@
"currentL"
:
-1
,
"currentL"
:
-1
,
"list"
:
[]
"list"
:
[]
},
},
"gamePlugin"
:
{
"current"
:
-1
,
"list"
:
[]
},
"miniprogram"
:
{
"miniprogram"
:
{
"current"
:
0
,
"current"
:
-1
,
"list"
:
[
"list"
:
[
{
{
"id"
:
0
,
"id"
:
0
,
...
@@ -57,6 +61,13 @@
...
@@ -57,6 +61,13 @@
"pathName"
:
"pages/login/main"
,
"pathName"
:
"pages/login/main"
,
"query"
:
""
,
"query"
:
""
,
"scene"
:
null
"scene"
:
null
},
{
"id"
:
2
,
"name"
:
"pages/index/main"
,
"pathName"
:
"pages/index/main"
,
"query"
:
"scene=pid_6141"
,
"scene"
:
1047
}
}
]
]
}
}
...
...
src/pages/address/index.vue
View file @
bb91e74b
<
template
>
<
template
>
<div
class=
"domain"
>
获取微信地址
</div>
<div
class=
"domain"
>
获取微信地址
</div>
<!--
{{
address
}}
----
{{
openid
}}
-->
<!--
{{
address
}}
----
{{
openid
}}
--
{{
options
}}
--
>
</
template
>
</
template
>
<
script
>
<
script
>
...
@@ -44,7 +44,6 @@ export default {
...
@@ -44,7 +44,6 @@ export default {
this
.
init
();
this
.
init
();
},
},
onShow
()
{
onShow
()
{
console
.
log
(
"onshow"
,
this
.
openSetting
);
if
(
this
.
openSetting
)
{
if
(
this
.
openSetting
)
{
this
.
openSetting
=
false
;
this
.
openSetting
=
false
;
this
.
init
();
this
.
init
();
...
@@ -65,7 +64,7 @@ export default {
...
@@ -65,7 +64,7 @@ export default {
fail
:
function
(
res
)
{
fail
:
function
(
res
)
{
// chooseAddress:fail auth deny ---用户拒绝后msg
// chooseAddress:fail auth deny ---用户拒绝后msg
// chooseAddress:fail cancel ---用户点击取消按钮
// chooseAddress:fail cancel ---用户点击取消按钮
console
.
log
(
res
,
"-------------------65"
);
console
.
log
(
res
,
"-------------------65"
,
that
.
options
);
//用户取消
//用户取消
console
.
log
(
5
);
console
.
log
(
5
);
if
(
res
.
errMsg
.
indexOf
(
"cancel"
)
!=
-
1
)
{
if
(
res
.
errMsg
.
indexOf
(
"cancel"
)
!=
-
1
)
{
...
@@ -180,6 +179,25 @@ export default {
...
@@ -180,6 +179,25 @@ export default {
}
}
});
});
console
.
log
(
this
.
areaResult
,
this
.
userAddressReq
,
'====='
)
//是否直接返回地址信息
if
(
this
.
options
.
refresh
)
{
// this.options.back+=`&wxAddress=${encodeURIComponent(JSON.stringify(this.userAddressReq))}`
let
url
=
this
.
options
.
back
;
url
+=
encodeURIComponent
(
`&wxAddress=
${
JSON
.
stringify
(
this
.
userAddressReq
)}
`
);
console
.
log
(
'refresh'
,
url
)
setTimeout
(()
=>
{
wx
.
reLaunch
({
url
:
`../index/main?from=address&backpath=
${
url
}
`
});
},
200
);
}
else
{
this
.
addAdressRequest
();
}
}
},
addAdressRequest
()
{
addres
addres
.
getUserAddressList
()
.
getUserAddressList
()
.
then
(
res
=>
{
.
then
(
res
=>
{
...
@@ -196,11 +214,6 @@ export default {
...
@@ -196,11 +214,6 @@ export default {
if
(
res
.
data
.
code
==
200
)
{
if
(
res
.
data
.
code
==
200
)
{
console
.
log
(
"!!!!!!!!!!!!!"
,
this
.
options
.
back
);
console
.
log
(
"!!!!!!!!!!!!!"
,
this
.
options
.
back
);
console
.
log
(
"微信地址"
,
this
.
userAddressReq
);
console
.
log
(
"微信地址"
,
this
.
userAddressReq
);
// setTimeout(() => {
// wx.reLaunch({
// url: `../index/main?from=address&backpath=${this.options.back}`
// });
// }, 200);
}
else
{
}
else
{
}
}
...
@@ -222,7 +235,6 @@ export default {
...
@@ -222,7 +235,6 @@ export default {
});
});
}
}
}
}
}
};
};
</
script
>
</
script
>
...
...
src/pages/index/index.vue
View file @
bb91e74b
...
@@ -33,14 +33,21 @@ export default {
...
@@ -33,14 +33,21 @@ export default {
newHref
:
""
,
newHref
:
""
,
shareShopName
:
""
,
shareShopName
:
""
,
shareLogoUrl
:
""
,
shareLogoUrl
:
""
,
sharePathStr
:
"goods/"
shareOrderSn
:
""
,
shareTid
:
""
,
sharePageList
:
[
"goods/"
,
"receivingGift"
,
"orderDetail"
]
};
};
},
},
onLoad
(
options
)
{
onLoad
(
options
)
{
Object
.
assign
(
this
.
$data
,
this
.
$options
.
data
());
Object
.
assign
(
this
.
$data
,
this
.
$options
.
data
());
console
.
log
(
console
.
log
(
options
,
"index------"
,
this
.
shopId
,
'-----'
,
wx
.
getStorageSync
(
"openid"
));
options
,
//检测
"index------"
,
this
.
shopId
,
"-----"
,
wx
.
getStorageSync
(
"openid"
)
);
//检测登录态
this
.
checkLogin
();
this
.
checkLogin
();
this
.
options
=
options
;
this
.
options
=
options
;
...
@@ -70,11 +77,10 @@ export default {
...
@@ -70,11 +77,10 @@ export default {
data
:
params
.
sessionid
data
:
params
.
sessionid
});
});
}
else
if
(
options
.
from
&&
options
.
from
==
"login"
)
{
}
else
if
(
options
.
from
&&
options
.
from
==
"login"
)
{
//来自登录页面
//来自
小程序
登录页面
this
.
page
=
decodeURIComponent
(
options
.
backpath
);
this
.
page
=
decodeURIComponent
(
options
.
backpath
);
this
.
params
+=
"&"
+
decodeURIComponent
(
options
.
params
);
this
.
params
+=
"&"
+
decodeURIComponent
(
options
.
params
)
+
"&"
;
}
else
if
(
options
.
from
&&
options
.
from
==
"logout"
)
{
}
else
if
(
options
.
from
&&
options
.
from
==
"logout"
)
{
console
.
log
(
"退出-------------"
);
//来自用户登出
//来自用户登出
wx
.
removeStorage
({
wx
.
removeStorage
({
key
:
"sessionid"
key
:
"sessionid"
...
@@ -83,10 +89,9 @@ export default {
...
@@ -83,10 +89,9 @@ export default {
key
:
"openid"
key
:
"openid"
});
});
}
else
if
(
options
.
from
&&
options
.
from
==
"address"
)
{
}
else
if
(
options
.
from
&&
options
.
from
==
"address"
)
{
// 来自小程序地址页面
this
.
link
=
decodeURIComponent
(
options
.
backpath
);
this
.
link
=
decodeURIComponent
(
options
.
backpath
);
console
.
log
(
'adress'
,
options
.
backpath
,
this
.
link
)
console
.
log
(
"???"
,
this
.
link
);
this
.
page
=
""
;
this
.
page
=
""
;
this
.
params
=
""
;
this
.
params
=
""
;
}
else
if
(
options
.
from
==
"wxPay"
)
{
}
else
if
(
options
.
from
==
"wxPay"
)
{
...
@@ -97,16 +102,27 @@ export default {
...
@@ -97,16 +102,27 @@ export default {
//来自扫码
//来自扫码
// options 中的scene需要使用decodeURIComponent才能获取到生成二维码时传入的scene
// options 中的scene需要使用decodeURIComponent才能获取到生成二维码时传入的scene
var
scene
=
decodeURIComponent
(
options
.
scene
);
//参数二维码传递过来的参数
var
scene
=
decodeURIComponent
(
options
.
scene
);
//参数二维码传递过来的参数
var
query
=
options
.
query
.
dentistId
;
// 参数二维码传递过来的场景参数
let
querys
=
scene
.
split
(
"_"
);
if
(
querys
)
{
if
(
querys
[
0
]
==
"pid"
)
{
//商品详情 pid_123
this
.
page
=
`/goods/
${
querys
[
1
]}
`
;
}
else
if
(
querys
[
0
]
==
"activty"
)
{
//活动页面activty_turntable_123
this
.
params
+=
`&pageInfo=
${
scene
}
`
}
}
console
.
log
(
querys
,
'scene'
);
// var query = options.query.dentistId; // 参数二维码传递过来的场景参数
}
}
console
.
log
(
"url"
,
this
.
link
+
this
.
page
+
this
.
params
);
console
.
log
(
"url"
,
this
.
link
+
this
.
page
+
this
.
params
);
this
.
getSpokesman
();
this
.
getSpokesman
();
},
},
onShow
(){
onShow
()
{
// console.log('显示了',options.webViewUrl);
// console.log('显示了',options.webViewUrl);
},
},
methods
:
{
methods
:
{
init
()
{
init
()
{
// 弃用小程序地位
let
that
=
this
;
let
that
=
this
;
// 可以通过 wx.getSetting 先查询一下用户是否授权了 "scope.record" 这个 scope
// 可以通过 wx.getSetting 先查询一下用户是否授权了 "scope.record" 这个 scope
wx
.
getSetting
({
wx
.
getSetting
({
...
@@ -125,11 +141,11 @@ export default {
...
@@ -125,11 +141,11 @@ export default {
}
}
});
});
},
},
checkLogin
(){
checkLogin
()
{
let
getOpenid
=
wx
.
getStorageSync
(
"openid"
);
let
getOpenid
=
wx
.
getStorageSync
(
"openid"
);
let
getSessionid
=
wx
.
getStorageSync
(
"sessionid"
);
let
getSessionid
=
wx
.
getStorageSync
(
"sessionid"
);
if
(
getOpenid
==
''
||
getSessionid
==
''
)
{
if
(
getOpenid
==
""
||
getSessionid
==
""
)
{
this
.
params
+=
'&logOut=true'
this
.
params
+=
"&logOut=true"
;
}
}
},
},
getLocationHandle
()
{
getLocationHandle
()
{
...
@@ -177,30 +193,54 @@ export default {
...
@@ -177,30 +193,54 @@ export default {
getMessage
(
res
)
{
getMessage
(
res
)
{
let
len
=
res
.
target
.
data
.
length
-
1
;
let
len
=
res
.
target
.
data
.
length
-
1
;
console
.
log
(
res
,
"h5消息"
,
res
.
target
.
data
[
len
]);
console
.
log
(
res
,
"h5消息"
,
res
.
target
.
data
[
len
]);
this
.
shareShopName
=
res
.
target
.
data
[
len
].
shareShopName
||
""
;
this
.
shareShopName
=
res
.
target
.
data
[
len
].
shareShopName
||
""
;
this
.
shareLogoUrl
=
res
.
target
.
data
[
len
].
shareLogoUrl
;
this
.
shareLogoUrl
=
DFSImg
(
res
.
target
.
data
[
len
].
shareLogoUrl
,
500
,
400
);
this
.
shareLogoUrl
=
DFSImg
(
this
.
shareLogoUrl
,
500
,
400
);
//分享内容中有订单信息为送礼活动
// console.log()
if
(
res
.
target
.
data
[
len
].
orderSn
)
{
console
.
log
(
this
.
shareLogoUrl
,
'logourl'
);
this
.
shareOrderSn
=
res
.
target
.
data
[
len
].
orderSn
;
this
.
shareTid
=
res
.
target
.
data
[
len
].
shareTid
;
}
console
.
log
(
"分享信息:"
,
this
.
shareLogoUrl
,
this
.
shareShopName
);
},
checkPageUrl
(
val
)
{
for
(
let
i
=
0
;
i
<
this
.
sharePageList
.
length
;
i
++
)
{
if
(
val
.
indexOf
(
this
.
sharePageList
[
i
])
!=
-
1
)
{
return
true
;
}
}
return
false
;
}
}
},
},
onUnload
()
{
onUnload
()
{
console
.
log
(
"卸载----------------"
,
this
.
options
);
console
.
log
(
"卸载----------------"
,
this
.
options
);
},
},
onShareAppMessage
(
res
)
{
onShareAppMessage
(
res
)
{
console
.
log
(
this
.
shareShopName
,
"share"
,
res
.
webViewUrl
,
'0000'
,
this
.
shareLogoUrl
);
console
.
log
(
this
.
shareShopName
,
"share"
,
res
.
webViewUrl
,
"0000"
,
this
.
shareLogoUrl
);
let
url
=
res
.
webViewUrl
;
let
url
=
res
.
webViewUrl
;
//分享页面去掉登录态
//分享页面去掉登录态
if
(
url
.
indexOf
(
"sessionid"
)
>
-
1
)
{
if
(
url
.
indexOf
(
"sessionid"
)
>
-
1
)
{
url
=
url
.
split
(
"?"
)[
0
]
+
"?mixid="
+
this
.
shopId
;
url
=
url
.
split
(
"?"
)[
0
]
+
"?mixid="
+
this
.
shopId
;
}
}
//分享页面为分类页,商品详情页外 跳转首页
//分享页面白名单 白名单以外的分享页面为首页
console
.
log
(
url
.
indexOf
(
this
.
sharePathStr
)
==
-
1
,
'good?'
)
if
(
!
this
.
checkPageUrl
(
url
))
{
if
(
url
.
indexOf
(
this
.
sharePathStr
)
==
-
1
)
{
url
=
this
.
baseUrl
+
"?mixid="
+
this
.
shopId
;
url
=
this
.
baseUrl
+
"?mixid="
+
this
.
shopId
;
}
}
console
.
log
(
"+++++"
,
this
.
shareOrderSn
);
//有订单为送礼页面
if
(
this
.
shareOrderSn
!=
""
)
{
url
=
`
${
this
.
baseUrl
}
/activty/receivingGift?mixid=
${
this
.
shopId
}
&orderSn=
${
this
.
shareOrderSn
}
&shareTid=
${
this
.
shareTid
}
`
;
}
//增加分销员信息
this
.
shareUrl
=
url
+
this
.
newHref
;
this
.
shareUrl
=
url
+
this
.
newHref
;
console
.
log
(
this
.
shareUrl
,
"index12"
);
console
.
log
(
this
.
shareUrl
,
"index12"
);
...
...
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