Commit bd7c5e1e by 张立顺

fix:二维码组件兼容问题

1 parent 71ab6835
Showing 54 changed files with 1363 additions and 230 deletions
...@@ -3,10 +3,12 @@ ...@@ -3,10 +3,12 @@
0本地 0本地
1开发 1开发
2测试 2测试
3生产环境
*/ */
const accountInfo = wx.getAccountInfoSync() const accountInfo = wx.getAccountInfoSync()
const systemInfo = wx.getSystemInfoSync()
// console.log(systemInfo);
// console.log(accountInfo.miniProgram.envVersion) // console.log(accountInfo.miniProgram.envVersion)
//手动控制体验版环境的请求 true就依据下面index false就默认为2 //手动控制体验版环境的请求 true就依据下面index false就默认为2
const manual = false const manual = false
...@@ -17,21 +19,26 @@ let index = 2 ...@@ -17,21 +19,26 @@ let index = 2
// develop:开发版(正常开发工具,测试时) // develop:开发版(正常开发工具,测试时)
// trial:体验版 // trial:体验版
// release:正式版 // release:正式版
switch (accountInfo.miniProgram.envVersion) { // console.log( systemInfo.platform);
case 'develop': // console.log(accountInfo.miniProgram.envVersion);
// this.globalData.url = 'http://192.168.0.252:3000/api'; // if ( systemInfo.platform != "devtools") {
break switch (accountInfo.miniProgram.envVersion) {
case 'trial': case 'develop':
index = manual ? index : 2 // this.globalData.url = 'http://192.168.0.252:3000/api'; //
break break
case 'release': case 'trial':
index = 3 index = manual ? index : 2
break break
default: case 'release':
index = 3 index = 3
break break
default:
index = 3
break
}
} }
// console.log(index);
const secretKey_items = { const secretKey_items = {
ip: { ip: {
appKey: '48e5e13229b82c1b4e6e8c96151f0637', appKey: '48e5e13229b82c1b4e6e8c96151f0637',
...@@ -58,7 +65,7 @@ const domain_items = { ...@@ -58,7 +65,7 @@ const domain_items = {
prod: 'https://dj.glsx.com.cn' prod: 'https://dj.glsx.com.cn'
} }
const target = ['ip', 'dev', 'uat', 'prod'] const target = ['ip', 'dev', 'uat', 'prod']
// console.log(domain_items[target[index]]);
module.exports = { module.exports = {
domain: domain_items[target[index]], domain: domain_items[target[index]],
secretKey: secretKey_items[target[index]] secretKey: secretKey_items[target[index]]
......
...@@ -4,7 +4,7 @@ import router from './router/index.js' ...@@ -4,7 +4,7 @@ import router from './router/index.js'
import util from './utils/util.js' import util from './utils/util.js'
import api from './api/api.js' import api from './api/api.js'
App({ App({
onLaunch: function () { onLaunch () {
this.autoUpdate() this.autoUpdate()
/**挂载到wx对象 */ /**挂载到wx对象 */
wx.$util = util wx.$util = util
......
...@@ -10,16 +10,11 @@ ...@@ -10,16 +10,11 @@
"tabDate/pages/index/index", "tabDate/pages/index/index",
"tabDate/pages/detail/detail", "tabDate/pages/detail/detail",
"tabMine/pages/index/index", "tabMine/pages/index/index",
"tabMine/pages/grass/index",
"tabGrass/pages/index/index",
"tabGrass/pages/release/index",
"tabGrass/pages/detail/index",
"pages/accountItems/accountItems", "pages/accountItems/accountItems",
"pages/nothing/nothing", "pages/nothing/nothing",
"pages/wxLogin/wxLogin", "pages/wxLogin/wxLogin",
"tabOperating/pages/index/index", "tabOperating/pages/index/index",
"tabOperating/pages/operatingShow/operatingShow", "tabOperating/pages/operatingShow/operatingShow"
"test/pages/test"
], ],
"window": { "window": {
"backgroundTextStyle": "light", "backgroundTextStyle": "light",
......
...@@ -9,7 +9,7 @@ Component({ ...@@ -9,7 +9,7 @@ Component({
value: -1 value: -1
}, },
show: { show: {
String type: String
// observer: function (boolean) { // observer: function (boolean) {
// // console.log(n) // // console.log(n)
// // this.resetData(n) // // this.resetData(n)
......
...@@ -4,9 +4,14 @@ Component({ ...@@ -4,9 +4,14 @@ Component({
* 组件的属性列表 * 组件的属性列表
*/ */
properties: { properties: {
imgSrc: String, imgSrc: {
type: String,
// observer: function (n) {
// if (n) this.setImgUrl()
// }
},
isLoading: { isLoading: {
Boolean, type: Boolean,
default: false default: false
} }
}, },
...@@ -22,7 +27,7 @@ Component({ ...@@ -22,7 +27,7 @@ Component({
methods: { methods: {
previewImage(e) { previewImage(e) {
let { url } = e.currentTarget.dataset let { url } = e.currentTarget.dataset
console.log(url) // console.log(url)
if (url.includes('http')) { if (url.includes('http')) {
wx.previewImage({ wx.previewImage({
urls: [url], urls: [url],
...@@ -31,6 +36,13 @@ Component({ ...@@ -31,6 +36,13 @@ Component({
} else { } else {
this.triggerEvent('refresh') this.triggerEvent('refresh')
} }
},
imageLoad(params) {
console.log('load', this.data.imgSrc)
// this.setdata({})
},
imageError(params) {
console.log('error', this.data.imgSrc)
} }
} }
}) })
<!-- components/Qrbox.wxml --> <!-- components/Qrbox.wxml -->
<!-- <text>components/Qrbox.wxml</text> --> <!-- <text>components/Qrbox.wxml</text> -->
<view class="qr-box"> <view class="qr-box">
<!-- <view class="loadingBox">
</view> -->
<view wx:if="{{!imgSrc}}" class="loader box-center" /> <view wx:if="{{!imgSrc}}" class="loader box-center" />
<image <image
wx:else wx:else
class="qrImg"
webp="{{true}}"
bindtap="previewImage" bindtap="previewImage"
binderror="imageError"
bindload="imageLoad"
data-url="{{imgSrc}}" data-url="{{imgSrc}}"
src="{{imgSrc}}" /> src="{{imgSrc}}"
/>
</view> </view>
...@@ -6,9 +6,10 @@ ...@@ -6,9 +6,10 @@
min-height: 160rpx; min-height: 160rpx;
margin-bottom: 14rpx; margin-bottom: 14rpx;
} }
.qr-box image { .qr-box .qrImg {
width: 160rpx; width: 160rpx;
height: 160rpx; height: 160rpx;
display: inline-block;
} }
.loadingBox { .loadingBox {
width: 160rpx; width: 160rpx;
...@@ -29,6 +30,7 @@ ...@@ -29,6 +30,7 @@
width:1.5em; width:1.5em;
height:1.5em; height:1.5em;
} }
@keyframes loader { @keyframes loader {
0% { 0% {
-webkit-transform:rotate(0deg); -webkit-transform:rotate(0deg);
......
...@@ -5,7 +5,7 @@ Component({ ...@@ -5,7 +5,7 @@ Component({
*/ */
properties: { properties: {
show: { show: {
Boolean, type:Boolean,
value: false, value: false,
observer: function (n) { observer: function (n) {
// if (n) this.getLetter() // if (n) this.getLetter()
...@@ -15,7 +15,7 @@ Component({ ...@@ -15,7 +15,7 @@ Component({
placeholder: String, placeholder: String,
maxlength: Number, maxlength: Number,
value: { value: {
String type: String
}, },
// isFormComponent: { // isFormComponent: {
// type: Boolean, // type: Boolean,
......
// components/switchBlock/switchBlock.js
Component({
/**
* 组件的属性列表
*/
properties: {
switchName: {
// label:
type: Object,
value: {
left: '必填',
right: '非必填'
}
},
switchStatus: {
type: Boolean
},
disable: {
type: Boolean,
value: true
}
// switchStatus: {
// type: Number
// // value: 1,
// // observer: function (n) {
// // console.log(n)
// // // if (n) this.getLetter()
// // }
// }
},
/**
* 组件的初始数据
*/
data: {},
/**
* 组件的方法列表
*/
methods: {
switchChange(e) {
// console.log(e)
let { disable } = this.data
if (disable) {
let { status } = e.currentTarget.dataset
this.triggerEvent('switchEvent', status)
}
}
}
})
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file \ No newline at end of file
<!-- components/switchBlock/switchBlock.wxml -->
<view class="switch-box {{disable?'':'disabled'}}">
<view class="block text-center {{switchStatus?'':'right'}}" />
<view class="male text-center {{switchStatus?'active':''}}" bindtap="switchChange" data-status="1">
{{switchName.left}}
</view>
<view class="woman text-center {{!switchStatus?'active':''}}" bindtap="switchChange" data-status="0">
{{switchName.right}}
</view>
</view>
/* components/switchBlock/switchBlock.wxss */
.switch-box {
width: 236rpx;
height: 60rpx;
display: flex;
border: 2rpx solid #3582EE;
border-radius: 12rpx;
font-size: 28rpx;
color: #3582EE;
margin-left: auto;
position: relative;
}
.text-center {
display: flex;
align-items: center;
justify-content: center;
}
.switch-box .block {
position: absolute;
top: 0;
left: 0;
width: 50%;
border-radius: 12rpx;
height: 100%;
background: #3582EE;
color: #fff;
transition: all .25s;
}
.switch-box .block.right {
left: 50%;
}
.switch-box .male,
.switch-box .woman {
width: 50%;
height: 100%;
position: absolute;
top: 0;
transition: all .25s;
}
.switch-box .male {
left: 0;
}
.switch-box .woman {
right: 0;
}
.switch-box .male.active,
.switch-box .woman.active{
color: #fff;
}
.disabled{
opacity: .5;
}
\ No newline at end of file \ No newline at end of file
// components/switchPopup/switchPopup.js
const app = getApp()
Component({
/**
* 组件的属性列表
*/
properties: {
show: {
type: Boolean,
value: true
// observer: function (n) {
// if (n) {
// this.checkCoupon()
// }
// }
},
title: String,
tips: String,
height: {
type: String,
value: '85%'
}
// merchantSettingInfo: {
// type: Object,
// observer: function (n) {
// if (n) {
// this.setOrderSettingList(n)
// }
// }
// }
},
/**
* 组件的初始数据
*/
data: {
isYqdSuper: app.globalData.isYqdSuper,
// switchStatus: 1,
orderSettingList: [
{
label: '选择车型',
valueName: 'carTypeRequiredFlag',
value: true
},
{
label: '车架号(VIN码)',
valueName: 'standNoRequiredFlag',
value: false
},
{
label: '车牌号',
valueName: 'plateNumRequiredFlag',
value: true
}
]
},
/** 组件生命周期 */
lifetimes: {
attached: function () {
let merchantSettingInfo = app.getYQorderInfo()
console.log(merchantSettingInfo)
this.setOrderSettingList(merchantSettingInfo)
// // 支付方式为微信
// if (this.data.orderType == 1) {
// this.createWxQrcode()
// }
}
},
/**
* 组件的方法列表
*/
methods: {
confirm() {
// 判断是不是园区店管理员 不是都不处理
let {} = this.data
// 是管理员请求数据 并存全局读取
if (app.globalData.isYqdSuper) {
}
},
onSwitchChange(e) {
console.log(e.detail)
this.setData({
switchStatus: e.detail
})
},
setOrderSettingList(n) {
// 做转换
let { orderSettingList } = this.data
orderSettingList.forEach(element => {
// if (element.valueName == n) {
let value = n[element.valueName]
element.value = value == 'Y' ? true : false
// }
})
this.setData({
orderSettingList
})
}
}
})
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file \ No newline at end of file
<tab-popup
show="{{show}}"
title="{{title}}"
height="{{height}}"
tips="{{tips}}"
bindconfirm="confirm">
<block
wx:for="{{orderSettingList}}"
wx:key="index"
wx:for-item="item"
wx:for-index="index">
<gl-cell
border
label="{{item.label}}"
valueAlign="right"
labelWidth="240rpx">
<!-- <switchBlock/> -->
<switch-block disable="{{isYqdSuper}}" bindswitchEvent="onSwitchChange" switchStatus="{{orderSettingList[index]['value']}}" />
<!-- <view class="gender-box">
<view class="block text-center {{orderObj.customer.customerSex==1?'':'right'}}" />
<view class="male text-center {{orderObj.customer.customerSex == 1?'active':''}}" bindtap="changeGender" data-gender="1">
男
</view>
<view class="woman text-center {{orderObj.customer.customerSex == 2?'active':''}}" bindtap="changeGender" data-gender="2">
女
</view>
</view> -->
</gl-cell>
</block>
</tab-popup>
/* components/switchPopup/switchPopup.wxss */
\ No newline at end of file \ No newline at end of file
// tabWorkOrder/pages/createOrder/createOrderComponents/Popup/Popup.js
Component({
/**
* 组件的属性列表
*/
properties: {
show: {
type: Boolean,
value: false,
observer: function (n, o) {
this.setData({
showPopup: n
})
}
},
title: String,
tips: String,
height: {
type: String,
value: '85%'
},
isFullSucreen: {
type: Boolean,
value: false
}
},
/**
* 组件的初始数据
*/
data: {},
/**
* 组件的方法列表
*/
methods: {
noScroll() {},
hidePopup() {
this.setData({
show: false
})
},
confirm() {
this.triggerEvent('confirm')
}
},
attached() {
let { isFullSucreen } = this.data
// console.log(wx.$util.isFullSucreen())
// console.log(isFullSucreen)
this.setData({
isFullSucreen: wx.$util.isFullSucreen(isFullSucreen)
})
}
})
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file \ No newline at end of file
<view class="popup" hidden="{{!showPopup}}" catchtouchmove="noScroll">
<view class="popup-bg" bindtap="hidePopup" />
<view class="popup-content" style="height:{{height}}">
<block wx:if="{{title}}">
<view class="popup-title text-center">{{title}}</view>
</block>
<!-- {{isFullSucreen?title?'isFullSucreen':'isFullSucreen-notitle':''}}" -->
<view class="{{tips?'popup-slot-other':'popup-slot'}}">
<slot/>
</view>
<block wx:if="{{tips}}">
<view class="tips text-center">{{tips}}</view>
</block>
<!-- {{isFullSucreen?'isFullSucreen':''}} -->
<view class="popup-footer ">
<view class="cancel btn text-center" bindtap="hidePopup">取消</view>
<view class="confirm btn text-center" bindtap="confirm">确认</view>
</view>
</view>
</view>
/* tabWorkOrder/pages/createOrder/createOrderComponents/Popup/Popup.wxss */
.popup {
position: fixed;
top: 0;
left: 0;
bottom: 0;
right: 0;
z-index: 998;
}
.popup-bg {
position: absolute;
top: 0;
left: 0;
bottom: 0;
right: 0;
background-color: rgba(0, 0, 0, .6);
}
.text-center {
display: flex;
align-items: center;
justify-content: center;
}
.popup-content {
position: absolute;
left: 0;
width: 100%;
background: #FFFFFF;
border-radius: 20rpx 20rpx 0 0;
animation: show-popup .5s forwards;
box-sizing: border-box;
padding: 0 32rpx;
}
.popup-title {
height: 98rpx;
font-size: 32rpx;
color: #333333;
border-bottom: 2rpx solid #EBEDF0;
}
.popup-slot {
height: calc(100% - 200rpx);
}
.popup-slot-other {
height: calc(100% - 200rpx - 71rpx);
}
.popup-slot.isFullSucreen{
height: calc(100% - 268rpx);
}
.popup-slot.isFullSucreen-notitle{
height: calc(100% - 170rpx);
}
.popup-content .tips {
color: #999;
font-size: 24rpx;
margin-bottom: 40rpx;
}
.popup-footer {
display: flex;
align-items: center;
justify-content: space-between;
padding:10rpx 0 ;
}
.popup-footer.isFullSucreen{
padding-bottom: 68rpx !important;
}
.popup-footer .btn {
width: 330rpx;
height: 80rpx;
box-sizing: border-box;
border-radius: 12rpx;
font-size: 28rpx;
}
.popup-footer .cancel {
color: #323233;
border: 2rpx solid #DCDEE0;
}
.popup-footer .confirm{
background: #3582EE;
color: #fff;
}
@keyframes show-popup {
0% {
bottom: -100%;
}
100% {
bottom: 0;
}
}
\ No newline at end of file \ No newline at end of file
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.GRAY_DARK = exports.GRAY = exports.ORANGE = exports.GREEN = exports.WHITE = exports.BLUE = exports.RED = void 0;
exports.RED = '#ee0a24';
exports.BLUE = '#1989fa';
exports.WHITE = '#fff';
exports.GREEN = '#07c160';
exports.ORANGE = '#ff976a';
exports.GRAY = '#323233';
exports.GRAY_DARK = '#969799';
import { basic } from '../mixins/basic'; "use strict";
const relationFunctions = { Object.defineProperty(exports, "__esModule", { value: true });
ancestor: { exports.VantComponent = void 0;
linked(parent) { var basic_1 = require("../mixins/basic");
this.parent = parent;
},
unlinked() {
this.parent = null;
},
},
descendant: {
linked(child) {
this.children = this.children || [];
this.children.push(child);
},
unlinked(child) {
this.children = (this.children || []).filter(it => it !== child);
},
},
};
function mapKeys(source, target, map) { function mapKeys(source, target, map) {
Object.keys(map).forEach(key => { Object.keys(map).forEach(function (key) {
if (source[key]) { if (source[key]) {
target[map[key]] = source[key]; target[map[key]] = source[key];
} }
}); });
} }
function makeRelation(options, vantOptions, relation) { function VantComponent(vantOptions) {
const { type, name, linked, unlinked, linkChanged } = relation; var options = {};
const { beforeCreate, destroyed } = vantOptions;
if (type === 'descendant') {
options.created = function () {
beforeCreate && beforeCreate.bind(this)();
this.children = this.children || [];
};
options.detached = function () {
this.children = [];
destroyed && destroyed.bind(this)();
};
}
options.relations = Object.assign(options.relations || {}, {
[`../${name}/index`]: {
type,
linked(node) {
relationFunctions[type].linked.bind(this)(node);
linked && linked.bind(this)(node);
},
linkChanged(node) {
linkChanged && linkChanged.bind(this)(node);
},
unlinked(node) {
relationFunctions[type].unlinked.bind(this)(node);
unlinked && unlinked.bind(this)(node);
},
}
});
}
function VantComponent(vantOptions = {}) {
const options = {};
mapKeys(vantOptions, options, { mapKeys(vantOptions, options, {
data: 'data', data: 'data',
props: 'properties', props: 'properties',
...@@ -65,37 +19,30 @@ function VantComponent(vantOptions = {}) { ...@@ -65,37 +19,30 @@ function VantComponent(vantOptions = {}) {
beforeCreate: 'created', beforeCreate: 'created',
created: 'attached', created: 'attached',
mounted: 'ready', mounted: 'ready',
relations: 'relations',
destroyed: 'detached', destroyed: 'detached',
classes: 'externalClasses' classes: 'externalClasses',
}); });
const { relation } = vantOptions;
if (relation) {
makeRelation(options, vantOptions, relation);
}
// add default externalClasses // add default externalClasses
options.externalClasses = options.externalClasses || []; options.externalClasses = options.externalClasses || [];
options.externalClasses.push('custom-class'); options.externalClasses.push('custom-class');
// add default behaviors // add default behaviors
options.behaviors = options.behaviors || []; options.behaviors = options.behaviors || [];
options.behaviors.push(basic); options.behaviors.push(basic_1.basic);
// add relations
var relation = vantOptions.relation;
if (relation) {
options.relations = relation.relations;
options.behaviors.push(relation.mixin);
}
// map field to form-field behavior // map field to form-field behavior
if (vantOptions.field) { if (vantOptions.field) {
options.behaviors.push('wx://form-field'); options.behaviors.push('wx://form-field');
} }
if (options.properties) {
Object.keys(options.properties).forEach(name => {
if (Array.isArray(options.properties[name])) {
// miniprogram do not allow multi type
options.properties[name] = null;
}
});
}
// add default options // add default options
options.options = { options.options = {
multipleSlots: true, multipleSlots: true,
addGlobalClass: true addGlobalClass: true,
}; };
Component(options); Component(options);
} }
export { VantComponent }; exports.VantComponent = VantComponent;
.van-ellipsis{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.van-multi-ellipsis--l2{-webkit-line-clamp:2}.van-multi-ellipsis--l2,.van-multi-ellipsis--l3{display:-webkit-box;overflow:hidden;text-overflow:ellipsis;-webkit-box-orient:vertical}.van-multi-ellipsis--l3{-webkit-line-clamp:3}.van-clearfix:after{display:table;clear:both;content:""}.van-hairline,.van-hairline--bottom,.van-hairline--left,.van-hairline--right,.van-hairline--surround,.van-hairline--top,.van-hairline--top-bottom{position:relative}.van-hairline--bottom:after,.van-hairline--left:after,.van-hairline--right:after,.van-hairline--surround:after,.van-hairline--top-bottom:after,.van-hairline--top:after,.van-hairline:after{position:absolute;box-sizing:border-box;-webkit-transform-origin:center;transform-origin:center;content:" ";pointer-events:none;top:-50%;right:-50%;bottom:-50%;left:-50%;border:0 solid #eee;-webkit-transform:scale(.5);transform:scale(.5)}.van-hairline--top:after{border-top-width:1px}.van-hairline--left:after{border-left-width:1px}.van-hairline--right:after{border-right-width:1px}.van-hairline--bottom:after{border-bottom-width:1px}.van-hairline--top-bottom:after{border-width:1px 0}.van-hairline--surround:after{border-width:1px}
\ No newline at end of file \ No newline at end of file
.van-ellipsis{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.van-multi-ellipsis--l2{-webkit-line-clamp:2}.van-multi-ellipsis--l2,.van-multi-ellipsis--l3{-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden;text-overflow:ellipsis}.van-multi-ellipsis--l3{-webkit-line-clamp:3}.van-clearfix:after{clear:both;content:"";display:table}.van-hairline,.van-hairline--bottom,.van-hairline--left,.van-hairline--right,.van-hairline--surround,.van-hairline--top,.van-hairline--top-bottom{position:relative}.van-hairline--bottom:after,.van-hairline--left:after,.van-hairline--right:after,.van-hairline--surround:after,.van-hairline--top-bottom:after,.van-hairline--top:after,.van-hairline:after{border:0 solid #ebedf0;bottom:-50%;box-sizing:border-box;content:" ";left:-50%;pointer-events:none;position:absolute;right:-50%;top:-50%;transform:scale(.5);transform-origin:center}.van-hairline--top:after{border-top-width:1px}.van-hairline--left:after{border-left-width:1px}.van-hairline--right:after{border-right-width:1px}.van-hairline--bottom:after{border-bottom-width:1px}.van-hairline--top-bottom:after{border-width:1px 0}.van-hairline--surround:after{border-width:1px}
\ No newline at end of file \ No newline at end of file
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.useChildren = exports.useParent = void 0;
function useParent(name, onEffect) {
var _a;
var path = "../" + name + "/index";
return {
relations: (_a = {},
_a[path] = {
type: 'ancestor',
linked: function () {
onEffect && onEffect.call(this);
},
linkChanged: function () {
onEffect && onEffect.call(this);
},
unlinked: function () {
onEffect && onEffect.call(this);
},
},
_a),
mixin: Behavior({
created: function () {
var _this = this;
Object.defineProperty(this, 'parent', {
get: function () { return _this.getRelationNodes(path)[0]; },
});
Object.defineProperty(this, 'index', {
// @ts-ignore
get: function () { var _a, _b; return (_b = (_a = _this.parent) === null || _a === void 0 ? void 0 : _a.children) === null || _b === void 0 ? void 0 : _b.indexOf(_this); },
});
},
}),
};
}
exports.useParent = useParent;
function useChildren(name, onEffect) {
var _a;
var path = "../" + name + "/index";
return {
relations: (_a = {},
_a[path] = {
type: 'descendant',
linked: function (target) {
onEffect && onEffect.call(this, target);
},
linkChanged: function (target) {
onEffect && onEffect.call(this, target);
},
unlinked: function (target) {
onEffect && onEffect.call(this, target);
},
},
_a),
mixin: Behavior({
created: function () {
var _this = this;
Object.defineProperty(this, 'children', {
get: function () { return _this.getRelationNodes(path) || []; },
});
},
}),
};
}
exports.useChildren = useChildren;
.van-clearfix:after{clear:both;content:"";display:table}
\ No newline at end of file \ No newline at end of file
.van-ellipsis{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.van-multi-ellipsis--l2{-webkit-line-clamp:2}.van-multi-ellipsis--l2,.van-multi-ellipsis--l3{-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden;text-overflow:ellipsis}.van-multi-ellipsis--l3{-webkit-line-clamp:3}
\ No newline at end of file \ No newline at end of file
.van-hairline,.van-hairline--bottom,.van-hairline--left,.van-hairline--right,.van-hairline--surround,.van-hairline--top,.van-hairline--top-bottom{position:relative}.van-hairline--bottom:after,.van-hairline--left:after,.van-hairline--right:after,.van-hairline--surround:after,.van-hairline--top-bottom:after,.van-hairline--top:after,.van-hairline:after{border:0 solid #ebedf0;bottom:-50%;box-sizing:border-box;content:" ";left:-50%;pointer-events:none;position:absolute;right:-50%;top:-50%;transform:scale(.5);transform-origin:center}.van-hairline--top:after{border-top-width:1px}.van-hairline--left:after{border-left-width:1px}.van-hairline--right:after{border-right-width:1px}.van-hairline--bottom:after{border-bottom-width:1px}.van-hairline--top-bottom:after{border-width:1px 0}.van-hairline--surround:after{border-width:1px}
\ No newline at end of file \ No newline at end of file
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getCurrentPage = exports.toPromise = exports.groupSetData = exports.getAllRect = exports.getRect = exports.pickExclude = exports.requestAnimationFrame = exports.addUnit = exports.getSystemInfoSync = exports.nextTick = exports.range = exports.isDef = void 0;
var validator_1 = require("./validator");
var version_1 = require("./version");
var validator_2 = require("./validator");
Object.defineProperty(exports, "isDef", { enumerable: true, get: function () { return validator_2.isDef; } });
function range(num, min, max) {
return Math.min(Math.max(num, min), max);
}
exports.range = range;
function nextTick(cb) {
if ((0, version_1.canIUseNextTick)()) {
wx.nextTick(cb);
}
else {
setTimeout(function () {
cb();
}, 1000 / 30);
}
}
exports.nextTick = nextTick;
var systemInfo;
function getSystemInfoSync() {
if (systemInfo == null) {
systemInfo = wx.getSystemInfoSync();
}
return systemInfo;
}
exports.getSystemInfoSync = getSystemInfoSync;
function addUnit(value) {
if (!(0, validator_1.isDef)(value)) {
return undefined;
}
value = String(value);
return (0, validator_1.isNumber)(value) ? value + "px" : value;
}
exports.addUnit = addUnit;
function requestAnimationFrame(cb) {
var systemInfo = getSystemInfoSync();
if (systemInfo.platform === 'devtools') {
return setTimeout(function () {
cb();
}, 1000 / 30);
}
return wx
.createSelectorQuery()
.selectViewport()
.boundingClientRect()
.exec(function () {
cb();
});
}
exports.requestAnimationFrame = requestAnimationFrame;
function pickExclude(obj, keys) {
if (!(0, validator_1.isPlainObject)(obj)) {
return {};
}
return Object.keys(obj).reduce(function (prev, key) {
if (!keys.includes(key)) {
prev[key] = obj[key];
}
return prev;
}, {});
}
exports.pickExclude = pickExclude;
function getRect(context, selector) {
return new Promise(function (resolve) {
wx.createSelectorQuery()
.in(context)
.select(selector)
.boundingClientRect()
.exec(function (rect) {
if (rect === void 0) { rect = []; }
return resolve(rect[0]);
});
});
}
exports.getRect = getRect;
function getAllRect(context, selector) {
return new Promise(function (resolve) {
wx.createSelectorQuery()
.in(context)
.selectAll(selector)
.boundingClientRect()
.exec(function (rect) {
if (rect === void 0) { rect = []; }
return resolve(rect[0]);
});
});
}
exports.getAllRect = getAllRect;
function groupSetData(context, cb) {
if ((0, version_1.canIUseGroupSetData)()) {
context.groupSetData(cb);
}
else {
cb();
}
}
exports.groupSetData = groupSetData;
function toPromise(promiseLike) {
if ((0, validator_1.isPromise)(promiseLike)) {
return promiseLike;
}
return Promise.resolve(promiseLike);
}
exports.toPromise = toPromise;
function getCurrentPage() {
var pages = getCurrentPages();
return pages[pages.length - 1];
}
exports.getCurrentPage = getCurrentPage;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.isVideoUrl = exports.isImageUrl = exports.isBoolean = exports.isNumber = exports.isObj = exports.isDef = exports.isPromise = exports.isPlainObject = exports.isFunction = void 0;
// eslint-disable-next-line @typescript-eslint/ban-types
function isFunction(val) {
return typeof val === 'function';
}
exports.isFunction = isFunction;
function isPlainObject(val) {
return val !== null && typeof val === 'object' && !Array.isArray(val);
}
exports.isPlainObject = isPlainObject;
function isPromise(val) {
return isPlainObject(val) && isFunction(val.then) && isFunction(val.catch);
}
exports.isPromise = isPromise;
function isDef(value) {
return value !== undefined && value !== null;
}
exports.isDef = isDef;
function isObj(x) {
var type = typeof x;
return x !== null && (type === 'object' || type === 'function');
}
exports.isObj = isObj;
function isNumber(value) {
return /^\d+(\.\d+)?$/.test(value);
}
exports.isNumber = isNumber;
function isBoolean(value) {
return typeof value === 'boolean';
}
exports.isBoolean = isBoolean;
var IMAGE_REGEXP = /\.(jpeg|jpg|gif|png|svg|webp|jfif|bmp|dpg)/i;
var VIDEO_REGEXP = /\.(mp4|mpg|mpeg|dat|asf|avi|rm|rmvb|mov|wmv|flv|mkv)/i;
function isImageUrl(url) {
return IMAGE_REGEXP.test(url);
}
exports.isImageUrl = isImageUrl;
function isVideoUrl(url) {
return VIDEO_REGEXP.test(url);
}
exports.isVideoUrl = isVideoUrl;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.canIUseGetUserProfile = exports.canIUseCanvas2d = exports.canIUseNextTick = exports.canIUseGroupSetData = exports.canIUseAnimate = exports.canIUseFormFieldButton = exports.canIUseModel = void 0;
var utils_1 = require("./utils");
function compareVersion(v1, v2) {
v1 = v1.split('.');
v2 = v2.split('.');
var len = Math.max(v1.length, v2.length);
while (v1.length < len) {
v1.push('0');
}
while (v2.length < len) {
v2.push('0');
}
for (var i = 0; i < len; i++) {
var num1 = parseInt(v1[i], 10);
var num2 = parseInt(v2[i], 10);
if (num1 > num2) {
return 1;
}
if (num1 < num2) {
return -1;
}
}
return 0;
}
function gte(version) {
var system = (0, utils_1.getSystemInfoSync)();
return compareVersion(system.SDKVersion, version) >= 0;
}
function canIUseModel() {
return gte('2.9.3');
}
exports.canIUseModel = canIUseModel;
function canIUseFormFieldButton() {
return gte('2.10.3');
}
exports.canIUseFormFieldButton = canIUseFormFieldButton;
function canIUseAnimate() {
return gte('2.9.0');
}
exports.canIUseAnimate = canIUseAnimate;
function canIUseGroupSetData() {
return gte('2.4.0');
}
exports.canIUseGroupSetData = canIUseGroupSetData;
function canIUseNextTick() {
return wx.canIUse('nextTick');
}
exports.canIUseNextTick = canIUseNextTick;
function canIUseCanvas2d() {
return gte('2.9.0');
}
exports.canIUseCanvas2d = canIUseCanvas2d;
function canIUseGetUserProfile() {
return !!wx.getUserProfile;
}
exports.canIUseGetUserProfile = canIUseGetUserProfile;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.basic = void 0;
exports.basic = Behavior({
methods: {
$emit: function (name, detail, options) {
this.triggerEvent(name, detail, options);
},
set: function (data) {
this.setData(data);
return new Promise(function (resolve) { return wx.nextTick(resolve); });
},
},
});
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.button = void 0;
var version_1 = require("../common/version");
exports.button = Behavior({
externalClasses: ['hover-class'],
properties: {
id: String,
lang: String,
businessId: Number,
sessionFrom: String,
sendMessageTitle: String,
sendMessagePath: String,
sendMessageImg: String,
showMessageCard: Boolean,
appParameter: String,
ariaLabel: String,
openType: String,
getUserProfileDesc: String,
},
data: {
canIUseGetUserProfile: (0, version_1.canIUseGetUserProfile)(),
},
methods: {
onGetUserInfo: function (event) {
this.triggerEvent('getuserinfo', event.detail);
},
onContact: function (event) {
this.triggerEvent('contact', event.detail);
},
onGetPhoneNumber: function (event) {
this.triggerEvent('getphonenumber', event.detail);
},
onError: function (event) {
this.triggerEvent('error', event.detail);
},
onLaunchApp: function (event) {
this.triggerEvent('launchapp', event.detail);
},
onOpenSetting: function (event) {
this.triggerEvent('opensetting', event.detail);
},
},
});
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.link = void 0;
exports.link = Behavior({
properties: {
url: String,
linkType: {
type: String,
value: 'navigateTo',
},
},
methods: {
jumpLink: function (urlKey) {
if (urlKey === void 0) { urlKey = 'url'; }
var url = this.data[urlKey];
if (url) {
if (this.data.linkType === 'navigateTo' &&
getCurrentPages().length > 9) {
wx.redirectTo({ url: url });
}
else {
wx[this.data.linkType]({ url: url });
}
}
},
},
});
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.pageScrollMixin = void 0;
var utils_1 = require("../common/utils");
function onPageScroll(event) {
var _a = (0, utils_1.getCurrentPage)().vanPageScroller, vanPageScroller = _a === void 0 ? [] : _a;
vanPageScroller.forEach(function (scroller) {
if (typeof scroller === 'function') {
// @ts-ignore
scroller(event);
}
});
}
var pageScrollMixin = function (scroller) {
return Behavior({
attached: function () {
var page = (0, utils_1.getCurrentPage)();
if (!(0, utils_1.isDef)(page)) {
return;
}
if (Array.isArray(page.vanPageScroller)) {
page.vanPageScroller.push(scroller.bind(this));
}
else {
page.vanPageScroller =
typeof page.onPageScroll === 'function'
? [page.onPageScroll.bind(page), scroller.bind(this)]
: [scroller.bind(this)];
}
page.onPageScroll = onPageScroll;
},
detached: function () {
var _a;
var page = (0, utils_1.getCurrentPage)();
if ((0, utils_1.isDef)(page)) {
page.vanPageScroller =
((_a = page.vanPageScroller) === null || _a === void 0 ? void 0 : _a.filter(function (item) { return item !== scroller; })) || [];
}
},
});
};
exports.pageScrollMixin = pageScrollMixin;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.touch = void 0;
// @ts-nocheck
var MIN_DISTANCE = 10;
function getDirection(x, y) {
if (x > y && x > MIN_DISTANCE) {
return 'horizontal';
}
if (y > x && y > MIN_DISTANCE) {
return 'vertical';
}
return '';
}
exports.touch = Behavior({
methods: {
resetTouchStatus: function () {
this.direction = '';
this.deltaX = 0;
this.deltaY = 0;
this.offsetX = 0;
this.offsetY = 0;
},
touchStart: function (event) {
this.resetTouchStatus();
var touch = event.touches[0];
this.startX = touch.clientX;
this.startY = touch.clientY;
},
touchMove: function (event) {
var touch = event.touches[0];
this.deltaX = touch.clientX - this.startX;
this.deltaY = touch.clientY - this.startY;
this.offsetX = Math.abs(this.deltaX);
this.offsetY = Math.abs(this.deltaY);
this.direction =
this.direction || getDirection(this.offsetX, this.offsetY);
},
},
});
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.transition = void 0;
// @ts-nocheck
var utils_1 = require("../common/utils");
var validator_1 = require("../common/validator");
var getClassNames = function (name) { return ({
enter: "van-" + name + "-enter van-" + name + "-enter-active enter-class enter-active-class",
'enter-to': "van-" + name + "-enter-to van-" + name + "-enter-active enter-to-class enter-active-class",
leave: "van-" + name + "-leave van-" + name + "-leave-active leave-class leave-active-class",
'leave-to': "van-" + name + "-leave-to van-" + name + "-leave-active leave-to-class leave-active-class",
}); };
function transition(showDefaultValue) {
return Behavior({
properties: {
customStyle: String,
// @ts-ignore
show: {
type: Boolean,
value: showDefaultValue,
observer: 'observeShow',
},
// @ts-ignore
duration: {
type: null,
value: 300,
observer: 'observeDuration',
},
name: {
type: String,
value: 'fade',
},
},
data: {
type: '',
inited: false,
display: false,
},
ready: function () {
if (this.data.show === true) {
this.observeShow(true, false);
}
},
methods: {
observeShow: function (value, old) {
if (value === old) {
return;
}
value ? this.enter() : this.leave();
},
enter: function () {
var _this = this;
var _a = this.data, duration = _a.duration, name = _a.name;
var classNames = getClassNames(name);
var currentDuration = (0, validator_1.isObj)(duration) ? duration.enter : duration;
this.status = 'enter';
this.$emit('before-enter');
(0, utils_1.requestAnimationFrame)(function () {
if (_this.status !== 'enter') {
return;
}
_this.$emit('enter');
_this.setData({
inited: true,
display: true,
classes: classNames.enter,
currentDuration: currentDuration,
});
(0, utils_1.requestAnimationFrame)(function () {
if (_this.status !== 'enter') {
return;
}
_this.transitionEnded = false;
_this.setData({ classes: classNames['enter-to'] });
});
});
},
leave: function () {
var _this = this;
if (!this.data.display) {
return;
}
var _a = this.data, duration = _a.duration, name = _a.name;
var classNames = getClassNames(name);
var currentDuration = (0, validator_1.isObj)(duration) ? duration.leave : duration;
this.status = 'leave';
this.$emit('before-leave');
(0, utils_1.requestAnimationFrame)(function () {
if (_this.status !== 'leave') {
return;
}
_this.$emit('leave');
_this.setData({
classes: classNames.leave,
currentDuration: currentDuration,
});
(0, utils_1.requestAnimationFrame)(function () {
if (_this.status !== 'leave') {
return;
}
_this.transitionEnded = false;
setTimeout(function () { return _this.onTransitionEnd(); }, currentDuration);
_this.setData({ classes: classNames['leave-to'] });
});
});
},
onTransitionEnd: function () {
if (this.transitionEnded) {
return;
}
this.transitionEnded = true;
this.$emit("after-" + this.status);
var _a = this.data, show = _a.show, display = _a.display;
if (!show && display) {
this.setData({ display: false });
}
},
},
});
}
exports.transition = transition;
{ {
"description": "项目配置文件,详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html", "description": "项目配置文件,详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
"packOptions": { "packOptions": {
"ignore": [], "ignore": [],
"include": [] "include": []
},
"setting": {
"urlCheck": false,
"es6": true,
"enhance": true,
"postcss": true,
"preloadBackgroundData": false,
"minified": true,
"newFeature": false,
"coverView": true,
"nodeModules": false,
"autoAudits": false,
"showShadowRootInWxmlPanel": true,
"scopeDataCheck": false,
"uglifyFileName": false,
"checkInvalidKey": true,
"checkSiteMap": false,
"uploadWithSourceMap": true,
"compileHotReLoad": false,
"lazyloadPlaceholderEnable": false,
"useMultiFrameRuntime": true,
"useApiHook": true,
"useApiHostProcess": true,
"babelSetting": {
"ignore": [],
"disablePlugins": [],
"outputPath": ""
}, },
"useIsolateContext": false, "setting": {
"userConfirmedBundleSwitch": false, "urlCheck": true,
"packNpmManually": false, "es6": true,
"packNpmRelationList": [], "enhance": true,
"minifyWXSS": true, "postcss": true,
"disableUseStrict": false, "preloadBackgroundData": false,
"minifyWXML": true, "minified": true,
"showES6CompileOption": false, "newFeature": false,
"useCompilerPlugins": false, "coverView": true,
"ignoreUploadUnusedFiles": true, "nodeModules": false,
"useStaticServer": true "autoAudits": false,
}, "showShadowRootInWxmlPanel": true,
"compileType": "miniprogram", "scopeDataCheck": false,
"libVersion": "2.23.4", "uglifyFileName": false,
"appid": "wx570d9331f9ace0bd", "checkInvalidKey": true,
"projectname": "%E7%B2%BE%E5%93%81%E5%8D%87%E7%BA%A7", "checkSiteMap": false,
"simulatorType": "wechat", "uploadWithSourceMap": true,
"simulatorPluginLibVersion": {}, "compileHotReLoad": false,
"condition": { "lazyloadPlaceholderEnable": false,
"search": { "useMultiFrameRuntime": true,
"list": [] "useApiHook": true,
}, "useApiHostProcess": true,
"conversation": { "babelSetting": {
"list": [] "ignore": [],
}, "disablePlugins": [],
"plugin": { "outputPath": ""
"list": [] },
}, "useIsolateContext": false,
"game": { "userConfirmedBundleSwitch": false,
"list": [] "packNpmManually": false,
"packNpmRelationList": [],
"minifyWXSS": true,
"disableUseStrict": false,
"minifyWXML": true,
"showES6CompileOption": false,
"useCompilerPlugins": false,
"ignoreUploadUnusedFiles": true
}, },
"gamePlugin": { "compileType": "miniprogram",
"list": [] "libVersion": "2.8.3",
"appid": "wx570d9331f9ace0bd",
"projectname": "%E7%B2%BE%E5%93%81%E5%8D%87%E7%BA%A7",
"simulatorType": "wechat",
"simulatorPluginLibVersion": {},
"editorSetting": {
"tabIndent": "insertSpaces",
"tabSize": 2
}, },
"miniprogram": { "condition": {
"list": [ "search": {
{ "list": []
"id": 0, },
"name": "分享组件", "conversation": {
"pathName": "tabComponents/pages/share/share", "list": []
"query": "",
"scene": null
}, },
{ "plugin": {
"id": 1, "list": []
"name": "授权组件",
"pathName": "tabComponents/pages/authorize/authorize",
"query": "",
"scene": null
}, },
{ "game": {
"id": -1, "list": []
"name": "时间范围选择器",
"pathName": "tabComponents/pages/time-horizon/time-horizon",
"query": "",
"scene": null
}, },
{ "gamePlugin": {
"id": -1, "list": []
"name": "cell",
"pathName": "tabComponents/pages/gl-cell/gl-cell",
"query": "",
"scene": null
}, },
{ "miniprogram": {
"id": -1, "list": [
"name": "日历", {
"pathName": "tabComponents/pages/calendar/calendar", "id": 0,
"query": "", "name": "分享组件",
"scene": null "pathName": "tabComponents/pages/share/share",
"query": "",
"scene": null
},
{
"id": 1,
"name": "授权组件",
"pathName": "tabComponents/pages/authorize/authorize",
"query": "",
"scene": null
},
{
"id": -1,
"name": "时间范围选择器",
"pathName": "tabComponents/pages/time-horizon/time-horizon",
"query": "",
"scene": null
},
{
"id": -1,
"name": "cell",
"pathName": "tabComponents/pages/gl-cell/gl-cell",
"query": "",
"scene": null
},
{
"id": -1,
"name": "日历",
"pathName": "tabComponents/pages/calendar/calendar",
"query": "",
"scene": null
}
]
} }
]
} }
},
"editorSetting": {
"tabIndent": "insertSpaces",
"tabSize": 2
}
} }
\ No newline at end of file \ No newline at end of file
...@@ -5,6 +5,8 @@ import util from '../utils/util.js' ...@@ -5,6 +5,8 @@ import util from '../utils/util.js'
const generateRoutList = routerList => { const generateRoutList = routerList => {
let _routerList = routerList let _routerList = routerList
try { try {
// console.log(wx.getLaunchOptionsSync());
// console.log(__wxConfig);
__wxConfig && __wxConfig &&
__wxConfig.tabBar && __wxConfig.tabBar &&
__wxConfig.tabBar.list && __wxConfig.tabBar.list &&
...@@ -29,11 +31,19 @@ class Router { ...@@ -29,11 +31,19 @@ class Router {
const thisRouter = this[_routerList].find(item => item.url === `/${e.path}`) const thisRouter = this[_routerList].find(item => item.url === `/${e.path}`)
// console.log(thisRouter) // console.log(thisRouter)
if (thisRouter.isTab) { if (thisRouter.isTab) {
wx.showTabBar() wx.showTabBar({
.then(result => {}) success(result) {
.catch(err => { console.log(result)
},
fail(err) {
console.log(err) console.log(err)
}) }
})
// 解决低版本兼容问题
// .then(result => {})
// .catch(err => {
// console.log(err)
// })
} }
if (thisPage) { if (thisPage) {
......
...@@ -463,7 +463,7 @@ Page({ ...@@ -463,7 +463,7 @@ Page({
let userInfo = wx.$util.getUserInfo() let userInfo = wx.$util.getUserInfo()
// console.log(userInfo) // console.log(userInfo)
console.log(app.globalData) // console.log(app.globalData)
if (userInfo) { if (userInfo) {
let { userInfo: newUserInfo } = this.data let { userInfo: newUserInfo } = this.data
......
...@@ -53,7 +53,7 @@ Page({ ...@@ -53,7 +53,7 @@ Page({
orderInfo: { selectPayType, status, orderCode } orderInfo: { selectPayType, status, orderCode }
} = this.data } = this.data
let _this = this let _this = this
console.log(orderCode) // console.log(orderCode)
// 微信支付 // 微信支付
if (selectPayType == 1) { if (selectPayType == 1) {
...@@ -185,7 +185,8 @@ Page({ ...@@ -185,7 +185,8 @@ Page({
} }
}, },
getDetail(orderCode) { getDetail(orderCode) {
console.log(orderCode) // console.log(orderCode)
let _this = this
api api
.getOrderDetail({ .getOrderDetail({
orderCode orderCode
...@@ -243,7 +244,7 @@ Page({ ...@@ -243,7 +244,7 @@ Page({
confirmColor: '#3582EE', confirmColor: '#3582EE',
success(res) { success(res) {
if (res.confirm) { if (res.confirm) {
_this.getOrderDetail(orderCode) _this.getDetail(orderCode)
} }
} }
}) })
......
...@@ -12,7 +12,8 @@ Page({ ...@@ -12,7 +12,8 @@ Page({
qrHeight: 107, qrHeight: 107,
isYqdSuper: app.globalData.isYqdSuper, isYqdSuper: app.globalData.isYqdSuper,
customerService: '', customerService: '',
defaultCustomerService: 'https://img01.glsx.com.cn/group1/M00/21/01/wKgFHWKEkeSAZRltAAED5CfS91o118.png', defaultCustomerService: 'https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/kf.png',
// defaultCustomerService: 'https://img01.glsx.com.cn/group1/M00/21/01/wKgFHWKEkeSAZRltAAED5CfS91o118.png',
failCustomerService: '../images/kfrefresh.png' failCustomerService: '../images/kfrefresh.png'
}, },
...@@ -179,6 +180,25 @@ Page({ ...@@ -179,6 +180,25 @@ Page({
delete orderInfo.orderCode delete orderInfo.orderCode
wx.$router.redirectTo('createOrder', orderInfo) wx.$router.redirectTo('createOrder', orderInfo)
}, },
// previewImage(e) {
// let { url } = e.currentTarget.dataset
// console.log(url)
// if (url.includes('http')) {
// wx.previewImage({
// urls: [url],
// current: url
// })
// } else {
// this.getWorkWechatLiveQRCode()
// }
// },
// imageLoad(params) {
// console.log('load', this.data.imgSrc)
// // this.setdata({})
// },
// imageError(params) {
// console.log('error', this.data.imgSrc)
// },
getWorkWechatLiveQRCode() { getWorkWechatLiveQRCode() {
this.setData({ this.setData({
customerService: '' customerService: ''
...@@ -186,7 +206,7 @@ Page({ ...@@ -186,7 +206,7 @@ Page({
// setTimeout(() => { // setTimeout(() => {
let { failCustomerService, defaultCustomerService } = this.data let { failCustomerService, defaultCustomerService } = this.data
let { orderCode, customerPhone: phoneNumber, selectPayType } = this.data.orderInfo let { orderCode, customerPhone: phoneNumber, selectPayType } = this.data.orderInfo
console.log(orderCode, phoneNumber, selectPayType) // console.log(orderCode, phoneNumber, selectPayType)
// 订单状态 1-升级订单 2-战败订单 // 订单状态 1-升级订单 2-战败订单
let orderType = selectPayType == 0 ? 2 : 1 let orderType = selectPayType == 0 ? 2 : 1
api api
...@@ -199,7 +219,7 @@ Page({ ...@@ -199,7 +219,7 @@ Page({
customerService: url customerService: url
}) })
} else { } else {
console.log(defaultCustomerService) // console.log(defaultCustomerService)
this.setData({ this.setData({
customerService: defaultCustomerService customerService: defaultCustomerService
}) })
......
...@@ -174,11 +174,18 @@ ...@@ -174,11 +174,18 @@
</view> </view>
<qr-box imgSrc="{{customerService}}" bindrefresh="getWorkWechatLiveQRCode" /> <qr-box imgSrc="{{customerService}}" bindrefresh="getWorkWechatLiveQRCode" />
<!-- <view class="qr-box"> <!-- <view class="qr-box">
<view class="loadingBox"> <view wx:if="{{!customerService}}" class="loader box-center" />
<view class="loader box-center" /> <image
</view> wx:else
<image bindtap="previewImage" data-url="{{customerService}}" src="{{customerService}}" /> class="qrImg"
</view> --> webp="{{true}}"
bindtap="previewImage"
binderror="imageError"
bindload="imageLoad"
data-url="{{customerService}}"
src="{{customerService}}"
/>
</view> -->
<view class="warranty-tips"> <view class="warranty-tips">
{{orderInfo.selectPayType==0? '建议让客户扫码关注客服号领取礼包' :'建议让客户扫码关注客服查询质保'}} {{orderInfo.selectPayType==0? '建议让客户扫码关注客服号领取礼包' :'建议让客户扫码关注客服查询质保'}}
</view> </view>
......
...@@ -196,10 +196,10 @@ border: 2px solid #FFFFFF; ...@@ -196,10 +196,10 @@ border: 2px solid #FFFFFF;
min-height: 160rpx; min-height: 160rpx;
margin-bottom: 14rpx; margin-bottom: 14rpx;
} }
.box .qr-box image { /* .box .qr-box image {
width: 160rpx; width: 160rpx;
height: 160rpx; height: 160rpx;
} } */
.box .qr-tips { .box .qr-tips {
font-size: 28rpx; font-size: 28rpx;
color: #888888; color: #888888;
...@@ -425,3 +425,47 @@ border: 2px solid #FFFFFF; ...@@ -425,3 +425,47 @@ border: 2px solid #FFFFFF;
color: #3582EE; color: #3582EE;
font-size: 28rpx; font-size: 28rpx;
} }
.qr-box {
display: flex;
justify-content: center;
align-items: center;
min-height: 160rpx;
margin-bottom: 14rpx;
}
.qr-box .qrImg {
width: 160rpx;
height: 160rpx;
display: inline-block;
}
.loadingBox {
width: 160rpx;
height: 160rpx;
position: relative;
}
.loader {
border-top:0.2em solid rgba(0,0,0,0.1);
border-right:0.2em solid rgba(0,0,0,0.1);
border-bottom:0.2em solid rgba(0,0,0,0.1);
border-left:0.2em solid #555;
transform:translateZ(0);
animation:loader 500ms infinite linear;
transition:all 500ms ease;
}
.loader,.loader:after {
border-radius:50%;
width:1.5em;
height:1.5em;
}
@keyframes loader {
0% {
-webkit-transform:rotate(0deg);
transform:rotate(0deg);
}
100% {
-webkit-transform:rotate(360deg);
transform:rotate(360deg);
}
}
\ No newline at end of file \ No newline at end of file
...@@ -11,13 +11,32 @@ Page({ ...@@ -11,13 +11,32 @@ Page({
showTips: true, showTips: true,
isYqdSuper: app.globalData.isYqdSuper, isYqdSuper: app.globalData.isYqdSuper,
customerService: '', customerService: '',
defaultCustomerService: 'https://img01.glsx.com.cn/group1/M00/21/01/wKgFHWKEkeSAZRltAAED5CfS91o118.png', defaultCustomerService: 'https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/kf.png',
failCustomerService: '../images/kfrefresh.png' failCustomerService: '../images/kfrefresh.png'
}, },
jumpUpdate() { jumpUpdate() {
let { orderInfo } = this.data let { orderInfo } = this.data
wx.$router.go('updateOrderInfo', orderInfo) wx.$router.go('updateOrderInfo', orderInfo)
}, },
// previewImage(e) {
// let { url } = e.currentTarget.dataset
// // console.log(url)
// if (url.includes('http')) {
// wx.previewImage({
// urls: [url],
// current: url
// })
// } else {
// this.getWorkWechatLiveQRCode()
// }
// },
// imageLoad(params) {
// console.log('load', this.data.imgSrc)
// // this.setdata({})
// },
// imageError(params) {
// console.log('error', this.data.imgSrc)
// },
confirmConstruction() { confirmConstruction() {
let { orderCode, orderInfo } = this.data let { orderCode, orderInfo } = this.data
let _this = this let _this = this
...@@ -100,7 +119,7 @@ Page({ ...@@ -100,7 +119,7 @@ Page({
isYqdSuper: app.globalData.isYqdSuper, isYqdSuper: app.globalData.isYqdSuper,
userInfo: o userInfo: o
}) })
console.log(this.data.isYqdSuper) // console.log(this.data.isYqdSuper)
}, },
getOrderDetail(orderCode) { getOrderDetail(orderCode) {
// console.log(orderCode) // console.log(orderCode)
...@@ -169,7 +188,7 @@ Page({ ...@@ -169,7 +188,7 @@ Page({
}, },
setQrBoxHeight() { setQrBoxHeight() {
wx.$util.getViewInfo('#qr-view', ({ height }) => { wx.$util.getViewInfo('#qr-view', ({ height }) => {
console.log(height) // console.log(height)
this.setData({ this.setData({
qrHeight: height, qrHeight: height,
qrFlag: true qrFlag: true
...@@ -219,20 +238,20 @@ Page({ ...@@ -219,20 +238,20 @@ Page({
// setTimeout(() => { // setTimeout(() => {
let { failCustomerService, defaultCustomerService } = this.data let { failCustomerService, defaultCustomerService } = this.data
let { orderCode, customerPhone: phoneNumber, selectPayType } = this.data.orderInfo let { orderCode, customerPhone: phoneNumber, selectPayType } = this.data.orderInfo
console.log(orderCode, phoneNumber, selectPayType) // console.log(orderCode, phoneNumber, selectPayType)
// 订单状态 1-升级订单 2-战败订单 // 订单状态 1-升级订单 2-战败订单
let orderType = selectPayType == 0 ? 2 : 1 let orderType = selectPayType == 0 ? 2 : 1
api api
.getWorkWechatLiveQRCode({ orderCode, phoneNumber, orderType }) .getWorkWechatLiveQRCode({ orderCode, phoneNumber, orderType })
.then(result => { .then(result => {
let { code, data: url, message } = result let { code, data: url, message } = result
console.log(url) // console.log(url)
if (code == 0) { if (code == 0) {
this.setData({ this.setData({
customerService: url customerService: url
}) })
} else { } else {
console.log(defaultCustomerService) // console.log(defaultCustomerService)
this.setData({ this.setData({
customerService: defaultCustomerService customerService: defaultCustomerService
}) })
......
...@@ -146,8 +146,18 @@ ...@@ -146,8 +146,18 @@
</view> </view>
<qr-box imgSrc="{{customerService}}" bindrefresh="getWorkWechatLiveQRCode" /> <qr-box imgSrc="{{customerService}}" bindrefresh="getWorkWechatLiveQRCode" />
<!-- <view class="qr-box"> <!-- <view class="qr-box">
<image bindtap="previewImage" data-url="{{customerService}}" src="{{customerService}}" /> <view wx:if="{{!customerService}}" class="loader box-center" />
</view> --> <image
wx:else
class="qrImg"
webp="{{true}}"
bindtap="previewImage"
binderror="imageError"
bindload="imageLoad"
data-url="{{customerService}}"
src="{{customerService}}"
/>
</view> -->
<view class="warranty-tips"> <view class="warranty-tips">
{{orderInfo.selectPayType==0? '建议让客户扫码关注客服号领取礼包' :'建议让客户扫码关注客服查询质保'}} {{orderInfo.selectPayType==0? '建议让客户扫码关注客服号领取礼包' :'建议让客户扫码关注客服查询质保'}}
</view> </view>
......
...@@ -420,3 +420,47 @@ page { ...@@ -420,3 +420,47 @@ page {
color: #3582EE; color: #3582EE;
font-size: 28rpx; font-size: 28rpx;
} }
.qr-box {
display: flex;
justify-content: center;
align-items: center;
min-height: 160rpx;
margin-bottom: 14rpx;
}
.qr-box .qrImg {
width: 160rpx;
height: 160rpx;
display: inline-block;
}
.loadingBox {
width: 160rpx;
height: 160rpx;
position: relative;
}
.loader {
border-top:0.2em solid rgba(0,0,0,0.1);
border-right:0.2em solid rgba(0,0,0,0.1);
border-bottom:0.2em solid rgba(0,0,0,0.1);
border-left:0.2em solid #555;
transform:translateZ(0);
animation:loader 500ms infinite linear;
transition:all 500ms ease;
}
.loader,.loader:after {
border-radius:50%;
width:1.5em;
height:1.5em;
}
@keyframes loader {
0% {
-webkit-transform:rotate(0deg);
transform:rotate(0deg);
}
100% {
-webkit-transform:rotate(360deg);
transform:rotate(360deg);
}
}
\ No newline at end of file \ No newline at end of file
...@@ -213,6 +213,7 @@ const isFullSucreen = isComponents => { ...@@ -213,6 +213,7 @@ const isFullSucreen = isComponents => {
// if (isComponents) val = screenHeight - windowHeight > 72 // if (isComponents) val = screenHeight - windowHeight > 72
if (isComponents) val = screenHeight - bottom > 0 if (isComponents) val = screenHeight - bottom > 0
}, },
fail(err) { fail(err) {
return false return false
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!