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
......@@ -39,7 +39,7 @@ Page({
},
getCommentList() {
let that = this;
util.request(api.CommentList, { valueId: that.data.id, typeId: 1, showType: 0, page: 1, size: 5 }).then(function (res) {
util.request(api.CommentList, { valueId: that.data.id, type: 1, showType: 0, page: 1, size: 5 }).then(function (res) {
if (res.errno === 0) {
that.setData({
......@@ -55,7 +55,7 @@ Page({
}
else {
wx.navigateTo({
url: '/pages/topicCommentPost/topicCommentPost?valueId=' + this.data.id + '&typeId=1',
url: '/pages/topicCommentPost/topicCommentPost?valueId=' + this.data.id + '&type=1',
})
}
},
......
......@@ -26,7 +26,7 @@
</view>
</view>
<view class="load" wx:if="{{commentCount > 5}}">
<navigator url="/pages/topicComment/topicComment?valueId={{topic.id}}&typeId=1">查看更多</navigator>
<navigator url="/pages/topicComment/topicComment?valueId={{topic.id}}&type=1">查看更多</navigator>
</view>
</view>
<view class="no-comments" wx:if="{{commentList.length <= 0}}">
......@@ -42,7 +42,7 @@
</view>
<view class="b">
<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>
<text class="title">{{item.title}}</text>
</navigator>
</view>
......
......@@ -287,7 +287,7 @@ Page({
return false;
}
if (!check.isValidPhone(this.data.mobile)) {
if (!check.isValidPhone(address.mobile)) {
util.showErrorToast('手机号不正确');
return false;
}
......
......@@ -5,7 +5,7 @@ var app = getApp();
Page({
data: {
typeId: 0,
type: 0,
collectList: [],
page: 1,
size: 10,
......@@ -16,7 +16,7 @@ Page({
title: '加载中...',
});
let that = this;
util.request(api.CollectList, { typeId: that.data.typeId, page: that.data.page, size: that.data.size }).then(function (res) {
util.request(api.CollectList, { type: that.data.type, page: that.data.page, size: that.data.size }).then(function (res) {
if (res.errno === 0) {
that.setData({
collectList: that.data.collectList.concat(res.data.collectList),
......@@ -60,7 +60,8 @@ Page({
openGoods(event) {
let that = this;
let goodsId = this.data.collectList[event.currentTarget.dataset.index].valueId;
let index = event.currentTarget.dataset.index;
let goodsId = this.data.collectList[index].valueId;
//触摸时间距离页面打开的毫秒数
var touchTime = that.data.touchEnd - that.data.touchStart;
......@@ -73,7 +74,7 @@ Page({
success: function (res) {
if (res.confirm) {
util.request(api.CollectAddOrDelete, { typeId: that.data.typeId, valueId: goodsId}, 'POST').then(function (res) {
util.request(api.CollectAddOrDelete, { type: that.data.type, valueId: goodsId}, 'POST').then(function (res) {
if (res.errno === 0) {
console.log(res.data);
wx.showToast({
......@@ -81,7 +82,10 @@ Page({
icon: 'success',
duration: 2000
});
that.getCollectList();
that.data.collectList.splice(index, 1)
that.setData({
collectList: that.data.collectList
});
}
});
}
......
......@@ -7,10 +7,10 @@
</view>
<view class="collect-list" wx:else>
<view class="item" bindtap="openGoods" bindtouchstart="touchStart" bindtouchend="touchEnd" wx:for="{{collectList}}" wx:key="id" data-index="{{index}}">
<image class="img" src="{{item.listPicUrl}}"></image>
<image class="img" src="{{item.picUrl}}"></image>
<view class="info">
<view class="name">{{item.name}}</view>
<view class="subtitle">{{item.goodsBrief}}</view>
<view class="subtitle">{{item.brief}}</view>
<view class="price">¥{{item.retailPrice}}</view>
</view>
</view>
......
......@@ -41,7 +41,9 @@ Page({
},
deleteItem (event){
let that = this;
let footprint = event.currentTarget.dataset.footprint;
let index = event.currentTarget.dataset.index;
let iindex = event.currentTarget.dataset.iindex;
let goodsId = this.data.footprintList[index][iindex].id;
var touchTime = that.data.touchEnd - that.data.touchStart;
console.log(touchTime);
//如果按下时间大于350为长按
......@@ -51,15 +53,20 @@ Page({
content: '要删除所选足迹?',
success: function (res) {
if (res.confirm) {
util.request(api.FootprintDelete, { footprintId: footprint.id }, 'POST').then(function (res) {
util.request(api.FootprintDelete, { footprintId: goodsId }, 'POST').then(function (res) {
if (res.errno === 0) {
wx.showToast({
title: '删除成功',
icon: 'success',
duration: 2000
});
that.data.footprintList = [];
that.getFootprintList();
that.data.footprintList[index].splice(iindex, 1)
if (that.data.footprintList[index].length == 0){
that.data.footprintList.splice(index, 1)
}
that.setData({
footprintList: that.data.footprintList
});
}
});
}
......@@ -67,7 +74,7 @@ Page({
});
} else {
wx.navigateTo({
url: '/pages/goods/goods?id=' + footprint.goodsId,
url: '/pages/goods/goods?id=' + goodsId,
});
}
......
......@@ -6,14 +6,14 @@
</view>
</view>
<view class="footprint" wx:if="{{footprintList.length > 0}}">
<view class="day-item" wx:for="{{footprintList}}" wx:key="*this">
<view class="day-item" wx:for="{{footprintList}}" wx:key="*this" wx:for-index="index">
<view class="day-hd" wx:if="{{item.length > 0}}">{{item[0].addTime}}</view>
<view class="day-list" wx:if="{{item.length > 0}}">
<view class="item" data-footprint="{{iitem}}" bindtouchstart="touchStart" bindtouchend="touchEnd" bindtap="deleteItem" wx:for="{{item}}" wx:for-item="iitem" wx:key="id">
<image class="img" src="{{iitem.listPicUrl}}"></image>
<view class="item" data-index="{{index}}" data-iindex="{{iindex}}" bindtouchstart="touchStart" bindtouchend="touchEnd" bindtap="deleteItem" wx:for="{{item}}" wx:for-index="iindex" wx:for-item="iitem" wx:key="id">
<image class="img" src="{{iitem.picUrl}}"></image>
<view class="info">
<view class="name">{{iitem.name}}</view>
<view class="subtitle">{{iitem.goodsBrief}}</view>
<view class="subtitle">{{iitem.brief}}</view>
<view class="price">¥{{iitem.retailPrice}}</view>
</view>
</view>
......
......@@ -24,7 +24,7 @@
</view>
<view class="orders">
<navigator url="../orderDetail/orderDetail?id={{item.id}}" class="order" wx:for="{{orderList}}" wx:key="id">
<navigator url="../orderDetail/orderDetail?id={{item.id}}" class="order" open-type="redirect" wx:for="{{orderList}}" wx:key="id">
<view class="h">
<view class="l">订单编号:{{item.orderSn}}</view>
<view class="r">{{item.orderStatusText}}</view>
......
......@@ -32,7 +32,7 @@
<view class="attr">{{item.goodsSpecificationValues}}</view>
<view class="price">¥{{item.retailPrice}}</view>
<view class="btn active" wx:if="{{handleOption.comment}}">
<navigator url="../../commentPost/commentPost?orderId={{item.orderId}}&&valueId={{item.goodsId}}&typeId=0">去评价</navigator>
<navigator url="../../commentPost/commentPost?orderId={{item.orderId}}&&valueId={{item.goodsId}}&type=0">去评价</navigator>
</view>
<view class="btn active" wx:if="{{handleOption.rebuy}}">
<navigator url="../../goods/goods?id={{item.goodsId}}">再次购买</navigator>
......
......@@ -52,13 +52,13 @@
"id": -1,
"name": "专题评论列表",
"pathName": "pages/topicComment/topicComment",
"query": "valueId=314&typeId=1"
"query": "valueId=314&type=1"
},
{
"id": -1,
"name": "专题评论添加",
"pathName": "pages/topicCommentPost/topicCommentPost",
"query": "valueId=314&typeId=1"
"query": "valueId=314&type=1"
},
{
"id": -1,
......@@ -112,7 +112,7 @@
"id": -1,
"name": "商品评论列表",
"pathName": "pages/comment/comment",
"query": "valueId=1181000&typeId=0"
"query": "valueId=1181000&type=0"
},
{
"id": -1,
......@@ -163,16 +163,16 @@
"query": "id=1"
},
{
"id": -1,
"id": 22,
"name": "待评价的订单详情",
"pathName": "pages/ucenter/orderDetail/orderDetail",
"query": "id=24"
"query": "id=1"
},
{
"id": -1,
"name": "购买商品评价",
"pathName": "pages/commentPost/commentPost",
"query": "orderId=2&typeId=0&valueId=1116011"
"query": "orderId=2&type=0&valueId=1116011"
},
{
"id": -1,
......
......@@ -36,7 +36,7 @@ function request(url, data = {}, method = "GET") {
if (res.statusCode == 200) {
if (res.data.errno == 401) {
if (res.data.errno == 501) {
// 清除登录相关内容
try {
wx.removeStorageSync('userInfo');
......
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