Commit 7c47db8a by 张立顺

Merge branch 'develop' into 'master'

Develop

See merge request !38
2 parents e3950b7b ba9b21ff
Showing 76 changed files with 1334 additions and 666 deletions
......@@ -45,7 +45,7 @@ module.exports = {
/** 根据商户号获取员工列表信息(转化人员) */
getConversionEmployeeList(data) {
// 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)
},
/** 根据园区店商户号获取绑定4S店列表 */
......@@ -143,7 +143,7 @@ module.exports = {
return api.post('dj.api.smartcarlife.select.openScene.info', data)
},
// 获取2.0场景园区店下的4s店
// 获取园区店下的4s店
getSceneMerchantRefStoreList(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'
import { Storage } from '~/utils/cache/storage'
const $Storage = new Storage()
import { setSystem_info } from '~/utils/cache/storageApi'
// const accountInfo = wx.getAccountInfoSync()
import { checkYqdSuper, setConfigInfo, checkScene } from '~/store/index'
import eventbus from './utils/eventbus'
App({
......@@ -36,21 +36,57 @@ App({
// 如果是带参数的小程序码进入 会处理后把参数存到wx.$SCENE
// options.query.scene = 2 //调试用
// 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) {
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)
// 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) {
this.globalData.yqdInfo = {}
this.globalData.YQorderSetting = ''
util.removeStorage()
wx.$relogin = relogin
wx.showModal({
title: '温馨提示',
content: context || '登录过期,请重新登录。',
showCancel: false,
confirmText: '去登录',
confirmColor: '#3582EE',
success(res) {
if (res.confirm) {
that.globalData.yqdInfo = {}
that.globalData.YQorderSetting = ''
util.removeStorage()
wx.$relogin = relogin
router.reLaunch('pages.wxLogin')
}
}
})
} else {
router.reLaunch('pages.wxLogin')
}
router.reLaunch('pages.wxLogin')
},
globalData: {
......
......@@ -87,6 +87,7 @@ Component({
/**转化人员 & 销售人员*/
getConversionEmployeeList(merchantId, type) {
let target = type == 0 ? 'form.conversionEmployeeList.data' : 'form.salesmanList.data'
if (merchantId) {
// let {
// userInfo: {
......@@ -96,7 +97,8 @@ Component({
api
.getConversionEmployeeList({
// channelType,
merchantId
merchantId,
sceneList: type == 1 ? [1] : ''
})
.then(res => {
wx.hideLoading()
......@@ -205,28 +207,30 @@ Component({
/**4S店列表 */
getServiceMerchantList(merchantId) {
if (merchantId) {
api
.getServiceMerchantList({
merchantId
})
.then(res => {
let { code, data, message } = res
let arr = []
if (code == 0) {
arr = [
{
merchantId: '',
merchantName: '全部'
},
...data
]
} else {
wx.$util.showToast(message)
}
this.setData({
['form.range_4s.data']: arr
})
let userInfo = wx.$util.getUserInfo()
let params = {
merchantId,
sceneType: 1,
staffUUID: userInfo.uuid
}
api.getSceneMerchantRefStoreList(params).then(res => {
let { code, data, message } = res
let arr = []
if (code == 0) {
arr = [
{
merchantId: '',
merchantName: '全部'
},
...data
]
} else {
wx.$util.showToast(message)
}
this.setData({
['form.range_4s.data']: arr
})
})
} else {
this.setData({
['form.range_4s.data']: []
......
// components/GlCell/GlCell.js
Component({
options: {
styleIsolation: 'apply-shared'
},
/**
* 组件的属性列表
*/
......
<view class='cell-box'>
<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>
{{label||'标题'}}
<text wx:if='{{required&&requiredAfter}}' class='required'>*</text>
......
......@@ -13,25 +13,44 @@ Component({
type: Object,
observer: function (n) {
// console.log('userInfo', n)
if (n) {
this.getMerchantList()
}
if (n && this.data.type != 1) this.getMerchantList()
}
},
orderObj: {
type: Object
},
type: Number, //1.销售顾问,2.转化人员
// order:Object,
isDefault: Boolean,
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: {
merchantList: [],
selesList: [],
orderObj: {},
isFirst: true,
selesFirstRender: true,
orderSellerInfo: ''
},
......@@ -44,8 +63,9 @@ Component({
moreMerchant: !this.data.moreMerchant
})
},
getMerchantList(refresh) {
getMerchantList() {
let { userInfo, type } = this.data
// console.log('type', type)
let thisPage = wx.$router.getPageInstance()
// console.log(thisPage.data)
// console.log(thisPage)
......@@ -55,11 +75,18 @@ Component({
let isSellerInfo, orderSellerInfo
// 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](
type == 1
? {
merchantId: userInfo.merchantId
merchantId: userInfo.merchantId,
sceneType: 1,
staffUUID: orderObj.sellerUserId
}
: {}
).then(async res => {
......@@ -111,6 +138,7 @@ Component({
}
let targetName = type == 1 ? 'orderObj.merchantName' : 'orderObj.sellerMerchantName'
let targetId = type == 1 ? 'orderObj.merchantId' : 'orderObj.sellerMerchantId'
// let isShowSelesBox = type == 3 ? true : false
this.setData(
{
[targetId]: merchantId,
......@@ -133,7 +161,8 @@ Component({
let { orderObj } = thisPage.data
api
.getConversionEmployeeList({
merchantId
merchantId,
sceneList: type == 1 ? [1] : ''
})
.then(async res => {
wx.$util.hideLoading()
......@@ -264,7 +293,7 @@ Component({
[name]: '',
[id]: ''
})
console.log(orderObj)
// console.log(orderObj)
wx.$util.showLoading('切换中...')
this.getConversionEmployeeList(item.merchantId, true)
},
......@@ -304,7 +333,7 @@ Component({
}
}
console.log(result)
// console.log(result)
// let userInfo = util.getUserInfo()
// // 保存销售勾选做回显
// oderType != 'recorder' && util.setSellerInfo({ ...this.data.orderObj, subLoginMechantId: userInfo.subLoginUser.merchantId })
......
// components/OrderPopup/OrderPopup.js
// import qrcode from '../../utils/wxqrcode'
import qrcode from '~/utils/lib/wxqrcode'
import api from '../../api/api.js'
Component({
......
......@@ -83,7 +83,7 @@
value="{{textareaValue}}"
bindinput="blur"
bindblur="blur"
maxlength="30"
maxlength="100"
placeholder="请输入内容" />
</view>
<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
<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
......@@ -79,7 +79,7 @@ Component({
if (code == '0') {
// 有二级流量方数据 添加必填二级流量方字段
if (data?.length) {
if (!requiredList.includes('subShopMerchantId')) requiredList.unshift('subShopMerchantId')
if (!requiredList?.includes('subShopMerchantId')) requiredList?.unshift('subShopMerchantId')
data.map(i => {
i.active = false
if (i.subMerchantId == orderObj.subShopMerchantId) {
......@@ -106,7 +106,7 @@ Component({
// 无二级流量方字段时 清空选择的二级流量方字段
delete orderObj?.subShopMerchantId
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({
isShowSubShopMerchant: false,
requiredList,
......
......@@ -10,7 +10,44 @@
* 2测试
* 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
// export const preReleaseAppId = 'wx24ebae5768e74138'
......
{
"dependencies": {
"@vant/weapp": "^1.10.14",
"bignumber.js": "^9.1.1",
"rfdc": "^1.3.0"
}
}
......@@ -61,9 +61,18 @@ module.exports = {
let params = data || {}
return api.post('dj.api.smartcarlife.vehicle.damage.upgrade.quotation.generate', params)
},
/** 更新报价单状态 */
updateOrderStatus(data) {
let params = data || {}
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 @@
wx:if="{{textNameObj.editName}}">
{{textNameObj.editName}}
</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>
......@@ -33,7 +33,18 @@ Page({
getStoreList(e) {
// 获取园区店下的4s店数据 超管拉全部数据
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 => {
userInfo = wx.$util.getUserInfo()
let selectStroeIndex =
......
......@@ -67,7 +67,7 @@
<view class="item-footer">
<view>{{item.createdDate}}</view>
<!-- 超管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:else class="order-btn" bindtap="handleRecordOrder" data-target="{{item}}">{{btnTxt[item.orderStatus]}}</view>
</block>
......
// 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 { 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
Page({
/**
......@@ -10,11 +14,62 @@ Page({
data: {
orderCode: '',
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() {
const accountInfo = wx.getAccountInfoSync()
let _this = this
let oParams = {}
oParams.appId = 'wx06d1198e751435d1'
......@@ -22,7 +77,6 @@ Page({
oParams.path = 'packagesPayment/pages/payment/index'
oParams.scene = `orderCode=${_this.data.orderCode}&workWxSessionId=${wx.getStorageSync('dj_boutique_sessionId')}`
oParams.channelType = 1
// oParams.env = accountInfo.miniProgram.envVersion
// B端小程序调用接口生成领券码时,传参userId用uuid,类型由int变string
createQrcodeImage(oParams).then(res => {
console.log(res.data)
......@@ -31,8 +85,8 @@ Page({
wxqrcode: res.data
})
// 轮询订单状态
this.getDetail()
})
this.getDetail()
},
createQRCode(text) {
console.log(text)
......@@ -147,7 +201,7 @@ Page({
onRoute(options) {
// console.log(options = 19)
let { data, id } = options
// id = 26
// id = 14
this.setData({ id })
this.getQuotationInfoById()
},
......@@ -155,7 +209,7 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad(options) {
setWebSocket()
// setWebSocket()
},
/**
......
{
"usingComponents": {
"order-detail": "../../../components/orderInfoCom/orderInfoCom"
"order-detail": "../../../components/orderInfoCom/orderInfoCom",
"popup-select-pay": "../components/PopupSelectPay/PopupSelect"
},
"navigationBarTitleText": "订单支付"
}
......@@ -7,9 +7,35 @@ page {
// background-color: #f5f5f5;
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 {
box-sizing: border-box;
padding: 32rpx 40rpx;
padding: 32rpx 40rpx 80rpx;
position: relative;
display: flex;
flex-direction: column;
......@@ -53,7 +79,7 @@ page {
width: 430rpx;
height: 430rpx;
background: #FFFFFF;
margin: 110rpx 0 50rpx;
margin: 0 0 50rpx;
// margin-bottom: 20rpx;
}
......
<!-- packageEquity/pages/carQuotation/CarQuotationPay/CarQuotationPay.wxml -->
<view class="OrderInfoPay">
<view class="qrCodeCom">
<!-- <gl-image src="../../../images/waitIcon.png" /> -->
<view class="title">
<image
show-menu-by-longpress
......@@ -13,14 +12,28 @@
<view class="label">待支付</view>
<view class="price">总保费{{orderDetail.totalPrice}}元/年</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
class="qrCode"
mode="scaleToFill"
src="{{wxqrcode}}"
src="{{selectPayType==1?wxqrcode:posqrcode}}"
binderror=""
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="bg" />
</view>
......@@ -48,4 +61,5 @@
</view>
</view>
</view>
<!-- <popup-select-pay show="{{popPayShow}}" bindconfirm="changePayType" /> -->
......@@ -6,6 +6,9 @@ import carLifeApi from '~/packageEquity/carEquityApi'
const defaultLabelWidth = '140rpx'
// import api from '~/api/api'
Component({
options: {
styleIsolation: 'apply-shared'
},
/**
* 组件的属性列表
*/
......
......@@ -16,6 +16,15 @@
overflow: hidden;
}
.pickerCell {
.cell-label {
font-weight: 500;
font-size: 32rpx;
color: #222222;
}
}
.employeeBox {
box-shadow: 0 6rpx 16rpx 0 #cdcdd159;
border-radius: 16rpx;
......@@ -30,6 +39,8 @@
display: flex;
}
.title {
display: flex;
justify-content: space-between;
......@@ -79,7 +90,7 @@
color: #B6B6B8;
}
.arrow {
.pickerArrow {
width: 28rpx;
height: 26rpx;
margin-top: 26rpx;
......
......@@ -5,6 +5,7 @@
border
valueAlign="right"
label="推荐人"
class="pickerCell"
labelWidth="{{defaultLabelWidth}}">
<picker
bindchange="handleSalesChange"
......@@ -12,7 +13,7 @@
range="{{employeeList}}"
range-key="staffName">
<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>
<text class="placeholder" wx:else>请选择</text>
</view>
......
......@@ -106,6 +106,7 @@ Component({
this.setData({
show: false
})
this.triggerEvent('confirm')
}
}
})
......@@ -227,6 +227,7 @@ Component({
this.setData({
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
<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
// packageEquity/pages/carEquity/components/SecondStep/SecondStep.js
import data from '../constant/stepData'
import fn from '../constant/ruleFn'
import { priceCounter } from '~/packageEquity/api'
const defaultLabelWidth = '140rpx'
Component({
options: {
styleIsolation: 'shared'
styleIsolation: 'apply-shared'
},
// behaviors: ['wx://component-export'],
attached() {
......@@ -80,7 +81,9 @@ Component({
popInputObj: {
type: 'add'
},
showError: false
showError: false,
insuranceCheck: false,
testQuotedPriceUpdate: 0
},
/**
......@@ -91,6 +94,55 @@ Component({
// let { activeNames } = this.data
// 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() {
......@@ -113,6 +165,12 @@ Component({
this.setData({
showYear: false
})
this.cancelInsuranceCheck()
},
cancelInsuranceCheck() {
this.setData({
insuranceCheck: false
})
},
// 取消选择年份的弹框
onCancel() {
......@@ -184,10 +242,12 @@ Component({
console.log(e)
let { name } = e.detail
// let { attrtype, attrname, typename } = this.data.tableObj
let { showError } = this.data
let { showError, insuranceCheck, orderInfo } = this.data
if (showError) return wx.$util.showToast('权益价不能小于最低权益价')
if (name == 'confirm') {
// 不是修改报价时,需要勾选保险
if (!insuranceCheck && !orderInfo.modifyEquityQuotation) return wx.$util.showToast('请先勾选保险')
this.triggerEvent('confirm')
} else {
this.triggerEvent('editSave')
......@@ -224,6 +284,7 @@ Component({
thisPage.setData({
['orderInfo' + '.' + attrtype + '.' + attrname]: value
})
this.cancelInsuranceCheck()
// console.log(thisPage.data)
}
// numberFixedDigit (e) { // 固定两位小数
......
......@@ -9,7 +9,6 @@
"popup-select": "../PopupSelect/PopupSelect",
"popup-input": "../PopupInput/PopupInput",
"van-popup": "@vant/weapp/popup/index",
"van-datetime-picker": "@vant/weapp/datetime-picker/index",
"van-picker": "@vant/weapp/picker/index"
}
}
......@@ -142,9 +142,13 @@
width: 570rpx;
}
}
}
}
.field_test {
color: blue !important;
}
.incrementInfo {
box-sizing: border-box;
......
......@@ -35,7 +35,7 @@
value="{{orderInfo.business.base}}"
data-attrName="base"
data-type='number'
type="digit"
type="digit"
placeholder="请输入保费"
data-attrType="business"
bindinput="handleInput">
......@@ -65,7 +65,7 @@
placeholder="请输入保费"
data-hold-keyboard
value="{{orderInfo.business.threePremium}}"
type="digit"
type="digit"
data-type='number'
data-attrType="business"
data-attrName="threePremium"
......@@ -99,7 +99,7 @@
value="{{orderInfo.business.carInsidePremium}}"
data-attrType="business"
data-attrName="carInsidePremium"
type="digit"
type="digit"
bindinput="handleInput">
<view slot="left-icon">
<view>¥</view>
......@@ -130,7 +130,7 @@
value="{{orderInfo.business.passengerPremium}}"
data-attrType="business"
data-attrName="passengerPremium"
type="digit"
type="digit"
bindinput="handleInput">
<view slot="left-icon">
<view>¥</view>
......@@ -183,6 +183,7 @@
border="{{false}}"
data-hold-keyboard
readonly="{{true}}"
disabled="{{true}}"
value="{{item.payPrice}}"
data-attrType="otherInsuranceList"
data-attrName="payPrice"
......@@ -224,7 +225,7 @@
value="{{orderInfo.mutualStrength.payPrice}}"
data-attrType="mutualStrength"
data-attrName="payPrice"
type="digit"
type="digit"
bindinput="handleInput">
<view slot="left-icon">
<view>¥</view>
......@@ -250,7 +251,7 @@
value="{{orderInfo.vehiclesAndVessels.payPrice}}"
data-attrType="vehiclesAndVessels"
data-attrName="payPrice"
type="digit"
type="digit"
bindinput="handleInput">
<view slot="left-icon">
<view>¥</view>
......@@ -267,22 +268,48 @@
</view>
</view>
<!-- bind:change="onChange" -->
<van-checkbox value="{{ true }}" shape="square">请勾选增值车损险服务</van-checkbox>
<view class="incrementInfo">
<!-- <view class="img" mode="widthFix" /> -->
<image class="img" src="{{orderInfo.quotationGoodsInfo.titlePictureUrl}}" />
<view class="info">
<view class="infoTitle">{{orderInfo.quotationGoodsInfo.goodsName}}</view>
<!-- class="content " -->
<view>
<text>包含</text>
<!-- {{orderInfo.quotationGoodsInfo.quotationGoodsServiceItemsRelationDTOList.length==index?'':'、'}} -->
<block wx:key="index" wx:for="{{orderInfo.quotationGoodsInfo.quotationGoodsServiceItemsRelationDTOList}}">
<text>{{item.serviceName}}{{orderInfo.quotationGoodsInfo.quotationGoodsServiceItemsRelationDTOList.length==index?'':'、'}}</text>
</block>
<van-checkbox
value="{{ insuranceCheck }}"
wx:if="{{!orderInfo.modifyEquityQuotation}}"
shape="square"
bind:change="onChangeInsurance">
请勾选增值车损险服务
</van-checkbox>
<block wx:if="{{insuranceCheck}}">
<view class="incrementInfo">
<!-- <view class="img" mode="widthFix" /> -->
<image class="img" src="{{orderInfo.quotationGoodsInfo.titlePictureUrl}}" />
<view class="info">
<view class="infoTitle">{{orderInfo.quotationGoodsInfo.goodsName}}</view>
<!-- class="content " -->
<view>
<text>包含</text>
<!-- {{orderInfo.quotationGoodsInfo.quotationGoodsServiceItemsRelationDTOList.length==index?'':'、'}} -->
<block wx:key="index" wx:for="{{orderInfo.quotationGoodsInfo.quotationGoodsServiceItemsRelationDTOList}}">
<text>{{item.serviceName}}{{orderInfo.quotationGoodsInfo.quotationGoodsServiceItemsRelationDTOList.length==index?'':'、'}}</text>
</block>
</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="title">增值权益价格</view>
<van-field
......@@ -294,7 +321,7 @@
data-attrName="quotedPriceUpdate"
maxlength="10"
data-type='number'
type="digit"
type="digit"
bindinput="handleInput">
<view slot="left-icon">
<view>¥</view>
......@@ -307,8 +334,12 @@
</van-collapse>
<Gl-Button-Group bindbtnTap="btnTap" textNameObj="{{textNameObj}}" />
<!-- customInput="{{customInput}}" -->
<popup-select show="{{popupShow}}" popObj="{{popObj}}" typeName="{{popObj.typename}}" />
<popup-input show="{{popupInputShow}}" popInputObj="{{popInputObj}}" />
<popup-select
show="{{popupShow}}"
popObj="{{popObj}}"
typeName="{{popObj.typename}}"
bindconfirm="cancelInsuranceCheck" />
<popup-input show="{{popupInputShow}}" popInputObj="{{popInputObj}}" bindconfirm="cancelInsuranceCheck" />
</view>
<!-- </scroll-view> -->
<van-popup
......
// packageEquity/pages/carEquity/serviceInfo/serviceInfo.js
import { getQuotationInfo, quotationAdd, updateQuotation, quotationGoods, getQuotationInfoById, quotationPicture } from '../../../api'
import { quotedImgUrl } from '~/config'
// console.log(quotedImgUrl, 'quotedImgUrl')
Page({
/**
* 页面的初始数据
......@@ -98,19 +100,11 @@ Page({
// quotationPicture
let { orderInfo } = this.data
const { id } = orderInfo
const accountInfo = wx.getAccountInfoSync()
const env = accountInfo.miniProgram.envVersion
console.log(env)
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)
quotationPicture({ id, quotedPriceUpdate, createQuotedUrl: createQuotedUrl[env] })
quotationPicture({ id, quotedPriceUpdate, createQuotedUrl: quotedImgUrl + id })
.then(result => {
// debugger
wx.hideLoading()
......@@ -140,7 +134,7 @@ Page({
let result = await this.handleSecondConfirmCheck()
let { code, data: id, message } = result
console.log(id)
// console.log(id)
if (id) {
// 校验生成告知书是否成功
let status = await this.getQuotationGenerate(id)
......@@ -163,34 +157,47 @@ Page({
// wx.$router.go('packageEquity.index')
},
handleSecondConfirmCheck() {
let { orderInfo, owner } = this.data
const insurance = ['business', 'mutualStrength', 'vehiclesAndVessels', 'valueAddedVehicleLoss', 'otherInsuranceList']
getInsurance() {
let { orderInfo } = this.data
orderInfo = wx.$util.deepClone(orderInfo)
owner = wx.$util.deepClone(owner)
let { default4SStoreInfo } = wx.$util.getUserInfo()
orderInfo.owner = owner
orderInfo.owner.price = this.multipliedByHundred(orderInfo.owner?.price) || ''
orderInfo.merchantId4s = default4SStoreInfo?.merchantId
orderInfo.merchantName4s = default4SStoreInfo?.merchantName
const insurance = ['business', 'mutualStrength', 'vehiclesAndVessels', 'valueAddedVehicleLoss', 'otherInsuranceList']
orderInfo.insureList = []
// multipliedByHundredObj
const business = this.multipliedByHundredObj(orderInfo.business)
const mutualStrength = this.multipliedByHundredObj(orderInfo.mutualStrength)
const vehiclesAndVessels = this.multipliedByHundredObj(orderInfo.vehiclesAndVessels)
const valueAddedVehicleLoss = this.multipliedByHundredObj(orderInfo.valueAddedVehicleLoss)
orderInfo.insureList = [business, mutualStrength, vehiclesAndVessels, valueAddedVehicleLoss]
// const otherInsuranceList =
orderInfo.otherInsuranceList.forEach(item => {
// return 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 => {
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)
try {
return new Promise(async (resolve, reject) => {
......
/* packageEquity/pages/carEquity/serviceInfo/serviceInfo.wxss */
page{
background: #f3f5f7;
}
.layout {
/* background: #F4F5F7; */
/* background: #1253d5; */
/* padding-bottom: 60rpx; */
background: #f3f5f7;
min-height: 100vh;
/* min-height: 100vh; */
}
.navigation-title {
......
......@@ -144,7 +144,7 @@ Page({
width: canvasWidth,
height: canvasHeight,
canvasId: 'signature',
fileType: 'jpg',
fileType: 'png',
success(res) {
// //将图片保存到本地相册
// wx.saveImageToPhotosAlbum({
......
......@@ -101,7 +101,7 @@
</view>
</block>
</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-label">报价金额</view>
<view class="text-hide">{{item.quotedPrice || '--'}}</view>
......
// packageEquity/pages/carQuotation/schemeConfirmation/schemeConfirmation.js
import { quotationPicture, updateOrderStatus, quotationGenerate } from '../../../api'
import { quotedImgUrl } from '~/config'
Page({
/**
* 页面的初始数据
......@@ -8,7 +9,8 @@ Page({
schemeConfirmationImg: '',
textNameObj: {
confirmName: '下一步·客户签字(3/4)',
editName: '修改报价',
editName: '修改权益报价',
editOrderName: '编辑报价单',
cancelName: '放弃报价'
},
id: '',
......@@ -54,6 +56,8 @@ Page({
} else if (name == 'edit') {
// this.triggerEvent('editSave')
this.backEdit()
} else if (name == 'editOrderName') {
wx.$router.redirectTo('createOrderCarQuotation', { id })
} else if (name == 'cancel') {
this.setData({
showRemark: true
......@@ -104,18 +108,7 @@ Page({
}
},
getQuotationPicture(id) {
const accountInfo = wx.getAccountInfoSync()
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] })
quotationPicture({ id, createQuotedUrl: quotedImgUrl + id })
.then(result => {
console.log('result', result)
// let {}
......
......@@ -14,6 +14,7 @@ page {
box-shadow: 0 6rpx 16rpx 0 #cdcdd159;
border-radius: 16rpx;
text-align: center;
overflow: hidden;
.title {
font-weight: 500;
......
......@@ -20,7 +20,7 @@ Page({
// let { noLogin } = options
let id = decodeURIComponent(options.scene).split('=')[1]
// noLogin
console.log(id)
// console.log(id)
id ? this.qrCodeScene(id) : this.getListSelectAccount()
// this.getListSelectAccount()
},
......@@ -162,11 +162,13 @@ Page({
let { data, message } = res
if (data) {
app.globalData.YQorderSetting = null
app.globalData.yqdInfo.merchantRange = null
wx.$util.setUserInfo(data.loginUserInfoList[0])
app.globalData.YQorderSetting = null
// console.log(data.loginUserInfoList[0])
checkYqdSuper(app, data.loginUserInfoList[0])
const SCENE = wx.$SCENE
console.log(SCENE, 'SCENE')
// debugger 兼容扫码优惠券进来和免登录逻辑冲突问题
if (SCENE && SCENE.path != 'pages/accountItems/accountItems') {
let {
......@@ -174,17 +176,19 @@ Page({
query
// : { scene }
} = SCENE
console.log(path, 'path')
let { target, name } = wx.$util.getSceneId(path)
// console.log(query)
// console.log(target,name);
wx.$router.reLaunch(`${target}.${name}`, query)
wx.$SCENE = null
} else {
// 超管默认开通所有场景
if (isSuper) {
// 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.$router.reLaunch('pages.sceneIndex')
return
......
......@@ -36,6 +36,7 @@ Page({
let { sceneList } = this.data
let userInfo = wx.$util.getUserInfo() || {}
let openSceneArr = userInfo?.openSceneArr || []
this.setData({
timeState: wx.$util.getTimeState()
})
......@@ -99,7 +100,8 @@ Page({
onShow() {
let { sceneList } = this.data
let userInfo = wx.$util.getUserInfo()
userInfo?.openSceneArr.includes(userInfo?.selectedSceneType) &&
let openSceneArr = userInfo?.openSceneArr || []
openSceneArr.includes(userInfo?.selectedSceneType) &&
sceneList.map(i => {
i.actived = false
if (i.sceneType == userInfo?.selectedSceneType) {
......
......@@ -17,6 +17,12 @@ Page({
loginToken
})
},
authChoose(e) {
let { detail: agree } = e
this.setData({
agree
})
},
changeLoginType(e) {
let { type } = e.currentTarget.dataset
this.setData({
......@@ -40,7 +46,7 @@ Page({
})
},
agree() {
let {agree} = this.data
let { agree } = this.data
this.setData({
agree: !agree
})
......@@ -82,63 +88,70 @@ Page({
})
},
smsLogin() {
const checkAgree = this.checkAgree()
if (checkAgree) return false
let { flag, code, mobile, loginType, accountNumber, password } = this.data
console.log(flag)
if (!flag) return
wx.$util.showLoading()
if (loginType == 1) { // 手机号登录
api.smsLogin({
code,
mobile
})
.then(result => {
wx.$util.showLoading()
if (result.code == 0) {
let { loginUserInfoList, sessionId } = result.data
if (loginUserInfoList.length > 0) {
wx.$util.setSessionId(sessionId)
wx.$router.reLaunch('pages.accountItems')
if (loginType == 1) {
// 手机号登录
api
.smsLogin({
code,
mobile
})
.then(result => {
wx.$util.showLoading()
if (result.code == 0) {
let { loginUserInfoList, sessionId } = result.data
if (loginUserInfoList.length > 0) {
wx.$util.setSessionId(sessionId)
wx.$router.reLaunch('pages.accountItems')
} else {
wx.$router.reLaunch('pages.nothing')
}
} else {
wx.$router.reLaunch('pages.nothing')
wx.hideLoading()
wx.showModal({
title: '温馨提示',
content: result.message,
showCancel: false,
confirmText: '知道了',
confirmColor: '#3582EE'
})
}
} else {
wx.hideLoading()
wx.showModal({
title: '温馨提示',
content: result.message,
showCancel: false,
confirmText: '知道了',
confirmColor: '#3582EE'
})
}
})
} else if (loginType == 2) { // 账号密码登录
})
} else if (loginType == 2) {
// 账号密码登录
console.log('账号密码登录成功')
api.smsLogin({
mobile: accountNumber,
code: password
})
.then(result => {
wx.$util.showLoading()
if (result.code == 0) {
let { loginUserInfoList, sessionId } = result.data
if (loginUserInfoList.length > 0) {
wx.$util.setSessionId(sessionId)
wx.$router.reLaunch('pages.accountItems')
api
.smsLogin({
mobile: accountNumber,
code: password
})
.then(result => {
wx.$util.showLoading()
if (result.code == 0) {
let { loginUserInfoList, sessionId } = result.data
if (loginUserInfoList.length > 0) {
wx.$util.setSessionId(sessionId)
wx.$router.reLaunch('pages.accountItems')
} else {
wx.$router.reLaunch('pages.nothing')
}
} else {
wx.$router.reLaunch('pages.nothing')
wx.hideLoading()
wx.showModal({
title: '温馨提示',
content: result.message,
showCancel: false,
confirmText: '知道了',
confirmColor: '#3582EE'
})
}
} else {
wx.hideLoading()
wx.showModal({
title: '温馨提示',
content: result.message,
showCancel: false,
confirmText: '知道了',
confirmColor: '#3582EE'
})
}
})
})
}
},
playCountDown() {
......@@ -159,6 +172,15 @@ Page({
})
}, 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({
*/
getPhoneNumber(e) {
console.log(e)
const checkAgree = this.checkAgree()
if (checkAgree) return false
let { loginToken } = this.data
let { encryptedData, iv } = e.detail
if (!encryptedData) return
......
{
"usingComponents": {}
}
\ No newline at end of file
"usingComponents": {
"auth-setting": "/components/authSetting/authSetting"
}
}
......@@ -2,61 +2,122 @@
<block wx:if="{{loginType == 1}}">
<view class='login-form'>
<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>
<view class='clear y-center' hidden="{{!mobile}}" bindtap="clear" data-name='mobile'>
<image src="/images/clear.png"></image>
<input
placeholder="请输入手机号"
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 class="sms-box">
<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>
<view class='clear y-center' style="right:50rpx;" hidden="{{!code}}" bindtap="clear" data-name='code'>
<image src="/images/clear.png"></image>
<input
placeholder="请输入验证码"
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 class="sms {{countDown?'code-disabled':''}}" bindtap="getSms">
<block wx:if="{{countDown}}">
{{count}}秒后获取
</block>
<block wx:else>
获取验证码
</block>
<block wx:if="{{countDown}}">{{count}}秒后获取</block>
<block wx:else>获取验证码</block>
</view>
</view>
</view>
</block>
<block wx:if="{{loginType == 2}}">
<block wx:if="{{loginType == 2}}">
<view class='login-form'>
<view class='input'>
<input placeholder="请输入账号" type="number" placeholder-style="color:#999;" style="width:calc(100% - 50rpx);" bindinput="input" data-name='accountNumber' value="{{accountNumber}}"></input>
<view class='clear y-center' hidden="{{!accountNumber}}" bindtap="clear" data-name='accountNumber'>
<image src="/images/clear.png"></image>
<input
placeholder="请输入账号"
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 class='input'>
<input
placeholder="请输入密码"
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 class='input'>
<input placeholder="请输入密码" type="password" placeholder-style="color:#999;" style="width:calc(100% - 50rpx);" bindinput="input" data-name='password' value='{{password}}'></input>
<view class='clear y-center' hidden="{{!password}}" bindtap="clear" data-name='password'>
<image src="/images/clear.png"></image>
</view>
</view>
</view>
</block>
<view class='box'>
<!-- <view class='box' style="top:{{loginType?'-264rpx':'0'}}"> -->
<view class="agree" bindtap="agree" wx:if="{{loginType == 2}}">
<view class="icon {{agree}}">
<image src="../../components/images/radio.png" />
</view>
<block>30天免登录</block>
</view>
<!-- <view class='box' style="top:{{loginType?'-264rpx':'0'}}"> -->
<view class="agree" bindtap="agree" wx:if="{{loginType == 2}}">
<view class="icon {{agree}}">
<image src="../../components/images/radio.png" />
</view>
<block>30天免登录</block>
</view>
<view class="login-btn {{loginType == 3?'mini':''}}">
<button size="default" hidden="{{loginType != 3}}" open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber"></button>
<view hidden="{{loginType !=3 }}">微信登录</view>
<button
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>
<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="3" wx:if="{{loginType != 3}}">{{"微信登录"}}</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="3"
wx:if="{{loginType != 3}}">
{{"微信登录"}}
</view>
<auth-setting bind:choose="authChoose" />
</view>
</view>
\ No newline at end of file
</view>
......@@ -48,7 +48,7 @@
"scene": null
},
{
"name": "工单列表",
"name": "预约管理",
"pathName": "tabWorkOrder/pages/index/index",
"query": "",
"launchMode": "default",
......@@ -139,13 +139,20 @@
"scene": null
},
{
"name": "",
"name": "报价单签名",
"pathName": "packageEquity/pages/carQuotation/signature/signature",
"query": "",
"launchMode": "default",
"scene": null
},
{
"name": "全屏签名",
"pathName": "packageEquity/pages/carQuotation/fullSignture/fullSignture",
"query": "",
"launchMode": "default",
"scene": null
},
{
"name": "新建工单",
"pathName": "tabWorkOrder/pages/createOrder/createOrder",
"query": "",
......@@ -153,8 +160,43 @@
"scene": null
},
{
"name": "全屏签名",
"pathName": "packageEquity/pages/carQuotation/fullSignture/fullSignture",
"name": "客户建档",
"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": "",
"launchMode": "default",
"scene": null
......@@ -162,5 +204,6 @@
]
}
},
"setting": {}
"setting": {},
"libVersion": "2.29.2"
}
\ No newline at end of file
......@@ -80,7 +80,7 @@ export const getYQorderInfo = () => {
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)
if (app.globalData.YQorderSetting) {
return resolve(app.globalData.YQorderSetting)
} else {
......@@ -99,13 +99,13 @@ export const getYQorderInfo = () => {
if (code == 0) {
// console.log(data);
// debugger
console.log(data.yqPhoneConfig,'data.yqPhoneConfig');
console.log(typeof data.yqPhoneConfig,'data.yqPhoneConfig');
// console.log(data.yqPhoneConfig, 'data.yqPhoneConfig')
// console.log(typeof data.yqPhoneConfig, 'data.yqPhoneConfig')
// 过滤园区店是否需要屏蔽手机号选项
let filterYqPhoneConfig = JSON.parse(data.yqPhoneConfig)
// 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)
app.globalData.YQorderSetting = data
// this.checkSeverType(userInfo)
......@@ -153,28 +153,44 @@ export const setConfigInfo = globalData => {
}
export const checkScene = options => {
// console.log(options, 'options')
// console.log(wx)
// return true
let { query } = options
console.log(query, 'query')
let userInfo = wx.$util.getStorageSync('dj_boutique_user_info')
// 判断对象是否满足任意一个key
// 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) {
// &&options.patch == 'tabIndex/pages/index/index'
let userInfo = wx.$util.getStorageSync('dj_boutique_user_info')
// 需要当前门店的 不是就重新登录
if (userInfo?.subLoginUser?.merchantId != query.merchantId) {
wx.$SCENE = null
// 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'
}
if (query.type) {
options.patch = 'tabWorkOrder/pages/createOrder/createOrder'
// h5跳转小程序 路径处理
if (query.page) {
const pagePath = {
createArchives: 'tabWorkOrder/pages/createArchives/createArchives',
createOrder: 'tabWorkOrder/pages/createOrder/createOrder',
followUpOrder: 'tabDate/pages/detail'
}
options.path = pagePath[query.page]
}
console.log(options, 'options')
wx.$SCENE = options
if (!userInfo) {
return '未登录,请登录。'
}
}
}
......@@ -214,12 +230,9 @@ export const setWebSocket = () => {
export const get4SStoreList = options => {
return new Promise((resolve, reject) => {
const app = getApp()
api
.getSceneMerchantRefStoreList({
merchantId: options.yqMerchantId,
scene: 0,
merchantName: options.merchantName
})
.getSceneMerchantRefStoreList(options)
.then(res => {
let { code, data } = res
if (code == 0) {
......
......@@ -31,18 +31,10 @@ Page({
callBack: 'makePhoneCall',
copy: true
},
// {
// label: '性别',
// key: 'customerSex',
// enum: {
// 1: '男',
// 2: '女'
// }
// },
// {
// label: '车型',
// key: 'carType',
// },
{
label: '客户车型',
key: 'carName'
},
{
label: '礼券名称',
key: 'couponName'
......@@ -106,6 +98,7 @@ Page({
this.getInviteDetail(options.id)
}
},
/**
* 生命周期函数--监听页面加载
*/
......@@ -160,6 +153,10 @@ Page({
let updatedDate = new Date(e.updatedDate)
e.year = updatedDate.format('yyyy-MM-dd')
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}`
......
......@@ -12,7 +12,17 @@
style="color:{{item.color}};"
catchtap="{{item.callBack}}"
data-data="{{detail[item.key]}}">
{{item.enum? item.enum[detail[item.key]] : 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] || ''}}
</block>
</view>
<block wx:if="{{item.copy}}">
<view class="copy" catchtap="setCopyData" data-content="{{detail[item.key]}}">
......@@ -25,7 +35,11 @@
</view>
<view class="box ">
<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" />
</view>
</block>
......@@ -90,7 +104,9 @@
</block>
:
</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>
</block>
<block wx:if="{{!userInfo.isSuper && userInfo.merchantType && index == 0 && userInfo.userType == 2}}">
......@@ -107,9 +123,9 @@
<view class="nothing text-center">暂无记录</view>
</block>
</view>
<view wx:if="{{detail.inviteStatus != 4}}" class="btns {{isFullSucreen?'isFullSucreen-btn':''}}">
<view class="btn text-center" bindtap="orderSubmit">去下单</view>
</view>
<view wx:if="{{detail.inviteStatus != 4}}" class="btns {{isFullSucreen?'isFullSucreen-btn':''}}">
<view class="btn text-center" bindtap="orderSubmit">去下单</view>
</view>
</view>
<date-picker show="{{showDate}}" merchantId="{{detail.merchantCoupon.yqMerchantId}}" />
<remark-popup
......
......@@ -43,13 +43,13 @@ Page({
text: '取消预约',
color: '#FF7D12'
},
4: {
text: '已施工',
color: '#999999'
},
5: {
text: '过期到店',
color: '#FF7D12'
},
4: {
text: '已施工',
color: '#999999'
}
},
searchObj: {},
......
......@@ -53,7 +53,7 @@
data-item="{{li}}">
<view class="status" style="color:{{status[li.inviteStatus].color}}">
<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}};" />
</block>
</view>
......@@ -92,7 +92,7 @@
<view class="time {{now<li.inviteDate?'':'gray'}}">{{li.time}}</view>
</view>
<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}}">
<image src="../../images/date.png" class="date-icon" />
预约
......
// tabIndex/pages/index/index.js
import mixins from './index_mixins'
import api from '../../api.js'
import {
getYQInfo
} from '~/store/index'
import { env } from '~/config'
import { getYQInfo } from '~/store/index'
const app = getApp()
let time = null
Page({
......@@ -14,7 +13,8 @@ Page({
flag: true,
...mixins.data,
navBarHeight: 0,
totalTableSum: [{
totalTableSum: [
{
name: 'filmTimesTotalSum'
},
{
......@@ -66,9 +66,7 @@ Page({
},
navigator(e) {
console.log(e)
let {
outTradeNo
} = e.detail
let { outTradeNo } = e.detail
this.closeSwitchPopup()
outTradeNo &&
wx.$router.go('tabWorkOrder.additionRecordOrder', {
......@@ -76,12 +74,8 @@ Page({
})
},
remarkConfirm(e) {
let {
methodUpdateInfo
} = this.data
let {
detail: filmTimes
} = e
let { methodUpdateInfo } = this.data
let { detail: filmTimes } = e
methodUpdateInfo.filmTimes = filmTimes
api
.updateCouponDayReport(methodUpdateInfo)
......@@ -105,16 +99,8 @@ Page({
})
},
changeTableData(e) {
let {
startDate,
maxDate,
isYqdSuper
} = this.data
let {
merchantId,
filmTimes,
merchantName
} = e.currentTarget.dataset.item
let { startDate, maxDate, isYqdSuper } = this.data
let { merchantId, filmTimes, merchantName } = e.currentTarget.dataset.item
// 不是管理员不开启这个权限
if (!isYqdSuper) return
if (startDate != maxDate) {
......@@ -154,12 +140,8 @@ Page({
})
},
changePicker(e) {
let {
value
} = e.detail
let {
merchantId
} = this.data.merchantRange[value]
let { value } = e.detail
let { merchantId } = this.data.merchantRange[value]
// 修改对应下标显示
app.globalData.yqdInfo.subIndex = value
let obj = {}
......@@ -167,11 +149,7 @@ Page({
wx.$util.showLoading('加载中...')
api.swtichSubLoginInfo(obj).then(res => {
console.log(res)
let {
code,
data,
message
} = res
let { code, data, message } = res
if (code == 0) {
wx.$util.setUserInfo(data)
this.init(data)
......@@ -182,13 +160,8 @@ Page({
this.tapPicker()
},
jump(e) {
let {
item,
type
} = e.currentTarget.dataset
let {
userInfo
} = this.data
let { item, type } = e.currentTarget.dataset
let { userInfo } = this.data
// 判断是不是门店员工
if (userInfo.merchantType && !userInfo.isSuper && type == 2) {
wx.$router.go(item.url)
......@@ -206,9 +179,7 @@ Page({
let today = new Date()
let startDate = today.format('yyyy-MM-dd')
let endDate = today.format('yyyy-MM-dd')
let {
tableBtn
} = this.data
let { tableBtn } = this.data
this.setData({
startDate,
endDate
......@@ -218,14 +189,9 @@ Page({
},
rangeSelect(e) {
// console.log(e)
let { tableBtn } = this.data
let {
tableBtn
} = this.data
let {
date: {
start,
end
}
date: { start, end }
} = e.detail
this.setData({
startDate: start,
......@@ -246,14 +212,9 @@ Page({
})
},
changeTableSort(e) {
let {
index
} = e.currentTarget.dataset
let { index } = e.currentTarget.dataset
console.log(index)
let {
tableSort,
tableObj
} = this.data
let { tableSort, tableObj } = this.data
if (tableSort == index) {
tableObj[index].sort = !tableObj[index].sort
} else {
......@@ -266,14 +227,8 @@ Page({
this.sortTable(tableObj)
},
sortTable(tableObj) {
let {
tableSort,
table
} = this.data
let {
key,
sort
} = tableObj[tableSort]
let { tableSort, table } = this.data
let { key, sort } = tableObj[tableSort]
const objectArraySort = keyName => {
return (objectN, objectM) => {
const valueN = objectN[keyName]
......@@ -299,41 +254,32 @@ Page({
},
// 10s轮询一次待补录
getWaitOrder() {
let {
isStaff
} = this.data
let { isStaff } = this.data
// console.log('isStaff', isStaff)
let thisPage = wx.$router.getPageInstance()
console.log(thisPage.route, ' thisPage.route')
thisPage.route == 'tabIndex/pages/index/index' &&
isStaff &&
api
.waitinputorder()
.then(result => {
// console.log(result)
let {
code,
data
} = result
this.setTime()
if (code == 0) {
this.setData({
waitInputCount: data.waitInputCount
})
}
})
.catch(err => {})
.waitinputorder()
.then(result => {
// console.log(result)
let { code, data } = result
this.setTime()
if (code == 0) {
this.setData({
waitInputCount: data.waitInputCount
})
}
})
.catch(err => {})
},
getPageData() {
api.getHomeReport().then(res => {
wx.$util.hideLoading()
console.log(res)
let {
code,
data,
message
} = res
let { code, data, message } = res
if (code == 0) {
this.setData({
report: data
......@@ -348,15 +294,7 @@ Page({
this.getMerchantCouponList()
},
getMerchantCouponList() {
let {
orderByTypeEnum,
tableSort,
tableObj,
startDate,
endDate,
totalTableSum,
tableWidth
} = this.data
let { orderByTypeEnum, tableSort, tableObj, startDate, endDate, totalTableSum, tableWidth } = this.data
let target = tableObj[tableSort].sort
let orderByType = orderByTypeEnum[target][tableSort]
api
......@@ -367,11 +305,7 @@ Page({
})
.then(res => {
console.log(res)
let {
code,
message,
data
} = res
let { code, message, data } = res
let table = []
if (code == 0) {
table = data ? data.page?.list : []
......@@ -415,16 +349,14 @@ Page({
}
},
init(userInfo) {
getYQInfo(userInfo)
.then(result => {
console.log(result)
// console.log(app.globalData.isYqdSuper)
this.getPageData()
this.setData({
...result
})
getYQInfo(userInfo).then(result => {
console.log(result)
// console.log(app.globalData.isYqdSuper)
this.getPageData()
this.setData({
...result
})
})
},
checkShowOrderPop(options) {
let userInfo = wx.$util.getStorageSync('dj_boutique_user_info')
......@@ -467,15 +399,15 @@ Page({
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
const accountInfo = wx.getAccountInfoSync()
// const accountInfo = wx.getAccountInfoSync()
let checklist = []
switch (accountInfo.miniProgram.envVersion) {
switch (env) {
case 'develop':
checklist = []
break
case 'trial':
// index = manual ? index : 2
checklist = ['15398879285', '15816539334']
checklist = ['15398879285']
break
case 'release':
checklist = ['18123663366', '19557403672']
......@@ -485,10 +417,7 @@ Page({
break
}
// 判断是不是特殊账号
let {
menu,
userInfo
} = this.data
let { menu, userInfo } = this.data
if (checklist.includes(userInfo?.accountName)) {
menu = menu.filter(e => e.name != '预约管理')
this.setData({
......@@ -507,9 +436,7 @@ Page({
// 如果是员工 开启订单补录轮询
this.getWaitOrder()
if (userInfo) {
let {
userInfo: newUserInfo
} = this.data
let { userInfo: newUserInfo } = this.data
// console.log(newUserInfo)
if (newUserInfo) {
let isChangeLogin = newUserInfo.subLoginUser.merchantId != userInfo.subLoginUser.merchantId
......@@ -551,4 +478,4 @@ Page({
* 用户点击右上角分享
*/
onShareAppMessage: function () {}
})
\ No newline at end of file
})
......@@ -28,7 +28,7 @@
</block>
</gl-cell>
</view>
<view class="subShopMerchantId" wx:if="{{isShowSubShopMerchant}}">
<view class="subShopMerchantId" wx:if="{{isShowSubShopMerchant}}">
<gl-cell
border
valueAlign="right"
......@@ -42,9 +42,7 @@
placeholder="点击选择"
disabled="{{orderObj.orderSource == 5}}">
<block wx:if="{{orderObj.subShopMerchantName}}">
<view class="between">
{{orderObj.subShopMerchantName}}
</view>
<view class="between">{{orderObj.subShopMerchantName}}</view>
</block>
</gl-cell>
</view>
......@@ -247,7 +245,9 @@
<view class="icon" bindtap="delGoodsList" data-index="{{index}}">
<image src="../../images/del.png" />
</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">
......@@ -321,15 +321,16 @@
show="{{selesBox}}"
title="选择合作门店"
sub-title="选择销售顾问"
orderObj="{{orderObj}}"
userInfo="{{userInfo}}"
type="1"
oderType="recorder" />
<sub-shop-merchant
show="{{subShopMerchantBox}}"
title="选择二级流量方"
selectedSelesMerchantId="{{orderObj.merchantId}}"
selectedCustomerInfo="{{orderObj.customer.customerId}}"
selectedSubShopMerchantId="{{orderObj.subShopMerchantId}}"/>
<sub-shop-merchant
show="{{subShopMerchantBox}}"
title="选择二级流量方"
selectedSelesMerchantId="{{orderObj.merchantId}}"
selectedCustomerInfo="{{orderObj.customer.customerId}}"
selectedSubShopMerchantId="{{orderObj.subShopMerchantId}}" />
<car-brands
show="{{carBrandBox}}"
bindconfirm="chooseCar"
......
......@@ -320,6 +320,7 @@ Page({
// console.log(arr[i])
delete orderInfo[deleteList[i]]
}
orderInfo.againOrder = true
wx.$router.redirectTo('createOrder', orderInfo)
// merchantDistributionList,expenseCategoryList,profitAllocatinList
},
......
......@@ -281,9 +281,9 @@ Page({
submit(i) {
this.checkPhoneUseConfig()
console.log(i);
console.log(i)
let { type } = i.currentTarget.dataset
console.log(type);
console.log(type)
let { orderObj, notUpgradeOrderList, dateObj, isStandNo } = this.data
let key = this.checkRequired(orderObj)
......@@ -311,22 +311,22 @@ Page({
return this.showToast(`请输入第${index + 1}位客户车架号`)
}
}
orderObj = {
...orderObj,
// notUpgradeOrderList,
createDate: dateObj.today
}
if (type=='success') {
orderObj.preliminaryOrders = notUpgradeOrderList
}else{
orderObj.notUpgradeOrderList = notUpgradeOrderList
}
if (type == 'success') {
orderObj.preliminaryOrders = notUpgradeOrderList
} else {
orderObj.notUpgradeOrderList = notUpgradeOrderList
}
this.showLoading('提交中...')
console.log('orderObj', orderObj)
// return
const apiName = type=='success'? 'createPrerecordedOrderBatch':'notUpgradeOrder'
const apiName = type == 'success' ? 'createPrerecordedOrderBatch' : 'notUpgradeOrder'
api[apiName](orderObj).then(res => {
wx.hideLoading()
// console.log(orderObj, res)
......@@ -446,32 +446,46 @@ Page({
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()
// console.log(options)
console.log(res)
res && this.initOPtions(res)
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function (res) {
// console.log(res)
console.log(res)
// this.getConfig()
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function (res) {
// console.log(wx.$modal)
// console.log(res)
// setTimeout(() => {
// wx.$util.showLoading()
// }, 2000)
console.log(res, 'onroute')
},
onRoute(res) {
console.log(res, 'onroute')
res && this.initOPtions(res)
this.getSetting()
},
/**
......
......@@ -57,28 +57,25 @@
</view>
</block>
</gl-cell>
<view class="subShopMerchantId" wx:if="{{isShowSubShopMerchant}}">
<gl-cell
border
valueAlign="right"
label="二级流量方"
requiredAfter
labelWidth="180rpx"
required
haveArrow
bindclick="showPopup"
data-show-name="subShopMerchantBox"
placeholder="点击选择"
disabled="{{orderObj.orderSource == 5}}">
<block wx:if="{{orderObj.subShopMerchantName}}">
<view class="between">
{{orderObj.subShopMerchantName}}
</view>
</block>
</gl-cell>
</view>
<view class="subShopMerchantId" wx:if="{{isShowSubShopMerchant}}">
<gl-cell
border
valueAlign="right"
label="二级流量方"
requiredAfter
labelWidth="180rpx"
required
haveArrow
bindclick="showPopup"
data-show-name="subShopMerchantBox"
placeholder="点击选择"
disabled="{{orderObj.orderSource == 5}}">
<block wx:if="{{orderObj.subShopMerchantName}}">
<view class="between">{{orderObj.subShopMerchantName}}</view>
</block>
</gl-cell>
</view>
</view>
<block
wx:for="{{notUpgradeOrderList}}"
wx:for-item="li"
......@@ -215,12 +212,11 @@
<view class="btns {{isFullSucreen?'isFullSucreen-btn':''}}">
<view class="tips">可批量生成当天的战败客户,缺漏信息建档后在工单详情补充</view>
<view class="btns-con">
<view class="confirm fail text-center" bindtap="submit">
战败下单
<!-- {{notUpgradeOrderList.length==1?'提交客户工单':'提交'+notUpgradeOrderList.length+'个客户工单'}} -->
</view>
<view class="confirm save text-center" bindtap="submit" data-type="success">提交</view>
<view class="confirm save text-center" bindtap="submit" data-type="success">提交</view>
</view>
<!-- <view class="confirm text-center" bindtap="submit">
{{notUpgradeOrderList.length==1?'提交客户工单':'提交'+notUpgradeOrderList.length+'个客户工单'}}
......@@ -230,11 +226,12 @@
show="{{selesBox}}"
title="选择合作门店"
sub-title="选择销售顾问"
orderObj="{{orderObj}}"
userInfo="{{userInfo}}"
type="1" />
<sub-shop-merchant
show="{{subShopMerchantBox}}"
title="选择二级流量方"
selectedSelesMerchantId="{{orderObj.merchantId}}"
selectedSubShopMerchantId="{{orderObj.subShopMerchantId}}"/>
<sub-shop-merchant
show="{{subShopMerchantBox}}"
title="选择二级流量方"
selectedSelesMerchantId="{{orderObj.merchantId}}"
selectedSubShopMerchantId="{{orderObj.subShopMerchantId}}" />
......@@ -470,10 +470,13 @@ Page({
*/
onLoad: function (options) {
// console.log(app.globalData.YQorderSetting, 'app.globalData.YQorderSetting.yqPhoneConfig')
// console.log(options)
console.log(options)
if (options.scene) {
this.setData(options)
}
if (options.orderCode) {
this.onRoute(options)
}
},
init(userInfo) {
let { scene, orderObj } = this.data
......@@ -595,7 +598,7 @@ Page({
// app .
getYQorderInfo()
.then(merchantSettingInfo => {
console.log(merchantSettingInfo,'merchantSettingInfo')
// console.log(merchantSettingInfo, 'merchantSettingInfo')
let dictionaryObj = {
carTypeRequiredFlag: 'carBrand',
standNoRequiredFlag: 'standNo',
......@@ -607,7 +610,7 @@ Page({
requiredList.push(dictionaryObj[key])
}
}
console.log(merchantSettingInfo.yqPhoneConfig,'merchantSettingInfo.yqPhoneConfig');
// console.log(merchantSettingInfo.yqPhoneConfig, 'merchantSettingInfo.yqPhoneConfig')
// console.log(deepClone(merchantSettingInfo.yqPhoneConfig), 'deepClone(merchantSettingInfo.yqPhoneConfig)')
this.setData({
requiredList: [...new Set(requiredList)],
......@@ -653,16 +656,26 @@ Page({
onShow: function () {
wx.disableAlertBeforeUnload && wx.disableAlertBeforeUnload() //关闭小程序页面返回询问对话框
},
onRoute(res) {
async onRoute(res) {
// debugger
// console.log(res)
console.log(res)
// 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
if (Object.keys(res).length > 0) {
if (res.associateOrderCode) {
tipsProps.showTips = true
tipsProps.tipsText = '原订单录入信息有误,请重新提交正确的订单信息。'
} else if (res.orderCode) {
} else if (res.orderCode || res.againOrder) {
// 以建档(预约列表)/待跟进工单不可建档
isAlreadyExistOrder = true
tipsProps.showTips = false
......
......@@ -26,7 +26,7 @@
</block>
</gl-cell>
</view>
<view class="subShopMerchantId" wx:if="{{isShowSubShopMerchant}}">
<view class="subShopMerchantId" wx:if="{{isShowSubShopMerchant}}">
<gl-cell
border
valueAlign="right"
......@@ -40,9 +40,7 @@
placeholder="点击选择"
disabled="{{orderObj.orderSource == 5}}">
<block wx:if="{{orderObj.subShopMerchantName}}">
<view class="between">
{{orderObj.subShopMerchantName}}
</view>
<view class="between">{{orderObj.subShopMerchantName}}</view>
</block>
</gl-cell>
</view>
......@@ -361,17 +359,25 @@
</view>
</block>
<merchant-seles
show="{{salesmanBox}}"
isDefault="{{isDefault}}"
title="选择园区店"
sub-title="选择转化人员"
userInfo="{{userInfo}}"
type="2" />
<merchant-seles
show="{{selesBox}}"
title="选择合作门店"
orderObj="{{orderObj}}"
sub-title="选择销售顾问"
userInfo="{{userInfo}}"
type="1" />
<sub-shop-merchant
show="{{subShopMerchantBox}}"
title="选择二级流量方"
selectedSelesMerchantId="{{orderObj.merchantId}}"
selectedCustomerInfo="{{orderObj.customer.customerId}}"
selectedSubShopMerchantId="{{orderObj.subShopMerchantId}}"/>
<sub-shop-merchant
show="{{subShopMerchantBox}}"
title="选择二级流量方"
selectedSelesMerchantId="{{orderObj.merchantId}}"
selectedCustomerInfo="{{orderObj.customer.customerId}}"
selectedSubShopMerchantId="{{orderObj.subShopMerchantId}}" />
<car-brands
show="{{carBrandBox}}"
bindconfirm="chooseCar"
......@@ -384,13 +390,6 @@
placeholder="请填写内容,最多30个字"
maxlength="30"
value="{{orderObj.remark}}" />
<merchant-seles
show="{{salesmanBox}}"
isDefault="{{isDefault}}"
title="选择园区店"
sub-title="选择转化人员"
userInfo="{{userInfo}}"
type="2" />
<coupon
show="{{couponBox}}"
class="coupon"
......
......@@ -3,23 +3,23 @@
*/
import { DEFAULT_GET_STORAGEKEY, STORAGE_OBJECTkEY } from '~/utils/constantData'
import { env } from '~/config'
class Storage {
types = {
1: 'get', // get
2: 'set', // set
3: 'rm' // rm
}
envVersion = {
develop: '开发版',
trial: '体验版',
release: '正式版'
}
// envVersion = {
// develop: '开发版',
// trial: '体验版',
// release: '正式版'
// }
// defaultGetStorageKey = DEFAULT_GET_STORAGEKEY
/** 构造函数 */
constructor() {
/** 获取当前小程序环境变量 */
const accountInfo = wx.getAccountInfoSync()
this.environment = accountInfo?.miniProgram.envVersion || 'release'
this.environment = env || 'release'
}
/**
......
......@@ -17,10 +17,10 @@ export const STORAGE_OBJECTkEY = {
authphone: 'authphone',
disLikeRecordFlag: 'disLikeRecordFlag',
fileList: 'fileList',
posterId: 'posterId',
posterId: 'posterId'
}
export const IMG_VERSION = () => {
const accountInfo = wx.getAccountInfoSync()
return accountInfo.miniProgram.version || '1.0.0'
}
// export const IMG_VERSION = () => {
// const accountInfo = wx.getAccountInfoSync()
// return accountInfo.miniProgram.version || '1.0.0'
// }
import { env } from '~/config'
const accountInfo = wx.getAccountInfoSync()
const systemInfo = wx.getSystemInfoSync()
// console.log(systemInfo);
// console.log(accountInfo.miniProgram.envVersion)
import { envIndex } from '~/config'
//手动控制体验版环境的请求 true就依据下面index false就默认为2
const manual = false
const release = false
// console.log(envIndex, 'envIndex')
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 = {
ip: {
appKey: '48e5e13229b82c1b4e6e8c96151f0637',
......@@ -80,7 +49,8 @@ const scrmSecretKey_items = {
const domain_items = {
ip: {
// 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'
},
dev: {
......@@ -100,22 +70,13 @@ const domain_items = {
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']
// console.log(domain_items[target[index]]);
module.exports = {
domain: domain_items[target[index]],
secretKey: secretKey_items[target[index]],
scrmSecretKey: scrmSecretKey_items[target[index]]
domain: domain_items[target[envIndex]],
secretKey: {
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'
/**接口 */
class Request {
......@@ -34,32 +35,12 @@ class Request {
data
} = 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) {
let thisPage = wx.$router.getPageInstance()
// console.log(thisPage);
wx.hideLoading()
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) {
wx.showToast({
......@@ -79,10 +60,6 @@ class Request {
icon: 'error'
})
reject(error)
// if (fail && typeof fail == 'function') {
// fail(error, reject)
// } else {
// }
},
complete() {
wx.stopPullDownRefresh()
......@@ -101,15 +78,17 @@ class Request {
data['locale'] = 'zh_CN'
data['source'] = 'dj-wechat'
// 兼容线上appkey和secret不一样的情况
let djapi = data.method.includes('dj.api')
let scmrapi = data.method.includes('scrm.api')
// console.log(scmrapi,'scmrapi');
const appKey = scmrapi?scrmSecretKey.appKey:djapi?secretKey.appKey:''
const secret = scmrapi?scrmSecretKey.secret:djapi?secretKey.secret:''
// 兼容线上dj和scrm appkey和secret不一样的情况
const apiName = data.method.split('.api')[0]
// 为空报错
if (!apiName) {
throw new Error('apiName is null')
}
data['appKey'] = appKey
const appKey = secretKey[apiName].appKey
const secret = secretKey[apiName].secret
data['appKey'] = appKey
let obj = sign(data, secret, noSignAttr)
//data['sign'] = obj.sign;
......
import { dsnUrl } from '~/config'
import * as Sentry from '~/utils/lib/sentry-miniapp'
import { env } from '~/config'
// console.log(env, 'env')
export default function sentryInit() {
// accountInfo.miniProgram.envVersion == 'release' &&
const accountInfo = wx.getAccountInfoSync()
//测试和生产才开发sentry
const env = ['trial', 'release']
env.includes(accountInfo.miniProgram.envVersion) &&
//测试和生产才开启sentry
const envNameList = ['trial', 'release']
envNameList.includes(env) &&
Sentry.init({
// dsn: 'http://ebcf31c417cc4ce185782f046e4a87a2@sentry.glsx.com.cn/5'
dsn: dsnUrl
})
}
......@@ -7,11 +7,6 @@
resolved "https://registry.npmmirror.com/@vant/weapp/-/weapp-1.10.14.tgz#b5f249097df1f1a7aa5c6602d8cad4afd397f934"
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:
version "1.3.0"
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!