Commit 198c6913 by 施宇

11

parent 69e45351
const WebIM = require("utils/WebIM")["default"];
const chat = require('utils/chat.js');
const bus = require('utils/bus.js');
import {
getData,
judgeToken
......@@ -17,6 +18,7 @@ App({
customerNum: "001",
customerName: "IC助手客服",
isRelogin:true,//登入环信失败后是否重新登入,只允许重新登入一次
bus:bus
},
getImUser: chat.getImUser,
addChatMember: function (id,userId) {//id为环信id userId为账户id
......
......@@ -107,11 +107,18 @@ Page({
url: "/pages/detail/chat/index?username=" + JSON.stringify(queryObj)
})
},
toRate:function(){
let data = this.data.info;
wx.navigateTo({
url: "/pages/form/rate/index?id=" + data.offer_id
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
......
......@@ -72,8 +72,11 @@
</view>
</view>
<view class="zxgt btn-com btn-com-y" wx:if="{{info}}" bindtap="sendTemplate">
<view class="zxgt btn-com btn-com-y zxgt1" wx:if="{{info}}" bindtap="sendTemplate">
<text class="icon iconfont iconiconxiantiaoshouji11"></text>
<text class="gt-t">在线沟通</text>
</view>
<view class="rate-btn btn-com btn-com-b" wx:if="{{info}}" bindtap="toRate">
<text class="gt-t">发表评价</text>
</view>
</view>
\ No newline at end of file
// pages/form/appeal/index.js
import {
getData,
tips
} from '../../../utils/util.js';
import {
apis
} from '../../../utils/api.js';
Page({
/**
* 页面的初始数据
*/
data: {
isShowTip:true
isShowTip:true,
textareaVal: '',
id: null,
isClick: true
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.setData({
id: options.id
})
},
/**
......@@ -64,5 +76,46 @@ Page({
this.setData({
isShowTip:false
})
},
textareaChange: function (e) {
let val = e.detail.value;
this.setData({
textareaVal: val
})
},
appealFun:function(){
if (!this.data.textareaVal.trim().length) {
tips('请填写申诉内容');
} else {
let obj = {
token: wx.getStorageSync('access_token') || '',
offer_id: this.data.id,
appeal_content: this.data.textareaVal
};
let me = this;
if (me.data.isClick) {
me.setData({
isClick: false
})
getData(apis.evaluateAppeal, 'get', obj, function (res) {
if (res.errcode == 0) {
tips('申诉成功');
me.setData({
isClick: true
});
setTimeout(() => {
wx.navigateBack()
}, 1000)
} else {
me.setData({
isClick: true
});
tips(res.errmsg)
}
}, true)
}
}
}
})
\ No newline at end of file
......@@ -9,7 +9,7 @@
</view>
<view class="form-view">
<view class="h3 bold">申诉内容:</view>
<textarea placeholder="请输入申请理由,后台人员会与您取得联系。" class="textarea"></textarea>
<textarea placeholder="请输入申请理由,后台人员会与您取得联系。" class="textarea" maxlength="100" bindinput="textareaChange"></textarea>
</view>
<view class="btn-com btn-com-b appeal-btn">提交申诉</view>
<view class="btn-com btn-com-b appeal-btn" bindtap="appealFun">提交申诉</view>
</view>
\ No newline at end of file
// pages/form/good/index.js
import { getData, chooseImg, tips } from '../../../utils/util.js';
import { apis } from '../../../utils/api.js';
import {
getData,
chooseImg,
tips
} from '../../../utils/util.js';
import {
apis
} from '../../../utils/api.js';
Page({
/**
......@@ -22,7 +28,7 @@ Page({
isShowTip: true,
array: ['RMB', 'USD']
},
bindPickerChange: function (e) {
bindPickerChange: function(e) {
this.setData({
currency: e.detail.value
})
......@@ -30,7 +36,7 @@ Page({
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
onLoad: function(options) {
this.setData({
goodId: options.goodId || "",
});
......@@ -46,14 +52,14 @@ Page({
}
},
getGoodData: function () {
getGoodData: function() {
let me = this;
let token = wx.getStorageSync('access_token');
let goodId = me.data.goodId;
getData(apis.goodsInfo, 'get', {
"goods_id/eq": goodId,
"token": token,
}, function (res) {
}, function(res) {
if (res.errcode == 0) {
if (res.total == 0) {
return
......@@ -67,14 +73,14 @@ Page({
}
}, true)
},
renderForm: function (infoObj) {
renderForm: function(infoObj) {
this.setData({
goodsName: infoObj.goods_name,
brandName: infoObj.brand_name,
encap: infoObj.encap,
stock: infoObj.stock,
price: infoObj.price,
currency: infoObj.currency == 1?0:1,
currency: infoObj.currency == 1 ? 0 : 1,
imgUrl: infoObj.goods_images
});
if (infoObj.delivery_time !== '现货') {
......@@ -88,7 +94,7 @@ Page({
}
},
formSubmit: function (e) {
formSubmit: function(e) {
let obj = e.detail.value;
if (!obj.goods_name.trim().length) {
tips('请填写型号');
......@@ -112,7 +118,7 @@ Page({
tips('请填写价格');
return
} else {
if (obj.hq == 2) {//期货
if (obj.hq == 2) { //期货
if (!obj.day.trim().length) {
tips('请填写货期');
return
......@@ -127,7 +133,7 @@ Page({
}
this.postData(obj);
},
postData: function (obj) {
postData: function(obj) {
let me = this;
let token = wx.getStorageSync('access_token');
let url = "";
......@@ -147,16 +153,23 @@ Page({
me.setData({
isClick: false
})
getData(url, 'get', obj, function (res) {
getData(url, 'get', obj, function(res) {
if (res.errcode == 0) {
tips('操作成功')
me.setData({
isClick: true
});
setTimeout(() => {
wx.navigateBack()
wx.navigateBack();
if (me.data.goodId) {
getApp().globalData.bus.emit('editGood');
} else {
getApp().globalData.bus.emit('addGood');
};
}, 1000)
} else {
tips(res.errmsg)
me.setData({
......@@ -175,65 +188,65 @@ Page({
})
},
uploadImg: function () {
uploadImg: function() {
let me = this;
chooseImg(apis.ossupload, 1, function (url) {
chooseImg(apis.ossupload, 1, function(url) {
me.setData({
imgUrl: url
})
})
},
deleteImg: function () {
deleteImg: function() {
this.setData({
imgUrl: null
})
},
deleteGood: function () {
deleteGood: function() {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
onReady: function() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
onShow: function() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
onHide: function() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
onUnload: function() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
onPullDownRefresh: function() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
onReachBottom: function() {
},
closeTip: function () {
closeTip: function() {
this.setData({
isShowTip: false
})
......
// pages/form/rate/index.js
import {
getData,
tips
} from '../../../utils/util.js';
import {
apis
} from '../../../utils/api.js';
Page({
/**
......@@ -7,14 +14,18 @@ Page({
data: {
defaulType: 0,
total: 0,
textareaVal:''
textareaVal: '',
id: null,
isClick: true
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.setData({
id: options.id
})
},
/**
......@@ -63,7 +74,7 @@ Page({
let val = e.detail.value;
this.setData({
total: val.length,
textareaVal:val
textareaVal: val
})
},
changeType: function (e) {
......@@ -71,5 +82,43 @@ Page({
this.setData({
defaulType: index
})
},
releaseRate: function () {
if (!this.data.textareaVal.trim().length) {
tips('请填写评价内容');
} else {
let obj = {
token: wx.getStorageSync('access_token') || '',
offer_id: this.data.id,
is_praise: this.data.defaulType == 0 ? '1' : '2',
content: this.data.textareaVal
};
let me = this;
if (me.data.isClick) {
me.setData({
isClick: false
})
getData(apis.evaluateAdd, 'get', obj, function (res) {
if (res.errcode == 0) {
tips('评价成功');
me.setData({
isClick: true
});
setTimeout(() => {
wx.navigateBack()
}, 1000)
} else {
me.setData({
isClick: true
});
tips(res.errmsg)
}
}, true)
}
}
}
})
\ No newline at end of file
......@@ -27,5 +27,5 @@
</view>
</view>
</view>
<view class="btn-com btn-com-b rate-btn ">发布评价</view>
<view class="btn-com btn-com-b rate-btn " bindtap="releaseRate">发布评价</view>
</view>
\ No newline at end of file
......@@ -7,6 +7,7 @@ import {
import {
apis
} from '../../../utils/api.js';
Page({
/**
......@@ -79,12 +80,13 @@ Page({
})
getData(apis.inquiryadd, 'get', obj, function(res) {
if (res.errcode == 0) {
tips('发布成功')
tips('发布成功');
me.setData({
isClick: true
});
setTimeout(() => {
wx.navigateBack()
wx.navigateBack();
getApp().globalData.bus.emit('addXj')
}, 1000)
} else {
......
// pages/list/qd/index.js
import { getData } from '../../../utils/util.js';
import { apis } from '../../../utils/api.js';
import {
getData
} from '../../../utils/util.js';
import {
apis
} from '../../../utils/api.js';
Page({
/**
* 页面的初始数据
*/
data: {
tabIndex: 1,//导航初始化
priceList: null,//商品数据
limit: 10,//每页的条数
p: 1,//当前页面
tabIndex: 1, //导航初始化
priceList: null, //商品数据
limit: 10, //每页的条数
p: 1, //当前页面
total: 1,
isShowBottom: false,
},
......@@ -18,24 +22,45 @@ Page({
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
onLoad: function(options) {
let me = this;
this.getData();
getApp().globalData.bus.on('addXj', () => {
me.setData({
priceList: null,
p: 1,
total: 1,
isShowBottom: false,
});
me.getData();
})
},
getData: function () {
getData: function() {
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 })
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" })
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) {
getData(apis.inquirySearch, 'get', params, function(res) {
if (res.errcode === 0) {
let newArr = [];
if (me.data.p > 1) {
......@@ -62,42 +87,42 @@ Page({
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
onReady: function() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
onShow: function() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
onHide: function() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
onUnload: function() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
onPullDownRefresh: function() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
onReachBottom: function() {
let allPage = Math.ceil(this.data.total / this.data.limit);
let p = this.data.p;
if (p == allPage) {
......@@ -113,7 +138,7 @@ Page({
this.getData();
}
},
switchTab: function (e) {
switchTab: function(e) {
let i = e.currentTarget.dataset.index;
if (i == this.data.tabIndex) {
return
......@@ -130,7 +155,7 @@ Page({
},
toXj: function () {
toXj: function() {
wx.navigateTo({
url: "/pages/form/xj/index"
})
......
// pages/list/rate/index.js
import { getData } from '../../../utils/util.js';
import { apis } from '../../../utils/api.js';
Page({
/**
* 页面的初始数据
*/
data: {
rateList: null,//数据
limit: 10,//每页的条数
p: 1,//当前页面
total: 0,
isShowBottom: false,
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.getData();
},
/**
......@@ -54,6 +60,44 @@ Page({
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
}
let allPage = Math.ceil(this.data.total / this.data.limit);
let p = this.data.p;
if (p == allPage) {
this.setData({
isShowBottom: true
});
return
} else {
this.setData({
p: p + 1
});
this.getData();
}
},
getData: function () {
let me = this;
let token = wx.getStorageSync('access_token');
getData(apis.evaluateList, 'get', {
limit: me.data.limit, page: me.data.p, token: token, received:'1'
}, function (res) {
if (res.errcode === 0) {
let newArr = [];
if (me.data.p > 1) {
newArr = me.data.rateList;
}
newArr = newArr.concat(res.data);
me.setData({
rateList: newArr,
total: res.total,
});
} else {
if (me.data.p == 1) {
me.setData({
rateList: []
})
}
}
}, true)
},
})
\ No newline at end of file
<!--pages/list/rate/index.wxml-->
<wxs module="dateUtil" src="../../../utils/timeUtil.wxs"></wxs>
<view class="rate-list-view">
<view class="rate-list">
<view class="rate-item">
<view class="item-top row bothSide px-hr-bottom verCenter">
<view class="top-left row verCenter">
<image src="/res/images/imgs/test.jpg" class="img"></image>
<text class="name">深圳邦马特科技有限公司</text>
</view>
<view class="top-right row verCenter">
<text class="icon iconfont iconiconxiantiaoshouji23 good-type"></text>
<text class="type good-text">好评</text>
</view>
</view>
<view class="item-center row bothSide verCenter">
<text class="num bold ellipsis">STM32F407ZGT6</text>
<text class="price bold">¥1.0120</text>
</view>
<view class="item-bottom">
我是评价内容我是评价内容我是评价内容我是评价内容我是评价内容,我是评价内容我是评价内容。
</view>
<view class="item-last row bothSide verCenter">
<view class="time">2019-05-10 10:15</view>
<view class="operation row verCenter">
<text class="icon iconfont iconiconxiantiaoshouji7"></text>
<text class="text">删除</text>
</view>
</view>
</view>
<view class="rate-item">
<view wx:if="{{rateList&&rateList.length==0}}" class="nodata">
<image src="/res/images/imgs/noxb.png" class="img"></image>
<view class="h3 bold">暂无评价</view>
</view>
<view class="rate-list" wx:if="{{rateList&&rateList.length!==0}}">
<view class="rate-item" wx:for="{{rateList}}" wx:key="{{index}}">
<view class="item-top row bothSide px-hr-bottom verCenter">
<view class="top-left row verCenter">
<image src="/res/images/imgs/test.jpg" class="img"></image>
<text class="name">深圳邦马特科技有限公司</text>
<image src="{{item.avatar||'/res/images/imgs/s.png'}}" class="img"></image>
<text class="name">{{item.evaluate_company_name||'--'}}</text>
</view>
<view class="top-right row verCenter">
<text class="icon iconfont iconiconxiantiaoshouji29 bad-type"></text>
<text class="type bad-text">差评</text>
<block wx:if="{{item.is_praise == 1}}">
<text class="icon iconfont iconiconxiantiaoshouji23 good-type"></text>
<text class="type good-text">好评</text>
</block>
<block wx:else>
<text class="icon iconfont iconiconxiantiaoshouji29 bad-type"></text>
<text class="type bad-text">差评</text>
</block>
</view>
</view>
<view class="item-center row bothSide verCenter">
<text class="num bold ellipsis">STM32F407ZGT6</text>
<text class="price bold">¥1.0120</text>
<text class="num bold ellipsis">{{item.goods_name||'--'}}</text>
<text class="price bold">
<block wx:if="{{item.currency == 1}}">¥{{item.price}}</block>
<block wx:else>${{item.price}} </block>
</text>
</view>
<view class="item-bottom">
我是评价内容我是评价内容我是评价内容我是评价内容我是评价内容,我是评价内容我是评价内容。
{{item.content||'--'}}
</view>
<view class="item-last row bothSide verCenter">
<view class="time">2019-05-10 10:15</view>
<view class="operation row verCenter">
<text class="icon iconfont iconiconxiantiaoshouji7"></text>
<text class="text">删除</text>
</view>
</view>
</view>
<view class="rate-item">
<view class="item-center row bothSide verCenter px-hr-bottom special-center">
<text class="num bold ellipsis">STM32F407ZGT6</text>
<text class="price bold">¥1.0120</text>
</view>
<view class="item-top row bothSide verCenter special-top">
<view class="top-left row verCenter">
<image src="/res/images/imgs/test.jpg" class="img"></image>
<text class="name">深圳邦马特科技有限公司</text>
</view>
<view class="top-right row verCenter">
<text class="icon iconfont iconiconxiantiaoshouji23 good-type"></text>
<text class="type good-text">好评</text>
</view>
</view>
<view class="item-bottom">
我是评价内容我是评价内容我是评价内容我是评价内容我是评价内容,我是评价内容我是评价内容。
</view>
<view class="item-last row bothSide verCenter">
<view class="time">2019-05-10 10:15</view>
<view class="operation row verCenter">
<text class="icon iconfont iconiconxiantiaoshouji7"></text>
<text class="text">删除</text>
</view>
<view class="time">{{dateUtil.dateFormat(item.add_time*1000)}}</view>
</view>
</view>
</view>
<view class="data-bottom row verCenter rowCenter" wx:if="{{isShowBottom}}">
<text class="line"></text>
<text class="text">我是有底线的</text>
<text class="line"></text>
</view>
</view>
\ No newline at end of file
// pages/list/ratemanage/index.js
import {
getData
} from '../../../utils/util.js';
import {
apis
} from '../../../utils/api.js';
Page({
/**
* 页面的初始数据
*/
data: {
tabIndex: 1
tabIndex: 1,
rateList: null, //数据
limit: 10, //每页的条数
p: 1, //当前页面
total: 1,
isShowBottom: false
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function(options) {
onLoad: function (options) {
this.getData();
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function() {
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function() {
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function() {
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function() {
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function() {
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function() {
onReachBottom: function () {
let allPage = Math.ceil(this.data.total / this.data.limit);
let p = this.data.p;
if (p == allPage) {
this.setData({
isShowBottom: true
});
return
} else {
this.setData({
p: p + 1
});
this.getData();
}
},
switchTab: function(e) {
switchTab: function (e) {
let i = e.currentTarget.dataset.index;
if (i == this.data.tabIndex) {
return
} else {
this.setData({
rateList: null,
p: 1,
total: 1,
tabIndex: i,
})
isShowBottom: false
});
this.getData();
}
},
getData: function () {
let me = this;
let token = wx.getStorageSync('access_token');
let obj = {
limit: me.data.limit,
page: me.data.p,
token: token
}
if (me.data.tabIndex == 2) {
obj.received = '1'
}
getData(apis.evaluateList, 'get', obj, function (res) {
if (res.errcode === 0) {
let newArr = [];
if (me.data.p > 1) {
newArr = me.data.rateList;
}
newArr = newArr.concat(res.data);
me.setData({
rateList: newArr,
total: res.total,
});
} else {
if (me.data.p == 1) {
me.setData({
rateList: []
})
}
}
}, true)
},
delData: function (e) {
let index = e.currentTarget.dataset.index;
let id = e.currentTarget.dataset.id;
let token = wx.getStorageSync('access_token');
let me = this;
wx.showModal({
title: '提示',
content: '是否删除该评论?',
success: function (res) {
if (res.confirm) {
getData(apis.evaluateDel, 'get', {token:token,offer_id:id}, function (res) {
if (res.errcode === 0) {
wx.showToast({
title: '删除成功',
icon: 'none',
duration: 2000
});
me.data.rateList.splice(index, 1);
me.setData({
rateList: me.data.rateList
})
} else {
wx.showToast({
title: '删除失败',
icon: 'none',
duration: 2000
})
}
}, true)
} else if (res.cancel) {
}
}
})
},
appealData: function (e) {
let id = e.currentTarget.dataset.id;
wx.navigateTo({
url: "/pages/form/appeal/index?id=" + id,
})
}
})
\ No newline at end of file
<!--pages/list/ratemanage/index.wxml-->
<wxs module="dateUtil" src="../../../utils/timeUtil.wxs"></wxs>
<view class="rate-list-view">
<view class="switch-tab-com row">
<view bindtap="switchTab" class="{{tabIndex == 1&&'active'}}" data-index="1">
<text>发布的评价</text>
<text class="active-bg"></text>
</view>
<view bindtap="switchTab" class="{{tabIndex == 2&&'active'}}" data-index="2">
<text>收到的评价</text>
<text class="active-bg"></text>
</view>
</view>
<view class="rate-list">
<view class="rate-item">
<view class="item-top row bothSide px-hr-bottom verCenter">
<view class="top-left row verCenter">
<image src="/res/images/imgs/test.jpg" class="img"></image>
<text class="name">深圳邦马特科技有限公司</text>
</view>
<view class="top-right row verCenter">
<text class="icon iconfont iconiconxiantiaoshouji23 good-type"></text>
<text class="type good-text">好评</text>
<view class="switch-tab-com row">
<view bindtap="switchTab" class="{{tabIndex == 1&&'active'}}" data-index="1">
<text>发布的评价</text>
<text class="active-bg"></text>
</view>
<view bindtap="switchTab" class="{{tabIndex == 2&&'active'}}" data-index="2">
<text>收到的评价</text>
<text class="active-bg"></text>
</view>
</view>
<view wx:if="{{rateList&&rateList.length==0}}" class="nodata">
<image src="/res/images/imgs/noxb.png" class="img"></image>
<view class="h3 bold">暂无评价</view>
</view>
<view class="rate-list" wx:if="{{rateList&&rateList.length!==0}}">
<block wx:if="{{tabIndex==1}}">
<view class="rate-item" wx:for="{{rateList}}" wx:key="{{index}}">
<view class="item-center row bothSide verCenter px-hr-bottom special-center">
<text class="num bold ellipsis">{{item.goods_name||'--'}}</text>
<text class="price bold">
<block wx:if="{{item.currency == 1}}">¥{{item.price}}</block>
<block wx:else>${{item.price}} </block>
</text>
</view>
</view>
<view class="item-center row bothSide verCenter">
<text class="num bold ellipsis">STM32F407ZGT6</text>
<text class="price bold">¥1.0120</text>
</view>
<view class="item-bottom">
我是评价内容我是评价内容我是评价内容我是评价内容我是评价内容,我是评价内容我是评价内容。
</view>
<view class="item-last row bothSide verCenter">
<view class="time">2019-05-10 10:15</view>
<view class="operation row verCenter">
<text class="icon iconfont iconiconxiantiaoshouji7"></text>
<text class="text">删除</text>
<view class="item-top row bothSide verCenter special-top">
<view class="top-left row verCenter">
<image src="{{item.avatar||'/res/images/imgs/s.png'}}" class="img"></image>
<text class="name">{{item.evaluate_company_name||'--'}}</text>
</view>
<view class="top-right row verCenter">
<block wx:if="{{item.is_praise == 1}}">
<text class="icon iconfont iconiconxiantiaoshouji23 good-type"></text>
<text class="type good-text">好评</text>
</block>
<block wx:else>
<text class="icon iconfont iconiconxiantiaoshouji29 bad-type"></text>
<text class="type bad-text">差评</text>
</block>
</view>
</view>
</view>
</view>
<view class="rate-item">
<view class="item-top row bothSide px-hr-bottom verCenter">
<view class="top-left row verCenter">
<image src="/res/images/imgs/test.jpg" class="img"></image>
<text class="name">深圳邦马特科技有限公司</text>
<view class="item-bottom">
{{item.content||'--'}}
</view>
<view class="top-right row verCenter">
<text class="icon iconfont iconiconxiantiaoshouji29 bad-type"></text>
<text class="type bad-text">差评</text>
<view class="item-last row bothSide verCenter">
<view class="time">{{dateUtil.dateFormat(item.add_time*1000)}}</view>
<view class="operation row verCenter" bindtap="delData" data-id="{{item.offer_id}}" data-index="{{index}}">
<text class="icon iconfont iconiconxiantiaoshouji7"></text>
<text class="text">删除</text>
</view>
</view>
</view>
<view class="item-center row bothSide verCenter">
<text class="num bold ellipsis">STM32F407ZGT6</text>
<text class="price bold">¥1.0120</text>
</view>
<view class="item-bottom">
我是评价内容我是评价内容我是评价内容我是评价内容我是评价内容,我是评价内容我是评价内容。
</view>
<view class="item-last row bothSide verCenter">
<view class="time">2019-05-10 10:15</view>
<view class="operation row verCenter">
<text class="icon iconfont iconiconxiantiaoshouji7"></text>
<text class="text">删除</text>
</block>
<block wx:else>
<view class="rate-item" wx:for="{{rateList}}" wx:key="{{index}}">
<view class="item-top row bothSide px-hr-bottom verCenter">
<view class="top-left row verCenter">
<image src="{{item.avatar||'/res/images/imgs/s.png'}}" class="img"></image>
<text class="name">{{item.evaluate_company_name||'--'}}</text>
</view>
<view class="top-right row verCenter">
<block wx:if="{{item.is_praise == 1}}">
<text class="icon iconfont iconiconxiantiaoshouji23 good-type"></text>
<text class="type good-text">好评</text>
</block>
<block wx:else>
<text class="icon iconfont iconiconxiantiaoshouji29 bad-type"></text>
<text class="type bad-text">差评</text>
</block>
</view>
</view>
</view>
</view>
<view class="rate-item">
<view class="item-center row bothSide verCenter px-hr-bottom special-center">
<text class="num bold ellipsis">STM32F407ZGT6</text>
<text class="price bold">¥1.0120</text>
</view>
<view class="item-top row bothSide verCenter special-top">
<view class="top-left row verCenter">
<image src="/res/images/imgs/test.jpg" class="img"></image>
<text class="name">深圳邦马特科技有限公司</text>
<view class="item-center row bothSide verCenter">
<text class="num bold ellipsis">{{item.goods_name||'--'}}</text>
<text class="price bold">
<block wx:if="{{item.currency == 1}}">¥{{item.price}}</block>
<block wx:else>${{item.price}} </block>
</text>
</view>
<view class="top-right row verCenter">
<text class="icon iconfont iconiconxiantiaoshouji23 good-type"></text>
<text class="type good-text">好评</text>
<view class="item-bottom">
{{item.content||'--'}}
</view>
</view>
<view class="item-bottom">
我是评价内容我是评价内容我是评价内容我是评价内容我是评价内容,我是评价内容我是评价内容。
</view>
<view class="item-last row bothSide verCenter">
<view class="time">2019-05-10 10:15</view>
<view class="operation row verCenter">
<text class="icon iconfont iconiconxiantiaoshouji7"></text>
<text class="text">删除</text>
<view class="item-last row bothSide verCenter">
<view class="time">{{dateUtil.dateFormat(item.add_time*1000)}}</view>
<view class="operation row verCenter" bindtap="appealData" data-id="{{item.offer_id}}">
<text class="icon iconfont iconiconxiantiaoshouji22"></text>
<text class="text">申诉</text>
</view>
</view>
</view>
</view>
</block>
</view>
<view class="data-bottom row verCenter rowCenter" wx:if="{{isShowBottom}}">
<text class="line"></text>
<text class="text">我是有底线的</text>
<text class="line"></text>
</view>
</view>
</view>
\ No newline at end of file
/* pages/list/ratemanage/index.wxss */
@import '/res/css/rate.wxss'
\ No newline at end of file
@import '/res/css/rate.wxss';
.rate-list-view {
box-sizing: border-box;
padding-top: 88rpx;
}
.rate-list-view .switch-tab-com{
position: fixed;
top: 0;
left: 0;
right: 0;
background-color: #fff;
z-index: 2;
}
\ No newline at end of file
......@@ -99,5 +99,10 @@ Page({
}
},
toRateList:function(){
wx.navigateTo({
url: '/pages/list/rate/index'
});
}
})
\ No newline at end of file
......@@ -37,7 +37,7 @@
<text class="t2">报价</text>
</view>
</view>
<view class="evaluation boxsiz row verCenter bothSide">
<view class="evaluation boxsiz row verCenter bothSide" bindtap="toRateList">
<view>
<text class="icon iconfont iconiconxiantiaoshouji23"></text>
<text class="t1">收到的评价</text>
......
// pages/searchresult/index.js
import { getData } from '../../../utils/util.js';
import { apis } from '../../../utils/api.js';
import {
getData
} from '../../../utils/util.js';
import {
apis
} from '../../../utils/api.js';
Page({
/**
......@@ -10,20 +14,20 @@ Page({
priceList: null,
tabIndex: 1,
type: 2,
limit: 10,//每页的条数
p: 1,//当前页面
limit: 10, //每页的条数
p: 1, //当前页面
total: 1,
key: "",
confirmKey: "",
isShowBottom: false,
token:''
token: ''
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
onLoad: function(options) {
let key = options.key;
this.setData({
......@@ -33,13 +37,40 @@ Page({
});
this.storageKey(key)
this.getData();
getApp().globalData.bus.on('addXj', () => {
if (me.data.tabIndex == 2) {
me.setData({
priceList: null,
p: 1,
total: 1,
isShowBottom: false,
})
me.getData();
}
});
getApp().globalData.bus.on('addGood', () => {
if (me.data.tabIndex == 1) {
me.setData({
priceList: null,
p: 1,
total: 1,
isShowBottom: false,
});
me.getData();
}
})
getApp().globalData.bus.on('editGood', () => {
if (me.data.tabIndex == 1) {
console.log('编辑商品')
}
})
},
bindKeyInput: function (e) {
bindKeyInput: function(e) {
this.setData({
key: e.detail.value
})
},
storageKey: function (key) {
storageKey: function(key) {
let storageKeys = wx.getStorageSync('storageKeys') || [];
if (!storageKeys.length) {
storageKeys.push(key);
......@@ -57,7 +88,7 @@ Page({
}
wx.setStorageSync('storageKeys', storageKeys)
},
bindKeyConfirm: function () {
bindKeyConfirm: function() {
let val = this.data.key;
if (!val.length) {
wx.showToast({
......@@ -83,7 +114,7 @@ Page({
this.getData()
}
},
getData: function () {
getData: function() {
let me = this;
let url, token = wx.getStorageSync('access_token');
let str = "";
......@@ -102,7 +133,7 @@ Page({
if (token) {
params.token = token
}
getData(url, 'get', params, function (res) {
getData(url, 'get', params, function(res) {
if (res.errcode === 0) {
let newArr = [];
if (me.data.p > 1) {
......@@ -128,42 +159,42 @@ Page({
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
onReady: function() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
onShow: function() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
onHide: function() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
onUnload: function() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
onPullDownRefresh: function() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
onReachBottom: function() {
let allPage = Math.ceil(this.data.total / this.data.limit);
let p = this.data.p;
if (p == allPage) {
......@@ -179,7 +210,7 @@ Page({
this.getData();
}
},
switchTab: function (e) {
switchTab: function(e) {
let i = e.currentTarget.dataset.index;
if (i == this.data.tabIndex) {
return
......@@ -205,17 +236,17 @@ Page({
}
},
toXj: function () {
toXj: function() {
wx.navigateTo({
url: "/pages/form/xj/index"
})
},
toSp: function () {
toSp: function() {
wx.navigateTo({
url: "/pages/form/good/index"
})
},
sendCustomer: function () {
sendCustomer: function() {
let my = wx.getStorageSync("myUsername");
let companyName = wx.getStorageSync("company_name");
let userId = wx.getStorageSync("user_id");
......@@ -226,9 +257,9 @@ Page({
name: getApp().globalData.customerName,
name1: companyName,
id: userId,
touserid:'',
touserid: '',
title: getApp().globalData.customerName,
img:'',
img: '',
img1: avatar
};
wx.setStorageSync('customer', this.data.confirmKey);
......
......@@ -22,9 +22,22 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
let me = this;
if (judgeToken(true)) {
this.getData();
}
};
getApp().globalData.bus.on('addGood', () => {
me.setData({
priceList: null,
p: 1,
total: 0,
isShowBottom: false,
});
me.getData();
})
getApp().globalData.bus.on('editGood', () => {
console.log('编辑商品')
})
},
bindKeyInput: function (e) {
this.setData({
......
......@@ -24,22 +24,29 @@ Page({
/**
* 生命周期函数--监听页面加载
*/
onLoad: function(options) {
onLoad: function (options) {
let me = this;
wx.removeStorageSync('homeToken')
this.getData(false);
if (!judgeToken()) {
wx.setStorageSync('homeToken', 1)
}
};
getApp().globalData.bus.on('addXj', () => {
if(me.data.xb == 1){
me.getData();
}
})
},
getTopData: function() {
getTopData: function () {
let me = this;
let token = wx.getStorageSync('access_token') || '';
getData(apis.inquirySearch, 'get', {
"offset": 10,
"p1": 1,
"add_time/order": "desc",
"token":token
}, function(res) {
"token": token
}, function (res) {
let newArr = [];
if (res.errcode === 0) {
if (res.total == 0) {
......@@ -78,7 +85,7 @@ Page({
}
}, true)
},
getData: function(bool) {
getData: function (bool) {
let me = this;
let url, token = wx.getStorageSync('access_token')
if (!token) {
......@@ -96,7 +103,7 @@ Page({
offset: me.data.limit,
p: 1,
token: token
}, function(res) {
}, function (res) {
if (res.errcode === 0) {
let newArr = [];
if (me.data.xb == 1) {
......@@ -120,14 +127,14 @@ Page({
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function() {
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function() {
onShow: function () {
this.getTopData();
if (judgeToken()) {
if (wx.getStorageSync('homeToken')) {
......@@ -142,31 +149,31 @@ Page({
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function() {
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function() {
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function() {
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function() {
onReachBottom: function () {
},
switchTab: function(e) {
switchTab: function (e) {
let i = e.currentTarget.dataset.index;
if (i == this.data.tabIndex) {
return
......@@ -190,12 +197,12 @@ Page({
},
toSearch: function() {
toSearch: function () {
wx.navigateTo({
url: '/pages/search/index/index',
})
},
toXj: function() {
toXj: function () {
if (judgeToken(true)) {
wx.navigateTo({
url: "/pages/form/xj/index"
......@@ -203,14 +210,14 @@ Page({
}
},
fbGood: function() {
fbGood: function () {
if (judgeToken(true)) {
wx.navigateTo({
url: "/pages/form/good/index",
})
}
},
toQd: function() {
toQd: function () {
if (judgeToken(true)) {
wx.navigateTo({
url: "/pages/list/qd/index"
......
......@@ -20,9 +20,21 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
let me = this;
if (judgeToken(true)) {
this.getData();
}
getApp().globalData.bus.on('addXj', () => {
if (me.data.tabIndex == 1) {
me.setData({
priceList: null,
p: 1,
total: 1,
isShowBottom: false
})
me.getData();
}
})
},
getData:function(){
let me = this;
......
......@@ -52,7 +52,7 @@
"list": []
},
"miniprogram": {
"current": 29,
"current": 32,
"list": [
{
"id": -1,
......@@ -268,6 +268,20 @@
"id": -1,
"name": "pages/tab/home/home",
"pathName": "pages/tab/home/home",
"query": "",
"scene": null
},
{
"id": -1,
"name": "pages/list/rate/index",
"pathName": "pages/list/rate/index",
"query": "",
"scene": null
},
{
"id": -1,
"name": "pages/list/ratemanage/index",
"pathName": "pages/list/ratemanage/index",
"scene": null
}
]
......
......@@ -64,7 +64,7 @@
padding-top: 16rpx;
}
.zxgt {
.zxgt,.rate-btn {
position: absolute;
bottom: 94rpx;
left: 0;
......@@ -76,3 +76,9 @@
font-size: 40rpx;
vertical-align: middle;
}
.zxgt1{
bottom:205rpx;
}
.rate-btn{
bottom: 68rpx;
}
......@@ -240,8 +240,23 @@ const apis = {
/**
* 热门话题(最多30条, 5 分钟更新一次)
*/
checkPopular: user_url + '/check/popular'
checkPopular: user_url + '/check/popular',
/**
* 报价评价
*/
evaluateList: user_url + '/evaluate/list',
/**
* 新增评价
*/
evaluateAdd: user_url + '/evaluate/add',
/**
* 删除自己发出的评价
*/
evaluateDel: user_url + '/evaluate/del',
/**
* 申述自己收到的评价
*/
evaluateAppeal: user_url + '/evaluate/appeal/add',
}
......
let bus = {
on: (key, func) => {
if (!bus[key]) {
bus[key] = [func];
} else {
bus[key].push(func)
}
},
emit: (key, params) => {
if (!bus[key]) return;
for (let v of bus[key]) {
v(params)
}
},
off: (key) => {
bus[key] && delete bus[key];
}
};
module.exports = bus;
\ No newline at end of file
......@@ -177,7 +177,6 @@ const webimListen = () => {
},
// 各种异常
onError(error) {
console.log(error)
if (error.type == 8) {
let pages = getCurrentPages();
let curPage = pages[pages.length - 1];
......@@ -188,7 +187,6 @@ const webimListen = () => {
} else if (error.type == 1) {
if (getApp().globalData.isRelogin) {
getApp().globalData.isRelogin = false;
console.log('重新登录')
registerIm()
} else {
wx.showModal({
......
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