index.wxml 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213
  1. <view class="container">
  2. <view class="main">
  3. <!-- 获取小程序码 -->
  4. <block wx:if="{{ type === 'wx_qrcode_get_qrcode' }}">
  5. <view class="top_tip">可通过云开发云模板提供的能力,直接获取ShortLink</view>
  6. <view wx:if="{{qrcode}}" class="code_box">
  7. <image class="code_img" src="{{qrcode}}" />
  8. </view>
  9. <view class="button" bindtap="getCodeSrc">获取小程序码</view>
  10. <view class="tip">可以在”云开发>云模板>模板中心>微信小程序码和链接“找到该模板</view>
  11. </block>
  12. <!-- 获取不限制的小程序码 -->
  13. <block wx:if="{{ type === 'wx_qrcode_get_unlimited_qrcode' }}">
  14. <view class="top_tip">可通过云开发云模板提供的能力,直接获取不限制的小程序码</view>
  15. <view class="page-section">
  16. <view wx:if="{{qrcodeShortLink}}" class="code_box">
  17. <image class="code_img" src="{{qrcodeShortLink}}" />
  18. </view>
  19. <view wx:if="{{getErrorInfo}}" class="weui-cells__title">失败原因</view>
  20. <view wx:if="{{getErrorInfo}}" class="weui-cells weui-cells_after-error">
  21. {{getErrorInfo}}
  22. </view>
  23. </view>
  24. <view class="button" bindtap="getUnlimitedCodeSrc">获取不限制的小程序码</view>
  25. <view class="tip">可以在”云开发>云模板>模板中心>微信小程序码和链接“找到该模板</view>
  26. </block>
  27. <!-- 获取shortLink -->
  28. <block wx:if="{{ type === 'wx_qrcode_generate_short_link' }}">
  29. <view class="top_tip">可通过云开发云模板提供的能力,直接获取ShortLink</view>
  30. <view class="page-section">
  31. <view wx:if="{{qrcode}}" class="code_box">
  32. <image class="code_img" src="{{qrcode}}" />
  33. </view>
  34. <view wx:if="{{getErrorInfo}}" class="weui-cells__title">失败原因</view>
  35. <view wx:if="{{getErrorInfo}}" class="weui-cells weui-cells_after-error">
  36. {{getErrorInfo}}
  37. </view>
  38. </view>
  39. <view class="button" bindtap="getShortLink">获取ShortLink</view>
  40. <view class="tip">可以在”云开发>云模板>模板中心>微信小程序码和链接“找到该模板</view>
  41. </block>
  42. <!-- 发送消息 -->
  43. <block wx:if="{{ type === 'wx_message_send_message' }}">
  44. <view class="top_tip">可通过云开发云模板提供的能力,向订阅用户送微信订阅消息。</view>
  45. <view class="page-section">
  46. <view class="weui-cells__title">订阅消息模板Id</view>
  47. <view class="weui-cells weui-cells_after-title">
  48. <view class="weui-cell weui-cell_input">
  49. <input class="weui-input" value="{{templateId}}" bindinput="bindKeyInputTemplateId" placeholder="微信订阅消息模板Id"/>
  50. </view>
  51. </view>
  52. <view class="weui-cells__title">消息接收者openId</view>
  53. <view class="weui-cells weui-cells_after-title">
  54. <view class="weui-cell weui-cell_input">
  55. <input class="weui-input" value="{{userOpenId}}" bindinput="bindKeyInputOpenId" placeholder="消息接收者openId"/>
  56. </view>
  57. </view>
  58. <view wx:if="{{getErrorInfo}}" class="weui-cells__title">失败原因</view>
  59. <view wx:if="{{getErrorInfo}}" class="weui-cells weui-cells_after-error">
  60. {{getErrorInfo}}
  61. </view>
  62. </view>
  63. <view class="button" bindtap="sendMessage" wx:if="{{!getErrorInfo}}">发送消息</view>
  64. <view class="button_clear" bindtap="clearError" wx:if="{{getErrorInfo}}">清空</view>
  65. <cloud-module-install-path installModuleName="小程序消息"></cloud-module-install-path>
  66. </block>
  67. <!-- 创建activity_id -->
  68. <block wx:if="{{ type === 'wx_message_create_activity_id' }}">
  69. <view class="top_tip">可通过云开发云模板提供的能力,创建被分享动态消息或私密消息的activity_id。</view>
  70. <view class="page-section">
  71. <view class="weui-cells__title">用户openId</view>
  72. <view class="weui-cells weui-cells_after-title">
  73. <view class="weui-cell weui-cell_input">
  74. <input class="weui-input" value="{{userOpenId}}" bindinput="bindKeyInputOpenId" placeholder="用户openId"/>
  75. </view>
  76. </view>
  77. <view wx:if="{{getErrorInfo}}" class="weui-cells__title">失败原因</view>
  78. <view wx:if="{{getErrorInfo}}" class="weui-cells weui-cells_after-error">
  79. {{getErrorInfo}}
  80. </view>
  81. </view>
  82. <view class="button" bindtap="createMessageActivityId" wx:if="{{!getErrorInfo}}">创建activity_id</view>
  83. <view class="button_clear" bindtap="clearError" wx:if="{{getErrorInfo}}">清空</view>
  84. <cloud-module-install-path installModuleName="小程序消息"></cloud-module-install-path>
  85. </block>
  86. <!-- 发送短信 -->
  87. <block wx:if="{{ type === 'wx_sms_new_send_cloudbase_sms' }}">
  88. <view class="top_tip">可通过云开发云模板提供的能力,向用户发送携带 URL Link 的短信。</view>
  89. <view class="page-section">
  90. <view class="weui-cells__title">URL Link</view>
  91. <view class="weui-cells weui-cells_after-title">
  92. <view class="weui-cell weui-cell_input">
  93. <input class="weui-input" value="{{urlLink}}" bindinput="bindKeyInputUrlLink" placeholder="请输入URL Link"/>
  94. </view>
  95. </view>
  96. <view class="weui-cells__title">短信模版ID</view>
  97. <view class="weui-cells weui-cells_after-title">
  98. <view class="weui-cell weui-cell_input">
  99. <input class="weui-input" value="{{smsTemplateId}}" bindinput="bindKeyInputSmsTemplateId" placeholder="请输入短信模版ID"/>
  100. </view>
  101. </view>
  102. <view class="weui-cells__title">手机号</view>
  103. <view class="weui-cells weui-cells_after-title">
  104. <view class="weui-cell weui-cell_input">
  105. <input class="weui-input" value="{{phoneNumber}}" bindinput="bindKeyInputPhoneNumber" placeholder="请输入手机号"/>
  106. </view>
  107. </view>
  108. <view class="weui-cells__title">APPID</view>
  109. <view class="weui-cells weui-cells_after-title">
  110. <view class="weui-cell weui-cell_input">
  111. <input class="weui-input" value="{{appid}}" bindinput="bindKeyInputAppid" placeholder="请输入APPID"/>
  112. </view>
  113. </view>
  114. <view wx:if="{{getErrorInfo}}" class="weui-cells__title">失败原因</view>
  115. <view wx:if="{{getErrorInfo}}" class="weui-cells weui-cells_after-error">
  116. {{getErrorInfo}}
  117. </view>
  118. </view>
  119. <view class="button" bindtap="sendCloudbaseSms" wx:if="{{!getErrorInfo}}">发送短信</view>
  120. <view class="button_clear" bindtap="clearError" wx:if="{{getErrorInfo}}">清空</view>
  121. <cloud-module-install-path installModuleName="小程序短信"></cloud-module-install-path>
  122. </block>
  123. <!-- 创建发送短信任务 -->
  124. <block wx:if="{{ type === 'wx_sms_create_send_sms_task' }}">
  125. <view class="top_tip">可通过云开发云模板提供的能力,创建发短信任务。发送的短信支持打开云开发静态网站 H5,进而在 H5 里可以打开小程序。</view>
  126. <view class="page-section">
  127. <view class="weui-cells__title">短信CSV文件地址</view>
  128. <view class="weui-cells weui-cells_after-title">
  129. <view class="weui-cell weui-cell_input">
  130. <input class="weui-input" value="{{csvLink}}" bindinput="bindKeyInputCsvLink" placeholder="请输入短信CSV文件地址"/>
  131. </view>
  132. </view>
  133. <view class="weui-cells__title">短信模版ID</view>
  134. <view class="weui-cells weui-cells_after-title">
  135. <view class="weui-cell weui-cell_input">
  136. <input class="weui-input" value="{{smsTemplateId}}" bindinput="bindKeyInputSmsTemplateId" placeholder="请输入短信模版ID"/>
  137. </view>
  138. </view>
  139. <view wx:if="{{getErrorInfo}}" class="weui-cells__title">失败原因</view>
  140. <view wx:if="{{getErrorInfo}}" class="weui-cells weui-cells_after-error">
  141. {{getErrorInfo}}
  142. </view>
  143. </view>
  144. <view class="button" bindtap="sendCloudbaseSmsTask" wx:if="{{!getErrorInfo}}">创建发送短信任务</view>
  145. <view class="button_clear" bindtap="clearError" wx:if="{{getErrorInfo}}">清空</view>
  146. <cloud-module-install-path installModuleName="小程序短信"></cloud-module-install-path>
  147. </block>
  148. <!-- 文本内容安全识别 -->
  149. <block wx:if="{{ type === 'wx_security_msg_sec_check' }}">
  150. <view class="top_tip">可通过云开发云模板提供的能力,检查一段文本是否含有违法违规内容。</view>
  151. <view class="page-section">
  152. <view class="weui-cells__title">文本内容</view>
  153. <view class="weui-cells weui-cells_after-title">
  154. <view class="weui-cell weui-cell_input">
  155. <input class="weui-input" value="{{securityContent}}" bindinput="bindKeyInputSecurityContent" placeholder="请输入需要安全识别的文本内容"/>
  156. </view>
  157. </view>
  158. </view>
  159. <view class="button" bindtap="securityMessageCheck">文本内容安全识别</view>
  160. <cloud-module-install-path installModuleName="小程序安全能力"></cloud-module-install-path>
  161. </block>
  162. <!-- 音视频内容安全识别 -->
  163. <block wx:if="{{ type === 'wx_security_media_check' }}">
  164. <view class="top_tip">可通过云开发云模板提供的能力,异步校验图片/音频是否含有违法违规内容。</view>
  165. <view class="page-section">
  166. <view class="weui-cells__title">文件url地址</view>
  167. <view class="weui-cells weui-cells_after-title">
  168. <view class="weui-cell weui-cell_input">
  169. <input class="weui-input" value="{{securityMedia}}" bindinput="bindKeyInputSecurityMedia" placeholder="请输入需要安全识别的音视频url地址"/>
  170. </view>
  171. </view>
  172. <view wx:if="{{getErrorInfo}}" class="weui-cells__title">失败原因</view>
  173. <view wx:if="{{getErrorInfo}}" class="weui-cells weui-cells_after-error">
  174. {{getErrorInfo}}
  175. </view>
  176. </view>
  177. <view class="button" bindtap="securityMediaCheck" wx:if="{{!getErrorInfo}}">音视频内容安全识别</view>
  178. <view class="button_clear" bindtap="clearError" wx:if="{{getErrorInfo}}">清空</view>
  179. <cloud-module-install-path installModuleName="小程序安全能力"></cloud-module-install-path>
  180. </block>
  181. <!-- 获取用户openId -->
  182. <block wx:if="{{ type === 'wx_user_get_open_id'}}">
  183. <view class="top_tip">可通过云开发云模板提供的能力,获取用户的openId。</view>
  184. <view class="box_text" wx:if="{{!currentOpenId}}">openId将展示在这里</view>
  185. <view wx:if="{{currentOpenId}}" class="code_box">
  186. {{currentOpenId}}
  187. </view>
  188. <view class="button" bindtap="getUserOpenId">获取openId</view>
  189. <cloud-module-install-path installModuleName="小程序用户信息"></cloud-module-install-path>
  190. </block>
  191. <!-- 手机号快速验证 -->
  192. <block wx:if="{{ type === 'wx_user_get_phone_number' }}">
  193. <view class="top_tip">可通过云开发云模板提供的能力,将code换取用户手机号。每个code只能使用一次,code的有效期为5min。</view>
  194. <button class="button_phone" open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber">获取手机号</button>
  195. <cloud-module-install-path installModuleName="小程序用户信息"></cloud-module-install-path>
  196. </block>
  197. </view>
  198. </view>
  199. <cloud-tip-modal showUploadTipProps="{{showUploadTip}}" />
  200. <!-- 云模板未安装提示弹框 -->
  201. <cloud-module-install-modal installModulePageTitleProps="{{installModulePageTitle}}" modalVisibleProps="{{ installModalVisible }}" tipTextProps="{{ installModalTipText }}" installModuleNameProps="{{ installModuleName }}" />