Merge branch 'feature/mall_product'

pull/16/head
tangqian 2023-05-25 14:48:49 +08:00
commit a61d46e620
11 changed files with 111 additions and 51 deletions

View File

@ -0,0 +1,22 @@
package cn.iocoder.yudao.module.shop.request.product;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.List;
/**
* @Title:DelectCartRequest
* @Description: TODO
* @author: tangqian
* @date: 2023/5/25 13:03
* @version: V1.0.0
*/
@Data
public class DeleteCartRequest implements Serializable {
private static final long serialVersionUID = 8471460222619043734L;
@Schema(description = "商品id")
private List<Long> ids;
}

View File

@ -6,6 +6,7 @@ import cn.iocoder.yudao.framework.common.pojo.PageParam;
import cn.iocoder.yudao.module.shop.request.product.CartNumRequest;
import cn.iocoder.yudao.module.shop.request.product.CartRequest;
import cn.iocoder.yudao.module.shop.request.product.CartResetRequest;
import cn.iocoder.yudao.module.shop.request.product.DeleteCartRequest;
import cn.iocoder.yudao.module.shop.response.product.CartInfoResponse;
import cn.iocoder.yudao.module.shop.service.product.StoreCartService;
import com.github.pagehelper.PageInfo;
@ -78,12 +79,11 @@ public class CartController {
/**
*
* @param ids ids
*/
@Operation(summary = "删除")
@RequestMapping(value = "/delete", method = RequestMethod.POST)
public CommonResult<String> delete(@RequestParam(value = "ids") List<Long> ids) {
if (storeCartService.deleteCartByIds(ids)) {
public CommonResult<String> delete(@RequestBody @Validated DeleteCartRequest request) {
if (storeCartService.deleteCartByIds(request.getIds())) {
return CommonResult.success("删除购物车成功");
} else {
return CommonResult.error(GlobalErrorCodeConstants.OPERATION_ERROR.getCode(), "删除购物车失败");

View File

@ -7,7 +7,10 @@ import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
import cn.iocoder.yudao.module.member.api.user.MemberUserApi;
import cn.iocoder.yudao.module.member.api.user.dto.MemberUserRespDTO;
import cn.iocoder.yudao.module.shop.controller.app.recharge.vo.PhoneRecordAdd;
import cn.iocoder.yudao.module.shop.dal.dataobject.order.StoreOrder;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
@ -70,11 +73,12 @@ public class PhoneRecordServiceImpl implements PhoneRecordService {
// 校验存在
validatePhoneRecordExists(id);
// 删除
phoneRecordMapper.deleteById(id);
phoneRecordMapper.delete(Wrappers.<PhoneRecordDO>lambdaQuery().eq(PhoneRecordDO::getRechargeOrderId,id));
}
private void validatePhoneRecordExists(Long id) {
if (phoneRecordMapper.selectById(id) == null) {
PhoneRecordDO phoneRecordDO = phoneRecordMapper.selectOne(Wrappers.<PhoneRecordDO>lambdaQuery().eq(PhoneRecordDO::getRechargeOrderId, id));
if (phoneRecordDO == null) {
throw exception(PHONE_RECORD_NOT_EXISTS);
}
}

View File

@ -6,7 +6,7 @@
width="70%"
:before-close="handleClose"
>
<el-form ref="ruleForm" :model="ruleForm" label-width="120px" size="mini" v-if="dialogVisible" :rules="rules">
<el-form ref="ruleForm" :model="ruleForm" label-width="180px" size="mini" v-if="dialogVisible" :rules="rules">
<el-form-item label="模板名称" prop="name">
<el-input v-model="ruleForm.name" class="withs" placeholder="请输入模板名称" />
</el-form-item>
@ -31,7 +31,6 @@
collapse-tags
clearable
filterable
@change="changeRegion"
/>
</template>
</el-table-column>
@ -306,9 +305,6 @@ export default {
noRegion: []
}
},
changeRegion(value) {
console.log(value)
},
changeRadio(num) {
this.columns = Object.assign({}, statusMap[num - 1])
},
@ -346,8 +342,10 @@ export default {
name: info.name,
type: info.type,
appoint: info.appoint,
noDelivery: info.noDelivery,
sort: info.sort
})
console.log(this.ruleForm)
this.columns = Object.assign({}, statusMap[this.ruleForm.type - 1])
this.$nextTick(() => {
loadingInstance.close()
@ -394,11 +392,7 @@ export default {
//
shippingNodelivery() {
logistics.shippingNodelivery({ tempId: this.tempId }).then(res => {
res.data.forEach((item, index) => {
// item.title = JSON.parse(item.title)
item.city_ids = JSON.parse(item.title)
})
this.ruleForm.noDelivery = res.data
this.ruleForm.noRegion = JSON.parse(res.data[0].title)
})
},
removeChild(list){

View File

@ -10,6 +10,10 @@
{
"launchtype" : "local"
},
"h5" :
{
"launchtype" : "local"
},
"mp-weixin" :
{
"launchtype" : "local"

View File

@ -15,6 +15,13 @@ export function memberOrderInfo(){
return request.get('api/order/member/memberOrderInfo', {})
}
/**
* 根据当前手机号获取账号的充值记录
*/
export function memberOrderInfoByPhone(phone){
return request.get(`api/order/member/memberOrderInfoByPhone?phone=${phone}`, {})
}
/**
* 查询权益档位信息
*/

View File

@ -1,14 +1,12 @@
let domain = 'http://api.cyywl.top'
// let domain = 'http://192.168.1.147:48080'
let domain = process.env.APP_BASE_URL
module.exports = {
// 请求域名 格式: https://您的域名
// #ifdef MP
HTTP_REQUEST_URL: domain,
// #endif
HTTP_ADMIN_URL:'http://api.cyywl.top', //PC后台的API请求地址上传图片用
// HTTP_ADMIN_URL:'http://192.168.1.147:48080', //PC后台的API请求地址上传图片用
HTTP_ADMIN_URL: process.env.APP_BASE_URL, //PC后台的API请求地址上传图片用
// #ifdef H5
//H5接口是浏览器地址
// HTTP_REQUEST_URL: window.location.protocol+"//"+window.location.host,

View File

@ -13,5 +13,23 @@
"clipboard": "^2.0.11",
"html-to-image": "^1.11.11",
"qrcode": "^1.5.3"
},
"uni-app": {
"scripts": {
"dev": {
"title": "开发版",
"env": {
"UNI_PLATFORM": "h5",
"APP_BASE_URL": "http://192.168.1.147:48080"
}
},
"prod": {
"title": "生产版",
"env": {
"UNI_PLATFORM": "h5",
"APP_BASE_URL": "http://api.cyywl.top"
}
}
}
}
}

View File

@ -47,7 +47,7 @@
</view>
</view>
</view>
<u-navbar leftIcon="" title="话费返回情况"></u-navbar>
<u-navbar autoBack title="购买纪录"></u-navbar>
</view>
</template>

View File

@ -10,7 +10,7 @@
<text>再升1级即可获得XX等6项权益</text>
<view class="left-button">
<view class="left-shopping" @click="handleRouter('购买记录')">
<text>购买记录</text>
<text>购买记录</text>
<image src="../../static/images/shopping-right.png" ></image>
</view>
<view class="left-others" @click="handleRouter('为他人充值')">
@ -21,8 +21,8 @@
</view>
<view class="member-right">
<image src='../../static/images/vipStar.png'></image>
<text>会员等级{{vipData.findIndex((item) => item == parseInt(memberDetail.grade)) +1}}</text>
<button @click="handleRenew"></button>
<text>会员等级{{vipData.findIndex((item) => item == memberDetail.grade) +1}}</text>
<button @click="handleRenew" class="right-button">立即续</button>
</view>
</view>
<view class="box-equity">
@ -257,7 +257,7 @@
margin-bottom: 10rpx;
}
button {
.right-button {
border-radius: 18rpx;
margin-top: 10rpx;
padding: 7rpx 16rpx;

View File

@ -9,7 +9,8 @@
<view></view>
<text>充值号码{{item.userPhone}}</text>
</view>
<button v-show="item.bool" @click.stop="handleService(item.orderId)">退</button>
<button v-show="item.bool && item.refundStatus == 0" @click.stop="handleService(item)">退</button>
<view v-show="item.refundStatus == 1">退</view>
</view>
<view class="item-text">
<text>充值档次{{item.grade}}</text>
@ -22,7 +23,7 @@
<script>
import {
memberOrderInfo,memberApplyRefund
memberOrderInfo,memberApplyRefund,memberOrderInfoByPhone
} from '@/api/member.js';
import { Debounce } from '@/utils/validate.js'
export default {
@ -37,20 +38,12 @@
await this.getList()
},
watch:{
keyword :Debounce (function (){
this.memberData.sort((a,b) =>{
let aIndex = this.keyword.indexOf(a.userPhone)
let bIndex = this.keyword.indexOf(b.userPhone)
if(aIndex > bIndex) return -1
if(aIndex < bIndex) return 1
if(a.userPhone == b.userPhone){
return a.stringCreateTime - b.stringCreateTime
}else{
if(a.stringCreateTime<b.stringCreateTime) return -1
if(a.stringCreateTime>b.stringCreateTime) return 1
return 0
}
})
keyword :Debounce (async function (){
if(this.keyword == ''){
await this.getList()
}else{
await this.searchList()
}
},1000)
},
methods: {
@ -59,20 +52,40 @@
url:`/pages/member_back/index?userPhone=${item.userPhone}&grade=${item.grade}`
})
},
async searchList(){
let milliseconds = 2 * 3600 * 1000 // 7200000
let timestamp = new Date().getTime()
const res = await memberOrderInfoByPhone(this.keyword)
if(res.data){
const arr = res.data.map((item) => {
return {
...item,
bool:item.createTime+milliseconds>timestamp
}
})
this.memberData = arr
}else{
this.memberData = []
}
},
async getList(){
let milliseconds = 2 * 3600 * 1000 // 7200000
let timestamp = new Date().getTime()
const res = await memberOrderInfo()
const arr = res.data.map((item) => {
return {
...item,
bool:item.createTime+milliseconds>timestamp
}
})
this.memberData = arr
if(res.data){
const arr = res.data.map((item) => {
return {
...item,
bool:item.createTime+milliseconds>timestamp
}
})
this.memberData = arr
}else{
this.memberData = []
}
},
async handleService(orderId){
await memberApplyRefund({orderId})
async handleService(item){
await memberApplyRefund({orderId:item.id,type:3})
this.$util.Tips({
title: '申请成功'
});
@ -93,10 +106,10 @@
background-attachment: fixed;
.box-seach{
z-index: 999;
padding: 10% 40rpx;
padding: 0 40rpx;
width: 100%;
position: fixed;
top: 3%;
top: 8%;
left: 0;
}
.list-item{