Commit c5712709 by 张立顺

Merge branch 'develop' into 'master'

Develop

See merge request !31
2 parents a3323d72 8c9ee9f1
...@@ -33,7 +33,7 @@ class Request { ...@@ -33,7 +33,7 @@ class Request {
data: { code, message }, data: { code, message },
data data
} = response } = response
// let thisPage = wx.$router.getPageInstance()
// // console.log(thisPage, 'thisPage') // // console.log(thisPage, 'thisPage')
// let { route, data: pageData } = thisPage // let { route, data: pageData } = thisPage
// if (pageData.shareQuery) { // if (pageData.shareQuery) {
...@@ -44,19 +44,23 @@ class Request { ...@@ -44,19 +44,23 @@ class Request {
// } // }
if (code == 20 || code == 21) { if (code == 20 || code == 21) {
let thisPage = wx.$router.getPageInstance()
// console.log(thisPage);
wx.hideLoading() wx.hideLoading()
wx.showModal({ if (thisPage.route != 'pages/wxLogin/wxLogin') {
title: '温馨提示', wx.showModal({
content: '登录过期,请重新登录。', title: '温馨提示',
showCancel: false, content: '登录过期,请重新登录。',
confirmText: '去登录', showCancel: false,
confirmColor: '#3582EE', confirmText: '去登录',
success(res) { confirmColor: '#3582EE',
if (res.confirm) { success(res) {
getApp().login(true) if (res.confirm) {
getApp().login(true)
}
} }
} })
}) }
} else if (code == -1) { } else if (code == -1) {
wx.showToast({ wx.showToast({
title: message || '网络请求失败', title: message || '网络请求失败',
......
...@@ -3,16 +3,12 @@ import request from './api/request.js' ...@@ -3,16 +3,12 @@ import request from './api/request.js'
import router from './router/index.js' 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'
import * as Sentry from './utils/sentry-miniapp.wx.min' // 初始化sentry
// 先屏蔽不上sentry功能 import sentryInit from '~/utils/sentryConfig/sentryInit'
const accountInfo = wx.getAccountInfoSync() sentryInit()
// console.log(Sentry) // 判断小程序是否需要更新
// 初始化 Sentry 生产环境再开启 import getUpdateManager from './utils/lib/wxUpdateManager'
// console.log('Sentry',Sentry);
accountInfo.miniProgram.envVersion == 'release' &&
Sentry.init({
dsn: 'https://ddaadc52bf8d4ecc92eca632683d456a@sentry.glsx.com.cn/23'
})
App({ App({
onLaunch() { onLaunch() {
/**挂载到wx对象 */ /**挂载到wx对象 */
...@@ -27,58 +23,12 @@ App({ ...@@ -27,58 +23,12 @@ App({
showModal(that, options) { showModal(that, options) {
that.selectComponent('#modal').showModal(options) that.selectComponent('#modal').showModal(options)
}, },
/**
* 下载小程序新版本并重启应用
*/
autoUpdate: function () {
const self = this
// 获取小程序更新机制兼容
if (wx.canIUse('getUpdateManager')) {
const updateManager = wx.getUpdateManager()
//1. 检查小程序是否有新版本发布
updateManager.onCheckForUpdate(function (res) {
// 请求完新版本信息的回调
if (res.hasUpdate) {
//2. 小程序有新版本,则静默下载新版本,做好更新准备
updateManager.onUpdateReady(function () {
console.log(new Date())
wx.showModal({
title: '更新提示',
content: '新版本已经准备好,是否重启应用?',
success: function (res) {
if (res.confirm) {
//3. 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
updateManager.applyUpdate()
}
}
})
})
updateManager.onUpdateFailed(function () {
// 新的版本下载失败
wx.showModal({
title: '已经有新版本了哟~',
content: '新版本已经上线啦~,请您删除当前小程序,重新搜索打开哟~'
})
})
}
})
} else {
// 如果希望用户在最新版本的客户端上体验您的小程序,可以这样子提示
wx.showModal({
title: '提示',
content: '当前微信版本过低,无法使用该功能,请升级到最新微信版本后重试。'
})
}
},
onShow(options) { onShow(options) {
let that = this let that = this
this.autoUpdate() getUpdateManager()
console.log(options)
// console.log(options) // console.log(options)
// wx.onMemoryWarning(function () {
// console.log('onMemoryWarningReceive')
// })
let systemInfo = util.getStorageSync('dj_boutique_system_info') let systemInfo = util.getStorageSync('dj_boutique_system_info')
wx.getSystemInfo({ wx.getSystemInfo({
success(res) { success(res) {
...@@ -87,29 +37,43 @@ App({ ...@@ -87,29 +37,43 @@ App({
} }
} }
}) })
let { query } = options let { query } = options
// 判断对象是否满足任意一个key // 判断对象是否满足任意一个key
// console.log(query, ' query') // console.log(query, ' query')
if (query && (query.scene || query.merchantId || query.type)) { wx.$SCENE = null // 解决不是外部跳转进来的问题, 重置
// 需要满 if (query && (query.supplementId || query.merchantId || query.type)) {
if (query.merchantId) { if (query.merchantId) {
// &&options.patch == 'tabIndex/pages/index/index' // 判断是首页还是待补录页面
options.patch = query.supplementId ? 'tabWorkOrder/pages/additionRecordOrder/additionRecordOrder' : 'pages/index/index'
// options.patch == 'tabIndex/pages/index/index'
let userInfo = util.getStorageSync('dj_boutique_user_info') let userInfo = util.getStorageSync('dj_boutique_user_info')
// 需要当前门店的 不是就重新登录 // 需要当前门店的 不是就重新登录
if (userInfo?.subLoginUser?.merchantId != query.merchantId) { if (userInfo?.subLoginUser?.merchantId != query.merchantId) {
wx.$SCENE = null let that = this
return this.login(true) // wx.$SCENE = null
// router.reLaunch('pages.wxLogin')
wx.showModal({
title: '温馨提示',
content: '登录账号非补单对应门店,请重新登录。',
showCancel: false,
confirmText: '去登录',
confirmColor: '#3582EE',
success(res) {
if (res.confirm) {
// getApp().login(true)
return that.login(true)
}
}
})
} }
options.patch = 'pages/index/index'
} }
if (query.type) { if (query.type) {
options.patch = 'tabWorkOrder/pages/createOrder/createOrder' options.patch = 'tabWorkOrder/pages/createArchives/createArchives'
} }
// tabIndex/pages/index/index?supplement=true
wx.$SCENE = options wx.$SCENE = options
// tabIndex/pages/index/index?supplement=true
} }
console.log(wx.$SCENE, ' wx.$SCENE') // console.log(wx.$SCENE, ' wx.$SCENE')
// if (options.query.scene) // if (options.query.scene)
}, },
login(relogin) { login(relogin) {
...@@ -129,20 +93,7 @@ App({ ...@@ -129,20 +93,7 @@ App({
// } // }
router.reLaunch('pages.wxLogin') router.reLaunch('pages.wxLogin')
}, },
// 获取设备信息
getDeviceSize: function () {
return new Promise((resolve, reject) => {
wx.getSystemInfo({
success: function (res) {
// console.log(res)
const { screenHeight, safeArea } = res
const { bottom } = safeArea
const bottomLift = screenHeight - bottom
resolve({ bottomLift })
}
})
})
},
// &&(userInfo.subLoginUser.merchantId != userInfo.merchantId || canRemark ) // &&(userInfo.subLoginUser.merchantId != userInfo.merchantId || canRemark )
checkYqdSuper(userInfo) { checkYqdSuper(userInfo) {
// console.log('app', userInfo) // console.log('app', userInfo)
......
...@@ -80,6 +80,9 @@ ...@@ -80,6 +80,9 @@
"~/*": "/*" "~/*": "/*"
}, },
"sitemapLocation": "sitemap.json", "sitemapLocation": "sitemap.json",
"resolveAlias": {
"~/*": "/*"
},
"permission": { "permission": {
"scope.userLocation": { "scope.userLocation": {
"desc": "你的位置信息将用于小程序位置接口的效果展示" "desc": "你的位置信息将用于小程序位置接口的效果展示"
......
...@@ -141,7 +141,7 @@ Component({ ...@@ -141,7 +141,7 @@ Component({
setCar(data, isApiEvent) { setCar(data, isApiEvent) {
let { carSeriesId, letter } = this.data let { carSeriesId, letter } = this.data
// 处理可能车型没有数据的问题 // 处理可能车型没有数据的问题
let letterList = data ? Array.from(new Set([...data.map(e => e.letter)])) : [] let letterList = data && data.length ? Array.from(new Set([...data.map(e => e.letter)])) : []
// console.log(letterList) // console.log(letterList)
let brandList = letterList.map(e => { let brandList = letterList.map(e => {
let list = [] let list = []
......
...@@ -27,8 +27,8 @@ Component({ ...@@ -27,8 +27,8 @@ Component({
// 校验历史订单二级流量方是否在配置的二级流量方数据中包含 不包含清空二级流量方重新选择 // 校验历史订单二级流量方是否在配置的二级流量方数据中包含 不包含清空二级流量方重新选择
let hasSubShopMerchantId = subShopMerchantList.some(item=> item.subMerchantId == orderObj.subShopMerchantId) let hasSubShopMerchantId = subShopMerchantList.some(item=> item.subMerchantId == orderObj.subShopMerchantId)
if (!hasSubShopMerchantId && subShopMerchantList.length) { if (!hasSubShopMerchantId && subShopMerchantList.length) {
delete orderObj.subShopMerchantId delete orderObj?.subShopMerchantId
delete orderObj.subShopMerchantName delete orderObj?.subShopMerchantName
} }
thisPage.setData({ thisPage.setData({
orderObj orderObj
...@@ -79,7 +79,7 @@ Component({ ...@@ -79,7 +79,7 @@ Component({
if (code == '0') { if (code == '0') {
// 有二级流量方数据 添加必填二级流量方字段 // 有二级流量方数据 添加必填二级流量方字段
if (data?.length) { if (data?.length) {
if (requiredList.indexOf('subShopMerchantId') < 0) requiredList.push('subShopMerchantId') if (!requiredList.includes('subShopMerchantId')) requiredList.unshift('subShopMerchantId')
data.map(i => { data.map(i => {
i.active = false i.active = false
if (i.subMerchantId == orderObj.subShopMerchantId) { if (i.subMerchantId == orderObj.subShopMerchantId) {
...@@ -90,8 +90,8 @@ Component({ ...@@ -90,8 +90,8 @@ Component({
// 校验历史订单二级流量方是否在配置的二级流量方数据中包含 不包含清空二级流量方重新选择 // 校验历史订单二级流量方是否在配置的二级流量方数据中包含 不包含清空二级流量方重新选择
let hasSubShopMerchantId = data.some(item=> item.subMerchantId == orderObj.subShopMerchantId) let hasSubShopMerchantId = data.some(item=> item.subMerchantId == orderObj.subShopMerchantId)
if (!hasSubShopMerchantId) { if (!hasSubShopMerchantId) {
delete orderObj.subShopMerchantId delete orderObj?.subShopMerchantId
delete orderObj.subShopMerchantName delete orderObj?.subShopMerchantName
} }
thisPage.setData({ thisPage.setData({
requiredList, requiredList,
...@@ -104,9 +104,9 @@ Component({ ...@@ -104,9 +104,9 @@ Component({
}) })
} else { } else {
// 无二级流量方字段时 清空选择的二级流量方字段 // 无二级流量方字段时 清空选择的二级流量方字段
delete orderObj.subShopMerchantId delete orderObj?.subShopMerchantId
delete orderObj.subShopMerchantName delete orderObj?.subShopMerchantName
requiredList.indexOf('subShopMerchantId') > -1 && requiredList.splice(requiredList.indexOf('subShopMerchantId'), 1) if (requiredList.includes('subShopMerchantId')) requiredList.splice(requiredList.indexOf('subShopMerchantId'), 1)
thisPage.setData({ thisPage.setData({
isShowSubShopMerchant: false, isShowSubShopMerchant: false,
requiredList, requiredList,
......
/**
* 用来配置小程序项目的变量
* 统一管理
*/
// 配置预发布的小程序aapId
// export const preReleaseAppId = 'wx24ebae5768e74138'
// 小程序id
export const appId = 'wx570d9331f9ace0bd'
// 开发环境
// 开发指定的小程序
// sentry Dsn 地址
export const dsnUrl = 'https://ddaadc52bf8d4ecc92eca632683d456a@sentry.glsx.com.cn/23'
...@@ -107,7 +107,7 @@ Page({ ...@@ -107,7 +107,7 @@ Page({
wx.$util.showLoading('加载中...') wx.$util.showLoading('加载中...')
api.getListSelectAccount().then(res => { api.getListSelectAccount().then(res => {
wx.hideLoading() wx.hideLoading()
console.log(res) // console.log(res)
let { code, data, message } = res let { code, data, message } = res
if (code == 0) { if (code == 0) {
let { loginUserInfoList, sessionId } = data let { loginUserInfoList, sessionId } = data
...@@ -165,7 +165,8 @@ Page({ ...@@ -165,7 +165,8 @@ Page({
// : { scene } // : { scene }
} = SCENE } = SCENE
let { target, name } = wx.$util.getSceneId(path) let { target, name } = wx.$util.getSceneId(path)
console.log(query) // console.log(query)
// console.log(target,name);
wx.$router.reLaunch(`${target}.${name}`, query) wx.$router.reLaunch(`${target}.${name}`, query)
wx.$SCENE = null wx.$SCENE = null
} else { } else {
......
...@@ -80,8 +80,8 @@ ...@@ -80,8 +80,8 @@
}, },
{ {
"name": "首页", "name": "首页",
"pathName": "/tabIndex/pages/index/index", "pathName": "pages/index/index",
"query": "merchantId=44209886", "query": "",
"launchMode": "default", "launchMode": "default",
"scene": null "scene": null
}, },
...@@ -95,7 +95,7 @@ ...@@ -95,7 +95,7 @@
{ {
"name": "订单补录", "name": "订单补录",
"pathName": "tabWorkOrder/pages/additionRecordOrder/additionRecordOrder", "pathName": "tabWorkOrder/pages/additionRecordOrder/additionRecordOrder",
"query": "tradeNo=354293022030&totalFee=1000.00&accountDate=07/06 16:53", "query": "supplementId=159&merchantId=44211025",
"launchMode": "default", "launchMode": "default",
"scene": null "scene": null
}, },
...@@ -109,6 +109,45 @@ ...@@ -109,6 +109,45 @@
{ {
"name": "门店概况", "name": "门店概况",
"pathName": "tabOperating/pages/4sOverview/4sOverview", "pathName": "tabOperating/pages/4sOverview/4sOverview",
"query": "supplement=true&merchantId=44202910",
"launchMode": "default",
"scene": null
},
{
"name": "",
"pathName": "tabIndex/pages/index/index",
"query": "supplement=true&merchantId=44202910",
"launchMode": "default",
"scene": 1008,
"groupInfo": {
"groupIdx": 1,
"groupName": "测试模拟群1"
}
},
{
"name": "",
"pathName": "tabIndex/pages/index/index",
"query": "supplement=true&merchantId=44202910",
"launchMode": "default",
"scene": null
},
{
"name": "",
"pathName": "tabIndex/pages/index/index",
"query": "supplement=true&merchantId=111",
"launchMode": "default",
"scene": 1008
},
{
"name": "",
"pathName": "tabIndex/pages/index/index",
"query": "",
"launchMode": "default",
"scene": null
},
{
"name": "",
"pathName": "/tabIndex/pages/index/index",
"query": "", "query": "",
"launchMode": "default", "launchMode": "default",
"scene": null "scene": null
......
...@@ -49,6 +49,7 @@ class Router { ...@@ -49,6 +49,7 @@ class Router {
if (thisPage) { if (thisPage) {
const onRoute = thisPage.onRoute const onRoute = thisPage.onRoute
thisPage.$query = this[_query] thisPage.$query = this[_query]
// console.log(this[_query]);
typeof onRoute === 'function' && onRoute(this[_query]) typeof onRoute === 'function' && onRoute(this[_query])
thisPage.showToast = util.showToast thisPage.showToast = util.showToast
thisPage.showLoading = util.showLoading thisPage.showLoading = util.showLoading
...@@ -99,8 +100,10 @@ class Router { ...@@ -99,8 +100,10 @@ class Router {
} }
checkRouter(route, events) { checkRouter(route, events) {
// console.log(route) // console.log(route)
// console.log(events);
// debugger // debugger
this[_query] = events || {} this[_query] = events || {}
// console.log(this[_query])
const [_parent, _name] = route.split('.') const [_parent, _name] = route.split('.')
let name = route let name = route
let parent = this.getPageInstance()?.__route__.split('/')[0] let parent = this.getPageInstance()?.__route__.split('/')[0]
...@@ -155,7 +158,10 @@ class Router { ...@@ -155,7 +158,10 @@ class Router {
} }
/**关闭所有页面,打开到应用内的某个页面 */ /**关闭所有页面,打开到应用内的某个页面 */
reLaunch(route, events) { reLaunch(route, events) {
// console.log(events)
// debugger
let { routerMapItem, query } = this.checkRouter(route, events) let { routerMapItem, query } = this.checkRouter(route, events)
// console.log(query, 'query')
wx.reLaunch({ wx.reLaunch({
url: `${routerMapItem.url}${query}` url: `${routerMapItem.url}${query}`
}) })
......
...@@ -281,30 +281,7 @@ Page({ ...@@ -281,30 +281,7 @@ Page({
table table
}) })
}, },
/**
* 生命周期函数--监听页面加载
*/
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')
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(() => {
...@@ -317,7 +294,10 @@ Page({ ...@@ -317,7 +294,10 @@ Page({
// console.log('waitorder') // console.log('waitorder')
let { isStaff } = this.data let { isStaff } = this.data
// console.log('isStaff', isStaff) // console.log('isStaff', isStaff)
isStaff && let thisPage = wx.$router.getPageInstance()
console.log(thisPage.route, ' thisPage.route')
thisPage.route == 'tabIndex/pages/index/index' &&
isStaff &&
api api
.waitinputorder() .waitinputorder()
.then(result => { .then(result => {
...@@ -420,13 +400,43 @@ Page({ ...@@ -420,13 +400,43 @@ Page({
} }
}) })
}, },
onRoute(options) { checkShowOrderPop(options) {
if (options.supplement) { let userInfo = wx.$util.getStorageSync('dj_boutique_user_info')
this.setData({ if (userInfo?.subLoginUser?.merchantId == options.merchantId) {
showOrderpop: true if (options.merchantId) {
}) this.setData({
showOrderpop: true
})
}
} }
}, },
onRoute(options) {
// console.log($query);
// debugger
// console.log(options,'options');
options && this.checkShowOrderPop(options)
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
// console.log(options)
options && this.checkShowOrderPop(options)
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()
},
/** /**
* 生命周期函数--监听页面初次渲染完成 * 生命周期函数--监听页面初次渲染完成
*/ */
...@@ -489,13 +499,15 @@ Page({ ...@@ -489,13 +499,15 @@ Page({
onHide: function () { onHide: function () {
// console.log('onHide') // console.log('onHide')
// console.log(time) // console.log(time)
clearTimeout(time) time && clearTimeout(time)
}, },
/** /**
* 生命周期函数--监听页面卸载 * 生命周期函数--监听页面卸载
*/ */
onUnload: function () {}, onUnload: function () {
time && clearTimeout(time)
},
/** /**
* 页面相关事件处理函数--监听用户下拉动作 * 页面相关事件处理函数--监听用户下拉动作
......
...@@ -7,7 +7,8 @@ export default { ...@@ -7,7 +7,8 @@ export default {
url: 'tabWorkOrder.createOrder' url: 'tabWorkOrder.createOrder'
}, },
{ {
name: '战败下单', name: '客户建档',
// name: '战败下单',
url: 'tabWorkOrder.createArchives' url: 'tabWorkOrder.createArchives'
}, },
{ {
......
...@@ -76,51 +76,6 @@ Page({ ...@@ -76,51 +76,6 @@ Page({
}) })
}) })
.catch(err => {}) .catch(err => {})
// console.log(userInfo)
// debugger
// if (!userInfo.isSuper && userInfo.merchantType && userInfo.userType == 2) {
// this.setData({
// merchantRange: [
// {
// merchantName: userInfo.merchantName
// }
// ],
// subIndex: 0
// })
// return
// }
// let all = {
// merchantName: '全部'
// }
// api.getYQList().then(res => {
// console.log(res)
// wx.hideLoading()
// 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,
// canRemark: arr.length == 1
// })
// }
// })
// this.getPageData()
}, },
refresh(data) { refresh(data) {
// console.log('refresh') // console.log('refresh')
...@@ -149,8 +104,6 @@ Page({ ...@@ -149,8 +104,6 @@ Page({
// console.log('time') // console.log('time')
let maxDate = new Date().format('yyyy-MM-dd') let maxDate = new Date().format('yyyy-MM-dd')
let today = dateNum || new Date().format('yyyy-MM-dd') let today = dateNum || new Date().format('yyyy-MM-dd')
// console.log(new Date(today).getTime())
// console.log(today)
/** /**
* 根据日期字符串获取星期几 * 根据日期字符串获取星期几
* @param dateString 日期字符串(如:2020-05-02) * @param dateString 日期字符串(如:2020-05-02)
...@@ -299,6 +252,20 @@ Page({ ...@@ -299,6 +252,20 @@ Page({
console.log(err) console.log(err)
}) })
}, },
// 获取设备信息
getDeviceSize() {
return new Promise((resolve, reject) => {
wx.getSystemInfo({
success: function (res) {
// console.log(res)
const { screenHeight, safeArea } = res
const { bottom } = safeArea
const bottomLift = screenHeight - bottom
resolve({ bottomLift })
}
})
})
},
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
...@@ -306,10 +273,9 @@ Page({ ...@@ -306,10 +273,9 @@ Page({
// console.log('onload') // console.log('onload')
this.setTimeList() this.setTimeList()
// this.getOrderNum() // this.getOrderNum()
let { bottomLift } = app.globalData let { bottomLift } = app.globalData
if (bottomLift >= 0) { if (bottomLift >= 0) {
app.getDeviceSize().then(res => { this.getDeviceSize().then(res => {
const { bottomLift } = res const { bottomLift } = res
this.setData({ this.setData({
bottomLift bottomLift
......
...@@ -94,6 +94,10 @@ module.exports = { ...@@ -94,6 +94,10 @@ module.exports = {
notUpgradeOrder(data) { notUpgradeOrder(data) {
return api.post('dj.api.smartcarlife.order.notUpgrade.batchInsert', data) return api.post('dj.api.smartcarlife.order.notUpgrade.batchInsert', data)
}, },
/** 批量新建预录工单 */
createPrerecordedOrderBatch(data) {
return api.post('dj.api.smartcarlife.order.preliminaryOrder.batch', data)
},
/** 新建预录工单 */ /** 新建预录工单 */
createPrerecordedOrder(data) { createPrerecordedOrder(data) {
return api.post('dj.api.smartcarlife.order.preliminaryOrder', data) return api.post('dj.api.smartcarlife.order.preliminaryOrder', data)
...@@ -102,9 +106,12 @@ module.exports = { ...@@ -102,9 +106,12 @@ module.exports = {
createBarCode(data) { createBarCode(data) {
return api.post('dj.api.smartcarlife.common.createBarCode', data) return api.post('dj.api.smartcarlife.common.createBarCode', data)
}, },
/** 获取商户基本信息 */ /** 获取商户基本信息 */
getServiceBaseInfo(data) { getServiceBaseInfo(data) {
return api.post('dj.api.smartcarlife.serviceMerchant.getServiceBaseInfo', data) return api.post('dj.api.smartcarlife.serviceMerchant.getServiceBaseInfo', data)
},
/** 根据id查询待补录订单 */
waitinputorderSelectById(data) {
return api.post('dj.api.smartcarlife.weapp.waitinputorder.selectById', data)
} }
} }
...@@ -727,6 +727,9 @@ Page({ ...@@ -727,6 +727,9 @@ Page({
// if (options.scene) { // if (options.scene) {
// this.setData(options) // this.setData(options)
// } // }
// let { supplementId } = options
console.log(options)
options?.supplementId && this.checkShowOrderInfo(options)
}, },
/** /**
* 生命周期函数--监听页面初次渲染完成 * 生命周期函数--监听页面初次渲染完成
...@@ -739,46 +742,51 @@ Page({ ...@@ -739,46 +742,51 @@ Page({
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow: function (res) { onShow: function (res) {
this.getSetting()
// console.log(111)
// this.saveImageClick() // this.saveImageClick()
// console.log(res) // console.log(res)
// setTimeout(() => { // setTimeout(() => {
// wx.$util.showLoading() // wx.$util.showLoading()
// }, 2000) // }, 2000)
}, },
checkShowOrderInfo(options) {
onRoute(res) { let userInfo = wx.$util.getStorageSync('dj_boutique_user_info')
console.log(options)
// debugger // debugger
let { outTradeNo, totalFee, accountDate } = res if (userInfo?.subLoginUser?.merchantId != options.merchantId) {
// console.log(res) // wx.$router.go('pages/index')
// console.log(outTradeNo, totalFee) wx.$router.go('tabIndex.index')
this.setData({ } else {
outTradeNo, // 查询补单信息
totalFee: totalFee, api
accountDate .waitinputorderSelectById({ id: options.supplementId })
}) .then(result => {
// console.log(res) console.log(result)
// console.log() let { outTradeNo, totalFee, accountDate } = result.data
// if (res.scene) { accountDate && (accountDate = new Date(accountDate).format('yyyy-MM-dd'))
// res.returnFun = true this.setData({
// this.setData(res) outTradeNo,
// } else if (res.merchantId) { totalFee: totalFee*100,
// this.setData({ accountDate
// returnFun: true })
// }) })
// this.setOrderObj(res) .catch(err => {})
// } else { }
// wx.$util.showLoading('加载中...') },
// this.setData( onRoute(options) {
// { let { outTradeNo, totalFee, accountDate, supplementId } = options
// flag: true console.log(options);
// }, // 如果是扫码进来的
// () => { if (supplementId) {
// wx.$util.hideLoading() return this.checkShowOrderInfo(options)
// } } else {
// ) this.setData({
// } outTradeNo,
// console.log(11) totalFee: totalFee,
this.getSetting() accountDate
})
}
}, },
/** /**
* 生命周期函数--监听页面隐藏 * 生命周期函数--监听页面隐藏
...@@ -803,27 +811,27 @@ Page({ ...@@ -803,27 +811,27 @@ Page({
/** /**
* 用户点击右上角分享 * 用户点击右上角分享
*/ */
onShareAppMessage: function () {}, onShareAppMessage: function () {}
// 获取园区店支付配置 // 获取园区店支付配置
getConfig() { // getConfig() {
// console.log(this.data.orderObj) // // console.log(this.data.orderObj)
let o = this.data.orderObj // let o = this.data.orderObj
let oParams = {} // let oParams = {}
oParams.yqMerchantId = o.sellerMerchantId // oParams.yqMerchantId = o.sellerMerchantId
api.getYqStoreConfig(oParams).then(res => { // api.getYqStoreConfig(oParams).then(res => {
console.log(res) // console.log(res)
let obj = res.data || {} // let obj = res.data || {}
let m = obj.supportPayTypes || [] // let m = obj.supportPayTypes || []
let n = this.data.payTypeList // let n = this.data.payTypeList
let list = n.filter(k => { // let list = n.filter(k => {
let idx = m.find(j => j == k.value) // let idx = m.find(j => j == k.value)
return idx >= 0 // return idx >= 0
}) // })
this.setData({ // this.setData({
showPayList: list // showPayList: list
}) // })
// console.log(list) // // console.log(list)
}) // })
} // }
}) })
...@@ -280,7 +280,9 @@ Page({ ...@@ -280,7 +280,9 @@ Page({
submit(i) { submit(i) {
this.checkPhoneUseConfig() this.checkPhoneUseConfig()
// let { save } = i.currentTarget.dataset console.log(i);
let { type } = i.currentTarget.dataset
console.log(type);
let { orderObj, notUpgradeOrderList, dateObj, isStandNo } = this.data let { orderObj, notUpgradeOrderList, dateObj, isStandNo } = this.data
let key = this.checkRequired(orderObj) let key = this.checkRequired(orderObj)
...@@ -308,16 +310,23 @@ Page({ ...@@ -308,16 +310,23 @@ Page({
return this.showToast(`请输入第${index + 1}位客户车架号`) return this.showToast(`请输入第${index + 1}位客户车架号`)
} }
} }
orderObj = { orderObj = {
...orderObj, ...orderObj,
notUpgradeOrderList, // notUpgradeOrderList,
createDate: dateObj.today createDate: dateObj.today
} }
if (type=='success') {
orderObj.preliminaryOrders = notUpgradeOrderList
}else{
orderObj.notUpgradeOrderList = notUpgradeOrderList
}
this.showLoading('提交中...') this.showLoading('提交中...')
console.log('orderObj', orderObj) console.log('orderObj', orderObj)
// return // return
api.notUpgradeOrder(orderObj).then(res => { const apiName = type=='success'? 'createPrerecordedOrderBatch':'notUpgradeOrder'
api[apiName](orderObj).then(res => {
wx.hideLoading() wx.hideLoading()
// console.log(orderObj, res) // console.log(orderObj, res)
let { code, data, message } = res let { code, data, message } = res
...@@ -327,8 +336,9 @@ Page({ ...@@ -327,8 +336,9 @@ Page({
icon: 'success', icon: 'success',
title: '提交成功' title: '提交成功'
}) })
wx.$router.back() // wx.$router.back()
// wx.$router.go('tabindex.index')
wx.$router.go('tabIndex.index')
// if (save) { // if (save) {
// wx.showModal({ // wx.showModal({
// title: '温馨提示', // title: '温馨提示',
......
{ {
"navigationBarTitleText": "战败下单", "navigationBarTitleText": "创建客户档案",
"usingComponents": { "usingComponents": {
"car-brands": "/components/CarBrands/CarBrands", "car-brands": "/components/CarBrands/CarBrands",
"merchant-seles": "/components/Merchant-Seles/Merchant-Seles", "merchant-seles": "/components/Merchant-Seles/Merchant-Seles",
......
...@@ -214,9 +214,17 @@ ...@@ -214,9 +214,17 @@
<!-- <car-brands show="{{carBrandBox}}" bindconfirm="chooseCar" carSeriesId="{{orderObj.carSeriesId || ''}}" /> --> <!-- <car-brands show="{{carBrandBox}}" bindconfirm="chooseCar" carSeriesId="{{orderObj.carSeriesId || ''}}" /> -->
<view class="btns {{isFullSucreen?'isFullSucreen-btn':''}}"> <view class="btns {{isFullSucreen?'isFullSucreen-btn':''}}">
<view class="tips">可批量生成当天的战败客户,缺漏信息建档后在工单详情补充</view> <view class="tips">可批量生成当天的战败客户,缺漏信息建档后在工单详情补充</view>
<view class="confirm text-center" bindtap="submit"> <view class="btns-con">
{{notUpgradeOrderList.length==1?'提交客户工单':'提交'+notUpgradeOrderList.length+'个客户工单'}}
<view class="confirm fail text-center" bindtap="submit">
战败下单
<!-- {{notUpgradeOrderList.length==1?'提交客户工单':'提交'+notUpgradeOrderList.length+'个客户工单'}} -->
</view>
<view class="confirm save text-center" bindtap="submit" data-type="success">提交</view>
</view> </view>
<!-- <view class="confirm text-center" bindtap="submit">
{{notUpgradeOrderList.length==1?'提交客户工单':'提交'+notUpgradeOrderList.length+'个客户工单'}}
</view> -->
</view> </view>
<merchant-seles <merchant-seles
show="{{selesBox}}" show="{{selesBox}}"
......
...@@ -269,14 +269,35 @@ scroll-view ::-webkit-scrollbar { ...@@ -269,14 +269,35 @@ scroll-view ::-webkit-scrollbar {
height: 80rpx; height: 80rpx;
background-color: #3582EE; background-color: #3582EE;
border-radius: 12rpx; border-radius: 12rpx;
margin: 0 32rpx; /* margin: 0 32rpx; */
} }
.btns-con {
box-sizing: border-box;
display: flex;
padding: 0 32rpx;
}
.btns-con .save {
width: 480rpx;
}
.btns-con .fail {
width: 186rpx;
margin-right: 20rpx;
background: #FFFFFF;
border: 2rpx solid #DCDEE0;
border-radius: 12rpx;
font-family: PingFangSC-Regular;
font-weight: 400;
font-size: 28rpx;
color: #323233;
}
.touch-item { .touch-item {
/* margin: 0 20rpx; */ /* margin: 0 20rpx; */
box-sizing: border-box; box-sizing: border-box;position: relative;
position: relative;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
/* width: calc(100% - 40rpx); */ /* width: calc(100% - 40rpx); */
......
...@@ -368,7 +368,7 @@ Page({ ...@@ -368,7 +368,7 @@ Page({
}, },
checkPhoneUseConfig() { checkPhoneUseConfig() {
let { phoneShow, orderObj } = this.data let { phoneShow, orderObj } = this.data
if (phoneShow && orderObj.merchantName && orderObj.employeeName && !orderObj.customer.customerPhone) { if (phoneShow && phoneShow.length && orderObj.merchantName && orderObj.employeeName && !orderObj.customer.customerPhone) {
// let list = phoneShow.shopMerchantPhoneList // let list = phoneShow.shopMerchantPhoneList
let phoneConfig = let phoneConfig =
phoneShow.find(item => { phoneShow.find(item => {
......
This diff could not be displayed because it is too large.
const getUpdateManager = () => {
let startParamObj = wx.getLaunchOptionsSync()
// 解决朋友圈分享是单页面报错问题
if (wx.canIUse('getUpdateManager') && startParamObj.scene != 1154) {
const updateManager = wx.getUpdateManager()
updateManager.onCheckForUpdate(function (res) {
// 请求完新版本信息的回调
})
updateManager.onUpdateReady(function () {
wx.showModal({
title: '更新提示',
content: '新版本已经准备好,是否重启应用?',
success: function (res) {
if (res.confirm) {
// 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
updateManager.applyUpdate()
}
}
})
})
updateManager.onUpdateFailed(function () {
// 新版本下载失败
wx.showModal({
title: '已经有新版本了哟~',
content: '新版本已经上线啦~,请您删除当前小程序,重新搜索打开哟~'
})
})
}
}
export default getUpdateManager
import { dsnUrl } from '~/config'
import * as Sentry from '~/utils/lib/sentry-miniapp'
export default function sentryInit() {
// accountInfo.miniProgram.envVersion == 'release' &&
const accountInfo = wx.getAccountInfoSync()
//测试和生产才开发sentry
const env = ['trial', 'release']
env.includes(accountInfo.miniProgram.envVersion) &&
Sentry.init({
// dsn: 'http://ebcf31c417cc4ce185782f046e4a87a2@sentry.glsx.com.cn/5'
dsn: dsnUrl
})
}
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!