意见反馈
This commit is contained in:
parent
22d78d8b5f
commit
53288a6e77
@ -22,8 +22,14 @@
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-select v-model="queryParams.status" placeholder="数据状态" clearable>
|
||||
<!-- <el-option-->
|
||||
<!-- v-for="dict in dict.type.sys_normal_disable"-->
|
||||
<!-- :key="dict.value"-->
|
||||
<!-- :label="dict.label"-->
|
||||
<!-- :value="dict.value"-->
|
||||
<!-- />-->
|
||||
<el-option
|
||||
v-for="dict in dict.type.sys_normal_disable"
|
||||
v-for="dict in dict.type.zhzt"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
@ -67,7 +73,8 @@
|
||||
<el-table-column label="字典排序" align="center" prop="dictSort" />
|
||||
<el-table-column label="状态" align="center" prop="status">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.sys_normal_disable" :value="scope.row.status"/>
|
||||
<!-- <dict-tag :options="dict.type.sys_normal_disable" :value="scope.row.status"/>-->
|
||||
<dict-tag :options="dict.type.zhzt" :value="scope.row.status"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="备注" align="center" prop="remark" :show-overflow-tooltip="true" />
|
||||
@ -135,8 +142,13 @@
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-radio-group v-model="form.status">
|
||||
<!-- <el-radio-->
|
||||
<!-- v-for="dict in dict.type.sys_normal_disable"-->
|
||||
<!-- :key="dict.value"-->
|
||||
<!-- :label="dict.value"-->
|
||||
<!-- >{{dict.label}}</el-radio>-->
|
||||
<el-radio
|
||||
v-for="dict in dict.type.sys_normal_disable"
|
||||
v-for="dict in dict.type.zhzt"
|
||||
:key="dict.value"
|
||||
:label="dict.value"
|
||||
>{{dict.label}}</el-radio>
|
||||
@ -160,7 +172,7 @@ import { listType, getType } from "@/api/system/dict/type";
|
||||
|
||||
export default {
|
||||
name: "Data",
|
||||
dicts: ['sys_normal_disable'],
|
||||
dicts: ['sys_normal_disable','zhzt'],
|
||||
props:{
|
||||
id:{
|
||||
type:String,
|
||||
|
@ -30,8 +30,14 @@
|
||||
clearable
|
||||
style="width: 240px"
|
||||
>
|
||||
<!-- <el-option-->
|
||||
<!-- v-for="dict in dict.type.sys_normal_disable"-->
|
||||
<!-- :key="dict.value"-->
|
||||
<!-- :label="dict.label"-->
|
||||
<!-- :value="dict.value"-->
|
||||
<!-- />-->
|
||||
<el-option
|
||||
v-for="dict in dict.type.sys_normal_disable"
|
||||
v-for="dict in dict.type.zhzt"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
@ -86,7 +92,8 @@
|
||||
</el-table-column>
|
||||
<el-table-column label="状态" align="center" prop="status">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.sys_normal_disable" :value="scope.row.status"/>
|
||||
<!-- <dict-tag :options="dict.type.sys_normal_disable" :value="scope.row.status"/>-->
|
||||
<dict-tag :options="dict.type.zhzt" :value="scope.row.status"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="备注" align="center" prop="remark" :show-overflow-tooltip="true" />
|
||||
@ -137,8 +144,13 @@
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-radio-group v-model="form.status">
|
||||
<!-- <el-radio-->
|
||||
<!-- v-for="dict in dict.type.sys_normal_disable"-->
|
||||
<!-- :key="dict.value"-->
|
||||
<!-- :label="dict.value"-->
|
||||
<!-- >{{dict.label}}</el-radio>-->
|
||||
<el-radio
|
||||
v-for="dict in dict.type.sys_normal_disable"
|
||||
v-for="dict in dict.type.zhzt"
|
||||
:key="dict.value"
|
||||
:label="dict.value"
|
||||
>{{dict.label}}</el-radio>
|
||||
@ -161,7 +173,7 @@
|
||||
|
||||
export default {
|
||||
name: "Dict",
|
||||
dicts: ['sys_normal_disable'],
|
||||
dicts: ['sys_normal_disable','zhzt'],
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
|
@ -5,6 +5,7 @@ import com.fuint.api.fuyou.entity.Const;
|
||||
import com.fuint.api.fuyou.service.FyPayService;
|
||||
import com.fuint.api.fuyou.util.Utils;
|
||||
import com.fuint.business.integral.service.IntegralOrdersService;
|
||||
import com.fuint.business.marketingActivity.cardValue.service.CardValueRecordService;
|
||||
import com.fuint.business.order.entity.AllOrderInfo;
|
||||
import com.fuint.business.order.entity.OilOrder;
|
||||
import com.fuint.business.order.service.AllOrderInfoService;
|
||||
@ -31,7 +32,9 @@ public class FyPayController {
|
||||
@Autowired
|
||||
@Lazy
|
||||
private IntegralOrdersService integralOrdersService;
|
||||
|
||||
@Autowired
|
||||
@Lazy
|
||||
private CardValueRecordService cardValueRecordService;
|
||||
@Autowired
|
||||
@Lazy
|
||||
private AllOrderInfoService allOrderInfoService;
|
||||
@ -62,7 +65,7 @@ public class FyPayController {
|
||||
}
|
||||
|
||||
updateOrderStatus(orderNo,allOrderInfo.getType());
|
||||
// 修改油品订单支付状态
|
||||
// 修改订单支付状态
|
||||
redisLock.unlock(orderLock);
|
||||
}
|
||||
// transaction_id 加锁
|
||||
@ -72,12 +75,14 @@ public class FyPayController {
|
||||
}
|
||||
}
|
||||
public void updateOrderStatus(String orderNo,String type){
|
||||
if ("油品订单".equals(type)) {
|
||||
if ("1".equals(type)) {
|
||||
orderService.updateOrderStatus(orderNo,"paid");
|
||||
}else if ("积分订单".equals(type)) {
|
||||
integralOrdersService.editPayStatus(orderNo,"paid",-1);
|
||||
integralOrdersService.checkTheStatusOfYourPaymentByIntegral(orderNo);
|
||||
|
||||
}else if ("3".equals(type)){
|
||||
cardValueRecordService.rechargeFinallDeal(orderNo);
|
||||
}
|
||||
}
|
||||
}
|
@ -394,6 +394,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
|
||||
cashierOrder.setGoodsOrderId(goodsOrder1.getId());
|
||||
}
|
||||
cashierOrderService.insertCashierOrder(cashierOrder);
|
||||
this.insertAllOrderInfo(orderNo,storeId,oilAmount,payType,userId,"PC");
|
||||
return orders;
|
||||
}
|
||||
|
||||
@ -506,7 +507,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
|
||||
cashierOrder.setOilOrderId(oilOrder.getId());
|
||||
cashierOrderService.insertCashierOrder(cashierOrder);
|
||||
this.updateGrowthValue1(oilAmount,userId, Integer.valueOf(oilOrder.getOils()),0.0);
|
||||
this.insertAllOrderInfo(orderNo,accountInfo.getStoreId(),oilAmount,map.get("payType"),userId);
|
||||
this.insertAllOrderInfo(orderNo,accountInfo.getStoreId(),oilAmount,map.get("payType"),userId,"applet");
|
||||
|
||||
res.put("success","success");
|
||||
} else {
|
||||
@ -580,7 +581,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
|
||||
}
|
||||
|
||||
cashierOrderService.insertCashierOrder(cashierOrder);
|
||||
this.insertAllOrderInfo(orderNo,accountInfo.getStoreId(),oilAmount,map.get("payType"),userId);
|
||||
this.insertAllOrderInfo(orderNo,accountInfo.getStoreId(),oilAmount,map.get("payType"),userId,"applet");
|
||||
res.put("success","success");
|
||||
}
|
||||
|
||||
@ -600,15 +601,15 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
|
||||
/**
|
||||
* 添加所有订单信息
|
||||
*/
|
||||
private void insertAllOrderInfo(String orderNo,Integer storeId,Double goodsMoney,String payType,Integer userId){
|
||||
private void insertAllOrderInfo(String orderNo,Integer storeId,Double goodsMoney,String payType,Integer userId,String payChannel){
|
||||
AllOrderInfo allOrderInfo = new AllOrderInfo();
|
||||
allOrderInfo.setOrderNo(orderNo);
|
||||
allOrderInfo.setType("油品订单");
|
||||
allOrderInfo.setType("1");
|
||||
allOrderInfo.setStoreId(storeId);
|
||||
allOrderInfo.setGoodsMoney(goodsMoney);
|
||||
allOrderInfo.setPayType(payType);
|
||||
allOrderInfo.setUserId(userId);
|
||||
allOrderInfo.setPayChannel("applet");
|
||||
allOrderInfo.setPayChannel(payChannel);
|
||||
allOrderInfo.setStatus("paid");
|
||||
allOrderInfo.setContent("油品订单");
|
||||
allOrderInfoService.insertAllOrderInfo(allOrderInfo);
|
||||
@ -752,7 +753,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
|
||||
// 处理支付需要的数据
|
||||
ReceiveParameter receiveParameter = new ReceiveParameter();
|
||||
receiveParameter.setOrderNo(orderNo);
|
||||
receiveParameter.setType("油品订单");
|
||||
receiveParameter.setType("1");
|
||||
receiveParameter.setContent("油品订单");
|
||||
receiveParameter.setGoodsMoney(oilOrder.getOrderAmount());
|
||||
receiveParameter.setStoreId(oilOrder.getStoreId());
|
||||
|
@ -0,0 +1,44 @@
|
||||
package com.fuint.business.userManager.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.fuint.business.userManager.entity.Feedback;
|
||||
import com.fuint.business.userManager.entity.FixingLevel;
|
||||
import com.fuint.business.userManager.service.FeedbackService;
|
||||
import com.fuint.framework.web.BaseController;
|
||||
import com.fuint.framework.web.ResponseObject;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/business/userManager/feedback")
|
||||
public class FeedbackController extends BaseController {
|
||||
@Autowired
|
||||
private FeedbackService feedbackService;
|
||||
|
||||
/**
|
||||
* 根据条件分页查询意见反馈信息
|
||||
* @param feedback
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public ResponseObject list(Feedback feedback,
|
||||
@RequestParam(value = "page",defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize",defaultValue = "10") Integer pageSize){
|
||||
Page page =new Page(pageNo,pageSize);
|
||||
IPage<Feedback> list = feedbackService.selectFeedbackList(page,feedback);
|
||||
return getSuccessResult(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加意见反馈信息
|
||||
* @param feedback
|
||||
* @return
|
||||
*/
|
||||
@PostMapping
|
||||
public ResponseObject add(@RequestBody Feedback feedback){
|
||||
return getSuccessResult(feedbackService.insertFeedback(feedback));
|
||||
}
|
||||
}
|
@ -0,0 +1,138 @@
|
||||
package com.fuint.business.userManager.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fuint.framework.entity.BaseEntity;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 意见反馈表(Feedback)实体类
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2023-12-26 11:57:22
|
||||
*/
|
||||
@Data
|
||||
@TableName("feedback")
|
||||
@ApiModel(value = "Feedback对象", description = "意见反馈表")
|
||||
public class Feedback extends BaseEntity implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@ApiModelProperty("自增ID")
|
||||
@TableId(value = "ID", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
/**
|
||||
* 店铺id
|
||||
*/
|
||||
private Integer storeId;
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
private Integer userId;
|
||||
/**
|
||||
* 截图路径
|
||||
*/
|
||||
private String screenshotUrl;
|
||||
/**
|
||||
* 反馈内容
|
||||
*/
|
||||
private String content;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createTime;
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
private String createBy;
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private Date updateTime;
|
||||
/**
|
||||
* 更新人
|
||||
*/
|
||||
private String updateBy;
|
||||
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Integer getStoreId() {
|
||||
return storeId;
|
||||
}
|
||||
|
||||
public void setStoreId(Integer storeId) {
|
||||
this.storeId = storeId;
|
||||
}
|
||||
|
||||
public Integer getUserId() {
|
||||
return userId;
|
||||
}
|
||||
|
||||
public void setUserId(Integer userId) {
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
public String getScreenshotUrl() {
|
||||
return screenshotUrl;
|
||||
}
|
||||
|
||||
public void setScreenshotUrl(String screenshotUrl) {
|
||||
this.screenshotUrl = screenshotUrl;
|
||||
}
|
||||
|
||||
public String getContent() {
|
||||
return content;
|
||||
}
|
||||
|
||||
public void setContent(String content) {
|
||||
this.content = content;
|
||||
}
|
||||
|
||||
public Date getCreateTime() {
|
||||
return createTime;
|
||||
}
|
||||
|
||||
public void setCreateTime(Date createTime) {
|
||||
this.createTime = createTime;
|
||||
}
|
||||
|
||||
public String getCreateBy() {
|
||||
return createBy;
|
||||
}
|
||||
|
||||
public void setCreateBy(String createBy) {
|
||||
this.createBy = createBy;
|
||||
}
|
||||
|
||||
public Date getUpdateTime() {
|
||||
return updateTime;
|
||||
}
|
||||
|
||||
public void setUpdateTime(Date updateTime) {
|
||||
this.updateTime = updateTime;
|
||||
}
|
||||
|
||||
public String getUpdateBy() {
|
||||
return updateBy;
|
||||
}
|
||||
|
||||
public void setUpdateBy(String updateBy) {
|
||||
this.updateBy = updateBy;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,17 @@
|
||||
package com.fuint.business.userManager.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.fuint.business.userManager.entity.Feedback;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
public interface FeedbackMapper extends BaseMapper<Feedback> {
|
||||
/**
|
||||
* 根据条件查询意见反馈信息
|
||||
* @param page
|
||||
* @param feedback
|
||||
* @return
|
||||
*/
|
||||
public IPage<Feedback> selectFeedbackList(Page page,@Param("feedback") Feedback feedback);
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
<?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="com.fuint.business.userManager.mapper.FeedbackMapper">
|
||||
<sql id="selectFeedback">
|
||||
select * from feedback
|
||||
</sql>
|
||||
|
||||
<select id="selectFeedbackList" resultType="com.fuint.business.userManager.entity.Feedback">
|
||||
<include refid="selectFeedback"></include>
|
||||
<where>
|
||||
<if test="feedback.storeId != null and feedback.storeId != ''">
|
||||
and store_id = #{feedback.storeId}
|
||||
</if>
|
||||
<if test="feedback.userId != null and feedback.userId != ''">
|
||||
and user_id = #{feedback.userId}
|
||||
</if>
|
||||
<if test="feedback.params.beginTime != null and feedback.params.beginTime != ''"><!-- 开始时间检索 -->
|
||||
and date_format(create_time,'%y%m%d') >= date_format(#{feedback.params.beginTime},'%y%m%d')
|
||||
</if>
|
||||
<if test="feedback.params.endTime != null and feedback.params.endTime != ''"><!-- 结束时间检索 -->
|
||||
and date_format(create_time,'%y%m%d') <= date_format(#{feedback.params.endTime},'%y%m%d')
|
||||
</if>
|
||||
order by create_time desc
|
||||
</where>
|
||||
</select>
|
||||
</mapper>
|
@ -0,0 +1,26 @@
|
||||
package com.fuint.business.userManager.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.fuint.business.userManager.entity.Feedback;
|
||||
|
||||
/**
|
||||
* 意见反馈信息 业务层
|
||||
*/
|
||||
public interface FeedbackService extends IService<Feedback> {
|
||||
/**
|
||||
* 根据条件分页查询意见反馈信息
|
||||
* @param page
|
||||
* @param feedback
|
||||
* @return
|
||||
*/
|
||||
IPage<Feedback> selectFeedbackList(Page page, Feedback feedback);
|
||||
|
||||
/**
|
||||
* 添加意见反馈信息
|
||||
* @param feedback
|
||||
* @return
|
||||
*/
|
||||
int insertFeedback(Feedback feedback);
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
package com.fuint.business.userManager.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.fuint.business.userManager.entity.Feedback;
|
||||
import com.fuint.business.userManager.mapper.FeedbackMapper;
|
||||
import com.fuint.business.userManager.service.FeedbackService;
|
||||
import com.fuint.common.dto.AccountInfo;
|
||||
import com.fuint.common.util.TokenUtil;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
public class FeedbackServiceImpl extends ServiceImpl<FeedbackMapper,Feedback> implements FeedbackService {
|
||||
@Override
|
||||
public IPage<Feedback> selectFeedbackList(Page page, Feedback feedback) {
|
||||
return baseMapper.selectFeedbackList(page,feedback);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int insertFeedback(Feedback feedback) {
|
||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
feedback.setUserId(nowAccountInfo.getId());
|
||||
return baseMapper.insert(feedback);
|
||||
}
|
||||
}
|
@ -78,7 +78,12 @@ public class LJUserGradeServiceImpl extends ServiceImpl<LJUserGradeMapper, LJUse
|
||||
ChainStoreConfig chainStoreConfig = chainStoreConfigService.selectChainStoreById(store.getChainStoreId());
|
||||
String isEnableLevel = chainStoreConfig.getIsEnableLevel();
|
||||
if (isEnableLevel.equals("yes")){
|
||||
return baseMapper.selectById(id);
|
||||
LJUserGrade ljUserGrade = baseMapper.selectById(id);
|
||||
if (ljUserGrade.getStatus().equals("qy")){
|
||||
return baseMapper.selectById(id);
|
||||
}else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
package com.fuint.common.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import lombok.Data;
|
||||
import java.io.Serializable;
|
||||
|
||||
@ -10,6 +11,8 @@ import java.io.Serializable;
|
||||
* CopyRight https://www.fuint.cn
|
||||
*/
|
||||
@Data
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
//@JsonIgnoreProperties({ "accountKey","accountName" })
|
||||
public class UserInfo implements Serializable {
|
||||
private Integer id;
|
||||
private String storeId;
|
||||
|
@ -75,7 +75,8 @@ public class TokenUtil {
|
||||
if (token == null || StringUtil.isEmpty(token)) {
|
||||
return null;
|
||||
}
|
||||
Object loginInfo = RedisUtil.get(Constants.SESSION_USER + token);
|
||||
// Object loginInfo = RedisUtil.get(Constants.SESSION_USER + token);
|
||||
Object loginInfo = RedisUtil.get(Constants.SESSION_ADMIN_USER + token);
|
||||
ObjectMapper objectMapper = new ObjectMapper();
|
||||
UserInfo userInfo = objectMapper.convertValue(loginInfo, UserInfo.class);
|
||||
if (userInfo != null && userInfo.getToken().equals(token)) {
|
||||
|
@ -18,7 +18,7 @@
|
||||
<view class="top-hong">¥{{oilPrice}}/{{oilUnit}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="" @click="goRefuel" style="width: 46%;font-size: 14px;">
|
||||
<view class="" @click="goRefuel" style="width: 80px;font-size: 14px;">
|
||||
<view class="bulu">切换站点 <uni-icons type="right" color="#304fff" size="16"></uni-icons> </view>
|
||||
|
||||
</view>
|
||||
@ -265,7 +265,7 @@
|
||||
method: 'get',
|
||||
}).then((res)=>{
|
||||
_this.oilNumberList = res.data;
|
||||
if (res.data != null){
|
||||
if (res.data != null && res.data!=""){
|
||||
_this.getOilGun(res.data[0].numberId);
|
||||
_this.oilPrice = res.data[0].gbPrice
|
||||
_this.oilUnit = res.data[0].unit
|
||||
|
@ -16,8 +16,9 @@
|
||||
<w-barcode :options="option"></w-barcode>
|
||||
</view>
|
||||
<view class="hui-size">
|
||||
<text>2023 **** **** 5523</text>
|
||||
<text>查看数字</text>
|
||||
<!-- <text>2023 **** **** 5523</text> -->
|
||||
<text>{{barCode}}</text>
|
||||
<text @click="lookNumber">查看数字</text>
|
||||
</view>
|
||||
<view class="code-box">
|
||||
<w-qrcode :options="options"></w-qrcode>
|
||||
@ -109,6 +110,8 @@
|
||||
{key:"oilStorageCard",value:"囤油卡扣款"},
|
||||
],
|
||||
value:"储值卡扣款",
|
||||
barCode:"",
|
||||
isLook:false,
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
@ -120,6 +123,17 @@
|
||||
|
||||
},
|
||||
methods: {
|
||||
// 是否查看数字
|
||||
lookNumber(){
|
||||
if (this.isLook){
|
||||
this.barCode = this.option.code.slice(0,4) + " **** **** " + this.option.code.slice(this.option.code.length-5,this.option.code.length-1)
|
||||
this.isLook = false
|
||||
}else{
|
||||
this.barCode = this.option.code.replace(/(.{4})/g, '$1 ')
|
||||
this.isLook = true
|
||||
}
|
||||
// console.log(this.barCode)
|
||||
},
|
||||
// 倒计时刷新
|
||||
countdown(){
|
||||
let _this = this
|
||||
@ -151,8 +165,9 @@
|
||||
url: 'business/qrCode/createBarCode',
|
||||
method: 'get',
|
||||
}).then(res => {
|
||||
console.log(res,111)
|
||||
// console.log(res,111)
|
||||
this.option.code = res.data
|
||||
this.barCode = res.data.slice(0,4) + " **** **** " + res.data.slice(res.data.length-5,res.data.length-1)
|
||||
})
|
||||
},
|
||||
// 获取二维码信息
|
||||
@ -161,7 +176,7 @@
|
||||
url: 'business/qrCode/createQrCode',
|
||||
method: 'get',
|
||||
}).then(res => {
|
||||
console.log(2222,res)
|
||||
// console.log(2222,res)
|
||||
this.options.code = res.data
|
||||
})
|
||||
},
|
||||
|
@ -2,7 +2,7 @@
|
||||
<view class="content">
|
||||
<view class="container">
|
||||
<view class="my-header">
|
||||
<view class="my-icons" @click="goback"> <uni-icons type="left" color="#ffffff" size="16"></uni-icons>
|
||||
<view class="my-icons" @click="goBack"> <uni-icons type="left" color="#ffffff" size="16"></uni-icons>
|
||||
</view>
|
||||
<view class="my-text">意见反馈</view>
|
||||
<view class="my-icons"></view>
|
||||
@ -18,7 +18,7 @@
|
||||
</view>
|
||||
<u-upload :fileList="fileList1" @afterRead="afterRead" @delete="deletePic" name="1" multiple
|
||||
:maxCount="5"></u-upload>
|
||||
<view class="anniu">
|
||||
<view class="anniu" @click="submitFeedback">
|
||||
<text>提交反馈</text>
|
||||
</view>
|
||||
</view>
|
||||
@ -30,13 +30,19 @@
|
||||
|
||||
<script>
|
||||
import upload from '@/utils/upload.js'
|
||||
import request from '../../utils/request'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
title: '',
|
||||
value5: '',
|
||||
fileList1: [],
|
||||
|
||||
images:[],
|
||||
feedback:{
|
||||
screenshotUrl:"",
|
||||
content:"",
|
||||
storeId:uni.getStorageSync("storeId")
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
@ -44,8 +50,38 @@
|
||||
|
||||
},
|
||||
methods: {
|
||||
// 提交反馈
|
||||
submitFeedback(){
|
||||
this.feedback.content = this.value5
|
||||
this.feedback.screenshotUrl = JSON.stringify(this.images)
|
||||
request({
|
||||
url: "business/userManager/feedback",
|
||||
method: 'post',
|
||||
data:this.feedback,
|
||||
}).then((res) => {
|
||||
if (res.code==200){
|
||||
uni.showToast({
|
||||
title:"反馈成功!",
|
||||
icon:none,
|
||||
})
|
||||
this.reset()
|
||||
}
|
||||
})
|
||||
},
|
||||
// 重置数据
|
||||
reset(){
|
||||
this.value5= ''
|
||||
this.fileList1= []
|
||||
this.images=[]
|
||||
this.feedback={
|
||||
screenshotUrl:"",
|
||||
content:"",
|
||||
storeId:uni.getStorageSync("storeId"),
|
||||
}
|
||||
},
|
||||
deletePic(event) {
|
||||
this[`fileList${event.name}`].splice(event.index, 1)
|
||||
this.images.splice(event.index, 1)
|
||||
},
|
||||
// 新增图片
|
||||
async afterRead(event) {
|
||||
@ -71,15 +107,16 @@
|
||||
},
|
||||
uploadFilePromise(url) {
|
||||
upload({
|
||||
url: '/common/upload',
|
||||
url: '/clientApi/file/upload',
|
||||
filePath: url,
|
||||
header:"",
|
||||
}).then((res) => {
|
||||
// console.log('images', res.fileName);
|
||||
// this.images.push(res.fileName)
|
||||
this.images.push(res.data.fileName)
|
||||
console.log('images', this.images);
|
||||
})
|
||||
|
||||
},
|
||||
goback() {
|
||||
goBack() {
|
||||
uni.navigateBack()
|
||||
}
|
||||
}
|
||||
|
@ -33,10 +33,10 @@
|
||||
<view class="chengg">{{getPayName(payList,item.orderStatus)}}</view>
|
||||
</view>
|
||||
|
||||
<view class="but-box">
|
||||
<!-- <view class="but-box">
|
||||
<view class="huis">订单类型</view>
|
||||
<view class="">油品订单</view>
|
||||
</view>
|
||||
</view> -->
|
||||
<view class="but-box">
|
||||
<view class="huis">订单金额</view>
|
||||
<view class="">¥{{item.orderAmount}}</view>
|
||||
@ -67,7 +67,7 @@
|
||||
</view>
|
||||
</view>
|
||||
<!-- 储值卡订单列表 -->
|
||||
<view class="box-order" v-for="(item,index) in balanceList" :key="index">
|
||||
<!-- <view class="box-order" v-for="(item,index) in balanceList" :key="index">
|
||||
<view class="or-box-top">
|
||||
<view class="">{{getStoreName(storeList,item.storeId)}}</view>
|
||||
<view class="chengg">{{getPayName(payList,item.status)}}</view>
|
||||
@ -95,7 +95,7 @@
|
||||
<text>评价有礼</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view> -->
|
||||
<!-- 状态:加载更多、没有更多了... -->
|
||||
<u-load-more :status="status"></u-load-more>
|
||||
</scroll-view>
|
||||
@ -335,12 +335,12 @@
|
||||
remark: "",
|
||||
}
|
||||
this.getMyOrder()
|
||||
this.map1 = {
|
||||
page: 1,
|
||||
pageSize: 10,
|
||||
status: "",
|
||||
}
|
||||
this.getBalanceOrder()
|
||||
// this.map1 = {
|
||||
// page: 1,
|
||||
// pageSize: 10,
|
||||
// status: "",
|
||||
// }
|
||||
// this.getBalanceOrder()
|
||||
} else if (this.tapindex == 1) {
|
||||
this.map = {
|
||||
page: 1,
|
||||
@ -350,12 +350,12 @@
|
||||
remark: "",
|
||||
}
|
||||
this.getMyOrder()
|
||||
this.map1 = {
|
||||
page: 1,
|
||||
pageSize: 10,
|
||||
status: "unpaid",
|
||||
}
|
||||
this.getBalanceOrder()
|
||||
// this.map1 = {
|
||||
// page: 1,
|
||||
// pageSize: 10,
|
||||
// status: "unpaid",
|
||||
// }
|
||||
// this.getBalanceOrder()
|
||||
} else if (this.tapindex == 2) {
|
||||
this.map = {
|
||||
page: 1,
|
||||
@ -365,12 +365,12 @@
|
||||
remark: "",
|
||||
}
|
||||
this.getMyOrder()
|
||||
this.map1 = {
|
||||
page: 1,
|
||||
pageSize: 10,
|
||||
status: "paid",
|
||||
}
|
||||
this.getBalanceOrder()
|
||||
// this.map1 = {
|
||||
// page: 1,
|
||||
// pageSize: 10,
|
||||
// status: "paid",
|
||||
// }
|
||||
// this.getBalanceOrder()
|
||||
} else {
|
||||
this.map = {
|
||||
page: 1,
|
||||
@ -380,12 +380,12 @@
|
||||
remark: "",
|
||||
}
|
||||
this.getMyOrder()
|
||||
this.map1 = {
|
||||
page: 1,
|
||||
pageSize: 10,
|
||||
status: "paid",
|
||||
}
|
||||
this.getBalanceOrder()
|
||||
// this.map1 = {
|
||||
// page: 1,
|
||||
// pageSize: 10,
|
||||
// status: "paid",
|
||||
// }
|
||||
// this.getBalanceOrder()
|
||||
}
|
||||
},
|
||||
goPayment(){
|
||||
|
@ -104,7 +104,7 @@
|
||||
console.log(res)
|
||||
if (res.code == 200) {
|
||||
this.cardsList = res.data.records
|
||||
console.log(cardsList)
|
||||
// console.log(cardsList)
|
||||
}
|
||||
})
|
||||
},
|
||||
|
@ -21,15 +21,15 @@
|
||||
</view>
|
||||
<view class="desc">
|
||||
<view>加油金额</view>
|
||||
<view>{{oilOrder.orderAmount}}</view>
|
||||
<view>¥{{oilOrder.orderAmount}}</view>
|
||||
</view>
|
||||
<view class="desc">
|
||||
<view>加油数量</view>
|
||||
<view>{{oilOrder.oilNum}}</view>
|
||||
<view>{{oilOrder.oilNum}}L</view>
|
||||
</view>
|
||||
<view class="desc">
|
||||
<view>油品单价</view>
|
||||
<view>{{oilPrice}}/元</view>
|
||||
<view>¥{{oilPrice}}/L</view>
|
||||
</view>
|
||||
<view class="desc">
|
||||
<view>加油员工</view>
|
||||
@ -38,153 +38,40 @@
|
||||
</view>
|
||||
|
||||
<view style="background-color: white;width: 94%;margin: 15px auto;">
|
||||
<view class="desc">
|
||||
<view class="desc" v-if="isOilStorageCard">
|
||||
<view style="display: flex;">
|
||||
储值卡
|
||||
<span style="display: flex;">(余额:{{user.cardBalance}})</span>
|
||||
</view>
|
||||
<view style="display: flex;">
|
||||
<span style="margin-right: 10px;">-¥{{balanceRedece}}</span>
|
||||
<u-checkbox-group>
|
||||
<u-checkbox v-model="balance" @change="changeBalance"></u-checkbox>
|
||||
</u-checkbox-group>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="desc" v-if="refuelMoney.length > 0">
|
||||
<view style="display: flex;">
|
||||
<u-collapse>
|
||||
<u-collapse-item title="囤油卡" :open="true">
|
||||
<view v-for="(item,index) in refuelMoney" :key="index">
|
||||
{{item.type}}{{item.oilType}}:{{item.refuelMoney}}L
|
||||
</view>
|
||||
</u-collapse-item>
|
||||
</u-collapse>
|
||||
<!-- 囤油卡
|
||||
<span style="color: red;display: flex;">(余额:0.00)<u-icon name="question-circle"
|
||||
color="red"></u-icon></span> -->
|
||||
囤油卡
|
||||
<span style="display: flex;">(余额:{{refuelBalance}}L)</span>
|
||||
</view>
|
||||
<view style="display: flex;">
|
||||
<span style="margin-right: 10px;">- {{oilCardRedece}}L</span>
|
||||
<u-checkbox-group>
|
||||
<u-checkbox v-model="oilCard" @change="changeOilCard"></u-checkbox>
|
||||
</u-checkbox-group>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="desc" v-if="gradeDiscount.length>0">
|
||||
<view class="desc" v-if="isStoreValueCard">
|
||||
<view style="display: flex;">
|
||||
<u-collapse>
|
||||
<u-collapse-item title="会员等级优惠" :open="true">
|
||||
<view v-for="(item,index) in gradeDiscount" :key="index">
|
||||
<span v-if="item.type=='满减优惠'">
|
||||
{{item.type}}:满{{item.full}}元,减{{item.reduce}}元
|
||||
</span>
|
||||
<span v-else>
|
||||
{{item.type}}:满{{item.full}}元,每升<br/>优惠{{item.liters}}元
|
||||
</span>
|
||||
</view>
|
||||
</u-collapse-item>
|
||||
</u-collapse>
|
||||
<!-- 会员等级优惠gradeDiscount -->
|
||||
储值卡
|
||||
<span style="display: flex;">(余额:¥{{user.cardBalance}})</span>
|
||||
</view>
|
||||
<view style="display: flex;">
|
||||
<span style="margin-right: 10px;">-¥{{balanceRedece}}</span>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="desc">
|
||||
<view style="display: flex;">
|
||||
会员等级优惠
|
||||
<span style="display: flex;">(会员等级)</span>
|
||||
</view>
|
||||
<view style="display: flex;">
|
||||
<span style="margin-right: 10px;">-¥{{gradeRedece}}</span>
|
||||
<u-checkbox-group>
|
||||
<u-checkbox v-model="grade" @change="changeGrade"></u-checkbox>
|
||||
</u-checkbox-group>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view v-if="exclusion == 0">
|
||||
<view class="desc" v-if="fullRedece >= couponRedece && fullReduceDiscount.length > 0">
|
||||
<view style="display: flex;">
|
||||
<u-collapse>
|
||||
<u-collapse-item title="满减优惠" :open="true">
|
||||
<view v-for="(item,index) in fullReduceDiscount" :key="index">
|
||||
<span v-if="item.discount!=0">
|
||||
{{item.type}}:满{{ item.full }}元,打{{ item.discount }}折
|
||||
</span>
|
||||
<span v-else>满{{ item.full }}元,减{{ item.reduce }}元</span>
|
||||
</view>
|
||||
</u-collapse-item>
|
||||
</u-collapse>
|
||||
<!-- 满减优惠fullReduceDiscount -->
|
||||
</view>
|
||||
<view style="display: flex;">
|
||||
<span style="margin-right: 10px;">-¥{{fullRedece}}</span>
|
||||
<u-checkbox-group>
|
||||
<u-checkbox v-model="full" @change="changeFull"></u-checkbox>
|
||||
</u-checkbox-group>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="desc" v-else-if="fullRedece < couponRedece && couponDiscount > 0">
|
||||
<view style="display: flex;">
|
||||
<u-collapse>
|
||||
<u-collapse-item title="优惠券" :open="true">
|
||||
<view v-for="(item,index) in couponDiscount" :key="index">
|
||||
满{{ item.full }}元,减{{ item.reduce }}元
|
||||
</view>
|
||||
</u-collapse-item>
|
||||
</u-collapse>
|
||||
<!-- 优惠券 couponDiscount -->
|
||||
</view>
|
||||
<view style="display: flex;">
|
||||
<span style="margin-right: 10px;">-¥{{couponRedece}}</span>
|
||||
<u-checkbox-group>
|
||||
<u-checkbox v-model="coupon" @change="changeCoupon"></u-checkbox>
|
||||
</u-checkbox-group>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-else>
|
||||
<view class="desc" v-if="fullRedece >= 0 && fullReduceDiscount.length>0">
|
||||
<view style="display: flex;">
|
||||
<u-collapse>
|
||||
<u-collapse-item title="满减优惠" :open="true">
|
||||
<view v-for="(item,index) in fullReduceDiscount" :key="index">
|
||||
<span v-if="item.discount!=0">
|
||||
{{item.type}}:满{{ item.full }}元,打{{ item.discount }}折
|
||||
</span>
|
||||
<span v-else>满{{ item.full }}元,减{{ item.reduce }}元</span>
|
||||
</view>
|
||||
</u-collapse-item>
|
||||
</u-collapse>
|
||||
<!-- 满减优惠fullReduceDiscount -->
|
||||
</view>
|
||||
<view style="display: flex;">
|
||||
<span style="margin-right: 10px;">-¥{{fullRedece}}</span>
|
||||
<u-checkbox-group>
|
||||
<u-checkbox v-model="full" @change="changeFull"></u-checkbox>
|
||||
</u-checkbox-group>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="desc" v-if="couponRedece >= 0 && couponDiscount.length>0">
|
||||
<view style="display: flex;">
|
||||
<u-collapse>
|
||||
<u-collapse-item title="优惠券" :open="true">
|
||||
<view v-for="(item,index) in couponDiscount" :key="index">
|
||||
满{{ item.full }}元,减{{ item.reduce }}元
|
||||
</view>
|
||||
</u-collapse-item>
|
||||
</u-collapse>
|
||||
<!-- 优惠券 couponDiscount -->
|
||||
</view>
|
||||
<view style="display: flex;">
|
||||
<span style="margin-right: 10px;">-¥{{couponRedece}}</span>
|
||||
<u-checkbox-group>
|
||||
<u-checkbox v-model="coupon" @change="changeCoupon"></u-checkbox>
|
||||
</u-checkbox-group>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view style="margin: 10px 20px 0;color: red;font-size: 12px;">注:囤油卡不参与任何优惠活动</view>
|
||||
</view>
|
||||
|
||||
<view style="background-color: white;width: 94%;margin: 15px auto;">
|
||||
<view style="background-color: white;width: 94%;margin: 15px auto;height: 100px;">
|
||||
<view style="font-weight: bold;height: 40px;line-height: 40px;margin-left: 10px;margin-top: 20px;">支付方式
|
||||
</view>
|
||||
<!-- <view class="desc">
|
||||
@ -241,11 +128,8 @@
|
||||
user:{
|
||||
cardBalance:0,
|
||||
},
|
||||
balance:true,
|
||||
grade:false,
|
||||
oilCard:false,
|
||||
coupon:false,
|
||||
full:false,
|
||||
// 储值卡升数
|
||||
refuelBalance:0,
|
||||
// 会员等级信息
|
||||
userGrade:{},
|
||||
balanceRedece:0,
|
||||
@ -262,32 +146,19 @@
|
||||
couponDiscount:[],
|
||||
// 满减优惠信息
|
||||
fullReduceDiscount:[],
|
||||
// 支付金额
|
||||
payAmount:0,
|
||||
// 查询优惠活动信息所需参数
|
||||
preferentialData:{
|
||||
userId:"",
|
||||
storeId:"",
|
||||
gradeId:"",
|
||||
oilName:"",
|
||||
oilPrice:"",
|
||||
oilLiters:"",
|
||||
},
|
||||
// 互斥限制 -1没有限制 0满减互斥 1储值卡互斥
|
||||
exclusion:-1,
|
||||
// 是否为满减互斥
|
||||
isUseFull:false,
|
||||
// 是否为储值卡互斥
|
||||
isUseBalance:false,
|
||||
// 调起支付所需的数据
|
||||
orderInfo:{},
|
||||
// 是否使用囤油卡
|
||||
isOilStorageCard:false,
|
||||
// 是否使用会员等级优惠
|
||||
isUseGrade:false,
|
||||
orderInfo:{},
|
||||
// 是否使用储值卡
|
||||
isStoreValueCard:false,
|
||||
}
|
||||
},
|
||||
onLoad(e) {
|
||||
this.orderNo = e.orderNo
|
||||
// this.orderNo = "2345202312191043054f3328"
|
||||
// this.orderNo = e.orderNo
|
||||
this.orderNo = "234520231226154037a1f53b"
|
||||
},
|
||||
onShow() {
|
||||
this.getOilOrder();
|
||||
@ -296,81 +167,6 @@
|
||||
|
||||
},
|
||||
methods: {
|
||||
changeBalance(val){
|
||||
if(val){
|
||||
this.balanceRedece = 0
|
||||
this.isUseBalance = false;
|
||||
// this.balance = true
|
||||
}else{
|
||||
// this.balance = false
|
||||
this.isUseBalance = true;
|
||||
this.isOilStorageCard = false;
|
||||
this.oilCardRedece = 0;
|
||||
}
|
||||
this.isExclusion()
|
||||
console.log(111,val,this.balance)
|
||||
},
|
||||
changeOilCard(val){
|
||||
if(val == false){
|
||||
this.oilCardRedece = 0
|
||||
this.oilCard = true
|
||||
this.isOilStorageCard = false
|
||||
this.balance = true
|
||||
}else{
|
||||
this.oilCardRedece = this.oilOrder.oilNum
|
||||
this.oilCard = false
|
||||
this.isOilStorageCard = true
|
||||
this.isUseBalance = false;
|
||||
this.balance = false
|
||||
}
|
||||
this.isExclusion()
|
||||
console.log(1,val,this.grade,this.oilOrder.oilNum)
|
||||
},
|
||||
changeGrade(val){
|
||||
if(val == false){
|
||||
this.gradeRedece = 0
|
||||
this.grade = true
|
||||
}else{
|
||||
this.gradeRedece = 0
|
||||
this.gradeDiscount.forEach(item => {
|
||||
this.gradeRedece += +item.reduce
|
||||
})
|
||||
this.grade = false
|
||||
}
|
||||
this.isExclusion()
|
||||
console.log(222,this.gradeDiscount,this.grade)
|
||||
},
|
||||
changeFull(val){
|
||||
if(val == false){
|
||||
this.fullRedece = 0
|
||||
this.full = true
|
||||
}else{
|
||||
this.fullRedece = 0
|
||||
this.fullReduceDiscount.forEach(item => {
|
||||
this.fullRedece += +item.reduce
|
||||
})
|
||||
this.full = false
|
||||
}
|
||||
this.isExclusion()
|
||||
console.log(333,val,this.full)
|
||||
},
|
||||
changeCoupon(val){
|
||||
if(val == false){
|
||||
this.couponRedece = 0
|
||||
this.coupon = true
|
||||
}else{
|
||||
this.couponRedece = 0
|
||||
this.couponDiscount.forEach(item => {
|
||||
this.couponRedece += +item.reduce
|
||||
})
|
||||
this.coupon = false
|
||||
}
|
||||
this.isExclusion()
|
||||
console.log(444,val,this.coupon)
|
||||
},
|
||||
closeDropdown() {
|
||||
this.$refs.uDropdown.close();
|
||||
},
|
||||
// 支付接口
|
||||
payment(){
|
||||
let refuel = this.refuelMoney
|
||||
@ -436,515 +232,114 @@
|
||||
}
|
||||
});
|
||||
}else{
|
||||
my.tradePay({ tradeNO: res.data.data.reservedTransactionId }, function(resp){
|
||||
if(resp.resultCode == '9000'){
|
||||
console.log("支付成功")
|
||||
}else{
|
||||
request({
|
||||
url: "/business/allOrderInfo/orderStatus",
|
||||
method: 'post',
|
||||
data: {"orderNo":res.data.data.orderNo,"status":"payFail"},
|
||||
}).then((res)=>{
|
||||
uni.showToast({
|
||||
title:"支付失败!",
|
||||
icon:"error"
|
||||
})
|
||||
my.tradePay({ tradeNO: res.data.data.reservedTransactionId }, function(resp){
|
||||
if(resp.resultCode == '9000'){
|
||||
console.log("支付成功")
|
||||
}else{
|
||||
request({
|
||||
url: "/business/allOrderInfo/orderStatus",
|
||||
method: 'post',
|
||||
data: {"orderNo":res.data.data.orderNo,"status":"payFail"},
|
||||
}).then((res)=>{
|
||||
uni.showToast({
|
||||
title:"支付失败!",
|
||||
icon:"error"
|
||||
})
|
||||
console.log('支付失败,'+resp.resultCode);
|
||||
}
|
||||
});
|
||||
}
|
||||
})
|
||||
console.log('支付失败,'+resp.resultCode);
|
||||
}
|
||||
});
|
||||
}
|
||||
})
|
||||
},
|
||||
// 囤油卡变化后总金额的变化
|
||||
changeRefuelMoney(){
|
||||
let _this = this;
|
||||
_this.consumeRefuelMoney = 0;
|
||||
_this.oilActualPay = 0;
|
||||
_this.hoardAmount = 0;
|
||||
let conRefMon = 0;
|
||||
let hoardAmount = 0;
|
||||
if (_this.refuelMoney!=null){
|
||||
_this.refuelMoney.forEach(item => {
|
||||
if (item.oilType == _this.oilName){
|
||||
_this.isOilStorageCard = true
|
||||
if ((item.refuelMoney-_this.oilOrder.oilNum)>=0){
|
||||
conRefMon = _this.oilOrder.oilNum
|
||||
}else {
|
||||
conRefMon = item.refuelMoney
|
||||
// 扣除升数后需要消费的金额
|
||||
hoardAmount = _this.oilOrder.orderAmount - +(item.refuelMoney * _this.oilPrice).toFixed(2)
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
_this.oilCardRedece += +conRefMon
|
||||
if (_this.oilCardRedece!=0){
|
||||
_this.isOilStorageCard = true;
|
||||
_this.balanceRedece = 0;
|
||||
}
|
||||
_this.hoardAmount += +hoardAmount
|
||||
_this.isExclusion();
|
||||
},
|
||||
// 使用囤油卡 囤油卡不参与任何优惠
|
||||
countOilCard(){
|
||||
if (this.hoardAmount!=0){
|
||||
if (this.user.cardBalance!=0 && this.user.cardBalance >= (this.oilOrder.orderAmount - this.hoardAmount)) {
|
||||
this.payAmount = 0
|
||||
this.balanceRedece = this.hoardAmount
|
||||
}else{
|
||||
this.payAmount = (this.oilOrder.orderAmount - this.hoardAmount - this.user.cardBalance).toFixed(2)
|
||||
}
|
||||
}else{
|
||||
this.payAmount = 0
|
||||
this.balanceRedece = 0
|
||||
}
|
||||
console.log("oil",this.hoardAmount,this.payAmount)
|
||||
},
|
||||
// 使用优惠券不使用满减
|
||||
countAmountFull(){
|
||||
if (this.user.cardBalance >= (this.oilOrder.orderAmount-this.gradeRedece - this.couponRedece)) {
|
||||
this.payAmount = 0
|
||||
this.balanceRedece = (this.oilOrder.orderAmount-this.gradeRedece - this.couponRedece).toFixed(2)
|
||||
}else{
|
||||
this.balanceRedece = this.user.cardBalance
|
||||
this.payAmount = (this.oilOrder.orderAmount - this.gradeRedece - this.couponRedece - this.user.cardBalance).toFixed(2)
|
||||
}
|
||||
console.log("coup",this.payAmount)
|
||||
},
|
||||
// 使用优惠券和满减不使用储值卡
|
||||
countAmountUnBalance(){
|
||||
if (this.fullRedece >= this.couponRedece && this.exclusion == 0) {
|
||||
this.payAmount = (this.oilOrder.orderAmount - this.gradeRedece - this.fullRedece).toFixed(2)
|
||||
}else if (this.fullRedece < this.couponRedece && this.exclusion == 0) {
|
||||
this.payAmount = (this.oilOrder.orderAmount - this.gradeRedece - this.couponRedece).toFixed(2)
|
||||
}else{
|
||||
this.payAmount = (this.oilOrder.orderAmount - this.gradeRedece - this.couponRedece - this.fullRedece).toFixed(2)
|
||||
}
|
||||
this.balanceRedece = 0
|
||||
console.log("full",this.payAmount,this.exclusion)
|
||||
},
|
||||
// 使用储值卡不使用优惠券 || 使用满减不使用优惠券
|
||||
countAmountBalance(){
|
||||
if (this.user.cardBalance >= (this.oilOrder.orderAmount-this.gradeRedece - this.fullRedece)) {
|
||||
this.payAmount = 0
|
||||
this.balanceRedece = (this.oilOrder.orderAmount-this.gradeRedece - this.fullRedece).toFixed(2)
|
||||
}else{
|
||||
this.balanceRedece = this.user.cardBalance
|
||||
this.payAmount = (this.oilOrder.orderAmount-this.gradeRedece - this.fullRedece - this.user.cardBalance).toFixed(2)
|
||||
}
|
||||
console.log("balance",this.gradeRedece,this.payAmount)
|
||||
},
|
||||
// 判断互斥限制
|
||||
isExclusion(){
|
||||
if (this.exclusion == 1){
|
||||
// 不使用满减
|
||||
if (this.isUseBalance){
|
||||
this.countAmountFull()
|
||||
return;
|
||||
}
|
||||
// 储值卡互斥
|
||||
if (this.isUseBalance){
|
||||
this.countAmountUnBalance()
|
||||
return;
|
||||
}else {
|
||||
this.countAmountBalance()
|
||||
return;
|
||||
}
|
||||
}else if (this.exclusion == 0){
|
||||
// 满减互斥
|
||||
// 不使用储值卡
|
||||
if (this.isUseBalance){
|
||||
this.countAmountUnBalance()
|
||||
return;
|
||||
}
|
||||
if (this.isUseFull){
|
||||
this.countAmountFull()
|
||||
return;
|
||||
}else {
|
||||
this.countAmountBalance()
|
||||
return;
|
||||
}
|
||||
}else {
|
||||
// 使用囤油卡
|
||||
if (this.isOilStorageCard){
|
||||
this.fullRedece = 0;
|
||||
this.gradeRedece = 0;
|
||||
this.couponRedece = 0;
|
||||
this.countOilCard();
|
||||
return;
|
||||
}
|
||||
// 无互斥
|
||||
// 不使用储值卡
|
||||
if (this.isUseBalance){
|
||||
this.countAmountUnBalance()
|
||||
return;
|
||||
}
|
||||
// 不使用满减
|
||||
if (this.isUseBalance){
|
||||
this.countAmountFull()
|
||||
return;
|
||||
}
|
||||
this.countAmountBalance();
|
||||
}
|
||||
},
|
||||
// 调用优惠券接口
|
||||
getCoupon(){
|
||||
let _this = this;
|
||||
_this.couponDiscount =[];
|
||||
request({
|
||||
url: "business/marketingActivity/activeExchange/selectCardFavorableList",
|
||||
method: 'get',
|
||||
params: _this.preferentialData,
|
||||
}).then(response => {
|
||||
console.log(response)
|
||||
_this.couponRedece = 0;
|
||||
if (response.data.length>0){
|
||||
response.data.forEach(item => {
|
||||
_this.useCouponIds = item.id
|
||||
let discount = {type:item.type,discountType:item.discountType,name:item.name,oilName:_this.oilOrder.oils,full:0,reduce:0,discount:0}
|
||||
discount.full = item.satisfiedAmount
|
||||
if (item.type==0){
|
||||
// 油品券
|
||||
if (item.discountType==0){
|
||||
// 满减券
|
||||
discount.reduce = item.discountAmount
|
||||
}else {
|
||||
// 折扣券
|
||||
discount.discount = item.specialDiscount
|
||||
discount.reduce = item.discountOffset
|
||||
}
|
||||
}else if (item.type==1){
|
||||
// 商品券
|
||||
if (item.discountType==0){
|
||||
// 满减券
|
||||
discount.reduce = item.discountAmount
|
||||
}else {
|
||||
// 折扣券
|
||||
discount.discount = item.specialDiscount
|
||||
discount.reduce = item.discountOffset
|
||||
}
|
||||
}else {
|
||||
// 通用券
|
||||
if (item.discountType==0){
|
||||
// 满减券
|
||||
discount.reduce = item.discountAmount
|
||||
}else {
|
||||
// 折扣券
|
||||
discount.discount = item.specialDiscount
|
||||
discount.reduce = item.discountOffset
|
||||
}
|
||||
}
|
||||
if (discount.reduce!=0){
|
||||
if (_this.couponDiscount.length!=0){
|
||||
_this.couponDiscount.forEach(item2 => {
|
||||
if (item2.oilName!=discount.oilName) {
|
||||
_this.couponDiscount.push(discount)
|
||||
_this.couponRedece = discount.reduce
|
||||
}
|
||||
if (item2.name!=discount.name && item2.oilName==discount.oilName) {
|
||||
_this.couponDiscount.push(discount)
|
||||
_this.couponRedece = discount.reduce
|
||||
}
|
||||
})
|
||||
}else {
|
||||
_this.couponDiscount.push(discount)
|
||||
_this.couponRedece = discount.reduce
|
||||
}
|
||||
}
|
||||
if (item.exclusiveFunction == 0){
|
||||
// 满减互斥
|
||||
_this.fullRedece = 0
|
||||
_this.isUseFull = true;
|
||||
}else {
|
||||
// 储值卡付款互斥
|
||||
_this.couponRedece = 0;
|
||||
_this.isUseBalance = true;
|
||||
}
|
||||
_this.exclusion = item.exclusiveFunction
|
||||
})
|
||||
}
|
||||
_this.isExclusion();
|
||||
})
|
||||
},
|
||||
// 获取优惠活动信息
|
||||
preferential(){
|
||||
let _this = this;
|
||||
let fullReduction = 0;
|
||||
_this.fullReduction = 0;
|
||||
|
||||
request({
|
||||
url: "business/marketingActivity/activeExchange/selectConsumptionList",
|
||||
method: 'get',
|
||||
params: _this.preferentialData,
|
||||
}).then( response => {
|
||||
if (response.data.length>0){
|
||||
_this.fullReduceDiscount = []
|
||||
response.data.forEach(item => {
|
||||
if (item.participationCondition==1){
|
||||
_this.exclusion = 0
|
||||
}
|
||||
let discount = {type:item.name,full:0,reduce:0,discount:0,exclusion:item.participationCondition}
|
||||
let activeList = item.activeDiscountChildList;
|
||||
if (activeList.length>0){
|
||||
for (let i = 1;i<=activeList.length;i++){
|
||||
if (activeList.length>0){
|
||||
if (activeList[0].discount != null){
|
||||
// 折扣营销
|
||||
if (_this.oilOrder.orderAmount>=activeList[0].amount){
|
||||
discount.full = activeList[0].amount;
|
||||
discount.discount = activeList[0].discount;
|
||||
discount.reduce = _this.oilOrder.orderAmount - (_this.oilOrder.orderAmount * (activeList[0].discount / 10)).toFixed(2)
|
||||
fullReduction = _this.oilOrder.orderAmount - (_this.oilOrder.orderAmount * (activeList[0].discount / 10)).toFixed(2);
|
||||
}
|
||||
}else {
|
||||
// 满减
|
||||
if (_this.oilOrder.orderAmount>=activeList[0].amount){
|
||||
discount.full = activeList[0].amount;
|
||||
discount.reduce = activeList[0].deductionAmount;
|
||||
fullReduction = activeList[0].deductionAmount;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (activeList.length==0){
|
||||
fullReduction = 0
|
||||
}
|
||||
if (discount.reduce!=0){
|
||||
_this.fullReduceDiscount.push(discount)
|
||||
}
|
||||
_this.fullRedece += +fullReduction
|
||||
})
|
||||
}
|
||||
if (_this.isUseFull){
|
||||
_this.fullReduction = 0
|
||||
}
|
||||
// 查看是否有可使用的囤油卡
|
||||
chooseRefuelMoney(){
|
||||
let falg = false;
|
||||
this.refuelMoney.forEach(item => {
|
||||
if (item.oilType == this.oilName){
|
||||
falg = true
|
||||
this.refuelBalance = item.refuelMoney
|
||||
this.isOilStorageCard = true
|
||||
if (this.oilCardRedece >= this.oilOrder.oilNum){
|
||||
this.oilCardRedece = this.oilOrder.oilNum
|
||||
}else{
|
||||
this.oilCardRedece = item.refuelMoney
|
||||
this.chooseCardBalance(1)
|
||||
}
|
||||
}
|
||||
})
|
||||
if (falg == false) {
|
||||
this.chooseCardBalance(0)
|
||||
}
|
||||
},
|
||||
// 根据等级id获取会员等级信息
|
||||
getGrade(id){
|
||||
let _this = this;
|
||||
// 查看是否有可使用的储值卡金额
|
||||
chooseCardBalance(val){
|
||||
if (this.user.cardBalance>0) {
|
||||
this.isStoreValueCard = true;
|
||||
if (val == 0) {
|
||||
// 没有使用囤油卡
|
||||
if (this.user.cardBalance >= this.oilOrder.orderAmount){
|
||||
this.balanceRedece = this.oilOrder.orderAmount
|
||||
} else {
|
||||
this.balanceRedece = this.user.cardBalance
|
||||
this.payAmount = this.oilOrder.orderAmount - this.balanceRedece
|
||||
}
|
||||
}else{
|
||||
// 使用囤油卡
|
||||
// 扣除囤油卡金额后需要支付的金额
|
||||
let residueAmount = (this.oilOrder.oilNum - this.oilCardRedece) * this.oilPrice
|
||||
if (this.user.cardBalance >= residueAmount){
|
||||
this.balanceRedece = residueAmount
|
||||
} else {
|
||||
this.balanceRedece = this.user.cardBalance
|
||||
this.payAmount = (this.oilOrder.orderAmount - residueAmount - this.balanceRedece).toFixed(2)
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
// 查看是否有可使用的会员等级优惠
|
||||
chooseGrade(id){
|
||||
let that = this;
|
||||
request({
|
||||
url: "business/userManager/userGrade/isUse/" + id,
|
||||
method: 'get',
|
||||
}).then((response) => {
|
||||
let gasolineDiscount = 0;
|
||||
let dieselDiscount = 0;
|
||||
let naturalGasDiscount = 0;
|
||||
_this.gradeDiscount = [];
|
||||
_this.userGrade = response.data
|
||||
}).then((res) => {
|
||||
console.log(res,that.oilType)
|
||||
if (res.data != null && res.data != ""){
|
||||
if (res.data.preferential== "自定义优惠"){
|
||||
if (that.oilType == "汽油"){
|
||||
// 将数组按照金额从小到大排序
|
||||
let gasolineRule = JSON.parse(res.data.gasolineRule).sort((a,b) => a.gasolineRule1 - b.gasolineRule1);
|
||||
console.log(gasolineRule,222)
|
||||
if (res.data.gasolineDiscount == "满减优惠"){
|
||||
for (let i = 0; i<gasolineRule.length; i++){
|
||||
if (that.oilOrder.orderAmount >= gasolineRule[gasolineRule.length-1].gasolineRule1){
|
||||
that.gradeRedece = gasolineRule[gasolineRule.length-1].gasolineRule2
|
||||
break;
|
||||
}
|
||||
if (item.amount >= gasolineRule[i - 1].gasolineRule1 && item.amount < gasolineRule[i].gasolineRule1) {
|
||||
discount.full = gasolineRule[i - 1].gasolineRule1
|
||||
oilDiscount = gasolineRule[i - 1].gasolineRule2
|
||||
discount.reduce = gasolineRule[i - 1].gasolineRule2
|
||||
}
|
||||
}
|
||||
}
|
||||
if (res.data.gasolineDiscount == "每升优惠"){
|
||||
|
||||
if (response.data != null) {
|
||||
let discount = {type: "", full: 0, reduce: 0, liters: 0}
|
||||
if (response.data.preferential == '自定义优惠' && response.data.status == 'qy') {
|
||||
if (_this.oilType == "汽油") {
|
||||
let gasolineRule = JSON.parse(response.data.gasolineRule);
|
||||
if (response.data.gasolineDiscount == "满减优惠") {
|
||||
let oilDiscount = 0;
|
||||
discount.type = "满减优惠"
|
||||
for (let i = 1; i <= gasolineRule.length; i++) {
|
||||
// 将满减条件加入等级优惠列表
|
||||
if (gasolineRule.length > 1) {
|
||||
if (_this.oilOrder.orderAmount >= gasolineRule[gasolineRule.length - 1].gasolineRule1) {
|
||||
discount.full = gasolineRule[gasolineRule.length - 1].gasolineRule1
|
||||
oilDiscount = gasolineRule[gasolineRule.length - 1].gasolineRule2
|
||||
discount.reduce = gasolineRule[gasolineRule.length - 1].gasolineRule2
|
||||
break;
|
||||
}
|
||||
if (_this.oilOrder.orderAmount >= gasolineRule[i - 1].gasolineRule1 && _this.oilOrder.orderAmount < gasolineRule[i].gasolineRule1) {
|
||||
discount.full = gasolineRule[i - 1].gasolineRule1
|
||||
oilDiscount = gasolineRule[i - 1].gasolineRule2
|
||||
discount.reduce = gasolineRule[i - 1].gasolineRule2
|
||||
}
|
||||
} else {
|
||||
if (_this.oilOrder.orderAmount >= gasolineRule[i - 1].gasolineRule1) {
|
||||
discount.full = gasolineRule[i - 1].gasolineRule1
|
||||
oilDiscount = gasolineRule[i - 1].gasolineRule2
|
||||
discount.reduce = gasolineRule[i - 1].gasolineRule2
|
||||
}
|
||||
}
|
||||
}
|
||||
if (discount.reduce != 0) {
|
||||
_this.gradeDiscount.push(discount)
|
||||
}
|
||||
gasolineDiscount += +oilDiscount
|
||||
} else if (response.data.gasolineDiscount == "每升优惠") {
|
||||
discount.type = "每升优惠"
|
||||
let oilDiscount = 0;
|
||||
for (let i = 1; i <= gasolineRule.length; i++) {
|
||||
// 将满减条件加入等级优惠列表
|
||||
if (gasolineRule.length > 1) {
|
||||
if (_this.oilOrder.orderAmount >= gasolineRule[gasolineRule.length - 1].gasolineRule1) {
|
||||
discount.full = gasolineRule[gasolineRule.length - 1].gasolineRule1
|
||||
oilDiscount = (_this.oilOrder.oilNum * gasolineRule[gasolineRule.length - 1].gasolineRule3).toFixed(2);
|
||||
discount.reduce = (_this.oilOrder.oilNum * gasolineRule[gasolineRule.length - 1].gasolineRule3).toFixed(2);
|
||||
discount.liters = gasolineRule[i - 1].gasolineRule3
|
||||
break;
|
||||
}
|
||||
if (_this.oilOrder.orderAmount >= gasolineRule[i - 1].gasolineRule1 && _this.oilOrder.orderAmount < gasolineRule[i].gasolineRule1) {
|
||||
discount.full = gasolineRule[i - 1].gasolineRule1
|
||||
oilDiscount = (_this.oilOrder.oilNum * gasolineRule[i - 1].gasolineRule3).toFixed(2)
|
||||
discount.reduce = (_this.oilOrder.oilNum * gasolineRule[i - 1].gasolineRule3).toFixed(2)
|
||||
discount.liters = gasolineRule[i - 1].gasolineRule3
|
||||
}
|
||||
} else {
|
||||
if (_this.oilOrder.orderAmount >= gasolineRule[i - 1].gasolineRule1) {
|
||||
discount.full = gasolineRule[i - 1].gasolineRule1
|
||||
oilDiscount = (_this.oilOrder.oilNum * gasolineRule[i - 1].gasolineRule3).toFixed(2)
|
||||
discount.reduce = (_this.oilOrder.oilNum * gasolineRule[i - 1].gasolineRule3).toFixed(2)
|
||||
discount.liters = gasolineRule[i - 1].gasolineRule3
|
||||
}
|
||||
}
|
||||
}
|
||||
if (discount.reduce != 0) {
|
||||
_this.gradeDiscount.push(discount)
|
||||
}
|
||||
gasolineDiscount += +oilDiscount
|
||||
} else {
|
||||
gasolineDiscount = 0;
|
||||
}
|
||||
}
|
||||
if (_this.oilType == "柴油") {
|
||||
let dieselRule = JSON.parse(response.data.dieselRule);
|
||||
if (response.data.dieselDiscount == "满减优惠") {
|
||||
let oilDiscount = 0;
|
||||
discount.type = "满减优惠"
|
||||
for (let i = 1; i <= dieselRule.length; i++) {
|
||||
// 将满减条件加入等级优惠列表
|
||||
if (dieselRule.length > 1) {
|
||||
if (_this.oilOrder.orderAmount >= dieselRule[dieselRule.length - 1].dieselRule1) {
|
||||
discount.full = dieselRule[dieselRule.length - 1].dieselRule1
|
||||
oilDiscount = dieselRule[dieselRule.length - 1].dieselRule2
|
||||
discount.reduce = dieselRule[dieselRule.length - 1].dieselRule2
|
||||
break;
|
||||
}
|
||||
if (_this.oilOrder.orderAmount >= dieselRule[i - 1].dieselRule1 && _this.oilOrder.orderAmount < dieselRule[i].dieselRule1) {
|
||||
discount.full = dieselRule[i - 1].dieselRule1
|
||||
oilDiscount = dieselRule[i - 1].dieselRule2
|
||||
discount.reduce = dieselRule[i - 1].dieselRule2
|
||||
}
|
||||
} else {
|
||||
discount.full = dieselRule[i - 1].dieselRule1
|
||||
if (_this.oilOrder.orderAmount >= dieselRule[i - 1].dieselRule1) {
|
||||
oilDiscount = dieselRule[i - 1].dieselRule2
|
||||
discount.reduce = dieselRule[i - 1].dieselRule2
|
||||
}
|
||||
}
|
||||
}
|
||||
if (discount.reduce != 0) {
|
||||
_this.gradeDiscount.push(discount)
|
||||
if (that.oilType == "柴油"){
|
||||
|
||||
}
|
||||
dieselDiscount += +oilDiscount
|
||||
} else if (response.data.dieselDiscount == "每升优惠") {
|
||||
let oilDiscount = 0;
|
||||
for (let i = 1; i <= dieselRule.length; i++) {
|
||||
discount.type = "每升优惠"
|
||||
// 将满减条件加入等级优惠列表
|
||||
if (dieselRule.length > 1) {
|
||||
if (_this.oilOrder.orderAmount >= dieselRule[dieselRule.length - 1].dieselRule1) {
|
||||
discount.full = dieselRule[dieselRule.length - 1].dieselRule1
|
||||
oilDiscount = (_this.oilOrder.oilNum * dieselRule[dieselRule.length - 1].dieselRule3).toFixed(2);
|
||||
discount.reduce = (_this.oilOrder.oilNum * dieselRule[dieselRule.length - 1].dieselRule3).toFixed(2);
|
||||
discount.liters = dieselRule[dieselRule.length - 1].dieselRule3
|
||||
break;
|
||||
}
|
||||
if (_this.oilOrder.orderAmount >= dieselRule[i - 1].dieselRule1 && _this.oilOrder.orderAmount < dieselRule[i].dieselRule1) {
|
||||
discount.full = dieselRule[i - 1].dieselRule1
|
||||
oilDiscount = (_this.oilOrder.oilNum * dieselRule[i - 1].dieselRule3).toFixed(2)
|
||||
discount.reduce = (_this.oilOrder.oilNum * dieselRule[i - 1].dieselRule3).toFixed(2)
|
||||
discount.liters = dieselRule[i - 1].dieselRule3
|
||||
}
|
||||
} else {
|
||||
discount.full = dieselRule[i - 1].dieselRule1
|
||||
if (_this.oilOrder.orderAmount >= dieselRule[i - 1].dieselRule1) {
|
||||
oilDiscount = (_this.oilOrder.oilNum * dieselRule[i - 1].dieselRule3).toFixed(2)
|
||||
discount.reduce = (_this.oilOrder.oilNum * dieselRule[i - 1].dieselRule3).toFixed(2)
|
||||
discount.liters = dieselRule[i - 1].dieselRule3
|
||||
}
|
||||
}
|
||||
if (that.oilType == "天然气"){
|
||||
|
||||
}
|
||||
if (discount.reduce != 0) {
|
||||
_this.gradeDiscount.push(discount)
|
||||
}
|
||||
dieselDiscount += +oilDiscount
|
||||
} else {
|
||||
dieselDiscount = 0;
|
||||
}
|
||||
}
|
||||
if(_this.oilType == "天然气") {
|
||||
let naturalGasRule = JSON.parse(response.data.naturalGasRule);
|
||||
if (response.data.naturalGasDiscount == "满减优惠") {
|
||||
let oilDiscount = 0;
|
||||
discount.type = "满减优惠"
|
||||
for (let i = 1; i <= naturalGasRule.length; i++) {
|
||||
// 将满减条件加入等级优惠列表
|
||||
if (naturalGasRule.length > 1) {
|
||||
if (_this.oilOrder.orderAmount >= naturalGasRule[naturalGasRule.length - 1].naturalGasRule1) {
|
||||
discount.full = naturalGasRule[naturalGasRule.length - 1].naturalGasRule1
|
||||
oilDiscount = naturalGasRule[naturalGasRule.length - 1].naturalGasRule2;
|
||||
discount.reduce = naturalGasRule[naturalGasRule.length - 1].naturalGasRule2
|
||||
break;
|
||||
}
|
||||
if (_this.oilOrder.orderAmount >= naturalGasRule[i - 1].naturalGasRule1 && _this.oilOrder.orderAmount < naturalGasRule[i].naturalGasRule1) {
|
||||
discount.full = naturalGasRule[i - 1].naturalGasRule1
|
||||
oilDiscount = naturalGasRule[i - 1].naturalGasRule2
|
||||
discount.reduce = naturalGasRule[i - 1].naturalGasRule2
|
||||
}
|
||||
} else {
|
||||
if (_this.oilOrder.orderAmount >= naturalGasRule[i - 1].naturalGasRule1) {
|
||||
discount.full = naturalGasRule[i - 1].naturalGasRule1
|
||||
oilDiscount = naturalGasRule[i - 1].naturalGasRule2
|
||||
discount.reduce = naturalGasRule[i - 1].naturalGasRule2
|
||||
}
|
||||
}
|
||||
}
|
||||
if (discount.reduce != 0) {
|
||||
_this.gradeDiscount.push(discount)
|
||||
}
|
||||
naturalGasDiscount += +oilDiscount
|
||||
} else if (response.data.naturalGasDiscount == "每单位优惠") {
|
||||
let oilDiscount = 0;
|
||||
discount.type = "每单位优惠"
|
||||
for (let i = 1; i <= naturalGasRule.length; i++) {
|
||||
// 将满减条件加入等级优惠列表
|
||||
if (naturalGasRule.length > 1) {
|
||||
if (_this.oilOrder.orderAmount >= naturalGasRule[naturalGasRule.length - 1].naturalGasRule1) {
|
||||
discount.full = naturalGasRule[naturalGasRule.length - 1].naturalGasRule1
|
||||
oilDiscount = (_this.oilOrder.oilNum * naturalGasRule[gasolineRule.length - 1].naturalGasRule3).toFixed(2)
|
||||
discount.reduce = (_this.oilOrder.oilNum * naturalGasRule[gasolineRule.length - 1].naturalGasRule3).toFixed(2)
|
||||
discount.liters = naturalGasRule[naturalGasRule.length - 1].naturalGasRule3
|
||||
break;
|
||||
}
|
||||
if (_this.oilOrder.orderAmount >= naturalGasRule[i - 1].naturalGasRule1 && _this.oilOrder.orderAmount < naturalGasRule[i].naturalGasRule1) {
|
||||
discount.full = naturalGasRule[i - 1].naturalGasRule1
|
||||
oilDiscount = (_this.oilOrder.oilNum * naturalGasRule[i - 1].naturalGasRule3).toFixed(2)
|
||||
discount.reduce = (_this.oilOrder.oilNum * naturalGasRule[i - 1].naturalGasRule3).toFixed(2)
|
||||
discount.liters = naturalGasRule[i - 1].naturalGasRule3
|
||||
}
|
||||
} else {
|
||||
if (_this.oilOrder.orderAmount >= naturalGasRule[i - 1].naturalGasRule1) {
|
||||
discount.full = naturalGasRule[i - 1].naturalGasRule1
|
||||
oilDiscount = (_this.oilOrder.oilNum * naturalGasRule[i - 1].naturalGasRule3).toFixed(2)
|
||||
discount.reduce = (_this.oilOrder.oilNum * naturalGasRule[i - 1].naturalGasRule3).toFixed(2)
|
||||
discount.liters = naturalGasRule[i - 1].naturalGasRule3
|
||||
}
|
||||
}
|
||||
}
|
||||
if (discount.reduce != 0) {
|
||||
_this.gradeDiscount.push(discount)
|
||||
}
|
||||
naturalGasDiscount += +oilDiscount
|
||||
} else {
|
||||
naturalGasDiscount = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
_this.gradeRedece = gasolineDiscount + dieselDiscount + naturalGasDiscount
|
||||
}
|
||||
this.balance = true
|
||||
})
|
||||
},
|
||||
|
||||
// 根据用户id查询用户信息
|
||||
getUser(id){
|
||||
let _this = this;
|
||||
@ -952,16 +347,15 @@
|
||||
url: "business/userManager/user/" + id,
|
||||
method: 'get',
|
||||
}).then((res) => {
|
||||
// console.log(res)
|
||||
_this.user = res.data;
|
||||
if (res.data.refuelMoney!=null && res.data.refuelMoney!=""){
|
||||
_this.refuelMoney = JSON.parse(res.data.refuelMoney)
|
||||
_this.chooseRefuelMoney()
|
||||
}else{
|
||||
_this.chooseCardBalance(0)
|
||||
}
|
||||
_this.changeRefuelMoney()
|
||||
_this.preferentialData.oilPrice = _this.oilPrice
|
||||
_this.preferentialData.gradeId = res.data.gradeId
|
||||
_this.preferential()
|
||||
_this.getCoupon()
|
||||
_this.getGrade(res.data.gradeId)
|
||||
_this.chooseGrade(res.data.gradeId)
|
||||
})
|
||||
},
|
||||
// 获取油品订单
|
||||
@ -979,10 +373,6 @@
|
||||
_this.getStore(res.data.storeId)
|
||||
_this.getOilNumber(res.data.storeId)
|
||||
_this.getUser(res.data.userId)
|
||||
_this.preferentialData.storeId = res.data.storeId
|
||||
_this.preferentialData.userId = res.data.userId
|
||||
_this.preferentialData.oilName = res.data.oils
|
||||
_this.preferentialData.oilLiters = res.data.oilNum
|
||||
})
|
||||
},
|
||||
// 获取门店信息
|
||||
@ -1024,6 +414,7 @@
|
||||
})
|
||||
})
|
||||
},
|
||||
// 返回
|
||||
goBack() {
|
||||
uni.navigateBack()
|
||||
}
|
||||
|
@ -7,6 +7,18 @@
|
||||
<view class="my-icons"></view>
|
||||
</view>
|
||||
|
||||
<view style="text-align: center;margin-top: 20px;">
|
||||
<view style="margin: 0 auto;">
|
||||
<image style="width: 60%;" src="@/static/imgs/paymentSuccess.png"></image>
|
||||
</view>
|
||||
<view style="margin: 20px auto;font-size: 20px;color: #30a1ff;">支付成功</view>
|
||||
<view style="color: gray">
|
||||
您已完成支付<br/>
|
||||
谢谢您对来个油惠的支持!
|
||||
</view>
|
||||
<view @click="goBack" style="border: solid 1px #30a1ff;border-radius: 50px;margin: 20px auto;width: 150px;
|
||||
height: 40px;line-height: 40px;color: #30a1ff;">返回首页</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
@ -31,7 +43,7 @@
|
||||
|
||||
<style scoped lang="scss">
|
||||
.content {
|
||||
background: #f4f5f6;
|
||||
background: white;
|
||||
}
|
||||
|
||||
.container {
|
||||
|
@ -18,7 +18,8 @@ const upload = config => {
|
||||
const isToken = (config.headers || {}).isToken === false
|
||||
config.header = config.header || {}
|
||||
if (getToken() && !isToken) {
|
||||
config.header['Authorization'] = 'Bearer ' + getToken()
|
||||
// config.header['Authorization'] = 'Bearer ' + getToken()
|
||||
config.header['Access-Token'] = getToken()
|
||||
}
|
||||
// get请求映射params参数
|
||||
if (config.params) {
|
||||
|
Loading…
Reference in New Issue
Block a user