Browse Source

购物车优化数量填写

登录优化
master
杜叶春 2 years ago
parent
commit
634f785c8d
  1. 11
      pages/cart/cart.wxss
  2. 2
      pages/category/category.wxss
  3. 19
      pages/listdetail/listdetail.js
  4. 4
      pages/listdetail/listdetail.wxml
  5. 8
      pages/listdetail/listdetail.wxss
  6. 52
      pages/login/login.js
  7. 2
      pages/order/order.wxml
  8. 11
      pages/order/pay.js
  9. 6
      pages/product/detail.js
  10. 2
      pages/product/detail.wxml
  11. 4
      pages/product/detail.wxss

11
pages/cart/cart.wxss

@ -274,7 +274,6 @@ page{
height: 21px!important;
font-size: 28rpx;
line-height: 20px;
min-height: 21px!important;
color: #666
}
@ -445,7 +444,7 @@ padding-right:16px;
/* overflow-y: scroll; */
}
.text_center{
width: 97%;
width: 97%;
position: absolute;
top: -40px;
}
@ -521,14 +520,14 @@ padding-right:16px;
height: 100rpx;
}
.stepper {
text-align: right;
/* text-align: right; */
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
width: 200rpx;
width: 230rpx;
overflow: hidden;
margin-left: 250rpx;
margin-left: 210rpx;
background-color: #F8F8F8;
border-top: 1px solid #DDD;
border-bottom: 1px solid #DDD;
@ -544,7 +543,7 @@ padding-right:16px;
font-weight: 900;
}
.stepper input {
width: 30px;
width: 60px;
height: 25px;
text-align: center;
}

2
pages/category/category.wxss

