Commit 234cd47a by 前端

Merge branch 'develop' into 'master'

Develop

See merge request !57
2 parents 7c47db8a cef440e7
......@@ -134,7 +134,7 @@ module.exports = {
},
// 获取订单信息
getWorkList(data) {
params = data || {}
let params = data || {}
params.sceneType = 1
return api.post('dj.api.smartcarlife.order.search', params)
},
......@@ -146,5 +146,10 @@ module.exports = {
// 获取园区店下的4s店
getSceneMerchantRefStoreList(data) {
return api.post('dj.api.scenemerchantref.query4SRefByYqShop', data)
},
// 获取园区店配置
getYqStoreConfig(data) {
return api.get('dj.api.smarcarlife.yqMerchantConfig.detail', data)
}
}
......@@ -24,7 +24,7 @@ class Calendar {
// console.log(calenderHeight)
let height = '80%'
if (typeof calenderHeight === 'number') {
wx.$util.getPhoneInfo(res => {
wx.$util.getSystemInfo(res => {
let { windowHeight } = res
if (calenderHeight > windowHeight) calenderHeight = windowHeight
if (calenderHeight < windowHeight * 0.5) calenderHeight = windowHeight * 0.5
......
......@@ -23,7 +23,7 @@ class Calendar {
let { data: calenderHeight } = _this
let height = '80%'
if (typeof calenderHeight === 'number') {
wx.$util.getPhoneInfo(res => {
wx.$util.getSystemInfo(res => {
let { windowHeight } = res
if (calenderHeight > windowHeight) calenderHeight = windowHeight
if (calenderHeight < windowHeight * 0.5) calenderHeight = windowHeight * 0.5
......
......@@ -539,7 +539,7 @@ Component({
}
},
attached() {
wx.$util.getPhoneInfo(info => {
wx.$util.getSystemInfo(info => {
let { windowWidth } = info
this.setData({
x: windowWidth,
......
......@@ -147,7 +147,7 @@ Component({
let upgradeGoodsList = []
i.upgradeGoodsList.map(c => {
// console.log(c);
let name = c.upgradeGoodsName ||c.goodsInfo.goodsName
let name = c.upgradeGoodsAlias || c.upgradeGoodsName || c.goodsInfo.goodsName
if (name.indexOf(value) != -1) {
upgradeGoodsList.push(c)
}
......
......@@ -24,7 +24,7 @@
data-ind="{{ind}}"
data-item="{{i}}">
<view class="name text-hide {{i.active?'textWidth':''}}">
{{filter.replaceItemText(i.upgradeGoodsName) || filter.replaceItemText(i.goodsInfo.goodsName)}}
{{filter.replaceItemText(i.upgradeGoodsAlias) ||filter.replaceItemText(i.upgradeGoodsName) || filter.replaceItemText(i.goodsInfo.goodsName)}}
</view>
<view class="last" wx:if="{{!i.active}}">
<!-- | -->
......
......@@ -13,7 +13,8 @@ Component({
type: Object,
observer: function (n) {
// console.log('userInfo', n)
if (n && this.data.type != 1) this.getMerchantList()
// 先请求导流方接口
if (n && this.data.type == 2) this.getMerchantList()
}
},
......@@ -28,16 +29,16 @@ Component({
// 处理先要调用销售顾问接口再调用转化人员接口的问题
observers: {
'orderObj.sellerUserId': function (id) {
// console.log(id)
// console.log('orderObj.sellerUserId', this.data.orderObj)
let { type, selesFirstRender } = this.data
// console.log(type == 1 && selesFirstRender)
// selesFirstRender
if (type == 1 && id) {
// sellerUserId 解决接口数据重复请求问题
let { type, sellerUserId } = this.data
if (type == 1 && id && id != sellerUserId) {
// console.log(id)
// console.log('orderObj.sellerUserId')
this.getMerchantList()
// this.setData({
// selesFirstRender: false
// })
this.setData({
sellerUserId: id
})
}
}
},
......@@ -50,7 +51,7 @@ Component({
selesList: [],
orderObj: {},
isFirst: true,
selesFirstRender: true,
sellerUserId: '',
orderSellerInfo: ''
},
......
......@@ -61,7 +61,7 @@ Component({
const path = `${baseUrl}${url}.html`
// private user
wx.navigateTo({
url: `/pages/webView/webView?path=${encodeURIComponent(path)}`
url: `/pages/webView/webView?url=${encodeURIComponent(path)}`
})
// var globalData = appInstance.globalData.extConfig
......
......@@ -10,7 +10,7 @@
* 2测试
* 3生产环境
*/
let index = 2
let index = 1
const accountInfo = wx.getAccountInfoSync()
const systemInfo = wx.getSystemInfoSync()
......
......@@ -136,6 +136,91 @@ Page({
loginUserInfoList
})
},
sceneHandle() {
const SCENE = wx.$SCENE
let { path, query } = SCENE
console.log(path, 'path')
let { target, name } = wx.$util.getSceneId(path)
// console.log(query)
// console.log(target,name);
wx.$router.reLaunch(`${target}.${name}`, query)
wx.$SCENE = null
// console.log(SCENE, 'SCENE')
// debugger 兼容扫码优惠券进来和免登录逻辑冲突问题
// if (SCENE && SCENE.path != 'pages/accountItems/accountItems') {
},
// 检测一下是否能微信端小程序登录
checkAgree() {
return new Promise((resolve, reject) => {
let sysInfo = wx.getSystemInfoSync()
// let { environment } = sysInfo
// 1企业微信 0微信
let envName = sysInfo.environment ? 1 : 0
let { merchantId: yqMerchantId } = wx.$util.getUserInfo()
api.getYqStoreConfig({ yqMerchantId }).then(res => {
let {
code,
data: { loginControlList = [] }
} = res
if (code == '0') {
// const loginControlList = []
// const loginControlList = [0, 1]
if (loginControlList.includes(envName)) {
resolve(true)
} else {
wx.hideLoading()
wx.showModal({
title: '温馨提示',
content: `请在${envName == 0 ? '企业微信' : '微信'}中打开`,
showCancel: false,
confirmText: '知道了',
confirmColor: '#3582EE'
})
resolve(false)
}
}
})
})
},
async getYqMerchantSceneConfig({ yqMerchantId, isSuper }) {
let checkAgree = await this.checkAgree()
if (!checkAgree) return false
// 超管默认开通所有场景
if (isSuper) {
// 0 会员权益/升级 1 精品升级
let openSceneArr = constantData.sceneList.map(val => {
return val?.sceneType
})
wx.$util.setUserInfo({ ...wx.$util.getUserInfo(), openSceneArr })
wx.$router.reLaunch('pages.sceneIndex')
return
}
// 获取开通的业务场景
api.getYqMerchantSceneConfigAPI({ yqMerchantId: yqMerchantId }).then(res => {
let { data, message, code } = res
if (code == 0) {
let openSceneArr = []
data?.forEach(v => {
if (v.sceneOpenFlag === 0) openSceneArr.push(v.scene)
})
if (!openSceneArr.length) {
wx.$util.showToast('暂无开通场景')
} else {
wx.$util.setUserInfo({ ...wx.$util.getUserInfo(), openSceneArr })
// 只开通一个场景直接跳转页面
if (openSceneArr.length === 1) {
wx.$util.setUserInfo({ ...wx.$util.getUserInfo(), selectedSceneType: openSceneArr.includes(1) ? 1 : 0 })
wx.$router.reLaunch(openSceneArr.includes(1) ? 'tabIndex.index' : 'packageEquity.equityPage')
} else if (openSceneArr.length > 1) {
wx.$router.reLaunch('pages.sceneIndex')
}
}
} else {
wx.$util.showToast(message)
}
})
},
choiceAccountLogin() {
let { loginUserInfoList } = this.data
let id = null
......@@ -148,6 +233,7 @@ Page({
isSuper = e.isSuper
}
})
if (!id) {
wx.$util.showToast('请选择账号')
return
......@@ -161,64 +247,16 @@ Page({
.then(res => {
let { data, message } = res
if (data) {
app.globalData.YQorderSetting = null
// app.globalData.YQorderSetting = null
app.globalData.yqdInfo.merchantRange = null
wx.$util.setUserInfo(data.loginUserInfoList[0])
app.globalData.YQorderSetting = null
// console.log(data.loginUserInfoList[0])
wx.$util.setUserInfo(data.loginUserInfoList[0])
checkYqdSuper(app, data.loginUserInfoList[0])
const SCENE = wx.$SCENE
console.log(SCENE, 'SCENE')
// debugger 兼容扫码优惠券进来和免登录逻辑冲突问题
if (SCENE && SCENE.path != 'pages/accountItems/accountItems') {
let {
path,
query
// : { scene }
} = SCENE
console.log(path, 'path')
let { target, name } = wx.$util.getSceneId(path)
// console.log(query)
// console.log(target,name);
wx.$router.reLaunch(`${target}.${name}`, query)
wx.$SCENE = null
} else {
// 超管默认开通所有场景
if (isSuper) {
// 0 会员权益/升级 1 精品升级
let openSceneArr = constantData.sceneList.map(val => {
return val?.sceneType
})
wx.$util.setUserInfo({ ...wx.$util.getUserInfo(), openSceneArr })
wx.$router.reLaunch('pages.sceneIndex')
return
}
// 获取开通的业务场景
api.getYqMerchantSceneConfigAPI({ yqMerchantId: yqMerchantId }).then(res => {
let { data, message, code } = res
if (code == 0) {
let openSceneArr = []
data?.forEach(v => {
if (v.sceneOpenFlag === 0) openSceneArr.push(v.scene)
})
if (!openSceneArr.length) {
wx.$util.showToast('暂无开通场景')
} else {
wx.$util.setUserInfo({ ...wx.$util.getUserInfo(), openSceneArr })
// 只开通一个场景直接跳转页面
if (openSceneArr.length === 1) {
wx.$util.setUserInfo({ ...wx.$util.getUserInfo(), selectedSceneType: openSceneArr.includes(1) ? 1 : 0 })
wx.$router.reLaunch(openSceneArr.includes(1) ? 'tabIndex.index' : 'packageEquity.equityPage')
} else if (openSceneArr.length > 1) {
wx.$router.reLaunch('pages.sceneIndex')
}
}
} else {
wx.$util.showToast(message)
}
})
}
// console.log(data.loginUserInfoList[0])
getYQorderInfo()
const SCENE = wx.$SCENE
// 有场景信息就跳转对应页面 没有就登录场景
SCENE && SCENE.path != 'pages/accountItems/accountItems' ? this.sceneHandle() : this.getYqMerchantSceneConfig({ yqMerchantId, isSuper })
} else {
wx.$util.showToast(message)
}
......
......@@ -24,7 +24,7 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
wx.$api.showLoading('加载中...')
wx.$util.showLoading('加载中...')
let decodeUrl = decodeURIComponent(options.url)
let param = this.getParams(decodeUrl)
if (param.urlParam) {
......
......@@ -204,6 +204,7 @@ Page({
iv
})
.then(({ code, data, message }) => {
console.log(data)
wx.hideLoading()
if (code == 0) {
let { loginUserInfoList, sessionId } = data
......
......@@ -88,7 +88,9 @@
wx:for-item='subOrdersItem'
wx:for-index='subOrdersIndex'>
<view class="goodsItem">
<view class="name oneText">{{filter.replaceItemText(subOrdersItem.upgradeGoodsName)}}</view>
<view class="name oneText">
{{filter.replaceItemText(subOrdersItem.upgradeGoodsAlias||subOrdersItem.upgradeGoodsName)}}
</view>
<view class="price">¥{{filter.toDecimal2 (subOrdersItem.totalPrice)}}</view>
</view>
</block>
......
......@@ -674,7 +674,7 @@ Page({
// if (!e.shopMinPrice) e.shopMinPrice = e.upgradeShopPrice
if (!e.shopMinPrice) e.shopMinPrice = e.upgradeShopMinPrice
e.goodsInfo = {
goodsName: e.upgradeGoodsName
goodsName: e.upgradeGoodsAlias || e.upgradeGoodsName
}
e.count = e.number
e.id = e.upgradeGoodsId
......@@ -768,7 +768,7 @@ Page({
accountDate && (accountDate = new Date(accountDate).format('yyyy-MM-dd'))
this.setData({
outTradeNo,
totalFee: totalFee*100,
totalFee: totalFee * 100,
accountDate
})
})
......@@ -777,7 +777,7 @@ Page({
},
onRoute(options) {
let { outTradeNo, totalFee, accountDate, supplementId } = options
console.log(options);
console.log(options)
// 如果是扫码进来的
if (supplementId) {
return this.checkShowOrderInfo(options)
......
......@@ -246,7 +246,7 @@
<image src="../../images/del.png" />
</view>
<view class="name text-hide">
{{filter.replaceItemText(item.upgradeGoodsName) || filter.replaceItemText(item.goodsInfo.goodsName)}}
{{filter.replaceItemText(item.upgradeGoodsAlias)||filter.replaceItemText(item.upgradeGoodsName) || filter.replaceItemText(item.goodsInfo.goodsName)}}
</view>
<view class="price-box">
¥
......
......@@ -218,7 +218,7 @@ Page({
if (e.upgradeWarrantyPeriod || e.upgradeWarrantyPeriod > 0) {
warrantyCardList.push({
warrantyPeriod: e.upgradeWarrantyPeriod,
goodsName: e.upgradeGoodsName
goodsName: e.upgradeGoodsAlias || e.upgradeGoodsName
})
}
})
......
......@@ -33,7 +33,9 @@
<view class="goods">
<block wx:for="{{orderInfo.subOrderList}}" wx:key="index">
<view class="item">
<view class="name text-hide">{{filter.replaceItemText(item.upgradeGoodsName) || ''}}</view>
<view class="name text-hide">
{{filter.replaceItemText(item.upgradeGoodsAlias) ||filter.replaceItemText(item.upgradeGoodsName) || ''}}
</view>
<view class="type">x{{item.number}}</view>
<view class="price">¥{{item.price}}</view>
</view>
......
......@@ -164,7 +164,7 @@ Page({
if (e.upgradeWarrantyPeriod || e.upgradeWarrantyPeriod > 0) {
warrantyCardList.push({
warrantyPeriod: e.upgradeWarrantyPeriod,
goodsName: e.upgradeGoodsName,
goodsName: e.upgradeGoodsAlias || e.upgradeGoodsName,
cardCode: e.cardCode
})
}
......
......@@ -37,7 +37,9 @@
<view class="goods">
<block wx:for="{{orderInfo.subOrderList}}" wx:key="index">
<view class="item">
<view class="name text-hide">{{filter.replaceItemText(item.upgradeGoodsName) || ''}}</view>
<view class="name text-hide">
{{filter.replaceItemText(item.upgradeGoodsAlias) ||filter.replaceItemText(item.upgradeGoodsName) || ''}}
</view>
<view class="type">x{{item.number}}</view>
<view class="price">¥{{item.price}}</view>
</view>
......@@ -173,7 +175,7 @@
</view>
</block> -->
<!-- wx:if="{{warrantyCardList.length || warrantyCardVisible}}" -->
<!-- 没有质保加屏蔽客服开启 就不显示 -->
<!-- 没有质保加屏蔽客服开启 就不显示 -->
<block wx:if="{{orderInfo.status != 10&&warrantyCardList.length || warrantyCardVisible}}">
<view class="box">
<view class="title">{{orderInfo.selectPayType==0? '客服' :'质保'}}</view>
......
......@@ -578,7 +578,7 @@ Page({
// if (!e.shopMinPrice) e.shopMinPrice = e.upgradeShopPrice
if (!e.shopMinPrice) e.shopMinPrice = e.upgradeShopMinPrice
e.goodsInfo = {
goodsName: e.upgradeGoodsName
goodsName: e.upgradeGoodsAlias || e.upgradeGoodsName
}
e.count = e.number
e.id = e.upgradeGoodsId
......
......@@ -253,7 +253,7 @@
<image src="../../images/del.png" />
</view>
<view class="name text-hide">
{{filter.replaceItemText(item.upgradeGoodsName) || filter.replaceItemText(item.goodsInfo.goodsName)}}
{{filter.replaceItemText(item.upgradeGoodsAlias) ||filter.replaceItemText(item.upgradeGoodsName) || filter.replaceItemText(item.goodsInfo.goodsName)}}
</view>
<view class="price-box">
¥
......
......@@ -90,7 +90,9 @@
wx:for-item="i"
wx:for-index="sindex">
<view class="goods" wx:if="{{sindex < 2}}">
<view class="goods-name text-hide">{{filter.replaceItemText(i.upgradeGoodsName) || ''}}</view>
<view class="goods-name text-hide">
{{filter.replaceItemText(i.upgradeGoodsAlias) ||filter.replaceItemText(i.upgradeGoodsName) || ''}}
</view>
<view class="goods-price">
¥
<text>{{i.totalPrice || 0}}</text>
......
......@@ -15,7 +15,7 @@ Page({
customerService: '',
defaultCustomerService: 'https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/kf.png',
failCustomerService: '../images/kfrefresh.png',
warrantyCardVisible:true,
warrantyCardVisible: true
},
jumpUpdate() {
let { orderInfo } = this.data
......@@ -159,7 +159,7 @@ Page({
if (e.upgradeWarrantyPeriod || e.upgradeWarrantyPeriod > 0) {
warrantyCardList.push({
warrantyPeriod: e.upgradeWarrantyPeriod,
goodsName: e.upgradeGoodsName,
goodsName: e.upgradeGoodsAlias || e.upgradeGoodsName,
cardCode: e.cardCode
})
}
......@@ -245,17 +245,17 @@ Page({
}, 1000 * index)
})
},
getServiceBaseInfo(merchantId){
api.getServiceBaseInfo({merchantId}) .then((result) => {
console.log(result,'result');
let {data,code} = result
if (data.cardCodeFlag&&data.cardCodeFlag==1) {
this.setData({
warrantyCardVisible:false
})
}
getServiceBaseInfo(merchantId) {
api.getServiceBaseInfo({ merchantId }).then(result => {
console.log(result, 'result')
let { data, code } = result
if (data.cardCodeFlag && data.cardCodeFlag == 1) {
this.setData({
warrantyCardVisible: false
})
}
})
},
},
setQrBoxHeight() {
wx.$util.getViewInfo('#qr-view', ({ height }) => {
// console.log(height)
......@@ -305,7 +305,7 @@ Page({
this.setData({
customerService: ''
})
// setTimeout(() => {
let { failCustomerService, defaultCustomerService } = this.data
let { orderCode, customerPhone: phoneNumber, selectPayType } = this.data.orderInfo
......
......@@ -27,7 +27,9 @@
<view class="goods">
<block wx:for="{{orderInfo.subOrderList}}" wx:key="index">
<view class="item">
<view class="name text-hide">{{filter.replaceItemText(item.upgradeGoodsName) || ''}}</view>
<view class="name text-hide">
{{filter.replaceItemText(item.upgradeGoodsAlias) ||filter.replaceItemText(item.upgradeGoodsName) || ''}}
</view>
<view class="type">x{{item.number}}</view>
<view class="price">¥{{item.price}}</view>
</view>
......@@ -134,8 +136,8 @@
</block>
</view>
<!-- wx:if="{{warrantyCardList&&warrantyCardList.length}}" -->
<!-- 没有屏蔽质保卡 就显示 -->
<!-- wx:if="{{!warrantyCardVisible&&orderInfo.selectPayType==0}}" -->
<!-- 没有屏蔽质保卡 就显示 -->
<!-- wx:if="{{!warrantyCardVisible&&orderInfo.selectPayType==0}}" -->
<block wx:if="{{warrantyCardList.length || warrantyCardVisible}}">
<view class="box">
<view class="title">{{orderInfo.selectPayType==0? '客服' :'质保'}}</view>
......
......@@ -105,7 +105,11 @@ const removeStorage = () => {
}
const showNoAccess = () => {
wx.showToast('您的账号无法完成此操作')
// wx.showToast('您的账号无法完成此操作')
wx.showToast({
title:'您的账号无法完成此操作',
icon:'error'
})
}
const setStorageSync = (key, data) => {
wx.setStorageSync(key, JSON.stringify(data))
......
......@@ -91,18 +91,6 @@ const wxShowToast = (name, params) => {
}
}
/**获取设备信息 */
const getSystemInfo = callBack => {
wx.getSystemInfo({
success(res) {
callBack(res)
},
fail(err) {
callBack(err)
}
})
}
/**拨打电话 */
const phoneCall = phoneNumber => {
wx.makePhoneCall({
......@@ -220,8 +208,19 @@ const isFullSucreen = isComponents => {
})
return val
}
/**获取手机信息 */
const getPhoneInfo = callBack => {
// /**获取手机信息 */
// const getPhoneInfo = callBack => {
// wx.getSystemInfo({
// success(res) {
// callBack(res)
// },
// fail(err) {
// callBack(err)
// }
// })
// }
/**获取设备信息 */
const getSystemInfo = callBack => {
wx.getSystemInfo({
success(res) {
callBack(res)
......@@ -232,7 +231,7 @@ const getPhoneInfo = callBack => {
})
}
const wxApi = {
getPhoneInfo,
// getPhoneInfo,
previewImage,
getSystemInfo,
showLoading,
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!