版本一

This commit is contained in:
高健 2021-07-20 15:45:29 +08:00
parent c7f4773ea9
commit 22ffde63ee
30 changed files with 1946 additions and 368 deletions

View File

@ -13,7 +13,10 @@
"pages/sharePage/sharePage",
"pages/mine/otherCard/othercarddetail",
"pages/moments/list/momentsshowlist",
"pages/moments/momentsdetail/momentsdetail"
"pages/moments/momentsdetail/momentsdetail",
"pages/moments/showlist/showlist",
"pages/mine/setting/columnsetting",
"pages/serve/index/index"
],
"window": {
"backgroundTextStyle": "dark",
@ -26,12 +29,16 @@
"color": "#8F8F8F",
"selectedColor": "#1296db",
"borderStyle": "black",
"list": [
{
"list": [{
"text": "首页",
"pagePath": "pages/index/index",
"iconPath": "images/ic_card_normal.png",
"selectedIconPath": "images/ic_card_sel.png"
}, {
"text": "服务",
"pagePath": "pages/serve/index/index",
"iconPath": "images/ic_serve_normal.png",
"selectedIconPath": "images/ic_serve_sel.png"
},
{
"text": "我的",
@ -56,7 +63,10 @@
"van-submit-bar": "/vant/dist/submit-bar/index",
"van-stepper": "/vant/dist/stepper/index",
"van-image": "/vant/dist/image/index",
"van-loading": "/vant/dist/loading/index"
"van-loading": "/vant/dist/loading/index",
"van-switch": "/vant/dist/switch/index",
"van-tab": "/vant/dist/tab/index",
"van-tabs": "/vant/dist/tabs/index"
},
"plugins": {
"chooseLocation": {

BIN
images/ic_serve_normal.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

BIN
images/ic_serve_sel.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

BIN
images/ic_setting.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

View File

@ -28,7 +28,8 @@ Page({
shareRecordId: '',
isShowBarCode: false,
browUserList: [],
shareImgUrl: ''
shareImgUrl: '',
tempUserId: ''
},
onLoad(options) {
var self = this
@ -101,6 +102,7 @@ Page({
cId: datas[_self.data.curIndex].configColumnId,
type: datas[_self.data.curIndex].configColumnType,
name: datas[_self.data.curIndex].configColumnName,
mode: datas[_self.data.curIndex].configTableMode,
list: res.data.slice(0, datas[_self.data.curIndex].configColumnRowCount)
}
_self.data.dataList.push(tempItem)
@ -216,6 +218,17 @@ Page({
dataList: _self.data.dataList
})
},
//显示更多栏目数据
showMore(e) {
var item = e.currentTarget.dataset.item
if (item.mode == '2') {
var userid = e.currentTarget.dataset.userid
var idx = e.currentTarget.dataset.idx
wx.navigateTo({
url: '../moments/showlist/showlist?id=' + item.cId + '&userId=' + userid + '&index=' + idx,
})
}
},
onPullDownRefresh() {
this.setData({
dataList: [],
@ -487,6 +500,9 @@ Page({
if (res.data) {
self.toSaveLocalImg(res.data.cardTemplateUseDispatchPhoto)
self.getBrowCardUserList(res.data.cardTemplateUseId)
self.setData({
tempUserId: res.data.creator
})
self.getMainColumn(res.data.creator)
}
}).catch(res => {
@ -714,7 +730,6 @@ Page({
* 用户点击右上角分享
*/
onShareAppMessage: function (res) {
console.log(res)
var self = this
wx.showShareMenu({
withShareTicket: true,
@ -729,7 +744,7 @@ Page({
var param = '/pages/sharePage/sharePage?cardTemplateDispatchId=' + postId;
return {
title: '名片分享名片分享名片分享名片分享名片分享名片分享名片分享名片分享名片分享名片分享名片分享名片分享名片分享',
title: '名片分享',
path: param,
imageUrl: self.data.shareImgUrl
}
@ -750,13 +765,13 @@ Page({
//显示详情
showDetail(e) {
var type = e.currentTarget.dataset.ctype //需要跳详情
// if (type.indexOf('dda5007c-5fb7-48f2-8537-3cb8ea298242') != -1) {
if (type.indexOf('dda5007c-5fb7-48f2-8537-3cb8ea298242') != -1) {
//需要跳详情
var cId = e.currentTarget.dataset.cid
var uId = e.currentTarget.dataset.id
wx.navigateTo({
url: '../moments/momentsdetail/momentsdetail?uId=' + uId + '&cId=' + cId,
})
// }
}
}
})

View File

@ -9,7 +9,7 @@
<view class="card"
style="padding-bottom:{{(cardInfo.cardTemplateUseHeight / cardInfo.cardTemplateUseWidth) *100 +'%'}};">
<!-- 背景图 -->
<image src="{{cardUrl}}{{cardInfo.cardTemplateUseBackgroundImage}}" alt="" class="card-bgImg"
<image src="{{cardUrl}}{{cardInfo.cardTemplateUseBackgroundImage}}" alt="" class="card-bgImg" mode="widthFix"
wx:if="{{cardInfo.cardTemplateUseBackgroundImage}}"></image>
<!-- 文字 -->
<view class="area-box" wx:for="{{areaList}}" wx:key="index"
@ -18,8 +18,8 @@
<!-- 图片 -->
<view wx:for="{{areaList}}" data-cur="{{index}}" wx:key="index"
style="position:absolute;top: {{(item.templateAreaTop / cardInfo.cardTemplateUseHeight) * 100 + '%'}};left:{{(item.templateAreaLeft / cardInfo.cardTemplateUseWidth) * 100 + '%'}};color:{{item.templateAreaFontColor}};width:{{(item.templateAreaWidth / cardInfo.cardTemplateUseWidth) * 100 + '%'}};height:{{(item.templateAreaHeight / cardInfo.cardTemplateUseHeight) * 100 + '%'}}"
wx:if="{{item.templateAreaType != '1'}}">
<image src="{{cardUrl}}{{item.templateAreaFile}}" style="width: 100%;height:100%">
wx:if="{{item.templateAreaServerLink != '1'}}">
<image src="{{cardUrl}}{{item.templateAreaFile}}" style="width: 100%;height:100%" mode="widthFix">
</image>
</view>
</view>
@ -95,15 +95,16 @@
<view wx:for="{{dataList}}" wx:key="index">
<view class="flex flex-direction margin-sm">
<!-- 栏目 -->
<view class="catelog-title margin-top-xs" data-item="{{item}}" bindtap="showMore">
<view class="catelog-title margin-top-xs" data-item="{{item}}" data-idx="{{index}}"
data-userid="{{tempUserId}}" bindtap="showMore">
<view class="action">
<view class="title intro-title">
<text class="cuIcon-vipcard"></text>
<text> {{item.name}}</text>
</view>
</view>
<view class="action">
更多
<view class="action text-blue" wx:if="{{item.mode=='2'}}">
更多 >
</view>
</view>
<view class="column-content">
@ -118,7 +119,9 @@
<view class="cu-form-group">
<view id="content" class="padding-left-xs padding-right-xs margin-left-xs margin-right-xs"
style="line-height:40rpx;">
{{child.value}}
<text class="{{item.type=='dda5007c-5fb7-48f2-8537-3cb8ea298242' ? 'cuIcon-title' : ''}}">
</text>
<text>{{child.value}}</text>
</view>
</view>
</view>
@ -265,9 +268,6 @@
</view>
</view>
</view>
<view wx:if="{{item.type=='dda5007c-5fb7-48f2-8537-3cb8ea298242'}}" bindtap="showDetail"
data-ctype="{{item.type}}" data-cid="{{item.cId}}" data-id="{{it.uid}}"
style="font-size:28rpx;text-align:right;margin-right:20rpx;color:#2b2b2b">详情 ></view>
</view>
</view>
</view>

View File

@ -24,6 +24,7 @@ page {
.area-box {
white-space: nowrap;
word-break: break-all;
z-index: 111;
}
.card-bgImg {

View File

@ -163,4 +163,10 @@ Page({
url: '../myCard/myCard',
})
},
//跳转设置页面
showSetting() {
wx.navigateTo({
url: '../../mine/setting/columnsetting'
})
}
})

View File

@ -9,6 +9,7 @@
<!-- <text class="des">{{nickName}}</text> -->
</view>
</view>
<image src="../../../images/ic_setting.png" class="icon" bindtap="showSetting"></image>
</view>
<view class="scroll-content">
@ -54,24 +55,3 @@
</view>
</view>
</view>
<!-- 固定我的名片菜单 -->
<!-- <view data-path="../myCard/myCard" data-type="1" bindtap="goMyCard" style="margin-top:20rpx;">
<view class="cu-list menu card-menu shadow-lg radius">
<view class="cu-item arrow">
<view class="cu-avatar radius lg" style="background-image:url(/images/ic_record_start.png);">
</view>
<view class="content padding-left-xs" style="width:80%;">
<view class="text-black">
<text class="text-cut">我的名片</text>
</view>
<view class="text-gray text-sm flex">
<text class="text-cut">管理自己的名片</text>
</view>
</view>
<view class="action">
</view>
</view>
</view>
</view> -->

View File

@ -60,6 +60,15 @@ page {
height: 400px;
}
.UCenter-bg .icon {
width: 48rpx;
height: 48rpx;
z-index: 10;
top: 200rpx;
position: absolute;
right: 48rpx;
}
.scroll-content {
width: 100%;
border-top-right-radius: 60rpx;

View File

@ -177,7 +177,7 @@ Page({
this.setData({
token: app.globalData.token
})
// this.getList()
this.getList()
},

View File

@ -8,6 +8,7 @@
</view>
<!-- 我的名片 -->
<view class="list" wx:if="{{tab == 0}}">
<view wx:if="{{cardList.length>0}}">
<view class="card" bindtap="goDetail" wx:for="{{cardList}}" wx:for-item="list" data-id="{{list.cardTemplateUseId}}"
wx:key="index" data-cur="{{index}}">
<view class="card-container"
@ -20,8 +21,14 @@
<view class="card-name">{{list.cardTemplateUseTitle}}</view>
</view>
</view>
<view wx:else style="margin-top:200rpx;width:100%;">
<van-empty description="暂无数据" image="/images/ic_empty_data.png" />
</view>
</view>
<!-- 他人名片 -->
<view class="list" wx:if="{{tab == 1}}">
<view wx:if="{{otherCardList.length>0}}">
<view class="card" bindtap="showCard" wx:for="{{otherCardList}}" wx:for-item="list"
data-id="{{list.cardTemplateUseDTO.cardTemplateUseId}}" wx:key="index" data-cur="{{index}}">
<view class="card-container"
@ -40,8 +47,14 @@
</view>
</view>
</view>
<view wx:else style="margin-top:200rpx;width:100%;">
<van-empty description="暂无数据" image="/images/ic_empty_data.png" />
</view>
</view>
<!-- 浏览历史 -->
<view class="list" wx:if="{{tab == 2}}">
<view wx:if="{{historyList.length>0}}">
<view class="card" bindtap="showCard" wx:for="{{historyList}}" wx:for-item="list"
data-id="{{list.cardTemplateUseDTO.cardTemplateUseId}}" wx:key="index" data-cur="{{index}}">
<view class="card-container"
@ -62,3 +75,7 @@
</view>
</view>
</view>
<view wx:else style="margin-top:200rpx;width:100%;">
<van-empty description="暂无数据" image="/images/ic_empty_data.png" />
</view>
</view>

View File

@ -1,6 +1,7 @@
page {
background: #f7f7f7;
}
.card {
width: 100%;
height: 0;
@ -10,6 +11,7 @@ page{
z-index: 100;
/* text-align: center; */
}
.card-bgImg {
position: absolute;
top: 0;
@ -17,42 +19,52 @@ page{
width: 100%;
height: 100%;
}
.area-box {
white-space: nowrap;
background: none !important;
z-index: 111;
}
.area-box image {
width: 100%;
height: 100%;
}
.card-info {
padding: 20rpx;
margin-bottom: 90rpx;
background: #fff;
}
.card-title {
font-size: 38rpx;
background: #f7f7f7;
line-height: 70rpx;
padding: 0 20rpx;
}
.row {
display: flex;
padding: 15rpx 0;
border-bottom: 1px solid #EEE;
/* margin-bottom: 15rpx; */
}
.item-title {
flex: 1;
font-size: 32rpx;
line-height: 50rpx;
color: #808080;
}
.item-input {
flex: 4;
box-sizing: border-box;
display: flex;
align-items: center;
}
.item-input input {
width: 100%;
text-align: right;
@ -60,14 +72,17 @@ page{
font-size: 32rpx;
color: #333;
}
.item-input image {
max-width: 70%;
max-height: 120rpx;
}
.item-code-input image {
max-width: 35%;
max-height: 160rpx;
}
.share {
padding: 20rpx 15rpx;
text-align: center;
@ -78,6 +93,7 @@ page{
background: #fff;
z-index: 1000;
}
.share .btn {
display: inline-block;
width: 32% !important;
@ -91,9 +107,11 @@ page{
text-align: center;
border-radius: 10rpx;
}
.share .btn:last-child {
margin-right: 0;
}
.hide-link {
position: fixed;
top: 0;
@ -104,6 +122,7 @@ page{
background: rgba(0, 0, 0, 0.6);
z-index: 1000;
}
.hide {
position: absolute;
top: 50%;
@ -114,6 +133,7 @@ page{
border-radius: 10rpx;
background: #fff;
}
.hide-btn {
display: flex;
width: 49%;
@ -125,18 +145,22 @@ page{
justify-content: center;
align-items: center;
}
.hide-text {
font-size: 30rpx;
color: #000;
margin-bottom: 20rpx;
}
.hide-btn-box {
display: flex;
justify-content: space-between;
}
.input-box {
width: 100%;
}
.cuIcon-cameraadd {
font-size: 60rpx;
}

View File

@ -0,0 +1,174 @@
// pages/mine/setting/columnsetting.js
const app = getApp()
Page({
data: {
curIndex: 0,
menuList: [],
imgUrl: app.urls.baseImgUrl,
inputColumnName: '',
isShowInput: false,
curId: '',
curIndex: 0,
curIdx: 0
},
onLoad: function (options) {
this.getColumnList()
try {
var isFrist = wx.getStorageSync('isFirst')
if (isFrist) {
} else {
wx.setStorage({
key: 'isFirst',
data: true
})
wx.showModal({
title: '提示',
content: '点击列表条目名称可以自定义栏目名称,点击开关可以控制是否在首页展示该条目.',
showCancel: false,
success(res) {
}
})
}
} catch (err) {
console.log('获取失败')
wx.showModal({
title: '提示',
content: '点击列表条目名称可以自定义栏目名称,点击开关可以控制是否在首页展示该条目.',
showCancel: false,
success(res) {
}
})
}
},
getColumnList() {
wx.showLoading({
title: '加载中...',
})
var _self = this
app.http.get(app.urls.getMineColumnList, {
header: {
token: app.globalData.token
}
})
.then(res => {
var data = res.data
wx.hideLoading({})
data.forEach(it => {
it.configColumnList.sort((a, b) => a.configColumnOrder - b.configColumnOrder)
})
_self.setData({
menuList: data
})
})
.catch(err => {
wx.hideLoading({})
})
},
//保存我的栏目是否显示
doSaveColumnDisplay(e) {
// configColumnId
var id = e.currentTarget.dataset.id
var index = e.currentTarget.dataset.index
var idx = e.currentTarget.dataset.idx
console.log(id + '===' + idx + '===' + index)
var _self = this
wx.showLoading({
title: '保存中...',
})
app.http.post(app.urls.doSaveColumnDisplay, {
header: {
token: app.globalData.token
},
data: {
configColumnId: id
}
})
.then(res => {
wx.hideLoading({})
var setMode = _self.data.menuList[index].configColumnList[idx].configColumnSet
if (setMode == '0') {
setMode = '1'
} else {
setMode = '0'
}
_self.data.menuList[index].configColumnList[idx].configColumnSet = setMode
_self.setData({
menuList: _self.data.menuList
})
})
.catch(err => {
console.log(err)
wx.hideLoading({})
wx.showToast({
title: '保存失败',
icon: 'error'
})
})
},
//保存我的栏目名称
doSaveColumnName() {
var _self = this
wx.showLoading({
title: '修改中...',
})
app.http.post(app.urls.doSaveColumnName, {
header: {
token: app.globalData.token
},
data: {
configColumnId: _self.data.curId,
configColumnName: _self.data.inputColumnName
}
})
.then(res => {
wx.hideLoading({})
_self.data.menuList[_self.data.curIndex].configColumnList[_self.data.curIdx].configColumnRemark = _self.data.menuList[_self.data.curIndex].configColumnList[_self.data.curIdx].configColumnName
_self.data.menuList[_self.data.curIndex].configColumnList[_self.data.curIdx].configColumnName = _self.data.inputColumnName
// 刷新数据
_self.setData({
menuList: _self.data.menuList,
inputColumnName: '',
})
})
.catch(err => {
wx.hideLoading({})
wx.showToast({
title: '修改失败',
icon: 'error'
})
})
},
showInput(e) {
var id = e.currentTarget.dataset.id //栏目
var index = e.currentTarget.dataset.index //栏目组
var idx = e.currentTarget.dataset.idx //栏目
this.setData({
isShowInput: true,
curId: id,
curIndex: index,
curIdx: idx
})
},
//保存自定义栏目名称
addName(e) {
var _self = this
_self.setData({
isShowInput: false,
})
_self.doSaveColumnName()
},
//栏目名称输入监听
textInput(e) {
this.setData({
inputColumnName: e.detail.value
})
},
onHide(e) {
this.setData({
isShowInput: false
})
}
})

View File

@ -0,0 +1,3 @@
{
"usingComponents": {}
}

View File

@ -0,0 +1,69 @@
<cu-custom isCustom="{{false}}" isBack="{{true}}">
<view slot="content">设置</view>
</cu-custom>
<view class="scroll-content">
<!-- 菜单 -->
<view wx:if="{{menuList.length>0}}" style="width:100%;">
<view class="cu-list menu card-menu shadow-lg radius"
style="margin-top:30rpx;margin-left:0rpx;margin-right:0rpx;" wx:for-item="group" wx:for="{{menuList}}"
wx:key="index" wx:if="{{group.configColumnGroupStatus=='1'}}">
<!-- 横向 -->
<view wx:if="{{group.configColumnGroupDirection=='1'}}">
<view class="cu-list grid col-4 no-border">
<view class="cu-item align-center justify-center" data-path="{{item.configColumnTargetUrl}}"
wx:if="{{item.configColumnStatus=='1'}}" data-type="{{item.configColumnTargetMode}}"
bindtap="choosePage" data-item="{{item}}" wx:for="{{group.configColumnList}}" wx:for-index="idx"
wx:for-item="item" wx:key="idx">
<image style="width:96rpx;height:96rpx;border-radius:10rpx;"
src="{{imgUrl+item.configColumnPhoto}}" mode="scaleToFill">
</image>
<text class="text-df text-black" data-id="{{item.configColumnId}}" data-index="{{index}}"
data-idx="{{idx}}" catchtap="showInput">{{item.configColumnName}}</text>
<view data-id="{{item.configColumnId}}" catchtap="doSaveColumnDisplay" data-index="{{index}}"
data-idx="{{idx}}">
<van-switch checked="{{ item.configColumnSet == '1' }}" size="24px" />
</view>
</view>
</view>
</view>
<!-- 纵向 -->
<view wx:else>
<view wx:for="{{group.configColumnList}}" wx:for-item="item" data-path="{{item.configColumnTargetUrl}}"
data-type="{{item.configColumnTargetMode}}" wx:for-index="idx" wx:key="idx" data-item="{{item}}">
<view class="cu-list menu card-menu shadow-lg radius">
<view class="cu-item border-bottom-sm" style="padding:20rpx;margin-top:5rpx;">
<image wx:if="{{item.configColumnPhoto.length>0}}" class="cu-avatar radius lg"
src="{{imgUrl + item.configColumnPhoto}}" mode="scaleToFill"></image>
<view class="content padding-left-xs" style="width:80%;" data-id="{{item.configColumnId}}"
data-index="{{index}}" data-idx="{{idx}}" catchtap="showInput">
<view class="text-black">
<text class="text-cut">{{item.configColumnName}}</text>
</view>
<view class="text-gray text-sm flex">
<text class="text-cut">原名称:{{item.configColumnRemark}}</text>
</view>
</view>
<view class="action" data-id="{{item.configColumnId}}" catchtap="doSaveColumnDisplay"
data-index="{{index}}" data-idx="{{idx}}">
<van-switch checked="{{ item.configColumnSet == '1' }}" size="24px" />
</view>
</view>
</view>
</view>
</view>
</view>
</view>
<view wx:else style="margin-top:200rpx;width:100%;">
<van-empty description="暂无数据" image="/images/ic_empty_data.png" />
</view>
</view>
<!-- 文本内容弹框 -->
<van-action-sheet show="{{ isShowInput }}" title="栏目名称修改" bind:close="onHide" data-type="5"
style="padding-bottom:180rpx;">
<view class="flex flex-direction align-center" style="margin-top:10rpx;padding-bottom:30rpx;">
<input id="linkStr" placeholder="请输入栏目名称"
style="width:90%;border:1rpx solid #DFDFDF;padding:8rpx;line-height:70rpx;height:70rpx; border-radius:3rpx;"
value="{{inputColumnName}}" bindinput="textInput" />
<view class="cu-btn bg-blue radius margin-top-sm" style="width:30%;" bindtap="addName">保存</view>
</view>
</van-action-sheet>

View File

@ -0,0 +1,8 @@
/* pages/mine/setting/columnsetting.wxss */
.scroll-content {
width: 100%;
position: absolute;
display: flex;
flex-direction: column;
}

View File

@ -0,0 +1,334 @@
// pages/moments/showlist/showlist.js
const app = getApp()
var innerAudioContext = wx.createInnerAudioContext()
Page({
data: {
currentIndex: 0,
tabList: [],
curId: '', //当前栏目ID
tempUserId: '', //当前栏目用户ID
dataList: [], //当前数据
speedStep: 5, //快进快退秒数
waitFlag: false,
topHeight: app.globalData.CustomBar,
},
onLoad(options) {
this.setData({
curId: options.id,
tempUserId: options.userId,
})
this.getTabs()
},
getTabs() {
var _self = this
wx.showLoading({
title: '加载中...',
})
app.http.get(app.urls.getMainColumn, {
header: {
token: app.globalData.token
},
data: {
cardTemplateUseId: _self.data.tempUserId
}
})
.then(res => {
for (var i = 0; i < res.data.length; i++) {
if (res.data[i].configColumnId == _self.data.curId) {
_self.setData({
currentIndex: i
})
}
}
wx.hideLoading({})
_self.setData({
tabList: res.data
})
_self.getMainMoment(_self.data.curId)
})
.catch(err => {
wx.hideLoading({})
})
},
onChange(e) {
var index = e.detail.index
var id = this.data.tabList[index].configColumnId
var _self = this
_self.setData({
currentIndex: index
})
//重新请求数据
_self.getMainMoment(id)
},
//切换标签
changeTab(e) {
var curIndex = e.currentTarget.dataset.currentindex
var id = this.data.dataList[curIndex].configColumnId
var _self = this
_self.setData({
currentIndex: curIndex
})
//重新请求数据
_self.getMainMoment(id)
},
getMainMoment(id) {
wx.showLoading({
title: '加载中...',
})
var _self = this
app.http.get(app.urls.getMainMoment.format({
configColumnId: id
}), {
header: {
token: app.globalData.token
},
data: {
userId: _self.data.tempUserId
}
})
.then(res => {
wx.hideLoading({})
_self.buildMainData(res.data)
})
.catch(err => {
wx.hideLoading({})
})
},
buildMainData(datas) {
var _self = this
datas.forEach(it => {
it.list.forEach(iem => {
switch (iem.dataType) {
case '2': //图片
var items = iem.value.split(',')
var tempList = []
items.forEach(item => {
var tempItem = {
id: item,
path: app.urls.baseImgUrl + item,
}
tempList.push(tempItem)
})
iem.valueList = tempList
break
case '3': //音频
var items = iem.value.split(',')
var tempList = []
items.forEach(item => {
var tempItem = {
id: item, //id
path: app.urls.baseImgUrl + item, //地址
isPlay: false, //是否播放中
duration: 100000, //时长
curDuration: 0,
curDurationStr: '00:00',
totalDurationStr: '00:00'
}
tempList.push(tempItem)
})
iem.valueList = tempList
break
case '4': //视频
var items = iem.value.split(',')
var tempList = []
for (var i = 0; i < items.length; i++) {
var ss = items[i].split('&')
var videoUrl = app.urls.baseImgUrl + ss[0]
var imgUrl = app.urls.baseImgUrl + ss[1]
var tempItem = {
path: videoUrl,
imgPath: imgUrl
}
tempList.push(tempItem)
}
iem.valueList = tempList
break
case '6':
var items = iem.value.split('-')
var tempList = []
items.forEach(item => {
var latlng = item.split(',')
var tempItem = {
name: '',
address: '',
latitude: latlng[0],
longitude: latlng[1],
}
tempList.push(tempItem)
})
iem.valueList = tempList
break
case '8': //单选
iem.dictionariesList.forEach(ss => {
if (iem.value.indexOf(ss.dataId) != -1) {
iem.selValue = ss.dataName
}
})
break
case '9': //多选
iem.dictionariesList.forEach(ss => {
if (iem.value.indexOf(ss.dataId) != -1) {
ss.isSel = true
} else {
ss.isSel = false
}
})
break
}
})
})
_self.setData({
dataList: datas
})
},
//预览图片
viewImg(e) {
wx.previewImage({
urls: [e.currentTarget.dataset.url],
})
},
//预览视频
viewVideo(e) {
var url = e.currentTarget.dataset.url
wx.previewMedia({
sources: [{
url: url,
type: 'video'
}],
})
},
play(e) {
//进行播放
const _self = this
const index = e.currentTarget.dataset.index
const idx = e.currentTarget.dataset.idx
const ix = e.currentTarget.dataset.i
const a = e.currentTarget.dataset.a
var audio = e.currentTarget.dataset.item
//先需要停止其他录音文件的播放
_self.data.dataList.forEach(it => {
it.list.forEach(item => {
item.list.forEach(ix => {
if (ix.dataType == '3') {
if (ix.valueList) {
ix.valueList.forEach(ii => {
if (ii.isPlay) {
innerAudioContext.stop()
}
ii.isPlay = false
ii.curDuration = 0
ii.curDuationStr = '00:00'
})
}
}
})
})
})
if (!audio.isPlay) {
innerAudioContext = wx.createInnerAudioContext()
innerAudioContext.src = _self.data.dataList[index].list[idx].list[ix].valueList[a].path + '.mp3'
innerAudioContext.autoplay = true
console.log(_self.data.dataList[index].list[idx].list[ix].valueList[a].path)
} else {
innerAudioContext.stop()
}
innerAudioContext.onPlay(() => {
console.log('onPlay')
_self.data.dataList[index].list[idx].list[ix].valueList[a]['isPlay'] = true
_self.setData({
dataList: _self.data.dataList
})
});
innerAudioContext.onCanplay((res) => {})
innerAudioContext.onStop((res) => {
_self.data.dataList[index].list[idx].list[ix].valueList[a].isPlay = false
_self.data.dataList[index].list[idx].list[ix].valueList[a].curDuration = 0
_self.data.dataList[index].list[idx].list[ix].valueList[a].curDurationStr = '00:00'
_self.setData({
dataList: _self.data.dataList,
})
innerAudioContext.destroy()
})
innerAudioContext.onEnded((res) => {
_self.data.dataList[index].list[idx].list[ix].valueList[a].isPlay = false
_self.data.dataList[index].list[idx].list[ix].valueList[a].curDuration = 0
_self.data.dataList[index].list[idx].list[ix].valueList[a].curDurationStr = '00:00'
_self.setData({
dataList: _self.data.dataList,
})
innerAudioContext.destroy()
})
innerAudioContext.onError((res) => {
_self.data.dataList[index].list[idx].list[ix].valueList[a].isPlay = false
_self.data.dataList[index].list[idx].list[ix].valueList[a].curDuration = 0
_self.data.dataList[index].list[idx].list[ix].valueList[a].curDurationStr = '00:00'
_self.setData({
dataList: _self.data.dataList,
})
innerAudioContext.destroy()
})
innerAudioContext.onSeeking(() => {})
innerAudioContext.onWaiting(() => {})
innerAudioContext.onTimeUpdate(() => {
if (innerAudioContext.duration != Infinity) {
_self.data.dataList[index].list[idx].list[ix].valueList[a].curDuration = parseInt(innerAudioContext.currentTime)
_self.data.dataList[index].list[idx].list[ix].valueList[a].duration = parseInt(innerAudioContext.duration)
var curM = parseInt(innerAudioContext.currentTime / 60) //分钟
var curS = parseInt(innerAudioContext.currentTime % 60) //秒
var tM = parseInt(innerAudioContext.duration / 60) //分钟
var tS = parseInt(innerAudioContext.duration % 60) //秒
var curMStr = curM > 9 ? curM : '0' + curM
var curSStr = curS > 9 ? curS : '0' + curS
var totalMStr = tM > 9 ? tM : '0' + tM
var totalSStr = +tS > 9 ? tS : '0' + tS
_self.data.dataList[index].list[idx].list[ix].valueList[a].curDurationStr = curMStr + ':' + curSStr
_self.data.dataList[index].list[idx].list[ix].valueList[a].totalDurationStr = totalMStr + ':' + totalSStr
_self.setData({
dataList: _self.data.dataList
})
}
})
},
//倒退5秒
rewind(e) {
var _self = this
var index = e.currentTarget.dataset.index
var item = e.currentTarget.dataset.item
var idx = e.currentTarget.dataset.idx
var a = e.currentTarget.dataset.a
var ix = e.currentTarget.dataset.i
if (item.isPlay) {
_self.data.dataList[index].list[idx].list[ix].valueList[a].curDuration = _self.data.dataList[index].list[idx].list[ix].valueList[a].curDuration - _self.data.speedStep
innerAudioContext.seek(_self.data.dataList[index].list[idx].list[ix].valueList[a].curDuration)
_self.setData({
dataList: _self.data.dataList
})
}
},
//快进5秒
speed(e) {
var _self = this
var index = e.currentTarget.dataset.index
var item = e.currentTarget.dataset.item
var idx = e.currentTarget.dataset.idx
var a = e.currentTarget.dataset.a
var ix = e.currentTarget.dataset.i
if (item.isPlay) {
_self.data.dataList[index].list[idx].list[ix].valueList[a].curDuration = _self.data.dataList[index].list[idx].list[ix].valueList[a].curDuration + _self.data.speedStep
innerAudioContext.seek(_self.data.dataList[index].list[idx].list[ix].valueList[a].curDuration)
_self.setData({
dataList: _self.data.dataList
})
}
},
slider4change(e) {
var index = e.currentTarget.dataset.index
var item = e.currentTarget.dataset.item
if (item.isPlay) {
innerAudioContext.seek(e.detail.value)
}
},
})

View File

@ -0,0 +1,3 @@
{
"usingComponents": {}
}

View File

@ -0,0 +1,197 @@
<cu-custom isCustom="{{false}}" isBack="{{true}}">
<view slot="content">栏目</view>
</cu-custom>
<view class="tab">
<van-tabs active="{{ currentIndex }}" bind:change="onChange" ellipsis="{{false}}" z-index="{{100}}" sticky
color="#0054bd">
<block wx:for="{{tabList}}" wx:key="index">
<van-tab title="{{item.configColumnName}}">
</van-tab>
</block>
</van-tabs>
</view>
<view wx:if="{{dataList.length>0}}" style="background-color:#F7F7F7;margin-top:90rpx;">
<!-- 栏目组 -->
<view wx:for="{{dataList}}" wx:key="index">
<view class="flex flex-direction margin-sm">
<view class="column-content">
<view class="column-box">
<!-- 栏目数据 -->
<view wx:for="{{item.list}}" wx:for-index="i" wx:for-item="child" wx:key="i" bindtap="showDetail">
<!-- 具体数据 -->
<!-- 文本 -->
<view wx:if="{{child.dataType=='1'}}" class="align-center">
<view class="bg-white">
<view class="cu-form-group">
<view id="content"
class="padding-left-xs padding-right-xs margin-left-xs margin-right-xs"
style="line-height:40rpx;">
{{child.value}}
</view>
</view>
</view>
</view>
<!-- 图片 -->
<view wx:if="{{child.dataType=='2'}}">
<!-- 九宫格 -->
<view wx:if="{{child.dataMode == '95bef6e2-0ab8-442f-b53d-b1f18130bae1'}}"
class="cu-form-group padding-sm">
<view class="grid col-3 grid-square flex-sub">
<view class="bg-img" wx:for="{{child.valueList}}" wx:key="d" wx:for-item="photo"
catchtap="viewImg" data-url="{{photo.path}}">
<image src='{{photo.path}}' mode='scaleToFill'></image>
</view>
</view>
</view>
<!-- 左右滑动 -->
<view
wx:elif="{{child.dataMode=='bae3d6c1-8f6e-4e27-bba2-e42860758db7' || child.dataMode=='179441e3-5ad1-485b-b5af-421bdc383b5e'}}">
<swiper style="width:100%;height:400rpx;margin-top:20rpx;" indicator-dots="{{true}}"
autoplay="{{child.dataMode=='179441e3-5ad1-485b-b5af-421bdc383b5e'}}">
<block wx:for="{{child.valueList}}" wx:key="pIndex" wx:for-index="pIndex"
wx:for-item="photo">
<swiper-item style="width:100%;">
<image style="width:100%;border-radius:20rpx;height:400rpx;"
src="{{photo.path}}" mode="scaleToFill">
</image>
</swiper-item>
</block>
</swiper>
</view>
<!-- 上下 -->
<view wx:elif="{{child.dataMode=='121133b0-3596-46f4-a35f-7aaae79cf47a'}}">
<block wx:for="{{child.valueList}}" wx:key="pIndex" wx:for-index="pIndex"
wx:for-item="photo">
<image style="width:100%;border-radius:20rpx;margin-top:20rpx;" src="{{photo.path}}"
mode="widthFix">
</image>
</block>
</view>
</view>
<!-- 视频 -->
<view wx:if="{{child.dataType=='4'}}">
<view class="cu-form-group margin-top-xs padding-xs"
style="border:1rpx solid #f9f9f9;border-radius:10rpx;">
<view class="grid col-{{count>3 ? count : 1}} grid-square flex-sub">
<view class="bg-img" wx:for="{{child.valueList}}" wx:for-index="d" wx:key="d"
wx:for-item="video" catchtap="viewVideo"
style="{{count > 3 ? '' :'height:280rpx;width:100%;padding-bottom:0px;'}}"
data-url="{{video.path}}">
<image style="width:100%;height:100%;" src='{{video.imgPath}}'
mode='scaleToFill'></image>
<view class="{{count > 3 ? 'play-box-arrow-pos':'play-box-arrow-flex'}}">
<image src="/images/ic_video_play.png" mode="scaleToFill"
style="{{count > 3 ? 'width:32px;height:32px':'height:64px;width:64px;'}}">
</image>
</view>
</view>
</view>
</view>
</view>
<!-- 音频 -->
<view wx:if="{{child.dataType=='3'}}" style="width:100%;">
<view class="cu-form-group padding-sm">
<view class="flex align-center shadow-box margin-top-xs" style="width:100%;"
wx:for="{{child.valueList}}" wx:for-index="a" wx:key="a" wx:for-item="audio">
<image src="/images/ic_user_default.png" mode="scaleToFill"
style="width:80rpx;height:80rpx;">
</image>
<view class="play-box">
<view class="flex justify-between align-center" style="width:80%;">
<text>{{audio.curDurationStr}}</text>
<slider class="flex-sub" bindchange="slider4change" min="{{0}}"
max="{{audio.duration}}" value="{{audio.curDuration}}"
backgroundColor="#cacaca" activeColor="#1296db" data-index="{{index}}"
data-idx="{{idx}}" data-i="{{i}}" data-item="{{audio}}" data-a="{{a}}"
block-size="14" block-color="#1296db" />
<text>{{audio.totalDurationStr}}</text>
</view>
<view class="flex justify-between" style="width:80%;">
<image src="/images/ic_audio_rewind.png" mode="scaleToFill"
data-index="{{index}}" data-idx="{{idx}}" data-a="{{a}}" data-i="{{i}}"
data-item="{{audio}}" catchtap="rewind">
</image>
<image
src="{{audio.isPlay ? '/images/ic_audio_playing.png':'/images/ic_audio_play.png'}}"
mode="scaleToFill" catchtap="play" data-index="{{index}}" data-i="{{i}}"
data-idx="{{idx}}" data-a="{{a}}" data-item="{{audio}}"></image>
<image src="/images/ic_audio_speed.png" mode="scaleToFill" catchtap="speed"
data-index="{{index}}" data-a="{{a}}" data-idx="{{idx}}" data-i="{{i}}"
data-item="{{audio}}">
</image>
</view>
</view>
</view>
</view>
</view>
<!-- 地图定位 -->
<view wx:if="{{child.dataType=='6'}}">
<view class="padding-sm">
<view wx:for="{{child.valueList}}" wx:key="mindex" wx:for-index="mindex" wx:for-item="m"
style="width:100%;" class="margin-top-xs">
<view class="flex justify-between">
<view>
</view>
<view></view>
</view>
<view style="border-radius:10rpx;overflow:hidden;margin-top:10rpx;">
<map style="width:100%;height:300rpx;" longitude="{{m.longitude}}"
latitude="{{m.latitude}}" scale="12" enable-scroll="{{false}}"
enable-zoom="{{false}}" enable-rotate="{{false}}" enable-traffic="{{false}}"
markers="{{[{latitude:m.latitude,longitude:m.longitude}]}}"></map>
</view>
</view>
</view>
</view>
<!-- 文本域 -->
<view wx:if="{{child.dataType == '7'}}">
<view class="bg-white">
<view class="cu-form-group">
<view id="content"
class="padding-left-xs padding-right-xs margin-left-xs margin-right-xs"
style="line-height:40rpx;">
{{child.value}}
</view>
</view>
</view>
</view>
<!-- 单选 -->
<view wx:if="{{child.dataType == '8'}}">
<view class="flex" style="flex-direction:row;">
<view class="cu-bar bg-white">
<view class="action">
<text class="cuIcon-vipcard"></text> <text
class="text-black">{{child.comment}}:</text><text
class="margin-left-sm">{{child.selValue}}</text>
</view>
</view>
</view>
</view>
<!-- 多选 -->
<view wx:if="{{child.dataType == '9'}}">
<view class="cu-bar bg-white">
<view class="action">
<text class="cuIcon-vipcard"></text> <text>{{child.comment}}</text>
</view>
</view>
<view class="cu-capsule radius" wx:for="{{child.dictionariesList}}" wx:key="ids"
wx:for-index="ids" wx:for-item="ss">
<view wx:if="{{ss.isSel}}"
class="cu-tag bg-blue radius padding-left-sm padding-right-sm">
{{ss.dataName}}
</view>
</view>
</view>
</view>
</view>
</view>
</view>
</view>
</view>
<view wx:else style="margin-top:200rpx;width:100%;">
<van-empty description="暂无数据" image="/images/ic_empty_data.png" />
</view>

View File

@ -0,0 +1,627 @@
.tab {
position: fixed;
left: 0;
right: 0;
background: #fff;
display: flex;
flex-direction: row;
height: 80rpx;
z-index: 100;
}
.tab-box {
display: flex;
justify-content: center;
align-items: center;
font-size: 32rpx;
color: #000;
}
.tab-box.active {
color: #055fe6;
border-bottom: 2px solid #055fe6;
box-sizing: border-box;
}
.card-container {
height: 0;
box-sizing: border-box;
}
.share-btn {
background: #eee;
}
.card {
width: 100%;
height: 0;
box-sizing: border-box;
background: #fff;
position: relative;
overflow: hidden;
/* text-align: center; */
}
.area-box {
white-space: nowrap;
word-break: break-all;
}
.card-bgImg {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
.person {
padding: 20rpx;
}
.dynamic-container {
margin-top: -50rpx;
position: relative;
background-color: #fff;
padding: 20rpx;
border-radius: 20rpx;
}
.dynamic-title image {
width: 30rpx;
height: 30rpx;
vertical-align: middle;
margin-top: -4rpx;
}
.catelog-title {
display: flex;
position: relative;
align-items: center;
justify-content: space-between;
}
.catelog-title .action {
display: flex;
align-items: center;
justify-content: center;
max-width: 100%;
padding-right: 30rpx;
}
.title {
font-size: 30rpx;
position: relative;
color: #fff;
border-top-right-radius: 48rpx;
border-top-left-radius: 48rpx;
background: #0054bd;
display: inline-block;
padding: 10rpx 60rpx 60rpx 10rpx;
margin-bottom: -50rpx;
}
.title text {
margin-left: 20rpx;
}
.column-box {
display: flex;
flex-direction: column;
background-color: #fff;
width: 100%;
}
.column-content {
display: flex;
flex-direction: column;
padding: 10rpx;
background-color: #fff;
border-radius: 10rpx;
width: 100%;
box-shadow: 0px 2px 2px #f0f0f0;
z-index: 2;
}
.intro-title image {
width: 28rpx;
height: 30rpx;
vertical-align: middle;
margin-top: -4px;
}
.serve-title image {
width: 28rpx;
height: 30rpx;
vertical-align: middle;
margin-top: -4px;
}
.person-content {
padding: 20rpx;
border-radius: 20rpx;
background: #fff;
margin-top: -30rpx;
font-size: 30rpx;
color: #000;
line-height: 40rpx;
word-break: break-all;
line-height: 40rpx;
letter-spacing: 2rpx;
position: relative;
}
.company-title {
display: flex;
justify-content: space-between;
border-bottom: 1px solid #ddd;
}
.company-title image {
width: 140rpx;
height: 140rpx;
}
.company-name {
width: 520rpx;
height: 140rpx;
display: flex;
align-items: center;
font-size: 34rpx;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.company-content {
background: #fff;
border-radius: 20rpx;
padding: 20rpx;
margin-top: -30rpx;
position: relative;
}
.company-content image {
width: 100%;
height: 300rpx;
border-radius: 20rpx;
}
.company .person-content {
margin-top: 0;
}
.dynamic-title {
width: 710rpx;
margin: 0 auto;
display: block;
}
.dynamic-box {
margin-bottom: 20rpx;
background: #fff;
border-radius: 20rpx;
overflow: hidden;
position: relative;
height: 400rpx;
}
.dynamic-box image {
width: 100%;
height: 400rpx;
}
.dynamic-text {
position: absolute;
left: 0;
right: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.6);
line-height: 60rpx;
color: #fff;
padding: 0 10rpx;
font-size: 30rpx;
}
.person-info {
display: flex;
justify-content: space-between;
padding-bottom: 20rpx;
border-bottom: 1px solid #EEE;
}
.avatar {
width: 120rpx;
height: 120rpx;
border-radius: 50%;
overflow: hidden;
}
.avatar image {
width: 100%;
height: 100%;
}
.person-name {
width: 530rpx;
}
.name {
font-size: 32rpx;
margin: 15rpx 0 10rpx;
color: #000;
}
.time {
color: #b2b2b2;
}
.dynamic-content {
margin: 20rpx 0;
}
.dynamic-img {
position: relative;
display: flex;
justify-content: space-between;
flex-wrap: wrap;
}
.dynamic-img image {
width: 32%;
margin-right: 2%;
height: 160rpx;
margin-bottom: 10rpx;
}
.dynamic-img image:nth-child(3n) {
margin-right: 0;
}
.dynamic-img-text {
position: absolute;
left: 0;
right: 0;
bottom: 3rpx;
padding: 0 20rpx;
background: rgba(0, 0, 0, 0.6);
color: #fff;
font-size: 32rpx;
line-height: 70rpx;
}
.dynamic-good {
margin: 10rpx 0;
display: flex;
justify-content: space-between;
}
.good-count {
color: #333;
font-size: 28rpx;
}
.good-btn image {
width: 40rpx;
height: 40rpx;
vertical-align: top;
}
.dynamic-reply {
background: #eee;
padding: 15rpx;
margin-top: 15rpx;
}
.reply {
font-size: 32rpx;
color: #000;
margin-bottom: 5rpx;
}
.reply-name {
font-weight: bold;
display: inline;
}
.dynamic-reply-input {
margin-top: 10rpx;
}
.dynamic-reply-input input {
width: 100%;
height: 60rpx;
border-bottom: 1px solid #eee;
}
.creat-card {
position: fixed;
right: 20rpx;
bottom: 20rpx;
padding: 20rpx;
background: #0054bd;
border-radius: 50%;
box-sizing: border-box;
align-items: center;
justify-content: center;
flex-direction: column;
width: 140rpx;
height: 140rpx;
z-index: 100;
}
.creat-card image {
width: 80rpx;
height: 60rpx;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
.share-save {
text-align: center;
display: flex;
justify-content: space-between;
}
.share-btn {
border: 1px solid #1296db;
background: none;
color: #1296db;
font-weight: normal;
}
.save-btn {
border: 1px solid #1296db;
background: #1296db;
color: #fff;
font-weight: normal;
}
.bottom-btn {
margin-top: 20rpx;
padding: 0 20rpx;
width: 100%;
white-space: nowrap;
}
.phone-box .icon {
width: 30rpx;
height: 30rpx;
vertical-align: top;
}
.wechate-box .icon {
width: 35rpx;
height: 30rpx;
vertical-align: top;
}
.email-box .icon {
width: 30rpx;
height: 30rpx;
vertical-align: top;
}
.bottom-btn-box {
display: inline-block;
min-width: 32%;
line-height: 30rpx;
padding: 20rpx;
box-sizing: border-box;
border: 1px solid #DDD;
border-radius: 10rpx;
margin-right: 10rpx;
}
.bottom-text {
margin-top: 10rpx;
}
.top-box {
padding-bottom: 20rpx;
background-color: #F7F7F7;
}
.good {
display: flex;
justify-content: space-between;
padding-left: 20rpx;
padding-bottom: 20rpx;
background-color: #fff;
}
.good-avatar,
.good-click {
line-height: 45rpx;
color: #333;
}
.good-click {
display: flex;
}
.view-count {
margin-right: 30rpx;
padding-right: 30rpx;
border-right: 1px solid #808080;
color: #808080;
display: flex;
flex-direction: row;
font-size: 36rpx;
}
.view-count-no {
margin-right: 30rpx;
padding-right: 30rpx;
color: #808080;
display: flex;
flex-direction: row;
align-items: center;
font-size: 36rpx;
}
.good-avatar image {
width: 100%;
height: 100%;
}
.good-click image {
width: 38rpx;
height: 38rpx;
}
.view-count image {
width: 32rpx;
height: 32rpx;
}
.view-count-no image {
width: 32rpx;
height: 32rpx;
}
.avatar-list {
width: 45rpx;
height: 45rpx;
margin-right: 10rpx;
vertical-align: top;
display: inline-block;
}
.mid {
display: flex;
background: #0054bd;
border-top-left-radius: 60rpx;
border-top-right-radius: 60rpx;
padding: 40rpx 0 80rpx;
margin-top: -20rpx;
position: relative;
}
.mid-box {
flex: 1;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
border-right: 1px solid #2f82ea;
background: none;
font-weight: normal;
width: auto !important;
padding: 0 !important;
}
.mid-box:last-child {
border: none;
}
.mid-box image {
width: 60rpx;
height: 60rpx;
margin-bottom: 20rpx;
}
.mid-box-text {
font-size: 30rpx;
color: #fff;
}
.mid-btn {
position: relative;
margin-top: -60rpx;
display: flex;
padding: 30rpx;
background: #fff;
border-top-left-radius: 60rpx;
border-top-right-radius: 60rpx;
flex-wrap: wrap;
justify-content: space-between;
}
.mid-btn-box {
flex-shrink: 0;
width: 49%;
margin-bottom: 20rpx;
padding: 15rpx;
border-radius: 20rpx;
background: #eee;
display: flex;
justify-content: space-between;
box-sizing: border-box;
}
.mid-btn-box:nth-child(3),
.mid-btn-box:nth-child(4) {
margin-bottom: 0;
}
.mid-btn-box image {
width: 80rpx;
height: 80rpx;
}
.mid-btn-text {
width: 200rpx;
}
.text-top {
line-height: 45rpx;
font-size: 30rpx;
color: #000;
}
.text-bottom {
font-size: 26rpx;
color: #898989;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.bar-code {
position: fixed;
top: 0;
bottom: 0;
right: 0;
left: 0;
background: rgba(0, 0, 0, 0.6);
z-index: 999;
}
.bar-code .content {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
max-width: 96%;
background: #fff;
/* width: 500rpx;
height: 500rpx; */
border-radius: 10rpx;
padding: 20rpx;
min-width: 80%;
min-height: 50%;
display: flex;
flex-direction: column;
align-items: center;
justify-content: space-between;
}
.code-title {
font-size: 32rpx;
font-weight: bold;
color: #000;
}
.code-txt {
font-size: 32rpx;
color: #000;
}
.bar-code image {
width: 300rpx;
height: 300rpx;
}

View File

@ -0,0 +1,16 @@
Page({
/**
* 页面的初始数据
*/
data: {
shopUrl: 'https://www.baidu.com'
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
}
})

View File

@ -0,0 +1,3 @@
{
"usingComponents": {}
}

View File

@ -0,0 +1,3 @@
<!--pages/serve/index/index.wxml-->
<web-view src="{{shopUrl}}">
</web-view>

View File

@ -0,0 +1 @@
/* pages/serve/index/index.wxss */

View File

@ -7,8 +7,8 @@ Page({
* 页面的初始数据
*/
data: {
active: 0,
curIndex: 0,
cardUrl: app.urls.baseImgUrl,
token: '',
cardTemplateUseId: '',
cardTemplateDispatchId: '',
@ -32,10 +32,12 @@ Page({
imgUrl: app.urls.baseImgUrl,
personId: '',
shareRecordId: '',
name: '名片',
nameTxt: '名片',
dataList: [],
isShowBarCode: false,
browUserList: []
browUserList: [],
tempUserId: '',
shareImgUrl: ''
},
// 登录
doLogin() {
@ -132,7 +134,7 @@ Page({
})
} else if (area[i].templateAreaSource == 'name') {
self.setData({
name: area[i].templateAreaFontValue
nameTxt: area[i].templateAreaFontValue
})
}
}
@ -142,14 +144,17 @@ Page({
dataList: []
})
if (res.data) {
self.toSaveLocalImg(res.data.cardTemplateUseDispatchPhoto)
self.getBrowCardUserList(res.data.cardTemplateUseId)
self.setData({
tempUserId: res.data.creator
})
self.getMainColumn(res.data.creator)
}
})
},
//获取首页展示的栏目
getMainColumn(id) {
console.log(id)
var _self = this
app.http.get(app.urls.getMainColumn, {
header: {
@ -185,8 +190,11 @@ Page({
.then(res => {
if (res.data.length > 0) {
var tempItem = {
cId: datas[_self.data.curIndex].configColumnId,
type: datas[_self.data.curIndex].configColumnType,
name: datas[_self.data.curIndex].configColumnName,
list: res.data
mode: datas[_self.data.curIndex].configTableMode,
list: res.data.slice(0, datas[_self.data.curIndex].configColumnRowCount)
}
_self.data.dataList.push(tempItem)
}
@ -246,14 +254,16 @@ Page({
case '4': //视频
var items = iem.value.split(',')
var tempList = []
items.forEach(item => {
for (var i = 0; i < items.length; i++) {
var ss = items[i].split('&')
var videoUrl = app.urls.baseImgUrl + ss[0]
var imgUrl = app.urls.baseImgUrl + ss[1]
var tempItem = {
id: item,
path: app.urls.baseImgUrl + item,
imgPath: '/images/ic_temp.png'
path: videoUrl,
imgPath: imgUrl
}
tempList.push(tempItem)
})
}
iem.valueList = tempList
break
case '6':
@ -381,7 +391,6 @@ Page({
* 用户点击右上角分享
*/
onShareAppMessage: function (res) {
console.log(res)
var self = this
wx.showShareMenu({
withShareTicket: true,
@ -396,9 +405,11 @@ Page({
var param = '/pages/sharePage/sharePage?cardTemplateDispatchId=' + postId;
return {
title: '我的名片',
path: param
title: '名片分享',
path: param,
imageUrl: self.data.shareImgUrl
}
// return返回 title 转发标题 path 路径 imageUrl 自定义图片,可以本地路径 代码包文件路径 支持png jpg 显示长宽比5:4
}
},
//获取浏览当前名片的用户头像列表
@ -625,9 +636,49 @@ Page({
innerAudioContext.seek(e.detail.value)
}
},
//将分享的Base64图片保存至本地
toSaveLocalImg(data) {
var base64 = data
var imgPath = wx.env.USER_DATA_PATH + '/index' + 'share.png'
var imageData = base64.replace(/^data:image\/\w+;base64,/, "");
var fs = wx.getFileSystemManager();
fs.writeFileSync(imgPath, imageData, "base64");
this.setData({
shareImgUrl: imgPath
})
},
goHome() {
wx.switchTab({
url: '/pages/index/index',
})
},
//显示详情
showDetail(e) {
var type = e.currentTarget.dataset.ctype //需要跳详情
if (type.indexOf('dda5007c-5fb7-48f2-8537-3cb8ea298242') != -1) {
//需要跳详情
var cId = e.currentTarget.dataset.cid
var uId = e.currentTarget.dataset.id
wx.navigateTo({
url: '../moments/momentsdetail/momentsdetail?uId=' + uId + '&cId=' + cId,
})
}
},
//显示更多栏目数据
showMore(e) {
var item = e.currentTarget.dataset.item
if (item.mode == '2') {
var userid = e.currentTarget.dataset.userid
var idx = e.currentTarget.dataset.idx
wx.navigateTo({
url: '../../pages/moments/showlist/showlist?id=' + item.cId + '&userId=' + userid + '&index=' + idx
})
}
},
//tabbar切换
onChange(e) {
this.setData({
active: e.detail
})
}
})

View File

@ -1,3 +1,4 @@
<view wx:if="{{active==0}}">
<cu-custom id="head" isCustom="{{false}}" isBack="{{false}}" isIndex="{{true}}">
<view slot="content">{{nameTxt}}</view>
</cu-custom>
@ -95,20 +96,24 @@
<view wx:for="{{dataList}}" wx:key="index">
<view class="flex flex-direction margin-sm">
<!-- 栏目 -->
<view class="catelog-title" data-item="{{item}}" bindtap="showMore">
<view class="catelog-title margin-top-xs" data-item="{{item}}" data-idx="{{index}}"
data-userid="{{tempUserId}}" bindtap="showMore">
<view class="action">
<view class="title intro-title">
<text class="cuIcon-vipcard"></text>
<text> {{item.name}}</text>
</view>
</view>
<view class="action">
<view class="action" wx:if="{{item.mode=='2'}}">
更多
</view>
</view>
<view class="column-content">
<view wx:for="{{item.list}}" wx:for-index="idx" wx:key="idx" wx:for-item="it" style="" class="column-box">
<view wx:for="{{item.list}}" wx:for-index="idx" wx:key="idx" wx:for-item="it" style=""
class="column-box">
<!-- 栏目数据 -->
<view wx:for="{{it.list}}" wx:for-index="i" wx:for-item="child" wx:key="i">
<view wx:for="{{it.list}}" wx:for-index="i" wx:for-item="child" wx:key="i" bindtap="showDetail"
data-ctype="{{item.type}}" data-cid="{{item.cId}}" data-id="{{it.uid}}">
<!-- 具体数据 -->
<!-- 文本 -->
<view wx:if="{{child.dataType=='1' && child.displayList}}" class="align-center">
@ -193,7 +198,8 @@
</view>
<view class="flex justify-between" style="width:80%;">
<image src="/images/ic_audio_rewind.png" mode="scaleToFill" data-index="{{index}}"
data-idx="{{idx}}" data-a="{{a}}" data-i="{{i}}" data-item="{{audio}}" catchtap="rewind">
data-idx="{{idx}}" data-a="{{a}}" data-i="{{i}}" data-item="{{audio}}"
catchtap="rewind">
</image>
<image src="{{audio.isPlay ? '/images/ic_audio_playing.png':'/images/ic_audio_play.png'}}"
mode="scaleToFill" catchtap="play" data-index="{{index}}" data-i="{{i}}"
@ -255,29 +261,30 @@
<text class="cuIcon-vipcard"></text> <text>{{child.comment}}</text>
</view>
</view>
<view class="cu-capsule radius" wx:for="{{child.dictionariesList}}" wx:key="ids" wx:for-index="ids"
wx:for-item="ss">
<view class="cu-capsule radius" wx:for="{{child.dictionariesList}}" wx:key="ids"
wx:for-index="ids" wx:for-item="ss">
<view wx:if="{{ss.isSel}}" class="cu-tag bg-blue radius padding-left-sm padding-right-sm">
{{ss.dataName}}
</view>
</view>
</view>
</view>
<view wx:if="{{item.type=='dda5007c-5fb7-48f2-8537-3cb8ea298242'}}" bindtap="showDetail"
data-ctype="{{item.type}}" data-cid="{{item.cId}}" data-id="{{it.uid}}"
style="font-size:28rpx;text-align:right;margin-right:20rpx;color:#2b2b2b">详情 ></view>
</view>
</view>
</view>
</view>
</view>
<view wx:else style="margin-top:200rpx;width:100%;">
<van-empty description="暂无数据" image="/images/ic_empty_data.png" />
</view>
</view>
</view>
<!-- 创建名片 -->
<view class="creat-card" bindtap="goHome">
<image src="/images/create-btn.png"></image>
<image src="../../images/create-btn.png"></image>
</view>
</view>
<view class="bar-code" wx:if="{{isShowBarCode}}" bindtap="hideBarCode">
@ -289,3 +296,15 @@
</view>
</view>
</view>
</view>
<view wx:if="{{active==1}}">
<web-view src="https://www.baidu.com" style="height:500rpx;"></web-view>
</view>
<cover-view>
<van-tabbar active="{{ active }}" bind:change="onChange" z-index="9999">
<van-tabbar-item icon="/images/ic_card_normal.png" icon-active="/images/ic_card_sel.png">首页</van-tabbar-item>
<van-tabbar-item icon="/images/ic_serve_normal.png" icon-active="/images/ic_serve_sel.png">服务</van-tabbar-item>
</van-tabbar>
</cover-view>

View File

@ -85,6 +85,12 @@ page {
}
.column-box {
display: flex;
flex-direction: column;
background-color: #fff;
width: 100%;
}
.column-content {
display: flex;
flex-direction: column;
padding: 10rpx 20rpx 40rpx;
@ -94,7 +100,6 @@ page {
box-shadow: 0px 2px 2px #f0f0f0;
z-index: 2;
}
.intro-title image {
width: 28rpx;
height: 30rpx;

View File

@ -56,6 +56,9 @@ var apis = {
getMomentsContent: `app/configcolumndata/get/{configColumnId}/{uid}`, //获取栏目数据
getMainColumn: `app/configcolumn/listhome`, //获取首页显示栏目
getMainMoment: `app/configcolumndata/list/{configColumnId}`, //获取首页栏目数据 通过栏目ID获取栏目下的数据列表(包含每条数据的字段集合) 传入userId参数则查询指定人的 , 没传入userId参数则查询当前token的
getMineColumnList: `app/configcolumnset/list`, //获取我的栏目配置列表
doSaveColumnDisplay: `app/configcolumnset/savedisplay`, //保存我的栏目隐藏显示
doSaveColumnName: `app/configcolumnset/savename`, //保存我的栏目名称
//名片信息
getCardList: `app/cardtemplate/list`, //获取名片列表

View File

@ -107,7 +107,7 @@ function doAjax(url, method, args) {
} else {
errorback(res)
var hintMsg = '网络错误'
if (res.data.msg) {
if (err.data && res.data.msg) {
hintMsg = res.data.msg
}
wx.showToast({
@ -120,7 +120,7 @@ function doAjax(url, method, args) {
wx.hideLoading({})
errorback(err)
var hintMsg = '网络错误'
if (err.data.msg) {
if (err.data && err.data.msg) {
hintMsg = err.data.msg
}
wx.showToast({