@ -94,7 +94,7 @@ page{
/*给text设成块级元素*/
display: block;
margin-top: 15px;
font-size: 14px;
font-size: 13px;
color: black;
/*设置文字溢出部分为...*/
overflow: hidden;

19
pages/listdetail/listdetail.js

@ -23,10 +23,11 @@ Page({
loading: false,//显示加载
period: false,//显示无数据
select: 0,//选中
sort: 0,// 1 asc 升序 0 desc 降序
sort: '',// 1 asc 升序 0 desc 降序
types: '刷新', // 点击更多、下拉上啦刷新
bg: '',
attrList: [],
sortType: '',
},
onPullDownRefresh: function () {
console.log(111)
@ -92,7 +93,8 @@ Page({
page: page,
pro:'',
keyword:'',
sort_criteria: sort,
sort_criteria: that.data.sortType,
sort: sort,
query_criteria: '',//'{"brand_id":"","min_price":"","max_price":""}',
}).then(res => {
if (res.code == 200) {
@ -220,7 +222,8 @@ Page({
var that = this;
this.setData({
select: 0,
sort: 1,
sort: '',
sortType: '',
imageurl1: "../../images/mo.png",
imageurl2: "../../images/mo.png",
page: 1,
@ -234,17 +237,18 @@ Page({
if (this.data.daindex1 == 0) {
this.setData({
imageurl1: "../../images/xia.png",
daindex1: 1,
daindex1: 'desc',
imageurl2: "../../images/mo.png",
})
} else {
this.setData({
imageurl1: "../../images/shang.png",
daindex1: 0,
daindex1: 'asc',
imageurl2: "../../images/mo.png",
})
}
this.setData({
sortType: 'volume',
select: 1,
sort: that.data.daindex1,
page: 1,
@ -258,17 +262,18 @@ Page({
if (this.data.daindex2 == 0) {
this.setData({
imageurl2: "../../images/shang.png",
daindex2: 1,
daindex2: 'asc',
imageurl1: "../../images/mo.png",
})
} else {
this.setData({
imageurl2: "../../images/xia.png",
imageurl1: "../../images/mo.png",
daindex2: 0
daindex2: 'desc'
})
}
this.setData({
sortType: 'price',
select: 2,
sort: that.data.daindex2,
page: 1,

4
pages/listdetail/listdetail.wxml

@ -38,10 +38,10 @@
价格
<image src="{{imageurl2}}"></image>
</view>
<view class='sort-btn' bindtap="tabchage">
<!-- <view class='sort-btn' bindtap="tabchage">
筛选
<image src="/images/filter.png"></image>
</view>
</view> -->
</view>
<view class="list" wx:if="{{shopList.length > 0}}">
<view class="cont" style='padding-top:10px;'>

8
pages/listdetail/listdetail.wxss

@ -2,6 +2,14 @@ page {
height: 100%;
background: #f5f5f5
}
.sort-btn{
width:33%;
text-align: center;
height:90rpx;
line-height:90rpx;
font-size: 28rpx;
color:#333;
}
.bxs{
display:none;
}

52
pages/login/login.js

@ -160,30 +160,36 @@ Page({
})
},
loginAct: function () {
var that = this;
WXAPI.login({
storeId: 239,
storeType: 1,
phone: that.data.account,
password: that.data.password,
}).then(res => {
if (res.code == 200) {
var data = res.data
app.globalData.accessId = data.access_id;
wx.setStorageSync('accessId', data.access_id)
wx.setStorageSync('isLogin', true);
wx.setStorageSync('userInfo', data.data);
wx.navigateBack()
wx.showToast({
title: '登录成功!',
success: 2000
var that = this;
wx.login({
success: function (res) {
var code = res.code;
WXAPI.login({
storeId: 239,
storeType: 1,
account: that.data.account,
password: that.data.password,
code: code,
}).then(res => {
if (res.code == 200) {
var data = res.data
app.globalData.accessId = data.access_id;
wx.setStorageSync('accessId', data.access_id)
wx.setStorageSync('isLogin', true);
wx.setStorageSync('userInfo', data.data);
wx.navigateBack()
wx.showToast({
title: '登录成功!',
success: 2000
});
} else {
wx.showToast({
title: res.message,
icon: 'none',
duration: 1500,
})
}
});
} else {
wx.showToast({
title: res.message,
icon: 'none',
duration: 1500,
})
}
});
},

2
pages/order/order.wxml

@ -28,7 +28,7 @@
<view class="spec">{{item.size}}</view>
<view class="priceView">
<view class="price">¥{{item.p_price}}</view>
<view class="quantity">共 {{item.num}} {{item.unit}}</view>
<view class="quantity">共 {{item.num}} {{item.unit==null?'':item.unit}}</view>
</view>
</view>
</view>

11
pages/order/pay.js

@ -228,14 +228,14 @@ Page({
pays: pays,
});
} else {
that.setData({
remind: true
});
wx.showToast({
title: res.message,
icon: 'none',
duration: 2000,
});
setTimeout(function () {
wx.navigateBack()
}, 600)
}
});
},
@ -560,6 +560,9 @@ Page({
// 确认订单
createProductOrder: function () {
var that = this;
var remarkArr = []
remarkArr.push(that.data.remark)
let remarkStr = JSON.stringify(remarkArr)
WXAPI.orderPayment({
accessId: app.globalData.accessId,
storeId: 239,
@ -567,7 +570,7 @@ Page({
cart_id: that.data.cartId,
address_id: that.data.addrId,
coupon_id: 0,
remarks: that.data.remark,
remarks: remarkStr,
vipSource: 0,
product: that.data.productAry,
pay_type: that.data.paytype,

6
pages/product/detail.js

@ -294,6 +294,12 @@ Page({
}
};
},
//数量
bindManual: function (e) {
this.setData({
buynum: e.detail.value
})
},
//首次进去选中
one: function () {
var attrListIn = this.data.attrList;

2
pages/product/detail.wxml

@ -133,7 +133,7 @@
<!-- 减号 -->
<text class="normal" data-alpha-beta="0" bindtap="changeNum">-</text>
<!-- 数值 -->
<view class="nownum">{{buynum}}</view>
<input class='nownum' type="number" bindinput="bindManual" value="{{buynum}}" />
<!-- 加号 -->
<text class="normal" data-alpha-beta="1" bindtap="changeNum">+</text>
</view>

4
pages/product/detail.wxss

@ -400,7 +400,7 @@ page{
flex-direction: row;
justify-content: space-between;
align-items: center;
width: 200rpx;
width: 230rpx;
overflow: hidden;
margin-left: 250rpx;
background-color: #F8F8F8;
@ -418,7 +418,7 @@ page{
font-weight: 900;
}
.stepper input {
width: 30px;
width: 60px;
height: 25px;
text-align: center;
}

Loading…
Cancel
Save