Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
7
7-Eleven
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
高淑倩
7-Eleven
Commits
f62751c6
Commit
f62751c6
authored
Feb 25, 2020
by
谢中龙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化功能
parent
8f2287e4
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
86 additions
and
67 deletions
+86
-67
sharePoster.js
src/component/sharePoster/sharePoster.js
+36
-45
index.js
src/config/index.js
+9
-9
order.js
src/pages/order/order.js
+17
-1
project.config.json
src/project.config.json
+3
-3
achievement.js
src/shoppingGuid/page/pages/achievement/achievement.js
+19
-7
achievement.wxml
src/shoppingGuid/page/pages/achievement/achievement.wxml
+1
-1
userInfo.js
src/shoppingGuid/page/pages/userInfo/userInfo.js
+1
-1
No files found.
src/component/sharePoster/sharePoster.js
View file @
f62751c6
...
@@ -11,8 +11,8 @@ Component({
...
@@ -11,8 +11,8 @@ Component({
type
:
String
,
type
:
String
,
value
:
''
value
:
''
},
},
cardExplain
:{
//文案
cardExplain
:
{
//文案
type
:
Array
,
type
:
String
,
value
:
''
value
:
''
},
},
productDesc
:
{
// 产品描述
productDesc
:
{
// 产品描述
...
@@ -23,13 +23,9 @@ Component({
...
@@ -23,13 +23,9 @@ Component({
type
:
String
,
type
:
String
,
value
:
''
value
:
''
},
},
codeImg
:{
codeImg
:
{
type
:
String
,
type
:
String
,
value
:
''
value
:
''
},
shareTitle
:
{
type
:
String
,
value
:
''
}
}
},
},
/**
/**
...
@@ -49,13 +45,14 @@ Component({
...
@@ -49,13 +45,14 @@ Component({
* 组件的方法列表
* 组件的方法列表
*/
*/
methods
:
{
methods
:
{
// 关闭modal
// 关闭modal
closePoste
(){
closePoste
()
{
this
.
setData
({
this
.
setData
({
showpost
:
false
showpost
:
false
})
})
},
},
//下载产品图片
//下载产品图片
getAvaterInfo
:
function
()
{
getAvaterInfo
:
function
()
{
wx
.
showLoading
({
wx
.
showLoading
({
...
@@ -89,7 +86,7 @@ Component({
...
@@ -89,7 +86,7 @@ Component({
})
})
}
}
},
},
fail
:
function
(
res
)
{
fail
:
function
(
res
)
{
wx
.
hideLoading
();
wx
.
hideLoading
();
wx
.
showToast
({
wx
.
showToast
({
title
:
'产品图片下载失败!'
,
title
:
'产品图片下载失败!'
,
...
@@ -132,7 +129,7 @@ Component({
...
@@ -132,7 +129,7 @@ Component({
})
})
}
}
},
},
fail
:
function
(
res
)
{
fail
:
function
(
res
)
{
wx
.
hideLoading
();
wx
.
hideLoading
();
wx
.
showToast
({
wx
.
showToast
({
title
:
'二维码下载失败!'
,
title
:
'二维码下载失败!'
,
...
@@ -150,6 +147,7 @@ Component({
...
@@ -150,6 +147,7 @@ Component({
//canvas绘制分享海报
//canvas绘制分享海报
sharePosteCanvas
:
function
(
avaterSrc
,
codeSrc
,
imgInfo
)
{
sharePosteCanvas
:
function
(
avaterSrc
,
codeSrc
,
imgInfo
)
{
wx
.
showLoading
({
wx
.
showLoading
({
title
:
'生成中...'
,
title
:
'生成中...'
,
mask
:
true
,
mask
:
true
,
...
@@ -165,7 +163,7 @@ Component({
...
@@ -165,7 +163,7 @@ Component({
var
left
=
rect
.
left
;
var
left
=
rect
.
left
;
ctx
.
setFillStyle
(
'#fff'
);
ctx
.
setFillStyle
(
'#fff'
);
ctx
.
fillRect
(
0
,
0
,
rect
.
width
,
height
);
ctx
.
fillRect
(
0
,
0
,
rect
.
width
,
height
);
// console.log(that.data)
// 图片
// 图片
if
(
avaterSrc
)
{
if
(
avaterSrc
)
{
if
(
imgInfo
)
{
if
(
imgInfo
)
{
...
@@ -176,30 +174,23 @@ Component({
...
@@ -176,30 +174,23 @@ Component({
ctx
.
setFillStyle
(
'#d8d8d8'
);
ctx
.
setFillStyle
(
'#d8d8d8'
);
ctx
.
setTextAlign
(
'left'
);
ctx
.
setTextAlign
(
'left'
);
}
}
// 品牌头像
// 品牌头像
if
(
that
.
data
.
userAvatar
)
{
if
(
that
.
data
.
userAvatar
)
{
// ctx.drawImage(that.data.userAvatar, 12, 290, 30, 30);
ctx
.
drawImage
(
that
.
data
.
userAvatar
,
12
,
290
,
40
,
40
);
}
//画一下分享商户名称
if
(
that
.
data
.
shareTitle
){
ctx
.
setFontSize
(
14
);
ctx
.
setFillStyle
(
'#333333'
);
ctx
.
setTextAlign
(
'left'
);
let
shareTitle
=
`[
${
that
.
data
.
shareTitle
}
]`
;
ctx
.
fillText
(
shareTitle
,
12
,
310
);
}
}
// title
// title
if
(
that
.
data
.
productDesc
){
if
(
that
.
data
.
productDesc
)
{
ctx
.
setFontSize
(
14
);
ctx
.
setFontSize
(
14
);
ctx
.
setFillStyle
(
'#
666666
'
);
ctx
.
setFillStyle
(
'#
333333
'
);
ctx
.
setTextAlign
(
'left'
);
ctx
.
setTextAlign
(
'left'
);
//只显示15个字
//只显示15个字
let
newStrArr
=
[];
let
newStrArr
=
[];
if
(
that
.
data
.
productDesc
){
if
(
that
.
data
.
productDesc
)
{
let
subTimes
=
Math
.
ceil
(
that
.
data
.
productDesc
.
length
/
15
);
let
subTimes
=
Math
.
ceil
(
that
.
data
.
productDesc
.
length
/
9
);
for
(
let
i
=
0
;
i
<
subTimes
;
i
++
)
{
for
(
let
i
=
0
;
i
<
subTimes
;
i
++
)
{
let
tempSubStr
=
that
.
data
.
productDesc
.
substr
(
i
*
15
,
15
);
let
tempSubStr
=
that
.
data
.
productDesc
.
substr
(
i
*
9
,
9
);
newStrArr
.
push
(
tempSubStr
)
newStrArr
.
push
(
tempSubStr
)
}
}
}
}
...
@@ -210,7 +201,7 @@ Component({
...
@@ -210,7 +201,7 @@ Component({
var
test
=
""
;
var
test
=
""
;
var
empty
=
[];
var
empty
=
[];
for
(
var
a
=
0
;
a
<
rowPart
.
length
;
a
++
)
{
for
(
var
a
=
0
;
a
<
rowPart
.
length
;
a
++
)
{
if
(
ctx
.
measureText
(
test
).
width
<
2
2
0
)
{
if
(
ctx
.
measureText
(
test
).
width
<
2
0
0
)
{
// if (context.measureText(test).width < 220) {
// if (context.measureText(test).width < 220) {
test
+=
rowPart
[
a
];
test
+=
rowPart
[
a
];
}
}
...
@@ -226,28 +217,27 @@ Component({
...
@@ -226,28 +217,27 @@ Component({
}
}
for
(
var
b
=
0
;
b
<
newStrArr
.
length
;
b
++
)
{
for
(
var
b
=
0
;
b
<
newStrArr
.
length
;
b
++
)
{
ctx
.
fillText
(
newStrArr
[
b
],
12
,
332
+
b
*
16
);
ctx
.
fillText
(
newStrArr
[
b
],
61
,
310
+
b
*
16
);
}
}
}
else
{
}
else
{
console
.
log
(
that
.
data
.
cardExplain
)
let
explain
=
JSON
.
parse
(
JSON
.
stringify
(
that
.
data
.
cardExplain
))
let
explain
=
JSON
.
parse
(
JSON
.
stringify
(
that
.
data
.
cardExplain
))
if
(
explain
[
0
]){
if
(
explain
[
0
])
{
ctx
.
setFontSize
(
12
);
ctx
.
setFontSize
(
12
);
ctx
.
setFillStyle
(
'#
666666
'
);
ctx
.
setFillStyle
(
'#
333333
'
);
ctx
.
setTextAlign
(
'left'
);
ctx
.
setTextAlign
(
'left'
);
ctx
.
fillText
(
explain
[
0
],
12
,
332
);
ctx
.
fillText
(
explain
[
0
],
61
,
300
);
}
}
if
(
explain
[
1
])
{
if
(
explain
[
1
])
{
ctx
.
setFontSize
(
12
);
ctx
.
setFontSize
(
12
);
ctx
.
setFillStyle
(
'#
666666
'
);
ctx
.
setFillStyle
(
'#
333333
'
);
ctx
.
setTextAlign
(
'left'
);
ctx
.
setTextAlign
(
'left'
);
ctx
.
fillText
(
explain
[
1
],
12
,
348
);
ctx
.
fillText
(
explain
[
1
],
61
,
314
);
}
}
// if (explain[2]) {
// if (explain[2]) {
// ctx.setFontSize(12);
// ctx.setFontSize(12);
// ctx.setFillStyle('#
666666
');
// ctx.setFillStyle('#
333333
');
// ctx.setTextAlign('left');
// ctx.setTextAlign('left');
// ctx.fillText(explain[2],
12, 364
);
// ctx.fillText(explain[2],
61, 326
);
// }
// }
}
}
...
@@ -266,10 +256,10 @@ Component({
...
@@ -266,10 +256,10 @@ Component({
// 绘制二维码
// 绘制二维码
if
(
codeSrc
)
{
if
(
codeSrc
)
{
ctx
.
drawImage
(
codeSrc
,
210
,
290
,
65
,
6
5
)
ctx
.
drawImage
(
codeSrc
,
195
,
281
,
61.5
,
61.
5
)
ctx
.
setFontSize
(
10
);
ctx
.
setFontSize
(
10
);
ctx
.
setFillStyle
(
'#000'
);
ctx
.
setFillStyle
(
'#000'
);
// ctx.fillText("微信扫码或长按保存图片", left + 165, imgheght + 110);
// ctx.fillText("微信扫码或长按保存图片", left + 165, imgheght + 110);
}
}
}).
exec
()
}).
exec
()
...
@@ -362,11 +352,11 @@ Component({
...
@@ -362,11 +352,11 @@ Component({
wx
.
getSystemInfo
({
wx
.
getSystemInfo
({
success
(
res2
)
{
success
(
res2
)
{
var
ratio
=
res
.
width
/
res
.
height
;
var
ratio
=
res
.
width
/
res
.
height
;
var
imgHeight
=
3
70
;
var
imgHeight
=
3
52.5
;
that
.
setData
({
that
.
setData
({
imgHeight
:
imgHeight
imgHeight
:
imgHeight
})
})
cb
(
imgHeight
-
1
5
0
);
cb
(
imgHeight
-
1
3
0
);
}
}
})
})
}
}
...
@@ -383,6 +373,6 @@ Component({
...
@@ -383,6 +373,6 @@ Component({
}
}
},
},
})
})
\ No newline at end of file
src/config/index.js
View file @
f62751c6
...
@@ -6,16 +6,16 @@
...
@@ -6,16 +6,16 @@
// 修改 BRANCH_ID 为对应的商户id
// 修改 BRANCH_ID 为对应的商户id
// app.js 中brandId 修改为对应
// app.js 中brandId 修改为对应
const
PROJECT_ENV
=
'
test
'
// 生产 prod, 开发 dev, 测试 test , 测试门户 test_store, 预生产 pre
const
PROJECT_ENV
=
'
prod
'
// 生产 prod, 开发 dev, 测试 test , 测试门户 test_store, 预生产 pre
//仅生产环境时 配置 :
//仅生产环境时 配置 :
//3001 3001 , wx313ec36b710125d4
//3001 3001 , wx313ec36b710125d4
//泰华 2006 , wx40fec8944623c8b3
//泰华 2006 , wx40fec8944623c8b3
//多多一上 2007
,
//多多一上 2007
, wxf7bc302c51166dc0
//雪岛书屋 2008
//雪岛书屋 2008
wx207f8a95bbc9d3ab
//苏州邻里 2003
//苏州邻里 2003
, wxe7770946f9d93d38
//2012 悦芙媞 wxfe14ebde4a6eea3d
//2012 悦芙媞 wxfe14ebde4a6eea3d
//2010 热风 wxe6d270a3e399ade9
//2010 热风 wxe6d270a3e399ade9
const
BRANCH_ID
=
1002
const
BRANCH_ID
=
3001
const
isMall
=
true
const
isMall
=
true
const
needMock
=
''
//
const
needMock
=
''
//
...
@@ -131,7 +131,7 @@ const prod_brand_config = {
...
@@ -131,7 +131,7 @@ const prod_brand_config = {
orderingMustOpenCard
:
true
,
orderingMustOpenCard
:
true
,
isOpenSelfMention
:
true
,
// 是否开启门店自提
isOpenSelfMention
:
true
,
// 是否开启门店自提
shareTitle
:
'泰华微商城'
,
shareTitle
:
'泰华微商城'
,
logo
:
'https://bigaka-xie.oss-cn-shanghai.aliyuncs.com/
logo_head
.png'
,
logo
:
'https://bigaka-xie.oss-cn-shanghai.aliyuncs.com/
taihua_logo
.png'
,
},
},
//多多一上
//多多一上
2007
:
{
2007
:
{
...
@@ -146,7 +146,7 @@ const prod_brand_config = {
...
@@ -146,7 +146,7 @@ const prod_brand_config = {
orderingMustOpenCard
:
false
,
orderingMustOpenCard
:
false
,
isOpenSelfMention
:
false
,
// 是否开启门店自提
isOpenSelfMention
:
false
,
// 是否开启门店自提
shareTitle
:
'多多一上'
,
shareTitle
:
'多多一上'
,
logo
:
'https://bigaka-xie.oss-cn-shanghai.aliyuncs.com/
logo_head
.png'
,
logo
:
'https://bigaka-xie.oss-cn-shanghai.aliyuncs.com/
duoduoyishang_logo
.png'
,
},
},
//雪岛书屋
//雪岛书屋
2008
:
{
2008
:
{
...
@@ -191,7 +191,7 @@ const prod_brand_config = {
...
@@ -191,7 +191,7 @@ const prod_brand_config = {
orderingMustOpenCard
:
false
,
orderingMustOpenCard
:
false
,
isOpenSelfMention
:
false
,
// 是否开启门店自提
isOpenSelfMention
:
false
,
// 是否开启门店自提
shareTitle
:
'热风微商城'
,
shareTitle
:
'热风微商城'
,
logo
:
'https://bigaka-xie.oss-cn-shanghai.aliyuncs.com/
logo_head
.png'
,
logo
:
'https://bigaka-xie.oss-cn-shanghai.aliyuncs.com/
hotwind_logo
.png'
,
},
},
//悦芙媞
//悦芙媞
2012
:
{
2012
:
{
...
@@ -206,7 +206,7 @@ const prod_brand_config = {
...
@@ -206,7 +206,7 @@ const prod_brand_config = {
orderingMustOpenCard
:
false
,
orderingMustOpenCard
:
false
,
isOpenSelfMention
:
false
,
// 是否开启门店自提
isOpenSelfMention
:
false
,
// 是否开启门店自提
shareTitle
:
'悦芙媞微商城'
,
shareTitle
:
'悦芙媞微商城'
,
logo
:
'https://bigaka-xie.oss-cn-shanghai.aliyuncs.com/
logo_head
.png'
,
logo
:
'https://bigaka-xie.oss-cn-shanghai.aliyuncs.com/
yufuti_logo
.png'
,
}
}
}
}
...
...
src/pages/order/order.js
View file @
f62751c6
...
@@ -67,8 +67,9 @@ wxService.page({
...
@@ -67,8 +67,9 @@ wxService.page({
* 生命周期函数--监听页面显示
* 生命周期函数--监听页面显示
*/
*/
onShow
:
function
()
{
onShow
:
function
()
{
const
{
currentIndex
}
=
this
.
data
const
{
currentIndex
}
=
this
.
data
;
this
.
handleOrderStatus
(
this
.
options
.
orderStatus
)
if
(
currentIndex
==
5
)
{
if
(
currentIndex
==
5
)
{
this
.
getRefundList
(
this
.
data
.
pageNo
,
this
.
data
.
pageSize
)
this
.
getRefundList
(
this
.
data
.
pageNo
,
this
.
data
.
pageSize
)
}
else
{
}
else
{
...
@@ -80,6 +81,21 @@ wxService.page({
...
@@ -80,6 +81,21 @@ wxService.page({
})
})
}
}
},
},
//处理订单状态
handleOrderStatus
(
orderStatus
){
if
(
orderStatus
){
this
.
data
.
swiperItem
.
forEach
(
item
=>
{
if
(
item
.
status
==
orderStatus
){
this
.
data
.
currentIndex
=
item
.
type
;
this
.
data
.
status
=
orderStatus
;
}
});
this
.
setData
({
currentIndex
:
this
.
data
.
currentIndex
});
}
},
// 确认收货
// 确认收货
handelConfirmReceipt
(
e
)
{
handelConfirmReceipt
(
e
)
{
const
{
id
}
=
e
.
currentTarget
.
dataset
const
{
id
}
=
e
.
currentTarget
.
dataset
...
...
src/project.config.json
View file @
f62751c6
...
@@ -13,7 +13,7 @@
...
@@ -13,7 +13,7 @@
},
},
"compileType"
:
"miniprogram"
,
"compileType"
:
"miniprogram"
,
"libVersion"
:
"2.8.2"
,
"libVersion"
:
"2.8.2"
,
"appid"
:
"wx
ac09792264c49b5c
"
,
"appid"
:
"wx
313ec36b710125d4
"
,
"projectname"
:
"%E5%BE%AE%E5%95%86%E5%9F%8E"
,
"projectname"
:
"%E5%BE%AE%E5%95%86%E5%9F%8E"
,
"debugOptions"
:
{
"debugOptions"
:
{
"hidedInDevtools"
:
[]
"hidedInDevtools"
:
[]
...
@@ -173,7 +173,7 @@
...
@@ -173,7 +173,7 @@
"scene"
:
null
"scene"
:
null
},
},
{
{
"id"
:
-1
,
"id"
:
20
,
"name"
:
"我的订单"
,
"name"
:
"我的订单"
,
"pathName"
:
"pages/order/order"
,
"pathName"
:
"pages/order/order"
,
"query"
:
""
,
"query"
:
""
,
...
@@ -403,7 +403,7 @@
...
@@ -403,7 +403,7 @@
"id"
:
53
,
"id"
:
53
,
"name"
:
"会员详情"
,
"name"
:
"会员详情"
,
"pathName"
:
"shoppingGuid/page/pages/userInfo/userInfo"
,
"pathName"
:
"shoppingGuid/page/pages/userInfo/userInfo"
,
"query"
:
"id= 6
40930496804704256
"
,
"query"
:
"id= 6
77585630707994624
"
,
"scene"
:
null
"scene"
:
null
},
},
{
{
...
...
src/shoppingGuid/page/pages/achievement/achievement.js
View file @
f62751c6
...
@@ -18,12 +18,16 @@ wxService.page({
...
@@ -18,12 +18,16 @@ wxService.page({
current
:
1
,
current
:
1
,
currentOrderData
:
{},
currentOrderData
:
{},
avator
:
'https://bigaka-xie.oss-cn-shanghai.aliyuncs.com/biaka_default_u_logo.png'
,
avator
:
'https://bigaka-xie.oss-cn-shanghai.aliyuncs.com/biaka_default_u_logo.png'
,
info
:
{},
info
:
{},
achievement
:
{},
achievement
:
{},
memberPreview
:
{},
memberPreview
:
{
rank
:
0
,
recruitAmountToday
:
0
,
recruitAmountMonth
:
0
,
recruitTotal
:
0
,
},
achivementType
:
1
,
//1 个人 2门店
achivementType
:
1
,
//1 个人 2门店
chartImg
:
''
chartImg
:
''
,
},
},
//切换个人和门店
//切换个人和门店
...
@@ -231,10 +235,17 @@ wxService.page({
...
@@ -231,10 +235,17 @@ wxService.page({
getGuidAchievementDay
(){
getGuidAchievementDay
(){
wxService
.
post
(
'/marketing/shoppingguide/achievement/recruit'
).
then
(
res
=>
{
wxService
.
post
(
'/marketing/shoppingguide/achievement/recruit'
).
then
(
res
=>
{
if
(
!
res
)
return
;
if
(
!
res
)
return
;
this
.
data
.
memberPreview
=
res
.
data
.
data
;
let
obj
=
res
.
data
.
data
?
res
.
data
.
data
:
null
;
this
.
setData
({
if
(
obj
){
memberPreview
:
this
.
data
.
memberPreview
this
.
data
.
memberPreview
.
rank
=
obj
.
rank
;
});
this
.
data
.
memberPreview
.
recruitAmountMonth
=
obj
.
recruitAmountMonth
;
this
.
data
.
memberPreview
.
recruitAmountToday
=
obj
.
recruitAmountToday
;
this
.
data
.
memberPreview
.
recruitTotal
=
obj
.
recruitTotal
;
this
.
setData
({
memberPreview
:
this
.
data
.
memberPreview
});
}
});
});
},
},
})
})
\ No newline at end of file
src/shoppingGuid/page/pages/achievement/achievement.wxml
View file @
f62751c6
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
<view class='info-rg'>
<view class='info-rg'>
<view class='my-name'>{{info.member.name}}</view>
<view class='my-name'>{{info.member.name}}</view>
<view class='my-rank'>
<view class='my-rank'>
<text wx:if="{{memberPreview.rank}}">今日我的招募排名 ,第 <
label>{{memberPreview.rank}}</label
> 位</text>
<text wx:if="{{memberPreview.rank}}">今日我的招募排名 ,第 <
text style="font-weight:550;">{{memberPreview.rank}}</text
> 位</text>
<text wx:else>当前暂无您的排名信息</text>
<text wx:else>当前暂无您的排名信息</text>
</view>
</view>
</view>
</view>
...
...
src/shoppingGuid/page/pages/userInfo/userInfo.js
View file @
f62751c6
...
@@ -87,7 +87,7 @@ wxService.page({
...
@@ -87,7 +87,7 @@ wxService.page({
//获取用户总消费额
//获取用户总消费额
getMemberTotalConsumeAmount
(
memberId
){
getMemberTotalConsumeAmount
(
memberId
){
wxService
.
get
(
`/sale/trade/tradeMemberCalcByMemberId?memberId=
${
memberId
}
`
).
then
(
res
=>
{
wxService
.
get
(
`/sale/trade/tradeMemberCalcByMemberId?memberId=
${
memberId
}
`
).
then
(
res
=>
{
this
.
data
.
total
.
totalConsume
=
res
.
data
.
data
.
totalConsume
?
res
.
data
.
data
.
totalConsume
:
0
;
this
.
data
.
total
.
totalConsume
=
res
.
data
.
data
.
consumeTotal
?
res
.
data
.
data
.
consumeTotal
:
0
;
this
.
setData
({
this
.
setData
({
total
:
this
.
data
.
total
total
:
this
.
data
.
total
});
});
...
...
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