Commit 7ede2bdb by 施宇

111

parent 7d77d9f9
...@@ -67,9 +67,9 @@ App({ ...@@ -67,9 +67,9 @@ App({
success(res) { success(res) {
if(res.data){ if(res.data){
wx.switchTab({ // wx.switchTab({
url: '/pages/tab/home/home' // url: '/pages/tab/home/home'
}); // });
} }
} }
...@@ -81,9 +81,9 @@ App({ ...@@ -81,9 +81,9 @@ App({
success(res) { success(res) {
if (res.authSetting['scope.userInfo']) { if (res.authSetting['scope.userInfo']) {
// 已经授权 // 已经授权
wx.switchTab({ // wx.switchTab({
url: '/pages/tab/home/home' // url: '/pages/tab/home/home'
}) // })
} }
} }
}) })
......
...@@ -242,7 +242,9 @@ image { ...@@ -242,7 +242,9 @@ image {
line-height: 98rpx; line-height: 98rpx;
border-radius: 8rpx; border-radius: 8rpx;
} }
.red{
color:#EA1717;
}
.btn-com-y { .btn-com-y {
background-color: #eaad37; background-color: #eaad37;
box-shadow: 0px 6px 10px 0px rgba(242, 191, 97, 0.5); box-shadow: 0px 6px 10px 0px rgba(242, 191, 97, 0.5);
......
...@@ -29,8 +29,9 @@ Component({ ...@@ -29,8 +29,9 @@ Component({
* 组件的方法列表 * 组件的方法列表
*/ */
methods: { methods: {
emitevent:function(){ emitevent:function(e){
this.triggerEvent('emitevent') let inquiryItemsId = e.currentTarget.dataset.inquiryitemsid;
this.triggerEvent('emitevent', {inquiryItemsId: inquiryItemsId})
}, },
previewImage:function(e){ previewImage:function(e){
let img = e.currentTarget.dataset.image; let img = e.currentTarget.dataset.image;
......
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
<text class="num"><text>数量:</text>{{item.number}} PCS</text> <text class="num"><text>数量:</text>{{item.number}} PCS</text>
</view> </view>
<view class="item-footer row bothSide verCenter nowrap"> <view class="item-footer row bothSide verCenter nowrap">
<text class="address ellipsis">备注:{{item.remark}}</text> <text class="address ellipsis">备注:{{item.remark||'--'}}</text>
<text class="time">{{dateUtil.dateFormat(item.add_time*1000)}}</text> <text class="time">{{dateUtil.dateFormat(item.add_time*1000)}}</text>
</view> </view>
</view> </view>
...@@ -62,29 +62,29 @@ ...@@ -62,29 +62,29 @@
</block> </block>
<!-- 搜索页面询报价展示 --> <!-- 搜索页面询报价展示 -->
<block wx:if="{{priceType==3}}"> <block wx:if="{{priceType==3}}">
<view class="price-item" wx:for="{{priceList}}" wx:key="*this" bindtap="emitevent"> <view class="price-item" wx:for="{{priceList}}" wx:key="*this" bindtap="emitevent" data-inquiryitemsid="{{item['inquiry_items_id']}}">
<view class="item-header px-hr-bottom row verCenter bothSide nowrap"> <view class="item-header px-hr-bottom row verCenter bothSide nowrap">
<view class="row verCenter"> <view class="row verCenter">
<text class="mark xun" wx:if="{{xb==1}}">询价</text> <text class="mark xun" wx:if="{{xb==1}}">询价</text>
<text class="mark bao" wx:else>报价</text> <text class="mark bao" wx:else>报价</text>
<text class="company ellipsis">{{item.company}}</text> <text class="company ellipsis">{{item.company_name||'--'}}</text>
</view> </view>
<text class="time">{{item.time}}</text> <text class="time">{{dateUtil.dateFormat(item.add_time*1000)}}</text>
</view> </view>
<view class="item-middle row verCenter bothSide item-middle2 nowrap"> <view class="item-middle row verCenter bothSide item-middle2 nowrap">
<text class="name ellipsis">{{item.name}}</text> <text class="name ellipsis">{{item.goods_name||'--'}}</text>
<block wx:if="{{xb==1}}"> <block wx:if="{{xb==1}}">
<text class="num-bj" wx:if="{{item.count}}">{{item.count}}个报价</text> <text class="num-bj" wx:if="{{item.offer_num}}">{{item.offer_num}}个报价</text>
<text class="no-bj" wx:else>等待报价</text> <text class="no-bj" wx:else>等待报价</text>
</block> </block>
<text class="price" wx:else>¥{{item.price}}</text> <text class="price" wx:else>¥{{item.price}}</text>
</view> </view>
<view class="item-middle row verCenter nowrap"> <view class="item-middle row verCenter nowrap">
<text class="brand ellipsis"><text>品牌:</text>{{item.brand}}</text> <text class="brand ellipsis"><text>品牌:</text>{{item.brand_name}}</text>
<text class="num bold"><text class="nobold">数量:</text>{{item.num}}PCS</text> <text class="num"><text>数量:</text>{{item.number}} PCS</text>
</view> </view>
<view class="item-footer row nowrap"> <view class="item-footer row nowrap">
<text class="address ellipsis">备注:{{item.desc}}</text> <text class="address ellipsis">备注:{{item.remark||'--'}}</text>
</view> </view>
</view> </view>
</block> </block>
......
// pages/list/bj/index.js // pages/list/bj/index.js
let arr = [ import { getData } from '../../../utils/util.js';
{ import { apis } from '../../../utils/api.js';
name: "STM32F407ZGT6",
price: "100.012",
brand: "Texas InstrumentsTexas",
num: "100,000",
desc: "深圳地区原装现货深圳地区原装现货",
time: "05-10 10:15",
company: "朗新科技股份有限公司",
fz:"LQFP-144",
hq:"现货"
},
{
name: "STM32F407ZGT6",
price: "100.012",
brand: "Texas InstrumentsTexas",
num: "100,000",
desc: "深圳地区原装现货深圳地区原装现货",
time: "05-10 10:15",
company: "朗新科技股份有限公司",
fz: "LQFP-144",
hq: "现货"
},
{
name: "STM32F407ZGT6",
price: "100.012",
brand: "Texas InstrumentsTexas",
num: "100,000",
desc: "深圳地区原装现货深圳地区原装现货",
time: "05-10 10:15",
company: "朗新科技股份有限公司",
fz: "LQFP-144",
hq: "现货"
}
]
Page({ Page({
/** /**
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
priceList: undefined, priceList: null,
topInfo: null,
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function (options) { onLoad: function (options) {
let seft = this; let inquiryItemsId = options.inquiryItemsId;
this.getTopInfo(inquiryItemsId)
wx.showLoading({ },
title: '加载中', getTopInfo: function (id) {
}) let me = this;
getData(apis.inquirySearch, 'get', { "inquiry_items_id/eq": id }, function (res) {
if (res.errcode === 0) {
me.setData({
setTimeout(() => { topInfo: res.inquiry_list[id]
wx.hideLoading() })
seft.setData({ priceList: arr }) } else {
}, 2000) me.setData({
topInfo: null
})
}
}, true)
}, },
getList:function(){
},
/** /**
* 生命周期函数--监听页面初次渲染完成 * 生命周期函数--监听页面初次渲染完成
*/ */
...@@ -112,7 +83,7 @@ Page({ ...@@ -112,7 +83,7 @@ Page({
onShareAppMessage: function () { onShareAppMessage: function () {
}, },
goBj:function(){ goBj: function () {
wx.navigateTo({ wx.navigateTo({
url: "/pages/form/bj/index", url: "/pages/form/bj/index",
}) })
......
<!--pages/list/bj/index.wxml--> <!--pages/list/bj/index.wxml-->
<wxs module="dateUtil" src="../../../utils/timeUtil.wxs"></wxs>
<view class="bj-view"> <view class="bj-view">
<view class="bj-title row bothSide verCenter"> <view class="bj-title ">
<view class="company row verCenter"> <view class="row bothSide verCenter" wx:if="{{topInfo}}">
<text class="xun">询价</text> <view class="company row verCenter">
<text class="name bold">中麒(北京)科技有限公司</text> <text class="xun">询价</text>
<text class="name bold">{{topInfo.company_name||'--'}}</text>
</view>
<text class="icon iconfont iconiconxiantiaoshouji6"></text>
</view> </view>
<text class="icon iconfont iconiconxiantiaoshouji6"></text>
</view> </view>
<view class="xb-com-content"> <view class="xb-com-content">
<view> <view class="x-info">
<view class="title row bothSide verCenter nowrap px-hr-bottom"> <view wx:if="{{topInfo}}">
<text class="name bold ellipsis">STM32F407ZGT6STM32F407ZGT6STM32F407ZGT6</text> <view class="title row bothSide verCenter nowrap px-hr-bottom">
<text class="time ">05-10 10:15</text> <text class="name bold ellipsis">{{topInfo.goods_name||'--'}}</text>
</view> <text class="time ">{{dateUtil.dateFormat(topInfo.add_time*1000)}}</text>
<view class="desc row"> </view>
<view class="left"> <view class="desc row">
<view class="brand row"> <view class="left">
<text class="t-com">品牌:</text> <view class="brand row">
<text class="c-com">Texas Instruments</text> <text class="t-com">品牌:</text>
</view> <text class="c-com">{{topInfo.brand_name}}</text>
<view class="fz row"> </view>
<text class="t-com">封装:</text> <view class="fz row">
<text class="c-com">LQFP-64</text> <text class="t-com">封装:</text>
</view> <text class="c-com">{{topInfo.encap}}</text>
<view class="hq row"> </view>
<text class="t-com">货期:</text> <view class="hq row">
<text class="c-com">现货</text> <text class="t-com">货期:</text>
</view> <text class="c-com">{{topInfo.delivery_time}}</text>
<view class="num row"> </view>
<text class="t-com">数量:</text> <view class="num row">
<text class="c-com bold">100,000 PCS</text> <text class="t-com">数量:</text>
</view> <text class="c-com bold">{{topInfo.number}} PCS</text>
<view class="price row"> </view>
<text class="t-com">接受价:</text> <view class="price row">
<text class="c-com">无</text> <text class="t-com">接受价:</text>
</view> <text class="c-com {{(!topInfo.price||topInfo.price=='0.00'||topInfo.price=='0')?'':'bold red'}}">
<view class="bz row"> <block wx:if="{{!topInfo.price||topInfo.price=='0.00'||topInfo.price=='0'}}">未回复</block>
<text class="t-com">备注:</text> <block wx:else>
<text class="c-com">有货的请尽快回复,比较急着要货</text> <block wx:if="{{topInfo.currency == 1}}">¥{{topInfo.price}}</block><block wx:else>${{topInfo.price}}
</block>
</block>
</text>
</view>
<view class="bz row">
<text class="t-com">备注:</text>
<text class="c-com">{{topInfo.remark||'--'}}</text>
</view>
</view> </view>
<cover-image class="right" src="{{topInfo.goods_images?topInfo.goods_images:'/res/images/imgs/iclogo.png'}}"></cover-image>
</view> </view>
<cover-image class="right" src="/res/images/imgs/iclogo.png"></cover-image>
</view> </view>
</view> </view>
<view class="bj-data"> <view class="bj-data">
<view class="xb-com-t row bothSide verCenter px-hr-bottom "> <view class="xb-com-t row bothSide verCenter px-hr-bottom ">
<text class="mybj bold beforeLine">我的报价</text> <text class="mybj bold beforeLine">我的报价</text>
<view class="sdbj"> <!-- <view class="sdbj">
已收到 已收到
<text class="num">5</text> 条报价 <text class="num">5</text> 条报价
</view> </view> -->
</view> </view>
<view class="bj-list"> <view class="bj-list">
<view wx:if="{{priceList&&priceList.length==0}}" class="nodata"> <view wx:if="{{priceList&&priceList.length==0}}" class="nodata">
......
...@@ -12,8 +12,12 @@ ...@@ -12,8 +12,12 @@
color: #fff; color: #fff;
font-size: 26rpx; font-size: 26rpx;
padding: 24rpx 24rpx 60rpx; padding: 24rpx 24rpx 60rpx;
min-height:130rpx;
box-sizing: border-box;
}
.x-info{
min-height: 496rpx;
} }
.bj-title .icon { .bj-title .icon {
font-size: 40rpx; font-size: 40rpx;
} }
......
// pages/list/qd/index.js // pages/list/qd/index.js
let arr = [ import { getData } from '../../../utils/util.js';
{ import { apis } from '../../../utils/api.js';
name: "STM32F407ZGT6",
price: "100.012",
brand: "Texas InstrumentsTexas",
num: "100,000",
desc: "深圳地区原装现货深圳地区原装现货",
time: "05-10 10:15",
company: "朗新科技股份有限公司",
},
{
name: "STM32F407ZGT6",
price: "100.012",
brand: "Texas InstrumentsTexas",
num: "100,000",
desc: "深圳地区原装现货深圳地区原装现货",
time: "05-10 10:15",
company: "朗新科技股份有限公司",
},
{
name: "STM32F407ZGT6",
price: "100.012",
brand: "Texas InstrumentsTexas",
num: "100,000",
desc: "深圳地区原装现货深圳地区原装现货",
time: "05-10 10:15",
company: "朗新科技股份有限公司",
}
]
Page({ Page({
/** /**
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
tabIndex: 1, tabIndex: 1,//导航初始化
priceList: undefined, priceList: null,//商品数据
limit: 10,//每页的条数
p: 1,//当前页面
total: 1
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function (options) { onLoad: function (options) {
let seft = this; this.getData();
},
wx.showLoading({ getData: function () {
title: '加载中', let me = this;
}) let token = wx.getStorageSync('access_token')||'';
let params = { offset: me.data.limit, p: me.data.p };
if(token){
params = Object.assign({}, params, { "token": token })
}
if(me.data.tabIndex == 1){
params = Object.assign({},params,{"add_time/order":"desc"})
}else if(me.data.tabIndex == 2){
params = Object.assign({}, params, { "today": "1" })
}else{
params = Object.assign({}, params, { "offer_num/eq": "0" })
}
getData(apis.inquirySearch, 'get', params, function (res) {
if (res.errcode === 0) {
let newArr = [];
if (me.data.p > 1) {
newArr = me.data.priceList;
}
for (let key in res.inquiry_list) {
newArr.push(res.inquiry_list[key])
}
me.setData({
priceList: newArr,
total: res.total,
});
} else {
if ((me.data.p == 1) && (res.errcode == (105001 || 105015))) {
me.setData({
priceList: []
})
}
setTimeout(() => { }
wx.hideLoading() }, true)
seft.setData({ priceList: arr })
}, 2000)
}, },
/** /**
...@@ -96,7 +97,22 @@ Page({ ...@@ -96,7 +97,22 @@ Page({
* 页面上拉触底事件的处理函数 * 页面上拉触底事件的处理函数
*/ */
onReachBottom: function () { onReachBottom: function () {
let allPage = Math.ceil(this.data.total / this.data.limit);
let p = this.data.p;
if (p == allPage) {
wx.showToast({
title: '数据到底啦',
icon: 'none',
duration: 2000
});
return
} else {
this.setData({
p: p + 1
});
console.log(this.data.p)
this.getData();
}
}, },
/** /**
...@@ -110,20 +126,13 @@ Page({ ...@@ -110,20 +126,13 @@ Page({
if (i == this.data.tabIndex) { if (i == this.data.tabIndex) {
return return
} else { } else {
if (i == 1) { this.setData({
this.setData({ priceList: null,
tabIndex: i, p: 1,
priceList: arr, total: 1,
tabIndex: i,
}); });
} else { this.getData();
this.setData({
tabIndex: i,
priceList: [],
});
}
} }
...@@ -133,9 +142,10 @@ Page({ ...@@ -133,9 +142,10 @@ Page({
url: "/pages/form/xj/index" url: "/pages/form/xj/index"
}) })
}, },
emitevent: function () { emitevent: function (e) {
let inquiryItemsId = e.detail.inquiryItemsId
wx.navigateTo({ wx.navigateTo({
url: "/pages/list/bj/index", url: "/pages/list/bj/index?inquiryItemsId="+inquiryItemsId,
}) })
} }
......
/* pages/list/qd/index.wxss */ /* pages/list/qd/index.wxss */
.qd-view {
box-sizing: border-box;
padding-top: 88rpx;
}
.qd-view .switch-tab-com {
position: fixed;
top: 0;
left: 0;
right: 0;
background-color: #fff;
z-index: 2;
}
.nodata .p { .nodata .p {
margin-top: 14rpx; margin-top: 14rpx;
} }
.nodata .fb_btn { .nodata .fb_btn {
margin-top:40rpx margin-top: 40rpx;
} }
...@@ -42,7 +42,7 @@ Page({ ...@@ -42,7 +42,7 @@ Page({
getData: function () { getData: function () {
let me = this; let me = this;
let token = wx.getStorageSync('access_token') let token = wx.getStorageSync('access_token')
getData(apis.goodsInfo, { getData(apis.goodsInfo,'get', {
offset: me.data.limit, p: me.data.p, token: token, 'goods_name/like': me.data.confirmKey offset: me.data.limit, p: me.data.p, token: token, 'goods_name/like': me.data.confirmKey
}, function (res) { }, function (res) {
if (res.errcode === 0) { if (res.errcode === 0) {
......
...@@ -21,7 +21,7 @@ Page({ ...@@ -21,7 +21,7 @@ Page({
onLoad: function (options) { onLoad: function (options) {
this.getData(); this.getData();
}, },
getData:function(type){ getData:function(){
let me = this; let me = this;
let url, token = wx.getStorageSync('access_token') let url, token = wx.getStorageSync('access_token')
if(me.data.xb == 1){ if(me.data.xb == 1){
...@@ -29,7 +29,7 @@ Page({ ...@@ -29,7 +29,7 @@ Page({
}else{ }else{
url = apis.offerinfo url = apis.offerinfo
} }
getData(url, { offset:me.data.limit, p:me.data.p, token: token},function(res){ getData(url,'get',{ offset:me.data.limit, p:me.data.p, token: token},function(res){
if(res.errcode === 0){ if(res.errcode === 0){
let newArr = []; let newArr = [];
if(me.data.p > 1 ){ if(me.data.p > 1 ){
...@@ -134,14 +134,12 @@ Page({ ...@@ -134,14 +134,12 @@ Page({
this.setData({ this.setData({
xb:1 xb:1
}); });
this.getData()
} else { } else {
this.setData({ this.setData({
xb: 2, xb: 2,
}); });
this.getData()
} }
this.getData();
} }
......
...@@ -48,12 +48,20 @@ ...@@ -48,12 +48,20 @@
"list": [] "list": []
}, },
"miniprogram": { "miniprogram": {
"current": 0, "current": 1,
"list": [ "list": [
{ {
"id": -1, "id": -1,
"name": "pages/detail/chat/index", "name": "pages/detail/chat/index",
"pathName": "pages/detail/chat/index", "pathName": "pages/detail/chat/index",
"query": "",
"scene": null
},
{
"id": -1,
"name": "pages/list/bj/index",
"pathName": "pages/list/bj/index",
"query": "inquiryItemsId=156403573054791",
"scene": null "scene": null
} }
] ]
......
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 sign in to comment