diff --git a/components/timepicker/timepicker.js b/components/timepicker/timepicker.js index a211251..beff0c1 100644 --- a/components/timepicker/timepicker.js +++ b/components/timepicker/timepicker.js @@ -1,18 +1,17 @@ // component/time-picker/index.js -let utils=require("../../utils/util.js") +let utils = require("../../utils/util.js") +let method = require("../../utils/reuqest.js") const app = getApp() Component({ /** * 组件的属性列表 */ - properties: { - - }, - + /** * 组件的初始数据 */ data: { + list:[], //时间数组 deliveryTime: "", selfData: [], //自提日期 showDelivery: false, @@ -23,46 +22,148 @@ Component({ nowDay: 0, selectTime: '', selectTimeIndex: '', - selectDay: 0 + selectDay: 0, + timeLists: '' }, pageLifetimes: { - show: function() { + show: function () { this.getDliveryTime() } }, + properties: { + timeLists: { + type: Array, + value: true + } + }, /** * 组件的方法列表 */ + lifetimes: { + created() { + let _this = this; + if(_this.data.nowDay==0){ + method.getRequest("/myUser/period/" + '1', data => { + //let list=this + if (data.statusCode == 0) { + _this.setData({ + list:data.data + }) + } + console.log(_this.data.nowDay,'now') + console.log(_this.data.deliveryTimeList, 'list') + }) + }else{ + method.getRequest("/myUser/period/" + '2', data => { + //let list=this + if (data.statusCode == 0) { + _this.setData({ + list:data.data + }) + } + console.log(_this.data.nowDay,'now') + console.log(_this.data.deliveryTimeList, 'list') + }) + } + + }, + attached() { + console.log("在组件实例进入页面节点树时执行") + }, + ready() { + + console.log("在组件在视图层布局完成后执行") + }, + moved() { + console.log("在组件实例被移动到节点树另一个位置时执行") + }, + detached() { + console.log("在组件实例被从页面节点树移除时执行") + }, + error() { + console.log("每当组件方法抛出错误时执行") + }, + /*组件所在页面的生命周期 */ + pageLifetimes: { + show: function () { + // 页面被展示 + console.log("页面被展示") + }, + hide: function () { + // 页面被隐藏 + console.log("页面被隐藏") + }, + resize: function (size) { + // 页面尺寸变化 + console.log("页面尺寸变化") + } + } + }, methods: { getnowDay(e) { this.setData({ nowDay: e.currentTarget.dataset.index }) + console.log(this.data.nowDay,'nowday') + let _this = this; + if(_this.data.nowDay==0){ + method.getRequest("/myUser/period/" + '1', data => { + //let list=this + if (data.statusCode == 0) { + _this.setData({ + list:data.data + }) + } + console.log(_this.data.nowDay,'now') + console.log(_this.data.deliveryTimeList, 'list') + }) + }else{ + method.getRequest("/myUser/period/" + '2', data => { + //let list=this + if (data.statusCode == 0) { + _this.setData({ + list:data.data + }) + } + console.log(_this.data.nowDay,'now') + console.log(_this.data.deliveryTimeList, 'list') + }) + } }, clickTime(e) { let selfData = this.data.selfData[this.data.nowDay] - let index = e.currentTarget.dataset.index - let selectTime = this.data.deliveryTimeList[this.data.nowDay].timeList[index] - let deliveryTime = selfData.year + '-' + selfData.month + '-' + selfData.day + ' ' + selectTime + let id= e.currentTarget.dataset.id; + let index= e.currentTarget.dataset.index; + let _this = this; + // let selectTime = this.data.deliveryTimeList[this.data.nowDay].timeList[index] + let deliveryTime = selfData.year + '-' + selfData.month + '-' + selfData.day + ' ' let nowDay = this.data.nowDay this.setData({ selectTimeIndex: index, - selectTime: selectTime, + // selectTime: selectTime, deliveryTime: deliveryTime, selectDay: nowDay }) - this.triggerEvent('selectTime', { - deliveryTime: this.data.deliveryTime + // this.triggerEvent('selectTime', { + // deliveryTime: this.data.deliveryTime + // }) + this.data.list.map((item,index)=>{ + if(item.id === id){ + let times = item.start + '-' + item.end + _this.triggerEvent('selectTime',{time : times,flag : false,timeId:item.id,deliveryTime:this.data. deliveryTime}) + //_this.triggerEvent('showTime',false) + wx.setStorageSync('selecClick',true) + } }) }, //计算配送时间 getDliveryTime() { + let that = this; let deliveryTimeList = []; let date = new Date(); - this.setData({ - selfData: utils.getDates(5) - // selfData: utils.getDates(5) - }) + this.setData({ + selfData: utils.getDates(5) + }) //获取时间段 let timeDate = new Date(date.getTime()); let todayList = getTimeList(timeDate.getHours(), 1); @@ -86,30 +187,40 @@ Component({ }) // today 1 是今天 0 不是今天 function getTimeList(hour, today) { + let timeList = []; - let startTime = hour <= 9 ? 9 : hour; - for (let i = 0; i < 8; i++) { - if (((hour <= 9) && (startTime + 2 * i >21)) || ((hour > 9) && (startTime + 2 * i >= 21))) { - break; - } else { - if (hour <= 9) { - timeList.push( - startTime + 2 * i + ":00" + "-" + (startTime + 2 * (i + 1)) + ":00" - ); - } else { - if (startTime % 2 === 0) { - timeList.push( - startTime + 2 * i + 1 + ":00" + "-" + (startTime + 2 * i + 3) + ":00" - ); - } else { - console.log(i,'i') - timeList.push( - startTime + 2 * i +2 + ":00" + "-" + (startTime + 2 * i + 4) + ":00" - ); - } - } + // let startTime = hour <= 9 ? 9 : hour; + // for (let i = 0; i < 8; i++) { + // if (((hour <= 9) && (startTime + 2 * i >21)) || ((hour > 9) && (startTime + 2 * i >= 21))) { + // break; + // } else { + // if (hour <= 9) { + // timeList.push( + // startTime + 2 * i + ":00" + "-" + (startTime + 2 * (i + 1)) + ":00" + // ); + // } else { + // if (startTime % 2 === 0) { + // timeList.push( + // startTime + 2 * i + 1 + ":00" + "-" + (startTime + 2 * i + 3) + ":00" + // ); + // } else { + // console.log(i,'i') + // timeList.push( + // startTime + 2 * i +2 + ":00" + "-" + (startTime + 2 * i + 4) + ":00" + // ); + // } + // } + // } + // } + method.getRequest("/myUser/period/" + '1', data => { + if (data.statusCode == 0) { + that.setData({ + deliveryTimeList: data.data + }) + timeList = data.data } - } + console.log(timeList, 'list') + }) return timeList; } } diff --git a/components/timepicker/timepicker.wxml b/components/timepicker/timepicker.wxml index 3fa28e1..4db304c 100644 --- a/components/timepicker/timepicker.wxml +++ b/components/timepicker/timepicker.wxml @@ -6,16 +6,29 @@ <view class="day" wx:for="{{selfData}}" wx:key="index" class='{{nowDay===index?"day active":"day"}}' bindtap="getnowDay" data-index='{{index}}'>{{item.month}}月{{item.day}}号【{{item.week}}】</view> </view> - <view class="select-time"> + <view class="select-time" wx:if='{{list.length!==0}}'> + <view wx:for="{{list}}" + class='{{ nowDay===selectDay&&index===selectTimeIndex?"select-time-item select":"select-time-item"}}' + data-id="{{item.id}}" bindtap="clickTime" data-index='{{index}}'> + {{item.start}}-{{item.end}} + </view> + </view> + <view wx:else class="time-title">对不起,今日暂无自提时间 + </view> + <!-- <view class="select-time"> <view wx:if="{{nowDay===0}}"> - <view wx:if='{{deliveryTimeList[nowDay].timeList.length>0}}'> - <view class='{{index===selectTimeIndex&&nowDay===selectDay?"select-time-item select":"select-time-item"}}' + <view wx:if='{{deliveryTimeList.length>0}}'> --> + <!-- <view wx:if='{{timeLists.length}}'> --> + <!-- <view class='{{index===selectTimeIndex&&nowDay===selectDay?"select-time-item select":"select-time-item"}}' + wx:for="timeLists" bindtap="clickTime" wx:key="index" data-index='{{index}}'> + {{item.start}} + </view> --> + <!-- <view class='{{index===selectTimeIndex&&nowDay===selectDay?"select-time-item select":"select-time-item"}}' wx:for="{{deliveryTimeList[nowDay].timeList}}" bindtap="clickTime" wx:key="index" data-index='{{index}}'> {{item}} - </view> - </view> - <view wx:else class="time-title">对不起,今日暂无自提时间 - </view> + </view> --> + <!-- </view> + </view> <view wx:if="{{nowDay!==0}}"> <view class='{{index===selectTimeIndex&&nowDay===selectDay?"select-time-item select":"select-time-item"}}' @@ -23,6 +36,6 @@ {{item}} </view> </view> - </view> + </view> --> <!-- </view> --> </view> \ No newline at end of file diff --git a/components/timepicker/timepicker.wxss b/components/timepicker/timepicker.wxss index 1133408..c8d21e4 100644 --- a/components/timepicker/timepicker.wxss +++ b/components/timepicker/timepicker.wxss @@ -17,6 +17,7 @@ float: left; width: 300rpx; height: 392rpx; + background: rgba(239, 239, 239, 1); } .day { @@ -26,10 +27,12 @@ justify-content: center; align-items: center; background: rgba(239, 239, 239, 1); + /* background-color: #fff; */ } .day.active { - background-color: #fff; + /* background: rgba(239, 239, 239, 1); */ + background: #fff; } .select-time { diff --git a/images/logo.png b/images/logo.png new file mode 100644 index 0000000..41a8aef Binary files /dev/null and b/images/logo.png differ diff --git a/pages/affirm-order/affirm-order.js b/pages/affirm-order/affirm-order.js index 6be9313..82efd94 100644 --- a/pages/affirm-order/affirm-order.js +++ b/pages/affirm-order/affirm-order.js @@ -38,14 +38,21 @@ Page({ resposeData: '', discountText: '', payment: '', - storePickupTime:'' + // storePickupTime:'' + deliveryTime: '', //配送时间年月 + timers: '', // 配送时间 + timerId: '' }, //选择时间 selectTime(e) { - if (e.detail.deliveryTime && e.detail.deliveryTime !== this.data.storePickupTime) { + console.log(e, 'e') + if (e.detail.time && e.detail.time !== this.data.timers) { this.setData({ - storePickupTime: e.detail.deliveryTime, - showTime: false + timers: e.detail.time, + // showTime: e.detail.flag, + deliveryTime:e.detail.deliveryTime, + showTime: false, + timerId: e.detail.timerId }) } }, @@ -216,7 +223,7 @@ Page({ let postData = { addressId: this.data.userData.id, couponId: this.data.couponId, - deliveryTime: this.data.storePickupTime, + deliveryTime: this.data.storePickupTime+this.data.timers, note: this.data.leavaWord, num: this.data.count, skuId: this.data.skuId @@ -287,7 +294,7 @@ Page({ title: '请选择收货地址', icon: "none" }) - } else if (this.data.storePickupTime == "") { + } else if (this.data.timers == "") { wx.showToast({ title: '请选择配送时间', icon: "none" @@ -322,7 +329,7 @@ Page({ }, onLoad: function (options) { - console.log(this.data.type==''?'true':'fasle','types') + console.log(this.data.type == '' ? 'true' : 'fasle', 'types') this.setData({ addressId: options.id }) diff --git a/pages/affirm-order/affirm-order.wxml b/pages/affirm-order/affirm-order.wxml index f9d9c46..9aef7d2 100644 --- a/pages/affirm-order/affirm-order.wxml +++ b/pages/affirm-order/affirm-order.wxml @@ -26,7 +26,7 @@ <view class="calendar1 " wx:if="{{storePickupTime!==''}}"> 配送时间: </view> - <view class="selectText">{{storePickupTime}}</view> + <view class="selectText">{{timers.length ? timers : ''}}</view> </view> <view class="arrow" bindtap='chooseTime'> <image src="/images/04-01/arrow.png"></image> diff --git a/pages/all-order/all-order.wxml b/pages/all-order/all-order.wxml index bf39312..4f08a6d 100644 --- a/pages/all-order/all-order.wxml +++ b/pages/all-order/all-order.wxml @@ -32,7 +32,9 @@ <view class="name">{{item.listGoodsVoList[0].goodsName}}</view> <view class="describe">{{item.listGoodsVoList[0].goodsAttributes}}</view> <view class="price"> - <view wx:if="{{item.type==2}}"> ¥{{item.listGoodsVoList[0].goodsPrice}}</view> + <view wx:if="{{item.type==2}}"> + <text class="moneyIcon">¥</text> + <text class="moneyNum">{{item.listGoodsVoList[0].goodsPrice}}</text></view> <view wx:if="{{item.type==1}}"> 积分{{item.listGoodsVoList[0].goodsPrice}}</view> <view class="amount">x{{item.listGoodsVoList[0].goodsQuantity}}</view> </view> @@ -41,8 +43,12 @@ <!-- 合计 --> <view class="totalMoneyBox"> 合计: - <view class="totalMoney">¥{{item.payAmount}}</view> - <view>(含运费¥{{item.freightAmount}})</view> + <view class="totalMoney"> + <text class="moneyIcon2">¥</text> + <text class="moneyNum2">{{item.payAmount}}</text> + </view> + <view>(含运费<text class="moneyIcon2">¥</text> + <text class="moneyNum2">{{item.freightAmount}}</text>)</view> </view> <!-- 按钮 --> <view wx:if="{{item.status!==4}}"> @@ -71,8 +77,8 @@ </view> </view> <view class="bottomHint" wx:if="{{bottomHint}}"> - 我是有底线的~ -</view> + 我是有底线的~ + </view> <view class="noData" wx:if="{{tabList.length==0}}"> <view class="noDataPic"> <image src="/images/message@2x.png"></image> diff --git a/pages/all-order/all-order.wxss b/pages/all-order/all-order.wxss index 7e7edfe..a81ab5a 100644 --- a/pages/all-order/all-order.wxss +++ b/pages/all-order/all-order.wxss @@ -111,7 +111,26 @@ page{ justify-content: space-between; align-items: flex-end; } - +.moneyIcon{ + font-size: 36rpx; + color: #FF1717; + margin-right: -10rpx; +} +.moneyNum{ + font-size: 36rpx; + font-weight: 500; + color: #FF1717; +} +.moneyIcon2{ + font-size:28rpx; + color: #332333; + margin-right: -4rpx; +} +.moneyNum2{ + font-size: 28rpx; + font-weight: 500; + color: #323233; +} .amount { font-size: 28rpx; font-weight: 400; diff --git a/pages/cart-affirm-order/cart-affirm-order.js b/pages/cart-affirm-order/cart-affirm-order.js index 779cb29..92cb4d9 100644 --- a/pages/cart-affirm-order/cart-affirm-order.js +++ b/pages/cart-affirm-order/cart-affirm-order.js @@ -9,8 +9,11 @@ Page({ cartList: [], //商品列表 goodsData: '', goodsList: '', - showTime: false , //配送时间 - storePickupTime: '', + showTime: false, //配送时间弹框 + // storePickupTime: '', + deliveryTime: '', //配送时间年月 + timers: '', // 配送时间 + timerId: '', show: false, currentDate: '12:00', currentDateTwo: '13:00', @@ -31,7 +34,7 @@ Page({ cartsId: [], //列表商品id couponId: '', //优惠券id payment: '', - amount:'' //优惠券金额 + amount: '' //优惠券金额 }, //商品 getList() { @@ -74,44 +77,47 @@ Page({ }) }, //选择时间 - //配送时间 - selectTime(e) { - if (e.detail.deliveryTime && e.detail.deliveryTime !== this.data.storePickupTime) { + //配送时间 + selectTime(e) { + if (e.detail.time && e.detail.time !== this.data.timers) { + this.setData({ + timers: e.detail.time, + // showTime: e.detail.flag, + deliveryTime:e.detail.deliveryTime, + showTime: false, + timerId: e.detail.timerId + }) + } + }, + onClose() { this.setData({ - storePickupTime: e.detail.deliveryTime, showTime: false + }); + }, + onReady() { + this.timepicker = this.selectComponent('#aaa') + }, + chooseTime() { + this.setData({ + showTime: true }) - } -}, -onClose() { - this.setData({ - showTime: false - }); -}, -onReady() { - this.timepicker = this.selectComponent('#aaa') -}, -chooseTime() { - this.setData({ - showTime: true - }) - // this.timepicker.getDliveryTime(); -}, -onClickButton() { - this.setData({ - showModal: true - }) -}, -getDayTime() { - var myDate = new Date(); - var year = myDate.getFullYear(); - var month = myDate.getMonth(); - var day = myDate.getDate(); - var dayNow = year + '-' + (month + 1) + "-" + day; - this.setData({ - startTime: dayNow - }) -}, + // this.timepicker.getDliveryTime(); + }, + onClickButton() { + this.setData({ + showModal: true + }) + }, + getDayTime() { + var myDate = new Date(); + var year = myDate.getFullYear(); + var month = myDate.getMonth(); + var day = myDate.getDate(); + var dayNow = year + '-' + (month + 1) + "-" + day; + this.setData({ + startTime: dayNow + }) + }, //点击减少 dec() { let that = this @@ -186,33 +192,46 @@ getDayTime() { buy() { //生成订单 this.getAddress(); - setTimeout(() => { - let postData = { - addressId: this.data.addressId, - carts: this.data.cartsId, - couponId: this.data.couponId, - deliveryTime: this.data.storePickupTime, - note: this.data.leavaWord, - } - method.postRequest("/order/buyNow", postData, data => { - if (data.statusCode == 0) { - this.setData({ - cartIds: data.data.id - }) - // this.buys() - this.payment(); - } else { - wx.showToast({ - title: data.msg, - icon: 'none' - }) - // setTimeout(() => { - // util.getUser() - // }, 2000) - } + if(this.data.userData == undefined){ + wx.showToast({ + title: '请选择收货地址', + icon: "none" }) - }, 500) - + }else if(this.data.timers == ""){ + wx.showToast({ + title: '请选择配送时间', + icon: "none" + }) + }else{ + setTimeout(() => { + let postData = { + addressId: this.data.addressId, + carts: this.data.cartsId, + couponId: this.data.couponId, + deliveryTime: this.data.deliveryTime+this.data.timers, + note: this.data.leavaWord, + } + method.postRequest("/order/buyNow", postData, data => { + if (data.statusCode == 0) { + this.setData({ + cartIds: data.data.id + }) + // this.buys() + this.payment(); + } else { + wx.showToast({ + title: data.msg, + icon: 'none' + }) + // setTimeout(() => { + // util.getUser() + // }, 2000) + } + }) + }, 500) + + } + }, //购物车-立即购买 buys() { @@ -299,7 +318,7 @@ getDayTime() { couponId: cardId, // date: date, type: type, - amount:amount + amount: amount }) that.getTotalPrice(); that.getAddress(); diff --git a/pages/cart-affirm-order/cart-affirm-order.wxml b/pages/cart-affirm-order/cart-affirm-order.wxml index cca4c2a..2e55051 100644 --- a/pages/cart-affirm-order/cart-affirm-order.wxml +++ b/pages/cart-affirm-order/cart-affirm-order.wxml @@ -22,7 +22,7 @@ <!-- <image src="/images/04-01/rili.png"></image> --> 请选择配送时间: </view> - {{storePickupTime}} + {{timers.length ? timers : ''}} </view> <view class="arrow"> <image src="/images/04-01/arrow.png"></image> diff --git a/pages/classify/classify.wxss b/pages/classify/classify.wxss index a2aa5b7..89fd84b 100644 --- a/pages/classify/classify.wxss +++ b/pages/classify/classify.wxss @@ -296,7 +296,6 @@ page { font-weight: 400; text-align: left; color: #ff4444; - line-height: 48rpx; letter-spacing: 1rpx; display: flex; align-items: center; @@ -306,7 +305,7 @@ page { font-size: 25rpx; margin-right: -6rpx; display: flex; - padding-top: 8rpx; + padding-top: 4rpx; } .num .addIcon { @@ -361,7 +360,7 @@ page { left: 0; border-radius: 10rpx 10rpx 0 0; background: #fff; - padding: 30rpx 32rpx; + padding: 56rpx 32rpx; box-sizing: border-box; max-height: 94%; overflow-y: auto; diff --git a/pages/discount-card/discount-card.wxss b/pages/discount-card/discount-card.wxss index 7fd7db2..c6ba84e 100644 --- a/pages/discount-card/discount-card.wxss +++ b/pages/discount-card/discount-card.wxss @@ -17,13 +17,14 @@ height: 246rpx; } .picBox { - width: 686rpx; + width:95%; height: 246rpx; margin: 0 auto; margin-bottom: 24rpx; display: flex; background-color: #ffffff; position: relative; + border-radius: 16rpx; } .picBox .left { @@ -34,6 +35,7 @@ padding-top: 48rpx; padding-bottom: 48rpx; box-sizing: border-box; + border-radius: 16rpx; } .left>view { @@ -73,7 +75,7 @@ margin-top: 24rpx; .topCircle{ position: absolute; top: -4px; - left: 96px; + left: 28%; width: 20rpx; height: 20rpx; background-color: #f1f2f4; @@ -82,7 +84,7 @@ margin-top: 24rpx; .bottomCircle{ position: absolute; bottom: -4px; - left: 96px; + left: 28%; width: 20rpx; height: 20rpx; background-color: #f1f2f4; diff --git a/pages/home/home.wxml b/pages/home/home.wxml index 39a01da..5b9d76d 100644 --- a/pages/home/home.wxml +++ b/pages/home/home.wxml @@ -58,7 +58,10 @@ <image src="{{item.goodsImg}}"></image> </view> <view class="countText">{{item.goodsName}}</view> - <view class="countPrice">¥{{item.goodsPrice}}</view> + <view class="countPrice"> + <text class="moneyIcon">¥</text> + <text class="moneyNum">{{item.goodsPrice}}</text> + </view> <view class="countNum"> <view class="num">还剩{{item.goodsStock}}件</view> <view class="icon" bindtap="addCart" data-id="{{item.defaultSku}}" data-type="{{item.type}}"> @@ -102,8 +105,8 @@ <view class="mainlyTitle">{{nameData.label}}</view> </view> <view style="position: relative;"> - <view bindtap="moreMainly" class="moreMainly">查看更多</view> - <view class="arrow" bindtap="moreMainly"></view> + <view bindtap="moreMainly" class="moreMainly">查看更多</view> + <view class="arrow" bindtap="moreMainly"></view> </view> </view> <view class="dayPricePicMain"> @@ -129,7 +132,9 @@ <view class="userInfo"> <view class="collectIcon"> <!-- <image src="{{item.collectIcon}}"></image> --> - <view style="display:inline-block">¥{{item.goodsPrice}}</view> + <view style="display:inline-block"> + <text class="moneyIcon">¥</text> + <text class="moneyNum">{{item.goodsPrice}}</text></view> </view> </view> </view> diff --git a/pages/home/home.wxss b/pages/home/home.wxss index 965863a..e2dd9bb 100644 --- a/pages/home/home.wxss +++ b/pages/home/home.wxss @@ -166,6 +166,16 @@ page { } /* 限时优惠 */ +.moneyIcon{ + font-size: 23rpx; + color: #FF1717; + margin-right: -4rpx; +} +.moneyNum{ + font-size: 28rpx; + font-weight: 500; + color: #FF1717; +} .dayDiscount { width: 686rpx; height: 414rpx; diff --git a/pages/index/index.json b/pages/index/index.json index 0b81116..036d7b6 100644 --- a/pages/index/index.json +++ b/pages/index/index.json @@ -1,5 +1,6 @@ { "usingComponents": { "van-button": "@vant/weapp/button/index" - } + }, + "navigationBarTitleText": "登录" } \ No newline at end of file diff --git a/pages/index/index.wxml b/pages/index/index.wxml index b8693e6..958b69e 100644 --- a/pages/index/index.wxml +++ b/pages/index/index.wxml @@ -2,7 +2,7 @@ <view class="container"> <view class="top"> <view class="storeLogo"> - <image src=""></image> + <image src="/images/logo.png"></image> </view> <view class="storeName"> 掌上商城 diff --git a/pages/index/index.wxss b/pages/index/index.wxss index d7d5c4f..5819b39 100644 --- a/pages/index/index.wxss +++ b/pages/index/index.wxss @@ -2,14 +2,19 @@ page{ width: 100%; overflow-x: hidden; + background-color: #fff !important; } .storeLogo { width: 200rpx; height: 200rpx; border-radius: 34px; - background: #719df0; margin: 0 auto; } +.storeLogo image{ + width: 200rpx; + height: 200rpx; + border-radius: 34px; +} .storeName { margin: 0 auto; diff --git a/pages/integral-order/integral-order.js b/pages/integral-order/integral-order.js index 25ca672..19c76c6 100644 --- a/pages/integral-order/integral-order.js +++ b/pages/integral-order/integral-order.js @@ -3,11 +3,14 @@ let method = require("../../utils/reuqest.js"); const util = require("../../utils/util.js"); Page({ data: { - showTime: false , //配送时间 + showTime: false, //配送时间 storePickupTime: '', userData: "", - data: '', //配送时间 - startTime: '', + deliveryTime: '', //配送时间年月 + timers: '', // 配送时间 + timerId: '', + // data: '', //配送时间 + // startTime: '', // endTime: '', cartList: [], goodsData: '', @@ -17,7 +20,7 @@ Page({ minHour: 1, maxHour: 23, length: 0, - maxlength:50, + maxlength: 50, leavaWord: '', discountText: '满3减1满3减1', allMoney: '4.00', @@ -31,10 +34,13 @@ Page({ }, //选择时间 selectTime(e) { - if (e.detail.deliveryTime && e.detail.deliveryTime !== this.data.storePickupTime) { + if (e.detail.time && e.detail.time !== this.data.timers) { this.setData({ - storePickupTime: e.detail.deliveryTime, - showTime: false + timers: e.detail.time, + // showTime: e.detail.flag, + deliveryTime: e.detail.deliveryTime, + showTime: false, + timerId: e.detail.timerId }) } }, @@ -72,7 +78,7 @@ Page({ let index = wx.getStorageSync('addIndex') method.getRequest("/address", data => { if (data.statusCode == 0) { - let list=data.data.reverse(); + let list = data.data.reverse(); this.setData({ userData: list[index], }) @@ -116,7 +122,7 @@ Page({ this.setData({ goodsData: data.data }) - console.log(this.data.goodsData,'goods') + console.log(this.data.goodsData, 'goods') } }) }, @@ -174,34 +180,41 @@ Page({ }, //商品-生成订单 creatOrder() { - if(this.data.userData==undefined){ - wx.showToast({ - title: '请选择收货地址', - icon:'none' - }) - } - let postData = { - addressId: this.data.userData.id, - couponId: "", - deliveryTime: this.data.storePickupTime, - note: this.data.leavaWord, - num: 1, - skuId: this.data.skuId - } - method.postRequest("/order/generateOrder", postData, data => { - if (data.statusCode == 0) { - this.setData({ - orderId: data.data.id - }) - this.exchange() - } else { - wx.showToast({ - title: data.msg, - icon: 'none' - }) - return false + if (this.data.userData == undefined) { + wx.showToast({ + title: '请选择收货地址', + icon: 'none' + }) + } else if (this.data.timers == "") { + wx.showToast({ + title: '请选择配送时间', + icon: "none" + }) + } else { + let postData = { + addressId: this.data.userData.id, + couponId: "", + deliveryTime: this.data.deliveryTime + this.data.timers, + note: this.data.leavaWord, + num: 1, + skuId: this.data.skuId } - }) + method.postRequest("/order/generateOrder", postData, data => { + if (data.statusCode == 0) { + this.setData({ + orderId: data.data.id + }) + this.exchange() + } else { + wx.showToast({ + title: data.msg, + icon: 'none' + }) + return false + } + }) + } + }, //立即兑换 exchange() { @@ -249,7 +262,7 @@ Page({ skuId: defaultSku }) this.getAddress() - + }, /** @@ -265,7 +278,7 @@ Page({ onShow: function () { // this.getList(); this.getAddress(); - this.getDayTime(); //配送时间 获取当天时间 + this.getDayTime(); //配送时间 获取当天时间 }, /** diff --git a/pages/integral-order/integral-order.wxml b/pages/integral-order/integral-order.wxml index 133a19e..05db697 100644 --- a/pages/integral-order/integral-order.wxml +++ b/pages/integral-order/integral-order.wxml @@ -26,7 +26,7 @@ <view class="calendar1 " wx:if="{{storePickupTime!==''}}"> 配送时间: </view> - <view class="selectText">{{storePickupTime}}</view> + <view class="selectText">{{timers.length ? timers : ''}}</view> </view> <view class="arrow" bindtap='chooseTime'> <image src="/images/04-01/arrow.png"></image> diff --git a/pages/look-more/look-more.wxml b/pages/look-more/look-more.wxml index 89bf5e8..34b7d25 100644 --- a/pages/look-more/look-more.wxml +++ b/pages/look-more/look-more.wxml @@ -21,7 +21,9 @@ <view class="pickDesc">{{item.goodsAttributes}}</view> <view class="collectIcon"> <view style="height:10rpx;display:none"></view> - <view style="display:inline-block;font-size: 28rpx; padding: 10rpx 0;">¥{{item.goodsPrice}}</view> + <view style="display:inline-block;font-size: 28rpx; padding: 10rpx 0;"> + <text class="moneyIcon">¥</text> + <text class="moneyNum">{{item.goodsPrice}}</text></view> </view> </view> </view> diff --git a/pages/look-more/look-more.wxss b/pages/look-more/look-more.wxss index 3722acf..6235901 100644 --- a/pages/look-more/look-more.wxss +++ b/pages/look-more/look-more.wxss @@ -105,6 +105,16 @@ page{ box-sizing: border-box; } /* 每日精选*/ +.moneyIcon{ + font-size: 23rpx; + color: #FF1717; + margin-right: -4rpx; +} +.moneyNum{ + font-size: 28rpx; + font-weight: 500; + color: #FF1717; +} .pickContainer { display: flex; justify-content: space-between; diff --git a/pages/my-collect/my-collect.wxss b/pages/my-collect/my-collect.wxss index f9f61ed..b7bee39 100644 --- a/pages/my-collect/my-collect.wxss +++ b/pages/my-collect/my-collect.wxss @@ -26,6 +26,7 @@ page{ background: #fff; overflow: hidden; margin-bottom: 24rpx; + border-radius: 16rpx; } movable-area { @@ -107,6 +108,7 @@ movable-view { .left image { width: 180rpx; height: 180rpx; + border-radius: 16rpx; } .right { diff --git a/pages/my-discount-card/my-discount-card.js b/pages/my-discount-card/my-discount-card.js index 5179c4f..bc7d2dd 100644 --- a/pages/my-discount-card/my-discount-card.js +++ b/pages/my-discount-card/my-discount-card.js @@ -81,6 +81,10 @@ Page({ */ onShow: function () { let cardLists = wx.getStorageSync('couponVos') + cardLists.map((item,index)=>{ + item.startTime = item.startTime.slice(0,10).replace(/-/g,'.'); + item.endTime = item.endTime.slice(0,10).replace(/-/g,'.'); + }) this.setData({ cardList: cardLists }) diff --git a/pages/my-discount-card/my-discount-card.wxml b/pages/my-discount-card/my-discount-card.wxml index ed38629..29d888c 100644 --- a/pages/my-discount-card/my-discount-card.wxml +++ b/pages/my-discount-card/my-discount-card.wxml @@ -9,7 +9,7 @@ </view> <view class="right"> <view>{{item.name}}</view> - <view class="time">{{startTime}}-{{endTime}}</view> + <view class="time">{{item.startTime}}-{{item.endTime}}</view> <view class="time">{{item.time}}</view> </view> <view class="topCircle"></view> diff --git a/pages/my-discount-card/my-discount-card.wxss b/pages/my-discount-card/my-discount-card.wxss index 196db8f..5e33cd7 100644 --- a/pages/my-discount-card/my-discount-card.wxss +++ b/pages/my-discount-card/my-discount-card.wxss @@ -20,7 +20,7 @@ .picBox .left { width: 200rpx; height: 244rpx; - background: linear-gradient(270deg, #fb7900 -100%, #ff4903); + background: linear-gradient(270deg, #f09c4d -70%, #ff4903); padding-top: 48rpx; padding-bottom: 48rpx; box-sizing: border-box; @@ -63,11 +63,11 @@ margin-top: 24rpx; .topCircle{ position: absolute; top: -4px; - left: 96px; + left: 98px; width: 20rpx; height: 20rpx; background-color: #f1f2f4; - border-radius: 50%; + border-radius: 43%; } .bottomCircle{ position: absolute; diff --git a/pages/my-member/my-member.wxml b/pages/my-member/my-member.wxml index 496332c..73ef077 100644 --- a/pages/my-member/my-member.wxml +++ b/pages/my-member/my-member.wxml @@ -2,7 +2,8 @@ <view class="topLine"> </view> <!-- 领取会员卡 --> -<view class="getCard" wx:if="{{noVip}}" > +<!-- <view class="getCard" wx:if="{{noVip}}" > --> +<view class="getCard" wx:if="{{true}}" > <view class="title"> {{postData.title}} </view> @@ -36,7 +37,8 @@ </view> </view> <!-- 会员卡详情 --> -<view class="cardDetail" wx:if="{{vip}}"> +<view class="cardDetail" wx:if="{{false}}"> +<!-- <view class="cardDetail" wx:if="{{vip}}"> --> <image src="/images/card.png" ></image> <!-- content --> <view class="cardBox1"> diff --git a/pages/my-member/my-member.wxss b/pages/my-member/my-member.wxss index 171bb15..2518d10 100644 --- a/pages/my-member/my-member.wxss +++ b/pages/my-member/my-member.wxss @@ -30,7 +30,7 @@ .line { width: 144rpx; height: 2rpx; - background: #f2f2f2; + background: #c4c6ca; } /* card */ @@ -47,7 +47,7 @@ background-color: antiquewhite; z-index: 99; position: absolute; - top: 137px; + top: 116px; border-radius: 16rpx; left: 70rpx; background: transparent; @@ -155,12 +155,12 @@ } .cardBox { - position: absolute; + /* position: absolute; top: 230rpx; left: 70rpx; width: 612px; height: 310rpx; - background-color: #ffffff; + background-color: #ffffff; */ } .cardBox { position: absolute; @@ -168,7 +168,8 @@ left: 70rpx; width: 612rpx; /* height:816rpx; */ - background-color: #ffffff; + /* background-color: #ffffff; */ + border-radius: 16rpx; } .cardBox1 { position: absolute; @@ -205,10 +206,6 @@ } .text { - font-size: 36rpx; - font-weight: 500; - text-align: center; - color: #323233; margin-top: 20rpx; } diff --git a/pages/order-detail/order-detail.js b/pages/order-detail/order-detail.js index aa55398..f7ad2be 100644 --- a/pages/order-detail/order-detail.js +++ b/pages/order-detail/order-detail.js @@ -36,6 +36,13 @@ Page({ } }) }, + //商品详情 + goGoodsDetail(e){ + let goodsid=e.currentTarget.dataset.id; + wx.navigateTo({ + url: '/pages/product-detail/product-detail?id='+goodsid, + }) + }, //再次购买 buyAgain(){ console.log(this.data.goodsId,'goods') diff --git a/pages/order-detail/order-detail.wxml b/pages/order-detail/order-detail.wxml index f9719ac..2ae00b6 100644 --- a/pages/order-detail/order-detail.wxml +++ b/pages/order-detail/order-detail.wxml @@ -24,7 +24,7 @@ </view> --> <!-- 商品列表 --> <view class="cartList"> - <view class="cartListItem" wx:for="{{requestData.listGoodsVoList}}"> + <view class="cartListItem" wx:for="{{requestData.listGoodsVoList}}" bindtap="goGoodsDetail" data-id="{{item.goodsId}}"> <view class="itemRight"> <view class="productPic"> <image src="{{item.goodsPic}}"></image> @@ -33,66 +33,69 @@ <view class="productName">{{item.goodsName}}</view> <view class="productDetail">{{item.goodsAttributes}}</view> <view class="productPrice"> - <view class="price">¥{{item.goodsPrice}}</view> - <view class="num"> - x{{item.goodsQuantity}} - </view> + <view class="price"> + <text class="moneyIcon">¥</text> + <text class="moneyNum">{{item.goodsPrice}}</text> + </view> + <view class="num"> + x{{item.goodsQuantity}} </view> </view> </view> </view> </view> - <!-- 买家留言 --> - <view wx:if="{{requestData.note!==''}}"> - <view class="messageBox"> - <view class="messageTitle">买家留言:</view> - <!-- <textarea name="" id="" cols="30" rows="10" value="{{content}}" placeholder="留言建议提前协商50字之内" maxlength="50" +</view> +<!-- 买家留言 --> +<view wx:if="{{requestData.note!==''}}"> + <view class="messageBox"> + <view class="messageTitle">买家留言:</view> + <!-- <textarea name="" id="" cols="30" rows="10" value="{{content}}" placeholder="留言建议提前协商50字之内" maxlength="50" bindinput="userInput"></textarea> --> - <view>{{requestData.note}}</view> - <view class="numLength">{{requestData.note.length}}/50</view> - </view> + <view>{{requestData.note}}</view> + <view class="numLength">{{requestData.note.length}}/50</view> </view> - <!-- 优惠券 --> - <view class="discountCard"> - <view>优惠券抵扣金额</view> - <view class="discountBox"> - <view class="discountText">{{requestData.couponAmount}}</view> - <!-- <view class="arrowRight"> +</view> +<!-- 优惠券 --> +<view class="discountCard"> + <view>优惠券抵扣金额</view> + <view class="discountBox"> + <view class="discountText">{{requestData.couponAmount}}</view> + <!-- <view class="arrowRight"> <image src="/images/04-01/arrow.png"></image> </view> --> - </view> </view> - <!-- 商品总额 --> - <view class="allMoney"> - <view class="prodeuctMoney moneyPublic"> - <view class="txt">商品总额</view> - <view class="money txt">¥{{requestData.payAmount}}</view> - </view> - <view class="carriage moneyPublic"> - <view class="txt">配送费</view> - <view class="money txt">¥{{requestData.freightAmount}}</view> - </view> +</view> +<!-- 商品总额 --> +<view class="allMoney"> + <view class="prodeuctMoney moneyPublic"> + <view class="txt">商品总额</view> + <view class="money txt">¥{{requestData.payAmount}}</view> </view> - <!-- 订单详情 --> - <view class="orderBox"> - <view class="number orderPublic innerPublic"> - <view class="title">订单编号 :</view> - <view class="content">{{requestData.id}}</view> - </view> - <view class="time orderPublic innerPublic"> - <view class="title ">配送时间 :</view> - <view class="content">{{requestData.createTime}}</view> - </view> - <view class="mainMoney innerPublic"> - <view class="title ">商品总额 :</view> - <view class="content"> - <view class="icon">¥</view> - <view>{{requestData.payAmount}}</view> - </view> - </view> + <view class="carriage moneyPublic"> + <view class="txt">配送费</view> + <view class="money txt">¥{{requestData.freightAmount}}</view> </view> - <!-- 再次购买 --> - <view class="bottomBox"> - <view bindtap="buyAgain">再次购买</view> +</view> +<!-- 订单详情 --> +<view class="orderBox"> + <view class="number orderPublic innerPublic"> + <view class="title">订单编号 :</view> + <view class="content">{{requestData.id}}</view> + </view> + <view class="time orderPublic innerPublic"> + <view class="title ">配送时间 :</view> + <view class="content">{{requestData.createTime}}</view> + </view> + <view class="mainMoney innerPublic"> + <view class="title ">商品总额 :</view> + <view class="content"> + <view class="icon">¥</view> + <view>{{requestData.payAmount}}</view> + </view> </view> +</view> +<!-- 再次购买 --> +<view class="bottomBox"> + <view bindtap="buyAgain">再次购买</view> +</view> </view> \ No newline at end of file diff --git a/pages/order-detail/order-detail.wxss b/pages/order-detail/order-detail.wxss index 3327a74..3ec452d 100644 --- a/pages/order-detail/order-detail.wxss +++ b/pages/order-detail/order-detail.wxss @@ -164,6 +164,16 @@ page { margin: 0 auto; display: flex; } +.moneyIcon{ + font-size: 36rpx; + color: #FF1717; + margin-right: -4rpx; +} +.moneyNum{ + font-size: 36rpx; + font-weight: 500; + color: #FF1717; +} .itemRight { width: 686rpx; diff --git a/pages/product-detail/product-detail.js b/pages/product-detail/product-detail.js index 7dcce34..63b8fb1 100644 --- a/pages/product-detail/product-detail.js +++ b/pages/product-detail/product-detail.js @@ -31,6 +31,7 @@ Page({ showMaskTwo: false, showMaskSku: false, count: 1, + cartGoodNum: '', //购物车商品数量 payCount: 1, stockNum: '', richText: '', @@ -39,7 +40,8 @@ Page({ ceshi: [], //商品规格 idx: 0, //商品规格 jifenNum: '', //商品积分 - integral: '' + integral: '', + bottomHint:false //触底提示 }, //倒计时 onChange1(e) { @@ -144,7 +146,7 @@ Page({ } }) }, - //查看全部 + //查看全部评价 openAll() { // this.setData({ // flags: !this.data.flags, @@ -154,7 +156,7 @@ Page({ url: '/pages/all-evaluate/all-evaluate?goodsid=' + this.data.goodsId, }) }, - //进入购物车 + //购物车 goCart() { if (wx.getStorageSync('Authorization') == " ") { // setTimeout(() => { @@ -166,6 +168,18 @@ Page({ }) } }, + getCartNum() { + method.getRequest("/cart/countCart",data=>{ + if(data.statusCode==0){ + if(data.data!==0){ + this.setData({ + cartGoodNum:data.data + }) + } + + } + }) + }, // 收藏 collection() { if (this.data.Authorization) { @@ -296,6 +310,7 @@ Page({ icon: 'success', duration: 1000 }) + this.getCartNum() } else if (wx.getStorageSync('Authorization')) { wx.showToast({ @@ -540,6 +555,7 @@ Page({ */ onShow: function () { this.countDown() //获取优惠剩余时间 + this.getCartNum() //获取购物车商品总数量 setTimeout(() => { this.demoDown(); }, 200) @@ -580,7 +596,14 @@ Page({ * 页面上拉触底事件的处理函数 */ onReachBottom: function () { - + this.setData({ + bottomHint:true + }) + setTimeout(()=>{ + this.setData({ + bottomHint:false + }) + },2000) }, /** diff --git a/pages/product-detail/product-detail.wxml b/pages/product-detail/product-detail.wxml index 4b61412..0c2ee18 100644 --- a/pages/product-detail/product-detail.wxml +++ b/pages/product-detail/product-detail.wxml @@ -28,7 +28,11 @@ {{goodsData.goodsName}} </view> <view class="productPrice"> - <view class="price" wx:if="{{goodsData.type==2}}">¥{{goodsData.goodsPrice}}</view> + <view class="price" wx:if="{{goodsData.type==2}}"> + <text class="moneyIcon">¥</text> + <text class="moneyNum">{{goodsData.goodsPrice}}</text> + <text class="moneyIcon">.00</text> + </view> <view class="jifen" wx:if="{{goodsData.type==1}}">积分{{goodsData.goodsPrice}}</view> <view class="share" data-id="{{goodsId}}"> <view class="shareIcon"> @@ -89,6 +93,9 @@ <image src="{{item.img}}"></image> </view> --> </view> + <view class="bottomHint" wx:if="{{bottomHint}}"> + 我是有底线的~ + </view> </view> <!--底部 --> <!-- <view class="bottomMain"> @@ -107,7 +114,7 @@ <view>客服</view> </view> <view class="bottom_left_item" catchtap="goCart"> - <view class="count_cart">{{count}}</view> + <view class="count_cart">{{cartGoodNum}}</view> <image src="/images/01-03/cart.png"></image> <view>购物车</view> </view> diff --git a/pages/product-detail/product-detail.wxss b/pages/product-detail/product-detail.wxss index dca3fae..9dda17f 100644 --- a/pages/product-detail/product-detail.wxss +++ b/pages/product-detail/product-detail.wxss @@ -167,7 +167,26 @@ margin-right: 6rpx; margin-left: 6rpx; } */ - +.bottomHint{ + background-color: #f1f2f4; + font-size: 24rpx; + color: gray; + display: flex; + justify-content: center; + padding: 8rpx; +} +.moneyIcon{ + font-size: 24rpx; + color: #FF1717; + margin-right: -6rpx; + font-weight: 600; +} +.moneyNum{ + font-size: 36rpx; + font-weight: 500; + color: #FF1717; + font-weight: 600; +} /* 请选择 */ .selectMain { width: 750rpx; @@ -739,7 +758,7 @@ button { /* 购物车弹框 */ .mask { position: fixed; - top: 72rpx; + top:0; left: 0; width: 100%; height: 100%; @@ -750,7 +769,7 @@ button { .diceng { width: 100%; position: absolute; - bottom: 40rpx; + bottom: 0; left: 0; border-radius: 10rpx 10rpx 0 0; background: #fff; @@ -758,7 +777,6 @@ button { box-sizing: border-box; max-height: 94%; overflow-y: auto; - margin-bottom: 22rpx; } .info { diff --git a/pages/refund-after/refund-after.wxss b/pages/refund-after/refund-after.wxss index 563652b..88f26af 100644 --- a/pages/refund-after/refund-after.wxss +++ b/pages/refund-after/refund-after.wxss @@ -18,6 +18,7 @@ page{ width: 750rpx; background-color: #f1f2f4; padding-top:26rpx; + box-sizing: border-box; } .orderItem { @@ -174,8 +175,8 @@ page{ } .noData{ width: 100%; - height: 100%; - margin-top: 300rpx; + position: absolute; + top: 25%; } .noDataPic{ width: 200rpx; diff --git a/pages/search/search.wxml b/pages/search/search.wxml index 8adb093..819c9a5 100644 --- a/pages/search/search.wxml +++ b/pages/search/search.wxml @@ -48,7 +48,8 @@ <view class="collect">{{item.goodsAttributes}}</view> <view class="discount"> <view class="discountPic"> - ¥{{item.goodsPrice}} + <text class="moneyIcon">¥</text> + <text class="moneyNum">{{item.goodsPrice}}</text> </view> </view> </view> diff --git a/pages/search/search.wxss b/pages/search/search.wxss index 3715813..f9e6b0a 100644 --- a/pages/search/search.wxss +++ b/pages/search/search.wxss @@ -146,6 +146,16 @@ } /* 猜你喜欢 */ +.moneyIcon{ + font-size: 23rpx; + color: #FF1717; + margin-right: -4rpx; +} +.moneyNum{ + font-size: 28rpx; + font-weight: 500; + color: #FF1717; +} .middleLine { width: 750rpx; height: 16rpx; diff --git a/pages/searchRequest/searchRequest.wxml b/pages/searchRequest/searchRequest.wxml index 20da42e..882704c 100644 --- a/pages/searchRequest/searchRequest.wxml +++ b/pages/searchRequest/searchRequest.wxml @@ -21,7 +21,10 @@ <view class="pickDesc">{{item.goodsAttributes}}</view> <view class="collectIcon"> <view style="height:10rpx;display:none"></view> - <view style="display:inline-block; font-size: 28rpx;padding: 10rpx 0;">¥{{item.goodsPrice}}</view> + <view style="display:inline-block; font-size: 28rpx;padding: 10rpx 0;"> + <text class="moneyIcon">¥</text> + <text class="moneyNum">{{item.goodsPrice}}</text> + </view> </view> </view> </view> diff --git a/pages/searchRequest/searchRequest.wxss b/pages/searchRequest/searchRequest.wxss index b6ad79b..52440d4 100644 --- a/pages/searchRequest/searchRequest.wxss +++ b/pages/searchRequest/searchRequest.wxss @@ -4,92 +4,18 @@ page{ background-color: #f1f2f4; } -.search_center { - height: 90rpx; - width: 750rpx; - margin-bottom: 24rpx; - position: fixed; - top: 2rpx; - left: 0; - background-color: #f1f2f4; -} - -.real_search_center { - margin: 0 auto; - margin-bottom: 24rpx; - width: 686rpx; - height: 64rpx; - background: rgba(255, 255, 255, 1); - border-radius: 186rpx; - position: relative; -} - -.icon-sousuo { - font-size: 32rpx; - position: absolute; - top: 50%; - transform: translateY(-50%); - left: 20rpx; -} -.real_search_center input { - width: 676rpx; - height: 100%; - margin: 0 auto; - border-radius: 46rpx; - font-size: 28rpx; - font-family: PingFang SC; - font-weight: 400; - line-height: 64rpx; - color: rgba(189, 196, 206, 1); - padding: 0 60rpx; - box-sizing: border-box; - padding-left: 20rpx; - box-sizing: border-box; - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; - background: #ffffff; -} -.search_right { - width: 66rpx; - height: 64rpx; - border-radius: 20rpx; - text-align: center; - line-height: 64rpx; - color: #fff; - font-size: 28rpx; - font-family: PingFang SC; - font-weight: 400; - display: flex; - align-items: center; -} -.search_right image { - width: 36rpx; - height: 36rpx; +/* 商品列表 */ +.moneyIcon{ + font-size: 23rpx; + color: #FF1717; + margin-right: -4rpx; } -.placeholder { - font-size: 28rpx; - font-family: PingFang SC; - font-weight: 400; - line-height: 64rpx; - color: rgba(189, 196, 206, 1); -} -.search_right { - width: 104rpx; - height: 48rpx; - border-radius: 20rpx; - text-align: center; - color: rgb(223, 219, 219); +.moneyNum{ font-size: 28rpx; - font-weight: 400; - display: inline-block; - position: absolute; - top: 3rpx; - right: 8rpx; - cursor: progress; + font-weight: 500; + color: #FF1717; } -/* 商品列表 */ .productList{ width: 750rpx; height:750rpx; diff --git a/pages/select-address/select-address.wxss b/pages/select-address/select-address.wxss index c18a2c2..05762dd 100644 --- a/pages/select-address/select-address.wxss +++ b/pages/select-address/select-address.wxss @@ -6,7 +6,7 @@ page{ width: 750rpx; border-top: 1rpx solid #f2f2f2; - padding-bottom:120rpx; + padding-bottom:140rpx; } .addressBox { @@ -14,6 +14,7 @@ page{ justify-content: space-between; background-color: #ffffff; align-items: center; + margin-bottom: 20rpx; } .left { @@ -178,15 +179,15 @@ page{ /* 新增地址 */ .bottom { width: 750rpx; - height: 119rpx; position: fixed; bottom: 0; - left: 0 + left: 0; + background-color: #fff; + padding: 28rpx 0; } .addAdress { margin: 0 auto; - margin-top: 16rpx; width: 622rpx; height: 88rpx; background: linear-gradient(270deg, #fb7900 -100%, #ff4903); diff --git a/pages/shopping-cart/shopping-cart.js b/pages/shopping-cart/shopping-cart.js index a6d4893..8850c13 100644 --- a/pages/shopping-cart/shopping-cart.js +++ b/pages/shopping-cart/shopping-cart.js @@ -5,7 +5,8 @@ Page({ data: { Authorization: false, //判断用户是否登录 showTime: false, //配送时间 - storePickupTime: '', + // storePickupTime: '', + timers: '', checkType: 1, userData: "", addHint: false, //判断有没有地址 @@ -20,6 +21,7 @@ Page({ // 购物车 goodsId: '', //商品id + goodsNum: '', //商品数量 carts: [], // 购物车列表 pitchCart: [], //选中商品 pitchList: [], //选中商品id @@ -32,6 +34,7 @@ Page({ }, title: '产品推荐', bottomHint: false, //上拉提示 + flagClick: wx.getStorageSync('selecClick') }, //登录 login() { @@ -68,10 +71,6 @@ Page({ }, // 猜你喜欢 youLike() { - // let postData = { - // currPage: 1, - // pageSize: 10 - // } method.getRequest("/myUser/cartRecommend", data => { if (data.statusCode == 0) { this.setData({ @@ -133,10 +132,12 @@ Page({ }, //配送时间 selectTime(e) { - if (e.detail.deliveryTime && e.detail.deliveryTime !== this.data.storePickupTime) { + console.log(e) + if (e.detail.time && e.detail.time !== this.data.timers) { this.setData({ - storePickupTime: e.detail.deliveryTime, - showTime: false + timers: e.detail.time, + // showTime: e.detail.flag, + showTime: false, }) } }, @@ -200,10 +201,10 @@ Page({ if (res.confirm) { const index = e.currentTarget.dataset.index; const cartIds = e.currentTarget.dataset.cartid; - let carts = that.data.carts; - carts.splice(index, 1); + let cartss = that.data.carts; + cartss.splice(index, 1); that.setData({ - carts: carts + carts: cartss }); method.deleteRequest("/cart/" + cartIds, data => { if (data.statusCode == 0) { @@ -213,12 +214,12 @@ Page({ }) } }) - if (!carts.length) { - this.setData({ + if (!cartss.length) { + that.setData({ hasList: false }); } else { - this.getTotalPrice(); + that.getTotalPrice(); } } else if (res.cancel) { console.log('用户点击取消') @@ -227,20 +228,20 @@ Page({ }) }, // 全选 - selectAll(e) { - let selectAllStatus = this.data.selectAllStatus; - selectAllStatus = !selectAllStatus; - let carts = this.data.carts; + // selectAll(e) { + // let selectAllStatus = this.data.selectAllStatus; + // selectAllStatus = !selectAllStatus; + // let carts = this.data.carts; - for (let i = 0; i < carts.length; i++) { - carts[i].selected = selectAllStatus; - } - this.setData({ - selectAllStatus: selectAllStatus, - carts: carts - }); - this.getTotalPrice(); - }, + // for (let i = 0; i < carts.length; i++) { + // carts[i].selected = selectAllStatus; + // } + // this.setData({ + // selectAllStatus: selectAllStatus, + // carts: carts + // }); + // this.getTotalPrice(); + // }, // 数量增加 addCount(e) { @@ -264,9 +265,7 @@ Page({ carts: carts }); method.postRequest("/cart/" + goodSkuId, {}, data => { - if (data.statusCode == 0) { - - } + if (data.statusCode == 0) {} }) this.getTotalPrice(); this.getTotalNum(); @@ -402,7 +401,7 @@ Page({ pitchCart: [], pitchList: [] }) - + console.log(this.data.flagClick) setTimeout(() => { //判断购物车是否有商品 if (this.data.carts.length == 0) { this.setData({ @@ -455,6 +454,7 @@ Page({ * 页面上拉触底事件的处理函数 */ onReachBottom: function () { + console.log('触底') this.setData({ bottomHint: true }) diff --git a/pages/shopping-cart/shopping-cart.wxml b/pages/shopping-cart/shopping-cart.wxml index b0f7189..432de6e 100644 --- a/pages/shopping-cart/shopping-cart.wxml +++ b/pages/shopping-cart/shopping-cart.wxml @@ -18,7 +18,7 @@ </view> </view> <!-- 配送时间 --> - <view class="timeBox"> + <view class="timeBox" > <view style="display:flex"> <view class="calendar " bindtap='chooseTime'> <view style="display: flex;align-items: center;"> @@ -27,7 +27,7 @@ <view wx:if="{{storePickupTime==''}}"> 请选择配送时间</view> <view wx:if="{{storePickupTime!==''}}"> 配送时间</view> </view> - {{storePickupTime}} + {{timers.length ? timers : ''}} </view> <!-- <view class="arrow1" style="width:94%"> <image src="/images/04-01/arrow.png"></image> @@ -88,16 +88,16 @@ <view class="discount"> <view class="discountTitle"></view> <view class="discountPic"> - ¥{{item.goodsPrice}} + <text class="moneyIcon">¥</text> + <text class="moneyNum">{{item.goodsPrice}}</text> </view> </view> </view> </view> - - <view class="bottomHint" wx:if="{{bottomHint}}"> + </view> + <view class="bottomHint" wx:if="{{bottomHint}}"> 我是有底线的~ </view> - </view> <!-- 立即购买 --> <view class="bottom"> <!-- <view class="checkPic"> diff --git a/pages/shopping-cart/shopping-cart.wxss b/pages/shopping-cart/shopping-cart.wxss index fd40167..f8216f4 100644 --- a/pages/shopping-cart/shopping-cart.wxss +++ b/pages/shopping-cart/shopping-cart.wxss @@ -6,9 +6,9 @@ page { .container { background-color: #f1f2f4; width: 100%; - height: 100%; overflow-x: hidden; padding-top: 6rpx; + box-sizing: border-box; padding-bottom: 120rpx; } @@ -272,6 +272,16 @@ page { text-align: center; } /* 猜你喜欢 */ +.moneyIcon{ + font-size: 24rpx; + color: #FF1717; + margin-right: -2rpx; +} +.moneyNum{ + font-size: 28rpx; + font-weight: 500; + color: #FF1717; +} .middleLine { width: 750rpx; height: 16rpx; @@ -353,7 +363,7 @@ page { .collect { width: 100%; - font-size: 28rpx; + font-size: 24rpx; font-weight: 400; text-align: left; color: #7d7e80; @@ -373,9 +383,10 @@ page { } .discountPic { - height: 48rpx; + padding: 6rpx; font-size: 28rpx; color: #f8633e; + padding-bottom: 16rpx; } .discountPic image { @@ -415,6 +426,7 @@ page { left: 85rpx; width: 185rpx; height: 185rpx; + border-radius: 16rpx; } .cart-list .cart-pro-name { diff --git a/pages/timedmo/timedmo.js b/pages/timedmo/timedmo.js index 5533f0a..4d83c7b 100644 --- a/pages/timedmo/timedmo.js +++ b/pages/timedmo/timedmo.js @@ -1,4 +1,5 @@ const app = getApp() +let method = require("../../utils/reuqest.js") // var numeral = require('numeral'); Page({ @@ -6,24 +7,27 @@ Page({ * 页面的初始数据 */ data: { - showTime: false , - storePickupTime: '' + showTime: false, + storePickupTime: '', + timeLists: [], + timers : '' }, selectTime(e) { - if (e.detail.deliveryTime && e.detail.deliveryTime !== this.data.storePickupTime) { - this.setData({ - storePickupTime: e.detail.deliveryTime, - showTime: false - }) - } + console.log(e,'e') + if(e.detail&& e.detail !== this.data.timers){ + this.setData({ + timers: e.detail, + showTime: false, + }) + } }, onClose() { this.setData({ showTime: false }); }, - onReady(){ - this.timepicker=this.selectComponent('#aaa') + onReady() { + this.timepicker = this.selectComponent('#aaa') }, chooseTime() { this.setData({ diff --git a/pages/timedmo/timedmo.wxml b/pages/timedmo/timedmo.wxml index 1476810..095c3cc 100644 --- a/pages/timedmo/timedmo.wxml +++ b/pages/timedmo/timedmo.wxml @@ -1,5 +1,5 @@ <!--pages/timedmo/timedmo.wxml--> - <view bindtap='chooseTime'> 自提时间{{storePickupTime}}</view> + <view bindtap='chooseTime'>自提时间{{timers.length ? timers : ''}}</view> <van-popup show="{{ showTime }}" bind:close="onClose" position="bottom" style="display:{{showTime ? 'vilative' : 'none'}}"> - <timepicker deliveryTime='{{deliveryTime}}' bind:selectTime="selectTime" id="aaa"></timepicker> + <timepicker deliveryTime='{{deliveryTime}}' bind:selectTime="selectTime" id="aaa" bind:selectTimes="selectTime"></timepicker> </van-popup> \ No newline at end of file diff --git a/project.config.json b/project.config.json index 53836de..a4df23f 100644 --- a/project.config.json +++ b/project.config.json @@ -290,6 +290,13 @@ "id": -1, "name": "pages/demo1/demo1", "pathName": "pages/demo1/demo1", + "query": "", + "scene": null + }, + { + "id": -1, + "name": "pages/timedmo/timedmo", + "pathName": "pages/timedmo/timedmo", "scene": null } ]