• 首页 首页 icon
  • 工具库 工具库 icon
    • IP查询 IP查询 icon
  • 内容库 内容库 icon
    • 快讯库 快讯库 icon
    • 精品库 精品库 icon
    • 问答库 问答库 icon
  • 更多 更多 icon
    • 服务条款 服务条款 icon

答题积分小程序云开发-界面交互篇个人心页布局样式和逻辑交互开发

武飞扬头像
Monstar_0°-蒙
帮助1

微信小程序云开发实战系列-答题积分赛小程序

界面交互篇:个人中心页布局样式与逻辑交互开发

个人中心页效果图

学新通

个人中心布局与样式实现

页头布局

在my.wxml中,编写布局代码:

<view class='UCenter-bg'>
    <view class="margin-bottom">
      <view class="cu-avatar xl round">
        <image class="avatar" src="https://blog.51cto.com/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>

用户反馈

在小程序客户端,点击【问题反馈】按钮,选择反馈类型、反馈内容,然后填写详细描述,提交即可。

学新通

管理员查看反馈

管理员在后台【用户反馈】-【功能异常】或者【产品建议】即可查看具体反馈内容,然后做出相应的处理或者优化。

学新通

这篇好文章是转载于:学新通技术网

  • 版权申明: 本站部分内容来自互联网,仅供学习及演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,请提供相关证据及您的身份证明,我们将在收到邮件后48小时内删除。
  • 本站站名: 学新通技术网
  • 本文地址: /boutique/detail/tanhibeefc
系列文章
更多 icon
同类精品
更多 icon
继续加载