Commit ef3bc1f1 by 严立

LL - 导航地图

parent b17c5786
App({
globalData: {
appResourcesBase: 'http://sm-web.meiqicloud.com/userfiles/appResources/',
token: '',
refreshToken: '',
userInfo: null,
......@@ -11,17 +12,17 @@ App({
onLaunch: function () {
this.setUnitProportion()
},
onShow: function (options) {
},
onHide: function () {
},
onError: function (msg) {
},
setUnitProportion: function () {
......@@ -34,140 +35,138 @@ App({
var token = that.globalData.token
var param = obj.data ? JSON.stringify(obj.data) : ""
var header = obj.header ? obj.header : { 'token': token || '', }
wx.request({
url: that.globalData.baseUrl + obj.url,
data: param,
method: obj.method || "POST",
header: header,
success: function (res) {
console.log("接口:", that.globalData.baseUrl + obj.url);
console.log("参数:", JSON.stringify(obj.data));
console.log("返回:", res);
let code = res.data.code * 1;
if (200 == code && true == res.data.success) {
if (obj.success) {
obj.success(res.data)
}
} else if (402 == code) { // token失效
that.refreshToken({
success: function() {
that.wxRequest(obj)
url: that.globalData.baseUrl + obj.url,
data: param,
method: obj.method || "POST",
header: header,
success: function (res) {
console.log("接口:", that.globalData.baseUrl + obj.url);
console.log("参数:", JSON.stringify(obj.data));
console.log("返回:", res);
let code = res.data.code * 1;
if (200 == code && true == res.data.success) {
if (obj.success) {
obj.success(res.data)
}
} else if (402 == code) { // token失效
that.refreshToken({
success: function () {
that.wxRequest(obj)
}
})
} else {
if (obj.fail) {
let err = {
statusCode: code,
msg: res.data.msg || '网络异常'
};
obj.fail(err)
}
}
})
} else {
if (obj.fail) {
let err = {
statusCode: code,
msg: res.data.msg || '网络异常'
};
obj.fail(err)
}
}
},
fail: function (err) {
console.log("接口:", that.globalData.baseUrl + obj.url);
console.log("参数:", obj.data);
console.log("返回:", err);
if (obj.fail) {
let err = {
statusCode: 9999,
msg: '网络异常'
};
obj.fail(err)
} else {
wx.showToast({
title: '网络异常',
icon: 'none',
duration: 2000
})
},
fail: function (err) {
console.log("接口:", that.globalData.baseUrl + obj.url);
console.log("参数:", obj.data);
console.log("返回:", err);
if (obj.fail) {
let err = {
statusCode: 9999,
msg: '网络异常'
};
obj.fail(err)
} else {
wx.showToast({
title: '网络异常',
icon: 'none',
duration: 2000
})
}
}
}
});
},
login(obj) {
let token = this.globalData.token
let that = this
if (token) {
if (obj.success) {
obj.success(token)
}
} else {
wx.login({
success: res => {
// 发送 res.code 到后台换取 openId, sessionKey, unionId
console.log('wx.login:', res);
this.wxRequest({
url: '/api/v1/login/getSmallSession?code='+res.code,
method: 'GET',
success: function (res) {
that.globalData.token = res.data.token
that.globalData.refreshToken = res.data.refreshToken
wx.setStorageSync('expires_in', res.data.expires_in)
wx.setStorageSync('openid', res.data.openid)
wx.setStorageSync('session_key', res.data.session_key)
wx.setStorageSync('mobile', res.data.mobile)
wx.setStorageSync('nickName', res.data.nickName)
wx.setStorageSync('avatarUrl', res.data.avatarUrl)
wx.setStorageSync('userType', res.data.userType) // 0 游客 1 业主
wx.setStorageSync('sex', res.data.sex)
wx.setStorageSync('birthday', res.data.birthday)
wx.setStorageSync('address', res.data.address)
if (obj.success) {
obj.success(res.data.token)
let token = this.globalData.token
let that = this
if (token) {
if (obj.success) {
obj.success(token)
}
} else {
wx.login({
success: res => {
// 发送 res.code 到后台换取 openId, sessionKey, unionId
console.log('wx.login:', res);
this.wxRequest({
url: '/api/v1/login/getSmallSession?code=' + res.code,
method: 'GET',
success: function (res) {
that.globalData.token = res.data.token
that.globalData.refreshToken = res.data.refreshToken
wx.setStorageSync('expires_in', res.data.expires_in)
wx.setStorageSync('openid', res.data.openid)
wx.setStorageSync('session_key', res.data.session_key)
wx.setStorageSync('mobile', res.data.mobile)
wx.setStorageSync('nickName', res.data.nickName)
wx.setStorageSync('avatarUrl', res.data.avatarUrl)
wx.setStorageSync('userType', res.data.userType) // 0 游客 1 业主
wx.setStorageSync('sex', res.data.sex)
wx.setStorageSync('birthday', res.data.birthday)
wx.setStorageSync('address', res.data.address)
if (obj.success) {
obj.success(res.data.token)
}
},
})
}
},
})
}
})
}
}
},
registUserInfo(obj) {
this.wxRequest({
url: '/api/v1/login/getDecryptData',
data: obj.param,
success: function(res) {
if (obj.success) {
obj.success(res)
}
},
fail: function (err) {
if (obj.fail) {
obj.fail(err)
}
}
})
this.wxRequest({
url: '/api/v1/login/getDecryptData',
data: obj.param,
success: function (res) {
if (obj.success) {
obj.success(res)
}
},
fail: function (err) {
if (obj.fail) {
obj.fail(err)
}
}
})
},
refreshToken(obj) {
let that = this
this.wxRequest({
url: '/api/v1/login/refreshToken',
header: {
token: this.globalData.token,
refreshToken: this.globalData.refreshToken
},
success: function(res) {
let token = res.data.token
let refreshToken = res.data.refreshToken
that.globalData.token = token
that.globalData.refreshToken = refreshToken
if (obj.success) {
obj.success()
}
let that = this
this.wxRequest({
url: '/api/v1/login/refreshToken',
header: {
token: this.globalData.token,
refreshToken: this.globalData.refreshToken
},
success: function (res) {
let token = res.data.token
let refreshToken = res.data.refreshToken
}
})
}
that.globalData.token = token
that.globalData.refreshToken = refreshToken
if (obj.success) {
obj.success()
}
})
}
})
}
})
\ No newline at end of file
......@@ -8,7 +8,7 @@
"pages/ownerCertification/ownerCertification",
"pages/hotelAccommodation/hotelAccommodation",
"pages/login/login",
"pages/guide/guide",
"pages/campsite/campsite",
"pages/myInfo/myInfo",
......@@ -25,7 +25,7 @@
"pages/notice-detail/notice-detail",
"pages/shop-detail/shop-detail",
"pages/strategy/strategy",
"pages/guide/guide",
"pages/index/index"
],
"usingComponents": {
......
let App = getApp()
let logicData = {
pageScrollLock: false,
pageScrollTimer: 0,
......@@ -10,11 +12,12 @@ Page({
detailImage: [],
detailImageUrl: [
'https://image-1256588539.cos.ap-shanghai.myqcloud.com/home/campsite0.png',
'https://image-1256588539.cos.ap-shanghai.myqcloud.com/home/campsite1.png',
'https://image-1256588539.cos.ap-shanghai.myqcloud.com/home/campsite2.png',
'https://image-1256588539.cos.ap-shanghai.myqcloud.com/home/campsite3.png',
'https://image-1256588539.cos.ap-shanghai.myqcloud.com/home/campsite4.png',
App.globalData.appResourcesBase + 'campsite/campsite-1.png',
App.globalData.appResourcesBase + 'campsite/campsite-2.png',
App.globalData.appResourcesBase + 'campsite/campsite-3.png',
App.globalData.appResourcesBase + 'campsite/campsite-4.png',
App.globalData.appResourcesBase + 'campsite/campsite-5.png',
App.globalData.appResourcesBase + 'campsite/campsite-6.png',
],
detailIndex: 0,
},
......
import iPoint from './js/point.js'
Page({
data: {
mapWidth: 500,
mapHeight: 338,
mapStyleWidth: 0,
mapStyleHeight: 0,
pointInfo: [
{
x: 50,
y: 50,
name: '景点11',
},
{
x: 140,
y: 110,
name: '景点22',
},
{
x: 230,
y: 200,
name: '景点33',
}
]
mapCss: '',
pointDetail: './image/card/01.png',
winPointDetail: false,
pointInfo: iPoint
},
onLoad: function (options) {
this.setMapStyle()
this.initGuide()
},
initGuide: function () {
this.setMapCss()
},
setMapStyle: function () {
setMapCss: function () {
// 设置地图样式
// 数值以设计图上的像素为准
let funcMapStyle = {
'width': 3329,
'height': 1218
}
let funcWindowHeight = wx.getSystemInfoSync().windowHeight
let funcProportion = funcWindowHeight / this.data.mapHeight
// let funcUnitProportion = wx.getStorageSync('unitProportion')
let funcProportion = funcWindowHeight / funcMapStyle['height']
funcMapStyle['width'] = Math.floor(funcMapStyle['width'] * funcProportion)
funcMapStyle['height'] = funcWindowHeight
let funcMapCss = {
'width': funcMapStyle['width'] + 'px;',
'height': funcMapStyle['height'] + 'px;',
}
this.setData({
mapCss: JSON.stringify(funcMapCss).replace(/[{",}]/g, ''),
})
this.setPointCss(funcProportion)
},
setPointCss: function (funcProportion) {
// 设置景点按钮样式
// 数值以设计图上的像素为准
let funcPointStyle = {
'width': 140,
'height': 52,
'padding-right': 22,
'borderRadius': 26,
'font-size': 20,
}
funcPointStyle['width'] = Math.floor(funcPointStyle['width'] * funcProportion)
funcPointStyle['height'] = Math.floor(funcPointStyle['height'] * funcProportion)
funcPointStyle['padding-right'] = Math.floor(funcPointStyle['padding-right'] * funcProportion)
funcPointStyle['borderRadius'] = funcPointStyle['height'] / 2
funcPointStyle['font-size'] = Math.floor(funcPointStyle['font-size'] * funcProportion)
let funcPointCss = {
'min-width': funcPointStyle['width'] + 'px;',
'height': funcPointStyle['height'] + 'px;',
'padding-right': funcPointStyle['padding-right'] + 'px;',
'border-radius': funcPointStyle['borderRadius'] + 'px;',
'font-size': funcPointStyle['font-size'] + 'px;',
}
// 设置景点按钮图标样式
// 数值以设计图上的像素为准
let funcIconStyle = {
'width': 52,
'height': 52,
'margin-right': 12
}
funcIconStyle['width'] = Math.floor(funcIconStyle['width'] * funcProportion)
funcIconStyle['height'] = Math.floor(funcIconStyle['height'] * funcProportion)
funcIconStyle['margin-right'] = Math.floor(funcIconStyle['margin-right'] * funcProportion)
let funcIconCss = {
'width': funcIconStyle['width'] + 'px;',
'height': funcIconStyle['height'] + 'px;',
'margin-right': funcIconStyle['margin-right'] + 'px;',
'border-radius': '50%',
}
// 景点按钮位置
let funcPointInfo = this.data.pointInfo
for (let i = 0, l = funcPointInfo.length; i < l; i++) {
funcPointInfo[i].x = funcPointInfo[i].x * funcProportion
funcPointInfo[i].y = funcPointInfo[i].y * funcProportion
funcPointInfo[i].x = Math.floor(funcPointInfo[i].x * funcProportion)
funcPointInfo[i].y = Math.floor(funcPointInfo[i].y * funcProportion)
funcPointInfo[i].css = 'top:' + funcPointInfo[i].y + 'px;left:' + funcPointInfo[i].x + 'px;' + JSON.stringify(funcPointCss).replace(/[{",}]/g, '')
}
this.setData({
mapStyleWidth: this.data.mapWidth * funcProportion,
mapStyleHeight: funcWindowHeight,
pointInfo: funcPointInfo
pointInfo: funcPointInfo,
pointIconCss: JSON.stringify(funcIconCss).replace(/[{",}]/g, '')
})
console.log(funcPointInfo)
},
onPointInfo: function (event) {
console.log(event)
let funcIndex = event.currentTarget.dataset.index
let funcPointInfo = this.data.pointInfo
for (let i = 0, l = funcPointInfo.length; i < l; i++) {
if (i !== funcIndex) {
funcPointInfo[i].isActive = false
} else {
funcPointInfo[i].isActive = !funcPointInfo[i].isActive
}
}
if (funcPointInfo[funcIndex].isActive) {
this.setData({
pointInfo: funcPointInfo,
pointDetail: funcPointInfo[funcIndex].card,
winPointDetail: true
})
} else {
this.setData({
pointInfo: funcPointInfo,
pointDetail: funcPointInfo[funcIndex].card,
winPointDetail: false
})
}
}
})
\ No newline at end of file
<view class="guide">
<image src="./image/guide.jpg" style="{{'width: ' + mapStyleWidth + 'px;height: ' + mapStyleHeight + 'px;'}}"></image>
<view>
<image src="http://sm-web.meiqicloud.com/userfiles/appResources/guide/guide.png" style="{{mapCss}}"></image>
<view class="point-map" style="{{mapCss}}">
<block wx:for="{{pointInfo}}" wx:for-index="index" wx:for-item="item" wx:key="index">
<view class="point-info" style="{{'top: ' + item.y + 'px;left: ' + item.x + 'px;'}}">
<button bind:tap="onPointInfo" data-item="{{item}}">{{item.name}}</button>
<view class="point-info row align-c {{item.isActive ? 'button-active' : 'button-inactive'}}" style="{{item.css}}">
<!-- 默认样式 -->
<image class="point-info-arrow" src="./image/icon/point-arrow-inactive.png" hidden="{{item.isActive}}"></image>
<image class="icon-inactive" src="{{item.icon}}" style="{{pointIconCss}}" hidden="{{item.isActive}}"></image>
<button class="button-inactive" bind:tap="onPointInfo" data-index="{{index}}" hidden="{{item.isActive}}">{{item.name}}</button>
<!-- 选择样式 -->
<image class="point-info-arrow" src="./image/icon/point-arrow-active.png" hidden="{{!item.isActive}}"></image>
<image class="icon-active" src="{{item.icon}}" style="{{pointIconCss}}" hidden="{{!item.isActive}}"></image>
<button class="button-active" bind:tap="onPointInfo" data-index="{{index}}" hidden="{{!item.isActive}}">{{item.name}}</button>
</view>
</block>
</view>
</view>
<view class="point-detail">
<view class="point-detail" hidden="{{!winPointDetail}}">
<image src="{{pointDetail}}"></image>
</view>
\ No newline at end of file
/* 景点地图 */
.guide {
position: relative;
height: 100%;
......@@ -5,16 +6,69 @@
overflow-x: scroll;
}
/* .point {
position: fixed;
bottom: 0;
width: 750rpx;
height: 200rpx;
background: #ffffff;
} */
.guide > image {
display: block;
}
/* 景点按钮 */
.point-map {
position: absolute;
top: 0;
left: 0;
}
.point-info {
position: absolute;
width: 100rpx;
height: 40rpx;
}
.point-info-arrow {
position: absolute;
left: 10px;
bottom: -6px;
width: 10px;
height: 8px;
}
.icon-active {
border: 2px #133f54 solid;
border-radius: 50%;
box-shadow: 0px 1px 2px 0px rgba(17,62,86,0.24);
}
.button-active {
background: #2a6381;
color: #FFFFFF;
}
.icon-inactive {
border: 2px #FFFFFF solid;
border-radius: 50%;
box-shadow: 0px 1px 2px 0px rgba(50,128,182,0.24);
}
.button-inactive {
background: #FFFFFF;
color: #000000;
}
.point-info button {
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
font-size: 10px;
}
/* 景点详情卡片 */
.point-detail {
position: fixed;
bottom: 40rpx;
}
.point-detail image {
width: 750rpx;
height: 230rpx;
}
\ No newline at end of file
let output = [
{
x: 174,
y: 220,
name: '温泉洋房子(建设中)',
icon: './image/icon/01.png',
card: './image/card/01.png',
isActive: false,
}, {
x: 830,
y: 220,
name: '海错图2号馆',
icon: './image/icon/02.png',
card: './image/card/02.png',
isActive: false,
}, {
x: 1060,
y: 220,
name: '海错图1号馆',
icon: './image/icon/03.png',
card: './image/card/03.png',
isActive: false,
}, {
x: 1300,
y: 220,
name: '原味舒食',
icon: './image/icon/04.png',
card: './image/card/04.png',
isActive: false,
}, {
x: 680,
y: 276,
name: '星空影院',
icon: './image/icon/05.png',
card: './image/card/05.png',
isActive: false,
}, {
x: 1120,
y: 276,
name: '元养水韵SPA',
icon: './image/icon/06.png',
card: './image/card/06.png',
isActive: false,
}, {
x: 1384,
y: 276,
name: '原野MOJITO',
icon: './image/icon/07.png',
card: './image/card/07.png',
isActive: false,
}, {
x: 1704,
y: 294,
name: '拾光花坊',
icon: './image/icon/08.png',
card: './image/card/08.png',
isActive: false,
}, {
x: 1016,
y: 386,
name: '星光广场',
icon: './image/icon/09.png',
card: './image/card/09.png',
isActive: false,
}, {
x: 1002,
y: 454,
name: '云之亭',
icon: './image/icon/10.png',
card: './image/card/10.png',
isActive: false,
}, {
x: 1390,
y: 520,
name: '湿地公园',
icon: './image/icon/11.png',
card: './image/card/11.png',
isActive: false,
}, {
x: 1782,
y: 540,
name: '新月码头',
icon: './image/icon/12.png',
card: './image/card/12.png',
isActive: false,
}, {
x: 2836,
y: 592,
name: '儿童营地',
icon: './image/icon/13.png',
card: './image/card/13.png',
isActive: false,
}, {
x: 2112,
y: 680,
name: '星耀银湖',
icon: './image/icon/14.png',
card: './image/card/14.png',
isActive: false,
}, {
x: 1610,
y: 724,
name: '奇幻森林',
icon: './image/icon/15.png',
card: './image/card/15.png',
isActive: false,
},
]
export default output
\ No newline at end of file
......@@ -146,6 +146,13 @@ Page({
})
},
onGuide: function () {
console.log('onGuide')
wx.navigateTo({
url: '/pages/guide/guide'
})
},
onNotice: function (event) {
wx.navigateTo({
url: '/pages/notice/notice'
......
......@@ -64,7 +64,7 @@
<image class="background-image" src="./image/guide.png" mode="aspectFit"></image>
<view class="operation col">
<text>探索精彩去处</text>
<button class="row con-c align-c">进入电子地图</button>
<button class="row con-c align-c" bind:tap="onGuide">进入电子地图</button>
</view>
</view>
</view>
......
......@@ -191,7 +191,6 @@
}
.guide-content .operation button {
z-index: -1;
width: 220rpx;
height: 68rpx;
margin-top: 36rpx;
......
......@@ -84,12 +84,14 @@ Page({
'https://image-1256588539.cos.ap-shanghai.myqcloud.com/miniapp/play/item/detail-1-1.png'
],
shop: [{
id: '1',
id: 1,
name: '海错图展馆',
cover: 'https://image-1256588539.cos.ap-shanghai.myqcloud.com/miniapp/play/item/detail-1-2.png',
x: 108,
y: 212,
}, {
id: '1',
id: 2,
name: '拾光花坊',
cover: 'https://image-1256588539.cos.ap-shanghai.myqcloud.com/miniapp/play/item/detail-1-3.png',
x: 108,
y: 264,
......@@ -99,7 +101,8 @@ Page({
'https://image-1256588539.cos.ap-shanghai.myqcloud.com/miniapp/play/item/detail-2-1.png'
],
shop: [{
id: '1',
id: 3,
name: '水元养韵SPA',
cover: 'https://image-1256588539.cos.ap-shanghai.myqcloud.com/miniapp/play/item/detail-2-2.png',
x: 108,
y: 212,
......@@ -109,12 +112,14 @@ Page({
'https://image-1256588539.cos.ap-shanghai.myqcloud.com/miniapp/play/item/detail-3-1.png'
],
shop: [{
id: '1',
id: 4,
name: '原味舒食',
cover: 'https://image-1256588539.cos.ap-shanghai.myqcloud.com/miniapp/play/item/detail-3-2.png',
x: 108,
y: 212,
}, {
id: '1',
id: 5,
name: '原野MOJITO',
cover: 'https://image-1256588539.cos.ap-shanghai.myqcloud.com/miniapp/play/item/detail-3-3.png',
x: 108,
y: 212,
......@@ -124,7 +129,8 @@ Page({
'https://image-1256588539.cos.ap-shanghai.myqcloud.com/miniapp/play/item/detail-4-1.png'
],
shop: [{
id: '1',
id: 6,
name: '星空影院',
cover: 'https://image-1256588539.cos.ap-shanghai.myqcloud.com/miniapp/play/item/detail-4-2.png',
x: 108,
y: 212,
......@@ -216,9 +222,8 @@ Page({
},
onShopDetail: function (funcItem) {
console.log(funcItem)
wx.navigateTo({
url: '/pages/shop-detail/shop-detail'
url: '/pages/shop-detail/shop-detail?id=' + funcItem.currentTarget.dataset.id
})
},
......
let App = getApp()
Page({
data: {
// banner 列表数据
......@@ -6,10 +8,12 @@ Page({
bannerHeight: 300,
info: {},
isBlack: false,
},
onLoad: function (options) {
this.queryDetail()
console.log(options)
this.queryDetail(Number(options.id))
},
/**
......@@ -18,29 +22,131 @@ Page({
* @param {string} - funcToken
* @returns
*/
queryDetail: function () {
let response = {
banner: [
'https://image-1256588539.cos.ap-shanghai.myqcloud.com/miniapp/shop/banner-1.png',
'https://image-1256588539.cos.ap-shanghai.myqcloud.com/miniapp/shop/banner-2.png',
'https://image-1256588539.cos.ap-shanghai.myqcloud.com/miniapp/shop/banner-3.png',
],
name: '元养水韵',
title: '元养水韵SPA馆',
date: '周一至周日 10:00 - 22:00',
describe: '元养水韵SPA馆,是个女性私享的空间。遵循定制化服务理念,每一位芳疗师会根据你的需要针对性地提供面部、头部、身体的SPA服务,柔软中带有力度能最大化地释放你的疲惫。其中,以泰国皇室经典SPA、面部养颜护理摩纳哥-蒙特卡洛足浴、能量中泰式理疗SPA等服务最为出色。每一位芳疗师都采用最正宗的泰国王室御用手法,足不出国就能体现最正宗的SPA体验。',
contact: '13316748039'
}
queryDetail: function (funcIndex) {
funcIndex = funcIndex - 1
console.log('queryDetail' + funcIndex)
// 预设数据
let funcDetail = [
{
id: 1,
banner: [
App.globalData.appResourcesBase + 'shop/banner/banner-1-1-1.png',
App.globalData.appResourcesBase + 'shop/banner/banner-1-1-2.png',
App.globalData.appResourcesBase + 'shop/banner/banner-1-1-3.png',
],
name: '海错图展馆',
title: '海错图',
date: '周一至周日 10:00 - 20:00',
describe: [
App.globalData.appResourcesBase + 'shop/detail/detail-1-1-1.png',
App.globalData.appResourcesBase + 'shop/detail/detail-1-1-2.png',
App.globalData.appResourcesBase + 'shop/detail/detail-1-1-3.png',
App.globalData.appResourcesBase + 'shop/detail/detail-1-1-4.png',
App.globalData.appResourcesBase + 'shop/detail/detail-1-1-5.png',
],
contact: '13316748039'
}, {
id: 2,
banner: [
App.globalData.appResourcesBase + 'shop/banner/banner-1-2-1.png',
App.globalData.appResourcesBase + 'shop/banner/banner-1-2-2.png',
App.globalData.appResourcesBase + 'shop/banner/banner-1-2-3.png',
],
name: '拾光花坊',
title: '拾光花坊',
date: '周一至周日 10:00 - 20:00',
describe: [
App.globalData.appResourcesBase + 'shop/detail/detail-1-2-1.png',
],
contact: '13316748039'
}, {
id: 3,
banner: [
App.globalData.appResourcesBase + 'shop/banner/banner-2-1-1.png',
App.globalData.appResourcesBase + 'shop/banner/banner-2-1-2.png',
App.globalData.appResourcesBase + 'shop/banner/banner-2-1-3.png',
],
name: '元养水韵',
title: '元养水韵SPA馆',
date: '周一至周日 10:00 - 22:00',
describe: [
App.globalData.appResourcesBase + 'shop/detail/detail-2-1-1.png',
App.globalData.appResourcesBase + 'shop/detail/detail-2-1-2.png',
App.globalData.appResourcesBase + 'shop/detail/detail-2-1-3.png',
App.globalData.appResourcesBase + 'shop/detail/detail-2-1-4.png',
],
contact: '13316748039'
}, {
id: 4,
banner: [
App.globalData.appResourcesBase + 'shop/banner/banner-3-1-1.png',
App.globalData.appResourcesBase + 'shop/banner/banner-3-1-2.png',
App.globalData.appResourcesBase + 'shop/banner/banner-3-1-3.png',
],
name: '原味舒食',
title: '原味舒食',
date: '周一至周日 10:00 - 21:30',
describe: [
App.globalData.appResourcesBase + 'shop/detail/detail-3-1-1.png',
App.globalData.appResourcesBase + 'shop/detail/detail-3-1-2.png',
App.globalData.appResourcesBase + 'shop/detail/detail-3-1-3.png',
App.globalData.appResourcesBase + 'shop/detail/detail-3-1-4.png',
App.globalData.appResourcesBase + 'shop/detail/detail-3-1-5.png',
App.globalData.appResourcesBase + 'shop/detail/detail-3-1-6.png',
App.globalData.appResourcesBase + 'shop/detail/detail-3-1-7.png',
],
contact: '13316748039'
}, {
id: 5,
banner: [
App.globalData.appResourcesBase + 'shop/banner/banner-3-2-1.png',
App.globalData.appResourcesBase + 'shop/banner/banner-3-2-2.png',
App.globalData.appResourcesBase + 'shop/banner/banner-3-2-3.png',
],
name: '原野MOJITO',
title: '原味舒食',
date: '周一至周日 10:00 - 凌晨02:00',
describe: [
App.globalData.appResourcesBase + 'shop/detail/detail-3-2-1.png',
],
contact: '13316748039'
}, {
id: 6,
banner: [
App.globalData.appResourcesBase + 'shop/banner/banner-4-1-1.png',
App.globalData.appResourcesBase + 'shop/banner/banner-4-1-2.png',
App.globalData.appResourcesBase + 'shop/banner/banner-4-1-3.png',
],
name: '星空影院',
title: '星空影院',
date: '周一至周日 10:00 - 20:30',
describe: [
App.globalData.appResourcesBase + 'shop/detail/detail-4-1-1.png',
App.globalData.appResourcesBase + 'shop/detail/detail-4-1-2.png',
App.globalData.appResourcesBase + 'shop/detail/detail-4-1-3.png',
App.globalData.appResourcesBase + 'shop/detail/detail-4-1-4.png',
],
contact: '13316748039'
}
]
this.setData({
banner: response.banner,
banner: funcDetail[funcIndex].banner,
info: {
name: response.name,
title: response.title,
date: response.date,
describe: response.describe,
contact: response.contact,
id: funcDetail[funcIndex].id,
name: funcDetail[funcIndex].name,
title: funcDetail[funcIndex].title,
date: funcDetail[funcIndex].date,
describe: funcDetail[funcIndex].describe,
contact: funcDetail[funcIndex].contact,
}
})
if (this.data.info.id === 6) {
this.setData({
isBlack: true
})
}
},
onContact: function () {
......
......@@ -14,11 +14,13 @@
<swiper-point bannerStyle="{{1}}" bannerActiveIndex="{{bannerIndex}}"></swiper-point>
</view>
<view class="banner-wave">
<image src="/image/ornament-2.png" mode="widthFix"></image>
<image wx:if="{{!isBlack}}" src="/image/ornament-2.png" mode="widthFix"></image>
<image wx:if="{{isBlack}}" src="/image/ornament-2-black.png" mode="widthFix"></image>
</view>
</view>
<view class="detail">
<!-- 明亮样式 -->
<view wx:if="{{!isBlack}}" class="detail">
<view class="detail-title row">
<text>{{info.title}}</text>
</view>
......@@ -29,7 +31,27 @@
</view>
</view>
<view class="detail-describe">
<text>{{info.describe}}</text>
<block wx:for="{{info.describe}}" wx:for-index="index" wx:for-item="item" wx:key="index">
<image src="{{item}}" mode="widthFix"></image>
</block>
</view>
</view>
<!-- 黑暗样式 -->
<view wx:if="{{isBlack}}" class="detail detail-black">
<view class="detail-title title-black row">
<text>{{info.title}}</text>
</view>
<view class="detail-other other-black col">
<view class="row align-c">
<text>开放时间</text>
<text>{{info.date}}</text>
</view>
</view>
<view class="detail-describe">
<block wx:for="{{info.describe}}" wx:for-index="index" wx:for-item="item" wx:key="index">
<image src="{{item}}" mode="widthFix"></image>
</block>
</view>
</view>
......
......@@ -59,6 +59,10 @@
padding-bottom: 200rpx;
}
.detail-black {
background: #1C1C25;
}
.detail-title {
width: 670rpx;
min-height: 76rpx;
......@@ -69,6 +73,10 @@
line-height: 76rpx;
}
.title-black {
color: #FFFFFF;
}
.detail-other {
margin-top: 32rpx;
padding: 0 40rpx 48rpx 40rpx;
......@@ -96,15 +104,23 @@
line-height: 42rpx;
}
.other-black view text:nth-child(2) {
color: #FFFFFF;
}
.detail-describe {
width: 670rpx;
min-height: 200rpx;
margin: 0 auto;
padding-top: 48rpx;
border-top: 1rpx #E2E7EF solid;
font-size: 30rpx;
color: #15191F;
line-height: 50rpx;
position: relative;
width: 750rpx;
}
.detail-describe image {
display: block;
width: 750rpx;
}
.black {
color: #FFFFFF !important;
background: #1C1C25;
}
/* 立即报名 */
......
......@@ -24,9 +24,6 @@
</view>
<view class="detail">
<!-- <block wx:for="{{detailImageUrl}}" wx:for-index="index" wx:for-item="item" wx:key="index">
<image mode="widthFix" src="{{item}}"></image>
</block> -->
<parser html="{{content}}"/>
<view class="relation" wx:if="{{relation.length>0}}">
......@@ -45,7 +42,6 @@
<image src="/image/more.png"></image>
</view>
</view>
</block>
</view>
</view>
......
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 sign in to comment