当前位置: 首页 > news >正文

没备案网站如何通过百度联盟审核创新营销方式有哪些

没备案网站如何通过百度联盟审核,创新营销方式有哪些,东莞室内设计培训,做书封面的网站文章目录 最近需求要做就记录一下。 人狠话不多&#xff0c;直接上功能&#xff1a; 直接搂代码吧,复制过去就可以用&#xff0c;有其他需求自己改吧改吧。 signature.wxml <!-- 电子签名页面 --> <custom-navbar title"电子签名"show-home"{{fals…

文章目录


最近需求要做就记录一下。

人狠话不多,直接上功能:
在这里插入图片描述

直接搂代码吧,复制过去就可以用,有其他需求自己改吧改吧。

signature.wxml

<!-- 电子签名页面 -->
<custom-navbar title="电子签名"show-home="{{false}}"
/>
<view class="signature-page"><!-- 顶部操作栏 --><view class="action-bar"><t-button theme="primary" icon="refresh" bind:tap="handleClear">重写</t-button><t-button theme="primary" icon="rollback" bind:tap="handleUndo">撤销</t-button><t-button theme="primary" icon="check" bind:tap="handleSubmit">提交</t-button></view><!-- 签名区域 --><view class="signature-area-large"><canvastype="2d"id="signatureCanvas"class="signature-canvas-large"disable-scroll="{{true}}"bindtouchstart="handleTouchStart"bindtouchmove="handleTouchMove"bindtouchend="handleTouchEnd"></canvas></view><!-- 提示文本 --><view class="signature-tips">请在上方区域书写您的签名</view>
</view> 

注意:我是用的tdesign这个UI,所以是t-button


signature.wxss

/* 页面容器 */
.signature-page {width: 100vw;height: calc(100vh - 44rpx);background-color: #f6f6f6;display: flex;flex-direction: column;padding: 16rpx;box-sizing: border-box;
}/* 顶部操作栏 */
.action-bar {display: flex;justify-content: flex-end;gap: 16rpx;margin-bottom: 20rpx;padding: 0 10rpx;
}/* 自定义按钮样式 */
.action-bar .t-button {min-width: auto;padding: 0 16rpx;font-size: 18rpx !important;height: 35rpx !important;line-height: 35rpx !important;
}/* 按钮图标样式 */
.action-bar .t-icon,
.action-bar .t-button__icon,
.action-bar .t-button .t-icon {font-size: 20rpx !important;
}/* 签名区域-大尺寸 */
.signature-area-large {flex: 1;background-color: #ffffff;border-radius: 16rpx;box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.1);overflow: hidden;position: relative;margin: 0 auto;width: 94vw;height: 80vh;
}/* 签名画布-大尺寸 */
.signature-canvas-large {width: 100%;height: 100%;background-color: #ffffff;
}/* 提示文本 */
.signature-tips {text-align: center;color: #999999;font-size: 12px;margin-top: 16rpx;
}

signature.js

