@@ -0,0 +1,120 @@ | |||||
{ | |||||
"http.proxy": "", | |||||
"http.proxySupport": "override", | |||||
"proxyType": "system", | |||||
"setProxy": "", | |||||
"systemProxyUrl": "", | |||||
"workbench.colorTheme": "Sublime VSCode Theme", | |||||
"workbench.colorThemeType": "dark", | |||||
"typescript.tsdk": "E:\\TikTok DevTool\\@bytedminiprogram-ide\\resources\\app\\app.content\\dist\\assets\\business\\typescript\\lib", | |||||
"files.associations": { | |||||
"*.ttss": "css", | |||||
"*.wxss": "css", | |||||
"*.sjs": "javascript", | |||||
"*.ttml": "ttml", | |||||
"*.wxml": "ttml", | |||||
"*.sk": "ttml" | |||||
}, | |||||
"files.exclude": { | |||||
"**/.git": true, | |||||
"**/.svn": true, | |||||
"**/.hg": true, | |||||
"**/CVS": true, | |||||
"**/.DS_Store": true, | |||||
"**/Thumbs.db": true, | |||||
"**/.byte-ide": true | |||||
}, | |||||
"emmet.includeLanguages": { | |||||
"sjs": "javascript" | |||||
}, | |||||
"security.workspace.trust.untrustedFiles": "open", | |||||
"[jsonc]": { | |||||
"editor.defaultFormatter": "HookyQR.beautify" | |||||
}, | |||||
"explorer.confirmDelete": false, | |||||
"less.compile": { | |||||
"compress": false, | |||||
"out": true, | |||||
"outExt": ".ttss" | |||||
}, | |||||
"[javascript]": { | |||||
"editor.defaultFormatter": "HookyQR.beautify" | |||||
}, | |||||
"[json]": { | |||||
"editor.defaultFormatter": "HookyQR.beautify" | |||||
}, | |||||
"editor.tokenColorCustomizations": { | |||||
"keywords": { | |||||
"foreground": "#FF0000", | |||||
"fontStyle": "italic bold" | |||||
}, | |||||
"variables": { | |||||
"foreground": "#ffffff", | |||||
"fontStyle": "italic bold", | |||||
}, | |||||
//字符串 | |||||
"strings": { | |||||
"foreground": "#fbff00", | |||||
"fontStyle": "italic" | |||||
}, | |||||
//函数 | |||||
"functions": "#00ffff", | |||||
//注释 | |||||
"comments": "#969696", | |||||
"types": "#00ff95" | |||||
}, | |||||
"editor.formatOnSave": true, | |||||
"editor.wordWrap": "on", | |||||
// 开启原生括号着色 | |||||
"editor.bracketPairColorization.enabled": true, | |||||
// 开启代码块边缘导轨线着色 | |||||
"editor.guides.bracketPairs": "active", | |||||
//覆盖当前所选颜色主题的颜色 | |||||
"workbench.colorCustomizations": { | |||||
//光标颜色 | |||||
"editorCursor.foreground": "#00ff00", | |||||
//编辑器背景色 | |||||
"editor.background": "#00000025", | |||||
//光标所在行边框颜色 | |||||
//光标所在行背景颜色 | |||||
"editor.lineHighlightBorder": "#ffffffa1", | |||||
"editor.lineHighlightBackground": "#ffffff1e", | |||||
//光标选中文本的背景颜色 | |||||
//光标选中文本时匹配同类型的值的背景颜色 | |||||
"editor.selectionBackground": "#ff0000c2", | |||||
"editor.selectionHighlightBackground": "#00ffff80", | |||||
//缩进参考线的颜色 | |||||
"editorIndentGuide.activeBackground": "#f92672", | |||||
//方括号出现意外的前景色 | |||||
"editorBracketHighlight.unexpectedBracket.foreground": "#ff0000", | |||||
//括号的前景色,需要启用括号对着色 | |||||
"editorBracketHighlight.foreground1": "#ffff00", | |||||
"editorBracketPairGuide.activeBackground1": "#ffff00", | |||||
"editorBracketHighlight.foreground2": "#f92672", | |||||
"editorBracketPairGuide.activeBackground2": "#f92672", | |||||
"editorBracketHighlight.foreground3": "#00ffff", | |||||
"editorBracketPairGuide.activeBackground3": "#00ffff", | |||||
"editorBracketHighlight.foreground4": "#00ff00", | |||||
"editorBracketPairGuide.activeBackground4": "#00ff00", | |||||
"workbench.colorTheme": "Sublime VSCode Theme", | |||||
"[Sublime VSCode Theme]": { | |||||
"activityBar.activeBackground": "#ffffff1e", | |||||
"activityBar.background": "#292b27", | |||||
"activityBar.foreground": "#ffffff", | |||||
"activityBar.activeBorder": "#ff0000", | |||||
"activityBar.activeFocusBorder": "#ff0000", | |||||
"breadcrumb.foreground": "#ffffff", | |||||
"breadcrumb.background": "#1a1b18", | |||||
"sideBar.background": "#1e1f1c", | |||||
"sideBarSectionHeader.background": "#343532", | |||||
"sideBarSectionHeader.foreground": "#fff", | |||||
"sideBar.border": "#777777", | |||||
"sideBar.foreground": "#fff", | |||||
"list.hoverBackground": "#8a8a8a", | |||||
"list.inactiveSelectionBackground": "#75715e", | |||||
"editor.selectionBackground": "#ff0000", | |||||
"editorGroupHeader.tabsBackground": "#141415" | |||||
}, | |||||
}, | |||||
"editor.cursorBlinking": "smooth", | |||||
} |
@@ -20,3 +20,7 @@ App({ | |||||
}, | }, | ||||
statusBarHeight: 0, | statusBarHeight: 0, | ||||
}) | }) | ||||
// 测试账号信息 | |||||
// 18872592635 | |||||
// 123456GD |
@@ -21,7 +21,9 @@ | |||||
"pages/exchange/index", | "pages/exchange/index", | ||||
"pages/creditOperate/index", | "pages/creditOperate/index", | ||||
"pages/goHtml/goHtml", | "pages/goHtml/goHtml", | ||||
"pages/orderUrl/orderUrl" | |||||
"pages/orderUrl/orderUrl", | |||||
"pages/Appointment/appointment", | |||||
"pages/appointDetail/appointDetail" | |||||
], | ], | ||||
"window": { | "window": { | ||||
"backgroundTextStyle": "light", | "backgroundTextStyle": "light", | ||||
@@ -31,8 +33,7 @@ | |||||
"color": "#9F9F9F", | "color": "#9F9F9F", | ||||
"selectedColor": "#52a0fd", | "selectedColor": "#52a0fd", | ||||
"backgroundColor": "#fff", | "backgroundColor": "#fff", | ||||
"list": [ | |||||
{ | |||||
"list": [{ | |||||
"pagePath": "pages/main/main", | "pagePath": "pages/main/main", | ||||
"text": "首页", | "text": "首页", | ||||
"iconPath": "assets/images/home-n.png", | "iconPath": "assets/images/home-n.png", | ||||
@@ -105,7 +105,7 @@ const func = { | |||||
/** | /** | ||||
* 优惠券详情 | * 优惠券详情 | ||||
*/ | */ | ||||
getCouponOrderDetail: function (couponOrderId) { | |||||
getCouponOrderDetail: function (couponOrderId, couponTenantId) { | |||||
return new Promise((resolve, reject) => { | return new Promise((resolve, reject) => { | ||||
tt.request({ | tt.request({ | ||||
url: config.api.couponOrderDetail, | url: config.api.couponOrderDetail, | ||||
@@ -115,7 +115,8 @@ const func = { | |||||
}, | }, | ||||
method: "get", | method: "get", | ||||
data: { | data: { | ||||
couponOrderId: couponOrderId | |||||
couponOrderId: couponOrderId, | |||||
couponTenantId: couponTenantId | |||||
}, | }, | ||||
success: function (res) { | success: function (res) { | ||||
resolve(res.data) | resolve(res.data) | ||||
@@ -245,7 +246,7 @@ const func = { | |||||
/** | /** | ||||
* 券核销 | * 券核销 | ||||
*/ | */ | ||||
couponOrderVerify: function (couponOrderId, verifyRemark) { | |||||
couponOrderVerify: function (couponOrderId, couponTenantId, verifyRemark) { | |||||
return new Promise((resolve, reject) => { | return new Promise((resolve, reject) => { | ||||
tt.request({ | tt.request({ | ||||
url: config.api.couponOrderVerify, | url: config.api.couponOrderVerify, | ||||
@@ -255,7 +256,8 @@ const func = { | |||||
}, | }, | ||||
data: { | data: { | ||||
couponOrderId: couponOrderId, | couponOrderId: couponOrderId, | ||||
verifyRemark: verifyRemark, | |||||
couponTenantId: couponTenantId, | |||||
verifyRemark: verifyRemark | |||||
}, | }, | ||||
method: "POST", | method: "POST", | ||||
success: function (res) { | success: function (res) { | ||||
@@ -274,7 +276,7 @@ const func = { | |||||
* | * | ||||
* @param {*换取openId} code | * @param {*换取openId} code | ||||
*/ | */ | ||||
getOpenId: function (code,bUserId) { | |||||
getOpenId: function (code, bUserId) { | |||||
return new Promise((resolve, reject) => { | return new Promise((resolve, reject) => { | ||||
tt.request({ | tt.request({ | ||||
url: config.api.getOpenId, | url: config.api.getOpenId, | ||||
@@ -285,7 +287,7 @@ const func = { | |||||
data: { | data: { | ||||
appId: config.weapp.appId, | appId: config.weapp.appId, | ||||
code: code, | code: code, | ||||
bUserId:bUserId | |||||
bUserId: bUserId | |||||
}, | }, | ||||
method: "POST", | method: "POST", | ||||
success: function (res) { | success: function (res) { | ||||
@@ -325,8 +327,8 @@ const func = { | |||||
}) | }) | ||||
}, | }, | ||||
/** | /** | ||||
* 获得手机号 | |||||
*/ | |||||
* 获得手机号 | |||||
*/ | |||||
getUserPhone: function (encryptedData, iv, superopenId, session_key) { | getUserPhone: function (encryptedData, iv, superopenId, session_key) { | ||||
return new Promise((resolve, reject) => { | return new Promise((resolve, reject) => { | ||||
tt.request({ | tt.request({ | ||||
@@ -5,14 +5,14 @@ let url = extConfig.attr.configUrl; | |||||
var apiPrefix = url + '/B'; | var apiPrefix = url + '/B'; | ||||
let config = { | let config = { | ||||
apiPrefix:apiPrefix, | |||||
apiPrefix: apiPrefix, | |||||
api: { | api: { | ||||
// 获取进件 页面地址 | // 获取进件 页面地址 | ||||
findTt: "/api/merchant/getTtReceiverUrl", | findTt: "/api/merchant/getTtReceiverUrl", | ||||
/** | /** | ||||
* 接口用途:login | |||||
*/ | |||||
* 接口用途:login | |||||
*/ | |||||
login: '/api/user/login', | login: '/api/user/login', | ||||
/** | /** | ||||
* B端用户详情 | * B端用户详情 | ||||
@@ -118,13 +118,33 @@ let config = { | |||||
*/ | */ | ||||
getMicroPayAmountOnDate: '/api/micropay/getMicroPayAmountOnDate', | getMicroPayAmountOnDate: '/api/micropay/getMicroPayAmountOnDate', | ||||
/** | /** | ||||
* 首页账单列表 | |||||
*/ | |||||
* 首页账单列表 | |||||
*/ | |||||
listBillOweAndWaitPay: "/api/bill/listBillOweAndWaitPay", | listBillOweAndWaitPay: "/api/bill/listBillOweAndWaitPay", | ||||
/** | /** | ||||
* 账单 | * 账单 | ||||
*/ | */ | ||||
listBill: "/api/bill/listBill", | listBill: "/api/bill/listBill", | ||||
/** | |||||
* 预约列表 | |||||
*/ | |||||
appointmentList: "/api/wxCouponOrderReservation/list", | |||||
/** | |||||
* 预约详情 | |||||
*/ | |||||
appointDetail: "/api/wxCouponOrderReservation/detail", | |||||
/** | |||||
* 核销 | |||||
*/ | |||||
verify: "/api/wxCouponOrderReservation/verify", | |||||
/** | |||||
* 预约确认 | |||||
*/ | |||||
appointConfirm: "/api/wxCouponOrderReservation/updateStatus", | |||||
/** | |||||
* 预约确认 | |||||
*/ | |||||
appointSetDate: "/api/wxCouponOrderReservation/update", | |||||
/** | /** | ||||
* 获得openId | * 获得openId | ||||
*/ | */ | ||||
@@ -210,8 +230,8 @@ let config = { | |||||
*/ | */ | ||||
getCreditList: "/api/credit/list", | getCreditList: "/api/credit/list", | ||||
/** | /** | ||||
* 查询账户信息 | |||||
*/ | |||||
* 查询账户信息 | |||||
*/ | |||||
findAccountById: "/api/merchant/findAccountById", | findAccountById: "/api/merchant/findAccountById", | ||||
/** | /** | ||||
* 更新收款账户信息 | * 更新收款账户信息 | ||||
@@ -306,12 +326,12 @@ let config = { | |||||
*/ | */ | ||||
addbatch: "/api/wxCouponChannel/addbatch", | addbatch: "/api/wxCouponChannel/addbatch", | ||||
/** | /** | ||||
* B端发卷-下架 | |||||
*/ | |||||
* B端发卷-下架 | |||||
*/ | |||||
soldOut: "/api/wxCouponChannel/update", | soldOut: "/api/wxCouponChannel/update", | ||||
/** | /** | ||||
* B端发卷-作废 | |||||
*/ | |||||
* B端发卷-作废 | |||||
*/ | |||||
cancellation: "/api/coupon/update", | cancellation: "/api/coupon/update", | ||||
/** | /** | ||||
* B端发卷-查询审批历史记录 | * B端发卷-查询审批历史记录 | ||||
@@ -332,7 +352,7 @@ let config = { | |||||
/** | /** | ||||
* 导出订单记录 | * 导出订单记录 | ||||
*/ | */ | ||||
exportUrl: "/api/couponOrder/getVerifiedExportUrl", | |||||
exportUrl: "/api/couponOrder/getVerifiedExportUrl", | |||||
}, | }, | ||||
weapp: { | weapp: { | ||||
@@ -345,6 +365,6 @@ let config = { | |||||
for (var key in config.api) { | for (var key in config.api) { | ||||
config.api[key] = apiPrefix + config.api[key]; | config.api[key] = apiPrefix + config.api[key]; | ||||
} | } | ||||
console.log(config,"config"); | |||||
console.log(config, "config"); | |||||
module.exports = config; | module.exports = config; |
@@ -1,38 +1,35 @@ | |||||
{ | { | ||||
"ext": { | "ext": { | ||||
"attr": { | "attr": { | ||||
"configUrl": "https://b.malls.iformall.com", | |||||
"datatowerurl": "https://mobile.malls.iformall.com" | |||||
"configUrl": "https://btest.malls.iformall.com", | |||||
"datatowerurl": "https://mobiletest.malls.iformall.com" | |||||
}, | }, | ||||
"name": "富茂券商户端模板", | |||||
"weappId": "tt7af40c49e5cd8d5001", | |||||
"name": "富茂家政商户端", | |||||
"weappId": "tt80b0f60d1f8c7bda01", | |||||
"appVersion": "Btest.5.1.0" | "appVersion": "Btest.5.1.0" | ||||
}, | }, | ||||
"debug": false, | "debug": false, | ||||
"tabBar": { | "tabBar": { | ||||
"list": [{ | |||||
"text": "首页", | |||||
"iconPath": "assets/images/home-n.png", | |||||
"pagePath": "pages/main/main", | |||||
"selectedIconPath": "assets/images/home-y.png" | |||||
}, { | |||||
"text": "我的", | |||||
"iconPath": "assets/images/user-n.png", | |||||
"pagePath": "pages/user/user", | |||||
"selectedIconPath": "assets/images/user-y.png" | |||||
}], | |||||
"color": "#9F9F9F", | "color": "#9F9F9F", | ||||
"selectedColor": "#52a0fd", | "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" | |||||
} | |||||
] | |||||
"backgroundColor": "#fff" | |||||
}, | }, | ||||
"window": { | "window": { | ||||
"backgroundTextStyle": "light", | "backgroundTextStyle": "light", | ||||
"navigationBarBackgroundColor": "#52A0FD" | "navigationBarBackgroundColor": "#52A0FD" | ||||
}, | }, | ||||
"extAppid": "tt7af40c49e5cd8d5001", | |||||
"extAppid": "tt80b0f60d1f8c7bda01", | |||||
"extEnable": true, | "extEnable": true, | ||||
"permission": { | "permission": { | ||||
"scope.userLocation": { | "scope.userLocation": { | ||||
@@ -0,0 +1,198 @@ | |||||
// c:\Users\Holy-Knight-IX\Desktop\Working Space\4.TikTok-MiniPro\ttb\pages\Appointment\appointment\appointment.js | |||||
const config = require('../../config/config.js') | |||||
const Http = require('../../utils/http.js') | |||||
const HttpBasics = require('../../utils/HttpBasics.js') | |||||
const util = require('../../utils/util') | |||||
var app = getApp() | |||||
Page({ | |||||
data: { | |||||
currentID: "", | |||||
pickedTime: "", | |||||
startTime: "开始时间", | |||||
endTime: "结束时间", | |||||
pageNum: 1, | |||||
status: 0, | |||||
list: [], | |||||
Phone: '', | |||||
}, | |||||
onLoad(options) { | |||||
this.getList() | |||||
}, | |||||
getList(status, startTime, endTime) { | |||||
const that = this | |||||
const data = { | |||||
pageNum: this.data.pageNum, | |||||
userPhone: this.data.Phone, | |||||
pageSize: 200, | |||||
} | |||||
if (startTime && endTime) { | |||||
data.serchStartDate = startTime | |||||
data.serchEndDate = endTime | |||||
} | |||||
if (status || status === 0) { | |||||
data.status = status | |||||
} | |||||
HttpBasics.get({ | |||||
url: config.api.appointmentList, | |||||
data | |||||
}) | |||||
.then(res => { | |||||
console.log(res, 'res'); | |||||
res.data.list.forEach(item => { | |||||
const appointStart = util.timestampToTime(item.startDate, 'YYYY-MM-DD hh:mm:ss') | |||||
const appointEnd = util.timestampToTime(item.endDate, 'hh:mm:ss') | |||||
if (item.startDate && item.endDate) { | |||||
item.appointTime = appointStart + ' - ' + appointEnd | |||||
} else { | |||||
item.appointTime = "暂无"; | |||||
} | |||||
}) | |||||
that.setData({ | |||||
list: res.data.list, | |||||
}) | |||||
}).catch(err => { | |||||
console.log(err, 'err'); | |||||
}) | |||||
}, | |||||
setNav(e) { | |||||
const id = e.currentTarget.dataset.id | |||||
this.setData({ | |||||
currentID: id == this.data.currentID ? '' : id | |||||
}) | |||||
console.log(this.data.currentID, 'currentID'); | |||||
}, | |||||
setType(e) { | |||||
const type = e.currentTarget.dataset.type | |||||
this.setData({ | |||||
currentID: '', | |||||
}) | |||||
if (type === 'X') { | |||||
this.getList(false) | |||||
} else if (type === 'Y') { | |||||
this.getList(0) | |||||
} else { | |||||
this.getList(type * 1) | |||||
} | |||||
}, | |||||
setStartTime(e) { | |||||
console.log(e.detail.value, 'e'); | |||||
this.setData({ | |||||
startTime: e.detail.value | |||||
}) | |||||
}, | |||||
setEndTime(e) { | |||||
console.log(e.detail.value, 'e'); | |||||
this.setData({ | |||||
endTime: e.detail.value | |||||
}) | |||||
}, | |||||
search() { | |||||
if (this.data.startTime == '开始时间' || this.data.endTime == '结束时间') { | |||||
return | |||||
} | |||||
const startTime = this.data.startTime + " 00:00:00" | |||||
const endTime = this.data.endTime + " 23:59:59" | |||||
this.getList(false, startTime, endTime) | |||||
}, | |||||
goDetail(e) { | |||||
const id = e.currentTarget.dataset.id | |||||
tt.navigateTo({ | |||||
url: `/pages/appointDetail/appointDetail?id=${id}`, | |||||
}); | |||||
}, | |||||
// 核销 | |||||
goVerification(e) { | |||||
let _this = this | |||||
// console.log(id, shop); | |||||
console.log(e); | |||||
// const id = BigInt(e.currentTarget.dataset.id) | |||||
const id = e.currentTarget.dataset.id | |||||
console.log(typeof (id)); | |||||
console.log(id); | |||||
const shop = e.currentTarget.dataset.shop | |||||
const data = { | |||||
id | |||||
} | |||||
tt.showModal({ | |||||
title: "提示", | |||||
content: `当前正在核销【${shop}】的预约订单,请确认是否核销?`, | |||||
showCancel: true, | |||||
confirmText: "确认核销", | |||||
confirmColor: "#52a0fd", | |||||
cancelText: "返回", | |||||
success(res) { | |||||
if (res.confirm) { | |||||
HttpBasics.post({ | |||||
url: config.api.verify, | |||||
data | |||||
}).then(res => { | |||||
console.log(res, 'res'); | |||||
_this.getList() | |||||
tt.showToast({ | |||||
image: './../../assets/images/success.png', | |||||
title: '核销成功', | |||||
}) | |||||
}).catch(err => { | |||||
console.log(err, 'err'); | |||||
tt.showToast({ | |||||
image: './../../assets/images/fail.png', | |||||
title: '核销失败', | |||||
}) | |||||
}) | |||||
} | |||||
if (res.cancel) { | |||||
return | |||||
} | |||||
} | |||||
}); | |||||
}, | |||||
// 解决数字丢失精度 | |||||
parseBigNumber(numberStr) { | |||||
let result = ''; | |||||
let carry = 0; | |||||
for (let i = numberStr.length - 1; i >= 0; i--) { | |||||
const digit = Number(numberStr[i]); | |||||
const sum = digit + carry; | |||||
if (sum >= 10) { | |||||
result = (sum - 10).toString() + result; | |||||
carry = 1; | |||||
} else { | |||||
result = sum.toString() + result; | |||||
carry = 0; | |||||
} | |||||
} | |||||
if (carry === 1) { | |||||
result = '1' + result; | |||||
} | |||||
return result; | |||||
}, | |||||
handleInput(e) { | |||||
// console.log(e.detail.value); | |||||
this.data.Phone = e.detail.value | |||||
}, | |||||
onShow() { | |||||
this.getList() | |||||
} | |||||
}) |
@@ -0,0 +1,8 @@ | |||||
{ | |||||
"navigationBarTitleText": "预约管理", | |||||
"enablePullDownRefresh": true, | |||||
"backgroundTextStyle": "dark", | |||||
"navigationBarTextStyle": "white", | |||||
"navigationBarBackgroundColor": "#52A0FD", | |||||
"usingComponents": {} | |||||
} |
@@ -0,0 +1,65 @@ | |||||
<view> | |||||
<view class="input"> | |||||
<input type="number" placeholder="手机号查询" bindinput="handleInput" value="{{Phone}}" /> | |||||
<button type="default" size="default" bindtap="getList"> | |||||
搜索 | |||||
</button> | |||||
</view> | |||||
<view class="nav"> | |||||
<view class="{{ currentID == 1 ? 'currentItem' : 'item' }}" bindtap="setNav" data-id="1"> | |||||
<text>类型</text> | |||||
<image mode="widthFix" src="../../assets/images/arrow.png"></image> | |||||
</view> | |||||
<view class="{{ currentID == 2 ? 'currentItem' : 'item' }}" bindtap="setNav" data-id="2"> | |||||
<text>日期</text> | |||||
<image mode="widthFix" src="../../assets/images/arrow.png"> | |||||
</image> | |||||
</view> | |||||
</view> | |||||
<view class="{{ currentID == 1 ? 'type active' : 'type' }}"> | |||||
<view class="item" bindtap="setType" data-type="X">全部</view> | |||||
<view class="item" bindtap="setType" data-type="Y">待确认</view> | |||||
<view class="item" bindtap="setType" data-type="-1">未预约</view> | |||||
<view class="item" bindtap="setType" data-type="5">已确认</view> | |||||
<view class="item" bindtap="setType" data-type="8">已完成</view> | |||||
</view> | |||||
<view tt:if="{{ currentID == 2 }}" class="pickedTime"> | |||||
<picker class="picker" mode="date" bindchange="setStartTime">{{ startTime }}</picker> 至 <picker class="picker" | |||||
mode="date" bindchange="setEndTime">{{ endTime }}</picker> | |||||
<button class="search" type="primary" bindtap="search">查询</button> | |||||
</view> | |||||
<view class="{{ currentID != 1 ? 'list active' : 'list' }}"> | |||||
<view tt:if="{{ list.length > 0 }}" class="item" tt:for="{{ list }}"> | |||||
<view class="head"> | |||||
<view>券码:{{ item.couponOrderId }}</view> | |||||
<view tt:if="{{ item.status == 0 }}" class="notice noAppoint">待确认</view> | |||||
<view tt:if="{{ item.status == 1 }}" class="notice noAppoint">已取消</view> | |||||
<view tt:if="{{ item.status == 3 }}" class="notice refund">已退款</view> | |||||
<view tt:if="{{ item.status == 5 }}" class="notice confirm">已确认</view> | |||||
<view tt:if="{{ item.status == '-1' }}" class="notice confirm">未预约</view> | |||||
<view tt:if="{{ item.status == 8 }}" class="notice complete">已完成</view> | |||||
<view tt:if="{{ item.status == 9 }}" class="notice complete">已评价</view> | |||||
</view> | |||||
<view class="body"> | |||||
<view class="items">商品名称:{{ item.couponTitle }}</view> | |||||
<view class="items">店铺名称:{{ item.reservationMerchantName }}</view> | |||||
<view class="items">用户手机号码:{{ item.userPhone }}</view> | |||||
<view class="items">服务预约时间:<text tt:if="{{ item.appointTime == '暂无' }}">暂无</text></view> | |||||
<view tt:if="{{ item.appointTime != '暂无' }}" class="items">{{ item.appointTime }}</view> | |||||
</view> | |||||
<view class="footer"> | |||||
<button type="primary" bindtap="goDetail" data-id="{{ item.id }}">详情</button> | |||||
<button tt:if="{{item.status==-1||item.status==0||item.status==5||item.status==7}}" type="primary" | |||||
bindtap="goVerification" data-id="{{ item.id }}" | |||||
data-shop="{{ item.reservationMerchantName }}">核销</button> | |||||
</view> | |||||
</view> | |||||
<view tt:if="{{ list.length == 0 }}" class="itemXX"> | |||||
暂无记录 | |||||
</view> | |||||
</view> | |||||
</view> |
@@ -0,0 +1,182 @@ | |||||
.nav { | |||||
display: flex; | |||||
flex-wrap: wrap; | |||||
justify-content: space-between; | |||||
padding: 20rpx 150rpx; | |||||
background-color: #f7f7f7; | |||||
} | |||||
.input { | |||||
/* width: 100%; */ | |||||
display: flex; | |||||
justify-content: space-between; | |||||
padding: 10rpx; | |||||
height: 100rpx; | |||||
} | |||||
.input input { | |||||
width: 70%; | |||||
height: 60rpx; | |||||
border: #52a0fd 1rpx solid; | |||||
border-radius: 5rpx; | |||||
padding: 20rpx; | |||||
} | |||||
.input button { | |||||
width: 25%; | |||||
height: 100rpx; | |||||
} | |||||
.nav .item image { | |||||
position: relative; | |||||
bottom: 5rpx; | |||||
width: 30rpx; | |||||
margin-left: 20rpx; | |||||
} | |||||
.nav .currentItem { | |||||
color: #52a0fd; | |||||
} | |||||
.nav .currentItem image { | |||||
position: relative; | |||||
bottom: 5rpx; | |||||
width: 30rpx; | |||||
margin-left: 20rpx; | |||||
transform: rotate(180deg); | |||||
transition: all 0.3s; | |||||
} | |||||
.type { | |||||
text-align: center; | |||||
padding: 40rpx; | |||||
transform: translateY(-150%); | |||||
opacity: 0; | |||||
transition: all 0.3s; | |||||
background-color: #ffffff86; | |||||
z-index: 99; | |||||
} | |||||
.type.active { | |||||
transform: translateY(0); | |||||
opacity: 1; | |||||
} | |||||
.type .item { | |||||
color: #ffffff; | |||||
background-color: #52a0fd; | |||||
border-radius: 5rpx; | |||||
padding: 10rpx 0; | |||||
margin-bottom: 40rpx; | |||||
} | |||||
.type .item.center { | |||||
margin: 30rpx 0; | |||||
} | |||||
.pickedTime { | |||||
position: relative; | |||||
bottom: 590rpx; | |||||
text-align: center; | |||||
} | |||||
.pickedTime .picker { | |||||
display: inline-block; | |||||
background-color: #529ffd86; | |||||
font-size: 30rpx; | |||||
padding: 10rpx; | |||||
border-radius: 10rpx; | |||||
color: #ffffff; | |||||
} | |||||
.pickedTime .search { | |||||
display: inline-block; | |||||
width: 120rpx; | |||||
height: 60rpx; | |||||
line-height: 50rpx; | |||||
padding: 5rpx; | |||||
margin-left: 40rpx; | |||||
} | |||||
.list { | |||||
position: relative; | |||||
bottom: 590rpx; | |||||
margin-top: 20rpx; | |||||
z-index: -1; | |||||
} | |||||
.list.active { | |||||
z-index: 1; | |||||
} | |||||
.list .item { | |||||
width: 95%; | |||||
border: 1px solid #ffffff93; | |||||
margin: auto; | |||||
overflow: hidden; | |||||
background-color: #0000000a; | |||||
border-radius: 20rpx; | |||||
margin-bottom: 30rpx; | |||||
} | |||||
.list .itemXX { | |||||
text-align: center; | |||||
} | |||||
.list .item .head { | |||||
position: relative; | |||||
padding: 20rpx; | |||||
font-size: 30rpx; | |||||
border-bottom: 1px solid #ffffffbb; | |||||
} | |||||
.notice { | |||||
position: absolute; | |||||
width: 250rpx; | |||||
text-align: center; | |||||
top: 28rpx; | |||||
right: -80rpx; | |||||
transform: rotate(45deg); | |||||
font-size: 35rpx; | |||||
} | |||||
.notice.noAppoint { | |||||
color: red; | |||||
background-color: #ffcc66; | |||||
} | |||||
.notice.confirm { | |||||
color: #ffffff; | |||||
background-color: #ffcc66; | |||||
} | |||||
.notice.refund { | |||||
color: #ffffff; | |||||
background-color: #ff0000; | |||||
} | |||||
.notice.complete { | |||||
color: #ffffff; | |||||
background-color: #19be27; | |||||
} | |||||
.list .item .body { | |||||
padding: 20rpx 20rpx; | |||||
border-bottom: 1px solid #ffffffbb; | |||||
} | |||||
.list .item .body .items { | |||||
margin-bottom: 10rpx; | |||||
} | |||||
.list .item .footer { | |||||
display: flex; | |||||
margin: 25rpx 0; | |||||
padding: 0 170rpx; | |||||
} | |||||
.list .item .footer button { | |||||
background-color: #52a0fd; | |||||
} |
@@ -0,0 +1,261 @@ | |||||
// c:\Users\Holy-Knight-IX\Desktop\Working Space\4.TikTok-MiniPro\ttb\pages\appointDetail\appointDetail.js | |||||
const config = require('../../config/config.js') | |||||
const Http = require('../../utils/http.js') | |||||
const HttpBasics = require('../../utils/HttpBasics.js') | |||||
const util = require('../../utils/util') | |||||
var app = getApp() | |||||
Page({ | |||||
data: { | |||||
id: "", | |||||
detail: null, | |||||
isShowBtns: true, | |||||
isSetTime: false, | |||||
isSetAddress: false, | |||||
pickedDate: "请选择日期", | |||||
pickedStartTime: "请选择", | |||||
pickedEndTime: "请选择", | |||||
startTime: "", | |||||
endTime: "" | |||||
}, | |||||
onLoad(options) { | |||||
console.log(options, 'options'); | |||||
if (options.id) { | |||||
this.setData({ | |||||
id: options.id | |||||
}) | |||||
this.getDetail(options.id) | |||||
} | |||||
}, | |||||
getDetail(id) { | |||||
const that = this | |||||
const data = { | |||||
id | |||||
} | |||||
HttpBasics.get({ | |||||
url: config.api.appointDetail, | |||||
data | |||||
}) | |||||
.then(res => { | |||||
console.log(res, 'res'); | |||||
console.log(typeof (data.id)); | |||||
const appointStart = util.timestampToTime(res.data.startDate, 'YYYY-MM-DD hh:mm:ss') | |||||
const appointEnd = util.timestampToTime(res.data.endDate, 'hh:mm:ss') | |||||
if (res.data.startDate && res.data.endDate) { | |||||
res.data.appointTime = appointStart + ' - ' + appointEnd | |||||
} else { | |||||
res.data.appointTime = "暂无"; | |||||
} | |||||
that.setData({ | |||||
detail: res.data, | |||||
pickedDate: util.timestampToTime(res.data.startDate, 'YYYY-MM-DD') || '请选择日期', | |||||
pickedStartTime: util.timestampToTime(res.data.startDate, 'hh:mm') || '请选择', | |||||
pickedEndTime: util.timestampToTime(res.data.endDate, 'hh:mm') || '请选择', | |||||
}) | |||||
}).catch(err => { | |||||
console.log(err, 'err'); | |||||
}) | |||||
}, | |||||
back() { | |||||
tt.navigateBack(); | |||||
}, | |||||
chooseDate(e) { | |||||
console.log(e.detail.value, 'e'); | |||||
this.setData({ | |||||
pickedDate: e.detail.value | |||||
}) | |||||
}, | |||||
chooseStartTime(e) { | |||||
console.log(e.detail.value, 'e'); | |||||
this.setData({ | |||||
pickedStartTime: e.detail.value | |||||
}) | |||||
}, | |||||
chooseEndTime(e) { | |||||
console.log(e.detail.value, 'e'); | |||||
this.setData({ | |||||
pickedEndTime: e.detail.value | |||||
}) | |||||
}, | |||||
cancel() { | |||||
const that = this | |||||
tt.showModal({ | |||||
title: "提示", | |||||
content: "是否与用户取得联系并取消确认?", | |||||
showCancel: true, | |||||
confirmText: "确认取消", | |||||
confirmColor: "#52a0fd", | |||||
cancelText: "返回", | |||||
success(res) { | |||||
if (res.confirm) { | |||||
that.goChange(that.data.id, 0) | |||||
} | |||||
if (res.cancel) { | |||||
return | |||||
} | |||||
} | |||||
}); | |||||
}, | |||||
confirm() { | |||||
const that = this | |||||
tt.showModal({ | |||||
title: "提示", | |||||
content: "是否与用户取得联系并完成预约?", | |||||
showCancel: true, | |||||
confirmText: "确认完成", | |||||
confirmColor: "#52a0fd", | |||||
cancelText: "关闭", | |||||
success(res) { | |||||
if (res.confirm) { | |||||
that.goChange(that.data.id, 5) | |||||
} | |||||
if (res.cancel) { | |||||
return | |||||
} | |||||
} | |||||
}); | |||||
}, | |||||
setDate() { | |||||
const isSetTime = !this.data.isSetTime | |||||
this.setData({ | |||||
isSetTime, | |||||
isSetAddress: false | |||||
}) | |||||
}, | |||||
confirmDate() { | |||||
const isSetTime = !this.data.isSetTime | |||||
this.setData({ | |||||
isSetTime, | |||||
isSetAddress: false | |||||
}) | |||||
if (!isSetTime) { | |||||
const tempData = this.data | |||||
if (tempData.pickedDate == '请选择日期') { | |||||
tt.showToast({ | |||||
title: '请请选择日期!', | |||||
icon: 'fail' | |||||
}); | |||||
return | |||||
} | |||||
if (tempData.pickedStartTime == '请选择') { | |||||
tt.showToast({ | |||||
title: '请起始时间!', | |||||
icon: 'fail' | |||||
}); | |||||
return | |||||
} | |||||
if (tempData.pickedEndTime == '请选择') { | |||||
tt.showToast({ | |||||
title: '请结束时间!', | |||||
icon: 'fail' | |||||
}); | |||||
return | |||||
} | |||||
const data = { | |||||
id: this.data.detail.id, | |||||
couponOrderId: this.data.detail.couponOrderId, | |||||
startDate: tempData.pickedDate + " " + tempData.pickedStartTime + ":00", | |||||
endDate: tempData.pickedDate + " " + tempData.pickedEndTime + ":00" | |||||
} | |||||
this.goSetDate(data) | |||||
console.log(data, 'data'); | |||||
} | |||||
}, | |||||
setAddress() { | |||||
const isSetAddress = !this.data.isSetAddress | |||||
this.setData({ | |||||
isSetAddress, | |||||
isSetTime: false | |||||
}) | |||||
}, | |||||
settingAddress(e) { | |||||
const detail = this.data.detail | |||||
detail.detailedAddress = e.detail.value | |||||
this.setData({ | |||||
detail | |||||
}) | |||||
}, | |||||
confirmAddress() { | |||||
const isSetAddress = !this.data.isSetAddress | |||||
this.setData({ | |||||
isSetAddress, | |||||
isSetTime: false | |||||
}) | |||||
const data = { | |||||
id: this.data.detail.id, | |||||
couponOrderId: this.data.detail.couponOrderId, | |||||
detailedAddress: this.data.detail.detailedAddress, | |||||
} | |||||
this.goSetDate(data) | |||||
}, | |||||
goChange(id, status) { | |||||
const data = { | |||||
id, | |||||
status | |||||
} | |||||
HttpBasics.post({ | |||||
url: config.api.appointConfirm, | |||||
data | |||||
}) | |||||
.then(res => { | |||||
console.log(res, 'res'); | |||||
tt.showToast({ | |||||
title: status == 5 ? '确认成功!' : '取消成功!', | |||||
icon: "success", | |||||
duration: 2000 | |||||
}); | |||||
setTimeout(() => { | |||||
tt.navigateBack(); | |||||
}, 2000); | |||||
}).catch(err => { | |||||
console.log(err, 'err'); | |||||
tt.showToast({ | |||||
title: err.message, | |||||
icon: "none" | |||||
}); | |||||
}) | |||||
}, | |||||
goSetDate(data) { | |||||
const that = this | |||||
HttpBasics.post({ | |||||
url: config.api.appointSetDate, | |||||
data | |||||
}) | |||||
.then(res => { | |||||
console.log(res, 'res'); | |||||
tt.showToast({ | |||||
title: '修改成功!', | |||||
icon: "success", | |||||
duration: 2000 | |||||
}); | |||||
that.getDetail(that.data.id) | |||||
}).catch(err => { | |||||
console.log(err, 'err'); | |||||
tt.showToast({ | |||||
title: err.message, | |||||
icon: "none" | |||||
}); | |||||
}) | |||||
} | |||||
}) |
@@ -0,0 +1,8 @@ | |||||
{ | |||||
"navigationBarTitleText": "预约详情", | |||||
"enablePullDownRefresh": true, | |||||
"backgroundTextStyle": "dark", | |||||
"navigationBarTextStyle": "white", | |||||
"navigationBarBackgroundColor": "#52A0FD", | |||||
"usingComponents": {} | |||||
} |
@@ -0,0 +1,55 @@ | |||||
<!-- c:\Users\Holy-Knight-IX\Desktop\Working Space\4.TikTok-MiniPro\ttb\pages\appointDetail\appointDetail.ttml --> | |||||
<view> | |||||
<view class="card"> | |||||
<view class="item">券码:{{ detail.couponOrderId }}</view> | |||||
<view class="item">商品名称:{{ detail.couponTitle }}</view> | |||||
<view class="item">店铺名称:{{ detail.reservationMerchantName }}</view> | |||||
<view class="item">服务预约时间:{{ detail.appointTime }}<span | |||||
tt:if="{{ detail.status == 0 || detail.status == 5 || detail.status == '-1' }}" class="edit" | |||||
bindtap="setDate">修改</span></view> | |||||
<view class="item">服务预约地址:<text class="lineHeight">{{ detail.userAddress }}</text></view> | |||||
<view class="item">服务详细地址:<text class="lineHeight">{{ detail.detailedAddress }}</text><span | |||||
tt:if="{{ detail.status == 0 || detail.status == 5 || detail.status == '-1' }}" class="edit" | |||||
bindtap="setAddress">修改</span></view> | |||||
<view class="item">用户手机号码:{{ detail.userPhone }}</view> | |||||
<view class="item">备注:{{ detail.describeStr }}</view> | |||||
</view> | |||||
<view tt:if="{{ isSetTime }}"> | |||||
<view class="datePickerFlex"> | |||||
<picker mode="date" start="{{ startTime }}" end="{{ endTime }}" disabled="{{ !isShowBtns }}" | |||||
bindchange='chooseDate'>选择服务日期:</picker> | |||||
<picker mode="date" start="{{ startTime }}" end="{{ endTime }}" disabled="{{ !isShowBtns }}" | |||||
bindchange='chooseDate' class="address"> | |||||
{{ pickedDate }}</picker> | |||||
</view> | |||||
<view class="datePickerFlex"> | |||||
<picker mode="time" disabled="{{ !isShowBtns }}" bindchange='chooseTime'>预计上门时间:</picker> | |||||
<picker mode="time" disabled="{{ !isShowBtns }}" bindchange='chooseStartTime' class="address">{{ | |||||
pickedStartTime | |||||
}}</picker> | |||||
- | |||||
<picker mode="time" start="{{ pickedStartTime }}" disabled="{{ !isShowBtns }}" bindchange='chooseEndTime' | |||||
class="address">{{ pickedEndTime }} | |||||
</picker> | |||||
</view> | |||||
</view> | |||||
<view tt:if="{{ isSetAddress }}"> | |||||
<textarea class="detailedAddress" placeholder="请输入服务详细地址" bindinput="settingAddress" | |||||
value="{{ detail.detailedAddress }}"></textarea> | |||||
</view> | |||||
<view class="{{ (isSetTime || isSetAddress) ? 'btns' : 'btns active' }}"> | |||||
<block tt:if="{{ detail.status != 8 }}"> | |||||
<button tt:if="{{ isSetTime }}" class="confirm" bindtap="confirmDate">确定预约时间</button> | |||||
<button tt:if="{{ isSetAddress }}" class="confirm" bindtap="confirmAddress">确定详细地址</button> | |||||
<button tt:if="{{ detail.status == 0 }}" class="confirm" bindtap="confirm">确认预约</button> | |||||
<button tt:if="{{ detail.status == 5 }}" class="confirm" bindtap="cancel">取消确认</button> | |||||
</block> | |||||
</view> | |||||
</view> |
@@ -0,0 +1,78 @@ | |||||
/* c:\Users\Holy-Knight-IX\Desktop\Working Space\4.TikTok-MiniPro\ttb\pages\appointDetail\appointDetail.ttss */ | |||||
.card { | |||||
width: 95%; | |||||
border: 1px solid #00000063; | |||||
margin: 40rpx auto; | |||||
padding: 20rpx; | |||||
border-radius: 15rpx; | |||||
box-sizing: border-box; | |||||
} | |||||
.card .item { | |||||
margin-bottom: 20rpx; | |||||
} | |||||
.card .item .lineHeight { | |||||
color: #52a0fd; | |||||
} | |||||
.btns { | |||||
width: 95%; | |||||
padding: 0 80rpx; | |||||
box-sizing: border-box; | |||||
margin: auto; | |||||
} | |||||
.btns.active { | |||||
position: absolute; | |||||
left: 50%; | |||||
bottom: 110rpx; | |||||
transform: translateX(-50%); | |||||
} | |||||
.btns .back { | |||||
margin-bottom: 40rpx; | |||||
} | |||||
.btns .confirm { | |||||
color: #ffffff; | |||||
background-color: #52a0fd; | |||||
margin-top: 40rpx; | |||||
} | |||||
.datePickerFlex { | |||||
display: flex; | |||||
justify-content: space-between; | |||||
width: 85%; | |||||
background-color: #f4f5f6; | |||||
border-radius: 20rpx; | |||||
padding: 30rpx; | |||||
margin: 35rpx auto; | |||||
} | |||||
.address { | |||||
color: #8a8a8a; | |||||
} | |||||
.edit { | |||||
display: inline-block; | |||||
width: 70rpx; | |||||
height: 40rpx; | |||||
line-height: 40rpx; | |||||
font-size: 30rpx; | |||||
color: #ffffff; | |||||
text-align: center; | |||||
background-color: #c85963; | |||||
border-radius: 10rpx; | |||||
padding: 2rpx 5rpx; | |||||
margin-left: 20rpx; | |||||
} | |||||
.detailedAddress { | |||||
width: 95%; | |||||
padding: 20rpx; | |||||
border-radius: 15rpx; | |||||
box-sizing: border-box; | |||||
border: 1px solid #00000063; | |||||
margin: 0 auto; | |||||
} |
@@ -1,18 +1,20 @@ | |||||
<view class='forgetpwd'> | <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> | |||||
<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> | ||||
<button form-type='submit' hover-class='active' bindtap='next'>下一步</button> | |||||
</form> | |||||
</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> |
@@ -9,18 +9,20 @@ Page({ | |||||
logo: '../../assets/images/logo.png', | logo: '../../assets/images/logo.png', | ||||
phone: '', | phone: '', | ||||
pwd: '', | pwd: '', | ||||
status:'', | |||||
status: '', | |||||
showpass: "hidepass", | showpass: "hidepass", | ||||
focus:false, | |||||
password: true | |||||
focus: false, | |||||
password: true, | |||||
ifShowShop: false, | |||||
merchantList: [] | |||||
}, | }, | ||||
onLoad() { | onLoad() { | ||||
Common.getMallIcon() | |||||
Common.getMallIcon() | |||||
.then(data => { | .then(data => { | ||||
// debugge | // debugge | ||||
console.log(data,777) | |||||
console.log(data, 777) | |||||
this.setData({ | this.setData({ | ||||
logo: data.data&&data.data.mallImgUrl ? data.data.mallImgUrl : '../../assets/images/logo.png', | |||||
logo: data.data && data.data.mallImgUrl ? data.data.mallImgUrl : '../../assets/images/logo.png', | |||||
}) | }) | ||||
}) | }) | ||||
}, | }, | ||||
@@ -39,34 +41,43 @@ Page({ | |||||
pwd: pwd | pwd: pwd | ||||
}); | }); | ||||
} | } | ||||
// 进入页面后清空bUserId | |||||
HttpBasics.setBUserId(''); | |||||
tt.setStorageSync("bUserId", ''); | |||||
app.globalData.bUserId = ''; | |||||
tt.setStorage({ | |||||
key: 'bUserId', | |||||
data: '', | |||||
}) | |||||
}, | }, | ||||
//显示具体的密码 | //显示具体的密码 | ||||
showpassword:function(){ | |||||
showpassword: function () { | |||||
console.log(this.data.password); | console.log(this.data.password); | ||||
let that = this; | let that = this; | ||||
if (that.data.password){ | |||||
if (that.data.password) { | |||||
that.setData({ | that.setData({ | ||||
password: false, | password: false, | ||||
focus:true | |||||
focus: true | |||||
}) | }) | ||||
}else{ | |||||
} else { | |||||
that.setData({ | that.setData({ | ||||
password: true, | password: true, | ||||
focus: true | focus: true | ||||
}) | }) | ||||
} | } | ||||
}, | }, | ||||
ttLogin(flag){ | |||||
ttLogin(flag) { | |||||
let that = this; | let that = this; | ||||
tt.login({ | tt.login({ | ||||
success: res => { | success: res => { | ||||
Common.getSuperOpenId(res.code) | Common.getSuperOpenId(res.code) | ||||
.then(res => { | .then(res => { | ||||
console.log(res) | console.log(res) | ||||
if (res.data&& res.data.data&&res.data.data.openId){ | |||||
if (res.data && res.data.data && res.data.data.openId) { | |||||
app.globalData.superopenId = res.data.data.openId; | app.globalData.superopenId = res.data.data.openId; | ||||
} | } | ||||
if (res.data && res.data.data && res.data.data.session_key){ | |||||
if (res.data && res.data.data && res.data.data.session_key) { | |||||
app.globalData.session_key = res.data.data.session_key; | app.globalData.session_key = res.data.data.session_key; | ||||
} | } | ||||
if (res.data.code == 200) { | if (res.data.code == 200) { | ||||
@@ -75,14 +86,14 @@ Page({ | |||||
ifAlBoss: true, | ifAlBoss: true, | ||||
status: "use" | status: "use" | ||||
}) | }) | ||||
if (flag =='fromgetPhoneNumber'){ | |||||
if (flag == 'fromgetPhoneNumber') { | |||||
tt.navigateTo({ | tt.navigateTo({ | ||||
url: `/pages/datatower/datatower?superopenId=${app.globalData.superopenId}&phone=${app.globalData.phone}`, | url: `/pages/datatower/datatower?superopenId=${app.globalData.superopenId}&phone=${app.globalData.phone}`, | ||||
}) | }) | ||||
} | } | ||||
} else { | } else { | ||||
if (flag =='fromgetPhoneNumber'){ | |||||
if (flag == 'fromgetPhoneNumber') { | |||||
tt.showToast({ | tt.showToast({ | ||||
title: res.data.message, | title: res.data.message, | ||||
icon: "none", | icon: "none", | ||||
@@ -91,7 +102,7 @@ Page({ | |||||
} | } | ||||
} | } | ||||
}).catch(error => { | }).catch(error => { | ||||
console.log(error,"error"); | |||||
console.log(error, "error"); | |||||
that.setData({ | that.setData({ | ||||
error: error.message | error: error.message | ||||
}) | }) | ||||
@@ -99,14 +110,25 @@ Page({ | |||||
} | } | ||||
}) | }) | ||||
}, | }, | ||||
showpass: function () { | showpass: function () { | ||||
let that = this; | let that = this; | ||||
}, | }, | ||||
forgetPwd: function () { | |||||
forgetPwd() { | |||||
console.log('forgetPwd!!!!!!!'); | |||||
tt.navigateTo({ | tt.navigateTo({ | ||||
url: '/pages/index/forgetpwd/forgetpwd', | |||||
}) | |||||
url: "/pages/forgetpwd/forgetpwd", | |||||
success: (res) => { | |||||
console.log(res, 'res'); | |||||
}, | |||||
fail: (res) => { | |||||
console.log(res, 'res'); | |||||
}, | |||||
}); | |||||
}, | }, | ||||
getLoginInfo(e) { | getLoginInfo(e) { | ||||
var phoneReg = /^1[0|1|2|3|4|5|6|7|8|9]\d{9}$/; | var phoneReg = /^1[0|1|2|3|4|5|6|7|8|9]\d{9}$/; | ||||
let { | let { | ||||
@@ -117,46 +139,64 @@ Page({ | |||||
if (pwd != '') { | if (pwd != '') { | ||||
Common.userLogin(phone, pwd, app.globalData.latitude, app.globalData.longitude) | Common.userLogin(phone, pwd, app.globalData.latitude, app.globalData.longitude) | ||||
.then(res => { | .then(res => { | ||||
console.log(res); | |||||
if (res.code == 200) { | |||||
HttpBasics.setBUserId(res.data.bUserId); | |||||
// 当logined为true时,正常进入商户 | |||||
if (res.data && res.data.logined == true) { | |||||
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" | |||||
}) | |||||
} | |||||
// 当logined为false时,选择商户 | |||||
} else if (res.data && res.data.logined == false) { | |||||
tt.setStorageSync("phone", phone); | tt.setStorageSync("phone", phone); | ||||
tt.setStorageSync("pwd", pwd); | 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调用失败`); | |||||
}, | |||||
}) | |||||
}) | |||||
} | |||||
this.setData({ | |||||
ifShowShop: true, | |||||
merchantList: res.data.merchantList | |||||
}) | }) | ||||
} else { | } else { | ||||
console.log(res, 'res'); | |||||
tt.showToast({ | tt.showToast({ | ||||
image:'./../../assets/images/fail.png', | |||||
image: './../../assets/images/fail.png', | |||||
title: res.message, | title: res.message, | ||||
icon: "none" | icon: "none" | ||||
}) | }) | ||||
@@ -169,13 +209,13 @@ Page({ | |||||
icon: "none", | icon: "none", | ||||
}) | }) | ||||
} | } | ||||
} else if(phone=="") { | |||||
} else if (phone == "") { | |||||
tt.showToast({ | tt.showToast({ | ||||
image: './../../assets/images/fail.png', | image: './../../assets/images/fail.png', | ||||
title: '请输入手机号', | title: '请输入手机号', | ||||
icon: "none" | icon: "none" | ||||
}) | }) | ||||
}else{ | |||||
} else { | |||||
tt.showToast({ | tt.showToast({ | ||||
image: './../../assets/images/fail.png', | image: './../../assets/images/fail.png', | ||||
title: '手机号有误', | title: '手机号有误', | ||||
@@ -186,10 +226,16 @@ Page({ | |||||
/** | /** | ||||
* 获得超级管理员手机号 | * 获得超级管理员手机号 | ||||
*/ | */ | ||||
getPhoneNumber: function (e) { | |||||
getPhoneNumber: function (e) { | |||||
this.ttLogin("fromgetPhoneNumber"); | this.ttLogin("fromgetPhoneNumber"); | ||||
if (app.globalData.superopenId && app.globalData.session_key){ | |||||
let { encryptedData, iv } = { encryptedData: e.detail.encryptedData, iv: e.detail.iv }; | |||||
if (app.globalData.superopenId && app.globalData.session_key) { | |||||
let { | |||||
encryptedData, | |||||
iv | |||||
} = { | |||||
encryptedData: e.detail.encryptedData, | |||||
iv: e.detail.iv | |||||
}; | |||||
if (encryptedData && iv) { | if (encryptedData && iv) { | ||||
Common.getUserPhone(encryptedData, iv, app.globalData.superopenId, app.globalData.session_key) | Common.getUserPhone(encryptedData, iv, app.globalData.superopenId, app.globalData.session_key) | ||||
.then(res => { | .then(res => { | ||||
@@ -200,12 +246,48 @@ Page({ | |||||
}) | }) | ||||
} | } | ||||
}) | }) | ||||
} | |||||
} | } | ||||
} | |||||
}, | |||||
goShop(e) { | |||||
const id = e.currentTarget.dataset.id | |||||
HttpBasics.setBUserId(id); | |||||
tt.setStorageSync("bUserId", id); | |||||
app.globalData.bUserId = id; | |||||
tt.setStorage({ | |||||
key: 'bUserId', | |||||
data: id, | |||||
}) | |||||
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调用失败`); | |||||
}, | |||||
}) | |||||
}) | |||||
} | |||||
}) | |||||
}, | }, | ||||
/** | /** | ||||
* 用户点击右上角分享 | |||||
*/ | |||||
* 用户点击右上角分享 | |||||
*/ | |||||
onShareAppMessage: function (res) { | onShareAppMessage: function (res) { | ||||
let _this = this; | let _this = this; | ||||
return { | return { | ||||
@@ -2,29 +2,53 @@ | |||||
<view class='logo'> | <view class='logo'> | ||||
<image src='{{logo}}' mode="widthFix"></image> | <image src='{{logo}}' mode="widthFix"></image> | ||||
</view> | </view> | ||||
<form bindsubmit='getLoginInfo'> | |||||
<form bindsubmit='getLoginInfo' tt:if="{{!ifShowShop}}"> | |||||
<view class='login'> | <view class='login'> | ||||
<view> | <view> | ||||
<input type='number' name='phone' value='{{phone}}' placeholder='请输入手机号' placeholder-style='color:#BFBFBF;' maxlength='11' class='inp' /> | |||||
</view> | |||||
<input type='number' name='phone' value='{{phone}}' placeholder='请输入手机号' placeholder-style='color:#BFBFBF;' | |||||
maxlength='11' class='inp' /> | |||||
</view> | |||||
<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> | |||||
<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> | ||||
</view> | </view> | ||||
<navigator url='../index/index' open-type='navigate' hover-class='none'> | <navigator url='../index/index' open-type='navigate' hover-class='none'> | ||||
</navigator> | </navigator> | ||||
<button form-type='submit' class='button' hover-class='active'>登录管理门店</button> | <button form-type='submit' class='button' hover-class='active'>登录管理门店</button> | ||||
<!-- <view class='forget clearfix'> | |||||
<text class='fr' bindtap='forgetPwd'>忘记密码</text> | |||||
</view> --> | |||||
<view class='forget clearfix' bindtap='forgetPwd'> | |||||
<text class='fr'>忘记密码</text> | |||||
</view> | |||||
<!-- <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}}" 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> | <button class="phone" tt:if="{{ifAlBoss}}" bindtap="getPhoneNumber"><image class='adminlogo' src='../../assets/images/admin.png' mode='widthFix'></image>数据塔台</button> | ||||
</view> --> | </view> --> | ||||
</form> | </form> | ||||
<view class='defaultLogo'> | |||||
<view class="page" tt:if="{{ifShowShop}}"> | |||||
<view class="title">请选择要管理的门店</view> | |||||
<view class="shopBox" tt:for="{{merchantList}}" tt:key="{{item.tenantId}}" bindtap="goShop" | |||||
data-id="{{item.buUserId}}"> | |||||
<view class="imgBox"> | |||||
<image class="imgInside" src="{{item.imgUrl}}"></image> | |||||
</view> | |||||
<view class="infoBox"> | |||||
<view class="shop">{{item.merchantName}}</view> | |||||
<view class="mainShop">{{item.tenantName}}</view> | |||||
<view class="address">{{}}</view> | |||||
</view> | |||||
</view> | |||||
</view> | |||||
<view class='defaultLogo' tt:if="{{merchantList.legth>2}}"> | |||||
<text>POWERED BY IFORMALL</text> | |||||
</view> | |||||
<view class='defaultLogo2' tt:else> | |||||
<text>POWERED BY IFORMALL</text> | <text>POWERED BY IFORMALL</text> | ||||
</view> | </view> | ||||
</view> | </view> |
@@ -1,142 +1,238 @@ | |||||
.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; | |||||
} | |||||
.adminlogo { | |||||
width: 100rpx; | |||||
display: block; | |||||
margin: 0 auto; | |||||
} | |||||
.logoin_wrap { | |||||
position: relative; | |||||
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; | |||||
} | |||||
.defaultLogo2 { | |||||
position: fixed; | |||||
bottom: 40rpx; | |||||
left: 0; | |||||
right: 0; | |||||
margin: auto; | |||||
} | |||||
.defaultLogo2 text { | |||||
display: block; | |||||
text-align: center; | |||||
color: #52A0FD; | |||||
font-size: 22rpx; | |||||
} | |||||
.defaultLogo2 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; | |||||
} | |||||
.page { | |||||
padding-left: 40rpx; | |||||
padding-right: 40rpx; | |||||
padding-bottom: 100rpx; | |||||
} | |||||
.page .logo { | |||||
width: 320rpx; | |||||
margin: 100rpx auto 15rpx; | |||||
} | |||||
.page .logo image { | |||||
display: block; | |||||
width: 320rpx; | |||||
} | |||||
.page .title { | |||||
text-align: center; | |||||
font-size: 35rpx; | |||||
font-weight: 500; | |||||
margin-bottom: 40rpx; | |||||
} | |||||
.page .shopBox { | |||||
display: flex; | |||||
padding: 20rpx; | |||||
border: 1px solid #5e5e5e; | |||||
border-radius: 15rpx; | |||||
margin-bottom: 20rpx; | |||||
} | |||||
.page .shopBox .imgBox { | |||||
width: 230rpx; | |||||
height: 230rpx; | |||||
margin-right: 30rpx; | |||||
} | |||||
.page .shopBox .imgBox .imgInside { | |||||
width: 100%; | |||||
height: 100%; | |||||
} | |||||
.page .shopBox .infoBox { | |||||
padding-top: 5rpx; | |||||
} | |||||
.page .shopBox .infoBox .shop { | |||||
font-size: 32rpx; | |||||
font-weight: 600; | |||||
margin-bottom: 70rpx; | |||||
} | |||||
.page .shopBox .infoBox .mainShop { | |||||
font-size: 28rpx; | |||||
font-weight: 600; | |||||
margin-bottom: 32rpx; | |||||
} | |||||
.page .shopBox .infoBox .address { | |||||
font-size: 23rpx; | |||||
} |
@@ -0,0 +1,9 @@ | |||||
// c:\Users\Holy-Knight-IX\Desktop\Working Space\4.TikTok-MiniPro\ttb\pages\index\pages\forgetpwd\forgetpwd.js | |||||
Page({ | |||||
data: { | |||||
}, | |||||
onLoad: function (options) { | |||||
} | |||||
}) |
@@ -0,0 +1,3 @@ | |||||
{ | |||||
"usingComponents": {} | |||||
} |
@@ -0,0 +1,2 @@ | |||||
<!-- c:\Users\Holy-Knight-IX\Desktop\Working Space\4.TikTok-MiniPro\ttb\pages\index\pages\forgetpwd\forgetpwd.ttml --> | |||||
<text>c:\Users\Holy-Knight-IX\Desktop\Working Space\4.TikTok-MiniPro\ttb\pages\index\pages\forgetpwd\forgetpwd.ttml</text> |
@@ -0,0 +1 @@ | |||||
/* c:\Users\Holy-Knight-IX\Desktop\Working Space\4.TikTok-MiniPro\ttb\pages\index\pages\forgetpwd\forgetpwd.ttss */ |
@@ -3,6 +3,7 @@ const Http = require('../../utils/http.js') | |||||
const HttpBasics = require('../../utils/HttpBasics.js') | const HttpBasics = require('../../utils/HttpBasics.js') | ||||
const util = require('../../utils/util') | const util = require('../../utils/util') | ||||
const changeNum = require('../../utils/changeNum.js') | const changeNum = require('../../utils/changeNum.js') | ||||
import * as echarts from '../../ec-canvas/echarts'; | import * as echarts from '../../ec-canvas/echarts'; | ||||
var app = getApp() | var app = getApp() | ||||
@@ -53,7 +54,7 @@ function setOption(chart, xdata, ydata) { | |||||
}, | }, | ||||
axisLabel: { | axisLabel: { | ||||
rotate: 40, | rotate: 40, | ||||
formatter: function(a, b) { | |||||
formatter: function (a, b) { | |||||
return a | return a | ||||
} | } | ||||
}, | }, | ||||
@@ -232,7 +233,7 @@ function getTabletListVerify() { | |||||
}; | }; | ||||
Page({ | Page({ | ||||
data: { | data: { | ||||
token:'', | |||||
token: '', | |||||
currentIndex: 0, | currentIndex: 0, | ||||
userInfo: {}, | userInfo: {}, | ||||
recordMoney: 0, | recordMoney: 0, | ||||
@@ -241,6 +242,11 @@ Page({ | |||||
ec: { | ec: { | ||||
lazyLoad: true | lazyLoad: true | ||||
}, | }, | ||||
classIfyList2: [{ | |||||
text: '服务预约', | |||||
icon: 'iconfont icon-lingquanzhongxin', | |||||
id: 9 | |||||
}], | |||||
classIfyList: [ | classIfyList: [ | ||||
// { | // { | ||||
// text: '收银台', | // text: '收银台', | ||||
@@ -287,10 +293,15 @@ Page({ | |||||
// icon: 'iconfont icon-wuliu', | // icon: 'iconfont icon-wuliu', | ||||
// id: 8 | // id: 8 | ||||
// } | // } | ||||
{ | |||||
text: '服务预约', | |||||
icon: 'iconfont icon-lingquanzhongxin', | |||||
id: 9 | |||||
}, | |||||
], | ], | ||||
amountMoney: '', | amountMoney: '', | ||||
djZmoney:'', | |||||
djZmoney: '', | |||||
writeOffMoney: '', | writeOffMoney: '', | ||||
getFullYear: new Date().getFullYear(), | getFullYear: new Date().getFullYear(), | ||||
getMonth: new Date().getMonth() + 1, | getMonth: new Date().getMonth() + 1, | ||||
@@ -307,14 +318,15 @@ Page({ | |||||
ecScatter: { | ecScatter: { | ||||
lazyLoad: true | lazyLoad: true | ||||
}, | }, | ||||
djArr:[], | |||||
djMoney:[], | |||||
count:'' | |||||
djArr: [], | |||||
djMoney: [], | |||||
count: '' | |||||
}, | }, | ||||
//获取商户信息 | //获取商户信息 | ||||
getUserInfo() { | getUserInfo() { | ||||
return new Promise((resolve, reject) => { | return new Promise((resolve, reject) => { | ||||
Http.getRequest(config.api.userDetail, app.globalData.token, '', {}, (res) => { | Http.getRequest(config.api.userDetail, app.globalData.token, '', {}, (res) => { | ||||
app.globalData.isAdmin = res.data.is_admin; | |||||
resolve(res.data); | resolve(res.data); | ||||
}) | }) | ||||
}) | }) | ||||
@@ -355,7 +367,7 @@ Page({ | |||||
}) | }) | ||||
}) | }) | ||||
}, | }, | ||||
onPullDownRefresh: function() { | |||||
onPullDownRefresh: function () { | |||||
let that = this; | let that = this; | ||||
// that.getUnverifiedAmountOnDate() | // that.getUnverifiedAmountOnDate() | ||||
// that.getVerifiedAmountOnDate(); | // that.getVerifiedAmountOnDate(); | ||||
@@ -386,9 +398,10 @@ Page({ | |||||
this.getUserInfo().then(res => { | this.getUserInfo().then(res => { | ||||
this.setData({ | this.setData({ | ||||
userInfo: res, | userInfo: res, | ||||
userInfoLoadIf:true | |||||
userInfoLoadIf: true | |||||
}) | }) | ||||
app.globalData.merchant = res; | app.globalData.merchant = res; | ||||
tt.setNavigationBarTitle({ | tt.setNavigationBarTitle({ | ||||
title: res.mall_name + "(" + res.merchant_name + ")" | title: res.mall_name + "(" + res.merchant_name + ")" | ||||
}) | }) | ||||
@@ -398,7 +411,7 @@ Page({ | |||||
/** | /** | ||||
* gotolook | * gotolook | ||||
*/ | */ | ||||
gotobill: function(e) { | |||||
gotobill: function (e) { | |||||
console.log(e) | console.log(e) | ||||
let owe = e.currentTarget.dataset.data.owe; | let owe = e.currentTarget.dataset.data.owe; | ||||
let status = e.currentTarget.dataset.data.status; | let status = e.currentTarget.dataset.data.status; | ||||
@@ -505,14 +518,18 @@ Page({ | |||||
tt.navigateTo({ | tt.navigateTo({ | ||||
url: '/pages/marktingsettlement/marktingsettlement', | url: '/pages/marktingsettlement/marktingsettlement', | ||||
}) | }) | ||||
}else if(id==7){//用户发卷 | |||||
} else if (id == 7) { //用户发卷 | |||||
tt.navigateTo({ | tt.navigateTo({ | ||||
url: '/pages/sendDiscounts/sendDiscounts', | url: '/pages/sendDiscounts/sendDiscounts', | ||||
}) | }) | ||||
} else if (id == 8) {//商品配送 | |||||
} else if (id == 8) { //商品配送 | |||||
tt.navigateTo({ | tt.navigateTo({ | ||||
url: '/pages/delivery/delivery', | url: '/pages/delivery/delivery', | ||||
}) | }) | ||||
} else if (id == 9) { //服务预约 | |||||
tt.navigateTo({ | |||||
url: '/pages/Appointment/appointment', | |||||
}) | |||||
} | } | ||||
}, | }, | ||||
toTran(e) { | toTran(e) { | ||||
@@ -545,7 +562,7 @@ Page({ | |||||
currentIndex: 0 | currentIndex: 0 | ||||
}) | }) | ||||
}, | }, | ||||
getpaybill: function() { | |||||
getpaybill: function () { | |||||
let that = this; | let that = this; | ||||
that.getUserInfo().then(res => { | that.getUserInfo().then(res => { | ||||
Http.postRequest(config.api.listBillOweAndWaitPay, app.globalData.token, '', { | Http.postRequest(config.api.listBillOweAndWaitPay, app.globalData.token, '', { | ||||
@@ -553,7 +570,8 @@ Page({ | |||||
tenantId: res.tenant_id, | tenantId: res.tenant_id, | ||||
}, (res) => { | }, (res) => { | ||||
console.log(res); | console.log(res); | ||||
if (res) { | |||||
if (res && res.data) { | |||||
res.data.map(file => { | res.data.map(file => { | ||||
if (file.starttime && file.endtime) { | if (file.starttime && file.endtime) { | ||||
file.end = file.starttime.substring(0, 7).replace(/-/g, ".") + "-" + file.endtime.substring(0, 7).replace(/-/g, "."); | file.end = file.starttime.substring(0, 7).replace(/-/g, ".") + "-" + file.endtime.substring(0, 7).replace(/-/g, "."); | ||||
@@ -565,22 +583,22 @@ Page({ | |||||
}) | }) | ||||
that.setData({ | that.setData({ | ||||
billList: res.data, | billList: res.data, | ||||
djArr : res.data.filter(item => item.status == 2), | |||||
djArr: res.data.filter(item => item.status == 2), | |||||
}) | }) | ||||
that.data.djMoney = that.data.djArr.map(item => parseInt(item.owe / 100)) | that.data.djMoney = that.data.djArr.map(item => parseInt(item.owe / 100)) | ||||
let money = 0 | let money = 0 | ||||
that.data.djMoney.filter(function (item, index) { | that.data.djMoney.filter(function (item, index) { | ||||
money += item; | money += item; | ||||
}) | |||||
}) | |||||
that.setData({ | that.setData({ | ||||
djZmoney: changeNum.changePeoNumber(money) | |||||
djZmoney: changeNum.changePeoNumber(money) | |||||
}) | }) | ||||
} | } | ||||
}) | }) | ||||
}) | }) | ||||
}, | }, | ||||
getTabletListVerify: function() { | |||||
getTabletListVerify: function () { | |||||
let that = this; | let that = this; | ||||
getTabletListVerify() | getTabletListVerify() | ||||
.then(res => { | .then(res => { | ||||
@@ -602,7 +620,7 @@ Page({ | |||||
/** | /** | ||||
* 交易 | * 交易 | ||||
*/ | */ | ||||
getTabletListOrder: function() { | |||||
getTabletListOrder: function () { | |||||
let that = this; | let that = this; | ||||
getTabletListOrder() | getTabletListOrder() | ||||
.then(res => { | .then(res => { | ||||
@@ -684,7 +702,7 @@ Page({ | |||||
url: `/pages/record/list/index`, | url: `/pages/record/list/index`, | ||||
}) | }) | ||||
}, | }, | ||||
// checkuserstatus() { | // checkuserstatus() { | ||||
// let _this = this; | // let _this = this; | ||||
// HttpBasics.get({ | // HttpBasics.get({ | ||||
@@ -701,5 +719,4 @@ Page({ | |||||
// }); | // }); | ||||
// }, | // }, | ||||
}) | |||||
}) |
@@ -1,8 +1,8 @@ | |||||
<view class='firstPage'> | <view class='firstPage'> | ||||
<view class='fix'> | |||||
<image src='../../assets/images/bannerbg.png'></image> | |||||
<view class='writeOff writeOff1'> | |||||
<!-- <view class='topBox clearfix' tt:if="{{djArr.length>0||count > 0}}" > | |||||
<view class='fix'> | |||||
<image src='../../assets/images/bannerbg.png'></image> | |||||
<view class='writeOff writeOff1'> | |||||
<!-- <view class='topBox clearfix' tt:if="{{djArr.length>0||count > 0}}" > | |||||
<view class='left fl' > | <view class='left fl' > | ||||
<text>待缴账单</text> | <text>待缴账单</text> | ||||
<text>{{djArr.length}}</text> | <text>{{djArr.length}}</text> | ||||
@@ -14,79 +14,93 @@ | |||||
<text>¥{{amountMoney/100}}</text> | <text>¥{{amountMoney/100}}</text> | ||||
</view> | </view> | ||||
</view> --> | </view> --> | ||||
<!-- tt:if="{{djArr.length == 0 && count == 0}}" --> | |||||
<view class='topBox2 clearfix' > | |||||
<view class='imgBox'> | |||||
<image src='{{userInfo.merchant_img_url}}' mode='{{widthFix}}' ></image> | |||||
</view> | |||||
<text class='name'>{{userInfo.mall_name}}({{userInfo.merchant_name}})</text> | |||||
<!-- tt:if="{{djArr.length == 0 && count == 0}}" --> | |||||
<view class='topBox2 clearfix'> | |||||
<view class='imgBox'> | |||||
<image src='{{userInfo.merchant_img_url}}' mode='{{widthFix}}'></image> | |||||
</view> | </view> | ||||
<text class='name'>{{userInfo.mall_name}}({{userInfo.merchant_name}})</text> | |||||
</view> | </view> | ||||
</view> | </view> | ||||
<view class='location'> | |||||
<view class='message' tt:if="{{billList.length>0}}"> | |||||
<image src='../../assets/images/mess.png' mode='widthFix'></image> | |||||
<text>{{billList.length}}</text> | |||||
</view> | |||||
<swiper tt:if="{{billList.length>0}}" current='{{currentIndex}}' class="swiper_container" vertical="true" autoplay="true" circular="true" interval="3000"> | |||||
<block tt:for="{{billList}}" tt:key="index"> | |||||
<swiper-item bindtap="gotobill" data-data='{{item}}' data-id='{{item.id}}'> | |||||
<view class="swiper_item clearfix"> | |||||
<text tt:if="{{item.status=='1'}}" class="state1 fl">欠缴</text> | |||||
<text tt:if="{{item.status=='2'}}" class="state2 fl">待缴</text> | |||||
<text class="fl billtype">{{item.name}}{{item.end}}</text> | |||||
<text class="fl">{{item.owe/100}}元</text> | |||||
</view> | |||||
</swiper-item> | |||||
</block> | |||||
</swiper> | |||||
</view> | |||||
<view class='location'> | |||||
<view class='message' tt:if="{{billList.length>0}}"> | |||||
<image src='../../assets/images/mess.png' mode='widthFix'></image> | |||||
<text>{{billList.length}}</text> | |||||
</view> | </view> | ||||
<view class='writeOff'> | |||||
<view class='classification clearfix' tt:if="{{userInfoLoadIf}}"> | |||||
<view tt:for='{{classIfyList}}' tt:if="{{!(item.id==4&&userInfo.creditLocked==1)}}" tt:key='{{index}}'> | |||||
<view hover-class='active' style='background:{{item.bg}}' bindtap='toWriteoff' data-id='{{item.id}}'> | |||||
<icon class='{{item.icon}}'></icon> | |||||
<swiper tt:if="{{billList.length>0}}" current='{{currentIndex}}' class="swiper_container" vertical="true" | |||||
autoplay="true" circular="true" interval="3000"> | |||||
<block tt:for="{{billList}}" tt:key="index"> | |||||
<swiper-item bindtap="gotobill" data-data='{{item}}' data-id='{{item.id}}'> | |||||
<view class="swiper_item clearfix"> | |||||
<text tt:if="{{item.status=='1'}}" class="state1 fl">欠缴</text> | |||||
<text tt:if="{{item.status=='2'}}" class="state2 fl">待缴</text> | |||||
<text class="fl billtype">{{item.name}}{{item.end}}</text> | |||||
<text class="fl">{{item.owe/100}}元</text> | |||||
</view> | </view> | ||||
<text>{{item.text}}</text> | |||||
</swiper-item> | |||||
</block> | |||||
</swiper> | |||||
</view> | |||||
<view class='writeOff'> | |||||
<view class='classification clearfix' tt:if="{{userInfoLoadIf&&userInfo.is_admin!=4}}"> | |||||
<view tt:for='{{classIfyList}}' tt:if="{{!(item.id==4&&userInfo.creditLocked==1)}}"> | |||||
<!-- <view tt:for='{{classIfyList}}' tt:if="{{false}}" tt:key='{{index}}'> --> | |||||
<view hover-class='active' style='background:{{item.bg}}' bindtap='toWriteoff' data-id='{{item.id}}'> | |||||
<icon class='{{item.icon}}'></icon> | |||||
</view> | </view> | ||||
<text>{{item.text}}</text> | |||||
</view> | </view> | ||||
</view> | </view> | ||||
<view class='jiaoyi jiaoyi1 jiaoyi2' hover-class='actives' bindtap='toTran' data-type='0'> | |||||
<view class='toTransaction'> | |||||
<view> | |||||
<text>交易记录</text> | |||||
</view> | |||||
<view>今日交易额:{{amountMoney/100}}元 | |||||
<image class='iconfonts' src='../../assets/images/jian.png' mode="widthFix"></image> | |||||
<view class='classification clearfix' tt:if="{{userInfoLoadIf&&userInfo.is_admin==4}}"> | |||||
<view tt:for='{{classIfyList2}}' tt:if="{{!(item.id==4&&userInfo.creditLocked==1)}}"> | |||||
<!-- <view tt:for='{{classIfyList}}' tt:if="{{false}}" tt:key='{{index}}'> --> | |||||
<view hover-class='active' style='background:{{item.bg}}' bindtap='toWriteoff' data-id='{{item.id}}'> | |||||
<icon class='{{item.icon}}'></icon> | |||||
</view> | </view> | ||||
<text>{{item.text}}</text> | |||||
</view> | |||||
</view> | |||||
</view> | |||||
<view tt:if="{{userInfo.is_admin!=4}}" class='jiaoyi jiaoyi1 jiaoyi2' hover-class='actives' bindtap='toTran' | |||||
data-type='0'> | |||||
<view class='toTransaction'> | |||||
<view> | |||||
<text>交易记录</text> | |||||
</view> | </view> | ||||
<!-- <view class='transaction' tt:if="{{ifShowChart!='show'}}"> | |||||
<view>今日交易额:{{amountMoney/100}}元 | |||||
<image class='iconfonts' src='../../assets/images/jian.png' mode="widthFix"></image> | |||||
</view> | |||||
</view> | |||||
<!-- <view class='transaction' tt:if="{{ifShowChart!='show'}}"> | |||||
<ec-canvas id="mychart-jiaoyi" canvas-id="mychart-multi-bar" ec="{{ ecBar }}"></ec-canvas> | <ec-canvas id="mychart-jiaoyi" canvas-id="mychart-multi-bar" ec="{{ ecBar }}"></ec-canvas> | ||||
</view> --> | </view> --> | ||||
<view class='transaction' tt:if="{{ifShowChart=='show'}}"> | |||||
<image class='img' src='../../assets/images/nothave01.png' mode='widthFix'></image> | |||||
<view class="nothave">暂无数据</view> | |||||
</view> | |||||
<view class='transaction' tt:if="{{ifShowChart=='show'}}"> | |||||
<image class='img' src='../../assets/images/nothave01.png' mode='widthFix'></image> | |||||
<view class="nothave">暂无数据</view> | |||||
</view> | </view> | ||||
<view class='jiaoyi' hover-class='actives' bindtap='toTran' data-type='1'> | |||||
<view class='toTransaction'> | |||||
<view> | |||||
<text>核销记录</text> | |||||
</view> | |||||
<view>今日核销额:{{writeOffMoney/100}}元 | |||||
<image class='iconfonts' src='../../assets/images/jian.png' mode="widthFix"></image> | |||||
</view> | |||||
</view> | |||||
<view tt:if="{{userInfo.is_admin!=4}}" class='jiaoyi' hover-class='actives' bindtap='toTran' data-type='1'> | |||||
<view class='toTransaction'> | |||||
<view> | |||||
<text>核销记录</text> | |||||
</view> | |||||
<view>今日核销额:{{writeOffMoney/100}}元 | |||||
<image class='iconfonts' src='../../assets/images/jian.png' mode="widthFix"></image> | |||||
</view> | </view> | ||||
<!-- <view class='transaction' tt:if="{{ifShowChart1!='show'}}"> | |||||
</view> | |||||
<!-- <view class='transaction' tt:if="{{ifShowChart1!='show'}}"> | |||||
<ec-canvas id="mychart-hexiao" canvas-id="mychart-multi-scatter" ec="{{ ecScatter }}"></ec-canvas> | <ec-canvas id="mychart-hexiao" canvas-id="mychart-multi-scatter" ec="{{ ecScatter }}"></ec-canvas> | ||||
</view> | </view> | ||||
<view class='transaction' tt:if="{{ifShowChart1=='show'}}"> | <view class='transaction' tt:if="{{ifShowChart1=='show'}}"> | ||||
<image class='img' src='../../assets/images/nothave02.png' mode='widthFix'></image> | <image class='img' src='../../assets/images/nothave02.png' mode='widthFix'></image> | ||||
<view class="nothave1">暂无数据</view> | <view class="nothave1">暂无数据</view> | ||||
</view> --> | </view> --> | ||||
</view> | |||||
<!-- <view class='jiaoyi jiaoyi1' hover-class='actives' bindtap='toRecord' data-type='0'> | |||||
</view> | |||||
<!-- <view class='jiaoyi jiaoyi1' hover-class='actives' bindtap='toRecord' data-type='0'> | |||||
<view class='toTransaction'> | <view class='toTransaction'> | ||||
<view> | <view> | ||||
<text>收银记录</text> | <text>收银记录</text> | ||||
@@ -103,4 +117,4 @@ | |||||
<view class="nothave2">暂无数据</view> | <view class="nothave2">暂无数据</view> | ||||
</view> | </view> | ||||
</view> --> | </view> --> | ||||
</view> | |||||
</view> |
@@ -15,25 +15,25 @@ Page({ | |||||
flagdate: null, | flagdate: null, | ||||
list: [], | list: [], | ||||
tabTxt: [{ | tabTxt: [{ | ||||
title: '全部', | |||||
idss: 0 | |||||
}, | |||||
{ | |||||
title: '日期', | |||||
idss: 1 | |||||
}, | |||||
{ | |||||
title: '类型', | |||||
idss: 2 | |||||
}, | |||||
{ | |||||
title: '状态', | |||||
idss: 3 | |||||
}, | |||||
{ | |||||
title: '来源', | |||||
idss: 4 | |||||
} | |||||
title: '全部', | |||||
idss: 0 | |||||
}, | |||||
{ | |||||
title: '日期', | |||||
idss: 1 | |||||
}, | |||||
{ | |||||
title: '类型', | |||||
idss: 2 | |||||
}, | |||||
{ | |||||
title: '状态', | |||||
idss: 3 | |||||
}, | |||||
{ | |||||
title: '来源', | |||||
idss: 4 | |||||
} | |||||
], | ], | ||||
showList: null, | showList: null, | ||||
loading: "", | loading: "", | ||||
@@ -43,37 +43,36 @@ Page({ | |||||
hasMore: false, //加载更多按钮 | hasMore: false, //加载更多按钮 | ||||
moreTxt: '点击加载更多', | moreTxt: '点击加载更多', | ||||
dataNull: true, | dataNull: true, | ||||
status:'', | |||||
type:'', | |||||
source:'', | |||||
status: '', | |||||
type: '', | |||||
source: '', | |||||
date: "", | date: "", | ||||
date2: "", | date2: "", | ||||
idss: 0, | idss: 0, | ||||
subsidy:'', | |||||
subsidy: '', | |||||
pageNum: 1, //第几页 | pageNum: 1, //第几页 | ||||
height: null, | height: null, | ||||
billtypes: [{ | billtypes: [{ | ||||
name: '自主结算', | |||||
billTypeValue: 1, | |||||
id: 1 | |||||
}, | |||||
{ | |||||
name: '微信分账', | |||||
billTypeValue: 2, | |||||
id: 2 | |||||
} | |||||
name: '自主结算', | |||||
billTypeValue: 1, | |||||
id: 1 | |||||
}, | |||||
{ | |||||
name: '微信分账', | |||||
billTypeValue: 2, | |||||
id: 2 | |||||
} | |||||
], | ], | ||||
statustypes: [ | |||||
{ | |||||
name: '未结算', | |||||
status: 0, | |||||
id: 0 | |||||
}, | |||||
{ | |||||
name: '已结算', | |||||
status: 1, | |||||
id: 1 | |||||
} | |||||
statustypes: [{ | |||||
name: '未结算', | |||||
status: 0, | |||||
id: 0 | |||||
}, | |||||
{ | |||||
name: '已结算', | |||||
status: 1, | |||||
id: 1 | |||||
} | |||||
], | ], | ||||
//结算来源 | //结算来源 | ||||
auditWayOptions: [ | auditWayOptions: [ | ||||
@@ -132,7 +131,7 @@ Page({ | |||||
idss: e.target.dataset.idss || e.currentTarget.dataset.idss, | idss: e.target.dataset.idss || e.currentTarget.dataset.idss, | ||||
pageNum: 1 | pageNum: 1 | ||||
}) | }) | ||||
if (e.currentTarget.dataset.idss===0){ | |||||
if (e.currentTarget.dataset.idss === 0) { | |||||
this.setData({ | this.setData({ | ||||
source: '', | source: '', | ||||
type: '', | type: '', | ||||
@@ -144,14 +143,14 @@ Page({ | |||||
this.getTotleData() | this.getTotleData() | ||||
} | } | ||||
var data = [true, true, true, true, true], | var data = [true, true, true, true, true], | ||||
index = e.currentTarget.dataset.index; | |||||
index = e.currentTarget.dataset.index; | |||||
data[index] = !that.data.tab[index]; | data[index] = !that.data.tab[index]; | ||||
that.setData({ | that.setData({ | ||||
tab: data | tab: data | ||||
}) | }) | ||||
}, | }, | ||||
bindDateChange1: function (e) { | bindDateChange1: function (e) { | ||||
if (new Date(e.detail.value).getTime() > new Date(this.data.date2).getTime()){ | |||||
if (new Date(e.detail.value).getTime() > new Date(this.data.date2).getTime()) { | |||||
tt.showToast({ | tt.showToast({ | ||||
title: '抱歉,开始日期不能大于结束日期', | title: '抱歉,开始日期不能大于结束日期', | ||||
icon: 'none', | icon: 'none', | ||||
@@ -178,19 +177,19 @@ Page({ | |||||
date2: e.detail.value | date2: e.detail.value | ||||
}) | }) | ||||
}, | }, | ||||
search(e){ | |||||
search(e) { | |||||
console.log(e.currentTarget.dataset.ids) | console.log(e.currentTarget.dataset.ids) | ||||
let type = e.currentTarget.dataset.ids; | let type = e.currentTarget.dataset.ids; | ||||
if(type==0){ | |||||
if (type == 0) { | |||||
this.setData({ | this.setData({ | ||||
source:'', | |||||
type:'', | |||||
status:'', | |||||
date:'', | |||||
date2:'' | |||||
source: '', | |||||
type: '', | |||||
status: '', | |||||
date: '', | |||||
date2: '' | |||||
}) | }) | ||||
} else if(type == 1){ | |||||
if(!this.data.date){ | |||||
} else if (type == 1) { | |||||
if (!this.data.date) { | |||||
tt.showToast({ | tt.showToast({ | ||||
title: '抱歉请选择开始日期', | title: '抱歉请选择开始日期', | ||||
icon: 'none', | icon: 'none', | ||||
@@ -198,7 +197,7 @@ Page({ | |||||
mask: false | mask: false | ||||
}); | }); | ||||
return; | return; | ||||
} else if (!this.data.date2){ | |||||
} else if (!this.data.date2) { | |||||
tt.showToast({ | tt.showToast({ | ||||
title: '抱歉请选择结束日期', | title: '抱歉请选择结束日期', | ||||
icon: 'none', | icon: 'none', | ||||
@@ -209,7 +208,7 @@ Page({ | |||||
} | } | ||||
} else if (type == 2) { | } else if (type == 2) { | ||||
this.setData({ | this.setData({ | ||||
type:e.currentTarget.dataset.id | |||||
type: e.currentTarget.dataset.id | |||||
}) | }) | ||||
} else if (type == 3) { | } else if (type == 3) { | ||||
console.log(e.currentTarget.dataset.id) | console.log(e.currentTarget.dataset.id) | ||||
@@ -259,22 +258,22 @@ Page({ | |||||
}) | }) | ||||
console.log(arr, 888888888888) | console.log(arr, 888888888888) | ||||
}, | }, | ||||
getTotleData(){ | |||||
getTotleData() { | |||||
let _this = this; | let _this = this; | ||||
Http.get({ | Http.get({ | ||||
url: config.api.getSubsidySummary, | |||||
data: { | |||||
startdate: this.data.date?this.data.date + " 00:00:00":'', | |||||
enddate: this.data.date2?this.data.date2 + " 23:59:59":'', | |||||
source: this.data.source, | |||||
type: this.data.type, | |||||
status: this.data.status | |||||
} | |||||
}) | |||||
url: config.api.getSubsidySummary, | |||||
data: { | |||||
startdate: this.data.date ? this.data.date + " 00:00:00" : '', | |||||
enddate: this.data.date2 ? this.data.date2 + " 23:59:59" : '', | |||||
source: this.data.source, | |||||
type: this.data.type, | |||||
status: this.data.status | |||||
} | |||||
}) | |||||
.then(res => { | .then(res => { | ||||
console.log(res,777) | |||||
console.log(res, 777) | |||||
_this.setData({ | _this.setData({ | ||||
subsidy: Number(Number(res.data.subsidy)/100).toFixed(2) | |||||
subsidy: Number(Number(res.data.subsidy) / 100).toFixed(2) | |||||
}) | }) | ||||
tt.stopPullDownRefresh(); | tt.stopPullDownRefresh(); | ||||
}) | }) | ||||
@@ -291,17 +290,17 @@ Page({ | |||||
getList: function (page) { | getList: function (page) { | ||||
let _this = this; | let _this = this; | ||||
Http.get({ | Http.get({ | ||||
url: config.api.getSubsidyList, | |||||
data: { | |||||
pageNum: page, | |||||
pageSize: 10, | |||||
startdate: this.data.date ? this.data.date + " 00:00:00" : '', | |||||
enddate: this.data.date2 ? this.data.date2 + " 23:59:59" : '', | |||||
source: this.data.source, | |||||
type: this.data.type, | |||||
status: this.data.status | |||||
} | |||||
}) | |||||
url: config.api.getSubsidyList, | |||||
data: { | |||||
pageNum: page, | |||||
pageSize: 10, | |||||
startdate: this.data.date ? this.data.date + " 00:00:00" : '', | |||||
enddate: this.data.date2 ? this.data.date2 + " 23:59:59" : '', | |||||
source: this.data.source, | |||||
type: this.data.type, | |||||
status: this.data.status | |||||
} | |||||
}) | |||||
.then(res => { | .then(res => { | ||||
tt.stopPullDownRefresh(); | tt.stopPullDownRefresh(); | ||||
let data = res.data.list; | let data = res.data.list; | ||||
@@ -316,7 +315,7 @@ Page({ | |||||
item.createDate01 = util.formatTime(item.createDate, 'yyyy-MM-dddd hh:mm:ss') | item.createDate01 = util.formatTime(item.createDate, 'yyyy-MM-dddd hh:mm:ss') | ||||
item.sourceStr = this.data.auditWayOptions.filter(e => e.value == item.source).length > 0 ? this.data.auditWayOptions.filter(e => e.value == item.source)[0].name : ''; | item.sourceStr = this.data.auditWayOptions.filter(e => e.value == item.source).length > 0 ? this.data.auditWayOptions.filter(e => e.value == item.source)[0].name : ''; | ||||
item.typeStr = this.data.billtypes.filter(e => e.id == item.type).length > 0 ? this.data.billtypes.filter(e => e.id == item.type)[0].name : ''; | item.typeStr = this.data.billtypes.filter(e => e.id == item.type).length > 0 ? this.data.billtypes.filter(e => e.id == item.type)[0].name : ''; | ||||
item.statusStr = item.status===0?'未结算' : "已结算"; | |||||
item.statusStr = item.status === 0 ? '未结算' : "已结算"; | |||||
allBillList.map((item02, index02) => { | allBillList.map((item02, index02) => { | ||||
if (item02.id == item.id) { | if (item02.id == item.id) { | ||||
haveIf = true; | haveIf = true; | ||||
@@ -326,7 +325,7 @@ Page({ | |||||
allBillList.push(item) | allBillList.push(item) | ||||
} | } | ||||
}) | }) | ||||
console.log(allBillList,444) | |||||
console.log(allBillList, 444) | |||||
if (res.data.pages <= page) { | if (res.data.pages <= page) { | ||||
_this.setData({ | _this.setData({ | ||||
allBillList, | allBillList, | ||||
@@ -12,19 +12,22 @@ Page({ | |||||
data: { | data: { | ||||
}, | }, | ||||
gotoSaoyiSao: function () {//扫码核销、识别会员码 | |||||
gotoSaoyiSao: function () { //扫码核销、识别会员码 | |||||
tt.setStorageSync("verifyRemark", 12) | tt.setStorageSync("verifyRemark", 12) | ||||
tt.scanCode({ | tt.scanCode({ | ||||
success: function(val) { | |||||
success: function (val) { | |||||
console.log(val.result); | console.log(val.result); | ||||
if (util.isJSON(val.result)) { | if (util.isJSON(val.result)) { | ||||
let value = JSON.parse(val.result); | let value = JSON.parse(val.result); | ||||
console.log(value, 'value'); | |||||
if (value.END == 'C' && value.TYPE == 'couponorder' && value.ID.length >= 18) { | if (value.END == 'C' && value.TYPE == 'couponorder' && value.ID.length >= 18) { | ||||
Http.getRequest(config.api.couponOrderDetail, app.globalData.token, '加载中', { | Http.getRequest(config.api.couponOrderDetail, app.globalData.token, '加载中', { | ||||
couponOrderId: value.ID | |||||
couponOrderId: value.ID, | |||||
couponTenantId: value.couponTenantId | |||||
}, (res) => { | }, (res) => { | ||||
tt.setStorageSync("verifyRemark", 12) | tt.setStorageSync("verifyRemark", 12) | ||||
tt.setStorageSync("couponOrderId", value.ID) | tt.setStorageSync("couponOrderId", value.ID) | ||||
tt.setStorageSync("couponTenantId", value.couponTenantId) | |||||
if (res.code == 200) { | if (res.code == 200) { | ||||
tt.navigateTo({ | tt.navigateTo({ | ||||
url: `/pages/writeoffPage/writeoffPage` | url: `/pages/writeoffPage/writeoffPage` | ||||
@@ -71,7 +74,7 @@ Page({ | |||||
}) | }) | ||||
} | } | ||||
}, | }, | ||||
fail:function(){ | |||||
fail: function () { | |||||
tt.showToast({ | tt.showToast({ | ||||
title: '请扫描正确的二维码', | title: '请扫描正确的二维码', | ||||
icon: 'none', | icon: 'none', | ||||
@@ -81,12 +84,11 @@ Page({ | |||||
}) | }) | ||||
}, | }, | ||||
// 跳转到手动核销 | // 跳转到手动核销 | ||||
aoto: function() { | |||||
aoto: function () { | |||||
tt.setStorageSync("verifyRemark", 11) | tt.setStorageSync("verifyRemark", 11) | ||||
tt.setStorageSync | tt.setStorageSync | ||||
tt.navigateTo({ | tt.navigateTo({ | ||||
url: '/pages/write0ff/write0ff', | url: '/pages/write0ff/write0ff', | ||||
}) | }) | ||||
}, | }, | ||||
}) | |||||
}) |
@@ -37,23 +37,23 @@ Page({ | |||||
pageSize: 8, | pageSize: 8, | ||||
}, (res) => { | }, (res) => { | ||||
console.log(res) | console.log(res) | ||||
if(res.data.list &&res.data.list.list.length &&res.data.list.list.length > 0){ | |||||
if (res.data.list && res.data.list.list.length && res.data.list.list.length > 0) { | |||||
res.data && res.data.list.list.map(file => { | res.data && res.data.list.list.map(file => { | ||||
file.expiredTime = format.formatTime(file.expiredTime, 'yyyy-MM-dddd hh:mm:ss') | file.expiredTime = format.formatTime(file.expiredTime, 'yyyy-MM-dddd hh:mm:ss') | ||||
file.createDate = format.formatTime(file.createDate, 'yyyy-MM-dddd hh:mm:ss') | file.createDate = format.formatTime(file.createDate, 'yyyy-MM-dddd hh:mm:ss') | ||||
file.updateDate = format.formatTime(file.updateDate, 'yyyy-MM-dddd hh:mm:ss') | file.updateDate = format.formatTime(file.updateDate, 'yyyy-MM-dddd hh:mm:ss') | ||||
file.ids = file.id.slice(0,4)+`******`+file.id.slice(14) | |||||
file.ids = file.id.slice(0, 4) + `******` + file.id.slice(14) | |||||
dataList.push(file) | dataList.push(file) | ||||
}) | }) | ||||
} | } | ||||
console.log(dataList,"dataList"); | |||||
console.log(dataList, "dataList"); | |||||
this.setData({ | this.setData({ | ||||
list: dataList, | list: dataList, | ||||
hide: res.data.list.list == 0 ? true : false | hide: res.data.list.list == 0 ? true : false | ||||
}) | }) | ||||
console.log(this.data.list) | console.log(this.data.list) | ||||
resolve(res) | resolve(res) | ||||
}) | }) | ||||
@@ -67,16 +67,16 @@ Page({ | |||||
pageSize: 10, | pageSize: 10, | ||||
}, (res) => { | }, (res) => { | ||||
console.log(res) | console.log(res) | ||||
if(res.data.list &&res.data.list.list.length &&res.data.list.list.length > 0){ | |||||
if (res.data.list && res.data.list.list.length && res.data.list.list.length > 0) { | |||||
res.data && res.data.list.list.map(file => { | res.data && res.data.list.list.map(file => { | ||||
file.expiredTime = format.formatTime(file.expiredTime, 'yyyy-MM-dddd hh:mm:ss') | file.expiredTime = format.formatTime(file.expiredTime, 'yyyy-MM-dddd hh:mm:ss') | ||||
file.createDate = format.formatTime(file.createDate, 'yyyy-MM-dddd hh:mm:ss') | file.createDate = format.formatTime(file.createDate, 'yyyy-MM-dddd hh:mm:ss') | ||||
file.updateDate = format.formatTime(file.updateDate, 'yyyy-MM-dddd hh:mm:ss') | file.updateDate = format.formatTime(file.updateDate, 'yyyy-MM-dddd hh:mm:ss') | ||||
file.ids = file.id.slice(0,4)+`******`+file.id.slice(14) | |||||
file.ids = file.id.slice(0, 4) + `******` + file.id.slice(14) | |||||
dataList.push(file) | dataList.push(file) | ||||
}) | }) | ||||
} | } | ||||
this.setData({ | this.setData({ | ||||
list: dataList, | list: dataList, | ||||
hide: res.data.list.list == 0 ? true : false | hide: res.data.list.list == 0 ? true : false | ||||
@@ -100,7 +100,7 @@ Page({ | |||||
nowDateTime: nowTime | nowDateTime: nowTime | ||||
}) | }) | ||||
this.getList(e.type, page, nowTime) | this.getList(e.type, page, nowTime) | ||||
if (e.type == '0') { // 交易流水 | |||||
if (e.type == '0') { // 交易流水 | |||||
this.setData({ | this.setData({ | ||||
flag: true, | flag: true, | ||||
text: '未核销', | text: '未核销', | ||||
@@ -111,8 +111,7 @@ Page({ | |||||
tt.setNavigationBarTitle({ | tt.setNavigationBarTitle({ | ||||
title: '交易记录', | title: '交易记录', | ||||
}) | }) | ||||
} | |||||
else { // 核销 | |||||
} else { // 核销 | |||||
this.setData({ | this.setData({ | ||||
flag: false, | flag: false, | ||||
text: '已核销', | text: '已核销', | ||||
@@ -154,7 +153,7 @@ Page({ | |||||
// 退券退款申请成功 | // 退券退款申请成功 | ||||
tt.showToast({ | tt.showToast({ | ||||
title: res.message, | title: res.message, | ||||
image:'../../static/images/success.png' | |||||
image: '../../static/images/success.png' | |||||
}) | }) | ||||
setTimeout(() => { | setTimeout(() => { | ||||
tt.switchTab({ | tt.switchTab({ | ||||
@@ -165,10 +164,10 @@ Page({ | |||||
tt.showModal({ | tt.showModal({ | ||||
title: '错误', | title: '错误', | ||||
content: res.message, | content: res.message, | ||||
showCancel:false | |||||
showCancel: false | |||||
}) | }) | ||||
} | } | ||||
}, (err) =>{ | |||||
}, (err) => { | |||||
console.log("err", err) | console.log("err", err) | ||||
tt.showModal({ | tt.showModal({ | ||||
title: '错误', | title: '错误', | ||||
@@ -186,7 +185,7 @@ Page({ | |||||
this.setData({ | this.setData({ | ||||
dateTime: e.detail.value, | dateTime: e.detail.value, | ||||
dataList: [], | dataList: [], | ||||
list:[] | |||||
list: [] | |||||
}) | }) | ||||
page = 1 | page = 1 | ||||
this.setData({ | this.setData({ | ||||
@@ -6,30 +6,30 @@ const Http = require('../../utils/HttpBasics.js') | |||||
Page({ | Page({ | ||||
data: { | data: { | ||||
cashOutOpenHeadImg:"",//用户头像 | |||||
cashOutOpenNickName:"",//用户名 | |||||
cashOutCount: "",//当日已提现次数 | |||||
cashOutOpenHeadImg: "", //用户头像 | |||||
cashOutOpenNickName: "", //用户名 | |||||
cashOutCount: "", //当日已提现次数 | |||||
cashOutNumber: "", // 可提现余额 | cashOutNumber: "", // 可提现余额 | ||||
cashOutSupport: "",// 1 - 支持提现 0-不支持提现 | |||||
cashOutLimit: "",// 当日提现次数限制 | |||||
cashOutSupport: "", // 1 - 支持提现 0-不支持提现 | |||||
cashOutLimit: "", // 当日提现次数限制 | |||||
city: '', | city: '', | ||||
userInfo: {}, | userInfo: {}, | ||||
flag: 'hidden', | flag: 'hidden', | ||||
isSet:false, | |||||
isSet: false, | |||||
haveData: false, | haveData: false, | ||||
ttBalanceUrl:"",//余额链接 | |||||
ttImportUrl:"",//进件链接 | |||||
ttBalanceUrl: "", //余额链接 | |||||
ttImportUrl: "", //进件链接 | |||||
}, | }, | ||||
toDetail() { | toDetail() { | ||||
tt.navigateTo({ | tt.navigateTo({ | ||||
url: `./signInDetail/signInDetail?userInfo=${this.data.userInfo}` | url: `./signInDetail/signInDetail?userInfo=${this.data.userInfo}` | ||||
}) | }) | ||||
}, | }, | ||||
phone(e){ | |||||
phone(e) { | |||||
tt.makePhoneCall({ | tt.makePhoneCall({ | ||||
phoneNumber: e.currentTarget.dataset.phone | |||||
phoneNumber: e.currentTarget.dataset.phone | |||||
}) | }) | ||||
}, | }, | ||||
toExit() { | toExit() { | ||||
@@ -51,21 +51,21 @@ Page({ | |||||
console.log(that.data.flag) | console.log(that.data.flag) | ||||
}, | }, | ||||
//获取提现信息 | //获取提现信息 | ||||
getTx(){ | |||||
getTx() { | |||||
Http.get({ | Http.get({ | ||||
url: config.api.balance | url: config.api.balance | ||||
}).then(res=>{ | |||||
}).then(res => { | |||||
console.log(111) | console.log(111) | ||||
this.setData({ | this.setData({ | ||||
cashOutCount: res.data.cashOutCount,//当日已提现次数 | |||||
cashOutCount: res.data.cashOutCount, //当日已提现次数 | |||||
cashOutNumber: res.data.cashOutNumber, // 可提现余额 | cashOutNumber: res.data.cashOutNumber, // 可提现余额 | ||||
cashOutSupport: res.data.cashOutSupport,// 1 - 支持提现 0-不支持提现 | |||||
cashOutLimit: res.data.cashOutLimit,// 当日提现次数限制 | |||||
cashOutSupport: res.data.cashOutSupport, // 1 - 支持提现 0-不支持提现 | |||||
cashOutLimit: res.data.cashOutLimit, // 当日提现次数限制 | |||||
withdrawNun: res.data.cashOutLimit - res.data.cashOutCount, | withdrawNun: res.data.cashOutLimit - res.data.cashOutCount, | ||||
cashOutOpenHeadImg: res.data.cashOutOpenHeadImg, | cashOutOpenHeadImg: res.data.cashOutOpenHeadImg, | ||||
cashOutOpenNickName: res.data.cashOutOpenNickName | cashOutOpenNickName: res.data.cashOutOpenNickName | ||||
}) | }) | ||||
}).catch(err=>{ | |||||
}).catch(err => { | |||||
// tt.showToast({ | // tt.showToast({ | ||||
// title: err.message, | // title: err.message, | ||||
// icon:"none", | // icon:"none", | ||||
@@ -73,10 +73,10 @@ Page({ | |||||
// }) | // }) | ||||
}) | }) | ||||
}, | }, | ||||
onLoad(){ | |||||
onLoad() { | |||||
// this.findJurisdiction() | // this.findJurisdiction() | ||||
}, | }, | ||||
onShow(){ | |||||
onShow() { | |||||
// this.getTx() | // this.getTx() | ||||
app.globalData.userInfo().then(res => { | app.globalData.userInfo().then(res => { | ||||
this.setData({ | this.setData({ | ||||
@@ -86,9 +86,10 @@ Page({ | |||||
// this.setData({ | // this.setData({ | ||||
// appVersion:appVersion | // appVersion:appVersion | ||||
// }) | // }) | ||||
console.log(app.globalData.isAdmin); | |||||
}, | }, | ||||
//提现按钮 | //提现按钮 | ||||
withdraw(){ | |||||
withdraw() { | |||||
console.log(this.data.cashOutOpenNickName) | console.log(this.data.cashOutOpenNickName) | ||||
tt.navigateTo({ | tt.navigateTo({ | ||||
url: `/pages/withdraw/withdraw?money=${this.data.cashOutNumber}&userTop=${this.data.cashOutOpenHeadImg}&userName=${this.data.cashOutOpenNickName}`, | url: `/pages/withdraw/withdraw?money=${this.data.cashOutNumber}&userTop=${this.data.cashOutOpenHeadImg}&userName=${this.data.cashOutOpenNickName}`, | ||||
@@ -97,7 +98,7 @@ Page({ | |||||
/** | /** | ||||
* 查询是否有修改账户权限 | * 查询是否有修改账户权限 | ||||
*/ | */ | ||||
findJurisdiction(){ | |||||
findJurisdiction() { | |||||
Http.get({ | Http.get({ | ||||
url: config.api.permitModifiy, | url: config.api.permitModifiy, | ||||
}).then(res => { | }).then(res => { | ||||
@@ -121,26 +122,26 @@ Page({ | |||||
}) | }) | ||||
}, | }, | ||||
goWebView(e){ | |||||
goWebView(e) { | |||||
tt.showLoading({ | tt.showLoading({ | ||||
title: "获取中!", | title: "获取中!", | ||||
}); | }); | ||||
let type = e.currentTarget.dataset.type | let type = e.currentTarget.dataset.type | ||||
this.findAccountById(this.data.userInfo.merchant_id,type) | |||||
this.findAccountById(this.data.userInfo.merchant_id, type) | |||||
}, | }, | ||||
/** | /** | ||||
* 查询收款账户状态 | * 查询收款账户状态 | ||||
*/ | */ | ||||
findAccountById(merchant_id,type){ | |||||
findAccountById(merchant_id, type) { | |||||
Http.get({ | Http.get({ | ||||
url: config.api.findTt, | url: config.api.findTt, | ||||
data:{ | |||||
data: { | |||||
id: merchant_id, | id: merchant_id, | ||||
urlType:type | |||||
urlType: type | |||||
} | } | ||||
}).then(res=>{ | |||||
}).then(res => { | |||||
tt.hideLoading() | tt.hideLoading() | ||||
console.log(); | console.log(); | ||||
/** | /** | ||||
@@ -150,7 +151,7 @@ Page({ | |||||
*/ | */ | ||||
tt.setClipboardData({ | tt.setClipboardData({ | ||||
data: res.data, | data: res.data, | ||||
success: function() { | |||||
success: function () { | |||||
tt.showToast({ | tt.showToast({ | ||||
title: '复制成功 请到浏览器打开', | title: '复制成功 请到浏览器打开', | ||||
icon: "none", | icon: "none", | ||||
@@ -158,12 +159,12 @@ Page({ | |||||
}) | }) | ||||
} | } | ||||
}) | }) | ||||
}).catch(err=>{ | |||||
}).catch(err => { | |||||
tt.hideLoading() | tt.hideLoading() | ||||
tt.showToast({ | tt.showToast({ | ||||
title: err.message, | title: err.message, | ||||
icon:"none", | |||||
duration:2000 | |||||
icon: "none", | |||||
duration: 2000 | |||||
}) | }) | ||||
}) | }) | ||||
} | } |
@@ -1,18 +1,18 @@ | |||||
<view> | <view> | ||||
<view class='mine'> | |||||
<image class='img' src='../../assets/images/bannerbg.png' mode="widthFix"></image> | |||||
<!-- bindtap='toDetail' --> | |||||
<view class='header' > | |||||
<view> | |||||
<image src='{{userInfo.merchant_img_url}}' mode='{{widthFix}}'></image> | |||||
</view> | |||||
<view> | |||||
<text>{{userInfo.mall_name}}({{userInfo.merchant_name}})</text> | |||||
<text>{{userInfo.phone}}</text> | |||||
</view> | |||||
<!-- <image class='imgs' src='../../assets/images/jian.png' mode="widthFix"></image> --> | |||||
<view class='mine'> | |||||
<image class='img' src='../../assets/images/bannerbg.png' mode="widthFix"></image> | |||||
<!-- bindtap='toDetail' --> | |||||
<view class='header'> | |||||
<view> | |||||
<image src='{{userInfo.merchant_img_url}}' mode='{{widthFix}}'></image> | |||||
</view> | |||||
<view> | |||||
<text>{{userInfo.mall_name}}({{userInfo.merchant_name}})</text> | |||||
<text>{{userInfo.phone}}</text> | |||||
</view> | </view> | ||||
<!-- <view class="withdrawBox" tt:if="{{cashOutSupport==1}}"> | |||||
<!-- <image class='imgs' src='../../assets/images/jian.png' mode="widthFix"></image> --> | |||||
</view> | |||||
<!-- <view class="withdrawBox" tt:if="{{cashOutSupport==1}}"> | |||||
<view class="textBox"> | <view class="textBox"> | ||||
<view class="balanceTitle">账户余额</view> | <view class="balanceTitle">账户余额</view> | ||||
@@ -23,46 +23,43 @@ | |||||
<button class="operationBut" bindtap="withdraw" tt:if="{{withdrawNun>0}}">提现到零钱</button> | <button class="operationBut" bindtap="withdraw" tt:if="{{withdrawNun>0}}">提现到零钱</button> | ||||
<button class="noOperationBut" tt:if="{{withdrawNun<=0}}">提现次数已耗尽</button> | <button class="noOperationBut" tt:if="{{withdrawNun<=0}}">提现次数已耗尽</button> | ||||
</view> --> | </view> --> | ||||
<view class='section'> | |||||
<view class='section'> | |||||
<!-- <navigator url='/pages/withdrawRecord/withdrawRecord' open-type='navigate' hover-class='none' tt:if="{{cashOutSupport==1}}"> | <!-- <navigator url='/pages/withdrawRecord/withdrawRecord' open-type='navigate' hover-class='none' tt:if="{{cashOutSupport==1}}"> | ||||
<view> | <view> | ||||
<text>提现记录</text> | <text>提现记录</text> | ||||
<image class='imgs' src='../../assets/images/jian.png' mode="widthFix"></image> | <image class='imgs' src='../../assets/images/jian.png' mode="widthFix"></image> | ||||
</view> | </view> | ||||
</navigator> --> | </navigator> --> | ||||
<navigator url='/pages/forgetpwd/forgetpwd?flags=reset' open-type='navigate' hover-class='none'> | |||||
<view> | |||||
<text>修改密码</text> | |||||
<image class='imgs' src='../../assets/images/jian.png' mode="widthFix"></image> | |||||
</view> | |||||
</navigator> | |||||
<navigator url='/pages/orderUrl/orderUrl' open-type='navigate' hover-class='none' tt:if="{{userInfo.user_is_admin==1}}"> | |||||
<view> | |||||
<text>导出核销记录</text> | |||||
<image class='imgs' src='../../assets/images/jian.png' mode="widthFix"></image> | |||||
</view> | |||||
</navigator> | |||||
<!-- <view bindtap="mode" data-type="{{1}}"> | |||||
<text>导出交易订单记录</text> | |||||
<navigator url='/pages/forgetpwd/forgetpwd?flags=reset' open-type='navigate' hover-class='none'> | |||||
<view> | |||||
<text>修改密码</text> | |||||
<image class='imgs' src='../../assets/images/jian.png' mode="widthFix"></image> | <image class='imgs' src='../../assets/images/jian.png' mode="widthFix"></image> | ||||
</view> --> | |||||
<view bindtap="goWebView" tt:if="{{userInfo.user_is_admin}}" data-type="{{1}}"> | |||||
<text>开通收款账户</text> | |||||
<text>点击复制链接</text> | |||||
</view> | </view> | ||||
</navigator> | |||||
<view bindtap="goWebView" tt:if="{{userInfo.user_is_admin}}" data-type="{{2}}"> | |||||
<text>账户余额</text> | |||||
<text>点击复制链接</text> | |||||
<navigator url='/pages/orderUrl/orderUrl' open-type='navigate' hover-class='none' | |||||
tt:if="{{userInfo.user_is_admin==1&&userInfo.is_admin!=4}}"> | |||||
<view> | |||||
<text>导出核销记录</text> | |||||
<image class='imgs' src='../../assets/images/jian.png' mode="widthFix"></image> | |||||
</view> | </view> | ||||
</navigator> | |||||
<!-- <view bindtap="mode" data-type="{{1}}"> | |||||
<text>导出交易订单记录</text> | |||||
<image class='imgs' src='../../assets/images/jian.png' mode="widthFix"></image> | |||||
</view> --> | |||||
<view bindtap="goWebView" tt:if="{{userInfo.user_is_admin&&userInfo.is_admin!=4}}" data-type="{{1}}"> | |||||
<text>开通收款账户</text> | |||||
<text>点击复制链接</text> | |||||
</view> | |||||
<view bindtap="goWebView" tt:if="{{userInfo.user_is_admin&&userInfo.is_admin!=4}}" data-type="{{2}}"> | |||||
<text>账户余额</text> | |||||
<text>点击复制链接</text> | |||||
</view> | |||||
<!-- <navigator url='/pages/accountManagement/index?merchant_id={{userInfo.merchant_id}}&merchant_name={{userInfo.merchant_name}}&phone={{userInfo.phone}}' open-type='navigate' hover-class='none'> | |||||
<!-- <navigator url='/pages/accountManagement/index?merchant_id={{userInfo.merchant_id}}&merchant_name={{userInfo.merchant_name}}&phone={{userInfo.phone}}' open-type='navigate' hover-class='none'> | |||||
<view> | <view> | ||||
<text>收款账户管理</text> | <text>收款账户管理</text> | ||||
<text tt:if="{{!isSet}}">未添加</text> | <text tt:if="{{!isSet}}">未添加</text> | ||||
@@ -83,24 +80,25 @@ | |||||
</view> | </view> | ||||
</navigator> --> | </navigator> --> | ||||
<navigator url='/pages/creditOperate/index' open-type='navigate' hover-class='none'> | |||||
<view> | |||||
<text>积分操作记录</text> | |||||
<image class='imgs' src='../../assets/images/jian.png' mode="widthFix"></image> | |||||
</view> | |||||
</navigator> | |||||
<navigator tt:if="{{!(userInfo.is_admin==4)}}" url='/pages/creditOperate/index' open-type='navigate' | |||||
hover-class='none'> | |||||
<view> | |||||
<text>积分操作记录</text> | |||||
<image class='imgs' src='../../assets/images/jian.png' mode="widthFix"></image> | |||||
</view> | |||||
</navigator> | |||||
<view bindtap='phone' data-phone='{{userInfo.service_phone}}'> | |||||
<text>客服电话</text> | |||||
<text>{{userInfo.service_phone}}</text> | |||||
</view> | |||||
</view> | |||||
<view bindlongtap='showVersion' class='version'> | |||||
<!-- <view tt:if="{{flag=='show'}}">版本号:{{appVersion}}</view> --> | |||||
<view tt:if="{{flag=='hidden'}}"></view> | |||||
<view bindtap='phone' data-phone='{{userInfo.service_phone}}'> | |||||
<text>客服电话</text> | |||||
<text>{{userInfo.service_phone}}</text> | |||||
</view> | </view> | ||||
<button class='exit' bindtap='toExit' hover-class='active'>退出登录</button> | |||||
</view> | </view> | ||||
</view> | |||||
<view bindlongtap='showVersion' class='version'> | |||||
<!-- <view tt:if="{{flag=='show'}}">版本号:{{appVersion}}</view> --> | |||||
<view tt:if="{{flag=='hidden'}}"></view> | |||||
</view> | |||||
<button class='exit' bindtap='toExit' hover-class='active'>退出登录</button> | |||||
</view> | |||||
</view> |
@@ -1,18 +1,19 @@ | |||||
<!-- <button type="primary" bindtap="getNetWorkType">获取网络类型</button> | <!-- <button type="primary" bindtap="getNetWorkType">获取网络类型</button> | ||||
<button type="primary" bindtap="getSystemInfo">获取设备信息</button> --> | <button type="primary" bindtap="getSystemInfo">获取设备信息</button> --> | ||||
<form > | |||||
<view class='write0ff'> | |||||
<view> | |||||
<text>券码</text> | |||||
<text class='line'></text> | |||||
<!-- <text class='search' bindtap='search' style='color:{{val == "请输券码"?"#ccc":"#666"}};font-size:{{val == "请输券码"?"30rpx":"30rpx"}}'>{{val}}</text> --> | |||||
<input class='search' bindinput="setVale" type='number' maxlength='20' focus value='{{inputValue}}' placeholder='请输入券码' placeholder-style='color:#BFBFBF;' /> | |||||
<!-- <text hover-class='actives' class='iconfont icon-fangdajing' data-id='{{list.id}}'></text> --> | |||||
<!-- <button form-type='submit' hover-class='actives' class='iconfont icon-fangdajing' data-id='{{list.id}}'></button> --> | |||||
<view class='iconfont icon-fangdajing' bindtap="toWriteoffPage"></view> | |||||
</view> | |||||
<!-- <view class='softkey' tt:if='{{flag}}'> | |||||
<form> | |||||
<view class='write0ff'> | |||||
<view> | |||||
<text>券码</text> | |||||
<text class='line'></text> | |||||
<!-- <text class='search' bindtap='search' style='color:{{val == "请输券码"?"#ccc":"#666"}};font-size:{{val == "请输券码"?"30rpx":"30rpx"}}'>{{val}}</text> --> | |||||
<input class='search' bindinput="setVale" type='number' maxlength='20' focus value='{{inputValue}}' | |||||
placeholder='只能输入当前商场的券码' placeholder-style='color:#BFBFBF;' /> | |||||
<!-- <text hover-class='actives' class='iconfont icon-fangdajing' data-id='{{list.id}}'></text> --> | |||||
<!-- <button form-type='submit' hover-class='actives' class='iconfont icon-fangdajing' data-id='{{list.id}}'></button> --> | |||||
<view class='iconfont icon-fangdajing' bindtap="toWriteoffPage"></view> | |||||
</view> | |||||
<!-- <view class='softkey' tt:if='{{flag}}'> | |||||
<view> | <view> | ||||
<text tt:for='{{keyBordList}}' tt:key='{{index}}' hover-class='active' bindtap='onClick' data-val='{{item}}'>{{item.num}}</text> | <text tt:for='{{keyBordList}}' tt:key='{{index}}' hover-class='active' bindtap='onClick' data-val='{{item}}'>{{item.num}}</text> | ||||
<text hover-class='active' class='iconfont icon-yincangjianpan hideKey' bindtap='hideKey'></text> | <text hover-class='active' class='iconfont icon-yincangjianpan hideKey' bindtap='hideKey'></text> | ||||
@@ -23,5 +24,5 @@ | |||||
<text hover-class='active' class='sure' bindtap='toWriteoffPage'>确定</text> | <text hover-class='active' class='sure' bindtap='toWriteoffPage'>确定</text> | ||||
</view> | </view> | ||||
</view> --> | </view> --> | ||||
</view> | |||||
</form> | |||||
</view> | |||||
</form> |
@@ -1,4 +1,3 @@ | |||||
const config = require('../../config/config.js') | const config = require('../../config/config.js') | ||||
const Common = require('../../common/common.js') | const Common = require('../../common/common.js') | ||||
const format = require('../../utils/util.js') | const format = require('../../utils/util.js') | ||||
@@ -8,12 +7,12 @@ Page({ | |||||
val: '请输入券码', | val: '请输入券码', | ||||
couponOrderId: null, | couponOrderId: null, | ||||
couponOrderDetail: null, | couponOrderDetail: null, | ||||
statusImg: '', | |||||
statusImg: '', | |||||
statusText: '', | statusText: '', | ||||
flag: false, | flag: false, | ||||
detail: '', | detail: '', | ||||
remark: '', | remark: '', | ||||
contentType: 0, | |||||
contentType: 0, | |||||
}, | }, | ||||
rule() { | rule() { | ||||
@@ -24,108 +23,108 @@ Page({ | |||||
onLoad(options) { | onLoad(options) { | ||||
if (tt.getStorageSync("couponOrderId")) { | if (tt.getStorageSync("couponOrderId")) { | ||||
this.setData({ | this.setData({ | ||||
couponOrderId: tt.getStorageSync("couponOrderId") | |||||
couponOrderId: tt.getStorageSync("couponOrderId"), | |||||
couponTenantId: tt.getStorageSync("couponTenantId") | |||||
}) | }) | ||||
this.detailInfo(tt.getStorageSync("couponOrderId")) | |||||
this.detailInfo(tt.getStorageSync("couponOrderId"), tt.getStorageSync("couponTenantId")) | |||||
} | } | ||||
}, | }, | ||||
detailInfo(couponOrderId) { | |||||
detailInfo(couponOrderId, couponTenantId) { | |||||
var that = this; | var that = this; | ||||
Common.getCouponOrderDetail(couponOrderId) | |||||
.then(res => { | |||||
console.log(res,"res123") | |||||
if (res.code == 200) { | |||||
this.setData({ | |||||
contentType: res.data.contentType ? res.data.contentType : 0 | |||||
}) | |||||
console.log(this.data.contentType) | |||||
if (res.data.contentType != undefined && res.data.contentType == 1) { | |||||
Common.getHtml(couponOrderId).then(res => { | |||||
if (res.data.html && res.data.html != '') { | |||||
app.globalData.curHtml = decodeURI(res.data.html); | |||||
} | |||||
Common.getCouponOrderDetail(couponOrderId, couponTenantId) | |||||
.then(res => { | |||||
console.log(res, "res123") | |||||
if (res.code == 200) { | |||||
this.setData({ | |||||
contentType: res.data.contentType ? res.data.contentType : 0 | |||||
}) | }) | ||||
} | |||||
res.data.createDate = format.formatTime(res.data.createDate, 'yyyy-MM-dddd hh:mm:ss') | |||||
res.data.expiredTime = format.formatTime(res.data.expiredTime, 'yyyy-MM-dddd hh:mm:ss') | |||||
switch (res.data.couponOrderStatus) { | |||||
case 0: | |||||
//待使用 | |||||
that.setData({ | |||||
statusText: '未核销', | |||||
flag: true | |||||
}) | |||||
break; | |||||
case 1: | |||||
//已核销 | |||||
that.setData({ | |||||
statusImg: '/static/images/use.png', | |||||
statusText: '已核销', | |||||
flag: false | |||||
}) | |||||
break; | |||||
case 2: | |||||
that.setData({ | |||||
statusImg: '/static/images/beOverdue.png', | |||||
statusText: '已过期', | |||||
flag: false | |||||
}) | |||||
//已过期 | |||||
break; | |||||
case 3: | |||||
that.setData({ | |||||
statusImg: '/static/images/refund.png', | |||||
statusText: '已退款', | |||||
flag: false | |||||
}) | |||||
//已作废 | |||||
break; | |||||
default: | |||||
tt.showToast({ | |||||
title: '数据有误', | |||||
image:'../../static/images/fail.png' | |||||
console.log(this.data.contentType) | |||||
if (res.data.contentType != undefined && res.data.contentType == 1) { | |||||
Common.getHtml(couponOrderId).then(res => { | |||||
if (res.data.html && res.data.html != '') { | |||||
app.globalData.curHtml = decodeURI(res.data.html); | |||||
} | |||||
}) | }) | ||||
} | |||||
res.data.createDate = format.formatTime(res.data.createDate, 'yyyy-MM-dddd hh:mm:ss') | |||||
res.data.expiredTime = format.formatTime(res.data.expiredTime, 'yyyy-MM-dddd hh:mm:ss') | |||||
switch (res.data.couponOrderStatus) { | |||||
case 0: | |||||
//待使用 | |||||
that.setData({ | |||||
statusText: '未核销', | |||||
flag: true | |||||
}) | |||||
break; | |||||
case 1: | |||||
//已核销 | |||||
that.setData({ | |||||
statusImg: '/static/images/use.png', | |||||
statusText: '已核销', | |||||
flag: false | |||||
}) | |||||
break; | |||||
case 2: | |||||
that.setData({ | |||||
statusImg: '/static/images/beOverdue.png', | |||||
statusText: '已过期', | |||||
flag: false | |||||
}) | |||||
//已过期 | |||||
break; | |||||
case 3: | |||||
that.setData({ | |||||
statusImg: '/static/images/refund.png', | |||||
statusText: '已退款', | |||||
flag: false | |||||
}) | |||||
//已作废 | |||||
break; | |||||
default: | |||||
tt.showToast({ | |||||
title: '数据有误', | |||||
image: '../../static/images/fail.png' | |||||
}) | |||||
} | |||||
console.log(res) | |||||
console.log("我是请求回来的数据") | |||||
that.setData({ | |||||
couponOrderDetail: res.data | |||||
}) | |||||
} else { | |||||
tt.reLaunch({ | |||||
url: 'pages/main/writeoffPage/errorPage/errorPage', | |||||
}) | |||||
} | } | ||||
console.log(res) | |||||
console.log("我是请求回来的数据") | |||||
that.setData({ | |||||
couponOrderDetail: res.data | |||||
}) | |||||
} else { | |||||
tt.reLaunch({ | |||||
url: 'pages/main/writeoffPage/errorPage/errorPage', | |||||
}) | |||||
} | |||||
}) | |||||
}) | |||||
}, | }, | ||||
user() { | user() { | ||||
console.log(tt.getStorageSync("verifyRemark")) | console.log(tt.getStorageSync("verifyRemark")) | ||||
// return | // return | ||||
Common.couponOrderVerify(this.data.couponOrderId, tt.getStorageSync("verifyRemark")) | |||||
.then(res => { | |||||
console.log(res) | |||||
if (res.code == 200) { | |||||
tt.redirectTo({ | |||||
url: '../success/success', | |||||
}) | |||||
}else{ | |||||
Common.couponOrderVerify(this.data.couponOrderId, this.data.couponTenantId, tt.getStorageSync("verifyRemark")) | |||||
.then(res => { | |||||
console.log(res) | |||||
if (res.code == 200) { | |||||
tt.redirectTo({ | |||||
url: '../success/success', | |||||
}) | |||||
} else { | |||||
tt.showModal({ | |||||
title: '抱歉', | |||||
content: res.message, | |||||
showCancel: false | |||||
}) | |||||
} | |||||
}) | |||||
.catch(error => { | |||||
console.log(error) | |||||
tt.showModal({ | tt.showModal({ | ||||
title: '抱歉', | title: '抱歉', | ||||
content: res.message, | |||||
showCancel:false | |||||
content: error.message, | |||||
showCancel: false | |||||
}) | }) | ||||
} | |||||
}) | |||||
.catch(error=>{ | |||||
console.log(error) | |||||
tt.showModal({ | |||||
title: '抱歉', | |||||
content: error.message, | |||||
showCancel: false | |||||
}) | }) | ||||
}) | |||||
}, | }, | ||||
reBuck() { | reBuck() { | ||||
tt.switchTab({ | tt.switchTab({ | ||||
@@ -1,6 +1,6 @@ | |||||
{ | { | ||||
"setting": { | "setting": { | ||||
"urlCheck": true, | |||||
"urlCheck": false, | |||||
"es6": true, | "es6": true, | ||||
"newFeature": false, | "newFeature": false, | ||||
"postcss": false, | "postcss": false, | ||||
@@ -16,17 +16,7 @@ | |||||
"condition": { | "condition": { | ||||
"miniprogram": { | "miniprogram": { | ||||
"current": -1, | "current": -1, | ||||
"list": [ | |||||
{ | |||||
"id": 1637139224806, | |||||
"name": "11", | |||||
"pathName": "pages/orderUrl/orderUrl", | |||||
"query": "", | |||||
"scene": "990001", | |||||
"launchFrom": "scan", | |||||
"location": "qr_code" | |||||
} | |||||
] | |||||
"list": [] | |||||
} | } | ||||
} | } | ||||
} | |||||
} |
@@ -0,0 +1,27 @@ | |||||
{ | |||||
"condition": { | |||||
"miniprogram": { | |||||
"current": -1, | |||||
"list": [ | |||||
{ | |||||
"id": 1687232092199, | |||||
"name": "pages/Appointment/appointment", | |||||
"pathName": "pages/Appointment/appointment", | |||||
"query": "", | |||||
"scene": "990001", | |||||
"launchFrom": "scan", | |||||
"location": "qr_code" | |||||
}, | |||||
{ | |||||
"id": 1687252858255, | |||||
"name": "pages/appointDetail/appointDetail", | |||||
"pathName": "pages/appointDetail/appointDetail", | |||||
"query": "id=831011125579538432", | |||||
"scene": "990001", | |||||
"launchFrom": "scan", | |||||
"location": "qr_code" | |||||
} | |||||
] | |||||
} | |||||
} | |||||
} |
@@ -8,10 +8,11 @@ function convertUTCTimeToLocalTime(UTCDateString) { | |||||
if (!UTCDateString) { | if (!UTCDateString) { | ||||
return '-'; | return '-'; | ||||
} | } | ||||
function formatFunc(str) { //格式化显示 | |||||
function formatFunc(str) { //格式化显示 | |||||
return str > 9 ? str : '0' + str | return str > 9 ? str : '0' + str | ||||
} | } | ||||
var date2 = new Date(UTCDateString); //这步是关键 | |||||
var date2 = new Date(UTCDateString); //这步是关键 | |||||
var year = date2.getFullYear(); | var year = date2.getFullYear(); | ||||
var mon = formatFunc(date2.getMonth() + 1); | var mon = formatFunc(date2.getMonth() + 1); | ||||
var day = formatFunc(date2.getDate()); | var day = formatFunc(date2.getDate()); | ||||
@@ -20,7 +21,7 @@ function convertUTCTimeToLocalTime(UTCDateString) { | |||||
hour = hour >= 24 ? hour - 24 : hour; | hour = hour >= 24 ? hour - 24 : hour; | ||||
hour = formatFunc(hour); | hour = formatFunc(hour); | ||||
var min = formatFunc(date2.getMinutes()); | var min = formatFunc(date2.getMinutes()); | ||||
var dateStr = ' ' + hour + ':' + min ; | |||||
var dateStr = ' ' + hour + ':' + min; | |||||
return dateStr; | return dateStr; | ||||
} | } | ||||
@@ -29,15 +30,15 @@ function convertUTCTimeToLocalTime(UTCDateString) { | |||||
// return new Date(+new Date(dateee) + 8 * 3600 * 1000).toISOString().replace(/T/g, ' ').replace(/\.[\d]{3}Z/, ''); | // return new Date(+new Date(dateee) + 8 * 3600 * 1000).toISOString().replace(/T/g, ' ').replace(/\.[\d]{3}Z/, ''); | ||||
// } | // } | ||||
function moodsText(Num){//人气值处理 Num人气值 返回字符串 处理到万位 | |||||
function moodsText(Num) { //人气值处理 Num人气值 返回字符串 处理到万位 | |||||
let sing = "" | let sing = "" | ||||
if(Num>10000){ | |||||
sing = (Num/10000).toFixed(2)+"w" | |||||
}else{ | |||||
sing =Num | |||||
} | |||||
return sing | |||||
if (Num > 10000) { | |||||
sing = (Num / 10000).toFixed(2) + "w" | |||||
} else { | |||||
sing = Num | |||||
} | |||||
return sing | |||||
} | } | ||||
const formatTime = (date, fmt) => { | const formatTime = (date, fmt) => { | ||||
@@ -69,9 +70,9 @@ const formatTime = (date, fmt) => { | |||||
if (new RegExp("(" + k + ")").test(fmt)) | if (new RegExp("(" + k + ")").test(fmt)) | ||||
fmt = fmt.replace( | fmt = fmt.replace( | ||||
RegExp.$1, | RegExp.$1, | ||||
RegExp.$1.length == 1 | |||||
? o[k] | |||||
: ("00" + o[k]).substr(("" + o[k]).length) | |||||
RegExp.$1.length == 1 ? | |||||
o[k] : | |||||
("00" + o[k]).substr(("" + o[k]).length) | |||||
); | ); | ||||
return fmt; | return fmt; | ||||
} catch (error) { | } catch (error) { | ||||
@@ -97,6 +98,61 @@ function barc(id, code, width, height) { | |||||
); | ); | ||||
} | } | ||||
/** | |||||
* @description 根据时间戳获取时间 | |||||
* @param {*} timestamp 必传,number类型,时间戳数据(10位及以下,10位至13位);若不传,则返回:“无时间戳” | |||||
* @param {*} format 选传,string类型,提供以下时间格式:YYYY-MM-DD hh:mm:ss、YYYY/MM/DD hh:mm:ss、YYYY.MM.DD hh:mm:ss、YYYY MM DD hh:mm:ss、YYYY年MM月DD日 hh:mm:ss、YYYY-MM-DD、YYYY/MM/DD、YYYY.MM.DD、YYYY MM DD、YYYY年MM月DD日、hh:mm:ss、hh:mm;若不传,则默认为:YYYY-MM-DD | |||||
* @returns 根据要求的时间格式 | |||||
* @version V 1.0, Created by YWQ, 2022.10.20 | |||||
*/ | |||||
function timestampToTime(timestamp, format) { | |||||
if (!timestamp) return false | |||||
//时间戳为10位需*1000,时间戳为13位不需乘1000 | |||||
const length = timestamp ? timestamp.length : '' | |||||
if (length <= 10) { | |||||
var date = new Date(timestamp * 1000) | |||||
} else { | |||||
var date = new Date(timestamp) | |||||
} | |||||
let Y = String(date.getFullYear()) | |||||
let M = String(date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) | |||||
let D = String(date.getDate() + 1 < 10 ? '0' + (date.getDate()) : date.getDate()) | |||||
let h = String(date.getHours() + 1 < 10 ? '0' + (date.getHours()) : date.getHours()) | |||||
let m = String(date.getMinutes() + 1 < 10 ? '0' + (date.getMinutes()) : date.getMinutes()) | |||||
let s = String(date.getSeconds() + 1 < 10 ? '0' + (date.getSeconds()) : date.getSeconds()) | |||||
// return Y + M + D + h + m + s | |||||
if (format == "YYYY-MM-DD hh:mm:ss") { | |||||
return Y + "-" + M + "-" + D + " " + h + ":" + m + ":" + s | |||||
} else if (format == "YYYY/MM/DD hh:mm:ss") { | |||||
return Y + "/" + M + "/" + D + " " + h + ":" + m + ":" + s | |||||
} else if (format == "YYYY.MM.DD hh:mm:ss") { | |||||
return Y + "." + M + "." + D + " " + h + ":" + m + ":" + s | |||||
} else if (format == "YYYY MM DD hh:mm:ss") { | |||||
return Y + " " + M + " " + D + " " + h + ":" + m + ":" + s | |||||
} else if (format == "YYYY年MM月DD日 hh:mm:ss") { | |||||
return Y + "年" + M + "月" + D + "日" + " " + h + ":" + m + ":" + s | |||||
} else if (format == "YYYY-MM-DD") { | |||||
return Y + "-" + M + "-" + D | |||||
} else if (format == "YYYY/MM/DD") { | |||||
return Y + "/" + M + "/" + D | |||||
} else if (format == "YYYY.MM.DD") { | |||||
return Y + "." + M + "." + D | |||||
} else if (format == "YYYY MM DD") { | |||||
return Y + " " + M + " " + D | |||||
} else if (format == "YYYY年MM月DD日") { | |||||
return Y + "年" + M + "月" + D + "日" | |||||
} else if (format == "hh:mm:ss") { | |||||
return h + ":" + m + ":" + s | |||||
} else if (format == "hh:mm") { | |||||
return h + ":" + m | |||||
} else { | |||||
return Y + "-" + M + "-" + D | |||||
} | |||||
} | |||||
function qrc(id, code, width, height) { | function qrc(id, code, width, height) { | ||||
qrcode.api.draw(code, { | qrcode.api.draw(code, { | ||||
ctx: tt.createCanvasContext(id), | ctx: tt.createCanvasContext(id), | ||||
@@ -137,20 +193,20 @@ function timechuo(startTime) { | |||||
var minute = Math.floor(runTime / 60); | var minute = Math.floor(runTime / 60); | ||||
var runTime = runTime % 60; | var runTime = runTime % 60; | ||||
var second = runTime; | var second = runTime; | ||||
if (day && !year && !month){ | |||||
if (day && !year && !month) { | |||||
return (day + '天' + hour + "小时" + minute + "分钟") | return (day + '天' + hour + "小时" + minute + "分钟") | ||||
} else if (month && !year){ | |||||
return ((month*30+day) +'天' + hour + "小时" + minute + "分钟") | |||||
} else if (month && !year) { | |||||
return ((month * 30 + day) + '天' + hour + "小时" + minute + "分钟") | |||||
} else if (year) { | } else if (year) { | ||||
return ((year*365 + month*30+ day) + '天' + hour + "小时" + minute + "分钟") | |||||
}else{ | |||||
return ((year * 365 + month * 30 + day) + '天' + hour + "小时" + minute + "分钟") | |||||
} else { | |||||
return (hour + "小时" + minute + "分钟") | return (hour + "小时" + minute + "分钟") | ||||
} | } | ||||
} | } | ||||
//计算时间差 | //计算时间差 | ||||
function timecha(endTime,startTime) { | |||||
function timecha(endTime, startTime) { | |||||
var s1 = new Date(endTime.replace(/-/g, "/")); | var s1 = new Date(endTime.replace(/-/g, "/")); | ||||
var s2 = new Date(startTime.replace(/-/g, "/")); | var s2 = new Date(startTime.replace(/-/g, "/")); | ||||
var runTime = parseInt((s1.getTime() - s2.getTime()) / 1000); | var runTime = parseInt((s1.getTime() - s2.getTime()) / 1000); | ||||
@@ -165,8 +221,9 @@ function timecha(endTime,startTime) { | |||||
var minute = Math.floor(runTime / 60); | var minute = Math.floor(runTime / 60); | ||||
var runTime = runTime % 60; | var runTime = runTime % 60; | ||||
var second = runTime; | var second = runTime; | ||||
return (month+"月"+day+"天"+hour+"小时"+minute+"分钟") | |||||
return (month + "月" + day + "天" + hour + "小时" + minute + "分钟") | |||||
} | } | ||||
function isJSON(str) { | function isJSON(str) { | ||||
if (typeof str == 'string') { | if (typeof str == 'string') { | ||||
console.log("string") | console.log("string") | ||||
@@ -202,6 +259,7 @@ module.exports = { | |||||
// fmtDate: fmtDate, | // fmtDate: fmtDate, | ||||
timechuo: timechuo, | timechuo: timechuo, | ||||
timecha: timecha, | timecha: timecha, | ||||
moodsText:moodsText, | |||||
convertUTCTimeToLocalTime: convertUTCTimeToLocalTime | |||||
}; | |||||
moodsText: moodsText, | |||||
convertUTCTimeToLocalTime: convertUTCTimeToLocalTime, | |||||
timestampToTime: timestampToTime | |||||
}; |