Merge remote-tracking branch 'origin/master'

This commit is contained in:
Menethil
2018-08-28 12:16:36 +08:00
70 changed files with 5889 additions and 812 deletions

View File

@@ -0,0 +1,102 @@
package org.linlinjava.litemall.admin.web;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.linlinjava.litemall.admin.annotation.LoginAdmin;
import org.linlinjava.litemall.core.util.RegexUtil;
import org.linlinjava.litemall.core.util.ResponseUtil;
import org.linlinjava.litemall.core.validator.Order;
import org.linlinjava.litemall.core.validator.Sort;
import org.linlinjava.litemall.db.domain.LitemallFeedback;
import org.linlinjava.litemall.db.service.LitemallFeedbackService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.validation.constraints.NotNull;
import java.time.LocalDateTime;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @author Yogeek
* @date 2018/8/26 1:11
*/
@RestController
@RequestMapping("/admin/feedback")
@Validated
public class AdminFeedbackController {
private final Log logger = LogFactory.getLog(AdminFeedbackController.class);
@Autowired
private LitemallFeedbackService feedbackService;
@GetMapping("/list")
public Object list(@LoginAdmin Integer adminId,
Integer userId, String username,
@RequestParam(defaultValue = "1") Integer page,
@RequestParam(defaultValue = "10") Integer limit,
@Sort @RequestParam(defaultValue = "add_time") String sort,
@Order @RequestParam(defaultValue = "desc") String order) {
if(adminId == null){
return ResponseUtil.unlogin();
}
List<LitemallFeedback> feedbackList = feedbackService.querySelective(userId, username, page, limit, sort, order);
int total = feedbackService.countSelective(userId, username, page, limit, sort, order);
Map<String, Object> data = new HashMap<>();
data.put("total", total);
data.put("items", feedbackList);
return ResponseUtil.ok(data);
}
@PostMapping("/create")
public Object create(@LoginAdmin Integer adminId, @RequestBody LitemallFeedback feedback) {
if(adminId == null){
return ResponseUtil.unlogin();
}
String mobile = feedback.getMobile();
if(!RegexUtil.isMobileExact(mobile)){
return ResponseUtil.fail(403, "手机号格式不正确");
}
feedback.setAddTime(LocalDateTime.now());
feedbackService.add(feedback);
return ResponseUtil.ok(feedback);
}
@GetMapping("/read")
public Object read(@LoginAdmin Integer adminId, @NotNull Integer id){
if(adminId == null){
return ResponseUtil.unlogin();
}
if(id == null){
return ResponseUtil.badArgument();
}
LitemallFeedback feedback = feedbackService.findById(id);
return ResponseUtil.ok(feedback);
}
@PostMapping("/update")
public Object update(@LoginAdmin Integer adminId, @RequestBody LitemallFeedback feedback) {
if(adminId == null){
return ResponseUtil.unlogin();
}
feedbackService.updateById(feedback);
return ResponseUtil.ok(feedback);
}
@PostMapping("/delete")
public Object delete(@LoginAdmin Integer adminId, @RequestBody LitemallFeedback feedback){
if(adminId == null){
return ResponseUtil.unlogin();
}
feedbackService.delete(feedback.getId());
return ResponseUtil.ok();
}
}

View File

@@ -24,6 +24,7 @@ import org.springframework.transaction.support.DefaultTransactionDefinition;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.HashMap;
@@ -53,7 +54,8 @@ public class AdminOrderController {
@GetMapping("/list")
public Object list(@LoginAdmin Integer adminId,
Integer userId, String orderSn, @RequestParam(required = false, value = "orderStatusArray[]") List<Short> orderStatusArray,
Integer userId, String orderSn,
@RequestParam(required = false) List<Short> orderStatusArray,
@RequestParam(defaultValue = "1") Integer page,
@RequestParam(defaultValue = "10") Integer limit,
@Sort @RequestParam(defaultValue = "add_time") String sort,
@@ -72,7 +74,7 @@ public class AdminOrderController {
}
@GetMapping("/detail")
public Object detail(@LoginAdmin Integer adminId, Integer id) {
public Object detail(@LoginAdmin Integer adminId, @NotNull Integer id) {
if (adminId == null) {
return ResponseUtil.unlogin();
}

View File

@@ -24,6 +24,7 @@
"mockjs": "1.0.1-beta3",
"normalize.css": "7.0.0",
"nprogress": "0.2.0",
"qs": "^6.5.2",
"screenfull": "3.3.2",
"v-charts": "^1.16.19",
"vue": "2.5.10",

View File

@@ -0,0 +1,41 @@
import request from '@/utils/request'
export function listFeedback(query) {
return request({
url: '/feedback/list',
method: 'get',
params: query
})
}
export function createFeedback(data) {
return request({
url: '/feedback/create',
method: 'post',
data
})
}
export function readFeedback(data) {
return request({
url: '/feedback/read',
method: 'get',
data
})
}
export function updateFeedback(data) {
return request({
url: '/feedback/update',
method: 'post',
data
})
}
export function deleteFeedback(data) {
return request({
url: '/feedback/delete',
method: 'post',
data
})
}

View File

@@ -1,10 +1,14 @@
import request from '@/utils/request'
import Qs from 'qs'
export function listOrder(query) {
return request({
url: '/order/list',
method: 'get',
params: query
params: query,
paramsSerializer: function(params) {
return Qs.stringify(params, { arrayFormat: 'repeat' })
}
})
}

View File

@@ -65,7 +65,8 @@ export const asyncRouterMap = [
{ 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: '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 }}
]
},

View File

@@ -0,0 +1,289 @@
<template>
<div class="app-container calendar-list-container">
<!-- 查询和其他操作 -->
<div class="filter-container">
<el-input clearable class="filter-item" style="width: 200px;" placeholder="请输入用户名" v-model="listQuery.username">
</el-input>
<el-input clearable class="filter-item" style="width: 200px;" placeholder="请输入反馈ID" v-model="listQuery.id">
</el-input>
<el-button class="filter-item" type="primary" icon="el-icon-search" @click="handleFilter">查找</el-button>
<el-button class="filter-item" type="primary" icon="el-icon-edit" @click="handleCreate">添加</el-button>
<el-button class="filter-item" type="primary" icon="el-icon-download" @click="handleDownload" :loading="downloadLoading">导出</el-button>
</div>
<!-- 查询结果 -->
<el-table size="small" :data="list" v-loading="listLoading" element-loading-text="正在查询中。。。" border fit highlight-current-row>
<el-table-column align="center" label="反馈ID" prop="id">
</el-table-column>
<el-table-column align="center" label="用户名" prop="username">
</el-table-column>
<el-table-column align="center" label="手机号码" prop="mobile">
</el-table-column>
<el-table-column align="center" label="反馈类型" prop="feedType">
</el-table-column>
<el-table-column align="center" label="反馈内容" prop="content">
</el-table-column>
<el-table-column align="center" label="反馈图片" prop="picUrls">
<template slot-scope="scope">
<img v-for="item in scope.row.picUrls" :key="item" :src="item" width="40"/>
</template>
</el-table-column>
<el-table-column align="center" label="时间" prop="addTime">
</el-table-column>
<el-table-column align="center" label="操作" width="200" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button type="primary" size="mini" @click="handleUpdate(scope.row)">编辑</el-button>
<el-button type="danger" size="mini" @click="handleDelete(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
<!-- 分页 -->
<div class="pagination-container">
<el-pagination background @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="listQuery.page"
:page-sizes="[10,20,30,50]" :page-size="listQuery.limit" layout="total, sizes, prev, pager, next, jumper" :total="total">
</el-pagination>
</div>
<!-- 添加或修改对话框 -->
<el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible">
<el-form :rules="rules" ref="dataForm" :model="dataForm" status-icon label-position="left" label-width="100px" style='width: 400px; margin-left:50px;'>
<el-form-item label="反馈ID" prop="id">
<el-input v-model="dataForm.id"></el-input>
</el-form-item>
<el-form-item label="用户名" prop="username">
<el-input v-model="dataForm.username"></el-input>
</el-form-item>
<el-form-item label="手机号码" prop="mobile">
<el-input v-model="dataForm.mobile" type="textarea" :rows="1"></el-input>
</el-form-item>
<el-form-item label="反馈类型" prop="feedType">
<el-input v-model="dataForm.feedType" type="textarea" :rows="4"></el-input>
</el-form-item>
<el-form-item label="反馈内容" prop="content">
<el-input v-model="dataForm.content" type="textarea" :rows="4"></el-input>
</el-form-item>
<el-form-item label="反馈时间" prop="addTime">
<el-date-picker v-model="dataForm.addTime" type="date" placeholder="选择日期" value-format="yyyy-MM-dd">
</el-date-picker>
</el-form-item>
<el-form-item label="反馈图片" prop="picUrls">
<!-- <el-input v-model="dataForm.picUrls"></el-input> -->
<el-upload action="#" list-type="picture" :headers="headers" :show-file-list="false" :limit="5" :http-request="uploadPicUrls">
<el-button size="small" type="primary">点击上传</el-button>
</el-upload>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogFormVisible = false">取消</el-button>
<el-button v-if="dialogStatus=='create'" type="primary" @click="createData">确定</el-button>
<el-button v-else type="primary" @click="updateData">确定</el-button>
</div>
</el-dialog>
</div>
</template>
<style>
.demo-table-expand {
font-size: 0;
}
.demo-table-expand label {
width: 200px;
color: #99a9bf;
}
.demo-table-expand .el-form-item {
margin-right: 0;
margin-bottom: 0;
}
</style>
<script>
import { listFeedback, createFeedback, updateFeedback, deleteFeedback } from '@/api/Feedback'
import { createStorage } from '@/api/storage'
import { getToken } from '@/utils/auth'
export default {
name: 'Feedback',
computed: {
headers() {
return {
'Admin-Token': getToken()
}
}
},
data() {
return {
list: undefined,
total: undefined,
listLoading: true,
listQuery: {
page: 1,
limit: 20,
username: undefined,
sort: 'add_time',
order: 'desc'
},
dataForm: {
id: undefined,
username: undefined,
mobile: undefined,
feedType: undefined,
content: undefined,
hasPicture: false,
picUrls: []
},
dialogFormVisible: false,
dialogStatus: '',
textMap: {
update: '编辑',
create: '创建'
},
rules: {
username: [{ required: true, message: '用户名不能为空', trigger: 'blur' }],
// valueId: [{ required: true, message: '反馈ID不能为空', trigger: 'blur' }],
content: [{ required: true, message: '反馈内容不能为空', trigger: 'blur' }]
},
downloadLoading: false
}
},
created() {
this.getList()
},
methods: {
getList() {
this.listLoading = true
listFeedback(this.listQuery).then(response => {
this.list = response.data.data.items
this.total = response.data.data.total
this.listLoading = false
}).catch(() => {
this.list = []
this.total = 0
this.listLoading = false
})
},
handleFilter() {
this.listQuery.page = 1
this.getList()
},
handleSizeChange(val) {
this.listQuery.limit = val
this.getList()
},
handleCurrentChange(val) {
this.listQuery.page = val
this.getList()
},
resetForm() {
this.dataForm = {
id: undefined,
username: undefined,
mobile: undefined,
feedType: undefined,
content: undefined,
picUrls: []
}
},
handleCreate() {
this.resetForm()
this.dialogStatus = 'create'
this.dialogFormVisible = true
this.$nextTick(() => {
this.$refs['dataForm'].clearValidate()
})
},
uploadPicUrls(item) {
const formData = new FormData()
formData.append('file', item.file)
createStorage(formData).then(res => {
this.dataForm.picUrls.push(res.data.data.url)
this.dataForm.hasPicture = true
}).catch(() => {
this.$message.error('上传失败,请重新上传')
})
},
createData() {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
createFeedback(this.dataForm).then(response => {
this.list.unshift(response.data.data)
this.dialogFormVisible = false
this.$notify({
title: '成功',
message: '创建成功',
type: 'success',
duration: 2000
})
})
}
})
},
handleUpdate(row) {
this.dataForm = Object.assign({}, row)
this.dialogStatus = 'update'
this.dialogFormVisible = true
this.$nextTick(() => {
this.$refs['dataForm'].clearValidate()
})
},
updateData() {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
updateFeedback(this.dataForm).then(() => {
for (const v of this.list) {
if (v.id === this.dataForm.id) {
const index = this.list.indexOf(v)
this.list.splice(index, 1, this.dataForm)
break
}
}
this.dialogFormVisible = false
this.$notify({
title: '成功',
message: '更新成功',
type: 'success',
duration: 2000
})
})
}
})
},
handleDelete(row) {
deleteFeedback(row).then(response => {
this.$notify({
title: '成功',
message: '删除成功',
type: 'success',
duration: 2000
})
const index = this.list.indexOf(row)
this.list.splice(index, 1)
})
},
handleDownload() {
this.downloadLoading = true
import('@/vendor/Export2Excel').then(excel => {
const tHeader = ['反馈ID', '用户名称', '反馈内容', '反馈图片列表', '反馈时间']
const filterVal = ['id', 'username', 'content', 'picUrls', 'addTime']
excel.export_json_to_excel2(tHeader, this.list, filterVal, '意见反馈信息')
this.downloadLoading = false
})
}
}
}
</script>

View File

@@ -25,7 +25,7 @@
<el-table-column align="center" label="性别" prop="gender">
<template slot-scope="scope">
<el-tag >{{genderDic[scope.row.status]}}</el-tag>
<el-tag >{{genderDic[scope.row.gender]}}</el-tag>
</template>
</el-table-column>

View File

@@ -102,6 +102,15 @@
<columnOverride column="pic_urls" javaType="java.lang.String[]"
typeHandler="org.linlinjava.litemall.db.mybatis.JsonStringArrayTypeHandler"/>
</table>
<table tableName="litemall_feedback">
<property name="versionColumn" value="version"/>
<generatedKey column="id" sqlStatement="MySql" identity="true"/>
<columnOverride javaType="java.time.LocalDateTime" column="add_time"/>
<columnOverride column="pic_urls" javaType="java.lang.String[]"
typeHandler="org.linlinjava.litemall.db.mybatis.JsonStringArrayTypeHandler"/>
</table>
<table tableName="litemall_footprint">
<property name="versionColumn" value="version"/>
<generatedKey column="id" sqlStatement="MySql" identity="true"/>

View File

