作者 王军

下拉加载

@@ -55,10 +55,11 @@ App({ @@ -55,10 +55,11 @@ App({
55 success: function (res) { //返回取得的数据 55 success: function (res) { //返回取得的数据
56 if (res.data.code == '1') { 56 if (res.data.code == '1') {
57 resolve(res.data.data); 57 resolve(res.data.data);
58 - } else if (res.data.code == '201') {  
59 - resolve(res.data);  
60 } else { 58 } else {
61 - reject(res) 59 + wx.showToast({
  60 + title: res.data.msg,
  61 + icon:"none"
  62 + })
62 } 63 }
63 }, 64 },
64 fail: function (e) { 65 fail: function (e) {
@@ -26,6 +26,9 @@ Page({ @@ -26,6 +26,9 @@ Page({
26 // 一键预约 26 // 一键预约
27 reservaImg:"", 27 reservaImg:"",
28 isVip:"",// 是否为vip 0:否 1:是 28 isVip:"",// 是否为vip 0:否 1:是
  29 + // 预约
  30 + yuyuecancel: false,
  31 + yuyuesuccess: false,
29 }, 32 },
30 33
31 /** 34 /**
@@ -33,9 +36,6 @@ Page({ @@ -33,9 +36,6 @@ Page({
33 */ 36 */
34 onLoad: function (options) { 37 onLoad: function (options) {
35 this.getPersonMsg(); 38 this.getPersonMsg();
36 - // this.setData({  
37 - // isVip:wx.getStorageSync("is_vip")  
38 - // })  
39 // 获取首页信息 39 // 获取首页信息
40 this.getIndexMsg(); 40 this.getIndexMsg();
41 }, 41 },
@@ -47,12 +47,41 @@ Page({ @@ -47,12 +47,41 @@ Page({
47 this.setData({ 47 this.setData({
48 isVip:res.is_vip 48 isVip:res.is_vip
49 }) 49 })
50 - wx.setStorageSync("is_vip",res.is_vip) 50 + wx.setStorageSync("is_vip",res.is_vip);
  51 + wx.setStorageSync("userId", res.id)
  52 + })
  53 + },
  54 + // vip一键预约
  55 + reserveNow(){
  56 + this.setData({
  57 + yuyuecancel:true
  58 + })
  59 +
  60 + },
  61 + // 确定预约
  62 + confirmAppoint(){
  63 + let url = "/api/user/book";
  64 + app.post(url,"","post")
  65 + .then(res=>{
  66 + this.setData({
  67 + yuyuecancel: false,
  68 + yuyuesuccess:true
  69 + })
  70 + })
  71 + },
  72 + cancelyuyue() {
  73 + this.setData({
  74 + yuyuecancel: false
  75 + })
  76 + },
  77 +
  78 + sure() {
  79 + this.setData({
  80 + yuyuesuccess: false
51 }) 81 })
52 }, 82 },
53 // 获取首页数据 83 // 获取首页数据
54 getIndexMsg(){ 84 getIndexMsg(){
55 - console.log(111)  
56 let t = this; 85 let t = this;
57 let url = "/api/index/index"; 86 let url = "/api/index/index";
58 app.post(url) 87 app.post(url)
@@ -89,7 +118,11 @@ Page({ @@ -89,7 +118,11 @@ Page({
89 }) 118 })
90 }, 119 },
91 // 会员注册 120 // 会员注册
92 - toRegister(){}, 121 + toRegister(){
  122 + wx.navigateTo({
  123 + url: '/pages/register/register',
  124 + })
  125 + },
93 // 会员中心 126 // 会员中心
94 vipmember(){ 127 vipmember(){
95 wx.navigateTo({ 128 wx.navigateTo({
@@ -47,9 +47,9 @@ @@ -47,9 +47,9 @@
47 </view> 47 </view>
48 </view> 48 </view>
49 </view> 49 </view>
50 - 50 + <!-- 普通用户 -->
51 <view class="topbox xiabox"> 51 <view class="topbox xiabox">
52 - <view class="topboxright" bindtap="serviceexperience"> 52 + <view class="topboxright" bindtap="serviceexperience" wx:if="{{isVip == 0}}">
53 <image src="{{experImg}}"></image> 53 <image src="{{experImg}}"></image>
54 <view class="servicetext"> 54 <view class="servicetext">
55 <view class="serviceword">Service</view> 55 <view class="serviceword">Service</view>
@@ -72,7 +72,19 @@ @@ -72,7 +72,19 @@
72 </view> 72 </view>
73 </view> 73 </view>
74 <view class="topboxright" bindtap="vipmember" wx:if="{{isVip == 0}}"> 74 <view class="topboxright" bindtap="vipmember" wx:if="{{isVip == 0}}">
75 - <image src="{{personalImg}}"></image> 75 + <image src="{{personalImg}}"></image>
  76 + <view class="servicetext">
  77 + <view class="serviceword">Personal</view>
  78 + <view class="serviceword">center</view>
  79 + <view class="serviceword">个人中心</view>
  80 + </view>
  81 + <view class="yourow">
  82 + <image src="/img/row.png"></image>
  83 + </view>
  84 + </view>
  85 + <!-- vip -->
  86 + <view class="topboxvip" bindtap="vipmember" wx:if="{{isVip == 1}}">
  87 + <image src="{{personalImg}}"></image>
76 <view class="servicetext"> 88 <view class="servicetext">
77 <view class="serviceword">Personal</view> 89 <view class="serviceword">Personal</view>
78 <view class="serviceword">center</view> 90 <view class="serviceword">center</view>
@@ -82,11 +94,11 @@ @@ -82,11 +94,11 @@
82 <image src="/img/row.png"></image> 94 <image src="/img/row.png"></image>
83 </view> 95 </view>
84 </view> 96 </view>
85 - <view class="topboxleft" bindtap="vipmember" wx:if="{{isVip == 1}}">  
86 - <image src="{{reservaImg}}"></image> 97 + <view class="topboxleft" bindtap="reserveNow" wx:if="{{isVip == 1}}">
  98 + <image mode='widthFix' src="{{reservaImg}}"></image>
87 <view class="textbox"> 99 <view class="textbox">
88 <view class="textboxtop">Immediately reservation</view> 100 <view class="textboxtop">Immediately reservation</view>
89 - <view class="textboxbottom">会员中心</view> 101 + <view class="textboxbottom">一键预约</view>
90 </view> 102 </view>
91 <view class="yourow"> 103 <view class="yourow">
92 <image src="/img/row.png"></image> 104 <image src="/img/row.png"></image>
@@ -98,4 +110,28 @@ @@ -98,4 +110,28 @@
98 110
99 <view class="bottomimg"> 111 <view class="bottomimg">
100 <image src="/img/bottom.png"></image> 112 <image src="/img/bottom.png"></image>
  113 +</view>
  114 +<!-- 是否预约 -->
  115 +<!-- 弹窗 -->
  116 +<view class="register" wx:if="{{yuyuecancel}}">
  117 + <view class="yuyuewrap">
  118 + <view class="yuyuewraptop">您确定要进行预约服务吗?</view>
  119 +
  120 + <view class="yuyuebottom">
  121 + <view class="yuyuebottomleft" bindtap="cancelyuyue">取消</view>
  122 + <view class="yuyuebottomright" bindtap='confirmAppoint'>确定</view>
  123 + </view>
  124 + </view>
  125 +
  126 +</view>
  127 +
  128 +<!-- 预约成功 -->
  129 +
  130 +<view class="register" wx:if="{{yuyuesuccess}}">
  131 + <view class="yuyuewrap">
  132 + <view class="yuyuecheng">预约成功</view>
  133 + <view class="yuyuechengword">润宝家将尽快与您电话联系</view>
  134 +
  135 + <view class="yuyuesure" bindtap="sure">确定</view>
  136 + </view>
101 </view> 137 </view>
@@ -138,6 +138,12 @@ image { @@ -138,6 +138,12 @@ image {
138 font-size:0; 138 font-size:0;
139 position: relative 139 position: relative
140 } 140 }
  141 +.topboxvip{
  142 + width:244rpx;
  143 + height:244rpx;
  144 + font-size:0;
  145 + position: relative
  146 +}
141 .boximg{ 147 .boximg{
142 padding: 34rpx 32rpx; 148 padding: 34rpx 32rpx;
143 box-sizing: border-box 149 box-sizing: border-box
@@ -188,4 +194,72 @@ image { @@ -188,4 +194,72 @@ image {
188 position: fixed; 194 position: fixed;
189 bottom:0; 195 bottom:0;
190 left:0; 196 left:0;
  197 +}
  198 +/* 弹窗 */
  199 +.yuyuewrap{
  200 + width:600rpx;
  201 + height:312rpx;
  202 + background: #fff;
  203 + position: absolute;
  204 + top:50%;
  205 + left:50%;
  206 + transform: translate(-50%,-50%)
  207 +}
  208 +.yuyuebottom{
  209 + display:flex;
  210 + align-items: center;
  211 + position: absolute;
  212 + bottom:0;
  213 + left:0
  214 +}
  215 +.yuyuebottomleft{
  216 + width:300rpx;
  217 + height:80rpx;
  218 + background: #BDC4CE;
  219 + color:#fff;
  220 + font-size: 28rpx;
  221 + text-align: center;
  222 + line-height:80rpx;
  223 +
  224 +}
  225 +.yuyuebottomright{
  226 + width:301rpx;
  227 + height:80rpx;
  228 + background: #273574;
  229 + color:#fff;
  230 + font-size: 28rpx;
  231 + text-align: center;
  232 + line-height: 80rpx;
  233 +
  234 +}
  235 +.yuyuewraptop{
  236 + color:#273574;
  237 + font-size: 32rpx;
  238 + text-align: center;
  239 + margin-top:92rpx;
  240 + font-weight: bold;
  241 +}
  242 +.yuyuesure{
  243 + width:600rpx;
  244 + height:80rpx;
  245 + background: #273574;
  246 + color:#fff;
  247 + text-align: center;
  248 + line-height: 80rpx;
  249 + position: absolute;
  250 + bottom:0;
  251 + left:0;
  252 +}
  253 +.yuyuecheng{
  254 + color:#263472;
  255 + font-size: 36rpx;
  256 + text-align: center;
  257 + font-weight: bold;
  258 + margin-top:58rpx;
  259 +}
  260 +.yuyuechengword{
  261 + color:#06121E;
  262 + font-size: 28rpx;
  263 + text-align: center;
  264 + margin-top:24rpx;
191 } 265 }
@@ -5,11 +5,12 @@ Page({ @@ -5,11 +5,12 @@ Page({
5 * 页面的初始数据 5 * 页面的初始数据
6 */ 6 */
7 data: { 7 data: {
8 - yuyuecancel:false,  
9 - yuyuesuccess:false, 8 +
10 nickName:"", 9 nickName:"",
11 avatar:"", 10 avatar:"",
12 token:"", 11 token:"",
  12 + yuyuesuccess:false,
  13 + isVip:"",
13 }, 14 },
14 15
15 /** 16 /**
@@ -19,18 +20,18 @@ Page({ @@ -19,18 +20,18 @@ Page({
19 this.setData({ 20 this.setData({
20 token:wx.getStorageSync("token"), 21 token:wx.getStorageSync("token"),
21 avatar:wx.getStorageSync("avatarUrl"), 22 avatar:wx.getStorageSync("avatarUrl"),
22 - nickName:wx.getStorageSync("nickName") 23 + nickName:wx.getStorageSync("nickName"),
  24 + isVip:wx.getStorageSync("is_vip")
23 }) 25 })
  26 + if(this.data.isVip == 0){
  27 + this.setData({
  28 + yuyuesuccess:true
  29 + })
  30 + }
24 }, 31 },
25 - cancelyuyue(){  
26 - this.setData({  
27 - yuyuecancel:false  
28 - })  
29 - },  
30 -  
31 sure(){ 32 sure(){
32 - this.setData({  
33 - yuyuesuccess:false 33 + wx.navigateBack({
  34 + delta:1
34 }) 35 })
35 }, 36 },
36 37
@@ -73,28 +73,12 @@ @@ -73,28 +73,12 @@
73 73
74 74
75 </view> 75 </view>
76 -  
77 -<!-- 是否预约 -->  
78 -  
79 -<view class="register" wx:if="{{yuyuecancel}}">  
80 - <view class="yuyuewrap">  
81 - <view class="yuyuewraptop">您确定要进行预约服务吗?</view>  
82 -  
83 - <view class="yuyuebottom">  
84 - <view class="yuyuebottomleft" bindtap="cancelyuyue">取消</view>  
85 - <view class="yuyuebottomright">确定</view>  
86 - </view>  
87 - </view>  
88 -  
89 -</view>  
90 -  
91 -<!-- 预约成功 -->  
92 - 76 +<!-- 普通用户 -->
93 <view class="register" wx:if="{{yuyuesuccess}}"> 77 <view class="register" wx:if="{{yuyuesuccess}}">
94 <view class="yuyuewrap"> 78 <view class="yuyuewrap">
95 - <view class="yuyuecheng">预约成功</view>  
96 - <view class="yuyuechengword">润宝家将尽快与您电话联系</view> 79 + <view class="yuyuecheng">提示</view>
  80 + <view class="yuyuechengword">您还不是vip用户,无法看此页面</view>
97 81
98 <view class="yuyuesure" bindtap="sure">确定</view> 82 <view class="yuyuesure" bindtap="sure">确定</view>
99 </view> 83 </view>
100 -</view>  
  84 +</view>
@@ -134,6 +134,7 @@ image { @@ -134,6 +134,7 @@ image {
134 font-size: 36rpx; 134 font-size: 36rpx;
135 margin-left:32rpx; 135 margin-left:32rpx;
136 } 136 }
  137 +/* 弹窗 */
137 .yuyuewrap{ 138 .yuyuewrap{
138 width:600rpx; 139 width:600rpx;
139 height:312rpx; 140 height:312rpx;
@@ -200,4 +201,4 @@ image { @@ -200,4 +201,4 @@ image {
200 font-size: 28rpx; 201 font-size: 28rpx;
201 text-align: center; 202 text-align: center;
202 margin-top:24rpx; 203 margin-top:24rpx;
203 -}  
  204 +}
1 // pages/myguanjia/myguanjia.js 1 // pages/myguanjia/myguanjia.js
  2 +const app = getApp();
2 Page({ 3 Page({
3 4
4 /** 5 /**
5 * 页面的初始数据 6 * 页面的初始数据
6 */ 7 */
7 data: { 8 data: {
8 - 9 + phone:"15694875615",
9 }, 10 },
10 11
11 /** 12 /**
12 * 生命周期函数--监听页面加载 13 * 生命周期函数--监听页面加载
13 */ 14 */
14 onLoad: function (options) { 15 onLoad: function (options) {
15 -  
16 }, 16 },
17 - 17 + // 拨打电话
  18 + callUp(){
  19 + wx.makePhoneCall({
  20 + phoneNumber: this.data.phone
  21 + })
  22 + },
18 /** 23 /**
19 * 生命周期函数--监听页面初次渲染完成 24 * 生命周期函数--监听页面初次渲染完成
20 */ 25 */
@@ -6,7 +6,7 @@ @@ -6,7 +6,7 @@
6 <image src="/img/phone.png"></image> 6 <image src="/img/phone.png"></image>
7 </view> 7 </view>
8 8
9 - <view class="hotline">管家热线:15694875615</view> 9 + <view class="hotline">管家热线:<text bindtap='callUp'> {{phone}}</text> </view>
10 <view class="boda">点击号码拨打管家电话</view> 10 <view class="boda">点击号码拨打管家电话</view>
11 </view> 11 </view>
12 12
@@ -76,6 +76,6 @@ Page({ @@ -76,6 +76,6 @@ Page({
76 * 用户点击右上角分享 76 * 用户点击右上角分享
77 */ 77 */
78 onShareAppMessage: function () { 78 onShareAppMessage: function () {
79 - 79 + this.getMyService()
80 } 80 }
81 }) 81 })
@@ -33,10 +33,11 @@ Page({ @@ -33,10 +33,11 @@ Page({
33 t.setData({ 33 t.setData({
34 name:res.user.user_name, 34 name:res.user.user_name,
35 phone:res.user.mobile, 35 phone:res.user.mobile,
36 - address:res.user.province+res.user.city+res.user.district, 36 + address:res.user.province+res.user.city+res.user.district+" "+res.user.address,
37 content:res.user.mark, 37 content:res.user.mark,
38 tableList:res.data 38 tableList:res.data
39 }) 39 })
  40 +
40 }) 41 })
41 }, 42 },
42 /** 43 /**
@@ -78,7 +79,7 @@ Page({ @@ -78,7 +79,7 @@ Page({
78 * 页面上拉触底事件的处理函数 79 * 页面上拉触底事件的处理函数
79 */ 80 */
80 onReachBottom: function () { 81 onReachBottom: function () {
81 - 82 + this.getMyorder()
82 }, 83 },
83 84
84 /** 85 /**
@@ -26,7 +26,7 @@ @@ -26,7 +26,7 @@
26 <view class="taocanboxitemright">{{address}}</view> 26 <view class="taocanboxitemright">{{address}}</view>
27 </view> 27 </view>
28 28
29 - <view class="taocanboxitem"> 29 + <view class="taocanboxitem" wx:if="{{content}}">
30 <view class="taocanboxitemleft"> 30 <view class="taocanboxitemleft">
31 <image src="/img/mark.png"></image> 31 <image src="/img/mark.png"></image>
32 </view> 32 </view>
1 -// pages/register/register.js 1 +// pages/serviceexperience/serviceexperience.js
  2 +const app = getApp();
2 Page({ 3 Page({
3 4
4 /** 5 /**
5 * 页面的初始数据 6 * 页面的初始数据
6 */ 7 */
7 data: { 8 data: {
8 - 9 + region: [],
  10 + place: '请选择省市区',
  11 + content: "",
  12 + name: "",
  13 + phone: "",
  14 + code: "",
  15 + token: "",
  16 + isCode: true,
  17 + seconds: 60,
  18 + isClick: false,
  19 + yuyuesuccess: false,
9 }, 20 },
10 21
11 /** 22 /**
12 * 生命周期函数--监听页面加载 23 * 生命周期函数--监听页面加载
13 */ 24 */
14 - onLoad: function (options) { 25 + onLoad: function(options) {
  26 + this.setData({
  27 + token: wx.getStorageSync("token")
  28 + })
  29 + // 获取服务介绍详情
  30 + this.getServeiceDetail();
  31 +
  32 + },
  33 + // 获取服务介绍详情
  34 + getServeiceDetail() {
  35 + let t = this;
  36 + let url = "/api/index/experienceDetail";
  37 + app.post(url)
  38 + .then(res => {
  39 + t.setData({
  40 + content: res.content
  41 + })
  42 + })
  43 + },
  44 + // 获取姓名
  45 + getName(e) {
  46 + this.setData({
  47 + name: e.detail.value
  48 + })
  49 + },
  50 + // 获取手机号
  51 + getPhone(e) {
  52 + this.setData({
  53 + phone: e.detail.value
  54 + })
  55 + },
  56 + // 获取详细地址
  57 + getAddress(e) {
  58 + this.setData({
  59 + code: e.detail.value
  60 + })
  61 + },
  62 + // 获取验证码
  63 + getCode() {
  64 + let t = this;
  65 + if (/^1[3456789]\d{9}$/.test(t.data.phone)) {
  66 + if (!t.data.isClick) {
  67 + t.setData({
  68 + isClick: true,
  69 + isCode: false
  70 + })
  71 + let timeAuther = null;
  72 + let time = 60;
  73 + timeAuther = setInterval(function() {
  74 + time--;
  75 + t.setData({
  76 + seconds: time
  77 + })
  78 + if (time <= 0) {
  79 + clearInterval(timeAuther)
  80 + }
  81 + }, 1000)
  82 + let url = "/api/user/sendMobileCode";
  83 + let params = {
  84 + mobile: t.data.phone
  85 + };
  86 + app.post(url, params, "post")
  87 + .then(res => {
  88 + t.setData({
  89 + isClick: false,
  90 +
  91 + })
  92 + })
  93 +
  94 + }
  95 + } else {
  96 + wx.showToast({
  97 + title: '请输入正确的手机号',
  98 + icon: "none"
  99 + })
  100 + }
15 101
16 }, 102 },
  103 +
  104 + // 预约成功
  105 + submit() {
  106 + // 判断是否登录
  107 + let t = this;
  108 + if (t.data.token) {
  109 + if (t.data.region.length > 0 && t.data.name && t.data.phone && t.data.code) {
  110 + let url = "/api/user/userRegister";
  111 + let params = {
  112 + user_name: t.data.name,
  113 + mobile: t.data.phone,
  114 + mobile_code: t.data.code,
  115 + province: t.data.region[0],
  116 + city: t.data.region[1],
  117 + district: t.data.region[2]
  118 + };
  119 + app.post(url, params, "post")
  120 + .then(res => {
  121 + t.setData({
  122 + yuyuesuccess: true
  123 + })
  124 + })
  125 + } else {
  126 + wx.showToast({
  127 + title: '请输入完整信息',
  128 + icon: "none"
  129 + })
  130 + }
  131 + } else {
  132 + // 未登录
  133 + wx.navigateTo({
  134 + url: '/pages/star/star',
  135 + })
  136 + }
  137 +
  138 +
17 139
  140 + },
  141 + // 提交成功
  142 + sure(){
  143 + wx.navigateBack({
  144 + delta: 1
  145 + })
  146 + },
  147 + bindRegionChange: function(e) {
  148 + this.setData({
  149 + region: e.detail.value,
  150 + place: e.detail.value[0] + '、' + e.detail.value[1] + '、' + e.detail.value[2]
  151 + })
  152 + },
18 /** 153 /**
19 * 生命周期函数--监听页面初次渲染完成 154 * 生命周期函数--监听页面初次渲染完成
20 */ 155 */
21 - onReady: function () { 156 + onReady: function() {
22 157
23 }, 158 },
24 159
25 /** 160 /**
26 * 生命周期函数--监听页面显示 161 * 生命周期函数--监听页面显示
27 */ 162 */
28 - onShow: function () { 163 + onShow: function() {
29 164
30 }, 165 },
31 166
32 /** 167 /**
33 * 生命周期函数--监听页面隐藏 168 * 生命周期函数--监听页面隐藏
34 */ 169 */
35 - onHide: function () { 170 + onHide: function() {
36 171
37 }, 172 },
38 173
39 /** 174 /**
40 * 生命周期函数--监听页面卸载 175 * 生命周期函数--监听页面卸载
41 */ 176 */
42 - onUnload: function () { 177 + onUnload: function() {
43 178
44 }, 179 },
45 180
46 /** 181 /**
47 * 页面相关事件处理函数--监听用户下拉动作 182 * 页面相关事件处理函数--监听用户下拉动作
48 */ 183 */
49 - onPullDownRefresh: function () { 184 + onPullDownRefresh: function() {
50 185
51 }, 186 },
52 187
53 /** 188 /**
54 * 页面上拉触底事件的处理函数 189 * 页面上拉触底事件的处理函数
55 */ 190 */
56 - onReachBottom: function () { 191 + onReachBottom: function() {
57 192
58 }, 193 },
59 194
60 /** 195 /**
61 * 用户点击右上角分享 196 * 用户点击右上角分享
62 */ 197 */
63 - onShareAppMessage: function () { 198 + onShareAppMessage: function() {
64 199
65 } 200 }
66 }) 201 })
  1 +<view class="experiencetop">
  2 + <view class="headimg">
  3 + <image src="/img/headimg.png"></image>
1 4
  5 + <view class="logo">
  6 + <image src="/img/logo.png"></image>
  7 + </view>
  8 + </view>
  9 + <view class="servicebox">
  10 + <view class="servicelsit">
  11 + <view class="servicelistitem">
  12 + <view class="servicelsitleft">
  13 + <image src="/img/renyuan.png"></image>
  14 + </view>
  15 + <view class="servicelistright">
  16 + <input placeholder='请输入您的姓名' value="{{name}}" bindinput='getName' placeholder-class='entertext' />
  17 + </view>
  18 + </view>
  19 + <view class="servicelistitem">
  20 + <view class="servicelsitleft">
  21 + <image src="/img/shouji.png"></image>
  22 + </view>
  23 + <view class="servicelistright">
  24 + <input placeholder='请输入您的手机号' maxlength='11' value="{{phone}}" bindinput='getPhone' placeholder-class='entertext' />
  25 + </view>
  26 + </view>
  27 +
  28 + <picker mode="region" bindchange="bindRegionChange" value="{{region}}" custom-item="{{customItem}}">
  29 + <view class="servicelistitem">
  30 + <view class="servicelsitleft">
  31 + <image src="/img/map.png"></image>
  32 + </view>
  33 + <view class="servicelistright">
  34 + <view class="rightword">{{place}}</view>
  35 + <view class="rightrow">
  36 + <image src="/img/xiasanjiao.png"></image>
  37 + </view>
  38 + </view>
  39 + </view>
  40 + </picker>
  41 +
  42 +
  43 +
  44 + <view class="servicelistitem code_box">
  45 + <view class="servicelsitleft">
  46 + <image src="/img/key.png"></image>
  47 + </view>
  48 + <view class="servicelistright code_input">
  49 + <input maxlength='6' placeholder='请输入验证码' value="{{code}}" bindinput='getAddress' placeholder-class='entertext' />
  50 + </view>
  51 + <view>
  52 + <view wx:if="{{isCode}}" class="get_code" bindtap='getCode'>获取验证码</view>
  53 + <view wx:else class="send_code">{{seconds}}秒后发送</view>
  54 + </view>
  55 + </view>
  56 +
  57 + <view class="queren" bindtap='submit'>确认</view>
  58 + </view>
  59 + </view>
  60 +</view>
  61 +<view class="register" wx:if="{{yuyuesuccess}}">
  62 + <view class="yuyuewrap">
  63 + <view class="yuyuecheng">提交成功</view>
  64 + <view class="yuyuechengword">信息提交成功,请等待人员审核</view>
  65 +
  66 + <view class="yuyuesure" bindtap="sure">确定</view>
  67 + </view>
  68 +</view>
1 -/* pages/register/register.wxss */  
  1 +.experiencetop {
  2 + width: 750rpx;
  3 + font-size: 0;
  4 +}
  5 +.headimg {
  6 + width: 750rpx;
  7 + height: 318rpx;
  8 + font-size: 0;
  9 +}
  10 +
  11 +.logo {
  12 + width: 215rpx;
  13 + height: 75rpx;
  14 + font-size: 0;
  15 + position: absolute;
  16 + top: 40rpx;
  17 + left: 50%;
  18 + transform: translateX(-50%);
  19 +}
  20 +image {
  21 + width: 100%;
  22 + height: 100%;
  23 +}
  24 +
  25 +
  26 +
  27 +
  28 +
  29 +.serviceboxtext {
  30 + color: #06121e;
  31 + font-size: 40rpx;
  32 + text-align: center;
  33 + font-weight: bold;
  34 + margin-top: 42rpx;
  35 +}
  36 +
  37 +.servicebox {
  38 + width: 686rpx;
  39 + height: 748rpx;
  40 + background: rgba(255, 255, 255, 1);
  41 + box-shadow: 0px 6px 12px rgba(0, 0, 0, 0.16);
  42 + opacity: 1;
  43 + position: absolute;
  44 + top: 260rpx;
  45 + left: 32rpx;
  46 +}
  47 +
  48 +.servicelsit {
  49 + padding: 0 84rpx;
  50 + box-sizing: border-box;
  51 +}
  52 +
  53 +.servicelistitem {
  54 + display: flex;
  55 + align-items: center;
  56 + margin-top: 56rpx;
  57 + padding-bottom: 8rpx;
  58 + box-sizing: border-box;
  59 + border-bottom: 1rpx solid #f5f5f5;
  60 +}
  61 +
  62 +.servicelsitleft {
  63 + width: 56rpx;
  64 + height: 56rpx;
  65 + font-size: 0;
  66 +}
  67 +
  68 +.servicelistright {
  69 + width: 389rpx;
  70 + color: #bdc4ce;
  71 + font-size: 28rpx;
  72 + margin-left: 50rpx;
  73 +}
  74 +
  75 +.entertext {
  76 + color: #bdc4ce;
  77 + font-size: 28rpx;
  78 +}
  79 +
  80 +.servicelistright {
  81 + display: flex;
  82 + align-items: center;
  83 + justify-content: space-between;
  84 +}
  85 +
  86 +.rightword {
  87 + color: #bdc4ce;
  88 + font-size: 28rpx;
  89 +}
  90 +
  91 +.rightrow {
  92 + width: 15rpx;
  93 + height: 15rpx;
  94 + font-size: 0;
  95 +}
  96 +
  97 +.queren {
  98 + width: 516rpx;
  99 + height: 80rpx;
  100 + background: rgba(39, 53, 116, 1);
  101 + box-shadow: 0rpx 6rpx 6rpx rgba(0, 0, 0, 0.16);
  102 + opacity: 1;
  103 + color:#fff;
  104 + font-size: 28rpx;
  105 + text-align: center;
  106 + line-height: 80rpx;
  107 + margin-top:50rpx;
  108 +}
  109 +/* 获取验证码 */
  110 +.code_input{
  111 + width: 200rpx;
  112 + margin-right: 48rpx
  113 +}
  114 +.get_code{
  115 + color: #273574;
  116 + font-size: 28rpx;
  117 +
  118 +}
  119 +.send_code{
  120 + color: #BDC4CE;
  121 + font-size: 28rpx
  122 +}
  123 +/* 弹窗 */
  124 +.yuyuewrap{
  125 + width:600rpx;
  126 + height:312rpx;
  127 + background: #fff;
  128 + position: absolute;
  129 + top:50%;
  130 + left:50%;
  131 + transform: translate(-50%,-50%)
  132 +}
  133 +.yuyuebottom{
  134 + display:flex;
  135 + align-items: center;
  136 + position: absolute;
  137 + bottom:0;
  138 + left:0
  139 +}
  140 +.yuyuebottomleft{
  141 + width:300rpx;
  142 + height:80rpx;
  143 + background: #BDC4CE;
  144 + color:#fff;
  145 + font-size: 28rpx;
  146 + text-align: center;
  147 + line-height:80rpx;
  148 +
  149 +}
  150 +.yuyuebottomright{
  151 + width:301rpx;
  152 + height:80rpx;
  153 + background: #273574;
  154 + color:#fff;
  155 + font-size: 28rpx;
  156 + text-align: center;
  157 + line-height: 80rpx;
  158 +
  159 +}
  160 +.yuyuewraptop{
  161 + color:#273574;
  162 + font-size: 32rpx;
  163 + text-align: center;
  164 + margin-top:92rpx;
  165 + font-weight: bold;
  166 +}
  167 +.yuyuesure{
  168 + width:600rpx;
  169 + height:80rpx;
  170 + background: #273574;
  171 + color:#fff;
  172 + text-align: center;
  173 + line-height: 80rpx;
  174 + position: absolute;
  175 + bottom:0;
  176 + left:0;
  177 +}
  178 +.yuyuecheng{
  179 + color:#263472;
  180 + font-size: 36rpx;
  181 + text-align: center;
  182 + font-weight: bold;
  183 + margin-top:58rpx;
  184 +}
  185 +.yuyuechengword{
  186 + color:#06121E;
  187 + font-size: 28rpx;
  188 + text-align: center;
  189 + margin-top:24rpx;
  190 +}
1 // pages/service/service.js 1 // pages/service/service.js
  2 +const app = getApp();
2 Page({ 3 Page({
3 4
4 /** 5 /**
5 * 页面的初始数据 6 * 页面的初始数据
6 */ 7 */
7 data: { 8 data: {
8 - 9 + content:"",
9 }, 10 },
10 11
11 /** 12 /**
@@ -14,7 +15,31 @@ Page({ @@ -14,7 +15,31 @@ Page({
14 onLoad: function (options) { 15 onLoad: function (options) {
15 16
16 }, 17 },
17 - 18 + getContent(e){
  19 + this.setData({
  20 + content:e.detail.value
  21 + })
  22 + },
  23 + // 意见反馈
  24 + submitSuggest(){
  25 + let url = "/api/user/feedBack";
  26 + let params = {
  27 + content:this.data.content
  28 + };
  29 + app.post(url,params,"post")
  30 + .then(res=>{
  31 + wx.showToast({
  32 + title: '反馈成功',
  33 + icon:'success',
  34 + duration:1500
  35 + })
  36 + setTimeout(function(){
  37 + wx.navigateBack({
  38 + delta:1
  39 + })
  40 + },1500)
  41 + })
  42 + },
18 /** 43 /**
19 * 生命周期函数--监听页面初次渲染完成 44 * 生命周期函数--监听页面初次渲染完成
20 */ 45 */
1 <view class="service"> 1 <view class="service">
2 - <textarea placeholder='请输入您的意见和建议' placeholder-class='entertext'/> 2 + <textarea placeholder='请输入您的意见和建议' bindinput='getContent' placeholder-class='entertext'/>
3 </view> 3 </view>
4 4
5 -<view class="subadvice">提交建议</view> 5 +<view class="subadvice" bindtap='submitSuggest'>提交建议</view>
@@ -13,6 +13,8 @@ Page({ @@ -13,6 +13,8 @@ Page({
13 phone: "", 13 phone: "",
14 address: "", 14 address: "",
15 token: "", 15 token: "",
  16 + // 分享人的ID
  17 + shareId:"",
16 }, 18 },
17 19
18 /** 20 /**
@@ -20,11 +22,11 @@ Page({ @@ -20,11 +22,11 @@ Page({
20 */ 22 */
21 onLoad: function(options) { 23 onLoad: function(options) {
22 this.setData({ 24 this.setData({
23 - token: wx.getStorageSync("token") 25 + token: wx.getStorageSync("token"),
  26 + shareId:options.id
24 }) 27 })
25 // 获取服务介绍详情 28 // 获取服务介绍详情
26 this.getServeiceDetail(); 29 this.getServeiceDetail();
27 -  
28 }, 30 },
29 // 获取服务介绍详情 31 // 获取服务介绍详情
30 getServeiceDetail() { 32 getServeiceDetail() {
@@ -77,10 +79,9 @@ Page({ @@ -77,10 +79,9 @@ Page({
77 icon:"success", 79 icon:"success",
78 duration:1500, 80 duration:1500,
79 }) 81 })
  82 + // 分享
80 setTimeout(function(){ 83 setTimeout(function(){
81 - wx.navigateBack({  
82 - delta:1  
83 - }) 84 + this.showShare()
84 },1500) 85 },1500)
85 }) 86 })
86 } else { 87 } else {
@@ -97,7 +98,19 @@ Page({ @@ -97,7 +98,19 @@ Page({
97 } 98 }
98 99
99 100
100 - 101 + },
  102 + // 分享
  103 + showShare(){
  104 + let url = "/api/user/share";
  105 + let params = {
  106 + share_uid:this.data.shareId
  107 + };
  108 + app.post(url,params,"post")
  109 + .then(res=>{
  110 + wx.redirectTo({
  111 + url: '/pages/homeindex/homeindex',
  112 + })
  113 + })
101 }, 114 },
102 bindRegionChange: function(e) { 115 bindRegionChange: function(e) {
103 this.setData({ 116 this.setData({
@@ -150,7 +163,16 @@ Page({ @@ -150,7 +163,16 @@ Page({
150 /** 163 /**
151 * 用户点击右上角分享 164 * 用户点击右上角分享
152 */ 165 */
153 - onShareAppMessage: function() { 166 + onShareAppMessage: function(res) {
  167 + if (res.from === 'button') {
154 168
  169 + }
  170 + return {
  171 + title: '服务体验',
  172 + path: '/pages/serviceexperience/serviceexperience?id=' + wx.getStorageSync("userId"),
  173 + success: function (res) {
  174 + console.log('成功', res)
  175 + }
  176 + }
155 } 177 }
156 }) 178 })
@@ -2,6 +2,7 @@ @@ -2,6 +2,7 @@
2 <image src="/img/experience.png"></image> 2 <image src="/img/experience.png"></image>
3 3
4 <view class="share"> 4 <view class="share">
  5 + <button open-type='share'></button>
5 <image class="shareimg" src="/img/share.png"></image> 6 <image class="shareimg" src="/img/share.png"></image>
6 </view> 7 </view>
7 8
@@ -17,7 +17,15 @@ image { @@ -17,7 +17,15 @@ image {
17 top: 12rpx; 17 top: 12rpx;
18 right: 36rpx; 18 right: 36rpx;
19 } 19 }
20 - 20 +.share button{
  21 + width: 100%;
  22 + height: 100%;
  23 + z-index: 9;
  24 + position: absolute;
  25 + top: 0;
  26 + left: 0;
  27 + opacity: 0
  28 +}
21 .servicetext { 29 .servicetext {
22 color: #fff; 30 color: #fff;
23 font-size: 28rpx; 31 font-size: 28rpx;
@@ -49,9 +49,10 @@ Page({ @@ -49,9 +49,10 @@ Page({
49 .then(res=>{ 49 .then(res=>{
50 wx.setStorageSync("token", res.token); 50 wx.setStorageSync("token", res.token);
51 wx.setStorageSync("is_vip", res.is_vip) //是否为vip 51 wx.setStorageSync("is_vip", res.is_vip) //是否为vip
  52 + wx.setStorageSync("userId",res.id)
52 // 之后跳转页面/执行方法 53 // 之后跳转页面/执行方法
53 - wx.redirectTo({  
54 - url: '/pages/homeindex/homeindex', 54 + wx.navigateBack({
  55 + delta:1
55 }) 56 })
56 }) 57 })
57 58
@@ -39,7 +39,7 @@ @@ -39,7 +39,7 @@
39 "list": [] 39 "list": []
40 }, 40 },
41 "miniprogram": { 41 "miniprogram": {
42 - "current": 6, 42 + "current": 10,
43 "list": [ 43 "list": [
44 { 44 {
45 "id": -1, 45 "id": -1,
@@ -87,6 +87,34 @@ @@ -87,6 +87,34 @@
87 "id": -1, 87 "id": -1,
88 "name": "我的服务", 88 "name": "我的服务",
89 "pathName": "pages/myservice/myservice", 89 "pathName": "pages/myservice/myservice",
  90 + "query": "",
  91 + "scene": null
  92 + },
  93 + {
  94 + "id": -1,
  95 + "name": "我的管家",
  96 + "pathName": "pages/myguanjia/myguanjia",
  97 + "query": "",
  98 + "scene": null
  99 + },
  100 + {
  101 + "id": -1,
  102 + "name": "意见反馈",
  103 + "pathName": "pages/service/service",
  104 + "query": "",
  105 + "scene": null
  106 + },
  107 + {
  108 + "id": -1,
  109 + "name": "会员注册",
  110 + "pathName": "pages/register/register",
  111 + "query": "",
  112 + "scene": null
  113 + },
  114 + {
  115 + "id": -1,
  116 + "name": "会员注册",
  117 + "pathName": "pages/register/register",
90 "scene": null 118 "scene": null
91 } 119 }
92 ] 120 ]