diff --git a/app.js b/app.js index f664f36..13244c2 100644 --- a/app.js +++ b/app.js @@ -1,7 +1,7 @@ //app.js App({ //----------------------------------------------globalData-------------------------------------- - evn: 1,//0:开发环境,1:测试环境,2:生产环境 + evn: 0,//0:开发环境,1:测试环境,2:生产环境 tmplIds: ['SUjEgwDopCv9xkkSZ4KbS0L7XbAiVQor6GmPg14K760'], agentMsgIds: ['kG8DErWDpyzBHCFaLlSKYMF7xVy8UpgogCwV_WSNt10', 'lOQ8Gvyy_dTk68bYGpRVnVA0M7DsYYrV81Gd39GUPBA'], version: 152, diff --git a/app.json b/app.json index dfc0bf0..479762c 100644 --- a/app.json +++ b/app.json @@ -2,17 +2,14 @@ "pages": [ "pages/index/index", "pages/login/index", - "pages/paper/index", "pages/home/about/index", "pages/home/service/index", "pages/home/mobile/index", "pages/home/password/index", "pages/home/setting/index", "pages/home/authory/index", - "pages/home/pauthory/index", "pages/home/idcard/index", "pages/home/info/index", - "pages/home/pinfo/index", "pages/home/tab1/index", "pages/home/tab2/index", "pages/home/tab3/index", @@ -38,11 +35,11 @@ "pages/morder/index/index", "pages/morder/create/index", "pages/morder/detail/index", - "pages/order/detail/index", "pages/agent/index/index", "pages/agent/ability/index", "pages/agent/factory/index", "pages/agent/edit/index", + "pages/agent/address/index", "pages/agent/order/index", "pages/agent/detail/index", "pages/agent/result/index", @@ -53,9 +50,6 @@ "pages/bank/bill-detail/index", "pages/bank/edit/index", "pages/bank/password/index", - "pages/balance/index/index", - "pages/balance/fragment/index", - "pages/balance/detail/index", "pages/withdrawal/index/index", "pages/withdrawal/balance/index", "pages/withdrawal/checkout/index", diff --git a/pages/agent/address/index.js b/pages/agent/address/index.js new file mode 100644 index 0000000..cbf0395 --- /dev/null +++ b/pages/agent/address/index.js @@ -0,0 +1,83 @@ +// pages/shop/apply/index.js +import { createAddress } from "../../api/ztb" +const util = require('../../../utils/util') +import regions from '../../../utils/region' +const app = getApp() + +Page({ + /** + * 页面的初始数据 + */ + data: { + safeBottom: app.globalData.safeBottom, + options: regions, + region: [], + form: { + receiver:'', + phone:'', + details:'', + isDefault:'', + locProvinceId: '', + locCityId: '', + districtId: '' + }, + requesting: false + }, + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + this.cascaderView = this.cascaderView || this.selectComponent('#wux-cascader') + this.setData({ safeBottom: app.globalData.safeBottom }) + }, + bindinput: function(e){ + this.data.form[e.target.id] = e.detail.value + }, + showRegion: function(){ + if(this.data.disabled){ + return + } + this.cascaderView.showPicker(this.data.region) + }, + onRegionChange: function (e) { + if (e.detail && e.detail.options) { + this.setData({ + ['form.areaStr']: e.detail.options.map((n) => n.label).join(' '), + region: e.detail.value + }) + this.data.form['locProvinceId'] = e.detail.value[0] + this.data.form['locCityId'] = e.detail.value[1] + this.data.form['districtId'] = e.detail.value[2] + } + }, + submitForm: function(){ + if(util.isEmpty(this.data.form.receiver)){ + util.showToast('请输入收货人') + return + } + if(util.isEmpty(this.data.form.phone)){ + util.showToast('请输入手机号') + return + } + if(util.isEmpty(this.data.form.districtId)){ + util.showToast('请选择店铺所在区域') + return + } + if(util.isEmpty(this.data.form.details)){ + util.showToast('请输入店铺详细地址') + return + } + if(util.isEmpty(this.data.form.isDefault)){ + util.showToast('请确定是否默认') + return + } + wx.showLoading({ title: '处理中', mask: true }) + createAddress(this.data.form).then(res => { + wx.hideLoading() + util.showBackToast('新增地址成功') + }).catch(err => { + wx.hideLoading() + util.showToast(err) + }) + } +}) \ No newline at end of file diff --git a/pages/agent/address/index.json b/pages/agent/address/index.json new file mode 100644 index 0000000..049c4f8 --- /dev/null +++ b/pages/agent/address/index.json @@ -0,0 +1,6 @@ +{ + "usingComponents": { + "wux-button": "/components/button/index", + "wux-cascader": "/components/cascader/index" + } +} \ No newline at end of file diff --git a/pages/agent/address/index.wxml b/pages/agent/address/index.wxml new file mode 100644 index 0000000..7d090b8 --- /dev/null +++ b/pages/agent/address/index.wxml @@ -0,0 +1,32 @@ + + + 送货信息 + + + + 工厂全称: + + + + 所在地区: + {{form.areaStr||'请选择所在地区'}} + + + + + 详细地址: + + + + 发货人姓名: + + + + + + + 提交 + + + + \ No newline at end of file diff --git a/pages/agent/address/index.wxss b/pages/agent/address/index.wxss new file mode 100644 index 0000000..aa83230 --- /dev/null +++ b/pages/agent/address/index.wxss @@ -0,0 +1,12 @@ +/* pages/adress/create/index.wxss */ +.margin-top{ + margin-top: 16rpx; +} + +.page-btn { + height: 27px; + background: rgba(255, 66, 43, 1); + box-shadow: 0px 4px 14px -6px rgba(255, 43, 45, 0.8); + color: white; + font-size: 32rpx; +} \ No newline at end of file diff --git a/pages/api/saas.js b/pages/api/saas.js index deda94b..086112b 100644 --- a/pages/api/saas.js +++ b/pages/api/saas.js @@ -9,7 +9,6 @@ const sconfig = { baseUrl: urls[app.evn] } // *******************************************************************账户业务*********************************************************** -const getOrderExists = () => mGet(`/saas-trade/receive/v150/get/OrderExists`, null, sconfig) const getFinanceLog = (id) => mGet(`/saas-user/account/financeLog/${id}`, null, sconfig) const getFinanceList = (params) => mGet(`/saas-user/account/financeLog/list`, params, sconfig) const sendVerifyCode = (params) => mPost(`/saas-user/user/sendVerifyCode`, params, sconfig) @@ -21,7 +20,6 @@ const checkPayPassword = () => mGet(`/saas-user/account/checkPayPassword`, null, const bankCardDefault = (id) => mPost(`/saas-user/account/bankCardDefault/${id}`, null, sconfig) const udpatePayPassword = (params) => mPost(`/saas-user/user/udpatePayPassword`, params, sconfig) -const getOrderList = (params) => mGet(`/saas-trade/receive/v150/orderListR`, params, sconfig) const getBaseInfo = () => mGet(`/user-centre/front/customer/myInfo`, null, sconfig) const getBalanceInfo = () => mGet(`/saas-user/account/balance`, null, sconfig) const getOrderOutInfo = (id) => mGet(`/saas-trade/receive/v150/OrderOut/${id}`, null, sconfig) @@ -32,7 +30,6 @@ const getCancelReceive = (id) => mGet(`/saas-trade/receive/v150/cancel/${id}`, n const putReceive = (id) => mPut(`/saas-trade/receive/v150/${id}`, null, sconfig) const updateUserInfo = (params) => mPut(`/saas-user/user/updateUserInfo`, params, sconfig) const getTrades = (params) => mGet(`/trades`, params, sconfig) -const personalAuth = (params) => mPost(`/user-centre/front/customer/personalAuth`, params, sconfig) const postFeedback = (params) => mPost(`/saas-user/account/feedback`, params, sconfig) const getWithdrawList = (params) => mGet(`/saas-user/account/withdraw/list`, params, sconfig) const getWithdrawInfo = (id) => mGet(`/saas-user/account/withdraw/${id}`, null, sconfig) @@ -40,7 +37,6 @@ const postWithdraw = (params) => mPost(`/saas-user/account/withdraw`, params, sc export { sconfig, - getOrderExists, getFinanceLog, getFinanceList, sendVerifyCode, @@ -51,7 +47,6 @@ export { checkPayPassword, bankCardDefault, udpatePayPassword, - getOrderList, getBaseInfo, getOrderOutInfo, getReceiveInfo, @@ -62,7 +57,6 @@ export { updateUserInfo, getTrades, getBalanceInfo, - personalAuth, postFeedback, getWithdrawList, getWithdrawInfo, diff --git a/pages/balance/detail/index.js b/pages/balance/detail/index.js deleted file mode 100644 index 41409b3..0000000 --- a/pages/balance/detail/index.js +++ /dev/null @@ -1,26 +0,0 @@ -// pages/balance/detail/index.js -import { getFinanceLog } from "../../api/saas" -const util = require('../../../utils/util') - -Page({ - /** - * 页面的初始数据 - */ - data: { - dataDetails: null - }, - /** - * 生命周期函数--监听页面加载 - */ - onLoad: function (options) { - wx.showLoading({ title: '加载中', mask: true }) - getFinanceLog(options.id).then(result => { - this.setData({ dataDetails: result.data, type: Number(options.type) }) - wx.hideLoading() - }).catch(err => { - wx.hideLoading() - util.showToast(err) - }) - } - -}) \ No newline at end of file diff --git a/pages/balance/detail/index.json b/pages/balance/detail/index.json deleted file mode 100644 index 8835af0..0000000 --- a/pages/balance/detail/index.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "usingComponents": {} -} \ No newline at end of file diff --git a/pages/balance/detail/index.wxml b/pages/balance/detail/index.wxml deleted file mode 100644 index b4c93ee..0000000 --- a/pages/balance/detail/index.wxml +++ /dev/null @@ -1,48 +0,0 @@ - - - - {{type == 0 ? '收入详细' : '支出详细'}} - - - - - - 流水号 - - - {{dataDetails.tradeSn}} - - - - - 类型 - - - {{dataDetails.operTypeStr}} - - - - - {{type == 0 ? '收入' : '支出'}} - - - {{formate.formateMoney(dataDetails.money)}} - - - - - 时间 - - - {{dataDetails.createTime}} - - - - - 余额 - - - {{formate.formateMoney(dataDetails.remainMoney)}} - - - \ No newline at end of file diff --git a/pages/balance/detail/index.wxss b/pages/balance/detail/index.wxss deleted file mode 100644 index c2d1a11..0000000 --- a/pages/balance/detail/index.wxss +++ /dev/null @@ -1 +0,0 @@ -/* pages/balance/detail/index.wxss */ \ No newline at end of file diff --git a/pages/balance/fragment/index.js b/pages/balance/fragment/index.js deleted file mode 100644 index 9f55b6e..0000000 --- a/pages/balance/fragment/index.js +++ /dev/null @@ -1,70 +0,0 @@ -// pages/balance/fragment/index.js -import { getFinanceList } from "../../api/saas" -const util = require('../../../utils/util') - -Component({ - options: { - addGlobalClass: true, - multipleSlots: true - }, - properties: { - direction: { type: Number, value: 0 }, - height: { type: Number, value: 0 } - }, - /** - * 页面的初始数据 - */ - data: { - firstShow: false, - finished: false, - requesting: false, - taskList: [], - form: { - pageSize: 10, - pageNum: 1, - direction: null, - pageSize:15 - } - }, - methods: { - onRestart: function () { - if (!this.data.firstShow) { - this.fetchList() - this.data.firstShow = true - } - }, - fetchList: function () { - if (this.data.requesting || this.data.finished) { - return - } - this.data.form.direction = this.data.direction - this.data.requesting = true - wx.showLoading({ title: '加载中', mask: true }) - getFinanceList(this.data.form).then(result => { - this.setData({ requesting: false, loading: false }) - if (result.data.records.length) { - var respList = result.data.records - let nowList = `taskList[${this.data.taskList.length}]` - var num = this.data.form.pageNum - var finished = this.data.form.pageNum >= result.data.pages - this.setData({ - [nowList]: respList, - total: result.data.total, - ['form.pageNum']: (num + 1), - finished - }) - } else { - this.setData({ finished: true }) - } - wx.hideLoading() - }).catch(err => { - this.setData({ requesting: false, loading: false }) - wx.hideLoading() - util.showToast(err) - }) - }, - lookItem: function(e){ - wx.navigateTo({ url: '/pages/balance/detail/index?id=' + e.currentTarget.id + '&type=' + this.data.direction }) - } - } -}) \ No newline at end of file diff --git a/pages/balance/fragment/index.json b/pages/balance/fragment/index.json deleted file mode 100644 index 4a42478..0000000 --- a/pages/balance/fragment/index.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "component": true, - "usingComponents": { - - } -} \ No newline at end of file diff --git a/pages/balance/fragment/index.wxml b/pages/balance/fragment/index.wxml deleted file mode 100644 index b6a9faf..0000000 --- a/pages/balance/fragment/index.wxml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - 暂无数据 - - - - - - {{item.operTypeStr}} - {{item.createTime}} - - - 余额:{{formate.formateMoney(item.remainMoney)}}元 - {{formate.formateMoney(item.money)}}元 - - - - \ No newline at end of file diff --git a/pages/balance/fragment/index.wxss b/pages/balance/fragment/index.wxss deleted file mode 100644 index d7da774..0000000 --- a/pages/balance/fragment/index.wxss +++ /dev/null @@ -1,4 +0,0 @@ -/* pages/balance/fragment/index.wxss */ -.padding{ - padding: 18rpx 30rpx; -} \ No newline at end of file diff --git a/pages/balance/index/index.js b/pages/balance/index/index.js deleted file mode 100644 index 1bcb345..0000000 --- a/pages/balance/index/index.js +++ /dev/null @@ -1,38 +0,0 @@ -// pages/balance/index/index.js -const app = getApp() - -Page({ - data: { - height: app.globalData.fragmentHeight, - CustomBar: 0, - tabList:['收入', '支出'], - tabIndex: 0 - }, - onLoad: function (options) { - this.setData({ height: app.globalData.fragmentHeight - 100, CustomBar: app.globalData.CustomBar }) - }, - onReady: function(){ - this.pageResume() - }, - onTabChange: function({detail}) { - if(this.data.tabIndex == Number(detail.index)){ - return - } - this.setData({tabIndex: Number(detail.index)}) - this.pageResume() - }, - onSwiperChange: function(e){ - const { current: index, source } = e.detail - if (!!source) { - this.setData({tabIndex: index}) - } - this.pageResume() - }, - pageResume: function (e) { - var pageView = this.selectComponent('#fragment' + this.data.tabIndex) - if (pageView) { - pageView.onRestart() - } - } - -}) \ No newline at end of file diff --git a/pages/balance/index/index.json b/pages/balance/index/index.json deleted file mode 100644 index 5ffc95c..0000000 --- a/pages/balance/index/index.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "usingComponents": { - "wux-tabi": "/components/tabi/index", - "fragment": "/pages/balance/fragment/index" - } -} \ No newline at end of file diff --git a/pages/balance/index/index.wxml b/pages/balance/index/index.wxml deleted file mode 100644 index 924b5c5..0000000 --- a/pages/balance/index/index.wxml +++ /dev/null @@ -1,16 +0,0 @@ - - - 余额明细 - - - - - - - - - - - - - \ No newline at end of file diff --git a/pages/balance/index/index.wxss b/pages/balance/index/index.wxss deleted file mode 100644 index b2f25a1..0000000 --- a/pages/balance/index/index.wxss +++ /dev/null @@ -1 +0,0 @@ -/* pages/balance/index/index.wxss */ \ No newline at end of file diff --git a/pages/home/authory/index.js b/pages/home/authory/index.js index c43923a..45bcf6a 100644 --- a/pages/home/authory/index.js +++ b/pages/home/authory/index.js @@ -1,5 +1,5 @@ // pages/home/authory/index.js -import { certificateIdentity} from "../../api/user" +import { certificateIdentity } from "../../api/user" const util = require('../../../utils/util') const event = require('../../../utils/event') const app = getApp() @@ -10,7 +10,6 @@ Page({ */ data: { form: { }, - typeList: [{text: '身份证', value: 1}, {text: '身份证', value: 2}], disable: true, // 是否不可以编辑, false:可编辑;true:不可编辑 auth: false }, @@ -18,7 +17,6 @@ Page({ * 生命周期函数--监听页面加载 */ onLoad: function (options) { - // this.pickerView = this.pickerView || this.selectComponent('#picker-view') const that = this wx.getStorage({ key: 'identityAuthToken', @@ -27,22 +25,7 @@ Page({ } }) }, - showPicker: function (e) { - if (this.data.flag) { - return - } - this.pickerView.showPicker(this.data.typeList, null, 1) - }, - onPickerChange: function (e) { - if (!e.detail) { - return - } - if (e.detail.type == 1) { - this.setData({ ['form.bankName']: e.detail.text, ['form.bankId']: Number(e.detail.value) }) - } - }, bindForm: function (e) { - // var form_data = 'form.' + e.target.id this.data.form[e.target.id] = e.detail.value }, submitForm: function(){ diff --git a/pages/home/authory/index.wxml b/pages/home/authory/index.wxml index 2a57802..9527ea8 100644 --- a/pages/home/authory/index.wxml +++ b/pages/home/authory/index.wxml @@ -10,13 +10,6 @@ - 身份证号码: diff --git a/pages/home/pauthory/index.wxss b/pages/home/pauthory/index.wxss index 4bc4006..ee9d388 100644 --- a/pages/home/pauthory/index.wxss +++ b/pages/home/pauthory/index.wxss @@ -1,5 +1,3 @@ -/* pages/home/authory/index.wxss */ - .image-reader-item { position: relative; width: 49%; diff --git a/pages/home/pindex/index.js b/pages/home/pindex/index.js deleted file mode 100644 index c9b5b72..0000000 --- a/pages/home/pindex/index.js +++ /dev/null @@ -1,119 +0,0 @@ -// pages/stock/index.js -import { getBaseInfo, getBalanceInfo } from "../../api/saas" -const util = require('../../../utils/util') -const math = require('../../../utils/math') -const event = require('../../../utils/event') -const app = getApp() - -Component({ - options: { - addGlobalClass: true, - multipleSlots: true - }, - lifetimes: { - // 生命周期函数,可以为函数,或一个在methods段中定义的方法名 - attached: function () { - event.on('EventMessage', this, this.onEvent) - }, - detached: function () { - event.remove('EventMessage', this) - } - }, - /** - * 页面的初始数据 - */ - data: { - firstShow: false, - token: app.globalData.token, - userInfo: null, - userName: null, - avatarUrl: null, - accountMoney: 0 - }, - methods: { - onRestart: function () { - this.fetchUserInfo() - this.data.firstShow = true - }, - fetchUserInfo: function () { - if(!app.globalData.userInfo){ - return - } - getBaseInfo().then(result => { - app.globalData.userInfo = result.data - this.setData({ - avatarUrl: util.isEmpty(app.globalData.userInfo.avatar) ? '/assets/image/ygImg.png' : app.globalData.userInfo.avatar, - userInfo: app.globalData.userInfo, - userName: util.isEmpty(app.globalData.userInfo.userName) ? '' : app.globalData.userInfo.userName.substring(0, 14) - }) - }).catch((e) => { - }) - getBalanceInfo().then(res => { - this.setData({ accountMoney: math.minus(res.data.accountMoney, res.data.frozenMoney) }) - }).catch(err => { - }) - }, - onEvent: function (message) { - if (message.what == 888) { - this.setData({ userInfo: app.globalData.userInfo, accountMoney: 0, avatarUrl: '/assets/image/ygImg.png', userName: null }) - } - }, - checkout: function () { - if(!app.globalData.userInfo){ - wx.navigateTo({ url: '/pages/login/index' }) - return - } - wx.navigateTo({ url: '/pages/withdrawal/checkout/index' }) - }, - toUserInfo: function () { - if(!app.globalData.userInfo){ - wx.navigateTo({ url: '/pages/login/index' }) - return - } - if(app.globalData.userInfo.isAuth != 1 && app.globalData.userInfo.userType == 1){ - wx.navigateTo({ url: '/pages/home/pauthory/index' }) - } else { - wx.navigateTo({ url: '/pages/home/pinfo/index' }) - } - }, - toAuthor: function () { - if(!app.globalData.userInfo){ - wx.navigateTo({ url: '/pages/login/index' }) - return - } - if(app.globalData.userInfo.isAuth != 1 && app.globalData.userInfo.userType == 1){ - wx.navigateTo({ url: '/pages/home/pauthory/index' }) - } else { - wx.navigateTo({ url: '/pages/home/pinfo/index' }) - } - }, - toBankCard: function () { - if(!app.globalData.userInfo){ - wx.navigateTo({ url: '/pages/login/index' }) - return - } - wx.navigateTo({ url: '/pages/bank/index/index' }) - }, - toWithdrawal: function () { - if(!app.globalData.userInfo){ - wx.navigateTo({ url: '/pages/login/index' }) - return - } - wx.navigateTo({ url: '/pages/withdrawal/index/index' }) - }, - toBalance: function () { - if(!app.globalData.userInfo){ - wx.navigateTo({ url: '/pages/login/index' }) - return - } - wx.navigateTo({ url: '/pages/balance/index/index' }) - }, - toSetting: function () { - if(!app.globalData.userInfo){ - wx.navigateTo({ url: '/pages/login/index' }) - return - } - wx.navigateTo({ url: '/pages/home/setting/index' }) - } - } -}) \ No newline at end of file diff --git a/pages/home/pindex/index.json b/pages/home/pindex/index.json deleted file mode 100644 index 0720a29..0000000 --- a/pages/home/pindex/index.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "component": true, - "usingComponents": { - "wux-button": "/components/button/index", - "wux-image": "/components/image/index", - "wux-cell-group": "/components/cell-group/index", - "wux-cell": "/components/cell/index" - } -} \ No newline at end of file diff --git a/pages/home/pindex/index.wxml b/pages/home/pindex/index.wxml deleted file mode 100644 index 9ff802f..0000000 --- a/pages/home/pindex/index.wxml +++ /dev/null @@ -1,54 +0,0 @@ - - - 我的 - - - - - - - - {{userName || '您还没有登录,去登录'}} - - - - {{userInfo.isAuth == 1 ? '已认证' : '未实名认证'}} - 去认证 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/pages/home/pindex/index.wxss b/pages/home/pindex/index.wxss deleted file mode 100644 index 0e83185..0000000 --- a/pages/home/pindex/index.wxss +++ /dev/null @@ -1,63 +0,0 @@ -/* pages/home/index.wxss */ - -.header-bg { - margin-top: 0px; - width: 100%; - height: 80px; - background: linear-gradient(314deg, rgba(50, 107, 250, 1) 0%, rgba(0, 138, 255, 1) 100%); - border-bottom-left-radius: 64rpx; - border-bottom-right-radius: 64rpx; -} - -.header-box { - width: 100%; - background: rgba(255, 255, 255, 1); - /* box-shadow: 0px 0px 15px -6px rgba(0, 0, 0, 0.32); - border-radius: 6px; */ -} - -.userinfo-avatar { - overflow: hidden; - width: 120rpx; - height: 120rpx; - border-radius: 12rpx; - border: 2px solid #fff; - box-shadow: 3px 3px 10px rgba(0, 0, 0, 0.2); -} - -.account-bg { - background: linear-gradient(314deg, rgba(50, 107, 250, 1) 0%, rgba(0, 138, 255, 1) 100%); - border-radius: 6px; -} - -.money { - font-size: 44rpx; - font-family: SFProDisplay-Semibold, SFProDisplay; - font-weight: 600; - color: rgba(255, 255, 255, 1); -} - -.label { - font-size: 24rpx; - font-family: PingFang-SC-Regular, PingFang-SC; - font-weight: 400; - color: rgba(255, 255, 255, 1); -} - -.img-auth { - width: 32rpx; - height: 32rpx; - margin-left: 24rpx; - margin-right: 12rpx -} - -.img-auth2 { - width: 32rpx; - height: 32rpx; - margin-right: 12rpx -} - -.realName { - max-width: 100px; - white-space: nowrap; -} \ No newline at end of file diff --git a/pages/home/pinfo/index.js b/pages/home/pinfo/index.js deleted file mode 100644 index a48c0b6..0000000 --- a/pages/home/pinfo/index.js +++ /dev/null @@ -1,340 +0,0 @@ -import { getBaseInfo, updateUserInfo, getTrades } from "../../api/saas" -const util = require('../../../utils/util') -const event = require('../../../utils/event') -const app = getApp() - -Page({ - /** - * 页面的初始数据 - */ - data: { - backStatus: true, - nickName: '', //用户昵称 - avatarUrl: '', //用户头像 - banckCardList: [{ - id: 1, - name: '个体回收户' - }, { - id: 2, - name: '打包站' - }, { - id: 3, - name: '废品站' - }, { - id: 4, - name: '印刷' - }, { - id: 6, - name: '包装厂' - }, { - id: 7, - name: '纸箱纸板厂' - }, { - id: 8, - name: '后加工' - }, { - id: 5, - name: '其他' - }], - cardList: [ - { value: '1', text: '个体回收户' }, - { value: '2', text: '打包站' }, - { value: '3', text: '废品站' }, - { value: '4', text: '印刷' }, - { value: '6', text: '包装厂' }, - { value: '7', text: '纸箱纸板厂' }, - { value: '8', text: '后加工' }, - { value: '5', text: '其他' } - ], - modalName: null, - identity: '', - identityStr: '', - licenseUrl: '', - userType: 1 - }, - - /** - * 生命周期函数--监听页面加载 - */ - onLoad: function (options) { - this.setData({ - isRequesting: false - }) - event.on('EventMessage', this, this.onEvent) - this.pickerView = this.pickerView || this.selectComponent('#picker-view') - this.getUserInfoData() - }, - onEvent: function (message) { - if (message.what == 103) { - this.getUserInfoData() - } - }, - showPicker: function () { - this.pickerView.showPicker(this.data.cardList, this.data.identity.toString(), 0) - }, - onPickerChange: function (e) { - getTrades({ identity: e.detail.value }).then(res => { - if (res.code == 0) { - this.setData({ identity: e.detail.value, identityStr: e.detail.text }) - util.showToast('修改身份成功!') - } else { - util.showToast('修改身份失败') - } - }) - }, - getUserInfoData: function () { - getBaseInfo().then(res => { - var identityStr = '' - for (var i = 0; i < this.data.cardList.length; i++) { - if (parseInt(this.data.cardList[i].value) == parseInt(res.data.identity)) { - identityStr = this.data.cardList[i].text - break - } - } - this.setData({ - nickName: res.data.nickName, - avatarUrl: res.data.avatar || '/assets/image/ygImg.png', - linkman: res.data.nickName, - linkPhone: res.data.mobile, - companyAddress: res.data.fullAddress, - identity: res.data.identity, - userType: res.data.userType, - identityStr: identityStr, - realName:res.data.realName || res.data.userName, - licenseUrl: res.data.businessLicenseList - }) - if (res.data.linkman == '' || res.data.linkPhone == '' || res.data.companyAddress == '' || res.data.identity == '') { - this.setData({ - backStatus: false - }) - } else { - this.setData({ - backStatus: true - }) - - } - }) - }, - //通过事件执行更换头像方法比如点击头像执行该方法 - updatahead() { - var that = this; - wx.chooseImage({ - count: 1, // 默认9 - sizeType: ['original', 'compressed'], // 可以指定是原图还是压缩图,默认二者都有 - sourceType: ['album', 'camera'], // 可以指定来源是相册还是相机,默认二者都有 - success: function (res) { - // 返回选定照片的本地文件路径列表,tempFilePath可以作为img标签的src属性显示图片 - var imgPaths = res.tempFilePaths - that.updataheadservice(imgPaths[0]); - } - }) - }, - //通过事件执行更换执照方法比如点击头像执行该方法 - updatalicenseUrl() { - var that = this; - wx.chooseImage({ - count: 1, // 默认9 - sizeType: ['original', 'compressed'], // 可以指定是原图还是压缩图,默认二者都有 - sourceType: ['album', 'camera'], // 可以指定来源是相册还是相机,默认二者都有 - success: function (res) { - // 返回选定照片的本地文件路径列表,tempFilePath可以作为img标签的src属性显示图片 - var imgPaths = res.tempFilePaths - that.updataheadservice2(imgPaths[0]); - } - }) - }, - //上传图片 - updataheadservice(imgPaths) { - var that = this; - wx.uploadFile({ - header: { - 'user-token': app.globalData.SessionId - }, - url: app.apiHttp + '/saas-user/utils/uploadImage', //你的服务器地址 - filePath: imgPaths, //要上传文件资源的路径 - name: 'image', //文件对应的 key,开发者在服务端可以通过这个 key 获取文件的二进制内容 - formData: { - adminid: app.globalData.adminid //HTTP 请求中其他额外的参数比如 用户id - }, - success(res) { - var jsonStr = res.data; - jsonStr = jsonStr.replace(" ", ""); - if (typeof jsonStr != 'object') { - jsonStr = jsonStr.replace(/\ufeff/g, ""); //重点 - var jj = JSON.parse(jsonStr); - res.data = jj; - } - that.setData({ - avatarUrl: res.data.data - }) - that.preservationheadimg(res.data.data) - } - }) - }, - //上传执照 - updataheadservice2(imgPaths) { - var that = this; - wx.uploadFile({ - header: { 'user-token': app.globalData.userToken }, - url: app.apiHttp + '/saas-user/utils/uploadImage', //你的服务器地址 - filePath: imgPaths, //要上传文件资源的路径 - name: 'image', //文件对应的 key,开发者在服务端可以通过这个 key 获取文件的二进制内容 - formData: { - adminid: app.globalData.adminid //HTTP 请求中其他额外的参数比如 用户id - }, - success(res) { - var jsonStr = res.data; - jsonStr = jsonStr.replace(" ", ""); - if (typeof jsonStr != 'object') { - jsonStr = jsonStr.replace(/\ufeff/g, ""); //重点 - var jj = JSON.parse(jsonStr); - res.data = jj; - } - that.setData({ - licenseUrl: res.data.data - }) - that.preservationheadimg2(res.data.data) - } - }) - }, - //保存用户头像 - preservationheadimg(imgUrl) { - updateUserInfo({ avatarUrl: imgUrl, nickName: this.data.nickName }).then(res => { - if (res.code == 0) { - util.showToast('修改头像成功!') - this.getUserInfoData() - } else { - util.showToast('头像上传失败') - } - }) - }, - //保存用户执照 - preservationheadimg2(imgUrl) { - updateUserInfo({ licenseUrl: this.data.licenseUrl }).then(res => { - if (res.code == 0) { - util.showToast('修改执照成功!') - this.getUserInfoData() - } else { - util.showToast('执照上传失败') - } - }) - }, - bindAndSet(e) { - let key = e.currentTarget.dataset.name - this.setData({ [key]: e.detail.value }) - }, - inputBlur(e) { - if (e.target.dataset.name == "nickName") { - if (this.data.nickName == '') { - util.showToast('请填写昵称') - this.setData({ backStatus: false }) - return - } else { - this.setData({ backStatus: true }) - } - updateUserInfo({ avatarUrl: this.data.avatarUrl, nickName: e.detail.value }).then(res => { - if (res.code == 0) { - util.showToast('修改昵称成功!') - this.getUserInfoData() - } else { - util.showToast('修改昵称失败') - } - }) - } else if (e.target.dataset.name == "linkman") { - if (this.data.linkman == '') { - util.showToast('请填写联系人') - this.setData({ - backStatus: false - }) - return - } else { - this.setData({ - backStatus: true - }) - } - updateUserInfo({ avatarUrl: this.data.avatarUrl, linkman: e.detail.value }).then(res => { - if (res.code == 0) { - util.showToast('修改联系人成功!') - this.getUserInfoData() - } else { - util.showToast('修改联系人失败!') - } - }) - } else if (e.target.dataset.name == "linkPhone") { - if (this.data.linkPhone == '') { - util.showToast('请填写联系方式') - this.setData({ backStatus: false }) - return - } else { - this.setData({ backStatus: true }) - } - updateUserInfo({ avatarUrl: this.data.avatarUrl, linkPhone: e.detail.value }).then(res => { - if (res.code == 0) { - util.showToast('修改联系方式成功!') - this.getUserInfoData() - } else { - util.showToast('修改联系方式失败!') - } - - }) - } else if (e.target.dataset.name == "companyAddress") { - if (this.data.companyAddress == '') { - util.showToast('请填写公司地址') - this.setData({ - backStatus: false - }) - return - } else { - this.setData({ - backStatus: true - }) - } - updateUserInfo({ avatarUrl: this.data.avatarUrl, companyAddress: e.detail.value }).then(res => { - if (res.code == 0) { - util.showToast('修改公司地址成功!') - this.getUserInfoData() - } else { - util.showToast('修改公司地址失败') - } - }) - } - }, - showModal(e) { - this.setData({ - modalName: e.currentTarget.dataset.target - }) - }, - hideModal(e) { - this.setData({ - modalName: null - }) - }, - bindchange: function (e) { - this.setData({ identity: e.detail.value }) - if (this.data.identity == '') { - util.showToast('请选择身份') - this.setData({ backStatus: false }) - return - } else { - this.setData({ backStatus: true }) - } - updateUserInfo({ avatarUrl: this.data.avatarUrl, identity: e.detail.value }).then(res => { - if (res.code == 0) { - util.showToast('修改身份成功!') - this.getUserInfoData() - this.hideModal() - } else { - util.showToast('修改身份失败') - } - }) - }, - returnHome(){ - wx.redirectTo({ url: '/pages/index/index' }) - }, - ViewImage(e) { - var list = [] - list.push(this.data.licenseUrl) - wx.previewImage({ urls: list, current: e.currentTarget.dataset.url }) - }, - -}) \ No newline at end of file diff --git a/pages/home/pinfo/index.json b/pages/home/pinfo/index.json deleted file mode 100644 index 54f5109..0000000 --- a/pages/home/pinfo/index.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "usingComponents": { - "wux-button": "/components/button/index", - "wux-cell-group": "/components/cell-group/index", - "wux-cell": "/components/cell/index", - "wux-image": "/components/image/index", - "picker-view": "/components/picker-view/index" - } -} \ No newline at end of file diff --git a/pages/home/pinfo/index.wxml b/pages/home/pinfo/index.wxml deleted file mode 100644 index 0d6746b..0000000 --- a/pages/home/pinfo/index.wxml +++ /dev/null @@ -1,40 +0,0 @@ - - - 个人中心 - - - - 头像 - - - - - {{linkman}} - - - {{realName}} - - - {{identityStr}} - - - {{linkPhone}} - - - {{companyAddress}} - - - - - - 营业执照 - - - - - - - - - - \ No newline at end of file diff --git a/pages/home/pinfo/index.wxss b/pages/home/pinfo/index.wxss deleted file mode 100644 index 39a9b8b..0000000 --- a/pages/home/pinfo/index.wxss +++ /dev/null @@ -1 +0,0 @@ -/* pages/home/info/index.wxss */ \ No newline at end of file diff --git a/pages/home/setting/index.js b/pages/home/setting/index.js index fbdc9f8..99aa5d4 100644 --- a/pages/home/setting/index.js +++ b/pages/home/setting/index.js @@ -35,14 +35,6 @@ Page({ bizUserName:res.data.bizUserName, }) }) - var pages = getCurrentPages() - for (let index = 0; index < pages.length; index++) { - const element = pages[index] - if('pages/paper/index' == element.route){ - this.data.version = 1 - break - } - } this.setData({ kg: app.globalData.kg, version: this.data.version diff --git a/pages/index/index.js b/pages/index/index.js index 3db523a..f58ade7 100644 --- a/pages/index/index.js +++ b/pages/index/index.js @@ -36,19 +36,16 @@ Page({ var authorization = app.globalData.token || storage.get('Authorization') if (authorization) { app.globalData.token = authorization - this.fetchUserInfo() + config.header = { 'Authorization': 'QNT ' + app.globalData.token } + getUserInfo().then(result => { + this.toIndex() + }).catch(err => { + wx.hideLoading() + }) } else { this.toIndex() } }, - fetchUserInfo: function () { - config.header = { 'Authorization': 'QNT ' + app.globalData.token } - getUserInfo().then(result => { - this.toIndex() - }).catch(err => { - wx.hideLoading() - }) - }, defaultIndex: function () { this.onResume() if (this.data.path) { @@ -73,7 +70,7 @@ Page({ getBaseInfo().then(result => { app.globalData.userInfo = result.data wx.hideLoading() - if(app.globalData.userInfo.hasShowedLoginTag == false){ + if(!app.globalData.userInfo.hasShowedLoginTag){ wx.navigateTo({ url: '/pages/home/tab1/index' }) } this.defaultIndex() @@ -105,7 +102,7 @@ Page({ if (this.data.inited) { this.onResume() } - if(app.globalData.userInfo && app.globalData.userInfo.hasShowedLoginTag == false){ + if(app.globalData.userInfo && !app.globalData.userInfo.hasShowedLoginTag){ wx.navigateTo({ url: '/pages/home/tab1/index' }) } }, diff --git a/pages/order/detail/index.js b/pages/order/detail/index.js deleted file mode 100644 index 34efff2..0000000 --- a/pages/order/detail/index.js +++ /dev/null @@ -1,176 +0,0 @@ -import { getBaseInfo, getOrderOutInfo, getReceiveInfo, feedbackReceiveInfo, deleteReceive, getCancelReceive, putReceive } from "../../api/saas" -import { $wuxDialog } from '../../../components/index' -const util = require('../../../utils/util') -const event = require('../../../utils/event') -const app = getApp() - -Page({ - /** - * 页面的初始数据 - */ - data: { - requesting: false, - orderId: null, - type: null, - dataDetails: {}, - content: null, - safeBottom: app.globalData.safeBottom - }, - - /** - * 生命周期函数--监听页面加载 - */ - onLoad: function (options) { - if (options.id) { - this.data.orderId = options.id - } - if (options.type) { - this.setData({ type: Number(options.type) }) - } - this.setData({ safeBottom: app.globalData.safeBottom }) - this.getDetailsInfo() - }, - /** - * 获取支出详情 - */ - getDetailsInfo: function () { - wx.showLoading({ title: '加载中', mask: true }) - if (util.isEmpty(app.globalData.userInfo.userName)) { - getBaseInfo().then(result => { - app.globalData.userInfo = result.data - }).catch(err => { - - }) - } - if (this.data.type == 1) { - getReceiveInfo(this.data.orderId).then(res => { - this.setData({ dataDetails: res.data }) - wx.hideLoading() - }).catch(err => { - wx.hideLoading() - }) - } else if (this.data.type == 2) { - getOrderOutInfo(this.data.orderId).then(res => { - this.setData({ dataDetails: res.data }) - wx.hideLoading() - }).catch(err => { - wx.hideLoading() - }) - } - - }, - bindAndSet(e) { - let key = e.currentTarget.dataset.name - this.setData({ [key]: e.detail.value }) - }, - // 提交反馈 - subFeedBack(feed) { - var that = this - const alert = (content) => { - $wuxDialog('#wux-dialog--alert').alert({ - resetOnClose: true, - title: '提示', - content: content, - }) - } - $wuxDialog().prompt({ - resetOnClose: true, - title: '反馈内容', - fieldtype: 'textarea', - defaultText: '', - placeholder: '请输入反馈内容', - maxlength: 100, - onConfirm(e, response) { - var postModel = { remark: response, orderId: that.data.orderId } - if (response == "") { - util.showToast('反馈内容不能为空!') - return - } - wx.showLoading({ title: '处理中', mask: true }) - feedbackReceiveInfo(postModel).then(res => { - wx.hideLoading() - util.showToast('提交反馈成功!') - }).catch(err => { - //异常回调 - wx.hideLoading() - util.showToast(err) - }) - }, - }) - }, - ViewImage(e) { - var list = [] - this.data.dataDetails.imgList.forEach(element => { - list.push(element.imgUrl) - }); - wx.previewImage({ urls: list, current: e.currentTarget.dataset.url }) - }, - showDialog: function () { - var that = this - $wuxDialog().open({ - resetOnClose: true, - title: '温馨提示', - content: '确定取消当前订单?', - buttons: [{ - text: '取消' - }, { - text: '确定', - type: 'primary', - onTap(e) { - that.stopReceviePost() - } - }] - }) - }, - deleteOrder: function () { - var that = this - $wuxDialog().open({ - resetOnClose: true, - title: '温馨提示', - content: '确定删除当前订单?', - buttons: [{ - text: '取消' - }, { - text: '确定', - type: 'primary', - onTap(e) { - wx.showLoading({ title: '处理中', mask: true }) - deleteReceive(that.data.orderId).then(res => { - event.emit('EventMessage', { what: 13, desc: '订单已删除' }) - wx.hideLoading() - util.showBackToast('订单已删除!') - }).catch(err => { - wx.hideLoading() - util.showToast(err) - }) - } - }] - }) - }, - //取消订单 - stopReceviePost: function () { - wx.showLoading({ title: '处理中', mask: true }) - getCancelReceive(this.data.orderId).then(result => { - event.emit('EventMessage', { what: 13, desc: '订单已取消' }) - wx.hideLoading() - util.showToast('订单已取消!') - this.setData({ ['dataDetails.status']: 5 }) - }).catch(err => { - wx.hideLoading() - util.showToast(err) - }) - }, - // 确认订单 - receviePost() { - wx.showLoading({ title: '处理中', mask: true }) - putReceive(this.data.orderId).then(res => { - wx.hideLoading() - util.showBackToast('订单已确认!') - event.emit('EventMessage', { what: 13, desc: '订单已订单' }) - }).catch(err => { - wx.hideLoading() - util.showToast(err) - }) - } - -}) \ No newline at end of file diff --git a/pages/order/detail/index.json b/pages/order/detail/index.json deleted file mode 100644 index d2eda5d..0000000 --- a/pages/order/detail/index.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "navigationBarTitleText": "Dialog", - "usingComponents": { - "wux-row": "/components/row/index", - "wux-col": "/components/col/index", - "wux-button": "/components/button/index", - "wux-dialog": "/components/dialog/index", - "wux-divider": "/components/divider/index" - } -} \ No newline at end of file diff --git a/pages/order/detail/index.wxml b/pages/order/detail/index.wxml deleted file mode 100644 index 6f1ba3b..0000000 --- a/pages/order/detail/index.wxml +++ /dev/null @@ -1,174 +0,0 @@ - - - - 订单详情 - - - - {{dataDetails.customerName||''}} - - {{order.orderStatus(dataDetails.status)}} - - - - - 订单信息 - - - 品类 - 磅单流水号 - 实重(kg) - 金额(元) - 扣重(kg) - 单价(元/kg) - 重磅重(kg) - 空磅重(kg) - - - - - {{item.paperCategoryName}} - {{item.tradeNo || '----'}} - {{item.settleWeight}} - {{item.totalPrice}} - {{item.deductWeight}} - {{item.unitPrice}} - {{item.totalWeight}} - {{item.emptyWeight}} - - - - - - - 总重量(Kg): - {{order.settleOrder(dataDetails, 1)}} - - - 总金额(元): - {{order.settleOrder(dataDetails, 2)}} - - - - - 订单信息 - - - 品类 - 价格(元/kg) - 结算重量(kg) - 结算金额(元) - - - - - {{item.paperCategoryName}} - {{item.unitPrice}} - {{item.settleWeight}} - {{item.settlePrice}} - - - - - - - 总重量(Kg): - {{order.settleOrder(dataDetails, 1)}} - - - 总金额(元): - {{order.settleOrder(dataDetails, 2)}} - - - - - - - 打包站名称 - {{dataDetails.factoryName || dataDetails.userName}} - - - - 订单编号 - {{dataDetails.orderNo||''}} - - - - - 上门时间 - {{dataDetails.expectedTime}} - - - - 收货地址 - {{dataDetails.address||''}} - - - - - - - 车牌号 - {{dataDetails.plateNumber}} - - - - - - 扣点 - {{dataDetails.deductPercent/100||0}}% - - - - - - 商务 - {{dataDetails.customerManagerName||''}} - - - - - - 过磅员 - {{dataDetails.weighmanName}} - - - - - 下单时间 - {{dataDetails.createTime||''}} - - - - 收货方式 - {{type == 1 ? '厂内收货' : '厂外收货'}} - - - - 备注 - {{dataDetails.remark||''}} - - - - - - - - - - 不通过原因: - {{dataDetails.rejectReason}} - - - - - - - - 取消订单 - - 确认订单 - - - - \ No newline at end of file diff --git a/pages/order/detail/index.wxss b/pages/order/detail/index.wxss deleted file mode 100644 index 7b45f33..0000000 --- a/pages/order/detail/index.wxss +++ /dev/null @@ -1,110 +0,0 @@ -/* pages/order/index.wxss */ - -.tower-swiper .tower-item { - transform: scale(calc(0.5 + var(--index) / 10)); - margin-left: calc(var(--left) * 100rpx - 150rpx); - z-index: var(--index); -} - -.mt-5 { - margin-top: 5rpx; -} - -.mt-30 { - margin-top: 30rpx; -} - -.mt-15 { - margin-top: 15rpx; -} - -.ft-left { - float: left -} - -.ft-right { - float: right -} - -.mg-left { - margin-left: 15rpx; -} - -.mg-right { - margin-right: 15rpx; -} - -.min-height { - min-height: 160rpx; -} - -.bottom-min-height { - min-height: 250rpx; -} - -.bottom-button { - border-radius: 1000rpx; -} - -.ftweight600 { - font-weight: 600 -} - -.cu-form-group1 { - background-color: var(--white); - padding-right: 32rpx; - display: flex; - font-size: 28rpx; - align-items: center; - min-height: 80rpx; - justify-content: space-between; -} - -.cu-form-group2 { - background-color: var(--white); - padding: 1rpx 30rpx; - display: flex; - align-items: center; - min-height: 80rpx; - justify-content: space-between; -} - -.item-label { - font-size: 28rpx; - font-family: PingFang-SC-Medium, PingFang-SC; - font-weight: 500; - color: rgba(0, 0, 0, 1); - line-height: 17px; -} - -.item-val { - font-size: 26rpx; - font-family: PingFang-SC-Medium, PingFang-SC; - font-weight: 500; - color: rgba(255, 164, 28, 1); - line-height: 17px; -} - -.col-title { - font-size: 14px; - font-family: PingFang-SC-Medium, PingFang-SC; - font-weight: 500; - height: 80rpx; - text-align: center; - line-height: 80rpx; - color: rgba(51, 51, 51, 1); -} - -.scroll-view_H{ - white-space: nowrap; -} - -.wux-divider { - display: block; - height: 2rpx; - width: 1680rpx; - clear: both; - border-top: 2rpx solid #e8e8e8 -} - - \ No newline at end of file diff --git a/pages/order/index/index.js b/pages/order/index/index.js deleted file mode 100644 index 0d1d1f9..0000000 --- a/pages/order/index/index.js +++ /dev/null @@ -1,120 +0,0 @@ -// pages/stock/index.js -import { getOrderList } from "../../api/saas" -const util = require('../../../utils/util') -const event = require('../../../utils/event') -const app = getApp() - -Component({ - options: { - addGlobalClass: true, - multipleSlots: true - }, - /** - * 页面的初始数据 - */ - data: { - height: app.globalData.fragmentHeight - 100, - loading: true, - requesting: false, - finished: false, - tabList: [ - {id: 1, name: '预约单'}, - {id: 2, name: '待确认'}, - {id: 3, name: '待结算'}, - {id: 4, name: '已完成'}, - {id: 5, name: '已取消'} - ], - orderList: [], - form: { - status: 1, - pageNum: 1, - pageSize:15 - } - }, - lifetimes: { - // 生命周期函数,可以为函数,或一个在methods段中定义的方法名 - attached: function () { - event.on('EventMessage', this, this.onEvent) - }, - detached: function () { - event.remove('EventMessage', this) - } - }, - methods: { - onRestart: function () { - if (!this.data.firstShow) { - this.setData({userInfo: app.globalData.userInfo, height: app.globalData.fragmentHeight - 100 }) - this.fetchOrderList() - } - this.data.firstShow = true - }, - onEvent: function (message) { - if (message.what == 13) { - this.onRefreshList() - } else if (message.what == 888) { - this.setData({ - userInfo: app.globalData.userInfo, orderList: [], loading: false }) - } - }, - onRefreshList: function () { - if (this.data.requesting) { - return - } - this.setData({ - orderList: [], - ['form.status']: this.data.form.status, - ['form.pageNum']: 1, - loading: true, - finished: false - }) - this.fetchOrderList() - }, - fetchOrderList: function () { - if (!app.globalData.userInfo) { - this.setData({ requesting: false, loading: false }) - return - } - if (this.data.requesting || this.data.finished) { - return - } - if (this.data.loading) { - this.data.requesting = true - } else { - this.setData({ requesting: true }) - } - getOrderList(this.data.form).then(result => { - if (result.data.records.length) { - var respList = result.data.records - let nowList = `orderList[${this.data.orderList.length}]` - var num = this.data.form.pageNum - var finished = this.data.form.pageNum >= result.data.pages - this.setData({ - [nowList]: respList, - total: result.data.total, - ['form.pageNum']: (num + 1), - finished, - requesting: false, - loading: false - }) - } else { - this.setData({ finished: true, requesting: false, loading: false }) - } - }).catch(err => { - //异常回调 - this.setData({ requesting: false, loading: false }) - util.showToast(err) - }) - }, - lookItem: function (e) { - var item = this.data.orderList[e.currentTarget.dataset.page][e.currentTarget.dataset.index] - wx.navigateTo({ url: '/pages/order/detail/index?id=' + item.id + '&type=' + item.receiveType }) - }, - onTabChange: function (e) { - if (this.data.form.status == e.detail.key) { - return - } - this.data.form.status = e.detail.key - this.onRefreshList() - } - } -}) \ No newline at end of file diff --git a/pages/order/index/index.json b/pages/order/index/index.json deleted file mode 100644 index 2d1ddf3..0000000 --- a/pages/order/index/index.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "component": true, - "usingComponents": { - "refresh-view": "/components/refresher/index", - "wux-tabs": "/components/tabs/index", - "wux-tab": "/components/tab/index", - "wux-divider": "/components/divider/index" - } -} \ No newline at end of file diff --git a/pages/order/index/index.wxml b/pages/order/index/index.wxml deleted file mode 100644 index 57bf99d..0000000 --- a/pages/order/index/index.wxml +++ /dev/null @@ -1,58 +0,0 @@ - - - 订单列表 - - - - - - - - - - - {{item.name}} - - - - - - - - {{loading? '正在加载' : userInfo ? '暂无数据' : '你还没登录'}} - - - - - - {{item.userName || item.factoryName}}{{item.receiveType == 1 ? '(厂内收货)' : '(厂外收货)'}} - {{order.orderStatus(item.status)}} - - - - {{order.cateString(item.paperCategoryNameList)}} - {{item.createTime}} - - - - - 总重量(Kg): - {{order.numberFormat(item.settleWeight, 3)}} - - - 总金额(元): - {{order.numberFormat(item.settlePrice, 2)}} - - - - - - - - - - {{finished?'到底啦~':'加载中...'}} - - - - \ No newline at end of file diff --git a/pages/order/index/index.wxss b/pages/order/index/index.wxss deleted file mode 100644 index 2b96dc4..0000000 --- a/pages/order/index/index.wxss +++ /dev/null @@ -1,60 +0,0 @@ -/* pages/home/index.wxss */ - -.item-content { - background-color: white; - padding: 0rpx 32rpx; - margin-bottom: 16rpx; -} - -.item-name { - font-size: 30rpx; - font-family: PingFang-SC-Regular, PingFang-SC; - font-weight: 400; - color: rgba(83, 83, 83, 1); - line-height: 20px; -} - -.item-status { - font-size: 30rpx; - font-family: PingFang-SC-Medium, PingFang-SC; - font-weight: 500; - color: rgba(255, 43, 45, 1); - line-height: 20px; -} - -.item-label { - font-size: 28rpx; - font-family: PingFang-SC-Medium, PingFang-SC; - font-weight: 500; - color: rgba(0, 0, 0, 1); - line-height: 17px; -} - -.item-val { - font-size: 26rpx; - font-family: PingFang-SC-Medium, PingFang-SC; - font-weight: 500; - color: rgba(255, 164, 28, 1); - line-height: 17px; -} - -.item-cate { - font-size: 28rpx; - font-family: PingFang-SC-Medium, PingFang-SC; - font-weight: 500; - color: rgba(0, 0, 0, 1); - line-height: 20px; -} - -.item-time { - font-size: 20rpx; - margin-top: 12rpx; - font-family: PingFang-SC-Regular, PingFang-SC; - font-weight: 400; - color: rgba(0, 0, 0, 1); - line-height: 14px; -} - -.shadow { - box-shadow: 0 1rpx 6rpx rgba(0, 0, 0, 0.1) -} diff --git a/pages/order/order.wxs b/pages/order/order.wxs deleted file mode 100644 index b0d5fe6..0000000 --- a/pages/order/order.wxs +++ /dev/null @@ -1,62 +0,0 @@ -function isEmpty(val) { - return typeof val === 'undefined' || val === '' || val === null -} - -function orderStatus(status) { - if (status == 2) { - return '待确认' - } else if (status == 3 || status == 30) { - return '待审核' - } else if (status == 23 || status == 31) { - return '待审核' - } else if (status == 4) { - return '已完成' - } else if (status == 5) { - return '已取消' - } else if (status == 6) { - return '不通过' - } - return '' -} - -function cateString(cateList) { - return cateList.toString() -} - -function numberFormat(value, fix) { - if (value) { - return value.toFixed(fix) - } - return '' -} - -function orderOperated(status) { - return status in [2, 3, 4] -} - -function settleOrder(orderInfo, type) { - if (type == 1) { - if (parseFloat(orderInfo.settleWeight) > 0) { - return numberFormat(orderInfo.settleWeight, 3) - } - if (parseFloat(orderInfo.allSettleWeight) > 0) { - return numberFormat(orderInfo.allSettleWeight, 3) - } - } else if (type == 2) { - if (parseFloat(orderInfo.settlePrice) > 0) { - return numberFormat(orderInfo.settlePrice, 2) - } - if (!isEmpty(orderInfo.allTotalPrice) && parseFloat(orderInfo.allTotalPrice) > 0) { - return numberFormat(orderInfo.allTotalPrice, 2) - } - } - return '' -} - -module.exports = { - orderStatus: orderStatus, - cateString: cateString, - numberFormat: numberFormat, - orderOperated: orderOperated, - settleOrder: settleOrder -} \ No newline at end of file diff --git a/pages/paper/index.js b/pages/paper/index.js deleted file mode 100644 index ae50b25..0000000 --- a/pages/paper/index.js +++ /dev/null @@ -1,26 +0,0 @@ -const app = getApp() - -Page({ - data: { - TabList: [ - { index: 0, value: 'order', icon: 'form', badge: 0, name: '订单' }, - { index: 1, value: 'home', icon: 'my', badge: 0, name: '我的' } - ], - pageIndex: 0, - safeBottom: app.globalData.safeBottom - }, - onLoad: function (options) { - this.setData({safeBottom: app.globalData.safeBottom }) - }, - onNavChange(e) { - this.setData({ pageIndex: Number(e.currentTarget.dataset.tab) }) - var pageView = this.selectComponent('#' + this.data.TabList[this.data.pageIndex].value); - pageView.onRestart() - }, - onShow: function () { - var pageView = this.selectComponent('#' + this.data.TabList[this.data.pageIndex].value); - if (pageView) { - pageView.onRestart() - } - } -}) diff --git a/pages/paper/index.json b/pages/paper/index.json deleted file mode 100644 index 6c9bcb1..0000000 --- a/pages/paper/index.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "disableScroll": true, - "usingComponents": { - "order": "/pages/order/index/index", - "home": "/pages/home/pindex/index" - } -} \ No newline at end of file diff --git a/pages/paper/index.wxml b/pages/paper/index.wxml deleted file mode 100644 index cdb7520..0000000 --- a/pages/paper/index.wxml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - {{item.name}} - - \ No newline at end of file diff --git a/pages/paper/index.wxs b/pages/paper/index.wxs deleted file mode 100644 index 310977b..0000000 --- a/pages/paper/index.wxs +++ /dev/null @@ -1,23 +0,0 @@ -function tabImage(tabIndex, index) { - if (index == 0) { - if(tabIndex == index){ - return '/assets/image/icon_trans_blue.png' - } - return '/assets/image/icon_trans_gray.png' - } else if (index == 1) { - if(tabIndex == index){ - return '/assets/image/icon_self_blue.png' - } - return '/assets/image/icon_self_gray.png' - } else if (index == 2) { - if(tabIndex == index){ - return '/assets/image/icon_self_blue.png' - } - return '/assets/image/icon_self_gray.png' - } - return '' -} - -module.exports = { - tabImage: tabImage -} \ No newline at end of file diff --git a/pages/paper/index.wxss b/pages/paper/index.wxss deleted file mode 100644 index e69de29..0000000 diff --git a/project.config.json b/project.config.json index 93e7860..dcdc167 100644 --- a/project.config.json +++ b/project.config.json @@ -40,7 +40,7 @@ "minifyWXSS": true }, "compileType": "miniprogram", - "libVersion": "2.17.0", + "libVersion": "2.18.1", "appid": "wx7a4a8415e6821108", "projectname": "zhitongbao-mini", "debugOptions": {