@@ -203,6 +203,31 @@ CREATE TABLE `litemall_comment` (
) ENGINE=InnoDB AUTO_INCREMENT=1005 DEFAULT CHARSET=utf8 COMMENT='评论表';
/*!40101 SET character_set_client = @saved_cs_client */;
-- ----------------------------
-- Table structure for litemall_feedback
-- ----------------------------
DROP TABLE IF EXISTS `litemall_feedback`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
DROP TABLE IF EXISTS `litemall_feedback`;
CREATE TABLE `litemall_feedback` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`user_id` int(11) NOT NULL DEFAULT '0' COMMENT '用户表的用户ID',
`username` varchar(63) CHARACTER SET utf8mb4 NOT NULL DEFAULT '' COMMENT '用户名称',
`mobile` varchar(20) CHARACTER SET utf8mb4 NOT NULL DEFAULT '' COMMENT '手机号',
`feed_type` varchar(63) NOT NULL DEFAULT '' COMMENT '反馈类型',
`content` varchar(1023) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '反馈内容',
`status` int(3) NOT NULL DEFAULT '0' COMMENT '状态',
`has_picture` tinyint(1) DEFAULT '0' COMMENT '是否含有图片',
`pic_urls` varchar(1023) CHARACTER SET utf8mb4 DEFAULT NULL COMMENT '图片地址列表采用JSON数组格式',
`add_time` datetime DEFAULT NULL COMMENT '创建时间',
`deleted` tinyint(1) DEFAULT '0' COMMENT '逻辑删除',
`version` int(11) DEFAULT '0' COMMENT '乐观锁字段',
PRIMARY KEY (`id`),
KEY `id_value` (`status`)
) ENGINE=InnoDB AUTO_INCREMENT=1007 DEFAULT CHARSET=utf8 COMMENT='意见反馈表';
--
-- Table structure for table `litemall_footprint`
--

View File

