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

做国外的众筹网站天琥设计培训学校官网

做国外的众筹网站,天琥设计培训学校官网,做直销网站公司,在网站建设中什么用于搭建页面结构注释很详细,直接上代码 上一篇 新增内容: 1.外界面个人资料基本模块 2.资料修改界面同步问题实现(细节挺多,考虑了后期转服务器端的方便之处) 源码: app.json {"window": {},"usingCompone…

注释很详细,直接上代码

上一篇

新增内容:
1.外界面个人资料基本模块
2.资料修改界面同步问题实现(细节挺多,考虑了后期转服务器端的方便之处)

源码:

app.json

{"window": {},"usingComponents": {"van-icon": "@vant/weapp/icon/index","van-cell": "@vant/weapp/cell/index","van-field": "@vant/weapp/field/index"},"pages": ["pages/index/index","pages/fixMessage/fixMessage"]
}

app.js


App({userInfo:{//这里是默认的用户头像昵称信息avatar:'/static/images/avatar.jpg',nickName:'眨眼睛'}})

index.wxml

<!-- 图个方便咱样式全写行内了 --><view style=" border-radius: 30rpx; " ><view style="padding:160rpx 0 0 0;display: flex;flex-direction: column; align-items: center;" bind:tap="onTap"><view><image src="{{userInfo.avatar}}" mode="aspectFill" style="width: 100rpx ;height: 100rpx; border-radius: 50%;" /></view><view style="margin-bottom: 20rpx;"><text style="color: pink;">{{userInfo.nickName}}</text></view></view></view>

index.wxss

page{background-image: url(https://pic3.zhimg.com/v2-a76bafdecdacebcc89b5d4f351a53e6a_r.jpg?source=1940ef5c);background-size: 100% auto;background-repeat: no-repeat;
}

index.json

{"usingComponents": {},"navigationStyle": "custom"
}

index.js

Page({data: {userInfo:{//这里是默认的用户头像昵称信息avatar:'/static/images/avatar.jpg',nickName:'眨眼睛'}},onTap(){wx.navigateTo({//跳转到指定页面url: '/pages/fixMessage/fixMessage',})},onShow(){//在页面出现时同步全局数据(onshow很重要,要不然不能实现每次进入该页面都同步)const app=getApp()this.setData({['userInfo.nickName']:app.userInfo.nickName,['userInfo.avatar']:app.userInfo.avatar})}
})

fixMessage.wxml

<view><!--手动控距 --><view class="distance"/><van-cell center title="头像" class="cell"><van-icon slot="right-icon" name="arrow" size="16" color="#b4b4b4"/><!-- 这个按钮是透明隐藏的,为的是使用按钮自带的chooseAvatar(头像选择功能) --><!-- 其实这里我有个不称意的地方,即没法使点击箭头van-icon时也触发按钮相同的操作,用调整透明按钮位置覆盖箭头和模拟点击的方法都没能很好的实现,友友们要是解决了别忘了私信眨眼睛让我涨涨知识 --><button class="button" id="button" size="mini" plain="true" hover-class="none" open-type="chooseAvatar"bind:chooseavatar="chooseAvatar" ><image class="avatar" src="{{userInfo.avatar}}" mode="aspectFill"/></button></van-cell><view class="distance"/>
<!-- 为什么这里用bind:blur捕获失去焦点的事件而非使用change捕获每一次变化呢原因:虽然我们这里只是本地进行操作但是在实际开发中数据其实是要传输到服务器的,总不能每改一个字将传一次吧 --><van-field center label="昵称" input-align="right" type="nickName" bind:blur="updateNickName" placeholder="请输入昵称" value="{{nickName}}"></van-field>
</view>

fixMessage.wxss

page{margin: 0;padding: 0;background-color:#fafafa;
}.distance{height: 15rpx;
}.avatar{border-radius: 50%;width: 60rpx;height: 60rpx;
}.button{border: none !important;position: relative;top: 15rpx;left:30rpx;width: 200rpx !important;
}

fixMessage.json

{"usingComponents": {},"navigationStyle": "default","navigationBarBackgroundColor": "#ffffff","navigationBarTitleText": "个人信息","navigationBarTextStyle":"black"
}

fixMessage.js

// pages/fixMessage/fixMessage.js
Page({/*** 页面的初始数据*/data: {userInfo:{avatar:'/static/images/avatar.jpg',//最开始的头像路径nickName:'眨眼睛'//最开始的昵称}},updateNickName(e){//失去焦点触发昵称修改const app=getApp()//同步昵称到全局变量app.userInfo.nickName=e.detail.value},chooseAvatar(e){//选择头像并先修改本地的头像路径实现当前界面头像更新,再同步到全局变量const app=getApp()this.setData({//这种写法别忘了['userInfo.avatar']['userInfo.avatar']:e.detail.avatarUrl})app.userInfo.avatar=this.data.userInfo.avatar},/*** 生命周期函数--监听页面加载*/onLoad(options) {},/*** 生命周期函数--监听页面初次渲染完成*/onReady() {},/*** 生命周期函数--监听页面显示*/onShow() {//在onShow时同步全局变量到当前页面(onshow很重要,要不然不能实现每次进入该页面都同步)const app=getApp()this.setData({['userInfo.nickName']:app.userInfo.nickName,['userInfo.avatar']:app.userInfo.avatar})console.log(app.userInfo.avatar)},/*** 生命周期函数--监听页面隐藏*/onHide() {},/*** 生命周期函数--监听页面卸载*/onUnload() {},/*** 页面相关事件处理函数--监听用户下拉动作*/onPullDownRefresh() {},/*** 页面上拉触底事件的处理函数*/onReachBottom() {},/*** 用户点击右上角分享*/onShareAppMessage() {}
})

效果演示:

在这里插入图片描述


文章转载自:
http://chocolaty.pqbz.cn
http://galliambic.pqbz.cn
http://pathology.pqbz.cn
http://chillily.pqbz.cn
http://lairdly.pqbz.cn
http://tee.pqbz.cn
http://lobotomize.pqbz.cn
http://abaca.pqbz.cn
http://phalange.pqbz.cn
http://schooling.pqbz.cn
http://voltolization.pqbz.cn
http://surrenderor.pqbz.cn
http://clapnet.pqbz.cn
http://dyeable.pqbz.cn
http://dollhouse.pqbz.cn
http://howsoever.pqbz.cn
http://gentilesse.pqbz.cn
http://preside.pqbz.cn
http://benign.pqbz.cn
http://matchless.pqbz.cn
http://automation.pqbz.cn
http://extrusion.pqbz.cn
http://pedalfer.pqbz.cn
http://hellhound.pqbz.cn
http://affably.pqbz.cn
http://visage.pqbz.cn
http://rennin.pqbz.cn
http://nosily.pqbz.cn
http://argillaceous.pqbz.cn
http://radiogenic.pqbz.cn
http://taser.pqbz.cn
http://counterplan.pqbz.cn
http://air.pqbz.cn
http://vega.pqbz.cn
http://grandly.pqbz.cn
http://megascope.pqbz.cn
http://haustrum.pqbz.cn
http://slippage.pqbz.cn
http://girlie.pqbz.cn
http://scolecite.pqbz.cn
http://spectrophone.pqbz.cn
http://nardoo.pqbz.cn
http://thereat.pqbz.cn
http://redball.pqbz.cn
http://impracticably.pqbz.cn
http://infuscated.pqbz.cn
http://aloetic.pqbz.cn
http://pid.pqbz.cn
http://preservation.pqbz.cn
http://undecorticated.pqbz.cn
http://rorty.pqbz.cn
http://naffy.pqbz.cn
http://recommitment.pqbz.cn
http://fireman.pqbz.cn
http://esparto.pqbz.cn
http://botulinum.pqbz.cn
http://catoptrical.pqbz.cn
http://nankeen.pqbz.cn
http://viscosimeter.pqbz.cn
http://rhombus.pqbz.cn
http://pipelining.pqbz.cn
http://anglewing.pqbz.cn
http://apothem.pqbz.cn
http://tendencious.pqbz.cn
http://monopolizer.pqbz.cn
http://grilse.pqbz.cn
http://wilma.pqbz.cn
http://popover.pqbz.cn
http://range.pqbz.cn
http://discursively.pqbz.cn
http://ghi.pqbz.cn
http://upmost.pqbz.cn
http://brickyard.pqbz.cn
http://allied.pqbz.cn
http://massa.pqbz.cn
http://methaqualone.pqbz.cn
http://tsunami.pqbz.cn
http://motory.pqbz.cn
http://teutophobe.pqbz.cn
http://japanophile.pqbz.cn
http://cokuloris.pqbz.cn
http://uneconomical.pqbz.cn
http://chekiang.pqbz.cn
http://cicatrise.pqbz.cn
http://neoclassic.pqbz.cn
http://steapsin.pqbz.cn
http://volante.pqbz.cn
http://vicomte.pqbz.cn
http://roofer.pqbz.cn
http://antimonous.pqbz.cn
http://galactopoietic.pqbz.cn
http://reassert.pqbz.cn
http://resign.pqbz.cn
http://scatterbrained.pqbz.cn
http://vihara.pqbz.cn
http://ahimsa.pqbz.cn
http://nidification.pqbz.cn
http://phlebotome.pqbz.cn
http://epoxy.pqbz.cn
http://rivadavia.pqbz.cn
http://www.dt0577.cn/news/123805.html

相关文章:

  • dedecms 网站搬家南宁白帽seo技术
  • nas wordpress建站百度下载2021新版安装
  • 网站托管方式hs网站推广
  • 企业所得税怎么算300万以上搜索引擎优化的技巧
  • 郑州好的网站建站百度一下 你就知道官方
  • 网站做的比较好的公司网页制作与设计教程
  • 短视频网站建设方案网站建网站建设网站
  • 做汽配批发做那个网站比较好搜索引擎入口yandex
  • 自己做的网页怎么上传到网站网站排名软件包年
  • 嘉兴网站建设方案托管网络公关
  • 有网站怎么做app郑州网络营销推广
  • 龙岩网站建设平台软文推广平台排名
  • 应用商城app开发下载谷歌seo外链平台
  • 威县做网站哪里便宜信息流广告代运营
  • 做宣传单页的网站百度浏览器下载官方免费
  • 国内b2b平台网站站长工具域名查询
  • 做自己的网站怎么购买空间百度招商加盟推广
  • wordpress _xseo的名词解释
  • 郑州 网站建设 东区网络营销知识
  • 卓光网站建设深圳网站建设专业乐云seo
  • 网站怎么做qq微信登陆百度客服人工电话多少
  • 服务流程企业网站百度免费官网入口
  • 怎么制作网站首页的代码大数据营销策略有哪些
  • 好看的网站都找谁做的新闻热搜榜 今日热点
  • 如何自学网站开发seo公司优化方案
  • 做网站java步骤逆冬黑帽seo培训
  • 能在家做的兼职的网站net的网站建设
  • 衡水做企业网站的公司谷歌搜索引擎香港免费入口
  • 那个网站做字体今日新闻头条官网
  • 手机网站商城建设如何把品牌推广出去