mirror of
https://gitee.com/lab1024/smart-admin.git
synced 2025-10-02 18:26:38 +08:00
!191 fitler data except H5 data
Merge pull request !191 from Admin/sit-Carl
This commit is contained in:
commit
a312f4db18
@ -21,6 +21,9 @@
|
|||||||
<div class="online bold"></div>
|
<div class="online bold"></div>
|
||||||
|
|
||||||
<div class="rs-dis">
|
<div class="rs-dis">
|
||||||
|
<div class="ts-no-data" v-if="!newlist.length">
|
||||||
|
暂未发现相关记录
|
||||||
|
</div>
|
||||||
<div
|
<div
|
||||||
class="rc-discount"
|
class="rc-discount"
|
||||||
v-for="(item, index) in newlist"
|
v-for="(item, index) in newlist"
|
||||||
@ -71,7 +74,7 @@ export default {
|
|||||||
// middleware: 'metaTitle',
|
// middleware: 'metaTitle',
|
||||||
// // middleware: 'metaTitle',
|
// // middleware: 'metaTitle',
|
||||||
// meta: {title: '优惠券'},
|
// meta: {title: '优惠券'},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
crumbs:[
|
crumbs:[
|
||||||
{
|
{
|
||||||
@ -89,14 +92,7 @@ export default {
|
|||||||
userstates:0,
|
userstates:0,
|
||||||
userimage: require("../../assets/image/unused.png"),
|
userimage: require("../../assets/image/unused.png"),
|
||||||
newlist: [
|
newlist: [
|
||||||
{
|
|
||||||
price: "30",
|
|
||||||
pricestype: "新客优惠券",
|
|
||||||
special: "全场每满299-30",
|
|
||||||
period: "有效期",
|
|
||||||
starttime: "2021.11.29-2022.01.28",
|
|
||||||
catimage: require("../../assets/image/unused.png"),
|
|
||||||
},
|
|
||||||
],
|
],
|
||||||
discountlist: [
|
discountlist: [
|
||||||
{
|
{
|
||||||
@ -139,19 +135,21 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|
||||||
//获取用户领取的优惠券
|
//获取用户领取的优惠券
|
||||||
async userdraw(mobile,states) {
|
async userdraw(mobile,states) {
|
||||||
let data = await getdraw(mobile,states);
|
let data = await getdraw(mobile,states);
|
||||||
if(data){
|
let _self = this;
|
||||||
console.log(data);
|
if(data){
|
||||||
this.newlist=data.data;
|
let list = [];
|
||||||
this.newlist.forEach(element=>{
|
data.data.forEach(function(element,index){
|
||||||
element.validFrom=element.validFrom.slice(0,10)
|
element.validFrom = element.validFrom.slice(0,10);
|
||||||
element.validTo=element.validTo.slice(0,10)
|
element.validTo = element.validTo.slice(0,10);
|
||||||
})
|
if(element.udf2 && element.udf2 == 'H5') {
|
||||||
console.log(this.newlist);
|
list.push(element);
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
this.newlist = list;
|
||||||
|
}
|
||||||
},
|
},
|
||||||
selectGoods(item, index) {
|
selectGoods(item, index) {
|
||||||
this.activeIndex = index;
|
this.activeIndex = index;
|
||||||
|
@ -247,73 +247,57 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
findall(){
|
findall(){
|
||||||
console.log('PPP');
|
let user= this.$store.state.userInfo;
|
||||||
console.log(this.userid.length);
|
if(user==undefined||user==null||user==''){
|
||||||
|
this.$message({
|
||||||
let user= localStorage.getItem("userInfo");
|
type: 'warning',
|
||||||
if(user==undefined||user==null||user==''){
|
message: '您还未登录'
|
||||||
this.$message({
|
});
|
||||||
type: 'warning',
|
return
|
||||||
message: '您还未登录'
|
|
||||||
});
|
|
||||||
return
|
|
||||||
|
|
||||||
}else{
|
|
||||||
this.$router.push({
|
|
||||||
path: "/personal/useraddress/",
|
|
||||||
query: {
|
|
||||||
stype: 0,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
|
} else {
|
||||||
|
this.$router.push({
|
||||||
|
path: "/personal/useraddress/",
|
||||||
|
query: {
|
||||||
|
stype: 0,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
},
|
},
|
||||||
//地址的跳转
|
//地址的跳转
|
||||||
obligation(item,index){
|
obligation(item,index){
|
||||||
console.log(index);
|
let user= this.$store.state.userInfo;
|
||||||
console.log(item);
|
if(user==undefined||user==null||user==''){
|
||||||
let user= localStorage.getItem("userInfo");
|
this.$message({
|
||||||
if(user==undefined||user==null||user==''){
|
type: 'warning',
|
||||||
this.$message({
|
message: '您还未登录'
|
||||||
type: 'warning',
|
});
|
||||||
message: '您还未登录'
|
return
|
||||||
});
|
}else{
|
||||||
return
|
if(item.title=='待付款'){
|
||||||
|
this.$router.push({
|
||||||
|
path: "/personal/useraddress",
|
||||||
}else{
|
query: {
|
||||||
if(item.title=='待付款'){
|
stype: 1,
|
||||||
this.$router.push({
|
},
|
||||||
path: "/personal/useraddress",
|
});
|
||||||
query: {
|
} else if(item.title=='待发货') {
|
||||||
stype: 1,
|
this.$router.push({
|
||||||
},
|
path: "/personal/useraddress",
|
||||||
});
|
query: {
|
||||||
|
stype: 2,
|
||||||
}
|
},
|
||||||
|
});
|
||||||
else if(item.title=='待发货'){
|
} else if(item.title=='待收货') {
|
||||||
this.$router.push({
|
this.$router.push({
|
||||||
path: "/personal/useraddress",
|
path: "/personal/useraddress",
|
||||||
query: {
|
query: {
|
||||||
stype: 2,
|
stype: 3,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
else if(item.title=='待收货'){
|
}
|
||||||
this.$router.push({
|
},
|
||||||
path: "/personal/useraddress",
|
|
||||||
query: {
|
|
||||||
stype: 3,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
},
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
handleClose(){
|
handleClose(){
|
||||||
this.dialogInfo1=false;
|
this.dialogInfo1=false;
|
||||||
console.log(this.dialogInfo1);
|
console.log(this.dialogInfo1);
|
||||||
@ -347,39 +331,41 @@ obligation(item,index){
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
openaddress(item,index){
|
openaddress(item,index){
|
||||||
let user= localStorage.getItem("userInfo");
|
let user= this.$store.state.userInfo;
|
||||||
if(user==undefined||user==null||user==''){
|
if(user==undefined||user==null||user==''){
|
||||||
this.$message({
|
this.$message({
|
||||||
type: 'warning',
|
type: 'warning',
|
||||||
message: '您还未登录'
|
message: '您还未登录'
|
||||||
});
|
});
|
||||||
return
|
return
|
||||||
|
} else {
|
||||||
}else{
|
if(item.title=='收货地址'){
|
||||||
if(item.title=='收货地址'){
|
this.$router.push({
|
||||||
this.$router.push({
|
path: `/useraddress/openaddress/`
|
||||||
path: `/useraddress/openaddress/`
|
})
|
||||||
})
|
}
|
||||||
|
if(index==0){
|
||||||
|
this.userlog=true
|
||||||
|
_hmt.push([
|
||||||
|
"_trackCustomEvent",
|
||||||
|
"jump_to_crmMiniApp",
|
||||||
|
{
|
||||||
|
"type":"积分商城",
|
||||||
|
}
|
||||||
|
])
|
||||||
|
let isMobile = this.ifadroind();
|
||||||
|
if(isMobile)
|
||||||
|
window.location.href="weixin://dl/business/?t=BE1OA2AngRs";
|
||||||
|
}
|
||||||
|
if(index==1){
|
||||||
|
this.$router.push({
|
||||||
|
path: `/personal/discount/`
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if(index==0){
|
|
||||||
this.userlog=true
|
|
||||||
let isMobile = this.ifadroind();
|
|
||||||
if(isMobile)
|
|
||||||
window.location.href="weixin://dl/business/?t=BE1OA2AngRs";
|
|
||||||
}
|
|
||||||
|
|
||||||
if(index==1){
|
|
||||||
this.$router.push({
|
|
||||||
path: `/personal/discount/`
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
opendialog(){
|
opendialog(){
|
||||||
|
this.ifadroind();
|
||||||
this.ifadroind();
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
@ -421,6 +421,9 @@ export default {
|
|||||||
if(myCoupon.minPrice && myCoupon.minPrice>this.sumPrice) {
|
if(myCoupon.minPrice && myCoupon.minPrice>this.sumPrice) {
|
||||||
dateChecked=false;
|
dateChecked=false;
|
||||||
}
|
}
|
||||||
|
if(myCoupon.udf2!='H5') {
|
||||||
|
dateChecked=false;
|
||||||
|
}
|
||||||
|
|
||||||
if(dateChecked && myCoupon.activityId != 10 && myCoupon.status == 0 && (!myCoupon.productCodes || myCoupon.productCodes.indexOf(itemInCart.productCode)>-1)) {
|
if(dateChecked && myCoupon.activityId != 10 && myCoupon.status == 0 && (!myCoupon.productCodes || myCoupon.productCodes.indexOf(itemInCart.productCode)>-1)) {
|
||||||
data.data.splice(tmpIndex,1);
|
data.data.splice(tmpIndex,1);
|
||||||
|
@ -659,7 +659,7 @@ export default {
|
|||||||
this.courseId(item);
|
this.courseId(item);
|
||||||
if (orderm == 0) {
|
if (orderm == 0) {
|
||||||
this.$message({
|
this.$message({
|
||||||
type: "warning",
|
type: "success",
|
||||||
message: "加入购物车成功",
|
message: "加入购物车成功",
|
||||||
});
|
});
|
||||||
_hmt.push([
|
_hmt.push([
|
||||||
|
@ -89,7 +89,11 @@ public class OrderController {
|
|||||||
JSONObject jsonObject = JSONObject.parseObject(couponInfo);
|
JSONObject jsonObject = JSONObject.parseObject(couponInfo);
|
||||||
com.alibaba.fastjson.JSONArray jsonArray = JSONObject.parseArray(jsonObject.getString("data"));
|
com.alibaba.fastjson.JSONArray jsonArray = JSONObject.parseArray(jsonObject.getString("data"));
|
||||||
JSONObject jsonObjectData = (JSONObject) jsonArray.get(0);
|
JSONObject jsonObjectData = (JSONObject) jsonArray.get(0);
|
||||||
|
if (jsonObjectData.getString("udf2") != null){
|
||||||
|
if (!jsonObjectData.getString("udf2").equals("H5")){
|
||||||
|
return ResponseDTO.wrap(OrderResponseCodeConst.COUPON_USE_FAIL);
|
||||||
|
}
|
||||||
|
}
|
||||||
ordersEntity.setCouponAmount(jsonObjectData.getString("couponAmount") == null ? jsonObjectData.getString("discount") : jsonObjectData.getString("couponAmount"));
|
ordersEntity.setCouponAmount(jsonObjectData.getString("couponAmount") == null ? jsonObjectData.getString("discount") : jsonObjectData.getString("couponAmount"));
|
||||||
ordersEntity.setCouponCode(jsonObjectData.getString("couponCode"));
|
ordersEntity.setCouponCode(jsonObjectData.getString("couponCode"));
|
||||||
ordersEntity.setCouponName(jsonObjectData.getString("couponName"));
|
ordersEntity.setCouponName(jsonObjectData.getString("couponName"));
|
||||||
@ -222,7 +226,7 @@ public class OrderController {
|
|||||||
|
|
||||||
@ApiOperation(value = "微信支付JSAPI订单", notes = "生成JSAPI订单")
|
@ApiOperation(value = "微信支付JSAPI订单", notes = "生成JSAPI订单")
|
||||||
@PostMapping("royalcanin/generateOrderWXJSAPI")
|
@PostMapping("royalcanin/generateOrderWXJSAPI")
|
||||||
public ResponseDTO<Map<String, String>> generateOrderWXJSAPI(@RequestBody List<OrdersEntity> ordersEntityList) throws Exception {
|
public ResponseDTO<Map<String, String>> generateOrderWXJSAPI(@RequestBody List<OrdersEntity> ordersEntityList,String resp) throws Exception {
|
||||||
StringBuffer productId = new StringBuffer();
|
StringBuffer productId = new StringBuffer();
|
||||||
StringBuffer productName = new StringBuffer();
|
StringBuffer productName = new StringBuffer();
|
||||||
String memberId = "";
|
String memberId = "";
|
||||||
@ -293,7 +297,7 @@ public class OrderController {
|
|||||||
Map<String, String> returnMap = new HashMap<>();
|
Map<String, String> returnMap = new HashMap<>();
|
||||||
returnMap.put("orderNumber",ordersEntity.getOrderNo());
|
returnMap.put("orderNumber",ordersEntity.getOrderNo());
|
||||||
returnMap.put("orderAmount",ordersEntity.getOrderAmount());
|
returnMap.put("orderAmount",ordersEntity.getOrderAmount());
|
||||||
return ResponseDTO.succData(returnMap,wxpayService.dounifiedOrderJSAPI(wxPayEntity));
|
return ResponseDTO.succData(returnMap,wxpayService.dounifiedOrderJSAPI(wxPayEntity,resp));
|
||||||
}
|
}
|
||||||
return ResponseDTO.wrap(OrderResponseCodeConst.GENERATE_ORDER_FAIL);
|
return ResponseDTO.wrap(OrderResponseCodeConst.GENERATE_ORDER_FAIL);
|
||||||
}
|
}
|
||||||
@ -358,7 +362,7 @@ public class OrderController {
|
|||||||
|
|
||||||
@ApiOperation(value = "重新支付(JSAPI)", notes = "重新支付(JSAPI)")
|
@ApiOperation(value = "重新支付(JSAPI)", notes = "重新支付(JSAPI)")
|
||||||
@PostMapping("royalcanin/repayOrderJSAPI")
|
@PostMapping("royalcanin/repayOrderJSAPI")
|
||||||
public ResponseDTO<String> repayOrderWXJSAPI(String orderNo) throws Exception {
|
public ResponseDTO<String> repayOrderWXJSAPI(String orderNo,String rsp) throws Exception {
|
||||||
OrderEntity ordersEntity = orderService.findByOrderId(orderNo);
|
OrderEntity ordersEntity = orderService.findByOrderId(orderNo);
|
||||||
if(ordersEntity != null){
|
if(ordersEntity != null){
|
||||||
QueryEntity queryEntity = new QueryEntity();
|
QueryEntity queryEntity = new QueryEntity();
|
||||||
@ -371,7 +375,7 @@ public class OrderController {
|
|||||||
wxPayEntity.setProduct_id(ordersEntity.getProductCode());
|
wxPayEntity.setProduct_id(ordersEntity.getProductCode());
|
||||||
wxPayEntity.setTotal_fee(jsonObject.getString("salesAmount"));
|
wxPayEntity.setTotal_fee(jsonObject.getString("salesAmount"));
|
||||||
wxPayEntity.setOut_trade_no(ordersEntity.getOrderNo());
|
wxPayEntity.setOut_trade_no(ordersEntity.getOrderNo());
|
||||||
return ResponseDTO.succData(wxpayService.dounifiedOrderJSAPI(wxPayEntity));
|
return ResponseDTO.succData(wxpayService.dounifiedOrderJSAPI(wxPayEntity,rsp));
|
||||||
}else {
|
}else {
|
||||||
return ResponseDTO.wrap(OrderResponseCodeConst.GENERATE_ORDER_ERROR,orderInfo);
|
return ResponseDTO.wrap(OrderResponseCodeConst.GENERATE_ORDER_ERROR,orderInfo);
|
||||||
}
|
}
|
||||||
|
@ -251,17 +251,18 @@ public class WxpayService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* /H5微信支付(预下单)
|
* /JSAPI微信支付(预下单)
|
||||||
* @return
|
* @return
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
public String dounifiedOrderJSAPI(WxPayEntity wxPayEntity) throws Exception {
|
public String dounifiedOrderJSAPI(WxPayEntity wxPayEntity,String resp) throws Exception {
|
||||||
//返回参数
|
//返回参数
|
||||||
Map<String, String> returnMap = new HashMap<>();
|
Map<String, String> returnMap = new HashMap<>();
|
||||||
WXPay wxpay = new WXPay(config);
|
WXPay wxpay = new WXPay(config);
|
||||||
|
// String getopenid_url = "https://api.weixin.qq.com/sns/oauth2/access_token";
|
||||||
|
// String param="appid="+config.getAppID()+"&secret="+config.getKey()+"&code="+code+"&grant_type=authorization_code";
|
||||||
//请求参数封装
|
//请求参数封装
|
||||||
Map<String, String> data = new HashMap<>();
|
Map<String, String> data = new HashMap<>();
|
||||||
|
|
||||||
data.put("out_trade_no",wxPayEntity.getOut_trade_no());
|
data.put("out_trade_no",wxPayEntity.getOut_trade_no());
|
||||||
data.put("notify_url",config.notify_url);
|
data.put("notify_url",config.notify_url);
|
||||||
data.put("fee_type","CNY");
|
data.put("fee_type","CNY");
|
||||||
@ -269,6 +270,7 @@ public class WxpayService {
|
|||||||
data.put("spbill_create_ip", SmartIPUtil.getLocalHostIP());
|
data.put("spbill_create_ip", SmartIPUtil.getLocalHostIP());
|
||||||
data.put("trade_type", "JSAPI"); // 此处指定为H5支付
|
data.put("trade_type", "JSAPI"); // 此处指定为H5支付
|
||||||
data.put("body","皇家宠物食品官方商城");
|
data.put("body","皇家宠物食品官方商城");
|
||||||
|
data.put("openid", resp.indexOf("openid") != -1 ? JSONObject.parseObject(resp).getString("openid") : "");
|
||||||
data.put("nonce_str", WXPayUtil.generateNonceStr());
|
data.put("nonce_str", WXPayUtil.generateNonceStr());
|
||||||
data.put("product_id",wxPayEntity.getProduct_id());
|
data.put("product_id",wxPayEntity.getProduct_id());
|
||||||
String s = WXPayUtil.generateSignature(data, config.getKey()); //签名
|
String s = WXPayUtil.generateSignature(data, config.getKey()); //签名
|
||||||
|
Loading…
Reference in New Issue
Block a user