作者 王旭宇

201908011801

正在显示 43 个修改的文件 包含 1165 行增加103 行删除
@@ -67,7 +67,8 @@ @@ -67,7 +67,8 @@
67 "pages/my/invoiceList/invoiceList", 67 "pages/my/invoiceList/invoiceList",
68 "pages/vip/detail_vip/detail_vip", 68 "pages/vip/detail_vip/detail_vip",
69 "pages/index/goodsDetials/goodsDetials", 69 "pages/index/goodsDetials/goodsDetials",
70 - "pages/navigate/navigate" 70 + "pages/navigate/navigate",
  71 + "pages/index/user_comment_detail/user_comment_detail"
71 ], 72 ],
72 "window": { 73 "window": {
73 "backgroundTextStyle": "dark", 74 "backgroundTextStyle": "dark",
@@ -14,7 +14,7 @@ @@ -14,7 +14,7 @@
14 </view> 14 </view>
15 </view> 15 </view>
16 <!-- 商品列表 --> 16 <!-- 商品列表 -->
17 - <view> 17 + <view class='da'>
18 <view class='product_list' wx:if='{{goodsList.length>0||promotion.length>0}}'> 18 <view class='product_list' wx:if='{{goodsList.length>0||promotion.length>0}}'>
19 <view class='singlepart' wx:for='{{goodsList}}' wx:for-item='cell' wx:for-index='cellindex' wx:key='{{cellindex}}'> 19 <view class='singlepart' wx:for='{{goodsList}}' wx:for-item='cell' wx:for-index='cellindex' wx:key='{{cellindex}}'>
20 <view class='single_part_top'> 20 <view class='single_part_top'>
@@ -85,7 +85,10 @@ @@ -85,7 +85,10 @@
85 </view> 85 </view>
86 </view> 86 </view>
87 </view> 87 </view>
88 - <view wx:else class='gogogo'>请先去选择商品</view> 88 + <view wx:if='{{goodsList.length==0&&promotion.length==0}}' class='gogogo'>
  89 + <image src='../imgs/noCart.png'></image>
  90 + <view>您暂时没有消息哦~</view>
  91 + </view>
89 </view> 92 </view>
90 93
91 94
@@ -3,20 +3,49 @@ page{ @@ -3,20 +3,49 @@ page{
3 background: #FFF; 3 background: #FFF;
4 display: flex; 4 display: flex;
5 flex-flow: column; 5 flex-flow: column;
  6 + width: 100%;
6 height: 100%; 7 height: 100%;
7 } 8 }
8 .page{ 9 .page{
  10 + width: 100%;
  11 + height: 100%;
9 overflow-x: hidden; 12 overflow-x: hidden;
10 - min-height: 100%; 13 +}
  14 +.da{
  15 + width: 100%;
  16 + height: calc(100% - 135rpx);
11 } 17 }
12 .gogogo{ 18 .gogogo{
  19 + width: 100%;
  20 + height: 100%;
13 text-align: center; 21 text-align: center;
14 line-height: 500rpx; 22 line-height: 500rpx;
15 color: #888; 23 color: #888;
16 font-size: 32rpx; 24 font-size: 32rpx;
17 - 25 + position: relative;
  26 +}
  27 +.gogogo image{
  28 + height: 247rpx;
  29 + width: 340rpx;
  30 + position: absolute;
  31 + top: 0;
  32 + left: 0;
  33 + right: 0;
  34 + bottom: 0;
  35 + margin:auto;
  36 +}
  37 +.gogogo view{
  38 + font-size:26rpx;
  39 + font-family:PingFang-SC-Medium;
  40 + font-weight:500;
  41 + color:rgba(136,136,136,1);
  42 + position: absolute;
  43 + left: 50%;
  44 + transform: translate(-50%,-10%);
  45 + top: 50%
18 } 46 }
19 .cart_box{ 47 .cart_box{
  48 + height: calc(100% - 100rpx);
20 flex: 1; 49 flex: 1;
21 display: flex; 50 display: flex;
22 flex-flow: column; 51 flex-flow: column;
@@ -355,7 +355,6 @@ Page({ @@ -355,7 +355,6 @@ Page({
355 gPrice: zuihoujiage, 355 gPrice: zuihoujiage,
356 collocation: r.data.collocation, 356 collocation: r.data.collocation,
357 comment: r.data.comment, 357 comment: r.data.comment,
358 - // star_arr: star_arr,  
359 skuid: skuid, 358 skuid: skuid,
360 is_group: r.data.info.group_min_number, 359 is_group: r.data.info.group_min_number,
361 id_arr: arr, 360 id_arr: arr,
@@ -370,7 +369,6 @@ Page({ @@ -370,7 +369,6 @@ Page({
370 gPrice: zuihoujiage, 369 gPrice: zuihoujiage,
371 collocation: r.data.collocation, 370 collocation: r.data.collocation,
372 comment: r.data.comment, 371 comment: r.data.comment,
373 - // star_arr: star_arr,  
374 favorite: r.data.is_favorite, 372 favorite: r.data.is_favorite,
375 skuid_price: skuid_price, 373 skuid_price: skuid_price,
376 old_skuid_price: old_skuid_price, 374 old_skuid_price: old_skuid_price,
@@ -165,10 +165,10 @@ @@ -165,10 +165,10 @@
165 </view> 165 </view>
166 </view> 166 </view>
167 </view> 167 </view>
168 - <!-- <view class='comments_btn'> 168 + <view class='comments_btn'>
169 <view class='iconfont icon-message'></view> 169 <view class='iconfont icon-message'></view>
170 <view class='comments'>评论</view> 170 <view class='comments'>评论</view>
171 - </view> --> 171 + </view>
172 </view> 172 </view>
173 </view> 173 </view>
174 <view id='NAV{{two}}'></view> 174 <view id='NAV{{two}}'></view>
@@ -230,20 +230,6 @@ Page({ @@ -230,20 +230,6 @@ Page({
230 show_cart_mask: false 230 show_cart_mask: false
231 }); 231 });
232 }, 232 },
233 - //渲染消息  
234 - fetchNotice() {  
235 - var that = this;  
236 - var url = '/portal/index/getUserMessage'  
237 - app.post(url).then(r => {  
238 - var count = r.data.activeList.length + r.data.noticeList.length;  
239 - if (r.data.activeList != [] || r.data.noticeList != []) {  
240 - that.setData({  
241 - showNotice: true,  
242 - noticeCount: count  
243 - });  
244 - }  
245 - });  
246 - },  
247 //渲染商品列表 233 //渲染商品列表
248 fetchGoodsData() { 234 fetchGoodsData() {
249 let id = this.data.goods_id; 235 let id = this.data.goods_id;
@@ -582,12 +568,14 @@ Page({ @@ -582,12 +568,14 @@ Page({
582 let sku_values='' 568 let sku_values=''
583 app.post(url).then(r => { 569 app.post(url).then(r => {
584 for (let i = 0; i < r.data.screen.length; i++) { 570 for (let i = 0; i < r.data.screen.length; i++) {
  571 + if (r.data.screen[i].item.length>0){
585 for (let x = 0; x < r.data.screen[i].item.length; x++) { 572 for (let x = 0; x < r.data.screen[i].item.length; x++) {
586 r.data.screen[i].item[x].t = false; 573 r.data.screen[i].item[x].t = false;
587 } 574 }
588 // r.data.screen[i].item[0].t = true 575 // r.data.screen[i].item[0].t = true
589 sku_values += r.data.screen[i].item[0].attribute_value 576 sku_values += r.data.screen[i].item[0].attribute_value
590 } 577 }
  578 + }
591 579
592 var percent = 0 580 var percent = 0
593 r.data.group.forEach(function(ele, index) { 581 r.data.group.forEach(function(ele, index) {
@@ -909,7 +897,6 @@ Page({ @@ -909,7 +897,6 @@ Page({
909 this.getaddress(); 897 this.getaddress();
910 // this.category(); 898 // this.category();
911 this.fetchGoodsData(); 899 this.fetchGoodsData();
912 - this.fetchNotice();  
913 var sysInfo = wx.getSystemInfoSync(); 900 var sysInfo = wx.getSystemInfoSync();
914 var winHeight = sysInfo.windowHeight; 901 var winHeight = sysInfo.windowHeight;
915 var winWidth = sysInfo.windowWidth; 902 var winWidth = sysInfo.windowWidth;
@@ -928,6 +915,7 @@ Page({ @@ -928,6 +915,7 @@ Page({
928 wx.getLocation({ 915 wx.getLocation({
929 type: 'gcj02', //返回可以用于wx.openLocation的经纬度 916 type: 'gcj02', //返回可以用于wx.openLocation的经纬度
930 success: function(res) { 917 success: function(res) {
  918 + console.log(res)
931 var latitude = res.latitude 919 var latitude = res.latitude
932 var longitude = res.longitude 920 var longitude = res.longitude
933 qqmapsdk.reverseGeocoder({ 921 qqmapsdk.reverseGeocoder({
@@ -936,6 +924,7 @@ Page({ @@ -936,6 +924,7 @@ Page({
936 longitude: longitude 924 longitude: longitude
937 }, 925 },
938 success: function(res) { 926 success: function(res) {
  927 + console.log(res)
939 var ctiy = res.result.address_component.district 928 var ctiy = res.result.address_component.district
940 that.setData({ 929 that.setData({
941 city: ctiy 930 city: ctiy
@@ -38,15 +38,10 @@ @@ -38,15 +38,10 @@
38 <image src='{{item.image}}' class="slide-image {{currentIndex == 0 ? 'active': ''}} uiuiui"></image> 38 <image src='{{item.image}}' class="slide-image {{currentIndex == 0 ? 'active': ''}} uiuiui"></image>
39 </swiper-item> 39 </swiper-item>
40 </block> 40 </block>
41 - <block wx:for='{{special}}' wx:key='{{item.id}}'>  
42 - <swiper-item bindtap='jump_special_list' data-specialid='{{item.id}}' >  
43 - <image src='{{item.image}}' class="slide-image {{currentIndex == 0 ? 'active': ''}} uiuiui"></image>  
44 - </swiper-item>  
45 - </block>  
46 </swiper> 41 </swiper>
47 <view class='safe_box'> 42 <view class='safe_box'>
48 <view bindtap='go_mind_detect'> 43 <view bindtap='go_mind_detect'>
49 - <text class='iconfont icon-jiance'></text> 44 + <image src='../imgs/anxin.png' class='anxin'></image>
50 <text>安心检测</text> 45 <text>安心检测</text>
51 </view> 46 </view>
52 <view bindtap='go_selectSource'> 47 <view bindtap='go_selectSource'>
@@ -174,7 +169,7 @@ @@ -174,7 +169,7 @@
174 <view wx:else> 169 <view wx:else>
175 170
176 <text wx:if='{{item.group_status==1}}'>开始\t\t\t</text> 171 <text wx:if='{{item.group_status==1}}'>开始\t\t\t</text>
177 - <text wx:elif='{{item.group_status==2}}' style='margin-left:-4rpx;'>结束</text> {{item.days}}:{{item.hours}}:{{item.minutes}}:{{item.seconds}} 172 + <text wx:elif='{{item.group_status==2}}' style='margin-left:-4rpx;'>结束</text> {{item.days}}天{{item.hours}}时{{item.minutes}}分
178 </view> 173 </view>
179 </view> 174 </view>
180 </view> 175 </view>
@@ -269,7 +264,7 @@ @@ -269,7 +264,7 @@
269 264
270 265
271 <view> 266 <view>
272 - <progress show-info border-radius='4' activeColor='#ffda44' stroke-width='8' percent='{{item.percent}}' font-size='12'></progress> 267 + <progress show-info border-radius='4' activeColor='#ffda44' stroke-width='8' percent='{{item.group_number * 100/item.group_min_number}}' font-size='12'></progress>
273 <text class='group_font'>已拼{{item.group_number}}份\t\t\t\t目标{{item.group_min_number}}份</text> 268 <text class='group_font'>已拼{{item.group_number}}份\t\t\t\t目标{{item.group_min_number}}份</text>
274 <view class='good_vipbox good_vipboxs'> 269 <view class='good_vipbox good_vipboxs'>
275 <view class='good_vipbox_left'> 270 <view class='good_vipbox_left'>
@@ -8,7 +8,6 @@ page { @@ -8,7 +8,6 @@ page {
8 background-color: #fafafa; 8 background-color: #fafafa;
9 width: 100%; 9 width: 100%;
10 height: 100%; 10 height: 100%;
11 - overflow-x: hidden;  
12 } 11 }
13 .big_page{ 12 .big_page{
14 min-height: 100% 13 min-height: 100%
@@ -17,6 +16,7 @@ page { @@ -17,6 +16,7 @@ page {
17 width: 100%; 16 width: 100%;
18 height: 100%; 17 height: 100%;
19 position: relative; 18 position: relative;
  19 + overflow-x: hidden;
20 } 20 }
21 21
22 .top_fixed { 22 .top_fixed {
@@ -197,7 +197,7 @@ page { @@ -197,7 +197,7 @@ page {
197 height: 54rpx; 197 height: 54rpx;
198 background: rgba(247, 247, 247, 1); 198 background: rgba(247, 247, 247, 1);
199 border-radius: 10rpx; 199 border-radius: 10rpx;
200 - color: #888; 200 + color: #222;
201 line-height: 54rpx; 201 line-height: 54rpx;
202 text-align: center; 202 text-align: center;
203 } 203 }
@@ -554,14 +554,18 @@ page { @@ -554,14 +554,18 @@ page {
554 color: #888; 554 color: #888;
555 text-decoration: line-through; 555 text-decoration: line-through;
556 } 556 }
557 - 557 +.anxin{
  558 + width: 20rpx;
  559 + height: 31rpx;
  560 + margin-right: 10rpx
  561 +}
558 .ad_box { 562 .ad_box {
559 height: 100%; 563 height: 100%;
560 position: fixed; 564 position: fixed;
561 width: 100%; 565 width: 100%;
562 top: 0; 566 top: 0;
563 left: 0; 567 left: 0;
564 - background-color: rgba(0, 0, 0, 0.6); 568 + background-color: rgba(51,51,51,0.6);
565 z-index: 9999; 569 z-index: 9999;
566 display: flex; 570 display: flex;
567 align-items: center; 571 align-items: center;
@@ -13,12 +13,22 @@ Page({ @@ -13,12 +13,22 @@ Page({
13 get_my(){ 13 get_my(){
14 wx.navigateBack({}) 14 wx.navigateBack({})
15 }, 15 },
  16 + //进入评价详情
  17 + jump_comment_detail(e){
  18 + wx.navigateTo({
  19 + url: '../user_comment_detail/user_comment_detail?id='+e.currentTarget.dataset.id,
  20 + })
  21 + },
16 //获取评论列表 22 //获取评论列表
17 fetchCommentList(){ 23 fetchCommentList(){
18 let url ='/wxapp/product/comment?id='+this.data.gid 24 let url ='/wxapp/product/comment?id='+this.data.gid
19 app.post(url).then(r=>{ 25 app.post(url).then(r=>{
20 console.log(r) 26 console.log(r)
21 r.data.forEach(function(ele,index){ 27 r.data.forEach(function(ele,index){
  28 + ele.stars_arr = []
  29 + for (let i = 1; i < ele.goods_stars + 1; i++) {
  30 + ele.stars_arr.push(i);
  31 + }
22 ele.create_time = app.timeFormate(ele.create_time, 'YYMMDDHHMM'); 32 ele.create_time = app.timeFormate(ele.create_time, 'YYMMDDHHMM');
23 }) 33 })
24 this.setData({ 34 this.setData({
@@ -12,9 +12,17 @@ @@ -12,9 +12,17 @@
12 </view> 12 </view>
13 <view class='star_box'> 13 <view class='star_box'>
14 <view class='user_name'>{{item.full_name}}</view> 14 <view class='user_name'>{{item.full_name}}</view>
  15 + <view class='oneoneonestar'>
15 <view class='stars1'> 16 <view class='stars1'>
16 - <view class='iconfont icon-pingfen' wx:for='{{star_arr}}' wx:key='{{item}}'></view>  
17 - 17 + <view class='iconfont icon-pingfen'></view>
  18 + <view class='iconfont icon-pingfen'></view>
  19 + <view class='iconfont icon-pingfen'></view>
  20 + <view class='iconfont icon-pingfen'></view>
  21 + <view class='iconfont icon-pingfen'></view>
  22 + </view>
  23 + <view class='stars1s'>
  24 + <view class='iconfont icon-pingfen icon-pingfens' wx:for='{{item.stars_arr}}' wx:key='{{item}}'></view>
  25 + </view>
18 </view> 26 </view>
19 </view> 27 </view>
20 </view> 28 </view>
@@ -28,9 +36,9 @@ @@ -28,9 +36,9 @@
28 </view> 36 </view>
29 </view> 37 </view>
30 </view> 38 </view>
31 - <!-- <view class='comments_btn'> 39 + <view class='comments_btn' bindtap='jump_comment_detail' data-id='{{item.id}}'>
32 <view class='iconfont icon-message'></view> 40 <view class='iconfont icon-message'></view>
33 <view class='comments'>评论</view> 41 <view class='comments'>评论</view>
34 - </view> --> 42 + </view>
35 </view> 43 </view>
36 </view> 44 </view>
@@ -33,12 +33,33 @@ @@ -33,12 +33,33 @@
33 font-size: 26rpx; 33 font-size: 26rpx;
34 color: #222; 34 color: #222;
35 } 35 }
  36 +
  37 +.oneoneonestar{
  38 + position: relative
  39 +}
36 .stars1 { 40 .stars1 {
37 display: flex; 41 display: flex;
38 } 42 }
  43 +.stars1s {
  44 + width: 100%;
  45 + height: 100%;
  46 + display: flex;
  47 + position: absolute;
  48 + left: 0;
  49 + top: 0;
  50 + z-index: 1;
  51 +}
39 .icon-pingfen { 52 .icon-pingfen {
40 font-size: 26rpx; 53 font-size: 26rpx;
41 - color: #222; 54 + color: #eee;
  55 + width: 26rpx;
  56 + height: 26rpx;
  57 +}
  58 +.icon-pingfens{
  59 + font-size: 26rpx;
  60 + color:#ffda44;
  61 + width: 26rpx;
  62 + height: 26rpx;
42 } 63 }
43 .title { 64 .title {
44 font-size: 24rpx; 65 font-size: 24rpx;
@@ -72,7 +93,7 @@ @@ -72,7 +93,7 @@
72 align-items: center; 93 align-items: center;
73 font-size: 23rpx; 94 font-size: 23rpx;
74 color: #949a9a; 95 color: #949a9a;
75 - margin-top: 24rpx; 96 + margin-top: 34rpx;
76 } 97 }
77 .icon-message { 98 .icon-message {
78 font-size: 22rpx; 99 font-size: 22rpx;
  1 +// pages/index/user_comment_detail/user_comment_detail.js
  2 +const app=getApp()
  3 +Page({
  4 +
  5 + /**
  6 + * 页面的初始数据
  7 + */
  8 + data: {
  9 + id:-1,
  10 + commentList:null,
  11 + info:{},
  12 + value:''
  13 + },
  14 + //返回
  15 + get_my(){
  16 + wx.navigateBack({})
  17 + },
  18 + //渲染评论数据
  19 + fetchDetail(){
  20 + let url ='/wxapp/product/commentDetail'
  21 + let id=this.data.id
  22 + let params={
  23 + id
  24 + }
  25 + app.post(url,params).then(r=>{
  26 + if(r.code==1){
  27 + r.data.info.stars_arr = []
  28 + for (let i = 1; i < r.data.info.goods_stars + 1; i++) {
  29 + r.data.info.stars_arr.push(i);
  30 + }
  31 + r.data.info.create_time = app.timeFormate(r.data.info.create_time, 'YYMMDDHHMM');
  32 + r.data.list.forEach(function(ele,index){
  33 + ele.create_time = app.timeFormate(ele.create_time, 'YYMMDDHHMM');
  34 + })
  35 + this.setData({
  36 + commentList:r.data.list,
  37 + info:r.data.info
  38 + })
  39 + console.log(r)
  40 + }
  41 + })
  42 + },
  43 + //获取内容
  44 + fromInput(e){
  45 + console.log(e)
  46 + this.setData({
  47 + value:e.detail.value
  48 + })
  49 + },
  50 + //提交
  51 + submit(){
  52 + let value=this.data.value
  53 + if(value==''){
  54 + wx.showToast({
  55 + title: '请输入评价内容',
  56 + icon:'none'
  57 + })
  58 + return
  59 + }
  60 + let url ='/wxapp/order/replayComment'
  61 + let params={
  62 + object_id:this.data.id,
  63 + content:this.data.value
  64 + }
  65 + app.post(url,params).then(r=>{
  66 + if(r.code==1){
  67 + console.log(r)
  68 + this.fetchDetail();
  69 + this.setData({
  70 + value:''
  71 + })
  72 + }
  73 + })
  74 + },
  75 +
  76 + /**
  77 + * 生命周期函数--监听页面加载
  78 + */
  79 + onLoad: function (options) {
  80 + console.log(options)
  81 + this.setData({
  82 + id:options.id
  83 + })
  84 + this.fetchDetail();
  85 + },
  86 +
  87 + /**
  88 + * 生命周期函数--监听页面初次渲染完成
  89 + */
  90 + onReady: function () {
  91 +
  92 + },
  93 +
  94 + /**
  95 + * 生命周期函数--监听页面显示
  96 + */
  97 + onShow: function () {
  98 +
  99 + },
  100 +
  101 + /**
  102 + * 生命周期函数--监听页面隐藏
  103 + */
  104 + onHide: function () {
  105 +
  106 + },
  107 +
  108 + /**
  109 + * 生命周期函数--监听页面卸载
  110 + */
  111 + onUnload: function () {
  112 +
  113 + },
  114 +
  115 + /**
  116 + * 页面相关事件处理函数--监听用户下拉动作
  117 + */
  118 + onPullDownRefresh: function () {
  119 +
  120 + },
  121 +
  122 + /**
  123 + * 页面上拉触底事件的处理函数
  124 + */
  125 + onReachBottom: function () {
  126 +
  127 + },
  128 +
  129 + /**
  130 + * 用户点击右上角分享
  131 + */
  132 + onShareAppMessage: function () {
  133 +
  134 + }
  135 +})
  1 +<!--pages/index/user_comment/user_comment.wxml-->
  2 +<view class='page'>
  3 + <view class='banner'>
  4 + <view class='iconfont icon-fanhui' catchtap='get_my'></view>
  5 + <view class='coupons'>用户评价</view>
  6 + </view>
  7 + <view class='user_information_box'>
  8 + <view class='user_information'>
  9 + <view class='the_star'>
  10 + <view class='head_portrait'>
  11 + <image src='{{info.avatar}}'></image>
  12 + </view>
  13 + <view class='star_box'>
  14 + <view class='user_name'>{{info.full_name}}</view>
  15 + <view class='oneoneonestar'>
  16 + <view class='stars1'>
  17 + <view class='iconfont icon-pingfen'></view>
  18 + <view class='iconfont icon-pingfen'></view>
  19 + <view class='iconfont icon-pingfen'></view>
  20 + <view class='iconfont icon-pingfen'></view>
  21 + <view class='iconfont icon-pingfen'></view>
  22 + </view>
  23 + <view class='stars1s'>
  24 + <view class='iconfont icon-pingfen icon-pingfens' wx:for='{{info.stars_arr}}' wx:key='{{item}}'></view>
  25 + </view>
  26 + </view>
  27 + </view>
  28 + </view>
  29 + <view class='title'>{{info.create_time}}</view>
  30 + </view>
  31 + <view class='evaluation'>{{info.content}}</view>
  32 + <view class='comments_btn' bindtap='jump_comment_detail' data-id='{{child.id}}'>
  33 + <view class='iconfont icon-message'></view>
  34 + <view class='comments'>{{commentList.length}}</view>
  35 + </view>
  36 + </view>
  37 + <view class='user_information_box' wx:for='{{commentList}}' wx:for-index='index' wx:key='{{index}}'>
  38 + <view class='user_information'>
  39 + <view class='the_star'>
  40 + <view class='head_portrait'>
  41 + <image src='{{item.avatar}}'></image>
  42 + </view>
  43 + <view class='star_box'>
  44 + <view class='user_name'>{{item.full_name}}</view>
  45 + </view>
  46 + </view>
  47 + <view class='title'>{{item.create_time}}</view>
  48 + </view>
  49 + <view class='evaluation'>{{item.content}}</view>
  50 + <view class='comments_btn'>
  51 + <!-- <view class='iconfont icon-message'></view> -->
  52 + <text class='comments'>{{index}}\t#</text>
  53 + </view>
  54 + </view>
  55 + <view class='input_box'>
  56 + <input placeholder='Hi,快来说点什么吧~' placeholder-class='placeholder' bindchange='fromInput' class='input' value='{{value}}'/>
  57 + <view class='input_btn' bindtap='submit'>发送</view>
  58 + </view>
  59 +</view>
  1 +/* pages/index/user_comment/user_comment.wxss */
  2 +page{
  3 + width: 100%;
  4 + height: 100%;
  5 + background: #f4f4f4
  6 +}
  7 +.page{
  8 + width: 100%;
  9 + min-height: 100%;
  10 + position: relative;
  11 + padding-bottom:70rpx;
  12 + box-sizing: border-box
  13 +}
  14 +.oneoneonestar{
  15 + position: relative
  16 +}
  17 +.stars1 {
  18 + display: flex;
  19 +}
  20 +.stars1s {
  21 + width: 100%;
  22 + height: 100%;
  23 + display: flex;
  24 + position: absolute;
  25 + left: 0;
  26 + top: 0;
  27 + z-index: 1;
  28 +}
  29 +.icon-pingfen {
  30 + font-size: 26rpx;
  31 + color: #eee;
  32 + width: 26rpx;
  33 + height: 26rpx;
  34 +}
  35 +.icon-pingfens{
  36 + font-size: 26rpx;
  37 + color:#ffda44;
  38 + width: 26rpx;
  39 + height: 26rpx;
  40 +}
  41 +.user_information_box {
  42 + padding: 31rpx 25rpx 25rpx 25rpx;
  43 + box-sizing: border-box;
  44 + background: #fff;
  45 + margin-bottom:20rpx;
  46 +}
  47 +
  48 +.user_information {
  49 + display: flex;
  50 + justify-content: space-between;
  51 + align-items: center;
  52 +}
  53 +.the_star {
  54 + display: flex;
  55 + align-items: center;
  56 +}
  57 +.head_portrait {
  58 + width: 62rpx;
  59 + height: 62rpx;
  60 + border-radius: 50%;
  61 + overflow: hidden
  62 +}
  63 +
  64 +.head_portrait image {
  65 + width: 100%;
  66 + height: 100%;
  67 +}
  68 +.star_box {
  69 + margin-left: 25rpx;
  70 +}
  71 +.user_name {
  72 + font-size: 26rpx;
  73 + color: #222;
  74 +}
  75 +.title {
  76 + font-size: 24rpx;
  77 + color: #888;
  78 +}
  79 +.evaluation {
  80 + font-size: 24rpx;
  81 + color: #222;
  82 + margin-top: 25rpx;
  83 +}
  84 +.evaluation_img {
  85 + margin-top: 21rpx;
  86 +}
  87 +
  88 +.upload_img_box {
  89 + display: flex;
  90 +}
  91 +
  92 +.upload_img {
  93 + width: 160rpx;
  94 + height: 160rpx;
  95 + margin-right: 20rpx;
  96 +}
  97 +.upload_img image {
  98 + width: 100%;
  99 + height: 100%;
  100 +}
  101 +.comments_btn {
  102 + height: 20rpx;
  103 + display: flex;
  104 + justify-content: flex-end;
  105 + align-items: center;
  106 + font-size: 23rpx;
  107 + color: #949a9a;
  108 + margin-top: 34rpx;
  109 + line-height: 20rpx
  110 +}
  111 +.icon-message {
  112 + font-size: 22rpx;
  113 + color: #949a9a;
  114 + margin-right: 10rpx;
  115 +}
  116 +.input_box{
  117 + width: 100%;
  118 + height: 70rpx;
  119 + background: #fff;
  120 + position: absolute;
  121 + bottom: 0;
  122 + left: 0;
  123 +}
  124 +.placeholder{
  125 + font-size: 26rpx;
  126 + color: #888;
  127 + line-height: 70rpx;
  128 +}
  129 +.input{
  130 + width: 80%;
  131 + padding:0 16rpx;
  132 + box-sizing: border-box;
  133 + float: left;
  134 + margin-right: 2%;
  135 + font-size: 26rpx;
  136 + color: #888;
  137 + line-height: 70rpx;
  138 +}
  139 +.input_btn{
  140 + width: 16%;
  141 + height: 50rpx;
  142 + margin-top: 10rpx;
  143 + border-radius: 18rpx;
  144 + text-align: center;
  145 + line-height: 50rpx;
  146 + color: #fff;
  147 + font-size: 26rpx;
  148 + background: #ffda44;
  149 + float: left
  150 +}
@@ -9,13 +9,14 @@ Page({ @@ -9,13 +9,14 @@ Page({
9 data: { 9 data: {
10 imgUrl: app.globalData.imgUrl, 10 imgUrl: app.globalData.imgUrl,
11 msgType: 0, 11 msgType: 0,
12 - activeList: [],  
13 - noticeList: [], 12 + activeList: null,
  13 + noticeList: null,
14 url: '', 14 url: '',
15 id: '', 15 id: '',
16 long: false, 16 long: false,
17 startTime:0, 17 startTime:0,
18 - endTime:0 18 + endTime:0,
  19 + status:0
19 }, 20 },
20 //点击清空消息 21 //点击清空消息
21 clearNotice() { 22 clearNotice() {
@@ -48,18 +49,18 @@ Page({ @@ -48,18 +49,18 @@ Page({
48 }, 49 },
49 //跳转至活动详情页 50 //跳转至活动详情页
50 jump_active_detail(e) { 51 jump_active_detail(e) {
51 - if(this.endTime=this.startTime<350){ 52 + if(this.data.endTime-this.data.startTime<300){
52 let that = this 53 let that = this
53 let activeList = that.data.activeList 54 let activeList = that.data.activeList
54 let id = e.currentTarget.dataset.id 55 let id = e.currentTarget.dataset.id
55 - activeList.forEach(function (ele, index) {  
56 - if (ele.id == id) {  
57 - ele.flag = !ele.flag  
58 - }  
59 - })  
60 - that.setData({  
61 - activeList: activeList  
62 - }) 56 + // activeList.forEach(function (ele, index) {
  57 + // if (ele.id == id) {
  58 + // ele.flag = !ele.flag
  59 + // }
  60 + // })
  61 + // that.setData({
  62 + // activeList: activeList
  63 + // })
63 wx.navigateTo({ 64 wx.navigateTo({
64 url: '../notice_detail/notice_detail?id=' + e.currentTarget.dataset.id, 65 url: '../notice_detail/notice_detail?id=' + e.currentTarget.dataset.id,
65 }) 66 })
@@ -93,6 +94,57 @@ Page({ @@ -93,6 +94,57 @@ Page({
93 noticeList: noticeList 94 noticeList: noticeList
94 }) 95 })
95 }, 96 },
  97 + //点击通知详情
  98 + dianji(e){
  99 + let id=e.currentTarget.dataset.objid
  100 + let that=this
  101 + let status=0
  102 + if (that.data.endTime - that.data.startTime < 300){
  103 + let url ='/wxapp/order/index'
  104 + let params={
  105 + status:0
  106 + }
  107 + app.post(url,params).then(r=>{
  108 + if(r.code==1){
  109 + console.log(r)
  110 + r.data.forEach(function(ele,index){
  111 + if(id==ele.id){
  112 + status = ele.status
  113 + if (status == 1) {
  114 + wx.navigateTo({
  115 + url: '../unpayOrderDetail/unpayOrderDetail?id=' + id,
  116 + })
  117 + } else if (status == 2) {
  118 + wx.navigateTo({
  119 + url: '../unship/unship?id=' + id,
  120 + })
  121 + } else if (status == 3) {
  122 + wx.navigateTo({
  123 + url: '../wait_receite/wait_receite?id=' + id
  124 + })
  125 + } else if (status == 4 || status == 5) {
  126 + console.log(1212)
  127 + wx.navigateTo({
  128 + url: '../uncomment/uncomment?id=' + id,
  129 + })
  130 + } else if (status == 8) {
  131 + wx.showToast({
  132 + title: '订单已取消',
  133 + icon: 'none'
  134 + })
  135 + } else if (status == 9) {
  136 + wx.navigateTo({
  137 + url: '../aftermarketDetail/aftermarketDetail?id=' + id,
  138 + })
  139 + }
  140 + }
  141 + })
  142 + }
  143 + })
  144 + }else{
  145 + return
  146 + }
  147 + },
96 //点击删除 148 //点击删除
97 deleteconfirm(e) { 149 deleteconfirm(e) {
98 let that = this 150 let that = this
@@ -124,13 +176,14 @@ Page({ @@ -124,13 +176,14 @@ Page({
124 //按压开始 176 //按压开始
125 touchstart(e){ 177 touchstart(e){
126 this.setData({ 178 this.setData({
127 - startTime : e.timeStamp 179 + startTime: e.timeStamp
128 }) 180 })
129 }, 181 },
130 //按压结束 182 //按压结束
131 touchend(e){ 183 touchend(e){
  184 + console.log(e)
132 this.setData({ 185 this.setData({
133 - endTime : e.timeStamp 186 + endTime: e.timeStamp
134 }) 187 })
135 }, 188 },
136 /** 189 /**
@@ -17,6 +17,7 @@ @@ -17,6 +17,7 @@
17 </view> 17 </view>
18 18
19 <view class='content_item' hidden='{{msgType==1}}'> 19 <view class='content_item' hidden='{{msgType==1}}'>
  20 + <view class='da'>
20 <view wx:if='{{activeList.length>0}}'> 21 <view wx:if='{{activeList.length>0}}'>
21 <view class='item_list' wx:for='{{activeList}}' wx:key='{{item.id}}' data-id='{{item.id}}' bindtouchstart='touchstart' bindtouchend='touchend' bindtap='jump_active_detail' bindlongtap='longtap'> 22 <view class='item_list' wx:for='{{activeList}}' wx:key='{{item.id}}' data-id='{{item.id}}' bindtouchstart='touchstart' bindtouchend='touchend' bindtap='jump_active_detail' bindlongtap='longtap'>
22 <image src='../../imgs/deleteicon.png' class='deleteicon' wx:if='{{item.flag}}' data-id='{{item.id}}' catchtap='deleteconfirm'></image> 23 <image src='../../imgs/deleteicon.png' class='deleteicon' wx:if='{{item.flag}}' data-id='{{item.id}}' catchtap='deleteconfirm'></image>
@@ -45,12 +46,16 @@ @@ -45,12 +46,16 @@
45 </view> 46 </view>
46 </view> 47 </view>
47 </view> 48 </view>
48 - <view class='gogogo' wx:else>暂无活动消息</view> 49 + <view class='gogogo' wx:if='{{activeList.length==0}}'>
  50 + <image src='../../imgs/noMessage.png'></image>
  51 + <view>您暂时没有消息哦</view>
  52 + </view>
  53 + </view>
49 </view> 54 </view>
50 <view class='content_item' hidden='{{msgType==0}}'> 55 <view class='content_item' hidden='{{msgType==0}}'>
51 - <view> 56 + <view class='da'>
52 <view wx:if='{{noticeList.length>0}}'> 57 <view wx:if='{{noticeList.length>0}}'>
53 - <view class='item_list1' wx:for='{{noticeList}}' wx:key='{{item.id}}' data-id='{{item.id}}' catchlongtap='longtap'> 58 + <view class='item_list1' wx:for='{{noticeList}}' wx:key='{{item.id}}' data-id='{{item.id}}' catchlongtap='longtap' bindtouchstart='touchstart' bindtouchend='touchend' data-objid='{{item.object_id}}' bindtap='dianji' >
54 <image src='../../imgs/deleteicon.png' class='deleteicon' data-id='{{item.id}}' catchtap='deleteconfirm' wx:if='{{item.flag}}'></image> 59 <image src='../../imgs/deleteicon.png' class='deleteicon' data-id='{{item.id}}' catchtap='deleteconfirm' wx:if='{{item.flag}}'></image>
55 <view class='item_top'> 60 <view class='item_top'>
56 <view class='list_left'> 61 <view class='list_left'>
@@ -59,7 +64,7 @@ @@ -59,7 +64,7 @@
59 </view> 64 </view>
60 <view> 65 <view>
61 <view class='head_portrait'> 66 <view class='head_portrait'>
62 - <image src='{{item.more.thumbnail}}'></image> 67 + <image src='{{item.thumbnail}}' wx:if='{{item.thumbnail!=""}}'></image>
63 </view> 68 </view>
64 </view> 69 </view>
65 </view> 70 </view>
@@ -69,6 +74,9 @@ @@ -69,6 +74,9 @@
69 </view> 74 </view>
70 </view> 75 </view>
71 </view> 76 </view>
72 - <view wx:else class='gogogo'>暂无通知消息</view> 77 + <view wx:if='{{noticeList.length==0}}' class='gogogo'>
  78 + <image src='../../imgs/noMessage.png'></image>
  79 + <view>您暂时没有消息哦</view>
  80 + </view>
73 </view> 81 </view>
74 </view> 82 </view>
@@ -4,11 +4,36 @@ page { @@ -4,11 +4,36 @@ page {
4 flex-flow: column; 4 flex-flow: column;
5 height: 100%; 5 height: 100%;
6 } 6 }
  7 +.da{
  8 + width: 100%;
  9 + height: 100%;
  10 +}
7 .gogogo{ 11 .gogogo{
  12 + width: 100%;
  13 + height: 100%;
8 text-align: center; 14 text-align: center;
9 line-height: 500rpx; 15 line-height: 500rpx;
10 color: #888; 16 color: #888;
11 font-size: 32rpx; 17 font-size: 32rpx;
  18 + position: relative;
  19 +}
  20 +.gogogo image{
  21 + height: 247rpx;
  22 + width: 340rpx;
  23 + position: absolute;
  24 + top: 50%;
  25 + left: 50%;
  26 + transform: translate(-50%,-70%)
  27 +}
  28 +.gogogo view{
  29 + font-size:26rpx;
  30 + font-family:PingFang-SC-Medium;
  31 + font-weight:500;
  32 + color:rgba(136,136,136,1);
  33 + position: absolute;
  34 + left: 50%;
  35 + transform: translate(-50%,-20%);
  36 + top: 50%
12 } 37 }
13 .banner { 38 .banner {
14 height: 86rpx; 39 height: 86rpx;
@@ -52,6 +77,8 @@ page { @@ -52,6 +77,8 @@ page {
52 } 77 }
53 78
54 .content_item { 79 .content_item {
  80 + width: 100%;
  81 + height: calc(100% - 160rpx);
55 padding: 0 25rpx; 82 padding: 0 25rpx;
56 flex: 1; 83 flex: 1;
57 overflow-y:scroll; 84 overflow-y:scroll;
@@ -40,6 +40,9 @@ @@ -40,6 +40,9 @@
40 </view> 40 </view>
41 </view> 41 </view>
42 </view> 42 </view>
43 - <view class='gogogo' wx:if='{{orderList.length==0}}'>暂无消息</view> 43 + <view class='gogogo' wx:if='{{orderList.length==0}}'>
  44 + <image src='../../imgs/noMessage.png'></image>
  45 + <view>您暂时没有消息哦</view>
  46 + </view>
44 </view> 47 </view>
45 </view> 48 </view>
1 /* pages/my/afterMarketList/afterMarketList.wxss */ 1 /* pages/my/afterMarketList/afterMarketList.wxss */
2 page{ 2 page{
3 - background: #fafafa 3 + background: #fafafa;
  4 + width: 100%;
  5 + height: 100%
  6 +}
  7 +.page{
  8 + width: 100%;
  9 + height: 100%
4 } 10 }
5 .item_list { 11 .item_list {
6 background-color: #fff; 12 background-color: #fff;
7 padding: 24rpx 27rpx; 13 padding: 24rpx 27rpx;
8 margin-top: 20rpx; 14 margin-top: 20rpx;
9 } 15 }
  16 +.content_item{
  17 + height: calc(100% - 100rpx)
  18 +}
10 .gogogo{ 19 .gogogo{
  20 + width: 100%;
  21 + height: 100%;
11 text-align: center; 22 text-align: center;
12 line-height: 500rpx; 23 line-height: 500rpx;
13 color: #888; 24 color: #888;
14 font-size: 32rpx; 25 font-size: 32rpx;
  26 + position: relative;
  27 +}
  28 +.gogogo image{
  29 + height: 247rpx;
  30 + width: 340rpx;
  31 + position: absolute;
  32 + top: 50%;
  33 + left: 50%;
  34 + transform: translate(-50%,-70%)
  35 +}
  36 +.gogogo view{
  37 + font-size:26rpx;
  38 + font-family:PingFang-SC-Medium;
  39 + font-weight:500;
  40 + color:rgba(136,136,136,1);
  41 + position: absolute;
  42 + left: 50%;
  43 + transform: translate(-50%,-20%);
  44 + top: 50%
15 } 45 }
16 .list_title { 46 .list_title {
17 font-size: 26rpx; 47 font-size: 26rpx;
@@ -37,6 +37,12 @@ Page({ @@ -37,6 +37,12 @@ Page({
37 name: '其他原因' 37 name: '其他原因'
38 }], 38 }],
39 }, 39 },
  40 + //查看评价
  41 + goComments(e){
  42 + wx.navigateTo({
  43 + url: '../showComment/showComment?id='+e.currentTarget.dataset.id,
  44 + })
  45 + },
40 //jump_user跳转用户指南 46 //jump_user跳转用户指南
41 jump_user() { 47 jump_user() {
42 wx.navigateTo({ 48 wx.navigateTo({
@@ -131,6 +137,7 @@ Page({ @@ -131,6 +137,7 @@ Page({
131 * 生命周期函数--监听页面加载 137 * 生命周期函数--监听页面加载
132 */ 138 */
133 onLoad: function (options) { 139 onLoad: function (options) {
  140 + console.log(options)
134 this.setData({ 141 this.setData({
135 order_sn: options.id 142 order_sn: options.id
136 }) 143 })
@@ -10,6 +10,7 @@ @@ -10,6 +10,7 @@
10 <view class='state'> 10 <view class='state'>
11 <view class='wait_pay'>售后服务</view> 11 <view class='wait_pay'>售后服务</view>
12 <view class='state_btn'> 12 <view class='state_btn'>
  13 + <view class='cancel_order' bindtap='goComments' data-id='{{orderInfo.id}}'>查看评价</view>
13 <view class='pay' bindtap='after_order' data-orderid='{{orderInfo.id}}'>申请售后</view> 14 <view class='pay' bindtap='after_order' data-orderid='{{orderInfo.id}}'>申请售后</view>
14 </view> 15 </view>
15 </view> 16 </view>
@@ -59,12 +59,12 @@ height:50rpx; @@ -59,12 +59,12 @@ height:50rpx;
59 width: 140rpx; 59 width: 140rpx;
60 height: 50rpx; 60 height: 50rpx;
61 font-size: 24rpx; 61 font-size: 24rpx;
62 - color: #333333; 62 + color: #333;
63 border-radius: 25rpx; 63 border-radius: 25rpx;
64 text-align: center; 64 text-align: center;
65 line-height: 50rpx; 65 line-height: 50rpx;
66 - border: 1rpx solid #949a9a;  
67 - margin-left: 24rpx; 66 + background: #fff;
  67 + margin-right: 24rpx;
68 } 68 }
69 69
70 .content_item { 70 .content_item {
@@ -15,9 +15,9 @@ Page({ @@ -15,9 +15,9 @@ Page({
15 tag: "知名情感博主", 15 tag: "知名情感博主",
16 answer: 134, 16 answer: 134,
17 listen: 2234, 17 listen: 2234,
18 - over:[],  
19 - unuse:[],  
20 - uses:[] 18 + over:null,
  19 + unuse:null,
  20 + uses:null
21 }], 21 }],
22 use:1, 22 use:1,
23 open:false, 23 open:false,
1 <!--pages/my/coupons/coupons.wxml--> 1 <!--pages/my/coupons/coupons.wxml-->
2 -<view> 2 +<view class='page'>
3 <view class='banner'> 3 <view class='banner'>
4 <view class='iconfont icon-fanhui' bindtap='get_back'></view> 4 <view class='iconfont icon-fanhui' bindtap='get_back'></view>
5 <view class='coupons'>优惠券</view> 5 <view class='coupons'>优惠券</view>
@@ -10,6 +10,7 @@ @@ -10,6 +10,7 @@
10 <view class='{{use===3?"use":""}}' bindtap='changeUse3'>已过期</view> 10 <view class='{{use===3?"use":""}}' bindtap='changeUse3'>已过期</view>
11 </view> 11 </view>
12 <block wx:if='{{use===1}}'> 12 <block wx:if='{{use===1}}'>
  13 + <view wx:if='{{unuse.length!=0}}'>
13 <view class='item_list_boxs' wx:for='{{unuse}}' wx:key='{{item.id}}'> 14 <view class='item_list_boxs' wx:for='{{unuse}}' wx:key='{{item.id}}'>
14 <view class='item_list'> 15 <view class='item_list'>
15 <view class='right_top_circle'>{{item.title}}</view> 16 <view class='right_top_circle'>{{item.title}}</view>
@@ -33,23 +34,35 @@ @@ -33,23 +34,35 @@
33 <view class='limit_values'>可使用商品,仅限{{item.limit_values}}</view> 34 <view class='limit_values'>可使用商品,仅限{{item.limit_values}}</view>
34 </view> 35 </view>
35 </view> 36 </view>
  37 + </view>
  38 + <view class='gogogo' wx:if='{{unuse.length==0}}'>
  39 + <image src='../../imgs/noMessage.png'></image>
  40 + <view>您暂时没有没使用的优惠券哦</view>
  41 + </view>
36 </block> 42 </block>
37 <block wx:if='{{use===2}}'> 43 <block wx:if='{{use===2}}'>
  44 + <view wx:if='{{used.length!=0}}'>
38 <view class='item_list item_list_list' wx:for='{{used}}' wx:key='{{item.id}}'> 45 <view class='item_list item_list_list' wx:for='{{used}}' wx:key='{{item.id}}'>
39 <view class='list_character'> 46 <view class='list_character'>
40 <view class='money'> 47 <view class='money'>
41 <text>¥</text>{{item.price}} 48 <text>¥</text>{{item.price}}
42 </view> 49 </view>
43 <view class='sale'>{{item.title}}</view> 50 <view class='sale'>{{item.title}}</view>
44 - <!--满200元可用(仅限蔬菜类目) --> 51 + <!-- 满200元可用(仅限蔬菜类目) -->
45 <view> 52 <view>
46 <view class='data' wx:if='{{item.end_time!=0}}'>有效期至:{{item.end_time}}</view> 53 <view class='data' wx:if='{{item.end_time!=0}}'>有效期至:{{item.end_time}}</view>
47 <view class='data' wx:else></view> 54 <view class='data' wx:else></view>
48 </view> 55 </view>
49 </view> 56 </view>
50 </view> 57 </view>
  58 + </view>
  59 + <view class='gogogo' wx:if='{{used.length==0}}'>
  60 + <image src='../../imgs/noMessage.png'></image>
  61 + <view>您暂时没有已使用的优惠券哦</view>
  62 + </view>
51 </block> 63 </block>
52 <block wx:if='{{use===3}}'> 64 <block wx:if='{{use===3}}'>
  65 + <view wx:if='{{over.length!=0}}'>
53 <view class='item_list item_list_list' wx:for='{{over}}' wx:key='{{item.id}}'> 66 <view class='item_list item_list_list' wx:for='{{over}}' wx:key='{{item.id}}'>
54 <view class='list_character'> 67 <view class='list_character'>
55 <view class='money'> 68 <view class='money'>
@@ -62,5 +75,10 @@ @@ -62,5 +75,10 @@
62 </view> 75 </view>
63 </view> 76 </view>
64 </view> 77 </view>
  78 + </view>
  79 + <view class='{{over.length==0}}' class='gogogo'>
  80 + <image src='../../imgs/noMessage.png'></image>
  81 + <view>您暂时没有已过期的优惠券哦</view>
  82 + </view>
65 </block> 83 </block>
66 </view> 84 </view>
1 page { 1 page {
  2 + width: 100%;
  3 + height: 100%;
2 background-color: #fafafa; 4 background-color: #fafafa;
3 } 5 }
4 - 6 +.page{
  7 + width: 100%;
  8 + height: 100%
  9 +}
  10 +.gogogo{
  11 + width: 100%;
  12 + height: calc(100% - 170rpx);
  13 + text-align: center;
  14 + line-height: 500rpx;
  15 + color: #888;
  16 + font-size: 32rpx;
  17 + position: relative;
  18 +}
  19 +.gogogo image{
  20 + height: 247rpx;
  21 + width: 340rpx;
  22 + position: absolute;
  23 + top: 50%;
  24 + left: 50%;
  25 + transform: translate(-50%,-70%)
  26 +}
  27 +.gogogo view{
  28 + font-size:26rpx;
  29 + font-family:PingFang-SC-Medium;
  30 + font-weight:500;
  31 + color:rgba(136,136,136,1);
  32 + position: absolute;
  33 + left: 50%;
  34 + transform: translate(-50%,-20%);
  35 + top: 50%
  36 +}
5 .banner { 37 .banner {
6 height: 86rpx; 38 height: 86rpx;
7 width: 100%; 39 width: 100%;
@@ -29,7 +61,6 @@ page { @@ -29,7 +61,6 @@ page {
29 font-size: 28rpx; 61 font-size: 28rpx;
30 color: #222; 62 color: #222;
31 border-bottom: 1rpx solid #ededed; 63 border-bottom: 1rpx solid #ededed;
32 - margin-bottom:46rpx;  
33 } 64 }
34 65
35 .use{ 66 .use{
@@ -47,7 +78,7 @@ page { @@ -47,7 +78,7 @@ page {
47 } 78 }
48 79
49 .item_list_boxs{ 80 .item_list_boxs{
50 - /* height: 360rpx */ 81 + margin-top:46rpx;
51 } 82 }
52 83
53 .item_list,.item_list_list { 84 .item_list,.item_list_list {
@@ -2,8 +2,8 @@ @@ -2,8 +2,8 @@
2 <view class='page {{is_mobile||popup_state?"active":""}}'> 2 <view class='page {{is_mobile||popup_state?"active":""}}'>
3 <view class='biggest_box'> 3 <view class='biggest_box'>
4 <view class='banner_box'> 4 <view class='banner_box'>
5 - <view class='hint_box' bindtap='signIn'>  
6 - <view class='sign_in_box1'> 5 + <view class='hint_box'>
  6 + <view class='sign_in_box1' bindtap='signIn'>
7 <view class='iconfont icon-qiandao'></view> 7 <view class='iconfont icon-qiandao'></view>
8 <view>签到</view> 8 <view>签到</view>
9 </view> 9 </view>
@@ -74,28 +74,28 @@ @@ -74,28 +74,28 @@
74 <view class='order_item' bindtap='get_obligation2'> 74 <view class='order_item' bindtap='get_obligation2'>
75 <view class='small_red_dot_order' wx:if='{{orderState2}}'>{{order2}}</view> 75 <view class='small_red_dot_order' wx:if='{{orderState2}}'>{{order2}}</view>
76 <view class='content_img'> 76 <view class='content_img'>
77 - <image src='{{imgUrl}}aicon44__2.png' class='iconfont0'></image> 77 + <image src='{{imgUrl}}aicon44__2.png' class='iconfont1'></image>
78 </view> 78 </view>
79 <view>待发货</view> 79 <view>待发货</view>
80 </view> 80 </view>
81 <view class='order_item' bindtap='get_obligation3'> 81 <view class='order_item' bindtap='get_obligation3'>
82 <view class='small_red_dot_order' wx:if='{{orderState3}}'>{{order3}}</view> 82 <view class='small_red_dot_order' wx:if='{{orderState3}}'>{{order3}}</view>
83 <view class='content_img'> 83 <view class='content_img'>
84 - <image src='{{imgUrl}}aicon44__3.png' class='iconfont0'></image> 84 + <image src='{{imgUrl}}aicon44__3.png' class='iconfont2'></image>
85 </view> 85 </view>
86 <view>待收货</view> 86 <view>待收货</view>
87 </view> 87 </view>
88 <view class='order_item' bindtap='get_obligation4'> 88 <view class='order_item' bindtap='get_obligation4'>
89 <view class='small_red_dot_order' wx:if='{{orderState4}}'>{{order4}}</view> 89 <view class='small_red_dot_order' wx:if='{{orderState4}}'>{{order4}}</view>
90 <view class='content_img'> 90 <view class='content_img'>
91 - <image src='{{imgUrl}}aicon44__4.png' class='iconfont0'></image> 91 + <image src='{{imgUrl}}aicon44__4.png' class='iconfont4'></image>
92 </view> 92 </view>
93 <view>待评价</view> 93 <view>待评价</view>
94 </view> 94 </view>
95 <view class='order_item' bindtap='jump_afterMarket'> 95 <view class='order_item' bindtap='jump_afterMarket'>
96 <view class='small_red_dot_order' wx:if='{{orderState9}}'>{{order9}}</view> 96 <view class='small_red_dot_order' wx:if='{{orderState9}}'>{{order9}}</view>
97 <view class='content_img'> 97 <view class='content_img'>
98 - <image src='{{imgUrl}}aicon44__5.png' class='iconfont0'></image> 98 + <image src='{{imgUrl}}aicon44__5.png' class='iconfont5'></image>
99 </view> 99 </view>
100 <view>售后</view> 100 <view>售后</view>
101 </view> 101 </view>
@@ -7,7 +7,8 @@ page { @@ -7,7 +7,8 @@ page {
7 } 7 }
8 .page{ 8 .page{
9 width: 100%; 9 width: 100%;
10 - height: 100% 10 + height: 100%;
  11 + overflow-x: hidden
11 } 12 }
12 .page.active{ 13 .page.active{
13 overflow: hidden 14 overflow: hidden
@@ -219,7 +220,7 @@ page { @@ -219,7 +220,7 @@ page {
219 } 220 }
220 221
221 .iconfont0 { 222 .iconfont0 {
222 - width: 50rpx; 223 + width: 49rpx;
223 height: 36rpx; 224 height: 36rpx;
224 } 225 }
225 .iconfont1 { 226 .iconfont1 {
@@ -235,8 +236,12 @@ page { @@ -235,8 +236,12 @@ page {
235 height: 36rpx; 236 height: 36rpx;
236 } 237 }
237 .iconfont4 { 238 .iconfont4 {
  239 + width: 55rpx;
  240 + height: 36rpx;
  241 +}
  242 +.iconfont5 {
238 width: 54rpx; 243 width: 54rpx;
239 - height: 44rpx; 244 + height: 43rpx;
240 } 245 }
241 246
242 .my_order { 247 .my_order {
@@ -538,9 +543,11 @@ background:rgba(239,241,246,1); @@ -538,9 +543,11 @@ background:rgba(239,241,246,1);
538 .popup_btn { 543 .popup_btn {
539 width: 500rpx; 544 width: 500rpx;
540 height: 70rpx; 545 height: 70rpx;
541 - font-size: 30rpx;  
542 - color: #f44;  
543 - border: 1rpx solid #f44; 546 + font-size:30rpx;
  547 +font-family:PingFang-SC-Medium;
  548 +font-weight:500;
  549 +color:rgba(255,68,68,1);
  550 + border: 2rpx solid #f44;
544 border-radius: 35rpx; 551 border-radius: 35rpx;
545 display: flex; 552 display: flex;
546 align-items: center; 553 align-items: center;
@@ -8,13 +8,13 @@ Page({ @@ -8,13 +8,13 @@ Page({
8 data: { 8 data: {
9 choose: false, 9 choose: false,
10 navId:-1, 10 navId:-1,
11 - collectionList:[], 11 + collectionList:null,
12 parentId:0, 12 parentId:0,
13 manage:false, 13 manage:false,
14 chooseAll:false, 14 chooseAll:false,
15 cid:0, 15 cid:0,
16 id:0, 16 id:0,
17 - arr:[] 17 + arr:null
18 }, 18 },
19 //点击管理 19 //点击管理
20 manage_relative(){ 20 manage_relative(){
@@ -47,6 +47,7 @@ fetchCollection(){ @@ -47,6 +47,7 @@ fetchCollection(){
47 that.setData({ 47 that.setData({
48 collectionList: r.data, 48 collectionList: r.data,
49 navId: r.data[0].id, 49 navId: r.data[0].id,
  50 + parentId:r.data[0].id,
50 arr: r.data[0].childList 51 arr: r.data[0].childList
51 }) 52 })
52 }else{ 53 }else{
@@ -69,7 +70,7 @@ fetch(){ @@ -69,7 +70,7 @@ fetch(){
69 } 70 }
70 }) 71 })
71 that.setData({ 72 that.setData({
72 - arr:arr 73 + arr:arr,
73 }) 74 })
74 }, 75 },
75 //选择删除 76 //选择删除
@@ -194,6 +195,7 @@ deleteGoods(){ @@ -194,6 +195,7 @@ deleteGoods(){
194 changeId(e){ 195 changeId(e){
195 this.setData({ 196 this.setData({
196 navId:e.currentTarget.dataset.id, 197 navId:e.currentTarget.dataset.id,
  198 + parentId: e.currentTarget.dataset.id
197 }); 199 });
198 this.fetch() 200 this.fetch()
199 }, 201 },
1 <!--pages/my/myCollection/myCollection.wxml--> 1 <!--pages/my/myCollection/myCollection.wxml-->
2 -<view> 2 +<view class='page'>
3 <view class='banner'> 3 <view class='banner'>
4 <view class='iconfont icon-fanhui' catchtap='get_my'></view> 4 <view class='iconfont icon-fanhui' catchtap='get_my'></view>
5 <view class='coupons'>我的收藏</view> 5 <view class='coupons'>我的收藏</view>
6 <view class='complete' bindtap='manage_relative'>管理</view> 6 <view class='complete' bindtap='manage_relative'>管理</view>
7 </view> 7 </view>
8 8
  9 +<view wx:if='{{collectionList!=0}}'>
9 <view class='select_list'> 10 <view class='select_list'>
10 <view bindtap='changeId' data-id='{{cell.id}}' class='select_list_item {{navId==cell.id?"active":""}}' wx:for='{{collectionList}}' wx:for-index='cellindex' wx:key='{{cellindex}}' wx:for-item='cell'>{{cell.name}}</view> 11 <view bindtap='changeId' data-id='{{cell.id}}' class='select_list_item {{navId==cell.id?"active":""}}' wx:for='{{collectionList}}' wx:for-index='cellindex' wx:key='{{cellindex}}' wx:for-item='cell'>{{cell.name}}</view>
11 </view> 12 </view>
12 13
13 - <!-- <block wx:if='{{navId==parentId}}'> -->  
14 - <view class='content_item'> 14 + <block wx:if='{{navId==parentId}}'>
  15 + <view class='content_item' wx:if='{{arr.length!=0}}'>
15 <view class='item_list' wx:for='{{arr}}' wx:for-item='item' wx:for-index='index' wx:key='{{index}}' bindtap="get_goodsDetail"data-index='{{index}}' data-id='{{item.id}}'> 16 <view class='item_list' wx:for='{{arr}}' wx:for-item='item' wx:for-index='index' wx:key='{{index}}' bindtap="get_goodsDetail"data-index='{{index}}' data-id='{{item.id}}'>
16 <view class='iconfont icon-xuanzhong {{item.t?"active":""}}' wx:if='{{manage}}' catchtap='choose_del' data-fid='{{item.favorite_id}}' data-id='{{item.id}}' data-flag='{{item.t}}' data-index='{{index}}'></view> 17 <view class='iconfont icon-xuanzhong {{item.t?"active":""}}' wx:if='{{manage}}' catchtap='choose_del' data-fid='{{item.favorite_id}}' data-id='{{item.id}}' data-flag='{{item.t}}' data-index='{{index}}'></view>
17 <view class='content_img' > 18 <view class='content_img' >
@@ -33,7 +34,16 @@ @@ -33,7 +34,16 @@
33 </view> 34 </view>
34 </view> 35 </view>
35 </view> 36 </view>
36 - <!-- </block> --> 37 + <view wx:if='{{arr.length==0}}' class='da'>
  38 + <image src='../../imgs/noMessage.png'></image>
  39 + <view>您暂时没有消息哦</view>
  40 +</view>
  41 + </block>
  42 +</view>
  43 +<view wx:if='{{collectionList.length==0}}' class='gogogo'>
  44 + <image src='../../imgs/noMessage.png'></image>
  45 + <view>您暂时没有消息哦</view>
  46 +</view>
37 <view class='bottom_btn' wx:if='{{manage}}'> 47 <view class='bottom_btn' wx:if='{{manage}}'>
38 <view class='all_btn' bindtap='chooseAllDel'> 48 <view class='all_btn' bindtap='chooseAllDel'>
39 <view class='iconfont icon-xuanzhong {{chooseAll?"active":""}}' ></view> 49 <view class='iconfont icon-xuanzhong {{chooseAll?"active":""}}' ></view>
1 /* pages/my/myCollection/myCollection.wxss */ 1 /* pages/my/myCollection/myCollection.wxss */
2 2
3 page { 3 page {
  4 + width: 100%;
  5 + height: 100%;
4 background-color: #fafafa; 6 background-color: #fafafa;
5 } 7 }
6 - 8 +.page{
  9 + width: 100%;
  10 + height: 100%
  11 +}
  12 +.gogogo{
  13 + width: 100%;
  14 + height: calc(100% - 86rpx);
  15 + text-align: center;
  16 + line-height: 500rpx;
  17 + color: #888;
  18 + font-size: 32rpx;
  19 + position: relative;
  20 +}
  21 +.da{
  22 + width: 100%;
  23 + height: calc(100% - 160rpx);
  24 + text-align: center;
  25 + line-height: 500rpx;
  26 + color: #888;
  27 + font-size: 32rpx;
  28 + position: relative;
  29 +}
  30 +.da image{
  31 + height: 247rpx;
  32 + width: 340rpx;
  33 + position: absolute;
  34 + top: 50%;
  35 + left: 50%;
  36 + transform: translate(-50%,-70%)
  37 +}
  38 +.da view{
  39 + font-size:26rpx;
  40 + font-family:PingFang-SC-Medium;
  41 + font-weight:500;
  42 + color:rgba(136,136,136,1);
  43 + position: absolute;
  44 + left: 50%;
  45 + transform: translate(-50%,-20%);
  46 + top: 50%
  47 +}
  48 +.gogogo image{
  49 + height: 247rpx;
  50 + width: 340rpx;
  51 + position: absolute;
  52 + top: 50%;
  53 + left: 50%;
  54 + transform: translate(-50%,-70%)
  55 +}
  56 +.gogogo view{
  57 + font-size:26rpx;
  58 + font-family:PingFang-SC-Medium;
  59 + font-weight:500;
  60 + color:rgba(136,136,136,1);
  61 + position: absolute;
  62 + left: 50%;
  63 + transform: translate(-50%,-20%);
  64 + top: 50%
  65 +}
7 .select_list { 66 .select_list {
8 height: 75rpx; 67 height: 75rpx;
9 /* display: flex; 68 /* display: flex;
@@ -62,7 +62,10 @@ @@ -62,7 +62,10 @@
62 </view> 62 </view>
63 </view> 63 </view>
64 </view> 64 </view>
65 - <view class='gogogo' wx:if='{{orderList.length==0}}'>暂无订单</view> 65 + <view class='gogogo' wx:if='{{orderList.length==0}}'>
  66 + <image src='../../imgs/no.png'></image>
  67 + <view>您暂时没有订单哦</view>
  68 + </view>
66 </view> 69 </view>
67 </block> 70 </block>
68 <block wx:if='{{navId==2}}'> 71 <block wx:if='{{navId==2}}'>
@@ -98,7 +101,10 @@ @@ -98,7 +101,10 @@
98 </view> 101 </view>
99 </view> 102 </view>
100 </view> 103 </view>
101 - <view class='gogogo' wx:else>暂无订单</view> 104 + <view class='gogogo' wx:if='{{orderList.length==0}}'>
  105 + <image src='../../imgs/no.png'></image>
  106 + <view>您暂时没有待付款的订单哦</view>
  107 + </view>
102 </view> 108 </view>
103 </block> 109 </block>
104 <block wx:if='{{navId==3}}'> 110 <block wx:if='{{navId==3}}'>
@@ -129,7 +135,10 @@ @@ -129,7 +135,10 @@
129 </view> 135 </view>
130 </view> 136 </view>
131 </view> 137 </view>
132 - <view wx:else class='gogogo'>暂无订单</view> 138 + <view class='gogogo' wx:if='{{orderList.length==0}}'>
  139 + <image src='../../imgs/no.png'></image>
  140 + <view>您暂时没有待发货的订单哦</view>
  141 + </view>
133 </view> 142 </view>
134 </block> 143 </block>
135 <block wx:if='{{navId==4}}'> 144 <block wx:if='{{navId==4}}'>
@@ -160,7 +169,10 @@ @@ -160,7 +169,10 @@
160 </view> 169 </view>
161 </view> 170 </view>
162 </view> 171 </view>
163 - <view class='gogogo' wx:else>暂无订单</view> 172 + <view class='gogogo' wx:if='{{orderList.length==0}}'>
  173 + <image src='../../imgs/no.png'></image>
  174 + <view>您暂时没有待收货的订单哦</view>
  175 + </view>
164 </view> 176 </view>
165 </block> 177 </block>
166 <block wx:if='{{navId==5}}'> 178 <block wx:if='{{navId==5}}'>
@@ -191,7 +203,10 @@ @@ -191,7 +203,10 @@
191 </view> 203 </view>
192 </view> 204 </view>
193 </view> 205 </view>
194 - <view wx:else class='gogogo'>暂无消息</view> 206 + <view class='gogogo' wx:if='{{orderList.length==0}}'>
  207 + <image src='../../imgs/no.png'></image>
  208 + <view>您暂时没有待评价的订单哦</view>
  209 + </view>
195 </view> 210 </view>
196 </block> 211 </block>
197 <block wx:if='{{navId==6}}'> 212 <block wx:if='{{navId==6}}'>
@@ -224,7 +239,10 @@ @@ -224,7 +239,10 @@
224 239
225 </view> 240 </view>
226 </view> 241 </view>
227 - <view class='gogogo' wx:else>暂无信息</view> 242 + <view class='gogogo' wx:if='{{orderList.length==0}}'>
  243 + <image src='../../imgs/no.png'></image>
  244 + <view>您暂时没有完成的订单哦</view>
  245 + </view>
228 </view> 246 </view>
229 </block> 247 </block>
230 </view> 248 </view>
@@ -5,11 +5,39 @@ page { @@ -5,11 +5,39 @@ page {
5 width: 100%; 5 width: 100%;
6 height: 100% 6 height: 100%
7 } 7 }
  8 +.page{
  9 + width: 100%;
  10 + height: 100%
  11 +}
  12 +.content_item{
  13 + height: calc(100% - 160rpx)
  14 +}
8 .gogogo{ 15 .gogogo{
  16 + width: 100%;
  17 + height: 100%;
9 text-align: center; 18 text-align: center;
10 line-height: 500rpx; 19 line-height: 500rpx;
11 color: #888; 20 color: #888;
12 font-size: 32rpx; 21 font-size: 32rpx;
  22 + position: relative;
  23 +}
  24 +.gogogo image{
  25 + height: 247rpx;
  26 + width: 340rpx;
  27 + position: absolute;
  28 + top: 50%;
  29 + left: 50%;
  30 + transform: translate(-50%,-70%)
  31 +}
  32 +.gogogo view{
  33 + font-size:26rpx;
  34 + font-family:PingFang-SC-Medium;
  35 + font-weight:500;
  36 + color:rgba(136,136,136,1);
  37 + position: absolute;
  38 + left: 50%;
  39 + transform: translate(-50%,-20%);
  40 + top: 50%
13 } 41 }
14 .page{ 42 .page{
15 width: 100%; 43 width: 100%;
@@ -15,6 +15,12 @@ Page({ @@ -15,6 +15,12 @@ Page({
15 value:'', 15 value:'',
16 searchList:[] 16 searchList:[]
17 }, 17 },
  18 + //返回
  19 + getget(){
  20 + wx.navigateBack({
  21 +
  22 + })
  23 + },
18 //获取关键字 24 //获取关键字
19 get_keyWords(e){ 25 get_keyWords(e){
20 let value=e.detail.value 26 let value=e.detail.value
1 <!--pages/my/edit_address/edit_address.wxml--> 1 <!--pages/my/edit_address/edit_address.wxml-->
2 <view class='page'> 2 <view class='page'>
3 <view class='banner'> 3 <view class='banner'>
4 - <!-- <view class='iconfont icon-fanhui'></view> --> 4 + <view class='iconfont icon-fanhui' bindtap='getget'></view>
5 <view class='input_box'> 5 <view class='input_box'>
6 <view> 6 <view>
7 <input type="text" placeholder='{{hothothot}}' placeholder-class='banner_input' value='{{value}}' bindinput='get_keyWords' class='input_placeholder'></input> 7 <input type="text" placeholder='{{hothothot}}' placeholder-class='banner_input' value='{{value}}' bindinput='get_keyWords' class='input_placeholder'></input>
1 -var _createClass=function(){function a(e,c){for(var b=0;b<c.length;b++){var d=c[b];d.enumerable=d.enumerable||false;d.configurable=true;if("value" in d){d.writable=true}Object.defineProperty(e,d.key,d)}}return function(d,b,c){if(b){a(d.prototype,b)}if(c){a(d,c)}return d}}();function _classCallCheck(a,b){if(!(a instanceof b)){throw new TypeError("Cannot call a class as a function")}}var ERROR_CONF={KEY_ERR:311,KEY_ERR_MSG:"key格式错误",PARAM_ERR:310,PARAM_ERR_MSG:"请求参数信息有误",SYSTEM_ERR:600,SYSTEM_ERR_MSG:"系统错误",WX_ERR_CODE:1000,WX_OK_CODE:200};var BASE_URL="https://apis.map.qq.com/ws/";var URL_SEARCH=BASE_URL+"place/v1/search";var URL_SUGGESTION=BASE_URL+"place/v1/suggestion";var URL_GET_GEOCODER=BASE_URL+"geocoder/v1/";var URL_CITY_LIST=BASE_URL+"district/v1/list";var URL_AREA_LIST=BASE_URL+"district/v1/getchildren";var URL_DISTANCE=BASE_URL+"distance/v1/";var Utils={location2query:function location2query(c){if(typeof c=="string"){return c}var b="";for(var a=0;a<c.length;a++){var e=c[a];if(!!b){b+=";"}if(e.location){b=b+e.location.lat+","+e.location.lng}if(e.latitude&&e.longitude){b=b+e.latitude+","+e.longitude}}return b},getWXLocation:function getWXLocation(c,b,a){wx.getLocation({type:"gcj02",success:c,fail:b,complete:a})},getLocationParam:function getLocationParam(b){if(typeof b=="string"){var a=b.split(",");if(a.length===2){b={latitude:b.split(",")[0],longitude:b.split(",")[1]}}else{b={}}}return b},polyfillParam:function polyfillParam(a){a.success=a.success||function(){};a.fail=a.fail||function(){};a.complete=a.complete||function(){}},checkParamKeyEmpty:function checkParamKeyEmpty(c,b){if(!c[b]){var a=this.buildErrorConfig(ERROR_CONF.PARAM_ERR,ERROR_CONF.PARAM_ERR_MSG+b+"参数格式有误");c.fail(a);c.complete(a);return true}return false},checkKeyword:function checkKeyword(a){return !this.checkParamKeyEmpty(a,"keyword")},checkLocation:function checkLocation(c){var a=this.getLocationParam(c.location);if(!a||!a.latitude||!a.longitude){var b=this.buildErrorConfig(ERROR_CONF.PARAM_ERR,ERROR_CONF.PARAM_ERR_MSG+" location参数格式有误");c.fail(b);c.complete(b);return false}return true},buildErrorConfig:function buildErrorConfig(a,b){return{status:a,message:b}},buildWxRequestConfig:function buildWxRequestConfig(c,a){var b=this;a.header={"content-type":"application/json"};a.method="GET";a.success=function(d){var e=d.data;if(e.status===0){c.success(e)}else{c.fail(e)}};a.fail=function(d){d.statusCode=ERROR_CONF.WX_ERR_CODE;c.fail(b.buildErrorConfig(ERROR_CONF.WX_ERR_CODE,result.errMsg))};a.complete=function(d){var e=+d.statusCode;switch(e){case ERROR_CONF.WX_ERR_CODE:c.complete(b.buildErrorConfig(ERROR_CONF.WX_ERR_CODE,d.errMsg));break;case ERROR_CONF.WX_OK_CODE:var f=d.data;if(f.status===0){c.complete(f)}else{c.complete(b.buildErrorConfig(f.status,f.message))}break;default:c.complete(b.buildErrorConfig(ERROR_CONF.SYSTEM_ERR,ERROR_CONF.SYSTEM_ERR_MSG))}};return a},locationProcess:function locationProcess(f,e,c,a){var d=this;c=c||function(g){g.statusCode=ERROR_CONF.WX_ERR_CODE;f.fail(d.buildErrorConfig(ERROR_CONF.WX_ERR_CODE,g.errMsg))};a=a||function(g){if(g.statusCode==ERROR_CONF.WX_ERR_CODE){f.complete(d.buildErrorConfig(ERROR_CONF.WX_ERR_CODE,g.errMsg))}};if(!f.location){d.getWXLocation(e,c,a)}else{if(d.checkLocation(f)){var b=Utils.getLocationParam(f.location);e(b)}}}};var QQMapWX=function(){function b(i){_classCallCheck(this,b);if(!i.key){throw Error("key值不能为空")}this.key=i.key}_createClass(b,[{key:"search",value:function f(i){var l=this;i=i||{};Utils.polyfillParam(i);if(!Utils.checkKeyword(i)){return}var k={keyword:i.keyword,orderby:i.orderby||"_distance",page_size:i.page_size||10,page_index:i.page_index||1,output:"json",key:l.key};if(i.address_format){k.address_format=i.address_format}if(i.filter){k.filter=i.filter}var n=i.distance||"1000";var j=i.auto_extend||1;var m=function m(o){k.boundary="nearby("+o.latitude+","+o.longitude+","+n+","+j+")";wx.request(Utils.buildWxRequestConfig(i,{url:URL_SEARCH,data:k}))};Utils.locationProcess(i,m)}},{key:"getSuggestion",value:function h(i){var k=this;i=i||{};Utils.polyfillParam(i);if(!Utils.checkKeyword(i)){return}var j={keyword:i.keyword,region:i.region||"全国",region_fix:i.region_fix||0,policy:i.policy||0,output:"json",key:k.key};wx.request(Utils.buildWxRequestConfig(i,{url:URL_SUGGESTION,data:j}))}},{key:"reverseGeocoder",value:function a(i){var k=this;i=i||{};Utils.polyfillParam(i);var j={coord_type:i.coord_type||5,get_poi:i.get_poi||0,output:"json",key:k.key};if(i.poi_options){j.poi_options=i.poi_options}var l=function l(m){j.location=m.latitude+","+m.longitude;wx.request(Utils.buildWxRequestConfig(i,{url:URL_GET_GEOCODER,data:j}))};Utils.locationProcess(i,l)}},{key:"geocoder",value:function g(i){var k=this;i=i||{};Utils.polyfillParam(i);if(Utils.checkParamKeyEmpty(i,"address")){return}var j={address:i.address,output:"json",key:k.key};wx.request(Utils.buildWxRequestConfig(i,{url:URL_GET_GEOCODER,data:j}))}},{key:"getCityList",value:function c(i){var k=this;i=i||{};Utils.polyfillParam(i);var j={output:"json",key:k.key};  
2 -wx.request(Utils.buildWxRequestConfig(i,{url:URL_CITY_LIST,data:j}))}},{key:"getDistrictByCityId",value:function d(i){var k=this;i=i||{};Utils.polyfillParam(i);if(Utils.checkParamKeyEmpty(i,"id")){return}var j={id:i.id||"",output:"json",key:k.key};wx.request(Utils.buildWxRequestConfig(i,{url:URL_AREA_LIST,data:j}))}},{key:"calculateDistance",value:function e(i){var k=this;i=i||{};Utils.polyfillParam(i);if(Utils.checkParamKeyEmpty(i,"to")){return}var j={mode:i.mode||"walking",to:Utils.location2query(i.to),output:"json",key:k.key};var l=function l(m){j.from=m.latitude+","+m.longitude;wx.request(Utils.buildWxRequestConfig(i,{url:URL_DISTANCE,data:j}))};if(i.from){i.location=i.from}Utils.locationProcess(i,l)}}]);return b}();module.exports=QQMapWX;  
  1 +var _createClass = function() {
  2 + function a(e, c) {
  3 + for (var b = 0; b < c.length; b++) {
  4 + var d = c[b];
  5 + d.enumerable = d.enumerable || false;
  6 + d.configurable = true;
  7 + if ("value" in d) {
  8 + d.writable = true
  9 + }
  10 + Object.defineProperty(e, d.key, d)
  11 + }
  12 + }
  13 + return function(d, b, c) {
  14 + if (b) {
  15 + a(d.prototype, b)
  16 + }
  17 + if (c) {
  18 + a(d, c)
  19 + }
  20 + return d
  21 + }
  22 +}();
  23 +
  24 +function _classCallCheck(a, b) {
  25 + if (!(a instanceof b)) {
  26 + throw new TypeError("Cannot call a class as a function")
  27 + }
  28 +}
  29 +var ERROR_CONF = {
  30 + KEY_ERR: 311,
  31 + KEY_ERR_MSG: "key格式错误",
  32 + PARAM_ERR: 310,
  33 + PARAM_ERR_MSG: "请求参数信息有误",
  34 + SYSTEM_ERR: 600,
  35 + SYSTEM_ERR_MSG: "系统错误",
  36 + WX_ERR_CODE: 1000,
  37 + WX_OK_CODE: 200
  38 +};
  39 +var BASE_URL = "https://apis.map.qq.com/ws/";
  40 +var URL_SEARCH = BASE_URL + "place/v1/search";
  41 +var URL_SUGGESTION = BASE_URL + "place/v1/suggestion";
  42 +var URL_GET_GEOCODER = BASE_URL + "geocoder/v1/";
  43 +var URL_CITY_LIST = BASE_URL + "district/v1/list";
  44 +var URL_AREA_LIST = BASE_URL + "district/v1/getchildren";
  45 +var URL_DISTANCE = BASE_URL + "distance/v1/";
  46 +var Utils = {
  47 + location2query: function location2query(c) {
  48 + if (typeof c == "string") {
  49 + return c
  50 + }
  51 + var b = "";
  52 + for (var a = 0; a < c.length; a++) {
  53 + var e = c[a];
  54 + if (!!b) {
  55 + b += ";"
  56 + }
  57 + if (e.location) {
  58 + b = b + e.location.lat + "," + e.location.lng
  59 + }
  60 + if (e.latitude && e.longitude) {
  61 + b = b + e.latitude + "," + e.longitude
  62 + }
  63 + }
  64 + return b
  65 + },
  66 + getWXLocation: function getWXLocation(c, b, a) {
  67 + wx.getLocation({
  68 + type: "gcj02",
  69 + success: c,
  70 + fail: b,
  71 + complete: a
  72 + })
  73 + },
  74 + getLocationParam: function getLocationParam(b) {
  75 + if (typeof b == "string") {
  76 + var a = b.split(",");
  77 + if (a.length === 2) {
  78 + b = {
  79 + latitude: b.split(",")[0],
  80 + longitude: b.split(",")[1]
  81 + }
  82 + } else {
  83 + b = {}
  84 + }
  85 + }
  86 + return b
  87 + },
  88 + polyfillParam: function polyfillParam(a) {
  89 + a.success = a.success || function() {};
  90 + a.fail = a.fail || function() {};
  91 + a.complete = a.complete || function() {}
  92 + },
  93 + checkParamKeyEmpty: function checkParamKeyEmpty(c, b) {
  94 + if (!c[b]) {
  95 + var a = this.buildErrorConfig(ERROR_CONF.PARAM_ERR, ERROR_CONF.PARAM_ERR_MSG + b + "参数格式有误");
  96 + c.fail(a);
  97 + c.complete(a);
  98 + return true
  99 + }
  100 + return false
  101 + },
  102 + checkKeyword: function checkKeyword(a) {
  103 + return !this.checkParamKeyEmpty(a, "keyword")
  104 + },
  105 + checkLocation: function checkLocation(c) {
  106 + var a = this.getLocationParam(c.location);
  107 + if (!a || !a.latitude || !a.longitude) {
  108 + var b = this.buildErrorConfig(ERROR_CONF.PARAM_ERR, ERROR_CONF.PARAM_ERR_MSG + " location参数格式有误");
  109 + c.fail(b);
  110 + c.complete(b);
  111 + return false
  112 + }
  113 + return true
  114 + },
  115 + buildErrorConfig: function buildErrorConfig(a, b) {
  116 + return {
  117 + status: a,
  118 + message: b
  119 + }
  120 + },
  121 + buildWxRequestConfig: function buildWxRequestConfig(c, a) {
  122 + var b = this;
  123 + a.header = {
  124 + "content-type": "application/json"
  125 + };
  126 + a.method = "GET";
  127 + a.success = function(d) {
  128 + var e = d.data;
  129 + if (e.status === 0) {
  130 + c.success(e)
  131 + } else {
  132 + c.fail(e)
  133 + }
  134 + };
  135 + a.fail = function(d) {
  136 + d.statusCode = ERROR_CONF.WX_ERR_CODE;
  137 + c.fail(b.buildErrorConfig(ERROR_CONF.WX_ERR_CODE, result.errMsg))
  138 + };
  139 + a.complete = function(d) {
  140 + var e = +d.statusCode;
  141 + switch (e) {
  142 + case ERROR_CONF.WX_ERR_CODE:
  143 + c.complete(b.buildErrorConfig(ERROR_CONF.WX_ERR_CODE, d.errMsg));
  144 + break;
  145 + case ERROR_CONF.WX_OK_CODE:
  146 + var f = d.data;
  147 + if (f.status === 0) {
  148 + c.complete(f)
  149 + } else {
  150 + c.complete(b.buildErrorConfig(f.status, f.message))
  151 + }
  152 + break;
  153 + default:
  154 + c.complete(b.buildErrorConfig(ERROR_CONF.SYSTEM_ERR, ERROR_CONF.SYSTEM_ERR_MSG))
  155 + }
  156 + };
  157 + return a
  158 + },
  159 + locationProcess: function locationProcess(f, e, c, a) {
  160 + var d = this;
  161 + c = c || function(g) {
  162 + g.statusCode = ERROR_CONF.WX_ERR_CODE;
  163 + f.fail(d.buildErrorConfig(ERROR_CONF.WX_ERR_CODE, g.errMsg))
  164 + };
  165 + a = a || function(g) {
  166 + if (g.statusCode == ERROR_CONF.WX_ERR_CODE) {
  167 + f.complete(d.buildErrorConfig(ERROR_CONF.WX_ERR_CODE, g.errMsg))
  168 + }
  169 + };
  170 + if (!f.location) {
  171 + d.getWXLocation(e, c, a)
  172 + } else {
  173 + if (d.checkLocation(f)) {
  174 + var b = Utils.getLocationParam(f.location);
  175 + e(b)
  176 + }
  177 + }
  178 + }
  179 +};
  180 +var QQMapWX = function() {
  181 + function b(i) {
  182 + _classCallCheck(this, b);
  183 + if (!i.key) {
  184 + throw Error("key值不能为空")
  185 + }
  186 + this.key = i.key
  187 + }
  188 + _createClass(b, [{
  189 + key: "search",
  190 + value: function f(i) {
  191 + var l = this;
  192 + i = i || {};
  193 + Utils.polyfillParam(i);
  194 + if (!Utils.checkKeyword(i)) {
  195 + return
  196 + }
  197 + var k = {
  198 + keyword: i.keyword,
  199 + orderby: i.orderby || "_distance",
  200 + page_size: i.page_size || 10,
  201 + page_index: i.page_index || 1,
  202 + output: "json",
  203 + key: l.key
  204 + };
  205 + if (i.address_format) {
  206 + k.address_format = i.address_format
  207 + }
  208 + if (i.filter) {
  209 + k.filter = i.filter
  210 + }
  211 + var n = i.distance || "1000";
  212 + var j = i.auto_extend || 1;
  213 + var m = function m(o) {
  214 + k.boundary = "nearby(" + o.latitude + "," + o.longitude + "," + n + "," + j + ")";
  215 + wx.request(Utils.buildWxRequestConfig(i, {
  216 + url: URL_SEARCH,
  217 + data: k
  218 + }))
  219 + };
  220 + Utils.locationProcess(i, m)
  221 + }
  222 + }, {
  223 + key: "getSuggestion",
  224 + value: function h(i) {
  225 + var k = this;
  226 + i = i || {};
  227 + Utils.polyfillParam(i);
  228 + if (!Utils.checkKeyword(i)) {
  229 + return
  230 + }
  231 + var j = {
  232 + keyword: i.keyword,
  233 + region: i.region || "全国",
  234 + region_fix: i.region_fix || 0,
  235 + policy: i.policy || 0,
  236 + output: "json",
  237 + key: k.key
  238 + };
  239 + wx.request(Utils.buildWxRequestConfig(i, {
  240 + url: URL_SUGGESTION,
  241 + data: j
  242 + }))
  243 + }
  244 + }, {
  245 + key: "reverseGeocoder",
  246 + value: function a(i) {
  247 + var k = this;
  248 + i = i || {};
  249 + Utils.polyfillParam(i);
  250 + var j = {
  251 + coord_type: i.coord_type || 5,
  252 + get_poi: i.get_poi || 0,
  253 + output: "json",
  254 + key: k.key
  255 + };
  256 + if (i.poi_options) {
  257 + j.poi_options = i.poi_options
  258 + }
  259 + var l = function l(m) {
  260 + j.location = m.latitude + "," + m.longitude;
  261 + wx.request(Utils.buildWxRequestConfig(i, {
  262 + url: URL_GET_GEOCODER,
  263 + data: j
  264 + }))
  265 + };
  266 + Utils.locationProcess(i, l)
  267 + }
  268 + }, {
  269 + key: "geocoder",
  270 + value: function g(i) {
  271 + var k = this;
  272 + i = i || {};
  273 + Utils.polyfillParam(i);
  274 + if (Utils.checkParamKeyEmpty(i, "address")) {
  275 + return
  276 + }
  277 + var j = {
  278 + address: i.address,
  279 + output: "json",
  280 + key: k.key
  281 + };
  282 + wx.request(Utils.buildWxRequestConfig(i, {
  283 + url: URL_GET_GEOCODER,
  284 + data: j
  285 + }))
  286 + }
  287 + }, {
  288 + key: "getCityList",
  289 + value: function c(i) {
  290 + var k = this;
  291 + i = i || {};
  292 + Utils.polyfillParam(i);
  293 + var j = {
  294 + output: "json",
  295 + key: k.key
  296 + };
  297 + wx.request(Utils.buildWxRequestConfig(i, {
  298 + url: URL_CITY_LIST,
  299 + data: j
  300 + }))
  301 + }
  302 + }, {
  303 + key: "getDistrictByCityId",
  304 + value: function d(i) {
  305 + var k = this;
  306 + i = i || {};
  307 + Utils.polyfillParam(i);
  308 + if (Utils.checkParamKeyEmpty(i, "id")) {
  309 + return
  310 + }
  311 + var j = {
  312 + id: i.id || "",
  313 + output: "json",
  314 + key: k.key
  315 + };
  316 + wx.request(Utils.buildWxRequestConfig(i, {
  317 + url: URL_AREA_LIST,
  318 + data: j
  319 + }))
  320 + }
  321 + }, {
  322 + key: "calculateDistance",
  323 + value: function e(i) {
  324 + var k = this;
  325 + i = i || {};
  326 + Utils.polyfillParam(i);
  327 + if (Utils.checkParamKeyEmpty(i, "to")) {
  328 + return
  329 + }
  330 + var j = {
  331 + mode: i.mode || "walking",
  332 + to: Utils.location2query(i.to),
  333 + output: "json",
  334 + key: k.key
  335 + };
  336 + var l = function l(m) {
  337 + j.from = m.latitude + "," + m.longitude;
  338 + wx.request(Utils.buildWxRequestConfig(i, {
  339 + url: URL_DISTANCE,
  340 + data: j
  341 + }))
  342 + };
  343 + if (i.from) {
  344 + i.location = i.from
  345 + }
  346 + Utils.locationProcess(i, l)
  347 + }
  348 + }]);
  349 + return b
  350 +}();
  351 +module.exports = QQMapWX;