|
@@ -0,0 +1,614 @@
|
|
|
+
|
|
|
+
|
|
|
+const CLOUD_MODULE_NOT_INSTALLED = 'InnerError.ResourceNotFound';
|
|
|
+
|
|
|
+Page({
|
|
|
+ data: {
|
|
|
+ type: '',
|
|
|
+ envId: '',
|
|
|
+ showUploadTip: false,
|
|
|
+ installModalVisible: false,
|
|
|
+ installModalTipText: '',
|
|
|
+ installModuleName: '',
|
|
|
+ installModulePageTitle: '',
|
|
|
+ userOpenId: 'ouSoxxxxxxxxxxxxxJp3zM',
|
|
|
+ currentOpenId:'',
|
|
|
+ templateId: 'XeULkxnxxxxxxxxxxxxxx9vRO0olhrQi34',
|
|
|
+ getErrorInfo:'',
|
|
|
+ securityContent:'hello world!',
|
|
|
+ securityMedia:'https://developers.weixin.qq.com/miniprogram/assets/images/head_global_z_@all.png',
|
|
|
+ mediaId:'MEDIA_ID',
|
|
|
+ sendCustomMessage:'Hello World',
|
|
|
+ urlLink:'https://wxaurl.cn/difT1VdVOLa',
|
|
|
+ smsTemplateId:'2053122',
|
|
|
+ phoneNumber:'+8611111111111',
|
|
|
+ appid:'appid',
|
|
|
+ csvLink:'extension://xxx.zip',
|
|
|
+ qrcode:'',
|
|
|
+ unlimitedQrcode:'',
|
|
|
+ qrcodeShortLink:''
|
|
|
+ },
|
|
|
+ handdleResult: function(data){
|
|
|
+ if(data.message.includes('env not exists') || data.message.includes('Environment not found') || data.message.includes('env check invalid be filterd')){
|
|
|
+ this.setData({
|
|
|
+ showUploadTip: true,
|
|
|
+ });
|
|
|
+ }
|
|
|
+ wx.hideLoading();
|
|
|
+ },
|
|
|
+ bindKeyInputCsvLink: function(e){
|
|
|
+ this.setData({
|
|
|
+ csvLink: e.detail.value
|
|
|
+ })
|
|
|
+ },
|
|
|
+ bindKeyInputUrlLink: function(e){
|
|
|
+ this.setData({
|
|
|
+ urlLink: e.detail.value
|
|
|
+ })
|
|
|
+ },
|
|
|
+ bindKeyInputSmsTemplateId: function(e){
|
|
|
+ this.setData({
|
|
|
+ smsTemplateId: e.detail.value
|
|
|
+ })
|
|
|
+ },
|
|
|
+ bindKeyInputPhoneNumber: function(e){
|
|
|
+ this.setData({
|
|
|
+ phoneNumber: e.detail.value
|
|
|
+ })
|
|
|
+ },
|
|
|
+ bindKeyInputAppid: function(e){
|
|
|
+ this.setData({
|
|
|
+ appid: e.detail.value
|
|
|
+ })
|
|
|
+ },
|
|
|
+ bindKeyInputSendCustomMessage: function(e){
|
|
|
+ this.setData({
|
|
|
+ sendCustomMessage: e.detail.value
|
|
|
+ })
|
|
|
+ },
|
|
|
+ bindKeyInputMediaId: function(e){
|
|
|
+ this.setData({
|
|
|
+ mediaId: e.detail.value
|
|
|
+ })
|
|
|
+ },
|
|
|
+ bindKeyInputSecurityMedia: function(e){
|
|
|
+ this.setData({
|
|
|
+ securityMedia: e.detail.value
|
|
|
+ })
|
|
|
+ },
|
|
|
+ bindKeyInputSecurityContent: function(e){
|
|
|
+ this.setData({
|
|
|
+ securityContent: e.detail.value
|
|
|
+ })
|
|
|
+ },
|
|
|
+ bindKeyInputTemplateId: function (e) {
|
|
|
+ this.setData({
|
|
|
+ templateId: e.detail.value
|
|
|
+ })
|
|
|
+ },
|
|
|
+ bindKeyInputOpenId: function (e) {
|
|
|
+ this.setData({
|
|
|
+ userOpenId: e.detail.value
|
|
|
+ })
|
|
|
+ },
|
|
|
+ clearError: function(){
|
|
|
+ this.setData({
|
|
|
+ userOpenId: '',
|
|
|
+ templateId: '',
|
|
|
+ getErrorInfo:'',
|
|
|
+ securityMedia:'',
|
|
|
+ securityContent:'',
|
|
|
+ mediaId:'',
|
|
|
+ sendCustomMessage:'',
|
|
|
+ urlLink:'',
|
|
|
+ smsTemplateId:'',
|
|
|
+ phoneNumber:'',
|
|
|
+ appid:'',
|
|
|
+ csvLink:'',
|
|
|
+ qrcode:'',
|
|
|
+ unlimitedQrcode:'',
|
|
|
+ qrcodeShortLink:''
|
|
|
+ })
|
|
|
+ },
|
|
|
+ onLoad(options) {
|
|
|
+ wx.setNavigationBarTitle({
|
|
|
+ title: `${options?.title}-${options?.subtitle}`
|
|
|
+ })
|
|
|
+ this.setData({ type: options?.type, envId: options?.envId});
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
+ sendMessage() {
|
|
|
+ wx.showLoading({
|
|
|
+ title: '',
|
|
|
+ });
|
|
|
+ wx.cloud
|
|
|
+ .callFunction({
|
|
|
+ name: 'cloudbase_module',
|
|
|
+ data: {
|
|
|
+ name: 'wx_message_send_message',
|
|
|
+ data: {
|
|
|
+ template_id: this.data.templateId,
|
|
|
+ page: "pages/index/index",
|
|
|
+ touser: this.data.userOpenId,
|
|
|
+ data:{ "thing1": { "value": 123 }, "thing4": { "value": 123 },"thing6": { "value": 123 },"thing7": { "value": 123 },"time6":{"value": "2022-11-32"} },
|
|
|
+ miniprogram_state:"trial",
|
|
|
+ lang:"zh_CN"
|
|
|
+ },
|
|
|
+ },
|
|
|
+ })
|
|
|
+ .then((resp) => {
|
|
|
+ if (resp?.result?.errcode === CLOUD_MODULE_NOT_INSTALLED) {
|
|
|
+ this.setData({
|
|
|
+ installModalVisible: true,
|
|
|
+ installModalTipText: '云开发>云模板>模板中心>小程序消息',
|
|
|
+ installModuleName: 'wx_message_send_message',
|
|
|
+ installModulePageTitle:'小程序消息-发送消息'
|
|
|
+ });
|
|
|
+ }else if(resp?.result?.errcode !== -1){
|
|
|
+ wx.showToast({
|
|
|
+ title: "发送失败",
|
|
|
+ icon: 'error',
|
|
|
+ duration: 2000
|
|
|
+ });
|
|
|
+ this.setData({
|
|
|
+ getErrorInfo:resp?.result?.errmsg,
|
|
|
+ })
|
|
|
+ }else {
|
|
|
+ wx.showToast({
|
|
|
+ title: "发送成功",
|
|
|
+ icon: 'success',
|
|
|
+ duration: 2000
|
|
|
+ });
|
|
|
+ }
|
|
|
+ wx.hideLoading();
|
|
|
+ })
|
|
|
+ .catch((e) => {
|
|
|
+ this.handdleResult(e);
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
+ createMessageActivityId() {
|
|
|
+ wx.showLoading({
|
|
|
+ title: '',
|
|
|
+ });
|
|
|
+ wx.cloud
|
|
|
+ .callFunction({
|
|
|
+ name: 'cloudbase_module',
|
|
|
+ data: {
|
|
|
+ name: 'wx_message_create_activity_id',
|
|
|
+ data: {
|
|
|
+ openid: this.data.userOpenId,
|
|
|
+ },
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .then((resp) => {
|
|
|
+ if (resp?.result?.errcode === CLOUD_MODULE_NOT_INSTALLED) {
|
|
|
+ this.setData({
|
|
|
+ installModalVisible: true,
|
|
|
+ installModalTipText: '云开发>云模板>模板中心>小程序消息',
|
|
|
+ installModuleName: 'wx_message_send_message',
|
|
|
+ installModulePageTitle:'小程序消息-创建activity_id'
|
|
|
+ });
|
|
|
+ }else if(resp?.result?.activityId){
|
|
|
+ wx.showToast({
|
|
|
+ title: "创建成功",
|
|
|
+ icon: 'success',
|
|
|
+ duration: 2000
|
|
|
+ });
|
|
|
+ }else {
|
|
|
+ wx.showToast({
|
|
|
+ title: "创建失败",
|
|
|
+ icon: 'error',
|
|
|
+ duration: 2000
|
|
|
+ });
|
|
|
+ this.setData({
|
|
|
+ getErrorInfo:resp?.result?.errmsg,
|
|
|
+ })
|
|
|
+ }
|
|
|
+ wx.hideLoading();
|
|
|
+ })
|
|
|
+ .catch((e) => {
|
|
|
+ this.handdleResult(e);
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
+ getCodeSrc() {
|
|
|
+ wx.showLoading({
|
|
|
+ title: '',
|
|
|
+ });
|
|
|
+ wx.cloud
|
|
|
+ .callFunction({
|
|
|
+ name: 'cloudbase_module',
|
|
|
+ data: {
|
|
|
+ name: 'wx_qrcode_get_qrcode',
|
|
|
+ data: {
|
|
|
+ path: 'pages/index/index',
|
|
|
+ width: 430,
|
|
|
+ auto_color: false,
|
|
|
+ line_color: { r: 0, g: 0, b: 0 },
|
|
|
+ is_hyaline: false,
|
|
|
+ env_version: 'trial',
|
|
|
+ },
|
|
|
+ },
|
|
|
+ })
|
|
|
+ .then((resp) => {
|
|
|
+ if (resp?.result?.errcode === CLOUD_MODULE_NOT_INSTALLED) {
|
|
|
+ this.setData({
|
|
|
+ installModalVisible: true,
|
|
|
+ installModalTipText: '云开发>云模板>模板中心>微信小程序码和链接',
|
|
|
+ installModuleName: 'wx_qrcode',
|
|
|
+ installModulePageTitle:'微信小程序码和链接-获取小程序码'
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ wx.showToast({
|
|
|
+ title: "获取成功",
|
|
|
+ icon: 'success',
|
|
|
+ duration: 2000
|
|
|
+ });
|
|
|
+ this.setData({
|
|
|
+ qrcode: resp.result.tempFileURL,
|
|
|
+ });
|
|
|
+ }
|
|
|
+ wx.hideLoading();
|
|
|
+ })
|
|
|
+ .catch((e) => {
|
|
|
+ this.handdleResult(e);
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
+ getUnlimitedCodeSrc() {
|
|
|
+ wx.showLoading({
|
|
|
+ title: '',
|
|
|
+ });
|
|
|
+ wx.cloud
|
|
|
+ .callFunction({
|
|
|
+ name: 'cloudbase_module',
|
|
|
+ data: {
|
|
|
+ name: 'wx_qrcode_get_unlimited_qrcode',
|
|
|
+ data: {
|
|
|
+ scene: 'abc',
|
|
|
+ page: 'pages/index/index',
|
|
|
+ check_path: true,
|
|
|
+ env_version: 'trial',
|
|
|
+ width: 430,
|
|
|
+ auto_color: false,
|
|
|
+ line_color: {"r":0,"g":0,"b":0},
|
|
|
+ is_hyaline: false,
|
|
|
+ },
|
|
|
+ },
|
|
|
+ })
|
|
|
+ .then((resp) => {
|
|
|
+ if (resp?.result?.errcode === CLOUD_MODULE_NOT_INSTALLED) {
|
|
|
+ this.setData({
|
|
|
+ installModalVisible: true,
|
|
|
+ installModalTipText: '云开发>云模板>模板中心>微信小程序码和链接',
|
|
|
+ installModuleName: 'wx_qrcode',
|
|
|
+ installModulePageTitle:'微信小程序码和链接-获取不限制的小程序码'
|
|
|
+ });
|
|
|
+ }else if(resp.result?.errmsg){
|
|
|
+ wx.showToast({
|
|
|
+ title: "获取失败",
|
|
|
+ icon: 'error',
|
|
|
+ duration: 2000
|
|
|
+ });
|
|
|
+ this.setData({
|
|
|
+ getErrorInfo:resp?.result?.errmsg,
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ wx.showToast({
|
|
|
+ title: "获取成功",
|
|
|
+ icon: 'success',
|
|
|
+ duration: 2000
|
|
|
+ });
|
|
|
+ this.setData({
|
|
|
+ unlimitedQrcode: resp.result.tempFileURL,
|
|
|
+ });
|
|
|
+ }
|
|
|
+ wx.hideLoading();
|
|
|
+ })
|
|
|
+ .catch((e) => {
|
|
|
+ this.handdleResult(e);
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
+ getShortLink() {
|
|
|
+ wx.showLoading({
|
|
|
+ title: '',
|
|
|
+ });
|
|
|
+ wx.cloud
|
|
|
+ .callFunction({
|
|
|
+ name: 'cloudbase_module',
|
|
|
+ data: {
|
|
|
+ name: 'wx_qrcode_generate_short_link',
|
|
|
+ data: {
|
|
|
+ page_url: 'pages/index/index',
|
|
|
+ page_title: '首页',
|
|
|
+ is_permanent: false,
|
|
|
+ },
|
|
|
+ },
|
|
|
+ })
|
|
|
+ .then((resp) => {
|
|
|
+ if (resp?.result?.errcode === CLOUD_MODULE_NOT_INSTALLED) {
|
|
|
+ this.setData({
|
|
|
+ installModalVisible: true,
|
|
|
+ installModalTipText: '云开发>云模板>模板中心>微信小程序码和链接',
|
|
|
+ installModuleName: 'wx_qrcode',
|
|
|
+ installModulePageTitle:'微信小程序码和链接-获取ShortLink'
|
|
|
+ });
|
|
|
+ }else if(resp.result?.errmsg){
|
|
|
+ wx.showToast({
|
|
|
+ title: "获取失败",
|
|
|
+ icon: 'error',
|
|
|
+ duration: 2000
|
|
|
+ });
|
|
|
+ this.setData({
|
|
|
+ getErrorInfo:resp?.result?.errmsg,
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ wx.showToast({
|
|
|
+ title: "获取成功",
|
|
|
+ icon: 'success',
|
|
|
+ duration: 2000
|
|
|
+ });
|
|
|
+ this.setData({
|
|
|
+ qrcodeShortLink: resp.result.tempFileURL,
|
|
|
+ });
|
|
|
+ }
|
|
|
+ wx.hideLoading();
|
|
|
+ })
|
|
|
+ .catch((e) => {
|
|
|
+ this.handdleResult(e);
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+sendCloudbaseSms() {
|
|
|
+ wx.showLoading({
|
|
|
+ title: '',
|
|
|
+ });
|
|
|
+ wx.cloud
|
|
|
+ .callFunction({
|
|
|
+ name: 'cloudbase_module',
|
|
|
+ data: {
|
|
|
+ name: 'wx_sms_new_send_cloudbase_sms',
|
|
|
+ data: {
|
|
|
+ env: this.data.envId,
|
|
|
+ url_link: this.data.urlLink,
|
|
|
+ template_id: this.data.smsTemplateId,
|
|
|
+ template_param_list: ['xxx'],
|
|
|
+ phone_number_list: [this.data.phoneNumber],
|
|
|
+ use_short_name: false,
|
|
|
+ resource_appid: this.data.appid,
|
|
|
+ },
|
|
|
+ },
|
|
|
+ })
|
|
|
+ .then((resp) => {
|
|
|
+ if (resp?.result?.errcode === CLOUD_MODULE_NOT_INSTALLED) {
|
|
|
+ this.setData({
|
|
|
+ installModalVisible: true,
|
|
|
+ installModalTipText: '云开发>云模板>模板中心>小程序短信',
|
|
|
+ installModuleName: 'wx_sms_new_send_cloudbase_sms',
|
|
|
+ installModulePageTitle:'小程序短信-发送短信'
|
|
|
+ });
|
|
|
+ }else if(resp?.result?.errmsg){
|
|
|
+ wx.showToast({
|
|
|
+ title: "发送失败",
|
|
|
+ icon: 'error',
|
|
|
+ duration: 2000
|
|
|
+ });
|
|
|
+ this.setData({
|
|
|
+ getErrorInfo:resp?.result?.errmsg,
|
|
|
+ })
|
|
|
+ }else {
|
|
|
+ wx.showToast({
|
|
|
+ title: "发送成功",
|
|
|
+ icon: 'success',
|
|
|
+ duration: 2000
|
|
|
+ });
|
|
|
+ }
|
|
|
+ wx.hideLoading();
|
|
|
+ })
|
|
|
+ .catch((e) => {
|
|
|
+ this.handdleResult(e);
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
+ sendCloudbaseSmsTask() {
|
|
|
+ wx.showLoading({
|
|
|
+ title: '',
|
|
|
+ });
|
|
|
+ wx.cloud
|
|
|
+ .callFunction({
|
|
|
+ name: 'cloudbase_module',
|
|
|
+ data: {
|
|
|
+ name: 'wx_sms_create_send_sms_task',
|
|
|
+ data:{
|
|
|
+ env: this.data.envId,
|
|
|
+ file_url: this.data.csvLink,
|
|
|
+ template_id: this.data.smsTemplateId,
|
|
|
+ use_short_name: false
|
|
|
+ }
|
|
|
+ },
|
|
|
+ })
|
|
|
+ .then((resp) => {
|
|
|
+ if (resp?.result?.errcode === CLOUD_MODULE_NOT_INSTALLED) {
|
|
|
+ this.setData({
|
|
|
+ installModalVisible: true,
|
|
|
+ installModalTipText: '云开发>云模板>模板中心>小程序短信',
|
|
|
+ installModuleName: 'wx_sms_new_send_cloudbase_sms',
|
|
|
+ installModulePageTitle:'小程序短信-创建发短信任务'
|
|
|
+ });
|
|
|
+ }else if(resp?.result?.errmsg){
|
|
|
+ wx.showToast({
|
|
|
+ title: "创建失败",
|
|
|
+ icon: 'error',
|
|
|
+ duration: 2000
|
|
|
+ });
|
|
|
+ this.setData({
|
|
|
+ getErrorInfo:resp?.result?.errmsg,
|
|
|
+ })
|
|
|
+ }else {
|
|
|
+ wx.showToast({
|
|
|
+ title: "创建成功",
|
|
|
+ icon: 'success',
|
|
|
+ duration: 2000
|
|
|
+ });
|
|
|
+ }
|
|
|
+ wx.hideLoading();
|
|
|
+ })
|
|
|
+ .catch((e) => {
|
|
|
+ this.handdleResult(e);
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
+ securityMessageCheck() {
|
|
|
+ wx.showLoading({
|
|
|
+ title: '',
|
|
|
+ });
|
|
|
+ wx.cloud
|
|
|
+ .callFunction({
|
|
|
+ name: 'cloudbase_module',
|
|
|
+ data: {
|
|
|
+ name: 'wx_security_msg_sec_check',
|
|
|
+ data: {
|
|
|
+ scene: 1,
|
|
|
+ version: 2,
|
|
|
+ content: this.data.securityContent,
|
|
|
+ },
|
|
|
+ },
|
|
|
+ })
|
|
|
+ .then((resp) => {
|
|
|
+ if (resp?.result?.errcode === CLOUD_MODULE_NOT_INSTALLED) {
|
|
|
+ this.setData({
|
|
|
+ installModalVisible: true,
|
|
|
+ installModalTipText: '云开发>云模板>模板中心>小程序安全能力',
|
|
|
+ installModuleName: 'wx_security_msg_sec_check',
|
|
|
+ installModulePageTitle:'小程序安全能力-文本内容安全识别'
|
|
|
+ });
|
|
|
+ }else if(resp?.result?.result?.label === 100){
|
|
|
+ wx.showToast({
|
|
|
+ title: "内容正常",
|
|
|
+ icon: 'success',
|
|
|
+ duration: 2000
|
|
|
+ });
|
|
|
+ }else{
|
|
|
+ wx.showToast({
|
|
|
+ title: "内容异常",
|
|
|
+ icon: 'error',
|
|
|
+ duration: 2000
|
|
|
+ });
|
|
|
+ }
|
|
|
+ wx.hideLoading();
|
|
|
+ })
|
|
|
+ .catch((e) => {
|
|
|
+ this.handdleResult(e);
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
+ securityMediaCheck() {
|
|
|
+ wx.showLoading({
|
|
|
+ title: '',
|
|
|
+ });
|
|
|
+ wx.cloud
|
|
|
+ .callFunction({
|
|
|
+ name: 'cloudbase_module',
|
|
|
+ data: {
|
|
|
+ name: 'wx_security_media_check',
|
|
|
+ data: {
|
|
|
+ scene: 1,
|
|
|
+ version: 2,
|
|
|
+ media_url: this.data.securityMedia,
|
|
|
+ media_type: 2,
|
|
|
+ },
|
|
|
+ },
|
|
|
+ })
|
|
|
+ .then((resp) => {
|
|
|
+ if (resp?.result?.errcode === CLOUD_MODULE_NOT_INSTALLED) {
|
|
|
+ this.setData({
|
|
|
+ installModalVisible: true,
|
|
|
+ installModalTipText: '云开发>云模板>模板中心>小程序安全能力',
|
|
|
+ installModuleName: 'wx_security_msg_sec_check',
|
|
|
+ installModulePageTitle:'小程序安全能力-音视频内容安全识别'
|
|
|
+ });
|
|
|
+ }else if(resp?.result?.errmsg){
|
|
|
+ wx.showToast({
|
|
|
+ title: "内容异常",
|
|
|
+ icon: 'error',
|
|
|
+ duration: 2000
|
|
|
+ });
|
|
|
+ this.setData({
|
|
|
+ getErrorInfo:resp?.result?.errmsg,
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ wx.showToast({
|
|
|
+ title: "内容正常",
|
|
|
+ icon: 'success',
|
|
|
+ duration: 2000
|
|
|
+ });
|
|
|
+ }
|
|
|
+ wx.hideLoading();
|
|
|
+ })
|
|
|
+ .catch((e) => {
|
|
|
+ this.handdleResult(e);
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
+ getUserOpenId() {
|
|
|
+ wx.showLoading({
|
|
|
+ title: '',
|
|
|
+ });
|
|
|
+ wx.cloud
|
|
|
+ .callFunction({
|
|
|
+ name: 'cloudbase_module',
|
|
|
+ data: {
|
|
|
+ name: 'wx_user_get_open_id',
|
|
|
+ },
|
|
|
+ })
|
|
|
+ .then((resp) => {
|
|
|
+ if (resp?.result?.errcode === CLOUD_MODULE_NOT_INSTALLED) {
|
|
|
+ this.setData({
|
|
|
+ installModalVisible: true,
|
|
|
+ installModalTipText: '云开发>云模板>模板中心>小程序用户信息',
|
|
|
+ installModuleName: 'wx_user_get_open_id',
|
|
|
+ installModulePageTitle:'小程序用户信息-获取用户openId'
|
|
|
+ });
|
|
|
+ }else {
|
|
|
+ this.setData({
|
|
|
+ currentOpenId: resp.result.openId,
|
|
|
+ });
|
|
|
+ }
|
|
|
+ wx.hideLoading();
|
|
|
+ })
|
|
|
+ .catch((e) => {
|
|
|
+ this.handdleResult(e);
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
+ getPhoneNumber(e) {
|
|
|
+ console.log(e.detail.code);
|
|
|
+ wx.cloud.callFunction({
|
|
|
+ name: 'cloudbase_module',
|
|
|
+ data: {
|
|
|
+ name: 'wx_user_get_phone_number',
|
|
|
+ data: {
|
|
|
+ code: e.detail.code,
|
|
|
+ },
|
|
|
+ },
|
|
|
+ success: (res) => {
|
|
|
+ const phoneInfo = res.result?.phoneInfo;
|
|
|
+ console.log('获取到的手机号信息: ', phoneInfo);
|
|
|
+ },
|
|
|
+ });
|
|
|
+ }
|
|
|
+});
|