Commit 09ddf2eb by 张立顺

Merge branch 'SAAS+V4.37.2-0402' into 'SAAS+V4.38.0-0425'

上线合并

See merge request !256
2 parents fa862601 bb2da658
......@@ -19,7 +19,7 @@ import { checkYqdSuper, checkScene } from '~/store/index'
import eventbus from './utils/eventbus'
import api from './api/api'
import { Version } from 'glsx-common-sdk'
import { areaList } from '@vant/area-data'; //预加载省市区
import { areaList } from '@vant/area-data' //预加载省市区
App({
onLaunch() {
/**挂载到wx对象 */
......@@ -66,11 +66,20 @@ App({
})
// console.log('lifeshow')
getUpdateManager()
// options = {
// query: {
// page: 'playVideo',
// type: 1,
// title: '内容通知-培训资料-视频',
// id: 30,
// merchantId: 44211025
// }
// }
if (options) {
console.log('options', options)
let res = checkScene(options)
// console.log(res, 'res')
console.log(res, 'res')
// 如果需要重新登录
res && this.login(true, res)
}
......
......@@ -64,20 +64,12 @@
{
"root": "tabDate",
"name": "tabDate",
"pages": [
"pages/detail/detail",
"pages/apprManage/apprManage",
"pages/userPortrait/userPortrait"
]
"pages": ["pages/detail/detail", "pages/apprManage/apprManage", "pages/userPortrait/userPortrait"]
},
{
"root": "tabMine",
"name": "tabMine",
"pages": [
"pages/technicianSetup/technicianSetup",
"pages/completeBuild/completeBuild",
"pages/collectCoupons/collectCoupons"
]
"pages": ["pages/technicianSetup/technicianSetup", "pages/completeBuild/completeBuild", "pages/collectCoupons/collectCoupons"]
},
{
"root": "tabWorkOrder",
......@@ -132,25 +124,12 @@
{
"root": "tabOperating",
"name": "tabOperating",
"pages": [
"pages/4sOverview/4sOverview",
"pages/index/index",
"pages/operatingShow/operatingShow"
]
"pages": ["pages/4sOverview/4sOverview", "pages/index/index", "pages/operatingShow/operatingShow"]
},
{
"root": "packageCrowdFunding",
"name": "packageCrowdFunding",
"pages": [
"pages/TabBar/crowdFundingPage",
"pages/activityPage/paidOrder/orderList",
"pages/activityPage/activityList/activityList",
"pages/activityPage/activityPay/activityPay",
"pages/activityPage/paymentSuccess/paymentSuccess",
"pages/activityPage/balanceNote/balanceNote",
"pages/activityPage/newOrder/newOrder",
"pages/activityPage/additionRecordOrder/additionRecordOrder"
]
"pages": ["pages/TabBar/crowdFundingPage", "pages/activityPage/paidOrder/orderList", "pages/activityPage/activityList/activityList", "pages/activityPage/activityPay/activityPay", "pages/activityPage/paymentSuccess/paymentSuccess", "pages/activityPage/balanceNote/balanceNote", "pages/activityPage/newOrder/newOrder", "pages/activityPage/additionRecordOrder/additionRecordOrder"]
},
{
"root": "subvehicleConversion",
......@@ -187,21 +166,17 @@
"van-popup": "@vant/weapp/popup/index",
"van-dialog": "@vant/weapp/dialog/index",
"van-uploader": "@vant/weapp/uploader/index",
"glsx-privacy": "glsx-applet-component/GlsxPrivacy/index",
"glsx-privacy": "glsk-applet-component/GlsxPrivacy/index",
"empty-data": "/components/EmptyData/EmptyData"
},
"preloadRule": {
"pages/tabWorkOrder/pages/index/index": {
"network": "all",
"packages": [
"tabWorkOrder"
]
"packages": ["tabWorkOrder"]
},
"tabIndex/pages/index/index": {
"network": "all",
"packages": [
"tabWorkOrder"
]
"packages": ["tabWorkOrder"]
}
},
"resolveAlias": {
......@@ -215,4 +190,4 @@
},
"lazyCodeLoading": "requiredComponents",
"resizable": true
}
\ No newline at end of file
}
......@@ -19,7 +19,6 @@ export const appId = 'wx570d9331f9ace0bd'
* 5cdptest
*/
let index = 2
const accountInfo = wx.getAccountInfoSync()
const systemInfo = wx.getSystemInfoSync()
const envName = accountInfo.miniProgram.envVersion
......@@ -66,4 +65,4 @@ export const quotedImgUrl = createQuotedUrl[target[envIndex]]
export const dsnUrl = 'https://ddaadc52bf8d4ecc92eca632683d456a@sentry.glsx.com.cn/23'
// 图片基地址
export const ImgUrl = 'https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat'
\ No newline at end of file
export const ImgUrl = 'https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat'
......@@ -12,10 +12,10 @@
"resolved": "https://registry.npmmirror.com/@vant/weapp/-/weapp-1.10.24.tgz",
"integrity": "sha512-oovAaaJq3mlB+wto5bHVCn/rov8IgRDg+gJXy6hPX0A3c9WF1GqLqSmoXyaktgidJ9IaV1RADd3PAFlw4lUsnQ=="
},
"glsx-applet-component": {
"version": "1.1.25",
"resolved": "https://registry.npmmirror.com/glsx-applet-component/-/glsx-applet-component-1.1.25.tgz",
"integrity": "sha512-tE84hW6y+1YG6hFroDEUvP/0rC0Bsgk/Z+xkKfp2++V3qs/7xFtYvz15ShThMSemLd7lcZCi0aMh9Xp4QNytLA=="
"glsk-applet-component": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/glsk-applet-component/-/glsk-applet-component-1.0.0.tgz",
"integrity": "sha512-ulz1OquWy4y4Q26Zu4FLDWzyqK+sInPWs4o8MKj2N8V/TnYQlUXoWkkgKh8fERK8A+rsusf3eiyZB0odchKk8g=="
},
"glsx-common-sdk": {
"version": "0.2.8",
......
......@@ -2,7 +2,7 @@
"dependencies": {
"@vant/area-data": "^1.5.1",
"@vant/weapp": "^1.10.24",
"glsx-applet-component": "^1.1.25",
"glsk-applet-component": "^1.0.0",
"glsx-common-sdk": "^0.2.8",
"number-precision": "^1.6.0",
"rfdc": "^1.3.0"
......
......@@ -170,5 +170,6 @@ module.exports = {
/** 员工是否需要推送开单预警 */
orderStaffValid(data) {
return api.post('dj.api.smartcarlife.order.staff.valid', data)
}
},
}
......@@ -228,6 +228,12 @@ Page({
// }
// })
},
checkDailyRecport() {
let { tabIndex } = this.data
const isStaff = app.globalData.isStaff
// 如果是员工 判读是否要填写日报
isStaff && tabIndex == 0 && this.staffDailyReport(wx.$util.getUserInfo())
},
getMerchant4SMode() {
let storeInfo = wx.$util.getUserInfo()?.default4SStoreInfo || {}
// console.log(wx.$util.getUserInfo()?.default4SStoreInfo ,'wx.$util.getUserInfo()?.default4SStoreInfo ');
......@@ -347,73 +353,6 @@ Page({
})
})
},
// test (){
// const params ={
// mode: 1,
// insurancePrice: 0,
// outTradeNo: '0120230111614687537054883840',
// referrerId: '390664aa685c4c43855f5b80122affa3',
// referrer: '负责人',
// quotedPriceUpdate: 47600,
// minEquityPrice: 1,
// goodsId: 687,
// goodsName: '测试2.0商品',
// merchantId4s: 44211468,
// merchantName4s: '明明长岭4s店A',
// owner:{
// owner: 'test',
// phone: 15626599738,
// // certificateNo: '',
// // carVin: '',
// seat: 5,
// price: 2222200,
// confirmStatus: false,
// saveStatus: false,
// },
// check: true,
// }
// console.log(params);
// quotationRecording(params).then((result) => {
// console.log(result);
// }).catch((err) => {
// });
// },
// getStoreList(e) {
// // 获取园区店下的4s店数据 超管拉全部数据
// let { userInfo } = this.data
// // {
// // merchantId: options.yqMerchantId,
// // scene: 0,
// // merchantName: options.merchantName
// // }
// let params = {
// merchantId: userInfo?.isSuper ? '' : userInfo?.merchantId,
// merchantName: e?.detail.value,
// staffUUID: userInfo?.isSuper ? '' : userInfo?.uuid
// }
// get4SStoreList(params)
// .then(result => {
// console.log(result)
// userInfo = wx.$util.getUserInfo()
// let selectStroeIndex =
// result?.findIndex(v => {
// return v.merchantId == userInfo?.default4SStoreInfo?.merchantId
// }) > -1
// ? result?.findIndex(v => {
// return v.merchantId == userInfo?.default4SStoreInfo?.merchantId
// })
// : 0
// this.setData({
// storeListRange: result,
// userInfo,
// selectStroeIndex,
// showPage: true
// })
// this.getMerchant4SMode()
// })
// .catch(err => {})
// },
showStorePicker() {
this.setData({
......@@ -486,12 +425,7 @@ Page({
.catch(err => { })
}
},
checkDailyRecport() {
let { tabIndex } = this.data
const isStaff = app.globalData.isStaff
// 如果是员工 判读是否要填写日报
isStaff && tabIndex == 0 && this.staffDailyReport(wx.$util.getUserInfo())
},
onRoute(options) {
console.log(options, 'options')
if (options && options.tabIndex) {
......
......@@ -52,7 +52,8 @@ Page({
},
message
} = await carLifeApi.getInspectionDetail({
batchId
batchId,
pageSize: 99999
})
if (code == 0 && list) {
let titleList = Array.from(new Set([...list.map(e => e.firstClassify)]))
......
......@@ -15,7 +15,7 @@
<view class="value " catchtap="choose" data-index="{{index}}" data-ind="{{ind}}" data-item="{{i}}">
<block wx:if="{{i.goods}}">
<view class="name text-hide ">
<view>{{filter.replaceItemText(i.goods.upgradeGoodsAlias) ||filter.replaceItemText(i.goods.upgradeGoodsName) || filter.replaceItemText(i.goods.goodsInfo.goodsName)}}</view>
<view>{{filter.replaceItemText(i.goods.goodsAlias) ||filter.replaceItemText(i.goods.upgradeGoodsName) || filter.replaceItemText(i.goods.goodsInfo.goodsName)}}</view>
<!-- <text wx:if="{{i.merchantGoodsPosition && i.goodsInfo.goodsType == 1}}">{{'「' + i.positionStr+'」'}}</text> -->
<view class="serveName" wx:if="{{i.goods.serveName}}">(包含{{i.goods.serveName}})</view>
<!-- <text class="warning_text" wx:if="{{!i.merchantGoodsPosition && i.goodsInfo.goodsType == 1}}">无部位</text> -->
......
......@@ -16,5 +16,8 @@ module.exports = {
let params = data || {}
return api.post('dj.api.customer.dynamic.record.leave', params)
},
/** 资料详情 */
materialDetail(data) {
return api.post('dj.api.smartcarlife.material.detail', data)
}
}
const IMG_URL = 'https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/'
import { materialListApi,leavePageTrack } from "../../api/api"
import { materialListApi, leavePageTrack } from "../../api/api"
let currentTabType = 'video';
Component({
properties: {
......@@ -94,7 +94,11 @@ Component({
materialListApi(params).then(res => {
if (res && res.data) {
res.data.forEach(el => {
if (el.createdDate) el.createdDate = new Date(el.createdDate).format('yyyy-MM-dd')
if (el.createdDate) {
let date = el.createdDate + ''
date = date.replace(/-/g, '/').split(' ')[0] // 日期格式处理
el.createdDate = date
}
})
}
list = res.data || []
......@@ -134,7 +138,7 @@ Component({
})
}
},
onHide(){
onHide() {
clearInterval(this.intaval)
}
}
......
import { enterPageTrack, leavePageTrack } from "../../api/api"
import { enterPageTrack, leavePageTrack, materialDetail } from "../../api/api"
Page({
data: {
martrialURL: ''
},
onLoad(options) {
if (options) {
console.log(options);
// if () {
options && this.getDetail(options)
// }
},
getDetail(options) {
materialDetail({ id: options.id }).then((res) => {
console.log(res, 'result');
const sys = wx.getSystemInfoSync()
const styleCss = `width:100%;height:100vh`
const { type, title, id } = options
const _tempArr = JSON.parse(wx.getStorageSync('pageQueryOfcontent'))
let { type, title, id } = options
let { materialDetailInfoList: _tempArr } = res.data
// const _tempArr = JSON.parse(wx.getStorageSync('pageQueryOfcontent'))
this.id = id
wx.removeStorageSync('pageQueryOfcontent');
// 添加埋点
this.toAddTrack(id)
// let typeNum = type
let url = ''
if (['1', '2', '0', 1, 2, 0].includes(type)) {
const typeOpt = {
'1': 'video',
'2': 'PDF',
'0': 'image',
1: 'video',
2: 'PDF',
0: 'image'
}
type = typeOpt[type]
console.log(type, 'type');
}
if (type == 'video' || type == 'PDF') {
url = _tempArr[0]
url = _tempArr[0].image
}
wx.setNavigationBarTitle({
title
title: decodeURIComponent(title)
})
if (type == 'PDF') {
wx.showLoading()
......@@ -71,7 +94,9 @@ Page({
type: type,
materials: _tempArr
})
}
}).catch((err) => {
console.log(err, 'err');
});
},
onShow() {
if (this.openPdf) {
......
<view class="video-container">
<block wx:if="{{martrialURL&&type=='video'}}">
<video style="{{styleCss}}" autoplay="{{true}}" src="{{martrialURL}}" />
</block>
<!-- <block wx:if="{{martrialURL&&type=='PDF'}}">
<block wx:if="{{martrialURL&&type=='video'}}">
<video style="{{styleCss}}" autoplay="{{true}}" src="{{martrialURL}}" />
</block>
<!-- <block wx:if="{{martrialURL&&type=='PDF'}}">
<web-view style="{{styleCss}}" src="{{martrialURL}}" />
</block> -->
<block wx:if="{{type=='image'}}">
<block wx:for="{{materials}}" wx:key="index">
<image mode="widthFix" src="{{item}}" />
</block>
<block wx:if="{{type=='image'}}">
<block wx:for="{{materials}}" wx:key="index">
<image mode="widthFix" src="{{item.image}}" />
</block>
</block>
</view>
\ No newline at end of file
......@@ -99,7 +99,12 @@ Page({
materialListApi(params).then(res => {
if (res && res.data) {
res.data.forEach(el => {
if (el.createdDate) el.createdDate = new Date(el.createdDate).format('yyyy-MM-dd')
if (el.createdDate) {
let date = el.createdDate + ''
date = date.replace(/-/g, '/').split(' ')[0] // 日期格式处理
el.createdDate = date
}
})
}
list = res.data
......@@ -148,7 +153,7 @@ Page({
})
}
},
onHide(){
onHide() {
clearInterval(this.intaval)
}
})
\ No newline at end of file
......@@ -32,7 +32,9 @@ Page({
console.log(id, 'id');
id ? this.qrCodeScene(id) : this.getListSelectAccount()
},
getSceneArr(yqMerchantId, loginUserObj) {
async getSceneArr(yqMerchantId, loginUserObj) {
// let checkAgree = await this.checkAgree()
// if (!checkAgree) return false
// 超管开通全部场景
if (loginUserObj?.isSuper) return
// 获取4s店关联场景数据
......
// pages/wxLogin/wxLogin.js
import api from '../../api/api.js'
import { setNoSignInUuid,getNoSignInUuid,rmNoSignInUuid } from '~/utils/cache/storageApi.js'
import { get4SStoreList,getYQList } from '~/store/index'
import { setNoSignInUuid, getNoSignInUuid, rmNoSignInUuid } from '~/utils/cache/storageApi.js'
import { get4SStoreList, getYQList } from '~/store/index'
const app = getApp()
Page({
/**
......@@ -17,7 +17,7 @@ Page({
noLoginAgree: false,
navBarHeight: 0
},
onRoute(loginToken) {
this.setData({
loginToken
......@@ -115,7 +115,7 @@ Page({
if (!flag) return
wx.$util.showLoading()
if (this.data.jumpPageFlag) return
this.setData({jumpPageFlag: true})
this.setData({ jumpPageFlag: true })
getYQList()
// console.log(smsLogin,'smsLogin');
if (loginType == 1) {
......@@ -128,15 +128,15 @@ Page({
})
.then(result => {
wx.$util.showLoading()
let { code, data,message } = result
let { code, data, message } = result
if (code == 0) {
let { loginUserInfoList, sessionId, noSignInUuid, needSelectAccount } = data
if (loginUserInfoList.length) {
const loginUserObj = loginUserInfoList.filter(val => val.subLoginUser && Object.keys(val.subLoginUser)?.length)[0] || {}
wx.$util.setSessionId(sessionId)
getYQList()
noSignInUuid ? setNoSignInUuid(noSignInUuid):rmNoSignInUuid()
noSignInUuid ? setNoSignInUuid(noSignInUuid) : rmNoSignInUuid()
// 记录登录信息 已选园区店、4s店和场景
if (!needSelectAccount && Object.keys(loginUserObj)?.length && loginUserObj?.shopMerchantId && !((loginUserObj?.sceneType ?? '') === '')) {
this.getYqMerchantSceneConfig(loginUserObj, 0)
......@@ -155,7 +155,7 @@ Page({
}
} else {
wx.hideLoading()
this.setData({jumpPageFlag: false})
this.setData({ jumpPageFlag: false })
wx.showModal({
title: '温馨提示',
content: message,
......@@ -174,15 +174,15 @@ Page({
})
.then(result => {
wx.$util.showLoading()
let { code, data,message } = result
let { code, data, message } = result
if (code == 0) {
let { loginUserInfoList, sessionId, noSignInUuid, needSelectAccount } = data
if (loginUserInfoList.length) {
const loginUserObj = loginUserInfoList.filter(val => val.subLoginUser && Object.keys(val.subLoginUser)?.length)[0] || {}
wx.$util.setSessionId(sessionId)
getYQList()
noSignInUuid ? setNoSignInUuid(noSignInUuid):rmNoSignInUuid()
noSignInUuid ? setNoSignInUuid(noSignInUuid) : rmNoSignInUuid()
// 记录登录信息 已选园区店、4s店和场景
if (!needSelectAccount && Object.keys(loginUserObj)?.length && loginUserObj?.shopMerchantId && !((loginUserObj?.sceneType ?? '') === '')) {
this.getYqMerchantSceneConfig(loginUserObj, 0)
......@@ -195,11 +195,11 @@ Page({
}
} else {
wx.$router.reLaunch('pages.nothing')
this.setData({jumpPageFlag: false})
this.setData({ jumpPageFlag: false })
}
} else {
wx.hideLoading()
this.setData({jumpPageFlag: false})
this.setData({ jumpPageFlag: false })
wx.showModal({
title: '温馨提示',
content: message,
......@@ -256,12 +256,12 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
console.log(options,'options');
console.log(options, 'options');
let id = decodeURIComponent(options.scene).split('=')[1]
id && this.qrCodeScene(id)
},
// 免登录逻辑
qrCodeScene(id) {
// 免登录逻辑
qrCodeScene(id) {
api
.getSceneById({
id,
......@@ -290,9 +290,9 @@ Page({
}
// }
})
.catch(err => {})
.catch(err => { })
},
noLoginFn (){
noLoginFn() {
let that = this
let { noLogin } = this.data
wx.$util.showLoading()
......@@ -304,12 +304,12 @@ Page({
wx.$util.showLoading()
if (result.code == 0) {
let { loginUserInfoList, sessionId, noSignInUuid, needSelectAccount } = result.data
console.log(result,loginUserInfoList,'loginUserInfoList');
console.log(result, loginUserInfoList, 'loginUserInfoList');
if (loginUserInfoList.length) {
const loginUserObj = loginUserInfoList.filter(val => val.subLoginUser && Object.keys(val.subLoginUser)?.length)[0] || {}
wx.$util.setSessionId(sessionId)
getYQList()
noSignInUuid ? setNoSignInUuid(noSignInUuid):rmNoSignInUuid()
noSignInUuid ? setNoSignInUuid(noSignInUuid) : rmNoSignInUuid()
// 记录登录信息 已选园区店、4s店和场景
if (!needSelectAccount && Object.keys(loginUserObj)?.length && loginUserObj?.shopMerchantId && !((loginUserObj?.sceneType ?? '') === '')) {
this.getYqMerchantSceneConfig(loginUserObj, 0)
......@@ -329,6 +329,39 @@ Page({
wx.hideLoading()
})
},
// 检测一下是否能微信端小程序登录
checkAgreeClient(loginUserObj) {
return new Promise((resolve, reject) => {
let sysInfo = wx.getSystemInfoSync()
// let { environment } = sysInfo
// 1企业微信 0微信
let envName = sysInfo.environment ? 1 : 0
let { merchantId: yqMerchantId } = loginUserObj
api.getYqStoreConfig({ yqMerchantId }).then(res => {
let {
code,
data: { loginControlList = [] }
} = res
if (code == '0') {
// const loginControlList = []
// const loginControlList = [0, 1]
if (loginControlList.includes(envName)) {
resolve(true)
} else {
wx.hideLoading()
wx.showModal({
title: '温馨提示',
content: `请在${envName == 0 ? '企业微信' : '微信'}中打开`,
showCancel: false,
confirmText: '知道了',
confirmColor: '#347BFF'
})
resolve(false)
}
}
})
})
},
/**
* 获取授权手机号
*/
......@@ -351,13 +384,13 @@ Page({
.then(({ code, data, message }) => {
wx.hideLoading()
if (code == 0) {
let { loginUserInfoList, sessionId, noSignInUuid, needSelectAccount } = data
if (loginUserInfoList.length) {
const loginUserObj = loginUserInfoList.filter(val => val.subLoginUser && Object.keys(val.subLoginUser)?.length)[0] || {}
wx.$util.setSessionId(sessionId)
getYQList()
noSignInUuid ? setNoSignInUuid(noSignInUuid):rmNoSignInUuid()
noSignInUuid ? setNoSignInUuid(noSignInUuid) : rmNoSignInUuid()
// 记录登录信息 已选园区店、4s店和场景
if (!needSelectAccount && Object.keys(loginUserObj)?.length && loginUserObj?.shopMerchantId && !((loginUserObj?.sceneType ?? '') === '')) {
this.getYqMerchantSceneConfig(loginUserObj, 0)
......@@ -384,6 +417,8 @@ Page({
})
},
async getYqMerchantSceneConfig(loginUserObj, num) {
// let checkAgreeClient = await this.checkAgreeClient(loginUserObj)
// if (!checkAgreeClient) return wx.$router.go('pages.accountItems')
// num 0已选园区店、4s店和场景 1已选园区店、4s店 2仅选择园区店
let pageUrl = ['pages.loading', 'pages.sceneIndex', 'pages.merchantList']
let { shopMerchantId, shopMerchantName } = loginUserObj
......@@ -409,14 +444,14 @@ Page({
})
if (num == 0) wx.$router.reLaunch(pageUrl[num])
else wx.$router.go(pageUrl[num])
this.setData({jumpPageFlag: false})
this.setData({ jumpPageFlag: false })
}
},
// 获取园区店下4s店数据
get4SStoreList(loginUserObj, pageUrl) {
let { merchantId, isSuper, uuid } = loginUserObj
get4SStoreList({merchantId: isSuper ? undefined : merchantId, staffUUID: isSuper ? undefined : uuid}).then(result => {
get4SStoreList({ merchantId: isSuper ? undefined : merchantId, staffUUID: isSuper ? undefined : uuid }).then(result => {
// 超管跳过选择4s店
if (isSuper) {
let { merchantName, merchantId } = result[0]
......@@ -426,7 +461,7 @@ Page({
shopMerchantId: merchantId
})
wx.$router.go('pages.sceneIndex')
this.setData({jumpPageFlag: false})
this.setData({ jumpPageFlag: false })
return
}
// 仅一家4s店
......@@ -450,13 +485,13 @@ Page({
}
})
wx.$router.go('pages.sceneIndex')
this.setData({jumpPageFlag: false})
this.setData({ jumpPageFlag: false })
} else if (!result?.length) {
this.setData({jumpPageFlag: false})
this.setData({ jumpPageFlag: false })
return wx.$util.showToast('园区店关联的4s店商户账号无效,请联系总部管理员')
} else {
wx.$router.go(pageUrl)
this.setData({jumpPageFlag:false})
this.setData({ jumpPageFlag: false })
}
})
},
......@@ -470,7 +505,7 @@ Page({
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {},
onReady: function () { },
/**
* 生命周期函数--监听页面显示
......@@ -479,7 +514,7 @@ Page({
wx.hideHomeButton()
this.login()
let noSignInUuid = getNoSignInUuid()
noSignInUuid&&app.login(true)
noSignInUuid && app.login(true)
this.setData({
jumpPageFlag: false
})
......@@ -512,20 +547,20 @@ Page({
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {},
onHide: function () { },
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {},
onUnload: function () { },
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {},
onPullDownRefresh: function () { },
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {}
onReachBottom: function () { }
})
......@@ -220,7 +220,7 @@ export const checkScene = options => {
}
console.log(query, 'query')
let userInfo = wx.$util.getStorageSync('dj_boutique_user_info')
if (query && query.reportDate) {
if (query && query.reportDate && Object.hasOwnProperty(query.approvedSource)) {
// const app = getApp()
// console.log(app, 'app');
// app.globalData.yqdInfo = {}
......@@ -235,39 +235,35 @@ export const checkScene = options => {
// console.log(query, ' query')
if (query && (query.scene || query.merchantId || query.type || query.page)) {
// 如果是跳转员工日报页面,需先情况之前的用户登录信息
if (query.merchantId && !query.reportDate) {
// &&options.patch == 'tabIndex/pages/index/index'
// 需要当前门店的 不是就重新登录
if (userInfo?.subLoginUser?.merchantId != query.merchantId) {
wx.$SCENE = null
// return this.login(true)
// return true // 重新登录
return '订单与当前登录园区不一致,请重新登录。'
}
if (query.page) {
//订单跟进
options.path = 'tabWorkOrder/pages/createOrder/createOrder'
} else {
//订单补录
options.path = 'pages/index/index'
}
}
// h5跳转小程序 路径处理
if (query.page) {
const pagePath = {
createArchives: 'tabWorkOrder/pages/createArchives/createArchives',
createOrder: 'tabWorkOrder/pages/createOrder/createOrder',
followUpOrder: 'tabDate/pages/detail',
staffDaily: 'tabWorkOrder/pages/staffDaily/staffDaily'
staffDaily: 'tabWorkOrder/pages/staffDaily/staffDaily',
playVideo: 'packageEquity/pages/trainingMaterials/pages/playVideo/index'
}
options.path = pagePath[query.page]
}
console.log(options, 'options')
console.log(options, query, 'options')
console.log(userInfo, 'userInfo');
wx.$SCENE = options
if (query.merchantId && !query.reportDate && !query.title) {
// &&options.patch == 'tabIndex/pages/index/index'
// 需要当前门店的 不是就重新登录
if (userInfo?.subLoginUser?.merchantId != query.merchantId) {
wx.$SCENE = null
// return this.login(true)
// return true // 重新登录
return '当前登录园区不一致,请重新登录。'
}
}
console.log(options.path, 'options.path')
if (!userInfo && !['pages/accountItems/accountItems', 'pages/wxLogin/wxLogin', 'tabWorkOrder/pages/staffDaily/staffDaily'].includes(options.path)) {
// wx.$SCENE = options
if (!userInfo && !['pages/accountItems/accountItems', 'pages/wxLogin/wxLogin', 'tabWorkOrder/pages/staffDaily/staffDaily', 'packageEquity/pages/trainingMaterials/pages/playVideo/index'].includes(options.path)) {
// if (!userInfo) {
// console.log(userInfo);
console.log('未登录,请登录。')
......
......@@ -55,7 +55,8 @@ module.exports = {
},
/** 查询该店员工日报是否开启 */
staffDailyReportMerchantValid(data) {
return api.post('dj.api.smartcarlife.staff.daily.report.merchant.valid', data)
// return api.post('dj.api.smartcarlife.staff.daily.report.merchant.valid', data)
return api.post('dj.api.smartcarlife.staff.daily.report.popup.need', data)
},
/** 员工是否需要推送开单预警 */
orderStaffValid(data) {
......
......@@ -633,8 +633,51 @@ Page({
})
.catch(err => { })
},
async staffDailyReport(userInfo) {
// 是配置的园区店并且没有填写上一天的日报
let merchantStaffDailyReportMerchantValid = await this.staffDailyReportMerchantValid(userInfo)
// 没有开启就不走下一步逻辑
// if (!merchantStaffDailyReportMerchantValid) return false
if (merchantStaffDailyReportMerchantValid) {
// 获取当前日期
let currentDate = new Date()
// 获取上一天的日期
let previousDate = new Date(currentDate)
previousDate.setDate(currentDate.getDate() - 1)
// 格式化日期为"yyyy-mm-dd"
let formattedDate = previousDate.toISOString().split('T')[0]
if (wx.__HAS_NOREPORT_MODAL || wx.__HAS_NOTLOGIN_MODAL) return false
wx.__HAS_NOREPORT_MODAL = true
wx.showModal({
title: '日报提醒',
content: '您有未填写的日报,请点击前往。',
showCancel: false,
// cancelText: '取消', // '取消
cancelColor: '#292D33',
confirmText: '前往填写',
confirmColor: '#347BFF',
success(res) {
if (res.confirm) {
wx.$router.go('tabWorkOrder.staffDaily', {
// reportDate: hasNeedReport.date
reportDate: formattedDate
})
}
},
complete: () => {
// 这个延迟的目的是为了避免短时间内重复弹出
// 你要是没有这个需要也可以去掉,直接把标志位改成 false 就行
setTimeout(() => {
wx.__HAS_NOREPORT_MODAL = false
}, 2000)
}
})
}
},
checkDailyRecport() {
let { tabIndex } = this.data
// let { tabIndex } = this.data
const isStaff = app.globalData.isStaff
// 如果是员工 判读是否要填写日报
isStaff && this.staffDailyReport(wx.$util.getUserInfo())
......@@ -654,7 +697,6 @@ Page({
// 产品需求:该场景无需再放开入口
// this.checkDailyRecport()
this.checkStaffOrderStatus()
// this.checkDailyRecport()
},
/**
* 生命周期函数--监听页面加载
......@@ -740,7 +782,10 @@ Page({
// console.log(userInfo, 'userInfo')
api
.staffDailyReportMerchantValid({
merchantId: userInfo.shopMerchantId
// merchantId: userInfo.shopMerchantId
merchantId: userInfo.shopMerchantId,
yqMerchantId: userInfo.merchantId,
staffUuid: userInfo.uuid
})
.then(res => {
// console.log(res, 'staffDailyReportMerchantValid')
......@@ -751,135 +796,6 @@ Page({
})
})
},
async staffDailyReport(userInfo) {
// debugger
let merchantStaffDailyReportMerchantValid = await this.staffDailyReportMerchantValid(userInfo)
console.log(merchantStaffDailyReportMerchantValid, 'merchantStaffDailyReportMerchantValid')
// 没有开启就不走下一步逻辑
if (!merchantStaffDailyReportMerchantValid) return false
let { isStaff } = this.data
// 获取当前日期
if (isStaff) {
const { merchantId, merchantName, name, uuid, shopMerchantId, shopMerchantName } = userInfo
let timeBean = util.getWeekDayList(0)
let params = {
yqMerchantId: merchantId,
yqMerchantName: merchantName,
staffName: name,
staffUuid: uuid,
// shopMerchantId: shopMerchantId,
// shopMerchantName: shopMerchantName
merchantId: shopMerchantId,
merchantName: shopMerchantName,
...timeBean
}
api.staffDailyReportDetailWeeklyList(params).then(res => {
let { code, data, message } = res
if (code == 0) {
console.log(data, 'data')
// timeBean.weekDayList = timeBean.weekDayList.map((item, index) => {
// // item.weeklyList = data[index]
// item.hasDailyValue = data.includes(item.date)
// return item
// })
// timeBean
// let dateStaffPop = wx.$storage.get('dateStaffPop')
// 判断 有没有填写日报
let hasNeedReport = timeBean.weekDayList.find((item, index) => {
// item.hasDailyValue =
return !data.includes(item.date) && !item.disabled
})
console.log(hasNeedReport, 'hasNeedReport')
let nowDate = new Date().format('yyyy-MM-dd')
// let num = 0
// if (dateStaffPop?.date && nowDate == dateStaffPop?.date) {
// num = dateStaffPop?.num || 0
// num = num + 1
// } else {
// num = num + 1
// }
// num <= 2
if (hasNeedReport && isStaff) {
// if (num <= 2) {
// wx.$util.showToast('驻店日报未填写,请及时填写')
if (wx.__HAS_NOREPORT_MODAL || wx.__HAS_NOTLOGIN_MODAL) return false
wx.__HAS_NOREPORT_MODAL = true
wx.showModal({
title: '日报提醒',
content: '您有未填写的日报,请点击前往。',
showCancel: false,
// cancelText: '取消', // '取消
cancelColor: '#292D33',
confirmText: '前往填写',
confirmColor: '#347BFF',
success(res) {
if (res.confirm) {
wx.$router.go('tabWorkOrder.staffDaily', {
reportDate: hasNeedReport.date
})
}
},
complete: () => {
// 这个延迟的目的是为了避免短时间内重复弹出
// 你要是没有这个需要也可以去掉,直接把标志位改成 false 就行
setTimeout(() => {
wx.__HAS_NOREPORT_MODAL = false
}, 2000)
}
})
// }
}
// let num = hasNeedReport ? dateStaffPop?.num + 1 : dateStaffPop?.num
console.log(num)
wx.$storage.set('dateStaffPop', {
date: new Date().format('yyyy-MM-dd'),
num
})
console.log(hasNeedReport, 'hasNeedReport')
this.setData({
// weeklyList: data
// timeBean
})
} else {
wx.$util.showToast(message)
}
})
// this.setData({
// timeBean: util.getWeekDayList(this.data.selectWeek)
// })
}
},
// onRoute(options) {
// options && this.checkShowOrderPop(options)
// // options && options.resetStoreList && this.get4SStoreList()
// // 跳转工单/预约详情
// // listStatus 0 待跟进 1已升级 2战败 3待支付
// if (options?.isGoPage) {
// // status 1待跟进(有inviteRecordId跳转预约详情无跳转待跟进工单页面 微信支付跳转工单确认页面)3待支付(跳转工单确认页面)constructionFlag(已施工页面)
// let pageName = options?.status == 1 && options?.pageParams?.id ? 'tabDate.detail' : options.status == 3 || (options.status == 1 && options.selectPayType == 1) ? 'tabWorkOrder.confirmOrder' : options.constructionFlag == 'Y' && options.status != 10 ? 'tabWorkOrder.constructionOrderDetail' : 'tabWorkOrder.orderDetail'
// wx.$router.go(`${pageName}?id=${options?.pageParams?.id}&orderCode=${options?.pageParams?.orderCode}`, { ...options?.pageParams })
// }
// },
/**
* 生命周期函数--监听页面加载
*/
// onLoad: function (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
// })
// this.setData({
// isStaff: app.globalData.isStaff
// })
// this.get4SStoreList()
// },
/**
* 生命周期函数--监听页面初次渲染完成
*/
......
......@@ -226,6 +226,8 @@ Page({
})
orderObj[name] = arr
})
orderObj.isAdmin = role == 'super' ? true : false
orderObj.oprBy = orderObj.staffUuid
// console.log(orderObj, 'orderObj')
wx.$util.showLoading()
api
......@@ -572,12 +574,12 @@ Page({
wx.$router.back()
},
initData(userInfo) {
let { orderObj, reportDate, role } = this.data
let { orderObj, reportDate, role, approvedSource } = this.data
// console.log(this.data, 'initData');
// const { sceneType, } = userInfo
// 根据不同角色做页面回显
const isStaff = app.globalData.isStaff || false
console.log(reportDate, 'reportDate');
const isStaff = app.globalData.isStaff || orderObj.approvedSource == '3' || false
console.log(isStaff, reportDate, 'reportDate');
if (reportDate) {
var dateisSunday = new Date(reportDate);
this.setData({
......@@ -593,14 +595,14 @@ Page({
this.setReportDate()
setTimeout(() => {
// console.log(this.data.role, this.data, 'roleOther');
if (this.data.role == 'other') {
if (this.data.role == 'other' || approvedSource == '3') {
this.getStaffReport()
this.getStaffDailyReportDetailWeeklyList()
return
}
})
if (isStaff) {
if (isStaff && approvedSource != '3') {
// console.log(userInfo, 'userInfo');
const { merchantId, merchantName, name, uuid, shopMerchantId, shopMerchantName } = userInfo
this.setData({
......@@ -691,6 +693,14 @@ Page({
}
}
// 初始化日期
if (options.hasOwnProperty('reportDate')) {
this.setData({
reportDate: options.reportDate
})
this.initData(wx.$util.getUserInfo())
}
console.log(options, 'options,onLoad');
this.setData({
flag: true
......@@ -699,8 +709,15 @@ Page({
let { orderObj } = this.data
// console.log(options.hasOwnProperty('approvedSource'), options, 'approvedSource');
if (options.hasOwnProperty('approvedSource')) {
let role = ''
if (options.approvedSource == '3') {
role = 'staff'
} else {
role = 'ohter'
}
this.setData({
role: 'other',
role,
approvedSource: options.approvedSource,
merchantRange: [{ merchantName: options.merchantName, merchantId: options.merhchantid }],
orderObj: {
......@@ -712,6 +729,7 @@ Page({
}
},
onRoute(options) {
console.log(options, 'staffoptions');
if (options?.scene) {
let id = decodeURIComponent(options.scene).split('=')[1]
// return
......@@ -738,8 +756,15 @@ Page({
}
if (options.hasOwnProperty('approvedSource')) {
let role = ''
if (options.approvedSource == '3') {
role = 'staff'
} else {
role = 'ohter'
}
this.setData({
role: 'other',
role,
approvedSource: options.approvedSource,
merchantRange: [{ merchantName: options.merchantName, merchantId: options.merhchantid }],
orderObj: {
......@@ -749,9 +774,6 @@ Page({
reportDate: options.reportDate
}, this.initData({}))
}
},
/**
......
......@@ -60,10 +60,10 @@ const domain_items = {
ip: {
// dj: 'http://192.168.1.165:8292',
// dj: 'http://192.168.1.104:8292', //叶立庆
// dj: 'http://192.168.1.169:8292',//蔡远明
dj: 'http://192.168.1.169:8292',//蔡远明
// dj: 'http://192.168.1.174:8292',//范富荣
// dj: 'http://192.168.1.88:8292', //周杭
dj: 'http://192.168.1.116:8292',//陈希
// dj: 'http://192.168.1.116:8292',//陈希
// dj:'http://192.168.2.59:8292/',//周立明
// scrm: 'http://192.168.1.165:8292'
scrm: 'https://scrm.dev.glsx.com.cn'
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!