@@ -0,0 +1,214 @@
package org.linlinjava.litemall.db.dao;
import org.apache.ibatis.annotations.Param;
import org.linlinjava.litemall.db.domain.LitemallFeedback;
import org.linlinjava.litemall.db.domain.LitemallFeedbackExample;
import java.util.List;
public interface LitemallFeedbackMapper {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_feedback
*
* @mbg.generated
*/
long countByExample(LitemallFeedbackExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_feedback
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
int deleteWithVersionByExample(@Param("version") Integer version, @Param("example") LitemallFeedbackExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_feedback
*
* @mbg.generated
*/
int deleteByExample(LitemallFeedbackExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_feedback
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
int deleteWithVersionByPrimaryKey(@Param("version") Integer version, @Param("key") Integer key);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_feedback
*
* @mbg.generated
*/
int deleteByPrimaryKey(Integer id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_feedback
*
* @mbg.generated
*/
int insert(LitemallFeedback record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_feedback
*
* @mbg.generated
*/
int insertSelective(LitemallFeedback record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_feedback
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
LitemallFeedback selectOneByExample(LitemallFeedbackExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_feedback
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
LitemallFeedback selectOneByExampleSelective(@Param("example") LitemallFeedbackExample example, @Param("selective") LitemallFeedback.Column... selective);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_feedback
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
List<LitemallFeedback> selectByExampleSelective(@Param("example") LitemallFeedbackExample example, @Param("selective") LitemallFeedback.Column... selective);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_feedback
*
* @mbg.generated
*/
List<LitemallFeedback> selectByExample(LitemallFeedbackExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_feedback
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
LitemallFeedback selectByPrimaryKeySelective(@Param("id") Integer id, @Param("selective") LitemallFeedback.Column... selective);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_feedback
*
* @mbg.generated
*/
LitemallFeedback selectByPrimaryKey(Integer id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_feedback
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
LitemallFeedback selectByPrimaryKeyWithLogicalDelete(@Param("id") Integer id, @Param("andLogicalDeleted") boolean andLogicalDeleted);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_feedback
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
int updateWithVersionByExample(@Param("version") Integer version, @Param("record") LitemallFeedback record, @Param("example") LitemallFeedbackExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_feedback
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
int updateWithVersionByExampleSelective(@Param("version") Integer version, @Param("record") LitemallFeedback record, @Param("example") LitemallFeedbackExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_feedback
*
* @mbg.generated
*/
int updateByExampleSelective(@Param("record") LitemallFeedback record, @Param("example") LitemallFeedbackExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_feedback
*
* @mbg.generated
*/
int updateByExample(@Param("record") LitemallFeedback record, @Param("example") LitemallFeedbackExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_feedback
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
int updateWithVersionByPrimaryKey(@Param("version") Integer version, @Param("record") LitemallFeedback record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_feedback
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
int updateWithVersionByPrimaryKeySelective(@Param("version") Integer version, @Param("record") LitemallFeedback record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_feedback
*
* @mbg.generated
*/
int updateByPrimaryKeySelective(LitemallFeedback record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_feedback
*
* @mbg.generated
*/
int updateByPrimaryKey(LitemallFeedback record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_feedback
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
int logicalDeleteByExample(@Param("example") LitemallFeedbackExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_feedback
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
int logicalDeleteByPrimaryKey(Integer id);
}

View File

@@ -0,0 +1,703 @@
package org.linlinjava.litemall.db.domain;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.Arrays;
public class LitemallFeedback {
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table litemall_feedback
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public static final Boolean NOT_DELETED = false;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table litemall_feedback
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public static final Boolean IS_DELETED = true;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column litemall_feedback.id
*
* @mbg.generated
*/
private Integer id;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column litemall_feedback.user_id
*
* @mbg.generated
*/
private Integer userId;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column litemall_feedback.username
*
* @mbg.generated
*/
private String username;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column litemall_feedback.mobile
*
* @mbg.generated
*/
private String mobile;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column litemall_feedback.feed_type
*
* @mbg.generated
*/
private String feedType;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column litemall_feedback.content
*
* @mbg.generated
*/
private String content;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column litemall_feedback.status
*
* @mbg.generated
*/
private Integer status;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column litemall_feedback.has_picture
*
* @mbg.generated
*/
private Boolean hasPicture;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column litemall_feedback.pic_urls
*
* @mbg.generated
*/
private String[] picUrls;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column litemall_feedback.add_time
*
* @mbg.generated
*/
private LocalDateTime addTime;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column litemall_feedback.deleted
*
* @mbg.generated
*/
private Boolean deleted;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column litemall_feedback.version
*
* @mbg.generated
*/
private Integer version;
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column litemall_feedback.id
*
* @return the value of litemall_feedback.id
*
* @mbg.generated
*/
public Integer getId() {
return id;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column litemall_feedback.id
*
* @param id the value for litemall_feedback.id
*
* @mbg.generated
*/
public void setId(Integer id) {
this.id = id;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column litemall_feedback.user_id
*
* @return the value of litemall_feedback.user_id
*
* @mbg.generated
*/
public Integer getUserId() {
return userId;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column litemall_feedback.user_id
*
* @param userId the value for litemall_feedback.user_id
*
* @mbg.generated
*/
public void setUserId(Integer userId) {
this.userId = userId;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column litemall_feedback.username
*
* @return the value of litemall_feedback.username
*
* @mbg.generated
*/
public String getUsername() {
return username;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column litemall_feedback.username
*
* @param username the value for litemall_feedback.username
*
* @mbg.generated
*/
public void setUsername(String username) {
this.username = username;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column litemall_feedback.mobile
*
* @return the value of litemall_feedback.mobile
*
* @mbg.generated
*/
public String getMobile() {
return mobile;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column litemall_feedback.mobile
*
* @param mobile the value for litemall_feedback.mobile
*
* @mbg.generated
*/
public void setMobile(String mobile) {
this.mobile = mobile;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column litemall_feedback.feed_type
*
* @return the value of litemall_feedback.feed_type
*
* @mbg.generated
*/
public String getFeedType() {
return feedType;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column litemall_feedback.feed_type
*
* @param feedType the value for litemall_feedback.feed_type
*
* @mbg.generated
*/
public void setFeedType(String feedType) {
this.feedType = feedType;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column litemall_feedback.content
*
* @return the value of litemall_feedback.content
*
* @mbg.generated
*/
public String getContent() {
return content;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column litemall_feedback.content
*
* @param content the value for litemall_feedback.content
*
* @mbg.generated
*/
public void setContent(String content) {
this.content = content;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column litemall_feedback.status
*
* @return the value of litemall_feedback.status
*
* @mbg.generated
*/
public Integer getStatus() {
return status;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column litemall_feedback.status
*
* @param status the value for litemall_feedback.status
*
* @mbg.generated
*/
public void setStatus(Integer status) {
this.status = status;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column litemall_feedback.has_picture
*
* @return the value of litemall_feedback.has_picture
*
* @mbg.generated
*/
public Boolean getHasPicture() {
return hasPicture;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column litemall_feedback.has_picture
*
* @param hasPicture the value for litemall_feedback.has_picture
*
* @mbg.generated
*/
public void setHasPicture(Boolean hasPicture) {
this.hasPicture = hasPicture;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column litemall_feedback.pic_urls
*
* @return the value of litemall_feedback.pic_urls
*
* @mbg.generated
*/
public String[] getPicUrls() {
return picUrls;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column litemall_feedback.pic_urls
*
* @param picUrls the value for litemall_feedback.pic_urls
*
* @mbg.generated
*/
public void setPicUrls(String[] picUrls) {
this.picUrls = picUrls;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column litemall_feedback.add_time
*
* @return the value of litemall_feedback.add_time
*
* @mbg.generated
*/
public LocalDateTime getAddTime() {
return addTime;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column litemall_feedback.add_time
*
* @param addTime the value for litemall_feedback.add_time
*
* @mbg.generated
*/
public void setAddTime(LocalDateTime addTime) {
this.addTime = addTime;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column litemall_feedback.deleted
*
* @return the value of litemall_feedback.deleted
*
* @mbg.generated
*/
public Boolean getDeleted() {
return deleted;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column litemall_feedback.deleted
*
* @param deleted the value for litemall_feedback.deleted
*
* @mbg.generated
*/
public void setDeleted(Boolean deleted) {
this.deleted = deleted;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column litemall_feedback.version
*
* @return the value of litemall_feedback.version
*
* @mbg.generated
*/
public Integer getVersion() {
return version;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column litemall_feedback.version
*
* @param version the value for litemall_feedback.version
*
* @mbg.generated
*/
public void setVersion(Integer version) {
this.version = version;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_feedback
*
* @mbg.generated
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", userId=").append(userId);
sb.append(", username=").append(username);
sb.append(", mobile=").append(mobile);
sb.append(", feedType=").append(feedType);
sb.append(", content=").append(content);
sb.append(", status=").append(status);
sb.append(", hasPicture=").append(hasPicture);
sb.append(", picUrls=").append(picUrls);
sb.append(", addTime=").append(addTime);
sb.append(", deleted=").append(deleted);
sb.append(", version=").append(version);
sb.append("]");
return sb.toString();
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_feedback
*
* @mbg.generated
*/
@Override
public boolean equals(Object that) {
if (this == that) {
return true;
}
if (that == null) {
return false;
}
if (getClass() != that.getClass()) {
return false;
}
LitemallFeedback other = (LitemallFeedback) that;
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
&& (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()))
&& (this.getUsername() == null ? other.getUsername() == null : this.getUsername().equals(other.getUsername()))
&& (this.getMobile() == null ? other.getMobile() == null : this.getMobile().equals(other.getMobile()))
&& (this.getFeedType() == null ? other.getFeedType() == null : this.getFeedType().equals(other.getFeedType()))
&& (this.getContent() == null ? other.getContent() == null : this.getContent().equals(other.getContent()))
&& (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
&& (this.getHasPicture() == null ? other.getHasPicture() == null : this.getHasPicture().equals(other.getHasPicture()))
&& (Arrays.equals(this.getPicUrls(), other.getPicUrls()))
&& (this.getAddTime() == null ? other.getAddTime() == null : this.getAddTime().equals(other.getAddTime()))
&& (this.getDeleted() == null ? other.getDeleted() == null : this.getDeleted().equals(other.getDeleted()))
&& (this.getVersion() == null ? other.getVersion() == null : this.getVersion().equals(other.getVersion()));
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_feedback
*
* @mbg.generated
*/
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode());
result = prime * result + ((getUsername() == null) ? 0 : getUsername().hashCode());
result = prime * result + ((getMobile() == null) ? 0 : getMobile().hashCode());
result = prime * result + ((getFeedType() == null) ? 0 : getFeedType().hashCode());
result = prime * result + ((getContent() == null) ? 0 : getContent().hashCode());
result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
result = prime * result + ((getHasPicture() == null) ? 0 : getHasPicture().hashCode());
result = prime * result + (Arrays.hashCode(getPicUrls()));
result = prime * result + ((getAddTime() == null) ? 0 : getAddTime().hashCode());
result = prime * result + ((getDeleted() == null) ? 0 : getDeleted().hashCode());
result = prime * result + ((getVersion() == null) ? 0 : getVersion().hashCode());
return result;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_feedback
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public void andLogicalDeleted(boolean deleted) {
setDeleted(deleted ? IS_DELETED : NOT_DELETED);
}
/**
* This enum was generated by MyBatis Generator.
* This enum corresponds to the database table litemall_feedback
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public enum Column {
id("id", "id", "INTEGER", false),
userId("user_id", "userId", "INTEGER", false),
username("username", "username", "VARCHAR", false),
mobile("mobile", "mobile", "VARCHAR", false),
feedType("feed_type", "feedType", "VARCHAR", false),
content("content", "content", "VARCHAR", false),
status("status", "status", "INTEGER", true),
hasPicture("has_picture", "hasPicture", "BIT", false),
picUrls("pic_urls", "picUrls", "VARCHAR", false),
addTime("add_time", "addTime", "TIMESTAMP", false),
deleted("deleted", "deleted", "BIT", false),
version("version", "version", "INTEGER", false);
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table litemall_feedback
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
private static final String BEGINNING_DELIMITER = "`";
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table litemall_feedback
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
private static final String ENDING_DELIMITER = "`";
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table litemall_feedback
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
private final String column;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table litemall_feedback
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
private final boolean isColumnNameDelimited;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table litemall_feedback
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
private final String javaProperty;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table litemall_feedback
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
private final String jdbcType;
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_feedback
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public String value() {
return this.column;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_feedback
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public String getValue() {
return this.column;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_feedback
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public String getJavaProperty() {
return this.javaProperty;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_feedback
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public String getJdbcType() {
return this.jdbcType;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_feedback
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) {
this.column = column;
this.javaProperty = javaProperty;
this.jdbcType = jdbcType;
this.isColumnNameDelimited = isColumnNameDelimited;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_feedback
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public String desc() {
return this.getEscapedColumnName() + " DESC";
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_feedback
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public String asc() {
return this.getEscapedColumnName() + " ASC";
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_feedback
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public static Column[] excludes(Column ... excludes) {
ArrayList<Column> columns = new ArrayList<>(Arrays.asList(Column.values()));
if (excludes != null && excludes.length > 0) {
columns.removeAll(new ArrayList<>(Arrays.asList(excludes)));
}
return columns.toArray(new Column[]{});
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_feedback
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public String getEscapedColumnName() {
if (this.isColumnNameDelimited) {
return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString();
} else {
return this.column;
}
}
}
}

View File

@@ -0,0 +1,72 @@
package org.linlinjava.litemall.db.service;
import com.github.pagehelper.PageHelper;
import org.linlinjava.litemall.db.dao.LitemallFeedbackMapper;
import org.linlinjava.litemall.db.domain.LitemallFeedback;
import org.linlinjava.litemall.db.domain.LitemallFeedbackExample;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;
import java.util.List;
/**
* @author Yogeek
* @date 2018/8/27 11:39
*/
@Service
public class LitemallFeedbackService {
@Autowired
private LitemallFeedbackMapper feedbackMapper;
//提交
public Integer add(LitemallFeedback feedback) {
return feedbackMapper.insertSelective(feedback);
}
public List<LitemallFeedback> querySelective(Integer userId, String username, Integer page, Integer limit, String sort, String order) {
LitemallFeedbackExample example = new LitemallFeedbackExample();
LitemallFeedbackExample.Criteria criteria = example.createCriteria();
if(userId != null){
criteria.andUserIdEqualTo(userId);
}
if(!StringUtils.isEmpty(username)){
criteria.andUsernameLike("%" + username + "%");
}
criteria.andDeletedEqualTo(false);
if (!StringUtils.isEmpty(sort) && !StringUtils.isEmpty(order)) {
example.setOrderByClause(sort + " " + order);
}
PageHelper.startPage(page, limit);
return feedbackMapper.selectByExample(example);
}
public int countSelective(Integer userId, String username, Integer page, Integer limit, String sort, String order) {
LitemallFeedbackExample example = new LitemallFeedbackExample();
LitemallFeedbackExample.Criteria criteria = example.createCriteria();
if(userId != null){
criteria.andUserIdEqualTo(userId);
}
if(!StringUtils.isEmpty(username)){
criteria.andUsernameLike("%" + username + "%");
}
criteria.andDeletedEqualTo(false);
return (int)feedbackMapper.countByExample(example);
}
public LitemallFeedback findById(Integer id) {
return feedbackMapper.selectByPrimaryKey(id);
}
public void updateById(LitemallFeedback feedback) {
feedbackMapper.updateByPrimaryKeySelective(feedback);
}
public void delete(Integer id) {
feedbackMapper.logicalDeleteByPrimaryKey(id);
}
}

View File

@@ -0,0 +1,774 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.linlinjava.litemall.db.dao.LitemallFeedbackMapper">
<resultMap id="BaseResultMap" type="org.linlinjava.litemall.db.domain.LitemallFeedback">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
<id column="id" jdbcType="INTEGER" property="id" />
<result column="user_id" jdbcType="INTEGER" property="userId" />
<result column="username" jdbcType="VARCHAR" property="username" />
<result column="mobile" jdbcType="VARCHAR" property="mobile" />
<result column="feed_type" jdbcType="VARCHAR" property="feedType" />
<result column="content" jdbcType="VARCHAR" property="content" />
<result column="status" jdbcType="INTEGER" property="status" />
<result column="has_picture" jdbcType="BIT" property="hasPicture" />
<result column="pic_urls" jdbcType="VARCHAR" property="picUrls" typeHandler="org.linlinjava.litemall.db.mybatis.JsonStringArrayTypeHandler" />
<result column="add_time" jdbcType="TIMESTAMP" property="addTime" />
<result column="deleted" jdbcType="BIT" property="deleted" />
<result column="version" jdbcType="INTEGER" property="version" />
</resultMap>
<sql id="Example_Where_Clause">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
<foreach collection="criteria.picUrlsCriteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value,typeHandler=org.linlinjava.litemall.db.mybatis.JsonStringArrayTypeHandler}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value,typeHandler=org.linlinjava.litemall.db.mybatis.JsonStringArrayTypeHandler} and #{criterion.secondValue,typeHandler=org.linlinjava.litemall.db.mybatis.JsonStringArrayTypeHandler}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem,typeHandler=org.linlinjava.litemall.db.mybatis.JsonStringArrayTypeHandler}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
<where>
<foreach close=")" collection="example.oredCriteria" item="criteria" open="and (" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
<foreach collection="criteria.picUrlsCriteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value,typeHandler=org.linlinjava.litemall.db.mybatis.JsonStringArrayTypeHandler}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value,typeHandler=org.linlinjava.litemall.db.mybatis.JsonStringArrayTypeHandler} and #{criterion.secondValue,typeHandler=org.linlinjava.litemall.db.mybatis.JsonStringArrayTypeHandler}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem,typeHandler=org.linlinjava.litemall.db.mybatis.JsonStringArrayTypeHandler}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_With_Version_Where_Clause">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
@project https://github.com/itfsw/mybatis-generator-plugin
-->
<where >
version = #{version,jdbcType=INTEGER}
<if test="example.oredCriteria.size() > 0">
<foreach close=")" collection="example.oredCriteria" item="criteria" open="and (" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
<foreach collection="criteria.picUrlsCriteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value,typeHandler=org.linlinjava.litemall.db.mybatis.JsonStringArrayTypeHandler}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value,typeHandler=org.linlinjava.litemall.db.mybatis.JsonStringArrayTypeHandler} and #{criterion.secondValue,typeHandler=org.linlinjava.litemall.db.mybatis.JsonStringArrayTypeHandler}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem,typeHandler=org.linlinjava.litemall.db.mybatis.JsonStringArrayTypeHandler}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</if>
</where >
</sql>
<sql id="Base_Column_List">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
id, user_id, username, mobile, feed_type, content, `status`, has_picture, pic_urls,
add_time, deleted, version
</sql>
<select id="selectByExample" parameterType="org.linlinjava.litemall.db.domain.LitemallFeedbackExample" resultMap="BaseResultMap">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from litemall_feedback
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByExampleSelective" parameterType="map" resultMap="BaseResultMap">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
@project https://github.com/itfsw/mybatis-generator-plugin
-->
select
<if test="example.distinct">
distinct
</if>
<choose>
<when test="selective != null and selective.length > 0">
<foreach collection="selective" item="column" separator=",">
${column.escapedColumnName}
</foreach>
</when>
<otherwise>
id, user_id, username, mobile, feed_type, content, `status`, has_picture, pic_urls,
add_time, deleted, version
</otherwise>
</choose>
from litemall_feedback
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
<if test="example.orderByClause != null">
order by ${example.orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
select
<include refid="Base_Column_List" />
from litemall_feedback
where id = #{id,jdbcType=INTEGER}
</select>
<select id="selectByPrimaryKeyWithLogicalDelete" parameterType="map" resultMap="BaseResultMap">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
@project https://github.com/itfsw/mybatis-generator-plugin
-->
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
select
<include refid="Base_Column_List" />
from litemall_feedback
where id = #{id,jdbcType=INTEGER}
and deleted =
<choose>
<when test="andLogicalDeleted">
'1'
</when>
<otherwise>
'0'
</otherwise>
</choose>
</select>
<select id="selectByPrimaryKeySelective" parameterType="map" resultMap="BaseResultMap">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
@project https://github.com/itfsw/mybatis-generator-plugin
-->
select
<choose>
<when test="selective != null and selective.length > 0">
<foreach collection="selective" item="column" separator=",">
${column.escapedColumnName}
</foreach>
</when>
<otherwise>
id, user_id, username, mobile, feed_type, content, `status`, has_picture, pic_urls,
add_time, deleted, version
</otherwise>
</choose>
from litemall_feedback
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
delete from litemall_feedback
where id = #{id,jdbcType=INTEGER}
</delete>
<delete id="deleteByExample" parameterType="org.linlinjava.litemall.db.domain.LitemallFeedbackExample">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
delete from litemall_feedback
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="org.linlinjava.litemall.db.domain.LitemallFeedback">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
SELECT LAST_INSERT_ID()
</selectKey>
insert into litemall_feedback (user_id, username, mobile,
feed_type, content, `status`,
has_picture, pic_urls,
add_time, deleted, version
)
values (#{userId,jdbcType=INTEGER}, #{username,jdbcType=VARCHAR}, #{mobile,jdbcType=VARCHAR},
#{feedType,jdbcType=VARCHAR}, #{content,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER},
#{hasPicture,jdbcType=BIT}, #{picUrls,jdbcType=VARCHAR,typeHandler=org.linlinjava.litemall.db.mybatis.JsonStringArrayTypeHandler},
#{addTime,jdbcType=TIMESTAMP}, #{deleted,jdbcType=BIT}, #{version,jdbcType=INTEGER}
)
</insert>
<insert id="insertSelective" parameterType="org.linlinjava.litemall.db.domain.LitemallFeedback">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
SELECT LAST_INSERT_ID()
</selectKey>
insert into litemall_feedback
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="userId != null">
user_id,
</if>
<if test="username != null">
username,
</if>
<if test="mobile != null">
mobile,
</if>
<if test="feedType != null">
feed_type,
</if>
<if test="content != null">
content,
</if>
<if test="status != null">
`status`,
</if>
<if test="hasPicture != null">
has_picture,
</if>
<if test="picUrls != null">
pic_urls,
</if>
<if test="addTime != null">
add_time,
</if>
<if test="deleted != null">
deleted,
</if>
<if test="version != null">
version,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="userId != null">
#{userId,jdbcType=INTEGER},
</if>
<if test="username != null">
#{username,jdbcType=VARCHAR},
</if>
<if test="mobile != null">
#{mobile,jdbcType=VARCHAR},
</if>
<if test="feedType != null">
#{feedType,jdbcType=VARCHAR},
</if>
<if test="content != null">
#{content,jdbcType=VARCHAR},
</if>
<if test="status != null">
#{status,jdbcType=INTEGER},
</if>
<if test="hasPicture != null">
#{hasPicture,jdbcType=BIT},
</if>
<if test="picUrls != null">
#{picUrls,jdbcType=VARCHAR,typeHandler=org.linlinjava.litemall.db.mybatis.JsonStringArrayTypeHandler},
</if>
<if test="addTime != null">
#{addTime,jdbcType=TIMESTAMP},
</if>
<if test="deleted != null">
#{deleted,jdbcType=BIT},
</if>
<if test="version != null">
#{version,jdbcType=INTEGER},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="org.linlinjava.litemall.db.domain.LitemallFeedbackExample" resultType="java.lang.Long">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
select count(*) from litemall_feedback
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update litemall_feedback
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=INTEGER},
</if>
<if test="record.userId != null">
user_id = #{record.userId,jdbcType=INTEGER},
</if>
<if test="record.username != null">
username = #{record.username,jdbcType=VARCHAR},
</if>
<if test="record.mobile != null">
mobile = #{record.mobile,jdbcType=VARCHAR},
</if>
<if test="record.feedType != null">
feed_type = #{record.feedType,jdbcType=VARCHAR},
</if>
<if test="record.content != null">
content = #{record.content,jdbcType=VARCHAR},
</if>
<if test="record.status != null">
`status` = #{record.status,jdbcType=INTEGER},
</if>
<if test="record.hasPicture != null">
has_picture = #{record.hasPicture,jdbcType=BIT},
</if>
<if test="record.picUrls != null">
pic_urls = #{record.picUrls,jdbcType=VARCHAR,typeHandler=org.linlinjava.litemall.db.mybatis.JsonStringArrayTypeHandler},
</if>
<if test="record.addTime != null">
add_time = #{record.addTime,jdbcType=TIMESTAMP},
</if>
<if test="record.deleted != null">
deleted = #{record.deleted,jdbcType=BIT},
</if>
<if test="record.version != null">
version = #{record.version,jdbcType=INTEGER},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update litemall_feedback
set id = #{record.id,jdbcType=INTEGER},
user_id = #{record.userId,jdbcType=INTEGER},
username = #{record.username,jdbcType=VARCHAR},
mobile = #{record.mobile,jdbcType=VARCHAR},
feed_type = #{record.feedType,jdbcType=VARCHAR},
content = #{record.content,jdbcType=VARCHAR},
`status` = #{record.status,jdbcType=INTEGER},
has_picture = #{record.hasPicture,jdbcType=BIT},
pic_urls = #{record.picUrls,jdbcType=VARCHAR,typeHandler=org.linlinjava.litemall.db.mybatis.JsonStringArrayTypeHandler},
add_time = #{record.addTime,jdbcType=TIMESTAMP},
deleted = #{record.deleted,jdbcType=BIT},
version = #{record.version,jdbcType=INTEGER}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="org.linlinjava.litemall.db.domain.LitemallFeedback">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update litemall_feedback
<set>
<if test="userId != null">
user_id = #{userId,jdbcType=INTEGER},
</if>
<if test="username != null">
username = #{username,jdbcType=VARCHAR},
</if>
<if test="mobile != null">
mobile = #{mobile,jdbcType=VARCHAR},
</if>
<if test="feedType != null">
feed_type = #{feedType,jdbcType=VARCHAR},
</if>
<if test="content != null">
content = #{content,jdbcType=VARCHAR},
</if>
<if test="status != null">
`status` = #{status,jdbcType=INTEGER},
</if>
<if test="hasPicture != null">
has_picture = #{hasPicture,jdbcType=BIT},
</if>
<if test="picUrls != null">
pic_urls = #{picUrls,jdbcType=VARCHAR,typeHandler=org.linlinjava.litemall.db.mybatis.JsonStringArrayTypeHandler},
</if>
<if test="addTime != null">
add_time = #{addTime,jdbcType=TIMESTAMP},
</if>
<if test="deleted != null">
deleted = #{deleted,jdbcType=BIT},
</if>
<if test="version != null">
version = #{version,jdbcType=INTEGER},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="org.linlinjava.litemall.db.domain.LitemallFeedback">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update litemall_feedback
set user_id = #{userId,jdbcType=INTEGER},
username = #{username,jdbcType=VARCHAR},
mobile = #{mobile,jdbcType=VARCHAR},
feed_type = #{feedType,jdbcType=VARCHAR},
content = #{content,jdbcType=VARCHAR},
`status` = #{status,jdbcType=INTEGER},
has_picture = #{hasPicture,jdbcType=BIT},
pic_urls = #{picUrls,jdbcType=VARCHAR,typeHandler=org.linlinjava.litemall.db.mybatis.JsonStringArrayTypeHandler},
add_time = #{addTime,jdbcType=TIMESTAMP},
deleted = #{deleted,jdbcType=BIT},
version = #{version,jdbcType=INTEGER}
where id = #{id,jdbcType=INTEGER}
</update>
<select id="selectOneByExample" parameterType="org.linlinjava.litemall.db.domain.LitemallFeedbackExample" resultMap="BaseResultMap">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
@project https://github.com/itfsw/mybatis-generator-plugin
-->
select
<include refid="Base_Column_List" />
from litemall_feedback
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
limit 1
</select>
<select id="selectOneByExampleSelective" parameterType="map" resultMap="BaseResultMap">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
@project https://github.com/itfsw/mybatis-generator-plugin
-->
select
<choose>
<when test="selective != null and selective.length > 0">
<foreach collection="selective" item="column" separator=",">
${column.escapedColumnName}
</foreach>
</when>
<otherwise>
id, user_id, username, mobile, feed_type, content, `status`, has_picture, pic_urls,
add_time, deleted, version
</otherwise>
</choose>
from litemall_feedback
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
<if test="example.orderByClause != null">
order by ${example.orderByClause}
</if>
limit 1
</select>
<update id="logicalDeleteByExample" parameterType="map">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
@project https://github.com/itfsw/mybatis-generator-plugin
-->
update litemall_feedback set deleted = 1
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="logicalDeleteByPrimaryKey" parameterType="java.lang.Integer">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
@project https://github.com/itfsw/mybatis-generator-plugin
-->
update litemall_feedback set deleted = 1
where id = #{id,jdbcType=INTEGER}
</update>
<delete id="deleteWithVersionByPrimaryKey" parameterType="map">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
@project https://github.com/itfsw/mybatis-generator-plugin
-->
delete from litemall_feedback
where version = #{version,jdbcType=INTEGER}
and id = #{key,jdbcType=INTEGER}
</delete>
<delete id="deleteWithVersionByExample" parameterType="map">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
@project https://github.com/itfsw/mybatis-generator-plugin
-->
delete from litemall_feedback
<if test="_parameter != null">
<include refid="Update_By_Example_With_Version_Where_Clause" />
</if>
</delete>
<update id="updateWithVersionByExample" parameterType="map">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
@project https://github.com/itfsw/mybatis-generator-plugin
-->
update litemall_feedback
set version = version + 1,
id = #{record.id,jdbcType=INTEGER},
user_id = #{record.userId,jdbcType=INTEGER},
username = #{record.username,jdbcType=VARCHAR},
mobile = #{record.mobile,jdbcType=VARCHAR},
feed_type = #{record.feedType,jdbcType=VARCHAR},
content = #{record.content,jdbcType=VARCHAR},
`status` = #{record.status,jdbcType=INTEGER},
has_picture = #{record.hasPicture,jdbcType=BIT},
pic_urls = #{record.picUrls,jdbcType=VARCHAR,typeHandler=org.linlinjava.litemall.db.mybatis.JsonStringArrayTypeHandler},
add_time = #{record.addTime,jdbcType=TIMESTAMP},
deleted = #{record.deleted,jdbcType=BIT}
<if test="_parameter != null">
<include refid="Update_By_Example_With_Version_Where_Clause" />
</if>
</update>
<update id="updateWithVersionByExampleSelective" parameterType="map">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
@project https://github.com/itfsw/mybatis-generator-plugin
-->
update litemall_feedback
<set>
<trim suffixOverrides=",">
version = version + 1,
<if test="record.id != null">
id = #{record.id,jdbcType=INTEGER},
</if>
<if test="record.userId != null">
user_id = #{record.userId,jdbcType=INTEGER},
</if>
<if test="record.username != null">
username = #{record.username,jdbcType=VARCHAR},
</if>
<if test="record.mobile != null">
mobile = #{record.mobile,jdbcType=VARCHAR},
</if>
<if test="record.feedType != null">
feed_type = #{record.feedType,jdbcType=VARCHAR},
</if>
<if test="record.content != null">
content = #{record.content,jdbcType=VARCHAR},
</if>
<if test="record.status != null">
`status` = #{record.status,jdbcType=INTEGER},
</if>
<if test="record.hasPicture != null">
has_picture = #{record.hasPicture,jdbcType=BIT},
</if>
<if test="record.picUrls != null">
pic_urls = #{record.picUrls,jdbcType=VARCHAR,typeHandler=org.linlinjava.litemall.db.mybatis.JsonStringArrayTypeHandler},
</if>
<if test="record.addTime != null">
add_time = #{record.addTime,jdbcType=TIMESTAMP},
</if>
<if test="record.deleted != null">
deleted = #{record.deleted,jdbcType=BIT},
</if>
</trim>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_With_Version_Where_Clause" />
</if>
</update>
<update id="updateWithVersionByPrimaryKey" parameterType="map">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
@project https://github.com/itfsw/mybatis-generator-plugin
-->
update litemall_feedback
set version = version + 1,
user_id = #{record.userId,jdbcType=INTEGER},
username = #{record.username,jdbcType=VARCHAR},
mobile = #{record.mobile,jdbcType=VARCHAR},
feed_type = #{record.feedType,jdbcType=VARCHAR},
content = #{record.content,jdbcType=VARCHAR},
`status` = #{record.status,jdbcType=INTEGER},
has_picture = #{record.hasPicture,jdbcType=BIT},
pic_urls = #{record.picUrls,jdbcType=VARCHAR,typeHandler=org.linlinjava.litemall.db.mybatis.JsonStringArrayTypeHandler},
add_time = #{record.addTime,jdbcType=TIMESTAMP},
deleted = #{record.deleted,jdbcType=BIT}
where version = #{version,jdbcType=INTEGER}
and id = #{record.id,jdbcType=INTEGER}
</update>
<update id="updateWithVersionByPrimaryKeySelective" parameterType="map">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
@project https://github.com/itfsw/mybatis-generator-plugin
-->
update litemall_feedback
<set>
<trim suffixOverrides=",">
version = version + 1,
<if test="record.userId != null">
user_id = #{record.userId,jdbcType=INTEGER},
</if>
<if test="record.username != null">
username = #{record.username,jdbcType=VARCHAR},
</if>
<if test="record.mobile != null">
mobile = #{record.mobile,jdbcType=VARCHAR},
</if>
<if test="record.feedType != null">
feed_type = #{record.feedType,jdbcType=VARCHAR},
</if>
<if test="record.content != null">
content = #{record.content,jdbcType=VARCHAR},
</if>
<if test="record.status != null">
`status` = #{record.status,jdbcType=INTEGER},
</if>
<if test="record.hasPicture != null">
has_picture = #{record.hasPicture,jdbcType=BIT},
</if>
<if test="record.picUrls != null">
pic_urls = #{record.picUrls,jdbcType=VARCHAR,typeHandler=org.linlinjava.litemall.db.mybatis.JsonStringArrayTypeHandler},
</if>
<if test="record.addTime != null">
add_time = #{record.addTime,jdbcType=TIMESTAMP},
</if>
<if test="record.deleted != null">
deleted = #{record.deleted,jdbcType=BIT},
</if>
</trim>
</set>
where version = #{version,jdbcType=INTEGER}
and id = #{record.id,jdbcType=INTEGER}
</update>
</mapper>

View File

@@ -49,6 +49,12 @@
<artifactId>weixin-java-miniapp</artifactId>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>1.2.45</version>
</dependency>
</dependencies>
<build>

View File

@@ -0,0 +1,102 @@
package org.linlinjava.litemall.wx.web;
import com.alibaba.fastjson.JSONObject;
import org.linlinjava.litemall.core.util.RegexUtil;
import org.linlinjava.litemall.core.util.ResponseUtil;
import org.linlinjava.litemall.db.domain.LitemallFeedback;
import org.linlinjava.litemall.db.domain.LitemallUser;
import org.linlinjava.litemall.db.service.LitemallFeedbackService;
import org.linlinjava.litemall.db.service.LitemallUserService;
import org.linlinjava.litemall.wx.annotation.LoginUser;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
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 java.io.BufferedReader;
import java.io.IOException;
import java.time.LocalDateTime;
/**
* @author Yogeek
* @date 2018/8/25 14:10
*/
@RestController
@RequestMapping("/wx/feedback")
@Validated
public class WxFeedbackController {
private final Log logger = LogFactory.getLog(WxFeedbackController.class);
@Autowired
private LitemallFeedbackService feedbackService;
@Autowired
protected HttpServletRequest request;
@Autowired
private LitemallUserService userService;
/**
* 意见反馈
*/
@PostMapping("submit")
@ResponseBody
public Object save(@LoginUser Integer userId){
if(userId == null){
return ResponseUtil.unlogin();
}
LitemallUser user = userService.findById(userId);
String username = user.getUsername();
//获取客户端对象
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]);
//状态默认是01表示状态已发生变化
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;
}
}

View File

@@ -7,6 +7,7 @@
"pages/ucenter/index/index",
"pages/ucenter/address/address",
"pages/ucenter/addressAdd/addressAdd",
"pages/ucenter/feedback/feedback",
"pages/ucenter/footprint/footprint",
"pages/ucenter/order/order",
"pages/ucenter/orderDetail/orderDetail",
@@ -50,25 +51,25 @@
"list": [
{
"pagePath": "pages/index/index",
"iconPath": "static/images/ic_menu_choice_nor.png",
"iconPath": "static/images/home.png",
"selectedIconPath": "static/images/home@selected.png",
"text": "首页"
},
{
"pagePath": "pages/catalog/catalog",
"iconPath": "static/images/ic_menu_sort_nor.png",
"iconPath": "static/images/category.png",
"selectedIconPath": "static/images/category@selected.png",
"text": "分类"
},
{
"pagePath": "pages/cart/cart",
"iconPath": "static/images/ic_menu_shoping_nor.png",
"iconPath": "static/images/cart.png",
"selectedIconPath": "static/images/cart@selected.png",
"text": "购物车"
},
{
"pagePath": "pages/ucenter/index/index",
"iconPath": "static/images/ic_menu_me_nor.png",
"iconPath": "static/images/my.png",
"selectedIconPath": "static/images/my@selected.png",
"text": "个人"
}

View File

@@ -1,86 +1,103 @@
.form-box{
width: 100%;
height: auto;
overflow: hidden;
padding: 0 40rpx;
margin-top: 200rpx;
background: #fff;
.form-box {
width: 100%;
height: auto;
overflow: hidden;
padding: 0 40rpx;
margin-top: 200rpx;
background: #fff;
}
.form-item{
position: relative;
background: #fff;
height: 96rpx;
border-bottom: 1px solid #d9d9d9;
.form-item {
position: relative;
background: #fff;
height: 96rpx;
border-bottom: 1px solid #d9d9d9;
}
.form-item .username, .form-item .password, .form-item .code{
position: absolute;
top: 26rpx;
left: 0;
display: block;
width: 100%;
height: 44rpx;
background: #fff;
color: #333;
font-size: 30rpx;
.form-item .username, .form-item .password, .form-item .code {
position: absolute;
top: 26rpx;
left: 0;
display: block;
width: 100%;
height: 44rpx;
background: #fff;
color: #333;
font-size: 30rpx;
}
.form-item-code{
margin-top:32rpx;
height: auto;
overflow: hidden;
width: 100%;
.form-item-code {
margin-top: 32rpx;
height: auto;
overflow: hidden;
width: 100%;
}
.form-item-code .form-item{
float: left;
width: 350rpx;
.form-item-code .form-item {
float: left;
width: 350rpx;
}
.form-item-code .code-img{
float: right;
margin-top: 4rpx;
height: 88rpx;
width: 236rpx;
.form-item-code .code-img {
float: right;
margin-top: 4rpx;
height: 88rpx;
width: 236rpx;
}
.form-item .clear{
position: absolute;
top: 26rpx;
right: 18rpx;
z-index: 2;
display: block;
background: #fff;
height: 44rpx;
width: 44rpx;
.form-item .clear {
position: absolute;
top: 26rpx;
right: 18rpx;
z-index: 2;
display: block;
background: #fff;
height: 44rpx;
width: 44rpx;
}
.login-btn{
margin: 60rpx 0 40rpx 0;
height: 96rpx;
line-height: 96rpx;
font-size: 30rpx;
width: 100%;
background: #b4282d;
border-radius: 6rpx;
.login-btn {
margin: 60rpx 0 40rpx 0;
height: 96rpx;
line-height: 96rpx;
font-size: 30rpx;
border-radius: 6rpx;
width: 90%;
color: #fff;
right: 0;
display: flex;
justify-content: center;
align-items: center;
position: flex;
bottom: 0;
left: 0;
padding: 0;
margin-left: 5%;
text-align: center;
/* padding-left: -5rpx; */
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%);
}
.form-item-text{
height: 35rpx;
width: 100%;
.form-item-text {
height: 35rpx;
width: 100%;
}
.form-item-text .register{
display: block;
height: 34rpx;
float: left;
font-size: 28rpx;
.form-item-text .register {
display: block;
height: 34rpx;
float: left;
font-size: 28rpx;
}
.form-item-text .reset{
display: block;
height: 34rpx;
float: right;
font-size: 28rpx;
}
.form-item-text .reset {
display: block;
height: 34rpx;
float: right;
font-size: 28rpx;
}

View File

@@ -1,26 +1,61 @@
.login-box{
width: 100%;
height: auto;
overflow: hidden;
padding: 0 40rpx;
margin-top: 200rpx;
background: #fff;
.login-box {
width: 100%;
height: auto;
overflow: hidden;
padding: 0 40rpx;
margin-top: 200rpx;
background: #fff;
}
.wx-login-btn{
margin: 60rpx 0 40rpx 0;
height: 96rpx;
line-height: 96rpx;
font-size: 30rpx;
width: 100%;
border-radius: 6rpx;
.wx-login-btn {
margin: 60rpx 0 40rpx 0;
height: 96rpx;
line-height: 96rpx;
font-size: 30rpx;
border-radius: 6rpx;
width: 90%;
color: #fff;
right: 0;
display: flex;
justify-content: center;
align-items: center;
position: flex;
bottom: 0;
left: 0;
padding: 0;
margin-left: 5%;
text-align: center;
/* padding-left: -5rpx; */
border-top-left-radius: 50rpx;
border-bottom-left-radius: 50rpx;
border-top-right-radius: 50rpx;
border-bottom-right-radius: 50rpx;
letter-spacing: 3rpx;
}
.account-login-btn{
margin: 60rpx 0 40rpx 0;
height: 96rpx;
line-height: 96rpx;
font-size: 30rpx;
width: 100%;
border-radius: 6rpx;
}
.account-login-btn {
width: 90%;
margin: 0 auto;
color: #fff;
font-size: 30rpx;
height: 96rpx;
line-height: 96rpx;
right: 0;
display: flex;
justify-content: center;
align-items: center;
position: flex;
bottom: 0;
left: 0;
border-radius: 0;
padding: 0;
margin-left: 5%;
text-align: center;
/* padding-left: -5rpx; */
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%);
}

View File

@@ -3,7 +3,7 @@
<view class="c">
<image src="http://nos.netease.com/mailpub/hxm/yanxuan-wap/p/20150730/style/img/icon-normal/noCart-a8fe3f12e5.png" />
<text>还没有登录</text>
<button type="primary" plain="true" bindtap="goLogin">去登录</button>
<button style="background-color:#A9A9A9" bindtap="goLogin">去登录</button>
</view>
</view>
<view class='login' wx:else>

View File

@@ -1,389 +1,531 @@
page{
height: 100%;
min-height: 100%;
background: #f4f4f4;
}
.container{
background: #f4f4f4;
width: 100%;
height: auto;
min-height: 100%;
overflow: hidden;
}
.service-policy{
width: 750rpx;
height: 73rpx;
background: #f4f4f4;
padding: 0 31.25rpx;
display: flex;
flex-flow: row nowrap;
align-items: center;
justify-content: space-between;
page {
height: 100%;
min-height: 100%;
background: #f4f4f4;
}
.service-policy .item{
background: url(http://nos.netease.com/mailpub/hxm/yanxuan-wap/p/20150730/style/img/icon-normal/servicePolicyRed-518d32d74b.png) 0 center no-repeat;
background-size: 10rpx;
padding-left: 15rpx;
display: flex;
align-items: center;
font-size: 25rpx;
color: #666;
.container {
background: #f4f4f4;
width: 100%;
height: auto;
min-height: 100%;
overflow: hidden;
}
.no-login{
width: 100%;
height: auto;
margin: 0 auto;
.service-policy {
width: 750rpx;
height: 73rpx;
background: #f4f4f4;
padding: 0 31.25rpx;
display: flex;
flex-flow: row nowrap;
align-items: center;
justify-content: space-between;
}
.no-login .c{
width: 100%;
height: auto;
margin-top: 200rpx;
.service-policy .item {
background: url(http://nos.netease.com/mailpub/hxm/yanxuan-wap/p/20150730/style/img/icon-normal/servicePolicyRed-518d32d74b.png) 0 center no-repeat;
background-size: 10rpx;
padding-left: 15rpx;
display: flex;
align-items: center;
font-size: 25rpx;
color: #666;
}
.no-login .c image{
margin: 0 auto;
display: block;
text-align: center;
width: 258rpx;
height: 258rpx;
.no-login {
width: 100%;
height: auto;
margin: 0 auto;
}
.no-login .c text{
margin: 0 auto;
display: block;
width: 258rpx;
height: 59rpx;
line-height: 29rpx;
text-align: center;
font-size: 50rpx;
color: #999;
.no-login .c {
width: 100%;
height: auto;
margin-top: 200rpx;
}
.no-login button{
width: 60%;
margin: 0 auto;
.no-login .c image {
margin: 0 auto;
display: block;
text-align: center;
width: 258rpx;
height: 258rpx;
}
.no-cart{
width: 100%;
height: auto;
margin: 0 auto;
.no-login .c text {
margin: 0 auto;
display: block;
width: 258rpx;
height: 59rpx;
line-height: 29rpx;
text-align: center;
font-size: 35rpx;
color: #999;
}
.no-cart .c{
width: 100%;
height: auto;
margin-top: 200rpx;
.no-login button {
width: 90%;
margin: 0 auto;
color: #fff;
font-size: 30rpx;
height: 96rpx;
line-height: 96rpx;
right: 0;
display: flex;
justify-content: center;
align-items: center;
position: flex;
bottom: 0;
left: 0;
border-radius: 0;
padding: 0;
margin-left: 5%;
text-align: center;
/* padding-left: -5rpx; */
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%);
}
.no-cart .c image{
margin: 0 auto;
display: block;
text-align: center;
width: 258rpx;
height: 258rpx;
.no-cart {
width: 100%;
height: auto;
margin: 0 auto;
}
.no-cart .c text{
margin: 0 auto;
display: block;
width: 258rpx;
height: 29rpx;
line-height: 29rpx;
text-align: center;
font-size: 29rpx;
color: #999;
.no-cart .c {
width: 100%;
height: auto;
margin-top: 200rpx;
}
.cart-view{
width: 100%;
height: auto;
overflow: hidden;
.no-cart .c image {
margin: 0 auto;
display: block;
text-align: center;
width: 258rpx;
height: 258rpx;
}
.cart-view .list{
height: auto;
width: 100%;
overflow: hidden;
margin-bottom: 120rpx;
.no-cart .c text {
margin: 0 auto;
display: block;
width: 258rpx;
height: 29rpx;
line-height: 29rpx;
text-align: center;
font-size: 29rpx;
color: #999;
}
.cart-view .group-item{
height: auto;
width: 100%;
background: #fff;
margin-bottom: 18rpx;
.cart-view {
width: 100%;
height: auto;
overflow: hidden;
}
.cart-view .item{
height: 164rpx;
width: 100%;
overflow: hidden;
}
.cart-view .item .checkbox{
float: left;
height: 34rpx;
width: 34rpx;
margin: 65rpx 18rpx 65rpx 26rpx;
background: url(http://nos.netease.com/mailpub/hxm/yanxuan-wap/p/20150730/style/img/icon-normal/checkbox-0e09baa37e.png) no-repeat;
background-size: 34rpx;
.cart-view .list {
height: auto;
width: 100%;
overflow: hidden;
margin-bottom: 120rpx;
}
.cart-view .item .checkbox.checked{
background: url(http://nos.netease.com/mailpub/hxm/yanxuan-wap/p/20150730/style/img/icon-normal/checkbox-checked-822e54472a.png) no-repeat;
background-size: 34rpx;
.cart-view .group-item {
height: auto;
width: 100%;
background: #fff;
margin-bottom: 18rpx;
}
.cart-view .item .cart-goods{
float: left;
height: 164rpx;
width: 672rpx;
border-bottom: 1px solid #f4f4f4;
.cart-view .item {
height: 164rpx;
width: 100%;
overflow: hidden;
}
.cart-view .item .img{
float: left;
height:125rpx;
width: 125rpx;
background: #f4f4f4;
margin: 19.5rpx 18rpx 19.5rpx 0;
.cart-view .item .checkbox {
float: left;
height: 34rpx;
width: 34rpx;
margin: 65rpx 18rpx 65rpx 26rpx;
background: url(http://nos.netease.com/mailpub/hxm/yanxuan-wap/p/20150730/style/img/icon-normal/checkbox-0e09baa37e.png) no-repeat;
background-size: 34rpx;
}
.cart-view .item .info{
float: left;
height:125rpx;
width: 503rpx;
margin: 19.5rpx 26rpx 19.5rpx 0;
.cart-view .item .checkbox.checked {
background: url(http://nos.netease.com/mailpub/hxm/yanxuan-wap/p/20150730/style/img/icon-normal/checkbox-checked-822e54472a.png) no-repeat;
background-size: 34rpx;
}
.cart-view .item .t{
margin: 8rpx 0;
height: 28rpx;
font-size: 25rpx;
color: #333;
overflow: hidden;
.cart-view .item .cart-goods {
float: left;
height: 164rpx;
width: 672rpx;
border-bottom: 1px solid #f4f4f4;
}
.cart-view .item .name{
height: 28rpx;
max-width: 310rpx;
line-height: 28rpx;
font-size: 25rpx;
color: #333;
overflow: hidden;
.cart-view .item .img {
float: left;
height: 125rpx;
width: 125rpx;
background: #f4f4f4;
margin: 19.5rpx 18rpx 19.5rpx 0;
}
.cart-view .item .num{
height: 28rpx;
line-height: 28rpx;
float: right;
.cart-view .item .info {
float: left;
height: 125rpx;
width: 503rpx;
margin: 19.5rpx 26rpx 19.5rpx 0;
}
.cart-view .item .attr{
margin-bottom: 17rpx;
height: 24rpx;
line-height: 24rpx;
font-size: 22rpx;
color: #666;
overflow: hidden;
.cart-view .item .t {
margin: 8rpx 0;
height: 28rpx;
font-size: 25rpx;
color: #333;
overflow: hidden;
}
.cart-view .item .b{
height: 28rpx;
line-height: 28rpx;
font-size: 25rpx;
color: #333;
overflow: hidden;
.cart-view .item .name {
height: 28rpx;
max-width: 310rpx;
line-height: 28rpx;
font-size: 25rpx;
color: #333;
overflow: hidden;
}
.cart-view .item .price{
float: left;
.cart-view .item .num {
height: 28rpx;
line-height: 28rpx;
float: right;
}
.cart-view .item .open{
height: 28rpx;
width: 150rpx;
display: block;
float: right;
background: url(http://nos.netease.com/mailpub/hxm/yanxuan-wap/p/20150730/style/img/icon-normal/arrowDown-d48093db25.png) right center no-repeat;
background-size: 25rpx;
font-size: 25rpx;
color: #333;
.cart-view .item .attr {
margin-bottom: 17rpx;
height: 24rpx;
line-height: 24rpx;
font-size: 22rpx;
color: #666;
overflow: hidden;
}
.cart-view .item.edit .t{
display: none;
.cart-view .item .b {
height: 28rpx;
line-height: 28rpx;
font-size: 25rpx;
color: #333;
overflow: hidden;
}
.cart-view .item.edit .attr{
text-align: right;
background: url(http://yanxuan.nosdn.127.net/hxm/yanxuan-wap/p/20161201/style/img/icon-normal/arrow-right1-e9828c5b35.png) right center no-repeat;
padding-right: 25rpx;
background-size: 12rpx 20rpx;
margin-bottom: 24rpx;
height: 39rpx;
line-height: 39rpx;
font-size: 24rpx;
color: #999;
overflow: hidden;
.cart-view .item .price {
float: left;
}
.cart-view .item.edit .b{
display: flex;
height: 52rpx;
overflow: hidden;
.cart-view .item .open {
height: 28rpx;
width: 150rpx;
display: block;
float: right;
background: url(http://nos.netease.com/mailpub/hxm/yanxuan-wap/p/20150730/style/img/icon-normal/arrowDown-d48093db25.png) right center no-repeat;
background-size: 25rpx;
font-size: 25rpx;
color: #333;
}
.cart-view .item.edit .price{
line-height: 52rpx;
height: 52rpx;
flex: 1;
.cart-view .item.edit .t {
display: none;
}
.cart-view .item .selnum{
display: none;
.cart-view .item.edit .attr {
text-align: right;
background: url(http://yanxuan.nosdn.127.net/hxm/yanxuan-wap/p/20161201/style/img/icon-normal/arrow-right1-e9828c5b35.png) right center no-repeat;
padding-right: 25rpx;
background-size: 12rpx 20rpx;
margin-bottom: 24rpx;
height: 39rpx;
line-height: 39rpx;
font-size: 24rpx;
color: #999;
overflow: hidden;
}
.cart-view .item.edit .selnum{
width: 235rpx;
height: 52rpx;
border: 1rpx solid #ccc;
display: flex;
.cart-view .item.edit .b {
display: flex;
height: 52rpx;
overflow: hidden;
}
.selnum .cut{
width: 70rpx;
height: 100%;
text-align: center;
line-height: 50rpx;
.cart-view .item.edit .price {
line-height: 52rpx;
height: 52rpx;
flex: 1;
}
.selnum .number{
flex: 1;
height: 100%;
text-align: center;
line-height: 68.75rpx;
border-left: 1px solid #ccc;
border-right: 1px solid #ccc;
float: left;
.cart-view .item .selnum {
display: none;
}
.selnum .add{
width: 80rpx;
height: 100%;
text-align: center;
line-height: 50rpx;
.cart-view .item.edit .selnum {
width: 235rpx;
height: 52rpx;
border: 1rpx solid #ccc;
display: flex;
}
.cart-view .group-item .header{
width: 100%;
height: 94rpx;
line-height: 94rpx;
padding: 0 26rpx;
border-bottom: 1px solid #f4f4f4;
.selnum .cut {
width: 70rpx;
height: 100%;
text-align: center;
line-height: 50rpx;
}
.cart-view .promotion .icon{
display: inline-block;
height: 24rpx;
width: 15rpx;
.selnum .number {
flex: 1;
height: 100%;
text-align: center;
line-height: 68.75rpx;
border-left: 1px solid #ccc;
border-right: 1px solid #ccc;
float: left;
}
.cart-view .promotion{
margin-top: 25.5rpx;
float: left;
height: 43rpx;
width: 480rpx;
/*margin-right: 84rpx;*/
line-height: 43rpx;
font-size: 0;
.selnum .add {
width: 80rpx;
height: 100%;
text-align: center;
line-height: 50rpx;
}
.cart-view .promotion .tag{
border: 1px solid #f48f18;
height: 37rpx;
line-height: 31rpx;
padding: 0 9rpx;
margin-right: 10rpx;
color: #f48f18;
font-size: 24.5rpx;
.cart-view .group-item .header {
width: 100%;
height: 94rpx;
line-height: 94rpx;
padding: 0 26rpx;
border-bottom: 1px solid #f4f4f4;
}
.cart-view .promotion .txt{
height: 43rpx;
line-height: 43rpx;
padding-right: 10rpx;
color: #333;
font-size: 29rpx;
overflow: hidden;
.cart-view .promotion .icon {
display: inline-block;
height: 24rpx;
width: 15rpx;
}
.cart-view .get{
margin-top: 18rpx;
float: right;
height: 58rpx;
padding-left: 14rpx;
border-left: 1px solid #d9d9d9;
line-height: 58rpx;
font-size: 29rpx;
color: #333;
.cart-view .promotion {
margin-top: 25.5rpx;
float: left;
height: 43rpx;
width: 480rpx;
/*margin-right: 84rpx;*/
line-height: 43rpx;
font-size: 0;
}
.cart-bottom{
position: fixed;
bottom:0;
left:0;
height: 100rpx;
width: 100%;
background: #fff;
display: flex;
.cart-view .promotion .tag {
border: 1px solid #f48f18;
height: 37rpx;
line-height: 31rpx;
padding: 0 9rpx;
margin-right: 10rpx;
color: #f48f18;
font-size: 24.5rpx;
}
.cart-bottom .checkbox{
height: 34rpx;
padding-left: 60rpx;
line-height: 34rpx;
margin: 33rpx 18rpx 33rpx 26rpx;
background: url(http://nos.netease.com/mailpub/hxm/yanxuan-wap/p/20150730/style/img/icon-normal/checkbox-0e09baa37e.png) no-repeat;
background-size: 34rpx;
font-size: 29rpx;
.cart-view .promotion .txt {
height: 43rpx;
line-height: 43rpx;
padding-right: 10rpx;
color: #333;
font-size: 29rpx;
overflow: hidden;
}
.cart-bottom .checkbox.checked{
background: url(http://nos.netease.com/mailpub/hxm/yanxuan-wap/p/20150730/style/img/icon-normal/checkbox-checked-822e54472a.png) no-repeat;
background-size: 34rpx;
.cart-view .get {
margin-top: 18rpx;
float: right;
height: 58rpx;
padding-left: 14rpx;
border-left: 1px solid #d9d9d9;
line-height: 58rpx;
font-size: 29rpx;
color: #333;
}
.cart-bottom .total{
height: 34rpx;
flex: 1;
margin: 33rpx 10rpx;
font-size: 29rpx;
.cart-bottom {
position: fixed;
bottom: 0;
left: 0;
height: 100rpx;
width: 100%;
background: #fff;
display: flex;
}
.cart-bottom .delete{
height: 34rpx;
width: auto;
margin: 33rpx 18rpx;
font-size: 29rpx;
.cart-bottom .checkbox {
height: 34rpx;
padding-left: 60rpx;
line-height: 34rpx;
margin: 33rpx 18rpx 33rpx 26rpx;
background: url(http://nos.netease.com/mailpub/hxm/yanxuan-wap/p/20150730/style/img/icon-normal/checkbox-0e09baa37e.png) no-repeat;
background-size: 34rpx;
font-size: 29rpx;
}
.cart-bottom .checkout{
height: 100rpx;
width: 210rpx;
text-align: center;
line-height: 100rpx;
font-size: 29rpx;
background: #b4282d;
color: #fff;
}
.cart-bottom .checkbox.checked {
background: url(http://nos.netease.com/mailpub/hxm/yanxuan-wap/p/20150730/style/img/icon-normal/checkbox-checked-822e54472a.png) no-repeat;
background-size: 34rpx;
}
.cart-bottom .total {
height: 34rpx;
flex: 1;
margin: 33rpx 10rpx;
font-size: 29rpx;
}
.cart-bottom .delete {
text-align: center;
width: 180rpx;
height: 80rpx;
line-height: 82rpx;
padding: 0;
margin: 0;
margin-left: -5rpx;
padding-right: 25rpx;
font-size: 25rpx;
color: #f4f4f4;
/* text-align: center; */
border-top-left-radius: 0rpx;
border-bottom-left-radius: 0rpx;
border-top-right-radius: 50rpx;
border-bottom-right-radius: 50rpx;
letter-spacing: 3rpx;
background-image: linear-gradient(to right, #9a9ba1 0%, #ae8b9c 100%);
}
.cart-bottom .checkout {
height: 100rpx;
width: 210rpx;
text-align: center;
line-height: 100rpx;
font-size: 29rpx;
background: #b4282d;
color: #fff;
}
.action_btn_area {
/* border: 1px solid #333; */
position: absolute;
display: flex;
justify-content: center;
align-items: center;
right: 0;
top: 0;
width: 380rpx;
height: 100rpx;
}
.action_btn_area .edit {
width: 140rpx;
/* border: 1px solid #000; */
height: 80rpx;
line-height: 82rpx;
padding: 0;
margin: 0;
margin-right: 5rpx;
text-align: center;
/* padding-left: 25rpx; */
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, #ff7701 100%); */
background-image: linear-gradient(to right, #AB956D 0%, #AB956D 100%);
}
.action_btn_area .checkout {
width: 140rpx;
height: 80rpx;
line-height: 82rpx;
padding: 0;
margin: 0;
margin-left: 5rpx;
/* padding-right: 25rpx; */
font-size: 25rpx;
color: #f4f4f4;
text-align: center;
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%);
}
.action_btn_area .delete {
width: 140rpx;
/* border: 1px solid #000; */
height: 80rpx;
line-height: 82rpx;
padding: 0;
margin: 0;
margin-right: 5rpx;
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%);
}
.action_btn_area .sure {
text-align: center;
width: 140rpx;
height: 80rpx;
line-height: 82rpx;
padding: 0;
margin: 0;
margin-right: 10rpx;
padding-left: -5rpx;
font-size: 25rpx;
color: #f4f4f4;
/* text-align: center; */
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, #AB956D 0%, #AB956D 100%);
/* background-image: linear-gradient(to right, #ff7701 0%, #fe4800 100%); */
}
.auth_btn {
position: fixed;
top: 55vh;
left: 10vw;
width: 80vw;
height: 96rpx;
line-height: 96rpx;
font-size: 25rpx;
color: #f4f4f4;
/* text-align: center; */
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, #8baaaa 0%, #9a9ba1 100%);
}

View File

@@ -68,9 +68,9 @@ page {
}
.catalog .nav .item.active {
color: #ab2b2b;
color: #AB956D;
font-size: 36rpx;
border-left: 6rpx solid #ab2b2b;
border-left: 6rpx solid #AB956D;
}
.catalog .cate {

View File

@@ -34,8 +34,8 @@
}
.cate-nav .item.active .name{
color: #ab2b2b;
border-bottom: 2px solid #ab2b2b;
color: #AB956D;
border-bottom: 2px solid #AB956D;
}
.cate-item{
@@ -113,5 +113,5 @@
height: 30rpx;
text-align: center;
font-size: 30rpx;
color: #b4282d;
color: #AB956D;
}

View File

@@ -41,6 +41,17 @@ Page({
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() {

View File

@@ -1,177 +1,193 @@
<view class="container">
<swiper class="goodsimgs" indicator-dots="true" autoplay="true" interval="3000" duration="1000">
<swiper-item wx:for="{{goods.gallery}}" wx:key="*this">
<image src="{{item}}" background-size="cover"></image>
</swiper-item>
</swiper>
<!-- 分享 -->
<view class="service-policy" wx:if="{{!isGroupon}}">
<button class="savesharebtn" bindtap="saveShare">分享朋友圈</button>
<button class="sharebtn" open-type="share">分享给朋友</button>
</view>
<view class="goods-info">
<view class="c">
<text class="name">{{goods.name}}</text>
<text class="desc">{{goods.goodsBrief}}</text>
<view class="price">
<view class="counterPrice">原价:¥{{goods.counterPrice}}</view>
<view class="retailPrice">现价:¥{{checkedSpecPrice}}</view>
</view>
<swiper class="goodsimgs" indicator-dots="true" autoplay="true" interval="3000" duration="1000">
<swiper-item wx:for="{{goods.gallery}}" wx:key="*this">
<image src="{{item}}" background-size="cover"></image>
</swiper-item>
</swiper>
<!-- 分享 -->
<view class='goods_name'>
<view class='goods_name_left'>{{goods.name}}</view>
<view class="goods_name_right" bindtap="shareFriendOrCircle">分享</view>
</view>
<view class="share-pop-box" hidden="{{!openShare}}">
<view class="share-pop">
<view class="close" bindtap="closeShare">
<image class="icon" src="/static/images/icon_close.png"></image>
</view>
<view class='share-info'>
<button class="sharebtn" open-type="share" wx:if="{{!isGroupon}}">
<image class='sharebtn_image' src='/static/images/wechat.png'></image>
<view class='sharebtn_text'>分享给好友</view>
</button>
<button class="savesharebtn" bindtap="saveShare" wx:if="{{!isGroupon}}">
<image class='sharebtn_image' src='/static/images/friend.png'></image>
<view class='sharebtn_text'>发朋友圈</view>
</button>
</view>
</view>
</view>
<view class="goods-info">
<view class="c">
<text class="desc">{{goods.goodsBrief}}</text>
<view class="price">
<view class="counterPrice">原价:¥{{goods.counterPrice}}</view>
<view class="retailPrice">现价:¥{{checkedSpecPrice}}</view>
</view>
<view class="brand" wx:if="{{brand.name}}">
<navigator url="../brandDetail/brandDetail?id={{brand.id}}">
<text>{{brand.name}}</text>
</navigator>
</view>
</view>
</view>
<view class="section-nav section-attr" bindtap="switchAttrPop">
<view class="t">{{checkedSpecText}}</view>
<image class="i" src="/static/images/address_right.png" background-size="cover"></image>
</view>
<view class="comments" wx:if="{{comment.count > 0}}">
<view class="h">
<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>
</view>
<view class="b">
<view class="item" wx:for="{{comment.data}}" wx:key="id">
<view class="info">
<view class="user">
<image src="{{item.avatar}}"></image>
<text>{{item.nickname}}</text>
</view>
<view class="time">{{item.addTime}}</view>
<view class="brand" wx:if="{{brand.name}}">
<navigator url="../brandDetail/brandDetail?id={{brand.id}}">
<text>{{brand.name}}</text>
</navigator>
</view>
</view>
<view class="content">
{{item.content}}
</view>
<view class="imgs" wx:if="{{item.picList.length > 0}}">
<image class="img" wx:for="{{item.picList}}" wx:key="*this" wx:for-item="iitem" src="{{iitem}} "></image>
</view>
</view>
</view>
</view>
<view class="goods-attr">
<view class="t">商品参数</view>
<view class="l">
<view class="item" wx:for="{{attribute}}" wx:key="name">
<text class="left">{{item.attribute}}</text>
<text class="right">{{item.value}}</text>
</view>
<view class="section-nav section-attr" bindtap="switchAttrPop">
<view class="t">{{checkedSpecText}}</view>
<image class="i" src="/static/images/address_right.png" background-size="cover"></image>
</view>
<view class="comments" wx:if="{{comment.count > 0}}">
<view class="h">
<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>
</view>
<view class="b">
<view class="item" wx:for="{{comment.data}}" wx:key="id">
<view class="info">
<view class="user">
<image src="{{item.avatar}}"></image>
<text>{{item.nickname}}</text>
</view>
<view class="time">{{item.addTime}}</view>
</view>
<view class="content">
{{item.content}}
</view>
<view class="imgs" wx:if="{{item.picList.length > 0}}">
<image class="img" wx:for="{{item.picList}}" wx:key="*this" wx:for-item="iitem" src="{{iitem}} "></image>
</view>
</view>
</view>
</view>
<view class="goods-attr">
<view class="t">商品参数</view>
<view class="l">
<view class="item" wx:for="{{attribute}}" wx:key="name">
<text class="left">{{item.attribute}}</text>
<text class="right">{{item.value}}</text>
</view>
</view>
</view>
</view>
<view class="detail">
<import src="/lib/wxParse/wxParse.wxml" />
<template is="wxParse" data="{{wxParseData:goodsDetail.nodes}}" />
</view>
<view class="detail">
<import src="/lib/wxParse/wxParse.wxml" />
<template is="wxParse" data="{{wxParseData:goodsDetail.nodes}}" />
</view>
<view class="common-problem">
<view class="h">
<view class="line"></view>
<text class="title">常见问题</text>
</view>
<view class="b">
<view class="item" wx:for="{{issueList}}" wx:key="id">
<view class="question-box">
<text class="spot"></text>
<text class="question">{{item.question}}</text>
<view class="common-problem">
<view class="h">
<view class="line"></view>
<text class="title">常见问题</text>
</view>
<view class="answer">
{{item.answer}}
<view class="b">
<view class="item" wx:for="{{issueList}}" wx:key="id">
<view class="question-box">
<text class="spot"></text>
<text class="question">{{item.question}}</text>
</view>
<view class="answer">
{{item.answer}}
</view>
</view>
</view>
</view>
</view>
</view>
<!-- 大家都在看 -->
<view class="related-goods" wx:if="{{relatedGoods.length > 0}}">
<view class="h">
<view class="line"></view>
<text class="title">大家都在看</text>
<!-- 大家都在看 -->
<view class="related-goods" wx:if="{{relatedGoods.length > 0}}">
<view class="h">
<view class="line"></view>
<text class="title">大家都在看</text>
</view>
<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.picUrl}}" background-size="cover"></image>
<text class="name">{{item.name}}</text>
<text class="price">¥{{item.retailPrice}}</text>
</navigator>
</view>
</view>
</view>
<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.picUrl}}" background-size="cover"></image>
<text class="name">{{item.name}}</text>
<text class="price">¥{{item.retailPrice}}</text>
</navigator>
</view>
</view>
</view>
</view>
<!-- 规格选择界面 -->
<view class="attr-pop-box" hidden="{{!openAttr}}">
<view class="attr-pop">
<view class="close" bindtap="closeAttr">
<image class="icon" src="/static/images/icon_close.png"></image>
<view class="attr-pop">
<view class="close" bindtap="closeAttr">
<image class="icon" src="/static/images/icon_close.png"></image>
</view>
<view class="img-info">
<image class="img" src="{{goods.picUrl}}"></image>
<view class="info">
<view class="c">
<view class="p">价格:¥{{checkedSpecPrice}}</view>
<view class="a">{{tmpSpecText}}</view>
</view>
</view>
</view>
<!-- 规格列表 -->
<view class="spec-con">
<view class="spec-item" wx:for="{{specificationList}}" wx:key="name">
<view class="name">{{item.name}}</view>
<view class="values">
<view class="value {{vitem.checked ? 'selected' : ''}}" bindtap="clickSkuValue" wx:for="{{item.valueList}}" wx:for-item="vitem" wx:key="{{vitem.id}}" data-value-id="{{vitem.id}}" data-name="{{vitem.specification}}">{{vitem.value}}</view>
</view>
</view>
<view class="spec-con" wx:if="{{groupon.length > 0}}">
<view class="spec-item">
<view class="name">团购立减</view>
<view class="values">
<view class="value {{vitem.checked ? 'selected' : ''}}" bindtap="clickGroupon" wx:for="{{groupon}}" wx:for-item="vitem" wx:key="{{vitem.id}}" data-value-id="{{vitem.id}}" data-name="{{vitem.specification}}">¥{{vitem.discount}} ({{vitem.discountMember}}人)</view>
</view>
</view>
</view>
<!-- 数量 -->
<view class="number-item">
<view class="name">数量</view>
<view class="selnum">
<view class="cut" bindtap="cutNumber">-</view>
<input value="{{number}}" class="number" disabled="true" type="number" />
<view class="add" bindtap="addNumber">+</view>
</view>
</view>
</view>
</view>
<view class="img-info">
<image class="img" src="{{goods.picUrl}}"></image>
<view class="info">
<view class="c">
<view class="p">价格:¥{{checkedSpecPrice}}</view>
<view class="a">{{tmpSpecText}}</view>
</view>
</view>
</view>
<!-- 规格列表 -->
<view class="spec-con">
<view class="spec-item" wx:for="{{specificationList}}" wx:key="name">
<view class="name">{{item.name}}</view>
<view class="values">
<view class="value {{vitem.checked ? 'selected' : ''}}" bindtap="clickSkuValue" wx:for="{{item.valueList}}" wx:for-item="vitem" wx:key="{{vitem.id}}" data-value-id="{{vitem.id}}" data-name="{{vitem.specification}}">{{vitem.value}}</view>
</view>
</view>
<view class="spec-con" wx:if="{{groupon.length > 0}}">
<view class="spec-item">
<view class="name">团购立减</view>
<view class="values">
<view class="value {{vitem.checked ? 'selected' : ''}}" bindtap="clickGroupon" wx:for="{{groupon}}" wx:for-item="vitem" wx:key="{{vitem.id}}" data-value-id="{{vitem.id}}" data-name="{{vitem.specification}}">¥{{vitem.discount}} ({{vitem.discountMember}}人)</view>
</view>
</view>
</view>
<!-- 数量 -->
<view class="number-item">
<view class="name">数量</view>
<view class="selnum">
<view class="cut" bindtap="cutNumber">-</view>
<input value="{{number}}" class="number" disabled="true" type="number" />
<view class="add" bindtap="addNumber">+</view>
</view>
</view>
</view>
</view>
</view>
<!-- 联系客服 -->
<view class="contact">
<contact-button style="opacity:0;position:absolute;" type="default-dark" session-from="weapp" size="27">
</contact-button>
<contact-button style="opacity:0;position:absolute;" type="default-dark" session-from="weapp" size="27">
</contact-button>
</view>
<!-- 底部按钮 -->
<view class="bottom-btn">
<view class="l l-collect" bindtap="addCollectOrNot" wx:if="{{!isGroupon}}">
<image class="icon" src="{{ collectImage }}"></image>
</view>
<view class="l l-cart" wx:if="{{!isGroupon}}">
<view class="box">
<text class="cart-count">{{cartGoodsCount}}</text>
<image bindtap="openCartPage" class="icon" src="/static/images/ic_menu_shoping_nor.png"></image>
<view class="l l-collect" bindtap="addCollectOrNot" wx:if="{{!isGroupon}}">
<image class="icon" src="{{ collectImage }}"></image>
</view>
</view>
<view class="r" bindtap="addToCart" wx:if="{{!soldout}}" wx:if="{{!isGroupon}}">加入购物车</view>
<view class="c" bindtap="addFast" wx:if="{{!soldout}}">{{isGroupon?'参加团购':'立即购买'}}</view>
<view class="n" wx:if="{{soldout}}">商品已售空</view>
<view class="l l-cart" wx:if="{{!isGroupon}}">
<view class="box">
<text class="cart-count">{{cartGoodsCount}}</text>
<image bindtap="openCartPage" class="icon" src="/static/images/ic_menu_shoping_nor.png"></image>
</view>
</view>
<view class="r" bindtap="addToCart" wx:if="{{!soldout}}" wx:if="{{!isGroupon}}">加入购物车</view>
<view class="c" bindtap="addFast" wx:if="{{!soldout}}">{{isGroupon?'参加团购':'立即购买'}}</view>
<view class="n" wx:if="{{soldout}}">商品已售空</view>
</view>

View File

@@ -12,6 +12,30 @@
height: 750rpx;
}
.commodity_screen {
width: 100%;
height: 100%;
position: fixed;
top: 0;
left: 0;
background: #000;
opacity: 0.2;
overflow: hidden;
z-index: 1000;
color: #fff;
}
.commodity_attr_box {
width: 100%;
overflow: hidden;
position: fixed;
bottom: 0;
left: 0;
z-index: 2000;
background: #fff;
padding-top: 20rpx;
}
/* .service-policy {
width: 750rpx;
height: 73rpx;
@@ -52,14 +76,47 @@
.goods-info .c text {
display: block;
width: 687.5rpx;
text-align: center;
text-align: left;
}
.goods-info .name {
height: 41rpx;
margin-bottom: 5.208rpx;
font-size: 41rpx;
line-height: 41rpx;
.goods_name {
/* border: 1px solid black; */
height: 86rpx;
line-height: 86rpx;
border-bottom: 1px solid #fafafa;
}
.goods_name_left {
/* border: 1px solid #757575; */
float: left;
height: 86rpx;
font-weight: 550;
line-height: 86rpx;
margin-left: 35rpx;
font-size: 38rpx;
letter-spacing: 1rpx;
}
.goods_name_right {
float: right;
font-weight: 550;
margin-top: 28rpx;
width: 140rpx;
height: 80rpx;
line-height: 82rpx;
padding: 0;
margin: 0;
margin-right: 0rpx;
text-align: center;
font-size: 25rpx;
color: #f4f4f4;
border-top-left-radius: 50rpx;
border-bottom-left-radius: 50rpx;
border-top-right-radius: 0rpx;
border-bottom-right-radius: 0rpx;
letter-spacing: 3rpx;
/* background-image: linear-gradient(to right, #ff7701 100%); */
background-image: linear-gradient(to right, #9a9ba1 0%, #9a9ba1 100%);
}
.goods-info .desc {
@@ -71,29 +128,28 @@
}
.goods-info .price {
height: 70rpx;
align-content: center;
height: 70rpx;
align-content: center;
}
.goods-info .counterPrice {
float: left;
padding-left: 120rpx;
text-decoration: line-through;
font-size: 30rpx;
color: #999;
float: left;
padding-left: 0rpx;
text-decoration: line-through;
font-size: 30rpx;
color: #999;
}
.goods-info .retailPrice {
/* float: right; */
padding-left: 60rpx;
font-size: 30rpx;
color: #a78845;
padding-left: 5%;
font-size: 30rpx;
color: #a78845;
}
.goods-info .brand {
margin-top: 23rpx;
min-height: 40rpx;
text-align: center;
text-align: left;
}
.goods-info .brand text {
@@ -431,7 +487,7 @@
width: 750rpx;
height: auto;
overflow: hidden;
padding-bottom: 80rpx;
padding-bottom: 80rpx;
}
.related-goods .h {
@@ -601,7 +657,7 @@
.bottom-btn .c {
float: left;
background: #f48f18;
background: #b4282d;
height: 100rpx;
line-height: 96rpx;
flex: 1;
@@ -611,8 +667,8 @@
}
.bottom-btn .r {
border: 1px solid #b4282d;
background: #b4282d;
border: 1px solid #f48f18;
background: #f48f18;
float: left;
height: 100rpx;
line-height: 96rpx;
@@ -767,74 +823,126 @@
line-height: 65rpx;
}
.contact {
height: 100rpx;
width: 100rpx;
background-color: #008000;
border-radius: 100%;
position: fixed;
bottom: 150rpx;
right: 20rpx;
display: flex;
align-items: center;
justify-content: center;
z-index: 9;
flex-direction: column;
/*line-height: 100rpx;
text-align: center;
padding-top: 26rpx;*/
bottom: 96rpx;
right: 10rpx;
font-size: 20rpx;
color: #008000;
box-sizing: border-box;
background: url("https://litemall.oss-cn-shenzhen.aliyuncs.com/kefu.png") no-repeat center 21rpx;
background-size: 55rpx auto;
}
.contact .name {
.share-pop-box {
width: 100%;
height: 100%;
position: fixed;
background: rgba(0, 0, 0, 0.5);
z-index: 8;
bottom: 0;
/* display: none; */
}
.share-pop {
width: 100%;
height: auto;
max-height: 780rpx;
padding: 31.25rpx;
background: #fff;
position: fixed;
z-index: 9;
bottom: 100rpx;
}
.share-pop .close {
position: absolute;
width: 48rpx;
height: 48rpx;
right: 31.25rpx;
top: 31.25rpx;
}
.share-pop .close .icon {
width: 48rpx;
height: 48rpx;
}
.share-pop .share-info {
width: 100%;
height: 225rpx;
overflow: hidden;
margin-bottom: 41.5rpx;
}
.sharebtn {
top: 75rpx;
background: none !important;
font-size: 32rpx;
max-width: 80rpx;
color: #fff;
color: #fff !important;
border-radius: 0%;
width: 175rpx;
height: 150rpx;
text-align: center;
display: flex;
justify-content: center;
align-items: center;
flex-wrap: wrap;
float: left;
background: #fff;
border-bottom: 0px solid #fafafa;
margin-left: 15%;
}
.service-policy {
width: 100%;
height: 96rpx;
/* background: #d3b676; */
border: 2px solid #fff;
/* align-items: center; */
.sharebtn::after {
border: none;
border-radius: 0%;
}
.service-policy .sharebtn {
width: 49.5%;
float: right;
border: none;
height: 80rpx;
font-size: 32rpx;
background: #d3b676;
text-align: center;
color: #fff;
border-radius:0%;
.savesharebtn {
top: 75rpx;
background: none !important;
font-size: 32rpx;
color: #fff !important;
border-radius: 0%;
width: 175rpx;
height: 150rpx;
text-align: center;
display: flex;
justify-content: center;
align-items: center;
flex-wrap: wrap;
float: right;
background: #fff;
border-bottom: 0px solid #fafafa;
margin-right: 15%;
}
.service-policy .sharebtn::after {
border: none;
border-radius:0%;
.savesharebtn::after {
border: none;
border-radius: 0%;
}
.service-policy .savesharebtn {
width: 49.5%;
float: left;
border: none;
height: 80rpx;
font-size: 32rpx;
background: #d3b676;
text-align: center;
color: #fff;
border-radius:0%;
.sharebtn_image {
/* border: 1px solid #757575; */
width: 128rpx;
height: 128rpx;
margin-top: 0rpx;
}
.service-policy .savesharebtn::after {
border: none;
border-radius:0%;
.sharebtn_text {
/* border: 1px solid #757575; */
width: 150rpx;
margin-bottom: 2rpx;
height: 20rpx;
line-height: 20rpx;
font-size: 20rpx;
color: #555;
}
.separate {
background: #e0e3da;
width: 100%;
height: 6rpx;
}

View File

@@ -9,19 +9,22 @@
}
.m-menu {
/* border: 1px solid black; */
/* height: 280rpx; */
background: #fff;
/* padding: 0 25rpx; */
display: flex;
height: 181rpx;
width: 750rpx;
flex-flow: row nowrap;
/* justify-content: center; */
align-items: center;
justify-content: space-between;
background-color: #fff;
flex-wrap: wrap;
padding-bottom: 0rpx;
padding-top: 25rpx
}
.m-menu .item {
flex: 1;
display: block;
padding: 20rpx 0;
/* border: 1px solid black; */
width: 150rpx;
height: 126rpx;
}
.m-menu image {
@@ -192,7 +195,7 @@
.a-groupon .b .price {
width: 476rpx;
display: flex;
color: #b4282d;
color: #AB956D;
line-height: 50rpx;
font-size: 33rpx;
}
@@ -249,7 +252,7 @@
text-align: center;
line-height: 30rpx;
font-size: 30rpx;
color: #b4282d;
color: #AB956D;
}
.a-popular {
@@ -310,7 +313,7 @@
.a-popular .b .price {
width: 456rpx;
display: block;
color: #b4282d;
color: #AB956D;
line-height: 50rpx;
font-size: 33rpx;
}
@@ -354,7 +357,7 @@
.a-topic .b .np .price {
margin-left: 20.8rpx;
color: #b4282d;
color: #AB956D;
}
.a-topic .b .desc {
@@ -433,7 +436,7 @@
height: 30rpx;
text-align: center;
font-size: 30rpx;
color: #b4282d;
color: #AB956D;
}
.good-grid .more-item{

View File

@@ -0,0 +1,109 @@
var util = require('../../../utils/util.js');
var api = require('../../../config/api.js');
var app = getApp();
Page({
data: {
array: ['请选择反馈类型', '商品相关', '功能异常', '优化建议', '其他'],
index: 0,
content:'',
contentLength:0,
mobile:''
},
bindPickerChange: function (e) {
console.log('picker发送选择改变携带值为', e.detail.value);
this.setData({
index: e.detail.value
});
},
mobileInput: function (e) {
let that = this;
this.setData({
mobile: e.detail.value,
});
console.log(that.data.mobile);
},
contentInput: function (e) {
let that = this;
this.setData({
contentLength: e.detail.cursor,
content: e.detail.value,
});
console.log(that.data.content);
},
cleanMobile:function(){
let that = this;
},
sbmitFeedback : function(e){
let that = this;
if (that.data.index == 0){
util.showErrorToast('请选择反馈类型');
return false;
}
if (that.data.content == '') {
util.showErrorToast('请输入反馈内容');
return false;
}
if (that.data.mobile == '') {
util.showErrorToast('请输入手机号码');
return false;
}
wx.showLoading({
title: '提交中...',
mask:true,
success: function () {
}
});
console.log(that.data);
util.request(api.FeedbackAdd, { mobile: that.data.mobile, index: that.data.index, content: that.data.content},'POST').then(function (res) {
if (res.errno === 0) {
console.log(res.data);
wx.hideLoading();
wx.showToast({
title: res.data,
icon: 'success',
duration: 2000,
complete: function () {
console.log('重新加载');
that.setData({
index: 0,
content: '',
contentLength: 0,
mobile: ''
});
}
});
} else {
util.showErrorToast(res.data);
}
});
},
onLoad: function (options) {
},
onReady: function () {
},
onShow: function () {
},
onHide: function () {
// 页面隐藏
},
onUnload: function () {
// 页面关闭
}
})

View File

@@ -0,0 +1,3 @@
{
}

View File

@@ -0,0 +1,27 @@
<view class="container">
<picker bindchange="bindPickerChange" value="{{index}}" range="{{array}}">
<view class="picker">
<view class="fb-type">
<view class="type-label">{{array[index]}}</view>
<image class="type-icon" src="http://yanxuan.nosdn.127.net/hxm/yanxuan-wap/p/20161201/style/img/icon-normal/pickerArrow-a8b918f05f.png"></image>
</view>
</view>
</picker>
<view class="fb-body">
<textarea class="content" placeholder="对我们网站、商品、服务,你还有什么建议吗?你还希望在商城上买到什么?请告诉我们..." bindinput ="contentInput" maxlength="500" auto-focus="true" value="{{content}}"/>
<view class="text-count">{{contentLength}}/500</view>
</view>
<view class="fb-mobile">
<view class="label">手机号码</view>
<view class="mobile-box">
<input class="mobile" maxlength="11" type="number" placeholder="方便我们与你联系" bindinput ="mobileInput" value="{{mobile}}"/>
<!--
<image class="clear-icon" src="https://platform-wxmall.oss-cn-beijing.aliyuncs.com/upload/20180727/150647657fcdd0.png" bindtap="cleanMobile"></image>
-->
</view>
</view>
<view class="fb-btn" bindtap="sbmitFeedback">提交</view>
</view>

View File

@@ -0,0 +1,131 @@
page{
background: #f4f4f4;
min-height: 100%;
}
.container{
background: #f4f4f4;
min-height: 100%;
padding-top: 30rpx;
}
.fb-type{
height: 104rpx;
width: 100%;
background: #fff;
margin-bottom: 20rpx;
display: flex;
flex-direction: row;
align-items: center;
padding-left: 30rpx;
padding-right: 30rpx;
}
.fb-type .type-label{
height: 36rpx;
flex: 1;
color: #333;
font-size: 28rpx;
}
.fb-type .type-icon{
height: 36rpx;
width: 36rpx;
}
.fb-body{
width: 100%;
background: #fff;
height: 374rpx;
padding: 18rpx 30rpx 64rpx 30rpx;
}
.fb-body .content{
width: 100%;
height: 100%;
color: #333;
line-height: 40rpx;
font-size: 28rpx;
}
.fb-body .text-count{
padding-top: 17rpx;
line-height: 30rpx;
float: right;
color: #666;
font-size: 24rpx;
}
.fb-mobile{
height: 162rpx;
width: 100%;
}
.fb-mobile .label{
height: 58rpx;
width: 100%;
padding-top: 14rpx;
padding-bottom: 11rpx;
color: #7f7f7f;
font-size: 24rpx;
padding-left: 30rpx;
padding-right: 30rpx;
line-height: 33rpx;
}
.fb-mobile .mobile-box{
height: 104rpx;
width: 100%;
color: #333;
padding-left: 30rpx;
padding-right: 30rpx;
font-size: 24rpx;
background: #fff;
position: relative;
}
.fb-mobile .mobile{
position: absolute;
top: 27rpx;
left: 30rpx;
height: 50rpx;
width: 100%;
color: #333;
line-height: 50rpx;
font-size: 24rpx;
}
.clear-icon{
position: absolute;
top: 43rpx;
right: 30rpx;
width: 48rpx;
height: 48rpx;
}
.fb-btn{
right: 0;
display: flex;
justify-content: center;
align-items: center;
width: 80%;
height: 90rpx;
line-height: 98rpx;
position: absolute;
bottom: 0;
left: 0;
border-radius: 0;
padding: 0;
margin: 0;
margin-left: 10%;
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%);
}

View File

@@ -51,6 +51,21 @@ Page({
url: "/pages/auth/login/login"
});
}
},
goOrderIndex(e) {
let tab = e.currentTarget.dataset.index
let route = e.currentTarget.dataset.route
try {
wx.setStorageSync('tab', tab);
} catch (e) {
}
wx.navigateTo({
url: route,
success: function(res) {},
fail: function(res) {},
complete: function(res) {},
})
},
goCoupon() {
if (app.globalData.hasLogin) {
@@ -85,6 +100,17 @@ Page({
});
};
},
goFeedback(e) {
if (app.globalData.hasLogin) {
wx.navigateTo({
url: "/pages/ucenter/feedback/feedback"
});
} else {
wx.navigateTo({
url: "/pages/auth/login/login"
});
};
},
goFootprint() {
if (app.globalData.hasLogin) {
wx.navigateTo({

View File

@@ -6,78 +6,90 @@
</view>
</view>
<view class="user-menu">
<view class="item">
<view class="a" bindtap="goOrder">
<text class="icon order"></text>
<text class="txt">我的订单</text>
</view>
<view class='separate'></view>
<view class='user_area'>
<view class='user_row' bindtap='goOrder'>
<view class='user_row_left'>我的订单</view>
<image class='user_row_right' src='/static/images/goright.png'></image>
</view>
<view class="item">
<view class="a" bindtap="goCoupon">
<text class="icon coupon"></text>
<text class="txt">优惠券</text>
<view class='user_column'>
<view class='user_column_item' bindtap='goOrderIndex' data-index='1' data-route='/pages/ucenter/order/order'>
<image class='user_column_item_image' src='/static/images/pendpay.png'></image>
<view class='user_column_item_text'>待付款</view>
</view>
</view>
<view class="item no-border" bindtap="goGroupon">
<view class="a">
<text class="icon gift"></text>
<text class="txt">团购</text>
<view class='user_column_item' bindtap='goOrderIndex' data-index='2' data-route='/pages/ucenter/order/order'>
<image class='user_column_item_image' src='/static/images/send.png'></image>
<view class='user_column_item_text'>待发货</view>
</view>
</view>
<view class="item">
<view class="a" bindtap="goCollect">
<image class="user-menu .icon.collect" src="/static/images/icon_collect.png"></image>
<text class="txt">我的收藏</text>
<view class='user_column_item' bindtap='goOrderIndex' data-index='3' data-route='/pages/ucenter/order/order'>
<image class='user_column_item_image' src='/static/images/receive.png'></image>
<view class='user_column_item_text'>待收货</view>
</view>
</view>
<view class="item">
<view class="a" bindtap="goFootprint">
<image class="user-menu .icon.collect" src="/static/images/foot.png"></image>
<text class="txt">我的足迹</text>
</view>
</view>
<!-- <view class="item no-border">
<view class="a">
<text class="icon kefu"></text>
<text class="txt">会员福利</text>
</view>
</view> -->
<view class="item">
<view class="a" bindtap="goAddress">
<text class="icon address"></text>
<text class="txt">地址管理</text>
</view>
</view>
<!-- <view class="item">
<view class="a">
<text class="icon security"></text>
<text class="txt">账号安全</text>
</view>
</view> -->
<!-- 开发环境看不到效果,但是线上环境可以正常使用-->
<!-- 开发者参考以下文档自行测试,建议直接采用文档中的网页版客服工具 -->
<!-- https://developers.weixin.qq.com/miniprogram/introduction/custom.html#功能介绍 -->
<button class="item" open-type="contact" size="20" session-from="weapp">
<view class="a">
<text class="icon kefu"></text>
<text class="txt">联系客服</text>
</view>
</button>
<button class="item" open-type="getPhoneNumber" bindgetphonenumber="bindPhoneNumber">
<view class="a">
<image class="user-menu .icon.phone" src="/static/images/mobile.png"></image>
<text class="txt">绑定手机号码</text>
</view>
</button>
<view class="item">
<view class="a" bindtap="aboutUs">
<image class="user-menu .icon.collect" src="/static/images/about_us.png"></image>
<text class="txt">关于我们</text>
<view class='user_column_item' bindtap='goOrderIndex' data-index='4' data-route='/pages/ucenter/order/order'>
<image class='user_column_item_image' src='/static/images/comment.png'></image>
<view class='user_column_item_text'>待评价</view>
</view>
</view>
</view>
<view class='separate'></view>
<view class='user_row'>
<view class='user_row_left'>核心服务</view>
</view>
<view class='user_column'>
<view class='user_column_item' bindtap='goCoupon' data-route='/pages/ucenter/order/order'>
<image class='user_column_item_image' src='/static/images/coupon.png'></image>
<view class='user_column_item_text'>优惠卷</view>
</view>
<view class='user_column_item' bindtap='goCollect' data-route='/pages/ucenter/order/order'>
<image class='user_column_item_image' src='/static/images/icon_collect.png'></image>
<view class='user_column_item_text'>商品收藏</view>
</view>
<view class='user_column_item' bindtap='goFootprint' data-route='/pages/ucenter/order/order'>
<image class='user_column_item_image' src='/static/images/footprint.png'></image>
<view class='user_column_item_text'>浏览足迹</view>
</view>
<view class='user_column_item' bindtap='goGroupon' data-route='/pages/ucenter/order/order'>
<image class='user_column_item_image' src='/static/images/group.png'></image>
<view class='user_column_item_text'>我的拼团</view>
</view>
<view class='user_column_item' bindtap='goOrderIndex' data-route='/pages/ucenter/order/order'>
<image class='user_column_item_image' src='/static/images/aftersale.png'></image>
<view class='user_column_item_text'>退款/售后</view>
</view>
</view>
<view class='separate'></view>
<view class='user_row'>
<view class='user_row_left'>必备工具</view>
</view>
<view class='user_tool_area'>
<view class='user_tool_item' bindtap='goAddress'>
<image class='user_tool_item_image' src='/static/images/address.png'></image>
<view class='user_tool_item_text'>地址管理</view>
</view>
<button class="user_tool_item_phone" open-type="getPhoneNumber" bindgetphonenumber="bindPhoneNumber">
<image class='user_tool_item_image' src='/static/images/mobile.png'></image>
<view class='user_tool_item_text'>绑定手机</view>
</button>
<view class='user_tool_item' bindtap='goFeedback'>
<image class='user_tool_item_image' src='/static/images/feedback.png'></image>
<view class='user_tool_item_text'>意见反馈</view>
</view>
<view class='user_tool_item'>
<contact-button style="opacity:0;position:absolute;" type="default-dark" session-from="weapp" size="27">
</contact-button>
<image class='user_tool_item_image' src='/static/images/customer.png'></image>
<view class='user_tool_item_text'>联系客服</view>
</view>
<view class='user_tool_item' bindtap='aboutUs'>
<image class='user_tool_item_image' src='/static/images/about_us.png'></image>
<view class='user_tool_item_text'>关于我们</view>
</view>
</view>
<!--<view class="logout" bindtap="exitLogin">退出登录</view>-->
</view>

View File

@@ -12,14 +12,12 @@ page {
}
.profile-info {
width: 100%;
height: 280rpx;
background-color: #ab956d;
color: #fff;
display: flex;
flex-wrap: wrap;
align-items: center;
justify-content: flex-start;
padding: 0 30.25rpx;
background: #333;
padding: 30rpx;
font-size: 28rpx;
}
.profile-info .avatar {
@@ -52,126 +50,147 @@ page {
font-size: 30rpx;
}
.user-menu {
.user_area {
/* border: 1px solid black; */
width: 100%;
height: auto;
overflow: hidden;
height: 226rpx;
/* margin: 0 auto; */
margin-top: -8rpx;
background: #fff;
/* border-top: 1px solid #f4f4f4; */
}
.user-menu .item {
.user_row {
/* border: 1px solid black; */
height: 86rpx;
line-height: 86rpx;
border-bottom: 1px solid #fafafa;
}
.user_row_left {
/* border: 1px solid #757575; */
float: left;
width: 33.33333%;
height: 187.5rpx;
border-right: 1px solid rgba(0, 0, 0, 0.15);
border-bottom: 1px solid rgba(0, 0, 0, 0.15);
text-align: center;
height: 86rpx;
font-weight: 550;
line-height: 86rpx;
margin-left: 35rpx;
font-size: 26rpx;
letter-spacing: 1rpx;
}
.user-menu .item .a {
.user_row_right {
/* border: 1px solid #757575; */
float: right;
height: 40rpx;
width: 40rpx;
font-weight: 550;
line-height: 86rpx;
margin-top: 28rpx;
margin-right: 30rpx;
}
.user_column {
/* border: 1px solid black; */
height: 140rpx;
display: flex;
width: 100%;
height: 100%;
flex-direction: column;
align-items: center;
justify-content: center;
align-items: center;
}
.user-menu .item.no-border {
border-right: 0;
}
.user-menu .item.item-bottom {
border-bottom: none;
}
.user-menu .icon {
margin: 0 auto;
display: block;
height: 52.803rpx;
width: 52.803rpx;
margin-bottom: 16rpx;
}
.user-menu .icon.order {
background: url(http://yanxuan.nosdn.127.net/hxm/yanxuan-wap/p/20161201/style/img/sprites/ucenter-sdf6a55ee56-f2c2b9c2f0.png) 0 -437.5rpx no-repeat;
background-size: 52.803rpx;
}
.user-menu .icon.coupon {
background: url(http://yanxuan.nosdn.127.net/hxm/yanxuan-wap/p/20161201/style/img/sprites/ucenter-sdf6a55ee56-f2c2b9c2f0.png) 0 -62.4997rpx no-repeat;
background-size: 52.803rpx;
}
.user-menu .icon.phone {
display: block;
height: 55rpx;
width: 55rpx;
background-size: 52.803rpx;
}
.user-menu .icon.gift {
background: url(http://yanxuan.nosdn.127.net/hxm/yanxuan-wap/p/20161201/style/img/sprites/ucenter-sdf6a55ee56-f2c2b9c2f0.png) 0 -187.5rpx no-repeat;
background-size: 52.803rpx;
}
.user-menu .icon.address {
background: url(http://yanxuan.nosdn.127.net/hxm/yanxuan-wap/p/20161201/style/img/sprites/ucenter-sdf6a55ee56-f2c2b9c2f0.png) 0 0 no-repeat;
background-size: 52.803rpx;
}
.user-menu .icon.security {
background: url(http://yanxuan.nosdn.127.net/hxm/yanxuan-wap/p/20161201/style/img/sprites/ucenter-sdf6a55ee56-f2c2b9c2f0.png) 0 -500rpx no-repeat;
background-size: 52.803rpx;
}
.user-menu .icon.kefu {
background: url(http://yanxuan.nosdn.127.net/hxm/yanxuan-wap/p/20161201/style/img/sprites/ucenter-sdf6a55ee56-f2c2b9c2f0.png) 0 -312.5rpx no-repeat;
background-size: 52.803rpx;
}
.user-menu .icon.help {
background: url(http://yanxuan.nosdn.127.net/hxm/yanxuan-wap/p/20161201/style/img/sprites/ucenter-sdf6a55ee56-f2c2b9c2f0.png) 0 -250rpx no-repeat;
background-size: 52.803rpx;
}
.user-menu .icon.about {
/* background: url(http://yanxuan.nosdn.127.net/hxm/yanxuan-wap/p/20161201/style/img/sprites/ucenter-sdf6a55ee56-f2c2b9c2f0.png) 0 -62.4997rpx no-repeat; */
display: block;
height: 55rpx;
width: 55rpx;
background-size: 52.803rpx;
}
.user-menu .icon.feedback {
background: url(http://yanxuan.nosdn.127.net/hxm/yanxuan-wap/p/20161201/style/img/sprites/ucenter-sdf6a55ee56-f2c2b9c2f0.png) 0 -125rpx no-repeat;
background-size: 52.803rpx;
}
.user-menu .txt {
display: block;
height: 24rpx;
width: 100%;
font-size: 24rpx;
color: #333;
}
.logout {
margin-top: 50rpx;
height: 101rpx;
width: 100%;
line-height: 101rpx;
.user_column_item {
width: 30%;
height: 140rpx;
/* background: #757575; */
text-align: center;
background: #fff;
color: #333;
font-size: 30rpx;
}
.about {
width: 100%;
background: url(https://cdn.it120.cc/images/weappshop/arrow-right.png) no-repeat 750rpx center;
background-size: 16rpx auto, 750rpx auto;
margin: 20rpx 0;
height: 80rpx;
line-height: 80rpx;
padding-left: 100rpx;
.user_column_item_image {
width: 50rpx;
height: 50rpx;
margin-top: 30rpx;
}
.user_column_item_text {
/* border: 1px solid black; */
margin-top: 5rpx;
font-size: 24rpx;
color: #555;
}
.separate {
background: #e0e3da;
width: 100%;
height: 6rpx;
}
.box_bottom_area {
/* border: 1px solid black; *//* margin-top: 32rpx; */
height: auto;
background: #fff;
}
.user_tool_item {
width: 187.5rpx;
height: 142rpx;
/* border: 1px solid #757575; */
text-align: center;
display: flex;
justify-content: center;
align-items: center;
flex-wrap: wrap;
float: left;
background: #fff;
border-bottom: 1px solid #fafafa;
}
.user_tool_item_image {
/* border: 1px solid #757575; */
width: 50rpx;
height: 50rpx;
margin-top: 23rpx;
}
.user_tool_item_text {
/* border: 1px solid #757575; */
width: 187.5rpx;
margin-bottom: 12rpx;
height: 42rpx;
line-height: 42rpx;
font-size: 23rpx;
color: #555;
}
.user_tool_item {
width: 187.5rpx;
height: 142rpx;
/* border: 1px solid #757575; */
text-align: center;
display: flex;
justify-content: center;
align-items: center;
flex-wrap: wrap;
float: left;
background: #fff;
border-bottom: 1px solid #fafafa;
}
.user_tool_item_phone {
background: none !important;
font-size: 32rpx;
color: #fff !important;
border-radius: 0%;
width: 187.5rpx;
height: 142rpx;
/* border: 1px solid #757575; */
text-align: center;
display: flex;
justify-content: center;
align-items: center;
flex-wrap: wrap;
float: left;
background: #fff;
border-bottom: 0px solid #fafafa;
}
.user_tool_item_phone::after{
border: none;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.0 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 528 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 9.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 9.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.1 KiB

After

Width:  |  Height:  |  Size: 8.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB