Commit da3c2141 by 前端

Merge branch 'develop' into 'master'

Develop

See merge request !106
2 parents 975538ca a9516bf2
Showing 93 changed files with 1809 additions and 777 deletions
No preview for this file type
......@@ -21,6 +21,12 @@ module.exports = {
data.productCode = 'PC00c2'
return api.post('dj.api.smartcarlife.sms.not.code.login', data)
},
/** 免登录 */
reNoSignIn(data) {
data.productCode = 'PC00c2'
return api.post('dj.api.smartcarlife.sms.noSignIn.login', data)
},
/**手机验证码登录 /1.0.0 */
smsLogin(data = {}) {
data.source = 'MINIAPP'
......@@ -157,5 +163,9 @@ module.exports = {
// 获取园区店配置
getYqStoreConfig(data) {
return api.get('dj.api.smarcarlife.yqMerchantConfig.detail', data)
},
//插入埋点记录
burialPointRecord(data) {
return api.get('dj.api.smartcarlife.common.insertRecord', data)
}
}
......@@ -13,10 +13,11 @@ import wxApi from './utils/utils_wx'
// 实例化对象存储
import { Storage } from '~/utils/cache/storage'
const $Storage = new Storage()
import { setSystem_info } from '~/utils/cache/storageApi'
import { setSystem_info, getNoSignInUuid,removeSystemStorage } from '~/utils/cache/storageApi'
setSystem_info() // 存储设备信息
import { checkYqdSuper, checkScene } from '~/store/index'
import eventbus from './utils/eventbus'
import api from './api/api'
App({
onLaunch() {
/**挂载到wx对象 */
......@@ -34,8 +35,8 @@ App({
showModal(that, options) {
that.selectComponent('#modal').showModal(options)
},
gobalCheckYqdSuper(userInfo){
checkYqdSuper(userInfo,this.globalData)
gobalCheckYqdSuper(userInfo) {
checkYqdSuper(userInfo, this.globalData)
},
onShow(options) {
getUpdateManager()
......@@ -49,30 +50,52 @@ App({
}
},
login(relogin, context) {
// debugger
// console.log(relogin, 'relogin')
let that = this
// 清空多账号信息
if (relogin) {
wx.showModal({
title: '温馨提示',
content: context || '登录过期,请重新登录。',
showCancel: false,
confirmText: '去登录',
confirmColor: '#3582EE',
success(res) {
if (res.confirm) {
that.globalData.yqdInfo = {}
that.globalData.YQorderSetting = ''
// 判断有没有 30 天免登陆 有直接跳选园区
let noSignInUuid = getNoSignInUuid()
if (noSignInUuid) {
api.reNoSignIn({ noSignInUuid: noSignInUuid }).then(res => {
let {
code,
data
} = res
if (code == '0' && data) {
// util.setUserinfo(data)
util.setSessionId(data?.sessionId)
return router.reLaunch('pages.accountItems')
} else {
util.removeStorage()
wx.$relogin = relogin
router.reLaunch('pages.wxLogin')
removeSystemStorage()
that.login(false)
}
}
})
})
} else {
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 {
this.globalData.yqdInfo = {}
this.globalData.YQorderSetting = ''
util.removeStorage()
removeSystemStorage()
wx.$relogin = relogin
router.reLaunch('pages.wxLogin')
}
......
......@@ -42,7 +42,7 @@
{
"root": "tabWorkOrder",
"name": "tabWorkOrder",
"pages": ["pages/createOrder/createOrder", "pages/additionRecordOrder/additionRecordOrder", "pages/orderDetail/orderDetail", "pages/constructionOrderDetail/constructionOrderDetail", "pages/confirmOrder/confirmOrder", "pages/updateOrderInfo/updateOrderInfo", "pages/createArchives/createArchives", "pages/orderSignature/orderSignature", "pages/fullSignture/fullSignture", "tpages/ocr/ocr"]
"pages": ["pages/createOrder/createOrder", "pages/additionRecordOrder/additionRecordOrder", "pages/orderDetail/orderDetail", "pages/constructionOrderDetail/constructionOrderDetail", "pages/confirmOrder/confirmOrder", "pages/updateOrderInfo/updateOrderInfo", "pages/createArchives/createArchives", "pages/orderSignature/orderSignature", "pages/fullSignture/fullSignture", "pages/ocr/ocr"]
},
{
"root": "packageEquity",
......
......@@ -9,6 +9,7 @@ Component({
show: {
type: Boolean,
observer: function (n) {
wx.$util.pointRecord(19)
let { isFirst } = this.data
if (n && isFirst) {
this.init()
......@@ -105,6 +106,7 @@ Component({
if (!flag) {
return wx.$util.showToast('请选择客户')
}
this.triggerEvent('confirm', orderInfo)
this.setData({
show: false
......
......@@ -164,17 +164,21 @@ Component({
},
confirm() {
let chooseList = this.getChooseList()
let { goodsList } = this.data
if (goodsList.length < 1) return
this.setData({
show: false
})
if (!chooseList.length) return wx.$util.showToast('请勾选商品')
let thisPage = wx.$router.getPageInstance()
thisPage.setGoodsTotal(chooseList)
console.log(chooseList)
thisPage.setData({
goodsList: chooseList
})
thisPage.setGoodsTotal(chooseList)
console.log(chooseList)
this.setData({
show: false
})
}
}
})
......@@ -65,14 +65,19 @@ Component({
})
},
getMerchantList() {
let { userInfo, type } = this.data
let {
userInfo,
type
} = this.data
// console.log('type', type)
let thisPage = wx.$router.getPageInstance()
// console.log(thisPage.data)
// console.log(thisPage)
// 处理组件实例化比页面快用上一个页面数据的问题
if (!thisPage?.data?.name) return
let { orderObj } = thisPage.data
let {
orderObj
} = thisPage.data
let isSellerInfo, orderSellerInfo
// console.log('orderObj', orderObj)
......@@ -91,12 +96,19 @@ Component({
}
: {}
).then(async res => {
let { code, data, message } = res
let {
code,
data,
message
} = res
if (code == 0) {
// console.log('data', data)
// 解决为空报错问题
if (data[0]) data[0].active = true
let { merchantId, merchantName } = data[0] || {}
let {
merchantId,
merchantName
} = data[0] || {}
let compareId = type == 1 ? orderObj.merchantId : orderObj.sellerMerchantId
// 增加默认勾选逻辑
......@@ -159,7 +171,9 @@ Component({
let { type, merchantList, isFirst, orderObj: comOrderObj, orderSellerInfo } = this.data
let thisPage = wx.$router.getPageInstance()
let { orderObj } = thisPage.data
let {
orderObj
} = thisPage.data
api
.getConversionEmployeeList({
merchantId,
......@@ -167,10 +181,17 @@ Component({
})
.then(async res => {
wx.$util.hideLoading()
let { code, data, message } = res
let {
code,
data,
message
} = res
if (code == 0) {
if (data && data.length) {
let { staffName, uuid } = data[0]
let {
staffName,
uuid
} = data[0]
data[0].active = true
// console.log(orderObj.sellerUserId)
let compareId = type == 1 ? orderObj.userId : orderObj.sellerUserId
......@@ -277,8 +298,15 @@ Component({
this.confirm()
},
changeMerchant(e) {
let { index, item } = e.currentTarget.dataset
let { merchantList, orderObj, type } = this.data
let {
index,
item
} = e.currentTarget.dataset
let {
merchantList,
orderObj,
type
} = this.data
let merchantId = type == 1 ? orderObj.merchantId : orderObj.sellerMerchantId
if (merchantId == item.merchantId) return
merchantList.map(i => (i.active = false))
......@@ -356,9 +384,15 @@ Component({
// console.log(e)
let {
index,
item: { staffName, uuid }
item: {
staffName,
uuid
}
} = e.currentTarget.dataset
let { type, selesList } = this.data
let {
type,
selesList
} = this.data
selesList.map(i => (i.active = false))
selesList[index].active = true
let targetName = type == 1 ? 'orderObj.employeeName' : 'orderObj.sellerName'
......@@ -380,4 +414,4 @@ Component({
// }
}
}
})
})
\ No newline at end of file
......@@ -94,8 +94,8 @@
padding: 30rpx 0 72rpx;
}
.fixed-remark {
background: #F7F7F7;
border: 2rpx solid #C3C3C3;
background: #F4F5F7;
border: 2rpx solid #EFF0F2;
border-radius: 12rpx;
width: 522rpx;
height: 260rpx;
......
......@@ -10,6 +10,7 @@ Component({
value: false,
observer: function (n) {
if (n) {
wx.$util.pointRecord(31)
let userInfo = wx.$util.getUserInfo() || {}
let storageSelectedSceneType = userInfo.selectedSceneType
this.setData({storageSelectedSceneType})
......@@ -53,14 +54,16 @@ Component({
if (this.data.hasTabBar) wx.hideTabBar({animation: true})
},
selectScene(e) {
let { scene } = e.currentTarget.dataset
let { scene,item } = e.currentTarget.dataset
let { sceneList, storageSelectedSceneType } = this.data
if (scene == storageSelectedSceneType) return this.closeMenu()
wx.$router.reLaunch(constantData?.pageUrl[scene])
sceneList.map(i => (i.actived = false))
wx.$util.setUserInfo({ ...wx.$util.getUserInfo(), selectedSceneType: scene })
wx.$util.pointRecord(item.recordId)
},
goMineCenter() {
wx.$util.pointRecord(5)
wx.$router.redirectTo('pages.sceneIndex')
}
}
......
......@@ -3,7 +3,7 @@
<view class="wrapper">
<view class="title">业务</view>
<block wx:for="{{sceneList}}" wx:key="index">
<view catch:tap="selectScene" data-scene="{{item.sceneType}}" class="element {{item.sceneType == storageSelectedSceneType ? 'active' : ''}}">
<view catch:tap="selectScene" data-item="{{item}}" data-scene="{{item.sceneType}}" class="element {{item.sceneType == storageSelectedSceneType ? 'active' : ''}}">
<view class="img"><image src="https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/scene_type_{{item.sceneType}}.png"></image></view>
<view class="label">{{item.sceneName}}</view>
</view>
......
......@@ -9,8 +9,9 @@
* 1开发
* 2测试
* 3生产环境
* 4预发布
*/
let index = 2
let index = 1
const accountInfo = wx.getAccountInfoSync()
const systemInfo = wx.getSystemInfoSync()
......
......@@ -50,5 +50,9 @@ module.exports = {
/**改变支付订单状态 */
createPayOrder(data) {
return api.post('dj.api.smartcarlife.payOrder.create', data)
},
/** 修改订单备注 */
updateOrderRemark(data) {
return api.post('dj.api.smartcarlife.order.updateRemark', data)
}
}
......@@ -88,6 +88,9 @@ Component({
console.log(target)
this.triggerEvent('showPickerSelect', target)
break
case 'remarkPopup':
this.triggerEvent('showMask')
break
default:
break
}
......
......@@ -43,12 +43,19 @@
</view>
<!-- picker -->
<view class="picker" wx:if="{{item.type == 'select'}}">
<image class="arrow" src="/components/images/arrow-x.png" />
<view class="text-hide" wx:if="{{formData[item.optionName]}}">
{{formData[item.optionName]}}
</view>
<text class="placeholder" wx:else>请选择</text>
</view>
<image class="arrow" src="/components/images/arrow-x.png" />
<view class="text-hide" wx:if="{{formData[item.optionName]}}">
{{formData[item.optionName]}}
</view>
<text class="placeholder" wx:else>请选择</text>
</view>
<!-- 备注 -->
<view class="remarks_box" wx:if="{{item.type == 'remarkPopup'}}">
<view class="text-hide" wx:if="{{formData[item.name]}}">
{{formData[item.name]}}
</view>
<text class="placeholder" wx:else>请输入</text>
</view>
</gl-cell>
</view>
......@@ -20,7 +20,7 @@
color: #C3C3C3;
}
.picker {
.picker,.remarks_box{
display: flex;
flex-direction: row-reverse;
height: 80rpx;
......
......@@ -26,7 +26,15 @@ Component({
title: String,
orderInfo: Object,
pickerObj: Object,
isAdditionRecordOrder: Boolean
isAdditionRecordOrder: Boolean,
popupHeight: {
type: String,
value: '60%'
},
goodsNumber: {
type: Number,
value: 1
}
},
/**
......@@ -53,7 +61,7 @@ Component({
this.setData({optionList})
},
confirm() {
let { optionList, orderInfo, pickerObj, title, isAdditionRecordOrder } = this.data
let { optionList, orderInfo, pickerObj, title, isAdditionRecordOrder, goodsNumber } = this.data
let arr = optionList?.filter(v => v.active) || []
if (!arr.length) {
return wx.showToast({
......@@ -67,13 +75,13 @@ Component({
orderInfo[pickerObj.optionName] = arr[0][pickerObj.optionName] || ''
if (pickerObj.flag) { // 商品带出金额
// 定金金额
orderInfo['depositPrice'] = `¥${this.priceFilter(arr[0]?.activityPrice / 100 || 0)}`
orderInfo['depositPrice'] = `¥${this.priceFilter(arr[0]?.activityPrice * goodsNumber / 100 || 0)}`
// 尾款金额 = 众筹价 - 定金金额
orderInfo['tailPayment'] = `¥${this.priceFilter((arr[0]?.crowdFundingPrice - arr[0]?.activityPrice) / 100 || 0)}`
orderInfo['crowdFundingPrice'] = `¥${this.priceFilter(arr[0]?.crowdFundingPrice / 100 || 0)}`
orderInfo['tailPayment'] = `¥${this.priceFilter((arr[0]?.crowdFundingPrice - arr[0]?.activityPrice) * goodsNumber / 100 || 0)}`
orderInfo['crowdFundingPrice'] = `¥${this.priceFilter(arr[0]?.crowdFundingPrice * goodsNumber / 100 || 0)}`
// 筛选交易流水号 补录用订单总价 关联尾款单(有定金支付时间 用尾款 没有支付时间 用订单总价)
if (isAdditionRecordOrder) {
orderInfo['tailPayment'] = `¥${this.priceFilter(arr[0]?.crowdFundingPrice / 100 || 0)}`
// orderInfo['tailPayment'] = `¥${this.priceFilter(arr[0]?.crowdFundingPrice / 100 || 0)}`
orderInfo['totalFee'] = arr[0]?.crowdFundingPrice || 0
} else {
orderInfo['totalFee'] = (arr[0]?.crowdFundingPrice - arr[0]?.activityPrice) || 0
......
<!--packageCrowdFunding/components/PickerSelect/PickerSelect.wxml-->
<popup show="{{show}}" bindconfirm="confirm" bindcancel="cancel" height="60%">
<popup show="{{show}}" bindconfirm="confirm" bindcancel="cancel" height="{{popupHeight || '60%'}}">
<view class="sub-title text-center">{{title}}</view>
<scroll-view class="picker_select_box" scroll-y enhanced="{{true}}" show-scrollbar="{{false}}">
<block wx:for="{{optionList}}" wx:key="index">
......
import Api from '../../api'
import api from "../../api";
Component({
options: {
......@@ -110,7 +109,9 @@ Component({
selectData: ['客户姓名','订单编号','手机号'], // 下拉列表的数据
selectIndex: 0, // 选择的下拉列表下标
showSelect: false, // 下拉框
confirmFlag: false
confirmFlag: false,
remarkType: '', // 备注类型 1备注 2 退款原因
selectItem: {} // 修改备注的订单对象
},
methods: {
init() {
......@@ -149,9 +150,9 @@ Component({
this.getList()
},
remarkCancel() {
this.setData({
showRemark: false,
})
this.setData({
showRemark: false,
})
},
tabClick(e) {
let {searchObj} = this.data
......@@ -186,6 +187,14 @@ Component({
}
})
},
// 复制文案
copyData(e) {
const {target, flag} = e.currentTarget.dataset
let copyItem = flag == 1 ? `${target.customerName}\t${target.customerPhone}` : target.subOrderCode
wx.setClipboardData({
data: copyItem
})
},
getList(isReset = false) {
this.setData({
......@@ -245,24 +254,55 @@ Component({
}
})
},
showMask(e) {
const { item } = e.currentTarget.dataset || {}
this.setData({
showRemark: true,
remarkType: 1,
selectItem: item
})
},
// 备注确认
remarkConfirm(e) {
let value = e.detail
let refundRemark = value
const {subOrderCodeCopy} = this.data
let value = e.detail
// 备注类型 remarkType 1备注 2退款原因
const {subOrderCodeCopy, remarkType, list, selectItem} = this.data
if (remarkType == 1) {
if (value) {
wx.showLoading()
Api.updateOrderRemark({
orderCode: selectItem?.subOrderCode,
remark: value
}).then(res => {
wx.hideLoading()
let { code } = res
if (code == 0) {
// 将订单项备注值回填 不请求接口刷新页面
list.forEach(val => {
if (val.subOrderCode == selectItem.subOrderCode) {
val.remark = value
}
})
this.setData({list})
}
})
}
} else {
let params = {
orderCode: subOrderCodeCopy,
refundRemark
orderCode: subOrderCodeCopy,
refundRemark: value
}
wx.showLoading()
Api.markAsRefunded(params).then(res => {
if (res.code == 0) {
console.log(res)
wx.$util.showToast('退款成功!')
this.getList()
} else {
wx.$util.showToast(res.message || '接口异常')
}
wx.hideLoading()
if (res.code == 0) {
wx.$util.showToast('退款成功!')
this.getList()
} else {
wx.$util.showToast(res.message || '接口异常')
}
})
}
},
handleClickBtn(e) {
const {target} = e.currentTarget.dataset
......@@ -276,20 +316,21 @@ Component({
const {goodsId: shopmallGoodsId, subOrderCode} = target
let params = {
subOrderCode,
orderPaySource: 1,
orderPaySource: 1, // 订单支付源(1.正常付尾款,2关联尾款单,3未收款新增,4已收款补录)
shopmallGoodsId,
selectPayType:1,
updatedBy: accountName
selectPayType:1, // 支付方式(1:线上微信支付,2:线下收款,3:POS机收款, 4:支付宝支付) 默认使用微信支付
updatedBy: accountName,
remark: target?.remark
}
if (confirmFlag) return
wx.$util.showLoading()
this.setData({confirmFlag: true})
api.createPayOrderAPI(params).then(res => {
Api.createPayOrderAPI(params).then(res => {
let {code, data, message} = res
wx.$util.hideLoading()
if (code == '0') {
// wx.$router.reLaunch
wx.$router.go('activityPay', {orderCode: target.subOrderCode, paramsActivityPrice: target.payedDate ? target.activityPrice : '', paramsActivityId: target.activityId, supplementOrderFlag: target.supplementOrderFlag})
wx.$router.go('activityPay', {orderCode: target.subOrderCode, paramsActivityPrice: target.payedDate ? target.activityPrice : '', paramsActivityId: target.activityId, supplementOrderFlag: target.supplementOrderFlag, orderPaySource: 1, goodsNumber: target.goodsNumber || 1, shopmallGoodsId})
setTimeout(() => {
this.setData({
confirmFlag: false
......@@ -302,35 +343,13 @@ Component({
})
}
})
// wx.$router.go('activityPay',{orderCode:target.subOrderCode})
}
if (target.tailOrderStatus == 1 || target.tailOrderStatus == 4) { // 已支付或退定金状态
this.setData({
showRemark: true,
})
// wx.showModal({
// title: '温馨提示',
// content: '请确定将此订单状态标记为已退款',
// showCancel: true,
// confirmText: '确定',
// confirmColor: '#3582EE',
// success(res) {
// if (res.confirm) {
// Api.markAsRefunded({orderCode: subOrderCode}).then(res => {
// if (res.code == 0){
// console.log(res)
// wx.$util.showToast('退款成功!')
// this.getList()
// }else{
// wx.$util.showToast(res.message || '接口异常')
// }
// })
// }
// }
// })
this.setData({
showRemark: true,
remarkType: 2
})
}
},
search() {
this.setData({
......
......@@ -70,6 +70,7 @@
<view class="header-cust">
<view class="cust-name">{{item.customerName}}</view>
<view class="cust-phone">{{item.customerPhone}}</view>
<image class="copy-icon" bindtap="copyData" data-target="{{item}}" data-flag="1" src="../../images/copy-text.png" mode=""/>
</view>
<view class="header-status">
<view wx:if="{{ item.tailOrderStatus =='1'}}">
......@@ -90,8 +91,16 @@
<view class="order">
<view class="order-label">{{i.label}} </view>
<view class="order-value">
<block wx:if="{{i.type == 'price' && item[i.key]}}">¥{{filter.priceFilter(item[i.key])}}</block>
<block wx:else>{{item[i.key] || ''}}</block>
<block wx:if="{{i.type == 'price' && (item[i.key]+'')}}">¥{{filter.priceFilter(item[i.key])}}</block>
<block wx:else>
<view wx:if="{{i.key == 'subOrderCode'}}" class="ordercode-class">
{{item[i.key] || ''}}
<image class="copy-icon" bindtap="copyData" data-target="{{item}}" data-flag="2" src="../../images/copy-text.png" mode=""/>
</view>
<view wx:else>
{{item[i.key] || ''}}
</view>
</block>
</view>
</view>
</block>
......@@ -108,6 +117,15 @@
<block>{{item['refundRemark']}}</block>
</view>
</view>
<view class="order refund_text">
<view class="order-label">备注 </view>
<view bindtap="showMask" class="order-value" data-item="{{item}}">
<view wx:if="{{item.remark}}">
<block>{{item['remark']}}</block>
</view>
<view class="placeholder_class" wx:if="{{!item.remark}}">点击添加备注</view>
</view>
</view>
</view>
</view>
......@@ -137,11 +155,12 @@
</view>
<remark-popup wx:if="{{showRemark}}"
title="退款备注"
title="{{remarkType == 1 ? '备注' : '退款备注'}}"
show="{{showRemark}}"
required="{{true}}"
maxlength="100"
maxlength="{{remarkType == 1 ? 30 : 100}}"
value="{{remarkType == 1 ? selectItem.remark : ''}}"
bindcancel="remarkCancel"
bindconfirm="remarkConfirm"
placeholder="请填写退款备注" />
placeholder="请填写内容,最多{{remarkType == 1 ? 30 : 100}}个字" />
......@@ -147,7 +147,7 @@
.order-box {
background-color: #fdfdfd;
height: calc(100% - 104rpx - 104rpx - 52rpx - 20rpx);
height: calc(100% - 104rpx - 104rpx - 52rpx - 30rpx);
}
.list {
......@@ -204,6 +204,12 @@
margin-left: 24rpx;
}
.item-header .header-cust .copy-icon{
width: 32rpx;
height: 32rpx;
margin-left: 16rpx;
}
.list .icon-sex {
width: 24rpx;
height: 24rpx;
......@@ -445,6 +451,30 @@
align-items: center;
}
.list .item .refund_text .order-value{
text-overflow:ellipsis;
display: -webkit-box;
word-break: break-all;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
overflow: hidden;
}
.list .item .refund_text .order-value .placeholder_class{
color: #C8C8C8;
}
.list .item .order .order-value .ordercode-class{
display: flex;
align-items: center;
}
.list .item .order .order-value .ordercode-class .copy-icon{
width: 32rpx;
height: 32rpx;
margin-left: 16rpx;
}
.list .item .order .order-value .order-value-item:first-of-type {
max-width: 70%;
}
......
......@@ -22,8 +22,8 @@ page {
color: #fff;
.imgBox image {
width: 18rpx;
height: 34rpx;
width: 22rpx;
height: 32rpx;
display: inline-block;
vertical-align: middle;
}
......@@ -40,7 +40,6 @@ page {
}
}
}
.box {
......@@ -69,7 +68,7 @@ page {
overflow: hidden;
border-radius: 16rpx 16rpx 0 0;
overflow: hidden;
flex-shrink: 0;
.tab-item {
flex: 1;
display: flex;
......@@ -85,20 +84,95 @@ page {
}
}
}
.pay-box{
flex-shrink: 0;
display: flex;
flex-flow: column;
align-items: center;
justify-content: center;
.tab-title {
margin: 36rpx 0;
}
.tab-title {
margin: 36rpx 0;
}
.tab-qrcode {
width: 430rpx;
height: 430rpx;
}
.tab-qrcode {
width: 430rpx;
height: 430rpx;
.tab-desc {
margin-top: 20rpx;
font-size: 24rpx;
color: #666666;
}
}
.tab-desc {
margin-top: 20rpx;
font-size: 24rpx;
color: #666666;
.input-box{
flex-shrink: 0;
width: 100%;
height: 100%;
padding: 38rpx 44rpx;
box-sizing: border-box;
.input-item{
display: flex;
margin-bottom: 36rpx;
.label{
flex-shrink: 0;
width: 150rpx;
height: 68rpx;
line-height: 68rpx;
font-size: 24rpx;
text-align: right;
margin-right: 16rpx;
color: #222222;
}
.input_content{
box-sizing: border-box;
flex-shrink: 0;
width: 456rpx;
height: 68rpx;
border: 2rpx solid #DCDCDC;
border-radius: 8rpx;
padding: 0 20rpx;
display: flex;
align-items: center;
input {
width: 100%;
height: 100%;
}
}
.payVoucher_image{
width: 456rpx;
height: 316rpx;
border: 2rpx dashed #999999;
border-radius: 20rpx;
}
.camera-box{
flex-shrink: 0;
width: 460rpx;
height: 320rpx;
background-image: url('https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/miniProgram/pay-voucher-bg.png');
background-size: 100% 100%;
position: relative;
.camera-icon{
width: 96rpx;
height: 96rpx;
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
}
}
}
.confirm-btn{
display: flex;
align-items: center;
justify-content: center;
font-size: 14px;
color: #FFFFFF;
width: 100%;
height: 88rpx;
background: #3582EE;
border-radius: 12rpx;
}
}
}
......@@ -157,6 +231,7 @@ page {
}
&:last-child {
width: calc(100% - 200rpx);
color: #1B233D;
}
......@@ -173,6 +248,18 @@ page {
text-overflow: ellipsis;
}
}
&.placeholder_class{
color: #C8C8C8;
}
&.remark-text{
text-overflow:ellipsis;
display: -webkit-box;
word-break: break-all;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
overflow: hidden;
width: 100% !important;
}
}
}
......
......@@ -16,32 +16,64 @@
<view class=" box">
<view class="tab-head">
<view
class="tab-item {{orderPaySource === item.id?'active':'' }}"
class="tab-item {{selectPayType === item.id?'active':'' }}"
wx:for="{{payItems}}"
wx:key="index"
data-item="{{item}}"
catchtap="handleTab">
<gl-image
<gl-image
class="btn_icon"
data-item="{{item}}"
webp
src="/miniProgram/wxPay.png"
wx:if="{{item.id==1}}" />
<gl-image
class="btn_icon"
data-item="{{item}}"
webp
src="/miniProgram/posPay.png"
wx:else></gl-image>
src="/miniProgram/{{item.icon}}.png"></gl-image>
{{item.name}}
</view>
</view>
<view class="tab-title">{{orderDetail.merchantName}}</view>
<view class="tab-qrcode">
<image src="{{orderPaySource==1?wxqrcode:posqrcode}}" mode="widthFix" />
</view>
<view class="tab-desc" hidden="{{orderPaySource==3}}">请让客户打开微信扫描上方付款码进行支付</view>
<view class="tab-desc" hidden="{{orderPaySource==1}}">请使用POS机扫描此码,再向客户收款</view>
<!-- 微信/pos机支付 -->
<block wx:if="{{selectPayType == 1 || selectPayType == 3}}">
<view class="pay-box">
<view class="tab-title">{{orderDetail.merchantName}}</view>
<view class="tab-qrcode">
<image src="{{selectPayType==1?wxqrcode:posqrcode}}" mode="widthFix" />
</view>
<view class="tab-desc" hidden="{{selectPayType==3}}">请让客户打开微信扫描上方付款码进行支付</view>
<view class="tab-desc" hidden="{{selectPayType==1}}">请使用POS机扫描此码,再向客户收款</view>
</view>
</block>
<!-- 门店收款 -->
<block wx:if="{{selectPayType == 2}}">
<view class="input-box">
<view class="input-item">
<view class="label">交易流水号</view>
<view class="input_content">
<input
type="text"
bindinput="input"
value="{{customOutTradeNo}}"
maxlength="32" />
</view>
</view>
<view class="input-item">
<view class="label">上传付款凭证</view>
<view bindtap="upLoad">
<block wx:if="{{customPayVoucher}}">
<image class="payVoucher_image" src="{{customPayVoucher}}" />
</block>
<block wx:else>
<view class="camera-box">
<gl-image
class="camera-icon"
webp
src="/miniProgram/camera-icon.png"></gl-image>
</view>
</block>
</view>
</view>
<view class="confirm-btn" bindtap="confirm">确定</view>
</view>
</block>
</view>
<!-- <view class="infoBox"> -->
<!-- <activity-info orderInfo="{{orderDetail}}" /> -->
......@@ -57,6 +89,10 @@
<view class="money" wx:elif="{{item.handle == 'money'}}">
¥{{orderDetail[item.value] || 0}}
</view>
<view wx:elif="{{item.handle == 'input'}}" bindtap="showMask">
<view class="placeholder_class" wx:if="{{!orderDetail[item.value]}}">点击添加备注</view>
<view class="remark-text" wx:else>{{orderDetail[item.value]}}</view>
</view>
<view wx:else>{{orderDetail[item.value] || ''}}</view>
</view>
</view>
......@@ -66,6 +102,15 @@
pickerObj="{{pickerObj}}"
orderInfo="{{orderInfo}}"
bindconfirm="changeGoods" />
<remark-popup wx:if="{{showRemark}}"
title="备注"
show="{{showRemark}}"
required="{{true}}"
maxlength="30"
value="{{textAreaValue}}"
bindcancel="remarkCancel"
bindconfirm="remarkConfirm"
placeholder="请填写内容,最多30个字" />
<!-- <view class="page-box isFullSucreen">
<view class="img-bg">
<glsx-image webp src="store-assistant/visitor_bg.png" />
......
......@@ -11,7 +11,14 @@ Page({
orderInfo: {},
orderNoPopup: false,
activityName: '',
activityId: ''
activityId: '',
navBarHeight: 0
},
navbarReady(e) {
let navBarHeight = e.detail.height
this.setData({
navBarHeight
})
},
/**
......@@ -21,7 +28,7 @@ Page({
// 推荐人
let { orderObj, orderInfo } = this.data
if (app.globalData?.staffListRange && orderObj?.orderFormList) {
orderObj.orderFormList[orderObj.orderFormList.length - 1].optionList = app.globalData.staffListRange
orderObj.orderFormList[orderObj.orderFormList.findIndex(v => v.name == 'uuid')].optionList = app.globalData.staffListRange
}
// 商品
if (app.globalData?.crowdFundingShopInfo && orderObj?.shopFormList) {
......@@ -34,9 +41,9 @@ Page({
orderObj.shopFormList[0].readonly = true
orderInfo.shopmallGoodsId = app.globalData?.crowdFundingShopInfo[0]?.goodsId || ''
orderInfo.goodsName = app.globalData?.crowdFundingShopInfo[0]?.goodsName || ''
orderInfo.activityPrice = `¥${this.priceFilter(app.globalData?.crowdFundingShopInfo[0]?.activityPrice / 100 || 0)}`
orderInfo.crowdFundingPrice = `¥${this.priceFilter(app.globalData?.crowdFundingShopInfo[0]?.crowdFundingPrice / 100 || 0)}`
orderInfo.tailPayment = `¥${this.priceFilter((app.globalData?.crowdFundingShopInfo[0]?.crowdFundingPrice - app.globalData?.crowdFundingShopInfo[0]?.activityPrice) / 100 || 0)}`
orderInfo.depositPrice = `¥${this.priceFilter(app.globalData?.crowdFundingShopInfo[0]?.activityPrice / 100 || 0)}` // 定金金额
orderInfo.crowdFundingPrice = `¥${this.priceFilter(app.globalData?.crowdFundingShopInfo[0]?.crowdFundingPrice / 100 || 0)}` // 众筹价
orderInfo.tailPayment = `¥${this.priceFilter((app.globalData?.crowdFundingShopInfo[0]?.crowdFundingPrice - app.globalData?.crowdFundingShopInfo[0]?.activityPrice) / 100 || 0)}` // 尾款
orderInfo['totalFee'] = app.globalData?.crowdFundingShopInfo[0]?.crowdFundingPrice || 0
orderInfo.goodsId = app.globalData?.crowdFundingShopInfo[0]?.goodsId
}
......@@ -68,6 +75,24 @@ Page({
})
},
// 添加备注
showMask() {
this.setData({
showRemark: true,
})
},
remarkCancel() {
this.setData({
showRemark: false,
})
},
remarkConfirm(e) {
let remark = e.detail
let { orderInfo } = this.data
orderInfo.remark = remark
this.setData({orderInfo})
},
// 自定义picker选择器
showPickerSelect(e) {
this.setData({
......@@ -103,7 +128,8 @@ Page({
shopmallGoodsId: orderInfo.goodsId,
orderPaySource: 4,
activityId: activityId,
activityName: activityName
activityName: activityName,
remark: orderInfo?.remark // 备注
}
wx.$util.showLoading()
api.createFullPayOrderAPI(params).then(res => {
......
<!--packageCrowdFunding/pages/additionRecordOrder/additionRecordOrder.wxml-->
<view class="addition-record-order">
<view class="title">订单信息</view>
<view class="content-box">
<scroll-view scroll-y class="content-box" style="height: calc(100vh - 220rpx);">
<view class="box">
<gl-form formData="{{orderInfo}}" bindshowPickerSelect="showPickerSelect" formDataList="{{orderObj.shopFormList}}"></gl-form>
</view>
<view class="box">
<gl-form bindshowOrderNoPopup="showOrderNoPopup" bindshowPickerSelect="showPickerSelect" formData="{{orderInfo}}" dataAttrName="orderInfo" formDataList="{{orderObj.orderFormList}}"></gl-form>
<gl-form bindshowOrderNoPopup="showOrderNoPopup" bindshowPickerSelect="showPickerSelect" bindshowMask="showMask" formData="{{orderInfo}}" dataAttrName="orderInfo" formDataList="{{orderObj.orderFormList}}"></gl-form>
</view>
</view>
</scroll-view>
<view class="btn-box {{isFullSucreen?'isFullSucreen-btn':''}}">
<view class="btn" bindtap="confirm">确定</view>
</view>
......@@ -25,3 +25,12 @@
orderInfo="{{orderInfo}}"
isAdditionRecordOrder="true"
/>
<remark-popup wx:if="{{showRemark}}"
title="备注"
show="{{showRemark}}"
required="{{true}}"
value="{{orderInfo.remark}}"
maxlength="30"
bindcancel="remarkCancel"
bindconfirm="remarkConfirm"
placeholder="请填写内容,最多30个字" />
......@@ -68,9 +68,14 @@ const orderObj = {
type: 'select',
optionList: [],
optionId: 'uuid',
optionName: 'staffName',
optionName: 'staffName'
},
{
label: '备注',
name: 'remark',
type: 'remarkPopup',
noBorder: true
}
},
]
}
......
......@@ -42,6 +42,11 @@ Page({
{
name: '订单编号',
value: 'subOrderCode'
},
{
name: '备注',
value: 'remark',
handle: 'input'
}
],
confirmFlag: false
......@@ -57,8 +62,8 @@ Page({
},
initOrderInfo() {
const {orderObj, orderList, orderInfo} = this.data
// 商品
api.getSamePriceGoodsAPI({actId: orderInfo.activityId, activityPrice: orderInfo.payedDate ? orderInfo.activityPrice : ''}).then(res => {
// 商品 (购买多个商品数量 定金过滤 总定价/购买数量)
api.getSamePriceGoodsAPI({actId: orderInfo.activityId, activityPrice: orderInfo.payedDate ? (orderInfo.activityPrice / orderInfo?.goodsNumber) : ''}).then(res => {
let { code, data, message } = res
if (code == 0) {
if (data && orderObj?.shopFormList) {
......@@ -90,6 +95,35 @@ Page({
pickerObj: this.data.orderObj.shopFormList[0]
})
},
// 添加备注
showMask() {
this.setData({
showRemark: true,
})
},
remarkCancel() {
this.setData({
showRemark: false,
})
},
// 修改备注
remarkConfirm(e) {
let remark = e.detail
let { orderInfo } = this.data
if (remark) {
api.updateOrderRemark({
orderCode: orderInfo?.subOrderCode,
remark: remark
}).then(res => {
let { code } = res
if (code == 0) {
// 直接更新订单备注字段
orderInfo.remark = remark
this.setData({orderInfo})
}
})
}
},
confirm() {
const {orderInfo, confirmFlag} = this.data
// console.log(orderInfo, orderListInfo)
......@@ -169,6 +203,7 @@ Page({
list.tailPayment = list.supplementOrderFlag == 1 ? `¥${this.priceFilter(list.crowdFundingPrice || 0)}` : `¥${this.priceFilter(list.tailPayment || 0)}`
list.shopmallGoodsId = list.goodsId || ''
list.payedDateStr = list.payedDate ? wx.$util.tsFormatTime(list.payedDate, 'Y年M月D日 h:m:s') : ''
list.goodsNumber = list.goodsNumber || 1
this.setData({
orderInfo: list
})
......
......@@ -143,6 +143,12 @@
text-overflow: ellipsis;
}
}
&.remark-text{
width: calc(100% - 200rpx);
.placeholder_class{
color: #C8C8C8;
}
}
}
}
......
......@@ -36,6 +36,10 @@
<view wx:if="{{item.isMark}}" class="mark-text" bindtap="showPopup">
<text class="goods_name_class">{{orderInfo[item.value] || '请选择商品'}}</text><text> ></text>
</view>
<view wx:elif="{{item.handle == 'input'}}" class="remark-text" bindtap="showMask">
<text class="placeholder_class" wx:if="{{!orderInfo[item.value]}}">点击添加备注</text>
<text wx:else>{{orderInfo[item.value]}}</text>
</view>
<view wx:else>{{orderInfo[item.value] || ''}}</view>
</view>
</view>
......@@ -57,4 +61,14 @@
pickerObj="{{pickerObj}}"
orderInfo="{{orderInfo}}"
isAdditionRecordOrder="{{!orderInfo.payedDate}}"
goodsNumber="{{orderInfo.goodsNumber}}"
/>
<remark-popup wx:if="{{showRemark}}"
title="备注"
show="{{showRemark}}"
required="{{true}}"
value="{{orderInfo.remark}}"
maxlength="30"
bindcancel="remarkCancel"
bindconfirm="remarkConfirm"
placeholder="请填写内容,最多30个字" />
// packageCrowdFunding/pages/newOrder/components/paymentVoucherPopup.js
import { uploadImg } from '~/api/api'
Component({
/**
* 组件的属性列表
*/
properties: {
show: {
type: Boolean,
observer: function(n) {
if (n) {
this.setData({
outTradeNo: '',
payVoucher: ''
})
}
}
},
},
/**
* 组件的初始数据
*/
data: {
outTradeNo: '',
payVoucher: ''
},
/**
* 组件的方法列表
*/
methods: {
input(e) {
let { value } = e.detail
let val = value.replace(/[^a-zA-Z0-9]/g, '')
this.setData({
outTradeNo: val
})
},
// 上传付款凭证
upLoad() {
let _this = this
wx.chooseImage({
count: 1,
success(res) {
let [tempFiles] = res.tempFilePaths
let imgType = tempFiles.split('.')[1]
let type = imgType == 'unknown' ? 'jpg' : imgType
wx.getFileSystemManager().readFile({
filePath: tempFiles, //选择图片返回的相对路径
encoding: 'base64', //编码格式
success(_res) {
wx.$util.showLoading('上传中...')
uploadImg({
file: `${type}@${_res.data}`
})
.then(img => {
wx.$util.hideLoading()
console.log(img)
let { code, data, message } = img
if (code == 0) {
_this.setData({
payVoucher: data
})
} else {
wx.$util.showToast(message)
}
})
}
})
}
})
},
confirm() {
let { outTradeNo, payVoucher } = this.data
if (!outTradeNo) {
return wx.$util.showToast('请输入交易流水号')
}
if (!payVoucher) {
return wx.$util.showToast('请上传付款凭证')
}
this.triggerEvent('payVoucherConfirm', {outTradeNo, payVoucher})
},
cancel() {
this.setData({
show: false
})
}
}
})
/* packageCrowdFunding/pages/newOrder/components/paymentVoucherPopup.wxss */
.input-box{
flex-shrink: 0;
width: 100%;
height: 100%;
padding: 38rpx 44rpx;
box-sizing: border-box;
.input-item{
display: flex;
margin-bottom: 36rpx;
.label{
flex-shrink: 0;
width: 150rpx;
height: 68rpx;
line-height: 68rpx;
font-size: 24rpx;
text-align: right;
margin-right: 16rpx;
color: #222222;
}
.input_content{
box-sizing: border-box;
flex-shrink: 0;
width: 456rpx;
height: 68rpx;
border: 2rpx solid #DCDCDC;
border-radius: 8rpx;
padding: 0 20rpx;
display: flex;
align-items: center;
input {
width: 100%;
height: 100%;
}
}
.payVoucher_image{
width: 456rpx;
height: 316rpx;
border: 2rpx dashed #999999;
border-radius: 20rpx;
}
.camera-box{
flex-shrink: 0;
width: 460rpx;
height: 320rpx;
background-image: url('https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/miniProgram/pay-voucher-bg.png');
background-size: 100% 100%;
position: relative;
.camera-icon{
width: 96rpx;
height: 96rpx;
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
}
}
}
}
\ No newline at end of file
<!--packageCrowdFunding/pages/newOrder/components/paymentVoucherPopup.wxml-->
<popup show="{{show}}" bindconfirm="confirm" bindcancel="cancel" height="750rpx" title="上传付款凭证">
<view class="input-box">
<view class="input-item">
<view class="label">交易流水号</view>
<view class="input_content">
<input
type="text"
bindinput="input"
value="{{outTradeNo}}"
maxlength="32" />
</view>
</view>
<view class="input-item">
<view class="label">上传付款凭证</view>
<view bindtap="upLoad">
<block wx:if="{{payVoucher}}">
<image class="payVoucher_image" src="{{payVoucher}}" />
</block>
<block wx:else>
<view class="camera-box">
<gl-image
class="camera-icon"
webp
src="/miniProgram/camera-icon.png"></gl-image>
</view>
</block>
</view>
</view>
</view>
</popup>
......@@ -2,7 +2,8 @@ const formRule = {
shopmallGoodsId: [{ required: true, message: '请选择商品' }],
customerName: [{ required: true, message: '客户名称不能为空' }],
customerPhone: [{ required: true, message: '客户手机号不能为空' }],
userId: [{ required: true, message: '推荐人不能为空' }]
userId: [{ required: true, message: '推荐人不能为空' }],
payType: [{ required: true, message: '请选择支付方式' }]
}
const orderObj = {
......@@ -33,7 +34,31 @@ const orderObj = {
type: 'select',
optionList: [],
optionId: 'userId',
optionName: 'employeeName',
optionName: 'employeeName'
},
{
label: '备注',
name: 'remark',
type: 'remarkPopup'
},
{
label: '支付方式',
pickerTitle: '支付方式',
name: 'payType',
type: 'select',
optionList: [{
payType: 'wechat',
confValue: '微信支付'
}, {
payType: 'pos',
confValue: 'POS机支付'
}, {
payType: 'store',
confValue: '门店收款'
}],
optionId: 'payType',
optionName: 'confValue',
height: '40%',
noBorder: true
}
],
......
......@@ -12,13 +12,23 @@ Page({
formRule: constantData.formRule,
orderInfo: {},
dataAttrName: 'orderInfo',
confirmFlag: false
confirmFlag: false,
showRemark: false,
showPaymentVoucherVisible: false,
navBarHeight: 0,
popupHeight: ''
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {},
navbarReady(e) {
let navBarHeight = e.detail.height
this.setData({
navBarHeight
})
},
back() {
wx.$router.back()
},
......@@ -36,7 +46,6 @@ Page({
let { orderObj, orderInfo } = this.data
// 商品
if (app.globalData?.crowdFundingShopInfo && orderObj?.shopFormList) {
console.log(app.globalData?.crowdFundingShopInfo?.length)
if (app.globalData?.crowdFundingShopInfo?.length > 1) {
// 多商品
orderObj.shopFormList[1].optionList = app.globalData?.crowdFundingShopInfo.map(item => {
......@@ -53,7 +62,7 @@ Page({
}
}
if (app.globalData?.staffListRange && orderObj?.orderFormList) {
orderObj.orderFormList[orderObj.orderFormList.length - 1].optionList = app.globalData.staffListRange.map(item => {
orderObj.orderFormList[orderObj.orderFormList.findIndex(v => v.name == 'employeeName')].optionList = app.globalData.staffListRange.map(item => {
item.employeeName = item.staffName
item.userId = item.uuid
return item
......@@ -67,23 +76,22 @@ Page({
return (Math.round(num * pow) / pow).toFixed(2)
},
confirm(e) {
const { target } = e.currentTarget.dataset
var { formRule, orderInfo, confirmFlag } = this.data
// let thisPage = this.$router.getCurrentPage()
// let thisPage = wx.$router.getPageInstance()
// console.log(thisPage.data['orderInfo']['actualSalesPersonId'])
// if (!thisPage.data['orderInfo']['referrerId']) {
// wx.$util.showToast('请选择推荐人')
// return
// }
let validObj = fn.checkRequired(orderInfo, formRule)
if (validObj) {
wx.$util.showToast(validObj.message)
return
}
if (confirmFlag) return
// 门店收款
if (orderInfo?.payType == 'store') {
this.setData({
showPaymentVoucherVisible: true
})
return
}
let { default4SStoreInfo_crowdFunding: merchantInfo } = wx.$util.getUserInfo()
const selectPayType = target == 'wechat' ? 1 : 3
const selectPayType = orderInfo?.payType == 'wechat' ? 1 : orderInfo?.payType == 'pos' ? 3 : ''
const orderObj = wx.$util.deepClone(orderInfo)
delete orderObj.activityPrice
delete orderObj.crowdFundingPrice
......@@ -92,7 +100,7 @@ Page({
let params = {
...orderObj,
selectPayType,
orderPaySource: 3,
orderPaySource: 3, // 订单支付源(1.正常付尾款,2关联尾款单,3未收款新增,4已收款补录)
merchantId: merchantInfo.merchantId,
merchantName: merchantInfo.merchantName
}
......@@ -109,7 +117,7 @@ Page({
let { code, data, message } = res
if (code == '0') {
// 新增未收款单 付全款金额
wx.$router.redirectTo('activityPay', { orderCode: data.subOrderCode, selectPayType, outTradeNo: data.outTradeNo || data?.payOrder?.outTradeNo, paramsActivityId: orderInfo.activityId, supplementOrderFlag: 1 })
wx.$router.redirectTo('activityPay', { orderCode: data.subOrderCode, selectPayType, outTradeNo: data.outTradeNo || data?.payOrder?.outTradeNo, paramsActivityId: orderInfo.activityId, supplementOrderFlag: 1, orderPaySource: 3, shopmallGoodsId: orderInfo.shopmallGoodsId })
setTimeout(() => {
// 防止页面跳转慢 重复点击
this.setData({
......@@ -129,14 +137,90 @@ Page({
})
})
},
payVoucherConfirm(e) {
let obj = e?.detail
let { orderInfo } = this.data
wx.showModal({
title: '门店收款确认',
content: '确定将此订单标记为门店收款',
complete: res => {
if (res.confirm) {
let { default4SStoreInfo_crowdFunding: merchantInfo } = wx.$util.getUserInfo()
const selectPayType = orderInfo?.payType == 'wechat' ? 1 : orderInfo?.payType == 'pos' ? 3 : 2
const orderObj = wx.$util.deepClone(orderInfo)
delete orderObj.activityPrice
delete orderObj.crowdFundingPrice
delete orderObj.tailPayment
delete orderObj.specialGoodsId
let params = {
...orderObj,
selectPayType,
orderPaySource: 3,
merchantId: merchantInfo.merchantId,
merchantName: merchantInfo.merchantName,
outTradeNo: obj.outTradeNo,
payVoucher: obj.payVoucher
}
this.setData({
confirmFlag: true
})
wx.showLoading()
api
.createFullPayOrderAPI(params)
.then(res => {
console.log(res, 'res')
wx.hideLoading()
let { code, data, message } = res
if (code == '0') {
wx.$router.back()
this.setData({
confirmFlag: false
})
} else {
wx.$util.showToast(message || '接口异常')
this.setData({
confirmFlag: false
})
}
})
.finally(() => {
this.setData({
confirmFlag: false
})
})
}
}
})
this.setData({
showPaymentVoucherVisible: false
})
},
// 自定义picker选择器
showPickerSelect(e) {
this.setData({
showPickerSelect: true,
pickerTitle: e?.detail?.pickerTitle,
pickerObj: e?.detail || {}
pickerObj: e?.detail || {},
popupHeight: e?.detail?.height || ''
})
},
// 添加备注
showMask() {
this.setData({
showRemark: true
})
},
remarkCancel() {
this.setData({
showRemark: false
})
},
remarkConfirm(e) {
let remark = e.detail
let { orderInfo } = this.data
orderInfo.remark = remark
this.setData({ orderInfo })
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
......
......@@ -2,7 +2,8 @@
"navigationBarTitleText": "新增订单",
"usingComponents": {
"gl-form": "/packageCrowdFunding/components/GLForm/GLForm",
"picker-select": "/packageCrowdFunding/components/PickerSelect/PickerSelect"
"picker-select": "/packageCrowdFunding/components/PickerSelect/PickerSelect",
"payment-voucher-popup": "./components/paymentVoucherPopup"
},
"navigationStyle": "custom"
}
......@@ -12,18 +12,19 @@
</navigation-bar>
<view class="addition-record-order">
<view class="title">订单信息</view>
<view class="content-box">
<scroll-view scroll-y class="content-box" style="height: calc(100vh - {{navBarHeight}}px - 250rpx);">
<view class="box">
<gl-form formData="{{orderInfo}}" dataAttrName="orderInfo" bindshowPickerSelect="showPickerSelect" formDataList="{{orderObj.shopFormList}}"></gl-form>
</view>
<view class="box">
<gl-form bindshowOrderNoPopup="showOrderNoPopup" dataAttrName="orderInfo" bindshowPickerSelect="showPickerSelect" formData="{{orderInfo}}" formDataList="{{orderObj.orderFormList}}"></gl-form>
<gl-form bindshowOrderNoPopup="showOrderNoPopup" dataAttrName="orderInfo" bindshowPickerSelect="showPickerSelect" bindshowMask="showMask" formData="{{orderInfo}}" formDataList="{{orderObj.orderFormList}}"></gl-form>
</view>
</view>
</scroll-view>
<view class="btn-box {{isFullSucreen?'isFullSucreen-btn':''}}">
<view class="btn" bindtap="confirm" data-target="wechat">微信支付</view>
<view class="btn-lucency" bindtap="confirm" data-target="pos">POS机支付</view>
<!-- <view class="btn" bindtap="confirm" data-target="wechat">微信支付</view>
<view class="btn-lucency" bindtap="confirm" data-target="pos">POS机支付</view> -->
<view class="btn" bindtap="confirm">确定</view>
</view>
</view>
<picker-select
......@@ -31,4 +32,15 @@
title="请选择{{pickerTitle}}"
pickerObj="{{pickerObj}}"
orderInfo="{{orderInfo}}"
popupHeight="{{popupHeight}}"
/>
<remark-popup wx:if="{{showRemark}}"
title="备注"
show="{{showRemark}}"
required="{{true}}"
value="{{orderInfo.remark}}"
maxlength="30"
bindcancel="remarkCancel"
bindconfirm="remarkConfirm"
placeholder="请填写内容,最多30个字" />
<payment-voucher-popup wx:if="{{showPaymentVoucherVisible}}" show="{{showPaymentVoucherVisible}}" bindpayVoucherConfirm="payVoucherConfirm" />
<!--packageCrowdFunding/pages/paidOrder/paidOrder.wxml-->
<navigation-bar class="navigation-header" bindnavbarReady="navbarReady" showMenu="{{true}}" bindback="back" bindshowMenuPopup="showMenuPopup">
<view class="navigation-title" bindtap="showStorePicker">
<view class="navigation-title" bindtap="showStorePicker" wx:if="{{storeListRange.length}}">
<view class="navigation-title-text text-hide">{{userInfo && userInfo.default4SStoreInfo_crowdFunding && userInfo.default4SStoreInfo_crowdFunding.merchantName}}</view>
<view class="arrow">
<image src="/images/back.png"/>
......
......@@ -5,7 +5,7 @@
showMenu="{{true}}"
bindback="back"
bindshowMenuPopup="showMenuPopup">
<view class="navigation-title" bindtap="showStorePicker">
<view class="navigation-title" bindtap="showStorePicker" wx:if="{{storeListRange.length}}">
<view class="navigation-title-text text-hide">
{{userInfo && userInfo.default4SStoreInfo && userInfo.default4SStoreInfo.merchantName}}
</view>
......
// 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
// }
agree: Boolean
},
/**
* 组件的初始数据
*/
data: {
// 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?url=${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?'https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/login_checked.png':'https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/login_check.png'}}" class='check-img' />
</view>
</view>
<text>30天内免登录</text>
</view>
/* components/authSetting/authSetting.wxss */
.tips {
/* position: fixed; */
width: 100%;
/* left: 0;
bottom: 60rpx; */
font-size: 24rpx;
color: #858A94;
letter-spacing: 2rpx;
/* padding-left: 28rpx; */
box-sizing: border-box;
display: flex;
align-items: center;
justify-content: center;
}
/* .tips text {
color: #5092FF;
} */
.tips .icon {
position: absolute;
top: 50%;
left: 50%;
width: 28rpx;
height: 28rpx;
border-radius: 50%;
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;
z-index: 10;
margin-right: -18rpx;
}
\ No newline at end of file
......@@ -3,25 +3,29 @@ const sceneList = [
sceneName: '精品升级',
sceneDesc: '太阳膜升级转化下单',
sceneType: 1,
actived: false
actived: false,
recordId:1,
},
{
sceneName: '会员权益/升级',
sceneDesc: '新车车损险下单',
sceneType: 0,
actived: false
actived: false,
recordId:2,
},
{
sceneName: '售后众筹',
sceneDesc: '门店存量客户众筹下单',
sceneType: 3,
actived: false
actived: false,
recordId:3,
},
{
sceneName: '次新车转化',
sceneDesc: '次新车用户领取套餐包转化',
sceneType: 2,
actived: false
actived: false,
recordId:4,
}
]
......
......@@ -25,6 +25,8 @@ Page({
this.setData({
sceneList
})
wx.$util.pointRecord( sceneList[index].recordId)
},
/**
......@@ -53,7 +55,7 @@ Page({
},)
// 没有登录信息 或无开通场景 退出登录
if (!Object.keys(userInfo).length || !userInfo.openSceneArr?.length) {
app.login(false)
app.login(true,'请重新登录')
}
},
......
......@@ -99,7 +99,7 @@ Page({
if (userType == 2 && item?.selectPayType == 1) {
wx.$router.go('tabWorkOrder.confirmOrder', item)
} else if (userType == 2) {
wx.$router.go('tabWorkOrder.'+name, item)
wx.$router.go('tabWorkOrder.' + name, item)
} else {
wx.$util.showNoAccess()
}
......@@ -111,7 +111,7 @@ Page({
wx.$router.go('tabWorkOrder.constructionOrderDetail', item)
} else {
// console.log(item)
wx.$router.go('tabWorkOrder.'+name, item)
wx.$router.go('tabWorkOrder.' + name, item)
}
},
scan() {
......@@ -505,6 +505,12 @@ Page({
)
},
/**
* 监听 TabBar 切换点击
*/
// onTabItemTap(item) {
// console.log(item, 'item')
// },
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {}
......
// pages/wxLogin/wxLogin.js
import api from '../../api/api.js'
import { setNoSignInUuid,getNoSignInUuid } from '~/utils/cache/storageApi.js'
const app = getApp()
Page({
/**
* 页面的初始数据
......@@ -10,13 +12,20 @@ Page({
count: 60,
verificationCount: '',
loginType: 3,
agree: false
agree: false,
noLoginAgree: false
},
onRoute(loginToken) {
this.setData({
loginToken
})
},
noLoginAgreeChoose(e) {
let { detail: agree } = e
this.setData({
noLoginAgreeChoose: agree
})
},
authChoose(e) {
let { detail: agree } = e
this.setData({
......@@ -93,7 +102,7 @@ Page({
const checkAgree = this.checkAgree()
if (checkAgree) return false
let { flag, code, mobile, loginType, accountNumber, password } = this.data
let { flag, code, mobile, loginType, accountNumber, password, noLoginAgreeChoose } = this.data
console.log(flag)
if (!flag) return
wx.$util.showLoading()
......@@ -102,14 +111,18 @@ Page({
api
.smsLogin({
code,
mobile
mobile,
noSignIn: noLoginAgreeChoose
})
.then(result => {
wx.$util.showLoading()
if (result.code == 0) {
let { loginUserInfoList, sessionId } = result.data
let { loginUserInfoList, sessionId, noSignInUuid } = result.data
if (loginUserInfoList.length > 0) {
wx.$util.setSessionId(sessionId)
// wx.$storage.
noSignInUuid && setNoSignInUuid(noSignInUuid)
wx.$router.reLaunch('pages.accountItems')
} else {
wx.$router.reLaunch('pages.nothing')
......@@ -210,7 +223,7 @@ Page({
const checkAgree = this.checkAgree()
if (checkAgree) return false
let { loginToken } = this.data
let { loginToken, noLoginAgreeChoose } = this.data
let { encryptedData, iv } = e.detail
if (!encryptedData) return
wx.$util.showLoading('加载中...')
......@@ -218,15 +231,18 @@ Page({
.authPhone({
encryptedData,
loginToken,
iv
iv,
noLoginAgreeChoose
})
.then(({ code, data, message }) => {
console.log(data)
wx.hideLoading()
if (code == 0) {
let { loginUserInfoList, sessionId } = data
let { loginUserInfoList, sessionId, noSignInUuid } = data
if (loginUserInfoList.length) {
wx.$util.setSessionId(sessionId)
// wx.$storage.
noSignInUuid && setNoSignInUuid(noSignInUuid)
wx.$router.reLaunch('pages.accountItems')
} else {
wx.$router.reLaunch('pages.nothing')
......@@ -255,6 +271,8 @@ Page({
onShow: function () {
wx.hideHomeButton()
this.login()
let noSignInUuid = getNoSignInUuid()
noSignInUuid&&app.login(true)
},
login() {
wx.$util.showLoading()
......
{
"usingComponents": {
"auth-setting": "../components/authSetting/authSetting"
"auth-setting": "../components/authSetting/authSetting",
"auth-noLogin": "../components/authNoLogin/authNoLogin"
},
"navigationStyle": "custom"
}
<view class="layout {{loginType == 1?'phone_login_layout':''}}">
<navigation-bar navStyle="background-color: rgba(0,0,0,0);box-shadow:none;">生意助手员工版</navigation-bar>
<view class="box_content">
<!-- 登录区域 -->
<view class="box">
<!-- 微信登录 -->
<block wx:if="{{loginType == 3}}">
<view class="wx opacity-view">
<view class="title">
您好
</view>
<view class="subtitle">
欢迎登录生意助手员工版
</view>
<image class="img" src="https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/login_box.png" />
</view>
<view class="login-btn {{loginType == 3?'mini':''}}">
<button
size="default"
hidden="{{loginType != 3 || !agree}}"
open-type="getPhoneNumber"
bindgetphonenumber="getPhoneNumber" />
<view hidden="{{loginType !=3 }}" bindtap="checkAgree">微信登录</view>
</view>
<view
class="mobile_btn"
bindtap="changeLoginType"
data-type="1"
wx:if="{{loginType != 1}}">手机号登录 </view>
</block>
<!-- 手机号登录 -->
<block wx:if="{{loginType == 1}}">
<view class="phone_login">
<view class="title">手机号码登录</view>
<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" />
<view
class='clear'
hidden="{{!mobile}}"
bindtap="clear"
data-name='mobile'>
<image src="/images/clear.png" />
</view>
</view>
<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" />
<view
class='clear'
hidden="{{!code}}"
bindtap="clear"
data-name='code'>
<image src="/images/clear.png" />
</view>
<view class="sms {{countDown?'code-disabled':''}}" bindtap="getSms">
<view wx:if="{{countDown}}">重新发送({{count}})</view>
<view wx:else>获取验证码</view>
</view>
</view>
<view class="login_btn" bindtap="smsLogin">登录</view>
<view class="wx_login">或<text bindtap="changeLoginType" data-type="3">微信登录</text></view>
</view>
</view>
</block>
</view>
<!-- 协议 -->
<auth-setting bind:choose="authChoose" agree="{{agree}}"/>
</view>
<!-- -->
<view class="layout {{ loginType == 1?'phone_login_layout':'' }}">
<navigation-bar navStyle="background-color: rgba(0,0,0,0);box-shadow:none;">生意助手员工版</navigation-bar>
<view class="box_content">
<!-- 登录区域 -->
<view class="box">
<!-- 微信登录 -->
<block wx:if="{{ loginType == 3 }}">
<view class="wx opacity-view">
<view class="title">您好</view>
<view class="subtitle">欢迎登录生意助手员工版</view>
<image class="img" src="https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/login_box.png" />
</view>
<view class="login-btn {{ loginType == 3?'mini':'' }}">
<button size="default" hidden="{{ loginType != 3 || !agree }}" open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber" />
<view hidden="{{ loginType !=3 }}" bindtap="checkAgree">微信登录</view>
</view>
<view class="mobile_btn" bindtap="changeLoginType" data-type="1" wx:if="{{ loginType != 1 }}">手机号登录</view>
<auth-noLogin bind:choose="noLoginAgreeChoose" agree="{{ noLoginAgree }}"></auth-noLogin>
</block>
<!-- 手机号登录 -->
<block wx:if="{{ loginType == 1 }}">
<view class="phone_login">
<view class="title">手机号码登录</view>
<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"
/>
<view class="clear" hidden="{{ !mobile }}" bindtap="clear" data-name="mobile">
<image src="/images/clear.png" />
</view>
</view>
<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"
/>
<view class="clear" hidden="{{ !code }}" bindtap="clear" data-name="code">
<image src="/images/clear.png" />
</view>
<view class="sms {{ countDown?'code-disabled':'' }}" bindtap="getSms">
<view wx:if="{{ countDown }}">重新发送({{count}})</view>
<view wx:else>获取验证码</view>
</view>
</view>
<view class="login_btn" bindtap="smsLogin">登录</view>
<view class="wx_login">
或
<text bindtap="changeLoginType" data-type="3">微信登录</text>
</view>
</view>
</view>
<autoLogin-btn></autoLogin-btn>
</block>
</view>
<!-- 协议 -->
<auth-setting bind:choose="authChoose" agree="{{ agree }}" />
</view>
<!-- -->
</view>
<!-- 未同意协议弹窗提示 -->
<van-dialog
use-slot
title="隐私协议与用户协议"
show="{{ showAuthDialog }}"
class="auth-dialog-class"
width="552rpx"
show-cancel-button
confirmButtonText="同意"
confirm-button-color="#5092FF"
bind:confirm="agreeEvent"
bind:close="onClose"
use-slot
title="隐私协议与用户协议"
show="{{ showAuthDialog }}"
class="auth-dialog-class"
width="552rpx"
show-cancel-button
confirmButtonText="同意"
confirm-button-color="#5092FF"
bind:confirm="agreeEvent"
bind:close="onClose"
>
<view class="message-box">
<view class="message">为保障你的合法权益,请阅读并同意</view>
<text catchtap="jump" data-url="privacy">《隐私协议》</text>和
<text catchtap="jump" data-url="agreement">《用户协议》</text>
</view>
</van-dialog>
<view class="message-box">
<view class="message">为保障你的合法权益,请阅读并同意</view>
<text catchtap="jump" data-url="privacy">《隐私协议》</text>
和
<text catchtap="jump" data-url="agreement">《用户协议》</text>
</view>
</van-dialog>
\ No newline at end of file
......@@ -265,15 +265,8 @@
"scene": null
},
{
"name": "1.1 订单详情",
"pathName": "tabWorkOrder/pages/constructionOrderDetail/constructionOrderDetail",
"query": "",
"launchMode": "default",
"scene": null
},
{
"name": "1.1 订单列表",
"pathName": "tabWorkOrder/pages/index/index",
"pathName": "pages/tabWorkOrder/pages/index/index",
"query": "",
"launchMode": "default",
"scene": null
......@@ -312,6 +305,27 @@
"query": "",
"launchMode": "default",
"scene": null
},
{
"name": "用户画像",
"pathName": "tabDate/pages/userPortrait/userPortrait",
"query": "",
"launchMode": "default",
"scene": null
},
{
"name": "经营数据",
"pathName": "tabOperating/pages/index/index",
"query": "",
"launchMode": "default",
"scene": null
},
{
"name": "1.1 订单详情",
"pathName": "tabWorkOrder/pages/constructionOrderDetail/constructionOrderDetail",
"query": "",
"launchMode": "default",
"scene": null
}
]
}
......
......@@ -36,11 +36,14 @@ export const getYQInfo = userInfo => {
let subIndex = 0
console.log(!userInfo.isSuper && userInfo.merchantType && userInfo.userType == 2);
console.log(userInfo.merchantId,'userInfo.merchantId');
if (!userInfo.loginRole || userInfo.loginRole ==4 ) {
// console.log(userInfo.merchantId,'userInfo.merchantId');
app.globalData.yqdInfo = {
subIndex,
merchantRange: [{
merchantName: userInfo.merchantName
merchantName: userInfo.merchantName,
merchantId: userInfo.merchantId
}]
}
// this.setData({
......@@ -71,7 +74,8 @@ export const getYQInfo = userInfo => {
arr = [all, ...data]
} else {
arr = [{
merchantName: userInfo.merchantName
merchantName: userInfo.merchantName,
merchantId: userInfo.merchantId
}]
}
app.globalData.yqdInfo = {
......
<!--subvehicleConversion/pages/index/index.wxml-->
<navigation-bar class="navigation-header" bindnavbarReady="navbarReady" showMenu="{{true}}" bindshowMenuPopup="showMenuPopup" navStyle="{{navStyle}}">
<view class="navigation-title" bindtap="showStorePicker">
<view class="navigation-title" bindtap="showStorePicker" wx:if="{{storeListRange.length}}">
<view class="navigation-title-text text-hide">{{userInfo && userInfo.default4SStoreInfo_newCarConversion && userInfo.default4SStoreInfo_newCarConversion.merchantName}}</view>
<view class="arrow">
<image src="/images/back.png"/>
......
......@@ -48,5 +48,10 @@ module.exports = {
/** 编辑客户画像 */
updateProfile(data) {
return api.post('dj.api.smartcarlife.inviteRecord.updateCustomerProfile', data)
},
/** 查询客户画像 */
portraitQuery(data) {
return api.post('dj.api.smartcarlife.customer.portrait.query', data)
}
}
......@@ -578,6 +578,7 @@ Component({
})
// this.triggerEvent('change', list)
this.triggerEventSelectDay();
wx.$util.pointRecord(26)
},
// 收起/展开
......
......@@ -30,6 +30,7 @@ Page({
* inviteDate - 邀约日期(格式:yyyy-MM-dd)
* */
getListByDay(e) {
let { detail } = e
let params = {
inviteDate: `${detail.year}-${detail.month}-${detail.day}`
......@@ -57,6 +58,7 @@ Page({
// 预约按钮
handleInvite(e) {
wx.$util.pointRecord(27)
let { item } = e.currentTarget.dataset
this.setData({
inviteObj: item,
......
......@@ -20,8 +20,7 @@ Page({
remark: '',
selectPayType: 2
},
customerObj: [
{
customerObj: [{
label: '客户姓名',
key: 'customerName'
},
......@@ -55,8 +54,7 @@ Page({
portrait: true
}
],
recordObj: [
{
recordObj: [{
label: '跟进人',
key: 'userName'
},
......@@ -80,8 +78,12 @@ Page({
},
showPopup(e) {
let _this = this
let { name } = e.currentTarget.dataset
let { detail } = this.data
let {
name
} = e.currentTarget.dataset
let {
detail
} = this.data
// if (detail.inviteStatus == 4 && name == 'showDate') return _this.showToast('已施工不可操作!')// 已施工预约单不可修改到店时间
this.setData({
[name]: !this.data[name]
......@@ -89,15 +91,20 @@ Page({
},
setCopyData(e) {
console.log(e)
let { content } = e.currentTarget.dataset
let {
content
} = e.currentTarget.dataset
wx.$util.setCopyData(`${content}`)
},
editProtrait(e) {
wx.$util.pointRecord(24)
wx.$router.go('userPortrait', this.data.detail)
},
makePhoneCall(e) {
console.log(e)
let { data } = e.currentTarget.dataset
let {
data
} = e.currentTarget.dataset
wx.makePhoneCall({
phoneNumber: data
})
......@@ -123,28 +130,39 @@ Page({
})
this.getInviteDetail(options.id)
}
this.checkPhoneShow(app.globalData.YQorderSetting.yqPhoneConfig)
this.checkPhoneShow(app.globalData.YQorderSetting?.yqPhoneConfig)
},
checkPhoneShow(config) {
console.log('config', config)
// 有就屏蔽手机号的显示
if (config) {
let { customerObj } = this.data
let {
customerObj
} = this.data
delete customerObj[1]
this.setData({
customerObj
})
}
},
dealPortrait(info) {
async dealPortrait(id) {
let _userPortrait = []
let {
code,
data: info
} = await api.portraitQuery({
id
})
if (code != 0) return
CONSTANTDATA.formData.forEach(item => {
if (info[item.name]) {
if (item.type == 'textarea') {
_userPortrait.push(info[item.name])
} else {
if (item.isMult) {
let _list = info[item.name].split(',')
// let _list = info[item.name].split(',')
let _list = info[item.name]
_list.forEach(n => {
_userPortrait.push(item.optionList.find(k => k.confId == n).confName)
})
......@@ -154,7 +172,10 @@ Page({
}
}
})
return _userPortrait
this.setData({
['detail.userPortrait']: _userPortrait
})
// return _userPortrait
},
getInviteDetail(id) {
let _this = this
......@@ -165,7 +186,11 @@ Page({
})
.then(res => {
console.log(res)
let { code, message, data } = res
let {
code,
message,
data
} = res
if (code == 0) {
wx.$util.hideLoading()
let detail = {}
......@@ -183,8 +208,8 @@ Page({
...detail.customerCoupon,
...detail.customer,
...detail,
employeeName: detail?.customerCoupon.employeeName,//解决详情的userId 不是对应的销售方的useid
userId:detail?.customerCoupon.userId
employeeName: detail?.customerCoupon.employeeName, //解决详情的userId 不是对应的销售方的useid
userId: detail?.customerCoupon.userId
}
if (detail.remarks && detail.remarks.length > 0) {
detail.remarks.map(e => {
......@@ -200,12 +225,13 @@ Page({
if (detail.carSeriesName) detail.carType = `${detail.carBrand}-${detail.carChildsBrandName || ''}-${detail.carSeriesName}`
if (detail.customerCoupon.createdDate) detail.time = new Date(detail.customerCoupon.createdDate).format('yyyy-MM-dd hh:mm:ss')
if (detail.inviteDate) detail.inviteDate = new Date(detail.inviteDate).format('yyyy-MM-dd hh:mm:ss')
// 用户画像
detail.userPortrait = this.dealPortrait(detail)
this.setData({
detail,
flag: true
})
// 用户画像
this.dealPortrait(detail.customerId)
} else {
wx.showModal({
title: '温馨提示',
......@@ -223,7 +249,10 @@ Page({
})
},
setInviteDate() {
let { detail, inviteDateStr } = this.data
let {
detail,
inviteDateStr
} = this.data
api
.setInviteDate({
id: detail.id,
......@@ -234,7 +263,11 @@ Page({
wx.$refresh = true
wx.hideLoading()
console.log(res)
let { code, data, message } = res
let {
code,
data,
message
} = res
if (code == 0) {
this.setData({
showDate: false
......@@ -247,7 +280,9 @@ Page({
},
cancelInvite() {
let _this = this
let { id } = this.data.detail
let {
id
} = this.data.detail
wx.showModal({
title: '温馨提示',
content: '是否取消预约?',
......@@ -263,7 +298,10 @@ Page({
})
.then(res => {
console.log(res)
let { code, message } = res
let {
code,
message
} = res
if (code == 0) {
wx.hideLoading()
_this.showToast('取消成功!')
......@@ -279,8 +317,12 @@ Page({
},
remarkConfirm(e) {
let value = e.detail
let { detail } = this.data
let { id } = detail.remarks[0]
let {
detail
} = this.data
let {
id
} = detail.remarks[0]
if (value) {
api
.followRecord({
......@@ -288,7 +330,10 @@ Page({
remark: value
})
.then(res => {
let { code, message } = res
let {
code,
message
} = res
if (code == 0) {
this.showToast('提交成功')
this.getInviteDetail(detail.id)
......@@ -300,20 +345,25 @@ Page({
},
// 去下单
orderSubmit() {
let { detail } = this.data
let {
detail
} = this.data
detail.isAppointment = true
wx.$util.pointRecord(25)
wx.$router.redirectTo('tabWorkOrder.createOrder', detail)
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () { },
onReady: function () {},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
let { options } = this.data
let {
options
} = this.data
if (options?.id) {
this.getInviteDetail(options.id)
}
......@@ -322,25 +372,25 @@ Page({
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () { },
onHide: function () {},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () { },
onUnload: function () {},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () { },
onPullDownRefresh: function () {},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () { },
onReachBottom: function () {},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () { }
})
onShareAppMessage: function () {}
})
\ No newline at end of file
......@@ -60,7 +60,11 @@ Page({
},
4: {
text: '已施工',
color: '#999999'
color: '#3582EE'
},
7: {
text: '已支付',
color: '#14CC68'
}
},
searchObj: {},
......@@ -73,7 +77,7 @@ Page({
// let { list } = this.data
// index, ind
let {
item: { id,customerCouponId }
item: { id, customerCouponId }
} = e.currentTarget.dataset
wx.showModal({
......@@ -276,7 +280,7 @@ Page({
this.setData({
show_confirm: false
})
wx.showTabBar()
wx.showTabBar()
// else wx.$router.back()
},
showConfirm() {
......@@ -286,16 +290,19 @@ Page({
wx.hideTabBar()
},
jump(e) {
console.log(e)
let { item, name } = e.currentTarget.dataset
// console.log(e)
// return
let { item, name,recorderid } = e.currentTarget.dataset
wx.$router.go(name, item)
wx.$util.pointRecord(recorderid)
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.setData({
phoneShow: app.globalData.YQorderSetting.yqPhoneConfig
phoneShow: app.globalData.YQorderSetting?.yqPhoneConfig
})
this.getStatByPeriod()
this.getiIviteRecord()
......@@ -367,7 +374,7 @@ Page({
}
})
console.log(data.list, 'list')
const userType = !userInfo.isSuper && userInfo.merchantType&&userInfo.userType == 1
const userType = !userInfo.isSuper && userInfo.merchantType && userInfo.userType == 1
list = data.list.map(item => {
item.repeal = userType && [1, 2].includes(item.inviteStatus)
return item
......@@ -470,6 +477,13 @@ Page({
)
},
/**
* 监听 TabBar 切换点击
*/
onTabItemTap(item) {
console.log(item, 'item')
wx.$util.pointRecord(10)
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {}
......
......@@ -32,7 +32,7 @@
<view>今日预约 · <span class="txt-blue">{{inviteObj.dayInvited || 0}}</span></view>
<view>本周预约 · <span class="txt-blue">{{inviteObj.weekInvited || 0}}</span></view>
<view>超时未到店 · <span class="txt-blue">{{inviteObj.overdue || 0}}</span></view>
<image class="icon-cal" src="/images/icon-cal.png" bindtap="jump" data-item="{}" data-name="apprManage"/>
<image class="icon-cal" src="/images/icon-cal.png" bindtap="jump" data-item="{}" data-recorderId='22' data-name="apprManage"/>
</view>
<block wx:if="{{flag}}">
<scroll-view
......@@ -67,6 +67,7 @@
bindtouchmove="touchmove"
bindtouchend="touchE"
data-name="detail"
data-recorderId='23'
data-item="{{li}}">
<view class="status" style="color:{{status[li.inviteStatus].color}}">
<block>{{status[li.inviteStatus].text}}</block>
......
const sexList = [{
confId: '1',
confName: '男'
}, {
confId: '2',
confName: '女'
}]
const sexList = [
{
confId: '1',
confName: '男'
},
{
confId: '2',
confName: '女'
}
]
const age = [
{
confId: '1',
confName: '20岁以下'
},
{
confId: '2',
confName: '21-30岁'
},
{
confId: '3',
confName: '31-40岁'
},
{
confId: '4',
confName: '41-50岁'
},
{
confId: '5',
confName: '51岁以上'
}
]
const maritalStatus = [
{
confId: '1',
confName: '已婚已育'
},
{
confId: '2',
confName: '已婚未育'
},
{
confId: '3',
confName: '未婚'
}
]
const giftProduct = [
{
confId: '1',
confName: '360全包脚垫'
},
{
confId: '2',
confName: '立体脚垫'
},
{
confId: '3',
confName: '单机记录仪'
},
{
confId: '4',
confName: '4G记录仪'
},
{
confId: '5',
confName: '单机车机'
},
{
confId: '6',
confName: '联网车机'
}
]
const buyCarList = [{
confId: '1',
confName: '首次'
}, {
confId: '2',
confName: '置换'
}, {
confId: '3',
confName: '增购'
}]
const buyCarList = [
{
confId: '1',
confName: '首次'
},
{
confId: '2',
confName: '置换'
},
{
confId: '3',
confName: '增购'
}
]
const purchaseList = [{
confId: '1',
confName: '全款'
}, {
confId: '2',
confName: '正常贷款'
}, {
confId: '3',
confName: '超低首付'
}]
const purchaseList = [
{
confId: '1',
confName: '全款'
},
{
confId: '2',
confName: '正常贷款'
},
{
confId: '3',
confName: '超低首付'
}
]
const decisionList = [{
confId: '1',
confName: '自己做主'
}, {
confId: '2',
confName: '听从亲友建议'
}, {
confId: '3',
confName: '他人买单'
}]
const decisionList = [
{
confId: '1',
confName: '自己做主'
},
{
confId: '2',
confName: '听从亲友建议'
},
{
confId: '3',
confName: '他人买单'
}
]
const promoteList = [{
confId: 'Y',
confName: '是',
otherName: '推膜时有铺垫'
}, {
confId: 'N',
confName: '否',
otherName: '推膜时未铺垫'
}]
const promoteList = [
{
confId: 'Y',
confName: '是',
otherName: '推膜时有铺垫'
},
{
confId: 'N',
confName: '否',
otherName: '推膜时未铺垫'
}
]
const satisfiedList = [{
confId: 'Y',
confName: '是',
otherName: '购车上牌时客户满意'
}, {
confId: 'N',
confName: '否',
otherName: '购车上牌时客户不满'
}]
const satisfiedList = [
{
confId: 'Y',
confName: '是',
otherName: '购车上牌时客户满意'
},
{
confId: 'N',
confName: '否',
otherName: '购车上牌时客户不满'
}
]
const timeList = [{
confId: '1',
confName: '加急安排'
}, {
confId: '2',
confName: '正常预约'
}]
const timeList = [
{
confId: '1',
confName: '加急安排'
},
{
confId: '2',
confName: '正常预约'
}
]
var formData = [{
label: '性别(单选)',
name: 'customerSex',
optionList: sexList,
optionId: 'confId',
optionLabel: 'confName',
optionsName: 'sexList'
}, {
label: '买车情况(单选)',
name: 'buyingCarDetails',
optionList: buyCarList,
var formData = [
{
label: '性别(单选)',
name: 'customerSex',
optionList: sexList,
optionId: 'confId',
optionLabel: 'confName',
optionsName: 'buyCarList'
}, {
label: '消费力(单选)',
name: 'purchasingPower',
optionList: purchaseList,
optionsName: 'sexList'
},
{
label: '年龄段',
name: 'age',
optionList: age,
optionId: 'confId',
optionLabel: 'confName',
optionsName: 'purchaseList'
}, {
label: '决策力(可多选)',
name: 'decisionMakingAbility',
isMult: true,
optionList: decisionList,
optionsName: 'age'
},
{
label: '家庭情况',
name: 'maritalStatus',
optionList: maritalStatus,
optionId: 'confId',
optionLabel: 'confName',
optionsName: 'decisionList'
}, {
label: '是否有做推膜铺垫',
name: 'introductionToPromoting',
optionList: promoteList,
optionsName: 'maritalStatus'
},
{
label: '附赠产品(每类产品只支持选一个选项)',
name: 'giftProductList',
isMult: true,
optionList: giftProduct,
optionId: 'confId',
optionLabel: 'confName',
optionsName: 'promoteList'
}, {
label: '客户在购车上牌环节中是否顺利愉快满意',
name: 'detailsOfSatisfaction',
optionList: satisfiedList,
optionsName: 'sexList'
},
{
label: '买车情况(单选)',
name: 'buyingCarDetails',
optionList: buyCarList,
optionId: 'confId',
optionLabel: 'confName',
optionsName: 'satisfiedList'
}, {
label: '贴膜时间优先级',
name: 'filmCoatingUseTime',
optionList: timeList,
optionsName: 'buyCarList'
},
{
label: '消费力(单选)',
name: 'purchasingPower',
optionList: purchaseList,
optionId: 'confId',
optionLabel: 'confName',
optionsName: 'timeList'
}, {
label: '自定义信息',
name: 'additionalInformation',
type: 'textarea',
maxlength: '100',
placeholder: '输入职业画像、喜好禁忌、推膜建议等客户信息,不超过100字'
}]
optionsName: 'purchaseList'
}
// ,{
// label: '决策力(可多选)',
// name: 'decisionMakingAbility',
// isMult: true,
// optionList: decisionList,
// optionId: 'confId',
// optionLabel: 'confName',
// optionsName: 'decisionList'
// }, {
// label: '是否有做推膜铺垫',
// name: 'introductionToPromoting',
// optionList: promoteList,
// optionId: 'confId',
// optionLabel: 'confName',
// optionsName: 'promoteList'
// }, {
// label: '客户在购车上牌环节中是否顺利愉快满意',
// name: 'detailsOfSatisfaction',
// optionList: satisfiedList,
// optionId: 'confId',
// optionLabel: 'confName',
// optionsName: 'satisfiedList'
// }, {
// label: '贴膜时间优先级',
// name: 'filmCoatingUseTime',
// optionList: timeList,
// optionId: 'confId',
// optionLabel: 'confName',
// optionsName: 'timeList'
// }, {
// label: '自定义信息',
// name: 'additionalInformation',
// type: 'textarea',
// maxlength: '100',
// placeholder: '输入职业画像、喜好禁忌、推膜建议等客户信息,不超过100字'
// }
]
export default {
sexList,
age,
maritalStatus,
giftProduct,
buyCarList,
purchaseList,
decisionList,
......@@ -134,4 +254,4 @@ export default {
satisfiedList,
timeList,
formData
}
\ No newline at end of file
}
......@@ -2,7 +2,6 @@
import CONSTANTDATA from './constant/data'
import api from '../../api'
Page({
/**
* 页面的初始数据
*/
......@@ -11,7 +10,8 @@ Page({
formData: CONSTANTDATA.formData,
detailForm: {
additionalInformation: ''
}
},
customerSex:1
},
click(e) {
let { pidx, idx } = e.currentTarget.dataset
......@@ -23,8 +23,17 @@ Page({
[`formData[${pidx}].optionList`]: JSON.parse(JSON.stringify(CONSTANTDATA[_item.optionsName]))
})
}
// 赙赠产品 每类只能二选一
if (_item.name == 'giftProductList' ) {
const noActiveIdx = idx % 2 == 0? idx+1:idx-1
this.setData({
[`formData[${pidx}].optionList[${noActiveIdx}].active`]:false
})
}
this.setData({
[`formData[${pidx}].optionList[${idx}].active`]: (_item.name == 'customerSex' || _item.isMult) ? !this.data.formData[pidx].optionList[idx].active : !_active
[`formData[${pidx}].optionList[${idx}].active`]: _item.name == 'customerSex' || _item.isMult ? !this.data.formData[pidx].optionList[idx].active : !_active
})
},
......@@ -36,27 +45,29 @@ Page({
})
},
recoverPortrait(info) {
async recoverPortrait(id) {
let {code,data:info} = await api.portraitQuery({id})
console.log(info);
if (code!= 0 ) return
let { formData } = this.data
formData.forEach(item => {
if (info[item.name]) {
if (item.type == 'textarea') {
this.setData({
['detailForm.' + item.name]: info[item.name]
})
} else {
if (item.isMult) {
let _list = info[item.name].split(',')
console.log(item.name,info[item.name],'info[item.name]');
// let _list = info[item.name].split(',')
let _list = info[item.name]
_list.forEach(n => {
item.optionList.find(k => k.confId == n).active = true
})
} else {
item.optionList.find(k => k.confId == info[item.name]).active = true
}
}
// }
} else {
if (item.name == 'customerSex') {
item.optionList.find(k => k.confId == '1').active = true
let {customerSex} = this.data
item.optionList.find(k => k.confId == customerSex).active = true
}
}
})
......@@ -65,19 +76,34 @@ Page({
})
},
reset() { },
reset() {
let {formData} = this.data
formData.forEach(item => {
// console.log(item?.optionList,'item?.optionList');
// if(item.isMult) params[item.name] = []
if (item.name!='customerSex') {
item?.optionList?.forEach(subItem => {
subItem.active = false
})
}
})
console.log(formData,'formData');
this.setData({
formData
})
},
dealParam() {
let { formData } = this.data
let params = {}
formData.forEach(item => {
// console.log(item?.optionList,'item?.optionList');
if(item.isMult) params[item.name] = []
item?.optionList?.forEach(subItem => {
if (subItem.active) {
if (item.isMult) {
params[item.name] = params[item.name] ? params[item.name] + ',' + subItem.confId : subItem.confId
} else {
params[item.name] = subItem.confId
}
item.isMult? params[item.name].push(subItem.confId):( params[item.name] = subItem.confId)
}
})
})
......@@ -85,14 +111,15 @@ Page({
},
confirm() {
let { detail, detailForm } = this.data
let { customerId } = this.data
let params = {
...this.dealParam(),
...detailForm,
id: detail.customerId
customerId
}
wx.$util.showLoading()
api.updateProfile(params).then(res => {
let { code, data, message } = res
wx.hideLoading()
if (code == '0') {
wx.$util.showToast('编辑成功')
wx.$refresh = true
......@@ -107,65 +134,66 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad(options) {
wx.$router.getData(res => {
res = {
...res.customerCoupon,
...res.customer,
...res
}
this.setData({
detail: res
// wx.$router.getData(res => {
// res = {
// ...res.customerCoupon,
// ...res.customer,
// ...res
// }
// this.setData({
// detail: res
// })
// console.log(res, 'res')
// this.recoverPortrait(this.data.detail)
// })
},
onRoute(options) {
console.log(options);
const {customerId,customer} = options
// let detail = {
// ...options.customerCoupon,
// ...options.customer,
// ...options
// }
this.setData({
customerId,
customerSex:customer?.customerSex||1
})
this.recoverPortrait(this.data.detail)
})
console.log(customerId, 'customerId')
this.recoverPortrait(customerId)
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
onReady() {},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
onShow() {},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
onHide() {},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
onUnload() {},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
onPullDownRefresh() {},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
onReachBottom() {},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})
\ No newline at end of file
onShareAppMessage() {}
})
......@@ -12,9 +12,14 @@
.user-portrait .check-block {
display: flex;
flex-wrap: wrap;
margin: 24rpx 0 62rpx;
}
.check-box:nth-child(n+4) {
margin-top: 10rpx;
}
.user-portrait .check-box {
position: relative;
box-sizing: border-box;
......
......@@ -2,12 +2,8 @@
import mixins from './index_mixins'
import api from '../../api.js'
import NP from 'number-precision'
import {
env
} from '~/config'
import {
getYQInfo
} from '~/store/index'
import { env } from '~/config'
import { getYQInfo } from '~/store/index'
const app = getApp()
let time = null
Page({
......@@ -49,9 +45,7 @@ Page({
},
navigator(e) {
console.log(e)
let {
outTradeNo
} = e.detail
let { outTradeNo } = e.detail
this.closeSwitchPopup()
outTradeNo &&
wx.$router.go('tabWorkOrder.additionRecordOrder', {
......@@ -59,12 +53,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)
......@@ -88,16 +78,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) {
......@@ -143,12 +125,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 = {}
......@@ -156,11 +134,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) {
let userInfo = wx.$util.getUserInfo()
userInfo.subLoginUser = data.subLoginUser
......@@ -173,21 +147,14 @@ 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) {
if (item.type == 'scanCode') {
wx.scanCode({
success(res) {
let {
result
} = res
let { result } = res
console.log(result)
wx.$router.go('tabWorkOrder.createOrder', {
scene: result
......@@ -208,9 +175,7 @@ Page({
},
changeDate(e) {
// console.log(e)
let {
name
} = e.currentTarget.dataset
let { name } = e.currentTarget.dataset
let data = new Date(),
value = name == 'today' ? 0 : 1,
startDate,
......@@ -229,9 +194,7 @@ Page({
// endDate = today.format('yyyy-MM-dd')
}
let {
tableBtn
} = this.data
let { tableBtn } = this.data
this.setData({
startDate,
endDate
......@@ -247,14 +210,9 @@ Page({
})
},
monthSelect(e) {
let {
date
} = e.detail
let { date } = e.detail
// let {date} = this.data
let {
label,
date: selectDate
} = date
let { label, date: selectDate } = date
// let [year, month] = selectDate.split('-')
// const endDate = new Date(year, month, 0).format('yyyy-MM-dd')
this.setData({
......@@ -265,25 +223,20 @@ Page({
// ['dateObj.endDateStr']: endDate
})
let {
subIndex,
// subIndex,
merchantRange
} = this.data
this.getOutputValue({
subIndex,
// subIndex,
merchantRange
})
// console.log(date)
},
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,
......@@ -305,14 +258,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 {
......@@ -325,14 +273,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]
......@@ -358,30 +300,25 @@ 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() {
......@@ -403,15 +340,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
......@@ -422,11 +351,7 @@ Page({
})
.then(res => {
console.log(res)
let {
code,
message,
data
} = res
let { code, message, data } = res
let table = []
if (code == 0) {
table = data?.page?.list || []
......@@ -447,7 +372,7 @@ Page({
})
// 处理列表宽度问题
tableWidth = 118 * 5 + 232 + 30 + sumWidth
console.log(table, 'table');
console.log(table, 'table')
this.setData({
tableFlag: true,
table,
......@@ -471,15 +396,10 @@ Page({
}
},
getOutputValue(yqdInfo) {
let {
dateObj,
userInfo
} = this.data
let {
subIndex,
merchantRange
} = yqdInfo
// let { userInfo } = this.data
let { dateObj, userInfo } = this.data
console.log(yqdInfo, 'yqdInfo')
let { subIndex, merchantRange } = yqdInfo
// yqMerchantId 不是全部就必要要带过去
// 1-超管 2-商户管理员 3-区域督导 4-驻店人员
const yqMerchantId = merchantRange[subIndex].merchantId || ''
const loginRole = userInfo.subLoginUser.loginRole
......@@ -499,10 +419,7 @@ Page({
.goodsOrderOutputValueBelong(params)
.then(result => {
console.log(result, 'result')
let {
code,
data
} = result
let { code, data } = result
if (code == 0) {
let rateValue = NP.divide(data?.totalOutputValue || 0, data?.totalTargetOutputValue || 0)
rateValue = NP.times(rateValue, 100)
......@@ -545,10 +462,7 @@ Page({
.userStat({})
.then(result => {
// console.log(result, 'result')
let {
code,
data
} = result
let { code, data } = result
if (code == 0) {
this.setData({
userStat: data
......@@ -558,12 +472,11 @@ Page({
.catch(err => {})
},
totalListSet() {
let {
userInfo
} = this.data
let { userInfo } = this.data
if (userInfo.loginRole == 3 || userInfo.isSuper) {
this.setData({
totalList: [{
totalList: [
{
name: '转化订单',
itemName: 'totalUpgrade',
index: 4
......@@ -685,28 +598,27 @@ Page({
break
}
// 判断是不是特殊账号
let {
menu,
userInfo
} = this.data
const isNoStaff = userInfo.loginRole!=4 && userInfo.loginRole!= null
let { menu, userInfo } = this.data
const isNoStaff = userInfo.loginRole != 4 && userInfo.loginRole != null
// 不是员工类型
if (isNoStaff) {
menu = [
{
name: '预约管理',
url: 'tabDate.index'
url: 'tabDate.index',
recordId: 8
},
{
name: '经营数据',
url: 'tabOperating.index'
},
url: 'tabOperating.index',
recordId: 11
}
]
}
if (checklist.includes(userInfo?.accountName)) {
menu = menu.filter(e => e.name != '预约管理')
}
this.setData({
menu,
isNoStaff
......@@ -772,9 +684,11 @@ Page({
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {},
// onTabItemTap(item) {
// console.log(item, 'item')
// },
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {}
})
\ No newline at end of file
})
......@@ -5,25 +5,30 @@ export default {
menu: [
{
name: '新建工单',
url: 'tabWorkOrder.createOrder'
url: 'tabWorkOrder.createOrder',
recordId: 6
},
{
name: '扫码下单',
url: 'tabWorkOrder.createOrder',
type: 'scanCode'
type: 'scanCode',
recordId: 7
},
{
name: '预约管理',
url: 'tabDate.index'
url: 'tabDate.index',
recordId: 9
},
{
name: '经营数据',
url: 'tabOperating.index'
url: 'tabOperating.index',
recordId: 11
},
{
name: '客户建档',
// name: '战败下单',
url: 'tabWorkOrder.createArchives'
url: 'tabWorkOrder.createArchives',
recordId: 8
}
],
totalTableSum: [
......
......@@ -16,17 +16,20 @@ Page({
{
name: '营业概况',
active: true,
componentsName: 'businessCell'
componentsName: 'businessCell',
recordId:12
},
{
name: '员工业绩',
active: false,
componentsName: 'staffCell'
componentsName: 'staffCell',
recordId:13
},
{
name: '今日战果',
active: false,
componentsName: 'conquestCell'
componentsName: 'conquestCell',
recordId:14
}
],
dateObj: {
......@@ -189,10 +192,12 @@ Page({
} else {
this.setTimeList(dateObj.nextDay)
}
wx.$util.pointRecord(type == 'before'?16:17)
this.calendar.resetData(type == 'before' ? dateObj.beforeDay : dateObj.nextDay)
},
// 获取选中天数
rangeSelect(e) {
wx.$util.pointRecord(15)
console.log(e.detail)
let { date } = e.detail
this.setTimeList(date)
......@@ -223,6 +228,7 @@ Page({
tabList,
activeTab
})
wx.$util.pointRecord(tabList[index].recordId)
},
closePop() {
this.components = this.selectComponent('#businessCell')
......
......@@ -3,11 +3,13 @@ export default {
menu: [
{
name: '累计营收',
url: 'tabOperating.operatingShow'
url: 'tabOperating.operatingShow',
recordId:18
},
{
name: '门店概况',
url: 'tabOperating.4sOverview'
url: 'tabOperating.4sOverview',
recordId:29
},
{
name: '商品排行',
......@@ -55,6 +57,7 @@ export default {
} else {
console.log(item.url)
wx.$router.go(item.url)
item.recordId&&wx.$util.pointRecord(item.recordId)
}
// 暂未上线,敬请期待
},
......
......@@ -219,7 +219,7 @@ Page({
// this.getDetail(options.orderCode)
// }
if (time) clearInterval(time)
this.checkPhoneShow(app.globalData.YQorderSetting.yqPhoneConfig)
this.checkPhoneShow(app.globalData.YQorderSetting?.yqPhoneConfig)
// wx.$util.setWebSocket()
setWebSocket()
},
......@@ -283,7 +283,7 @@ Page({
// 校验是否显示二级流量方
if (data.subShopMerchantName) {
let { customerObj } = this.data
if(customerObj.findIndex(val => val.key == 'subShopMerchantName') < 0) {
if(customerObj.findIndex(val =>val?.key && val.key == 'subShopMerchantName') < 0) {
customerObj[customerObj.length - 2] = {
label: '二级流量方:',
key: 'subShopMerchantName'
......@@ -317,7 +317,7 @@ Page({
isArtificer(data) {
let { customerObj, orderInfo } = this.data
orderInfo.isOpenArtificer = true
if(customerObj.findIndex(val => val.key == 'technicianName') < 0) {
if(customerObj.findIndex(val =>val?.key && val.key == 'technicianName') < 0) {
customerObj[customerObj.length] = {
label: '选择技师:',
key: 'technicianName',
......
......@@ -92,7 +92,8 @@
<!-- setDateSelect -->
<block wx:if="{{item.copy}}">
<view class="copy" bindtap="setCopyData" data-content="{{orderInfo[item.key]}}">
复制
<!-- 复制 -->
<image src="../../images/copyIcon.png" class="copyImage" binderror="" bindload=""></image>
</view>
</block>
<!-- 超管不能进入创建工单页面 -->
......@@ -134,7 +135,8 @@
</block>
<block wx:if="{{item.copy}}">
<view class="copy" catchtap="setCopyData" data-content="{{orderInfo[item.key]}}">
复制
<!-- 复制 -->
<image src="../../images/copyIcon.png" class="copyImage" binderror="" bindload=""></image>
</view>
</block>
<block wx:if="{{item.type == 'select'}}">
......
......@@ -26,6 +26,9 @@ Page({
showRatingPopup: !this.data.showRatingPopup
})
},
jumpUserPortrait (){
wx.$router.go('tabDate.userPortrait', this.data.orderInfo)
},
// 跳转正确订单
redirectOrder() {
let { orderInfo } = this.data
......@@ -133,7 +136,7 @@ Page({
this.getOrderDetail(options.orderCode)
}
let o = wx.$util.getStorageSync('dj_boutique_user_info')
this.checkPhoneShow(app.globalData.YQorderSetting.yqPhoneConfig)
this.checkPhoneShow(app.globalData.YQorderSetting?.yqPhoneConfig)
this.setData({
userInfo: o,
isYqdSuper: app.globalData.isYqdSuper,
......@@ -217,7 +220,7 @@ Page({
// 校验是否显示二级流量方
if (data.subShopMerchantName) {
let { customerObj } = this.data
if (customerObj.findIndex(val => val.key == 'subShopMerchantName') < 0) {
if (customerObj.findIndex(val =>val?.key && val.key == 'subShopMerchantName') < 0) {
customerObj[customerObj.length - 2] = {
label: '二级流量方:',
key: 'subShopMerchantName'
......@@ -251,7 +254,7 @@ Page({
isArtificer(data) {
let { customerObj, orderInfo } = this.data
orderInfo.isOpenArtificer = true
if (customerObj.findIndex(val => val.key == 'technicianName') < 0) {
if (customerObj.findIndex(val => val?.key && val.key == 'technicianName') < 0) {
customerObj[customerObj.length] = {
label: '选择技师:',
key: 'technicianName'
......
......@@ -91,7 +91,8 @@
</block>
<block wx:if="{{item.copy}}">
<view class="copy" bindtap="setCopyData" data-content="{{orderInfo[item.key]}}">
复制
<!-- 复制 -->
<image src="../../images/copyIcon.png" class="copyImage" binderror="" bindload=""></image>
</view>
</block>
</view>
......@@ -111,9 +112,10 @@
</view>
</view>
<view class="box customer">
<view class="title">
<text>客户信息</text>
<text wx:if="{{isYqdSuper||isStaff}}" bindtap="jumpUpdate" class="updateInfo">修改客户信息</text>
<view class="title userTitle">
<view>客户信息</view>
<view bindtap="jumpUserPortrait" class="updateInfo icon"><image src="../../images/userImageIcon.png" class="iconImage" ></image>画像</view>
<view wx:if="{{isYqdSuper||isStaff}}" bindtap="jumpUpdate" class="updateInfo "><image src="../../images/editIcon.png" class="iconImage" ></image>客户信息</view>
</view>
<block wx:for="{{customerObj}}" wx:key="index">
<view class="cell">
......@@ -142,7 +144,8 @@
</block>
<block wx:if="{{item.copy}}">
<view class="copy" catchtap="setCopyData" data-content="{{orderInfo[item.key]}}">
复制
<!-- 复制 -->
<image src="../../images/copyIcon.png" class="copyImage" binderror="" bindload=""></image>
</view>
</block>
</view>
......
......@@ -242,7 +242,21 @@ page {
font-weight: 700;
margin-left: auto;
}
.copyImage, .iconImage {
width: 36rpx;
height: 36rpx;
/* vertical-align: bottom; */
vertical-align: middle;
}
.iconImage{
margin-right: 5rpx;
}
.customer .userTitle {
justify-content:start;
}
.userTitle .icon {
margin-right: auto;
}
.box .cell .copy {
color: #3582EE;
margin-left: auto;
......@@ -509,6 +523,7 @@ page {
}
.customer .title {
box-sizing: border-box;
display: flex;
align-items: center;
justify-content: space-between;
......@@ -517,6 +532,8 @@ page {
.customer .updateInfo {
color: #3582EE;
font-size: 28rpx;
margin-left: 16rpx;
margin-top: 3rpx;
}
......
......@@ -321,6 +321,7 @@ Page({
// 预录建档跳转到预约列表
wx.$refresh = true
wx.$router.redirectTo('tabDate.index')
wx.$util.pointRecord(30)
} else {
wx.$router.back(page => {
page.search && page.search()
......@@ -494,7 +495,7 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
// console.log(app.globalData.YQorderSetting, 'app.globalData.YQorderSetting.yqPhoneConfig')
// console.log(app.globalData.YQorderSetting, 'app.globalData.YQorderSetting?.yqPhoneConfig')
console.log(options)
if (options.scene) {
this.setData(options)
......
......@@ -368,6 +368,7 @@ Page({
wx.setNavigationBarTitle({
title: data.type == 'standNo' ? '车架号识别' : '车牌识别'
})
wx.$util.pointRecord(data.type == 'standNo'?20:21)
}
// // 在组件实例进入页面节点树时执行
var that = this
......
/* tabWorkOrder/pages/ocr/ocr.wxss */
\ No newline at end of file
......@@ -11,13 +11,16 @@ Page({
showTips: true,
isYqdSuper: app.globalData.isYqdSuper,
isStaff: app.globalData.isStaff,
isShowPhone: app.globalData.YQorderSetting.yqPhoneConfig,
isShowPhone: app.globalData.YQorderSetting?.yqPhoneConfig,
customerService: '',
defaultCustomerService: 'https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/kf.png',
failCustomerService: '../images/kfrefresh.png',
warrantyCardVisible: true,
signatureSwitch: false //不需要走签名逻辑 没有开启签名功能或则是战败订单
},
jumpUserPortrait (){
wx.$router.go('tabDate.userPortrait', this.data.orderInfo)
},
navOrderSignature() {
let { orderInfo } = this.data
wx.$router.redirectTo('orderSignature', orderInfo)
......@@ -104,7 +107,7 @@ Page({
let o = wx.$util.getStorageSync('dj_boutique_user_info')
this.checkPhoneShow(app.globalData.YQorderSetting.yqPhoneConfig)
this.checkPhoneShow(app.globalData.YQorderSetting?.yqPhoneConfig)
this.setData({
isYqdSuper: app.globalData.isYqdSuper,
......@@ -184,7 +187,7 @@ Page({
// 校验是否显示二级流量方
if (data.subShopMerchantName) {
let { customerObj } = this.data
if (customerObj.findIndex(val => val.key == 'subShopMerchantName') < 0) {
if (customerObj.findIndex(val => val?.key &&val.key == 'subShopMerchantName') < 0) {
customerObj[customerObj.length - 2] = {
label: '二级流量方:',
key: 'subShopMerchantName'
......@@ -218,7 +221,7 @@ Page({
isArtificer(data) {
let { customerObj, orderInfo } = this.data
orderInfo.isOpenArtificer = true
if (customerObj.findIndex(val => val.key == 'technicianName') < 0) {
if (customerObj.findIndex(val =>val?.key && val.key == 'technicianName') < 0) {
customerObj[customerObj.length] = {
label: '选择技师:',
key: 'technicianName'
......
......@@ -73,7 +73,8 @@
</block>
<block wx:if="{{item.copy}}">
<view class="copy" bindtap="setCopyData" data-content="{{orderInfo[item.key]}}">
复制
<!-- 复制 -->
<image src="../../images/copyIcon.png" class="copyImage" binderror="" bindload=""></image>
</view>
</block>
</view>
......@@ -93,9 +94,10 @@
</view>
</view>
<view class="box customer">
<view class="title">
<view class="title userTitle">
<text>客户信息</text>
<text wx:if="{{isYqdSuper||isStaff}}" bindtap="jumpUpdate" class="updateInfo">修改客户信息</text>
<view bindtap="jumpUserPortrait" class="updateInfo icon"><image src="../../images/userImageIcon.png" class="iconImage" ></image>画像</view>
<view wx:if="{{isYqdSuper||isStaff}}" bindtap="jumpUpdate" class="updateInfo "><image src="../../images/editIcon.png" class="iconImage" ></image>客户信息</view>
</view>
<block wx:for="{{customerObj}}" wx:key="index">
<view class="cell">
......@@ -124,7 +126,8 @@
</block>
<block wx:if="{{item.copy}}">
<view class="copy" catchtap="setCopyData" data-content="{{orderInfo[item.key]}}">
复制
<!-- 复制 -->
<image src="../../images/copyIcon.png" class="copyImage" binderror="" bindload=""></image>
</view>
</block>
</view>
......
......@@ -2,7 +2,20 @@
page {
background-color: rgb(246, 247, 247);
}
.copyImage, .iconImage {
width: 36rpx;
height: 36rpx;
vertical-align: bottom;
}
.iconImage{
margin-right: 5rpx;
}
.customer .userTitle {
justify-content:start;
}
.userTitle .icon {
margin-right: auto;
}
.main {
padding-bottom: 160rpx;
}
......@@ -457,6 +470,7 @@ page {
.customer .updateInfo {
color: #3582EE;
font-size: 28rpx;
margin-left: 16rpx;
}
......
......@@ -14,7 +14,7 @@ Page({
showTips: true,
isYqdSuper: app.globalData.isYqdSuper,
isStaff: app.globalData.isStaff,
isShowPhone: app.globalData.YQorderSetting.yqPhoneConfig,
isShowPhone: app.globalData.YQorderSetting?.yqPhoneConfig,
ctx: '',
hasDraw: false,
canvasWidth: 0,
......@@ -557,7 +557,7 @@ Page({
}
let o = wx.$util.getStorageSync('dj_boutique_user_info')
this.checkPhoneShow(app.globalData.YQorderSetting.yqPhoneConfig)
this.checkPhoneShow(app.globalData.YQorderSetting?.yqPhoneConfig)
this.setData({
isYqdSuper: app.globalData.isYqdSuper,
......
......@@ -286,6 +286,7 @@ Page({
*/
onShow: function () {},
onRoute(res) {
wx.$util.pointRecord(28)
// 避免数据污染到上一页
let obj = JSON.parse(JSON.stringify(res))
this.setOrderObj(obj)
......
// tabWorkOrder/tpages/ocr/ocr.js
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})
\ No newline at end of file
/* tabWorkOrder/tpages/ocr/ocr.wxss */
\ No newline at end of file
<!--tabWorkOrder/tpages/ocr/ocr.wxml-->
<text>tabWorkOrder/tpages/ocr/ocr.wxml</text>
......@@ -9,6 +9,12 @@ export function getSessionId() {
export function setSessionId(sessionId) {
$Storage.set('sessionId', sessionId)
}
export function getNoSignInUuid() {
return $Storage.get('noSignInUuid')
}
export function setNoSignInUuid(noSignInUuid) {
$Storage.set('noSignInUuid', noSignInUuid)
}
export function getUserInfo() {
return $Storage.get('userInfo')
}
......@@ -17,9 +23,7 @@ export function setUserInfo(data) {
$Storage.set('userInfo', data)
}
export function removeSystemStorage() {
// $Storage.rm('srcm_shopmall_user_info')
// $Storage.rm('scrm_shopmall_sessionId')
// $Storage.rm('guest_no')
$Storage.rm('noSignInUuid')
}
export function setStorageSync(key, data) {
$Storage.set(key, JSON.stringify(data))
......
......@@ -17,7 +17,8 @@ export const STORAGE_OBJECTkEY = {
authphone: 'authphone',
disLikeRecordFlag: 'disLikeRecordFlag',
fileList: 'fileList',
posterId: 'posterId'
posterId: 'posterId',
noSignInUuid: 'noSignInUuid'
}
// export const IMG_VERSION = () => {
......
......@@ -51,8 +51,9 @@ const domain_items = {
// dj: 'http://192.168.1.165:8292',
// dj: 'http://192.168.1.170:8292', //叶立庆
// dj: 'http://192.168.1.169:8292',//蔡远明
dj: 'http://192.168.1.174:8292',//范富荣
// dj: 'http://192.168.1.129:8292',//周杭
// dj: 'http://192.168.1.174:8292',//范富荣
dj: 'http://192.168.1.203:8292',//周杭
// dj: 'http://192.168.1.53:8292',//陈希
// dj:'http://192.168.2.59:8292/',//周立明
// scrm: 'http://192.168.1.165:8292'
scrm: 'https://scrm.dev.glsx.com.cn'
......
// import api from '../api/api'
import api from '~/api/api'
import wxApi from '~/utils/utils_wx'
import format from '~/utils/utils_format'
import $router from '../router/index'
......@@ -88,12 +88,15 @@ const getUserInfo = () => {
let user = wx.getStorageSync('dj_boutique_user_info') || null
return JSON.parse(user)
}
const removeSellerInfo = () => {
wx.removeStorageSync('dj_boutique_seller_info')
}
const setUserInfo = userInfo => {
// console.log(userInfo)
// userInfo.loginrole
const loginRole = userInfo.loginRole
if (loginRole&&loginRole==3) {
userInfo.userType = 1
if (loginRole && loginRole == 3) {
userInfo.userType = 1
}
wx.setStorageSync('dj_boutique_user_info', JSON.stringify(userInfo))
}
......@@ -105,15 +108,16 @@ const setSessionId = sessionId => {
wx.setStorageSync('dj_boutique_sessionId', sessionId)
}
const removeStorage = () => {
wx.removeStorageSync('noSignInUuid')
wx.removeStorageSync('dj_boutique_user_info')
wx.removeStorageSync('dj_boutique_sessionId')
wx.removeStorageSync('dj_boutique_sessionId')
}
const showNoAccess = () => {
// wx.showToast('您的账号无法完成此操作')
wx.showToast({
title:'您的账号无法完成此操作',
icon:'error'
title: '您的账号无法完成此操作',
icon: 'error'
})
}
const setStorageSync = (key, data) => {
......@@ -123,7 +127,6 @@ const getStorageSync = key => {
let data = wx.getStorageSync(key) || null
return JSON.parse(data)
}
const getSceneId = path => {
let [_route_, _options_] = path.split('?')
let [target] = _route_.split('/')
......@@ -209,6 +212,20 @@ const checkRule = function (obj, formRule) {
}
return false
}
// 埋点
const pointRecord = clickEventType => {
let userInfo = getUserInfo()
// let sessionId = getSessionId()
let params = {
userId: userInfo.uuid,
clickEventType
}
console.log('burialPointRecord', params)
api.burialPointRecord(params).then(res => {
console.log('burialPointRecord', res)
})
}
const util = {
onReachBottom,
haveEmoji,
......@@ -219,6 +236,7 @@ const util = {
setUserInfo,
getSessionId,
setSessionId,
removeSellerInfo,
removeStorage,
showNoAccess,
setStorageSync,
......@@ -227,7 +245,8 @@ const util = {
type,
deepClone,
getTimeState,
checkRule
checkRule,
pointRecord
}
const Util = Object.assign(util, wxApi, format)
// console.log('Util', Util)
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!