作者 倪静楠

位置授权

1 { 1 {
2 - "pages": [ 2 + "pages": [
3 "pages/home/home", 3 "pages/home/home",
4 "pages/logs/logs", 4 "pages/logs/logs",
5 "pages/classify/classify", 5 "pages/classify/classify",
@@ -31,7 +31,9 @@ @@ -31,7 +31,9 @@
31 "pages/timedmo/timedmo", 31 "pages/timedmo/timedmo",
32 "pages/index/index", 32 "pages/index/index",
33 "components/timepicker/timepicker", 33 "components/timepicker/timepicker",
34 - "pages/idea-feedback/idea-feedback" 34 + "pages/idea-feedback/idea-feedback",
  35 + "pages/demo1/demo1",
  36 + "pages/look-more/look-more"
35 ], 37 ],
36 "window": { 38 "window": {
37 "backgroundTextStyle": "light", 39 "backgroundTextStyle": "light",
@@ -78,6 +78,15 @@ Page({ @@ -78,6 +78,15 @@ Page({
78 }, 78 },
79 //地区 79 //地区
80 map() { 80 map() {
  81 + wx.getLocation({
  82 + type: 'wgs84',
  83 + success(res) {
  84 + const latitude = res.latitude
  85 + const longitude = res.longitude
  86 + const speed = res.speed
  87 + const accuracy = res.accuracy
  88 + }
  89 + })
81 let that = this; 90 let that = this;
82 const key = 'C4QBZ-UYQLI-S45G2-5ETMC-LQYWE-L6FJU'; 91 const key = 'C4QBZ-UYQLI-S45G2-5ETMC-LQYWE-L6FJU';
83 const referer = '春晓世纪华联超市'; 92 const referer = '春晓世纪华联超市';
@@ -173,8 +182,7 @@ Page({ @@ -173,8 +182,7 @@ Page({
173 }) 182 })
174 } 183 }
175 }, 184 },
176 - onLoad: function (options) {  
177 - }, 185 + onLoad: function (options) {},
178 186
179 /** 187 /**
180 * 生命周期函数--监听页面初次渲染完成 188 * 生命周期函数--监听页面初次渲染完成
@@ -18,15 +18,17 @@ @@ -18,15 +18,17 @@
18 18
19 19
20 <!-- 配送时间 --> 20 <!-- 配送时间 -->
21 - <view class="timeBox">  
22 - <view style="width:95%;display:flex">  
23 - <view class="calendar " bindtap='chooseTime'>  
24 - <!-- <image src="/images/04-01/rili.png"></image> --> 21 + <view class="timeBox" >
  22 + <view style="width:95%;display:flex" bindtap='chooseTime'>
  23 + <view class="calendar " wx:if="{{storePickupTime==''}}">
25 请选择配送时间: 24 请选择配送时间:
26 </view> 25 </view>
  26 + <view class="calendar1 " wx:if="{{storePickupTime!==''}}">
  27 + 配送时间:
  28 + </view>
27 <view class="selectText">{{storePickupTime}}</view> 29 <view class="selectText">{{storePickupTime}}</view>
28 </view> 30 </view>
29 - <view class="arrow"> 31 + <view class="arrow" bindtap='chooseTime'>
30 <image src="/images/04-01/arrow.png"></image> 32 <image src="/images/04-01/arrow.png"></image>
31 </view> 33 </view>
32 <view class="section"> 34 <view class="section">
@@ -70,7 +70,7 @@ page { @@ -70,7 +70,7 @@ page {
70 70
71 .userAddress { 71 .userAddress {
72 width: 504rpx; 72 width: 504rpx;
73 - font-size: 28prx; 73 + font-size: 28rpx;
74 font-weight: 400; 74 font-weight: 400;
75 text-align: left; 75 text-align: left;
76 color: #6c6c6d; 76 color: #6c6c6d;
@@ -106,6 +106,13 @@ page { @@ -106,6 +106,13 @@ page {
106 color: #323233; 106 color: #323233;
107 width: 224rpx; 107 width: 224rpx;
108 } 108 }
  109 +.calendar1 {
  110 + font-size: 28rpx;
  111 + font-weight: 400;
  112 + text-align: left;
  113 + color: #323233;
  114 + width: 142rpx;
  115 +}
109 .selectText{ 116 .selectText{
110 font-size: 28rpx; 117 font-size: 28rpx;
111 color: #323233; 118 color: #323233;
@@ -10,7 +10,7 @@ Page({ @@ -10,7 +10,7 @@ Page({
10 //评价列表 10 //评价列表
11 getList(goodsId) { 11 getList(goodsId) {
12 let postData = { 12 let postData = {
13 - goodsId: goodsId, 13 + goodsId: this.data.goodsId,
14 page: this.data.page, 14 page: this.data.page,
15 size: 10 15 size: 10
16 } 16 }
@@ -28,7 +28,7 @@ Page({ @@ -28,7 +28,7 @@ Page({
28 */ 28 */
29 onLoad: function (options) { 29 onLoad: function (options) {
30 this.setData({ 30 this.setData({
31 - goodsId:options.goodsId 31 + goodsId:options.goodsid
32 }) 32 })
33 this.getList(options.goodsid) 33 this.getList(options.goodsid)
34 }, 34 },
1 <!--pages/all-evaluate/all-evaluate.wxml--> 1 <!--pages/all-evaluate/all-evaluate.wxml-->
2 <view class="outerBox" wx:for="{{list}}"> 2 <view class="outerBox" wx:for="{{list}}">
3 <view class="userBox"> 3 <view class="userBox">
4 - <view class="wxHead"> 4 + <view class="wxHead" wx:if="{{item.anonymous==0}}">
5 <image src="{{item.wxHeadImg}}"></image> 5 <image src="{{item.wxHeadImg}}"></image>
6 </view> 6 </view>
  7 + <view class="wxHead" wx:if="{{item.anonymous==1}}">
  8 + <image src="/images/nimingtouxiang.png"> </image>
  9 + </view>
7 <view class="wxName">{{item.wxName}}</view> 10 <view class="wxName">{{item.wxName}}</view>
8 </view> 11 </view>
9 <view class="text">{{item.content}}</view> 12 <view class="text">{{item.content}}</view>
10 <view class="picBox"> 13 <view class="picBox">
11 <view class="pic" wx:for="{{item.images}}"> 14 <view class="pic" wx:for="{{item.images}}">
12 - <image src="{{item}}" ></image> 15 + <image src="{{item}}"></image>
13 </view> 16 </view>
14 </view> 17 </view>
15 </view> 18 </view>
@@ -24,12 +24,12 @@ page { @@ -24,12 +24,12 @@ page {
24 width: 72rpx; 24 width: 72rpx;
25 height: 72rpx; 25 height: 72rpx;
26 margin-right: 16rpx; 26 margin-right: 16rpx;
27 - background-color: aqua;  
28 } 27 }
29 28
30 .wxHead image { 29 .wxHead image {
31 width: 72rpx; 30 width: 72rpx;
32 height: 72rpx; 31 height: 72rpx;
  32 + border-radius: 50%;
33 } 33 }
34 34
35 .wxName { 35 .wxName {
@@ -76,9 +76,9 @@ Page({ @@ -76,9 +76,9 @@ Page({
76 tabList: list 76 tabList: list
77 }) 77 })
78 } else { 78 } else {
79 - setTimeout(() => {  
80 - util.getUser()  
81 - }, 2000) 79 + // setTimeout(() => {
  80 + // util.getUser()
  81 + // }, 2000)
82 } 82 }
83 }) 83 })
84 }, 84 },
@@ -118,9 +118,9 @@ Page({ @@ -118,9 +118,9 @@ Page({
118 tabList: list 118 tabList: list
119 }) 119 })
120 } else [ 120 } else [
121 - setTimeout(() => {  
122 - util.getUser()  
123 - }, 2000) 121 + // setTimeout(() => {
  122 + // util.getUser()
  123 + // }, 2000)
124 ] 124 ]
125 }) 125 })
126 }, 126 },
@@ -139,9 +139,9 @@ Page({ @@ -139,9 +139,9 @@ Page({
139 tabList: list 139 tabList: list
140 }) 140 })
141 } else { 141 } else {
142 - setTimeout(() => {  
143 - util.getUser()  
144 - }, 2000) 142 + // setTimeout(() => {
  143 + // util.getUser()
  144 + // }, 2000)
145 } 145 }
146 }) 146 })
147 }, 147 },
@@ -160,9 +160,9 @@ Page({ @@ -160,9 +160,9 @@ Page({
160 tabList: list 160 tabList: list
161 }) 161 })
162 } else { 162 } else {
163 - setTimeout(() => {  
164 - util.getUser()  
165 - }, 2000) 163 + // setTimeout(() => {
  164 + // util.getUser()
  165 + // }, 2000)
166 } 166 }
167 }) 167 })
168 }, 168 },
@@ -210,9 +210,9 @@ Page({ @@ -210,9 +210,9 @@ Page({
210 if (data.statusCode == 0) { 210 if (data.statusCode == 0) {
211 211
212 } else { 212 } else {
213 - setTimeout(() => {  
214 - util.getUser()  
215 - }, 2000) 213 + // setTimeout(() => {
  214 + // util.getUser()
  215 + // }, 2000)
216 } 216 }
217 }) 217 })
218 } else if (res.cancel) { 218 } else if (res.cancel) {
@@ -70,6 +70,7 @@ page{ @@ -70,6 +70,7 @@ page{
70 .productPic image{ 70 .productPic image{
71 width: 180rpx; 71 width: 180rpx;
72 height: 180rpx; 72 height: 180rpx;
  73 + border-radius: 16rpx;
73 } 74 }
74 75
75 .productDetail { 76 .productDetail {
@@ -3,6 +3,7 @@ let method = require("../../utils/reuqest.js"); @@ -3,6 +3,7 @@ let method = require("../../utils/reuqest.js");
3 const util = require("../../utils/util.js"); 3 const util = require("../../utils/util.js");
4 Page({ 4 Page({
5 data: { 5 data: {
  6 + Authorization: '', //判断用户是否登录
6 page: 1, 7 page: 1,
7 classifyId: "", 8 classifyId: "",
8 idx: 0, //商品规格索引 9 idx: 0, //商品规格索引
@@ -41,24 +42,26 @@ Page({ @@ -41,24 +42,26 @@ Page({
41 }) 42 })
42 }, 43 },
43 //获取定位 44 //获取定位
44 - getLocation() {  
45 - let that = this;  
46 - wx.getLocation({  
47 - type: 'gcj02',  
48 - success(res) {  
49 - that.setData({  
50 - latitude: res.latitude,  
51 - longitude: res.longitude  
52 - })  
53 - that.location();  
54 - const speed = res.speed  
55 - const accuracy = res.accuracy  
56 - }  
57 - })  
58 - }, 45 + // getLocation() {
  46 + // let that = this;
  47 + // wx.getLocation({
  48 + // type: 'gcj02',
  49 + // success(res) {
  50 + // that.setData({
  51 + // latitude: res.latitude,
  52 + // longitude: res.longitude
  53 + // })
  54 + // that.location();
  55 + // const speed = res.speed
  56 + // const accuracy = res.accuracy
  57 + // }
  58 + // })
  59 + // },
59 location() { 60 location() {
60 let that = this 61 let that = this
  62 + console.log(that.data.latitude, '5555')
61 let str = that.data.latitude + ',' + that.data.longitude; 63 let str = that.data.latitude + ',' + that.data.longitude;
  64 + console.log(str, 'str')
62 method.getRequest("/goods/geocoder/v1/" + str, data => { 65 method.getRequest("/goods/geocoder/v1/" + str, data => {
63 if (data.statusCode == 0) { 66 if (data.statusCode == 0) {
64 that.setData({ 67 that.setData({
@@ -156,22 +159,31 @@ Page({ @@ -156,22 +159,31 @@ Page({
156 }) 159 })
157 }, 160 },
158 addCart(e) { 161 addCart(e) {
159 - let id = e.currentTarget.dataset.id  
160 - this.setData({  
161 - showMask: true  
162 - })  
163 - method.getRequest("/goods/" + id, data => {  
164 - if (data.statusCode == 0) {  
165 - this.setData({  
166 - goodsData: data.data,  
167 - stockNum: data.data.list[0].goodsStock  
168 - })  
169 - } else {  
170 - setTimeout(() => {  
171 - util.getUser()  
172 - }, 2000)  
173 - }  
174 - }) 162 + if (this.data.Authorization) {
  163 + let id = e.currentTarget.dataset.id
  164 + this.setData({
  165 + showMask: true
  166 + })
  167 + method.getRequest("/goods/" + id, data => {
  168 + if (data.statusCode == 0) {
  169 + this.setData({
  170 + goodsData: data.data,
  171 + stockNum: data.data.list[0].goodsStock
  172 + })
  173 + } else {
  174 +
  175 + }
  176 + })
  177 + } else {
  178 + wx.showToast({
  179 + title: '请先登录!',
  180 + icon: 'none'
  181 + })
  182 + setTimeout(() => {
  183 + util.getUser()
  184 + }, 2000)
  185 + }
  186 +
175 }, 187 },
176 closeMask() { 188 closeMask() {
177 this.setData({ 189 this.setData({
@@ -243,32 +255,38 @@ Page({ @@ -243,32 +255,38 @@ Page({
243 }, 255 },
244 //兑换 256 //兑换
245 exchange(e) { 257 exchange(e) {
246 - let jifenNum = e.currentTarget.dataset.integral;  
247 - let defaultSku = e.currentTarget.dataset.defaultSku;  
248 - wx.setStorageSync('defaultSku', e.currentTarget.dataset.defaultsku)  
249 - //获取用户积分  
250 - method.getRequest("/myUser/queryUserInfo", data => {  
251 - if (data.statusCode == 0) {  
252 - this.setData({  
253 - integral: data.data.integral  
254 - })  
255 - if (jifenNum > this.data.integral) {  
256 - wx.showToast({  
257 - title: '您的积分目前不够兑换该商品',  
258 - icon: 'none'  
259 - })  
260 - return false  
261 - } else {  
262 - wx.navigateTo({  
263 - url: '/pages/integral-order/integral-order', 258 + if (this.data.Authorization) {
  259 + let jifenNum = e.currentTarget.dataset.integral;
  260 + let defaultSku = e.currentTarget.dataset.defaultSku;
  261 + wx.setStorageSync('defaultSku', e.currentTarget.dataset.defaultsku)
  262 + //获取用户积分
  263 + method.getRequest("/myUser/queryUserInfo", data => {
  264 + if (data.statusCode == 0) {
  265 + this.setData({
  266 + integral: data.data.integral
264 }) 267 })
265 - }  
266 - } else {  
267 - setTimeout(() => {  
268 - util.getUser()  
269 - }, 2000)  
270 - }  
271 - }) 268 + if (jifenNum > this.data.integral) {
  269 + wx.showToast({
  270 + title: '您的积分目前不够兑换该商品',
  271 + icon: 'none'
  272 + })
  273 + return false
  274 + } else {
  275 + wx.navigateTo({
  276 + url: '/pages/integral-order/integral-order',
  277 + })
  278 + }
  279 + } else {}
  280 + })
  281 + } else {
  282 + wx.showToast({
  283 + title: '请先登录!',
  284 + icon: 'none'
  285 + })
  286 + setTimeout(() => {
  287 + util.getUser()
  288 + }, 2000)
  289 + }
272 290
273 }, 291 },
274 //商品详情 292 //商品详情
@@ -279,7 +297,26 @@ Page({ @@ -279,7 +297,26 @@ Page({
279 url: '/pages/product-detail/product-detail', 297 url: '/pages/product-detail/product-detail',
280 }) 298 })
281 }, 299 },
282 - 300 + //再次申请获取位置信息
  301 + openConfirm: function () {
  302 + wx.showModal({
  303 + content: '检测到您没打开定位权限,有些功能无法使用,是否去设置打开?',
  304 + confirmText: "确认",
  305 + cancelText: "取消",
  306 + success: function (res) {
  307 + console.log(res);
  308 + //点击“确认”时打开设置页面
  309 + if (res.confirm) {
  310 + console.log('用户点击确认')
  311 + wx.openSetting({
  312 + success: (res) => {}
  313 + })
  314 + } else {
  315 + console.log('用户点击取消')
  316 + }
  317 + }
  318 + });
  319 + },
283 /** 320 /**
284 * 生命周期函数--监听页面加载 321 * 生命周期函数--监听页面加载
285 */ 322 */
@@ -329,23 +366,65 @@ Page({ @@ -329,23 +366,65 @@ Page({
329 } 366 }
330 wx.removeStorageSync("classifyIndex") 367 wx.removeStorageSync("classifyIndex")
331 let that = this; 368 let that = this;
332 - wx.getLocation({  
333 - type: 'gcj02',  
334 - success(res) {  
335 - that.setData({  
336 - latitude: res.latitude,  
337 - longitude: res.longitude 369 + //判断用户是否登录
  370 + if (this.data.Authorization) {
  371 + // wx.getLocation({
  372 + // type: 'gcj02',
  373 + // success(res) {
  374 + // that.setData({
  375 + // latitude: res.latitude,
  376 + // longitude: res.longitude
  377 + // })
  378 + // that.location();
  379 + // const speed = res.speed
  380 + // const accuracy = res.accuracy
  381 + // },
  382 + // fail(errInfo) {
  383 + // console.info(errInfo)
  384 + // }
  385 + // })
  386 + }
  387 + //判断用户是否登录
  388 + if (wx.getStorageSync('Authorization') === '') {
  389 + this.setData({
  390 + Authorization: false
  391 + })
  392 + } else {
  393 + this.setData({
  394 + Authorization: true
  395 + })
  396 + //位置
  397 + wx.getLocation({
  398 + type: 'wgs84',
  399 + success: function (res) {
  400 + that.setData({
  401 + longitude: res.longitude,
  402 + latitude: res.latitude
  403 + })
  404 + that.location()
  405 + }
  406 + })
  407 + //判断是否获得了用户地理位置授权
  408 + if (that.data.latitude == undefined) {
  409 + wx.getSetting({
  410 + success: (res) => {
  411 + if (!res.authSetting['scope.userLocation'])
  412 + that.openConfirm()
  413 + }
338 }) 414 })
339 - that.location();  
340 - const speed = res.speed  
341 - const accuracy = res.accuracy  
342 - },  
343 - fail(errInfo) {  
344 - console.info(errInfo)  
345 } 415 }
346 - }) 416 +
  417 + }
  418 + if (that.data.latitude !== undefined) {
  419 + setTimeout(() => {
  420 + that.location()
  421 + }, 1000)
  422 + }
  423 +
347 }, 424 },
  425 + open() {
348 426
  427 + },
349 /** 428 /**
350 * 生命周期函数--监听页面隐藏 429 * 生命周期函数--监听页面隐藏
351 */ 430 */
@@ -2,7 +2,7 @@ @@ -2,7 +2,7 @@
2 <!-- 搜索框 --> 2 <!-- 搜索框 -->
3 <view class="searchMain"> 3 <view class="searchMain">
4 <view class="location"> 4 <view class="location">
5 - <view style="display:inline-block;height: 20rpx;width: 20rpx;"> 5 + <view style="display:inline-block;height: 20rpx;width: 20rpx;" bindtap="open">
6 <image src="/images/location.png"></image> 6 <image src="/images/location.png"></image>
7 </view> 7 </view>
8 <text>{{location}}</text> 8 <text>{{location}}</text>
@@ -87,6 +87,7 @@ @@ -87,6 +87,7 @@
87 <view class="info"> 87 <view class="info">
88 <image src="{{goodsData.goodsBanners[0]}}"></image> 88 <image src="{{goodsData.goodsBanners[0]}}"></image>
89 <view class="info_right"> 89 <view class="info_right">
  90 + <view class="info_name">{{goodsData.goodsName}}</view>
90 <view class="info_price">¥{{goodsData.list[idx].goodsPrice}}</view> 91 <view class="info_price">¥{{goodsData.list[idx].goodsPrice}}</view>
91 <view class="info_stock">库存:{{goodsData.list[idx].goodsStock}}件</view> 92 <view class="info_stock">库存:{{goodsData.list[idx].goodsStock}}件</view>
92 <view class="info_stock" wx:if='{{info.detai.spec_type=="20"}}'>请选择规格</view> 93 <view class="info_stock" wx:if='{{info.detai.spec_type=="20"}}'>请选择规格</view>
@@ -252,6 +252,7 @@ page { @@ -252,6 +252,7 @@ page {
252 .productLeft image { 252 .productLeft image {
253 width: 180rpx; 253 width: 180rpx;
254 height: 180rpx; 254 height: 180rpx;
  255 + border-radius: 16rpx;
255 } 256 }
256 257
257 .productRight { 258 .productRight {
@@ -380,14 +381,17 @@ page { @@ -380,14 +381,17 @@ page {
380 381
381 .info_right { 382 .info_right {
382 width: calc(100% - 212rpx); 383 width: calc(100% - 212rpx);
383 - padding-top: 46rpx;  
384 padding-left: 36rpx; 384 padding-left: 36rpx;
385 box-sizing: border-box; 385 box-sizing: border-box;
386 display: flex; 386 display: flex;
387 flex-direction: column; 387 flex-direction: column;
388 justify-content: flex-end 388 justify-content: flex-end
389 } 389 }
390 - 390 +.info_name{
  391 + margin-bottom: 48rpx;
  392 + font-size: 30rpx;
  393 + color: #323233;
  394 +}
391 .info_price { 395 .info_price {
392 font-size: 28rpx; 396 font-size: 28rpx;
393 font-family: PingFang SC; 397 font-family: PingFang SC;
  1 +//index.js
  2 +//获取应用实例
  3 +Page({
  4 + data: { location: {}
  5 + },
  6 +
  7 + onLoad: function () {
  8 + var that = this
  9 + wx.getLocation({
  10 + type: 'wgs84',
  11 + success: function (res) {
  12 + that.setData({
  13 + location: {
  14 + longitude: res.longitude,
  15 + latitude: res.latitude
  16 + }
  17 + })
  18 + }
  19 + })
  20 + //判断是否获得了用户地理位置授权
  21 + wx.getSetting({
  22 + success: (res) => {
  23 + if (!res.authSetting['scope.userLocation'])
  24 + that.openConfirm()
  25 + }
  26 + })
  27 + },
  28 +
  29 + openConfirm: function () {
  30 + wx.showModal({
  31 + content: '检测到您没打开美团外卖的定位权限,是否去设置打开?',
  32 + confirmText: "确认",
  33 + cancelText: "取消",
  34 + success: function (res) {
  35 + console.log(res);
  36 + //点击“确认”时打开设置页面
  37 + if (res.confirm) {
  38 + console.log('用户点击确认')
  39 + wx.openSetting({
  40 + success: (res) => { }
  41 + })
  42 + } else {
  43 + console.log('用户点击取消')
  44 + }
  45 + }
  46 + });
  47 + },
  48 +})
  1 +{
  2 + "usingComponents": {}
  3 +}
  1 +<!--pages/demo1/demo1.wxml-->
  2 +<view class="location">
  3 +
  4 +</view>
  1 +/* pages/demo1/demo1.wxss */
@@ -176,7 +176,7 @@ Page({ @@ -176,7 +176,7 @@ Page({
176 submit() { 176 submit() {
177 console.log(this.data.orderId, 'orderid') 177 console.log(this.data.orderId, 'orderid')
178 let postData = { 178 let postData = {
179 - anonymous: this.data.checkType, 179 + anonymous: this.data.checkType?'1':'0',
180 content: this.data.content, 180 content: this.data.content,
181 orderId: this.data.orderId, 181 orderId: this.data.orderId,
182 contentImages: this.data.imgs 182 contentImages: this.data.imgs
@@ -12,7 +12,7 @@ Page({ @@ -12,7 +12,7 @@ Page({
12 classifyArray: [], //分类 12 classifyArray: [], //分类
13 limitCount: '限时优惠', //限时优惠 13 limitCount: '限时优惠', //限时优惠
14 limitCountShow: true, 14 limitCountShow: true,
15 - moreCount: '更多优惠', 15 + moreCount: '查看更多',
16 time: '', //限时优惠倒计时 16 time: '', //限时优惠倒计时
17 timeData: {}, 17 timeData: {},
18 hour: "", 18 hour: "",
@@ -25,7 +25,7 @@ Page({ @@ -25,7 +25,7 @@ Page({
25 discountArray: [], //每日特价 25 discountArray: [], //每日特价
26 dayPrice: '每日特价', 26 dayPrice: '每日特价',
27 dayPriceShow: true, 27 dayPriceShow: true,
28 - morePrice: '更多特价', 28 + morePrice: '查看更多',
29 dayPicArray: [], 29 dayPicArray: [],
30 nameData: '', //九月主推 30 nameData: '', //九月主推
31 marilyArray: [{ 31 marilyArray: [{
@@ -235,8 +235,8 @@ Page({ @@ -235,8 +235,8 @@ Page({
235 }, 235 },
236 //更多优惠 236 //更多优惠
237 moreCount() { 237 moreCount() {
238 - wx.switchTab({  
239 - url: '/pages/classify/classify', 238 + wx.navigateTo({
  239 + url: '/pages/look-more/look-more?parameter='+'1',
240 }) 240 })
241 }, 241 },
242 //加入购物车 242 //加入购物车
@@ -304,8 +304,8 @@ Page({ @@ -304,8 +304,8 @@ Page({
304 }, 304 },
305 //更多特价 305 //更多特价
306 morePrice() { 306 morePrice() {
307 - wx.switchTab({  
308 - url: '/pages/classify/classify', 307 + wx.navigateTo({
  308 + url: '/pages/look-more/look-more?parameter='+'2',
309 }) 309 })
310 }, 310 },
311 //九月主推 311 //九月主推
@@ -332,6 +332,11 @@ Page({ @@ -332,6 +332,11 @@ Page({
332 } 332 }
333 }) 333 })
334 }, 334 },
  335 + moreMainly(){
  336 + wx.navigateTo({
  337 + url: '/pages/look-more/look-more?parameter='+'3',
  338 + })
  339 + },
335 340
336 // 弹出优惠券领取 341 // 弹出优惠券领取
337 getCard() { 342 getCard() {
@@ -12,20 +12,20 @@ @@ -12,20 +12,20 @@
12 </view> 12 </view>
13 </view> --> 13 </view> -->
14 <van-search value="{{ value }}" shape="round" background='linear-gradient(137deg,#5b8eff, #2e55ff 92%)' 14 <van-search value="{{ value }}" shape="round" background='linear-gradient(137deg,#5b8eff, #2e55ff 92%)'
15 - placeholder="搜索" bind:focus="goSearch"/> 15 + placeholder="搜索" bind:focus="goSearch" />
16 </view> 16 </view>
17 <!-- 轮播图 --> 17 <!-- 轮播图 -->
18 <view style="margin-top:60rpx"> 18 <view style="margin-top:60rpx">
19 <swiper class="swiper" indicator-dots="true" autoplay="true" interval="5000" duration="1000"> 19 <swiper class="swiper" indicator-dots="true" autoplay="true" interval="5000" duration="1000">
20 <block wx:for="{{swiperArray}}" wx:for-index="idx"> 20 <block wx:for="{{swiperArray}}" wx:for-index="idx">
21 <swiper-item bindtap="goBannnerDetail" data-url="{{item.url}}" data-index="{{index}}"> 21 <swiper-item bindtap="goBannnerDetail" data-url="{{item.url}}" data-index="{{index}}">
22 - <image src="{{item.img}}" class="slideImage" ></image> 22 + <image src="{{item.img}}" class="slideImage"></image>
23 </swiper-item> 23 </swiper-item>
24 </block> 24 </block>
25 </swiper> 25 </swiper>
26 </view> 26 </view>
27 <!-- 分类 --> 27 <!-- 分类 -->
28 - <view class="classify"> 28 + <view class="{{countDownShow?'classify':'classify1'}}">
29 <scroll-view class='wrapper1' scroll-x="true"> 29 <scroll-view class='wrapper1' scroll-x="true">
30 <view wx:for="{{classifyArray}}" class="classifyItem" bindtap="classifyEvent" data-id="{{item.categoryId}}" 30 <view wx:for="{{classifyArray}}" class="classifyItem" bindtap="classifyEvent" data-id="{{item.categoryId}}"
31 data-index="{{index}}"> 31 data-index="{{index}}">
@@ -37,11 +37,11 @@ @@ -37,11 +37,11 @@
37 </scroll-view> 37 </scroll-view>
38 </view> 38 </view>
39 <!-- 限时优惠 --> 39 <!-- 限时优惠 -->
40 - <view class="dayDiscount" wx:if="{{limitCountShow}}"> 40 + <view class="dayDiscount" wx:if="{{limitCountShow}}" wx:if="{{countDownShow}}">
41 <view class="discountTitle"> 41 <view class="discountTitle">
42 <view class="limitCount">{{limitCount}}</view> 42 <view class="limitCount">{{limitCount}}</view>
43 <!-- 倒计时 --> 43 <!-- 倒计时 -->
44 - <view class="countTime" wx:if="{{countDownShow}}"> 44 + <view class="countTime">
45 <view class="textss">{{hour}}</view> 45 <view class="textss">{{hour}}</view>
46 <view class="maohao">:</view> 46 <view class="maohao">:</view>
47 <view class="textss">{{minute}}</view> 47 <view class="textss">{{minute}}</view>
@@ -70,9 +70,9 @@ @@ -70,9 +70,9 @@
70 <!-- </view> --> 70 <!-- </view> -->
71 </view> 71 </view>
72 <!-- 每日特价 --> 72 <!-- 每日特价 -->
73 - <view class="borderTop"></view> 73 + <view class="borderTop"></view>
74 <view class="dayPriceContent"> 74 <view class="dayPriceContent">
75 - <view class="dayPrice"> 75 + <view class="dayPrice" wx:if="{{dayPicArray.length!==0}}">
76 <view class="dayPriceTitle"> 76 <view class="dayPriceTitle">
77 <view class="dayPriceText">{{dayPrice}}</view> 77 <view class="dayPriceText">{{dayPrice}}</view>
78 <view class="dayPriceTime"> 78 <view class="dayPriceTime">
@@ -96,9 +96,15 @@ @@ -96,9 +96,15 @@
96 </view> 96 </view>
97 </view> 97 </view>
98 <view class="mainly"> 98 <view class="mainly">
99 - <view class="dayPriceTitle">  
100 - <view class="dayPriceText">{{nameData.name}}</view>  
101 - <view class="mainlyTitle">{{nameData.label}}</view> 99 + <view class="dayPriceTitle" style="display: flex;justify-content: space-between;">
  100 + <view>
  101 + <view class="dayPriceText">{{nameData.name}}</view>
  102 + <view class="mainlyTitle">{{nameData.label}}</view>
  103 + </view>
  104 + <view style="position: relative;">
  105 + <view bindtap="moreMainly" class="moreMainly">查看更多</view>
  106 + <view class="arrow" bindtap="moreMainly"></view>
  107 + </view>
102 </view> 108 </view>
103 <view class="dayPricePicMain"> 109 <view class="dayPricePicMain">
104 <scroll-view class='wrapper' scroll-x="true"> 110 <scroll-view class='wrapper' scroll-x="true">
@@ -122,7 +128,7 @@ @@ -122,7 +128,7 @@
122 <view class="pickDesc">{{item.goodsAttributes}}</view> 128 <view class="pickDesc">{{item.goodsAttributes}}</view>
123 <view class="userInfo"> 129 <view class="userInfo">
124 <view class="collectIcon"> 130 <view class="collectIcon">
125 - <image src="{{item.collectIcon}}"></image> 131 + <!-- <image src="{{item.collectIcon}}"></image> -->
126 <view style="display:inline-block">¥{{item.goodsPrice}}</view> 132 <view style="display:inline-block">¥{{item.goodsPrice}}</view>
127 </view> 133 </view>
128 </view> 134 </view>
@@ -19,9 +19,10 @@ @@ -19,9 +19,10 @@
19 display: flex; 19 display: flex;
20 align-items: center; 20 align-items: center;
21 justify-content: center; 21 justify-content: center;
22 - background: linear-gradient(137deg,#5b8eff, #2e55ff 92%); 22 + background: linear-gradient(137deg, #5b8eff, #2e55ff 92%);
23 z-index: 66; 23 z-index: 66;
24 } 24 }
  25 +
25 .pageTitle { 26 .pageTitle {
26 width: 100%; 27 width: 100%;
27 height: 88rpx; 28 height: 88rpx;
@@ -35,12 +36,14 @@ @@ -35,12 +36,14 @@
35 display: flex; 36 display: flex;
36 align-items: center; 37 align-items: center;
37 justify-content: center; 38 justify-content: center;
38 - background: linear-gradient(137deg,#5b8eff, #2e55ff 92%); 39 + background: linear-gradient(137deg, #5b8eff, #2e55ff 92%);
39 z-index: 66; 40 z-index: 66;
40 } 41 }
41 -.van-tabs{ 42 +
  43 +.van-tabs {
42 background: #f1f2f4; 44 background: #f1f2f4;
43 } 45 }
  46 +
44 .contenter { 47 .contenter {
45 /* margin-bottom: 100rpx; */ 48 /* margin-bottom: 100rpx; */
46 padding: 47rpx 32rpx 0 32rpx; 49 padding: 47rpx 32rpx 0 32rpx;
@@ -338,12 +341,13 @@ page { @@ -338,12 +341,13 @@ page {
338 } 341 }
339 342
340 /* 每日特价 */ 343 /* 每日特价 */
341 -.borderTop{  
342 - width:92%; 344 +.borderTop {
  345 + width: 92%;
343 height: 32rpx; 346 height: 32rpx;
344 background-color: #f1f2f4; 347 background-color: #f1f2f4;
345 border-radius: 10rpx; 348 border-radius: 10rpx;
346 } 349 }
  350 +
347 .dayPriceContent { 351 .dayPriceContent {
348 width: 686rpx; 352 width: 686rpx;
349 background-color: rgb(241, 240, 150); 353 background-color: rgb(241, 240, 150);
@@ -362,7 +366,11 @@ page { @@ -362,7 +366,11 @@ page {
362 .mainly { 366 .mainly {
363 width: 100%; 367 width: 100%;
364 } 368 }
365 - 369 +.moreMainly{
  370 + font-size: 28rpx;
  371 + color: rgb(167, 164, 164);
  372 + padding-right: 10rpx;
  373 +}
366 .dayPriceText { 374 .dayPriceText {
367 width: 128rpx; 375 width: 128rpx;
368 height: 44rpx; 376 height: 44rpx;
@@ -431,6 +439,7 @@ page { @@ -431,6 +439,7 @@ page {
431 439
432 .pickContent { 440 .pickContent {
433 /* width: 343rpx; */ 441 /* width: 343rpx; */
  442 + width: 100%;
434 display: flex; 443 display: flex;
435 justify-content: space-between; 444 justify-content: space-between;
436 margin-top: 24rpx; 445 margin-top: 24rpx;
@@ -441,13 +450,14 @@ page { @@ -441,13 +450,14 @@ page {
441 } 450 }
442 451
443 .pickItem { 452 .pickItem {
444 - width: 336rpx;  
445 - padding: 0 4rpx 8rpx; 453 + width: 49%;
  454 + /* padding: 0 4rpx 8rpx; */
446 box-sizing: border-box; 455 box-sizing: border-box;
447 background-color: #ffffff; 456 background-color: #ffffff;
448 margin-bottom: 16rpx; 457 margin-bottom: 16rpx;
449 break-inside: avoid; 458 break-inside: avoid;
450 border-radius: 16rpx; 459 border-radius: 16rpx;
  460 + padding-bottom: 8rpx;
451 } 461 }
452 462
453 .pickPic { 463 .pickPic {
@@ -466,9 +476,8 @@ page { @@ -466,9 +476,8 @@ page {
466 font-size: 28rpx; 476 font-size: 28rpx;
467 font-weight: 500; 477 font-weight: 500;
468 color: #323233; 478 color: #323233;
469 - padding-left: 8rpx; 479 + padding: 0 24rpx;
470 box-sizing: border-box; 480 box-sizing: border-box;
471 - width: 296rpx;  
472 overflow: hidden; 481 overflow: hidden;
473 text-overflow: ellipsis; 482 text-overflow: ellipsis;
474 white-space: nowrap; 483 white-space: nowrap;
@@ -481,8 +490,7 @@ page { @@ -481,8 +490,7 @@ page {
481 text-align: left; 490 text-align: left;
482 color: #7d7e80; 491 color: #7d7e80;
483 margin-top: 8rpx; 492 margin-top: 8rpx;
484 - padding-left: 8rpx;  
485 - padding-right: 16rpx; 493 + padding: 0 24rpx;
486 box-sizing: border-box; 494 box-sizing: border-box;
487 word-break: break-all; 495 word-break: break-all;
488 overflow: hidden; 496 overflow: hidden;
@@ -542,6 +550,11 @@ page { @@ -542,6 +550,11 @@ page {
542 height: 36rpx; 550 height: 36rpx;
543 justify-content: space-between; 551 justify-content: space-between;
544 text-align: right; 552 text-align: right;
  553 + padding: 0 24rpx;
  554 + box-sizing: border-box;
  555 + overflow: hidden;
  556 + white-space: nowrap;
  557 + text-overflow: ellipsis;
545 } 558 }
546 559
547 .userBox { 560 .userBox {
@@ -574,17 +587,13 @@ page { @@ -574,17 +587,13 @@ page {
574 } 587 }
575 588
576 .collectIcon { 589 .collectIcon {
577 - font-size: 24rpx; 590 + font-size: 28rpx;
578 color: #ff4742; 591 color: #ff4742;
579 display: flex; 592 display: flex;
580 align-items: center; 593 align-items: center;
581 justify-content: space-between; 594 justify-content: space-between;
582 - padding-right: 15rpx;  
583 } 595 }
584 596
585 -.collectIcon>view {  
586 - margin-left: 8rpx;  
587 -}  
588 597
589 /* 弹出层 */ 598 /* 弹出层 */
590 .delIcon { 599 .delIcon {
@@ -2,7 +2,7 @@ @@ -2,7 +2,7 @@
2 <view class="container"> 2 <view class="container">
3 <!-- 地址 --> 3 <!-- 地址 -->
4 <view class="address" bindtap="emit"> 4 <view class="address" bindtap="emit">
5 - <view class="address_content_left" style="width:92%"> 5 + <view class="address_content_left" style="width:92%">
6 <view> 6 <view>
7 <view class="userName">{{userData.name}}</view> 7 <view class="userName">{{userData.name}}</view>
8 <view class="userTell">{{userData.phone}}</view> 8 <view class="userTell">{{userData.phone}}</view>
@@ -18,22 +18,25 @@ @@ -18,22 +18,25 @@
18 </view> 18 </view>
19 </view> 19 </view>
20 <!-- 配送时间 --> 20 <!-- 配送时间 -->
21 - <view class="timeBox" > 21 + <view class="timeBox">
22 <view style="width:95%;display:flex" bindtap='chooseTime'> 22 <view style="width:95%;display:flex" bindtap='chooseTime'>
23 - <view class="calendar " >  
24 - 请选择配送时间: 23 + <view class="calendar " wx:if="{{storePickupTime==''}}">
  24 + 请选择配送时间:
  25 + </view>
  26 + <view class="calendar1 " wx:if="{{storePickupTime!==''}}">
  27 + 配送时间:
  28 + </view>
  29 + <view class="selectText">{{storePickupTime}}</view>
25 </view> 30 </view>
26 - <view class="selectText">{{storePickupTime}}</view>  
27 - </view>  
28 <view class="arrow" bindtap='chooseTime'> 31 <view class="arrow" bindtap='chooseTime'>
29 - <image src="/images/04-01/arrow.png"></image>  
30 - </view>  
31 - <view class="section">  
32 - <van-popup show="{{ showTime }}" bind:close="onClose" position="bottom" >  
33 - <timepicker deliveryTime='{{deliveryTime}}' bind:selectTime="selectTime" id="aaa"></timepicker>  
34 - </van-popup>  
35 - </view>  
36 - </view> 32 + <image src="/images/04-01/arrow.png"></image>
  33 + </view>
  34 + <view class="section">
  35 + <van-popup show="{{ showTime }}" bind:close="onClose" position="bottom">
  36 + <timepicker deliveryTime='{{deliveryTime}}' bind:selectTime="selectTime" id="aaa"></timepicker>
  37 + </van-popup>
  38 + </view>
  39 + </view>
37 <!-- 商品列表 --> 40 <!-- 商品列表 -->
38 <view class="cartList"> 41 <view class="cartList">
39 <!-- <view class="cartListItem" wx:for="{{cartList}}"> --> 42 <!-- <view class="cartListItem" wx:for="{{cartList}}"> -->
@@ -19,6 +19,13 @@ page { @@ -19,6 +19,13 @@ page {
19 color: #323233; 19 color: #323233;
20 width: 204rpx; 20 width: 204rpx;
21 } 21 }
  22 +.calendar1 {
  23 + font-size: 28rpx;
  24 + font-weight: 400;
  25 + text-align: left;
  26 + color: #323233;
  27 + width: 142rpx;
  28 +}
22 29
23 .selectText { 30 .selectText {
24 font-size: 28rpx; 31 font-size: 28rpx;
@@ -95,7 +102,7 @@ page { @@ -95,7 +102,7 @@ page {
95 102
96 .userAddress { 103 .userAddress {
97 width: 504rpx; 104 width: 504rpx;
98 - font-size: 28prx; 105 + font-size: 28rpx;
99 font-weight: 400; 106 font-weight: 400;
100 text-align: left; 107 text-align: left;
101 color: #6c6c6d; 108 color: #6c6c6d;
  1 +// pages/searchRequest/searchRequest.js
  2 +let method = require("../../utils/reuqest.js")
  3 +Page({
  4 + data: {
  5 + list: [],
  6 + keyword: '',
  7 + bottomHint: false, //触底提示
  8 + pageNum: 1,
  9 + parameter: '' //路径参数
  10 + },
  11 + getMoreSpecial() {
  12 + let postData = {
  13 + page: 1,
  14 + size: 10
  15 + }
  16 + method.postRequest("/goods/todaySpecial", postData, data => {
  17 + if (data.statusCode == 0) {
  18 + this.setData({
  19 + list: data.data
  20 + })
  21 + }
  22 + })
  23 + },
  24 + getMoreDiscount() {
  25 + let postData = {
  26 + page: this.data.pageNum,
  27 + size: 10
  28 + }
  29 + method.postRequest("/goods/limitedTimeOffer", postData, data => {
  30 + if (data.statusCode == 0) {
  31 + this.setData({
  32 + list: data.data
  33 + })
  34 + }
  35 + })
  36 + },
  37 + getMoreMainly() {
  38 + let postData = {
  39 + page: 1,
  40 + size: 10
  41 + }
  42 + method.postRequest("/goods/septemberMainPush", postData, data => {
  43 + if (data.statusCode == 0) {
  44 + this.setData({
  45 + list: data.data
  46 + })
  47 + }
  48 + })
  49 + },
  50 + //商品详情
  51 + goGoodsDetail(e) {
  52 + let id = e.currentTarget.dataset.id;
  53 + wx.navigateTo({
  54 + url: '/pages/product-detail/product-detail?id=' + id,
  55 + })
  56 + },
  57 + /**
  58 + * 生命周期函数--监听页面加载
  59 + */
  60 + onLoad: function (options) {
  61 + console.log(options, 'options')
  62 + this.setData({
  63 + parameter: options.parameter
  64 + });
  65 + if (Number(options.parameter) == 1) {
  66 + this.getMoreDiscount()
  67 + } else if (Number(options.parameter) == 2) {
  68 + this.getMoreSpecial()
  69 + } else {
  70 + this.getMoreMainly()
  71 + }
  72 + },
  73 +
  74 + /**
  75 + * 生命周期函数--监听页面初次渲染完成
  76 + */
  77 + onReady: function () {
  78 +
  79 + },
  80 +
  81 + /**
  82 + * 生命周期函数--监听页面显示
  83 + */
  84 + onShow: function () {
  85 +
  86 + },
  87 +
  88 + /**
  89 + * 生命周期函数--监听页面隐藏
  90 + */
  91 + onHide: function () {
  92 +
  93 + },
  94 +
  95 + /**
  96 + * 生命周期函数--监听页面卸载
  97 + */
  98 + onUnload: function () {
  99 +
  100 + },
  101 +
  102 + /**
  103 + * 页面相关事件处理函数--监听用户下拉动作
  104 + */
  105 + onRefresh() {
  106 + this.setData({
  107 + pageNum: 1,
  108 + list: []
  109 + })
  110 + let parameter = this.data.parameter;
  111 + if (parameter==1) {
  112 + this.getMoreDiscount()
  113 + }else if(parameter==2){
  114 + this.getMoreSpecial()
  115 + }else{
  116 + this.getMoreMainly()
  117 + }
  118 + },
  119 + onPullDownRefresh: function () {
  120 +
  121 + },
  122 +
  123 + /**
  124 + * 页面上拉触底事件的处理函数
  125 + */
  126 + onReachBottom: function () {
  127 + this.setData({
  128 + bottomHint: true
  129 + })
  130 + setTimeout(() => {
  131 + this.setData({
  132 + bottomHint: false
  133 + })
  134 + }, 2000)
  135 + },
  136 +
  137 + /**
  138 + * 用户点击右上角分享
  139 + */
  140 + onShareAppMessage: function () {
  141 +
  142 + }
  143 +})
  1 +{
  2 + "usingComponents": {
  3 + "van-search": "@vant/weapp/search/index"
  4 + },
  5 + "navigationBarTitleText": "查看更多",
  6 + "enablePullDownRefresh": true
  7 +}
  1 +<!--pages/searchRequest/searchRequest.wxml-->
  2 +<!-- 搜索 -->
  3 +<!-- <view class="search_center" catchtap="goSearch">
  4 + <van-search value="{{keyword}}" placeholder="请输入搜索关键词" use-action-slot shape="round" bind:change="onChange"
  5 + bind:search="onSearch">
  6 + <view slot="action" bind:tap="onClick">搜索</view>
  7 + </van-search>
  8 +</view> -->
  9 +<!-- 商品列表 -->
  10 +<view class="productList" wx:if="{{list.length==0}}">
  11 + 没有找到您想要的商品~
  12 +</view>
  13 +<view class="listBox">
  14 + <view class="pickContainer">
  15 + <view class="pickContent">
  16 + <view class="pickItem" wx:for="{{list}}" data-id="{{item.goodsId}}" bindtap="goGoodsDetail">
  17 + <view class="pickPic">
  18 + <image src="{{item.goodsImg}}"></image>
  19 + </view>
  20 + <view class="pickTitle">{{item.goodsName}}</view>
  21 + <view class="pickDesc">{{item.goodsAttributes}}</view>
  22 + <view class="collectIcon">
  23 + <view style="height:10rpx;display:none"></view>
  24 + <view style="display:inline-block;font-size: 28rpx; padding: 10rpx 0;">¥{{item.goodsPrice}}</view>
  25 + </view>
  26 + </view>
  27 + </view>
  28 + </view>
  29 +</view>
  30 +<view class="bottomHint" wx:if="{{bottomHint}}">
  31 + 我是有底线的~
  32 + </view>
  1 +/* pages/searchRequest/searchRequest.wxss */
  2 +/* 搜索 */
  3 +/* 搜索框 */
  4 +page{
  5 + background-color: #f1f2f4;
  6 +}
  7 +.search_center {
  8 + height: 90rpx;
  9 + width: 750rpx;
  10 + margin-bottom: 24rpx;
  11 + position: fixed;
  12 + top: 2rpx;
  13 + left: 0;
  14 + background-color: #f1f2f4;
  15 +}
  16 +
  17 +.real_search_center {
  18 + margin: 0 auto;
  19 + margin-bottom: 24rpx;
  20 + width: 686rpx;
  21 + height: 64rpx;
  22 + background: rgba(255, 255, 255, 1);
  23 + border-radius: 186rpx;
  24 + position: relative;
  25 +}
  26 +
  27 +.icon-sousuo {
  28 + font-size: 32rpx;
  29 + position: absolute;
  30 + top: 50%;
  31 + transform: translateY(-50%);
  32 + left: 20rpx;
  33 +}
  34 +
  35 +.real_search_center input {
  36 + width: 676rpx;
  37 + height: 100%;
  38 + margin: 0 auto;
  39 + border-radius: 46rpx;
  40 + font-size: 28rpx;
  41 + font-family: PingFang SC;
  42 + font-weight: 400;
  43 + line-height: 64rpx;
  44 + color: rgba(189, 196, 206, 1);
  45 + padding: 0 60rpx;
  46 + box-sizing: border-box;
  47 + padding-left: 20rpx;
  48 + box-sizing: border-box;
  49 + overflow: hidden;
  50 + text-overflow: ellipsis;
  51 + white-space: nowrap;
  52 + background: #ffffff;
  53 +}
  54 +.search_right {
  55 + width: 66rpx;
  56 + height: 64rpx;
  57 + border-radius: 20rpx;
  58 + text-align: center;
  59 + line-height: 64rpx;
  60 + color: #fff;
  61 + font-size: 28rpx;
  62 + font-family: PingFang SC;
  63 + font-weight: 400;
  64 + display: flex;
  65 + align-items: center;
  66 +}
  67 +.search_right image {
  68 + width: 36rpx;
  69 + height: 36rpx;
  70 +}
  71 +.placeholder {
  72 + font-size: 28rpx;
  73 + font-family: PingFang SC;
  74 + font-weight: 400;
  75 + line-height: 64rpx;
  76 + color: rgba(189, 196, 206, 1);
  77 +}
  78 +.search_right {
  79 + width: 104rpx;
  80 + height: 48rpx;
  81 + border-radius: 20rpx;
  82 + text-align: center;
  83 + color: rgb(223, 219, 219);
  84 + font-size: 28rpx;
  85 + font-weight: 400;
  86 + display: inline-block;
  87 + position: absolute;
  88 + top: 3rpx;
  89 + right: 8rpx;
  90 + cursor: progress;
  91 +}
  92 +/* 商品列表 */
  93 +.productList{
  94 + width: 750rpx;
  95 + height:750rpx;
  96 + display: flex;
  97 + justify-content: center;
  98 + align-items: center;
  99 + font-size: 32rpx;
  100 + color: rgb(206, 208, 209);
  101 +}
  102 +.listBox{
  103 + display: flex;
  104 + padding: 0 26rpx;
  105 + box-sizing: border-box;
  106 +}
  107 +/* 每日精选*/
  108 +.pickContainer {
  109 + display: flex;
  110 + justify-content: space-between;
  111 + flex-direction: row;
  112 +}
  113 +
  114 +.pickContent {
  115 + /* width: 343rpx; */
  116 + display: flex;
  117 + justify-content: space-between;
  118 + margin-top: 24rpx;
  119 + flex-wrap: wrap;
  120 + border-radius: 16rpx;
  121 + column-count: 2;
  122 + column-gap: 20rpx;
  123 + width: 700rpx;
  124 +}
  125 +
  126 +.pickItem {
  127 + width: 336rpx;
  128 + box-sizing: border-box;
  129 + background-color: #ffffff;
  130 + margin-bottom: 16rpx;
  131 + break-inside: avoid;
  132 + border-radius: 16rpx;
  133 + padding-bottom: 8rpx;
  134 +}
  135 +
  136 +.pickPic {
  137 + width: 100%;
  138 + height: 328rpx;
  139 +}
  140 +
  141 +.pickPic image {
  142 + width: 100%;
  143 + height: 328rpx;
  144 + border-radius: 16rpx;
  145 +}
  146 +
  147 +.pickTitle {
  148 + margin-top: 16rpx;
  149 + font-size: 28rpx;
  150 + font-weight: 500;
  151 + color: #323233;
  152 + padding-left: 8rpx;
  153 + box-sizing: border-box;
  154 +}
  155 +
  156 +.pickDesc {
  157 + font-size: 24rpx;
  158 + font-weight: 400;
  159 + text-align: left;
  160 + color: #7d7e80;
  161 + margin-top: 8rpx;
  162 + padding-left: 8rpx;
  163 + padding-right: 16rpx;
  164 + box-sizing: border-box;
  165 + width: 310rpx;
  166 + overflow: hidden;
  167 +}
  168 +
  169 +.pickCollect {
  170 + font-size: 24rpx;
  171 + font-weight: 400;
  172 + text-align: left;
  173 + color: #7d7e80;
  174 + margin-top: 8rpx;
  175 + padding-left: 8rpx;
  176 + padding-right: 16rpx;
  177 + box-sizing: border-box;
  178 + display: flex;
  179 + justify-content: space-between;
  180 +}
  181 +.collectIcon {
  182 + font-size: 24rpx;
  183 + color: #ff4742;
  184 + display: flex;
  185 + align-items: center;
  186 + justify-content: space-between;
  187 +}
  188 +
  189 +.collectIcon>view {
  190 + margin-left: 8rpx;
  191 +}
  192 +.bottomHint {
  193 + background-color: #f1f2f4;
  194 + font-size: 24rpx;
  195 + color: gray;
  196 + display: flex;
  197 + justify-content: center;
  198 + padding-bottom:16rpx;
  199 +}
@@ -3,6 +3,7 @@ let method = require("../../utils/reuqest.js"); @@ -3,6 +3,7 @@ let method = require("../../utils/reuqest.js");
3 const util = require("../../utils/util.js"); 3 const util = require("../../utils/util.js");
4 Page({ 4 Page({
5 data: { 5 data: {
  6 + Authorization: '', //判断用户是否登录
6 id: '', 7 id: '',
7 skuId: '', 8 skuId: '',
8 goodsId: '', 9 goodsId: '',
@@ -29,7 +30,7 @@ Page({ @@ -29,7 +30,7 @@ Page({
29 showMask: false, 30 showMask: false,
30 showMaskTwo: false, 31 showMaskTwo: false,
31 showMaskSku: false, 32 showMaskSku: false,
32 - count: "", 33 + count: 1,
33 payCount: 1, 34 payCount: 1,
34 stockNum: '', 35 stockNum: '',
35 richText: '', 36 richText: '',
@@ -38,7 +39,7 @@ Page({ @@ -38,7 +39,7 @@ Page({
38 ceshi: [], //商品规格 39 ceshi: [], //商品规格
39 idx: 0, //商品规格 40 idx: 0, //商品规格
40 jifenNum: '', //商品积分 41 jifenNum: '', //商品积分
41 - integral:'' 42 + integral: ''
42 }, 43 },
43 //倒计时 44 //倒计时
44 onChange1(e) { 45 onChange1(e) {
@@ -120,7 +121,7 @@ Page({ @@ -120,7 +121,7 @@ Page({
120 // richText:data.data.goodsDesc 121 // richText:data.data.goodsDesc
121 richText: richText, 122 richText: richText,
122 goodsId: data.data.goodsId, 123 goodsId: data.data.goodsId,
123 - jifenNum:data.data.goodsPrice, 124 + jifenNum: data.data.goodsPrice,
124 }) 125 })
125 this.evaluate() 126 this.evaluate()
126 console.log(this.data.goodsId, 'goodsid') 127 console.log(this.data.goodsId, 'goodsid')
@@ -156,9 +157,9 @@ Page({ @@ -156,9 +157,9 @@ Page({
156 //进入购物车 157 //进入购物车
157 goCart() { 158 goCart() {
158 if (wx.getStorageSync('Authorization') == " ") { 159 if (wx.getStorageSync('Authorization') == " ") {
159 - setTimeout(() => {  
160 - util.getUser();  
161 - }, 2000) 160 + // setTimeout(() => {
  161 + // util.getUser();
  162 + // }, 2000)
162 } else { 163 } else {
163 wx.switchTab({ 164 wx.switchTab({
164 url: '/pages/shopping-cart/shopping-cart', 165 url: '/pages/shopping-cart/shopping-cart',
@@ -167,40 +168,41 @@ Page({ @@ -167,40 +168,41 @@ Page({
167 }, 168 },
168 // 收藏 169 // 收藏
169 collection() { 170 collection() {
170 - if (this.data.goodsData.keep) {  
171 - let data = this.data.goodsData;  
172 - data.keep = false;  
173 - this.setData({  
174 - goodsData: data 171 + if (this.data.Authorization) {
  172 + if (this.data.goodsData.keep) {
  173 + let data = this.data.goodsData;
  174 + data.keep = false;
  175 + this.setData({
  176 + goodsData: data
  177 + })
  178 + } else {
  179 + let data = this.data.goodsData;
  180 + data.keep = true;
  181 + this.setData({
  182 + goodsData: data
  183 + })
  184 + }
  185 + method.getRequest("/myUser/myCollection/" + this.data.goodsId, data => {
  186 + if (data.statusCode == 0) {} else {}
175 }) 187 })
176 } else { 188 } else {
177 - let data = this.data.goodsData;  
178 - data.keep = true;  
179 - this.setData({  
180 - goodsData: data 189 + wx.showToast({
  190 + title: '请先登录',
  191 + icon: 'none'
181 }) 192 })
  193 + setTimeout(() => {
  194 + util.getUser()
  195 + }, 2000)
182 } 196 }
183 - method.getRequest("/myUser/myCollection/" + this.data.goodsId, data => {  
184 - if (data.statusCode == 0) {  
185 197
186 - } else {  
187 - wx.showToast({  
188 - title: '请先登录',  
189 - icon: 'none'  
190 - })  
191 - setTimeout(() => {  
192 - util.getUser()  
193 - }, 2000)  
194 - }  
195 - })  
196 }, 198 },
197 //联系客服 199 //联系客服
198 linkKefu() { 200 linkKefu() {
199 201
200 if (getStorageSync.Authorization == "") { 202 if (getStorageSync.Authorization == "") {
201 - setTimeout(() => {  
202 - util.getUser()  
203 - }, 2000) 203 + // setTimeout(() => {
  204 + // util.getUser()
  205 + // }, 2000)
204 } else { 206 } else {
205 wx.makePhoneCall({ 207 wx.makePhoneCall({
206 phoneNumber: '111111111000', 208 phoneNumber: '111111111000',
@@ -236,21 +238,43 @@ Page({ @@ -236,21 +238,43 @@ Page({
236 }, 238 },
237 //在线客服 239 //在线客服
238 myKefu() { 240 myKefu() {
239 - wx.makePhoneCall({  
240 - phoneNumber: '111111111000',  
241 - success() {  
242 - console.log('拨打电话成功')  
243 - },  
244 - fail() {  
245 - console.log('拨打电话失败')  
246 - }  
247 - }) 241 + if (this.data.Authorization) {
  242 + wx.makePhoneCall({
  243 + phoneNumber: '111111111000',
  244 + success() {
  245 + console.log('拨打电话成功')
  246 + },
  247 + fail() {
  248 + console.log('拨打电话失败')
  249 + }
  250 + })
  251 + } else {
  252 + wx.showToast({
  253 + title: '请先登录!',
  254 + icon: 'none'
  255 + })
  256 + setTimeout(() => {
  257 + util.getUser()
  258 + }, 2000)
  259 + }
  260 +
248 }, 261 },
249 //加入购物车 262 //加入购物车
250 addCart() { 263 addCart() {
251 - this.setData({  
252 - showMask: true  
253 - }) 264 + if (this.data.Authorization) {
  265 + this.setData({
  266 + showMask: true
  267 + })
  268 + } else {
  269 + wx.showToast({
  270 + title: '请先登录!',
  271 + icon: 'none'
  272 + })
  273 + setTimeout(() => {
  274 + util.getUser()
  275 + }, 2000)
  276 + }
  277 +
254 }, 278 },
255 closeMask() { 279 closeMask() {
256 this.setData({ 280 this.setData({
@@ -280,9 +304,9 @@ Page({ @@ -280,9 +304,9 @@ Page({
280 duration: 1000 304 duration: 1000
281 }) 305 })
282 } else { 306 } else {
283 - setTimeout(() => {  
284 - util.getUser()  
285 - }, 2000) 307 + // setTimeout(() => {
  308 + // util.getUser()
  309 + // }, 2000)
286 } 310 }
287 }) 311 })
288 }, 312 },
@@ -365,28 +389,57 @@ Page({ @@ -365,28 +389,57 @@ Page({
365 }, 389 },
366 //立即购买 390 //立即购买
367 immediatelyPay() { 391 immediatelyPay() {
368 - method.getRequest("/myUser/queryUserInfo", data => {  
369 - if (data.statusCode == 0) {  
370 - this.setData({  
371 - integral: data.data.integral  
372 - })  
373 - if (this.data.jifenNum > this.data.integral) {  
374 - wx.showToast({  
375 - title: '您的积分目前不够兑换该商品',  
376 - icon: 'none'  
377 - })  
378 - return false  
379 - } else { 392 + if (this.data.Authorization) {
  393 + method.getRequest("/myUser/queryUserInfo", data => {
  394 + if (data.statusCode == 0) {
380 this.setData({ 395 this.setData({
381 showMaskTwo: true 396 showMaskTwo: true
382 }) 397 })
383 } 398 }
384 - } else {  
385 - setTimeout(() => {  
386 - util.getUser()  
387 - }, 2000)  
388 - }  
389 - }) 399 + })
  400 + } else {
  401 + wx.showToast({
  402 + title: '请先登录!',
  403 + icon: 'none'
  404 + })
  405 + setTimeout(() => {
  406 + util.getUser()
  407 + }, 2000)
  408 + }
  409 + },
  410 + //立即兑换
  411 + immediatelyPay1() {
  412 + if (this.data.Authorization) {
  413 + method.getRequest("/myUser/queryUserInfo", data => {
  414 + if (data.statusCode == 0) {
  415 + this.setData({
  416 + integral: data.data.integral
  417 + })
  418 + if (this.data.jifenNum > this.data.integral) {
  419 + wx.showToast({
  420 + title: '您的积分目前不够兑换该商品',
  421 + icon: 'none'
  422 + })
  423 + return false
  424 + } else {
  425 + this.setData({
  426 + showMaskTwo: true
  427 + })
  428 + }
  429 + } else {
  430 +
  431 + }
  432 + })
  433 + } else {
  434 + wx.showToast({
  435 + title: '请先登录!',
  436 + icon: 'none'
  437 + })
  438 + setTimeout(() => {
  439 + util.getUser()
  440 + }, 2000)
  441 + }
  442 +
390 443
391 }, 444 },
392 closeMaskTwo() { 445 closeMaskTwo() {
@@ -417,9 +470,9 @@ Page({ @@ -417,9 +470,9 @@ Page({
417 duration: 1000 470 duration: 1000
418 }) 471 })
419 } else { 472 } else {
420 - setTimeout(() => {  
421 - util.getUser()  
422 - }, 2000) 473 + // setTimeout(() => {
  474 + // util.getUser()
  475 + // }, 2000)
423 } 476 }
424 }) 477 })
425 }, 478 },
@@ -490,6 +543,16 @@ Page({ @@ -490,6 +543,16 @@ Page({
490 setTimeout(() => { 543 setTimeout(() => {
491 this.demoDown(); 544 this.demoDown();
492 }, 200) 545 }, 200)
  546 + //判断用户是否登录
  547 + if (wx.getStorageSync('Authorization') === '') {
  548 + this.setData({
  549 + Authorization: false
  550 + })
  551 + } else {
  552 + this.setData({
  553 + Authorization: true
  554 + })
  555 + }
493 }, 556 },
494 557
495 /** 558 /**
@@ -41,7 +41,8 @@ @@ -41,7 +41,8 @@
41 41
42 </view> 42 </view>
43 <!-- 请选择 --> 43 <!-- 请选择 -->
44 - <view class="selectMain" bindtap="selectSku"> 44 + <view class="selectMain" bindtap="addCart">
  45 + <!-- <view class="selectMain" bindtap="selectSku"> -->
45 <view class="selectTitle">选择</view> 46 <view class="selectTitle">选择</view>
46 <view class="selectNum"> 47 <view class="selectNum">
47 <view>{{}}</view> 48 <view>{{}}</view>
@@ -65,10 +66,13 @@ @@ -65,10 +66,13 @@
65 <view class="noData" wx:if="{{infoList.length==0}}">暂时没有相关商品的更多评价~</view> 66 <view class="noData" wx:if="{{infoList.length==0}}">暂时没有相关商品的更多评价~</view>
66 <view class="evaluateBox" wx:for="{{infoList}}" wx:if="{{infolist!==0}}"> 67 <view class="evaluateBox" wx:for="{{infoList}}" wx:if="{{infolist!==0}}">
67 <view class="evaluateInfo"> 68 <view class="evaluateInfo">
68 - <view class="userImg" style="display:inline-block"> 69 + <view class="userImg" style="display:inline-block" wx:if="{{item.anonymous==0}}">
69 <image src="{{item.wxHeadImg}}"> </image> 70 <image src="{{item.wxHeadImg}}"> </image>
70 </view> 71 </view>
71 - <view class="userName" style="display:inline-block">{{item.wxName}}</view> 72 + <view class="userImg" style="display:inline-block" wx:if="{{item.anonymous==1}}">
  73 + <image src="/images/nimingtouxiang.png"> </image>
  74 + </view>
  75 + <view class="userName" style="display:inline-block" >{{item.wxName}}</view>
72 </view> 76 </view>
73 <view class="evaluateDetails">{{item.content}}</view> 77 <view class="evaluateDetails">{{item.content}}</view>
74 <view class="evaluatePic" wx:if="{{item.images}}"> 78 <view class="evaluatePic" wx:if="{{item.images}}">
@@ -124,7 +128,7 @@ @@ -124,7 +128,7 @@
124 <view class="Mask"></view> 128 <view class="Mask"></view>
125 </view> 129 </view>
126 <view class="bottom_right_two" wx:if="{{goodsData.type==1}}"> 130 <view class="bottom_right_two" wx:if="{{goodsData.type==1}}">
127 - <view class="bottom_right_right_two" catchtap="immediatelyPay">立即兑换</view> 131 + <view class="bottom_right_right_two" catchtap="immediatelyPay1">立即兑换</view>
128 </view> 132 </view>
129 </view> 133 </view>
130 <!-- 选择规格弹框 --> 134 <!-- 选择规格弹框 -->
@@ -137,7 +141,7 @@ @@ -137,7 +141,7 @@
137 </view> 141 </view>
138 </view> 142 </view>
139 <!-- 加入购物车弹框 --> 143 <!-- 加入购物车弹框 -->
140 -<view class="mask" catchtap="closeMask" wx:if='{{showMask}}'> 144 +<!-- <view class="mask" catchtap="closeMask" wx:if='{{showMask}}'>
141 <view class="diceng" catchtap="openMask"> 145 <view class="diceng" catchtap="openMask">
142 <view class="info"> 146 <view class="info">
143 <image src="{{goodsData.goodsBanners[idx]}}"></image> 147 <image src="{{goodsData.goodsBanners[idx]}}"></image>
@@ -155,6 +159,8 @@ @@ -155,6 +159,8 @@
155 catchtap="changeAttrNum">{{cell.spec_value}}</view> 159 catchtap="changeAttrNum">{{cell.spec_value}}</view>
156 </view> 160 </view>
157 </view> 161 </view>
  162 + <view>
  163 + </view>
158 <view class="pay_count"> 164 <view class="pay_count">
159 <view>购买数量</view> 165 <view>购买数量</view>
160 <view class="count_box"> 166 <view class="count_box">
@@ -167,6 +173,40 @@ @@ -167,6 +173,40 @@
167 <view class="btn" wx:if='{{type==1}}' catchtap="jiagou">加入购物车</view> 173 <view class="btn" wx:if='{{type==1}}' catchtap="jiagou">加入购物车</view>
168 <view class="btn" wx:if='{{type==2}}' catchtap="lijigoumai">立即购买</view> 174 <view class="btn" wx:if='{{type==2}}' catchtap="lijigoumai">立即购买</view>
169 </view> 175 </view>
  176 +</view> -->
  177 +<view class="mask" catchtap="closeMask" wx:if='{{showMask}}'>
  178 + <view class="diceng" catchtap="openMask">
  179 + <view class="info">
  180 + <image src="{{goodsData.goodsBanners[0]}}"></image>
  181 + <view class="info_right">
  182 + <view class="info_name">{{goodsData.goodsName}}</view>
  183 + <view class="info_price">¥{{goodsData.list[idx].goodsPrice}}</view>
  184 + <view class="info_stock">库存:{{goodsData.list[idx].goodsStock}}件</view>
  185 + <view class="info_stock" wx:if='{{info.detai.spec_type=="20"}}'>请选择规格</view>
  186 + </view>
  187 + </view>
  188 + <view class="attr" wx:if='{{info.detail.spec_type=="20"}}' wx:for='{{info.specData.spec_attr}}' wx:key='index'>
  189 + <view>{{item.group_name}}</view>
  190 + <view class="attr_main">
  191 + <view class="attr_item {{cell.flag?'activity':''}}" wx:for='{{item.spec_items}}' wx:for-item='cell'
  192 + wx:for-index='cellindex' wx:key='{{cellindex}}' data-index='{{index}}' data-cellindex='{{cellindex}}'
  193 + catchtap="changeAttrNum">{{cell.spec_value}}</view>
  194 + </view>
  195 + </view>
  196 + <view class="spec">
  197 + <view class="{{idx==index?'specItem1':'specItem'}}" wx:for="{{goodsData.list}}" bindtap="check"
  198 + data-index="{{index}}" data-id="{{item.goodsSkuId}}">{{item.goodsSkuName}}</view>
  199 + </view>
  200 + <view class="pay_count">
  201 + <view>购买数量</view>
  202 + <view class="count_box">
  203 + <view class="count_jian" catchtap="decNum">-</view>
  204 + <view class="real_count">{{count}}</view>
  205 + <view class="count_jian" catchtap="addNum">+</view>
  206 + </view>
  207 + </view>
  208 + <view class="confrimBtn" catchtap="confrimCart">确定</view>
  209 + </view>
170 </view> 210 </view>
171 <!-- 立即购买弹框 --> 211 <!-- 立即购买弹框 -->
172 <view class="mask" catchtap="closeMaskTwo" wx:if='{{showMaskTwo}}'> 212 <view class="mask" catchtap="closeMaskTwo" wx:if='{{showMaskTwo}}'>
@@ -174,6 +214,7 @@ @@ -174,6 +214,7 @@
174 <view class="info"> 214 <view class="info">
175 <image src="{{goodsData.goodsBanners[0]}}"></image> 215 <image src="{{goodsData.goodsBanners[0]}}"></image>
176 <view class="info_right"> 216 <view class="info_right">
  217 + <view class="info_name">{{goodsData.goodsName}}</view>
177 <view class="info_price">¥{{goodsData.list[idx].goodsPrice}}</view> 218 <view class="info_price">¥{{goodsData.list[idx].goodsPrice}}</view>
178 <view class="info_stock">库存:{{goodsData.list[idx].goodsStock}}件</view> 219 <view class="info_stock">库存:{{goodsData.list[idx].goodsStock}}件</view>
179 <view class="info_stock" wx:if='{{info.detai.spec_type=="20"}}'>请选择规格</view> 220 <view class="info_stock" wx:if='{{info.detai.spec_type=="20"}}'>请选择规格</view>
@@ -187,6 +228,18 @@ @@ -187,6 +228,18 @@
187 catchtap="changeAttrNum">{{cell.spec_value}}</view> 228 catchtap="changeAttrNum">{{cell.spec_value}}</view>
188 </view> 229 </view>
189 </view> 230 </view>
  231 + <view class="attr" wx:if='{{info.detail.spec_type=="20"}}' wx:for='{{info.specData.spec_attr}}' wx:key='index'>
  232 + <view>{{item.group_name}}</view>
  233 + <view class="attr_main">
  234 + <view class="attr_item {{cell.flag?'activity':''}}" wx:for='{{item.spec_items}}' wx:for-item='cell'
  235 + wx:for-index='cellindex' wx:key='{{cellindex}}' data-index='{{index}}' data-cellindex='{{cellindex}}'
  236 + catchtap="changeAttrNum">{{cell.spec_value}}</view>
  237 + </view>
  238 + </view>
  239 + <view class="spec">
  240 + <view class="{{idx==index?'specItem1':'specItem'}}" wx:for="{{goodsData.list}}" bindtap="check"
  241 + data-index="{{index}}" data-id="{{item.goodsSkuId}}">{{item.goodsSkuName}}</view>
  242 + </view>
190 <view class="pay_count"> 243 <view class="pay_count">
191 <view>购买数量</view> 244 <view>购买数量</view>
192 <view class="count_box"> 245 <view class="count_box">
@@ -212,7 +212,7 @@ @@ -212,7 +212,7 @@
212 /* 评价 */ 212 /* 评价 */
213 .evaluateContent { 213 .evaluateContent {
214 width: 750rpx; 214 width: 750rpx;
215 - max-height: 236rpx; 215 + max-height: 252rpx;
216 box-sizing: border-box; 216 box-sizing: border-box;
217 background-color: #ffffff; 217 background-color: #ffffff;
218 margin: 0 auto; 218 margin: 0 auto;
@@ -601,14 +601,17 @@ button { @@ -601,14 +601,17 @@ button {
601 601
602 .info_right { 602 .info_right {
603 width: calc(100% - 212rpx); 603 width: calc(100% - 212rpx);
604 - padding-top: 46rpx;  
605 padding-left: 36rpx; 604 padding-left: 36rpx;
606 box-sizing: border-box; 605 box-sizing: border-box;
607 display: flex; 606 display: flex;
608 flex-direction: column; 607 flex-direction: column;
609 justify-content: flex-end 608 justify-content: flex-end
610 } 609 }
611 - 610 +.info_name{
  611 + margin-bottom: 48rpx;
  612 + font-size: 30rpx;
  613 + color: #323233;
  614 +}
612 .info_price { 615 .info_price {
613 font-size: 28rpx; 616 font-size: 28rpx;
614 font-family: PingFang SC; 617 font-family: PingFang SC;
@@ -733,6 +736,217 @@ button { @@ -733,6 +736,217 @@ button {
733 margin-top: 20rpx; 736 margin-top: 20rpx;
734 } 737 }
735 738
  739 +/* 购物车弹框 */
  740 +.mask {
  741 + position: fixed;
  742 + top: 72rpx;
  743 + left: 0;
  744 + width: 100%;
  745 + height: 100%;
  746 + background: rgba(0, 0, 0, 0.5);
  747 + z-index: 2
  748 +}
  749 +
  750 +.diceng {
  751 + width: 100%;
  752 + position: absolute;
  753 + bottom: 40rpx;
  754 + left: 0;
  755 + border-radius: 10rpx 10rpx 0 0;
  756 + background: #fff;
  757 + padding: 30rpx 32rpx;
  758 + box-sizing: border-box;
  759 + max-height: 94%;
  760 + overflow-y: auto;
  761 + margin-bottom: 22rpx;
  762 +}
  763 +
  764 +.info {
  765 + display: flex;
  766 +}
  767 +
  768 +.info image {
  769 + width: 176rpx;
  770 + height: 176rpx;
  771 + display: block;
  772 + border: 1rpx solid #ff6d00;
  773 + border-radius: 8rpx;
  774 +}
  775 +
  776 +.info_right {
  777 + width: calc(100% - 212rpx);
  778 + padding-left: 36rpx;
  779 + box-sizing: border-box;
  780 + display: flex;
  781 + flex-direction: column;
  782 + justify-content: flex-end
  783 +}
  784 +
  785 +.info_price {
  786 + font-size: 28rpx;
  787 + font-family: PingFang SC;
  788 + font-weight: 400;
  789 + line-height: 40rpx;
  790 + color: rgba(255, 109, 0, 1);
  791 +}
  792 +
  793 +.info_stock {
  794 + margin-top: 6rpx;
  795 + font-size: 28rpx;
  796 + font-family: PingFang SC;
  797 + font-weight: 400;
  798 + line-height: 40rpx;
  799 + color: rgba(140, 145, 152, 1);
  800 +}
  801 +
  802 +.attr {
  803 + margin-top: 46rpx;
  804 + font-size: 28rpx;
  805 + font-family: PingFang SC;
  806 + font-weight: 500;
  807 + line-height: 40rpx;
  808 + color: rgba(6, 18, 30, 1);
  809 +}
  810 +
  811 +.attr_main {
  812 + margin-top: 10rpx;
  813 + display: flex;
  814 + flex-wrap: wrap;
  815 +}
  816 +
  817 +.attr_item {
  818 + padding: 0 50rpx;
  819 + height: 60rpx;
  820 + box-sizing: border-box;
  821 + background: rgba(238, 238, 238, 1);
  822 + border-radius: 30rpx;
  823 + font-size: 28rpx;
  824 + font-family: PingFang SC;
  825 + font-weight: 400;
  826 + line-height: 60rpx;
  827 + color: rgba(6, 18, 30, 1);
  828 + margin: 22rpx 22rpx 0 0;
  829 + border: 2rpx solid transparent;
  830 +}
  831 +
  832 +.attr_item.activity {
  833 + background: rgba(253, 229, 211, 1);
  834 + border: 2rpx solid rgba(246, 105, 0, 1);
  835 + color: rgba(255, 109, 0, 1);
  836 +}
  837 +
  838 +.spec {
  839 + width: 100%;
  840 + padding: 10rpx;
  841 + display: flex;
  842 + flex-wrap: wrap;
  843 + margin-right: 20rpx;
  844 + align-items: center;
  845 + justify-content: space-around;
  846 + border-top: 3rpx solid #f5f5f5;
  847 + margin-top: 20rpx;
  848 +}
  849 +
  850 +.specItem {
  851 + font-size: 30rpx;
  852 + color: #323233;
  853 + height: 57rpx;
  854 + width: auto;
  855 + background-color: rgb(238, 239, 241);
  856 + padding: 0 20rpx;
  857 + border-radius: 16rpx;
  858 + margin-bottom: 10rpx;
  859 + display: flex;
  860 + width: auto;
  861 + align-items: center;
  862 +}
  863 +
  864 +.specItem1 {
  865 + font-size: 30rpx;
  866 + color: #323233;
  867 + height: 57rpx;
  868 + width: auto;
  869 + background-color: rgb(197, 198, 199);
  870 + padding: 0 20rpx;
  871 + border-radius: 16rpx;
  872 + margin-bottom: 10rpx;
  873 + display: flex;
  874 + justify-content: center;
  875 + align-items: center;
  876 + width: auto;
  877 +}
  878 +
  879 +.pay_count {
  880 + padding: 24rpx 0;
  881 + box-sizing: border-box;
  882 + display: flex;
  883 + align-items: center;
  884 + justify-content: space-between;
  885 + border-top: 1rpx solid #eee;
  886 + border-bottom: 1rpx solid #eee;
  887 + font-size: 28rpx;
  888 + font-family: PingFang SC;
  889 + font-weight: 500;
  890 + color: rgba(6, 18, 30, 1);
  891 + margin-top: 0;
  892 +}
  893 +
  894 +.count_box {
  895 + display: flex;
  896 + align-items: center;
  897 +}
  898 +
  899 +.count_jian {
  900 + width: 56rpx;
  901 + height: 56rpx;
  902 + background: rgba(238, 238, 238, 1);
  903 + border-radius: 8rpx;
  904 + text-align: center;
  905 + line-height: 56rpx;
  906 + font-size: 38rpx;
  907 + font-family: PingFang SC;
  908 + font-weight: 400;
  909 + color: rgba(6, 18, 30, 1);
  910 + display: flex;
  911 + align-items: center;
  912 + justify-content: center;
  913 +}
  914 +
  915 +.real_count {
  916 + padding: 0 20rpx;
  917 + box-sizing: border-box;
  918 + font-size: 32rpx;
  919 + font-family: PingFang SC;
  920 + font-weight: 500;
  921 + line-height: 56rpx;
  922 + color: rgba(61, 68, 77, 1);
  923 +}
  924 +
  925 +.btn {
  926 + height: 100rpx;
  927 + text-align: center;
  928 + line-height: 100rpx;
  929 + width: 100vw;
  930 + margin-left: -32rpx;
  931 + background: rgba(255, 109, 0, 1);
  932 + color: #fff;
  933 + font-size: 28rpx;
  934 + font-family: PingFang SC;
  935 + font-weight: 400;
  936 + margin-top: 64rpx;
  937 +}
  938 +
  939 +.confrimBtn {
  940 + height: 78rpx;
  941 + display: flex;
  942 + background-color: #f16304;
  943 + color: #ffffff;
  944 + align-items: center;
  945 + justify-content: center;
  946 + margin-top: 20rpx;
  947 + border-radius: 36rpx;
  948 +}
  949 +
736 /* 商品明细 */ 950 /* 商品明细 */
737 rich-text .rich-img { 951 rich-text .rich-img {
738 width: 100%; 952 width: 100%;
@@ -13,7 +13,8 @@ Page({ @@ -13,7 +13,8 @@ Page({
13 title: '香蕉' 13 title: '香蕉'
14 }], 14 }],
15 title: '猜你喜欢', 15 title: '猜你喜欢',
16 - list: [] 16 + list: [],
  17 + bottomHint:false //触底提示
17 }, 18 },
18 //获取输入的关键字 19 //获取输入的关键字
19 onChange(e) { 20 onChange(e) {
@@ -56,18 +57,18 @@ Page({ @@ -56,18 +57,18 @@ Page({
56 }) 57 })
57 }, 58 },
58 delSearch() { 59 delSearch() {
59 - let that=this; 60 + let that = this;
60 wx.showModal({ 61 wx.showModal({
61 title: '提示', 62 title: '提示',
62 content: '确认删除所有历史记录吗?', 63 content: '确认删除所有历史记录吗?',
63 - success (res) { 64 + success(res) {
64 if (res.confirm) { 65 if (res.confirm) {
65 - method.deleteRequest("/coupon/deleteHistory",data=>{  
66 - if(data.statusCode==0){ 66 + method.deleteRequest("/coupon/deleteHistory", data => {
  67 + if (data.statusCode == 0) {
67 that.setData({ 68 that.setData({
68 - labelArray:[] 69 + labelArray: []
69 }) 70 })
70 - } 71 + }
71 }) 72 })
72 } else if (res.cancel) { 73 } else if (res.cancel) {
73 console.log('用户点击取消') 74 console.log('用户点击取消')
@@ -154,7 +155,14 @@ Page({ @@ -154,7 +155,14 @@ Page({
154 * 页面上拉触底事件的处理函数 155 * 页面上拉触底事件的处理函数
155 */ 156 */
156 onReachBottom: function () { 157 onReachBottom: function () {
157 - 158 + this.setData({
  159 + bottomHint: true
  160 + })
  161 + setTimeout(() => {
  162 + this.setData({
  163 + bottomHint: false
  164 + })
  165 + })
158 }, 166 },
159 167
160 /** 168 /**
@@ -11,7 +11,8 @@ @@ -11,7 +11,8 @@
11 </view> 11 </view>
12 </view> 12 </view>
13 <view class="search_right" catchtap="unsearch">取消</view> --> 13 <view class="search_right" catchtap="unsearch">取消</view> -->
14 - <van-search value="{{keyWord}}" placeholder="请输入搜索关键词" shape="round" show-action bind:search="search" bind:cancel="onCancel" bind:change="onChange"/> 14 + <van-search value="{{keyWord}}" placeholder="请输入搜索关键词" shape="round" show-action bind:search="search"
  15 + bind:cancel="onCancel" bind:change="onChange" />
15 </view> 16 </view>
16 17
17 <!-- 搜索历史 --> 18 <!-- 搜索历史 -->
@@ -46,12 +47,15 @@ @@ -46,12 +47,15 @@
46 <view class="listTitle">{{item.goodsName}}</view> 47 <view class="listTitle">{{item.goodsName}}</view>
47 <view class="collect">{{item.goodsAttributes}}</view> 48 <view class="collect">{{item.goodsAttributes}}</view>
48 <view class="discount"> 49 <view class="discount">
49 - <view class="discountTitle"></view>  
50 <view class="discountPic"> 50 <view class="discountPic">
51 ¥{{item.goodsPrice}} 51 ¥{{item.goodsPrice}}
52 </view> 52 </view>
53 </view> 53 </view>
54 </view> 54 </view>
55 </view> 55 </view>
  56 + <view class="bottomHint" wx:if="{{bottomHint}}">
  57 + 我是有底线的~
  58 + </view>
56 </view> 59 </view>
  60 +
57 </view> 61 </view>
@@ -3,11 +3,12 @@ @@ -3,11 +3,12 @@
3 padding-top: 24rpx; 3 padding-top: 24rpx;
4 background: linear-gradient(180deg, #ffffff, #ebedf0); 4 background: linear-gradient(180deg, #ffffff, #ebedf0);
5 } 5 }
  6 +
6 /* 搜索框 */ 7 /* 搜索框 */
7 .search_center { 8 .search_center {
8 height: 68rpx; 9 height: 68rpx;
9 margin-bottom: 24rpx; 10 margin-bottom: 24rpx;
10 - width:750rpx; 11 + width: 750rpx;
11 } 12 }
12 13
13 .real_search_center { 14 .real_search_center {
@@ -24,7 +25,7 @@ @@ -24,7 +25,7 @@
24 margin-left: 32rpx; 25 margin-left: 32rpx;
25 } 26 }
26 27
27 -.searchIcon{ 28 +.searchIcon {
28 width: 32rpx; 29 width: 32rpx;
29 height: 32rpx; 30 height: 32rpx;
30 margin-right: 12rpx; 31 margin-right: 12rpx;
@@ -33,10 +34,12 @@ @@ -33,10 +34,12 @@
33 align-items: center; 34 align-items: center;
34 margin-left: 16rpx; 35 margin-left: 16rpx;
35 } 36 }
36 -.searchIcon image{ 37 +
  38 +.searchIcon image {
37 width: 32rpx; 39 width: 32rpx;
38 height: 32rpx; 40 height: 32rpx;
39 } 41 }
  42 +
40 .icon-sousuo { 43 .icon-sousuo {
41 font-size: 32rpx; 44 font-size: 32rpx;
42 position: absolute; 45 position: absolute;
@@ -68,6 +71,7 @@ @@ -68,6 +71,7 @@
68 line-height: 64rpx; 71 line-height: 64rpx;
69 color: rgba(189, 196, 206, 1); 72 color: rgba(189, 196, 206, 1);
70 } 73 }
  74 +
71 .search_right { 75 .search_right {
72 width: 104rpx; 76 width: 104rpx;
73 height: 64rpx; 77 height: 64rpx;
@@ -90,7 +94,7 @@ @@ -90,7 +94,7 @@
90 .searchHistory { 94 .searchHistory {
91 width: 750rpx; 95 width: 750rpx;
92 height: 420rpx; 96 height: 420rpx;
93 -background: linear-gradient(180deg,#ffffff, #ebedf0); 97 + background: linear-gradient(180deg, #ffffff, #ebedf0);
94 /* background-color: cadetblue; */ 98 /* background-color: cadetblue; */
95 } 99 }
96 100
@@ -194,27 +198,33 @@ background: linear-gradient(180deg,#ffffff, #ebedf0); @@ -194,27 +198,33 @@ background: linear-gradient(180deg,#ffffff, #ebedf0);
194 width: 335rpx; 198 width: 335rpx;
195 background-color: #ffffff; 199 background-color: #ffffff;
196 margin-bottom: 24rpx; 200 margin-bottom: 24rpx;
197 - padding: 0 11rpx 8rpx 12rpx; 201 + padding: 0 0 8rpx 0;
198 box-sizing: border-box; 202 box-sizing: border-box;
  203 + border-radius: 16rpx;
199 } 204 }
200 205
201 .listPic { 206 .listPic {
202 - width: 312rpx;  
203 height: 328rpx; 207 height: 328rpx;
204 } 208 }
205 209
206 .listSon image { 210 .listSon image {
207 - width: 312rpx; 211 + width: 100%;
208 height: 328rpx; 212 height: 328rpx;
  213 + border-radius: 16rpx;
209 } 214 }
210 215
211 .listTitle { 216 .listTitle {
212 - margin-bottom: 8rpx;  
213 width: 100%; 217 width: 100%;
214 font-size: 28rpx; 218 font-size: 28rpx;
215 font-weight: 500; 219 font-weight: 500;
216 color: #323233; 220 color: #323233;
217 line-height: 40rpx; 221 line-height: 40rpx;
  222 + padding: 0 24rpx;
  223 + box-sizing: border-box;
  224 + overflow: hidden;
  225 + white-space: nowrap;
  226 + text-overflow: ellipsis;
  227 + margin-top: 16rpx;
218 } 228 }
219 229
220 .collect { 230 .collect {
@@ -223,7 +233,12 @@ background: linear-gradient(180deg,#ffffff, #ebedf0); @@ -223,7 +233,12 @@ background: linear-gradient(180deg,#ffffff, #ebedf0);
223 font-weight: 400; 233 font-weight: 400;
224 text-align: left; 234 text-align: left;
225 color: #7d7e80; 235 color: #7d7e80;
226 - line-height: 34rpx; 236 + padding: 0 24rpx;
  237 + box-sizing: border-box;
  238 + overflow: hidden;
  239 + white-space: nowrap;
  240 + text-overflow: ellipsis;
  241 +
227 } 242 }
228 243
229 .discount { 244 .discount {
@@ -232,6 +247,7 @@ background: linear-gradient(180deg,#ffffff, #ebedf0); @@ -232,6 +247,7 @@ background: linear-gradient(180deg,#ffffff, #ebedf0);
232 display: flex; 247 display: flex;
233 justify-content: space-between; 248 justify-content: space-between;
234 align-items: center; 249 align-items: center;
  250 + margin-top: 8rpx;
235 } 251 }
236 252
237 .discountTitle { 253 .discountTitle {
@@ -249,12 +265,20 @@ background: linear-gradient(180deg,#ffffff, #ebedf0); @@ -249,12 +265,20 @@ background: linear-gradient(180deg,#ffffff, #ebedf0);
249 } 265 }
250 266
251 .discountPic { 267 .discountPic {
252 - height: 48rpx;  
253 font-size: 28rpx; 268 font-size: 28rpx;
254 color: #f8633e; 269 color: #f8633e;
  270 + padding: 0 24rpx;
255 } 271 }
256 272
257 .discountPic image { 273 .discountPic image {
258 width: 48rpx; 274 width: 48rpx;
259 height: 48rpx; 275 height: 48rpx;
260 -}  
  276 +}
  277 +.bottomHint {
  278 + font-size: 24rpx;
  279 + color: gray;
  280 + display: flex;
  281 + justify-content: center;
  282 + background-color: #f1f2f4;
  283 + /* margin-bottom: 250rpx; */
  284 +}
@@ -20,8 +20,8 @@ @@ -20,8 +20,8 @@
20 <view class="pickTitle">{{item.goodsName}}</view> 20 <view class="pickTitle">{{item.goodsName}}</view>
21 <view class="pickDesc">{{item.goodsAttributes}}</view> 21 <view class="pickDesc">{{item.goodsAttributes}}</view>
22 <view class="collectIcon"> 22 <view class="collectIcon">
23 - <view style="height:10rpx"></view>  
24 - <view style="display:inline-block">¥{{item.goodsPrice}}</view> 23 + <view style="height:10rpx;display:none"></view>
  24 + <view style="display:inline-block; font-size: 28rpx;padding: 10rpx 0;">¥{{item.goodsPrice}}</view>
25 </view> 25 </view>
26 </view> 26 </view>
27 </view> 27 </view>
@@ -126,7 +126,6 @@ page{ @@ -126,7 +126,6 @@ page{
126 126
127 .pickItem { 127 .pickItem {
128 width: 336rpx; 128 width: 336rpx;
129 - padding: 0 12rpx 8rpx;  
130 box-sizing: border-box; 129 box-sizing: border-box;
131 background-color: #ffffff; 130 background-color: #ffffff;
132 margin-bottom: 16rpx; 131 margin-bottom: 16rpx;
@@ -135,13 +134,14 @@ page{ @@ -135,13 +134,14 @@ page{
135 } 134 }
136 135
137 .pickPic { 136 .pickPic {
138 - width: 312rpx; 137 + width: 100%;
139 height: 328rpx; 138 height: 328rpx;
140 } 139 }
141 140
142 .pickPic image { 141 .pickPic image {
143 - width: 312rpx; 142 + width: 100%;
144 height: 328rpx; 143 height: 328rpx;
  144 + border-radius: 16rpx;
145 } 145 }
146 146
147 .pickTitle { 147 .pickTitle {
@@ -3,6 +3,7 @@ let method = require("../../utils/reuqest.js") @@ -3,6 +3,7 @@ let method = require("../../utils/reuqest.js")
3 const util = require("../../utils/util.js") 3 const util = require("../../utils/util.js")
4 Page({ 4 Page({
5 data: { 5 data: {
  6 + Authorization: false, //判断用户是否登录
6 showTime: false, //配送时间 7 showTime: false, //配送时间
7 storePickupTime: '', 8 storePickupTime: '',
8 checkType: 1, 9 checkType: 1,
@@ -18,6 +19,7 @@ Page({ @@ -18,6 +19,7 @@ Page({
18 stockNum: '', 19 stockNum: '',
19 20
20 // 购物车 21 // 购物车
  22 + goodsId: '', //商品id
21 carts: [], // 购物车列表 23 carts: [], // 购物车列表
22 pitchCart: [], //选中商品 24 pitchCart: [], //选中商品
23 pitchList: [], //选中商品id 25 pitchList: [], //选中商品id
@@ -31,6 +33,12 @@ Page({ @@ -31,6 +33,12 @@ Page({
31 title: '产品推荐', 33 title: '产品推荐',
32 bottomHint: false, //上拉提示 34 bottomHint: false, //上拉提示
33 }, 35 },
  36 + //登录
  37 + login() {
  38 + wx.navigateTo({
  39 + url: '/pages/index/index',
  40 + })
  41 + },
34 // tabbar 42 // tabbar
35 toClassify() { 43 toClassify() {
36 wx.reLaunch({ 44 wx.reLaunch({
@@ -64,7 +72,7 @@ Page({ @@ -64,7 +72,7 @@ Page({
64 // currPage: 1, 72 // currPage: 1,
65 // pageSize: 10 73 // pageSize: 10
66 // } 74 // }
67 - method.getRequest("/myUser/cartRecommend", data => { 75 + method.getRequest("/myUser/cartRecommend", data => {
68 if (data.statusCode == 0) { 76 if (data.statusCode == 0) {
69 this.setData({ 77 this.setData({
70 list: data.data 78 list: data.data
@@ -74,11 +82,12 @@ Page({ @@ -74,11 +82,12 @@ Page({
74 }, 82 },
75 goGoodsDetail(e) { 83 goGoodsDetail(e) {
76 let id = e.currentTarget.dataset.id; 84 let id = e.currentTarget.dataset.id;
  85 + console.log(id, 'id')
77 this.setData({ 86 this.setData({
78 goodsId: id 87 goodsId: id
79 }) 88 })
80 wx.navigateTo({ 89 wx.navigateTo({
81 - url: '/pages/product-detail/product-detail?goodsId=' + this.data.goodsId, 90 + url: '/pages/product-detail/product-detail?id=' + this.data.goodsId,
82 }) 91 })
83 }, 92 },
84 //地址信息 93 //地址信息
@@ -136,14 +145,11 @@ Page({ @@ -136,14 +145,11 @@ Page({
136 showTime: false 145 showTime: false
137 }); 146 });
138 }, 147 },
139 - onReady() {  
140 - this.timepicker = this.selectComponent('#aaa')  
141 - },  
142 chooseTime() { 148 chooseTime() {
143 this.setData({ 149 this.setData({
144 showTime: true 150 showTime: true
145 }) 151 })
146 - // this.timepicker.getDliveryTime(); 152 + this.selectComponent('#timePicker').getDliveryTime()
147 }, 153 },
148 onClickButton() { 154 onClickButton() {
149 this.setData({ 155 this.setData({
@@ -369,7 +375,13 @@ Page({ @@ -369,7 +375,13 @@ Page({
369 }, 375 },
370 onLoad: function (options) { 376 onLoad: function (options) {
371 this.getAddress(); 377 this.getAddress();
372 - this.youLike() 378 + this.setData({
  379 + hasList: true,
  380 + //carts: [],
  381 + checkNum: 0
  382 + });
  383 + this.youLike();
  384 +
373 }, 385 },
374 386
375 /** 387 /**
@@ -383,15 +395,9 @@ Page({ @@ -383,15 +395,9 @@ Page({
383 * 生命周期函数--监听页面显示 395 * 生命周期函数--监听页面显示
384 */ 396 */
385 onShow: function () { 397 onShow: function () {
386 - this.getList();  
387 - this.setData({  
388 - hasList: true,  
389 - carts: [],  
390 - checkNum: 0  
391 - });  
392 this.getTotalPrice(); 398 this.getTotalPrice();
393 this.getAddress() //获取默认地址 399 this.getAddress() //获取默认地址
394 - this.getDayTime() //获取当日期 400 + this.getDayTime() //获取当日期
395 this.setData({ //每次购物车下单重新选择商品 401 this.setData({ //每次购物车下单重新选择商品
396 pitchCart: [], 402 pitchCart: [],
397 pitchList: [] 403 pitchList: []
@@ -408,7 +414,17 @@ Page({ @@ -408,7 +414,17 @@ Page({
408 }) 414 })
409 } 415 }
410 }, 300) 416 }, 300)
411 - 417 + this.getList();
  418 + //判断用户是否登录
  419 + if (wx.getStorageSync('Authorization') === '') {
  420 + this.setData({
  421 + Authorization: false
  422 + })
  423 + } else {
  424 + this.setData({
  425 + Authorization: true
  426 + })
  427 + }
412 }, 428 },
413 429
414 /** 430 /**
1 <!--pages/shopping-cart/shopping-cart.wxml--> 1 <!--pages/shopping-cart/shopping-cart.wxml-->
2 -<view class="container"> 2 +<view class="container" wx:if="{{Authorization}}">
3 <!-- 地址 --> 3 <!-- 地址 -->
4 <view class="userInfo" bindtap="goAddress1"> 4 <view class="userInfo" bindtap="goAddress1">
5 - <view>  
6 - <view wx:if="{{userData!==''}}"> 5 + <view style="display:flex;align-items: center;">
  6 + <view wx:if="{{userData!==''}}" style="width:95%">
7 <view class="userName">{{userData.name}}</view> 7 <view class="userName">{{userData.name}}</view>
8 <view class="userTell">{{userData.phone}}</view> 8 <view class="userTell">{{userData.phone}}</view>
9 <view class="default" wx:if="{{userData.delFlag==1}}">默认</view> 9 <view class="default" wx:if="{{userData.delFlag==1}}">默认</view>
@@ -19,16 +19,22 @@ @@ -19,16 +19,22 @@
19 </view> 19 </view>
20 <!-- 配送时间 --> 20 <!-- 配送时间 -->
21 <view class="timeBox"> 21 <view class="timeBox">
22 - <view class="calendar " bindtap='chooseTime'>  
23 - <view style="display: flex;align-items: center;">  
24 - <image src="/images/04-01/rili.png"></image> 22 + <view style="display:flex">
  23 + <view class="calendar " bindtap='chooseTime'>
  24 + <view style="display: flex;align-items: center;">
  25 + <image src="/images/04-01/rili.png"></image>
  26 + </view>
  27 + <view wx:if="{{storePickupTime==''}}"> 请选择配送时间</view>
  28 + <view wx:if="{{storePickupTime!==''}}"> 配送时间</view>
25 </view> 29 </view>
26 - <view> 请选择配送时间</view> 30 + {{storePickupTime}}
27 </view> 31 </view>
28 - {{storePickupTime}} 32 + <!-- <view class="arrow1" style="width:94%">
  33 + <image src="/images/04-01/arrow.png"></image>
  34 + </view> -->
29 <view class="section"> 35 <view class="section">
30 <van-popup show="{{ showTime }}" bind:close="onClose" position="bottom"> 36 <van-popup show="{{ showTime }}" bind:close="onClose" position="bottom">
31 - <timepicker deliveryTime='{{deliveryTime}}' bind:selectTime="selectTime" id="aaa"></timepicker> 37 + <timepicker deliveryTime='{{deliveryTime}}' bind:selectTime="selectTime" id="timePicker"></timepicker>
32 </van-popup> 38 </van-popup>
33 </view> 39 </view>
34 </view> 40 </view>
@@ -60,7 +66,8 @@ @@ -60,7 +66,8 @@
60 66
61 </view> 67 </view>
62 <!-- <view wx:if="{{carts.length==0}}"> --> 68 <!-- <view wx:if="{{carts.length==0}}"> -->
63 - <view wx:if="{{cartnoData}}"> 69 + <view wx:if="{{!hasList}}">
  70 + <!-- <view wx:if="{{cartnoData}}"> -->
64 <view class="cart-no-data">一件商品都没有呢</view> 71 <view class="cart-no-data">一件商品都没有呢</view>
65 <view class="cart-no-data-btn" bindtap="goHome">去逛逛</view> 72 <view class="cart-no-data-btn" bindtap="goHome">去逛逛</view>
66 </view> 73 </view>
@@ -86,6 +93,7 @@ @@ -86,6 +93,7 @@
86 </view> 93 </view>
87 </view> 94 </view>
88 </view> 95 </view>
  96 +
89 <view class="bottomHint" wx:if="{{bottomHint}}"> 97 <view class="bottomHint" wx:if="{{bottomHint}}">
90 我是有底线的~ 98 我是有底线的~
91 </view> 99 </view>
@@ -108,6 +116,17 @@ @@ -108,6 +116,17 @@
108 </view> 116 </view>
109 </view> 117 </view>
110 </view> 118 </view>
  119 +<!-- 没登录 -->
  120 +<view wx:if="{{!Authorization}}" class="noToken">
  121 + <view class="logBox">
  122 + <text class="logText1" bindtap="login">登录</text>
  123 + <text class="logText2">后同步您购物车的商品</text>
  124 + </view>
  125 + <view class="noGoodPic">
  126 + <image src="/images/message@2x.png"></image>
  127 + 购物车里空空如也~
  128 + </view>
  129 +</view>
111 <!-- tabbar --> 130 <!-- tabbar -->
112 <!-- <view class="tabbarBox" > 131 <!-- <view class="tabbarBox" >
113 <ul> 132 <ul>
@@ -6,6 +6,8 @@ page { @@ -6,6 +6,8 @@ page {
6 .container { 6 .container {
7 background-color: #f1f2f4; 7 background-color: #f1f2f4;
8 width: 100%; 8 width: 100%;
  9 + height: 100%;
  10 + overflow-x: hidden;
9 padding-top: 6rpx; 11 padding-top: 6rpx;
10 padding-bottom: 120rpx; 12 padding-bottom: 120rpx;
11 } 13 }
@@ -15,16 +17,13 @@ page { @@ -15,16 +17,13 @@ page {
15 17
16 /* 用户信息 */ 18 /* 用户信息 */
17 .noAdd{ 19 .noAdd{
18 - width: 300rpx; 20 + width: 95%;
19 font-size: 32rpx; 21 font-size: 32rpx;
20 font-weight: 600; 22 font-weight: 600;
21 color: #323233; 23 color: #323233;
22 - position: absolute;  
23 - top: 82rpx;  
24 } 24 }
25 .userInfo { 25 .userInfo {
26 width: 686rpx; 26 width: 686rpx;
27 - height: 200rpx;  
28 background-color: #ffffff; 27 background-color: #ffffff;
29 margin: 0 auto; 28 margin: 0 auto;
30 margin-top: 20rpx; 29 margin-top: 20rpx;
@@ -80,16 +79,11 @@ page { @@ -80,16 +79,11 @@ page {
80 color: #323233; 79 color: #323233;
81 line-height: 40rpx; 80 line-height: 40rpx;
82 margin-top: 16rpx; 81 margin-top: 16rpx;
83 - height: 84rpx;  
84 overflow: hidden; 82 overflow: hidden;
85 } 83 }
86 84
87 .arrow { 85 .arrow {
88 - width: 32rpx;  
89 - height: 32rpx;  
90 - position: absolute;  
91 - top: 84rpx;  
92 - left: 626rpx; 86 + width: 5%;
93 } 87 }
94 88
95 .arrow image { 89 .arrow image {
@@ -144,6 +138,16 @@ page { @@ -144,6 +138,16 @@ page {
144 .selectTime { 138 .selectTime {
145 margin-left: 16rpx; 139 margin-left: 16rpx;
146 } 140 }
  141 +/* .arrow1 {
  142 + width: 5%;
  143 + display: flex;
  144 + align-items: center;
  145 +}
  146 +
  147 +.arrow1 image {
  148 + width: 16rpx;
  149 + height: 27rpx;
  150 +} */
147 151
148 /* 购物车列表 */ 152 /* 购物车列表 */
149 .cartList { 153 .cartList {
@@ -320,59 +324,52 @@ page { @@ -320,59 +324,52 @@ page {
320 width: 335rpx; 324 width: 335rpx;
321 background-color: #ffffff; 325 background-color: #ffffff;
322 margin-bottom: 24rpx; 326 margin-bottom: 24rpx;
323 - padding: 0 11rpx 8rpx 12rpx;  
324 - box-sizing: border-box;  
325 border-radius: 16rpx; 327 border-radius: 16rpx;
326 } 328 }
327 329
328 .listPic { 330 .listPic {
329 - width: 312rpx; 331 + width: 100%;
330 height: 328rpx; 332 height: 328rpx;
331 } 333 }
332 334
333 .listSon image { 335 .listSon image {
334 - width: 312rpx;  
335 - height: 328rpx; 336 + width: 100%;
  337 + border-radius: 16rpx;
  338 + height: 100%;
336 } 339 }
337 340
338 .listTitle { 341 .listTitle {
339 - margin-bottom: 8rpx;  
340 width: 100%; 342 width: 100%;
341 font-size: 28rpx; 343 font-size: 28rpx;
342 font-weight: 500; 344 font-weight: 500;
343 color: #323233; 345 color: #323233;
344 - line-height: 40rpx; 346 + padding: 0 24rpx;
  347 + box-sizing: border-box;
  348 + overflow: hidden;
  349 + white-space: nowrap;
  350 + text-overflow: ellipsis;
  351 + margin-top: 16rpx;
345 } 352 }
346 353
347 .collect { 354 .collect {
348 width: 100%; 355 width: 100%;
349 - font-size: 24rpx; 356 + font-size: 28rpx;
350 font-weight: 400; 357 font-weight: 400;
351 text-align: left; 358 text-align: left;
352 color: #7d7e80; 359 color: #7d7e80;
353 - line-height: 34rpx; 360 + padding: 0 24rpx;
  361 + box-sizing: border-box;
  362 + overflow: hidden;
  363 + white-space: nowrap;
  364 + text-overflow: ellipsis;
  365 + margin-top: 8rpx;
354 } 366 }
355 367
356 .discount { 368 .discount {
357 width: 100%; 369 width: 100%;
358 - height: 32rpx;  
359 display: flex; 370 display: flex;
360 - justify-content: space-between;  
361 align-items: center; 371 align-items: center;
362 -}  
363 -  
364 -.discountTitle {  
365 - width: 10rpx;  
366 - height: 38rpx;  
367 - /* border: 1rpx solid #ff4944; */  
368 - border-radius: 12rpx;  
369 - font-size: 22rpx;  
370 - font-weight: 400;  
371 - text-align: left;  
372 - color: #ff4340;  
373 - line-height: 48rpx;  
374 - letter-spacing: 1rpx;  
375 - text-align: center; 372 + padding: 0 24rpx;
376 } 373 }
377 374
378 .discountPic { 375 .discountPic {
@@ -383,7 +380,6 @@ page { @@ -383,7 +380,6 @@ page {
383 380
384 .discountPic image { 381 .discountPic image {
385 width: 48rpx; 382 width: 48rpx;
386 - height: 48rpx;  
387 } 383 }
388 /* 购物车 */ 384 /* 购物车 */
389 385
@@ -681,4 +677,29 @@ li text{ @@ -681,4 +677,29 @@ li text{
681 .tabbarPic image{ 677 .tabbarPic image{
682 width:48rpx; 678 width:48rpx;
683 height: 48rpx; 679 height: 48rpx;
  680 +}
  681 +/* noToken */
  682 +.logBox{
  683 + padding: 14rpx;
  684 + background: antiquewhite;
  685 + font-size: 28rpx;
  686 +}
  687 +.logText1{
  688 + color: #f57878;
  689 + font-weight: 600;
  690 + border-bottom: 2rpx solid;
  691 +}
  692 +.logText2{
  693 + color: #474646;
  694 +}
  695 +.noGoodPic{
  696 + text-align: center;
  697 + margin-top: 200rpx;
  698 + font-size: 24rpx;
  699 +}
  700 +.noGoodPic image{
  701 + width: 200rpx;
  702 + height: 200rpx;
  703 + display: block;
  704 + margin: 0 auto;
684 } 705 }
1 // pages/user/user.js 1 // pages/user/user.js
2 let method = require("../../utils/reuqest.js") 2 let method = require("../../utils/reuqest.js")
  3 +const util = require("../../utils/util.js")
3 Page({ 4 Page({
4 data: { 5 data: {
  6 + Authorization: '', //判断用户是否登录
5 phoneNumber: '', 7 phoneNumber: '',
6 userData: '', 8 userData: '',
7 vip: '', 9 vip: '',
@@ -44,6 +46,12 @@ Page({ @@ -44,6 +46,12 @@ Page({
44 text: '意见反馈' 46 text: '意见反馈'
45 }] 47 }]
46 }, 48 },
  49 + //登录
  50 + login(){
  51 + wx.navigateTo({
  52 + url: '/pages/index/index',
  53 + })
  54 + },
47 // tabbar 55 // tabbar
48 toHome() { 56 toHome() {
49 wx.reLaunch({ 57 wx.reLaunch({
@@ -72,16 +80,38 @@ Page({ @@ -72,16 +80,38 @@ Page({
72 }, 80 },
73 //全部订单 81 //全部订单
74 mainOrder() { 82 mainOrder() {
75 - wx.navigateTo({  
76 - url: '/pages/all-order/all-order',  
77 - }) 83 + if (this.data.Authorization) {
  84 + wx.navigateTo({
  85 + url: '/pages/all-order/all-order',
  86 + })
  87 + } else {
  88 + wx.showToast({
  89 + title: '请先登录!',
  90 + icon: 'none'
  91 + })
  92 + setTimeout(() => {
  93 + util.getUser()
  94 + }, 2000)
  95 + }
  96 +
78 }, 97 },
79 //订单状态 98 //订单状态
80 orderEvent(e) { 99 orderEvent(e) {
81 - let index = e.currentTarget.dataset.index;  
82 - wx.navigateTo({  
83 - url: '/pages/all-order/all-order?index=' + index,  
84 - }) 100 + if (this.data.Authorization) {
  101 + let index = e.currentTarget.dataset.index;
  102 + wx.navigateTo({
  103 + url: '/pages/all-order/all-order?index=' + index,
  104 + })
  105 + } else {
  106 + wx.showToast({
  107 + title: '请先登录!',
  108 + icon: 'none'
  109 + })
  110 + setTimeout(() => {
  111 + util.getUser()
  112 + }, 2000)
  113 + }
  114 +
85 }, 115 },
86 //我的服务 116 //我的服务
87 myServeEvent(e) { 117 myServeEvent(e) {
@@ -115,75 +145,164 @@ Page({ @@ -115,75 +145,164 @@ Page({
115 }, 145 },
116 //我的会员 146 //我的会员
117 myMember() { 147 myMember() {
118 - method.getRequest("/myUser/queryUserInfo", data => {  
119 - if (data.statusCode == 0) {  
120 - this.setData({  
121 - vip: data.data.vip  
122 - })  
123 - wx.setStorageSync('vip', this.data.vip)  
124 - }  
125 - })  
126 - wx.navigateTo({  
127 - url: '/pages/my-member/my-member',  
128 - }) 148 + if (this.data.Authorization) {
  149 + method.getRequest("/myUser/queryUserInfo", data => {
  150 + if (data.statusCode == 0) {
  151 + this.setData({
  152 + vip: data.data.vip
  153 + })
  154 + wx.setStorageSync('vip', this.data.vip)
  155 + }
  156 + })
  157 + wx.navigateTo({
  158 + url: '/pages/my-member/my-member',
  159 + })
  160 + } else {
  161 + wx.showToast({
  162 + title: '请先登录!',
  163 + icon: 'none'
  164 + })
  165 + setTimeout(() => {
  166 + util.getUser()
  167 + }, 2000)
  168 + }
  169 +
129 }, 170 },
130 //收货地址 171 //收货地址
131 myAddress() { 172 myAddress() {
132 - wx.navigateTo({  
133 - url: '/pages/select-address/select-address',  
134 - }) 173 + if (this.data.Authorization) {
  174 + wx.navigateTo({
  175 + url: '/pages/select-address/select-address',
  176 + })
  177 + } else {
  178 + wx.showToast({
  179 + title: '请先登录!',
  180 + icon: 'none'
  181 + })
  182 + setTimeout(() => {
  183 + util.getUser()
  184 + }, 2000)
  185 + }
135 }, 186 },
136 //优惠券 187 //优惠券
137 mydiscountCard() { 188 mydiscountCard() {
138 - wx.navigateTo({  
139 - url: '/pages/discount-card/discount-card',  
140 - }) 189 + if (this.data.Authorization) {
  190 + wx.navigateTo({
  191 + url: '/pages/discount-card/discount-card',
  192 + })
  193 + } else {
  194 + wx.showToast({
  195 + title: '请先登录!',
  196 + icon: 'none'
  197 + })
  198 + setTimeout(() => {
  199 + util.getUser()
  200 + }, 2000)
  201 + }
  202 +
141 }, 203 },
142 //退款售后 204 //退款售后
143 myRefund() { 205 myRefund() {
144 - wx.navigateTo({  
145 - url: '/pages/refund-after/refund-after',  
146 - }) 206 + if (this.data.Authorization) {
  207 + wx.navigateTo({
  208 + url: '/pages/refund-after/refund-after',
  209 + })
  210 + } else {
  211 + wx.showToast({
  212 + title: '请先登录!',
  213 + icon: 'none'
  214 + })
  215 + setTimeout(() => {
  216 + util.getUser()
  217 + }, 2000)
  218 + }
  219 +
147 }, 220 },
148 //在线客服 221 //在线客服
149 myKefu() { 222 myKefu() {
150 - method.getRequest("/information/queryCustomerPhone", data => {  
151 - if (data.statusCode == 0) {  
152 - this.setData({  
153 - phoneNumber: data.data  
154 - })  
155 - }  
156 - })  
157 - wx.makePhoneCall({  
158 - phoneNumber: this.data.phoneNumber,  
159 - success() {  
160 - console.log('拨打电话成功')  
161 - },  
162 - fail() {  
163 - wx.showToast({  
164 - title: this.data.msg,  
165 - icon: 'none'  
166 - })  
167 - }  
168 - }) 223 + if (this.data.Authorization) {
  224 + method.getRequest("/information/queryCustomerPhone", data => {
  225 + if (data.statusCode == 0) {
  226 + this.setData({
  227 + phoneNumber: data.data
  228 + })
  229 + }
  230 + })
  231 + wx.makePhoneCall({
  232 + phoneNumber: this.data.phoneNumber,
  233 + success() {
  234 + console.log('拨打电话成功')
  235 + },
  236 + fail() {
  237 + wx.showToast({
  238 + title: this.data.msg,
  239 + icon: 'none'
  240 + })
  241 + }
  242 + })
  243 + } else {
  244 + wx.showToast({
  245 + title: '请先登录!',
  246 + icon: 'none'
  247 + })
  248 + setTimeout(() => {
  249 + util.getUser()
  250 + }, 2000)
  251 + }
  252 +
169 }, 253 },
170 //我的收藏 254 //我的收藏
171 myCollect() { 255 myCollect() {
172 - wx.navigateTo({  
173 - url: '/pages/my-collect/my-collect',  
174 - }) 256 + if (this.data.Authorization) {
  257 + wx.navigateTo({
  258 + url: '/pages/my-collect/my-collect',
  259 + })
  260 + } else {
  261 + wx.showToast({
  262 + title: '请先登录!',
  263 + icon: 'none'
  264 + })
  265 + setTimeout(() => {
  266 + util.getUser()
  267 + }, 2000)
  268 + }
  269 +
  270 +
175 }, 271 },
176 //关于我们 272 //关于我们
177 relatedOur() { 273 relatedOur() {
178 - wx.navigateTo({  
179 - url: '/pages/related-our/related',  
180 - }) 274 + if (this.data.Authorization) {
  275 + wx.navigateTo({
  276 + url: '/pages/related-our/related',
  277 + })
  278 + } else {
  279 + wx.showToast({
  280 + title: '请先登录!',
  281 + icon: 'none'
  282 + })
  283 + setTimeout(() => {
  284 + util.getUser()
  285 + }, 2000)
  286 + }
  287 +
  288 +
181 }, 289 },
182 //意见反馈 290 //意见反馈
183 - ideaFeedback(){  
184 - wx.navigateTo({  
185 - url: '/pages/idea-feedback/idea-feedback',  
186 - }) 291 + ideaFeedback() {
  292 + if (this.data.Authorization) {
  293 + wx.navigateTo({
  294 + url: '/pages/idea-feedback/idea-feedback',
  295 + })
  296 + } else {
  297 + wx.showToast({
  298 + title: '请先登录!',
  299 + icon: 'none'
  300 + })
  301 + setTimeout(() => {
  302 + util.getUser()
  303 + }, 2000)
  304 + }
  305 +
187 }, 306 },
188 /** 307 /**
189 * 生命周期函数--监听页面加载 308 * 生命周期函数--监听页面加载
@@ -191,6 +310,16 @@ Page({ @@ -191,6 +310,16 @@ Page({
191 onLoad: function (options) { 310 onLoad: function (options) {
192 let that = this; 311 let that = this;
193 that.getUserInfo() 312 that.getUserInfo()
  313 + //Authorization判断用户是否登录
  314 + if (wx.getStorageSync('Authorization') === '') {
  315 + this.setData({
  316 + Authorization: false
  317 + })
  318 + } else {
  319 + this.setData({
  320 + Authorization: true
  321 + })
  322 + }
194 }, 323 },
195 324
196 /** 325 /**
@@ -4,15 +4,18 @@ @@ -4,15 +4,18 @@
4 </view> 4 </view>
5 <!-- 用户信息 --> 5 <!-- 用户信息 -->
6 <view class="userInfo"> 6 <view class="userInfo">
7 - <view class="headPic"> 7 + <view class="headPic" wx:if="{{Authorization}}">
8 <image src="{{userData.wxHeadImg}}"></image> 8 <image src="{{userData.wxHeadImg}}"></image>
9 </view> 9 </view>
10 - <view class="userName">  
11 - <view class="name"> 10 + <view class="headPic" wx:if="{{!Authorization}}">
  11 + <image src="/images/nimingtouxiang.png"></image>
  12 + </view>
  13 + <view class="userName" >
  14 + <view class="name" wx:if="{{Authorization}}">
12 {{userData.wxName}} 15 {{userData.wxName}}
13 </view> 16 </view>
14 - <view class="decribe">  
15 - 描述 17 + <view class="name" wx:if="{{!Authorization}}" bindtap="login">
  18 + 登录/注册
16 </view> 19 </view>
17 </view> 20 </view>
18 <!-- <view class="arrow"> 21 <!-- <view class="arrow">
@@ -43,6 +43,8 @@ @@ -43,6 +43,8 @@
43 padding-left: 20rpx; 43 padding-left: 20rpx;
44 box-sizing: border-box; 44 box-sizing: border-box;
45 padding-top: 10rpx; 45 padding-top: 10rpx;
  46 + display: flex;
  47 + align-items: center;
46 } 48 }
47 49
48 .userName .name { 50 .userName .name {
@@ -143,7 +145,7 @@ @@ -143,7 +145,7 @@
143 } 145 }
144 146
145 .text { 147 .text {
146 - width: 72rpx; 148 + width: auto;
147 height: 34rpx; 149 height: 34rpx;
148 font-size: 24rpx; 150 font-size: 24rpx;
149 font-weight: 400; 151 font-weight: 400;
@@ -283,6 +283,13 @@ @@ -283,6 +283,13 @@
283 "id": -1, 283 "id": -1,
284 "name": "pages/demo/demo", 284 "name": "pages/demo/demo",
285 "pathName": "pages/demo/demo", 285 "pathName": "pages/demo/demo",
  286 + "query": "",
  287 + "scene": null
  288 + },
  289 + {
  290 + "id": -1,
  291 + "name": "pages/demo1/demo1",
  292 + "pathName": "pages/demo1/demo1",
286 "scene": null 293 "scene": null
287 } 294 }
288 ] 295 ]
@@ -16,10 +16,10 @@ const formatNumber = n => { @@ -16,10 +16,10 @@ const formatNumber = n => {
16 16
17 //获取时间 17 //获取时间
18 //获取d当前时间多少天后的日期和对应星期 18 //获取d当前时间多少天后的日期和对应星期
19 -function getDates(days, todate = new Date() ) { //todate默认参数是当前日期,可以传入对应时间  
20 -// function getDates(days, todate =getCurrentMonthFirst()) { //todate默认参数是当前日期,可以传入对应时间 19 +function getDates(days, todate = new Date()) { //todate默认参数是当前日期,可以传入对应时间
  20 + // function getDates(days, todate =getCurrentMonthFirst()) { //todate默认参数是当前日期,可以传入对应时间
21 var dateArry = []; 21 var dateArry = [];
22 - for (var i = 0; i < days-3; i++) { 22 + for (var i = 0; i < days - 3; i++) {
23 var dateObj = dateLater(todate, i); 23 var dateObj = dateLater(todate, i);
24 console.log(dateObj) 24 console.log(dateObj)
25 dateArry.push(dateObj) 25 dateArry.push(dateObj)
@@ -66,9 +66,55 @@ function getUser(msg) { @@ -66,9 +66,55 @@ function getUser(msg) {
66 url: '/pages/index/index', 66 url: '/pages/index/index',
67 }) 67 })
68 } 68 }
  69 +//获取位置信息
  70 +function getLocation(that) {
  71 + wx.getLocation({
  72 + type: 'wgs84',
  73 + success: function (res) {
  74 + // 经纬度
  75 + var latitude = res.latitude
  76 + var longitude = res.longitude
  77 + var aK = that.data.aK
  78 + wx.request({
  79 + url: 'https://api.map.baidu.com/geocoder/v2/?ak=' + aK + '&location=' + latitude + ',' + longitude + '&output=json',
  80 + data: {},
  81 + header: {
  82 + 'content-type': 'application/json'
  83 + },
  84 + success: function (res) {
  85 + var city = res.data.result.addressComponent.city;
  86 + that.setData({
  87 + currentCity: city
  88 + })
  89 + wx.request({
  90 + url: 'xxx' + city,
  91 + data: {},
  92 + header: {
  93 + 'content-type': 'application/json'
  94 + },
  95 + success: function (res) {
  96 + that.setData({
  97 + county: res.data,
  98 + })
  99 + },
  100 + })
  101 + }
  102 + })
  103 +
  104 + },
  105 + fail: function () {
  106 + wx.showToast({
  107 + title: '授权失败',
  108 + icon: 'success',
  109 + duration: 1000
  110 + })
  111 + }
  112 + })
  113 +}
69 module.exports = { 114 module.exports = {
70 formatTime: formatTime, 115 formatTime: formatTime,
71 onReachListData: onReachListData, 116 onReachListData: onReachListData,
72 getUser: getUser, 117 getUser: getUser,
73 - getDates:getDates 118 + getDates: getDates,
  119 + getLocation:getLocation
74 } 120 }