Browse Source

bug修复

master
xpz2018 6 years ago
parent
commit
d508429634
12 changed files with 149 additions and 222 deletions
  1. 11
      pages/mall/order-info/index.js
  2. 6
      pages/mall/order-info/index.wxml
  3. 22
      pages/mall/page-list/index.js
  4. 6
      pages/mall/page-list/index.json
  5. 23
      pages/mall/page-list/index.wxml
  6. 76
      pages/mall/page-list/index.wxss
  7. 3
      pages/mall/search-list/index.json
  8. 24
      pages/mall/search-list/index.wxml
  9. 75
      pages/mall/search-list/index.wxss
  10. 3
      pages/mall/shops/index.json
  11. 46
      pages/mall/shops/index.wxml
  12. 76
      pages/mall/shops/index.wxss

11
pages/mall/order-info/index.js

@ -179,6 +179,7 @@ Page({
const element = this.data.orderInfo.skuList[index];
if(this.checkSkuPrice(this.data.matchTag, element)){
this.data.form.unitPrice = Number(element.price)
this.data.form.stockNumber = Number(element.stockNumber)
this.data.form.dividePrice = Number(element.dividePrice)
this.data.form.skuId = element.id
console.log(element)
@ -188,6 +189,8 @@ Page({
// 如果查询到了价格,进行价格计算
if(this.data.form.unitPrice){
this.setData({
['form.unitPrice']: this.data.form.unitPrice,
['form.stockNumber']: this.data.form.stockNumber,
amount: float.accMul(this.data.form.unitPrice, this.data.form.number)
})
}
@ -210,6 +213,14 @@ Page({
return
}
}
if(this.data.form.number <= 0){
util.showToast('请输入购买数量,必选大于0')
return
}
if(this.data.form.stockNumber <= 0){
util.showToast('暂无库存,请选择其他规格类型')
return
}
this.data.form.summary = this.data.orderInfo.summary
this.data.form.sellMode = this.data.orderInfo.sellMode
this.data.form.name = this.data.orderInfo.name

6
pages/mall/order-info/index.wxml

@ -12,8 +12,8 @@
</swiper>
<view class="bg-white flex flex-justify" style="padding:8rpx 32rpx 0rpx 32rpx">
<view class="flex flex-center">
<view class="detail-price">¥{{orderInfo.price}}</view>
<view class="text-gray" style="font-size:12px;margin-left:48rpx">库存:{{orderInfo.stockNumber}}{{orderInfo.unit}}</view>
<view class="detail-price">¥{{form.unitPrice || orderInfo.price}}</view>
<view class="text-gray" style="font-size:12px;margin-left:48rpx">库存:{{form.stockNumber >= 0 ? form.stockNumber : orderInfo.stockNumber}}{{orderInfo.unit}}</view>
</view>
<view class="flex flex-center">
<view class="text-gray" style="font-size:12px;margin-right:24rpx">{{orderInfo.viewNum}} 浏览</view>
@ -42,7 +42,7 @@
</view>
<view class="bg-white flex flex-justify" style="height:100rpx;;padding: 0rpx 32rpx">
<view class="text-gray" style="font-size:14px">购买数量</view>
<wux-input-number default-value="{{form.number}}" disabled="{{false}}" color="stable" min="{{1}}" max="{{orderInfo.stockNumber}}" bind:change="onNumChange" />
<wux-input-number default-value="{{form.number}}" disabled="{{false}}" color="stable" min="{{1}}" max="{{stockNumber||orderInfo.stockNumber}}" bind:change="onNumChange" />
</view>
<view class="bg-white" style="padding:32rpx;margin-top:32rpx">

22
pages/mall/page-list/index.js

@ -0,0 +1,22 @@
// pages/message/index.js
Component({
options: {
addGlobalClass: true,
multipleSlots: true
},
properties: {
dataList: { // 必选,通知本组件收起
type: Array,
value: null,
}
},
methods: {
lookItem: function (e) {
var item = this.data.dataList[e.currentTarget.dataset.index]
wx.navigateTo({
url: '/pages/mall/order-info/index?id=' + item.id
})
}
}
})

6
pages/mall/page-list/index.json

@ -0,0 +1,6 @@
{
"component": true,
"usingComponents": {
"wux-image": "/components/image/index"
}
}

23
pages/mall/page-list/index.wxml

@ -0,0 +1,23 @@
<view class="flex content" wx:for="{{dataList}}" wx:key="index" data-index="{{index}}" bindtap="lookItem">
<wux-image width="{{119}}" height="{{119}}" wux-class="page-icon" lazyLoad="true" src="{{item.litimgUrl}}" mode="aspectFill">
<view class="image-load" slot="loading">
<text class="icon--refresher"></text>
</view>
</wux-image>
<view style="flex:1;padding:16rpx 20rpx">
<view class="flex flex-justify">
<view class="page-name">{{item.name}}</view>
<view class="page-num" wx:if="{{item.sellMode == 1}}">{{item.viewNum}} 浏览</view>
<view class="page-num" wx:elif="{{item.sellMode == 2}}">已拼{{item.soldNum}}{{item.unit}}</view>
</view>
<view style="height:100rpx">
<view class="page-outline">{{item.outline}}</view>
<view class="page-outline" style="margin-top: 8rpx">{{item.summary}}</view>
</view>
<view class="flex flex-justify" style="align-items:flex-end">
<view class="page-price">¥{{item.price}}</view>
<view class="page-stock" style="margin-bottom:6rpx">库存:{{item.stockNumber}}{{item.unit}}</view>
<button class="cu-btn bg-red round shadow-blur page-btn">立即抢购</button>
</view>
</view>
</view>

76
pages/mall/page-list/index.wxss

@ -0,0 +1,76 @@
/* pages/message/index.wxss */
.content {
margin-top: 24rpx;
background: rgba(255, 255, 255, 1);
border-radius: 6px;
}
.page-icon {
height: 240rpx;
width: 240rpx;
border-top-left-radius: 12rpx;
border-bottom-left-radius: 12rpx;
}
.page-name {
font-size: 16px;
font-family: PingFang-SC-Medium, PingFang-SC;
font-weight: 500;
color: rgba(51, 51, 51, 1);
line-height: 22px;
}
.page-num {
margin-top: 8rpx;
font-size: 10px;
font-family: PingFang-SC-Regular, PingFang-SC;
font-weight: 400;
color: rgba(51, 51, 51, 1);
}
.page-outline {
margin-top: 8rpx;
font-size: 10px;
font-family: PingFang-SC-Regular, PingFang-SC;
font-weight: 400;
color: rgba(51, 51, 51, 1);
display: -webkit-box;
overflow: hidden;
text-overflow: ellipsis;
word-wrap: break-word;
white-space: normal !important;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
}
.page-btn {
height: 27px;
background: rgba(255, 66, 43, 1);
box-shadow: 0px 4px 14px -6px rgba(255, 43, 45, 0.8);
color: white;
font-size: 12px;
}
.page-price {
font-size: 16px;
font-family: DINAlternate-Bold, DINAlternate;
font-weight: bold;
color: rgba(255, 66, 43, 1);
}
.page-stock {
font-size: 10px;
font-family: PingFang-SC-Regular, PingFang-SC;
font-weight: 400;
color: rgba(153, 153, 153, 1);
line-height: 14px;
}
.image-load {
width: 240rpx;
height: 240rpx;
display: flex;
align-items: center;
justify-content: center;
}

3
pages/mall/search-list/index.json

@ -3,6 +3,7 @@
"refresh-view": "/components/refresher/index",
"wux-button": "/components/button/index",
"wux-tab": "/components/tab/index",
"wux-image": "/components/image/index"
"wux-image": "/components/image/index",
"page-list": "/pages/mall/page-list/index"
}
}

24
pages/mall/search-list/index.wxml

@ -37,29 +37,7 @@
</view>
<scroll-view scroll-y scroll-top="{{top}}" style="height:{{height}}rpx;padding: 0rpx 24rpx" wx:else bindscrolltolower="fetchTaskList">
<view wx:for-item="pageItem" wx:for-index="pageIndex" wx:for="{{taskList}}" wx:key="pageIndex">
<view class="flex content" wx:for="{{pageItem}}" wx:key="index" data-page="{{pageIndex}}" data-index="{{index}}" bindtap="lookItem">
<wux-image width="{{120}}" height="{{120}}" wux-class="page-icon" src="{{item.litimgUrl}}" mode="{{aspectFill}}">
<view class="image-load" slot="loading">
<text class="icon--refresher"></text>
</view>
</wux-image>
<view style="flex:1;padding:16rpx">
<view class="flex flex-justify" >
<view class="page-name">{{item.name}}</view>
<view wx:if="{{item.sellMode==2}}" class="page-num">已拼{{item.soldNum}}{{item.unit}}</view>
<view wx:elif="{{item.sellMode==1}}" class="page-num">{{item.viewNum}} 浏览</view>
</view>
<view style="height:100rpx">
<view class="page-outline">{{item.outline}}</view>
<view class="page-outline" style="margin-top: 8rpx">{{item.summary}}</view>
</view>
<view class="flex flex-justify" style="align-items:flex-end">
<view class="page-price">¥{{item.price}}</view>
<view class="page-stock" style="margin-bottom:6rpx">库存:{{item.stockNumber}}{{item.unit}}</view>
<button class="cu-btn bg-red round shadow-blur page-btn">立即抢购</button>
</view>
</view>
</view>
<page-list dataList="{{pageItem}}"></page-list>
</view>
<!--加载更多的UI-->
<view class="flex flex-center" style="height:80rpx;padding-bottom:18rpx" wx:if="{{form.pageNum>1}}">

75
pages/mall/search-list/index.wxss

@ -32,78 +32,3 @@
.cu-bar .search-form [class*="cuIcon-"]::before {
top: 0rpx;
}
.content {
margin-top: 24rpx;
background: rgba(255, 255, 255, 1);
border-radius: 6px;
}
.page-icon {
height: 240rpx;
width: 240rpx;
border-top-left-radius: 12rpx;
border-bottom-left-radius: 12rpx;
}
.page-name {
font-size: 16px;
font-family: PingFang-SC-Medium, PingFang-SC;
font-weight: 500;
color: rgba(51, 51, 51, 1);
line-height: 22px;
}
.page-num {
margin-top: 8rpx;
font-size: 10px;
font-family: PingFang-SC-Regular, PingFang-SC;
font-weight: 400;
color: rgba(51, 51, 51, 1);
}
.page-outline {
margin-top: 8rpx;
font-size: 10px;
font-family: PingFang-SC-Regular, PingFang-SC;
font-weight: 400;
color: rgba(51, 51, 51, 1);
display: -webkit-box;
overflow: hidden;
text-overflow: ellipsis;
word-wrap: break-word;
white-space: normal !important;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
}
.page-btn {
height: 27px;
background: rgba(255, 66, 43, 1);
box-shadow: 0px 4px 14px -6px rgba(255, 43, 45, 0.8);
color: white;
font-size: 12px;
}
.page-price {
font-size: 16px;
font-family: DINAlternate-Bold, DINAlternate;
font-weight: bold;
color: rgba(255, 66, 43, 1);
}
.page-stock {
font-size: 10px;
font-family: PingFang-SC-Regular, PingFang-SC;
font-weight: 400;
color: rgba(153, 153, 153, 1);
line-height: 14px;
}
.image-load {
width: 240rpx;
height: 240rpx;
display: flex;
align-items: center;
justify-content: center;
}

3
pages/mall/shops/index.json

@ -9,6 +9,7 @@
"wux-button": "/components/button/index",
"wux-tab": "/components/tab/index",
"wux-image": "/components/image/index",
"wux-divider": "/components/divider/index"
"wux-divider": "/components/divider/index",
"page-list": "/pages/mall/page-list/index"
}
}

46
pages/mall/shops/index.wxml

@ -110,28 +110,7 @@
<view class="v-driver"></view>
<view class="nav-title">限时限量 售完即止</view>
</view>
<view class="flex content" wx:for="{{cheapList}}" wx:key="index" data-index="{{index}}" bindtap="lookCheapItem">
<wux-image width="{{119}}" height="{{119}}" wux-class="page-icon" lazyLoad="true" src="{{item.litimgUrl}}" mode="aspectFill">
<view class="image-load" slot="loading">
<text class="icon--refresher"></text>
</view>
</wux-image>
<view style="flex:1;padding:16rpx 20rpx">
<view class="flex flex-justify">
<view class="page-name">{{item.name}}</view>
<view class="page-num">{{item.viewNum}} 浏览</view>
</view>
<view style="height:100rpx">
<view class="page-outline">{{item.outline}}</view>
<view class="page-outline" style="margin-top: 8rpx">{{item.summary}}</view>
</view>
<view class="flex flex-justify" style="align-items:flex-end">
<view class="page-price">¥{{item.price}}</view>
<view class="page-stock" style="margin-bottom:6rpx">库存:{{item.stockNumber}}{{item.unit}}</view>
<button class="cu-btn bg-red round shadow-blur page-btn">立即抢购</button>
</view>
</view>
</view>
<page-list dataList="{{cheapList}}"></page-list>
</view>
<view wx:if="{{taskList.length}}">
<view class="flex nav-li">
@ -142,28 +121,7 @@
</view>
</view>
<view wx:for-item="pageItem" wx:for-index="pageIndex" wx:for="{{taskList}}" wx:key="pageIndex">
<view class="flex content" wx:for="{{pageItem}}" wx:key="index" data-page="{{pageIndex}}" data-index="{{index}}" bindtap="lookGroupItem">
<wux-image width="{{120}}" height="{{120}}" lazyLoad="{{true}}" wux-class="page-icon" src="{{item.litimgUrl}}" mode="aspectFill">
<view class="image-load" slot="loading">
<text class="icon--refresher"></text>
</view>
</wux-image>
<view style="flex:1;padding:16rpx 20rpx">
<view class="flex flex-justify">
<view class="page-name">{{item.name}}</view>
<view class="page-num">已拼{{item.soldNum}}{{item.unit}}</view>
</view>
<view style="height:100rpx">
<view class="page-outline" >{{item.outline}}</view>
<view class="page-outline" style="margin-top: 8rpx">{{item.summary}}</view>
</view>
<view class="flex flex-justify" style="align-items:flex-end">
<view class="page-price">¥{{item.price}}</view>
<view class="page-stock" style="margin-bottom:6rpx">库存:{{item.stockNumber}}{{item.unit}}</view>
<button class="cu-btn bg-red round shadow-blur page-btn">立即抢购</button>
</view>
</view>
</view>
<page-list dataList="{{pageItem}}"></page-list>
</view>
<!--加载更多的UI-->
<wux-divider dashed wx:if="{{form.pageNum>1}}">

76
pages/mall/shops/index.wxss

@ -74,78 +74,4 @@
font-weight: 400;
color: rgba(208, 208, 208, 1);
}
.content {
margin-top: 24rpx;
background: rgba(255, 255, 255, 1);
border-radius: 6px;
}
.page-icon {
height: 240rpx;
width: 240rpx;
border-top-left-radius: 12rpx;
border-bottom-left-radius: 12rpx;
}
.page-name {
font-size: 16px;
font-family: PingFang-SC-Medium, PingFang-SC;
font-weight: 500;
color: rgba(51, 51, 51, 1);
line-height: 22px;
}
.page-num {
margin-top: 8rpx;
font-size: 10px;
font-family: PingFang-SC-Regular, PingFang-SC;
font-weight: 400;
color: rgba(51, 51, 51, 1);
}
.page-outline {
margin-top: 8rpx;
font-size: 10px;
font-family: PingFang-SC-Regular, PingFang-SC;
font-weight: 400;
color: rgba(51, 51, 51, 1);
display: -webkit-box;
overflow: hidden;
text-overflow: ellipsis;
word-wrap: break-word;
white-space: normal !important;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
}
.page-btn {
height: 27px;
background: rgba(255, 66, 43, 1);
box-shadow: 0px 4px 14px -6px rgba(255, 43, 45, 0.8);
color: white;
font-size: 12px;
}
.page-price {
font-size: 16px;
font-family: DINAlternate-Bold, DINAlternate;
font-weight: bold;
color: rgba(255, 66, 43, 1);
}
.page-stock {
font-size: 10px;
font-family: PingFang-SC-Regular, PingFang-SC;
font-weight: 400;
color: rgba(153, 153, 153, 1);
line-height: 14px;
}
.image-load {
width: 240rpx;
height: 240rpx;
display: flex;
align-items: center;
justify-content: center;
}
Loading…
Cancel
Save