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