Initial commit

This commit is contained in:
小鱼开发
2024-05-24 14:16:05 +08:00
commit 3bf5c948d8
368 changed files with 44954 additions and 0 deletions
+33
View File
@@ -0,0 +1,33 @@
# 狸车宝项目
## 账号密码
//狸车宝
wx71095d4049de3ed1
a80eb6ed68d7bae2d804fe507a4522f7
//好店云
wx8edd43f384bc39c4
测试账号:15359333655,没验证码
测试账号
账号:15359333655
验证码:888888
## 状态码规范
参数 | 类型 | 描述
------------ | ------------- | ------------
200 | Number | 成功状态码,服务器正常处理
401 | Number | 认证信息失败,也就是token(ukey)失败
402 | Number | 授权解密数据失败
400 | Number | 服务端错误(除了40x中规定的错误状态,其他错误统一返回400)
## 页面访问路径
/pages/login/index //登录
+157
View File
@@ -0,0 +1,157 @@
import log from './commons/js/utils/log'
App({
onLaunch: function () {
let that = this;
this.updateVersion()
wx.getSystemInfo({
success(res) {
console.log(res)
if(!!res.environment&&res.environment=='wxwork'){
console.log('当前企业微信')
}
that.globalData.statusBarHeight = res.statusBarHeight;
that.globalData.screenHeight = res.screenHeight;
that.globalData.screenWidth = res.screenWidth;
if (res.platform == "devtools") {
that.globalData.platform = "android";
} else {
that.globalData.platform = res.platform
}
}
})
wx.onMemoryWarning(function () {
let getPath = getCurrentPages()
let currentPage = getPath[getPath.length - 1]
wx.reportAnalytics('outofmemory', {
pages: getPath, //获取所有页面
url: currentPage.route, //当前页面url
options: currentPage.options //如果要获取url中所带的参数可以查看options
})
that.printErrorClient('filteroutofmemory')
wx.reportMonitor('0', 500)
wx.reLaunch(currentPage.route)
})
},
onHide: function () {
if (wx.canIUse('offMemoryWarning')) {
wx.offMemoryWarning()
// this.printErrorClient('offmemory')
} else {
this.printErrorClient('offmemorylowversion')
console.warn('当前微信版本' + wx.getSystemInfoSync().SDKVersion + '过低,无法使用该功能,请升级到最新微信版本后重试。')
}
},
onPageNotFound(res) {
this.printErrorClient('404notfound',['错误信息:'+JSON.stringify(res)])
if (res.path == 'pages/detail/detail') {
this.errorPageRedirect('/pages/index/index', '抱歉,该页面已迁移,请在搜索页查询...')
} else if (res.path == 'pages/card/card' || res.path == 'pages/mine/mine') {
this.errorPageRedirect('/pages/mine/index')
} else {
this.errorPageRedirect('/pages/index/index', '抱歉,该页面无法访问,正在回到首页...')
}
},
initNum: 0,
globalData: {
loginRuning: false,
loginCollect: [],
userInfo: '',
location: '',
ukey: "",
statusBarHeight: 20,
screenHeight: 0,
screenWidth: 0,
platform: '',
},
setStorage: function (key, data, callback = function () {}, reject = function () {}) {
try {
wx.setStorageSync(key, data);
this.globalData[key] = data;
callback(data)
} catch (e) {
reject(e)
}
},
getStorageByKey: function (key) {
var storage;
if (!!this.globalData[key]) {
return this.globalData[key];
} else {
try {
const value = wx.getStorageSync(key)
if (value) {
storage = value;
return storage;
}
} catch (e) {
console.warn("getStorageByKey-fail:" + key);
}
}
return !!storage ? storage : "";
},
errorPageRedirect(URL, TITLE = '正在跳转,请稍候...') {
wx.showToast({
title: TITLE,
icon: 'none',
duration: 2000,
success: function () {
setTimeout(function () {
wx.reLaunch({
url: URL
})
}, 2000)
}
})
},
/**
* 打印客户端信息
*/
printErrorClient(MSGNAME, ER = []) {
log.setFilterMsg(MSGNAME)
let pages = getCurrentPages() //获取加载的页面
if(pages.length>0){
let currentPage = pages[pages.length - 1] //获取当前页面的对象
log.warn('当前页面:' + currentPage.route)
log.info('路径:' + JSON.stringify(pages))
}else{
log.warn('当前页面不在app.json列表里')
}
let systemInfo = wx.getSystemInfoSync()
log.info('设备型号:' + systemInfo.model)
log.info('微信版本号:' + systemInfo.version)
log.info('操作系统及版本:' + systemInfo.system)
log.info('客户端平台:' + systemInfo.platform)
log.info('客户端基础库版本:' + systemInfo.SDKVersion)
log.info('地理位置的系统开关:' + systemInfo.locationEnabled)
log.info('客户端Ukey' + wx.getStorageSync('ukey'))
log.info('客户端Userinfo' + JSON.stringify(wx.getStorageSync('userInfo')))
for(let i =0;i<ER.length;i++){
log.info(ER[i])
}
},
updateVersion() {
const updateManager = wx.getUpdateManager()
updateManager.onCheckForUpdate(function (res) {
// 请求完新版本信息的回调
})
updateManager.onUpdateReady(function () {
wx.showModal({
title: '更新提示',
content: '新版本已经准备好,\n是否重启应用?',
success: function (res) {
if (res.confirm) {
// 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
updateManager.applyUpdate()
}
}
})
})
updateManager.onUpdateFailed(function () {
// 新版本下载失败
})
}
})
+103
View File
@@ -0,0 +1,103 @@
{
"pages": [
"pages/login/index",
"pages/index/index",
"pages/customer/index",
"pages/order/index",
"pages/web-view/index",
"pages/mine/index",
"pages/customer/addCard/index",
"pages/customer/detail/index",
"pages/order/register/index",
"pages/order/detail/index",
"pages/mine/install/index",
"pages/mine/install/staff/index",
"pages/customer/filterList/index",
"pages/order/filterList/index",
"pages/customer/allot/index",
"pages/distribute/index",
"pages/distribute/cashout/index",
"pages/distribute/material/index",
"pages/distribute/reward/index",
"pages/distribute/statistics/index",
"pages/distribute/assets/index",
"pages/customer/editCard/index",
"pages/channel/index",
"pages/dataAnalysis/index",
"pages/distribute/special/index",
"pages/customer/optDefeat/index",
"pages/order/edit/index",
"pages/distribute/storePoster/index",
"pages/distribute/storePoster/modelList/index",
"pages/allot/detail/index",
"pages/allot/list/index",
"pages/audioPlay/index",
"pages/recommend/index",
"pages/allot/index",
"pages/storeInfo/index",
"pages/order/detail/index2",
"pages/order/edit/index2",
"pages/order/editOwner/index",
"pages/order/filterList/index2",
"pages/siyutong/index",
"pages/siyutong/activityDetail/index",
"pages/siyutong/activityRanking/index",
"pages/inventory/detail/index",
"pages/inventory/list/index",
"pages/inventory/warning/index",
"pages/order/editFinance/index",
"pages/statement/registration/index",
"pages/statement/privacy/index",
"pages/order/editCardid/index",
"pages/order/editBusinessBicence/index",
"pages/order/editLicenseImg/index",
"pages/order/editInsImg/index",
"pages/order/editOtherImg/index",
"pages/storeData/index",
"pages/storeData/customerData/index",
"pages/storeData/wechatData/index",
"pages/storeData/orderData/index",
"pages/order/editDeliveryckimg/index",
"pages/order/editQVImg/index",
"pages/order/editVoucherImg/index",
"pages/dataAnalysis/detail/index",
"pages/order/editBuyer/index",
"pages/storeData/subData/index"
],
"echarts": [
{
"root": "ecCanvas",
"pages": [
"pages/index/index"
]
}
],
"window": {
"backgroundTextStyle": "light",
"navigationBarBackgroundColor": "#fff",
"navigationBarTitleText": "狸车宝",
"navigationBarTextStyle": "black"
},
"sitemapLocation": "sitemap.json",
"usingComponents": {
"lcb-msg": "/components/msg/index",
"lcb-auth": "/components/auth/index",
"lcb-navBar": "/components/navBar/navBar",
"lcb-footer": "/components/footer/footer",
"lcb-listmore": "/components/listMore/index",
"lcb-channelTabBarNav": "/components/channel-tab-bar/index",
"lcb-shopTabBarNav": "/components/shop-tab-bar/index",
"lcb-backChannel": "/components/backChannel/index",
"QYWXcontact": "plugin://contactPlugin/cell",
"kefuSuccess": "/components/kefuSuccess/index"
},
"plugins": {
"contactPlugin": {
"version": "1.4.1",
"provider": "wx104a1a20c3f81ec2"
}
},
"navigateToMiniProgramAppIdList": [
"wx98e64c11aac45966"
]
}
+5
View File
@@ -0,0 +1,5 @@
/**app.wxss**/
@import "commons/css/common.wxss";
page{
background-color:#fff;
}
+83
View File
@@ -0,0 +1,83 @@
@-webkit-keyframes zoomIn {
0% {
opacity:0;
-webkit-transform:scale3d(.3, .3, .3);
transform:scale3d(.3, .3, .3)
}
50% {
opacity:1
}
}
@keyframes zoomIn {
0% {
opacity:0;
-webkit-transform:scale3d(.3, .3, .3);
transform:scale3d(.3, .3, .3)
}
50% {
opacity:1
}
}
.zoomIn {
-webkit-animation-name:zoomIn;
animation-name:zoomIn
}
@-webkit-keyframes zoomOut {
0% {
opacity:1
}
50% {
opacity:0;
-webkit-transform:scale3d(.3, .3, .3);
transform:scale3d(.3, .3, .3)
}
to {
opacity:0
}
}
@keyframes zoomOut {
0% {
opacity:1
}
50% {
opacity:0;
-webkit-transform:scale3d(.3, .3, .3);
transform:scale3d(.3, .3, .3)
}
to {
opacity:0
}
}
.zoomOut {
-webkit-animation-name:zoomOut;
animation-name:zoomOut
}
@-webkit-keyframes slideInDown {
0% {
-webkit-transform:translate3d(0, -100%, 0);
transform:translate3d(0, -100%, 0);
visibility:visible
}
to {
-webkit-transform:translateZ(0);
transform:translateZ(0)
}
}
@keyframes slideInDown {
0% {
-webkit-transform:translate3d(0, -100%, 0);
transform:translate3d(0, -100%, 0);
visibility:visible
}
to {
-webkit-transform:translateZ(0);
transform:translateZ(0)
}
}
.slideInDown {
-webkit-animation-name:slideInDown;
animation-name:slideInDown
}
+42
View File
@@ -0,0 +1,42 @@
.bg-fff{background-color:#fff;}
.bg-f6{background-color:#f6f6f6;}
.bg-f7{background-color:#f7f7f7;}
.bg-f8{background-color:#f8f8f8;}
.bg-e4{background-color:#e4e4e4;}
.bg-ccc{background-color:#ccc;}
.bg-666{background-color:#666;}
.bg-999{background-color:#999;}
.bg-333{background-color:#333;}
.bg-1a{background-color: #1a1a1a;}
.bg-36afa2{background-color:#36afa2;}
.bg-f9394d{background-color:#f9394d;}
.bg-3f4047{background-color:#3f4047;}
.bg-000-op30{background-color:rgba(0,0,0,.3);}
.bg-000-op50{background-color:rgba(0,0,0,.5);}
.bg-000-op60{background-color:rgba(0,0,0,.6);}
.bg-000-op80{background-color:rgba(0,0,0,.8);}
.bg-f00-op50{background-color:rgba(255,0,0,.5);}
.bg-fff-op20{background-color:rgba(255,255,255,.2);}
.bg-fff-op50{background-color:rgba(255,255,255,.5);}
.bg-fff-op80{background-color:rgba(255,255,255,.8);}
.bg-fff-op90{background-color:rgba(255,255,255,.9);}
.bg-fff-op95{background-color:rgba(255,255,255,.95);}
.bg-000-gradual-30-60{background-image:linear-gradient(rgba(0,0,0,.3),rgba(0,0,0,.6));}
.bg-2f3346-1a1c26{background-image:linear-gradient(#2f3346,#1a1c26);}
.bg-f6-fff{background-image:linear-gradient(#f6f6f6,#fff);}
.bg-f3f6fc{background-color:#f3f6fc;}
.bg-fffaeb{background-color:#fffaeb;}
.bg-f1f9f8{background-color:#f1f9f8;}
.bg-fff6f8{background-color:#fff6f8;}
.bg-e3f5f3{background-color:#e3f5f3;}
.bg-2e3246{background-color:#2e3246;}
.bg-ffedeb{background-color:#ffedeb;}
.bg-f0f4ff{background-color:#f0f4ff;}
.bg-fffaf3{background-color:#fffaf3;}
+27
View File
@@ -0,0 +1,27 @@
.bds-2-96dda2{border:#96dda2 2rpx solid;box-sizing:border-box;}
.bts-20-f8{border-top:#f8f8f8 20rpx solid;box-sizing:border-box;}
.bts-20-f7{border-top:#f7f7f7 20rpx solid;box-sizing:border-box;}
.bts-1-eb{border-top:#ebebeb 1rpx solid;box-sizing:border-box;}
.bls-1-eb{border-left:#ebebeb 1rpx solid; box-sizing:border-box;}
.brs-1-eb{border-right:#ebebeb 1rpx solid; box-sizing:border-box;}
.bbs-1-eb{border-bottom:#ebebeb 1rpx solid; box-sizing:border-box;}
.bds-1-eb{border:#ebebeb 1rpx solid; box-sizing:border-box;}
.btd-1-eb{border-top:#ebebeb 1rpx dashed;box-sizing:border-box;}
.bds-2-eb{border:#ebebeb 2rpx solid; box-sizing:border-box;}
.bds-2-fff{border:#fff 2rpx solid; box-sizing:border-box;}
.bds-7dbeeb{border:#7dbeeb 1rpx solid;box-sizing:border-box;}
.bds-2-36afa2{border:#36afa2 2rpx solid;box-sizing:border-box;}
.bts-2-36afa2{border-top:#36afa2 2rpx solid;box-sizing:border-box;}
.bls-2-36afa2{border-left:#36afa2 2rpx solid;box-sizing:border-box;}
.brs-2-36afa2{border-right:#36afa2 2rpx solid;box-sizing:border-box;}
.bbs-2-36afa2{border-bottom:#36afa2 2rpx solid;box-sizing:border-box;}
.bds-2-f9394d{border:#f9394d 2rpx solid;box-sizing:border-box;}
.bts-1-474a65{border-top:#474a65 1rpx solid; box-sizing:border-box;}
.bbs-1-474a65{border-bottom:#474a65 1rpx solid; box-sizing:border-box;}
.last-b-none:last-child{border-bottom:none;}
+21
View File
@@ -0,0 +1,21 @@
.btn-border-36afa2{background:none;border:none;}
.btn-border-36afa2::after{border:#36afa2 2rpx solid;}
.btn-border-36afa2[disabled]{background:#ddd !important;border:none !important;color:#bbb !important;}
.btn-border-36afa2[disabled]::after{border:#ddd 2rpx solid !important;}
.btn-36afa2{background: #36afa2;border:none;}
.btn-36afa2::after{border:none;}
.btn-36afa2-hover{background:#2fa195;}
.btn-36afa2[disabled]{background:#ddd !important;border:none !important;color:#bbb !important;}
.btn-f9394d{background: #f9394d;border:none;}
.btn-f9394d::after{border:none;}
.btn-f9394d-hover{background:#f0293e;}
.btn-f9394d[disabled]{background:#ddd;border:none;color:#bbb;}
.btn-999{background:#999;border:none;}
.btn-999::after{border:none;}
.btn-999-hover{background:#a7a6a6;}
.btn-999[disabled]{background:#999 !important;border:none !important;}
.btn-no-border{border:none;}
.btn-no-border::after{border:none;}
.btn-no-border[disabled]{background:#ddd !important;border:none;color:#bbb;}
.btn-no-bg{background:none;}
.btn-inset-shadow{box-shadow:inset 0rpx 0rpx 10rpx 5rpx rgba(0, 0, 0, .2);}
+17
View File
@@ -0,0 +1,17 @@
.color-fff{color:#fff;}
.color-f8{color:#f8f8f8;}
.color-e4e4e4{color:#e4e4e4;}
.color-1a{color:#1a1a1a;}
.color-333{color:#333;}
.color-666{color:#666;}
.color-777{color:#777;}
.color-888{color:#888;}
.color-999{color:#999;}
.color-aaa{color:#aaa;}
.color-bbb{color:#bbb;}
.color-ccc{color:#ccc;}
.color-f9394d{color:#f9394d;}
.color-fe4109{color:#fe4109;}
.color-36afa2{color:#36afa2;}
.color-00c800{color:#00c800;}
.color-575b6a{color:#575b6a;}
+30
View File
@@ -0,0 +1,30 @@
.font-10{font-size:16rpx;}
.font-16{font-size:16rpx;}
.font-18{font-size:18rpx;}
.font-20{font-size:20rpx;}
.font-22{font-size:22rpx;}
.font-24{font-size:24rpx;}
.font-26{font-size:26rpx;}
.font-28{font-size:28rpx;}
.font-30{font-size:30rpx;}
.font-32{font-size:32rpx;}
.font-34{font-size:34rpx;}
.font-36{font-size:36rpx;}
.font-38{font-size:38rpx;}
.font-40{font-size:40rpx;}
.font-42{font-size:42rpx;}
.font-44{font-size:44rpx;}
.font-48{font-size:48rpx;}
.font-50{font-size:50rpx;}
.font-52{font-size:52rpx;}
.font-54{font-size:54rpx;}
.font-56{font-size:56rpx;}
.font-60{font-size:60rpx;}
.font-64{font-size:64rpx;}
.font-66{font-size:66rpx;}
.font-72{font-size:72rpx;}
.font-75{font-size:75rpx;}
.font-80{font-size:80rpx;}
.font-90{font-size:90rpx;}
.font-120{font-size:120rpx;}
.font-180{font-size:180rpx;}
+34
View File
@@ -0,0 +1,34 @@
.img-24x24{width:24rpx;height:24rpx;box-sizing:border-box;}
.img-45x45{width:45rpx;height:45rpx;box-sizing:border-box;}
.img-50x50{width:50rpx;height:50rpx;box-sizing:border-box;}
.img-55x55{width:55rpx;height:55rpx;box-sizing:border-box;}
.img-55x65{width:55rpx;height:65rpx;box-sizing:border-box;}
.img-60x60{width:60rpx;height:60rpx;box-sizing:border-box;}
.img-65x65{width:65rpx;height:65rpx;box-sizing:border-box;}
.img-70x70{width:70rpx;height:70rpx;box-sizing:border-box;}
.img-72x72{width:72rpx;height:72rpx;box-sizing:border-box;}
.img-80x80{width:80rpx;height:80rpx;box-sizing:border-box;}
.img-90x90{width:90rpx;height:90rpx;box-sizing:border-box;}
.img-100x100{width:100rpx;height:100rpx;box-sizing:border-box;}
.img-120x120{width:120rpx;height:120rpx;box-sizing:border-box;}
.img-125x75{width:125rpx;height:75rpx;box-sizing:border-box;}
.img-130x130{width:130rpx;height:130rpx;box-sizing:border-box;}
.img-135x135{width:135rpx;height:135rpx;box-sizing:border-box;}
.img-140x140{width:140rpx;height:140rpx;box-sizing:border-box;}
.img-160x160{width:160rpx;height:160rpx;box-sizing:border-box;}
.img-190x175{width:190rpx;height:175rpx;box-sizing:border-box;}
.img-200x180{width:200rpx;height:180rpx;box-sizing:border-box;}
.img-208x170{width:208rpx;height:170rpx;box-sizing:border-box;}
.img-220x200{width:220rpx;height:200rpx;box-sizing:border-box;}
.img-250x150{width:250rpx;height:150rpx;box-sizing:border-box;}
.img-250x250{width:250rpx;height:250rpx;box-sizing:border-box;}
.img-250x445{width:250rpx;height:445rpx;box-sizing:border-box;}
.img-300x200{width:300rpx;height:200rpx;box-sizing:border-box;}
.img-300x230{width:300rpx;height:230rpx;box-sizing:border-box;}
.img-750x250{width:750rpx;height:250rpx;box-sizing:border-box;}
.img-750x422{width:100%;height:422rpx;box-sizing:border-box;}
.img-h-200{height:200rpx;box-sizing:border-box;}
.img-w-260{width:260rpx;box-sizing:border-box;}
.img-w-280{width:280rpx;box-sizing:border-box;}
.img-h-400{height:400rpx;box-sizing:border-box;}
+136
View File
@@ -0,0 +1,136 @@
.h-100vh{height:100vh;}
.h-30vh{height:30vh;}
.h-70vh{height:70vh;}
.minh-100vh{min-height:100vh;box-sizing:border-box;}
.h-90vh{height:90vh;}
/*layout float*/
.fn-clear:before,.fn-clear:after{content:"";display:table;}
.fn-clear:after{clear:both;}
.fn-clear{zoom:1;}
.fn-fl{float:left;}
.fn-fr{float:right;}
.fn-hide{display:none;}
/*layout display*/
.block{display:block;}
.inline-block{display:inline-block;}
.overflowhidden{overflow:hidden;}
.overflowXhidden{overflow-x:hidden;}
.overflow-initial{overflow:initial;}
.opacity-0{opacity:0;}
.opacity-50{opacity:.5;}
.opacity-80{opacity:.8;}
/*line-clamp*/
.line-clamp-2{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;}
.line-clamp-3{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:3;overflow:hidden;}
/*layout flex*/
.fn-flex{display:flex;flex-flow:row;align-items:stretch;}
.fn-flex-item{display:block;flex:1;}
.fn-flex-item.flexsize2{flex:2;}
.fn-flex-item.flexsize3{flex:3;}
.fn-flex-item.flexsize4{flex:4;}
.fn-flex-item.flexsize5{flex:5;}
.fn-flex-item.flexsize6{flex:6;}
.fn-flex-item.flexsize7{flex:7;}
.fn-flex-item.flexsize8{flex:8;}
.fn-flex-item.flexsize9{flex:9;}
.fn-flex-itemfixed{flex:0 0 auto;}
.fn-flex-between{justify-content: space-between;}/*两端对齐*/
.fn-flex-wrap{flex-wrap:wrap}/*多行*/
.fn-flex-around{justify-content: space-around;}/*各项周围留有空白*/
.fn-flex-middle{align-items:center;}/*交叉轴上上下居中对齐*/
.fn-flex-center{justify-content: center;}/*居中对齐*/
.wp25{width:25%;box-sizing:border-box;}
.wp31{width:31%;box-sizing:border-box;}
.wp33{width:33%;box-sizing:border-box;}
.wp40{width:40%;box-sizing:border-box;}
.wp45{width:45%;box-sizing:border-box;}
.wp50{width:50%;box-sizing:border-box;}
.wp60{width:60%!important;box-sizing:border-box;}
.wp65{width:65%!important;box-sizing:border-box;}
.wp70{width:70%!important;box-sizing:border-box;}
.wp80{width:80%!important;box-sizing:border-box;}
.wp90{width:90%;box-sizing:border-box;}
.wp100{width:100%;box-sizing:border-box;}
.wp110{width:110%;box-sizing:border-box;}
.box-x-scroll{overflow-x:auto;}
.img-top-cover{background-repeat:no-repeat;background-position:center top;background-size:100% auto;}
.img-bottom-cover{background-repeat:no-repeat;background-position:center bottom;background-size:100% auto;}
.img-center-cover{background-repeat:no-repeat;background-position:center center;background-size:100% auto;}
.img-middle-cover{background-repeat:no-repeat;background-position:center center;background-size:auto 100%;}
.img-fill-cover{background-repeat:no-repeat;background-position:center center;background-size:100% 100%;}
.img-center-middle-100{position:absolute;top:50%;left:50%;max-width:100%;max-height:100%;transform:translate(-50%,-50%);}
.fiximg{max-width:100%;}
.box-shadow-000-3-5{box-shadow:0 0 3rpx rgba(0,0,0,.05);}
.box-shadow-000-10-10{box-shadow:0 0 10rpx rgba(0,0,0,.10);}
.box-shadow-000-10-15{box-shadow:0 0 10rpx rgba(0,0,0,.15);}
.box-shadow-000-20-8{box-shadow:0 0 20rpx rgba(0,0,0,.08);}
/*layer*/
.content-pop-cover{position:fixed;top:0;bottom:0;right:0;left:0;background:rgba(0,0,0,0.6);z-index:999; }
.content-pop{position:fixed;top:50%;left:50%;width:84%;transform:translate(-50%,-50%);z-index:1002;}
/*layout position*/
.relative{position:relative;}
.absolute{position:absolute;}
.fixed{position:fixed;z-index:1;}
.top--6{top:-6rpx;}
.top-0{top:0;}
.bottom-0{bottom:0;}
.bottom-120{bottom:120rpx;}
.bottom--67{bottom:-67rpx;}
.left-0{left:0;}
.right-0{right:0;}
.right--10{right:-10rpx;}
.left-p50{left:50%;}
.z-index-0{z-index:0;}
.z-index-1{z-index:1;}
.z-index-2{z-index:2;}
.z-index-3{z-index:3;}
.z-index-4{z-index:4;}
.z-index-9999{z-index:9999;}
.box-center-middle{top:50%;left:50%;transform:translate(-50%,-50%);}
.box-middle{top:50%;transform:translate(0,-50%);}
.box-center{left:50%;transform:translate(-50%,0);}
.container{min-height:calc(100vh - 110rpx);}
.icon-jiazai{display:inline-block;-webkit-animation:rotate linear 1.2s infinite;animation:rotate linear 1.2s infinite;}
@-webkit-keyframes rotate{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}
.line-height-11{line-height:1.1;}
.line-height-12{line-height:1.2;}
.line-height-13{line-height:1.3;}
.line-height-14{line-height:1.4;}
.line-height-15{line-height:1.5;}
.line-height-16{line-height:1.6;}
.line-height-17{line-height:1.7;}
.line-height-18{line-height:1.8;}
.line-height-19{line-height:1.9;}
.line-height-20{line-height:2;}
.rich-text-img{display:bolck;max-width:100% !important;height:auto !important;margin:40rpx 0 20rpx 0 !important;}
.height-80{height:80rpx;box-sizing:border-box;}
.height-90{height:90rpx;box-sizing:border-box;}
.height-100{height:100rpx;box-sizing:border-box;}
.height-120{height:120rpx;box-sizing:border-box;}
.height-190{height:190rpx;box-sizing:border-box;}
.height-240{height:240rpx;box-sizing:border-box;}
.height-400{height:400rpx;box-sizing:border-box;}
.height-500{height:500rpx;box-sizing:border-box;}
.height-600{height:600rpx;box-sizing:border-box;}
.height-800{height:800rpx;box-sizing:border-box;}
.tabmenu{line-height:80rpx;}
.tabmenu.active::before{display:block;position:absolute;bottom:0;left:50%;width:30rpx;height:4rpx;margin-left:-15rpx;content:"";background-color:#36afa2;}
.safe-pb{padding-bottom:calc(constant(safe-area-inset-bottom) - 15px );padding-bottom:calc(env(safe-area-inset-bottom) - 15px);}
.datecell{width:14.28%;padding:30rpx 0;text-align:center;box-sizing:border-box;}
.datecell.active{background-color:#36afa2;color:#fff;}
+80
View File
@@ -0,0 +1,80 @@
.mt0{margin-top:0;}
.mt1{margin-top:1rpx;}
.mt2{margin-top:2rpx;}
.mt5{margin-top:5rpx;}
.mt7{margin-top:7rpx;}
.mt8{margin-top:8rpx;}
.mt9{margin-top:9rpx;}
.mt10{margin-top:10rpx;}
.mt15{margin-top:15rpx;}
.mt20{margin-top:20rpx;}
.mt25{margin-top:25rpx;}
.mt30{margin-top:30rpx;}
.mt40{margin-top:40rpx;}
.mt50{margin-top:50rpx;}
.mt60{margin-top:60rpx;}
.mt68{margin-top:68rpx;}
.mt75{margin-top:75rpx;}
.mt80{margin-top:80rpx;}
.mt90{margin-top:90rpx;}
.mt110{margin-top:110rpx;}
.mt120{margin-top:120rpx;}
.mt130{margin-top:130rpx;}
.mt150{margin-top:150rpx;}
.mt190{margin-top:190rpx;}
.ml-1{margin-left:-1rpx;}
.ml1{margin-left:1rpx;}
.ml5{margin-left:5rpx;}
.ml10{margin-left:10rpx;}
.ml15{margin-left:15rpx;}
.ml20{margin-left:20rpx;}
.ml25{margin-left:25rpx;}
.ml30{margin-left:30rpx;}
.ml35{margin-left:35rpx;}
.ml40{margin-left:40rpx;}
.ml45{margin-left:45rpx;}
.ml50{margin-left:50rpx;}
.ml60{margin-left:60rpx;}
.ml65{margin-left:65rpx;}
.ml70{margin-left:70rpx;}
.ml80{margin-left:80rpx;}
.ml110{margin-left:110rpx;}
.ml140{margin-left:140rpx;}
.ml150{margin-left:150rpx;}
.ml160{margin-left:160rpx;}
.ml180{margin-left:180rpx;}
.ml200{margin-left:200rpx;}
.mr-20{margin-right:-20rpx;}
.mr-30{margin-right:-30rpx;}
.mr1{margin-right:1rpx;}
.mr5{margin-right:5rpx;}
.mr10{margin-right:10rpx;}
.mr11{margin-right:11rpx;}
.mr15{margin-right:15rpx;}
.mr18{margin-right:18rpx;}
.mr20{margin-right:20rpx;}
.mr25{margin-right:25rpx;}
.mr28{margin-right:28rpx;}
.mr30{margin-right:30rpx;}
.mr35{margin-right:35rpx;}
.mr40{margin-right:40rpx;}
.mr50{margin-right:50rpx;}
.mr60{margin-right:60rpx;}
.mr70{margin-right:70rpx;}
.mr150{margin-right:150rpx;}
.mr160{margin-right:160rpx;}
.mr170{margin-right:170rpx;}
.mr180{margin-right:180rpx;}
.mr190{margin-right:190rpx;}
.mb5{margin-bottom:5rpx;}
.mb10{margin-bottom:10rpx;}
.mb15{margin-bottom:15rpx;}
.mb20{margin-bottom:20rpx;}
.mb25{margin-bottom:25rpx;}
.mb30{margin-bottom:30rpx;}
.mb40{margin-bottom:40rpx;}
.mb60{margin-bottom:60rpx;}
.mb100{margin-bottom:100rpx;}
.mb120{margin-bottom:120rpx;}
.mb180{margin-bottom:180rpx;}
.mb200{margin-bottom:200rpx;}
+120
View File
@@ -0,0 +1,120 @@
.inner6{padding:6rpx;}
.inner8{padding:8rpx;}
.inner10{padding:10rpx;}
.inner20{padding:20rpx;}
.inner25{padding:25rpx;}
.inner30{padding:30rpx;}
.inner40{padding:40rpx;}
.inner60{padding:60rpx;}
.pt0{padding-top:0;}
.pt2{padding-top:2rpx;}
.pt3{padding-top:3rpx;}
.pt4{padding-top:4rpx;}
.pt5{padding-top:5rpx}
.pt8{padding-top:8rpx;}
.pt10{padding-top:10rpx;}
.pt15{padding-top:15rpx;}
.pt20{padding-top:20rpx;}
.pt25{padding-top:25rpx;}
.pt30{padding-top:30rpx;}
.pt35{padding-top:35rpx;}
.pt40{padding-top:40rpx;}
.pt45{padding-top:45rpx;}
.pt50{padding-top:50rpx;}
.pt55{padding-top:55rpx;}
.pt60{padding-top:60rpx;}
.pt70{padding-top:70rpx;}
.pt80{padding-top:80rpx;}
.pt90{padding-top:90rpx;}
.pt100{padding-top:100rpx;}
.pt125{padding-top:125rpx;}
.pt140{padding-top:140rpx;}
.pt160{padding-top:160rpx;}
.pt180{padding-top:180rpx;}
.pt200{padding-top:200rpx;}
.pt300{padding-top:300rpx;}
.pt400{padding-top:400rpx;}
.pl0{padding-left:0;}
.pl5{padding-left:5rpx;}
.pl10{padding-left:10rpx;}
.pl15{padding-left:15rpx;}
.pl20{padding-left:20rpx;}
.pl25{padding-left:25rpx;}
.pl28{padding-left:28rpx;}
.pl30{padding-left:30rpx;}
.pl36{padding-left:36rpx;}
.pl40{padding-left:40rpx;}
.pl42{padding-left:42rpx;}
.pl45{padding-left:45rpx;}
.pl50{padding-left:50rpx;}
.pl60{padding-left:60rpx;}
.pl62{padding-left:62rpx;}
.pl70{padding-left:70rpx;}
.pl75{padding-left:75rpx;}
.pl80{padding-left:80rpx;}
.pl90{padding-left:90rpx;}
.pl100{padding-left:100rpx;}
.pl110{padding-left:110rpx;}
.pl120{padding-left:120rpx;}
.pl130{padding-left:130rpx;}
.pl135{padding-left:135rpx;}
.pl140{padding-left:140rpx;}
.pl150{padding-left:150rpx;}
.pl160{padding-left:160rpx;}
.pl170{padding-left:170rpx;}
.pl180{padding-left:180rpx;}
.pl190{padding-left:190rpx;}
.pl200{padding-left:200rpx;}
.pl210{padding-left:210rpx;}
.pl220{padding-left:220rpx;}
.pl260{padding-left:260rpx;}
.pl320{padding-left:320rpx;}
.pr0{padding-right:0;}
.pr5{padding-right:5rpx;}
.pr10{padding-right:10rpx;}
.pr15{padding-right:15rpx;}
.pr20{padding-right:20rpx;}
.pr25{padding-right:25rpx;}
.pr28{padding-right:28rpx;}
.pr30{padding-right:30rpx;}
.pr38{padding-right:38rpx;}
.pr40{padding-right:40rpx;}
.pr42{padding-right:42rpx;}
.pr45{padding-right:45rpx;}
.pr50{padding-right:50rpx;}
.pr60{padding-right:60rpx;}
.pr62{padding-right:62rpx;}
.pr64{padding-right:64rpx;}
.pr80{padding-right:80rpx;}
.pr90{padding-right:90rpx;}
.pr100{padding-right:100rpx;}
.pr110{padding-right:110rpx;}
.pr120{padding-right:120rpx;}
.pr130{padding-right:130rpx;}
.pr150{padding-right:150rpx;}
.pr160{padding-right:160rpx;}
.pr180{padding-right:180rpx;}
.pr200{padding-right:200rpx;}
.pr250{padding-right:250rpx;}
.pb0{padding-bottom:0;}
.pb2{padding-bottom:2rpx;}
.pb5{padding-bottom:5rpx;}
.pb8{padding-bottom:8rpx;}
.pb10{padding-bottom:10rpx;}
.pb15{padding-bottom:15rpx;}
.pb20{padding-bottom:20rpx;}
.pb25{padding-bottom:25rpx;}
.pb30{padding-bottom:30rpx;}
.pb35{padding-bottom:40rpx;}
.pb40{padding-bottom:40rpx;}
.pb50{padding-bottom:50rpx;}
.pb55{padding-bottom:55rpx;}
.pb60{padding-bottom:60rpx;}
.pb80{padding-bottom:80rpx;}
.pb90{padding-bottom:90rpx;}
.pb100{padding-bottom:100rpx;}
.pb130{padding-bottom:130rpx;}
.pb150{padding-bottom:150rpx;}
.pb180{padding-bottom:180rpx;}
.pb200{padding-bottom:200rpx;}
+29
View File
@@ -0,0 +1,29 @@
.ulib-r0{border-radius:0;}
.ulib-rr0{border-top-right-radius:0;border-bottom-right-radius:0;}
.ulib-r5{border-radius:5rpx;}
.ulib-rt5{border-top-left-radius:5rpx;border-top-right-radius:5rpx;}
.ulib-rb5{border-bottom-left-radius:5rpx;border-bottom-right-radius:5rpx;}
.ulib-rl5{border-top-left-radius:5rpx;border-bottom-left-radius:5rpx;}
.ulib-r10{border-radius:10rpx;}
.ulib-rt10{border-top-left-radius:10rpx;border-top-right-radius:10rpx;}
.ulib-rl10{border-top-left-radius:10rpx;border-bottom-left-radius:10rpx;}
.ulib-rr10{border-top-right-radius:10rpx;border-bottom-right-radius:10rpx;}
.ulib-rb10{border-bottom-left-radius:10rpx;border-bottom-right-radius:10rpx;}
.ulib-rbl10{border-bottom-left-radius:10rpx;}
.ulib-r10-bl{border-bottom-left-radius:10rpx;}
.ulib-r10-tr-bl{border-top-right-radius:10rpx;border-bottom-left-radius:10rpx;}
.ulib-r15{border-radius:15rpx;}
.ulib-r20{border-radius:20rpx;}
.ulib-rt20{border-top-left-radius:20rpx;border-top-right-radius:20rpx;}
.ulib-rb20{border-bottom-left-radius:20rpx;border-bottom-right-radius:20rpx;}
.ulib-rl20{border-top-left-radius:20rpx;border-bottom-left-radius:20rpx;}
.ulib-rt30{border-top-left-radius:30rpx;border-top-right-radius:30rpx;}
.ulib-r750{border-radius:750rpx;}
.ulib-rt750{border-top-left-radius:750rpx;border-top-right-radius:750rpx;}
.ulib-rl750{border-top-left-radius:750rpx;border-bottom-left-radius:750rpx;}
.ulib-rr750{border-top-right-radius:750rpx;border-bottom-right-radius:750rpx;}
.ulib-rlb750{border-bottom-left-radius:750rpx;}
.ulib-rlt0{border-top-left-radius:0;}
.ulib-rlt10{border-top-left-radius:10rpx;}
.ulib-rlt0{border-top-left-radius:0;}
.ulib-rlb10{border-bottom-left-radius:10rpx;}
+14
View File
@@ -0,0 +1,14 @@
.text-nowrap{width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.text-nospace{line-height:1;}
.text-left{text-align:left;}
.text-center{text-align:center;}
.text-right{text-align:right;}
.text-underline{text-decoration:underline;}
.text-through{text-decoration:line-through;}
.text-middle{vertical-align:middle}
.text-bold{font-weight:bold;}
.text-break{word-break:break-all;word-wrap:break-word;white-space:pre-wrap;}
.text-shadow{text-shadow:1rpx 3rpx 3rpx rgba(0,0,0,.8);}
.text-spacing-10{letter-spacing:10rpx}
.space-nowrap{white-space:nowrap;}
.space-normal{white-space:normal;}
+13
View File
@@ -0,0 +1,13 @@
@import "thirdparty/iconfont.wxss";
@import "base/background.wxss";
@import "base/border.wxss";
@import "base/button.wxss";
@import "base/fontColor.wxss";
@import "base/fontSize.wxss";
@import "base/imgSize.wxss";
@import "base/textRender.wxss";
@import "base/layout.wxss";
@import "base/margin.wxss";
@import "base/padding.wxss";
@import "base/radius.wxss";
@import "base/animate.wxss";
+79
View File
@@ -0,0 +1,79 @@
.A-coupon-item {
height: 155rpx;
background-repeat:repeat-y;
background-size:100% auto;
border-top:#e6e6e6 2rpx solid;
border-bottom:#e6e6e6 2rpx solid;
}
.A-coupon-item-price{
height:100%;
width: 150rpx;
border-right: 2rpx dashed #f1e5d9;
box-sizing: border-box;
}
.A-coupon-item-price::before {
content: '';
position: absolute;
right: -11rpx;
top: -11rpx;
width: 20rpx;
height: 20rpx;
border-radius: 100%;
background-color: #fff;
border:#e6e6e6 2rpx solid;
}
.A-coupon-item-price::after {
content: '';
position: absolute;
right: -11rpx;
bottom: -11rpx;
width: 20rpx;
height: 20rpx;
border-radius: 100%;
background-color: #fff;
border:#e6e6e6 2rpx solid;
}
.lcb-coupon{
overflow: hidden;
background-image: url('https://qs.haodian.cn/wechat_app/xiaohongbangV2/coupon/coupon-bg.png');
background-size: 100% auto;
background-repeat: repeat-y;
}
.lcb-coupon::before,.lcb-coupon::after{
content: '';
position: absolute;
z-index: 1;
width: 18rpx;
height: 18rpx;
border-radius: 100%;
border: 1px solid #e8e8e8;
left: 457rpx;
background-color: #fff;
border-radius: 100%;
}
.lcb-coupon::before{
top: -9rpx;
}
.lcb-coupon::after{
bottom: -9rpx;
}
.lcb-coupon-info{
width: 467rpx;
height: 168rpx;
border-top: 1px solid #e8e8e8;
border-bottom: 1px solid #e8e8e8;
border-right: 1px dashed #e8e8e8;
}
.lcb-coupon-opt{
width: 223rpx;
height: 168rpx;
border-top: 1px solid #e8e8e8;
border-bottom: 1px solid #e8e8e8;
}
.lcb-coupon-opt .btn{
width: 162rpx;
height: 60rpx;
line-height: 60rpx;
}
+36
View File
@@ -0,0 +1,36 @@
.coms-dialog-kf .pic-top{
height: 172rpx;
background: url("http://qs.haodian.cn/wechat_app/xiaohongbangV2/kf_dialog_bg_2.png") no-repeat top center;
background-size: 100% 100%;
}
.coms-dialog-kf{
width:596rpx;
background: #fff;
padding: 0 0 50rpx 0;
}
.coms-dialog-kf .tit{
color: #333333;
font-size: 30rpx;
text-align: center;
font-weight: bold;
line-height: 1.6;
margin: 20rpx 0 0;
}
.coms-dialog-kf .tit text{
display: block;
}
.coms-dialog-kf .btn-concat{
width: 328rpx;
height: 88rpx;
line-height: 88rpx;
border-radius: 50rpx;
background: #fe2643;
font-size: 32rpx;
color:#fff;
padding: 0;
margin: 30rpx auto 0;
}
File diff suppressed because one or more lines are too long
Binary file not shown.

After

Width:  |  Height:  |  Size: 526 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1018 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 889 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 869 B

+15
View File
@@ -0,0 +1,15 @@
import config from 'config'
import WxRouter from 'utils/router';
import apiQuery from 'utils/apiQuery';
import userManager from 'utils/user-manager'
import utils from 'utils/util'
import eventBus from 'lib/event'
module.exports = {
$router:new WxRouter(),
apiQuery,
config,
userManager,
utils,
eventBus
}
+234
View File
@@ -0,0 +1,234 @@
const env = "p";
const version = 1,
//狸车宝
app_id = '' +
'',
key = '71fd71173b776766a2ae1209d9a2c2ed';
//好店云
// app_id = 'ebb6d3808b2fa324',
// key = '06c92b4b954d06dab7b91a8886c7a69b';
let api, baseUrl;
if (env == "d") {
baseUrl = "https://liche-api-dev.xiaoyu.com/hd/";
} else if (env == "t") {
baseUrl = "https://api.test.liche.cn/hd/";
} else if (env == "p") {
baseUrl = "https://api.liche.cn/hd/";
}
api = {
baseUrl: baseUrl,
upImg: baseUrl + "upimg", //上传图片
appUserUkey: "app/user/ukey", //登录/退出登录
appUser: "app/user", //用户信息
appSms: "app/sms", //获取验证码
appSeriesCars: "app/series/cars", //获取车型库
appSeriesAttrs: "app/series/attrs", //获取车型属性
appCustomersTabs: "app/customers/tabs", //获取tab
appCustomers: "app/customers", //获取客户列表 /新建客户 /修改状态和到店次数、试驾次数 /获取客户详情
appCustomersFilter: "app/customers/filter", //获取列表筛选条件
appSmsCustomer: "app/sms/customer", //客户发短信
appSmsCusorder: "app/sms/cusorder", //订单发短信
appCustomerlogs: "app/customerlogs", //获取日志
appCustomerData: "app/customers/data", //获取客户详细信息
appCusorder: "app/cusorder", //新建订单 /获取订单列表 /获取订单详情 /修改付款方式 /修改委托协议
appCusorderTabs: "app/cusorder/tabs", //获取tab
appEmployees: "app/employees", //获取客户详细信息 /获取店员列表 /更新店员信息 /删除店员
appIdcard: "app/idcard", //创建申请开票信息
appUserCal: "app/user/cal", //获取用户统计
appCusorderCkcar: "app/cusorder/ckcar", //确认交付
appCustomersAdmins: "app/customers/admins", //分配客户
appXz: "app/xz", //获取虚拟电话
appCustomerlogs: "app/customerlogs", //新增日志
appCustomerData: "app/customers/data", //修改客户基本信息
appServicesPackage: "app/services/package", //获取代办包
appSeriesInfo: "app/series/info", //获取车辆价格
appBusiness: "app/business", //获取商务政策
appSeriesBrands: "app/series/brands", //获取车型品牌
appSeries: "app/series", //获取车系车型
appUserTel: "app/user/tel", //编辑拨打电话
appFinance: "app/finance", //获取金融产品列表
appFinanceNums: "app/finance/nums", //获取金融分期期数
appLoan: "app/loan", //修改贷款信息
appUserBizs: "app/user/bizs", //获取管理门店
appStatisticsCust: "app/statistics/cust", //获取渠道客户统计
appStatisticsOrders: "app/statistics/orders", //获取渠道订单统计
appUserAdmins: "app/user/admins", //获取门店管理员
appStatisticsScust: "app/statistics/scust", //数据分析-客户数据
appStatisticsOcust: "app/statistics/ocust", //数据分析-订单数据
appStatisticsHcust: "app/statistics/hcust", //首页-客户图标数据
appStatisticsHorder: "app/statistics/horder", //首页-订单图表数据
appStatisticsStats: "app/statistics/stats", //获取渠道经理数据分析入口数据
appStatisticsStats_days: "app/statistics/stats_days", //获取渠道经理数据分析数据
appStatisticsStats_customer: "app/statistics/stats_customer", //获取渠道经理数据分析数据
appUserResetbiz: "app/user/resetbiz", //更新用户店铺id
appXzStat: "app/xz/stat", //获取电话统计数据
appCity: "app/city", //获取系统配置城市
materialHomeTabs: "material/home/tabs", //推广素材_tab
materialHomeLists: "material/home/lists", //推广素材_lists
materialHomeTopic: "material/home/topic", //生成专题
materialTopic: "material/topic", //专题首页
materialHomeQrcode: "material/home/qrcode", //获取二维码
materialStatistics: 'material/statistics', //数据分析_首页
materialStatisticsCal: 'material/statistics/cal', //数据分析_累计数据
materialStatisticsChart: 'material/statistics/chart', //数据分析_图表
appCusorder2: 'app/cusorder2', //新建订单(新)/修改订单信息
appCustomersDefeats: 'app/customers/defeats', //战败客户列表 /战败/再战申请
appServices:'app/services', //获取代办服务列表
appFine:'app/fine', //获取精品赠送列表 /获取精品选装
materialHomeBiz:'material/home/biz', //店铺海报
materialHomePosters:'material/home/posters', //保存店铺海报
appDelivery:'app/delivery', //获取车辆确定随车资料
materialHomeBiz_posters:'material/home/biz_posters', //店铺海报模版
appTransferLists:'app/transfer/lists', //调拨记录
appTransfer:'app/transfer', //调拨详情 /确认发车/接车 /报备异常
appTransferRemind:'app/transfer/remind', //调拨提醒
appCusorderCdata:'app/cusorder/cdata', //上传资料
appBrokerageOrders:'app/brokerage/orders', //转介绍列表
appBrokerage:'app/brokerage', //获取佣金设置 /更新佣金设置 /创建佣金设置
appTransferTabs:'app/transfer/tabs', //调拨记录_tab
appTransferTransport:'app/transfer/transport', //上传运输单
appBizSituation_tabs:'app/biz/situation_tabs', //店铺概况_tab
appBizSituation:'app/biz/situation', //店铺概况 /店铺概况保存
appBizStreet:'app/biz/street', //获取乡镇
appCusorderV2Inten:'app/cusorderV2/inten', //新增意向金订单
appCusorderV2:'app/cusorderV2', //新建订单 /获取订单列表 /订单详情 /修改订单信息
appCusorderV2Tabs:'app/cusorderV2/tabs', //获取订单列表tab
appCusorderdata:'app/Cusorderdata', //获取订单图片 /上传编辑国补资料
appCusorderV2Info:'app/cusorderV2/info', //修改订单基本信息
appCusorderV2Status:'app/cusorderV2/status', //删除订单
appSytactivityTabs:'app/sytactivity/tabs', //私域通_tab
appSytactivityList:'app/sytactivity/list', //活动列表
appSytactivityDetail:'app/sytactivity/detail', //活动详情
appSytactivityLog:'app/sytactivity/log', //实时战报
appSytactivityRanking:'app/sytactivity/ranking', //活动排名
appInventoryTabs:'app/inventory/tabs', //盘点记录_tab
appInventoryLists:'app/inventory/lists', //盘点记录
appInventory:'app/inventory', //盘点详情 /盘点上传图片
appInventoryRemind:'app/inventory/remind', //盘点提醒
appGoodsRemind:'app/goods/remind', //库存提醒/预警
appGoodsLists:'app/goods/lists', //库存列表
appCustomersOffline_sources:'app/customers/offline_sources', //客户来源
appCustomersTag:'app/customers/tag', //客户标签
appCityOncard:'app/city/oncard', //获取上牌城市
appFinanceNums:'app/finance/nums', //获取金融分期期数
appCusorderV2Customer:'app/cusorderV2/customer', //获取客户订单
appCustomersVisit_tabs:'app/customers/visit_tabs', //回访待跟进tab
appIdcardInfo:'app/idcard/info', //识别身份证号码
appCustomersComments:'app/customers/comments', //用户评论
appCityArea:'app/city/area', //获取省/市/区/街道
appEmployeesLeave:'app/employees/leave', //获取离职 //提交离职
appCusorderV2Admins:'app/cusorderV2/admins', //分配订单
appCusorderdataInfo:'app/cusorderdata/info', //保单信息确认
appBizStats:'app/biz/stats', //数据看板首页
appBizStats_customer:'app/biz/stats_customer', //客户数据
appBizStats_wxqy:'app/biz/stats_wxqy', //企微数据
appBizStats_order:'app/biz/stats_order', //订单数据
appBizStats_days:'app/biz/stats_days', //客户/订单走势图
appBizStats_customer_pid:'app/biz/stats_customer_pid', //客户数据二级
appBizStats_order_series:'app/biz/stats_order_series', //品牌数据二级
appOptions:'app/options', //获取车辆选装包
appResetgroupid:'app/user/resetgroupid', //切换角色
}
//远程图片存储地址
var imgUrl = 'https://qs.haodian.cn/wechat_app/lichebao/'
/**
* 默认头像
*/
// var defaultAvartar = imgUrl + 'default.png'
var defaultAvartar = ''
/**
* 滚动高度设置
*/
var elementScrollTop = '150'
/**
* 提醒模板id
*/
var bookTmpId ='zT5wqntUU0ipSJY7Hlw4T4lKfWwTddn3tv8udUv-rdo'
/**
* 开奖模板id
*/
var getLotteryTmpId = '5Lv1DATQLG23omDhIA8DS2ZBM6zU9prvt94BO7S9exc'
/**
* 模板id
*/
var subscribeTmpId = {
book: 'zT5wqntUU0ipSJY7Hlw4T4lKfWwTddn3tv8udUv-rdo',
getlottery: '5Lv1DATQLG23omDhIA8DS2ZBM6zU9prvt94BO7S9exc'
}
/**
* 接口白名单
*/
var white401UrlList = {
'app/home/qrcode':'app/home/qrcode'
}
/**
* 订单id临界切换版本
*/
var v2OrderId = 10000
export default {
env,
api,
key,
version,
app_id,
imgUrl,
defaultAvartar,
elementScrollTop,
bookTmpId,
getLotteryTmpId,
subscribeTmpId,
white401UrlList,
v2OrderId,
}
+418
View File
@@ -0,0 +1,418 @@
/**
* 表单验证
*
* @param {Object} rules 验证字段的规则
* @param {Object} messages 验证字段的提示信息
*
*/
class WxValidate {
constructor(rules = {}, messages = {}) {
Object.assign(this, {
data: {},
rules,
messages,
})
this.__init()
}
/**
* __init
*/
__init() {
this.__initMethods()
this.__initDefaults()
this.__initData()
}
/**
* 初始化数据
*/
__initData() {
this.form = {}
this.errorList = []
}
/**
* 初始化默认提示信息
*/
__initDefaults() {
this.defaults = {
messages: {
required: '这是必填字段。',
email: '请输入有效的电子邮件地址。',
tel: '请输入11位的手机号码。',
url: '请输入有效的网址。',
date: '请输入有效的日期。',
dateISO: '请输入有效的日期(ISO),例如:2009-06-231998/01/22。',
number: '请输入有效的数字。',
digits: '只能输入数字。',
idcard: '请输入18位的有效身份证。',
equalTo: this.formatTpl('输入值必须和 {0} 相同。'),
contains: this.formatTpl('输入值必须包含 {0}。'),
minlength: this.formatTpl('最少要输入 {0} 个字符。'),
maxlength: this.formatTpl('最多可以输入 {0} 个字符。'),
rangelength: this.formatTpl('请输入长度在 {0} 到 {1} 之间的字符。'),
min: this.formatTpl('请输入不小于 {0} 的数值。'),
max: this.formatTpl('请输入不大于 {0} 的数值。'),
range: this.formatTpl('请输入范围在 {0} 到 {1} 之间的数值。'),
}
}
}
/**
* 初始化默认验证方法
*/
__initMethods() {
const that = this
that.methods = {
/**
* 验证必填元素
*/
required(value, param) {
if (!that.depend(param)) {
return 'dependency-mismatch'
} else if (typeof value === 'number') {
value = value.toString()
} else if (typeof value === 'boolean') {
return !0
}
return value.length > 0
},
/**
* 验证电子邮箱格式
*/
email(value) {
return that.optional(value) || /^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/.test(value)
},
/**
* 验证手机格式
*/
tel(value) {
return that.optional(value) || /^1[3456789]\d{9}$/.test(value)
},
/**
* 验证URL格式
*/
url(value) {
return that.optional(value) || /^(?:(?:(?:https?|ftp):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,})).?)(?::\d{2,5})?(?:[/?#]\S*)?$/i.test(value)
},
/**
* 验证日期格式
*/
date(value) {
return that.optional(value) || !/Invalid|NaN/.test(new Date(value).toString())
},
/**
* 验证ISO类型的日期格式
*/
dateISO(value) {
return that.optional(value) || /^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$/.test(value)
},
/**
* 验证十进制数字
*/
number(value) {
return that.optional(value) || /^(?:-?\d+|-?\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test(value)
},
/**
* 验证整数
*/
digits(value) {
return that.optional(value) || /^\d+$/.test(value)
},
/**
* 验证身份证号码
*/
idcard(value) {
return that.optional(value) || /^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}([0-9]|X)$/.test(value)
},
/**
* 验证两个输入框的内容是否相同
*/
equalTo(value, param) {
return that.optional(value) || value === that.data[param]
},
/**
* 验证是否包含某个值
*/
contains(value, param) {
return that.optional(value) || value.indexOf(param) >= 0
},
/**
* 验证最小长度
*/
minlength(value, param) {
return that.optional(value) || value.length >= param
},
/**
* 验证最大长度
*/
maxlength(value, param) {
return that.optional(value) || value.length <= param
},
/**
* 验证一个长度范围[min, max]
*/
rangelength(value, param) {
return that.optional(value) || (value.length >= param[0] && value.length <= param[1])
},
/**
* 验证最小值
*/
min(value, param) {
return that.optional(value) || value >= param
},
/**
* 验证最大值
*/
max(value, param) {
return that.optional(value) || value <= param
},
/**
* 验证一个值范围[min, max]
*/
range(value, param) {
return that.optional(value) || (value >= param[0] && value <= param[1])
},
}
}
/**
* 添加自定义验证方法
* @param {String} name 方法名
* @param {Function} method 函数体,接收两个参数(value, param)value表示元素的值,param表示参数
* @param {String} message 提示信息
*/
addMethod(name, method, message) {
this.methods[name] = method
this.defaults.messages[name] = message !== undefined ? message : this.defaults.messages[name]
}
/**
* 判断验证方法是否存在
*/
isValidMethod(value) {
let methods = []
for (let method in this.methods) {
if (method && typeof this.methods[method] === 'function') {
methods.push(method)
}
}
return methods.indexOf(value) !== -1
}
/**
* 格式化提示信息模板
*/
formatTpl(source, params) {
const that = this
if (arguments.length === 1) {
return function() {
let args = Array.from(arguments)
args.unshift(source)
return that.formatTpl.apply(this, args)
}
}
if (params === undefined) {
return source
}
if (arguments.length > 2 && params.constructor !== Array) {
params = Array.from(arguments).slice(1)
}
if (params.constructor !== Array) {
params = [params]
}
params.forEach(function(n, i) {
source = source.replace(new RegExp("\\{" + i + "\\}", "g"), function() {
return n
})
})
return source
}
/**
* 判断规则依赖是否存在
*/
depend(param) {
switch (typeof param) {
case 'boolean':
param = param
break
case 'string':
param = !!param.length
break
case 'function':
param = param()
default:
param = !0
}
return param
}
/**
* 判断输入值是否为空
*/
optional(value) {
return !this.methods.required(value) && 'dependency-mismatch'
}
/**
* 获取自定义字段的提示信息
* @param {String} param 字段名
* @param {Object} rule 规则
*/
customMessage(param, rule) {
const params = this.messages[param]
const isObject = typeof params === 'object'
if (params && isObject) return params[rule.method]
}
/**
* 获取某个指定字段的提示信息
* @param {String} param 字段名
* @param {Object} rule 规则
*/
defaultMessage(param, rule) {
let message = this.customMessage(param, rule) || this.defaults.messages[rule.method]
let type = typeof message
if (type === 'undefined') {
message = `Warning: No message defined for ${rule.method}.`
} else if (type === 'function') {
message = message.call(this, rule.parameters)
}
return message
}
/**
* 缓存错误信息
* @param {String} param 字段名
* @param {Object} rule 规则
* @param {String} value 元素的值
*/
formatTplAndAdd(param, rule, value) {
let msg = this.defaultMessage(param, rule)
this.errorList.push({
param: param,
msg: msg,
value: value,
})
}
/**
* 验证某个指定字段的规则
* @param {String} param 字段名
* @param {Object} rules 规则
* @param {Object} data 需要验证的数据对象
*/
checkParam(param, rules, data) {
// 缓存数据对象
this.data = data
// 缓存字段对应的值
const value = data[param] !== null && data[param] !== undefined ? data[param] : ''
// 遍历某个指定字段的所有规则,依次验证规则,否则缓存错误信息
for (let method in rules) {
// 判断验证方法是否存在
if (this.isValidMethod(method)) {
// 缓存规则的属性及值
const rule = {
method: method,
parameters: rules[method]
}
// 调用验证方法
const result = this.methods[method](value, rule.parameters)
// 若result返回值为dependency-mismatch,则说明该字段的值为空或非必填字段
if (result === 'dependency-mismatch') {
continue
}
this.setValue(param, method, result, value)
// 判断是否通过验证,否则缓存错误信息,跳出循环
if (!result) {
this.formatTplAndAdd(param, rule, value)
break
}
}
}
}
/**
* 设置字段的默认验证值
* @param {String} param 字段名
*/
setView(param) {
this.form[param] = {
$name: param,
$valid: true,
$invalid: false,
$error: {},
$success: {},
$viewValue: ``,
}
}
/**
* 设置字段的验证值
* @param {String} param 字段名
* @param {String} method 字段的方法
* @param {Boolean} result 是否通过验证
* @param {String} value 字段的值
*/
setValue(param, method, result, value) {
const params = this.form[param]
params.$valid = result
params.$invalid = !result
params.$error[method] = !result
params.$success[method] = result
params.$viewValue = value
}
/**
* 验证所有字段的规则,返回验证是否通过
* @param {Object} data 需要验证数据对象
*/
checkForm(data) {
this.__initData()
for (let param in this.rules) {
this.setView(param)
this.checkParam(param, this.rules[param], data)
}
return this.valid()
}
/**
* 返回验证是否通过
*/
valid() {
return this.size() === 0
}
/**
* 返回错误信息的个数
*/
size() {
return this.errorList.length
}
/**
* 返回所有错误信息
*/
validationErrors() {
return this.errorList
}
}
export default WxValidate
+36
View File
@@ -0,0 +1,36 @@
var events = {};
function on(name, self, callback) {
var tuple = [self, callback];
var callbacks = events[name];
if (Array.isArray(callbacks)) {
callbacks.push(tuple);
}
else {
events[name] = [tuple];
}
}
function remove(name, self) {
var callbacks = events[name];
if (Array.isArray(callbacks)) {
events[name] = callbacks.filter((tuple) => {
return tuple[0] != self;
})
}
}
function emit(name, data) {
var callbacks = events[name];
if (Array.isArray(callbacks)) {
callbacks.map((tuple) => {
var self = tuple[0];
var callback = tuple[1];
callback.call(self, data);
})
}
}
exports.on = on;
exports.remove = remove;
exports.emit = emit;
+353
View File
@@ -0,0 +1,353 @@
/*
* A JavaScript implementation of the RSA Data Security, Inc. MD5 Message
* Digest Algorithm, as defined in RFC 1321.
* Version 2.2 Copyright (C) Paul Johnston 1999 - 2009
* Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
* Distributed under the BSD License
* See http://pajhome.org.uk/crypt/md5 for more info.
*/
/*
* Configurable variables. You may need to tweak these to be compatible with
* the server-side, but the defaults work in most cases.
*/
var hexcase = 0; /* hex output format. 0 - lowercase; 1 - uppercase */
var b64pad = ""; /* base-64 pad character. "=" for strict RFC compliance */
/*
* These are the functions you'll usually want to call
* They take string arguments and return either hex or base-64 encoded strings
*/
function hex_md5(s) { return rstr2hex(rstr_md5(str2rstr_utf8(s))); }
function b64_md5(s) { return rstr2b64(rstr_md5(str2rstr_utf8(s))); }
function any_md5(s, e) { return rstr2any(rstr_md5(str2rstr_utf8(s)), e); }
function hex_hmac_md5(k, d) { return rstr2hex(rstr_hmac_md5(str2rstr_utf8(k), str2rstr_utf8(d))); }
function b64_hmac_md5(k, d) { return rstr2b64(rstr_hmac_md5(str2rstr_utf8(k), str2rstr_utf8(d))); }
function any_hmac_md5(k, d, e) { return rstr2any(rstr_hmac_md5(str2rstr_utf8(k), str2rstr_utf8(d)), e); }
/*
* Perform a simple self-test to see if the VM is working
*/
function md5_vm_test() {
return hex_md5("abc").toLowerCase() == "900150983cd24fb0d6963f7d28e17f72";
}
/*
* Calculate the MD5 of a raw string
*/
function rstr_md5(s) {
return binl2rstr(binl_md5(rstr2binl(s), s.length * 8));
}
/*
* Calculate the HMAC-MD5, of a key and some data (raw strings)
*/
function rstr_hmac_md5(key, data) {
var bkey = rstr2binl(key);
if (bkey.length > 16) bkey = binl_md5(bkey, key.length * 8);
var ipad = Array(16), opad = Array(16);
for (var i = 0; i < 16; i++) {
ipad[i] = bkey[i] ^ 0x36363636;
opad[i] = bkey[i] ^ 0x5C5C5C5C;
}
var hash = binl_md5(ipad.concat(rstr2binl(data)), 512 + data.length * 8);
return binl2rstr(binl_md5(opad.concat(hash), 512 + 128));
}
/*
* Convert a raw string to a hex string
*/
function rstr2hex(input) {
try { hexcase } catch (e) { hexcase = 0; }
var hex_tab = hexcase ? "0123456789ABCDEF" : "0123456789abcdef";
var output = "";
var x;
for (var i = 0; i < input.length; i++) {
x = input.charCodeAt(i);
output += hex_tab.charAt((x >>> 4) & 0x0F)
+ hex_tab.charAt(x & 0x0F);
}
return output;
}
/*
* Convert a raw string to a base-64 string
*/
function rstr2b64(input) {
try { b64pad } catch (e) { b64pad = ''; }
var tab = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
var output = "";
var len = input.length;
for (var i = 0; i < len; i += 3) {
var triplet = (input.charCodeAt(i) << 16)
| (i + 1 < len ? input.charCodeAt(i + 1) << 8 : 0)
| (i + 2 < len ? input.charCodeAt(i + 2) : 0);
for (var j = 0; j < 4; j++) {
if (i * 8 + j * 6 > input.length * 8) output += b64pad;
else output += tab.charAt((triplet >>> 6 * (3 - j)) & 0x3F);
}
}
return output;
}
/*
* Convert a raw string to an arbitrary string encoding
*/
function rstr2any(input, encoding) {
var divisor = encoding.length;
var i, j, q, x, quotient;
/* Convert to an array of 16-bit big-endian values, forming the dividend */
var dividend = Array(Math.ceil(input.length / 2));
for (i = 0; i < dividend.length; i++) {
dividend[i] = (input.charCodeAt(i * 2) << 8) | input.charCodeAt(i * 2 + 1);
}
/*
* Repeatedly perform a long division. The binary array forms the dividend,
* the length of the encoding is the divisor. Once computed, the quotient
* forms the dividend for the next step. All remainders are stored for later
* use.
*/
var full_length = Math.ceil(input.length * 8 /
(Math.log(encoding.length) / Math.log(2)));
var remainders = Array(full_length);
for (j = 0; j < full_length; j++) {
quotient = Array();
x = 0;
for (i = 0; i < dividend.length; i++) {
x = (x << 16) + dividend[i];
q = Math.floor(x / divisor);
x -= q * divisor;
if (quotient.length > 0 || q > 0)
quotient[quotient.length] = q;
}
remainders[j] = x;
dividend = quotient;
}
/* Convert the remainders to the output string */
var output = "";
for (i = remainders.length - 1; i >= 0; i--)
output += encoding.charAt(remainders[i]);
return output;
}
/*
* Encode a string as utf-8.
* For efficiency, this assumes the input is valid utf-16.
*/
function str2rstr_utf8(input) {
var output = "";
var i = -1;
var x, y;
while (++i < input.length) {
/* Decode utf-16 surrogate pairs */
x = input.charCodeAt(i);
y = i + 1 < input.length ? input.charCodeAt(i + 1) : 0;
if (0xD800 <= x && x <= 0xDBFF && 0xDC00 <= y && y <= 0xDFFF) {
x = 0x10000 + ((x & 0x03FF) << 10) + (y & 0x03FF);
i++;
}
/* Encode output as utf-8 */
if (x <= 0x7F)
output += String.fromCharCode(x);
else if (x <= 0x7FF)
output += String.fromCharCode(0xC0 | ((x >>> 6) & 0x1F),
0x80 | (x & 0x3F));
else if (x <= 0xFFFF)
output += String.fromCharCode(0xE0 | ((x >>> 12) & 0x0F),
0x80 | ((x >>> 6) & 0x3F),
0x80 | (x & 0x3F));
else if (x <= 0x1FFFFF)
output += String.fromCharCode(0xF0 | ((x >>> 18) & 0x07),
0x80 | ((x >>> 12) & 0x3F),
0x80 | ((x >>> 6) & 0x3F),
0x80 | (x & 0x3F));
}
return output;
}
/*
* Encode a string as utf-16
*/
function str2rstr_utf16le(input) {
var output = "";
for (var i = 0; i < input.length; i++)
output += String.fromCharCode(input.charCodeAt(i) & 0xFF,
(input.charCodeAt(i) >>> 8) & 0xFF);
return output;
}
function str2rstr_utf16be(input) {
var output = "";
for (var i = 0; i < input.length; i++)
output += String.fromCharCode((input.charCodeAt(i) >>> 8) & 0xFF,
input.charCodeAt(i) & 0xFF);
return output;
}
/*
* Convert a raw string to an array of little-endian words
* Characters >255 have their high-byte silently ignored.
*/
function rstr2binl(input) {
var output = Array(input.length >> 2);
for (var i = 0; i < output.length; i++)
output[i] = 0;
for (var i = 0; i < input.length * 8; i += 8)
output[i >> 5] |= (input.charCodeAt(i / 8) & 0xFF) << (i % 32);
return output;
}
/*
* Convert an array of little-endian words to a string
*/
function binl2rstr(input) {
var output = "";
for (var i = 0; i < input.length * 32; i += 8)
output += String.fromCharCode((input[i >> 5] >>> (i % 32)) & 0xFF);
return output;
}
/*
* Calculate the MD5 of an array of little-endian words, and a bit length.
*/
function binl_md5(x, len) {
/* append padding */
x[len >> 5] |= 0x80 << ((len) % 32);
x[(((len + 64) >>> 9) << 4) + 14] = len;
var a = 1732584193;
var b = -271733879;
var c = -1732584194;
var d = 271733878;
for (var i = 0; i < x.length; i += 16) {
var olda = a;
var oldb = b;
var oldc = c;
var oldd = d;
a = md5_ff(a, b, c, d, x[i + 0], 7, -680876936);
d = md5_ff(d, a, b, c, x[i + 1], 12, -389564586);
c = md5_ff(c, d, a, b, x[i + 2], 17, 606105819);
b = md5_ff(b, c, d, a, x[i + 3], 22, -1044525330);
a = md5_ff(a, b, c, d, x[i + 4], 7, -176418897);
d = md5_ff(d, a, b, c, x[i + 5], 12, 1200080426);
c = md5_ff(c, d, a, b, x[i + 6], 17, -1473231341);
b = md5_ff(b, c, d, a, x[i + 7], 22, -45705983);
a = md5_ff(a, b, c, d, x[i + 8], 7, 1770035416);
d = md5_ff(d, a, b, c, x[i + 9], 12, -1958414417);
c = md5_ff(c, d, a, b, x[i + 10], 17, -42063);
b = md5_ff(b, c, d, a, x[i + 11], 22, -1990404162);
a = md5_ff(a, b, c, d, x[i + 12], 7, 1804603682);
d = md5_ff(d, a, b, c, x[i + 13], 12, -40341101);
c = md5_ff(c, d, a, b, x[i + 14], 17, -1502002290);
b = md5_ff(b, c, d, a, x[i + 15], 22, 1236535329);
a = md5_gg(a, b, c, d, x[i + 1], 5, -165796510);
d = md5_gg(d, a, b, c, x[i + 6], 9, -1069501632);
c = md5_gg(c, d, a, b, x[i + 11], 14, 643717713);
b = md5_gg(b, c, d, a, x[i + 0], 20, -373897302);
a = md5_gg(a, b, c, d, x[i + 5], 5, -701558691);
d = md5_gg(d, a, b, c, x[i + 10], 9, 38016083);
c = md5_gg(c, d, a, b, x[i + 15], 14, -660478335);
b = md5_gg(b, c, d, a, x[i + 4], 20, -405537848);
a = md5_gg(a, b, c, d, x[i + 9], 5, 568446438);
d = md5_gg(d, a, b, c, x[i + 14], 9, -1019803690);
c = md5_gg(c, d, a, b, x[i + 3], 14, -187363961);
b = md5_gg(b, c, d, a, x[i + 8], 20, 1163531501);
a = md5_gg(a, b, c, d, x[i + 13], 5, -1444681467);
d = md5_gg(d, a, b, c, x[i + 2], 9, -51403784);
c = md5_gg(c, d, a, b, x[i + 7], 14, 1735328473);
b = md5_gg(b, c, d, a, x[i + 12], 20, -1926607734);
a = md5_hh(a, b, c, d, x[i + 5], 4, -378558);
d = md5_hh(d, a, b, c, x[i + 8], 11, -2022574463);
c = md5_hh(c, d, a, b, x[i + 11], 16, 1839030562);
b = md5_hh(b, c, d, a, x[i + 14], 23, -35309556);
a = md5_hh(a, b, c, d, x[i + 1], 4, -1530992060);
d = md5_hh(d, a, b, c, x[i + 4], 11, 1272893353);
c = md5_hh(c, d, a, b, x[i + 7], 16, -155497632);
b = md5_hh(b, c, d, a, x[i + 10], 23, -1094730640);
a = md5_hh(a, b, c, d, x[i + 13], 4, 681279174);
d = md5_hh(d, a, b, c, x[i + 0], 11, -358537222);
c = md5_hh(c, d, a, b, x[i + 3], 16, -722521979);
b = md5_hh(b, c, d, a, x[i + 6], 23, 76029189);
a = md5_hh(a, b, c, d, x[i + 9], 4, -640364487);
d = md5_hh(d, a, b, c, x[i + 12], 11, -421815835);
c = md5_hh(c, d, a, b, x[i + 15], 16, 530742520);
b = md5_hh(b, c, d, a, x[i + 2], 23, -995338651);
a = md5_ii(a, b, c, d, x[i + 0], 6, -198630844);
d = md5_ii(d, a, b, c, x[i + 7], 10, 1126891415);
c = md5_ii(c, d, a, b, x[i + 14], 15, -1416354905);
b = md5_ii(b, c, d, a, x[i + 5], 21, -57434055);
a = md5_ii(a, b, c, d, x[i + 12], 6, 1700485571);
d = md5_ii(d, a, b, c, x[i + 3], 10, -1894986606);
c = md5_ii(c, d, a, b, x[i + 10], 15, -1051523);
b = md5_ii(b, c, d, a, x[i + 1], 21, -2054922799);
a = md5_ii(a, b, c, d, x[i + 8], 6, 1873313359);
d = md5_ii(d, a, b, c, x[i + 15], 10, -30611744);
c = md5_ii(c, d, a, b, x[i + 6], 15, -1560198380);
b = md5_ii(b, c, d, a, x[i + 13], 21, 1309151649);
a = md5_ii(a, b, c, d, x[i + 4], 6, -145523070);
d = md5_ii(d, a, b, c, x[i + 11], 10, -1120210379);
c = md5_ii(c, d, a, b, x[i + 2], 15, 718787259);
b = md5_ii(b, c, d, a, x[i + 9], 21, -343485551);
a = safe_add(a, olda);
b = safe_add(b, oldb);
c = safe_add(c, oldc);
d = safe_add(d, oldd);
}
return Array(a, b, c, d);
}
/*
* These functions implement the four basic operations the algorithm uses.
*/
function md5_cmn(q, a, b, x, s, t) {
return safe_add(bit_rol(safe_add(safe_add(a, q), safe_add(x, t)), s), b);
}
function md5_ff(a, b, c, d, x, s, t) {
return md5_cmn((b & c) | ((~b) & d), a, b, x, s, t);
}
function md5_gg(a, b, c, d, x, s, t) {
return md5_cmn((b & d) | (c & (~d)), a, b, x, s, t);
}
function md5_hh(a, b, c, d, x, s, t) {
return md5_cmn(b ^ c ^ d, a, b, x, s, t);
}
function md5_ii(a, b, c, d, x, s, t) {
return md5_cmn(c ^ (b | (~d)), a, b, x, s, t);
}
/*
* Add integers, wrapping at 2^32. This uses 16-bit operations internally
* to work around bugs in some JS interpreters.
*/
function safe_add(x, y) {
var lsw = (x & 0xFFFF) + (y & 0xFFFF);
var msw = (x >> 16) + (y >> 16) + (lsw >> 16);
return (msw << 16) | (lsw & 0xFFFF);
}
/*
* Bitwise rotate a 32-bit number to the left.
*/
function bit_rol(num, cnt) {
return (num << cnt) | (num >>> (32 - cnt));
}
module.exports = {
hex_md5,
b64_md5
}
+20
View File
@@ -0,0 +1,20 @@
//常用时间 /start 距离当前时间几天前,later往前延续几天
let getDateLater = function(start=0,later=0) {
return new Promise(function (resolve, reject) {
let dateArr = [];
let date = new Date();
date.setDate(date.getDate() - start);
let todate = date.getFullYear() + "-" + ((date.getMonth() + 1) < 10 ? ("0" + (date.getMonth() + 1)) : date.getMonth()+1) + "-" + (date.getDate() < 10 ? ("0" + date.getDate()) : date.getDate());
date.setDate(date.getDate() - later);
let laterdate = date.getFullYear() + "-" + ((date.getMonth() + 1) < 10 ? ("0" + (date.getMonth() + 1)) : date.getMonth()+1) + "-" + (date.getDate() < 10 ? ("0" + date.getDate()) : date.getDate());
let laterMonth = date.getFullYear() + "-" + ((date.getMonth() + 1) < 10 ? ("0" + (date.getMonth() + 1)) : date.getMonth()+1);
dateArr.push(laterdate)
dateArr.push(todate)
dateArr.push(laterMonth)
resolve(dateArr);
})
}
module.exports = {
getDateLater,
}
File diff suppressed because it is too large Load Diff
+423
View File
@@ -0,0 +1,423 @@
//Core code comes from https://github.com/davidshimjs/qrcodejs
var QRCode;
(function () {
/**
* Get the type by string length
*
* @private
* @param {String} sText
* @param {Number} nCorrectLevel
* @return {Number} type
*/
function _getTypeNumber(sText, nCorrectLevel) {
var nType = 1;
var length = _getUTF8Length(sText);
for (var i = 0, len = QRCodeLimitLength.length; i <= len; i++) {
var nLimit = 0;
switch (nCorrectLevel) {
case QRErrorCorrectLevel.L:
nLimit = QRCodeLimitLength[i][0];
break;
case QRErrorCorrectLevel.M:
nLimit = QRCodeLimitLength[i][1];
break;
case QRErrorCorrectLevel.Q:
nLimit = QRCodeLimitLength[i][2];
break;
case QRErrorCorrectLevel.H:
nLimit = QRCodeLimitLength[i][3];
break;
}
if (length <= nLimit) {
break;
} else {
nType++;
}
}
if (nType > QRCodeLimitLength.length) {
throw new Error("Too long data");
}
return nType;
}
function _getUTF8Length(sText) {
var replacedText = encodeURI(sText).toString().replace(/\%[0-9a-fA-F]{2}/g, 'a');
return replacedText.length + (replacedText.length != sText ? 3 : 0);
}
function QR8bitByte(data) {
this.mode = QRMode.MODE_8BIT_BYTE;
this.data = data;
this.parsedData = [];
// Added to support UTF-8 Characters
for (var i = 0, l = this.data.length; i < l; i++) {
var byteArray = [];
var code = this.data.charCodeAt(i);
if (code > 0x10000) {
byteArray[0] = 0xF0 | ((code & 0x1C0000) >>> 18);
byteArray[1] = 0x80 | ((code & 0x3F000) >>> 12);
byteArray[2] = 0x80 | ((code & 0xFC0) >>> 6);
byteArray[3] = 0x80 | (code & 0x3F);
} else if (code > 0x800) {
byteArray[0] = 0xE0 | ((code & 0xF000) >>> 12);
byteArray[1] = 0x80 | ((code & 0xFC0) >>> 6);
byteArray[2] = 0x80 | (code & 0x3F);
} else if (code > 0x80) {
byteArray[0] = 0xC0 | ((code & 0x7C0) >>> 6);
byteArray[1] = 0x80 | (code & 0x3F);
} else {
byteArray[0] = code;
}
this.parsedData.push(byteArray);
}
this.parsedData = Array.prototype.concat.apply([], this.parsedData);
if (this.parsedData.length != this.data.length) {
this.parsedData.unshift(191);
this.parsedData.unshift(187);
this.parsedData.unshift(239);
}
}
QR8bitByte.prototype = {
getLength: function (buffer) {
return this.parsedData.length;
},
write: function (buffer) {
for (var i = 0, l = this.parsedData.length; i < l; i++) {
buffer.put(this.parsedData[i], 8);
}
}
};
// QRCodeModel
function QRCodeModel(typeNumber, errorCorrectLevel) {
this.typeNumber = typeNumber;
this.errorCorrectLevel = errorCorrectLevel;
this.modules = null;
this.moduleCount = 0;
this.dataCache = null;
this.dataList = [];
}
QRCodeModel.prototype = {
addData: function (data) { var newData = new QR8bitByte(data); this.dataList.push(newData); this.dataCache = null; }, isDark: function (row, col) {
if (row < 0 || this.moduleCount <= row || col < 0 || this.moduleCount <= col) { throw new Error(row + "," + col); }
return this.modules[row][col];
}, getModuleCount: function () { return this.moduleCount; }, make: function () { this.makeImpl(false, this.getBestMaskPattern()); }, makeImpl: function (test, maskPattern) {
this.moduleCount = this.typeNumber * 4 + 17; this.modules = new Array(this.moduleCount); for (var row = 0; row < this.moduleCount; row++) { this.modules[row] = new Array(this.moduleCount); for (var col = 0; col < this.moduleCount; col++) { this.modules[row][col] = null; } }
this.setupPositionProbePattern(0, 0); this.setupPositionProbePattern(this.moduleCount - 7, 0); this.setupPositionProbePattern(0, this.moduleCount - 7); this.setupPositionAdjustPattern(); this.setupTimingPattern(); this.setupTypeInfo(test, maskPattern); if (this.typeNumber >= 7) { this.setupTypeNumber(test); }
if (this.dataCache == null) { this.dataCache = QRCodeModel.createData(this.typeNumber, this.errorCorrectLevel, this.dataList); }
this.mapData(this.dataCache, maskPattern);
}, setupPositionProbePattern: function (row, col) { for (var r = -1; r <= 7; r++) { if (row + r <= -1 || this.moduleCount <= row + r) continue; for (var c = -1; c <= 7; c++) { if (col + c <= -1 || this.moduleCount <= col + c) continue; if ((0 <= r && r <= 6 && (c == 0 || c == 6)) || (0 <= c && c <= 6 && (r == 0 || r == 6)) || (2 <= r && r <= 4 && 2 <= c && c <= 4)) { this.modules[row + r][col + c] = true; } else { this.modules[row + r][col + c] = false; } } } }, getBestMaskPattern: function () {
var minLostPoint = 0; var pattern = 0; for (var i = 0; i < 8; i++) { this.makeImpl(true, i); var lostPoint = QRUtil.getLostPoint(this); if (i == 0 || minLostPoint > lostPoint) { minLostPoint = lostPoint; pattern = i; } }
return pattern;
}, createMovieClip: function (target_mc, instance_name, depth) {
var qr_mc = target_mc.createEmptyMovieClip(instance_name, depth); var cs = 1; this.make(); for (var row = 0; row < this.modules.length; row++) { var y = row * cs; for (var col = 0; col < this.modules[row].length; col++) { var x = col * cs; var dark = this.modules[row][col]; if (dark) { qr_mc.beginFill(0, 100); qr_mc.moveTo(x, y); qr_mc.lineTo(x + cs, y); qr_mc.lineTo(x + cs, y + cs); qr_mc.lineTo(x, y + cs); qr_mc.endFill(); } } }
return qr_mc;
}, setupTimingPattern: function () {
for (var r = 8; r < this.moduleCount - 8; r++) {
if (this.modules[r][6] != null) { continue; }
this.modules[r][6] = (r % 2 == 0);
}
for (var c = 8; c < this.moduleCount - 8; c++) {
if (this.modules[6][c] != null) { continue; }
this.modules[6][c] = (c % 2 == 0);
}
}, setupPositionAdjustPattern: function () {
var pos = QRUtil.getPatternPosition(this.typeNumber); for (var i = 0; i < pos.length; i++) {
for (var j = 0; j < pos.length; j++) {
var row = pos[i]; var col = pos[j]; if (this.modules[row][col] != null) { continue; }
for (var r = -2; r <= 2; r++) { for (var c = -2; c <= 2; c++) { if (r == -2 || r == 2 || c == -2 || c == 2 || (r == 0 && c == 0)) { this.modules[row + r][col + c] = true; } else { this.modules[row + r][col + c] = false; } } }
}
}
}, setupTypeNumber: function (test) {
var bits = QRUtil.getBCHTypeNumber(this.typeNumber); for (var i = 0; i < 18; i++) { var mod = (!test && ((bits >> i) & 1) == 1); this.modules[Math.floor(i / 3)][i % 3 + this.moduleCount - 8 - 3] = mod; }
for (var i = 0; i < 18; i++) { var mod = (!test && ((bits >> i) & 1) == 1); this.modules[i % 3 + this.moduleCount - 8 - 3][Math.floor(i / 3)] = mod; }
}, setupTypeInfo: function (test, maskPattern) {
var data = (this.errorCorrectLevel << 3) | maskPattern; var bits = QRUtil.getBCHTypeInfo(data); for (var i = 0; i < 15; i++) { var mod = (!test && ((bits >> i) & 1) == 1); if (i < 6) { this.modules[i][8] = mod; } else if (i < 8) { this.modules[i + 1][8] = mod; } else { this.modules[this.moduleCount - 15 + i][8] = mod; } }
for (var i = 0; i < 15; i++) { var mod = (!test && ((bits >> i) & 1) == 1); if (i < 8) { this.modules[8][this.moduleCount - i - 1] = mod; } else if (i < 9) { this.modules[8][15 - i - 1 + 1] = mod; } else { this.modules[8][15 - i - 1] = mod; } }
this.modules[this.moduleCount - 8][8] = (!test);
}, mapData: function (data, maskPattern) {
var inc = -1; var row = this.moduleCount - 1; var bitIndex = 7; var byteIndex = 0; for (var col = this.moduleCount - 1; col > 0; col -= 2) {
if (col == 6) col--; while (true) {
for (var c = 0; c < 2; c++) {
if (this.modules[row][col - c] == null) {
var dark = false; if (byteIndex < data.length) { dark = (((data[byteIndex] >>> bitIndex) & 1) == 1); }
var mask = QRUtil.getMask(maskPattern, row, col - c); if (mask) { dark = !dark; }
this.modules[row][col - c] = dark; bitIndex--; if (bitIndex == -1) { byteIndex++; bitIndex = 7; }
}
}
row += inc; if (row < 0 || this.moduleCount <= row) { row -= inc; inc = -inc; break; }
}
}
}
};
QRCodeModel.PAD0 = 0xEC;
QRCodeModel.PAD1 = 0x11;
QRCodeModel.createData = function (typeNumber, errorCorrectLevel, dataList) {
var rsBlocks = QRRSBlock.getRSBlocks(typeNumber, errorCorrectLevel); var buffer = new QRBitBuffer(); for (var i = 0; i < dataList.length; i++) { var data = dataList[i]; buffer.put(data.mode, 4); buffer.put(data.getLength(), QRUtil.getLengthInBits(data.mode, typeNumber)); data.write(buffer); }
var totalDataCount = 0; for (var i = 0; i < rsBlocks.length; i++) { totalDataCount += rsBlocks[i].dataCount; }
if (buffer.getLengthInBits() > totalDataCount * 8) {
throw new Error("code length overflow. ("
+ buffer.getLengthInBits()
+ ">"
+ totalDataCount * 8
+ ")");
}
if (buffer.getLengthInBits() + 4 <= totalDataCount * 8) { buffer.put(0, 4); }
while (buffer.getLengthInBits() % 8 != 0) { buffer.putBit(false); }
while (true) {
if (buffer.getLengthInBits() >= totalDataCount * 8) { break; }
buffer.put(QRCodeModel.PAD0, 8); if (buffer.getLengthInBits() >= totalDataCount * 8) { break; }
buffer.put(QRCodeModel.PAD1, 8);
}
return QRCodeModel.createBytes(buffer, rsBlocks);
};
QRCodeModel.createBytes = function (buffer, rsBlocks) {
var offset = 0; var maxDcCount = 0; var maxEcCount = 0; var dcdata = new Array(rsBlocks.length); var ecdata = new Array(rsBlocks.length); for (var r = 0; r < rsBlocks.length; r++) {
var dcCount = rsBlocks[r].dataCount; var ecCount = rsBlocks[r].totalCount - dcCount; maxDcCount = Math.max(maxDcCount, dcCount); maxEcCount = Math.max(maxEcCount, ecCount); dcdata[r] = new Array(dcCount); for (var i = 0; i < dcdata[r].length; i++) { dcdata[r][i] = 0xff & buffer.buffer[i + offset]; }
offset += dcCount; var rsPoly = QRUtil.getErrorCorrectPolynomial(ecCount); var rawPoly = new QRPolynomial(dcdata[r], rsPoly.getLength() - 1); var modPoly = rawPoly.mod(rsPoly); ecdata[r] = new Array(rsPoly.getLength() - 1); for (var i = 0; i < ecdata[r].length; i++) { var modIndex = i + modPoly.getLength() - ecdata[r].length; ecdata[r][i] = (modIndex >= 0) ? modPoly.get(modIndex) : 0; }
}
var totalCodeCount = 0; for (var i = 0; i < rsBlocks.length; i++) { totalCodeCount += rsBlocks[i].totalCount; }
var data = new Array(totalCodeCount); var index = 0; for (var i = 0; i < maxDcCount; i++) { for (var r = 0; r < rsBlocks.length; r++) { if (i < dcdata[r].length) { data[index++] = dcdata[r][i]; } } }
for (var i = 0; i < maxEcCount; i++) { for (var r = 0; r < rsBlocks.length; r++) { if (i < ecdata[r].length) { data[index++] = ecdata[r][i]; } } }
return data;
};
var QRMode = { MODE_NUMBER: 1 << 0, MODE_ALPHA_NUM: 1 << 1, MODE_8BIT_BYTE: 1 << 2, MODE_KANJI: 1 << 3 };
var QRErrorCorrectLevel = { L: 1, M: 0, Q: 3, H: 2 };
var QRMaskPattern = { PATTERN000: 0, PATTERN001: 1, PATTERN010: 2, PATTERN011: 3, PATTERN100: 4, PATTERN101: 5, PATTERN110: 6, PATTERN111: 7 };
var QRUtil = {
PATTERN_POSITION_TABLE: [[], [6, 18], [6, 22], [6, 26], [6, 30], [6, 34], [6, 22, 38], [6, 24, 42], [6, 26, 46], [6, 28, 50], [6, 30, 54], [6, 32, 58], [6, 34, 62], [6, 26, 46, 66], [6, 26, 48, 70], [6, 26, 50, 74], [6, 30, 54, 78], [6, 30, 56, 82], [6, 30, 58, 86], [6, 34, 62, 90], [6, 28, 50, 72, 94], [6, 26, 50, 74, 98], [6, 30, 54, 78, 102], [6, 28, 54, 80, 106], [6, 32, 58, 84, 110], [6, 30, 58, 86, 114], [6, 34, 62, 90, 118], [6, 26, 50, 74, 98, 122], [6, 30, 54, 78, 102, 126], [6, 26, 52, 78, 104, 130], [6, 30, 56, 82, 108, 134], [6, 34, 60, 86, 112, 138], [6, 30, 58, 86, 114, 142], [6, 34, 62, 90, 118, 146], [6, 30, 54, 78, 102, 126, 150], [6, 24, 50, 76, 102, 128, 154], [6, 28, 54, 80, 106, 132, 158], [6, 32, 58, 84, 110, 136, 162], [6, 26, 54, 82, 110, 138, 166], [6, 30, 58, 86, 114, 142, 170]], G15: (1 << 10) | (1 << 8) | (1 << 5) | (1 << 4) | (1 << 2) | (1 << 1) | (1 << 0), G18: (1 << 12) | (1 << 11) | (1 << 10) | (1 << 9) | (1 << 8) | (1 << 5) | (1 << 2) | (1 << 0), G15_MASK: (1 << 14) | (1 << 12) | (1 << 10) | (1 << 4) | (1 << 1), getBCHTypeInfo: function (data) {
var d = data << 10; while (QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G15) >= 0) { d ^= (QRUtil.G15 << (QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G15))); }
return ((data << 10) | d) ^ QRUtil.G15_MASK;
}, getBCHTypeNumber: function (data) {
var d = data << 12; while (QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G18) >= 0) { d ^= (QRUtil.G18 << (QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G18))); }
return (data << 12) | d;
}, getBCHDigit: function (data) {
var digit = 0; while (data != 0) { digit++; data >>>= 1; }
return digit;
}, getPatternPosition: function (typeNumber) { return QRUtil.PATTERN_POSITION_TABLE[typeNumber - 1]; }, getMask: function (maskPattern, i, j) { switch (maskPattern) { case QRMaskPattern.PATTERN000: return (i + j) % 2 == 0; case QRMaskPattern.PATTERN001: return i % 2 == 0; case QRMaskPattern.PATTERN010: return j % 3 == 0; case QRMaskPattern.PATTERN011: return (i + j) % 3 == 0; case QRMaskPattern.PATTERN100: return (Math.floor(i / 2) + Math.floor(j / 3)) % 2 == 0; case QRMaskPattern.PATTERN101: return (i * j) % 2 + (i * j) % 3 == 0; case QRMaskPattern.PATTERN110: return ((i * j) % 2 + (i * j) % 3) % 2 == 0; case QRMaskPattern.PATTERN111: return ((i * j) % 3 + (i + j) % 2) % 2 == 0; default: throw new Error("bad maskPattern:" + maskPattern); } }, getErrorCorrectPolynomial: function (errorCorrectLength) {
var a = new QRPolynomial([1], 0); for (var i = 0; i < errorCorrectLength; i++) { a = a.multiply(new QRPolynomial([1, QRMath.gexp(i)], 0)); }
return a;
}, getLengthInBits: function (mode, type) { if (1 <= type && type < 10) { switch (mode) { case QRMode.MODE_NUMBER: return 10; case QRMode.MODE_ALPHA_NUM: return 9; case QRMode.MODE_8BIT_BYTE: return 8; case QRMode.MODE_KANJI: return 8; default: throw new Error("mode:" + mode); } } else if (type < 27) { switch (mode) { case QRMode.MODE_NUMBER: return 12; case QRMode.MODE_ALPHA_NUM: return 11; case QRMode.MODE_8BIT_BYTE: return 16; case QRMode.MODE_KANJI: return 10; default: throw new Error("mode:" + mode); } } else if (type < 41) { switch (mode) { case QRMode.MODE_NUMBER: return 14; case QRMode.MODE_ALPHA_NUM: return 13; case QRMode.MODE_8BIT_BYTE: return 16; case QRMode.MODE_KANJI: return 12; default: throw new Error("mode:" + mode); } } else { throw new Error("type:" + type); } }, getLostPoint: function (qrCode) {
var moduleCount = qrCode.getModuleCount(); var lostPoint = 0; for (var row = 0; row < moduleCount; row++) {
for (var col = 0; col < moduleCount; col++) {
var sameCount = 0; var dark = qrCode.isDark(row, col); for (var r = -1; r <= 1; r++) {
if (row + r < 0 || moduleCount <= row + r) { continue; }
for (var c = -1; c <= 1; c++) {
if (col + c < 0 || moduleCount <= col + c) { continue; }
if (r == 0 && c == 0) { continue; }
if (dark == qrCode.isDark(row + r, col + c)) { sameCount++; }
}
}
if (sameCount > 5) { lostPoint += (3 + sameCount - 5); }
}
}
for (var row = 0; row < moduleCount - 1; row++) { for (var col = 0; col < moduleCount - 1; col++) { var count = 0; if (qrCode.isDark(row, col)) count++; if (qrCode.isDark(row + 1, col)) count++; if (qrCode.isDark(row, col + 1)) count++; if (qrCode.isDark(row + 1, col + 1)) count++; if (count == 0 || count == 4) { lostPoint += 3; } } }
for (var row = 0; row < moduleCount; row++) { for (var col = 0; col < moduleCount - 6; col++) { if (qrCode.isDark(row, col) && !qrCode.isDark(row, col + 1) && qrCode.isDark(row, col + 2) && qrCode.isDark(row, col + 3) && qrCode.isDark(row, col + 4) && !qrCode.isDark(row, col + 5) && qrCode.isDark(row, col + 6)) { lostPoint += 40; } } }
for (var col = 0; col < moduleCount; col++) { for (var row = 0; row < moduleCount - 6; row++) { if (qrCode.isDark(row, col) && !qrCode.isDark(row + 1, col) && qrCode.isDark(row + 2, col) && qrCode.isDark(row + 3, col) && qrCode.isDark(row + 4, col) && !qrCode.isDark(row + 5, col) && qrCode.isDark(row + 6, col)) { lostPoint += 40; } } }
var darkCount = 0; for (var col = 0; col < moduleCount; col++) { for (var row = 0; row < moduleCount; row++) { if (qrCode.isDark(row, col)) { darkCount++; } } }
var ratio = Math.abs(100 * darkCount / moduleCount / moduleCount - 50) / 5; lostPoint += ratio * 10; return lostPoint;
}
};
var QRMath = {
glog: function (n) {
if (n < 1) { throw new Error("glog(" + n + ")"); }
return QRMath.LOG_TABLE[n];
}, gexp: function (n) {
while (n < 0) { n += 255; }
while (n >= 256) { n -= 255; }
return QRMath.EXP_TABLE[n];
}, EXP_TABLE: new Array(256), LOG_TABLE: new Array(256)
}; for (var i = 0; i < 8; i++) { QRMath.EXP_TABLE[i] = 1 << i; }
for (var i = 8; i < 256; i++) { QRMath.EXP_TABLE[i] = QRMath.EXP_TABLE[i - 4] ^ QRMath.EXP_TABLE[i - 5] ^ QRMath.EXP_TABLE[i - 6] ^ QRMath.EXP_TABLE[i - 8]; }
for (var i = 0; i < 255; i++) { QRMath.LOG_TABLE[QRMath.EXP_TABLE[i]] = i; }
function QRPolynomial(num, shift) {
if (num.length == undefined) { throw new Error(num.length + "/" + shift); }
var offset = 0; while (offset < num.length && num[offset] == 0) { offset++; }
this.num = new Array(num.length - offset + shift); for (var i = 0; i < num.length - offset; i++) { this.num[i] = num[i + offset]; }
}
QRPolynomial.prototype = {
get: function (index) { return this.num[index]; }, getLength: function () { return this.num.length; }, multiply: function (e) {
var num = new Array(this.getLength() + e.getLength() - 1); for (var i = 0; i < this.getLength(); i++) { for (var j = 0; j < e.getLength(); j++) { num[i + j] ^= QRMath.gexp(QRMath.glog(this.get(i)) + QRMath.glog(e.get(j))); } }
return new QRPolynomial(num, 0);
}, mod: function (e) {
if (this.getLength() - e.getLength() < 0) { return this; }
var ratio = QRMath.glog(this.get(0)) - QRMath.glog(e.get(0)); var num = new Array(this.getLength()); for (var i = 0; i < this.getLength(); i++) { num[i] = this.get(i); }
for (var i = 0; i < e.getLength(); i++) { num[i] ^= QRMath.gexp(QRMath.glog(e.get(i)) + ratio); }
return new QRPolynomial(num, 0).mod(e);
}
};
function QRRSBlock(totalCount, dataCount) { this.totalCount = totalCount; this.dataCount = dataCount; }
QRRSBlock.RS_BLOCK_TABLE = [[1, 26, 19], [1, 26, 16], [1, 26, 13], [1, 26, 9], [1, 44, 34], [1, 44, 28], [1, 44, 22], [1, 44, 16], [1, 70, 55], [1, 70, 44], [2, 35, 17], [2, 35, 13], [1, 100, 80], [2, 50, 32], [2, 50, 24], [4, 25, 9], [1, 134, 108], [2, 67, 43], [2, 33, 15, 2, 34, 16], [2, 33, 11, 2, 34, 12], [2, 86, 68], [4, 43, 27], [4, 43, 19], [4, 43, 15], [2, 98, 78], [4, 49, 31], [2, 32, 14, 4, 33, 15], [4, 39, 13, 1, 40, 14], [2, 121, 97], [2, 60, 38, 2, 61, 39], [4, 40, 18, 2, 41, 19], [4, 40, 14, 2, 41, 15], [2, 146, 116], [3, 58, 36, 2, 59, 37], [4, 36, 16, 4, 37, 17], [4, 36, 12, 4, 37, 13], [2, 86, 68, 2, 87, 69], [4, 69, 43, 1, 70, 44], [6, 43, 19, 2, 44, 20], [6, 43, 15, 2, 44, 16], [4, 101, 81], [1, 80, 50, 4, 81, 51], [4, 50, 22, 4, 51, 23], [3, 36, 12, 8, 37, 13], [2, 116, 92, 2, 117, 93], [6, 58, 36, 2, 59, 37], [4, 46, 20, 6, 47, 21], [7, 42, 14, 4, 43, 15], [4, 133, 107], [8, 59, 37, 1, 60, 38], [8, 44, 20, 4, 45, 21], [12, 33, 11, 4, 34, 12], [3, 145, 115, 1, 146, 116], [4, 64, 40, 5, 65, 41], [11, 36, 16, 5, 37, 17], [11, 36, 12, 5, 37, 13], [5, 109, 87, 1, 110, 88], [5, 65, 41, 5, 66, 42], [5, 54, 24, 7, 55, 25], [11, 36, 12], [5, 122, 98, 1, 123, 99], [7, 73, 45, 3, 74, 46], [15, 43, 19, 2, 44, 20], [3, 45, 15, 13, 46, 16], [1, 135, 107, 5, 136, 108], [10, 74, 46, 1, 75, 47], [1, 50, 22, 15, 51, 23], [2, 42, 14, 17, 43, 15], [5, 150, 120, 1, 151, 121], [9, 69, 43, 4, 70, 44], [17, 50, 22, 1, 51, 23], [2, 42, 14, 19, 43, 15], [3, 141, 113, 4, 142, 114], [3, 70, 44, 11, 71, 45], [17, 47, 21, 4, 48, 22], [9, 39, 13, 16, 40, 14], [3, 135, 107, 5, 136, 108], [3, 67, 41, 13, 68, 42], [15, 54, 24, 5, 55, 25], [15, 43, 15, 10, 44, 16], [4, 144, 116, 4, 145, 117], [17, 68, 42], [17, 50, 22, 6, 51, 23], [19, 46, 16, 6, 47, 17], [2, 139, 111, 7, 140, 112], [17, 74, 46], [7, 54, 24, 16, 55, 25], [34, 37, 13], [4, 151, 121, 5, 152, 122], [4, 75, 47, 14, 76, 48], [11, 54, 24, 14, 55, 25], [16, 45, 15, 14, 46, 16], [6, 147, 117, 4, 148, 118], [6, 73, 45, 14, 74, 46], [11, 54, 24, 16, 55, 25], [30, 46, 16, 2, 47, 17], [8, 132, 106, 4, 133, 107], [8, 75, 47, 13, 76, 48], [7, 54, 24, 22, 55, 25], [22, 45, 15, 13, 46, 16], [10, 142, 114, 2, 143, 115], [19, 74, 46, 4, 75, 47], [28, 50, 22, 6, 51, 23], [33, 46, 16, 4, 47, 17], [8, 152, 122, 4, 153, 123], [22, 73, 45, 3, 74, 46], [8, 53, 23, 26, 54, 24], [12, 45, 15, 28, 46, 16], [3, 147, 117, 10, 148, 118], [3, 73, 45, 23, 74, 46], [4, 54, 24, 31, 55, 25], [11, 45, 15, 31, 46, 16], [7, 146, 116, 7, 147, 117], [21, 73, 45, 7, 74, 46], [1, 53, 23, 37, 54, 24], [19, 45, 15, 26, 46, 16], [5, 145, 115, 10, 146, 116], [19, 75, 47, 10, 76, 48], [15, 54, 24, 25, 55, 25], [23, 45, 15, 25, 46, 16], [13, 145, 115, 3, 146, 116], [2, 74, 46, 29, 75, 47], [42, 54, 24, 1, 55, 25], [23, 45, 15, 28, 46, 16], [17, 145, 115], [10, 74, 46, 23, 75, 47], [10, 54, 24, 35, 55, 25], [19, 45, 15, 35, 46, 16], [17, 145, 115, 1, 146, 116], [14, 74, 46, 21, 75, 47], [29, 54, 24, 19, 55, 25], [11, 45, 15, 46, 46, 16], [13, 145, 115, 6, 146, 116], [14, 74, 46, 23, 75, 47], [44, 54, 24, 7, 55, 25], [59, 46, 16, 1, 47, 17], [12, 151, 121, 7, 152, 122], [12, 75, 47, 26, 76, 48], [39, 54, 24, 14, 55, 25], [22, 45, 15, 41, 46, 16], [6, 151, 121, 14, 152, 122], [6, 75, 47, 34, 76, 48], [46, 54, 24, 10, 55, 25], [2, 45, 15, 64, 46, 16], [17, 152, 122, 4, 153, 123], [29, 74, 46, 14, 75, 47], [49, 54, 24, 10, 55, 25], [24, 45, 15, 46, 46, 16], [4, 152, 122, 18, 153, 123], [13, 74, 46, 32, 75, 47], [48, 54, 24, 14, 55, 25], [42, 45, 15, 32, 46, 16], [20, 147, 117, 4, 148, 118], [40, 75, 47, 7, 76, 48], [43, 54, 24, 22, 55, 25], [10, 45, 15, 67, 46, 16], [19, 148, 118, 6, 149, 119], [18, 75, 47, 31, 76, 48], [34, 54, 24, 34, 55, 25], [20, 45, 15, 61, 46, 16]];
QRRSBlock.getRSBlocks = function (typeNumber, errorCorrectLevel) {
var rsBlock = QRRSBlock.getRsBlockTable(typeNumber, errorCorrectLevel); if (rsBlock == undefined) { throw new Error("bad rs block @ typeNumber:" + typeNumber + "/errorCorrectLevel:" + errorCorrectLevel); }
var length = rsBlock.length / 3; var list = []; for (var i = 0; i < length; i++) { var count = rsBlock[i * 3 + 0]; var totalCount = rsBlock[i * 3 + 1]; var dataCount = rsBlock[i * 3 + 2]; for (var j = 0; j < count; j++) { list.push(new QRRSBlock(totalCount, dataCount)); } }
return list;
};
QRRSBlock.getRsBlockTable = function (typeNumber, errorCorrectLevel) { switch (errorCorrectLevel) { case QRErrorCorrectLevel.L: return QRRSBlock.RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 0]; case QRErrorCorrectLevel.M: return QRRSBlock.RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 1]; case QRErrorCorrectLevel.Q: return QRRSBlock.RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 2]; case QRErrorCorrectLevel.H: return QRRSBlock.RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 3]; default: return undefined; } };
function QRBitBuffer() { this.buffer = []; this.length = 0; }
QRBitBuffer.prototype = {
get: function (index) { var bufIndex = Math.floor(index / 8); return ((this.buffer[bufIndex] >>> (7 - index % 8)) & 1) == 1; }, put: function (num, length) { for (var i = 0; i < length; i++) { this.putBit(((num >>> (length - i - 1)) & 1) == 1); } }, getLengthInBits: function () { return this.length; }, putBit: function (bit) {
var bufIndex = Math.floor(this.length / 8); if (this.buffer.length <= bufIndex) { this.buffer.push(0); }
if (bit) { this.buffer[bufIndex] |= (0x80 >>> (this.length % 8)); }
this.length++;
}
};
var QRCodeLimitLength = [[17, 14, 11, 7], [32, 26, 20, 14], [53, 42, 32, 24], [78, 62, 46, 34], [106, 84, 60, 44], [134, 106, 74, 58], [154, 122, 86, 64], [192, 152, 108, 84], [230, 180, 130, 98], [271, 213, 151, 119], [321, 251, 177, 137], [367, 287, 203, 155], [425, 331, 241, 177], [458, 362, 258, 194], [520, 412, 292, 220], [586, 450, 322, 250], [644, 504, 364, 280], [718, 560, 394, 310], [792, 624, 442, 338], [858, 666, 482, 382], [929, 711, 509, 403], [1003, 779, 565, 439], [1091, 857, 611, 461], [1171, 911, 661, 511], [1273, 997, 715, 535], [1367, 1059, 751, 593], [1465, 1125, 805, 625], [1528, 1190, 868, 658], [1628, 1264, 908, 698], [1732, 1370, 982, 742], [1840, 1452, 1030, 790], [1952, 1538, 1112, 842], [2068, 1628, 1168, 898], [2188, 1722, 1228, 958], [2303, 1809, 1283, 983], [2431, 1911, 1351, 1051], [2563, 1989, 1423, 1093], [2699, 2099, 1499, 1139], [2809, 2213, 1579, 1219], [2953, 2331, 1663, 1273]];
// QRCode object
QRCode = function (canvasId, vOption) {
this._htOption = {
width: 256,
height: 256,
typeNumber: 4,
colorDark: "#000000",
colorLight: "#ffffff",
correctLevel: QRErrorCorrectLevel.H
};
if (typeof vOption === 'string') {
vOption = {
text: vOption
};
}
// Overwrites options
if (vOption) {
for (var i in vOption) {
this._htOption[i] = vOption[i];
}
}
this._oQRCode = null;
this.canvasId = canvasId
if (this._htOption.text && this.canvasId) {
this.makeCode(this._htOption.text);
}
};
QRCode.prototype.makeCode = function (sText) {
this._oQRCode = new QRCodeModel(_getTypeNumber(sText, this._htOption.correctLevel), this._htOption.correctLevel);
this._oQRCode.addData(sText);
this._oQRCode.make();
this.makeImage();
};
QRCode.prototype.makeImage = function () {
var _oContext
if (this._htOption.usingIn) {
_oContext = wx.createCanvasContext(this.canvasId, this._htOption.usingIn)
}
else {
_oContext = wx.createCanvasContext(this.canvasId)
}
var _htOption = this._htOption;
var oQRCode = this._oQRCode
var nCount = oQRCode.getModuleCount();
var nWidth = _htOption.width / nCount;
var nHeight = _htOption.height / nCount;
var nRoundedWidth = Math.round(nWidth);
var nRoundedHeight = Math.round(nHeight);
if (_htOption.image && _htOption.image != '') {
_oContext.drawImage(_htOption.image, 0, 0, _htOption.width, _htOption.height)
}
for (var row = 0; row < nCount; row++) {
for (var col = 0; col < nCount; col++) {
var bIsDark = oQRCode.isDark(row, col);
var nLeft = col * nWidth;
var nTop = row * nHeight;
_oContext.setStrokeStyle(bIsDark ? _htOption.colorDark : _htOption.colorLight)
// _oContext.setStrokeStyle('yellow')
_oContext.setLineWidth(1)
_oContext.setFillStyle(bIsDark ? _htOption.colorDark : _htOption.colorLight)
// _oContext.setFillStyle('red')
// if (bIsDark) {
_oContext.fillRect(nLeft, nTop, nWidth, nHeight);
// }
// 안티 앨리어싱 방지 처리
// if (bIsDark) {
_oContext.strokeRect(
Math.floor(nLeft) + 0.5,
Math.floor(nTop) + 0.5,
nRoundedWidth,
nRoundedHeight
);
_oContext.strokeRect(
Math.ceil(nLeft) - 0.5,
Math.ceil(nTop) - 0.5,
nRoundedWidth,
nRoundedHeight
);
// }
// _oContext.fillRect(
// Math.floor(nLeft) + 0.5,
// Math.floor(nTop) + 0.5,
// nRoundedWidth,
// nRoundedHeight
// );
// _oContext.fillRect(
// Math.ceil(nLeft) - 0.5,
// Math.ceil(nTop) - 0.5,
// nRoundedWidth,
// nRoundedHeight
// );
// _oContext.clearRect(
// Math.floor(nLeft) + 0.5,
// Math.floor(nTop) + 0.5,
// nRoundedWidth,
// nRoundedHeight
// );
// _oContext.clearRect(
// Math.ceil(nLeft) - 0.5,
// Math.ceil(nTop) - 0.5,
// nRoundedWidth,
// nRoundedHeight
// );
}
}
_oContext.draw()
};
QRCode.prototype.exportImage = function (callback) {
if (!callback) {
return
}
wx.canvasToTempFilePath({
x: 0,
y: 0,
width: this._htOption.width,
height: this._htOption.height,
destWidth: this._htOption.width,
destHeight: this._htOption.height,
canvasId: this.canvasId,
success: function (res) {
console.log(res.tempFilePath)
callback(res.tempFilePath)
}
})
}
QRCode.CorrectLevel = QRErrorCorrectLevel;
})();
module.exports = QRCode
+130
View File
@@ -0,0 +1,130 @@
/**
* https://github.com/caiya/wxTimer
*/
var wxTimer = function(initObj) {
initObj = initObj || {};
this.leftTime = initObj.leftTime || 0; //开始时间
this.interval = initObj.interval || 1; //间隔时间
this.complete = initObj.complete; //结束任务
this.intervalFn = initObj.intervalFn; //间隔任务
this.name = initObj.name; //当前计时器在计时器数组对象中的名字
this.intervarID; //计时ID
};
wxTimer.prototype = {
dateformat: function(micro_second) {
// 总秒数
var second = Math.floor(micro_second);
// 天数
var day = Math.floor(second / 3600 / 24);
// 总小时
var hr = Math.floor(second / 3600);
// 小时位
var hr2 = hr % 24;
// 分钟位
var min = Math.floor((second - hr * 3600) / 60);
// 秒位
var sec = second - hr * 3600 - min * 60; // equal to => var sec = second % 60;
// 毫秒位,保留2位
var micro_sec = Math.floor((micro_second % 1000) / 10);
return hr2;
},
dateformat_hur: function(micro_second) {
// 总秒数
var second = Math.floor(micro_second);
// 天数
var day = Math.floor(second / 3600 / 24);
// 总小时
var hr = Math.floor(second / 3600);
// 小时位
var hr2 = hr % 24;
// 分钟位
var min = Math.floor((second - hr * 3600) / 60);
// 秒位
var sec = second - hr * 3600 - min * 60; // equal to => var sec = second % 60;
// 毫秒位,保留2位
var micro_sec = Math.floor((micro_second % 1000) / 10);
return min;
},
dateformat_tim: function(micro_second) {
// 总秒数
var second = Math.floor(micro_second);
// 天数
var day = Math.floor(second / 3600 / 24);
// 总小时
var hr = Math.floor(second / 3600);
// 小时位
var hr2 = hr % 24;
// 分钟位
var min = Math.floor((second - hr * 3600) / 60);
// 秒位
var sec = second - hr * 3600 - min * 60; // equal to => var sec = second % 60;
// 毫秒位,保留2位
var micro_sec = Math.floor((micro_second % 1000) / 10);
return sec;
},
dateformats: function(micro_second) {
// 总秒数
var second = Math.floor(micro_second);
var day = Math.floor(second / 3600 / 24);
// 总小时
var hr = Math.floor(second / 3600);
// 小时位
var hr2 = hr % 24;
// 分钟位
var min = Math.floor((second - hr * 3600) / 60);
// 秒位
var sec = second - hr * 3600 - min * 60; // equal to => var sec = second % 60;
// 毫秒位,保留2位
var micro_sec = Math.floor((micro_second % 1000) / 10);
return day;
},
//开始
start: function(self) {
var that = this;
//开始倒计时
var count = 0; //这个count在这里应该是表示s数,js中获得时间是ms,所以下面*1000都换成ms
function begin() {
var collageHour = that.dateformat(that.leftTime); //时
var collageDay = that.dateformats(that.leftTime); //天
var collageMin = that.dateformat_hur(that.leftTime); //分
var collageTim = that.dateformat_tim(that.leftTime); //秒
var tmpTimeStr = `${collageDay}${collageHour}${collageMin}${collageTim}`;
var wxTimerList = self.data.wxTimerList;
//更新计时器数组
wxTimerList[that.name] = {
wxTimer: tmpTimeStr
};
self.setData({
wxTimer: tmpTimeStr,
wxTimerList: wxTimerList
});
//时间间隔执行函数
if (0 == that.leftTime-- % that.interval && that.intervalFn) {
that.intervalFn();
}
//结束执行函数
if (that.leftTime <= 0) {
if (that.complete) {
that.complete();
}
that.stop();
}
}
begin();
this.intervarID = setInterval(begin, 1000);
},
//结束
stop: function() {
clearInterval(this.intervarID);
}
};
module.exports = wxTimer;
+983
View File
@@ -0,0 +1,983 @@
import Config from '../config';
import { HttpNoUkeyRequest, HttpRequest, asyncLogin, app } from 'httpRequest';
let apiQuery = Object.assign({});
apiQuery.asyncLogin = asyncLogin;
apiQuery.getUserInfo = function (params,isLoading=false) {
return new Promise(function (resolve, reject) {
HttpRequest(isLoading, Config.api.appUser, 2, params, "GET", function (res) {
app.setStorage("userInfo", res.data);
resolve(res.data);
}, reject)
})
}
apiQuery.putUserInfo = function (params) {
return new Promise(function (resolve, reject) {
HttpRequest(true, Config.api.appUser, 2, params, "PUT", function (res) {
console.log(res)
app.setStorage("userInfo", res.data);
resolve(res.data);
}, reject)
})
}
//用户手机号码授权
apiQuery.authUserPhone = function (params) {
return new Promise(function (resolve, reject) {
if (params.detail.errMsg.indexOf("deny") === -1) {
asyncLogin().then(res => {
apiQuery.putUserInfo({
encryptedData: params.detail.encryptedData,
iv: params.detail.iv
}).then(res => {
//设置本地存储
resolve(res)
})
})
} else {
wx.showToast({
title: '您拒绝授权,将无法进行更多操作!',
icon: 'none',
duration: 2000
});
reject();
}
})
}
//登录
apiQuery.getUserUkey = function(params){
return new Promise(function (resolve, reject) {
HttpNoUkeyRequest(false, Config.api.appUserUkey, 2, params, "GET", resolve, reject)
})
}
//获取验证码
apiQuery.getAppSms = function (params) {
return new Promise(function (resolve, reject) {
HttpNoUkeyRequest(false, Config.api.appSms, 2, params, "GET", resolve, reject)
})
}
//退出登录 /作废
apiQuery.putLogout = function (params) {
return new Promise(function (resolve, reject) {
HttpRequest(false, Config.api.appUserUkey, 2, params, "PUT", resolve, reject)
})
}
//获取车型库
apiQuery.getAppSeriesCars = function (params) {
return new Promise(function (resolve, reject) {
HttpRequest(false, Config.api.appSeriesCars, 2, params, "GET", resolve, reject)
})
}
//获取车型属性
apiQuery.getAppSeriesAttrs = function (params) {
return new Promise(function (resolve, reject) {
HttpRequest(false, Config.api.appSeriesAttrs, 2, params, "GET", resolve, reject)
})
}
//获取tab
apiQuery.getAppCustomersTabs = function (params) {
return new Promise(function (resolve, reject) {
HttpRequest(false, Config.api.appCustomersTabs, 2, params, "GET", resolve, reject)
})
}
//获取客户列表
apiQuery.getAppCustomersList = function (params) {
return new Promise(function (resolve, reject) {
HttpRequest(false, Config.api.appCustomers, 2, params, "GET", resolve, reject)
})
}
//获取客户详情
apiQuery.getAppCustomersDetails = function (params) {
return new Promise(function (resolve, reject) {
HttpRequest(true, Config.api.appCustomers, 2, params, "GET", resolve, reject)
})
}
//获取列表筛选条件
apiQuery.getAppCustomersFilter = function (params) {
return new Promise(function (resolve, reject) {
HttpRequest(false, Config.api.appCustomersFilter, 2, params, "GET", resolve, reject)
})
}
//新建客户
apiQuery.postAppCustomers = function (params) {
return new Promise(function (resolve, reject) {
HttpRequest(true, Config.api.appCustomers, 2, params, "POST", resolve, reject)
})
}
//修改状态和到店次数、试驾次数
apiQuery.putAppCustomers = function (params) {
return new Promise(function (resolve, reject) {
HttpRequest(true, Config.api.appCustomers, 2, params, "PUT", resolve, reject)
})
}
//客户发短信
apiQuery.postAppSmsCustomer = function (params) {
return new Promise(function (resolve, reject) {
HttpRequest(true, Config.api.appSmsCustomer, 2, params, "POST", resolve, reject)
})
}
//订单发短信
apiQuery.postAppSmsCusorder = function (params) {
return new Promise(function (resolve, reject) {
HttpRequest(true, Config.api.appSmsCusorder, 2, params, "POST", resolve, reject)
})
}
//获取日志
apiQuery.getAppCustomerlogs = function (params) {
return new Promise(function (resolve, reject) {
HttpRequest(false, Config.api.appCustomerlogs, 2, params, "GET", resolve, reject)
})
}
//获取客户详细信息
apiQuery.getAppCustomerData = function (params) {
return new Promise(function (resolve, reject) {
HttpRequest(false, Config.api.appCustomerData, 2, params, "GET", resolve, reject)
})
}
//获取订单列表
apiQuery.getAppCusorderList = function (params) {
return new Promise(function (resolve, reject) {
HttpRequest(false, Config.api.appCusorder, 2, params, "GET", resolve, reject)
})
}
//获取订单详情
apiQuery.getAppCusorderDetails = function (params) {
return new Promise(function (resolve, reject) {
HttpRequest(false, Config.api.appCusorder, 2, params, "GET", resolve, reject)
})
}
//新建订单
apiQuery.postAppCusorder = function (params) {
return new Promise(function (resolve, reject) {
HttpRequest(true, Config.api.appCusorder, 2, params, "POST", resolve, reject)
})
}
//修改付款方式 /修改委托协议
apiQuery.putAppCusorder = function (params) {
return new Promise(function (resolve, reject) {
HttpRequest(false, Config.api.appCusorder, 2, params, "PUT", resolve, reject)
})
}
//获取tab
apiQuery.getAppCusorderTabs = function (params) {
return new Promise(function (resolve, reject) {
HttpRequest(false, Config.api.appCusorderTabs, 2, params, "GET", resolve, reject)
})
}
//获取店员列表
apiQuery.getAppEmployees = function (params) {
return new Promise(function (resolve, reject) {
HttpRequest(false, Config.api.appEmployees, 2, params, "GET", resolve, reject)
})
}
//新建店员
apiQuery.postAppEmployees = function (params) {
return new Promise(function (resolve, reject) {
HttpRequest(true, Config.api.appEmployees, 2, params, "POST", resolve, reject)
})
}
//更新店员信息 //提交离职
apiQuery.putAppEmployees = function (params) {
return new Promise(function (resolve, reject) {
HttpRequest(true, Config.api.appEmployees, 2, params, "PUT", resolve, reject)
})
}
//删除店员
apiQuery.deleteAppEmployees = function (params) {
return new Promise(function (resolve, reject) {
HttpRequest(true, Config.api.appEmployees, 2, params, "DELETE", resolve, reject)
})
}
//创建申请开票信息
apiQuery.postAppIdcard = function (params) {
return new Promise(function (resolve, reject) {
HttpRequest(true, Config.api.appIdcard, 2, params, "POST", resolve, reject)
})
}
//修改申请开票信息
apiQuery.putAppIdcard = function (params) {
return new Promise(function (resolve, reject) {
HttpRequest(true, Config.api.appIdcard, 2, params, "PUT", resolve, reject)
})
}
//获取用户统计
apiQuery.getAppUserCal = function (params) {
return new Promise(function (resolve, reject) {
HttpRequest(true, Config.api.appUserCal, 2, params, "GET", resolve, reject)
})
}
//确认交付
apiQuery.putAppCusorderCkcar = function (params) {
return new Promise(function (resolve, reject) {
HttpRequest(true, Config.api.appCusorderCkcar, 2, params, "PUT", resolve, reject)
})
}
//分配客户
apiQuery.putAppCustomersAdmins = function (params) {
return new Promise(function (resolve, reject) {
HttpRequest(true, Config.api.appCustomersAdmins, 2, params, "PUT", resolve, reject)
})
}
//获取虚拟电话
apiQuery.getAppXz = function (params) {
return new Promise(function (resolve, reject) {
HttpRequest(false, Config.api.appXz, 2, params, "GET", resolve, reject)
})
}
//新增日志 /作废
apiQuery.postAppCustomerlogs = function (params) {
return new Promise(function (resolve, reject) {
HttpRequest(true, Config.api.appCustomerlogs, 2, params, "POST", resolve, reject)
})
}
//修改客户基本信息
apiQuery.putAppCustomerData = function (params) {
return new Promise(function (resolve, reject) {
HttpRequest(false, Config.api.appCustomerData, 2, params, "PUT", resolve, reject)
})
}
//获取代办包
apiQuery.getAppServicesPackage = function (params) {
return new Promise(function (resolve, reject) {
HttpRequest(false, Config.api.appServicesPackage, 2, params, "GET", resolve, reject)
})
}
//获取车辆价格
apiQuery.getAppSeriesInfo = function(params){
return new Promise(function (resolve, reject) {
HttpRequest(false, Config.api.appSeriesInfo, 2, params, "GET", resolve, reject)
})
}
//获取商务政策
apiQuery.getAppBusiness = function(params){
return new Promise(function (resolve, reject) {
HttpRequest(false, Config.api.appBusiness, 2, params, "GET", resolve, reject)
})
}
//获取车型品牌
apiQuery.getAppSeriesBrands = function(params){
return new Promise(function (resolve, reject) {
HttpRequest(false, Config.api.appSeriesBrands, 2, params, "GET", resolve, reject)
})
}
//获取车系车型
apiQuery.getAppSeries = function(params){
return new Promise(function (resolve, reject) {
HttpRequest(false, Config.api.appSeries, 2, params, "GET", resolve, reject)
})
}
// 编辑拨打电话
apiQuery.putAppUserTel = function (params) {
return new Promise(function (resolve, reject) {
HttpRequest(false, Config.api.appUserTel, 2, params, "PUT", resolve, reject)
})
}
//获取金融产品列表
apiQuery.getAppFinance = function(params){
return new Promise(function (resolve, reject) {
HttpRequest(false, Config.api.appFinance, 2, params, "GET", resolve, reject)
})
}
//获取金融分期期数
apiQuery.getAppFinanceNums = function(params){
return new Promise(function (resolve, reject) {
HttpRequest(false, Config.api.appFinanceNums, 2, params, "GET", resolve, reject)
})
}
//获取管理门店
apiQuery.getAppUserBizs = function(params){
return new Promise(function (resolve, reject) {
HttpRequest(true, Config.api.appUserBizs, 2, params, "GET", resolve, reject)
})
}
//获取渠道客户统计
apiQuery.getAppStatisticsCust = function(params){
return new Promise(function (resolve, reject) {
HttpRequest(false, Config.api.appStatisticsCust, 2, params, "GET", resolve, reject)
})
}
//获取渠道订单统计
apiQuery.getAppStatisticsOrders = function(params){
return new Promise(function (resolve, reject) {
HttpRequest(false, Config.api.appStatisticsOrders, 2, params, "GET", resolve, reject)
})
}
//获取门店管理员
apiQuery.getAppUserAdmins = function(params){
return new Promise(function (resolve, reject) {
HttpRequest(false, Config.api.appUserAdmins, 2, params, "GET", resolve, reject)
})
}
//数据分析-客户数据
apiQuery.getAppStatisticsScust = function(params){
return new Promise(function (resolve, reject) {
HttpRequest(false, Config.api.appStatisticsScust, 2, params, "GET", resolve, reject)
})
}
//数据分析-订单数据
apiQuery.getAppStatisticsOcust = function(params){
return new Promise(function (resolve, reject) {
HttpRequest(false, Config.api.appStatisticsOcust, 2, params, "GET", resolve, reject)
})
}
//首页-客户图标数据
apiQuery.getAppStatisticsHcust = function(params){
return new Promise(function (resolve, reject) {
HttpRequest(false, Config.api.appStatisticsHcust, 2, params, "GET", resolve, reject)
})
}
//首页-订单图表数据
apiQuery.getAppStatisticsHorder = function(params){
return new Promise(function (resolve, reject) {
HttpRequest(false, Config.api.appStatisticsHorder, 2, params, "GET", resolve, reject)
})
}
//更新用户店铺id
apiQuery.putAppUserResetbiz = function (params) {
return new Promise(function (resolve, reject) {
HttpRequest(false, Config.api.appUserResetbiz, 2, params, "PUT", resolve, reject)
})
}
//获取电话统计数据
apiQuery.getAppXzStat = function(params){
return new Promise(function (resolve, reject) {
HttpRequest(false, Config.api.appXzStat, 2, params, "GET", resolve, reject)
})
}
//获取系统配置城市
apiQuery.getAppCity = function(params){
return new Promise(function (resolve, reject) {
HttpRequest(false, Config.api.appCity, 2, params, "GET", resolve, reject)
})
}
//推广素材_tab
apiQuery.getMaterialHomeTabs = function(params){
return new Promise(function (resolve, reject) {
HttpRequest(false, Config.api.materialHomeTabs, 2, params, "GET", resolve, reject)
})
}
//推广素材_lists
apiQuery.getMaterialHomeLists = function(params){
return new Promise(function (resolve, reject) {
HttpRequest(false, Config.api.materialHomeLists, 2, params, "GET", resolve, reject)
})
}
//生成专题
apiQuery.putMaterialHomeTopic = function (params) {
return new Promise(function (resolve, reject) {
HttpRequest(false, Config.api.materialHomeTopic, 2, params, "PUT", resolve, reject)
})
}
//专题首页
apiQuery.getMaterialTopic = function(params){
return new Promise(function (resolve, reject) {
HttpRequest(false, Config.api.materialTopic, 2, params, "GET", resolve, reject)
})
}
//获取二维码
apiQuery.getMaterialHomeQrcode = function(params){
return new Promise(function (resolve, reject) {
HttpRequest(false, Config.api.materialHomeQrcode, 2, params, "GET", resolve, reject)
})
}
//数据分析_首页
apiQuery.getMaterialStatistics = function (params) {
return new Promise(function (resolve, reject) {
HttpRequest(false, Config.api.materialStatistics, 2, params, "GET", resolve, reject)
})
}
//数据分析_累计数据
apiQuery.getMaterialStatisticsCal = function (params) {
return new Promise(function (resolve, reject) {
HttpRequest(false, Config.api.materialStatisticsCal, 2, params, "GET", resolve, reject)
})
}
//数据分析_图表
apiQuery.getMaterialStatisticsChart = function (params) {
return new Promise(function (resolve, reject) {
HttpRequest(false, Config.api.materialStatisticsChart, 2, params, "GET", resolve, reject)
})
}
//战败客户列表
apiQuery.getAppCustomersDefeats = function (params) {
return new Promise(function (resolve, reject) {
HttpRequest(false, Config.api.appCustomersDefeats, 2, params, "GET", resolve, reject)
})
}
//战败/再战申请
apiQuery.putAppCustomersDefeats = function (params) {
return new Promise(function (resolve, reject) {
HttpRequest(false, Config.api.appCustomersDefeats, 2, params, "PUT", resolve, reject)
})
}
//新建订单(新)
apiQuery.postAppCusorder2 = function (params) {
return new Promise(function (resolve, reject) {
HttpRequest(true, Config.api.appCusorder2, 2, params, "POST", resolve, reject)
})
}
//修改订单信息
apiQuery.putAppCusorder2 = function (params) {
return new Promise(function (resolve, reject) {
HttpRequest(false, Config.api.appCusorder2, 2, params, "PUT", resolve, reject)
})
}
//获取代办服务列表
apiQuery.getAppServices = function (params) {
return new Promise(function (resolve, reject) {
HttpRequest(false, Config.api.appServices, 2, params, "GET", resolve, reject)
})
}
//获取精品赠送列表
apiQuery.getAppFine = function (params) {
return new Promise(function (resolve, reject) {
HttpRequest(false, Config.api.appFine, 2, params, "GET", resolve, reject)
})
}
//店铺海报
apiQuery.getMaterialHomeBiz = function (params) {
return new Promise(function (resolve, reject) {
HttpRequest(false, Config.api.materialHomeBiz, 2, params, "GET", resolve, reject)
})
}
//保存店铺海报
apiQuery.putMaterialHomePosters = function (params) {
return new Promise(function (resolve, reject) {
HttpRequest(false, Config.api.materialHomePosters, 2, params, "PUT", resolve, reject)
})
}
//获取车辆确定随车资料
apiQuery.getAppDelivery = function (params) {
return new Promise(function (resolve, reject) {
HttpRequest(false, Config.api.appDelivery, 2, params, "GET", resolve, reject)
})
}
//店铺海报模版
apiQuery.getMaterialHomeBiz_posters = function (params) {
return new Promise(function (resolve, reject) {
HttpRequest(false, Config.api.materialHomeBiz_posters, 2, params, "GET", resolve, reject)
})
}
//调拨记录
apiQuery.getAppTransferLists = function (params) {
return new Promise(function (resolve, reject) {
HttpRequest(false, Config.api.appTransferLists, 2, params, "GET", resolve, reject)
})
}
//调拨详情
apiQuery.getAppTransfer = function (params) {
return new Promise(function (resolve, reject) {
HttpRequest(true, Config.api.appTransfer, 2, params, "GET", resolve, reject)
})
}
//确认发车/接车
apiQuery.putAppTransfer = function (params) {
return new Promise(function (resolve, reject) {
HttpRequest(true, Config.api.appTransfer, 2, params, "PUT", resolve, reject)
})
}
//报备异常
apiQuery.postAppTransfer = function (params) {
return new Promise(function (resolve, reject) {
HttpRequest(true, Config.api.appTransfer, 2, params, "POST", resolve, reject)
})
}
//调拨提醒
apiQuery.getAppTransferRemind = function (params) {
return new Promise(function (resolve, reject) {
HttpRequest(false, Config.api.appTransferRemind, 2, params, "GET", resolve, reject)
})
}
//上传资料
apiQuery.putAppCusorderCdata = function (params) {
return new Promise(function (resolve, reject) {
HttpRequest(false, Config.api.appCusorderCdata, 2, params, "PUT", resolve, reject)
})
}
//获取佣金设置
apiQuery.getAppBrokerage = function (params) {
return new Promise(function (resolve, reject) {
HttpRequest(false, Config.api.appBrokerage, 2, params, "GET", resolve, reject)
})
}
//创建佣金设置
apiQuery.postAppBrokerage = function (params) {
return new Promise(function (resolve, reject) {
HttpRequest(true, Config.api.appBrokerage, 2, params, "POST", resolve, reject)
})
}
//更新佣金设置
apiQuery.putAppBrokerage = function (params) {
return new Promise(function (resolve, reject) {
HttpRequest(true, Config.api.appBrokerage, 2, params, "PUT", resolve, reject)
})
}
//转介绍列表
apiQuery.getAppBrokerageOrders = function (params) {
return new Promise(function (resolve, reject) {
HttpRequest(false, Config.api.appBrokerageOrders, 2, params, "GET", resolve, reject)
})
}
//调拨记录_tab
apiQuery.getAppTransferTabs = function (params) {
return new Promise(function (resolve, reject) {
HttpRequest(false, Config.api.appTransferTabs, 2, params, "GET", resolve, reject)
})
}
//上传运输单
apiQuery.postAppTransferTransport = function (params) {
return new Promise(function (resolve, reject) {
HttpRequest(true, Config.api.appTransferTransport, 2, params, "POST", resolve, reject)
})
}
//店铺概况_tab
apiQuery.getAppBizSituation_tabs = function (params) {
return new Promise(function (resolve, reject) {
HttpRequest(false, Config.api.appBizSituation_tabs, 2, params, "GET", resolve, reject)
})
}
//店铺概况
apiQuery.getAppBizSituation = function (params) {
return new Promise(function (resolve, reject) {
HttpRequest(false, Config.api.appBizSituation, 2, params, "GET", resolve, reject)
})
}
//店铺概况保存
apiQuery.postAppBizSituation = function (params) {
return new Promise(function (resolve, reject) {
HttpRequest(true, Config.api.appBizSituation, 2, params, "POST", resolve, reject)
})
}
//获取乡镇
apiQuery.getAppBizStreet = function (params) {
return new Promise(function (resolve, reject) {
HttpRequest(false, Config.api.appBizStreet, 2, params, "GET", resolve, reject)
})
}
//新增意向金订单
apiQuery.postAppCusorderV2Inten = function (params) {
return new Promise(function (resolve, reject) {
HttpRequest(true, Config.api.appCusorderV2Inten, 2, params, "POST", resolve, reject)
})
}
//新建订单
apiQuery.postAppCusorderV2 = function (params) {
return new Promise(function (resolve, reject) {
HttpRequest(true, Config.api.appCusorderV2, 2, params, "POST", resolve, reject)
})
}
//获取订单列表tab
apiQuery.getAppCusorderV2Tabs = function (params) {
return new Promise(function (resolve, reject) {
HttpRequest(false, Config.api.appCusorderV2Tabs, 2, params, "GET", resolve, reject)
})
}
//获取订单列表
apiQuery.getAppCusorderV2List = function (params) {
return new Promise(function (resolve, reject) {
HttpRequest(false, Config.api.appCusorderV2, 2, params, "GET", resolve, reject)
})
}
//订单详情
apiQuery.getAppCusorderV2 = function (params) {
return new Promise(function (resolve, reject) {
HttpRequest(false, Config.api.appCusorderV2, 2, params, "GET", resolve, reject)
})
}
//获取订单图片
apiQuery.getAppCusorderdata = function (params) {
return new Promise(function (resolve, reject) {
HttpRequest(false, Config.api.appCusorderdata, 2, params, "GET", resolve, reject)
})
}
//上传编辑国补资料
apiQuery.putAppCusorderdata = function (params) {
return new Promise(function (resolve, reject) {
HttpRequest(false, Config.api.appCusorderdata, 2, params, "PUT", resolve, reject)
})
}
//修改订单信息
apiQuery.putAppCusorderV2 = function (params) {
return new Promise(function (resolve, reject) {
HttpRequest(true, Config.api.appCusorderV2, 2, params, "PUT", resolve, reject)
})
}
//修改订单基本信息
apiQuery.putAppCusorderV2Info = function (params) {
return new Promise(function (resolve, reject) {
HttpRequest(true, Config.api.appCusorderV2Info, 2, params, "PUT", resolve, reject)
})
}
//删除订单
apiQuery.putAppCusorderV2Status = function (params) {
return new Promise(function (resolve, reject) {
HttpRequest(true, Config.api.appCusorderV2Status, 2, params, "PUT", resolve, reject)
})
}
//私域通_tab
apiQuery.getAppSytactivityTabs = function (params) {
return new Promise(function (resolve, reject) {
HttpRequest(false, Config.api.appSytactivityTabs, 2, params, "GET", resolve, reject)
})
}
//活动列表
apiQuery.getAppSytactivityList = function (params) {
return new Promise(function (resolve, reject) {
HttpRequest(false, Config.api.appSytactivityList, 2, params, "GET", resolve, reject)
})
}
//活动详情
apiQuery.getAppSytactivityDetail = function (params) {
return new Promise(function (resolve, reject) {
HttpRequest(false, Config.api.appSytactivityDetail, 2, params, "GET", resolve, reject)
})
}
//实时战报
apiQuery.getAppSytactivityLog = function (params) {
return new Promise(function (resolve, reject) {
HttpRequest(false, Config.api.appSytactivityLog, 2, params, "GET", resolve, reject)
})
}
//活动排名
apiQuery.getAppSytactivityRanking = function (params) {
return new Promise(function (resolve, reject) {
HttpRequest(false, Config.api.appSytactivityRanking, 2, params, "GET", resolve, reject)
})
}
//盘点记录_tab
apiQuery.getAppInventoryTabs = function (params) {
return new Promise(function (resolve, reject) {
HttpRequest(false, Config.api.appInventoryTabs, 2, params, "GET", resolve, reject)
})
}
//盘点列表
apiQuery.getAppInventoryLists = function (params) {
return new Promise(function (resolve, reject) {
HttpRequest(false, Config.api.appInventoryLists, 2, params, "GET", resolve, reject)
})
}
//盘点详情
apiQuery.getAppInventory = function (params) {
return new Promise(function (resolve, reject) {
HttpRequest(false, Config.api.appInventory, 2, params, "GET", resolve, reject)
})
}
//确认盘点
apiQuery.postAppInventory = function (params) {
return new Promise(function (resolve, reject) {
HttpRequest(true, Config.api.appInventory, 2, params, "POST", resolve, reject)
})
}
//盘点提醒
apiQuery.getAppInventoryRemind = function (params) {
return new Promise(function (resolve, reject) {
HttpRequest(false, Config.api.appInventoryRemind, 2, params, "GET", resolve, reject)
})
}
//库存提醒/预警
apiQuery.getAppGoodsRemind = function (params) {
return new Promise(function (resolve, reject) {
HttpRequest(false, Config.api.appGoodsRemind, 2, params, "GET", resolve, reject)
})
}
//库存列表
apiQuery.getAppGoodsLists = function (params) {
return new Promise(function (resolve, reject) {
HttpRequest(false, Config.api.appGoodsLists, 2, params, "GET", resolve, reject)
})
}
//客户来源
apiQuery.getAppCustomersOffline_sources = function (params) {
return new Promise(function (resolve, reject) {
HttpRequest(false, Config.api.appCustomersOffline_sources, 2, params, "GET", resolve, reject)
})
}
//客户标签
apiQuery.getAppCustomersTag = function (params) {
return new Promise(function (resolve, reject) {
HttpRequest(false, Config.api.appCustomersTag, 2, params, "GET", resolve, reject)
})
}
//修改贷款信息
apiQuery.putAppLoan = function (params) {
return new Promise(function (resolve, reject) {
HttpRequest(true, Config.api.appLoan, 2, params, "PUT", resolve, reject)
})
}
//获取上牌城市
apiQuery.getAppCityOncard = function (params) {
return new Promise(function (resolve, reject) {
HttpRequest(false, Config.api.appCityOncard, 2, params, "GET", resolve, reject)
})
}
//获取金融分期期数
apiQuery.getAppFinanceNums = function (params) {
return new Promise(function (resolve, reject) {
HttpRequest(false, Config.api.appFinanceNums, 2, params, "GET", resolve, reject)
})
}
//获取客户订单
apiQuery.getAppCusorderV2Customer = function (params) {
return new Promise(function (resolve, reject) {
HttpRequest(false, Config.api.appCusorderV2Customer, 2, params, "GET", resolve, reject)
})
}
//回访待跟进tab
apiQuery.getAppCustomersVisit_tabs = function (params) {
return new Promise(function (resolve, reject) {
HttpRequest(false, Config.api.appCustomersVisit_tabs, 2, params, "GET", resolve, reject)
})
}
//识别身份证号码
apiQuery.getAppIdcardInfo = function (params) {
return new Promise(function (resolve, reject) {
HttpRequest(false, Config.api.appIdcardInfo, 2, params, "GET", resolve, reject)
})
}
//用户评论
apiQuery.postAppCustomersComments = function (params) {
return new Promise(function (resolve, reject) {
HttpRequest(true, Config.api.appCustomersComments, 2, params, "POST", resolve, reject)
})
}
//获取省/市/区/街道
apiQuery.getAppCityArea = function (params) {
return new Promise(function (resolve, reject) {
HttpRequest(false, Config.api.appCityArea, 2, params, "GET", resolve, reject)
})
}
//获取离职
apiQuery.getAppEmployeesLeave = function (params) {
return new Promise(function (resolve, reject) {
HttpRequest(false, Config.api.appEmployeesLeave, 2, params, "GET", resolve, reject)
})
}
//提交离职
apiQuery.putAppEmployeesLeave = function (params) {
return new Promise(function (resolve, reject) {
HttpRequest(true, Config.api.appEmployeesLeave, 2, params, "PUT", resolve, reject)
})
}
//分配订单
apiQuery.putAppCusorderV2Admins = function (params) {
return new Promise(function (resolve, reject) {
HttpRequest(true, Config.api.appCusorderV2Admins, 2, params, "PUT", resolve, reject)
})
}
//保单信息确认
apiQuery.putAppCusorderdataInfo = function (params) {
return new Promise(function (resolve, reject) {
HttpRequest(true, Config.api.appCusorderdataInfo, 2, params, "PUT", resolve, reject)
})
}
//数据看板首页
apiQuery.getAppBizStats = function (params) {
return new Promise(function (resolve, reject) {
HttpRequest(false, Config.api.appBizStats, 2, params, "GET", resolve, reject)
})
}
//客户数据
apiQuery.getAppBizStats_customer = function (params) {
return new Promise(function (resolve, reject) {
HttpRequest(false, Config.api.appBizStats_customer, 2, params, "GET", resolve, reject)
})
}
//企微数据
apiQuery.getAppBizStats_wxqy = function (params) {
return new Promise(function (resolve, reject) {
HttpRequest(false, Config.api.appBizStats_wxqy, 2, params, "GET", resolve, reject)
})
}
//订单数据
apiQuery.getAppBizStats_order = function (params) {
return new Promise(function (resolve, reject) {
HttpRequest(false, Config.api.appBizStats_order, 2, params, "GET", resolve, reject)
})
}
//客户/订单走势图
apiQuery.getAppBizStats_days = function (params) {
return new Promise(function (resolve, reject) {
HttpRequest(false, Config.api.appBizStats_days, 2, params, "GET", resolve, reject)
})
}
//客户数据二级
apiQuery.getAppBizStats_customer_pid = function (params) {
return new Promise(function (resolve, reject) {
HttpRequest(false, Config.api.appBizStats_customer_pid, 2, params, "GET", resolve, reject)
})
}
//品牌数据二级
apiQuery.getAppBizStats_order_series = function (params) {
return new Promise(function (resolve, reject) {
HttpRequest(false, Config.api.appBizStats_order_series, 2, params, "GET", resolve, reject)
})
}
//获取渠道经理数据分析入口数据
apiQuery.getAppStatisticsStats = function (params) {
return new Promise(function (resolve, reject) {
HttpRequest(false, Config.api.appStatisticsStats, 2, params, "GET", resolve, reject)
})
}
//获取渠道经理数据分析数据
apiQuery.getAppStatisticsStats_days = function (params) {
return new Promise(function (resolve, reject) {
HttpRequest(false, Config.api.appStatisticsStats_days, 2, params, "GET", resolve, reject)
})
}
//获取渠道经理数据分析数据
apiQuery.getAppStatisticsStats_customer = function (params) {
return new Promise(function (resolve, reject) {
HttpRequest(false, Config.api.appStatisticsStats_customer, 2, params, "GET", resolve, reject)
})
}
//获取车辆选装包
apiQuery.getAppOptions = function (params) {
return new Promise(function (resolve, reject) {
HttpRequest(false, Config.api.appOptions, 2, params, "GET", resolve, reject)
})
}
//切换角色
apiQuery.putAppResetgroupid = function (params) {
return new Promise(function (resolve, reject) {
HttpRequest(true, Config.api.appResetgroupid, 2, params, "PUT", resolve, reject)
})
}
export default apiQuery;
+180
View File
@@ -0,0 +1,180 @@
/**
* 绘制圆角矩形
* @param {Object} context - canvas组件的绘图上下文
* @param {Number} x - 矩形的x坐标
* @param {Number} y - 矩形的y坐标
* @param {Number} w - 矩形的宽度
* @param {Number} h - 矩形的高度
* @param {Number} r - 矩形的圆角半径
* @param {String} [c = 'transparent'] - 矩形的填充色
*/
const roundRect = (context, x, y, w, h, r, c = 'transparent') => {
if (w < 2 * r) {
r = w / 2;
}
if (h < 2 * r) {
r = h / 2;
}
context.beginPath();
context.fillStyle = c;
context.arc(x + r, y + r, r, Math.PI, Math.PI * 1.5);
context.moveTo(x + r, y);
context.lineTo(x + w - r, y);
context.lineTo(x + w, y + r);
context.arc(x + w - r, y + r, r, Math.PI * 1.5, Math.PI * 2);
context.lineTo(x + w, y + h - r);
context.lineTo(x + w - r, y + h);
context.arc(x + w - r, y + h - r, r, 0, Math.PI * 0.5);
context.lineTo(x + r, y + h);
context.lineTo(x, y + h - r);
context.arc(x + r, y + h - r, r, Math.PI * 0.5, Math.PI);
context.lineTo(x, y + r);
context.lineTo(x + r, y);
context.fill();
context.closePath();
};
/**
* 绘制圆角图片
* @param {Object} context - canvas组件的绘图上下文
* @param {Number} r - 圆角半径
* @param {String} path - 图片地址
* @param {Number} sx - 源图像的矩形选择框的左上角 x 坐标
* @param {Number} sy - 源图像的矩形选择框的左上角 y 坐标
* @param {Number} sWidth - 源图像的矩形选择框的宽度
* @param {Number} sHeight - 源图像的矩形选择框的高度
* @param {Number} dx - 图像的左上角在目标 canvas 上 x 轴的位置
* @param {Number} dy - 图像的左上角在目标 canvas 上 y 轴的位置
* @param {Number} dWidth - 在目标画布上绘制图像的宽度,允许对绘制的图像进行缩放
* @param {Number} dHeight - 在目标画布上绘制图像的高度,允许对绘制的图像进行缩放
* @param {String} c - 矩形的填充色
*/
const roundImage = (context, r, path, sx, sy, sWidth, sHeight, dx, dy, dWidth, dHeight, c) => {
context.save();
roundRect(context, dx, dy, dWidth, dHeight, r, c);
context.fill();
context.clip();
context.drawImage(path, sx, sy, sWidth, sHeight, dx, dy, dWidth, dHeight);
context.restore();
};
/**
* 绘制圆形图片
* @param {Object} context - canvas组件的绘图上下文
* @param {String} path - 图片地址
* @param {Number} x - 图片的x坐标
* @param {Number} y - 图片的y坐标
* @param {Number} r - 图片的半径
*/
const circleImage = (context, path, x, y, r) => {
let d = 2 * r;
let cx = x + r;
let cy = y + r;
context.save();
context.beginPath();
context.arc(cx, cy, r, 0, 2 * Math.PI);
context.fill();
context.clip();
context.drawImage(path, x, y, d, d);
context.restore();
};
/**
* 多行文本溢出
* @param {Object} context - canvas组件的绘图上下文
* @param {String} text - 文本内容
* @param {Number} maxWidth - 文本最大宽度
* @param {Number} maxRow - 文本最多显示行数
* @param {String} font - 字体样式
* @param {String} color - 文本颜色
* @param {Number} lineHeight - 文本行高
* @param {Number} x - 文本的x坐标
* @param {Number} y - 文本的y坐标
* @param {String} align - 文本居左居右
* @param {String} decoration - 文字装饰,支持 underline、 overline、 line-through
*/
const drawTextOverflow = (context, text, maxWidth, maxRow, font, color, lineHeight, x, y,align='left',decoration='') => {
let arr = [];
let temp = '';
let row = [];
text = text.replace(/[\r\n]/g, ''); // 去除回车换行符
arr = text.split('');
//context.font = font; // 注意:一定要先设置字号,否则会出现文本变形
context.setFontSize(font);
context.setFillStyle(color);
context.setTextAlign(align);
if (context.measureText(text).width <= maxWidth) {
row.push(text);
} else {
for (let i = 0; i < arr.length; i++) {
// 超出最大行数且字符有剩余,添加...
if (row.length == maxRow && i < arr.length - 1) {
row[row.length - 1] += '...';
break;
}
// 字符换行计算
if (context.measureText(temp).width < maxWidth) {
temp += arr[i];
// 遍历到最后一位字符
if (i === arr.length - 1) {
row.push(temp);
}
} else {
i--; // 防止字符丢失
row.push(temp);
temp = '';
}
}
}
// 绘制文本
for (let i = 0; i < row.length; i++) {
context.fillText(row[i], x, y + i * lineHeight, maxWidth);
}
let measuredWith = context.measureText(text).width
if (decoration) {
context.beginPath();
if (/\bunderline\b/.test(decoration)) {
context.moveTo(x, y);
context.lineTo(x + measuredWith, y);
}
if (/\boverline\b/.test(decoration)) {
context.moveTo(x, y - font);
context.lineTo(x + measuredWith, y - font);
}
if (/\bline-through\b/.test(decoration)) {
context.moveTo(x, y - font / 3);
context.lineTo(x + measuredWith, y - font / 3);
}
context.closePath();
context.strokeStyle = color;
context.stroke();
}
context.save()
return row.length * lineHeight; // 返回文本高度
};
module.exports = {
roundRect,
roundImage,
circleImage,
drawTextOverflow
}
+255
View File
@@ -0,0 +1,255 @@
import Config from '../config';
import { toEncrypt, randomString } from 'stringEncrypt';
let app = getApp();
function HttpNoUkeyRequest(loading, url, sessionChoose, params, method, callBack, reject) {
if (loading == true) {
wx.showLoading();
}
let paramSession = sessionChoose == 1 ? {
'content-type': 'application/x-www-form-urlencoded'
} : {
'content-type': 'application/json'
};
var params = Object.prototype.toString.call(params) == "[object Object]" ? params : {};
params["version"] = Config.version;
params["nonce_str"] = randomString();
params["app_id"] = Config.app_id;
let serectParams = {
...params,
sign: toEncrypt(params)
}
wx.request({
url: Config.api.baseUrl + url,
data: serectParams,
dataType: "json",
header: paramSession,
method: method,
success: function (res) {
if (loading == true) {
wx.hideLoading(); //隐藏提示框
}
//token 存在 还返回408,这个时候就要强制
if (res.data.code == 408) {
if (getCurrentPages().pop().route != 'pages/login/index') {
wx.clearStorage()
wx.reLaunch({
url: '/pages/login/index'
})
}
} else {
if (res.data.code == 200) {
callBack(res.data);
} else {
app.printErrorClient('failrequest', ['api地址:' + url, '传入数据:' + JSON.stringify(serectParams), '响应数据:' + JSON.stringify(res.data)])
reject(res.data);
if (Config.white401UrlList[url] === url) {//接口白名单
return
}
wx.showToast({
title: res.data.msg,
icon: "none",
duration: 2500
});
}
}
},
fail: function (res) {
console.warn("HttpRequst当中wx.request fail 执行了:调用失败")
app.printErrorClient('failrequest', ['HttpRequst当中wx.request fail 执行了:调用失败', 'api地址:' + url, '传入数据:' + JSON.stringify(serectParams), '响应数据:' + JSON.stringify(res.data)])
}
})
}
function HttpRequest(loading, url, sessionChoose, params, method, callBack, reject) {
let ukey = app.getStorageByKey("ukey");
let requestUrl = Config.api.baseUrl;
//判断ukey是否存在
// 存在就继续执行
if (!!ukey) {
if (loading == true) {
wx.showLoading();
}
let paramSession = sessionChoose == 1 ? {
'content-type': 'application/x-www-form-urlencoded'
} : {
'content-type': 'application/json'
};
var params = Object.prototype.toString.call(params) == "[object Object]" ? params : {};
params["ukey"] = ukey;
params["version"] = Config.version;
params["nonce_str"] = randomString();
params["app_id"] = Config.app_id;
let serectParams = {
...params,
sign: toEncrypt(params)
}
wx.request({
url: Config.api.baseUrl + url,
data: serectParams,
dataType: "json",
header: paramSession,
method: method,
success: function (res) {
if (loading == true) {
wx.hideLoading(); //隐藏提示框
}
//token 存在 还返回408,这个时候就要强制
if (res.data.code == 408) {
// asyncLogin(true).then((res) => {
// console.log("asyncLogin().then-success")
// HttpRequest(loading, url, sessionChoose, params, method, callBack, reject)
// })
//if (getCurrentPages().pop().route != 'pages/login/index'){
wx.clearStorage()
wx.reLaunch({
url: '/pages/login/index'
})
//}
}else{
if (res.data.code==200){
callBack(res.data);
}else{
app.printErrorClient('failrequest',['api地址:'+url,'传入数据:'+JSON.stringify(serectParams),'响应数据:'+JSON.stringify(res.data)])
reject(res.data);
if (Config.white401UrlList[url] === url) {//接口白名单
return
}
if(res.data.msg){
wx.showToast({
title: res.data.msg,
icon: "none"
});
}
}
}
},
fail: function (res) {
console.warn("HttpRequst当中wx.request fail 执行了:调用失败")
app.printErrorClient('failrequest',['HttpRequst当中wx.request fail 执行了:调用失败','api地址:'+url,'传入数据:'+JSON.stringify(serectParams),'响应数据:'+JSON.stringify(res.data)])
}
})
} else {
//不存在(或者) 重走登录流程
//第一个执行的时候 后面的都需要挂起来
// asyncLogin().then((res) => {
// console.log("asyncLogin().then-没有token")
// HttpRequest(loading, url, sessionChoose, params, method, callBack, reject)
// })
//if (getCurrentPages().pop().route != 'pages/login/index') {
wx.clearStorage()
wx.reLaunch({
url: '/pages/login/index'
})
//}
}
}
function asyncLogin(flag) {
return new Promise((reslove, reject) => {
if (app.globalData.loginRuning) {
//已经在执行了
app.globalData.loginCollect.push(reslove);
} else {
app.globalData.loginRuning = true;
work(reslove, reject, flag)
}
})
}
function _resloveRun() {
app.globalData.loginCollect.forEach((reslove) => {
reslove();
// console.log("app.globalData.loginCollect.forEach")
});
// console.log("_resloveRun")
app.globalData.loginRuning = false;
app.globalData.loginCollect = [];
}
function work(reslove, reject, flag) {
wx.checkSession({
success: function () {
//同步获取token
let ukey = app.getStorageByKey("ukey");
console.log("asyncLogin(checkSession-success)-ukey:" + ukey)
//为了安全验证 判断ukey是否有本地存储
if (!ukey || (!!ukey && flag)) {
wxLogin(reslove);
} else {
//重新走登录流程
reslove(ukey);
_resloveRun();
}
},
fail: function () {
//重新走登录流程
wxLogin(reslove);
}
})
}
function wxLogin(reslove) {
wx.login({
success(res) {
console.log("执行了wx.login-code:"+res.code)
if (res.code) {
let params = {
code: res.code,
app_id: Config.app_id,
nonce_str: randomString()
}
let sendData={
...params,
sign: toEncrypt(params)
}
wx.request({
url: Config.api.baseUrl + Config.api.appUserUkey,
data: sendData,
dataType: "json",
header: {
'content-type': 'application/json'
},
method: "GET",
success: function (res) {
console.log("wx.login-ukey:"+res.data.data.ukey)
if (res.data.code == 200) {
app.globalData.ukey = res.data.data.ukey;
app.setStorage("ukey", res.data.data.ukey, function () {
reslove();
_resloveRun();
})
}
},
fail: function (res) {
console.warn("wxLogin当中wx.request fail 执行了:调用失败")
}
})
} else {
console.warn('登录失败!' + res.errMsg)
}
},
fail: function () {
console.warn("调用wx.login接口失败!")
}
})
}
app.asyncLogin = asyncLogin;
export { HttpNoUkeyRequest, HttpRequest, asyncLogin, app }
+26
View File
@@ -0,0 +1,26 @@
var log = wx.getRealtimeLogManager ? wx.getRealtimeLogManager() : null
module.exports = {
info() {
if (!log) return
log.info.apply(log, arguments)
},
warn() {
if (!log) return
log.warn.apply(log, arguments)
},
error() {
if (!log) return
log.error.apply(log, arguments)
},
setFilterMsg(msg) { // 从基础库2.7.3开始支持
if (!log || !log.setFilterMsg) return
if (typeof msg !== 'string') return
log.setFilterMsg(msg)
},
addFilterMsg(msg) { // 从基础库2.8.1开始支持
if (!log || !log.addFilterMsg) return
if (typeof msg !== 'string') return
log.addFilterMsg(msg)
}
}
+310
View File
@@ -0,0 +1,310 @@
/**
* 使用方法:
* 1.脚本顶部引入 const app = getApp();
* 2.Utils.$router.push(name,params,type,openMode)
* -1params为传入参数和值,如果params有值,将存在本地存储中
* -2)如果type(默认为params)为query时,参数会拼接到url后面
* -3openMode 开发方式 默认navigateTo
* 3.Utils.$router.reLaunch(name,params,type)//打开到应用内的某个页面,可跳转到Tabbar页面
* 4.Utils.$router.redirect(name,params,type)//打开到应用内的某个页面,不可重定向到Tabbar页面
* 5.Utils.$router.switchTab(name)//跳转指定的tab页
* 6.Utils.$router.back(deltah,params)//返回上n级页面
* 7.Utils.$router.backHome(params)//返回到首页
* 8.Utils.$router.webviewRedirect(name, params, openMode)//跳转到webview页面
* 9.Utils.$router.openUrlScheme //传入url结构解析后跳转
* 10.链式调用successfailcomplete
* 例:Util.$router.push("mine")
.success(res => {
console.log("success: ", res)
})
.fail(err => {
console.log("fail: ", res)
})
.complete(_ => {
console.log("complete")
})
*/
const symbol = {
reLaunch: Symbol(),
redirect: Symbol(),
switchTab: Symbol(),
}
export default class Router {
/**
* constructor 🚀
*/
constructor() {
// 当前页面携带的参数 (缓存在storage中)
this.params = null
// 当前页面携带的参数 (在query中)
this.query = null
this.callbacks = {}
this.success = function (onSuccess) {
this.callbacks.onSuccess = onSuccess
return this
}
this.fail = function (onFail) {
this.callbacks.onFail = onFail
return this
}
this.complete = function (onComplete) {
this.callbacks.onComplete = onComplete
return this
}
}
/******** Public ********/
/**
* 保留当前页面,跳转到应用内的某个页面。但是不能跳到 tabbar 页面
* @param name
* @param params
* @returns {*}
*/
push(name, params = null, type = 'params', openMode = 'navigateTo') {
// const page = isFullPath ? { url: name, name: name}:this.getPageFor(name)
const page = {
url: name,
name: name
}
if (!page) {
throw Error(`!! Not found page ->[${name}] !!`)
return
}
this.currentPage = page
if (params) {
const key = `router-${page.name}-params`
wx.setStorageSync(key, params)
this.params = this._getParams(key)
} else {
this.params = null
}
if (type === 'query') {
this.params = {}
page.url += "?"
for (let key in params) {
console.log("key: ", key)
page.url += `${key}=${params[key]}&`
this.params[key] = params[key]
}
page.url = page.url.slice(0, -1)
console.log("this.params", this.params)
}
const [, , obj] = Array.from(arguments)
const that = this
let f = wx.navigateTo
if (obj && Object.is(obj.fn, symbol.reLaunch)) {
f = wx.reLaunch
}
if (obj && Object.is(obj.fn, symbol.redirect)) {
f = wx.redirectTo
}
if (obj && Object.is(obj.fn, symbol.switchTab)) {
f = wx.switchTab
}
if (openMode == 'reLaunch') {
f = wx.reLaunch
} else if (openMode == 'redirect') {
f = wx.redirectTo
} else if(openMode == 'switchTab') {
f = wx.switchTab
}
f({
url: page.url,
...that._getFunc()
})
return this
}
/**
* 关闭所有页面,打开到应用内的某个页面 可传递参数 可跳转到Tabbar页面
* @param name
* @param params
*/
reLaunch(name, params = null, type = 'params') {
return this.push(name, params, {
fn: symbol.reLaunch
}, type)
}
/**
* 关闭所有页面,打开到应用内的某个页面 可传递参数 不可重定向到Tabbar页面
* @param name
* @param params
*/
redirect(name, params = null, type = 'params') {
return this.push(name, params, {
fn: symbol.redirect
}, type)
}
/**
* 跳转指定的tab页
* @param name
* @returns {*}
*/
//lcb://switchTab/pages/card/index
switchTab(name) {
return this.push(name, null, {
fn: symbol.switchTab
})
}
/**
* 关闭当前页面,返回上一页面或多级页面。 没有参数 代表返回上一页
* @param delta
* @param params
*/
back(delta = 1, params = null) {
if (params) {
const key = `router-${this._currentPage.name}-params`
wx.setStorageSync(key, params)
this.params = this._getParams(key)
} else {
this.params = null
}
wx.navigateBack({
delta,
...this._getFunc()
})
return this
}
/**
* 关闭所有页面返回到首页
* @param params
*/
backHome(params = null) {
// return this.back(Number.MAX_SAFE_INTEGER, params)
return this.reLaunch('/pages/index/index')
}
/**
* 跳转到webview页面
* @param name
* @param params
*/
webviewRedirect(url = null, title = '', openMode = 'navigateTo') {
return this.push('/pages/web-view/index', {
title: title,
url: encodeURIComponent(url)
}, 'query', openMode)
}
/**
* 跳转到其他小程序
* @param url
*/
//调整小程序数据格式,appId要先加到app.json中
//'lcb://navigateToMiniPrograms??appId=wx636830278bc7b5f4@path=/pages/consultant?id=1@envVersion=release@extraData={"fromwhere":"aolai"}'
navigateToMiniProgramRedirect(OBJ) {
let search = OBJ.split('??')[1]
let appId = this._getQueryString('appId',search)
let path = this._getQueryString('path',search)
let extraData = JSON.parse(this._getQueryString('extraData',search))
let envVersion = this._getQueryString('envVersion',search) || 'release'
wx.navigateToMiniProgram({
appId: appId,
path: path,
extraData: extraData,
envVersion: envVersion
})
return this
}
/**
* 传入url结构解析后跳转
* @param url
*/
openUrlScheme(url = null, title = '', extraData = {}, openMode = 'navigateTo') {
if (url.indexOf('lcb://navigateToMiniProgram') > -1) {
this.navigateToMiniProgramRedirect(url)
} else if (url.indexOf('lcb://switchTab') > -1) {
this.switchTab(url.split('switchTab')[1])
// } else if(url.indexOf('ixm://reLaunch')>-1) {
// this.reLaunch(url.split('reLaunch')[1])
// } else if(url.indexOf('ixm://redirectTo')>-1) {
// this.redirect(url.split('redirectTo')[1])
// } else if(url.indexOf('ixm://navigateTo')>-1){
// this.push(url.split('navigateTo')[1])
// } else if(url.indexOf('ixm://navigateBack')>-1){
// this.back(url.split('navigateBack/')[1])
}else if (url.indexOf('http') > -1) {
this.webviewRedirect(url, title, extraData, openMode)
} else {
this.push(url)
}
return this
}
/******** Private ********/
/**
* 获取函数
* @returns {{fail: fail, success: success, complete: complete}}
* @private
*/
_getFunc() {
let that = this
return {
success: function (res) {
if (that.callbacks.onSuccess) that.callbacks.onSuccess(res)
},
fail: function (err) {
if (that.callbacks.onFail) that.callbacks.onFail(err)
},
complete: function () {
if (that.callbacks.onComplete) that.callbacks.onComplete()
}
}
}
/**
* 获取当前跳转的页面的携带的参数
* @param key
* @returns {*}
* @private
*/
_getParams(key) {
return wx.getStorageSync(key)
}
/**
* 获取url的query值
* @param name
* @private
*/
_getQueryString = (name, url) => {
if (url.indexOf(name) > -1) {
var reg = new RegExp('(^|@)' + name + '=([^@]*)(@|$)', 'i');
var r = url.match(reg)
if (r != null) {
return decodeURI(r[2]);
}
}
return null;
}
}
+144
View File
@@ -0,0 +1,144 @@
/**
* date:2019-10-17
* author: lien
* desc: import StringEncrypt from '文件路径'; StringEncrypt.toEncrypt(this.data.dd,'xmfish')
*/
import md5 from '../lib/md5'
import Config from '../config'
/**
* utf-8加密
*/
function encodeUtf8(text) {
const code = encodeURIComponent(text);
const bytes = [];
for (var i = 0; i < code.length; i++) {
const c = code.charAt(i);
if (c === '%') {
const hex = code.charAt(i + 1) + code.charAt(i + 2);
const hexVal = parseInt(hex, 16);
bytes.push(hexVal);
i += 2;
} else bytes.push(c.charCodeAt(0));
}
return bytes;
}
/**
* utf-8解密
*/
function decodeUtf8(bytes) {
var encoded = "";
for (var i = 0; i < bytes.length; i++) {
encoded += '%' + bytes[i].toString(16);
}
return decodeURIComponent(encoded);
}
/**
* 生成从minNum到maxNum的随机数
*/
function randomNum(minNum, maxNum) {
switch (arguments.length) {
case 1:
return parseInt(Math.random() * minNum + 1, 10);
break;
case 2:
return parseInt(Math.random() * (maxNum - minNum + 1) + minNum, 10);
break;
default:
return 0;
break;
}
}
/**
* 随机加密串
*/
function randomString(len) {
len = len || 32;
let $chars = 'ABCDEFGHJKMNPQRSTWXYZabcdefhijkmnprstwxyz2345678'; /****默认去掉了容易混淆的字符oOLl,9gq,Vv,Uu,I1****/
let maxPos = $chars.length;
let pwd = '';
let newLen = randomNum(10, len)
for (let i = 0; i < newLen; i++) {
pwd += $chars.charAt(Math.floor(Math.random() * maxPos));
}
return pwd;
}
/**
* 获取数据
*/
let getData = (DATA) => {
return DATA
}
/**
* 删除空值
*/
let delEmptyValue = (DATA) => {
let data = getData(DATA)
let newData = {}
for (let i in data) {
if (data[i] !== '' && Object.prototype.toString.call(data[i]) != "[object Array]" && Object.prototype.toString.call(data[i]) != "[object Object]") {
newData[i] = data[i]
}
}
return newData
}
/**
* 按ascii码从小到大排序
*/
let sortByAscii = (DATA) => {
let obj = {
...delEmptyValue(DATA)
}
let arr = new Array();
let num = 0;
for (let i in obj) {
arr[num] = i;
num++;
}
let sortArr = arr.sort();
//let sortObj = {}; //完成排序值
let str = ''; //自定义排序字符串
for (let i in sortArr) {
str += sortArr[i] + '=' + obj[sortArr[i]] + '&';
//sortObj[sortArr[i]] = obj[sortArr[i]];
}
//去除两侧字符串
let char = '&'
str = str.replace(new RegExp('^\\' + char + '+|\\' + char + '+$', 'g'), '');
return str
//return sortObj
}
/**
* 拼接字符串
*/
let combineUrl = (DATA) => {
let data = sortByAscii(DATA)
let str = data + '&key=' + Config.key
// console.log("发送的字符串:"+str)
return str
}
/**
* 加密字符串
*/
let toEncrypt = (DATA) => {
// let secretKey = randomString()
let data = combineUrl(DATA)
//console.log(data)//加密原始数据
return md5.hex_md5(data);
}
module.exports = {
toEncrypt,
randomString
}
+55
View File
@@ -0,0 +1,55 @@
// import config from '../config'
import api from '../utils/apiQuery'
const app = getApp()
/**
* 获取用户信息
*/
function getAjaxUserInfo(){
return new Promise(function (resolve, reject) {
api.getUserInfo().then(res=>{
resolve(res)
})
})
}
/**
* 判断用户是否授权用户信息
*/
function isAuthUserInfo() {
return new Promise(function (resolve, reject) {
api.getUserInfo().then(res=>{
resolve(Boolean(res && res.headimg))
})
})
}
/**
* 判断用户是否绑定手机
*/
function isBindMobile() {
return new Promise(function (resolve, reject) {
api.getUserInfo().then(res=>{
resolve(res && res.mobile)
})
})
}
/**
* 是否开卡
*/
function isOpenCard() {
return new Promise(function (resolve, reject) {
api.getUserInfo().then(res=>{
resolve(res && res.card_id)
})
})
}
module.exports = {
getAjaxUserInfo,
isAuthUserInfo,
isBindMobile,
isOpenCard,
}
+389
View File
@@ -0,0 +1,389 @@
import log from 'log.js'
const app = getApp();
const formatTime = date => {
const year = date.getFullYear()
const month = date.getMonth() + 1
const day = date.getDate()
const hour = date.getHours()
const minute = date.getMinutes()
const second = date.getSeconds()
return [year, month, day].map(formatNumber).join('/') + ' ' + [hour, minute, second].map(formatNumber).join(':')
}
/**
* 获取时间戳
* @param {*}
*/
const getTimestamp = () => {
return new Date().getTime()
}
const formatNumber = n => {
n = n.toString()
return n[1] ? n : '0' + n
}
const padding = (s, len) => {
len = len - (s + '').length
for (var i = 0; i < len; i++) {
s = '0' + s
}
return s
}
var DEFAULT_PATTERN = 'yyyy-MM-dd'
var SIGN_REGEXP = /([yMdhsm])(\1*)/g
const formatDate = {
formatYYMMDD: function (time) {
let date = new Date(time)
return date.toLocaleDateString().replace(RegExp('/', 'g'), '-') + ' 00:00:00'
},
format: function (date, pattern) {
pattern = pattern || DEFAULT_PATTERN
return pattern.replace(SIGN_REGEXP, function ($0) {
switch ($0.charAt(0)) {
case 'y':
return padding(date.getFullYear(), $0.length)
case 'M':
return padding(date.getMonth() + 1, $0.length)
case 'd':
return padding(date.getDate(), $0.length)
case 'w':
return date.getDay() + 1
case 'h':
return padding(date.getHours(), $0.length)
case 'm':
return padding(date.getMinutes(), $0.length)
case 's':
return padding(date.getSeconds(), $0.length)
}
})
}
}
const getNowTimeFormate = (TYPE) => {
var date = ''
switch (TYPE) {
case 'DAY':
date = formatDate.format(new Date())
// return date.slice(0, 4)+'-'+date.slice(4, 6)+'-'+date.slice(6, 8)
return date
break;
case 'MONTH':
date = formatDate.format(new Date(), 'yyyyMM')
return date.slice(0, 4) + '-' + date.slice(4, 6)
break;
case 'TIME':
date = formatDate.format(new Date(), 'yyyyMMddhhmmss')
return date.slice(0, 4) + '-' + date.slice(4, 6) + '-' + date.slice(6, 8) + ' ' + date.slice(8, 10) + ':' + date.slice(10, 12) + ':' + date.slice(12, 14)
break;
}
}
/**
* 打开地图
*/
const openLocation = function (params) {
wx.openLocation({
latitude: params.latitude,
longitude: params.longitude,
name: params.name || '',
address: params.address || '',
scale: params.scale || 18
})
}
/**
* 提示框
*/
const $toast = function (message, time = 1500) {
return new Promise((resolve, reject) => {
wx.showToast({
title: message,
icon: 'none',
duration: time,
success: function (res) {
resolve(res)
}
})
})
}
/**
* 对话框
*/
const $modal = function (title, content, confirmText = '确定', cancelText = '取消') {
return new Promise((resolve, reject) => {
wx.showModal({
title: title,
content: content,
confirmText: confirmText,
cancelText: cancelText,
success: function (res) {
if (res.confirm) {
// 确认按钮点击
resolve(true)
} else if (res.cancel) {
// 取消按钮点击
resolve(false)
}
}
})
})
}
/**
* 获取状态栏高度
*/
const getStatusBarHeight = () => {
let barHeight = ''
wx.getSystemInfo({
success: function (res) {
barHeight = res.statusBarHeight
}
})
return barHeight
}
/**
* 获取当前路径
*/
function getCurrentPath() {
var pages = getCurrentPages() //获取加载的页面
var currentPage = pages[pages.length - 1] //获取当前页面的对象
return {
pages: pages, //获取所有页面
url: currentPage.route, //当前页面url
options: currentPage.options //如果要获取url中所带的参数可以查看options
}
}
/**
* 获取路由跳转过来的数据
*/
function getRouterData(URL) {
return wx.getStorageSync('router-/' + URL + '-params')
}
/**
* 防止多次重复点击 (函数节流)
*/
function throttle(fn, gapTime) {
if (gapTime == null || gapTime == undefined) {
gapTime = 1000
}
let _lastTime = null
// 返回新的函数
return (function (e) {
// console.log(this)
let _nowTime = +new Date()
if (_nowTime - _lastTime > gapTime || !_lastTime) {
// fn.apply(this, arguments) //将this和参数传给原函数
fn(this, e) //上方法不可行的解决办法 改变this和e
_lastTime = _nowTime
}
})()
}
/*函数防抖*/
function debounce(fn, interval) {
var timer;
var gapTime = interval || 200; //间隔时间,如果interval不传,则默认200ms
return function () {
clearTimeout(timer);
var context = this;
var args = arguments; //保存此处的arguments,因为setTimeout是全局的,arguments不是防抖函数需要的。
timer = setTimeout(function () {
fn.call(context, args);
}, gapTime);
};
}
//去掉前后空格
function trim(s) {
return s.toString().replace(/(^\s*)|(\s*$)/g, "");
}
//过滤所以空格
function filterSpace(s) {
return s.toString().replace(/\ +/g, "");
}
function getNumber(str) {
return str.toString().match(/\d+(\.\d{0,2})?/)[0]
}
function compareVersion(v1, v2) {
v1 = v1.split('.')
v2 = v2.split('.')
const len = Math.max(v1.length, v2.length)
while (v1.length < len) {
v1.push('0')
}
while (v2.length < len) {
v2.push('0')
}
for (let i = 0; i < len; i++) {
const num1 = parseInt(v1[i])
const num2 = parseInt(v2[i])
if (num1 > num2) {
return 1
} else if (num1 < num2) {
return -1
}
}
return 0
}
/**
* 内存报警
* 报警后,使用reLaunch,并记录当前页面及页面栈
*/
function memoryWarning() {
wx.onMemoryWarning(function () {
let getPath = getCurrentPath()
wx.reportAnalytics('outofmemory', getPath)
wx.reportMonitor('0', 500)
wx.reLaunch(getPath.url)
app.printErrorClient('filteroutofmemory')
})
}
/**
* 取消内存报警
*/
function offMemoryWarning() {
if (wx.canIUse('offMemoryWarning')) {
wx.offMemoryWarning()
app.printErrorClient('offmemory')
} else {
app.printErrorClient('offmemorylowversion')
log.warn('当前微信版本' + wx.getSystemInfoSync().SDKVersion + '过低,无法使用该功能,请升级到最新微信版本后重试。')
}
}
/**
* 设置底部导航选中
*/
function setBottomTabbar(page, isUnRead, that) {
if (typeof that.getTabBar === 'function' &&
that.getTabBar()) {
that.getTabBar().setData({
show: true,
selected: page,
isUnRead: isUnRead || false
})
}
}
/**
* 页面滚动到指定的上一个dom位置
*/
function scrollPageToDom(el, extraHeight = 0) {
let query = wx.createSelectorQuery()
query.select(el).boundingClientRect()
query.selectViewport().scrollOffset()
query.exec(function (res) {
wx.pageScrollTo({
scrollTop: res[0].height + extraHeight,
duration: 100
});
})
}
/**
* 页面滚动到dom指定位置
* 注:如果该dom滚动到顶部之后,他的top就变成0了。
* 再下次滚动的话,就会依照0来滚动,也就变成回到顶部了
*/
function scrollPageToDomForTop(el, extraHeight = 0) {
let query = wx.createSelectorQuery()
query.select(el).boundingClientRect()
query.selectViewport().scrollOffset()
query.exec(function (res) {
wx.pageScrollTo({
scrollTop: res[0].top + extraHeight,
duration: 100
});
})
}
let scrollFloatwindow_id = null;
//悬浮窗滚动方法判断方法
function scrollFloatwindow(e, that) {
if (e.scrollTop <= 0) {
//最顶部
e.scrollTop = 0;
} else if (e.scrollTop > that.data.scrollHeight) {
//最底部
e.scrollTop = that.data.scrollHeight;
}
if (scrollFloatwindow_id) clearTimeout(scrollFloatwindow_id);
//给scrollTop重新赋值
scrollFloatwindow_id = setTimeout(() => {
that.setData({
istrue_scroll: e.scrollTop > that.data.scrollTop || e.scrollTop >= that.data.scrollHeight,
scrollTop: e.scrollTop
});
}, 50);
}
let monitor = {
reportMonitor: function (id, value) {
if (wx.reportMonitor) {
wx.reportMonitor(id, value);
}
},
Error_Fail_Image: '1', //转化网络图片失败
Error_Req_Fail: '2',//网络请求失败
Error_Fail_Canvas: '3', //canvas转化失败
Error_Req_code_400: '4', //请求失败
Error_Req_code_401: '5', //非法参数
Error_Req_code_403: '6', //禁止访问
Error_Req_code_404: '7', //请求不存在
Error_Req_code_408: '8', //未登录
Error_Req_code_500: '9', //请求失败
};
module.exports = {
log,
formatTime,
openLocation,
$toast,
$modal,
getStatusBarHeight,
getCurrentPath,
getRouterData,
throttle,
debounce,
getNowTimeFormate,
getTimestamp,
trim,
filterSpace,
getNumber,
memoryWarning,
offMemoryWarning,
setBottomTabbar,
scrollPageToDom,
scrollPageToDomForTop,
scrollFloatwindow,
monitor
// printErrorClient
}
+222
View File
@@ -0,0 +1,222 @@
import _ from '../../commons/js/commons'
import Canvas from '../../commons/js/utils/canvas'
let isGetImgInfo = false
const app = getApp()
Component({
//组件的属性列表
properties: {
isShow: {
type: Boolean,
value: false
},
customImg: {
type: String,
value: ''
},
codeImg: {
type: String,
value: ''
},
},
//组件的初始数据
data: {
imgs: [],
tempPosterPath: '',
showOptBtn:false,//操作按钮显示
},
attached: function () {
isGetImgInfo = false
},
//数据监听
observers: {
'isShow': function (e) {
if (e) {
this.setData({
showOptBtn:false,
})
this.createPoster()
}
},
'customImg': function (e) {
if (e) {
this.getImageInfo(this.data.customImg, 0)
}
},
'codeImg': function (e) {
if (e) {
this.getImageInfo(this.data.codeImg, 1)
}
},
},
//组件的方法列表
methods: {
// 转化网络图片,获取路径
getImageInfo(src, index) {
let that = this
isGetImgInfo = false
setTimeout(function () {
wx.getImageInfo({
src: src,
success: (res) => {
let arr = that.data.imgs
arr[index] = res
that.setData({
imgs: arr
})
isGetImgInfo = true
},
fail: (err) => {
console.log('error img is: ' + src)
}
})
}, 200)
},
//自定义海报
customizePoster(CTX){
if(this.data.customImg){
let that = this
let width = 600
let height = (parseFloat(this.data.imgs[0].height)/parseFloat(this.data.imgs[0].width))*600
this.setData({
canvasInfo:{
width: width+'px',
height: height+'px'
}
})
// CTX.setFillStyle('#ffffff')
// CTX.fillRect(0, 0,width+20, picheight+optheight+ftheight+20)
//底图
if (that.data.imgs[0]) {
CTX.drawImage(that.data.imgs[0].path, 0, 0, that.data.imgs[0].width, that.data.imgs[0].height, 0, 0, width, height)
}
//二维码
if (that.data.imgs[1]) {
CTX.drawImage(that.data.imgs[1].path,417, height-180,140,140)
}
setTimeout(function(){
CTX.save()
CTX.draw(true, function () {
wx.hideLoading()
that.saveCanvas()
})
},200)
}
},
//生成海报
createPoster() {
let that = this
wx.showLoading({
title: '正在生成',
})
if(isGetImgInfo){
this.setData({
tempPosterPath: ''
})
let ctx = wx.createCanvasContext('postercanvas', that)
that.customizePoster(ctx)
}
},
//临时存储canvas
saveCanvas() {
let that = this
wx.canvasToTempFilePath({
canvasId: 'postercanvas',
quality: 1,
success: (res) => {
// this.tempFilePath = res.tempFilePath
that.setData({
'tempPosterPath': res.tempFilePath
})
setTimeout(function () {
that.setData({
showOptBtn:true,
})
},200)
},
fail: (res) => {
app.printErrorClient('poseterfail',['错误信息:临时存储canvas失败',JSON.stringify(res)])
}
}, this)
},
//保存到相册
saveToAblum() {
let that = this
wx.saveImageToPhotosAlbum({
filePath: this.data.tempPosterPath,
success: (res) => {
_.utils.$toast('保存成功')
},
fail: (err) => {
app.printErrorClient('poseterfail',['错误信息:图片保存失败',JSON.stringify(err)])
if (err.errMsg == 'saveImageToPhotosAlbum:fail cancel') {
_.utils.$toast('您已取消保存')
} else if (err.errMsg == 'saveImageToPhotosAlbum:fail auth deny') {
_.utils.$modal('提示', '保存图片失败,您可以点击确定设置获取相册权限后再尝试保存!', '去授权').then(res => {
if (res) {
wx.openSetting({}) // 打开小程序设置页面,可以设置权限
}
})
}
}
})
},
//隐藏海报弹框
hidePoster() {
this.setData({
isShow: false
})
wx.hideLoading()
},
//预览图片
preview() {
wx.previewImage({
current: this.data.tempPosterPath, // 当前显示图片的http链接
urls: [this.data.tempPosterPath] // 需要预览的图片http链接列表
})
},
//推送链接
pushLink(e) {
if(e.currentTarget.dataset.url){
_.$router.openUrlScheme(e.currentTarget.dataset.url)
}
},
//复制内容
copyWord(e){
if(e.currentTarget.dataset.tx){
wx.setClipboardData({
data: e.currentTarget.dataset.tx,
success (res) {
_.utils.$toast('复制成功')
}
})
}else{
_.utils.$toast('目前无文案')
}
},
}
})
+4
View File
@@ -0,0 +1,4 @@
{
"component": true,
"usingComponents": {}
}
+16
View File
@@ -0,0 +1,16 @@
<!-- components/poster/index.wxml -->
<view class="poster fixed {{isShow?'show':'hide'}}">
<view class="poster-bg absolute top-0 bottom-0 left-0 right-0" bindtap="hidePoster"></view>
<view class="poster-main bg-fff inner40 pt70 poster-main-img absolute box-center-middle ulib-r10">
<view class="absolute top-0 right-0 mt5 mr5 inner30 bg-fff img-50x50" bindtap="hidePoster"><text class="absolute box-center-middle iconfont icon-guanbi1 text-bold font-40 color-999"></text></view>
<canvas canvas-id='postercanvas' class='canvas absolute box-center-middle' style="width:{{canvasInfo.width}};height:{{canvasInfo.height}}"></canvas>
<view wx:if="{{showOptBtn}}" class="overflowhidden">
<scroll-view scroll-y="true" style="max-height:1000rpx;">
<image class="block wp100 ulib-r10" wx:if="{{tempPosterPath}}" src="{{tempPosterPath}}" mode="widthFix" catchtap="preview" />
</scroll-view>
</view>
<view class="mt40 fn-flex" wx:if="{{showOptBtn}}">
<button class="fn-flex-item btn-ffa73d-ff7a28 font-32 color-fff ulib-r750 text-center ml20 mr20" catchtap="saveToAblum">保存分享</button>
</view>
</view>
</view>
+26
View File
@@ -0,0 +1,26 @@
@import "../../commons/css/common.wxss";
.poster{
top: 0;
left: 100%;
width: 100%;
height: 100%;
z-index: 9999;
}
.show{
left: 0;
}
.poster-bg{
z-index: 9998;
background-color: rgba(0,0,0,.6);
}
.poster-main{
z-index: 9999;
}
.poster-main-img{
width:580rpx;
}
.poster-main-img canvas{
left: 1000%;
}
.btn-ffa73d-ff7a28{background-image:linear-gradient(#ffa73d,#ff7a28);border:none;}
.btn-ffa73d-ff7a28::after{border:none;}
+192
View File
@@ -0,0 +1,192 @@
import _ from '../../commons/js/commons'
const app = getApp()
Component({
//组件的属性列表
properties: {
isShow: {
type: Boolean,
value: false
},
userInfo:{
type: Object,
value:""
},
//是否显示授权用户信息
isShowProfile: {
type: Boolean,
value: true
},
//是否强制显示授权用户信息
isForceProfile: {
type: Boolean,
value:false
},
title:{
type: String,
value: ''
},
cancelbtn:{
type: String,
value: ''
},
submitbtn:{
type: String,
value: ''
},
tip:{
type: String,
value: ''
},
type:{
type: String,
value: ''
},
zindex: {
type: Number,
value: 10
},
//专题模式登录样式
mode:{
type: String,
value: ''
},
modeDate:{
type: Object,
value:""
},
},
//组件的初始数据
data: {
isRunning:false,
userCurrInfo:"",
isBindMobile:false
},
lifetimes: {
attached: function () {
// 在组件实例进入页面节点树时执行
if (this.data.type == "mobile") {
if (!this.data.userInfo){
_.apiQuery.getUserInfo("",false).then(res => {
this.setData({
userCurrInfo: res
})
})
}else{
this.setData({
userCurrInfo: this.data.userInfo
})
}
}
if (this.data.type == "userinfo") {
_.userManager.isAuthUserInfo().then(re => {
if (re) {
this.setData({
isShowProfile:false
})
}else{
this.setData({
isShowProfile:true
})
}
})
}
},
detached: function () {
// 在组件实例被从页面节点树移除时执行
this.setData({
isBindMobile:false,
isShow:false
})
},
},
/**
* 组件的方法列表
*/
methods: {
//catchtap
emptyfunc(){},
//授权用户信息
getUserProfile(){
let that = this
if(!!that.data.isRunning) return;
that.setData({
isRunning:true
});
wx.getUserProfile({
desc:'获取你的昵称、头像、地区及性别',//不写不弹提示框
success:function(res){
let params = {};
params['userInfo'] = res.userInfo;
_.apiQuery.putUserInfo(params).then(res => {
that.setData({
isRunning:false
});
that.successEvent()
_.eventBus.emit("isShowProfile",false)
})
},
fail:function(err){
that.setData({
isRunning:false
});
wx.showToast({
title: '您拒绝授权,将无法进行更多操作!',
icon: 'none',
duration: 2000
});
}
})
},
//授权手机号码
getPhoneNumber(e) {
if (e.detail.errMsg && e.detail.errMsg.indexOf('ok') > -1){
let that = this;
_.apiQuery.authUserPhone(e).then(res=>{
_.apiQuery.getUserInfo()
this.setData({
isBindMobile: true
})
})
}else{
app.printErrorClient('failGetPhoneNumber',['用户拒绝授权手机号码:'+JSON.stringify(e)])
}
},
onShow:function () {
this.setData({
isShow: true
});
this.triggerEvent('onShow', {
type: this.data.type
});
},
onClose: function () {
this.setData({
isShow: false
});
this.triggerEvent('onClose', {
type: this.data.type
});
if(this.data.type=="mobile" && this.data.isBindMobile){
this.setData({
isBindMobile:false
})
this.successEvent()
}
},
//成功回调方法
successEvent(){
this.triggerEvent('onSuccess', {
type: this.data.type
});
},
}
})
+3
View File
@@ -0,0 +1,3 @@
{
"component": true
}
+62
View File
@@ -0,0 +1,62 @@
<!--
type="mobile"用法
<lcb-auth type="mobile" isShow="true" bind:onSuccess="authEvent" bind:onClose="authFailEvent"></lcb-auth>
type="userinfo"用法 isForceProfile需要强制更新用户信息的时候才添加
<lcb-auth type="userinfo" isForceProfile="true" isShowProfile="{{isShowProfile}}" bind:onSuccess="authEvent"></lcb-auth>
-->
<!-- <view catch:tap="emptyfunc" wx:if="{{type=='userinfo' || !type}}">
<button open-type="getUserInfo" class="auth-btngetUserInfo" bindgetuserinfo="getUserInfo">获取用户信息</button>
</view> -->
<view catch:tap="emptyfunc" wx:if="{{type=='userinfo' || !type}}">
<block wx:if="{{isForceProfile || isShowProfile}}">
<button class="auth-btngetUserInfo" bindtap="getUserProfile">获取用户信息</button>
</block>
<block wx:else>
<button class="auth-btngetUserInfo" bindtap="successEvent">已获取用户信息</button>
</block>
</view>
<view class="auth-dialog-special inner40" style="z-index:{{zindex+1}};" catchtouchmove="true" wx:if="{{type=='mobile' && isShow && mode=='special'}}">
<view class="mt30 pt2" wx:if="{{!isBindMobile}}">
<image class='block auth-dialog-logo box-shadow-000-10-10 img-100x100 ulib-r750' src="{{modeDate.logo}}" lazy-load="{{true}}" mode="scaleToFill"></image>
<view class="mt5 text-center font-32 text-bold" wx:if="{{modeDate.title}}">{{modeDate.title}}</view>
<view class="relative special-intro bg-f5 mt30 inner30 line-height-16 font-28 color-333 ulib-r10">{{modeDate.content}}</view>
<view class="mt30">
<button class="btn-1a1a1a text-spacing-10 font-34 color-fff ulib-r10" open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber">{{modeDate.btn}}</button>
</view>
<text class="special-close iconfont icon-guanbi font-60 color-fff" bindtap="onClose"></text>
</view>
<view class="pt20 pb20" wx:else>
<view class="text-center font-32 text-bold">{{modeDate.success}}</view>
<view class="relative special-intro bg-f5 mt30 inner30 line-height-16 font-28 color-333 ulib-r10">{{modeDate.content}}</view>
<view class="mt30 pl70 pr70">
<button class="btn-border-1a1a1a font-32 color-1a ulib-r10" bindtap="onClose">知道了</button>
</view>
</view>
</view>
<view class="auth-dialog" style="z-index:{{zindex+1}};" catchtouchmove="true" wx:elif="{{type=='mobile' && isShow}}">
<view wx:if="{{!isBindMobile}}">
<view class="cap">{{title || '立即登录'}}</view>
<view class="intro">授权手机号即可登录狸车小程序,了解更多狸车资讯,一手活动特惠即刻拥有。</view>
<view class="btn-list">
<view class="item-cell">
<button class="btn-cancel" bindtap="onClose">{{cancelbtn || '取消'}}</button>
</view>
<view class="item-cell">
<button class="btn-confirm" open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber">{{submitbtn || '授权手机号'}}</button>
</view>
</view>
</view>
<view wx:else>
<view class="cap">{{tip || '恭喜您,登录成功!'}}</view>
<view class="btn-list">
<view class="item-cell">
<button class="btn-cancel" bindtap="onClose">知道了</button>
</view>
</view>
</view>
</view>
<view class="auth-dialog-mask" style="z-index:{{zindex}};" catchtouchmove="true" wx:if="{{isShow && type=='mobile'}}"></view>
+116
View File
@@ -0,0 +1,116 @@
@import "../../commons/css/common.wxss";
.auth-dialog{
position: fixed;
left:50%;
top:50%;
transform: translate(-50%,-50%);
width:88%;
padding:70rpx 60rpx;
background-color:#fff;
box-sizing: border-box;
border-radius: 10rpx;
overflow: hidden;
z-index: 10;
}
.auth-dialog-special{
position: fixed;
left:50%;
top:50%;
transform: translate(-50%,-50%);
width:80%;
background-color:#fff;
box-sizing: border-box;
border-radius: 10rpx;
z-index: 10;
}
.auth-btngetUserInfo{
position: absolute;
left:0;
top:0;
right:0;
bottom:0;
opacity: 0;
}
.auth-dialog .cap{
color:#000;
font-size: 36rpx;
line-height: 36rpx;
text-align: center;
font-weight: bold;
}
.auth-dialog .intro{
margin-top:30rpx;
color:#666;
font-size: 28rpx;
line-height: 46rpx;
}
.auth-dialog .btn-list{
display: flex;
margin-top:40rpx;
}
.auth-dialog .btn-list .item-cell{
flex: 1;
padding:0 10rpx;
}
.auth-dialog .btn-list button{
width: 220rpx;
height: 72rpx;
line-height: 72rpx;
overflow: hidden;
border-radius: 50rpx;
font-size: 30rpx;
box-sizing: border-box;
}
.auth-dialog .btn-list button.btn-cancel{
background: #fff;
color: #1a1a1a;
line-height: 68rpx;
border:1rpx solid #1a1a1a;
}
.auth-dialog .btn-list button.btn-confirm{
background: #1a1a1a;
color: #fff;
}
.auth-dialog .btn-list button::after{
border:none;
}
.auth-dialog-mask{
position: fixed;
left:0;
right: 0;
top:0;
bottom:0;
background-color: rgba(0, 0, 0, 0.6);
}
.auth-dialog-logo{
position:absolute;
top:-50rpx;
left:50%;
transform:translate(-50%,0);
}
.special-intro::before{
display:block;
position:absolute;
top:-20rpx;
left:50%;
transform:translate(-50%,0);
width: 0;
height: 0;
border-color: transparent transparent #f5f5f5 transparent;
border-style: solid;
border-width: 0 20rpx 20rpx 20rpx;
content:"";
}
.special-close{
position:absolute;
bottom:-100rpx;
left:50%;
transform:translate(-50%,0);
}
+57
View File
@@ -0,0 +1,57 @@
import _ from '../../commons/js/commons'
const app = getApp()
Component({
//组件的属性列表
properties: {
isShow: {
type: Boolean,
value: true,
},
},
//组件的初始数据
data: {
isAdmin:false,
},
//生命周期方法
lifetimes: {
//在组件实例进入页面节点树时执行
attached: function () {
if(app.getStorageByKey("userInfo").group_id==4){
this.setData({
isAdmin:true,
})
}
},
//在组件实例被从页面节点树移除时执行
detached: function () {
},
},
//组件所在页面的生命周期
pageLifetimes: {
//组件所在的页面被展示时执行
show: function () {
},
//组件所在的页面被隐藏时执行
hide: function () {
},
//组件所在的页面尺寸变化时执行
resize: function () {
},
},
//组件的方法列表
methods: {
backChannel(){
wx.reLaunch({
url: '/pages/channel/index'
})
},
}
})
+3
View File
@@ -0,0 +1,3 @@
{
"usingComponents": {}
}
+7
View File
@@ -0,0 +1,7 @@
<view class="fixed left-0 box-middle mb200 box-60x120 bg-2e3246 ulib-rr750" wx:if="{{isShow&&isAdmin}}" bindtap="backChannel">
<view class="absolute left-0 ml10 box-middle line-height-13 font-22 color-fff">
<view>返</view>
<view>回</view>
</view>
<i class="absolute right-0 box-middle mr5 iconfont icon-jiantou-left font-22 color-fff"></i>
</view>
+5
View File
@@ -0,0 +1,5 @@
@import "../../commons/css/common.wxss";
.box-60x120{
width: 60rpx;
height: 120rpx;
}
+86
View File
@@ -0,0 +1,86 @@
import _ from '../../commons/js/commons'
const app = getApp()
Component({
properties: {
isShow: {
type:Boolean,
value:false
},
},
data: {
mobileNumber: '',
},
lifetimes: {
attached: function () {
let userInfo = app.getStorageByKey("userInfo");
if (!!userInfo) {
this.setData({
userInfo: userInfo,
mobileNumber: !!userInfo.tel ? userInfo.tel : userInfo.mobile,
})
} else {
this.getUserInfo()
}
},
detached: function () {
// 在组件实例被从页面节点树移除时执行
},
},
ready: function () {},
methods: {
onClose() {
this.setData({
isShow: false
})
},
// 输入
inputTx(e) {
this.setData({
[e.currentTarget.dataset.key]: e.detail.value
})
},
//用户信息
getUserInfo() {
let params = {};
params['biz_id'] = 0;
_.apiQuery.getUserInfo(params, false).then(res => {
this.setData({
userInfo: res,
mobileNumber: !!res.tel ? res.tel : res.mobile,
})
});
},
//保存手机号
putAppUserTel() {
if (!/^1[3456789]\d{9}$/.test(this.data.mobileNumber)) {
wx.showToast({
title: '请输入正确手机号',
icon: 'none'
})
} else {
let params = {};
params['tel'] = this.data.mobileNumber;
_.apiQuery.putAppUserTel(params).then(res => {
console.log(res)
wx.showToast({
title: '修改成功',
icon: 'success',
duration: 2000
})
this.getUserInfo()
this.setData({
isShow: false
})
});
}
},
}
})
+6
View File
@@ -0,0 +1,6 @@
{
"component": true,
"usingComponents": {
"lcb-msg": "/components/msg/index"
}
}
+14
View File
@@ -0,0 +1,14 @@
<lcb-msg isShow="{{isShow}}">
<view slot="content" class="inner40">
<input class="bg-f7 wp100 pl30 pr30 font-42 ulib-r10" placeholder-class='color-ccc' style="height:90rpx;" maxlength='-1' type='number' placeholder='请输入您的手机号' bindinput='inputTx' data-key='mobileNumber' value="{{mobileNumber}}"></input>
<view class="mt30 font-26 color-666">请务必将号码修改成当前使用的手机号,否则将无法接通。</view>
<view class="mt40 fn-flex text-center font-32">
<view class="fn-flex-item pr20">
<view class="bds-1-eb pt20 pb20 ulib-r10" bindtap="onClose">取消</view>
</view>
<view class="fn-flex-item pl20">
<view class="btn-36afa2 pt20 pb20 color-fff ulib-r10" bindtap="putAppUserTel">保存</view>
</view>
</view>
</view>
</lcb-msg>
+1
View File
@@ -0,0 +1 @@
@import "../../commons/css/common.wxss";
+92
View File
@@ -0,0 +1,92 @@
import _ from '../../commons/js/commons'
const app = getApp()
Component({
//组件的属性列表
properties: {
currentIndex: {
type: String,
value: '0'
},
},
//组件的初始数据
data: {
list: [
{
"url": "/pages/channel/index",
"icon": "tab-home",
"activeIcon": "tab-home-ac",
"title": "首页",
},
{
"url": "/pages/dataAnalysis/index",
"icon": "tab-dataAnalysis",
"activeIcon": "tab-dataAnalysis-ac",
"title": "数据分析",
},
{
"url": "/pages/mine/index?source=channel",
"icon": "tab-mine",
"activeIcon": "tab-mine-ac",
"title": "我的",
},
],
},
//生命周期方法
lifetimes: {
//在组件实例进入页面节点树时执行
attached: function () {
},
//在组件实例被从页面节点树移除时执行
detached: function () {
},
},
//组件所在页面的生命周期
pageLifetimes: {
//组件所在的页面被展示时执行
show: function () {
},
//组件所在的页面被隐藏时执行
hide: function () {
},
//组件所在的页面尺寸变化时执行
resize: function () {
},
},
//组件的方法列表
methods: {
//页面跳转
pushNavTab(e) {
let pages = getCurrentPages() //获取加载的页面
let currentPage = pages[pages.length - 1] //获取当前页面的对象
let url = currentPage.route //当前页面url
let isBack = false
let backIndex = 0
if (e.currentTarget.dataset.url && e.currentTarget.dataset.url != '/' + url) {
pages.forEach((item,index) => {
if(e.currentTarget.dataset.url=='/'+item.route){
isBack = true
backIndex = index
}
});
if(isBack){//后退
_.$router.back(Number(pages.length-backIndex-1))
}else{//前进打开
_.$router.openUrlScheme(e.currentTarget.dataset.url)
}
} else {
_.utils.scrollPageToDomForTop('.container')
}
},
}
})
+3
View File
@@ -0,0 +1,3 @@
{
"usingComponents": {}
}
+9
View File
@@ -0,0 +1,9 @@
<view class="safe-pb height-190"></view>
<view class="fixed bottom-0 left-0 wp100 fn-flex bg-fff fn-flex-around safe-pb bg-fff bts-1-eb text-center z-index-4">
<block wx:for="{{list}}" wx:key='index'>
<view class="fn-flex-item pt5 pb10" bindtap="pushNavTab" data-url="{{item.url}}">
<view class="inline-block img-60x60 icon-menu {{currentIndex == index?item.activeIcon:item.icon}}"></view>
<view class="font-22 line-height-12 {{currentIndex == index?'color-1a':'color-999'}}">{{item.title}}</view>
</view>
</block>
</view>
+9
View File
@@ -0,0 +1,9 @@
@import "../../commons/css/common.wxss";
.z-index-4{z-index:9999999999;}
.icon-menu{background:url("https://qs.haodian.cn/wechat_app/lichebao/common/icon-menu.png") no-repeat;background-size:750rpx auto;}
.tab-home{background-position:0 5rpx;}
.tab-home-ac{background-position:0 -55rpx;}
.tab-dataAnalysis{background-position:-60rpx 5rpx;}
.tab-dataAnalysis-ac{background-position:-60rpx -55rpx;}
.tab-mine{background-position:-120rpx 5rpx;}
.tab-mine-ac{background-position:-120rpx -55rpx;}
@@ -0,0 +1,277 @@
import _ from '../../commons/js/commons'
import Canvas from '../../commons/js/utils/canvas'
let isGetImgInfo = false
const app = getApp()
Component({
//组件的属性列表
properties: {
source: {
type: String,
value: 'goods'
},
isShow: {
type: Boolean,
value: false
},
isCreateQrcode: {
type: Boolean,
value: false
},
qccodeid: {
type: String,
value: ''
},
customImg: {
type: String,
value: ''
},
slogan: {
type: String,
value: ''
},
moments: {
type: String,
value: ''
},
},
//组件的初始数据
data: {
//headImg:app.getStorageByKey("userInfo").headimg,
defaultQrcode: _.config.imgUrl + 'common/qr.jpg',
imgs: [],
tempPosterPath: '',
showOptBtn:false,//操作按钮显示
},
attached: function () {
isGetImgInfo = false
},
//数据监听
observers: {
'isCreateQrcode': function (e) {
if (e) {
this.getMaterialHomeQrcode()
}
},
'isShow': function (e) {
if (e) {
this.setData({
showOptBtn:false,
})
this.createPoster()
}
},
'customImg': function (e) {
if (e) {
// this.setData({
// headImg:app.getStorageByKey("userInfo").headimg,
// })
//头像
//this.getImageInfo(this.data.headImg, 4)
this.getImageInfo(this.data.customImg, 3)
}
},
},
//组件的方法列表
methods: {
// 转化网络图片,获取路径
getImageInfo(src, index) {
let that = this
isGetImgInfo = false
setTimeout(function () {
wx.getImageInfo({
src: src,
success: (res) => {
let arr = that.data.imgs
arr[index] = res
that.setData({
imgs: arr
})
isGetImgInfo = true
},
fail: (err) => {
console.log('error img is: ' + src)
}
})
}, 200)
},
//获取二维码
getMaterialHomeQrcode() {
let params = {};
params['page'] = 'pages/special2/index';
params['scene'] = this.data.qccodeid+'_'+app.getStorageByKey("userInfo").biz_id;
params['width'] = 1280;
_.apiQuery.getMaterialHomeQrcode(params).then(res => {
this.getImageInfo(res.data.url, 2)
}).catch(res => {
//this.getImageInfo(this.data.defaultQrcode, 2)
})
},
//自定义海报
customizePoster(CTX){
if(this.data.customImg){
let that = this
this.setData({
canvasInfo:{
width: parseFloat(this.data.imgs[3].width)+'px',
height: parseFloat(this.data.imgs[3].height)+'px'
}
})
console.log(this.data.imgs[3].width)
console.log(this.data.imgs[3].height)
//背景
if (that.data.imgs[3]) {
CTX.drawImage(that.data.imgs[3].path, 0, 0, that.data.imgs[3].width, that.data.imgs[3].height, 0, 0, that.data.imgs[3].width, that.data.imgs[3].height)
}
// //头像
// if (that.data.imgs[4]) {
// Canvas.circleImage(CTX,that.data.imgs[4].path,20, (that.data.imgs[3].height-170)/2,22/2)
// }
// //昵称
// Canvas.drawTextOverflow(CTX, app.getStorageByKey("userInfo").nickname, 150, 1, 14, '#fff', 20, 46, (that.data.imgs[3].height-132)/2)
// //标语
// if (that.data.slogan) {
// Canvas.drawTextOverflow(CTX, that.data.slogan, 200, 2, 11, '#fff', 17, 20, (that.data.imgs[3].height-85)/2)
// }
// //标语
// if (that.data.slogan) {
// Canvas.drawTextOverflow(CTX, that.data.slogan, 180, 2, 11, '#666', 17, 20, (that.data.imgs[3].height-100)/2)
// }
//二维码
if (that.data.imgs[2]) {
if(this.data.imgs[3].width>this.data.imgs[3].height){
Canvas.circleImage(CTX,that.data.imgs[2].path,parseFloat(this.data.imgs[3].width)-parseFloat(this.data.imgs[3].height/5.5)-30, parseFloat(this.data.imgs[3].height)-parseFloat(this.data.imgs[3].height/5.5)-30,parseFloat(this.data.imgs[3].height/11))
}else{
Canvas.circleImage(CTX,that.data.imgs[2].path,parseFloat(this.data.imgs[3].width)-parseFloat(this.data.imgs[3].width/5.5)-30, parseFloat(this.data.imgs[3].height)-parseFloat(this.data.imgs[3].width/5.5)-30,parseFloat(this.data.imgs[3].width/11))
}
}
setTimeout(function(){
CTX.save()
CTX.draw(true, function () {
wx.hideLoading()
that.saveCanvas()
})
},200)
}
},
//生成海报
createPoster() {
let that = this
wx.showLoading({
title: '正在生成',
})
if(isGetImgInfo){
this.setData({
tempPosterPath: ''
})
let ctx = wx.createCanvasContext('postercanvas', that)
that.customizePoster(ctx)
}
},
//临时存储canvas
saveCanvas() {
let that = this
wx.canvasToTempFilePath({
canvasId: 'postercanvas',
quality: 1,
success: (res) => {
// this.tempFilePath = res.tempFilePath
that.setData({
'tempPosterPath': res.tempFilePath
})
setTimeout(function () {
that.setData({
showOptBtn:true,
})
},200)
},
fail: (res) => {
app.printErrorClient('poseterfail',['错误信息:临时存储canvas失败',JSON.stringify(res)])
}
}, this)
},
//保存到相册
saveToAblum() {
let that = this
wx.saveImageToPhotosAlbum({
filePath: this.data.tempPosterPath,
success: (res) => {
_.utils.$toast('保存成功')
},
fail: (err) => {
app.printErrorClient('poseterfail',['错误信息:图片保存失败',JSON.stringify(err)])
if (err.errMsg == 'saveImageToPhotosAlbum:fail cancel') {
_.utils.$toast('您已取消保存')
} else if (err.errMsg == 'saveImageToPhotosAlbum:fail auth deny') {
_.utils.$modal('提示', '保存图片失败,您可以点击确定设置获取相册权限后再尝试保存!', '去授权').then(res => {
if (res) {
wx.openSetting({}) // 打开小程序设置页面,可以设置权限
}
})
}
}
})
},
//隐藏海报弹框
hidePoster() {
this.setData({
isShow: false
})
wx.hideLoading()
},
//预览图片
preview() {
wx.previewImage({
current: this.data.tempPosterPath, // 当前显示图片的http链接
urls: [this.data.tempPosterPath] // 需要预览的图片http链接列表
})
},
//推送链接
pushLink(e) {
if(e.currentTarget.dataset.url){
_.$router.openUrlScheme(e.currentTarget.dataset.url)
}
},
//复制内容
copyWord(e){
if(e.currentTarget.dataset.tx){
wx.setClipboardData({
data: e.currentTarget.dataset.tx,
success (res) {
_.utils.$toast('复制成功')
}
})
}else{
_.utils.$toast('目前无文案')
}
},
}
})
+270
View File
@@ -0,0 +1,270 @@
import _ from '../../commons/js/commons'
import Canvas from '../../commons/js/utils/canvas'
let isGetImgInfo = false
const app = getApp()
Component({
//组件的属性列表
properties: {
source: {
type: String,
value: 'goods'
},
isShow: {
type: Boolean,
value: false
},
isCreateQrcode: {
type: Boolean,
value: false
},
qccodeid: {
type: String,
value: ''
},
customImg: {
type: String,
value: ''
},
slogan: {
type: String,
value: ''
},
moments: {
type: String,
value: ''
},
},
//组件的初始数据
data: {
//headImg:app.getStorageByKey("userInfo").headimg,
defaultQrcode: _.config.imgUrl + 'common/qr.jpg',
imgs: [],
tempPosterPath: '',
showOptBtn:false,//操作按钮显示
},
attached: function () {
isGetImgInfo = false
},
//数据监听
observers: {
'isCreateQrcode': function (e) {
if (e) {
this.getMaterialHomeQrcode()
}
},
'isShow': function (e) {
if (e) {
this.setData({
showOptBtn:false,
})
this.createPoster()
}
},
'customImg': function (e) {
if (e) {
// this.setData({
// headImg:app.getStorageByKey("userInfo").headimg,
// })
//头像
//this.getImageInfo(this.data.headImg, 4)
this.getImageInfo(this.data.customImg, 3)
}
},
},
//组件的方法列表
methods: {
// 转化网络图片,获取路径
getImageInfo(src, index) {
let that = this
isGetImgInfo = false
setTimeout(function () {
wx.getImageInfo({
src: src,
success: (res) => {
let arr = that.data.imgs
arr[index] = res
that.setData({
imgs: arr
})
isGetImgInfo = true
},
fail: (err) => {
console.log('error img is: ' + src)
}
})
}, 200)
},
//获取二维码
getMaterialHomeQrcode() {
let params = {};
params['page'] = 'pages/special2/index';
params['scene'] = this.data.qccodeid+'_'+app.getStorageByKey("userInfo").biz_id;
params['width'] = 260;
_.apiQuery.getMaterialHomeQrcode(params).then(res => {
this.getImageInfo(res.data.url, 2)
}).catch(res => {
//this.getImageInfo(this.data.defaultQrcode, 2)
})
},
//自定义海报
customizePoster(CTX){
if(this.data.customImg){
let that = this
this.setData({
canvasInfo:{
width: parseFloat(this.data.imgs[3].width/2)+'px',
height: parseFloat(this.data.imgs[3].height/2)+'px'
}
})
//背景
if (that.data.imgs[3]) {
CTX.drawImage(that.data.imgs[3].path, 0, 0, that.data.imgs[3].width, that.data.imgs[3].height, 0, 0, that.data.imgs[3].width/2, that.data.imgs[3].height/2)
}
// //头像
// if (that.data.imgs[4]) {
// Canvas.circleImage(CTX,that.data.imgs[4].path,20, (that.data.imgs[3].height-170)/2,22/2)
// }
// //昵称
// Canvas.drawTextOverflow(CTX, app.getStorageByKey("userInfo").nickname, 150, 1, 14, '#fff', 20, 46, (that.data.imgs[3].height-132)/2)
// //标语
// if (that.data.slogan) {
// Canvas.drawTextOverflow(CTX, that.data.slogan, 200, 2, 11, '#fff', 17, 20, (that.data.imgs[3].height-85)/2)
// }
// //标语
// if (that.data.slogan) {
// Canvas.drawTextOverflow(CTX, that.data.slogan, 180, 2, 11, '#666', 17, 20, (that.data.imgs[3].height-100)/2)
// }
//二维码
if (that.data.imgs[2]) {
Canvas.circleImage(CTX,that.data.imgs[2].path,parseFloat(this.data.imgs[3].width/2)-parseFloat(this.data.imgs[3].width/8.5)-16, parseFloat(this.data.imgs[3].height/2)-parseFloat(this.data.imgs[3].width/8.5)-16,parseFloat(this.data.imgs[3].width/17))
}
setTimeout(function(){
CTX.save()
CTX.draw(true, function () {
wx.hideLoading()
that.saveCanvas()
})
},200)
}
},
//生成海报
createPoster() {
let that = this
wx.showLoading({
title: '正在生成',
})
if(isGetImgInfo){
this.setData({
tempPosterPath: ''
})
let ctx = wx.createCanvasContext('postercanvas', that)
that.customizePoster(ctx)
}
},
//临时存储canvas
saveCanvas() {
let that = this
wx.canvasToTempFilePath({
canvasId: 'postercanvas',
quality: 1,
success: (res) => {
// this.tempFilePath = res.tempFilePath
that.setData({
'tempPosterPath': res.tempFilePath
})
setTimeout(function () {
that.setData({
showOptBtn:true,
})
},200)
},
fail: (res) => {
app.printErrorClient('poseterfail',['错误信息:临时存储canvas失败',JSON.stringify(res)])
}
}, this)
},
//保存到相册
saveToAblum() {
let that = this
wx.saveImageToPhotosAlbum({
filePath: this.data.tempPosterPath,
success: (res) => {
_.utils.$toast('保存成功')
},
fail: (err) => {
app.printErrorClient('poseterfail',['错误信息:图片保存失败',JSON.stringify(err)])
if (err.errMsg == 'saveImageToPhotosAlbum:fail cancel') {
_.utils.$toast('您已取消保存')
} else if (err.errMsg == 'saveImageToPhotosAlbum:fail auth deny') {
_.utils.$modal('提示', '保存图片失败,您可以点击确定设置获取相册权限后再尝试保存!', '去授权').then(res => {
if (res) {
wx.openSetting({}) // 打开小程序设置页面,可以设置权限
}
})
}
}
})
},
//隐藏海报弹框
hidePoster() {
this.setData({
isShow: false
})
wx.hideLoading()
},
//预览图片
preview() {
wx.previewImage({
current: this.data.tempPosterPath, // 当前显示图片的http链接
urls: [this.data.tempPosterPath] // 需要预览的图片http链接列表
})
},
//推送链接
pushLink(e) {
if(e.currentTarget.dataset.url){
_.$router.openUrlScheme(e.currentTarget.dataset.url)
}
},
//复制内容
copyWord(e){
if(e.currentTarget.dataset.tx){
wx.setClipboardData({
data: e.currentTarget.dataset.tx,
success (res) {
_.utils.$toast('复制成功')
}
})
}else{
_.utils.$toast('目前无文案')
}
},
}
})
+4
View File
@@ -0,0 +1,4 @@
{
"component": true,
"usingComponents": {}
}
+22
View File
@@ -0,0 +1,22 @@
<!-- components/poster/index.wxml -->
<view class="poster fixed {{isShow?'show':'hide'}}">
<view class="poster-bg absolute top-0 bottom-0 left-0 right-0" bindtap="hidePoster"></view>
<view class="poster-main poster-main-img absolute box-center-middle">
<canvas canvas-id='postercanvas' class='canvas absolute box-center-middle' style="width:{{canvasInfo.width}};height:{{canvasInfo.height}}"></canvas>
<view wx:if="{{showOptBtn}}" class="overflowhidden ulib-r10">
<scroll-view scroll-y="true" style="max-height:900rpx;">
<image class="block wp100 ulib-r10" wx:if="{{tempPosterPath}}" src="{{tempPosterPath}}" mode="widthFix" catchtap="preview" />
</scroll-view>
</view>
<view class="bg-fff mt30 inner30 box-shadow-000-10-10 ulib-r10" wx:if="{{showOptBtn&&moments}}">
<view class="font-32 color-666 line-clamp-2 line-height-16">{{moments}}</view>
<view class="mt10 text-right">
<view class="inline-block bg-333 pt5 pb5 pl20 pr20 font-22 color-fff ulib-r750" bindtap="copyWord" data-tx="{{moments}}">复制</view>
</view>
</view>
<view class="mt40 fn-flex" wx:if="{{showOptBtn}}">
<button class="fn-flex-item bds-2-fff btn-no-bg font-32 color-fff ulib-r750 text-center ml20 mr20" catchtap="pushLink" data-url="/pages/distribute/special/index?id={{qccodeid}}">专题预览</button>
<button class=" fn-flex-item btn-f9394d font-32 color-fff ulib-r750 text-center ml20 mr20" hover-class="btn-f9394d-hover" catchtap="saveToAblum">保存分享</button>
</view>
</view>
</view>
+24
View File
@@ -0,0 +1,24 @@
@import "../../commons/css/common.wxss";
.poster{
top: 0;
left: 100%;
width: 100%;
height: 100%;
z-index: 9999;
}
.show{
left: 0;
}
.poster-bg{
z-index: 9998;
background-color: rgba(0,0,0,.6);
}
.poster-main{
z-index: 9999;
}
.poster-main-img{
width:580rpx;
}
.poster-main-img canvas{
left: 1000%;
}
+23
View File
@@ -0,0 +1,23 @@
// pages/components/footer/footer.js
Component({
/**
* 组件的属性列表
*/
properties: {
},
/**
* 组件的初始数据
*/
data: {
},
/**
* 组件的方法列表
*/
methods: {
}
})
+4
View File
@@ -0,0 +1,4 @@
{
"component": true,
"usingComponents": {}
}
+7
View File
@@ -0,0 +1,7 @@
<view class="footer text-center">
<view>
<text class="support-tx">Powered by</text>
<image class='inline-block img-30x30' mode='aspectFit' src='https://qs.haodian.cn/wechat_app/common/lc-logo-gray.png?v=220223'></image>
<text class="support-tx">狸车</text>
</view>
</view>
+5
View File
@@ -0,0 +1,5 @@
.footer {padding:30rpx 0;text-align:center; grid-row-start:2;grid-row-end:3;}
.img-30x30{width:30rpx;height:30rpx;vertical-align:middle}
.support-tx{margin:0 8rpx;font-size:20rpx;color:#bbb;vertical-align:middle}
.inline-block{display:inline-block}
.foot-del{font-size:18rpx;color:#bbb;}
+21
View File
@@ -0,0 +1,21 @@
import _ from '../../commons/js/commons'
const app = getApp()
Component({
properties: {
isShow: {
type: Boolean,
value: false
},
},
data: {
imgUrl: _.config.imgUrl,//静态图片路径
},
lifetimes: {
},
ready: function () {},
methods: {
}
})
+6
View File
@@ -0,0 +1,6 @@
{
"component": true,
"usingComponents": {
"lcb-msg": "/components/msg/index"
}
}
+6
View File
@@ -0,0 +1,6 @@
<lcb-msg isShow="{{isShow}}" isBottomOpt="true">
<view slot="content" class="inner30">
<view class="pt20 font-30 line-height-17 color-666">已为您分配专属客服,并将她的联系方式通过服务通知放送给你,请在消息列表查看。</view>
<image lazy-load="{{true}}" class="mt20 wp100" mode="widthFix" src="{{imgUrl}}common/notice.jpg" />
</view>
</lcb-msg>
+1
View File
@@ -0,0 +1 @@
@import "../../commons/css/common.wxss";
+41
View File
@@ -0,0 +1,41 @@
Component({
/**
* 组件的属性列表
*/
properties: {
isNoData: {
type: Boolean,
value: false
},
isLoading: {
type: Boolean,
value: false
},
isEnd: {
type: Boolean,
value: false
},
noDataMsg: {
type:String,
value: ''
},
isMiddle: {
type: Boolean,
value: false
},
},
/**
* 组件的初始数据
*/
data: {
},
/**
* 组件的方法列表
*/
methods: {
}
})
+4
View File
@@ -0,0 +1,4 @@
{
"component": true,
"usingComponents": {}
}
+13
View File
@@ -0,0 +1,13 @@
<view class="pt20 pb20 text-center color-ccc" hidden="{{!isLoading}}">
<i class="iconfont icon-jiazai font-36 text-middle"></i>
<view class="mt10 font-26 text-middle">请稍等...</view>
</view>
<view class="pt20 pb20 text-center font-26 color-ccc" hidden="{{!isEnd}}">
<text>我们是有底线的</text>
</view>
<view class="text-center {{isMiddle?'absolute box-center-middle':'pt100 pb100'}}" hidden="{{!isNoData}}">
<view class="inline-block noData"></view>
<view class="pt30 font-28 color-999">{{noDataMsg||'空空如也,这里什么也没有'}}</view>
</view>
+9
View File
@@ -0,0 +1,9 @@
@import "../../commons/css/common.wxss";
.noData {
width:264rpx;
height:165rpx;
background: url(https://qs.haodian.cn/wechat_app/liche/common/none.png?v=191231) no-repeat;
background-size:100% auto;
background-position: top center;
}
+77
View File
@@ -0,0 +1,77 @@
import commonconstants from '../../commons/js/config'
Component({
/**
* 组件的属性列表
*/
properties: {
isShow: { //是否显示弹框
type: Boolean,
value: false
},
isHasClose: { //是否显示关闭按钮 取值:'','up','down'
type: String,
value: ''
},
isExtraOpt: { //是否增加底部操作
type: Boolean,
value: false
},
isBottomOpt: { //是否显示底部操作
type: Boolean,
value: false
},
isTransparent: { //是否背景透明
type: Boolean,
value: false
},
isCustomTabBar: { //是否有底部自定义TabBar
type: Boolean,
value: false
},
iconType: { //图标
type: String,
value: ''
},
title: { //标题
type: String,
value: ''
},
content: { //内容
type: String,
value: ''
},
closeWord: { //关闭按钮文字
type: String,
value: '我知道了'
}
},
options: {
multipleSlots: true // 在组件定义时的选项中启用多slot支持
},
/**
* 组件的初始数据
*/
data: {
successIcon:commonconstants.imgUrl+'/msg/icon-success.png',
failIcon: commonconstants.imgUrl+'/msg/icon-fail.png'
},
/**
* 组件的方法列表
*/
methods: {
close(){
this.setData({
isShow: false
})
this.triggerEvent('closeevent', {
bubbles: true
})
},
aaa(){
}
}
})
+4
View File
@@ -0,0 +1,4 @@
{
"component": true,
"usingComponents": {}
}
+45
View File
@@ -0,0 +1,45 @@
<!-- "usingComponents": {
"lcb-msg": "/components/msg/index"
},
<lcb-msg bind:closeevent="closeevent"></lcb-msg>
关闭方法: closeevent
插槽:
<view slot="content">这里是插入到组件slot中的内容</view>
<view slot="opt">这里是插入到组件slot中的内容</view> -->
<view class="lcb-msg" style="{{isShow?'display:block':'display:none'}}" catchmove="aaa">
<view class="msgBg" style="background-color: rgba(0, 0, 0, .6);"></view>
<view class="msgMain {{isShow?'active':''}}" style="{{isTransparent?'background-color: transparent;':''}}{{isCustomTabBar?'margin-top: -95rpx;':''}}" catchmove="aaa">
<block wx:if="{{isHasClose !=''}}">
<view wx:if="{{isHasClose=='up'}}" class="close up">
<text class="iconfont icon-guanbi1 color-fff" bindtap="close"></text>
</view>
<view wx:else class="close down" bindtap="close">
</view>
</block>
<view class="hd">
<block wx:if="{{iconType!=''}}">
<view class="msgMain-icon">
<image src="{{successIcon}}" wx:if="{{iconType=='success'}}" />
<image src="{{failIcon}}" wx:if="{{iconType=='fail'}}" />
</view>
</block>
<text class="msgMain-title" wx:if="{{title}}">{{title}}</text>
<view class="msgMain-content" wx:if="{{content}}">
<view>{{content}}</view>
</view>
<slot name="content"></slot>
</view>
<view class="bd" style="border-top:1rpx solid #ddd;" wx:if="{{isBottomOpt}}">
<view class="msgMain-opt">
<view class="msgMain-opt-item" wx:if="{{isExtraOpt}}">
<slot name="opt"></slot>
</view>
<view class="msgMain-opt-item">
<view class="color-1a1a1a msgMain-opt-close" bindtap="close">{{closeWord}}</view>
</view>
</view>
</view>
</view>
</view>
+138
View File
@@ -0,0 +1,138 @@
@import "../../commons/css/common.wxss";
.lcb-msg{
}
.lcb-msg .msgBg{
position: fixed;
left: 0;
top: 0;
width: 100%;
height: 100%;
z-index: 9998;
}
.lcb-msg .msgMain{
position: fixed;
left: 50%;
top: 50%;
transform: translate(-50%,-50%);
min-width: 560rpx;
/* min-height: 456rpx; */
z-index: 9999;
background-color: #fff;
border-radius: 20rpx;
overflow: hidden;
}
.lcb-msg .msgMain.active{
/* animation: card .5s linear 1; */
}
.lcb-msg .msgMain .close{
position: absolute;
}
.lcb-msg .msgMain .close.up{
right: 0;
top: -80rpx;
font-size: 30rpx;
}
.lcb-msg .msgMain .close.up::before{
content: '';
position: absolute;
width: 4rpx;
height: 34rpx;
background-color: #fff;
left: 50%;
top: 53rpx;
}
.lcb-msg .msgMain .close.up text{
width: 53rpx;
height: 53rpx;
line-height: 53rpx;
text-align: center;
display: inline-block;
border-radius: 100%;
border: 4rpx solid #fff;
box-sizing: border-box;
}
/* .lcb-msg .msgMain .close.down{
left: 50%;
bottom: -140rpx;
transform: translateX(-50%);
font-size: 53rpx;
} */
.lcb-msg .msgMain .close.down{
right: 20rpx;
top: 20rpx;
/* font-size: 30rpx; */
width: 35rpx;
height: 35rpx;
background-size: 100%;
background-repeat: no-repeat;
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACMAAAAjBAMAAADs965qAAAAG1BMVEUAAAAjGBUjGBUjGBUjGBUjGBUjGBUjGBUjGBUq0FsOAAAACXRSTlMAZlQITRE0SzF33gruAAAAh0lEQVQoz33S0Q1AMBDG8Uss4GzQiHfpBBoLsAEbGMHoHtr6N/lEX1x9v1Dn7FytXV06zIe5vRW9t+Rji4IvFluWd12AlQ2MGkYJyxUZBSGopCBYRTAQrCLYVBHMXwQriLW7b/av9Fn6Rj2Xnl6/UTsB4qpd1d6TwYhg+rdBMJ2c62O+dArvBxZYHZp91AHFAAAAAElFTkSuQmCC");
}
.lcb-msg .msgMain-title{
display: block;
padding: 25rpx 0 5rpx 0;
text-align: center;
font-weight:bold;
font-size: 36rpx;
color: #000;
}
.lcb-msg .msgMain-content{
display: block;
font-size: 24rpx;
color: #999;
padding: 0 39rpx 55rpx;
text-align: center;
}
.lcb-msg .msgMain .bd{
/* padding-bottom: 30rpx; */
height: 100rpx;
line-height: 100rpx;
}
.lcb-msg .msgMain-opt{
display: flex;
}
.msgMain-opt-item{
position: relative;
flex: 1;
text-align: center;
}
.msgMain-opt-item text{
font-size: 32rpx;
}
.msgMain-opt-item+.msgMain-opt-item::before{
content: '';
position: absolute;
left: 0;
top: 0;
width: 2rpx;
height: 100%;
background-color: #d5d6d8;
font-size: 32rpx;
}
.msgMain-opt-close{
border-radius: 10rpx;
margin-left: 30rpx;
margin-right: 30rpx;
font-size: 32rpx;
height: 100rpx;
line-height: 100rpx;
}
.msgMain-icon{
margin-top: 80rpx;
text-align: center;
}
.msgMain-icon image{
width: 75rpx;
height: 75rpx;
}
@keyframes card{
0% {
opacity: 0;
transform: translate(-50%,-50%) scale3d(.3, .3, .3);
}
50% {
transform: translate(-50%,-50%) scale3d(1,1,1);
opacity: 1
}
}
+96
View File
@@ -0,0 +1,96 @@
import Utils from '../../commons/js/utils/util'
Component({
/**
* 组件的属性列表
*/
properties: {
titleText: {
type: String,
value: ''
},
txtColor: {
type: String,
value: 'transparent'
},
bgColor: {
type: String,
value: '#1a1a1a'
},
isShowBg: {
type: Boolean,
value: false
},
type: {
type: String,
value: ''
},
city:{
type: String,
value: ''
},
homeShowBar:{
type: Boolean,
value: true
},
homeShowTitle:{
type: Boolean,
value: false
}
},
attached: function () {
this.setNavSize()
},
data: {
isShowRetBtn: false,
isShowHomeBtn: false,
homeInfo:{
placeholder: '搜索城市好店、好评...',
url: '/pages/search/index'
}
},
pageLifetimes: {
show: function () {
let pages = getCurrentPages();
if (pages.length == 1) {
this.setData({
isShowRetBtn: true
})
}
if (Utils.getCurrentPath().url == 'pages/index/index'||Utils.getCurrentPath().url == 'pages/login/index'||Utils.getCurrentPath().url == 'pages/customer/index'||Utils.getCurrentPath().url == 'pages/order/index'||Utils.getCurrentPath().url == 'pages/channel/index'||Utils.getCurrentPath().url == 'pages/dataAnalysis/index') {
this.setData({
isShowHomeBtn: true
})
}
},
},
methods: {
// 通过获取系统信息计算导航栏高度
setNavSize: function () {
var that = this,
sysinfo = wx.getSystemInfoSync(),
statusHeight = sysinfo.statusBarHeight,
isiOS = sysinfo.system.indexOf('iOS') > -1,
navHeight;
if (!isiOS) {
navHeight = 48;
} else {
navHeight = 44;
}
that.setData({
status: statusHeight,
navHeight: navHeight
})
},
// 返回事件
back: function () {
wx.navigateBack({
delta: 1
})
},
home: function () {
wx.switchTab({
url: '/pages/index/index'
})
}
}
})
+6
View File
@@ -0,0 +1,6 @@
{
"component": true,
"usingComponents": {
"lc-searchBar": "/components/searchBar/index"
}
}
+26
View File
@@ -0,0 +1,26 @@
<view>
<view class="fixed top-0 left-0 right-0 z-index-2" style="height: {{status + navHeight}}px;background-color:{{bgColor}}" wx:if="{{isShowBg}}"></view>
<view class="fixed top-0 left-0 right-0 z-index-9999" style="height: {{status + navHeight}}px;">
<view style='height: {{status}}px;'></view>
<view class="relative" style='height:{{navHeight}}px;line-height:{{navHeight}}px;' wx:if="{{type=='home'}}">
<view class="citySelect font-28 color-fff ml30" wx:if="{{city}}">{{city}}</view>
<view class="searchBar absolute box-middle" wx:if="{{homeShowBar}}">
<lcb-searchBar searchType="home" placeholder="{{homeInfo.placeholder}}" url="{{homeInfo.url}}"></lcb-searchBar>
</view>
<view class='navbarTitle absolute box-center-middle wp40 text-center text-nowrap text-bold' style="color:{{txtColor}};" wx:if="{{!homeShowBar}}">{{titleText}}</view>
</view>
<view class='relative' style='height:{{navHeight}}px;' wx:else>
<view class="absolute left-0 box-middle" style="width:80px;height:32px;margin-left:7px;box-sizing:border-box;" wx:if="{{!isShowRetBtn}}">
<view class="absolute left-0 box-middle pl15 pr15" bindtap='back'>
<i class="iconfont mr10 icon-fanhui" style="font-size:22px;color:{{txtColor}};"></i>
</view>
</view>
<view class="absolute left-0 box-middle" style="width:40px;height:32px;margin-left:7px;box-sizing:border-box;" wx:else>
<view class="absolute box-center-middle" bindtap='home' wx:if="{{!isShowHomeBtn}}">
<i class="iconfont icon-shouye1" style="font-size:22px;color:{{txtColor}}"></i>
</view>
</view>
<view class='navbarTitle absolute box-center-middle wp40 text-center text-nowrap text-bold' style="color:{{txtColor}};">{{titleText}}</view>
</view>
</view>
</view>
+24
View File
@@ -0,0 +1,24 @@
@import "../../commons/css/common.wxss";
.citySelect {
padding-left: 12rpx;
}
.citySelect::after {
content: '';
width: 0;
height: 0;
margin-left: 12rpx;
display: inline-block;
border-width: 7rpx;
border-style: solid;
border-color: #fff transparent transparent transparent;
vertical-align: middle;
}
.searchBar{
left: 150rpx;
width: 384rpx;
}
.navbarTitle{
font-size: 32rpx;
}
+35
View File
@@ -0,0 +1,35 @@
// components/searchBar/index.js
import _ from '../../commons/js/commons';
Component({
/**
* 组件的属性列表
*/
properties: {
searchType: {
type: String,
value: ''
},
placeholder: {
type: String,
value: ''
},
url: {
type: String,
value: '/pages/search/index'
}
},
attached: function () {
},
data: {
},
pageLifetimes: {
show: function () {
},
},
methods: {
goPage(e){
_.$router.push(e.currentTarget.dataset.url)
}
}
})
+4
View File
@@ -0,0 +1,4 @@
{
"component": true,
"usingComponents": {}
}
+13
View File
@@ -0,0 +1,13 @@
<!-- components/searchBar/index.wxml -->
<view class="homeSearch" wx:if="{{searchType=='home'}}" bindtap="goPage" data-url="{{url}}">
<view>
<text class="icon"></text>
<text class="placeholder">{{placeholder}}</text>
</view>
</view>
<view wx:else class="professionSearch" bindtap="goPage" data-url="{{url}}">
<view>
<text class="icon"></text>
<text class="placeholder">{{placeholder}}</text>
</view>
</view>
+33
View File
@@ -0,0 +1,33 @@
/* components/searchBar/index.wxss */
.homeSearch{
width: 100%;
border-radius: 100rpx;
height: 55rpx;
line-height: 55rpx;
background-color: rgba(255,255,255,.6);
text-align: center;
}
.homeSearch .icon{
display: inline-block;
font-size: 30rpx;
}
.homeSearch .placeholder{
font-size: 26rpx;
color: rgba(0,0,0,.6);
}
.professionSearch{
width: 100%;
border-radius: 100rpx;
height: 70rpx;
line-height: 70rpx;
background-color: rgba(255,255,255,1);
text-align: center;
}
.homeSearch .icon{
display: inline-block;
font-size: 30rpx;
}
.professionSearch .placeholder{
font-size: 26rpx;
color: #a3a3a3;
}
+98
View File
@@ -0,0 +1,98 @@
import _ from '../../commons/js/commons'
const app = getApp()
Component({
//组件的属性列表
properties: {
currentIndex: {
type: String,
value: '0'
},
},
//组件的初始数据
data: {
list: [
{
"url": "/pages/index/index",
"icon": "tab-home",
"activeIcon": "tab-home-ac",
"title": "首页",
},
{
"url": "/pages/customer/index",
"icon": "tab-customer",
"activeIcon": "tab-customer-ac",
"title": "客户",
},
{
"url": "/pages/order/index",
"icon": "tab-order",
"activeIcon": "tab-order-ac",
"title": "订单",
},
{
"url": "/pages/mine/index?source=shop",
"icon": "tab-mine",
"activeIcon": "tab-mine-ac",
"title": "我的",
},
],
},
//生命周期方法
lifetimes: {
//在组件实例进入页面节点树时执行
attached: function () {
},
//在组件实例被从页面节点树移除时执行
detached: function () {
},
},
//组件所在页面的生命周期
pageLifetimes: {
//组件所在的页面被展示时执行
show: function () {
},
//组件所在的页面被隐藏时执行
hide: function () {
},
//组件所在的页面尺寸变化时执行
resize: function () {
},
},
//组件的方法列表
methods: {
//页面跳转
pushNavTab(e) {
let pages = getCurrentPages() //获取加载的页面
let currentPage = pages[pages.length - 1] //获取当前页面的对象
let url = currentPage.route //当前页面url
let isBack = false
let backIndex = 0
if (e.currentTarget.dataset.url && e.currentTarget.dataset.url != '/' + url) {
pages.forEach((item,index) => {
if(e.currentTarget.dataset.url=='/'+item.route){
isBack = true
backIndex = index
}
});
if(isBack){//后退
_.$router.back(Number(pages.length-backIndex-1))
}else{//前进打开
_.$router.openUrlScheme(e.currentTarget.dataset.url)
}
} else {
_.utils.scrollPageToDomForTop('.container')
}
},
}
})
+3
View File
@@ -0,0 +1,3 @@
{
"usingComponents": {}
}
+9
View File
@@ -0,0 +1,9 @@
<view class="safe-pb height-190"></view>
<view class="fixed bottom-0 left-0 wp100 fn-flex bg-fff fn-flex-around safe-pb bg-fff bts-1-eb text-center z-index-4">
<block wx:for="{{list}}" wx:key='index'>
<view class="fn-flex-item pt5 pb10" bindtap="pushNavTab" data-url="{{item.url}}">
<view class="inline-block img-60x60 icon-menu {{currentIndex == index?item.activeIcon:item.icon}}"></view>
<view class="font-22 line-height-12 {{currentIndex == index?'color-1a':'color-999'}}">{{item.title}}</view>
</view>
</block>
</view>
+11
View File
@@ -0,0 +1,11 @@
@import "../../commons/css/common.wxss";
.z-index-4{z-index:9999999999;}
.icon-menu{background:url("https://qs.haodian.cn/wechat_app/lichebao/common/icon-menu.png") no-repeat;background-size:750rpx auto;}
.tab-home{background-position:0 5rpx;}
.tab-home-ac{background-position:0 -55rpx;}
.tab-mine{background-position:-120rpx 5rpx;}
.tab-mine-ac{background-position:-120rpx -55rpx;}
.tab-customer{background-position:-180rpx 5rpx;}
.tab-customer-ac{background-position:-180rpx -55rpx;}
.tab-order{background-position:-240rpx 5rpx;}
.tab-order-ac{background-position:-240rpx -55rpx;}
+266
View File
@@ -0,0 +1,266 @@
import _ from '../../commons/js/commons'
import Canvas from '../../commons/js/utils/canvas'
let isGetImgInfo = false
const app = getApp()
Component({
//组件的属性列表
properties: {
isShow: {
type: Boolean,
value: false
},
qrcode: {
type: String,
value: ''
},
customImg: {
type: String,
value: ''
},
model: {
type:Object,
value:{}
},
storName: {
type: String,
value: ''
},
storaAddress: {
type: String,
value: ''
},
},
//组件的初始数据
data: {
imgs: [],
tempPosterPath: '',
showOptBtn:false,//操作按钮显示
},
attached: function () {
isGetImgInfo = false
},
//数据监听
observers: {
'isShow': function (e) {
if (e) {
this.setData({
showOptBtn:false,
})
this.createPoster()
}
},
'model': function (e) {
if (e) {
console.log(this.data.model)
this.getImageInfo(this.data.model.posterFt, 0)
if(this.data.model.type==1){
this.getImageInfo(this.data.model.posterBg, 3)
}
}
},
'customImg': function (e) {
if (e) {
this.getImageInfo(this.data.customImg, 1)
}
},
'qrcode': function (e) {
if (e) {
this.getImageInfo(this.data.qrcode, 2)
}
},
},
//组件的方法列表
methods: {
// 转化网络图片,获取路径
getImageInfo(src, index) {
let that = this
isGetImgInfo = false
setTimeout(function () {
wx.getImageInfo({
src: src,
success: (res) => {
let arr = that.data.imgs
arr[index] = res
that.setData({
imgs: arr
})
isGetImgInfo = true
},
fail: (err) => {
console.log('error img is: ' + src)
}
})
}, 200)
},
//自定义海报
defaultPoster(CTX){
if(this.data.customImg){
let that = this
let width = 600
let picheight = (parseFloat(this.data.imgs[1].height)/parseFloat(this.data.imgs[1].width))*(width-this.data.model.marginLR*2)
this.setData({
canvasInfo:{
width: width+'px',
height: this.data.model.tpHeight+this.data.model.ftHeight+picheight+'px'
}
})
CTX.setFillStyle(this.data.model.bgColor)
CTX.fillRect(0, 0,width, this.data.model.tpHeight+this.data.model.ftHeight+picheight)
//底图
if(that.data.model.type==1){
CTX.drawImage(that.data.imgs[3].path, 0, 0, that.data.imgs[3].width, that.data.imgs[3].height, 0, 0, width, this.data.model.tpHeight)
}
//底部图
if (that.data.imgs[0]) {
CTX.drawImage(that.data.imgs[0].path, 0, 0, that.data.imgs[0].width, that.data.imgs[0].height, 0, this.data.model.tpHeight+picheight, width, this.data.model.ftHeight)
}
//上传图
if (that.data.imgs[1]) {
CTX.drawImage(that.data.imgs[1].path, 0, 0, that.data.imgs[1].width, that.data.imgs[1].height, this.data.model.marginLR, this.data.model.tpHeight, width-this.data.model.marginLR*2, picheight)
}
//二维码
if (that.data.imgs[2]) {
Canvas.circleImage(CTX,that.data.imgs[2].path,417, this.data.model.tpHeight+picheight+170,70)
}
//店铺名
if (that.data.storName) {
Canvas.drawTextOverflow(CTX, that.data.storName, 230, 1, 24, this.data.model.color, 30, 88, this.data.model.tpHeight+picheight+72)
}
//地址
if (that.data.storaAddress) {
Canvas.drawTextOverflow(CTX, that.data.storaAddress, 200, 1, 18, this.data.model.color, 24, 113, this.data.model.tpHeight+picheight+104)
}
setTimeout(function(){
CTX.save()
CTX.draw(true, function () {
wx.hideLoading()
that.saveCanvas()
})
},200)
}
},
//生成海报
createPoster() {
let that = this
wx.showLoading({
title: '正在生成',
})
if(isGetImgInfo){
this.setData({
tempPosterPath: ''
})
let ctx = wx.createCanvasContext('postercanvas', that)
if(that.data.posterBg){
that.customizePoster(ctx)
}else{
that.defaultPoster(ctx)
}
}
},
//临时存储canvas
saveCanvas() {
let that = this
wx.canvasToTempFilePath({
canvasId: 'postercanvas',
quality: 1,
success: (res) => {
// this.tempFilePath = res.tempFilePath
that.setData({
'tempPosterPath': res.tempFilePath
})
setTimeout(function () {
that.setData({
showOptBtn:true,
})
},200)
},
fail: (res) => {
app.printErrorClient('poseterfail',['错误信息:临时存储canvas失败',JSON.stringify(res)])
}
}, this)
},
//保存到相册
saveToAblum() {
let that = this
wx.saveImageToPhotosAlbum({
filePath: this.data.tempPosterPath,
success: (res) => {
_.utils.$toast('保存成功')
},
fail: (err) => {
app.printErrorClient('poseterfail',['错误信息:图片保存失败',JSON.stringify(err)])
if (err.errMsg == 'saveImageToPhotosAlbum:fail cancel') {
_.utils.$toast('您已取消保存')
} else if (err.errMsg == 'saveImageToPhotosAlbum:fail auth deny') {
_.utils.$modal('提示', '保存图片失败,您可以点击确定设置获取相册权限后再尝试保存!', '去授权').then(res => {
if (res) {
wx.openSetting({}) // 打开小程序设置页面,可以设置权限
}
})
}
}
})
},
//隐藏海报弹框
hidePoster() {
this.setData({
isShow: false
})
wx.hideLoading()
},
//预览图片
preview() {
wx.previewImage({
current: this.data.tempPosterPath, // 当前显示图片的http链接
urls: [this.data.tempPosterPath] // 需要预览的图片http链接列表
})
},
//推送链接
pushLink(e) {
if(e.currentTarget.dataset.url){
_.$router.openUrlScheme(e.currentTarget.dataset.url)
}
},
//复制内容
copyWord(e){
if(e.currentTarget.dataset.tx){
wx.setClipboardData({
data: e.currentTarget.dataset.tx,
success (res) {
_.utils.$toast('复制成功')
}
})
}else{
_.utils.$toast('目前无文案')
}
},
}
})

Some files were not shown because too many files have changed in this diff Show More