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
09141bd3
Commit
09141bd3
authored
Sep 17, 2023
by
李嘉林
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化
parent
9186e4df
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
80 additions
and
93 deletions
+80
-93
src/components/ThemeDataPlant.vue
+5
-4
src/pages/home/index.vue
+10
-9
src/pages/login/index.vue
+4
-0
src/pages/wxPay/index.vue
+59
-56
static/nativeComponents/Banner/index.js
+2
-24
No files found.
src/components/ThemeDataPlant.vue
View file @
09141bd3
<
template
>
<
template
>
<div
ref=
"ThemeDataPlant"
class=
"ThemeDataPlant"
:style=
"
{
<div
ref=
"ThemeDataPlant"
class=
"ThemeDataPlant"
:style=
"
{
'position': pageCode == 14 ? 'fixed' : '',
'position': pageCode == 14 ? 'fixed' : '',
'background-color':
pageSettingData.backgroundColor
,
'background-color':
imgRgb
,
'background-image': bacImage,
'background-image': bacImage,
'background-size': pageSettingData.backgroundFit != 'equiratioFill' ? '100% auto' : 'cover',
'background-size': pageSettingData.backgroundFit != 'equiratioFill' ? '100% auto' : 'cover',
'background-repeat': pageSettingData.backgroundFit == 'repeat' ? 'repeat' : 'no-repeat',
'background-repeat': pageSettingData.backgroundFit == 'repeat' ? 'repeat' : 'no-repeat',
...
@@ -51,16 +51,17 @@ export default {
...
@@ -51,16 +51,17 @@ export default {
this
.
mpApp
.
setHomeBgImg
=
this
.
setHomeBgImg
;
this
.
mpApp
.
setHomeBgImg
=
this
.
setHomeBgImg
;
},
},
mounted
()
{
mounted
()
{
this
.
bacImage
=
`url(
${
this
.
pageSettingData
.
backgroundImage
}
)`
this
.
bacImage
=
`url(
${
this
.
pageSettingData
.
backgroundImage
}
)`
;
this
.
imgRgb
=
`url(
${
this
.
pageSettingData
.
backgroundColor
}
)`
;
},
},
computed
:
{
computed
:
{
},
},
methods
:
{
methods
:
{
setHomeBgImg
({
backgroundImage
,
imgRgb
})
{
setHomeBgImg
({
backgroundImage
,
imgRgb
})
{
if
(
this
.
pageCode
!=
1
)
return
;
console
.
log
(
imgRgb
,
'-imgRgb'
)
console
.
log
(
imgRgb
,
'-imgRgb'
)
this
.
bacImage
=
backgroundImage
;
// this.bacImage = backgroundImage;
this
.
bacImage
=
""
;
this
.
imgRgb
=
imgRgb
;
this
.
imgRgb
=
imgRgb
;
}
}
}
}
...
...
src/pages/home/index.vue
View file @
09141bd3
...
@@ -488,7 +488,7 @@ export default {
...
@@ -488,7 +488,7 @@ export default {
that
.
init
(
this
.
mpApp
.
globalData
.
pageList
);
that
.
init
(
this
.
mpApp
.
globalData
.
pageList
);
}
else
{
}
else
{
this
.
mpApp
.
pageCallBack
=
function
(
params
)
{
this
.
mpApp
.
pageCallBack
=
function
(
params
)
{
console
.
log
(
"获取页面数据-2"
)
console
.
log
(
"获取页面数据-2"
,
params
)
that
.
init
(
params
);
that
.
init
(
params
);
};
};
}
}
...
@@ -641,6 +641,7 @@ export default {
...
@@ -641,6 +641,7 @@ export default {
// 设置visible
// 设置visible
pageInfo
.
pageData
=
this
.
updateCondition
(
pageData
,
ids
);
pageInfo
.
pageData
=
this
.
updateCondition
(
pageData
,
ids
);
log
.
info
(
showConditionIds
,
"--------------5454"
,
ids
,
pageInfo
);
log
.
info
(
showConditionIds
,
"--------------5454"
,
ids
,
pageInfo
);
console
.
log
(
showConditionIds
,
"--------------5454"
,
ids
,
pageInfo
);
cb
(
pageInfo
)
cb
(
pageInfo
)
},
},
checkCondition
({
allCondition
})
{
checkCondition
({
allCondition
})
{
...
@@ -742,11 +743,17 @@ export default {
...
@@ -742,11 +743,17 @@ export default {
console
.
log
(
"home-init"
);
console
.
log
(
"home-init"
);
this
.
getCartNum
();
this
.
getCartNum
();
this
.
active
=
checkTabbarPage
(
'/'
);
this
.
active
=
checkTabbarPage
(
'/'
);
this
.
setVisible
(
this
.
mpApp
.
globalData
.
pageList
,(
res
)
=>
{
this
.
setVisible
(
pageList
,(
res
)
=>
{
this
.
pageInfo
=
res
;
this
.
pageInfo
=
res
;
if
(
this
.
pageInfo
.
pageSettingData
&&
JSON
.
parse
(
this
.
pageInfo
.
pageSettingData
).
topNavStyleType
)
{
this
.
customBgOpacity
=
true
;
}
else
{
this
.
customBgOpacity
=
false
;
}
console
.
log
(
this
.
customBgOpacity
,
'-this.customBgOpacity'
)
this
.
contentList
=
JSON
.
parse
(
this
.
pageInfo
.
pageData
);
this
.
contentList
=
JSON
.
parse
(
this
.
pageInfo
.
pageData
);
this
.
pageData
.
push
(
this
.
contentList
[
0
]);
this
.
pageData
.
push
(
this
.
contentList
[
0
]);
console
.
log
(
this
.
page
Data
,
'--this.pageData
'
)
console
.
log
(
this
.
page
Info
,
'--this.pageInfo
'
)
let
i
=
1
;
let
i
=
1
;
this
.
loadComponents
(
i
);
this
.
loadComponents
(
i
);
});
});
...
@@ -757,12 +764,6 @@ export default {
...
@@ -757,12 +764,6 @@ export default {
this
.
setPageLoading
();
this
.
setPageLoading
();
log
.
info
(
app
.
globalData
.
shopInfo
,
'app'
)
log
.
info
(
app
.
globalData
.
shopInfo
,
'app'
)
wx
.
setNavigationBarTitle
({
title
:
app
.
globalData
.
shopInfo
.
shopName
})
wx
.
setNavigationBarTitle
({
title
:
app
.
globalData
.
shopInfo
.
shopName
})
console
.
log
(
this
.
pageInfo
.
pageSettingData
,
'-this.pageInfo.pageSettingData'
)
if
(
this
.
pageInfo
.
pageSettingData
&&
JSON
.
parse
(
this
.
pageInfo
.
pageSettingData
).
topNavStyleType
)
{
this
.
customBgOpacity
=
true
;
}
else
{
this
.
customBgOpacity
=
false
;
}
if
(
wx
.
getStorageSync
(
"sessionid"
))
{
if
(
wx
.
getStorageSync
(
"sessionid"
))
{
//清空门店id
//清空门店id
wx
.
setStorageSync
(
this
.
$store
.
state
.
mixid
+
'storeId'
,
''
)
wx
.
setStorageSync
(
this
.
$store
.
state
.
mixid
+
'storeId'
,
''
)
...
...
src/pages/login/index.vue
View file @
09141bd3
...
@@ -469,10 +469,12 @@ export default {
...
@@ -469,10 +469,12 @@ export default {
},
},
getUserProfile
()
{
getUserProfile
()
{
log
.
info
(
'点击了微信一键登录'
);
log
.
info
(
'点击了微信一键登录'
);
console
.
log
(
'点击了微信一键登录'
);
wx
.
showLoading
({
wx
.
showLoading
({
title
:
'登录中...'
,
title
:
'登录中...'
,
mask
:
true
mask
:
true
})
})
console
.
log
(
'登录中...'
);
if
(
this
.
content
&&!
this
.
checked
&&
this
.
onceFlag
)
{
if
(
this
.
content
&&!
this
.
checked
&&
this
.
onceFlag
)
{
wx
.
hideLoading
()
wx
.
hideLoading
()
if
(
this
.
registerFlag
)
{
if
(
this
.
registerFlag
)
{
...
@@ -485,6 +487,7 @@ export default {
...
@@ -485,6 +487,7 @@ export default {
}
}
return
return
}
}
console
.
log
(
'同意协议...'
,
this
.
userInfo
);
if
(
this
.
userInfo
)
{
if
(
this
.
userInfo
)
{
if
(
this
.
tempData
)
return
this
.
handleSuccess
()
if
(
this
.
tempData
)
return
this
.
handleSuccess
()
return
this
.
initUserInfo
();
return
this
.
initUserInfo
();
...
@@ -500,6 +503,7 @@ export default {
...
@@ -500,6 +503,7 @@ export default {
this
.
initUserInfo
();
this
.
initUserInfo
();
},
},
fail
:
(
e
)
=>
{
fail
:
(
e
)
=>
{
console
.
log
(
'wx.getUserProfile-fail'
,
e
)
log
.
info
(
'wx.getUserProfile-fail'
,
e
)
log
.
info
(
'wx.getUserProfile-fail'
,
e
)
wx
.
hideLoading
()
wx
.
hideLoading
()
}
}
...
...
src/pages/wxPay/index.vue
View file @
09141bd3
...
@@ -3,10 +3,65 @@
...
@@ -3,10 +3,65 @@
</
template
>
</
template
>
<
script
>
<
script
>
import
{
formatTime
}
from
"@/utils/index"
;
import
{
formatTime
,
serialize
}
from
"@/utils/index"
;
import
wxPay
from
"@/api/wxPay"
;
import
wxPay
from
"@/api/wxPay"
;
const
app
=
getApp
();
const
app
=
getApp
();
const
{
log
}
=
app
;
const
{
log
}
=
app
;
function
fn
(
_this
)
{
// _this.message = "支付成功";
if
(
!
_this
.
options_isCard
)
{
let
query
;
if
(
_this
.
batchNumber
)
{
query
=
{
orderSn
:
_this
.
options
.
orderSn
,
batchNumber
:
_this
.
batchNumber
,
multiMerchantsFlag
:
1
,
totalMoney
:
_this
.
totalMoney
,
};
}
else
{
query
=
{
orderSn
:
_this
.
options
.
orderSn
,
};
}
// sso场景(跳转第三方url)
if
(
_this
.
scene
==
"sso"
)
{
console
.
log
(
_this
.
backUrl
,
'----------pay--_this.backUrl'
)
setTimeout
(()
=>
{
wx
.
redirectTo
({
url
:
`../wxArticle/main?from=sso&link=
${
_this
.
backUrl
}
`
,
});
},
500
);
return
;
}
let
params
=
`?
${
serialize
(
query
)}
`
;
if
(
_this
.
options
.
accountBalanceFlag
==
1
)
{
// 余额充值
params
+=
`&accountBalanceFlag=1&totalMoney=
${
_this
.
totalMoney
}
`
}
if
(
_this
.
options
.
isPayReplace
==
1
)
{
// 好友代付
wx
.
redirectTo
({
url
:
`../index/main?from=wxPay&backpath=/order/payForOrderDetail¶ms=
${
JSON
.
stringify
(
query
)}
`
,
});
return
;
}
wx
.
redirectTo
({
url
:
`/pages/pages_subpack/paySuccess/main
${
params
}
`
,
});
}
else
{
let
query
=
{
cardTitle
:
_this
.
options_isCardTitle
,
};
wx
.
redirectTo
({
url
:
`../index/main?from=wxPay&backpath=/pay/payCardSuccess¶ms=
${
JSON
.
stringify
(
query
)}
`
,
});
}
}
export
default
{
export
default
{
components
:
{
components
:
{
// card
// card
...
@@ -48,7 +103,7 @@ export default {
...
@@ -48,7 +103,7 @@ export default {
log
.
info
(
JSON
.
parse
(
options
.
ordercode
).
orderSn
);
log
.
info
(
JSON
.
parse
(
options
.
ordercode
).
orderSn
);
if
(
JSON
.
parse
(
options
.
ordercode
).
orderSn
)
{
if
(
JSON
.
parse
(
options
.
ordercode
).
orderSn
)
{
this
.
totalMoney
=
Number
(
this
.
totalMoney
=
Number
(
JSON
.
parse
(
options
.
ordercode
).
orderSn
.
totalAmount
JSON
.
parse
(
options
.
ordercode
).
totalAmount
).
toFixed
(
2
);
).
toFixed
(
2
);
}
else
{
}
else
{
this
.
totalMoney
=
Number
(
this
.
totalMoney
=
Number
(
...
@@ -163,60 +218,6 @@ export default {
...
@@ -163,60 +218,6 @@ export default {
}
catch
(
err
)
{
}
catch
(
err
)
{
console
.
error
(
"subscribeMessage-err"
,
err
);
console
.
error
(
"subscribeMessage-err"
,
err
);
}
}
function
fn
(
_this
)
{
// _this.message = "支付成功";
if
(
!
_this
.
options_isCard
)
{
let
query
;
if
(
_this
.
batchNumber
)
{
query
=
{
orderSn
:
_this
.
options
.
orderSn
,
batchNumber
:
_this
.
batchNumber
,
multiMerchantsFlag
:
1
,
totalMoney
:
_this
.
totalMoney
,
};
}
else
{
query
=
{
orderSn
:
_this
.
options
.
orderSn
,
};
}
// sso场景(跳转第三方url)
if
(
_this
.
scene
==
"sso"
)
{
console
.
log
(
_this
.
backUrl
,
'----------pay--_this.backUrl'
)
setTimeout
(()
=>
{
wx
.
redirectTo
({
url
:
`../wxArticle/main?from=sso&link=
${
_this
.
backUrl
}
`
,
});
},
500
);
return
;
}
let
params
=
`?orderSn=
${
_this
.
options
.
orderSn
}
`
;
if
(
_this
.
options
.
accountBalanceFlag
==
1
)
{
// 余额充值
params
+=
`&accountBalanceFlag=1&totalMoney=
${
_this
.
totalMoney
}
`
}
if
(
_this
.
options
.
isPayReplace
==
1
)
{
// 好友代付
wx
.
redirectTo
({
url
:
`../index/main?from=wxPay&backpath=/order/payForOrderDetail¶ms=
${
JSON
.
stringify
(
query
)}
`
,
});
return
;
}
wx
.
redirectTo
({
url
:
`/pages/pages_subpack/paySuccess/main
${
params
}
`
,
});
}
else
{
let
query
=
{
cardTitle
:
_this
.
options_isCardTitle
,
};
wx
.
redirectTo
({
url
:
`../index/main?from=wxPay&backpath=/pay/payCardSuccess¶ms=
${
JSON
.
stringify
(
query
)}
`
,
});
}
}
};
};
payData
.
fail
=
(
res
)
=>
{
payData
.
fail
=
(
res
)
=>
{
log
.
info
(
"支付失败"
,
res
,
this
.
options
.
orderSn
);
log
.
info
(
"支付失败"
,
res
,
this
.
options
.
orderSn
);
...
@@ -226,7 +227,9 @@ export default {
...
@@ -226,7 +227,9 @@ export default {
log
.
info
(
"取消成功"
);
log
.
info
(
"取消成功"
);
});
});
}
}
// fn(this);
this
.
toPage
();
this
.
toPage
();
};
};
payData
.
complete
=
(
res
)
=>
{
payData
.
complete
=
(
res
)
=>
{
log
.
info
(
"支付completa"
,
res
,
this
.
options
.
orderSn
);
log
.
info
(
"支付completa"
,
res
,
this
.
options
.
orderSn
);
...
...
static/nativeComponents/Banner/index.js
View file @
09141bd3
...
@@ -45,10 +45,10 @@ Component({
...
@@ -45,10 +45,10 @@ Component({
customMethod
()
{
customMethod
()
{
console
.
log
(
"hello world! I am learning 微信小程序"
);
console
.
log
(
"hello world! I am learning 微信小程序"
);
},
},
async
bannerChange
(
val
)
{
bannerChange
(
val
)
{
let
{
newArr
}
=
this
.
data
;
let
{
newArr
}
=
this
.
data
;
console
.
log
(
newArr
,
'-newArr'
);
let
{
changeHomePageFlag
}
=
this
.
data
.
datas
.
componentData
;
let
{
changeHomePageFlag
}
=
this
.
data
.
datas
.
componentData
;
let
_this
=
this
;
// 如果开启了修改首页背景图
// 如果开启了修改首页背景图
let
imageUrl
=
`url(
${
let
imageUrl
=
`url(
${
newArr
[
val
.
detail
.
current
].
imageUrl
newArr
[
val
.
detail
.
current
].
imageUrl
...
@@ -59,28 +59,6 @@ Component({
...
@@ -59,28 +59,6 @@ Component({
backgroundImage
:
imageUrl
,
backgroundImage
:
imageUrl
,
imgRgb
:
newArr
[
val
.
detail
.
current
].
imgRgb
imgRgb
:
newArr
[
val
.
detail
.
current
].
imgRgb
});
});
}
else
{
await
wx
.
request
({
url
:
`
${
newArr
[
val
.
detail
.
current
].
imageUrl
}
?x-oss-process=image/average-hue`
,
data
:
{},
header
:
{
"content-type"
:
"application/json"
},
method
:
"GET"
,
dataType
:
"json"
,
responseType
:
"text"
,
success
:
result
=>
{
let
imgRgb
=
`#
${
result
.
data
.
RGB
.
split
(
"x"
)[
1
]}
`
;
app
.
setHomeBgImg
({
backgroundImage
:
imageUrl
,
imgRgb
});
newArr
[
val
.
detail
.
current
].
imgRgb
=
imgRgb
;
_this
.
setData
({
newArr
});
},
fail
:
()
=>
{},
complete
:
()
=>
{}
});
}
}
}
}
this
.
setData
({
activeIndex
:
val
.
detail
.
current
});
this
.
setData
({
activeIndex
:
val
.
detail
.
current
});
...
...
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