作者 倪静楠

样式

... ... @@ -5,7 +5,7 @@
align-items: center;
box-sizing: border-box;
padding: 10px 12px;
padding: var(--search-padding, 10px 12px)
padding: var(--search-padding, 10px 16px)
}
.van-search,
... ... @@ -27,7 +27,7 @@
.van-search__content--round {
border-radius: 17px;
border-radius: calc(var(--search-input-height, 34px)/2)
border-radius: calc(var(--search-input-height, 52px)/2)
}
.van-search__label {
... ... @@ -43,7 +43,8 @@
.van-search__field {
-webkit-flex: 1;
flex: 1
flex: 1;
height: 68rpx;
}
.van-search__field__left-icon {
... ...
... ... @@ -92,7 +92,7 @@
.van-tabs__line {
position: absolute;
bottom: 0;
left: 0;
left:6rpx;
z-index: 1;
height: 3px;
height: var(--tabs-bottom-bar-height, 3px);
... ...
... ... @@ -4,27 +4,27 @@ const util = require("../../utils/util.js");
Page({
data: {
userData: "", //收货地址
id: '', //收货地址id
id: '', //收货地址id
goodsData: '', //商品信息
show: false,
maxlength: 50, //留言
length: 0,
leavaWord: '',
skuId: '',
orderId: '', //普通商品Id
orderId: '', //普通商品Id
orderjfId: '', //积分商品Id
couponId: '', //优惠券Id
couponId: '', //优惠券Id
cardData: '',
type: "", //优惠券类型
type: "", //优惠券类型
cardAmount: '', //减优惠券金额
amount: '', //满优惠券金额
amount: '', //满优惠券金额
// count: '',
stockNum: '', //商品库存
stockNum: '', //商品库存
discountText: '', //无门槛优惠券金额
payment: '',
deliveryTime: '', //配送时间年月
timers: '', //配送时间
resposeData: '', //支付
timers: '', //配送时间
resposeData: '', //支付
},
//选择配送时间
selectTime(e) {
... ... @@ -62,8 +62,9 @@ Page({
let index = wx.getStorageSync('addIndex')
method.getRequest("/address", data => {
if (data.statusCode == 0) {
let list=data.data.reverse()
this.setData({
userData: data.data[index],
userData:list[index],
})
} else {
wx.showToast({
... ... @@ -204,9 +205,6 @@ Page({
title: data.msg,
icon: 'none'
})
// setTimeout(() => {
// util.getUser()
// }, 2000)
}
})
wx.removeStorageSync('type') //清除优惠券
... ... @@ -233,9 +231,11 @@ Page({
wx.showToast({
title: '支付成功',
})
wx.switchTab({
url: '/pages/classify/classify',
})
setTimeout(() => {
wx.reLaunch({
url: '/pages/order-detail/order-detail?orderId=' + _this.data.orderId,
})
}, 1000)
},
'fail': function (res) {
console.log(_this.data.orderId)
... ... @@ -262,18 +262,24 @@ Page({
})
} else {
let postData = {
addressId: this.data.userData.id,
deliveryTime: this.data.deliveryTime + this.data.timers,
note: this.data.leavaWord,
num: this.data.count,
skuId: this.data.skuId
}
method.postRequest("/order/goodsBuyNow", postData, data => {
method.postRequest("/order/generateOrder", postData, data => {
if (data.statusCode == 0) {
this.setData({
orderId:data.data.id
})
wx.showToast({
title: '兑换成功',
duration: 5000
})
setTimeout(() => {
wx.switchTab({
url: '/pages/classify/classify',
wx.reLaunch({
url: '/pages/order-detail/order-detail?orderId=' + this.data.orderId,
})
}, 1000)
} else {
... ...
... ... @@ -2,7 +2,7 @@
<view class="container">
<!-- 地址 -->
<view class="address" catchtap="selectAdd">
<view wx:if="{{userData!==''}}" style="width:95%">
<view wx:if="{{userData!==''}}" style="width:95%;display: flex;flex-wrap: wrap; align-items: center;">
<view class="userName">{{userData.name}}</view>
<view class="userTell">{{userData.phone}}</view>
<view class="default" wx:if="{{userData.delFlag==1}}">默认</view>
... ...
... ... @@ -33,12 +33,15 @@ page {
.userName {
display: inline-block;
height: 40rpx;
width: auto;
font-size: 32rpx;
font-weight: 600;
text-align: left;
color: #323233;
line-height: 44rpx;
width: 200rpx;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
max-width: 260rpx;
}
.userTell {
... ...
... ... @@ -4,7 +4,11 @@ const util = require("../../utils/util.js");
Page({
data: {
postData: {}, //积分详情
tabList: [],
tabList: [{
title: '积分明细'
}, {
title: '兑换记录'
}],
list: [], //积分明细/兑换记录列表
integralList: [], //积分明细
exchangeList: [], //兑换记录
... ...
... ... @@ -13,7 +13,7 @@
<van-tab title="{{item.title}}" wx:for="{{tabList}}">{{}}</van-tab>
</van-tabs>
<!-- content -->
<view class="listBox">
<view class="listBox" style="background: #fff">
<view class="listItem" wx:for="{{list}}">
<view class="left">
<view>{{item.name}}</view>
... ...
... ... @@ -63,5 +63,5 @@ color: #ee231c;
color: gray;
display: flex;
justify-content: center;
padding-bottom: 10rpx;
padding: 20rpx;
}
\ No newline at end of file
... ...
... ... @@ -3,6 +3,7 @@ let method = require("../../utils/reuqest.js");
const util = require("../../utils/util.js");
Page({
data: {
orderId: '', //订单Id
userData: "", //地址
addressId: '',
cartList: [], //商品列表
... ... @@ -44,6 +45,7 @@ Page({
let payment = Number(this.data.goodsList.payment) - Number(this.data.discountText)
let goodsList = this.data.goodsList;
goodsList.payment = payment;
goodsList.payment=goodsList.payment.toFixed(2)
this.setData({
goodsList: goodsList
})
... ... @@ -54,8 +56,9 @@ Page({
let index = wx.getStorageSync('addIndex')
method.getRequest("/address", data => {
if (data.statusCode == 0) {
let list=data.data.reverse()
this.setData({
userData: data.data[index],
userData: list[index],
addressId: data.data[index].id
})
}
... ... @@ -216,16 +219,21 @@ Page({
buys() {
method.getRequest("/order/buyNow/" + this.data.cartIds, data => {
if (data.statusCode == 0) {
this.payment();
this.setData({
orderId: data.data.id
})
console.log(this.data.orderId,'id')
this.payment();
wx.setStorageSync('cardAmount', "")
} else {}
})
},
//支付
payment() {
let that = this;
let obj = {};
let resposeData = {};
method.postRequest("/payment/payment/" + this.data.cartIds, obj, data => {
method.postRequest("/payment/payment/" + that.data.cartIds, obj, data => {
if (data.statusCode == 0) {
resposeData = data.data;
wx.requestPayment({
... ... @@ -238,9 +246,11 @@ Page({
wx.showToast({
title: '支付成功',
})
wx.switchTab({
url: '/pages/shopping-cart/shopping-cart',
})
setTimeout(() => {
wx.reLaunch({
url: '/pages/order-detail/order-detail?orderId=' + that.data.cartIds,
})
}, 1000)
},
'fail': function (res) {
wx.switchTab({
... ... @@ -253,6 +263,16 @@ Page({
})
},
onLoad: function (options) {
wx.setStorageSync('type', "")
console.log(wx.getStorageSync('sendTime').substring(12, 23), 'sendtime')
let sendTime = wx.getStorageSync('sendTime')
if (sendTime !== '') {
console.log('jshjxhh5555')
this.setData({
deliveryTime: sendTime.substring(0, 12),
timers: sendTime.substring(12, 23)
})
}
this.getList();
if (this.data.cardId) {
this.setData({
... ...
... ... @@ -2,7 +2,7 @@
<view class="container">
<!-- 地址 -->
<view class="address" bindtap="emit">
<view wx:if="{{userData!==''}}" style="width:95%">
<view wx:if="{{userData!==''}}" style="width:95%;display: flex;flex-wrap: wrap; align-items: center;">
<view class="userName">{{userData.name}}</view>
<view class="userTell">{{userData.phone}}</view>
<view class="default" wx:if="{{userData.delFlag==1}}">默认</view>
... ... @@ -17,14 +17,16 @@
</view>
<!-- 配送时间 -->
<view class="timeBox">
<view style="width:95%;display:flex;font-size:28rpx">
<view class="calendar " bindtap='chooseTime' style="width:224rpx">
<view style="width:95%;display:flex;font-size:28rpx" bindtap='chooseTime'>
<view class="calendar " style="width:224rpx">
<!-- <image src="/images/04-01/rili.png"></image> -->
请选择配送时间:
</view>
<view style="display:inline-block">
{{timers.length ? timers : ''}}
</view>
<view class="arrow">
</view>
<view class="arrow" bindtap='chooseTime'>
<image src="/images/04-01/arrow.png" mode="aspectFill"></image>
</view>
<view class="section">
... ...
... ... @@ -30,12 +30,14 @@
.userName {
display: inline-block;
height: 40rpx;
width: auto;
font-size: 32rpx;
font-weight: 600;
text-align: left;
color: #323233;
line-height: 44rpx;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
max-width: 260rpx;
}
.userTell {
... ...
... ... @@ -11,7 +11,7 @@
<view class="search_center" catchtap="goSearch">
<view class="real_search_center">
<input class="weui-input" auto-focus="{{false}}" placeholder="请输入商品名称" bindinput="getKeyWord"
placeholder-class="placeholder" />
placeholder-class="placeholder" bindconfirm='search'/>
<view class="search_right" catchtap="search">
<image src="/images/01-02/sousuo.png" mode="aspectFill"></image>
</view>
... ...
... ... @@ -15,7 +15,8 @@
placeholder="搜索" bind:focus="goSearch" />
</view>
<!-- 轮播图 -->
<view style="margin-top:80rpx">
<view class="inner">
<view style="margin-top:24rpx">
<swiper class="swiper" indicator-dots="true" autoplay="true" interval="5000" duration="1000">
<block wx:for="{{swiperArray}}" wx:for-index="idx">
<swiper-item bindtap="goBannnerDetail" data-url="{{item.url}}" data-index="{{index}}">
... ... @@ -37,6 +38,7 @@
</scroll-view>
</view>
<!-- 限时优惠 -->
<view style="width:100%;padding-top:30rpx;background: #f1f2f4;">
<view class="dayDiscount" wx:if="{{limitCountShow}}" wx:if="{{countDownShow}}">
<view class="discountTitle">
<view class="limitCount">{{limitCount}}</view>
... ... @@ -72,8 +74,9 @@
</scroll-view>
<!-- </view> -->
</view>
</view>
<!-- 每日特价 -->
<view class="borderTop"></view>
<view style="width:100%;padding-top:30rpx;background: #f1f2f4;">
<view class="dayPriceContent">
<view class="dayPrice" wx:if="{{dayPicArray.length!==0}}">
<view class="dayPriceTitle">
... ... @@ -104,9 +107,11 @@
<view class="dayPriceText">{{nameData.name}}</view>
<view class="mainlyTitle">{{nameData.label}}</view>
</view>
<view style="position: relative;">
<view style="display: flex; align-items: center;">
<view bindtap="moreMainly" class="moreMainly">查看更多</view>
<view class="arrow" bindtap="moreMainly"></view>
<view class="arrow" bindtap="moreMainly">
<image src="/images/01-03/icon_more@2x.png"></image>
</view>
</view>
</view>
<view class="dayPricePicMain">
... ... @@ -118,6 +123,7 @@
</view>
</view>
</view>
</view>
<!-- 每日精选 -->
<van-tabs active="{{0}}" bind:change="onChange">
<van-tab title="{{item.categoryName}}" wx:for="{{pickArray}}">
... ... @@ -174,6 +180,7 @@
我是有底线的~
</view>
</view>
</view>
<!-- tabbar -->
<!-- <view class="tabbarBox" >
... ...
... ... @@ -46,10 +46,14 @@
.contenter {
/* margin-bottom: 100rpx; */
padding: 47rpx 32rpx 0 32rpx;
box-sizing: border-box;
position: relative;
top: 176rpx;
top: 134rpx;
padding-top: 48rpx;
}
.inner{
width: 92%;
padding-left: 4%;
}
page {
... ... @@ -61,10 +65,10 @@ page {
.searchBox {
width: 100%;
height: 88rpx;
background: linear-gradient(137deg, #5b8eff, #2e55ff 92%);
position: fixed;
/* background: linear-gradient(137deg, #5b8eff, #2e55ff 92%); */
/* position: fixed;
top: 174rpx;
left: 0;
left:0%; */
z-index: 66;
box-sizing: border-box;
}
... ... @@ -139,6 +143,19 @@ page {
box-sizing: border-box;
background-color: #f1f2f4;
padding: 36rpx 0 32rpx 0;
padding-bottom: 0;
}
.classify{
width: 100%;
/* margin-top: 18rpx; */
/* background-color: bisque; */
display: flex;
justify-content: space-between;
align-items: center;
box-sizing: border-box;
background-color: #f1f2f4;
padding: 36rpx 0 32rpx 0;
padding-bottom: 0;
}
.classifyItem {
... ... @@ -146,18 +163,16 @@ page {
display: inline-block;
}
.classify1 .classifyPic {
.classifyPic {
width: 104rpx;
height: 89rpx;
}
.classify1 .classifyPic image {
.classifyPic image {
width: 104rpx;
height: 89rpx;
border-radius: 16rpx;
}
.classify1 .classifyText {
.classifyText {
width: 104rpx;
height: 34rpx;
font-size: 24rpx;
... ... @@ -177,7 +192,7 @@ page {
color: #FF1717;
}
.dayDiscount {
width: 686rpx;
width:100%;
height: 414rpx;
/* background-color: cadetblue; */
background-color: #ffffff;
... ... @@ -258,16 +273,28 @@ page {
}
.arrow {
width: 10rpx;
height: 10rpx;
border: 3rpx solid #7d7e80;
width: 24rpx;
height: 100%;
/* border: 3rpx solid #7d7e80; */
/* background-color: #7d7e80; */
display: inline-block;
/* transform: rotate(45deg); */
/* border-color: #7d7e80 #7d7e80 transparent transparent; */
/* position: absolute;
top: 6px;
right: -2px; */
}
.arrow image{
width: 24rpx;
height: 24rpx;
/* border: 3rpx solid #7d7e80;
/* background-color: #7d7e80; */
/* display: inline-block;
transform: rotate(45deg);
border-color: #7d7e80 #7d7e80 transparent transparent;
position: absolute;
top: 6px;
right: -2px;
right: -2px; */
}
.discountContent {
... ... @@ -351,15 +378,9 @@ page {
}
/* 每日特价 */
.borderTop {
width: 92%;
height: 32rpx;
background-color: #f1f2f4;
border-radius: 10rpx;
}
.dayPriceContent {
width: 686rpx;
width:100%;
background-color: rgb(241, 240, 150);
background-color: #ffffff;
padding: 32rpx 24rpx;
... ... @@ -479,7 +500,7 @@ page {
.pickPic image {
width: 100%;
height: 328rpx;
border-radius: 16rpx;
border-radius: 16rpx 16rpx 0 0;
}
.pickTitle {
... ...
... ... @@ -227,9 +227,11 @@ Page({
title: '兑换成功',
duration: 3000
})
wx.redirectTo({
url: '/pages/order-detail/order-detail?orderId=' + this.data.orderId,
})
setTimeout(()=>{
wx.reLaunch({
url: '/pages/order-detail/order-detail?orderId='+this.data.orderId,
})
},1000)
} else {
wx.showToast({
title: data.msg,
... ...
... ... @@ -2,8 +2,8 @@
<view class="container">
<!-- 地址 -->
<view class="address" bindtap="emit">
<view class="address_content_left" style="width:92%">
<view>
<view class="address_content_left" style="width:92%;display: flex;flex-wrap: wrap; align-items: center;">
<view style="display: flex;align-items: center;">
<view class="userName">{{userData.name}}</view>
<view class="userTell">{{userData.phone}}</view>
<view class="default" wx:if="{{userData.delFlag==1}}">默认</view>
... ...
... ... @@ -66,12 +66,14 @@ page {
.userName {
display: inline-block;
height: 40rpx;
width: auto;
font-size: 32rpx;
font-weight: 600;
text-align: left;
color: #323233;
line-height: 44rpx;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
max-width: 260rpx;
}
.userTell {
... ...
... ... @@ -7,12 +7,30 @@ Page({
goodsId: '',
userData: {},
requestData: {}, //订单信息
list: [{
"goodsId": "1337649087209541632",
"goodsName": "测试商品",
"goodsPic": "http://116.62.78.113/imgstore/M00/00/04/rBD3oV_UZkyAQDDQAAAeI1dTncM636.png",
"goodsAttributes": "32132132132",
"goodsPrice": 0.01,
"goodsQuantity": 1
},
{
"goodsId": "1333662567566008320",
"goodsName": "欧莱雅洁面乳",
"goodsPic": "http://116.62.78.113/imgstore/M00/00/04/rBD3oV_O1ECABF12AAGC4X0pixA897.png",
"goodsAttributes": "欧莱雅洁面乳",
"goodsPrice": 0.01,
"goodsQuantity": 1
}
], //测试
num: '2222',
orderData: {
number: '123456789456123',
time: '2020-11-03',
money: '12.00'
}
},
addZero: true, //价格补零
},
//订单详情
orderDetail(orderId) {
... ... @@ -23,6 +41,8 @@ Page({
goodsId: data.data.listGoodsVoList[0].goodsId,
// refoundStatus:this.data.requestData.returnVos[0].status
})
isInteger(this.data.requestData.payAmount)
isInteger(this.data.requestData.freightAmount)
let status = this.data.requestData.returnVos[0].status
this.setData({
refoundStatus: status
... ... @@ -31,6 +51,15 @@ Page({
}
})
},
//判断价格是否整数
isInteger(obj) {
Number.isInteger(obj);
if (!Number.isInteger(obj)) {
this.setData({
addZero: false
})
}
},
//商品详情
goGoodsDetail(e) {
let goodsid = e.currentTarget.dataset.id;
... ...
... ... @@ -17,7 +17,8 @@
</view>
<!-- 商品列表 -->
<view class="cartList">
<view class="cartListItem" wx:for="{{requestData.listGoodsVoList}}" bindtap="goGoodsDetail" data-id="{{item.goodsId}}">
<view class="cartListItem" wx:for="{{list}}" bindtap="goGoodsDetail" data-id="{{item.goodsId}}">
<!-- <view class="cartListItem" wx:for="{{requestData.listGoodsVoList}}" bindtap="goGoodsDetail" data-id="{{item.goodsId}}"> -->
<view class="itemRight">
<view class="productPic">
<image src="{{item.goodsPic}}" mode="aspectFill"></image>
... ... @@ -29,61 +30,71 @@
<view class="price">
<text class="moneyIcon">¥</text>
<text class="moneyNum">{{item.goodsPrice}}</text>
</view>
<view class="num">
x{{item.goodsQuantity}}
</view>
<view class="num">
x{{item.goodsQuantity}}
</view>
</view>
</view>
</view>
</view>
</view>
</view>
<!-- 买家留言 -->
<view wx:if="{{requestData.note!==''}}">
<view class="messageBox">
<view class="messageTitle">买家留言:</view>
<view>{{requestData.note}}</view>
<view class="numLength">{{requestData.note.length}}/50</view>
</view>
</view>
<!-- 优惠券 -->
<view class="discountCard">
<view>优惠券抵扣金额</view>
<view class="discountBox">
<view class="discountText">{{requestData.couponAmount}}</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 wx:if="{{requestData.note!==''}}">
<!-- <view > -->
<view class="messageBox">
<view class="messageTitle">买家留言:</view>
<view class="messageText">{{requestData.note}}</view>
<!-- <view class="numLength">{{requestData.note.length}}/50</view> -->
</view>
</view>
</view>
<!-- 订单详情 -->
<view class="orderBox">
<view class="number orderPublic innerPublic">
<view class="title">订单编号 :</view>
<view class="content">{{requestData.id}}</view>
<!-- 优惠券 -->
<view class="discountCard">
<view>优惠券抵扣金额</view>
<view class="discountBox">
<view class="discountText">{{requestData.couponAmount}}</view>
</view>
</view>
<view class="time orderPublic innerPublic">
<view class="title ">配送时间 :</view>
<view class="content">{{requestData.createTime}}</view>
<!-- 商品总额 -->
<view class="allMoney">
<view class="prodeuctMoney moneyPublic">
<view class="txt">商品总额</view>
<!-- <view class="money txt">¥{{requestData.payAmount}}</view> -->
<view class="money txt">
<text style="margin-right: -6rpx;">¥</text>
<text>{{requestData.payAmount}}</text>
<text wx:if="{{addZero}}">.00</text>
</view>
</view>
<view class="carriage moneyPublic">
<view class="txt">配送费</view>
<view class="money txt">
<text style="margin-right: -6rpx;">¥</text>
<text>{{requestData.freightAmount}}</text>
<text wx:if="{{addZero}}">.00</text>
</view>
</view>
</view>
<view class="mainMoney innerPublic">
<view class="title ">商品总额 :</view>
<view class="content">
<view class="icon">¥</view>
<view>{{requestData.payAmount}}</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.deliveryTime}}</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>
<!-- 再次购买 -->
<view class="bottomBox">
<view bindtap="buyAgain">再次购买</view>
</view>
</view>
\ No newline at end of file
... ...
... ... @@ -48,6 +48,7 @@ page {
}
.userName {
max-width: 276rpx;
display: inline-block;
height: 40rpx;
width: auto;
... ... @@ -56,6 +57,9 @@ page {
text-align: left;
color: #323233;
line-height: 44rpx;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.userTell {
... ... @@ -87,7 +91,7 @@ page {
.userAddress {
width: 504rpx;
font-size: 28prx;
font-size: 28rpx;
font-weight: 400;
text-align: left;
color: #6c6c6d;
... ... @@ -191,6 +195,7 @@ page {
.productPic image {
width: 180rpx;
height: 180rpx;
border-radius: 16rpx;
}
.productName {
... ... @@ -267,7 +272,7 @@ page {
/* 买家留言 */
.messageBox {
width: 686rpx;
height: 280rpx;
height:auto;
background-color: #ffffff;
margin: 0 auto;
margin-top: 24rpx;
... ... @@ -284,7 +289,10 @@ page {
text-align: left;
color: #323233;
line-height: 40rpx;
}
.messageText{
font-size: 28rpx;
color: #323233;
}
textarea {
... ...
... ... @@ -9,6 +9,7 @@ Page({
goodsId: '',
swiperArray: [], //商品轮播图
countDownShow: '', //判断限时优惠商品
addZero:true, //商品价格补零
time: '', //倒计时
timeData: '',
hour: "",
... ... @@ -17,8 +18,8 @@ Page({
endTimess: '',
goodsData: '',
pingjiaNum: 0,
infoList: [],//评价
image: '', //评价图片
infoList: [], //评价
image: '', //评价图片
flags: true,
deacArray: [],
flag: 1,
... ... @@ -27,15 +28,17 @@ Page({
showMaskSku: false,
count: 1,
cartGoodNum: '', //购物车商品数量
cartGoodNumBj: false, //购物车商品数量
payCount: 1,
stockNum: '',
richText: '',
couponVos: [], //优惠券列表
userData: '', //地址信息
ceshi: [], //商品规格
idx: 0, //商品规格索引
ceshi: [], //商品规格
idx: 0, //商品规格索引
jifenNum: '', //商品积分
integral: '', //用户积分
phoneNumber: '', //联系客服
bottomHint: false //触底提示
},
//倒计时
... ... @@ -120,11 +123,21 @@ Page({
goodsId: data.data.goodsId,
jifenNum: data.data.goodsPrice,
})
this.evaluate()
this.evaluate();
this.isInteger(this.data.jifenNum)
console.log(this.data.goodsId, 'goodsid')
}
})
},
//判断价格是否整数
isInteger(obj) {
Number.isInteger(obj);
if (!Number.isInteger(obj)) {
this.setData({
addZero:false
})
}
},
//商品评价
evaluate() {
let postData = {
... ... @@ -164,9 +177,10 @@ Page({
if (data.statusCode == 0) {
if (data.data !== 0) {
this.setData({
cartGoodNum: data.data
cartGoodNum: data.data,
cartGoodNumBj: true
})
}
} else {}
}
})
... ... @@ -202,11 +216,11 @@ Page({
},
//联系客服
linkKefu() {
if (getStorageSync.Authorization == "") {
} else {
myKefu() {
if (getStorageSync.Authorization == "") {} else {
wx.makePhoneCall({
phoneNumber: '111111111000',
phoneNumber: this.data.phoneNumber,
success() {
console.log('拨打电话成功')
},
... ... @@ -240,8 +254,15 @@ Page({
//在线客服
myKefu() {
if (this.data.Authorization) {
method.getRequest("/information/queryCustomerPhone", data => {
if (data.statusCode == 0) {
this.setData({
phoneNumber: data.data
})
}
})
wx.makePhoneCall({
phoneNumber: '111111111000',
phoneNumber: this.data.phoneNumber,
success() {
console.log('拨打电话成功')
},
... ... @@ -305,8 +326,7 @@ Page({
icon: 'none',
duration: 1000
})
} else {
}
} else {}
})
},
decNum() {
... ... @@ -436,8 +456,7 @@ Page({
icon: 'none',
duration: 1000
})
} else {
}
} else {}
})
},
dec() {
... ... @@ -503,7 +522,7 @@ Page({
* 生命周期函数--监听页面显示
*/
onShow: function () {
this.countDown() //获取优惠剩余时间
this.countDown() //获取优惠剩余时间
this.getCartNum() //获取购物车商品总数量
setTimeout(() => {
this.demoDown();
... ... @@ -560,8 +579,7 @@ Page({
*/
onShareAppMessage: function (res) {
console.log(this.data.goodsId, 'id')
if (res.from === 'button') {
}
if (res.from === 'button') {}
return {
title: '世纪华联超市',
path: "/pages/product-detail/product-detail?id=" + this.data.goodsId
... ...
... ... @@ -30,10 +30,10 @@
<view class="productPrice">
<view class="price" wx:if="{{goodsData.type==2}}">
<text class="moneyIcon">¥</text>
<text class="moneyNum">{{goodsData.goodsPrice}}</text>
<text class="moneyIcon">.00</text>
<text class="moneyNum">{{jifenNum}}</text>
<text class="moneyIcon" wx:if="{{addZero}}">.00</text>
</view>
<view class="jifen" wx:if="{{goodsData.type==1}}">积分{{goodsData.goodsPrice}}</view>
<view class="jifen" wx:if="{{goodsData.type==1}}">积分{{jifenNum}}</view>
<view class="share" data-id="{{goodsId}}">
<view class="shareIcon">
<image src="/images/01-03/icon_share@2x.png"></image>
... ... @@ -114,7 +114,7 @@
<view>客服</view>
</view>
<view class="bottom_left_item" catchtap="goCart">
<view class="count_cart">{{cartGoodNum}}</view>
<view class="count_cart" wx:if="{{cartGoodNumBj}}">{{cartGoodNum}}</view>
<image src="/images/01-03/cart.png"></image>
<view>购物车</view>
</view>
... ...
... ... @@ -308,6 +308,7 @@
.evaluateBox {
width: 750rpx;
margin-top: 20rpx;
height: 132rpx;
}
.evaluateInfo {
... ... @@ -347,11 +348,14 @@
font-weight: 400;
text-align: left;
color: #333333;
line-height: 40rpx;
line-height:44rpx;
letter-spacing: 1rpx;
margin: 0 auto;
margin-top: 20rpx;
word-break: break-all;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.evaluatePic {
... ...
... ... @@ -220,7 +220,7 @@
.listSon image {
width: 100%;
height: 328rpx;
border-radius: 16rpx;
border-radius: 16rpx 16rpx 0 0 ;
}
.listTitle {
... ...
... ... @@ -27,7 +27,6 @@ page{
}
.listBox{
display: flex;
margin-top: 108rpx;
padding: 0 26rpx;
box-sizing: border-box;
}
... ... @@ -67,7 +66,7 @@ page{
.pickPic image {
width: 100%;
height: 328rpx;
border-radius: 16rpx;
border-radius: 16rpx 16rpx 0 0;
}
.pickTitle {
... ...
/* pages/select-address/select-address.wxss */
page{
page {
background-color: #f1f2f4;
}
.container {
width: 750rpx;
border-top: 1rpx solid #f2f2f2;
padding-bottom:140rpx;
padding-bottom: 140rpx;
}
.addressBox {
... ... @@ -40,6 +41,11 @@ page{
color: #333333;
line-height: 40rpx;
margin-right: 10rpx;
width: 200rpx;
overflow: hidden;
height: 34rpx;
white-space: nowrap;
text-overflow: ellipsis;
}
.tell {
... ... @@ -140,7 +146,7 @@ page{
width: 36rpx;
height: 40rpx;
display: flex;
align-items: center;
align-items: center;
}
.editIcon image {
... ... @@ -199,21 +205,25 @@ page{
font-weight: 400;
color: #ffffff;
}
.noData{
.noData {
width: 100%;
height: 100%;
margin-top: 300rpx;
}
.noDataPic{
.noDataPic {
width: 200rpx;
height: 200rpx;
margin: 0 auto;
}
.noDataPic image{
.noDataPic image {
width: 200rpx;
height: 200rpx;
}
.noDataTop{
.noDataTop {
width: 100%;
font-size: 30rpx;
display: flex;
... ... @@ -222,7 +232,8 @@ page{
justify-content: center;
font-weight: 500;
}
.noDataBottom{
.noDataBottom {
width: 100%;
font-size: 24rpx;
color: #7d7e80;
... ...
... ... @@ -7,6 +7,7 @@ Page({
userData: "", //地址信息
addHint: false, //判断有没有地址
showTime: false, //配送时间
deliveryTime:'',
timers: '',
checkNum: 0,
stockNum: '',
... ... @@ -125,6 +126,7 @@ Page({
this.setData({
timers: e.detail.time,
// showTime: e.detail.flag,
deliveryTime: e.detail.deliveryTime,
showTime: false,
})
}
... ... @@ -346,7 +348,10 @@ Page({
carts: list
})
})
wx.setStorageSync('date', this.data.date)
let str=this.data.deliveryTime+' '+this.data.timers
console.log(str,'str')
// wx.setStorageSync('date', this.data.date)
wx.setStorageSync('sendTime',str)
wx.removeStorageSync('time')
wx.setStorageSync('pitchList', this.data.pitchList)
wx.setStorageSync('pitchCart', this.data.pitchCart)
... ... @@ -362,7 +367,7 @@ Page({
this.getAddress();
this.setData({
hasList: true,
//carts: [],
// carts: [],
checkNum: 0
});
this.youLike();
... ... @@ -384,7 +389,8 @@ Page({
this.getAddress() //获取默认地址
this.setData({ //每次购物车下单重新选择商品
pitchCart: [],
pitchList: []
pitchList: [],
checkNum:0
})
console.log(this.data.flagClick)
setTimeout(() => { //判断购物车是否有商品
... ...
... ... @@ -3,7 +3,7 @@
<!-- 地址 -->
<view class="userInfo" bindtap="goAddress1">
<view style="display:flex;align-items: center;">
<view wx:if="{{userData!==''}}" style="width:95%">
<view wx:if="{{userData!==''}}" style="width:95%;display: flex;flex-wrap: wrap; align-items: center;">
<view class="userName">{{userData.name}}</view>
<view class="userTell">{{userData.phone}}</view>
<view class="default" wx:if="{{userData.delFlag==1}}">默认</view>
... ... @@ -19,8 +19,8 @@
</view>
<!-- 配送时间 -->
<view class="timeBox" >
<view style="display:flex">
<view class="calendar " bindtap='chooseTime'>
<view style="display:flex" bindtap='chooseTime'>
<view class="calendar " >
<view style="display: flex;align-items: center;">
<image src="/images/04-01/rili.png"></image>
</view>
... ...
... ... @@ -36,12 +36,14 @@ page {
.userName {
display: inline-block;
height: 40rpx;
width: auto;
font-size: 32rpx;
font-weight: 600;
text-align: left;
color: #323233;
line-height: 44rpx;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
max-width: 260rpx;
}
.userTell {
... ... @@ -72,8 +74,7 @@ page {
}
.userAddress {
width: 504rpx;
font-size: 28prx;
font-size: 28rpx;
font-weight: 400;
text-align: left;
color: #323233;
... ... @@ -344,7 +345,7 @@ page {
.listSon image {
width: 100%;
border-radius: 16rpx;
border-radius: 16rpx 16rpx 0 0;
height: 100%;
}
... ...
... ... @@ -133,10 +133,10 @@
"scene": null
},
{
"id": -1,
"id": 9,
"name": "pages/order-detail/order-detail",
"pathName": "pages/order-detail/order-detail",
"query": "",
"query": "orderId= 1337661626714722306",
"scene": null
},
{
... ... @@ -297,6 +297,7 @@
"id": -1,
"name": "pages/timedmo/timedmo",
"pathName": "pages/timedmo/timedmo",
"query": "",
"scene": null
}
]
... ...