| @@ -0,0 +1,22 @@ | |||||
| App({ | |||||
| data:{}, | |||||
| globalData:{ | |||||
| token: "", | |||||
| // "token": "0b272d7d-d669-401a-8d4b-a9eef9340dc1:1027:tt-cuser", | |||||
| imgHttps: 'https://formall.oss-accelerate.aliyuncs.com/douyin/drawable-xhdpi/', | |||||
| platform:null,//手机型号 | |||||
| }, | |||||
| onLaunch: function () { | |||||
| let that = this | |||||
| // this.logn(); | |||||
| try { | |||||
| var res = tt.getSystemInfoSync(); | |||||
| that.statusBarHeight = res.statusBarHeight | |||||
| console.log(`手机型号为 ${res.platform}`); | |||||
| this.globalData.platform = res.platform | |||||
| } catch (error) { | |||||
| console.log(`获取系统信息失败`); | |||||
| } | |||||
| }, | |||||
| statusBarHeight: 0, | |||||
| }) | |||||
| @@ -0,0 +1,48 @@ | |||||
| { | |||||
| "pages": [ | |||||
| "pages/index/index", | |||||
| "pages/main/main", | |||||
| "pages/user/user", | |||||
| "pages/scan/scan", | |||||
| "pages/writeoffPage/writeoffPage", | |||||
| "pages/errorPage/errorPage", | |||||
| "pages/write0ff/write0ff", | |||||
| "pages/marktingsettlement/marktingsettlement", | |||||
| "pages/forgetpwd/forgetpwd", | |||||
| "pages/setpwd/setpwd", | |||||
| "pages/success/success", | |||||
| "pages/transaction/transaction", | |||||
| "pages/creditSelect/index", | |||||
| "pages/memberPhone/index", | |||||
| "pages/Add/index", | |||||
| "pages/operation/index", | |||||
| "pages/getMerchant/index", | |||||
| "pages/editSuccess/index", | |||||
| "pages/exchange/index", | |||||
| "pages/creditOperate/index", | |||||
| "pages/goHtml/goHtml" | |||||
| ], | |||||
| "window": { | |||||
| "backgroundTextStyle": "light", | |||||
| "navigationBarBackgroundColor": "#52A0FD" | |||||
| }, | |||||
| "tabBar": { | |||||
| "color": "#9F9F9F", | |||||
| "selectedColor": "#52a0fd", | |||||
| "backgroundColor": "#fff", | |||||
| "list": [ | |||||
| { | |||||
| "pagePath": "pages/main/main", | |||||
| "text": "首页", | |||||
| "iconPath": "assets/images/home-n.png", | |||||
| "selectedIconPath": "assets/images/home-y.png" | |||||
| }, | |||||
| { | |||||
| "pagePath": "pages/user/user", | |||||
| "text": "我的", | |||||
| "iconPath": "assets/images/user-n.png", | |||||
| "selectedIconPath": "assets/images/user-y.png" | |||||
| } | |||||
| ] | |||||
| } | |||||
| } | |||||
| @@ -0,0 +1,29 @@ | |||||
| .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,358 @@ | |||||
| let config = require("../config/config.js"); | |||||
| var app = getApp(); | |||||
| const func = { | |||||
| getMallIcon: function () { | |||||
| return new Promise((resolve, reject) => { | |||||
| tt.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) => { | |||||
| tt.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) => { | |||||
| tt.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) => { | |||||
| tt.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) => { | |||||
| tt.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) => { | |||||
| tt.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) => { | |||||
| tt.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) => { | |||||
| tt.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) => { | |||||
| tt.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) => { | |||||
| tt.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) { | |||||
| return new Promise((resolve, reject) => { | |||||
| tt.request({ | |||||
| url: config.api.getOpenId, | |||||
| header: { | |||||
| "content-type": "application/json;charset=UTF-8", | |||||
| "token": app.globalData.token, | |||||
| }, | |||||
| data: { | |||||
| appId: config.weapp.appId, | |||||
| code: code, | |||||
| bUserId:bUserId | |||||
| }, | |||||
| method: "POST", | |||||
| success: function (res) { | |||||
| resolve(res) | |||||
| }, | |||||
| fail: function (err) { | |||||
| reject(err) | |||||
| }, | |||||
| complete: function (res) { | |||||
| //console.log("userLogin complete:" + res) | |||||
| } | |||||
| }) | |||||
| }) | |||||
| }, | |||||
| /** | |||||
| * 获得超级管理员openId | |||||
| */ | |||||
| getSuperOpenId: function (code) { | |||||
| return new Promise((resolve, reject) => { | |||||
| tt.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) => { | |||||
| tt.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 @@ | |||||
| <?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="128px" height="128.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path fill="#202020" d="M962.986667 480.426667l-422.4-379.733334a42.666667 42.666667 0 0 0-57.173334 0l-422.4 379.733334a42.666667 42.666667 0 0 0 57.173334 63.146666l9.813333-8.533333V896a42.666667 42.666667 0 0 0 42.666667 42.666667h682.666666a42.666667 42.666667 0 0 0 42.666667-42.666667v-360.96l9.813333 8.533333a42.666667 42.666667 0 0 0 28.586667 11.093334 42.666667 42.666667 0 0 0 31.573333-14.08 42.666667 42.666667 0 0 0-2.986666-60.16zM469.333333 853.333333v-170.666666h85.333334v170.666666z m341.333334-384v384h-170.666667v-213.333333a42.666667 42.666667 0 0 0-42.666667-42.666667h-170.666666a42.666667 42.666667 0 0 0-42.666667 42.666667v213.333333H213.333333v-384a61.013333 61.013333 0 0 0 0-9.386666l298.666667-270.08 298.666667 270.08a61.013333 61.013333 0 0 0 0 9.386666z" /></svg> | |||||
| @@ -0,0 +1,71 @@ | |||||
| const app = getApp() | |||||
| Component({ | |||||
| properties: { | |||||
| background: { | |||||
| type: String, | |||||
| value: '#F4F5F9' | |||||
| }, | |||||
| color: { | |||||
| type: String, | |||||
| value: '#000' | |||||
| }, | |||||
| text: { | |||||
| type: String, | |||||
| value: 'Wechat' | |||||
| }, | |||||
| showLocationIf: { | |||||
| type: Boolean, | |||||
| value: false | |||||
| }, | |||||
| back: { | |||||
| type: Boolean, | |||||
| value: false | |||||
| }, | |||||
| home: { | |||||
| type: Boolean, | |||||
| value: false | |||||
| } | |||||
| }, | |||||
| data: { | |||||
| array: ['A广场', 'B广场-北京西单'], | |||||
| index: 1, | |||||
| statusBarHeight: app.statusBarHeight + 'px', | |||||
| navigationBarHeight: (app.statusBarHeight + 44) + 'px', | |||||
| imgHttps: app.globalData.imgHttps, | |||||
| }, | |||||
| methods: { | |||||
| backHome: function () { | |||||
| tt.switchTab({ | |||||
| url: `/pages/main/main`, | |||||
| success(res) { | |||||
| console.log(`${res}`); | |||||
| }, | |||||
| fail(res) { | |||||
| console.log(`switchTab调用失败`); | |||||
| }, | |||||
| }); | |||||
| }, | |||||
| bindPickerChange: function (e) { | |||||
| console.log('picker发送选择改变,携带值为', e.detail.value) | |||||
| this.setData({ | |||||
| index: e.detail.value | |||||
| }) | |||||
| }, | |||||
| back: function () { | |||||
| tt.navigateBack({ | |||||
| delta: 1 | |||||
| }) | |||||
| } | |||||
| }, | |||||
| attached: function(){ | |||||
| let pages = getCurrentPages(); | |||||
| if (pages.length <= 1) { | |||||
| this.setData({ | |||||
| back: false | |||||
| }) | |||||
| } | |||||
| } | |||||
| }) | |||||
| @@ -0,0 +1,3 @@ | |||||
| { | |||||
| "component": true | |||||
| } | |||||
| @@ -0,0 +1,21 @@ | |||||
| <view class="navbar" style="background:{{background}}!important;"> | |||||
| <view style="{{'height: ' + statusBarHeight}}"></view> | |||||
| <view class='title-container'> | |||||
| <view class='capsule' tt:if="{{ back || home}}"> | |||||
| <view bindtap='back' tt:if="{{back}}"> | |||||
| <image style="left:36%;" src='./img/back.png'></image> | |||||
| </view> | |||||
| <view bindtap='backHome' tt:if="{{home}}"> | |||||
| <image src='img/home.png' style="width:60%;"></image> | |||||
| </view> | |||||
| </view> | |||||
| <view class='title' style="color:{{color}}!important">{{text}}</view> | |||||
| <picker bindchange="bindPickerChange" tt:if="{{showLocationIf}}" class="pick-box" value="{{index}}" range="{{array}}"> | |||||
| <icon class='iconfont icon-daohangdizhiweizhi'></icon> | |||||
| <view class="picker locations"> | |||||
| {{array[index]}} | |||||
| </view> | |||||
| </picker> | |||||
| </view> | |||||
| </view> | |||||
| @@ -0,0 +1,91 @@ | |||||
| .navbar { | |||||
| width: 100vw; | |||||
| background-color: #F4F5F9; | |||||
| position: fixed; | |||||
| left: 0; | |||||
| top: 0; | |||||
| overflow: hidden; | |||||
| z-index: 400000000; | |||||
| } | |||||
| .title-container { | |||||
| height: 44px; | |||||
| display: flex; | |||||
| align-items: center; | |||||
| position: relative; | |||||
| } | |||||
| .capsule { | |||||
| margin-left: 10px; | |||||
| height: 32px; | |||||
| /* border: 1px solid #e1e1e3; */ | |||||
| border-radius: 60px; | |||||
| display: flex; | |||||
| align-items: center; | |||||
| padding: 0 20rpx; | |||||
| /* background: #fff!important; */ | |||||
| } | |||||
| .capsule > view { | |||||
| width: 35px; | |||||
| height: 60%; | |||||
| position: relative; | |||||
| } | |||||
| .capsule > view:nth-child(2) { | |||||
| border-left: 1px solid #777; | |||||
| } | |||||
| .capsule image { | |||||
| width: 70%; | |||||
| height: 100%; | |||||
| position: absolute; | |||||
| left: 50%; | |||||
| top: 50%; | |||||
| transform: translate(-50%,-50%); | |||||
| } | |||||
| .title { | |||||
| color: #000; | |||||
| position: absolute; | |||||
| left: 104px; | |||||
| right: 104px; | |||||
| font-weight: 600; | |||||
| font-size: 32rpx; | |||||
| text-align: center; | |||||
| overflow: hidden; | |||||
| text-overflow: ellipsis; | |||||
| white-space: nowrap; | |||||
| } | |||||
| @font-face { | |||||
| font-family: 'iconfont'; /* project id 1353695 */ | |||||
| src: url('//at.alicdn.com/t/font_1353695_nyv2ld9xqk8.eot'); | |||||
| src: url('//at.alicdn.com/t/font_1353695_nyv2ld9xqk8.eot?#iefix') format('embedded-opentype'), | |||||
| url('//at.alicdn.com/t/font_1353695_nyv2ld9xqk8.woff2') format('woff2'), | |||||
| url('//at.alicdn.com/t/font_1353695_nyv2ld9xqk8.woff') format('woff'), | |||||
| url('//at.alicdn.com/t/font_1353695_nyv2ld9xqk8.ttf') format('truetype'), | |||||
| url('//at.alicdn.com/t/font_1353695_nyv2ld9xqk8.svg#iconfont') format('svg'); | |||||
| } | |||||
| .iconfont { | |||||
| font-family: "iconfont" !important; | |||||
| font-size: 16px; | |||||
| font-style: normal; | |||||
| -webkit-font-smoothing: antialiased; | |||||
| -moz-osx-font-smoothing: grayscale; | |||||
| } | |||||
| .icon-daohangdizhiweizhi:before { | |||||
| content: "\e787"; | |||||
| } | |||||
| .locations{ | |||||
| font-size: 28rpx; | |||||
| display: inline-block; | |||||
| width: 200rpx; | |||||
| overflow: hidden; | |||||
| text-overflow:ellipsis; | |||||
| white-space: nowrap; | |||||
| } | |||||
| .pick-box{ | |||||
| width: 260rpx; | |||||
| padding-left: 20rpx; | |||||
| } | |||||
| @@ -0,0 +1,345 @@ | |||||
| const extConfig = wx.getExtConfigSync ? wx.getExtConfigSync().extConfig : {} | |||||
| let weappId = extConfig.weappId; | |||||
| let dataTowerUrl = extConfig.attr.datatowerurl; | |||||
| let url = extConfig.attr.configUrl; | |||||
| var apiPrefix = url + '/B'; | |||||
| let config = { | |||||
| api: { | |||||
| // 获取进件 页面地址 | |||||
| findTt: "/api/merchant/getTtReceiverUrl", | |||||
| /** | |||||
| * 接口用途: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', | |||||
| /** | |||||
| * 未核销的券包 | |||||
| */ | |||||
| couponOrderListUnVerified: '/api/couponOrder/listUnverified', | |||||
| /** | |||||
| * 上报解单 | |||||
| */ | |||||
| reportDailyVolume: '/api/wxMerchantTradeDaily/reportDailyVolume', | |||||
| /** | |||||
| * 获取当日解单 | |||||
| */ | |||||
| 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', | |||||
| /** | |||||
| *刷卡支付交易流水分页列表接口 | |||||
| */ | |||||
| micropayListMicroPay: '/api/micropay/listMicroPay', | |||||
| /** | |||||
| *刷卡支付退款 | |||||
| */ | |||||
| // microPayRefund: '/api/micropay/microPayRefund', | |||||
| /** | |||||
| *刷卡支付某日期交易总流水 | |||||
| */ | |||||
| getMicroPayAmountOnDate: '/api/micropay/getMicroPayAmountOnDate', | |||||
| /** | |||||
| * 首页账单列表 | |||||
| */ | |||||
| listBillOweAndWaitPay: "/api/bill/listBillOweAndWaitPay", | |||||
| /** | |||||
| * 账单 | |||||
| */ | |||||
| listBill: "/api/bill/listBill", | |||||
| /** | |||||
| * 获得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", | |||||
| /** | |||||
| *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", | |||||
| }, | |||||
| weapp: { | |||||
| appId: weappId, | |||||
| dataTowerUrl: dataTowerUrl, | |||||
| // appId: "tt7af40c49e5cd8d5001", | |||||
| // dataTowerUrl: "https://mobiletest.malls.iformall.com", | |||||
| } | |||||
| } | |||||
| for (var key in config.api) { | |||||
| config.api[key] = apiPrefix + config.api[key]; | |||||
| } | |||||
| console.log(config,"config"); | |||||
| module.exports = config; | |||||
| @@ -0,0 +1,118 @@ | |||||
| import WxCanvas from './tt-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 = tt.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 = tt.createCanvasContext(this.data.canvasId, this); | |||||
| const canvas = new WxCanvas(ctx, this.data.canvasId); | |||||
| echarts.setCanvasCreator(() => { | |||||
| return canvas; | |||||
| }); | |||||
| var query = tt.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, () => { | |||||
| tt.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,96 @@ | |||||
| 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; | |||||
| // } | |||||
| 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,47 @@ | |||||
| { | |||||
| "ext": { | |||||
| "attr": { | |||||
| "configUrl": "https://btest.malls.iformall.com", | |||||
| "datatowerurl": "https://mobile.malls.iformall.com" | |||||
| }, | |||||
| "name": "富茂券商户端模板", | |||||
| "weappId": "tt7af40c49e5cd8d5001", | |||||
| "appVersion": "Btest.5.1.0" | |||||
| }, | |||||
| "debug": false, | |||||
| "tabBar": { | |||||
| "color": "#9F9F9F", | |||||
| "selectedColor": "#52a0fd", | |||||
| "backgroundColor": "#fff", | |||||
| "list": [ | |||||
| { | |||||
| "pagePath": "pages/main/main", | |||||
| "text": "首页", | |||||
| "iconPath": "assets/images/home-n.png", | |||||
| "selectedIconPath": "assets/images/home-y.png" | |||||
| }, | |||||
| { | |||||
| "pagePath": "pages/user/user", | |||||
| "text": "我的", | |||||
| "iconPath": "assets/images/user-n.png", | |||||
| "selectedIconPath": "assets/images/user-y.png" | |||||
| } | |||||
| ] | |||||
| }, | |||||
| "window": { | |||||
| "backgroundTextStyle": "light", | |||||
| "navigationBarBackgroundColor": "#52A0FD" | |||||
| }, | |||||
| "extAppid": "tt7af40c49e5cd8d5001", | |||||
| "extEnable": true, | |||||
| "permission": { | |||||
| "scope.userLocation": { | |||||
| "desc": "你的位置信息将用于小程序位置接口的效果展示" | |||||
| } | |||||
| }, | |||||
| "directCommit": false, | |||||
| "networkTimeout": { | |||||
| "request": 30000, | |||||
| "downloadFile": 10000 | |||||
| } | |||||
| } | |||||
| @@ -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,115 @@ | |||||
| // 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 | |||||
| }); | |||||
| console.log(options,"options") | |||||
| 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=>{ | |||||
| tt.showToast({ | |||||
| title: '商户信息获取出错', | |||||
| icon: 'none', | |||||
| duration: 2000, | |||||
| mask: false | |||||
| }); | |||||
| }) | |||||
| }, | |||||
| gotoScore(e){ | |||||
| // console.log(e.currentTarget.id,6666666666) | |||||
| if (e.currentTarget.id == '1') { | |||||
| tt.navigateTo({ | |||||
| url: `/pages/operation/index?address=${this.data.paramData.address}&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 { | |||||
| tt.navigateTo({ | |||||
| url: `/pages/exchange/index?address=${this.data.paramData.address}&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,4 @@ | |||||
| { | |||||
| "navigationBarTitleText": "会员积分", | |||||
| "navigationBarTextStyle": "white" | |||||
| } | |||||
| @@ -0,0 +1,28 @@ | |||||
| <!--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' tt:if="{{!phoneIf}}">会员未授权手机号,请用户先去授权手机号!</view> | |||||
| <view class='butBox'> | |||||
| <button id='1' bindtap='gotoScore' tt:if="{{phoneIf}}" style='{{"width:"+(userData.is_admin==1?"":"690rpx")}}'>新增积分</button> | |||||
| <button id='2' bindtap='gotoScore' tt: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,199 @@ | |||||
| // pages/creditOperate/index.js | |||||
| const config = require('../../config/config.js') | |||||
| const Http = require('../../utils/HttpBasics.js') | |||||
| const util = require('../../utils/util.js') | |||||
| const app = getApp(); | |||||
| Page({ | |||||
| /** | |||||
| * 页面的初始数据 | |||||
| */ | |||||
| data: { | |||||
| date: util.formatTime(new Date(), 'yyyy-MM-dddd'), //默认起始时间 | |||||
| date2: util.formatTime(new Date(), 'yyyy-MM-dddd'), //默认结束时间 | |||||
| endDate: util.formatTime(new Date(), 'yyyy-MM-dddd'), | |||||
| list: [], | |||||
| showNocontent: false, | |||||
| todayDate: null, | |||||
| pageNum: 1, | |||||
| length: 0, | |||||
| userInfo:null, | |||||
| listData:[], | |||||
| loading:false, | |||||
| content:'正在加载中', | |||||
| pages:null | |||||
| }, | |||||
| /** | |||||
| * 生命周期函数--监听页面加载 | |||||
| */ | |||||
| onLoad: function (options) { | |||||
| this.getUser() | |||||
| }, | |||||
| 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) | |||||
| }, | |||||
| search(){ | |||||
| this.getList(this.data.pageNum) | |||||
| }, | |||||
| getUser(){ | |||||
| let _this=this; | |||||
| app.globalData.userInfo().then(res => { | |||||
| this.setData({ | |||||
| userInfo: res | |||||
| }) | |||||
| _this.getList(1); | |||||
| console.log(res); | |||||
| }) | |||||
| }, | |||||
| formatData(data){ | |||||
| let arr=[]; | |||||
| data.map((item,index)=>{ | |||||
| let a = {}; | |||||
| a.value = [item]; | |||||
| a.dateR = item.createDate01; | |||||
| let indexSt=0; | |||||
| let haveIf=false; | |||||
| arr.map((item01,index01)=>{ | |||||
| if (item.createDate01 == item01.dateR){ | |||||
| indexSt = index01; | |||||
| haveIf=true; | |||||
| } | |||||
| }) | |||||
| if (haveIf && (new Date(item.createDate)).valueOf() >= (new Date((this.data.date + ' 00:00:00').replace(/-/g, "/"))).getTime() && (new Date(item.createDate)).valueOf() <= (new Date((this.data.date2 + ' 23:59:59').replace(/-/g, "/"))).getTime()){ | |||||
| arr[indexSt].value.push(item) | |||||
| } else if ((new Date(item.createDate)).valueOf() >= (new Date((this.data.date + ' 00:00:00').replace(/-/g, "/"))).getTime() && (new Date(item.createDate)).valueOf() <= (new Date((this.data.date2 + ' 23:59:59').replace(/-/g, "/"))).getTime()){ | |||||
| arr.push(a) | |||||
| } | |||||
| }) | |||||
| this.setData({ | |||||
| list:arr | |||||
| }) | |||||
| }, | |||||
| getList(page){ | |||||
| let _this=this; | |||||
| Http.get({ | |||||
| url: config.api.getCreditList, | |||||
| data: { | |||||
| pageNum: page, | |||||
| pageSize: 10, | |||||
| startTime: this.data.date + " 00:00:00", | |||||
| endTime: this.data.date2 + " 23:59:59", | |||||
| merchantId: _this.data.userInfo.merchant_id | |||||
| } | |||||
| }) | |||||
| .then(res => { | |||||
| tt.stopPullDownRefresh(); | |||||
| let data=res.data.list; | |||||
| let listData = []; | |||||
| if(page==1){ | |||||
| listData = res.data.list; | |||||
| }else{ | |||||
| listData = _this.data.listData; | |||||
| } | |||||
| console.log(data) | |||||
| data.map((item, index) => { | |||||
| let haveIf = false; | |||||
| item.createDate01 = util.formatTime(item.createDate, 'yyyy-MM-dddd') | |||||
| listData.map((item02, index02) => { | |||||
| if (item02.creditId == item.creditId) { | |||||
| haveIf = true; | |||||
| } | |||||
| }) | |||||
| if (!haveIf) { | |||||
| listData.push(item) | |||||
| } | |||||
| }) | |||||
| _this.formatData(listData) | |||||
| if (res.data.pages <= page) { | |||||
| _this.setData({ | |||||
| listData, | |||||
| pageNum: res.data.pages-1, | |||||
| content: '已经加载全部数据!' | |||||
| }) | |||||
| } else { | |||||
| _this.setData({ | |||||
| listData, | |||||
| loading: false, | |||||
| content:'小主,我在玩命加载中...' | |||||
| }) | |||||
| } | |||||
| }) | |||||
| .catch(err => { | |||||
| tt.stopPullDownRefresh(); | |||||
| tt.showToast({ | |||||
| title: err.message, | |||||
| icon: 'none', | |||||
| duration: 2000, | |||||
| mask: false | |||||
| }); | |||||
| }); | |||||
| }, | |||||
| /** | |||||
| * 生命周期函数--监听页面初次渲染完成 | |||||
| */ | |||||
| onReady: function () { | |||||
| }, | |||||
| /** | |||||
| * 生命周期函数--监听页面显示 | |||||
| */ | |||||
| onShow: function () { | |||||
| }, | |||||
| /** | |||||
| * 生命周期函数--监听页面隐藏 | |||||
| */ | |||||
| onHide: function () { | |||||
| }, | |||||
| /** | |||||
| * 生命周期函数--监听页面卸载 | |||||
| */ | |||||
| onUnload: function () { | |||||
| }, | |||||
| /** | |||||
| * 刷新 | |||||
| */ | |||||
| onPullDownRefresh: function (e) { | |||||
| let that = this; | |||||
| that.setData({ | |||||
| pageNum: 1, | |||||
| list: [] | |||||
| }); | |||||
| that.getList(1); | |||||
| }, | |||||
| onReachBottom: function () { | |||||
| var that = this; | |||||
| that.data.pageNum++; | |||||
| that.setData({ | |||||
| pageNum: that.data.pageNum, | |||||
| loading: true | |||||
| }); | |||||
| that.getList(that.data.pageNum); | |||||
| }, | |||||
| /** | |||||
| * 用户点击右上角分享 | |||||
| */ | |||||
| onShareAppMessage: function () { | |||||
| } | |||||
| }) | |||||
| @@ -0,0 +1,6 @@ | |||||
| { | |||||
| "navigationBarTitleText": "积分操作记录", | |||||
| "enablePullDownRefresh": true, | |||||
| "backgroundTextStyle": "dark", | |||||
| "navigationBarTextStyle": "white" | |||||
| } | |||||
| @@ -0,0 +1,48 @@ | |||||
| <image class='img' src='./../../static/images/bg.png' mode='widthFix'></image> | |||||
| <view class='head'> | |||||
| <image src='./../../static/images/reviveimg.png' mode='widthFix'></image> | |||||
| <view class='time'> | |||||
| <view> | |||||
| <text>开始日期</text> | |||||
| <picker mode="date" value="{{date}}" start="1970-01-01" end="{{endDate}}" bindchange="bindDateChange"> | |||||
| <view class="picker"> | |||||
| {{date}} | |||||
| </view> | |||||
| </picker> | |||||
| </view> | |||||
| <view> | |||||
| <text></text> | |||||
| <text>至</text> | |||||
| </view> | |||||
| <view> | |||||
| <text>结束日期</text> | |||||
| <picker mode="date" value="{{date2}}" start="1970-01-01" end="{{endDate}}" bindchange="bindDateChange2"> | |||||
| <view class="picker"> | |||||
| {{date2}} | |||||
| </view> | |||||
| </picker> | |||||
| </view> | |||||
| </view> | |||||
| </view> | |||||
| <button class='btn' hover-class='active' bindtap='search'>查询</button> | |||||
| <view class="contents"> | |||||
| <view tt:for="{{list}}" tt:key="{{index}}"> | |||||
| <view class='date-t'>{{item.dateR}}</view> | |||||
| <view class='content clearfix' tt:for="{{item.value}}" tt:for-item="item01" tt:key="{{index01}}"> | |||||
| <view class='le'> | |||||
| <text>{{item01.name}}</text> | |||||
| <text>{{item01.createDate01}}</text> | |||||
| </view> | |||||
| <view class='fr'> | |||||
| <text>{{item01.creditNum>0?('+'+item01.creditNum):(item01.creditNum)}}</text> | |||||
| <text>{{'操作人:'+item01.operator}}</text> | |||||
| </view> | |||||
| </view> | |||||
| </view> | |||||
| </view> | |||||
| <view class="loading" tt:if="{{loading}}"> | |||||
| {{content}} | |||||
| </view> | |||||
| <view class='nocontent' tt:if="{{showNocontent}}"> | |||||
| 暂无数据 | |||||
| </view> | |||||
| @@ -0,0 +1,235 @@ | |||||
| page { | |||||
| background: #f6f6f6; | |||||
| } | |||||
| .head { | |||||
| height: 227rpx; | |||||
| width: 681rpx; | |||||
| margin: -45rpx auto 0; | |||||
| position: relative; | |||||
| } | |||||
| picker { | |||||
| width: 180rpx; | |||||
| text-align:center; | |||||
| height: 45rpx; | |||||
| font-size: 30rpx; | |||||
| overflow: hidden; | |||||
| color: rgba(85, 85, 85, 1); | |||||
| margin: 0 auto; | |||||
| } | |||||
| .head image { | |||||
| position: absolute; | |||||
| width: 100%; | |||||
| height: 100% !important; | |||||
| left: 0; | |||||
| right: 0; | |||||
| top: 0; | |||||
| bottom: 0; | |||||
| z-index: 1; | |||||
| } | |||||
| .time { | |||||
| position: relative; | |||||
| display: flex; | |||||
| flex: 2.5; | |||||
| text-align: center; | |||||
| z-index: 10; | |||||
| align-items: center; | |||||
| } | |||||
| .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; | |||||
| } | |||||
| .btn { | |||||
| background: #51a0fc; | |||||
| height: 76rpx; | |||||
| line-height: 76rpx; | |||||
| display: block; | |||||
| width: 681rpx; | |||||
| margin: 0 auto; | |||||
| border-top-left-radius: 0 !important; | |||||
| border-top-right-radius: 0 !important; | |||||
| border-bottom-left-radius: 16rpx; | |||||
| border-bottom-right-radius: 16rpx; | |||||
| color: #fff; | |||||
| font-size: 30rpx; | |||||
| box-shadow: 0 9rpx 16rpx 0 rgba(81, 160, 252, 0.57); | |||||
| } | |||||
| button::after { | |||||
| border: none; | |||||
| } | |||||
| .active { | |||||
| opacity: 0.6; | |||||
| } | |||||
| .acount { | |||||
| width: 630rpx; | |||||
| display: flex; | |||||
| margin: 30rpx auto 0; | |||||
| padding: 35rpx 0; | |||||
| flex: 2; | |||||
| text-align: center; | |||||
| border-top: 1px solid #e3f0ff; | |||||
| } | |||||
| .acount>view { | |||||
| flex: 1; | |||||
| } | |||||
| .acount>view text { | |||||
| display: block; | |||||
| color: #999; | |||||
| font-size: 26rpx; | |||||
| } | |||||
| .acount>view text:nth-of-type(2n) { | |||||
| color: #333; | |||||
| font-size: 40rpx; | |||||
| margin-top: 20rpx; | |||||
| } | |||||
| .content { | |||||
| position: relative; | |||||
| padding: 0 35rpx; | |||||
| height: 145rpx; | |||||
| background: #fff; | |||||
| border-bottom: 1px solid #eaeaea; | |||||
| } | |||||
| .content>view:nth-of-type(2n+1) text { | |||||
| display: block; | |||||
| } | |||||
| .content>view:nth-of-type(2n+1) text:nth-of-type(1) { | |||||
| margin-top: 27rpx; | |||||
| } | |||||
| .content>view:nth-of-type(2n+1) text:nth-of-type(2) { | |||||
| margin-top: 10rpx; | |||||
| font-size: 26rpx; | |||||
| font-family: PingFang-SC-Bold; | |||||
| color: rgba(153, 153, 153, 1); | |||||
| } | |||||
| .content>view:nth-of-type(2n+1) { | |||||
| float: left; | |||||
| width: 40%; | |||||
| } | |||||
| .content>view:nth-of-type(2n) { | |||||
| width: 55%; | |||||
| float: right; | |||||
| text-align: right; | |||||
| } | |||||
| .nocontent { | |||||
| text-align: center; | |||||
| font-size: 30rpx; | |||||
| padding: 30rpx 0; | |||||
| } | |||||
| .contents { | |||||
| margin-top: 20rpx; | |||||
| } | |||||
| .content .fr text:nth-of-type(1) { | |||||
| margin-top: 36rpx; | |||||
| } | |||||
| .content .fr text:nth-of-type(1), .content .fr text:nth-of-type(3) { | |||||
| color:rgba(51,51,51,1); | |||||
| display: block; | |||||
| font-size: 28rpx; | |||||
| } | |||||
| .content .fr text:nth-of-type(2) { | |||||
| display: block; | |||||
| color:rgba(153,153,153,1); | |||||
| font-size: 26rpx; | |||||
| } | |||||
| .img { | |||||
| display: block; | |||||
| width: 100%; | |||||
| } | |||||
| .title { | |||||
| display: block; | |||||
| text-align: center; | |||||
| color: rgba(153, 153, 153, 1); | |||||
| font-size: 26rpx; | |||||
| } | |||||
| .total { | |||||
| display: block; | |||||
| text-align: center; | |||||
| font-size: 70rpx; | |||||
| margin: 36rpx 0; | |||||
| font-family: PingFang-SC-Bold; | |||||
| font-weight: bold; | |||||
| color: rgba(51, 51, 51, 1); | |||||
| } | |||||
| .acounts { | |||||
| width: 680rpx; | |||||
| margin: 48rpx auto 48rpx; | |||||
| border: 1px solid #51a0fc; | |||||
| border-radius: 16rpx; | |||||
| padding: 40rpx 0 0; | |||||
| background: #fff; | |||||
| } | |||||
| .daishou{ | |||||
| width: 133rpx; | |||||
| height: 79rpx; | |||||
| position: absolute; | |||||
| top: 0; | |||||
| bottom: 0; | |||||
| right:264rpx; | |||||
| margin: auto; | |||||
| } | |||||
| .date-t{ | |||||
| font-size:26rpx; | |||||
| font-family:PingFang-SC-Regular; | |||||
| font-weight:400; | |||||
| color:rgba(153,153,153,1); | |||||
| line-height:44rpx; | |||||
| padding:0 35rpx; | |||||
| margin: 10rpx 0; | |||||
| } | |||||
| .loading{ | |||||
| color:rgba(51,51,51,1); | |||||
| font-size:28rpx; | |||||
| line-height: 40rpx; | |||||
| margin:30rpx 0; | |||||
| text-align: center; | |||||
| } | |||||
| @@ -0,0 +1,73 @@ | |||||
| const config = require('../../config/config.js') | |||||
| const Http = require('../../utils/http.js') | |||||
| const HttpBasics = require('../../utils/HttpBasics.js') | |||||
| const util = require('../../utils/util.js') | |||||
| import * as echarts from '../../ec-canvas/echarts'; | |||||
| var app = getApp() | |||||
| Page({ | |||||
| /** | |||||
| * 页面的初始数据 | |||||
| */ | |||||
| data: { | |||||
| }, | |||||
| gotoSaoyiSao: function () { | |||||
| tt.scanCode({ | |||||
| success: function (val) { | |||||
| console.log(val.result); | |||||
| if (util.isJSON(val.result)) { | |||||
| let value = JSON.parse(val.result); | |||||
| if (value.END == 'C' && value.TYPE == 'memberCode' && value.ID.length >= 18) { | |||||
| Http.postRequest(config.api.memScan, app.globalData.token, '加载中', { | |||||
| memCode: value.ID | |||||
| }, (res) => { | |||||
| console.log(res, 9999999999) | |||||
| if (res.code == 200) { | |||||
| if (res.data.discountRate != 100) { | |||||
| var discountRate = res.data.discountRate / 10; | |||||
| } else { | |||||
| var discountRate = "暂无折扣"; | |||||
| } | |||||
| tt.navigateTo({ | |||||
| url: `/pages/Add/index?address=${res.data.address}&id=${res.data.id}&levelName=${res.data.levelName}&nickName=${res.data.nickName}&name=${res.data.name}&phone=${res.data.phone}&score=${res.data.score}&discountRate=${discountRate}&credit=${res.data.credit}` | |||||
| }) | |||||
| } else { | |||||
| tt.showModal({ | |||||
| title: "抱歉", | |||||
| content: res.message, | |||||
| showCancel: false | |||||
| }) | |||||
| } | |||||
| }) | |||||
| } else { | |||||
| tt.showToast({ | |||||
| title: '请扫描正确的二维码', | |||||
| icon: 'none', | |||||
| duration: 1300 | |||||
| }) | |||||
| } | |||||
| } else { | |||||
| tt.showToast({ | |||||
| title: '请扫描正确的二维码', | |||||
| icon: 'none', | |||||
| duration: 1300 | |||||
| }) | |||||
| } | |||||
| }, | |||||
| fail: function () { | |||||
| tt.showToast({ | |||||
| title: '请扫描正确的二维码', | |||||
| icon: 'none', | |||||
| duration: 1300 | |||||
| }) | |||||
| } | |||||
| }) | |||||
| }, | |||||
| // 跳转到手动核销 | |||||
| aoto: function () { | |||||
| tt.navigateTo({ | |||||
| url: '/pages/memberPhone/index?a=1', | |||||
| }) | |||||
| }, | |||||
| }) | |||||
| @@ -0,0 +1,4 @@ | |||||
| { | |||||
| "navigationBarTitleText": "积分操作形式", | |||||
| "navigationBarTextStyle": "white" | |||||
| } | |||||
| @@ -0,0 +1,6 @@ | |||||
| <view class='content'> | |||||
| <image src='./../../static/images/scan.png' mode='widthFix'></image> | |||||
| <button class='btn1' hover-class='active' bindtap='gotoSaoyiSao'>识别会员码</button> | |||||
| <button class='btn2' hover-class='active' bindtap='aoto'>手机号查询</button> | |||||
| </view> | |||||
| @@ -0,0 +1,41 @@ | |||||
| /* pages/scan/scan.wxss */ | |||||
| page{ | |||||
| background: #52A0FD; | |||||
| } | |||||
| .content{ | |||||
| width: 588rpx; | |||||
| margin: 0 auto; | |||||
| background: #fff; | |||||
| border-radius:10rpx; | |||||
| padding-bottom: 100rpx; | |||||
| padding: 0 46rpx 46rpx; | |||||
| } | |||||
| .content image{ | |||||
| width: 603rpx; | |||||
| margin: 48rpx auto 0; | |||||
| } | |||||
| button::after{ border: none; } | |||||
| .btn1{ | |||||
| width: 550rpx; | |||||
| margin: 50rpx auto 0; | |||||
| background:#52A0FD; | |||||
| border:1px solid #52A0FD; | |||||
| border-radius:45rpx; | |||||
| color: #fff; | |||||
| font-weight:400; | |||||
| font-size:36rpx; | |||||
| box-shadow: 0 6px 20px 0 rgba(183, 216, 254, 1); | |||||
| } | |||||
| .btn2{ | |||||
| width: 550rpx; | |||||
| margin: 50rpx auto 0; | |||||
| background:rgba(255,255,255,1); | |||||
| border:1px solid rgba(180,212,249,1); | |||||
| border-radius:45rpx; | |||||
| font-weight:400; | |||||
| font-size:36rpx; | |||||
| color:rgba(81,160,252,1); | |||||
| } | |||||
| .active{ | |||||
| opacity: .6; | |||||
| } | |||||
| @@ -0,0 +1,55 @@ | |||||
| 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: { | |||||
| showDetailIf: true, | |||||
| creditNum:0, | |||||
| type:1, | |||||
| creditAmount:0, | |||||
| titleH:'', | |||||
| title:[] | |||||
| }, | |||||
| goOn(){ | |||||
| tt.navigateBack({ | |||||
| delta: 1 | |||||
| }) | |||||
| }, | |||||
| goBack(){ | |||||
| tt.reLaunch({ | |||||
| url: '/pages/main/main', | |||||
| }) | |||||
| }, | |||||
| /** | |||||
| * 生命周期函数--监听页面显示 | |||||
| */ | |||||
| onLoad: function (options) { | |||||
| console.log(options) | |||||
| if (options.titleH){ | |||||
| this.setData({ | |||||
| type: options.type, | |||||
| titleH: options.titleH, | |||||
| title: options.titleH.split(',') | |||||
| }) | |||||
| tt.setNavigationBarTitle({ | |||||
| title: '会员赠券' | |||||
| }) | |||||
| }else{ | |||||
| this.setData({ | |||||
| creditNum: options.creditNum, | |||||
| type: options.type, | |||||
| creditAmount: options.creditAmount, | |||||
| }) | |||||
| tt.setNavigationBarTitle({ | |||||
| title: '会员积分' | |||||
| }) | |||||
| } | |||||
| console.log(this.data.titleH, this.data.title) | |||||
| }, | |||||
| }) | |||||
| @@ -0,0 +1,6 @@ | |||||
| { | |||||
| "backgroundTextStyle": "light", | |||||
| "navigationBarTitleText": "会员赠券", | |||||
| "navigationBarTextStyle": "white", | |||||
| "navigationBarBackgroundColor": "#52A0FD" | |||||
| } | |||||
| @@ -0,0 +1,24 @@ | |||||
| <!--pages/editSuccess/index.wxml--> | |||||
| <view class='content'> | |||||
| <view class='cBox'> | |||||
| <image class='tick' src='../../static/images/tick.png' mode='widthFix'></image> | |||||
| <text class='txt1'>操作成功</text> | |||||
| </view> | |||||
| <view tt:if="{{type==1}}"> | |||||
| <text class='txt2'>本次积分:<text class='txt3'>+{{creditNum}}</text></text> | |||||
| </view> | |||||
| <view tt:if="{{type==2}}"> | |||||
| <text class='txt4'>消费积分:<text class='txt3'>-{{creditNum}}</text></text> | |||||
| <text class='txt5'>剩余积分:<text class='txt6'>{{creditAmount}}</text></text> | |||||
| </view> | |||||
| <view tt:if="{{type==3}}"> | |||||
| <view class='title' tt:for="{{title}}" tt:key="{{index}}"> | |||||
| <view class='txt3'>{{item}}赠送成功</view> | |||||
| </view> | |||||
| <!-- <text class='txt7' >赠送成功</text> --> | |||||
| </view> | |||||
| </view> | |||||
| <view class='bBox'> | |||||
| <button class='goOn' bindtap='goOn'>继续</button> | |||||
| <button class='goBack' bindtap='goBack'>返回首页</button> | |||||
| </view> | |||||
| @@ -0,0 +1,110 @@ | |||||
| page { | |||||
| background: #f6f6f8; | |||||
| height: 100%; | |||||
| } | |||||
| .content { | |||||
| width: 630rpx; | |||||
| border-radius: 20rpx; | |||||
| background: #fff; | |||||
| margin: 60rpx auto 68rpx; | |||||
| padding-bottom: 67rpx; | |||||
| } | |||||
| .cBox { | |||||
| display: flex; | |||||
| } | |||||
| .image { | |||||
| width: 70rpx; | |||||
| height: 70rpx; | |||||
| float: left; | |||||
| } | |||||
| .tick { | |||||
| width: 70rpx; | |||||
| height: 70rpx; | |||||
| margin-left: 189rpx; | |||||
| margin-top: 73rpx; | |||||
| margin-bottom: 21rpx; | |||||
| } | |||||
| .txt1 { | |||||
| display: block; | |||||
| font-size: 40rpx; | |||||
| font-family: PingFang-SC-Bold; | |||||
| font-weight: Bold; | |||||
| margin-left: 26rpx; | |||||
| margin-top: 85rpx; | |||||
| } | |||||
| .txt2 { | |||||
| display: block; | |||||
| width: 100%; | |||||
| margin-left: 208rpx; | |||||
| margin-bottom: 85rpx; | |||||
| color: #333333; | |||||
| font-size: 28rpx; | |||||
| } | |||||
| .txt3{ | |||||
| color: #000; | |||||
| font-weight: Regular; | |||||
| } | |||||
| .txt4 { | |||||
| display: block; | |||||
| width: 100%; | |||||
| margin-left: 208rpx; | |||||
| color: #333333; | |||||
| font-size: 28rpx; | |||||
| } | |||||
| .txt5 { | |||||
| display: block; | |||||
| width: 100%; | |||||
| margin-left: 208rpx; | |||||
| margin-bottom: 85rpx; | |||||
| color: #333333; | |||||
| font-size: 28rpx; | |||||
| } | |||||
| .bBox { | |||||
| display: flex; | |||||
| } | |||||
| .goOn { | |||||
| display: block; | |||||
| width: 300rpx; | |||||
| height: 90rpx; | |||||
| line-height: 90rpx; | |||||
| margin: 15rpx auto 0; | |||||
| font-size: 32rpx; | |||||
| color: #fff; | |||||
| text-align: center; | |||||
| background: rgba(81, 160, 252, 1); | |||||
| border-radius: 100rpx; | |||||
| margin-left: 60rpx; | |||||
| } | |||||
| .goBack { | |||||
| display: block; | |||||
| width: 300rpx; | |||||
| height: 90rpx; | |||||
| line-height: 90rpx; | |||||
| margin: 15rpx auto 0; | |||||
| font-size: 32rpx; | |||||
| color: #333; | |||||
| text-align: center; | |||||
| background: #fff; | |||||
| border-radius: 45rpx; | |||||
| border: 1rpx solid #d2d2d2; | |||||
| margin-right: 60rpx; | |||||
| } | |||||
| .title{ | |||||
| margin: 0 auto; | |||||
| text-align: center; | |||||
| display: block; | |||||
| color: #333333; | |||||
| font-size: 28rpx; | |||||
| } | |||||
| @@ -0,0 +1,22 @@ | |||||
| // pages/index/solution/fail/fail.js | |||||
| Page({ | |||||
| /** | |||||
| * 页面的初始数据 | |||||
| */ | |||||
| data: { | |||||
| errTitle:"暂无结果" | |||||
| }, | |||||
| reBack(){ | |||||
| tt.switchTab({ | |||||
| url: '/pages/main/main', | |||||
| }) | |||||
| }, | |||||
| onLoad(options) { | |||||
| if (options.errTitle) { | |||||
| this.setData({ | |||||
| errTitle: options.errTitle | |||||
| }) | |||||
| } | |||||
| }, | |||||
| }) | |||||
| @@ -0,0 +1,6 @@ | |||||
| { | |||||
| "backgroundTextStyle": "light", | |||||
| "navigationBarTitleText": "查询", | |||||
| "navigationBarTextStyle": "white", | |||||
| "navigationBarBackgroundColor": "#52A0FD" | |||||
| } | |||||
| @@ -0,0 +1,9 @@ | |||||
| <view class='success'> | |||||
| <view class='success_logo'> | |||||
| <icon class='iconfont icon-cuo'></icon> | |||||
| </view> | |||||
| <view class='info'> | |||||
| <text>{{errTitle}}</text> | |||||
| </view> | |||||
| <button hover-class='active' bindtap='reBack' class='reBack'>返回首页</button> | |||||
| </view> | |||||
| @@ -0,0 +1,72 @@ | |||||
| /* pages/index/solution/success/success.wxss */ | |||||
| @font-face {font-family: "iconfont"; | |||||
| src: url('iconfont.eot?t=1534918788675'); /* IE9*/ | |||||
| src: url('iconfont.eot?t=1534918788675#iefix') format('embedded-opentype'), /* IE6-IE8 */ | |||||
| url('data:application/x-font-woff;charset=utf-8;base64,d09GRgABAAAAAAQMAAsAAAAABmAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABHU1VCAAABCAAAADMAAABCsP6z7U9TLzIAAAE8AAAARAAAAFY8eUf1Y21hcAAAAYAAAABKAAABcOcrtbNnbHlmAAABzAAAAGEAAABsGZubU2hlYWQAAAIwAAAAKwAAADYSZIcFaGhlYQAAAlwAAAAcAAAAJAfeA4NobXR4AAACeAAAAAgAAAAICAAAAGxvY2EAAAKAAAAABgAAAAYANgAAbWF4cAAAAogAAAAeAAAAIAENAChuYW1lAAACqAAAAUUAAAJtPlT+fXBvc3QAAAPwAAAAHAAAAC1khnAFeJxjYGRgYOBikGPQYWB0cfMJYeBgYGGAAJAMY05meiJQDMoDyrGAaQ4gZoOIAgCKIwNPAHicY2BkYWCcwMDKwMHUyXSGgYGhH0IzvmYwYuRgYGBiYGVmwAoC0lxTGByeMT9jZm7438AQw9zA0AAUZgTJAQDdnQvpeJztkLENgEAMA89KoECMQEXNLFTsX7LGf97AFlg6Sz6lCjABURxFgi7EyFlW9sFin+y+yeHvaO3r2ulGM39W9/Yu/+oBdTBACXUAAHicY2BkAALmBmYGBmkGBlVORjMTNSV2TkY1JTYRcU5GNhExI3NORjEjMxPmkn/HGK14JBR5/h37d4xXQYKH0erfMR4JBV5GK6C4ooQ7iAaJQ9Qp8ILUAcWh6hQZALfsFpMAAAB4nGNgZGBgAOKvzEtux/PbfGXgZmEAgeuLFVuQaRYGZhDFwcAEogAbEAh3AHicY2BkYGBu+N/AEMPCAAJAkpEBFTABAEcIAmsEAAAABAAAAAAAAAAANgAAeJxjYGRgYGBikGEA0SAWAwMXEDIw/AfzGQALUwE2AAB4nGWPTU7DMBCFX/oHpBKqqGCH5AViASj9EatuWFRq911036ZOmyqJI8et1ANwHo7ACTgC3IA78EgnmzaWx9+8eWNPANzgBx6O3y33kT1cMjtyDRe4F65TfxBukF+Em2jjVbhF/U3YxzOmwm10YXmD17hi9oR3YQ8dfAjXcI1P4Tr1L+EG+Vu4iTv8CrfQ8erCPuZeV7iNRy/2x1YvnF6p5UHFockikzm/gple75KFrdLqnGtbxCZTg6BfSVOdaVvdU+zXQ+ciFVmTqgmrOkmMyq3Z6tAFG+fyUa8XiR6EJuVYY/62xgKOcQWFJQ6MMUIYZIjK6Og7VWb0r7FDwl57Vj3N53RbFNT/c4UBAvTPXFO6stJ5Ok+BPV8bUnV0K27LnpQ0kV7NSRKyQl7WtlRC6gE2ZVeOEXpc0Yk/KGdI/wAJWm7IAAAAeJxjYGKAAC4G7ICJkYmRmYE5uTSfgQEAB2cBYA==') format('woff'), | |||||
| url('iconfont.ttf?t=1534918788675') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+*/ | |||||
| url('iconfont.svg?t=1534918788675#iconfont') format('svg'); /* iOS 4.1- */ | |||||
| } | |||||
| .iconfont { | |||||
| font-family:"iconfont" !important; | |||||
| font-size:16px; | |||||
| font-style:normal; | |||||
| -webkit-font-smoothing: antialiased; | |||||
| -moz-osx-font-smoothing: grayscale; | |||||
| } | |||||
| .icon-cuo:before { content: "\e603"; } | |||||
| .success { | |||||
| width: 100%; | |||||
| height: 100%; | |||||
| position: absolute; | |||||
| } | |||||
| .success_logo { | |||||
| width: 150rpx; | |||||
| height: 150rpx; | |||||
| margin: 0 auto; | |||||
| display: flex; | |||||
| flex-direction: column; | |||||
| margin-top: 10%; | |||||
| } | |||||
| .success_logo icon { | |||||
| width: 150rpx; | |||||
| height: 150rpx; | |||||
| background: #ccc; | |||||
| border-radius: 50%; | |||||
| color: #fff; | |||||
| font-size: 30px; | |||||
| text-align: center; | |||||
| line-height: 150rpx; | |||||
| } | |||||
| .info { | |||||
| width: 100%; | |||||
| display: flex; | |||||
| flex-direction: column; | |||||
| } | |||||
| .info text { | |||||
| font-size: 36rpx; | |||||
| text-align: center; | |||||
| padding-top: 3%; | |||||
| color:#999; | |||||
| } | |||||
| .reBack { | |||||
| color: #fff; | |||||
| width: 670rpx; | |||||
| background: #52A0FD; | |||||
| position: fixed; | |||||
| bottom: 40rpx; | |||||
| left: 0; | |||||
| right: 0; | |||||
| margin: auto; | |||||
| } | |||||
| .active{ | |||||
| opacity: .6; | |||||
| } | |||||
| @@ -0,0 +1,167 @@ | |||||
| // pages/operation/index.js | |||||
| const config = require('../../config/config.js') | |||||
| const Http = require('../../utils/HttpBasics.js') | |||||
| const util = require('../../utils/util.js') | |||||
| const app = getApp(); | |||||
| Page({ | |||||
| /** | |||||
| * 页面的初始数据 | |||||
| */ | |||||
| data: { | |||||
| showDetailIf: true, | |||||
| type: null, | |||||
| paramData: '', | |||||
| array: ['美国', '中国', '巴西', '日本'], | |||||
| merchentList: [], | |||||
| spendStr: null, | |||||
| creditNum: 0, | |||||
| submitAble: true, | |||||
| thoroughfare:'', | |||||
| }, | |||||
| /** | |||||
| * 生命周期函数--监听页面加载 | |||||
| */ | |||||
| onLoad: function (options) { | |||||
| this.setData({ | |||||
| type: options.type, | |||||
| paramData: options | |||||
| }) | |||||
| this.getMerchent(); | |||||
| }, | |||||
| /** | |||||
| * 保存积分操作数据 | |||||
| */ | |||||
| submitForm() { | |||||
| let _this = this; | |||||
| const reg = /^[1-9]\d*$/; | |||||
| if (!reg.test(_this.data.creditNum) || Number(_this.data.creditNum) > 9999999 || Number(_this.data.creditNum) <1) { | |||||
| tt.showToast({ | |||||
| title: '消费金额限制1~9999999的正整数!', | |||||
| icon: 'none', | |||||
| duration: 2000, | |||||
| mask: false | |||||
| }); | |||||
| return; | |||||
| } | |||||
| _this.setData({ | |||||
| submitAble: false | |||||
| }) | |||||
| Http.post({ | |||||
| url: config.api.addCredit, | |||||
| data: { | |||||
| creditNum: _this.data.creditNum, | |||||
| creditType: 12,//消费积分 | |||||
| cuserId: _this.data.paramData.id, | |||||
| operatorType: 3, | |||||
| merchantId: _this.data.paramData.merchant_id, | |||||
| changePurpose: _this.data.thoroughfare | |||||
| } | |||||
| }) | |||||
| .then(res => { | |||||
| _this.setData({ | |||||
| merchentList: res.data, | |||||
| submitAble: true | |||||
| }) | |||||
| tt.showToast({ | |||||
| title: '保存成功!', | |||||
| icon: 'none', | |||||
| duration: 2000, | |||||
| mask: false | |||||
| }); | |||||
| tt.navigateTo({ | |||||
| url: '/pages/editSuccess/index?type=2&creditNum=' + _this.data.creditNum + '&creditAmount=' + res.data.creditAmount, | |||||
| }) | |||||
| }) | |||||
| .catch(err => { | |||||
| _this.setData({ | |||||
| submitAble: true | |||||
| }) | |||||
| tt.showToast({ | |||||
| title: err.message, | |||||
| icon: 'none', | |||||
| duration: 2000, | |||||
| mask: false | |||||
| }); | |||||
| }); | |||||
| }, | |||||
| getPrice(e) { | |||||
| this.setData({ | |||||
| creditNum: e.detail.value | |||||
| }) | |||||
| }, | |||||
| getThoroughfare(e){ | |||||
| this.setData({ | |||||
| thoroughfare: e.detail.value | |||||
| }) | |||||
| }, | |||||
| getMerchent() { | |||||
| let _this = this; | |||||
| Http.get({ | |||||
| url: config.api.getMerchentList | |||||
| }) | |||||
| .then(res => { | |||||
| _this.setData({ | |||||
| merchentList: res.data | |||||
| }) | |||||
| }) | |||||
| .catch(err => { | |||||
| tt.showToast({ | |||||
| title: err.message, | |||||
| icon: 'none', | |||||
| duration: 2000, | |||||
| mask: false | |||||
| }); | |||||
| }); | |||||
| }, | |||||
| bindPickerChange(e) { | |||||
| console.log('picker发送选择改变,携带值为', e.detail.value) | |||||
| this.setData({ | |||||
| index: e.detail.value | |||||
| }) | |||||
| }, | |||||
| /** | |||||
| * 生命周期函数--监听页面初次渲染完成 | |||||
| */ | |||||
| onReady: function () { | |||||
| }, | |||||
| /** | |||||
| * 生命周期函数--监听页面显示 | |||||
| */ | |||||
| onShow: function () { | |||||
| this.setData({ | |||||
| submitAble:true | |||||
| }) | |||||
| }, | |||||
| /** | |||||
| * 生命周期函数--监听页面隐藏 | |||||
| */ | |||||
| onHide: function () { | |||||
| }, | |||||
| /** | |||||
| * 生命周期函数--监听页面卸载 | |||||
| */ | |||||
| onUnload: function () { | |||||
| }, | |||||
| /** | |||||
| * 页面相关事件处理函数--监听用户下拉动作 | |||||
| */ | |||||
| onPullDownRefresh: function () { | |||||
| }, | |||||
| /** | |||||
| * 页面上拉触底事件的处理函数 | |||||
| */ | |||||
| onReachBottom: function () { | |||||
| } | |||||
| }) | |||||
| @@ -0,0 +1,6 @@ | |||||
| { | |||||
| "backgroundTextStyle": "light", | |||||
| "navigationBarTitleText": "会员积分", | |||||
| "navigationBarTextStyle": "white", | |||||
| "navigationBarBackgroundColor": "#52A0FD" | |||||
| } | |||||
| @@ -0,0 +1,33 @@ | |||||
| <!--pages/exchange/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}}</text> | |||||
| </view> | |||||
| <view> | |||||
| <text>手机号码:</text> | |||||
| <text>{{paramData.phone}}</text> | |||||
| </view> | |||||
| </view> | |||||
| <view > | |||||
| <view class='footer' bindtap='toDetail'> | |||||
| <text>消费积分</text> | |||||
| <input placeholder='请输入' type='number' bindinput="getPrice"></input> | |||||
| </view> | |||||
| <view class='footer footerYt' bindtap='toDetail'> | |||||
| <text>消费用途</text> | |||||
| <input placeholder='请输入' bindinput="getThoroughfare"></input> | |||||
| </view> | |||||
| <button bindtap='{{submitAble?"submitForm":""}}'>提交</button> | |||||
| </view> | |||||
| </view> | |||||
| </view> | |||||
| </view> | |||||
| @@ -0,0 +1,99 @@ | |||||
| /* pages/exchange/index.wxss */ | |||||
| .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; | |||||
| } | |||||
| .footer { | |||||
| width: 710rpx; | |||||
| height: 126rpx; | |||||
| line-height: 126rpx; | |||||
| display: flex; | |||||
| background: #fff; | |||||
| border-radius: 20rpx; | |||||
| margin: 100rpx auto 0; | |||||
| box-shadow: 0 6px 20px 0 rgba(0, 0, 0, 0.15); | |||||
| } | |||||
| .footerYt{ | |||||
| width: 710rpx; | |||||
| height: 126rpx; | |||||
| line-height: 126rpx; | |||||
| display: flex; | |||||
| background: #fff; | |||||
| border-radius: 20rpx; | |||||
| margin: 30rpx auto 0; | |||||
| box-shadow: 0 6px 20px 0 rgba(0, 0, 0, 0.15); | |||||
| } | |||||
| .footer text { | |||||
| margin-left: 31rpx; | |||||
| font-size: 30rpx; | |||||
| } | |||||
| .footer input{ | |||||
| width: 460rpx; | |||||
| margin-left: 40rpx; | |||||
| height: 126rpx; | |||||
| line-height: 126rpx; | |||||
| font-size: 30rpx; | |||||
| text-align: right; | |||||
| } | |||||
| .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%; | |||||
| } | |||||
| @@ -0,0 +1,163 @@ | |||||
| const config = require('../../config/config.js') | |||||
| const Common = require('../../common/common.js') | |||||
| const app = getApp() | |||||
| var interval = null //倒计时函数 | |||||
| Page({ | |||||
| data: { | |||||
| phone: '', | |||||
| yzm: '', | |||||
| flag: true, | |||||
| retry: false, | |||||
| time: 60, | |||||
| phones: "", | |||||
| date: '请选择日期', | |||||
| fun_id: 2, | |||||
| time: '获取验证码', //倒计时 | |||||
| currentTime: 61, | |||||
| disabled:false, | |||||
| setInter:'' | |||||
| }, | |||||
| getCode: function (options) { | |||||
| var that = this; | |||||
| var currentTime = that.data.currentTime | |||||
| that.data.setInter = setInterval(function () { | |||||
| currentTime--; | |||||
| that.setData({ | |||||
| time: currentTime + '秒' | |||||
| }) | |||||
| if (currentTime <= 0) { | |||||
| clearInterval(that.data.setInter) | |||||
| that.setData({ | |||||
| time: '获取验证码', | |||||
| currentTime: 61, | |||||
| disabled: false | |||||
| }) | |||||
| } | |||||
| console.log(that.data.time) | |||||
| }, 1000) | |||||
| }, | |||||
| onHide:function(){ | |||||
| let that = this; | |||||
| clearInterval(that.data.setInter); | |||||
| that.setData({ | |||||
| time: '获取验证码', | |||||
| currentTime: 61, | |||||
| disabled: false | |||||
| }) | |||||
| }, | |||||
| onUnload:function(){ | |||||
| let that = this; | |||||
| clearInterval(that.data.setInter) | |||||
| that.setData({ | |||||
| time: '获取验证码', | |||||
| currentTime: 61, | |||||
| disabled: false | |||||
| }) | |||||
| }, | |||||
| onLoad:function(options){ | |||||
| console.log(options); | |||||
| if(tt.getStorageSync("phone")){ | |||||
| this.setData({ | |||||
| phone: tt.getStorageSync("phone"), | |||||
| }) | |||||
| } | |||||
| if(options.flags=='reset'){ | |||||
| tt.setNavigationBarTitle({ | |||||
| title: '修改密码' | |||||
| }) | |||||
| this.setData({ | |||||
| flags: options.flags | |||||
| }) | |||||
| }else{ | |||||
| tt.setNavigationBarTitle({ | |||||
| title: '忘记密码' | |||||
| }) | |||||
| } | |||||
| }, | |||||
| onShow: function () { | |||||
| let that = this; | |||||
| that.setData({ | |||||
| phones: tt.getStorageSync("phone"), | |||||
| disabled:false | |||||
| }); | |||||
| console.log(that.data.phones) | |||||
| }, | |||||
| getYZM(e) { | |||||
| console.log(e); | |||||
| if (e.detail.value.phone) { | |||||
| this.setData({ | |||||
| phone: e.detail.value.phone, | |||||
| yzm: e.detail.value.yzm | |||||
| }) | |||||
| }else{ | |||||
| this.setData({ | |||||
| phone: tt.getStorageSync("phone"), | |||||
| yzm: e.detail.value.yzm | |||||
| }) | |||||
| } | |||||
| }, | |||||
| next() { | |||||
| setTimeout(() => { | |||||
| console.log(this.data) | |||||
| Common.hasValidationCode(this.data.phone, this.data.yzm) | |||||
| .then(res => { | |||||
| console.log(res) | |||||
| setTimeout(() => { | |||||
| console.log(res) | |||||
| if (res.code == 200) { | |||||
| tt.navigateTo({ | |||||
| url: `/pages/setpwd/setpwd?phone=${this.data.phone}&code=${this.data.yzm}` | |||||
| }) | |||||
| } else { | |||||
| tt.showToast({ | |||||
| title: "验证码错误", | |||||
| icon: "none", | |||||
| duration: 2000 | |||||
| }) | |||||
| } | |||||
| }, 500) | |||||
| }) | |||||
| }, 1000) | |||||
| }, | |||||
| send(e) { | |||||
| console.log(this.data.phone); | |||||
| var phoneReg = /(^1[3|4|5|7|8]\d{9}$)|(^09\d{8}$)/; | |||||
| let that = this; | |||||
| // setTimeout(() => { | |||||
| let tel = that.data.phone; | |||||
| console.log(tel) | |||||
| if (phoneReg.test(tel)) { | |||||
| Common.sendValidationCode(tel) | |||||
| .then(res => { | |||||
| console.log(res); | |||||
| if (res.code == 200) { | |||||
| that.getCode(); | |||||
| that.setData({ | |||||
| disabled: true | |||||
| }) | |||||
| tt.showToast({ | |||||
| title: res.message, | |||||
| image: '../../static/images/success.png' | |||||
| }) | |||||
| } else if (res.code == 12061){ | |||||
| tt.showToast({ | |||||
| title: "短息已发送,稍后重试", | |||||
| icon: "none", | |||||
| }) | |||||
| } else { | |||||
| tt.showToast({ | |||||
| title: res.message, | |||||
| icon: "none", | |||||
| }) | |||||
| } | |||||
| }) | |||||
| } else { | |||||
| tt.showToast({ | |||||
| title: '手机号有误', | |||||
| icon: "none", | |||||
| }) | |||||
| } | |||||
| // }, 500) | |||||
| } | |||||
| }) | |||||
| @@ -0,0 +1,6 @@ | |||||
| { | |||||
| "backgroundTextStyle": "light", | |||||
| "navigationBarTitleText": "", | |||||
| "navigationBarTextStyle": "black", | |||||
| "navigationBarBackgroundColor": "#fff" | |||||
| } | |||||
| @@ -0,0 +1,18 @@ | |||||
| <view class='forgetpwd'> | |||||
| <form bindsubmit='getYZM'> | |||||
| <view class='retrievepwd'> | |||||
| <view class='input01' tt:if="{{flags=='reset'}}">修改密码</view> | |||||
| <view class='input01' tt:else>找回密码</view> | |||||
| <view class='input02'>请填写你的手机号,我们会发送验证码验证身份</view> | |||||
| <view class='pho'> | |||||
| <input tt:if="{{phones}}" type='number' placeholder-style='color:#000;' placeholder='{{phones}}' maxlength='11' disabled /> | |||||
| <input tt:else type='number' placeholder-style='color:#bfbfbf;' placeholder='请输入手机号' maxlength='11' name='phone' /> | |||||
| <button form-type='submit' class='send' disabled='{{disabled}}' bindtap="send">{{time}}</button> | |||||
| </view> | |||||
| <view> | |||||
| <input type='number' placeholder-style='color:#bfbfbf;' placeholder='请输入验证码' name='yzm' /> | |||||
| </view> | |||||
| </view> | |||||
| <button form-type='submit' hover-class='active' bindtap='next'>下一步</button> | |||||
| </form> | |||||
| </view> | |||||
| @@ -0,0 +1,116 @@ | |||||
| .forgetpwd { | |||||
| width: 100%; | |||||
| display: flex; | |||||
| flex-direction: column; | |||||
| } | |||||
| .retrievepwd { | |||||
| width: 100%; | |||||
| display: flex; | |||||
| flex-direction: column; | |||||
| position: relative; | |||||
| margin-bottom: 68rpx; | |||||
| } | |||||
| /* .retrievepwd view { | |||||
| width: 90%; | |||||
| display: flex; | |||||
| margin: 0 auto; | |||||
| height: 94rpx; | |||||
| line-height: 94rpx; | |||||
| padding-left: 4%; | |||||
| position: relative; | |||||
| } */ | |||||
| .input01 { | |||||
| text-indent: 40rpx; | |||||
| font-size: 40rpx; | |||||
| color: #000; | |||||
| letter-spacing: 0; | |||||
| margin-top: 28rpx; | |||||
| } | |||||
| .input02 { | |||||
| text-indent: 40rpx; | |||||
| font-size: 28rpx; | |||||
| margin-top: 16rpx; | |||||
| color: #000; | |||||
| letter-spacing: 0; | |||||
| line-height: 32rpx; | |||||
| } | |||||
| .line { | |||||
| width: 2rpx; | |||||
| height: 22rpx; | |||||
| background: #d7d7d7; | |||||
| position: absolute; | |||||
| left: 20%; | |||||
| top: 38rpx; | |||||
| } | |||||
| .retrievepwd view input { | |||||
| display: inline-block; | |||||
| font-size: 30rpx; | |||||
| width: 460rpx; | |||||
| padding-left: 40rpx; | |||||
| height: 94rpx; | |||||
| color: #000!important; | |||||
| letter-spacing: 0; | |||||
| line-height: 32rpx; | |||||
| } | |||||
| .pho { | |||||
| margin-top: 40rpx; | |||||
| } | |||||
| .retrievepwd view:nth-child(1) input { | |||||
| width: 68%; | |||||
| } | |||||
| .retrievepwd view text:nth-child(4) { | |||||
| color: #52a0fd; | |||||
| font-size: 28rpx; | |||||
| } | |||||
| .forgetpwd button { | |||||
| width: 92%; | |||||
| height: 94rpx; | |||||
| line-height: 94rpx; | |||||
| background: #52a0fd; | |||||
| color: #fff; | |||||
| font-size: 36rpx; | |||||
| } | |||||
| .active { | |||||
| opacity: 0.6; | |||||
| } | |||||
| .send { | |||||
| display: inline-block; | |||||
| width: 210rpx !important; | |||||
| border-radius: 16rpx; | |||||
| margin-top: 12rpx; | |||||
| margin-right: 30rpx; | |||||
| font-size: 30rpx!important; | |||||
| letter-spacing: 0; | |||||
| padding: 0!important; | |||||
| } | |||||
| button::after { | |||||
| border: none; | |||||
| } | |||||
| .try { | |||||
| width: 32%; | |||||
| display: inline-block; | |||||
| background: #52a0fd; | |||||
| color: #fff; | |||||
| border-radius: 16rpx; | |||||
| text-align: center; | |||||
| opacity: 0.6; | |||||
| height: 70rpx !important; | |||||
| font-size: 28rpx !important; | |||||
| line-height: 70rpx !important; | |||||
| margin-top: 12rpx; | |||||
| } | |||||
| @@ -0,0 +1,147 @@ | |||||
| // pages/getMerchant/index.js | |||||
| const config = require('../../config/config.js') | |||||
| const Http = require('../../utils/HttpBasics.js') | |||||
| const util = require('../../utils/util.js') | |||||
| const app = getApp(); | |||||
| Page({ | |||||
| /** | |||||
| * 页面的初始数据 | |||||
| */ | |||||
| data: { | |||||
| selectList:[], | |||||
| list: [], | |||||
| selectMerchant:null, | |||||
| businessId:'' | |||||
| }, | |||||
| /** | |||||
| * 生命周期函数--监听页面加载 | |||||
| */ | |||||
| onLoad: function (options) { | |||||
| this.setData({ | |||||
| paramData: options | |||||
| }) | |||||
| this.getMerchent() | |||||
| }, | |||||
| getMerchent() { | |||||
| let _this = this; | |||||
| Http.get({ | |||||
| url: config.api.getMerchentList | |||||
| }) | |||||
| .then(res => { | |||||
| _this.setData({ | |||||
| list: res.data, | |||||
| selectList:res.data | |||||
| }) | |||||
| }) | |||||
| .catch(err => { | |||||
| tt.showToast({ | |||||
| title: err.message, | |||||
| icon: 'none', | |||||
| duration: 2000, | |||||
| mask: false | |||||
| }); | |||||
| }); | |||||
| }, | |||||
| /** | |||||
| * 生命周期函数--监听页面初次渲染完成 | |||||
| */ | |||||
| onReady: function () { | |||||
| }, | |||||
| checkMerchant(e){ | |||||
| console.log(e) | |||||
| let id=e.target.id; | |||||
| this.data.selectList.map((item,index)=>{ | |||||
| if(id==item.id){ | |||||
| console.log(item,item.businessId) | |||||
| this.setData({ | |||||
| selectMerchant:item, | |||||
| businessId: item.businessId | |||||
| }) | |||||
| } | |||||
| }) | |||||
| }, | |||||
| submitForm(){ | |||||
| if (this.data.selectMerchant!=null){ | |||||
| tt.redirectTo({ | |||||
| url: `/pages/operation/index?address=${this.data.paramData.address}&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=1&merchantName=${this.data.selectMerchant.merchantName}&merchant_id=${this.data.selectMerchant.id}&isAdmin=1&merchantType=1&businessId=${this.data.businessId}`, | |||||
| }) | |||||
| }else{ | |||||
| tt.showToast({ | |||||
| title: '抱歉,您未选择门店', | |||||
| icon: 'none', | |||||
| duration: 2000, | |||||
| mask: false | |||||
| }); | |||||
| } | |||||
| }, | |||||
| getList(e){ | |||||
| console.log(e.detail.value) | |||||
| let selectList = []; | |||||
| var reg = new RegExp(e.detail.value.toUpperCase()); | |||||
| this.data.list.map((item,index)=>{ | |||||
| if (item.merchantName.toUpperCase().match(reg) || e.detail.value==''){ | |||||
| selectList.push(item) | |||||
| } | |||||
| }) | |||||
| let haveIf=false; | |||||
| selectList.map((item,index)=>{ | |||||
| console.log(item,this.data.selectMerchant) | |||||
| if (this.data.selectMerchant!=null&&item.id == this.data.selectMerchant.id){ | |||||
| haveIf=true | |||||
| } | |||||
| }) | |||||
| if (!haveIf){ | |||||
| this.setData({ | |||||
| selectMerchant:null | |||||
| }) | |||||
| } | |||||
| // debugger | |||||
| this.setData({ | |||||
| selectList | |||||
| }) | |||||
| }, | |||||
| /** | |||||
| * 生命周期函数--监听页面显示 | |||||
| */ | |||||
| onShow: function () { | |||||
| }, | |||||
| /** | |||||
| * 生命周期函数--监听页面隐藏 | |||||
| */ | |||||
| onHide: function () { | |||||
| }, | |||||
| /** | |||||
| * 生命周期函数--监听页面卸载 | |||||
| */ | |||||
| onUnload: function () { | |||||
| }, | |||||
| /** | |||||
| * 页面相关事件处理函数--监听用户下拉动作 | |||||
| */ | |||||
| onPullDownRefresh: function () { | |||||
| }, | |||||
| /** | |||||
| * 页面上拉触底事件的处理函数 | |||||
| */ | |||||
| onReachBottom: function () { | |||||
| }, | |||||
| /** | |||||
| * 用户点击右上角分享 | |||||
| */ | |||||
| onShareAppMessage: function () { | |||||
| } | |||||
| }) | |||||
| @@ -0,0 +1,4 @@ | |||||
| { | |||||
| "navigationBarTitleText": "消费门店", | |||||
| "navigationBarTextStyle": "white" | |||||
| } | |||||
| @@ -0,0 +1,14 @@ | |||||
| <!--pages/getMerchant/index.wxml--> | |||||
| <view class='box'> | |||||
| <view class='top'> | |||||
| <view class='footer'> | |||||
| <text>消费门店</text> | |||||
| <input placeholder='请输入消费门店' bindinput="getList"></input> | |||||
| </view> | |||||
| </view> | |||||
| <view class='merchant-list'> | |||||
| <view class='lists' style='background:{{selectMerchant.id==item.id?"#F6F6F6":"#fff"}}' tt:for='{{selectList}}' id='{{item.id}}' bindtap='checkMerchant' tt:key='{{index}}'>{{item.merchantName}}</view> | |||||
| </view> | |||||
| <button class='sub-button' bindtap='submitForm'>提交</button> | |||||
| </view> | |||||
| @@ -0,0 +1,57 @@ | |||||
| /* pages/getMerchant/index.wxss */ | |||||
| .top{ | |||||
| position: fixed; | |||||
| top: 0; | |||||
| left: 0; | |||||
| opacity: 1; | |||||
| background: #fff; | |||||
| } | |||||
| .footer { | |||||
| width: 710rpx; | |||||
| height: 126rpx; | |||||
| line-height: 126rpx; | |||||
| display: flex; | |||||
| background: #fff; | |||||
| border-radius: 20rpx; | |||||
| margin-top: 40rpx; | |||||
| margin-left: 20rpx; | |||||
| align-self: center; | |||||
| box-shadow: 0 6px 20px 0 rgba(0, 0, 0, 0.15); | |||||
| } | |||||
| .footer text { | |||||
| margin-left: 31rpx; | |||||
| font-size: 30rpx; | |||||
| } | |||||
| .footer input { | |||||
| width: 450rpx; | |||||
| margin-right: 19rpx; | |||||
| height: 126rpx; | |||||
| line-height: 126rpx; | |||||
| font-size: 30rpx; | |||||
| text-align: right; | |||||
| } | |||||
| .merchant-list{ | |||||
| width: 690rpx; | |||||
| margin: 230rpx auto; | |||||
| border-top: 1px solid #EAEAEA; | |||||
| } | |||||
| .lists{ | |||||
| height: 84rpx; | |||||
| line-height: 84rpx; | |||||
| border-bottom: 1px dashed #EAEAEA; | |||||
| font-size:30rpx; | |||||
| } | |||||
| .sub-button{ | |||||
| position: fixed; | |||||
| bottom: 30rpx; | |||||
| left: 20rpx; | |||||
| width:710rpx; | |||||
| height:94rpx; | |||||
| background:rgba(82,160,253,1); | |||||
| box-shadow:0px 10rpx 22rpx 2rpx rgba(82,160,253,0.51); | |||||
| border-radius:10rpx; | |||||
| color: #fff; | |||||
| line-height: 94rpx; | |||||
| } | |||||
| @@ -0,0 +1,11 @@ | |||||
| // d:\fumaolianke\ttFmB\TTB\pages\goHtml\goHtml.js | |||||
| Page({ | |||||
| data: { | |||||
| httpUrl:"" | |||||
| }, | |||||
| onLoad: function (options) { | |||||
| this.setData({ | |||||
| httpUrl:options.url | |||||
| }) | |||||
| } | |||||
| }) | |||||
| @@ -0,0 +1,3 @@ | |||||
| { | |||||
| "usingComponents": {} | |||||
| } | |||||
| @@ -0,0 +1,8 @@ | |||||
| <web-view | |||||
| src="{{httpUrl}}" | |||||
| progressbar-color="{{progressbar-color}}" | |||||
| bindmessage="bindmessage" | |||||
| bindload="bindload" | |||||
| binderror="binderror" | |||||
| > | |||||
| </web-view> | |||||
| @@ -0,0 +1,222 @@ | |||||
| const config = require('../../config/config.js') | |||||
| const app = getApp() | |||||
| const Common = require('../../common/common.js') | |||||
| const Http = require('../../utils/http.js') | |||||
| const HttpBasics = require('../../utils/HttpBasics.js') | |||||
| Page({ | |||||
| data: { | |||||
| logo: '../../assets/images/logo.png', | |||||
| phone: '', | |||||
| pwd: '', | |||||
| status:'', | |||||
| showpass: "hidepass", | |||||
| focus:false, | |||||
| password: true | |||||
| }, | |||||
| onLoad() { | |||||
| Common.getMallIcon() | |||||
| .then(data => { | |||||
| // debugge | |||||
| console.log(data,777) | |||||
| this.setData({ | |||||
| logo: data.data&&data.data.mallImgUrl ? data.data.mallImgUrl : '../../assets/images/logo.png', | |||||
| }) | |||||
| }) | |||||
| }, | |||||
| onShow() { | |||||
| var that = this; | |||||
| var phone = tt.getStorageSync("phone"); | |||||
| var pwd = tt.getStorageSync("pwd"); | |||||
| that.ttLogin(); | |||||
| if (phone) { | |||||
| that.setData({ | |||||
| phone: phone | |||||
| }); | |||||
| } | |||||
| if (pwd) { | |||||
| that.setData({ | |||||
| pwd: pwd | |||||
| }); | |||||
| } | |||||
| }, | |||||
| //显示具体的密码 | |||||
| showpassword:function(){ | |||||
| console.log(this.data.password); | |||||
| let that = this; | |||||
| if (that.data.password){ | |||||
| that.setData({ | |||||
| password: false, | |||||
| focus:true | |||||
| }) | |||||
| }else{ | |||||
| that.setData({ | |||||
| password: true, | |||||
| focus: true | |||||
| }) | |||||
| } | |||||
| }, | |||||
| ttLogin(flag){ | |||||
| let that = this; | |||||
| tt.login({ | |||||
| success: res => { | |||||
| Common.getSuperOpenId(res.code) | |||||
| .then(res => { | |||||
| console.log(res) | |||||
| if (res.data&& res.data.data&&res.data.data.openId){ | |||||
| app.globalData.superopenId = res.data.data.openId; | |||||
| } | |||||
| if (res.data && res.data.data && res.data.data.session_key){ | |||||
| app.globalData.session_key = res.data.data.session_key; | |||||
| } | |||||
| if (res.data.code == 200) { | |||||
| app.globalData.phone = res.data.data.phone; | |||||
| that.setData({ | |||||
| ifAlBoss: true, | |||||
| status: "use" | |||||
| }) | |||||
| if (flag =='fromgetPhoneNumber'){ | |||||
| tt.navigateTo({ | |||||
| url: `/pages/datatower/datatower?superopenId=${app.globalData.superopenId}&phone=${app.globalData.phone}`, | |||||
| }) | |||||
| } | |||||
| } else { | |||||
| if (flag =='fromgetPhoneNumber'){ | |||||
| tt.showToast({ | |||||
| title: res.data.message, | |||||
| icon: "none", | |||||
| duration: 2000 | |||||
| }) | |||||
| } | |||||
| } | |||||
| }).catch(error => { | |||||
| console.log(error,"error"); | |||||
| that.setData({ | |||||
| error: error.message | |||||
| }) | |||||
| }) | |||||
| } | |||||
| }) | |||||
| }, | |||||
| showpass: function () { | |||||
| let that = this; | |||||
| }, | |||||
| forgetPwd: function () { | |||||
| tt.navigateTo({ | |||||
| url: '/pages/index/forgetpwd/forgetpwd', | |||||
| }) | |||||
| }, | |||||
| getLoginInfo(e) { | |||||
| var phoneReg = /^1[0|1|2|3|4|5|6|7|8|9]\d{9}$/; | |||||
| let { | |||||
| phone, | |||||
| pwd | |||||
| } = e.detail.value; | |||||
| if (phoneReg.test(phone)) { | |||||
| if (pwd != '') { | |||||
| Common.userLogin(phone, pwd, app.globalData.latitude, app.globalData.longitude) | |||||
| .then(res => { | |||||
| console.log(res); | |||||
| if (res.code == 200) { | |||||
| HttpBasics.setBUserId(res.data.bUserId); | |||||
| tt.setStorageSync("phone", phone); | |||||
| tt.setStorageSync("pwd", pwd); | |||||
| tt.setStorageSync("bUserId", res.data.bUserId); | |||||
| app.globalData.bUserId = res.data.bUserId; | |||||
| tt.setStorage({ | |||||
| key: 'bUserId', | |||||
| data: res.data.bUserId, | |||||
| }) | |||||
| tt.login({ | |||||
| success:function(res){ | |||||
| Common.getOpenId(res.code,app.globalData.bUserId) | |||||
| .then(res => { | |||||
| console.log(res,888) | |||||
| app.globalData.openId = res.data.data.openId; | |||||
| app.globalData.token = res.data.data.token; | |||||
| HttpBasics.setToken(res.data.data.token); | |||||
| tt.setStorageSync("openId", res.data.data.openId); | |||||
| tt.setStorageSync("session_key", res.data.data.session_key); | |||||
| tt.showToast({ | |||||
| image: './../../assets/images/success.png', | |||||
| title: '登录成功', | |||||
| }) | |||||
| tt.switchTab({ | |||||
| url: '/pages/main/main', | |||||
| success(res) { | |||||
| console.log(`${res}`); | |||||
| }, | |||||
| fail(err) { | |||||
| console.log(err,`switchTab调用失败`); | |||||
| }, | |||||
| }) | |||||
| }) | |||||
| } | |||||
| }) | |||||
| } else { | |||||
| tt.showToast({ | |||||
| image:'./../../assets/images/fail.png', | |||||
| title: res.message, | |||||
| icon: "none" | |||||
| }) | |||||
| } | |||||
| }) | |||||
| } else { | |||||
| tt.showToast({ | |||||
| image: './../../assets/images/fail.png', | |||||
| title: '密码不能为空', | |||||
| icon: "none", | |||||
| }) | |||||
| } | |||||
| } else if(phone=="") { | |||||
| tt.showToast({ | |||||
| image: './../../assets/images/fail.png', | |||||
| title: '请输入手机号', | |||||
| icon: "none" | |||||
| }) | |||||
| }else{ | |||||
| tt.showToast({ | |||||
| image: './../../assets/images/fail.png', | |||||
| title: '手机号有误', | |||||
| icon: "none" | |||||
| }) | |||||
| } | |||||
| }, | |||||
| /** | |||||
| * 获得超级管理员手机号 | |||||
| */ | |||||
| getPhoneNumber: function (e) { | |||||
| this.ttLogin("fromgetPhoneNumber"); | |||||
| if (app.globalData.superopenId && app.globalData.session_key){ | |||||
| let { encryptedData, iv } = { encryptedData: e.detail.encryptedData, iv: e.detail.iv }; | |||||
| if (encryptedData && iv) { | |||||
| Common.getUserPhone(encryptedData, iv, app.globalData.superopenId, app.globalData.session_key) | |||||
| .then(res => { | |||||
| if (res.data.code == 200 && res.data.data.admin == 1) { | |||||
| app.globalData.phone = res.data.data.phone; | |||||
| tt.navigateTo({ | |||||
| url: `/pages/datatower/datatower?superopenId=${app.globalData.superopenId}&phone=${app.globalData.phone}`, | |||||
| }) | |||||
| } | |||||
| }) | |||||
| } | |||||
| } | |||||
| }, | |||||
| /** | |||||
| * 用户点击右上角分享 | |||||
| */ | |||||
| onShareAppMessage: function (res) { | |||||
| let _this = this; | |||||
| return { | |||||
| title: '数据塔台', | |||||
| path: '/pages/main/main', | |||||
| success: function (res) { | |||||
| // 转发成功 | |||||
| }, | |||||
| fail: function (res) { | |||||
| // 转发失败 | |||||
| } | |||||
| } | |||||
| }, | |||||
| }) | |||||
| @@ -0,0 +1,6 @@ | |||||
| { | |||||
| "backgroundTextStyle": "light", | |||||
| "navigationBarTitleText": "登录", | |||||
| "navigationBarTextStyle": "white", | |||||
| "navigationBarBackgroundColor": "#52A0FD" | |||||
| } | |||||
| @@ -0,0 +1,30 @@ | |||||
| <view class="logoin_wrap"> | |||||
| <view class='logo'> | |||||
| <image src='{{logo}}' mode="widthFix"></image> | |||||
| </view> | |||||
| <form bindsubmit='getLoginInfo'> | |||||
| <view class='login'> | |||||
| <view> | |||||
| <input type='number' name='phone' value='{{phone}}' placeholder='请输入手机号' placeholder-style='color:#BFBFBF;' maxlength='11' class='inp' /> | |||||
| </view> | |||||
| <view> | |||||
| <input password='{{password}}' focus='{{focus}}' class='inp' placeholder='请输入密码' placeholder-style='color:#BFBFBF;' name='pwd' value='{{pwd}}' /> | |||||
| <image class='showpassword' bindtap='showpassword' src='../../assets/images/password.png' mode='widthFix'></image> | |||||
| </view> | |||||
| </view> | |||||
| <navigator url='../index/index' open-type='navigate' hover-class='none'> | |||||
| </navigator> | |||||
| <button form-type='submit' class='button' hover-class='active'>登录管理门店</button> | |||||
| <!-- <view class='forget clearfix'> | |||||
| <text class='fr' bindtap='forgetPwd'>忘记密码</text> | |||||
| </view> --> | |||||
| <!-- <view> | |||||
| <button class="phone" tt:if="{{!ifAlBoss}}" open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber"><image class='adminlogo' src='../../assets/images/admin.png' mode='widthFix'></image>数据塔台</button> | |||||
| <button class="phone" tt:if="{{ifAlBoss}}" bindtap="getPhoneNumber"><image class='adminlogo' src='../../assets/images/admin.png' mode='widthFix'></image>数据塔台</button> | |||||
| </view> --> | |||||
| </form> | |||||
| <view class='defaultLogo'> | |||||
| <text>POWERED BY IFORMALL</text> | |||||
| </view> | |||||
| </view> | |||||
| @@ -0,0 +1,142 @@ | |||||
| .adminlogo{ | |||||
| width: 100rpx; | |||||
| display: block; | |||||
| margin: 0 auto; | |||||
| } | |||||
| .logoin_wrap { | |||||
| width: 100%; | |||||
| display: flex; | |||||
| flex-direction: column; | |||||
| } | |||||
| .login { | |||||
| width: 100%; | |||||
| display: flex; | |||||
| flex-direction: column; | |||||
| position: relative; | |||||
| } | |||||
| .inp{ | |||||
| color: #666; | |||||
| } | |||||
| .login view { | |||||
| position: relative; | |||||
| width: 88%; | |||||
| display: flex; | |||||
| margin: 0 auto; | |||||
| height: 100rpx; | |||||
| line-height: 100rpx; | |||||
| border-bottom: 1rpx solid #DADADA; | |||||
| } | |||||
| .line { | |||||
| width: 2rpx; | |||||
| height: 22rpx; | |||||
| background: #d7d7d7; | |||||
| position: absolute; | |||||
| left: 20%; | |||||
| top: 38rpx; | |||||
| } | |||||
| .login view input { | |||||
| font-size: 34rpx; | |||||
| height: 100rpx; | |||||
| line-height: 100rpx; | |||||
| } | |||||
| .login view:nth-child(1) input { | |||||
| /* padding-left: 60rpx; */ | |||||
| font-size: 34rpx; | |||||
| height: 100rpx; | |||||
| line-height: 100rpx; | |||||
| } | |||||
| .eye{ | |||||
| display: inline-block; | |||||
| width: 50rpx; | |||||
| margin-top:26rpx; | |||||
| } | |||||
| .logo { | |||||
| width: 320rpx; | |||||
| margin: 100rpx auto 30rpx; | |||||
| } | |||||
| .logo image { | |||||
| display: block; | |||||
| width: 320rpx; | |||||
| } | |||||
| .button { | |||||
| background: #52A0FD; | |||||
| border-radius: 8rpx; | |||||
| color: #fff; | |||||
| margin-top: 8%; | |||||
| font-size: 36rpx; | |||||
| width: 90%; | |||||
| } | |||||
| .active{ | |||||
| opacity: .4; | |||||
| } | |||||
| .logoin_wrap navigator { | |||||
| display: block; | |||||
| width: 25%; | |||||
| margin: 0 auto; | |||||
| text-align: right; | |||||
| margin-top: 15rpx; | |||||
| } | |||||
| .logoin_wrap navigator text { | |||||
| display: block; | |||||
| text-align: center; | |||||
| /* padding-top: 1.5%; */ | |||||
| font-size: 26rpx; | |||||
| height: 45rpx; | |||||
| color: #404040; | |||||
| letter-spacing: 0; | |||||
| line-height: 45rpx; | |||||
| } | |||||
| .forget{ | |||||
| text-align: right; | |||||
| padding:0 40rpx; | |||||
| color: #999; | |||||
| margin-top: 20rpx; | |||||
| } | |||||
| .forget text{ | |||||
| font-size: 26rpx; | |||||
| } | |||||
| .defaultLogo{ | |||||
| position: absolute; | |||||
| bottom: 40rpx; | |||||
| left: 0; | |||||
| right: 0; | |||||
| margin: auto; | |||||
| } | |||||
| .defaultLogo text { | |||||
| display: block; | |||||
| text-align: center; | |||||
| color: #52A0FD; | |||||
| font-size: 22rpx; | |||||
| } | |||||
| .defaultLogo image { | |||||
| width: 200rpx; | |||||
| } | |||||
| .phone{ | |||||
| display: block!important; | |||||
| background: none!important; | |||||
| color: #999!important; | |||||
| font-size: 26rpx!important; | |||||
| padding: 0!important; | |||||
| margin-top: 40rpx!important; | |||||
| } | |||||
| button::after{ border: none; } | |||||
| .showpassword{ | |||||
| padding: 30rpx; | |||||
| width: 40rpx; | |||||
| position: absolute; | |||||
| z-index: 100; | |||||
| right: 20rpx; | |||||
| top: 0; | |||||
| bottom: 0; | |||||
| margin: auto; | |||||
| } | |||||
| @@ -0,0 +1,705 @@ | |||||
| const config = require('../../config/config.js') | |||||
| const Http = require('../../utils/http.js') | |||||
| const HttpBasics = require('../../utils/HttpBasics.js') | |||||
| const util = require('../../utils/util') | |||||
| const changeNum = require('../../utils/changeNum.js') | |||||
| import * as echarts from '../../ec-canvas/echarts'; | |||||
| var app = getApp() | |||||
| function setOption(chart, xdata, ydata) { | |||||
| const option = { | |||||
| title: { | |||||
| padding: [10, 0, 0, 20], | |||||
| textStyle: { | |||||
| fontSize: 14, | |||||
| color: '#FF6A6A' | |||||
| }, | |||||
| }, | |||||
| backgroundColor: "#fff", | |||||
| color: ["#006EFF", "#67E0E3", "#9FE6B8"], | |||||
| animation: true, | |||||
| grid: { | |||||
| top: '3%', | |||||
| left: "5%", | |||||
| right: "7%", | |||||
| bottom: "4%", | |||||
| containLabel: true, | |||||
| }, | |||||
| xAxis: { | |||||
| type: 'category', | |||||
| boundaryGap: false, | |||||
| data: xdata, | |||||
| splitLine: { | |||||
| show: false | |||||
| }, //去除网格线 | |||||
| axisLine: { | |||||
| show: false | |||||
| }, | |||||
| axisTick: { | |||||
| show: false | |||||
| } | |||||
| }, | |||||
| yAxis: [{ | |||||
| splitLine: { | |||||
| lineStyle: { | |||||
| type: 'none' | |||||
| } | |||||
| }, | |||||
| axisLine: { | |||||
| show: false | |||||
| }, | |||||
| axisTick: { | |||||
| show: false | |||||
| }, | |||||
| axisLabel: { | |||||
| rotate: 40, | |||||
| formatter: function(a, b) { | |||||
| return a | |||||
| } | |||||
| }, | |||||
| type: 'value', | |||||
| }], | |||||
| series: [{ | |||||
| type: 'line', | |||||
| data: ydata, | |||||
| smooth: true, //这句就是让曲线变平滑的 | |||||
| lineStyle: { | |||||
| normal: { | |||||
| color: '#33cdff', | |||||
| } | |||||
| }, | |||||
| areaStyle: { | |||||
| normal: { | |||||
| color: new echarts.graphic.LinearGradient( | |||||
| 0, 0, 0, 1, [{ | |||||
| offset: 0, | |||||
| color: '#FFF' | |||||
| }, { | |||||
| offset: 1, | |||||
| color: '#52A0FD' | |||||
| }] | |||||
| ) | |||||
| } | |||||
| }, | |||||
| }] | |||||
| }; | |||||
| chart.setOption(option) | |||||
| console.log(chart) | |||||
| } | |||||
| /** | |||||
| * 交易记录 | |||||
| */ | |||||
| function getBarOption(x, y) { | |||||
| return { | |||||
| color: ['#FF6A6A'], | |||||
| fontSize: "14rpx", | |||||
| grid: { | |||||
| top: '3%', | |||||
| left: "5%", | |||||
| right: "7%", | |||||
| bottom: "4%", | |||||
| containLabel: true, | |||||
| }, | |||||
| xAxis: { | |||||
| axisLine: { | |||||
| show: false | |||||
| }, | |||||
| axisTick: { | |||||
| show: false | |||||
| }, | |||||
| type: 'category', | |||||
| boundaryGap: false, | |||||
| data: x | |||||
| }, | |||||
| yAxis: { | |||||
| axisLine: { | |||||
| show: false | |||||
| }, | |||||
| axisTick: { | |||||
| show: false | |||||
| }, | |||||
| type: 'value', | |||||
| splitLine: { | |||||
| lineStyle: { | |||||
| type: 'none' | |||||
| } | |||||
| }, | |||||
| axisLabel: { | |||||
| rotate: 40, | |||||
| } | |||||
| }, | |||||
| series: [{ | |||||
| data: y, | |||||
| type: 'line', | |||||
| smooth: true, | |||||
| lineStyle: { | |||||
| normal: { | |||||
| color: '#FF6A6A', | |||||
| } | |||||
| }, | |||||
| areaStyle: {} | |||||
| }] | |||||
| }; | |||||
| }; | |||||
| /** | |||||
| * 核销记录 | |||||
| */ | |||||
| function getScatterOption(x, y) { | |||||
| return { | |||||
| color: '#FFCE00', | |||||
| fontSize: "14rpx", | |||||
| grid: { | |||||
| top: '3%', | |||||
| left: "5%", | |||||
| right: "7%", | |||||
| bottom: "4%", | |||||
| containLabel: true, | |||||
| }, | |||||
| xAxis: { | |||||
| axisLine: { | |||||
| show: false | |||||
| }, | |||||
| axisTick: { | |||||
| show: false | |||||
| }, | |||||
| type: 'category', | |||||
| boundaryGap: false, | |||||
| data: x | |||||
| }, | |||||
| yAxis: { | |||||
| axisLine: { | |||||
| show: false | |||||
| }, | |||||
| axisTick: { | |||||
| show: false | |||||
| }, | |||||
| type: 'value', | |||||
| splitLine: { | |||||
| lineStyle: { | |||||
| type: 'none' | |||||
| } | |||||
| }, | |||||
| axisLabel: { | |||||
| rotate: 40, | |||||
| } | |||||
| }, | |||||
| series: [{ | |||||
| data: y, | |||||
| type: 'line', | |||||
| smooth: true, | |||||
| areaStyle: {} | |||||
| }] | |||||
| }; | |||||
| }; | |||||
| /** | |||||
| * 获取交易记录 | |||||
| */ | |||||
| function getTabletListOrder() { | |||||
| let newArr = { | |||||
| xList: [], | |||||
| amountList: [] | |||||
| } | |||||
| return new Promise((resolve, reject) => { | |||||
| Http.getRequest(config.api.dateAmountRecordListOrder, app.globalData.token, '', {}, (res) => { | |||||
| // 日期 | |||||
| res.data && res.data.map(file => { | |||||
| newArr.xList.push(file.mouthAndDate) | |||||
| newArr.amountList.push(file.amountStr) | |||||
| }) | |||||
| resolve(newArr); | |||||
| }) | |||||
| }) | |||||
| }; | |||||
| /** | |||||
| * 获取核销记录 | |||||
| */ | |||||
| function getTabletListVerify() { | |||||
| let newArr = { | |||||
| xList: [], | |||||
| amountList: [] | |||||
| } | |||||
| return new Promise((resolve, reject) => { | |||||
| Http.getRequest(config.api.dateAmountRecordListVerified, app.globalData.token, '', {}, (res) => { | |||||
| // 日期 | |||||
| res.data && res.data.map(file => { | |||||
| newArr.xList.push(file.mouthAndDate) | |||||
| newArr.amountList.push(file.amountStr) | |||||
| }) | |||||
| resolve(newArr) | |||||
| }) | |||||
| }) | |||||
| }; | |||||
| Page({ | |||||
| data: { | |||||
| token:'', | |||||
| currentIndex: 0, | |||||
| userInfo: {}, | |||||
| recordMoney: 0, | |||||
| recordData: [], | |||||
| userInfoLoadIf: false, | |||||
| ec: { | |||||
| lazyLoad: true | |||||
| }, | |||||
| classIfyList: [ | |||||
| // { | |||||
| // text: '收银台', | |||||
| // icon: 'iconfont icon-shouyintai1', | |||||
| // id: 3 | |||||
| // }, | |||||
| { | |||||
| text: '会员核销', | |||||
| icon: 'iconfont icon-hexiao', | |||||
| id: 0 | |||||
| }, | |||||
| // { | |||||
| // text: '消费卡收款', | |||||
| // icon: 'iconfont icon-shouye1', | |||||
| // id: 1 | |||||
| // }, | |||||
| // { | |||||
| // text: '当日解单', | |||||
| // icon: 'iconfont icon-shoufukuan', | |||||
| // id: 2 | |||||
| // }, | |||||
| { | |||||
| text: '会员积分', | |||||
| icon: 'iconfont icon-jifen', | |||||
| id: 4 | |||||
| }, | |||||
| // { | |||||
| // text: '会员赠券', | |||||
| // icon: 'iconfont icon-quan', | |||||
| // id: 5 | |||||
| // }, | |||||
| { | |||||
| text: '营销结算', | |||||
| icon: 'iconfont icon-jiesuan', | |||||
| id: 6 | |||||
| }, | |||||
| // { | |||||
| // text: '商户建券', | |||||
| // icon: 'iconfont icon-lingquanzhongxin', | |||||
| // id: 7 | |||||
| // }, | |||||
| // { | |||||
| // text: '商品配送', | |||||
| // icon: 'iconfont icon-wuliu', | |||||
| // id: 8 | |||||
| // } | |||||
| ], | |||||
| amountMoney: '', | |||||
| djZmoney:'', | |||||
| writeOffMoney: '', | |||||
| getFullYear: new Date().getFullYear(), | |||||
| getMonth: new Date().getMonth() + 1, | |||||
| getDate: new Date().getDate(), | |||||
| dateTime: '', | |||||
| show: null, | |||||
| billList: [], | |||||
| ifShowChart: null, | |||||
| ifShowChart1: null, | |||||
| ifShowChart2: null, | |||||
| ecBar: { | |||||
| lazyLoad: true | |||||
| }, | |||||
| ecScatter: { | |||||
| lazyLoad: true | |||||
| }, | |||||
| djArr:[], | |||||
| djMoney:[], | |||||
| count:'' | |||||
| }, | |||||
| //获取商户信息 | |||||
| getUserInfo() { | |||||
| return new Promise((resolve, reject) => { | |||||
| Http.getRequest(config.api.userDetail, app.globalData.token, '', {}, (res) => { | |||||
| resolve(res.data); | |||||
| }) | |||||
| }) | |||||
| }, | |||||
| //今日交易额 | |||||
| getUnverifiedAmountOnDate() { | |||||
| let { | |||||
| getFullYear, | |||||
| getMonth, | |||||
| getDate, | |||||
| amountMoney, | |||||
| writeOffMoney | |||||
| } = this.data | |||||
| let dateTimer = getFullYear + '-' + getMonth + '-' + getDate | |||||
| Http.getRequest(config.api.getUnverifiedAmountOnDate, app.globalData.token, '', { | |||||
| date: dateTimer | |||||
| }, (res) => { | |||||
| console.log(res) | |||||
| this.setData({ | |||||
| amountMoney: res.data.amount, | |||||
| count: res.data.orderCount, | |||||
| }) | |||||
| }) | |||||
| }, | |||||
| //今日核销额 | |||||
| getVerifiedAmountOnDate() { | |||||
| let { | |||||
| getFullYear, | |||||
| getMonth, | |||||
| getDate | |||||
| } = this.data | |||||
| let dateTimer = getFullYear + '-' + getMonth + '-' + getDate | |||||
| Http.getRequest(config.api.getVerifiedAmountOnDate, app.globalData.token, '', { | |||||
| date: dateTimer | |||||
| }, (res) => { | |||||
| this.setData({ | |||||
| writeOffMoney: res.data.amount | |||||
| }) | |||||
| }) | |||||
| }, | |||||
| onPullDownRefresh: function() { | |||||
| let that = this; | |||||
| // that.getUnverifiedAmountOnDate() | |||||
| // that.getVerifiedAmountOnDate(); | |||||
| that.getpaybill(); | |||||
| if (that.oneComponent) { | |||||
| that.getrecordData(); | |||||
| } | |||||
| if (that.jiaoyiComponent) { | |||||
| that.getTabletListOrder(); | |||||
| } | |||||
| if (that.hexiaoComponent) { | |||||
| that.getTabletListVerify(); | |||||
| } | |||||
| tt.hideNavigationBarLoading(); | |||||
| tt.stopPullDownRefresh(); | |||||
| }, | |||||
| onLoad: function (options) { | |||||
| var that = this; | |||||
| this.checkuserstatus() | |||||
| }, | |||||
| onReady() { | |||||
| // this.oneComponent = this.selectComponent('#mychart-pament'); | |||||
| // this.jiaoyiComponent = this.selectComponent('#mychart-jiaoyi'); | |||||
| // this.hexiaoComponent = this.selectComponent('#mychart-hexiao'); | |||||
| this.getrecordData(); | |||||
| this.getTabletListOrder(); | |||||
| this.getTabletListVerify(); | |||||
| this.getUserInfo().then(res => { | |||||
| this.setData({ | |||||
| userInfo: res, | |||||
| userInfoLoadIf:true | |||||
| }) | |||||
| app.globalData.merchant = res; | |||||
| tt.setNavigationBarTitle({ | |||||
| title: res.mall_name + "(" + res.merchant_name + ")" | |||||
| }) | |||||
| }) | |||||
| app.globalData.userInfo = this.getUserInfo; | |||||
| }, | |||||
| /** | |||||
| * gotolook | |||||
| */ | |||||
| gotobill: function(e) { | |||||
| console.log(e) | |||||
| let owe = e.currentTarget.dataset.data.owe; | |||||
| let status = e.currentTarget.dataset.data.status; | |||||
| let receivedate = e.currentTarget.dataset.data.receiveDate; | |||||
| let starttime = e.currentTarget.dataset.data.starttime; | |||||
| let endtime = e.currentTarget.dataset.data.endtime; | |||||
| let id = e.currentTarget.dataset.data.id; | |||||
| var transactionId = e.currentTarget.dataset.data.transactionId; | |||||
| var priceDetail = e.currentTarget.dataset.data.priceDetail; | |||||
| var freeze = e.currentTarget.dataset.data.freeze; | |||||
| let pay = e.currentTarget.dataset.data.pay ? e.currentTarget.dataset.data.pay : 0; | |||||
| let latePayPrice = e.currentTarget.dataset.data.latePayPrice ? e.currentTarget.dataset.data.latePayPrice : 0; | |||||
| let serviceChargePay = e.currentTarget.dataset.data.serviceChargePay ? e.currentTarget.dataset.data.serviceChargePay : 0; | |||||
| if (starttime && endtime) { | |||||
| var end = starttime + "至" + endtime; | |||||
| } else { | |||||
| var end = ""; | |||||
| } | |||||
| if (transactionId) { | |||||
| var tradeTime = e.currentTarget.dataset.data.tradeTime; | |||||
| } else { | |||||
| var tradeTime = e.currentTarget.dataset.data.payDate; | |||||
| } | |||||
| console.log(e.currentTarget.dataset.data, tradeTime, 6666666) | |||||
| var billTypeValue = e.currentTarget.dataset.data.billTypeValue; | |||||
| let receivePay = e.currentTarget.dataset.data.receivePay; | |||||
| tt.navigateTo({ | |||||
| url: `/pages/bill/billdetail/index?owe=${owe}&receivedate=${receivedate}&status=${status}&end=${end}&id=${id}&tradeTime=${tradeTime}&transactionId=${transactionId}&priceDetail=${priceDetail}&billTypeValue=${billTypeValue}&receivePay=${receivePay}&freeze=${freeze}&pay=${pay}&latePayPrice=${latePayPrice}&serviceChargePay=${serviceChargePay}`, | |||||
| }) | |||||
| }, | |||||
| /** | |||||
| * 核销记录 | |||||
| */ | |||||
| // hexiaoInit: function(heXiaox, heXiaoYiy) { | |||||
| // this.hexiaoComponent.init((canvas, width, height) => { | |||||
| // const barChart = echarts.init(canvas, null, { | |||||
| // width: width, | |||||
| // height: height | |||||
| // }); | |||||
| // canvas.setChart(barChart); | |||||
| // barChart.setOption(getScatterOption(heXiaox, heXiaoYiy)); | |||||
| // return barChart; | |||||
| // }); | |||||
| // }, | |||||
| /** | |||||
| * 交易记录 | |||||
| */ | |||||
| // jiaoyiInit: function(jiaoYix, jiaoYiy) { | |||||
| // this.jiaoyiComponent.init((canvas, width, height) => { | |||||
| // const barChart = echarts.init(canvas, null, { | |||||
| // width: width, | |||||
| // height: height | |||||
| // }); | |||||
| // canvas.setChart(barChart); | |||||
| // barChart.setOption(getBarOption(jiaoYix, jiaoYiy)); | |||||
| // return barChart; | |||||
| // }); | |||||
| // }, | |||||
| // init_one: function(xdata, ydata) { //初始化第一个图表 | |||||
| // console.log(this.oneComponent, xdata, ydata) | |||||
| // this.oneComponent.init((canvas, width, height) => { | |||||
| // const chart = echarts.init(canvas, null, { | |||||
| // width: width, | |||||
| // height: height | |||||
| // }); | |||||
| // console.log(chart, xdata, ydata) | |||||
| // setOption(chart, xdata, ydata) | |||||
| // this.chart = chart; | |||||
| // return chart; | |||||
| // }); | |||||
| // }, | |||||
| toWriteoff(e) { | |||||
| console.log(e) | |||||
| let id = e.currentTarget.dataset.id | |||||
| console.log(id) | |||||
| if (id == 0) { | |||||
| tt.navigateTo({ | |||||
| url: '/pages/scan/scan', | |||||
| }) | |||||
| } else if (id == 1) { | |||||
| // 优惠卡收款 | |||||
| tt.navigateTo({ | |||||
| url: '/pages/cardReceive/cardReceive', | |||||
| }) | |||||
| } else if (id == 2) { | |||||
| tt.navigateTo({ | |||||
| url: '/pages/main/solution/solution', | |||||
| }) | |||||
| } else if (id == 3) { | |||||
| tt.navigateTo({ | |||||
| url: '/pages/payment/index', | |||||
| }) | |||||
| } else if (id == 4) { | |||||
| tt.navigateTo({ | |||||
| url: '/pages/creditSelect/index', | |||||
| }) | |||||
| } else if (id == 5) { | |||||
| tt.navigateTo({ | |||||
| url: '/pages/incouponSelect/index', | |||||
| }) | |||||
| } else if (id == 6) { | |||||
| tt.navigateTo({ | |||||
| url: '/pages/marktingsettlement/marktingsettlement', | |||||
| }) | |||||
| }else if(id==7){//用户发卷 | |||||
| tt.navigateTo({ | |||||
| url: '/pages/sendDiscounts/sendDiscounts', | |||||
| }) | |||||
| } else if (id == 8) {//商品配送 | |||||
| tt.navigateTo({ | |||||
| url: '/pages/delivery/delivery', | |||||
| }) | |||||
| } | |||||
| }, | |||||
| toTran(e) { | |||||
| let type = e.currentTarget.dataset.type | |||||
| tt.navigateTo({ | |||||
| url: `./transaction/transaction?type=${type}`, | |||||
| }) | |||||
| }, | |||||
| onShow() { | |||||
| let that = this; | |||||
| /** | |||||
| * 交易记录 | |||||
| */ | |||||
| if (that.oneComponent) { | |||||
| that.getrecordData(); | |||||
| } | |||||
| if (that.jiaoyiComponent) { | |||||
| that.getTabletListOrder(); | |||||
| } | |||||
| if (that.hexiaoComponent) { | |||||
| that.getTabletListVerify(); | |||||
| } | |||||
| /** | |||||
| * 获得交易记录和核销额 | |||||
| */ | |||||
| that.getUnverifiedAmountOnDate(); | |||||
| that.getVerifiedAmountOnDate(); | |||||
| that.getpaybill(); | |||||
| that.setData({ | |||||
| currentIndex: 0 | |||||
| }) | |||||
| }, | |||||
| getpaybill: function() { | |||||
| let that = this; | |||||
| that.getUserInfo().then(res => { | |||||
| Http.postRequest(config.api.listBillOweAndWaitPay, app.globalData.token, '', { | |||||
| merchantId: res.merchant_id, | |||||
| tenantId: res.tenant_id, | |||||
| }, (res) => { | |||||
| console.log(res); | |||||
| if (res) { | |||||
| res.data.map(file => { | |||||
| if (file.starttime && file.endtime) { | |||||
| file.end = file.starttime.substring(0, 7).replace(/-/g, ".") + "-" + file.endtime.substring(0, 7).replace(/-/g, "."); | |||||
| } else { | |||||
| file.end = ""; | |||||
| file.endtime = "" | |||||
| } | |||||
| file.receiveDate = util.fmtDate(file.receiveDate); | |||||
| }) | |||||
| that.setData({ | |||||
| billList: res.data, | |||||
| djArr : res.data.filter(item => item.status == 2), | |||||
| }) | |||||
| that.data.djMoney = that.data.djArr.map(item => parseInt(item.owe / 100)) | |||||
| let money = 0 | |||||
| that.data.djMoney.filter(function (item, index) { | |||||
| money += item; | |||||
| }) | |||||
| that.setData({ | |||||
| djZmoney: changeNum.changePeoNumber(money) | |||||
| }) | |||||
| } | |||||
| }) | |||||
| }) | |||||
| }, | |||||
| getTabletListVerify: function() { | |||||
| let that = this; | |||||
| getTabletListVerify() | |||||
| .then(res => { | |||||
| if (res.xList.length > 0 && res.amountList.length > 0) { | |||||
| that.setData({ | |||||
| ifShowChart1: 'show1' | |||||
| }) | |||||
| // that.hexiaoInit(res.xList, res.amountList) | |||||
| } else { | |||||
| /** | |||||
| * 判断是否显示数据表 | |||||
| */ | |||||
| that.setData({ | |||||
| ifShowChart1: 'show' | |||||
| }) | |||||
| } | |||||
| }) | |||||
| }, | |||||
| /** | |||||
| * 交易 | |||||
| */ | |||||
| getTabletListOrder: function() { | |||||
| let that = this; | |||||
| getTabletListOrder() | |||||
| .then(res => { | |||||
| console.log(res); | |||||
| if (res.xList.length > 0 && res.amountList.length > 0) { | |||||
| // that.jiaoyiInit(res.xList, res.amountList) | |||||
| that.setData({ | |||||
| ifShowChart: 'show1' | |||||
| }) | |||||
| } else { | |||||
| /** | |||||
| * 判断是否显示数据表 | |||||
| */ | |||||
| that.setData({ | |||||
| ifShowChart: 'show' | |||||
| }) | |||||
| } | |||||
| }) | |||||
| }, | |||||
| /** | |||||
| * 收银记录 | |||||
| */ | |||||
| getrecordData() { | |||||
| let _this = this; | |||||
| HttpBasics.get({ | |||||
| url: config.api.getMicroPayAmountOnDate | |||||
| }) | |||||
| .then(res => { | |||||
| _this.setData({ | |||||
| recordMoney: res.data.amount | |||||
| }) | |||||
| }) | |||||
| .catch(err => { | |||||
| tt.showToast({ | |||||
| title: err.message, | |||||
| icon: 'none', | |||||
| duration: 2000, | |||||
| mask: false | |||||
| }); | |||||
| }); | |||||
| HttpBasics.get({ | |||||
| url: config.api.listMicropay | |||||
| }) | |||||
| .then(res => { | |||||
| let dataX = []; | |||||
| let dataY = []; | |||||
| if (res.data && res.data.length > 0) { | |||||
| _this.setData({ | |||||
| ifShowChart2: "show1" | |||||
| }) | |||||
| res.data.map((item, index) => { | |||||
| dataX.push(item.mouthAndDate) | |||||
| dataY.push(Number(item.amountStr)) | |||||
| }) | |||||
| // _this.init_one(dataX, dataY) | |||||
| } else { | |||||
| _this.setData({ | |||||
| ifShowChart2: "show" | |||||
| }) | |||||
| } | |||||
| }) | |||||
| .catch(err => { | |||||
| tt.showToast({ | |||||
| title: err.message, | |||||
| icon: 'none', | |||||
| duration: 2000, | |||||
| mask: false | |||||
| }); | |||||
| }); | |||||
| }, | |||||
| toTran(e) { | |||||
| let type = e.currentTarget.dataset.type | |||||
| tt.navigateTo({ | |||||
| url: `/pages/transaction/transaction?type=${type}`, | |||||
| }) | |||||
| }, | |||||
| toRecord() { | |||||
| tt.navigateTo({ | |||||
| url: `/pages/record/list/index`, | |||||
| }) | |||||
| }, | |||||
| checkuserstatus() { | |||||
| let _this = this; | |||||
| HttpBasics.get({ | |||||
| url: config.api.checkPhoneStatus | |||||
| }) | |||||
| .then(res => { | |||||
| }) | |||||
| .catch(err => { | |||||
| if (err.code == 11005) { | |||||
| tt.redirectTo({ | |||||
| url: `/pages/getuserinfo/index` | |||||
| }) | |||||
| } | |||||
| }); | |||||
| }, | |||||
| }) | |||||
| @@ -0,0 +1,10 @@ | |||||
| { | |||||
| "backgroundTextStyle": "dark", | |||||
| "navigationBarBackgroundColor": "#52A0FD", | |||||
| "navigationBarTitleText": "", | |||||
| "navigationBarTextStyle": "white", | |||||
| "enablePullDownRefresh": true, | |||||
| "usingComponents": { | |||||
| "ec-canvas": "../../ec-canvas/ec-canvas" | |||||
| } | |||||
| } | |||||