| @@ -0,0 +1,5 @@ | |||
| .DS_Store | |||
| ext.json | |||
| project.config.json | |||
| project.private.config.json | |||
| pages/.DS_Store | |||
| @@ -0,0 +1,43 @@ | |||
| //index.js | |||
| Component({ | |||
| /** | |||
| * 组件的属性列表 | |||
| */ | |||
| properties: { | |||
| propArray: { | |||
| type: Array, | |||
| } | |||
| }, | |||
| /** | |||
| * 组件的初始数据 | |||
| */ | |||
| data: { | |||
| selectShow: false,//初始option不显示 | |||
| selectText: "请选择",//初始内容 | |||
| }, | |||
| /** | |||
| * 组件的方法列表 | |||
| */ | |||
| methods: { | |||
| //option的显示与否 | |||
| selectToggle: function () { | |||
| var nowShow = this.data.selectShow;//获取当前option显示的状态 | |||
| this.setData({ | |||
| selectShow: !nowShow | |||
| }) | |||
| }, | |||
| //设置内容 | |||
| setText: function (e) { | |||
| var nowData = this.properties.propArray;//当前option的数据是引入组件的页面传过来的,所以这里获取数据只有通过this.properties | |||
| var nowIdx = e.target.dataset.index;//当前点击的索引 | |||
| var nowText = nowData[nowIdx].text || nowData[nowIdx].value || nowData[nowIdx];//当前点击的内容 | |||
| //再次执行动画,注意这里一定,一定,一定是this.animation来使用动画 | |||
| this.setData({ | |||
| selectShow: false, | |||
| selectText: nowText, | |||
| }) | |||
| this.triggerEvent('select', nowData[nowIdx]) | |||
| } | |||
| } | |||
| }) | |||
| @@ -0,0 +1,4 @@ | |||
| { | |||
| "usingComponents": {}, | |||
| "component": true | |||
| } | |||
| @@ -0,0 +1,9 @@ | |||
| <view class='ms-content-box'> | |||
| <view class='ms-content' bindtap='selectToggle'> | |||
| <view class='ms-text'>{{selectText}}</view> | |||
| <view class="{{selectShow ? 'icon-up' : 'icon-down'}}"></view> | |||
| </view> | |||
| <view class='ms-options' wx:if="{{selectShow}}"> | |||
| <view wx:for="{{propArray}}" data-index="{{index}}" wx:key='index' class='ms-option' bindtap='setText'>{{item.text || item.value || item}}</view> | |||
| </view> | |||
| </view> | |||
| @@ -0,0 +1,86 @@ | |||
| .ms-content-box { | |||
| width: 240rpx; | |||
| } | |||
| .ms-content { | |||
| border: 1px solid #e2e2e2; | |||
| background: white; | |||
| font-size: 28rpx; | |||
| position: relative; | |||
| height: 60rpx; | |||
| line-height: 60rpx; | |||
| } | |||
| .ms-text { | |||
| overflow: hidden; | |||
| text-overflow: ellipsis; | |||
| white-space: nowrap; | |||
| padding: 0 80rpx 0 12rpx; | |||
| font-size: 28rpx; | |||
| } | |||
| .ms-options { | |||
| background: white; | |||
| width: inherit; | |||
| position: absolute; | |||
| border: 1px solid #e2e2e2; | |||
| border-top: none; | |||
| box-sizing: border-box; | |||
| z-index: 3; | |||
| max-height: 240rpx; | |||
| overflow: auto; | |||
| } | |||
| .ms-option { | |||
| height: 60rpx; | |||
| line-height: 60rpx; | |||
| border-top: 1px solid #e2e2e2; | |||
| padding: 0 12rpx; | |||
| text-align: left; | |||
| overflow: hidden; | |||
| text-overflow: ellipsis; | |||
| white-space: nowrap; | |||
| font-size: 28rpx; | |||
| } | |||
| .ms-item:first-child { | |||
| border-top: none; | |||
| } | |||
| .icon-right, .icon-down, .icon-up { | |||
| display: inline-block; | |||
| padding-right: 13rpx; | |||
| position: absolute; | |||
| right: 20rpx; | |||
| top: 10rpx; | |||
| } | |||
| .icon-right::after, .icon-down::after, .icon-up::after { | |||
| content: ""; | |||
| display: inline-block; | |||
| position: relative; | |||
| bottom: 2rpx; | |||
| margin-left: 10rpx; | |||
| height: 20rpx; | |||
| width: 20rpx; | |||
| border: solid #bbb; | |||
| border-width:4rpx 4rpx 0 0; | |||
| } | |||
| .icon-right::after { | |||
| -webkit-transform: rotate(45deg); | |||
| transform: rotate(45deg); | |||
| } | |||
| .icon-down::after { | |||
| bottom: 14rpx; | |||
| -webkit-transform: rotate(135deg); | |||
| transform: rotate(135deg); | |||
| } | |||
| .icon-up::after { | |||
| bottom: 0rpx; | |||
| -webkit-transform: rotate(-45deg); | |||
| transform: rotate(-45deg); | |||
| } | |||
| @@ -0,0 +1,36 @@ | |||
| // pages/common/foot/teacher/foot.js | |||
| Component({ | |||
| properties: { | |||
| dataInd: { | |||
| type: String, | |||
| value: '' | |||
| } | |||
| }, | |||
| data: { | |||
| tabList: [{ | |||
| icon: 'iconfont icon-shouye', | |||
| txt: "首页", | |||
| url: '/pages/main/main', | |||
| id: '0', | |||
| color: '' | |||
| }, | |||
| { | |||
| icon: 'iconfont icon-wode', | |||
| txt: "我的", | |||
| url: '/pages/mine/mine', | |||
| id: '2', | |||
| color: '' | |||
| } | |||
| ] | |||
| }, | |||
| ready() { | |||
| this.properties.tabList.map(file => { | |||
| if (file.id == this.properties.dataInd) { | |||
| file.color = '#0ac4ff' | |||
| } | |||
| }) | |||
| this.setData({ | |||
| tabList: this.properties.tabList | |||
| }) | |||
| } | |||
| }) | |||
| @@ -0,0 +1,4 @@ | |||
| { | |||
| "component": true, | |||
| "usingComponents": {} | |||
| } | |||
| @@ -0,0 +1,6 @@ | |||
| <!-- <view class='tabbar'> | |||
| <navigator redirect wx:for='{{tabList}}' wx:key="index" url="{{item.url}}" class='navigator' data-index='{{index}}' hover-class='navigator-hover'> | |||
| <icon class='{{item.icon}}' style='color: {{item.color}}'></icon> | |||
| <text style='color: {{item.color}}'>{{item.txt}}</text> | |||
| </navigator> | |||
| </view> --> | |||
| @@ -0,0 +1,29 @@ | |||
| /* Components/tabBar/tabBar.wxss */ | |||
| @import "../../iconfont.wxss"; | |||
| .tabbar{ | |||
| background: #fff; | |||
| display: flex; | |||
| justify-content: space-around; | |||
| position: fixed; | |||
| bottom: 0; | |||
| width: 100%; | |||
| height: 50px; | |||
| border-top: 1px solid #ccc; | |||
| z-index: 999; | |||
| } | |||
| .navigator-hover{ | |||
| color: #0ac4ff; | |||
| } | |||
| .tabbar .navigator{ | |||
| display: flex; | |||
| flex-wrap: wrap; | |||
| align-content: center; | |||
| text-align: center; | |||
| } | |||
| .tabbar .navigator icon{ | |||
| width: 100%; | |||
| } | |||
| .tabbar .navigator text{ | |||
| width: 100%; | |||
| } | |||
| @@ -0,0 +1,17 @@ | |||
| <template name="we-cropper"> | |||
| <canvas | |||
| class="cropper" | |||
| disable-scroll="true" | |||
| bindtouchstart="touchStart" | |||
| bindtouchmove="touchMove" | |||
| bindtouchend="touchEnd" | |||
| style="width:{{width}}px;height:{{height}}px;background-color: rgba(0, 0, 0, 0.8)" | |||
| canvas-id="{{id}}"> | |||
| </canvas> | |||
| <canvas | |||
| class="cropper" | |||
| disable-scroll="true" | |||
| style="position: fixed; top: -{{width * pixelRatio}}px; left: -{{height * pixelRatio}}px; width:{{width * pixelRatio}}px;height:{{height * pixelRatio}}px;" | |||
| canvas-id="{{targetId}}"> | |||
| </canvas> | |||
| </template> | |||
| @@ -0,0 +1,131 @@ | |||
| let config = require("./config/config.js"); | |||
| const Http = require("./utils/http"); | |||
| import GlobalConfig from './config/index' | |||
| const globalConfig = new GlobalConfig() | |||
| globalConfig.init() | |||
| App({ | |||
| onLaunch: function () { | |||
| var that = this | |||
| // 1. 自动更新 | |||
| that.autoUpdate() | |||
| // 2. 获取当前位置坐标 | |||
| // wx.getLocation({ | |||
| // type: 'wgs84', | |||
| // success: function(res) { | |||
| // that.globalData.latitude = res.latitude | |||
| // that.globalData.longitude = res.longitude | |||
| // } | |||
| // }) | |||
| // 3. 展示本地存储能力 | |||
| var logs = wx.getStorageSync('logs') || [] | |||
| logs.unshift(Date.now()) | |||
| wx.setStorageSync('logs', logs) | |||
| // 获取用户信息 | |||
| wx.getSetting({ | |||
| success: res => { | |||
| if (res.authSetting['scope.userInfo']) { | |||
| // 已经授权,可以直接调用 getUserInfo 获取头像昵称,不会弹框 | |||
| wx.getUserInfo({ | |||
| success: res => { | |||
| // 可以将 res 发送给后台解码出 unionId | |||
| this.globalData.userInfo = res.userInfo | |||
| // 由于 getUserInfo 是网络请求,可能会在 Page.onLoad 之后才返回 | |||
| // 所以此处加入 callback 以防止这种情况 | |||
| if (this.userInfoReadyCallback) { | |||
| this.userInfoReadyCallback(res) | |||
| } | |||
| } | |||
| }) | |||
| } | |||
| } | |||
| }) | |||
| }, | |||
| autoUpdate: function () { | |||
| let that = this; | |||
| if (wx.canIUse('getUpdateManager')) { | |||
| const updateManager = wx.getUpdateManager() | |||
| // 1. 检查小程序是否有新版本发布 | |||
| updateManager.onCheckForUpdate(function (res) { | |||
| // 请求完新版本信息的回调 | |||
| if (res.hasUpdate) { | |||
| // 检测到新版本,需要更新,给出提示 | |||
| wx.showModal({ | |||
| title: '更新提示', | |||
| content: '检测到新版本,是否下载新版本并重启小程序?', | |||
| success: function (res) { | |||
| if (res.confirm) { | |||
| //2. 用户确定下载更新小程序,小程序下载及更新静默进行 | |||
| that.downLoadAndUpdate(updateManager) | |||
| } else if (res.cancel) { | |||
| //用户点击取消按钮的处理,如果需要强制更新,则给出二次弹窗,如果不需要,则这里的代码都可以删掉了 | |||
| wx.showModal({ | |||
| title: '温馨提示~', | |||
| content: '本次版本更新涉及到新的功能添加,旧版本无法正常访问的哦~', | |||
| showCancel: false,//隐藏取消按钮 | |||
| confirmText: "确定更新",//只保留确定更新按钮 | |||
| success: function (res) { | |||
| if (res.confirm) { | |||
| //下载新版本,并重新应用 | |||
| that.downLoadAndUpdate(updateManager) | |||
| } | |||
| } | |||
| }) | |||
| } | |||
| } | |||
| }) | |||
| } | |||
| }) | |||
| } else { | |||
| // 如果希望用户在最新版本的客户端上体验您的小程序,可以这样子提示 | |||
| wx.showModal({ | |||
| title: '提示', | |||
| content: '当前微信版本过低,无法使用该功能,请升级到最新微信版本后重试。' | |||
| }) | |||
| } | |||
| }, | |||
| /** | |||
| * 下载小程序新版本并重启应用 | |||
| */ | |||
| downLoadAndUpdate: function (updateManager) { | |||
| let that = this | |||
| wx.showLoading(); | |||
| //静默下载更新小程序新版本 | |||
| updateManager.onUpdateReady(function () { | |||
| wx.hideLoading() | |||
| //新的版本已经下载好,调用 applyUpdate 应用新版本并重启 | |||
| updateManager.applyUpdate() | |||
| }) | |||
| updateManager.onUpdateFailed(function () { | |||
| // 新的版本下载失败 | |||
| wx.showModal({ | |||
| title: '已经有新版本了哟~', | |||
| content: '新版本已经上线啦~,请您删除当前小程序,重新搜索打开哟~', | |||
| }) | |||
| }) | |||
| }, | |||
| globalData: { | |||
| mouldType: 0,//主题风格模板 | |||
| userInfo: '', | |||
| superopenId: null, | |||
| session_key: null, | |||
| latitude: null, | |||
| longitude: null, | |||
| token: null, | |||
| enddate: null, | |||
| startdate: null, | |||
| curHtml: '', | |||
| config: globalConfig | |||
| } | |||
| }) | |||
| // 测试 wxfa116c4a29453fc9 | |||
| // 生产 wx7299c86d22d0ab42 | |||
| // 测试账号信息 | |||
| // 18872592633 | |||
| // 123456GD | |||
| @@ -0,0 +1,136 @@ | |||
| { | |||
| "pages": [ | |||
| "pages/index/index", | |||
| "pages/statementsDetail/index", | |||
| "pages/creditOperate/index", | |||
| "pages/memberPhone/index", | |||
| "pages/creditSelect/index", | |||
| "pages/getMerchant/index", | |||
| "pages/operation/index", | |||
| "pages/exchange/index", | |||
| "pages/editSuccess/index", | |||
| "pages/Add/index", | |||
| "pages/main/main", | |||
| "pages/membersinfo/index", | |||
| "pages/payment/index", | |||
| "pages/huiyuanHome/huiyuanHome", | |||
| "pages/Yunying/Yunying", | |||
| "pages/Keliu/Keliu", | |||
| "pages/cheliu/cheliu", | |||
| "pages/yingXiao/yingXiao", | |||
| "pages/datatower/datatower", | |||
| "pages/record/list/index", | |||
| "pages/pos/list/index", | |||
| "pages/main/writeoffPage/errorPage/errorPage", | |||
| "pages/main/write0ff/write0ff", | |||
| "pages/main/writeoffPage/writeoffPage", | |||
| "pages/main/solution/success/success", | |||
| "pages/main/solution/detail/index", | |||
| "pages/main/transaction/transaction", | |||
| "pages/index/setpwd/setpwd", | |||
| "pages/index/forgetpwd/forgetpwd", | |||
| "pages/main/solution/submission/submission", | |||
| "pages/main/solution/fail/fail", | |||
| "pages/mine/mine", | |||
| "pages/main/solution/solution", | |||
| "pages/bill/bill", | |||
| "pages/bill/billdetail/index", | |||
| "pages/bill/query/index", | |||
| "pages/bill/querySg/index", | |||
| "pages/bill/pay/index", | |||
| "pages/main/success/success", | |||
| "pages/mine/signInDetail/signInDetail", | |||
| "pages/main/rule/rule", | |||
| "pages/member/member", | |||
| "pages/cardReceive/cardReceive", | |||
| "pages/scan/scan", | |||
| "pages/scanII/scan", | |||
| "pages/saoyisao/saoyisao", | |||
| "pages/memberlist/index", | |||
| "pages/receiveRecord/index", | |||
| "pages/butie/butie", | |||
| "pages/receiveDate/receiveDate", | |||
| "pages/receiveDateX/receiveDate", | |||
| "pages/accountManagement/detail", | |||
| "pages/accountManagement/result/success", | |||
| "pages/accountManagement/index", | |||
| "pages/giveCoupon/index", | |||
| "pages/couponRecord/index", | |||
| "pages/incouponSelect/index", | |||
| "pages/getuserinfo/index", | |||
| "pages/payment/mjCoupon/mjCoupon", | |||
| "pages/marktingsettlement/index", | |||
| "pages/sendDiscounts/sendDiscounts", | |||
| "pages/addReel/addReel", | |||
| "pages/upload/upload", | |||
| "pages/lookExamine/lookExamine", | |||
| "pages/withdraw/withdraw", | |||
| "pages/withdrawRecord/withdrawRecord", | |||
| "pages/withdrawDetails/withdrawDetails", | |||
| "pages/delivery/delivery", | |||
| "pages/deliveryDetails/deliveryDetails", | |||
| "pages/bill/voucher/voucher", | |||
| "pages/warehouse/warehouse", | |||
| "pages/warehouse/detail/subjectFirm/subjectFirm", | |||
| "pages/warehouse/detail/manageFirm/manageFirm", | |||
| "pages/warehouse/detail/industryFirm/industryFirm", | |||
| "pages/warehouse/detail/clearingFirm/clearingFirm", | |||
| "pages/warehouse/detail/adminFirm/adminFirm", | |||
| "pages/webBox/webVi", | |||
| "pages/warehouse/lookStatus/lookStatus", | |||
| "pages/cardPay/cardPay", | |||
| "pages/cardInput/cardInput", | |||
| "pages/cardSuccess/cardSuccess", | |||
| "pages/refund/refund", | |||
| "pages/refundDetail/refundDetail", | |||
| "pages/activityCash/activityCash", | |||
| "pages/activityCashDetails/activityCashDetails", | |||
| "pages/cashContent/cashContent", | |||
| "pages/raffle/index", | |||
| "pages/raffleDetails/index", | |||
| "pages/raffleContent/index", | |||
| "pages/bill/meter/meter", | |||
| "pages/legionOrder/list", | |||
| "pages/legionOrderDetail/index", | |||
| "pages/datatower81/datatower", | |||
| "pages/datatower82/datatower", | |||
| "pages/datatower83/datatower", | |||
| "pages/datatower84/datatower", | |||
| "pages/datatower85/datatower", | |||
| "pages/datatower86/datatower" | |||
| ], | |||
| "permission": { | |||
| "scope.userLocation": { | |||
| "desc": "你的位置信息将用于小程序位置接口的效果展示" | |||
| } | |||
| }, | |||
| "tabBar": { | |||
| "color": "#9F9F9F", | |||
| "selectedColor": "#52a0fd", | |||
| "list": [ | |||
| { | |||
| "pagePath": "pages/main/main", | |||
| "iconPath": "static/images/home-n.png", | |||
| "selectedIconPath": "static/images/home-y.png", | |||
| "text": "首页" | |||
| }, | |||
| { | |||
| "pagePath": "pages/bill/bill", | |||
| "iconPath": "static/images/bill.png", | |||
| "selectedIconPath": "static/images/bill1.png", | |||
| "text": "账单" | |||
| }, | |||
| { | |||
| "pagePath": "pages/mine/mine", | |||
| "iconPath": "static/images/user-n.png", | |||
| "selectedIconPath": "static/images/user-y.png", | |||
| "text": "我的" | |||
| } | |||
| ] | |||
| }, | |||
| "window": { | |||
| "backgroundTextStyle": "light", | |||
| "navigationBarBackgroundColor": "#52A0FD" | |||
| }, | |||
| "sitemapLocation": "sitemap.json" | |||
| } | |||
| @@ -0,0 +1,29 @@ | |||
| /**app.wxss**/ | |||
| .container { | |||
| height: 100%; | |||
| display: flex; | |||
| flex-direction: column; | |||
| align-items: center; | |||
| justify-content: space-between; | |||
| box-sizing: border-box; | |||
| } | |||
| text{ | |||
| font-size: 34rpx; | |||
| } | |||
| .fl{ | |||
| float: left; | |||
| } | |||
| .fr{ | |||
| float: right; | |||
| } | |||
| .clearfix:after { | |||
| content: "."; | |||
| display: block; | |||
| height: 0; | |||
| clear: both; | |||
| visibility: hidden; | |||
| } | |||
| view, | |||
| text { | |||
| font-family: PingFangSC-Regular; | |||
| } | |||
| @@ -0,0 +1,366 @@ | |||
| let config = require("../config/config.js"); | |||
| var app = getApp(); | |||
| const func = { | |||
| getMallIcon: function () { | |||
| return new Promise((resolve, reject) => { | |||
| wx.request({ | |||
| url: config.api.getMallIcon, | |||
| data: { | |||
| appId: config.weapp.appId, | |||
| }, | |||
| success: function (res) { | |||
| resolve(res.data) | |||
| }, | |||
| fail: function (err) { | |||
| reject(err) | |||
| }, | |||
| complete: function (res) { | |||
| //console.log("getMallIcon complete:" + res) | |||
| } | |||
| }) | |||
| }) | |||
| }, | |||
| userLogin: function (phone, password, latitude, longitude) { | |||
| return new Promise((resolve, reject) => { | |||
| wx.request({ | |||
| url: config.api.login, | |||
| data: { | |||
| appId: config.weapp.appId, | |||
| phone: phone, | |||
| password: password, | |||
| latitude: latitude, | |||
| longitude: longitude | |||
| }, | |||
| method: "POST", | |||
| success: function (res) { | |||
| resolve(res.data) | |||
| }, | |||
| fail: function (err) { | |||
| reject(err) | |||
| }, | |||
| complete: function (res) { | |||
| //console.log("userLogin complete:" + res) | |||
| } | |||
| }) | |||
| }) | |||
| }, | |||
| getUserInfo: function (phone, password, latitude, longitude) { | |||
| return new Promise((resolve, reject) => { | |||
| wx.request({ | |||
| url: config.api.userDetail, | |||
| header: { | |||
| "content-type": "application/json;charset=UTF-8", | |||
| "token": app.globalData.token | |||
| }, | |||
| data: { | |||
| appId: config.weapp.appId, | |||
| phone: phone, | |||
| password: password, | |||
| latitude: latitude, | |||
| longitude: longitude | |||
| }, | |||
| method: "POST", | |||
| success: function (res) { | |||
| resolve(res) | |||
| }, | |||
| fail: function (err) { | |||
| reject(err) | |||
| }, | |||
| complete: function (res) { | |||
| //console.log("userLogin complete:" + res) | |||
| } | |||
| }) | |||
| }) | |||
| }, | |||
| /** | |||
| * 优惠券查询 | |||
| */ | |||
| getCouponList: function (pageNum, pageSize) { | |||
| return new Promise((resolve, reject) => { | |||
| wx.request({ | |||
| url: config.api.couponList, | |||
| header: { | |||
| "content-type": "application/json;charset=UTF-8", | |||
| "token": app.globalData.token | |||
| }, | |||
| method: "Get", | |||
| data: { | |||
| pageNum: pageNum, | |||
| pageSize: pageSize | |||
| }, | |||
| success: function (res) { | |||
| resolve(res) | |||
| }, | |||
| fail: function (err) { | |||
| reject(err) | |||
| }, | |||
| complete: function (res) { | |||
| console.log(res) | |||
| } | |||
| }) | |||
| }) | |||
| }, | |||
| /** | |||
| * 优惠券详情 | |||
| */ | |||
| getCouponOrderDetail: function (couponOrderId) { | |||
| return new Promise((resolve, reject) => { | |||
| wx.request({ | |||
| url: config.api.couponOrderDetail, | |||
| header: { | |||
| "content-type": "application/json;charset=UTF-8", | |||
| "token": app.globalData.token | |||
| }, | |||
| method: "Get", | |||
| data: { | |||
| couponOrderId: couponOrderId | |||
| }, | |||
| success: function (res) { | |||
| resolve(res.data) | |||
| }, | |||
| fail: function (err) { | |||
| reject(err) | |||
| }, | |||
| complete: function (res) { | |||
| console.log(res) | |||
| } | |||
| }) | |||
| }) | |||
| }, | |||
| /** | |||
| * 获取图文详情html | |||
| */ | |||
| getHtml: function (couponOrderId) { | |||
| return new Promise((resolve, reject) => { | |||
| wx.request({ | |||
| url: config.api.couponHtmlDetail, | |||
| header: { | |||
| "content-type": "application/json;charset=UTF-8", | |||
| "token": app.globalData.token | |||
| }, | |||
| method: "Get", | |||
| data: { | |||
| couponOrderId: couponOrderId | |||
| }, | |||
| success: function (res) { | |||
| resolve(res.data) | |||
| }, | |||
| fail: function (err) { | |||
| reject(err) | |||
| }, | |||
| complete: function (res) { | |||
| console.log(res) | |||
| } | |||
| }) | |||
| }) | |||
| }, | |||
| /** | |||
| * 更新密码 | |||
| */ | |||
| updateUserPassword: function (phone, yzm, newPwd) { | |||
| return new Promise((resolve, reject) => { | |||
| wx.request({ | |||
| url: config.api.userUpdatePwd, | |||
| header: { | |||
| "content-type": "application/json;charset=UTF-8", | |||
| }, | |||
| method: "POST", | |||
| data: { | |||
| phone: phone, | |||
| code: yzm, | |||
| pwd: newPwd, | |||
| appId: config.weapp.appId | |||
| }, | |||
| success: function (res) { | |||
| resolve(res.data) | |||
| }, | |||
| fail: function (err) { | |||
| reject(err) | |||
| }, | |||
| complete: function (res) { | |||
| console.log(res) | |||
| } | |||
| }) | |||
| }) | |||
| }, | |||
| /** | |||
| * 验证码验证 | |||
| */ | |||
| hasValidationCode: function (phone, yzm) { | |||
| return new Promise((resolve, reject) => { | |||
| wx.request({ | |||
| url: config.api.hasValidationCode, | |||
| header: { | |||
| "content-type": "application/json;charset=UTF-8", | |||
| }, | |||
| method: "Get", | |||
| data: { | |||
| phone: phone, | |||
| code: yzm, | |||
| type: 1, | |||
| appid: config.weapp.appId | |||
| }, | |||
| success: function (res) { | |||
| resolve(res.data) | |||
| }, | |||
| fail: function (err) { | |||
| reject(err) | |||
| }, | |||
| complete: function (res) { | |||
| console.log(res) | |||
| } | |||
| }) | |||
| }) | |||
| }, | |||
| /** | |||
| * 发送验证码 | |||
| */ | |||
| sendValidationCode: function (phone) { | |||
| return new Promise((resolve, reject) => { | |||
| wx.request({ | |||
| url: config.api.sendValidationCode, | |||
| header: { | |||
| "content-type": "application/json;charset=UTF-8", | |||
| }, | |||
| method: "Get", | |||
| data: { | |||
| phone: phone, | |||
| type: 1, | |||
| appid: config.weapp.appId | |||
| }, | |||
| success: function (res) { | |||
| resolve(res.data) | |||
| }, | |||
| fail: function (err) { | |||
| reject(err) | |||
| }, | |||
| complete: function (res) { | |||
| console.log(res) | |||
| } | |||
| }) | |||
| }) | |||
| }, | |||
| /** | |||
| * 券核销 | |||
| */ | |||
| couponOrderVerify: function (couponOrderId, verifyRemark) { | |||
| return new Promise((resolve, reject) => { | |||
| wx.request({ | |||
| url: config.api.couponOrderVerify, | |||
| header: { | |||
| "content-type": "application/json;charset=UTF-8", | |||
| "token": app.globalData.token, | |||
| }, | |||
| data: { | |||
| couponOrderId: couponOrderId, | |||
| verifyRemark: verifyRemark, | |||
| }, | |||
| method: "POST", | |||
| success: function (res) { | |||
| resolve(res.data) | |||
| }, | |||
| fail: function (err) { | |||
| reject(err) | |||
| }, | |||
| complete: function (res) { | |||
| //console.log("userLogin complete:" + res) | |||
| } | |||
| }) | |||
| }) | |||
| }, | |||
| /** | |||
| * | |||
| * @param {*换取openId} code | |||
| */ | |||
| getOpenId: function (code, bUserId, isCheck) { | |||
| const data = { | |||
| appId: config.weapp.appId, | |||
| code: code, | |||
| bUserId: bUserId | |||
| } | |||
| if (isCheck) { | |||
| data.isCheck = 'Y' | |||
| } | |||
| return new Promise((resolve, reject) => { | |||
| wx.request({ | |||
| url: config.api.getOpenId, | |||
| header: { | |||
| "content-type": "application/json;charset=UTF-8", | |||
| "token": app.globalData.token, | |||
| }, | |||
| data: data, | |||
| method: "POST", | |||
| success: function (res) { | |||
| if (res.data.code == 200) { | |||
| resolve(res) | |||
| } else { | |||
| reject(res) | |||
| } | |||
| }, | |||
| fail: function (err) { | |||
| reject(err) | |||
| }, | |||
| complete: function (res) { | |||
| //console.log("userLogin complete:" + res) | |||
| } | |||
| }) | |||
| }) | |||
| }, | |||
| /** | |||
| * 获得超级管理员openId | |||
| */ | |||
| getSuperOpenId: function (code) { | |||
| return new Promise((resolve, reject) => { | |||
| wx.request({ | |||
| url: config.api.getSuperOpenId, | |||
| header: { | |||
| "content-type": "application/json;charset=UTF-8", | |||
| }, | |||
| data: { | |||
| appId: config.weapp.appId, | |||
| code: code, | |||
| }, | |||
| method: "POST", | |||
| success: function (res) { | |||
| resolve(res) | |||
| }, | |||
| fail: function (err) { | |||
| reject(err) | |||
| } | |||
| }) | |||
| }) | |||
| }, | |||
| /** | |||
| * 获得手机号 | |||
| */ | |||
| getUserPhone: function (encryptedData, iv, superopenId, session_key) { | |||
| return new Promise((resolve, reject) => { | |||
| wx.request({ | |||
| url: config.api.getUserPhone, | |||
| header: { | |||
| "content-type": "application/json;charset=UTF-8", | |||
| }, | |||
| data: { | |||
| appId: config.weapp.appId, | |||
| encryptedData: encryptedData, | |||
| iv: iv, | |||
| openId: superopenId, | |||
| session_key: session_key, | |||
| }, | |||
| method: "POST", | |||
| success: function (res) { | |||
| resolve(res) | |||
| }, | |||
| fail: function (err) { | |||
| reject(err) | |||
| }, | |||
| complete: function (res) { | |||
| //console.log("userLogin complete:" + res) | |||
| } | |||
| }) | |||
| }) | |||
| }, | |||
| } | |||
| module.exports = func; | |||
| @@ -0,0 +1,508 @@ | |||
| const extConfig = wx.getExtConfigSync ? wx.getExtConfigSync() : {} | |||
| let weappId = extConfig.weappId; | |||
| console.log(extConfig, wx.getExtConfigSync(), 'extConfig') | |||
| let dataTowerUrl = extConfig.attr.datatowerurl; | |||
| let url = extConfig.attr.configUrl; | |||
| var apiPrefix = url + '/B'; | |||
| var config = { | |||
| // name: "富茂", | |||
| api: { | |||
| /** | |||
| * 接口用途:login | |||
| */ | |||
| login: '/api/user/login', | |||
| /** | |||
| * B端用户详情 | |||
| */ | |||
| userDetail: '/api/user/detail', | |||
| getMallIcon: '/api/mall/getAppIcon', | |||
| //提现列表 | |||
| withdrawLsit: "/api/cashout/list", | |||
| //账户余额 | |||
| balance: "/api/cashout/getCurrentCashOutData", | |||
| // 商户提现 | |||
| userWithdraw: "/api/cashout/cashout", | |||
| /** | |||
| * 修改密码 | |||
| */ | |||
| userUpdatePwd: '/api/user/updatepwd', | |||
| /** | |||
| * 券包详情 | |||
| */ | |||
| couponOrderDetail: '/api/couponOrder/detail', | |||
| /** | |||
| * 购买须知图文详情 | |||
| */ | |||
| couponHtmlDetail: '/api/couponOrder/html', | |||
| /** | |||
| * 退款 | |||
| */ | |||
| refundOrderCreate: '/api/refund/create', | |||
| /** | |||
| * 券核销 | |||
| */ | |||
| couponOrderVerify: '/api/couponOrder/verify', | |||
| /** | |||
| * 发送验证码 | |||
| */ | |||
| sendValidationCode: '/wxMsgValidationcode/sendvalidationcode', | |||
| /** | |||
| * 验证验证码 | |||
| */ | |||
| hasValidationCode: '/wxMsgValidationcode/hasvalidationcode', | |||
| /** | |||
| * 已被核销的券包 | |||
| */ | |||
| couponOrderListVerified: '/api/couponOrder/listVerified', | |||
| /** | |||
| * 已被核销的券包V2 | |||
| */ | |||
| couponOrderListVerifiedV2: '/api/couponOrder/listVerifiedV2', | |||
| /** | |||
| * 核销总金额和总笔数 | |||
| */ | |||
| couponOrderSumVerified: '/api/couponOrder/sumVerified', | |||
| /** | |||
| * 未核销的券包 | |||
| */ | |||
| couponOrderListUnVerified: '/api/couponOrder/listUnverified', | |||
| /** | |||
| * 手动券码核销开关 | |||
| */ | |||
| getByKey: '/api/sysConfig/getByKey', | |||
| /** | |||
| * 上报解单 | |||
| */ | |||
| reportDailyVolume: '/api/wxMerchantTradeDaily/reportDailyVolume', | |||
| /** | |||
| * 解单编辑 | |||
| */ | |||
| updateDailyVolume: '/api/wxMerchantTradeDaily/updateDailyVolume', | |||
| /** | |||
| * 获取当日解单 | |||
| */ | |||
| getVolume: '/api/wxMerchantTradeDaily/getVolume', | |||
| /** | |||
| * 获取周解单 | |||
| */ | |||
| getVolumeOfWeek: '/api/wxMerchantTradeDaily/getVolumeOfWeek', | |||
| /** | |||
| * 交易记录list | |||
| */ | |||
| dateAmountRecordListOrder: '/api/wxDateAmountRecord/listOrder', | |||
| /** | |||
| * 交易记录list | |||
| */ | |||
| dateAmountRecordListVerified: '/api/wxDateAmountRecord/listVerified', | |||
| /** | |||
| * 某日期交易总流水 | |||
| */ | |||
| getUnverifiedAmountOnDate: '/api/couponOrder/getUnverifiedAmountOnDate', | |||
| /** | |||
| * 某日期核销总流水 | |||
| */ | |||
| getVerifiedAmountOnDate: '/api/couponOrder/getVerifiedAmountOnDate', | |||
| /** | |||
| *刷卡支付订单 | |||
| */ | |||
| orderCreate: '/api/micropay/order_create', | |||
| /** | |||
| *查询刷卡支付订单 | |||
| */ | |||
| orderQuery: '/api/micropay/order_query', | |||
| /** | |||
| *撤销刷卡支付订单 | |||
| */ | |||
| orderReverse: '/api/micropay/order_reverse', | |||
| /** | |||
| *首页查询刷卡金额记录接口 | |||
| */ | |||
| listMicropay: '/api/wxDateAmountRecord/listMicropay', | |||
| oneMerchantOrderlist: '/neupos/api/trade/oneMerchantOrderlist', // pos交易流水 | |||
| dateMerchantOrderlist: '/neupos/api/trade/dateMerchantOrderlist', // pos交易流水 | |||
| /** | |||
| *刷卡支付交易流水分页列表接口 | |||
| */ | |||
| micropayListMicroPay: '/api/micropay/listMicroPay', | |||
| /** | |||
| *刷卡支付交易流水分页列表接口V2 | |||
| */ | |||
| micropayListMicroPayV2: '/api/micropay/listMicroPayV2', | |||
| /** | |||
| *刷卡支付交易流水分页列表接口V2 | |||
| */ | |||
| micropaySumMicroPay: '/api/micropay/sumMicroPay', | |||
| /** | |||
| *刷卡支付退款 | |||
| */ | |||
| // microPayRefund: '/api/micropay/microPayRefund', | |||
| /** | |||
| *刷卡支付某日期交易总流水 | |||
| */ | |||
| getMicroPayAmountOnDate: '/api/micropay/getMicroPayAmountOnDate', | |||
| /** | |||
| * 首页账单列表 | |||
| */ | |||
| listBillOweAndWaitPay: "/api/bill/listBillOweAndWaitPay", | |||
| /** | |||
| * 账单 | |||
| */ | |||
| listBill: "/api/bill/listBill", | |||
| notifyList: "/api/bill/notifyList", | |||
| oweBillList: "/api/bill/oweBillList", | |||
| nearBillList: '/api/bill/nearBillList', | |||
| billDetail: '/api/bill/detail', | |||
| mallbillDetail: '/api/mallAdmin/detail', | |||
| billActionlist: '/api/bill/billActionlist', | |||
| billScales: '/api/bill/billScales', | |||
| billTypes: '/api/bill/billTypes', | |||
| payChannel: '/api/bill/payChannel', | |||
| payBill: '/api/bill/payBill', | |||
| mallNotifyList: '/api/mallAdmin/notifyList', | |||
| mallNearBillHot: '/api/mallAdmin/nearBillHot', | |||
| mallOweBillHot: '/api/mallAdmin/oweBillHot', | |||
| mallListBill: "/api/mallAdmin/listBill", | |||
| mallBillSum: "/api/mallAdmin/billSum", | |||
| mallRent: "/api/mallAdmin/rent", | |||
| mallSales: "/api/mallAdmin/sales", | |||
| mallBillDailyTypes: "/api/mallAdmin/billDailyTypes", | |||
| menus: "/api/mallAdmin/menus", | |||
| billDailyAdd: "/api/mallAdmin/billDailyAdd", | |||
| getbuildingfloorlist: "/api/mallAdmin/getbuildingfloorlist", | |||
| getShopList: "/api/mallAdmin/shopList?pageNum=1&pageSize=1000&floor=", | |||
| getShopMeterList: "/api/mallAdmin/shopMeterList?", | |||
| timeList: "/api/mallAdmin/timeList", | |||
| meterList: "/api/mallAdmin/meterList", | |||
| preShopReadingList: "/api/mallAdmin/preShopReadingList?meterId=", | |||
| commitEnergyReading: "/api/mallAdmin/commitEnergyReading", | |||
| /** | |||
| * 获得openId | |||
| */ | |||
| getOpenId: "/api/wx/getOpenId", | |||
| /** | |||
| * 获得超级管理员openid | |||
| */ | |||
| getSuperOpenId: "/api/wx/getSuperOpenId", | |||
| /** | |||
| * 获得手机号 | |||
| */ | |||
| getUserPhone: "/api/wx/getUserPhone", | |||
| /** | |||
| * | |||
| */ | |||
| getUserPhoneForBuser: "/api/wx/getUserPhoneForBuser", | |||
| /** | |||
| * 发起微信小程序支付订单 | |||
| */ | |||
| createorder: "/api/pay/create", | |||
| /** | |||
| * 更新支付订单状态 | |||
| */ | |||
| updatePayBill: '/api/pay/updatePayBill', | |||
| /** | |||
| * 获取用户等级及在此商户的折扣率及折扣后的金额 | |||
| */ | |||
| getUserInfo: "/api/user/getUserInfo", | |||
| /** | |||
| * 扫C端会员码返回会员信息 | |||
| */ | |||
| memScan: "/api/mem/mem_scan", | |||
| /** | |||
| * 补充会员信息 | |||
| */ | |||
| cMemberAdd: "/api/cuser/updateUserInfo", | |||
| /** | |||
| * | |||
| */ | |||
| findUserInfo: '/api/cuser/findUserInfo', | |||
| /** | |||
| *b端来源会员信息分页列表接口 | |||
| */ | |||
| listCUser: '/api/cuser/listCUser', | |||
| /** | |||
| *C端扫B端储值卡交易流水(消费记录 + 补贴)列表接口 | |||
| */ | |||
| cardPayList: "/api/cardPay/list", | |||
| cardRefundCardOrder: "/api/cardPay/refundCardOrder", | |||
| cardPayDetail: "/api/cardPay/detail", | |||
| /** | |||
| *B端根据手机号查询卡列表 | |||
| */ | |||
| cardInfoList: "/api/cardInfo/list", | |||
| useCardBySearchPhone: "/api/merchant/useCardBySearchPhone", | |||
| /** | |||
| *C端扫B端储值卡交易流水SUM | |||
| */ | |||
| payMum: "/api/cardPay/sum", | |||
| /** | |||
| 补贴记录 | |||
| */ | |||
| subsidyList: "/api/subsidy/list", | |||
| /** | |||
| * 补贴记录汇总 | |||
| */ | |||
| subsidySum: "/api/subsidy/sum", | |||
| /** | |||
| * 图片上传 | |||
| */ | |||
| imgUpload: '/api/upload/awsFileUpload', | |||
| /** | |||
| * 获取商户列表 | |||
| */ | |||
| getMerchentList: "/api/merchant/name_list", | |||
| /** | |||
| * 获取消费金额对应积分 | |||
| */ | |||
| getCreditNum: "/api/credit/findByMerchantIdAndSpend", | |||
| /** | |||
| * 积分新增 | |||
| */ | |||
| addCredit: "/api/credit/add", | |||
| /** | |||
| * 根据手机号查询C端会员信息 | |||
| */ | |||
| findByPhone: "/api/credit/findByPhone", | |||
| /** | |||
| * 获取积分操作记录 | |||
| */ | |||
| getCreditList: "/api/credit/list", | |||
| /** | |||
| * 查询账户信息 | |||
| */ | |||
| findAccountById: "/api/merchant/findAccountById", | |||
| /** | |||
| * 更新收款账户信息 | |||
| */ | |||
| updateAccount: "/api/merchant/updateAccount", | |||
| /** | |||
| * 删除分账账户 | |||
| */ | |||
| deleteByReceiverId: "/api/merchant/deleteByReceiverId", | |||
| /** | |||
| * 获得解单的list | |||
| */ | |||
| tradeDailyList: "/api/wxMerchantTradeDaily/list", | |||
| /** | |||
| *保存或编辑 | |||
| */ | |||
| saveOrUpdate: "/api/wxMerchantTradeDaily/saveOrUpdate", | |||
| /** | |||
| * 解单详情详情 | |||
| */ | |||
| wxMerchantTradeDailyfindById: "/api/wxMerchantTradeDaily/findById", | |||
| /** | |||
| * 获取会员可赠送的券列表 | |||
| */ | |||
| wxMerchantcouponSend: "/api/couponSend/list", | |||
| /** | |||
| * 商户注券操作 | |||
| */ | |||
| wxMerchantcouponhandSel: "/api/couponSend/handSel", | |||
| /** | |||
| * 商户注券记录 | |||
| */ | |||
| wxMerchantcouponStory: "/api/couponSend/actionLog", | |||
| /** | |||
| * 获取结算单详情接口 | |||
| */ | |||
| findSettleById: "/api/bill/findSettleById", | |||
| /** | |||
| * 检查用户手机授权状态 | |||
| */ | |||
| checkPhoneStatus: "/api/wx/checkPhoneStatus", | |||
| /** | |||
| * 检查用户是否有权限修改收款账户 | |||
| */ | |||
| permitModifiy: "/api/merchant/permitModifiy", | |||
| /** | |||
| * 查询服装tag | |||
| */ | |||
| getTag: "/api/tag/getData", | |||
| /** | |||
| * 收银满减券 | |||
| */ | |||
| getManjian: "/api/micropay/order_create_v2", | |||
| /** | |||
| * 获取营销结算列表 | |||
| */ | |||
| getSubsidyList: "/api/subsidy/list", | |||
| /** | |||
| * 获取营销结算汇总 | |||
| */ | |||
| getSubsidySummary: "/api/subsidy/summary", | |||
| /** | |||
| *刷卡支付订单 | |||
| */ | |||
| orderCreate2: '/api/micropay/pay_order_create_v2', | |||
| /** | |||
| * 查询商户授权状态 | |||
| */ | |||
| getOpenIdByPhone: "/api/merchant/getOpenIdByPhone", | |||
| /** | |||
| * B端发卷-查询 | |||
| */ | |||
| getCouponlist: "/api/coupon/list", | |||
| /** | |||
| * B端发卷-已上架 | |||
| */ | |||
| getShelf: "/api/wxCouponChannel/list", | |||
| /** | |||
| * B端发卷-添加通用卷 | |||
| */ | |||
| addCoupon: "/api/coupon/add", | |||
| /** | |||
| * B端发卷-修改通用券 | |||
| */ | |||
| updataCoupon: "/api/coupon/update", | |||
| /** | |||
| *B端发卷- 提交审批 | |||
| */ | |||
| submitExamine: "/api/coupon/apply", | |||
| /** | |||
| * B端发卷-投放 | |||
| */ | |||
| addbatch: "/api/wxCouponChannel/addbatch", | |||
| /** | |||
| * B端发卷-下架 | |||
| */ | |||
| soldOut: "/api/wxCouponChannel/update", | |||
| /** | |||
| * B端发卷-作废 | |||
| */ | |||
| cancellation: "/api/coupon/update", | |||
| /** | |||
| * B端发卷-查询审批历史记录 | |||
| */ | |||
| lookHistory: "/api/coupon/flowHistory", | |||
| /** | |||
| * 配送列表 | |||
| */ | |||
| goodsList: '/api/couponOrder/goodsList', | |||
| /** | |||
| * 查询配送详情 | |||
| */ | |||
| ouponOrderId: "/api/couponOrder/detail", | |||
| /** | |||
| * 发货 | |||
| */ | |||
| sendGoods: "/api/couponOrder/sendGoods", | |||
| getAppMouldType: "/api/wx/getAppMouldType", | |||
| /** | |||
| * 上传交易凭证 | |||
| */ | |||
| finishBill: "/api/bill/finishBill", | |||
| /** | |||
| * 判断行业资质 | |||
| */ | |||
| getQualification: "/api/sharingReceiverApply/getQualification", | |||
| /** | |||
| * 进件 | |||
| */ | |||
| receiverAdd: "/api/sharingReceiverApply/receiverAdd", | |||
| /** | |||
| * 查询进件状态 | |||
| */ | |||
| getReceiverApply: "/api/sharingReceiverApply/getReceiverApply", | |||
| /** | |||
| * 图片上传 | |||
| */ | |||
| merchantUpload: "/api/mediaUpload/merchantUpload", | |||
| /** | |||
| * 获取行业资质列表 | |||
| */ | |||
| getQualification: "/api/sharingReceiverApply/getQualification", | |||
| /** | |||
| * 查询银行 | |||
| * | |||
| */ | |||
| banking: "/api/bank/banking", | |||
| /** | |||
| * 查询省份 | |||
| */ | |||
| // areasProvinces:"/api/bank/areasProvinces", | |||
| areasProvinces: "/api/bank/wxProvinces", | |||
| /** | |||
| * 查询市 | |||
| */ | |||
| // areasCities:"/api/bank/areasCities", | |||
| areasCities: "/api/bank/wxCities", | |||
| /** | |||
| * 查支行 | |||
| */ | |||
| bankBranches: "/api/bank/bankBranches", | |||
| /** | |||
| * 下载授权函 | |||
| */ | |||
| getYwsqh: "/api/sharingReceiverApply/getYwsqh_v2", | |||
| /** | |||
| * 进件提交审核 | |||
| */ | |||
| applyment: "/api/sharingReceiverApply/applyment", | |||
| /** | |||
| * 查询进件状态 | |||
| */ | |||
| syncApplymentStates: "/api/sharingReceiverApply/syncApplymentStates", | |||
| /** | |||
| * 查看支付配置 | |||
| * | |||
| */ | |||
| getPayAccount: "/api/payAccount/getPayAccount", | |||
| cardInfoDetail: "/api/cardInfo/detail", | |||
| cardPayScanCard: '/api/cardPay/scanCard', | |||
| // 活动返现 | |||
| cashbackList: '/api/cashback/list', | |||
| recordList: '/api/cashback/recordList', | |||
| recordCount: '/api/cashback/recordCount', | |||
| recordInfo: '/api/cashback/recordInfo', | |||
| saveOrUpdateRecord: '/api/cashback/saveOrUpdateRecord', | |||
| //线上抽奖 | |||
| raffleList: '/api/raffle/list', | |||
| raffleRecordList: '/api/raffle/recordList', | |||
| raffleRecordCount: '/api/raffle/recordCount', | |||
| raffleRecordInfo: '/api/raffle/recordInfo', | |||
| raffleSaveOrUpdateRecord: '/api/raffle/saveOrUpdateRecord', | |||
| //军团活动 | |||
| legionList: '/api/legion/list', | |||
| legionOrderGetInfoById: '/api/legionOrder/getInfoById', | |||
| legionOrderList: '/api/legionOrder/list', | |||
| legionOrderSaveOrUpdate: '/api/legionOrder/saveOrUpdate', | |||
| legionOrderStatistics: '/api/legionOrder/statistics', | |||
| legionUserGetByPhone: '/api/legionUser/getByPhone', | |||
| legionUserGetInfoById: '/api/legionUser/getInfoById', | |||
| legionUserList: '/api/legionUser/list', | |||
| legionUserSaveOrUpdate: '/api/legionUser/saveOrUpdate', | |||
| //军团活动用户分页列表 | |||
| legionUserList:'/api/legionUser/list', | |||
| //活动发奖 | |||
| offlineRecordList: "/api/offlineRecord/list", | |||
| //新建/修改活动审批 | |||
| offlineSaveOrUpdate: '/api/offlineRecord/saveOrUpdate', | |||
| //查看活动审批详情 | |||
| offlineRecordGetInfoById: '/api/offlineRecord/getInfoById', | |||
| //线下活动统计 | |||
| fflineRecordStatistics: '/api/offlineRecord/statistics' | |||
| }, | |||
| weapp: { | |||
| appId: weappId, | |||
| dataTowerUrl: dataTowerUrl, | |||
| } | |||
| }; | |||
| for (var key in config.api) { | |||
| config.api[key] = apiPrefix + config.api[key]; | |||
| } | |||
| module.exports = config; | |||
| @@ -0,0 +1,35 @@ | |||
| export default class GlobalConfig { | |||
| constructor () { | |||
| this.theme = { | |||
| active: 'green', | |||
| items: [ | |||
| { | |||
| color: '#04b00f', | |||
| name: 'green' | |||
| }, | |||
| { | |||
| color: '#C20C0C', | |||
| name: 'red' | |||
| }, | |||
| { | |||
| color: '#F0C040', | |||
| name: 'yellow' | |||
| } | |||
| ] | |||
| } | |||
| } | |||
| init () { | |||
| const { color } = this.theme.items.find(item => item.name === this.theme.active) | |||
| this.setThemeColor(color) | |||
| } | |||
| setThemeColor (v) { | |||
| wx.setStorageSync('themeColor', v) | |||
| } | |||
| getThemeColor () { | |||
| return wx.getStorageSync('themeColor') | |||
| } | |||
| } | |||
| @@ -0,0 +1,118 @@ | |||
| import WxCanvas from './wx-canvas'; | |||
| import * as echarts from './echarts'; | |||
| let ctx; | |||
| Component({ | |||
| properties: { | |||
| canvasId: { | |||
| type: String, | |||
| value: 'ec-canvas' | |||
| }, | |||
| ec: { | |||
| type: Object | |||
| } | |||
| }, | |||
| data: { | |||
| }, | |||
| ready: function () { | |||
| if (!this.data.ec) { | |||
| console.warn('组件需绑定 ec 变量,例:<ec-canvas id="mychart-dom-bar" ' | |||
| + 'canvas-id="mychart-bar" ec="{{ ec }}"></ec-canvas>'); | |||
| return; | |||
| } | |||
| if (!this.data.ec.lazyLoad) { | |||
| this.init(); | |||
| } | |||
| }, | |||
| methods: { | |||
| init: function (callback) { | |||
| const version = wx.version.version.split('.').map(n => parseInt(n, 10)); | |||
| const isValid = version[0] > 1 || (version[0] === 1 && version[1] > 9) | |||
| || (version[0] === 1 && version[1] === 9 && version[2] >= 91); | |||
| if (!isValid) { | |||
| console.error('微信基础库版本过低,需大于等于 1.9.91。' | |||
| + '参见:https://github.com/ecomfe/echarts-for-weixin' | |||
| + '#%E5%BE%AE%E4%BF%A1%E7%89%88%E6%9C%AC%E8%A6%81%E6%B1%82'); | |||
| return; | |||
| } | |||
| ctx = wx.createCanvasContext(this.data.canvasId, this); | |||
| const canvas = new WxCanvas(ctx, this.data.canvasId); | |||
| echarts.setCanvasCreator(() => { | |||
| return canvas; | |||
| }); | |||
| var query = wx.createSelectorQuery().in(this); | |||
| query.select('.ec-canvas').boundingClientRect(res => { | |||
| if (typeof callback === 'function') { | |||
| this.chart = callback(canvas, res.width, res.height); | |||
| } | |||
| else if (this.data.ec && typeof this.data.ec.onInit === 'function') { | |||
| this.chart = this.data.ec.onInit(canvas, res.width, res.height); | |||
| } | |||
| else { | |||
| this.triggerEvent('init', { | |||
| canvas: canvas, | |||
| width: res.width, | |||
| height: res.height | |||
| }); | |||
| } | |||
| }).exec(); | |||
| }, | |||
| canvasToTempFilePath(opt) { | |||
| if (!opt.canvasId) { | |||
| opt.canvasId = this.data.canvasId; | |||
| } | |||
| ctx.draw(true, () => { | |||
| wx.canvasToTempFilePath(opt, this); | |||
| }); | |||
| }, | |||
| touchStart(e) { | |||
| if (this.chart && e.touches.length > 0) { | |||
| var touch = e.touches[0]; | |||
| this.chart._zr.handler.dispatch('mousedown', { | |||
| zrX: touch.x, | |||
| zrY: touch.y | |||
| }); | |||
| this.chart._zr.handler.dispatch('mousemove', { | |||
| zrX: touch.x, | |||
| zrY: touch.y | |||
| }); | |||
| } | |||
| }, | |||
| touchMove(e) { | |||
| if (this.chart && e.touches.length > 0) { | |||
| var touch = e.touches[0]; | |||
| this.chart._zr.handler.dispatch('mousemove', { | |||
| zrX: touch.x, | |||
| zrY: touch.y | |||
| }); | |||
| } | |||
| }, | |||
| touchEnd(e) { | |||
| if (this.chart) { | |||
| const touch = e.changedTouches ? e.changedTouches[0] : {}; | |||
| this.chart._zr.handler.dispatch('mouseup', { | |||
| zrX: touch.x, | |||
| zrY: touch.y | |||
| }); | |||
| this.chart._zr.handler.dispatch('click', { | |||
| zrX: touch.x, | |||
| zrY: touch.y | |||
| }); | |||
| } | |||
| } | |||
| } | |||
| }); | |||
| @@ -0,0 +1,4 @@ | |||
| { | |||
| "component": true, | |||
| "usingComponents": {} | |||
| } | |||
| @@ -0,0 +1,4 @@ | |||
| <canvas class="ec-canvas" canvas-id="{{ canvasId }}" | |||
| bindinit="init" | |||
| bindtouchstart="{{ ec.disableTouch ? '' : 'touchStart' }}" bindtouchmove="{{ ec.disableTouch ? '' : 'touchMove' }}" bindtouchend="{{ ec.disableTouch ? '' : 'touchEnd' }}"> | |||
| </canvas> | |||
| @@ -0,0 +1,4 @@ | |||
| .ec-canvas { | |||
| width: 100%; | |||
| height: 100%; | |||
| } | |||
| @@ -0,0 +1,97 @@ | |||
| export default class WxCanvas { | |||
| constructor(ctx, canvasId) { | |||
| this.ctx = ctx; | |||
| this.canvasId = canvasId; | |||
| this.chart = null; | |||
| // this._initCanvas(zrender, ctx); | |||
| this._initStyle(ctx); | |||
| this._initEvent(); | |||
| } | |||
| getContext(contextType) { | |||
| if (contextType === '2d') { | |||
| return this.ctx; | |||
| } | |||
| } | |||
| // canvasToTempFilePath(opt) { | |||
| // if (!opt.canvasId) { | |||
| // opt.canvasId = this.canvasId; | |||
| // } | |||
| // return wx.canvasToTempFilePath(opt, this); | |||
| // } | |||
| setChart(chart) { | |||
| this.chart = chart; | |||
| } | |||
| attachEvent () { | |||
| // noop | |||
| } | |||
| detachEvent() { | |||
| // noop | |||
| } | |||
| _initCanvas(zrender, ctx) { | |||
| zrender.util.getContext = function () { | |||
| return ctx; | |||
| }; | |||
| zrender.util.$override('measureText', function (text, font) { | |||
| ctx.font = font || '12px sans-serif'; | |||
| return ctx.measureText(text); | |||
| }); | |||
| } | |||
| _initStyle(ctx) { | |||
| var styles = ['fillStyle', 'strokeStyle', 'globalAlpha', | |||
| 'textAlign', 'textBaseAlign', 'shadow', 'lineWidth', | |||
| 'lineCap', 'lineJoin', 'lineDash', 'miterLimit', 'fontSize']; | |||
| styles.forEach(style => { | |||
| Object.defineProperty(ctx, style, { | |||
| set: value => { | |||
| if (style !== 'fillStyle' && style !== 'strokeStyle' | |||
| || value !== 'none' && value !== null | |||
| ) { | |||
| ctx['set' + style.charAt(0).toUpperCase() + style.slice(1)](value); | |||
| } | |||
| } | |||
| }); | |||
| }); | |||
| ctx.createRadialGradient = () => { | |||
| return ctx.createCircularGradient(arguments); | |||
| }; | |||
| } | |||
| _initEvent() { | |||
| this.event = {}; | |||
| const eventNames = [{ | |||
| wxName: 'touchStart', | |||
| ecName: 'mousedown' | |||
| }, { | |||
| wxName: 'touchMove', | |||
| ecName: 'mousemove' | |||
| }, { | |||
| wxName: 'touchEnd', | |||
| ecName: 'mouseup' | |||
| }, { | |||
| wxName: 'touchEnd', | |||
| ecName: 'click' | |||
| }]; | |||
| eventNames.forEach(name => { | |||
| this.event[name.wxName] = e => { | |||
| const touch = e.touches[0]; | |||
| this.chart._zr.handler.dispatch(name.ecName, { | |||
| zrX: name.wxName === 'tap' ? touch.clientX : touch.x, | |||
| zrY: name.wxName === 'tap' ? touch.clientY : touch.y | |||
| }); | |||
| }; | |||
| }); | |||
| } | |||
| } | |||
| @@ -0,0 +1,74 @@ | |||
| @font-face { | |||
| font-family: "iconfont"; /* Project id 1353693 */ | |||
| src: url('//at.alicdn.com/t/font_1353693_dinubmjfutg.woff2?t=1631098323868') format('woff2'), | |||
| url('//at.alicdn.com/t/font_1353693_dinubmjfutg.woff?t=1631098323868') format('woff'), | |||
| url('//at.alicdn.com/t/font_1353693_dinubmjfutg.ttf?t=1631098323868') format('truetype'); | |||
| } | |||
| .iconfont { | |||
| font-family: "iconfont" !important; | |||
| font-size: 16px; | |||
| font-style: normal; | |||
| -webkit-font-smoothing: antialiased; | |||
| -moz-osx-font-smoothing: grayscale; | |||
| } | |||
| .icon-lingquanzhongxin:before { | |||
| content: "\e8e7"; | |||
| } | |||
| .icon-wuliu:before { | |||
| content: "\e808"; | |||
| } | |||
| .icon-youhuiquan:before { | |||
| content: "\e76d"; | |||
| } | |||
| .icon-zhijiandan-:before { | |||
| content: "\e611"; | |||
| } | |||
| .icon-jiesuan:before { | |||
| content: "\e682"; | |||
| } | |||
| .icon-hexiao:before { | |||
| content: "\e687"; | |||
| } | |||
| .icon-shouyintai:before { | |||
| content: "\e683"; | |||
| } | |||
| .icon-jifen:before { | |||
| content: "\e61c"; | |||
| } | |||
| .icon-icon-riliriqi:before { | |||
| content: "\e807"; | |||
| } | |||
| .icon-shouye1:before { | |||
| content: "\e64e"; | |||
| } | |||
| .icon-shouyintai1:before { | |||
| content: "\e64f"; | |||
| } | |||
| .icon-quan:before { | |||
| content: "\e651"; | |||
| } | |||
| .icon-shoufukuan:before { | |||
| content: "\e647"; | |||
| } | |||
| .icon-jiantou-copy-copy:before { | |||
| content: "\e668"; | |||
| } | |||
| .icon-jiantou-copy-copy-copy:before { | |||
| content: "\e669"; | |||
| } | |||
| @@ -0,0 +1 @@ | |||
| {} | |||
| @@ -0,0 +1,114 @@ | |||
| // pages/Add/index.js | |||
| const config = require('../../config/config.js') | |||
| const Http = require('../../utils/http.js') | |||
| const HttpBasics = require('../../utils/HttpBasics.js') | |||
| const util = require('../../utils/util.js') | |||
| var app = getApp() | |||
| Page({ | |||
| /** | |||
| * 页面的初始数据 | |||
| */ | |||
| data: { | |||
| paramData:null, | |||
| isAdmin:null, | |||
| userData:null, | |||
| phoneIf:false, | |||
| businessId:'' | |||
| }, | |||
| /** | |||
| * 生命周期函数--监听页面加载 | |||
| */ | |||
| onLoad: function (options) { | |||
| console.log(options,88888888888888888) | |||
| let phoneIf = options.phone != 'undefined' ? true : false | |||
| options.phone = (options.phone != 'undefined' ? options.phone:'未绑定') | |||
| this.setData({ | |||
| paramData:options, | |||
| phoneIf | |||
| }); | |||
| this.getUserInfo() | |||
| }, | |||
| getUserInfo(){ | |||
| let _this=this; | |||
| app.globalData.userInfo().then(res => { | |||
| console.log(res) | |||
| if (res.businessId == 3){ | |||
| _this.setData({ | |||
| businessId:3 | |||
| }) | |||
| } | |||
| _this.setData({ | |||
| userData:res | |||
| }) | |||
| }).catch(err=>{ | |||
| wx.showToast({ | |||
| title: '商户信息获取出错', | |||
| icon: 'none', | |||
| duration: 2000, | |||
| mask: false | |||
| }); | |||
| }) | |||
| }, | |||
| gotoScore(e){ | |||
| // console.log(e.currentTarget.id,6666666666) | |||
| if (e.currentTarget.id == '1') { | |||
| wx.navigateTo({ | |||
| url: `/pages/operation/index?address=${this.data.paramData.address}&avatarUrl=${this.data.paramData.avatarUrl}&id=${this.data.paramData.id}&levelName=${this.data.paramData.levelName}&name=${this.data.paramData.name}&nickName=${this.data.paramData.nickName}&phone=${this.data.paramData.phone}&score=${this.data.paramData.score}&credit=${this.data.paramData.credit}&type=${e.currentTarget.id}&isAdmin=${this.data.userData.is_admin}&merchant_id=${this.data.userData.merchant_id}&businessId=${this.data.businessId}` | |||
| }) | |||
| } else { | |||
| wx.navigateTo({ | |||
| url: `/pages/exchange/index?address=${this.data.paramData.address}&avatarUrl=${this.data.paramData.avatarUrl}&id=${this.data.paramData.id}&levelName=${this.data.paramData.levelName}&name=${this.data.paramData.name}&nickName=${this.data.paramData.nickName}&phone=${this.data.paramData.phone}&score=${this.data.paramData.score}&credit=${this.data.paramData.credit}&type=${e.currentTarget.id}&merchant_id=${this.data.userData.merchant_id}` | |||
| }) | |||
| } | |||
| }, | |||
| /** | |||
| * 生命周期函数--监听页面初次渲染完成 | |||
| */ | |||
| onReady: function () { | |||
| }, | |||
| /** | |||
| * 生命周期函数--监听页面显示 | |||
| */ | |||
| onShow: function () { | |||
| }, | |||
| /** | |||
| * 生命周期函数--监听页面隐藏 | |||
| */ | |||
| onHide: function () { | |||
| }, | |||
| /** | |||
| * 生命周期函数--监听页面卸载 | |||
| */ | |||
| onUnload: function () { | |||
| }, | |||
| /** | |||
| * 页面相关事件处理函数--监听用户下拉动作 | |||
| */ | |||
| onPullDownRefresh: function () { | |||
| }, | |||
| /** | |||
| * 页面上拉触底事件的处理函数 | |||
| */ | |||
| onReachBottom: function () { | |||
| }, | |||
| /** | |||
| * 用户点击右上角分享 | |||
| */ | |||
| onShareAppMessage: function () { | |||
| } | |||
| }) | |||
| @@ -0,0 +1,3 @@ | |||
| { | |||
| "navigationBarTitleText": "会员积分" | |||
| } | |||
| @@ -0,0 +1,27 @@ | |||
| <!--pages/Add/index.wxml--> | |||
| <view> | |||
| <view class='exchange'> | |||
| <image class='img' src='./../../static/images/bannerbg.png' mode="widthFix"></image> | |||
| <view class='exchangeBox'> | |||
| <view class='section'> | |||
| <view> | |||
| <text>会员姓名(昵称):</text> | |||
| <text>{{paramData.name!='undefined'?paramData.name:paramData.nickName!='undefined'?paramData.nickName:''}}</text> | |||
| </view> | |||
| <view> | |||
| <text>会员等级:</text> | |||
| <text>{{paramData.levelName!='undefined'?paramData.levelName:''}}</text> | |||
| </view> | |||
| <view> | |||
| <text>手机号码:</text> | |||
| <text>{{paramData.phone}}</text> | |||
| </view> | |||
| </view> | |||
| <view class='phoneDes' wx:if="{{!phoneIf}}">会员未授权手机号,请用户先去授权手机号!</view> | |||
| <view class='butBox'> | |||
| <button id='1' bindtap='gotoScore' wx:if="{{phoneIf}}" style='{{"width:"+(userData.is_admin==1?"":"690rpx")}}'>新增积分</button> | |||
| <button id='2' bindtap='gotoScore' wx:if="{{phoneIf&&userData.is_admin=='1'}}">消费积分</button> | |||
| </view> | |||
| </view> | |||
| </view> | |||
| </view> | |||
| @@ -0,0 +1,92 @@ | |||
| /* pages/Add/index.wxss */ | |||
| page{ | |||
| background: #f8f8fa; | |||
| } | |||
| .exchange { | |||
| width: 100%; | |||
| height: 100%; | |||
| background: #f8f8fa; | |||
| } | |||
| .exchangeBox{ | |||
| margin-top: -45rpx; | |||
| } | |||
| .radian{ | |||
| width: 100%; | |||
| height: 100rpx; | |||
| border-radius: 0 0 100rpx 100rpx; | |||
| background-color: #52A0FD; | |||
| } | |||
| .section { | |||
| width: 710rpx; | |||
| /* height: 176rpx; */ | |||
| margin-top: 8%; | |||
| background: #fff; | |||
| display: flex; | |||
| flex-direction: column; | |||
| border: 1px solid #eaeaea; | |||
| border-radius: 18rpx; | |||
| margin: auto; | |||
| } | |||
| .section view { | |||
| position: relative; | |||
| width: 92%; | |||
| height: 88rpx; | |||
| line-height: 88rpx; | |||
| display: flex; | |||
| justify-content: space-between; | |||
| padding: 0 4%; | |||
| /* border-bottom: 1px solid #f5f5f5; */ | |||
| } | |||
| .section view text { | |||
| font-size: 30rpx; | |||
| color: #999999; | |||
| letter-spacing: 1.16rpx; | |||
| } | |||
| .section view text:nth-child(2) { | |||
| font-size: 28rpx; | |||
| color: #000; | |||
| letter-spacing: 1.16rpx; | |||
| text-align: right; | |||
| } | |||
| button{ | |||
| width: 710rpx; | |||
| height: 94rpx; | |||
| margin-top: 88rpx; | |||
| color: #FFF; | |||
| font-size: 36rpx; | |||
| background-color: #52A0FD; | |||
| box-shadow:0px 10px 22px 2px rgba(82,160,253,0.51); | |||
| } | |||
| .img { | |||
| margin-top: -60rpx; | |||
| display: block; | |||
| width: 100%; | |||
| } | |||
| .butBox{ | |||
| display: flex; | |||
| } | |||
| .butBox button{ | |||
| width: 344rpx; | |||
| height: 130rpx; | |||
| line-height: 130rpx; | |||
| border-radius: 30rpx; | |||
| } | |||
| .butBox :nth-child(1){ | |||
| background-color: #52A0FD; | |||
| box-shadow:0px 10px 22px 2px rgba(82,160,253,0.51); | |||
| } | |||
| .butBox :nth-child(2){ | |||
| background-color: #FF6A6B; | |||
| box-shadow:0px 10px 22px 2px rgba(255,106,107,0.51); | |||
| } | |||
| .phoneDes{ | |||
| font-size: 26rpx; | |||
| color: rgb(175, 168, 168); | |||
| text-align: center; | |||
| margin-top: 30rpx; | |||
| } | |||
| @@ -0,0 +1,75 @@ | |||
| const config = require('../../config/config.js') | |||
| Page({ | |||
| /** | |||
| * 页面的初始数据 | |||
| */ | |||
| data: { | |||
| src: config.weapp.dataTowerUrl +'/#/Keliu' | |||
| }, | |||
| /** | |||
| * 生命周期函数--监听页面加载 | |||
| */ | |||
| onLoad: function (options) { | |||
| }, | |||
| /** | |||
| * 生命周期函数--监听页面初次渲染完成 | |||
| */ | |||
| onReady: function () { | |||
| }, | |||
| /** | |||
| * 生命周期函数--监听页面显示 | |||
| */ | |||
| onShow: function () { | |||
| }, | |||
| /** | |||
| * 生命周期函数--监听页面隐藏 | |||
| */ | |||
| onHide: function () { | |||
| }, | |||
| /** | |||
| * 生命周期函数--监听页面卸载 | |||
| */ | |||
| onUnload: function () { | |||
| }, | |||
| /** | |||
| * 页面相关事件处理函数--监听用户下拉动作 | |||
| */ | |||
| onPullDownRefresh: function () { | |||
| }, | |||
| /** | |||
| * 页面上拉触底事件的处理函数 | |||
| */ | |||
| onReachBottom: function () { | |||
| }, | |||
| /** | |||
| * 用户点击右上角分享 | |||
| */ | |||
| onShareAppMessage: function (res) { | |||
| let _this = this; | |||
| return { | |||
| title: '商管操作台', | |||
| path: 'pages/index/index', | |||
| success: function (res) { | |||
| // 转发成功 | |||
| }, | |||
| fail: function (res) { | |||
| // 转发失败 | |||
| } | |||
| } | |||
| }, | |||
| }) | |||
| @@ -0,0 +1 @@ | |||
| {} | |||
| @@ -0,0 +1 @@ | |||
| <web-view src="{{src}}"></web-view> | |||
| @@ -0,0 +1 @@ | |||
| /* pages/Keliu/Keliu.wxss */ | |||
| @@ -0,0 +1,66 @@ | |||
| // pages/Submission/index.js | |||
| Page({ | |||
| /** | |||
| * 页面的初始数据 | |||
| */ | |||
| data: { | |||
| }, | |||
| /** | |||
| * 生命周期函数--监听页面加载 | |||
| */ | |||
| onLoad: function (options) { | |||
| }, | |||
| /** | |||
| * 生命周期函数--监听页面初次渲染完成 | |||
| */ | |||
| onReady: function () { | |||
| }, | |||
| /** | |||
| * 生命周期函数--监听页面显示 | |||
| */ | |||
| onShow: function () { | |||
| }, | |||
| /** | |||
| * 生命周期函数--监听页面隐藏 | |||
| */ | |||
| onHide: function () { | |||
| }, | |||
| /** | |||
| * 生命周期函数--监听页面卸载 | |||
| */ | |||
| onUnload: function () { | |||
| }, | |||
| /** | |||
| * 页面相关事件处理函数--监听用户下拉动作 | |||
| */ | |||
| onPullDownRefresh: function () { | |||
| }, | |||
| /** | |||
| * 页面上拉触底事件的处理函数 | |||
| */ | |||
| onReachBottom: function () { | |||
| }, | |||
| /** | |||
| * 用户点击右上角分享 | |||
| */ | |||
| onShareAppMessage: function () { | |||
| } | |||
| }) | |||
| @@ -0,0 +1,3 @@ | |||
| { | |||
| "usingComponents": {} | |||
| } | |||
| @@ -0,0 +1,2 @@ | |||
| <!--pages/Submission/index.wxml--> | |||
| <text>pages/Submission/index.wxml</text> | |||
| @@ -0,0 +1 @@ | |||
| /* pages/Submission/index.wxss */ | |||
| @@ -0,0 +1,76 @@ | |||
| const config = require('../../config/config.js') | |||
| Page({ | |||
| /** | |||
| * 页面的初始数据 | |||
| */ | |||
| data: { | |||
| src: config.weapp.dataTowerUrl + '/#/Yunying' | |||
| }, | |||
| /** | |||
| * 生命周期函数--监听页面加载 | |||
| */ | |||
| onLoad: function (options) { | |||
| }, | |||
| /** | |||
| * 生命周期函数--监听页面初次渲染完成 | |||
| */ | |||
| onReady: function () { | |||
| }, | |||
| /** | |||
| * 生命周期函数--监听页面显示 | |||
| */ | |||
| onShow: function () { | |||
| }, | |||
| /** | |||
| * 生命周期函数--监听页面隐藏 | |||
| */ | |||
| onHide: function () { | |||
| }, | |||
| /** | |||
| * 生命周期函数--监听页面卸载 | |||
| */ | |||
| onUnload: function () { | |||
| }, | |||
| /** | |||
| * 页面相关事件处理函数--监听用户下拉动作 | |||
| */ | |||
| onPullDownRefresh: function () { | |||
| }, | |||
| /** | |||
| * 页面上拉触底事件的处理函数 | |||
| */ | |||
| onReachBottom: function () { | |||
| }, | |||
| /** | |||
| * 用户点击右上角分享 | |||
| */ | |||
| onShareAppMessage: function (res) { | |||
| let _this = this; | |||
| return { | |||
| title: '商管操作台', | |||
| path: 'pages/index/index', | |||
| success: function (res) { | |||
| // 转发成功 | |||
| }, | |||
| fail: function (res) { | |||
| // 转发失败 | |||
| } | |||
| } | |||
| }, | |||
| }) | |||
| @@ -0,0 +1 @@ | |||
| {} | |||
| @@ -0,0 +1 @@ | |||
| <web-view src="{{src}}"></web-view> | |||
| @@ -0,0 +1 @@ | |||
| /* pages/Yunying/Yunying.wxss */ | |||
| @@ -0,0 +1,66 @@ | |||
| // pages/accountManagement/detail.js | |||
| Page({ | |||
| /** | |||
| * 页面的初始数据 | |||
| */ | |||
| data: { | |||
| }, | |||
| /** | |||
| * 生命周期函数--监听页面加载 | |||
| */ | |||
| onLoad: function (options) { | |||
| }, | |||
| /** | |||
| * 生命周期函数--监听页面初次渲染完成 | |||
| */ | |||
| onReady: function () { | |||
| }, | |||
| /** | |||
| * 生命周期函数--监听页面显示 | |||
| */ | |||
| onShow: function () { | |||
| }, | |||
| /** | |||
| * 生命周期函数--监听页面隐藏 | |||
| */ | |||
| onHide: function () { | |||
| }, | |||
| /** | |||
| * 生命周期函数--监听页面卸载 | |||
| */ | |||
| onUnload: function () { | |||
| }, | |||
| /** | |||
| * 页面相关事件处理函数--监听用户下拉动作 | |||
| */ | |||
| onPullDownRefresh: function () { | |||
| }, | |||
| /** | |||
| * 页面上拉触底事件的处理函数 | |||
| */ | |||
| onReachBottom: function () { | |||
| }, | |||
| /** | |||
| * 用户点击右上角分享 | |||
| */ | |||
| onShareAppMessage: function () { | |||
| } | |||
| }) | |||
| @@ -0,0 +1,3 @@ | |||
| { | |||
| "usingComponents": {} | |||
| } | |||
| @@ -0,0 +1 @@ | |||
| /* pages/accountManagement/detail.wxss */ | |||
| @@ -0,0 +1,224 @@ | |||
| const Http = require('../../utils/HttpBasics.js') | |||
| const config = require('../../config/config.js') | |||
| Page({ | |||
| /** | |||
| * 页面的初始数据 | |||
| */ | |||
| data: { | |||
| tihuoWay: '微信商户号', | |||
| accountData: "", | |||
| accountTypeValue: 0, | |||
| isFlag: false, | |||
| accountCode: false, | |||
| cOpendId: '' | |||
| }, | |||
| /** | |||
| * 查询收款账户状态 | |||
| */ | |||
| findAccountById(merchant_id) { | |||
| Http.get({ | |||
| url: config.api.findAccountById, | |||
| data: { | |||
| id: merchant_id | |||
| } | |||
| }).then(res => { | |||
| /** | |||
| * receiverAccount | |||
| * 如有:已设置收款账户 | |||
| * 没有;未设置收款账户 | |||
| */ | |||
| if (res && res.data && res.data.receiver) { | |||
| this.setData({ | |||
| isSet: true, | |||
| receiverAccount: res.data.receiver.receiverAccount, | |||
| accountData: res.data.receiver | |||
| }) | |||
| } else { | |||
| this.setData({ | |||
| isSet: false | |||
| }) | |||
| } | |||
| }).catch(error => { | |||
| wx.showToast({ | |||
| title: error.message, | |||
| icon: "none" | |||
| }) | |||
| }) | |||
| }, | |||
| /** | |||
| * 生命周期函数--监听页面加载 | |||
| */ | |||
| onLoad: function (options) { | |||
| let that = this; | |||
| if (options && options.merchant_id) { | |||
| that.findAccountById(options.merchant_id) | |||
| that.setData({ | |||
| merchant_id: options.merchant_id, | |||
| phone: options.phone | |||
| }) | |||
| } | |||
| if (options && options.merchant_name) { | |||
| that.setData({ | |||
| merchant_name: options.merchant_name, | |||
| phone: options.phone | |||
| }) | |||
| } | |||
| this.getAccount(options.phone); | |||
| }, | |||
| //查询商户C端授权状态 | |||
| getAccount(phone) { | |||
| let that = this; | |||
| Http.get({ | |||
| url: `${config.api.getOpenIdByPhone}?phone=${phone}`, | |||
| data: { | |||
| phone | |||
| } | |||
| }).then(res => { | |||
| console.log(res, 111)// | |||
| this.setData({ | |||
| haveAccount: res.message, | |||
| cOpendId: res.data | |||
| }) | |||
| }).catch(error => { | |||
| console.log(error, 222) | |||
| this.setData({ | |||
| haveAccount: error.message | |||
| }) | |||
| }) | |||
| }, | |||
| // 提交 | |||
| formSubmit: function (e) { | |||
| let that = this; | |||
| let accountTypeValue = that.data.accountTypeValue; | |||
| let accountId = e.detail.value.id; | |||
| let accountName = e.detail.value.name; | |||
| let id = that.data.merchant_id; | |||
| let name = that.data.merchant_name; | |||
| that.setData({ | |||
| select: false | |||
| }) | |||
| if (!accountId) { | |||
| if (accountTypeValue == 0) { | |||
| wx.showToast({ | |||
| title: '商户号不能为空', | |||
| icon: "none" | |||
| }) | |||
| } | |||
| if (accountTypeValue == 1) { | |||
| wx.showToast({ | |||
| title: '微信号不能为空', | |||
| icon: "none" | |||
| }) | |||
| } | |||
| } | |||
| if (!accountName) { | |||
| if (accountTypeValue == 0) { | |||
| wx.showToast({ | |||
| title: '商户名不能为空', | |||
| icon: "none" | |||
| }) | |||
| } | |||
| if (accountTypeValue == 1) { | |||
| wx.showToast({ | |||
| title: '姓名不能为空', | |||
| icon: "none" | |||
| }) | |||
| } | |||
| } | |||
| let data = { | |||
| accountTypeValue: that.data.accountTypeValue == 1 ? 3 : that.data.accountTypeValue, | |||
| accountId: (that.data.accountTypeValue == 0 ? e.detail.value.id : this.data.cOpendId).replace(/\s+/g, ""), | |||
| accountName: (e.detail.value.name).replace(/\s+/g, ""), | |||
| id: that.data.merchant_id, | |||
| name: that.data.merchant_name | |||
| } | |||
| console.log(data) | |||
| if (!data.accountId) { | |||
| wx.showToast({ | |||
| title: '当前状态不能提交', | |||
| icon: "none" | |||
| }) | |||
| return; | |||
| } | |||
| if (accountId && accountName && id && name) { | |||
| Http.post({ | |||
| url: config.api.updateAccount, | |||
| data: data | |||
| }).then(res => { | |||
| wx.navigateTo({ | |||
| url: '/pages/accountManagement/result/success', | |||
| }) | |||
| }).catch(error => { | |||
| wx.showToast({ | |||
| title: error.message, | |||
| icon: "none" | |||
| }) | |||
| }) | |||
| } | |||
| }, | |||
| submitAccount() { | |||
| let that = this; | |||
| let data = { | |||
| accountTypeValue: 3, | |||
| accountId: (this.data.cOpendId).replace(/\s+/g, ""), | |||
| accountName: (this.data.accountData.trueName).replace(/\s+/g, ""), | |||
| id: this.data.accountData.merchantId, | |||
| name: that.data.merchant_name | |||
| } | |||
| console.log(data) | |||
| if (data.accountId && data.accountName && data.id && data.name) { | |||
| Http.post({ | |||
| url: config.api.updateAccount, | |||
| data: data | |||
| }).then(res => { | |||
| wx.navigateTo({ | |||
| url: '/pages/accountManagement/result/success', | |||
| }) | |||
| }).catch(error => { | |||
| wx.showToast({ | |||
| title: error.message, | |||
| icon: "none" | |||
| }) | |||
| }) | |||
| } | |||
| }, | |||
| bindShowMsg(e) { | |||
| this.setData({ | |||
| select: !this.data.select | |||
| }) | |||
| }, | |||
| mySelect(e) { | |||
| var name = e.currentTarget.dataset.name | |||
| this.setData({ | |||
| tihuoWay: name, | |||
| accountTypeValue: e.currentTarget.dataset.accounttypevalue, | |||
| select: false | |||
| }) | |||
| }, | |||
| //申请变更 | |||
| reset() { | |||
| let that = this; | |||
| that.setData({ | |||
| isFlag: true | |||
| }) | |||
| }, | |||
| //删除账号得信息 | |||
| deleteByReceiverId(e) { | |||
| Http.get({ | |||
| url: config.api.deleteByReceiverId, | |||
| data: { | |||
| id: e.currentTarget.dataset.id | |||
| } | |||
| }).then(res => { | |||
| wx.navigateTo({ | |||
| url: '/pages/accountManagement/result/success?type=delete', | |||
| }) | |||
| }).catch(error => { | |||
| wx.showToast({ | |||
| title: `${error.message}`, | |||
| icon: "none" | |||
| }) | |||
| }) | |||
| } | |||
| }) | |||
| @@ -0,0 +1,3 @@ | |||
| { | |||
| "navigationBarTitleText": "收款账户管理" | |||
| } | |||
| @@ -0,0 +1,71 @@ | |||
| <view class='accountManagement'> | |||
| <view class='title' wx:if="{{!receiverAccount&&!isFlag||!isSet}}">添加收款账户</view> | |||
| <view class='title' wx:if="{{isFlag}}">变更收款账户</view> | |||
| <view class='title' wx:if="{{receiverAccount}}">商家收款账户</view> | |||
| <!-- 没有添加收款账户 --> | |||
| <form bindsubmit="formSubmit" bindreset="formReset" wx:if="{{(!receiverAccount&&!isFlag)||isFlag||!isSet}}"> | |||
| <view class="section"> | |||
| <view class="section__title">账号类型</view> | |||
| <view class='list-msg2' bindtap='bindShowMsg'> | |||
| <view>{{tihuoWay}}</view> | |||
| <image style='height:20rpx;width:20rpx;' src='https://formall.oss-accelerate.aliyuncs.com/cimg/belowan.png'></image> | |||
| </view> | |||
| <view class="select_box" wx:if="{{select}}"> | |||
| <view class="select_one" bindtap="mySelect" data-name="微信商户号" data-accountTypeValue='0'>微信商户号</view> | |||
| <view class="select_one" bindtap="mySelect" data-name="个人微信号" data-accountTypeValue='1'>个人微信号</view> | |||
| </view> | |||
| </view> | |||
| <view class="section"> | |||
| <view class="section__title" wx:if="{{tihuoWay=='微信商户号'}}">商户号</view> | |||
| <view class="section__title" wx:if="{{tihuoWay=='个人微信号'}}">微信号</view> | |||
| <input name="id" placeholder="请输入{{tihuoWay}}" placeholder-style='color:#eee;' /> | |||
| </view> | |||
| <view class="section"> | |||
| <view class="section__title" wx:if="{{tihuoWay=='微信商户号'}}">商户名</view> | |||
| <view class="section__title" wx:if="{{tihuoWay=='个人微信号'}}">姓名</view> | |||
| <input name="name" placeholder="请输入{{tihuoWay=='个人微信号'?'个人微信名':'微信商户名'}}" placeholder-style='color:#eee;' /> | |||
| </view> | |||
| <view class="section" wx:if="{{tihuoWay=='个人微信号'}}"> | |||
| <view class="section__title">收款授权状态</view> | |||
| <!-- <view class='tihuoWay tihuoWay01' wx:if="{{haveAccount}}">已授权</view> | |||
| <view class='tihuoWay tihuoWay01' wx:if="{{!haveAccount}}">未授权(请打开本广场用户端小程序领取任意一张优惠券,然后刷新本页面点击保存完成授权)</view> --> | |||
| <view class='tihuoWay tihuoWay01' >{{haveAccount}}</view> | |||
| </view> | |||
| <view class="btn-area"> | |||
| <button formType="submit" hover-class='opacity'>提交</button> | |||
| </view> | |||
| </form> | |||
| <!-- 已经添加收款账户 --> | |||
| <view class='add' wx:if="{{receiverAccount&&!isFlag}}"> | |||
| <form> | |||
| <view class="section"> | |||
| <view class="section__title">账号类型</view> | |||
| <view class='tihuoWay' wx:if="{{accountData.receiverType == 0}}">微信商户号</view> | |||
| <view class='tihuoWay' wx:if="{{accountData.receiverType == 1 || accountData.receiverType == 3}}">个人微信号</view> | |||
| </view> | |||
| <view class="section"> | |||
| <view class="section__title" wx:if="{{accountData.receiverType == 0}}">商户号</view> | |||
| <view class="section__title" wx:if="{{accountData.receiverType == 1}}">微信号</view> | |||
| <view class="section__title" wx:if="{{accountData.receiverType == 3}}">openId</view> | |||
| <view class='tihuoWay' style="overflow:hidden;text-overflow:ellipsis;white-space:nowrap;">{{accountData.receiverAccount}}</view> | |||
| </view> | |||
| <view class="section"> | |||
| <view class="section__title" wx:if="{{accountData.receiverType == 0}}">商户名</view> | |||
| <view class="section__title" wx:if="{{accountData.receiverType == 1||accountData.receiverType == 3}}">姓名</view> | |||
| <!-- <view class='tihuoWay' wx:if="{{accountData.receiverType == 0}}">{{accountData.receiverComments}}</view> --> | |||
| <view class='tihuoWay'>{{accountData.trueName}}</view> | |||
| </view> | |||
| <view class="section" wx:if="{{accountData.receiverType == 1||accountData.receiverType == 3}}"> | |||
| <view class="section__title">收款授权状态</view> | |||
| <!-- <view class='tihuoWay tihuoWay01' wx:if="{{haveAccount}}">已授权</view> | |||
| <view class='tihuoWay tihuoWay01' wx:if="{{!haveAccount}}">未授权(请打开本广场用户端小程序领取任意一张优惠券,然后刷新本页面点击保存完成授权)</view> --> | |||
| <view class='tihuoWay tihuoWay01' >{{haveAccount}}</view> | |||
| </view> | |||
| <view class="btn-area"> | |||
| <button bindtap="deleteByReceiverId" hover-class='opacity' data-id='{{accountData.id}}'>删除账号</button> | |||
| <button bindtap="submitAccount" wx:if="{{accountData.receiverType == 1}}" hover-class='opacity'>提交</button> | |||
| </view> | |||
| </form> | |||
| </view> | |||
| </view> | |||
| @@ -0,0 +1,130 @@ | |||
| .accountManagement{ | |||
| padding: 0 30rpx; | |||
| } | |||
| .title{ | |||
| font-size: 38rpx; | |||
| font-weight: bold; | |||
| padding-top: 40rpx; | |||
| } | |||
| .subtitle{ | |||
| font-size: 32rpx; | |||
| margin-bottom: 80rpx; | |||
| } | |||
| .btn-area button{ | |||
| background: #52A0FD; | |||
| color: #fff; | |||
| width: 400rpx; | |||
| height: 90rpx; | |||
| margin-top: 60rpx; | |||
| font-size: 30rpx; | |||
| line-height: 90rpx; | |||
| } | |||
| .section{ | |||
| display: flex; | |||
| flex: 16; | |||
| /* height: 100rpx; */ | |||
| font-size: 32rpx; | |||
| position: relative; | |||
| } | |||
| .section__title{ | |||
| /* flex: 1; */ | |||
| display: flex; | |||
| width: 202rpx; | |||
| text-align: left; | |||
| height: 100rpx; | |||
| line-height: 100rpx; | |||
| } | |||
| .section input,.list-msg2{ | |||
| flex: 3; | |||
| margin-left: -20rpx; | |||
| border:1rpx solid #ccc; | |||
| padding-left: 10rpx; | |||
| height: 70rpx; | |||
| line-height: 70rpx; | |||
| margin-top: 10rpx; | |||
| border-radius: 6rpx; | |||
| } | |||
| .list-msg2 view{ | |||
| color: #999; | |||
| } | |||
| .list-msg2 image{ | |||
| position: absolute; | |||
| right: 22rpx; | |||
| top: 0; | |||
| bottom: 0; | |||
| margin: auto; | |||
| } | |||
| .list-msg { | |||
| padding: 0 20rpx; | |||
| background-color: #fff; | |||
| position: relative; | |||
| } | |||
| .list-msg1 { | |||
| height: 60rpx; | |||
| display: flex; | |||
| align-items: center; | |||
| justify-content: space-between; | |||
| } | |||
| .list-msg .list-msg2 { | |||
| height: 60rpx; | |||
| display: flex; | |||
| align-items: center; | |||
| justify-content: space-between; | |||
| border: 1px solid #ccc; | |||
| padding: 0 10rpx; | |||
| } | |||
| .select_box { | |||
| width:77%; | |||
| position:absolute; | |||
| top:83rpx; | |||
| z-index:100; | |||
| overflow:hidden; | |||
| animation:myfirst 0.5s; | |||
| left:154rpx; | |||
| border:1rpx solid #ccc; | |||
| background: #fff; | |||
| } | |||
| @keyframes myfirst { | |||
| from { | |||
| height: 0rpx; | |||
| } | |||
| to { | |||
| height: 210rpx; | |||
| } | |||
| } | |||
| .select_one { | |||
| text-indent: 1em; | |||
| height: 80rpx; | |||
| line-height: 80rpx; | |||
| } | |||
| .add input{ | |||
| border: none!important; | |||
| } | |||
| .tihuoWay{ | |||
| flex:3; | |||
| color: #999; | |||
| height:100rpx; | |||
| line-height:100rpx; | |||
| } | |||
| .add .btn-area text{ | |||
| color: green; | |||
| font-size: 32rpx; | |||
| display: block; | |||
| text-align: center; | |||
| margin-top:100rpx; | |||
| } | |||
| .opacity{ | |||
| opacity: .7; | |||
| } | |||
| .section .tihuoWay01{ | |||
| line-height: 43rpx; | |||
| margin-top: 33rpx; | |||
| color: red; | |||
| } | |||
| @@ -0,0 +1,69 @@ | |||
| // pages/accountManagement/result/success.js | |||
| Page({ | |||
| /** | |||
| * 页面的初始数据 | |||
| */ | |||
| data: { | |||
| type:null | |||
| }, | |||
| // 返回上一级页面 | |||
| goback(){ | |||
| wx.switchTab({ | |||
| url: '/pages/mine/mine', | |||
| }) | |||
| }, | |||
| /** | |||
| * 生命周期函数--监听页面加载 | |||
| */ | |||
| onLoad: function (options) { | |||
| if(options&&options.type=='delete'){ | |||
| this.setData({ | |||
| type:"delete", | |||
| message:"删除成功" | |||
| }) | |||
| } | |||
| }, | |||
| /** | |||
| * 生命周期函数--监听页面初次渲染完成 | |||
| */ | |||
| onReady: function () { | |||
| }, | |||
| /** | |||
| * 生命周期函数--监听页面显示 | |||
| */ | |||
| onShow: function () { | |||
| }, | |||
| /** | |||
| * 生命周期函数--监听页面隐藏 | |||
| */ | |||
| onHide: function () { | |||
| }, | |||
| /** | |||
| * 生命周期函数--监听页面卸载 | |||
| */ | |||
| onUnload: function () { | |||
| }, | |||
| /** | |||
| * 页面相关事件处理函数--监听用户下拉动作 | |||
| */ | |||
| onPullDownRefresh: function () { | |||
| }, | |||
| /** | |||
| * 页面上拉触底事件的处理函数 | |||
| */ | |||
| onReachBottom: function () { | |||
| } | |||
| }) | |||
| @@ -0,0 +1,3 @@ | |||
| { | |||
| "navigationBarTitleText": "收款账户管理" | |||
| } | |||
| @@ -0,0 +1,8 @@ | |||
| <view class='message'> | |||
| <image src='https://formall.oss-accelerate.aliyuncs.com/cimg/bsuccess.png' mode='widthFix'></image> | |||
| <view class='tip' wx:if="{{type!='delete'}}">账号提交成功!</view> | |||
| <view class='tip' wx:if="{{type=='delete'}}">账号删除成功!</view> | |||
| <view class="btn-area"> | |||
| <button bindtap='goback' hover-class='opacity'>返回</button> | |||
| </view> | |||
| </view> | |||
| @@ -0,0 +1,28 @@ | |||
| .message image{ | |||
| display: block; | |||
| width: 150rpx; | |||
| margin: 200rpx auto 0; | |||
| } | |||
| .tip{ | |||
| font-weight: bold; | |||
| font-size: 40rpx; | |||
| text-align: center; | |||
| margin-top: 40rpx; | |||
| } | |||
| .msg{ | |||
| font-size: 32rpx; | |||
| text-align: center; | |||
| margin-top: 10rpx; | |||
| } | |||
| .btn-area button{ | |||
| background: #52A0FD; | |||
| color: #fff; | |||
| width: 400rpx; | |||
| height: 90rpx; | |||
| margin-top: 60rpx; | |||
| font-size: 30rpx; | |||
| line-height: 90rpx; | |||
| } | |||
| .opacity{ | |||
| opacity: 0.7; | |||
| } | |||
| @@ -0,0 +1,334 @@ | |||
| var app = getApp(); | |||
| const config = require('../../config/config.js') | |||
| const util = require('../../utils/util.js') | |||
| const Http = require('../../utils/HttpBasics.js') | |||
| Page({ | |||
| data: { | |||
| data: { | |||
| list: [] | |||
| }, //数据 | |||
| crollTop: 0, | |||
| scrollHeight: 0, | |||
| house_type: 0, //户型 | |||
| house_style: 0, //风格 | |||
| house_area: 0, //面积 | |||
| flagdate: null, | |||
| list: [], | |||
| tabTxt: [{ | |||
| title: '全部', | |||
| idss: 0 | |||
| }, | |||
| { | |||
| title: '日期', | |||
| idss: 1 | |||
| }, | |||
| // { | |||
| // title: '类型', | |||
| // idss: 2 | |||
| // }, | |||
| { | |||
| title: '状态', | |||
| idss: 3 | |||
| }, | |||
| // { | |||
| // title: '来源', | |||
| // idss: 4 | |||
| // } | |||
| ], | |||
| showList: null, | |||
| loading: "", | |||
| tab: [true, true, true, true, true], | |||
| disabled: false, //加载更多按钮状态 | |||
| page: 1, //当前页码 | |||
| hasMore: false, //加载更多按钮 | |||
| moreTxt: '点击加载更多', | |||
| dataNull: true, | |||
| status: '', | |||
| type: '', | |||
| source: '', | |||
| date: "", | |||
| date2: "", | |||
| idss: 0, | |||
| subsidy: '', | |||
| pageNum: 1, //第几页 | |||
| height: null, | |||
| statustypes: [ | |||
| { | |||
| name: '进行中', | |||
| status: 1, | |||
| id: 1 | |||
| }, | |||
| { | |||
| name: '已过期', | |||
| status: 3, | |||
| id: 3 | |||
| }, | |||
| { | |||
| name: '未开始', | |||
| status: 4, | |||
| id: 4 | |||
| } | |||
| ], | |||
| starttime: null, | |||
| endtime: null, | |||
| billTypeValue: null | |||
| }, | |||
| // 选项卡 | |||
| filterTab: function (e) { | |||
| let that = this; | |||
| console.log(e); | |||
| that.setData({ | |||
| loading: "" | |||
| }) | |||
| that.setData({ | |||
| idss: e.target.dataset.idss || e.currentTarget.dataset.idss, | |||
| pageNum: 1 | |||
| }) | |||
| if (e.currentTarget.dataset.idss === 0) { | |||
| this.setData({ | |||
| source: '', | |||
| type: '', | |||
| status: '', | |||
| date: '', | |||
| date2: '' | |||
| }) | |||
| this.getList(1) | |||
| this.getTotleData() | |||
| } | |||
| var data = [true, true, true, true, true], | |||
| index = e.currentTarget.dataset.index; | |||
| data[index] = !that.data.tab[index]; | |||
| that.setData({ | |||
| tab: data | |||
| }) | |||
| }, | |||
| bindDateChange1: function (e) { | |||
| if (new Date(e.detail.value).getTime() > new Date(this.data.date2).getTime()) { | |||
| wx.showToast({ | |||
| title: '抱歉,开始日期不能大于结束日期', | |||
| icon: 'none', | |||
| duration: 2000, | |||
| mask: false | |||
| }); | |||
| return; | |||
| } | |||
| this.setData({ | |||
| date: e.detail.value, | |||
| }) | |||
| }, | |||
| bindDateChange2: function (e) { | |||
| if (new Date(e.detail.value).getTime() < new Date(this.data.date).getTime()) { | |||
| wx.showToast({ | |||
| title: '抱歉,结束日期不能小于开始日期', | |||
| icon: 'none', | |||
| duration: 2000, | |||
| mask: false | |||
| }); | |||
| return; | |||
| } | |||
| this.setData({ | |||
| date2: e.detail.value | |||
| }) | |||
| }, | |||
| search(e) { | |||
| console.log(e.currentTarget.dataset.ids) | |||
| let type = e.currentTarget.dataset.ids; | |||
| if (type == 0) { | |||
| this.setData({ | |||
| source: '', | |||
| type: '', | |||
| status: '', | |||
| date: '', | |||
| date2: '' | |||
| }) | |||
| } else if (type == 1) { | |||
| if (!this.data.date) { | |||
| wx.showToast({ | |||
| title: '抱歉请选择开始日期', | |||
| icon: 'none', | |||
| duration: 2000, | |||
| mask: false | |||
| }); | |||
| return; | |||
| } else if (!this.data.date2) { | |||
| wx.showToast({ | |||
| title: '抱歉请选择结束日期', | |||
| icon: 'none', | |||
| duration: 2000, | |||
| mask: false | |||
| }); | |||
| return; | |||
| } | |||
| } else if (type == 2) { | |||
| this.setData({ | |||
| type: e.currentTarget.dataset.id | |||
| }) | |||
| } else if (type == 3) { | |||
| console.log(e.currentTarget.dataset.id) | |||
| this.setData({ | |||
| status: e.currentTarget.dataset.id | |||
| }) | |||
| } else if (type == 4) { | |||
| this.setData({ | |||
| source: e.currentTarget.dataset.id | |||
| }) | |||
| } | |||
| var data = [true, true, true, true, true]; | |||
| this.setData({ | |||
| tab: data | |||
| }) | |||
| this.getList(1) | |||
| this.getTotleData() | |||
| }, | |||
| onShow() { | |||
| this.getList(1) | |||
| this.getTotleData() | |||
| }, | |||
| formatData(data) { | |||
| let arr = []; | |||
| data.map((item, index) => { | |||
| let a = {}; | |||
| a.value = [item]; | |||
| a.dateR = item.createDate01; | |||
| let indexSt = 0; | |||
| let haveIf = false; | |||
| console.log(item, this.data.auditWayOptions, 1111) | |||
| console.log(item.sourceStr, item.typeStr, item.statusStr, 222) | |||
| arr.map((item01, index01) => { | |||
| if (item.id == item01.id) { | |||
| indexSt = index01; | |||
| haveIf = true; | |||
| } | |||
| }) | |||
| if (haveIf && (new Date(item.createDate)).valueOf() >= (new Date(this.data.date + ' 00:00:00')).valueOf() && (new Date(item.createDate)).valueOf() <= (new Date(this.data.date2 + ' 23:59:59')).valueOf()) { | |||
| arr[indexSt].value.push(item) | |||
| } else if ((new Date(item.createDate)).valueOf() >= (new Date(this.data.date + ' 00:00:00')).valueOf() && (new Date(item.createDate)).valueOf() <= (new Date(this.data.date2 + ' 23:59:59')).valueOf()) { | |||
| arr.push(a) | |||
| } | |||
| }) | |||
| this.setData({ | |||
| allBillList: arr | |||
| }) | |||
| console.log(arr, 888888888888) | |||
| }, | |||
| getTotleData() { | |||
| let _this = this; | |||
| Http.get({ | |||
| url: config.api.getSubsidySummary, | |||
| data: { | |||
| startdate: this.data.date ? this.data.date + " 00:00:00" : '', | |||
| enddate: this.data.date2 ? this.data.date2 + " 23:59:59" : '', | |||
| source: this.data.source, | |||
| type: this.data.type, | |||
| status: this.data.status | |||
| } | |||
| }) | |||
| .then(res => { | |||
| _this.setData({ | |||
| subsidy: Number(Number(res.data.subsidy) / 100).toFixed(2) | |||
| }) | |||
| wx.stopPullDownRefresh(); | |||
| }) | |||
| .catch(err => { | |||
| wx.stopPullDownRefresh(); | |||
| wx.showToast({ | |||
| title: err.message, | |||
| icon: 'none', | |||
| duration: 2000, | |||
| mask: false | |||
| }); | |||
| }); | |||
| }, | |||
| getList: function (page) { | |||
| let _this = this; | |||
| Http.get({ | |||
| url: config.api.cashbackList, | |||
| data: { | |||
| pageNum: page, | |||
| pageSize: 10, | |||
| begin: this.data.date ? this.data.date + " 00:00:00" : '', | |||
| enddate: this.data.date2 ? this.data.date2 + " 23:59:59" : '', | |||
| status: this.data.status | |||
| } | |||
| }) | |||
| .then(res => { | |||
| wx.stopPullDownRefresh(); | |||
| let data = res.data.list; | |||
| let allBillList = []; | |||
| if (page == 1) { | |||
| allBillList = res.data.list; | |||
| } else { | |||
| allBillList = _this.data.allBillList; | |||
| } | |||
| allBillList.map((item, index) => { | |||
| let haveIf = false; | |||
| item.startDate = util.formatTime(item.startTime, 'yyyy-MM-dddd') | |||
| item.endDate = util.formatTime(item.endTime, 'yyyy-MM-dddd') // hh:mm:ss | |||
| item.statusStr = this.data.statustypes.find(e => e.status === item.status)?.name | |||
| item.isStart = item.startTime > new Date().getTime() | |||
| if (item.startTime > new Date().getTime()) { | |||
| item.startBtn = '活动未开始' | |||
| item.startFlag = 0 | |||
| } else if (item.endTime < new Date().getTime()) { | |||
| // item.startBtn = '活动已结束' | |||
| // item.startFlag = 1 | |||
| item.startBtn = '参加活动' | |||
| item.startFlag = 2 | |||
| } else { | |||
| item.startBtn = '参加活动' | |||
| item.startFlag = 2 | |||
| } | |||
| }) | |||
| if (res.data.pages <= page) { | |||
| _this.setData({ | |||
| allBillList, | |||
| pageNum: res.data.pages - 1, | |||
| content: '已经加载全部数据!' | |||
| }) | |||
| } else { | |||
| _this.setData({ | |||
| allBillList, | |||
| loading: false, | |||
| content: '小主,我在玩命加载中...' | |||
| }) | |||
| } | |||
| }) | |||
| .catch(err => { | |||
| wx.stopPullDownRefresh(); | |||
| wx.showToast({ | |||
| title: err.message, | |||
| icon: 'none', | |||
| duration: 2000, | |||
| mask: false | |||
| }); | |||
| }); | |||
| }, | |||
| onPullDownRefresh: function (e) { | |||
| let that = this; | |||
| that.setData({ | |||
| pageNum: 1, | |||
| list: [] | |||
| }); | |||
| that.getList(1); | |||
| this.getTotleData() | |||
| }, | |||
| onReachBottom() { | |||
| var that = this; | |||
| that.data.pageNum++; | |||
| that.setData({ | |||
| pageNum: that.data.pageNum, | |||
| loading: true | |||
| }); | |||
| that.getList(that.data.pageNum); | |||
| this.getTotleData() | |||
| }, | |||
| viewDetail(e) { | |||
| let id = e.currentTarget.dataset.id | |||
| let flag = e.currentTarget.dataset.flag | |||
| if (flag === 2) { | |||
| wx.navigateTo({ | |||
| url: `/pages/cashContent/cashContent?id=${id}`, | |||
| }) | |||
| } | |||
| } | |||
| }); | |||
| @@ -0,0 +1,5 @@ | |||
| { | |||
| "navigationBarTitleText": "活动返现", | |||
| "enablePullDownRefresh": true, | |||
| "backgroundTextStyle": "dark" | |||
| } | |||
| @@ -0,0 +1,45 @@ | |||
| <!-- 查询列表 有结果 --> | |||
| <view class="tabTit box tc bg_f clearfix"> | |||
| <view class="flex1{{!tab[index]?' active':''}} fl" wx:for="{{tabTxt}}" wx:key="index" data-index="{{index}}" data-idss="{{item.idss}}" bindtap="filterTab"> | |||
| <text wx:if="{{index==0}}" class="{{index==idss?'active3':''}}">{{tabTxt[0].title}}</text> | |||
| <text wx:if="{{index!=0}}" class="{{index==idss?'active3':''}}">{{item.title}}</text> | |||
| <image src="../../static/images/arrow.png"></image> | |||
| </view> | |||
| </view> | |||
| <!-- 日期 --> | |||
| <view class="tabLayer tc" hidden="{{tab[1]}}"> | |||
| <view class="picker_group"> | |||
| <picker mode="date" value="{{date}}" end="{{date2}}" fields="day" bindchange="bindDateChange1"> | |||
| <view wx:if="{{!date}}" class="picker">开始日期</view> | |||
| <view wx:if="{{date}}" class="picker">{{date}}</view> | |||
| </picker> | |||
| 至 | |||
| <picker mode="date" value="{{date2}}" start="{{date}}" fields="day" bindchange="bindDateChange2"> | |||
| <view wx:if="{{!date2}}" class="picker">结束日期</view> | |||
| <view wx:if="{{date2}}" class="picker">{{date2}}</view> | |||
| </picker> | |||
| <button class='btns' data-ids="1" hover-class='active1' bindtap='search' data-index='dateindex1'>查询</button> | |||
| </view> | |||
| </view> | |||
| <!-- 状态 --> | |||
| <view class="tabLayer tc clearfix" hidden="{{tab[2]}}"> | |||
| <a class='{{status===item.id?"active2":""}}' data-ids="3" wx:for="{{statustypes}}" wx:key="index" wx:if="index" data-id="{{item.id}}" bindtap='search' data-status='{{item.status}}'> | |||
| {{item.name}} | |||
| </a> | |||
| </view> | |||
| <view class='lists'> | |||
| <view wx:for="{{allBillList}}" wx:key="index"> | |||
| <view class="{{item.startFlag === 0 ? 'list noList' : item.startFlag === 1 ? 'list list1' : 'list'}}"> | |||
| <view class='title'>{{item.name}} </view> | |||
| <view class='txt'>活动时间:{{item.startDate}} - {{item.endDate}}</view> | |||
| <view class='txt'>参与条件:订单满 {{item.limitMoney}} 元</view> | |||
| <view class='txt'>活动状态:{{item.statusStr}}</view> | |||
| <view class="button" data-id="{{item.id}}" data-flag="{{item.startFlag}}" bindtap="viewDetail">{{item.startBtn}}</view> | |||
| </view> | |||
| </view> | |||
| </view> | |||
| <!-- </scroll-view> --> | |||
| <view wx:if="{{allBillList.length!==0}}" class="loading {{allBillList.length==0?'mr':''}}">{{content}}</view> | |||
| <!-- 查询列表 无结果 --> | |||
| <view class='recond' wx:if="{{allBillList.length==0}}">暂无数据!</view> | |||
| @@ -0,0 +1,304 @@ | |||
| page { | |||
| padding: 90rpx 0 30rpx; | |||
| } | |||
| .tabTit { | |||
| height: 90rpx; | |||
| line-height: 82rpx; | |||
| position: fixed; | |||
| top: 0; | |||
| width: 750rpx; | |||
| z-index: 1; | |||
| } | |||
| .tabTit > view:nth-of-type(1) { | |||
| border-left: 0; | |||
| } | |||
| .tabTit > view:nth-of-type(4) { | |||
| border-right: 0; | |||
| } | |||
| .tabTit .active image { | |||
| transform: rotate(180deg); | |||
| background: none; | |||
| } | |||
| .tabTit image { | |||
| width: 18rpx; | |||
| height: 9rpx; | |||
| vertical-align: middle; | |||
| margin-left: 5px; | |||
| } | |||
| .tabLayer { | |||
| width: 750rpx; | |||
| overflow: hidden; | |||
| position: fixed; | |||
| top: 90rpx; | |||
| z-index: 1; | |||
| background: #fff; | |||
| padding-bottom: 26rpx; | |||
| box-shadow:2px 9px 10px rgba(0, 0, 0, 0.05); | |||
| bottom: 0; | |||
| border-top:1px solid #eee; | |||
| } | |||
| .tabLayer a { | |||
| float: left; | |||
| width: 210rpx; | |||
| height: 80rpx; | |||
| line-height: 80rpx; | |||
| margin: 30rpx 0 0 26rpx; | |||
| text-align: center; | |||
| color: #888; | |||
| font-size: 30rpx; | |||
| background: rgba(255, 255, 255, 1); | |||
| border: 1px solid rgba(234, 234, 234, 1); | |||
| border-radius: 10rpx; | |||
| } | |||
| .tabLayer .active { | |||
| text-align: center; | |||
| height: 80rpx; | |||
| background: rgba(255, 255, 255, 1); | |||
| border: 1px solid rgba(101, 158, 246, 1); | |||
| border-radius: 10rpx; | |||
| color: #659ef6; | |||
| } | |||
| .tabTit .active { | |||
| background: #fff; | |||
| font-size: 32prx; | |||
| font-weight: 500; | |||
| color: rgba(101, 158, 246, 1); | |||
| } | |||
| /*弹性盒模型*/ | |||
| .box { | |||
| background: #fff; | |||
| border-bottom:1px solid #eee; | |||
| } | |||
| .flex1 { | |||
| overflow: hidden; | |||
| width: 20%; | |||
| display: block; | |||
| text-align: center; | |||
| } | |||
| .flex1 text,.text { | |||
| font-size: 30rpx; | |||
| } | |||
| .text{ | |||
| display: block; | |||
| width: 25%; | |||
| text-align: center; | |||
| } | |||
| /* 日期选择 */ | |||
| .picker_group { | |||
| height: 85rpx; | |||
| line-height: 85rpx; | |||
| justify-content: center; | |||
| display: flex; | |||
| align-items: center; | |||
| font-size: 30rpx; | |||
| color: #888; | |||
| } | |||
| .picker_group picker { | |||
| height: 55rpx; | |||
| line-height: 55rpx; | |||
| margin: 0 2%; | |||
| padding: 2% 5%; | |||
| border-bottom: 1px solid #eee; | |||
| } | |||
| .view view:nth-of-type(1) { | |||
| font-size: 28rpx; | |||
| color: #888; | |||
| } | |||
| .list { | |||
| position: relative; | |||
| width: 644rpx; | |||
| border-radius: 16rpx; | |||
| margin: 40rpx auto; | |||
| box-shadow: 0 6px 20px 0 rgba(0, 0, 0, 0.1); | |||
| padding-bottom: 20rpx; | |||
| } | |||
| .list >view { | |||
| height: 60rpx; | |||
| line-height: 60rpx; | |||
| font-size: 30rpx; | |||
| } | |||
| .txt1 { | |||
| font-size: 24rpx; | |||
| font-weight: 500; | |||
| color: rgba(85, 85, 85, 1); | |||
| } | |||
| .txt2 { | |||
| font-size: 28rpx; | |||
| font-weight: 500; | |||
| color: rgba(255, 106, 106, 1); | |||
| } | |||
| .money { | |||
| font-weight: 500; | |||
| color: rgba(255, 106, 106, 1); | |||
| font-size: 26rpx; | |||
| /* width: 123rpx; */ | |||
| padding-right: 20rpx; | |||
| } | |||
| .time { | |||
| font-size: 28rpx; | |||
| font-weight: 500; | |||
| color: rgba(125, 125, 125, 1); | |||
| } | |||
| .status{ | |||
| position: absolute; | |||
| top: 60rpx; | |||
| left: 250rpx; | |||
| width: auto; | |||
| padding: 0 20rpx; | |||
| height: 50rpx; | |||
| text-align: center; | |||
| line-height: 50rpx; | |||
| border-radius: 8rpx; | |||
| transform:rotate(-30deg); | |||
| } | |||
| .status1 { | |||
| color: #659ef6; | |||
| border: 2px solid #659ef6; | |||
| } | |||
| .status2 { | |||
| color: #eea959; | |||
| } | |||
| .status3 { | |||
| color: #ff6a6a; | |||
| border: 2px solid #ff6a6a; | |||
| } | |||
| .status4 { | |||
| color: #8aaa6b; | |||
| } | |||
| .btn { | |||
| float: right; | |||
| height: 52rpx; | |||
| line-height: 52rpx; | |||
| background: rgba(101, 158, 246, 1); | |||
| border-radius: 10rpx; | |||
| font-size: 28rpx; | |||
| font-weight: 500; | |||
| padding: 0 25rpx; | |||
| color: rgba(255, 255, 255, 1); | |||
| } | |||
| .active1 { | |||
| opacity: 0.6; | |||
| } | |||
| .btns { | |||
| width:137rpx; | |||
| margin-top: 21rpx; | |||
| background: #52a0fd; | |||
| border-radius: 8rpx; | |||
| color: #fff; | |||
| font-size: 26rpx; | |||
| height: 64rpx; | |||
| line-height: 64rpx; | |||
| } | |||
| .active2{ | |||
| border: 1px solid #52a0fd!important; | |||
| color: #52a0fd!important; | |||
| } | |||
| .recond{ | |||
| text-align: center; | |||
| font-size: 30rpx; | |||
| margin-top: 60rpx; | |||
| } | |||
| .active3{ | |||
| color: #659ef6; | |||
| } | |||
| .loading{ | |||
| text-align: center; | |||
| font-size: 28rpx; | |||
| color: #999; | |||
| margin-bottom: 80rpx; | |||
| /* padding: 20rpx 0 40rpx; */ | |||
| } | |||
| .mr{ | |||
| margin-top: 200rpx!important; | |||
| } | |||
| .lists{ | |||
| height: 100%; | |||
| position: relative; | |||
| } | |||
| .bottom{ | |||
| position: fixed; | |||
| width: 100%; | |||
| height: 80rpx; | |||
| bottom: 0; | |||
| left: 0; | |||
| background: #fff; | |||
| z-index: 1000; | |||
| overflow: hidden; | |||
| box-shadow: 1rpx -5rpx 11rpx rgb(202, 201, 201); | |||
| } | |||
| .b-left{ | |||
| width: 50%; | |||
| line-height: 80rpx; | |||
| padding-left: 20rpx; | |||
| font-size: 32rpx; | |||
| color: #333; | |||
| float: left; | |||
| box-sizing: border-box; | |||
| } | |||
| .b-right{ | |||
| width: 50%; | |||
| float: left; | |||
| line-height: 80rpx; | |||
| text-align: right; | |||
| padding-right: 30rpx; | |||
| color: #ff6a6a; | |||
| font-size: 32rpx; | |||
| box-sizing: border-box; | |||
| } | |||
| .list .title{ | |||
| width: 100%; | |||
| height: 80rpx; | |||
| line-height: 80rpx; | |||
| background: #409EFF; | |||
| text-align: center; | |||
| font-weight: bold; | |||
| color: #fff; | |||
| } | |||
| .list .button{ | |||
| width: 200rpx; | |||
| height: 80rpx; | |||
| line-height: 80rpx; | |||
| background: #409EFF; | |||
| color: #fff; | |||
| margin: 30rpx auto; | |||
| border-radius: 50rpx; | |||
| text-align: center; | |||
| } | |||
| .list .txt{ | |||
| padding-left: 30rpx; | |||
| } | |||
| .noList .title, .noList .button{ | |||
| background: #67C23A; | |||
| } | |||
| .list1 .title, .list1 .button{ | |||
| background: #909399; | |||
| } | |||
| @@ -0,0 +1,282 @@ | |||
| const config = require('../../config/config.js') | |||
| const Http = require('../../utils/HttpBasics.js') | |||
| const util = require('../../utils/util.js') | |||
| const format = require('../../utils/format.js') | |||
| const app = getApp(); | |||
| Page({ | |||
| /** | |||
| * 页面的初始数据 | |||
| */ | |||
| data: { | |||
| receiptUrl: "", | |||
| courierInput: "", | |||
| expressageIdInput: "", | |||
| formData: { | |||
| orderNo: '', | |||
| orderMoney: '', | |||
| cusName: '', | |||
| cusPhone: "", | |||
| cusAddress: "", | |||
| lotteryNum: [''], | |||
| lotteryCount: '', | |||
| anniversaryLotteryNum: '', | |||
| }, | |||
| address: '', | |||
| paramData: null, | |||
| detailData: null, | |||
| auditRemark: '', | |||
| disabled: false, | |||
| btnText: '提交', | |||
| auditRemarkShow: false, | |||
| disabledDetail: true, | |||
| recordExtends: [''], | |||
| rule: { | |||
| "orderNo": [{ | |||
| required: true, | |||
| message: "请填写订单编号" | |||
| }], | |||
| "orderMoney": [{ | |||
| required: true, | |||
| message: "请填写订单编号" | |||
| }, | |||
| { | |||
| type: 'float', | |||
| message: "请输入最多两位小数的数字" | |||
| } | |||
| ], | |||
| "cusName": [{ | |||
| required: true, | |||
| message: "请填写客户姓名" | |||
| }], | |||
| "cusPhone": [{ | |||
| required: true, | |||
| message: "请填写手机号" | |||
| }, | |||
| { | |||
| type: 'phone', | |||
| message: "请输入正确的手机号码" | |||
| } | |||
| ], | |||
| "cusAddress": [{ | |||
| required: true, | |||
| message: "请填写客户地址" | |||
| }], | |||
| // "lotteryCount": [{ | |||
| // required: true, | |||
| // message: "请填写抽奖券数量" | |||
| // }], | |||
| // "anniversaryLotteryNum": [{ | |||
| // required: true, | |||
| // message: "周年庆抽奖编码" | |||
| // } | |||
| // ], | |||
| // "cusAddress":[ | |||
| // { | |||
| // pattern:/^[A-Z]{1}[0-9]{9}/g, | |||
| // message:"请输入以大写字母开头的长度为10的字符" | |||
| // } | |||
| // ] | |||
| }, | |||
| }, | |||
| inputChange(e) { | |||
| console.log(e, 9999) | |||
| this.setData({ | |||
| formData: Object.assign(this.data.formData, { | |||
| [e.target.dataset.key]: e.detail.value | |||
| }) | |||
| }) | |||
| // this.setData({ | |||
| // auditRemark: e.detail.value | |||
| // }) | |||
| }, | |||
| inputLotteryNum(e) { | |||
| let lotteryNum = this.data.formData.lotteryNum | |||
| lotteryNum[e.target.dataset.index] = e.detail.value | |||
| this.setData({ | |||
| formData: Object.assign(this.data.formData, { | |||
| lotteryNum | |||
| }) | |||
| }) | |||
| }, | |||
| addRemark() { | |||
| let lotteryNum = this.data.formData.lotteryNum | |||
| lotteryNum.push('') | |||
| console.log(lotteryNum, 'lotteryNum') | |||
| this.setData({ | |||
| formData: Object.assign(this.data.formData, { | |||
| lotteryNum | |||
| }) | |||
| }) | |||
| }, | |||
| delRemark(e) { | |||
| let lotteryNum = this.data.formData.lotteryNum | |||
| lotteryNum.splice(e.target.dataset.index, 1) | |||
| this.setData({ | |||
| formData: Object.assign(this.data.formData, { | |||
| lotteryNum | |||
| }) | |||
| }) | |||
| }, | |||
| /** | |||
| * 取消 | |||
| */ | |||
| goBack() { | |||
| wx.navigateBack({ | |||
| delta: 1 | |||
| }) | |||
| }, | |||
| submit() { | |||
| if (!format.validateForm(this.data.formData, this.data.rule)) { | |||
| return | |||
| } | |||
| if (this.data.formData.auditRemark == "" && this.data.detailData?.auditStatus == 2) { | |||
| wx.showToast({ | |||
| title: '请输入驳回意见', | |||
| icon: "none" | |||
| }) | |||
| return | |||
| } | |||
| Http.post({ | |||
| url: config.api.offlineSaveOrUpdate, | |||
| data: { | |||
| id: this.data.paramData.tag === 'add' ? '' : this.data.detailData.id, | |||
| activityId: this.data.paramData.tag === 'add' ? '' : this.data.detailData.activityId, | |||
| orderNo: this.data.formData.orderNo, | |||
| orderMoney: this.data.formData.orderMoney, | |||
| cusName: this.data.formData.cusName, | |||
| cusPhone: this.data.formData.cusPhone, | |||
| cusAddress: this.data.formData.cusAddress, | |||
| lotteryNum: JSON.stringify(this.data.formData.lotteryNum), | |||
| lotteryCount: this.data.formData.lotteryCount, | |||
| anniversaryLotteryNum: this.data.formData.anniversaryLotteryNum, | |||
| // auditStatus: this.data.paramData.tag !== 'add' && this.data.detailData.auditStatus === 2 ? 0 : undefined, | |||
| // recordExtends: this.data.recordExtends | |||
| } | |||
| }).then(res => { | |||
| wx.showToast({ | |||
| title: '提交成功!', | |||
| icon: "none" | |||
| }) | |||
| wx.navigateBack({ | |||
| delta: 1 | |||
| }) | |||
| }).catch(err => { | |||
| wx.showToast({ | |||
| title: err.message ? err.message : err.data, | |||
| icon: "none" | |||
| }) | |||
| }) | |||
| }, | |||
| /** | |||
| * 生命周期函数--监听页面加载 | |||
| */ | |||
| onLoad: function (options) { | |||
| this.setData({ | |||
| id: options.id, | |||
| paramData: options, | |||
| disabled: false, //options.tag !== 'add' ? true : false, | |||
| disabledDetail: options.tag === 'add' ? false : true, | |||
| auditRemarkShow: options.auditStatus == '2' ? true : false, | |||
| btnText: options.auditStatus == '0' || options.auditStatus == '1'|| options.auditStatus == '3' ? '' : options.auditStatus == '2' ? '修改' : '提交', | |||
| }) | |||
| wx.setNavigationBarTitle({ | |||
| title: options.auditStatus == '0' || options.auditStatus === '1' ? '查看活动审批' : options.auditStatus == '2' ? '修改活动审批' : '提交活动审批', | |||
| }) | |||
| console.log(options, 1111) | |||
| options.tag !== 'add' && this.getData() | |||
| }, | |||
| getData() { | |||
| Http.get({ | |||
| url: config.api.offlineRecordGetInfoById, | |||
| data: { | |||
| id: this.data.id | |||
| } | |||
| }).then(res => { | |||
| res.data.cashRate = res.data.cashRate + '%' | |||
| res.data.mallRate = res.data.mallRate + '%' | |||
| res.data.merchantRate = res.data.merchantRate + '%' | |||
| this.setData({ | |||
| detailData: res.data | |||
| }) | |||
| const formData = { | |||
| orderNo: res.data.orderNo, | |||
| orderMoney: res.data.orderMoney, | |||
| cusName: res.data.cusName, | |||
| cusPhone: res.data.cusPhone, | |||
| cusAddress: res.data.cusAddress, | |||
| lotteryNum: JSON.parse(res.data.lotteryNum), | |||
| lotteryCount: res.data.lotteryCount, | |||
| anniversaryLotteryNum: res.data.anniversaryLotteryNum, | |||
| } | |||
| if(res.data.auditStatus === 2){ | |||
| formData.auditRemark = res.data.auditRemark | |||
| } | |||
| console.log(res.data.auditStatus === 0 || res.data.auditStatus === 1 ? true : false, 888888) | |||
| this.setData({ | |||
| formData, | |||
| disabledDetail: res.data.auditStatus === 0 || res.data.auditStatus === 1 || res.data.auditStatus === 3? true : false | |||
| }) | |||
| if (res.data.auditStatus === 0) { | |||
| this.setData({ | |||
| disabled: false | |||
| }) | |||
| } | |||
| }).catch(err => { | |||
| wx.showToast({ | |||
| title: err.message ? err.message : err.data, | |||
| }) | |||
| }) | |||
| }, | |||
| /** | |||
| * 生命周期函数--监听页面初次渲染完成 | |||
| */ | |||
| onReady: function () { | |||
| }, | |||
| /** | |||
| * 生命周期函数--监听页面显示 | |||
| */ | |||
| onShow: function () { | |||
| }, | |||
| /** | |||
| * 生命周期函数--监听页面隐藏 | |||
| */ | |||
| onHide: function () { | |||
| }, | |||
| /** | |||
| * 生命周期函数--监听页面卸载 | |||
| */ | |||
| onUnload: function () { | |||
| }, | |||
| /** | |||
| * 页面相关事件处理函数--监听用户下拉动作 | |||
| */ | |||
| onPullDownRefresh: function () { | |||
| }, | |||
| /** | |||
| * 页面上拉触底事件的处理函数 | |||
| */ | |||
| onReachBottom: function () { | |||
| }, | |||
| /** | |||
| * 用户点击右上角分享 | |||
| */ | |||
| onShareAppMessage: function () { | |||
| } | |||
| }) | |||
| @@ -0,0 +1,9 @@ | |||
| { | |||
| "backgroundTextStyle": "light", | |||
| "navigationBarTitleText": "提交活动审批", | |||
| "navigationBarTextStyle": "white", | |||
| "navigationBarBackgroundColor": "#52A0FD", | |||
| "usingComponents": { | |||
| "single-dropdown-select": "../../Components/select/select" | |||
| } | |||
| } | |||
| @@ -0,0 +1,78 @@ | |||
| <view class="orderBox"> | |||
| <view class="orderTitle" wx:if="{{auditRemarkShow}}">驳回意见</view> | |||
| <view class="courier" wx:if="{{auditRemarkShow}}"> | |||
| <input class="courierInput" placeholder="请填写驳回意见" data-key="auditRemark" disabled="{{disabledDetail}}" bindinput="inputChange" value="{{formData.auditRemark}}"></input> | |||
| </view> | |||
| <view class="orderTitle">订单号</view> | |||
| <view class="courier"> | |||
| <input class="courierInput" placeholder="请填写交易订单号" data-key="orderNo" disabled="{{disabledDetail}}" bindinput="inputChange" value="{{formData.orderNo}}"></input> | |||
| </view> | |||
| <view class="orderTitle">订单金额</view> | |||
| <view class="courier"> | |||
| <input class="courierInput" placeholder="请填写交易订单金额" data-key="orderMoney" disabled="{{disabledDetail}}" bindinput="inputChange" value="{{formData.orderMoney}}"></input> | |||
| </view> | |||
| <view class="orderTitle">客户姓名</view> | |||
| <view class="courier"> | |||
| <input class="courierInput" placeholder="请填写客户姓名" data-key="cusName" disabled="{{disabledDetail}}" bindinput="inputChange" value="{{formData.cusName}}"></input> | |||
| </view> | |||
| <view class="orderTitle">客户电话</view> | |||
| <view class="courier"> | |||
| <input class="courierInput" placeholder="请填写客户电话" data-key="cusPhone" disabled="{{disabledDetail}}" bindinput="inputChange" value="{{formData.cusPhone}}"></input> | |||
| </view> | |||
| <view class="orderTitle">客户地址</view> | |||
| <view class="courier"> | |||
| <input class="courierInput" placeholder="请填写客户地址" data-key="cusAddress" disabled="{{disabledDetail}}" bindinput="inputChange" value="{{formData.cusAddress}}"></input> | |||
| </view> | |||
| <view class="codeList" wx:for="{{formData.lotteryNum}}" wx:key="index"> | |||
| <view class="orderTitle">抽奖券编码</view> | |||
| <view class="courier"> | |||
| <input class="courierInput" placeholder="请填写抽奖券编码" disabled="{{disabledDetail}}" bindinput="inputLotteryNum" data-index='{{index}}' value="{{item}}"></input> | |||
| </view> | |||
| <view class="oprBtn"> | |||
| <button wx:if="{{!disabledDetail && index===formData.lotteryNum.length-1}}" bindtap='addRemark'>添加</button> | |||
| <button wx:if="{{!disabledDetail && formData.lotteryNum.length > 1}}" bindtap='delRemark' data-index='{{index}}'>删除</button> | |||
| </view> | |||
| </view> | |||
| <view class="orderTitle">抽奖券数量</view> | |||
| <view class="courier"> | |||
| <input class="courierInput" placeholder="请填写抽奖券数量" data-key="lotteryCount" disabled="{{disabledDetail}}" bindinput="inputChange" value="{{formData.lotteryCount}}"></input> | |||
| </view> | |||
| <view class="orderTitle">周年庆抽奖券编码</view> | |||
| <view class="courier"> | |||
| <input class="courierInput" placeholder="请填写周年庆抽奖券编码" data-key="anniversaryLotteryNum" disabled="{{disabledDetail}}" bindinput="inputChange" value="{{formData.anniversaryLotteryNum}}"></input> | |||
| </view> | |||
| <!-- <view wx:if="{{detailData.auditStatus === 1}}"> | |||
| <view class="orderTitle">奖项名称</view> | |||
| <view class="courier"> | |||
| <input class="courierInput" placeholder="" disabled="{{disabled}}" bindinput="inputorderNo" value="{{detailData.itemName}}"></input> | |||
| </view> | |||
| <view class="orderTitle">总返现比率</view> | |||
| <view class="courier"> | |||
| <input class="courierInput" placeholder="" disabled="{{disabled}}" bindinput="inputorderNo" value="{{detailData.cashRate}}"></input> | |||
| </view> | |||
| <view class="orderTitle">总返现金额</view> | |||
| <view class="courier"> | |||
| <input class="courierInput" placeholder="" disabled="{{disabled}}" bindinput="inputorderNo" value="{{detailData.cashMoney}}"></input> | |||
| </view> | |||
| <view class="orderTitle">商管承担比例</view> | |||
| <view class="courier"> | |||
| <input class="courierInput" placeholder="" disabled="{{disabled}}" bindinput="inputorderNo" value="{{detailData.mallRate}}"></input> | |||
| </view> | |||
| <view class="orderTitle">商管承担金额</view> | |||
| <view class="courier"> | |||
| <input class="courierInput" placeholder="" disabled="{{disabled}}" bindinput="inputorderNo" value="{{detailData.mallCashMoney}}"></input> | |||
| </view> | |||
| <view class="orderTitle">商户承担比例</view> | |||
| <view class="courier"> | |||
| <input class="courierInput" placeholder="" disabled="{{disabled}}" bindinput="inputorderNo" value="{{detailData.merchantRate}}"></input> | |||
| </view> | |||
| <view class="orderTitle">商户承担金额</view> | |||
| <view class="courier"> | |||
| <input class="courierInput" placeholder="" disabled="{{disabled}}" bindinput="inputorderNo" value="{{detailData.merchantCashMoney}}"></input> | |||
| </view> | |||
| </view> --> | |||
| </view> | |||
| <view wx:if="{{btnText}}" class="submit" bindtap="submit">{{ btnText }}</view> | |||
| <view class="submit goBack" bindtap="goBack">{{btnText?'取消':'返回'}}</view> | |||
| @@ -0,0 +1,116 @@ | |||
| /* pages/deliveryDetails/deliveryDetails.wxss */ | |||
| page { | |||
| background: #f8f8fa; | |||
| } | |||
| .orderBox { | |||
| width: 96%; | |||
| margin: 20rpx auto; | |||
| overflow: hidden; | |||
| } | |||
| .orderTitle { | |||
| font-size: 32rpx; | |||
| font-weight: 500; | |||
| } | |||
| .orderItem { | |||
| margin: 20rpx auto; | |||
| background-color: #fff; | |||
| border-radius: 12rpx; | |||
| overflow: hidden; | |||
| } | |||
| .orderName { | |||
| } | |||
| .item { | |||
| width: 90%; | |||
| margin: 20rpx auto; | |||
| font-size: 28rpx; | |||
| } | |||
| .courier { | |||
| background-color: #fff; | |||
| width: 96%; | |||
| margin: 20rpx auto; | |||
| height: 80rpx; | |||
| border: 12rpx; | |||
| overflow: hidden; | |||
| } | |||
| .courierInput { | |||
| width: 90%; | |||
| margin: 10rpx auto; | |||
| height: 60rpx; | |||
| line-height: 60rpx; | |||
| font-size: 30rpx; | |||
| } | |||
| .expressageIdInput { | |||
| width: 90%; | |||
| margin: 10rpx auto; | |||
| height: 60rpx; | |||
| line-height: 60rpx; | |||
| } | |||
| .addImg { | |||
| height: 340rpx; | |||
| width: 310rpx; | |||
| margin: 88rpx auto; | |||
| border: 1px solid #52a0fd; | |||
| color: #52a0fd; | |||
| } | |||
| .addImg image{ | |||
| width: 59rpx; | |||
| height: 45rpx; | |||
| margin: 113rpx 125rpx 35rpx 126rpx; | |||
| } | |||
| .addImg text { | |||
| display: block; | |||
| text-align: center; | |||
| } | |||
| .up-img{ | |||
| width: 600rpx; | |||
| margin: 40rpx auto 0; | |||
| height: auto; | |||
| padding: 10rpx; | |||
| border: 1px dashed #52A0FD; | |||
| } | |||
| .up-img image{ | |||
| width: 600rpx; | |||
| } | |||
| .submit { | |||
| width: 80%; | |||
| margin: 20rpx auto; | |||
| text-align: center; | |||
| line-height: 80rpx; | |||
| height: 80rpx; | |||
| border-radius: 12rpx; | |||
| color: #fff; | |||
| background: rgba(101, 158, 246, 1); | |||
| } | |||
| .goBack{ | |||
| background: #fff; | |||
| color: #000; | |||
| border: 1px solid #eee; | |||
| } | |||
| .codeList{ | |||
| position: relative; | |||
| } | |||
| .oprBtn { | |||
| position: absolute; | |||
| top: -10rpx; | |||
| right: 13rpx; | |||
| } | |||
| .oprBtn button{ | |||
| width: 140rpx; | |||
| height: 60rpx; | |||
| line-height: 60rpx; | |||
| font-size: 28rpx; | |||
| display: inline-block; | |||
| float: right; | |||
| margin-left: 10rpx; | |||
| } | |||
| @@ -0,0 +1,752 @@ | |||
| const Http = require('../../utils/HttpBasics.js') | |||
| const config = require('../../config/config.js') | |||
| const app = getApp(); | |||
| Page({ | |||
| /** | |||
| * 页面的初始数据 | |||
| */ | |||
| data: { | |||
| tempFilePaths: [], | |||
| BtempFilePaths: [], | |||
| // typeIndex: 0, //类型下标 | |||
| timeIndex: 0, //时间下标 | |||
| // typeArray: ['优惠券 >', '代金卷 >',], | |||
| timeArray: ['按日期 >', '按领取天数 >'], | |||
| useLimitRuleLsit: ['限制领取该券总数量', '只限制券包中未使用的该券数量'], | |||
| refundText: ['是', '否'], | |||
| refundIndex: 0, //0 =>是 1=>否 | |||
| beginTime: '请选择时间', | |||
| endTime: '请选择时间', | |||
| numDays: "", //按天数 | |||
| title: '', //标题 | |||
| faceValue: 0, //面值 | |||
| selling: 0, //售价\ | |||
| bank: 0, //库存 | |||
| everyday: 0, //每人限领 | |||
| explain: '', | |||
| ifUpdata: false, //判断是否修改 | |||
| id: '', //修改id | |||
| examineColor_back: '', | |||
| putApplyStatus: 0, //0未提交审批 1待审批 2审批成功 3审批驳回 | |||
| putApplyText: "待审批通过", | |||
| noUpdata: true, | |||
| couponId: '', | |||
| useLimitRule: 0 | |||
| }, | |||
| addPicture() { | |||
| const num = this.data.tempFilePaths.length | |||
| if (num == 5) { | |||
| wx.showToast({ | |||
| title: '主图限制为5张!', | |||
| icon: 'error' | |||
| }) | |||
| console.log(this.data.tempFilePaths, 'tempFilePaths'); | |||
| return | |||
| } | |||
| wx.navigateTo({ | |||
| url: '/pages/upload/upload?save=1', | |||
| }) | |||
| }, | |||
| BaddPicture() { | |||
| const num = this.data.BtempFilePaths.length | |||
| if (num == 5) { | |||
| wx.showToast({ | |||
| title: '主图限制为5张!', | |||
| icon: 'error' | |||
| }) | |||
| console.log(this.data.BtempFilePaths, 'BtempFilePaths'); | |||
| return | |||
| } | |||
| wx.navigateTo({ | |||
| url: '/pages/upload/upload?save=2', | |||
| }) | |||
| }, | |||
| /** | |||
| * 取消 | |||
| */ | |||
| goBack() { | |||
| wx.navigateBack({ | |||
| delta: 1 | |||
| }) | |||
| }, | |||
| /** | |||
| * 保存 | |||
| */ | |||
| save() { | |||
| wx.showLoading({ | |||
| title: '加载中', | |||
| }) | |||
| if (this.data.timeIndex == 0) { | |||
| if (this.data.beginTime.indexOf('请选择时间') != -1) { | |||
| wx.showToast({ | |||
| title: '请选择开始时间', | |||
| icon: 'none', | |||
| duration: 2000 | |||
| }) | |||
| return | |||
| } | |||
| if (this.data.endTime.indexOf('请选择时间') != -1) { | |||
| wx.showToast({ | |||
| title: '请选择结束时间', | |||
| icon: 'none', | |||
| duration: 2000 | |||
| }) | |||
| return | |||
| } | |||
| } else { | |||
| if (this.data.numDays == '') { | |||
| wx.showToast({ | |||
| title: '请输入有效期', | |||
| icon: 'none', | |||
| duration: 2000 | |||
| }) | |||
| return | |||
| } | |||
| } | |||
| let _that = this | |||
| let postData = { | |||
| title: _that.data.title, | |||
| type: "6", | |||
| priceStr: _that.data.faceValue, | |||
| salePriceStr: _that.data.selling, | |||
| inventory: _that.data.bank, | |||
| useLimitQuantity: _that.data.everyday, | |||
| validStartDate: _that.data.timeIndex == 0 ? _that.data.beginTime + ' 00:00:00' : '', | |||
| validEndDate: _that.data.timeIndex == 0 ? _that.data.endTime + ' 23:59:59' : '', | |||
| validDays: _that.data.numDays, | |||
| remark: _that.data.explain, | |||
| subTitle: '', //不用管管副标题 B端没用 | |||
| sendType: "1", | |||
| remainInventory: _that.data.bank, //剩余库存 | |||
| autoRefund: _that.data.refundIndex, //是否退款 | |||
| useLimitRule: (_that.data.useLimitRule * 1) + 1 | |||
| } | |||
| if (this.data.timeIndex == 0) { | |||
| //1是时间类型 2是领取后多少天有效 | |||
| postData.validType = '1' | |||
| } else { | |||
| postData.validType = '2' | |||
| } | |||
| if (postData.title == '' || postData.priceStr == 0 || postData.inventory == 0 || postData.useLimitQuantity == 0 || postData.validStartDate == '请选择时间' || postData.validEndDate == '请选择时间' || postData.html == '') { | |||
| console.log(postData, 'postData'); | |||
| wx.hideLoading(); | |||
| wx.showToast({ | |||
| title: '请输入完整信息', | |||
| icon: 'none', | |||
| duration: 2000 | |||
| }) | |||
| return | |||
| } | |||
| if (parseInt(postData.priceStr) < parseInt(postData.salePriceStr)) { | |||
| wx.hideLoading(); | |||
| wx.showToast({ | |||
| title: '面值必须小于售价', | |||
| icon: 'none', | |||
| duration: 2000 | |||
| }) | |||
| return | |||
| } | |||
| if (parseInt(postData.inventory) < parseInt(postData.useLimitQuantity)) { | |||
| wx.hideLoading(); | |||
| wx.showToast({ | |||
| title: '库存必须大于每人限领', | |||
| icon: 'none', | |||
| duration: 2000 | |||
| }) | |||
| return | |||
| } | |||
| const beginTime = new Date(_that.data.beginTime) | |||
| const endTime = new Date(_that.data.endTime) | |||
| if (beginTime > endTime) { | |||
| wx.showToast({ | |||
| title: '起始时间必须小于结束时间', | |||
| icon: 'none', | |||
| duration: 2000 | |||
| }) | |||
| return | |||
| } | |||
| if (_that.data.tempFilePaths.length < 1) { | |||
| wx.showToast({ | |||
| title: '请至少上传一张主图!', | |||
| icon: 'none', | |||
| duration: 2000 | |||
| }) | |||
| return | |||
| } | |||
| // if (_that.data.selling<=0){ | |||
| // wx.showToast({ | |||
| // title: '售价必须大于0', | |||
| // icon: 'none', | |||
| // duration: 2000 | |||
| // }) | |||
| // return | |||
| // } | |||
| // console.log(beginTime, endTime) | |||
| // 编辑 | |||
| if (_that.data.ifUpdata || _that.data.id != '') { | |||
| // if (_that.data.receiptUrl.indexOf('//tmp') != -1 || _that.data.receiptUrl.indexOf('"http://tmp') != -1) { | |||
| // console.log(1234568); | |||
| // wx.uploadFile({ | |||
| // url: config.api.imgUpload, | |||
| // filePath: _that.data.receiptUrl, | |||
| // name: 'file', | |||
| // header: { | |||
| // 'token': app.globalData.token | |||
| // }, | |||
| // success(res) { | |||
| // const data = res.data | |||
| // console.log(data, 'data'); | |||
| // // console.log(JSON.parse(res.data).data.url ,"????hhahah66666") | |||
| // postData.coverImg = _that.data.receiptUrl | |||
| // postData.coverPicture = JSON.stringify([_that.data.receiptUrl]) | |||
| // postData.id = _that.data.id | |||
| // Http.post({ | |||
| // url: config.api.updataCoupon, | |||
| // data: postData | |||
| // }).then(res => { | |||
| // const { | |||
| // code, | |||
| // data | |||
| // } = res | |||
| // if (code == 200) { | |||
| // wx.hideLoading(); | |||
| // wx.showToast({ | |||
| // title: '保存成功', | |||
| // icon: "none", | |||
| // duration: 1000, | |||
| // }) | |||
| // } | |||
| // }).catch(res => { | |||
| // wx.hideLoading(); | |||
| // wx.showToast({ | |||
| // title: `${res.message}`, | |||
| // icon: "none", | |||
| // duration: 1000, | |||
| // }) | |||
| // }) | |||
| // }, | |||
| // fail(res) { | |||
| // wx.hideLoading(); | |||
| // wx.showToast({ | |||
| // title: '请上传主图', | |||
| // icon: "none", | |||
| // duration: 1000 | |||
| // }) | |||
| // } | |||
| // }) | |||
| // } | |||
| postData.coverImg = _that.data.tempFilePaths[0] | |||
| postData.coverPicture = JSON.stringify(_that.data.tempFilePaths) | |||
| postData.detailPicture = JSON.stringify(_that.data.BtempFilePaths) | |||
| postData.id = _that.data.id | |||
| Http.post({ | |||
| url: config.api.updataCoupon, | |||
| data: postData | |||
| }).then(res => { | |||
| const { | |||
| code, | |||
| data | |||
| } = res | |||
| console.log(code, data, "666") | |||
| _that.setData({ | |||
| id: data | |||
| }) | |||
| if (code == 200) { | |||
| wx.hideLoading(); | |||
| wx.showToast({ | |||
| title: '保存成功', | |||
| icon: "none", | |||
| duration: 1000, | |||
| success() { | |||
| setTimeout(() => { | |||
| wx.navigateBack() | |||
| }, 1000); | |||
| } | |||
| }) | |||
| } | |||
| }).catch(res => { | |||
| wx.hideLoading(); | |||
| wx.showToast({ | |||
| title: `${res.message}`, | |||
| icon: "none", | |||
| duration: 1000 | |||
| }) | |||
| }) | |||
| } else { | |||
| // 新建 | |||
| console.log(1234567); | |||
| postData.coverImg = _that.data.tempFilePaths[0] | |||
| postData.coverPicture = JSON.stringify(_that.data.tempFilePaths) | |||
| postData.detailPicture = JSON.stringify(_that.data.BtempFilePaths) | |||
| console.log(postData, 'postData'); | |||
| Http.post({ | |||
| url: config.api.addCoupon, | |||
| data: postData | |||
| }).then(res => { | |||
| const { | |||
| code, | |||
| data | |||
| } = res | |||
| if (code == 200) { | |||
| _that.setData({ | |||
| id: data | |||
| }) | |||
| wx.hideLoading(); | |||
| wx.showToast({ | |||
| title: '保存成功', | |||
| icon: "none", | |||
| duration: 1000, | |||
| success() { | |||
| setTimeout(() => { | |||
| wx.navigateBack() | |||
| }, 1000); | |||
| } | |||
| }) | |||
| } | |||
| }).catch(res => { | |||
| wx.hideLoading(); | |||
| wx.showToast({ | |||
| title: `${res.message}`, | |||
| icon: "none", | |||
| duration: 1000, | |||
| }) | |||
| }) | |||
| } | |||
| }, | |||
| /** | |||
| * 提交审批 | |||
| */ | |||
| examine() { | |||
| wx.showLoading({ | |||
| title: '加载中', | |||
| }) | |||
| if (this.data.putApplyStatus == 1) { | |||
| wx.hideLoading(); | |||
| wx.showToast({ | |||
| title: "待审批请勿重复提交", | |||
| icon: 'none', | |||
| duration: 2000, | |||
| }) | |||
| return | |||
| } | |||
| if (this.data.id != '') { | |||
| let postData = { | |||
| id: this.data.id, | |||
| remark: '' | |||
| } | |||
| Http.post({ | |||
| url: config.api.submitExamine, | |||
| data: postData | |||
| }).then(res => { | |||
| const { | |||
| code, | |||
| message | |||
| } = res; | |||
| console.log(code, message) | |||
| if (code == 200) { | |||
| wx.hideLoading(); | |||
| wx.showToast({ | |||
| title: message, | |||
| icon: 'none', | |||
| duration: 2000, | |||
| success: (res => { | |||
| this.goBack() | |||
| }) | |||
| }) | |||
| } | |||
| }) | |||
| } else { | |||
| wx.hideLoading(); | |||
| wx.showToast({ | |||
| title: '请先保存再提交审核', | |||
| icon: 'error', | |||
| duration: 2000 | |||
| }) | |||
| } | |||
| }, | |||
| /** | |||
| * 获取卷标题 | |||
| */ | |||
| getTitle(e) { | |||
| this.setData({ | |||
| title: e.detail.value | |||
| }) | |||
| }, | |||
| /** | |||
| * 获取面值 | |||
| */ | |||
| getfaceValue(e) { | |||
| this.setData({ | |||
| faceValue: e.detail.value | |||
| }) | |||
| }, | |||
| /** | |||
| * 获取售价 | |||
| */ | |||
| getselling(e) { | |||
| this.setData({ | |||
| selling: e.detail.value | |||
| }) | |||
| }, | |||
| /** | |||
| * 获取库存 | |||
| */ | |||
| getbank(e) { | |||
| this.setData({ | |||
| bank: e.detail.value | |||
| }) | |||
| }, | |||
| /** | |||
| * 每人限领 | |||
| */ | |||
| geteveryday(e) { | |||
| this.setData({ | |||
| everyday: e.detail.value | |||
| }) | |||
| }, | |||
| /** | |||
| * 购买须知 | |||
| */ | |||
| getexplain(e) { | |||
| this.setData({ | |||
| explain: e.detail.value | |||
| }) | |||
| }, | |||
| /** | |||
| * 选择天数获取天数 | |||
| */ | |||
| getNumDays(e) { | |||
| this.setData({ | |||
| numDays: e.detail.value | |||
| }) | |||
| }, | |||
| //删除图片 | |||
| pictureDel(e) { | |||
| const index = e.currentTarget.dataset.index | |||
| const tempFilePaths = this.data.tempFilePaths | |||
| tempFilePaths.splice(index, 1) | |||
| this.setData({ | |||
| tempFilePaths, | |||
| }) | |||
| }, | |||
| //删除图片 | |||
| BpictureDel(e) { | |||
| const index = e.currentTarget.dataset.index | |||
| const BtempFilePaths = this.data.BtempFilePaths | |||
| BtempFilePaths.splice(index, 1) | |||
| this.setData({ | |||
| BtempFilePaths | |||
| }) | |||
| }, | |||
| //卷类型选择器: | |||
| bindPickerChange: function (e) { | |||
| console.log('picker发送选择改变,携带值为', e.detail.value) | |||
| this.setData({ | |||
| tpyeIndex: e.detail.value | |||
| }) | |||
| }, | |||
| //先领规则 | |||
| setUseLimitRule: function (e) { | |||
| console.log('picker发送选择改变,携带值为', e.detail.value) | |||
| this.setData({ | |||
| useLimitRule: e.detail.value | |||
| }) | |||
| }, | |||
| //时间类型 | |||
| timeChange: function (e) { | |||
| console.log('picker发送选择改变,携带值为', e.detail.value) | |||
| this.setData({ | |||
| timeIndex: e.detail.value | |||
| }) | |||
| }, | |||
| //过期是否退款类型 | |||
| refundChange: function (e) { | |||
| console.log('picker发送选择改变,携带值为', e.detail.value) | |||
| this.setData({ | |||
| refundIndex: e.detail.value | |||
| }) | |||
| }, | |||
| setDeginTime: function (e) { | |||
| console.log('picker发送选择改变,携带值为', e.detail.value) | |||
| this.setData({ | |||
| beginTime: e.detail.value | |||
| }) | |||
| }, | |||
| setEndTime: function (e) { | |||
| console.log('picker发送选择改变,携带值为', e.detail.value) | |||
| this.setData({ | |||
| endTime: e.detail.value | |||
| }) | |||
| }, | |||
| setRefund: function (e) { | |||
| console.log('picker发送选择改变,携带值为', e.detail.value) | |||
| this.setData({ | |||
| endTime: e.detail.value | |||
| }) | |||
| }, | |||
| /** | |||
| * 上架 | |||
| */ | |||
| putaway() { | |||
| if (this.data.bank <= 0) { | |||
| wx.showToast({ | |||
| title: '库存不能为0', | |||
| icon: 'none', | |||
| duration: 2000 | |||
| }) | |||
| return | |||
| } | |||
| wx.showLoading({ | |||
| title: '加载中', | |||
| }) | |||
| let postData = { | |||
| couponIds: this.data.id, | |||
| channelId: "1", | |||
| beginTime: "", | |||
| endTime: "" | |||
| } | |||
| Http.post({ | |||
| url: config.api.addbatch, | |||
| data: postData | |||
| }).then(res => { | |||
| const { | |||
| code, | |||
| data | |||
| } = res | |||
| if (code == 200) { | |||
| wx.hideLoading(); | |||
| wx.showToast({ | |||
| title: '上架成功', | |||
| icon: 'none', | |||
| duration: 2000 | |||
| }) | |||
| } else { | |||
| wx.hideLoading(); | |||
| wx.showToast({ | |||
| title: res.message, | |||
| icon: 'none', | |||
| duration: 2000, | |||
| }) | |||
| } | |||
| }) | |||
| }, | |||
| /** | |||
| * 下架 | |||
| */ | |||
| soldOut() { | |||
| wx.showLoading({ | |||
| title: '加载中', | |||
| }) | |||
| let postData = { | |||
| id: this.data.id, | |||
| status: "1", | |||
| } | |||
| Http.post({ | |||
| url: config.api.soldOut, | |||
| data: postData | |||
| }).then(res => { | |||
| const { | |||
| code, | |||
| data | |||
| } = res | |||
| if (code == 200) { | |||
| wx.hideLoading(); | |||
| wx.showToast({ | |||
| title: '下架成功', | |||
| icon: 'none', | |||
| duration: 2000, | |||
| success: (res => { | |||
| this.goBack() | |||
| }) | |||
| }) | |||
| } else { | |||
| wx.hideLoading(); | |||
| wx.showToast({ | |||
| title: res.message, | |||
| icon: 'none', | |||
| duration: 2000, | |||
| }) | |||
| } | |||
| }) | |||
| }, | |||
| /** | |||
| * 作废 | |||
| */ | |||
| cancellation() { | |||
| wx.showLoading({ | |||
| title: '加载中', | |||
| }) | |||
| let postData = { | |||
| id: this.data.couponId != '' ? this.data.couponId : this.data.id, | |||
| status: "1", | |||
| } | |||
| Http.post({ | |||
| url: config.api.cancellation, | |||
| data: postData | |||
| }).then(res => { | |||
| const { | |||
| code, | |||
| data | |||
| } = res | |||
| if (code == 200) { | |||
| wx.hideLoading(); | |||
| wx.showToast({ | |||
| title: '作废成功', | |||
| icon: 'none', | |||
| duration: 2000, | |||
| success: (res => { | |||
| this.goBack() | |||
| }) | |||
| }) | |||
| } else { | |||
| wx.hideLoading(); | |||
| wx.showToast({ | |||
| title: res.message, | |||
| icon: 'none', | |||
| duration: 2000, | |||
| }) | |||
| } | |||
| }) | |||
| }, | |||
| /** | |||
| * 审批历史记录 | |||
| */ | |||
| lookExamine() { | |||
| console.log("查看审批历史") | |||
| wx.navigateTo({ | |||
| url: `/pages/lookExamine/lookExamine?id=${this.data.id}`, | |||
| }) | |||
| }, | |||
| /** | |||
| * 生命周期函数--监听页面加载 | |||
| */ | |||
| onLoad: function (options) { | |||
| const storTempData = wx.getStorageSync('tmepdata') | |||
| console.log(storTempData); | |||
| if (storTempData) { | |||
| let tempData = JSON.parse(storTempData) | |||
| console.log(tempData) | |||
| this.setData({ | |||
| title: tempData.title, | |||
| faceValue: tempData.priceStr, | |||
| selling: tempData.salePriceStr, | |||
| bank: tempData.remainInventory, | |||
| everyday: tempData.useLimitQuantity, | |||
| timeIndex: tempData.validType - 1, | |||
| explain: tempData.remark, | |||
| numDays: tempData.numDays, | |||
| beginTime: tempData.validStartDate, | |||
| endTime: tempData.validEndDate, | |||
| status: tempData.status, | |||
| ifUpdata: true, | |||
| id: tempData.id, | |||
| couponId: tempData.couponId, | |||
| refundIndex: tempData.autoRefund, | |||
| putApplyStatus: tempData.putApplyStatus, //0未提交审批 1待审批 2审批成功 3审批驳回 | |||
| channel: tempData.channel, //已上架按钮判断条件 1是已上架, | |||
| noUpdata: tempData.noUpdata, //是否能修改 | |||
| useLimitRule: (tempData.useLimitRule * 1) - 1, | |||
| }) | |||
| if (tempData.coverPicture) { | |||
| this.setData({ | |||
| tempFilePaths: JSON.parse(tempData.coverPicture), | |||
| }) | |||
| } else { | |||
| this.setData({ | |||
| tempFilePaths: tempData.coverImg, | |||
| }) | |||
| } | |||
| if (tempData.detailPicture) { | |||
| this.setData({ | |||
| BtempFilePaths: JSON.parse(tempData.detailPicture) | |||
| }) | |||
| } | |||
| console.log(this.data.channel, "channel") | |||
| if (this.data.putApplyStatus == 1) { | |||
| this.setData({ | |||
| examineColor_back: 'background-color: yellow;color: red;', | |||
| putApplyText: "待审批通过", | |||
| }) | |||
| } else if (this.data.putApplyStatus == 3) { | |||
| this.setData({ | |||
| examineColor_back: 'background-color: red;color: #fff;', | |||
| putApplyText: "审批未通过", | |||
| }) | |||
| } else if (this.data.putApplyStatus == 2) { | |||
| this.setData({ | |||
| examineColor_back: 'background-color: green;color: #fff;', | |||
| putApplyText: "审批已通过", | |||
| }) | |||
| } | |||
| } else { | |||
| this.setData({ | |||
| tempFilePaths: [options.res] | |||
| }) | |||
| } | |||
| }, | |||
| /** | |||
| * 生命周期函数--监听页面初次渲染完成 | |||
| */ | |||
| onReady: function () { | |||
| }, | |||
| /** | |||
| * 生命周期函数--监听页面显示 | |||
| */ | |||
| onShow: function () { }, | |||
| /** | |||
| * 生命周期函数--监听页面隐藏 | |||
| */ | |||
| onHide: function () { | |||
| }, | |||
| /** | |||
| * 生命周期函数--监听页面卸载 | |||
| */ | |||
| onUnload: function () { | |||
| console.log("123456789") | |||
| if (wx.getStorageSync('tmepdata')) { | |||
| wx.removeStorageSync('tmepdata') | |||
| } | |||
| }, | |||
| /** | |||
| * 页面相关事件处理函数--监听用户下拉动作 | |||
| */ | |||
| onPullDownRefresh: function () { | |||
| }, | |||
| /** | |||
| * 页面上拉触底事件的处理函数 | |||
| */ | |||
| onReachBottom: function () { | |||
| }, | |||
| /** | |||
| * 用户点击右上角分享 | |||
| */ | |||
| onShareAppMessage: function () { | |||
| } | |||
| }) | |||
| @@ -0,0 +1,6 @@ | |||
| { | |||
| "backgroundTextStyle": "light", | |||
| "navigationBarTitleText": "新建优惠券", | |||
| "navigationBarTextStyle": "white", | |||
| "navigationBarBackgroundColor": "#52A0FD" | |||
| } | |||
| @@ -0,0 +1,128 @@ | |||
| <view class="box"> | |||
| <input class="searchs" value="{{title}}" placeholder="新建优惠券请输入优惠券名称" bindinput="getTitle" disabled="{{!noUpdata}}"></input> | |||
| <view class="couponImgBox"> | |||
| <view>主图:</view> | |||
| <view class="imgBox" wx:if="{{tempFilePaths.length >= 1}}" wx:for="{{ tempFilePaths }}" wx:key="index"> | |||
| <image class="couponImg" src="{{item}}" mode="widthFix"></image> | |||
| <view class="delBox" bindtap="pictureDel" data-index="{{index}}" wx:if="{{tempFilePaths.length >= 1 && noUpdata}}"> | |||
| <image class="del" src="https://formall.oss-accelerate.aliyuncs.com/bimg/pictureDel.png" mode="widthFix"></image> | |||
| </view> | |||
| </view> | |||
| <block wx:if="{{noUpdata}}"> | |||
| <!-- <view class="uploadTitle">上传主图</view> --> | |||
| <view class="nullImg" bindtap="addPicture"> | |||
| + | |||
| </view> | |||
| </block> | |||
| </view> | |||
| <view class="couponImgBox"> | |||
| <view>附图:</view> | |||
| <view class="imgBox" wx:if="{{BtempFilePaths.length >= 1}}" wx:for="{{ BtempFilePaths }}" wx:key="index"> | |||
| <image class="couponImg" src="{{item}}" mode="widthFix"></image> | |||
| <view class="delBox" bindtap="BpictureDel" data-index="{{index}}" wx:if="{{BtempFilePaths.length >= 1 && noUpdata}}"> | |||
| <image class="del" src="https://formall.oss-accelerate.aliyuncs.com/bimg/pictureDel.png" mode="widthFix"></image> | |||
| </view> | |||
| </view> | |||
| <block wx:if="{{noUpdata}}"> | |||
| <!-- <view class="uploadTitle">上传附图</view> --> | |||
| <view class="nullImg" bindtap="BaddPicture"> | |||
| + | |||
| </view> | |||
| </block> | |||
| </view> | |||
| <view class="couponType"> | |||
| <view class="type">券类型</view> | |||
| <!-- <picker class="typeName" bindchange="bindPickerChange" value="{{typeIndex}}" range="{{typeArray}}"> | |||
| <view class="picker"> | |||
| {{typeArray[typeIndex]}} | |||
| </view> | |||
| </picker> --> | |||
| <view class="typeName">通用券</view> | |||
| </view> | |||
| <view class="couponType"> | |||
| <view class="faceValue">面值</view> | |||
| <input class="faceIpt" placeholder="50.00 >" type="digit" bindinput="getfaceValue" value="{{faceValue}}" disabled="{{!noUpdata}}"></input> | |||
| <view class="bef">¥</view> | |||
| </view> | |||
| <view class="couponType "> | |||
| <view class="faceValue">售价</view> | |||
| <input class="selling" placeholder="50.00 >" type="digit" bindinput="getselling" value="{{selling}}" disabled="{{!noUpdata}}"></input> | |||
| <view class="sellingbef">¥</view> | |||
| </view> | |||
| <view class="couponType "> | |||
| <view class="faceValue ">库存数量</view> | |||
| <input class="bank" placeholder="50 >" type="number" bindinput="getbank" value="{{bank}}" disabled="{{!noUpdata}}"></input> | |||
| </view> | |||
| <view class="couponType "> | |||
| <view class="faceValue ">每人限领 </view> | |||
| <input class="bank" placeholder="50 >" type="number" bindinput="geteveryday" value="{{everyday}}" disabled="{{!noUpdata}}"></input> | |||
| </view> | |||
| <view style="overflow: hidden;"> | |||
| <view class="faceValue">限领规则</view> | |||
| <picker class="typeName" bindchange="setUseLimitRule" value="{{useLimitRule}}" range="{{useLimitRuleLsit}}" disabled="{{!noUpdata}}"> | |||
| <view class="picker" disabled="{{!noUpdata}}"> | |||
| {{useLimitRuleLsit[useLimitRule]}} | |||
| </view> | |||
| </picker> | |||
| </view> | |||
| <view class="couponType"> | |||
| <view style="overflow: hidden;"> | |||
| <view class="faceValue">有效期</view> | |||
| <picker class="typeName" bindchange="timeChange" value="{{timeIndex}}" range="{{timeArray}}" disabled="{{!noUpdata}}"> | |||
| <view class="picker" disabled="{{!noUpdata}}"> | |||
| {{timeArray[timeIndex]}} | |||
| </view> | |||
| </picker> | |||
| </view> | |||
| <view class="daysBox" wx:if="{{timeIndex!=0}}"> | |||
| <view class="daysText">日内有效</view> | |||
| <input class="daysName" placeholder="xx" value="{{numDays}}" bindinput="getNumDays" disabled="{{!noUpdata}}"></input> | |||
| </view> | |||
| <view class="beginTime" wx:if="{{timeIndex==0}}"> | |||
| <view class="section__title">起始日期</view> | |||
| <picker mode="date" value="{{beginTime}}" bindchange="setDeginTime" disabled="{{!noUpdata}}"> | |||
| <view class="pickerotiem"> | |||
| {{beginTime+'>'}} | |||
| </view> | |||
| </picker> | |||
| </view> | |||
| <view class="endTime" wx:if="{{timeIndex==0}}"> | |||
| <view class="section__title">结束日期</view> | |||
| <picker mode="date" value="{{endTime}}" bindchange="setEndTime" disabled="{{!noUpdata}}"> | |||
| <view class="pickerotiem"> | |||
| {{endTime+'>'}} | |||
| </view> | |||
| </picker> | |||
| </view> | |||
| </view> | |||
| <view class="couponType"> | |||
| <view class="refundText">到期是否退款</view> | |||
| <picker class="typeName" bindchange="refundChange" value="{{refundIndex}}" range="{{refundText}}" disabled="{{!noUpdata}}"> | |||
| <view class="picker"> | |||
| {{refundText[refundIndex]}} | |||
| </view> | |||
| </picker> | |||
| </view> | |||
| <view class="Purchase"> | |||
| <textarea class="PurchaseText" type="text" placeholder="请输购买须知" maxlength="-1" bindinput="getexplain" value="{{explain}}" disabled="{{!noUpdata}}"></textarea> | |||
| </view> | |||
| <view class="examineState" style="{{examineColor_back}}" wx:if="{{putApplyStatus!=0&&status!=1}}">{{putApplyText}}</view> | |||
| <view class="butBox"> | |||
| <button class="save" bindtap="putaway" wx:if="{{putApplyStatus==2&&status!=1&&channel!=1}}">上架</button> | |||
| <button class="save" bindtap="soldOut" wx:if="{{channel==1}}">下架</button> | |||
| <button class="save" bindtap="save" wx:if="{{(putApplyStatus==0||putApplyStatus==3)&&channel!=1&&status!=1}}">保存</button> | |||
| <button class="save" bindtap="examine" wx:if="{{(putApplyStatus==0||putApplyStatus==3)&&channel!=1&&status!=1}}">提交审核</button> | |||
| <button class="save" bindtap="cancellation" wx:if="{{(putApplyStatus==0||putApplyStatus==2||putApplyStatus==3)&&status!=1}}">作废</button> | |||
| <button class="save" bindtap="goBack" wx:if="{{putApplyStatus==2||putApplyStatus==1||channel==1||status==1}}">取消</button> | |||
| <button class="save" bindtap="lookExamine" wx:if="{{putApplyStatus!=0&&status!=1}}">审批历史</button> | |||
| </view> | |||
| </view> | |||
| @@ -0,0 +1,249 @@ | |||
| .box { | |||
| width: 710rpx; | |||
| overflow: hidden; | |||
| margin: auto; | |||
| font-size: 24rpx; | |||
| } | |||
| .searchs { | |||
| height: 60rpx; | |||
| /* border: 2rpx solid #ccc; */ | |||
| font-size: 28rpx; | |||
| margin: 15rpx 0; | |||
| border-bottom: 1px solid #ccc; | |||
| padding-left: 20rpx; | |||
| } | |||
| .couponImg { | |||
| width: 300rpx; | |||
| position: relative; | |||
| } | |||
| .imgBox { | |||
| position: relative; | |||
| display: inline-block; | |||
| width: 300rpx; | |||
| height: 300rpx; | |||
| margin-left: 25rpx; | |||
| margin-bottom: 25rpx; | |||
| margin-top: 25rpx; | |||
| } | |||
| .delBox { | |||
| position: absolute; | |||
| right: 0; | |||
| top: 0; | |||
| background-color: #000; | |||
| border-radius: 50% | |||
| } | |||
| .del { | |||
| width: 50rpx; | |||
| } | |||
| .couponImgBox { | |||
| overflow: hidden; | |||
| margin-top: 50rpx; | |||
| } | |||
| .couponType { | |||
| overflow: hidden; | |||
| border-bottom: 1px solid #ccc; | |||
| font-size: 28rpx; | |||
| } | |||
| .type { | |||
| float: left; | |||
| margin-left: 20rpx; | |||
| padding: 20rpx 0; | |||
| } | |||
| .typeName { | |||
| width: 170rpx; | |||
| float: right; | |||
| margin-right: 20rpx; | |||
| position: relative; | |||
| margin-top: 20rpx; | |||
| text-align: center; | |||
| padding: 4rpx 0; | |||
| } | |||
| /* .typeName::after{ | |||
| content: '>'; | |||
| } */ | |||
| .selectBox { | |||
| width: 150rpx; | |||
| position: absolute; | |||
| right: 40rpx; | |||
| top: 340rpx; | |||
| background-color: #fff; | |||
| border: 1rpx solid #ccc; | |||
| z-index: 100; | |||
| } | |||
| .selectType1 { | |||
| padding: 5rpx 0; | |||
| border-bottom: 1rpx solid #ccc; | |||
| text-align: center; | |||
| } | |||
| .selectType2 { | |||
| text-align: center; | |||
| padding: 5rpx 0; | |||
| } | |||
| .faceValue { | |||
| margin-left: 20rpx; | |||
| padding: 20rpx 0; | |||
| float: left; | |||
| } | |||
| .faceIpt { | |||
| width: 150rpx; | |||
| float: right; | |||
| margin-right: 20rpx; | |||
| margin-top: 20rpx; | |||
| text-align: center; | |||
| padding: 4rpx 0; | |||
| position: relative; | |||
| } | |||
| .bef { | |||
| color: red; | |||
| margin-top: 25rpx; | |||
| position: absolute; | |||
| right: 160rpx; | |||
| /* top: 350rpx; */ | |||
| } | |||
| .selling { | |||
| width: 150rpx; | |||
| float: right; | |||
| margin-right: 20rpx; | |||
| margin-top: 20rpx; | |||
| text-align: center; | |||
| padding: 4rpx 0; | |||
| position: relative; | |||
| } | |||
| .sellingbef { | |||
| color: red; | |||
| margin-top: 25rpx; | |||
| position: absolute; | |||
| right: 160rpx; | |||
| } | |||
| .bank { | |||
| width: 150rpx; | |||
| float: right; | |||
| margin-right: 20rpx; | |||
| margin-top: 20rpx; | |||
| text-align: center; | |||
| padding: 4rpx 0; | |||
| position: relative; | |||
| } | |||
| .beginTime { | |||
| overflow: hidden; | |||
| } | |||
| .section__title { | |||
| margin-left: 20rpx; | |||
| padding: 20rpx 0; | |||
| float: left; | |||
| } | |||
| .refundText { | |||
| margin-left: 20rpx; | |||
| padding: 20rpx 0; | |||
| float: left; | |||
| } | |||
| .pickerotiem { | |||
| float: right; | |||
| padding: 20rpx 0; | |||
| margin-right: 30rpx; | |||
| } | |||
| .endTime { | |||
| overflow: hidden; | |||
| } | |||
| .daysBox { | |||
| overflow: hidden; | |||
| margin-left: -30rpx; | |||
| padding-bottom: 50rpx; | |||
| } | |||
| .daysName { | |||
| width: 80rpx; | |||
| text-align: right; | |||
| float: right; | |||
| margin-top: 4rpx; | |||
| } | |||
| .daysText { | |||
| float: right; | |||
| margin-right: 40rpx; | |||
| padding: 5rpx; | |||
| } | |||
| .Purchase { | |||
| overflow: hidden; | |||
| margin-top: 20rpx; | |||
| } | |||
| .PurchaseText { | |||
| width: 100%; | |||
| margin-left: 20rpx; | |||
| height: 200rpx; | |||
| } | |||
| .butBox { | |||
| width: 80%; | |||
| margin: 20rpx auto; | |||
| overflow: hidden; | |||
| display: flex; | |||
| flex-direction: row; | |||
| justify-content: space-around; | |||
| } | |||
| .save { | |||
| width: 30%; | |||
| height: 70rpx; | |||
| line-height: 70rpx; | |||
| font-size: 28rpx; | |||
| margin: 0 10rpx; | |||
| padding-left: 5rpx; | |||
| padding-right: 5rpx; | |||
| } | |||
| .uploadTitle { | |||
| margin-top: 40rpx; | |||
| } | |||
| .nullImg { | |||
| width: 300rpx; | |||
| height: 170rpx; | |||
| border: 1rpx #ccc solid; | |||
| text-align: center; | |||
| line-height: 170rpx; | |||
| font-size: 40rpx; | |||
| font-weight: bold; | |||
| margin-top: 10rpx; | |||
| } | |||
| .examineState { | |||
| width: 300rpx; | |||
| height: 70rpx; | |||
| background-color: green; | |||
| margin: auto; | |||
| text-align: center; | |||
| line-height: 70rpx; | |||
| margin-bottom: 20rpx; | |||
| color: #fff; | |||
| } | |||
| @@ -0,0 +1,342 @@ | |||
| var app = getApp(); | |||
| const config = require('../../config/config.js') | |||
| const util = require('../../utils/util.js') | |||
| const Http = require('../../utils/http.js') | |||
| Page({ | |||
| data: { | |||
| data: { | |||
| list: [] | |||
| }, //数据 | |||
| crollTop: 0, | |||
| scrollHeight: 0, | |||
| house_type: 0, //户型 | |||
| house_style: 0, //风格 | |||
| house_area: 0, //面积 | |||
| flagdate: null, | |||
| list: [], | |||
| typeid: '1', | |||
| tabTxt: [{ | |||
| title: '类型', | |||
| idss: 2 | |||
| }, | |||
| { | |||
| title: '日期', | |||
| idss: 1 | |||
| }, | |||
| { | |||
| title: '状态', | |||
| idss: 3 | |||
| } | |||
| ], | |||
| showList: null, | |||
| loading: "", | |||
| tab: [true, true, true], | |||
| disabled: false, //加载更多按钮状态 | |||
| page: 1, //当前页码 | |||
| hasMore: false, //加载更多按钮 | |||
| moreTxt: '点击加载更多', | |||
| dataNull: true, | |||
| date: null, | |||
| date2: null, | |||
| idss: 0, | |||
| pageIndex: 2, //第几页 | |||
| height: null, | |||
| billtypes: [{ | |||
| name: '租金', | |||
| billTypeValue: '1', | |||
| id: "1" | |||
| }, | |||
| { | |||
| name: '营业管理费', | |||
| billTypeValue: '12', | |||
| id: "12" | |||
| }, | |||
| { | |||
| name: '商业管理费', | |||
| billTypeValue: '11', | |||
| id: "11" | |||
| }, | |||
| { | |||
| name: '租赁押金', | |||
| billTypeValue: '2', | |||
| id: "2" | |||
| }, | |||
| { | |||
| name: '物业费', | |||
| billTypeValue: '3', | |||
| id: "3" | |||
| }, | |||
| { | |||
| name: '物业押金', | |||
| billTypeValue: '4', | |||
| id: "4" | |||
| }, | |||
| { | |||
| name: '水电空调费', | |||
| billTypeValue: '5', | |||
| id: "5" | |||
| }, | |||
| { | |||
| name: '其他费用', | |||
| billTypeValue: '7', | |||
| id: "7" | |||
| }, | |||
| { | |||
| name: '其他押金', | |||
| billTypeValue: '8', | |||
| id: "8" | |||
| }, | |||
| { | |||
| name: '结算单', | |||
| billTypeValue: '10', | |||
| id: "10" | |||
| }, | |||
| ], | |||
| statustypes: [{ | |||
| name: '未到期', | |||
| status: "4", | |||
| id: "4" | |||
| }, | |||
| { | |||
| name: '待缴', | |||
| status: "2", | |||
| id: '2' | |||
| }, | |||
| { | |||
| name: '欠缴', | |||
| status: "1", | |||
| id: "1" | |||
| }, | |||
| { | |||
| name: '待清算', | |||
| status: "7", | |||
| id: "7" | |||
| }, | |||
| { | |||
| name: '已结清', | |||
| status: "3", | |||
| id: "3" | |||
| }, | |||
| ], | |||
| starttime: null, | |||
| endtime: null, | |||
| billTypeValue: '1', | |||
| status: null, | |||
| allBillList: [], | |||
| oweBillList: [], | |||
| nearBillList: [] | |||
| }, | |||
| // 选项卡 | |||
| filterTab: function (e) { | |||
| let that = this; | |||
| console.log(e); | |||
| that.setData({ | |||
| loading: "" | |||
| }) | |||
| that.setData({ | |||
| idss: e.currentTarget.dataset.index, | |||
| pageIndex: 2 | |||
| }) | |||
| var data = [true, true, true], | |||
| index = e.currentTarget.dataset.index; | |||
| /** | |||
| * index == 0 | |||
| * 显示全部 | |||
| */ | |||
| if (index == 1) { | |||
| data[index] = !that.data.tab[index]; | |||
| let date = new Date; | |||
| let year = date.getFullYear(); | |||
| var month = ''; | |||
| if (date.getMonth() + 1 < 10) { | |||
| var month = '0' + (date.getMonth() + 1); | |||
| } else { | |||
| var month = date.getMonth() + 1; | |||
| } | |||
| that.setData({ | |||
| date: year + '-' + month, | |||
| date2: year + '-' + month, | |||
| tab: data | |||
| }) | |||
| } else { | |||
| data[index] = !that.data.tab[index]; | |||
| that.setData({ | |||
| tab: data | |||
| }) | |||
| } | |||
| }, | |||
| bindDateChange1: function (e) { | |||
| this.setData({ | |||
| date: e.detail.value, | |||
| }) | |||
| }, | |||
| bindDateChange2: function (e) { | |||
| this.setData({ | |||
| date2: e.detail.value | |||
| }) | |||
| }, | |||
| search: function (e) { | |||
| let that = this; | |||
| let billTypeValue = e.target.dataset.billtypevalue; | |||
| let status = e.target.dataset.status; | |||
| if (billTypeValue) { | |||
| this.setData({ | |||
| billTypeValue: e.target.dataset.billtypevalue ? e.target.dataset.billtypevalue : '' | |||
| }) | |||
| } | |||
| if (e.target.dataset.id) { | |||
| that.setData({ | |||
| typeid: e.target.dataset.id | |||
| }) | |||
| } else if (e.target.dataset.id1) { | |||
| that.setData({ | |||
| typeid1: e.target.dataset.id1 | |||
| }) | |||
| } | |||
| var data = [true, true, true], | |||
| index = e.currentTarget.dataset.index; | |||
| /** | |||
| * 点击过查询 | |||
| */ | |||
| if (e.currentTarget.dataset.index == 'dateindex1') { | |||
| data[index] = !that.data.tab[index]; | |||
| that.setData({ | |||
| tab: data, | |||
| flagdate: "flagdate" | |||
| }); | |||
| that.getList(that.data.date, that.data.date2, that.data.billTypeValue, status, 1); | |||
| } else { | |||
| data[index] = !that.data.tab[index]; | |||
| that.setData({ | |||
| tab: data | |||
| }); | |||
| if (that.data.flagdate == 'flagdate') { | |||
| that.getList(that.data.date, that.data.date2, that.data.billTypeValue, status, 1); | |||
| } else { | |||
| that.getList(null, null, that.data.billTypeValue, status, 1); | |||
| } | |||
| } | |||
| }, | |||
| goUploading(e) { | |||
| let item = e.currentTarget.dataset.data | |||
| console.log(item) | |||
| let id = e.currentTarget.dataset.id | |||
| wx.navigateTo({ | |||
| url: `/pages/bill/voucher/voucher?id=${id}&billTypeValue=${this.data.billTypeValue}&newPrice=${item.needPay}`, | |||
| }) | |||
| }, | |||
| /** | |||
| * gotolook点击查看 | |||
| */ | |||
| gotolook: function (e) { | |||
| var billTypeValue = e.currentTarget.dataset.data.billType; | |||
| let billId = e.currentTarget.dataset.data.billId; | |||
| wx.navigateTo({ | |||
| url: `/pages/bill/billdetail/index?billTypeValue=${billTypeValue}&billId=${billId}`, | |||
| }) | |||
| }, | |||
| goPay(e) { | |||
| var billTypeValue = e.currentTarget.dataset.data.billType; | |||
| let billId = e.currentTarget.dataset.data.billId; | |||
| wx.navigateTo({ | |||
| url: `/pages/bill/pay/index?billTypeValue=${billTypeValue}&billId=${billId}`, | |||
| }) | |||
| }, | |||
| gotolook02(e) { | |||
| console.log(e, 333) | |||
| let receivePay = e.currentTarget.dataset.data.receivePay; | |||
| let status = e.currentTarget.dataset.data.status; | |||
| let id = e.currentTarget.dataset.data.id; | |||
| var settle_number = e.currentTarget.dataset.data.settle_number; | |||
| var billTypeValue = e.currentTarget.dataset.data.billTypeValue; | |||
| var freeze = e.currentTarget.dataset.data.freeze; | |||
| let owe = e.currentTarget.dataset.data.owe; | |||
| let merchantId = e.currentTarget.dataset.data.merchantId | |||
| wx.navigateTo({ | |||
| url: `/pages/bill/billdetail/index?receivePay=${receivePay}&status=${status}&id=${id}&settle_number=${settle_number}&billTypeValue=${billTypeValue}&freeze=${freeze}&owe=${owe}&merchantId=${merchantId}`, | |||
| }) | |||
| }, | |||
| onShow() { | |||
| let that = this; | |||
| //获取完整的日期 | |||
| let date = new Date; | |||
| let year = date.getFullYear(); | |||
| let month = date.getMonth() + 1; | |||
| that.setData({ | |||
| pageIndex: 2, | |||
| date: year + '-' + month, | |||
| date2: year + '-' + month, | |||
| }) | |||
| that.getList(null, null, that.data.billTypeValue, null, 1); | |||
| // wx.showLoading({ | |||
| // title: '加载中...', | |||
| // }) | |||
| setTimeout(function () { | |||
| wx.hideLoading(); | |||
| }, 1500) | |||
| }, | |||
| getList: function (starttime, endtime, billTypeValue, status, pageIndex) { | |||
| let that = this; | |||
| that.setData({ | |||
| starttime01: starttime || null, | |||
| endtime01: endtime || null, | |||
| billTypeValue01: billTypeValue || null, | |||
| status01: status || null | |||
| }) | |||
| Http.getRequest(config.api.notifyList, app.globalData.token, '', {}, (res) => { | |||
| if (res.data && res.data && res.data.length >= 0) { | |||
| res.data.map(file => { | |||
| file.starttime = file.starttime ? util.formatTime(Number(file.starttime), "yyyy.MM.dd ") : ''; | |||
| file.endtime = file.starttime ? util.formatTime(Number(file.endtime), "yyyy.MM.dd ") : ''; | |||
| }) | |||
| that.setData({ | |||
| allBillList: res.data, | |||
| }) | |||
| } | |||
| }) | |||
| Http.getRequest(config.api.nearBillList, app.globalData.token, '', {}, (res) => { | |||
| if (res.data && res.data && res.data.length >= 0) { | |||
| res.data.map(file => { | |||
| file.starttime = file.starttime ? util.formatTime(Number(file.starttime), "yyyy.MM.dd ") : ''; | |||
| file.endtime = file.starttime ? util.formatTime(Number(file.endtime), "yyyy.MM.dd ") : ''; | |||
| }) | |||
| that.setData({ | |||
| nearBillList: res.data, | |||
| }) | |||
| } | |||
| }) | |||
| Http.getRequest(config.api.oweBillList, app.globalData.token, '', {}, (res) => { | |||
| if (res.data && res.data && res.data.length >= 0) { | |||
| res.data.map(file => { | |||
| file.starttime = file.starttime ? util.formatTime(Number(file.starttime), "yyyy.MM.dd ") : ''; | |||
| file.endtime = file.starttime ? util.formatTime(Number(file.endtime), "yyyy.MM.dd ") : ''; | |||
| }) | |||
| that.setData({ | |||
| oweBillList: res.data, | |||
| }) | |||
| } | |||
| }) | |||
| }, | |||
| gosearch() { | |||
| wx.navigateTo({ | |||
| url: `/pages/bill/query/index`, | |||
| }) | |||
| }, | |||
| onReachBottom() { | |||
| let that = this; | |||
| let pageIndex = that.data.pageIndex++; | |||
| that.getList(that.data.starttime01, that.data.endtime01, that.data.billTypeValue01, that.data.status01, pageIndex); | |||
| } | |||
| }); | |||
| @@ -0,0 +1,3 @@ | |||
| { | |||
| "navigationBarTitleText": "账单" | |||
| } | |||
| @@ -0,0 +1,101 @@ | |||
| <view class="search" bindtap='gosearch'>账单高级查询</view> | |||
| <view class="title"><image src='../../static/images/icon1.png' mode='widthFix'></image>【催缴】:您有 <text>{{allBillList.length}} </text>条账单被催缴,请尽快处理!</view> | |||
| <view class="table"> | |||
| <view class="tr bg-w"> | |||
| <view class="th">账单类型</view> | |||
| <view class="th">账单周期</view> | |||
| <view class="th">应付金额</view> | |||
| <view class="th">已付金额</view> | |||
| <view class="th">欠费金额</view> | |||
| <view class="th">操作</view> | |||
| </view> | |||
| <block wx:for="{{allBillList}}" wx:key="index"> | |||
| <view class="tr"> | |||
| <view class="td">{{item.billTypeName}}</view> | |||
| <view class="td">起:{{item.starttime}} <text>止:{{item.endtime}}</text></view> | |||
| <view class="td">{{item.receivePay}}</view> | |||
| <view class="td">{{item.pay}}</view> | |||
| <view class="td">{{item.owe}}</view> | |||
| <view class="td"> | |||
| <button class='btn' bindtap='gotolook' data-data='{{item}}' data-id='{{item.id}}'> | |||
| 查看 | |||
| </button> | |||
| <button class='btn' bindtap='goPay' data-data='{{item}}' data-id='{{item.id}}'> | |||
| 缴费 | |||
| </button> | |||
| </view> | |||
| </view> | |||
| </block> | |||
| </view> | |||
| <view class="title"><image src='../../static/images/icon2.png' mode='widthFix'></image>【逾期账单】:您有 <text>{{oweBillList.length}} </text>条逾期账单,请尽快处理!</view> | |||
| <view class="table"> | |||
| <view class="tr bg-w"> | |||
| <view class="th">账单类型</view> | |||
| <view class="th">账单周期</view> | |||
| <view class="th">应付金额</view> | |||
| <view class="th">已付金额</view> | |||
| <view class="th">欠费金额</view> | |||
| <view class="th">操作</view> | |||
| </view> | |||
| <block wx:for="{{oweBillList}}" wx:key="index"> | |||
| <view class="tr"> | |||
| <view class="td">{{item.billTypeName}}</view> | |||
| <view class="td">起:{{item.starttime}} <text>止:{{item.endtime}}</text></view> | |||
| <view class="td">{{item.receivePay}}</view> | |||
| <view class="td">{{item.pay}}</view> | |||
| <view class="td">{{item.owe}}</view> | |||
| <view class="td"> | |||
| <button class='btn' bindtap='gotolook' data-data='{{item}}' data-id='{{item.id}}'> | |||
| 查看 | |||
| </button> | |||
| <button class='btn' bindtap='goPay' data-data='{{item}}' data-id='{{item.id}}'> | |||
| 缴费 | |||
| </button> | |||
| </view> | |||
| </view> | |||
| </block> | |||
| </view> | |||
| <view class="title"><image src='../../static/images/icon3.png' mode='widthFix'></image>【临期账单】:您有 <text>{{nearBillList.length}} </text>条临期缴费账单,请及时处理!</view> | |||
| <view class="table"> | |||
| <view class="tr bg-w"> | |||
| <view class="th">账单类型</view> | |||
| <view class="th">账单周期</view> | |||
| <view class="th">应付金额</view> | |||
| <view class="th">已付金额</view> | |||
| <view class="th">欠费金额</view> | |||
| <view class="th">操作</view> | |||
| </view> | |||
| <block wx:for="{{nearBillList}}" wx:key="index"> | |||
| <view class="tr"> | |||
| <view class="td">{{item.billTypeName}}</view> | |||
| <view class="td">起:{{item.starttime}} <text>止:{{item.endtime}}</text></view> | |||
| <view class="td">{{item.receivePay}}</view> | |||
| <view class="td">{{item.pay}}</view> | |||
| <view class="td">{{item.owe}}</view> | |||
| <view class="td"> | |||
| <button class='btn' bindtap='gotolook' data-data='{{item}}' data-id='{{item.id}}'> | |||
| 查看 | |||
| </button> | |||
| <button class='btn' bindtap='goPay' data-data='{{item}}' data-id='{{item.id}}'> | |||
| 缴费 | |||
| </button> | |||
| </view> | |||
| </view> | |||
| </block> | |||
| </view> | |||
| <!-- <scroll-view wx:if="{{allBillList.length>0}}" scroll-top="{{scrollTop}}" scroll-y="true" style="height:{{scrollHeight}}px;" bindscrolltolower="bindDownLoad" bindscroll="scroll"> --> | |||
| <!-- </scroll-view> --> | |||
| <view class="loading {{allBillList.length==0?'mr':''}}">{{loading}}</view> | |||
| <!-- 查询列表 无结果 --> | |||
| <!-- <view class='recond' wx:if="{{allBillList.length==0}}">暂无数据!</view> --> | |||
| @@ -0,0 +1,289 @@ | |||
| page { | |||
| padding: 0 0 30rpx; | |||
| } | |||
| .tabTit { | |||
| height: 90rpx; | |||
| line-height: 82rpx; | |||
| position: fixed; | |||
| top: 0; | |||
| width: 750rpx; | |||
| z-index: 1; | |||
| } | |||
| .tabTit > view:nth-of-type(1) { | |||
| border-left: 0; | |||
| } | |||
| .tabTit > view:nth-of-type(4) { | |||
| border-right: 0; | |||
| } | |||
| .tabTit .active image { | |||
| transform: rotate(180deg); | |||
| background: none; | |||
| } | |||
| .tabTit image { | |||
| width: 18rpx; | |||
| height: 9rpx; | |||
| vertical-align: middle; | |||
| margin-left: 5px; | |||
| } | |||
| .tabLayer { | |||
| width: 750rpx; | |||
| overflow: hidden; | |||
| position: fixed; | |||
| top: 90rpx; | |||
| z-index: 1; | |||
| background: #fff; | |||
| padding-bottom: 26rpx; | |||
| box-shadow:2px 9px 10px rgba(0, 0, 0, 0.05); | |||
| bottom: 0; | |||
| border-top:1px solid #eee; | |||
| } | |||
| .tabLayer a { | |||
| float: left; | |||
| width: 210rpx; | |||
| height: 80rpx; | |||
| line-height: 80rpx; | |||
| margin: 30rpx 0 0 26rpx; | |||
| text-align: center; | |||
| color: #888; | |||
| font-size: 30rpx; | |||
| background: rgba(255, 255, 255, 1); | |||
| border: 1px solid rgba(234, 234, 234, 1); | |||
| border-radius: 10rpx; | |||
| } | |||
| .tabLayer .active { | |||
| text-align: center; | |||
| height: 80rpx; | |||
| background: rgba(255, 255, 255, 1); | |||
| border: 1px solid rgba(101, 158, 246, 1); | |||
| border-radius: 10rpx; | |||
| color: #659ef6; | |||
| } | |||
| .tabTit .active { | |||
| background: #fff; | |||
| font-size: 32prx; | |||
| font-weight: 500; | |||
| color: rgba(101, 158, 246, 1); | |||
| } | |||
| /*弹性盒模型*/ | |||
| .box { | |||
| background: #fff; | |||
| border-bottom:1px solid #eee; | |||
| } | |||
| .flex1 { | |||
| overflow: hidden; | |||
| width: 25%; | |||
| display: block; | |||
| text-align: center; | |||
| } | |||
| .flex1 text,.text { | |||
| font-size: 30rpx; | |||
| } | |||
| .text{ | |||
| display: block; | |||
| width: 25%; | |||
| text-align: center; | |||
| } | |||
| /* 日期选择 */ | |||
| .picker_group { | |||
| height: 85rpx; | |||
| line-height: 85rpx; | |||
| justify-content: center; | |||
| display: flex; | |||
| align-items: center; | |||
| font-size: 30rpx; | |||
| color: #888; | |||
| } | |||
| .picker_group picker { | |||
| height: 55rpx; | |||
| line-height: 55rpx; | |||
| margin: 0 2%; | |||
| padding: 2% 5%; | |||
| border-bottom: 1px solid #eee; | |||
| } | |||
| .view view:nth-of-type(1) { | |||
| font-size: 28rpx; | |||
| color: #888; | |||
| } | |||
| .list { | |||
| width: 644rpx; | |||
| border-radius: 16rpx; | |||
| padding: 32rpx; | |||
| margin: 40rpx auto; | |||
| box-shadow: 0 6px 20px 0 rgba(0, 0, 0, 0.1); | |||
| } | |||
| .list >view { | |||
| height: 60rpx; | |||
| line-height: 60rpx; | |||
| font-size: 30rpx; | |||
| } | |||
| .txt1 { | |||
| font-size: 32rpx; | |||
| font-weight: 500; | |||
| color: rgba(85, 85, 85, 1); | |||
| } | |||
| .txt2 { | |||
| font-size: 28rpx; | |||
| font-weight: 500; | |||
| color: rgba(255, 106, 106, 1); | |||
| } | |||
| .money { | |||
| font-weight: 500; | |||
| color: rgba(85, 85, 85, 1); | |||
| font-size: 26rpx; | |||
| /* width: 123rpx; */ | |||
| padding-right: 20rpx; | |||
| } | |||
| .time { | |||
| font-size: 28rpx; | |||
| font-weight: 500; | |||
| color: rgba(125, 125, 125, 1); | |||
| } | |||
| .status1 { | |||
| color: #659ef6; | |||
| } | |||
| .status2 { | |||
| color: #eea959; | |||
| } | |||
| .status3 { | |||
| color: #ff6a6a; | |||
| } | |||
| .status4 { | |||
| color: #8aaa6b; | |||
| } | |||
| .btn { | |||
| float: right; | |||
| height: 52rpx; | |||
| line-height: 52rpx; | |||
| background: rgba(101, 158, 246, 1); | |||
| border-radius: 10rpx; | |||
| font-size: 28rpx; | |||
| font-weight: 500; | |||
| padding: 0 25rpx; | |||
| color: rgba(255, 255, 255, 1); | |||
| } | |||
| .active1 { | |||
| opacity: 0.6; | |||
| } | |||
| .btns { | |||
| width:137rpx; | |||
| margin-top: 21rpx; | |||
| background: #52a0fd; | |||
| border-radius: 8rpx; | |||
| color: #fff; | |||
| font-size: 26rpx; | |||
| height: 64rpx; | |||
| line-height: 64rpx; | |||
| } | |||
| .active2{ | |||
| border: 1px solid #52a0fd!important; | |||
| color: #52a0fd!important; | |||
| } | |||
| .recond{ | |||
| text-align: center; | |||
| font-size: 30rpx; | |||
| margin-top: 60rpx; | |||
| } | |||
| .active3{ | |||
| color: #659ef6; | |||
| } | |||
| .loading{ | |||
| text-align: center; | |||
| font-size: 28rpx; | |||
| color: #999; | |||
| /* padding: 20rpx 0 40rpx; */ | |||
| } | |||
| .mr{ | |||
| margin-top: 200rpx!important; | |||
| } | |||
| .uploading{ | |||
| margin-left: 10rpx; | |||
| } | |||
| .lists{ | |||
| height: 100%; | |||
| } | |||
| .table { | |||
| border: 0px solid darkgray; | |||
| border-top: 1rpx dashed #222; | |||
| border-bottom: 20rpx solid #eee; | |||
| padding-bottom: 20rpx; | |||
| } | |||
| .tr { | |||
| display: flex; | |||
| width: 100%; | |||
| justify-content: center; | |||
| height: 3rem; | |||
| align-items: center; | |||
| border-bottom: 1rpx dashed #222; | |||
| } | |||
| .td { | |||
| width:40%; | |||
| justify-content: center; | |||
| text-align: center; | |||
| font-size: 23rpx; | |||
| } | |||
| .td text{ | |||
| font-size: 23rpx; | |||
| } | |||
| .bg-w{ | |||
| background: snow; | |||
| } | |||
| .bg-g{ | |||
| background: #E6F3F9; | |||
| } | |||
| .th { | |||
| width: 40%; | |||
| justify-content: center; | |||
| display: flex; | |||
| height: 2rem; | |||
| align-items: center; | |||
| text-align: center; | |||
| font-size: 26rpx; | |||
| } | |||
| .title{ | |||
| font-size: 30rpx; | |||
| line-height: 3rem; | |||
| } | |||
| .title text{ | |||
| color: red; | |||
| } | |||
| .title image{ | |||
| width: 44rpx; | |||
| vertical-align: middle; | |||
| } | |||
| .search{ | |||
| line-height: 2rem; | |||
| text-align: right; | |||
| padding-right: 20rpx; | |||
| font-size: 30rpx; | |||
| border-bottom: 20rpx solid #eee; | |||
| } | |||
| @@ -0,0 +1,177 @@ | |||
| var app = getApp(); | |||
| const config = require('../../../config/config.js') | |||
| const util = require('../../../utils/util.js') | |||
| const Http = require('../../../utils/http.js') | |||
| Page({ | |||
| /** | |||
| * 页面的初始数据 | |||
| */ | |||
| data: { | |||
| billTypeValue: '', | |||
| billId: '', | |||
| flag: false, | |||
| detailData: {}, | |||
| list: [] | |||
| }, | |||
| onLoad: function (options) { | |||
| let that = this; | |||
| console.log(options, 'options'); | |||
| that.setData({ | |||
| billTypeValue: options.billTypeValue, | |||
| billId: options.billId, | |||
| flag: options.flag === 'mall' | |||
| }) | |||
| this.getData() | |||
| }, | |||
| getData() { | |||
| Http.getRequest(this.data.flag ? config.api.mallbillDetail : config.api.billDetail, app.globalData.token, '', { | |||
| billId: this.data.billId, | |||
| billTypeValue: this.data.billTypeValue, | |||
| }, (res) => { | |||
| if (res.code === 200) { | |||
| res.data.starttime = res.data.starttime ? util.formatTime(Number(res.data.starttime), "yyyy.MM.dd ") : ''; | |||
| res.data.endtime = res.data.starttime ? util.formatTime(Number(res.data.endtime), "yyyy.MM.dd ") : ''; | |||
| this.setData({ | |||
| detailData: res.data | |||
| }) | |||
| } | |||
| }) | |||
| Http.getRequest(config.api.billActionlist, app.globalData.token, '', { | |||
| billId: this.data.billId, | |||
| pageNum: 1, | |||
| pageSize: 1000, | |||
| }, (res) => { | |||
| if (res.code === 200) { | |||
| res.data.list.forEach(ele => { | |||
| ele.createtime = ele.createtime ? util.formatTime(Number(ele.createtime), "yyyy.MM.dd ") : ''; | |||
| }) | |||
| this.setData({ | |||
| list: res.data.list | |||
| }) | |||
| } | |||
| }) | |||
| }, | |||
| goBack() { | |||
| wx.navigateBack({ | |||
| delta: 1 | |||
| }) | |||
| }, | |||
| /** | |||
| * 查看结算单详情 | |||
| */ | |||
| godetail() { | |||
| wx.navigateTo({ | |||
| url: `/pages/statementsDetail/index?id=${this.data.billId}`, | |||
| }) | |||
| }, | |||
| makePhoneCall(e) { | |||
| const phone = e.currentTarget.dataset.phone | |||
| wx.makePhoneCall({ | |||
| phoneNumber: phone | |||
| }) | |||
| }, | |||
| /** | |||
| * 更新订单的状态 | |||
| */ | |||
| updatePayBill: function (billId, status, reason, type) { | |||
| let that = this; | |||
| Http.postRequest(config.api.updatePayBill, app.globalData.token, '', { | |||
| billId: billId, | |||
| status: status, | |||
| reason: reason | |||
| }, (res) => { | |||
| }) | |||
| }, | |||
| /** | |||
| * @去支付 | |||
| */ | |||
| gotopay: function () { | |||
| let that = this; | |||
| wx.showLoading({ | |||
| title: '加载中', | |||
| }) | |||
| let bUserId = wx.getStorageSync("bUserId") ? wx.getStorageSync("bUserId") : app.globalData.bUserId; | |||
| if (bUserId && that.data.billId && app.globalData.openId && config.weapp.appId) { | |||
| Http.postRequest(config.api.createorder, app.globalData.token, '', { | |||
| bUserId: bUserId, | |||
| billId: that.data.billId, | |||
| openId: app.globalData.openId, | |||
| appId: config.weapp.appId, | |||
| billTypeValue: that.data.billTypeValue, | |||
| merchantId: that.data.merchantId | |||
| }, (res) => { | |||
| console.log(res); | |||
| if (res.code == 200) { | |||
| // that.setData({ | |||
| // payBillId: res.data.payBillId | |||
| // }) | |||
| wx.requestPayment({ | |||
| timeStamp: res.data.timeStamp, | |||
| nonceStr: res.data.nonceStr, | |||
| package: res.data.package, | |||
| signType: res.data.signType ? res.data.signType : 'MD5', | |||
| paySign: res.data.paySign, | |||
| success(res) { | |||
| console.log(res); | |||
| wx.hideLoading(); | |||
| that.updatePayBill(that.data.billId, 1, res.errMsg, "fail"); | |||
| wx.showModal({ | |||
| title: '提示', | |||
| content: '支付成功', | |||
| showCancel: false, | |||
| success: function (res) { | |||
| if (res.confirm) { | |||
| wx.switchTab({ | |||
| url: '/pages/bill/bill', | |||
| }) | |||
| } | |||
| } | |||
| }) | |||
| }, | |||
| fail(res) { | |||
| console.log(res); | |||
| wx.hideLoading(); | |||
| that.updatePayBill(that.data.billId, 2, res.errMsg, "cancel"); | |||
| wx.showModal({ | |||
| title: '支付消息', | |||
| showCancel: false, | |||
| content: "支付取消", | |||
| success: function (res) { | |||
| console.log(res); | |||
| wx.switchTab({ | |||
| url: '/pages/bill/bill', | |||
| }) | |||
| }, | |||
| fail: function (res) { | |||
| console.log(res); | |||
| } | |||
| }) | |||
| } | |||
| }) | |||
| } else { | |||
| wx.hideLoading(); | |||
| wx.showModal({ | |||
| title: '支付失败', | |||
| showCancel: false, | |||
| content: res.message, | |||
| success: function (res) { | |||
| console.log(res); | |||
| wx.switchTab({ | |||
| url: '/pages/bill/bill', | |||
| }) | |||
| }, | |||
| fail: function (res) { | |||
| console.log(res); | |||
| } | |||
| }) | |||
| } | |||
| }) | |||
| } else { | |||
| wx.hideLoading(); | |||
| } | |||
| } | |||
| }) | |||
| @@ -0,0 +1,3 @@ | |||
| { | |||
| "navigationBarTitleText": "账单详情" | |||
| } | |||
| @@ -0,0 +1,74 @@ | |||
| <view class='list'> | |||
| <view class='clearfix'> | |||
| <text class='fl'>账单编号:</text> | |||
| <text class='fr'>{{detailData.merchantId}}</text> | |||
| </view> | |||
| <view class='clearfix'> | |||
| <text class='fl'>账单类型:</text> | |||
| <text class='fr'>{{detailData.billTypeName}}</text> | |||
| </view> | |||
| <view class='clearfix'> | |||
| <text class='fl'>账单周期:</text> | |||
| <text class='fr'>{{detailData.starttime}}至{{detailData.endtime}}</text> | |||
| </view> | |||
| <view class='clearfix'> | |||
| <text class='fl'>应付金额:</text> | |||
| <text class='fr'>{{detailData.receivePay}}</text> | |||
| </view> | |||
| <view class='clearfix'> | |||
| <text class='fl'>已付金额:</text> | |||
| <text class='fr'>{{detailData.pay}}</text> | |||
| </view> | |||
| <view class='clearfix'> | |||
| <text class='fl'>欠费金额:</text> | |||
| <button wx:if="{{!flag}}" class='fr' hover-class="actives" bindtap="gotopay">去缴费</button> | |||
| <text class='fr'>{{detailData.owe}} | |||
| </text> | |||
| </view> | |||
| <view class='clearfix'> | |||
| <text class='fl'>账单备注:</text> | |||
| <text class='fr'>{{detailData.remark}}</text> | |||
| </view> | |||
| <view class='clearfix'> | |||
| <text class='fl'>商户名称:</text> | |||
| <text class='fr'>{{detailData.merchantName}}</text> | |||
| </view> | |||
| <view class='clearfix'> | |||
| <text class='fl'>商户联系信息:</text> | |||
| <text class='fr'>{{detailData.merchantLinkPerson}}</text> | |||
| </view> | |||
| <view class='clearfix'> | |||
| <text class='fl'>手机号:</text> | |||
| <text> | |||
| <text style="color:#409eff;margin-left:20rpx;" class='fr' data-phone="{{detailData.merchantPhone}}" bindtap="makePhoneCall">拨打</text> | |||
| <text class='fr'>{{detailData.merchantPhone}}</text> | |||
| </text> | |||
| </view> | |||
| </view> | |||
| <view class="btn"> | |||
| <button hover-class="actives" bindtap="goBack">返回</button> | |||
| </view> | |||
| <view class='clearfix'> | |||
| <text class='fl'>账单历史</text> | |||
| </view> | |||
| <view class="table"> | |||
| <view class="tr bg-w"> | |||
| <view class="th">操作用户</view> | |||
| <view class="th">手机号</view> | |||
| <view class="th">操作描述</view> | |||
| <view class="th">日期</view> | |||
| <view class="th">备注</view> | |||
| </view> | |||
| <block wx:for="{{list}}" wx:key="index"> | |||
| <view class="tr"> | |||
| <view class="td">{{item.userName}}</view> | |||
| <view class="td">{{item.phone}}</view> | |||
| <view class="td">{{item.details}}</view> | |||
| <view class="td">{{item.createtime}}</view> | |||
| <view class="td">{{item.remark}}</view> | |||
| </view> | |||
| </block> | |||
| </view> | |||
| @@ -0,0 +1,127 @@ | |||
| page { | |||
| height: 100%; | |||
| background: #f6f6f8; | |||
| } | |||
| .list { | |||
| background: #fff; | |||
| width: 710rpx; | |||
| margin: 30rpx auto; | |||
| border-radius:16rpx; | |||
| box-shadow:0 6px 20px 0 rgba(0, 0, 0, 0.1); | |||
| } | |||
| .fl{ | |||
| color: #999; | |||
| font-size: 30rpx; | |||
| } | |||
| .fr{ | |||
| color: #333; | |||
| font-size: 26rpx; | |||
| } | |||
| .clearfix { | |||
| height: 87rpx; | |||
| line-height: 87rpx; | |||
| width: 660rpx; | |||
| margin: 0 auto; | |||
| font-size: 30rpx; | |||
| border-bottom: 1px solid #f6f6f8; | |||
| } | |||
| .txt04{ | |||
| color: #659ef6; | |||
| } | |||
| .txt02{ | |||
| color: #eea959; | |||
| } | |||
| .txt01{ | |||
| color: #ff6a6a; | |||
| } | |||
| .txt03{ | |||
| color: #8aaa6b; | |||
| } | |||
| .btn{ | |||
| width: 95%; | |||
| margin: 30rpx auto; | |||
| } | |||
| .btn button{ | |||
| background: #659ef6; | |||
| color: #fff; | |||
| height: 86rpx; | |||
| line-height: 86rpx; | |||
| border:none; | |||
| } | |||
| .actives{ | |||
| opacity: .6; | |||
| } | |||
| @font-face { | |||
| font-family: 'iconfont'; /* project id 1353693 */ | |||
| src: url('//at.alicdn.com/t/font_1353693_ur939r0g15.eot'); | |||
| src: url('//at.alicdn.com/t/font_1353693_ur939r0g15.eot?#iefix') format('embedded-opentype'), | |||
| url('//at.alicdn.com/t/font_1353693_ur939r0g15.woff2') format('woff2'), | |||
| url('//at.alicdn.com/t/font_1353693_ur939r0g15.woff') format('woff'), | |||
| url('//at.alicdn.com/t/font_1353693_ur939r0g15.ttf') format('truetype'), | |||
| url('//at.alicdn.com/t/font_1353693_ur939r0g15.svg#iconfont') format('svg'); | |||
| } | |||
| .iconfont { | |||
| font-family:"iconfont" !important; | |||
| font-size:30rpx; | |||
| font-style:normal; | |||
| -webkit-font-smoothing: antialiased; | |||
| -moz-osx-font-smoothing: grayscale; | |||
| } | |||
| .arrow-right:before { content: "\e601"} | |||
| .clearfix button { | |||
| margin-left: 20rpx; | |||
| margin-top: 10rpx; | |||
| } | |||
| .table { | |||
| border: 0px solid darkgray; | |||
| border-top: 1rpx dashed #222; | |||
| } | |||
| .tr { | |||
| display: flex; | |||
| width: 100%; | |||
| justify-content: center; | |||
| height: 3rem; | |||
| align-items: center; | |||
| border-bottom: 1rpx dashed #222; | |||
| } | |||
| .td { | |||
| width:40%; | |||
| justify-content: center; | |||
| text-align: center; | |||
| font-size: 23rpx; | |||
| } | |||
| .td text{ | |||
| font-size: 23rpx; | |||
| } | |||
| .bg-w{ | |||
| background: snow; | |||
| } | |||
| .bg-g{ | |||
| background: #E6F3F9; | |||
| } | |||
| .th { | |||
| width: 40%; | |||
| justify-content: center; | |||
| display: flex; | |||
| height: 2rem; | |||
| align-items: center; | |||
| text-align: center; | |||
| font-size: 26rpx; | |||
| } | |||
| .title{ | |||
| font-size: 30rpx; | |||
| line-height: 3rem; | |||
| } | |||
| .btn button{ | |||
| background:#409EFF; | |||
| color: #fff; | |||
| width: 90%; | |||
| margin: 0 auto; | |||
| border: none; | |||
| } | |||
| @@ -0,0 +1,434 @@ | |||
| var app = getApp(); | |||
| const config = require('../../../config/config.js') | |||
| const util = require('../../../utils/util.js') | |||
| const Http = require('../../../utils/HttpBasics.js') | |||
| Page({ | |||
| /** | |||
| * 页面的初始数据 | |||
| */ | |||
| data: { | |||
| actions: [ | |||
| // { name: "抄电", id: 1 }, | |||
| // { name: "抄水", id: 2 }, | |||
| // { name: "抄燃气", id: 3 } | |||
| ], | |||
| actionID: 1, | |||
| timeIndex: 0, | |||
| typeIndex: 0, | |||
| searchIndex: 0, | |||
| timeArr: ['区间1', '区间2', '区间3', '区间4'], | |||
| typeArr: ['用户表', '公共表'], | |||
| searchArr: ['按表号查询', '按店铺查询'], | |||
| shopNumber: "", | |||
| searchKey: "", | |||
| buildIndex: 0, | |||
| floorIndex: 0, | |||
| shopIndex: 0, | |||
| isShowBuilding: false, | |||
| isShowfloor: false, | |||
| isShowshop: false, | |||
| buildArr: [], | |||
| floorArr: [], | |||
| shopArr: [], | |||
| building: "", | |||
| floor: "", | |||
| preShopReadingList: [], | |||
| date: "2024-08-28", //默认起始时间 | |||
| date2: "2024-08-28", //默认结束时间 | |||
| }, | |||
| goAction(e) { | |||
| const id = e.target.dataset.id | |||
| this.setData({ | |||
| actionID: id | |||
| }) | |||
| }, | |||
| bindSelectChange(e) { | |||
| const index = e.target.dataset.index | |||
| const value = e.detail.value | |||
| console.log(value, 'value'); | |||
| this.setData({ | |||
| searchKey: "" | |||
| }) | |||
| if (index == "timeIndex") { | |||
| this.setData({ | |||
| timeIndex: value | |||
| }) | |||
| } else if (index == "typeIndex") { | |||
| this.setData({ | |||
| typeIndex: value, | |||
| }) | |||
| } else if (index == "searchIndex") { | |||
| this.setData({ | |||
| searchIndex: value, | |||
| }) | |||
| } else if (index == "buildIndex") { | |||
| this.setData({ | |||
| building: this.data.buildArr[value].id, | |||
| buildIndex: value, | |||
| isShowBuilding: true, | |||
| floorArr: this.data.buildArr[value].floors | |||
| }) | |||
| } else if (index == "floorIndex") { | |||
| // wx.showLoading({ | |||
| // title: '请稍等', | |||
| // }) | |||
| // this.getShopList(this.data.floorArr[value].id) | |||
| this.setData({ | |||
| floor: this.data.floorArr[value].id, | |||
| floorIndex: value, | |||
| isShowfloor: true, | |||
| }) | |||
| } else if (index == "shopIndex") { | |||
| this.setData({ | |||
| shopIndex: value, | |||
| isShowshop: true, | |||
| }) | |||
| } | |||
| }, | |||
| changeShopNumber(e) { | |||
| const value = e.detail.value | |||
| this.setData({ | |||
| shopNumber: value | |||
| }) | |||
| }, | |||
| changeSearchKey(e) { | |||
| const value = e.detail.value | |||
| this.setData({ | |||
| searchKey: value | |||
| }) | |||
| }, | |||
| getbuildingfloorlist() { | |||
| Http.get({ | |||
| url: config.api.getbuildingfloorlist | |||
| }) | |||
| .then(res => { | |||
| console.log(res.data) | |||
| this.setData({ | |||
| buildArr: res.data | |||
| }) | |||
| }) | |||
| .catch(err => { | |||
| }); | |||
| }, | |||
| getShopList(floor) { | |||
| Http.get({ | |||
| url: config.api.getShopList + floor | |||
| }) | |||
| .then(res => { | |||
| console.log(res.data.list) | |||
| this.setData({ | |||
| shopArr: res.data.list | |||
| }) | |||
| wx.hideLoading() | |||
| }) | |||
| .catch(err => { | |||
| }); | |||
| }, | |||
| getShopMeterList() { | |||
| let type = this.data.actionID | |||
| // let shopNumber = this.data.shopNumber | |||
| // let shopId = this.data.shopArr[this.data.shopIndex].id | |||
| // if (!shopId) shopId = "" | |||
| // const physicsType = this.data.typeIndex * 1 + 1 | |||
| const searchKey = this.data.searchKey | |||
| const building = this.data.building | |||
| const floor = this.data.floor | |||
| console.log(building, floor); | |||
| Http.get({ | |||
| // url: config.api.getShopMeterList + | |||
| // "physicsType=" + physicsType + | |||
| // "&type=" + type + | |||
| // "&shopId=" + shopId + | |||
| // "&shopNumber=" + shopNumber | |||
| url: config.api.getShopMeterList + | |||
| "searchKey=" + searchKey + | |||
| "&type=" + type + | |||
| "&building=" + building + | |||
| "&floor=" + floor | |||
| }) | |||
| .then(res => { | |||
| console.log(res.data) | |||
| this.setData({ | |||
| preShopReadingList: res.data.list | |||
| }) | |||
| res.data.list.forEach((item, index) => { | |||
| this.getPreShopReadingList(item.id, index) | |||
| }) | |||
| if (!res.data.list.length) { | |||
| wx.showToast({ | |||
| title: "该店铺暂无数据!", | |||
| icon: 'error', | |||
| duration: 2000, | |||
| mask: false | |||
| }); | |||
| } | |||
| }) | |||
| .catch(err => { | |||
| }); | |||
| }, | |||
| getPreShopReadingList(id, index) { | |||
| Http.get({ | |||
| url: config.api.preShopReadingList + id | |||
| }) | |||
| .then(res => { | |||
| try { | |||
| console.log(res, 'res', index); | |||
| const preShopReadingList = [...this.data.preShopReadingList] | |||
| if (res.data) { | |||
| res.data.formatTime = this.timestampToTime(res.data.preTime, "YYYY-MM-DD") | |||
| preShopReadingList[index].meterData = res.data | |||
| console.log(index, 'index1'); | |||
| } else { | |||
| const obj = { | |||
| meterId: id, | |||
| preNumber: "", | |||
| curNumber: "", | |||
| formatTime: "", | |||
| preByName: "" | |||
| } | |||
| preShopReadingList[index].meterData = obj | |||
| console.log(index, 'index2'); | |||
| } | |||
| this.setData({ | |||
| preShopReadingList | |||
| }) | |||
| console.log(preShopReadingList, 'preShopReadingList'); | |||
| } catch (error) { | |||
| console.log(error, 'err'); | |||
| } | |||
| }) | |||
| .catch(err => { | |||
| }); | |||
| }, | |||
| getMeterList() { | |||
| Http.get({ | |||
| url: config.api.meterList | |||
| }) | |||
| .then(res => { | |||
| const valus = Object.values(res.data) | |||
| const keys = Object.keys(res.data) | |||
| const arr = [] | |||
| valus.forEach((item, index) => { | |||
| const obj = { | |||
| id: keys[index] * 1, | |||
| name: item | |||
| } | |||
| arr.push(obj) | |||
| }) | |||
| this.setData({ | |||
| actions: arr | |||
| }) | |||
| console.log(this.data.actions, 'this.data.actions') | |||
| }) | |||
| .catch(err => { | |||
| }); | |||
| }, | |||
| getTimeList() { | |||
| Http.get({ | |||
| url: config.api.timeList + "?type=" + this.data.actionID | |||
| }) | |||
| .then(res => { | |||
| console.log(res.data) | |||
| res.data.list.forEach(item => { | |||
| item.period = item.period ? item.period : "*" | |||
| }) | |||
| this.setData({ | |||
| timeArr: res.data.list | |||
| }) | |||
| }) | |||
| .catch(err => { | |||
| }); | |||
| }, | |||
| numberInput(e) { | |||
| console.log(e, 'e'); | |||
| const index = e.currentTarget.dataset.index | |||
| const value = e.detail.value | |||
| const preShopReadingList = [...this.data.preShopReadingList] | |||
| preShopReadingList[index].meterData.curNumber = value | |||
| this.setData({ | |||
| preShopReadingList | |||
| }) | |||
| }, | |||
| bindDateChange(e) { | |||
| let that = this; | |||
| that.setData({ | |||
| date: e.detail.value, | |||
| }) | |||
| console.log(that.data.date) | |||
| }, | |||
| bindDateChange2(e) { | |||
| let that = this; | |||
| that.setData({ | |||
| date2: e.detail.value, | |||
| }) | |||
| console.log(that.data.date2) | |||
| }, | |||
| isConfirmTouched() { | |||
| wx.showToast({ | |||
| icon: "none", | |||
| title: "该表已确认,无法更改!", | |||
| }) | |||
| }, | |||
| save() { | |||
| const meterReadingList = this.data.preShopReadingList.map(item => { | |||
| const obj = { | |||
| meterId: item.id, | |||
| curNumber: item.meterData.curNumber, | |||
| } | |||
| if (item.meterData.id) { | |||
| obj.id = item.meterData.id | |||
| } | |||
| return obj | |||
| }) | |||
| Http.post({ | |||
| url: config.api.commitEnergyReading, | |||
| data: { | |||
| startTime: this.data.date + " 00:00:00", | |||
| endTime: this.data.date2 + " 23:59:59", | |||
| meterReadingList | |||
| } | |||
| }).then(res => { | |||
| wx.showToast({ | |||
| title: "保存成功!", | |||
| icon: 'none', | |||
| duration: 2000, | |||
| mask: false, | |||
| }); | |||
| this.getShopMeterList() | |||
| }).catch(err => { | |||
| wx.showToast({ | |||
| title: err.message ? err.message : "保存失败!", | |||
| icon: 'none', | |||
| duration: 2000, | |||
| mask: false | |||
| }); | |||
| }) | |||
| }, | |||
| /** | |||
| * @description 根据时间戳获取时间 | |||
| * @param {*} timestamp 必传,number类型,时间戳数据(10位及以下,10位至13位);若不传,则返回:“无时间戳” | |||
| * @param {*} format 选传,string类型,提供以下时间格式:YYYY-MM-DD hh:mm:ss、YYYY/MM/DD hh:mm:ss、YYYY.MM.DD hh:mm:ss、YYYY MM DD hh:mm:ss、YYYY年MM月DD日 hh:mm:ss、YYYY-MM-DD、YYYY/MM/DD、YYYY.MM.DD、YYYY MM DD、YYYY年MM月DD日;若不传,则默认为:YYYY-MM-DD | |||
| * @returns 根据要求的时间格式 | |||
| * @version V 1.0, Created by YWQ, 2022.10.20 | |||
| */ | |||
| timestampToTime(timestamp, format) { | |||
| //时间戳为10位需*1000,时间戳为13位不需乘1000 | |||
| if (!timestamp) return | |||
| const length = timestamp.length | |||
| if (length <= 10) { | |||
| var date = new Date(timestamp * 1000) | |||
| } else { | |||
| var date = new Date(timestamp) | |||
| } | |||
| let Y = String(date.getFullYear()) | |||
| let M = String(date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) | |||
| let D = String(date.getDate() + 1 < 10 ? '0' + (date.getDate()) : date.getDate()) | |||
| let h = String(date.getHours() + 1 < 10 ? '0' + (date.getHours()) : date.getHours()) | |||
| let m = String(date.getMinutes() + 1 < 10 ? '0' + (date.getMinutes()) : date.getMinutes()) | |||
| let s = String(date.getSeconds() + 1 < 10 ? '0' + (date.getSeconds()) : date.getSeconds()) | |||
| // return Y + M + D + h + m + s | |||
| if (format == "YYYY-MM-DD hh:mm:ss") { | |||
| return Y + "-" + M + "-" + D + " " + h + ":" + m + ":" + s | |||
| } else if (format == "YYYY/MM/DD hh:mm:ss") { | |||
| return Y + "/" + M + "/" + D + " " + h + ":" + m + ":" + s | |||
| } else if (format == "YYYY.MM.DD hh:mm:ss") { | |||
| return Y + "." + M + "." + D + " " + h + ":" + m + ":" + s | |||
| } else if (format == "YYYY MM DD hh:mm:ss") { | |||
| return Y + " " + M + " " + D + " " + h + ":" + m + ":" + s | |||
| } else if (format == "YYYY年MM月DD日 hh:mm:ss") { | |||
| return Y + "年" + M + "月" + D + "日" + " " + h + ":" + m + ":" + s | |||
| } else if (format == "YYYY-MM-DD") { | |||
| return Y + "-" + M + "-" + D | |||
| } else if (format == "YYYY/MM/DD") { | |||
| return Y + "/" + M + "/" + D | |||
| } else if (format == "YYYY.MM.DD") { | |||
| return Y + "." + M + "." + D | |||
| } else if (format == "YYYY MM DD") { | |||
| return Y + " " + M + " " + D | |||
| } else if (format == "YYYY年MM月DD日") { | |||
| return Y + "年" + M + "月" + D + "日" | |||
| } else { | |||
| return Y + "-" + M + "-" + D | |||
| } | |||
| }, | |||
| /** | |||
| * 生命周期函数--监听页面加载 | |||
| */ | |||
| onLoad(options) { | |||
| }, | |||
| /** | |||
| * 生命周期函数--监听页面初次渲染完成 | |||
| */ | |||
| onReady() { | |||
| }, | |||
| /** | |||
| * 生命周期函数--监听页面显示 | |||
| */ | |||
| onShow() { | |||
| Http.setToken(app.globalData.token) | |||
| this.getbuildingfloorlist() | |||
| this.getTimeList() | |||
| this.getMeterList() | |||
| }, | |||
| /** | |||
| * 生命周期函数--监听页面隐藏 | |||
| */ | |||
| onHide() { | |||
| }, | |||
| /** | |||
| * 生命周期函数--监听页面卸载 | |||
| */ | |||
| onUnload() { | |||
| }, | |||
| /** | |||
| * 页面相关事件处理函数--监听用户下拉动作 | |||
| */ | |||
| onPullDownRefresh() { | |||
| }, | |||
| /** | |||
| * 页面上拉触底事件的处理函数 | |||
| */ | |||
| onReachBottom() { | |||
| }, | |||
| /** | |||
| * 用户点击右上角分享 | |||
| */ | |||
| onShareAppMessage() { | |||
| } | |||
| }) | |||
| @@ -0,0 +1,3 @@ | |||
| { | |||
| "navigationBarTitleText": "新增抄表数据" | |||
| } | |||
| @@ -0,0 +1,182 @@ | |||
| <!-- pages/bill/meter/meter.wxml --> | |||
| <view class="page"> | |||
| <view class="tabBar" bindtap="goAction"> | |||
| <view wx:for="{{actions}}" wx:key="index" data-id="{{item.id}}" class="{{item.id=== actionID ?'item active':'item'}}"> | |||
| {{item.name}} | |||
| </view> | |||
| </view> | |||
| <view class="selectArea"> | |||
| <!-- <view class="timeSelect"> | |||
| <picker value="{{typeIndex}}" range="{{typeArr}}" bindchange="bindSelectChange" data-index="typeIndex"> | |||
| <view class="picker" style="text-indent: 1em;"> | |||
| 表类型:<text style="text-indent: 0;" class="pickerBorder">{{typeArr[typeIndex]}}</text> | |||
| </view> | |||
| </picker> | |||
| </view> --> | |||
| <view class='time'> | |||
| <view> | |||
| <text>开始日期</text> | |||
| <picker mode="date" value="{{date}}" end="{{date2}}" bindchange="bindDateChange"> | |||
| <view class="picker"> | |||
| {{date}} | |||
| </view> | |||
| </picker> | |||
| </view> | |||
| <view> | |||
| <text></text> | |||
| <text>至</text> | |||
| </view> | |||
| <view> | |||
| <text>结束日期</text> | |||
| <picker mode="date" value="{{date2}}" start="{{date}}" end="2050-01-01" bindchange="bindDateChange2"> | |||
| <view class="picker"> | |||
| {{date2}} | |||
| </view> | |||
| </picker> | |||
| </view> | |||
| </view> | |||
| <!-- <view class="timeSelect"> | |||
| <picker value="{{timeIndex}}" range="{{timeArr}}" range-key="period" bindchange="bindSelectChange" data-index="timeIndex"> | |||
| <view class="picker"> | |||
| 时间区间:<text class="pickerBorder">{{timeArr[timeIndex].period}}</text> | |||
| </view> | |||
| </picker> | |||
| </view> --> | |||
| <!-- <view class="timeSelect"> | |||
| <picker value="{{searchIndex}}" range="{{searchArr}}" bindchange="bindSelectChange" data-index="searchIndex"> | |||
| <view class="picker"> | |||
| 查询方式:<text class="pickerBorder">{{searchArr[searchIndex]}}</text> | |||
| </view> | |||
| </picker> | |||
| </view> --> | |||
| </view> | |||
| <view class="line" /> | |||
| <!-- <view class="searchArea"> | |||
| <view>查询方式</view> | |||
| <view class="searchBox"> | |||
| <view class="timeSelect"> | |||
| <picker value="{{searchIndex}}" range="{{searchArr}}" bindchange="bindSelectChange" data-index="searchIndex"> | |||
| <view class="picker"> | |||
| 查询方式:<text class="pickerBorder">{{searchArr[searchIndex]}}</text> | |||
| </view> | |||
| </picker> | |||
| </view> | |||
| </view> | |||
| </view> | |||
| <view class="line" /> --> | |||
| <view class="searchArea"> | |||
| <!-- <view>根据表号或店铺号查询</view> --> | |||
| <view class="searchBox"> | |||
| <view wx:if="{{searchIndex != 1}}" class="pickerSelect"> | |||
| <picker value="{{buildIndex}}" range="{{buildArr}}" range-key="name" bindchange="bindSelectChange" data-index="buildIndex"> | |||
| <view wx:if="{{isShowBuilding}}" class="picker"> | |||
| 选择楼栋:<text style="color: #000000;" class="pickerBorder">{{buildArr[buildIndex].name}}</text> | |||
| </view> | |||
| <view wx:else class="picker"> | |||
| 选择楼栋:<text class="pickerBorder">请选择</text> | |||
| </view> | |||
| </picker> | |||
| </view> | |||
| <view wx:if="{{searchIndex != 1}}" class="pickerSelect"> | |||
| <picker value="{{floorIndex}}" range="{{floorArr}}" range-key="floorName" bindchange="bindSelectChange" data-index="floorIndex" disabled="{{!isShowBuilding}}"> | |||
| <view wx:if="{{isShowfloor}}" class="picker"> | |||
| 选择楼层:<text style="color: #000000;" class="pickerBorder">{{floorArr[floorIndex].floorName}}</text> | |||
| </view> | |||
| <view wx:else="" class="picker"> | |||
| 选择楼层:<text class="pickerBorder">请先选择楼栋</text> | |||
| </view> | |||
| </picker> | |||
| </view> | |||
| <view class="timeSelect"> | |||
| <view class="picker"> | |||
| <input class="input" value="{{searchKey}}" placeholder="请输入表号或店铺号" placeholder-style="color:#a0a0a0" bindinput="changeSearchKey" /> | |||
| </view> | |||
| <view class="searchBtn" bindtap="getShopMeterList">查询</view> | |||
| </view> | |||
| <!-- <view class="timeSelect"> | |||
| <view class="picker"> | |||
| 输入店铺:<input class="input" value="{{searchKey}}" placeholder="请输入店铺" placeholder-style="color:#ffffff" bindinput="changeSearchKey" /> | |||
| </view> | |||
| </view> --> | |||
| <!-- <view wx:if="{{searchIndex != 1}}" class="timeSelect"> | |||
| <picker value="{{buildIndex}}" range="{{buildArr}}" range-key="name" bindchange="bindSelectChange" data-index="buildIndex"> | |||
| <view wx:if="{{isShowBuilding}}" class="picker"> | |||
| 选择楼栋:<text class="pickerBorder">{{buildArr[buildIndex].name}}</text> | |||
| </view> | |||
| <view wx:else class="picker"> | |||
| 选择楼栋:<text class="pickerBorder">请选择</text> | |||
| </view> | |||
| </picker> | |||
| </view> | |||
| <view wx:if="{{searchIndex != 1}}" class="timeSelect"> | |||
| <picker value="{{floorIndex}}" range="{{floorArr}}" range-key="floorName" bindchange="bindSelectChange" data-index="floorIndex" disabled="{{!isShowBuilding}}"> | |||
| <view wx:if="{{isShowfloor}}" class="picker"> | |||
| 选择楼层:<text class="pickerBorder">{{floorArr[floorIndex].floorName}}</text> | |||
| </view> | |||
| <view wx:else="" class="picker"> | |||
| 选择楼层:<text class="pickerBorder">请先选择楼栋</text> | |||
| </view> | |||
| </picker> | |||
| </view> | |||
| <view wx:if="{{ searchIndex != 1 }}" class="timeSelect"> | |||
| <picker value="{{shopIndex}}" range="{{shopArr}}" range-key="shopNumber" bindchange="bindSelectChange" data-index="shopIndex" disabled="{{!isShowfloor}}"> | |||
| <view wx:if="{{isShowshop}}" class="picker"> | |||
| 选择店铺:<text class="pickerBorder">{{shopArr[shopIndex].shopNumber}}</text> | |||
| </view> | |||
| <view wx:else class="picker"> | |||
| 选择店铺:<text class="pickerBorder">请先选择楼层</text> | |||
| </view> | |||
| </picker> | |||
| </view>--> | |||
| </view> | |||
| </view> | |||
| <view wx:if="{{preShopReadingList.length}}" class="meterList"> | |||
| <block wx:for="{{preShopReadingList}}" wx:key="index"> | |||
| <view class="beforeItem"> | |||
| <view style="font-weight: 600;">表名:{{item.name}}</view> | |||
| <view class="inline"> | |||
| 类型:【{{item.typeName}}】 | |||
| 分组:【{{item.physicsTypeName}}】 | |||
| </view> | |||
| <view class="inline"> | |||
| 归属:【{{item.aliseName}}】 | |||
| </view> | |||
| </view> | |||
| <view class="item"> | |||
| <view class="top"> | |||
| <text>上次抄表时间:{{item.meterData.formatTime}}</text> | |||
| </view> | |||
| <view class="center"> | |||
| <text>上次抄表人:{{item.meterData.preByName}}</text> | |||
| </view> | |||
| <view class="bottom"> | |||
| <view style="position: relative;top: 6rpx;">上次度数:{{item.meterData.preNumber}}</view> | |||
| <view wx:if="{{!item.meterData.isConfirm}}"> | |||
| 本次度数:<input class="input" value="{{item.meterData.curNumber}}" placeholder="请输入度数" placeholder-style="color:#000000;font-size:22rpx;text-align:center;" bindinput="numberInput" data-index="{{index}}" /> | |||
| </view> | |||
| <view wx:if="{{item.meterData.isConfirm}}"> | |||
| 本次度数:<input class="input disabled" value="{{item.meterData.curNumber}}" placeholder="请输入度数" placeholder-style="color:#ff0000;font-size:22rpx;text-align:center;" disabled bindinput="numberInput" data-index="{{index}}" bindtap="isConfirmTouched" /> | |||
| </view> | |||
| </view> | |||
| </view> | |||
| </block> | |||
| <view class="searchBtn" bindtap="save">保存</view> | |||
| </view> | |||
| </view> | |||
| @@ -0,0 +1,254 @@ | |||
| .page { | |||
| padding: 20rpx 0; | |||
| } | |||
| .page .tabBar { | |||
| display: flex; | |||
| justify-content: space-evenly; | |||
| align-items: center; | |||
| width: 100%; | |||
| } | |||
| .page .tabBar .item { | |||
| width: 28%; | |||
| height: 80rpx; | |||
| line-height: 80rpx; | |||
| color: #fff; | |||
| background-color: #52a0fd; | |||
| text-align: center; | |||
| border-radius: 15rpx; | |||
| opacity: 0.7; | |||
| transform: scale(1); | |||
| transition: all 0.3s; | |||
| } | |||
| .page .tabBar .item.active { | |||
| opacity: 1; | |||
| transform: scale(1.1); | |||
| } | |||
| .selectArea { | |||
| /* background-color: #b4b4b4; */ | |||
| padding: 20rpx; | |||
| text-align: center; | |||
| } | |||
| .selectArea .timeSelect { | |||
| margin-bottom: 10rpx; | |||
| } | |||
| .selectArea .timeSelect .picker .pickerBorder { | |||
| display: inline-block; | |||
| width: 400rpx; | |||
| height: 55rpx; | |||
| line-height: 55rpx; | |||
| border: 1px solid #bbbbbb; | |||
| background-color: #f5f5f5; | |||
| border-radius: 10rpx; | |||
| text-align: center; | |||
| } | |||
| .line { | |||
| border-bottom: 1rpx solid #c7c7c7; | |||
| } | |||
| .searchArea { | |||
| padding: 20rpx; | |||
| } | |||
| .searchBox { | |||
| text-align: center; | |||
| margin: 30rpx 0 50rpx 0; | |||
| } | |||
| .searchArea .searchBox .timeSelect { | |||
| display: flex; | |||
| align-items: center; | |||
| justify-content: space-between; | |||
| font-size: 25rpx; | |||
| padding: 0 80rpx; | |||
| } | |||
| .searchArea .searchBox .pickerSelect { | |||
| font-size: 25rpx; | |||
| margin-bottom: 30rpx; | |||
| } | |||
| .searchArea .searchBox .pickerSelect .picker { | |||
| font-size: 27rpx; | |||
| } | |||
| .searchArea .searchBox .pickerSelect .picker .pickerBorder { | |||
| display: inline-block; | |||
| font-size: 27rpx; | |||
| width: 420rpx; | |||
| height: 45rpx; | |||
| line-height: 45rpx; | |||
| color: #a0a0a0; | |||
| border: 1px solid #a0a0a0; | |||
| /* background-color: #b9b9b9; */ | |||
| border-radius: 10rpx; | |||
| } | |||
| .searchArea .searchBox .timeSelect .picker .pickerBorder { | |||
| display: inline-block; | |||
| width: 400rpx; | |||
| height: 40rpx; | |||
| line-height: 40rpx; | |||
| font-size: 25rpx; | |||
| color: #ffffff; | |||
| border: 1px solid #bbbbbb; | |||
| background-color: #75b3fd; | |||
| border-radius: 10rpx; | |||
| text-align: center; | |||
| } | |||
| .searchArea .searchBox .timeSelect .picker { | |||
| display: inline-block; | |||
| width: 400rpx; | |||
| height: 50rpx; | |||
| } | |||
| .searchArea .searchBox .timeSelect .picker .input { | |||
| width: 100%; | |||
| height: 100%; | |||
| color: #000000; | |||
| border: 1px solid #a0a0a0; | |||
| /* background-color: #b9b9b9; */ | |||
| border-radius: 10rpx; | |||
| } | |||
| .searchArea .searchBtn { | |||
| display: inline-block; | |||
| width: 20%; | |||
| height: 100%; | |||
| color: #ffffff; | |||
| border-radius: 10rpx; | |||
| background-color: #52a0fd; | |||
| padding: 10rpx 0; | |||
| } | |||
| .searchArea .searchBtn.one { | |||
| position: relative; | |||
| bottom: 10rpx; | |||
| right: 40rpx; | |||
| display: inline-block; | |||
| width: 110rpx; | |||
| height: 100%; | |||
| font-size: 25rpx; | |||
| color: #ffffff; | |||
| border-radius: 10rpx; | |||
| background-color: #52a0fd; | |||
| padding: 10rpx 0; | |||
| } | |||
| .meterList { | |||
| padding: 0 20rpx; | |||
| font-size: 28rpx; | |||
| } | |||
| .meterList .item { | |||
| padding: 20rpx 30rpx; | |||
| background-color: #52a0fd; | |||
| color: #ffffff; | |||
| margin-bottom: 50rpx; | |||
| border-radius: 15rpx; | |||
| } | |||
| .meterList .beforeItem { | |||
| width: 100%; | |||
| } | |||
| .meterList .beforeItem .inline { | |||
| font-size: 28rpx; | |||
| /* text-overflow: ellipsis; | |||
| overflow: hidden; | |||
| word-break: break-all; | |||
| white-space: nowrap; */ | |||
| line-height: 50rpx; | |||
| margin: 20rpx 0; | |||
| color: #a1a1a1; | |||
| } | |||
| .meterList .item text { | |||
| font-size: 28rpx; | |||
| } | |||
| .meterList .item .top { | |||
| margin-bottom: 20rpx; | |||
| } | |||
| .meterList .item .center { | |||
| margin-bottom: 10rpx; | |||
| } | |||
| .meterList .item .bottom { | |||
| display: flex; | |||
| align-items: center; | |||
| justify-content: space-between; | |||
| } | |||
| .meterList .item .bottom .input { | |||
| position: relative; | |||
| top: 12rpx; | |||
| right: 10rpx; | |||
| display: inline-block; | |||
| width: 143rpx; | |||
| background-color: #fff; | |||
| color: #000000; | |||
| text-align: center; | |||
| } | |||
| .meterList .item .bottom .input.disabled { | |||
| color: #a5a5a5; | |||
| } | |||
| .meterList .searchBtn { | |||
| width: 80%; | |||
| height: 80rpx; | |||
| color: #ffffff; | |||
| line-height: 80rpx; | |||
| text-align: center; | |||
| margin: auto; | |||
| border-radius: 10rpx; | |||
| background-color: #52a0fd; | |||
| } | |||
| .time { | |||
| position: relative; | |||
| display: flex; | |||
| flex: 2.5; | |||
| text-align: center; | |||
| z-index: 10; | |||
| align-items: center; | |||
| margin-bottom: 30rpx; | |||
| } | |||
| .time>view:nth-of-type(1), | |||
| .time>view:nth-of-type(3) { | |||
| flex: 1; | |||
| } | |||
| .time>view:nth-of-type(2) { | |||
| flex: 0.5; | |||
| } | |||
| .time>view text { | |||
| display: block; | |||
| } | |||
| .time>view text:nth-of-type(2n+1) { | |||
| margin-top: 69rpx; | |||
| } | |||
| .time>view text:nth-of-type(2n+1) { | |||
| color: #999; | |||
| font-size: 26rpx; | |||
| margin-bottom: 24rpx; | |||
| } | |||
| .time>view text:nth-of-type(2n) { | |||
| color: rgba(153, 153, 153, 1); | |||
| font-size: 32rpx; | |||
| margin-top: 34rpx; | |||
| } | |||
| @@ -0,0 +1,203 @@ | |||
| const config = require('../../../config/config.js') | |||
| const util = require('../../../utils/util.js') | |||
| const Http = require('../../../utils/http.js') | |||
| const Common = require('../../../common/common.js') | |||
| const qrCodeJS = require('../../../utils/qrcode.js') | |||
| const app = getApp(); | |||
| Page({ | |||
| /** | |||
| * 页面的初始数据 | |||
| */ | |||
| data: { | |||
| billTypeValue: "", | |||
| billId: "", | |||
| disabled: true, | |||
| detailData: {}, | |||
| tempFilePath: '', | |||
| codeShow: false | |||
| }, | |||
| qrcode(url) { | |||
| let that = this; | |||
| qrCodeJS.qrApi.draw(url, 'logoQRCode', wx.getSystemInfoSync().windowWidth * (260 / 375), wx.getSystemInfoSync().windowWidth * (260 / 375), function (res) { | |||
| that.setData({ | |||
| tempFilePath: res | |||
| }) | |||
| }) | |||
| }, | |||
| /** | |||
| * 取消 | |||
| */ | |||
| goBack() { | |||
| wx.navigateBack({ | |||
| delta: 1 | |||
| }) | |||
| }, | |||
| submit() { | |||
| let that = this | |||
| Http.getRequest(config.api.payChannel, app.globalData.token, '', {}, (res) => { | |||
| if(res.code === 200) { | |||
| if (res.data.payChannel === 1) { | |||
| wx.login({ | |||
| success: res => { | |||
| Common.getOpenId(res.code, app.globalData.bUserId, false) | |||
| .then(res => { | |||
| if (res.data && res.data.data && res.data.data.openId) { | |||
| Http.postRequest(config.api.payBill, app.globalData.token, '', { | |||
| billTypeValue: that.data.billTypeValue, billId: that.data.billId,payMoney: that.data.detailData.billAllNeedPay, openId: res.data.data.openId | |||
| }, (el) => { | |||
| debugger | |||
| wx.requestPayment({ | |||
| timeStamp: el.data.timeStamp, | |||
| nonceStr: el.data.nonceStr, | |||
| package: el.data.package, | |||
| signType: (el.data.signType) ? el.data.signType : "MD5", | |||
| paySign: el.data.paySign, | |||
| success: res => { | |||
| wx.showLoading({ | |||
| title: '订单正在处理中...', | |||
| }) | |||
| // that.payOrderUpdate(that.data.orderId, payOrderId, 1, '', '', that, that.data.composeOrderType); | |||
| if (res.errMsg == "requestPayment:ok") { | |||
| /** | |||
| * 用户支付成功以后跳转到券包列表 | |||
| */ | |||
| wx.navigateTo({ | |||
| url: `/pages/bill/billdetail/index?billTypeValue=${that.data.billTypeValue}&billId=${that.data.billId}`, | |||
| }) | |||
| // if (that.data.cardType == 100) { | |||
| // wx.setStorage({ | |||
| // key: 'couponNum2', | |||
| // data: "couponNum2" | |||
| // }) | |||
| // } else if (that.data.data.type != 5 && that.data.cardType != 100) { | |||
| // wx.setStorage({ | |||
| // key: 'couponNum', | |||
| // data: "couponNum" | |||
| // }) | |||
| // } | |||
| } | |||
| }, | |||
| fail: res => { | |||
| wx.hideLoading(); | |||
| wx.showToast({ | |||
| title: '支付失败', | |||
| icon: 'none', | |||
| }) | |||
| /** | |||
| * 支付失败,需要更新订单的状态 | |||
| */ | |||
| // that.payOrderUpdate(that.data.orderId, payOrderId, 2, '', 'fail', that, that.data.composeOrderType); | |||
| // that.setData({ | |||
| // showbutton: false | |||
| // }) | |||
| return; | |||
| }, | |||
| complete: res => { } | |||
| }); | |||
| // if(el.code === 200) { | |||
| // wx.navigateTo({ | |||
| // url: `/pages/bill/billdetail/index?billTypeValue=${el.data.billTypeValue}&billId=${el.data.billId}`, | |||
| // }) | |||
| // } | |||
| }) | |||
| } | |||
| }) | |||
| .catch(error => { | |||
| wx.showToast({ | |||
| title: error.data.message, | |||
| icon: 'none', | |||
| }) | |||
| }) | |||
| } | |||
| }) | |||
| } else { | |||
| Http.postRequest(config.api.payBill, app.globalData.token, '', { | |||
| billTypeValue: that.data.billTypeValue, billId: that.data.billId,payMoney: that.data.detailData.billAllNeedPay | |||
| }, (el) => { | |||
| if(el.code === 200) { | |||
| that.setData({ | |||
| codeShow: true | |||
| }) | |||
| that.qrcode(el.data) | |||
| } | |||
| }) | |||
| } | |||
| } | |||
| }) | |||
| }, | |||
| /** | |||
| * 生命周期函数--监听页面加载 | |||
| */ | |||
| onLoad: function(options) { | |||
| let that = this; | |||
| that.setData({ | |||
| billTypeValue: options.billTypeValue, | |||
| billId: options.billId | |||
| }) | |||
| this.getData() | |||
| }, | |||
| getData() { | |||
| Http.getRequest(config.api.billDetail, app.globalData.token, '', { | |||
| billId: this.data.billId, | |||
| billTypeValue: this.data.billTypeValue, | |||
| }, (res) => { | |||
| if(res.code === 200) { | |||
| this.setData({ | |||
| detailData: res.data | |||
| }) | |||
| } | |||
| }) | |||
| }, | |||
| /** | |||
| * 生命周期函数--监听页面初次渲染完成 | |||
| */ | |||
| onReady: function() { | |||
| }, | |||
| /** | |||
| * 生命周期函数--监听页面显示 | |||
| */ | |||
| onShow: function() { | |||
| }, | |||
| /** | |||
| * 生命周期函数--监听页面隐藏 | |||
| */ | |||
| onHide: function() { | |||
| }, | |||
| /** | |||
| * 生命周期函数--监听页面卸载 | |||
| */ | |||
| onUnload: function() { | |||
| }, | |||
| /** | |||
| * 页面相关事件处理函数--监听用户下拉动作 | |||
| */ | |||
| onPullDownRefresh: function() { | |||
| }, | |||
| /** | |||
| * 页面上拉触底事件的处理函数 | |||
| */ | |||
| onReachBottom: function() { | |||
| }, | |||
| /** | |||
| * 用户点击右上角分享 | |||
| */ | |||
| onShareAppMessage: function() { | |||
| } | |||
| }) | |||
| @@ -0,0 +1,3 @@ | |||
| { | |||
| "navigationBarTitleText": "账单详情" | |||
| } | |||
| @@ -0,0 +1,33 @@ | |||
| <view class="orderBox"> | |||
| <view class="orderTitle">欠费金额</view> | |||
| <view class="courier"> | |||
| <input class="courierInput" disabled="{{disabled}}" value="{{detailData.owe}}"></input> | |||
| </view> | |||
| <view class="orderTitle">滞纳金</view> | |||
| <view class="courier"> | |||
| <input class="courierInput" disabled="{{disabled}}" value="{{detailData.billLatePay}}"></input> | |||
| </view> | |||
| <view class="orderTitle">手续费</view> | |||
| <view class="courier"> | |||
| <input class="courierInput" disabled="{{disabled}}" value="{{detailData.billServicePay}}"></input> | |||
| </view> | |||
| <view class="orderTitle">待支付总金额</view> | |||
| <view class="courier"> | |||
| <input class="courierInput" disabled="{{disabled}}" value="{{detailData.billAllNeedPay}}"></input> | |||
| </view> | |||
| </view> | |||
| <view class="submit" bindtap="submit">去缴费</view> | |||
| <view class="submit" bindtap="getData">刷新</view> | |||
| <view class="bg" wx:if="{{codeShow}}"></view> | |||
| <view class='content' wx:if="{{codeShow}}"> | |||
| <view class='showQrcode'> | |||
| <view class="canvas-box"> | |||
| <text class='txt1'>请将收款码截屏。用微信,支付宝,建行APP 扫码支付。</text> | |||
| <view class="canWrap"> | |||
| <canvas canvas-id="logoQRCode" style="width: 1200rpx; height: 800rpx;" /> | |||
| </view> | |||
| <image class='canvasImage' src="{{tempFilePath}}" mode="aspectFit" /> | |||
| </view> | |||
| </view> | |||
| </view> | |||
| @@ -0,0 +1,206 @@ | |||
| /* pages/deliveryDetails/deliveryDetails.wxss */ | |||
| page { | |||
| background: #f8f8fa; | |||
| } | |||
| .orderBox { | |||
| width: 96%; | |||
| margin: 20rpx auto; | |||
| overflow: hidden; | |||
| } | |||
| .orderTitle { | |||
| font-size: 32rpx; | |||
| font-weight: 500; | |||
| } | |||
| .orderItem { | |||
| margin: 20rpx auto; | |||
| background-color: #fff; | |||
| border-radius: 12rpx; | |||
| overflow: hidden; | |||
| } | |||
| .orderName { | |||
| } | |||
| .item { | |||
| width: 90%; | |||
| margin: 20rpx auto; | |||
| font-size: 28rpx; | |||
| } | |||
| .courier { | |||
| background-color: #fff; | |||
| width: 96%; | |||
| margin: 20rpx auto; | |||
| height: 80rpx; | |||
| border: 12rpx; | |||
| overflow: hidden; | |||
| } | |||
| .courierInput { | |||
| width: 90%; | |||
| margin: 10rpx auto; | |||
| height: 60rpx; | |||
| line-height: 60rpx; | |||
| font-size: 30rpx; | |||
| } | |||
| .expressageIdInput { | |||
| width: 90%; | |||
| margin: 10rpx auto; | |||
| height: 60rpx; | |||
| line-height: 60rpx; | |||
| } | |||
| .addImg { | |||
| height: 340rpx; | |||
| width: 310rpx; | |||
| margin: 88rpx auto; | |||
| border: 1px solid #52a0fd; | |||
| color: #52a0fd; | |||
| } | |||
| .addImg image{ | |||
| width: 59rpx; | |||
| height: 45rpx; | |||
| margin: 113rpx 125rpx 35rpx 126rpx; | |||
| } | |||
| .addImg text { | |||
| display: block; | |||
| text-align: center; | |||
| } | |||
| .up-img{ | |||
| width: 600rpx; | |||
| margin: 40rpx auto 0; | |||
| height: auto; | |||
| padding: 10rpx; | |||
| border: 1px dashed #52A0FD; | |||
| } | |||
| .up-img image{ | |||
| width: 600rpx; | |||
| } | |||
| .submit { | |||
| width: 80%; | |||
| margin: 20rpx auto; | |||
| text-align: center; | |||
| line-height: 80rpx; | |||
| height: 80rpx; | |||
| border-radius: 12rpx; | |||
| color: #fff; | |||
| background: rgba(101, 158, 246, 1); | |||
| } | |||
| .goBack{ | |||
| background: #fff; | |||
| color: #000; | |||
| border: 1px solid #eee; | |||
| } | |||
| .oprBtn button{ | |||
| width: 200rpx; | |||
| height: 70rpx; | |||
| line-height: 70rpx; | |||
| font-size: 28rpx; | |||
| display: inline-block; | |||
| float: right; | |||
| margin-left: 10rpx; | |||
| } | |||
| .content { | |||
| width: 680rpx; | |||
| border-radius: 10rpx; | |||
| background: #fff; | |||
| margin: 30rpx auto 0; | |||
| padding-bottom: 27rpx; | |||
| position: absolute; | |||
| left: 35rpx; | |||
| top: 50rpx; | |||
| z-index: 10; | |||
| } | |||
| .txt1 { | |||
| display: block; | |||
| width: 400rpx; | |||
| font-size: 28rpx; | |||
| margin: 0 auto 15rpx; | |||
| text-align: center; | |||
| font-family: PingFang-SC-Medium; | |||
| font-weight: 500; | |||
| padding-top: 70rpx; | |||
| color: rgba(51, 51, 51, 1); | |||
| } | |||
| .pay { | |||
| width: 680rpx; | |||
| text-align: center; | |||
| margin: auto; | |||
| margin-top: 20rpx; | |||
| overflow: hidden; | |||
| } | |||
| .pay .memberIds { | |||
| display: block; | |||
| width: 680rpx; | |||
| height: 88rpx; | |||
| line-height: 88rpx; | |||
| margin: auto; | |||
| font-size: 28rpx; | |||
| color: #000; | |||
| text-align: center; | |||
| background: #ffffff; | |||
| margin-bottom: 20rpx; | |||
| border-radius: 10rpx; | |||
| } | |||
| .pay .memberIdss { | |||
| display: block; | |||
| width: 680rpx; | |||
| height: 88rpx; | |||
| line-height: 88rpx; | |||
| margin: auto; | |||
| font-size: 28rpx; | |||
| color: #000; | |||
| text-align: center; | |||
| background: #ffffff7a; | |||
| margin-bottom: 20rpx; | |||
| border-radius: 10rpx; | |||
| } | |||
| .canvas { | |||
| width: 600rpx; | |||
| margin: 0 auto; | |||
| z-index: 9; | |||
| } | |||
| .canWrap { | |||
| position: fixed; | |||
| bottom: -20000rpx; | |||
| left: -2000rpx; | |||
| width: 100%; | |||
| height: 100%; | |||
| overflow: visible; | |||
| } | |||
| .canWrap canvas { | |||
| width: 690rpx; | |||
| height: 450rpx; | |||
| } | |||
| .canvasImage { | |||
| display: block; | |||
| width: 500rpx; | |||
| margin: 0 auto; | |||
| } | |||
| .bg{ | |||
| position: absolute; | |||
| left: 0; | |||
| top: 0; | |||
| right: 0; | |||
| bottom: 0; | |||
| background: #000; | |||
| opacity: 0.5; | |||
| z-index: 9; | |||
| } | |||
| @@ -0,0 +1,124 @@ | |||
| var app = getApp(); | |||
| const config = require('../../../config/config.js') | |||
| const util = require('../../../utils/util.js') | |||
| const Http = require('../../../utils/http.js') | |||
| Page({ | |||
| /** | |||
| * 页面的初始数据 | |||
| */ | |||
| data: { | |||
| array: ['美国', '中国', '巴西', '日本'], | |||
| billTypesObj: { | |||
| name: '', | |||
| id: '' | |||
| }, | |||
| billScalesObj: { | |||
| name: '', | |||
| id: '' | |||
| }, | |||
| billtypes: [ | |||
| {id: "1", name: "租金"}, | |||
| {id: "2", name: "物业费"}, | |||
| {id: "3", name: "日常(水电空调)费"}, | |||
| {id: "4", name: "其他费用"}, | |||
| {id: "5", name: "其他押金"}, | |||
| {id: "11", name: "商业管理费"}, | |||
| {id: "12", name: "运营管理费"}, | |||
| {id: "13", name: "租赁押金"}, | |||
| {id: "21", name: "物业押金"} | |||
| ], | |||
| statustypes: [], | |||
| date: '', | |||
| date2: '', | |||
| list: [] | |||
| }, | |||
| onLoad: function (options) { | |||
| // let date = new Date; | |||
| // let year = date.getFullYear(); | |||
| // let month = date.getMonth() + 1; | |||
| // this.setData({ | |||
| // date: year + '-' + month, | |||
| // date2: year + '-' + month, | |||
| // }) | |||
| this.getData() | |||
| this.search() | |||
| }, | |||
| bindDateChange1: function (e) { | |||
| this.setData({ | |||
| date: e.detail.value, | |||
| }) | |||
| }, | |||
| bindDateChange2: function (e) { | |||
| this.setData({ | |||
| date2: e.detail.value | |||
| }) | |||
| }, | |||
| bindPickerChange: function(e) { | |||
| this.setData({ | |||
| billTypesObj: this.data.billtypes[e.detail.value] | |||
| }) | |||
| }, | |||
| bindPickerChange2: function(e) { | |||
| this.setData({ | |||
| billScalesObj: this.data.billScales[e.detail.value] | |||
| }) | |||
| }, | |||
| getData() { | |||
| Http.getRequest(config.api.billScales, app.globalData.token, '', {}, (res) => { | |||
| let arr = [] | |||
| for (let key in res.data) { | |||
| let val = res.data[key]; | |||
| arr.push({id: key, name: val}) | |||
| } | |||
| this.setData({ | |||
| billScales: arr | |||
| }) | |||
| }) | |||
| Http.getRequest(config.api.billTypes, app.globalData.token, '', {}, (res) => { | |||
| let arr = [] | |||
| for (let key in res.data) { | |||
| let val = res.data[key]; | |||
| arr.push({id: key, name: val}) | |||
| } | |||
| this.setData({ | |||
| billTypes: arr | |||
| }) | |||
| }) | |||
| }, | |||
| search() { | |||
| Http.getRequest(config.api.listBill, app.globalData.token, '', { | |||
| billTypeValue: this.data.billTypesObj.id, | |||
| starttime: this.data.date, | |||
| endtime: this.data.date2, | |||
| onlyOweOrNear: this.data.billScalesObj.id, | |||
| pageNum: 1, | |||
| pageSize: 1000, | |||
| }, (res) => { | |||
| if(res.code === 200) { | |||
| res.data.forEach(file => { | |||
| file.starttime = file.starttime ? util.formatTime(Number(file.starttime), "yyyy.MM.dd ") : ''; | |||
| file.endtime = file.starttime ? util.formatTime(Number(file.endtime), "yyyy.MM.dd ") : ''; | |||
| }) | |||
| this.setData({ | |||
| list: res.data | |||
| }) | |||
| } | |||
| }) | |||
| }, | |||
| /** | |||
| * gotolook点击查看 | |||
| */ | |||
| gotolook: function (e) { | |||
| var billTypeValue = e.currentTarget.dataset.data.billType; | |||
| let billId = e.currentTarget.dataset.data.billId; | |||
| wx.navigateTo({ | |||
| url: `/pages/bill/billdetail/index?billTypeValue=${billTypeValue}&billId=${billId}`, | |||
| }) | |||
| }, | |||
| goBack(){ | |||
| wx.navigateBack({ | |||
| delta: 1 | |||
| }) | |||
| } | |||
| }) | |||
| @@ -0,0 +1,3 @@ | |||
| { | |||
| "navigationBarTitleText": "账单详情" | |||
| } | |||
| @@ -0,0 +1,62 @@ | |||
| <view class="section"> | |||
| <view class="section__title">账单类型:</view> | |||
| <picker class="pickerArr" bindchange="bindPickerChange" value="{{index}}" range="{{billtypes}}" range-key="name"> | |||
| <view class="picker"> | |||
| {{billTypesObj.name || '请选择'}} | |||
| </view> | |||
| </picker> | |||
| <view class="tabLayer tc"> | |||
| <view class="picker_group"> | |||
| <view class="section__title">日期范围:</view> | |||
| <picker mode="date" value="{{date}}" end="{{date}}" fields="day" bindchange="bindDateChange1"> | |||
| <view wx:if="{{!date}}" class="picker">开始日期</view> | |||
| <view wx:if="{{date}}" class="picker">{{date}}</view> | |||
| </picker> | |||
| 至 | |||
| <picker mode="date" value="{{date2}}" start="{{date2}}" fields="day" bindchange="bindDateChange2"> | |||
| <view wx:if="{{!date2}}" class="picker">结束日期</view> | |||
| <view wx:if="{{date2}}" class="picker">{{date2}}</view> | |||
| </picker> | |||
| </view> | |||
| </view> | |||
| <view class="section__title">查询范围:</view> | |||
| <picker class="pickerArr" bindchange="bindPickerChange2" value="{{index}}" range="{{billScales}}" range-key="name"> | |||
| <view class="picker"> | |||
| {{billScalesObj.name || '请选择'}} | |||
| </view> | |||
| </picker> | |||
| <button class='btns' hover-class='active1' bindtap='search' >查询</button> | |||
| </view> | |||
| <view class="table"> | |||
| <view class="tr bg-w"> | |||
| <view class="th">账单类型</view> | |||
| <view class="th">账单周期</view> | |||
| <view class="th">应付金额</view> | |||
| <view class="th">已付金额</view> | |||
| <view class="th">欠费金额</view> | |||
| <view class="th">操作</view> | |||
| </view> | |||
| <block wx:for="{{list}}" wx:key="index"> | |||
| <view class="tr"> | |||
| <view class="td">{{item.billTypeName}}</view> | |||
| <view class="td">起:{{item.starttime}} <text>止:{{item.endtime}}</text></view> | |||
| <view class="td">{{item.receivePay}}</view> | |||
| <view class="td">{{item.pay}}</view> | |||
| <view class="td">{{item.owe}}</view> | |||
| <view class="td"> | |||
| <button class='btn' bindtap='gotolook' data-data='{{item}}' data-id='{{item.id}}'> | |||
| 查看 | |||
| </button> | |||
| <button class='btn' bindtap='gotolook02' data-data='{{item}}' data-id='{{item.id}}'> | |||
| 缴费 | |||
| </button> | |||
| </view> | |||
| </view> | |||
| </block> | |||
| </view> | |||
| @@ -0,0 +1,108 @@ | |||
| page { | |||
| height: 100%; | |||
| background: #f6f6f8; | |||
| padding: 20rpx; | |||
| } | |||
| .section__title{ | |||
| display: inline-block; | |||
| margin-left: 20rpx; | |||
| font-size: 30rpx; | |||
| color: #888; | |||
| } | |||
| .pickerArr{ | |||
| display: inline-block; | |||
| margin-left: 10rpx; | |||
| border: 1rpx solid #ccc9c9; | |||
| width: 45%; | |||
| padding: 5rpx 20rpx; | |||
| border-radius: 5rpx; | |||
| font-size: 30rpx; | |||
| color: #888; | |||
| } | |||
| .btns { | |||
| width: 20%; | |||
| background: #409EFF; | |||
| color: #fff; | |||
| font-size:30rpx; | |||
| display: inline-block; | |||
| vertical-align: middle; | |||
| height: 60rpx; | |||
| line-height: 60rpx; | |||
| margin-left: 20rpx; | |||
| } | |||
| .picker_group { | |||
| height: 85rpx; | |||
| line-height: 85rpx; | |||
| display: flex; | |||
| align-items: center; | |||
| font-size: 30rpx; | |||
| } | |||
| .picker_group picker { | |||
| height: 55rpx; | |||
| line-height: 55rpx; | |||
| margin: 0 2%; | |||
| padding: 2% 5%; | |||
| border-bottom: 1px solid #eee; | |||
| } | |||
| .picker_group { | |||
| height: 85rpx; | |||
| line-height: 85rpx; | |||
| display: flex; | |||
| align-items: center; | |||
| font-size: 30rpx; | |||
| color: #888; | |||
| } | |||
| .picker_group picker { | |||
| height: 55rpx; | |||
| line-height: 55rpx; | |||
| margin: 0 2%; | |||
| padding: 2% 5%; | |||
| border-bottom: 1px solid #eee; | |||
| } | |||
| .table { | |||
| border: 0px solid darkgray; | |||
| border-top: 1rpx dashed #222; | |||
| margin-top: 20rpx; | |||
| } | |||
| .tr { | |||
| display: flex; | |||
| width: 100%; | |||
| justify-content: center; | |||
| height: 3rem; | |||
| align-items: center; | |||
| border-bottom: 1rpx dashed #222; | |||
| } | |||
| .td { | |||
| width:40%; | |||
| justify-content: center; | |||
| text-align: center; | |||
| font-size: 25rpx; | |||
| } | |||
| .td text{ | |||
| font-size: 25rpx; | |||
| } | |||
| .bg-w{ | |||
| background: snow; | |||
| } | |||
| .bg-g{ | |||
| background: #E6F3F9; | |||
| } | |||
| .th { | |||
| width: 40%; | |||
| justify-content: center; | |||
| display: flex; | |||
| height: 2rem; | |||
| align-items: center; | |||
| text-align: center; | |||
| font-size: 26rpx; | |||
| } | |||
| @@ -0,0 +1,133 @@ | |||
| var app = getApp(); | |||
| const config = require('../../../config/config.js') | |||
| const util = require('../../../utils/util.js') | |||
| const Http = require('../../../utils/http.js') | |||
| Page({ | |||
| /** | |||
| * 页面的初始数据 | |||
| */ | |||
| data: { | |||
| array: ['美国', '中国', '巴西', '日本'], | |||
| billTypesObj: { | |||
| name: '', | |||
| id: '' | |||
| }, | |||
| billScalesObj: { | |||
| name: '', | |||
| id: '' | |||
| }, | |||
| billtypes: [ | |||
| { id: "1", name: "租金" }, | |||
| { id: "2", name: "物业费" }, | |||
| { id: "3", name: "日常(水电空调)费" }, | |||
| { id: "4", name: "其他费用" }, | |||
| { id: "5", name: "其他押金" }, | |||
| { id: "11", name: "商业管理费" }, | |||
| { id: "12", name: "运营管理费" }, | |||
| { id: "13", name: "租赁押金" }, | |||
| { id: "21", name: "物业押金" } | |||
| ], | |||
| statustypes: [], | |||
| date: '', | |||
| date2: '', | |||
| list: [] | |||
| }, | |||
| onLoad: function (options) { | |||
| // let date = new Date; | |||
| // let year = date.getFullYear(); | |||
| // let month = date.getMonth() + 1; | |||
| // this.setData({ | |||
| // date: year + '-' + month, | |||
| // date2: year + '-' + month, | |||
| // }) | |||
| let that = this; | |||
| that.setData({ | |||
| billScalesObj: { | |||
| name: options.name, | |||
| id: options.scale | |||
| }, | |||
| date: options.date, | |||
| date2: options.date2 | |||
| }) | |||
| this.getData() | |||
| this.search() | |||
| }, | |||
| bindDateChange1: function (e) { | |||
| this.setData({ | |||
| date: e.detail.value, | |||
| }) | |||
| }, | |||
| bindDateChange2: function (e) { | |||
| this.setData({ | |||
| date2: e.detail.value | |||
| }) | |||
| }, | |||
| bindPickerChange: function (e) { | |||
| this.setData({ | |||
| billTypesObj: this.data.billtypes[e.detail.value] | |||
| }) | |||
| }, | |||
| bindPickerChange2: function (e) { | |||
| this.setData({ | |||
| billScalesObj: this.data.billScales[e.detail.value] | |||
| }) | |||
| }, | |||
| getData() { | |||
| Http.getRequest(config.api.billScales, app.globalData.token, '', {}, (res) => { | |||
| let arr = [] | |||
| for (let key in res.data) { | |||
| let val = res.data[key]; | |||
| arr.push({ id: key, name: val }) | |||
| } | |||
| this.setData({ | |||
| billScales: arr | |||
| }) | |||
| }) | |||
| Http.getRequest(config.api.billTypes, app.globalData.token, '', {}, (res) => { | |||
| let arr = [] | |||
| for (let key in res.data) { | |||
| let val = res.data[key]; | |||
| arr.push({ id: key, name: val }) | |||
| } | |||
| this.setData({ | |||
| billTypes: arr | |||
| }) | |||
| }) | |||
| }, | |||
| search() { | |||
| Http.getRequest(config.api.mallListBill, app.globalData.token, '', { | |||
| billTypeValue: this.data.billTypesObj.id, | |||
| starttime: this.data.date, | |||
| endtime: this.data.date2, | |||
| onlyOweOrNear: this.data.billScalesObj.id, | |||
| pageNum: 1, | |||
| pageSize: 1000, | |||
| }, (res) => { | |||
| if (res.code === 200) { | |||
| res.data.list.forEach(file => { | |||
| file.starttime = file.starttime ? util.formatTime(Number(file.starttime), "yyyy.MM.dd ") : ''; | |||
| file.endtime = file.starttime ? util.formatTime(Number(file.endtime), "yyyy.MM.dd ") : ''; | |||
| }) | |||
| this.setData({ | |||
| list: res.data.list | |||
| }) | |||
| } | |||
| }) | |||
| }, | |||
| /** | |||
| * gotolook点击查看 | |||
| */ | |||
| gotolook: function (e) { | |||
| var billTypeValue = e.currentTarget.dataset.data.billType; | |||
| let billId = e.currentTarget.dataset.data.id; | |||
| wx.navigateTo({ | |||
| url: `/pages/bill/billdetail/index?billTypeValue=${billTypeValue}&billId=${billId}`, | |||
| }) | |||
| }, | |||
| goBack() { | |||
| wx.navigateBack({ | |||
| delta: 1 | |||
| }) | |||
| } | |||
| }) | |||
| @@ -0,0 +1,3 @@ | |||
| { | |||
| "navigationBarTitleText": "账单详情" | |||
| } | |||
| @@ -0,0 +1,59 @@ | |||
| <view class="section"> | |||
| <view class="section__title">账单类型:</view> | |||
| <picker class="pickerArr" bindchange="bindPickerChange" value="{{index}}" range="{{billtypes}}" range-key="name"> | |||
| <view class="picker"> | |||
| {{billTypesObj.name || '请选择'}} | |||
| </view> | |||
| </picker> | |||
| <view class="tabLayer tc"> | |||
| <view class="picker_group"> | |||
| <view class="section__title">日期范围:</view> | |||
| <picker mode="date" value="{{date}}" end="{{date}}" fields="day" bindchange="bindDateChange1"> | |||
| <view wx:if="{{!date}}" class="picker">开始日期</view> | |||
| <view wx:if="{{date}}" class="picker">{{date}}</view> | |||
| </picker> | |||
| 至 | |||
| <picker mode="date" value="{{date2}}" start="{{date2}}" fields="day" bindchange="bindDateChange2"> | |||
| <view wx:if="{{!date2}}" class="picker">结束日期</view> | |||
| <view wx:if="{{date2}}" class="picker">{{date2}}</view> | |||
| </picker> | |||
| </view> | |||
| </view> | |||
| <view class="section__title">查询范围:</view> | |||
| <picker class="pickerArr" bindchange="bindPickerChange2" value="{{index}}" range="{{billScales}}" range-key="name"> | |||
| <view class="picker"> | |||
| {{billScalesObj.name || '请选择'}} | |||
| </view> | |||
| </picker> | |||
| <button class='btns' hover-class='active1' bindtap='search'>查询</button> | |||
| </view> | |||
| <view class="table"> | |||
| <view class="tr bg-w"> | |||
| <view class="th">账单类型</view> | |||
| <view class="th">账单周期</view> | |||
| <view class="th">应付金额</view> | |||
| <view class="th">已付金额</view> | |||
| <view class="th">欠费金额</view> | |||
| <view class="th">操作</view> | |||
| </view> | |||
| <block wx:for="{{list}}" wx:key="index"> | |||
| <view class="tr"> | |||
| <view class="td">{{item.billTypeName}}</view> | |||
| <view class="td">起:{{item.starttime}} <text>止:{{item.endtime}}</text></view> | |||
| <view class="td">{{item.receivePay}}</view> | |||
| <view class="td">{{item.pay}}</view> | |||
| <view class="td">{{item.owe}}</view> | |||
| <view class="td"> | |||
| <button class='btn' bindtap='gotolook' data-data='{{item}}' data-id='{{item.id}}'> | |||
| 查看 | |||
| </button> | |||
| </view> | |||
| </view> | |||
| </block> | |||
| </view> | |||
| @@ -0,0 +1,129 @@ | |||
| page { | |||
| height: 100%; | |||
| background: #f6f6f8; | |||
| padding: 20rpx; | |||
| } | |||
| .section__title { | |||
| display: inline-block; | |||
| margin-left: 20rpx; | |||
| font-size: 30rpx; | |||
| color: #888; | |||
| } | |||
| .pickerArr { | |||
| display: inline-block; | |||
| margin-left: 10rpx; | |||
| border: 1rpx solid #ccc9c9; | |||
| width: 45%; | |||
| padding: 5rpx 20rpx; | |||
| border-radius: 5rpx; | |||
| font-size: 30rpx; | |||
| color: #888; | |||
| } | |||
| .btns { | |||
| width: 20%; | |||
| background: #409EFF; | |||
| color: #fff; | |||
| font-size: 30rpx; | |||
| display: inline-block; | |||
| vertical-align: middle; | |||
| height: 60rpx; | |||
| line-height: 60rpx; | |||
| margin-left: 20rpx; | |||
| } | |||
| .btn { | |||
| float: right; | |||
| height: 52rpx; | |||
| line-height: 52rpx; | |||
| background: rgba(101, 158, 246, 1); | |||
| border-radius: 10rpx; | |||
| font-size: 28rpx; | |||
| font-weight: 500; | |||
| padding: 0 25rpx; | |||
| color: rgba(255, 255, 255, 1); | |||
| } | |||
| .picker_group { | |||
| height: 85rpx; | |||
| line-height: 85rpx; | |||
| display: flex; | |||
| align-items: center; | |||
| font-size: 30rpx; | |||
| } | |||
| .picker_group picker { | |||
| height: 55rpx; | |||
| line-height: 55rpx; | |||
| margin: 0 2%; | |||
| padding: 2% 5%; | |||
| border-bottom: 1px solid #eee; | |||
| } | |||
| .picker_group { | |||
| height: 85rpx; | |||
| line-height: 85rpx; | |||
| display: flex; | |||
| align-items: center; | |||
| font-size: 30rpx; | |||
| color: #888; | |||
| } | |||
| .picker_group picker { | |||
| height: 55rpx; | |||
| line-height: 55rpx; | |||
| margin: 0 2%; | |||
| padding: 2% 5%; | |||
| border-bottom: 1px solid #eee; | |||
| } | |||
| .table { | |||
| border: 0px solid darkgray; | |||
| border-top: 1rpx solid #a0a0a0; | |||
| margin-top: 20rpx; | |||
| padding-right: 30rpx; | |||
| } | |||
| .tr { | |||
| display: flex; | |||
| width: 100%; | |||
| justify-content: center; | |||
| height: 3rem; | |||
| align-items: center; | |||
| border-bottom: 1rpx solid #a0a0a0; | |||
| } | |||
| .td { | |||
| width: 40%; | |||
| justify-content: center; | |||
| text-align: center; | |||
| font-size: 25rpx; | |||
| } | |||
| .td text { | |||
| font-size: 25rpx; | |||
| } | |||
| .bg-w { | |||
| background: ffffff; | |||
| } | |||
| .bg-g { | |||
| background: #E6F3F9; | |||
| } | |||
| .th { | |||
| width: 40%; | |||
| justify-content: center; | |||
| display: flex; | |||
| height: 2rem; | |||
| align-items: center; | |||
| text-align: center; | |||
| font-size: 26rpx; | |||
| } | |||
| @@ -0,0 +1,161 @@ | |||
| var app = getApp(); | |||
| const config = require('../../../config/config.js') | |||
| const util = require('../../../utils/util.js') | |||
| const Http = require('../../../utils/HttpBasics.js') | |||
| Page({ | |||
| /** | |||
| * 页面的初始数据 | |||
| */ | |||
| data: { | |||
| receiptUrl:null, | |||
| id:"", | |||
| newPrice:'', | |||
| }, | |||
| goBack(){ | |||
| wx.navigateBack({ | |||
| delta: 1 | |||
| }) | |||
| }, | |||
| // setNewPrice(e){ | |||
| // this.setData({ | |||
| // newPrice: e.detail.value | |||
| // }) | |||
| // }, | |||
| uploadImg() { | |||
| let that = this; | |||
| wx.chooseImage({ | |||
| success(res) { | |||
| const tempFilePaths = res.tempFilePaths | |||
| wx.showLoading({ | |||
| title: '上传中...', | |||
| }) | |||
| wx.uploadFile({ | |||
| url: config.api.imgUpload, // 仅为示例,非真实的接口地址 | |||
| filePath: tempFilePaths[0], | |||
| name: 'file', | |||
| header: { | |||
| 'token': app.globalData.token | |||
| }, | |||
| success(res) { | |||
| const data = res.data | |||
| that.setData({ | |||
| receiptUrl: JSON.parse(res.data).data.url | |||
| }) | |||
| wx.hideLoading() | |||
| // do something | |||
| }, | |||
| fail() { | |||
| wx.hideLoading() | |||
| } | |||
| }) | |||
| }, | |||
| }) | |||
| }, | |||
| submit(){ | |||
| let this_ = this; | |||
| if (!this.data.receiptUrl){ | |||
| wx.showToast({ | |||
| title: `请先上传凭证在提交!`, | |||
| icon: "none", | |||
| duration: 1000, | |||
| }) | |||
| return true | |||
| }else{ | |||
| Http.post({ | |||
| url: config.api.finishBill, | |||
| data:{ | |||
| id:this.data.id, | |||
| payImg:this.data.receiptUrl, | |||
| billTypeValue: this.data.billTypeValue, | |||
| newPrice: this.data.newPrice | |||
| } | |||
| }).then(res=>{ | |||
| wx.showToast({ | |||
| title: "上传成功!", | |||
| icon: 'none', | |||
| duration: 2000, | |||
| mask: false, | |||
| success(res){ | |||
| setTimeout(function () { | |||
| this_.goBack() | |||
| }, 2000); | |||
| }, | |||
| }); | |||
| }).catch(err=>{ | |||
| wx.showToast({ | |||
| title: err.message, | |||
| icon: 'none', | |||
| duration: 2000, | |||
| mask: false | |||
| }); | |||
| }) | |||
| } | |||
| }, | |||
| /** | |||
| * 生命周期函数--监听页面加载 | |||
| */ | |||
| onLoad: function (options) { | |||
| console.log(options.id) | |||
| this.setData({ | |||
| id : options.id, | |||
| billTypeValue: options.billTypeValue, | |||
| newPrice: options.newPrice | |||
| }) | |||
| }, | |||
| /** | |||
| * 生命周期函数--监听页面初次渲染完成 | |||
| */ | |||
| onReady: function () { | |||
| }, | |||
| /** | |||
| * 生命周期函数--监听页面显示 | |||
| */ | |||
| onShow: function () { | |||
| }, | |||
| /** | |||
| * 生命周期函数--监听页面隐藏 | |||
| */ | |||
| onHide: function () { | |||
| }, | |||
| /** | |||
| * 生命周期函数--监听页面卸载 | |||
| */ | |||
| onUnload: function () { | |||
| }, | |||
| /** | |||
| * 页面相关事件处理函数--监听用户下拉动作 | |||
| */ | |||
| onPullDownRefresh: function () { | |||
| }, | |||
| /** | |||
| * 页面上拉触底事件的处理函数 | |||
| */ | |||
| onReachBottom: function () { | |||
| }, | |||
| /** | |||
| * 用户点击右上角分享 | |||
| */ | |||
| onShareAppMessage: function () { | |||
| } | |||
| }) | |||
| @@ -0,0 +1,3 @@ | |||
| { | |||
| "navigationBarTitleText": "上传缴费凭证" | |||
| } | |||
| @@ -0,0 +1,20 @@ | |||
| <!-- <view class="topBox"> | |||
| 缴费金额:<view><input type="number" bindinput="setNewPrice"></input></view> | |||
| </view> --> | |||
| <view wx:if='{{receiptUrl!=null}}' class='up-img'> | |||
| <image src='{{receiptUrl}}' mode="widthFix" ></image> | |||
| </view> | |||
| <view class='camera' bindtap='uploadImg'> | |||
| <image src='./../../../static/images/camera.png' mode="widthFix"></image> | |||
| <text>拍摄缴费凭证</text> | |||
| </view> | |||
| <view class="operationBox"> | |||
| <button class='btn' hover-class='active1' bindtap="goBack"> | |||
| 返回 | |||
| </button> | |||
| <button class='btn' hover-class='active1' bindtap="submit"> | |||
| 提交凭证 | |||
| </button> | |||
| </view> | |||
| @@ -0,0 +1,45 @@ | |||
| .camera { | |||
| height: 340rpx; | |||
| width: 310rpx; | |||
| margin: 88rpx auto; | |||
| border: 1px solid #52a0fd; | |||
| color: #52a0fd; | |||
| } | |||
| .camera image { | |||
| width: 59rpx; | |||
| height: 45rpx; | |||
| margin: 113rpx 125rpx 35rpx 126rpx; | |||
| } | |||
| .camera text { | |||
| display: block; | |||
| text-align: center; | |||
| } | |||
| .up-img{ | |||
| width: 600rpx; | |||
| margin: 40rpx auto 0; | |||
| height: auto; | |||
| padding: 10rpx; | |||
| border: 1px dashed #52A0FD; | |||
| } | |||
| .up-img image{ | |||
| width: 600rpx; | |||
| } | |||
| .operationBox{ | |||
| display: flex; | |||
| justify-content: space-between; | |||
| margin-bottom: 40rpx; | |||
| } | |||
| .btn { | |||
| float: right; | |||
| height: 52rpx; | |||
| line-height: 52rpx; | |||
| background: rgba(101, 158, 246, 1); | |||
| border-radius: 10rpx; | |||
| font-size: 28rpx; | |||
| font-weight: 500; | |||
| padding: 0 25rpx; | |||
| color: rgba(255, 255, 255, 1); | |||
| } | |||
| @@ -0,0 +1,71 @@ | |||
| var app = getApp(); | |||
| const config = require('../../config/config.js') | |||
| const util = require('../../utils/util.js') | |||
| const Http = require('../../utils/http.js') | |||
| Page({ | |||
| /** | |||
| * 页面的初始数据 | |||
| */ | |||
| data: { | |||
| }, | |||
| /** | |||
| * 生命周期函数--监听页面加载 | |||
| */ | |||
| onLoad: function(options) { | |||
| }, | |||
| /** | |||
| * 生命周期函数--监听页面初次渲染完成 | |||
| */ | |||
| onReady: function() { | |||
| }, | |||
| /** | |||
| * 生命周期函数--监听页面显示 | |||
| */ | |||
| onShow: function() { | |||
| Http.getRequest(config.api.subsidyList, app.globalData.token, '', { | |||
| pageNum: 1, | |||
| pageSize: 10 | |||
| }, (res) => { | |||
| console.log(res) | |||
| }) | |||
| Http.getRequest(config.api.subsidySum, app.globalData.token, '', { | |||
| }, (res) => { | |||
| console.log(res) | |||
| }) | |||
| }, | |||
| /** | |||
| * 生命周期函数--监听页面隐藏 | |||
| */ | |||
| onHide: function() { | |||
| }, | |||
| /** | |||
| * 生命周期函数--监听页面卸载 | |||
| */ | |||
| onUnload: function() { | |||
| }, | |||
| /** | |||
| * 页面相关事件处理函数--监听用户下拉动作 | |||
| */ | |||
| onPullDownRefresh: function() { | |||
| }, | |||
| /** | |||
| * 页面上拉触底事件的处理函数 | |||
| */ | |||
| onReachBottom: function() { | |||
| }, | |||
| }) | |||
| @@ -0,0 +1,3 @@ | |||
| { | |||
| "usingComponents": {} | |||
| } | |||
| @@ -0,0 +1 @@ | |||
| /* pages/butie/butie.wxss */ | |||
| @@ -0,0 +1,159 @@ | |||
| const config = require('../../config/config.js') | |||
| const Http = require('../../utils/HttpBasics.js') | |||
| const format = require('../../utils/util.js') | |||
| const util = require('../../utils/util.js') | |||
| const qrCodeJS = require('../../utils/qrcode.js') | |||
| var app = getApp() | |||
| // pages/cardPay/cardPay.js | |||
| Page({ | |||
| /** | |||
| * 页面的初始数据 | |||
| */ | |||
| data: { | |||
| pageNum: 1, | |||
| reachBottom: false, | |||
| phone: '', | |||
| list: [] | |||
| }, | |||
| getList(pageNum) { | |||
| const that = this; | |||
| let data = { | |||
| userPhone: that.data.phone, | |||
| pageNum, | |||
| pageSize: 10, | |||
| } | |||
| wx.showLoading() | |||
| Http.get({ | |||
| url: config.api.cardInfoList, | |||
| data | |||
| }) | |||
| .then(res => { | |||
| console.log(res, 'res'); | |||
| if (res.data.list) { | |||
| res.data.list.forEach(item => { | |||
| item.createDate = format.formatTime(item.createDate, 'yyyy-MM-dddd hh:mm:ss') | |||
| item.updateDate = format.formatTime(item.updateDate, 'yyyy-MM-dddd hh:mm:ss') | |||
| item.remainingAmount = (item.remainingAmount / 100) || '' | |||
| if (item.wxCardInfo && item.wxCardInfo.id) { | |||
| item.cardIdHide = item.wxCardInfo.id.slice(0, 4) + `******` + item.wxCardInfo.id.slice(14) | |||
| } | |||
| }) | |||
| if (data.pageNum == 1) { | |||
| that.setData({ | |||
| list: res.data.list | |||
| }) | |||
| } else { | |||
| const tempList = that.data.list | |||
| res.data.list.forEach(item => { | |||
| tempList.push(item) | |||
| }) | |||
| that.setData({ | |||
| list: tempList | |||
| }) | |||
| } | |||
| } | |||
| wx.hideLoading() | |||
| }) | |||
| .catch(err => { | |||
| console.log(err, 'err'); | |||
| wx.showToast({ | |||
| title: err.message, | |||
| icon: 'none' | |||
| }) | |||
| }) | |||
| }, | |||
| goToPay(e) { | |||
| const id = e.currentTarget.dataset.id * 1 | |||
| wx.navigateTo({ | |||
| url: `/pages/cardPay/cardPay?codeInfo=${e.currentTarget.dataset.id}&cardPayType="3"`, | |||
| }) | |||
| }, | |||
| checkNum() { | |||
| const phoneReg = /^(?:(?:\+|00)86)?1\d{10}$/ | |||
| if (!phoneReg.test(this.data.phone)) { | |||
| wx.showToast({ | |||
| title: '请输入正确的手机号!', | |||
| icon: 'none' | |||
| }) | |||
| return | |||
| } | |||
| this.setData({ | |||
| pageNum: 1, | |||
| reachBottom: true | |||
| }); | |||
| this.getList(1) | |||
| console.log(this.data.pageNum, 'pageNum'); | |||
| }, | |||
| getCardNum(e) { | |||
| this.setData({ | |||
| phone: e.detail.value | |||
| }) | |||
| }, | |||
| /** | |||
| * 生命周期函数--监听页面加载 | |||
| */ | |||
| onLoad(options) { | |||
| }, | |||
| /** | |||
| * 生命周期函数--监听页面初次渲染完成 | |||
| */ | |||
| onReady() { | |||
| }, | |||
| /** | |||
| * 生命周期函数--监听页面显示 | |||
| */ | |||
| onShow() { | |||
| }, | |||
| /** | |||
| * 生命周期函数--监听页面隐藏 | |||
| */ | |||
| onHide() { | |||
| }, | |||
| /** | |||
| * 生命周期函数--监听页面卸载 | |||
| */ | |||
| onUnload() { | |||
| }, | |||
| /** | |||
| * 页面相关事件处理函数--监听用户下拉动作 | |||
| */ | |||
| onPullDownRefresh() { | |||
| }, | |||
| /** | |||
| * 页面上拉触底事件的处理函数 | |||
| */ | |||
| onReachBottom() { | |||
| if (!this.data.reachBottom) return | |||
| let pageNum = this.data.pageNum + 1 | |||
| this.setData({ | |||
| pageNum: pageNum | |||
| }); | |||
| this.getList(this.data.pageNum); | |||
| }, | |||
| /** | |||
| * 用户点击右上角分享 | |||
| */ | |||
| onShareAppMessage() { | |||
| } | |||
| }) | |||
| @@ -0,0 +1,6 @@ | |||
| { | |||
| "backgroundTextStyle": "light", | |||
| "navigationBarTitleText": "消费卡收款", | |||
| "navigationBarTextStyle": "white", | |||
| "navigationBarBackgroundColor": "#52A0FD" | |||
| } | |||