作者 倪静楠

1128

@@ -31,7 +31,6 @@ @@ -31,7 +31,6 @@
31 "pages/cart-affirm-order/cart-affirm-order", 31 "pages/cart-affirm-order/cart-affirm-order",
32 "pages/integral-order/integral-order", 32 "pages/integral-order/integral-order",
33 "pages/refund-after/refund-after", 33 "pages/refund-after/refund-after",
34 - "pages/demo1/demo1",  
35 "pages/my-discount-card/my-discount-card" 34 "pages/my-discount-card/my-discount-card"
36 ], 35 ],
37 "window": { 36 "window": {
1 // pages/add-address/add-address.js 1 // pages/add-address/add-address.js
2 -let method = require("../../utils/reuqest.js") 2 +let method = require("../../utils/reuqest.js");
  3 +const util = require("../../utils/util.js");
3 const chooseLocation = requirePlugin('chooseLocation'); 4 const chooseLocation = requirePlugin('chooseLocation');
4 Page({ 5 Page({
5 data: { 6 data: {
@@ -9,14 +10,10 @@ Page({ @@ -9,14 +10,10 @@ Page({
9 checked: 0, 10 checked: 0,
10 show: false, 11 show: false,
11 selectBox: true, 12 selectBox: true,
12 - // region: ['请选择', '请选择', '请选择'],  
13 - // province: '选择省/',  
14 - // city: '市/',  
15 - // county: '区',  
16 location: '', 13 location: '',
17 latitude: "", 14 latitude: "",
18 longitude: "", 15 longitude: "",
19 - latitudes: "", //传值给后台 16 + latitudes: "", //传值
20 longitudes: "", 17 longitudes: "",
21 flag: true 18 flag: true
22 }, 19 },
@@ -162,15 +159,13 @@ Page({ @@ -162,15 +159,13 @@ Page({
162 title: '保存成功', 159 title: '保存成功',
163 icon: 'none' 160 icon: 'none'
164 }) 161 })
165 - console.log('22')  
166 - wx.navigateTo({  
167 - url: '/pages/select-address/select-address', 162 + wx.redirectTo({
  163 + url: '/pages/select-address/select-address?edit=1',
168 }) 164 })
169 - console.log('33')  
170 } else { 165 } else {
171 wx.showToast({ 166 wx.showToast({
172 - title: data.msg,  
173 - icon: 'none' 167 + title: '地址超出配送费范围请重新选择',
  168 + icon:'none'
174 }) 169 })
175 } 170 }
176 }) 171 })
@@ -193,7 +188,7 @@ Page({ @@ -193,7 +188,7 @@ Page({
193 onShow: function () { 188 onShow: function () {
194 let that = this; 189 let that = this;
195 const location = chooseLocation.getLocation(); 190 const location = chooseLocation.getLocation();
196 - console.log(location,'location') 191 + console.log(location, 'location')
197 const address = location.address 192 const address = location.address
198 const latitude = location.latitude 193 const latitude = location.latitude
199 const longitude = location.longitude 194 const longitude = location.longitude
1 <!--pages/add-address/add-address.wxml--> 1 <!--pages/add-address/add-address.wxml-->
2 <view class="container"> 2 <view class="container">
3 <van-cell-group class="addContent"> 3 <van-cell-group class="addContent">
4 - <van-field value="{{ username }}" required clearable label="姓名" icon="question-o" placeholder="请输入姓名" 4 + <van-field value="{{ username }}" clearable label="姓名" icon="question-o" placeholder="请输入姓名"
5 bind:click-icon="onClickIcon" bindinput="inputName" /> 5 bind:click-icon="onClickIcon" bindinput="inputName" />
6 <van-field value="{{ phone }}" label="电话" placeholder="请输入电话" bindinput="inputDel" bindblur="blurPhone" /> 6 <van-field value="{{ phone }}" label="电话" placeholder="请输入电话" bindinput="inputDel" bindblur="blurPhone" />
7 - <!-- 地址 -->  
8 - <!-- <van-cell title="展示弹出层" is-link bindtap="showPopup"> -->  
9 - <!-- <view class="popups">  
10 - <view>地区</view>  
11 - <view class="addBox">  
12 - <picker mode="region" bindchange="bindRegionChange" value="{{region}}" custom-item="{{customItem}}">  
13 - <view class="picker">  
14 - {{region[0]}},{{region[1]}},{{region[2]}}  
15 - </view>  
16 - </picker>  
17 - </view>  
18 - </view> -->  
19 <view class="location" catchtap="map"> 7 <view class="location" catchtap="map">
20 <text style="width:200rpx">收货地址</text> 8 <text style="width:200rpx">收货地址</text>
21 <text class="locationItem">{{location}}</text> 9 <text class="locationItem">{{location}}</text>
1 // pages/affirm-order/affirm-order.js 1 // pages/affirm-order/affirm-order.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: {
5 userData: "", 6 userData: "",
@@ -34,7 +35,7 @@ Page({ @@ -34,7 +35,7 @@ Page({
34 count: '', 35 count: '',
35 stockNum: '', 36 stockNum: '',
36 resposeData: '', 37 resposeData: '',
37 - discountText:'', 38 + discountText: '',
38 payment: '' 39 payment: ''
39 }, 40 },
40 //选择时间 41 //选择时间
@@ -109,6 +110,10 @@ Page({ @@ -109,6 +110,10 @@ Page({
109 this.setData({ 110 this.setData({
110 userData: data.data[index], 111 userData: data.data[index],
111 }) 112 })
  113 + } else {
  114 + setTimeout(() => {
  115 + util.getUser()
  116 + }, 2000)
112 } 117 }
113 }) 118 })
114 }, 119 },
@@ -155,6 +160,10 @@ Page({ @@ -155,6 +160,10 @@ Page({
155 this.setData({ 160 this.setData({
156 goodsData: goodsData 161 goodsData: goodsData
157 }) 162 })
  163 + } else {
  164 + setTimeout(() => {
  165 + util.getUser()
  166 + }, 2000)
158 } 167 }
159 }) 168 })
160 169
@@ -220,7 +229,6 @@ Page({ @@ -220,7 +229,6 @@ Page({
220 //商品-生成订单 229 //商品-生成订单
221 creatOrder() { 230 creatOrder() {
222 if (this.data.userData == undefined) { 231 if (this.data.userData == undefined) {
223 -  
224 wx.showToast({ 232 wx.showToast({
225 title: '请选择收货地址', 233 title: '请选择收货地址',
226 icon: 'none' 234 icon: 'none'
@@ -247,6 +255,9 @@ Page({ @@ -247,6 +255,9 @@ Page({
247 title: data.msg, 255 title: data.msg,
248 icon: 'none' 256 icon: 'none'
249 }) 257 })
  258 + setTimeout(() => {
  259 + util.getUser()
  260 + }, 2000)
250 } 261 }
251 }) 262 })
252 wx.removeStorageSync('type') //清除优惠券 263 wx.removeStorageSync('type') //清除优惠券
@@ -285,6 +296,10 @@ Page({ @@ -285,6 +296,10 @@ Page({
285 }, 296 },
286 'complete': function (res) {} 297 'complete': function (res) {}
287 }) 298 })
  299 + }else{
  300 + setTimeout(() => {
  301 + util.getUser()
  302 + }, 2000)
288 } 303 }
289 }) 304 })
290 }, 305 },
@@ -311,18 +326,14 @@ Page({ @@ -311,18 +326,14 @@ Page({
311 url: '/pages/classify/classify', 326 url: '/pages/classify/classify',
312 }) 327 })
313 }, 1000) 328 }, 1000)
314 -  
315 -  
316 } else { 329 } else {
317 wx.showToast({ 330 wx.showToast({
318 title: data.msg, 331 title: data.msg,
319 icon: 'none' 332 icon: 'none'
320 }) 333 })
321 setTimeout(() => { 334 setTimeout(() => {
322 - wx.redirectTo({  
323 - url: '/pages/classify/classify',  
324 - })  
325 - }, 1000) 335 + util.getUser()
  336 + }, 2000)
326 } 337 }
327 }) 338 })
328 } 339 }
1 // pages/all-order/all-order.js 1 // pages/all-order/all-order.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: {
5 pageNum: 1, 6 pageNum: 1,
@@ -165,6 +166,10 @@ Page({ @@ -165,6 +166,10 @@ Page({
165 this.setData({ 166 this.setData({
166 tabList: list 167 tabList: list
167 }) 168 })
  169 + } else {
  170 + setTimeout(() => {
  171 + util.getUser()
  172 + }, 2000)
168 } 173 }
169 }) 174 })
170 }, 175 },
@@ -181,6 +186,10 @@ Page({ @@ -181,6 +186,10 @@ Page({
181 this.setData({ 186 this.setData({
182 tabList: list 187 tabList: list
183 }) 188 })
  189 + } else {
  190 + setTimeout(() => {
  191 + util.getUser()
  192 + }, 2000)
184 } 193 }
185 }) 194 })
186 }, 195 },
@@ -197,7 +206,11 @@ Page({ @@ -197,7 +206,11 @@ Page({
197 this.setData({ 206 this.setData({
198 tabList: list 207 tabList: list
199 }) 208 })
200 - } 209 + } else [
  210 + setTimeout(() => {
  211 + util.getUser()
  212 + }, 2000)
  213 + ]
201 }) 214 })
202 }, 215 },
203 //待评价 216 //待评价
@@ -213,6 +226,10 @@ Page({ @@ -213,6 +226,10 @@ Page({
213 this.setData({ 226 this.setData({
214 tabList: list 227 tabList: list
215 }) 228 })
  229 + } else {
  230 + setTimeout(() => {
  231 + util.getUser()
  232 + }, 2000)
216 } 233 }
217 }) 234 })
218 }, 235 },
@@ -229,6 +246,10 @@ Page({ @@ -229,6 +246,10 @@ Page({
229 this.setData({ 246 this.setData({
230 tabList: list 247 tabList: list
231 }) 248 })
  249 + } else {
  250 + setTimeout(() => {
  251 + util.getUser()
  252 + }, 2000)
232 } 253 }
233 }) 254 })
234 }, 255 },
@@ -273,9 +294,17 @@ Page({ @@ -273,9 +294,17 @@ Page({
273 tabList: tabList 294 tabList: tabList
274 }) 295 })
275 method.getRequest("/order/cancelOrder/" + orderId, data => { 296 method.getRequest("/order/cancelOrder/" + orderId, data => {
276 - if (data.statusCode == 0) {} 297 + if (data.statusCode == 0) {
  298 +
  299 + }else{
  300 + setTimeout(() => {
  301 + util.getUser()
  302 + }, 2000)
  303 + }
277 }) 304 })
278 - } else if (res.cancel) {} 305 + } else if (res.cancel) {
  306 +
  307 + }
