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UPv3;&PgTe(%kRTGtuKJd2UJgwCMP^aTcpG*LTzxXl
z4}-tVNp;*BB0BQq_2Z84&}yGDGJ3s%(A8@v2bi&|^xWscOtOY|L&X4HMq
zNrx^CRPGOYckJsa2cXl0)Z$N)}1T4N^2&&EJQ=gLfytfkAQjI|?o51$v~d!cj*P$z9gN7>a8Zdr?D2RIm*YgQ&c
zOD?gSFwS`yWA%U@B(>oV+}%g`OHajF-qMMtKgQ^0SsmL+r(=C!T?bKq)_w1P1ZQAZ
z!bXFy`|MR+k|URs9#o?@7pak$OlJ@uIDlAR=VP8o%N47$R%NHTT2^>R#U>eL_15%`
zd8fA*W0rOCP*8{HiDg;-;pHEsF&bAYCH#9oISZ-S^u2?gqK9`RSgy_g984=HjIg5K
zih<3lPrIdB{fw_%s9l}96_u<>rJL+|pw6`Fo@CToWmf#Lf=wZPf`dc-qQNwSQTH-k
hP4+ZyIr5xJsO~;NlzRCA@xLO#P}fAKM$0Ywe*li1OSk|4
literal 0
HcmV?d00001
diff --git a/images/moments_ico.png b/images/moments_ico.png
new file mode 100644
index 0000000000000000000000000000000000000000..eb3cbe113bd6696afbb3450745bc60ebafc3dcb6
GIT binary patch
literal 1379
zcmV-p1)TbcP)j`A_
z2_j$YqvRGnhXHyh(1YnyVb$amONkOCQsgel@@A8q{lA^rnc1ZX6SLm95Lryz
z0K){4xoDaP;%{Oa5V7m~e7@fAyJd%`G6w$H-F1lgD}by*b{JpZ@AW!`-krXr48Sd2
z$9?GZqvwvBO)IErVrCx{5y6au^Pu9On^{4X{VX)ECG=P5RJ)%r*Dpot}=j>_}M7M
z!bt{TvfN;w92@;Kh*S?Ki7x>m3n0QNVC-~X8KY&01i*B`zD1OQ~;)-)IT{k?D*IV0AZd7zAG$VF`SeEQr5!^Agr+W=v|@E
zNh6lOAwGIP@UcmJxlu6pS0i4CNd?Fe
zFWw6PoA~n40HAF(4^$^U6+lA#RPR9nfNI4j0OZAs{^*?eV#5W=W}vzF)1j$9t-DfL
zC(paH5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jd?Qo;*jlLG)~05WY+)jG~3KF~Q95seIM`tkUbpwY84{66uqs+65Cn
zfw&Xa7W;8w)Bvt0iwz!8dDv#9+e~PId2A)1^O6FSD5%O=N*MqHeambdsDPE3jR7xL
ztI(uPwaNg5fM5?2rIg4(V9r~6%}P))v4(jtrf-9r2hYu1{n^0$2%f()BTqnG
zHQ>YKs>~;>xi3iuT`~aN72PWV^DMJMpCJD))2cR@!VBa);5S|we-81BG;@P{KY16o
z#*|**1K89OD`XWCc2Bc;;Z3AvXT-9#@c_(r{i9@kh@!c~#u1i$2fQ
z8(*o2Wi4@!p!HdI{g)Y+@?a51oEL8cIajYJtuq7hH3u*=pD1dXZV(jh1b6@;8o7F8
z?gu{UTSigVpoMCgCZ#GXn9)IzI)ek!%5HQ%3T7lQOExm|1bMCi_~Nb?5E5E^LTaLwQb3<0Z>9qSv43
zPBre`I2M3pthztSLV18+56os{J%|kAFePTI#E#M)DFqTSpiDK?lQe+J76|Gyn*&a>
z0wNS=&}ndnR>hwRfMhNgQcS2OjS+92W%M2lryJ+zQDD{r5M(S0pmXOGiBKd)o(To8
v__rJJj6x$~jF>QHhHY#cw#vhZiWU9`YvbkqLNis300000NkvXXu0mjflH!2s
literal 0
HcmV?d00001
diff --git a/pages/activity_list/activity_list.js b/pages/activity_list/activity_list.js
new file mode 100644
index 0000000..e6ca0ed
--- /dev/null
+++ b/pages/activity_list/activity_list.js
@@ -0,0 +1,88 @@
+// pages/activity_list/activity_list.js
+const util = require('../../utils/util.js')
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ repos: [],
+ },
+
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function (options) {
+ this.loadData();
+ },
+
+ loadData: function () {//定义函数名称
+ wx.showLoading();
+ var that = this;
+ wx.request({
+ url: getApp().gw.hostUrl + '/mall/wxa/activity/group/list',
+ method: 'get',
+ data: {
+ pageNum: 1,
+ pageSize: 2
+ },
+ header: {
+ 'Content-Type': 'application/x-www-form-urlencoded',
+ 'sessionId': wx.getStorageSync('sessionId')
+ },
+ success: function (res) {
+ console.log(res);
+ wx.hideLoading();
+ if (res.data.code == 0) {
+ that.setData({
+ repos: res.data.response.map((n) => Object.assign({}, n, {
+ createdAt: util.formatTime(new Date(n.createdAt)).substr(0, 16),
+ img: that.switchImg(n.status),
+ activityTypeStr: that.switchType(n.activityType),
+ })),
+ })
+ } else {
+ wx.showToast({
+ title: res.data.msg,
+ icon: 'none',
+ duration: 1000
+ });
+ }
+ },
+
+ fail: function (e) {
+ wx.hideLoading();
+ wx.showToast({
+ title: '网络异常!',
+ icon: 'none',
+ duration: 1000
+ });
+ },
+
+ })
+ },
+
+ itemClick: function (event) {
+ var groupNo = event.currentTarget.dataset.testid;
+ wx.navigateTo({
+ url: '../pay_result/pay_result?groupNo=' + groupNo
+ })
+ },
+
+ switchType: function (activityType) {
+ switch (activityType) {
+ case 10: return '拼团'
+ case 20: return '砍价'
+ case 30: return '抽奖'
+ }
+ },
+
+ switchImg: function (status) {
+ switch (status) {
+ case 0: return '../../images/icon_task_finish.png'
+ case 20: return '../../images/icon_task_finish.png'
+ case 90: return '../../images/icon_task_finish.png'
+ }
+ }
+
+})
\ No newline at end of file
diff --git a/pages/activity_list/activity_list.json b/pages/activity_list/activity_list.json
new file mode 100644
index 0000000..2094ac4
--- /dev/null
+++ b/pages/activity_list/activity_list.json
@@ -0,0 +1,3 @@
+{
+ "navigationBarTitleText": "活动记录"
+}
\ No newline at end of file
diff --git a/pages/activity_list/activity_list.wxml b/pages/activity_list/activity_list.wxml
new file mode 100644
index 0000000..8ae8a4f
--- /dev/null
+++ b/pages/activity_list/activity_list.wxml
@@ -0,0 +1,36 @@
+
+
+
+
+
+
+
+
+
+
+ {{ item.activityName }}
+ {{ item.activityTypeStr }}
+
+
+ 参与时间: {{ item.createdAt }}
+
+
+
+
+ 进行中
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 亲,您还没有参加任何活动!
+
+
\ No newline at end of file
diff --git a/pages/activity_list/activity_list.wxss b/pages/activity_list/activity_list.wxss
new file mode 100644
index 0000000..d79615f
--- /dev/null
+++ b/pages/activity_list/activity_list.wxss
@@ -0,0 +1,138 @@
+/* pages/activity_list/activity_list.wxss */
+
+.weui-media-box {
+ height: 120rpx;
+ padding: 15px;
+ margin-top: 10rpx;
+ position: relative;
+}
+
+.weui-media-box:before {
+ content: "";
+ position: absolute;
+ top: 0;
+ right: 0;
+ height: 1px;
+ border-top: 1rpx solid #f1f1f1;
+ color: #f1f1f1;
+ left: 0;
+}
+
+.weui-media-box_appmsg {
+ height: 120rpx;
+ margin-top: 10rpx;
+ background: #fff;
+ display: -webkit-box;
+ display: -webkit-flex;
+ display: flex;
+ -webkit-box-align: center;
+ -webkit-align-items: center;
+ align-items: center;
+}
+
+.weui-cell_active {
+ background-color: #f1f1f1;
+}
+
+.weui-media-box__bd_in-appmsg {
+ -webkit-box-flex: 1;
+ -webkit-flex: 1;
+ flex: 1;
+ min-width: 0;
+}
+
+.weui-media-box__info {
+ list-style: none;
+ overflow: hidden;
+}
+
+.weui-media-box-info-meta {
+ float: left;
+ padding-right: 1px;
+ font-size: 13px;
+ margin-top: 12px;
+ color: #cecece;
+}
+
+.weui-media-box-name {
+ float: left;
+ padding-right: 1px;
+ margin-right: 4px;
+ height: 40rpx;
+ line-height: 40rpx;
+ font-size: 18px;
+ color: #333;
+ font-weight: bold;
+}
+
+.item_status {
+ margin-right: 0.8em;
+ float: left;
+ height: 40rpx;
+ line-height: 40rpx;
+ font-size: 16px;
+ color: #666;
+}
+
+.weui-media-box__thumb {
+ width: 60px;
+ height: 60px;
+ margin-right: 0.8em;
+ vertical-align: top;
+}
+
+.icon-arrow {
+ width: 16px;
+ height: 16px;
+ vertical-align: top;
+}
+
+.weui-media-box__type10 {
+ color: #fff;
+ background: #f36619;
+ border-radius: 20rpx;
+ text-align: center;
+ font-size: 12px;
+ height: 40rpx;
+ line-height: 40rpx;
+ width: 90rpx;
+ float: left;
+}
+
+.weui-media-box__type20 {
+ color: #fff;
+ background: #21be8d;
+ border-radius: 20rpx;
+ text-align: center;
+ font-size: 12px;
+ height: 40rpx;
+ line-height: 40rpx;
+ width: 90rpx;
+ float: left;
+}
+
+.weui-media-box__type30 {
+ color: #fff;
+ background: #ffa043;
+ border-radius: 20rpx;
+ text-align: center;
+ font-size: 12px;
+ height: 40rpx;
+ line-height: 40rpx;
+ width: 90rpx;
+ float: left;
+}
+
+.view_hide {
+ display: none;
+}
+
+.empty-layout {
+ width: 100%;
+ height: 100%;
+ padding-top: 65%;
+ display: flex;
+ flex-direction: column;
+ justify-content: center;
+ align-items: center;
+}
diff --git a/pages/mcenter/mcenter.js b/pages/mcenter/mcenter.js
index 64ce901..a8f3d46 100644
--- a/pages/mcenter/mcenter.js
+++ b/pages/mcenter/mcenter.js
@@ -6,8 +6,8 @@ Page({
data: {
items:[
{ top: 20, title: '我的订单', img:'../../images/order.png',page:'Order'},
- // { top: 1, title: '我的地址', img: '../../images/addr.png', page:'Address'},
- { top: 20, title: '联系客服', img: '../../images/service.png', page:'Transition'}
+ { top: 1, title: '我的活动', img: '../../images/addr.png', page:'Activity'},
+ { top: 1, title: '联系客服', img: '../../images/service.png', page:'Transition'}
],
sessionId: ''
},
@@ -23,6 +23,11 @@ Page({
url: '../jz/jz'
})
},
+ goActivity: function (e) {
+ wx.navigateTo({
+ url: '../pay_result/pay_result'
+ })
+ },
goLogin: function (e) {
wx.navigateTo({
url: '../login/login'
diff --git a/pages/pay_result/pay_result.js b/pages/pay_result/pay_result.js
new file mode 100644
index 0000000..6b55cb1
--- /dev/null
+++ b/pages/pay_result/pay_result.js
@@ -0,0 +1,371 @@
+Page({
+ data: {
+ groupNo: '',
+ windowWidth: 0,
+ windowHeight: 0,
+ scaleW: 0.85,
+ scaleH: 1.15,
+ shareImgSrc: '',
+ showPopup: false,
+ show: false,
+ cancelWithMask: true,
+ actions: [{
+ name: '微信好友',
+ icon: '../../images/wechat_ico.png',
+ openType: 'share'
+ }, {
+ name: '朋友圈',
+ icon: '../../images/moments_ico.png'
+ }],
+ txtmoment: '保存图片,分享到朋友圈',
+ qrImageUrl: "",
+ avatarPath: '',
+ imgPath: '',
+ qrCodePath: '',
+ },
+
+ onLoad: function (options) {
+ this.groupNo = options.groupNo;
+ console.log("groupNo>>" + this.groupNo);
+ wx.getSystemInfo({
+ success: (res) => {
+ this.setData({
+ windowWidth: res.windowWidth,
+ windowHeight: res.windowHeight,
+ })
+ }
+ });
+ var that = this;
+ wx.request({
+ url: getApp().gw.hostUrl + '/mall/wxa/activity/group/wxa_code',
+ method: 'get',
+ data: {
+ groupNo: that.groupNo,
+ width: 120,
+ // page: ''
+ },
+ header: {
+ 'Content-Type': 'application/x-www-form-urlencoded',
+ 'sessionId': wx.getStorageSync('sessionId')
+ },
+ success: function (res) {
+ if (res.statusCode == 200) {
+ that.qrImageUrl = res.data.msg;
+ }
+ }
+ })
+ },
+ //打败Actionsheet,进行分享
+ openActionsheet: function () {
+ if (this.data.qrImageUrl.length == 0) {
+ wx.showLoading({
+ title: '正在获取',
+ mask: true,
+ });
+ var that = this;
+ wx.request({
+ url: getApp().gw.hostUrl + '/mall/wxa/activity/group/wxa_code',
+ method: 'get',
+ data: {
+ groupNo: that.groupNo,
+ width: 120,
+ page: ''
+ },
+ header: {
+ 'Content-Type': 'application/x-www-form-urlencoded',
+ 'sessionId': wx.getStorageSync('sessionId')
+ },
+ success: function (res) {
+ wx.hideLoading();
+ if (res.statusCode == 200) {
+ that.setData({
+ qrImageUrl: res.data.msg,
+ show: true
+ });
+ } else {
+ wx.showToast({
+ title: '获取信息失败!',
+ icon: 'none',
+ duration: 1000
+ });
+ }
+ },
+ fail: function (res) {
+ wx.hideLoading();
+ wx.showToast({
+ title: '网络错误!',
+ icon: 'none',
+ duration: 1000
+ });
+ }
+ });
+ } else {
+ this.setData({
+ 'show': true
+ });
+ }
+ },
+
+ closeActionSheet: function () {
+ this.setData({
+ 'show': false
+ });
+ },
+
+ onShareAppMessage: function () {
+ return {
+ title: '1号家政',
+ imageUrl: this.qrImageUrl
+ };
+ },
+
+ clickAction({ detail }) {
+ // 如果是分享按钮被点击, 不处理关闭
+ const { index } = detail;
+ if (index === 0) {
+
+ return
+ } else if (index == 1) {
+ this.showMomentImage();
+ }
+ this.setData({
+ [`show`]: false,
+ [`actions[${index}].loading`]: false
+ });
+ },
+
+ goActivityInfo: function () {
+
+ },
+
+ togglePopup: function () {
+ this.setData({
+ shareImgSrc: '',
+ showPopup: !this.data.showPopup,
+ })
+ },
+
+ //绘制图片,加上二维码和相关的信息;
+ drawMomentImage: function (avatarPath, imgPath, qrCodePath) {
+ var that = this;
+ console.log(avatarPath.length + "," + imgPath.length + "," + qrCodePath.length);
+ if (avatarPath.length == 0 || qrCodePath.length == 0 || imgPath.length == 0) {
+ return;
+ }
+
+ const ctx = wx.createCanvasContext('shareCanvas');
+ var viewWidth = that.data.windowWidth * that.data.scaleW;
+ var viewHight = that.data.windowWidth * that.data.scaleH;
+
+ ctx.clearRect(0, 0, viewWidth, viewHight)
+ ctx.setFillStyle('white')
+ ctx.fillRect(0, viewHight - 120, viewWidth, viewHight);
+
+ ctx.drawImage(imgPath, 0, 0, viewWidth, viewHight - 120)
+ ctx.drawImage(qrCodePath, viewWidth - 110, viewHight - 110, 100, 100);
+ ctx.save();
+
+ ctx.beginPath(); //开始绘制
+ ctx.arc(36 / 2 + 10, 36 / 2 + 200, 36 / 2, 0, Math.PI * 2, false);
+ ctx.clip();//
+ ctx.drawImage(avatarPath, 10, 200, 36, 36); // 推进去图片
+ ctx.drawImage(avatarPath, 10, viewHight - 113, 24, 24)
+ ctx.restore(); //恢复之前保存的绘图上下文 恢复之前保存的绘图上下午即状态 还可以继续绘制
+ ctx.save();
+
+ ctx.setFontSize(15)
+ ctx.setTextBaseline('top')
+ ctx.setFillStyle('#333')
+ ctx.fillText(getApp().globalData.userInfo.nickName, 40, viewHight - 111)
+
+ ctx.setFontSize(16)
+ ctx.setFillStyle('#000')
+ ctx.fillText('宠友们快来围观萌宠靓照', 10, viewHight - 80)
+ ctx.fillText('我在萌爪幼稚园', 10, viewHight - 58)
+
+ ctx.setFontSize(13)
+ ctx.fillText('长按扫码查看详情', 10, viewHight - 26)
+ ctx.draw()
+ //将绘制的图片保存到内存,然后进行展示;
+ setTimeout(function () {
+ wx.canvasToTempFilePath({
+ x: 0,
+ y: 0,
+ width: viewWidth,
+ height: viewHight,
+ destWidth: viewWidth,
+ destHeight: viewHight,
+ canvasId: 'shareCanvas',
+ success: function (res) {
+ that.setData({
+ shareImgSrc: res.tempFilePath,
+ showPopup: !that.data.showPopup
+ })
+ wx.hideLoading();
+ },
+ fail: function (err) {
+ that.handleErr(err, false);
+ }
+ })
+ }, 2000);
+ },
+
+ handleErr: function (err, toast) {
+ if (!toast) {
+ toast = true;
+ wx.hideLoading();
+ wx.showToast({
+ title: '生成图片失败!',
+ icon: 'none',
+ duration: 1000
+ });
+ }
+ },
+
+ showMomentImage: function () {
+ var that = this;
+ var toast = false;
+ var avatarPath = '';
+ var imgPath = '';
+ var qrCodePath = '';
+ wx.showLoading({
+ title: '正在生成图片',
+ mask: true,
+ });
+ console.log(getApp().globalData.userInfo);
+ //先从服务器获取要分享的图片,保存到本地;
+ wx.downloadFile({
+ url: getApp().globalData.userInfo.avatarUrl,
+ success: (res) => {
+ if (res.statusCode == 200 && res.tempFilePath != undefined && res.tempFilePath.length > 0) {
+ console.log(res);
+ avatarPath = res.tempFilePath;
+ that.drawMomentImage(avatarPath, imgPath, qrCodePath);
+ } else {
+ that.handleErr(err, toast);
+ toast = true;
+ }
+ },
+ fail: function (err) {
+ that.handleErr(err, toast);
+ toast = true;
+ }
+ });
+ wx.downloadFile({
+ url: 'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1527496410439&di=54c111d35f3ca9d1e9b193834785c264&imgtype=0&src=http%3A%2F%2Fimg.zcool.cn%2Fcommunity%2F013c81583fa08ea8012060c864c3b7.jpg',
+ success: (res) => {
+ if (res.statusCode == 200 && res.tempFilePath != undefined && res.tempFilePath.length > 0) {
+ console.log(res);
+ imgPath = res.tempFilePath;
+ that.drawMomentImage(avatarPath, imgPath, qrCodePath);
+ } else {
+ that.handleErr(err, toast);
+ toast = true;
+ }
+ },
+ fail: function (err) {
+ that.handleErr(err, toast);
+ toast = true;
+ }
+ });
+ wx.downloadFile({
+ url: that.qrImageUrl,
+ success: (res) => {
+ if (res.statusCode == 200 && res.tempFilePath != undefined && res.tempFilePath.length > 0) {
+ console.log(res);
+ qrCodePath = res.tempFilePath;
+ that.drawMomentImage(avatarPath, imgPath, qrCodePath);
+ } else {
+ that.handleErr(err, toast);
+ toast = true;
+ }
+ },
+ fail: function (err) {
+ that.handleErr(err, toast);
+ toast = true;
+ }
+ });
+ // wx.downloadFile({
+ // url: getApp().globalData.userInfo.avatarUrl,
+ // success: (aRes) => {
+ // wx.downloadFile({
+ // url: 'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1527496410439&di=54c111d35f3ca9d1e9b193834785c264&imgtype=0&src=http%3A%2F%2Fimg.zcool.cn%2Fcommunity%2F013c81583fa08ea8012060c864c3b7.jpg',
+ // success: (res) => {
+ // //从服务器获二维码图片,保存到本地;
+ // wx.downloadFile({
+ // url: that.qrImageUrl,
+ // success: (qRres) => {
+ // that.drawMomentImage(aRes.tempFilePath, res.tempFilePath, qRres.tempFilePath);
+ // },
+ // fail: function (err) {
+ // wx.hideLoading();
+ // wx.showToast({
+ // title: '生成图片失败!qRres',
+ // icon: 'none',
+ // duration: 1000
+ // });
+ // }
+ // })
+ // },
+ // fail: function (err) {
+ // console.log(err);
+ // wx.hideLoading();
+ // wx.showToast({
+ // title: '生成图片失败!res',
+ // icon: 'none',
+ // duration: 1000
+ // });
+ // }
+ // })
+ // },
+ // fail: function (err) {
+ // wx.hideLoading();
+ // wx.showToast({
+ // title: '生成图片失败!' + err.errMsg,
+ // icon: 'none',
+ // duration: 1000
+ // });
+ // }
+ // });
+ },
+
+ //将图片保存到本地相册
+ saveImageToAlbum: function () {
+ wx.showLoading({
+ title: '正在保存成图片',
+ mask: true,
+ });
+ var that = this;
+ setTimeout(function () {
+ wx.saveImageToPhotosAlbum({
+ filePath: that.data.shareImgSrc,
+ success(res) {
+ wx.hideLoading();
+ that.togglePopup()
+ wx.showModal({
+ title: '保存图片成功',
+ content: '图片成功保存到相册了,去发圈噻~',
+ showCancel: false,
+ confirmText: '好哒',
+ confirmColor: '#333',
+ success: function (res) {
+ if (res.confirm) {
+ console.log('用户点击确定');
+ }
+ }
+ })
+ },
+ fail: function (res) {
+ console.log(res)
+ wx.hideLoading();
+ wx.showToast({
+ title: '保存图片失败!aRres',
+ icon: 'none',
+ duration: 1000
+ });
+ }
+ })
+ }, 3000)
+ },
+
+})
\ No newline at end of file
diff --git a/pages/pay_result/pay_result.json b/pages/pay_result/pay_result.json
new file mode 100644
index 0000000..bb1779e
--- /dev/null
+++ b/pages/pay_result/pay_result.json
@@ -0,0 +1,7 @@
+{
+ "navigationBarTitleText": "支付成功",
+ "usingComponents": {
+ "zan-actionsheet": "../../components/actionsheet/index",
+ "zan-popup": "../../components/popup/index"
+ }
+}
\ No newline at end of file
diff --git a/pages/pay_result/pay_result.wxml b/pages/pay_result/pay_result.wxml
new file mode 100644
index 0000000..180a87d
--- /dev/null
+++ b/pages/pay_result/pay_result.wxml
@@ -0,0 +1,31 @@
+
+
+
+
+
+
+ 支付成功
+
+ 拼团成功后,将会存入您的服务卡中公众号关注【一号家政服务号】,即可预约
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pages/pay_result/pay_result.wxss b/pages/pay_result/pay_result.wxss
new file mode 100644
index 0000000..4b1eca7
--- /dev/null
+++ b/pages/pay_result/pay_result.wxss
@@ -0,0 +1,83 @@
+page {
+ background-color: #21be8d;
+}
+
+.main-layout {
+ height: 100%;
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+}
+
+.userinfo {
+ width: 85%;
+ height: 900rpx;
+ display: flex;
+ background-color: #fff;
+ flex-direction: column;
+ align-items: center;
+ border-radius: 8px;
+ margin-top: 85rpx;
+}
+
+.pay-icon {
+ width: 160rpx;
+ height: 160rpx;
+ margin-top: 60rpx;
+ margin-bottom: 10rpx;
+}
+
+.pop-image {
+ width: 85vw;
+ height: 105vw;
+}
+
+.pay-text {
+ color: #21be8d;
+ font-size: 20px;
+ /* font-weight:bold; */
+}
+
+.tip-text {
+ color: #333;
+ font-size: 14px;
+ text-align: center;
+ margin: 60rpx;
+}
+
+.btn-invite {
+ color: #fff;
+ background: #1eba84;
+ border-radius: 40px;
+ text-align: center;
+ font-size: 18px;
+ height: 80rpx;
+ line-height: 80rpx;
+ width: 80%;
+ margin: 0 auto;
+ margin-top: 80rpx;
+}
+
+.btn-info {
+ color: #333;
+ background: #fff;
+ border-radius: 40px;
+ text-align: center;
+ font-size: 18px;
+ height: 80rpx;
+ line-height: 80rpx;
+ width: 80%;
+ margin: 0 auto;
+ margin-top: 50rpx;
+ border: 2rpx solid #1eba84;
+}
+
+.title_img {
+ width: 200rpx;
+ height: 36rpx;
+ margin-top: 80rpx;
+}
+
+.tiny {
+ background: rgba(30, 30, 40, 0.7) !important;
+}
\ No newline at end of file