diff --git a/app.js b/app.js index b4edc66..f143bb1 100644 --- a/app.js +++ b/app.js @@ -1,7 +1,7 @@ //app.js App({ - release: false, + release: true, httpUrl: 'https://api-test.qniao.cn', tmplIds: ['kg0T1ve0FpYrEtZ4ExbypHm8mtS7OJaehvqN_T9ypoI'], globalData: { @@ -15,14 +15,8 @@ if (this.release) { this.httpUrl = 'https://api.qniao.cn' } else { - this.httpUrl = 'https://api-test.qniao.cn' + this.httpUrl = 'http://api-test.qniao.cn' } - // wx.loadFontFace({ - // family: 'DINAlternate', - // source: 'url("https://medou.oss-cn-shenzhen.aliyuncs.com/ttf/DIN-BoldAlternate.otf")', - // success: function (res) { - // } - // }) wx.getSystemInfo({ success: e => { this.globalData.StatusBar = e.statusBarHeight; diff --git a/colorui/main.wxss b/colorui/main.wxss index 2539e18..990c256 100644 --- a/colorui/main.wxss +++ b/colorui/main.wxss @@ -756,7 +756,7 @@ button.icon.lg { padding-right: 30rpx; height: 72rpx; line-height: 72rpx; - font-size: 32rpx; + font-size: 30rpx; background-color: transparent; } diff --git a/components/tab/index.wxss b/components/tab/index.wxss index d6a53bc..5338e17 100644 --- a/components/tab/index.wxss +++ b/components/tab/index.wxss @@ -39,7 +39,7 @@ } .tabs__item--cur { color: #008AFF; - font-size: 32rpx; + font-size: 30rpx; } .tabs__item-child { display: inline-block; diff --git a/pages/mall/order-info/index.wxs b/pages/mall/order-info/index.wxs deleted file mode 100644 index c4527a7..0000000 --- a/pages/mall/order-info/index.wxs +++ /dev/null @@ -1,148 +0,0 @@ -function getDispatchDetailByIndex(form, index) { - if (index === 5) { - if (!isEmpty(form.schedulingNotesVehicleVos) && form.schedulingNotesVehicleVos.length >= 1) { - var centerName = '外部' - if (!isEmpty(form.schedulingNotesVehicleVos[0].vehicleOperationCenterName)) { - centerName = form.schedulingNotesVehicleVos[0].vehicleOperationCenterName.replace('工厂', '') - } - return '[' + centerName + ']' + form.schedulingNotesVehicleVos[0].driver - } - } else if (index === 6) { - if (!isEmpty(form.schedulingNotesVehicleVos) && form.schedulingNotesVehicleVos.length >= 1) { - return form.schedulingNotesVehicleVos[0].phone - } - } else if (index === 7) { - if (!isEmpty(form.schedulingNotesVehicleVos) && form.schedulingNotesVehicleVos.length >= 1) { - return form.schedulingNotesVehicleVos[0].plateNumber - } - } else if (index === 8) { - if (!isEmpty(form.schedulingNotesVehicleVos) && form.schedulingNotesVehicleVos.length >= 1) { - return (form.schedulingNotesVehicleVos[0].wheelBase / 10 ).toFixed(1) - } - } else if (index === 9) { - if (!isEmpty(form.schedulingNotesVehicleVos) && form.schedulingNotesVehicleVos.length >= 2) { - var wai = '' - if (form.schedulingNotesVehicleVos[1].isSelfSupport !== 1 ) { - wai = '/外' - } - return ( - form.schedulingNotesVehicleVos[1].plateNumber + - '(' + getTruckString(form.schedulingNotesVehicleVos[1].vehicleType) + ')' + wai - ) - } - } else if (index === 10) { - if (!isEmpty(form.schedulingNotesVehicleVos) && form.schedulingNotesVehicleVos.length >= 2) { - return form.schedulingNotesVehicleVos[1].driver - } - } else if (index === 11) { - if (!isEmpty(form.schedulingNotesVehicleVos) && form.schedulingNotesVehicleVos.length > 2) { - var wai2 = '' - if (form.schedulingNotesVehicleVos[2].isSelfSupport !== 1) { - wai2 = '/外' - } - return ( - form.schedulingNotesVehicleVos[2].plateNumber + - '(' + getTruckString(form.schedulingNotesVehicleVos[2].vehicleType) + ')' + wai2 - ) - } - } else if (index === 12) { - if (!isEmpty(form.schedulingNotesVehicleVos) && form.schedulingNotesVehicleVos.length > 2) { - return form.schedulingNotesVehicleVos[2].driver - } - } else if (index === 13) { - var loaderString = '' - if (!isEmpty(form.loaders)) { - for (var i = 0; i < form.loaders.length; i++) { - if (isEmpty(loaderString)) { - loaderString += toLoaderString( form.loaders[i]) - } else { - loaderString += ';' + toLoaderString(form.loaders[i]) - } - } - } - return loaderString - } - return '' -} - -function isEmpty(val) { - return typeof val === 'undefined' || val === '' || val === null -} - -function getTruckString(type){ - if (type == 1) { - return '抱车' - } else if (type == 2) { - return '铲车' - } else if (type == 3) { - return '叉拖车' - } else if (type == 4) { - return '货车' - } - return '' -} - -function toLoaderString(loader) { - var ldString = '' - var centerName = '外部' - if (!isEmpty(loader.operationCenterName)) { - centerName = loader.operationCenterName.replace('工厂', '') - } - ldString += '[' + centerName + ']' - if (!isEmpty(loader.name)) { - ldString += loader.name - } - if (loader.isEmployee === 0) { - ldString += '/外' - } - return ldString -} - -function showLayoutByIndex(form, index){ - if (index === 1) { - if (!isEmpty(form.schedulingNotesVehicleVos) && form.schedulingNotesVehicleVos.length >= 2) { - return ( form.schedulingNotesVehicleVos[1].vehicleType === 1 || form.schedulingNotesVehicleVos[1].vehicleType === 2) - } - } else if (index === 2) { - if (!isEmpty(form.schedulingNotesVehicleVos) && form.schedulingNotesVehicleVos.length >= 3) { - return (form.schedulingNotesVehicleVos[2].vehicleType === 3 ) - } - } else if (index === 3) { - if (!isEmpty(form.loaders) && form.loaders.length >= 1) { - return true - } - } - return false -} - -function getSchedulingDate(form){ - if (isEmpty(form.schedulingDate)) { - return '' - } - var date = getDate(form.schedulingDate.trim()) - var today = getDate() - var dayCode = 24 * 60 * 60 * 1000 - console.log((date.getTime() - today.getTime()) / dayCode) - var week = '' - if (date.getTime() === today.getTime()) { - week = '(今天)' - } else if (date.getTime() === today.getTime() + dayCode) { - week = '(明天)' - } else if (date.getTime() === today.getTime() - dayCode) { - week = '(昨天)' - } else if (date.getTime() === today.getTime() + dayCode * 2) { - week = '(后天)' - } else { - week = ['(周日)', '(周一)', '(周二)', '(周三)', '(周四)', '(周五)', '(周六)'][date.getDay()] - } - if (isEmpty(week)) { - week = '' - } - return form.schedulingDate + week -} - -module.exports = { - getSchedulingDate: getSchedulingDate, - getDispatchDetailByIndex: getDispatchDetailByIndex, - showLayoutByIndex: showLayoutByIndex -} \ No newline at end of file diff --git a/pages/mall/order-offer/index.js b/pages/mall/order-offer/index.js index 6fa9464..580da4f 100644 --- a/pages/mall/order-offer/index.js +++ b/pages/mall/order-offer/index.js @@ -1,9 +1,7 @@ // pages/task/task-detail/index.js -import { $wuxDialog } from '../../../components/index' const request = require('../../../utils/request'); //导入模块 const util = require('../../../utils/util'); const float = require('../../../utils/floatObj'); -const event = require('../../../utils/event.js') const app = getApp() Page({ @@ -21,7 +19,6 @@ Page({ * 生命周期函数--监听页面加载 */ onLoad: function (options) { - event.on('EventMessage', this, this.onEvent) if (options.json) { var form = JSON.parse(options.json) form.payType = 1 @@ -34,12 +31,6 @@ Page({ }) } }, - // 事件处理 - onEvent: function (message) { - if (message.what == 10 && message.arg == 1) { - wx.navigateBack() - } - }, chooseAddress() { wx.chooseAddress({ @@ -53,9 +44,9 @@ Page({ checkMode: function (e) { var preAmount = 0 - if(e.currentTarget.dataset.index == 1){ + if (e.currentTarget.dataset.index == 1) { preAmount = float.accMul(float.accMul(this.data.form.unitPrice, this.data.form.number), 0.1).toFixed(2) - } else if(e.currentTarget.dataset.index == 2){ + } else if (e.currentTarget.dataset.index == 2) { preAmount = float.accMul(this.data.form.unitPrice, this.data.form.number).toFixed(2) } this.setData({ @@ -83,44 +74,19 @@ Page({ }] }) }, - + // 创建订单 offerProject: function (e) { if (!this.data.addressInfo) { util.showToast('请选择收货地址') return } - if (Number(this.data.form.payType) == 1) { - // 微信支付 - // wx.requestPayment({ - // 'timeStamp': '', - // 'nonceStr': '', - // 'package': '', - // 'signType': 'MD5', - // 'paySign': '', - // 'success': function (res) { - - // }, - // 'fail': function (res) { - - // }, - // 'complete': function (res) { - - // } - // }) - util.showToast('进行中,请选择货到付款') - } else { - this.postOrder(0) - } - }, - // 创建订单 - postOrder: function(realPrice){ var data = {} data.productId = Number(this.data.form.productId) data.skuId = this.data.form.skuId data.number = this.data.form.number data.sellMode = Number(this.data.form.sellMode) data.payType = Number(this.data.form.payType) - data.realPrice = realPrice + data.realPrice = data.payType == 1 ? this.data.form.preAmount : 0 data.unitPrice = this.data.form.unitPrice data.totalPrice = this.data.form.totalPrice data.mobile = this.data.addressInfo.telNumber @@ -134,22 +100,39 @@ Page({ request.post('/bxe-mall/order', data).then(result => { //成功回调 wx.hideLoading() - wx.requestSubscribeMessage({ - tmplIds: app.tmplIds, - complete (res) { - wx.redirectTo({url: '/pages/mall/order-result/index?type=1'}) - } - }) + if (data.payType == 1) { + this.requestPayment(result.data.wxpay) + } else { + wx.requestSubscribeMessage({ + tmplIds: app.tmplIds, + complete(res) { + wx.redirectTo({ + url: '/pages/mall/order-result/index?type=1' + }) + } + }) + } }).catch(err => { //异常回调 wx.hideLoading() - wx.redirectTo({ - url: '/pages/mall/order-result/index?type=0&message=' + err - }) + if (data.payType == 2) { + wx.redirectTo({ + url: '/pages/mall/order-result/index?type=0&message=' + err + }) + } }) }, - // event的unregister - onUnload: function () { - event.remove('EventMessage', this) + // 微信支付流程 + requestPayment: function (data) { + data.success = function(res){ + util.showToast('订单支付成功') + wx.redirectTo({ + url: '/pages/mall/order-result/index?type=1' + }) + } + data.fail = function(res){ + util.showToast('订单支付失败') + } + wx.requestPayment(data) } }) \ No newline at end of file diff --git a/pages/mall/order-offer/index.wxml b/pages/mall/order-offer/index.wxml index 1f52842..716339b 100644 --- a/pages/mall/order-offer/index.wxml +++ b/pages/mall/order-offer/index.wxml @@ -8,7 +8,7 @@ - + {{addressInfo.userName}} {{addressInfo.provinceName + addressInfo.cityName + addressInfo.countyName + addressInfo.detailInfo}} diff --git a/pages/mall/search-list/index.js b/pages/mall/search-list/index.js index 83dcac1..af54507 100644 --- a/pages/mall/search-list/index.js +++ b/pages/mall/search-list/index.js @@ -144,6 +144,7 @@ Page({ this.setData({ rearchStringList: strList, focus: false, + finished: true, loading: false }) } diff --git a/pages/mall/search-list/index.wxml b/pages/mall/search-list/index.wxml index d29e828..66062e4 100644 --- a/pages/mall/search-list/index.wxml +++ b/pages/mall/search-list/index.wxml @@ -31,7 +31,7 @@ 加载中... - + 暂无数据 diff --git a/pages/mall/shops/index.js b/pages/mall/shops/index.js index d959ea3..829c066 100644 --- a/pages/mall/shops/index.js +++ b/pages/mall/shops/index.js @@ -120,6 +120,7 @@ Page({ if (this.data.requesting || this.data.finished) { return } + console.log('fetchTaskList>>>') if(this.data.loading){ this.data.requesting = true } else { @@ -140,6 +141,10 @@ Page({ ['form.pageNum']: (num + 1), finished }) + } else { + this.setData({ + finished: true + }) } }).catch(err => { //异常回调 diff --git a/pages/mall/shops/index.wxml b/pages/mall/shops/index.wxml index df795fa..4536a1a 100644 --- a/pages/mall/shops/index.wxml +++ b/pages/mall/shops/index.wxml @@ -96,7 +96,7 @@ - + 暂无数据