279 } 308 }
280 }) 309 })
281 310
1 // pages/apply-after-sale/apply-after-sale.js 1 // pages/apply-after-sale/apply-after-sale.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: {
5 id: '', //订单号 6 id: '', //订单号
@@ -27,6 +28,10 @@ Page({ @@ -27,6 +28,10 @@ Page({
27 id: data.data.id, 28 id: data.data.id,
28 postList: data.data 29 postList: data.data
29 }) 30 })
  31 + }else{
  32 + setTimeout(() => {
  33 + util.getUser()
  34 + }, 2000)
30 } 35 }
31 }) 36 })
32 }, 37 },
@@ -53,6 +58,10 @@ Page({ @@ -53,6 +58,10 @@ Page({
53 this.setData({ 58 this.setData({
54 columns:data.data 59 columns:data.data
55 }) 60 })
  61 + }else{
  62 + setTimeout(() => {
  63 + util.getUser()
  64 + }, 2000)
56 } 65 }
57 }) 66 })
58 // this.setData({ 67 // this.setData({
@@ -135,6 +144,10 @@ Page({ @@ -135,6 +144,10 @@ Page({
135 wx.redirectTo({ 144 wx.redirectTo({
136 url: '/pages/all-order/all-order', 145 url: '/pages/all-order/all-order',
137 }) 146 })
  147 + }else{
  148 + setTimeout(() => {
  149 + util.getUser()
  150 + }, 2000)
138 } 151 }
139 }) 152 })
140 }, 153 },
1 // pages/card-detail/card-detail.js 1 // pages/card-detail/card-detail.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: {
5 postData: { 6 postData: {
@@ -30,6 +31,10 @@ Page({ @@ -30,6 +31,10 @@ Page({
30 this.setData({ 31 this.setData({
31 postData: data.data 32 postData: data.data
32 }) 33 })
  34 + }else{
  35 + setTimeout(() => {
  36 + util.getUser()
  37 + }, 2000)
33 } 38 }
34 }) 39 })
35 }, 40 },
@@ -45,6 +50,10 @@ Page({ @@ -45,6 +50,10 @@ Page({
45 this.setData({ 50 this.setData({
46 list:data.data 51 list:data.data
47 }) 52 })
  53 + }else{
  54 + setTimeout(() => {
  55 + util.getUser()
  56 + }, 2000)
48 } 57 }
49 }) 58 })
50 }, 59 },
1 // pages/affirm-order/affirm-order.js 1 // pages/affirm-order/affirm-order.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: {
5 userData: { 6 userData: {
@@ -34,7 +35,6 @@ Page({ @@ -34,7 +35,6 @@ Page({
34 //商品 35 //商品
35 getList() { 36 getList() {
36 let pitchList = wx.getStorageSync('pitchList') 37 let pitchList = wx.getStorageSync('pitchList')
37 - //let payment = this.data.goodsList.payment;  
38 method.getRequest("/order/buyNow/" + pitchList, data => { 38 method.getRequest("/order/buyNow/" + pitchList, data => {
39 this.setData({ 39 this.setData({
40 goodsList: data.data, 40 goodsList: data.data,
@@ -46,7 +46,7 @@ Page({ @@ -46,7 +46,7 @@ Page({
46 }) 46 })
47 } 47 }
48 let payment = Number(this.data.goodsList.payment) - Number(this.data.discountText) 48 let payment = Number(this.data.goodsList.payment) - Number(this.data.discountText)
49 - let goodsList =this.data.goodsList; 49 + let goodsList = this.data.goodsList;
50 goodsList.payment = payment; 50 goodsList.payment = payment;
51 this.setData({ 51 this.setData({
52 goodsList: goodsList 52 goodsList: goodsList
@@ -232,19 +232,21 @@ Page({ @@ -232,19 +232,21 @@ Page({
232 deliveryTime: this.data.date, 232 deliveryTime: this.data.date,
233 note: this.data.leavaWord, 233 note: this.data.leavaWord,
234 } 234 }
235 - console.log(this.data.cartsId, 'cartid')  
236 - console.log(this.data.addressId, 'addid')  
237 method.postRequest("/order/buyNow", postData, data => { 235 method.postRequest("/order/buyNow", postData, data => {
238 if (data.statusCode == 0) { 236 if (data.statusCode == 0) {
239 this.setData({ 237 this.setData({
240 cartIds: data.data.id 238 cartIds: data.data.id
241 }) 239 })
242 - this.buys(); 240 + // this.buys()
  241 + this.payment();
243 } else { 242 } else {
244 wx.showToast({ 243 wx.showToast({
245 title: data.msg, 244 title: data.msg,
246 icon: 'none' 245 icon: 'none'
247 }) 246 })
  247 + // setTimeout(() => {
  248 + // util.getUser()
  249 + // }, 2000)
248 } 250 }
249 }) 251 })
250 }, 500) 252 }, 500)
@@ -252,11 +254,11 @@ Page({ @@ -252,11 +254,11 @@ Page({
252 }, 254 },
253 //购物车-立即购买 255 //购物车-立即购买
254 buys() { 256 buys() {
255 - console.log(this.data.cartIds, 'card')  
256 method.getRequest("/order/buyNow/" + this.data.cartIds, data => { 257 method.getRequest("/order/buyNow/" + this.data.cartIds, data => {
257 if (data.statusCode == 0) { 258 if (data.statusCode == 0) {
258 this.payment(); 259 this.payment();
259 wx.setStorageSync('cardAmount', "") 260 wx.setStorageSync('cardAmount', "")
  261 + }else{
260 } 262 }
261 }) 263 })
262 }, 264 },
@@ -277,8 +279,15 @@ Page({ @@ -277,8 +279,15 @@ Page({
277 wx.showToast({ 279 wx.showToast({
278 title: '支付成功', 280 title: '支付成功',
279 }) 281 })
  282 + wx.switchTab({
  283 + url: '/pages/shopping-cart/shopping-cart',
  284 + })
  285 + },
  286 + 'fail': function (res) {
  287 + wx.switchTab({
  288 + url: '/pages/shopping-cart/shopping-cart',
  289 + })
280 }, 290 },
281 - 'fail': function (res) {},  
282 'complete': function (res) {} 291 'complete': function (res) {}
283 }) 292 })
284 } 293 }
@@ -286,8 +295,7 @@ Page({ @@ -286,8 +295,7 @@ Page({
286 }, 295 },
287 onLoad: function (options) { 296 onLoad: function (options) {
288 this.getList(); 297 this.getList();
289 -  
290 - if (cardId) { 298 + if (this.data.cardId) {
291 this.setData({ 299 this.setData({
292 couponId: cardId, 300 couponId: cardId,
293 id: options.id, 301 id: options.id,
@@ -326,16 +334,15 @@ Page({ @@ -326,16 +334,15 @@ Page({
326 that.setData({ 334 that.setData({
327 cartsId: cartsId, 335 cartsId: cartsId,
328 cartList: goodsCarts, 336 cartList: goodsCarts,
329 - couponId:cardId, 337 + couponId: cardId,
330 // date: date, 338 // date: date,
331 type: type 339 type: type
332 }) 340 })
333 that.getTotalPrice(); 341 that.getTotalPrice();
334 that.getAddress(); 342 that.getAddress();
335 that.getDayTime(); //获取当天时间 343 that.getDayTime(); //获取当天时间
336 - that.buy(); 344 + // that.buy();
337 that.getList(); // 345 that.getList(); //
338 - console.log(this.data.userData, '66')  
339 // wx.removeStorageSync('pitchCart') 346 // wx.removeStorageSync('pitchCart')
340 // wx.removeStorageSync('pitchList') 347 // wx.removeStorageSync('pitchList')
341 wx.removeStorageSync('cardId') 348 wx.removeStorageSync('cardId')
1 // pages/classify/classify.js 1 // pages/classify/classify.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: {
5 idx: 0, //商品规格索引 6 idx: 0, //商品规格索引
@@ -130,6 +131,10 @@ Page({ @@ -130,6 +131,10 @@ Page({
130 goodsData: data.data, 131 goodsData: data.data,
131 stockNum: data.data.list[0].goodsStock 132 stockNum: data.data.list[0].goodsStock
132 }) 133 })
  134 + }else{
  135 + setTimeout(() => {
  136 + util.getUser()
  137 + }, 2000)
133 } 138 }
134 }) 139 })
135 }, 140 },
@@ -224,6 +229,10 @@ Page({ @@ -224,6 +229,10 @@ Page({
224 url: '/pages/integral-order/integral-order', 229 url: '/pages/integral-order/integral-order',
225 }) 230 })
226 } 231 }
  232 + }else{
  233 + setTimeout(() => {
  234 + util.getUser()
  235 + }, 2000)
227 } 236 }
228 }) 237 })
229 238
@@ -360,6 +360,7 @@ @@ -360,6 +360,7 @@
360 margin-bottom: 10rpx; 360 margin-bottom: 10rpx;
361 display: flex; 361 display: flex;
362 width: auto; 362 width: auto;
  363 + align-items: center;
363 } 364 }
364 365
365 .specItem1 { 366 .specItem1 {
1 -// pages/demo1/demo1.js  
2 -Page({  
3 -  
4 - /**  
5 - * 页面的初始数据  
6 - */  
7 - data: {  
8 -  
9 - },  
10 -  
11 - /**  
12 - * 生命周期函数--监听页面加载  
13 - */  
14 - onLoad: function (options) {  
15 -  
16 - },  
17 -  
18 - /**  
19 - * 生命周期函数--监听页面初次渲染完成  
20 - */  
21 - onReady: function () {  
22 -  
23 - },  
24 -  
25 - /**  
26 - * 生命周期函数--监听页面显示  
27 - */  
28 - onShow: function () {  
29 -  
30 - },  
31 -  
32 - /**  
33 - * 生命周期函数--监听页面隐藏  
34 - */  
35 - onHide: function () {  
36 -  
37 - },  
38 -  
39 - /**  
40 - * 生命周期函数--监听页面卸载  
41 - */  
42 - onUnload: function () {  
43 -  
44 - },  
45 -  
46 - /**  
47 - * 页面相关事件处理函数--监听用户下拉动作  
48 - */  
49 - onPullDownRefresh: function () {  
50 -  
51 - },  
52 -  
53 - /**  
54 - * 页面上拉触底事件的处理函数  
55 - */  
56 - onReachBottom: function () {  
57 -  
58 - },  
59 -  
60 - /**  
61 - * 用户点击右上角分享  
62 - */  
63 - onShareAppMessage: function () {  
64 -  
65 - }  
66 -})  
1 -{  
2 - "usingComponents": {}  
3 -}  
1 -<!--pages/demo1/demo1.wxml-->  
2 -<text>pages/demo1/demo1.wxml</text>  
1 -/* pages/demo1/demo1.wxss */  
@@ -40,6 +40,10 @@ Page({ @@ -40,6 +40,10 @@ Page({
40 }) 40 })
41 41
42 }) 42 })
  43 + }else{
  44 + setTimeout(() => {
  45 + util.getUser()
  46 + }, 2000)
43 } 47 }
44 }) 48 })
45 }, 49 },
1 // pages/add-address/add-address.js 1 // pages/add-address/add-address.js
2 let method = require("../../utils/reuqest.js"); 2 let method = require("../../utils/reuqest.js");
  3 +const util = require("../../utils/util.js");
