Commit 5c8232c9 by 谢中龙

导购发布种草功能

parent 672d90c6
......@@ -94,7 +94,9 @@
"pages/moreCoupons/moreCoupons",
"pages/moreProducts/moreProducts",
"pages/couponWriteOff/couponWriteOff",
"pages/openCard/openCard"
"pages/openCard/openCard",
"pages/releaseContent/releaseContent",
"pages/selectProductList/selectProductList"
]
},
{
......
......@@ -81,6 +81,19 @@ Component({
if (e.currentTarget.dataset.currentType == 2) {
wxService.router(`/subPackage/page/pages/myReleaseDetail/myReleaseDetail?id=${e.currentTarget.dataset.id}`)
}
else if (e.currentTarget.dataset.currentType == 3){
//判断当前登录用户是不是有导购身份
let userInfo = wx.getStorageSync('_baseUserInfo') ? wx.getStorageSync('_baseUserInfo') : null;
if (!userInfo){
wxService.router(`/subPackage/page/pages/grassCommunity/grassCommunity?id=${e.currentTarget.dataset.id}`)
}
else if (!userInfo.member.qiyeInfo){
wxService.router(`/subPackage/page/pages/grassCommunity/grassCommunity?id=${e.currentTarget.dataset.id}`)
}
else{
wxService.router(`/shoppingGuid/page/pages/releaseContent/releaseContent?id=${e.currentTarget.dataset.id}`)
}
}
}
},
......
......@@ -6,7 +6,7 @@
// 修改 BRANCH_ID 为对应的商户id
// app.js 中brandId 修改为对应
const PROJECT_ENV = 'test' // 生产 prod, 开发 dev, 测试 test , 测试门户 test_store, 预生产 pre
const PROJECT_ENV = 'prod' // 生产 prod, 开发 dev, 测试 test , 测试门户 test_store, 预生产 pre
//仅生产环境时 配置 :
//3001 3001 , wx313ec36b710125d4
//2006 泰华 , wx40fec8944623c8b3
......@@ -24,7 +24,7 @@ const PROJECT_ENV = 'test' // 生产 prod, 开发 dev, 测试 test , 测试门
//2992 山东盛联微商城 wx53dedc202ae0d0c2
//2002 巴黎贝甜 wx21968cb3a486d4ab
const BRANCH_ID = 1002
const BRANCH_ID = 3001
const isMall = true
// const needMock = '' //
......@@ -326,7 +326,7 @@ const prod_brand_config = {
//2002 巴黎贝甜
2002 : {
appId: 'wx21968cb3a486d4ab',
tunnelToken: '2c626cb97cd05b635ae85ace7acb5608',
tunnelToken: '50a322b1d197d6213a2bbe75016da3d9',
brandId: 2002,
plusIsOpen: false,
contactUsIsOpen: false,
......
......@@ -51,6 +51,7 @@ wxService.page({
})
}
},
//申请退货
handelReturnGood() {
const {params} = this.data
// 退款申请
......
......@@ -13,7 +13,7 @@
},
"compileType": "miniprogram",
"libVersion": "2.8.2",
"appid": "wxac09792264c49b5c",
"appid": "wx313ec36b710125d4",
"projectname": "%E5%BE%AE%E5%95%86%E5%9F%8E",
"debugOptions": {
"hidedInDevtools": []
......@@ -43,7 +43,7 @@
"list": []
},
"miniprogram": {
"current": -1,
"current": 81,
"list": [
{
"id": -1,
......@@ -230,10 +230,10 @@
"scene": null
},
{
"id": 29,
"id": 28,
"name": "我的发布_种草详情",
"pathName": "subPackage/page/pages/myReleaseDetail/myReleaseDetail",
"query": "",
"query": "id=690150609835417600",
"scene": null
},
{
......@@ -588,6 +588,20 @@
"pathName": "subPackage/page/pages/categoryPro/categoryPro",
"query": "id=659088011908222976&name=盖浇饭哦",
"scene": null
},
{
"id": 81,
"name": "导购发布种草内容",
"pathName": "shoppingGuid/page/pages/releaseContent/releaseContent",
"query": "id=690150609835417600",
"scene": null
},
{
"id": -1,
"name": "选择商品",
"pathName": "shoppingGuid/page/pages/selectProductList/selectProductList",
"query": "",
"scene": null
}
]
}
......
......@@ -130,6 +130,19 @@ wxService.page({
},
//跳转到发布界面
onTapToReleaseContent(){
wx.navigateTo({
url: '/shoppingGuid/page/pages/releaseContent/releaseContent',
});
},
//跳转我的发布
onTapToMyRelease(){
wx.navigateTo({
url: '/subPackage/page/pages/myRelease/myRelease',
});
},
//跳转到我的会员列表
onTapToMyMemberList(){
wx.navigateTo({
......
......@@ -57,6 +57,18 @@
<image src='/assets/imgs/shoppingGuide/right.png' mode='aspectFit'></image>
</view>
</view>
<view class='list-item' bindtap='onTapToReleaseContent'>
<text>发布种草</text>
<view class='rec-number'>
<image src='/assets/imgs/shoppingGuide/right.png' mode='aspectFit'></image>
</view>
</view>
<view class='list-item' bindtap='onTapToMyRelease'>
<text>我的种草</text>
<view class='rec-number'>
<image src='/assets/imgs/shoppingGuide/right.png' mode='aspectFit'></image>
</view>
</view>
</view>
<!-- 月统计 -->
<view class='my-achive'>
......
......@@ -180,7 +180,7 @@ view{
}
.list-item text{
color: #999999;
color: #666666;
}
.achivement .list-item label{
......
// shoppingGuid/page/pages/releaseContent/releaseContent.js
const app = getApp()
const wxService = require('../../../../utils/wxService')
const utils = require('../../../../utils/util')
const envInfo = require('../../../../config/index').envInfo;
wxService.page({
/**
* 页面的初始数据
*/
data: {
uploadImgs : [],
videoUrl : '',
article : '',
headline : '',
//选择标签
showSelectTabModal : false,
tagsId : '',
tagName : '',
proGoods : [],
isRequesting : false,
id : null,
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.data.id = options.id ? options.id : null;
//如果id存在 则是编辑
if (this.data.id){
wx.setNavigationBarTitle({
title: '编辑种草',
});
this.getContentInfo();
}
wx.hideShareMenu();
},
//获取种草详情
getContentInfo(){
const { memberId } = wx.getStorageSync('_baseUserInfo')
let params = {
id: this.data.id,
userId: memberId
}
wxService.post(`/merchant/contentMobileTerminal/terminalContentDetails`, params).then(res => {
const { result, data } = res.data
if (result == 0) {
this.data.article = data.article;
this.data.headline = data.headline;
this.data.tagsId = data.tagsId;
this.data.tagsName = data.tagsName;
let sspList = data.sspList;
sspList.forEach(item => {
if(item.url){
this.data.uploadImgs.push(item.url);
}
if(item.videoUrl){
this.data.videoUrl = item.videoUrl;
}
});
this.setData({
uploadImgs: this.data.uploadImgs,
videoUrl: this.data.videoUrl,
article: this.data.article,
headline: this.data.headline,
//选择标签
tagsId: this.data.tagsId,
tagName: this.data.tagsName,
});
//获取商品数据去
let productIds = data.productIds ? data.productIds : [];
if (productIds.length > 0){
this.getProductsInfoByIds(productIds);
}
}
});
},
//获取商品信息根据商品ids
getProductsInfoByIds(productIds){
wxService.post(`/sale/product/buyer/listPage?pageNo=1&pageSize=${productIds.length + 1}`, {
productIds: productIds
}).then(res => {
const { result, data } = res.data;
if (result == 0){
let list = data.content ? data.content : [];
list.forEach(item => {
item.minSalePriceText = parseFloat(item.minSalePrice / 10 / 10).toFixed(2);
});
this.data.proGoods = list;
this.setData({
proGoods: this.data.proGoods
});
}
})
},
//输入数据事件
onInputChange(e){
this.data.headline = e.detail.value;
},
//删除
deleteImage(e){
this.data.uploadImgs.splice(e.target.dataset.index,1);
this.setData({
uploadImgs: this.data.uploadImgs
});
},
//输入
bindWordLimit(e){
var keyWord = e.detail.value
this.throttle(this.queryData, null, 400, keyWord)
},
//
queryData(e) {
this.data.article = e // 此处打印出来的就是 用户输入的值
},
//节流器
throttle(fn, context, delay, text){
clearTimeout(fn.timeoutId)
fn.timeoutId = setTimeout(function () {
fn.call(context, text)
}, delay)
},
//上传完video
_uploadVideo(e){
this.data.videoUrl = e.detail;
},
//删除video
_deleteVideo(e){
this.data.videoUrl = '';
},
//上传图片点击事件
uploadImg(){
let that = this;
let pics = this.data.uploadImgs;
var url = envInfo.ctx + '/merchant/upload/pic'
wx.chooseImage({
count: 5 - pics.length, // 最多可以选择的图片5张,
sizeType: ['original', 'compressed'], // original 原图,compressed 压缩图,默认二者都有
sourceType: ['album', 'camera'], // album 从相册选图,camera 使用相机,默认二者都有
success: function (res) {
var imgSrcs = res.tempFilePaths;
//直接调用上传,上传完成之后才显示图片
that.moreImgUpload({
url: url,//这里是你图片上传的接口
path: imgSrcs//这里是选取的图片的地址数组
});
},
fail: function () {
// fail
},
complete: function () {
// complete
}
})
},
//多图上传
moreImgUpload(params){
var that = this,
i = params.i ? params.i : 0,//当前上传的哪张图片
success = params.success ? params.success : 0,//上传成功的个数
fail = params.fail ? params.fail : 0;//上传失败的个数
wx.uploadFile({
url: params.url,
filePath: params.path[i],
header: {
'buyer-token': wx.getStorageSync('token')
},
name: 'imgs',//这里根据自己的实际情况改
formData: null,//这里是上传图片时一起上传的数据
success: (res) => {
if (res.statusCode == 200) {
var imgdata = JSON.parse(res.data);
var img = imgdata.data[0];
//图片上传成功,图片上传成功的变量+1
success ++;
that.data.uploadImgs.push(envInfo.imgCtx + img.url)
that.setData({
uploadImgs: that.data.uploadImgs
})
}
},
fail: (res) => {
fail++;//图片上传失败,图片上传失败的变量+1
},
complete: (res) => {
i++;
//若图片还没有传完,则继续调用函数
if (i != params.path.length) {
params.i = i;
params.success = success;
params.fail = fail;
that.moreImgUpload(params);
}
}
});
},
//选择完标签
//关联标签
_selectTab(e) {
this.setData({
tagsId : e.detail.id,
tagName: e.detail.name
})
},
//点击去选择商品
onTapToChooseProducts(){
wx.setStorageSync('guiderReleaseProducts', this.data.proGoods);
wx.navigateTo({
url: '/shoppingGuid/page/pages/selectProductList/selectProductList',
});
},
//选择标签
onTapChooseTag(){
this.setData({
showSelectTabModal: true
});
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
let chooseProducts = wx.getStorageSync('guiderReleaseProducts') ? wx.getStorageSync('guiderReleaseProducts') : [];
console.log(chooseProducts)
if(chooseProducts.length > 0){
this.setData({
proGoods: chooseProducts,
})
}
else{
this.setData({
proGoods: [],
});
}
},
//移除
onTapRemove(e){
let _this = this;
let index = e.currentTarget.dataset.index;
wx.showModal({
title: '移除关联商品提示',
content: '确认移除此关联商品?',
showCancel: true,
cancelText: '取消',
confirmText: '移除',
confirmColor: '#cb3c3c',
success: function (modalRes) {
if (modalRes.confirm) {
_this.data.proGoods.splice(index,1);
_this.setData({
proGoods: _this.data.proGoods
});
}
}
});
},
//确认发布
onTapPublish(){
// 防止用点击太快
if(this.data.isRequesting){
wx.showToast({
title: '您点的太快啦~',
icon : 'none'
});
return ;
}
if(!this.data.headline){
wx.showToast({
title: '请输入内容标题',
icon : 'none'
});
return;
}
if (!this.data.article) {
wx.showToast({
title: '请设置内容信息',
icon: 'none'
});
return;
}
//处理视频和图片
let sspList = [];
this.data.uploadImgs.forEach(item => {
sspList.push({
cover : 0,
url: item
});
});
//处理视频
if(this.data.videoUrl){
sspList.push({
cover: 0,
videoUrl: item
});
}
if (sspList.length == 0){
wx.showToast({
title: '请上传至少一张图片/视频',
icon: 'none'
})
return;
}
//找到第一个图片设为主图
let isFirst = 0;
sspList.forEach(item => {
if (isFirst == 0 && item.url){
item.cover = 1;
count++
}
else{
item.cover = 0;
}
});
//获取商品
let checkedProducts = [];
this.data.proGoods.forEach(item => {
checkedProducts.push({
commodityId: item.productId
});
});
this.data.isRequesting = true;
const { memberId } = wx.getStorageSync('_baseUserInfo')
let param = {};
param.article = this.data.article;
param.headline = this.data.headline;
param.sspList = this.data.sspList;
param.stcList = this.data.checkedProducts;
param.tagsId = this.data.tagsId;
param.userId = memberId;
param.id = this.data.id;
wxService.post(`/merchant/contentMobileTerminal/contentSave`,param).then(res => {
if(res){
if(res.data.result == 0){
wx.showToast({
title: '发布成功',
});
wx.redirectTo({
url: '/subPackage/page/pages/myRelease/myRelease',
});
}
}
}).catch(err => {
this.data.isRequesting = false;
wx.showToast({
title: '发布失败,请稍后重试',
icon : 'none'
});
});
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
wx.removeStorageSync('guiderReleaseProducts');
},
})
\ No newline at end of file
{
"navigationBarTitleText": "发布种草",
"usingComponents": {
"upload-img": "/component/uploadImg/uploadImg",
"upload-video": "/component/uploadVideo/uploadVideo",
"select-tab": "/component/selectTab/selectTab",
"grass-item": "/component/grassItem/grassItem"
}
}
\ No newline at end of file
<!--shoppingGuid/page/pages/releaseContent/releaseContent.wxml-->
<!-- 顶部布局信息 -->
<view class='main-container'>
<view class='title'>
<view class='title-text'>
<input placeholder="请输入种草内容标题.." bindinput='onInputChange' data-key="headline" value="{{headline}}" />
</view>
</view>
<view class='pub-textarea'>
<textarea
bindblur="bindWordLimit"
class='textarea-text'
value="{{article}}"
auto-height
placeholder="这一刻想说什么..." />
</view>
<view class="page-upload-img">
<view class="flex-wrp">
<view class="flex-item" wx:for="{{uploadImgs}}" wx:key="*this" wx:for-index="index" wx:for-item="item">
<icon size="16" type="clear" bindtap="deleteImage" data-index="{{index}}" />
<image class="item-img" src="{{item}}" />
</view>
<view class="flex-item" hidden="{{pics.length >= 5}}">
<view class="upload-wrap" bindtap="uploadImg">
<view class="upload-text">+图片</view>
</view>
</view>
<view class="flex-item">
<upload-video bind:_uploadVideo="_uploadVideo" bind:_deleteVideo="_deleteVideo" video="{{videoUrl}}"/>
</view>
</view>
<view class="upload-tip">*只支持.jpg、png、gif、kpge格式图片/ .mp4、m3u8格式视频,最长60s</view>
</view>
<!-- items -->
<view class='list-items'>
<view class='items' bindtap='onTapChooseTag'>
<view class='label'>
<image src='/assets/imgs/7_1_0/relation.png' mode='aspectFit'></image>
选择标签
</view>
<view class='tag-name'>
<view class='t-name' wx:if="{{tagName}}">{{tagName}}</view>
</view>
<view class='icon'>
<image src='/assets/imgs/arrow-right.png' mode='aspectFit'></image>
</view>
</view>
<view class='items' bindtap='onTapToChooseProducts'>
<view class='label'>
<image src='/assets/imgs/7_1_0/relation.png' mode='aspectFit'></image>
关联商品
</view>
<view class='tag-name'>
<view class='t-name'>已选择 <label>{{proGoods.length}}</label>个商品</view>
</view>
<view class='icon'>
<image src='/assets/imgs/arrow-right.png' mode='aspectFit'></image>
</view>
</view>
<!-- 选择的商品 -->
<view wx:if="{{proGoods.length > 0}}">
<view class='product-list' wx:if="{{proGoods.length > 0}}">
<view class='product-item'
wx:for="{{proGoods}}"
wx:key="*this"
wx:for-item="item"
wx:for-index="idx">
<view class='product-info'>
<image src='{{item.indexUrl}}' mode='aspectFit' lazy-load></image>
<view class='rg-pro-info'>
<view class='pro-name'>{{item.productName}}</view>
<view class='product-price'>¥ <label>{{item.minSalePriceText}}</label></view>
</view>
</view>
<view class='check-icon' data-index="{{idx}}" bindtap='onTapRemove'>
<icon size='25' type='cancel'></icon>
</view>
</view>
</view>
</view>
</view>
</view>
<!-- 选择标签 -->
<select-tab showSelectTabModal="{{showSelectTabModal}}" bind:_selectTab="_selectTab" />
<!-- 底部按钮 -->
<view class='bottom-btns' bindtap='onTapPublish'>确认发布</view>
\ No newline at end of file
/* shoppingGuid/page/pages/releaseContent/releaseContent.wxss */
page{
background: #f2f2f2;
box-sizing: border-box;
-webkit-box-sizing: border-box;
}
view{
box-sizing: border-box;
-webkit-box-sizing: border-box;
}
.title{
width: 100%;
background: #ffffff;
padding: 20rpx;
margin-bottom: 10rpx;
margin-top: 10rpx;
color: #333333;
font-size: 28rpx;
}
.pub-textarea{
background: #ffffff;
padding: 20rpx;
min-height: 260rpx;
margin-bottom: 10rpx;
}
.pub-textarea .textarea-text{
width: 100%;
height: 100%;
border: none;
color: #333333;
font-size: 28rpx;
}
.page-upload-img{
margin-bottom: 10rpx;
padding: 20rpx;
background: #ffffff;
}
.flex-wrp {
width: 100%;
height: 100%;
display: flex;
flex-wrap: wrap;
flex-direction: row;
}
.upload-wrap{
border-radius: 5rpx;
border: 1px solid rgba(216, 216, 216, 1);
line-height: 160rpx;
text-align: center;
}
.upload-text{
color: #aaaaaa;
}
.upload-img{
width: 160rpx;
height: 160rpx;
border: 1px solid rgba(216, 216, 216, 1);
}
.upload-img-wrap{
margin-right: 20rpx;
}
.item-img {
width: 100%;
height: 160rpx;
}
.flex-item {
margin-bottom: 20rpx;
width: 21%;
height: 160rpx;
margin-right: 20rpx;
position: relative;
}
.flex-item icon {
position: absolute;
right: -10rpx;
top: -10rpx;
background: #ffffff;
border-radius: 50%;
}
.relate-img{
width: 23rpx;
margin-right: 10rpx;
vertical-align: middle;
}
.relate-text{
color: rgba(0, 0, 0, 1);
font-size: 26rpx;
font-family: PingFangSC-Medium;
vertical-align: middle;
}
.upload-tip {
height: 28prx;
color: rgba(170, 170, 170, 1);
font-size: 20rpx;
text-align: left;
font-family: PingFangSC-Regular;
}
.list-items{
width: 100%;
height: auto;
padding: 0 20rpx;
background: #ffffff;
}
.list-items .items{
padding: 20rpx 0;
border-bottom: solid 1rpx #dddddd;
display: flex;
align-items: center;
font-size: 28rpx;
color: #333333;
}
.list-items .items:last-child{
border-bottom: none;
}
.list-items .items .label{
flex: 0;
min-width: 160rpx;
max-width: 160rpx;
display: flex;
align-items: center;
font-size: #666666;
}
.list-items .items .label image{
width: 26rpx;
height: 26rpx;
margin-right: 8rpx;
}
.list-items .items .icon{
flex: 0;
min-width: 30rpx;
max-width: 30rpx;
}
.list-items .items .icon image{
width: 20rpx;
height: 24rpx;
}
.list-items .items .tag-name{
flex: 1;
display: flex;
justify-content: flex-end;
padding: 0 20px;
}
.list-items .items .tag-name .t-name{
height: 32rpx;
display: flex;
align-items: center;
justify-content: center;
font-size: 22rpx;
padding: 0 10rpx;
background: rgba(203, 60, 60, 0.2);
color: rgba(203, 60, 60, 1);
border-radius: 5rpx;
}
.list-items .items .tag-name .t-name label{
font-weight: bold;
}
.product-list{
background: #ffffff;
padding: 0 20rpx;
}
.product-list .product-item{
padding: 20rpx 0;
display: flex;
border-bottom: solid 1rpx #eeeeee;
}
.product-list .product-item:last-child{
border-bottom: none;
}
.product-list .product-item .product-info{
flex: 1;
display: flex;
}
.product-list .product-item .product-info image{
flex: 0;
min-width: 120rpx;
max-width: 120rpx;
height: 120rpx;
}
.product-list .product-item .product-info .rg-pro-info{
flex: 1;
padding-left: 20rpx;
display: flex;
flex-direction: column;
justify-content: space-around;
}
.product-list .product-item .product-info .rg-pro-info .pro-name{
font-size: 24rpx;
color: #333333;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
overflow: hidden;
}
.product-list .product-item .product-info .rg-pro-info .product-price{
color: rgba(203, 60, 60, 1);
font-size: 22rpx;
}
.product-list .product-item .product-info .rg-pro-info .product-price label{
font-size: 30rpx;
font-weight: bold;
}
.product-list .product-item .check-icon{
flex: 0;
min-width: 80rpx;
max-width: 80rpx;
display: flex;
align-items: center;
justify-content: center;
}
.product-list .product-item .check-icon .icons{
width: 40rpx;
height: 40rpx;
border-radius: 50%;
border: solid 2rpx rgba(203, 60, 60, 1);
display: flex;
justify-content: center;
align-items: center;
}
.product-list .product-item .check-icon image{
width: 40rpx;
height: 40rpx;
}
.bottom-btns{
position: fixed;
z-index: 2;
width: 100%;
height: 90rpx;
left: 0;
bottom: 0;
background: rgba(203, 60, 60, 1);
color: #ffffff;
font-size: 28rpx;
display: flex;
align-items: center;
justify-content: center;
}
.bottom-btns:active{
opacity: 0.7;
}
\ No newline at end of file
// shoppingGuid/page/pages/selectProductList/selectProductList.js
const app = getApp()
const wxService = require('../../../../utils/wxService')
const utils = require('../../../../utils/util')
const envInfo = require('../../../../config/index').envInfo;
wxService.page({
/**
* 页面的初始数据
*/
data: {
productName : '',
pageNo : 1,
pageSize : 10,
totalPages : 0,
productList : [],
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.getProductList();
wx.hideShareMenu();
},
//商品名称改变
onProductNameChange(e){
this.data.productName = e.detail.value;
},
//查询
onTapFilter(){
this.data.pageNo = 1;
this.data.totalPages = 0;
this.data.productList = [];
this.getProductList();
},
//选择商品
onTapChooseProduct(e){
let index = e.currentTarget.dataset.index;
this.data.productList[index].checked = !this.data.productList[index].checked;
this.setData({
productList: this.data.productList
});
},
//获取商品列表
getProductList(refresh){
wxService.post(`/sale/product/buyer/listPage?pageNo=${this.data.pageNo}&pageSize=${this.data.pageSize}`, {
productName: this.data.productName
}).then(res => {
if(res){
let list = res.data.data.content ? res.data.data.content : [];
list.forEach(item => {
item.checked = false;
item.minSalePriceText = parseFloat(item.minSalePrice/10/10).toFixed(2);
});
this.data.productList = this.data.productList.concat(list);
this.handlerChecked();
this.data.totalPages = res.data.data.totalPages ? res.data.data.totalPages : 0;
this.setData({
productList: this.data.productList
});
}
if (refresh){
wx.stopPullDownRefresh();
wx.showToast({
title: '刷新成功!',
});
}
});
},
//处理选中
handlerChecked(){
let checkedProduct = wx.getStorageSync('guiderReleaseProducts') ? wx.getStorageSync('guiderReleaseProducts') : [];
if (checkedProduct.length != 0){
checkedProduct.forEach(item => {
let filter = this.data.productList.filter(c => c.productId == item.productId);
if (filter.length > 0){
filter.forEach(f => {
f.checked = true;
});
}
});
}
},
//选择完成
onTapChooseOk(e){
//找到已选中的
let checkedProducts = this.data.productList.filter(item => item.checked);
if (checkedProducts.length == 0){
wx.showToast({
title: '请选择关联商品',
icon : 'none',
});
return ;
}
wx.setStorageSync('guiderReleaseProducts', checkedProducts)
wx.navigateBack({
delta : 1
});
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
this.data.pageNo = 1;
this.data.totalPages = 0;
this.data.productList = [];
this.getProductList(true);
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
if(this.data.pageNo < this.data.totalPages){
this.data.pageNo ++ ;
this.getProductList();
}
else{
if(this.data.pageNo > 1){
wx.showToast({
title: '没有更多商品了',
icon : 'none'
});
}
}
},
});
\ No newline at end of file
{
"navigationBarTitleText": "选择商品",
"enablePullDownRefresh": true,
"usingComponents": {
"empty": "../../../../component/empty/empty"
}
}
\ No newline at end of file
<!--shoppingGuid/page/pages/selectProductList/selectProductList.wxml-->
<!-- 搜索栏 -->
<view class='filter-bar'>
<input placeholder='请输入商品名称查询' value='{{productName}}' bindinput='onProductNameChange'></input>
<text class='order-search' bindtap='onTapFilter'>搜索</text>
</view>
<!-- 商品列表 -->
<view class='product-list' wx:if="{{productList.length > 0}}">
<view class='product-item'
wx:for="{{productList}}"
bindtap='onTapChooseProduct'
wx:key="*this"
data-index="{{idx}}"
wx:for-item="item"
wx:for-index="idx">
<view class='product-info'>
<image src='{{item.indexUrl}}' mode='aspectFit' lazy-load></image>
<view class='rg-pro-info'>
<view class='pro-name'>{{item.productName}}</view>
<view class='product-price'>¥ <label>{{item.minSalePriceText}}</label></view>
</view>
</view>
<view class='check-icon'>
<view class='icons' wx:if="{{!item.checked}}"></view>
<image src='/assets/imgs/7_1_0/trade-success.png' wx:if="{{item.checked}}" mode='aspectFit'></image>
</view>
</view>
</view>
<!-- 空1 -->
<empty text="未找到任何商品数据~" wx:else/>
<!-- bottom -->
<view class='bottom-fix' bindtap='onTapChooseOk'>选好了</view>
\ No newline at end of file
/* shoppingGuid/page/pages/selectProductList/selectProductList.wxss */
page{
background: #f2f2f2;
box-sizing: border-box;
-webkit-box-sizing: border-box;
padding-top: 110rpx;
padding-bottom: 100rpx;
}
view{
box-sizing: border-box;
-webkit-box-sizing: border-box;
}
.filter-bar {
background-color:rgba(246, 246, 246, 1);
width: 100%;
height: 100rpx;
padding: 20rpx;
display: flex;
position: fixed;
top: 0;
left: 0;
z-index: 8;
}
.filter-bar input{
flex: 1;
height:60rpx;
border-radius:5rpx;
background-color:rgba(255, 255, 255, 1);
margin-right: 20rpx;
padding: 0 10rpx;
font-size: 24rpx;
}
.order-search {
flex: 0;
min-width: 122rpx;
max-width: 122rpx;
height:60rpx;
line-height:60rpx;
border-radius:5rpx;
background-color:rgba(203, 60, 60, 1);
color:rgba(255, 255, 255, 1);
font-size:28rpx;
font-family:PingFangSC-Regular;
text-align:center;
}
.product-list{
background: #ffffff;
padding: 0 20rpx;
}
.product-list .product-item{
padding: 20rpx 0;
display: flex;
border-bottom: solid 1rpx #eeeeee;
}
.product-list .product-item:last-child{
border-bottom: none;
}
.product-list .product-item .product-info{
flex: 1;
display: flex;
}
.product-list .product-item .product-info image{
flex: 0;
min-width: 120rpx;
max-width: 120rpx;
height: 120rpx;
}
.product-list .product-item .product-info .rg-pro-info{
flex: 1;
padding-left: 20rpx;
display: flex;
flex-direction: column;
justify-content: space-around;
}
.product-list .product-item .product-info .rg-pro-info .pro-name{
font-size: 24rpx;
color: #333333;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
overflow: hidden;
}
.product-list .product-item .product-info .rg-pro-info .product-price{
color: rgba(203, 60, 60, 1);
font-size: 22rpx;
}
.product-list .product-item .product-info .rg-pro-info .product-price label{
font-size: 30rpx;
font-weight: bold;
}
.product-list .product-item .check-icon{
flex: 0;
min-width: 80rpx;
max-width: 80rpx;
display: flex;
align-items: center;
justify-content: center;
}
.product-list .product-item .check-icon .icons{
width: 40rpx;
height: 40rpx;
border-radius: 50%;
border: solid 2rpx rgba(203, 60, 60, 1);
display: flex;
justify-content: center;
align-items: center;
}
.product-list .product-item .check-icon image{
width: 40rpx;
height: 40rpx;
}
.bottom-fix{
position: fixed;
z-index: 8;
left: 0;
bottom: 0;
height: 90rpx;
background: rgba(203, 60, 60, 1);
color: #ffffff;
font-size: 28rpx;
display: flex;
align-items: center;
justify-content: center;
width: 100%;
}
.bottom-fix:active{
opacity: 0.7;
}
\ No newline at end of file
......@@ -72,6 +72,13 @@ wxService.page({
});
},
//导购发布种草内容
onTapToReleaseContent(){
wx.navigateTo({
url: '/shoppingGuid/page/pages/releaseContent/releaseContent',
});
},
//点击事件
//分类点击
onTapChangeCouponType(e) {
......
......@@ -129,4 +129,9 @@
<text>微信好友</text>
</view>
</button>
</view>
\ No newline at end of file
</view>
<!-- 发布 -->
<!-- <view class="add" bindtap='onTapToReleaseContent'>
<image src="/assets/imgs/icon_plus.png" mode="aspectFit"></image>
</view> -->
\ No newline at end of file
......@@ -402,4 +402,26 @@ view{
width: 80rpx;
height: 80rpx;
margin-bottom: 5rpx;
}
.add{
width: 82rpx;
height: 82rpx;
background-color: rgba(203, 60, 60, 1);
border-radius: 50%;
font-size: 60rpx;
color: #ffffff;
position: fixed;
right: 22rpx;
bottom: 330rpx;
/* bottom: 35rpx; */
z-index: 99;
display: flex;
justify-content: center;
align-items: center;
}
.add image{
width: 45rpx;
height: 45rpx;
}
\ No newline at end of file
......@@ -33,14 +33,21 @@ wxService.page({
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
console.log(options)
if (options && options.id) {
wx.setNavigationBarTitle({
title: '编辑种草',
});
this.setData({
'params.id': options.id
}, () => {
this.getInitInfo()
})
}
else{
wx.setNavigationBarTitle({
title: '发布种草',
});
}
},
/**
......
{
"navigationBarTitleText": "种草专区",
"navigationBarTitleText": "发布种草",
"usingComponents": {
"upload-img": "/component/uploadImg/uploadImg",
"upload-video": "/component/uploadVideo/uploadVideo",
......
......@@ -46,7 +46,7 @@
color: #ffffff;
position: fixed;
right: 22rpx;
bottom: 357rpx;
bottom: 230rpx;
/* bottom: 35rpx; */
z-index: 99;
display: flex;
......
......@@ -61,6 +61,20 @@ wxService.page({
showDialig: true
})
},
//编辑
onTapEdit(e){
let id = e.currentTarget.dataset.item.id;
let userInfo = wx.getStorageSync('_baseUserInfo') ? wx.getStorageSync('_baseUserInfo') : null;
if (!userInfo) {
wxService.router(`/subPackage/page/pages/grassCommunity/grassCommunity?id=${id}`)
}
else if (!userInfo.member.qiyeInfo) {
wxService.router(`/subPackage/page/pages/grassCommunity/grassCommunity?id=${id}`)
}
else {
wxService.router(`/shoppingGuid/page/pages/releaseContent/releaseContent?id=${id}`)
}
},
//获取内容第一个图片
getImageInSspList() {
......
......@@ -51,10 +51,10 @@
<view class="weui-flex df-j--bt action border_box">
<view class="weui-flex">
<view class="action-del" bindtap="handleDel"> 删除 </view>
<navigator url="/subPackage/page/pages/grassCommunity/grassCommunity?id={{contentInfo.id}}" hover-class="none">
<view class="action-edit"> 编辑 </view>
</navigator>
<view class="action-edit" bindtap='onTapEdit' data-item="{{contentInfo}}"> 编辑 </view>
<!-- <navigator url="/subPackage/page/pages/grassCommunity/grassCommunity?id={{contentInfo.id}}" hover-class="none">
</navigator> -->
</view>
<navigator url="/subPackage/page/pages/orderBenefit/orderBenefit?id={{contentInfo.id}}" hover-class="none">
<view class="action-check"> 查看收益 </view>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment