Commit 7e1ca638 by 张立顺

分包处理

1 parent dc9a3811
{ {
"pages": [ "pages": [
"pages/accountItems/accountItems",
"pages/nothing/nothing",
"pages/wxLogin/wxLogin",
"pages/webView/webView",
"tabIndex/pages/index/index", "tabIndex/pages/index/index",
"tabWorkOrder/pages/index/index", "tabWorkOrder/pages/index/index",
"tabWorkOrder/pages/createOrder/createOrder", "tabWorkOrder/pages/createOrder/createOrder",
...@@ -8,18 +12,12 @@ ...@@ -8,18 +12,12 @@
"tabWorkOrder/pages/constructionOrderDetail/constructionOrderDetail", "tabWorkOrder/pages/constructionOrderDetail/constructionOrderDetail",
"tabWorkOrder/pages/confirmOrder/confirmOrder", "tabWorkOrder/pages/confirmOrder/confirmOrder",
"tabWorkOrder/pages/updateOrderInfo/updateOrderInfo", "tabWorkOrder/pages/updateOrderInfo/updateOrderInfo",
"tabWorkOrder/pages/createArchives/createArchives",
"tabWorkOrder/pages/ocr/ocr",
"tabDate/pages/index/index", "tabDate/pages/index/index",
"tabDate/pages/detail/detail", "tabDate/pages/detail/detail",
"tabMine/pages/index/index", "tabMine/pages/index/index",
"pages/accountItems/accountItems", "test/pages/test"
"pages/nothing/nothing",
"pages/wxLogin/wxLogin",
"tabOperating/pages/index/index",
"tabOperating/pages/operatingShow/operatingShow",
"tabWorkOrder/pages/ocr/ocr",
"test/pages/test",
"tabWorkOrder/pages/createArchives/createArchives",
"tabOperating/pages/4sOverview/4sOverview"
], ],
"window": { "window": {
"backgroundTextStyle": "light", "backgroundTextStyle": "light",
...@@ -54,6 +52,13 @@ ...@@ -54,6 +52,13 @@
} }
] ]
}, },
"subpackages": [
{
"root": "tabOperating",
"name": "tabOperating",
"pages": ["pages/4sOverview/4sOverview", "pages/index/index", "pages/operatingShow/operatingShow"]
}
],
"usingComponents": { "usingComponents": {
"gl-textarea": "/components/GlTextarea/GlTextarea", "gl-textarea": "/components/GlTextarea/GlTextarea",
"gl-cell": "/components/GlCell/GlCell", "gl-cell": "/components/GlCell/GlCell",
......
// components/image/index.js
import { IMG_URL, IMG_VERSION } from '~/utils/constantData'
Component({
externalClasses: ['custom-class', 'class'],
/**
* 组件的属性列表
*/
properties: {
src: {
type: String,
value: '',
observer: function (url, o) {
if (url) {
let isWebp = url.includes('webp')
this.setData({
isWebp,
imagePath: `${IMG_URL}${url}?v=` + IMG_VERSION()
})
}
}
},
mode: {
type: String,
value: 'scaleToFill'
},
webp: {
type: Boolean,
value: false
}
},
/**
* 组件的初始数据
*/
data: {
imagePath: '',
isWebp: false
},
// 组件生命周期
lifetimes: {
// 在组件实例进入页面节点树时执行
// attached: function () {
// let src = this.data.src
// let prefix = IMG_URL
// this.setData({
// imagePath: `${prefix}${src}?v=` + IMG_VERSION()
// })
// },
// 在组件实例被从页面节点树移除时执行
detached: function () {}
},
/**
* 组件的方法列表
*/
methods: {}
})
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file \ No newline at end of file
/* components/image/index.wxss */
\ No newline at end of file \ No newline at end of file
<!-- components/image/index.wxml -->
<image
src="{{imagePath}}"
mode="{{mode}}"
webp="{{webp||isWebp}}"
lazy-load
class="custom-class class" />
// pages/webView/webView.js
Page({
/**
* 页面的初始数据
*/
data: {
flag: true
},
getParams(str) {
let params = str.split('?')
if (params.length < 2) return {}
let param = params[1].split('&')
let obj = {}
for (let i = 0; i < param.length; i++) {
let paramsA = param[i].split('=')
let key = paramsA[0]
let value = paramsA[1]
obj[key] = value
}
return obj
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
wx.$api.showLoading('加载中...')
let decodeUrl = decodeURIComponent(options.url)
let param = this.getParams(decodeUrl)
if (param.urlParam) {
let query = JSON.parse(param.urlParam)
this.refresh = query.refresh
}
console.log(decodeUrl)
this.setData({
url: decodeUrl
})
wx.hideLoading()
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
if (this.refresh) {
this.setData(
{
flag: true
},
() => {
this.setData({
url: this.data.url
})
}
)
}
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
if (this.refresh) {
this.setData({
flag: false
})
}
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
if (this.refresh) {
this.setData({
flag: false
})
}
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {}
})
{
"usingComponents": {}
}
\ No newline at end of file \ No newline at end of file
/* packagesList/webView/pages/webView.wxss */
\ No newline at end of file \ No newline at end of file
<!-- <web-view src="{{url}}"></web-view> -->
<block wx:if="{{flag}}">
<web-view src="{{url}}"></web-view>
</block>
\ No newline at end of file \ No newline at end of file
/* pages/webView/webView.wxss */
\ No newline at end of file \ No newline at end of file
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
"disablePlugins": [], "disablePlugins": [],
"outputPath": "" "outputPath": ""
}, },
"useIsolateContext": false, "useIsolateContext": true,
"userConfirmedBundleSwitch": false, "userConfirmedBundleSwitch": false,
"packNpmManually": false, "packNpmManually": false,
"packNpmRelationList": [], "packNpmRelationList": [],
......
...@@ -130,5 +130,5 @@ ...@@ -130,5 +130,5 @@
] ]
} }
}, },
"libVersion": "2.15.0" "libVersion": "2.28.1"
} }
\ No newline at end of file \ No newline at end of file
...@@ -13,7 +13,6 @@ export const checkYqdSuper = (globalData, userInfo) => { ...@@ -13,7 +13,6 @@ export const checkYqdSuper = (globalData, userInfo) => {
// app.globalData.isYqdSuper = userInfo.userType == 2 && !userInfo.isSuper && merchantAccountType // app.globalData.isYqdSuper = userInfo.userType == 2 && !userInfo.isSuper && merchantAccountType
globalData.isYqdSuper = userInfo.userType != 2 && !userInfo.isSuper && merchantAccountType globalData.isYqdSuper = userInfo.userType != 2 && !userInfo.isSuper && merchantAccountType
globalData.isStaff = userInfo.userType == 2 && !userInfo.isSuper && merchantAccountType globalData.isStaff = userInfo.userType == 2 && !userInfo.isSuper && merchantAccountType
globalData.isStaff = 'test'
} }
// 获取园区店信息 // 获取园区店信息
export const getYQInfo = userInfo => { export const getYQInfo = userInfo => {
......
...@@ -10,13 +10,11 @@ Page({ ...@@ -10,13 +10,11 @@ Page({
*/ */
data: { data: {
...mixins.data, ...mixins.data,
navBarHeight: 0,
totalTableSum: [ totalTableSum: [
{ {
name: 'filmTimesTotalSum' name: 'filmTimesTotalSum'
}, },
// {
// name: 'getTotalSum' //发券总数
// },
{ {
name: 'usedTotalSum' name: 'usedTotalSum'
}, },
...@@ -53,7 +51,6 @@ Page({ ...@@ -53,7 +51,6 @@ Page({
type: 2, type: 2,
typeText: '补录订单' typeText: '补录订单'
} }
// tableWidth: 606 + 28
}, },
tipsEvent() { tipsEvent() {
this.setData({ this.setData({
...@@ -81,7 +78,7 @@ Page({ ...@@ -81,7 +78,7 @@ Page({
api api
.updateCouponDayReport(methodUpdateInfo) .updateCouponDayReport(methodUpdateInfo)
.then(result => { .then(result => {
console.log(result) // console.log(result)
if (result.code == 0) { if (result.code == 0) {
methodUpdateInfo.value = '' methodUpdateInfo.value = ''
this.setData({ this.setData({
...@@ -102,13 +99,8 @@ Page({ ...@@ -102,13 +99,8 @@ Page({
changeTableData(e) { changeTableData(e) {
let { startDate, maxDate, isYqdSuper } = this.data let { startDate, maxDate, isYqdSuper } = this.data
let { merchantId, filmTimes, merchantName } = e.currentTarget.dataset.item let { merchantId, filmTimes, merchantName } = e.currentTarget.dataset.item
// UpdateInfo
// console.log(e.currentTarget.dataset)
// console.log(item)
// 不是管理员不开启这个权限 // 不是管理员不开启这个权限
if (!isYqdSuper) return if (!isYqdSuper) return
if (startDate != maxDate) { if (startDate != maxDate) {
return wx.showToast({ return wx.showToast({
title: '只能修改当天数据', title: '只能修改当天数据',
...@@ -119,21 +111,20 @@ Page({ ...@@ -119,21 +111,20 @@ Page({
let methodUpdateInfo = { let methodUpdateInfo = {
merchantId, merchantId,
merchantName, merchantName,
// filmTimes == 0 ? '' :
filmTimes: filmTimes, filmTimes: filmTimes,
startDate: maxDate, startDate: maxDate,
endDate: maxDate endDate: maxDate
} }
// return
this.setData({ this.setData({
showRemark: true, showRemark: true,
methodUpdateInfo methodUpdateInfo
}) })
// console.log('changeTableData')
}, },
navbarReady(e) { navbarReady(e) {
// console.log(e, 'e')
let navBarHeight = e.detail.height let navBarHeight = e.detail.height
// console.log(e.detail.height)
this.setData({ this.setData({
navBarHeight navBarHeight
}) })
...@@ -169,40 +160,6 @@ Page({ ...@@ -169,40 +160,6 @@ Page({
// 判断是不是门店员工 // 判断是不是门店员工
if (userInfo.merchantType && !userInfo.isSuper && type == 2) { if (userInfo.merchantType && !userInfo.isSuper && type == 2) {
wx.$router.go(item.url) wx.$router.go(item.url)
// if () {
// // if (item.url) {
// // if (type == 2) {
// // wx.$router.go(item.url)
// // } else {
// // wx.$util.showNoAccess()
// // }
// // }
// // if (item.wxCallBack) {
// // wx[item.wxCallBack]({
// // success(res) {
// // let { result } = res
// // wx.$router.go('tabWorkOrder.createOrder', {
// // scene: result
// // })
// // },
// // fail(err) {
// // this.showToast(err)
// // }
// // })
// // }
// } else {
// console.log('item.url', item.url)
// // if (item.url) {
// // if (item.url != 'tabWorkOrder.createOrder') {
// if (!['tabWorkOrder.createOrder', 'tabWorkOrder.createArchives'].includes(item.url)) {
// return wx.$router.go(item.url)
// } else {
// wx.$util.showNoAccess()
// }
// // } else {
// // wx.$util.showNoAccess()
// // }
// }
} else { } else {
// item.url != 'tabWorkOrder.createOrder' // item.url != 'tabWorkOrder.createOrder'
if (!['tabWorkOrder.createOrder', 'tabWorkOrder.createArchives'].includes(item.url)) { if (!['tabWorkOrder.createOrder', 'tabWorkOrder.createArchives'].includes(item.url)) {
...@@ -282,30 +239,7 @@ Page({ ...@@ -282,30 +239,7 @@ Page({
table table
}) })
}, },
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
// console.log(app.globalData.isStaff )
if (options.supplement) {
this.setData({
showOrderpop: true
})
}
let today = new Date()
let startDate = today.format('yyyy-MM-dd')
let endDate = today.format('yyyy-MM-dd')
this.setData({
maxDate: new Date().format('yyyy-MM-dd'),
startDate,
endDate
})
// console.log(app.globalData.isYqdSuper)
this.setData({
isStaff: app.globalData.isStaff
})
// this.getWaitOrder()
},
setTime() { setTime() {
let _this = this let _this = this
time = setTimeout(() => { time = setTimeout(() => {
...@@ -315,17 +249,13 @@ Page({ ...@@ -315,17 +249,13 @@ Page({
}, },
// 10s轮询一次待补录 // 10s轮询一次待补录
getWaitOrder() { getWaitOrder() {
// console.log('waitorder')
let { isStaff } = this.data let { isStaff } = this.data
// console.log('isStaff', isStaff)
isStaff && isStaff &&
api api
.waitinputorder() .waitinputorder()
.then(result => { .then(result => {
// console.log(result) // console.log(result)
let { code, data } = result let { code, data } = result
// console.log(this.setTime)
// console.log(result.data.waitInputCount)
this.setTime() this.setTime()
if (code == 0) { if (code == 0) {
this.setData({ this.setData({
...@@ -335,19 +265,7 @@ Page({ ...@@ -335,19 +265,7 @@ Page({
}) })
.catch(err => {}) .catch(err => {})
}, },
init(userInfo) {
// app.
getYQInfo(userInfo)
.then(result => {
console.log(result)
// console.log(app.globalData.isYqdSuper)
this.setData({
...result
})
})
.catch(err => {})
this.getPageData()
},
getPageData() { getPageData() {
api.getHomeReport().then(res => { api.getHomeReport().then(res => {
wx.$util.hideLoading() wx.$util.hideLoading()
...@@ -369,9 +287,6 @@ Page({ ...@@ -369,9 +287,6 @@ Page({
getMerchantCouponList() { getMerchantCouponList() {
let { orderByTypeEnum, tableSort, tableObj, startDate, endDate, totalTableSum, tableWidth } = this.data let { orderByTypeEnum, tableSort, tableObj, startDate, endDate, totalTableSum, tableWidth } = this.data
let target = tableObj[tableSort].sort let target = tableObj[tableSort].sort
// console.log(target)
// console.log(orderByTypeEnum[target])
// console.log(orderByTypeEnum[target][tableSort])
let orderByType = orderByTypeEnum[target][tableSort] let orderByType = orderByTypeEnum[target][tableSort]
api api
.getMerchantCouponList({ .getMerchantCouponList({
...@@ -388,12 +303,8 @@ Page({ ...@@ -388,12 +303,8 @@ Page({
let sumWidth = 0 let sumWidth = 0
totalTableSum.forEach((element, index) => { totalTableSum.forEach((element, index) => {
element.total = data[element.name] || 0 element.total = data[element.name] || 0
// customerUnitMoneySum
let sumList = ['orderMoneyTotalSum', 'customerUnitMoneySum'] let sumList = ['orderMoneyTotalSum', 'customerUnitMoneySum']
if (sumList.includes(element.name)) { if (sumList.includes(element.name)) {
// debugger
// element.total = 12344566778
// console.log(element.total)
let length = element.total.toString().length let length = element.total.toString().length
// console.log(length) // console.log(length)
let labelWidth = length > 5 ? length * 20 : 118 let labelWidth = length > 5 ? length * 20 : 118
...@@ -403,10 +314,8 @@ Page({ ...@@ -403,10 +314,8 @@ Page({
sumWidth = sumWidth + labelWidth sumWidth = sumWidth + labelWidth
} }
}) })
// console.log(sumWidth)
tableWidth = 118 * 5 + 232 + 30 + sumWidth
// 处理列表宽度问题 // 处理列表宽度问题
tableWidth = 118 * 5 + 232 + 30 + sumWidth
this.setData({ this.setData({
tableFlag: true, tableFlag: true,
...@@ -414,7 +323,6 @@ Page({ ...@@ -414,7 +323,6 @@ Page({
totalTableSum, totalTableSum,
tableWidth, tableWidth,
tableObj tableObj
// totalTableAverage
}) })
} else { } else {
this.showToast(message) this.showToast(message)
...@@ -428,18 +336,50 @@ Page({ ...@@ -428,18 +336,50 @@ Page({
}) })
} }
}, },
init(userInfo) {
getYQInfo(userInfo)
.then(result => {
// console.log(result)
// console.log(app.globalData.isYqdSuper)
this.setData({
...result
})
})
.catch(err => {})
this.getPageData()
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
// console.log(app.globalData.isStaff)
if (options.supplement) {
this.setData({
showOrderpop: true
})
}
let today = new Date()
let startDate = today.format('yyyy-MM-dd')
let endDate = today.format('yyyy-MM-dd')
this.setData({
maxDate: new Date().format('yyyy-MM-dd'),
startDate,
endDate
})
// console.log(app.globalData.isYqdSuper)
this.setData({
isStaff: app.globalData.isStaff
})
},
/** /**
* 生命周期函数--监听页面初次渲染完成 * 生命周期函数--监听页面初次渲染完成
*/ */
onReady: function () { onReady: function () {
// debugger
const accountInfo = wx.getAccountInfoSync() const accountInfo = wx.getAccountInfoSync()
let checklist = [] let checklist = []
switch (accountInfo.miniProgram.envVersion) { switch (accountInfo.miniProgram.envVersion) {
case 'develop': case 'develop':
// checklist = ['15816539334']
checklist = [] checklist = []
// this.globalData.url = 'http://192.168.0.252:3000/api'; //
break break
case 'trial': case 'trial':
// index = manual ? index : 2 // index = manual ? index : 2
......
{ {
"navigationStyle":"custom" "navigationStyle":"custom"
} }
\ No newline at end of file \ No newline at end of file
<view class="layout {{flag?'opacity':''}}"> <view class="layout {{flag?'opacity':''}}">
<navigation-bar bindnavbarReady="navbarReady"> <navigation-bar bindnavbarReady="navbarReady">
<picker <picker range="{{merchantRange}}" value="{{subIndex}}" range-key="merchantName" bindchange="changePicker" bindtap="tapPicker" bindcancel="tapPicker" disabled="{{merchantRange.length < 2}}">
range="{{merchantRange}}"
value="{{subIndex}}"
range-key="merchantName"
bindchange="changePicker"
bindtap="tapPicker"
bindcancel="tapPicker"
disabled="{{merchantRange.length < 2}}">
<view class="navigation-title"> <view class="navigation-title">
<view class="navigation-title-text text-hide"> <view class="navigation-title-text text-hide">
{{merchantRange[subIndex].merchantName}} {{merchantRange[subIndex].merchantName}}
...@@ -22,11 +15,7 @@ ...@@ -22,11 +15,7 @@
<view class="main {{waitInputCount?'mtTips':''}}" style="margin-top:{{navBarHeight}}px"> <view class="main {{waitInputCount?'mtTips':''}}" style="margin-top:{{navBarHeight}}px">
<div class="menu"> <div class="menu">
<block wx:for="{{menu}}" wx:key="index"> <block wx:for="{{menu}}" wx:key="index">
<view <view class="item" bindtap="jump" data-item="{{item}}" data-type="{{userInfo.userType}}">
class="item"
bindtap="jump"
data-item="{{item}}"
data-type="{{userInfo.userType}}">
<image src="../../images/icon-{{index}}.png" /> <image src="../../images/icon-{{index}}.png" />
{{item.name}} {{item.name}}
</view> </view>
...@@ -59,16 +48,7 @@ ...@@ -59,16 +48,7 @@
<view class="table-control-btn"> <view class="table-control-btn">
<block wx:for="{{tableBtn}}" wx:key="index"> <block wx:for="{{tableBtn}}" wx:key="index">
<block wx:if="{{item.type == 'date'}}"> <block wx:if="{{item.type == 'date'}}">
<calendar <calendar allowSameDay shortcut bindselect='rangeSelect' rangeAll dateType='range' calenderColor='#3582EE' vertical minDate="2020-10-01" maxDate="{{maxDate}}">
allowSameDay
shortcut
bindselect='rangeSelect'
rangeAll
dateType='range'
calenderColor='#3582EE'
vertical
minDate="2020-10-01"
maxDate="{{maxDate}}">
<view class="{{item.active?'active':''}} table-control-btn-view"> <view class="{{item.active?'active':''}} table-control-btn-view">
{{item.text}} {{item.text}}
</view> </view>
...@@ -83,24 +63,14 @@ ...@@ -83,24 +63,14 @@
</view> </view>
</view> </view>
<!-- class="table" --> <!-- class="table" -->
<ScrollView <ScrollView scroll-x scroll-y show-scrollbar="{{false}}" bindscrolltolower="handleScrollToLower" class="table">
scroll-x
scroll-y
show-scrollbar="{{false}}"
bindscrolltolower="handleScrollToLower"
class="table">
<view class="table-box"> <view class="table-box">
<!-- top:{{navBarHeight}}px; --> <!-- top:{{navBarHeight}}px; -->
<view class="table-header" style=" width:{{tableWidth}}rpx"> <view class="table-header" style=" width:{{tableWidth}}rpx">
<view class="label">合作门店</view> <view class="label">合作门店</view>
<view class="values"> <view class="values">
<block wx:for="{{tableObj}}" wx:key="index"> <block wx:for="{{tableObj}}" wx:key="index">
<view <view class="value {{tableSort == index?'active':''}}" style="width: {{item.width}};" bindtap="changeTableSort" id="header-{{index}}" data-index="{{index}}">
class="value {{tableSort == index?'active':''}}"
style="width: {{item.width}};"
bindtap="changeTableSort"
id="header-{{index}}"
data-index="{{index}}">
<view class="lable "> <view class="lable ">
<view class="name">{{item.name}}{{item.unit}}</view> <view class="name">{{item.name}}{{item.unit}}</view>
<!-- <view class="unit">{{item.unit}}</view> --> <!-- <view class="unit">{{item.unit}}</view> -->
...@@ -116,11 +86,7 @@ ...@@ -116,11 +86,7 @@
<view class="table-total " style="width:{{tableWidth}}rpx"> <view class="table-total " style="width:{{tableWidth}}rpx">
<view class="totalLabel average">累计</view> <view class="totalLabel average">累计</view>
<view class="values"> <view class="values">
<block <block wx:for="{{totalTableSum}}" wx:for-index="index" wx:key="index" wx:for-item="item">
wx:for="{{totalTableSum}}"
wx:for-index="index"
wx:key="index"
wx:for-item="item">
<!-- font-size:{{item.total>9999&&item.total<10000000?'20rpx':''}}; --> <!-- font-size:{{item.total>9999&&item.total<10000000?'20rpx':''}}; -->
<view class="th" style="width:{{tableObj[index]['width']}};"> <view class="th" style="width:{{tableObj[index]['width']}};">
<!-- {{item.total?item.total:'0'}} --> <!-- {{item.total?item.total:'0'}} -->
...@@ -159,19 +125,11 @@ ...@@ -159,19 +125,11 @@
</view> </view>
</view> </view>
<view class="values"> <view class="values">
<block <block wx:for="{{tableObj}}" wx:key="ind" wx:for-item="i" wx:for-index="ind">
wx:for="{{tableObj}}"
wx:key="ind"
wx:for-item="i"
wx:for-index="ind">
<!-- font-size:{{item[i.key]>9999&&item[i.key]<10000000?'20rpx':''}}; ind==4||ind==5? '124rpx':'100rpx' --> <!-- font-size:{{item[i.key]>9999&&item[i.key]<10000000?'20rpx':''}}; ind==4||ind==5? '124rpx':'100rpx' -->
<view class="td text-center" style="width: {{tableObj[ind]['width']}};"> <view class="td text-center" style="width: {{tableObj[ind]['width']}};">
<block wx:if="{{i.key == 'filmTimes'}}"> <block wx:if="{{i.key == 'filmTimes'}}">
<view <view class="text-center" style="width:100%;height: 100%;color:{{isYqdSuper?'#3582EE':'#333333'}}" data-item="{{item}}" bindtap="changeTableData">
class="text-center"
style="width:100%;height: 100%;color:{{isYqdSuper?'#3582EE':'#333333'}}"
data-item="{{item}}"
bindtap="changeTableData">
{{item[i.key] || 0}} {{item[i.key] || 0}}
</view> </view>
</block> </block>
...@@ -239,22 +197,5 @@ ...@@ -239,22 +197,5 @@
<tips-bottom style="width: 100%;box-sizing: border-box;" tipsProps="{{tipsProps}}" /> <tips-bottom style="width: 100%;box-sizing: border-box;" tipsProps="{{tipsProps}}" />
</view> </view>
</view> </view>
<remark-popup <remark-popup wx:if="{{showRemark}}" show="{{showRemark}}" isLimitNum="{{false}}" title="{{'修改贴膜台次'}}" btnName="{{'确认'}}" bind:confirm="remarkConfirm" placeholder="{{'请输入整数'}}" maxlength="4" value="{{methodUpdateInfo.filmTimes}}" isInt="{{true}}" />
wx:if="{{showRemark}}" <order-switchPopup bind:close="closeSwitchPopup" bind:success="navigator" title="{{'请选择支付订单号'}}" wx:if="{{showOrderpop}}" flag="{{showOrderpop}}" />
show="{{showRemark}}"
isLimitNum="{{false}}"
title="{{'修改贴膜台次'}}"
btnName="{{'确认'}}"
bind:confirm="remarkConfirm"
placeholder="{{'请输入整数'}}"
maxlength="4"
value="{{methodUpdateInfo.filmTimes}}"
isInt="{{true}}" />
<order-switchPopup
bind:close="closeSwitchPopup"
bind:success="navigator"
title="{{'请选择支付订单号'}}"
wx:if="{{showOrderpop}}"
flag="{{showOrderpop}}" />
<!-- value="{{1}}" -->
\ No newline at end of file \ No newline at end of file
// tabWorkOrder/pages/createOrder/createOrder.js // tabWorkOrder/pages/createOrder/createOrder.js
import deepClone from '~/utils/deepClone' // import deepClone from '~/utils/deepClone'
import api from '../../api' import api from '../../api'
import { getYQorderInfo } from '~/store/index' import { getYQorderInfo } from '~/store/index'
const app = getApp() const app = getApp()
...@@ -711,7 +711,7 @@ Page({ ...@@ -711,7 +711,7 @@ Page({
this.setData({ this.setData({
// requiredList: [...new Set(requiredList)], // requiredList: [...new Set(requiredList)],
// phoneShow: merchantSettingInfo.yqPhoneConfig // phoneShow: merchantSettingInfo.yqPhoneConfig
phoneShow: deepClone(merchantSettingInfo.yqPhoneConfig) phoneShow: wx.$util.deepClone(merchantSettingInfo.yqPhoneConfig)
}) })
// this.setData({ merchantSettingInfo }) // this.setData({ merchantSettingInfo })
}) })
......
// tabWorkOrder/pages/createArchives/createArchives.js // tabWorkOrder/pages/createArchives/createArchives.js
// tabWorkOrder/pages/createOrder/createOrder.js // tabWorkOrder/pages/createOrder/createOrder.js
import deepClone from '~/utils/deepClone' // import deepClone from '~/utils/deepClone'
import api from '../../api' import api from '../../api'
import { getYQorderInfo } from '~/store/index' import { getYQorderInfo } from '~/store/index'
const app = getApp() const app = getApp()
...@@ -416,7 +416,7 @@ Page({ ...@@ -416,7 +416,7 @@ Page({
this.setData({ this.setData({
isStandNo, isStandNo,
// phoneShow: merchantSettingInfo.yqPhoneConfig // phoneShow: merchantSettingInfo.yqPhoneConfig
phoneShow: deepClone(merchantSettingInfo.yqPhoneConfig) phoneShow: wx.$util.deepClone(merchantSettingInfo.yqPhoneConfig)
}) })
// this.setData({ merchantSettingInfo }) // this.setData({ merchantSettingInfo })
}) })
......
// tabWorkOrder/pages/createOrder/createOrder.js // tabWorkOrder/pages/createOrder/createOrder.js
import deepClone from '~/utils/deepClone' // import deepClone from '~/utils/deepClone'
import api from '../../api' import api from '../../api'
import { getYQorderInfo } from '~/store/index' import { getYQorderInfo } from '~/store/index'
const app = getApp() const app = getApp()
...@@ -611,7 +611,7 @@ Page({ ...@@ -611,7 +611,7 @@ Page({
// console.log(deepClone(merchantSettingInfo.yqPhoneConfig), 'deepClone(merchantSettingInfo.yqPhoneConfig)') // console.log(deepClone(merchantSettingInfo.yqPhoneConfig), 'deepClone(merchantSettingInfo.yqPhoneConfig)')
this.setData({ this.setData({
requiredList: [...new Set(requiredList)], requiredList: [...new Set(requiredList)],
phoneShow: deepClone(merchantSettingInfo.yqPhoneConfig) phoneShow: wx.$util.deepClone(merchantSettingInfo.yqPhoneConfig)
}) })
// this.setData({ merchantSettingInfo }) // this.setData({ merchantSettingInfo })
}) })
......
// tabWorkOrder/pages/createOrder/createOrder.js // tabWorkOrder/pages/createOrder/createOrder.js
import deepClone from '~/utils/deepClone' // import deepClone from '~/utils/deepClone'
import api from '../../api' import api from '../../api'
import { getYQorderInfo } from '~/store/index' import { getYQorderInfo } from '~/store/index'
let toastList = { let toastList = {
...@@ -242,7 +242,7 @@ Page({ ...@@ -242,7 +242,7 @@ Page({
getYQorderInfo() getYQorderInfo()
.then(merchantSettingInfo => { .then(merchantSettingInfo => {
this.setData({ this.setData({
phoneShow: deepClone(merchantSettingInfo.yqPhoneConfig) phoneShow: wx.$util.deepClone(merchantSettingInfo.yqPhoneConfig)
}) })
// this.setData({ merchantSettingInfo }) // this.setData({ merchantSettingInfo })
}) })
......
...@@ -13,18 +13,13 @@ export function getUserInfo() { ...@@ -13,18 +13,13 @@ export function getUserInfo() {
return $Storage.get('userInfo') return $Storage.get('userInfo')
} }
export function setUserInfo(data) { export function setUserInfo(data) {
console.log(data) // console.log(data)
$Storage.set('userInfo', data) $Storage.set('userInfo', data)
} }
export function removeSystemStorage() { export function removeSystemStorage() {
// $Storage.rm('srcm_shopmall_user_info') // $Storage.rm('srcm_shopmall_user_info')
// $Storage.rm('scrm_shopmall_sessionId') // $Storage.rm('scrm_shopmall_sessionId')
// $Storage.rm('guest_no') // $Storage.rm('guest_no')
// $Storage.rm('equity_info')
// $Storage.rm('packageList')
// $Storage.rm('isVIP')
// $Storage.rm('bizjiaUrl')
// $Storage.rm('vip_card_info')
} }
export function setStorageSync(key, data) { export function setStorageSync(key, data) {
$Storage.set(key, JSON.stringify(data)) $Storage.set(key, JSON.stringify(data))
......
/**
* 深克隆 所有原型链上的对象和属性
* 例: const bar=deepClone(foo)
* console.log(bar===foo) false
* @param {*} obj
*/
const deepClone = obj => {
const clone = require('rfdc')({ proto: false, circles: false })
return clone(obj)
}
// const deepClone = obj => {
// if (typeof obj !== 'object') {
// return obj
// }
// if (Array.isArray(obj)) {
// return deepCloneArray(obj)
// } else {
// return deepCloneObj(obj)
// }
// }
// const deepCloneArray = arr => {
// // function deepCloneArray(arr) {
// const target = []
// arr.forEach(it => {
// if (typeof it === 'object') {
// target.push(deepClone(it))
// } else {
// target.push(it)
// }
// })
// return target
// }
// const deepCloneObj = target => {
// const map = new WeakMap()
// function isObject(target) {
// return (typeof target === 'object' && target) || typeof target === 'function'
// }
// function clone(data) {
// if (!isObject(data)) {
// return data
// }
// if ([Date, RegExp].includes(data.constructor)) {
// return new data.constructor(data)
// }
// // 会在生产环境的clone props对象报错 导致报错 弃用
// if (typeof data === 'function') {
// return new Function('return ' + data.toString())()
// }
// const exist = map.get(data)
// if (exist) {
// return exist
// }
// const keys = Reflect.ownKeys(data)
// const allDesc = Object.getOwnPropertyDescriptors(data)
// const result = Object.create(Object.getPrototypeOf(data), allDesc)
// map.set(data, result)
// keys.forEach(key => {
// const val = data[key]
// if (isObject(val)) {
// result[key] = clone(val)
// } else {
// result[key] = val
// }
// })
// return result
// }
// return clone(target)
// }
export default deepClone
...@@ -14,7 +14,7 @@ const systemInfo = wx.getSystemInfoSync() ...@@ -14,7 +14,7 @@ const systemInfo = wx.getSystemInfoSync()
const manual = false const manual = false
const release = false const release = false
let index = 3 let index = 2
// 判断小程序环境 // 判断小程序环境
// develop:开发版(正常开发工具,测试时) // develop:开发版(正常开发工具,测试时)
......
...@@ -88,16 +88,6 @@ const getUserInfo = () => { ...@@ -88,16 +88,6 @@ const getUserInfo = () => {
let user = wx.getStorageSync('dj_boutique_user_info') || null let user = wx.getStorageSync('dj_boutique_user_info') || null
return JSON.parse(user) return JSON.parse(user)
} }
const setSellerInfo = sellerInfo => {
wx.setStorageSync('dj_boutique_seller_info', JSON.stringify(sellerInfo))
}
const getSellerInfo = () => {
let sellerInfo = wx.getStorageSync('dj_boutique_seller_info') || null
return JSON.parse(sellerInfo)
}
const removeSellerInfo = () => {
wx.removeStorageSync('dj_boutique_seller_info')
}
const setUserInfo = userInfo => { const setUserInfo = userInfo => {
wx.setStorageSync('dj_boutique_user_info', JSON.stringify(userInfo)) wx.setStorageSync('dj_boutique_user_info', JSON.stringify(userInfo))
} }
...@@ -111,8 +101,8 @@ const setSessionId = sessionId => { ...@@ -111,8 +101,8 @@ const setSessionId = sessionId => {
const removeStorage = () => { const removeStorage = () => {
wx.removeStorageSync('dj_boutique_user_info') wx.removeStorageSync('dj_boutique_user_info')
wx.removeStorageSync('dj_boutique_sessionId') wx.removeStorageSync('dj_boutique_sessionId')
// wx.removeStorageSync('dj_boutique_seller_info')
} }
const showNoAccess = () => { const showNoAccess = () => {
showToast('您的账号无法完成此操作') showToast('您的账号无法完成此操作')
} }
...@@ -153,7 +143,16 @@ var type = function (data) { ...@@ -153,7 +143,16 @@ var type = function (data) {
.toLowerCase() .toLowerCase()
return dataType return dataType
} }
/**
* 深克隆 所有原型链上的对象和属性
* 例: const bar=deepClone(foo)
* console.log(bar===foo) false
* @param {*} obj
*/
const deepClone = obj => {
const clone = require('rfdc')({ proto: false, circles: false })
return clone(obj)
}
const util = { const util = {
onReachBottom, onReachBottom,
haveEmoji, haveEmoji,
...@@ -164,15 +163,13 @@ const util = { ...@@ -164,15 +163,13 @@ const util = {
setUserInfo, setUserInfo,
getSessionId, getSessionId,
setSessionId, setSessionId,
setSellerInfo,
getSellerInfo,
removeSellerInfo,
removeStorage, removeStorage,
showNoAccess, showNoAccess,
setStorageSync, setStorageSync,
getStorageSync, getStorageSync,
getSceneId, getSceneId,
type type,
deepClone
} }
const Util = Object.assign(util, wxApi, format) const Util = Object.assign(util, wxApi, format)
// console.log('Util', Util) // console.log('Util', Util)
......
...@@ -160,9 +160,9 @@ export function handleCopy(url) { ...@@ -160,9 +160,9 @@ export function handleCopy(url) {
const getViewInfo = (name, callBack, isComponents) => { const getViewInfo = (name, callBack, isComponents) => {
const query = !isComponents ? wx.createSelectorQuery() : wx.createSelectorQuery().in(isComponents) const query = !isComponents ? wx.createSelectorQuery() : wx.createSelectorQuery().in(isComponents)
query query
.selectAll(name) .select(name)
.boundingClientRect(res => { .boundingClientRect(res => {
console.log('res: ', res) // console.log('res: ', res)
callBack(res) callBack(res)
}) })
.exec() .exec()
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!