Unverified Commit b68151cb authored by Menethil's avatar Menethil Committed by GitHub
Browse files

Merge pull request #1 from linlinjava/master

update
parents 126d027a 02679509
......@@ -33,7 +33,7 @@
</view>
<view class="attr">{{ isEditCart ? '已选择:' : ''}}{{item.goodsSpecificationValues||''}}</view>
<view class="b">
<text class="price">¥{{item.retailPrice}}</text>
<text class="price">¥{{item.price}}</text>
<view class="selnum">
<view class="cut" bindtap="cutNumber" data-item-index="{{index}}">-</view>
<input value="{{item.number}}" class="number" disabled="true" type="number" />
......
......@@ -11,7 +11,7 @@
</scroll-view>
<scroll-view class="cate" scroll-y="true">
<navigator url="url" class="banner">
<image class="image" src="{{currentCategory.wapBannerUrl}}"></image>
<image class="image" src="{{currentCategory.picUrl}}"></image>
<view class="txt">{{currentCategory.frontName}}</view>
</navigator>
<view class="hd">
......@@ -21,7 +21,7 @@
</view>
<view class="bd">
<navigator url="/pages/category/category?id={{item.id}}" class="item {{(index+1) % 3 == 0 ? 'last' : ''}}" wx:key="id" wx:for="{{currentSubCategoryList}}">
<image class="icon" src="{{item.wapBannerUrl}}"></image>
<image class="icon" src="{{item.picUrl}}"></image>
<text class="txt">{{item.name}}</text>
</navigator>
</view>
......
......@@ -15,7 +15,7 @@
</view>
<view class="b">
<navigator class="item {{(iindex + 1) % 2 == 0 ? 'item-b' : ''}}" url="/pages/goods/goods?id={{iitem.id}}" wx:for="{{goodsList}}" wx:key="id" wx:for-item="iitem" wx:for-index="iindex" >
<image class="img" src="{{iitem.listPicUrl}}" background-size="cover"></image>
<image class="img" src="{{iitem.picUrl}}" background-size="cover"></image>
<text class="name">{{iitem.name}}</text>
<text class="price">¥{{iitem.retailPrice}}</text>
</navigator>
......
......@@ -7,7 +7,7 @@ Page({
comments: [],
allCommentList: [],
picCommentList: [],
typeId: 0,
type: 0,
valueId: 0,
showType: 0,
allCount: 0,
......@@ -18,7 +18,7 @@ Page({
},
getCommentCount: function () {
let that = this;
util.request(api.CommentCount, { valueId: that.data.valueId, typeId: that.data.typeId}).then(function (res) {
util.request(api.CommentCount, { valueId: that.data.valueId, type: that.data.type}).then(function (res) {
if (res.errno === 0) {
that.setData({
allCount: res.data.allCount,
......@@ -31,7 +31,7 @@ Page({
let that = this;
util.request(api.CommentList, {
valueId: that.data.valueId,
typeId: that.data.typeId,
type: that.data.type,
size: that.data.size,
page: (that.data.showType == 0 ? that.data.allPage : that.data.picPage),
showType: that.data.showType
......@@ -57,7 +57,7 @@ Page({
onLoad: function (options) {
// 页面初始化 options为页面跳转所带来的参数
this.setData({
typeId: options.typeId,
type: options.type,
valueId: options.valueId
});
this.getCommentCount();
......
......@@ -5,7 +5,7 @@ var api = require('../../config/api.js');
Page({
data: {
orderId: 0,
typeId: 0,
type: 0,
valueId: 0,
orderGoods: {},
content: '',
......@@ -102,7 +102,7 @@ Page({
var that = this;
that.setData({
orderId: options.orderId,
typeId: options.typeId,
type: options.type,
valueId: options.valueId
});
this.getOrderComment();
......@@ -131,7 +131,7 @@ Page({
}
util.request(api.CommentPost, {
typeId: that.data.typeId,
type: that.data.type,
valueId: that.data.valueId,
content: that.data.content,
star: that.data.star,
......
......@@ -40,7 +40,7 @@ Page({
// 如果仅仅存在一种货品,那么商品价格应该和货品价格一致
// 这里检测一下
let _productPrice = res.data.productList[0].retailPrice;
let _productPrice = res.data.productList[0].price;
let _goodsPrice = res.data.info.retailPrice;
if (_productPrice != _goodsPrice){
console.error('商品数量价格和货品不一致');
......@@ -75,7 +75,7 @@ Page({
});
}
WxParse.wxParse('goodsDetail', 'html', res.data.info.goodsDesc, that);
WxParse.wxParse('goodsDetail', 'html', res.data.info.desc, that);
that.getGoodsRelated();
}
......@@ -161,7 +161,7 @@ Page({
},
getCheckedSpecKey: function () {
let checkedValue = this.getCheckedSpecValue().map(function (v) {
return v.valueId;
return v.valueText;
});
return checkedValue;
......@@ -206,9 +206,9 @@ Page({
}
let checkedProduct = checkedProductArray[0];
if (checkedProduct.goodsNumber > 0){
if (checkedProduct.number > 0){
this.setData({
checkedSpecPrice: checkedProduct.retailPrice,
checkedSpecPrice: checkedProduct.price,
soldout: false
});
}
......@@ -231,7 +231,7 @@ Page({
},
getCheckedProductItem: function (key) {
return this.data.productList.filter(function (v) {
if (v.goodsSpecificationIds.toString() == key.toString()) {
if (v.specifications.toString() == key.toString()) {
return true;
} else {
return false;
......@@ -293,7 +293,7 @@ Page({
}
} else {
//添加或是取消收藏
util.request(api.CollectAddOrDelete, { typeId: 0, valueId: this.data.id }, "POST")
util.request(api.CollectAddOrDelete, { type: 0, valueId: this.data.id }, "POST")
.then(function (res) {
let _res = res;
if (_res.errno == 0) {
......@@ -354,7 +354,7 @@ Page({
let checkedProduct = checkedProductArray[0];
//验证库存
if (checkedProduct.goodsNumber <= 0) {
if (checkedProduct.number <= 0) {
wx.showToast({
image: '/static/images/icon_error.png',
title: '没有库存'
......@@ -420,7 +420,7 @@ Page({
let checkedProduct = checkedProductArray[0];
//验证库存
if (checkedProduct.goodsNumber <= 0) {
if (checkedProduct.number <= 0) {
wx.showToast({
image: '/static/images/icon_error.png',
title: '没有库存'
......
......@@ -28,7 +28,7 @@
</view>
<view class="comments" wx:if="{{comment.count > 0}}">
<view class="h">
<navigator url="/pages/comment/comment?valueId={{goods.id}}&typeId=0">
<navigator url="/pages/comment/comment?valueId={{goods.id}}&type=0">
<text class="t">评价({{comment.count > 999 ? '999+' : comment.count}})</text>
<text class="i">查看全部</text>
</navigator>
......@@ -54,8 +54,8 @@
<view class="goods-attr">
<view class="t">商品参数</view>
<view class="l">
<view class="item" wx:for="{{attribute}}" wx:key="name">
<text class="left">{{item.name}}</text>
<view class="item" wx:for="{{attribute}}" wx:key="item">
<text class="left">{{item.attribute}}</text>
<text class="right">{{item.value}}</text>
</view>
</view>
......@@ -92,7 +92,7 @@
<view class="b">
<view class="item" wx:for="{{relatedGoods}}" wx:key="id">
<navigator url="/pages/goods/goods?id={{item.id}}">
<image class="img" src="{{item.listPicUrl}}" background-size="cover"></image>
<image class="img" src="{{item.picUrl}}" background-size="cover"></image>
<text class="name">{{item.name}}</text>
<text class="price">¥{{item.retailPrice}}</text>
</navigator>
......@@ -102,7 +102,7 @@
</view>
<view wx:if="{{openAttr}}" class="attr-pop">
<view class="img-info">
<image class="img" src="{{goods.primaryPicUrl}}"></image>
<image class="img" src="{{goods.picUrl}}"></image>
<view class="info">
<view class="c">
<view class="p">价格:¥{{checkedSpecPrice}}</view>
......
......@@ -13,6 +13,7 @@ Page({
goodsList: [],
categoryId: 0,
currentSortType: 'default',
currentSort: 'add_time',
currentSortOrder: 'desc',
page: 1,
size: 100
......@@ -42,7 +43,7 @@ Page({
getGoodsList: function (){
var that = this;
util.request(api.GoodsList, { isHot: 1, page: that.data.page, size: that.data.size, order: that.data.currentSortOrder, sort: that.data.currentSortType, categoryId: that.data.categoryId})
util.request(api.GoodsList, { isHot: true, page: that.data.page, size: that.data.size, order: that.data.currentSortOrder, sort: that.data.currentSort, categoryId: that.data.categoryId})
.then(function (res) {
if (res.errno === 0) {
that.setData({
......@@ -80,7 +81,8 @@ Page({
this.setData({
categoryFilter: !this.data.categoryFilter,
currentSortType: 'category',
currentSortOrder: 'asc'
currentSort: 'add_time',
currentSortOrder: 'desc'
});
break;
case 'priceSort':
......@@ -90,6 +92,7 @@ Page({
}
this.setData({
currentSortType: 'price',
currentSort: 'retail_price',
currentSortOrder: tmpSortOrder,
categoryFilter: false
});
......@@ -100,6 +103,7 @@ Page({
//综合排序
this.setData({
currentSortType: 'default',
currentSort: 'add_time',
currentSortOrder: 'desc',
categoryFilter: false,
categoryId: 0,
......
......@@ -30,7 +30,7 @@
<view class="b">
<block wx:for="{{goodsList}}" wx:for-index="iindex" wx:for-item="iitem" wx:key="id">
<navigator class="item {{iindex % 2 == 0 ? 'item-b' : '' }}" url="../goods/goods?id={{iitem.id}}">
<image class="img" src="{{iitem.listPicUrl}}" background-size="cover"></image>
<image class="img" src="{{iitem.picUrl}}" background-size="cover"></image>
<text class="name">{{iitem.name}}</text>
<text class="price">¥{{iitem.retailPrice}}</text>
</navigator>
......
......@@ -46,7 +46,7 @@
<view class="b">
<view class="item" wx:for="{{newGoods}}" wx:for-index="index" wx:for-item="item" wx:key="id">
<navigator url="../goods/goods?id={{item.id}}">
<image class="img" src="{{item.listPicUrl}}" background-size="cover"></image>
<image class="img" src="{{item.picUrl}}" background-size="cover"></image>
<text class="name">{{item.name}}</text>
<text class="price">¥{{item.retailPrice}}</text>
</navigator>
......@@ -64,11 +64,11 @@
<view class="b">
<view class="item" wx:for="{{hotGoods}}" wx:for-index="index" wx:for-item="item" wx:key="id">
<navigator url="/pages/goods/goods?id={{item.id}}">
<image class="img" src="{{item.listPicUrl}}" background-size="cover"></image>
<image class="img" src="{{item.picUrl}}" background-size="cover"></image>
<view class="right">
<view class="text">
<text class="name">{{item.name}}</text>
<text class="desc">{{item.goods_brief}}</text>
<text class="desc">{{item.brief}}</text>
<text class="price">¥{{item.retailPrice}}</text>
</view>
</view>
......@@ -88,10 +88,10 @@
<scroll-view scroll-x class="list">
<view class="item" wx:for="{{topics}}" wx:for-index="index" wx:for-item="item" wx:key="id">
<navigator url="../topicDetail/topicDetail?id={{item.id}}">
<image class="img" src="{{item.scenePicUrl}}" background-size="cover"></image>
<image class="img" src="{{item.picUrl}}" background-size="cover"></image>
<view class="np">
<text class="name">{{item.title}}</text>
<text class="price">¥{{item.priceInfo}}元起</text>
<text class="price">¥{{item.price}}元起</text>
</view>
<text class="desc">{{item.subtitle}}</text>
</navigator>
......@@ -109,7 +109,7 @@
<block wx:for="{{item.goodsList}}" wx:for-index="iindex" wx:for-item="iitem" wx:key="id">
<view class="item {{iindex % 2 == 0 ? '' : 'item-b'}}">
<navigator url="../goods/goods?id={{iitem.id}}" class="a">
<image class="img" src="{{iitem.listPicUrl}}" background-size="cover"></image>
<image class="img" src="{{iitem.picUrl}}" background-size="cover"></image>
<text class="name">{{iitem.name}}</text>
<text class="price">¥{{iitem.retailPrice}}</text>
</navigator>
......
......@@ -96,12 +96,12 @@
display: block;
font-size: 33rpx;
height: 43rpx;
color: #333;
color: #fff;
}
.a-brand .mt .price, .a-brand .mt .unit {
font-size: 25rpx;
color: #999;
color: #fff;
}
.a-brand .item-1 {
......
......@@ -13,6 +13,7 @@ Page({
goodsList: [],
categoryId: 0,
currentSortType: 'default',
currentSort: 'add_time',
currentSortOrder: 'desc',
page: 1,
size: 100
......@@ -30,7 +31,7 @@ Page({
getGoodsList: function() {
var that = this;
util.request(api.GoodsList, { isNew: 1, page: that.data.page, size: that.data.size, order: that.data.currentSortOrder, sort: that.data.currentSortType, categoryId: that.data.categoryId })
util.request(api.GoodsList, { isNew: true, page: that.data.page, size: that.data.size, order: that.data.currentSortOrder, sort: that.data.currentSort, categoryId: that.data.categoryId })
.then(function (res) {
if (res.errno === 0) {
that.setData({
......@@ -67,7 +68,8 @@ Page({
this.setData({
categoryFilter: !this.data.categoryFilter,
currentSortType: 'category',
currentSortOrder: 'asc'
currentSort: 'add_time',
currentSortOrder: 'desc'
});
break;
case 'priceSort':
......@@ -77,6 +79,7 @@ Page({
}
this.setData({
currentSortType: 'price',
currentSort: 'retail_price',
currentSortOrder: tmpSortOrder,
categoryFilter: false
});
......@@ -87,6 +90,7 @@ Page({
//综合排序
this.setData({
currentSortType: 'default',
currentSort: 'add_time',
currentSortOrder: 'desc',
categoryFilter: false,
categoryId: 0
......
......@@ -30,7 +30,7 @@
<view class="b">
<block wx:for="{{goodsList}}" wx:for-index="iindex" wx:for-item="iitem" wx:key="id">
<navigator class="item {{iindex % 2 == 0 ? 'item-b' : '' }}" url="../goods/goods?id={{iitem.id}}">
<image class="img" src="{{iitem.listPicUrl}}" background-size="cover"></image>
<image class="img" src="{{iitem.picUrl}}" background-size="cover"></image>
<text class="name">{{iitem.name}}</text>
<text class="price">¥{{iitem.retailPrice}}</text>
</navigator>
......
......@@ -287,7 +287,7 @@ Page({
return false;
}
if (!check.isValidPhone(this.data.mobile)) {
if (!check.isValidPhone(address.mobile)) {
util.showErrorToast('手机号不正确');
return false;
}
......
......@@ -162,6 +162,11 @@ Page({
}
});
}
else{
wx.redirectTo({
url: '/pages/payResult/payResult?status=0&orderId=' + orderId
});
}
});
} else {
......
......@@ -72,8 +72,8 @@
<text class="name">{{item.goodsName}}</text>
<text class="number">x{{item.number}}</text>
</view>
<view class="m">{{item.goodsSpecificationValues}}</view>
<view class="b">¥{{item.retailPrice}}</view>
<view class="m">{{item.specifications}}</view>
<view class="b">¥{{item.price}}</view>
</view>
</view>
</view>
......
<view class="container">
<scroll-view class="topic-list" scroll-y="true" scroll-top="{{scrollTop}}">
<navigator class="item" wx:for="{{topicList}}" wx:key="id" url="../topicDetail/topicDetail?id={{item.id}}">
<image class="img" src="{{item.scenePicUrl}}"></image>
<image class="img" src="{{item.picUrl}}"></image>
<view class="info">
<text class="title">{{item.title}}</text>
<text class="desc">{{item.subtitle}}</text>
<text class="price">{{item.priceInfo}}元起</text>
<text class="price">{{item.price}}元起</text>
</view>
</navigator>
<view class="page" wx:if="{{showPage}}">
......
......@@ -8,7 +8,7 @@ Page({
comments: [],
allCommentList: [],
picCommentList: [],
typeId: 0,
type: 0,
valueId: 0,
showType: 0,
allCount: 0,
......@@ -19,7 +19,7 @@ Page({
},
getCommentCount: function () {
let that = this;
util.request(api.CommentCount, { valueId: that.data.valueId, typeId: that.data.typeId}).then(function (res) {
util.request(api.CommentCount, { valueId: that.data.valueId, type: that.data.type}).then(function (res) {
if (res.errno === 0) {
that.setData({
......@@ -33,7 +33,7 @@ Page({
let that = this;
util.request(api.CommentList, {
valueId: that.data.valueId,
typeId: that.data.typeId,
type: that.data.type,
size: that.data.size,
page: (that.data.showType == 0 ? that.data.allPage : that.data.picPage),
showType: that.data.showType
......@@ -59,7 +59,7 @@ Page({
onLoad: function (options) {
// 页面初始化 options为页面跳转所带来的参数
this.setData({
typeId: options.typeId,
type: options.type,
valueId: options.valueId
});
this.getCommentCount();
......
......@@ -97,7 +97,7 @@ Page({
},
onLoad: function (options) {
if (parseInt(options.typeId) !== 1){
if (parseInt(options.type) !== 1){
return;
}
......@@ -131,7 +131,7 @@ Page({
}
util.request(api.CommentPost, {
typeId: 1,
type: 1,
valueId: that.data.valueId,
content: that.data.content,
star: that.data.star,
......
......@@ -2,7 +2,7 @@
<view class="post-comment">
<view class="goods">
<view class="img">
<image src="{{topic.scenePicUrl}}"></image>
<image src="{{topic.picUrl}}"></image>
</view>
<view class="info">
<view class="t">
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment