Commit 1f4d9e20 by 前端

Merge branch 'develop' into 'master'

Saas+v4.24.0 0713上线后,代码合并。

See merge request !33
2 parents 52aa83e9 1397b57a
......@@ -10,9 +10,14 @@
"integrity": "sha512-R2FyCk0mK2xvUX2dMgVZjVG512RKBj7ELMDxjRJjhQWtw4495WBgbl5Yb4v2A6d4vWJe6z9toKgDJTciN0Bo9A=="
},
"glsx-applet-component": {
"version": "1.1.16",
"resolved": "https://registry.npmjs.org/glsx-applet-component/-/glsx-applet-component-1.1.16.tgz",
"integrity": "sha512-XlBqP5ja4TqGB0nTW4dW6fdSQ9m/hAspbBKTJZ9CNUGVCKorkyjv/RfY85ta4OU5PiQCKTFZBbTELtz5MoxaVQ=="
"version": "1.1.18",
"resolved": "https://registry.npmjs.org/glsx-applet-component/-/glsx-applet-component-1.1.18.tgz",
"integrity": "sha512-oNJMLkKh/BOFyiGUDlm5r+5dvqBlZx7T9U+UQ2BkqL8R9i713sCHs+1AOsFMA1GOjsgRM2ShgzoXaQef6RQ/ew=="
},
"glsx-map-sdk": {
"version": "0.1.5",
"resolved": "https://registry.npmjs.org/glsx-map-sdk/-/glsx-map-sdk-0.1.5.tgz",
"integrity": "sha512-hvAEOZnc4b1bVDlG0PPWRJCNZbAry6FMu/eGdP2LiRyujuNJHL4cHmqwdtqgwXmeTkglomtIJdGoJtU8jwHPNQ=="
}
}
}
......@@ -5,7 +5,8 @@
"main": "app.js",
"dependencies": {
"@vant/weapp": "^1.10.7",
"glsx-applet-component": "^1.1.16"
"glsx-applet-component": "^1.1.18",
"glsx-map-sdk": "^0.1.5"
},
"devDependencies": {},
"scripts": {
......
......@@ -43,9 +43,10 @@ Page({
// let address = formData.provinceName || '' + formData.cityName || '' + formData.merchantAddress || ''
let address = (formData.provinceName || '') + (formData.cityName || '')
mapApi.geocoder(address).then(res => {
let location = res?.geocodes[0]?.location.split(',')
this.setData({
['formData.longitude']: res?.location?.lng,
['formData.latitude']: res?.location?.lat,
['formData.longitude']: location[0],
['formData.latitude']: location[1],
})
})
},
......@@ -103,11 +104,12 @@ Page({
if (obj.longitude && obj.latitude) {
resolve(obj)
}
mapApi.getLocationByIp().then(res => {
let { location } = res
wx.getLocation({
type: 'gcj02'
}).then(({ latitude, longitude }) => {
resolve({
longitude: location.lng,
latitude: location.lat
longitude: longitude,
latitude: latitude
})
})
})
......
......@@ -30,9 +30,10 @@ Page({
// let address = formData.provinceName || '' + formData.cityName || '' + formData.merchantAddress || ''
let address = (formData.provinceName || '') + (formData.cityName || '')
mapApi.geocoder(address).then(res => {
let location = res?.geocodes[0]?.location.split(',')
this.setData({
['formData.longitude']: res?.location?.lng,
['formData.latitude']: res?.location?.lat,
['formData.longitude']: location[0],
['formData.latitude']: location[1],
})
})
},
......@@ -105,11 +106,12 @@ Page({
if (obj.longitude && obj.latitude) {
resolve(obj)
}
mapApi.getLocationByIp().then(res => {
let { location } = res
wx.getLocation({
type: 'gcj02'
}).then(({ latitude, longitude }) => {
resolve({
longitude: location.lng,
latitude: location.lat
longitude: longitude,
latitude: latitude
})
})
})
......@@ -186,7 +188,7 @@ Page({
wx.$api.showToast(validObj.message)
return
}
if(!selectedBrandList.length) {
if (!selectedBrandList.length) {
wx.$api.showToast('至少选择一个主营品牌')
return
}
......
page {
height: 100vh;
width: 100vw;
background-color: #F2F3F7 !important;
background-color: #FFFFFF !important;
}
::-webkit-scrollbar {
......@@ -11,12 +11,15 @@ page {
}
.sub-menu-active-custom {
background: #F0F4FF !important;
color: #3666FE !important;
background: #3666FE !important;
/* color: #3666FE !important; */
}
.sidebar-active-custom::after {
background: #3666FE !important;
}
.sidebar-active-custom {
color: #3666FE !important;
}
.reclaim {
background: #fff;
......
......@@ -55,6 +55,9 @@ Component({
* 组件的方法列表
*/
methods: {
handleItemTap(e) {
const { item } = e.currentTarget.dataset
this.triggerEvent('handleItemTap', item)
}
}
})
......@@ -13,9 +13,9 @@
<view class="title">{{info.merchantName || info.merchantName4s || ''}}</view>
</view>
<view class="content">
<view wx:for="{{formObj[sceneCode]}}" wx:key="index" class="content-item {{sceneCode == -1 ? 'row-two' : ''}}">
<view wx:for="{{formObj[sceneCode]}}" wx:key="index" class="content-item {{sceneCode == -1 ? 'row-two' : ''}}" bindtap="handleItemTap" data-item="{{item}}">
<view wx:if="{{info[item.name] == '未开通'}}" class="price">{{info[item.name]}}</view>
<view wx:else="" class="price">
<view wx:else class="price">
{{item.prefix || ''}}
{{item.isNum ? filter.money_three_for_two_thousands(info[item.name] || 0.00) : (info[item.name] || 0)}}
{{item.suffix || ''}}
......
......@@ -296,6 +296,18 @@ Component({
})
},
// 业务经营汇总-全部-点击跳转h5
handleBusiCardTap(e) {
const { detail } = e
if (detail.label != '精品升级') {
return true
}
const { idx } = e.currentTarget.dataset
let obj = this.data.busiTotalList[idx]
let url = 'https://dj.glsx.com.cn/dj-car-revenue-analysis/#/?merchantId=' + obj?.merchantId4s + '&merchantName=' + obj?.merchantName4s
wx.$router.jumpH5(url)
},
// 门店经营汇总-start
getPMerchantInfo() {
let { userInfo } = wx.$storage.get()
......
......@@ -80,7 +80,7 @@
<!-- 0:全部;1:精品升级;3:会员权益/升级 -->
<view wx:else>
<view wx:for="{{busiTotalList}}" wx:key="index">
<busi-card info="{{item}}" sceneCode="{{formData.sceneCode}}"></busi-card>
<busi-card info="{{item}}" sceneCode="{{formData.sceneCode}}" bindhandleItemTap="handleBusiCardTap" data-idx="{{index}}"></busi-card>
</view>
<view class="end-txt">
{{busiTotalList.length ? '到底啦!' : '暂无数据'}}
......
import md5 from '../lib/md5'
import qs from '../lib/qs'
const key = 'F2HBZ-KH73F-7A2J2-JC4UR-WOHCO-UVFGZ'
const secret = 'YBmrM98E5pM4gYeknWiBPaWpFR4AISUl'
const domain = 'https://apis.map.qq.com'
class QQMap {
setLocaleCompare(params) {
params.key = key
let keys = []
let obj = {}
Object.keys(params).map(e => keys.push(e))
keys.sort((a, b) => a.localeCompare(b)).map(e => (obj[e] = params[e]))
return obj
}
getSign(params, methods) {
let obj = this.setLocaleCompare(params)
let sign = `${methods}?${decodeURIComponent(qs.stringify(obj))}${secret}`
return md5(sign)
}
get(method, data) {
return this.request('GET', method, data)
}
request(RequestMethods, method, data) {
return new Promise((resolve, reject) => {
wx.showNavigationBarLoading()
if (!data) data = {}
let header =
RequestMethods === 'POST'
? {
'content-type': 'application/json'
}
: {}
const sig = this.getSign(data, method)
let params = {
...this.setLocaleCompare(data),
sig
}
wx.request({
url: `${domain}${method}`,
data: params,
method: RequestMethods,
header,
dataType: 'json',
responseType: 'text',
success({ statusCode, data }) {
if (statusCode == '200') {
if (data.status == '0') {
resolve(data.result || data)
}
} else {
reject(data.result || data)
}
},
fail(error) {
wx.hideLoading()
console.error(`接口异常:`, error)
wx.showToast({
title: '系统异常',
icon: 'error'
})
reject(error)
},
complete() {
wx.stopPullDownRefresh()
wx.hideNavigationBarLoading()
}
})
})
}
/**计算距离 */
calculateDistance(from, to) {
from = from.join(',')
to = to.join(',')
return this.get('/ws/distance/v1/', {
from,
to,
mode: 'driving'
})
}
/** 批量距离计算(矩阵) */
calculateDistanceMatrix(from, toList) {
from = from.join(',')
let to = toList.join(';')
return this.get('/ws/distance/v1/matrix/', {
from,
to,
mode: 'driving'
})
}
/**地址解析(地址转坐标) */
geocoder(address) {
return this.get('/ws/geocoder/v1/', {
address
})
}
/**逆地址解析(坐标位置描述) location=lat<纬度>,lng<经度> */
detailedAdrress(location) {
location = location.join(',')
return this.get('/ws/geocoder/v1/', {
location
})
}
/**IP定位 */
getLocationByIp() {
return this.get('/ws/location/v1/ip')
}
/**坐标转换 */
translate(locations, type = 5) {
locations = locations.join(';') //格式:纬度前,经度后
return this.get('/ws/coord/v1/translate', {
locations,
type
})
}
}
export default new QQMap()
import GlMap from 'glsx-map-sdk'
export default new GlMap()
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!