AA
@@ -1,158 +0,0 @@
|
||||
//获取应用实例
|
||||
var app = getApp();
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
order_list:[],
|
||||
navHeight: '',
|
||||
menuButtonInfo: {},
|
||||
searchMarginTop: 0, // 搜索框上边距
|
||||
searchWidth: 0, // 搜索框宽度
|
||||
searchHeight: 0, // 搜索框高度
|
||||
style_id:'',
|
||||
search:''
|
||||
},
|
||||
/**
|
||||
* 监听搜索内容
|
||||
*/
|
||||
changeSearch: function(e) {
|
||||
let that = this;
|
||||
var inputSearch = e.detail.value;
|
||||
that.setData({
|
||||
search: inputSearch
|
||||
})
|
||||
app.console(inputSearch+"================="+'22dddddddddddddddddddddd2')
|
||||
this.getGoodsList();
|
||||
},
|
||||
back(){
|
||||
wx.navigateBack()
|
||||
},
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad: function (options) {
|
||||
app.console('sssssss'+"================="+options.id),
|
||||
this.setData({
|
||||
style_id:options.id
|
||||
|
||||
});
|
||||
this.getGoodsList();
|
||||
this.setData({
|
||||
menuButtonInfo: wx.getMenuButtonBoundingClientRect()
|
||||
})
|
||||
console.log(this.data.menuButtonInfo)
|
||||
const { top, width, height, right } = this.data.menuButtonInfo
|
||||
wx.getSystemInfo({
|
||||
success: (res) => {
|
||||
const { statusBarHeight } = res
|
||||
const margin = top - statusBarHeight
|
||||
this.setData({
|
||||
navHeight: (height + statusBarHeight + (margin * 2) + 15),
|
||||
searchMarginTop: statusBarHeight + margin, // 状态栏 + 胶囊按钮边距
|
||||
searchHeight: height, // 与胶囊按钮同高
|
||||
searchWidth: right - width // 胶囊按钮右边坐标 - 胶囊按钮宽度 = 按钮左边可使用宽度
|
||||
})
|
||||
},
|
||||
})
|
||||
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
onReady: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面隐藏
|
||||
*/
|
||||
onHide: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面卸载
|
||||
*/
|
||||
onUnload: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面相关事件处理函数--监听用户下拉动作
|
||||
*/
|
||||
onPullDownRefresh: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面上拉触底事件的处理函数
|
||||
*/
|
||||
onReachBottom: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 用户点击右上角分享
|
||||
*/
|
||||
onShareAppMessage: function () {
|
||||
|
||||
},
|
||||
// 跳转详情
|
||||
activity(e){
|
||||
|
||||
if (e.currentTarget.dataset.id != 0) {
|
||||
console.log("你选择的课程id是"+e.currentTarget.dataset.id);
|
||||
wx.navigateTo({
|
||||
url: "/shopping/pages/goddess/goddess?id=" + e.currentTarget.dataset.id,
|
||||
});
|
||||
}
|
||||
|
||||
},
|
||||
//商品列表
|
||||
getGoodsList: function () {
|
||||
var that = this;
|
||||
wx.request({
|
||||
url: app.buildUrl("/app/Goddesswechat/getGoodsList"),
|
||||
header: app.getRequestHeader(),
|
||||
method:'POST',
|
||||
data: {
|
||||
version_number: this.data.version_number,
|
||||
uid:wx.getStorageSync('uid'),
|
||||
token:wx.getStorageSync('token'),
|
||||
page:'1',
|
||||
page_size:10,
|
||||
city:'',
|
||||
style_id:this.data.style_id,
|
||||
mechanism_id:'',
|
||||
serach_name:this.data.search,
|
||||
px_type:'',
|
||||
lng:'',
|
||||
lat:''
|
||||
},
|
||||
success: function (res) {
|
||||
var resp = res.data;
|
||||
console.log(resp+"=================dddddddddddddddddddddddddddddddddddddddddddd")
|
||||
console.log(resp.erro+"=================dddddddddddddddddddddddddddddddddddddddddddd")
|
||||
if(resp.erro==0){
|
||||
that.setData({
|
||||
order_list:resp.lists
|
||||
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
})
|
||||
@@ -1,4 +0,0 @@
|
||||
{
|
||||
"usingComponents": {},
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
@@ -1,45 +0,0 @@
|
||||
<!--pages/activity/activity.wxml-->
|
||||
<!-- 顶部排序 -->
|
||||
<!--index.wxml-->
|
||||
<view>
|
||||
<view class="custom-bar" style="height:{{navHeight}}px">
|
||||
<view class="custom-bar__wrapper" style="margin-top:{{searchMarginTop}}px; height: {{searchHeight}}px;width: {{searchWidth}}px" >
|
||||
<view style="height:24rpx;width:24rpx;border-right: 2px solid black;border-top: 2px solid black;transform: rotate(-135deg);margin-left:10px" bindtap="back"></view>
|
||||
<view class="search-group">
|
||||
<icon class="icon-small searchicon" type="search" size="38rpx"></icon>
|
||||
<input class="search-group__input" bindblur='changeSearch' bindconfirm='changeSearch' bindinput='changeSearch' placeholder="搜索"/>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- <view style="display:flex;justify-content: space-around;margin-bottom:23rpx;margin-top:{{navHeight}}px;font-size:24rpx;color: #585858;">
|
||||
<view>西安市</view>
|
||||
<view>智能排序</view>
|
||||
<view>分类</view>
|
||||
</view> -->
|
||||
|
||||
|
||||
<view class="order-list" style="margin-top: 160rpx;" wx:if="{{order_list.length}}">
|
||||
<view wx:for="{{order_list}}" wx:key="{{index}}" wx:for-item="item">
|
||||
<view class="Group" bindtap="activity" data-id="{{item.id}}">
|
||||
<view class="Group-image">
|
||||
<image src="{{item.index_img}}"></image>
|
||||
</view>
|
||||
<view class="content">
|
||||
<view class="title1">{{item.goods_name}}</view>
|
||||
<view class="title2">
|
||||
<view class="house">
|
||||
<image src="/pages/image/address.png"/>
|
||||
</view>
|
||||
<view >{{item.mechanism_name}}</view>
|
||||
</view>
|
||||
<view class="Price">
|
||||
<view class="Price1">¥{{item.price}}</view>
|
||||
<view class="Price2">¥{{item.original_price}}</view>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -1,128 +0,0 @@
|
||||
/* pages/activity/activity.wxss */
|
||||
.Group {
|
||||
height: 270rpx;
|
||||
display: flex;
|
||||
/* border-bottom: 1px solid #999999; */
|
||||
}
|
||||
|
||||
.Group-image {
|
||||
width: 230rpx;
|
||||
height: 230rpx;
|
||||
margin: 19rpx 28rpx 19rpx 31rpx;
|
||||
}
|
||||
|
||||
.Group-image image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.content {
|
||||
/* padding: 20rpx 35rpx; */
|
||||
width: 400rpx;
|
||||
height: 201rpx;
|
||||
margin-top: 28rpx;
|
||||
}
|
||||
|
||||
.content .title1 {
|
||||
font-size: 30rpx;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.content .title2 {
|
||||
font-size: 26rpx;
|
||||
height: 37rpx;
|
||||
line-height: 37rpx;
|
||||
display: flex;
|
||||
color: #B4B4B4;
|
||||
margin: 11rpx 0 18rpx 0;
|
||||
}
|
||||
|
||||
.content .title2 .house {
|
||||
width: 28rpx;
|
||||
height: 28rpx;
|
||||
margin-right: 7rpx;
|
||||
margin-top: 5rpx;
|
||||
}
|
||||
|
||||
.content .title2 .house image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.content .Price {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.content .Price .Price1 {
|
||||
font-size: 34rpx;
|
||||
color: #FF4A4A;
|
||||
line-height: 42rpx;
|
||||
margin-right: 17rpx;
|
||||
}
|
||||
|
||||
.content .Price .Price2 {
|
||||
font-size: 24rpx;
|
||||
color: #CBCBCB;
|
||||
line-height: 41rpx;
|
||||
margin-right: 23rpx;
|
||||
text-decoration:line-through;
|
||||
}
|
||||
|
||||
.content .Price .Price3 {
|
||||
width: 51rpx;
|
||||
height: 21rpx;
|
||||
font-size: 15rpx;
|
||||
color: #E75D4D;
|
||||
border: 1px solid #E75D4D;
|
||||
border-radius: 4rpx;
|
||||
text-align: center;
|
||||
line-height: 18rpx;
|
||||
margin-top: 10rpx;
|
||||
}
|
||||
|
||||
.order-list{
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/* _______________________________________ */
|
||||
view {
|
||||
box-sizing: border-box;
|
||||
overflow: hidden;
|
||||
}
|
||||
.custom-bar {
|
||||
/* background-color: #aaa; */
|
||||
position: fixed;
|
||||
left: 0;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
}
|
||||
.custom-bar__wrapper {
|
||||
padding: 0 10rpx;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
.search-group {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
justify-content: flex-start;
|
||||
align-items: center;
|
||||
border-radius: 60rpx;
|
||||
/* padding: 0 10rpx; */
|
||||
padding-left: 25rpx;
|
||||
background: #F5F5F5;
|
||||
}
|
||||
.search-group > input {
|
||||
font-size: 25rpx;
|
||||
width: 800rpx;
|
||||
}
|
||||
.search-group > image {
|
||||
height: 32rpx;
|
||||
width: 32rpx;
|
||||
margin-right: 20rpx
|
||||
}
|
||||
|
||||
@@ -1,201 +0,0 @@
|
||||
var dateTimePicker = require('../../utils/dateTimePicker.js');
|
||||
const uilt = require('../../utils/util.js');
|
||||
var Token = require('../../utils/util.js');
|
||||
const app = getApp()
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
dateTimeArray1: null,
|
||||
dateTime1: null,
|
||||
fromBox:false,
|
||||
infor:{},
|
||||
store:[],
|
||||
store_id:'',
|
||||
appointment_time:'',
|
||||
name:'',
|
||||
phone:wx.getStorageSync('phone'),
|
||||
id:''//优惠券id
|
||||
},
|
||||
yuyue(e){
|
||||
console.log(e.currentTarget.dataset)
|
||||
this.setData({
|
||||
fromBox:true,
|
||||
store_id:e.currentTarget.dataset.id
|
||||
})
|
||||
},
|
||||
mengcheng(){
|
||||
this.setData({
|
||||
fromBox:false
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad: function (options) {
|
||||
// 获取完整的年月日 时分秒,以及默认显示的数组
|
||||
var obj1 = dateTimePicker.dateTimePicker(this.data.startYear, this.data.endYear);
|
||||
// 精确到分的处理,将数组的秒去掉
|
||||
var lastArray = obj1.dateTimeArray.pop();
|
||||
var lastTime = obj1.dateTime.pop();
|
||||
console.log(options)
|
||||
this.setData({
|
||||
id:options.id,
|
||||
dateTimeArray1: obj1.dateTimeArray,
|
||||
dateTime1: obj1.dateTime
|
||||
})
|
||||
this.getCouponDetail(options.id)
|
||||
},
|
||||
changeDateTime1(e) {
|
||||
this.setData({ dateTime1: e.detail.value });
|
||||
},
|
||||
|
||||
changeDateTimeColumn1(e) {
|
||||
var arr = this.data.dateTime1, dateArr = this.data.dateTimeArray1;
|
||||
arr[e.detail.column] = e.detail.value;
|
||||
dateArr[2] = dateTimePicker.getMonthDay(dateArr[0][arr[0]], dateArr[1][arr[1]]);
|
||||
this.setData({
|
||||
dateTimeArray1: dateArr
|
||||
});
|
||||
console.log(this.data.dateTimeArray1)
|
||||
},
|
||||
nameChang(e){
|
||||
this.setData({
|
||||
name: e.detail.value
|
||||
})
|
||||
|
||||
},
|
||||
phoneChang(e){
|
||||
this.setData({
|
||||
phone: e.detail.value
|
||||
})
|
||||
},
|
||||
// 点击预约提交信息
|
||||
appointment(){
|
||||
var that=this;
|
||||
var appointment_time;
|
||||
var appointment_time=that.data.dateTimeArray1[0][that.data.dateTime1[0]]+'-'+that.data.dateTimeArray1[1][that.data.dateTime1[1]]+"-"+that.data.dateTimeArray1[2][that.data.dateTime1[2]]+' '+that.data.dateTimeArray1[3][that.data.dateTime1[3]]+':'+that.data.dateTimeArray1[4][that.data.dateTime1[4]];
|
||||
console.log(that.data.name)
|
||||
wx.request({
|
||||
url: app.globalData.url + '/device/CouponWechat/submitAppointment',
|
||||
data: {
|
||||
uid:wx.getStorageSync('uid'),
|
||||
token:wx.getStorageSync('token'),
|
||||
version_number:app.globalData.version_number,
|
||||
id:that.data.id,
|
||||
store_id:that.data.store_id,
|
||||
appointment_time:appointment_time,
|
||||
name:that.data.name,
|
||||
phone:that.data.phone
|
||||
},
|
||||
method: 'POST',
|
||||
header: { 'content-type': 'application/x-www-form-urlencoded' },
|
||||
success(res) {
|
||||
console.log(res)
|
||||
|
||||
if(res.data.result.erro=='0'){
|
||||
that.setData({
|
||||
fromBox:false
|
||||
})
|
||||
wx.showToast({
|
||||
title: '预约成功',
|
||||
icon: 'success',
|
||||
duration: 1000,
|
||||
success(){
|
||||
wx.switchTab({
|
||||
url: '../cardBag/cardBag.wxml'
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
}else{
|
||||
Token.token()
|
||||
that.getCouponDetail(that.data.id)
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
// 获取优惠券详情
|
||||
getCouponDetail(id){
|
||||
var that=this;
|
||||
wx.request({
|
||||
url: app.globalData.url + '/app/Goddesswechat/selectCouponDetail',
|
||||
data: {
|
||||
uid:wx.getStorageSync('uid'),
|
||||
token:wx.getStorageSync('token'),
|
||||
version_number:app.globalData.version_number,
|
||||
id:id
|
||||
},
|
||||
method: 'POST',
|
||||
header: { 'content-type': 'application/x-www-form-urlencoded' },
|
||||
success(res) {
|
||||
console.log(res)
|
||||
if(res.data.infor.full_minus){
|
||||
res.data.infor.full=res.data.infor.full_minus.split("-")[0];
|
||||
res.data.infor.minus=res.data.infor.full_minus.split("-")[1];
|
||||
}
|
||||
if(res.data.erro=='0'){
|
||||
that.setData({
|
||||
infor:res.data.infor,
|
||||
store:res.data.store
|
||||
})
|
||||
}else{
|
||||
Token.token()
|
||||
that.getCouponDetail(that.data.id)
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
onReady: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面隐藏
|
||||
*/
|
||||
onHide: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面卸载
|
||||
*/
|
||||
onUnload: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面相关事件处理函数--监听用户下拉动作
|
||||
*/
|
||||
onPullDownRefresh: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面上拉触底事件的处理函数
|
||||
*/
|
||||
onReachBottom: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 用户点击右上角分享
|
||||
*/
|
||||
onShareAppMessage: function () {
|
||||
|
||||
}
|
||||
})
|
||||
@@ -1,9 +0,0 @@
|
||||
{
|
||||
"usingComponents": {},
|
||||
|
||||
"backgroundTextStyle":"light",
|
||||
"navigationBarBackgroundColor": "#fff",
|
||||
"navigationBarTitleText": "详情",
|
||||
"navigationBarTextStyle":"black"
|
||||
|
||||
}
|
||||
@@ -1,77 +0,0 @@
|
||||
<!--pages/appointmentDetails/appointmentDetails.wxml-->
|
||||
<view class="app">
|
||||
<view class="title">
|
||||
<view class="title-box">
|
||||
<text class="maoney">¥</text>
|
||||
<text class="maoney-nmb" wx:if="{{infor.type_id==2}}">{{infor.minus}}</text>
|
||||
<text class="maoney-nmb">{{infor.denomination}}</text>
|
||||
|
||||
<text class="status" wx:if="{{infor.type_id==1}}">体验券</text>
|
||||
<text class="status" wx:if="{{infor.type_id==2}}">满减券</text>
|
||||
<text class="status" wx:if="{{infor.type_id==3}}">兑换券</text>
|
||||
</view>
|
||||
<view class="title-details" wx:if="{{infor.type_id==2}}">满{{infor.full}}可用</view>
|
||||
<view class="title-details">{{infor.coupon_name}}</view>
|
||||
<view class="title-time">有效期:{{infor.expiration_date}}</view>
|
||||
</view>
|
||||
<view class="yuan-left"></view>
|
||||
<view class="yuan-right"></view>
|
||||
<view class="details" >
|
||||
<view class="details-yy" wx:if="{{infor.appointment_status==1}}">
|
||||
<view class="yy-title yy-details">预约信息</view>
|
||||
<view class="yy-details yy-sizestyle">
|
||||
<text>姓名</text>
|
||||
<text style="float: right;">{{infor.name}}</text>
|
||||
</view>
|
||||
<view class="yy-details yy-sizestyle">
|
||||
<text>联系方式</text>
|
||||
<text style="float: right;">{{infor.phone}}</text>
|
||||
</view>
|
||||
<view class="yy-sizestyle">
|
||||
<text>预约时间</text>
|
||||
<text style="float: right;">{{infor.appointment_time}}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="details-title" wx:if="{{infor.appointment_status==0}}">适用门店</view>
|
||||
<view class="details-title" wx:else>预约门店</view>
|
||||
|
||||
<view wx:for="{{store}}" wx:key="key" class="details-list">
|
||||
<view class="details-md">{{item.store_name}}</view>
|
||||
<view class="details-phone">{{item.contact}}</view>
|
||||
<view class="details-dz">{{item.address}} <text wx:if="{{infor.appointment_status==0}}" class="yy" bindtap="yuyue" data-id="{{item.store_id}}">立即预约</text></view>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
<view class="zysx">
|
||||
<view class="zysx-title">注意事项</view>
|
||||
<view class="zysx-text">1.抵扣券、折扣券与抵用金均不可兑换为现金。</view>
|
||||
<view class="zysx-text">2.每张抵用券在同一活动中只可使用一次。</view>
|
||||
<view class="zysx-text">3.新人礼包每个用户只能领取一次。</view>
|
||||
<view class="zysx-text">4.老用户推荐成功后可获得活动邀请券,新用户也可邀请好友获得此券。</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- /蒙层 -->
|
||||
<view class="mengcheng" wx:if="{{fromBox}}" bindtap="mengcheng"></view>
|
||||
<view class="from-box" wx:if="{{fromBox}}">
|
||||
<view class="from-title">请输入您的信息</view>
|
||||
<view class="piker_n">
|
||||
<view class="tui-picker-content">
|
||||
<picker mode="multiSelector" value="{{dateTime1}}" bindchange="changeDateTime1" bindcolumnchange="changeDateTimeColumn1" range="{{dateTimeArray1}}">
|
||||
<view class="tui-picker-detail">
|
||||
{{dateTimeArray1[0][dateTime1[0]]}}-{{dateTimeArray1[1][dateTime1[1]]}}-{{dateTimeArray1[2][dateTime1[2]]}} {{dateTimeArray1[3][dateTime1[3]]}}:{{dateTimeArray1[4][dateTime1[4]]}}
|
||||
</view>
|
||||
</picker>
|
||||
</view>
|
||||
</view>
|
||||
<view style="margin-bottom: 35rpx;margin-top: 35rpx;">
|
||||
<input type="text"
|
||||
placeholder="请输入您的姓名"
|
||||
style="background: #F3F3F3;width:530rpx;height:84rpx;margin-bottom: 35rpx;margin: 0 auto;padding-left: 34rpx;" value="{{name}}" bindinput="nameChang"></input>
|
||||
</view>
|
||||
<view style="margin-bottom: 35rpx;">
|
||||
<input type="text"
|
||||
placeholder="请输入您的手机号"
|
||||
style="background: #F3F3F3;width:530rpx;height:84rpx;margin-bottom: 35rpx;margin: 0 auto;padding-left: 34rpx;" value="{{phone}}" bindinput="phoneChang"></input>
|
||||
</view>
|
||||
<view class="from-btn" bindtap="appointment">立即预约</view>
|
||||
</view>
|
||||
@@ -1,66 +0,0 @@
|
||||
// pages/cardBag/cardBag.js
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad(options) {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
onReady() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面隐藏
|
||||
*/
|
||||
onHide() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面卸载
|
||||
*/
|
||||
onUnload() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面相关事件处理函数--监听用户下拉动作
|
||||
*/
|
||||
onPullDownRefresh() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面上拉触底事件的处理函数
|
||||
*/
|
||||
onReachBottom() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 用户点击右上角分享
|
||||
*/
|
||||
onShareAppMessage() {
|
||||
|
||||
}
|
||||
})
|
||||
@@ -1,2 +0,0 @@
|
||||
<!--pages/cardBag/cardBag.wxml-->
|
||||
<text>pages/cardBag/cardBag.wxml</text>
|
||||
|
Before Width: | Height: | Size: 982 B |
|
Before Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 2.4 KiB |
|
Before Width: | Height: | Size: 4.3 KiB |
|
Before Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 3.7 KiB |
|
Before Width: | Height: | Size: 2.9 KiB |
|
Before Width: | Height: | Size: 821 B |
|
Before Width: | Height: | Size: 3.0 KiB |
|
Before Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 4.7 KiB |
|
Before Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 547 B |
|
Before Width: | Height: | Size: 569 B |
|
Before Width: | Height: | Size: 715 B |
|
Before Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 4.1 KiB |
|
Before Width: | Height: | Size: 7.3 KiB |
|
Before Width: | Height: | Size: 242 KiB |
|
Before Width: | Height: | Size: 39 KiB |
|
Before Width: | Height: | Size: 3.4 KiB |
|
Before Width: | Height: | Size: 2.3 KiB |
|
Before Width: | Height: | Size: 2.9 KiB |
|
Before Width: | Height: | Size: 43 KiB |
|
Before Width: | Height: | Size: 2.5 KiB |
|
Before Width: | Height: | Size: 41 KiB |
|
Before Width: | Height: | Size: 50 KiB |
|
Before Width: | Height: | Size: 4.3 KiB |
|
Before Width: | Height: | Size: 6.6 KiB |
|
Before Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 425 B |
|
Before Width: | Height: | Size: 2.1 KiB |
|
Before Width: | Height: | Size: 696 B |
|
Before Width: | Height: | Size: 612 B |
|
Before Width: | Height: | Size: 687 B |
|
Before Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 31 KiB |
|
Before Width: | Height: | Size: 498 B |
|
Before Width: | Height: | Size: 31 KiB |
|
Before Width: | Height: | Size: 936 B |
|
Before Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 498 B |
|
Before Width: | Height: | Size: 158 KiB |
|
Before Width: | Height: | Size: 648 B |
|
Before Width: | Height: | Size: 297 B |
|
Before Width: | Height: | Size: 287 B |
|
Before Width: | Height: | Size: 514 B |
|
Before Width: | Height: | Size: 8.8 KiB |
|
Before Width: | Height: | Size: 597 B |
|
Before Width: | Height: | Size: 891 B |
|
Before Width: | Height: | Size: 4.0 KiB |
|
Before Width: | Height: | Size: 80 KiB |
|
Before Width: | Height: | Size: 164 KiB |
|
Before Width: | Height: | Size: 9.1 KiB |
|
Before Width: | Height: | Size: 4.8 KiB |
|
Before Width: | Height: | Size: 2.1 KiB |
@@ -1,105 +0,0 @@
|
||||
//获取应用实例
|
||||
const app = getApp()
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
id:''
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad: function (options) {
|
||||
|
||||
this.setData({
|
||||
id:options.id
|
||||
})
|
||||
this.getMechanismIndex()
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
onReady: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面隐藏
|
||||
*/
|
||||
onHide: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面卸载
|
||||
*/
|
||||
onUnload: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面相关事件处理函数--监听用户下拉动作
|
||||
*/
|
||||
onPullDownRefresh: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面上拉触底事件的处理函数
|
||||
*/
|
||||
onReachBottom: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 用户点击右上角分享
|
||||
*/
|
||||
onShareAppMessage: function () {
|
||||
|
||||
},
|
||||
// 跳转详情
|
||||
itemgodetail(e){
|
||||
if (e.currentTarget.dataset.id != 0) {
|
||||
console.log("你选择的课程id是"+e.currentTarget.dataset.id);
|
||||
wx.navigateTo({
|
||||
url: "/shopping/pages/goddess/goddess?id=" + e.currentTarget.dataset.id,
|
||||
});
|
||||
}
|
||||
},
|
||||
//机构详情
|
||||
getMechanismIndex: function () {
|
||||
var that = this;
|
||||
wx.request({
|
||||
url: app.buildUrl("/app/Goddesswechat/getMechanismIndex"),
|
||||
header: app.getRequestHeader(),
|
||||
method:'POST',
|
||||
data: {
|
||||
version_number: this.data.version_number,
|
||||
uid:wx.getStorageSync('uid'),
|
||||
token:wx.getStorageSync('token'),
|
||||
id:this.data.id
|
||||
},
|
||||
success: function (res) {
|
||||
var resp = res.data;
|
||||
if(resp.erro==0){
|
||||
that.setData({
|
||||
infor:resp.infor,
|
||||
goods:resp.goods,
|
||||
activity:resp.activity,
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
})
|
||||
@@ -1,4 +0,0 @@
|
||||
{
|
||||
"usingComponents": {},
|
||||
"navigationBarTitleText": "机构主页"
|
||||
}
|
||||
@@ -1,65 +0,0 @@
|
||||
<view style=" background: #fff;">
|
||||
<image src="{{infor.wechat_cover_img}}" style="width:100%;height:375rpx">
|
||||
</image>
|
||||
<view class="detail_box">
|
||||
<view>
|
||||
<view class="title_map">{{infor.mechanism_name}}</view>
|
||||
<view style="line-height:28rpx;margin-bottom:11rpx;">认证医院:认证医院机构;正品保证机构</view>
|
||||
<view style="margin-bottom:11rpx;">
|
||||
<image src="/pages/image/Star.png" style="width:23rpx;height:23rpx; margin-right:5rpx" wx:for="xxxxxx" wx:key="index" ></image>{{infor.score}}
|
||||
</view>
|
||||
</view>
|
||||
<image
|
||||
src="{{infor.wechat_logo}}"
|
||||
class="header_img"></image>
|
||||
</view>
|
||||
<view
|
||||
style="padding: 0 24rpx;display: flex;font-size: 20rpx;font-family: PingFang SC;font-weight: 400;color: #6A6A6A;align-items: center;position: relative;padding-bottom: 44rpx;">
|
||||
<image src="/pages/image/site.png" style="width:17rpx;height:21rpx;margin-right:13rpx;"></image>
|
||||
<view>
|
||||
{{infor.address}}
|
||||
</view>
|
||||
<view
|
||||
style="width:46rpx;height:26rpx;padding-left:20rpx;border-left: 1rpx solid #C7C7C7;right:43rpx;position: absolute;">
|
||||
<image src="/pages/image/phone.png" style="width:26rpx;height:26rpx;"></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 滚动 -->
|
||||
<view wx:if="{{activity.length>0}}" class="scroll_box">
|
||||
<view style="font-size: 28rpx;color: #222222;line-height: 41rpx;">活动专区</view>
|
||||
<scroll-view scroll-x scroll-with-animation style="height:322rpx;width:100%;margin-top: 12rpx;">
|
||||
<view style="display:flex;">
|
||||
<view wx:for="{{activity}}" style="position:relative;margin-right: 8rpx;border: 1rpx solid #E5E5E5;"wx:for-item="item" data-id="{{item.id}}" bindtap="itemgodetail">
|
||||
<image src="{{item.index_img}}" style="height:200rpx;width:200rpx;"></image>
|
||||
<view class="title">{{item.goods_name}}</view>
|
||||
<view class="money">¥{{item.price}}</view>
|
||||
<view class="conter">剩余{{item.stock}}件</view>
|
||||
<view class="qiang"> 抢</view>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
<!-- 推荐 -->
|
||||
<view wx:if="{{goods.length>0}}" class="recommended_box">
|
||||
<view class="fuwu">
|
||||
<text>服务</text>
|
||||
<!-- <text>全部 ></text> -->
|
||||
</view>
|
||||
|
||||
<view style=" display:flex; flex-wrap: wrap;">
|
||||
<view wx:for="{{goods}}" style="width:340rpx;height:488rpx;background:#fff;margin-bottom:16rpx;margin-left: 0rpx; margin-right: 10rpx;" wx:for-item="item" data-id="{{item.id}}" bindtap="itemgodetail">
|
||||
<image src="{{item.index_img}}" style="width:340rpx;height:340rpx;border-radius: 10rpx 10rpx 0px 0px;"></image>
|
||||
<view class="title1">{{item.goods_name}}</view>
|
||||
<view style="display:flex;margin:8rpx 0;">
|
||||
<image src="/pages/image/address.png" style="width:17rpx;height:17rpx"></image>
|
||||
<view class="dianpu">{{item.mechanism_name}}</view>
|
||||
</view>
|
||||
<view class="price">
|
||||
<view>¥{{item.price}}</view>
|
||||
<!-- <view>5.0折</view> -->
|
||||
<view>已售{{item.sold}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -1,194 +0,0 @@
|
||||
/* pages/institutions/institutions.wxss */
|
||||
page {
|
||||
background: #F5F5F5;
|
||||
}
|
||||
|
||||
.detail_box {
|
||||
padding: 0 24rpx;
|
||||
margin-top: 23rpx;
|
||||
display: flex;
|
||||
font-size: 20rpx;
|
||||
font-family: PingFang SC;
|
||||
font-weight: 400;
|
||||
color: #6A6A6A;
|
||||
opacity: 1;
|
||||
position: relative;
|
||||
|
||||
}
|
||||
|
||||
.header_img {
|
||||
height: 149rpx;
|
||||
width: 149rpx;
|
||||
border-radius: 50%;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 49rpx;
|
||||
}
|
||||
|
||||
.title_map {
|
||||
width: 408rpx;
|
||||
height: 96rpx;
|
||||
font-size: 34rpx;
|
||||
font-family: PingFang SC;
|
||||
font-weight: bold;
|
||||
color: #333333;
|
||||
opacity: 1;
|
||||
margin-bottom: 23rpx;
|
||||
text-overflow: -o-ellipsis-lastline;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 2;
|
||||
line-clamp: 2;
|
||||
-webkit-box-orient: vertical;
|
||||
}
|
||||
|
||||
.title {
|
||||
width: 189rpx;
|
||||
height: 50rpx;
|
||||
font-size: 18rpx;
|
||||
font-family: PingFang SC;
|
||||
font-weight: 500;
|
||||
color: #414141;
|
||||
opacity: 1;
|
||||
text-overflow: -o-ellipsis-lastline;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 2;
|
||||
line-clamp: 2;
|
||||
-webkit-box-orient: vertical;
|
||||
}
|
||||
|
||||
.money {
|
||||
font-size: 18rpx;
|
||||
font-family: PingFang SC;
|
||||
font-weight: 500;
|
||||
color: #E75D4D;
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.conter {
|
||||
font-size: 16rpx;
|
||||
font-family: PingFang SC;
|
||||
font-weight: 400;
|
||||
color: #A7A7A7;
|
||||
opacity: 1;
|
||||
|
||||
}
|
||||
.scroll_box{
|
||||
background: #fff;margin-top: 8rpx;padding:18rpx 10rpx 26rpx 24rpx;
|
||||
}
|
||||
|
||||
.qiang {
|
||||
line-height: 35rpx;
|
||||
width: 39rpx;
|
||||
position: absolute;
|
||||
text-align: center;
|
||||
bottom: 10rpx;
|
||||
right: 10rpx;
|
||||
background: #FF576E;
|
||||
border-radius: 8rpx;
|
||||
font-size: 20rpx;
|
||||
color:#fff;
|
||||
}
|
||||
.recommended_box{
|
||||
padding: 16rpx 24rpx 0rpx;
|
||||
background: linear-gradient(180deg, #FFFFFF 0%, #EFEFEF 100%);
|
||||
margin: 8rpx 0;
|
||||
|
||||
}
|
||||
.fuwu{
|
||||
line-height: 41rpx;
|
||||
margin-bottom: 18rpx;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
.fuwu text:nth-child(1){
|
||||
font-size:28rpx;
|
||||
color: #222;
|
||||
}
|
||||
.fuwu text:nth-child(2){
|
||||
font-size: 26rpx;
|
||||
line-height: 31rpx;
|
||||
color: #AEAEAE;
|
||||
}
|
||||
.title1{
|
||||
width: 329rpx;
|
||||
height: 56rx;
|
||||
font-size: 20rpx;
|
||||
font-family: PingFang SC;
|
||||
font-weight: 500;
|
||||
color: #414141;
|
||||
opacity: 1;
|
||||
text-overflow: -o-ellipsis-lastline;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 2;
|
||||
line-clamp: 2;
|
||||
-webkit-box-orient: vertical;
|
||||
}
|
||||
.dianpu{
|
||||
font-size: 20rpx;
|
||||
font-family: PingFang SC;
|
||||
font-weight: 400;
|
||||
line-height: 28rpx;
|
||||
color: #B4B4B4;
|
||||
opacity: 1;
|
||||
}
|
||||
.title1 {
|
||||
width: 329rpx;
|
||||
height: 56rx;
|
||||
font-size: 20rpx;
|
||||
font-family: PingFang SC;
|
||||
font-weight: 500;
|
||||
color: #414141;
|
||||
opacity: 1;
|
||||
text-overflow: -o-ellipsis-lastline;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 2;
|
||||
line-clamp: 2;
|
||||
-webkit-box-orient: vertical;
|
||||
}
|
||||
.dianpu {
|
||||
font-size: 20rpx;
|
||||
font-family: PingFang SC;
|
||||
font-weight: 400;
|
||||
line-height: 18rpx;
|
||||
color: #B4B4B4;
|
||||
opacity: 1;
|
||||
margin-left: 6rpx;
|
||||
}
|
||||
|
||||
.price {
|
||||
display: flex;
|
||||
margin-top: 8rpx;
|
||||
}
|
||||
.price view:nth-child(1) {
|
||||
line-height: 44rpx;
|
||||
font-size: 20rpx;
|
||||
font-weight: 700;
|
||||
color: #E75D4D;
|
||||
}
|
||||
|
||||
.price view:nth-child(2) {
|
||||
width: 51rpx;
|
||||
height: 21rpx;
|
||||
border: 1px solid #E75D4D;
|
||||
border-radius: 4rpx;
|
||||
font-size: 15rpx;
|
||||
font-weight: 400;
|
||||
color: #e75d4d;
|
||||
text-align: center;
|
||||
margin: 11rpx ;
|
||||
}
|
||||
.price view:nth-child(3){
|
||||
font-size: 20rpx;
|
||||
line-height: 44rpx;
|
||||
font-weight: 400;
|
||||
color: #B4B4B4;
|
||||
margin-left: 121rpx;
|
||||
}
|
||||
@@ -1,203 +0,0 @@
|
||||
const app = getApp()
|
||||
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
userInfo:{},
|
||||
phoneFlag:true,
|
||||
uidFlag:false
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad: function (options) {
|
||||
this.getLogin()
|
||||
// console.log(this.userInfo)
|
||||
},
|
||||
// getUserInfo(e) {
|
||||
// var _this=this;
|
||||
// wx.getUserInfo({
|
||||
// desc: '展示用户信息', // 声明获取用户个人信息后的用途,后续会展示在弹窗中,请谨慎填写
|
||||
// success: (res) => {
|
||||
// console.log(res)
|
||||
// this.setData({
|
||||
// userInfo: res.userInfo,
|
||||
// hasUserInfo: true
|
||||
// })
|
||||
// if(res.encryptedData&&res.iv){
|
||||
// _this.wechatLogin(res.encryptedData,res.iv)
|
||||
// }
|
||||
// }
|
||||
// })
|
||||
// },
|
||||
// 登录
|
||||
getLogin() {
|
||||
var that=this;
|
||||
wx.login({
|
||||
success: res => {
|
||||
console.log(res)
|
||||
app.globalData.code = res.code
|
||||
}
|
||||
})
|
||||
},
|
||||
// 获取电话号码
|
||||
getPhoneNumber (e) {
|
||||
var _this=this;
|
||||
wx.request({
|
||||
url: app.globalData.url + '/device/CouponWechat/login',
|
||||
data: {
|
||||
encryptedData: e.detail.encryptedData,
|
||||
iv: e.detail.iv,
|
||||
wxcode:app.globalData.code
|
||||
},
|
||||
method: 'POST',
|
||||
header: { 'content-type': 'application/x-www-form-urlencoded' },
|
||||
success(res) {
|
||||
console.log(1111111)
|
||||
console.log(res)
|
||||
if (res.data.result.erro == 0) {
|
||||
// wx.setStorageSync('phonenum', true);
|
||||
app.globalData.phone = res.data.result.phone;
|
||||
wx.setStorageSync('phone', res.data.result.phone);
|
||||
app.globalData.uid = res.data.result.uid;
|
||||
wx.setStorageSync('uid', res.data.result.uid);
|
||||
// wx.setStorageSync('uidFlag', true);
|
||||
wx.switchTab({
|
||||
url: '/pages/index/index'
|
||||
})
|
||||
// _this.wechatLogin()
|
||||
// _this.setData({
|
||||
// uidFlag:true,
|
||||
// phoneFlag:false
|
||||
// })
|
||||
wx.showToast({
|
||||
title: res.data.msg,
|
||||
icon: 'success',
|
||||
duration: 2000
|
||||
})
|
||||
}else{
|
||||
wx.showToast({
|
||||
title: res.data.msg,
|
||||
icon: 'error',
|
||||
duration: 2000
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
// 用户信息登录小程序
|
||||
// wechatLogin(encryptedData,iv){
|
||||
// var _this=this;
|
||||
// wx.request({
|
||||
// url: app.globalData.url + '/device/CouponWechat/login',
|
||||
// data: {
|
||||
// encryptedData:encryptedData,
|
||||
// iv: iv,
|
||||
// phone: app.globalData.phone,
|
||||
// sessionKey: app.globalData.sessionKey
|
||||
// },
|
||||
// method: 'POST',
|
||||
// header: { 'content-type': 'application/x-www-form-urlencoded' },
|
||||
// success(res) {
|
||||
// console.log(res)
|
||||
// if(res.data.erro==0){
|
||||
// app.globalData.token=res.data.token;
|
||||
// app.globalData.uid=res.data.uid;
|
||||
// wx.setStorageSync('token', res.data.token);
|
||||
// wx.setStorageSync('uid', res.data.uid);
|
||||
// _this.getToken()
|
||||
// }else{
|
||||
// wx.showToast({
|
||||
// title: res.data.msg,
|
||||
// icon: 'none',
|
||||
// duration: 2000
|
||||
// })
|
||||
// }
|
||||
|
||||
// }
|
||||
// })
|
||||
// },
|
||||
// 获取token
|
||||
getToken(){
|
||||
var that=this;
|
||||
wx.request({
|
||||
url: app.globalData.url + '/device/CouponWechat/getToken',
|
||||
data: {
|
||||
uid:wx.getStorageSync('uid'),
|
||||
phone: app.globalData.phone
|
||||
},
|
||||
method: 'POST',
|
||||
header: { 'content-type': 'application/x-www-form-urlencoded' },
|
||||
success:(res)=>{
|
||||
console.log(res)
|
||||
if(res.data.erro=='0'){
|
||||
app.globalData.token=res.data.token;
|
||||
wx.setStorageSync('token', res.data.token);
|
||||
|
||||
wx.switchTab({
|
||||
url: '/pages/cardBag/cardBag'
|
||||
})
|
||||
}else{
|
||||
wx.showToast({
|
||||
title: res.data.msg,
|
||||
icon: 'none',
|
||||
duration: 2000
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
onReady: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面隐藏
|
||||
*/
|
||||
onHide: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面卸载
|
||||
*/
|
||||
onUnload: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面相关事件处理函数--监听用户下拉动作
|
||||
*/
|
||||
onPullDownRefresh: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面上拉触底事件的处理函数
|
||||
*/
|
||||
onReachBottom: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 用户点击右上角分享
|
||||
*/
|
||||
onShareAppMessage: function () {
|
||||
|
||||
}
|
||||
})
|
||||
@@ -1,5 +0,0 @@
|
||||
{
|
||||
"usingComponents": {},
|
||||
"navigationBarTitleText": "登录"
|
||||
|
||||
}
|
||||
@@ -1,2 +0,0 @@
|
||||
<button class="phone" open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber" wx:if="{{phoneFlag}}">获取电话号码</button>
|
||||
<!-- <button class="uid" bindtap="getUserInfo" wx:if="{{uidFlag}}">登录</button> -->
|
||||
@@ -1,7 +0,0 @@
|
||||
.phone{
|
||||
margin: 40rpx;
|
||||
}
|
||||
.uid{
|
||||
margin: 40rpx;
|
||||
|
||||
}
|
||||
@@ -1,97 +0,0 @@
|
||||
var city = require('../../utils/city.js');
|
||||
var app = getApp()
|
||||
Page({
|
||||
data: {
|
||||
searchLetter: [],
|
||||
showLetter: "",
|
||||
winHeight: 0,
|
||||
// tHeight: 0,
|
||||
// bHeight: 0,
|
||||
cityList: [],
|
||||
isShowLetter: false,
|
||||
scrollTop: 0,//置顶高度
|
||||
scrollTopId: '',//置顶id
|
||||
city: "上海市",
|
||||
hotcityList: [{ cityCode: 110000, city: '北京市' }, { cityCode: 310000, city: '上海市' }, { cityCode: 440100, city: '广州市' }, { cityCode: 440300, city: '深圳市' }, { cityCode: 330100, city: '杭州市' }, { cityCode: 320100, city: '南京市' }, { cityCode: 420100, city: '武汉市' }, { cityCode: 410100, city: '郑州市' }, { cityCode: 120000, city: '天津市' }, { cityCode: 610100, city: '西安市' }, { cityCode: 510100, city: '成都市' }, { cityCode: 500000, city: '重庆市' }]
|
||||
},
|
||||
onLoad: function () {
|
||||
// 生命周期函数--监听页面加载
|
||||
var searchLetter = city.searchLetter;
|
||||
var cityList = city.cityList();
|
||||
var sysInfo = wx.getSystemInfoSync();
|
||||
var winHeight = sysInfo.windowHeight;
|
||||
var itemH = winHeight / searchLetter.length;
|
||||
var tempObj = [];
|
||||
for (var i = 0; i < searchLetter.length; i++) {
|
||||
var temp = {};
|
||||
temp.name = searchLetter[i];
|
||||
temp.tHeight = i * itemH;
|
||||
temp.bHeight = (i + 1) * itemH;
|
||||
tempObj.push(temp)
|
||||
}
|
||||
this.setData({
|
||||
winHeight: winHeight,
|
||||
itemH: itemH,
|
||||
searchLetter: tempObj,
|
||||
cityList: cityList
|
||||
})
|
||||
|
||||
},
|
||||
onReady: function () {
|
||||
// 生命周期函数--监听页面初次渲染完成
|
||||
|
||||
},
|
||||
onShow: function () {
|
||||
// 生命周期函数--监听页面显示
|
||||
|
||||
},
|
||||
onHide: function () {
|
||||
// 生命周期函数--监听页面隐藏
|
||||
|
||||
},
|
||||
onUnload: function () {
|
||||
// 生命周期函数--监听页面卸载
|
||||
|
||||
},
|
||||
onPullDownRefresh: function () {
|
||||
// 页面相关事件处理函数--监听用户下拉动作
|
||||
|
||||
},
|
||||
onReachBottom: function () {
|
||||
// 页面上拉触底事件的处理函数
|
||||
|
||||
},
|
||||
clickLetter: function (e) {
|
||||
console.log(e.currentTarget.dataset.letter)
|
||||
var showLetter = e.currentTarget.dataset.letter;
|
||||
this.setData({
|
||||
showLetter: showLetter,
|
||||
isShowLetter: true,
|
||||
scrollTopId: showLetter,
|
||||
})
|
||||
var that = this;
|
||||
setTimeout(function () {
|
||||
that.setData({
|
||||
isShowLetter: false
|
||||
})
|
||||
}, 1000)
|
||||
},
|
||||
//选择城市
|
||||
bindCity: function (e) {
|
||||
console.log("bindCity")
|
||||
this.setData({ city: e.currentTarget.dataset.city })
|
||||
},
|
||||
//选择热门城市
|
||||
bindHotCity: function (e) {
|
||||
console.log("bindHotCity")
|
||||
this.setData({
|
||||
city: e.currentTarget.dataset.city
|
||||
})
|
||||
},
|
||||
//点击热门城市回到顶部
|
||||
hotCity: function () {
|
||||
this.setData({
|
||||
scrollTop: 0,
|
||||
})
|
||||
}
|
||||
})
|
||||