Merge remote-tracking branch 'origin/feature/mall_product' into feature/mall_product

pull/2/head
tangqian 2023-05-23 11:23:21 +08:00
commit a8bfcebce4
26 changed files with 1101 additions and 127 deletions

View File

@ -16,13 +16,13 @@
<module>yudao-module-member</module>
<module>yudao-module-system</module>
<module>yudao-module-infra</module>
<module>yudao-module-pay</module>
<!-- <module>yudao-module-pay</module>-->
<!-- <module>yudao-module-bpm</module>-->
<!-- <module>yudao-module-report</module>-->
<!-- <module>yudao-module-mp</module>-->
<module>yudao-module-mall</module>
<!-- 示例项目 -->
<module>yudao-example</module>
<!-- <module>yudao-example</module>-->
</modules>
<name>${project.artifactId}</name>

View File

@ -18,12 +18,12 @@
商城大模块,由 product 商品、promotion 营销、trade 交易等组成
</description>
<modules>
<module>yudao-module-promotion-api</module>
<module>yudao-module-promotion-biz</module>
<module>yudao-module-product-api</module>
<module>yudao-module-product-biz</module>
<module>yudao-module-trade-api</module>
<module>yudao-module-trade-biz</module>
<!-- <module>yudao-module-promotion-api</module>-->
<!-- <module>yudao-module-promotion-biz</module>-->
<!-- <module>yudao-module-product-api</module>-->
<!-- <module>yudao-module-product-biz</module>-->
<!-- <module>yudao-module-trade-api</module>-->
<!-- <module>yudao-module-trade-biz</module>-->
<module>yudao-module-shop-biz</module>
<module>yudao-module-shop-api</module>
</modules>

View File

@ -17,11 +17,6 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>cn.iocoder.boot</groupId>
<artifactId>yudao-module-product-api</artifactId>
<version>${revision}</version>
</dependency>
<dependency>
<groupId>cn.iocoder.boot</groupId>

View File

