Commit af6cdeeb by 前端

Merge branch 'develop' into 'master'

Develop

See merge request !13
2 parents c5fd6a26 8bcd8e76
......@@ -119,5 +119,13 @@ module.exports = {
data.inputStatus = 0
// data.payType = 1
return api.post('dj.api.smartcarlife.weapp.waitinputorder.page', data)
},
/** 获取转化员上一笔订单的销售顾问 */
getLastUserOrderInfo(data) {
return api.post('dj.api.smartcarlife.order.getLastUser', data)
},
// 获取订单信息
getWorkList(data) {
return api.post('dj.api.smartcarlife.order.search', data)
}
}
......@@ -64,7 +64,8 @@ const secretKey_items = {
}
const domain_items = {
// ip: 'http://192.168.2.59:8292',
ip: 'http://192.168.1.129:8392',
// ip: 'http://192.168.1.129:8392',
ip: 'http://192.168.1.129:8292',
// ip: 'http://192.168.2.3:8292',
dev: 'https://dj.dev.glsx.com.cn',
uat: 'https://dj.test.glsx.com.cn',
......
import {
secretKey,
domain,
path,
sign,
} from './http.js'
import { secretKey, domain, path, sign } from './http.js'
import util from '../utils/util.js'
/**接口 */
class Request {
......@@ -18,9 +13,12 @@ class Request {
return new Promise((resolve, reject) => {
wx.showNavigationBarLoading()
if (!data) data = {}
let header = RequestMethods === 'POST' ? {
'content-type': 'application/x-www-form-urlencoded'
} : {}
let header =
RequestMethods === 'POST'
? {
'content-type': 'application/x-www-form-urlencoded'
}
: {}
data = _this.getData(data, method, noSignAttr)
wx.request({
url: `${domain}${path}?method=${method}`,
......@@ -32,11 +30,19 @@ class Request {
success(response) {
/**业务代码 */
let {
data: {
code
},
data: { code, message },
data
} = response
// let thisPage = wx.$router.getPageInstance()
// // console.log(thisPage, 'thisPage')
// let { route, data: pageData } = thisPage
// if (pageData.shareQuery) {
// wx.$util.setStorageSync('shareQuery', {
// route,
// shareQuery: pageData.shareQuery
// })
// }
if (code == 20 || code == 21) {
wx.hideLoading()
wx.showModal({
......@@ -51,6 +57,12 @@ class Request {
}
}
})
} else if (code == -1) {
wx.showToast({
title: message || '网络请求失败',
icon: 'none'
})
resolve(data)
} else {
resolve(data)
}
......@@ -79,16 +91,16 @@ class Request {
let sessionId = util.getSessionId()
if (sessionId) data['sessionId'] = sessionId
data['v'] = '1.0.0'
data['method'] = method;
data['format'] = 'json';
data['locale'] = 'zh_CN';
data['source'] = 'dj-wechat';
data['appKey'] = secretKey.appKey;
data['method'] = method
data['format'] = 'json'
data['locale'] = 'zh_CN'
data['source'] = 'dj-wechat'
data['appKey'] = secretKey.appKey
let obj = sign(data, secretKey.secret, noSignAttr)
//data['sign'] = obj.sign;
return obj
}
}
export default new Request()
\ No newline at end of file
export default new Request()
......@@ -5,14 +5,12 @@ import util from './utils/util.js'
import api from './api/api.js'
import * as Sentry from './utils/sentry-miniapp.wx.min'
// 先屏蔽不上sentry功能
// import * as Sentry from 'sentry-miniapp'
const accountInfo = wx.getAccountInfoSync()
// console.log(Sentry)
// 初始化 Sentry 生产环境再开启
// console.log('Sentry',Sentry);
accountInfo.miniProgram.envVersion == 'release' &&
Sentry.init({
// dsn: 'http://ebcf31c417cc4ce185782f046e4a87a2@sentry.glsx.com.cn/5'
dsn: 'https://ddaadc52bf8d4ecc92eca632683d456a@sentry.glsx.com.cn/23'
})
App({
......@@ -25,8 +23,6 @@ App({
wx.$modal = this.showModal
let userInfo = util.getStorageSync('dj_boutique_user_info')
userInfo && this.checkYqdSuper(userInfo)
// this.getYQorderInfo() //初始化园区店配置
},
showModal(that, options) {
that.selectComponent('#modal').showModal(options)
......@@ -35,7 +31,6 @@ App({
* 下载小程序新版本并重启应用
*/
autoUpdate: function () {
// console.log(new Date())
const self = this
// 获取小程序更新机制兼容
if (wx.canIUse('getUpdateManager')) {
......@@ -54,24 +49,6 @@ App({
if (res.confirm) {
//3. 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
updateManager.applyUpdate()
} else if (res.cancel) {
//如果需要强制更新,则给出二次弹窗,如果不需要,则这里的代码都可以删掉了
// wx.showModal({
// title: '温馨提示~',
// content: '本次版本更新涉及到新的功能添加,旧版本无法正常访问的哦~',
// success: function (res) {
// self.autoUpdate()
// return;
// //第二次提示后,强制更新
// if (res.confirm) {
// // 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
// updateManager.applyUpdate()
// } else if (res.cancel) {
// //重新回到版本更新提示
// self.autoUpdate()
// }
// }
// })
}
}
})
......@@ -97,11 +74,11 @@ App({
onShow(options) {
let that = this
this.autoUpdate()
console.log(options)
// console.log(options)
wx.onMemoryWarning(function () {
console.log('onMemoryWarningReceive')
})
if (options.query.scene) wx.$SCENE = options
// wx.onMemoryWarning(function () {
// console.log('onMemoryWarningReceive')
// })
let systemInfo = util.getStorageSync('dj_boutique_system_info')
wx.getSystemInfo({
success(res) {
......@@ -110,6 +87,30 @@ App({
}
}
})
let { query } = options
// 判断对象是否满足任意一个key
// console.log(query, ' query')
if (query && (query.scene || query.merchantId || query.type)) {
// 需要满
if (query.merchantId) {
// &&options.patch == 'tabIndex/pages/index/index'
let userInfo = util.getStorageSync('dj_boutique_user_info')
// 需要当前门店的 不是就重新登录
if (userInfo?.subLoginUser?.merchantId != query.merchantId) {
wx.$SCENE = null
return this.login(true)
}
options.patch = 'pages/index/index'
}
if (query.type) {
options.patch = 'tabWorkOrder/pages/createOrder/createOrder'
}
// tabIndex/pages/index/index?supplement=true
wx.$SCENE = options
}
console.log(wx.$SCENE, ' wx.$SCENE')
// if (options.query.scene)
},
login(relogin) {
if (relogin) {
......@@ -120,12 +121,12 @@ App({
util.removeStorage()
wx.$relogin = relogin
}
let userInfo = util.getUserInfo()
let sessionId = util.getSessionId()
if (sessionId && userInfo) {
// util.setWebSocket()
return
}
// let userInfo = util.getUserInfo()
// let sessionId = util.getSessionId()
// if (sessionId && userInfo) {
// // util.setWebSocket()
// return
// }
router.reLaunch('pages.wxLogin')
},
// 获取设备信息
......@@ -152,19 +153,6 @@ App({
// this.globalData.isYqdSuper = userInfo.userType == 2 && !userInfo.isSuper && merchantAccountType
this.globalData.isYqdSuper = userInfo.userType != 2 && !userInfo.isSuper && merchantAccountType
this.globalData.isStaff = userInfo.userType == 2 && !userInfo.isSuper && merchantAccountType
// console.log(this.globalData.isYqdSuper)
// checkSeverType
// console.log(userInfo)
// let {
// yqdInfo: { merchantRange }
// } = this.globalData
// console.log(merchantRange)
// console.log(subIndex)
// let flag = userInfo.userType != 2 || userInfo.isSuper
// let flag2 = userInfo.subLoginUser.merchantId != userInfo.merchantId || merchantRange.length == 1
// console.log(this.globalData.isYqdSuper)
// this.globalData.isYqdSuper = flag && flag2
//先模拟测试
// this.globalData.serverType = !this.globalData.serverType
// console.log('serverType', this.globalData.serverType)
......@@ -234,13 +222,13 @@ App({
return new Promise((resolve, reject) => {
// console.log(this.globalData.YQorderSetting, 'this.globalData.YQorderSetting')
// 如果有 直接返回
console.log(this.globalData.YQorderSetting, 'this.globalData.YQorderSetting')
// console.log(this.globalData.YQorderSetting, 'this.globalData.YQorderSetting')
// debugger
if (this.globalData.YQorderSetting) {
return resolve(this.globalData.YQorderSetting)
} else {
// this. yqdInfo
let userInfo = util.getUserInfo()
if (!userInfo) this.login(true)
let { merchantId, merchantName } = userInfo.subLoginUser
// console.log(this.globalData)
......@@ -255,11 +243,10 @@ App({
if (code == 0) {
// 过滤园区店是否需要屏蔽手机号选项
let filterYqPhoneConfig = JSON.parse(data.yqPhoneConfig)
console.log(filterYqPhoneConfig)
// console.log(filterYqPhoneConfig)
data.yqPhoneConfig = filterYqPhoneConfig.find(item => item.yqMerchantId == merchantId)?.shopMerchantPhoneList || false
//
console.log(data)
// console.log(data)
this.globalData.YQorderSetting = data
// this.checkSeverType(userInfo)
resolve(this.globalData.YQorderSetting)
......@@ -274,11 +261,9 @@ App({
globalData: {
// loginUserInfo: {},
systemInfo: {},
// 头部导航栏的高度
statusBarHeight: wx.getSystemInfoSync()['statusBarHeight'],
statusBarHeight: wx.getSystemInfoSync()['statusBarHeight'], // 头部导航栏的高度
bottomLift: 0,
yqdInfo: {},
// serverType: false
isYqdSuper: true,
isStaff: false,
YQorderSetting: ''
......
......@@ -90,11 +90,11 @@ Component({
let carData = JSON.stringify(car.data)
let size = carData.length * 2
// const arrp = ['bytes', 'KB', 'MB', 'GB', 'TB']
console.log(size / 1000000)
// console.log(size / 1000000)
let sliceLength = size / 1000000
const carDateLength = Math.ceil(sliceLength)
console.log(carDateLength)
// console.log(carDateLength)
let list = []
// carDateLength.map(index => {
// 缓存到本地
......
// components/CarBrands/CarBrands.js
import api from '../../api/api.js'
let isNum, num, y, time
Component({
/**
* 组件的属性列表
*/
properties: {
show: {
type: Boolean,
observer: function (n) {
let { isFirst } = this.data
if (n && isFirst) {
this.init()
this.setData({
isFirst: false
})
}
}
}
},
/**
* 组件的初始数据
*/
data: {
orderInfo: {},
// storageData: null,
customerList: [],
isFirst: true
},
pageLifetimes: {
show: function () {},
hide: function () {}
},
/**
* 组件的方法列表
*/
methods: {
init(keyword) {
// console.log('getBrandList')
// console.log(storageData)
let params = {
pageSize: 999999,
pageNum: 1,
// upgradeFinishFlag: 'R',
statusList: [1],
// ...data
keyword
}
let customerList = []
api.getWorkList(params).then(res => {
// console.log(res)
// this.setCar(res.data, changeMerchantId)
// console.log(res)
let { data, code } = res
if (code == 0 && data?.list.length) {
data.list = data.list.map(item => {
if (item.customer && item.customer.carSeriesName) {
item.carType = `${item.customer.carBrand || ''}-${item.customer.carChildsBrandName || ''}-${item.customer.carSeriesName || ''}`
}
return item
})
customerList = data.list
}
this.setData({
customerList
})
})
},
searchCar(e) {
let { value } = e.detail
this.init(value)
},
choose(e) {
let { item, index } = e.currentTarget.dataset
console.log(item, index)
let { customerList } = this.data
customerList = customerList.map(item => {
item.active = false
return item
})
customerList[index].active = true
let orderInfo = item
orderInfo.orderSource = 4
// delete orderInfo.orderCode
// 去除掉错误订单对应的关联码
// delete orderInfo.associateOrderCode
// 'orderCode',
let deleteList = ['associateOrderCode', 'merchantDistributionList', 'expenseCategoryList', 'profitAllocatinList']
for (var i = 0; i < deleteList.length; i++) {
// console.log(arr[i])
delete orderInfo[deleteList[i]]
}
this.setData({
customerList,
orderInfo
})
},
confirm() {
let { orderInfo, customerList } = this.data
let flag = customerList.some(item => {
return item.active
})
if (!flag) {
return wx.$util.showToast('请选择客户')
}
this.triggerEvent('confirm', orderInfo)
this.setData({
show: false
})
}
}
})
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
<popup
title="选择客户"
show="{{show}}"
bindconfirm="confirm"
height="90%">
<view class="car-brands-box">
<search-input bindsearch="searchCar" />
<view class="car-brands">
<view class="label title y-center">
<span class="labelName">姓名</span>
<span class="labelPhone">| 手机号</span>
</view>
<scroll-view style="height: calc(100% - 44px)" scroll-y scroll-into-view="{{letter}}">
<block wx:if="{{customerList.length > 0}}">
<!-- <block wx:for="{{customerList}}" wx:key="index"> -->
<!-- <view> -->
<!-- <view cla></view> -->
<view class="box">
<block
wx:for="{{customerList}}"
wx:for-item="item"
wx:key="ind"
wx:for-index="ind">
<view
class="list y-center child {{item.active?'active':''}}"
data-item="{{item}}"
data-index="{{ind}}"
catchtap="choose">
<span class="name text-hide">{{item.customer.customerName}}</span>
<span class="carType " wx:if="{{item.carType.length}}">
<view>(</view>
<view class="text-hide cartypeLabel">{{item.carType}}</view>
<view>)</view>
</span>
<span class="phone">{{item.customer.customerPhone}}</span>
<!-- {{c.name}} {{c.active?'active':''}} {{c.isTitle?'title':''}} -->
<view class="icon">
<image src="../images/choose.png" />
</view>
</view>
<!-- data-index="{{index}}"
data-ind="{{ind}}"
data-cind="{{cind}}"
data-item="{{i}}"
data-that="{{c}}" -->
<!-- <view
class="brands"
catchtap="showChilds"
data-index='{{index}}'
data-ind='{{ind}}'>
<view class="list y-center">{{i.name}}</view> -->
<!-- <block wx:if="{{i.active}}"> -->
<!-- <block
wx:for='{{i.childs_list}}'
wx:key="cind"
wx:for-item='c'
wx:for-index='cind'>
</block> -->
<!-- </block> -->
<!-- </view> -->
</block>
</view>
<!-- </view> -->
<!-- </block> -->
</block>
<block wx:if="{{ brandList.length <= 0}}">
<view class="nothing">暂无数据</view>
</block>
<!-- merchantId && -->
<!-- <block wx:if="{{!merchantId}}">
<view class="nothing">请先选择流量来源</view>
</block> -->
</scroll-view>
<!-- <view class="side-bar" id="side-bar">
<block wx:for="{{brandList}}" wx:key="index">
<view
data-letter="{{item.letter}}"
class="view {{item.active?'active':''}}"
capture-catch:touchstart="start"
id="letter-{{item.letter}}"
data-index="{{index}}"
capture-catch:touchmove="move"
capture-catch:touchend="end">
{{item.letter}}
</view>
</block>
</view> -->
<!-- 提示 -->
<view class='tips' hidden='{{!showTip}}'>{{letter}}</view>
</view>
</view>
</popup>
/* components/CarBrands/CarBrands.wxss */
.car-brands-box {
width: calc(100% + 64rpx);
height: 100%;
margin-left: -32rpx;
}
.car-brands {
height: calc(100% - 104rpx);
position: relative;
/* display: flex; */
}
.label {
padding-left: 32rpx;
line-height: 88rpx;
}
.labelName {
font-size: 16px;
color: #333333;
padding-right: 20rpx;
}
.text-hide {
/* display: inline-block; */
/* width: 200rpx; */
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
/* line-height: 37rpx; */
}
.labelPhone {
font-size: 12px;
color: #999999;
}
.y-center {
display: flex;
align-items: center;
}
.list {
box-sizing: border-box;
height: 88rpx;
/* padding-left: 32rpx; */
margin: 0 32rpx 0 92rpx;
font-weight: 700;
border-top: 2rpx solid #EBEDF0;
}
.list .name {
/* flex: 4; */
max-width: 150rpx;
}
.list .carType {
/* flex: 10; */
display: flex;
align-items: center;
margin-left: 15px;
max-width: 300rpx;
}
.cartypeLabel {
flex: 1;
}
.list .phone {
/* flex: 5; */
margin-left: auto;
}
.child {
font-weight: normal;
/* padding-left: 96rpx; */
font-size: 28rpx;
/* color: #888888; */
position: relative;
color: #333333;
}
.child.active {
color: #3582ee;
}
.child.title {
color: #282829;
padding-left: 64rpx;
/* color: #3582ee; */
}
.child .icon {
display: none;
width: 32rpx;
height: 32rpx;
position: absolute;
top: 50%;
left: -46rpx;
transform: translateY(-50%);
}
.child.active .icon {
display: block;
}
@keyframes show-side-bar {
0% {
opacity: 0;
right: -100%;
}
100% {
opacity: 1;
right: 0;
}
}
.tips {
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 140rpx;
height: 140rpx;
border-radius: 50%;
color: #fff;
background: rgba(153, 153, 153, 0.7);
z-index: 9999;
font-size: 60rpx;
font-weight: bold;
display: flex;
align-items: center;
justify-content: center;
}
.nothing {
padding: 100rpx;
text-align: center;
color: #999;
}
\ No newline at end of file
......@@ -3,8 +3,12 @@
<view class='cell-label' style="width:{{labelWidth}};{{labelStyle}}" bindtap="titleClick">
<text wx:if='{{required&&requiredBefore}}' class='required'>*</text>
{{label||'标题'}}
<image class="titleIcon" wx:if="{{iconSrc}}" src="{{iconSrc}}" />
<text wx:if='{{required&&requiredAfter}}' class='required'>*</text>
<image
webp
class="titleIcon"
wx:if="{{iconSrc}}"
src="{{iconSrc}}" />
</view>
<view class='cell-value ' style="width:calc(100% - {{labelWidth}});">
<view class='value {{valueAlign}} {{haveArrow}}'>
......
......@@ -30,6 +30,7 @@
.titleIcon {
width: 34rpx;
height: 34rpx;
margin-left: 10rpx;
}
.cell-value {
......
var replaceItemText = function (item) {
// console.log(item)
return item.replace(';~;', ' ')
var reg = getRegExp(';~;', 'g')
return item.replace(reg, ' ')
}
/*
......
......@@ -69,15 +69,17 @@ Page({
// console.log(data.loginUserInfoList[0])
app.checkYqdSuper(data.loginUserInfoList[0])
const SCENE = wx.$SCENE
console.log(SCENE)
// debugger
if (SCENE) {
let {
path,
query: { scene }
query
// : { scene }
} = SCENE
let { target, name } = wx.$util.getSceneId(path)
wx.$router.reLaunch(`${target}.${name}`, {
scene
})
console.log(query)
wx.$router.reLaunch(`${target}.${name}`, query)
wx.$SCENE = null
} else {
wx.$router.reLaunch('tabIndex.index')
......
......@@ -23,7 +23,8 @@
{
"name": "新增工单",
"pathName": "tabWorkOrder/pages/createOrder/createOrder",
"query": "",
"query": "type=supplement",
"launchMode": "default",
"scene": null
},
{
......@@ -80,7 +81,8 @@
{
"name": "首页",
"pathName": "/tabIndex/pages/index/index",
"query": "",
"query": "merchantId=44209886",
"launchMode": "default",
"scene": null
},
{
......
......@@ -103,7 +103,7 @@ class Router {
this[_query] = events || {}
const [_parent, _name] = route.split('.')
let name = route
let parent = this.getPageInstance().__route__.split('/')[0]
let parent = this.getPageInstance()?.__route__.split('/')[0]
let query = ''
if (route.includes('?')) {
let [_name_, _query_] = route.split('?')
......
......@@ -73,49 +73,10 @@ Page({
...e.detail
})
},
touchstart(e) {
// let _this = this
// wx.$util.getViewInfo(
// '#header-0',
// res => {
// console.log(res)
// // wx.$util.getViewInfo(
// // '#side-bar',
// // _res => {
// // _this.setData({
// // letterHeight: res.height,
// // toTop: res.height + _res.top,
// // height: _res.bottom
// // })
// // },
// // _this
// // )
// },
// _this
// )
// console.log(e.changedTouches[0].clientX)
// console.log(e.changedTouches[0].clientY)
// startX: e.changedTouches[0].clientX,
// startY: e.changedTouches[0].clientY,
},
touchmove() {},
touchE() {},
remarkConfirm(e) {
let { methodUpdateInfo } = this.data
let { detail: filmTimes } = e
// let params ={filmTimes}
// if (methodUpdateInfo.filmTimes > filmTimes) {
// return wx.showToast({
// title: '修改值不可低于原数值',
// icon: 'none'
// })
// } else {
methodUpdateInfo.filmTimes = filmTimes
// }
// let params = Object.assign(methodUpdateInfo, filmTimes)
// console.log(methodUpdateInfo)
// return
api
.updateCouponDayReport(methodUpdateInfo)
.then(result => {
......@@ -203,61 +164,55 @@ Page({
},
jump(e) {
let { item, type } = e.currentTarget.dataset
// console.log(item)
// return
// debugger
let { userInfo } = this.data
if (userInfo.merchantType && !userInfo.isSuper) {
if (type == 2) {
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 {
if (item.url) {
// if (item.url != 'tabWorkOrder.createOrder') {
if (!['tabWorkOrder.createOrder', 'tabWorkOrder.createArchives'].includes(item.url)) {
wx.$router.go(item.url)
return
} else {
wx.$util.showNoAccess()
}
} else {
wx.$util.showNoAccess()
}
}
// 判断是不是门店员工
if (userInfo.merchantType && !userInfo.isSuper && type == 2) {
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 {
if (item.url) {
// item.url != 'tabWorkOrder.createOrder'
if (!['tabWorkOrder.createOrder', 'tabWorkOrder.createArchives'].includes(item.url)) {
wx.$router.go(item.url)
return
} else {
wx.$util.showNoAccess()
}
// item.url != 'tabWorkOrder.createOrder'
if (!['tabWorkOrder.createOrder', 'tabWorkOrder.createArchives'].includes(item.url)) {
return wx.$router.go(item.url)
} else {
wx.$util.showNoAccess()
}
}
},
changeDate(e) {
console.log(e)
// console.log(e)
let today = new Date()
let startDate = today.format('yyyy-MM-dd')
let endDate = today.format('yyyy-MM-dd')
......@@ -270,7 +225,7 @@ Page({
this.getMerchantCouponList()
},
rangeSelect(e) {
console.log(e)
// console.log(e)
let { tableBtn } = this.data
let {
date: { start, end }
......@@ -330,6 +285,12 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
// console.log(options)
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')
......@@ -342,13 +303,11 @@ Page({
this.setData({
isStaff: app.globalData.isStaff
})
// this.getWaitOrder()
},
setTime() {
let _this = this
time = setTimeout(() => {
// console.log(111)
// console.log(_this.getWaitOrder)
_this.getWaitOrder()
}, 10 * 1000)
......@@ -366,7 +325,6 @@ Page({
let { code, data } = result
// console.log(this.setTime)
// console.log(result.data.waitInputCount)
// 先取消
this.setTime()
if (code == 0) {
this.setData({
......@@ -387,53 +345,6 @@ Page({
})
})
.catch(err => {})
// console.log(!userInfo.isSuper && userInfo.merchantType && userInfo.userType == 2)
// if (!userInfo.isSuper && userInfo.merchantType && userInfo.userType == 2) {
// this.setData({
// merchantRange: [
// {
// merchantName: userInfo.merchantName
// }
// // 测试用 后面要取消
// // {
// // merchantName: '全部'
// // }
// ]
// })
// return
// }
// let all = {
// merchantName: '全部'
// }
// api.getYQList().then(res => {
// console.log(res)
// let { code, data } = res
// if (code == 0) {
// let subIndex = 0
// let arr = []
// if (data.length > 1) {
// if (userInfo.merchantId != userInfo.subLoginUser.merchantId) {
// data.map((e, index) => {
// if (e.merchantId == userInfo.subLoginUser.merchantId) subIndex = index + 1
// })
// }
// arr = [all, ...data]
// } else {
// arr = [
// {
// merchantName: userInfo.merchantName
// }
// ]
// }
// this.setData({
// merchantRange: arr,
// subIndex
// })
// }
// })
this.getPageData()
},
getPageData() {
......@@ -442,9 +353,6 @@ Page({
console.log(res)
let { code, data, message } = res
if (code == 0) {
// Object.keys(data).map(key => {
// if (key == 'upgradeMoneyTotal') data[key] = wx.$util.setPrice(data[key])
// })
this.setData({
report: data
})
......@@ -512,6 +420,13 @@ Page({
}
})
},
onRoute(options) {
if (options.supplement) {
this.setData({
showOrderpop: true
})
}
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
......@@ -520,18 +435,10 @@ Page({
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
// '加载中...'
// api
// .queryPayOrderStatus({ outTradeNo: '0120220709547257827237044224' })
// .then(result => {
// console.log(result)
// })
// .catch(err => {})
onShow: function (options) {
console.log(options, 'options')
let userInfo = wx.$util.getUserInfo()
// console.log(userInfo)
// console.log(app.globalData)
// 如果是员工 开启订单补录轮询
this.getWaitOrder()
if (userInfo) {
......@@ -541,11 +448,8 @@ Page({
let isChangeLogin = newUserInfo.subLoginUser.merchantId != userInfo.subLoginUser.merchantId
isChangeLogin && this.init(userInfo)
}
// else {
// this.getPageData()
// }
} else {
console.log('首页登录')
// console.log('首页登录')
getApp().login(true)
}
},
......
......@@ -86,9 +86,6 @@
<ScrollView
scroll-x
scroll-y
bindtouchstart="touchstart"
bindtouchmove="touchmove"
bindtouchend="touchE"
show-scrollbar="{{false}}"
bindscrolltolower="handleScrollToLower"
class="table">
......@@ -238,9 +235,9 @@
<view class="label">该门店产生异常订单,请点击补录!</view>
<view class="btn" bindtap="showOrderPop">补录订单</view>
</view> -->
<view class="waitOrderCon" wx:if="{{waitInputCount}}">
<tips-bottom style="width: 100%;box-sizing: border-box;" tipsProps="{{tipsProps}}"></tips-bottom>
</view>
<view class="waitOrderCon" wx:if="{{waitInputCount}}">
<tips-bottom style="width: 100%;box-sizing: border-box;" tipsProps="{{tipsProps}}" />
</view>
</view>
<remark-popup
wx:if="{{showRemark}}"
......
......@@ -105,6 +105,11 @@ var formatCoupon = function (params) {
return data[0]
}
var replaceItemText = function (item) {
var reg = getRegExp(';~;', 'g')
return item.replace(reg, ' ')
}
/*
* 导出
*/
......@@ -118,5 +123,6 @@ module.exports = {
dateFormatMonth: dateFormatMonth,
rateFormatAbs: rateFormatAbs,
toDecimal2: toDecimal2,
formatCoupon: formatCoupon
formatCoupon: formatCoupon,
replaceItemText: replaceItemText
}
......@@ -88,7 +88,7 @@
wx:for-item='subOrdersItem'
wx:for-index='subOrdersIndex'>
<view class="goodsItem">
<view class="name oneText">{{subOrdersItem.upgradeGoodsName}}</view>
<view class="name oneText">{{filter.replaceItemText(subOrdersItem.upgradeGoodsName)}}</view>
<view class="price">¥{{filter.toDecimal2 (subOrdersItem.totalPrice)}}</view>
</view>
</block>
......
var isIncludesItem = function (list, item) {
//
// console.log(list.indexOf(item))
// var flag = list.indexOf(item)
return list.indexOf(item) != -1
}
/*
* 导出
*/
module.exports = {
isIncludesItem: isIncludesItem
}
var replaceItemText = function (item) {
var reg = getRegExp(';~;', 'g')
return item.replace(reg, ' ')
}
var isIncludesItem = function (list, item) {
//
// console.log(list.indexOf(item))
// var flag = list.indexOf(item)
return list.indexOf(item) != -1
}
/*
* 导出
*/
module.exports = {
replaceItemText: replaceItemText,
isIncludesItem: isIncludesItem
}
......@@ -18,9 +18,11 @@ Page({
*/
data: {
scanIcon: 'https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/ocrIcon.png',
selectIcon: 'https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/selectIncon.webp',
name: 'createdOrder',
phoneShow: false,
flag: true,
customerInfoBox: false,
// canOrder: true, // 是否能下单和保存 判断商户配置财务规则
payTypeList: [
{
......@@ -63,6 +65,16 @@ Page({
priceSpread: '',
showTips: true
},
showCustomPop() {
this.setData({
customerInfoBox: true
})
},
chooseCustomerInfo(e) {
let { detail } = e
// this.onRoute(detail)
this.setOrderObj(detail)
},
closeTips() {
this.setData({
showTips: false
......@@ -729,6 +741,7 @@ Page({
// wx.$util.showLoading()
// }, 2000)
},
onRoute(res) {
// debugger
let { outTradeNo, totalFee, accountDate } = res
......
......@@ -4,6 +4,7 @@
"car-brands": "/components/CarBrands/CarBrands",
"merchant-seles": "/components/Merchant-Seles/Merchant-Seles",
"coupon": "/components/Coupon/Coupon",
"goods": "/components/Goods/Goods"
"goods": "/components/Goods/Goods",
"customerInfo": "/components/CustomerInfo/CustomerInfo"
}
}
<!-- 确认付款页面 -->
<wxs src="../../index.wxs" module="filter" />
<block wx:if="{{flag}}">
<view class="main {{isFullSucreen&&!userInfo.isSuper && userInfo.userType == 2?'isFullSucreen':''}}">
<view class="status-box">
......@@ -32,7 +33,7 @@
<view class="goods">
<block wx:for="{{orderInfo.subOrderList}}" wx:key="index">
<view class="item">
<view class="name text-hide">{{item.upgradeGoodsName || ''}}</view>
<view class="name text-hide">{{filter.replaceItemText(item.upgradeGoodsName) || ''}}</view>
<view class="type">x{{item.number}}</view>
<view class="price">¥{{item.price}}</view>
</view>
......
......@@ -17,7 +17,7 @@ Page({
// defaultCustomerService: 'https://img01.glsx.com.cn/group1/M00/21/01/wKgFHWKEkeSAZRltAAED5CfS91o118.png',
failCustomerService: '../images/kfrefresh.png',
showTip: false,
warrantyCardVisible:true,
warrantyCardVisible: true
},
// 跳转正确订单
redirectOrder() {
......@@ -243,17 +243,17 @@ Page({
}, 500 * index)
})
},
getServiceBaseInfo(merchantId){
api.getServiceBaseInfo({merchantId}) .then((result) => {
console.log(result,'result');
let {data,code} =result
console.log(data);
if (data.cardCodeFlag&&data.cardCodeFlag==1) {
this.setData({
warrantyCardVisible:false
})
}
})
getServiceBaseInfo(merchantId) {
api.getServiceBaseInfo({ merchantId }).then(result => {
console.log(result, 'result')
let { data, code } = result
console.log(data)
if (data.cardCodeFlag && data.cardCodeFlag == 1) {
this.setData({
warrantyCardVisible: false
})
}
})
},
setQrBoxHeight() {
const { orderInfo } = this.data
......@@ -301,10 +301,16 @@ api.getServiceBaseInfo({merchantId}) .then((result) => {
keepGoing(type) {
let { orderInfo } = this.data
orderInfo.orderSource = type
delete orderInfo.orderCode
// delete orderInfo.orderCode
// 去除掉错误订单对应的关联码
delete orderInfo.associateOrderCode
// delete orderInfo.associateOrderCode
let deleteList = ['orderCode', 'associateOrderCode', 'merchantDistributionList', 'expenseCategoryList', 'profitAllocatinList']
for (var i = 0; i < deleteList.length; i++) {
// console.log(arr[i])
delete orderInfo[deleteList[i]]
}
wx.$router.redirectTo('createOrder', orderInfo)
// merchantDistributionList,expenseCategoryList,profitAllocatinList
},
// previewImage(e) {
// let { url } = e.currentTarget.dataset
......
<!-- 完成施工页面 -->
<!-- <wxs src="/utils/index.wxs" module="common" /> -->
<wxs src="../../index.wxs" module="filter" />
<block wx:if="{{flag}}">
<view class="main {{isFullSucreen?'isFullSucreen':''}}">
<view class="status-box">
......@@ -36,7 +37,7 @@
<view class="goods">
<block wx:for="{{orderInfo.subOrderList}}" wx:key="index">
<view class="item">
<view class="name text-hide">{{item.upgradeGoodsName || ''}}</view>
<view class="name text-hide">{{filter.replaceItemText(item.upgradeGoodsName) || ''}}</view>
<view class="type">x{{item.number}}</view>
<view class="price">¥{{item.price}}</view>
</view>
......@@ -179,7 +180,7 @@
<view class="warranty-box">
<block wx:for="{{warrantyCardList}}" wx:key="index">
<view class="warranty-card">
<view class="name text-hide">{{item.goodsName}}</view>
<view class="name text-hide">{{filter.replaceItemText(item.goodsName)}}</view>
<view class="value">
质保期
<text>{{item.warrantyPeriod}}年</text>
......
......@@ -4,6 +4,7 @@
"car-brands": "/components/CarBrands/CarBrands",
"merchant-seles": "/components/Merchant-Seles/Merchant-Seles",
"coupon": "/components/Coupon/Coupon",
"goods": "/components/Goods/Goods"
"goods": "/components/Goods/Goods",
"customerInfo": "/components/CustomerInfo/CustomerInfo"
}
}
......@@ -6,8 +6,8 @@ var isIncludesItem = function (list, item) {
}
var replaceItemText = function (item) {
// console.log(item)
return item.replace(';~;', ' ')
var reg = getRegExp(';~;', 'g')
return item.replace(reg, ' ')
}
/*
......
......@@ -322,13 +322,17 @@ Page({
pageNum,
...searchObj
}
if (tabIndex != 0) {
// 待跟进状态需要特殊处理避免带出已关闭
if ([2, 3].includes(tabIndex)) {
let target = {
1: 'R',
2: 'Y',
3: 'N'
}
obj.upgradeFinishFlag = target[tabIndex]
} else if (tabIndex == 1) {
obj.statusList = [1]
}
// console.log(obj.sourceList && obj.statusList[0] == 'Y')
......
<wxs src="../../index.wxs" module="filter" />
<navigation-bar bindnavbarReady="navbarReady" showBack="{{show_confirm}}" bindback="back">
{{!show_confirm?'工单列表':'筛选'}}
</navigation-bar>
......@@ -89,7 +90,7 @@
wx:for-item="i"
wx:for-index="sindex">
<view class="goods" wx:if="{{sindex < 2}}">
<view class="goods-name text-hide">{{i.upgradeGoodsName || ''}}</view>
<view class="goods-name text-hide">{{filter.replaceItemText(i.upgradeGoodsName) || ''}}</view>
<view class="goods-price">
¥
<text>{{i.totalPrice || 0}}</text>
......
<!-- 确认施工 -->
<wxs src="../../index.wxs" module="filter" />
<block wx:if="{{flag}}">
<view class="main {{isFullSucreen?'isFullSucreen':''}}">
<view class="status-box" wx:if="{{orderInfo.status!=10}}">
......@@ -26,7 +27,7 @@
<view class="goods">
<block wx:for="{{orderInfo.subOrderList}}" wx:key="index">
<view class="item">
<view class="name text-hide">{{item.upgradeGoodsName || ''}}</view>
<view class="name text-hide">{{filter.replaceItemText(item.upgradeGoodsName) || ''}}</view>
<view class="type">x{{item.number}}</view>
<view class="price">¥{{item.price}}</view>
</view>
......@@ -141,7 +142,7 @@
<view class="warranty-box">
<block wx:for="{{warrantyCardList}}" wx:key="index">
<view class="warranty-card">
<view class="name text-hide">{{item.goodsName}}</view>
<view class="name text-hide">{{filter.replaceItemText(item.goodsName)}}</view>
<view class="value">
质保期
<text>{{item.warrantyPeriod}}年</text>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!