|
@@ -129,18 +129,62 @@ function activeOverCheck (endTime, callback) {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-// 未定义兼容
|
|
|
-try {
|
|
|
- var shareSheet = appShareSheet
|
|
|
-} catch (error) {
|
|
|
- var shareSheet = {}
|
|
|
- console.log(error)
|
|
|
+var shareMixin = {
|
|
|
+ data: function () {
|
|
|
+ return {
|
|
|
+ shareShow: false,
|
|
|
+ guideMask: false,
|
|
|
+ shareConf: {
|
|
|
+ title: '剑鱼超级会员节,百万补贴限量抢',
|
|
|
+ content: '快来和我一起参与吧!剑鱼超级会员节,百万补贴限量抢,快速获取商机信息',
|
|
|
+ pathname: '/weixin/frontPage/activity/sess/task-202207',
|
|
|
+ origin: location.origin,
|
|
|
+ link: ''
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ created: function () {
|
|
|
+ if (utils.isWeiXinBrowser) {
|
|
|
+ this.registerWxShare()
|
|
|
+ } else {
|
|
|
+ this.getShareDomain()
|
|
|
+ }
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ refreshShareLink: function () {
|
|
|
+ this.shareConf.link = this.shareConf.origin + this.shareConf.pathname
|
|
|
+ },
|
|
|
+ getShareDomain: function () {
|
|
|
+ var _this = this
|
|
|
+ $.ajax({
|
|
|
+ url: '/jypay/getDomain',
|
|
|
+ type: 'post',
|
|
|
+ success: function (res) {
|
|
|
+ if (res && res.data && res.data.wx) {
|
|
|
+ _this.shareConf.origin = res.data.wx
|
|
|
+ _this.refreshShareLink()
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ registerWxShare: function () {
|
|
|
+ this.refreshShareLink()
|
|
|
+ shareFn.init({
|
|
|
+ title: this.shareConf.title,
|
|
|
+ desc: this.shareConf.content,
|
|
|
+ link: this.shareConf.link
|
|
|
+ })
|
|
|
+ },
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
var task = new Vue({
|
|
|
el: '#main-app',
|
|
|
delimiters: ['${', '}'],
|
|
|
+ mixins: [shareMixin],
|
|
|
components: {
|
|
|
- appShareSheet: shareSheet
|
|
|
+ appShareSheet: appShareSheet,
|
|
|
+ wxShareGuide: wxShareGuide
|
|
|
},
|
|
|
data: {
|
|
|
platform: 'app',
|
|
@@ -413,9 +457,16 @@ var task = new Vue({
|
|
|
mounted: function () {
|
|
|
// this.calcPointList()
|
|
|
this.headerTransparent()
|
|
|
+ this.clickEvents()
|
|
|
this.stickyTopEvents()
|
|
|
},
|
|
|
methods: {
|
|
|
+ clickEvents: function () {
|
|
|
+ var _this = this
|
|
|
+ $('.j-header.jy-app-header').on('click', function () {
|
|
|
+ _this.shareShow = true
|
|
|
+ })
|
|
|
+ },
|
|
|
add0: function (t) {
|
|
|
return t < 10 ? ('0' + t) : t
|
|
|
},
|
|
@@ -865,8 +916,11 @@ var task = new Vue({
|
|
|
break
|
|
|
}
|
|
|
case 'share': {
|
|
|
- // 分享----------
|
|
|
- // _this.scrollTo('.copy-share-container')
|
|
|
+ if (utils.isWeiXinBrowser) {
|
|
|
+ this.guideMask = true
|
|
|
+ } else {
|
|
|
+ this.shareShow = true
|
|
|
+ }
|
|
|
break
|
|
|
}
|
|
|
}
|
|
@@ -1083,6 +1137,22 @@ var task = new Vue({
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
+ onShare: function () {
|
|
|
+ if (this.activeState === 'activating') {
|
|
|
+ var _this = this
|
|
|
+ $.ajax({
|
|
|
+ url: '/jyActivity/membershipDay/doShare',
|
|
|
+ type: 'post',
|
|
|
+ success: function (res) {
|
|
|
+ if (res.data) {
|
|
|
+ _this.ajaxProgress()
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ this.activeNotStartToast()
|
|
|
+ }
|
|
|
+ },
|
|
|
toOrderPage: function () {
|
|
|
if (utils.isWeiXinBrowser) {
|
|
|
location.href = '/weixin/pay/toMyWxOrder?active=0'
|