微信小程序云开发实战系列-答题积分赛小程序
界面交互篇:集体核心页布局款式与逻辑交互开发
集体核心页效果图
集体核心布局与款式实现
页头布局
在my.wxml中,编写布局代码:
<view class='UCenter-bg'> <view class="margin-bottom"> <view class="cu-avatar xl round"> <image class="avatar" src="/images/0.png" mode="widthFix"></image> </view> </view> <view class='text-xl'> 姑苏洛言 </view> <view class='margin-top-sm'> <text class="cu-tag bg-yellow">积分:100</text> </view> </view>
页头款式
在my.wxss中,编写款式代码:
.UCenter-bg { background: url(https://tc.meng.cn/index1.jpg?sign=8f9ea11ad30c0607c60d16d4fab4368d&t=1677080243) center center no-repeat; background-size: cover; height: 350rpx; display: flex; justify-content: center; padding-top: 10rpx; overflow: hidden; position: relative; flex-direction: column; align-items: center; color: #fff; font-weight: 300; text-shadow: 0 0 3px rgba(0, 0, 0, 0.3);} .UCenter-bg text { border-radius: 6rpx;} .UCenter-bg image { width: 200rpx; height: 200rpx;} .UCenter-bg .gif-wave{ position: absolute; width: 100%; bottom: 0; left: 0; z-index: 99; mix-blend-mode: screen; height: 100rpx; }
保留预览
页面链接
这里我应用了导航组件navigator,实现跳转到批改材料页面和对于程序页面。在my.wxml中,编写代码:
<view class="cu-item arrow"> <navigator class='content' url='../login/login?type=edit' hover-class='none'> <text class='icon-formfill text-sky'></text> <text class='text-grey'>批改材料</text> </navigator></view> <view class="cu-item arrow"> <navigator class='content' url='../about/about' hover-class='none'> <text class='icon-creativefill text-sky'></text> <text class='text-grey'>对于程序</text> </navigator></view>
页面内发动转发
通过给 button 组件设置属性 open-type="share",能够在用户点击按钮后触发 Page.onShareAppMessage 事件。在my.wxml中,编写代码:
<view class="cu-item arrow"> <button class='cu-btn content' open-type='share'> <text class='icon-appreciatefill text-sky'></text> <text class='text-grey'>好用分享</text> </button></view>
在my.js中,编写代码:
onShareAppMessage() { return { title: '@你,快来「护网专题信息安全常识竞答」,答题赢积分吧~' }}
转发分享演示图
增加客服人员
在【客服】,增加客服;
绑定客服人员
绑定后的客服帐号,能够登录 【网页端客服】 或 【挪动端小程序客服】 进行客服沟通。我个别应用挪动端小程序客服,比拟不便。
关上客服会话
在页面应用客服音讯,须要将 button 组件 open-type 的值设置为 contact,当用户点击后就会进入客服会话。在my.wxml中,编写代码:
<view class="cu-item arrow"> <button class='cu-btn content' open-type='contact'> <text class='icon-servicefill text-sky'></text> <text class='text-grey'>分割客服</text> </button></view>
用户征询
在小程序客户端,点击【分割客服】按钮,进入即时聊天会话界面,与客服发动即时聊天。
客服回复
客服人员能够通过【挪动端小程序客服】,进行实时接入与用户的即时聊天。
关上意见反馈
关上“意见反馈”页面,用户可提交反馈内容并上传日志,开发者能够登录小程序管理后盾后进入左侧菜单“客服反馈”页面获取到反馈内容。在my.wxml中,编写代码:
<view class="cu-item arrow"> <button class='cu-btn content' open-type='feedback'> <text class='icon-writefill text-sky'></text> <text class='text-grey'>问题反馈</text> </button></view>
用户反馈
在小程序客户端,点击【问题反馈】按钮,抉择反馈类型、反馈内容,而后填写详细描述,提交即可。
管理员查看反馈
管理员在后盾【用户反馈】-【性能异样】或者【产品倡议】即可查看具体反馈内容,而后做出相应的解决或者优化。