|
@@ -79,9 +79,9 @@ Page({
|
|
|
stop_type: '',
|
|
|
marqueePace: 0.6, //滚动速度
|
|
|
marqueeDistance: 520, //初始滚动距离 用到
|
|
|
- size: 26, //用到
|
|
|
- marqueeWidth: 520, //用到
|
|
|
- length: '',
|
|
|
+ size: 26, //通知公告用到
|
|
|
+ marqueeWidth: 560, //通知公告用到
|
|
|
+ length: '',//通知公告
|
|
|
swiperCurrent: 0,
|
|
|
midbolear: '',
|
|
|
per_money: '',
|
|
@@ -116,6 +116,7 @@ Page({
|
|
|
console.log('YYYYYYYYYYYYY')
|
|
|
that.location()
|
|
|
that.getUser()
|
|
|
+ that.userState()
|
|
|
})
|
|
|
// that.location();
|
|
|
// testToken = setInterval(function () {
|
|
@@ -215,6 +216,47 @@ Page({
|
|
|
});
|
|
|
}
|
|
|
},
|
|
|
+ //通知公告
|
|
|
+ getNotice(id){
|
|
|
+ let data = {
|
|
|
+ 'area_id': id
|
|
|
+ }
|
|
|
+ app.request("/index/an", data, "GET").then(res => {
|
|
|
+ console.log(res)
|
|
|
+ if(200 == res.status && res.data.id){
|
|
|
+ this.setData({notice:res.data})
|
|
|
+ var length = res.data.description.length * this.data.size; //计算文字的长度
|
|
|
+ this.setData({
|
|
|
+ length: length
|
|
|
+ })
|
|
|
+ if (this.data.length > this.data.marqueeWidth) {
|
|
|
+ this.noticeRun();
|
|
|
+ } else {
|
|
|
+ this.setData({
|
|
|
+ marqueeDistance: 0
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }).catch(err => {
|
|
|
+ console.log(err)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ noticeRun: function () {
|
|
|
+ var that = this;
|
|
|
+ mytime = setInterval(function () {
|
|
|
+ if (-that.data.marqueeDistance < that.data.length) {
|
|
|
+ that.setData({
|
|
|
+ marqueeDistance: that.data.marqueeDistance - that.data.marqueePace,
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ clearInterval(mytime);
|
|
|
+ that.setData({
|
|
|
+ marqueeDistance: that.data.marqueeWidth
|
|
|
+ });
|
|
|
+ that.noticeRun();
|
|
|
+ }
|
|
|
+ }, 6)
|
|
|
+ },
|
|
|
//定位当前位置
|
|
|
posi: util.throttle(function () {
|
|
|
//点击定位
|
|
@@ -273,7 +315,7 @@ Page({
|
|
|
var data = res.data;
|
|
|
console.log(data, '区域')
|
|
|
let id = data.id
|
|
|
- that.userState()
|
|
|
+ this.getNotice(id)
|
|
|
if (data.points != []) {
|
|
|
that.setData({
|
|
|
id: data.id,
|
|
@@ -464,7 +506,7 @@ Page({
|
|
|
return;
|
|
|
} else {
|
|
|
//没有押金没有免押券
|
|
|
- if (userStatus.is_deposit == 0 && that.data.setting.is_deposit != 0 && userStatus.is_coupon_deposit_free == false) {
|
|
|
+ if (userStatus.is_deposit == 0 && setting.is_deposit != 0 && userStatus.is_coupon_deposit_free == false) {
|
|
|
console.log('没有押金没有免押券')
|
|
|
my.navigateTo({
|
|
|
url: '/pages/ride_zige/ride_zige',
|
|
@@ -619,11 +661,7 @@ Page({
|
|
|
//用户状态
|
|
|
userState: function (id) {
|
|
|
var that = this;
|
|
|
-
|
|
|
- var data = {
|
|
|
- 'area_id': id
|
|
|
- }
|
|
|
- app.request("/user/status", data, "GET").then(res => {
|
|
|
+ app.request("/user/status","GET").then(res => {
|
|
|
console.log(res)
|
|
|
if (res.status == 200) {
|
|
|
console.log(res, 'XYYING================')
|
|
@@ -746,10 +784,9 @@ Page({
|
|
|
}
|
|
|
}
|
|
|
} else if (data.id == 3 && !setting) {
|
|
|
- wx.showModal({
|
|
|
+ my.alert({
|
|
|
title: '提示',
|
|
|
content: '您附近暂无运营区,暂不可用车',
|
|
|
- showCancel: false
|
|
|
})
|
|
|
} else if (data.id == 4) {
|
|
|
if (userStatus.is_bind_mobile == 0) {
|