|
|
|
@ -1,6 +1,7 @@
|
|
|
|
|
|
|
|
|
|
import {
|
|
|
|
|
http
|
|
|
|
|
http,
|
|
|
|
|
location_city
|
|
|
|
|
} from '../../../../utils/util'
|
|
|
|
|
Page({
|
|
|
|
|
|
|
|
|
@ -19,13 +20,26 @@ Page({
|
|
|
|
|
* 生命周期函数--监听页面加载
|
|
|
|
|
*/
|
|
|
|
|
onLoad: function (options) {
|
|
|
|
|
|
|
|
|
|
let coupon_id = options.coupon_id
|
|
|
|
|
let city_id = getApp().globalData.city_id
|
|
|
|
|
http("/api/v1/coupon-cycle","post",{coupon_id,city_id}).then(res=>{
|
|
|
|
|
this.setData({IP_list:res})
|
|
|
|
|
|
|
|
|
|
if (!city_id) {
|
|
|
|
|
// 默认北京写法
|
|
|
|
|
location_city().then(res => {
|
|
|
|
|
let city_id = res.city_info.city_id
|
|
|
|
|
getApp().globalData.city_id = city_id
|
|
|
|
|
this.getip_list(coupon_id, city_id)
|
|
|
|
|
})
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
this.getip_list(coupon_id, city_id)
|
|
|
|
|
},
|
|
|
|
|
getip_list(coupon_id, city_id) {
|
|
|
|
|
http("/api/v1/coupon-cycle", "post", { coupon_id, city_id }).then(res => {
|
|
|
|
|
this.setData({ IP_list: res })
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 生命周期函数--监听页面初次渲染完成
|
|
|
|
|
*/
|
|
|
|
|