Commit 27496ca4 by 胡悦

添加骨架屏

1 parent f752a9df
...@@ -66,7 +66,7 @@ App({ ...@@ -66,7 +66,7 @@ App({
console.log('scene', wx.$trackData.scene) console.log('scene', wx.$trackData.scene)
wx.$trackData.merchant = res.merchantId wx.$trackData.merchant = res.merchantId
wx.$trackData.cardId = res.cardId wx.$trackData.cardId = res.cardId
const systemInfo = wx.getStorageSync('srcm_shopmall_system_info') const systemInfo = JSON.parse(wx.getStorageSync('srcm_shopmall_system_info'))
wx.$trackData.type = systemInfo.environment ? 2 : 1 wx.$trackData.type = systemInfo.environment ? 2 : 1
wx.$Track.sendTrack(trackData.COMPANY) wx.$Track.sendTrack(trackData.COMPANY)
}) })
......
...@@ -49,7 +49,14 @@ Page({ ...@@ -49,7 +49,14 @@ Page({
hasPhoneNumber: false, hasPhoneNumber: false,
curTab: [trackData.COMPANY, trackData.CUBE], curTab: [trackData.COMPANY, trackData.CUBE],
// 员工名片信息 // 员工名片信息
cardInfo: {}, cardInfo: null,
defaultInfo: {
staffName: '虚拟员工',
operation: '虚拟职位',
staffPhone: 'xxxxxxxx',
image: 'https://img.zcool.cn/community/01e47e60ab5b4011013eaf70962e3f.jpg@520w_390h_1c_1e_2o_100sh.jpg',
qrCode: 'https://img.zcool.cn/community/01e47e60ab5b4011013eaf70962e3f.jpg@520w_390h_1c_1e_2o_100sh.jpg'
}
}, },
introduce(e) { introduce(e) {
const curTabIndex = e.currentTarget.dataset.index; const curTabIndex = e.currentTarget.dataset.index;
...@@ -306,11 +313,18 @@ Page({ ...@@ -306,11 +313,18 @@ Page({
const sessionId = util.getSessionId(); const sessionId = util.getSessionId();
let params = {}; let params = {};
params.cardId = wx.$trackData.cardId params.cardId = wx.$trackData.cardId
entmicroApi.getCardDetail(params).then(({data}) => { entmicroApi.getCardDetail(params).then(({data, code, message}) => {
if (code == -1) {
wx.showToast({
title: message,
icon: 'none',
duration: 2000
})
}
this.setData({ this.setData({
cardInfo: data cardInfo: data || this.data.defaultInfo
}) })
this.setShareInfo(data); this.setShareInfo(this.data.cardInfo);
}); });
}, },
}); });
<!--
此文件为开发者工具生成,生成时间: 2022/9/9下午3:55:54
使用方法:
在 D:\workCode\2022-09\ai-card\pages\tab\index\index.wxml 引入模板
```
<import src="index.skeleton.wxml"/>
<template is="skeleton" wx:if="{{loading}}" />
```
在 D:\workCode\2022-09\ai-card\pages\tab\index\index.wxss 中引入样式
```
@import "./index.skeleton.wxss";
```
更多详细信息可以参考文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/skeleton.html
-->
<template name="skeleton">
<view class="sk-container">
<view class="main-box">
<view is="components/UserInfo/UserInfo">
<view class="UserInfo--user-wrapper">
<view class="UserInfo--user-box">
<view class="UserInfo--user-info" data-item="[object Object]">
<view class="UserInfo--user-company">
<image class="UserInfo--company-logo sk-image"></image>
</view>
<view class="UserInfo--user-name">
<view class="UserInfo--name sk-transparent sk-text-16-6667-707 sk-text">李崇源</view>
<view class="UserInfo--position sk-transparent sk-text-14-2857-250 sk-text">啦啦啦</view>
</view>
<view class="UserInfo--user-phone">
<image webp="true" class="UserInfo--user-icon sk-image"></image>
<view class="sk-transparent sk-text-12-5000-755 sk-text">15778727124</view>
</view>
<view class="UserInfo--user-address">
<image webp="true" class="UserInfo--user-icon sk-image"></image>
<view class="UserInfo--address sk-transparent sk-text-12-5000-970 sk-text">深圳市南山区留仙大道3370号南山智园崇文园区1号楼14层</view>
</view>
<image lazy-load="true" class="UserInfo--user-avatar sk-image"></image>
<image webp="true" class="UserInfo--add-wechat sk-image"></image>
</view>
<image webp="true" class="UserInfo--user-bg sk-image"></image>
</view>
<view class="UserInfo--btn-group">
<view class="UserInfo--phone-btn">
<image webp="true" class="UserInfo--icon-dial sk-image"></image>
<view class="UserInfo--phone-text sk-transparent sk-text-14-2857-35 sk-text" style="background-position-x: 50%;">拨打电话</view>
</view>
<button class="UserInfo--btn-plain UserInfo--btn sk-transparent sk-button sk-pseudo sk-pseudo-circle">保存名片</button>
<button class="UserInfo--btn-primary UserInfo--btn sk-transparent sk-button sk-pseudo sk-pseudo-circle" open-type="share">分享名片</button>
</view>
</view>
<view is="components/Authorize/Authorize"></view>
</view>
<view class="main-bottom">
<view class="channel-bg">
<image webp="true" class="channel-img sk-image" data-name="logo" mode="widthFix" style="height: 71.7949px;"></image>
<view class="channel-word">
<view class="channel-title sk-transparent sk-text-17-8571-311 sk-text">面向渠道</view>
<view class="channel-text sk-transparent sk-text-16-6667-334 sk-text">助力数字化转型,实现获客增值</view>
</view>
</view>
<view class="tab-list">
<view class="tab-item tab-item-active sk-image" data-index="0" data-name="[object Object]">
<image webp="true" class="tab-img sk-image" mode="widthFix" style="height: 36px;"></image>
<view class="tab-text sk-transparent sk-text-14-2857-558 sk-text" style="background-position-x: 50%;">公司介绍</view>
</view>
<view class="tab-item" data-index="1" data-name="[object Object]">
<image webp="true" class="tab-img sk-image" mode="widthFix" style="height: 36px;"></image>
<view class="tab-text sk-transparent sk-text-14-2857-567 sk-text" style="background-position-x: 50%;">方案介绍</view>
</view>
<view class="tab-item" data-index="2" data-name="[object Object]">
<image webp="true" class="tab-img sk-image" mode="widthFix" style="height: 36px;"></image>
<view class="tab-text sk-transparent sk-text-14-2857-682 sk-text" style="background-position-x: 50%;">视频直播</view>
</view>
</view>
<view class="box-wrapper">
<view class="sk-transparent sk-text-14-2857-396 sk-text" style="background-position-x: 50%;">广联数科</view>
<image class="m-t-md sk-image"></image>
</view>
</view>
</view>
</view>
</template>
\ No newline at end of file \ No newline at end of file
/*
此文件为开发者工具生成,生成时间: 2022/9/9下午3:55:54
在 D:\workCode\2022-09\ai-card\pages\tab\index\index.wxss 中引入样式
```
@import "./index.skeleton.wxss";
```
更多详细信息可以参考文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/skeleton.html
*/
.sk-transparent {
color: transparent !important;
}
.sk-text-16-6667-707 {
background-image: linear-gradient(transparent 16.6667%, #EEEEEE 0%, #EEEEEE 83.3333%, transparent 0%) !important;
background-size: 100% 72.0000rpx;
position: relative !important;
}
.sk-text {
background-origin: content-box !important;
background-clip: content-box !important;
background-color: transparent !important;
color: transparent !important;
background-repeat: repeat-y !important;
}
.sk-text-14-2857-250 {
background-image: linear-gradient(transparent 14.2857%, #EEEEEE 0%, #EEEEEE 85.7143%, transparent 0%) !important;
background-size: 100% 39.2000rpx;
position: relative !important;
}
.sk-text-12-5000-755 {
background-image: linear-gradient(transparent 12.5000%, #EEEEEE 0%, #EEEEEE 87.5000%, transparent 0%) !important;
background-size: 100% 32.0000rpx;
position: relative !important;
}
.sk-text-12-5000-970 {
background-image: linear-gradient(transparent 12.5000%, #EEEEEE 0%, #EEEEEE 87.5000%, transparent 0%) !important;
background-size: 100% 32.0000rpx;
position: relative !important;
}
.sk-text-14-2857-35 {
background-image: linear-gradient(transparent 14.2857%, #EEEEEE 0%, #EEEEEE 85.7143%, transparent 0%) !important;
background-size: 100% 28.0000rpx;
position: relative !important;
}
.sk-text-17-8571-311 {
background-image: linear-gradient(transparent 17.8571%, #EEEEEE 0%, #EEEEEE 82.1429%, transparent 0%) !important;
background-size: 100% 56.0000rpx;
position: relative !important;
}
.sk-text-16-6667-334 {
background-image: linear-gradient(transparent 16.6667%, #EEEEEE 0%, #EEEEEE 83.3333%, transparent 0%) !important;
background-size: 100% 36.0000rpx;
position: relative !important;
}
.sk-text-14-2857-558 {
background-image: linear-gradient(transparent 14.2857%, #EEEEEE 0%, #EEEEEE 85.7143%, transparent 0%) !important;
background-size: 100% 33.6000rpx;
position: absolute !important;
}
.sk-text-14-2857-567 {
background-image: linear-gradient(transparent 14.2857%, #EEEEEE 0%, #EEEEEE 85.7143%, transparent 0%) !important;
background-size: 100% 33.6000rpx;
position: absolute !important;
}
.sk-text-14-2857-682 {
background-image: linear-gradient(transparent 14.2857%, #EEEEEE 0%, #EEEEEE 85.7143%, transparent 0%) !important;
background-size: 100% 33.6000rpx;
position: absolute !important;
}
.sk-text-14-2857-396 {
background-image: linear-gradient(transparent 14.2857%, #EEEEEE 0%, #EEEEEE 85.7143%, transparent 0%) !important;
background-size: 100% 44.8000rpx;
position: relative !important;
}
.sk-button {
color: #EFEFEF !important;
background: #EFEFEF !important;
border: none !important;
box-shadow: none !important;
}
.sk-image {
background: #EFEFEF !important;
}
.sk-pseudo::before, .sk-pseudo::after {
background: #EFEFEF !important;
background-image: none !important;
color: transparent !important;
border-color: transparent !important;
}
.sk-pseudo-rect::before, .sk-pseudo-rect::after {
border-radius: 0 !important;
}
.sk-pseudo-circle::before, .sk-pseudo-circle::after {
border-radius: 50% !important;
}
.sk-container {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
overflow: hidden;
background-color: transparent;
}
...@@ -2,11 +2,10 @@ ...@@ -2,11 +2,10 @@
<import src="../../template/channel/channel.wxml" /> <import src="../../template/channel/channel.wxml" />
<import src="../../template/company/company.wxml" /> <import src="../../template/company/company.wxml" />
<import src="../../template/menu/menu.wxml" /> <import src="../../template/menu/menu.wxml" />
<!-- <import src="../../template/cube/cube" /> <import src="index.skeleton.wxml"/>
<import src="../../template/equity/equity" /> <template is="skeleton" wx:if="{{!cardInfo}}" />
<import src="../../template/clue/clue" /> --> <view class="main-box" wx:if="{{cardInfo}}" >
<view class="main-box"> <user-info data-skeleton-hide="cardInfo" cardInfo="{{cardInfo}}"></user-info>
<user-info cardInfo="{{cardInfo}}"></user-info>
<view class="main-bottom"> <view class="main-bottom">
<!-- 面向渠道 --> <!-- 面向渠道 -->
<template is="channel"></template> <template is="channel"></template>
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
@import '../../template/cube/cube.wxss'; @import '../../template/cube/cube.wxss';
@import '../../template/equity/equity.wxss'; @import '../../template/equity/equity.wxss';
@import '../../template/clue/clue.wxss'; @import '../../template/clue/clue.wxss';
@import "./index.skeleton.wxss";
page { page {
background-color: #F5F5F7; background-color: #F5F5F7;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!