diff --git a/fuintBackend/db/待优化项 b/fuintBackend/db/待优化项 index 353e3d020..1e4757789 100644 --- a/fuintBackend/db/待优化项 +++ b/fuintBackend/db/待优化项 @@ -1,2 +1,17 @@ 1、 transaction_id存储 -2、 \ No newline at end of file +2、 + + +20231219 +1.中台组织架构删除有遮挡 +2.油站管理 滚动异样 +3.VueX页面刷新丢失缓存 +4.编辑油站 》 图片上传 +5.支付通道查询 +6.支付通道发布 +7.注意 进入油站配置链接 +8.进入油站错误提示 +9.首页没对齐 +10.门店二维码 收款二维码 +11.门店信息保存按钮 +12.角色组问题 \ No newline at end of file diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/api/fuyou/entity/MerchantConfig.java b/fuintBackend/fuint-application/src/main/java/com/fuint/api/fuyou/entity/MerchantConfig.java index 0b61f658b..16be692b9 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/api/fuyou/entity/MerchantConfig.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/api/fuyou/entity/MerchantConfig.java @@ -63,9 +63,12 @@ public class MerchantConfig extends BaseEntity implements Serializable { */ private Double amount; /** - * 小程序appid + * 微信小程序appid */ private String appid; - + /** + * 支付宝小程序appid + */ + private String alipayAppid; } diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/api/fuyou/service/impl/FyPayServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/api/fuyou/service/impl/FyPayServiceImpl.java index a33272cad..94c8c01c2 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/api/fuyou/service/impl/FyPayServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/api/fuyou/service/impl/FyPayServiceImpl.java @@ -341,14 +341,10 @@ public class FyPayServiceImpl implements FyPayService { // 私钥 Const.INS_PRIVATE_KEY = merchantConfig.getPrivateKey(); Map map = Builder.buildFuiou23(); - // 微信open_id - map.put("sub_openid", userVo.getOpenId()); // 机构号 map.put("ins_cd", merchantConfig.getInsCd()); // 商户号 map.put("mchnt_cd", merchantConfig.getMchntCd()); - // appid - map.put("sub_appid", merchantConfig.getAppid()); // 订单号 map.put("mchnt_order_no",receiveParameter.getOrderNo()); // 订单总金额 @@ -358,8 +354,16 @@ public class FyPayServiceImpl implements FyPayService { map.put("goods_des", receiveParameter.getContent()); if (receiveParameter.getPayType().equals("WECHAT")){ map.put("trade_type","LETPAY"); + // 微信open_id + map.put("sub_openid", userVo.getOpenId()); + // appid + map.put("sub_appid", merchantConfig.getAppid()); } else if (receiveParameter.getPayType().equals("ALIPAY")){ map.put("trade_type","FWC"); + // 支付宝userId + map.put("sub_openid", userVo.getUserId()); + // appid + map.put("sub_appid", merchantConfig.getAlipayAppid()); }else { res.put("code","error"); res.put("msg","暂不支持其他支付方式"); diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/indexBanner/controller/IndexBannerController.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/indexBanner/controller/IndexBannerController.java new file mode 100644 index 000000000..a5c820b3e --- /dev/null +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/indexBanner/controller/IndexBannerController.java @@ -0,0 +1,22 @@ +package com.fuint.business.indexBanner.controller; + +import com.fuint.business.indexBanner.service.IndexBannerService; +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.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("/business/indexBanner") +public class IndexBannerController extends BaseController { + @Autowired + private IndexBannerService indexBannerService; + + @GetMapping("/list/{storeId}") + public ResponseObject list(@PathVariable Integer storeId){ + return getSuccessResult(indexBannerService.selectIndexBannerList(storeId)); + } +} diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/indexBanner/entity/IndexBanner.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/indexBanner/entity/IndexBanner.java new file mode 100644 index 000000000..650a70f56 --- /dev/null +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/indexBanner/entity/IndexBanner.java @@ -0,0 +1,123 @@ +package com.fuint.business.indexBanner.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; + +/** + * 首页轮播图(IndexBanner)实体类 + */ +@Data +@TableName("index_banner") +@ApiModel(value = "IndexBanner对象", description = "首页轮播图") +public class IndexBanner extends BaseEntity implements Serializable { + private static final long serialVersionUID = 1L; + /** + * 自增ID + */ + @ApiModelProperty("自增ID") + @TableId(value = "ID", type = IdType.AUTO) + private Integer id; + /** + * 店铺id + */ + private Integer storeId; + /** + * 轮播图地址 + */ + private String bannerUrl; + /** + * 路由地址 + */ + private String routeUrl; + /** + * 创建时间 + */ + 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 String getBannerUrl() { + return bannerUrl; + } + + public void setBannerUrl(String bannerUrl) { + this.bannerUrl = bannerUrl; + } + + public String getRouteUrl() { + return routeUrl; + } + + public void setRouteUrl(String routeUrl) { + this.routeUrl = routeUrl; + } + + 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; + } + +} + diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/indexBanner/mapper/IndexBannerMapper.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/indexBanner/mapper/IndexBannerMapper.java new file mode 100644 index 000000000..15d31dfa0 --- /dev/null +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/indexBanner/mapper/IndexBannerMapper.java @@ -0,0 +1,7 @@ +package com.fuint.business.indexBanner.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.fuint.business.indexBanner.entity.IndexBanner; + +public interface IndexBannerMapper extends BaseMapper { +} diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/indexBanner/service/IndexBannerService.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/indexBanner/service/IndexBannerService.java new file mode 100644 index 000000000..fed42c45f --- /dev/null +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/indexBanner/service/IndexBannerService.java @@ -0,0 +1,13 @@ +package com.fuint.business.indexBanner.service; + +import com.fuint.business.indexBanner.entity.IndexBanner; + +import java.util.List; + +public interface IndexBannerService { + /** + * 根据店铺id查询首页banner图 + * @return + */ + List selectIndexBannerList(int storeId); +} diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/indexBanner/service/impl/IndexBannerServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/indexBanner/service/impl/IndexBannerServiceImpl.java new file mode 100644 index 000000000..d6aabcf4c --- /dev/null +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/indexBanner/service/impl/IndexBannerServiceImpl.java @@ -0,0 +1,22 @@ +package com.fuint.business.indexBanner.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.fuint.business.indexBanner.entity.IndexBanner; +import com.fuint.business.indexBanner.mapper.IndexBannerMapper; +import com.fuint.business.indexBanner.service.IndexBannerService; +import com.fuint.common.dto.AccountInfo; +import com.fuint.common.util.TokenUtil; +import org.springframework.stereotype.Service; + +import java.util.List; +@Service +public class IndexBannerServiceImpl extends ServiceImpl implements IndexBannerService { + @Override + public List selectIndexBannerList(int storeId) { +// AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo(); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("store_id",storeId); + return baseMapper.selectList(queryWrapper); + } +} diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeExchange/controller/ActiveExchangeController.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeExchange/controller/ActiveExchangeController.java index ec57c80d5..8028dbd35 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeExchange/controller/ActiveExchangeController.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeExchange/controller/ActiveExchangeController.java @@ -97,8 +97,8 @@ public class ActiveExchangeController extends BaseController { * @param paymentActiveDTO * @return */ - @GetMapping("test") - public ResponseObject paymentActiveVO(@Param("transferDTO") PaymentActiveDTO paymentActiveDTO) { + @PostMapping("test") + public ResponseObject paymentActiveVO(@RequestBody PaymentActiveDTO paymentActiveDTO) { return getSuccessResult(this.activeExchangeService.paymentActive(paymentActiveDTO)); } diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeExchange/service/impl/ActiveExchangeServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeExchange/service/impl/ActiveExchangeServiceImpl.java index d5c8ed9ab..a4a2771f4 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeExchange/service/impl/ActiveExchangeServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeExchange/service/impl/ActiveExchangeServiceImpl.java @@ -395,10 +395,10 @@ public class ActiveExchangeServiceImpl implements ActiveExchangeService { if (activeDiscountPayVO.getOilId().contains(paymentActiveDTO.getOilId().toString()) && activeDiscountPayVO.getAdaptUser().contains(paymentActiveDTO.getMtUserLevel().toString())){ if (activeDiscountPayVO.getDiscount() * activeDiscountPayVO.getAmount() > amount){ - amount = activeDiscountPayVO.getDiscount() * activeDiscountPayVO.getAmount(); + amount = paymentActiveDTO.getAmount() - (activeDiscountPayVO.getDiscount() * activeDiscountPayVO.getAmount()); paymentActiveVO.setActiveId(activeDiscountPayVO.getActiveId()); - paymentActiveVO.setAmount(activeDiscountPayVO.getAmount()); - paymentActiveVO.setFavorableAmount(amount); + paymentActiveVO.setAmount(amount); + paymentActiveVO.setFavorableAmount(activeDiscountPayVO.getAmount()); } } } @@ -410,10 +410,10 @@ public class ActiveExchangeServiceImpl implements ActiveExchangeService { if (activeDiscountPayVO.getOilId().contains(paymentActiveDTO.getOilId().toString()) && activeDiscountPayVO.getAdaptUser().contains(paymentActiveDTO.getMtUserLevel().toString())){ if (activeDiscountPayVO.getAmount() > amount){ - amount = activeDiscountPayVO.getDiscount() * activeDiscountPayVO.getAmount(); + amount = paymentActiveDTO.getAmount() - activeDiscountPayVO.getAmount(); paymentActiveVO.setActiveId(activeDiscountPayVO.getActiveId()); - paymentActiveVO.setAmount(activeDiscountPayVO.getAmount()); - paymentActiveVO.setFavorableAmount(amount); + paymentActiveVO.setAmount(amount); + paymentActiveVO.setFavorableAmount(activeDiscountPayVO.getAmount()); } } } diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/mapper/xml/OilOrderMapper.xml b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/mapper/xml/OilOrderMapper.xml index 8212656e6..b3eb4d687 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/mapper/xml/OilOrderMapper.xml +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/mapper/xml/OilOrderMapper.xml @@ -359,7 +359,7 @@ adc.deduction_amount discount FROM active_fullminus af - LEFT JOIN active_discount_child adc ON af.id = adc.active_discount_id + LEFT JOIN active_discount_child adc ON af.id = adc.active_fullminus_id where af.store_id = #{storeId} and adc.amount <= #{amount} diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/impl/OilOrderServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/impl/OilOrderServiceImpl.java index 600ba455e..f40eff429 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/impl/OilOrderServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/impl/OilOrderServiceImpl.java @@ -890,8 +890,7 @@ public class OilOrderServiceImpl extends ServiceImpl i // 查询会员等级列表信息 Page page = new Page(1,20); LJUserGrade ljUserGrade1 = new LJUserGrade(); - IPage ljUserGradeIPage = userGradeService.selectUserGradeList(page, ljUserGrade1); - List records = ljUserGradeIPage.getRecords(); + List records = userGradeService.selectUserGradeAll(storeId); if (oilName.getOilType().equals("汽油")){ gasGrowthValue = Integer.valueOf(sysConfigService.getValueByKey("gas_growth_value")); Integer addVal = (int) (gasGrowthValue * oilActualPay); diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/petrolStationManagement/mapper/xml/OilNumberMapper.xml b/fuintBackend/fuint-application/src/main/java/com/fuint/business/petrolStationManagement/mapper/xml/OilNumberMapper.xml index e4095aef1..5dab6ffaa 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/petrolStationManagement/mapper/xml/OilNumberMapper.xml +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/petrolStationManagement/mapper/xml/OilNumberMapper.xml @@ -132,7 +132,7 @@ diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/service/LJUserGradeService.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/service/LJUserGradeService.java index f18609a4a..1347a9474 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/service/LJUserGradeService.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/service/LJUserGradeService.java @@ -19,6 +19,13 @@ public interface LJUserGradeService extends IService { */ public IPage selectUserGradeList(Page page, LJUserGrade userGrade); + /** + * 根据店铺id查询当前店铺所有等级列表信息 + * @param storeId + * @return + */ + public List selectUserGradeAll(int storeId); + /** * 查询所有会员等级信息 * @return diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/service/impl/LJUserGradeServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/service/impl/LJUserGradeServiceImpl.java index 23823d0e2..3d599e355 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/service/impl/LJUserGradeServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/service/impl/LJUserGradeServiceImpl.java @@ -46,6 +46,14 @@ public class LJUserGradeServiceImpl extends ServiceImpl selectUserGradeAll(int storeId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("status","qy"); + queryWrapper.eq("store_id",storeId); + return baseMapper.selectList(queryWrapper); + } + @Override public List selectUserGradeAll() { QueryWrapper queryWrapper = new QueryWrapper<>(); diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/service/impl/LJUserServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/service/impl/LJUserServiceImpl.java index ce83d74ef..3ea478f84 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/service/impl/LJUserServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/service/impl/LJUserServiceImpl.java @@ -234,6 +234,7 @@ public class LJUserServiceImpl extends ServiceImpl impleme user1.setName(user.getName()); } user1.setOpenId(user.getOpenId()); + user1.setUserId(user.getUserId()); user1.setMobile(user.getMobile()); user1.setIdcard(user.getIdcard()); user1.setSex(user.getSex()); diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/vo/LJUserVo.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/vo/LJUserVo.java index 1cee0357f..1cf02647e 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/vo/LJUserVo.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/vo/LJUserVo.java @@ -35,6 +35,9 @@ public class LJUserVo extends BaseEntity { // @ExcelProperty(value = "微信") private String openId; +// 支付宝userid + private String userId; + // 手机号码 @ExcelProperty(value = "手机号码(必填)") private String mobile; diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/module/AlipayApi/controller/AlipayController.java b/fuintBackend/fuint-application/src/main/java/com/fuint/module/AlipayApi/controller/AlipayController.java index 43d3c0ced..48d524a50 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/module/AlipayApi/controller/AlipayController.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/module/AlipayApi/controller/AlipayController.java @@ -4,12 +4,17 @@ import cn.hutool.core.util.ObjectUtil; import com.alibaba.fastjson.JSONObject; import com.alipay.api.AlipayApiException; import com.alipay.api.response.AlipaySystemOauthTokenResponse; +import com.fuint.business.storeInformation.entity.LJStore; +import com.fuint.business.storeInformation.service.ILJStoreService; import com.fuint.business.userManager.entity.LJUser; import com.fuint.business.userManager.service.LJUserService; import com.fuint.business.userManager.vo.LJUserVo; +import com.fuint.common.dto.AccountInfo; +import com.fuint.common.util.TokenUtil; import com.fuint.framework.web.BaseController; import com.fuint.framework.web.ResponseObject; import com.fuint.module.AlipayApi.service.AlipayService1; +import com.fuint.module.backendApi.response.LoginResponse; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -19,6 +24,8 @@ import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; +import javax.servlet.http.HttpServletRequest; +import java.util.Date; import java.util.Map; @RestController @@ -29,6 +36,8 @@ public class AlipayController extends BaseController { private AlipayService1 alipayService; @Autowired private LJUserService userService; + @Autowired + private ILJStoreService iljStoreService; /** * 获取支付宝userId @@ -36,32 +45,51 @@ public class AlipayController extends BaseController { * @return */ @PostMapping("/getUserid") - public ResponseObject getUserId(@Validated @RequestBody Map map) throws AlipayApiException { + public ResponseObject getUserId(@RequestBody Map map,HttpServletRequest request) throws AlipayApiException { String authCode = map.get("authCode"); - JSONObject paramsObj = new JSONObject(map.isEmpty()); - logger.info("微信授权登录参数:{}", map); - JSONObject userInfo = paramsObj.getJSONObject("userInfo"); - String storeId = ObjectUtil.isEmpty(userInfo.get("storeId"))? "" : userInfo.get("storeId").toString(); - if ("".equals(storeId)) return getFailureResult(0, "微信登录失败"); - + logger.info("支付宝授权登录参数:{}", map); + String storeId = map.get("storeId"); + if ("".equals(storeId)) return getFailureResult(0, "支付宝登录失败"); +// 根据storeId查找对应的连锁店id + LJStore ljStore = iljStoreService.selectStoreByIdUni(Integer.parseInt(storeId)); // 获取支付宝userid AlipaySystemOauthTokenResponse alipayProfile = alipayService.getAlipayProfile(authCode); + if (alipayProfile == null) { + return getFailureResult(0, "支付宝登录失败"); + } String userId = alipayProfile.getUserId(); // 根据手机号查询用户信息 - LJUser user = userService.selectUserByMobile(userInfo.get("phone").toString()); + LJUser user = userService.selectUserByMobile(map.get("phone")); if (ObjectUtil.isNotEmpty(user)){ -// 添加用户的支付宝userid +// 存在则修改用户的支付宝userid user.setUserId(userId); userService.updateById(user); }else { +// 不存在则添加用户的支付宝userid LJUserVo ljUser = new LJUserVo(); - ljUser.setMobile(userInfo.get("phone").toString()); - - + ljUser.setMobile(map.get("phone")); + ljUser.setUserId(userId); userService.insertUser(ljUser); } + LJUser ljUser = userService.selectUserByMobile(map.get("phone")); - return getSuccessResult(""); + String userAgent = request.getHeader("user-agent"); + AccountInfo accountInfo = new AccountInfo(); + accountInfo.setId(ljUser.getId()); + accountInfo.setDeptId(-1L); + if (ObjectUtil.isNotEmpty(storeId) && storeId!= "") { + accountInfo.setStoreId(Integer.parseInt(storeId)); + } + String token = TokenUtil.generateToken(userAgent, ljUser.getId()); + accountInfo.setToken(token); + TokenUtil.saveAccountToken(accountInfo); + LoginResponse response = new LoginResponse(); + response.setLogin(true); + response.setChainStoreId(ljStore.getChainStoreId()); + response.setToken(token); + response.setTokenCreatedTime(new Date()); + + return getSuccessResult("登录成功",response); } } diff --git a/gasStation-uni/App.vue b/gasStation-uni/App.vue index 7f920bac9..e9bc255f5 100644 --- a/gasStation-uni/App.vue +++ b/gasStation-uni/App.vue @@ -41,7 +41,7 @@ // #ifdef MP-ALIPAY uni.setStorageSync("appltType","ALIPAY") console.log("支付宝") - + my.canIUse('button.open-type.getAuthorize') // #endif }, onShow: function() { diff --git a/gasStation-uni/config.js b/gasStation-uni/config.js index 6795f0a38..c294d620a 100644 --- a/gasStation-uni/config.js +++ b/gasStation-uni/config.js @@ -5,7 +5,7 @@ module.exports = { baseUrl: 'http://192.168.0.121:8080/', // baseUrl: 'http://192.168.1.5:8002/cdJdc', - imagesUrl: 'http://www.nuoyunr.com/lananRsc', + imagesUrl: 'https://www.tuofeng.cc/oilRescue', // 应用信息 appInfo: { // 应用名称 diff --git a/gasStation-uni/main.js b/gasStation-uni/main.js index ed964ca52..d197a4404 100644 --- a/gasStation-uni/main.js +++ b/gasStation-uni/main.js @@ -7,7 +7,7 @@ import share from './utils/share.js' Vue.mixin(share) const baseUrl = config.baseUrl Vue.prototype.$baseUrl = baseUrl; - +Vue.prototype.$imageUrl = config.imageUrl; // #ifndef VUE3 import Vue from 'vue' import './uni.promisify.adaptor' diff --git a/gasStation-uni/pages/index/index.vue b/gasStation-uni/pages/index/index.vue index a4913c556..e18e59763 100644 --- a/gasStation-uni/pages/index/index.vue +++ b/gasStation-uni/pages/index/index.vue @@ -5,15 +5,16 @@ - + @@ -185,7 +186,7 @@ if (q == undefined) { let str = q.split("?")[1]; let arr = str.split("&"); - let storeId = ""; + let storeId = "16"; let staffId = ""; arr.forEach(item => { if (item.includes("storeId")) { @@ -206,12 +207,30 @@ }, onShow() { this.isJoined() + this.getIndexBanner() // this.isExistStoreId(); }, components: { tabbar }, methods: { + // 跳转banner图对应的页面 + goPage(url){ + uni.navigateTo({ + url:url, + }) + }, + // 获取首页轮播图信息 + getIndexBanner(){ + if (uni.getStorageSync("storeId")){ + request({ + url: 'business/indexBanner/list/'+uni.getStorageSync("storeId"), + method: 'get', + }).then(res => { + this.list1 = res.data + }) + } + }, //判断是否是新人 isJoined() { request({ @@ -277,10 +296,11 @@ let _this = this; // this.getAddress(); - wx.getSetting({ + uni.getSetting({ success(res) { + console.log(res,111) if (!res.authSetting['scope.userLocation']) { - wx.authorize({ + uni.authorize({ scope: 'scope.userLocation', success() { // 用户同意获取位置信息 @@ -493,7 +513,7 @@ width: 100%; height: 250px; // background-color: #3da4df; - background: url('http://47.95.206.185:83/topbj.png')center no-repeat; + // background: url('http://47.95.206.185:83/topbj.png')center no-repeat; background-size: 100% 100%; position: relative; margin-bottom: 60px; diff --git a/gasStation-uni/pages/refuel/refuel.vue b/gasStation-uni/pages/refuel/refuel.vue index b9707982e..473d6e815 100644 --- a/gasStation-uni/pages/refuel/refuel.vue +++ b/gasStation-uni/pages/refuel/refuel.vue @@ -113,7 +113,7 @@ data() { return { value: '', - liters:"", + liters:"", show: false, pic: 0, hindex: 0, @@ -159,7 +159,7 @@ orderAmount:0, discountAmount:0, payAmount:0, - payType:"WECHAT", + payType:uni.getStorageSync("appltType"), }, } }, @@ -189,6 +189,7 @@ onShow() { // this.isExistStoreId(); this.getStore(uni.getStorageSync("storeId")); + // this.getStore(0); }, methods: { isExistStoreId(){ diff --git a/gasStation-uni/pagesLogin/login/login.vue b/gasStation-uni/pagesLogin/login/login.vue index 15f91dcbd..3ebd4ab39 100644 --- a/gasStation-uni/pagesLogin/login/login.vue +++ b/gasStation-uni/pagesLogin/login/login.vue @@ -57,6 +57,7 @@ // return; // } console.log(e) + let _this = this; my.getAuthCode({ scopes: 'auth_base', @@ -68,15 +69,23 @@ method: 'post', data: { authCode:authCode, - userInfo: { - storeId: 0, - staffId: "", - phone: '18457621459' - }, + storeId:0, + staffId:"", + phone:"18457621459", }, }).then((resp)=>{ console.log(resp) - // uni.setStorageSync("userId",resp.data) + if (resp.code == 200) { + + uni.setStorageSync('App-Token', resp.data.token); + uni.setStorageSync('chainStoreId', resp.data.chainStoreId); + + uni.navigateTo({ + url: '/pages/index/index' + }) + } + console.log("swq", uni.getStorageSync( + 'App-Token')); }) }, fail: err => { diff --git a/gasStation-uni/pagesMy/setup/index.vue b/gasStation-uni/pagesMy/setup/index.vue index 272ecacea..7782efd47 100644 --- a/gasStation-uni/pagesMy/setup/index.vue +++ b/gasStation-uni/pagesMy/setup/index.vue @@ -72,6 +72,7 @@ let _this = this; let tempFilePath = e.detail.avatarUrl //上传的图片地址 let maxSizeInBytes = 1024*1024 //限制大小 + console.log(111) uni.getFileInfo({ filePath:tempFilePath, success(res) { diff --git a/gasStation-uni/pagesRefuel/orderDetail/index.vue b/gasStation-uni/pagesRefuel/orderDetail/index.vue index 05429c85d..a66337e1c 100644 --- a/gasStation-uni/pagesRefuel/orderDetail/index.vue +++ b/gasStation-uni/pagesRefuel/orderDetail/index.vue @@ -60,15 +60,15 @@ - 满减活动优惠 - (满减活动}) + 活动优惠 + -¥{{fullRedece}} - + @@ -94,17 +94,20 @@ 支付方式 - + 微信支付 + + + + + 支付宝支付 + + + @@ -130,7 +133,7 @@ data() { return { // 小程序类型 微信 WECHAT 支付宝 ALIPAY - appltType: "WECHAT", + appltType: uni.getStorageSync("appltType"), gradeDis:"", title: '', value: true, @@ -146,6 +149,8 @@ oilName: "", // 油品类型 oilType:"", + // 油品id + oilId:"", // 用户信息 user:{ cardBalance:0, @@ -179,11 +184,17 @@ isStoreValueCard:false, // 是否存在可使用的等级优惠 isGradePreferential:false, + transferDTO:{ + type:0, + amount:0, + oilId:"", + mtUserLevel:"", + } } }, onLoad(e) { this.orderNo = e.orderNo - // this.orderNo = "234520231226154037a1f53b" + // this.orderNo = "234520231229140854e4c4ca" }, onShow() { this.getOilOrder(); @@ -214,14 +225,14 @@ method: 'post', data: map, }).then(res => { - // console.log(res) + // console.log(res,_this.appltType) let payProvider = "wxpay" if (_this.appltType== "WECHAT"){ payProvider = "wxpay" }else{ payProvider = "alipay" } - if (res.data.reservedPayInfo!=null && res.data.reservedPayInfo!=""){ + if (res.data.data.reservedPayInfo!=null && res.data.data.reservedPayInfo!=""){ _this.orderInfo = JSON.parse(res.data.data.reservedPayInfo); uni.requestPayment({ // 微信支付provider: 'wxpay' 支付宝支付 'alipay' @@ -260,6 +271,9 @@ my.tradePay({ tradeNO: res.data.data.reservedTransactionId }, function(resp){ if(resp.resultCode == '9000'){ console.log("支付成功") + uni.reLaunch({ + url: '/pagesRefuel/orderSuccess/index' + }) }else{ request({ url: "/business/allOrderInfo/orderStatus", @@ -312,6 +326,7 @@ this.deductAmount = this.oilOrder.orderAmount - this.balanceRedece this.payAmount = this.oilOrder.orderAmount - this.balanceRedece } + this.preferential.amount = this.deductAmount }else{ // 使用囤油卡 // 扣除囤油卡金额后需要支付的金额 @@ -325,6 +340,7 @@ } }else{ this.deductAmount = this.oilOrder.orderAmount + this.transferDTO.amount = this.deductAmount } }, // 查看是否有可使用的会员等级优惠 @@ -336,6 +352,7 @@ }).then((res) => { if (res.data != null && res.data != ""){ that.userGrade = res.data + that.chooseFullOrCoupon(); if (res.data.preferential== "自定义优惠"){ if (that.oilType == "汽油"){ // 将数组按照金额从小到大排序 @@ -477,6 +494,25 @@ } }) }, + // 查看是否有可使用的优惠活动 + chooseFullOrCoupon(){ + this.transferDTO.amount = this.deductAmount + this.transferDTO.mtUserLevel = this.userGrade.id + this.transferDTO.oilId = this.oilId + console.log(this.transferDTO) + let _this = this; + request({ + url: "business/marketingActivity/activeExchange/test", + method: 'post', + data:_this.transferDTO, + }).then((res) => { + console.log(res) + if (res.data.amount!=0){ + _this.payAmount = res.data.amount - _this.gradeRedece + _this.fullRedece = res.data.favorableAmount + } + }) + }, // 计算用户应付金额 countPayMent(){ @@ -510,11 +546,14 @@ orderNo: _this.orderNo }, }).then((res) => { - _this.oilOrder = res.data - _this.getStaffList(res.data.staffId) - _this.getStore(res.data.storeId) - _this.getOilNumber(res.data.storeId) - _this.getUser(res.data.userId) + // console.log(res) + if(res.data!=null){ + _this.oilOrder = res.data + _this.getStaffList(res.data.staffId) + _this.getStore(res.data.storeId) + _this.getOilNumber(res.data.storeId) + _this.getUser(res.data.userId) + } }) }, // 获取门店信息 @@ -552,6 +591,7 @@ _this.oilPrice = item.gbPrice; _this.oilName = item.oilNames; _this.oilType = item.oilType; + _this.oilId = item.oilId; } }) })