Commit 198c6913 by 施宇

11

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