Commit 612ecd06 by 赵雅纹

update

parent 695ed67a
// component/selectRelatedGoods/selectRelatedGoods.js
var app = getApp()
const wxService = require('../../utils/wxService')
const utils = require('../../utils/util')
const envInfo = require('../../config/index').envInfo
Component({
/**
* 组件的属性列表
*/
properties: {
show: { // 显示标识
type: Boolean,
value: false
},
proGoods: { // 显示标识
type: Array,
value: ''
}
},
/**
* 组件的初始数据
*/
data: {
proList: [],
proData: [],
productName: ''
},
observers: {
proGoods(val) {
for (var i in this.data.proList) {
for (var j in val) {
if (this.data.proList[i].productId == val[j].productId) {
this.data.proList[i].isSelect = true
}
this.setData({
proList: this.data.proList
})
}
}
},
show() {
const { show } = this.data
if (show) {
wxService.nextTick(() => {
this.getProList();
})
}
}
},
/**
* 组件的方法列表
*/
methods: {
hidePopup: function () { // 隐藏弹出框
this.setData({
show: false
})
},
_selectCoupon(e) {
console.log(e)
this.setData({
proData: e.detail
})
},
confirm() {
if (this.data.proData.length < 1) {
wx.showToast({
title: '请选择关联商品',
icon: 'none'
})
return false;
}
this.setData({
show: false
})
wxService.nextTick(() => {
this.triggerEvent('_selectGoods', this.data.proData)
})
},
// 点击键盘完成时触发
onTapConfirm(e) {
this.setData({
productName: e.detail.value
})
},
// 搜索商品search
search() {
if (!this.data.productName) {
wx.showToast({
title: '请输入商品名称',
icon: 'none'
})
return false
}
this.getProList()
},
// 商品列表
getProList() {
wxService.post(`/sale/product/buyer/listWithMember`, {
productName: this.data.productName
}).then(res => {
const { result, data } = res.data
if (result == 0) {
data.forEach(item => {
item.isSelect = false
})
this.setData({
proList: data
})
console.log(data)
}
}).finally(() => {
})
}
},
})
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
<view class="modal-container{{show ? ' active' : ''}}" bindtap="hidePopup" />
<view class="modal-content{{show ? ' active' : ''}}">
<view class="modal-header">
<image src="/assets/imgs/7_1_0/arrow-right.png" class="modal-to-back" mode="widthFix" bindtap="hidePopup" />
<text class="modal-title">选择订单商品</text>
<image
class="modal-close"
mode="widthFix"
src="/assets/imgs/7_1_0/close.png"
bindtap="hidePopup"
/>
</view>
<view class="modal-info">
<view class="order-input weui-flex weui-progress">
<input class="order-name border_box" placeholder=" 请输入商品名称" value="{{productName}}" bindblur="onTapConfirm"/>
<text class="order-search" bindtap="search">搜索</text>
</view>
<view class="coupon-list">
<relate-order-item wx:if="{{proList && proList.length > 0}}" bind:_selectCoupon="_selectCoupon" selectShow="{{show}}" proList="{{proList}}" />
</view>
<view class="empty-coupon" wx:if="{{!proList || proList.length < 1}}">
暂无订单商品哦~
</view>
</view>
<view class="post-notes fixed-bottom0" bindtap="confirm">确认添加</view>
</view>
/* component/selectTab/selectTab.wxss */
@import '/app.wxss';
@import './../../base/base.wxss';
.order-input {
height: 112rpx;
line-height: 112rpx;
background-color: rgba(246, 246, 246, 1);
}
.order-name {
width: 550rpx;
height: 60rpx;
border-radius: 5rpx;
margin: 0 20rpx;
background-color: rgba(255, 255, 255, 1);
}
.order-search {
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;
text-align: left;
font-family: PingFangSC-Regular;
text-align: center;
}
.modal-container {
position: fixed;
width: 100%;
height: 100%;
top: 0;
left: 0;
background: rgba(0, 0, 0, 0.5);
transform: translateY(100%);
opacity: 0;
transition: opacity 200ms;
z-index: 98;
}
.post-notes {
text-align: center;
height: 88rpx;
line-height: 88rpx;
background-color: rgba(203, 60, 60, 1);
color: rgba(255, 255, 255, 1);
font-size: 25rpx;
font-family: PingFangSC-Medium;
}
.modal-container.active {
opacity: 1;
transform: translateY(0);
}
.modal-content.active {
transform: translateY(0);
}
.modal-content {
position: fixed;
z-index: 99999;
width: 100%;
bottom: 0;
left: 0;
background: #ffffff;
transition: transform 300ms;
transform: translateY(100%);
height: 1000rpx;
}
.modal-content .modal-close {
position: absolute;
right: 24rpx;
top: 35rpx;
width: 25rpx;
}
.modal-to-back {
width: 18rpx;
position: absolute;
left: 24rpx;
top: 35rpx;
transform: rotate(180deg);
}
.modal-title {
color: #333333;
font-size: 32rpx;
position: absolute;
left: 295rpx;
top: 28rpx;
}
.coupon-list {
width: 702rpx;
height: 174rpx;
position: relative;
margin-bottom: 25rpx;
}
.modal-info {
padding: 0 24rpx;
margin-top: 95rpx;
}
.modal-info {
min-height: 900rpx;
overflow: scroll;
}
.empty-coupon {
width: 100%;
color: #aaaaaa;
margin-top: 211rpx;
text-align: center;
}
.coupon-radio {
width: 32rpx;
height: 32rpx;
border-radius: 50%;
border: 1rpx solid rgba(0, 0, 0, 0.2);
line-height: 26rpx;
text-align: center;
}
.tick-success {
width: 18rpx;
}
.select-radio {
position: absolute;
top: 71rpx;
right: 30rpx;
}
.theme-color {
border: none;
}
...@@ -25,6 +25,10 @@ ...@@ -25,6 +25,10 @@
<view class="title-border"> <view class="title-border">
<input placeholder="这一刻想说什么..." name="article" value="{{params.article}}" /> <input placeholder="这一刻想说什么..." name="article" value="{{params.article}}" />
</view> </view>
<view class="title-border">
<image class="tab-icon" src="/assets/imgs/7_1_0/tab.png"></image>
<input class="tab-input" placeholder="选择标签" name="article" value="{{params.article}}" />
</view>
<view class="related-goods" bindtap="handleRelatedGoods"> <view class="related-goods" bindtap="handleRelatedGoods">
<image class="relate-img" mode="widthFix" src="/assets/imgs/7_1_0/relation.png"></image> <image class="relate-img" mode="widthFix" src="/assets/imgs/7_1_0/relation.png"></image>
......
...@@ -31,9 +31,17 @@ page{ ...@@ -31,9 +31,17 @@ page{
line-height: 66rpx; line-height: 66rpx;
border-bottom: 1px solid rgba(151, 151, 151, 0.3); border-bottom: 1px solid rgba(151, 151, 151, 0.3);
} }
.tab-icon{
width: 26rpx;
height: 26rpx;
margin-right: 16rpx;
}
.title-border input{ .title-border input{
height: 66rpx; height: 66rpx;
} }
.title-border .tab-input{
display: inline-block;
}
.related-goods { .related-goods {
width: 189rpx; width: 189rpx;
height: 54rpx; height: 54rpx;
......
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