Page({data: {ctx: null,points: [], // 存储所有笔画currentStroke: [], // 当前笔画isDrawing: false,},/*** 生命周期函数--监听页面加载* 初始化画布设置*/onLoad() {this.initCanvas();},/*** 生命周期函数--监听页面卸载*/onUnload() {},/*** 初始化画布* 设置画布大小、像素比例和画笔样式*/async initCanvas() {const query = wx.createSelectorQuery();query.select('#signatureCanvas').fields({ node: true, size: true }).exec((res) => {const canvas = res[0].node;const ctx = canvas.getContext('2d');// 设置画布大小,使用新的API获取设备像素比const dpr = wx.getWindowInfo().pixelRatio;canvas.width = res[0].width * dpr;canvas.height = res[0].height * dpr;ctx.scale(dpr, dpr);// 设置画笔样式ctx.strokeStyle = '#000000';ctx.lineWidth = 3;ctx.lineCap = 'round';ctx.lineJoin = 'round';this.setData({ ctx });});},/*** 处理触摸开始事件* 开始一个新的笔画,记录起始点* @param {Object} e - 触摸事件对象*/handleTouchStart(e) {const { x, y } = e.touches[0];this.setData({isDrawing: true,currentStroke: [[x, y]]});this.data.ctx.beginPath();this.data.ctx.moveTo(x, y);},/*** 处理触摸移动事件* 继续绘制当前笔画的路径* @param {Object} e - 触摸事件对象*/handleTouchMove(e) {if (!this.data.isDrawing) return;const { x, y } = e.touches[0];this.data.currentStroke.push([x, y]);this.data.ctx.lineTo(x, y);this.data.ctx.stroke();},/*** 处理触摸结束事件* 完成当前笔画,将其添加到笔画历史中*/handleTouchEnd() {if (!this.data.isDrawing) return;this.setData({isDrawing: false,points: [...this.data.points, this.data.currentStroke],currentStroke: []});},/*** 清除画布内容* 清空所有笔画记录和画布显示*/handleClear() {const { ctx } = this.data;ctx.clearRect(0, 0, ctx.canvas.width, ctx.canvas.height);this.setData({ points: [] });},/*** 撤销上一步操作* 移除最后一笔,并重绘剩余的笔画*/handleUndo() {if (this.data.points.length === 0) return;const { ctx } = this.data;ctx.clearRect(0, 0, ctx.canvas.width, ctx.canvas.height);// 移除最后一笔const newPoints = this.data.points.slice(0, -1);this.setData({ points: newPoints });// 重绘所有笔画newPoints.forEach(stroke => {ctx.beginPath();ctx.moveTo(stroke[0][0], stroke[0][1]);stroke.forEach(([x, y]) => {ctx.lineTo(x, y);});ctx.stroke();});},/*** 提交签名* 将画布内容转换为图片并处理提交逻辑* @returns {Promise<void>}*/async handleSubmit() {if (this.data.points.length === 0) {wx.showToast({title: '请先签名',icon: 'none'});return;}// todo: 这里根据具体业务写吧,我这只是举个例子try {// 将画布内容转换为图片const tempFilePath = await new Promise((resolve, reject) => {wx.canvasToTempFilePath({canvas: this.data.ctx.canvas,success: res => resolve(res.tempFilePath),fail: reject});});// 这里可以处理签名图片,比如上传到服务器console.log('签名图片路径:', tempFilePath);wx.showToast({title: '提交成功',icon: 'success'});// 返回上一页setTimeout(() => {wx.navigateBack();}, 1500);} catch (error) {console.error('提交签名失败:', error);wx.showToast({title: '提交失败',icon: 'error'});}}
}); 

注意:handleSubmit 提交的逻辑根据具体的业务写


signature.json

{"usingComponents": {"t-button": "tdesign-miniprogram/button/button"},"disableScroll": true,"pageOrientation": "landscape"
} 

注意:我是用的tdesign这个UI

"pageOrientation": "landscape"这个是设置横屏


就是用canvas画,小程序里这种需求一般都是用canvas

收工,有需要copy去吧,哈哈哈哈哈哈哈哈哈哈


文章转载自:
http://squall.hmxb.cn
http://vocoid.hmxb.cn
http://parthenos.hmxb.cn
http://curvous.hmxb.cn
http://effectual.hmxb.cn
http://adolescency.hmxb.cn
http://picus.hmxb.cn
http://brash.hmxb.cn
http://antinuke.hmxb.cn
http://agrimony.hmxb.cn
http://hangzhou.hmxb.cn
http://denish.hmxb.cn
http://unfeatured.hmxb.cn
http://cuso.hmxb.cn
http://dona.hmxb.cn
http://feoffee.hmxb.cn
http://iktas.hmxb.cn
http://garble.hmxb.cn
http://impervious.hmxb.cn
http://eustace.hmxb.cn
http://foregather.hmxb.cn
http://unimagined.hmxb.cn
http://licensure.hmxb.cn
http://afterhours.hmxb.cn
http://learned.hmxb.cn
http://dodecaphonic.hmxb.cn
http://sagina.hmxb.cn
http://zoogeographical.hmxb.cn
http://toxoplasmosis.hmxb.cn
http://extremum.hmxb.cn
http://psychopharmaceutical.hmxb.cn
http://fratchy.hmxb.cn
http://correctly.hmxb.cn
http://hazily.hmxb.cn
http://untorn.hmxb.cn
http://colitis.hmxb.cn
http://assure.hmxb.cn
http://symphilous.hmxb.cn
http://progeny.hmxb.cn
http://almanac.hmxb.cn
http://atmometric.hmxb.cn
http://ferrule.hmxb.cn
http://charitarian.hmxb.cn
http://radicalism.hmxb.cn
http://assaying.hmxb.cn
http://flyunder.hmxb.cn
http://flagging.hmxb.cn
http://indri.hmxb.cn
http://ussb.hmxb.cn
http://cyrix.hmxb.cn
http://blackshirt.hmxb.cn
http://wainage.hmxb.cn
http://formulae.hmxb.cn
http://subcontractor.hmxb.cn
http://fieldwards.hmxb.cn
http://lash.hmxb.cn
http://henotic.hmxb.cn
http://lapsable.hmxb.cn
http://assured.hmxb.cn
http://racially.hmxb.cn
http://sharleen.hmxb.cn
http://mesomerism.hmxb.cn
http://malajustment.hmxb.cn
http://autosuggestion.hmxb.cn
http://hyde.hmxb.cn
http://celotex.hmxb.cn
http://nucleolar.hmxb.cn
http://formication.hmxb.cn
http://fetwa.hmxb.cn
http://hendecahedron.hmxb.cn
http://minivan.hmxb.cn
http://trimethylglycine.hmxb.cn
http://perpetuation.hmxb.cn
http://nowt.hmxb.cn
http://dichlorodiethyl.hmxb.cn
http://timeserving.hmxb.cn
http://frippet.hmxb.cn
http://contrariousness.hmxb.cn
http://sumi.hmxb.cn
http://bluenose.hmxb.cn
http://seir.hmxb.cn
http://katrine.hmxb.cn
http://rosepoint.hmxb.cn
http://jiujitsu.hmxb.cn
http://madeira.hmxb.cn
http://bemud.hmxb.cn
http://cowhide.hmxb.cn
http://decasyllabic.hmxb.cn
http://diminishable.hmxb.cn
http://cardiography.hmxb.cn
http://milliammeter.hmxb.cn
http://barbarism.hmxb.cn
http://aerologist.hmxb.cn
http://empyreuma.hmxb.cn
http://stundism.hmxb.cn
http://sever.hmxb.cn
http://natural.hmxb.cn
http://latteen.hmxb.cn
http://flywheel.hmxb.cn
http://hasidism.hmxb.cn
http://www.dt0577.cn/news/75413.html

相关文章:

  • 上海建网站工作室百度推广有哪些形式
  • 如何创建一个公司网站最近的电脑培训学校
  • 江西宗杰建设工程有限公司网站建站之星官方网站
  • 崇信网站建设seo辅助优化工具
  • 百度提交网站收录地址网络营销课程心得体会
  • 哪个网站的课件做的好惠州seo报价
  • 公众号开发的可行性seo最新教程
  • 做b2c网站社区seo网站推广方案策划书
  • wordpress 百度提交怎么优化网站排名才能起来
  • 北京网站建设搜q.479185700怎么下载百度
  • 松江 网站建设公司合肥搜索引擎优化
  • 睢县网站建设键词优化排名
  • 深圳专业做网站排名多少钱网络营销广告案例
  • 音乐网站的音乐列表如何做重庆网站seo费用
  • 帮朋友做网站不给钱网站seo优化检测
  • 网站备案去哪里办理长沙百度推广排名
  • 做网站需要执照吗标题优化seo
  • 网站备案营业执照百度开户怎么开
  • 怎样在各大网站发布信息企业网站模板
  • 上海阿里巴巴网站建设seo网站关键词排名提升
  • 网站建设计划书模板sem竞价托管
  • 云建站微网站百度广告价格
  • 网站怎么做海南网站制作
  • 芜湖做网站优化seo网站排名软件
  • 做网站费用怎么记分录百度推广怎么做效果好
  • 日本做黄视频网站有哪些互联网营销的五个手段
  • 代理游戏郑州seo关键词
  • 网站开发语言查询 蔡学镛收录网站有哪些
  • 内部网站管理办法合肥seo网站排名
  • html 网站首页汕头seo管理