@@ -70,8 +70,6 @@ | |||||
} | } | ||||
}, | }, | ||||
"tabBar": { | "tabBar": { | ||||
"color": "#abb1be", | |||||
"selectedColor": "#FD782D", | |||||
"custom": true, | "custom": true, | ||||
"list": [ | "list": [ | ||||
{ | { | ||||
@@ -32,7 +32,7 @@ Component({ | |||||
methods: { | methods: { | ||||
backHome: function () { | backHome: function () { | ||||
wx.switchTab({ | wx.switchTab({ | ||||
url: '/pages/main/index', | |||||
url: '/index/index', | |||||
}) | }) | ||||
}, | }, | ||||
back: function () { | back: function () { | ||||
@@ -1,3 +1,5 @@ | |||||
const extConfig = wx.getExtConfigSync ? wx.getExtConfigSync() : {} | |||||
let ifStoreApp = extConfig.attr.ifStoreApp; | |||||
Component({ | Component({ | ||||
data: { | data: { | ||||
selected: 0, | selected: 0, | ||||
@@ -31,6 +33,24 @@ Component({ | |||||
] | ] | ||||
}, | }, | ||||
attached() { | attached() { | ||||
if (ifStoreApp==1){ | |||||
this.setData({ | |||||
list: [ | |||||
{ | |||||
"pagePath": "/index/index", | |||||
"iconPath": "../assets/images/home.png", | |||||
"selectedIconPath": "../assets/images/home-a.png", | |||||
"text": "首页" | |||||
}, | |||||
{ | |||||
"pagePath": "/index/user", | |||||
"iconPath": "../assets/images/user.png", | |||||
"selectedIconPath": "../assets/images/user-a.png", | |||||
"text": "我的" | |||||
} | |||||
] | |||||
}) | |||||
} | |||||
}, | }, | ||||
methods: { | methods: { | ||||
switchTab(e) { | switchTab(e) { | ||||
@@ -30,34 +30,33 @@ | |||||
}, | }, | ||||
"debug": false, | "debug": false, | ||||
"tabBar": { | "tabBar": { | ||||
"custom": true, | |||||
"list": [ | "list": [ | ||||
{ | { | ||||
"text": "首页", | |||||
"pagePath": "index/index", | |||||
"iconPath": "assets/images/home.png", | "iconPath": "assets/images/home.png", | ||||
"pagePath": "pages/main/index", | |||||
"selectedIconPath": "assets/images/home-a.png" | |||||
"selectedIconPath": "assets/images/home-a.png", | |||||
"text": "首页" | |||||
}, | }, | ||||
{ | { | ||||
"text": "门店", | |||||
"pagePath": "index/searchbar", | |||||
"iconPath": "assets/images/mendian.png", | "iconPath": "assets/images/mendian.png", | ||||
"pagePath": "pages/index/searchbar/index", | |||||
"selectedIconPath": "assets/images/mendian-a.png" | |||||
"selectedIconPath": "assets/images/mendian-a.png", | |||||
"text": "门店" | |||||
}, | }, | ||||
{ | { | ||||
"text": "停车", | |||||
"pagePath": "index/passCar", | |||||
"iconPath": "assets/images/park.png", | "iconPath": "assets/images/park.png", | ||||
"pagePath": "pages/passCar/passCar", | |||||
"selectedIconPath": "assets/images/park-a.png" | |||||
"selectedIconPath": "assets/images/park-a.png", | |||||
"text": "停车" | |||||
}, | }, | ||||
{ | { | ||||
"text": "我的", | |||||
"pagePath": "index/user", | |||||
"iconPath": "assets/images/user.png", | "iconPath": "assets/images/user.png", | ||||
"pagePath": "pages/user/index", | |||||
"selectedIconPath": "assets/images/user-a.png" | |||||
"selectedIconPath": "assets/images/user-a.png", | |||||
"text": "我的" | |||||
} | } | ||||
], | |||||
"color": "#abb1be", | |||||
"selectedColor": "#FD782D" | |||||
] | |||||
}, | }, | ||||
"window": { | "window": { | ||||
"backgroundTextStyle": "dark", | "backgroundTextStyle": "dark", | ||||
@@ -1,12 +1,654 @@ | |||||
Component({ | |||||
pageLifetimes: { | |||||
show() { | |||||
if (typeof this.getTabBar === 'function' && | |||||
this.getTabBar()) { | |||||
this.getTabBar().setData({ | |||||
selected: 0 | |||||
const extConfig = wx.getExtConfigSync ? wx.getExtConfigSync() : {} | |||||
let ifStoreApp = extConfig.attr.ifStoreApp; | |||||
const navigationBarHeight = (getApp().statusBarHeight + 60) + 'px' | |||||
const Http = require("../utils/HttpBasics"); | |||||
const imgurl = require("../utils/imgurl"); | |||||
const config = require("../config/config"); | |||||
const QR = require("../utils/memberqrcode.js"); | |||||
const util = require("../utils/util"); | |||||
const bgColor = require("../utils/bgColor.js") | |||||
let app = getApp(); | |||||
Page({ | |||||
data: { | |||||
ifStoreApp: ifStoreApp, | |||||
navigationBarTitle: '首页', | |||||
navigationBarHeight, | |||||
chengzhangBox: bgColor.colorFirst.main.chengzhangBox, | |||||
activeColor: bgColor.colorFirst.main.activeColor, | |||||
qg: bgColor.colorFirst.main.qg, | |||||
newUrl: "", | |||||
cover: "", | |||||
kanjia:imgurl.kanjia.url, | |||||
pintuan: imgurl.pintuan.url, | |||||
xiaofeika: imgurl.xiaofeika.url, | |||||
xingyun: imgurl.xingyun.url, | |||||
jfshangcheng: imgurl.jfshangcheng.url, | |||||
toutiao: imgurl.toutiao.url, | |||||
giftHr: imgurl.giftHr.url, | |||||
giftHr: imgurl.giftHr.url, | |||||
next: imgurl.next.url, | |||||
usergift: imgurl.usergift.url, | |||||
guanbi1: imgurl.guanbi1.url, | |||||
icon0001: imgurl.icon0001.url, | |||||
icon0002: imgurl.icon0002.url, | |||||
icon0003: imgurl.icon0003.url, | |||||
icon0004: imgurl.icon0004.url, | |||||
icon0005: imgurl.icon0005.url, | |||||
icon0006: imgurl.icon0006.url, | |||||
icon0007: imgurl.icon0007.url, | |||||
icon0008: imgurl.icon0008.url, | |||||
barcode: imgurl.barcode.url, | |||||
leftarrows: imgurl.leftarrows.url, | |||||
newcard: imgurl.newcard.url, | |||||
newseckill: imgurl.newseckill.url, | |||||
newbargain: imgurl.newbargain.url, | |||||
newgroup: imgurl.newgroup.url, | |||||
product: imgurl.product.url, | |||||
barginicon: imgurl.barginicon.url, | |||||
pintuan: imgurl.pintuan.url, | |||||
duihuan: imgurl.duihuan.url, | |||||
market: app.globalData.market, | |||||
list: [], | |||||
xslist:[], | |||||
loading: true, | |||||
fistLogin: null, | |||||
alphaData: null, | |||||
swiperCurrent: 0, | |||||
title: null, | |||||
weappShareTitle: '', //分享标题 | |||||
weappShareCoverImg: '', //分享图片 | |||||
desc: null, | |||||
scrollTop: 0, | |||||
showGame: false, | |||||
showTopic: false, | |||||
showQg:false, | |||||
gamedata: {}, | |||||
couponId: '', //游戏返回时传回的字段 | |||||
played: false, //从游戏页面跳回首页返回true | |||||
havePlayEd: app.globalData.havePlayEd, | |||||
staticGamedata: {}, | |||||
showIf: false, | |||||
showPages: false, | |||||
display: 'none', | |||||
display1: 'none', | |||||
optionsData: null, | |||||
page: 1 // 刷新进入页面时已经加载了第一页数据,onReachBottom时 page++,从第2页开始加载 | |||||
}, | |||||
alphaClick: function(even) { | |||||
var animation = wx.createAnimation({}) | |||||
animation.opacity(0).step({ | |||||
duration: 2000 | |||||
}) | |||||
this.setData({ | |||||
alphaData: animation.export() | |||||
}) | |||||
}, | |||||
// 我的卡包 | |||||
mycard: function() { | |||||
wx.navigateTo({ | |||||
url: '/pages/cardorder/index/index', | |||||
}) | |||||
}, | |||||
//我的券包 | |||||
mycoupon: function() { | |||||
wx.navigateTo({ | |||||
url: '/pages/couponorder/index/index', | |||||
}) | |||||
}, | |||||
gotoSpellGroup: function() { | |||||
wx.navigateTo({ | |||||
url: '/pages/spellGroup/spellGroup', | |||||
}) | |||||
}, | |||||
qrcode: function() { | |||||
var that = this; | |||||
let memberId = that.data.memberId; | |||||
if (memberId) { | |||||
wx.navigateTo({ | |||||
url: '/pages/specialcourtesy/specialcourtesy' | |||||
}) | |||||
} | |||||
}, | |||||
//跳往限时秒杀 | |||||
gotoRushBuy: function() { | |||||
wx.navigateTo({ | |||||
url: '/pages/rushToBuy/index', | |||||
}) | |||||
}, | |||||
swiperChange: function(e) { | |||||
this.setData({ | |||||
swiperCurrent: e.detail.current | |||||
}); | |||||
}, | |||||
gotogame: function() { | |||||
let that = this; | |||||
if (!that.data.showIf){ | |||||
wx.showToast({ | |||||
title: '暂无游戏频道', | |||||
icon:"none", | |||||
duration:3000 | |||||
}) | |||||
}else{ | |||||
Http.get({ | |||||
url: config.api.checkPhoneStatus, | |||||
data: {} | |||||
}) | |||||
.then(res => { | |||||
var data = { | |||||
couponChannelId: "" + that.data.couponChannelId, | |||||
couponId: "" + that.data.couponId | |||||
}; | |||||
if (that.data.couponChannelId == null) { | |||||
var data = { | |||||
couponId: "" + that.data.couponId | |||||
}; | |||||
} | |||||
wx.redirectTo({ | |||||
url: '/pages/game/index?url=' + that.data.staticGamedata.url + "&id=" + that.data.staticGamedata.id + "&gameId=" + that.data.staticGamedata.gameId, | |||||
}) | |||||
}) | |||||
.catch(err => { | |||||
if (err.code == 11005) { | |||||
// 用户手机未授权 | |||||
/** | |||||
* 将值传到用户手机号授权的页面 | |||||
* | |||||
*/ | |||||
wx.redirectTo({ | |||||
url: "/pages/getphoneInfo/index?path=index&url=" + that.data.staticGamedata.url + "&id=" + that.data.staticGamedata.id + "&gameId=" + that.data.staticGamedata.gameId, | |||||
}); | |||||
} else if (err.code == 11006) { | |||||
// 用户手机已加密 | |||||
wx.redirectTo({ | |||||
url: "/pages/phoneinput/phoneinput?path=index&url=" + that.data.staticGamedata.url + "&id=" + that.data.staticGamedata.id + "&gameId=" + that.data.staticGamedata.gameId, | |||||
}); | |||||
} else { | |||||
wx.showToast({ | |||||
title: err.message, | |||||
icon: 'none', | |||||
duration: 2000, | |||||
mask: false | |||||
}); | |||||
} | |||||
}) | |||||
} | |||||
}, | |||||
mySpecial: function() { | |||||
console.log("special"); | |||||
wx.navigateTo({ | |||||
url: '/pages/specialcourtesy/specialcourtesy', | |||||
}) | |||||
}, | |||||
/** | |||||
* 生命周期函数--监听页面初次渲染完成 | |||||
*/ | |||||
onLoad: function(options) { | |||||
let that = this; | |||||
let optionss; | |||||
if (wx.getStorageSync('options')){ | |||||
optionss = JSON.parse(wx.getStorageSync('options')); | |||||
} | |||||
if (options.played == "true") { | |||||
that.setData({ | |||||
played: true | |||||
}) | |||||
} | |||||
if (optionss && optionss.couponChannelId || optionss && optionss.orderId) { | |||||
that.setData({ | |||||
optionsData: optionss | |||||
}) | |||||
that.getWeapNote(optionss.couponChannelId, optionss.orderId); | |||||
} else { | |||||
that.getWeapNote() | |||||
} | |||||
//获取条形码 | |||||
// util.barcode("barcode", optionss.quancode, 510, 100); | |||||
}, | |||||
onShow: function() { | |||||
if (typeof this.getTabBar === 'function' && | |||||
this.getTabBar()) { | |||||
this.getTabBar().setData({ | |||||
selected: 0 | |||||
}) | |||||
} | |||||
let that = this; | |||||
that.setData({ | |||||
havePlayEd: app.globalData.havePlayEd ? app.globalData.havePlayEd : false | |||||
}) | |||||
/** | |||||
* couponNum 是否有普通的优惠券购买 | |||||
* couponNum2 是否有新买的消费卡 | |||||
*/ | |||||
let num = wx.getStorageSync('couponNum'); | |||||
let num1 = wx.getStorageSync('couponNum2'); | |||||
if (num == 'couponNum' || num1 == 'couponNum2') { | |||||
wx.showTabBarRedDot({ | |||||
index: 3 | |||||
}) | |||||
} else { | |||||
wx.hideTabBarRedDot({ | |||||
index: 3 | |||||
}) | |||||
} | |||||
if (app.globalData.score) { | |||||
that.setData({ | |||||
fistLogin: app.globalData.score | |||||
}) | |||||
} | |||||
// 如果有游戏 | |||||
setTimeout(function() { | |||||
that.alphaClick(); | |||||
}, 8000) | |||||
}, | |||||
getmemberId: function(token) { | |||||
let that = this; | |||||
Http.get({ | |||||
url: config.api.getScore, | |||||
data: { | |||||
token: token | |||||
} | |||||
}).then(res => { | |||||
that.setData({ | |||||
levelName: res.data.levelName, | |||||
upgradePercent: res.data.upgradePercent, | |||||
upgradeScore: res.data.upgradeScore, | |||||
}) | |||||
if (res.data.nickName) { | |||||
that.setData({ | |||||
memberId: res.data.id | |||||
}) | |||||
var initUrl = JSON.stringify({ | |||||
flagid: res.data.id | |||||
}); | |||||
} | |||||
}) | |||||
.catch(err => { | |||||
wx.showModal({ | |||||
title: '提示', | |||||
content: err.message, | |||||
showCancel: false | |||||
}) | |||||
}) | |||||
}, | |||||
gotoChengzhangzhi: function() { | |||||
wx.navigateTo({ | |||||
url: '/pages/czdetail/czdetail', | |||||
}) | |||||
}, | |||||
gotoBargain: function () { | |||||
wx.navigateTo({ | |||||
url: '/pages/bargain/bargain', | |||||
}) | |||||
}, | |||||
gotoSpellGroup: function () { | |||||
wx.navigateTo({ | |||||
url: '/pages/spellGroup/spellGroup', | |||||
}) | |||||
}, | |||||
gotoCard: function () { | |||||
wx.navigateTo({ | |||||
url: '/pages/discountCardList/discountCardList', | |||||
}) | |||||
}, | |||||
// gotoGame: function () { | |||||
// wx.navigateTo({ | |||||
// url: '/pages/game/index', | |||||
// }) | |||||
// }, | |||||
gotoJfsc: function () { | |||||
wx.navigateTo({ | |||||
url: '/pages/integralmall/index', | |||||
}) | |||||
}, | |||||
/** | |||||
* | |||||
* @param {code,page} | |||||
* 子组件向父组件传值 | |||||
*/ | |||||
onGetCode: function(e) { | |||||
this.setData({ | |||||
code: e.detail.val, | |||||
page: e.detail.pageNum, | |||||
}); | |||||
console.log(e.detail.val) | |||||
console.log(e.detail.pageNum) | |||||
}, | |||||
getWeapNote: function(couponChannelId, couponId, orderId) { | |||||
var that = this; | |||||
// 登录 | |||||
that.getmemberId(app.globalData.token); | |||||
that.getBannerlist(); | |||||
that.topicShow(); | |||||
that.getxsList(); | |||||
that.getMallInfo(app.globalData.token); | |||||
if (app.couponChannelListCallback) { | |||||
app.couponChannelListCallback(app.globalData.token); | |||||
} | |||||
if (app.couponListCallback) { | |||||
app.couponListCallback(app.globalData.token); | |||||
} | |||||
if (app.businessListCallback) { | |||||
app.businessListCallback(app.globalData.token); | |||||
} | |||||
Http.get({ | |||||
url: config.api.getWeapNote, | |||||
data: { | |||||
appId: config.weapp.AppId, | |||||
} | |||||
}) | |||||
.then(res => { | |||||
that.getGameOne(app.globalData.token) | |||||
that.getStaticGame(app.globalData.token) | |||||
let weapNote = JSON.parse(res.data.weapNote); | |||||
that.setData({ | |||||
desc: weapNote.firstpage.desc, | |||||
title: weapNote.firstpage.title | |||||
}) | |||||
}) | |||||
.catch(err => { | |||||
that.getGameOne(app.globalData.token) | |||||
that.getStaticGame(app.globalData.token) | |||||
wx.showModal({ | |||||
title: "提示", | |||||
content: err.errMsg, | |||||
showCancel: false | |||||
}); | |||||
}); | |||||
}, | |||||
getStaticGame(token) { | |||||
let _this = this; | |||||
Http.get({ | |||||
url: config.api.getGame, | |||||
data: { | |||||
triggleAction: 2, // 固定入口 | |||||
token: token | |||||
} | |||||
}).then(res => { | |||||
if (res.data.id) { | |||||
_this.setData({ | |||||
showIf: true, | |||||
newUrl: res.data.imgUrl | |||||
}) | |||||
} else { | |||||
_this.setData({ | |||||
showIf: false | |||||
}) | |||||
} | |||||
_this.setData({ | |||||
staticGamedata: res.data | |||||
}) | |||||
}) | |||||
.catch(err => { | |||||
_this.setData({ | |||||
showIf: false | |||||
}) | |||||
console.log(err) | |||||
}) | |||||
}, | |||||
getGameOne: function(token) { | |||||
let _this = this; | |||||
Http.get({ | |||||
url: config.api.getGame, | |||||
data: { | |||||
triggleAction: 1, // 登录触发 | |||||
token: token | |||||
} | |||||
}).then(res => { | |||||
if (res.data.id) { | |||||
_this.setData({ | |||||
showGame: true, | |||||
}) | |||||
} else { | |||||
_this.setData({ | |||||
showGame: false | |||||
}) | |||||
} | |||||
_this.setData({ | |||||
gamedata: res.data | |||||
}) | |||||
}) | |||||
.catch(err => { | |||||
_this.setData({ | |||||
showGame: false | |||||
}) | |||||
this.alphaClick(); | |||||
}) | |||||
}, | |||||
/** | |||||
* mallinfo | |||||
*/ | |||||
getMallInfo: function(token) { | |||||
let that = this; | |||||
Http.get({ | |||||
url: config.api.getMallInfo, | |||||
data: { | |||||
token: token, | |||||
} | |||||
}).then(res => { | |||||
that.setData({ | |||||
weappShareTitle: res.data.weappShareTitle ? res.data.weappShareTitle : null, | |||||
weappShareCoverImg: res.data.weappShareCoverImg ? res.data.weappShareCoverImg : null, | |||||
}); | |||||
}) | |||||
.catch(err => { | |||||
// 不需要错误提示 | |||||
}); | |||||
}, | |||||
//获取限时抢购列表 | |||||
getxsList(){ | |||||
let that = this; | |||||
Http.get({ | |||||
url: config.api.couponChannelList, | |||||
data: { | |||||
pageNum: 1, | |||||
pageSize: 3, | |||||
targetAd: 2 | |||||
} | |||||
}).then(res => { | |||||
if (res && res.data.total>0) { | |||||
that.setData({ | |||||
xslist: res.data.list, | |||||
showQg:true | |||||
}); | |||||
}else{ | |||||
that.setData({ | |||||
showQg:false | |||||
}) | }) | ||||
} | } | ||||
}) | |||||
.catch(err => { | |||||
console.log(err) | |||||
wx.showToast({ | |||||
title: err.errMsg, | |||||
icon: 'none', | |||||
duration: 2000, | |||||
mask: false | |||||
}); | |||||
}) | |||||
}, | |||||
/** | |||||
* banner | |||||
*/ | |||||
getBannerlist: function() { | |||||
let that = this; | |||||
Http.get({ | |||||
url: config.api.bannerlist, | |||||
data: { | |||||
pageNum: 1, | |||||
pageSize: 7 | |||||
} | |||||
}).then(res => { | |||||
// that.getmemberId(app.globalData.token); | |||||
// that.checkUserCarStatus(); | |||||
that.setData({ | |||||
list: res.data.list | |||||
}); | |||||
}) | |||||
.catch(err => { | |||||
// that.getmemberId(app.globalData.token); | |||||
// that.checkUserCarStatus(); | |||||
}); | |||||
}, | |||||
// 专题显示 | |||||
topicShow: function() { | |||||
let that = this; | |||||
Http.get({ | |||||
url: config.api.topicShow, | |||||
data: { | |||||
token: app.globalData.token | |||||
} | |||||
}).then(res => { | |||||
if (res && res.data) { | |||||
that.setData({ | |||||
name: res.data.name, | |||||
cover: res.data.cover, | |||||
id: res.data.id, | |||||
showTopic: true | |||||
}) | |||||
} else { | |||||
that.setData({ | |||||
showTopic: false | |||||
}) | |||||
} | |||||
}) | |||||
.catch(err => { | |||||
console.log(err); | |||||
}) | |||||
}, | |||||
gotoTopic() { | |||||
wx.navigateTo({ | |||||
url: `/pages/topicDetail/index?id=${this.data.id}` | |||||
}) | |||||
}, | |||||
/** | |||||
* 检查用户是否有车 | |||||
*/ | |||||
// checkUserCarStatus: function() { | |||||
// var that = this; | |||||
// Http.get({ | |||||
// url: config.api.userCarCount, | |||||
// data: {} | |||||
// }).then(res => { | |||||
// if (res.data > 0) { | |||||
// // 用户名下有车 | |||||
// app.globalData.phone = res.data.phone; | |||||
// app.globalData.supportCar = true; | |||||
// // 共同登录 | |||||
// that.userCarLogin(); | |||||
// } | |||||
// }); | |||||
// }, | |||||
/** | |||||
* car共同登录 | |||||
*/ | |||||
// userCarLogin: function() { | |||||
// var that = this; | |||||
// if (!app.globalData.carLogin) { | |||||
// // 共同登录 | |||||
// Http.post({ | |||||
// url: config.api.carInit, | |||||
// data: { | |||||
// phone: app.globalData.phone | |||||
// } | |||||
// }).then(res => { | |||||
// app.globalData.carLogin = true; | |||||
// app.globalData.parkVendor = res.data.vendor; | |||||
// if (res.data.token != "undefined") { | |||||
// app.globalData.etcpToken = res.data.token; | |||||
// } | |||||
// }); | |||||
// } | |||||
// }, | |||||
/** | |||||
* 获取用户信息 | |||||
*/ | |||||
// getUserInfo: function() { | |||||
// // 获取用户信息 | |||||
// wx.getSetting({ | |||||
// success: res => { | |||||
// if (res.authSetting["scope.userInfo"]) { | |||||
// // 已经授权,可以直接调用 getUserInfo 获取头像昵称,不会弹框 | |||||
// wx.getUserInfo({ | |||||
// success: res => { | |||||
// // 可以将 res 发送给后台解码出 unionId | |||||
// } | |||||
// }); | |||||
// } | |||||
// } | |||||
// }); | |||||
// }, | |||||
gotoBargain: function() { | |||||
wx.navigateTo({ | |||||
url: '/pages/bargain/bargain' | |||||
}) | |||||
}, | |||||
/** | |||||
* 刷新 | |||||
*/ | |||||
onPullDownRefresh: function(e) { | |||||
let that = this; | |||||
that.getWeapNote(); | |||||
that.setData({ | |||||
page: 1 | |||||
}) | |||||
if (this.data.optionsData != null && (this.data.optionsData.couponChannelId || this.data.optionsData.orderId)) { | |||||
this.getWeapNote(this.data.optionsData.couponChannelId, this.data.optionsData.orderId); | |||||
} else { | |||||
this.getWeapNote() | |||||
} | } | ||||
if (that.data.code == 0 || that.data.code == undefined) { | |||||
that.selectComponent("#lists").getList(0, 1, "refresh"); | |||||
wx.stopPullDownRefresh(); | |||||
} else { | |||||
that.selectComponent("#lists").getList(that.data.code, 1, "refresh"); | |||||
wx.stopPullDownRefresh(); | |||||
}; | |||||
// 砍价下拉刷新 | |||||
// that.selectComponent("#bargain").getList(); | |||||
// that.selectComponent("#spellGroup").getList(); | |||||
// that.selectComponent("#rushtobyCard").getList(); | |||||
wx.stopPullDownRefresh(); | |||||
//爆款专区下拉刷新 | |||||
that.selectComponent("#hot").getList(); | |||||
that.getxsList(); | |||||
that.topicShow(); | |||||
}, | |||||
//加载更多 | |||||
onReachBottom: function() { | |||||
let that = this; | |||||
that.data.page++; | |||||
that.setData({ | |||||
page: that.data.page | |||||
}); | |||||
console.log("加载更多页数" + that.data.page); | |||||
console.log("加载更多key" + that.data.code); | |||||
//父组件获得子组件的方法 | |||||
//如果code == 0 | |||||
if (that.data.code == 0 || that.data.code == undefined) { | |||||
that.selectComponent("#lists").getList(0, that.data.page); | |||||
} else { | |||||
that.selectComponent("#lists").getList(that.data.code, that.data.page); | |||||
} | |||||
}, | |||||
// 用户点击右上角分享 | |||||
onShareAppMessage: function() { | |||||
return { | |||||
title: this.data.weappShareTitle, | |||||
imageUrl: this.data.weappShareCoverImg, | |||||
// desc: this.data.desc, | |||||
success: function(res) { | |||||
wx.showToast({ | |||||
title: "分享成功", | |||||
duration: 1000, | |||||
icon: "success" | |||||
}); | |||||
} | |||||
}; | |||||
} | } | ||||
}) | |||||
}); |
@@ -1,3 +1,12 @@ | |||||
{ | { | ||||
"usingComponents": {} | |||||
} | |||||
"usingComponents": { | |||||
"c-banner": "../components/banner/index", | |||||
"discount-card": "../components/discountCard/index", | |||||
"c-coupons": "../pages/main/coupons/index", | |||||
"g-entry": "../components/gameentry/gentry", | |||||
"c-hot": "../components/hot/index", | |||||
"navbar": "../components/navbar/navbar" | |||||
}, | |||||
"enablePullDownRefresh": true, | |||||
"navigationBarBackgroundColor": "#F4F5F9" | |||||
} |
@@ -1 +1,93 @@ | |||||
<view class="intro">组件</view> | |||||
<navbar text="首页"></navbar> | |||||
<view class="container" style="padding-top:{{navigationBarHeight}};"> | |||||
<!-- 会员信息 --> | |||||
<view class='userinfo' wx:if="{{ifStoreApp!=1}}"> | |||||
<!-- 头像 --> | |||||
<view class='infoLeft'> | |||||
<view class="user-avatar"> | |||||
<open-data class="open" type="userAvatarUrl"></open-data> | |||||
</view> | |||||
<!-- 成长值 --> | |||||
<view class="user-data fl" bindtap='gotoChengzhangzhi'> | |||||
<view class='nameBox'> | |||||
<open-data type="userNickName"></open-data> | |||||
<view class='chengzhangBox' style='background:{{chengzhangBox}}'> | |||||
<text class='chengzhang'>{{levelName}}</text> | |||||
</view> | |||||
</view> | |||||
<view class="view"> | |||||
<progress percent="{{upgradePercent}}" stroke-width="6" activeColor="{{activeColor}}" /> | |||||
<view class='remainchengzhangzhi'>还需{{upgradeScore}}成长值可升级</view> | |||||
</view> | |||||
</view> | |||||
</view> | |||||
<!-- 二维码 --> | |||||
<view class='qrcode fr' bindtap='qrcode'> | |||||
<image src="{{barcode}}" class='qrcodeimg' mode='widthFix'></image> | |||||
</view> | |||||
</view> | |||||
<!-- banner --> | |||||
<c-banner wx:key="unique" list="{{list}}" /> | |||||
<!-- 频道 --> | |||||
<view class='channelBox' wx:if="{{ifStoreApp!=1}}"> | |||||
<view class='kjBox' bindtap='gotoBargain'> | |||||
<image src='{{kanjia}}' mode='aspectFill'></image> | |||||
<text>砍价</text> | |||||
</view> | |||||
<view class='kjBox' bindtap='gotoSpellGroup'> | |||||
<image src='{{pintuan}}' mode='aspectFill'></image> | |||||
<text>拼团</text> | |||||
</view> | |||||
<view class='kjBox' bindtap='gotoCard'> | |||||
<image src='{{xiaofeika}}' mode='aspectFill'></image> | |||||
<text>消费卡</text> | |||||
</view> | |||||
<view class='kjBox' bindtap='gotogame'> | |||||
<image src='{{xingyun}}' mode='aspectFill' bindtap=''></image> | |||||
<text>游戏频道</text> | |||||
</view> | |||||
<view class='kjBox' bindtap='gotoJfsc'> | |||||
<image src='{{jfshangcheng}}' mode='aspectFill'></image> | |||||
<text>积分商城</text> | |||||
</view> | |||||
</view> | |||||
<!-- 频道 --> | |||||
<view class='channelBox' wx:if="{{ifStoreApp==1}}" style="width:525rpx;"> | |||||
<view class='kjBox' bindtap='gotoBargain'> | |||||
<image src='{{kanjia}}' mode='aspectFill'></image> | |||||
<text>砍价</text> | |||||
</view> | |||||
<view class='kjBox' bindtap='gotoSpellGroup'> | |||||
<image src='{{pintuan}}' mode='aspectFill'></image> | |||||
<text>拼团</text> | |||||
</view> | |||||
<view class='kjBox' bindtap='gotoRushBuy'> | |||||
<image src='{{xiaofeika}}' mode='aspectFill'></image> | |||||
<text>限时抢购</text> | |||||
</view> | |||||
</view> | |||||
<!-- 每日头条 限时抢购 --> | |||||
<view class='toutiao' bindtap='gotoRushBuy' wx:if="{{showQg}}" > | |||||
<view class='imgBox'> | |||||
<image src='{{toutiao}}' mode='aspectFill'></image> | |||||
</view> | |||||
<view> | |||||
今日好物推荐, | |||||
<text>'{{xslist[0].title}}'</text>原价 <text>{{xslist[0].priceStr}}</text> 现价... | |||||
</view> | |||||
<view class='qg' style='border-color:{{qg}}'>抢购</view> | |||||
</view> | |||||
<!-- 爆款专区 --> | |||||
<c-hot id="hot"/> | |||||
<view class='product' wx:if="{{showTopic}}" bindtap='gotoTopic'> | |||||
<image src='{{cover}}' mode='widthFix' ></image> | |||||
</view> | |||||
<c-coupons id="lists" bind:myevent="onGetCode" class="business" loadingtext="{{loadingtext}}" loading="{{loading}}" /> | |||||
<g-entry id="listss" wx:if="{{showGame&&!played&&!havePlayEd}}" gamedata="{{gamedata}}" bind:myevent="" /> | |||||
</view> | |||||
<!-- 顶部签到成长值 --> | |||||
<view class='signin' wx:if="{{fistLogin}}" animation="{{alphaData}}"> | |||||
<open-data class="open" type="userAvatarUrl"></open-data> | |||||
<text class='text'>您今日签到成功,获得{{fistLogin}}成长值</text> | |||||
</view> |
@@ -1,4 +1,482 @@ | |||||
.intro { | |||||
margin: 30px; | |||||
@import "../app.wxss"; | |||||
page{ | |||||
background: #F4F5F9; | |||||
} | |||||
.index-position { | |||||
background: rgba(0, 0, 0, 0.5); | |||||
height: 88rpx; | |||||
position: absolute; | |||||
top: 0; | |||||
width: 100%; | |||||
font-family: PingFangSC-Semibold; | |||||
font-size: 30rpx; | |||||
color: #fff; | |||||
letter-spacing: 0.75rpx; | |||||
z-index: 9; | |||||
line-height: 88rpx; | |||||
overflow: hidden; | |||||
} | |||||
.red{ | |||||
position:absolute; | |||||
width:13rpx; | |||||
height:13rpx; | |||||
border-radius:50%; | |||||
background:red; | |||||
right:-50rpx; | |||||
top:19rpx; | |||||
left:0; | |||||
margin:auto; | |||||
display: none; | |||||
} | |||||
page { | |||||
width: 100%; | |||||
height: auto !important; | |||||
overflow-x: hidden; | |||||
} | |||||
.txt { | |||||
margin-left: 20rpx; | |||||
} | |||||
.game-entry { | |||||
position: fixed; | |||||
right: 27rpx; | |||||
bottom:323rpx; | |||||
width: 120rpx; | |||||
margin: 37rpx auto 0; | |||||
z-index: 10; | |||||
} | |||||
.gameimg { | |||||
display: block; | |||||
width: 100%; | |||||
} | |||||
.userinfo{ | |||||
width:690rpx; | |||||
height: 96rpx; | |||||
border-radius:16rpx; | |||||
display: flex; | |||||
justify-content: space-between; | |||||
margin: 0 auto 30rpx; | |||||
} | |||||
.infoLeft{ | |||||
height: 100%; | |||||
border-radius:12rpx; | |||||
background: #FFF; | |||||
} | |||||
.section { | |||||
padding: 0 20rpx; | |||||
justify-content: space-around; | |||||
text-align: center; | text-align: center; | ||||
} | |||||
margin-top: 25rpx; | |||||
margin-bottom: 30rpx; | |||||
} | |||||
.sellsection{ | |||||
margin-bottom: 37rpx; | |||||
padding: 0 38rpx; | |||||
} | |||||
.section >view,.sellsection>view{ | |||||
width: 25%; | |||||
display: inline-block; | |||||
position: relative; | |||||
} | |||||
.section >view image,.sellsection>view image{ | |||||
display: block; | |||||
margin: 0 auto; | |||||
} | |||||
.section >view image { | |||||
width: 55rpx; | |||||
height: 55rpx; | |||||
margin-top: 20rpx; | |||||
margin-bottom: 14rpx; | |||||
} | |||||
.sellsection>view image{ | |||||
width: 159rpx; | |||||
height: 134rpx; | |||||
} | |||||
.section text { | |||||
font-size: 24rpx; | |||||
color: rgba(51, 51, 51, 1); | |||||
display: block; | |||||
margin-top: 0rpx; | |||||
} | |||||
.showQrcode { | |||||
position: fixed; | |||||
top: 0; | |||||
left: 0; | |||||
right: 0; | |||||
bottom: 0; | |||||
z-index: 1000; | |||||
background: rgba(0, 0, 0, 0.6); | |||||
} | |||||
.qrcode image { | |||||
/* position: absolute; | |||||
top: 0; | |||||
bottom: 0; */ | |||||
margin: 15rpx 20rpx 15rpx; | |||||
z-index:100; | |||||
} | |||||
.showQrcode { | |||||
position: fixed; | |||||
top: 0; | |||||
left: 0; | |||||
right: 0; | |||||
bottom: 0; | |||||
z-index: 1000; | |||||
background: rgba(0, 0, 0, 0.6); | |||||
} | |||||
.canvas-box { | |||||
position: fixed; | |||||
width: 500rpx; | |||||
overflow: hidden; | |||||
left: 0; | |||||
top: 200rpx; | |||||
right: 0; | |||||
margin: auto; | |||||
background: #fff; | |||||
border-radius: 16rpx; | |||||
z-index:100; | |||||
padding-bottom: 30rpx; | |||||
} | |||||
.showQrcode text { | |||||
display: none; | |||||
text-align: center; | |||||
font-size: 28rpx; | |||||
} | |||||
.button { | |||||
width: 414rpx; | |||||
text-align: center; | |||||
margin: 0 auto; | |||||
height: 80rpx; | |||||
line-height: 80rpx; | |||||
background: rgba(255, 255, 255, 1); | |||||
border-radius: 10rpx; | |||||
font-size: 32rpx; | |||||
color: rgba(2, 192, 255, 1); | |||||
overflow: hidden; | |||||
} | |||||
.memberIds{ | |||||
padding-top: 30rpx; | |||||
font-size: 30rpx; | |||||
} | |||||
.search{ | |||||
background:rgba(2, 192, 255, 1); | |||||
height: 50rpx; | |||||
} | |||||
.searchbar{ | |||||
position: relative; | |||||
width: 685rpx; | |||||
height: 76rpx; | |||||
margin: 0 auto; | |||||
text-align: center; | |||||
} | |||||
.searchbar image{ | |||||
width: 40rpx; | |||||
} | |||||
.searchbar text{ | |||||
font-size: 28rpx; | |||||
line-height: 50rpx; | |||||
color: #fff; | |||||
display: inline-block; | |||||
} | |||||
.user-avatar { | |||||
width: 80rpx; | |||||
height: 80rpx; | |||||
border-radius: 50%; | |||||
overflow: hidden; | |||||
float: left; | |||||
margin: 10rpx 10rpx; | |||||
} | |||||
.user-avatar open-data { | |||||
display:block; | |||||
width:100%; | |||||
height:100%; | |||||
} | |||||
.user-data { | |||||
letter-spacing: 0.64rpx; | |||||
line-height: 46rpx; | |||||
font-size: 30rpx; | |||||
color: #333; | |||||
background: #FFF; | |||||
margin-top: 10rpx; | |||||
margin-bottom: 26rpx; | |||||
float: right; | |||||
display: flex; | |||||
flex-direction: column; | |||||
} | |||||
.nameBox open-data{ | |||||
float: left; | |||||
} | |||||
.chengzhangBox{ | |||||
height:32rpx; | |||||
line-height: 26rpx; | |||||
border-radius:9px 9px 9px 0px; | |||||
font-family:PingFangSC-Regular; | |||||
font-weight:400; | |||||
color:rgba(255,255,255,1); | |||||
float: left; | |||||
margin-top: 8rpx; | |||||
} | |||||
.chengzhang { | |||||
font-size: 22rpx; | |||||
font-weight: 400; | |||||
color: #FFFFFF; | |||||
height:22rpx; | |||||
line-height: 22rpx; | |||||
padding: 0 8rpx; | |||||
} | |||||
.integral{ | |||||
margin-left: 70rpx; | |||||
} | |||||
.jifen{ | |||||
display: inline-block; | |||||
height: 34rpx; | |||||
color: #999999; | |||||
font-size:24rpx; | |||||
line-height: 34rpx; | |||||
} | |||||
.jifenNumber{ | |||||
color:#D18B4C; | |||||
font-size: 34rpx; | |||||
line-height: 34rpx; | |||||
margin-left: 10rpx; | |||||
font-weight: bold; | |||||
} | |||||
.view { | |||||
display: flex; | |||||
font-size: 24rpx; | |||||
color: #999999; | |||||
} | |||||
.view>.score{ | |||||
margin-left:9rpx; | |||||
color:#333333; | |||||
font-size:30rpx; | |||||
margin-right:23rpx; | |||||
font-family:PingFang-SC-Bold; | |||||
} | |||||
.qrcode{ | |||||
width: 106rpx; | |||||
height: 96rpx; | |||||
background: #FFF; | |||||
border-radius:12rpx; | |||||
} | |||||
.qrcodeimg{ | |||||
width: 68rpx!important; | |||||
height: 68rpx!important; | |||||
} | |||||
.leftimg{ | |||||
position: absolute; | |||||
right: 40rpx; | |||||
top: 60rpx; | |||||
margin-top: -7rpx; | |||||
width: 14rpx; | |||||
height: 26rpx; | |||||
} | |||||
.duihuanimg{ | |||||
display: block; | |||||
width: 48rpx; | |||||
margin-top: 6rpx; | |||||
} | |||||
.product{ | |||||
width: 710rpx; | |||||
margin: 30rpx auto 10rpx; | |||||
border-radius: 16rpx; | |||||
overflow: hidden; | |||||
} | |||||
.product image{ | |||||
display: block; | |||||
width: 100%; | |||||
} | |||||
.textBox{ | |||||
/* display: block; */ | |||||
width: 400rpx; | |||||
height: 100%; | |||||
float: left; | |||||
margin-left: 10rpx; | |||||
} | |||||
.textBox .name{ | |||||
width: 400rpx; | |||||
font-size: 28rpx; | |||||
color: #3C3C3C; | |||||
margin-top: 20rpx; | |||||
} | |||||
.textBox .title{ | |||||
width: 400rpx; | |||||
font-size: 20rpx; | |||||
color: #A6A6A6; | |||||
margin-top: 10rpx; | |||||
} | |||||
.product .gift{ | |||||
width:88rpx; | |||||
height:88rpx; | |||||
float: left; | |||||
margin-top: 30rpx; | |||||
margin-left: 15rpx; | |||||
} | |||||
.next image{ | |||||
width: 26rpx; | |||||
height: 40rpx; | |||||
} | |||||
.gift image{ | |||||
width:88rpx; | |||||
height:76rpx; | |||||
} | |||||
.product .next{ | |||||
width:32rpx; | |||||
height:60rpx; | |||||
float: right; | |||||
margin-top: 40rpx; | |||||
margin-right: 26rpx; | |||||
} | |||||
#rushtobyCard{ | |||||
margin-top: 30rpx; | |||||
} | |||||
.signin{ | |||||
width: 542rpx; | |||||
height: 94rpx; | |||||
position: fixed; | |||||
top: 0; | |||||
left: 0; | |||||
right: 0; | |||||
z-index: 100; | |||||
margin: auto; | |||||
} | |||||
.signin open-data { | |||||
position: absolute; | |||||
width:90rpx; | |||||
left: 0; | |||||
top: 0; | |||||
bottom: 0; | |||||
height:94rpx; | |||||
margin: auto; | |||||
border-radius: 50%; | |||||
overflow: hidden; | |||||
} | |||||
.signin text{ | |||||
display: block; | |||||
background: rgba(0, 0, 0, 0.5); | |||||
font-size: 28rpx; | |||||
height: 80rpx; | |||||
width: 100%; | |||||
line-height: 80rpx; | |||||
color: #D6D5D5; | |||||
text-indent: 4em; | |||||
border-radius:60rpx; | |||||
margin-top: 7rpx; | |||||
} | |||||
.remainchengzhangzhi{ | |||||
display: block; | |||||
color: #A6A6A6; | |||||
font-size: 22rpx; | |||||
margin-top: 5rpx; | |||||
height: 30rpx; | |||||
line-height: 30rpx; | |||||
float: left; | |||||
margin-left:10rpx; | |||||
width: 255rpx; | |||||
overflow: hidden; | |||||
text-overflow:ellipsis; | |||||
white-space: nowrap; | |||||
} | |||||
progress{ | |||||
width:200rpx; | |||||
border-radius:60rpx; | |||||
overflow:hidden; | |||||
float: left; | |||||
margin-top: 10rpx; | |||||
} | |||||
.channelBox{ | |||||
width:688rpx; | |||||
height: 220rpx; | |||||
margin:0 auto; | |||||
display: flex; | |||||
justify-content: space-between; | |||||
background: #F4F5F9; | |||||
} | |||||
.kjBox{ | |||||
width: 104rpx; | |||||
height: 148rpx; | |||||
font-size: 24rpx; | |||||
color: #A6A6A6; | |||||
margin-top: 46rpx; | |||||
text-align: center; | |||||
} | |||||
.kjBox image{ | |||||
width: 104rpx; | |||||
height: 104rpx; | |||||
} | |||||
.toutiao{ | |||||
width:710rpx; | |||||
height: 82rpx; | |||||
line-height: 82rpx; | |||||
margin:0 auto; | |||||
background: #FFF; | |||||
box-shadow:0px 6rpx 16rpx 0px rgba(236,238,243,1); | |||||
border-radius:12rpx; | |||||
margin-top: 18rpx; | |||||
margin-bottom:18rpx; | |||||
position: relative; | |||||
} | |||||
.toutiao view:nth-child(2){ | |||||
font-size:26rpx; | |||||
font-family:PingFangSC-Regular; | |||||
font-weight:400; | |||||
color:rgba(60,60,60,1); | |||||
float: left; | |||||
width: 500rpx; | |||||
overflow: hidden; | |||||
text-overflow:ellipsis; | |||||
white-space: nowrap; | |||||
} | |||||
.toutiao view:nth-child(2) text:nth-child(1){ | |||||
color: red; | |||||
} | |||||
.toutiao view:nth-child(2) text:nth-child(2){ | |||||
text-decoration: line-through; | |||||
color: red; | |||||
} | |||||
.toutiao .imgBox{ | |||||
width: 64rpx; | |||||
height: 64rpx; | |||||
float: left; | |||||
margin:5rpx 0 5rpx 20rpx; | |||||
} | |||||
.toutiao image{ | |||||
width: 48rpx; | |||||
height: 38rpx; | |||||
margin: auto; | |||||
} | |||||
.toutiao .qg{ | |||||
width: 80rpx; | |||||
height: 44rpx; | |||||
line-height: 44rpx; | |||||
border-radius:18rpx; | |||||
border:2rpx solid; | |||||
position: absolute; | |||||
top: 0; | |||||
bottom: 0; | |||||
right: 20rpx; | |||||
margin: auto; | |||||
font-size:24rpx; | |||||
font-family:PingFangSC-Medium; | |||||
font-weight:500; | |||||
color:#FD782D; | |||||
text-align: center; | |||||
} | |||||
i-tabs i-tabs-scroll{ | |||||
background: #F4F5F9!important; | |||||
} | |||||
@@ -1,11 +1,12 @@ | |||||
const navigationBarHeight = (getApp().statusBarHeight + 50) + 'px' | const navigationBarHeight = (getApp().statusBarHeight + 50) + 'px' | ||||
const extConfig = wx.getExtConfigSync ? wx.getExtConfigSync() : {} | const extConfig = wx.getExtConfigSync ? wx.getExtConfigSync() : {} | ||||
let app = getApp(); | let app = getApp(); | ||||
const format = require("../../utils/util.js"); | |||||
let config = require("../../config/config.js"); | |||||
let Http = require("../../utils/HttpBasics"); | |||||
let Util = require("../../utils/util"); | |||||
const imgurl = require("../../utils/imgurl"); | |||||
const format = require("../utils/util.js"); | |||||
let config = require("../config/config.js"); | |||||
let Http = require("../utils/HttpBasics"); | |||||
let Util = require("../utils/util"); | |||||
const imgurl = require("../utils/imgurl"); | |||||
Page({ | Page({ | ||||
data: { | data: { | ||||
navigationBarHeight, | navigationBarHeight, | ||||
@@ -226,7 +227,12 @@ Page({ | |||||
}) | }) | ||||
}, | }, | ||||
onShow: function (options) { | onShow: function (options) { | ||||
console.log(123) | |||||
if (typeof this.getTabBar === 'function' && | |||||
this.getTabBar()) { | |||||
this.getTabBar().setData({ | |||||
selected: 2 | |||||
}) | |||||
} | |||||
var that = this; | var that = this; | ||||
that.setData({ | that.setData({ | ||||
etcpAppId: extConfig.attr.etcpAppId, | etcpAppId: extConfig.attr.etcpAppId, | ||||
@@ -115,7 +115,7 @@ | |||||
<image src="{{noCoupon}}" mode="widthFix" /> | <image src="{{noCoupon}}" mode="widthFix" /> | ||||
<text class="txt001">请您敬请期待</text> | <text class="txt001">请您敬请期待</text> | ||||
<text class='txt002'>我们正在筹备一大波优惠活动</text> | <text class='txt002'>我们正在筹备一大波优惠活动</text> | ||||
<navigator class='nav' url="/pages/main/index" open-type="switchTab" hover-class="other-navigator-hover"> | |||||
<navigator class='nav' url="/index/index" open-type="switchTab" hover-class="other-navigator-hover"> | |||||
<button hover-class='active'>前往首页看看</button> | <button hover-class='active'>前往首页看看</button> | ||||
</navigator> | </navigator> | ||||
</view> | </view> | ||||
@@ -1,7 +1,7 @@ | |||||
const navigationBarHeight = (getApp().statusBarHeight + 44) + 'px' | const navigationBarHeight = (getApp().statusBarHeight + 44) + 'px' | ||||
const Http = require("../../../utils/HttpBasics"); | |||||
const imgurl = require("../../../utils/imgurl"); | |||||
const config = require("../../../config/config"); | |||||
const Http = require("../utils/HttpBasics"); | |||||
const imgurl = require("../utils/imgurl"); | |||||
const config = require("../config/config"); | |||||
let app = getApp(); | let app = getApp(); | ||||
Page({ | Page({ | ||||
@@ -18,7 +18,7 @@ Page({ | |||||
page:1, | page:1, | ||||
isFirstPage:false, | isFirstPage:false, | ||||
isLastPage:false, | isLastPage:false, | ||||
teljpgUrl: imgurl.teljpg.url, | |||||
teljpgUrl: imgurl.teljpg.url | |||||
}, | }, | ||||
// 左侧点击事件 | // 左侧点击事件 | ||||
jumpIndex(e) { | jumpIndex(e) { | ||||
@@ -53,10 +53,15 @@ Page({ | |||||
}) | }) | ||||
}, | }, | ||||
onShow(){ | onShow(){ | ||||
if (typeof this.getTabBar === 'function' && | |||||
this.getTabBar()) { | |||||
this.getTabBar().setData({ | |||||
selected: 1 | |||||
}) | |||||
} | |||||
let that = this; | let that = this; | ||||
wx.getSystemInfo({ | wx.getSystemInfo({ | ||||
success: function (res) { | success: function (res) { | ||||
console.log(res.windowHeight, navigationBarHeight); | |||||
that.setData({ | that.setData({ | ||||
windowHeight: res.windowHeight + parseInt(navigationBarHeight) | windowHeight: res.windowHeight + parseInt(navigationBarHeight) | ||||
}) | }) | ||||
@@ -1,22 +1,22 @@ | |||||
var app = getApp(); | |||||
const navigationBarHeight = (getApp().statusBarHeight + 44) + 'px' | const navigationBarHeight = (getApp().statusBarHeight + 44) + 'px' | ||||
const extConfig = wx.getExtConfigSync ? wx.getExtConfigSync() : {} | const extConfig = wx.getExtConfigSync ? wx.getExtConfigSync() : {} | ||||
var config = require("../../config/config.js"); | |||||
var app = getApp(); | |||||
const Http = require("../../utils/HttpBasics"); | |||||
const QR = require("../../utils/memberqrcode.js"); | |||||
const imgurl = require("../../utils/imgurl"); | |||||
const bgColor = require("../../utils/bgColor.js") | |||||
let ifStoreApp = extConfig.attr.ifStoreApp; | |||||
const Http = require("../utils/HttpBasics"); | |||||
const imgurl = require("../utils/imgurl"); | |||||
var config = require("../config/config.js"); | |||||
const bgColor = require("../utils/bgColor.js") | |||||
Page({ | Page({ | ||||
/** | /** | ||||
* 页面的初始数据 | * 页面的初始数据 | ||||
*/ | */ | ||||
data: { | data: { | ||||
navigationBarHeight, | navigationBarHeight, | ||||
ifStoreApp:ifStoreApp, | |||||
banneColor: bgColor.colorFirst.user.banneColor, | banneColor: bgColor.colorFirst.user.banneColor, | ||||
levelBg: bgColor.colorFirst.user.levelBg, | levelBg: bgColor.colorFirst.user.levelBg, | ||||
view: bgColor.colorFirst.user.view, | view: bgColor.colorFirst.user.view, | ||||
redirectUrl: imgurl.redirect.url, | redirectUrl: imgurl.redirect.url, | ||||
qrcodeUrl: imgurl.qrcode.url, | |||||
editUrl: imgurl.edit.url, | editUrl: imgurl.edit.url, | ||||
activeUrl: imgurl.active.url, | activeUrl: imgurl.active.url, | ||||
dingUrl: imgurl.ding.url, | dingUrl: imgurl.ding.url, | ||||
@@ -38,12 +38,10 @@ Page({ | |||||
sex: "", | sex: "", | ||||
showEdit: false, | showEdit: false, | ||||
ismember: false, | ismember: false, | ||||
showQrcode: false, | |||||
canvasHidden: false, | canvasHidden: false, | ||||
maskHidden: true, | maskHidden: true, | ||||
imagePath: '', | imagePath: '', | ||||
appVersion: "", | appVersion: "", | ||||
showmemberqrcode: false, | |||||
placeholder: '' | placeholder: '' | ||||
}, | }, | ||||
checkUserStatus() { | checkUserStatus() { | ||||
@@ -66,11 +64,6 @@ Page({ | |||||
url: '/pages/czdetail/czdetail', | url: '/pages/czdetail/czdetail', | ||||
}) | }) | ||||
}, | }, | ||||
navigateTo() { | |||||
wx.navigateTo({ | |||||
url: `/pages/main/index` | |||||
}); | |||||
}, | |||||
showVersion: function() { | showVersion: function() { | ||||
/** | /** | ||||
* 长按显示版本号 | * 长按显示版本号 | ||||
@@ -117,7 +110,6 @@ Page({ | |||||
} | } | ||||
}) | }) | ||||
}, | }, | ||||
/** | /** | ||||
* 用户更新scene | * 用户更新scene | ||||
*/ | */ | ||||
@@ -135,6 +127,19 @@ Page({ | |||||
* 生命周期函数--监听页面显示 | * 生命周期函数--监听页面显示 | ||||
*/ | */ | ||||
onShow: function() { | onShow: function() { | ||||
if (typeof this.getTabBar === 'function' && | |||||
this.getTabBar()) { | |||||
if (ifStoreApp==1){ | |||||
this.getTabBar().setData({ | |||||
selected: 1 | |||||
}) | |||||
}else{ | |||||
this.getTabBar().setData({ | |||||
selected: 3 | |||||
}) | |||||
} | |||||
} | |||||
let that = this; | let that = this; | ||||
that.checkUserStatus(); | that.checkUserStatus(); | ||||
that.setData({ | that.setData({ | ||||
@@ -149,9 +154,6 @@ Page({ | |||||
wx.hideTabBarRedDot({ | wx.hideTabBarRedDot({ | ||||
index: 3 | index: 3 | ||||
}); | }); | ||||
wx.hideTabBarRedDot({ | |||||
index: 3 | |||||
}); | |||||
if (num == 'couponNum1') { | if (num == 'couponNum1') { | ||||
wx.setStorage({ | wx.setStorage({ | ||||
key: 'couponNum', | key: 'couponNum', | ||||
@@ -201,7 +203,6 @@ Page({ | |||||
var initUrl = JSON.stringify({ | var initUrl = JSON.stringify({ | ||||
flagid: res.data.id | flagid: res.data.id | ||||
}); | }); | ||||
that.createQrCode(initUrl, "mycanvas1", size.w, size.h); | |||||
} | } | ||||
}) | }) | ||||
.catch(err => { | .catch(err => { | ||||
@@ -214,12 +215,6 @@ Page({ | |||||
//暂时注释 | //暂时注释 | ||||
// that.getrun(); | // that.getrun(); | ||||
}, | }, | ||||
hideQrcode: function() { | |||||
let that = this; | |||||
that.setData({ | |||||
showQrcode: false | |||||
}) | |||||
}, | |||||
//适配不同屏幕大小的canvas | //适配不同屏幕大小的canvas | ||||
setCanvasSize: function() { | setCanvasSize: function() { | ||||
var size = {}; | var size = {}; | ||||
@@ -237,52 +232,5 @@ Page({ | |||||
console.log("获取设备信息失败" + e); | console.log("获取设备信息失败" + e); | ||||
} | } | ||||
return size; | return size; | ||||
}, | |||||
createQrCode: function(url, canvasId, cavW, cavH) { | |||||
//调用插件中的draw方法,绘制二维码图片 | |||||
QR.api.draw(url, canvasId, cavW, cavH); | |||||
}, | |||||
qrcode: function(e) { | |||||
var that = this; | |||||
that.setData({ | |||||
showQrcode: true | |||||
}) | |||||
wx.showToast({ | |||||
title: '生成中...', | |||||
icon: 'loading', | |||||
duration: 2000 | |||||
}); | |||||
var st = setTimeout(function() { | |||||
wx.hideToast() | |||||
var size = that.setCanvasSize(); | |||||
var url = JSON.stringify({ | |||||
END: "C", | |||||
TYPE: "memberCode", | |||||
ID: that.data.memberId, | |||||
}) | |||||
that.createQrCode(url, "mycanvas1", size.w, size.h); | |||||
that.setData({ | |||||
maskHidden: true | |||||
}); | |||||
clearTimeout(st); | |||||
}, 1000) | |||||
}, | |||||
close: function() { | |||||
this.setData({ | |||||
showmemberqrcode: false, | |||||
}) | |||||
} | } | ||||
}); | }); | ||||
Component({ | |||||
pageLifetimes: { | |||||
show() { | |||||
if (typeof this.getTabBar === 'function' && | |||||
this.getTabBar()) { | |||||
this.getTabBar().setData({ | |||||
selected: 0 | |||||
}) | |||||
} | |||||
} | |||||
} | |||||
}) |
@@ -1,7 +1,7 @@ | |||||
{ | { | ||||
"usingComponents": { | "usingComponents": { | ||||
"i-button": "../../dist/button/index", | |||||
"navbar": "../../components/navbar/navbar" | |||||
"i-button": "../dist/button/index", | |||||
"navbar": "../components/navbar/navbar" | |||||
}, | }, | ||||
"navigationBarBackgroundColor": "#FD832D", | "navigationBarBackgroundColor": "#FD832D", | ||||
"navigationBarTextStyle": "white", | "navigationBarTextStyle": "white", | ||||
@@ -1,7 +1,7 @@ | |||||
<navbar text="我的" background='#FD832D' color="white"></navbar> | <navbar text="我的" background='#FD832D' color="white"></navbar> | ||||
<view class="user" style="padding-top:{{navigationBarHeight}};"> | <view class="user" style="padding-top:{{navigationBarHeight}};"> | ||||
<view class="top" style='background:{{banneColor}}'></view> | <view class="top" style='background:{{banneColor}}'></view> | ||||
<view class="top-content"> | |||||
<view class="top-content" wx:if="{{ifStoreApp!=1}}"> | |||||
<view class='user_title '> | <view class='user_title '> | ||||
<view class="user-avatar" bindtap='gotoedit'> | <view class="user-avatar" bindtap='gotoedit'> | ||||
<open-data class="open" type="userAvatarUrl"></open-data> | <open-data class="open" type="userAvatarUrl"></open-data> | ||||
@@ -49,7 +49,7 @@ | |||||
</view> | </view> | ||||
</view> | </view> | ||||
</view> | </view> | ||||
<view class='btns_bg'> | |||||
<view class='btns_bg' wx:if="{{ifStoreApp!=1}}"> | |||||
<view class="user-btns"> | <view class="user-btns"> | ||||
<!-- 我的砍价 --> | <!-- 我的砍价 --> | ||||
<navigator url="/pages/bargain/bargain?from=myhtml" open-type="navigate"> | <navigator url="/pages/bargain/bargain?from=myhtml" open-type="navigate"> | ||||
@@ -87,6 +87,50 @@ | |||||
</navigator> | </navigator> | ||||
</view> | </view> | ||||
</view> | </view> | ||||
<!-- 小马快店样式 --> | |||||
<view class="top-content" wx:if="{{ifStoreApp==1}}"> | |||||
<view class='user_title '> | |||||
<view class="user-avatar" bindtap='gotoedit'> | |||||
<open-data class="open" type="userAvatarUrl"></open-data> | |||||
</view> | |||||
<view class="user-name" bindtap='gotoedit'> | |||||
<open-data class="name" type="userNickName" ></open-data> | |||||
</view> | |||||
<view class="user-btns"> | |||||
<!-- 我的订单 --> | |||||
<navigator url="/pages/order/index/index?id=all"> | |||||
<view class="user-btn app-border-bottom"> | |||||
<view> | |||||
<image class='icons' src="{{dingUrl}}" mode='widthFix'></image>我的订单</view> | |||||
</view> | |||||
</navigator> | |||||
<!-- 我的券包 --> | |||||
<navigator url="/pages/couponorder/index/index"> | |||||
<view class="user-btn app-border-bottom"> | |||||
<view> | |||||
<image class='icons' src="{{quansUrl}}" mode='widthFix'></image>我的券包</view> | |||||
<view> | |||||
<text class="couponnum" wx:if="{{couponNum=='couponNum'}}"></text> | |||||
</view> | |||||
</view> | |||||
</navigator> | |||||
<!-- 我的砍价 --> | |||||
<navigator url="/pages/bargain/bargain?from=myhtml" open-type="navigate"> | |||||
<view class="user-btn app-border-bottom"> | |||||
<view> | |||||
<image class='icons' src="{{wmbarginicon}}" mode='widthFix'></image>我的砍价</view> | |||||
</view> | |||||
</navigator> | |||||
<!-- 我的拼团 --> | |||||
<navigator url="/pages/spellGroup/spellGroup?from=myhtml" open-type="navigate"> | |||||
<view class="user-btn app-border-bottom"> | |||||
<view> | |||||
<image class='icons' src="{{wmspellgroup}}" mode='widthFix'></image>我的拼团</view> | |||||
</view> | |||||
</navigator> | |||||
</view> | |||||
</view> | |||||
</view> | |||||
<view class="margin"></view> | <view class="margin"></view> | ||||
<view bindlongtap='showVersion' class='version'> | <view bindlongtap='showVersion' class='version'> | ||||
<view wx:if="{{flag=='show'}}">版本号:{{appVersion}}</view> | <view wx:if="{{flag=='show'}}">版本号:{{appVersion}}</view> | ||||
@@ -95,10 +139,4 @@ | |||||
<view class='of' wx:if="{{canIUse}}"> | <view class='of' wx:if="{{canIUse}}"> | ||||
<official-account class="gzh"></official-account> | <official-account class="gzh"></official-account> | ||||
</view> | </view> | ||||
</view> | |||||
<view class='showQrcode' bindtap='hideQrcode' wx:if="{{showQrcode}}"> | |||||
<view class="canvas-box"> | |||||
<canvas hidden="{{canvasHidden}}" style="height:500rpx;background:0 0 0 .6;margin-top:10rpx;" canvas-id="mycanvas1" /> | |||||
<text class='memberIds'>会员ID{{memberId}}</text> | |||||
</view> | |||||
</view> | </view> |
@@ -57,7 +57,7 @@ Page({ | |||||
}, | }, | ||||
goback: function () { | goback: function () { | ||||
wx.switchTab({ | wx.switchTab({ | ||||
url: '/pages/main/index', | |||||
url: '/index/index', | |||||
}) | }) | ||||
} | } | ||||
}) | }) |
@@ -72,7 +72,7 @@ Page({ | |||||
jumpTo: function () { | jumpTo: function () { | ||||
// 返回 | // 返回 | ||||
wx.navigateBack({ | wx.navigateBack({ | ||||
url: '/pages/passCar/passCar' | |||||
url: '/index/passCar' | |||||
}) | }) | ||||
}, | }, | ||||
handleTap: function (e) { | handleTap: function (e) { | ||||
@@ -358,7 +358,7 @@ Page({ | |||||
} | } | ||||
else{ | else{ | ||||
wx.navigateBack({ | wx.navigateBack({ | ||||
url: '/pages/passCar/passCar?addcar=' + carNumber, | |||||
url: '/index/passCar?addcar=' + carNumber, | |||||
}) | }) | ||||
} | } | ||||
} | } | ||||
@@ -45,7 +45,7 @@ Page({ | |||||
}, | }, | ||||
goback: function () { | goback: function () { | ||||
wx.switchTab({ | wx.switchTab({ | ||||
url: '/pages/main/index', | |||||
url: '/index/index', | |||||
}) | }) | ||||
}, | }, | ||||
}); | }); |
@@ -33,7 +33,7 @@ Page({ | |||||
}, | }, | ||||
goback: function () { | goback: function () { | ||||
wx.switchTab({ | wx.switchTab({ | ||||
url: '/pages/main/index', | |||||
url: '/index/index', | |||||
}) | }) | ||||
}, | }, | ||||
onLoad: function (options) { | onLoad: function (options) { | ||||
@@ -78,7 +78,7 @@ Page({ | |||||
}, | }, | ||||
goback: function () { | goback: function () { | ||||
wx.switchTab({ | wx.switchTab({ | ||||
url: '/pages/main/index', | |||||
url: '/index/index', | |||||
}) | }) | ||||
}, | }, | ||||
/** | /** | ||||
@@ -37,7 +37,7 @@ Page({ | |||||
}, | }, | ||||
goback: function () { | goback: function () { | ||||
wx.switchTab({ | wx.switchTab({ | ||||
url: '/pages/main/index', | |||||
url: '/index/index', | |||||
}) | }) | ||||
}, | }, | ||||
onLoad: function() { | onLoad: function() { | ||||
@@ -10,7 +10,7 @@ | |||||
<image src="{{noCoupon}}" mode="widthFix" /> | <image src="{{noCoupon}}" mode="widthFix" /> | ||||
<text class="txt001">请您敬请期待</text> | <text class="txt001">请您敬请期待</text> | ||||
<text class='txt002'>我们正在筹备一大波优惠活动</text> | <text class='txt002'>我们正在筹备一大波优惠活动</text> | ||||
<navigator class='nav' url="/pages/main/index" open-type="switchTab" hover-class="other-navigator-hover"> | |||||
<navigator class='nav' url="/index/index" open-type="switchTab" hover-class="other-navigator-hover"> | |||||
<button hover-class='active'>前往首页看看</button> | <button hover-class='active'>前往首页看看</button> | ||||
</navigator> | </navigator> | ||||
</view> | </view> | ||||
@@ -204,7 +204,7 @@ Page({ | |||||
}, | }, | ||||
goback: function() { | goback: function() { | ||||
wx.switchTab({ | wx.switchTab({ | ||||
url: '/pages/main/index', | |||||
url: '/index/index', | |||||
}) | }) | ||||
}, | }, | ||||
/** | /** | ||||
@@ -54,7 +54,7 @@ Page({ | |||||
}, | }, | ||||
goback: function () { | goback: function () { | ||||
wx.switchTab({ | wx.switchTab({ | ||||
url: '/pages/main/index', | |||||
url: '/index/index', | |||||
}) | }) | ||||
}, | }, | ||||
//点击跳转到券详情页面 | //点击跳转到券详情页面 | ||||
@@ -10,7 +10,7 @@ | |||||
<image src="{{couponUrl}}" mode="widthFix" /> | <image src="{{couponUrl}}" mode="widthFix" /> | ||||
<text class="txt001">请您敬请期待</text> | <text class="txt001">请您敬请期待</text> | ||||
<text class='txt002'>我们正在筹备一大波优惠活动</text> | <text class='txt002'>我们正在筹备一大波优惠活动</text> | ||||
<navigator class='nav' url="/pages/main/index" open-type="switchTab" hover-class="other-navigator-hover"> | |||||
<navigator class='nav' url="/index/index" open-type="switchTab" hover-class="other-navigator-hover"> | |||||
<button hover-class='active'>前往首页看看</button> | <button hover-class='active'>前往首页看看</button> | ||||
</navigator> | </navigator> | ||||
</view> | </view> | ||||
@@ -40,7 +40,7 @@ Page({ | |||||
}, | }, | ||||
goback: function () { | goback: function () { | ||||
wx.switchTab({ | wx.switchTab({ | ||||
url: '/pages/main/index', | |||||
url: '/index/index', | |||||
}) | }) | ||||
}, | }, | ||||
onLoad(options) { | onLoad(options) { | ||||
@@ -13,7 +13,7 @@ | |||||
<image src="{{noCoupon}}" mode="aspectFill" lazy-load="true" /> | <image src="{{noCoupon}}" mode="aspectFill" lazy-load="true" /> | ||||
<text class="txt001">请您敬请期待</text> | <text class="txt001">请您敬请期待</text> | ||||
<text class='txt002'>我们正在筹备一大波优惠活动</text> | <text class='txt002'>我们正在筹备一大波优惠活动</text> | ||||
<navigator class='nav' url="/pages/main/index" open-type="switchTab" hover-class="other-navigator-hover"> | |||||
<navigator class='nav' url="/index/index" open-type="switchTab" hover-class="other-navigator-hover"> | |||||
<button hover-class='active'>前往首页看看</button> | <button hover-class='active'>前往首页看看</button> | ||||
</navigator> | </navigator> | ||||
</view> | </view> | ||||
@@ -116,7 +116,7 @@ Page({ | |||||
}) | }) | ||||
} else if (that.data.mineFlag == 'mine'){ | } else if (that.data.mineFlag == 'mine'){ | ||||
wx.switchTab({ | wx.switchTab({ | ||||
url: '/pages/user/index' | |||||
url: '/index/user' | |||||
}); | }); | ||||
} else { | } else { | ||||
wx.showToast({ | wx.showToast({ | ||||
@@ -129,7 +129,7 @@ Page({ | |||||
}) | }) | ||||
} else { | } else { | ||||
wx.switchTab({ | wx.switchTab({ | ||||
url: '/pages/passCar/passCar', | |||||
url: '/index/passCar', | |||||
}) | }) | ||||
} | } | ||||
} | } | ||||
@@ -177,12 +177,12 @@ Page({ | |||||
} else if (app.globalData.type == 'uc') { | } else if (app.globalData.type == 'uc') { | ||||
// 我的 | // 我的 | ||||
wx.switchTab({ | wx.switchTab({ | ||||
url: '/pages/user/index' | |||||
url: '/index/user' | |||||
}); | }); | ||||
} else if (app.globalData.type == 'in') { | } else if (app.globalData.type == 'in') { | ||||
// 首页 | // 首页 | ||||
wx.switchTab({ | wx.switchTab({ | ||||
url: '/pages/main/index' | |||||
url: '/index/index' | |||||
}); | }); | ||||
} | } | ||||
// 积分 | // 积分 | ||||
@@ -193,7 +193,7 @@ Page({ | |||||
}else if (app.globalData.type == 'pc') { | }else if (app.globalData.type == 'pc') { | ||||
// 停车 | // 停车 | ||||
wx.switchTab({ | wx.switchTab({ | ||||
url: '/pages/passCar/passCar' | |||||
url: '/index/passCar' | |||||
}); | }); | ||||
} else if (app.globalData.type == 'mc') { | } else if (app.globalData.type == 'mc') { | ||||
// 我的券包 | // 我的券包 | ||||
@@ -254,11 +254,11 @@ Page({ | |||||
else if (app.globalData.type == 'ml') { | else if (app.globalData.type == 'ml') { | ||||
// 门店 | // 门店 | ||||
wx.switchTab({ | wx.switchTab({ | ||||
url: '/pages/index/searchbar/index' | |||||
url: '/index/searchbar' | |||||
}); | }); | ||||
} else { | } else { | ||||
wx.switchTab({ | wx.switchTab({ | ||||
url: "/pages/main/index" | |||||
url: "/index/index" | |||||
}); | }); | ||||
} | } | ||||
} | } | ||||
@@ -229,7 +229,7 @@ Page({ | |||||
// 我的 | // 我的 | ||||
else if (app.globalData.type == 'uc') { | else if (app.globalData.type == 'uc') { | ||||
wx.switchTab({ | wx.switchTab({ | ||||
url: '/pages/user/index' | |||||
url: '/index/user' | |||||
}); | }); | ||||
} | } | ||||
// 积分 | // 积分 | ||||
@@ -241,14 +241,14 @@ Page({ | |||||
// 首页 | // 首页 | ||||
else if (app.globalData.type == 'in') { | else if (app.globalData.type == 'in') { | ||||
wx.switchTab({ | wx.switchTab({ | ||||
url: '/pages/main/index' | |||||
url: '/index/index' | |||||
}); | }); | ||||
} | } | ||||
// 停车 | // 停车 | ||||
else if (app.globalData.type == 'pc') { | else if (app.globalData.type == 'pc') { | ||||
// 停车 | // 停车 | ||||
wx.switchTab({ | wx.switchTab({ | ||||
url: '/pages/passCar/passCar' | |||||
url: '/index/passCar' | |||||
}); | }); | ||||
} | } | ||||
// 我的券包 | // 我的券包 | ||||
@@ -324,7 +324,7 @@ Page({ | |||||
// 门店 | // 门店 | ||||
else if (app.globalData.type == 'ml') { | else if (app.globalData.type == 'ml') { | ||||
wx.switchTab({ | wx.switchTab({ | ||||
url: '/pages/index/searchbar/index' | |||||
url: '/index/searchbar' | |||||
}) | }) | ||||
} | } | ||||
// 通过分享进入的门店详情 | // 通过分享进入的门店详情 | ||||
@@ -335,7 +335,7 @@ Page({ | |||||
}else { | }else { | ||||
// 主页 | // 主页 | ||||
wx.switchTab({ | wx.switchTab({ | ||||
url: '/pages/main/index' | |||||
url: '/index/index' | |||||
}) | }) | ||||
} | } | ||||
}) | }) | ||||
@@ -41,7 +41,7 @@ Page({ | |||||
}, | }, | ||||
goback: function () { | goback: function () { | ||||
wx.switchTab({ | wx.switchTab({ | ||||
url: '/pages/main/index', | |||||
url: '/index/index', | |||||
}) | }) | ||||
}, | }, | ||||
/** | /** | ||||
@@ -1,156 +0,0 @@ | |||||
const navigationBarHeight = (getApp().statusBarHeight + 44) + 'px' | |||||
const Http = require("../../../utils/HttpBasics"); | |||||
const imgurl = require("../../../utils/imgurl"); | |||||
const config = require("../../../config/config"); | |||||
let app = getApp(); | |||||
Page({ | |||||
/** | |||||
* 页面的初始数据 | |||||
*/ | |||||
data: { | |||||
navigationBarHeight, | |||||
lists: [], | |||||
merchantVoList:[], | |||||
indexId: 0, | |||||
businessId:0, | |||||
windowHeight:"", | |||||
page:1, | |||||
isFirstPage:false, | |||||
isLastPage:false, | |||||
teljpgUrl: imgurl.teljpg.url, | |||||
}, | |||||
// 左侧点击事件 | |||||
jumpIndex(e) { | |||||
let that = this; | |||||
let index = e.currentTarget.dataset.menuindex; | |||||
that.setData({ | |||||
indexId: index, | |||||
businessId: index | |||||
}); | |||||
that.setData({ | |||||
page:1 | |||||
}) | |||||
that.getList(1, that.data.businessId); | |||||
}, | |||||
/** | |||||
* 跳转到门店列表的详情页面 | |||||
*/ | |||||
gotoDetail(e){ | |||||
wx.navigateTo({ | |||||
url: `/pages/index/searchbar/detail/index?id=${e.currentTarget.dataset.id}` | |||||
}) | |||||
}, | |||||
/** | |||||
* 生命周期函数--监听页面加载 | |||||
*/ | |||||
onLoad: function (options) { | |||||
let that = this; | |||||
that.getBussiness(); | |||||
that.getList(1, 0); | |||||
wx.showLoading({ | |||||
title: '加载中...', | |||||
}) | |||||
}, | |||||
onShow(){ | |||||
let that = this; | |||||
wx.getSystemInfo({ | |||||
success: function (res) { | |||||
console.log(res.windowHeight, navigationBarHeight); | |||||
that.setData({ | |||||
windowHeight: res.windowHeight + parseInt(navigationBarHeight) | |||||
}) | |||||
}, | |||||
}) | |||||
}, | |||||
getBussiness:function(){ | |||||
let that = this; | |||||
Http.get({ | |||||
url: config.api.businessList, | |||||
data:{ | |||||
filter:1 | |||||
} | |||||
}).then(res => { | |||||
that.setData({ | |||||
lists: [{ id: 0, title: "全部", type: 1 }].concat(res.data) | |||||
}); | |||||
}) | |||||
.catch(err => { | |||||
wx.showToast({ | |||||
title: err.errMsg, | |||||
icon: 'none', | |||||
duration: 2000, | |||||
mask: false | |||||
}); | |||||
}) | |||||
}, | |||||
getList: function (page, businessId) { | |||||
let that = this; | |||||
let data; | |||||
if(businessId == 0){ | |||||
data = { | |||||
pageNum: page, | |||||
pageSize: 8 | |||||
} | |||||
}else{ | |||||
data = { | |||||
pageNum: page, | |||||
pageSize: 8, | |||||
businessId: businessId | |||||
} | |||||
} | |||||
Http.get({ | |||||
url: config.api.merchantList, | |||||
data: data | |||||
}).then(res => { | |||||
wx.hideLoading(); | |||||
if (page == 1) { | |||||
that.setData({ | |||||
merchantVoList: [], | |||||
}) | |||||
} | |||||
var tmpArr = that.data.merchantVoList; | |||||
tmpArr.push.apply(tmpArr, res.data.list); | |||||
// console.log(tmpArr) | |||||
that.setData({ | |||||
merchantVoList: tmpArr, | |||||
isFirstPage: res.data.isFirstPage, | |||||
isLastPage: res.data.isLastPage | |||||
}) | |||||
// console.log(that.data.merchantVoList) | |||||
}) | |||||
.catch(err => { | |||||
wx.hideLoading(); | |||||
wx.showToast({ | |||||
title: err.errMsg, | |||||
icon: 'none', | |||||
duration: 2000, | |||||
mask: false | |||||
}); | |||||
}) | |||||
}, | |||||
phone: function (e) { | |||||
let that = this; | |||||
if (e.currentTarget.dataset.merchantlinkphone) { | |||||
wx.makePhoneCall({ | |||||
phoneNumber: e.currentTarget.dataset.merchantlinkphone | |||||
}) | |||||
} | |||||
}, | |||||
/** | |||||
* 页面上拉触底事件的处理函数 | |||||
*/ | |||||
onReachBottom: function () { | |||||
let that = this; | |||||
that.data.page++; | |||||
that.setData({ | |||||
page: that.data.page | |||||
}); | |||||
console.log(that.data.page); | |||||
// 如果是最后一页 | |||||
//就不发送请求 | |||||
if (!that.data.isLastPage || that.data.isFirstPage && that.data.isLastPage){ | |||||
that.getList(that.data.page, that.data.businessId); | |||||
} | |||||
} | |||||
}) |
@@ -1,8 +0,0 @@ | |||||
{ | |||||
"navigationBarTitleText": "门店", | |||||
"navigationBarBackgroundColor": "#F4F5F9", | |||||
"navigationBarTextStyle": "black", | |||||
"usingComponents": { | |||||
"navbar": "../../../components/navbar/navbar" | |||||
} | |||||
} |
@@ -1,43 +0,0 @@ | |||||
<navbar text="门店"></navbar> | |||||
<!-- 左侧滚动栏 --> | |||||
<view style="padding-top:{{navigationBarHeight}}"> | |||||
<view class='under_line'></view> | |||||
<view style='float: left' class='left'> | |||||
<scroll-view scroll-y scroll-with-animation scroll-left="{{scrollLength}}" class='scrollY' style='height: {{windowHeight}}px;top:{{navigationBarHeight}}'> | |||||
<view class='all clear'> | |||||
<block wx:for="{{lists}}" wx:key="{{index}}"> | |||||
<view bindtap='jumpIndex' data-menuindex='{{item.id}}'> | |||||
<view class="{{indexId==item.id?'text-style':'text-styleHover'}}"> | |||||
<text class="{{indexId==item.id?'active1':''}}">{{item.title}}</text> | |||||
<text class="{{indexId==item.id?'active':''}}"></text> | |||||
</view> | |||||
</view> | |||||
</block> | |||||
</view> | |||||
</scroll-view> | |||||
</view> | |||||
<view class='lists'> | |||||
<view class='posi' wx:if="{{merchantVoList.length>0}}"> | |||||
<view class='posi_logo' wx:for="{{merchantVoList}}" wx:key="index"> | |||||
<view class='merchants' bindtap='gotoDetail' data-id='{{item.id}}'> | |||||
<view style=' margin-left: 24rpx;margin-top: 24rpx;'> | |||||
<image src='{{item.merchantImgUrl}}'></image> | |||||
</view> | |||||
<view class='leftBox'> | |||||
<view class='merchantName'>{{item.merchantName}}</view> | |||||
<view class='shopVo'> | |||||
<view class='shopVoList' > | |||||
<text wx:for="{{item.shopVoList}}" wx:key="{{index}}" wx:for-item="itemName">{{itemName.buildingName}}{{itemName.floorName}}--{{itemName.shopNumber}}</text> | |||||
</view> | |||||
</view> | |||||
</view> | |||||
</view> | |||||
<image wx:if="{{item.linkLinePhone}}" bindtap='phone' data-merchantLinkPhone='{{item.linkLinePhone}}' class="tel" src="{{teljpgUrl}}" mode="widthFix" /> | |||||
</view> | |||||
</view> | |||||
<view class='position' wx:if="{{merchantVoList.length==0}}"> | |||||
暂无数据 | |||||
</view> | |||||
</view> | |||||
</view> |
@@ -1,158 +0,0 @@ | |||||
.under_line{ | |||||
width: 100%; | |||||
} | |||||
.scrollY { | |||||
width: 134rpx; | |||||
position: fixed; | |||||
left: 0; | |||||
background:#F4F5F9; | |||||
} | |||||
.text-style { | |||||
position: relative; | |||||
width: 139rpx; | |||||
height: 100rpx; | |||||
line-height: 100rpx; | |||||
text-align: center; | |||||
font-size: 30rpx; | |||||
font-family: PingFangSC-Semibold; | |||||
color: #3C3C3C; | |||||
background: #FFFFFF; | |||||
font-weight:500; | |||||
} | |||||
.text-styleHover{ | |||||
position: relative; | |||||
width: 139rpx; | |||||
height: 100rpx; | |||||
line-height: 100rpx; | |||||
text-align: center; | |||||
font-size: 26rpx; | |||||
font-family: PingFangSC-Semibold; | |||||
color: #A6A6A6; | |||||
} | |||||
.text-style text{ | |||||
font-size: 26rpx; | |||||
} | |||||
.active1 { | |||||
font-size: 26rpx!important; | |||||
} | |||||
.active { | |||||
position: absolute; | |||||
left: 4rpx; | |||||
bottom: 0rpx; | |||||
top:0; | |||||
margin: auto; | |||||
width:12rpx; | |||||
height:24rpx; | |||||
background:linear-gradient(127deg,rgba(252,177,74,1) 0%,rgba(254,70,20,1) 100%); | |||||
border-radius:7rpx; | |||||
} | |||||
.posi { | |||||
position: relative; | |||||
width: 616rpx; | |||||
float: right; | |||||
} | |||||
.posi>view:nth-child(2) { | |||||
width: 100%; | |||||
display: flex; | |||||
justify-content: space-between; | |||||
box-sizing: border-box; | |||||
} | |||||
.posi>view:nth-child(2) text:nth-child(1) { | |||||
font-size: 30rpx; | |||||
color: #a9a9a9; | |||||
} | |||||
.posi>view:nth-child(2) text:nth-child(2) { | |||||
font-size: 30rpx; | |||||
color: #a9a9a9; | |||||
} | |||||
.posi_logo { | |||||
position: relative; | |||||
width:576rpx!important; | |||||
height:176rpx; | |||||
background:rgba(255,255,255,1); | |||||
box-shadow:0px 4rpx 8rpx 0px rgba(0,0,0,0.04); | |||||
border-radius:16rpx; | |||||
margin: 20rpx; | |||||
overflow: hidden; | |||||
} | |||||
.tel { | |||||
position: absolute; | |||||
right: 3%; | |||||
top: 0; | |||||
bottom: 0; | |||||
margin: auto; | |||||
width: 50rpx; | |||||
height: 50rpx; | |||||
} | |||||
.merchants{ | |||||
width: 90%; | |||||
display: flex; | |||||
background: #fff; | |||||
padding-right:5%; | |||||
overflow: hidden; | |||||
} | |||||
.position{ | |||||
text-align: center; | |||||
margin-top: 100rpx; | |||||
color: #999; | |||||
} | |||||
.leftBox{ | |||||
padding: 20rpx 0; | |||||
} | |||||
.merchants view:nth-child(1) image { | |||||
display: block; | |||||
width: 120rpx; | |||||
height: 120rpx; | |||||
border-radius: 16rpx; | |||||
} | |||||
.shopVo{ | |||||
margin-left: 20rpx; | |||||
} | |||||
.merchantName{ | |||||
color: #3C3C3C; | |||||
font-size: 32rpx; | |||||
margin-left: 20rpx; | |||||
width: 60%; | |||||
overflow: hidden; | |||||
text-overflow:ellipsis; | |||||
white-space: nowrap; | |||||
margin-top: 10rpx; | |||||
} | |||||
.shopVo text{ | |||||
float: left; | |||||
} | |||||
page { | |||||
padding: 0 0 30rpx; | |||||
} | |||||
.text{ | |||||
display: block; | |||||
width: 25%; | |||||
text-align: center; | |||||
} | |||||
.view view:nth-of-type(1) { | |||||
font-size: 28rpx; | |||||
color: #888; | |||||
} | |||||
.shopVoList{ | |||||
padding-left: 0!important; | |||||
display: inline-block!important; | |||||
width: 345rpx; | |||||
white-space: nowrap; | |||||
text-overflow: ellipsis; | |||||
overflow: hidden; | |||||
} | |||||
.shopVoList text{ | |||||
font-size: 20rpx!important; | |||||
color: #b8b8b8!important; | |||||
margin-right: 10rpx; | |||||
} |
@@ -43,7 +43,7 @@ Page({ | |||||
}, | }, | ||||
goback: function () { | goback: function () { | ||||
wx.switchTab({ | wx.switchTab({ | ||||
url: '/pages/main/index', | |||||
url: '/index/index', | |||||
}) | }) | ||||
}, | }, | ||||
onLoad: function (options) { | onLoad: function (options) { | ||||
@@ -70,7 +70,7 @@ Page({ | |||||
*/ | */ | ||||
gotoIndex(){ | gotoIndex(){ | ||||
wx.switchTab({ | wx.switchTab({ | ||||
url: '/pages/main/index', | |||||
url: '/index/index', | |||||
}) | }) | ||||
}, | }, | ||||
/** | /** | ||||
@@ -1,663 +0,0 @@ | |||||
const navigationBarHeight = (getApp().statusBarHeight + 60) + 'px' | |||||
const Http = require("../../utils/HttpBasics"); | |||||
const imgurl = require("../../utils/imgurl"); | |||||
const config = require("../../config/config"); | |||||
const QR = require("../../utils/memberqrcode.js"); | |||||
const util = require("../../utils/util"); | |||||
const bgColor = require("../../utils/bgColor.js") | |||||
let app = getApp(); | |||||
Page({ | |||||
data: { | |||||
navigationBarTitle: '首页', | |||||
navigationBarHeight, | |||||
chengzhangBox: bgColor.colorFirst.main.chengzhangBox, | |||||
activeColor: bgColor.colorFirst.main.activeColor, | |||||
qg: bgColor.colorFirst.main.qg, | |||||
newUrl: "", | |||||
cover: "", | |||||
kanjia:imgurl.kanjia.url, | |||||
pintuan: imgurl.pintuan.url, | |||||
xiaofeika: imgurl.xiaofeika.url, | |||||
xingyun: imgurl.xingyun.url, | |||||
jfshangcheng: imgurl.jfshangcheng.url, | |||||
toutiao: imgurl.toutiao.url, | |||||
giftHr: imgurl.giftHr.url, | |||||
giftHr: imgurl.giftHr.url, | |||||
next: imgurl.next.url, | |||||
usergift: imgurl.usergift.url, | |||||
guanbi1: imgurl.guanbi1.url, | |||||
icon0001: imgurl.icon0001.url, | |||||
icon0002: imgurl.icon0002.url, | |||||
icon0003: imgurl.icon0003.url, | |||||
icon0004: imgurl.icon0004.url, | |||||
icon0005: imgurl.icon0005.url, | |||||
icon0006: imgurl.icon0006.url, | |||||
icon0007: imgurl.icon0007.url, | |||||
icon0008: imgurl.icon0008.url, | |||||
barcode: imgurl.barcode.url, | |||||
leftarrows: imgurl.leftarrows.url, | |||||
newcard: imgurl.newcard.url, | |||||
newseckill: imgurl.newseckill.url, | |||||
newbargain: imgurl.newbargain.url, | |||||
newgroup: imgurl.newgroup.url, | |||||
product: imgurl.product.url, | |||||
barginicon: imgurl.barginicon.url, | |||||
pintuan: imgurl.pintuan.url, | |||||
duihuan: imgurl.duihuan.url, | |||||
market: app.globalData.market, | |||||
list: [], | |||||
xslist:[], | |||||
loading: true, | |||||
fistLogin: null, | |||||
alphaData: null, | |||||
swiperCurrent: 0, | |||||
title: null, | |||||
weappShareTitle: '', //分享标题 | |||||
weappShareCoverImg: '', //分享图片 | |||||
desc: null, | |||||
scrollTop: 0, | |||||
showGame: false, | |||||
showTopic: false, | |||||
showQg:false, | |||||
gamedata: {}, | |||||
couponId: '', //游戏返回时传回的字段 | |||||
played: false, //从游戏页面跳回首页返回true | |||||
havePlayEd: app.globalData.havePlayEd, | |||||
staticGamedata: {}, | |||||
showIf: false, | |||||
showPages: false, | |||||
display: 'none', | |||||
display1: 'none', | |||||
optionsData: null, | |||||
page: 1 // 刷新进入页面时已经加载了第一页数据,onReachBottom时 page++,从第2页开始加载 | |||||
}, | |||||
alphaClick: function(even) { | |||||
var animation = wx.createAnimation({}) | |||||
animation.opacity(0).step({ | |||||
duration: 2000 | |||||
}) | |||||
this.setData({ | |||||
alphaData: animation.export() | |||||
}) | |||||
}, | |||||
// 我的卡包 | |||||
mycard: function() { | |||||
wx.navigateTo({ | |||||
url: '/pages/cardorder/index/index', | |||||
}) | |||||
}, | |||||
//我的券包 | |||||
mycoupon: function() { | |||||
wx.navigateTo({ | |||||
url: '/pages/couponorder/index/index', | |||||
}) | |||||
}, | |||||
gotoSpellGroup: function() { | |||||
wx.navigateTo({ | |||||
url: '/pages/spellGroup/spellGroup', | |||||
}) | |||||
}, | |||||
qrcode: function() { | |||||
var that = this; | |||||
let memberId = that.data.memberId; | |||||
if (memberId) { | |||||
wx.navigateTo({ | |||||
url: '/pages/specialcourtesy/specialcourtesy' | |||||
}) | |||||
} | |||||
}, | |||||
// hideQrcode: function() { | |||||
// let that = this; | |||||
// that.setData({ | |||||
// showQrcode: false | |||||
// }) | |||||
// }, | |||||
//跳往限时秒杀 | |||||
gotoRushBuy: function() { | |||||
wx.navigateTo({ | |||||
url: '/pages/rushToBuy/index', | |||||
}) | |||||
}, | |||||
//搜索门店 | |||||
// searchbar:function(){ | |||||
// wx.switchTab({ | |||||
// url: '/pages/index/searchbar/index', | |||||
// }) | |||||
// }, | |||||
// createQrCode: function(url, canvasId, cavW, cavH) { | |||||
// //调用插件中的draw方法,绘制二维码图片 | |||||
// QR.api.draw(url, canvasId, cavW, cavH); | |||||
// }, | |||||
swiperChange: function(e) { | |||||
this.setData({ | |||||
swiperCurrent: e.detail.current | |||||
}); | |||||
}, | |||||
gotogame: function() { | |||||
let that = this; | |||||
if (!that.data.showIf){ | |||||
wx.showToast({ | |||||
title: '暂无游戏频道', | |||||
icon:"none", | |||||
duration:3000 | |||||
}) | |||||
}else{ | |||||
Http.get({ | |||||
url: config.api.checkPhoneStatus, | |||||
data: {} | |||||
}) | |||||
.then(res => { | |||||
var data = { | |||||
couponChannelId: "" + that.data.couponChannelId, | |||||
couponId: "" + that.data.couponId | |||||
}; | |||||
if (that.data.couponChannelId == null) { | |||||
var data = { | |||||
couponId: "" + that.data.couponId | |||||
}; | |||||
} | |||||
wx.redirectTo({ | |||||
url: '/pages/game/index?url=' + that.data.staticGamedata.url + "&id=" + that.data.staticGamedata.id + "&gameId=" + that.data.staticGamedata.gameId, | |||||
}) | |||||
}) | |||||
.catch(err => { | |||||
if (err.code == 11005) { | |||||
// 用户手机未授权 | |||||
/** | |||||
* 将值传到用户手机号授权的页面 | |||||
* | |||||
*/ | |||||
wx.redirectTo({ | |||||
url: "/pages/getphoneInfo/index?path=index&url=" + that.data.staticGamedata.url + "&id=" + that.data.staticGamedata.id + "&gameId=" + that.data.staticGamedata.gameId, | |||||
}); | |||||
} else if (err.code == 11006) { | |||||
// 用户手机已加密 | |||||
wx.redirectTo({ | |||||
url: "/pages/phoneinput/phoneinput?path=index&url=" + that.data.staticGamedata.url + "&id=" + that.data.staticGamedata.id + "&gameId=" + that.data.staticGamedata.gameId, | |||||
}); | |||||
} else { | |||||
wx.showToast({ | |||||
title: err.message, | |||||
icon: 'none', | |||||
duration: 2000, | |||||
mask: false | |||||
}); | |||||
} | |||||
}) | |||||
} | |||||
}, | |||||
mySpecial: function() { | |||||
console.log("special"); | |||||
wx.navigateTo({ | |||||
url: '/pages/specialcourtesy/specialcourtesy', | |||||
}) | |||||
}, | |||||
/** | |||||
* 生命周期函数--监听页面初次渲染完成 | |||||
*/ | |||||
onLoad: function(options) { | |||||
let that = this; | |||||
let optionss; | |||||
if (wx.getStorageSync('options')){ | |||||
optionss = JSON.parse(wx.getStorageSync('options')); | |||||
} | |||||
if (options.played == "true") { | |||||
that.setData({ | |||||
played: true | |||||
}) | |||||
} | |||||
if (optionss && optionss.couponChannelId || optionss && optionss.orderId) { | |||||
that.setData({ | |||||
optionsData: optionss | |||||
}) | |||||
that.getWeapNote(optionss.couponChannelId, optionss.orderId); | |||||
} else { | |||||
that.getWeapNote() | |||||
} | |||||
//获取条形码 | |||||
// util.barcode("barcode", optionss.quancode, 510, 100); | |||||
}, | |||||
onShow: function() { | |||||
let that = this; | |||||
that.setData({ | |||||
havePlayEd: app.globalData.havePlayEd ? app.globalData.havePlayEd : false | |||||
}) | |||||
/** | |||||
* couponNum 是否有普通的优惠券购买 | |||||
* couponNum2 是否有新买的消费卡 | |||||
*/ | |||||
let num = wx.getStorageSync('couponNum'); | |||||
let num1 = wx.getStorageSync('couponNum2'); | |||||
if (num == 'couponNum' || num1 == 'couponNum2') { | |||||
wx.showTabBarRedDot({ | |||||
index: 3 | |||||
}) | |||||
} else { | |||||
wx.hideTabBarRedDot({ | |||||
index: 3 | |||||
}) | |||||
} | |||||
if (app.globalData.score) { | |||||
that.setData({ | |||||
fistLogin: app.globalData.score | |||||
}) | |||||
} | |||||
// 如果有游戏 | |||||
setTimeout(function() { | |||||
that.alphaClick(); | |||||
}, 8000) | |||||
}, | |||||
getmemberId: function(token) { | |||||
let that = this; | |||||
Http.get({ | |||||
url: config.api.getScore, | |||||
data: { | |||||
token: token | |||||
} | |||||
}).then(res => { | |||||
that.setData({ | |||||
levelName: res.data.levelName, | |||||
upgradePercent: res.data.upgradePercent, | |||||
upgradeScore: res.data.upgradeScore, | |||||
}) | |||||
if (res.data.nickName) { | |||||
that.setData({ | |||||
memberId: res.data.id | |||||
}) | |||||
var initUrl = JSON.stringify({ | |||||
flagid: res.data.id | |||||
}); | |||||
} | |||||
}) | |||||
.catch(err => { | |||||
wx.showModal({ | |||||
title: '提示', | |||||
content: err.message, | |||||
showCancel: false | |||||
}) | |||||
}) | |||||
}, | |||||
gotoChengzhangzhi: function() { | |||||
wx.navigateTo({ | |||||
url: '/pages/czdetail/czdetail', | |||||
}) | |||||
}, | |||||
gotoBargain: function () { | |||||
wx.navigateTo({ | |||||
url: '/pages/bargain/bargain', | |||||
}) | |||||
}, | |||||
gotoSpellGroup: function () { | |||||
wx.navigateTo({ | |||||
url: '/pages/spellGroup/spellGroup', | |||||
}) | |||||
}, | |||||
gotoCard: function () { | |||||
wx.navigateTo({ | |||||
url: '/pages/discountCardList/discountCardList', | |||||
}) | |||||
}, | |||||
// gotoGame: function () { | |||||
// wx.navigateTo({ | |||||
// url: '/pages/game/index', | |||||
// }) | |||||
// }, | |||||
gotoJfsc: function () { | |||||
wx.navigateTo({ | |||||
url: '/pages/integralmall/index', | |||||
}) | |||||
}, | |||||
/** | |||||
* | |||||
* @param {code,page} | |||||
* 子组件向父组件传值 | |||||
*/ | |||||
onGetCode: function(e) { | |||||
this.setData({ | |||||
code: e.detail.val, | |||||
page: e.detail.pageNum, | |||||
}); | |||||
console.log(e.detail.val) | |||||
console.log(e.detail.pageNum) | |||||
}, | |||||
getWeapNote: function(couponChannelId, couponId, orderId) { | |||||
var that = this; | |||||
// 登录 | |||||
that.getmemberId(app.globalData.token); | |||||
that.getBannerlist(); | |||||
that.topicShow(); | |||||
that.getxsList(); | |||||
that.getMallInfo(app.globalData.token); | |||||
if (app.couponChannelListCallback) { | |||||
app.couponChannelListCallback(app.globalData.token); | |||||
} | |||||
if (app.couponListCallback) { | |||||
app.couponListCallback(app.globalData.token); | |||||
} | |||||
if (app.businessListCallback) { | |||||
app.businessListCallback(app.globalData.token); | |||||
} | |||||
Http.get({ | |||||
url: config.api.getWeapNote, | |||||
data: { | |||||
appId: config.weapp.AppId, | |||||
} | |||||
}) | |||||
.then(res => { | |||||
that.getGameOne(app.globalData.token) | |||||
that.getStaticGame(app.globalData.token) | |||||
let weapNote = JSON.parse(res.data.weapNote); | |||||
that.setData({ | |||||
desc: weapNote.firstpage.desc, | |||||
title: weapNote.firstpage.title | |||||
}) | |||||
}) | |||||
.catch(err => { | |||||
that.getGameOne(app.globalData.token) | |||||
that.getStaticGame(app.globalData.token) | |||||
wx.showModal({ | |||||
title: "提示", | |||||
content: err.errMsg, | |||||
showCancel: false | |||||
}); | |||||
}); | |||||
}, | |||||
getStaticGame(token) { | |||||
let _this = this; | |||||
Http.get({ | |||||
url: config.api.getGame, | |||||
data: { | |||||
triggleAction: 2, // 固定入口 | |||||
token: token | |||||
} | |||||
}).then(res => { | |||||
if (res.data.id) { | |||||
_this.setData({ | |||||
showIf: true, | |||||
newUrl: res.data.imgUrl | |||||
}) | |||||
} else { | |||||
_this.setData({ | |||||
showIf: false | |||||
}) | |||||
} | |||||
_this.setData({ | |||||
staticGamedata: res.data | |||||
}) | |||||
}) | |||||
.catch(err => { | |||||
_this.setData({ | |||||
showIf: false | |||||
}) | |||||
console.log(err) | |||||
}) | |||||
}, | |||||
getGameOne: function(token) { | |||||
let _this = this; | |||||
Http.get({ | |||||
url: config.api.getGame, | |||||
data: { | |||||
triggleAction: 1, // 登录触发 | |||||
token: token | |||||
} | |||||
}).then(res => { | |||||
if (res.data.id) { | |||||
_this.setData({ | |||||
showGame: true, | |||||
}) | |||||
} else { | |||||
_this.setData({ | |||||
showGame: false | |||||
}) | |||||
} | |||||
_this.setData({ | |||||
gamedata: res.data | |||||
}) | |||||
}) | |||||
.catch(err => { | |||||
_this.setData({ | |||||
showGame: false | |||||
}) | |||||
this.alphaClick(); | |||||
}) | |||||
}, | |||||
/** | |||||
* mallinfo | |||||
*/ | |||||
getMallInfo: function(token) { | |||||
let that = this; | |||||
Http.get({ | |||||
url: config.api.getMallInfo, | |||||
data: { | |||||
token: token, | |||||
} | |||||
}).then(res => { | |||||
that.setData({ | |||||
weappShareTitle: res.data.weappShareTitle ? res.data.weappShareTitle : null, | |||||
weappShareCoverImg: res.data.weappShareCoverImg ? res.data.weappShareCoverImg : null, | |||||
}); | |||||
}) | |||||
.catch(err => { | |||||
// 不需要错误提示 | |||||
}); | |||||
}, | |||||
//获取限时抢购列表 | |||||
getxsList(){ | |||||
let that = this; | |||||
Http.get({ | |||||
url: config.api.couponChannelList, | |||||
data: { | |||||
pageNum: 1, | |||||
pageSize: 3, | |||||
targetAd: 2 | |||||
} | |||||
}).then(res => { | |||||
if (res && res.data.total>0) { | |||||
that.setData({ | |||||
xslist: res.data.list, | |||||
showQg:true | |||||
}); | |||||
}else{ | |||||
that.setData({ | |||||
showQg:false | |||||
}) | |||||
} | |||||
}) | |||||
.catch(err => { | |||||
console.log(err) | |||||
wx.showToast({ | |||||
title: err.errMsg, | |||||
icon: 'none', | |||||
duration: 2000, | |||||
mask: false | |||||
}); | |||||
}) | |||||
}, | |||||
/** | |||||
* banner | |||||
*/ | |||||
getBannerlist: function() { | |||||
let that = this; | |||||
Http.get({ | |||||
url: config.api.bannerlist, | |||||
data: { | |||||
pageNum: 1, | |||||
pageSize: 7 | |||||
} | |||||
}).then(res => { | |||||
// that.getmemberId(app.globalData.token); | |||||
// that.checkUserCarStatus(); | |||||
that.setData({ | |||||
list: res.data.list | |||||
}); | |||||
}) | |||||
.catch(err => { | |||||
// that.getmemberId(app.globalData.token); | |||||
// that.checkUserCarStatus(); | |||||
}); | |||||
}, | |||||
// 专题显示 | |||||
topicShow: function() { | |||||
let that = this; | |||||
Http.get({ | |||||
url: config.api.topicShow, | |||||
data: { | |||||
token: app.globalData.token | |||||
} | |||||
}).then(res => { | |||||
if (res && res.data) { | |||||
that.setData({ | |||||
name: res.data.name, | |||||
cover: res.data.cover, | |||||
id: res.data.id, | |||||
showTopic: true | |||||
}) | |||||
} else { | |||||
that.setData({ | |||||
showTopic: false | |||||
}) | |||||
} | |||||
}) | |||||
.catch(err => { | |||||
console.log(err); | |||||
}) | |||||
}, | |||||
gotoTopic() { | |||||
wx.navigateTo({ | |||||
url: `/pages/topicDetail/index?id=${this.data.id}` | |||||
}) | |||||
}, | |||||
/** | |||||
* 检查用户是否有车 | |||||
*/ | |||||
// checkUserCarStatus: function() { | |||||
// var that = this; | |||||
// Http.get({ | |||||
// url: config.api.userCarCount, | |||||
// data: {} | |||||
// }).then(res => { | |||||
// if (res.data > 0) { | |||||
// // 用户名下有车 | |||||
// app.globalData.phone = res.data.phone; | |||||
// app.globalData.supportCar = true; | |||||
// // 共同登录 | |||||
// that.userCarLogin(); | |||||
// } | |||||
// }); | |||||
// }, | |||||
/** | |||||
* car共同登录 | |||||
*/ | |||||
// userCarLogin: function() { | |||||
// var that = this; | |||||
// if (!app.globalData.carLogin) { | |||||
// // 共同登录 | |||||
// Http.post({ | |||||
// url: config.api.carInit, | |||||
// data: { | |||||
// phone: app.globalData.phone | |||||
// } | |||||
// }).then(res => { | |||||
// app.globalData.carLogin = true; | |||||
// app.globalData.parkVendor = res.data.vendor; | |||||
// if (res.data.token != "undefined") { | |||||
// app.globalData.etcpToken = res.data.token; | |||||
// } | |||||
// }); | |||||
// } | |||||
// }, | |||||
/** | |||||
* 获取用户信息 | |||||
*/ | |||||
// getUserInfo: function() { | |||||
// // 获取用户信息 | |||||
// wx.getSetting({ | |||||
// success: res => { | |||||
// if (res.authSetting["scope.userInfo"]) { | |||||
// // 已经授权,可以直接调用 getUserInfo 获取头像昵称,不会弹框 | |||||
// wx.getUserInfo({ | |||||
// success: res => { | |||||
// // 可以将 res 发送给后台解码出 unionId | |||||
// } | |||||
// }); | |||||
// } | |||||
// } | |||||
// }); | |||||
// }, | |||||
gotoBargain: function() { | |||||
wx.navigateTo({ | |||||
url: '/pages/bargain/bargain' | |||||
}) | |||||
}, | |||||
/** | |||||
* 刷新 | |||||
*/ | |||||
onPullDownRefresh: function(e) { | |||||
let that = this; | |||||
that.getWeapNote(); | |||||
that.setData({ | |||||
page: 1 | |||||
}) | |||||
if (this.data.optionsData != null && (this.data.optionsData.couponChannelId || this.data.optionsData.orderId)) { | |||||
this.getWeapNote(this.data.optionsData.couponChannelId, this.data.optionsData.orderId); | |||||
} else { | |||||
this.getWeapNote() | |||||
} | |||||
if (that.data.code == 0 || that.data.code == undefined) { | |||||
that.selectComponent("#lists").getList(0, 1, "refresh"); | |||||
wx.stopPullDownRefresh(); | |||||
} else { | |||||
that.selectComponent("#lists").getList(that.data.code, 1, "refresh"); | |||||
wx.stopPullDownRefresh(); | |||||
}; | |||||
// 砍价下拉刷新 | |||||
// that.selectComponent("#bargain").getList(); | |||||
// that.selectComponent("#spellGroup").getList(); | |||||
// that.selectComponent("#rushtobyCard").getList(); | |||||
wx.stopPullDownRefresh(); | |||||
//爆款专区下拉刷新 | |||||
that.selectComponent("#hot").getList(); | |||||
that.getxsList(); | |||||
that.topicShow(); | |||||
}, | |||||
//加载更多 | |||||
onReachBottom: function() { | |||||
let that = this; | |||||
that.data.page++; | |||||
that.setData({ | |||||
page: that.data.page | |||||
}); | |||||
console.log("加载更多页数" + that.data.page); | |||||
console.log("加载更多key" + that.data.code); | |||||
//父组件获得子组件的方法 | |||||
//如果code == 0 | |||||
if (that.data.code == 0 || that.data.code == undefined) { | |||||
that.selectComponent("#lists").getList(0, that.data.page); | |||||
} else { | |||||
that.selectComponent("#lists").getList(that.data.code, that.data.page); | |||||
} | |||||
}, | |||||
// 用户点击右上角分享 | |||||
onShareAppMessage: function() { | |||||
return { | |||||
title: this.data.weappShareTitle, | |||||
imageUrl: this.data.weappShareCoverImg, | |||||
// desc: this.data.desc, | |||||
success: function(res) { | |||||
wx.showToast({ | |||||
title: "分享成功", | |||||
duration: 1000, | |||||
icon: "success" | |||||
}); | |||||
} | |||||
}; | |||||
} | |||||
}); |
@@ -1,12 +0,0 @@ | |||||
{ | |||||
"usingComponents": { | |||||
"c-banner": "../../components/banner/index", | |||||
"discount-card": "../../components/discountCard/index", | |||||
"c-coupons": "./coupons/index", | |||||
"g-entry": "../../components/gameentry/gentry", | |||||
"c-hot": "../../components/hot/index", | |||||
"navbar": "../../components/navbar/navbar" | |||||
}, | |||||
"enablePullDownRefresh": true, | |||||
"navigationBarBackgroundColor": "#F4F5F9" | |||||
} |
@@ -1,78 +0,0 @@ | |||||
<navbar text="首页"></navbar> | |||||
<view class="container" style="padding-top:{{navigationBarHeight}};"> | |||||
<!-- 会员信息 --> | |||||
<view class='userinfo' > | |||||
<!-- 头像 --> | |||||
<view class='infoLeft'> | |||||
<view class="user-avatar"> | |||||
<open-data class="open" type="userAvatarUrl"></open-data> | |||||
</view> | |||||
<!-- 成长值 --> | |||||
<view class="user-data fl" bindtap='gotoChengzhangzhi'> | |||||
<view class='nameBox'> | |||||
<open-data type="userNickName"></open-data> | |||||
<view class='chengzhangBox' style='background:{{chengzhangBox}}'> | |||||
<text class='chengzhang'>{{levelName}}</text> | |||||
</view> | |||||
</view> | |||||
<view class="view"> | |||||
<progress percent="{{upgradePercent}}" stroke-width="6" activeColor="{{activeColor}}" /> | |||||
<view class='remainchengzhangzhi'>还需{{upgradeScore}}成长值可升级</view> | |||||
</view> | |||||
</view> | |||||
</view> | |||||
<!-- 二维码 --> | |||||
<view class='qrcode fr' bindtap='qrcode'> | |||||
<image src="{{barcode}}" class='qrcodeimg' mode='widthFix'></image> | |||||
</view> | |||||
</view> | |||||
<!-- banner --> | |||||
<c-banner wx:key="unique" list="{{list}}" /> | |||||
<!-- 频道 --> | |||||
<view class='channelBox'> | |||||
<view class='kjBox' bindtap='gotoBargain'> | |||||
<image src='{{kanjia}}' mode='aspectFill'></image> | |||||
<text>砍价</text> | |||||
</view> | |||||
<view class='kjBox' bindtap='gotoSpellGroup'> | |||||
<image src='{{pintuan}}' mode='aspectFill'></image> | |||||
<text>拼团</text> | |||||
</view> | |||||
<view class='kjBox' bindtap='gotoCard'> | |||||
<image src='{{xiaofeika}}' mode='aspectFill'></image> | |||||
<text>消费卡</text> | |||||
</view> | |||||
<view class='kjBox' bindtap='gotogame' > | |||||
<image src='{{xingyun}}' mode='aspectFill' bindtap=''></image> | |||||
<text>游戏频道</text> | |||||
</view> | |||||
<view class='kjBox' bindtap='gotoJfsc'> | |||||
<image src='{{jfshangcheng}}' mode='aspectFill'></image> | |||||
<text>积分商城</text> | |||||
</view> | |||||
</view> | |||||
<!-- 每日头条 限时抢购 --> | |||||
<view class='toutiao' bindtap='gotoRushBuy' wx:if="{{showQg}}" > | |||||
<view class='imgBox'> | |||||
<image src='{{toutiao}}' mode='aspectFill'></image> | |||||
</view> | |||||
<view> | |||||
今日好物推荐, | |||||
<text>'{{xslist[0].title}}'</text>原价 <text>{{xslist[0].priceStr}}</text> 现价... | |||||
</view> | |||||
<view class='qg' style='border-color:{{qg}}'>抢购</view> | |||||
</view> | |||||
<!-- 爆款专区 --> | |||||
<c-hot id="hot"/> | |||||
<view class='product' wx:if="{{showTopic}}" bindtap='gotoTopic'> | |||||
<image src='{{cover}}' mode='widthFix' ></image> | |||||
</view> | |||||
<c-coupons id="lists" bind:myevent="onGetCode" class="business" loadingtext="{{loadingtext}}" loading="{{loading}}" /> | |||||
<g-entry id="listss" wx:if="{{showGame&&!played&&!havePlayEd}}" gamedata="{{gamedata}}" bind:myevent="" /> | |||||
</view> | |||||
<!-- 顶部签到成长值 --> | |||||
<view class='signin' wx:if="{{fistLogin}}" animation="{{alphaData}}"> | |||||
<open-data class="open" type="userAvatarUrl"></open-data> | |||||
<text class='text'>您今日签到成功,获得{{fistLogin}}成长值</text> | |||||
</view> |
@@ -1,482 +0,0 @@ | |||||
@import "../../app.wxss"; | |||||
page{ | |||||
background: #F4F5F9; | |||||
} | |||||
.index-position { | |||||
background: rgba(0, 0, 0, 0.5); | |||||
height: 88rpx; | |||||
position: absolute; | |||||
top: 0; | |||||
width: 100%; | |||||
font-family: PingFangSC-Semibold; | |||||
font-size: 30rpx; | |||||
color: #fff; | |||||
letter-spacing: 0.75rpx; | |||||
z-index: 9; | |||||
line-height: 88rpx; | |||||
overflow: hidden; | |||||
} | |||||
.red{ | |||||
position:absolute; | |||||
width:13rpx; | |||||
height:13rpx; | |||||
border-radius:50%; | |||||
background:red; | |||||
right:-50rpx; | |||||
top:19rpx; | |||||
left:0; | |||||
margin:auto; | |||||
display: none; | |||||
} | |||||
page { | |||||
width: 100%; | |||||
height: auto !important; | |||||
overflow-x: hidden; | |||||
} | |||||
.txt { | |||||
margin-left: 20rpx; | |||||
} | |||||
.game-entry { | |||||
position: fixed; | |||||
right: 27rpx; | |||||
bottom:323rpx; | |||||
width: 120rpx; | |||||
margin: 37rpx auto 0; | |||||
z-index: 10; | |||||
} | |||||
.gameimg { | |||||
display: block; | |||||
width: 100%; | |||||
} | |||||
.userinfo{ | |||||
width:690rpx; | |||||
height: 96rpx; | |||||
border-radius:16rpx; | |||||
display: flex; | |||||
justify-content: space-between; | |||||
margin: 0 auto 30rpx; | |||||
} | |||||
.infoLeft{ | |||||
height: 100%; | |||||
border-radius:12rpx; | |||||
background: #FFF; | |||||
} | |||||
.section { | |||||
padding: 0 20rpx; | |||||
justify-content: space-around; | |||||
text-align: center; | |||||
margin-top: 25rpx; | |||||
margin-bottom: 30rpx; | |||||
} | |||||
.sellsection{ | |||||
margin-bottom: 37rpx; | |||||
padding: 0 38rpx; | |||||
} | |||||
.section >view,.sellsection>view{ | |||||
width: 25%; | |||||
display: inline-block; | |||||
position: relative; | |||||
} | |||||
.section >view image,.sellsection>view image{ | |||||
display: block; | |||||
margin: 0 auto; | |||||
} | |||||
.section >view image { | |||||
width: 55rpx; | |||||
height: 55rpx; | |||||
margin-top: 20rpx; | |||||
margin-bottom: 14rpx; | |||||
} | |||||
.sellsection>view image{ | |||||
width: 159rpx; | |||||
height: 134rpx; | |||||
} | |||||
.section text { | |||||
font-size: 24rpx; | |||||
color: rgba(51, 51, 51, 1); | |||||
display: block; | |||||
margin-top: 0rpx; | |||||
} | |||||
.showQrcode { | |||||
position: fixed; | |||||
top: 0; | |||||
left: 0; | |||||
right: 0; | |||||
bottom: 0; | |||||
z-index: 1000; | |||||
background: rgba(0, 0, 0, 0.6); | |||||
} | |||||
.qrcode image { | |||||
/* position: absolute; | |||||
top: 0; | |||||
bottom: 0; */ | |||||
margin: 15rpx 20rpx 15rpx; | |||||
z-index:100; | |||||
} | |||||
.showQrcode { | |||||
position: fixed; | |||||
top: 0; | |||||
left: 0; | |||||
right: 0; | |||||
bottom: 0; | |||||
z-index: 1000; | |||||
background: rgba(0, 0, 0, 0.6); | |||||
} | |||||
.canvas-box { | |||||
position: fixed; | |||||
width: 500rpx; | |||||
overflow: hidden; | |||||
left: 0; | |||||
top: 200rpx; | |||||
right: 0; | |||||
margin: auto; | |||||
background: #fff; | |||||
border-radius: 16rpx; | |||||
z-index:100; | |||||
padding-bottom: 30rpx; | |||||
} | |||||
.showQrcode text { | |||||
display: none; | |||||
text-align: center; | |||||
font-size: 28rpx; | |||||
} | |||||
.button { | |||||
width: 414rpx; | |||||
text-align: center; | |||||
margin: 0 auto; | |||||
height: 80rpx; | |||||
line-height: 80rpx; | |||||
background: rgba(255, 255, 255, 1); | |||||
border-radius: 10rpx; | |||||
font-size: 32rpx; | |||||
color: rgba(2, 192, 255, 1); | |||||
overflow: hidden; | |||||
} | |||||
.memberIds{ | |||||
padding-top: 30rpx; | |||||
font-size: 30rpx; | |||||
} | |||||
.search{ | |||||
background:rgba(2, 192, 255, 1); | |||||
height: 50rpx; | |||||
} | |||||
.searchbar{ | |||||
position: relative; | |||||
width: 685rpx; | |||||
height: 76rpx; | |||||
margin: 0 auto; | |||||
text-align: center; | |||||
} | |||||
.searchbar image{ | |||||
width: 40rpx; | |||||
} | |||||
.searchbar text{ | |||||
font-size: 28rpx; | |||||
line-height: 50rpx; | |||||
color: #fff; | |||||
display: inline-block; | |||||
} | |||||
.user-avatar { | |||||
width: 80rpx; | |||||
height: 80rpx; | |||||
border-radius: 50%; | |||||
overflow: hidden; | |||||
float: left; | |||||
margin: 10rpx 10rpx; | |||||
} | |||||
.user-avatar open-data { | |||||
display:block; | |||||
width:100%; | |||||
height:100%; | |||||
} | |||||
.user-data { | |||||
letter-spacing: 0.64rpx; | |||||
line-height: 46rpx; | |||||
font-size: 30rpx; | |||||
color: #333; | |||||
background: #FFF; | |||||
margin-top: 10rpx; | |||||
margin-bottom: 26rpx; | |||||
float: right; | |||||
display: flex; | |||||
flex-direction: column; | |||||
} | |||||
.nameBox open-data{ | |||||
float: left; | |||||
} | |||||
.chengzhangBox{ | |||||
height:32rpx; | |||||
line-height: 26rpx; | |||||
border-radius:9px 9px 9px 0px; | |||||
font-family:PingFangSC-Regular; | |||||
font-weight:400; | |||||
color:rgba(255,255,255,1); | |||||
float: left; | |||||
margin-top: 8rpx; | |||||
} | |||||
.chengzhang { | |||||
font-size: 22rpx; | |||||
font-weight: 400; | |||||
color: #FFFFFF; | |||||
height:22rpx; | |||||
line-height: 22rpx; | |||||
padding: 0 8rpx; | |||||
} | |||||
.integral{ | |||||
margin-left: 70rpx; | |||||
} | |||||
.jifen{ | |||||
display: inline-block; | |||||
height: 34rpx; | |||||
color: #999999; | |||||
font-size:24rpx; | |||||
line-height: 34rpx; | |||||
} | |||||
.jifenNumber{ | |||||
color:#D18B4C; | |||||
font-size: 34rpx; | |||||
line-height: 34rpx; | |||||
margin-left: 10rpx; | |||||
font-weight: bold; | |||||
} | |||||
.view { | |||||
display: flex; | |||||
font-size: 24rpx; | |||||
color: #999999; | |||||
} | |||||
.view>.score{ | |||||
margin-left:9rpx; | |||||
color:#333333; | |||||
font-size:30rpx; | |||||
margin-right:23rpx; | |||||
font-family:PingFang-SC-Bold; | |||||
} | |||||
.qrcode{ | |||||
width: 106rpx; | |||||
height: 96rpx; | |||||
background: #FFF; | |||||
border-radius:12rpx; | |||||
} | |||||
.qrcodeimg{ | |||||
width: 68rpx!important; | |||||
height: 68rpx!important; | |||||
} | |||||
.leftimg{ | |||||
position: absolute; | |||||
right: 40rpx; | |||||
top: 60rpx; | |||||
margin-top: -7rpx; | |||||
width: 14rpx; | |||||
height: 26rpx; | |||||
} | |||||
.duihuanimg{ | |||||
display: block; | |||||
width: 48rpx; | |||||
margin-top: 6rpx; | |||||
} | |||||
.product{ | |||||
width: 710rpx; | |||||
margin: 30rpx auto 10rpx; | |||||
border-radius: 16rpx; | |||||
overflow: hidden; | |||||
} | |||||
.product image{ | |||||
display: block; | |||||
width: 100%; | |||||
} | |||||
.textBox{ | |||||
/* display: block; */ | |||||
width: 400rpx; | |||||
height: 100%; | |||||
float: left; | |||||
margin-left: 10rpx; | |||||
} | |||||
.textBox .name{ | |||||
width: 400rpx; | |||||
font-size: 28rpx; | |||||
color: #3C3C3C; | |||||
margin-top: 20rpx; | |||||
} | |||||
.textBox .title{ | |||||
width: 400rpx; | |||||
font-size: 20rpx; | |||||
color: #A6A6A6; | |||||
margin-top: 10rpx; | |||||
} | |||||
.product .gift{ | |||||
width:88rpx; | |||||
height:88rpx; | |||||
float: left; | |||||
margin-top: 30rpx; | |||||
margin-left: 15rpx; | |||||
} | |||||
.next image{ | |||||
width: 26rpx; | |||||
height: 40rpx; | |||||
} | |||||
.gift image{ | |||||
width:88rpx; | |||||
height:76rpx; | |||||
} | |||||
.product .next{ | |||||
width:32rpx; | |||||
height:60rpx; | |||||
float: right; | |||||
margin-top: 40rpx; | |||||
margin-right: 26rpx; | |||||
} | |||||
#rushtobyCard{ | |||||
margin-top: 30rpx; | |||||
} | |||||
.signin{ | |||||
width: 542rpx; | |||||
height: 94rpx; | |||||
position: fixed; | |||||
top: 0; | |||||
left: 0; | |||||
right: 0; | |||||
z-index: 100; | |||||
margin: auto; | |||||
} | |||||
.signin open-data { | |||||
position: absolute; | |||||
width:90rpx; | |||||
left: 0; | |||||
top: 0; | |||||
bottom: 0; | |||||
height:94rpx; | |||||
margin: auto; | |||||
border-radius: 50%; | |||||
overflow: hidden; | |||||
} | |||||
.signin text{ | |||||
display: block; | |||||
background: rgba(0, 0, 0, 0.5); | |||||
font-size: 28rpx; | |||||
height: 80rpx; | |||||
width: 100%; | |||||
line-height: 80rpx; | |||||
color: #D6D5D5; | |||||
text-indent: 4em; | |||||
border-radius:60rpx; | |||||
margin-top: 7rpx; | |||||
} | |||||
.remainchengzhangzhi{ | |||||
display: block; | |||||
color: #A6A6A6; | |||||
font-size: 22rpx; | |||||
margin-top: 5rpx; | |||||
height: 30rpx; | |||||
line-height: 30rpx; | |||||
float: left; | |||||
margin-left:10rpx; | |||||
width: 255rpx; | |||||
overflow: hidden; | |||||
text-overflow:ellipsis; | |||||
white-space: nowrap; | |||||
} | |||||
progress{ | |||||
width:200rpx; | |||||
border-radius:60rpx; | |||||
overflow:hidden; | |||||
float: left; | |||||
margin-top: 10rpx; | |||||
} | |||||
.channelBox{ | |||||
width:688rpx; | |||||
height: 220rpx; | |||||
margin:0 auto; | |||||
display: flex; | |||||
justify-content: space-between; | |||||
background: #F4F5F9; | |||||
} | |||||
.kjBox{ | |||||
width: 104rpx; | |||||
height: 148rpx; | |||||
font-size: 24rpx; | |||||
color: #A6A6A6; | |||||
margin-top: 46rpx; | |||||
text-align: center; | |||||
} | |||||
.kjBox image{ | |||||
width: 104rpx; | |||||
height: 104rpx; | |||||
} | |||||
.toutiao{ | |||||
width:710rpx; | |||||
height: 82rpx; | |||||
line-height: 82rpx; | |||||
margin:0 auto; | |||||
background: #FFF; | |||||
box-shadow:0px 6rpx 16rpx 0px rgba(236,238,243,1); | |||||
border-radius:12rpx; | |||||
margin-top: 18rpx; | |||||
margin-bottom:18rpx; | |||||
position: relative; | |||||
} | |||||
.toutiao view:nth-child(2){ | |||||
font-size:26rpx; | |||||
font-family:PingFangSC-Regular; | |||||
font-weight:400; | |||||
color:rgba(60,60,60,1); | |||||
float: left; | |||||
width: 500rpx; | |||||
overflow: hidden; | |||||
text-overflow:ellipsis; | |||||
white-space: nowrap; | |||||
} | |||||
.toutiao view:nth-child(2) text:nth-child(1){ | |||||
color: red; | |||||
} | |||||
.toutiao view:nth-child(2) text:nth-child(2){ | |||||
text-decoration: line-through; | |||||
color: red; | |||||
} | |||||
.toutiao .imgBox{ | |||||
width: 64rpx; | |||||
height: 64rpx; | |||||
float: left; | |||||
margin:5rpx 0 5rpx 20rpx; | |||||
} | |||||
.toutiao image{ | |||||
width: 48rpx; | |||||
height: 38rpx; | |||||
margin: auto; | |||||
} | |||||
.toutiao .qg{ | |||||
width: 80rpx; | |||||
height: 44rpx; | |||||
line-height: 44rpx; | |||||
border-radius:18rpx; | |||||
border:2rpx solid; | |||||
position: absolute; | |||||
top: 0; | |||||
bottom: 0; | |||||
right: 20rpx; | |||||
margin: auto; | |||||
font-size:24rpx; | |||||
font-family:PingFangSC-Medium; | |||||
font-weight:500; | |||||
color:#FD782D; | |||||
text-align: center; | |||||
} | |||||
i-tabs i-tabs-scroll{ | |||||
background: #F4F5F9!important; | |||||
} | |||||
@@ -35,7 +35,7 @@ Page({ | |||||
}, | }, | ||||
goback: function () { | goback: function () { | ||||
wx.switchTab({ | wx.switchTab({ | ||||
url: '/pages/main/index', | |||||
url: '/index/index', | |||||
}) | }) | ||||
}, | }, | ||||
onLoad(e) { | onLoad(e) { | ||||
@@ -9,7 +9,7 @@ | |||||
<image src="{{noCoupon}}" mode="widthFix" /> | <image src="{{noCoupon}}" mode="widthFix" /> | ||||
<text class="txt001">请您敬请期待</text> | <text class="txt001">请您敬请期待</text> | ||||
<text class='txt002'>我们正在筹备一大波优惠活动</text> | <text class='txt002'>我们正在筹备一大波优惠活动</text> | ||||
<navigator class='nav' url="/pages/main/index" open-type="switchTab" hover-class="other-navigator-hover"> | |||||
<navigator class='nav' url="/index/index" open-type="switchTab" hover-class="other-navigator-hover"> | |||||
<button hover-class='active'>前往首页看看</button> | <button hover-class='active'>前往首页看看</button> | ||||
</navigator> | </navigator> | ||||
</view> | </view> | ||||
@@ -1,768 +0,0 @@ | |||||
const navigationBarHeight = (getApp().statusBarHeight + 50) + 'px' | |||||
const extConfig = wx.getExtConfigSync ? wx.getExtConfigSync() : {} | |||||
let app = getApp(); | |||||
const format = require("../../utils/util.js"); | |||||
let config = require("../../config/config.js"); | |||||
let Http = require("../../utils/HttpBasics"); | |||||
let Util = require("../../utils/util"); | |||||
const imgurl = require("../../utils/imgurl"); | |||||
Page({ | |||||
data: { | |||||
navigationBarHeight, | |||||
jianUrl: imgurl.jian.url, | |||||
jiaofeiwm: imgurl.jiaofeiwm.url, | |||||
parkUrl: imgurl.park.url, | |||||
guanliHr: imgurl.guanliHr.url, | |||||
qidaiUrl: imgurl.qidai.url, | |||||
addUrl: imgurl.add.url, | |||||
tingcheHr: imgurl.tingcheHr.url, | |||||
cheUrl: imgurl.che.url, | |||||
jiaofei: imgurl.jiaofei.url, | |||||
wentiHr: imgurl.wentiHr.url, | |||||
park: null, | |||||
carList: [], | |||||
payList: [], | |||||
addCar: null, | |||||
tcq: 2, | |||||
flag: "", | |||||
extraData: {}, | |||||
desc: '', | |||||
title: '', | |||||
indicatorDots: true, | |||||
autoplay: false, | |||||
interval: 5000, | |||||
duration: 1000, | |||||
current: 0, | |||||
stopFees: {}, | |||||
scroll: true, | |||||
ifHaveCarModular: "", | |||||
canIUse: wx.canIUse("navigator"), | |||||
showTicketModal: false, | |||||
ticketList: [], | |||||
noCoupon:imgurl.noCoupon.url, | |||||
loadingUrl: imgurl.loading.url, | |||||
allow_load: true, | |||||
curPageNum: 1, | |||||
curPageSize: 15, | |||||
curTotalpageNum: 0, | |||||
quantitle: '', | |||||
quanid: '', | |||||
gouHr: imgurl.gouHr.url, | |||||
totalTicketNum: 0, | |||||
}, | |||||
getMoreList(e) { | |||||
let totalNum = this.data.ticketList.length; | |||||
if (this.data.curPageNum < this.data.curTotalpageNum) { | |||||
this.setData({ | |||||
curPageNum: this.data.curPageNum+1 | |||||
}) | |||||
this.getTicketList(0 ,this.data.curPageNum); | |||||
} | |||||
}, | |||||
/** | |||||
* 选择使用的优惠券 | |||||
*/ | |||||
choicecoupon: function(e) { | |||||
/* wx.navigateBack(); | |||||
var pages = getCurrentPages(); | |||||
var prevPage = pages[pages.length - 2] //上一个页面 */ | |||||
var that = this; | |||||
var quantitle = e.currentTarget.dataset.title; | |||||
var quanid = e.currentTarget.dataset.id; | |||||
this.setData({ | |||||
quantitle: quantitle, | |||||
quanid: quanid, | |||||
showTicketModal: false, | |||||
}); | |||||
that.bindCoupon(that.data.quanid); | |||||
/* wx.setStorage({ | |||||
key: 'chosed', | |||||
data: 'chosed', | |||||
}) */ | |||||
}, | |||||
/* | |||||
*/ | |||||
getTicketList(key, pageNum) { | |||||
var that = this; | |||||
if (that.data.allow_load) { | |||||
wx.showLoading({ | |||||
title: "加载中" | |||||
}); | |||||
Http.get({ | |||||
url: config.api.couponOrderCarList, | |||||
data: { | |||||
pageNum: pageNum, | |||||
pageSize: 15, | |||||
couponOrderStatus: key | |||||
} | |||||
}).then(res => { | |||||
that.setData({ | |||||
curTotalpageNum: res.data.pages, | |||||
curPageNum: res.data.pageNum, | |||||
totalTicketNum: res.data.total | |||||
}) | |||||
res.data.list.map(file => { | |||||
file.expiredTime = format.formatTime( | |||||
file.expiredTime, | |||||
"yyyy-MM-dd hh:mm:ss" | |||||
); | |||||
}); | |||||
setTimeout(function () { | |||||
wx.hideLoading(); | |||||
}, 1200); | |||||
if (pageNum >= res.data.pages) { | |||||
that.setData({ | |||||
allow_load: false | |||||
}); | |||||
} | |||||
/** | |||||
* 先赋值后渲染页面 | |||||
* concat 不会改变原数组值 | |||||
* push 会改变原数组值,但不会一条一条插入,而是整个数组插入 | |||||
*/ | |||||
if (pageNum == 1) { | |||||
that.setData({ | |||||
ticketList: res.data.list, | |||||
curPageNum: pageNum | |||||
}); | |||||
} else { | |||||
that.setData({ | |||||
ticketList: that.data.ticketList.concat(res.data.list) | |||||
}); | |||||
} | |||||
// that.data.ticketList = that.data.ticketList.concat(res.data.list); | |||||
this.hideLoading(); | |||||
}) | |||||
.catch(err => { | |||||
setTimeout(function () { | |||||
wx.hideLoading(); | |||||
}, 1200); | |||||
wx.showToast({ | |||||
title: err.errMsg, | |||||
icon: 'none', | |||||
duration: 2000, | |||||
mask: false | |||||
}); | |||||
}) | |||||
} else { | |||||
} | |||||
}, | |||||
//点击跳转到券详情页面 | |||||
gotouse: function (e) { | |||||
wx.navigateTo({ | |||||
url: `/pages/passCar/couponDetail/couponDetail?quancode=${ | |||||
e.currentTarget.dataset.quancode | |||||
}`, | |||||
success: function (res) { | |||||
// success | |||||
}, | |||||
fail: function () { | |||||
// fail | |||||
}, | |||||
complete: function () { | |||||
// complete | |||||
} | |||||
}); | |||||
}, | |||||
/** | |||||
* 车牌轮播滑动 | |||||
*/ | |||||
onSlideChangeEnd: function (e) { | |||||
var that = this; | |||||
/** | |||||
* 获得当前的车牌号码 | |||||
*/ | |||||
var listCardNum = (that.data.carList)[e.detail.current].carNumber; | |||||
that.setData({ | |||||
listCardNum: listCardNum | |||||
}); | |||||
/** | |||||
* 获得停车费用 | |||||
*/ | |||||
if (that.data.scroll) { | |||||
that.getStopFee(listCardNum); | |||||
} | |||||
}, | |||||
//停车费用为0 | |||||
paySuccess: function () { | |||||
wx.showModal({ | |||||
title: '支付成功', | |||||
content: '请尽快离场', | |||||
showCancel: false | |||||
}) | |||||
}, | |||||
gotomange: function () { | |||||
wx.navigateTo({ | |||||
url: '/pages/managelicenseplate/managelicenseplate', | |||||
}) | |||||
}, | |||||
bindfail: function (res) { | |||||
console.log(res) | |||||
}, | |||||
gotoetcp: function () { | |||||
wx.navigateToMiniProgram({ | |||||
appId: that.data.etcpAppId, | |||||
extraData: this.data.extraData, | |||||
envVersion: 'release', | |||||
path: "pages/main/main", | |||||
}) | |||||
}, | |||||
showquan: function () { | |||||
wx.navigateTo({ | |||||
url: '/pages/passCar/couponList/couponList', | |||||
}) | |||||
}, | |||||
gotodetail: function (e) { | |||||
wx.showModal({ | |||||
title: '缴费规则', | |||||
content: e.target.dataset.rule, | |||||
showCancel: false, | |||||
}) | |||||
}, | |||||
onShow: function (options) { | |||||
console.log(123) | |||||
var that = this; | |||||
that.setData({ | |||||
etcpAppId: extConfig.attr.etcpAppId, | |||||
etcpVersion: extConfig.attr.etcpVersion, | |||||
etcpCallbackUrl: extConfig.attr.etcpCallbackUrl, | |||||
ifHaveCarModular: extConfig.attr.ifHaveCarModular | |||||
}) | |||||
if (app.globalData.token) { | |||||
that.getList(); | |||||
that.init(); | |||||
} else { | |||||
that.init(); | |||||
} | |||||
/** | |||||
* 只有用户选择了优惠券 | |||||
* 才会进行券和车牌的绑定 | |||||
*/ | |||||
/* if (wx.getStorageSync("chosed") && that.data.quanid) { | |||||
that.getStopFee(that.data.listCardNum); | |||||
that.bindCoupon(that.data.quanid); | |||||
wx.setStorage({ | |||||
key: 'chosed', | |||||
data: '', | |||||
}) | |||||
}; */ | |||||
if (app.globalData.token) { | |||||
// that.initUsrCarList(); | |||||
that.initUsrCarList("flags"); | |||||
that.setData({ | |||||
current: 0 | |||||
}) | |||||
} | |||||
if (that.data.addCar) { | |||||
// 绑车牌 | |||||
if (app.globalData.carLogin) { | |||||
that.bindCar(that.data.addCar); | |||||
} else { | |||||
that.bindCar(that.data.addCar); | |||||
} | |||||
that.setData({ | |||||
addCar: null | |||||
}); | |||||
} | |||||
this.getTicketList(0, 1); | |||||
}, | |||||
cancelMove: function() { | |||||
console.log(111) | |||||
return false; | |||||
}, | |||||
onHide: function () { | |||||
this.setData({ | |||||
allow_load: true, | |||||
showTicketModal: false, | |||||
curPageNum: 1, | |||||
ticketList: [] | |||||
}) | |||||
}, | |||||
onLoad: function (options) { | |||||
var that = this; | |||||
/** | |||||
* 获得分享小程序的 | |||||
* title | |||||
* desc | |||||
*/ | |||||
Http.get({ | |||||
url: config.api.getWeapNote, | |||||
data: { | |||||
appId: config.weapp.AppId, | |||||
} | |||||
}) | |||||
.then(res => { | |||||
let weapNote = JSON.parse(res.data.weapNote); | |||||
that.setData({ | |||||
desc: weapNote.carpage.desc, | |||||
title: weapNote.carpage.title | |||||
}) | |||||
}) | |||||
.catch(err => { | |||||
console.log(err); | |||||
}) | |||||
// 登录 | |||||
var scene = decodeURIComponent(options.scene); | |||||
that.setData({ | |||||
scene: scene | |||||
}); | |||||
if (app.globalData.token) { } else { | |||||
// app.getLocation(); | |||||
that.userLogin() | |||||
} | |||||
}, | |||||
/** | |||||
* 用户登录 | |||||
*/ | |||||
userLogin: function () { | |||||
var that = this; | |||||
// 登录 | |||||
wx.login({ | |||||
success: ({ | |||||
code | |||||
}) => { | |||||
wx.getSystemInfo({ | |||||
success: function (res) { | |||||
that.setData({ | |||||
systemInfo: JSON.stringify(res) | |||||
}) | |||||
} | |||||
}) | |||||
var usrdata = { | |||||
appId: config.weapp.AppId, | |||||
code: code, | |||||
sceneAddress: app.globalData.sceneAddress, | |||||
scene: that.data.scene, | |||||
systemInfo: that.data.systemInfo | |||||
}; | |||||
if (app.globalData.locationInfo) { | |||||
usrdata = { | |||||
appId: config.weapp.AppId, | |||||
code: code, | |||||
sceneAddress: app.globalData.sceneAddress, | |||||
latitude: "" + app.globalData.locationInfo.latitude, | |||||
longitude: "" + app.globalData.locationInfo.longitude, | |||||
scene: that.data.scene, | |||||
systemInfo: that.data.systemInfo | |||||
}; | |||||
} | |||||
Http.post({ | |||||
url: config.api.login, | |||||
data: usrdata | |||||
}) | |||||
.then(res => { | |||||
app.globalData.token = res.data.token; | |||||
Http.setToken(res.data.token); | |||||
that.checkUserCarStatus(); | |||||
that.getList(); | |||||
that.init(); | |||||
that.initUsrCarList(); | |||||
return Http.get({ | |||||
url: config.api.checkUserStatus, | |||||
data: {} | |||||
}); | |||||
}) | |||||
.then(res => { }) | |||||
.catch(err => { | |||||
if (err.code == 11004) { | |||||
// 用户昵称未授权 | |||||
wx.redirectTo({ | |||||
url: "/pages/getuserinfo/index" | |||||
}); | |||||
} else { | |||||
wx.showModal({ | |||||
title: '提示', | |||||
content: err.errMsg, | |||||
showCancel: false | |||||
}) | |||||
} | |||||
}); | |||||
} | |||||
}); | |||||
}, | |||||
/** | |||||
* 检查用户是否有车 | |||||
*/ | |||||
checkUserCarStatus: function () { | |||||
var that = this; | |||||
Http.get({ | |||||
url: config.api.userCarCount, | |||||
data: {} | |||||
}).then(res => { | |||||
if (res.data > 0) { | |||||
// 用户名下有车 | |||||
app.globalData.phone = res.data.phone; | |||||
app.globalData.supportCar = true; | |||||
// 共同登录 | |||||
that.userCarLogin(); | |||||
} | |||||
}) | |||||
.catch(err => { }) | |||||
}, | |||||
jumpToAdd: function () { | |||||
wx.navigateTo({ | |||||
url: `/pages/addPark/addPark?flags=managepalte` | |||||
}); | |||||
}, | |||||
passc: function () { | |||||
wx.navigateTo({ | |||||
url: '/pages/ques/ques', | |||||
}) | |||||
}, | |||||
/** | |||||
* 券绑定车牌 | |||||
*/ | |||||
bindCoupon: function (quanid) { | |||||
var that = this; | |||||
/** | |||||
* etcp | |||||
*/ | |||||
var etcpData = { | |||||
etcpToken: app.globalData.etcpToken, | |||||
carNumber: that.data.listCardNum, | |||||
couponOrderId: quanid | |||||
}; | |||||
/** | |||||
* 停简单 | |||||
*/ | |||||
var tjdData = { | |||||
carNumber: that.data.listCardNum | |||||
}; | |||||
var postCouponData = app.globalData.parkVendor == 1 ? etcpData : tjdData; | |||||
Http.post({ | |||||
url: config.api.getCarCoupon, | |||||
data: postCouponData | |||||
}) | |||||
.then(res => { | |||||
that.getStopFee(that.data.listCardNum); | |||||
that.initUsrCarList(); | |||||
}) | |||||
.catch(err => { | |||||
if (err.message!=undefined) { | |||||
wx.showToast({ | |||||
title: err.message, | |||||
icon: 'none', | |||||
duration: 2000, | |||||
mask: false | |||||
}); | |||||
} | |||||
}) | |||||
}, | |||||
/** | |||||
* 选择优惠券 | |||||
*/ | |||||
// gotoquan: function () { | |||||
// let that = this; | |||||
// if (that.data.quanid) { | |||||
// wx.navigateTo({ | |||||
// url: `/pages/passCar/choicecoupon/choicecoupon?quanid=${that.data.quanid}`, | |||||
// }) | |||||
// } else { | |||||
// wx.navigateTo({ | |||||
// url: '/pages/passCar/choicecoupon/choicecoupon', | |||||
// }) | |||||
// } | |||||
// }, | |||||
closeTicketModal: function () { | |||||
this.setData({ | |||||
showTicketModal: false | |||||
}) | |||||
}, | |||||
/** | |||||
* 停车券 弹框 | |||||
*/ | |||||
openTicketModal: function () { | |||||
this.setData({ | |||||
showTicketModal: true, | |||||
allow_load: true, | |||||
ticketList: [], | |||||
curPageNum: 1, | |||||
}) | |||||
this.getTicketList(0, 1); | |||||
/* if (!this.data.ticketList.length){ | |||||
this.getTicketList(0, 1); | |||||
} */ | |||||
}, | |||||
//获取名下停车券列表 | |||||
getList() { | |||||
var that = this; | |||||
Http.get({ | |||||
url: config.api.couponOrderCarList + "?type=5&couponOrderStatus=0", | |||||
data: { | |||||
pageNum: 1, | |||||
pageSize: 15, | |||||
couponOrderStatus: 0 | |||||
} | |||||
}).then(res => { | |||||
that.setData({ | |||||
couponList: res.data.list | |||||
}); | |||||
}) | |||||
.catch(err => { | |||||
console.log(err) | |||||
}) | |||||
}, | |||||
/** | |||||
* 共同登录 | |||||
*/ | |||||
init: function (carNumber) { | |||||
var that = this; | |||||
app.parkInitCallback = token => { | |||||
that.initPark(); | |||||
that.getParkStatus(); | |||||
if (!app.globalData.carLogin) { | |||||
/** | |||||
* 判断是否授权手机号 | |||||
*/ | |||||
Http.get({ | |||||
url: config.api.checkPhoneStatus, | |||||
data: {} | |||||
}) | |||||
.then(res => { | |||||
Http.post({ | |||||
url: config.api.carInit, | |||||
data: { | |||||
phone: app.globalData.phone | |||||
} | |||||
}).then(res => { | |||||
app.globalData.carLogin = true; | |||||
app.globalData.parkVendor = res.data.vendor; | |||||
if (res.data.token) { | |||||
app.globalData.etcpToken = res.data.token; | |||||
} | |||||
/** | |||||
* 获得停车费用 | |||||
*/ | |||||
that.initUsrCarList("flags"); | |||||
}); | |||||
}) | |||||
.catch(err => { | |||||
if (err.code == 11005) { | |||||
// 用户手机未授权 | |||||
/** | |||||
* 将值传到用户手机号授权的页面 | |||||
* | |||||
*/ | |||||
wx.redirectTo({ | |||||
url: "/pages/getphoneInfo/index" | |||||
}); | |||||
} else if (err.code == 11006) { | |||||
// 用户手机已加密 | |||||
wx.redirectTo({ | |||||
url: "/pages/phoneinput/phoneinput" | |||||
}); | |||||
} else { | |||||
wx.showToast({ | |||||
title: err.errMsg, | |||||
icon: 'none', | |||||
duration: 2000, | |||||
mask: false | |||||
}); | |||||
} | |||||
}) | |||||
} | |||||
}; | |||||
if (app.globalData.token && app.globalData.token != null) { | |||||
app.parkInitCallback(app.globalData.token); | |||||
} | |||||
}, | |||||
bindCar: function (carNum) { | |||||
var that = this; | |||||
// ETCP | |||||
var etcpData = { | |||||
etcpToken: app.globalData.etcpToken, | |||||
carNumber: carNum | |||||
}; | |||||
var tjdData = { | |||||
carNumber: carNum | |||||
}; | |||||
var postData = app.globalData.parkVendor == 1 ? etcpData : tjdData; | |||||
Http.post({ | |||||
url: config.api.bindCar, | |||||
data: postData | |||||
}) | |||||
.then(res => { | |||||
that.setData({ | |||||
addCar: null | |||||
}); | |||||
that.initUsrCarList(); | |||||
wx.showModal({ | |||||
title: "提示", | |||||
showCancel: false, | |||||
content: "绑车牌成功!", | |||||
success: function () { } | |||||
}); | |||||
}) | |||||
.catch(error => { | |||||
wx.showModal({ | |||||
title: "提示", | |||||
showCancel: false, | |||||
content: error.data.message, | |||||
success: function () { } | |||||
}); | |||||
}); | |||||
}, | |||||
/** | |||||
* 车场信息获取 | |||||
*/ | |||||
initPark: function () { | |||||
var that = this; | |||||
Http.get({ | |||||
url: config.api.getParkInfo, | |||||
data: {} | |||||
}) | |||||
.then(res => { | |||||
that.setData({ | |||||
park: res.data | |||||
}) | |||||
}) | |||||
.catch(err => { | |||||
console.log(err); | |||||
// wx.showToast({ | |||||
// title: err.message, | |||||
// icon: 'none', | |||||
// duration: 2000, | |||||
// mask: false | |||||
// }); | |||||
}) | |||||
}, | |||||
/** | |||||
* 车场状态获取 | |||||
*/ | |||||
getParkStatus: function () { | |||||
var that = this; | |||||
Http.get({ | |||||
url: config.api.getParkStatus, | |||||
}) | |||||
.then(res => { | |||||
console.log(res) | |||||
}) | |||||
.catch(err => { | |||||
console.log(err) | |||||
// wx.showToast({ | |||||
// title: err.message, | |||||
// icon:"none" | |||||
// }) | |||||
}) | |||||
}, | |||||
/** | |||||
* 绑定车获取 | |||||
*/ | |||||
initUsrCarList: function (flag) { | |||||
var that = this; | |||||
Http.get({ | |||||
url: config.api.getUserCarList, | |||||
data: {} | |||||
}).then(res => { | |||||
that.setData({ | |||||
carList: res.data | |||||
}); | |||||
/** | |||||
* flag ==flags | |||||
* 表示从首页onShow进来的 | |||||
*/ | |||||
if (flag == "flags" && res.data.length > 0) { | |||||
var listCardNum = res.data[0].carNumber; | |||||
that.setData({ | |||||
listCardNum: listCardNum | |||||
}) | |||||
/** | |||||
* 获得停车费用 | |||||
*/ | |||||
that.getStopFee(listCardNum); | |||||
} | |||||
}) | |||||
.catch(err => { | |||||
wx.showToast({ | |||||
title: err.message, | |||||
icon: 'none', | |||||
duration: 2000, | |||||
mask: false | |||||
}); | |||||
}) | |||||
}, | |||||
/** | |||||
* 获得停车费用修改 | |||||
*/ | |||||
getStopFee: function (carNumber) { | |||||
let that = this; | |||||
let postData = | |||||
app.globalData.parkVendor == 1 ? { | |||||
etcpToken: app.globalData.etcpToken, | |||||
carNumber: carNumber | |||||
} : { | |||||
carNumber: carNumber, | |||||
outCarId: outCarId | |||||
}; | |||||
Http.post({ | |||||
url: config.api.getCarStopFee, | |||||
data: postData | |||||
}) | |||||
.then(res => { | |||||
console.log(res) | |||||
var extraDataStr = { | |||||
params: { | |||||
token: app.globalData.etcpToken, | |||||
syncId: res.data.orderId, | |||||
payType: 6, // 小程序支付 | |||||
CarNumber: carNumber, | |||||
returnUrl: that.data.etcpCallbackUrl, | |||||
source: "FUMAO-001", | |||||
actionId: "1" //操作ID,1:小程序支付 | |||||
} | |||||
}; | |||||
that.setData({ | |||||
extraData: extraDataStr, | |||||
stopFees: res.data, | |||||
timecha: Util.timecha(res.data.exitTime, res.data.entranceTime) | |||||
}); | |||||
that.setData({ | |||||
scroll: true | |||||
}) | |||||
}) | |||||
.catch(error => { | |||||
that.setData({ | |||||
stopFees: {}, | |||||
scroll: true | |||||
}) | |||||
}); | |||||
}, | |||||
/** | |||||
* 下拉刷新 | |||||
*/ | |||||
onPullDownRefresh: function (e) { | |||||
let that = this; | |||||
that.initUsrCarList("flags"); | |||||
that.setData({ | |||||
current:0 | |||||
}) | |||||
wx.stopPullDownRefresh(); | |||||
} | |||||
}); |
@@ -1,8 +0,0 @@ | |||||
{ | |||||
"component": true, | |||||
"usingComponents": { | |||||
"navbar": "../../../components/navbar/navbar" | |||||
}, | |||||
"navigationBarTitleText": "智能停车", | |||||
"enablePullDownRefresh": true | |||||
} |
@@ -1,157 +0,0 @@ | |||||
<navbar text="停车"></navbar> | |||||
<view class='container' wx:if="{{ifHaveCarModular == 1}}" style="padding-top:{{navigationBarHeight}}"> | |||||
<view class='top'> | |||||
<view class='header'> | |||||
<image src='{{parkUrl}}' mode="widthFix"></image>{{park.addr}} | |||||
(<text style='color:#f86661;'>{{park.number}}</text>车位)</view> | |||||
</view> | |||||
<view class='borderBox'> | |||||
<view class='passNumberBox'> | |||||
<!-- 有车牌的时候显示 --> | |||||
<view class='passUp'> | |||||
<view class='addicense_active' wx:if='{{carList.length>0}}'> | |||||
<swiper current="{{current}}" bindchange='onSlideChangeEnd' class='swiper swiper-box' circular='true' indicator-dots='{{indicatorDots}}' autoplay='{{autoplay}}' interval='1500' duration='1500'> | |||||
<block wx:for='{{carList}}' wx:key="unique"> | |||||
<swiper-item class="swiper-item" data-memberKeyword='{{item.carNumber}}'> | |||||
<view class='clearfix clearfix1'> | |||||
<text class='txt01'>{{item.carNumber}}</text> | |||||
</view> | |||||
</swiper-item> | |||||
</block> | |||||
</swiper> | |||||
</view> | |||||
</view> | |||||
</view> | |||||
</view> | |||||
<view class='orderBox' wx:if="{{stopFees.orderId&&carList.length>0&&3>=carList.length}}"> | |||||
<view class='clearfix'> | |||||
<text class="fl">入场时间:</text> | |||||
<text class='fr time'>{{stopFees.entranceTime}}</text> | |||||
</view> | |||||
<view class='clearfix'> | |||||
<text class="fl">停车时长:</text> | |||||
<text class='fr time'>{{timecha}}</text> | |||||
</view> | |||||
<!-- <view class='coupon clearfix' bindtap='gotoquan' wx:if="{{couponList.length>0}}"> --> | |||||
<view class='coupon clearfix' bindtap='openTicketModal' wx:if="{{couponList.length>0}}"> | |||||
<text class='fl'><text class='jians'>券</text>优惠券:</text> | |||||
<view class="fr"> | |||||
<text wx:if="{{quantitle}}">{{quantitle}}</text> | |||||
<text wx:else>{{totalTicketNum}}张可用</text> | |||||
<image class='jiant' src='{{jianUrl}}' mode='widthFix'></image> | |||||
</view> | |||||
</view> | |||||
<view class="clearfix"> | |||||
<text class="fl">待缴费用:</text> | |||||
<text class='fr' style='color:#ff4949;'>{{stopFees.remainingFee}}元</text> | |||||
</view> | |||||
<!-- 停车费用大于0 --> | |||||
<view class="buy-view" wx:if="{{stopFees.orderId&&stopFees.remainingFee>0}}"> | |||||
<navigator bindfail="bindfail" path="pages/main/main" wx:if="{{canIUse}}" class='buy' target="miniProgram" open-type="navigate" app-id="{{etcpAppId}}" extra-data='{{extraData}}' version="{{etcpVersion}}"> | |||||
立即支付 | |||||
</navigator> | |||||
<view wx:if="{{!canIUse}}" class='buy' bindtap='gotoetcp'>立即支付</view> | |||||
</view> | |||||
<!-- 停车费用为0 --> | |||||
<view wx:if="{{stopFees.remainingFee==0}}" class='buy' bindtap='paySuccess'>立即支付</view> | |||||
</view> | |||||
<!-- 没有车牌的时候显示 --> | |||||
<view class='borderUp' bindtap='jumpToAdd' wx:if="{{carList.length==0}}"> | |||||
<view class="myCars"> | |||||
<!-- <image src='{{addUrl}}' mode="widthFix"></image> --> | |||||
添加车牌 | |||||
</view> | |||||
<text class='carNumber'>车辆入场后,才能绑车牌</text> | |||||
</view> | |||||
<view class='bottonBox'> | |||||
<view class='textStyle' bindtap='showquan'> | |||||
<image src='{{tingcheHr}}'></image> | |||||
我的停车券 | |||||
<view class='detail'> | |||||
<image src='{{jianUrl}}'></image> | |||||
</view> | |||||
</view> | |||||
<view class='textStyle' bindtap='gotomange'> | |||||
<image src='{{guanliHr}}'></image> | |||||
车辆管理 | |||||
<view class='detail'> | |||||
<image src='{{jianUrl}}'></image> | |||||
</view> | |||||
</view> | |||||
<view class='textStyle' bindtap='gotodetail' data-rule='{{park.stopFee}}'> | |||||
<image src='{{jiaofei}}'></image> | |||||
缴费规则 | |||||
<view class='detail'> | |||||
<image src='{{jianUrl}}'></image> | |||||
</view> | |||||
</view> | |||||
<view class='textStyle' bindtap='passc'> | |||||
<image src='{{wentiHr}}'></image> | |||||
常见问题 | |||||
<view class='detail'> | |||||
<image src='{{jianUrl}}'></image> | |||||
</view> | |||||
</view> | |||||
</view> | |||||
</view> | |||||
<view class="con" wx:if="{{ifHaveCarModular == 0}}" style="padding-top:{{navigationBarHeight}}"> | |||||
<image class="img" src="{{parkUrl}}" mode="widthFix"></image> | |||||
<text class="txt1">智慧停车即将上线</text> | |||||
<text class="txt2">敬请期待</text> | |||||
</view> | |||||
<!-- --> | |||||
<view bindtap="closeTicketModal" class="gray-bg" catchtouchmove="cancelMove" wx:if="{{showTicketModal}}"></view> | |||||
<view class="ticket-modal" wx:if="{{showTicketModal}}"> | |||||
<view style='padding-top:0;'> | |||||
<view class="nocoupon" wx:if="{{ticketList.length==0}}" style="margin-top:100rpx;"> | |||||
<image src="{{noCoupon}}" mode="widthFix" /> | |||||
<text class="txt001">请您敬请期待</text> | |||||
<text class='txt002'>我们正在筹备一大波优惠活动</text> | |||||
<navigator class='nav' url="/pages/main/index" open-type="switchTab" hover-class="other-navigator-hover"> | |||||
<button hover-class='active'>前往首页看看</button> | |||||
</navigator> | |||||
</view> | |||||
<view wx:if="{{ticketList.length>0}}" class="ticket-title-tip"> | |||||
<text>停车券</text> | |||||
<icon bindtap="closeTicketModal" class="close-icon" type="cancel"></icon> | |||||
</view> | |||||
<scroll-view bindscrolltolower="getMoreList" scroll-y style="height:800rpx;"> | |||||
<view class='section' wx:for='{{ticketList}}' wx:key='{{index}}' bindtap="choicecoupon" data-title="{{item.title}}" data-id="{{item.id}}"> | |||||
<view class='mms'> | |||||
<!-- <text>{{index}}</text> --> | |||||
<!-- <image class='gou' wx:if="{{item.id==quanid}}" mode='widthFix' src='{{gouHr}}'></image> --> | |||||
<view class='detail_msg'> | |||||
<view class='info'> | |||||
<view class='title'> | |||||
<text>{{item.title}}</text> | |||||
</view> | |||||
<view class='subtitle'> | |||||
<text>{{item.subTitle}}</text> | |||||
</view> | |||||
<view class="btns"> | |||||
<text class='yuan' style='margin-right:10rpx;'>售价:{{item.salePrice/100}}元</text><text class='yuan' style='text-decoration:line-through' wx:if="{{item.unit==0}}">{{item.price/100}}元</text> | |||||
<text class='yuan' style='text-decoration:line-through' wx:if="{{item.unit==1}}">{{item.price/100}}小时</text> | |||||
</view> | |||||
</view> | |||||
</view> | |||||
<!-- <image class="liness" src='{{linessUrl}}' mode="widthFix"></image> --> | |||||
<view class='expiretime'> | |||||
<text class="txt1">有效期至:</text> | |||||
<text class="txt1">{{item.expiredTime}}</text> | |||||
</view> | |||||
</view> | |||||
</view> | |||||
</scroll-view> | |||||
<view class="loading" wx:if="{{loading}}"> | |||||
<image src="{{loadingUrl}}" mode="widthFix"></image>{{content}} | |||||
</view> | |||||
</view> | |||||
</view> |
@@ -1,881 +0,0 @@ | |||||
@import "../../app.wxss"; | |||||
page { | |||||
background-color: #fff; | |||||
} | |||||
.container{ | |||||
padding-bottom: 60rpx; | |||||
} | |||||
.con text{ | |||||
display: block; | |||||
text-align: center; | |||||
font-size: 30rpx; | |||||
} | |||||
.header{ | |||||
width: 690rpx; | |||||
height: 80rpx; | |||||
font-size: 32rpx; | |||||
margin: 0 auto; | |||||
border-radius:16rpx; | |||||
line-height: 80rpx; | |||||
letter-spacing: 3rpx; | |||||
} | |||||
.header image{ | |||||
width: 60rpx; | |||||
vertical-align: middle; | |||||
margin-top:-5rpx; | |||||
margin-right:6rpx; | |||||
} | |||||
.top{ | |||||
border-bottom:2rpx solid #f8f8f8; | |||||
} | |||||
.headBox { | |||||
width: 690rpx; | |||||
margin: 30rpx auto 0; | |||||
box-sizing: border-box; | |||||
display: flex; | |||||
background-color: white; | |||||
} | |||||
.headBox image { | |||||
width: 150rpx; | |||||
height: 150rpx; | |||||
margin: 10rpx 30rpx 0 0; | |||||
border-radius: 16rpx; | |||||
} | |||||
.titleName { | |||||
width: 100%; | |||||
line-height: 35rpx; | |||||
height: 35rpx; | |||||
color: #666; | |||||
font-size: 32rpx; | |||||
word-break: break-all; | |||||
text-align: justify; | |||||
font-weight: bold; | |||||
} | |||||
::-webkit-scrollbar { | |||||
width: 0; | |||||
height: 0; | |||||
color: transparent; | |||||
} | |||||
.carLocation, .locationNumber { | |||||
display: inline-block; | |||||
height: 40rpx; | |||||
color: #999; | |||||
font-size: 24rpx; | |||||
line-height: 30rpx; | |||||
} | |||||
.carLocation { | |||||
width: 206rpx; | |||||
font-size: 28rpx; | |||||
} | |||||
.price { | |||||
width: 690rpx; | |||||
font-size: 28rpx; | |||||
color: #999; | |||||
margin: 10rpx auto 0; | |||||
} | |||||
.time { | |||||
color: #999 !important; | |||||
} | |||||
.price .fl { | |||||
width: 15%; | |||||
color: #333; | |||||
} | |||||
.price .fr { | |||||
width: 85%; | |||||
color: #999; | |||||
line-height: 40rpx; | |||||
font-size: 26rpx; | |||||
} | |||||
.titleName .fr { | |||||
color: #999; | |||||
font-size: 27rpx; | |||||
} | |||||
.borderBox { | |||||
width: 750rpx; | |||||
margin-top:30rpx; | |||||
} | |||||
.borderUp { | |||||
width: 680rpx; | |||||
margin: 0 auto; | |||||
font-size: 36rpx; | |||||
border: 2rpx dashed #FD832D; | |||||
border-radius: 16rpx; | |||||
padding-bottom: 40rpx; | |||||
height: 202rpx; | |||||
margin-top: 47rpx; | |||||
} | |||||
.addicense_active { | |||||
width: 690rpx; | |||||
/* box-shadow: 0 4rpx 20rpx 0 rgba(153, 153, 153, 0.35); */ | |||||
border-radius: 12rpx; | |||||
/* background: #02c0ff; *//* padding-bottom: 40rpx; */ | |||||
} | |||||
.myCar { | |||||
display: block; | |||||
text-align: center; | |||||
font-size: 34rpx; | |||||
color: #02c0ff; | |||||
letter-spacing: 0; | |||||
} | |||||
.carNumber { | |||||
display: block; | |||||
height: 50rpx; | |||||
line-height: 50rpx; | |||||
text-align: center; | |||||
font-size: 26rpx; | |||||
color: #999; | |||||
letter-spacing: 0; | |||||
margin-top: 10rpx; | |||||
} | |||||
.addBox { | |||||
width: 750rpx; | |||||
position: relative; | |||||
background-color: white; | |||||
} | |||||
.add { | |||||
position: absolute; | |||||
left: 50%; | |||||
top: 50%; | |||||
transform: translate(-50%, -50%); | |||||
font-size: 34rpx; | |||||
color: #666; | |||||
border: 2px dashed #eee; | |||||
padding: 30rpx 50rpx; | |||||
border-radius: 16rpx; | |||||
} | |||||
.add text { | |||||
font-size: 40rpx; | |||||
} | |||||
.bottonBox { | |||||
width: 750rpx; | |||||
margin-top: 34rpx; | |||||
margin-bottom: 80rpx; | |||||
border-top: 16rpx #f8f8f8 solid; | |||||
} | |||||
.bottonBox view:nth-of-type(1) image{ | |||||
height: 45rpx; | |||||
} | |||||
.textStyle { | |||||
background-color: white; | |||||
height: 88rpx; | |||||
line-height: 88rpx; | |||||
padding-left: 82rpx; | |||||
border-bottom: 1px #f8f8f8 solid; | |||||
position: relative; | |||||
font-size: 30rpx; | |||||
color: #333; | |||||
letter-spacing: 1.16rpx; | |||||
} | |||||
.textStyle image { | |||||
width: 40rpx; | |||||
height: 40rpx; | |||||
top: 24rpx; | |||||
left: 27rpx; | |||||
position: absolute; | |||||
} | |||||
.swiper { | |||||
position: relative; | |||||
margin: 0 auto; | |||||
height: 262rpx; | |||||
} | |||||
.swiper-item { | |||||
width: 365rpx; | |||||
font-size: 75rpx; | |||||
font-weight: 400; | |||||
text-align: center; | |||||
color: rgba(255, 255, 255, 1); | |||||
} | |||||
.swiper-item .clearfix1 { | |||||
background: linear-gradient(127deg,rgba(252,177,74,1) 0%,rgba(254,70,20,1) 100%); | |||||
border-radius: 12rpx; | |||||
padding: 6rpx; | |||||
} | |||||
.tche { | |||||
width: 685rpx; | |||||
height: 88rpx; | |||||
line-height: 88rpx; | |||||
margin: 0 auto; | |||||
background: #00c0ff; | |||||
border-radius: 60rpx; | |||||
position: relative; | |||||
margin-top: 30rpx; | |||||
} | |||||
.txt01 { | |||||
width: 667rpx; | |||||
height: 180rpx; | |||||
line-height: 180rpx; | |||||
float: left; | |||||
background: linear-gradient(127deg,rgba(252,177,74,1) 0%,rgba(254,70,20,1) 100%); | |||||
border-radius: 12rpx; | |||||
border: 3px solid #fff; | |||||
text-align: center; | |||||
font-size: 60rpx; | |||||
} | |||||
.passNumberBox { | |||||
width: 690rpx; | |||||
margin: 32rpx auto 0; | |||||
position: relative; | |||||
background-color: white; | |||||
} | |||||
.numberBox { | |||||
width: 100%; | |||||
} | |||||
.passNumber { | |||||
width: 400rpx; | |||||
height: 100rpx; | |||||
font-size: 32rpx; | |||||
font-weight: 600; | |||||
line-height: 100rpx; | |||||
left: 55rpx; | |||||
position: absolute; | |||||
} | |||||
.nopay { | |||||
height: 80rpx; | |||||
line-height: 80rpx; | |||||
font-weight: 400; | |||||
} | |||||
.number { | |||||
font-size: 48rpx; | |||||
color: #1f2d3d; | |||||
letter-spacing: 0; | |||||
line-height: 52rpx; | |||||
font-weight: 400; | |||||
} | |||||
.manage_plate { | |||||
width: 65%; | |||||
border-radius: 80rpx; | |||||
margin: 40rpx auto 0; | |||||
background: #02c0ff; | |||||
color: #fff; | |||||
text-align: center; | |||||
font-size: 30rpx; | |||||
} | |||||
.button_active { | |||||
opacity: 0.6; | |||||
} | |||||
.btn001 { | |||||
height: 88rpx; | |||||
line-height: 88rpx; | |||||
margin: 0 auto; | |||||
font-size: 30rpx; | |||||
font-weight: 400; | |||||
color: #fff; | |||||
background: none; | |||||
} | |||||
.parkPrice { | |||||
font-size: 30rpx; | |||||
font-weight: 500; | |||||
} | |||||
.deleteButton { | |||||
font-size: 28rpx; | |||||
line-height: 50rpx; | |||||
height: 50rpx; | |||||
top: 50%; | |||||
right: 30rpx; | |||||
position: absolute; | |||||
transform: translate(0, -50%); | |||||
color: white; | |||||
background-color: #00c0ff !important; | |||||
} | |||||
.deleteButton button { | |||||
background-color: #00c0ff !important; | |||||
} | |||||
.detail { | |||||
width: 32rpx; | |||||
height: 32rpx; | |||||
right: 34rpx; | |||||
top: 32rpx; | |||||
position: absolute; | |||||
} | |||||
.detail image { | |||||
width: 44rpx; | |||||
height: 44rpx; | |||||
position: absolute; | |||||
left: 0; | |||||
top: 0; | |||||
} | |||||
.voucher { | |||||
width: 90%; | |||||
padding: 0 5%; | |||||
background-color: #fff; | |||||
/* background-color: #cbcbcb; */ | |||||
height: 80rpx; | |||||
position: relative; | |||||
margin: 0 0 12rpx 0; | |||||
border-bottom: 2rpx #fff solid; | |||||
display: flex; | |||||
justify-content: space-between;; | |||||
} | |||||
.textV1, .textV2 { | |||||
height: 58rpx; | |||||
width: 100rpx; | |||||
padding-top: 26rpx; | |||||
text-align: center; | |||||
line-height: 80rxp; | |||||
font-size: 24rpx; | |||||
color: #333; | |||||
} | |||||
.textV2 { | |||||
margin-top: 0rpx; | |||||
padding: 0; | |||||
/* background-color: rgb(0, 192, 255); */ | |||||
border-radius: 10rpx; | |||||
width: 300rpx; | |||||
height: 80rpx; | |||||
line-height: 80rpx; | |||||
font-size: 20rpx; | |||||
border: 4rpx #fff solid; | |||||
margin-bottom: 20rpx; | |||||
} | |||||
.textV3 { | |||||
width: 225rpx; | |||||
} | |||||
.choice { | |||||
width: 80rpx; | |||||
height: 80rpx; | |||||
position: relative; | |||||
} | |||||
.choice image { | |||||
position: absolute; | |||||
left: 50%; | |||||
top: 50%; | |||||
transform: translate(-50%, -50%); | |||||
width: 30rpx; | |||||
height: 30rpx; | |||||
} | |||||
.buy-view { | |||||
background: #fff; | |||||
position: relative; | |||||
height: 88rpx; | |||||
margin-top: 30rpx; | |||||
} | |||||
.buy { | |||||
background: linear-gradient(127deg,rgba(252,177,74,1) 0%,rgba(254,70,20,1) 100%); | |||||
height: 88rpx; | |||||
width: 73%; | |||||
margin: 0 auto; | |||||
color: #fff; | |||||
font-size: 36rpx; | |||||
line-height: 88rpx; | |||||
border-radius: 60rpx; | |||||
position: relative; | |||||
z-index: 100; | |||||
text-align: center; | |||||
} | |||||
.buyBox { | |||||
height: 88rpx; | |||||
line-height: 88rpx; | |||||
width: 98%; | |||||
position: absolute; | |||||
left: 0; | |||||
right: 0; | |||||
bottom: 0; | |||||
top: 0; | |||||
z-index: 100000000; | |||||
border-radius: 60rpx; | |||||
} | |||||
.active { | |||||
opacity: 0.6; | |||||
} | |||||
.borderBox { | |||||
width: 750rpx; | |||||
} | |||||
.carmanage { | |||||
position: relative; | |||||
width: 690rpx; | |||||
margin: 15rpx auto 0; | |||||
height: 60rpx; | |||||
line-height: 60rpx; | |||||
/* border-bottom: 1rpx solid #eee; */ | |||||
} | |||||
.carmanage .fr { | |||||
font-size: 28rpx; | |||||
color: #888; | |||||
letter-spacing: 1.16rpx; | |||||
text-align: right; | |||||
} | |||||
.fl { | |||||
float: left; | |||||
} | |||||
.fr { | |||||
float: right; | |||||
} | |||||
.carmanage .fl { | |||||
width: 400rpx; | |||||
} | |||||
.carmanage .fr image { | |||||
position: absolute; | |||||
top: 0; | |||||
right: 0; | |||||
bottom: 0; | |||||
margin: auto; | |||||
width: 44rpx; | |||||
height: 44rpx; | |||||
} | |||||
.carmanage image { | |||||
width: 40rpx; | |||||
vertical-align: middle; | |||||
} | |||||
.mycar { | |||||
display: inline-block; | |||||
font-size: 33rpx; | |||||
color: #666; | |||||
line-height: 35rpx; | |||||
letter-spacing: 1.16rpx; | |||||
} | |||||
.num { | |||||
display: inline-block; | |||||
font-size: 26rpx; | |||||
color: #999; | |||||
letter-spacing: 0; | |||||
margin-left: 20rpx; | |||||
} | |||||
.orderBox { | |||||
padding: 0 45rpx; | |||||
position: relative; | |||||
} | |||||
.priceBox { | |||||
display: inline-block; | |||||
width: 355rpx; | |||||
} | |||||
.priceBox text { | |||||
color: #333; | |||||
font-size: 28rpx; | |||||
display: block; | |||||
text-align: left; | |||||
} | |||||
.payBox { | |||||
width: 250rpxpx; | |||||
} | |||||
.payBox button { | |||||
width: 230rpx; | |||||
border: 0; | |||||
font-size: 32rpx; | |||||
margin-top: 13rpx; | |||||
margin-right: 20rpx; | |||||
background-color: lightgreen; | |||||
color: white; | |||||
} | |||||
input { | |||||
outline: none; | |||||
border: none; | |||||
list-style: none; | |||||
} | |||||
button::after { | |||||
border: none; | |||||
} | |||||
.right { | |||||
display: inline-block; | |||||
width: 328rpx; | |||||
} | |||||
.textRight { | |||||
margin-left: 0; | |||||
margin-right: 25rpx; | |||||
text-align: left; | |||||
font-size: 30rpx !important; | |||||
color: #333 !important; | |||||
} | |||||
.myCars image { | |||||
width: 44rpx; | |||||
height: 44rpx; | |||||
vertical-align: middle; | |||||
margin-right: 14rpx; | |||||
} | |||||
.myCars { | |||||
font-size: 34rpx; | |||||
color: #02c0ff; | |||||
letter-spacing: 0; | |||||
text-align: center; | |||||
padding-top: 58rpx; | |||||
} | |||||
.dots { | |||||
position: absolute; | |||||
left: 0; | |||||
right: 0; | |||||
bottom: 19rpx; | |||||
display: flex; | |||||
justify-content: center; | |||||
height: 19rpx; | |||||
background: #fff; | |||||
} | |||||
.dots .dot { | |||||
margin: 0 8rpx; | |||||
width: 32rpx; | |||||
height: 14rpx; | |||||
background: #ccc; | |||||
border-radius: 8rpx; | |||||
transition: all 0.6s; | |||||
} | |||||
.dots .dot.active { | |||||
width: 49rpx; | |||||
height: 4rpx; | |||||
background: rgba(86, 189, 248, 1); | |||||
border-radius: 6rpx; | |||||
} | |||||
.coupon { | |||||
font-size: 28rpx; | |||||
color: #666; | |||||
} | |||||
.orderBox .fl { | |||||
line-height: 70rpx; | |||||
font-size: 28rpx; | |||||
color: #333; | |||||
} | |||||
.orderBox .fr { | |||||
line-height: 70rpx; | |||||
font-size: 28rpx; | |||||
color: #FD832D; | |||||
} | |||||
.jians { | |||||
font-size: 22rpx; | |||||
display: inline-block; | |||||
width: 34rpx; | |||||
height: 34rpx; | |||||
text-align: center; | |||||
background: #ff4949; | |||||
line-height: 34rpx; | |||||
color: #fff; | |||||
border-radius: 6rpx; | |||||
margin-right: 6rpx; | |||||
} | |||||
.jiant{ | |||||
display: inline-block; | |||||
width: 44rpx; | |||||
height: 44rpx; | |||||
vertical-align: middle; | |||||
margin-top: -6rpx; | |||||
margin-right: -10rpx; | |||||
} | |||||
.img { | |||||
display: block; | |||||
width: 211rpx; | |||||
margin: 168rpx auto 40rpx; | |||||
} | |||||
.txt1 { | |||||
font-size: 22rpx; | |||||
color: #A6A6A6; | |||||
letter-spacing: 0; | |||||
} | |||||
.txt2 { | |||||
display: block; | |||||
font-size: 28rpx; | |||||
color: #999; | |||||
letter-spacing: 0; | |||||
text-align: center; | |||||
line-height: 40rpx; | |||||
margin-top: 10rpx; | |||||
} | |||||
.gray-bg { | |||||
position: fixed; | |||||
left: 0; | |||||
top: 0; | |||||
width: 100%; | |||||
height: 100%; | |||||
z-index: 1000; | |||||
background: rgba(0,0,0,.2); | |||||
} | |||||
.ticket-modal { | |||||
position: fixed; | |||||
left: 50%; | |||||
top: 50%; | |||||
width: 80%; | |||||
height: 880rpx; | |||||
z-index: 10000; | |||||
transform: translate(-50%, -50%); | |||||
background: #fff; | |||||
} | |||||
.nocoupon image { | |||||
width: 300rpx; | |||||
display: block; | |||||
margin: 3% auto 0; | |||||
} | |||||
.txt001 { | |||||
display: block; | |||||
line-height: 48rpx; | |||||
font-size: 34rpx; | |||||
color: #333; | |||||
letter-spacing: 0; | |||||
text-align: center; | |||||
} | |||||
.txt002 { | |||||
display: block; | |||||
margin-top: 1%; | |||||
font-size: 28rpx; | |||||
color: #999; | |||||
letter-spacing: 0; | |||||
line-height: 40rpx; | |||||
text-align: center; | |||||
} | |||||
.nocoupon button { | |||||
background: linear-gradient(127deg,rgba(252,177,74,1) 0%,rgba(254,70,20,1) 100%); | |||||
color: #fff; | |||||
font-size: 30rpx; | |||||
width: 74%; | |||||
border-radius: 60rpx; | |||||
height: 78rpx; | |||||
line-height: 78rpx; | |||||
margin-top: 100rpx; | |||||
} | |||||
.loading { | |||||
text-align: center; | |||||
height: 80rpx; | |||||
line-height: 80rpx; | |||||
font-size: 26rpx; | |||||
color: #999; | |||||
} | |||||
.loading image { | |||||
width: 60rpx; | |||||
height: 60rpx; | |||||
vertical-align: middle; | |||||
margin-right: 10rpx; | |||||
} | |||||
.section { | |||||
position: relative; | |||||
width: 90%; | |||||
margin-left: 5%; | |||||
} | |||||
.mms { | |||||
width: 100%; | |||||
height: 180rpx !important; | |||||
background: #fff; | |||||
/* padding: 30rpx 0 0; */ | |||||
margin: 0 auto 40rpx; | |||||
/* border-radius: 16rpx; */ | |||||
/* border-top: 8rpx solid #02b7ff; */ | |||||
box-shadow: 0 6px 20px 0 rgba(0, 0, 0, 0.10); | |||||
} | |||||
.detail_msg { | |||||
display: flex; | |||||
padding-top: 16rpx; | |||||
padding-bottom: 16rpx; | |||||
background: linear-gradient(127deg,rgba(252,177,74,1) 0%,rgba(254,70,20,1) 100%); | |||||
} | |||||
.logo { | |||||
width: 60rpx; | |||||
height: 60rpx; | |||||
/* border: 1px solid #f8f8f8; */ | |||||
border-radius: 50rpx; | |||||
display: block; | |||||
margin: 15rpx 20rpx 0 20rpx; | |||||
} | |||||
.logo image { | |||||
width: 60rpx; | |||||
height: 60rpx; | |||||
border-radius: 50%; | |||||
} | |||||
.info view:nth-child(1) { | |||||
display: flex; | |||||
justify-content: space-between; | |||||
padding: 0 4%; | |||||
margin-top: 15rpx; | |||||
} | |||||
.info { | |||||
width: 100%; | |||||
border-left: 1rpx #FFF dashed; | |||||
} | |||||
.info view:nth-child(1) text { | |||||
font-size: 32rpx; | |||||
line-height: 32rpx; | |||||
height: 32rpx; | |||||
color: #FFFFFF; | |||||
letter-spacing: 0; | |||||
width: 400rpx; | |||||
display: inline-block; | |||||
white-space: nowrap; | |||||
text-overflow: ellipsis; | |||||
overflow: hidden; | |||||
} | |||||
.info view:nth-child(2) { | |||||
padding-left: 4%; | |||||
font-size: 22rpx; | |||||
color: #FFFFFF; | |||||
letter-spacing: 0; | |||||
margin-top: 6rpx; | |||||
display: inline-block; | |||||
white-space: nowrap; | |||||
text-overflow: ellipsis; | |||||
overflow: hidden; | |||||
width: 400rpx; | |||||
} | |||||
.info view:nth-child(3) { | |||||
margin-left: 20rpx; | |||||
} | |||||
.active { | |||||
color: #fff; | |||||
opacity: 0.6; | |||||
/* background: #02c0ff; */ | |||||
} | |||||
.expiretime { | |||||
display: block; | |||||
width: 100%; | |||||
text-align: left; | |||||
text-indent: 1em; | |||||
height: 50rpx; | |||||
line-height: 50rpx; | |||||
font-size: 22rpx; | |||||
color: #A6A6A6; | |||||
letter-spacing: 0; | |||||
} | |||||
.ticket-title-tip { | |||||
position: relative; | |||||
width: 100%; | |||||
height: 76rpx; | |||||
line-height: 76rpx; | |||||
text-align: center; | |||||
color: #353535; | |||||
font-size: 34rpx; | |||||
} | |||||
.close-icon { | |||||
position: absolute; | |||||
right: 10rpx; | |||||
transform: translateY(16rpx); | |||||
} | |||||
.btns { | |||||
position: absolute; | |||||
right: 120rpx; | |||||
top: 50rpx; | |||||
height: 48rpx; | |||||
line-height: 48rpx; | |||||
text-align: right; | |||||
color: #FFF; | |||||
font-size: 40rpx; | |||||
} | |||||
.yuan { | |||||
color: #FFF; | |||||
font-size: 26rpx; | |||||
} | |||||
.gou { | |||||
position: absolute; | |||||
top:45rpx; | |||||
right: 30rpx; | |||||
width: 60rpx; | |||||
} | |||||
.swiper-box .wx-swiper-dots.wx-swiper-dots-horizontal{ | |||||
margin-bottom: 2rpx; | |||||
} | |||||
.swiper-box .wx-swiper-dot{ | |||||
width:40rpx; | |||||
display: inline-flex; | |||||
height: 6rpx; | |||||
margin-left: 10rpx; | |||||
border-radius:6rpx; | |||||
justify-content:space-between; | |||||
} | |||||
.swiper-box .wx-swiper-dot::before{ | |||||
content: ''; | |||||
flex-grow: 1; | |||||
background: #ccc8c8; | |||||
} | |||||
.swiper-box .wx-swiper-dot-active::before{ | |||||
background:#f6792b; | |||||
} |
@@ -98,7 +98,7 @@ Page({ | |||||
}, | }, | ||||
goback: function() { | goback: function() { | ||||
wx.switchTab({ | wx.switchTab({ | ||||
url: '/pages/main/index', | |||||
url: '/index/index', | |||||
}) | }) | ||||
}, | }, | ||||
onShareAppMessage: function (options) { | onShareAppMessage: function (options) { | ||||
@@ -41,7 +41,7 @@ Page({ | |||||
}, | }, | ||||
goback: function () { | goback: function () { | ||||
wx.switchTab({ | wx.switchTab({ | ||||
url: '/pages/main/index', | |||||
url: '/index/index', | |||||
}) | }) | ||||
}, | }, | ||||
/** | /** | ||||
@@ -26,7 +26,7 @@ Page({ | |||||
}, | }, | ||||
goback: function () { | goback: function () { | ||||
wx.switchTab({ | wx.switchTab({ | ||||
url: '/pages/main/index', | |||||
url: '/index/index', | |||||
}) | }) | ||||
}, | }, | ||||
//列表 | //列表 | ||||
@@ -56,7 +56,7 @@ Page({ | |||||
goback: function () { | goback: function () { | ||||
wx.switchTab({ | wx.switchTab({ | ||||
url: '/pages/main/index', | |||||
url: '/index/index', | |||||
}) | }) | ||||
}, | }, | ||||
/** | /** | ||||
@@ -54,7 +54,7 @@ Page({ | |||||
}, | }, | ||||
gotoIndex(){ | gotoIndex(){ | ||||
wx.switchTab({ | wx.switchTab({ | ||||
url: '/pages/main/index', | |||||
url: '/index/index', | |||||
}) | }) | ||||
}, | }, | ||||
gotoshare() { | gotoshare() { | ||||
@@ -108,7 +108,7 @@ Page({ | |||||
}, | }, | ||||
gotoIndex: function() { | gotoIndex: function() { | ||||
wx.switchTab({ | wx.switchTab({ | ||||
url: '/pages/main/index', | |||||
url: '/index/index', | |||||
}) | }) | ||||
}, | }, | ||||
/** | /** | ||||
@@ -35,7 +35,7 @@ Page({ | |||||
}, | }, | ||||
goback: function () { | goback: function () { | ||||
wx.switchTab({ | wx.switchTab({ | ||||
url: '/pages/main/index', | |||||
url: '/index/index', | |||||
}) | }) | ||||
}, | }, | ||||
onLoad: function (options) { | onLoad: function (options) { | ||||
@@ -29,7 +29,7 @@ Page({ | |||||
}, | }, | ||||
goback: function () { | goback: function () { | ||||
wx.switchTab({ | wx.switchTab({ | ||||
url: '/pages/main/index', | |||||
url: '/index/index', | |||||
}) | }) | ||||
}, | }, | ||||
topicShow(id){ | topicShow(id){ | ||||
@@ -1,276 +0,0 @@ | |||||
const navigationBarHeight = (getApp().statusBarHeight + 44) + 'px' | |||||
const extConfig = wx.getExtConfigSync ? wx.getExtConfigSync() : {} | |||||
var config = require("../../config/config.js"); | |||||
var app = getApp(); | |||||
const Http = require("../../utils/HttpBasics"); | |||||
const QR = require("../../utils/memberqrcode.js"); | |||||
const imgurl = require("../../utils/imgurl"); | |||||
const bgColor = require("../../utils/bgColor.js") | |||||
Page({ | |||||
/** | |||||
* 页面的初始数据 | |||||
*/ | |||||
data: { | |||||
navigationBarHeight, | |||||
banneColor: bgColor.colorFirst.user.banneColor, | |||||
levelBg: bgColor.colorFirst.user.levelBg, | |||||
view: bgColor.colorFirst.user.view, | |||||
redirectUrl: imgurl.redirect.url, | |||||
qrcodeUrl: imgurl.qrcode.url, | |||||
editUrl: imgurl.edit.url, | |||||
activeUrl: imgurl.active.url, | |||||
dingUrl: imgurl.ding.url, | |||||
quansUrl: imgurl.quans.url, | |||||
wmintegral: imgurl.wmintegral.url, | |||||
cardiconUrl: imgurl.cardicon.url, | |||||
myactivitygift: imgurl.myactivitygift.url, | |||||
myactivity: imgurl.myactivity.url, | |||||
cheUrl: imgurl.che.url, | |||||
giftUrl: imgurl.gift.url, | |||||
wmbarginicon: imgurl.wmbarginicon.url, | |||||
wmspellgroup: imgurl.wmspellgroup.url, | |||||
canIUse: wx.canIUse('official-account'), | |||||
mineFlag:"", | |||||
flag: 'hidden', | |||||
score: '0', | |||||
name: "", | |||||
birthdate: "", | |||||
sex: "", | |||||
showEdit: false, | |||||
ismember: false, | |||||
showQrcode: false, | |||||
canvasHidden: false, | |||||
maskHidden: true, | |||||
imagePath: '', | |||||
appVersion: "", | |||||
showmemberqrcode: false, | |||||
placeholder: '' | |||||
}, | |||||
checkUserStatus() { | |||||
let that = this; | |||||
Http.get({ | |||||
url: config.api.checkPhoneStatus, | |||||
data: {} | |||||
}).then(res => { | |||||
}).catch(err => { | |||||
wx.navigateTo({ | |||||
url: `/pages/getphoneInfo/index?mineFlag=mine`, | |||||
}) | |||||
}) | |||||
}, | |||||
/** | |||||
* 跳转到成长值的页面 | |||||
*/ | |||||
gotograde: function() { | |||||
wx.navigateTo({ | |||||
url: '/pages/czdetail/czdetail', | |||||
}) | |||||
}, | |||||
navigateTo() { | |||||
wx.navigateTo({ | |||||
url: `/pages/main/index` | |||||
}); | |||||
}, | |||||
showVersion: function() { | |||||
/** | |||||
* 长按显示版本号 | |||||
*/ | |||||
let that = this; | |||||
if (that.data.flag == 'hidden') { | |||||
that.setData({ | |||||
flag: 'show' | |||||
}); | |||||
} | |||||
}, | |||||
gotoedit: function() { | |||||
wx.navigateTo({ | |||||
url: '/pages/edit/edit', | |||||
}) | |||||
}, | |||||
onLoad() { | |||||
this.getLocation(); | |||||
this.updateScene(); | |||||
}, | |||||
/** | |||||
* 获得经纬度 | |||||
*/ | |||||
getLocation() { | |||||
let that = this; | |||||
wx.getLocation({ | |||||
type: "wgs84", | |||||
success: function(res) { | |||||
console.log(res) | |||||
if (res && res.longitude && res.latitude) { | |||||
Http.post({ | |||||
url: config.api.updateLBS, | |||||
data: { | |||||
latitude: res.latitude, | |||||
longitude: res.longitude | |||||
} | |||||
}).then(res => { | |||||
console.log(res) | |||||
}) | |||||
} | |||||
}, | |||||
fail: error => { | |||||
console.log(error); | |||||
} | |||||
}) | |||||
}, | |||||
/** | |||||
* 用户更新scene | |||||
*/ | |||||
updateScene(){ | |||||
Http.post({ | |||||
url: config.api.updateScene, | |||||
data: { | |||||
scene: app.globalData.scene | |||||
} | |||||
}).then(res => { | |||||
console.log(res) | |||||
}) | |||||
}, | |||||
/** | |||||
* 生命周期函数--监听页面显示 | |||||
*/ | |||||
onShow: function() { | |||||
let that = this; | |||||
that.checkUserStatus(); | |||||
that.setData({ | |||||
appVersion: extConfig.appVersion, | |||||
}) | |||||
/** | |||||
* couponNum | |||||
* couponNum2 | |||||
*/ | |||||
let num = wx.getStorageSync('couponNum'); | |||||
let num1 = wx.getStorageSync('couponNum2'); | |||||
wx.hideTabBarRedDot({ | |||||
index: 3 | |||||
}); | |||||
wx.hideTabBarRedDot({ | |||||
index: 3 | |||||
}); | |||||
if (num == 'couponNum1') { | |||||
wx.setStorage({ | |||||
key: 'couponNum', | |||||
data: "couponNum1", | |||||
}) | |||||
that.setData({ | |||||
couponNum: "couponNum1" | |||||
}) | |||||
} else if (num == 'couponNum') { | |||||
that.setData({ | |||||
couponNum: "couponNum" | |||||
}) | |||||
}; | |||||
if (num1 == 'couponNum3') { | |||||
wx.setStorage({ | |||||
key: 'couponNum2', | |||||
data: "couponNum3", | |||||
}) | |||||
that.setData({ | |||||
couponNum2: "couponNum3" | |||||
}) | |||||
} else if (num1 == 'couponNum2') { | |||||
that.setData({ | |||||
couponNum2: "couponNum2" | |||||
}); | |||||
}; | |||||
Http.get({ | |||||
url: config.api.getScore, | |||||
data: {} | |||||
}).then(res => { | |||||
if (res.data.address && res.data.name && res.data.sex && res.data.birthdate) { | |||||
that.setData({ | |||||
showEdit: true | |||||
}) | |||||
} | |||||
that.setData({ | |||||
score: res.data.score, | |||||
levelName: res.data.levelName, | |||||
}) | |||||
if (res.data.nickName) { | |||||
that.setData({ | |||||
ismember: true, | |||||
memberId: res.data.id | |||||
}) | |||||
var size = this.setCanvasSize(); | |||||
var initUrl = JSON.stringify({ | |||||
flagid: res.data.id | |||||
}); | |||||
that.createQrCode(initUrl, "mycanvas1", size.w, size.h); | |||||
} | |||||
}) | |||||
.catch(err => { | |||||
wx.showModal({ | |||||
title: '提示', | |||||
content: err.errMsg, | |||||
showCancel: false | |||||
}) | |||||
}) | |||||
//暂时注释 | |||||
// that.getrun(); | |||||
}, | |||||
hideQrcode: function() { | |||||
let that = this; | |||||
that.setData({ | |||||
showQrcode: false | |||||
}) | |||||
}, | |||||
//适配不同屏幕大小的canvas | |||||
setCanvasSize: function() { | |||||
var size = {}; | |||||
try { | |||||
var res = wx.getSystemInfoSync(); | |||||
var scale = 750 / 500; | |||||
//不同屏幕下canvas的适配比例;设计稿是750宽 | |||||
var width = res.windowWidth / scale; | |||||
var height = width; | |||||
//canvas画布为正方形 | |||||
size.w = width; | |||||
size.h = height; | |||||
} catch (e) { | |||||
// Do something when catch error | |||||
console.log("获取设备信息失败" + e); | |||||
} | |||||
return size; | |||||
}, | |||||
createQrCode: function(url, canvasId, cavW, cavH) { | |||||
//调用插件中的draw方法,绘制二维码图片 | |||||
QR.api.draw(url, canvasId, cavW, cavH); | |||||
}, | |||||
qrcode: function(e) { | |||||
var that = this; | |||||
that.setData({ | |||||
showQrcode: true | |||||
}) | |||||
wx.showToast({ | |||||
title: '生成中...', | |||||
icon: 'loading', | |||||
duration: 2000 | |||||
}); | |||||
var st = setTimeout(function() { | |||||
wx.hideToast() | |||||
var size = that.setCanvasSize(); | |||||
var url = JSON.stringify({ | |||||
END: "C", | |||||
TYPE: "memberCode", | |||||
ID: that.data.memberId, | |||||
}) | |||||
that.createQrCode(url, "mycanvas1", size.w, size.h); | |||||
that.setData({ | |||||
maskHidden: true | |||||
}); | |||||
clearTimeout(st); | |||||
}, 1000) | |||||
}, | |||||
close: function() { | |||||
this.setData({ | |||||
showmemberqrcode: false, | |||||
}) | |||||
} | |||||
}); |
@@ -1,9 +0,0 @@ | |||||
{ | |||||
"usingComponents": { | |||||
"i-button": "../../dist/button/index", | |||||
"navbar": "../../components/navbar/navbar" | |||||
}, | |||||
"navigationBarBackgroundColor": "#FD832D", | |||||
"navigationBarTextStyle": "white", | |||||
"disableScroll": true | |||||
} |
@@ -1,104 +0,0 @@ | |||||
<navbar text="我的" background='#FD832D' color="white"></navbar> | |||||
<view class="user" style="padding-top:{{navigationBarHeight}};"> | |||||
<view class="top" style='background:{{banneColor}}'></view> | |||||
<view class="top-content"> | |||||
<view class='user_title '> | |||||
<view class="user-avatar" bindtap='gotoedit'> | |||||
<open-data class="open" type="userAvatarUrl"></open-data> | |||||
</view> | |||||
<view class="user-name" bindtap='gotoedit'> | |||||
<open-data class="name" type="userNickName" ></open-data> | |||||
<view class=' usre_level'style='background:{{levelBg}}'> | |||||
<text class='chengzhang '>{{levelName}}</text> | |||||
</view> | |||||
</view> | |||||
<view class="user-phone" bindtap='gotograde'> | |||||
<text class="my">我的</text> | |||||
<text class="chengzhang_h" >成长值{{score}}</text> | |||||
<text class="my my_line">|</text> | |||||
<!-- <text class="my">更多成长值</text> --> | |||||
<text class="view" style='color:{{view}}'>更多成长值</text> | |||||
</view> | |||||
<view class="user-btns"> | |||||
<!-- 我的订单 --> | |||||
<navigator url="/pages/order/index/index?id=all"> | |||||
<view class="user-btn app-border-bottom"> | |||||
<view> | |||||
<image class='icons' src="{{dingUrl}}" mode='widthFix'></image>我的订单</view> | |||||
</view> | |||||
</navigator> | |||||
<!-- 我的券包 --> | |||||
<navigator url="/pages/couponorder/index/index"> | |||||
<view class="user-btn app-border-bottom"> | |||||
<view> | |||||
<image class='icons' src="{{quansUrl}}" mode='widthFix'></image>我的券包</view> | |||||
<view> | |||||
<text class="couponnum" wx:if="{{couponNum=='couponNum'}}"></text> | |||||
</view> | |||||
</view> | |||||
</navigator> | |||||
<navigator url="/pages/cardorder/index/index"> | |||||
<view class="user-btn app-border-bottom"> | |||||
<view> | |||||
<image class='icons' src="{{cardiconUrl}}" mode='widthFix'></image>我的卡包</view> | |||||
<view> | |||||
<text class="couponnum" wx:if="{{couponNum2=='couponNum2'}}"></text> | |||||
</view> | |||||
</view> | |||||
</navigator> | |||||
</view> | |||||
</view> | |||||
</view> | |||||
<view class='btns_bg'> | |||||
<view class="user-btns"> | |||||
<!-- 我的砍价 --> | |||||
<navigator url="/pages/bargain/bargain?from=myhtml" open-type="navigate"> | |||||
<view class="user-btn app-border-bottom"> | |||||
<view> | |||||
<image class='icons' src="{{wmbarginicon}}" mode='widthFix'></image>我的砍价</view> | |||||
</view> | |||||
</navigator> | |||||
<!-- 我的拼团 --> | |||||
<navigator url="/pages/spellGroup/spellGroup?from=myhtml" open-type="navigate"> | |||||
<view class="user-btn app-border-bottom"> | |||||
<view> | |||||
<image class='icons' src="{{wmspellgroup}}" mode='widthFix'></image>我的拼团</view> | |||||
</view> | |||||
</navigator> | |||||
<!-- 积分商城 --> | |||||
<navigator url="/pages/integralmall/index"> | |||||
<view class="user-btn app-border-bottom"> | |||||
<view> | |||||
<image class='icons' src="{{wmintegral}}" mode='widthFix'></image>积分商城</view> | |||||
</view> | |||||
</navigator> | |||||
<!-- 当商场开启使用折扣按钮的时候, --> | |||||
<navigator url="/pages/specialcourtesy/specialcourtesy"> | |||||
<view class="user-btn app-border-bottom"> | |||||
<view> | |||||
<image class='icons' src="{{giftUrl}}" mode='widthFix'></image>特享礼遇</view> | |||||
</view> | |||||
</navigator> | |||||
<navigator url="/pages/user/myactivity/index" open-type="navigate"> | |||||
<view class="user-btn app-border-bottom"> | |||||
<view> | |||||
<image class='icons' src="{{myactivity}}" mode='widthFix'></image>我的活动</view> | |||||
</view> | |||||
</navigator> | |||||
</view> | |||||
</view> | |||||
<view class="margin"></view> | |||||
<view bindlongtap='showVersion' class='version'> | |||||
<view wx:if="{{flag=='show'}}">版本号:{{appVersion}}</view> | |||||
<view wx:if="{{flag=='hidden'}}"></view> | |||||
</view> | |||||
<view class='of' wx:if="{{canIUse}}"> | |||||
<official-account class="gzh"></official-account> | |||||
</view> | |||||
</view> | |||||
<view class='showQrcode' bindtap='hideQrcode' wx:if="{{showQrcode}}"> | |||||
<view class="canvas-box"> | |||||
<canvas hidden="{{canvasHidden}}" style="height:500rpx;background:0 0 0 .6;margin-top:10rpx;" canvas-id="mycanvas1" /> | |||||
<text class='memberIds'>会员ID{{memberId}}</text> | |||||
</view> | |||||
</view> |
@@ -1,392 +0,0 @@ | |||||
page{ | |||||
overflow-y:visible!important; | |||||
height: 100%!important; | |||||
background: #f6f6f6; | |||||
} | |||||
.icons { | |||||
display: block; | |||||
width: 50rpx; | |||||
margin: 0 auto 10rpx; | |||||
} | |||||
.navigator-hover { | |||||
opacity: 1 !important; | |||||
background: #fff; | |||||
} | |||||
.version { | |||||
position: absolute; | |||||
right: 0; | |||||
width: 307rpx; | |||||
height: 50rpx; | |||||
bottom: 0; | |||||
text-align: center; | |||||
font-size: 15rpx; | |||||
color: #999; | |||||
} | |||||
.couponnum { | |||||
display: inline-block; | |||||
position: absolute; | |||||
top: 39rpx; | |||||
bottom: 0; | |||||
right: 20px; | |||||
width: 16rpx; | |||||
height: 16rpx; | |||||
border-radius: 50%; | |||||
background: red; | |||||
font-size: 22rpx; | |||||
} | |||||
.user-avatar open-data { | |||||
display: block; | |||||
width: 100%; | |||||
height: 100%; | |||||
} | |||||
.user-name{ | |||||
font-family: PingFangSC-Medium; | |||||
height: 42rpx; | |||||
margin-top:66rpx; | |||||
letter-spacing: 0.64rpx; | |||||
line-height: 44rpx; | |||||
font-size: 30rpx; | |||||
color: #3C3C3C; | |||||
font-weight:600; | |||||
display: flex; /*设置显示样式**/ | |||||
align-items: center; /**子view垂直居中*/ | |||||
vertical-align: center; /**垂直居中*/ | |||||
justify-content: center; /**内容居中*/ | |||||
flex-direction: row; | |||||
} | |||||
.user-phone { | |||||
font-family: PingFangSC-Regular; | |||||
letter-spacing: 0.64rpx; | |||||
line-height: 44rpx; | |||||
font-size: 36rpx; | |||||
color: #000; | |||||
padding:20rpx; | |||||
text-align: center; | |||||
} | |||||
.user-avatar { | |||||
position: absolute; | |||||
width: 128rpx; | |||||
height: 128rpx; | |||||
border-radius: 50%; | |||||
overflow: hidden; | |||||
top:-64rpx; | |||||
left: 300rpx; | |||||
} | |||||
.chengzhang { | |||||
font-size: 24rpx; | |||||
font-weight: 400; | |||||
color: #FFFFFF; | |||||
padding: 0 8rpx; | |||||
} | |||||
.view { | |||||
font-size: 24rpx; | |||||
} | |||||
.view image { | |||||
width: 12rpx; | |||||
vertical-align: middle; | |||||
margin-top: -6rpx; | |||||
} | |||||
.bannerbg { | |||||
width: 100%; | |||||
} | |||||
.bannerbg image { | |||||
display: block; | |||||
width: 100%; | |||||
} | |||||
.open01 { | |||||
display: block; | |||||
width: 120rpx; | |||||
height: 120rpx; | |||||
} | |||||
.user-btns{ | |||||
background: #fff; | |||||
display: flex; | |||||
text-align: center; | |||||
flex-wrap: wrap; | |||||
} | |||||
.user-btns navigator{ | |||||
width: 33.3%; | |||||
height: 160rpx; | |||||
} | |||||
.user-btns:nth-of-type(3){ | |||||
margin-bottom: 0; | |||||
} | |||||
.user-btns .user-btn { | |||||
font-size: 30rpx; | |||||
letter-spacing: 1.16rpx; | |||||
} | |||||
.top-content{ | |||||
width: 100%; | |||||
height: auto; | |||||
} | |||||
.user_title{ | |||||
position: relative; | |||||
width: 94%; | |||||
background: #fff; | |||||
border-radius: 16rpx; | |||||
margin: -100rpx auto 0; | |||||
padding: 10rpx 0; | |||||
box-shadow: 0 6px 20px 0 rgba(0, 0, 0, 0.10); | |||||
} | |||||
.btns_bg{ | |||||
width: 94%; | |||||
background: #fff; | |||||
border-radius: 16rpx; | |||||
margin: 30rpx auto 0; | |||||
padding: 20rpx 0; | |||||
box-shadow: 0 6px 20px 0 rgba(0, 0, 0, 0.10); | |||||
} | |||||
.user-btns .user-btn > view { | |||||
padding: 20rpx 10px ; | |||||
font-size: 28rpx; | |||||
color: #888; | |||||
letter-spacing: 1.16rpx; | |||||
text-align: center; | |||||
} | |||||
.iconfont { | |||||
position: absolute; | |||||
right: 0; | |||||
top: 0; | |||||
bottom: 0; | |||||
width: 30rpx; | |||||
height: 30rpx; | |||||
line-height: 44rpx; | |||||
color: #c7c7cc; | |||||
font-size: 44rpx; | |||||
margin: auto; | |||||
} | |||||
.look { | |||||
display: inline-block; | |||||
padding-right: 25rpx; | |||||
} | |||||
.user-out-btn { | |||||
background-color: #fff; | |||||
height: 100rpx; | |||||
line-height: 100rpx; | |||||
font-family: PingFangSC-Semibold; | |||||
font-size: 30rpx; | |||||
color: #000; | |||||
text-align: center; | |||||
border-radius: 0; | |||||
border: none; | |||||
} | |||||
.user-out-btn.button-hover { | |||||
background-color: rgba(237, 237, 237, 1); | |||||
} | |||||
.user-out-btn::after { | |||||
opacity: 0; | |||||
} | |||||
.gzh button::after { | |||||
border: none!important; | |||||
} | |||||
.gzh { | |||||
width: 100%; | |||||
height: 170rpx; | |||||
z-index: 10; | |||||
background: #fff; | |||||
border-radius: 16rpx; | |||||
overflow: hidden; | |||||
box-shadow: 0 6px 20px 0 rgba(0, 0, 0, 0.15); | |||||
} | |||||
.act { | |||||
display: none; | |||||
} | |||||
.of { | |||||
width: 90%; | |||||
margin: 30rpx auto; | |||||
height: auto; | |||||
background: #fff; | |||||
border-radius: 16rpx; | |||||
overflow: hidden; | |||||
box-shadow: 0 6px 20px 0 rgba(0, 0, 0, 0.15); | |||||
} | |||||
.activeimg { | |||||
width: 200rpx !important; | |||||
position: absolute; | |||||
bottom: 0; | |||||
right: 0; | |||||
z-index: 10000; | |||||
} | |||||
.edit { | |||||
width: 26rpx; | |||||
vertical-align: middle; | |||||
} | |||||
.qrcode{ | |||||
display: none; | |||||
} | |||||
.qrcode image { | |||||
width: 70rpx; | |||||
margin-right: 20rpx; | |||||
} | |||||
.edits { | |||||
margin-top: 44rpx; | |||||
} | |||||
.showQrcode { | |||||
position: fixed; | |||||
top: 0; | |||||
left: 0; | |||||
right: 0; | |||||
bottom: 0; | |||||
z-index: 1000; | |||||
background: rgba(0, 0, 0, 0.6); | |||||
} | |||||
.qrcodes { | |||||
position: absolute; | |||||
width: 400rpx; | |||||
height: 440rpx; | |||||
top: 0; | |||||
left: 0; | |||||
right: 0; | |||||
bottom: 0; | |||||
border-radius: 15rpx; | |||||
margin: auto; | |||||
background: #fff; | |||||
text-align: center; | |||||
} | |||||
.qrcodes text { | |||||
text-align: center; | |||||
font-size: 26rpx; | |||||
display: inline-block; | |||||
line-height: 40rpx; | |||||
} | |||||
.container-box { | |||||
width: 100%; | |||||
height: 100%; | |||||
background: 0 0 0 0.6; | |||||
position: relative; | |||||
} | |||||
.img-box { | |||||
width: 500rpx; | |||||
margin: 200rpx auto 0; | |||||
background-color: #fff; | |||||
border-radius: 16rpx; | |||||
} | |||||
.img-box text { | |||||
display: block; | |||||
text-align: center; | |||||
font-size: 28rpx; | |||||
} | |||||
.img-box image { | |||||
display: block; | |||||
width: 500rpx; | |||||
} | |||||
.input-row { | |||||
border-bottom: 1rpx solid #e5e5e5; | |||||
border-top: 1rpx solid #e5e5e5; | |||||
display: flex; | |||||
align-items: center; | |||||
height: 100rpx; | |||||
padding: 0 32rpx; | |||||
background-color: #fff; | |||||
font-size: 34rpx; | |||||
color: #000; | |||||
} | |||||
.input-row input { | |||||
margin-left: 100rpx; | |||||
flex: 1; | |||||
} | |||||
.mybtn { | |||||
width: 686rpx; | |||||
margin: 60rpx auto; | |||||
} | |||||
.mask { | |||||
position: fixed; | |||||
top: 0; | |||||
left: 0; | |||||
z-index: 3; | |||||
width: 100%; | |||||
height: 100%; | |||||
opacity: 0; | |||||
} | |||||
.canvas-box { | |||||
position: fixed; | |||||
width: 500rpx; | |||||
height: 587rpx; | |||||
overflow: hidden; | |||||
left: 0; | |||||
top: 0; | |||||
bottom: 0; | |||||
right: 0; | |||||
margin: auto; | |||||
background: #fff; | |||||
border-radius: 16rpx; | |||||
} | |||||
.showQrcode text{ | |||||
display: block; | |||||
text-align: center; | |||||
font-size: 28rpx; | |||||
} | |||||
.membercode { | |||||
margin-top: 20rpx; | |||||
} | |||||
.top{ | |||||
width: 100%; | |||||
height: 234rpx; | |||||
} | |||||
.usre_level{ | |||||
height:32rpx; | |||||
border-radius:9px 9px 9px 0px; | |||||
font-family:PingFangSC-Regular; | |||||
font-weight:400; | |||||
color:rgba(255,255,255,1); | |||||
line-height:32rpx; | |||||
float: left; | |||||
margin-top: 8rpx; | |||||
} | |||||
.my{ | |||||
font-size:24rpx; | |||||
font-family:PingFangSC-Regular; | |||||
font-weight:400; | |||||
color:rgba(166,166,166,1); | |||||
line-height:34rpx; | |||||
} | |||||
.chengzhang_h{ | |||||
color: #3C3C3C; | |||||
font-size:24rpx; | |||||
font-weight: 600; | |||||
} | |||||
.my_line{ | |||||
margin: 0 10rpx; | |||||
} | |||||
.usre_level{ | |||||
font-size:20rpx; | |||||
} | |||||
.name{ | |||||
float: left; | |||||
} |
@@ -37,7 +37,7 @@ Page({ | |||||
}, | }, | ||||
goback: function () { | goback: function () { | ||||
wx.switchTab({ | wx.switchTab({ | ||||
url: '/pages/main/index', | |||||
url: '/index/index', | |||||
}) | }) | ||||
}, | }, | ||||
onLoad(options) { | onLoad(options) { | ||||