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.CartNumRequest;
import cn.iocoder.yudao.module.shop.request.product.CartRequest; 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.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.response.product.CartInfoResponse;
import cn.iocoder.yudao.module.shop.service.product.StoreCartService; import cn.iocoder.yudao.module.shop.service.product.StoreCartService;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
@ -78,12 +79,11 @@ public class CartController {
/** /**
* *
* @param ids ids
*/ */
@Operation(summary = "删除") @Operation(summary = "删除")
@RequestMapping(value = "/delete", method = RequestMethod.POST) @RequestMapping(value = "/delete", method = RequestMethod.POST)
public CommonResult<String> delete(@RequestParam(value = "ids") List<Long> ids) { public CommonResult<String> delete(@RequestBody @Validated DeleteCartRequest request) {
if (storeCartService.deleteCartByIds(ids)) { if (storeCartService.deleteCartByIds(request.getIds())) {
return CommonResult.success("删除购物车成功"); return CommonResult.success("删除购物车成功");
} else { } else {
return CommonResult.error(GlobalErrorCodeConstants.OPERATION_ERROR.getCode(), "删除购物车失败"); 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.MemberUserApi;
import cn.iocoder.yudao.module.member.api.user.dto.MemberUserRespDTO; 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.controller.app.recharge.vo.PhoneRecordAdd;
import cn.iocoder.yudao.module.shop.dal.dataobject.order.StoreOrder;
import com.alibaba.fastjson.JSONObject; 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 com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
@ -70,11 +73,12 @@ public class PhoneRecordServiceImpl implements PhoneRecordService {
// 校验存在 // 校验存在
validatePhoneRecordExists(id); validatePhoneRecordExists(id);
// 删除 // 删除
phoneRecordMapper.deleteById(id); phoneRecordMapper.delete(Wrappers.<PhoneRecordDO>lambdaQuery().eq(PhoneRecordDO::getRechargeOrderId,id));
} }
private void validatePhoneRecordExists(Long 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); throw exception(PHONE_RECORD_NOT_EXISTS);
} }
} }

View File

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

View File

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

View File

@ -15,6 +15,13 @@ export function memberOrderInfo(){
return request.get('api/order/member/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 = process.env.APP_BASE_URL
// let domain = 'http://192.168.1.147:48080'
module.exports = { module.exports = {
// 请求域名 格式: https://您的域名 // 请求域名 格式: https://您的域名
// #ifdef MP // #ifdef MP
HTTP_REQUEST_URL: domain, HTTP_REQUEST_URL: domain,
// #endif // #endif
HTTP_ADMIN_URL:'http://api.cyywl.top', //PC后台的API请求地址上传图片用 HTTP_ADMIN_URL: process.env.APP_BASE_URL, //PC后台的API请求地址上传图片用
// HTTP_ADMIN_URL:'http://192.168.1.147:48080', //PC后台的API请求地址上传图片用
// #ifdef H5 // #ifdef H5
//H5接口是浏览器地址 //H5接口是浏览器地址
// HTTP_REQUEST_URL: window.location.protocol+"//"+window.location.host, // HTTP_REQUEST_URL: window.location.protocol+"//"+window.location.host,

View File

@ -13,5 +13,23 @@
"clipboard": "^2.0.11", "clipboard": "^2.0.11",
"html-to-image": "^1.11.11", "html-to-image": "^1.11.11",
"qrcode": "^1.5.3" "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> </view>
</view> </view>
<u-navbar leftIcon="" title="话费返回情况"></u-navbar> <u-navbar autoBack title="购买纪录"></u-navbar>
</view> </view>
</template> </template>

View File

@ -21,8 +21,8 @@
</view> </view>
<view class="member-right"> <view class="member-right">
<image src='../../static/images/vipStar.png'></image> <image src='../../static/images/vipStar.png'></image>
<text>会员等级{{vipData.findIndex((item) => item == parseInt(memberDetail.grade)) +1}}</text> <text>会员等级{{vipData.findIndex((item) => item == memberDetail.grade) +1}}</text>
<button @click="handleRenew"></button> <button @click="handleRenew" class="right-button">立即续</button>
</view> </view>
</view> </view>
<view class="box-equity"> <view class="box-equity">
@ -257,7 +257,7 @@
margin-bottom: 10rpx; margin-bottom: 10rpx;
} }
button { .right-button {
border-radius: 18rpx; border-radius: 18rpx;
margin-top: 10rpx; margin-top: 10rpx;
padding: 7rpx 16rpx; padding: 7rpx 16rpx;

View File

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