答题积分小程序云开发实战-界面交互篇:个人中心页布局样式与逻辑交互开发
发布于 1 年前 作者 leiwang 4587 次浏览 来自 分享

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

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

个人中心页效果图

个人中心布局与样式实现

页头布局

在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>

用户反馈

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


管理员查看反馈

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

回到顶部