Commit ea7be4bb by 张立顺

oher:去除无用组件

1 parent 61b09984
// components/grass/index.js
import {
GRASSGIVELIKE
} from '../../tabGrass/api'
Component({
/**
* 组件的属性列表
*/
properties: {
grassInfo: {
type: Object,
value: function () {
return {}
}
}
},
// 生命周期
lifetimes: {
attached: function () {
// 在组件实例进入页面节点树时执行
//this.getAvatar()
},
},
/**
* 组件的初始数据
*/
data: {
userAvatarUrl: ''
},
/**
* 组件的方法列表
*/
methods: {
// 查看种草详情
send: function (e) {
let row = this.data.grassInfo;
console.log(row);
wx.navigateTo({
url: '/tabGrass/pages/detail/index?id=' + row.id + '&code=' + row.orderCode
})
},
// 点赞
giveLike(e) {
let _this = this;
let o = this.data.grassInfo
let status = e.currentTarget.dataset.status
let oParams = {};
oParams.id = o.id;
oParams.behaviorUserImg = wx.getStorageSync('userAvatar')
oParams.behaviorType = status?2:1
o.hadThumbUp = !o.hadThumbUp;
if(!status){
o.likesAmount += 1;
}
_this.setData({
grassInfo: o
})
GRASSGIVELIKE(oParams)
},
// 获取用户头像
getAvatar(e) {
let _this = this;
console.log('进入此处')
console.log( wx.$util.getAvatarImage)
wx.$util.getAvatarImage().then(res => {
console.log('头像:' + res)
_this.giveLike(e, res)
})
}
}
})
\ No newline at end of file \ No newline at end of file
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file \ No newline at end of file
<!--components/grass/index.wxml-->
<view class="cell" bindtap="send">
<view class="cell_box">
<view class="img_box" wx:if="{{!grassInfo.videoCoverUrl}}">
<image src="{{grassInfo.imgUrls?grassInfo.imgUrls[0]:''}}" mode="widthFix"></image>
</view>
<view class="img_box" wx:if="{{grassInfo.videoCoverUrl}}">
<image src="{{grassInfo.videoCoverUrl}}" mode="widthFix"></image>
</view>
<view class="title">{{grassInfo.shareContent}}</view>
<view class="tags_box" wx:if="{{grassInfo.topicNames && grassInfo.topicNames.length>0}}">
<block wx:for="{{grassInfo.topicNames||[]}}" wx:for-item="k" wx:for-index="idx" wx:key="idx">#{{k}}</block>
<!-- <text wx:for="{{grassInfo.topicNames||[]}}" wx:for-item="k" wx:for-index="idx" wx:key="idx">#{{k}}</text> -->
</view>
<view class="info_box">
<view class="user">
<!-- <image src="/images/defaut_avatar.png" class="img" mode="widthFix"></image> -->
<image src="{{grassInfo.shareUserImg}}" class="img" mode="widthFix" wx:if="{{grassInfo.shareUserImg}}"></image>
<image src="/images/user_avatar.png" class="img" mode="widthFix" wx:else></image>
<text class="name">{{grassInfo.shareUserName}}</text>
</view>
<view class="dian" data-status="{{grassInfo.hadThumbUp}}" catchtap="giveLike">
<image src="/images/dian_active.png" class="img" mode="widthFix" wx:if="{{grassInfo.hadThumbUp}}" ></image>
<image src="/images/dian.png" class="img" mode="widthFix" wx:else></image>
<text class="num">{{common.showLikeNumber(grassInfo.likesAmount)}}</text>
</view>
</view>
</view>
</view>
<wxs src="/utils/index.wxs" module="common" />
\ No newline at end of file \ No newline at end of file
/* components/grass/index.wxss */
.cell {
width: 100%;
padding: 12rpx;
box-sizing: border-box;
}
.cell .cell_box {
background: #FFFFFF;
border-radius: 8rpx;
padding: 20rpx;
box-sizing: border-box;
}
.cell_box .img_box {
width: 100%;
max-height: 304rpx;
overflow: hidden;
}
.cell_box .title {
font-family: PingFangSC-Medium;
font-size: 24rpx;
color: #333333;
font-weight: 500;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
overflow: hidden;
margin: 16rpx 0;
}
.cell_box .tags_box {
width: 100%;
font-family: PingFangSC-Medium;
font-size: 24rpx;
color: #FF6601;
font-weight: 500;
display: -webkit-box;
text-overflow: ellipsis;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
overflow: hidden;
margin: 16rpx 0;
}
.info_box {
display: flex;
align-items: center;
justify-content: space-between;
width: 100%;
overflow: hidden;
}
.info_box .user,
.info_box .dian {
width: 50%;
display: flex;
align-items: center;
flex-shrink: 0;
flex-grow: 0;
}
.info_box .user .img {
width: 36rpx;
height: 36rpx;
border-radius:100%;
}
.info_box .user .name {
flex: 1;
font-family: PingFangSC-Regular;
font-size: 22rpx;
color: #999999;
font-weight: 400;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
margin-left: 8rpx;
}
.info_box .dian {
justify-content: flex-end;
}
.info_box .dian .img {
width: 24rpx;
margin-right: 12rpx;
}
.info_box .dian .num {
font-family: PingFangSC-Regular;
font-size: 26rpx;
color: #666666;
text-align: right;
font-weight: 400;
}
\ No newline at end of file \ No newline at end of file
{ {
"component": true, "component": true,
"usingComponents": {} "usingComponents": {"switch-block":"../switchBlock/switchBlock"}
} }
\ No newline at end of file \ No newline at end of file
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
"disablePlugins": [], "disablePlugins": [],
"outputPath": "" "outputPath": ""
}, },
"useIsolateContext": false, "useIsolateContext": true,
"userConfirmedBundleSwitch": false, "userConfirmedBundleSwitch": false,
"packNpmManually": false, "packNpmManually": false,
"packNpmRelationList": [], "packNpmRelationList": [],
......
const api = wx.$request
module.exports = {
/**上传图片 /1.0.0
*/
uploadImg(data) {
return api.post('dj.api.smartcarlife.common.uploadImg', data, ['file'])
},
// 视频上传接口
uploadVideo(data) {
return api.post('dj.api.smartcarlife.common.uploadVideo', data, ['file'])
},
// 视频上传接口(带视频封面返回)
UPLOADVIDEOWHITHIMAGECOVER(data) {
return api.post('dj.api.smartcarlife.common.uploadVideo.returnWithCover', data, ['file'])
},
// 发布种草信息、保存为草稿
SAVEGRASSINFO(data) {
return api.post('dj.api.smartcarlife.orderShareRecord.save', data)
},
// 获取所有的种草信息
GETORDERGRASSRECORD(data) {
return api.post('dj.api.smartcarlife.orderShareRecord.page', data)
},
// 获取商品列表
GETGOODSLIST(data) {
return api.post('dj.api.smartcarlife.goodsinfo.list', data)
},
// 获取所有园区
GETYQMERCHANTLIST(data) {
return api.post('dj.api.smartcarlife.yqMerchant.list', data)
},
// 获取种草详情
GETGRASSINFO(data) {
return api.post('dj.api.smartcarlife.orderShareRecord.detail', data)
},
// 获取订单商品种草统计
GETGOODSGRASSSTATIC(data) {
return api.post('dj.api.smartcarlife.orderGoods.orderShareRecordStatics', data)
},
// 点赞
GRASSGIVELIKE(data) {
return api.post('dj.api.smartcarlife.orderShareRecord.thumbUp', data)
},
// 删除晒单
REMOVEGRASSINFO(data) {
return api.post('dj.api.smartcarlife.orderShareRecord.remove', data)
},
}
\ No newline at end of file \ No newline at end of file
// tabGrass/pages/detail/index.js
import {
GETGRASSINFO,
REMOVEGRASSINFO,
GRASSGIVELIKE
} from '../../api'
Page({
/**
* 页面的初始数据
*/
data: {
swiperIndex: 0,
grassInfo: {},
avatar: '',
userInfo: {}
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.getAvatar()
this.getInfo(options)
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
// console.log('666666666')
// console.log(this.data.grassInfo)
// let _pages = getCurrentPages();
// let _prevPage = _pages[_pages.length - 2];
// _prevPage.setData({
// grassInfo: this.data.grassInfo
// })
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 监听滑动块
*/
onSwiperChange: function (e) {
console.log(e)
this.setData({
swiperIndex: e.detail.current
})
},
// 获取种草详情
getInfo(options) {
let oParams = {};
oParams.orderCode = options.code;
oParams.id = options.id
GETGRASSINFO(oParams).then(res => {
let _data = res.data || {}
_data.updatedDateTime = wx.$util.dateFormatter(_data.updatedDate)
this.setData({
grassInfo: _data
})
})
},
// 图片预览
imagePreview(e) {
let oParams = {};
oParams.urls = this.data.grassInfo.imgUrls || [];
oParams.current = e.currentTarget.dataset.index;
wx.previewImage(oParams)
},
// 删除种草
remove() {
let _this = this;
wx.showModal({
title: '提示',
content: '确认删除该种草信息吗?',
success(res) {
if (res.confirm) {
_this.removeGrass()
}
}
})
},
// 删除种草请求
removeGrass() {
let oParams = {};
let o = this.data.grassInfo;
oParams.id = o.id;
REMOVEGRASSINFO(oParams).then(res => {
if (res.code == 0) {
wx.showToast({
title: '删除成功',
icon: 'none',
success() {
setTimeout(function () {
wx.navigateBack({
delta: 1,
})
}, 1500)
}
})
}
})
},
// 种草点赞
goLike(e) {
let _this = this;
let oParams = {};
let status = e.currentTarget.dataset.status
let o = _this.data.grassInfo;
oParams.id = this.data.grassInfo.id
oParams.behaviorUserImg = this.data.avatar
oParams.behaviorType = status?2:1
o.hadThumbUp = !o.hadThumbUp;
if (!status) {
o.likesAmount += 1;
}
_this.setData({
grassInfo: o
})
GRASSGIVELIKE(oParams)
},
// 获取头像
getAvatar() {
let _this = this
let o = wx.$util.getStorageSync('dj_boutique_user_info');
console.log(o)
this.setData({
userInfo: o
})
// 判断是否有缓存用户头像
if (o.userAvatarUrl) {
this.setData({
avatar: o.userAvatarUrl
})
return false;
}
// 微信环境
if (!wx.canIUse('qy.getAvatar')) {
wx.getUserInfo({
success: function (res) {
var userInfo = res.userInfo
_this.setData({
avatar: userInfo.avatarUrl
})
}
})
return false;
}
// 没有缓存,则从企业微信中取
wx.qy.getAvatar({
success(res) {
_this.setData({
avatar: res.avatar
})
}
})
}
})
\ No newline at end of file \ No newline at end of file
{
"usingComponents": {},
"navigationBarTitleText": "商品种草"
}
\ No newline at end of file \ No newline at end of file
<!--我的种草-->
<view class="page">
<!-- banner 开始 -->
<view class="banner" wx:if="{{!grassInfo.videoUrl && grassInfo.imgUrls && grassInfo.imgUrls.length>0}}">
<view class="dot_box">{{swiperIndex+1}}/{{grassInfo.imgUrls.length}}</view>
<swiper indicator-dots="{{false}}" current="{{swiperIndex}}" class="swiper" bindchange="onSwiperChange">
<block wx:for="{{grassInfo.imgUrls||[]}}" wx:key="index">
<swiper-item class="swiper_item">
<view class="swiper_box">
<image src="{{item}}" class="img" mode="heightFix" data-index="{{grassInfo.imgUrls[swiperIndex]}}" bindtap="imagePreview">
</image>
</view>
</swiper-item>
</block>
</swiper>
</view>
<!-- banner end -->
<!-- 视频 开始 -->
<view class="banner" wx:if="{{grassInfo.videoUrl}}">
<video src="{{grassInfo.videoUrl}}" poster="{{grassInfo.videoCoverUrl}}" class="video_box"></video>
</view>
<!-- 视频 end -->
<!-- 文本内容 开始 -->
<view class="txt_content">
{{grassInfo.shareContent}}
</view>
<!-- 文本内容 end -->
<!-- 产品、门店 开始 -->
<view class="shop_box">
<text wx:for="{{grassInfo.topicNames}}" wx:key="index">#{{item}}</text>
</view>
<!-- 产品、门店 end -->
<!-- 用户信息 开始 -->
<view class="user_info">
<view class="left">
<view class="avatar">
<image src="{{grassInfo.shareUserImg}}" class="img" mode="widthFix" wx:if="{{grassInfo.shareUserImg}}"></image>
<image src="/images/user_avatar.png" class="img" mode="widthFix" wx:else></image>
</view>
<view class="name">{{grassInfo.shareUserName}}</view>
</view>
<view class="right">编辑于{{grassInfo.updatedDateTime}}</view>
</view>
<!-- 用户信息 end -->
<!-- 底部操作栏 开始 -->
<view class="footer">
<view class="remove">
<image src="/images/delete.png" mode="widthFix" class="img" bindtap="remove" wx:if="{{grassInfo.shareUserId == userInfo.id}}"></image>
</view>
<!-- 点赞信息 开始 -->
<view class="dian_box">
<image src="/images/dian_active.png" mode="widthFix" class="img" wx:if="{{grassInfo.hadThumbUp}}" data-status="{{grassInfo.hadThumbUp}}" bindtap="goLike"></image>
<image src="/images/dian.png" mode="widthFix" class="img" wx:else data-status="{{grassInfo.hadThumbUp}}" bindtap="goLike"></image>
<text>{{common.showLikeNumber(grassInfo.likesAmount)}}</text>
</view>
<!-- 点赞信息 end -->
</view>
<!-- 底部操作栏 end -->
</view>
<wxs src="/utils/index.wxs" module="common" />
\ No newline at end of file \ No newline at end of file
/* tabGrass/pages/detail/index.wxss */
.page {
padding-bottom: 120rpx;
}
.banner {
position: relative;
padding: 0 20rpx;
}
.banner .swiper {
position: relative;
height: 946rpx;
text-align: center;
}
.banner .swiper .img {
position: absolute;
height:100%;
max-height: 946rpx;
left:50%;
transform: translateX(-50%);
}
.banner .dot_box {
position: absolute;
top: 20rpx;
right: 40rpx;
z-index: 999;
width: 62rpx;
height: 46rpx;
background: #333333;
border-radius: 20rpx;
text-align: center;
line-height: 46rpx;
font-family: PingFangSC-Medium;
font-size: 24rpx;
color: #FFFFFF;
}
.banner .video_box {
height: 946rpx;
width: 100%;
}
.txt_content,
.shop_box,
.user_info,
.dian_box {
padding: 0 40rpx;
}
.txt_content {
margin-top: 46rpx;
font-family: PingFangSC-Medium;
font-size: 28rpx;
color: #333333;
font-weight: 500;
}
.shop_box {
margin: 20rpx 0;
font-family: PingFangSC-Medium;
font-size: 24rpx;
color: #FF6601;
font-weight: 500;
}
.shop_box text {
margin-right: 8rpx;
}
.user_info {
display: flex;
align-items: center;
justify-content: space-between;
font-family: PingFangSC-Regular;
}
.user_info .left {
width: 50%;
display: flex;
align-items: center;
font-size: 22rpx;
color: #999999;
}
.user_info .left .avatar {
flex-shrink: 0;
width: 36rpx;
height: 36rpx;
border-radius: 100%;
overflow: hidden;
margin-right: 20rpx;
}
.user_info .left .avatar .img {
width: 100%;
height: 100%;
}
.user_info .left .name {
flex: 1;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.user_info .right {
width: 50%;
font-size: 24rpx;
color: #666666;
text-align: right;
}
.dian_box {
display: flex;
align-items: center;
justify-content: flex-end;
font-family: PingFangSC-Regular;
font-size: 26rpx;
color: #666666;
text-align: right;
font-weight: 400;
/* margin: 120rpx 0 32rpx 0; */
}
.dian_box .img {
width: 42rpx;
margin-right: 12rpx;
}
.footer {
height: 100rpx;
background: #fff;
padding: 0 40rpx;
position: fixed;
left: 0;
right: 0;
bottom: 0;
display: flex;
align-items: center;
justify-content: space-between;
}
.footer .remove,
.footer.dian_box {
flex: 1;
}
.footer .remove .img {
width: 42rpx;
height: 42rpx;
}
\ No newline at end of file \ No newline at end of file
// tabIndex/pages/index/index.js
import {
GETORDERGRASSRECORD,
GETGOODSLIST,
GETYQMERCHANTLIST
} from '../../api.js'
Page({
/**
* 页面的初始数据
*/
data: {
searchText: '',
showDialog: false,
productList: [],
showProductList: [],
merchantList: [],
showMerchantList: [],
showList: [],
currentId: '',
productId: '',
productName: '',
merchantId: '',
merchantName: '',
currentPage: 1,
pageSize: 10,
list: [],
total: '',
isLast: false,
grassInfo: {}
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.getMechant()
this.getGoods()
wx.$util.getAvatarImage().then(res => {
wx.setStorageSync('userAvatar', res)
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
this.setData({
currentPage: 1,
list: [],
isLast: false,
productId: '',
productName: '',
merchantId: '',
merchantName: '',
})
this.getList()
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
console.log('666666');
this.getList()
},
/**
* 打开弹框
*/
openDialog: function (e) {
console.log(e);
this.setData({
showDialog: true,
currentId: e.currentTarget.dataset.name,
})
wx.hideTabBar()
},
// 关闭弹框
closeDialog: function () {
this.setData({
showDialog: false
})
wx.showTabBar()
},
// 监听输入框输入
onInput: function (e) {
let id = e.target.dataset.name
let o = {}
o[id] = e.detail.value;
this.setData(o)
},
// 选择商品
changeProduct(e) {
console.log(e)
let id = e.currentTarget.dataset.id;
let c = this.data.currentId;
let obj = {};
obj[c + 'Id'] = id;
obj[c + 'Name'] = e.currentTarget.dataset.name
obj.showDialog = false;
obj.isLast = false;
obj.currentPage = 1;
obj.list = [];
this.setData(obj)
this.getList();
wx.showTabBar()
},
// 查看种草详情
send: function (e) {
let row = e.currentTarget.dataset.row;
console.log(row);
wx.navigateTo({
url: '/tabGrass/pages/detail/index?id=' + row.id + '&code=' + row.orderCode
})
},
// 获取种草列表
getList: function () {
let oParams = {};
let isLast = this.data.isLast;
let pageNum = this.data.currentPage
oParams.currentPage = pageNum
oParams.pageSize = this.data.pageSize
if (this.data.productId) {
oParams.goodsCode = this.data.productId;
}
if (this.data.merchantId) {
oParams.merchantId = this.data.merchantId;
}
// 没有下一页
if (isLast) {
return false;
}
GETORDERGRASSRECORD(oParams).then(res => {
var obj = res.data || {};
let n = obj.list || []
let oList = this.data.list;
let nList = n
// 判断是否有下一页
console.log(oList.length + '---' + obj.total)
if (oList.length < obj.total) {
nList = oList.concat(n);
pageNum += 1;
} else {
isLast = true
nList = oList
}
this.setData({
list: nList,
total: obj.total,
currentPage: pageNum,
isLast: isLast
})
this.updateGrassInfo()
})
},
// 获取商品列表
getGoods: function () {
let _this = this;
GETGOODSLIST().then(res => {
let list = res.data || []
_this.setData({
productList: list,
showProductList: list
})
})
},
// 获取所有园区
getMechant: function () {
let _this = this;
GETYQMERCHANTLIST().then(res => {
let list = res.data || [];
_this.setData({
merchantList: list,
showMerchantList: list
})
})
},
// 本地搜索方法
filterMethod: function () {
if (this.data.currentId == 'merchant') {
this.filterMerchant()
} else {
this.filterGoods()
}
},
// 搜索商品
filterGoods() {
let txt = this.data.searchText;
let list = this.data.productList;
let n = list.filter(k => {
let idx = k.goodsName.indexOf(txt);
return idx >= 0
})
this.setData({
showProductList: n
})
},
// 搜索园区
filterMerchant() {
let txt = this.data.searchText;
let list = this.data.merchantList;
let n = list.filter(k => {
let idx = k.merchantName.indexOf(txt);
return idx >= 0
})
this.setData({
showMerchantList: n
})
},
// 更新 种草状态和点赞数
updateGrassInfo: function () {
let list = this.data.list;
let o = this.data.grassInfo;
let m = list.find(k => k.id == o.id);
if (!o.id) {
return false;
}
if (!m) {
return false;
}
console.log(list);
m.hadThumbUp = o.hadThumbUp;
m.likesAmount = o.likesAmount;
this.setData({
list: list
})
}
})
\ No newline at end of file \ No newline at end of file
{
"navigationStyle": "default",
"navigationBarTitleText": "商品种草",
"usingComponents": {
"grass-box": "../../../components/grass/index"
}
}
\ No newline at end of file \ No newline at end of file
<view class="page">
<!-- 搜索区域 开始 -->
<view class="menus_box {{showDialog?'menus_active':''}}">
<view class="menu" data-name="product" bindtap="openDialog">
<text>{{productName?common.showName(productName):'全部商品'}}</text>
<image src="/images/arrow_down.png" mode="widthFix" class="img"></image>
</view>
<view class="menu" data-name="merchant" bindtap="openDialog">
<text>{{merchantName?common.showName(merchantName):'所有园区'}}</text>
<image src="/images/arrow_down.png" mode="widthFix" class="img"></image>
</view>
</view>
<!-- 搜索区域 end -->
<!-- 内容区域 开始 -->
<view class="grass_box">
<view class="left_list">
<block wx:for="{{list}}" wx:key="index" data-row="{{item}}">
<grass-box grassInfo="{{item}}" wx:if="{{index%2 == 1}}"></grass-box>
</block>
</view>
<view class="right_list">
<block wx:for="{{list}}" wx:key="index" data-row="{{item}}">
<grass-box grassInfo="{{item}}" wx:if="{{index%2 == 0}}"></grass-box>
</block>
</view>
</view>
<!-- 内容区域 end -->
<!-- 暂无 数据 开始 -->
<view class="grass_box">
<view class="nodata" wx:if="{{total === 0}}">
<image src="../../../images/nodata.png" mode="widthFix" class="img"></image>
<view class="desc">暂无种草信息</view>
</view>
</view>
<!-- 暂无 数据 end -->
<!-- 搜索区域 弹框 开始 -->
<view class="search_dialog" wx:if="{{showDialog}}">
<view class="blk" bindtap="closeDialog"></view>
<view class="search_content">
<view class="search">
<view class="input_box">
<icon class="icon" type="search" size="12"></icon>
<input type="text" class="a_input" placeholder="请输入" placeholder-class="input_placeholder"
data-name="searchText" value="{{searchText}}" bindinput="onInput" />
</view>
<view class="search_btn" bindtap="filterMethod">搜索</view>
</view>
<view class="list_box" wx:if="{{currentId == 'product'}}">
<view class="li {{!productId?'active':''}}" data-name="全部商品" data-id="" bindtap="changeProduct">全部商品</view>
<view class="li {{item.goodsCode == productId?'active':''}}" wx:for="{{showProductList}}" wx:key="index"
data-name="{{item.goodsName}}" data-id="{{item.goodsCode}}" bindtap="changeProduct">{{item.goodsName}}</view>
</view>
<view class="list_box" wx:if="{{currentId == 'merchant'}}">
<view class="li {{!merchantId?'active':''}}" data-name="所有园区" data-id="" bindtap="changeProduct">所有园区</view>
<view class="li {{item.merchantId == merchantId?'active':''}}" wx:for="{{showMerchantList}}" wx:key="index"
data-name="{{item.merchantName}}" data-id="{{item.merchantId}}" bindtap="changeProduct">{{item.merchantName}}
</view>
</view>
</view>
</view>
<!-- 搜索区域 弹框 end -->
</view>
<wxs src="/utils/index.wxs" module="common" />
\ No newline at end of file \ No newline at end of file
/* tabIndex/pages/index/index.wxss */
page {
background-color: #F8F9F9;
height: 100vh;
}
.page {
padding: 88rpx 0 20rpx 0;
}
/* 搜索区域 */
.menus_box {
position: fixed;
left: 0;
right: 0;
top: 0;
background: #fff;
display: flex;
align-items: center;
height: 88rpx;
}
.menus_box .menu {
flex: 1;
display: flex;
align-items: center;
justify-content: center;
font-family: PingFangSC-Medium;
font-size: 28rpx;
color: #666666;
text-align: center;
font-weight: 500;
}
.menus_box .menu .img {
width: 14rpx;
margin-left: 8rpx;
}
.menus_active {
background: #F8F9F9;
}
/* 搜索弹框 */
.search_dialog .blk,
.search_dialog .search_content {
position: fixed;
top: 88rpx;
left: 0;
right: 0;
}
.search_dialog .blk {
background: #000;
opacity: 0.2;
z-index: 10;
bottom: 0;
}
.search_dialog .search_content {
z-index: 11;
background: #fff;
padding: 20rpx 0rpx;
}
.search_dialog .search_content .search {
padding: 0 40rpx;
}
.search_content .list_box {
max-height: 60vh;
overflow-y: auto;
}
.search_content .list_box .li {
position: relative;
font-family: PingFangSC-Regular;
font-size: 32rpx;
color: #888888;
font-weight: 400;
padding: 30rpx 40rpx;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.search_content .list_box .li:last-child:after {
display: none;
}
.search_content .list_box .li:after {
display: block;
position: absolute;
content: "";
height: 1rpx;
background: #EBEDF0;
left: 0;
right: 0;
bottom: 0;
transform: scaleY(0.5);
}
.search_content .list_box .active {
color: #3582EE;
}
.search {
display: flex;
align-items: center;
justify-content: space-between;
}
.search .search_btn {
flex-shrink: 0;
margin-left: 40rpx;
font-family: PingFangSC-Medium;
font-size: 32rpx;
color: #333333;
letter-spacing: 0;
text-align: center;
}
.search .input_box {
flex: 1;
display: flex;
align-items: center;
height: 72rpx;
background: #F7F8FA;
border-radius: 38rpx;
padding: 0 20rpx;
box-sizing: border-box;
}
.input_placeholder {
opacity: 0.89;
font-family: PingFangSC-Regular;
font-size: 28rpx;
color: #C8C9CC;
}
.search .input_box .a_input {
flex: 1;
padding-left: 8rpx;
font-family: PingFangSC-Regular;
font-size: 28rpx;
}
/* 内容区域 */
.grass_box {
display: flex;
flex-wrap: wrap;
flex-direction: row-reverse;
}
.grass_box .left_list,
.grass_box .right_list {
flex: 0 0 50%;
}
/* 暂无数据 */
.nodata {
width: 100%;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
text-align: center;
}
.nodata .img {
width: 200rpx;
height: 200rpx;
}
.nodata .desc {
font-family: PingFangSC-Regular;
font-size: 28rpx;
color: #606060;
text-align: center;
font-weight: 400;
margin-top: 60rpx;
letter-spacing: 2rpx;
}
\ No newline at end of file \ No newline at end of file
{
"usingComponents": {
"van-action-sheet": "../../../components/vant/action-sheet/index"
},
"navigationStyle": "custom",
"navigationBarTitleText": "发布种草"
}
\ No newline at end of file \ No newline at end of file
<!--发布种草-->
<navigation-bar bindnavbarReady="navbarReady" showBack="{{true}}" bindback="onBack">
发布种草
</navigation-bar>
<view class="page" style="margin-top:{{navBarHeight}}px">
<!-- <navigation-bar>
发布种草
</navigation-bar> -->
<!-- 内容区域 开 -->
<view class="release_box">
<!-- 输入 开始 -->
<textarea class="a_area" placeholder="输入内容" placeholder-class="area_placeholder" value="{{shareContent}}" data-name="shareContent" bindinput="onInput"></textarea>
<!-- 输入 end -->
<!-- 商品名称、门店 开始 -->
<view class="shop_box">
<text wx:for="{{topicNames}}" wx:key="index">#{{item}}</text>
</view>
<!-- 商品名称、门店 end -->
<!-- 上传图片、视频 开始 -->
<view class="upload_box">
<view class="img_box" wx:for="{{fileList}}" wx:key="index">
<image src="/images/close.png" class="close" mode="widthFix" data-url="{{item.path}}" bindtap="remove"></image>
<image src="{{item.url}}" class="img" data-url="{{item.path}}" bindtap="previewImage" wx:if="{{!hasVideo}}"></image>
<image src="{{videoCoverUrl}}" class="img" data-url="{{videoCoverUrl}}" bindtap="previewImage" wx:if="{{hasVideo}}"></image>
</view>
<view class="upload" bindtap="openActionSheet" wx:if="{{!hasVideo && fileList.length<9}}">
<image src="/images/plus.png" class="plus" mode="widthFix"></image>
</view>
</view>
<!-- 上传图片、视频 end -->
<!-- 时间戳 开始 -->
<view class="date_box">编辑于{{time}}</view>
<!-- 时间戳 end -->
</view>
<!-- 内容区域 end -->
<!-- 其他人发布 列表 开始 -->
<view class="other_list" wx:if="{{staticList && staticList.length>0}}">
<view class="title">其他人也发布过…</view>
<view class="swiper_list">
<swiper indicator-dots="{{false}}" current="{{swiperIndex}}" class="swiper" bindchange="onSwiperChange">
<block wx:for="{{staticList}}" wx:key="index">
<swiper-item class="swiper_item">
<view class="swiper_box">
<image src="/images/arrow_01.png" mode="widthFix" class="arrow"></image>
<view class="top">
<view class="avatar">
<image src="{{item.thumbUrl}}" class="img" wx:if="{{item.thumbUrl}}"></image>
<image src="/images/user_avatar.png" class="img" mode="widthFix" wx:else></image>
</view>
<view class="info">
<view class="name">{{item.goodsName}}</view>
<view class="sub">{{item.salesCount}}人已购买该商品</view>
<view class="desc">该商品累计产生{{item.shareRecordCount}}个种草内容。</view>
</view>
</view>
<view class="bottom">
<view class="left">
<view class="avatar_list">
<image wx:for="{{item.shareUserImgs||[]}}" wx:for-item="k" wx:for-index="idx" wx:key="idx" src="{{k||'/images/user_avatar.png'}}" class="img"></image>
</view>
<view class="">等{{item.shareUserCount}}人发布过</view>
</view>
<view class="time">{{item.lastShareDateTime}}</view>
</view>
</view>
</swiper-item>
</block>
</swiper>
<view class="dot_box">
<view class="dot {{swiperIndex == index?'active':''}}" wx:for="{{staticList}}" wx:key="index"></view>
</view>
</view>
</view>
<!-- 其他人发布 列表 end -->
<!-- 发布按钮 开始 -->
<view class="btn_group">
<button class="btn" bindtap="saveDraft">草稿</button>
<button class="btn_primary" bindtap="saveInfo">发布</button>
</view>
<!-- 发布按钮 end -->
<!-- 弹框 开始 -->
<van-action-sheet show="{{ showActionSheet }}" actions="{{ actionsList }}" cancel-text="取消" round="{{false}}" bind:select="onSelect" bind:cancel="closeActionSheet" bind:click-overlay="closeActionSheet" />
<!-- 弹框 end -->
</view>
\ No newline at end of file \ No newline at end of file
/* tabGrass/pages/release/index.wxss */
page {
background: #f8f9f9;
}
.page {
border-top: 1px solid #f8f9f9;
padding-bottom: 120rpx;
}
.release_box {
min-height: 680rpx;
background: #FFFFFF;
box-shadow: 0px 4rpx 20rpx 0px rgba(0, 0, 0, 0.1);
border-radius: 16rpx;
margin: 20rpx;
padding: 20rpx;
}
.release_box .a_area {
width: 100%;
height: 240rpx;
font-size: 24rpx;
font-family: PingFangSC-Regular;
color: #333333;
line-height: 1.8;
}
.shop_box {
position: relative;
font-family: PingFangSC-Regular;
font-size: 24rpx;
color: #333333;
font-weight: 400;
padding: 38rpx 0;
}
.shop_box text {
margin-right: 8rpx;
}
.shop_box:after {
display: block;
content: "";
height: 1rpx;
background: #c3c3c3;
position: absolute;
left: 0;
right: 0;
bottom: 0;
opacity: 0.5;
transform: scaleY(0.5);
}
.area_placeholder {
font-family: PingFangSC-Medium;
font-size: 28rpx;
color: #999999;
}
/* 上传区域 */
.upload_box {
padding: 40rpx 0;
display: flex;
align-items: center;
align-items: center;
flex-wrap: wrap;
}
.upload_box .img_box {
position: relative;
width: 172rpx;
height: 172rpx;
overflow: hidden;
margin: 0 12rpx 12rpx 0;
}
.upload_box .img_box .img {
width: 100%;
height: 100%;
}
.upload_box .video_box{
width:100vh;
height:200rpx;
}
.upload_box .img_box .close {
position: absolute;
width: 32rpx;
height: 32rpx;
top: 10rpx;
right: 10rpx;
z-index:2;
}
/*上传按钮*/
.upload {
width: 172rpx;
height: 172rpx;
background: #F7F7F7;
display: flex;
align-items: center;
justify-content: center;
margin: 0 12rpx 12rpx 0;
}
.upload .plus {
width: 32rpx;
}
/* 日期 */
.date_box {
text-align: right;
font-family: PingFangSC-Regular;
font-size: 24rpx;
color: #666666;
font-weight: 400;
}
/* 按钮区域 */
.btn_group {
position: fixed;
height: 100rpx;
background: #FFFFFF;
left: 0;
right: 0;
bottom: 0;
display: flex;
align-items: center;
padding: 0 32rpx;
}
.btn_group .btn,
.btn_group .btn_primary {
display:flex;
align-items: center;
justify-content: center;
height: 80rpx;
border-radius: 12rpx;
padding: 0;
box-sizing: border-box;
font-family: PingFangSC-Regular;
font-size: 28rpx;
text-align: center;
}
.btn_group .btn {
width: 186rpx;
color: #3582EE;
background: #FFFFFF;
border: 1rpx solid #0075F9;
margin: 0 20rpx 0 0;
}
.btn_group .btn_primary {
flex: 1;
background: #3582EE;
color: #FFFFFF;
}
/* 其他人发布列表 */
/* .other_list {
padding: 0 20rpx;
} */
.other_list .title {
font-family: PingFangSC-Regular;
font-size: 28rpx;
color: #424242;
font-weight: 400;
padding: 0 20rpx;
}
.swiper_list {
position: relative;
margin-top: 10px;
}
.swiper {
height: 360rpx;
/* background: #f8f9f9; */
border-radius: 8rpx;
}
.swiper_item {
padding: 10rpx 20rpx 50rpx 20rpx;
box-sizing: border-box;
}
.swiper_box {
position: relative;
height: 320rpx;
background: #FFFFFF;
box-shadow: 0px 4rpx 20rpx 0px rgba(0, 0, 0, 0.1);
border-radius: 8rpx;
padding: 20rpx;
box-sizing: border-box;
}
.swiper_box .arrow {
position: absolute;
width: 52rpx;
left: 20rpx;
top: -20rpx;
z-index: 999;
}
.swiper_box .top {
display: flex;
}
.swiper_box .top .avatar {
width: 200rpx;
height: 200rpx;
flex-shrink: 0;
}
.swiper_box .top .avatar .img {
width: 100%;
height: 100%;
}
.swiper_box .top .info {
flex: 1;
padding: 0 0 0 40rpx;
font-family: PingFangSC-Semibold;
color: #333333;
}
.swiper_box .top .info .name {
font-size: 28rpx;
color: #333333;
font-weight: 600;
margin: 20rpx 0;
}
.swiper_box .top .info .sub {
font-family: PingFangSC-Regular;
font-size: 24rpx;
margin: 20rpx 0;
}
.swiper_box .top .info .desc {
font-family: PingFangSC-Regular;
font-size: 24rpx;
color: #999999;
font-weight: 400;
}
.swiper_box .bottom {
position: relative;
padding: 20rpx 0;
margin: 20rpx 0;
display: flex;
align-items: center;
justify-content: space-between;
font-family: PingFangSC-Regular;
font-size: 24rpx;
color: #333333;
}
.swiper_box .bottom::before {
display: block;
content: "";
height: 1rpx;
background: #c3c3c3;
position: absolute;
left: 0;
right: 0;
top: 0;
opacity: 0.3;
transform: scaleY(0.5);
}
.swiper_box .bottom .left {
width: 60%;
display: flex;
align-items: center;
}
.swiper_box .bottom .time {
color: #999999;
}
.avatar_list .img {
width: 36rpx;
height: 36rpx;
border-radius: 100%;
position: relative;
margin-left: -20%;
}
.avatar_list .img:first-child {
margin: 0;
}
.dot_box {
position: relative;
display: flex;
align-items: center;
justify-content: center;
padding: 20rpx 0;
margin-top: -20rpx;
}
.dot_box .dot {
width: 10rpx;
height: 10rpx;
border-radius: 100%;
background: #d8d8d8;
margin: 0 4rpx;
}
.dot_box .active {
background: #3582EE;
}
\ No newline at end of file \ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!