Commit 21a2fc2b by 施宇

11

parent 917d15da
...@@ -15,8 +15,8 @@ App({ ...@@ -15,8 +15,8 @@ App({
auth: wx.getStorageSync('auth'), auth: wx.getStorageSync('auth'),
token: wx.getStorageSync('access_token'), token: wx.getStorageSync('access_token'),
isIPX: false, //是否为iphone X isIPX: false, //是否为iphone X
customerNum: "001", customerNum: "001",//客服
customerName: "IC助手客服", customerName: "IC助手客服",//客服名称
isRelogin: true, //登入环信失败后是否重新登入,只允许重新登入一次 isRelogin: true, //登入环信失败后是否重新登入,只允许重新登入一次
bus: bus, bus: bus,
imBoolean: false, imBoolean: false,
......
...@@ -58,7 +58,7 @@ ...@@ -58,7 +58,7 @@
<view class="form-item row verCenter px-hr-top" hidden="{{!isShowTime}}"> <view class="form-item row verCenter px-hr-top" hidden="{{!isShowTime}}">
<text class="form-item-title">*时间</text> <text class="form-item-title">*时间</text>
<view class="form-item-right"> <view class="form-item-right">
<input placeholder="请输入货期时间(天)" placeholder-class="placeholderClass" type="number" name="day" value="{{day}}"></input> <input placeholder="请输入货期时间(天)" placeholder-class="placeholderClass" type="text" name="day" value="{{day}}"></input>
</view> </view>
</view> </view>
<view class="form-hr"></view> <view class="form-hr"></view>
......
...@@ -69,7 +69,7 @@ ...@@ -69,7 +69,7 @@
<view class="form-item row verCenter px-hr-bottom" hidden="{{!isShowTime}}"> <view class="form-item row verCenter px-hr-bottom" hidden="{{!isShowTime}}">
<text class="form-item-title">*时间</text> <text class="form-item-title">*时间</text>
<view class="form-item-right"> <view class="form-item-right">
<input placeholder="请输入货期时间(天)" placeholder-class="placeholderClass" type="number" name="day" value="{{day}}"></input> <input placeholder="请输入货期时间(天)" placeholder-class="placeholderClass" type="text" name="day" value="{{day}}"></input>
</view> </view>
</view> </view>
<!-- <button class="btn-com btn-com-b hf-btn " form-type="submit" style="margin-bottom:{{'goodId'&&'32rpx'}}"> --> <!-- <button class="btn-com btn-com-b hf-btn " form-type="submit" style="margin-bottom:{{'goodId'&&'32rpx'}}"> -->
......
...@@ -16,13 +16,15 @@ Page({ ...@@ -16,13 +16,15 @@ Page({
total: 0, total: 0,
textareaVal: '', textareaVal: '',
id: null, id: null,
isClick: true isClick: true,
isWarm: false,
isShowTip: true
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function (options) { onLoad: function(options) {
this.setData({ this.setData({
id: options.id id: options.id
}) })
...@@ -31,62 +33,67 @@ Page({ ...@@ -31,62 +33,67 @@ 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() {
}, },
closeTip: function() {
textareaChange: function (e) { this.setData({
isShowTip: false
})
},
textareaChange: function(e) {
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) {
let index = e.currentTarget.dataset.index; let index = e.currentTarget.dataset.index;
this.setData({ this.setData({
defaulType: index defaulType: index
}) })
}, },
releaseRate: function () { releaseRate: function() {
if (!this.data.textareaVal.trim().length) { if (!this.data.textareaVal.trim().length) {
tips('请填写评价内容'); tips('请填写评价内容');
} else { } else {
let obj = { let obj = {
token: wx.getStorageSync('access_token') || '', token: wx.getStorageSync('access_token') || '',
offer_id: this.data.id, offer_id: this.data.id,
...@@ -98,23 +105,22 @@ Page({ ...@@ -98,23 +105,22 @@ Page({
me.setData({ me.setData({
isClick: false isClick: false
}) })
getData(apis.evaluateAdd, 'get', obj, function (res) { getData(apis.evaluateAdd, 'get', obj, function(res) {
me.setData({
isClick: true
});
if (res.errcode == 0) { if (res.errcode == 0) {
tips('评价成功'); tips('评价成功');
me.setData({
isClick: true
});
setTimeout(() => { setTimeout(() => {
wx.navigateBack() wx.navigateBack()
}, 1000) }, 1000)
} else if (res.errcode == 107040) { //含敏感词汇
} else {
me.setData({ me.setData({
isClick: true isWarm:true,
}); isShowTip:true
})
} else {
tips(res.errmsg) tips(res.errmsg)
} }
}, true) }, true)
} }
......
<!--pages/form/rate/index.wxml--> <!--pages/form/rate/index.wxml-->
<view class="rate-form"> <view class="rate-form">
<view class="tip row bothSide verCenter tip-error"> <view class="tip row bothSide verCenter {{isWarm?'tip-error':''}} {{isShowTip?'':'noheight'}}">
<view class="tip-left row verCenter"> <view class="tip-left row verCenter">
<!-- <text class="icon iconfont iconiconxiantiaoshouji12 tip-icon"></text> --> <text class="icon iconfont tip-icon {{isWarm?'iconiconxiantiaoshouji1 error-icon':'iconiconxiantiaoshouji12'}}"></text>
<!-- <text class="tip-c">评论内容,一条回复报价仅评价一次</text> --> <text class="tip-c {{isWarm?'error-text':''}}">{{isWarm?'提示:您的内容存在敏感词汇,请编辑后再发布':'评论内容,一条回复报价仅评价一次'}}</text>
<text class="icon iconfont iconiconxiantiaoshouji1 tip-icon error-icon"></text>
<text class="tip-c error-text">提示:您的内容存在敏感词汇,请编辑后再发布</text>
</view> </view>
<text class="icon iconfont iconiconxiantiaoshouji13 close-icon"></text> <text class="icon iconfont iconiconxiantiaoshouji13 close-icon" bindtap="closeTip"></text>
</view> </view>
<view class="form"> <view class="form">
<view class="textarea-view"> <view class="textarea-view">
......
...@@ -54,13 +54,14 @@ Page({ ...@@ -54,13 +54,14 @@ Page({
if (!obj.day.trim().length) { if (!obj.day.trim().length) {
tips('请填写货期'); tips('请填写货期');
return return
} else if (isNaN(Number(obj.day.trim()))) { }
tips('货期必须为数字'); // else if (isNaN(Number(obj.day.trim()))) {
return // tips('货期必须为数字');
} else if (obj.day.trim().length > 3) { // return
tips('货期不能大于3个字符'); // } else if (obj.day.trim().length > 3) {
return // tips('货期不能大于3个字符');
} // return
// }
} }
} }
this.postData(obj); this.postData(obj);
......
...@@ -69,7 +69,7 @@ ...@@ -69,7 +69,7 @@
<view class="form-item row verCenter px-hr-top" hidden="{{!isShowTime}}"> <view class="form-item row verCenter px-hr-top" hidden="{{!isShowTime}}">
<text class="form-item-title">*时间</text> <text class="form-item-title">*时间</text>
<view class="form-item-right"> <view class="form-item-right">
<input placeholder="请输入货期时间(天)" placeholder-class="placeholderClass" type="number" name="day"></input> <input placeholder="请输入货期时间(天)" placeholder-class="placeholderClass" type="text" name="day"></input>
</view> </view>
</view> </view>
<view class="form-hr"></view> <view class="form-hr"></view>
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
<view class="rate-item" wx:for="{{rateList}}" wx:key="{{index}}"> <view class="rate-item" wx:for="{{rateList}}" wx:key="{{index}}">
<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="{{item.avatar||'/res/images/imgs/s.png'}}" class="img"></image> <image src="{{item.evaluate_avatar||'/res/images/imgs/s.png'}}" class="img"></image>
<text class="name">{{item.evaluate_company_name||'--'}}</text> <text class="name">{{item.evaluate_company_name||'--'}}</text>
</view> </view>
<view class="top-right row verCenter"> <view class="top-right row verCenter">
......
...@@ -57,7 +57,7 @@ ...@@ -57,7 +57,7 @@
<view class="rate-item" wx:for="{{rateList}}" wx:key="{{index}}"> <view class="rate-item" wx:for="{{rateList}}" wx:key="{{index}}">
<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="{{item.avatar||'/res/images/imgs/s.png'}}" class="img"></image> <image src="{{item.evaluate_avatar||'/res/images/imgs/s.png'}}" class="img"></image>
<text class="name">{{item.evaluate_company_name||'--'}}</text> <text class="name">{{item.evaluate_company_name||'--'}}</text>
</view> </view>
<view class="top-right row verCenter"> <view class="top-right row verCenter">
......
...@@ -72,12 +72,10 @@ Page({ ...@@ -72,12 +72,10 @@ Page({
wx.login({ wx.login({
success(res) { success(res) {
if (res.code) { if (res.code) {
//存储用户资料 //存储用户资料
self.setData({ self.setData({
userinfo: e.detail.userInfo userinfo: e.detail.userInfo
}); });
//获取openId //获取openId
http.getData(apis.getOpenId, 'GET', { http.getData(apis.getOpenId, 'GET', {
code: res.code, code: res.code,
......
...@@ -65,7 +65,15 @@ Page({ ...@@ -65,7 +65,15 @@ Page({
*/ */
getPhoneNumber(e) { getPhoneNumber(e) {
if (e.detail.errMsg == 'getPhoneNumber:ok') { if (e.detail.errMsg == 'getPhoneNumber:ok') {
console.log(
{
openid: wx.getStorageSync('openid'),
session_key: wx.getStorageSync('session_key'),
encryptedData: e.detail.encryptedData,
iv: e.detail.iv
}
)
return
http.getData(apis.getwxUserInfo, 'GET', { http.getData(apis.getwxUserInfo, 'GET', {
openid: wx.getStorageSync('openid'), openid: wx.getStorageSync('openid'),
session_key: wx.getStorageSync('session_key'), session_key: wx.getStorageSync('session_key'),
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<image src="/res/images/imgs/nomessage.png" class="img"></image> <image src="/res/images/imgs/nomessage.png" class="img"></image>
<view class="h3 bold">暂无询价消息</view> <view class="h3 bold">暂无询价消息</view>
</view> --> </view> -->
<view class="message-content" wx:if="{{!isCustomer||arr.length}}"> <view class="message-content">
<view class="tip row bothSide verCenter {{isShowTip?'':'noheight'}}"> <view class="tip row bothSide verCenter {{isShowTip?'':'noheight'}}">
<view class="tip-left row verCenter"> <view class="tip-left row verCenter">
<text class="icon iconfont iconiconxiantiaoshouji12 tip-icon"></text> <text class="icon iconfont iconiconxiantiaoshouji12 tip-icon"></text>
......
...@@ -48,15 +48,9 @@ const getImUser = () => { ...@@ -48,15 +48,9 @@ const getImUser = () => {
wx.setStorageSync('company_name', res.data.company_name || ''); wx.setStorageSync('company_name', res.data.company_name || '');
wx.setStorageSync("myUsername", res.data.im_username); wx.setStorageSync("myUsername", res.data.im_username);
wx.setStorageSync("myPassword", res.data.im_password); wx.setStorageSync("myPassword", res.data.im_password);
// wx.setStorageSync("imNick", res.data.company_name || (res.data.mobile ? res.data.mobile.replace(reg, '$1****$2') : '') || res.data.wechat_oauth.oauth_nickname || ''); // wx.setStorageSync("myUsername",'001');
// wx.setStorageSync("myPassword", '123456789');
getBlackList(token, res.data.im_username, res.data.im_password); getBlackList(token, res.data.im_username, res.data.im_password);
// conn.open({
// apiUrl: WebIM.config.apiURL,
// user: res.data.im_username,
// pwd: res.data.im_password,
// appKey: WebIM.config.appkey
// })
} else { } else {
console.log('获取环信账号失败') console.log('获取环信账号失败')
} }
...@@ -77,6 +71,8 @@ const getBlackList = (token,name,pwd) => { //获取黑名单列表 ...@@ -77,6 +71,8 @@ const getBlackList = (token,name,pwd) => { //获取黑名单列表
apiUrl: WebIM.config.apiURL, apiUrl: WebIM.config.apiURL,
user:name, user:name,
pwd: pwd, pwd: pwd,
// user:'001',
// pwd:'123456789',
appKey: WebIM.config.appkey appKey: WebIM.config.appkey
}) })
} else { } else {
......
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