3 const chooseLocation = requirePlugin('chooseLocation'); 4 const chooseLocation = requirePlugin('chooseLocation');
4 Page({ 5 Page({
5 data: { 6 data: {
1 // pages/evaluate/evaluate.js 1 // pages/evaluate/evaluate.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: {
5 imags: [], 6 imags: [],
@@ -5,7 +5,7 @@ let discountCart = []; //弹窗优惠券id @@ -5,7 +5,7 @@ let discountCart = []; //弹窗优惠券id
5 let discountListId = []; //优惠券列表ID 5 let discountListId = []; //优惠券列表ID
6 Page({ 6 Page({
7 data: { 7 data: {
8 - show: '', 8 + show: false,
9 discountList: '', //优惠券列表 9 discountList: '', //优惠券列表
10 value: '', 10 value: '',
11 swiperArray: [], //轮播图 11 swiperArray: [], //轮播图
@@ -101,7 +101,7 @@ Page({ @@ -101,7 +101,7 @@ Page({
101 t: {} 101 t: {}
102 } 102 }
103 method.postRequest('/goods/limitedTimeOffer', postData, data => { 103 method.postRequest('/goods/limitedTimeOffer', postData, data => {
104 - console.log(data,'data') 104 + console.log(data, 'data')
105 if (data.statusCode == 0) { 105 if (data.statusCode == 0) {
106 this.setData({ 106 this.setData({
107 discountArray: data.data 107 discountArray: data.data
@@ -138,11 +138,6 @@ Page({ @@ -138,11 +138,6 @@ Page({
138 time: date 138 time: date
139 }) 139 })
140 } 140 }
141 -  
142 -  
143 - // var str2 = toString(date / 1000 / 3600);  
144 - // var ary = str2.split("\\.")  
145 - // // console.log(str2.split("\\."),'ary')  
146 // var str = ary[1] 141 // var str = ary[1]
147 } 142 }
148 }) 143 })
@@ -177,16 +172,12 @@ Page({ @@ -177,16 +172,12 @@ Page({
177 }, 172 },
178 dayCountDown() { 173 dayCountDown() {
179 var nowTime = this.getCurrentDate(2) 174 var nowTime = this.getCurrentDate(2)
180 - console.log(nowTime, '现在时间')  
181 var nowTimes = Date.parse(nowTime) 175 var nowTimes = Date.parse(nowTime)
182 this.setData({ 176 this.setData({
183 nowTimes: nowTimes 177 nowTimes: nowTimes
184 }) 178 })
185 - console.log(nowTimes, '现在时间戳')  
186 var endTimes = new Date(new Date().toLocaleDateString()).getTime() + 24 * 60 * 60 * 1000 - 1; //每天24:00时间戳 179 var endTimes = new Date(new Date().toLocaleDateString()).getTime() + 24 * 60 * 60 * 1000 - 1; //每天24:00时间戳
187 - console.log(endTimes, '12点时间戳')  
188 var jieguo = Number(endTimes) - Number(nowTimes) 180 var jieguo = Number(endTimes) - Number(nowTimes)
189 - console.log(jieguo, '时间戳差')  
190 this.setData({ 181 this.setData({
191 times: jieguo 182 times: jieguo
192 }) 183 })
@@ -225,6 +216,10 @@ Page({ @@ -225,6 +216,10 @@ Page({
225 icon: 'none', 216 icon: 'none',
226 duration: 1000 217 duration: 1000
227 }) 218 })
  219 + setTimeout(() => {
  220 + util.getUser()
  221 + }, 1000)
  222 +
228 } 223 }
229 }) 224 })
230 } 225 }
@@ -288,11 +283,8 @@ Page({ @@ -288,11 +283,8 @@ Page({
288 method.getRequest("/myUser/get", data => { 283 method.getRequest("/myUser/get", data => {
289 if (data.statusCode == 0) { 284 if (data.statusCode == 0) {
290 if (data.data) { 285 if (data.data) {
291 - console.log("true")  
292 this.showPopup() 286 this.showPopup()
293 - } else {  
294 - console.log("false")  
295 - } 287 + } else {}
296 } 288 }
297 }) 289 })
298 }, 290 },
@@ -300,10 +292,8 @@ Page({ @@ -300,10 +292,8 @@ Page({
300 this.setData({ 292 this.setData({
301 show: true 293 show: true
302 }); 294 });
303 - console.log("show")  
304 }, 295 },
305 onClose() { 296 onClose() {
306 - console.log('关闭')  
307 this.setData({ 297 this.setData({
308 show: false 298 show: false
309 }); 299 });
@@ -204,6 +204,7 @@ @@ -204,6 +204,7 @@
204 204
205 .countPic image { 205 .countPic image {
206 width: 100%; 206 width: 100%;
  207 + border-radius: 16rpx;
207 height: 100%; 208 height: 100%;
208 } 209 }
209 210
@@ -212,6 +213,7 @@ @@ -212,6 +213,7 @@
212 height: 46rpx; 213 height: 46rpx;
213 font-size: 28rpx; 214 font-size: 28rpx;
214 margin-top: 4rpx; 215 margin-top: 4rpx;
  216 + overflow: hidden;
215 } 217 }
216 218
217 .countPrice { 219 .countPrice {
@@ -468,7 +470,7 @@ @@ -468,7 +470,7 @@
468 } 470 }
469 471
470 .collectIcon { 472 .collectIcon {
471 - font-size: 22rpx; 473 + font-size: 24rpx;
472 color: #ff4742; 474 color: #ff4742;
473 display: flex; 475 display: flex;
474 align-items: center; 476 align-items: center;
1 // pages/affirm-order/affirm-order.js 1 // pages/affirm-order/affirm-order.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: {
5 userData: { 6 userData: {
1 // pages/my-member/my-member.js 1 // pages/my-member/my-member.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: {
5 postData: { 6 postData: {
@@ -28,13 +29,14 @@ Page({ @@ -28,13 +29,14 @@ Page({
28 if (data.statusCode == 0) { 29 if (data.statusCode == 0) {
29 wx.showToast({ 30 wx.showToast({
30 title: '领取成功', 31 title: '领取成功',
31 - icon:"none" 32 + icon: "none"
32 }) 33 })
  34 + this.getMemberInfo()
33 this.setData({ 35 this.setData({
34 noVip: false, 36 noVip: false,
35 vip: true 37 vip: true
36 }) 38 })
37 - } 39 + } else {}
38 }) 40 })
39 }, 41 },
40 //会员信息 42 //会员信息
@@ -48,7 +50,7 @@ Page({ @@ -48,7 +50,7 @@ Page({
48 }) 50 })
49 }, 51 },
50 //会员卡详情 52 //会员卡详情
51 - cardDetail(){ 53 + cardDetail() {
52 wx.navigateTo({ 54 wx.navigateTo({
53 url: '/pages/card-detail/card-detail', 55 url: '/pages/card-detail/card-detail',
54 }) 56 })
1 // pages/product-detail/product-detail.js 1 // pages/product-detail/product-detail.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: {
5 id: '', 6 id: '',
@@ -34,7 +35,7 @@ Page({ @@ -34,7 +35,7 @@ Page({
34 richText: '', 35 richText: '',
35 couponVos: [], //优惠券列表 36 couponVos: [], //优惠券列表
36 userData: '', //地址信息 37 userData: '', //地址信息
37 - ceshi: [],//商品规格 38 + ceshi: [], //商品规格
38 idx: 0, //商品规格 39 idx: 0, //商品规格
39 40
40 }, 41 },
@@ -120,9 +121,15 @@ Page({ @@ -120,9 +121,15 @@ Page({
120 }, 121 },
121 //进入购物车 122 //进入购物车
122 goCart() { 123 goCart() {
  124 + if(wx.getStorageSync('Authorization')==" "){
  125 + setTimeout(()=>{
  126 + util.getUser();
  127 + },2000)
  128 + }else{
123 wx.switchTab({ 129 wx.switchTab({
124 url: '/pages/shopping-cart/shopping-cart', 130 url: '/pages/shopping-cart/shopping-cart',
125 }) 131 })
  132 + }
126 }, 133 },
127 // 收藏 134 // 收藏
128 collection() { 135 collection() {
@@ -142,11 +149,25 @@ Page({ @@ -142,11 +149,25 @@ Page({
142 method.getRequest("/myUser/myCollection/" + this.data.id, data => { 149 method.getRequest("/myUser/myCollection/" + this.data.id, data => {
143 if (data.statusCode == 0) { 150 if (data.statusCode == 0) {
144 151
  152 + } else {
  153 + wx.showToast({
  154 + title: '请先登录',
  155 + icon:'none'
  156 + })
  157 + setTimeout(() => {
  158 + util.getUser()
  159 + }, 2000)
145 } 160 }
146 }) 161 })
147 }, 162 },
148 //联系客服 163 //联系客服
149 linkKefu() { 164 linkKefu() {
  165 +
  166 + if (getStorageSync.Authorization == "") {
  167 + setTimeout(() => {
  168 + util.getUser()
  169 + }, 2000)
  170 + } else {
150 wx.makePhoneCall({ 171 wx.makePhoneCall({
151 phoneNumber: '111111111000', 172 phoneNumber: '111111111000',
152 success() { 173 success() {
@@ -156,6 +177,7 @@ Page({ @@ -156,6 +177,7 @@ Page({
156 console.log('拨打电话失败') 177 console.log('拨打电话失败')
157 } 178 }
158 }) 179 })
  180 + }
159 }, 181 },
160 //选择规格 182 //选择规格
161 selectSku() { 183 selectSku() {
@@ -205,6 +227,9 @@ Page({ @@ -205,6 +227,9 @@ Page({
205 duration: 1000 227 duration: 1000
206 }) 228 })
207 } else { 229 } else {
  230 + setTimeout(() => {
  231 + util.getUser()
  232 + }, 2000)
208 wx.showToast({ 233 wx.showToast({
209 title: data.msg, 234 title: data.msg,
210 icon: 'none', 235 icon: 'none',
@@ -264,6 +289,9 @@ Page({ @@ -264,6 +289,9 @@ Page({
264 url: '/pages/affirm-order/affirm-order', 289 url: '/pages/affirm-order/affirm-order',
265 }) 290 })
266 } else { 291 } else {
  292 + setTimeout(() => {
  293 + util.getUser()
  294 + }, 2000)
267 wx.showToast({ 295 wx.showToast({
268 title: '积分不足', 296 title: '积分不足',
269 icon: 'none', 297 icon: 'none',
@@ -314,6 +342,9 @@ Page({ @@ -314,6 +342,9 @@ Page({
314 url: '/pages/affirm-order/affirm-order?id=' + that.data.id + '&count=' + that.data.payCount + '&stockNum=' + that.data.stockNum + "&skuId=" + this.data.skuId, 342 url: '/pages/affirm-order/affirm-order?id=' + that.data.id + '&count=' + that.data.payCount + '&stockNum=' + that.data.stockNum + "&skuId=" + this.data.skuId,
315 }) 343 })
316 } else { 344 } else {
  345 + setTimeout(() => {
  346 + util.getUser()
  347 + }, 2000)
317 wx.showToast({ 348 wx.showToast({
318 title: data.msg, 349 title: data.msg,
319 icon: 'none', 350 icon: 'none',
@@ -64,8 +64,9 @@ @@ -64,8 +64,9 @@
64 </view> 64 </view>
65 </view> 65 </view>
66 </view> 66 </view>
  67 + <view class="noData" wx:if="{{infoList.length==0}}">暂时没有相关商品的更多评价~</view>
67 <view class="evaluateBox" wx:for="{{infoList}}" wx:if="{{infolist!==0}}"> 68 <view class="evaluateBox" wx:for="{{infoList}}" wx:if="{{infolist!==0}}">
68 - <view class="evaluateInfo"> 69 + <view class="evaluateInfo" >
69 <view class="userImg" style="display:inline-block"> 70 <view class="userImg" style="display:inline-block">
70 <image src="{{item.wxHeadImg}}"> </image> 71 <image src="{{item.wxHeadImg}}"> </image>
71 </view> 72 </view>
@@ -125,9 +126,10 @@ @@ -125,9 +126,10 @@
125 </view> 126 </view>
126 <!-- 选择规格弹框 --> 127 <!-- 选择规格弹框 -->
127 <view class="mask" catchtap="closeMaskSku" wx:if='{{showMaskSku}}'> 128 <view class="mask" catchtap="closeMaskSku" wx:if='{{showMaskSku}}'>
128 - <view class="diceng" > 129 + <view class="diceng">
129 <view class="skuBox"> 130 <view class="skuBox">
130 - <view wx:for="{{goodsData.list}}" class="{{idx==index?'skuItem1':'skuItem'}}" bindtap="check" data-index="{{index}}" data-id="{{item.goodsSkuId}}">{{item.goodsSkuName}}</view> 131 + <view wx:for="{{goodsData.list}}" class="{{idx==index?'skuItem1':'skuItem'}}" bindtap="check"
  132 + data-index="{{index}}" data-id="{{item.goodsSkuId}}">{{item.goodsSkuName}}</view>
131 </view> 133 </view>
132 </view> 134 </view>
133 </view> 135 </view>
@@ -120,9 +120,11 @@ @@ -120,9 +120,11 @@
120 padding-left: 32rpx; 120 padding-left: 32rpx;
121 box-sizing: border-box; 121 box-sizing: border-box;
122 } 122 }
123 -.countDownTxt{ 123 +
  124 +.countDownTxt {
124 margin-right: 30rpx; 125 margin-right: 30rpx;
125 } 126 }
  127 +
126 .countTime { 128 .countTime {
127 display: inline-block; 129 display: inline-block;
128 /* background-color: #9b74fb; */ 130 /* background-color: #9b74fb; */
@@ -136,7 +138,7 @@ @@ -136,7 +138,7 @@
136 color: #fff; 138 color: #fff;
137 font-size: 24rpx; 139 font-size: 24rpx;
138 text-align: center; 140 text-align: center;
139 - background: rgba(95,0,0,0.8); 141 + background: rgba(95, 0, 0, 0.8);
140 border-radius: 8rpx; 142 border-radius: 8rpx;
141 margin-right: 6rpx; 143 margin-right: 6rpx;
142 margin-left: 6rpx; 144 margin-left: 6rpx;
@@ -186,7 +188,7 @@ @@ -186,7 +188,7 @@
186 /* 评价 */ 188 /* 评价 */
187 .evaluateContent { 189 .evaluateContent {
188 width: 750rpx; 190 width: 750rpx;
189 - height: 236rpx; 191 + max-height: 236rpx;
190 box-sizing: border-box; 192 box-sizing: border-box;
191 background-color: #ffffff; 193 background-color: #ffffff;
192 margin: 0 auto; 194 margin: 0 auto;
@@ -198,6 +200,15 @@ @@ -198,6 +200,15 @@
198 -webkit-box-orient: vertical; 200 -webkit-box-orient: vertical;
199 } 201 }
200 202
  203 +.noData {
  204 + height: 58rpx;
  205 + color: #999999;
  206 + font-size: 26rpx;
  207 + display: flex;
  208 + align-items: center;
  209 + justify-content: center;
  210 +}
  211 +
201 .evaluateContents { 212 .evaluateContents {
202 width: 750rpx; 213 width: 750rpx;
203 height: auto; 214 height: auto;
@@ -470,7 +481,7 @@ button { @@ -470,7 +481,7 @@ button {
470 } 481 }
471 482
472 /* 规格弹框 */ 483 /* 规格弹框 */
473 -.skuBox{ 484 +.skuBox {
474 width: 100%; 485 width: 100%;
475 padding: 10rpx; 486 padding: 10rpx;
476 display: flex; 487 display: flex;
@@ -481,7 +492,8 @@ button { @@ -481,7 +492,8 @@ button {
481 margin-top: 30rpx; 492 margin-top: 30rpx;
482 margin-bottom: 50rpx; 493 margin-bottom: 50rpx;
483 } 494 }
484 -.skuItem{ 495 +
  496 +.skuItem {
485 font-size: 30rpx; 497 font-size: 30rpx;
486 color: #323233; 498 color: #323233;
487 height: 57rpx; 499 height: 57rpx;
@@ -494,11 +506,12 @@ button { @@ -494,11 +506,12 @@ button {
494 align-items: center; 506 align-items: center;
495 margin-right: 20rpx; 507 margin-right: 20rpx;
496 } 508 }
497 -.skuItem1{ 509 +
  510 +.skuItem1 {
498 font-size: 30rpx; 511 font-size: 30rpx;
499 height: 57rpx; 512 height: 57rpx;
500 width: auto; 513 width: auto;
501 - background-color:#868585; 514 + background-color: #868585;
502 padding: 0 20rpx; 515 padding: 0 20rpx;
503 border-radius: 16rpx; 516 border-radius: 16rpx;
504 margin-bottom: 10rpx; 517 margin-bottom: 10rpx;
@@ -506,6 +519,7 @@ button { @@ -506,6 +519,7 @@ button {
506 align-items: center; 519 align-items: center;
507 margin-right: 20rpx; 520 margin-right: 20rpx;
508 } 521 }
  522 +
509 /* 购物车弹框 */ 523 /* 购物车弹框 */
510 .mask { 524 .mask {
511 position: fixed; 525 position: fixed;
@@ -4,19 +4,10 @@ Page({ @@ -4,19 +4,10 @@ Page({
4 data: { 4 data: {
5 default: true, 5 default: true,
6 defaultType: '', 6 defaultType: '',
7 - list: [{  
8 - name: '王先生',  
9 - tell: '12345678910',  
10 - address: '天津市 西青区科技园小区',  
11 - defaultType: '1'  
12 - }], 7 + list: [],
13 exceedRange: true, 8 exceedRange: true,
14 - exceedArray: [{  
15 - name: '王先生',  
16 - tell: '12345678910',  
17 - address: '天津市 西青区科技园小区西青区科技园小区',  
18 - defaultType: '1'  
19 - }], 9 + exceedArray: [],
  10 + edit:'' //判断是否是新增地址页面跳转
20 }, 11 },
21 12
22 //获取地址列表 13 //获取地址列表
@@ -34,9 +25,12 @@ Page({ @@ -34,9 +25,12 @@ Page({
34 let id = e.currentTarget.dataset.id; 25 let id = e.currentTarget.dataset.id;
35 let addIndex=e.currentTarget.dataset.index; 26 let addIndex=e.currentTarget.dataset.index;
36 wx.setStorageSync('addIndex', addIndex) 27 wx.setStorageSync('addIndex', addIndex)
  28 + if(!this.data.edit){
37 wx.navigateBack({ 29 wx.navigateBack({
38 delta: 1, 30 delta: 1,
39 }) 31 })
  32 + }
  33 +
40 }, 34 },
41 // 默认地址 35 // 默认地址
42 defaultEvent(e) { 36 defaultEvent(e) {
@@ -50,7 +44,6 @@ Page({ @@ -50,7 +44,6 @@ Page({
50 }, 44 },
51 //编辑地址 45 //编辑地址
52 editEvent(e) { 46 editEvent(e) {
53 - console.log(e)  
54 let list = this.data.list; 47 let list = this.data.list;
55 let id = e.currentTarget.dataset.id; 48 let id = e.currentTarget.dataset.id;
56 let idx = e.currentTarget.dataset.index; 49 let idx = e.currentTarget.dataset.index;
@@ -109,6 +102,9 @@ Page({ @@ -109,6 +102,9 @@ Page({
109 }) 102 })
110 }, 103 },
111 onLoad: function (options) { 104 onLoad: function (options) {
  105 + this.setData({
  106 + edit:options.edit
  107 + })
112 108
113 this.getAddressList(); 109 this.getAddressList();
114 }, 110 },
1 /* pages/select-address/select-address.wxss */ 1 /* pages/select-address/select-address.wxss */
  2 +page{
  3 + background-color: #f1f2f4;
  4 +}
2 .container { 5 .container {
3 width: 750rpx; 6 width: 750rpx;
4 - background-color: #f1f2f4; 7 +
5 border-top: 1rpx solid #f2f2f2; 8 border-top: 1rpx solid #f2f2f2;
6 - padding-bottom: 200rpx; 9 + padding-bottom:120rpx;
7 } 10 }
8 11
9 .addressBox { 12 .addressBox {
@@ -4,6 +4,7 @@ Page({ @@ -4,6 +4,7 @@ Page({
4 data: { 4 data: {
5 checkType: 1, 5 checkType: 1,
6 userData: {}, 6 userData: {},
  7 + addHint: false, //判断有没有地址
7 startTime: '', //日历选择获取当天日期 8 startTime: '', //日历选择获取当天日期
8 date: '', 9 date: '',
9 cartList: [], 10 cartList: [],
@@ -24,27 +25,14 @@ Page({ @@ -24,27 +25,14 @@ Page({
24 name: "hello" 25 name: "hello"
25 } 26 }
26 }, 27 },
27 -  
28 //地址信息 28 //地址信息
29 - // getAddress() {  
30 - // method.getRequest("/address", data => {  
31 - // if (data.statusCode == 0) {  
32 - // data.data.forEach((item, index) => {  
33 - // if (item.delFlag == 1) {  
34 - // this.setData({  
35 - // userData: item,  
36 - // })  
37 - // }  
38 - // })  
39 - // }  
40 - // })  
41 - // },  
42 getAddress() { 29 getAddress() {
43 let index = wx.getStorageSync('addIndex') 30 let index = wx.getStorageSync('addIndex')
44 method.getRequest("/address", data => { 31 method.getRequest("/address", data => {
45 if (data.statusCode == 0) { 32 if (data.statusCode == 0) {
46 this.setData({ 33 this.setData({
47 userData: data.data[index], 34 userData: data.data[index],
  35 + addHint: true
48 }) 36 })
49 } 37 }
50 }) 38 })
@@ -236,7 +224,6 @@ Page({ @@ -236,7 +224,6 @@ Page({
236 }) 224 })
237 return false 225 return false
238 } else { 226 } else {
239 -  
240 wx.navigateTo({ 227 wx.navigateTo({
241 url: '/pages/cart-affirm-order/cart-affirm-order', 228 url: '/pages/cart-affirm-order/cart-affirm-order',
242 }) 229 })
@@ -247,6 +234,17 @@ Page({ @@ -247,6 +234,17 @@ Page({
247 this.data.pitchCart.push(carts[i]) 234 this.data.pitchCart.push(carts[i])
248 } 235 }
249 } 236 }
  237 + let list = this.data.carts;
  238 + list.forEach((item, index) => {
  239 + if(item.selected==true){
  240 + console.log(item,"item")
  241 + list.splice(index,1)
  242 + console.log(list,'list')
  243 + }
  244 + this.setData({
  245 + carts:list
  246 + })
  247 + })
250 wx.setStorageSync('date', this.data.date) 248 wx.setStorageSync('date', this.data.date)
251 console.log(this.data.date, 'datess') 249 console.log(this.data.date, 'datess')
252 wx.removeStorageSync('time') 250 wx.removeStorageSync('time')
@@ -284,15 +282,8 @@ Page({ @@ -284,15 +282,8 @@ Page({
284 }) 282 })
285 this.setData({ 283 this.setData({
286 hasList: true, 284 hasList: true,
287 - carts: [{  
288 - id: 1,  
289 - title: '新鲜芹菜 半斤',  
290 - desc: '商品描述商品描述',  
291 - image: '/images/demo/s5.png',  
292 - num: 4,  
293 - price: 0.01,  
294 - selected: false  
295 - }] 285 + carts: [],
  286 + checkNum : 0
296 }); 287 });
297 this.getTotalPrice(); 288 this.getTotalPrice();
298 this.getAddress() //获取默认地址 289 this.getAddress() //获取默认地址
@@ -2,6 +2,11 @@ @@ -2,6 +2,11 @@
2 <view class="container"> 2 <view class="container">
3 <!-- 地址 --> 3 <!-- 地址 -->
4 <view class="userInfo" bindtap="goAddress"> 4 <view class="userInfo" bindtap="goAddress">
  5 + <view class="addHint" wx:if="{{addHint==false}}">
  6 + <view class="addItem1">暂未获取到收获地址</view>
  7 + <view class="addItem2"> 请选择收货地址</view>
  8 + </view>
  9 + <view wx:if="{{addHint==true}}">
5 <view class="userName">{{userData.name}}</view> 10 <view class="userName">{{userData.name}}</view>
6 <view class="userTell">{{userData.phone}}</view> 11 <view class="userTell">{{userData.phone}}</view>
7 <view class="default" wx:if="{{userData.delFlag==1}}">默认</view> 12 <view class="default" wx:if="{{userData.delFlag==1}}">默认</view>
@@ -10,13 +15,12 @@ @@ -10,13 +15,12 @@
10 <image src="/images/04-01/arrow.png"></image> 15 <image src="/images/04-01/arrow.png"></image>
11 </view> 16 </view>
12 </view> 17 </view>
  18 + </view>
13 <!-- 配送时间 --> 19 <!-- 配送时间 -->
14 <view class="timeBox"> 20 <view class="timeBox">
15 <view class="calendar "> 21 <view class="calendar ">
16 <image src="/images/04-01/rili.png"></image> 22 <image src="/images/04-01/rili.png"></image>
17 </view> 23 </view>
18 - <!-- <view class="timeTitle">配送时间:</view>  
19 - <view class="selectTime">{{}}</view> -->  
20 <view class="section"> 24 <view class="section">
21 <picker mode="date" value="{{date}}" bindchange="bindDateChange" start="{{startTime}}"> 25 <picker mode="date" value="{{date}}" bindchange="bindDateChange" start="{{startTime}}">
22 <view class="picker"> 26 <view class="picker">
@@ -30,7 +34,8 @@ @@ -30,7 +34,8 @@
30 <view class="main"> 34 <view class="main">
31 <view wx:if="{{hasList}}"> 35 <view wx:if="{{hasList}}">
32 <view class="cart-box"> 36 <view class="cart-box">
33 - <view class="cart-list" wx:for="{{carts}}" wx:key="{{index}}" data-goodsid="{{item.goodsId}}" bindtap="goDetail"> 37 + <view class="cart-list" wx:for="{{carts}}" wx:key="{{index}}" data-goodsid="{{item.goodsId}}"
  38 + bindtap="goDetail">
34 <icon wx:if="{{item.selected}}" type="success" color="#FF4903" data-index="{{index}}" class="cart-pro-select" 39 <icon wx:if="{{item.selected}}" type="success" color="#FF4903" data-index="{{index}}" class="cart-pro-select"
35 catchtap="selectList" /> 40 catchtap="selectList" />
36 <icon wx:else type="circle" class="cart-pro-select" data-index="{{index}}" catchtap="selectList" /> 41 <icon wx:else type="circle" class="cart-pro-select" data-index="{{index}}" catchtap="selectList" />
@@ -52,7 +57,7 @@ @@ -52,7 +57,7 @@
52 </view> 57 </view>
53 </view> 58 </view>
54 59
55 - <view class="cart-footer"> 60 + <!-- <view class="cart-footer">
56 <icon wx:if="{{selectAllStatus}}" type="success_circle" color="#fff" class="total-select" bindtap="selectAll" /> 61 <icon wx:if="{{selectAllStatus}}" type="success_circle" color="#fff" class="total-select" bindtap="selectAll" />
57 <icon wx:else type="circle" color="#fff" class="total-select" bindtap="selectAll" /> 62 <icon wx:else type="circle" color="#fff" class="total-select" bindtap="selectAll" />
58 <view class="order-icon"> 63 <view class="order-icon">
@@ -62,7 +67,7 @@ @@ -62,7 +67,7 @@
62 </view> 67 </view>
63 <text>全选</text> 68 <text>全选</text>
64 <text class="cart-toatl-price">¥{{totalPrice}}</text> 69 <text class="cart-toatl-price">¥{{totalPrice}}</text>
65 - </view> 70 + </view> -->
66 </view> 71 </view>
67 <view wx:if="{{carts.length==0}}"> 72 <view wx:if="{{carts.length==0}}">
68 <view class="cart-no-data">一件商品都没有呢</view> 73 <view class="cart-no-data">一件商品都没有呢</view>
1 /* pages/shopping-cart/shopping-cart.wxss */ 1 /* pages/shopping-cart/shopping-cart.wxss */
2 -page{ 2 +page {
3 background-color: #f1f2f4; 3 background-color: #f1f2f4;
4 } 4 }
  5 +
5 .container { 6 .container {
6 background-color: #f1f2f4; 7 background-color: #f1f2f4;
7 width: 100%; 8 width: 100%;
8 padding-top: 6rpx; 9 padding-top: 6rpx;
  10 + padding-bottom: 120rpx;
  11 +}
  12 +
  13 +.addHint {
  14 + height: 128rpx;
  15 + align-items: center;
  16 + padding-top: 26rpx;
  17 +}
  18 +
  19 +.addItem1 {
  20 + font-size: 28rpx;
  21 + font-weight: 400;
  22 + text-align: left;
  23 + color: #323233;
  24 + display:block;
  25 +}
  26 +.addItem2{
  27 + font-size: 32rpx;
  28 + font-weight: 600;
  29 + text-align: left;
  30 + color: #323233;
  31 + margin-top: 20rpx;
9 } 32 }
10 33
  34 +
11 /* 用户信息 */ 35 /* 用户信息 */
12 .userInfo { 36 .userInfo {
13 width: 686rpx; 37 width: 686rpx;
@@ -102,10 +126,12 @@ page{ @@ -102,10 +126,12 @@ page{
102 width: 32rpx; 126 width: 32rpx;
103 margin-right: 12rpx; 127 margin-right: 12rpx;
104 } 128 }
105 -.picker{ 129 +
  130 +.picker {
106 width: 610rpx; 131 width: 610rpx;
107 height: 50rpx; 132 height: 50rpx;
108 } 133 }
  134 +
109 .calendar image { 135 .calendar image {
110 width: 32rpx; 136 width: 32rpx;
111 height: 32rpx; 137 height: 32rpx;
@@ -255,7 +281,7 @@ page{ @@ -255,7 +281,7 @@ page{
255 margin-top: 24rpx; 281 margin-top: 24rpx;
256 background-color: #ffffff; 282 background-color: #ffffff;
257 border-radius: 16rpx; 283 border-radius: 16rpx;
258 - padding-bottom: 120rpx; 284 + /* padding-bottom: 120rpx; */
259 } 285 }
260 286
261 .cart-list { 287 .cart-list {
@@ -306,6 +332,7 @@ page{ @@ -306,6 +332,7 @@ page{
306 height: 48rpx; 332 height: 48rpx;
307 line-height: 48rpx; 333 line-height: 48rpx;
308 margin-top: 40rpx; 334 margin-top: 40rpx;
  335 + color: #FF4444;
309 } 336 }
310 337
311 .cart-list .cart-count-box { 338 .cart-list .cart-count-box {
@@ -392,6 +419,7 @@ page{ @@ -392,6 +419,7 @@ page{
392 text-align: center; 419 text-align: center;
393 font-size: 28rpx; 420 font-size: 28rpx;
394 } 421 }
  422 +
395 .cart-no-data-btn { 423 .cart-no-data-btn {
396 color: #999; 424 color: #999;
397 text-align: center; 425 text-align: center;
@@ -467,6 +495,7 @@ page{ @@ -467,6 +495,7 @@ page{
467 color: #ff4444; 495 color: #ff4444;
468 font-size: 34rpx; 496 font-size: 34rpx;
469 font-weight: 600; 497 font-weight: 600;
  498 + margin-left: 6rpx;
470 } 499 }
471 500
472 .buyText { 501 .buyText {
@@ -15,9 +15,9 @@ @@ -15,9 +15,9 @@
15 描述 15 描述
16 </view> 16 </view>
17 </view> 17 </view>
18 - <view class="arrow"> 18 + <!-- <view class="arrow">
19 <image src="/images/05-01/arrow.png"></image> 19 <image src="/images/05-01/arrow.png"></image>
20 - </view> 20 + </view> -->
21 </view> 21 </view>
22 <view class="container"> 22 <view class="container">
23 <!-- 全部订单 --> 23 <!-- 全部订单 -->
@@ -16,7 +16,6 @@ function postRequest(url, postData, doSuccess) { @@ -16,7 +16,6 @@ function postRequest(url, postData, doSuccess) {
16 16
17 }) 17 })
18 wx.request({ 18 wx.request({
19 - //项目的真正接口,通过字符串拼接方式实现  
20 url: host + url, 19 url: host + url,
21 header: { 20 header: {
22 'Authorization': wx.getStorageSync('Authorization') || '' 21 'Authorization': wx.getStorageSync('Authorization') || ''
@@ -27,22 +26,12 @@ function postRequest(url, postData, doSuccess) { @@ -27,22 +26,12 @@ function postRequest(url, postData, doSuccess) {
27 setTimeout(()=>{ 26 setTimeout(()=>{
28 wx.hideLoading() 27 wx.hideLoading()
29 },800) 28 },800)
30 - if(res.data.msg.indexOf('过期')>-1||res.data.msg.indexOf('请登录')>-1||wx.getStorageSync('Authorization')==""){ 29 + if(res.data.msg.indexOf('过期')>-1||res.data.msg.indexOf('请登录')>-1){
31 loginFail++; 30 loginFail++;
32 - // wx.showToast({  
33 - // title: res.data.msg,  
34 - // icon:'none'  
35 - // })  
36 - // setTimeout(()=>{  
37 - // wx.navigateTo({  
38 - // url: '/pages/index/index',  
39 - // })  
40 - // },1000)  
41 - console.log(loginFail)  
42 if(loginFail<2){ 31 if(loginFail<2){
43 setTimeout(()=>{ 32 setTimeout(()=>{
44 wx.redirectTo({ 33 wx.redirectTo({
45 - url: '/pages/home/home', 34 + url: '/pages/index/index',
46 }) 35 })
47 },1200) 36 },1200)
48 } 37 }
@@ -91,7 +80,7 @@ function getRequest(url, doSuccess) { @@ -91,7 +80,7 @@ function getRequest(url, doSuccess) {
91 }) 80 })
92 setTimeout(()=>{ 81 setTimeout(()=>{
93 wx.redirectTo({ 82 wx.redirectTo({
94 - url: '/pages/home/home', 83 + url: '/pages/index/index',
95 }) 84 })
96 },1200) 85 },1200)
97 } 86 }
@@ -121,8 +110,8 @@ function deleteRequest(url, doSuccess) { @@ -121,8 +110,8 @@ function deleteRequest(url, doSuccess) {
121 icon:'none' 110 icon:'none'
122 }) 111 })
123 setTimeout(()=>{ 112 setTimeout(()=>{
124 - wx.switchTab({  
125 - url: '/pages/home/home', 113 + wx.redirectTo({
  114 + url: '/pages/index/index',
126 }) 115 })
127 },1200) 116 },1200)
128 } 117 }
@@ -33,15 +33,9 @@ function onReachListData(page, pagenum, data, doFunction) { @@ -33,15 +33,9 @@ function onReachListData(page, pagenum, data, doFunction) {
33 } 33 }
34 //获取登录信息 34 //获取登录信息
35 function getUser(msg) { 35 function getUser(msg) {
36 - if (res.data.msg.indexOf('请登录') > -1) {  
37 - wx.showToast({  
38 - title: '请登录',  
39 - icon: 'none'  
40 - })  
41 - }  
42 wx.navigateTo({ 36 wx.navigateTo({
43 url: '/pages/index/index', 37 url: '/pages/index/index',
44 - }) 38 +})
45 } 39 }
46 module.exports = { 40 module.exports = {
47 formatTime: formatTime, 41 formatTime: formatTime,