Commit 7e77ef9b by 严立

LL - 导航地图调整

parent dfb4d546
......@@ -31,7 +31,7 @@ App({
onLaunch: function () {
this.setUnitProportion()
// this.login()
this.login()
},
setUnitProportion: function () {
......@@ -71,11 +71,7 @@ App({
obj.success(res.data)
}
} else if (402 == code) {
this.refreshToken({
success: () => {
this.wxRequest(obj)
}
})
this.refreshToken(obj)
} else if (500 === code) {
if (obj.success) {
obj.success(res)
......@@ -163,7 +159,7 @@ App({
wx.setStorageSync('userInfo', funcUserInfo)
if (obj.success) {
if (obj && obj.success) {
obj.success(funcResponse.token)
}
},
......@@ -243,16 +239,6 @@ App({
},
/**
* 令牌有效性判断
* @function
* @param
* @returns
*/
tokenInspect: function () {
let funcToken = wx.getStorageSync()
},
/**
* 刷新令牌
* @function
* @param
......@@ -265,20 +251,31 @@ App({
token: this.globalData.token,
refreshToken: this.globalData.refreshToken
},
success: (res) => {
// { "msg": "登录失效", "code": 402, "success": true }
let token = res.data.token
let refreshToken = res.data.refreshToken
success: (response) => {
let funcResponse = response.data
this.globalData.token = token
this.globalData.refreshToken = refreshToken
switch (Number(funcResponse.code)) {
case 200:
this.globalData.token = funcResponse.token
this.globalData.refreshToken = funcResponse.refreshToken
wx.setStorageSync('token', funcResponse.token)
wx.setStorageSync('tokenRefresh', funcResponse.refreshToken)
if (obj.success) {
obj.success()
this.wxRequest(obj)
break
case 402:
this.globalData.token = ''
this.globalData.refreshToken = ''
// 记录原始请求参数
let funcCallBackFunction = {
success: () => {
this.wxRequest(obj)
}
}
this.login(funcCallBackFunction)
break
}
}
})
......
{
"pages": [
"pages/home/home/home",
"pages/home/dynamic/dynamic",
"pages/home/dynamic-detail/dynamic-detail",
......
......@@ -18,6 +18,9 @@ Page({
}, {
'appId': 3,
'commodityType': 1,
}, {
'appId': 3,
'commodityType': 3,
}
],
shopCommodityData: [],
......
......@@ -153,7 +153,7 @@
<view class="shop-item">
<view class="shop-name row align-c">
<image src="{{resourcesBase + 'shop/logo-3.png'}}" style="width: 64rpx; height: 50rpx;"></image>
<text>元养水韵SPA</text>
<text>儿童营地</text>
</view>
<view class="commodity-list">
<block wx:for="{{shopCommodityData[2]}}" wx:for-index="index" wx:for-item="item" wx:key="index">
......@@ -212,6 +212,63 @@
</view>
</view>
</block>
<block wx:for="{{shopCommodityData[4]}}" wx:for-index="index" wx:for-item="item" wx:key="index">
<view class="commodity-item row">
<view class="commodity-cover">
<image src="{{item.cover}}"></image>
</view>
<view class="commodity-describe">
<text>{{item.name}}</text>
<text>{{item.describe}}</text>
</view>
<view class="commodity-price">
<!-- 活动价样式 -->
<block wx:if="{{item.priceType === 1}}">
<view>
<text class="commodity-price-symbol">¥</text>
<text class="commodity-price-value">{{item.priceDiscountText}}</text>
<text class="commodity-price-special">业主价</text>
</view>
<view class="commodity-price-through row con-e align-c">
<text>¥</text>
<text>{{item.priceText}}</text>
</view>
</block>
<!-- 业主价样式 -->
<block wx:if="{{item.priceType === 2}}">
<view>
<text class="commodity-price-symbol">¥</text>
<text class="commodity-price-value">{{item.priceSpecialText}}</text>
<text class="commodity-price-special">业主价</text>
</view>
<view class="commodity-price-through row con-e align-c">
<text>¥</text>
<text>{{item.priceText}}</text>
</view>
</block>
<!-- 普通价样式 -->
<block wx:if="{{item.priceType === 3}}">
<view>
<text class="commodity-price-symbol">¥</text>
<text class="commodity-price-value">{{item.priceText}}</text>
<text></text>
</view>
<view class="commodity-price-through row con-e align-c">
<text></text>
<text></text>
</view>
</block>
<view class="commodity-price-operation row con-e align-c">
<button class="row con-c align-c" data-index="{{3}}" data-itemindex="{{index}}" bindtap="onBuy">购买门票</button>
</view>
</view>
</view>
</block>
</view>
</view>
</view>
......
......@@ -5,9 +5,6 @@ Page({
imageBase: App.globalData.appImageBase,
resourcesBase: App.globalData.appResourcesBase,
navigationTitle: '123213231',
formType: 1,
appointmentDate: '',
appointmentEndDate: '',
appointmentComplete: false,
......@@ -22,19 +19,12 @@ Page({
errorQuantity: '',
canSubmit: false,
winQuota: false,
// 预约入园剩余名额
total: 0,
},
onLoad: function (options) {
this.setData({
formType: Number(options.type),
navigationTitle: Number(options.type) === 1 ? '夜间入园预约' : '看房预约'
})
console.log(options.type)
this.setReset()
},
......@@ -44,14 +34,11 @@ Page({
this.setData({
formName: '',
formPhone: '',
formQuantity: this.data.formType === 1 ? 0 : 1,
formQuantity: 1,
formDate: funcDate,
appointmentDate: funcDate,
appointmentEndDate: endDate,
})
if (this.data.formType === 1) { // 入园预约
this.getResidue()
}
},
onServic: function () {
......@@ -117,35 +104,10 @@ Page({
this.updateSubmitButtonStatus()
},
onQuantityAdd: function () {
if (this.data.total * 1 == 0) {
this.setData({
errorQuantity: '所选日期预约名额已满'
})
} else if (this.data.formQuantity >= this.data.total * 1) {
this.setData({
errorQuantity: '所选日期预约的名额仅剩' + activityTime.residue + '人'
})
} else if (this.data.formQuantity >= 5) {
this.setData({
errorQuantity: '每个账号最多预约5人'
})
} else {
this.setData({
formQuantity: this.data.formQuantity + 1,
errorQuantity: '',
})
}
this.updateSubmitButtonStatus()
},
onSelectionDate: function (event) {
this.setData({
formDate: event.detail.value,
})
if (this.data.formType === 1) { // 入园预约
this.getResidue()
}
},
inspectForm: function () {
......@@ -231,6 +193,7 @@ Page({
mask: true,
duration: 1000 * 60,
})
App.wxRequest({
url: '/api/v1/subscribe/doSubscribe',
data: {
......@@ -238,7 +201,7 @@ Page({
subscribeNum: this.data.formQuantity,
subscribeDate: this.data.formDate + ' 00:00:00',
name: this.data.formName,
type: this.data.formType === 1 ? 0 : 1,
type: 1,
},
success: (res) => {
this.setData({
......@@ -264,31 +227,6 @@ Page({
})
},
// 预约入园查询返回剩余名额
getResidue() {
App.login({
success: function () {
App.wxRequest({
url: '/api/v1/subscribe/getResidue',
data: {
subscribeDate: this.data.formDate + ' 00:00:00',
type: 0,
},
success: (res) => {
this.setData({
total: res.data.total,
winQuota: true,
formQuantity: 0,
})
this.updateSubmitButtonStatus()
}
})
}
})
},
getNextDay(d, t) {
console.log(d, t)//格式为---2019-02-13 3
d = new Date(d);
......
<l-toast l-image-class="toast-image"></l-toast>
<!-- 首页 - 入园预约 / 房屋预约 -->
<navigation class="navigation" titleText="{{navigationTitle}}" color="#FFFFFF" backIcon="{{'../../image/icon/arrow-l-2.png'}}"></navigation>
<navigation class="navigation" titleText="看房预约" color="#FFFFFF" backIcon="{{'../../image/icon/arrow-l-2.png'}}"></navigation>
<view class="appointment-complete row con-c align-c" wx:if="{{appointmentComplete}}">
<view class="appointment-complete-tip">
<image wx:if="{{formType === 1}}" src="./image/tip-1.png"></image>
<image wx:if="{{formType === 2}}" src="./image/tip-2.png"></image>
<image src="./image/tip-2.png"></image>
<l-button l-class="button" plain="{{true}}" bind:lintap="onAppointmentComplete">我知道了</l-button>
</view>
</view>
<!-- 入园预约 -->
<view wx:if="{{formType === 1}}" class="container">
<view class="appointment-tip">
<image class="background-image" src="./image/banner-1.png"></image>
<image class="ornament-wave" src="/image/ornament-2.png" mode="widthFix"></image>
</view>
<view class="form-title row con-s align-c">
<text>填写预约信息</text>
</view>
<view class="form">
<!-- 名字输入 -->
<view class="row align-c">
<view class="input-label row con-b align-c">
<text>姓</text>
<text>名</text>
</view>
<view class="input-wrap row align-c">
<input maxlength="16" class="text" placeholder-class="input-tip" placeholder="请输入名字" data-type="name" bindblur="onInputBlur"></input>
</view>
</view>
<view class="form-error row align-c">
<text hidden="{{errorName ? false : true}}">{{errorName}}</text>
</view>
<!-- 手机输入 -->
<view class="row align-c">
<view class="input-label row con-b align-c">
<text>手</text>
<text>机</text>
<text>号</text>
</view>
<view class="input-wrap row align-c">
<input maxlength="11" type="number" class="text" placeholder-class="input-tip" placeholder="请输入手机号" data-type="phone" bindblur="onInputBlur"></input>
</view>
</view>
<view class="form-error row align-c">
<text hidden="{{errorPhone ? false : true}}">{{errorPhone}}</text>
</view>
<!-- 预约人数 -->
<view class="row align-c">
<view class="input-label row con-b align-c">
<text>预</text>
<text>约</text>
<text>人</text>
<text>数</text>
</view>
<view class="input-wrap row con-b align-c" style="padding: 0">
<l-button special="{{true}}" bind:lintap="onQuantityCut">
<image class="input-icon" src="{{imageBase + 'icon/cut-1.png'}}"></image>
</l-button>
<text class="text" style="{{formQuantity === 0 ? 'color: #C2C7CF' : 'color: #15191F'}}">{{formQuantity}}</text>
<l-button special="{{true}}" bind:lintap="onQuantityAdd">
<image class="input-icon" src="{{imageBase + 'icon/add-1.png'}}"></image>
</l-button>
</view>
</view>
<view class="form-error row align-c">
<text hidden="{{errorQuantity ? false : true}}">{{errorQuantity}}</text>
</view>
<!-- 预约日期 -->
<view class="row align-c">
<view class="input-label row con-b align-c">
<text>预</text>
<text>约</text>
<text>日</text>
<text>期</text>
</view>
<view class="input-wrap row con-b align-c" style="padding: 0 0 0 24rpx">
<picker class="input-picker" mode="date" value="{{date}}" start="{{appointmentDate}}" end="{{appointmentEndDate}}" bindchange="onSelectionDate">
<view class="picker text" style="display: inline-block;width:400rpx">{{formDate}}</view>
<image class="input-icon" style="float: right;" src="{{imageBase + 'icon/arrow-r-1.png'}}"></image>
</picker>
</view>
</view>
<view class="quota row con-e align-c" hidden="{{!winQuota}}">
<text>剩余名额:</text>
<text>{{total}}人</text>
</view>
</view>
<view class="appointment-operation">
<button class="{{canSubmit ? 'button' : 'button-disable'}} row con-c align-c" bindtap="onSubmit">确认预约</button>
<button class="button-plain row con-c align-c" bindtap="onServic">电话咨询</button>
</view>
</view>
<!-- 看房预约 -->
<view wx:if="{{formType === 2}}" class="container">
<view class="container">
<view class="appointment-tip">
<image class="background-image" src="./image/banner-2.png"></image>
<image class="ornament-wave" src="/image/ornament-2.png" mode="widthFix"></image>
......
......@@ -188,14 +188,13 @@ Page({
},
onPointDetail: function () {
console.log('onPointDetail')
// 当从景点详情进入屏蔽该功能
if (logicData.option.id) return
let funcPointInfo = this.data.pointInfo
for (let i = 0, l = funcPointInfo.length; i < l; i++) {
if (funcPointInfo[i].isActive) {
console.log(funcPointInfo[i].detail)
console.log('point', funcPointInfo[i].detail)
wx.navigateTo({
url: funcPointInfo[i].detail
......
......@@ -29,47 +29,47 @@ let output = [
}, {
x: 1300,
y: 220,
id: 4,
id: 6,
name: '原味舒食',
icon: './image/icon/04.png',
card: 'guide/card/04.png',
detail: '/pages/play/service-detail/service-detail?id=4',
detail: '/pages/play/service-detail/service-detail?id=6',
isActive: false,
}, {
x: 666,
y: 280,
id: 6,
id: 2,
name: '星空影院',
icon: './image/icon/05.png',
card: 'guide/card/05.png',
detail: '/pages/play/service-detail/service-detail?id=6',
detail: '/pages/play/service-detail/service-detail?id=2',
isActive: false,
}, {
x: 1120,
y: 276,
id: 3,
id: 7,
name: '元养水韵SPA',
icon: './image/icon/06.png',
card: 'guide/card/06.png',
detail: '/pages/play/service-detail/service-detail?id=3',
detail: '/pages/play/service-detail/service-detail?id=7',
isActive: false,
}, {
x: 1370,
y: 284,
id: 5,
id: 4,
name: '原野MOJITO',
icon: './image/icon/07.png',
card: 'guide/card/07.png',
detail: '/pages/play/service-detail/service-detail?id=5',
detail: '/pages/play/service-detail/service-detail?id=4',
isActive: false,
}, {
x: 1708,
y: 306,
id: 2,
id: 5,
name: '拾光花坊',
icon: './image/icon/08.png',
card: 'guide/card/08.png',
detail: '/pages/play/service-detail/service-detail?id=2',
detail: '/pages/play/service-detail/service-detail?id=5',
isActive: false,
}, {
x: 1016,
......
......@@ -9,12 +9,11 @@ Page({
this.getBrands(index)
},
getBrands: function (index) {
let that = this
App.wxRequest({
url: '/api/v1/common/getBrands',
success: function(res) {
let history = res.data[index]
that.setData({
success: (response) => {
let history = response.data[index]
this.setData({
history
})
}
......
......@@ -322,6 +322,7 @@
margin-top: 88rpx;
}
.footer image {
display: block;
width: 750rpx;
height: 1148rpx;
margin-bottom: 40rpx;
......
......@@ -3,10 +3,8 @@ const App = getApp()
Page({
data: {
imageBase: App.globalData.appImageBase,
resourcesBase: App.globalData.appResourcesBase,
navigationTitle: '123213231',
formType: 1,
appointmentDate: '',
appointmentEndDate: '',
appointmentComplete: false,
......@@ -28,28 +26,29 @@ Page({
},
onLoad: function (options) {
this.setData({
formType: Number(options.type),
navigationTitle: Number(options.type) === 1 ? '夜间入园预约' : '看房预约'
})
this.setReset()
},
setReset: function () {
let funcDate = App.modular.miment(new Date().getTime()).format('YYYY-MM-DD')
let funcDate = App.modular.miment().format('YYYY-MM-DD')
console.log(funcDate)
let endDate = this.getNextDay(funcDate, 3)
console.log('endDate', endDate)
this.setData({
formName: '',
formPhone: '',
formQuantity: this.data.formType === 1 ? 0 : 1,
formQuantity: 0,
formDate: funcDate,
appointmentDate: funcDate,
appointmentEndDate: endDate,
})
if (this.data.formType === 1) { // 入园预约
this.getResidue()
}
console.log(this.data.formDate)
console.log(this.data.appointmentDate)
console.log(this.data.appointmentEndDate)
this.queryQuota()
},
onServic: function () {
......@@ -138,12 +137,13 @@ Page({
},
onSelectionDate: function (event) {
console.log(event.detail.value)
this.setData({
formDate: event.detail.value,
})
if (this.data.formType === 1) { // 入园预约
this.getResidue()
}
this.queryQuota()
},
inspectForm: function () {
......@@ -218,49 +218,39 @@ Page({
},
onSubmit: function () {
var that = this
App.login({
success: function () {
if (!that.inspectForm()) {
return
}
if (!this.inspectForm()) {
return
}
wx.lin.showToast({
icon: 'loading',
title: '提交中',
show: true,
mask: true,
duration: 1000 * 60,
wx.lin.showToast({
icon: 'loading',
title: '提交中',
show: true,
mask: true,
duration: 1000 * 60,
})
App.wxRequest({
url: '/api/v1/subscribe/doSubscribe',
data: {
mobile: this.data.formPhone,
subscribeNum: this.data.formQuantity,
subscribeDate: this.data.formDate + ' 00:00:00',
name: this.data.formName,
type: 0,
},
success: (res) => {
this.setData({
appointmentComplete: true,
})
App.wxRequest({
url: '/api/v1/subscribe/doSubscribe',
data: {
mobile: that.data.formPhone,
subscribeNum: that.data.formQuantity,
subscribeDate: that.data.formDate + ' 00:00:00',
name: that.data.formName,
type: that.data.formType === 1 ? 0 : 1,
},
success: function (res) {
that.setData({
appointmentComplete: true,
})
wx.lin.hideToast()
},
fail: function (err) {
wx.lin.showToast({
image: '/image/error.png',
title: err.msg,
})
}
wx.lin.hideToast()
},
fail: (err) => {
wx.lin.showToast({
image: '/image/error.png',
title: err.msg,
})
}
})
},
onAppointmentComplete: function () {
......@@ -273,30 +263,22 @@ Page({
},
// 预约入园查询返回剩余名额
getResidue() {
var that = this
App.login({
success: function () {
App.wxRequest({
url: '/api/v1/subscribe/getResidue',
data: {
subscribeDate: that.data.formDate + ' 00:00:00',
type: 0,
},
success: function (res) {
that.setData({
total: res.data.total,
winQuota: true,
formQuantity: 0,
})
that.updateSubmitButtonStatus()
}
queryQuota: function () {
App.wxRequest({
url: '/api/v1/subscribe/getResidue',
data: {
subscribeDate: this.data.formDate + ' 00:00:00',
type: 0,
},
success: (res) => {
this.setData({
total: res.data.total,
winQuota: true,
formQuantity: 0,
})
this.updateSubmitButtonStatus()
}
})
},
getNextDay(d, t) {
......
<l-toast l-image-class="toast-image"></l-toast>
<!-- 首页 - 入园预约 / 房屋预约 -->
<navigation class="navigation" titleText="{{navigationTitle}}" color="#FFFFFF" backIcon="/image/back-w.png"></navigation>
<navigation class="navigation" titleText="夜间入园预约" color="#FFFFFF" backIcon="{{'../../image/icon/arrow-l-2.png'}}"></navigation>
<view class="appointment-complete row con-c align-c" wx:if="{{appointmentComplete}}">
<view class="appointment-complete-tip">
<image wx:if="{{formType === 1}}" src="./image/tip-1.png"></image>
<image wx:if="{{formType === 2}}" src="./image/tip-2.png"></image>
<image src="./image/tip-1.png"></image>
<l-button l-class="button" plain="{{true}}" bind:lintap="onAppointmentComplete">我知道了</l-button>
</view>
</view>
<!-- 入园预约 -->
<view wx:if="{{formType === 1}}" class="container">
<view class="container">
<view class="appointment-tip">
<image class="background-image" src="./image/banner-1.png"></image>
<image class="ornament-wave" src="/image/ornament-2.png" mode="widthFix"></image>
......@@ -61,11 +60,11 @@
</view>
<view class="input-wrap row con-b align-c" style="padding: 0">
<l-button special="{{true}}" bind:lintap="onQuantityCut">
<image class="input-icon" src="{{imageBase + 'cut.png'}}"></image>
<image class="input-icon" src="{{imageBase + 'icon/cut-1.png'}}"></image>
</l-button>
<text class="text" style="{{formQuantity === 0 ? 'color: #C2C7CF' : 'color: #15191F'}}">{{formQuantity}}</text>
<l-button special="{{true}}" bind:lintap="onQuantityAdd">
<image class="input-icon" src="{{imageBase + 'add.png'}}"></image>
<image class="input-icon" src="{{imageBase + 'icon/add-1.png'}}"></image>
</l-button>
</view>
</view>
......@@ -84,7 +83,7 @@
<view class="input-wrap row con-b align-c" style="padding: 0 0 0 24rpx">
<picker class="input-picker" mode="date" value="{{date}}" start="{{appointmentDate}}" end="{{appointmentEndDate}}" bindchange="onSelectionDate">
<view class="picker text" style="display: inline-block;width:400rpx">{{formDate}}</view>
<image class="input-icon" style="float: right;" src="{{imageBase + 'more.png'}}"></image>
<image class="input-icon" style="float: right;" src="{{imageBase + 'icon/arrow-r-1.png'}}"></image>
</picker>
</view>
</view>
......@@ -98,67 +97,4 @@
<button class="{{canSubmit ? 'button' : 'button-disable'}} row con-c align-c" bindtap="onSubmit">确认预约</button>
<button class="button-plain row con-c align-c" bindtap="onServic">电话咨询</button>
</view>
</view>
<!-- 看房预约 -->
<view wx:if="{{formType === 2}}" class="container">
<view class="appointment-tip">
<image class="background-image" src="./image/banner-2.png"></image>
<image class="ornament-wave" src="/image/ornament-2.png" mode="widthFix"></image>
</view>
<view class="form-title row con-s align-c">
<text>填写预约信息</text>
</view>
<view class="form">
<!-- 名字输入 -->
<view class="row align-c">
<view class="input-label row con-b align-c">
<text>姓</text>
<text>名</text>
</view>
<view class="input-wrap row align-c">
<input maxlength="16" class="text" placeholder-class="input-tip" placeholder="请输入名字" data-type="name" bindblur="onInputBlur"></input>
</view>
</view>
<view class="form-error row align-c">
<text hidden="{{errorName ? false : true}}">{{errorName}}</text>
</view>
<!-- 手机输入 -->
<view class="row align-c">
<view class="input-label row con-b align-c">
<text>手</text>
<text>机</text>
<text>号</text>
</view>
<view class="input-wrap row align-c">
<input maxlength="11" type="number" class="text" placeholder-class="input-tip" placeholder="请输入手机号" data-type="phone" bindblur="onInputBlur"></input>
</view>
</view>
<view class="form-error row align-c">
<text hidden="{{errorPhone ? false : true}}">{{errorPhone}}</text>
</view>
<!-- 预约日期 -->
<view class="row align-c">
<view class="input-label row con-b align-c">
<text>看</text>
<text>房</text>
<text>日</text>
<text>期</text>
</view>
<view class="input-wrap row align-c" style="padding: 0 0 0 24rpx">
<picker class="input-picker" mode="date" value="{{date}}" start="{{appointmentDate}}" bindchange="onSelectionDate">
<view class="picker text" style="display: inline-block;width:400rpx">{{formDate}}</view>
<image class="input-icon" style="float: right;" src="{{imageBase + 'more.png'}}"></image>
</picker>
</view>
</view>
</view>
<view class="appointment-operation">
<button class="{{canSubmit ? 'button' : 'button-disable'}} row con-c align-c" bindtap="onSubmit">确认预约</button>
</view>
</view>
\ No newline at end of file
......@@ -2,87 +2,116 @@ const App = getApp()
Page({
data: {
birthdayEnd: App.modular.miment(new Date().getTime()).format('YYYY-MM-DD'),
mobile: '',
nickName: '',
avatarUrl: '',
genderArray: [
birthdayLimit: App.modular.miment().format('YYYY-MM-DD'),
sexList: [
{ id: 1, name: '男' },
{ id: 2, name: '女' },
],
genderIndex: 0,
birthday: '',
address: '',
sexActive: 0,
userInfo: {
name: '',
phone: '',
avatar: '',
address: '',
birthday: '',
sex: '',
userType: '',
status: '',
isSignIn: false,
}
},
onLoad: function (options) {
let funcUserInfo = wx.getStorageSync('userInfo')
funcUserInfo.phone = this.phoneEncryption(funcUserInfo.phone)
if (!funcUserInfo.birthday) funcUserInfo.birthday = birthdayLimit
let mobile = funcUserInfo.phone
let nickName = funcUserInfo.name
let avatarUrl = funcUserInfo.avatar
let sex = funcUserInfo.sex
let birthday = funcUserInfo.birthday
let address = birthday.address
this.setData({
mobile: this.toHide(mobile),
nickName: nickName,
avatarUrl: avatarUrl,
genderIndex: sex == 2 ? 1 : 0,
birthday: birthday ? birthday : this.data.birthdayEnd,
address: address,
userInfo: funcUserInfo
})
},
toHide: function (array) {
var mphone = array.substring(0, 3) + '****' + array.substring(7);
return mphone;
/**
* 加密号码
* @function
* @param {object} - funcEvent
* @returns
*/
phoneEncryption: function (funcPhone) {
return funcPhone = funcPhone.substring(0, 3) + '****' + funcPhone.substring(7)
},
/**
* 加密号码
* @function
* @param {object} - funcEvent
* @returns
*/
onInputBlur: function (event) {
let funcType = event.target.dataset.type
let funcValue = event.detail.value
let funcUserInfo = wx.getStorageSync('userInfo')
switch (funcType) {
case 'name':
this.setData({
nickName: funcValue
})
funcUserInfo.name = funcValue
break
case 'address':
this.setData({
address: funcValue
})
funcUserInfo.address = funcValue
break
}
this.setData({
userInfo: funcUserInfo
})
this.doUpdateInfo()
},
// 性别选择
onSelectionGender(e) {
/**
* 性别选择
* @function
* @param {object} - funcEvent
* @returns
*/
onSelectionGender(event) {
// console.log(event)
this.setData({
genderIndex: e.detail.value
sexActive: Number(event.detail.value)
})
let funcUserInfo = wx.getStorageSync('userInfo')
funcUserInfo.sex = this.data.sexList[this.data.sexActive].id
this.setData({
userInfo: funcUserInfo
})
this.doUpdateInfo()
},
// 生日选择
/**
* 生日选择
* @function
* @param {object} - funcEvent
* @returns
*/
onSelectionDate: function (event) {
let funcUserInfo = wx.getStorageSync('userInfo')
funcUserInfo.birthday = event.detail.value
this.setData({
birthday: event.detail.value,
userInfo: funcUserInfo
})
this.doUpdateInfo()
},
doUpdateInfo() {
let nickName = this.data.nickName
let sex = this.data.genderArray[this.data.genderIndex].id
let birthday = this.data.birthday
let address = this.data.address
if (nickName == '') {
/**
* 更新信息
* @function
* @param {object} - funcEvent
* @returns
*/
doUpdateInfo: function () {
if (this.data.userInfo.name == '') {
wx.lin.showToast({
image: '/image/error.png',
title: '请填写姓名',
......@@ -91,22 +120,20 @@ Page({
}
let param = {
sex: sex,
name: nickName,
address: address,
birthday: birthday,
sex: this.data.userInfo.sex,
name: this.data.userInfo.name,
address: this.data.userInfo.address,
birthday: this.data.userInfo.birthday,
}
console.log(param)
App.wxRequest({
url: '/api/v1/smUser/doUpdateInfo',
data: param,
success: function (res) {
wx.setStorageSync('nickName', nickName)
wx.setStorageSync('sex', sex)
wx.setStorageSync('birthday', birthday)
wx.setStorageSync('address', address)
let funcUserInfo = wx.getStorageSync('userInfo')
Object.assign(funcUserInfo, param)
wx.setStorageSync('userInfo', funcUserInfo)
}
})
}
})
\ No newline at end of file
<!--pages/myInfo/myInfo.wxml-->
<l-toast l-image-class="toast-image"></l-toast>
<navigation class="navigation" titleText="个人资料" backIcon="/image/back.png"></navigation>
......@@ -6,32 +5,32 @@
<view class="myInfo">
<l-list is-hover="{{false}}" l-content-class="menu-title" title="头像" is-link="{{false}}">
<view style="margin-bottom:30rpx;" slot="right-section">
<l-avatar size="100" src="{{avatarUrl}}" />
<l-avatar size="100" src="{{userInfo.avatar}}" />
</view>
</l-list>
<l-list is-hover="{{false}}" l-content-class="menu-title" title="姓名" is-link="{{false}}">
<view slot="right-section">
<input maxlength="10" style="text-align:right;" placeholder="请填写姓名" placeholder-class="phone" value="{{nickName}}" data-type="name" bindblur="onInputBlur" />
<input maxlength="10" style="text-align:right;" placeholder="请填写姓名" placeholder-class="phone" value="{{userInfo.name}}" data-type="name" bindblur="onInputBlur" />
</view>
</l-list>
<l-list is-hover="{{false}}" l-content-class="menu-title" title="性别" is-link="{{false}}">
<picker slot="right-section" class="input-picker" mode="selector" value="{{genderIndex}}" range-key="{{'name'}}" range="{{genderArray}}" bindchange="onSelectionGender">
<view class="picker">{{genderArray[genderIndex].name}}</view>
<picker slot="right-section" class="input-picker" mode="selector" value="{{sexActive}}" range-key="{{'name'}}" range="{{sexList}}" bindchange="onSelectionGender">
<view class="picker">{{sexList[sexActive].name}}</view>
</picker>
</l-list>
<l-list is-hover="{{false}}" l-content-class="menu-title" title="生日" is-link="{{false}}">
<picker slot="right-section" class="input-picker" mode="date" value="{{birthday}}" end="{{birthdayEnd}}" bindchange="onSelectionDate">
<view class="picker">{{birthday}}</view>
<picker slot="right-section" class="input-picker" mode="date" value="{{userInfo.birthday}}" end="{{birthdayLimit}}" bindchange="onSelectionDate">
<view class="picker">{{userInfo.birthday}}</view>
</picker>
</l-list>
<l-list is-hover="{{false}}" l-content-class="menu-title" title="地址" is-link="{{false}}">
<view slot="right-section">
<input maxlength="30" style="text-align:right;" placeholder="请填写地址" placeholder-class="phone" value="{{address}}" data-type="address" bindblur="onInputBlur" />
<input maxlength="30" style="text-align:right;" placeholder="请填写地址" placeholder-class="phone" value="{{userInfo.address}}" data-type="address" bindblur="onInputBlur" />
</view>
</l-list>
<l-list is-hover="{{false}}" l-content-class="menu-title" title="手机号" is-link="{{false}}">
<view slot="right-section">
<view class="phone">{{mobile}}</view>
<view class="phone">{{userInfo.phone}}</view>
</view>
</l-list>
</view>
......
......@@ -17,8 +17,7 @@ Page({
this.setData({
bannerHeight: wx.getSystemInfoSync().windowHeight
})
// this.queryDetail(Number(options.id))
this.queryDetail(1)
this.queryDetail(Number(options.id))
},
/**
......
......@@ -72,7 +72,7 @@ Page({
this.setData({
option: options
})
console.log(this.data.option)
this.queryDetail(Number(options.id))
if (Number(options.id) === 2) {
this.queryDetailMovie()
......@@ -216,7 +216,7 @@ Page({
],
shareImage: App.globalData.appResourcesBase + 'share/share-13.png',
name: '原野MOJITO',
title: '原味舒食',
title: '原野MOJITO',
date: '周一至周日 10:00 - 凌晨02:00',
describe: [
App.globalData.appResourcesBase + 'shop/detail/detail-3-2-1.png',
......@@ -245,6 +245,8 @@ Page({
// 读取预设信息,banner 图片等等
for (let i = 0, l = funcDetail.length; i < l; i++) {
console.log(funcAppId)
console.log(funcDetail[i].appId)
if (funcAppId === funcDetail[i].appId) {
funcIndex = i
break
......
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