Commit 11a11554 by 施宇

111

parent ecc7aa04
......@@ -19,11 +19,29 @@ App({
customerName: "IC助手客服",
isRelogin: true, //登入环信失败后是否重新登入,只允许重新登入一次
bus: bus,
imBoolean:false,
imBoolean: false,
},
setNav: function () {//设置导航
let menuButtonObject = wx.getMenuButtonBoundingClientRect();
wx.getSystemInfo({
success: res => {
//导航高度
let statusBarHeight = res.statusBarHeight,
navTop = menuButtonObject.top,
navHeight = statusBarHeight + menuButtonObject.height + (menuButtonObject.top - statusBarHeight) * 2;
this.globalData.navHeight = navHeight;
this.globalData.navTop = navTop;
this.globalData.windowHeight = res.windowHeight;
},
fail(err) {
console.log(err);
}
})
},
getImUser: chat.getImUser,
conn: chat.conn,
addChatMember: function(id, userId) { //id为环信id userId为账户id
addChatMember: function (id, userId) { //id为环信id userId为账户id
let token = wx.getStorageSync('access_token') || '';
this.addChatMemberStorage(id);
......@@ -31,7 +49,7 @@ App({
getData(apis.addrecord, 'GET', {
"token": token,
"user_id": userId
}, function(res) {
}, function (res) {
if (res.errcode === 0) {
} else {
......@@ -39,7 +57,7 @@ App({
}
}, false);
},
addChatMemberStorage: function(id) {
addChatMemberStorage: function (id) {
let member = wx.getStorageSync("member") || [];
member.push(id);
wx.setStorageSync("member", member)
......@@ -47,6 +65,7 @@ App({
onLaunch() {
wx.removeStorageSync('im');
this.versionUpdate();
this.setNav();
//验证是否授权
if (this.globalData.auth) {
//是否登录
......@@ -60,7 +79,7 @@ App({
});
}
} else {
if (!judgeToken()){
if (!judgeToken()) {
wx.reLaunch({
url: '/pages/person/auth/index'
});
......@@ -75,23 +94,23 @@ App({
chat.webimListen();
this.checkIsIPhoneX();
},
versionUpdate: function() {//小程序检测版本更新
versionUpdate: function () { //小程序检测版本更新
if (wx.canIUse('getUpdateManager')) {
const updateManager = wx.getUpdateManager()
updateManager.onCheckForUpdate(function(res) {
updateManager.onCheckForUpdate(function (res) {
if (res.hasUpdate) {
updateManager.onUpdateReady(function() {
updateManager.onUpdateReady(function () {
wx.showModal({
title: '更新提示',
content: '新版本已经准备好,是否重启应用?',
success: function(res) {
success: function (res) {
if (res.confirm) {
updateManager.applyUpdate()
}
}
})
})
updateManager.onUpdateFailed(function() {
updateManager.onUpdateFailed(function () {
wx.showModal({
title: '已经有新版本了哟~',
content: '新版本已经上线啦~,请您删除当前小程序,重新搜索打开哟~'
......@@ -106,10 +125,10 @@ App({
})
}
},
checkIsIPhoneX: function() {
checkIsIPhoneX: function () {
const me = this
wx.getSystemInfo({
success: function(res) {
success: function (res) {
// 根据 model 进行判断
if (res.model.search('iPhone X') != -1) {
me.globalData.isIPX = true
......
......@@ -59,7 +59,6 @@
"window": {
"backgroundTextStyle": "light",
"navigationBarBackgroundColor": "#fff",
"navigationBarTitleText": "WeChat",
"navigationBarTextStyle": "black"
},
"tabBar": {
......
......@@ -3,7 +3,7 @@
<block>
<!-- 询报价展示 -->
<block wx:if="{{priceType==1}}">
<view class="price-item" wx:for="{{priceList}}" wx:key="{{index}}" bindtap="emitevent" data-inquiryitemsid="{{item['inquiry_items_id']}}" data-offerid="{{item['offer_id']}} " data-type="{{xb}}" data-pricetype="1" data-isclick="{{isClick}}">
<view class="price-item" wx:for="{{priceList}}" wx:key="{{index}}" catchtap="emitevent" data-inquiryitemsid="{{item['inquiry_items_id']}}" data-offerid="{{item['offer_id']}} " data-type="{{xb}}" data-pricetype="1" data-isclick="{{isClick}}">
<view class="item-header px-hr-bottom row verCenter bothSide nowrap">
<view class="row verCenter">
<text class="mark xun" wx:if="{{xb==1}}">询</text>
......@@ -40,7 +40,7 @@
</block>
<!-- 搜索页的商品展示 -->
<block wx:if="{{priceType==2}}">
<view class="price-item" wx:for="{{priceList}}" wx:key="{{index}}" bindtap="emitevent" data-goodid="{{item.goods_id}}" data-pricetype="2">
<view class="price-item" wx:for="{{priceList}}" wx:key="{{index}}" catchtap="emitevent" data-goodid="{{item.goods_id}}" data-pricetype="2">
<view class="item-header px-hr-bottom row verCenter bothSide nowrap ">
<view class="row verCenter">
<text class="mark bao">
......@@ -76,7 +76,7 @@
</block>
<!-- 搜索页面询报价展示 -->
<block wx:if="{{priceType==3}}">
<view class="price-item" wx:for="{{priceList}}" wx:key="{{index}}" bindtap="emitevent" data-inquiryitemsid="{{item['inquiry_items_id']}}" data-offerid="{{item['offer_id']}} " data-type="{{xb}}" data-pricetype="3" data-isclick="{{isClick}}">
<view class="price-item" wx:for="{{priceList}}" wx:key="{{index}}" catchtap="emitevent" data-inquiryitemsid="{{item['inquiry_items_id']}}" data-offerid="{{item['offer_id']}} " data-type="{{xb}}" data-pricetype="3" data-isclick="{{isClick}}">
<view class="item-header px-hr-bottom row verCenter bothSide nowrap">
<view class="row verCenter">
<text class="mark xun" wx:if="{{xb==1}}">询价</text>
......@@ -91,7 +91,10 @@
<text class="num-bj" wx:if="{{item.offer_num}}">{{item.offer_num}}个报价</text>
<text class="no-bj" wx:else>等待报价</text>
</block>
<text class="price" wx:else>¥{{item.price}}</text>
<text class="price" wx:else>
<block wx:if="{{item.currency == 1}}">¥{{item.price}}</block>
<block wx:else>${{item.price}}</block>
</text>
</view>
<view class="item-middle row verCenter nowrap">
<text class="brand ellipsis"><text>品牌:</text>{{item.brand_name}}</text>
......@@ -104,7 +107,7 @@
</block>
<!-- 我的报价展示 -->
<block wx:if="{{priceType==4}}">
<view class="price-item" wx:for="{{priceList}}" wx:key="{{index}}" bindtap="emitevent">
<view class="price-item" wx:for="{{priceList}}" wx:key="{{index}}" catchtap="emitevent">
<view class="item-header px-hr-bottom row verCenter bothSide nowrap">
<view class="row verCenter">
<text class="mark bao">报价</text>
......@@ -143,7 +146,7 @@
</block>
<!-- 商品管理 -->
<block wx:if="{{priceType == 5}}">
<view class="price-item good-item" wx:for="{{priceList}}" wx:key="{{index}}" bindtap="emitevent" data-goodid="{{item.goods_id}}" data-pricetype="5">
<view class="price-item good-item" wx:for="{{priceList}}" wx:key="{{index}}" catchtap="emitevent" data-goodid="{{item.goods_id}}" data-pricetype="5">
<view class="item-header row verCenter bothSide nowrap good-header">
<view class="row verCenter">
<text class="name ellipsis good-name">{{item.goods_name}}</text>
......
// components/tohome/index.js
Component({
/**
* 组件的属性列表
*/
properties: {
homeShow: { //是否展示该home图标
type: Boolean
},
},
/**
* 组件的初始数据
*/
data: {
},
/**
* 组件的方法列表
*/
methods: {
tohome: function() {
wx.switchTab({
url: '/pages/tab/home/home'
});
}
}
})
\ No newline at end of file
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
<!--components/tohome/index.wxml-->
<view class="to-home-view" wx:if="{{homeShow}}" >
<image src="../../res/images/icons/tohome.png" catchtap="tohome"></image>
</view>
\ No newline at end of file
/* components/tohome/index.wxss */
.to-home-view{
position: fixed;
bottom:103rpx;
right:24rpx;
height:80rpx;
width:80rpx;
background-color: #000;
opacity: .2;
border-radius: 50% 50%;
z-index: 99;
}
.to-home-view image{
height:50rpx;
width:50rpx;
margin:15rpx 0 0 15rpx;
}
\ No newline at end of file
......@@ -17,7 +17,8 @@ Page({
info: null,
editOrShow: -1, //1编辑 2在线沟通
goodId: "",
type: ""
type: "",//1 自己 2 别人 3 分享
homeShow: false,
},
/**
......@@ -27,7 +28,9 @@ Page({
let me = this;
this.setData({
goodId: options.goodId || '',
type: options.type || ''
type: options.type || '',
homeShow: options.type == 3 ? true : false
});
this.getData(false,true)
getApp().globalData.bus.off('editGood');
......
{
"usingComponents": {},
"usingComponents": {
"tohome": "/components/tohome/index"
},
"navigationBarBackgroundColor": "#0D84D1",
"navigationBarTextStyle": "white",
"backgroundColor": "#0d84d1",
......
<!--pages/detail/good/index.wxml-->
<wxs module="dateUtil" src="../../../utils/timeUtil.wxs"></wxs>
<tohome home-show="{{homeShow}}"></tohome>
<view class="detail-view">
<view class="t-desc">
<view class="t-desc-content" wx:if="{{info}}">
......
......@@ -19,7 +19,10 @@ Page({
currency: 0,
isClick: true,
isShowTip: true,
array: ['RMB', 'USD']
array: ['RMB', 'USD'],
obj:{},
hq:"1",
day:""
},
bindPickerChange: function (e) {
this.setData({
......@@ -54,13 +57,11 @@ Page({
if (!obj.day.trim().length) {
tips('请填写货期');
return
} else if (isNaN(Number(obj.day.trim()))) {
tips('货期必须为数字');
return
} else if (obj.day.trim().length > 3) {
tips('货期不能大于3个字符');
return
}
// else if (obj.day.trim().length > 3) {
// tips('货期不能大于3个字符');
// return
// }
}
}
this.postData(obj);
......@@ -120,12 +121,27 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
console.log(options)
this.setData({
inquiryItemsId: options.inquiryItemsId || "",
offerId: options.offerId || "",
type: options.type || ""
type: options.type || "",
obj:JSON.parse(options.obj||'{}')
});
console.log(this.data.obj)
let delivery_time = this.data.obj.delivery_time;
if (this.data.obj.currency=='2'){
this.setData({
currency: 1
})
}
if (delivery_time != '现货') {
let day = delivery_time.replace('天', '');
this.setData({
hq: "2",
isShowTime:true,
day: day
})
}
},
/**
......
......@@ -11,31 +11,31 @@
<view class="form-item row verCenter">
<text class="form-item-title">*型号</text>
<view class="form-item-right">
<input placeholder="请输入产品型号(必填)" placeholder-class="placeholderClass" type="text" name="goods_name"></input>
<input placeholder="请输入产品型号(必填)" placeholder-class="placeholderClass" type="text" name="goods_name" value="{{obj.goods_name}}"></input>
</view>
</view>
<view class="form-item row verCenter px-hr-top">
<text class="form-item-title">*品牌</text>
<view class="form-item-right">
<input placeholder="请输入品牌(必填)" placeholder-class="placeholderClass" type="text" name="brand_name"></input>
<input placeholder="请输入品牌(必填)" placeholder-class="placeholderClass" type="text" name="brand_name" value="{{obj.brand_name}}"></input>
</view>
</view>
<view class="form-item row verCenter px-hr-top">
<text class="form-item-title"> 封装</text>
<view class="form-item-right">
<input placeholder="请输入封装" placeholder-class="placeholderClass" type="text" name="encap"></input>
<input placeholder="请输入封装" placeholder-class="placeholderClass" type="text" name="encap" value="{{obj.encap}}"></input>
</view>
</view>
<view class="form-item row verCenter px-hr-top">
<text class="form-item-title">*数量</text>
<view class="form-item-right">
<input placeholder="请输入数量(必填)" placeholder-class="placeholderClass" type="number" name="number"></input>
<input placeholder="请输入数量(必填)" placeholder-class="placeholderClass" type="number" name="number" value="{{obj.number}}"></input>
</view>
</view>
<view class="form-item row verCenter px-hr-top bj-item">
<text class="form-item-title">*报价</text>
<view class="form-item-right row verCenter bothSide">
<input placeholder="请输入单价" placeholder-class="placeholderClass" type="digit" name="price"></input>
<input placeholder="请输入单价" placeholder-class="placeholderClass" type="digit" name="price" value="{{obj.price}}"></input>
<picker class="price-type" value="{{currency}}" range="{{array}}" bindchange="bindPickerChange">
<text class="price-value">{{array[currency]}}</text>
<text class="icon iconfont iconbianzu1"></text>
......@@ -47,10 +47,10 @@
<view class="form-item-right">
<radio-group name="hq" bindchange="radioChange">
<label>
<radio value="1" checked/>现货
<radio value="1" checked="{{hq==1}}" />现货
</label>
<label>
<radio value="2" />期货
<radio value="2" checked="{{hq==2}}" />期货
</label>
</radio-group>
</view>
......@@ -58,14 +58,14 @@
<view class="form-item row verCenter px-hr-top" hidden="{{!isShowTime}}">
<text class="form-item-title">*时间</text>
<view class="form-item-right">
<input placeholder="请输入货期时间(天)" placeholder-class="placeholderClass" type="number" name="day"></input>
<input placeholder="请输入货期时间(天)" placeholder-class="placeholderClass" type="number" name="day" value="{{day}}"></input>
</view>
</view>
<view class="form-hr"></view>
<view class="form-item row px-hr-bottom">
<text class="form-item-title">备注</text>
<view class="form-item-right">
<textarea placeholder="请输入备注" placeholder-class="placeholderClass" maxlength="-1" name="remark"/>
<textarea placeholder="请输入备注" placeholder-class="placeholderClass" maxlength="-1" name="remark" value="{{obj.remark}}" />
</view>
</view>
<button class="btn-com btn-com-b hf-btn" form-type="submit">回复报价</button>
......
......@@ -84,7 +84,6 @@ Page({
});
if (infoObj.delivery_time !== '现货') {
let day = infoObj.delivery_time.replace('天', '');
console.log(day)
this.setData({
isShowTime: 2,
hq: 2,
......@@ -121,13 +120,14 @@ Page({
if (!obj.day.trim().length) {
tips('请填写货期');
return
} else if (isNaN(Number(obj.day.trim()))) {
tips('货期必须为数字');
return
} else if (obj.day.trim().length > 3) {
tips('货期不能大于3个字符');
return
}
// else if (isNaN(Number(obj.day.trim()))) {
// tips('货期必须为数字');
// return
// } else if (obj.day.trim().length > 3) {
// tips('货期不能大于3个字符');
// return
// }
}
}
this.postData(obj);
......
......@@ -23,6 +23,7 @@ Page({
offerId: "",
// isShowImg: false,
isShareType: 0, //分享后点进来的页面 1代表自己的询价 2代表别人的询价
homeShow:false,
},
/**
......@@ -33,7 +34,8 @@ Page({
this.setData({
inquiryItemsId: options.inquiryItemsId || '',
type: options.type || '',
offerId: options.offerId || ''
offerId: options.offerId || '',
homeShow: options.type == 3 ? true:false
});
this.getTopInfo();
if (this.data.type == 1) {
......@@ -202,7 +204,7 @@ Page({
onPullDownRefresh: function() {
},
companyHome: function () {//跳转到公司首页
companyHome: function() { //跳转到公司首页
let userId = wx.getStorageSync("user_id");
if (this.data.topInfo.user_id == userId) {
wx.navigateTo({
......@@ -219,7 +221,7 @@ Page({
* 页面上拉触底事件的处理函数
*/
onReachBottom: function() {
if (this.data.type == 2 || this.data.isShareType==2){
if (this.data.type == 2 || this.data.isShareType == 2) {
return
}
let allPage = Math.ceil(this.data.total / this.data.limit);
......@@ -257,14 +259,27 @@ Page({
duration: 2000
});
} else {
if (this.data.total == 0) {
if (this.data.total == 0) { //新增报价
let info = this.data.topInfo
let obj = {
brand_name: info.brand_name,
currency: info.currency,
delivery_time: info.delivery_time,
encap: info.encap,
goods_name: info.goods_name,
number: info.number,
price: info.price,
remark: info.remark
}
wx.navigateTo({
url: "/pages/form/bj/index?type=1&inquiryItemsId=" + this.data.inquiryItemsId,
url: "/pages/form/bj/index?type=1&inquiryItemsId=" + this.data.inquiryItemsId + '&obj=' + JSON.stringify(obj),
})
} else {
let offerId = this.data.priceList[0].offer_id || ''
} else { //继续报价
let length = this.data.priceList.length;
let offerId = this.data.priceList[0].offer_id || '';
let obj = this.data.priceList[length - 1];
wx.navigateTo({
url: "/pages/form/bj/index?type=2&offerId=" + offerId,
url: "/pages/form/bj/index?type=2&offerId=" + offerId + '&obj=' + JSON.stringify(obj),
})
}
......
{
"usingComponents": {
"priceItem": "/components/priceItem/priceItem"
"priceItem": "/components/priceItem/priceItem",
"tohome": "/components/tohome/index"
},
"navigationBarBackgroundColor": "#0D84D1",
"navigationBarTextStyle": "white",
......
<!--pages/list/xj/index.wxml-->
<wxs module="dateUtil" src="../../../utils/timeUtil.wxs"></wxs>
<tohome home-show="{{homeShow}}"></tohome>
<template name="info">
<view class="xb-com-content">
<view class="x-info">
......@@ -31,7 +32,8 @@
<text class="c-com {{(!topInfo.price||topInfo.price=='0.00'||topInfo.price=='0')?'':'bold red'}}">
<block wx:if="{{!topInfo.price||topInfo.price=='0.00'||topInfo.price=='0'}}">无</block>
<block wx:else>
<block wx:if="{{topInfo.currency == 1}}">¥{{topInfo.price}}</block><block wx:else>${{topInfo.price}}
<block wx:if="{{topInfo.currency == 1}}">¥{{topInfo.price}}</block>
<block wx:else>${{topInfo.price}}
</block>
</block>
</text>
......@@ -55,10 +57,10 @@
<view class="bj-data">
<view class="xb-com-t row bothSide verCenter px-hr-bottom ">
<text class="num bold beforeLine">收到的报价 <text>{{total}}</text></text>
<view class="jgpx">
<!-- <view class="jgpx">
<text class="icon iconfont iconiconxiantiaoshouji10"></text>
<text>价格排序</text>
</view>
</view> -->
</view>
<view class="bj-list">
<view wx:if="{{priceList&&priceList.length==0}}" class="nodata">
......
......@@ -15,7 +15,7 @@
</block>
</view>
<view class="txt">
<textarea name='com_desc' value="{{userInfo.com_desc}}" auto-height placeholder="请输入企业简介" class="tarea" placeholder-class="textarea-placeholder" />
<textarea name='com_desc' value="{{userInfo.com_desc}}" placeholder="请输入企业简介" class="tarea" placeholder-class="textarea-placeholder" />
</view>
<view class="hr"></view>
<view class="list row verCenter bothSide bor">
......
// const auth_url = 'https://authapi.icsales.com';
// const so_url = 'https://soapi.icsales.com';
// const offer_url = "https://offerapi.icsales.com";
// const user_url = 'https://userapi.icsales.com';
// const goods_url = 'https://goodsapi.icsales.com';
// const home_url = 'https://home.icsales.com';
// const welfare_url = 'https://welfareapi.icsales.com'
const auth_url = 'http://authapi.icsales.cc';
const so_url = 'http://soapi.icsales.cc';
const offer_url = "http://offerapi.icsales.cc";
const user_url = 'http://userapi.icsales.cc';
const goods_url = 'http://goodsapi.icsales.cc';
const home_url = 'http://home.icsales.cc';
const welfare_url = 'http://welfareapi.icsales.cc';
const auth_url = 'https://authapi.icsales.com';
const so_url = 'https://soapi.icsales.com';
const offer_url = "https://offerapi.icsales.com";
const user_url = 'https://userapi.icsales.com';
const goods_url = 'https://goodsapi.icsales.com';
const home_url = 'https://home.icsales.com';
const welfare_url = 'https://welfareapi.icsales.com'
// const auth_url = 'http://authapi.icsales.cc';
// const so_url = 'http://soapi.icsales.cc';
// const offer_url = "http://offerapi.icsales.cc";
// const user_url = 'http://userapi.icsales.cc';
// const goods_url = 'http://goodsapi.icsales.cc';
// const home_url = 'http://home.icsales.cc';
// const welfare_url = 'http://welfareapi.icsales.cc';
const apis = {
......
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