|
|
// page/subPackage/pages/zeroSell/components/action-bar.js
|
|
|
|
|
|
import ZeroSellService from '../service/zero-sell'
|
|
|
import CommonService from '../service/common'
|
|
|
import router from '../router/router'
|
|
|
|
|
|
import { postTmplId } from '../../../libs/tmplIdMessage.js'
|
|
|
const event = global.event;
|
|
|
|
|
|
var app = getApp();
|
...
|
...
|
@@ -50,18 +49,23 @@ Component({ |
|
|
show: false,
|
|
|
code: '',
|
|
|
error: false,
|
|
|
fellow: false
|
|
|
fellow: false,
|
|
|
msgChecked: true
|
|
|
},
|
|
|
|
|
|
ready() {
|
|
|
this.service = new ZeroSellService();
|
|
|
this.commonService = new CommonService();
|
|
|
},
|
|
|
|
|
|
/**
|
|
|
* 组件的方法列表
|
|
|
*/
|
|
|
methods: {
|
|
|
msgSwitch() {
|
|
|
this.setData({
|
|
|
msgChecked: !this.data.msgChecked
|
|
|
})
|
|
|
},
|
|
|
fetchCode() {
|
|
|
wx.showLoading({
|
|
|
mask: true
|
...
|
...
|
@@ -104,8 +108,22 @@ Component({ |
|
|
},
|
|
|
|
|
|
hadJoinToShare() {
|
|
|
console.log(this.data.msgChecked)
|
|
|
let that = this
|
|
|
if (this.data.msgChecked) {
|
|
|
let tmplIds = ['2PMsn85-733813unyw1EGVLQY5LE6BbHIQ_sGM-F-3U', 'l3YAeDrrqspEFpNpOofZxXAk_wKH3zdjNBVZmX42q5c'];
|
|
|
postTmplId({
|
|
|
tmplIds
|
|
|
}).then(res => {
|
|
|
that.goShare();
|
|
|
that.triggerEvent('getcode');
|
|
|
}).catch(err => {
|
|
|
console.log(err)
|
|
|
})
|
|
|
} else {
|
|
|
this.goShare();
|
|
|
this.triggerEvent('getcode');
|
|
|
}
|
|
|
},
|
|
|
|
|
|
goMyList() {
|
...
|
...
|
@@ -152,13 +170,5 @@ Component({ |
|
|
this.triggerEvent('getcode');
|
|
|
},
|
|
|
|
|
|
submitFormId(e) {
|
|
|
return this.commonService.addWechatFormId({
|
|
|
formId: e.detail.formId,
|
|
|
uid: app.getUid() || 0,
|
|
|
openId: app.getOpenID() || '',
|
|
|
miniapp_type: app.getMiniappType()
|
|
|
});
|
|
|
}
|
|
|
}
|
|
|
}) |
...
|
...
|
|