Jelajahi Sumber

Merge branch '黄色分支' into 测试

xiaohaizhao 1 tahun lalu
induk
melakukan
0ccd60d0f5

+ 9 - 53
packageA/clockIn/signIn.js

@@ -1,8 +1,8 @@
 const _Http = getApp().globalData.http;
-/* const QQMapWX = require('../../utils/qqmap-wx-jssdk.min'),
-    qqmapsdk = new QQMapWX({
-        key: 'QF6BZ-4IQC5-SN2IH-QL5BW-U4IJO-R3BY4' // 必填
-    }); */
+
+import { tianditu } from "../../utils/tianditu.js";
+const api = new tianditu();
+
 import {
     formatTime
 } from "../../utils/getTime";
@@ -258,29 +258,14 @@ Page({
                 latitude,
                 longitude
             }) {
-                console.log('bu精确', latitude, longitude)
                 wx.hideLoading();
-                _Http.basic({
-                    "id": "10027201",
-                    "content": {
-                        "lon": longitude,
-                        "lat": latitude
-                    }
-                }).then(res => {
-                    console.log("获取逆解析地址", res)
-                    if (res.msg != '成功') return wx.showToast({
-                        title: res.msg,
-                        icon: "none"
-                    })
-                    if (res.data.msg != 'ok') return wx.showToast({
-                        title: '定位失败,请查看手机是否开启定位服务',
-                        icon: "none"
-                    })
-                    let result = res.data.result;
+                api.getPlace(longitude, latitude).then((place) => {
+                    console.log("获取逆解析地址", place)
+                    let result = place.result;
                     that.setData({
                         content: {
-                            province: result.addressComponent.province,
-                            city: result.addressComponent.city,
+                            province: result.addressComponent.province|| result.addressComponent.city,
+                            city: result.addressComponent.city||result.addressComponent.province,
                             county: result.addressComponent.county,
                             address: result.formatted_address,
                             latitude,
@@ -291,35 +276,6 @@ Page({
                         }
                     })
                 })
-                /*   qqmapsdk.reverseGeocoder({
-                      location: {
-                          latitude,
-                          longitude
-                      },
-                      success(s) {
-                          console.log("逆解析", s)
-                          that.setData({
-                              content: {
-                                  province: s.result.address_component.province,
-                                  city: s.result.address_component.city,
-                                  county: s.result.address_component.district,
-                                  address: s.result.address,
-                                  longitude,
-                                  latitude,
-                                  remarks: "",
-                                  sa_projectid: 0,
-                                  sys_enterpriseid: 0
-                              }
-                          })
-                      },
-                      fail(err) {
-                          console.log(err)
-                          wx.showToast({
-                              title: '定位失败,请查看手机是否开启定位服务',
-                              icon: "none"
-                          })
-                      }
-                  }) */
             },
             fail: function (e) {
                 //这里是获取失败的时候

+ 15 - 1
packageA/publicClue/modules/follow/follow.js

@@ -1,9 +1,18 @@
-const _Http = getApp().globalData.http
+const _Http = getApp().globalData.http,
+    currency = require("../../../../utils/currency"),
+    CNY = value => currency(value, {
+        symbol: "¥",
+        precision: 2
+    }).format();
 Component({
     properties: {
         disabled: {
             type: Boolean,
             value: false
+        },
+        isshowsalesfeesamount: {
+            type: Boolean,
+            value: false
         }
     },
     options: {
@@ -47,6 +56,11 @@ Component({
                 content
             }).then(res => {
                 console.log('线索跟进', res);
+                
+                if (this.data.isshowsalesfeesamount) res.data = res.data.map(v => {
+                    v.showsalesfeesamount = CNY(v.salesfeesamount)
+                    return v
+                })
                 this.setData({
                     followList: res.pageNumber == 1 ? res.data : this.data.followList.concat(res.data),
                     "content.pageNumber": res.pageNumber + 1,

+ 3 - 0
packageA/publicClue/modules/follow/follow.wxml

@@ -28,6 +28,9 @@
         <view class="text">
             {{item.content||' --'}}
         </view>
+        <view class="type" wx:if="{{isshowsalesfeesamount}}">
+            营销费用:<text>{{item.showsalesfeesamount}}</text>
+        </view>
     </view>
     <Yl_Files id="{{'Yl_Files'+item.rowindex}}" delete="{{disabled}}" strict />
     <view class="bottom">

+ 10 - 40
packageA/publicClue/modules/follow/insert.js

@@ -2,10 +2,11 @@ const _Http = getApp().globalData.http,
     {
         formatTime
     } = require("../../../../utils/getTime");
-/*     QQMapWX = require('../../../../utils/qqmap-wx-jssdk.min'),
-    qqmapsdk = new QQMapWX({
-        key: 'QF6BZ-4IQC5-SN2IH-QL5BW-U4IJO-R3BY4' // 必填
-    }); */
+
+import {
+    tianditu
+} from "../../../../utils/tianditu.js";
+const api = new tianditu();
 Page({
     data: {
         disabled: true,
@@ -80,43 +81,12 @@ Page({
                     latitude,
                     longitude
                 }) {
-                    that.setData({
-                        "content.latitude": latitude,
-                        "content.longitude": longitude
-                    })
-                    /*        qqmapsdk.reverseGeocoder({
-                               location: {
-                                   latitude,
-                                   longitude
-                               },
-                               success(s) {
-                                   console.log("逆解析", s)
-                                   that.setData({
-                                       "content.address": s.result.address,
-                                   })
-                               }
-                           }) */
-
-                    _Http.basic({
-                        "id": "10027201",
-                        "content": {
-                            "lon": longitude,
-                            "lat": latitude
-                        }
-                    }).then(res => {
-                        console.log("获取逆解析地址", res)
-                        if (res.msg != '成功') return wx.showToast({
-                            title: res.msg,
-                            icon: "none"
-                        })
-                        if (res.data.msg != 'ok') return wx.showToast({
-                            title: '定位失败,请查看手机是否开启定位服务',
-                            icon: "none"
-                        })
+                    api.getPlace(longitude, latitude).then((place) => {
+                        console.log("获取逆解析地址", place)
                         that.setData({
-                            content: {
-                                "content.address": res.data.result.formatted_address,
-                            }
+                            "content.address": place.result.formatted_address,
+                            "content.latitude": latitude,
+                            "content.longitude": longitude
                         })
                     })
                 },

+ 1 - 1
packageA/saleClue/detail.wxml

@@ -11,7 +11,7 @@
 <view style="height: 20rpx;" />
 <Yl_FunTabs list='{{tabsList}}' active='{{tabsActive}}' bind:onChenge="tabsChange">
     <Preview slot='详细信息' list1='{{list1}}' list2='{{list2}}' />
-    <Follow slot='跟进记录' rowData="{{detail}}" id='follow' disabled="{{isFollow && isLeader}}" />
+    <Follow slot='跟进记录' isshowsalesfeesamount rowData="{{detail}}" id='follow' disabled="{{isFollow && isLeader}}" />
     <Work slot='任务' id='Work' ownertable='sat_orderclue' ownerid='{{sat_orderclueid}}' disabled="{{isAdmin||isLeader}}" />
     <Clue slot='来源线索' id='Clue' />
     <Record slot='操作' id="Record" ownertable='sat_orderclue' ownerid='{{sat_orderclueid}}' />

+ 9 - 1
pages/trace/index.js

@@ -1,4 +1,10 @@
-const _Http = getApp().globalData.http
+const _Http = getApp().globalData.http,
+  currency = require("../../utils/currency"),
+  CNY = value => currency(value, {
+    symbol: "¥",
+    precision: 2
+  }).format();
+
 Component({
   properties: {
     ownertable: {
@@ -54,6 +60,8 @@ Component({
           } catch (error) {
             v.names = null
           }
+
+          v.showsalesfeesamount = CNY(v.salesfeesamount)
           return v
         })
         this.setData({

+ 3 - 0
pages/trace/index.wxml

@@ -44,6 +44,9 @@
         <view class="text">
             下次跟进计划:{{item.nextplan||' --'}}
         </view>
+        <view class="text">
+            营销费用:{{item.showsalesfeesamount||' --'}}
+        </view>
     </navigator>
     <view class="bottom">
         <view class="date">

+ 32 - 0
utils/tianditu.js

@@ -0,0 +1,32 @@
+/* 文档 http://lbs.tianditu.gov.cn/server/search2.html */
+
+class tianditu {
+    /* 逆解析 */
+    getPlace(lon, lat) {
+        return this.request(`/geocoder?postStr={'lon':${lon},'lat':${lat},'ver':1}&type=geocode`)
+    }
+    /* 地名搜索 */
+    placeNameSearch(data = {}) {
+        return this.request(`/v2/search?postStr=${JSON.stringify(data)}&type=query`)
+    }
+    request(query, method = 'GET') {
+        const tks = ['524ebc3954aaa26259f80ea937a3f569', '8aad97b24c38ed6643207de9da174b98', '47bb2ca36a43839fd7c45e2d762561f8'],
+            url = 'https://api.tianditu.gov.cn' + query + `&tk=${tks[ Math.floor(Math.random() * tks.length)]}`
+        return new Promise((resolve, reject) => {
+            this._request(url, method, resolve)
+        })
+    }
+    _request(url, method, resolve) {
+        wx.request({
+            url,
+            method,
+            success: (res) => {
+                resolve(res.data)
+            }
+        });
+    }
+}
+
+export {
+    tianditu
+}