Commit 7c47db8a by 张立顺

Merge branch 'develop' into 'master'

Develop

See merge request !38
2 parents e3950b7b ba9b21ff
Showing 76 changed files with 1283 additions and 526 deletions
...@@ -45,7 +45,7 @@ module.exports = { ...@@ -45,7 +45,7 @@ module.exports = {
/** 根据商户号获取员工列表信息(转化人员) */ /** 根据商户号获取员工列表信息(转化人员) */
getConversionEmployeeList(data) { getConversionEmployeeList(data) {
// 0->2.0 1->1.1 2->1.2 3->1.3 场景对应 // 0->2.0 1->1.1 2->1.2 3->1.3 场景对应
data.sceneList = [1] // data.sceneList = [1]
return api.post('dj.api.smartcarlife.employee.getByMerchantId', data) return api.post('dj.api.smartcarlife.employee.getByMerchantId', data)
}, },
/** 根据园区店商户号获取绑定4S店列表 */ /** 根据园区店商户号获取绑定4S店列表 */
...@@ -143,7 +143,7 @@ module.exports = { ...@@ -143,7 +143,7 @@ module.exports = {
return api.post('dj.api.smartcarlife.select.openScene.info', data) return api.post('dj.api.smartcarlife.select.openScene.info', data)
}, },
// 获取2.0场景园区店下的4s店 // 获取园区店下的4s店
getSceneMerchantRefStoreList(data) { getSceneMerchantRefStoreList(data) {
return api.post('dj.api.scenemerchantref.query4SRefByYqShop', data) return api.post('dj.api.scenemerchantref.query4SRefByYqShop', data)
} }
......
/**
*
0本地
1开发
2测试
3生产环境
*/
const accountInfo = wx.getAccountInfoSync()
const systemInfo = wx.getSystemInfoSync()
// console.log(systemInfo);
// console.log(accountInfo.miniProgram.envVersion)
//手动控制体验版环境的请求 true就依据下面index false就默认为2
const manual = false
const release = false
let index = 1
// 判断小程序环境
// develop:开发版(正常开发工具,测试时)
// trial:体验版
// release:正式版
// console.log( systemInfo.platform);
// console.log(accountInfo.miniProgram.envVersion);
if (systemInfo.platform != 'devtools') {
switch (accountInfo.miniProgram.envVersion) {
case 'develop':
// this.globalData.url = 'http://192.168.0.252:3000/api'; //
break
case 'trial':
index = manual ? index : 2
break
case 'release':
index = release ? index : 3
break
default:
index = 3
break
}
}
// console.log(index);
const secretKey_items = {
ip: {
appKey: '48e5e13229b82c1b4e6e8c96151f0637',
secret: 'c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b'
},
dev: {
appKey: '48e5e13229b82c1b4e6e8c96151f0637',
secret: 'c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b'
},
uat: {
appKey: '48e5e13229b82c1b4e6e8c96151f0637',
secret: 'c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b'
},
prod: {
appKey: 'd7ffc3346fc9a45bccaaa35300d59022',
secret: '4bc07f8868374c49a4661d603377e3106fc9a45bccaaa353'
},
preRelease: {
appKey: 'd7ffc3346fc9a45bccaaa35300d59022',
secret: '4bc07f8868374c49a4661d603377e3106fc9a45bccaaa353'
}
}
const domain_items = {
// ip: 'http://192.168.2.59:8292',
// ip: 'http://192.168.1.129:8392',
// ip: 'http://192.168.1.129:8292',
ip: 'http://192.168.1.165:8292',
// ip: 'http://192.168.2.3:8292',
dev: 'https://dj.dev.glsx.com.cn',
uat: 'https://dj.test.glsx.com.cn',
// uat: 'https://dj.beta.glsx.com.cn',
prod: 'https://dj.glsx.com.cn',
preRelease: 'https://dj.beta.glsx.com.cn'
}
const target = ['ip', 'dev', 'uat', 'prod', 'preRelease']
// console.log(domain_items[target[index]]);
module.exports = {
domain: domain_items[target[index]],
secretKey: secretKey_items[target[index]]
}
...@@ -10,7 +10,7 @@ import util from './utils/util.js' ...@@ -10,7 +10,7 @@ import util from './utils/util.js'
import { Storage } from '~/utils/cache/storage' import { Storage } from '~/utils/cache/storage'
const $Storage = new Storage() const $Storage = new Storage()
import { setSystem_info } from '~/utils/cache/storageApi' import { setSystem_info } from '~/utils/cache/storageApi'
// const accountInfo = wx.getAccountInfoSync()
import { checkYqdSuper, setConfigInfo, checkScene } from '~/store/index' import { checkYqdSuper, setConfigInfo, checkScene } from '~/store/index'
import eventbus from './utils/eventbus' import eventbus from './utils/eventbus'
App({ App({
...@@ -36,21 +36,57 @@ App({ ...@@ -36,21 +36,57 @@ App({
// 如果是带参数的小程序码进入 会处理后把参数存到wx.$SCENE // 如果是带参数的小程序码进入 会处理后把参数存到wx.$SCENE
// options.query.scene = 2 //调试用 // options.query.scene = 2 //调试用
// console.log(options, 'options') // console.log(options, 'options')
// orderCode=2208241419054111&merchantId=44209480&customerName=123&page=createOrder
// let mockOptions = {
// query: {
// // orderCode: 2208241419054111,
// // merchantId: 44209480,
// customerName: '%E7%83%82%EC%A7%84%ED%9D%99%E6%B3%A5',
// page: 'createArchives'
// }
// }
// options = mockOptions
if (options) { if (options) {
let query = options.query
if (query) {
// 解码
for (const key in query) {
query[key] = decodeURIComponent(query[key])
}
options.query = query
}
console.log('options', options)
let res = checkScene(options) let res = checkScene(options)
// console.log(res, 'res')
// 如果需要重新登录 // 如果需要重新登录
res && this.login(true) res && this.login(true, res)
} }
}, },
login(relogin) { login(relogin, context) {
console.log(relogin, 'relogin')
let that = this
// 清空多账号信息 // 清空多账号信息
if (relogin) { if (relogin) {
this.globalData.yqdInfo = {} wx.showModal({
this.globalData.YQorderSetting = '' title: '温馨提示',
content: context || '登录过期,请重新登录。',
showCancel: false,
confirmText: '去登录',
confirmColor: '#3582EE',
success(res) {
if (res.confirm) {
that.globalData.yqdInfo = {}
that.globalData.YQorderSetting = ''
util.removeStorage() util.removeStorage()
wx.$relogin = relogin wx.$relogin = relogin
router.reLaunch('pages.wxLogin')
}
} }
})
} else {
router.reLaunch('pages.wxLogin') router.reLaunch('pages.wxLogin')
}
}, },
globalData: { globalData: {
......
...@@ -87,6 +87,7 @@ Component({ ...@@ -87,6 +87,7 @@ Component({
/**转化人员 & 销售人员*/ /**转化人员 & 销售人员*/
getConversionEmployeeList(merchantId, type) { getConversionEmployeeList(merchantId, type) {
let target = type == 0 ? 'form.conversionEmployeeList.data' : 'form.salesmanList.data' let target = type == 0 ? 'form.conversionEmployeeList.data' : 'form.salesmanList.data'
if (merchantId) { if (merchantId) {
// let { // let {
// userInfo: { // userInfo: {
...@@ -96,7 +97,8 @@ Component({ ...@@ -96,7 +97,8 @@ Component({
api api
.getConversionEmployeeList({ .getConversionEmployeeList({
// channelType, // channelType,
merchantId merchantId,
sceneList: type == 1 ? [1] : ''
}) })
.then(res => { .then(res => {
wx.hideLoading() wx.hideLoading()
...@@ -205,11 +207,13 @@ Component({ ...@@ -205,11 +207,13 @@ Component({
/**4S店列表 */ /**4S店列表 */
getServiceMerchantList(merchantId) { getServiceMerchantList(merchantId) {
if (merchantId) { if (merchantId) {
api let userInfo = wx.$util.getUserInfo()
.getServiceMerchantList({ let params = {
merchantId merchantId,
}) sceneType: 1,
.then(res => { staffUUID: userInfo.uuid
}
api.getSceneMerchantRefStoreList(params).then(res => {
let { code, data, message } = res let { code, data, message } = res
let arr = [] let arr = []
if (code == 0) { if (code == 0) {
......
// components/GlCell/GlCell.js // components/GlCell/GlCell.js
Component({ Component({
options: {
styleIsolation: 'apply-shared'
},
/** /**
* 组件的属性列表 * 组件的属性列表
*/ */
......
<view class='cell-box'> <view class='cell-box'>
<view class="cell {{cellHeight?'cellHeight': ''}} {{border?'border':''}}" bindtap="click"> <view class="cell {{cellHeight?'cellHeight': ''}} {{border?'border':''}}" bindtap="click">
<view class='cell-label' style="width:{{labelWidth}};{{labelStyle}}" bindtap="titleClick"> <view class='cell-label title-style' style="width:{{labelWidth}};{{labelStyle}}" bindtap="titleClick">
<text wx:if='{{required&&requiredBefore}}' class='required'>*</text> <text wx:if='{{required&&requiredBefore}}' class='required'>*</text>
{{label||'标题'}} {{label||'标题'}}
<text wx:if='{{required&&requiredAfter}}' class='required'>*</text> <text wx:if='{{required&&requiredAfter}}' class='required'>*</text>
......
...@@ -13,25 +13,44 @@ Component({ ...@@ -13,25 +13,44 @@ Component({
type: Object, type: Object,
observer: function (n) { observer: function (n) {
// console.log('userInfo', n) // console.log('userInfo', n)
if (n) { if (n && this.data.type != 1) this.getMerchantList()
this.getMerchantList()
}
} }
}, },
orderObj: {
type: Object
},
type: Number, //1.销售顾问,2.转化人员 type: Number, //1.销售顾问,2.转化人员
// order:Object, // order:Object,
isDefault: Boolean, isDefault: Boolean,
oderType: String oderType: String
}, },
// 处理先要调用销售顾问接口再调用转化人员接口的问题
observers: {
'orderObj.sellerUserId': function (id) {
// console.log(id)
// console.log('orderObj.sellerUserId', this.data.orderObj)
let { type, selesFirstRender } = this.data
// console.log(type == 1 && selesFirstRender)
// selesFirstRender
if (type == 1 && id) {
this.getMerchantList()
// this.setData({
// selesFirstRender: false
// })
}
}
},
/** /**
* 组件的初始数据 * 组件的初始数据
*/ */
data: { data: {
merchantList: [], merchantList: [],
selesList: [], selesList: [],
orderObj: {}, orderObj: {},
isFirst: true, isFirst: true,
selesFirstRender: true,
orderSellerInfo: '' orderSellerInfo: ''
}, },
...@@ -44,8 +63,9 @@ Component({ ...@@ -44,8 +63,9 @@ Component({
moreMerchant: !this.data.moreMerchant moreMerchant: !this.data.moreMerchant
}) })
}, },
getMerchantList(refresh) { getMerchantList() {
let { userInfo, type } = this.data let { userInfo, type } = this.data
// console.log('type', type)
let thisPage = wx.$router.getPageInstance() let thisPage = wx.$router.getPageInstance()
// console.log(thisPage.data) // console.log(thisPage.data)
// console.log(thisPage) // console.log(thisPage)
...@@ -55,11 +75,18 @@ Component({ ...@@ -55,11 +75,18 @@ Component({
let isSellerInfo, orderSellerInfo let isSellerInfo, orderSellerInfo
// console.log('orderObj', orderObj) // console.log('orderObj', orderObj)
let callBackName = type == 1 ? 'getServiceMerchantList' : 'getYQList' let callBackName = type == 1 ? 'getSceneMerchantRefStoreList' : 'getYQList'
// debugger
// if (type == 1) {
// debugger
// console.log('orderObj', orderObj)
// }
api[callBackName]( api[callBackName](
type == 1 type == 1
? { ? {
merchantId: userInfo.merchantId merchantId: userInfo.merchantId,
sceneType: 1,
staffUUID: orderObj.sellerUserId
} }
: {} : {}
).then(async res => { ).then(async res => {
...@@ -111,6 +138,7 @@ Component({ ...@@ -111,6 +138,7 @@ Component({
} }
let targetName = type == 1 ? 'orderObj.merchantName' : 'orderObj.sellerMerchantName' let targetName = type == 1 ? 'orderObj.merchantName' : 'orderObj.sellerMerchantName'
let targetId = type == 1 ? 'orderObj.merchantId' : 'orderObj.sellerMerchantId' let targetId = type == 1 ? 'orderObj.merchantId' : 'orderObj.sellerMerchantId'
// let isShowSelesBox = type == 3 ? true : false
this.setData( this.setData(
{ {
[targetId]: merchantId, [targetId]: merchantId,
...@@ -133,7 +161,8 @@ Component({ ...@@ -133,7 +161,8 @@ Component({
let { orderObj } = thisPage.data let { orderObj } = thisPage.data
api api
.getConversionEmployeeList({ .getConversionEmployeeList({
merchantId merchantId,
sceneList: type == 1 ? [1] : ''
}) })
.then(async res => { .then(async res => {
wx.$util.hideLoading() wx.$util.hideLoading()
...@@ -264,7 +293,7 @@ Component({ ...@@ -264,7 +293,7 @@ Component({
[name]: '', [name]: '',
[id]: '' [id]: ''
}) })
console.log(orderObj) // console.log(orderObj)
wx.$util.showLoading('切换中...') wx.$util.showLoading('切换中...')
this.getConversionEmployeeList(item.merchantId, true) this.getConversionEmployeeList(item.merchantId, true)
}, },
...@@ -304,7 +333,7 @@ Component({ ...@@ -304,7 +333,7 @@ Component({
} }
} }
console.log(result) // console.log(result)
// let userInfo = util.getUserInfo() // let userInfo = util.getUserInfo()
// // 保存销售勾选做回显 // // 保存销售勾选做回显
// oderType != 'recorder' && util.setSellerInfo({ ...this.data.orderObj, subLoginMechantId: userInfo.subLoginUser.merchantId }) // oderType != 'recorder' && util.setSellerInfo({ ...this.data.orderObj, subLoginMechantId: userInfo.subLoginUser.merchantId })
......
// components/OrderPopup/OrderPopup.js // components/OrderPopup/OrderPopup.js
// import qrcode from '../../utils/wxqrcode'
import qrcode from '~/utils/lib/wxqrcode' import qrcode from '~/utils/lib/wxqrcode'
import api from '../../api/api.js' import api from '../../api/api.js'
Component({ Component({
......
...@@ -83,7 +83,7 @@ ...@@ -83,7 +83,7 @@
value="{{textareaValue}}" value="{{textareaValue}}"
bindinput="blur" bindinput="blur"
bindblur="blur" bindblur="blur"
maxlength="30" maxlength="100"
placeholder="请输入内容" /> placeholder="请输入内容" />
</view> </view>
<view class="shortcut-list"> <view class="shortcut-list">
......
// components/authSetting/authSetting.js
// const restapi = require('../../utils/restapi.js')
// var appInstance = getApp()
Component({
/**
* 组件的属性列表
*/
properties: {
// auth: {
// type: Boolean,
// value: true,
// observer: function (newVal, oldVal) {
// this.getHeadImage()
// }
// },
// type: {
// type: Boolean,
// value: true
// },
// special: {
// type: Boolean,
// value: false
// },
// index: {
// type: Boolean,
// value: false
// }
},
/**
* 组件的初始数据
*/
data: {
agree: false
// auth: true,
// type: true,
// appLogo: '',
// appName: '',
// merchantName: '',
// gender: 1
},
ready() {
// this.getHeadImage()
},
/**
* 组件的方法列表
*/
methods: {
choose() {
this.setData({
agree: !this.data.agree
})
this.triggerEvent('choose', this.data.agree)
},
jump(e) {
console.log(e)
let { url } = e.currentTarget.dataset
const baseUrl = 'https://img01.glsx.com.cn/weapp/resource/saas/scrm/html/'
const path = `${baseUrl}${url}.html`
// private user
wx.navigateTo({
url: `/pages/webView/webView?path=${encodeURIComponent(path)}`
})
// var globalData = appInstance.globalData.extConfig
// restapi.getMerchantBussiness(globalData.merchantId, function (res) {
// console.log(res);
// if (res.returnCode == '0') {
// let path = `https://dj.glsx.com.cn/agreement/djUserPolicy.html?merchantName=${globalData.merchantName}&phone=${res.data.phone}`
// wx.navigateTo({
// url: `/pages/webpage/webpage?path=${encodeURIComponent(path)}`
// })
// }
// }, function (res) {
// console.log(res);
// })
},
noScroll() {}
}
})
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file \ No newline at end of file
<view class='tips'>
<view class='choose-box' bindtap="choose">
<view class='icon'>
<image src="{{agree?'./images/ok.png':'./images/box.png'}}" class='check-img' />
</view>
</view>
阅读并同意以下协议
<!-- <text catchtap="jump" data-url="agree">《服务协议》</text> -->
<text catchtap="jump" data-url="privacy">《隐私协议》</text>
<text catchtap="jump" data-url="agreement">《用户协议》</text>
</view>
/* components/authSetting/authSetting.wxss */
.tips {
position: fixed;
width: 100%;
left: 0;
bottom: 60rpx;
font-size: 24rpx;
color: #999;
letter-spacing: 2rpx;
padding-left: 28rpx;
box-sizing: border-box;
display: flex;
align-items: center;
justify-content: center;
}
.tips text {
color: #ff600f;
}
.tips .icon {
position: absolute;
top: 50%;
left: 50%;
width: 24rpx;
height: 24rpx;
border-radius: 2rpx;
box-sizing: border-box;
transform: translate(-50%, -50%);
}
.tips .icon .check-img {
vertical-align: top;
width: 100%;
height: 100%;
}
.tips .choose-box {
width: 80rpx;
height: 80rpx;
position: relative;
}
\ No newline at end of file \ No newline at end of file
...@@ -79,7 +79,7 @@ Component({ ...@@ -79,7 +79,7 @@ Component({
if (code == '0') { if (code == '0') {
// 有二级流量方数据 添加必填二级流量方字段 // 有二级流量方数据 添加必填二级流量方字段
if (data?.length) { if (data?.length) {
if (!requiredList.includes('subShopMerchantId')) requiredList.unshift('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) {
...@@ -106,7 +106,7 @@ Component({ ...@@ -106,7 +106,7 @@ Component({
// 无二级流量方字段时 清空选择的二级流量方字段 // 无二级流量方字段时 清空选择的二级流量方字段
delete orderObj?.subShopMerchantId delete orderObj?.subShopMerchantId
delete orderObj?.subShopMerchantName delete orderObj?.subShopMerchantName
if (requiredList.includes('subShopMerchantId')) 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,
......
...@@ -10,7 +10,44 @@ ...@@ -10,7 +10,44 @@
* 2测试 * 2测试
* 3生产环境 * 3生产环境
*/ */
export let env = 2 let index = 2
const accountInfo = wx.getAccountInfoSync()
const systemInfo = wx.getSystemInfoSync()
const envName = accountInfo.miniProgram.envVersion
//手动控制体验版环境的请求 true就依据下面index false就默认为2
const manual = false
const release = false
// 判断小程序环境
// develop:开发版 trial:体验版 release:正式版
if (systemInfo.platform != 'devtools') {
switch (envName) {
case 'develop':
break
case 'trial':
index = manual ? index : 2
break
case 'release':
index = release ? index : 3
break
default:
index = 3
break
}
}
export const env = envName
export const envIndex = index
const createQuotedUrl = {
develop: `http://192.168.1.178:9528/dj-scrm-wx-work-main-zhangls/#/equityPoster?id=`,
trial: `http://frontend.test.glsx.com.cn/dj-car-boutique-work-wechat/#/equityPoster?id=`,
release: `https://dj.glsx.com.cn/dj-car-boutique-work-wechat/#/equityPoster?id=`
}
const target = ['ip', 'develop', 'trial', 'release', 'preRelease']
// 报价单图片地址
export const quotedImgUrl = createQuotedUrl[target[envIndex]]
// 配置预发布的小程序aapId // 配置预发布的小程序aapId
// export const preReleaseAppId = 'wx24ebae5768e74138' // export const preReleaseAppId = 'wx24ebae5768e74138'
......
{ {
"dependencies": { "dependencies": {
"@vant/weapp": "^1.10.14", "@vant/weapp": "^1.10.14",
"bignumber.js": "^9.1.1",
"rfdc": "^1.3.0" "rfdc": "^1.3.0"
} }
} }
...@@ -61,9 +61,18 @@ module.exports = { ...@@ -61,9 +61,18 @@ module.exports = {
let params = data || {} let params = data || {}
return api.post('dj.api.smartcarlife.vehicle.damage.upgrade.quotation.generate', params) return api.post('dj.api.smartcarlife.vehicle.damage.upgrade.quotation.generate', params)
}, },
/** 更新报价单状态 */ /** 更新报价单状态 */
updateOrderStatus(data) { updateOrderStatus(data) {
let params = data || {} let params = data || {}
return api.post('dj.api.smartcarlife.vehicle.damage.upgrade.quotation.status.update', params) return api.post('dj.api.smartcarlife.vehicle.damage.upgrade.quotation.status.update', params)
},
/** 车损报价单权益价格计算 */
priceCounter(data) {
return api.post('dj.api.smartcarlife.vehicle.damage.upgrade.quotation.equity.price.counter', data)
},
/**改变支付订单状态 */
createPayOrder(data) {
return api.post('dj.api.smartcarlife.payOrder.create', data)
} }
} }
...@@ -11,6 +11,13 @@ ...@@ -11,6 +11,13 @@
wx:if="{{textNameObj.editName}}"> wx:if="{{textNameObj.editName}}">
{{textNameObj.editName}} {{textNameObj.editName}}
</view> </view>
<view
class="btn editBtn"
data-name="editOrderName"
bindtap="btnTap"
wx:if="{{textNameObj.editOrderName}}">
{{textNameObj.editOrderName}}
</view>
<view class="btn cancelBtn" data-name="cancel" bindtap="btnTap">{{textNameObj.cancelName}}</view> <view class="btn cancelBtn" data-name="cancel" bindtap="btnTap">{{textNameObj.cancelName}}</view>
</view> </view>
...@@ -33,7 +33,18 @@ Page({ ...@@ -33,7 +33,18 @@ Page({
getStoreList(e) { getStoreList(e) {
// 获取园区店下的4s店数据 超管拉全部数据 // 获取园区店下的4s店数据 超管拉全部数据
let { userInfo } = this.data let { userInfo } = this.data
get4SStoreList({ yqMerchantId: userInfo?.isSuper ? '' : userInfo?.merchantId, merchantName: e?.detail.value }) // {
// merchantId: options.yqMerchantId,
// scene: 0,
// merchantName: options.merchantName
// }
let params = {
merchantId: userInfo?.isSuper ? '' : userInfo?.merchantId,
scene: 0,
merchantName: e?.detail.value,
staffUUID: userInfo?.isSuper ? '' : userInfo?.uuid
}
get4SStoreList(params)
.then(result => { .then(result => {
userInfo = wx.$util.getUserInfo() userInfo = wx.$util.getUserInfo()
let selectStroeIndex = let selectStroeIndex =
......
...@@ -67,7 +67,7 @@ ...@@ -67,7 +67,7 @@
<view class="item-footer"> <view class="item-footer">
<view>{{item.createdDate}}</view> <view>{{item.createdDate}}</view>
<!-- 超管isSuper/商户类型 userType 1账号不可操作 --> <!-- 超管isSuper/商户类型 userType 1账号不可操作 -->
<block wx:if="{{!userInfo.isSuper && userInfo.userType == 2}}"> <block wx:if="{{(!userInfo.isSuper && userInfo.userType == 2)||(item.orderStatus==2) }}">
<view wx:if="{{item.orderStatus == '2'}}" class="order-btn default-btn" bindtap="handlePreviewContract" data-target="{{item}}">{{btnTxt[item.orderStatus]}}</view> <view wx:if="{{item.orderStatus == '2'}}" class="order-btn default-btn" bindtap="handlePreviewContract" data-target="{{item}}">{{btnTxt[item.orderStatus]}}</view>
<view wx:else class="order-btn" bindtap="handleRecordOrder" data-target="{{item}}">{{btnTxt[item.orderStatus]}}</view> <view wx:else class="order-btn" bindtap="handleRecordOrder" data-target="{{item}}">{{btnTxt[item.orderStatus]}}</view>
</block> </block>
......
// packageEquity/pages/carQuotation/CarQuotationPay/CarQuotationPay.js // packageEquity/pages/carQuotation/CarQuotationPay/CarQuotationPay.js
import { getOrderDetail, updateOrderStatus, getQuotationInfoById } from '../../../api' import { getOrderDetail, updateOrderStatus, getQuotationInfoById, createPayOrder } from '../../../api'
import { createQrcodeImage } from '~/api/api' import { createQrcodeImage } from '~/api/api'
import { setWebSocket } from '~/store/index' import qrcode from '~/utils/lib/wxqrcode'
// const imgUrl = {
// wechat: '/packageEquity/images/pay/wechat.png'
// }
// import { setWebSocket } from '~/store/index'
let time = null let time = null
Page({ Page({
/** /**
...@@ -10,11 +14,62 @@ Page({ ...@@ -10,11 +14,62 @@ Page({
data: { data: {
orderCode: '', orderCode: '',
wxqrcode: '', wxqrcode: '',
orderDetail: {} posqrcode: '',
orderDetail: {},
popPayShow: true,
payType: {
1: {
name: '微信支付',
imgUrl: '/packageEquity/images/wechat.png'
},
3: {
name: 'pos机支付',
imgUrl: '/packageEquity/images/posMachine.png'
}
},
selectPayType: 1
},
async changePayType(e) {
console.log(e)
// pos支付
let { posqrcode } = this.data
console.log('pos支付')
let { value } = e.currentTarget.dataset
console.log(value)
// createQRCode(text) {
this.setData({
selectPayType: value
})
if (value == 3 && !posqrcode) {
let { orderCode } = this.data
let result = await createPayOrder({
orderCode,
payType: 3
})
console.log(result)
let { code, data, message } = result
if (code == 0) {
// console.log(text)
let size = 0
try {
const info = wx.getSystemInfoSync()
let scale = info.windowWidth / 750 //不同屏幕下QRcode的适配比例;设计稿是750宽
let width = 300 * scale
size = width
} catch (e) {
size = 150
}
let _img = qrcode.createQrCodeImg(data.outTradeNo, {
size: parseInt(size)
})
this.setData({
posqrcode: _img
})
}
}
}, },
// 生成小程序码 // 生成小程序码
createWxQrcode() { createWxQrcode() {
const accountInfo = wx.getAccountInfoSync()
let _this = this let _this = this
let oParams = {} let oParams = {}
oParams.appId = 'wx06d1198e751435d1' oParams.appId = 'wx06d1198e751435d1'
...@@ -22,7 +77,6 @@ Page({ ...@@ -22,7 +77,6 @@ Page({
oParams.path = 'packagesPayment/pages/payment/index' oParams.path = 'packagesPayment/pages/payment/index'
oParams.scene = `orderCode=${_this.data.orderCode}&workWxSessionId=${wx.getStorageSync('dj_boutique_sessionId')}` oParams.scene = `orderCode=${_this.data.orderCode}&workWxSessionId=${wx.getStorageSync('dj_boutique_sessionId')}`
oParams.channelType = 1 oParams.channelType = 1
// oParams.env = accountInfo.miniProgram.envVersion
// B端小程序调用接口生成领券码时,传参userId用uuid,类型由int变string // B端小程序调用接口生成领券码时,传参userId用uuid,类型由int变string
createQrcodeImage(oParams).then(res => { createQrcodeImage(oParams).then(res => {
console.log(res.data) console.log(res.data)
...@@ -31,8 +85,8 @@ Page({ ...@@ -31,8 +85,8 @@ Page({
wxqrcode: res.data wxqrcode: res.data
}) })
// 轮询订单状态 // 轮询订单状态
this.getDetail()
}) })
this.getDetail()
}, },
createQRCode(text) { createQRCode(text) {
console.log(text) console.log(text)
...@@ -147,7 +201,7 @@ Page({ ...@@ -147,7 +201,7 @@ Page({
onRoute(options) { onRoute(options) {
// console.log(options = 19) // console.log(options = 19)
let { data, id } = options let { data, id } = options
// id = 26 // id = 14
this.setData({ id }) this.setData({ id })
this.getQuotationInfoById() this.getQuotationInfoById()
}, },
...@@ -155,7 +209,7 @@ Page({ ...@@ -155,7 +209,7 @@ Page({
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad(options) { onLoad(options) {
setWebSocket() // setWebSocket()
}, },
/** /**
......
{ {
"usingComponents": { "usingComponents": {
"order-detail": "../../../components/orderInfoCom/orderInfoCom" "order-detail": "../../../components/orderInfoCom/orderInfoCom",
"popup-select-pay": "../components/PopupSelectPay/PopupSelect"
}, },
"navigationBarTitleText": "订单支付" "navigationBarTitleText": "订单支付"
} }
...@@ -7,9 +7,35 @@ page { ...@@ -7,9 +7,35 @@ page {
// background-color: #f5f5f5; // background-color: #f5f5f5;
padding: 20rpx; padding: 20rpx;
.payType {
display: flex;
margin: 44rpx 0;
.payIcon {
width: 42rpx;
height: 42rpx;
margin-right: 20rpx;
}
}
.arrow {
position: absolute;
top: 50%;
width: 72rpx;
height: 72rpx;
}
.right {
right: 40rpx;
}
.left {
left: 40rpx;
}
.qrCodeCom { .qrCodeCom {
box-sizing: border-box; box-sizing: border-box;
padding: 32rpx 40rpx; padding: 32rpx 40rpx 80rpx;
position: relative; position: relative;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
...@@ -53,7 +79,7 @@ page { ...@@ -53,7 +79,7 @@ page {
width: 430rpx; width: 430rpx;
height: 430rpx; height: 430rpx;
background: #FFFFFF; background: #FFFFFF;
margin: 110rpx 0 50rpx; margin: 0 0 50rpx;
// margin-bottom: 20rpx; // margin-bottom: 20rpx;
} }
......
<!-- packageEquity/pages/carQuotation/CarQuotationPay/CarQuotationPay.wxml --> <!-- packageEquity/pages/carQuotation/CarQuotationPay/CarQuotationPay.wxml -->
<view class="OrderInfoPay"> <view class="OrderInfoPay">
<view class="qrCodeCom"> <view class="qrCodeCom">
<!-- <gl-image src="../../../images/waitIcon.png" /> -->
<view class="title"> <view class="title">
<image <image
show-menu-by-longpress show-menu-by-longpress
...@@ -13,14 +12,28 @@ ...@@ -13,14 +12,28 @@
<view class="label">待支付</view> <view class="label">待支付</view>
<view class="price">总保费{{orderDetail.totalPrice}}元/年</view> <view class="price">总保费{{orderDetail.totalPrice}}元/年</view>
</view> </view>
<!-- <image src="" mode="scaleToFill|aspectFit|aspectFill|widthFix" binderror="" bindload=""></image> --> <view class="payType">
<image class="payIcon" src="{{payType[selectPayType].imgUrl}}" />
<view class="payName">{{payType[selectPayType].name}}</view>
</view>
<image
wx:if="{{selectPayType==3}}"
data-value="1"
bindtap="changePayType"
src="/packageEquity/images/arrow-left.png"
class="arrow left" />
<image <image
class="qrCode" class="qrCode"
mode="scaleToFill" mode="scaleToFill"
src="{{wxqrcode}}" src="{{selectPayType==1?wxqrcode:posqrcode}}"
binderror="" binderror=""
bindload="" /> bindload="" />
<!-- <view>{{wxqrcode}}</view> --> <image
wx:if="{{selectPayType==1}}"
data-value="3"
bindtap="changePayType"
src="/packageEquity/images/arrow-right.png"
class="arrow right" />
<view class="MerchantName">{{orderDetail.merchantName||''}}</view> <view class="MerchantName">{{orderDetail.merchantName||''}}</view>
<view class="bg" /> <view class="bg" />
</view> </view>
...@@ -48,4 +61,5 @@ ...@@ -48,4 +61,5 @@
</view> </view>
</view> </view>
</view> </view>
<!-- <popup-select-pay show="{{popPayShow}}" bindconfirm="changePayType" /> -->
...@@ -6,6 +6,9 @@ import carLifeApi from '~/packageEquity/carEquityApi' ...@@ -6,6 +6,9 @@ import carLifeApi from '~/packageEquity/carEquityApi'
const defaultLabelWidth = '140rpx' const defaultLabelWidth = '140rpx'
// import api from '~/api/api' // import api from '~/api/api'
Component({ Component({
options: {
styleIsolation: 'apply-shared'
},
/** /**
* 组件的属性列表 * 组件的属性列表
*/ */
......
...@@ -16,6 +16,15 @@ ...@@ -16,6 +16,15 @@
overflow: hidden; overflow: hidden;
} }
.pickerCell {
.cell-label {
font-weight: 500;
font-size: 32rpx;
color: #222222;
}
}
.employeeBox { .employeeBox {
box-shadow: 0 6rpx 16rpx 0 #cdcdd159; box-shadow: 0 6rpx 16rpx 0 #cdcdd159;
border-radius: 16rpx; border-radius: 16rpx;
...@@ -30,6 +39,8 @@ ...@@ -30,6 +39,8 @@
display: flex; display: flex;
} }
.title { .title {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
...@@ -79,7 +90,7 @@ ...@@ -79,7 +90,7 @@
color: #B6B6B8; color: #B6B6B8;
} }
.arrow { .pickerArrow {
width: 28rpx; width: 28rpx;
height: 26rpx; height: 26rpx;
margin-top: 26rpx; margin-top: 26rpx;
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
border border
valueAlign="right" valueAlign="right"
label="推荐人" label="推荐人"
class="pickerCell"
labelWidth="{{defaultLabelWidth}}"> labelWidth="{{defaultLabelWidth}}">
<picker <picker
bindchange="handleSalesChange" bindchange="handleSalesChange"
...@@ -12,7 +13,7 @@ ...@@ -12,7 +13,7 @@
range="{{employeeList}}" range="{{employeeList}}"
range-key="staffName"> range-key="staffName">
<view class="picker"> <view class="picker">
<image class="arrow" src="/components/images/arrow-x.png" /> <image class="pickerArrow" src="/components/images/arrow-x.png" />
<view class="text-hide" wx:if="{{orderInfo.referrerId }}">{{orderInfo.referrer }}</view> <view class="text-hide" wx:if="{{orderInfo.referrerId }}">{{orderInfo.referrer }}</view>
<text class="placeholder" wx:else>请选择</text> <text class="placeholder" wx:else>请选择</text>
</view> </view>
......
...@@ -106,6 +106,7 @@ Component({ ...@@ -106,6 +106,7 @@ Component({
this.setData({ this.setData({
show: false show: false
}) })
this.triggerEvent('confirm')
} }
} }
}) })
...@@ -227,6 +227,7 @@ Component({ ...@@ -227,6 +227,7 @@ Component({
this.setData({ this.setData({
show: false show: false
}) })
this.triggerEvent('confirm')
} }
} }
}) })
// components/CarBrands/CarBrands.js
// import api from '../../api/api.js'
import { optionsSelect } from '../constant/stepData'
Component({
/**
* 组件的属性列表
*/
properties: {
show: {
type: Boolean,
observer: function (n) {
if (n) {
// console.log(n)
// n & this.initOptions()
}
}
}
},
/**
* 组件的初始数据
*/
data: {
// orderInfo: {},
optionsObj: {
name: '支付方式',
height: '450rpx'
// optionsList: [
// {
// value: '微信支付'
// },
// {
// value: 'pos支付'
// },
// ]
},
optionsList: [
{
value: 1,
label: '微信支付',
active: true
},
{
value: 3,
label: 'pos支付'
}
]
},
pageLifetimes: {
attached: function () {
// 在组件实例进入页面节点树时执行
// console.log('attached', attached)
// this.initOptions()
},
show: function () {},
hide: function () {}
},
/**
* 组件的方法列表
*/
methods: {
choose(e) {
let { item, index } = e.currentTarget.dataset
console.log(item, index)
let { optionsList } = this.data
optionsList = optionsList.map(item => {
item.active = false
return item
})
optionsList[index].active = true
this.setData({
optionsList
})
},
confirm() {
// let { attrname, attrtype } = this.data.popObj
let { optionsList } = this.data
let flag = optionsList.find(item => {
return item.active
})
if (!flag) {
return wx.$util.showToast('请选择')
}
if (flag.value == 3) {
this.triggerEvent('confirm', flag)
}
this.setData({
show: false
})
}
}
})
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file \ No newline at end of file
<popup
title="{{optionsObj.name}}"
show="{{show}}"
bindconfirm="confirm"
height="{{optionsObj.height}}">
<view class="box">
<block
wx:for="{{optionsList}}"
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">
<view wx:if="{{!item.type}}">{{item.label}}</view>
<view class="icon">
<image src="../../../../images/choose.png" />
</view>
</view>
</block>
</view>
</popup>
/* components/CarBrands/CarBrands.wxss */
.label {
padding-left: 32rpx;
line-height: 88rpx;
}
.labelName {
font-size: 16px;
color: #333333;
padding-right: 20rpx;
}
.y-center {
display: flex;
align-items: center;
}
.list {
box-sizing: border-box;
height: 88rpx;
/* padding-left: 32rpx; */
padding: 0 32rpx 0 92rpx;
font-weight: 700;
border-bottom: 2rpx solid #EBEDF0;
}
.list:last-child {
border: none;
}
.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: 20rpx;
transform: translateY(-50%);
}
.customCom {
display: flex;
/* justify-content: center; */
align-items: center;
}
/* .custom-class */
.inputSty {
box-sizing: border-box;
width: 400rpx;
height: 72rpx;
margin-left: 32rpx;
padding: 16rpx 20rpx;
background: #F4F5F7;
border: 2rpx solid #EFF0F2;
border-radius: 8rpx;
}
.placeholderStyle {
font-size: 28rpx;
color: #CDCDD1;
}
.child.active .icon {
display: block;
}
\ No newline at end of file \ No newline at end of file
// packageEquity/pages/carEquity/components/SecondStep/SecondStep.js // packageEquity/pages/carEquity/components/SecondStep/SecondStep.js
import data from '../constant/stepData' import data from '../constant/stepData'
import fn from '../constant/ruleFn' import fn from '../constant/ruleFn'
import { priceCounter } from '~/packageEquity/api'
const defaultLabelWidth = '140rpx' const defaultLabelWidth = '140rpx'
Component({ Component({
options: { options: {
styleIsolation: 'shared' styleIsolation: 'apply-shared'
}, },
// behaviors: ['wx://component-export'], // behaviors: ['wx://component-export'],
attached() { attached() {
...@@ -80,7 +81,9 @@ Component({ ...@@ -80,7 +81,9 @@ Component({
popInputObj: { popInputObj: {
type: 'add' type: 'add'
}, },
showError: false showError: false,
insuranceCheck: false,
testQuotedPriceUpdate: 0
}, },
/** /**
...@@ -91,6 +94,55 @@ Component({ ...@@ -91,6 +94,55 @@ Component({
// let { activeNames } = this.data // let { activeNames } = this.data
// console.log('activeNames', activeNames) // console.log('activeNames', activeNames)
// }, // },
onChangeInsurance(e) {
console.log(e)
let { detail } = e
console.log(detail, 'detail')
if (!detail) {
return this.setData({
insuranceCheck: false
})
}
let thisPage = wx.$router.getPageInstance()
let params = thisPage.getInsurance()
let owner = thisPage.getOwnerInfo()
// const owner = wx.$util.deepClone(thisPage.data.owner)
params.owner = owner
// params.owner = owner
// params.owner.price = this.multipliedByHundred(orderInfo.owner?.price) || ''
// console.log(thisPage)
if (params.owner?.buyCarTime) {
delete params.owner.buyCarTime
}
// quotedPriceUpdate
delete params?.quotedPriceUpdate
// if (params?.quotedPriceUpdate) {
// }
console.log(params, 'params')
priceCounter(params)
.then(result => {
console.log('result', result)
let { data, code, message } = result
if (code) {
let thisPage = wx.$router.getPageInstance()
thisPage.setData({
['orderInfo.quotedPriceUpdate']: data.quotedPriceUpdate
})
this.setData({
insuranceCheck: true,
testQuotedPriceUpdate: data.quotedPriceUpdate / 100
})
} else {
wx.$util.showToast({
title: message || '获取报价失败',
icon: 'error'
})
}
})
.catch(err => {})
},
//--------自定义方法---------- //--------自定义方法----------
// 选择年份的区域,弹出弹窗框 // 选择年份的区域,弹出弹窗框
chooseYear() { chooseYear() {
...@@ -113,6 +165,12 @@ Component({ ...@@ -113,6 +165,12 @@ Component({
this.setData({ this.setData({
showYear: false showYear: false
}) })
this.cancelInsuranceCheck()
},
cancelInsuranceCheck() {
this.setData({
insuranceCheck: false
})
}, },
// 取消选择年份的弹框 // 取消选择年份的弹框
onCancel() { onCancel() {
...@@ -184,10 +242,12 @@ Component({ ...@@ -184,10 +242,12 @@ Component({
console.log(e) console.log(e)
let { name } = e.detail let { name } = e.detail
// let { attrtype, attrname, typename } = this.data.tableObj // let { attrtype, attrname, typename } = this.data.tableObj
let { showError } = this.data let { showError, insuranceCheck, orderInfo } = this.data
if (showError) return wx.$util.showToast('权益价不能小于最低权益价') if (showError) return wx.$util.showToast('权益价不能小于最低权益价')
if (name == 'confirm') { if (name == 'confirm') {
// 不是修改报价时,需要勾选保险
if (!insuranceCheck && !orderInfo.modifyEquityQuotation) return wx.$util.showToast('请先勾选保险')
this.triggerEvent('confirm') this.triggerEvent('confirm')
} else { } else {
this.triggerEvent('editSave') this.triggerEvent('editSave')
...@@ -224,6 +284,7 @@ Component({ ...@@ -224,6 +284,7 @@ Component({
thisPage.setData({ thisPage.setData({
['orderInfo' + '.' + attrtype + '.' + attrname]: value ['orderInfo' + '.' + attrtype + '.' + attrname]: value
}) })
this.cancelInsuranceCheck()
// console.log(thisPage.data) // console.log(thisPage.data)
} }
// numberFixedDigit (e) { // 固定两位小数 // numberFixedDigit (e) { // 固定两位小数
......
...@@ -9,7 +9,6 @@ ...@@ -9,7 +9,6 @@
"popup-select": "../PopupSelect/PopupSelect", "popup-select": "../PopupSelect/PopupSelect",
"popup-input": "../PopupInput/PopupInput", "popup-input": "../PopupInput/PopupInput",
"van-popup": "@vant/weapp/popup/index", "van-popup": "@vant/weapp/popup/index",
"van-datetime-picker": "@vant/weapp/datetime-picker/index",
"van-picker": "@vant/weapp/picker/index" "van-picker": "@vant/weapp/picker/index"
} }
} }
...@@ -142,9 +142,13 @@ ...@@ -142,9 +142,13 @@
width: 570rpx; width: 570rpx;
} }
} }
}
}
.field_test {
color: blue !important;
}
.incrementInfo { .incrementInfo {
box-sizing: border-box; box-sizing: border-box;
......
...@@ -183,6 +183,7 @@ ...@@ -183,6 +183,7 @@
border="{{false}}" border="{{false}}"
data-hold-keyboard data-hold-keyboard
readonly="{{true}}" readonly="{{true}}"
disabled="{{true}}"
value="{{item.payPrice}}" value="{{item.payPrice}}"
data-attrType="otherInsuranceList" data-attrType="otherInsuranceList"
data-attrName="payPrice" data-attrName="payPrice"
...@@ -267,7 +268,14 @@ ...@@ -267,7 +268,14 @@
</view> </view>
</view> </view>
<!-- bind:change="onChange" --> <!-- bind:change="onChange" -->
<van-checkbox value="{{ true }}" shape="square">请勾选增值车损险服务</van-checkbox> <van-checkbox
value="{{ insuranceCheck }}"
wx:if="{{!orderInfo.modifyEquityQuotation}}"
shape="square"
bind:change="onChangeInsurance">
请勾选增值车损险服务
</van-checkbox>
<block wx:if="{{insuranceCheck}}">
<view class="incrementInfo"> <view class="incrementInfo">
<!-- <view class="img" mode="widthFix" /> --> <!-- <view class="img" mode="widthFix" /> -->
<image class="img" src="{{orderInfo.quotationGoodsInfo.titlePictureUrl}}" /> <image class="img" src="{{orderInfo.quotationGoodsInfo.titlePictureUrl}}" />
...@@ -283,6 +291,25 @@ ...@@ -283,6 +291,25 @@
</view> </view>
</view> </view>
</view> </view>
<view class="title">增值权益价格</view>
<!-- -webkit-text-fill-color:rgb(130 127 127 / 83%); -->
<van-field
class="inputBox disabled"
border="{{false}}"
value="{{testQuotedPriceUpdate}}"
data-attrType="modifyEquityQuotation"
data-attrName="quotedPriceUpdate"
maxlength="10"
readonly
disabled
label-class="field_test"
custom-style=" background-color: #F4F5F7; "
data-type='number'>
<view slot="left-icon">
<view>¥</view>
</view>
</van-field>
</block>
<view class="equityPirce" wx:if="{{orderInfo.modifyEquityQuotation}}"> <view class="equityPirce" wx:if="{{orderInfo.modifyEquityQuotation}}">
<view class="title">增值权益价格</view> <view class="title">增值权益价格</view>
<van-field <van-field
...@@ -307,8 +334,12 @@ ...@@ -307,8 +334,12 @@
</van-collapse> </van-collapse>
<Gl-Button-Group bindbtnTap="btnTap" textNameObj="{{textNameObj}}" /> <Gl-Button-Group bindbtnTap="btnTap" textNameObj="{{textNameObj}}" />
<!-- customInput="{{customInput}}" --> <!-- customInput="{{customInput}}" -->
<popup-select show="{{popupShow}}" popObj="{{popObj}}" typeName="{{popObj.typename}}" /> <popup-select
<popup-input show="{{popupInputShow}}" popInputObj="{{popInputObj}}" /> show="{{popupShow}}"
popObj="{{popObj}}"
typeName="{{popObj.typename}}"
bindconfirm="cancelInsuranceCheck" />
<popup-input show="{{popupInputShow}}" popInputObj="{{popInputObj}}" bindconfirm="cancelInsuranceCheck" />
</view> </view>
<!-- </scroll-view> --> <!-- </scroll-view> -->
<van-popup <van-popup
......
// packageEquity/pages/carEquity/serviceInfo/serviceInfo.js // packageEquity/pages/carEquity/serviceInfo/serviceInfo.js
import { getQuotationInfo, quotationAdd, updateQuotation, quotationGoods, getQuotationInfoById, quotationPicture } from '../../../api' import { getQuotationInfo, quotationAdd, updateQuotation, quotationGoods, getQuotationInfoById, quotationPicture } from '../../../api'
import { quotedImgUrl } from '~/config'
// console.log(quotedImgUrl, 'quotedImgUrl')
Page({ Page({
/** /**
* 页面的初始数据 * 页面的初始数据
...@@ -98,19 +100,11 @@ Page({ ...@@ -98,19 +100,11 @@ Page({
// quotationPicture // quotationPicture
let { orderInfo } = this.data let { orderInfo } = this.data
const { id } = orderInfo const { id } = orderInfo
const accountInfo = wx.getAccountInfoSync()
const env = accountInfo.miniProgram.envVersion
console.log(env)
wx.$util.showLoading('加载中...') wx.$util.showLoading('加载中...')
const createQuotedUrl = {
develop: `http://192.168.1.178:9528/dj-scrm-wx-work-main-zhangls/#/equityPoster?id=${id}`,
trial: `http://frontend.test.glsx.com.cn/dj-car-boutique-work-wechat/#/equityPoster?id=${id}`,
release: `https://dj.glsx.com.cn/dj-car-boutique-work-wechat/#/equityPoster?id=${id}`
}
const quotedPriceUpdate = this.multipliedByHundred(orderInfo?.modifyEquityQuotation?.quotedPriceUpdate) const quotedPriceUpdate = this.multipliedByHundred(orderInfo?.modifyEquityQuotation?.quotedPriceUpdate)
quotationPicture({ id, quotedPriceUpdate, createQuotedUrl: createQuotedUrl[env] }) quotationPicture({ id, quotedPriceUpdate, createQuotedUrl: quotedImgUrl + id })
.then(result => { .then(result => {
// debugger // debugger
wx.hideLoading() wx.hideLoading()
...@@ -140,7 +134,7 @@ Page({ ...@@ -140,7 +134,7 @@ Page({
let result = await this.handleSecondConfirmCheck() let result = await this.handleSecondConfirmCheck()
let { code, data: id, message } = result let { code, data: id, message } = result
console.log(id) // console.log(id)
if (id) { if (id) {
// 校验生成告知书是否成功 // 校验生成告知书是否成功
let status = await this.getQuotationGenerate(id) let status = await this.getQuotationGenerate(id)
...@@ -163,34 +157,47 @@ Page({ ...@@ -163,34 +157,47 @@ Page({
// wx.$router.go('packageEquity.index') // wx.$router.go('packageEquity.index')
}, },
handleSecondConfirmCheck() { getInsurance() {
let { orderInfo, owner } = this.data let { orderInfo } = this.data
const insurance = ['business', 'mutualStrength', 'vehiclesAndVessels', 'valueAddedVehicleLoss', 'otherInsuranceList']
orderInfo = wx.$util.deepClone(orderInfo) orderInfo = wx.$util.deepClone(orderInfo)
owner = wx.$util.deepClone(owner)
let { default4SStoreInfo } = wx.$util.getUserInfo() let { default4SStoreInfo } = wx.$util.getUserInfo()
orderInfo.owner = owner orderInfo.merchantId4s = default4SStoreInfo?.merchantId
orderInfo.owner.price = this.multipliedByHundred(orderInfo.owner?.price) || '' orderInfo.merchantName4s = default4SStoreInfo?.merchantName
const insurance = ['business', 'mutualStrength', 'vehiclesAndVessels', 'valueAddedVehicleLoss', 'otherInsuranceList']
orderInfo.insureList = [] orderInfo.insureList = []
// multipliedByHundredObj
const business = this.multipliedByHundredObj(orderInfo.business) const business = this.multipliedByHundredObj(orderInfo.business)
const mutualStrength = this.multipliedByHundredObj(orderInfo.mutualStrength) const mutualStrength = this.multipliedByHundredObj(orderInfo.mutualStrength)
const vehiclesAndVessels = this.multipliedByHundredObj(orderInfo.vehiclesAndVessels) const vehiclesAndVessels = this.multipliedByHundredObj(orderInfo.vehiclesAndVessels)
const valueAddedVehicleLoss = this.multipliedByHundredObj(orderInfo.valueAddedVehicleLoss) const valueAddedVehicleLoss = this.multipliedByHundredObj(orderInfo.valueAddedVehicleLoss)
orderInfo.insureList = [business, mutualStrength, vehiclesAndVessels, valueAddedVehicleLoss] orderInfo.insureList = [business, mutualStrength, vehiclesAndVessels, valueAddedVehicleLoss]
// const otherInsuranceList =
orderInfo.otherInsuranceList.forEach(item => { orderInfo.otherInsuranceList.forEach(item => {
// return this.multipliedByHundredObj(item)
orderInfo.insureList.push(this.multipliedByHundredObj(item)) orderInfo.insureList.push(this.multipliedByHundredObj(item))
}) })
// || 44211547 || 'test'
orderInfo.merchantId4s = default4SStoreInfo?.merchantId
orderInfo.merchantName4s = default4SStoreInfo?.merchantName
delete orderInfo.owner?.buyCarTime
insurance.forEach(item => { insurance.forEach(item => {
delete orderInfo[item] delete orderInfo[item]
}) })
// delete orderInfo.quotedPriceUpdate
return orderInfo
},
getOwnerInfo() {
let { owner } = this.data
owner = wx.$util.deepClone(owner)
owner.price = this.multipliedByHundred(owner?.price) || ''
// orderInfo.owner = owner
if (owner) {
delete owner?.buyCarTime
}
return owner
},
handleSecondConfirmCheck() {
// 获取保险信息
let orderInfo = this.getInsurance()
let owner = this.getOwnerInfo()
orderInfo.owner = owner
console.log('orderInfo', orderInfo) console.log('orderInfo', orderInfo)
try { try {
return new Promise(async (resolve, reject) => { return new Promise(async (resolve, reject) => {
......
/* packageEquity/pages/carEquity/serviceInfo/serviceInfo.wxss */ /* packageEquity/pages/carEquity/serviceInfo/serviceInfo.wxss */
page{
background: #f3f5f7;
}
.layout { .layout {
/* background: #F4F5F7; */ /* background: #F4F5F7; */
/* background: #1253d5; */ /* background: #1253d5; */
/* padding-bottom: 60rpx; */ /* padding-bottom: 60rpx; */
background: #f3f5f7; background: #f3f5f7;
min-height: 100vh; /* min-height: 100vh; */
} }
.navigation-title { .navigation-title {
......
...@@ -144,7 +144,7 @@ Page({ ...@@ -144,7 +144,7 @@ Page({
width: canvasWidth, width: canvasWidth,
height: canvasHeight, height: canvasHeight,
canvasId: 'signature', canvasId: 'signature',
fileType: 'jpg', fileType: 'png',
success(res) { success(res) {
// //将图片保存到本地相册 // //将图片保存到本地相册
// wx.saveImageToPhotosAlbum({ // wx.saveImageToPhotosAlbum({
......
...@@ -101,7 +101,7 @@ ...@@ -101,7 +101,7 @@
</view> </view>
</block> </block>
</view> </view>
<view class="order-detail" wx:if="{{item.orderStatus == '1' || item.orderStatus == '3' ||item.orderStatus =='4'}}"> <view class="order-detail" wx:if="{{item.orderStatus == '1'|| item.orderStatus == '2' || item.orderStatus == '3' ||item.orderStatus =='4'}}">
<view class="detail-item"> <view class="detail-item">
<view class="detail-label">报价金额</view> <view class="detail-label">报价金额</view>
<view class="text-hide">{{item.quotedPrice || '--'}}</view> <view class="text-hide">{{item.quotedPrice || '--'}}</view>
......
// packageEquity/pages/carQuotation/schemeConfirmation/schemeConfirmation.js // packageEquity/pages/carQuotation/schemeConfirmation/schemeConfirmation.js
import { quotationPicture, updateOrderStatus, quotationGenerate } from '../../../api' import { quotationPicture, updateOrderStatus, quotationGenerate } from '../../../api'
import { quotedImgUrl } from '~/config'
Page({ Page({
/** /**
* 页面的初始数据 * 页面的初始数据
...@@ -8,7 +9,8 @@ Page({ ...@@ -8,7 +9,8 @@ Page({
schemeConfirmationImg: '', schemeConfirmationImg: '',
textNameObj: { textNameObj: {
confirmName: '下一步·客户签字(3/4)', confirmName: '下一步·客户签字(3/4)',
editName: '修改报价', editName: '修改权益报价',
editOrderName: '编辑报价单',
cancelName: '放弃报价' cancelName: '放弃报价'
}, },
id: '', id: '',
...@@ -54,6 +56,8 @@ Page({ ...@@ -54,6 +56,8 @@ Page({
} else if (name == 'edit') { } else if (name == 'edit') {
// this.triggerEvent('editSave') // this.triggerEvent('editSave')
this.backEdit() this.backEdit()
} else if (name == 'editOrderName') {
wx.$router.redirectTo('createOrderCarQuotation', { id })
} else if (name == 'cancel') { } else if (name == 'cancel') {
this.setData({ this.setData({
showRemark: true showRemark: true
...@@ -104,18 +108,7 @@ Page({ ...@@ -104,18 +108,7 @@ Page({
} }
}, },
getQuotationPicture(id) { getQuotationPicture(id) {
const accountInfo = wx.getAccountInfoSync() quotationPicture({ id, createQuotedUrl: quotedImgUrl + id })
const env = accountInfo.miniProgram.envVersion
const createQuotedUrl = {
// develop: `http://192.168.1.178:9528/dj-scrm-wx-work-main-zhangls/#/equityPoster?id=${id}`,
develop: `https://frontend.test.glsx.com.cn/dj-car-boutique-work-wechat/#/equityPoster?id=${id}`,
trial: `https://frontend.test.glsx.com.cn/dj-car-boutique-work-wechat/#/equityPoster?id=${id}`,
release: `https://dj.glsx.com.cn/dj-car-boutique-work-wechat/#/equityPoster?id=${id}`
}
console.log(env)
// let createQuotedUrl =
console.log(createQuotedUrl[env])
quotationPicture({ id, createQuotedUrl: createQuotedUrl[env] })
.then(result => { .then(result => {
console.log('result', result) console.log('result', result)
// let {} // let {}
......
...@@ -14,6 +14,7 @@ page { ...@@ -14,6 +14,7 @@ page {
box-shadow: 0 6rpx 16rpx 0 #cdcdd159; box-shadow: 0 6rpx 16rpx 0 #cdcdd159;
border-radius: 16rpx; border-radius: 16rpx;
text-align: center; text-align: center;
overflow: hidden;
.title { .title {
font-weight: 500; font-weight: 500;
......
...@@ -20,7 +20,7 @@ Page({ ...@@ -20,7 +20,7 @@ Page({
// let { noLogin } = options // let { noLogin } = options
let id = decodeURIComponent(options.scene).split('=')[1] let id = decodeURIComponent(options.scene).split('=')[1]
// noLogin // noLogin
console.log(id) // console.log(id)
id ? this.qrCodeScene(id) : this.getListSelectAccount() id ? this.qrCodeScene(id) : this.getListSelectAccount()
// this.getListSelectAccount() // this.getListSelectAccount()
}, },
...@@ -162,11 +162,13 @@ Page({ ...@@ -162,11 +162,13 @@ Page({
let { data, message } = res let { data, message } = res
if (data) { if (data) {
app.globalData.YQorderSetting = null app.globalData.YQorderSetting = null
app.globalData.yqdInfo.merchantRange = null
wx.$util.setUserInfo(data.loginUserInfoList[0]) wx.$util.setUserInfo(data.loginUserInfoList[0])
app.globalData.YQorderSetting = null app.globalData.YQorderSetting = null
// console.log(data.loginUserInfoList[0]) // console.log(data.loginUserInfoList[0])
checkYqdSuper(app, data.loginUserInfoList[0]) checkYqdSuper(app, data.loginUserInfoList[0])
const SCENE = wx.$SCENE const SCENE = wx.$SCENE
console.log(SCENE, 'SCENE')
// debugger 兼容扫码优惠券进来和免登录逻辑冲突问题 // debugger 兼容扫码优惠券进来和免登录逻辑冲突问题
if (SCENE && SCENE.path != 'pages/accountItems/accountItems') { if (SCENE && SCENE.path != 'pages/accountItems/accountItems') {
let { let {
...@@ -174,17 +176,19 @@ Page({ ...@@ -174,17 +176,19 @@ Page({
query query
// : { scene } // : { scene }
} = SCENE } = SCENE
console.log(path, 'path')
let { target, name } = wx.$util.getSceneId(path) let { target, name } = wx.$util.getSceneId(path)
// console.log(query) // console.log(query)
// console.log(target,name); // console.log(target,name);
wx.$router.reLaunch(`${target}.${name}`, query) wx.$router.reLaunch(`${target}.${name}`, query)
wx.$SCENE = null wx.$SCENE = null
} else { } else {
// 超管默认开通所有场景 // 超管默认开通所有场景
if (isSuper) { if (isSuper) {
// 0 会员权益/升级 1 精品升级 // 0 会员权益/升级 1 精品升级
let openSceneArr = constantData.sceneList.map(val => {return val?.sceneType}) let openSceneArr = constantData.sceneList.map(val => {
return val?.sceneType
})
wx.$util.setUserInfo({ ...wx.$util.getUserInfo(), openSceneArr }) wx.$util.setUserInfo({ ...wx.$util.getUserInfo(), openSceneArr })
wx.$router.reLaunch('pages.sceneIndex') wx.$router.reLaunch('pages.sceneIndex')
return return
......
...@@ -36,6 +36,7 @@ Page({ ...@@ -36,6 +36,7 @@ Page({
let { sceneList } = this.data let { sceneList } = this.data
let userInfo = wx.$util.getUserInfo() || {} let userInfo = wx.$util.getUserInfo() || {}
let openSceneArr = userInfo?.openSceneArr || [] let openSceneArr = userInfo?.openSceneArr || []
this.setData({ this.setData({
timeState: wx.$util.getTimeState() timeState: wx.$util.getTimeState()
}) })
...@@ -99,7 +100,8 @@ Page({ ...@@ -99,7 +100,8 @@ Page({
onShow() { onShow() {
let { sceneList } = this.data let { sceneList } = this.data
let userInfo = wx.$util.getUserInfo() let userInfo = wx.$util.getUserInfo()
userInfo?.openSceneArr.includes(userInfo?.selectedSceneType) && let openSceneArr = userInfo?.openSceneArr || []
openSceneArr.includes(userInfo?.selectedSceneType) &&
sceneList.map(i => { sceneList.map(i => {
i.actived = false i.actived = false
if (i.sceneType == userInfo?.selectedSceneType) { if (i.sceneType == userInfo?.selectedSceneType) {
......
...@@ -17,6 +17,12 @@ Page({ ...@@ -17,6 +17,12 @@ Page({
loginToken loginToken
}) })
}, },
authChoose(e) {
let { detail: agree } = e
this.setData({
agree
})
},
changeLoginType(e) { changeLoginType(e) {
let { type } = e.currentTarget.dataset let { type } = e.currentTarget.dataset
this.setData({ this.setData({
...@@ -40,7 +46,7 @@ Page({ ...@@ -40,7 +46,7 @@ Page({
}) })
}, },
agree() { agree() {
let {agree} = this.data let { agree } = this.data
this.setData({ this.setData({
agree: !agree agree: !agree
}) })
...@@ -82,12 +88,17 @@ Page({ ...@@ -82,12 +88,17 @@ Page({
}) })
}, },
smsLogin() { smsLogin() {
const checkAgree = this.checkAgree()
if (checkAgree) return false
let { flag, code, mobile, loginType, accountNumber, password } = this.data let { flag, code, mobile, loginType, accountNumber, password } = this.data
console.log(flag) console.log(flag)
if (!flag) return if (!flag) return
wx.$util.showLoading() wx.$util.showLoading()
if (loginType == 1) { // 手机号登录 if (loginType == 1) {
api.smsLogin({ // 手机号登录
api
.smsLogin({
code, code,
mobile mobile
}) })
...@@ -112,9 +123,11 @@ Page({ ...@@ -112,9 +123,11 @@ Page({
}) })
} }
}) })
} else if (loginType == 2) { // 账号密码登录 } else if (loginType == 2) {
// 账号密码登录
console.log('账号密码登录成功') console.log('账号密码登录成功')
api.smsLogin({ api
.smsLogin({
mobile: accountNumber, mobile: accountNumber,
code: password code: password
}) })
...@@ -159,6 +172,15 @@ Page({ ...@@ -159,6 +172,15 @@ Page({
}) })
}, 1 * 1000) }, 1 * 1000)
}, },
checkAgree() {
let { agree } = this.data
console.log('agree', agree)
if (!agree) {
wx.$util.showToast('请同意用户协议')
return true
}
return false
},
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
...@@ -168,6 +190,9 @@ Page({ ...@@ -168,6 +190,9 @@ Page({
*/ */
getPhoneNumber(e) { getPhoneNumber(e) {
console.log(e) console.log(e)
const checkAgree = this.checkAgree()
if (checkAgree) return false
let { loginToken } = this.data let { loginToken } = this.data
let { encryptedData, iv } = e.detail let { encryptedData, iv } = e.detail
if (!encryptedData) return if (!encryptedData) return
......
{ {
"usingComponents": {} "usingComponents": {
"auth-setting": "/components/authSetting/authSetting"
}
} }
...@@ -2,25 +2,46 @@ ...@@ -2,25 +2,46 @@
<block wx:if="{{loginType == 1}}"> <block wx:if="{{loginType == 1}}">
<view class='login-form'> <view class='login-form'>
<view class='input'> <view class='input'>
<input placeholder="请输入手机号" type="number" placeholder-style="color:#999;" style="width:calc(100% - 50rpx);" bindinput="input" data-name='mobile' value="{{mobile}}" maxlength="11"></input> <input
<view class='clear y-center' hidden="{{!mobile}}" bindtap="clear" data-name='mobile'> placeholder="请输入手机号"
<image src="/images/clear.png"></image> type="number"
placeholder-style="color:#999;"
style="width:calc(100% - 50rpx);"
bindinput="input"
data-name='mobile'
value="{{mobile}}"
maxlength="11" />
<view
class='clear y-center'
hidden="{{!mobile}}"
bindtap="clear"
data-name='mobile'>
<image src="/images/clear.png" />
</view> </view>
</view> </view>
<view class="sms-box"> <view class="sms-box">
<view class='input'> <view class='input'>
<input placeholder="请输入验证码" type="number" placeholder-style="color:#999;" style="width:calc(100% - 100rpx);" bindinput="input" data-name='code' value='{{code}}' maxlength="4"></input> <input
<view class='clear y-center' style="right:50rpx;" hidden="{{!code}}" bindtap="clear" data-name='code'> placeholder="请输入验证码"
<image src="/images/clear.png"></image> type="number"
placeholder-style="color:#999;"
style="width:calc(100% - 100rpx);"
bindinput="input"
data-name='code'
value='{{code}}'
maxlength="4" />
<view
class='clear y-center'
style="right:50rpx;"
hidden="{{!code}}"
bindtap="clear"
data-name='code'>
<image src="/images/clear.png" />
</view> </view>
</view> </view>
<view class="sms {{countDown?'code-disabled':''}}" bindtap="getSms"> <view class="sms {{countDown?'code-disabled':''}}" bindtap="getSms">
<block wx:if="{{countDown}}"> <block wx:if="{{countDown}}">{{count}}秒后获取</block>
{{count}}秒后获取 <block wx:else>获取验证码</block>
</block>
<block wx:else>
获取验证码
</block>
</view> </view>
</view> </view>
</view> </view>
...@@ -28,15 +49,37 @@ ...@@ -28,15 +49,37 @@
<block wx:if="{{loginType == 2}}"> <block wx:if="{{loginType == 2}}">
<view class='login-form'> <view class='login-form'>
<view class='input'> <view class='input'>
<input placeholder="请输入账号" type="number" placeholder-style="color:#999;" style="width:calc(100% - 50rpx);" bindinput="input" data-name='accountNumber' value="{{accountNumber}}"></input> <input
<view class='clear y-center' hidden="{{!accountNumber}}" bindtap="clear" data-name='accountNumber'> placeholder="请输入账号"
<image src="/images/clear.png"></image> type="number"
placeholder-style="color:#999;"
style="width:calc(100% - 50rpx);"
bindinput="input"
data-name='accountNumber'
value="{{accountNumber}}" />
<view
class='clear y-center'
hidden="{{!accountNumber}}"
bindtap="clear"
data-name='accountNumber'>
<image src="/images/clear.png" />
</view> </view>
</view> </view>
<view class='input'> <view class='input'>
<input placeholder="请输入密码" type="password" placeholder-style="color:#999;" style="width:calc(100% - 50rpx);" bindinput="input" data-name='password' value='{{password}}'></input> <input
<view class='clear y-center' hidden="{{!password}}" bindtap="clear" data-name='password'> placeholder="请输入密码"
<image src="/images/clear.png"></image> type="password"
placeholder-style="color:#999;"
style="width:calc(100% - 50rpx);"
bindinput="input"
data-name='password'
value='{{password}}' />
<view
class='clear y-center'
hidden="{{!password}}"
bindtap="clear"
data-name='password'>
<image src="/images/clear.png" />
</view> </view>
</view> </view>
</view> </view>
...@@ -50,13 +93,31 @@ ...@@ -50,13 +93,31 @@
<block>30天免登录</block> <block>30天免登录</block>
</view> </view>
<view class="login-btn {{loginType == 3?'mini':''}}"> <view class="login-btn {{loginType == 3?'mini':''}}">
<button size="default" hidden="{{loginType != 3}}" open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber"></button> <button
<view hidden="{{loginType !=3 }}">微信登录</view> size="default"
hidden="{{loginType != 3 || !agree}}"
open-type="getPhoneNumber"
bindgetphonenumber="getPhoneNumber" />
<view hidden="{{loginType !=3 }}" bindtap="checkAgree">微信登录</view>
<view hidden="{{loginType == 3}}" bindtap="smsLogin">登录</view> <view hidden="{{loginType == 3}}" bindtap="smsLogin">登录</view>
</view> </view>
<view class='tips' bindtap="changeLoginType" data-type="1" wx:if="{{loginType != 1}}">{{"手机号登录"}}</view> <view
class='tips'
bindtap="changeLoginType"
data-type="1"
wx:if="{{loginType != 1}}">
{{"手机号登录"}}
</view>
<!-- 暂时不做密码登录 --> <!-- 暂时不做密码登录 -->
<!-- <view class='tips' bindtap="changeLoginType" data-type="2" wx:if="{{loginType != 2}}">{{"账号密码登录"}}</view> --> <!-- <view class='tips' bindtap="changeLoginType" data-type="2" wx:if="{{loginType != 2}}">{{"账号密码登录"}}</view> -->
<view class='tips' bindtap="changeLoginType" data-type="3" wx:if="{{loginType != 3}}">{{"微信登录"}}</view> <view
class='tips'
bindtap="changeLoginType"
data-type="3"
wx:if="{{loginType != 3}}">
{{"微信登录"}}
</view>
<auth-setting bind:choose="authChoose" />
</view> </view>
</view> </view>
...@@ -48,7 +48,7 @@ ...@@ -48,7 +48,7 @@
"scene": null "scene": null
}, },
{ {
"name": "工单列表", "name": "预约管理",
"pathName": "tabWorkOrder/pages/index/index", "pathName": "tabWorkOrder/pages/index/index",
"query": "", "query": "",
"launchMode": "default", "launchMode": "default",
...@@ -139,13 +139,20 @@ ...@@ -139,13 +139,20 @@
"scene": null "scene": null
}, },
{ {
"name": "", "name": "报价单签名",
"pathName": "packageEquity/pages/carQuotation/signature/signature", "pathName": "packageEquity/pages/carQuotation/signature/signature",
"query": "", "query": "",
"launchMode": "default", "launchMode": "default",
"scene": null "scene": null
}, },
{ {
"name": "全屏签名",
"pathName": "packageEquity/pages/carQuotation/fullSignture/fullSignture",
"query": "",
"launchMode": "default",
"scene": null
},
{
"name": "新建工单", "name": "新建工单",
"pathName": "tabWorkOrder/pages/createOrder/createOrder", "pathName": "tabWorkOrder/pages/createOrder/createOrder",
"query": "", "query": "",
...@@ -153,8 +160,43 @@ ...@@ -153,8 +160,43 @@
"scene": null "scene": null
}, },
{ {
"name": "全屏签名", "name": "客户建档",
"pathName": "packageEquity/pages/carQuotation/fullSignture/fullSignture", "pathName": "tabWorkOrder/pages/createArchives/createArchives",
"query": "",
"launchMode": "default",
"scene": null
},
{
"name": "预约管理",
"pathName": "tabDate/pages/index/index",
"query": "",
"launchMode": "default",
"scene": null
},
{
"name": "1.1 创建客户档案",
"pathName": "tabWorkOrder/pages/createArchives/createArchives",
"query": "",
"launchMode": "default",
"scene": null
},
{
"name": "预约管理",
"pathName": "tabDate/pages/index/index",
"query": "",
"launchMode": "default",
"scene": null
},
{
"name": "创建工单",
"pathName": "tabWorkOrder/pages/createOrder/createOrder",
"query": "",
"launchMode": "default",
"scene": null
},
{
"name": "登录页面",
"pathName": "pages/wxLogin/wxLogin",
"query": "", "query": "",
"launchMode": "default", "launchMode": "default",
"scene": null "scene": null
...@@ -162,5 +204,6 @@ ...@@ -162,5 +204,6 @@
] ]
} }
}, },
"setting": {} "setting": {},
"libVersion": "2.29.2"
} }
\ No newline at end of file \ No newline at end of file
...@@ -80,7 +80,7 @@ export const getYQorderInfo = () => { ...@@ -80,7 +80,7 @@ export const getYQorderInfo = () => {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
// 如果有 直接返回 // 如果有 直接返回
// console.log(app.globalData.YQorderSetting, 'app.globalData.YQorderSetting') // console.log(app.globalData.YQorderSetting, 'app.globalData.YQorderSetting')
console.log('app.globalData.YQorderSetting', app.globalData.YQorderSetting) // console.log('app.globalData.YQorderSetting', app.globalData.YQorderSetting)
if (app.globalData.YQorderSetting) { if (app.globalData.YQorderSetting) {
return resolve(app.globalData.YQorderSetting) return resolve(app.globalData.YQorderSetting)
} else { } else {
...@@ -100,12 +100,12 @@ export const getYQorderInfo = () => { ...@@ -100,12 +100,12 @@ export const getYQorderInfo = () => {
// console.log(data); // console.log(data);
// debugger // debugger
console.log(data.yqPhoneConfig,'data.yqPhoneConfig'); // console.log(data.yqPhoneConfig, 'data.yqPhoneConfig')
console.log(typeof data.yqPhoneConfig,'data.yqPhoneConfig'); // console.log(typeof data.yqPhoneConfig, 'data.yqPhoneConfig')
// 过滤园区店是否需要屏蔽手机号选项 // 过滤园区店是否需要屏蔽手机号选项
let filterYqPhoneConfig = JSON.parse(data.yqPhoneConfig) let filterYqPhoneConfig = JSON.parse(data.yqPhoneConfig)
// console.log(filterYqPhoneConfig) // console.log(filterYqPhoneConfig)
data.yqPhoneConfig = filterYqPhoneConfig.find(item => item.yqMerchantId == merchantId)?.shopMerchantPhoneList || false data.yqPhoneConfig = filterYqPhoneConfig?.find(item => item.yqMerchantId == merchantId)?.shopMerchantPhoneList || false
// console.log(data) // console.log(data)
app.globalData.YQorderSetting = data app.globalData.YQorderSetting = data
// this.checkSeverType(userInfo) // this.checkSeverType(userInfo)
...@@ -153,28 +153,44 @@ export const setConfigInfo = globalData => { ...@@ -153,28 +153,44 @@ export const setConfigInfo = globalData => {
} }
export const checkScene = options => { export const checkScene = options => {
// console.log(options, 'options')
// console.log(wx)
// return true
let { query } = options let { query } = options
console.log(query, 'query')
let userInfo = wx.$util.getStorageSync('dj_boutique_user_info')
// 判断对象是否满足任意一个key // 判断对象是否满足任意一个key
// console.log(query, ' query') // console.log(query, ' query')
if (query && (query.scene || query.merchantId || query.type)) { if (query && (query.scene || query.merchantId || query.type || query.page)) {
if (query.merchantId) { if (query.merchantId) {
// &&options.patch == 'tabIndex/pages/index/index' // &&options.patch == 'tabIndex/pages/index/index'
let userInfo = wx.$util.getStorageSync('dj_boutique_user_info')
// 需要当前门店的 不是就重新登录 // 需要当前门店的 不是就重新登录
if (userInfo?.subLoginUser?.merchantId != query.merchantId) { if (userInfo?.subLoginUser?.merchantId != query.merchantId) {
wx.$SCENE = null wx.$SCENE = null
// return this.login(true) // return this.login(true)
return true // 重新登录 // return true // 重新登录
return '订单与当前登录园区不一致,请重新登录。'
}
if (query.page) {
//订单跟进
options.path = 'tabWorkOrder/pages/createOrder/createOrder'
} else {
//订单补录
options.path = 'pages/index/index'
}
} }
options.patch = 'pages/index/index' // h5跳转小程序 路径处理
if (query.page) {
const pagePath = {
createArchives: 'tabWorkOrder/pages/createArchives/createArchives',
createOrder: 'tabWorkOrder/pages/createOrder/createOrder',
followUpOrder: 'tabDate/pages/detail'
} }
if (query.type) { options.path = pagePath[query.page]
options.patch = 'tabWorkOrder/pages/createOrder/createOrder'
} }
console.log(options, 'options')
wx.$SCENE = options wx.$SCENE = options
if (!userInfo) {
return '未登录,请登录。'
}
} }
} }
...@@ -214,12 +230,9 @@ export const setWebSocket = () => { ...@@ -214,12 +230,9 @@ export const setWebSocket = () => {
export const get4SStoreList = options => { export const get4SStoreList = options => {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
const app = getApp() const app = getApp()
api api
.getSceneMerchantRefStoreList({ .getSceneMerchantRefStoreList(options)
merchantId: options.yqMerchantId,
scene: 0,
merchantName: options.merchantName
})
.then(res => { .then(res => {
let { code, data } = res let { code, data } = res
if (code == 0) { if (code == 0) {
......
...@@ -31,18 +31,10 @@ Page({ ...@@ -31,18 +31,10 @@ Page({
callBack: 'makePhoneCall', callBack: 'makePhoneCall',
copy: true copy: true
}, },
// { {
// label: '性别', label: '客户车型',
// key: 'customerSex', key: 'carName'
// enum: { },
// 1: '男',
// 2: '女'
// }
// },
// {
// label: '车型',
// key: 'carType',
// },
{ {
label: '礼券名称', label: '礼券名称',
key: 'couponName' key: 'couponName'
...@@ -106,6 +98,7 @@ Page({ ...@@ -106,6 +98,7 @@ Page({
this.getInviteDetail(options.id) this.getInviteDetail(options.id)
} }
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
...@@ -160,6 +153,10 @@ Page({ ...@@ -160,6 +153,10 @@ Page({
let updatedDate = new Date(e.updatedDate) let updatedDate = new Date(e.updatedDate)
e.year = updatedDate.format('yyyy-MM-dd') e.year = updatedDate.format('yyyy-MM-dd')
e.time = updatedDate.format('hh:mm:ss') e.time = updatedDate.format('hh:mm:ss')
// 格式化跟进时间
let time = e.inviteDate
e.inviteDate = time ? `「${new Date(e.inviteDate).format('MM-dd hh:mm')}」` : ''
}) })
} }
if (detail.carSeriesName) detail.carType = `${detail.carBrand}-${detail.carChildsBrandName || ''}-${detail.carSeriesName}` if (detail.carSeriesName) detail.carType = `${detail.carBrand}-${detail.carChildsBrandName || ''}-${detail.carSeriesName}`
......
...@@ -12,7 +12,17 @@ ...@@ -12,7 +12,17 @@
style="color:{{item.color}};" style="color:{{item.color}};"
catchtap="{{item.callBack}}" catchtap="{{item.callBack}}"
data-data="{{detail[item.key]}}"> data-data="{{detail[item.key]}}">
<!-- <view>{{item.key}}</view> -->
<block wx:if="{{item.key=='carName'}}">
<block wx:if="{{detail.customer.carSeriesName}}">
<!-- <view class="between"> -->
{{detail.customer.carBrand}}-{{detail.customer.carChildsBrandName}}-{{detail.customer.carSeriesName}}
<!-- </view> -->
</block>
</block>
<block wx:else>
{{item.enum? item.enum[detail[item.key]] : detail[item.key] || ''}} {{item.enum? item.enum[detail[item.key]] : detail[item.key] || ''}}
</block>
</view> </view>
<block wx:if="{{item.copy}}"> <block wx:if="{{item.copy}}">
<view class="copy" catchtap="setCopyData" data-content="{{detail[item.key]}}"> <view class="copy" catchtap="setCopyData" data-content="{{detail[item.key]}}">
...@@ -25,7 +35,11 @@ ...@@ -25,7 +35,11 @@
</view> </view>
<view class="box "> <view class="box ">
<block wx:if="{{!userInfo.isSuper && userInfo.merchantType && userInfo.userType == 2}}"> <block wx:if="{{!userInfo.isSuper && userInfo.merchantType && userInfo.userType == 2}}">
<view wx:if="{{detail.inviteStatus != 4}}" class="icon date-icon" bindtap="showPopup" data-name="showDate"> <view
wx:if="{{detail.inviteStatus != 4}}"
class="icon date-icon"
bindtap="showPopup"
data-name="showDate">
<image src="../../images/date.png" /> <image src="../../images/date.png" />
</view> </view>
</block> </block>
...@@ -90,7 +104,9 @@ ...@@ -90,7 +104,9 @@
</block> </block>
: :
</view> </view>
<view class="value">{{i.enum? i.enum[item[i.key]] :item[i.key]||'无'}}</view> <view class="value">
{{i.enum? i.enum[item[i.key]]+item.inviteDate :item[i.key]||'无'}}
</view>
</view> </view>
</block> </block>
<block wx:if="{{!userInfo.isSuper && userInfo.merchantType && index == 0 && userInfo.userType == 2}}"> <block wx:if="{{!userInfo.isSuper && userInfo.merchantType && index == 0 && userInfo.userType == 2}}">
......
...@@ -43,13 +43,13 @@ Page({ ...@@ -43,13 +43,13 @@ Page({
text: '取消预约', text: '取消预约',
color: '#FF7D12' color: '#FF7D12'
}, },
4: {
text: '已施工',
color: '#999999'
},
5: { 5: {
text: '过期到店', text: '过期到店',
color: '#FF7D12' color: '#FF7D12'
},
4: {
text: '已施工',
color: '#999999'
} }
}, },
searchObj: {}, searchObj: {},
......
...@@ -53,7 +53,7 @@ ...@@ -53,7 +53,7 @@
data-item="{{li}}"> data-item="{{li}}">
<view class="status" style="color:{{status[li.inviteStatus].color}}"> <view class="status" style="color:{{status[li.inviteStatus].color}}">
<block>{{status[li.inviteStatus].text}}</block> <block>{{status[li.inviteStatus].text}}</block>
<block wx:if="{{li.inviteStatus !==4}}"> <block wx:if="{{li.inviteStatus !=4}}">
<view class="line" style="background-color:{{status[li.inviteStatus].color}};" /> <view class="line" style="background-color:{{status[li.inviteStatus].color}};" />
</block> </block>
</view> </view>
...@@ -92,7 +92,7 @@ ...@@ -92,7 +92,7 @@
<view class="time {{now<li.inviteDate?'':'gray'}}">{{li.time}}</view> <view class="time {{now<li.inviteDate?'':'gray'}}">{{li.time}}</view>
</view> </view>
<view class="order-control"> <view class="order-control">
<block wx:if="{{!userInfo.isSuper && userInfo.merchantType && userInfo.userType == 2 && li.customerCoupon.usedFlag !='Y'}}"> <block wx:if="{{!userInfo.isSuper && userInfo.merchantType && userInfo.userType == 2 && li.customerCoupon.usedFlag !='Y'&&li.inviteStatus !=4}}">
<view class="control-item" catchtap="showDateBox" data-item="{{li}}"> <view class="control-item" catchtap="showDateBox" data-item="{{li}}">
<image src="../../images/date.png" class="date-icon" /> <image src="../../images/date.png" class="date-icon" />
预约 预约
......
// tabIndex/pages/index/index.js // tabIndex/pages/index/index.js
import mixins from './index_mixins' import mixins from './index_mixins'
import api from '../../api.js' import api from '../../api.js'
import { import { env } from '~/config'
getYQInfo import { getYQInfo } from '~/store/index'
} from '~/store/index'
const app = getApp() const app = getApp()
let time = null let time = null
Page({ Page({
...@@ -14,7 +13,8 @@ Page({ ...@@ -14,7 +13,8 @@ Page({
flag: true, flag: true,
...mixins.data, ...mixins.data,
navBarHeight: 0, navBarHeight: 0,
totalTableSum: [{ totalTableSum: [
{
name: 'filmTimesTotalSum' name: 'filmTimesTotalSum'
}, },
{ {
...@@ -66,9 +66,7 @@ Page({ ...@@ -66,9 +66,7 @@ Page({
}, },
navigator(e) { navigator(e) {
console.log(e) console.log(e)
let { let { outTradeNo } = e.detail
outTradeNo
} = e.detail
this.closeSwitchPopup() this.closeSwitchPopup()
outTradeNo && outTradeNo &&
wx.$router.go('tabWorkOrder.additionRecordOrder', { wx.$router.go('tabWorkOrder.additionRecordOrder', {
...@@ -76,12 +74,8 @@ Page({ ...@@ -76,12 +74,8 @@ Page({
}) })
}, },
remarkConfirm(e) { remarkConfirm(e) {
let { let { methodUpdateInfo } = this.data
methodUpdateInfo let { detail: filmTimes } = e
} = this.data
let {
detail: filmTimes
} = e
methodUpdateInfo.filmTimes = filmTimes methodUpdateInfo.filmTimes = filmTimes
api api
.updateCouponDayReport(methodUpdateInfo) .updateCouponDayReport(methodUpdateInfo)
...@@ -105,16 +99,8 @@ Page({ ...@@ -105,16 +99,8 @@ Page({
}) })
}, },
changeTableData(e) { changeTableData(e) {
let { let { startDate, maxDate, isYqdSuper } = this.data
startDate, let { merchantId, filmTimes, merchantName } = e.currentTarget.dataset.item
maxDate,
isYqdSuper
} = this.data
let {
merchantId,
filmTimes,
merchantName
} = e.currentTarget.dataset.item
// 不是管理员不开启这个权限 // 不是管理员不开启这个权限
if (!isYqdSuper) return if (!isYqdSuper) return
if (startDate != maxDate) { if (startDate != maxDate) {
...@@ -154,12 +140,8 @@ Page({ ...@@ -154,12 +140,8 @@ Page({
}) })
}, },
changePicker(e) { changePicker(e) {
let { let { value } = e.detail
value let { merchantId } = this.data.merchantRange[value]
} = e.detail
let {
merchantId
} = this.data.merchantRange[value]
// 修改对应下标显示 // 修改对应下标显示
app.globalData.yqdInfo.subIndex = value app.globalData.yqdInfo.subIndex = value
let obj = {} let obj = {}
...@@ -167,11 +149,7 @@ Page({ ...@@ -167,11 +149,7 @@ Page({
wx.$util.showLoading('加载中...') wx.$util.showLoading('加载中...')
api.swtichSubLoginInfo(obj).then(res => { api.swtichSubLoginInfo(obj).then(res => {
console.log(res) console.log(res)
let { let { code, data, message } = res
code,
data,
message
} = res
if (code == 0) { if (code == 0) {
wx.$util.setUserInfo(data) wx.$util.setUserInfo(data)
this.init(data) this.init(data)
...@@ -182,13 +160,8 @@ Page({ ...@@ -182,13 +160,8 @@ Page({
this.tapPicker() this.tapPicker()
}, },
jump(e) { jump(e) {
let { let { item, type } = e.currentTarget.dataset
item, let { userInfo } = this.data
type
} = e.currentTarget.dataset
let {
userInfo
} = this.data
// 判断是不是门店员工 // 判断是不是门店员工
if (userInfo.merchantType && !userInfo.isSuper && type == 2) { if (userInfo.merchantType && !userInfo.isSuper && type == 2) {
wx.$router.go(item.url) wx.$router.go(item.url)
...@@ -206,9 +179,7 @@ Page({ ...@@ -206,9 +179,7 @@ Page({
let today = new Date() let today = new Date()
let startDate = today.format('yyyy-MM-dd') let startDate = today.format('yyyy-MM-dd')
let endDate = today.format('yyyy-MM-dd') let endDate = today.format('yyyy-MM-dd')
let { let { tableBtn } = this.data
tableBtn
} = this.data
this.setData({ this.setData({
startDate, startDate,
endDate endDate
...@@ -218,14 +189,9 @@ Page({ ...@@ -218,14 +189,9 @@ Page({
}, },
rangeSelect(e) { rangeSelect(e) {
// console.log(e) // console.log(e)
let { tableBtn } = this.data
let { let {
tableBtn date: { start, end }
} = this.data
let {
date: {
start,
end
}
} = e.detail } = e.detail
this.setData({ this.setData({
startDate: start, startDate: start,
...@@ -246,14 +212,9 @@ Page({ ...@@ -246,14 +212,9 @@ Page({
}) })
}, },
changeTableSort(e) { changeTableSort(e) {
let { let { index } = e.currentTarget.dataset
index
} = e.currentTarget.dataset
console.log(index) console.log(index)
let { let { tableSort, tableObj } = this.data
tableSort,
tableObj
} = this.data
if (tableSort == index) { if (tableSort == index) {
tableObj[index].sort = !tableObj[index].sort tableObj[index].sort = !tableObj[index].sort
} else { } else {
...@@ -266,14 +227,8 @@ Page({ ...@@ -266,14 +227,8 @@ Page({
this.sortTable(tableObj) this.sortTable(tableObj)
}, },
sortTable(tableObj) { sortTable(tableObj) {
let { let { tableSort, table } = this.data
tableSort, let { key, sort } = tableObj[tableSort]
table
} = this.data
let {
key,
sort
} = tableObj[tableSort]
const objectArraySort = keyName => { const objectArraySort = keyName => {
return (objectN, objectM) => { return (objectN, objectM) => {
const valueN = objectN[keyName] const valueN = objectN[keyName]
...@@ -299,9 +254,7 @@ Page({ ...@@ -299,9 +254,7 @@ Page({
}, },
// 10s轮询一次待补录 // 10s轮询一次待补录
getWaitOrder() { getWaitOrder() {
let { let { isStaff } = this.data
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')
...@@ -311,10 +264,7 @@ Page({ ...@@ -311,10 +264,7 @@ Page({
.waitinputorder() .waitinputorder()
.then(result => { .then(result => {
// console.log(result) // console.log(result)
let { let { code, data } = result
code,
data
} = result
this.setTime() this.setTime()
if (code == 0) { if (code == 0) {
this.setData({ this.setData({
...@@ -329,11 +279,7 @@ Page({ ...@@ -329,11 +279,7 @@ Page({
api.getHomeReport().then(res => { api.getHomeReport().then(res => {
wx.$util.hideLoading() wx.$util.hideLoading()
console.log(res) console.log(res)
let { let { code, data, message } = res
code,
data,
message
} = res
if (code == 0) { if (code == 0) {
this.setData({ this.setData({
report: data report: data
...@@ -348,15 +294,7 @@ Page({ ...@@ -348,15 +294,7 @@ Page({
this.getMerchantCouponList() this.getMerchantCouponList()
}, },
getMerchantCouponList() { getMerchantCouponList() {
let { let { orderByTypeEnum, tableSort, tableObj, startDate, endDate, totalTableSum, tableWidth } = this.data
orderByTypeEnum,
tableSort,
tableObj,
startDate,
endDate,
totalTableSum,
tableWidth
} = this.data
let target = tableObj[tableSort].sort let target = tableObj[tableSort].sort
let orderByType = orderByTypeEnum[target][tableSort] let orderByType = orderByTypeEnum[target][tableSort]
api api
...@@ -367,11 +305,7 @@ Page({ ...@@ -367,11 +305,7 @@ Page({
}) })
.then(res => { .then(res => {
console.log(res) console.log(res)
let { let { code, message, data } = res
code,
message,
data
} = res
let table = [] let table = []
if (code == 0) { if (code == 0) {
table = data ? data.page?.list : [] table = data ? data.page?.list : []
...@@ -415,8 +349,7 @@ Page({ ...@@ -415,8 +349,7 @@ Page({
} }
}, },
init(userInfo) { init(userInfo) {
getYQInfo(userInfo) getYQInfo(userInfo).then(result => {
.then(result => {
console.log(result) console.log(result)
// console.log(app.globalData.isYqdSuper) // console.log(app.globalData.isYqdSuper)
this.getPageData() this.getPageData()
...@@ -424,7 +357,6 @@ Page({ ...@@ -424,7 +357,6 @@ Page({
...result ...result
}) })
}) })
}, },
checkShowOrderPop(options) { checkShowOrderPop(options) {
let userInfo = wx.$util.getStorageSync('dj_boutique_user_info') let userInfo = wx.$util.getStorageSync('dj_boutique_user_info')
...@@ -467,15 +399,15 @@ Page({ ...@@ -467,15 +399,15 @@ Page({
* 生命周期函数--监听页面初次渲染完成 * 生命周期函数--监听页面初次渲染完成
*/ */
onReady: function () { onReady: function () {
const accountInfo = wx.getAccountInfoSync() // const accountInfo = wx.getAccountInfoSync()
let checklist = [] let checklist = []
switch (accountInfo.miniProgram.envVersion) { switch (env) {
case 'develop': case 'develop':
checklist = [] checklist = []
break break
case 'trial': case 'trial':
// index = manual ? index : 2 // index = manual ? index : 2
checklist = ['15398879285', '15816539334'] checklist = ['15398879285']
break break
case 'release': case 'release':
checklist = ['18123663366', '19557403672'] checklist = ['18123663366', '19557403672']
...@@ -485,10 +417,7 @@ Page({ ...@@ -485,10 +417,7 @@ Page({
break break
} }
// 判断是不是特殊账号 // 判断是不是特殊账号
let { let { menu, userInfo } = this.data
menu,
userInfo
} = this.data
if (checklist.includes(userInfo?.accountName)) { if (checklist.includes(userInfo?.accountName)) {
menu = menu.filter(e => e.name != '预约管理') menu = menu.filter(e => e.name != '预约管理')
this.setData({ this.setData({
...@@ -507,9 +436,7 @@ Page({ ...@@ -507,9 +436,7 @@ Page({
// 如果是员工 开启订单补录轮询 // 如果是员工 开启订单补录轮询
this.getWaitOrder() this.getWaitOrder()
if (userInfo) { if (userInfo) {
let { let { userInfo: newUserInfo } = this.data
userInfo: newUserInfo
} = this.data
// console.log(newUserInfo) // console.log(newUserInfo)
if (newUserInfo) { if (newUserInfo) {
let isChangeLogin = newUserInfo.subLoginUser.merchantId != userInfo.subLoginUser.merchantId let isChangeLogin = newUserInfo.subLoginUser.merchantId != userInfo.subLoginUser.merchantId
......
...@@ -42,9 +42,7 @@ ...@@ -42,9 +42,7 @@
placeholder="点击选择" placeholder="点击选择"
disabled="{{orderObj.orderSource == 5}}"> disabled="{{orderObj.orderSource == 5}}">
<block wx:if="{{orderObj.subShopMerchantName}}"> <block wx:if="{{orderObj.subShopMerchantName}}">
<view class="between"> <view class="between">{{orderObj.subShopMerchantName}}</view>
{{orderObj.subShopMerchantName}}
</view>
</block> </block>
</gl-cell> </gl-cell>
</view> </view>
...@@ -247,7 +245,9 @@ ...@@ -247,7 +245,9 @@
<view class="icon" bindtap="delGoodsList" data-index="{{index}}"> <view class="icon" bindtap="delGoodsList" data-index="{{index}}">
<image src="../../images/del.png" /> <image src="../../images/del.png" />
</view> </view>
<view class="name text-hide">{{filter.replaceItemText(item.upgradeGoodsName) || filter.replaceItemText(item.goodsInfo.goodsName)}}</view> <view class="name text-hide">
{{filter.replaceItemText(item.upgradeGoodsName) || filter.replaceItemText(item.goodsInfo.goodsName)}}
</view>
<view class="price-box"> <view class="price-box">
¥ ¥
<view class="price"> <view class="price">
...@@ -321,6 +321,7 @@ ...@@ -321,6 +321,7 @@
show="{{selesBox}}" show="{{selesBox}}"
title="选择合作门店" title="选择合作门店"
sub-title="选择销售顾问" sub-title="选择销售顾问"
orderObj="{{orderObj}}"
userInfo="{{userInfo}}" userInfo="{{userInfo}}"
type="1" type="1"
oderType="recorder" /> oderType="recorder" />
...@@ -329,7 +330,7 @@ ...@@ -329,7 +330,7 @@
title="选择二级流量方" title="选择二级流量方"
selectedSelesMerchantId="{{orderObj.merchantId}}" selectedSelesMerchantId="{{orderObj.merchantId}}"
selectedCustomerInfo="{{orderObj.customer.customerId}}" selectedCustomerInfo="{{orderObj.customer.customerId}}"
selectedSubShopMerchantId="{{orderObj.subShopMerchantId}}"/> selectedSubShopMerchantId="{{orderObj.subShopMerchantId}}" />
<car-brands <car-brands
show="{{carBrandBox}}" show="{{carBrandBox}}"
bindconfirm="chooseCar" bindconfirm="chooseCar"
......
...@@ -320,6 +320,7 @@ Page({ ...@@ -320,6 +320,7 @@ Page({
// console.log(arr[i]) // console.log(arr[i])
delete orderInfo[deleteList[i]] delete orderInfo[deleteList[i]]
} }
orderInfo.againOrder = true
wx.$router.redirectTo('createOrder', orderInfo) wx.$router.redirectTo('createOrder', orderInfo)
// merchantDistributionList,expenseCategoryList,profitAllocatinList // merchantDistributionList,expenseCategoryList,profitAllocatinList
}, },
......
...@@ -281,9 +281,9 @@ Page({ ...@@ -281,9 +281,9 @@ Page({
submit(i) { submit(i) {
this.checkPhoneUseConfig() this.checkPhoneUseConfig()
console.log(i); console.log(i)
let { type } = i.currentTarget.dataset let { type } = i.currentTarget.dataset
console.log(type); 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)
...@@ -317,16 +317,16 @@ Page({ ...@@ -317,16 +317,16 @@ Page({
// notUpgradeOrderList, // notUpgradeOrderList,
createDate: dateObj.today createDate: dateObj.today
} }
if (type=='success') { if (type == 'success') {
orderObj.preliminaryOrders = notUpgradeOrderList orderObj.preliminaryOrders = notUpgradeOrderList
}else{ } else {
orderObj.notUpgradeOrderList = notUpgradeOrderList orderObj.notUpgradeOrderList = notUpgradeOrderList
} }
this.showLoading('提交中...') this.showLoading('提交中...')
console.log('orderObj', orderObj) console.log('orderObj', orderObj)
// return // return
const apiName = type=='success'? 'createPrerecordedOrderBatch':'notUpgradeOrder' const apiName = type == 'success' ? 'createPrerecordedOrderBatch' : 'notUpgradeOrder'
api[apiName](orderObj).then(res => { api[apiName](orderObj).then(res => {
wx.hideLoading() wx.hideLoading()
// console.log(orderObj, res) // console.log(orderObj, res)
...@@ -446,32 +446,46 @@ Page({ ...@@ -446,32 +446,46 @@ Page({
orderObj orderObj
}) })
}, },
initOPtions(res) {
if (res.customerName) {
// if (query) {
// 解码
for (const key in res) {
res[key] = decodeURIComponent(res[key])
}
// options.query = query
// }
console.log(res,'res');
let f = 'notUpgradeOrderList[' + 0 + '].customerName'
this.setData({
[f]: res.customerName
})
}
},
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function (options) { onLoad: function (res) {
this.setTimeList() this.setTimeList()
// console.log(options) console.log(res)
res && this.initOPtions(res)
}, },
/** /**
* 生命周期函数--监听页面初次渲染完成 * 生命周期函数--监听页面初次渲染完成
*/ */
onReady: function (res) { onReady: function (res) {
// console.log(res) console.log(res)
// this.getConfig() // this.getConfig()
}, },
/** /**
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow: function (res) { onShow: function (res) {
// console.log(wx.$modal) console.log(res, 'onroute')
// console.log(res)
// setTimeout(() => {
// wx.$util.showLoading()
// }, 2000)
}, },
onRoute(res) { onRoute(res) {
console.log(res, 'onroute')
res && this.initOPtions(res)
this.getSetting() this.getSetting()
}, },
/** /**
......
...@@ -71,14 +71,11 @@ ...@@ -71,14 +71,11 @@
placeholder="点击选择" placeholder="点击选择"
disabled="{{orderObj.orderSource == 5}}"> disabled="{{orderObj.orderSource == 5}}">
<block wx:if="{{orderObj.subShopMerchantName}}"> <block wx:if="{{orderObj.subShopMerchantName}}">
<view class="between"> <view class="between">{{orderObj.subShopMerchantName}}</view>
{{orderObj.subShopMerchantName}}
</view>
</block> </block>
</gl-cell> </gl-cell>
</view> </view>
</view> </view>
<block <block
wx:for="{{notUpgradeOrderList}}" wx:for="{{notUpgradeOrderList}}"
wx:for-item="li" wx:for-item="li"
...@@ -215,7 +212,6 @@ ...@@ -215,7 +212,6 @@
<view class="btns {{isFullSucreen?'isFullSucreen-btn':''}}"> <view class="btns {{isFullSucreen?'isFullSucreen-btn':''}}">
<view class="tips">可批量生成当天的战败客户,缺漏信息建档后在工单详情补充</view> <view class="tips">可批量生成当天的战败客户,缺漏信息建档后在工单详情补充</view>
<view class="btns-con"> <view class="btns-con">
<view class="confirm fail text-center" bindtap="submit"> <view class="confirm fail text-center" bindtap="submit">
战败下单 战败下单
<!-- {{notUpgradeOrderList.length==1?'提交客户工单':'提交'+notUpgradeOrderList.length+'个客户工单'}} --> <!-- {{notUpgradeOrderList.length==1?'提交客户工单':'提交'+notUpgradeOrderList.length+'个客户工单'}} -->
...@@ -230,11 +226,12 @@ ...@@ -230,11 +226,12 @@
show="{{selesBox}}" show="{{selesBox}}"
title="选择合作门店" title="选择合作门店"
sub-title="选择销售顾问" sub-title="选择销售顾问"
orderObj="{{orderObj}}"
userInfo="{{userInfo}}" userInfo="{{userInfo}}"
type="1" /> type="1" />
<sub-shop-merchant <sub-shop-merchant
show="{{subShopMerchantBox}}" show="{{subShopMerchantBox}}"
title="选择二级流量方" title="选择二级流量方"
selectedSelesMerchantId="{{orderObj.merchantId}}" selectedSelesMerchantId="{{orderObj.merchantId}}"
selectedSubShopMerchantId="{{orderObj.subShopMerchantId}}"/> selectedSubShopMerchantId="{{orderObj.subShopMerchantId}}" />
...@@ -470,10 +470,13 @@ Page({ ...@@ -470,10 +470,13 @@ Page({
*/ */
onLoad: function (options) { onLoad: function (options) {
// console.log(app.globalData.YQorderSetting, 'app.globalData.YQorderSetting.yqPhoneConfig') // console.log(app.globalData.YQorderSetting, 'app.globalData.YQorderSetting.yqPhoneConfig')
// console.log(options) console.log(options)
if (options.scene) { if (options.scene) {
this.setData(options) this.setData(options)
} }
if (options.orderCode) {
this.onRoute(options)
}
}, },
init(userInfo) { init(userInfo) {
let { scene, orderObj } = this.data let { scene, orderObj } = this.data
...@@ -595,7 +598,7 @@ Page({ ...@@ -595,7 +598,7 @@ Page({
// app . // app .
getYQorderInfo() getYQorderInfo()
.then(merchantSettingInfo => { .then(merchantSettingInfo => {
console.log(merchantSettingInfo,'merchantSettingInfo') // console.log(merchantSettingInfo, 'merchantSettingInfo')
let dictionaryObj = { let dictionaryObj = {
carTypeRequiredFlag: 'carBrand', carTypeRequiredFlag: 'carBrand',
standNoRequiredFlag: 'standNo', standNoRequiredFlag: 'standNo',
...@@ -607,7 +610,7 @@ Page({ ...@@ -607,7 +610,7 @@ Page({
requiredList.push(dictionaryObj[key]) requiredList.push(dictionaryObj[key])
} }
} }
console.log(merchantSettingInfo.yqPhoneConfig,'merchantSettingInfo.yqPhoneConfig'); // console.log(merchantSettingInfo.yqPhoneConfig, 'merchantSettingInfo.yqPhoneConfig')
// console.log(deepClone(merchantSettingInfo.yqPhoneConfig), 'deepClone(merchantSettingInfo.yqPhoneConfig)') // console.log(deepClone(merchantSettingInfo.yqPhoneConfig), 'deepClone(merchantSettingInfo.yqPhoneConfig)')
this.setData({ this.setData({
requiredList: [...new Set(requiredList)], requiredList: [...new Set(requiredList)],
...@@ -653,16 +656,26 @@ Page({ ...@@ -653,16 +656,26 @@ Page({
onShow: function () { onShow: function () {
wx.disableAlertBeforeUnload && wx.disableAlertBeforeUnload() //关闭小程序页面返回询问对话框 wx.disableAlertBeforeUnload && wx.disableAlertBeforeUnload() //关闭小程序页面返回询问对话框
}, },
onRoute(res) { async onRoute(res) {
// debugger // debugger
// console.log(res) console.log(res)
// console.log() // console.log()
if (res.orderCode && res.page) {
let result = await api.getOrderDetail({
orderCode: res.orderCode
})
console.log(res)
let { code, message, data } = result
// data.customer.customerName = res.customerName
code == 0 && (res = data)
}
let { tipsProps, isAlreadyExistOrder } = this.data let { tipsProps, isAlreadyExistOrder } = this.data
if (Object.keys(res).length > 0) { if (Object.keys(res).length > 0) {
if (res.associateOrderCode) { if (res.associateOrderCode) {
tipsProps.showTips = true tipsProps.showTips = true
tipsProps.tipsText = '原订单录入信息有误,请重新提交正确的订单信息。' tipsProps.tipsText = '原订单录入信息有误,请重新提交正确的订单信息。'
} else if (res.orderCode) { } else if (res.orderCode || res.againOrder) {
// 以建档(预约列表)/待跟进工单不可建档 // 以建档(预约列表)/待跟进工单不可建档
isAlreadyExistOrder = true isAlreadyExistOrder = true
tipsProps.showTips = false tipsProps.showTips = false
......
...@@ -40,9 +40,7 @@ ...@@ -40,9 +40,7 @@
placeholder="点击选择" placeholder="点击选择"
disabled="{{orderObj.orderSource == 5}}"> disabled="{{orderObj.orderSource == 5}}">
<block wx:if="{{orderObj.subShopMerchantName}}"> <block wx:if="{{orderObj.subShopMerchantName}}">
<view class="between"> <view class="between">{{orderObj.subShopMerchantName}}</view>
{{orderObj.subShopMerchantName}}
</view>
</block> </block>
</gl-cell> </gl-cell>
</view> </view>
...@@ -361,8 +359,16 @@ ...@@ -361,8 +359,16 @@
</view> </view>
</block> </block>
<merchant-seles <merchant-seles
show="{{salesmanBox}}"
isDefault="{{isDefault}}"
title="选择园区店"
sub-title="选择转化人员"
userInfo="{{userInfo}}"
type="2" />
<merchant-seles
show="{{selesBox}}" show="{{selesBox}}"
title="选择合作门店" title="选择合作门店"
orderObj="{{orderObj}}"
sub-title="选择销售顾问" sub-title="选择销售顾问"
userInfo="{{userInfo}}" userInfo="{{userInfo}}"
type="1" /> type="1" />
...@@ -371,7 +377,7 @@ ...@@ -371,7 +377,7 @@
title="选择二级流量方" title="选择二级流量方"
selectedSelesMerchantId="{{orderObj.merchantId}}" selectedSelesMerchantId="{{orderObj.merchantId}}"
selectedCustomerInfo="{{orderObj.customer.customerId}}" selectedCustomerInfo="{{orderObj.customer.customerId}}"
selectedSubShopMerchantId="{{orderObj.subShopMerchantId}}"/> selectedSubShopMerchantId="{{orderObj.subShopMerchantId}}" />
<car-brands <car-brands
show="{{carBrandBox}}" show="{{carBrandBox}}"
bindconfirm="chooseCar" bindconfirm="chooseCar"
...@@ -384,13 +390,6 @@ ...@@ -384,13 +390,6 @@
placeholder="请填写内容,最多30个字" placeholder="请填写内容,最多30个字"
maxlength="30" maxlength="30"
value="{{orderObj.remark}}" /> value="{{orderObj.remark}}" />
<merchant-seles
show="{{salesmanBox}}"
isDefault="{{isDefault}}"
title="选择园区店"
sub-title="选择转化人员"
userInfo="{{userInfo}}"
type="2" />
<coupon <coupon
show="{{couponBox}}" show="{{couponBox}}"
class="coupon" class="coupon"
......
...@@ -27,11 +27,30 @@ ...@@ -27,11 +27,30 @@
</gl-cell> </gl-cell>
</view> --> </view> -->
<view class="customerName"> <view class="customerName">
<gl-cell border valueAlign="right" label="车主姓名" requiredAfter labelWidth="140rpx" required> <gl-cell
<input placeholder="点击输入" class="input" placeholder-class="placeholder-class" maxlength="16" value="{{orderObj.customer.customerName}}" bindinput="input" data-name="customer.customerName" disabled="{{orderObj.orderSource == 5}}" always-embed></input> border
valueAlign="right"
label="车主姓名"
requiredAfter
labelWidth="140rpx"
required>
<input
placeholder="点击输入"
class="input"
placeholder-class="placeholder-class"
maxlength="16"
value="{{orderObj.customer.customerName}}"
bindinput="input"
data-name="customer.customerName"
disabled="{{orderObj.orderSource == 5}}"
always-embed></input>
</gl-cell> </gl-cell>
</view> </view>
<gl-cell border label="性别" valueAlign="right" labelWidth="140rpx"> <gl-cell
border
label="性别"
valueAlign="right"
labelWidth="140rpx">
<view class="gender-box"> <view class="gender-box">
<view class="block text-center {{orderObj.customer.customerSex==1?'':'right'}}" /> <view class="block text-center {{orderObj.customer.customerSex==1?'':'right'}}" />
<view class="male text-center {{orderObj.customer.customerSex == 1?'active':''}}" bindtap="changeGender" data-gender="1"> <view class="male text-center {{orderObj.customer.customerSex == 1?'active':''}}" bindtap="changeGender" data-gender="1">
...@@ -43,24 +62,76 @@ ...@@ -43,24 +62,76 @@
</view> </view>
</gl-cell> </gl-cell>
<view class="customerPhone" wx:if="{{!phoneShow}}"> <view class="customerPhone" wx:if="{{!phoneShow}}">
<gl-cell border valueAlign="right" label="手机号" requiredAfter labelWidth="140rpx" required> <gl-cell
<input placeholder="点击输入" class="input" type="number" maxlength="11" placeholder-class="placeholder-class" value="{{orderObj.customer.customerPhone}}" bindinput="input" data-name="customer.customerPhone" disabled="{{orderObj.orderSource == 5||orderObj.orderSource == 6}}" always-embed></input> border
valueAlign="right"
label="手机号"
requiredAfter
labelWidth="140rpx"
required>
<input
placeholder="点击输入"
class="input"
type="number"
maxlength="11"
placeholder-class="placeholder-class"
value="{{orderObj.customer.customerPhone}}"
bindinput="input"
data-name="customer.customerPhone"
disabled="{{orderObj.orderSource == 5||orderObj.orderSource == 6}}"
always-embed></input>
</gl-cell> </gl-cell>
</view> </view>
<gl-cell border valueAlign="right" label="选择车型" labelWidth="140rpx" haveArrow placeholder="点击选择" bindclick="showPopup" data-show-name="carBrandBox"> <gl-cell
border
valueAlign="right"
label="选择车型"
labelWidth="140rpx"
haveArrow
placeholder="点击选择"
bindclick="showPopup"
data-show-name="carBrandBox">
<block wx:if="{{orderObj.customer.carSeriesName}}"> <block wx:if="{{orderObj.customer.carSeriesName}}">
<view class="between"> <view class="between">
{{orderObj.customer.carBrand}}-{{orderObj.customer.carChildsBrandName}}-{{orderObj.customer.carSeriesName}} {{orderObj.customer.carBrand}}-{{orderObj.customer.carChildsBrandName}}-{{orderObj.customer.carSeriesName}}
</view> </view>
</block> </block>
</gl-cell> </gl-cell>
<gl-cell border valueAlign="right" label="车架号( VIN码 )" labelWidth="240rpx"> <gl-cell
<input placeholder="点击输入" class="input" placeholder-class="placeholder-class" value="{{orderObj.customer.standNo}}" bindinput="input" data-name="customer.standNo" maxlength="17" always-embed></input> border
valueAlign="right"
label="车架号( VIN码 )"
labelWidth="240rpx">
<input
placeholder="点击输入"
class="input"
placeholder-class="placeholder-class"
value="{{orderObj.customer.standNo}}"
bindinput="input"
data-name="customer.standNo"
maxlength="17"
always-embed></input>
</gl-cell> </gl-cell>
<gl-cell border valueAlign="right" label="车牌号" labelWidth="240rpx"> <gl-cell
<input placeholder="点击输入" class="input" placeholder-class="placeholder-class" value="{{orderObj.customer.plateNumber}}" bindinput="input" data-name="customer.plateNumber" maxlength="10" always-embed></input> border
valueAlign="right"
label="车牌号"
labelWidth="240rpx">
<input
placeholder="点击输入"
class="input"
placeholder-class="placeholder-class"
value="{{orderObj.customer.plateNumber}}"
bindinput="input"
data-name="customer.plateNumber"
maxlength="10"
always-embed></input>
</gl-cell> </gl-cell>
<gl-cell border label="是否体验" valueAlign="right" labelWidth="140rpx"> <gl-cell
border
label="是否体验"
valueAlign="right"
labelWidth="140rpx">
<view class="gender-box"> <view class="gender-box">
<view class="block text-center {{orderObj.customer.experienceFlag=='Y'?'':'right'}}" /> <view class="block text-center {{orderObj.customer.experienceFlag=='Y'?'':'right'}}" />
<view class="male text-center {{orderObj.customer.experienceFlag == 'Y'?'active':''}}" bindtap="changeExperience" data-experience="Y"> <view class="male text-center {{orderObj.customer.experienceFlag == 'Y'?'active':''}}" bindtap="changeExperience" data-experience="Y">
...@@ -71,7 +142,15 @@ ...@@ -71,7 +142,15 @@
</view> </view>
</view> </view>
</gl-cell> </gl-cell>
<gl-cell border valueAlign="right" label="备注" labelWidth="140rpx" bindclick="showPopup" data-show-name="showRemark" placeholder="30字以内" value="{{orderObj.remark}}" /> <gl-cell
border
valueAlign="right"
label="备注"
labelWidth="140rpx"
bindclick="showPopup"
data-show-name="showRemark"
placeholder="30字以内"
value="{{orderObj.remark}}" />
<!-- <view class="sellerUserId"> <!-- <view class="sellerUserId">
<gl-cell <gl-cell
border border
...@@ -182,18 +261,27 @@ ...@@ -182,18 +261,27 @@
</view> </view>
<view class="btns {{isFullSucreen?'isFullSucreen-btn':''}}"> <view class="btns {{isFullSucreen?'isFullSucreen-btn':''}}">
<text class="tips x-center">客户信息仅支持修改以上部分。</text> <text class="tips x-center">客户信息仅支持修改以上部分。</text>
<view class="save text-center" data-giveUp="{{true}}" bindtap="submit" data-save>放弃</view> <view
class="save text-center"
data-giveUp="{{true}}"
bindtap="submit"
data-save>放弃
</view>
<view class="confirm text-center" bindtap="submit">提交修改</view> <view class="confirm text-center" bindtap="submit">提交修改</view>
</view> </view>
</block> </block>
<!-- <merchant-seles <car-brands
show="{{selesBox}}" show="{{carBrandBox}}"
title="选择合作门店" bindconfirm="chooseCar"
sub-title="选择销售顾问" carSeriesId="{{orderObj.customer.carSeriesId}}"
userInfo="{{userInfo}}" merchantId="{{orderObj.merchantId || undefined}}" />
type="1" /> --> <remark-popup
<car-brands show="{{carBrandBox}}" bindconfirm="chooseCar" carSeriesId="{{orderObj.customer.carSeriesId}}" merchantId="{{orderObj.merchantId || undefined}}" /> wx:if="{{showRemark}}"
<remark-popup wx:if="{{showRemark}}" show="{{showRemark}}" bindconfirm="remarkConfirm" placeholder="请填写内容,最多30个字" maxlength="30" value="{{orderObj.remark}}" /> show="{{showRemark}}"
bindconfirm="remarkConfirm"
placeholder="请填写内容,最多30个字"
maxlength="30"
value="{{orderObj.remark}}" />
<!-- <merchant-seles <!-- <merchant-seles
show="{{salesmanBox}}" show="{{salesmanBox}}"
isDefault="{{isDefault}}" isDefault="{{isDefault}}"
...@@ -217,3 +305,4 @@ ...@@ -217,3 +305,4 @@
show="{{remarkBox}}" show="{{remarkBox}}"
qrCode="{{orderInfo.payOrder.outTradeNo}}" qrCode="{{orderInfo.payOrder.outTradeNo}}"
price="{{orderInfo.total_price}}" /> --> price="{{orderInfo.total_price}}" /> -->
...@@ -3,23 +3,23 @@ ...@@ -3,23 +3,23 @@
*/ */
import { DEFAULT_GET_STORAGEKEY, STORAGE_OBJECTkEY } from '~/utils/constantData' import { DEFAULT_GET_STORAGEKEY, STORAGE_OBJECTkEY } from '~/utils/constantData'
import { env } from '~/config'
class Storage { class Storage {
types = { types = {
1: 'get', // get 1: 'get', // get
2: 'set', // set 2: 'set', // set
3: 'rm' // rm 3: 'rm' // rm
} }
envVersion = { // envVersion = {
develop: '开发版', // develop: '开发版',
trial: '体验版', // trial: '体验版',
release: '正式版' // release: '正式版'
} // }
// defaultGetStorageKey = DEFAULT_GET_STORAGEKEY // defaultGetStorageKey = DEFAULT_GET_STORAGEKEY
/** 构造函数 */ /** 构造函数 */
constructor() { constructor() {
/** 获取当前小程序环境变量 */ /** 获取当前小程序环境变量 */
const accountInfo = wx.getAccountInfoSync() this.environment = env || 'release'
this.environment = accountInfo?.miniProgram.envVersion || 'release'
} }
/** /**
......
...@@ -17,10 +17,10 @@ export const STORAGE_OBJECTkEY = { ...@@ -17,10 +17,10 @@ export const STORAGE_OBJECTkEY = {
authphone: 'authphone', authphone: 'authphone',
disLikeRecordFlag: 'disLikeRecordFlag', disLikeRecordFlag: 'disLikeRecordFlag',
fileList: 'fileList', fileList: 'fileList',
posterId: 'posterId', posterId: 'posterId'
} }
export const IMG_VERSION = () => { // export const IMG_VERSION = () => {
const accountInfo = wx.getAccountInfoSync() // const accountInfo = wx.getAccountInfoSync()
return accountInfo.miniProgram.version || '1.0.0' // return accountInfo.miniProgram.version || '1.0.0'
} // }
import { env } from '~/config' import { envIndex } from '~/config'
const accountInfo = wx.getAccountInfoSync()
const systemInfo = wx.getSystemInfoSync()
// console.log(systemInfo);
// console.log(accountInfo.miniProgram.envVersion)
//手动控制体验版环境的请求 true就依据下面index false就默认为2 // console.log(envIndex, 'envIndex')
const manual = false
const release = false
let index = env
// 判断小程序环境
// develop:开发版(正常开发工具,测试时)
// trial:体验版
// release:正式版
// console.log( systemInfo.platform);
// console.log(accountInfo.miniProgram.envVersion);
if (systemInfo.platform != 'devtools') {
switch (accountInfo.miniProgram.envVersion) {
case 'develop':
break
case 'trial':
index = manual ? index : 2
break
case 'release':
index = release ? index : 3
break
default:
index = 3
break
}
}
// console.log(index);
const secretKey_items = { const secretKey_items = {
ip: { ip: {
appKey: '48e5e13229b82c1b4e6e8c96151f0637', appKey: '48e5e13229b82c1b4e6e8c96151f0637',
...@@ -80,7 +49,8 @@ const scrmSecretKey_items = { ...@@ -80,7 +49,8 @@ const scrmSecretKey_items = {
const domain_items = { const domain_items = {
ip: { ip: {
// dj: 'http://192.168.1.165:8292', // dj: 'http://192.168.1.165:8292',
dj: 'http://192.168.1.170:8292', // dj: 'http://192.168.1.170:8292',
dj: 'http://192.168.1.169:8292',//蔡远明
scrm: 'http://192.168.1.165:8292' scrm: 'http://192.168.1.165:8292'
}, },
dev: { dev: {
...@@ -100,22 +70,13 @@ const domain_items = { ...@@ -100,22 +70,13 @@ const domain_items = {
scrm: 'https://scrm.beta.glsx.com.cn' scrm: 'https://scrm.beta.glsx.com.cn'
} }
} }
// const domain_items = {
// // ip: 'http://192.168.2.59:8292',
// // ip: 'http://192.168.1.129:8392',
// // ip: 'http://192.168.1.129:8292',
// ip: 'http://192.168.1.165:8292',
// // ip: 'http://192.168.2.3:8292',
// dev: 'https://dj.dev.glsx.com.cn',
// uat: 'https://dj.test.glsx.com.cn',
// // uat: 'https://dj.beta.glsx.com.cn',
// prod: 'https://dj.glsx.com.cn',
// preRelease: 'https://dj.beta.glsx.com.cn'
// }
const target = ['ip', 'dev', 'uat', 'prod', 'preRelease'] const target = ['ip', 'dev', 'uat', 'prod', 'preRelease']
// console.log(domain_items[target[index]]);
module.exports = { module.exports = {
domain: domain_items[target[index]], domain: domain_items[target[envIndex]],
secretKey: secretKey_items[target[index]], secretKey: {
scrmSecretKey: scrmSecretKey_items[target[index]] dj: secretKey_items[target[envIndex]],
scrm: scrmSecretKey_items[target[envIndex]]
}
} }
import { secretKey, domain, path, sign,scrmSecretKey } from './http.js' import { secretKey, domain, path, sign } from './http.js'
// console.log(secretKey, 'secretKey')
import util from '~/utils/util.js' import util from '~/utils/util.js'
/**接口 */ /**接口 */
class Request { class Request {
...@@ -34,33 +35,13 @@ class Request { ...@@ -34,33 +35,13 @@ class Request {
data data
} = response } = response
// // 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) { if (code == 20 || code == 21) {
let thisPage = wx.$router.getPageInstance() let thisPage = wx.$router.getPageInstance()
// console.log(thisPage); // console.log(thisPage);
wx.hideLoading() wx.hideLoading()
if (thisPage.route != 'pages/wxLogin/wxLogin') { if (thisPage.route != 'pages/wxLogin/wxLogin') {
wx.showModal({
title: '温馨提示',
content: '登录过期,请重新登录。',
showCancel: false,
confirmText: '去登录',
confirmColor: '#3582EE',
success(res) {
if (res.confirm) {
getApp().login(true) getApp().login(true)
} }
}
})
}
} else if (code == -1) { } else if (code == -1) {
wx.showToast({ wx.showToast({
title: message || '网络请求失败', title: message || '网络请求失败',
...@@ -79,10 +60,6 @@ class Request { ...@@ -79,10 +60,6 @@ class Request {
icon: 'error' icon: 'error'
}) })
reject(error) reject(error)
// if (fail && typeof fail == 'function') {
// fail(error, reject)
// } else {
// }
}, },
complete() { complete() {
wx.stopPullDownRefresh() wx.stopPullDownRefresh()
...@@ -101,15 +78,17 @@ class Request { ...@@ -101,15 +78,17 @@ class Request {
data['locale'] = 'zh_CN' data['locale'] = 'zh_CN'
data['source'] = 'dj-wechat' data['source'] = 'dj-wechat'
// 兼容线上appkey和secret不一样的情况 // 兼容线上dj和scrm appkey和secret不一样的情况
let djapi = data.method.includes('dj.api') const apiName = data.method.split('.api')[0]
let scmrapi = data.method.includes('scrm.api') // 为空报错
// console.log(scmrapi,'scmrapi'); if (!apiName) {
const appKey = scmrapi?scrmSecretKey.appKey:djapi?secretKey.appKey:'' throw new Error('apiName is null')
const secret = scmrapi?scrmSecretKey.secret:djapi?secretKey.secret:'' }
data['appKey'] = appKey const appKey = secretKey[apiName].appKey
const secret = secretKey[apiName].secret
data['appKey'] = appKey
let obj = sign(data, secret, noSignAttr) let obj = sign(data, secret, noSignAttr)
//data['sign'] = obj.sign; //data['sign'] = obj.sign;
......
import { dsnUrl } from '~/config' import { dsnUrl } from '~/config'
import * as Sentry from '~/utils/lib/sentry-miniapp' import * as Sentry from '~/utils/lib/sentry-miniapp'
import { env } from '~/config'
// console.log(env, 'env')
export default function sentryInit() { export default function sentryInit() {
// accountInfo.miniProgram.envVersion == 'release' && //测试和生产才开启sentry
const accountInfo = wx.getAccountInfoSync() const envNameList = ['trial', 'release']
//测试和生产才开发sentry envNameList.includes(env) &&
const env = ['trial', 'release']
env.includes(accountInfo.miniProgram.envVersion) &&
Sentry.init({ Sentry.init({
// dsn: 'http://ebcf31c417cc4ce185782f046e4a87a2@sentry.glsx.com.cn/5'
dsn: dsnUrl dsn: dsnUrl
}) })
} }
...@@ -7,11 +7,6 @@ ...@@ -7,11 +7,6 @@
resolved "https://registry.npmmirror.com/@vant/weapp/-/weapp-1.10.14.tgz#b5f249097df1f1a7aa5c6602d8cad4afd397f934" resolved "https://registry.npmmirror.com/@vant/weapp/-/weapp-1.10.14.tgz#b5f249097df1f1a7aa5c6602d8cad4afd397f934"
integrity sha512-5usuhoN1kiOV6pzrdVzHrAux6DupKlGd9w+yYc992Zy1n1wHLZMb1dGM3+xtbNE3tpWE2qv95vIFSMpJRFyE7Q== integrity sha512-5usuhoN1kiOV6pzrdVzHrAux6DupKlGd9w+yYc992Zy1n1wHLZMb1dGM3+xtbNE3tpWE2qv95vIFSMpJRFyE7Q==
bignumber.js@^9.1.1:
version "9.1.1"
resolved "https://registry.npmmirror.com/bignumber.js/-/bignumber.js-9.1.1.tgz#c4df7dc496bd849d4c9464344c1aa74228b4dac6"
integrity sha512-pHm4LsMJ6lzgNGVfZHjMoO8sdoRhOzOH4MLmY65Jg70bpxCKu5iOHNJyfF6OyvYw7t8Fpf35RuzUyqnQsj8Vig==
rfdc@^1.3.0: rfdc@^1.3.0:
version "1.3.0" version "1.3.0"
resolved "https://registry.npmmirror.com/rfdc/-/rfdc-1.3.0.tgz#d0b7c441ab2720d05dc4cf26e01c89631d9da08b" resolved "https://registry.npmmirror.com/rfdc/-/rfdc-1.3.0.tgz#d0b7c441ab2720d05dc4cf26e01c89631d9da08b"
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!