默认提交
Showing
25 changed files
with
250 additions
and
452 deletions
... | @@ -50,13 +50,13 @@ | ... | @@ -50,13 +50,13 @@ |
50 | "pagePath": "pages/index/index", | 50 | "pagePath": "pages/index/index", |
51 | "iconPath": "image/tabbar/scan-bar.png", | 51 | "iconPath": "image/tabbar/scan-bar.png", |
52 | "selectedIconPath": "image/tabbar/scan-bar-selected.png", | 52 | "selectedIconPath": "image/tabbar/scan-bar-selected.png", |
53 | "text": "扫码得奖金" | 53 | "text": "首页" |
54 | }, | 54 | }, |
55 | { | 55 | { |
56 | "pagePath": "pages/gift-shop/gift-shop", | 56 | "pagePath": "pages/gift-shop/gift-shop", |
57 | "iconPath": "image/tabbar/gift-bar.png", | 57 | "iconPath": "image/tabbar/gift-bar.png", |
58 | "selectedIconPath": "image/tabbar/gift-bar-selected.png", | 58 | "selectedIconPath": "image/tabbar/gift-bar-selected.png", |
59 | "text": "礼物兑换" | 59 | "text": "奖金兑换" |
60 | }, | 60 | }, |
61 | { | 61 | { |
62 | "pagePath": "pages/user-center/user-center", | 62 | "pagePath": "pages/user-center/user-center", | ... | ... |
... | @@ -2,7 +2,7 @@ let ENV_CONFIG = require('./env/index'); | ... | @@ -2,7 +2,7 @@ let ENV_CONFIG = require('./env/index'); |
2 | 2 | ||
3 | const APPID = '' | 3 | const APPID = '' |
4 | /** ====每次发布版本记得修改此环境配置==== */ | 4 | /** ====每次发布版本记得修改此环境配置==== */ |
5 | const ENV = 'Prod'; // Dev Prod | 5 | const ENV = 'Dev'; // Dev Prod |
6 | const NET_CONFIG = ENV_CONFIG[ENV]; | 6 | const NET_CONFIG = ENV_CONFIG[ENV]; |
7 | const MOCKAPI = ENV_CONFIG.mockApi; | 7 | const MOCKAPI = ENV_CONFIG.mockApi; |
8 | 8 | ... | ... |
src/image/index/icon-auction.png
0 → 100644
2.8 KB
src/image/index/icon-qrcode.png
0 → 100644
2.2 KB
src/image/index/icon-rank.png
0 → 100644
3.03 KB
src/image/index/icon-scan.png
0 → 100644
3.9 KB
src/image/index/icon-seckill.png
0 → 100644
2.91 KB
src/image/index/icon-verify.png
0 → 100644
2.5 KB
... | @@ -8,7 +8,8 @@ Page({ | ... | @@ -8,7 +8,8 @@ Page({ |
8 | authorizeVisible: false, | 8 | authorizeVisible: false, |
9 | contactInfo: {}, | 9 | contactInfo: {}, |
10 | // qrcodeUrl:"https://kd.cdn.xyiyang.com/weapp/zhiliang-light/qrcode/qrcode-focus.png", | 10 | // qrcodeUrl:"https://kd.cdn.xyiyang.com/weapp/zhiliang-light/qrcode/qrcode-focus.png", |
11 | qrcodeUrl: "https://kdcdn.oss-cn-shenzhen.aliyuncs.com/weapp/zhiliang-light/qrcode/qrcode-focus.png", | 11 | qrcodeUrlPublic: "https://kdcdn.oss-cn-shenzhen.aliyuncs.com/weapp/zhiliang-light/qrcode/qrcode-public.png", |
12 | qrcodeUrlContact: "https://kdcdn.oss-cn-shenzhen.aliyuncs.com/weapp/zhiliang-light/qrcode/qrcode-contact.png", | ||
12 | }, | 13 | }, |
13 | onShareAppMessage() {}, | 14 | onShareAppMessage() {}, |
14 | showAuth() { | 15 | showAuth() { |
... | @@ -40,7 +41,8 @@ Page({ | ... | @@ -40,7 +41,8 @@ Page({ |
40 | * 图片查看 | 41 | * 图片查看 |
41 | */ | 42 | */ |
42 | onPreviewImageHandler(evt) { | 43 | onPreviewImageHandler(evt) { |
43 | let current = this.data.qrcodeUrl; | 44 | let current = getBindtapData(evt); |
45 | // let current = this.data.qrcodeUrl; | ||
44 | let urls = [current]; | 46 | let urls = [current]; |
45 | wx.previewImage({ | 47 | wx.previewImage({ |
46 | current: current, | 48 | current: current, | ... | ... |
... | @@ -68,9 +68,19 @@ $contentWidth:690px; | ... | @@ -68,9 +68,19 @@ $contentWidth:690px; |
68 | // 关注 | 68 | // 关注 |
69 | .focus { | 69 | .focus { |
70 | text-align: center; | 70 | text-align: center; |
71 | display: flex; | ||
72 | justify-content: center; | ||
73 | font-size: 26px; | ||
74 | |||
75 | &-item { | ||
76 | margin: 0 12px; | ||
77 | |||
78 | .t1{ | ||
79 | margin-top: -12px; | ||
80 | } | ||
81 | } | ||
71 | 82 | ||
72 | .qrcode { | 83 | .qrcode { |
73 | margin-top: 16px; | ||
74 | width: 280px; | 84 | width: 280px; |
75 | } | 85 | } |
76 | 86 | ... | ... |
... | @@ -41,8 +41,15 @@ | ... | @@ -41,8 +41,15 @@ |
41 | </view> | 41 | </view> |
42 | <!-- 关注 --> | 42 | <!-- 关注 --> |
43 | <view class="border focus"> | 43 | <view class="border focus"> |
44 | <image bindtap="onPreviewImageHandler" class="qrcode" mode="widthFix" src="{{qrcodeUrl}}" /> | 44 | <view class="focus-item"> |
45 | <view class="tips">更多讯息,欢迎关注我们的公众号</view> | 45 | <image bindtap="onPreviewImageHandler" data-data="{{qrcodeUrlPublic}}" class="qrcode" mode="widthFix" src="{{qrcodeUrlPublic}}" /> |
46 | <view class="t1">微信公众号</view> | ||
47 | </view> | ||
48 | <view class="focus-item"> | ||
49 | <image bindtap="onPreviewImageHandler" data-data="{{qrcodeUrlContact}}" class="qrcode" mode="widthFix" src="{{qrcodeUrlContact}}" /> | ||
50 | <view class="t1">客服微信</view> | ||
51 | </view> | ||
52 | <!-- <view class="tips">更多讯息,欢迎关注我们的公众号</view> --> | ||
46 | <!-- <view bindtap="onPreviewImageHandler" class="btn">一键关注</view> --> | 53 | <!-- <view bindtap="onPreviewImageHandler" class="btn">一键关注</view> --> |
47 | </view> | 54 | </view> |
48 | <!-- 一键关注 --> | 55 | <!-- 一键关注 --> | ... | ... |
... | @@ -15,7 +15,7 @@ Page({ | ... | @@ -15,7 +15,7 @@ Page({ |
15 | productList: [], // 产品列表 | 15 | productList: [], // 产品列表 |
16 | curProductDetail: {}, // 选中的产品详情 | 16 | curProductDetail: {}, // 选中的产品详情 |
17 | qrCodeCode: "", | 17 | qrCodeCode: "", |
18 | userInfo: {}, //用户信息 | 18 | userInfo: null, //用户信息 |
19 | code: "", // 手输入码 / 扫出的奖金码 | 19 | code: "", // 手输入码 / 扫出的奖金码 |
20 | memberCode: "", // 扫出的用户码 | 20 | memberCode: "", // 扫出的用户码 |
21 | isVerify: true, // 是否已经认证 | 21 | isVerify: true, // 是否已经认证 |
... | @@ -28,6 +28,7 @@ Page({ | ... | @@ -28,6 +28,7 @@ Page({ |
28 | }, | 28 | }, |
29 | onLoad(options) { | 29 | onLoad(options) { |
30 | let q = decodeURIComponent(options.q); | 30 | let q = decodeURIComponent(options.q); |
31 | |||
31 | // 获取会员码 | 32 | // 获取会员码 |
32 | let m = getQueryByUrl("m", q); | 33 | let m = getQueryByUrl("m", q); |
33 | // 获取奖金码 | 34 | // 获取奖金码 |
... | @@ -157,6 +158,43 @@ Page({ | ... | @@ -157,6 +158,43 @@ Page({ |
157 | }) | 158 | }) |
158 | }, | 159 | }, |
159 | 160 | ||
161 | /** | ||
162 | * 我的二维码 | ||
163 | */ | ||
164 | onMyQrcodeHandler(evt) { | ||
165 | app.router.push({ | ||
166 | path: "myQrcode" | ||
167 | }) | ||
168 | }, | ||
169 | |||
170 | /** | ||
171 | * 排行榜 | ||
172 | */ | ||
173 | onRankHandler(evt) { | ||
174 | console.log("rank"); | ||
175 | app.router.push({ | ||
176 | path: "rank" | ||
177 | }) | ||
178 | }, | ||
179 | |||
180 | /** | ||
181 | * 点击拍卖 | ||
182 | */ | ||
183 | onAuctionHandler(evt) { | ||
184 | app.router.push({ | ||
185 | path: "auctionList" | ||
186 | }) | ||
187 | }, | ||
188 | |||
189 | /** | ||
190 | * 点击秒杀 | ||
191 | */ | ||
192 | onSeckillHandler(evt) { | ||
193 | app.router.push({ | ||
194 | path: "seckillList" | ||
195 | }) | ||
196 | }, | ||
197 | |||
160 | 198 | ||
161 | /** | 199 | /** |
162 | * 请求产品 | 200 | * 请求产品 |
... | @@ -211,6 +249,7 @@ Page({ | ... | @@ -211,6 +249,7 @@ Page({ |
211 | this.setData({ | 249 | this.setData({ |
212 | userInfo: result | 250 | userInfo: result |
213 | }) | 251 | }) |
252 | app.globalData.userInfo = result; | ||
214 | resolve(result); | 253 | resolve(result); |
215 | }) | 254 | }) |
216 | }); | 255 | }); | ... | ... |
... | @@ -21,29 +21,74 @@ $contentWidth:670px; | ... | @@ -21,29 +21,74 @@ $contentWidth:670px; |
21 | &-bg { | 21 | &-bg { |
22 | position: absolute; | 22 | position: absolute; |
23 | width: 750px; | 23 | width: 750px; |
24 | height: 300px; | 24 | height: 360px; |
25 | } | 25 | } |
26 | 26 | ||
27 | .space1 { | 27 | .space1 { |
28 | height: 222px; | 28 | height: 12px; |
29 | } | ||
30 | |||
31 | .scan { | ||
32 | position: relative; | ||
33 | text-align: center; | ||
34 | color: #ffffff; | ||
35 | font-size: 26px; | ||
36 | |||
37 | &-icon { | ||
38 | width: 108px; | ||
39 | } | ||
40 | |||
41 | &-t1 { | ||
42 | margin-top: 12px; | ||
43 | } | ||
44 | } | ||
45 | |||
46 | .data { | ||
47 | width: 730px; | ||
48 | margin: 0 auto; | ||
49 | position: relative; | ||
50 | display: flex; | ||
51 | justify-content: space-between; | ||
52 | text-align: center; | ||
53 | color: #ffffff; | ||
54 | |||
55 | &-item { | ||
56 | width: 320px; | ||
57 | // background-color: wheat; | ||
58 | |||
59 | &-t1 { | ||
60 | font-size: 50px; | ||
61 | } | ||
62 | |||
63 | &-t2 { | ||
64 | font-size: 24px; | ||
65 | color: rgba(255, 255, 255, 0.7); | ||
66 | } | ||
67 | } | ||
29 | } | 68 | } |
30 | 69 | ||
31 | .search { | 70 | .search { |
32 | position: relative; | 71 | position: relative; |
33 | width: $contentWidth; | 72 | width: $contentWidth; |
34 | height: 100px; | 73 | // height: 100px; |
74 | width: 621px; | ||
75 | height: 84px; | ||
76 | border-radius: 42px; | ||
77 | box-shadow: 0px 6px 23.5px 1.5px rgba(112, 168, 239, 0.17); | ||
78 | background-color: #ffffff; | ||
35 | background: #FFFFFF; | 79 | background: #FFFFFF; |
36 | @extend .shadow; | 80 | @extend .shadow; |
37 | // margin: 222px auto 0; | 81 | // margin: 222px auto 0; |
38 | margin: 0 auto 0; | 82 | margin: 16px auto 0; |
39 | display: flex; | 83 | display: flex; |
40 | justify-content: space-between; | 84 | // justify-content: space-between; |
41 | align-items: center; | 85 | align-items: center; |
42 | 86 | ||
43 | &-ipt-wrap { | 87 | &-ipt-wrap { |
44 | @extend .bb; | 88 | @extend .bb; |
45 | padding-left: 30px; | 89 | // padding-left: 30px; |
46 | width: 320px; | 90 | // width: 320px; |
91 | flex: 1; | ||
47 | 92 | ||
48 | .ipt { | 93 | .ipt { |
49 | font-size: 28px; | 94 | font-size: 28px; |
... | @@ -58,9 +103,11 @@ $contentWidth:670px; | ... | @@ -58,9 +103,11 @@ $contentWidth:670px; |
58 | } | 103 | } |
59 | 104 | ||
60 | &-scan { | 105 | &-scan { |
106 | @extend .bb; | ||
61 | @extend .fcc; | 107 | @extend .fcc; |
62 | width: 100px; | 108 | width: 100px; |
63 | height: 100px; | 109 | height: 100px; |
110 | padding-left: 24px; | ||
64 | 111 | ||
65 | .icon { | 112 | .icon { |
66 | width: 40px; | 113 | width: 40px; |
... | @@ -96,8 +143,7 @@ $contentWidth:670px; | ... | @@ -96,8 +143,7 @@ $contentWidth:670px; |
96 | } | 143 | } |
97 | 144 | ||
98 | .top-space { | 145 | .top-space { |
99 | // height: 362px; | 146 | height: 64px; |
100 | height: 80px; | ||
101 | } | 147 | } |
102 | 148 | ||
103 | .content { | 149 | .content { |
... | @@ -105,11 +151,33 @@ $contentWidth:670px; | ... | @@ -105,11 +151,33 @@ $contentWidth:670px; |
105 | width: $contentWidth; | 151 | width: $contentWidth; |
106 | margin: 0 auto; | 152 | margin: 0 auto; |
107 | 153 | ||
154 | // 导航 | ||
155 | .nav { | ||
156 | @extend .bb; | ||
157 | display: flex; | ||
158 | justify-content: space-between; | ||
159 | // width: 100%; | ||
160 | padding: 0 12px; | ||
161 | |||
162 | &-item { | ||
163 | text-align: center; | ||
164 | |||
165 | .icon { | ||
166 | width: 86px; | ||
167 | } | ||
168 | |||
169 | .t1 { | ||
170 | color: #333333; | ||
171 | font-size: 26px; | ||
172 | } | ||
173 | } | ||
174 | } | ||
175 | |||
108 | // banner | 176 | // banner |
109 | .banner { | 177 | .banner { |
110 | width: $contentWidth; | 178 | width: $contentWidth; |
111 | height: 250px; | 179 | height: 250px; |
112 | margin: 0 auto; | 180 | margin: 42px auto 0; |
113 | 181 | ||
114 | .swiper { | 182 | .swiper { |
115 | width: $contentWidth; | 183 | width: $contentWidth; | ... | ... |
1 | <wxs module="filter" src="../../utils/utilswxs.wxs"></wxs> | ||
1 | <view class="page"> | 2 | <view class="page"> |
2 | <view class="app__bgc bgc"></view> | 3 | <view class="app__bgc bgc"></view> |
3 | <view class="app__bg bg"></view> | 4 | <view class="app__bg bg"></view> |
... | @@ -6,23 +7,55 @@ | ... | @@ -6,23 +7,55 @@ |
6 | <view class="top"> | 7 | <view class="top"> |
7 | <image class="top-bg" mode="widthFix" src="../../image/index/index-c1.png" /> | 8 | <image class="top-bg" mode="widthFix" src="../../image/index/index-c1.png" /> |
8 | <view class="space1"></view> | 9 | <view class="space1"></view> |
9 | <view class="search"> | 10 | <view class="scan"> |
10 | <view class="search-ipt-wrap"> | 11 | <image bindtap="onScanHandler" mode="widthFix" class="scan-icon" src="../../image/index/icon-scan.png" /> |
11 | <input value="{{code}}" bindinput="bindCodeInput" class="ipt" placeholder="请输入串码" /> | 12 | <view class="icon-t1">点击扫码</view> |
13 | </view> | ||
14 | <view class="data"> | ||
15 | <view class="data-item"> | ||
16 | <view class="data-item-t1"> | ||
17 | {{userInfo&&userInfo.memberPoints ? filter.Fen2Yuan(userInfo.memberPoints) + '元' : '-' }} | ||
12 | </view> | 18 | </view> |
19 | <view class="data-item-t2">我的奖金</view> | ||
20 | </view> | ||
21 | <view class="data-item"> | ||
22 | <view class="data-item-t1">{{userInfo ? userInfo.promotionNum + '人' : '-' }}</view> | ||
23 | <view class="data-item-t2">推广人数</view> | ||
24 | </view> | ||
25 | </view> | ||
26 | <view class="search"> | ||
13 | <view bindtap="onSearchHandler" class="search-scan"> | 27 | <view bindtap="onSearchHandler" class="search-scan"> |
14 | <image class="icon icon-search" mode="aspectFit" src="../../image/icon/icon-search.png" /> | 28 | <image class="icon icon-search" mode="aspectFit" src="../../image/icon/icon-search.png" /> |
15 | </view> | 29 | </view> |
16 | <view class="search-line"></view> | 30 | <view class="search-ipt-wrap"> |
17 | <!-- 隐藏扫描二维码 --> | 31 | <input value="{{code}}" bindinput="bindCodeInput" class="ipt" placeholder="请输入串码" /> |
18 | <view bindtap="onScanHandler" class="search-scan search-scan2"> | ||
19 | <text class="t1">扫码得奖金</text> | ||
20 | <image class="icon icon2" mode="aspectFit" src="../../image/icon/icon-scan.png" /> | ||
21 | </view> | 32 | </view> |
22 | </view> | 33 | </view> |
23 | </view> | 34 | </view> |
24 | <view class="top-space"></view> | 35 | <view class="top-space"></view> |
25 | <view class="content"> | 36 | <view class="content"> |
37 | <view class="nav"> | ||
38 | <view bindtap="onMyQrcodeHandler" class="nav-item"> | ||
39 | <image class="icon" mode="widthFix" src="../../image/index/icon-qrcode.png" /> | ||
40 | <view class="t1">二维码</view> | ||
41 | </view> | ||
42 | <view bindtap="toVipLoginHandler" class="nav-item"> | ||
43 | <image class="icon" mode="widthFix" src="../../image/index/icon-verify.png" /> | ||
44 | <view class="t1">去认证</view> | ||
45 | </view> | ||
46 | <view bindtap="onRankHandler" class="nav-item"> | ||
47 | <image class="icon" mode="widthFix" src="../../image/index/icon-rank.png" /> | ||
48 | <view class="t1">排行榜</view> | ||
49 | </view> | ||
50 | <view bindtap="onAuctionHandler" class="nav-item"> | ||
51 | <image class="icon" mode="widthFix" src="../../image/index/icon-seckill.png" /> | ||
52 | <view class="t1">秒杀</view> | ||
53 | </view> | ||
54 | <view bindtap="onAuctionHandler" class="nav-item"> | ||
55 | <image class="icon" mode="widthFix" src="../../image/index/icon-auction.png" /> | ||
56 | <view class="t1">拍卖</view> | ||
57 | </view> | ||
58 | </view> | ||
26 | <!-- 轮播 banner --> | 59 | <!-- 轮播 banner --> |
27 | <view class="banner"> | 60 | <view class="banner"> |
28 | <swiper class="swiper" indicator-color="rgba(0,0,0,.3)" indicator-active-color="rgba(255,255,255,1)" indicator-dots="{{true}}" autoplay="{{true}}" interval="{{5000}}" duration="{{500}}"> | 61 | <swiper class="swiper" indicator-color="rgba(0,0,0,.3)" indicator-active-color="rgba(255,255,255,1)" indicator-dots="{{true}}" autoplay="{{true}}" interval="{{5000}}" duration="{{500}}"> | ... | ... |
src/pages/my-qrcode-bk/my-qrcode.js
deleted
100755 → 0
1 | import QR from '../../utils/qrcode' | ||
2 | import Poster from '../../miniprogram_dist/poster/poster'; | ||
3 | |||
4 | let app = getApp(); | ||
5 | Page({ | ||
6 | data: { | ||
7 | authorizeVisible: false, | ||
8 | userInfo: {}, | ||
9 | qrImagePath: "", | ||
10 | imageUrl: "", | ||
11 | }, | ||
12 | onShareAppMessage() {}, | ||
13 | showAuth() { | ||
14 | this.setData({ | ||
15 | authorizeVisible: true | ||
16 | }) | ||
17 | }, | ||
18 | onLoad(options) { | ||
19 | this.initData(); | ||
20 | }, | ||
21 | initData() { | ||
22 | // 获取用户信息 小程序码 | ||
23 | this.queryMember().then((result) => { | ||
24 | wx.showLoading({ | ||
25 | title: '二维码生成中···', | ||
26 | }); | ||
27 | // 获取海报数据 | ||
28 | let posterData = this.getPosterConfig(); | ||
29 | // 绘制设置海报 | ||
30 | this.onCreatePoster(posterData); | ||
31 | }); | ||
32 | }, | ||
33 | |||
34 | onPosterSuccess(e) { | ||
35 | wx.hideLoading(); | ||
36 | const { | ||
37 | detail | ||
38 | } = e; | ||
39 | console.log("detail:", detail) | ||
40 | this.setData({ | ||
41 | imageUrl: detail | ||
42 | }) | ||
43 | }, | ||
44 | onPosterFail(err) { | ||
45 | wx.hideLoading(); | ||
46 | console.error(err); | ||
47 | }, | ||
48 | |||
49 | /** | ||
50 | * 异步生成海报 | ||
51 | */ | ||
52 | onCreatePoster(posterConfig) { | ||
53 | console.log("posterConfig:", posterConfig); | ||
54 | this.setData({ | ||
55 | posterConfig: posterConfig | ||
56 | }, () => { | ||
57 | Poster.create(true); // 入参:true为抹掉重新生成 | ||
58 | }); | ||
59 | }, | ||
60 | |||
61 | // 获取海报数据 | ||
62 | getPosterConfig() { | ||
63 | // 合成图片需要的数据 | ||
64 | let { | ||
65 | userInfo | ||
66 | } = this.data; | ||
67 | |||
68 | let blocks = [{ | ||
69 | x: 0, | ||
70 | y: 0, | ||
71 | width: 690, | ||
72 | height: 900, | ||
73 | backgroundColor: "#ffffff", | ||
74 | borderRadius: 10, | ||
75 | }]; | ||
76 | let images = [{ | ||
77 | x: 286, | ||
78 | y: 30, | ||
79 | width: 120, | ||
80 | height: 120, | ||
81 | borderRadius: 120, | ||
82 | zIndex: 11, | ||
83 | url: userInfo.avatar, | ||
84 | }, { | ||
85 | x: 126, | ||
86 | y: 220, | ||
87 | width: 440, | ||
88 | height: 440, | ||
89 | zIndex: 11, | ||
90 | url: userInfo.memberUrl, | ||
91 | }]; | ||
92 | let lines = []; | ||
93 | let texts = [{ | ||
94 | x: 690 / 2, | ||
95 | y: 192, | ||
96 | width: 690, | ||
97 | fontSize: 36, | ||
98 | color: "#3680EB", | ||
99 | textAlign: "center", | ||
100 | zIndex: 11, | ||
101 | text: userInfo.nickname, | ||
102 | }, | ||
103 | { | ||
104 | x: 690 / 2, | ||
105 | y: 640, | ||
106 | width: 690, | ||
107 | fontSize: 28, | ||
108 | color: "#666666", | ||
109 | textAlign: "center", | ||
110 | zIndex: 11, | ||
111 | text: userInfo.memberCode, | ||
112 | }, | ||
113 | { | ||
114 | x: 690 / 2, | ||
115 | y: 740, | ||
116 | width: 690, | ||
117 | fontSize: 28, | ||
118 | color: "#666666", | ||
119 | textAlign: "center", | ||
120 | zIndex: 11, | ||
121 | text: "深士照明", | ||
122 | }, { | ||
123 | x: 690 / 2, | ||
124 | y: 800, | ||
125 | width: 690, | ||
126 | fontSize: 28, | ||
127 | color: "#666666", | ||
128 | textAlign: "center", | ||
129 | zIndex: 11, | ||
130 | text: "扫码即获专属奖金,兑换超值奖品", | ||
131 | } | ||
132 | ]; | ||
133 | |||
134 | let posterData = { | ||
135 | width: 690, | ||
136 | height: 900, | ||
137 | debug: false, | ||
138 | blocks: blocks, | ||
139 | images: images, | ||
140 | lines: lines, | ||
141 | texts: texts, | ||
142 | } | ||
143 | return posterData; | ||
144 | }, | ||
145 | |||
146 | /** | ||
147 | * 获取会员信息 | ||
148 | */ | ||
149 | queryMember() { | ||
150 | let _this = this; | ||
151 | return new Promise((resolve, reject) => { | ||
152 | app.post({ | ||
153 | url: app.api.member, | ||
154 | data: {} | ||
155 | }).then((result) => { | ||
156 | let userInfo = result | ||
157 | _this.setData({ | ||
158 | userInfo: userInfo, | ||
159 | qrImagePath: userInfo.memberUrl, | ||
160 | }) | ||
161 | resolve(); | ||
162 | }) | ||
163 | }); | ||
164 | }, | ||
165 | |||
166 | /** | ||
167 | * 图片查看 | ||
168 | */ | ||
169 | onPreviewImageHandler(evt) { | ||
170 | // let curItem = getBindtapData(evt); | ||
171 | // let index = getBindtapData(evt, "index"); | ||
172 | // let current = curItem[index] || ''; | ||
173 | console.log("onPreviewImageHandler") | ||
174 | let current = this.data.imageUrl; | ||
175 | let urls = [current]; | ||
176 | wx.previewImage({ | ||
177 | current: current, | ||
178 | urls: urls | ||
179 | }) | ||
180 | }, | ||
181 | |||
182 | /** | ||
183 | * 保存图片到本地 | ||
184 | */ | ||
185 | saveImageToPhotosAlbum() { | ||
186 | let _this = this; | ||
187 | if (!_this.data.imageUrl) { | ||
188 | wx.showToast({ | ||
189 | title: "图片加载中,请重试", | ||
190 | icon: "none" | ||
191 | }) | ||
192 | return; | ||
193 | } | ||
194 | wx.saveImageToPhotosAlbum({ | ||
195 | filePath: _this.data.imageUrl, | ||
196 | success(res) { | ||
197 | wx.showToast({ | ||
198 | title: '保存成功', | ||
199 | icon: 'success' | ||
200 | }); | ||
201 | }, | ||
202 | fail(err) { | ||
203 | wx.getSetting({ | ||
204 | success: (res) => { | ||
205 | if (!res.authSetting['scope.writePhotosAlbum']) { | ||
206 | // 未授权 | ||
207 | wx.showModal({ | ||
208 | title: '提示', | ||
209 | content: '小程序请求访问相册权限', | ||
210 | confirmText: '前往授权', | ||
211 | success(res) { | ||
212 | if (res.confirm) { | ||
213 | wx.openSetting({ | ||
214 | success(res) {} | ||
215 | }) | ||
216 | } else if (res.cancel) {} | ||
217 | } | ||
218 | }) | ||
219 | } | ||
220 | } | ||
221 | }) | ||
222 | } | ||
223 | }) | ||
224 | }, | ||
225 | |||
226 | |||
227 | // 创建二维码 | ||
228 | createQrCode(content, canvasId, cavW, cavH) { | ||
229 | //调用插件中的draw方法,绘制二维码图片 | ||
230 | QR.api.draw(content, canvasId, cavW, cavH); | ||
231 | this.canvasToTempImage(canvasId); | ||
232 | }, | ||
233 | //获取临时缓存图片路径,存入data中 | ||
234 | canvasToTempImage(canvasId) { | ||
235 | let that = this; | ||
236 | wx.canvasToTempFilePath({ | ||
237 | canvasId, // 这里canvasId即之前创建的canvas-id | ||
238 | success: function (res) { | ||
239 | let tempFilePath = res.tempFilePath; | ||
240 | console.log(tempFilePath); | ||
241 | that.setData({ // 如果采用mpvue,即 this.imagePath = tempFilePath | ||
242 | qrImagePath: tempFilePath, | ||
243 | }); | ||
244 | }, | ||
245 | fail: function (res) { | ||
246 | console.log(res); | ||
247 | } | ||
248 | }); | ||
249 | }, | ||
250 | //适配不同屏幕大小的canvas | ||
251 | setCanvasSize(sz) { | ||
252 | var size = {}; | ||
253 | try { | ||
254 | var res = wx.getSystemInfoSync(); | ||
255 | var scale = 750 / sz; //不同屏幕下canvas的适配比例;设计稿是750宽 | ||
256 | var width = res.windowWidth / scale; | ||
257 | var height = width; //canvas画布为正方形 | ||
258 | size.w = width; | ||
259 | size.h = height; | ||
260 | } catch (e) { | ||
261 | // Do something when catch error | ||
262 | console.log("获取设备信息失败" + e); | ||
263 | } | ||
264 | return size; | ||
265 | }, | ||
266 | |||
267 | // 隐藏蒙层 | ||
268 | hideMask() { | ||
269 | this.setData({ | ||
270 | authorizeVisible: false, | ||
271 | }) | ||
272 | }, | ||
273 | // 子组件事件 | ||
274 | evtcomp(evt) { | ||
275 | let { | ||
276 | name, | ||
277 | data | ||
278 | } = evt.detail; | ||
279 | switch (name) { | ||
280 | |||
281 | // 隐藏弹窗 | ||
282 | case "_evt_hide_mask": | ||
283 | this.hideMask(); | ||
284 | break; | ||
285 | |||
286 | default: | ||
287 | break; | ||
288 | } | ||
289 | }, | ||
290 | |||
291 | }) |
1 | @import '../../assets/scss/mixins'; | ||
2 | @import '../../assets/scss/utils'; | ||
3 | |||
4 | $contentWidth:690px; | ||
5 | |||
6 | .page { | ||
7 | padding-bottom: $pageBottom; | ||
8 | |||
9 | .bgc { | ||
10 | background: #3680EB; | ||
11 | } | ||
12 | |||
13 | .bg {} | ||
14 | |||
15 | .main { | ||
16 | font-size: 28px; | ||
17 | |||
18 | .top-space { | ||
19 | height: 40px; | ||
20 | } | ||
21 | |||
22 | .content { | ||
23 | position: relative; | ||
24 | |||
25 | .card { | ||
26 | margin: 0 auto; | ||
27 | // padding: 20px 0 74px; | ||
28 | width: $contentWidth; | ||
29 | // background: #FFFFFF; | ||
30 | // box-shadow: 0 3px 9px 0 rgba(0, 0, 0, 0.10); | ||
31 | border-radius: 10px; | ||
32 | text-align: center; | ||
33 | font-size: 32px; | ||
34 | |||
35 | .my-card { | ||
36 | width: 690px; | ||
37 | height: 900px; | ||
38 | } | ||
39 | |||
40 | .avatar { | ||
41 | width: 120px; | ||
42 | height: 120px; | ||
43 | border-radius: 120px; | ||
44 | } | ||
45 | |||
46 | .nickname { | ||
47 | margin: 8px 0 0; | ||
48 | font-size: 36px; | ||
49 | color: #3680EB; | ||
50 | } | ||
51 | |||
52 | .qrcode { | ||
53 | margin-top: 24px; | ||
54 | width: 440px; | ||
55 | height: 440px; | ||
56 | } | ||
57 | |||
58 | .t1 { | ||
59 | margin-top: 20px; | ||
60 | color: #666666; | ||
61 | } | ||
62 | |||
63 | .t2 { | ||
64 | margin-top: 40px; | ||
65 | } | ||
66 | } | ||
67 | |||
68 | .tips { | ||
69 | margin: 20px auto 0; | ||
70 | color: #FFFFFF; | ||
71 | text-align: center; | ||
72 | } | ||
73 | |||
74 | .btn-wrap { | ||
75 | margin-top: 40px; | ||
76 | |||
77 | .btn { | ||
78 | margin: 0 auto; | ||
79 | @include btc(320px, 84px); | ||
80 | border-radius: 8px; | ||
81 | background: #FFFFFF; | ||
82 | color: #3680EB; | ||
83 | font-size: 32px; | ||
84 | } | ||
85 | } | ||
86 | } | ||
87 | } | ||
88 | } |
1 | <poster id="poster" hide-loading="{{true}}" preload="{{false}}" config="{{posterConfig}}" bind:success="onPosterSuccess" bind:fail="onPosterFail"></poster> | ||
2 | <view class="page"> | ||
3 | <view class="app__bgc bgc"></view> | ||
4 | <view class="app__bg bg"></view> | ||
5 | <view class="app__content main"> | ||
6 | <view class="top-space"></view> | ||
7 | <view class="content"> | ||
8 | <view class="card"> | ||
9 | <image bindtap="onPreviewImageHandler" class="my-card" mode="widthFix" src="{{imageUrl}}" /> | ||
10 | </view> | ||
11 | <view class="tips">分享邀请好友加入,赢取推广奖金</view> | ||
12 | <view class="btn-wrap"> | ||
13 | <view bindtap="saveImageToPhotosAlbum" class="btn">保存图片</view> | ||
14 | </view> | ||
15 | </view> | ||
16 | </view> | ||
17 | </view> | ||
18 | <van-popup show="{{ authorizeVisible }}"> | ||
19 | <authorize-comp bind:evtcomp="evtcomp"></authorize-comp> | ||
20 | </van-popup> |
... | @@ -191,11 +191,14 @@ Page({ | ... | @@ -191,11 +191,14 @@ Page({ |
191 | }) | 191 | }) |
192 | return; | 192 | return; |
193 | } | 193 | } |
194 | wx.setClipboardData({ | ||
195 | data: '「深士照明」50万电工奖\n分享二维码:邀请好友就获奖\n好友购买:再获105返现奖金', | ||
196 | success(res) { | ||
194 | wx.saveImageToPhotosAlbum({ | 197 | wx.saveImageToPhotosAlbum({ |
195 | filePath: _this.data.imageUrl, | 198 | filePath: _this.data.imageUrl, |
196 | success(res) { | 199 | success(res) { |
197 | wx.showToast({ | 200 | wx.showToast({ |
198 | title: '保存成功', | 201 | title: '操作成功', |
199 | icon: 'success' | 202 | icon: 'success' |
200 | }); | 203 | }); |
201 | }, | 204 | }, |
... | @@ -221,6 +224,42 @@ Page({ | ... | @@ -221,6 +224,42 @@ Page({ |
221 | }) | 224 | }) |
222 | } | 225 | } |
223 | }) | 226 | }) |
227 | } | ||
228 | }) | ||
229 | |||
230 | |||
231 | |||
232 | |||
233 | // wx.saveImageToPhotosAlbum({ | ||
234 | // filePath: _this.data.imageUrl, | ||
235 | // success(res) { | ||
236 | // wx.showToast({ | ||
237 | // title: '保存成功', | ||
238 | // icon: 'success' | ||
239 | // }); | ||
240 | // }, | ||
241 | // fail(err) { | ||
242 | // wx.getSetting({ | ||
243 | // success: (res) => { | ||
244 | // if (!res.authSetting['scope.writePhotosAlbum']) { | ||
245 | // // 未授权 | ||
246 | // wx.showModal({ | ||
247 | // title: '提示', | ||
248 | // content: '小程序请求访问相册权限', | ||
249 | // confirmText: '前往授权', | ||
250 | // success(res) { | ||
251 | // if (res.confirm) { | ||
252 | // wx.openSetting({ | ||
253 | // success(res) {} | ||
254 | // }) | ||
255 | // } else if (res.cancel) {} | ||
256 | // } | ||
257 | // }) | ||
258 | // } | ||
259 | // } | ||
260 | // }) | ||
261 | // } | ||
262 | // }) | ||
224 | }, | 263 | }, |
225 | 264 | ||
226 | 265 | ... | ... |
... | @@ -9,10 +9,10 @@ | ... | @@ -9,10 +9,10 @@ |
9 | <image bindtap="onPreviewImageHandler" class="my-card" mode="widthFix" src="{{imageUrl}}" /> | 9 | <image bindtap="onPreviewImageHandler" class="my-card" mode="widthFix" src="{{imageUrl}}" /> |
10 | </view> | 10 | </view> |
11 | <view class="tips"> | 11 | <view class="tips"> |
12 | <text>保存分享朋友圈,邀请好友赢奖金\n好友购买产品,再获10%奖金</text> | 12 | <text>「深士照明」50万电工奖\n分享二维码:邀请好友就获奖\n好友购买:再获105返现奖金</text> |
13 | </view> | 13 | </view> |
14 | <view class="btn-wrap"> | 14 | <view class="btn-wrap"> |
15 | <view bindtap="saveImageToPhotosAlbum" class="btn">保存图片</view> | 15 | <view bindtap="saveImageToPhotosAlbum" class="btn">保存照片|复制文字</view> |
16 | </view> | 16 | </view> |
17 | </view> | 17 | </view> |
18 | </view> | 18 | </view> | ... | ... |
... | @@ -282,7 +282,9 @@ $contentWidth: 690px; | ... | @@ -282,7 +282,9 @@ $contentWidth: 690px; |
282 | } | 282 | } |
283 | 283 | ||
284 | &-wrap { | 284 | &-wrap { |
285 | margin: 40px auto 4px; | 285 | @extend .bb; |
286 | padding: 0 48px; | ||
287 | margin: 4px auto 4px; | ||
286 | display: flex; | 288 | display: flex; |
287 | justify-content: space-between; | 289 | justify-content: space-between; |
288 | 290 | ... | ... |
... | @@ -64,18 +64,18 @@ | ... | @@ -64,18 +64,18 @@ |
64 | </view> | 64 | </view> |
65 | <!-- 功能区 --> | 65 | <!-- 功能区 --> |
66 | <view class="border func"> | 66 | <view class="border func"> |
67 | <view bindtap="onMyQrcodeHandler" class="my-qrcode"> | 67 | <!-- <view bindtap="onMyQrcodeHandler" class="my-qrcode"> |
68 | <image class="qrcode" mode="widthFix" src="../../image/icon/icon-qrcode.png" /> | 68 | <image class="qrcode" mode="widthFix" src="../../image/icon/icon-qrcode.png" /> |
69 | <view class="t1">我的二维码</view> | 69 | <view class="t1">我的二维码</view> |
70 | </view> | 70 | </view> --> |
71 | <!-- 功能区 --> | 71 | <!-- 功能区 --> |
72 | <view class="func-wrap"> | 72 | <view class="func-wrap"> |
73 | <view bindtap="onRankHandler" class="func-wrap-item"> | 73 | <!-- <view bindtap="onRankHandler" class="func-wrap-item"> |
74 | <view class="icon-wrap"> | 74 | <view class="icon-wrap"> |
75 | <image class="icon" mode="aspectFit" src="../../image/icon/icon-integral-rank.png" /> | 75 | <image class="icon" mode="aspectFit" src="../../image/icon/icon-integral-rank.png" /> |
76 | </view> | 76 | </view> |
77 | <view class="txt">奖金排行</view> | 77 | <view class="txt">奖金排行</view> |
78 | </view> | 78 | </view> --> |
79 | <view bindtap="onAddressHandler" class="func-wrap-item"> | 79 | <view bindtap="onAddressHandler" class="func-wrap-item"> |
80 | <view class="icon-wrap"> | 80 | <view class="icon-wrap"> |
81 | <image class="icon" mode="aspectFit" src="../../image/icon/icon-my-address.png" /> | 81 | <image class="icon" mode="aspectFit" src="../../image/icon/icon-my-address.png" /> |
... | @@ -98,7 +98,7 @@ | ... | @@ -98,7 +98,7 @@ |
98 | </view> | 98 | </view> |
99 | </view> | 99 | </view> |
100 | <!-- 活动区 拍卖和秒杀 --> | 100 | <!-- 活动区 拍卖和秒杀 --> |
101 | <view class="border active" wx:if="{{1>0}}"> | 101 | <view class="border active" wx:if="{{1>10}}"> |
102 | <view bindtap="onAuctionHandler" data-index="0" class="active-item"> | 102 | <view bindtap="onAuctionHandler" data-index="0" class="active-item"> |
103 | <view class="icon-wrap"> | 103 | <view class="icon-wrap"> |
104 | <span class="iconfont iconpaimai icon"></span> | 104 | <span class="iconfont iconpaimai icon"></span> | ... | ... |
... | @@ -229,9 +229,9 @@ Page({ | ... | @@ -229,9 +229,9 @@ Page({ |
229 | } else if (!verifyCode) { | 229 | } else if (!verifyCode) { |
230 | this.showTips("请输入验证码"); | 230 | this.showTips("请输入验证码"); |
231 | reject(); | 231 | reject(); |
232 | } else if (pics.length <= 0) { | 232 | // } else if (pics.length <= 0) { |
233 | this.showTips("请上传身份证或电工证"); | 233 | // this.showTips("请上传身份证或电工证"); |
234 | reject(); | 234 | // reject(); |
235 | } else { | 235 | } else { |
236 | resolve(); | 236 | resolve(); |
237 | } | 237 | } | ... | ... |
... | @@ -11,10 +11,6 @@ | ... | @@ -11,10 +11,6 @@ |
11 | <view class="label">真实姓名</view> | 11 | <view class="label">真实姓名</view> |
12 | <input disabled="{{isModify}}" class="cont {{isModify ? 'modify' :''}}" value="{{name}}" bindinput="bindNameInput" placeholder="请输入" /> | 12 | <input disabled="{{isModify}}" class="cont {{isModify ? 'modify' :''}}" value="{{name}}" bindinput="bindNameInput" placeholder="请输入" /> |
13 | </view> | 13 | </view> |
14 | <view class="form-item"> | ||
15 | <view class="label">店名</view> | ||
16 | <input disabled="{{isModify}}" class="cont {{isModify ? 'modify' :''}}" value="{{shopName}}" bindinput="bindShopNameInput" placeholder="选填" /> | ||
17 | </view> | ||
18 | <picker disabled="{{isModify}}" value="{{membersShipIndex}}" range="{{membersShipList}}" range-key="memberTypeName" bindchange="bindMembersShipChange"> | 14 | <picker disabled="{{isModify}}" value="{{membersShipIndex}}" range="{{membersShipList}}" range-key="memberTypeName" bindchange="bindMembersShipChange"> |
19 | <view class="form-item"> | 15 | <view class="form-item"> |
20 | <view class="label">会员身份</view> | 16 | <view class="label">会员身份</view> |
... | @@ -25,6 +21,10 @@ | ... | @@ -25,6 +21,10 @@ |
25 | </view> | 21 | </view> |
26 | </picker> | 22 | </picker> |
27 | <view class="form-item"> | 23 | <view class="form-item"> |
24 | <view class="label">店名</view> | ||
25 | <input disabled="{{isModify}}" class="cont {{isModify ? 'modify' :''}}" value="{{shopName}}" bindinput="bindShopNameInput" placeholder="选填" /> | ||
26 | </view> | ||
27 | <view class="form-item"> | ||
28 | <view class="label">销售区域</view> | 28 | <view class="label">销售区域</view> |
29 | <view class="cont address"> | 29 | <view class="cont address"> |
30 | <picker disabled="{{isModify}}" class="area {{isModify ? 'modify' :''}}" bindchange="bindPickerChangeProvince" value="{{provinceIndex}}" range="{{provinceList}}" range-key="areaName"> | 30 | <picker disabled="{{isModify}}" class="area {{isModify ? 'modify' :''}}" bindchange="bindPickerChangeProvince" value="{{provinceIndex}}" range="{{provinceList}}" range-key="areaName"> |
... | @@ -53,7 +53,7 @@ | ... | @@ -53,7 +53,7 @@ |
53 | <!-- 上传 --> | 53 | <!-- 上传 --> |
54 | <view class="upload"> | 54 | <view class="upload"> |
55 | <!-- <view class="upload-tit">请上传身份证或电工证,审核后,可签到及兑换奖金</view> --> | 55 | <!-- <view class="upload-tit">请上传身份证或电工证,审核后,可签到及兑换奖金</view> --> |
56 | <view class="upload-wrap"> | 56 | <!-- <view class="upload-wrap"> |
57 | <view class="upload-wrap-item"> | 57 | <view class="upload-wrap-item"> |
58 | <image class="image" bindtap="onUploadHandler" mode="aspectFit" src="{{files[0] && files[0].path?files[0].path:'../../image/icon/icon-plus.png'}}" /> | 58 | <image class="image" bindtap="onUploadHandler" mode="aspectFit" src="{{files[0] && files[0].path?files[0].path:'../../image/icon/icon-plus.png'}}" /> |
59 | <view class="tips">身份证正面</view> | 59 | <view class="tips">身份证正面</view> |
... | @@ -62,13 +62,16 @@ | ... | @@ -62,13 +62,16 @@ |
62 | <image class="image" mode="aspectFit" src="../../image/icon/icon-id-card.png" /> | 62 | <image class="image" mode="aspectFit" src="../../image/icon/icon-id-card.png" /> |
63 | <view class="tips">示例</view> | 63 | <view class="tips">示例</view> |
64 | </view> | 64 | </view> |
65 | </view> | 65 | </view> --> |
66 | <view class="submit-tips"> | 66 | <!-- <view class="submit-tips"> |
67 | <text class="text">五金分销商请填写店名,提交营业执照或名片\n其他用户请上传电工证或身份证\n认证后可参与签到及兑换奖金</text> | 67 | <text class="text">五金分销商请填写店名,提交营业执照或名片\n其他用户请上传电工证或身份证\n认证后可参与签到及兑换奖金</text> |
68 | </view> | 68 | </view> --> |
69 | </view> | 69 | </view> |
70 | <!-- 提交按钮 --> | 70 | <!-- 提交按钮 --> |
71 | <view class="submit-btn" bindtap="onSubmitHandler">确认提交</view> | 71 | <view class="submit-btn" bindtap="onSubmitHandler">确认提交</view> |
72 | <view class="submit-tips"> | ||
73 | <text class="text">预计一个工作日内完成认证\n请正确填写信息</text> | ||
74 | </view> | ||
72 | </view> | 75 | </view> |
73 | </view> | 76 | </view> |
74 | </view> | 77 | </view> | ... | ... |
-
Please register or sign in to post a comment