@ -52,6 +52,8 @@ import cn.iocoder.yudao.module.shop.utils.RedisUtil;
import cn.iocoder.yudao.module.shop.vo.order.LogisticsResultVo;
import cn.iocoder.yudao.module.shop.vo.order.StoreDateRangeSqlPram;
import cn.iocoder.yudao.module.shop.vo.order.StoreOrderInfoOldVo;
import cn.iocoder.yudao.module.system.api.dept.DeptApi;
import cn.iocoder.yudao.module.system.api.dept.dto.DeptRespDTO;
import com.alipay.api.AlipayApiException;
import com.alipay.api.internal.util.AlipaySignature;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
@ -147,6 +149,8 @@ public class StoreOrderServiceImpl extends ServiceImpl<StoreOrderMapper, StoreOr
@Autowired
private WxMpService wxMpService;
private DeptApi deptApi;
/**
* PC
*
@ -1360,6 +1364,12 @@ public class StoreOrderServiceImpl extends ServiceImpl<StoreOrderMapper, StoreOr
private RechargeOrderDO initializeOrder(OrderContentRequest request, String code, MemberUserRespDTO user, PromoterDTO promoterDTO) {
Long tenantId = TenantContextHolder.getTenantId();
Long deptId = promoterDTO.getDeptId();
if(deptId==null){
DeptRespDTO deptRespDTO = deptApi.findParentDept(tenantId);
deptId = deptRespDTO.getId();
}
RechargeOrderDO orderDO = new RechargeOrderDO();
List<OrderContentRequest.OrderInfo> orderInfos = request.getOrderInfos();
orderDO.setOrderId(code);

View File

@ -116,7 +116,7 @@ public class AppUserController {
List<UserSpreadBannerVO> list = new ArrayList<>();
UserSpreadBannerVO userSpreadBannerVO = new UserSpreadBannerVO();
userSpreadBannerVO.setId(1);
userSpreadBannerVO.setPic("http://192.168.1.147:48080/admin-api/infra/file/4/get/431efea27162d536d35f7b3c0b844ede98a6ba58f4fd72ac7181e7ee5ebae77a.jpg");
userSpreadBannerVO.setPic("http://image.cyywl.top/431efea27162d536d35f7b3c0b844ede98a6ba58f4fd72ac7181e7ee5ebae77a.jpg");
userSpreadBannerVO.setTitle("推广背景图");
list.add(userSpreadBannerVO);
return CommonResult.success(list);

View File

@ -48,6 +48,18 @@ public interface DeptApi {
*/
void validateDeptList(Collection<Long> ids);
/**
* <pre>
* <b>findParentDept</b>
* <b>Description:</b>
* <b>@author:</b> zenghuapei
* <b>@date:</b> 2023/5/23 09:38
* @param :
* @return
* </pre>
*/
DeptRespDTO findParentDept(Long tenantId);
/**
* Map
*

View File

@ -38,6 +38,22 @@ public class DeptApiImpl implements DeptApi {
List<DeptDO> depts = deptService.getDeptList(new DeptListReqVO());
return DeptConvert.INSTANCE.convertList03(depts);
}
/**
* <pre>
* <b>findParentDept</b>
* <b>Description:</b>
* <b>@author:</b> zenghuapei
* <b>@date:</b> 2023/5/23 09:38
* @return
* </pre>
*/
@Override
public DeptRespDTO findParentDept(Long tenantId) {
DeptDO deptDO = deptService.findParentDept(tenantId );
return DeptConvert.INSTANCE.convert03(deptDO);
}
@Override
public void validateDeptList(Collection<Long> ids) {
deptService.validateDeptList(ids);

View File

@ -2,6 +2,7 @@ package cn.iocoder.yudao.module.system.service.dept;
import cn.hutool.core.collection.CollUtil;
import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils;
import cn.iocoder.yudao.module.system.api.dept.dto.DeptRespDTO;
import cn.iocoder.yudao.module.system.controller.admin.dept.vo.dept.DeptCreateReqVO;
import cn.iocoder.yudao.module.system.controller.admin.dept.vo.dept.DeptListReqVO;
import cn.iocoder.yudao.module.system.controller.admin.dept.vo.dept.DeptUpdateReqVO;
@ -54,6 +55,18 @@ public interface DeptService {
*/
List<DeptDO> getDeptList(DeptListReqVO reqVO);
/**
* <pre>
* <b>findParentDept</b>
* <b>Description:</b>
* <b>@author:</b> zenghuapei
* <b>@date:</b> 2023/5/23 09:40
* @param tenantId:
* @return
* </pre>
*/
DeptDO findParentDept(Long tenantId);
/**
*
*

View File

@ -4,6 +4,7 @@ import cn.hutool.core.collection.CollUtil;
import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
import cn.iocoder.yudao.framework.tenant.core.context.TenantContextHolder;
import cn.iocoder.yudao.framework.tenant.core.util.TenantUtils;
import cn.iocoder.yudao.module.system.api.dept.dto.DeptRespDTO;
import cn.iocoder.yudao.module.system.controller.admin.dept.vo.dept.DeptCreateReqVO;
import cn.iocoder.yudao.module.system.controller.admin.dept.vo.dept.DeptListReqVO;
import cn.iocoder.yudao.module.system.controller.admin.dept.vo.dept.DeptUpdateReqVO;
@ -13,6 +14,7 @@ import cn.iocoder.yudao.module.system.dal.mysql.dept.DeptMapper;
import cn.iocoder.yudao.module.system.enums.dept.DeptIdEnum;
import cn.iocoder.yudao.module.system.mq.producer.dept.DeptProducer;
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableMultimap;
import com.google.common.collect.Multimap;
@ -152,6 +154,26 @@ public class DeptServiceImpl implements DeptService {
return deptMapper.selectList(reqVO);
}
/**
* <pre>
* <b>findParentDept</b>
* <b>Description:</b>
* <b>@author:</b> zenghuapei
* <b>@date:</b> 2023/5/23 09:40
* @param tenantId :
* @return
* </pre>
*/
@Override
public DeptDO findParentDept(Long tenantId) {
List<DeptDO> deptDOs = deptMapper.selectList(Wrappers.lambdaQuery(DeptDO.class).eq(DeptDO::getParentId,DeptIdEnum.ROOT.getId()).eq(DeptDO::getTenantId,tenantId));
if(deptDOs!=null && deptDOs.size() > 0){
return deptDOs.get(0);
}
return null;
}
@Override
public List<DeptDO> getDeptListByParentIdFromCache(Long parentId, boolean recursive) {
if (parentId == null) {

View File

@ -45,7 +45,7 @@ spring:
datasource:
master:
name: cyywl
url: jdbc:mysql://117.33.142.185:3306/${spring.datasource.dynamic.datasource.master.name}?useSSL=false&allowPublicKeyRetrieval=true
url: jdbc:mysql://47.109.92.244:3306/${spring.datasource.dynamic.datasource.master.name}?useSSL=false&allowPublicKeyRetrieval=true
driver-class-name: com.mysql.jdbc.Driver
username: root
password: axzsd110
@ -58,10 +58,10 @@ spring:
# Redis 配置。Redisson 默认的配置足够使用,一般不需要进行调优
redis:
host: 117.33.142.185 # 地址
host: 47.109.92.244 # 地址
port: 6369 # 端口
database: 6 # 数据库索引
password: 20221122@dev # 密码,建议生产环境开启
password: cyywl123.. # 密码,建议生产环境开启
--- #################### 定时任务相关配置 ####################
@ -216,7 +216,7 @@ wx:
useRedis: false
defaultContent: \u60A8\u597D\uFF0C\u6709\u4EC0\u4E48\u95EE\u9898\uFF1F
redisConfig:
host: 117.33.142.185 # 地址
port: 6369 # 端口
host: 47.109.92.244 # 地址
port: 6399 # 端口
database: 16 # 数据库索引
password: 20221122@dev # 密码,建议生产环境开启
password: cyywl123.. # 密码,建议生产环境开启

View File

@ -47,10 +47,10 @@ spring:
datasource:
master:
name: cyywl
url: jdbc:mysql://117.33.142.185:3306/${spring.datasource.dynamic.datasource.master.name}?useSSL=false&allowPublicKeyRetrieval=true
url: jdbc:mysql://47.109.92.244:3386/${spring.datasource.dynamic.datasource.master.name}?useSSL=false&allowPublicKeyRetrieval=true
driver-class-name: com.mysql.jdbc.Driver
username: root
password: axzsd110
password: cyywl123
# slave: # 模拟从库,可根据自己需要修改 # 模拟从库,可根据自己需要修改
# name: ruoyi-vue-pro
# url: jdbc:mysql://400-infra.server.iocoder.cn:3306/${spring.datasource.dynamic.datasource.slave.name}?useSSL=false&serverTimezone=CTT&allowPublicKeyRetrieval=true
@ -60,10 +60,10 @@ spring:
# Redis 配置。Redisson 默认的配置足够使用,一般不需要进行调优
redis:
host: 117.33.142.185 # 地址
port: 6369 # 端口
host: 47.109.92.244 # 地址
port: 6399 # 端口
database: 6 # 数据库索引
password: 20221122@dev # 密码,建议生产环境开启
password: cyywl123.. # 密码,建议生产环境开启
--- #################### 定时任务相关配置 ####################
@ -143,9 +143,16 @@ logging:
--- #################### 微信公众号相关配置 ####################
wx: # 参见 https://github.com/Wechat-Group/WxJava/blob/develop/spring-boot-starters/wx-java-mp-spring-boot-starter/README.md 文档
mp:
useRedis: false
defaultContent: \u60A8\u597D\uFF0C\u6709\u4EC0\u4E48\u95EE\u9898\uFF1F
redisConfig:
host: 47.109.92.244 # 地址
port: 6399 # 端口
database: 16 # 数据库索引
password: cyywl123.. # 密码,建议生产环境开启
# 公众号配置(必填)
app-id: wx041349c6f39b268b
secret: 5abee519483bc9f8cb37ce280e814bd0
app-id: wx7e503d9cded34c07
secret: 31883ca14e2cbac8610d30f8f945ee47
# 存储配置,解决 AccessToken 的跨节点的共享
config-storage:
type: RedisTemplate # 采用 RedisTemplate 操作 Redis会自动从 Spring 中获取
@ -161,14 +168,14 @@ wx: # 参见 https://github.com/Wechat-Group/WxJava/blob/develop/spring-boot-sta
pay:
one:
enabled: true
app-id: wxb1826c88da21d81e
mch-id: 1641993417
app-id: wx7e503d9cded34c07
mch-id: 1641073271
mch-key: qdn2I7Cmx4JeiKOt2CDjiu6UHgLTsOsM
apiv3-key: cyywl666666cyywl888888cyywl66666
apiv3-key: cyywl123456cyywl654321cyywl12345
private-cert-path: classpath:/1/apiclient_cert.pem
private-key-path: classpath:/1/apiclient_key.pem
key-path: classpath:/1/apiclient_cert.p12
cert-serial-no: 58FDB503F92B6C0E258C9940BB726C2BF6022E56
cert-serial-no: 7F76A4ADC52CA0B440C4E5698F8A5CD1633A0FCD
notify-url: http://api.cyywl.top/app-api/pay/wxpay/pay_notify
refund-notify-url: http://api.cyywl.top/app-api/pay/wxpay/refund_notify
two:

View File

@ -196,6 +196,7 @@ yudao:
- rep_demo_jianpiao
- tmp_report_data_1
- tmp_report_data_income
- eb_category
- eb_shipping_templates
- eb_shipping_templates_free
- eb_shipping_templates_no_delivery
@ -221,7 +222,7 @@ yudao:
- eb_store_order_status
sms-code: # 短信验证码相关的配置项
expire-times: 5m
send-frequency: 10m
send-frequency: 10s
send-maximum-quantity-per-day: 10
begin-code: 100000 # 这里配置 9999 的原因是,测试方便。
end-code: 999999 # 这里配置 9999 的原因是,测试方便。

View File

@ -5,8 +5,8 @@ ENV = 'development'
VUE_APP_TITLE = 创盈商户管理系统
# 芋道管理系统/开发环境
#VUE_APP_BASE_API = 'https://cmx.bskies.cc:8000/cyywl-api'
VUE_APP_BASE_API = 'http://192.168.1.147:48080'
VUE_APP_BASE_API = 'https://cmx.bskies.cc:8000/cyywl-api'
#VUE_APP_BASE_API = 'http://192.168.1.147:48080'
# 路由懒加载
VUE_CLI_BABEL_TRANSPILE_MODULES = true

View File

@ -5,13 +5,13 @@ ENV = 'production'
VUE_APP_TITLE = 创盈商户管理系统
# 创盈管理系统/生产环境
VUE_APP_BASE_API = 'https://cmx.bskies.cc:8000/cyywl-api'
VUE_APP_BASE_API = 'http://api.cyywl.top'
#VUE_APP_BASE_API = 'http://192.168.2.71'
# 根据服务器或域名修改
PUBLIC_PATH = 'https://cmx.bskies.cc:8000/cy-admin/'
PUBLIC_PATH = 'http://admin.cyywl.top'
# 二级部署路径
VUE_APP_APP_NAME ='/cy-admin/'
VUE_APP_APP_NAME =''
# 多租户的开关
VUE_APP_TENANT_ENABLE = true

View File

@ -1,5 +1,15 @@
module.exports = {
/**
* 推广链接域名
*/
spreadDomain: 'http://h5.cyywl.top',
/**
* 推广码生成访问H5链接地址
*/
spreadLink: '/pages/member_application/index',
/**
* 侧边栏主题 深色主题theme-dark浅色主题theme-light
*/

View File

@ -204,6 +204,7 @@ import {
getTenantPage,
exportTenantExcel
} from '@/api/system/tenant';
import config from '@/settings'
import QRCode from 'qrcode'
import {CommonStatusEnum} from '@/utils/constants'
import {getTenantPackageList} from '@/api/system/tenantPackage';
@ -345,8 +346,7 @@ export default {
this.resetForm('form');
},
handleQRCode(row) {
const baseUrl = 'http://yuxy.perrymake.com'
const url =`${baseUrl}/pages/member_application/index?redirectUrl=${baseUrl}&tenantId=${row.id}`
const url =`${config.spreadDomain}${config.spreadLink}?redirectUrl=${config.spreadDomain}&tenantId=${row.id}`
QRCode.toCanvas(document.getElementById(`id-${row.id}`), url, {
scale: 2
}, function (error) {

View File

@ -1,14 +1,14 @@
<template>
<view class="time" :style="justifyLeft">
<text class="" v-if="tipText">{{ tipText }}</text>
<text class="styleAll p6" v-if="isDay === true" :style="{background:bgColor.bgColor,color:bgColor.Color}">{{ day }}{{bgColor.isDay?'':''}}</text>
<text class="timeTxt" v-if="dayText" :style="{width:bgColor.timeTxtwidth,color:bgColor.bgColor}">{{ dayText }}</text>
<text class="styleAll" :class='isCol?"timeCol":""' :style="{background:bgColor.bgColor,color:bgColor.Color,width:bgColor.width}">{{ hour }}</text>
<text class="timeTxt" v-if="hourText" :class='isCol?"whit":""' :style="{width:bgColor.timeTxtwidth,color:bgColor.bgColor}">{{ hourText }}</text>
<text class="styleAll" :class='isCol?"timeCol":""' :style="{background:bgColor.bgColor,color:bgColor.Color,width:bgColor.width}">{{ minute }}</text>
<text class="timeTxt" v-if="minuteText" :class='isCol?"whit":""' :style="{width:bgColor.timeTxtwidth,color:bgColor.bgColor}">{{ minuteText }}</text>
<text class="styleAll" :class='isCol?"timeCol":""' :style="{background:bgColor.bgColor,color:bgColor.Color,width:bgColor.width}">{{ second }}</text>
<text class="timeTxt" v-if="secondText">{{ secondText }}</text>
<text class="red" v-if="tipText">{{ tipText }}</text>
<text class="styleAll" :style="'background-color:'+ bgColor +';color:'+ colors +';'" v-if="isDay === true">{{ day }}</text>
<text class="timeTxt red" v-if="dayText">{{ dayText }}</text>
<text class="styleAll" :style="'background-color:'+ bgColor +';color:'+ colors +';'">{{ hour }}</text>
<text class="timeTxt red" v-if="hourText">{{ hourText }}</text>
<text class="styleAll" :style="'background-color:'+ bgColor +';color:'+ colors +';'">{{ minute }}</text>
<text class="timeTxt red" v-if="minuteText">{{ minuteText }}</text>
<text class="styleAll" :style="'background-color:'+ bgColor +';color:'+ colors +';'">{{ second }}</text>
<text class="timeTxt red" v-if="secondText">{{ secondText }}</text>
</view>
</template>
@ -49,13 +49,13 @@
type: Boolean,
default: true
},
isCol: {
type: Boolean,
default: false
bgColor:{
type: String,
default: ""
},
bgColor: {
type: Object,
default: null
colors:{
type: String,
default: ""
}
},
data: function() {
@ -116,47 +116,13 @@
};
</script>
<style scoped>
.p6{
padding: 0 8rpx;
}
.styleAll{
/* color: #fff; */
font-size: 24rpx;
height: 36rpx;
line-height: 36rpx;
border-radius: 6rpx;
text-align: center;
/* padding: 0 6rpx; */
}
.timeTxt{
text-align: center;
/* width: 16rpx; */
height: 36rpx;
line-height: 36rpx;
display: inline-block;
}
.whit{
color: #fff !important;
}
.time {
<style>
.time{
display: flex;
justify-content: center;
}
.red {
color: #fc4141;
}
.red{
color: var(--view-theme);
margin: 0 4rpx;
}
.timeCol {
/* width: 40rpx;
height: 40rpx;
line-height: 40rpx;
text-align:center;
border-radius: 6px;
background: #fff;
font-size: 24rpx; */
color: #E93323;
}
</style>

View File

@ -0,0 +1,160 @@
<template>
<view class="number-box">
<block v-for="(myIndex, index) in indexArr" :key="index">
<swiper class="swiper" vertical="true" :current="myIndex" circular="true"
v-bind:style="{color:color,width:myIndex == 10 ? '14rpx' : myIndex == 1 ? '22rpx' : width+'rpx',height:height+'rpx',lineHeight:fontSize+'rpx',fontSize:fontSize+'rpx',fontWeight: fontWeight}">
<swiper-item>
<view class="swiper-item">0</view>
</swiper-item>
<swiper-item>
<view class="swiper-item">1</view>
</swiper-item>
<swiper-item>
<view class="swiper-item">2</view>
</swiper-item>
<swiper-item>
<view class="swiper-item">3</view>
</swiper-item>
<swiper-item>
<view class="swiper-item">4</view>
</swiper-item>
<swiper-item>
<view class="swiper-item">5</view>
</swiper-item>
<swiper-item>
<view class="swiper-item">6</view>
</swiper-item>
<swiper-item>
<view class="swiper-item">7</view>
</swiper-item>
<swiper-item>
<view class="swiper-item">8</view>
</swiper-item>
<swiper-item>
<view class="swiper-item">9</view>
</swiper-item>
<swiper-item>
<view class="swiper-item">.</view>
</swiper-item>
</swiper>
</block>
</view>
</template>
<script>
export default {
props: {
num: [String, Number],
color: {
type: String,
default: '#000000'
},
width: {
type: String,
default: '30'
},
height: {
type: String,
default: '30'
},
fontSize: {
type: String,
default: '30'
},
fontWeight: {
type: [String, Number],
default: 500
}
},
data() {
return {
indexArr: []
};
},
created() {
let {
num
} = this;
let arr = new Array(num.toString().length);
arr.fill(0);
this.indexArr = arr;
},
watch: {
num: function(val, oldVal) {
//
let arr = Array.prototype.slice.apply(this.indexArr);
let newLen = val.toString().length;
let oldLen = oldVal.toString().length;
if (newLen > oldLen) {
for (let i = 0; i < newLen - oldLen; i++) {
arr.push(0);
}
this.indexArr = arr;
}
if (newLen < oldLen) {
for (let i = 0; i < oldLen - newLen; i++) {
arr.pop();
}
this.indexArr = arr;
}
this.numChange(val);
}
},
mounted() {
//app
this._time = setTimeout(() => {
this.numChange(this.num);
clearTimeout(this._time);
}, 50);
},
methods: {
/**
* 数字改变
* @value 数字
*/
numChange(num) {
this.$nextTick(() => {
let {
indexArr
} = this;
let copyIndexArr = Array.prototype.slice.apply(indexArr);
let _num = num.toString();
for (let i = 0; i < _num.length; i++) {
if (_num[i] === '.') {
copyIndexArr[i] = 10;
} else {
copyIndexArr[i] = Number(_num[i]);
}
}
this.indexArr = copyIndexArr;
})
}
}
};
</script>
<style lang="scss">
.number-box {
display: flex;
flex-wrap: wrap;
justify-content: center;
}
.swiper {
position: relative;
// line-height: 30upx;
// width: 30upx;
// height: 30upx;
// font-size: 30upx;
// background: red;
}
.swiper:after {
content: '';
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
}
</style>

View File

@ -22,7 +22,8 @@
<view class="mask" @click='close' v-if="pay_close"></view>
<!-- 支付宝支付界面 -->
<u-modal :show="alipayShow" title="支付宝支付" @confirm="handleConfirm">
<view class="slot-content">
<button style="display:none;" class="btn" data-clipboard-text="Just because you can doesn't mean you should clipboard.js"></button>
<view class="slot-content">
<rich-text :nodes="alipayForm"></rich-text>
</view>
</u-modal>
@ -65,35 +66,35 @@
data() {
return {
alipayShow: false,
alipayForm:`链接已复制,请到外部浏览器完成支付`
alipayForm: `链接已复制,请到外部浏览器完成支付`
};
},
computed: mapGetters(['systemPlatform', 'openId']),
methods: {
handleConfirm(){
handleConfirm() {
this.alipayShow = false
window.location.reload()
},
//
_copy(context) {
//
let oInput = document.createElement('input');
//
oInput.value = context;
//
document.body.appendChild(oInput);
//
oInput.select();
//
document.execCommand('Copy');
//
this.$util.Tips({
title: '复制链接成功'
})
this.alipayShow = true
//
oInput.remove();
},
_copy(context) {
//
let oInput = document.createElement('input');
//
oInput.value = context;
//
document.body.appendChild(oInput);
//
oInput.select();
//
document.execCommand('Copy');
//
this.$util.Tips({
title: '复制链接成功'
})
this.alipayShow = true
//
oInput.remove();
},
close: function() {
this.$emit('onChangeFun', {
action: 'payClose'
@ -139,7 +140,7 @@
title: '支付中',
mask: true
});
if(paytype === 'WXPAY' && !that.openId) {
if (paytype === 'WXPAY' && !that.openId) {
return that.$util.Tips({
title: '请在微信客户端进行支付操作'
});

View File

@ -1,12 +1,12 @@
let domain = 'http://yuxy.perrymake.com'
let domain = 'http://api.cyywl.top'
module.exports = {
// 请求域名 格式: https://您的域名
// #ifdef MP
HTTP_REQUEST_URL: domain,
// #endif
HTTP_ADMIN_URL:'http://yuxy.perrymake.com', //PC后台的API请求地址上传图片用
HTTP_ADMIN_URL:'http://api.cyywl.top', //PC后台的API请求地址上传图片用
// #ifdef H5
//H5接口是浏览器地址
// HTTP_REQUEST_URL: window.location.protocol+"//"+window.location.host,
@ -25,5 +25,9 @@ module.exports = {
// 缓存时间 0 永久
EXPIRE:0,
//分页最多显示条数
LIMIT: 10
LIMIT: 10,
// 推广链接域名
SPREAD_DOMAIN: 'http://h5.cyywl.top',
// 推广码生成访问H5链接地址
SPREAD_LINK: '/pages/member_application/index',
};

View File

@ -46,6 +46,12 @@
"navigationBarTitleText": "购物车"
}
},
{
"path": "pages/goods_cashier/index",
"style": {
"navigationBarTitleText": "收银台"
}
},
{
"path": "pages/user/index",
"style": {

View File

@ -0,0 +1,752 @@
<template>
<view class="page" v-if="payPriceShow">
<view class="pay-price">
<view class="price">
<text class="unit"></text>
<numberScroll :num='payPriceShow' color="#E93323" width='30' height='50' fontSize='50'></numberScroll>
</view>
<view class="count-down">
支付剩余时间
<countDown :is-day="false" :tip-text="' '" :day-text="' '" :hour-text="' : '" :minute-text="' : '"
:second-text="' '" :datatime="invalidTime"></countDown>
</view>
</view>
<view class="payment">
<view class="title">
请选择支付方式
</view>
<view class="item acea-row row-between-wrapper" v-for="(item,index) in cartArr" :key="index"
v-show='item.payStatus' @click="payType(item.number || 0, item.value, index)">
<view class="left acea-row row-between-wrapper">
<view class="iconfont" :class="item.icon"></view>
<view class="text">
<view class="name">{{item.name}}</view>
<view class="info" v-if="item.value == 'yue'">
{{item.title}} <span class="money">{{ item.number }}</span>
</view>
<view class="info" v-else>{{item.title}}</view>
</view>
</view>
<view class="iconfont" :class="active==index?'icon-xuanzhong11 font-num':'icon-weixuan'"></view>
</view>
</view>
<view class="btn">
<view class="button acea-row row-center-wrapper" @click='goPay(number, paytype)'>确认支付</view>
<view class="wait-pay" @click="waitPay"></view>
</view>
<view v-show="false" v-html="formContent"></view>
</view>
</view>
</template>
<script>
import countDown from '@/components/countDown';
import numberScroll from '@/components/numberScroll.vue'
import {
getCashierOrder,
orderPay
} from '@/api/order.js';
export default {
components: {
countDown,
numberScroll
},
data() {
return {
checked: false,
datatime: 1676344056,
//
cartArr: [{
"name": '微信支付',
"icon": "icon-weixin2",
value: 'weixin',
title: '使用微信快捷支付',
payStatus: 1,
},
{
"name": '支付宝支付',
"icon": "icon-zhifubao",
value: 'alipay',
title: '使用支付宝支付',
payStatus: 1,
}
],
orderId: 0,
fromType: '',
active: 0,
payPrice: 10,
payPriceShow: 10,
payPostage: 0,
offlinePostage: false,
invalidTime: 1684748596,
initIn: false,
jumpData: {
orderId: '',
msg: ''
},
formContent: ''
}
},
watch: {
cartArr: {
handler(newV, oldValue) {
let newPayList = [];
newV.forEach((item, index) => {
if (item.payStatus) {
item.index = index;
newPayList.push(item)
}
});
this.active = newPayList[0].index;
this.paytype = newPayList[0].value;
this.number = newPayList[0].number || 0;
},
immediate: true,
deep: true
}
},
onLoad(options) {
if (options.order_id) this.orderId = options.order_id
if (options.from_type) this.fromType = options.from_type
// this.getCashierOrder()
},
onShow() {
let options = wx.getEnterOptionsSync();
console.log(options)
if (options.scene == '1038' && options.referrerInfo.appId == 'wxef277996acc166c3' && this.initIn) {
//
let extraData = options.referrerInfo.extraData;
this.initIn = false
if (!extraData) {
// "";
this.$util.Tips({
title: `取消支付`
}, {
tab: 5,
url: `/pages/goods/order_pay_status/index?order_id=${this.orderId}&msg=取消支付&type=3&totalPrice=${this.payPriceShow}&status=2`
});
} else {
if (extraData.code == 'success') {
this.$util.Tips({
title: `支付成功`,
icon: 'success'
}, {
tab: 5,
url: `/pages/goods/order_pay_status/index?order_id=${this.orderId}&msg=${this.jumpData.msg}&type=3&totalPrice=${this.payPriceShow}`
});
} else if (extraData.code == 'cancel') {
// "";
this.$util.Tips({
title: `取消支付`
}, {
tab: 5,
url: `/pages/goods/order_pay_status/index?order_id=${this.orderId}&msg=取消支付&type=3&totalPrice=${this.payPriceShow}&status=2`
});
} else {
// "" + extraData.errmsg;
uni.reLaunch({
url: `/pages/goods/order_pay_status/index?order_id=${this.orderId}&msg=支付失败&totalPrice=${this.payPriceShow}`
})
}
}
}
},
methods: {
getCashierOrder() {
uni.showLoading({
title: '创建订单中'
});
getCashierOrder(this.orderId, this.fromType).then(res => {
console.log(res)
this.payPrice = this.payPriceShow = res.data.pay_price
this.payPostage = res.data.pay_postage
this.offlinePostage = res.data.offline_postage
this.invalidTime = res.data.invalid_time
//
this.cartArr[0].payStatus = res.data.wechat_pay_status || 0
//
this.cartArr[1].payStatus = res.data.ali_pay_status || 0;
//#ifdef MP
this.cartArr[1].payStatus = false;
//#endif
//
// that.cartArr[2].title = ':' + res.data.userInfo.now_money;
this.cartArr[2].number = res.data.now_money;
this.cartArr[2].payStatus = res.data.yue_pay_status
if (res.data.offline_pay_status) {
this.cartArr[3].payStatus = 1
} else {
this.cartArr[3].payStatus = 0
}
//
this.cartArr[4].payStatus = res.data.friend_pay_status || 0;
uni.hideLoading();
}).catch(err => {
uni.hideLoading();
return this.$util.Tips({
title: err
})
})
},
payType(number, paytype, index) {
this.active = index;
this.paytype = paytype;
this.number = number;
if (this.offlinePostage) {
if (paytype == 'offline') {
this.payPriceShow = this.$util.$h.Sub(this.payPrice, this.payPostage);
} else {
this.payPriceShow = this.payPrice;
}
}
},
formpost(url, postData) {
let tempform = document.createElement("form");
tempform.action = url;
tempform.method = "post";
tempform.target = "_self";
tempform.style.display = "none";
for (let x in postData) {
let opt = document.createElement("input");
opt.name = x;
opt.value = postData[x];
tempform.appendChild(opt);
}
document.body.appendChild(tempform);
this.$nextTick(e => {
tempform.submit();
})
},
waitPay() {
uni.reLaunch({
url: '/pages/goods/order_pay_status/index?order_id=' + this.orderId + '&msg=取消支付&type=3' +
'&status=2&totalPrice=' + this.payPriceShow
})
},
goPay(number, paytype) {
let that = this;
if (!that.orderId) return that.$util.Tips({
title: '请选择要支付的订单'
});
if (paytype == 'yue' && parseFloat(number) < parseFloat(that.payPriceShow)) return that.$util.Tips({
title: `余额不足`
});
uni.showLoading({
title: `支付中`
});
if (paytype == 'friend' && that.orderId) {
uni.hideLoading();
return uni.navigateTo({
url: '/pages/users/payment_on_behalf/index?order_id=' + that.orderId + '&spread=' +
this.$store.state.app.uid,
success: res => {},
fail: () => {},
complete: () => {}
});
}
orderPay({
uni: that.orderId,
paytype: paytype,
type: that.friendPay ? 1 : 0,
// #ifdef H5
quitUrl: location.port ? location.protocol + '//' + location.hostname + ':' + location
.port +
'/pages/goods/order_details/index?order_id=' + this.orderId : location.protocol +
'//' + location.hostname +
'/pages/goods/order_details/index?order_id=' + this.orderId
// #endif
// #ifdef APP-PLUS
quitUrl: '/pages/goods/order_details/index?order_id=' + this.orderId
// #endif
}).then(res => {
let status = res.data.status,
orderId = res.data.result.orderId,
jsConfig = res.data.result.jsConfig,
goPages = '/pages/goods/order_pay_status/index?order_id=' + this.orderId + '&msg=' +
res
.msg +
'&type=3' + '&totalPrice=' + this.payPriceShow,
friendPay = '/pages/users/payment_on_behalf/index?order_id=' + this.orderId +
'&spread=' +
this
.$store.state.app.uid
switch (status) {
case 'ORDER_EXIST':
case 'EXTEND_ORDER':
uni.hideLoading();
return that.$util.Tips({
title: res.msg
}, {
tab: 5,
url: goPages
});
case 'ALLINPAY_PAY':
uni.hideLoading();
// #ifdef MP
this.initIn = true
wx.openEmbeddedMiniProgram({
appId: 'wxef277996acc166c3',
extraData: {
cusid: jsConfig.cusid,
appid: jsConfig.appid,
version: jsConfig.version,
trxamt: jsConfig.trxamt,
reqsn: jsConfig.reqsn,
notify_url: jsConfig.notify_url,
body: jsConfig.body,
remark: jsConfig.remark,
validtime: jsConfig.validtime,
randomstr: jsConfig.randomstr,
paytype: jsConfig.paytype,
sign: jsConfig.sign,
signtype: jsConfig.signtype
}
})
this.jumpData = {
orderId: res.data.result.orderId,
msg: res.msg,
}
// #endif
// #ifdef APP-PLUS
plus.runtime.openURL(jsConfig.payinfo);
setTimeout(e => {
uni.reLaunch({
url: goPages
})
}, 1000)
// #endif
// #ifdef H5
this.formpost(res.data.result.pay_url, jsConfig)
// #endif
break;
case 'PAY_ERROR':
uni.hideLoading();
return that.$util.Tips({
title: res.msg
}, {
tab: 5,
url: goPages
});
break;
case 'SUCCESS':
uni.hideLoading();
if (paytype !== 'friend') {
return that.$util.Tips({
title: res.msg,
icon: 'success'
}, {
tab: 4,
url: goPages
});
} else {
return that.$util.Tips({
title: res.msg,
icon: 'success'
}, {
tab: 4,
url: friendPay
});
}
break;
case 'WECHAT_PAY':
that.toPay = true;
// #ifdef MP
/* that.toPay = true; */
let mp_pay_name = ''
if (uni.requestOrderPayment) {
mp_pay_name = 'requestOrderPayment'
} else {
mp_pay_name = 'requestPayment'
}
uni[mp_pay_name]({
timeStamp: jsConfig.timestamp,
nonceStr: jsConfig.nonceStr,
package: jsConfig.package,
signType: jsConfig.signType,
paySign: jsConfig.paySign,
success: function(res) {
uni.hideLoading();
if (that.BargainId || that.combinationId || that.pinkId ||
that
.seckillId || that.discountId)
return that.$util.Tips({
title: `支付成功`,
icon: 'success'
}, {
tab: 4,
url: goPages
});
return that.$util.Tips({
title: `支付成功`,
icon: 'success'
}, {
tab: 5,
url: goPages
});
},
fail: function(e) {
uni.hideLoading();
return that.$util.Tips({
title: `取消支付`
}, {
tab: 5,
url: goPages + '&status=2'
});
},
complete: function(e) {
uni.hideLoading();
//
if (res.errMsg == 'requestPayment:cancel' || e.errMsg ==
'requestOrderPayment:cancel') return that.$util
.Tips({
title: `取消支付`
}, {
tab: 5,
url: goPages + '&status=2'
});
},
})
// #endif
// #ifdef H5
this.$wechat.pay(res.data.result.jsConfig).then(res => {
return that.$util.Tips({
title: `支付成功`,
icon: 'success'
}, {
tab: 5,
url: goPages
});
}).catch(res => {
if (!this.$wechat.isWeixin()) {
uni.redirectTo({
url: goPages + '&msg=' + `支付失败` +
'&status=2'
// '&msg=&status=2'
})
}
if (res.errMsg == 'chooseWXPay:cancel') return that.$util.Tips({
title: `取消支付`
}, {
tab: 5,
url: goPages + '&status=2'
});
})
// #endif
// #ifdef APP-PLUS
uni.requestPayment({
provider: 'wxpay',
orderInfo: jsConfig,
success: (e) => {
let url = goPages;
uni.showToast({
title: `支付成功`
})
setTimeout(res => {
uni.redirectTo({
url: url
})
}, 2000)
},
fail: (e) => {
let url = '/pages/goods/order_pay_status/index?order_id=' +
orderId +
'&msg=' + `支付失败`;
uni.showModal({
content: `支付失败`,
showCancel: false,
success: function(res) {
if (res.confirm) {
uni.redirectTo({
url: url
})
} else if (res.cancel) {}
}
})
},
complete: () => {
uni.hideLoading();
},
});
// #endif
break;
case 'PAY_DEFICIENCY':
uni.hideLoading();
//
return that.$util.Tips({
title: res.msg
}, {
tab: 5,
url: goPages + '&status=1'
});
break;
case "WECHAT_H5_PAY":
uni.hideLoading();
that.$util.Tips({
title: `等待支付中`
}, {
tab: 4,
url: goPages + '&status=0'
});
setTimeout(() => {
location.href = res.data.result.jsConfig.h5_url;
}, 1500);
break;
case 'ALIPAY_PAY':
//#ifdef H5
uni.hideLoading();
that.$util.Tips({
title: `等待支付中`
}, {
tab: 4,
url: goPages + '&status=0'
});
that.formContent = res.data.result.jsConfig;
setTimeout(() => {
document.getElementById('alipaysubmit').submit();
}, 1500);
//#endif
// #ifdef MP
uni.navigateTo({
url: `/pages/users/alipay_invoke/index?id=${orderId}&link=${jsConfig.qrCode}`
});
// #endif
// #ifdef APP-PLUS
uni.requestPayment({
provider: 'alipay',
orderInfo: jsConfig,
success: (e) => {
uni.showToast({
title: `支付成功`
})
let url = '/pages/goods/order_pay_status/index?order_id=' +
orderId +
'&msg=' + `支付成功`;
setTimeout(res => {
uni.redirectTo({
url: url
})
}, 2000)
},
fail: (e) => {
let url = '/pages/goods/order_pay_status/index?order_id=' +
orderId +
'&msg=' + `支付失败`;
uni.showModal({
content: `支付失败`,
showCancel: false,
success: function(res) {
if (res.confirm) {
uni.redirectTo({
url: url
})
} else if (res.cancel) {}
}
})
},
complete: () => {
uni.hideLoading();
},
});
// #endif
break;
}
}).catch(err => {
uni.hideLoading();
return that.$util.Tips({
title: err
}, () => {
that.$emit('onChangeFun', {
action: 'pay_fail'
});
});
})
}
}
}
</script>
<style lang="scss" scoped>
.page {
.pay-price {
display: flex;
justify-content: center;
flex-direction: column;
align-items: center;
padding: 50rpx 0 40rpx 0;
.price {
color: #E93323;
margin-bottom: 20rpx;
display: flex;
align-items: flex-end;
.unit {
font-size: 34rpx;
font-weight: 500;
line-height: 41rpx;
}
.num {
font-size: 50rpx;
font-weight: 600;
}
}
.count-down {
display: flex;
align-items: center;
background-color: #fff;
padding: 8rpx 28rpx;
border-radius: 40rpx;
font-size: 24rpx;
color: #E93323;
.time {
margin-top: 0 !important;
}
/deep/.red {
margin: 0 !important;
}
}
}
.payment {
width: 690rpx;
border-radius: 14rpx 14rpx;
background-color: #fff;
z-index: 999;
margin: 0 30rpx;
.title {
color: #666666;
font-size: 26rpx;
padding: 30rpx 0 0 30rpx;
}
.payMoney {
font-size: 28rpx;
color: #333333;
text-align: center;
margin-top: 50rpx;
.font-color {
margin-left: 10rpx;
.money {
font-size: 40rpx;
}
}
}
}
.payment.on {
transform: translate3d(0, 0, 0);
}
.icon-xuanzhong11 {
color: #E93323 !important;
}
.payment .item {
border-bottom: 1rpx solid #eee;
height: 130rpx;
margin-left: 30rpx;
padding-right: 30rpx;
}
.payment .item:last-child {
border-bottom: none;
}
.payment .item .left {
flex: 1;
}
.payment .item .left .text {
flex: 1;
}
.payment .item .left .text .name {
font-size: 30rpx;
color: #333;
}
.payment .item .left .text .info {
font-size: 22rpx;
color: #999;
}
.payment .item .left .text .info .money {
color: #ff9900;
}
.payment .item .left .iconfont {
font-size: 50rpx;
color: #09bb07;
margin-right: 28rpx;
}
.payment .item .left .iconfont.icon-zhifubao {
color: #00aaea;
}
.payment .item .left .iconfont.icon-yuezhifu {
color: #ff9900;
}
.payment .item .left .iconfont.icon-yuezhifu1 {
color: #eb6623;
}
.payment .item .left .iconfont.icon-tonglianzhifu1 {
color: #305fd8;
}
.payment .item .iconfont {
font-size: 40rpx;
color: #ccc;
}
.icon-haoyoudaizhifu {
color: #F34C3E !important;
}
.btn {
position: fixed;
left: 30rpx;
display: flex;
flex-direction: column;
align-items: center;
bottom: 30rpx;
bottom: calc(30rpx + constant(safe-area-inset-bottom)); /// IOS<11.2/
bottom: calc(30rpx + env(safe-area-inset-bottom)); /// IOS>11.2/
}
.wait-pay {
color: #aaa;
font-size: 24rpx;
padding-top: 20rpx;
}
.button {
width: 690rpx;
height: 90rpx;
border-radius: 45rpx;
color: #FFFFFF;
background-color: #E93323;
}
}
</style>

View File

@ -379,7 +379,7 @@
background-size:100% 672rpx;
.logo-wrap {
margin: 285rpx 0 85rpx 0;
margin: 185rpx 0 85rpx 0;
display:flex;
align-items:center;
img{
@ -478,7 +478,7 @@
justify-content: center;
width: 100%;
height: 87rpx;
margin-top: 237rpx;
margin-top: 137rpx;
color: #FFFFFF;
font-size: 32rpx;
background: linear-gradient(0deg, #E63163 0%, #FF819F 100%);
@ -486,7 +486,7 @@
}
.tips {
margin: 125rpx 20rpx 0 20rpx;
margin: 60rpx 20rpx 0 20rpx;
font-size: 24rpx;
color: #000;
display: flex;

View File

@ -206,7 +206,7 @@
background-size:100% 672rpx;
.logo-wrap {
margin: 285rpx 0 85rpx 0;
margin: 185rpx 0 85rpx 0;
display:flex;
align-items:center;
img{

View File

@ -154,7 +154,7 @@
background-size: 100% 672rpx;
.logo-wrap {
margin: 285rpx 0 85rpx 0;
margin: 185rpx 0 85rpx 0;
display:flex;
align-items:center;
img{

View File

@ -58,6 +58,7 @@
import {
imageBase64
} from "@/api/public";
import appConfig from '@/config/app.js'
export default {
components: {
// #ifdef MP
@ -203,9 +204,7 @@
let that = this;
let href = '';
// href = window.location.href.split('/pages')[0];
console.log('uid', that.uid)
const baseUrl = 'http://yuxy.perrymake.com';
const url =`${baseUrl}/pages/member_application/index?redirectUrl=${baseUrl}&tenantId=${that.tenantId}&spreadId=${that.uid}`
const url =`${appConfig.SPREAD_DOMAIN}${appConfig.SPREAD_LINK}?redirectUrl=${appConfig.SPREAD_DOMAIN}&tenantId=${that.tenantId}&spreadId=${that.uid}`
console.log('url', url)
uQRCode.make({
canvasId: 'qrcode',