diff --git a/app.js.rej b/app.js.rej
new file mode 100644
index 0000000..2e916a7
--- /dev/null
+++ b/app.js.rej
@@ -0,0 +1,11 @@
+diff a/app.js b/app.js (rejected hunks)
+@@ -19,8 +19,7 @@
+
+ }
+ })
+-
+-
++ this.gw.systemInfo = wx.getSystemInfoSync();
+ },
+ getSessionKey: function (code) {
+ var that = this;
diff --git a/app.json b/app.json
index 2dcda70..89b432f 100644
--- a/app.json
+++ b/app.json
@@ -17,7 +17,9 @@
"pages/serviceDesc/serviceDesc",
"pages/two_code/two_code",
"pages/out/out",
- "pages/agreement/agreement"
+ "pages/agreement/agreement",
+ "pages/pay_result/pay_result",
+ "pages/activity_list/activity_list"
],
"window": {
"backgroundTextStyle": "light",
diff --git a/components/actionsheet/index.js b/components/actionsheet/index.js
new file mode 100644
index 0000000..406df27
--- /dev/null
+++ b/components/actionsheet/index.js
@@ -0,0 +1,36 @@
+Component({
+ externalClasses: ['mask-class', 'container-class'],
+ properties: {
+ actions: {
+ type: Array,
+ value: []
+ },
+ show: {
+ type: Boolean,
+ value: false
+ },
+ cancelWithMask: {
+ type: Boolean,
+ value: true
+ },
+ cancelText: {
+ type: String,
+ value: ''
+ }
+ },
+ methods: {
+ onMaskClick() {
+ if (this.data.cancelWithMask) {
+ this.cancelClick();
+ }
+ },
+ cancelClick() {
+ this.triggerEvent('cancel');
+ },
+ handleBtnClick({ currentTarget = {} }) {
+ const dataset = currentTarget.dataset || {};
+ const { index } = dataset;
+ this.triggerEvent('actionclick', { index });
+ }
+ }
+});
diff --git a/components/actionsheet/index.json b/components/actionsheet/index.json
new file mode 100644
index 0000000..467ce29
--- /dev/null
+++ b/components/actionsheet/index.json
@@ -0,0 +1,3 @@
+{
+ "component": true
+}
diff --git a/components/actionsheet/index.wxml b/components/actionsheet/index.wxml
new file mode 100644
index 0000000..c7b7d5f
--- /dev/null
+++ b/components/actionsheet/index.wxml
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/components/actionsheet/index.wxss b/components/actionsheet/index.wxss
new file mode 100644
index 0000000..68e934e
--- /dev/null
+++ b/components/actionsheet/index.wxss
@@ -0,0 +1,107 @@
+.zan-actionsheet {
+ background-color: #f8f8f8;
+}
+
+.zan-actionsheet__mask {
+ position: fixed;
+ top: 0;
+ left: 0;
+ right: 0;
+ bottom: 0;
+ z-index: 10;
+ background: rgba(0, 0, 0, 0.7);
+ display: none;
+}
+
+.zan-actionsheet__container {
+ position: fixed;
+ left: 0;
+ right: 0;
+ bottom: 0;
+ background: #f8f8f8;
+ -webkit-transform: translate3d(0, 50%, 0);
+ transform: translate3d(0, 50%, 0);
+ -webkit-transform-origin: center;
+ transform-origin: center;
+ transition: all 0.2s ease;
+ z-index: 11;
+ opacity: 0;
+ visibility: hidden;
+}
+
+.zan-actionsheet__btn {
+ margin-bottom: 0 !important;
+}
+
+.zan-actionsheet__footer .zan-actionsheet__btn {
+ background: #fff;
+}
+
+.zan-actionsheet__btn-content {
+ display: flex;
+ flex-direction: row;
+ justify-content: center;
+}
+
+.zan-actionsheet__subname {
+ color: #999;
+}
+
+.zan-actionsheet__name, .zan-actionsheet__subname {
+ height: 45px;
+ line-height: 45px;
+}
+
+.zan-actionsheet__btn.zan-btn:last-child::after {
+ border-bottom-width: 0;
+}
+
+.zan-actionsheet__subname {
+ margin-left: 2px;
+ font-size: 12px;
+}
+
+.zan-actionsheet__footer {
+ margin-top: 10px;
+}
+
+.zan-actionsheet__btn--loading .zan-actionsheet__subname {
+ color: transparent;
+}
+
+.zan-actionsheet--show .zan-actionsheet__container {
+ opacity: 1;
+ -webkit-transform: translate3d(0, 0, 0);
+ transform: translate3d(0, 0, 0);
+ visibility: visible;
+}
+
+.zan-actionsheet--show .zan-actionsheet__mask {
+ display: block;
+}
+
+.icon-wrap {
+ width: 375rpx;
+ height: 135px;
+ float: left;
+ text-align: center;
+ background: none !important;
+ color: #000 !important;
+}
+
+.icon-wrap::after {
+ border: none;
+}
+
+.txt-classname {
+ height: 20rpx;
+ line-height: 20rpx;
+ color: #333;
+ font-size: 16px;
+}
+
+.icon-classname {
+ width: 80rpx;
+ height: 80rpx;
+ margin-top: 48rpx;
+}
diff --git a/components/pop-manager/index.js b/components/pop-manager/index.js
new file mode 100644
index 0000000..edbd996
--- /dev/null
+++ b/components/pop-manager/index.js
@@ -0,0 +1,29 @@
+Component({
+ properties: {
+ show: {
+ type: Boolean,
+ value: false
+ },
+ // 是否有遮罩层
+ overlay: {
+ type: Boolean,
+ value: true
+ },
+ // 遮罩层是否会显示
+ showOverlay: {
+ type: Boolean,
+ value: true
+ },
+ // 内容从哪个方向出,可选 center top bottom left right
+ type: {
+ type: String,
+ value: 'center'
+ }
+ },
+
+ methods: {
+ handleMaskClick() {
+ this.triggerEvent('clickmask', {});
+ }
+ }
+});
diff --git a/components/pop-manager/index.json b/components/pop-manager/index.json
new file mode 100644
index 0000000..467ce29
--- /dev/null
+++ b/components/pop-manager/index.json
@@ -0,0 +1,3 @@
+{
+ "component": true
+}
diff --git a/components/pop-manager/index.wxml b/components/pop-manager/index.wxml
new file mode 100644
index 0000000..6bb47ef
--- /dev/null
+++ b/components/pop-manager/index.wxml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
diff --git a/components/pop-manager/index.wxss b/components/pop-manager/index.wxss
new file mode 100644
index 0000000..5f449e8
--- /dev/null
+++ b/components/pop-manager/index.wxss
@@ -0,0 +1 @@
+.pop{visibility:hidden}.pop--show{visibility:visible}.pop__mask{position:fixed;top:0;left:0;right:0;bottom:0;z-index:10;background:rgba(0,0,0,.7);display:none}.pop__mask--hide{background:0 0}.pop__container{position:fixed;left:50%;top:50%;-webkit-transform:translate3d(-50%,-50%,0);transform:translate3d(-50%,-50%,0);-webkit-transform-origin:center;transform-origin:center;transition:all .4s ease;z-index:11;opacity:0}.pop--show .pop__container{opacity:1}.pop--show .pop__mask{display:block}.pop--left .pop__container{left:0;top:50%;-webkit-transform:translate3d(-100%,-50%,0);transform:translate3d(-100%,-50%,0)}.pop--show.pop--left .pop__container{-webkit-transform:translate3d(0,-50%,0);transform:translate3d(0,-50%,0)}.pop--right .pop__container{right:0;top:50%;left:auto;-webkit-transform:translate3d(100%,-50%,0);transform:translate3d(100%,-50%,0)}.pop--show.pop--right .pop__container{-webkit-transform:translate3d(0,-50%,0);transform:translate3d(0,-50%,0)}.pop--bottom .pop__container{top:auto;left:50%;bottom:0;-webkit-transform:translate3d(-50%,100%,0);transform:translate3d(-50%,100%,0)}.pop--show.pop--bottom .pop__container{-webkit-transform:translate3d(-50%,0,0);transform:translate3d(-50%,0,0)}.pop--top .pop__container{top:0;left:50%;-webkit-transform:translate3d(-50%,-100%,0);transform:translate3d(-50%,-100%,0)}.pop--show.pop--top .pop__container{-webkit-transform:translate3d(-50%,0,0);transform:translate3d(-50%,0,0)}
\ No newline at end of file
diff --git a/components/popup/index.js b/components/popup/index.js
new file mode 100644
index 0000000..71bb69f
--- /dev/null
+++ b/components/popup/index.js
@@ -0,0 +1,35 @@
+Component({
+ properties: {
+ show: {
+ type: Boolean,
+ value: false
+ },
+
+ overlay: {
+ type: Boolean,
+ value: true
+ },
+
+ closeOnClickOverlay: {
+ type: Boolean,
+ value: true
+ },
+
+ // 弹出方向
+ type: {
+ type: String,
+ value: 'center'
+ }
+ },
+
+ methods: {
+ handleMaskClick() {
+ this.triggerEvent('click-overlay', {});
+
+ if (!this.data.closeOnClickOverlay) {
+ return;
+ }
+ this.triggerEvent('close', {});
+ }
+ }
+});
diff --git a/components/popup/index.json b/components/popup/index.json
new file mode 100644
index 0000000..a6fe44e
--- /dev/null
+++ b/components/popup/index.json
@@ -0,0 +1,6 @@
+{
+ "component": true,
+ "usingComponents": {
+ "pop-manager": "../pop-manager/index"
+ }
+}
diff --git a/components/popup/index.wxml b/components/popup/index.wxml
new file mode 100644
index 0000000..6451fc6
--- /dev/null
+++ b/components/popup/index.wxml
@@ -0,0 +1,8 @@
+
+
+
diff --git a/images/finish_ico.png b/images/finish_ico.png
new file mode 100644
index 0000000..5ae6921
Binary files /dev/null and b/images/finish_ico.png differ
diff --git a/images/ic_arrow_right.png b/images/ic_arrow_right.png
new file mode 100644
index 0000000..f8c3b20
Binary files /dev/null and b/images/ic_arrow_right.png differ
diff --git a/images/icon_task_finish.png b/images/icon_task_finish.png
new file mode 100644
index 0000000..34f0f80
Binary files /dev/null and b/images/icon_task_finish.png differ
diff --git a/images/moments_ico.png b/images/moments_ico.png
new file mode 100644
index 0000000..eb3cbe1
Binary files /dev/null and b/images/moments_ico.png differ
diff --git a/images/wechat_ico.png b/images/wechat_ico.png
new file mode 100644
index 0000000..948bce3
Binary files /dev/null and b/images/wechat_ico.png differ
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