| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788 |
- import common from '../../utils/util';
- import server from '../../utils/main';
- const app = getApp();
- Page({
- data: {
- IsInput: true,
- Name: "",
- Contact: "",
- ChannelID: 0,
- },
- onLoad: function (options) {
- this.setData({
- IsInput: true,
- Name: "",
- Contact: "",
- AppID: app.globalData.AppID,
- Height: common.getSystemHeight(),
- });
- },
- bindKeyInput1: function (e) {
- this.setData({
- Name: e.detail.value
- })
- },
- bindKeyInput2: function (e) {
- this.setData({
- Contact: e.detail.value
- })
- },
- save: function () {
- if (this.data.Name.length > 0 && this.data.Contact.length > 0) {
- if (common.IsChinese(this.data.Contact)) {
- wx.showToast({
- title: '请输入有效信息',
- icon: 'success',
- duration: 2000
- })
- }
- else {
- var that = this;
- server.getData('AddChannel?Name='
- + this.data.Name + '&Contact='
- + this.data.Contact + '&ProgramID='
- + app.globalData.ProgramID + '&UserID='
- + app.globalData.userInfo.UserID, function (data) {
- if (data) {
- that.setData({
- IsInput: false,
- ChannelID: data.insertId,
- });
- }
- });
- }
- }
- else {
- wx.showToast({
- title: '请输入有效信息',
- icon: 'success',
- duration: 2000
- })
- }
- },
- setClipboardData: function () {
- wx.setClipboardData({
- data: '小程序AppID:' + app.globalData.AppID + ' 小程序启动Path:pages/index/index?SourceID=' + this.data.ChannelID,
- success: function (res) {
- wx.getClipboardData({
- success: function (res) {
- wx.showToast({
- title: '存入剪贴板',
- icon: 'success',
- duration: 2000
- })
- }
- })
- }
- })
- },
- onShareAppMessage: function () {
- return {
- title: app.globalData.ShareTitle,
- path: 'pages/index/index?UserID=' + app.globalData.userInfo.UserID,
- imageUrl: '../../images/07001.png',
- }
- },
- });
|