作者 刘朕

代码更新

@@ -233,7 +233,7 @@ App({ @@ -233,7 +233,7 @@ App({
233 // baseUrl: 'http://chemai.shs.broing.cn/', 233 // baseUrl: 'http://chemai.shs.broing.cn/',
234 baseUrl: 'https://xiaoxiangauto.com/', 234 baseUrl: 'https://xiaoxiangauto.com/',
235 // baseUrl: 'http://chemai.t.brotop.cn/', 235 // baseUrl: 'http://chemai.t.brotop.cn/',
236 - // imagesUrl: 'https://xiaoxiangauto.com/', 236 + imagesUrl: 'https://xiaoxiangauto.com/',
237 statusHeight: 0, 237 statusHeight: 0,
238 stores_id: '', //进入4s店id 238 stores_id: '', //进入4s店id
239 city_glob_id: '', // 城市定位 239 city_glob_id: '', // 城市定位
@@ -727,7 +727,7 @@ Page({ @@ -727,7 +727,7 @@ Page({
727 */ 727 */
728 onHide: function () { 728 onHide: function () {
729 clearTimeout(timerPageA); 729 clearTimeout(timerPageA);
730 - this.sendCountTime() 730 + // this.sendCountTime()
731 intPageATime = 0 731 intPageATime = 0
732 732
733 }, 733 },
@@ -24,6 +24,7 @@ Page({ @@ -24,6 +24,7 @@ Page({
24 id: '', 24 id: '',
25 type: '', 25 type: '',
26 inviter_id: '', 26 inviter_id: '',
  27 + share_inviter_id: '',
27 time_data: '', 28 time_data: '',
28 obj: '', 29 obj: '',
29 texts: 0, 30 texts: 0,
@@ -68,12 +69,13 @@ Page({ @@ -68,12 +69,13 @@ Page({
68 that.getCitied()//获取位置 69 that.getCitied()//获取位置
69 }, 70 },
70 onLoad: function (options) { 71 onLoad: function (options) {
  72 + console.log('options',options);
71 let that = this 73 let that = this
72 let token = wx.getStorageSync('token') 74 let token = wx.getStorageSync('token')
73 console.log(options,wx.getStorageSync('user_id')) 75 console.log(options,wx.getStorageSync('user_id'))
74 if (options.scene) { 76 if (options.scene) {
75 let str = decodeURIComponent(options.scene) 77 let str = decodeURIComponent(options.scene)
76 - console.log(str) 78 + console.log('str',str)
77 let sss = str.indexOf (':') 79 let sss = str.indexOf (':')
78 let sssh = str.indexOf (',') 80 let sssh = str.indexOf (',')
79 let codeid = str.substring(sss + 1, sssh) 81 let codeid = str.substring(sss + 1, sssh)
@@ -86,6 +88,12 @@ Page({ @@ -86,6 +88,12 @@ Page({
86 type: 2, 88 type: 2,
87 inviter_id: codeid 89 inviter_id: codeid
88 }) 90 })
  91 + if (str.is_share) {
  92 + wx.setStorageSync('is_share', str.is_share)
  93 + that.setData({
  94 + share_inviter_id: str.inviter_id
  95 + })
  96 + }
89 // wx.setStorageSync('s4_id', options.s4_id) 97 // wx.setStorageSync('s4_id', options.s4_id)
90 // wx.setStorageSync('s4_name', options.s4_name) 98 // wx.setStorageSync('s4_name', options.s4_name)
91 } else { 99 } else {
@@ -102,6 +110,9 @@ Page({ @@ -102,6 +110,9 @@ Page({
102 } 110 }
103 if (options.is_share) { 111 if (options.is_share) {
104 wx.setStorageSync('is_share', options.is_share) 112 wx.setStorageSync('is_share', options.is_share)
  113 + that.setData({
  114 + share_inviter_id: options.inviter_id
  115 + })
105 } 116 }
106 // 改 117 // 改
107 // if (options.is_share == 1) { 118 // if (options.is_share == 1) {
@@ -489,16 +500,16 @@ Page({ @@ -489,16 +500,16 @@ Page({
489 // 发送浏览时间 500 // 发送浏览时间
490 sendCountTime() { 501 sendCountTime() {
491 let that = this 502 let that = this
492 - console.log(this.data.id,intPageATime, 'assdsdsdsdsdsdsdsd') 503 + console.log(that.data.id,intPageATime, 'assdsdsdsdsdsdsdsd')
493 request({ 504 request({
494 url: '/api/new2/userOperateTime', 505 url: '/api/new2/userOperateTime',
495 data: { 506 data: {
496 type: 2, 507 type: 2,
497 - active_id: this.data.id, 508 + active_id: that.data.id,
498 time: intPageATime, 509 time: intPageATime,
499 - lat: this.data.latitude,  
500 - lng: this.data.longitude,  
501 - inviter_id:wx.getStorageSync('user_id') 510 + lat: that.data.latitude,
  511 + lng: that.data.longitude,
  512 + inviter_id:that.data.share_inviter_id
502 }, 513 },
503 success(res){ 514 success(res){
504 console.log('res', res) 515 console.log('res', res)
@@ -568,7 +579,7 @@ Page({ @@ -568,7 +579,7 @@ Page({
568 onHide: function () { 579 onHide: function () {
569 clearTimeout(timerPageA); 580 clearTimeout(timerPageA);
570 console.log(intPageATime) 581 console.log(intPageATime)
571 - this.sendCountTime() 582 + // this.sendCountTime()
572 intPageATime = 0 583 intPageATime = 0
573 584
574 }, 585 },
@@ -578,7 +589,10 @@ Page({ @@ -578,7 +589,10 @@ Page({
578 */ 589 */
579 onUnload: function () { 590 onUnload: function () {
580 clearTimeout(timerPageA); 591 clearTimeout(timerPageA);
581 - this.sendCountTime() 592 + if(wx.getStorageSync('is_share') == 1) {
  593 + this.sendCountTime()
  594 + }
  595 + wx.removeStorageSync('is_share')
582 console.log(intPageATime) 596 console.log(intPageATime)
583 intPageATime = 0 597 intPageATime = 0
584 }, 598 },
@@ -37,8 +37,12 @@ Page({ @@ -37,8 +37,12 @@ Page({
37 id: options.id, 37 id: options.id,
38 }) 38 })
39 } else { 39 } else {
  40 + console.log(options.scene);
  41 + let scene = options.scene;
  42 + scene = scene.split('%2C');
  43 + let id = scene[1].split('scene%3A')[1]
40 that.setData({ 44 that.setData({
41 - id: options.id, 45 + id: id,
42 }) 46 })
43 } 47 }
44 if (token) { 48 if (token) {