商品详情,购物车
This commit is contained in:
parent
339fada3e1
commit
4901d6c43f
13
app.json
13
app.json
@ -38,14 +38,18 @@
|
||||
"pages/myVolunteerTeam/myVolunteerTeam",
|
||||
"pages/myVolunteerActivity/myVolunteerActivity",
|
||||
"pages/serviceActivityDetail/serviceActivityDetail",
|
||||
"pages/shop/shopcategory"
|
||||
"pages/shop/shopcategory",
|
||||
"subpages/goodsdetail/goodsdetail",
|
||||
"subpages/goodscar/goodscar"
|
||||
],
|
||||
"subPackages": [{
|
||||
"subPackages": [
|
||||
{
|
||||
"root": "subpages/goodslist",
|
||||
"pages": [
|
||||
"goodslist"
|
||||
]
|
||||
}],
|
||||
}
|
||||
],
|
||||
"window": {
|
||||
"backgroundTextStyle": "light",
|
||||
"navigationBarBackgroundColor": "#9F1512",
|
||||
@ -56,7 +60,8 @@
|
||||
"color": "#BBBBBB",
|
||||
"borderStyle": "black",
|
||||
"selectedColor": "#000000",
|
||||
"list": [{
|
||||
"list": [
|
||||
{
|
||||
"pagePath": "pages/index/index",
|
||||
"iconPath": "images/index.png",
|
||||
"text": "首页",
|
||||
|
@ -24,7 +24,7 @@ Page({
|
||||
changeAvatar: function () {
|
||||
var self = this
|
||||
wx.showActionSheet({
|
||||
itemList: ['从相册中选择','拍照'],
|
||||
itemList: ['从相册中选择', '拍照'],
|
||||
success: function (res) {
|
||||
if (!res.cancel) {
|
||||
if (res.tapIndex == 0) {
|
||||
@ -82,7 +82,7 @@ Page({
|
||||
var self = this
|
||||
wx.getStorage({
|
||||
key: 'token',
|
||||
success: function(res) {
|
||||
success: function (res) {
|
||||
self.setData({
|
||||
token: res.data
|
||||
})
|
||||
@ -90,10 +90,16 @@ Page({
|
||||
},
|
||||
})
|
||||
},
|
||||
// 购物车
|
||||
toShopCar() {
|
||||
wx.navigateTo({
|
||||
url: '/subpages/goodscar/goodscar',
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 跳转到我的活动
|
||||
*/
|
||||
toMyJoinActivity(){
|
||||
toMyJoinActivity() {
|
||||
wx.navigateTo({
|
||||
url: '/pages/myActivity/myActivity',
|
||||
})
|
||||
@ -101,7 +107,7 @@ Page({
|
||||
/**
|
||||
* 跳转到我的预订列表
|
||||
*/
|
||||
toMyOrder: function() {
|
||||
toMyOrder: function () {
|
||||
wx.navigateTo({
|
||||
url: '../order/order',
|
||||
})
|
||||
@ -109,7 +115,7 @@ Page({
|
||||
/**
|
||||
* 跳转到我的志愿团队页面
|
||||
*/
|
||||
toMyTeam: function() {
|
||||
toMyTeam: function () {
|
||||
wx.navigateTo({
|
||||
url: '../myVolunteerTeam/myVolunteerTeam',
|
||||
})
|
||||
@ -117,7 +123,7 @@ Page({
|
||||
/**
|
||||
* 跳转到我的志愿活动页面
|
||||
*/
|
||||
toMyVolunteerActivity: function() {
|
||||
toMyVolunteerActivity: function () {
|
||||
wx.navigateTo({
|
||||
url: '../myVolunteerActivity/myVolunteerActivity',
|
||||
})
|
||||
|
@ -41,10 +41,10 @@
|
||||
<image src="../../images/team.png"></image>
|
||||
<view class="title">我的志愿活动</view>
|
||||
</view>
|
||||
<!-- <view class="main-box">
|
||||
<view class="main-box" bindtap="toShopCar">
|
||||
<image src="../../images/share.png"></image>
|
||||
<view class="title">我的分享</view>
|
||||
</view> -->
|
||||
<view class="title">购物车</view>
|
||||
</view>
|
||||
<!-- <view class="main-box">
|
||||
<image src="../../images/setting.png"></image>
|
||||
<view class="title">设置</view>
|
||||
|
@ -1,11 +1,11 @@
|
||||
<view class="container-box" wx:if="{{isHidePageLoading}}">
|
||||
<view class="left">
|
||||
<scroll-view class="left" scroll-y="true">
|
||||
<view bindtap="chooseOne" data-index="{{index}}" class="{{currentIndex==index ? 'category-item-active':'category-item-default'}}" wx:for="{{categoryOneList}}" wx:for-index="index" wx:for-item="item" wx:key="index">
|
||||
<view wx:if="{{currentIndex==index}}" class="line"></view>
|
||||
<view class="category-one-name">{{item.name}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="right">
|
||||
</scroll-view>
|
||||
<scroll-view class="right" scroll-y="true">
|
||||
<view class="category-card" wx:for="{{categorySeconList}}" wx:for-index="index" wx:for-item="item" wx:key="index">
|
||||
<view class="category-two-name" bindtap="goList" data-id="{{item.id}}">
|
||||
<view>{{item.name}}</view>
|
||||
@ -13,7 +13,7 @@
|
||||
</view>
|
||||
<view class="category-thrid-box" wx:if="{{item.subList.length > 0}}">
|
||||
<view class="category-thrid-item" wx:for="{{item.subList}}" wx:for-index="i" wx:for-item="it" wx:key="i" bindtap="goList" data-id="{{it.id}}">
|
||||
<image src="../../images/avatar.png"></image>
|
||||
<image src="{{it.icon==''? '/subpages/images/ic_goods_type_default.png':imgUrl+it.icon}}"></image>
|
||||
<view>{{it.name}}</view>
|
||||
</view>
|
||||
</view>
|
||||
@ -22,6 +22,6 @@
|
||||
<text>暂无数据</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
<page-loading wx:else></page-loading>
|
@ -17,12 +17,15 @@ page {
|
||||
width: 35%;
|
||||
height: 100%;
|
||||
margin-top: 10rpx;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
}
|
||||
|
||||
.category-item-default {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
padding: 10rpx 0rpx 5rpx 2rpx;
|
||||
padding: 20rpx 0rpx 20rpx 2rpx;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
@ -31,7 +34,7 @@ page {
|
||||
.category-item-active {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
padding: 10rpx 0rpx 5rpx 2rpx;
|
||||
padding: 20rpx 0rpx 20rpx 2rpx;
|
||||
background: white;
|
||||
width: 100%;
|
||||
}
|
||||
@ -48,13 +51,16 @@ page {
|
||||
.line {
|
||||
background: #e70101;
|
||||
width: 10rpx;
|
||||
height: 100%;
|
||||
height: 60rpx;
|
||||
align-self: center;
|
||||
}
|
||||
|
||||
.container-box .right {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
width: 65%;
|
||||
position: absolute;
|
||||
left: 35%;
|
||||
}
|
||||
|
||||
.category-card {
|
||||
@ -71,7 +77,7 @@ page {
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 10rpx;
|
||||
padding: 20rpx 5rpx;
|
||||
}
|
||||
|
||||
.category-thrid-box {
|
||||
@ -80,20 +86,24 @@ page {
|
||||
margin-top: 20rpx;
|
||||
justify-content: flex-start;
|
||||
align-items: center;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.category-thrid-item {
|
||||
width: 33%;
|
||||
width: 30%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 30rpx;
|
||||
margin: 10rpx 0rpx;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.category-thrid-item image {
|
||||
width: 96rpx;
|
||||
height: 96rpx;
|
||||
width: 82rpx;
|
||||
height: 82rpx;
|
||||
margin-bottom: 15rpx;
|
||||
}
|
||||
|
||||
.category-empty {
|
||||
|
@ -1,4 +1,7 @@
|
||||
{
|
||||
"description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
|
||||
"libVersion": "2.30.0"
|
||||
"libVersion": "2.30.0",
|
||||
"setting": {
|
||||
"urlCheck": false
|
||||
}
|
||||
}
|
35
subpages/goodscar/goodscar.js
Normal file
35
subpages/goodscar/goodscar.js
Normal file
@ -0,0 +1,35 @@
|
||||
// subpages/goodscar/goodscar.js
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
carList: [],
|
||||
isHidePageloading: false,
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad(options) {
|
||||
var _self = this;
|
||||
try {
|
||||
var value = wx.getStorageSync('carlist');
|
||||
console.log(value)
|
||||
if (value) {
|
||||
_self.setData({
|
||||
carList: value,
|
||||
isHidePageloading: true
|
||||
})
|
||||
} else {
|
||||
_self.setData({
|
||||
isHidePageloading: true
|
||||
})
|
||||
}
|
||||
} catch (e) {
|
||||
|
||||
}
|
||||
},
|
||||
|
||||
})
|
4
subpages/goodscar/goodscar.json
Normal file
4
subpages/goodscar/goodscar.json
Normal file
@ -0,0 +1,4 @@
|
||||
{
|
||||
"usingComponents": {},
|
||||
"navigationBarTitleText": "购物车"
|
||||
}
|
21
subpages/goodscar/goodscar.wxml
Normal file
21
subpages/goodscar/goodscar.wxml
Normal file
@ -0,0 +1,21 @@
|
||||
<!--subpages/goodscar/goodscar.wxml-->
|
||||
<scroll-view wx:if="{{isHidePageloading}}">
|
||||
<view wx:if="{{carList.length>0}}">
|
||||
<block wx:for="{{carList}}" wx:for-item="item" wx:for-index="index" wx:key="index">
|
||||
<view class="goods-item">
|
||||
<image class="check" src="/subpages/images/ic_shop_car_icon.png" mode="aspectFill"></image>
|
||||
<view class="goods">
|
||||
<image class="goods-img"></image>
|
||||
<view class="goods-content">
|
||||
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
<view class="category-empty" wx:else>
|
||||
<image src="../../images/ic_empty_data.png" mode="scaleToFill"></image>
|
||||
<text class="hint">暂无数据</text>
|
||||
</view>
|
||||
</scroll-view>
|
||||
<page-loading wx:else></page-loading>
|
43
subpages/goodscar/goodscar.wxss
Normal file
43
subpages/goodscar/goodscar.wxss
Normal file
@ -0,0 +1,43 @@
|
||||
/* subpages/goodscar/goodscar.wxss */
|
||||
|
||||
.category-empty {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
text-align: center;
|
||||
align-self: center;
|
||||
|
||||
position: fixed;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translateX(-50%)translateY(-50%);
|
||||
}
|
||||
|
||||
.category-empty image {
|
||||
width: 180rpx;
|
||||
height: 120rpx;
|
||||
}
|
||||
|
||||
.category-empty .hint {
|
||||
margin-top: 30rpx;
|
||||
font-size: 32rpx;
|
||||
}
|
||||
|
||||
.goods-item {}
|
||||
|
||||
.check {
|
||||
width: 48rpx;
|
||||
height: 48rpx;
|
||||
}
|
||||
|
||||
.goods {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: flex-start;
|
||||
|
||||
}
|
||||
.goods .goods-img{}
|
||||
.goods-content{
|
||||
|
||||
}
|
129
subpages/goodsdetail/goodsdetail.js
Normal file
129
subpages/goodsdetail/goodsdetail.js
Normal file
@ -0,0 +1,129 @@
|
||||
// subpages/goodsdetail/goodsdetail.js
|
||||
var app = getApp();
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
goodsId: "",
|
||||
isHidePageloading: false,
|
||||
detailBean: {},
|
||||
currentStandard: {},
|
||||
standardList: [],
|
||||
curStandardIndex: 0,
|
||||
imgUrl: app.shopImgUrl,
|
||||
carList: [],
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad(options) {
|
||||
this.setData({
|
||||
goodsId: options.id
|
||||
})
|
||||
this.getGoodsDetail();
|
||||
|
||||
},
|
||||
//获取商品详情
|
||||
getGoodsDetail() {
|
||||
var _self = this
|
||||
app.restAjax.get(app.restAjax.path('{shopUrl}/app/shopgoods/getrelease/{goodsId}',
|
||||
[app.shopUrl, _self.data.goodsId]),
|
||||
null,
|
||||
null,
|
||||
function (code, data) {
|
||||
if (data) {
|
||||
if (data.goodsPhotos.length > 0) {
|
||||
var photos = data.goodsPhotos.split(',');
|
||||
data.photoList = photos;
|
||||
} else {
|
||||
data.photoList = []
|
||||
}
|
||||
data.goodsPrice = 0;
|
||||
data.goodsStandarName = "";
|
||||
data.goodsStandarId = "";
|
||||
data.isCheck = false;
|
||||
data.carAmount = 0;
|
||||
_self.setData({
|
||||
detailBean: data,
|
||||
})
|
||||
}
|
||||
},
|
||||
function (code, data) {
|
||||
app.dialog.msg(data.msg);
|
||||
},
|
||||
function () {
|
||||
_self.getGoodsStandardList();
|
||||
})
|
||||
},
|
||||
// carAmount;
|
||||
// goodsPrice;
|
||||
// goodsStandarId;
|
||||
// goodsStandarName;
|
||||
// isCheck;
|
||||
//获取商品附加信息
|
||||
getGoodsStandardList() {
|
||||
var _self = this
|
||||
_self.data.detailBean.goodsPrice = 0;
|
||||
_self.data.detailBean.goodsStandarName = "";
|
||||
_self.data.detailBean.goodsStandarId = "";
|
||||
_self.data.detailBean.isCheck = false;
|
||||
_self.data.detailBean.carAmount = 0;
|
||||
|
||||
app.restAjax.get(app.restAjax.path('{shopUrl}/app/shopgoodsitem/listrelease/{goodsId}',
|
||||
[app.shopUrl, _self.data.goodsId]),
|
||||
null,
|
||||
null,
|
||||
function (code, data) {
|
||||
if (data && data.length > 0) {
|
||||
_self.data.detailBean.goodsPrice = data[0].goodsItemUnitPrice;
|
||||
_self.data.detailBean.goodsStandarName = data[0].goodsItemName;
|
||||
_self.data.detailBean.goodsStandarId = data[0].goodsItemId;
|
||||
_self.setData({
|
||||
standardList: data,
|
||||
currentStandard: data[0],
|
||||
isHidePageloading: true,
|
||||
detailBean: _self.data.detailBean
|
||||
})
|
||||
} else {
|
||||
_self.setData({
|
||||
isHidePageloading: true
|
||||
})
|
||||
}
|
||||
},
|
||||
function (code, data) {
|
||||
app.dialog.msg(data.msg);
|
||||
_self.setData({
|
||||
isHidePageloading: true
|
||||
})
|
||||
},
|
||||
function () {
|
||||
_self.setData({
|
||||
isHidePageloading: true
|
||||
})
|
||||
})
|
||||
},
|
||||
doSelStandard(e) {
|
||||
var item = e.currentTarget.dataset.item;
|
||||
var index = e.currentTarget.dataset.index;
|
||||
this.data.detailBean.goodsPrice = item.goodsItemUnitPrice;
|
||||
this.data.detailBean.goodsStandarName = item.goodsItemName;
|
||||
this.data.detailBean.goodsStandarId = item.goodsItemId;
|
||||
this.setData({
|
||||
currentStandard: item,
|
||||
curStandardIndex: index,
|
||||
detailBean: this.data.detailBean
|
||||
})
|
||||
},
|
||||
// 添加购物车
|
||||
addToCar() {
|
||||
//判断购物车中是否存在该商品
|
||||
var _self = this;
|
||||
for (let i = 0; i < _self.data.carList.length; i++) {
|
||||
var item = _self.data.carList[i];
|
||||
|
||||
}
|
||||
}
|
||||
})
|
3
subpages/goodsdetail/goodsdetail.json
Normal file
3
subpages/goodsdetail/goodsdetail.json
Normal file
@ -0,0 +1,3 @@
|
||||
{
|
||||
"usingComponents": {}
|
||||
}
|
83
subpages/goodsdetail/goodsdetail.wxml
Normal file
83
subpages/goodsdetail/goodsdetail.wxml
Normal file
@ -0,0 +1,83 @@
|
||||
<!--subpages/goodsdetail/goodsdetail.wxml-->
|
||||
<scroll-view wx:if="{{isHidePageloading}}">
|
||||
<view class="container-box">
|
||||
<!-- 轮播图 -->
|
||||
<swiper autoplay="true" class="banner" indicator-dots="true">
|
||||
<block wx:for="{{detailBean.photoList}}" wx:for-item="item" wx:for-index="index" wx:key="index">
|
||||
<swiper-item class="banner">
|
||||
<image src="{{imgUrl+detailBean.photoList[index]}}" mode="aspectFill"></image>
|
||||
</swiper-item>
|
||||
</block>
|
||||
</swiper>
|
||||
<!-- 名称 -->
|
||||
<view class="name-box">
|
||||
<view class="type-box">
|
||||
<view class="type-item">库存:{{currentStandard.goodsItemTotal}}</view>
|
||||
<view class="type-item"> 销量:{{detailBean.goodsSalesVolume}}</view>
|
||||
<view class="type-item">评分:{{detailBean.userEvaluate}}</view>
|
||||
<view class="type-item">{{detailBean.goodsNotFreight==1? '包邮':'不包邮'}}</view>
|
||||
</view>
|
||||
<view class="goods-name">
|
||||
{{detailBean.goodsName}}
|
||||
</view>
|
||||
<view class="shop-name">
|
||||
{{detailBean.shopName}}
|
||||
</view>
|
||||
</view>
|
||||
<!-- 规格 -->
|
||||
<view class="standard-box">
|
||||
<view class="title-item">
|
||||
<view class="line"></view>
|
||||
<view class="title-name">规格</view>
|
||||
</view>
|
||||
<view class="standard-content">
|
||||
<block wx:for="{{standardList}}" wx:for-item="item" wx:for-index="index" wx:key="index">
|
||||
<view class="{{index==curStandardIndex? 'standard-item-sel':'standard-item'}}" bindtap="doSelStandard" data-index="{{index}}" data-item="{{item}}">
|
||||
<image src="{{imgUrl+item.goodsItemIcon}}" mode="aspectFill"></image>
|
||||
<view class="name">{{item.goodsItemName}}</view>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 详情 -->
|
||||
<view class="desc-box">
|
||||
<view class="title-item">
|
||||
<view class="line"></view>
|
||||
<view class="title-name">详情</view>
|
||||
</view>
|
||||
<!-- 参数 -->
|
||||
<view class="params-box">
|
||||
<block wx:for="{{detailBean.shopGoodsParameterList}}" wx:for-item="it" wx:for-index="i" wx:key="i">
|
||||
<view class="params-item">
|
||||
<view class="params-title">{{it.parameterName}}</view>
|
||||
<view class="params-content">{{it.shopGoodsParameterContent}}</view>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
<view class="desc-video" wx:if="{{detailBean.goodsVideo.length>0}}">
|
||||
<video style="width: 100%;" src="{{imgUrl+detailBean.goodsVideo}}" controls></video>
|
||||
</view>
|
||||
<rich-text class="desc-txt" nodes="{{detailBean.goodsSummary}}"></rich-text>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
<page-loading wx:else></page-loading>
|
||||
|
||||
<view class="bottom-box">
|
||||
<view class="bottom-content">
|
||||
<view class="bottom-price">
|
||||
<view class="price-icon">¥</view>
|
||||
<view class="price-content">{{currentStandard.goodsItemUnitPrice}}</view>
|
||||
</view>
|
||||
<view class="icon-btn">
|
||||
<view class="car-icon">
|
||||
<view class="car">
|
||||
<image src="/subpages/images/ic_shop_car_icon.png" mode="aspectFill"></image>
|
||||
<view class="car-num ">{{carList.length}}</view>
|
||||
</view>
|
||||
<view>购物车</view>
|
||||
</view>
|
||||
<view class="car-add">添加购物车</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
296
subpages/goodsdetail/goodsdetail.wxss
Normal file
296
subpages/goodsdetail/goodsdetail.wxss
Normal file
@ -0,0 +1,296 @@
|
||||
/* subpages/goodsdetail/goodsdetail.wxss */
|
||||
page {
|
||||
background: #f2f2f2;
|
||||
}
|
||||
|
||||
.container-box {
|
||||
width: 100%;
|
||||
height: auto;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
margin-bottom: 150rpx;
|
||||
}
|
||||
|
||||
.banner {
|
||||
height: 500rpx;
|
||||
}
|
||||
|
||||
.banner image {
|
||||
width: 100%;
|
||||
height: 500rpx;
|
||||
}
|
||||
|
||||
|
||||
.goods-type {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
margin-top: 10rpx;
|
||||
|
||||
}
|
||||
|
||||
.name-box {
|
||||
padding: 30rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
box-shadow: 10rpx 5rpx 10rpx #dfdfdf;
|
||||
background: white;
|
||||
margin: 20rpx;
|
||||
border-radius: 10rpx;
|
||||
}
|
||||
|
||||
.type-box {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: flex-start;
|
||||
align-content: center;
|
||||
}
|
||||
|
||||
.type-item {
|
||||
background: #f2f2f2;
|
||||
color: #e70606;
|
||||
padding: 10rpx;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
|
||||
.type-item:nth-of-type(n+2) {
|
||||
margin-left: 20rpx;
|
||||
}
|
||||
|
||||
.goods-name {
|
||||
font-size: 32rpx;
|
||||
color: black;
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
|
||||
.shop-name {
|
||||
margin-top: 20rpx;
|
||||
font-size: 28rpx;
|
||||
color: gray;
|
||||
}
|
||||
|
||||
.standard-box {
|
||||
padding: 30rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
box-shadow: 10rpx 5rpx 10rpx #dfdfdf;
|
||||
background: white;
|
||||
margin: 20rpx;
|
||||
border-radius: 10rpx;
|
||||
}
|
||||
|
||||
.title-item {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.line {
|
||||
height: 30rpx;
|
||||
width: 10rpx;
|
||||
background: #e70606;
|
||||
}
|
||||
|
||||
.title-name {
|
||||
margin-left: 30rpx;
|
||||
}
|
||||
|
||||
.standard-content {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
}
|
||||
|
||||
.standard-item {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
border: 1rpx solid #dfdfdf;
|
||||
border-radius: 3rpx;
|
||||
margin: 10rpx;
|
||||
text-align: center;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
padding: 0rpx 0rpx 0rpx 5rpx;
|
||||
}
|
||||
|
||||
.name {
|
||||
text-align: center;
|
||||
margin: 0rpx 20rpx;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
|
||||
.standard-item image {
|
||||
width: 48rpx;
|
||||
height: 48rpx;
|
||||
}
|
||||
|
||||
.standard-item-sel {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
border: 1rpx solid #e70606;
|
||||
border-radius: 3rpx;
|
||||
margin: 10rpx;
|
||||
text-align: center;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
padding: 0rpx 0rpx 0rpx 5rpx;
|
||||
}
|
||||
|
||||
.standard-item-sel image {
|
||||
width: 48rpx;
|
||||
height: 48rpx;
|
||||
}
|
||||
|
||||
.desc-box {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
margin: 20rpx;
|
||||
box-shadow: 10rpx 5rpx 10rpx #dfdfdf;
|
||||
background: white;
|
||||
padding: 30rpx;
|
||||
}
|
||||
|
||||
.desc-video {
|
||||
margin-top: 20rpx;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.desc-img {
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
|
||||
.desc-txt {
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
|
||||
.bottom-box {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
background: white;
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
|
||||
}
|
||||
|
||||
.bottom-content {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin: 25rpx;
|
||||
}
|
||||
|
||||
.bottom-price {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: flex-start;
|
||||
align-items: baseline;
|
||||
color: #e70606;
|
||||
text-align: center;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.price-icon {
|
||||
font-size: 30rpx;
|
||||
}
|
||||
|
||||
.price-content {
|
||||
font-size: 55rpx;
|
||||
}
|
||||
|
||||
|
||||
.icon-btn {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.car-icon {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 30rpx;
|
||||
}
|
||||
|
||||
.car-icon image {
|
||||
width: 48rpx;
|
||||
height: 48rpx;
|
||||
align-items: center;
|
||||
align-self: center;
|
||||
margin-left: 25rpx;
|
||||
margin-top: 10rpx;
|
||||
}
|
||||
|
||||
.car {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.car-num {
|
||||
position: relative;
|
||||
right: 10rpx;
|
||||
top: -10rpx;
|
||||
background: #e70606;
|
||||
color: white;
|
||||
width: 48rpx;
|
||||
height: 48rpx;
|
||||
border-radius: 50%;
|
||||
text-align: center;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
font-size: 25rpx;
|
||||
}
|
||||
|
||||
.car-add {
|
||||
background: linear-gradient(to right bottom, rgb(245, 74, 74), rgb(221, 5, 5) 70px);
|
||||
color: white;
|
||||
padding: 15rpx;
|
||||
border-radius: 10rpx;
|
||||
margin-left: 20rpx;
|
||||
font-size: 32rpx;
|
||||
}
|
||||
|
||||
.params-box {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
|
||||
.params-item {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.params-item:first-child {
|
||||
border: 1rpx solid #6e6e6e;
|
||||
}
|
||||
|
||||
.params-item:nth-of-type(n+2) {
|
||||
border-bottom: 1rpx solid #6e6e6e;
|
||||
border-left: 1rpx solid #6e6e6e;
|
||||
border-right: 1rpx solid #6e6e6e;
|
||||
}
|
||||
|
||||
.params-title {
|
||||
width: 40%;
|
||||
border-right: 1rpx solid #6e6e6e;
|
||||
padding: 5rpx;
|
||||
text-align: center;
|
||||
font-size: 32rpx;
|
||||
}
|
||||
|
||||
.params-content {
|
||||
width: 60%;
|
||||
text-align: center;
|
||||
font-size: 32rpx;
|
||||
padding: 5rpx;
|
||||
}
|
@ -24,6 +24,14 @@ Page({
|
||||
})
|
||||
this.getGoodsList();
|
||||
},
|
||||
inputKeywords(event) {
|
||||
this.setData({
|
||||
keywords: event.detail.value
|
||||
})
|
||||
},
|
||||
doSearch() {
|
||||
wx.startPullDownRefresh()
|
||||
},
|
||||
getGoodsList() {
|
||||
var _self = this
|
||||
var info = {
|
||||
@ -69,5 +77,10 @@ Page({
|
||||
page: _self.data.page += 1
|
||||
})
|
||||
_self.getGoodsList()
|
||||
},
|
||||
goDetail(e) {
|
||||
wx.navigateTo({
|
||||
url: '/subpages/goodsdetail/goodsdetail?id=' + e.currentTarget.dataset.id,
|
||||
})
|
||||
}
|
||||
})
|
@ -1,14 +1,14 @@
|
||||
<!--pages/goodslist/goodslist.wxml-->
|
||||
<view wx:if="{{hidePageLoading}}">
|
||||
<view class="search-box">
|
||||
<input placeholder="请输入要查询的关键字" />
|
||||
<view class="btn">搜索</view>
|
||||
<input placeholder="请输入要查询的关键字" bindinput="inputKeywords" type="text" bindconfirm="doSearch" />
|
||||
<view class="btn" bindtap="doSearch">搜索</view>
|
||||
</view>
|
||||
<view class="container-box">
|
||||
<view class="goods-item" wx:for="{{goodsList}}" wx:for-item="item" wx:for-index="index" wx:key="index">
|
||||
<image src="{{imgUrl+item.goodsIcon}}"></image>
|
||||
<view class="goods-item" wx:for="{{goodsList}}" wx:for-item="item" wx:for-index="index" wx:key="index" bindtap="goDetail" data-id="{{item.goodsId}}">
|
||||
<image src="{{item.goodsIcon=='' ? '/images/address.png' : imgUrl+item.goodsIcon}}"></image>
|
||||
<view class="goods-content">
|
||||
<view class="goods-name">{{item.goodsName}}</view>
|
||||
<rich-text class="goods-name" nodes="{{item.goodsName}}"></rich-text>
|
||||
<view class="goods-price">¥ {{item.goodsPrice}}</view>
|
||||
<view class="goods-type">
|
||||
<view class="type-item">销量:{{item.goodsSalesVolume}}</view>
|
||||
|
BIN
subpages/images/ic_goods_type_default.png
Normal file
BIN
subpages/images/ic_goods_type_default.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.0 KiB |
BIN
subpages/images/ic_shop_car_icon.png
Normal file
BIN
subpages/images/ic_shop_car_icon.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 685 B |
Loading…
Reference in New Issue
Block a user