Commit d0a1bf1c by 汪睦雄

'修改了很多bug'

parent 6717eeb4
...@@ -5,7 +5,7 @@ App({ ...@@ -5,7 +5,7 @@ App({
onLaunch: function(options) { onLaunch: function(options) {
this.options = options this.options = options
// 用户登录 // 用户登录
this.checkUserLogin() // this.checkUserLogin()
}, },
onShow: function(options) { onShow: function(options) {
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
"pages/detail/appoint/index", "pages/detail/appoint/index",
"components/navs/index", "components/navs/index",
"pages/search/search/search", "pages/search/search/search",
"pages/prjlist/list",
"pages/search/list/list" "pages/search/list/list"
], ],
"window": { "window": {
......
...@@ -22,4 +22,5 @@ ...@@ -22,4 +22,5 @@
.banner-image { .banner-image {
background: transparent; background: transparent;
width: 100%; width: 100%;
height: 180px;
} }
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<view class="prj-info"> <view class="prj-info">
<text class='ptitle'>{{projectItem.title}}</text> <text class='ptitle'>{{projectItem.title}}</text>
<view class="ptags"> <view class="ptags">
<text wx-if="{{projectItem.type=='1'}}">限{{projectItem.sign_limits}}组</text> <text wx-if="{{projectItem.type=='1'}}" class='sign_limits'>限{{projectItem.sign_limits}}组</text>
<text class='tags'>{{projectItem.tags}}</text> <text class='tags'>{{projectItem.tags}}</text>
</view> </view>
<view class="pactivity" wx-if="{{projectItem.type=='1'}}"> <view class="pactivity" wx-if="{{projectItem.type=='1'}}">
......
/* components/project-item/index.wxss */ /* components/project-item/index.wxss */
.project-item { .project-item {
padding: 20rpx 30rpx; padding: 30rpx 30rpx;
box-sizing: border-box; box-sizing: border-box;
display: flex; display: flex;
flex-flow: row nowrap; flex-flow: row nowrap;
...@@ -19,17 +19,24 @@ ...@@ -19,17 +19,24 @@
.prj-info { .prj-info {
width: 430rpx; width: 430rpx;
height: 190rpx;
display: flex; display: flex;
flex-flow: column nowrap; flex-flow: column nowrap;
justify-content: flex-start; justify-content: space-between;
align-items: flex-start;
} }
.prj-info .ptitle { .prj-info .ptitle {
padding-top: 10rpx; padding-top: 10rpx;
font-size: 28rpx; font-size: 28rpx;
color: rgb(51, 51, 51); color: rgb(51, 51, 51);
margin-bottom: 23rpx; /* margin-bottom: 23rpx; */
overflow:hidden;
display: -webkit-box;
-webkit-line-clamp:2;
-webkit-box-orient: vertical;
width: 90%;
text-overflow:ellipsis;
} }
.prj-info .ptags { .prj-info .ptags {
...@@ -37,7 +44,15 @@ ...@@ -37,7 +44,15 @@
width: 100%; width: 100%;
font-size: 24rpx; font-size: 24rpx;
color: rgb(153, 153, 153); color: rgb(153, 153, 153);
margin-bottom: 70rpx; /* margin-bottom: 30rpx; */
}
.ptags .sign_limits{
max-width: 180rpx;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
margin-right: 10rpx;
} }
.prj-info .ptags .tags { .prj-info .ptags .tags {
......
...@@ -78,9 +78,11 @@ Component({ ...@@ -78,9 +78,11 @@ Component({
if (name == '国内' || name == '国外') { if (name == '国内' || name == '国外') {
// 国内国外筛选 // 国内国外筛选
_selected.region = idx _selected.region = idx
_selected.city = '0'
} else { } else {
// 城市筛选 // 城市筛选
_selected.city = idx _selected.city = idx
_selected.region = '0'
} }
_selected_titles.region = name _selected_titles.region = name
} }
...@@ -137,7 +139,7 @@ Component({ ...@@ -137,7 +139,7 @@ Component({
}, },
// 提交筛选数据请求 // 提交筛选数据请求
_submitFilter() { _submitFilter() {
// console.log(this.data.selected ) console.log(this.data.selected )
let myEventDetail = { let myEventDetail = {
filters: this.data.selected filters: this.data.selected
} // detail对象,提供给事件监听函数 } // detail对象,提供给事件监听函数
......
<!--components/search-filter/index.wxml--> <!--components/search-filter/index.wxml-->
<wxs src="../../pages/common.wxs" module="common"></wxs> <wxs src="../../pages/common.wxs" module="common"></wxs>
<view class='filter-wrapper'> <view class='filter-wrapper' catchtouchmove="true">
<i-row i-class='row-filter'> <i-row i-class='row-filter'>
<i-col span="6"> <i-col span="6">
<view class="filter-item"> <view class="filter-item">
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
<image class="search-icon" src="/images/icon-down-select{{filter_idx==2?'ed':''}}.png"></image> <image class="search-icon" src="/images/icon-down-select{{filter_idx==2?'ed':''}}.png"></image>
</view> </view>
</i-col> </i-col>
<!-- 地区筛选 -->
<i-col span="6" i-class="col-class"> <i-col span="6" i-class="col-class">
<view class="filter-item"> <view class="filter-item">
<text class="{{filter_idx==3?'active':''}}" catchtap='filterTap' data-idx="3">{{selected_titles.region}}</text> <text class="{{filter_idx==3?'active':''}}" catchtap='filterTap' data-idx="3">{{selected_titles.region}}</text>
...@@ -27,30 +28,33 @@ ...@@ -27,30 +28,33 @@
</view> </view>
</i-col> </i-col>
</i-row> </i-row>
<view catchtap='closeFilter' class='filter-content-wrapper' wx:if="{{filter_idx>0}}"> <view catchtap='closeFilter' class='filter-content-wrapper' wx:if="{{filter_idx>0}}" catchtouchmove='true'>
<view class="row-content" catchtap='preventEvent'> <view class="row-content" catchtap='preventEvent'>
<scroll-view class="scroll-view" scroll-y="true" style="width: 100%;height: 100%;" wx:if="{{filter_idx!=4}}"> <scroll-view class="scroll-view" scroll-y="true" style="width: 100%;height: 100%;" wx:if="{{filter_idx!=4}}">
<view wx:if="{{filter_idx==1}}" class='filter-row' wx:for="{{types}}" wx:for-index="idx" wx:for-item="n" wx:key="n.id"> <view wx:if="{{filter_idx==1}}" class='filter-row' wx:for="{{types}}" wx:for-index="idx" wx:for-item="n" wx:key="n.id">
<text bindtap="selectFilter" data-idx="{{n.id}}" data-name="{{n.name}}" class="{{selected.type==n.id?'seled':''}}">{{n.name}}</text> <text bindtap="selectFilter" data-idx="{{n.id}}" data-name="{{n.name}}" class="{{selected.type==n.id?'seled':''}}">{{n.name}}</text>
<image wx:if="{{selected.type==n.id}}" class="f-selected" src='/images/icon_filter_selected.png'></image> <image wx:if="{{selected.type==n.id}}" class="f-selected" src='/images/icon_filter_selected.png'></image>
</view> </view>
<view wx:if="{{filter_idx==2}}" class='filter-row' wx:for="{{catalogs}}" wx:for-index="idx" wx:for-item="n" wx:key="n.id"> <view wx:if="{{filter_idx==2}}" class='filter-row' wx:for="{{catalogs}}" wx:for-index="idx" wx:for-item="n" wx:key="n.id">
<text bindtap="selectFilter" data-idx="{{n.id}}" data-name="{{n.name}}">{{n.name}}</text> <text bindtap="selectFilter" data-idx="{{n.id}}" data-name="{{n.name}}">{{n.name}}</text>
<image wx:if="{{selected.catalog==n.id}}" class='f-selected' src='/images/icon_filter_selected.png'></image> <image wx:if="{{selected.catalog==n.id}}" class='f-selected' src='/images/icon_filter_selected.png'></image>
</view> </view>
<view wx:if="{{filter_idx==3}}" class='filter-row' wx:for="{{regions}}" wx:for-index="idx" wx:for-item="n" wx:key="n.id"> <!-- 地区选项 -->
<text bindtap="selectFilter" data-idx="{{n.id}}" data-name="{{n.name}}">{{n.name}}</text> <view wx:if="{{filter_idx==3}}" class='filter-row' wx:for="{{regions}}" wx:for-index="idx" wx:for-item="n" wx:key="n.id">
<image wx:if="{{selected.region==n.id}}" class='f-selected' src='/images/icon_filter_selected.png'></image> <text bindtap="selectFilter" data-idx="{{n.id}}" data-name="{{n.name}}">{{n.name}}</text>
</view> <image wx:if="{{selected.region==n.id}}" class='f-selected' src='/images/icon_filter_selected.png'></image>
</scroll-view> </view>
<view class="tags-wrapper" wx:if="{{filter_idx==4}}"> </scroll-view>
<scroll-view class="tab-scroll-view" scroll-y="true" wx:if="{{filter_idx==4}}">
<view class="tags-wrapper">
<block wx:for="{{tags}}" wx:for-index="idx" wx:for-item="n" wx:key="n.id"> <block wx:for="{{tags}}" wx:for-index="idx" wx:for-item="n" wx:key="n.id">
<view class="tag-item {{common.inArray(selected.tags, n.id)==true?'active':''}}" bindtap="selectTags" data-idx="{{n.id}}"> <view class="tag-item {{common.inArray(selected.tags, n.id)==true?'active':''}}" bindtap="selectTags" data-idx="{{n.id}}">
{{n.name}} {{n.name}}
</view> </view>
</block> </block>
</view> </view>
<view class="tag-btn-wrapper" wx:if="{{filter_idx==4}}"> </scroll-view>
<view class="tag-btn-wrapper" wx:if="{{filter_idx==4}}">
<button class="btn cancel" bindtap="cancelSelectTags">取消选择</button> <button class="btn cancel" bindtap="cancelSelectTags">取消选择</button>
<button class="btn ensure" bindtap="ensureSelectTags">确定</button> <button class="btn ensure" bindtap="ensureSelectTags">确定</button>
</view> </view>
......
...@@ -71,7 +71,7 @@ ...@@ -71,7 +71,7 @@
} }
.filter-row > text { .filter-row > text {
width: 80%; width: 100%;
} }
.filter-row > text.seled { .filter-row > text.seled {
...@@ -88,9 +88,8 @@ ...@@ -88,9 +88,8 @@
flex-flow: row wrap; flex-flow: row wrap;
justify-content: space-around; justify-content: space-around;
align-items: center; align-items: center;
height: 88%; height: 100%;
width: 100%; width: 100%;
overflow: auto;
} }
.tag-item { .tag-item {
min-width: 120rpx; min-width: 120rpx;
...@@ -105,6 +104,10 @@ ...@@ -105,6 +104,10 @@
margin: 10rpx; margin: 10rpx;
border-radius: 2rpx; border-radius: 2rpx;
} }
.tab-scroll-view {
height: 88%;
width: 100%;
}
.scroll-view { .scroll-view {
height: 100%; height: 100%;
width: 100%; width: 100%;
...@@ -121,7 +124,7 @@ ...@@ -121,7 +124,7 @@
text-align: center; text-align: center;
position: absolute; position: absolute;
bottom: 0; bottom: 0;
height: 48px; height: 12%;
background-color: #f5f5f5; background-color: #f5f5f5;
display: flex; display: flex;
justify-content: center; justify-content: center;
......
.i-modal{position:fixed;overflow:auto;top:0;right:0;bottom:0;left:0;height:100%;z-index:1000;display:flex;outline:0;-webkit-box-align:center;align-items:center;-webkit-box-pack:center;justify-content:center;transform:translateZ(1px);opacity:0;visibility:hidden}.i-modal-show{visibility:visible;opacity:1}.i-modal-mask{position:fixed;top:0;left:0;right:0;bottom:0;background:rgba(0,0,0,.7);z-index:1000;transition:all .2s ease-in-out;opacity:0;visibility:hidden}.i-modal-mask-show{opacity:1;visibility:visible}.i-modal-main{width:270px;position:relative}.i-modal-content{border-radius:7px;padding-top:15px;position:relative;background-color:#fff;border:0;background-clip:padding-box;text-align:center;height:100%;overflow:hidden}.i-modal-body{max-height:100px;margin-bottom:15px;font-size:14px;color:#80848f;height:100%;line-height:1.5;overflow:auto}.i-modal-title{padding:6px 15px 15px;margin:0;font-size:18px;line-height:1;color:#1c2438;text-align:center}.i-modal-actions{margin:0 1px}.i-modal-action-vertical{position:relative}.i-modal-action-vertical:after{content:'';position:absolute;top:0;left:0;width:200%;height:200%;transform:scale(.5);transform-origin:0 0;pointer-events:none;box-sizing:border-box;border:0 solid #e9eaec;border-top-width:1px}.i-modal-grid{border-radius:0 0 7px 7px;border-left:none}.i-modal-grid-item,.i-modal-grid-item-last{padding:0;border-bottom:none}.i-modal-grid-item-last{border-right:none}.i-modal-btn-ok{color:#2d8cf0!important}.i-modal-btn-loading{display:inline-block;vertical-align:middle;margin-right:10px;width:12px;height:12px;background:0 0;border-radius:50%;border:2px solid #e5e5e5;border-color:#666 #e5e5e5 #e5e5e5 #e5e5e5;animation:btn-spin .6s linear;animation-iteration-count:infinite}.i-modal-btn-text{display:inline-block;vertical-align:middle}.i-modal-btn-icon{font-size:14px!important;margin-right:4px}@keyframes btn-spin{0%{transform:rotate(0)}100%{transform:rotate(360deg)}} .i-modal{position:fixed;overflow:auto;top:0;right:0;bottom:0;left:0;height:100%;z-index:1000;display:flex;outline:0;-webkit-box-align:center;align-items:center;-webkit-box-pack:center;justify-content:center;transform:translateZ(1px);opacity:0;visibility:hidden}.i-modal-show{visibility:visible;opacity:1}.i-modal-mask{position:fixed;top:0;left:0;right:0;bottom:0;background:rgba(0,0,0,.7);z-index:1000;transition:all .2s ease-in-out;opacity:0;visibility:hidden}.i-modal-mask-show{opacity:1;visibility:visible}.i-modal-main{width:270px;position:relative}.i-modal-content{border-radius:7px;padding-top:15px;position:relative;background-color:#fff;border:0;background-clip:padding-box;text-align:center;height:100%;overflow:hidden}.i-modal-body{max-height:152px;margin-bottom:15px;font-size:14px;color:#80848f;height:100%;line-height:1.5;overflow:auto}.i-modal-title{padding:6px 15px 15px;margin:0;font-size:18px;line-height:1;color:#1c2438;text-align:center}.i-modal-actions{margin:0 1px}.i-modal-action-vertical{position:relative}.i-modal-action-vertical:after{content:'';position:absolute;top:0;left:0;width:200%;height:200%;transform:scale(.5);transform-origin:0 0;pointer-events:none;box-sizing:border-box;border:0 solid #e9eaec;border-top-width:1px}.i-modal-grid{border-radius:0 0 7px 7px;border-left:none}.i-modal-grid-item,.i-modal-grid-item-last{padding:0;border-bottom:none}.i-modal-grid-item-last{border-right:none}.i-modal-btn-ok{color:#2d8cf0!important}.i-modal-btn-loading{display:inline-block;vertical-align:middle;margin-right:10px;width:12px;height:12px;background:0 0;border-radius:50%;border:2px solid #e5e5e5;border-color:#666 #e5e5e5 #e5e5e5 #e5e5e5;animation:btn-spin .6s linear;animation-iteration-count:infinite}.i-modal-btn-text{display:inline-block;vertical-align:middle}.i-modal-btn-icon{font-size:14px!important;margin-right:4px}@keyframes btn-spin{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}
\ No newline at end of file \ No newline at end of file
...@@ -47,19 +47,16 @@ Page({ ...@@ -47,19 +47,16 @@ Page({
}).then(res => { }).then(res => {
if (!res.code) { if (!res.code) {
app.globalData.userInfo = res.user app.globalData.userInfo = res.user
wx.setStorage({ wx.setStorageSync('token', res.token)
key: 'token', $Toast({
data: res.token, content: '授权登录成功',
}) type: 'success'
Wx.showToast({ });
title: '微信授权成功', setTimeout(()=>{
icon: 'success',
duration: 2000,
}).then(() => {
wx.navigateBack({ wx.navigateBack({
delta: 1 delta: 1
}) })
}) }, 1000);
} else { } else {
$Toast({ $Toast({
content: '微信授权失败,请重试', content: '微信授权失败,请重试',
......
...@@ -9,8 +9,8 @@ ...@@ -9,8 +9,8 @@
</view> </view>
<view class='action-wrapper'> <view class='action-wrapper'>
<i-button bindgetuserinfo="handleWxAuth" type="success" shape="circle" open-type='getUserInfo'>微信授权</i-button> <i-button bindgetuserinfo="handleWxAuth" type="success" shape="circle" open-type='getUserInfo'>微信授权</i-button>
<i-button bindgetphonenumber="handlePhoneAuth" type="info" shape="circle" open-type="getPhoneNumber">手机号授权</i-button> <!-- <i-button bindgetphonenumber="handlePhoneAuth" type="info" shape="circle" open-type="getPhoneNumber">手机号授权</i-button> -->
<view class="text-small text-hint tip">请完成2步,微信授权</view> <view class="text-small text-hint tip">请完成微信授权</view>
</view> </view>
</view> </view>
</view> </view>
......
...@@ -25,7 +25,7 @@ Page({ ...@@ -25,7 +25,7 @@ Page({
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function (options) { onLoad: function(options) {
if (options.id) { if (options.id) {
this.setData({ this.setData({
id: options.id id: options.id
...@@ -36,7 +36,7 @@ Page({ ...@@ -36,7 +36,7 @@ Page({
/** /**
* 生命周期函数--监听页面初次渲染完成 * 生命周期函数--监听页面初次渲染完成
*/ */
onReady: function () { onReady: function() {
let that = this let that = this
wx.showNavigationBarLoading() wx.showNavigationBarLoading()
wx.showLoading({ wx.showLoading({
...@@ -51,7 +51,7 @@ Page({ ...@@ -51,7 +51,7 @@ Page({
/** /**
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow: function () { onShow: function() {
this.setData({ this.setData({
nickname: app.globalData.userInfo.nickname nickname: app.globalData.userInfo.nickname
}) })
...@@ -62,7 +62,7 @@ Page({ ...@@ -62,7 +62,7 @@ Page({
} }
}, },
getDetailData: function () { getDetailData: function() {
api.project.detail({ api.project.detail({
id: this.data.id id: this.data.id
}).then(res => { }).then(res => {
...@@ -75,13 +75,13 @@ Page({ ...@@ -75,13 +75,13 @@ Page({
}) })
}, },
// 打开位置 // 打开位置
handleMap: function () { handleMap: function() {
wx.openLocation({ wx.openLocation({
latitude: parseFloat(this.data.detail.latitude), latitude: parseFloat(this.data.detail.latitude),
longitude: parseFloat(this.data.detail.longitude), longitude: parseFloat(this.data.detail.longitude),
}) })
}, },
handlePhoneAuth: function (event) { handlePhoneAuth: function(event) {
Wx.login().then(res => { Wx.login().then(res => {
let encryptedData = event.detail.encryptedData let encryptedData = event.detail.encryptedData
let iv = event.detail.iv let iv = event.detail.iv
...@@ -92,7 +92,7 @@ Page({ ...@@ -92,7 +92,7 @@ Page({
/** /**
* 解密手机号数据 * 解密手机号数据
*/ */
decodePhoneData: function (code, encryptedData, iv) { decodePhoneData: function(code, encryptedData, iv) {
let that = this let that = this
api.getPhoneNumber({ api.getPhoneNumber({
code: code, code: code,
...@@ -107,6 +107,10 @@ Page({ ...@@ -107,6 +107,10 @@ Page({
this.setData({ this.setData({
phone: res.data.phone phone: res.data.phone
}) })
// 将刚拿到的手机号码放到全局数据中,否则phone数据只会是当前页面数据
if (app.globalData.userInfo) {
app.globalData.userInfo.phone = res.data.phone
}
} else { } else {
$Toast({ $Toast({
content: '手机号授权失败', content: '手机号授权失败',
...@@ -116,24 +120,24 @@ Page({ ...@@ -116,24 +120,24 @@ Page({
}) })
}, },
handleNickname: function (event) { handleNickname: function(event) {
this.setData({ this.setData({
nickname: event.detail.value nickname: event.detail.value
}) })
}, },
handleDateChange: function (e) { handleDateChange: function(e) {
this.setData({ this.setData({
date: e.detail.value date: e.detail.value
}) })
}, },
handleRemark: function (event) { handleRemark: function(event) {
this.setData({ this.setData({
remark: event.detail.value remark: event.detail.value
}) })
}, },
handleSubmit: function () { handleSubmit: function() {
if (!this.data.nickname || !this.data.phone || !this.data.date) { if (!this.data.nickname || !this.data.phone || !this.data.date) {
$Toast({ $Toast({
content: '请完善必要信息', content: '请完善必要信息',
......
...@@ -46,13 +46,6 @@ ...@@ -46,13 +46,6 @@
<i-cell title="备注" i-class="cell-class"> <i-cell title="备注" i-class="cell-class">
<input slot="footer" class='input' type='text' placeholder='备注(可选)' bindinput='handleRemark'></input> <input slot="footer" class='input' type='text' placeholder='备注(可选)' bindinput='handleRemark'></input>
</i-cell> </i-cell>
<i-cell>
<image slot="icon" src='/images/icon_location.png' mode='scaleToFill' class='icon'></image>
<view catchtap='handleMap'>{{detail.location}}</view>
<view slot="footer">
<image src='/images/icon_map.png' class='icon-map' catchtap='handleMap'></image>
</view>
</i-cell>
</i-cell-group> </i-cell-group>
</view> </view>
......
...@@ -110,6 +110,10 @@ Page({ ...@@ -110,6 +110,10 @@ Page({
this.setData({ this.setData({
phone: res.data.phone phone: res.data.phone
}) })
// 将刚拿到的手机号码放到全局数据中,否则phone数据只会是当前页面数据
if (app.globalData.userInfo){
app.globalData.userInfo.phone = res.data.phone
}
} else { } else {
$Toast({ $Toast({
content: '手机号授权失败', content: '手机号授权失败',
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
<!-- 报名信息 --> <!-- 报名信息 -->
<view class='project-input margin-bottom'> <view class='project-input margin-bottom'>
<i-cell-group> <i-cell-group>
<i-cell title="家庭组数" is-link i-class="cell-class"> <i-cell title="数量" is-link i-class="cell-class">
<picker slot="footer" class="num-picker" bindchange="bindPickerChange" range="{{nums}}" value="{{familyNum}}"> <picker slot="footer" class="num-picker" bindchange="bindPickerChange" range="{{nums}}" value="{{familyNum}}">
<view class='picker-text'>{{familyNum + 1}}</view> <view class='picker-text'>{{familyNum + 1}}</view>
</picker> </picker>
...@@ -62,7 +62,7 @@ ...@@ -62,7 +62,7 @@
<input slot="footer" class='input' type='text' placeholder='如5岁、八岁' bindinput='handleChildrenAge'></input> <input slot="footer" class='input' type='text' placeholder='如5岁、八岁' bindinput='handleChildrenAge'></input>
</i-cell> </i-cell>
<i-cell title="地址" i-class="cell-class"> <i-cell title="地址" i-class="cell-class">
<input slot="footer" class='input' type='text' placeholder='地址(可选)' bindinput='handleAddress'></input> <input slot="footer" class='input' type='text' placeholder='请输入地址' bindinput='handleAddress'></input>
</i-cell> </i-cell>
<i-cell title="备注" i-class="cell-class"> <i-cell title="备注" i-class="cell-class">
<input slot="footer" class='input' type='text' placeholder='备注(可选)' bindinput='handleRemark'></input> <input slot="footer" class='input' type='text' placeholder='备注(可选)' bindinput='handleRemark'></input>
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<view class='v-page'> <view class='v-page'>
<banner banners="{{detail.banners}}" /> <banner banners="{{detail.banners}}" />
<view class="attributes-wrapper"> <view class="attributes-wrapper">
<view class='header'> <view class='header'>
<view class='title'>{{detail.title}}</view> <view class='title'>{{detail.title}}</view>
...@@ -22,11 +22,18 @@ ...@@ -22,11 +22,18 @@
</i-cell> </i-cell>
<i-cell> <i-cell>
<image slot="icon" src='/images/icon_location.png' mode='scaleToFill' class='icon'></image> <image slot="icon" src='/images/icon_location.png' mode='scaleToFill' class='icon'></image>
<view catchtap='handleMap'>{{detail.location}}</view> <view class='text_address' catchtap='handleMap'>{{detail.location}}</view>
<view slot="footer"> <view slot="footer">
<image src='/images/icon_map.png' class='icon-map' catchtap='handleMap'></image> <image src='/images/icon_map.png' class='icon-map' catchtap='handleMap'></image>
</view> </view>
</i-cell> </i-cell>
<i-cell wx-if="{{detail.type=='2'}}">
<image slot="icon" src='/images/icon_rmb.png' mode='scaleToFill' class='icon'></image>
<view catchtap='handleMap'>
<text>参考价格:<text class='text-red'>¥{{detail.price}}起/{{detail.night_num}}晚</text> </text>
</view>
</i-cell>
<i-cell wx-if="{{detail.type=='1'}}"> <i-cell wx-if="{{detail.type=='1'}}">
<image slot="icon" src='/images/icon_rmb.png' mode='scaleToFill' class='icon'></image> <image slot="icon" src='/images/icon_rmb.png' mode='scaleToFill' class='icon'></image>
<view class='text-red'> <view class='text-red'>
...@@ -39,14 +46,12 @@ ...@@ -39,14 +46,12 @@
</i-cell> </i-cell>
</i-cell-group> </i-cell-group>
</view> </view>
<view class='desc-wrapper'> <view class='desc-wrapper'>
<view class='title'>{{detail.type=='1'?'活动':'商家'}}详情</view> <view class='title'>{{detail.type=='1'?'活动':'商家'}}详情</view>
<view class='content'> <view class='content'>
<template is="wxParse" data="{{wxParseData:description.nodes}}" /> <template is="wxParse" data="{{wxParseData:description.nodes}}" />
</view> </view>
</view> </view>
<view wx-if="{{detail.type=='1'}}" class='comments-wrapper'> <view wx-if="{{detail.type=='1'}}" class='comments-wrapper'>
<view class='title'>活动评价({{comments.length > 0 ? comments.lenght : 0}})</view> <view class='title'>活动评价({{comments.length > 0 ? comments.lenght : 0}})</view>
<view class='content-wrapper'> <view class='content-wrapper'>
...@@ -76,13 +81,17 @@ ...@@ -76,13 +81,17 @@
</view> </view>
</view> </view>
<i-toast id="toast" /> <i-toast id="toast" />
<i-modal title="咨询客服" visible="{{show_kf}}" bind:ok="handleKfClose" bind:cancel="handleKfClose" ok-text="保存图片"> <i-modal title="咨询客服" visible="{{show_kf}}" bind:ok="handleKfClose" bind:cancel="handleKfClose" ok-text="保存图片">
<view class="qrcode"> <view class="qrcode">
<image style='width:236rpx;height:236rpx;border-radius:4rpx;' src='{{detail.kf_qrcode}}'></image> <image style='width:236rpx;height:236rpx;border-radius:4rpx;' src='{{detail.kf_qrcode}}'></image>
<text style='width:100%;text-align:center;height:24px;line-height:24px;font-size:24rpx;'> <text style='width:100%;text-align:center;height:24px;line-height:24px;font-size:24rpx;'>
保存图片后,扫码添加客服咨询 保存图片后,扫码添加客服咨询
</text> </text>
</view> </view>
</i-modal> </i-modal>
</view> </view>
\ No newline at end of file
...@@ -115,8 +115,8 @@ ...@@ -115,8 +115,8 @@
} }
.op-wrapper .icon { .op-wrapper .icon {
width: 22px; width: 20px;
height: 22px; height: 20px;
display: inline-block; display: inline-block;
} }
...@@ -137,4 +137,9 @@ ...@@ -137,4 +137,9 @@
} }
.actions-section.btn-soldout { .actions-section.btn-soldout {
background-color: #CFCFCF; background-color: #CFCFCF;
}
.text_address{
text-overflow: ellipsis;
overflow: hidden;
margin-right: 10px;
} }
\ No newline at end of file
...@@ -4,9 +4,9 @@ ...@@ -4,9 +4,9 @@
<view class="guide-wrapper" wx:for="{{guides}}" wx:for-item="n" wx:key="n.id" catchtap='handleGuideDetail' data-content="{{n.type=='1'?n.id:n.content}}" data-type="{{n.type}}"> <view class="guide-wrapper" wx:for="{{guides}}" wx:for-item="n" wx:key="n.id" catchtap='handleGuideDetail' data-content="{{n.type=='1'?n.id:n.content}}" data-type="{{n.type}}">
<image class='image' src="{{n.poster}}" mode='aspectFill'></image> <image class='image' src="{{n.poster}}" mode='aspectFill'></image>
<view class='info'> <view class='info'>
<view class='text-small intro'>{{n.intro ? n.intro : ''}}</view> <view class='text-small intro'>{{n.title ? n.title : ''}}</view>
<view class='text-small text-hint'> <view class='text-small text-hint'>
<text class='tag' wx:for="{{n.tags}}" wx:for-index="idx" wx:key="idx" wx:for-item="t">{{t}}</text> {{n.intro}}
</view> </view>
</view> </view>
</view> </view>
......
...@@ -24,18 +24,18 @@ ...@@ -24,18 +24,18 @@
} }
.guide-wrapper .image { .guide-wrapper .image {
width: 130px; height: 95px;
height: 95px; flex: 0 0 130px
display: inline-block;
} }
.guide-wrapper .info { .guide-wrapper .info {
flex: 1; flex: 1;
display: flex; display: flex;
flex-direction: column; flex-flow: column nowrap;
justify-content: space-between; justify-content: space-between;
padding: 5px 10px; padding: 0 10px;
color: rgb(51, 51, 51); color: rgb(51, 51, 51);
overflow: hidden;
} }
.guide-wrapper .info .intro { .guide-wrapper .info .intro {
...@@ -46,6 +46,8 @@ ...@@ -46,6 +46,8 @@
overflow: hidden; overflow: hidden;
} }
.guide-wrapper .info .tag { .guide-wrapper .info .text-hint {
margin-right: 4px; text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
} }
...@@ -3,6 +3,9 @@ import api from '../../utils/Api.js' ...@@ -3,6 +3,9 @@ import api from '../../utils/Api.js'
import Config from '../../utils/Config.js' import Config from '../../utils/Config.js'
const app = getApp() const app = getApp()
const {
$Message
} = require('../../iview/base/index');
Page({ Page({
...@@ -37,7 +40,62 @@ Page({ ...@@ -37,7 +40,62 @@ Page({
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow: function() { onShow: function() {
// 检查用户是否登陆
this.checkUserLogin()
wx.showShareMenu({
withShareTicket: true,
success: function(ret) {
console.log('shareTickets:', ret)
}
})
},
/**
* 用户资料授权
*/
checkUserLogin: function(callback) {
if (app.globalData.userInfo == null) {
api.me.info().then(res => {
if (res.code == 0) {
app.globalData.userInfo = res.data
} else {
$Message({
content: '请授权登录美行者亲子游',
type: 'warning'
})
setTimeout(() => {
wx.navigateTo({
url: '/pages/auth/index',
})
}, 800)
}
})
}
// console.log(wx.getStorageSync('token') )
// if (!wx.getStorageSync('token')) {
// $Message({
// content: '请授权登录美行者亲子游',
// type: 'warning'
// })
// setTimeout(()=>{
// wx.navigateTo({
// url: '/pages/auth/index',
// })
// }, 800)
// } else {
// api.me.info().then(res => {
// if(res.code == 0){
// app.globalData.userInfo = res.data
// }else{
// $Message({
// content: res.msg,
// type: 'error'
// })
// }
// })
// }
}, },
/** /**
...@@ -108,7 +166,7 @@ Page({ ...@@ -108,7 +166,7 @@ Page({
url: '/pages/prjlist/list?type=' + _type + '&ptitle=' + _ptitle, url: '/pages/prjlist/list?type=' + _type + '&ptitle=' + _ptitle,
}) })
}, },
// 更多:按分类筛选 // 更多:按分类筛选
gotoSearchProjects: function(event) { gotoSearchProjects: function(event) {
let _catalog = event.target.dataset.catalog let _catalog = event.target.dataset.catalog
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
"i-cell-group": "/iview/cell-group/index", "i-cell-group": "/iview/cell-group/index",
"i-cell": "/iview/cell/index", "i-cell": "/iview/cell/index",
"i-row": "/iview/row/index", "i-row": "/iview/row/index",
"i-col": "/iview/col/index" "i-col": "/iview/col/index",
"i-message": "/iview/message/index"
} }
} }
\ No newline at end of file
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
<image class='image' src="{{n.poster}}" mode='aspectFill'></image> <image class='image' src="{{n.poster}}" mode='aspectFill'></image>
<view class='title'>{{n.title}}</view> <view class='title'>{{n.title}}</view>
<view class='info'> <view class='info'>
<text class='text-red text-small mergin-right-2'>¥{{common.numFixed(n.vip_price, 0)}}</text> <text class='text-red text-small mergin-right-2'>¥{{common.numFixed(n.price, 0)}}</text>
<text> 起/{{n.night_num}}晚</text> <text> 起/{{n.night_num}}晚</text>
</view> </view>
</view> </view>
...@@ -42,8 +42,8 @@ ...@@ -42,8 +42,8 @@
</i-cell-group> </i-cell-group>
<i-cell-group i-class="section-wrapper"> <i-cell-group i-class="section-wrapper">
<i-cell title="酒店预订" is-link i-class="text-mtitle"> <i-cell title="美行推荐" is-link i-class="text-mtitle">
<text slot="footer" class='text-gray text-small' catchtap='gotoSearchProjects' data-catalog='5' data-name='酒店预订'>更多</text> <text slot="footer" class='text-gray text-small' catchtap='gotoSearchProjects' data-catalog='5' data-name='美行推荐'>更多</text>
</i-cell> </i-cell>
<i-row i-class="col-wrapper"> <i-row i-class="col-wrapper">
<i-col span="12" i-class="col-class" wx:for="{{businesses}}" wx:for-index="idx" wx:for-item="n" wx:key="n.id"> <i-col span="12" i-class="col-class" wx:for="{{businesses}}" wx:for-index="idx" wx:for-item="n" wx:key="n.id">
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
<image class='image' src="{{n.poster}}" mode='aspectFill'></image> <image class='image' src="{{n.poster}}" mode='aspectFill'></image>
<view class='title'>{{n.title}}</view> <view class='title'>{{n.title}}</view>
<view class='info'> <view class='info'>
<text class='text-red text-small mergin-right-2'>¥{{common.numFixed(n.vip_price, 0)}}</text> <text class='text-red text-small mergin-right-2'>¥{{common.numFixed(n.price, 0)}}</text>
<text> 起/{{n.night_num}}晚</text> <text> 起/{{n.night_num}}晚</text>
</view> </view>
</view> </view>
...@@ -69,10 +69,12 @@ ...@@ -69,10 +69,12 @@
<view class='info'> <view class='info'>
<view class='text-small intro'>{{n.title ? n.title : ''}}</view> <view class='text-small intro'>{{n.title ? n.title : ''}}</view>
<view class='text-small text-hint'> <view class='text-small text-hint'>
<text>{{n.intro}}</text> {{n.intro}}
</view> </view>
</view> </view>
</view> </view>
</view> </view>
</i-cell-group> </i-cell-group>
<i-message id="message" />
</view> </view>
\ No newline at end of file
...@@ -57,15 +57,14 @@ page { ...@@ -57,15 +57,14 @@ page {
.guides-wrapper { .guides-wrapper {
position: relative; position: relative;
padding: 0 15px; margin: 0 15px;
} }
.guide-item { .guide-item {
position: relative;
border-bottom: 1px solid #eee; border-bottom: 1px solid #eee;
padding: 10px 0; padding: 10px 0;
display: flex; display: flex;
flex-direction: row; flex-flow: row nowrap;
justify-content: space-between; justify-content: space-between;
} }
...@@ -75,18 +74,19 @@ page { ...@@ -75,18 +74,19 @@ page {
} }
.guide-item image { .guide-item image {
display: inline-block;
width: 130px;
height: 95px; height: 95px;
flex: 0 0 130px
} }
.guide-item .info { .guide-item .info {
flex: 1; flex: 1;
display: flex; display: flex;
flex-direction: column; flex-flow: column nowrap;
justify-content: space-between; justify-content: space-between;
padding: 5px 10px; padding: 0 6px;
padding-left: 12px;
color: rgb(51, 51, 51); color: rgb(51, 51, 51);
overflow: hidden;
} }
.guide-item .info .intro { .guide-item .info .intro {
...@@ -96,7 +96,14 @@ page { ...@@ -96,7 +96,14 @@ page {
-webkit-box-orient: vertical; -webkit-box-orient: vertical;
overflow: hidden; overflow: hidden;
} }
.text-mtitle{
.text-mtitle {
font-size: 16px; font-size: 16px;
font-weight: bolder; font-weight: bolder;
} }
.guide-item .info .text-hint {
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
}
\ No newline at end of file
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
<view class='calculation-box'> <view class='calculation-box'>
<i-row class='height'> <i-row class='height'>
<i-col span="6" offset='1' i-class="col-class">{{user.is_vip==1?'续费':'购买'}}会员</i-col> <i-col span="6" offset='1' i-class="col-class">{{user.is_vip==1?'续费':'购买'}}会员</i-col>
<i-col span="4" i-class="col-class color-orange">¥ {{vip_price}}</i-col> <i-col span="4" i-class="col-class color-orange">¥{{vip_price}}</i-col>
<i-col span="12" offset='1' i-class="col-class"> <i-col span="12" offset='1' i-class="col-class">
<i-input-number i-class="vip_num_input" value="{{ value1 }}" min="1" max="10" bindchange="handleChange1" /> <i-input-number i-class="vip_num_input" value="{{ value1 }}" min="1" max="10" bindchange="handleChange1" />
</i-col> </i-col>
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
"compileType": "miniprogram", "compileType": "miniprogram",
"libVersion": "2.3.2", "libVersion": "2.3.2",
"appid": "wx1b834552a7d49bb3", "appid": "wx1b834552a7d49bb3",
"projectname": "mxz", "projectname": "%E7%BE%8E%E8%A1%8C%E8%80%85%E4%BA%B2%E5%AD%90%E6%B8%B8",
"debugOptions": { "debugOptions": {
"hidedInDevtools": [] "hidedInDevtools": []
}, },
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
"list": [] "list": []
}, },
"miniprogram": { "miniprogram": {
"current": 11, "current": 14,
"list": [ "list": [
{ {
"id": 0, "id": 0,
...@@ -91,7 +91,7 @@ ...@@ -91,7 +91,7 @@
"id": 8, "id": 8,
"name": "活动/商家详情", "name": "活动/商家详情",
"pathName": "pages/detail/index", "pathName": "pages/detail/index",
"query": "id=12" "query": "id=127"
}, },
{ {
"id": -1, "id": -1,
...@@ -109,7 +109,7 @@ ...@@ -109,7 +109,7 @@
"id": 11, "id": 11,
"name": "预约下次", "name": "预约下次",
"pathName": "pages/detail/appoint/index", "pathName": "pages/detail/appoint/index",
"query": "id=8" "query": "id=173"
}, },
{ {
"id": -1, "id": -1,
...@@ -123,6 +123,12 @@ ...@@ -123,6 +123,12 @@
"pathName": "pages/index/index", "pathName": "pages/index/index",
"query": "", "query": "",
"scene": "1047" "scene": "1047"
},
{
"id": -1,
"name": "预约下次",
"pathName": "pages/detail/appoint/index",
"query": "id=173"
} }
] ]
} }
......
...@@ -33,12 +33,12 @@ function wxParse(bindName = 'wxParseData', type='html', data='<div class="color: ...@@ -33,12 +33,12 @@ function wxParse(bindName = 'wxParseData', type='html', data='<div class="color:
var transData = {};//存放转化后的数据 var transData = {};//存放转化后的数据
if (type == 'html') { if (type == 'html') {
transData = HtmlToJson.html2json(data, bindName); transData = HtmlToJson.html2json(data, bindName);
console.log(JSON.stringify(transData, ' ', ' ')); // console.log(JSON.stringify(transData, ' ', ' '));
} else if (type == 'md' || type == 'markdown') { } else if (type == 'md' || type == 'markdown') {
var converter = new showdown.Converter(); var converter = new showdown.Converter();
var html = converter.makeHtml(data); var html = converter.makeHtml(data);
transData = HtmlToJson.html2json(html, bindName); transData = HtmlToJson.html2json(html, bindName);
console.log(JSON.stringify(transData, ' ', ' ')); // console.log(JSON.stringify(transData, ' ', ' '));
} }
transData.view = {}; transData.view = {};
transData.view.imagePadding = 0; transData.view.imagePadding = 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment