作者 王军

下拉加载

... ... @@ -55,10 +55,11 @@ App({
success: function (res) { //返回取得的数据
if (res.data.code == '1') {
resolve(res.data.data);
} else if (res.data.code == '201') {
resolve(res.data);
} else {
reject(res)
wx.showToast({
title: res.data.msg,
icon:"none"
})
}
},
fail: function (e) {
... ...
... ... @@ -26,6 +26,9 @@ Page({
// 一键预约
reservaImg:"",
isVip:"",// 是否为vip 0:否 1:是
// 预约
yuyuecancel: false,
yuyuesuccess: false,
},
/**
... ... @@ -33,9 +36,6 @@ Page({
*/
onLoad: function (options) {
this.getPersonMsg();
// this.setData({
// isVip:wx.getStorageSync("is_vip")
// })
// 获取首页信息
this.getIndexMsg();
},
... ... @@ -47,12 +47,41 @@ Page({
this.setData({
isVip:res.is_vip
})
wx.setStorageSync("is_vip",res.is_vip)
wx.setStorageSync("is_vip",res.is_vip);
wx.setStorageSync("userId", res.id)
})
},
// vip一键预约
reserveNow(){
this.setData({
yuyuecancel:true
})
},
// 确定预约
confirmAppoint(){
let url = "/api/user/book";
app.post(url,"","post")
.then(res=>{
this.setData({
yuyuecancel: false,
yuyuesuccess:true
})
})
},
cancelyuyue() {
this.setData({
yuyuecancel: false
})
},
sure() {
this.setData({
yuyuesuccess: false
})
},
// 获取首页数据
getIndexMsg(){
console.log(111)
let t = this;
let url = "/api/index/index";
app.post(url)
... ... @@ -89,7 +118,11 @@ Page({
})
},
// 会员注册
toRegister(){},
toRegister(){
wx.navigateTo({
url: '/pages/register/register',
})
},
// 会员中心
vipmember(){
wx.navigateTo({
... ...
... ... @@ -47,9 +47,9 @@
</view>
</view>
</view>
<!-- 普通用户 -->
<view class="topbox xiabox">
<view class="topboxright" bindtap="serviceexperience">
<view class="topboxright" bindtap="serviceexperience" wx:if="{{isVip == 0}}">
<image src="{{experImg}}"></image>
<view class="servicetext">
<view class="serviceword">Service</view>
... ... @@ -82,11 +82,23 @@
<image src="/img/row.png"></image>
</view>
</view>
<view class="topboxleft" bindtap="vipmember" wx:if="{{isVip == 1}}">
<image src="{{reservaImg}}"></image>
<!-- vip -->
<view class="topboxvip" bindtap="vipmember" wx:if="{{isVip == 1}}">
<image src="{{personalImg}}"></image>
<view class="servicetext">
<view class="serviceword">Personal</view>
<view class="serviceword">center</view>
<view class="serviceword">个人中心</view>
</view>
<view class="yourow">
<image src="/img/row.png"></image>
</view>
</view>
<view class="topboxleft" bindtap="reserveNow" wx:if="{{isVip == 1}}">
<image mode='widthFix' src="{{reservaImg}}"></image>
<view class="textbox">
<view class="textboxtop">Immediately reservation</view>
<view class="textboxbottom">会员中心</view>
<view class="textboxbottom">一键预约</view>
</view>
<view class="yourow">
<image src="/img/row.png"></image>
... ... @@ -99,3 +111,27 @@
<view class="bottomimg">
<image src="/img/bottom.png"></image>
</view>
<!-- 是否预约 -->
<!-- 弹窗 -->
<view class="register" wx:if="{{yuyuecancel}}">
<view class="yuyuewrap">
<view class="yuyuewraptop">您确定要进行预约服务吗?</view>
<view class="yuyuebottom">
<view class="yuyuebottomleft" bindtap="cancelyuyue">取消</view>
<view class="yuyuebottomright" bindtap='confirmAppoint'>确定</view>
</view>
</view>
</view>
<!-- 预约成功 -->
<view class="register" wx:if="{{yuyuesuccess}}">
<view class="yuyuewrap">
<view class="yuyuecheng">预约成功</view>
<view class="yuyuechengword">润宝家将尽快与您电话联系</view>
<view class="yuyuesure" bindtap="sure">确定</view>
</view>
</view>
\ No newline at end of file
... ...
... ... @@ -138,6 +138,12 @@ image {
font-size:0;
position: relative
}
.topboxvip{
width:244rpx;
height:244rpx;
font-size:0;
position: relative
}
.boximg{
padding: 34rpx 32rpx;
box-sizing: border-box
... ... @@ -189,3 +195,71 @@ image {
bottom:0;
left:0;
}
/* 弹窗 */
.yuyuewrap{
width:600rpx;
height:312rpx;
background: #fff;
position: absolute;
top:50%;
left:50%;
transform: translate(-50%,-50%)
}
.yuyuebottom{
display:flex;
align-items: center;
position: absolute;
bottom:0;
left:0
}
.yuyuebottomleft{
width:300rpx;
height:80rpx;
background: #BDC4CE;
color:#fff;
font-size: 28rpx;
text-align: center;
line-height:80rpx;
}
.yuyuebottomright{
width:301rpx;
height:80rpx;
background: #273574;
color:#fff;
font-size: 28rpx;
text-align: center;
line-height: 80rpx;
}
.yuyuewraptop{
color:#273574;
font-size: 32rpx;
text-align: center;
margin-top:92rpx;
font-weight: bold;
}
.yuyuesure{
width:600rpx;
height:80rpx;
background: #273574;
color:#fff;
text-align: center;
line-height: 80rpx;
position: absolute;
bottom:0;
left:0;
}
.yuyuecheng{
color:#263472;
font-size: 36rpx;
text-align: center;
font-weight: bold;
margin-top:58rpx;
}
.yuyuechengword{
color:#06121E;
font-size: 28rpx;
text-align: center;
margin-top:24rpx;
}
\ No newline at end of file
... ...
... ... @@ -5,11 +5,12 @@ Page({
* 页面的初始数据
*/
data: {
yuyuecancel:false,
yuyuesuccess:false,
nickName:"",
avatar:"",
token:"",
yuyuesuccess:false,
isVip:"",
},
/**
... ... @@ -19,18 +20,18 @@ Page({
this.setData({
token:wx.getStorageSync("token"),
avatar:wx.getStorageSync("avatarUrl"),
nickName:wx.getStorageSync("nickName")
nickName:wx.getStorageSync("nickName"),
isVip:wx.getStorageSync("is_vip")
})
},
cancelyuyue(){
if(this.data.isVip == 0){
this.setData({
yuyuecancel:false
yuyuesuccess:true
})
}
},
sure(){
this.setData({
yuyuesuccess:false
wx.navigateBack({
delta:1
})
},
... ...
... ... @@ -73,27 +73,11 @@
</view>
<!-- 是否预约 -->
<view class="register" wx:if="{{yuyuecancel}}">
<view class="yuyuewrap">
<view class="yuyuewraptop">您确定要进行预约服务吗?</view>
<view class="yuyuebottom">
<view class="yuyuebottomleft" bindtap="cancelyuyue">取消</view>
<view class="yuyuebottomright">确定</view>
</view>
</view>
</view>
<!-- 预约成功 -->
<!-- 普通用户 -->
<view class="register" wx:if="{{yuyuesuccess}}">
<view class="yuyuewrap">
<view class="yuyuecheng">预约成功</view>
<view class="yuyuechengword">润宝家将尽快与您电话联系</view>
<view class="yuyuecheng">提示</view>
<view class="yuyuechengword">您还不是vip用户,无法看此页面</view>
<view class="yuyuesure" bindtap="sure">确定</view>
</view>
... ...
... ... @@ -134,6 +134,7 @@ image {
font-size: 36rpx;
margin-left:32rpx;
}
/* 弹窗 */
.yuyuewrap{
width:600rpx;
height:312rpx;
... ...
// pages/myguanjia/myguanjia.js
const app = getApp();
Page({
/**
* 页面的初始数据
*/
data: {
phone:"15694875615",
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
},
// 拨打电话
callUp(){
wx.makePhoneCall({
phoneNumber: this.data.phone
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
... ...
... ... @@ -6,7 +6,7 @@
<image src="/img/phone.png"></image>
</view>
<view class="hotline">管家热线:15694875615</view>
<view class="hotline">管家热线:<text bindtap='callUp'> {{phone}}</text> </view>
<view class="boda">点击号码拨打管家电话</view>
</view>
... ...
... ... @@ -76,6 +76,6 @@ Page({
* 用户点击右上角分享
*/
onShareAppMessage: function () {
this.getMyService()
}
})
\ No newline at end of file
... ...
... ... @@ -33,10 +33,11 @@ Page({
t.setData({
name:res.user.user_name,
phone:res.user.mobile,
address:res.user.province+res.user.city+res.user.district,
address:res.user.province+res.user.city+res.user.district+" "+res.user.address,
content:res.user.mark,
tableList:res.data
})
})
},
/**
... ... @@ -78,7 +79,7 @@ Page({
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
this.getMyorder()
},
/**
... ...
... ... @@ -26,7 +26,7 @@
<view class="taocanboxitemright">{{address}}</view>
</view>
<view class="taocanboxitem">
<view class="taocanboxitem" wx:if="{{content}}">
<view class="taocanboxitemleft">
<image src="/img/mark.png"></image>
</view>
... ...
// pages/register/register.js
// pages/serviceexperience/serviceexperience.js
const app = getApp();
Page({
/**
* 页面的初始数据
*/
data: {
region: [],
place: '请选择省市区',
content: "",
name: "",
phone: "",
code: "",
token: "",
isCode: true,
seconds: 60,
isClick: false,
yuyuesuccess: false,
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
onLoad: function(options) {
this.setData({
token: wx.getStorageSync("token")
})
// 获取服务介绍详情
this.getServeiceDetail();
},
// 获取服务介绍详情
getServeiceDetail() {
let t = this;
let url = "/api/index/experienceDetail";
app.post(url)
.then(res => {
t.setData({
content: res.content
})
})
},
// 获取姓名
getName(e) {
this.setData({
name: e.detail.value
})
},
// 获取手机号
getPhone(e) {
this.setData({
phone: e.detail.value
})
},
// 获取详细地址
getAddress(e) {
this.setData({
code: e.detail.value
})
},
// 获取验证码
getCode() {
let t = this;
if (/^1[3456789]\d{9}$/.test(t.data.phone)) {
if (!t.data.isClick) {
t.setData({
isClick: true,
isCode: false
})
let timeAuther = null;
let time = 60;
timeAuther = setInterval(function() {
time--;
t.setData({
seconds: time
})
if (time <= 0) {
clearInterval(timeAuther)
}
}, 1000)
let url = "/api/user/sendMobileCode";
let params = {
mobile: t.data.phone
};
app.post(url, params, "post")
.then(res => {
t.setData({
isClick: false,
})
})
}
} else {
wx.showToast({
title: '请输入正确的手机号',
icon: "none"
})
}
},
// 预约成功
submit() {
// 判断是否登录
let t = this;
if (t.data.token) {
if (t.data.region.length > 0 && t.data.name && t.data.phone && t.data.code) {
let url = "/api/user/userRegister";
let params = {
user_name: t.data.name,
mobile: t.data.phone,
mobile_code: t.data.code,
province: t.data.region[0],
city: t.data.region[1],
district: t.data.region[2]
};
app.post(url, params, "post")
.then(res => {
t.setData({
yuyuesuccess: true
})
})
} else {
wx.showToast({
title: '请输入完整信息',
icon: "none"
})
}
} else {
// 未登录
wx.navigateTo({
url: '/pages/star/star',
})
}
},
// 提交成功
sure(){
wx.navigateBack({
delta: 1
})
},
bindRegionChange: function(e) {
this.setData({
region: e.detail.value,
place: e.detail.value[0] + '、' + e.detail.value[1] + '、' + e.detail.value[2]
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
onReady: function() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
onShow: function() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
onHide: function() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
onUnload: function() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
onPullDownRefresh: function() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
onReachBottom: function() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
onShareAppMessage: function() {
}
})
\ No newline at end of file
... ...
<view class="experiencetop">
<view class="headimg">
<image src="/img/headimg.png"></image>
<view class="logo">
<image src="/img/logo.png"></image>
</view>
</view>
<view class="servicebox">
<view class="servicelsit">
<view class="servicelistitem">
<view class="servicelsitleft">
<image src="/img/renyuan.png"></image>
</view>
<view class="servicelistright">
<input placeholder='请输入您的姓名' value="{{name}}" bindinput='getName' placeholder-class='entertext' />
</view>
</view>
<view class="servicelistitem">
<view class="servicelsitleft">
<image src="/img/shouji.png"></image>
</view>
<view class="servicelistright">
<input placeholder='请输入您的手机号' maxlength='11' value="{{phone}}" bindinput='getPhone' placeholder-class='entertext' />
</view>
</view>
<picker mode="region" bindchange="bindRegionChange" value="{{region}}" custom-item="{{customItem}}">
<view class="servicelistitem">
<view class="servicelsitleft">
<image src="/img/map.png"></image>
</view>
<view class="servicelistright">
<view class="rightword">{{place}}</view>
<view class="rightrow">
<image src="/img/xiasanjiao.png"></image>
</view>
</view>
</view>
</picker>
<view class="servicelistitem code_box">
<view class="servicelsitleft">
<image src="/img/key.png"></image>
</view>
<view class="servicelistright code_input">
<input maxlength='6' placeholder='请输入验证码' value="{{code}}" bindinput='getAddress' placeholder-class='entertext' />
</view>
<view>
<view wx:if="{{isCode}}" class="get_code" bindtap='getCode'>获取验证码</view>
<view wx:else class="send_code">{{seconds}}秒后发送</view>
</view>
</view>
<view class="queren" bindtap='submit'>确认</view>
</view>
</view>
</view>
<view class="register" wx:if="{{yuyuesuccess}}">
<view class="yuyuewrap">
<view class="yuyuecheng">提交成功</view>
<view class="yuyuechengword">信息提交成功,请等待人员审核</view>
<view class="yuyuesure" bindtap="sure">确定</view>
</view>
</view>
\ No newline at end of file
... ...
/* pages/register/register.wxss */
\ No newline at end of file
.experiencetop {
width: 750rpx;
font-size: 0;
}
.headimg {
width: 750rpx;
height: 318rpx;
font-size: 0;
}
.logo {
width: 215rpx;
height: 75rpx;
font-size: 0;
position: absolute;
top: 40rpx;
left: 50%;
transform: translateX(-50%);
}
image {
width: 100%;
height: 100%;
}
.serviceboxtext {
color: #06121e;
font-size: 40rpx;
text-align: center;
font-weight: bold;
margin-top: 42rpx;
}
.servicebox {
width: 686rpx;
height: 748rpx;
background: rgba(255, 255, 255, 1);
box-shadow: 0px 6px 12px rgba(0, 0, 0, 0.16);
opacity: 1;
position: absolute;
top: 260rpx;
left: 32rpx;
}
.servicelsit {
padding: 0 84rpx;
box-sizing: border-box;
}
.servicelistitem {
display: flex;
align-items: center;
margin-top: 56rpx;
padding-bottom: 8rpx;
box-sizing: border-box;
border-bottom: 1rpx solid #f5f5f5;
}
.servicelsitleft {
width: 56rpx;
height: 56rpx;
font-size: 0;
}
.servicelistright {
width: 389rpx;
color: #bdc4ce;
font-size: 28rpx;
margin-left: 50rpx;
}
.entertext {
color: #bdc4ce;
font-size: 28rpx;
}
.servicelistright {
display: flex;
align-items: center;
justify-content: space-between;
}
.rightword {
color: #bdc4ce;
font-size: 28rpx;
}
.rightrow {
width: 15rpx;
height: 15rpx;
font-size: 0;
}
.queren {
width: 516rpx;
height: 80rpx;
background: rgba(39, 53, 116, 1);
box-shadow: 0rpx 6rpx 6rpx rgba(0, 0, 0, 0.16);
opacity: 1;
color:#fff;
font-size: 28rpx;
text-align: center;
line-height: 80rpx;
margin-top:50rpx;
}
/* 获取验证码 */
.code_input{
width: 200rpx;
margin-right: 48rpx
}
.get_code{
color: #273574;
font-size: 28rpx;
}
.send_code{
color: #BDC4CE;
font-size: 28rpx
}
/* 弹窗 */
.yuyuewrap{
width:600rpx;
height:312rpx;
background: #fff;
position: absolute;
top:50%;
left:50%;
transform: translate(-50%,-50%)
}
.yuyuebottom{
display:flex;
align-items: center;
position: absolute;
bottom:0;
left:0
}
.yuyuebottomleft{
width:300rpx;
height:80rpx;
background: #BDC4CE;
color:#fff;
font-size: 28rpx;
text-align: center;
line-height:80rpx;
}
.yuyuebottomright{
width:301rpx;
height:80rpx;
background: #273574;
color:#fff;
font-size: 28rpx;
text-align: center;
line-height: 80rpx;
}
.yuyuewraptop{
color:#273574;
font-size: 32rpx;
text-align: center;
margin-top:92rpx;
font-weight: bold;
}
.yuyuesure{
width:600rpx;
height:80rpx;
background: #273574;
color:#fff;
text-align: center;
line-height: 80rpx;
position: absolute;
bottom:0;
left:0;
}
.yuyuecheng{
color:#263472;
font-size: 36rpx;
text-align: center;
font-weight: bold;
margin-top:58rpx;
}
.yuyuechengword{
color:#06121E;
font-size: 28rpx;
text-align: center;
margin-top:24rpx;
}
\ No newline at end of file
... ...
// pages/service/service.js
const app = getApp();
Page({
/**
* 页面的初始数据
*/
data: {
content:"",
},
/**
... ... @@ -14,7 +15,31 @@ Page({
onLoad: function (options) {
},
getContent(e){
this.setData({
content:e.detail.value
})
},
// 意见反馈
submitSuggest(){
let url = "/api/user/feedBack";
let params = {
content:this.data.content
};
app.post(url,params,"post")
.then(res=>{
wx.showToast({
title: '反馈成功',
icon:'success',
duration:1500
})
setTimeout(function(){
wx.navigateBack({
delta:1
})
},1500)
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
... ...
<view class="service">
<textarea placeholder='请输入您的意见和建议' placeholder-class='entertext'/>
<textarea placeholder='请输入您的意见和建议' bindinput='getContent' placeholder-class='entertext'/>
</view>
<view class="subadvice">提交建议</view>
<view class="subadvice" bindtap='submitSuggest'>提交建议</view>
... ...
... ... @@ -13,6 +13,8 @@ Page({
phone: "",
address: "",
token: "",
// 分享人的ID
shareId:"",
},
/**
... ... @@ -20,11 +22,11 @@ Page({
*/
onLoad: function(options) {
this.setData({
token: wx.getStorageSync("token")
token: wx.getStorageSync("token"),
shareId:options.id
})
// 获取服务介绍详情
this.getServeiceDetail();
},
// 获取服务介绍详情
getServeiceDetail() {
... ... @@ -77,10 +79,9 @@ Page({
icon:"success",
duration:1500,
})
// 分享
setTimeout(function(){
wx.navigateBack({
delta:1
})
this.showShare()
},1500)
})
} else {
... ... @@ -97,7 +98,19 @@ Page({
}
},
// 分享
showShare(){
let url = "/api/user/share";
let params = {
share_uid:this.data.shareId
};
app.post(url,params,"post")
.then(res=>{
wx.redirectTo({
url: '/pages/homeindex/homeindex',
})
})
},
bindRegionChange: function(e) {
this.setData({
... ... @@ -150,7 +163,16 @@ Page({
/**
* 用户点击右上角分享
*/
onShareAppMessage: function() {
onShareAppMessage: function(res) {
if (res.from === 'button') {
}
return {
title: '服务体验',
path: '/pages/serviceexperience/serviceexperience?id=' + wx.getStorageSync("userId"),
success: function (res) {
console.log('成功', res)
}
}
}
})
\ No newline at end of file
... ...
... ... @@ -2,6 +2,7 @@
<image src="/img/experience.png"></image>
<view class="share">
<button open-type='share'></button>
<image class="shareimg" src="/img/share.png"></image>
</view>
... ...
... ... @@ -17,7 +17,15 @@ image {
top: 12rpx;
right: 36rpx;
}
.share button{
width: 100%;
height: 100%;
z-index: 9;
position: absolute;
top: 0;
left: 0;
opacity: 0
}
.servicetext {
color: #fff;
font-size: 28rpx;
... ...
... ... @@ -49,9 +49,10 @@ Page({
.then(res=>{
wx.setStorageSync("token", res.token);
wx.setStorageSync("is_vip", res.is_vip) //是否为vip
wx.setStorageSync("userId",res.id)
// 之后跳转页面/执行方法
wx.redirectTo({
url: '/pages/homeindex/homeindex',
wx.navigateBack({
delta:1
})
})
... ...
... ... @@ -39,7 +39,7 @@
"list": []
},
"miniprogram": {
"current": 6,
"current": 10,
"list": [
{
"id": -1,
... ... @@ -87,6 +87,34 @@
"id": -1,
"name": "我的服务",
"pathName": "pages/myservice/myservice",
"query": "",
"scene": null
},
{
"id": -1,
"name": "我的管家",
"pathName": "pages/myguanjia/myguanjia",
"query": "",
"scene": null
},
{
"id": -1,
"name": "意见反馈",
"pathName": "pages/service/service",
"query": "",
"scene": null
},
{
"id": -1,
"name": "会员注册",
"pathName": "pages/register/register",
"query": "",
"scene": null
},
{
"id": -1,
"name": "会员注册",
"pathName": "pages/register/register",
"scene": null
}
]
... ...