Commit 96d21fc8 by 张立顺

v4.16.0 功能开发

1 parent 161df0c6
...@@ -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 = 1
// 判断小程序环境 // 判断小程序环境
// develop:开发版(正常开发工具,测试时) // develop:开发版(正常开发工具,测试时)
......
...@@ -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) {
...@@ -90,10 +40,11 @@ App({ ...@@ -90,10 +40,11 @@ App({
let { query } = options let { query } = options
// 判断对象是否满足任意一个key // 判断对象是否满足任意一个key
console.log(query, ' query') console.log(query, ' query')
wx.$SCENE = null // 解决不是外部跳转进来的问题, 重置
if (query && (query.scene || query.merchantId || query.type)) { if (query && (query.scene || query.merchantId || query.type)) {
options.patch = 'pages/index/index'
// 需要满
if (query.merchantId) { if (query.merchantId) {
// 判断是首页还是待补录页面
options.patch = query.scene ? 'tabWorkOrder/pages/additionRecordOrder/additionRecordOrder' : 'pages/index/index'
// options.patch == 'tabIndex/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')
// 需要当前门店的 不是就重新登录 // 需要当前门店的 不是就重新登录
...@@ -117,7 +68,7 @@ App({ ...@@ -117,7 +68,7 @@ App({
} }
} }
if (query.type) { if (query.type) {
options.patch = 'tabWorkOrder/pages/createOrder/createOrder' options.patch = 'tabWorkOrder/pages/createArchives/createArchives'
} }
wx.$SCENE = options wx.$SCENE = options
// tabIndex/pages/index/index?supplement=true // tabIndex/pages/index/index?supplement=true
...@@ -142,20 +93,7 @@ App({ ...@@ -142,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)
......
...@@ -82,6 +82,9 @@ ...@@ -82,6 +82,9 @@
"tips-bottom": "components/tipsBottom/index" "tips-bottom": "components/tipsBottom/index"
}, },
"sitemapLocation": "sitemap.json", "sitemapLocation": "sitemap.json",
"resolveAlias": {
"~/*": "/*"
},
"permission": { "permission": {
"scope.userLocation": { "scope.userLocation": {
"desc": "你的位置信息将用于小程序位置接口的效果展示" "desc": "你的位置信息将用于小程序位置接口的效果展示"
......
/**
* 用来配置小程序项目的变量
* 统一管理
*/
// 配置预发布的小程序aapId
// export const preReleaseAppId = 'wx24ebae5768e74138'
// 小程序id
export const appId = 'wx570d9331f9ace0bd'
// 开发环境
// 开发指定的小程序
// sentry Dsn 地址
export const dsnUrl = 'https://ddaadc52bf8d4ecc92eca632683d456a@sentry.glsx.com.cn/23'
...@@ -174,7 +174,6 @@ Page({ ...@@ -174,7 +174,6 @@ Page({
onShow: function () { onShow: function () {
wx.hideHomeButton() wx.hideHomeButton()
this.login() this.login()
console.log(' wx.$SCENE ', wx.$SCENE );
}, },
login() { login() {
wx.$util.showLoading() wx.$util.showLoading()
......
...@@ -295,8 +295,9 @@ Page({ ...@@ -295,8 +295,9 @@ Page({
let { isStaff } = this.data let { isStaff } = this.data
// console.log('isStaff', isStaff) // console.log('isStaff', isStaff)
let thisPage = wx.$router.getPageInstance() let thisPage = wx.$router.getPageInstance()
console.log( thisPage.route,' thisPage.route'); console.log(thisPage.route, ' thisPage.route')
thisPage.route == 'tabIndex/pages/index/index'&& isStaff && thisPage.route == 'tabIndex/pages/index/index' &&
isStaff &&
api api
.waitinputorder() .waitinputorder()
.then(result => { .then(result => {
...@@ -399,9 +400,8 @@ Page({ ...@@ -399,9 +400,8 @@ Page({
} }
}) })
}, },
checkShowOrderPop(options){ checkShowOrderPop(options) {
let userInfo = wx.$util.getStorageSync('dj_boutique_user_info') let userInfo = wx.$util.getStorageSync('dj_boutique_user_info')
// 需要当前门店的 不是就重新登录
if (userInfo?.subLoginUser?.merchantId == options.merchantId) { if (userInfo?.subLoginUser?.merchantId == options.merchantId) {
if (options.merchantId) { if (options.merchantId) {
this.setData({ this.setData({
...@@ -414,15 +414,14 @@ Page({ ...@@ -414,15 +414,14 @@ Page({
// console.log($query); // console.log($query);
// debugger // debugger
// console.log(options,'options'); // console.log(options,'options');
options&& this.checkShowOrderPop(options) options && this.checkShowOrderPop(options)
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function (options) { onLoad: function (options) {
// console.log(options) // console.log(options)
options&& this.checkShowOrderPop(options) options && this.checkShowOrderPop(options)
let today = new Date() let today = new Date()
let startDate = today.format('yyyy-MM-dd') let startDate = today.format('yyyy-MM-dd')
...@@ -471,14 +470,14 @@ Page({ ...@@ -471,14 +470,14 @@ Page({
onHide: function () { onHide: function () {
// console.log('onHide') // console.log('onHide')
// console.log(time) // console.log(time)
time &&clearTimeout(time) time && clearTimeout(time)
}, },
/** /**
* 生命周期函数--监听页面卸载 * 生命周期函数--监听页面卸载
*/ */
onUnload: function () { onUnload: function () {
time &&clearTimeout(time) 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
......
...@@ -723,6 +723,7 @@ Page({ ...@@ -723,6 +723,7 @@ Page({
// if (options.scene) { // if (options.scene) {
// this.setData(options) // this.setData(options)
// } // }
options?.scene && this.checkShowOrderInfo(options)
}, },
/** /**
* 生命周期函数--监听页面初次渲染完成 * 生命周期函数--监听页面初次渲染完成
...@@ -735,46 +736,45 @@ Page({ ...@@ -735,46 +736,45 @@ 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) {
let userInfo = wx.$util.getStorageSync('dj_boutique_user_info')
if (userInfo?.subLoginUser?.merchantId != options.merchantId) {
wx.$router.go('index')
} else {
// 查询补单信息
api
.supplementOrder({ scene: options })
.then(result => {
let { outTradeNo, totalFee, accountDate } = result
this.setData({
outTradeNo,
totalFee: totalFee,
accountDate
})
})
.catch(err => {})
}
},
onRoute(res) { onRoute(res) {
// debugger let { outTradeNo, totalFee, accountDate, scene } = res
let { outTradeNo, totalFee, accountDate } = res // 如果是扫码进来的
// console.log(res) if (scene) {
// console.log(outTradeNo, totalFee) return this.checkShowOrderInfo(res)
} else {
this.setData({ this.setData({
outTradeNo, outTradeNo,
totalFee: totalFee, totalFee: totalFee,
accountDate accountDate
}) })
// console.log(res) }
// console.log()
// if (res.scene) {
// res.returnFun = true
// this.setData(res)
// } else if (res.merchantId) {
// this.setData({
// returnFun: true
// })
// this.setOrderObj(res)
// } else {
// wx.$util.showLoading('加载中...')
// this.setData(
// {
// flag: true
// },
// () => {
// wx.$util.hideLoading()
// }
// )
// }
// console.log(11)
this.getSetting()
}, },
/** /**
* 生命周期函数--监听页面隐藏 * 生命周期函数--监听页面隐藏
...@@ -799,27 +799,27 @@ Page({ ...@@ -799,27 +799,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)
}) // })
} // }
}) })
{ {
"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"
......
...@@ -193,9 +193,17 @@ ...@@ -193,9 +193,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="submitUserInfo">提交</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); */
......
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!