Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
yoho-limited-sell-miniapp
·
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
htoooth
7 years ago
Commit
5ae941dd5ff416ad7788707f24a61df27d90e715
1 parent
04028e5a
add cavans
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
74 additions
and
35 deletions
app/pages/product/detail/detail.js
app/pages/product/detail/detail.wxml
app/pages/product/detail/detail.wxss
app/pages/snapshootShare/snapshootShare.js
app/pages/snapshootShare/snapshootShare.wxml
app/project.config.json
app/pages/product/detail/detail.js
View file @
5ae941d
...
...
@@ -225,10 +225,10 @@ Page(Object.assign({
price
:
res
.
data
.
price
,
saleTime
:
res
.
data
.
saleTime
,
reminderNum
:
res
.
data
.
reminderNum
,
limitProductTyp
:
res
.
data
.
limitProductType
,
limitProductTyp
e
:
res
.
data
.
limitProductType
,
showStatus
:
res
.
data
.
showStatus
?
res
.
data
.
showStatus
:
0
,
assisLimit
:
res
.
data
.
helpLimit
?
res
.
data
.
helpLimit
:
0
,
queueType
:
res
.
data
.
queueType
?
res
.
data
.
queueType
:
''
,
queueType
:
res
.
data
.
queueType
?
res
.
data
.
queueType
:
QUEUE_TYPE
.
READY
,
activityId
:
res
.
data
.
activityId
?
res
.
data
.
activityId
:
''
,
defaultImage
,
productDesc
,
...
...
@@ -305,10 +305,10 @@ Page(Object.assign({
}
},
assisShare
()
{
// if (!app.getUnionID()) {
// this.goLogin();
// return;
// }
if
(
!
app
.
getUnionID
())
{
this
.
goLogin
();
return
;
}
this
.
share
();
},
...
...
@@ -411,9 +411,9 @@ Page(Object.assign({
data
.
limitProductCode
=
this
.
data
.
limitProductCode
;
}
let
refer
=
encodeURIComponent
(
`
/
pages
/
product
/
detail
/
detail
?
$
{
stringify
(
data
)}
`
)
;
let
refer
er
=
`
/
pages
/
product
/
detail
/
detail
?
$
{
stringify
(
data
)}
`
;
router
.
go
(
'userCenter'
,
{
refer
,
login
:
0
});
router
.
go
(
'userCenter'
,
{
refer
er
,
login
:
0
});
}
},
Actionsheet
));
\ No newline at end of file
...
...
app/pages/product/detail/detail.wxml
View file @
5ae941d
...
...
@@ -10,8 +10,8 @@
<view class="realPrice">{{price}}</view>
<view class="advanceTitleView">
<view class="advanceTime">
<image class="image-time" src="../../../static/images/shijian2@3x.png"></image>
{{saleTime}}发售
<view class="image-time"><image class="image-time" src="../../../static/images/shijian2@3x.png"></image></view>
<view class="text-time">{{saleTime}}发售</view>
</view>
<view class="advanceTitle">{{reminderNum}}人已关注</view>
</view>
...
...
app/pages/product/detail/detail.wxss
View file @
5ae941d
...
...
@@ -25,11 +25,20 @@
.advanceTitleView .advanceTime {
font-size: 24rpx;
color: #000;
display: flex;
align-items: center;
}
.advanceTitleView .image-time {
width: 24rpx;
height: 24rpx;
margin-right: 5rpx;
}
.advanceTitleView .text-time {
display: inline-block;
height: 34rpx;
line-height: 34rpx;
margin-top: 2rpx;
}
...
...
app/pages/snapshootShare/snapshootShare.js
View file @
5ae941d
...
...
@@ -2,8 +2,8 @@ let app = getApp();
const
windowWidth
=
app
.
globalData
.
systemInfo
.
windowWidth
;
const
windowHeight
=
app
.
globalData
.
systemInfo
.
windowHeight
;
const
screenHeight
=
app
.
globalData
.
systemInfo
.
screenHeight
;
// const scale = windowWidth / 375;
const
scale
=
0.7
const
scale
=
windowWidth
/
375
;
// const scale = 0.6
var
Point
=
function
(
x
,
y
)
{
return
{
...
...
@@ -110,18 +110,8 @@ Page({
icon
:
'success'
,
duration
:
2000
});
that
.
hidden
();
},
fail
:
function
()
{
that
.
hidden
();
}
});
},
fail
:
function
(
error
)
{
that
.
hidden
();
},
complete
:
function
(
res
)
{
that
.
hidden
();
}
},
this
);
},
...
...
@@ -130,28 +120,35 @@ Page({
let
that
=
this
;
let
pCtx
=
wx
.
createCanvasContext
(
'productDetailCanvas'
,
this
);
pCtx
.
setFillStyle
(
'white'
);
pCtx
.
fillRect
(
0
,
0
,
windowWidth
,
screenHeight
);
let
defaultImage
=
this
.
data
.
default_image
;
if
(
defaultImage
&&
defaultImage
.
indexOf
(
'https://'
)
===
-
1
)
{
defaultImage
=
defaultImage
.
replace
(
'http://'
,
'https://'
);
}
that
.
drawLongText
(
'你的好友邀你为ta助力,购买限定商品'
,
pCtx
,
187.5
*
scale
,
50
*
scale
,
'black'
,
18
,
20
);
wx
.
getImageInfo
({
src
:
defaultImage
,
success
:
function
(
res
)
{
pCtx
.
drawImage
(
res
.
path
,
27
*
scale
,
60
*
scale
,
320
*
scale
,
430
*
scale
);
pCtx
.
setFillStyle
(
'black'
);
that
.
drawLongText
(
that
.
data
.
product_name
,
pCtx
,
187.5
*
scale
,
402
*
scale
,
'white'
,
14
,
20
);
pCtx
.
drawImage
(
res
.
path
,
27
*
scale
,
60
*
scale
,
320
*
scale
,
279
*
scale
);
pCtx
.
setFillStyle
(
'white'
);
that
.
drawLongText
(
that
.
data
.
product_name
,
pCtx
,
187.5
*
scale
,
352
*
scale
,
'black'
,
14
,
20
);
pCtx
.
setTextAlign
(
'center'
);
pCtx
.
setFontSize
(
18
*
scale
);
pCtx
.
draw
(
true
);
}
});
pCtx
.
drawImage
(
'./images/share-logo@2x.png'
,
132
*
scale
,
415
*
scale
,
111
*
scale
,
20
*
scale
);
wx
.
getImageInfo
({
src
:
this
.
data
.
product_qrCode
,
success
:
function
(
res
)
{
pCtx
.
drawImage
(
res
.
path
,
1
48.5
*
scale
,
539.5
*
scale
,
78
*
scale
,
78
*
scale
);
pCtx
.
drawImage
(
res
.
path
,
1
09.5
*
scale
,
450.5
*
scale
,
156
*
scale
,
156
*
scale
);
pCtx
.
draw
(
true
);
}
});
...
...
@@ -160,7 +157,7 @@ Page({
pCtx
.
setTextAlign
(
'center'
);
pCtx
.
setFontSize
(
11
);
pCtx
.
fillText
(
'长按扫码查看详情'
,
187.5
*
scale
,
632.5
*
scale
);
pCtx
.
drawImage
(
'./images/snapshoot_tip_ic@2x.png'
,
12
7
*
scale
,
645.5
*
scale
,
9
*
scale
,
9
*
scale
);
pCtx
.
drawImage
(
'./images/snapshoot_tip_ic@2x.png'
,
8
7
*
scale
,
645.5
*
scale
,
9
*
scale
,
9
*
scale
);
pCtx
.
setFillStyle
(
'#b0b0b0'
);
pCtx
.
setFontSize
(
9
);
pCtx
.
fillText
(
'或者在各大应用市场搜索 Yoho!Buy有货 下载App'
,
187.5
*
scale
,
652.5
*
scale
);
...
...
@@ -234,5 +231,8 @@ Page({
break
;
}
}
},
hidden
()
{
wx
.
navigateBack
();
}
});
});
\ No newline at end of file
...
...
app/pages/snapshootShare/snapshootShare.wxml
View file @
5ae941d
<!--pages/snapshootShare/snapshootShare.wxml-->
<view class="snapshoot-container" >
<view class="snapshoot-container">
<view class="snapshoot-content">
<view class="snapshoot">
<view class="snapshoot-title">
<view>你的好友邀你为ta助力,购买限定商品</view>
</view>
<view class="snapshoot-productinfo">
<image class="product-defaultImage" src="{{default_image}}"> </image>
</view>
<view class="product-info-content">
<text class="product-name">{{product_name}}</text>
</view>
<view class="product-miniqr">
<image class="yoho-logo" src="./images/share-logo@2x.png"></image>
<image class="product-qrcode" src="{{product_qrCode}}"></image>
<text class="snapshoot-tips">长按扫码查看详情</text>
<view class='product-tips'>
<image class="product-tips-img" src="./images/snapshoot_tip_ic@2x.png"></image>
<text class="product-tips-text">或者在各大应用市场搜索 Yoho!Buy有货 下载App</text>
</view>
</view>
</view>
</view>
<view class="snapshoot-bottom">
<view class="snapshoot-save" bindtap="saveToAlbum">
<text class="text">保存到相册</text>
</view>
<view class="snapshoot-cancel" bindtap="hidden">
<text class="cancel-text">取消</text>
</view>
</view>
</view>
<view class="snapshoot-canvas" style="width: {{windowWidth}}px;height:{{screenHeight}}px; background-color: white; " >
<view class="snapshoot-canvas" style="width: {{windowWidth}}px;height:{{screenHeight}}px; background-color: white; margin-top: {{screenHeight}}px" >
<canvas canvas-id="productDetailCanvas" style="width: {{windowWidth}}px;height:{{screenHeight}}px;background-color: white"></canvas>
</view>
<!-- <view class="snapshoot-canvas" style="width: {{windowWidth}}px;height:{{screenHeight}}px; background-color: white; margin-top: {{-100}}px " >
<canvas canvas-id="productDetailCanvas" style="width: {{windowWidth}}px;height:{{screenHeight}}px;background-color: white"></canvas>
</view> -->
</view>
...
...
app/project.config.json
View file @
5ae941d
...
...
@@ -33,7 +33,7 @@
"list"
:
[]
},
"miniprogram"
:
{
"current"
:
3
,
"current"
:
2
,
"list"
:
[
{
"id"
:
0
,
...
...
Please
register
or
login
to post a comment