Commit c4f48302 authored by Menethil's avatar Menethil
Browse files

Merge remote-tracking branch 'origin/master'

parents 8f75afed c82046b7
...@@ -38,4 +38,4 @@ export function deleteFeedback(data) { ...@@ -38,4 +38,4 @@ export function deleteFeedback(data) {
method: 'post', method: 'post',
data data
}) })
} }
\ No newline at end of file
...@@ -65,8 +65,8 @@ export const asyncRouterMap = [ ...@@ -65,8 +65,8 @@ export const asyncRouterMap = [
{ path: 'address', component: _import('user/address'), name: 'address', meta: { title: '收货地址', noCache: true }}, { path: 'address', component: _import('user/address'), name: 'address', meta: { title: '收货地址', noCache: true }},
{ path: 'collect', component: _import('user/collect'), name: 'collect', meta: { title: '会员收藏', noCache: true }}, { path: 'collect', component: _import('user/collect'), name: 'collect', meta: { title: '会员收藏', noCache: true }},
{ path: 'footprint', component: _import('user/footprint'), name: 'footprint', meta: { title: '会员足迹', noCache: true }}, { path: 'footprint', component: _import('user/footprint'), name: 'footprint', meta: { title: '会员足迹', noCache: true }},
{ path: 'history', component: _import('user/history'), name: 'history', meta: { title: '搜索历史', noCache: true }} { path: 'history', component: _import('user/history'), name: 'history', meta: { title: '搜索历史', noCache: true }},
{ path: 'feedback', component: _import('user/feedback'), name: 'feedback', meta: { title: '意见反馈', noCache: true }} { path: 'feedback', component: _import('user/feedback'), name: 'feedback', meta: { title: '意见反馈', noCache: true }}
] ]
}, },
......
...@@ -49,12 +49,6 @@ ...@@ -49,12 +49,6 @@
<artifactId>weixin-java-miniapp</artifactId> <artifactId>weixin-java-miniapp</artifactId>
</dependency> </dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>1.2.45</version>
</dependency>
</dependencies> </dependencies>
<build> <build>
......
package org.linlinjava.litemall.wx.web; package org.linlinjava.litemall.wx.web;
import com.alibaba.fastjson.JSONObject; import org.linlinjava.litemall.core.util.JacksonUtil;
import org.linlinjava.litemall.core.util.RegexUtil; import org.linlinjava.litemall.core.util.RegexUtil;
import org.linlinjava.litemall.core.util.ResponseUtil; import org.linlinjava.litemall.core.util.ResponseUtil;
import org.linlinjava.litemall.db.domain.LitemallFeedback; import org.linlinjava.litemall.db.domain.LitemallFeedback;
...@@ -12,17 +12,11 @@ import org.apache.commons.logging.Log; ...@@ -12,17 +12,11 @@ import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import java.io.BufferedReader;
import java.io.IOException;
import java.time.LocalDateTime; import java.time.LocalDateTime;
/** /**
* @author Yogeek * @author Yogeek
* @date 2018/8/25 14:10 * @date 2018/8/25 14:10
...@@ -36,67 +30,33 @@ public class WxFeedbackController { ...@@ -36,67 +30,33 @@ public class WxFeedbackController {
@Autowired @Autowired
private LitemallFeedbackService feedbackService; private LitemallFeedbackService feedbackService;
@Autowired @Autowired
protected HttpServletRequest request;
@Autowired
private LitemallUserService userService; private LitemallUserService userService;
/** /**
* 意见反馈 * 意见反馈
*/ */
@PostMapping("submit") @PostMapping("submit")
@ResponseBody public Object submit(@LoginUser Integer userId, @RequestBody LitemallFeedback feedback) {
public Object save(@LoginUser Integer userId){ if (userId == null) {
if(userId == null){
return ResponseUtil.unlogin(); return ResponseUtil.unlogin();
} }
LitemallUser user = userService.findById(userId); // 测试手机号码是否正确
String username = user.getUsername(); if (!RegexUtil.isMobileExact(feedback.getMobile())) {
//获取客户端对象 return ResponseUtil.badArgument();
JSONObject feedbackJson = this.getJsonRequest();
if (null != feedbackJson) {
LitemallFeedback feedback = new LitemallFeedback();
String mobile = feedbackJson.getString("mobile");
// 测试手机号码是否正确
if (!RegexUtil.isMobileExact(mobile)) {
return ResponseUtil.badArgument();
}
String[] feedType = new String [] {"请选择反馈类型", "商品相关", "功能异常", "优化建议", "其他"};
int index = feedbackJson.getInteger("index");
String content = feedbackJson.getString("content");
feedback.setUserId(userId);
feedback.setUsername(username);
feedback.setMobile(mobile);
feedback.setAddTime(LocalDateTime.now());
feedback.setFeedType(feedType[index]);
//状态默认是0,1表示状态已发生变化
feedback.setStatus(1);
feedback.setContent(content);
feedbackService.add(feedback);
return ResponseUtil.ok("感谢您的反馈");
}
return ResponseUtil.badArgument();
}
private JSONObject getJsonRequest() {
JSONObject result = null;
StringBuilder sb = new StringBuilder();
try (BufferedReader reader = request.getReader();) {
char[] buff = new char[1024];
int len;
while ((len = reader.read(buff)) != -1) {
sb.append(buff, 0, len);
}
result = JSONObject.parseObject(sb.toString());
} catch (IOException e) {
e.printStackTrace();
} }
return result; LitemallUser user = userService.findById(userId);
String username = user.getUsername();
feedback.setId(null);
feedback.setUserId(userId);
feedback.setUsername(username);
feedback.setAddTime(LocalDateTime.now());
//状态默认是0,1表示状态已发生变化
feedback.setStatus(1);
feedbackService.add(feedback);
return ResponseUtil.ok();
} }
} }
// 以下是业务服务器API地址 // 以下是业务服务器API地址
// 本机开发时使用 // 本机开发时使用
var WxApiRoot = 'http://localhost:8080/wx/'; var WxApiRoot = 'http://localhost:8082/wx/';
// 局域网测试使用 // 局域网测试使用
// var WxApiRoot = 'http://192.168.0.101:8080/wx/'; // var WxApiRoot = 'http://192.168.0.101:8080/wx/';
// 云平台部署时使用 // 云平台部署时使用
// var WxApiRoot = 'http://122.152.206.172:8080/wx/'; // var WxApiRoot = 'http://122.152.206.172:8080/wx/';
// 云平台上线时使用 // 云平台上线时使用
// var WxApiRoot = 'https://www.menethil.com.cn/wx/'; //var WxApiRoot = 'https://www.menethil.com.cn/wx/';
module.exports = { module.exports = {
IndexUrl: WxApiRoot + 'home/index', //首页数据接口 IndexUrl: WxApiRoot + 'home/index', //首页数据接口
...@@ -75,6 +75,7 @@ module.exports = { ...@@ -75,6 +75,7 @@ module.exports = {
OrderConfirm: WxApiRoot + 'order/confirm', //确认收货 OrderConfirm: WxApiRoot + 'order/confirm', //确认收货
OrderComment: WxApiRoot + 'order/comment', // 代评价商品信息 OrderComment: WxApiRoot + 'order/comment', // 代评价商品信息
FeedbackAdd: WxApiRoot + 'feedback/submit', //添加反馈
FootprintList: WxApiRoot + 'footprint/list', //足迹列表 FootprintList: WxApiRoot + 'footprint/list', //足迹列表
FootprintDelete: WxApiRoot + 'footprint/delete', //删除足迹 FootprintDelete: WxApiRoot + 'footprint/delete', //删除足迹
......
...@@ -50,9 +50,12 @@ ...@@ -50,9 +50,12 @@
<view class="cart-bottom"> <view class="cart-bottom">
<view class="checkbox {{checkedAllStatus ? 'checked' : ''}}" bindtap="checkedAll">全选({{cartTotal.checkedGoodsCount}})</view> <view class="checkbox {{checkedAllStatus ? 'checked' : ''}}" bindtap="checkedAll">全选({{cartTotal.checkedGoodsCount}})</view>
<view class="total">{{!isEditCart ? '¥'+cartTotal.checkedGoodsAmount : ''}}</view> <view class="total">{{!isEditCart ? '¥'+cartTotal.checkedGoodsAmount : ''}}</view>
<view class="delete" bindtap="editCart">{{!isEditCart ? '编辑' : '完成'}}</view> <view class='action_btn_area'>
<view class="checkout" bindtap="deleteCart" wx:if="{{isEditCart}}">删除所选</view> <view class="{{!isEditCart ? 'edit' : 'sure'}}" bindtap="editCart">{{!isEditCart ? '编辑' : '完成'}}</view>
<view class="checkout" bindtap="checkoutOrder" wx:if="{{!isEditCart}}">下单</view> <view class="delete" bindtap="deleteCart" wx:if="{{isEditCart}}">删除({{cartTotal.checkedGoodsCount}})</view>
<view class="checkout" bindtap="checkoutOrder" wx:if="{{!isEditCart}}">下单</view>
<!-- </view> -->
</view>
</view> </view>
</view> </view>
</view> </view>
......
...@@ -5,646 +5,652 @@ var api = require('../../config/api.js'); ...@@ -5,646 +5,652 @@ var api = require('../../config/api.js');
var user = require('../../utils/user.js'); var user = require('../../utils/user.js');
Page({ Page({
data: { data: {
id: 0, id: 0,
goods: {}, goods: {},
groupon: [], //该商品支持的团购规格 groupon: [], //该商品支持的团购规格
grouponLink: {}, //参与的团购 grouponLink: {}, //参与的团购
attribute: [], attribute: [],
issueList: [], issueList: [],
comment: [], comment: [],
brand: {}, brand: {},
specificationList: [], specificationList: [],
productList: [], productList: [],
relatedGoods: [], relatedGoods: [],
cartGoodsCount: 0, cartGoodsCount: 0,
userHasCollect: 0, userHasCollect: 0,
number: 1, number: 1,
checkedSpecText: '规格数量选择', checkedSpecText: '规格数量选择',
tmpSpecText: '请选择规格数量', tmpSpecText: '请选择规格数量',
checkedSpecPrice: 0, checkedSpecPrice: 0,
openAttr: false, openAttr: false,
noCollectImage: '/static/images/icon_collect.png', openShare: false,
hasCollectImage: '/static/images/icon_collect_checked.png', noCollectImage: '/static/images/icon_collect.png',
collectImage: '/static/images/icon_collect.png', hasCollectImage: '/static/images/icon_collect_checked.png',
shareImage: '', collectImage: '/static/images/icon_collect.png',
isGroupon: false, //标识是否是一个参团购买 shareImage: '',
soldout: false isGroupon: false, //标识是否是一个参团购买
}, soldout: false
},
// 页面分享
onShareAppMessage: function() { // 页面分享
let that = this; onShareAppMessage: function() {
return { let that = this;
title: that.data.goods.name, return {
desc: '唯爱与美食不可辜负', title: that.data.goods.name,
path: '/pages/index/index?goodId=' + this.data.id desc: '唯爱与美食不可辜负',
} path: '/pages/index/index?goodId=' + this.data.id
}, }
},
shareFriendOrCircle: function () {
//var that = this;
if (this.data.openShare === false) {
this.setData({
openShare: !this.data.openShare
});
} else {
return false;
}
},
// 保存分享图
saveShare: function() {
let that = this;
wx.downloadFile({
url: that.data.shareImage,
success: function(res) {
console.log(res)
wx.saveImageToPhotosAlbum({
filePath: res.tempFilePath,
success: function(res) {
wx.showModal({
title: '存图成功',
content: '图片成功保存到相册了,可以分享到朋友圈了',
showCancel: false,
confirmText: '好的',
confirmColor: '#a78845',
success: function(res) {
if (res.confirm) {
console.log('用户点击确定');
}
}
})
},
fail: function(res) {
console.log('fail')
}
})
},
fail: function() {
console.log('fail')
}
})
},
//从分享的团购进入
getGrouponInfo: function(grouponId) {
let that = this;
util.request(api.GroupOnJoin, {
grouponId: grouponId
}).then(function(res) {
if (res.errno === 0) {
that.setData({
grouponLink: res.data.groupon,
id: res.data.goods.id
});
//获取商品详情
that.getGoodsInfo();
}
});
},
// 获取商品信息
getGoodsInfo: function() {
let that = this;
util.request(api.GoodsDetail, {
id: that.data.id
}).then(function(res) {
if (res.errno === 0) {
let _specificationList = res.data.specificationList
// 如果仅仅存在一种货品,那么商品页面初始化时默认checked
if (_specificationList.length == 1) {
if (_specificationList[0].valueList.length == 1) {
_specificationList[0].valueList[0].checked = true
// 如果仅仅存在一种货品,那么商品价格应该和货品价格一致
// 这里检测一下
let _productPrice = res.data.productList[0].price;
let _goodsPrice = res.data.info.retailPrice;
if (_productPrice != _goodsPrice) {
console.error('商品数量价格和货品不一致');
}
that.setData({ shareFriendOrCircle: function() {
checkedSpecText: _specificationList[0].valueList[0].value, //var that = this;
tmpSpecText: '已选择:' + _specificationList[0].valueList[0].value, if (this.data.openShare === false) {
this.setData({
openShare: !this.data.openShare
}); });
} } else {
return false;
} }
},
that.setData({
goods: res.data.info, // 保存分享图
attribute: res.data.attribute, saveShare: function() {
issueList: res.data.issue, let that = this;
comment: res.data.comment, wx.downloadFile({
brand: res.data.brand, url: that.data.shareImage,
specificationList: res.data.specificationList, success: function(res) {
productList: res.data.productList, console.log(res)
userHasCollect: res.data.userHasCollect, wx.saveImageToPhotosAlbum({
shareImage: res.data.shareImage, filePath: res.tempFilePath,
checkedSpecPrice: res.data.info.retailPrice, success: function(res) {
groupon: res.data.groupon wx.showModal({
title: '存图成功',
content: '图片成功保存到相册了,可以分享到朋友圈了',
showCancel: false,
confirmText: '好的',
confirmColor: '#a78845',
success: function(res) {
if (res.confirm) {
console.log('用户点击确定');
}
}
})
},
fail: function(res) {
console.log('fail')
}
})
},
fail: function() {
console.log('fail')
}
})
},
//从分享的团购进入
getGrouponInfo: function(grouponId) {
let that = this;
util.request(api.GroupOnJoin, {
grouponId: grouponId
}).then(function(res) {
if (res.errno === 0) {
that.setData({
grouponLink: res.data.groupon,
id: res.data.goods.id
});
//获取商品详情
that.getGoodsInfo();
}
}); });
},
// 获取商品信息
getGoodsInfo: function() {
let that = this;
util.request(api.GoodsDetail, {
id: that.data.id
}).then(function(res) {
if (res.errno === 0) {
let _specificationList = res.data.specificationList
// 如果仅仅存在一种货品,那么商品页面初始化时默认checked
if (_specificationList.length == 1) {
if (_specificationList[0].valueList.length == 1) {
_specificationList[0].valueList[0].checked = true
// 如果仅仅存在一种货品,那么商品价格应该和货品价格一致
// 这里检测一下
let _productPrice = res.data.productList[0].price;
let _goodsPrice = res.data.info.retailPrice;
if (_productPrice != _goodsPrice) {
console.error('商品数量价格和货品不一致');
}
that.setData({
checkedSpecText: _specificationList[0].valueList[0].value,
tmpSpecText: '已选择:' + _specificationList[0].valueList[0].value,
});
}
}
//如果是通过分享的团购参加团购,则团购项目应该与分享的一致并且不可更改 that.setData({
if (that.data.isGroupon) { goods: res.data.info,
let groupons = that.data.groupon; attribute: res.data.attribute,
for (var i = 0; i < groupons.length; i++) { issueList: res.data.issue,
if (groupons[i].id != that.data.grouponLink.rulesId) { comment: res.data.comment,
groupons.splice(i, 1); brand: res.data.brand,
} specificationList: res.data.specificationList,
} productList: res.data.productList,
groupons[0].checked = true; userHasCollect: res.data.userHasCollect,
//重设团购规格 shareImage: res.data.shareImage,
that.setData({ checkedSpecPrice: res.data.info.retailPrice,
groupon: groupons groupon: res.data.groupon
}); });
//如果是通过分享的团购参加团购,则团购项目应该与分享的一致并且不可更改
if (that.data.isGroupon) {
let groupons = that.data.groupon;
for (var i = 0; i < groupons.length; i++) {
if (groupons[i].id != that.data.grouponLink.rulesId) {
groupons.splice(i, 1);
}
}
groupons[0].checked = true;
//重设团购规格
that.setData({
groupon: groupons
});
} }
if (res.data.userHasCollect == 1) { if (res.data.userHasCollect == 1) {
that.setData({ that.setData({
collectImage: that.data.hasCollectImage collectImage: that.data.hasCollectImage
}); });
} else { } else {
that.setData({ that.setData({
collectImage: that.data.noCollectImage collectImage: that.data.noCollectImage
}); });
} }
WxParse.wxParse('goodsDetail', 'html', res.data.info.detail, that); WxParse.wxParse('goodsDetail', 'html', res.data.info.detail, that);
//获取推荐商品 //获取推荐商品
that.getGoodsRelated(); that.getGoodsRelated();
} }
});
},
// 获取推荐商品
getGoodsRelated: function() {
let that = this;
util.request(api.GoodsRelated, {
id: that.data.id
}).then(function(res) {
if (res.errno === 0) {
that.setData({
relatedGoods: res.data.goodsList,
}); });
} },
});
}, // 获取推荐商品
getGoodsRelated: function() {
// 团购选择 let that = this;
clickGroupon: function(event) { util.request(api.GoodsRelated, {
let that = this; id: that.data.id
}).then(function(res) {
//参与团购,不可更改选择 if (res.errno === 0) {
if (that.data.isGroupon) { that.setData({
return; relatedGoods: res.data.goodsList,
} });
}
let specName = event.currentTarget.dataset.name; });
let specValueId = event.currentTarget.dataset.valueId; },
let _grouponList = this.data.groupon; // 团购选择
for (let i = 0; i < _grouponList.length; i++) { clickGroupon: function(event) {
if (_grouponList[i].id == specValueId) { let that = this;
if (_grouponList[i].checked) {
_grouponList[i].checked = false; //参与团购,不可更改选择
} else { if (that.data.isGroupon) {
_grouponList[i].checked = true; return;
} }
} else {
_grouponList[i].checked = false; let specName = event.currentTarget.dataset.name;
} let specValueId = event.currentTarget.dataset.valueId;
}
let _grouponList = this.data.groupon;
this.setData({ for (let i = 0; i < _grouponList.length; i++) {
groupon: _grouponList, if (_grouponList[i].id == specValueId) {
}); if (_grouponList[i].checked) {
}, _grouponList[i].checked = false;
} else {
// 规格选择 _grouponList[i].checked = true;
clickSkuValue: function(event) { }
let that = this;
let specName = event.currentTarget.dataset.name;
let specValueId = event.currentTarget.dataset.valueId;
//判断是否可以点击
//TODO 性能优化,可在wx:for中添加index,可以直接获取点击的属性名和属性值,不用循环
let _specificationList = this.data.specificationList;
for (let i = 0; i < _specificationList.length; i++) {
if (_specificationList[i].name === specName) {
for (let j = 0; j < _specificationList[i].valueList.length; j++) {
if (_specificationList[i].valueList[j].id == specValueId) {
//如果已经选中,则反选
if (_specificationList[i].valueList[j].checked) {
_specificationList[i].valueList[j].checked = false;
} else { } else {
_specificationList[i].valueList[j].checked = true; _grouponList[i].checked = false;
} }
} else {
_specificationList[i].valueList[j].checked = false;
}
} }
}
} this.setData({
this.setData({ groupon: _grouponList,
specificationList: _specificationList, });
}); },
//重新计算spec改变后的信息
this.changeSpecInfo(); // 规格选择
clickSkuValue: function(event) {
//重新计算哪些值不可以点击 let that = this;
}, let specName = event.currentTarget.dataset.name;
let specValueId = event.currentTarget.dataset.valueId;
//获取选中的团购信息
getCheckedGrouponValue: function() { //判断是否可以点击
let checkedValues = {};
let _grouponList = this.data.groupon; //TODO 性能优化,可在wx:for中添加index,可以直接获取点击的属性名和属性值,不用循环
for (let i = 0; i < _grouponList.length; i++) { let _specificationList = this.data.specificationList;
if (_grouponList[i].checked) { for (let i = 0; i < _specificationList.length; i++) {
checkedValues = _grouponList[i]; if (_specificationList[i].name === specName) {
} for (let j = 0; j < _specificationList[i].valueList.length; j++) {
} if (_specificationList[i].valueList[j].id == specValueId) {
//如果已经选中,则反选
return checkedValues; if (_specificationList[i].valueList[j].checked) {
}, _specificationList[i].valueList[j].checked = false;
} else {
//获取选中的规格信息 _specificationList[i].valueList[j].checked = true;
getCheckedSpecValue: function() { }
let checkedValues = []; } else {
let _specificationList = this.data.specificationList; _specificationList[i].valueList[j].checked = false;
for (let i = 0; i < _specificationList.length; i++) { }
let _checkedObj = { }
name: _specificationList[i].name, }
valueId: 0,
valueText: ''
};
for (let j = 0; j < _specificationList[i].valueList.length; j++) {
if (_specificationList[i].valueList[j].checked) {
_checkedObj.valueId = _specificationList[i].valueList[j].id;
_checkedObj.valueText = _specificationList[i].valueList[j].value;
} }
}
checkedValues.push(_checkedObj);
}
return checkedValues;
},
//判断规格是否选择完整
isCheckedAllSpec: function() {
return !this.getCheckedSpecValue().some(function(v) {
if (v.valueId == 0) {
return true;
}
});
},
getCheckedSpecKey: function() {
let checkedValue = this.getCheckedSpecValue().map(function(v) {
return v.valueText;
});
return checkedValue;
},
// 规格改变时,重新计算价格及显示信息
changeSpecInfo: function() {
let checkedNameValue = this.getCheckedSpecValue();
//设置选择的信息
let checkedValue = checkedNameValue.filter(function(v) {
if (v.valueId != 0) {
return true;
} else {
return false;
}
}).map(function(v) {
return v.valueText;
});
if (checkedValue.length > 0) {
this.setData({
tmpSpecText: checkedValue.join(' ')
});
} else {
this.setData({
tmpSpecText: '请选择规格数量'
});
}
if (this.isCheckedAllSpec()) {
this.setData({
checkedSpecText: this.data.tmpSpecText
});
// 规格所对应的货品选择以后
let checkedProductArray = this.getCheckedProductItem(this.getCheckedSpecKey());
if (!checkedProductArray || checkedProductArray.length <= 0) {
this.setData({ this.setData({
soldout: true specificationList: _specificationList,
}); });
console.error('规格所对应货品不存在'); //重新计算spec改变后的信息
return; this.changeSpecInfo();
}
//重新计算哪些值不可以点击
},
//获取选中的团购信息
getCheckedGrouponValue: function() {
let checkedValues = {};
let _grouponList = this.data.groupon;
for (let i = 0; i < _grouponList.length; i++) {
if (_grouponList[i].checked) {
checkedValues = _grouponList[i];
}
}
let checkedProduct = checkedProductArray[0]; return checkedValues;
if (checkedProduct.number > 0) { },
this.setData({
checkedSpecPrice: checkedProduct.price, //获取选中的规格信息
soldout: false getCheckedSpecValue: function() {
let checkedValues = [];
let _specificationList = this.data.specificationList;
for (let i = 0; i < _specificationList.length; i++) {
let _checkedObj = {
name: _specificationList[i].name,
valueId: 0,
valueText: ''
};
for (let j = 0; j < _specificationList[i].valueList.length; j++) {
if (_specificationList[i].valueList[j].checked) {
_checkedObj.valueId = _specificationList[i].valueList[j].id;
_checkedObj.valueText = _specificationList[i].valueList[j].value;
}
}
checkedValues.push(_checkedObj);
}
return checkedValues;
},
//判断规格是否选择完整
isCheckedAllSpec: function() {
return !this.getCheckedSpecValue().some(function(v) {
if (v.valueId == 0) {
return true;
}
}); });
} else { },
this.setData({
checkedSpecPrice: this.data.goods.retailPrice, getCheckedSpecKey: function() {
soldout: true let checkedValue = this.getCheckedSpecValue().map(function(v) {
return v.valueText;
}); });
} return checkedValue;
},
} else { // 规格改变时,重新计算价格及显示信息
this.setData({ changeSpecInfo: function() {
checkedSpecText: '规格数量选择', let checkedNameValue = this.getCheckedSpecValue();
checkedSpecPrice: this.data.goods.retailPrice,
soldout: false //设置选择的信息
}); let checkedValue = checkedNameValue.filter(function(v) {
} if (v.valueId != 0) {
return true;
}, } else {
return false;
// 获取选中的产品(根据规格) }
getCheckedProductItem: function(key) { }).map(function(v) {
return this.data.productList.filter(function(v) { return v.valueText;
if (v.specifications.toString() == key.toString()) {
return true;
} else {
return false;
}
});
},
onLoad: function(options) {
// 页面初始化 options为页面跳转所带来的参数
if (options.id) {
this.setData({
id: parseInt(options.id)
});
this.getGoodsInfo();
}
if (options.grouponId) {
this.setData({
isGroupon: true,
});
this.getGrouponInfo(options.grouponId);
}
},
onShow: function() {
// 页面显示
var that = this;
util.request(api.CartGoodsCount).then(function(res) {
if (res.errno === 0) {
that.setData({
cartGoodsCount: res.data
}); });
} if (checkedValue.length > 0) {
}); this.setData({
}, tmpSpecText: checkedValue.join(' ')
//添加或是取消收藏
addCollectOrNot: function() {
let that = this;
util.request(api.CollectAddOrDelete, {
type: 0,
valueId: this.data.id
}, "POST")
.then(function(res) {
let _res = res;
if (_res.errno == 0) {
if (_res.data.type == 'add') {
that.setData({
collectImage: that.data.hasCollectImage
}); });
} else { } else {
that.setData({ this.setData({
collectImage: that.data.noCollectImage tmpSpecText: '请选择规格数量'
});
}
if (this.isCheckedAllSpec()) {
this.setData({
checkedSpecText: this.data.tmpSpecText
}); });
}
// 规格所对应的货品选择以后
let checkedProductArray = this.getCheckedProductItem(this.getCheckedSpecKey());
if (!checkedProductArray || checkedProductArray.length <= 0) {
this.setData({
soldout: true
});
console.error('规格所对应货品不存在');
return;
}
let checkedProduct = checkedProductArray[0];
if (checkedProduct.number > 0) {
this.setData({
checkedSpecPrice: checkedProduct.price,
soldout: false
});
} else {
this.setData({
checkedSpecPrice: this.data.goods.retailPrice,
soldout: true
});
}
} else { } else {
wx.showToast({ this.setData({
image: '/static/images/icon_error.png', checkedSpecText: '规格数量选择',
title: _res.errmsg, checkedSpecPrice: this.data.goods.retailPrice,
mask: true soldout: false
}); });
} }
}); },
}, // 获取选中的产品(根据规格)
getCheckedProductItem: function(key) {
//立即购买(先自动加入购物车) return this.data.productList.filter(function(v) {
addFast: function() { if (v.specifications.toString() == key.toString()) {
var that = this; return true;
if (this.data.openAttr == false) { } else {
//打开规格选择窗口 return false;
this.setData({ }
openAttr: !this.data.openAttr
});
} else {
//提示选择完整规格
if (!this.isCheckedAllSpec()) {
wx.showToast({
image: '/static/images/icon_error.png',
title: '请选择完整规格'
});
return false;
}
//根据选中的规格,判断是否有对应的sku信息
let checkedProductArray = this.getCheckedProductItem(this.getCheckedSpecKey());
if (!checkedProductArray || checkedProductArray.length <= 0) {
//找不到对应的product信息,提示没有库存
wx.showToast({
image: '/static/images/icon_error.png',
title: '没有库存'
});
return false;
}
let checkedProduct = checkedProductArray[0];
//验证库存
if (checkedProduct.number <= 0) {
wx.showToast({
image: '/static/images/icon_error.png',
title: '没有库存'
}); });
return false; },
}
onLoad: function(options) {
//验证团购是否有效 // 页面初始化 options为页面跳转所带来的参数
let checkedGroupon = this.getCheckedGrouponValue(); if (options.id) {
this.setData({
//立即购买 id: parseInt(options.id)
util.request(api.CartFastAdd, {
goodsId: this.data.goods.id,
number: this.data.number,
productId: checkedProduct.id
}, "POST")
.then(function(res) {
if (res.errno == 0) {
// 如果storage中设置了cartId,则是立即购买,否则是购物车购买
try {
wx.setStorageSync('cartId', res.data);
wx.setStorageSync('grouponRulesId', checkedGroupon.id);
wx.setStorageSync('grouponLinkId', that.data.grouponLink.id);
wx.navigateTo({
url: '/pages/checkout/checkout'
})
} catch (e) {}
} else {
wx.showToast({
image: '/static/images/icon_error.png',
title: res.errmsg,
mask: true
}); });
} this.getGoodsInfo();
}); }
}
if (options.grouponId) {
this.setData({
}, isGroupon: true,
});
//添加到购物车 this.getGrouponInfo(options.grouponId);
addToCart: function() { }
var that = this; },
if (this.data.openAttr == false) { onShow: function() {
//打开规格选择窗口 // 页面显示
this.setData({ var that = this;
openAttr: !this.data.openAttr util.request(api.CartGoodsCount).then(function(res) {
}); if (res.errno === 0) {
} else { that.setData({
cartGoodsCount: res.data
//提示选择完整规格 });
if (!this.isCheckedAllSpec()) { }
wx.showToast({
image: '/static/images/icon_error.png',
title: '请选择完整规格'
});
return false;
}
//根据选中的规格,判断是否有对应的sku信息
let checkedProductArray = this.getCheckedProductItem(this.getCheckedSpecKey());
if (!checkedProductArray || checkedProductArray.length <= 0) {
//找不到对应的product信息,提示没有库存
wx.showToast({
image: '/static/images/icon_error.png',
title: '没有库存'
});
return false;
}
let checkedProduct = checkedProductArray[0];
//验证库存
if (checkedProduct.number <= 0) {
wx.showToast({
image: '/static/images/icon_error.png',
title: '没有库存'
}); });
return false; },
}
//添加或是取消收藏
//添加到购物车 addCollectOrNot: function() {
util.request(api.CartAdd, { let that = this;
goodsId: this.data.goods.id, util.request(api.CollectAddOrDelete, {
number: this.data.number, type: 0,
productId: checkedProduct.id valueId: this.data.id
}, "POST") }, "POST")
.then(function(res) { .then(function(res) {
let _res = res; let _res = res;
if (_res.errno == 0) { if (_res.errno == 0) {
wx.showToast({ if (_res.data.type == 'add') {
title: '添加成功' that.setData({
collectImage: that.data.hasCollectImage
});
} else {
that.setData({
collectImage: that.data.noCollectImage
});
}
} else {
wx.showToast({
image: '/static/images/icon_error.png',
title: _res.errmsg,
mask: true
});
}
}); });
that.setData({
openAttr: !that.data.openAttr, },
cartGoodsCount: _res.data
//立即购买(先自动加入购物车)
addFast: function() {
var that = this;
if (this.data.openAttr == false) {
//打开规格选择窗口
this.setData({
openAttr: !this.data.openAttr
}); });
if (that.data.userHasCollect == 1) { } else {
that.setData({
collectImage: that.data.hasCollectImage //提示选择完整规格
}); if (!this.isCheckedAllSpec()) {
} else { wx.showToast({
that.setData({ image: '/static/images/icon_error.png',
collectImage: that.data.noCollectImage title: '请选择完整规格'
}); });
return false;
}
//根据选中的规格,判断是否有对应的sku信息
let checkedProductArray = this.getCheckedProductItem(this.getCheckedSpecKey());
if (!checkedProductArray || checkedProductArray.length <= 0) {
//找不到对应的product信息,提示没有库存
wx.showToast({
image: '/static/images/icon_error.png',
title: '没有库存'
});
return false;
}
let checkedProduct = checkedProductArray[0];
//验证库存
if (checkedProduct.number <= 0) {
wx.showToast({
image: '/static/images/icon_error.png',
title: '没有库存'
});
return false;
} }
} else {
wx.showToast({ //验证团购是否有效
image: '/static/images/icon_error.png', let checkedGroupon = this.getCheckedGrouponValue();
title: _res.errmsg,
mask: true //立即购买
util.request(api.CartFastAdd, {
goodsId: this.data.goods.id,
number: this.data.number,
productId: checkedProduct.id
}, "POST")
.then(function(res) {
if (res.errno == 0) {
// 如果storage中设置了cartId,则是立即购买,否则是购物车购买
try {
wx.setStorageSync('cartId', res.data);
wx.setStorageSync('grouponRulesId', checkedGroupon.id);
wx.setStorageSync('grouponLinkId', that.data.grouponLink.id);
wx.navigateTo({
url: '/pages/checkout/checkout'
})
} catch (e) {}
} else {
wx.showToast({
image: '/static/images/icon_error.png',
title: res.errmsg,
mask: true
});
}
});
}
},
//添加到购物车
addToCart: function() {
var that = this;
if (this.data.openAttr == false) {
//打开规格选择窗口
this.setData({
openAttr: !this.data.openAttr
}); });
} } else {
//提示选择完整规格
if (!this.isCheckedAllSpec()) {
wx.showToast({
image: '/static/images/icon_error.png',
title: '请选择完整规格'
});
return false;
}
//根据选中的规格,判断是否有对应的sku信息
let checkedProductArray = this.getCheckedProductItem(this.getCheckedSpecKey());
if (!checkedProductArray || checkedProductArray.length <= 0) {
//找不到对应的product信息,提示没有库存
wx.showToast({
image: '/static/images/icon_error.png',
title: '没有库存'
});
return false;
}
let checkedProduct = checkedProductArray[0];
//验证库存
if (checkedProduct.number <= 0) {
wx.showToast({
image: '/static/images/icon_error.png',
title: '没有库存'
});
return false;
}
//添加到购物车
util.request(api.CartAdd, {
goodsId: this.data.goods.id,
number: this.data.number,
productId: checkedProduct.id
}, "POST")
.then(function(res) {
let _res = res;
if (_res.errno == 0) {
wx.showToast({
title: '添加成功'
});
that.setData({
openAttr: !that.data.openAttr,
cartGoodsCount: _res.data
});
if (that.data.userHasCollect == 1) {
that.setData({
collectImage: that.data.hasCollectImage
});
} else {
that.setData({
collectImage: that.data.noCollectImage
});
}
} else {
wx.showToast({
image: '/static/images/icon_error.png',
title: _res.errmsg,
mask: true
});
}
});
}
},
cutNumber: function() {
this.setData({
number: (this.data.number - 1 > 1) ? this.data.number - 1 : 1
});
},
addNumber: function() {
this.setData({
number: this.data.number + 1
});
},
onHide: function() {
// 页面隐藏
},
onUnload: function() {
// 页面关闭
},
switchAttrPop: function() {
if (this.data.openAttr == false) {
this.setData({
openAttr: !this.data.openAttr
});
}
},
closeAttr: function() {
this.setData({
openAttr: false,
});
},
closeShare: function() {
this.setData({
openShare: false,
});
},
openCartPage: function() {
wx.switchTab({
url: '/pages/cart/cart'
}); });
} },
onReady: function() {
}, // 页面渲染完成
cutNumber: function() { },
this.setData({ // 下拉刷新
number: (this.data.number - 1 > 1) ? this.data.number - 1 : 1 onPullDownRefresh() {
}); wx.showNavigationBarLoading() //在标题栏中显示加载
}, this.getGoodsInfo();
addNumber: function() { wx.hideNavigationBarLoading() //完成停止加载
this.setData({ wx.stopPullDownRefresh() //停止下拉刷新
number: this.data.number + 1 },
}); //根据已选的值,计算其它值的状态
}, setSpecValueStatus: function() {
onHide: function() {
// 页面隐藏 },
},
onUnload: function() {
// 页面关闭
},
switchAttrPop: function() {
if (this.data.openAttr == false) {
this.setData({
openAttr: !this.data.openAttr
});
}
},
closeAttr: function() {
this.setData({
openAttr: false,
});
},
openCartPage: function() {
wx.switchTab({
url: '/pages/cart/cart'
});
},
onReady: function() {
// 页面渲染完成
},
// 下拉刷新
onPullDownRefresh() {
wx.showNavigationBarLoading() //在标题栏中显示加载
this.getGoodsInfo();
wx.hideNavigationBarLoading() //完成停止加载
wx.stopPullDownRefresh() //停止下拉刷新
},
//根据已选的值,计算其它值的状态
setSpecValueStatus: function() {
},
}) })
\ No newline at end of file
{ {
"navigationBarTitleText": "", "navigationBarTitleText": "首页",
"usingComponents": { "usingComponents": {
"zan-capsule": "../../lib/zanui-weapp/capsule/index" "zan-capsule": "../../lib/zanui-weapp/capsule/index"
} }
......
...@@ -90,18 +90,31 @@ page{ ...@@ -90,18 +90,31 @@ page{
} }
.add-address{ .add-address{
background: #b4282d; border: none;
text-align: center; right: 0;
width: 100%; display: flex;
height: 99rpx; justify-content: center;
line-height: 99rpx; align-items: center;
position: fixed; width: 90%;
border-radius: 0; height: 90rpx;
border: none; line-height: 98rpx;
color: #fff; position: absolute;
font-size: 29rpx; bottom: 0;
bottom: 0; left: 0;
left:0; border-radius: 0;
padding: 0;
margin: 0;
margin-left: 5%;
text-align: center;
/* padding-left: -5rpx; */
font-size: 25rpx;
color: #f4f4f4;
border-top-left-radius: 50rpx;
border-bottom-left-radius: 50rpx;
border-top-right-radius: 50rpx;
border-bottom-right-radius: 50rpx;
letter-spacing: 3rpx;
background-image: linear-gradient(to right, #9a9ba1 0%, #9a9ba1 100%);
} }
.empty-view{ .empty-view{
......
var util = require('../../../utils/util.js'); var util = require('../../../utils/util.js');
var check = require('../../../utils/check.js');
var api = require('../../../config/api.js'); var api = require('../../../config/api.js');
var app = getApp(); var app = getApp();
Page({ Page({
data: { data: {
array: ['请选择反馈类型', '商品相关', '功能异常', '优化建议', '其他'], array: ['请选择反馈类型', '商品相关', '功能异常', '优化建议', '其他'],
index: 0, index: 0,
content:'', content: '',
contentLength:0, contentLength: 0,
mobile:'' mobile: '',
hasPicture: false,
picUrls: [],
files: []
},
chooseImage: function (e) {
if (this.data.files.length >= 5) {
util.showErrorToast('只能上传五张图片')
return false;
}
var that = this;
wx.chooseImage({
count: 1,
sizeType: ['original', 'compressed'],
sourceType: ['album', 'camera'],
success: function (res) {
that.setData({
files: that.data.files.concat(res.tempFilePaths)
});
that.upload(res);
}
})
},
upload: function (res) {
var that = this;
const uploadTask = wx.uploadFile({
url: api.StorageUpload,
filePath: res.tempFilePaths[0],
name: 'file',
success: function (res) {
var _res = JSON.parse(res.data);
if (_res.errno === 0) {
var url = _res.data.url
that.data.picUrls.push(url)
that.setData({
hasPicture: true,
picUrls: that.data.picUrls
})
}
},
fail: function (e) {
wx.showModal({
title: '错误',
content: '上传失败',
showCancel: false
})
},
})
uploadTask.onProgressUpdate((res) => {
console.log('上传进度', res.progress)
console.log('已经上传的数据长度', res.totalBytesSent)
console.log('预期需要上传的数据总长度', res.totalBytesExpectedToSend)
})
}, },
bindPickerChange: function (e) { previewImage: function (e) {
console.log('picker发送选择改变,携带值为', e.detail.value); wx.previewImage({
current: e.currentTarget.id, // 当前显示图片的http链接
urls: this.data.files // 需要预览的图片http链接列表
})
},
bindPickerChange: function(e) {
this.setData({ this.setData({
index: e.detail.value index: e.detail.value
}); });
}, },
mobileInput: function (e) { mobileInput: function(e) {
let that = this;
this.setData({ this.setData({
mobile: e.detail.value, mobile: e.detail.value
}); });
console.log(that.data.mobile);
}, },
contentInput: function (e) { contentInput: function(e) {
let that = this;
this.setData({ this.setData({
contentLength: e.detail.cursor, contentLength: e.detail.cursor,
content: e.detail.value, content: e.detail.value,
}); });
console.log(that.data.content);
}, },
cleanMobile:function(){ clearMobile: function(e) {
let that = this; this.setData({
mobile: ''
});
}, },
sbmitFeedback : function(e){ submitFeedback: function(e) {
if (!app.globalData.hasLogin) {
wx.navigateTo({
url: "/pages/auth/login/login"
});
}
let that = this; let that = this;
if (that.data.index == 0){ if (that.data.index == 0) {
util.showErrorToast('请选择反馈类型'); util.showErrorToast('请选择反馈类型');
return false; return false;
} }
...@@ -55,55 +116,69 @@ Page({ ...@@ -55,55 +116,69 @@ Page({
util.showErrorToast('请输入手机号码'); util.showErrorToast('请输入手机号码');
return false; return false;
} }
if (!check.isValidPhone(this.data.mobile)) {
this.setData({
mobile: ''
});
util.showErrorToast('请输入手机号码');
return false;
}
wx.showLoading({ wx.showLoading({
title: '提交中...', title: '提交中...',
mask:true, mask: true,
success: function () { success: function() {
} }
}); });
console.log(that.data); util.request(api.FeedbackAdd, {
mobile: that.data.mobile,
feedType: that.data.array[that.data.index],
content: that.data.content,
hasPicture: that.data.hasPicture,
picUrls: that.data.picUrls
}, 'POST').then(function(res) {
wx.hideLoading();
util.request(api.FeedbackAdd, { mobile: that.data.mobile, index: that.data.index, content: that.data.content},'POST').then(function (res) {
if (res.errno === 0) { if (res.errno === 0) {
console.log(res.data);
wx.hideLoading();
wx.showToast({ wx.showToast({
title: res.data, title: '感谢您的反馈!',
icon: 'success', icon: 'success',
duration: 2000, duration: 2000,
complete: function () { complete: function() {
console.log('重新加载');
that.setData({ that.setData({
index: 0, index: 0,
content: '', content: '',
contentLength: 0, contentLength: 0,
mobile: '' mobile: '',
hasPicture: false,
picUrls: [],
files: []
}); });
} }
}); });
} else { } else {
util.showErrorToast(res.data); util.showErrorToast(res.errmsg);
} }
}); });
}, },
onLoad: function (options) { onLoad: function(options) {
}, },
onReady: function () { onReady: function() {
}, },
onShow: function () { onShow: function() {
}, },
onHide: function () { onHide: function() {
// 页面隐藏 // 页面隐藏
}, },
onUnload: function () { onUnload: function() {
// 页面关闭 // 页面关闭
} }
}) })
\ No newline at end of file
{ {
"navigationBarTitleText": "意见反馈"
} }
\ No newline at end of file
...@@ -10,18 +10,26 @@ ...@@ -10,18 +10,26 @@
</view> </view>
</picker> </picker>
<view class="fb-body"> <view class="fb-body">
<textarea class="content" placeholder="对我们网站、商品、服务,你还有什么建议吗?你还希望在商城上买到什么?请告诉我们..." bindinput ="contentInput" maxlength="500" auto-focus="true" value="{{content}}"/> <textarea class="content" placeholder="对我们网站、商品、服务,你还有什么建议吗?你还希望在商城上买到什么?请告诉我们..." bindinput="contentInput" maxlength="500" auto-focus="true" value="{{content}}" />
<view class="weui-uploader__files" id="uploaderFiles">
<block wx:for="{{files}}" wx:key="*this">
<view class="weui-uploader__file" bindtap="previewImage" id="{{item}}">
<image class="weui-uploader__img" src="{{item}}" mode="aspectFill" />
</view>
</block>
<view class="weui-uploader__input-box" wx:if="{{ files.length < 5 }}">
<view class="weui-uploader__input" bindtap="chooseImage"></view>
</view>
</view>
<view class="text-count">{{contentLength}}/500</view> <view class="text-count">{{contentLength}}/500</view>
</view> </view>
<view class="fb-mobile"> <view class="fb-mobile">
<view class="label">手机号码</view> <view class="label">手机号码</view>
<view class="mobile-box"> <view class="mobile-box">
<input class="mobile" maxlength="11" type="number" placeholder="方便我们与你联系" bindinput ="mobileInput" value="{{mobile}}"/> <input class="mobile" maxlength="11" type="number" placeholder="方便我们与你联系" bindinput="mobileInput" value="{{mobile}}" />
<!-- <image class="clear-icon" src="/static/images/clear_input.png" wx:if="{{ mobile.length > 0 }}" catchtap="clearMobile"></image>
<image class="clear-icon" src="https://platform-wxmall.oss-cn-beijing.aliyuncs.com/upload/20180727/150647657fcdd0.png" bindtap="cleanMobile"></image>
-->
</view> </view>
</view> </view>
<view class="fb-btn" bindtap="sbmitFeedback">提交</view> <view class="fb-btn" bindtap="submitFeedback">提交</view>
</view> </view>
\ No newline at end of file
page{ page{
background: #f4f4f4; background: #f4f4f4;
min-height: 100%; min-height: 100%;
} }
...@@ -36,20 +36,83 @@ page{ ...@@ -36,20 +36,83 @@ page{
.fb-body{ .fb-body{
width: 100%; width: 100%;
background: #fff; background: #fff;
height: 374rpx; height: 600rpx;
padding: 18rpx 30rpx 64rpx 30rpx; padding: 18rpx 30rpx 64rpx 30rpx;
} }
.fb-body .content{ .fb-body .content{
width: 100%; width: 100%;
height: 100%; height: 400rpx;
color: #333; color: #333;
line-height: 40rpx; line-height: 40rpx;
font-size: 28rpx; font-size: 28rpx;
} }
.weui-uploader__files{
width: 100%;
}
.weui-uploader__file {
float: left;
margin-right: 9px;
margin-bottom: 9px;
}
.weui-uploader__img {
display: block;
width: 50px;
height: 50px;
}
.weui-uploader__input-box {
float: left;
position: relative;
margin-right: 9px;
margin-bottom: 9px;
width: 50px;
height: 50px;
border: 1px solid #d9d9d9;
}
.weui-uploader__input-box:after, .weui-uploader__input-box:before {
content: " ";
position: absolute;
top: 50%;
left: 50%;
-webkit-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
background-color: #d9d9d9;
}
.weui-uploader__input-box:before {
width: 2px;
height: 39.5px;
}
.weui-uploader__input-box:after {
width: 39.5px;
height: 2px;
}
.weui-uploader__input-box:active {
border-color: #999;
}
.weui-uploader__input-box:active:after, .weui-uploader__input-box:active:before {
background-color: #999;
}
.weui-uploader__input {
position: absolute;
z-index: 1;
top: 0;
left: 0;
width: 100%;
height: 100%;
opacity: 0;
}
.fb-body .text-count{ .fb-body .text-count{
padding-top: 17rpx;
line-height: 30rpx; line-height: 30rpx;
float: right; float: right;
color: #666; color: #666;
...@@ -95,12 +158,13 @@ page{ ...@@ -95,12 +158,13 @@ page{
font-size: 24rpx; font-size: 24rpx;
} }
.clear-icon{ .fb-mobile .clear-icon{
position: absolute; position: absolute;
top: 43rpx; top: 27rpx;
right: 30rpx; right: 30rpx;
width: 48rpx; width: 48rpx;
height: 48rpx; height: 48rpx;
z-index: 2;
} }
.fb-btn{ .fb-btn{
......
...@@ -13,7 +13,7 @@ page { ...@@ -13,7 +13,7 @@ page {
.profile-info { .profile-info {
background-color: #ab956d; background-color: #ab956d;
color: #fff; color: #f4f4f4;
display: flex; display: flex;
align-items: center; align-items: center;
padding: 30rpx; padding: 30rpx;
...@@ -175,21 +175,16 @@ page { ...@@ -175,21 +175,16 @@ page {
} }
.user_tool_item_phone { .user_tool_item_phone {
background: none !important; width:187.5rpx;
font-size: 32rpx; height:142rpx;
color: #fff !important; text-align:center;
border-radius: 0%; display:flex;
width: 187.5rpx; justify-content:center;
height: 142rpx; align-items:center;
/* border: 1px solid #757575; */ flex-wrap:wrap;
text-align: center; float:left;
display: flex; background:#fff;
justify-content: center; border-bottom:1px solid #fafafa;
align-items: center;
flex-wrap: wrap;
float: left;
background: #fff;
border-bottom: 0px solid #fafafa;
} }
.user_tool_item_phone::after{ .user_tool_item_phone::after{
border: none; border: none;
......
...@@ -7,7 +7,17 @@ Page({ ...@@ -7,7 +7,17 @@ Page({
showType: 0 showType: 0
}, },
onLoad: function(options) { onLoad: function(options) {
// 页面初始化 options为页面跳转所带来的参数 // 页面初始化 options为页面跳转所带来的参数
let that = this
try {
var tab = wx.getStorageSync('tab');
this.setData({
showType: tab
});
} catch (e) {
}
}, },
onPullDownRefresh() { onPullDownRefresh() {
......
...@@ -9,7 +9,7 @@ page{ ...@@ -9,7 +9,7 @@ page{
width: 100%; width: 100%;
background: #fff; background: #fff;
height: 84rpx; height: 84rpx;
border-bottom: 1px solid rgba(0,0,0,.15); /* border-bottom: 1px solid rgba(0,0,0,.15); */
} }
.orders-switch .item{ .orders-switch .item{
...@@ -25,14 +25,14 @@ page{ ...@@ -25,14 +25,14 @@ page{
height: 82rpx; height: 82rpx;
padding: 0 20rpx; padding: 0 20rpx;
line-height: 82rpx; line-height: 82rpx;
color: #333; color: #9a9ba1;
font-size: 30rpx; font-size: 30rpx;
width: 170rpx; width: 170rpx;
} }
.orders-switch .item.active .txt{ .orders-switch .item.active .txt{
color: #ab2b2b; color: #AB956D;
border-bottom: 4rpx solid #ab2b2b; border-bottom: 4rpx solid #AB956D;
} }
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
"list": [] "list": []
}, },
"miniprogram": { "miniprogram": {
"current": 32, "current": 33,
"list": [ "list": [
{ {
"id": -1, "id": -1,
...@@ -225,7 +225,14 @@ ...@@ -225,7 +225,14 @@
{ {
"id": -1, "id": -1,
"name": "测试更新", "name": "测试更新",
"pathName": "pages/index/index" "pathName": "pages/index/index",
"query": ""
},
{
"id": -1,
"name": "意见反馈",
"pathName": "pages/ucenter/feedback/feedback",
"query": ""
} }
] ]
} }
......
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