mirror of
http://git.coreshop.cn/jianweie/coreshoppro.git
synced 2025-12-06 19:03:27 +08:00
# 2022-02-19
### 1.3.7 开源社区版: 无 ### 0.2.0 会员专业版: 【调整】拆分下单支付单类型,由【订单,充值,服务订单,表单付款码,表单订单】拆分细则为【普通订单,拼团订单,团购订单,秒杀订单,砍价,赠品,接龙,交易组件,充值,服务订单,表单付款码,表单订单】。 【修复】修复拼团,秒杀,团购下单成功但提示“订单支付参数错误”问题。 【新增】商品详情封面图增加【原图上传】,前【上传图片】按钮改为【裁剪上传】。 【新增】商品详情图集增加【原图上传】,前【上传图片】按钮改为【裁剪上传】。
This commit is contained in:
@@ -964,31 +964,70 @@ namespace CoreCms.Net.Configuration
|
||||
/// </summary>
|
||||
public enum BillPaymentsType
|
||||
{
|
||||
/// <summary>
|
||||
/// 订单
|
||||
/// </summary>
|
||||
[Description("订单")]
|
||||
Order = 1,
|
||||
/// <summary>
|
||||
/// 充值
|
||||
/// </summary>
|
||||
[Description("充值")]
|
||||
Recharge = 2,
|
||||
Recharge = 201,
|
||||
/// <summary>
|
||||
/// 表单订单
|
||||
/// </summary>
|
||||
[Description("表单订单")]
|
||||
FormOrder = 3,
|
||||
FormOrder = 302,
|
||||
/// <summary>
|
||||
/// 表单付款码
|
||||
/// </summary>
|
||||
[Description("表单付款码")]
|
||||
FormPay = 4,
|
||||
FormPay = 301,
|
||||
/// <summary>
|
||||
/// 服务订单
|
||||
/// </summary>
|
||||
[Description("服务订单")]
|
||||
ServiceOrder = 5,
|
||||
ServiceOrder = 501,
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 普通
|
||||
/// </summary>
|
||||
[Description("普通")]
|
||||
Common = 1,
|
||||
/// <summary>
|
||||
/// 拼团
|
||||
/// </summary>
|
||||
[Description("拼团")]
|
||||
PinTuan = 2,
|
||||
/// <summary>
|
||||
/// 团购
|
||||
/// </summary>
|
||||
[Description("团购")]
|
||||
Group = 3,
|
||||
/// <summary>
|
||||
/// 秒杀
|
||||
/// </summary>
|
||||
[Description("秒杀")]
|
||||
Skill = 4,
|
||||
/// <summary>
|
||||
/// 砍价
|
||||
/// </summary>
|
||||
[Description("砍价")]
|
||||
Bargain = 6,
|
||||
/// <summary>
|
||||
/// 赠品
|
||||
/// </summary>
|
||||
[Description("赠品")]
|
||||
Giveaway = 7,
|
||||
/// <summary>
|
||||
/// 接龙
|
||||
/// </summary>
|
||||
[Description("接龙")]
|
||||
Solitaire = 8,
|
||||
/// <summary>
|
||||
/// 微信交易组件
|
||||
/// </summary>
|
||||
[Description("微信交易组件")]
|
||||
TransactionComponent = 10,
|
||||
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// 付款单状态【对应CoreCmsBillPayments.status字段】
|
||||
@@ -2841,6 +2880,5 @@ namespace CoreCms.Net.Configuration
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,11 +14,13 @@ using System.Linq;
|
||||
using System.Linq.Expressions;
|
||||
using System.Threading.Tasks;
|
||||
using CoreCms.Net.Configuration;
|
||||
|
||||
using CoreCms.Net.IRepository;
|
||||
using CoreCms.Net.IRepository.UnitOfWork;
|
||||
using CoreCms.Net.Model.Entities;
|
||||
using CoreCms.Net.Model.ViewModels.Basics;
|
||||
using CoreCms.Net.Model.ViewModels.UI;
|
||||
|
||||
using SqlSugar;
|
||||
|
||||
namespace CoreCms.Net.Repository
|
||||
@@ -35,6 +37,7 @@ namespace CoreCms.Net.Repository
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 支付单7天统计
|
||||
/// </summary>
|
||||
@@ -43,8 +46,10 @@ namespace CoreCms.Net.Repository
|
||||
{
|
||||
var dt = DateTime.Now.AddDays(-8);
|
||||
|
||||
var types = new int[] { (int)GlobalEnumVars.BillPaymentsType.Common, (int)GlobalEnumVars.BillPaymentsType.PinTuan, (int)GlobalEnumVars.BillPaymentsType.Group, (int)GlobalEnumVars.BillPaymentsType.Skill, (int)GlobalEnumVars.BillPaymentsType.Bargain, (int)GlobalEnumVars.BillPaymentsType.Giveaway, (int)GlobalEnumVars.BillPaymentsType.Solitaire, (int)GlobalEnumVars.BillPaymentsType.TransactionComponent };
|
||||
|
||||
var list = await DbClient.Queryable<CoreCmsBillPayments>()
|
||||
.Where(p => p.createTime >= dt && p.status == (int)GlobalEnumVars.BillPaymentsStatus.Payed && p.type == (int)GlobalEnumVars.BillPaymentsType.Order)
|
||||
.Where(p => p.createTime >= dt && p.status == (int)GlobalEnumVars.BillPaymentsStatus.Payed && types.Contains(p.type))
|
||||
.Select(it => new
|
||||
{
|
||||
it.paymentId,
|
||||
|
||||
@@ -116,7 +116,15 @@ namespace CoreCms.Net.Services
|
||||
var dto = new CheckPayDTO();
|
||||
|
||||
//订单
|
||||
if (type == (int)GlobalEnumVars.BillPaymentsType.Order)
|
||||
if (type == (int)GlobalEnumVars.BillPaymentsType.Common
|
||||
|| type == (int)GlobalEnumVars.BillPaymentsType.PinTuan
|
||||
|| type == (int)GlobalEnumVars.BillPaymentsType.Group
|
||||
|| type == (int)GlobalEnumVars.BillPaymentsType.Skill
|
||||
|| type == (int)GlobalEnumVars.BillPaymentsType.Bargain
|
||||
|| type == (int)GlobalEnumVars.BillPaymentsType.Giveaway
|
||||
|| type == (int)GlobalEnumVars.BillPaymentsType.Solitaire
|
||||
|| type == (int)GlobalEnumVars.BillPaymentsType.TransactionComponent
|
||||
)
|
||||
{
|
||||
//如果是订单生成支付单的话,取第一条订单的店铺id,后面的所有订单都要保证是此店铺的id
|
||||
var orderModel = await orderServices.QueryByClauseAsync(p =>
|
||||
@@ -264,7 +272,15 @@ namespace CoreCms.Net.Services
|
||||
var dto = new CheckPayDTO();
|
||||
|
||||
//订单
|
||||
if (type == (int)GlobalEnumVars.BillPaymentsType.Order)
|
||||
if (type == (int)GlobalEnumVars.BillPaymentsType.Common
|
||||
|| type == (int)GlobalEnumVars.BillPaymentsType.PinTuan
|
||||
|| type == (int)GlobalEnumVars.BillPaymentsType.Group
|
||||
|| type == (int)GlobalEnumVars.BillPaymentsType.Skill
|
||||
|| type == (int)GlobalEnumVars.BillPaymentsType.Bargain
|
||||
|| type == (int)GlobalEnumVars.BillPaymentsType.Giveaway
|
||||
|| type == (int)GlobalEnumVars.BillPaymentsType.Solitaire
|
||||
|| type == (int)GlobalEnumVars.BillPaymentsType.TransactionComponent
|
||||
)
|
||||
{
|
||||
//如果是订单生成支付单的话,取第一条订单的店铺id,后面的所有订单都要保证是此店铺的id
|
||||
foreach (var item in sourceStr)
|
||||
@@ -538,7 +554,7 @@ namespace CoreCms.Net.Services
|
||||
/// <param name="type">支付类型</param>
|
||||
/// <param name="params">参数</param>
|
||||
/// <returns></returns>
|
||||
private async Task<WebApiCallBack> ToAdd(string sourceStr, string paymentCode, int userId = 0, int type = (int)GlobalEnumVars.BillPaymentsType.Order, JObject @params = null)
|
||||
private async Task<WebApiCallBack> ToAdd(string sourceStr, string paymentCode, int userId = 0, int type = (int)GlobalEnumVars.BillPaymentsType.Common, JObject @params = null)
|
||||
{
|
||||
var jm = new WebApiCallBack();
|
||||
|
||||
@@ -647,7 +663,15 @@ namespace CoreCms.Net.Services
|
||||
await _dal.UpdateAsync(billPaymentInfo);
|
||||
if (status == (int)GlobalEnumVars.BillPaymentsStatus.Payed)
|
||||
{
|
||||
if (billPaymentInfo.type == (int)GlobalEnumVars.BillPaymentsType.Order)
|
||||
if (billPaymentInfo.type == (int)GlobalEnumVars.BillPaymentsType.Common
|
||||
|| billPaymentInfo.type == (int)GlobalEnumVars.BillPaymentsType.PinTuan
|
||||
|| billPaymentInfo.type == (int)GlobalEnumVars.BillPaymentsType.Group
|
||||
|| billPaymentInfo.type == (int)GlobalEnumVars.BillPaymentsType.Skill
|
||||
|| billPaymentInfo.type == (int)GlobalEnumVars.BillPaymentsType.Bargain
|
||||
|| billPaymentInfo.type == (int)GlobalEnumVars.BillPaymentsType.Giveaway
|
||||
|| billPaymentInfo.type == (int)GlobalEnumVars.BillPaymentsType.Solitaire
|
||||
|| billPaymentInfo.type == (int)GlobalEnumVars.BillPaymentsType.TransactionComponent
|
||||
)
|
||||
{
|
||||
//如果是订单类型,做支付后处理
|
||||
await orderServices.Pay(billPaymentInfo.sourceId, paymentCode, billPaymentInfo);
|
||||
@@ -725,27 +749,38 @@ namespace CoreCms.Net.Services
|
||||
{
|
||||
|
||||
var res = string.Empty;
|
||||
switch (entity.type)
|
||||
if (entity.type == (int)GlobalEnumVars.BillPaymentsType.Common
|
||||
|| entity.type == (int)GlobalEnumVars.BillPaymentsType.PinTuan
|
||||
|| entity.type == (int)GlobalEnumVars.BillPaymentsType.Group
|
||||
|| entity.type == (int)GlobalEnumVars.BillPaymentsType.Skill
|
||||
|| entity.type == (int)GlobalEnumVars.BillPaymentsType.Bargain
|
||||
|| entity.type == (int)GlobalEnumVars.BillPaymentsType.Giveaway
|
||||
|| entity.type == (int)GlobalEnumVars.BillPaymentsType.Solitaire
|
||||
|| entity.type == (int)GlobalEnumVars.BillPaymentsType.TransactionComponent)
|
||||
{
|
||||
case (int)GlobalEnumVars.BillPaymentsType.Order:
|
||||
var orderItem = await _orderItemServices.QueryByClauseAsync(p => p.orderId == entity.sourceId);
|
||||
if (orderItem != null)
|
||||
{
|
||||
res = orderItem.name;
|
||||
}
|
||||
break;
|
||||
case (int)GlobalEnumVars.BillPaymentsType.Recharge:
|
||||
res = "账户充值";
|
||||
break;
|
||||
case (int)GlobalEnumVars.BillPaymentsType.FormPay:
|
||||
break;
|
||||
case (int)GlobalEnumVars.BillPaymentsType.FormOrder:
|
||||
break;
|
||||
case (int)GlobalEnumVars.BillPaymentsType.ServiceOrder:
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
var orderItem = await _orderItemServices.QueryByClauseAsync(p => p.orderId == entity.sourceId);
|
||||
if (orderItem != null)
|
||||
{
|
||||
res = orderItem.name;
|
||||
}
|
||||
}
|
||||
else if (entity.type == (int)GlobalEnumVars.BillPaymentsType.Recharge)
|
||||
{
|
||||
res = "账户充值";
|
||||
}
|
||||
else if (entity.type == (int)GlobalEnumVars.BillPaymentsType.FormPay)
|
||||
{
|
||||
}
|
||||
else if (entity.type == (int)GlobalEnumVars.BillPaymentsType.FormOrder)
|
||||
{
|
||||
}
|
||||
else if (entity.type == (int)GlobalEnumVars.BillPaymentsType.ServiceOrder)
|
||||
{
|
||||
}
|
||||
else
|
||||
{
|
||||
}
|
||||
|
||||
if (string.IsNullOrEmpty(res))
|
||||
{
|
||||
var allConfigs = await _settingServices.GetConfigDictionaries();
|
||||
@@ -774,19 +809,27 @@ namespace CoreCms.Net.Services
|
||||
|
||||
//查支付人id
|
||||
var userId = 0;
|
||||
switch (type)
|
||||
if (type == (int)GlobalEnumVars.BillPaymentsType.Common
|
||||
|| type == (int)GlobalEnumVars.BillPaymentsType.PinTuan
|
||||
|| type == (int)GlobalEnumVars.BillPaymentsType.Group
|
||||
|| type == (int)GlobalEnumVars.BillPaymentsType.Skill
|
||||
|| type == (int)GlobalEnumVars.BillPaymentsType.Bargain
|
||||
|| type == (int)GlobalEnumVars.BillPaymentsType.Giveaway
|
||||
|| type == (int)GlobalEnumVars.BillPaymentsType.Solitaire
|
||||
|| type == (int)GlobalEnumVars.BillPaymentsType.TransactionComponent
|
||||
)
|
||||
{
|
||||
case (int)GlobalEnumVars.BillPaymentsType.Order:
|
||||
var orderInfo = await orderServices.QueryByIdAsync(orderId);
|
||||
if (orderInfo == null)
|
||||
{
|
||||
jm.code = 10000;
|
||||
jm.msg = GlobalErrorCodeVars.Code10000;
|
||||
return jm;
|
||||
}
|
||||
userId = orderInfo.userId;
|
||||
break;
|
||||
var orderInfo = await orderServices.QueryByIdAsync(orderId);
|
||||
if (orderInfo == null)
|
||||
{
|
||||
jm.code = 10000;
|
||||
jm.msg = GlobalErrorCodeVars.Code10000;
|
||||
return jm;
|
||||
}
|
||||
|
||||
userId = orderInfo.userId;
|
||||
}
|
||||
|
||||
//::todo 校验支付方式是否存在
|
||||
//生成支付单
|
||||
var result = await ToAdd(orderId, paymentCode, userId, type);
|
||||
|
||||
@@ -145,7 +145,14 @@ namespace CoreCms.Net.Services
|
||||
// 将参数(parameter)给 公众号前端 让他在微信内H5调起支付(https://pay.weixin.qq.com/wiki/doc/api/jsapi.php?chapter=7_7&index=6)
|
||||
parameter.Add("paymentId", entity.paymentId);
|
||||
|
||||
if (entity.type == (int)GlobalEnumVars.BillPaymentsType.Order)
|
||||
if (entity.type == (int)GlobalEnumVars.BillPaymentsType.Common
|
||||
|| entity.type == (int)GlobalEnumVars.BillPaymentsType.PinTuan
|
||||
|| entity.type == (int)GlobalEnumVars.BillPaymentsType.Group
|
||||
|| entity.type == (int)GlobalEnumVars.BillPaymentsType.Skill
|
||||
|| entity.type == (int)GlobalEnumVars.BillPaymentsType.Bargain
|
||||
|| entity.type == (int)GlobalEnumVars.BillPaymentsType.Giveaway
|
||||
|| entity.type == (int)GlobalEnumVars.BillPaymentsType.Solitaire
|
||||
|| entity.type == (int)GlobalEnumVars.BillPaymentsType.TransactionComponent)
|
||||
{
|
||||
var payment = await billPaymentsServices.QueryByClauseAsync(p => p.paymentId == entity.paymentId);
|
||||
if (payment != null)
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*/
|
||||
|
||||
//接口请求地址,如果需要不部署接口端的情况下测试uni-app,可以直接替换为官方测试接口:https://api.demo.coreshop.cn
|
||||
export const apiBaseUrl = 'https://api.demo.coreshop.cn';
|
||||
export const apiBaseUrl = 'https://api.nsts.mvccms.cn';
|
||||
//项目静态资源请求地址,如果使用官方的静态文件地址可以直接替换为:https://files.cdn.coreshop.cn
|
||||
export const apiFilesUrl = 'https://files.cdn.coreshop.cn';
|
||||
|
||||
@@ -14,13 +14,35 @@ export const h5Url = apiBaseUrl + "/wap/"; //H5端网站地址,
|
||||
export const baseUrl = process.env.NODE_ENV === 'development' ? window.location.origin + '/' : apiBaseUrl
|
||||
// #endif
|
||||
|
||||
//支付单类型
|
||||
export const paymentType = {
|
||||
//支付单类型
|
||||
order: 1, //订单
|
||||
recharge: 2, //充值
|
||||
formPay: 3, //表单订单
|
||||
formOrder: 4, //表单付款码
|
||||
serviceOrder: 5, //服务订单
|
||||
//普通订单
|
||||
common: 1,
|
||||
//拼团订单
|
||||
pinTuan: 2,
|
||||
//团购订单
|
||||
group: 3,
|
||||
//秒杀订单
|
||||
skill: 4,
|
||||
|
||||
//砍价
|
||||
bargain: 6,
|
||||
//赠品
|
||||
giveaway: 7,
|
||||
//接龙
|
||||
solitaire: 8,
|
||||
//交易组件
|
||||
transactionComponent: 10,
|
||||
|
||||
//充值
|
||||
recharge: 201,
|
||||
|
||||
//服务订单
|
||||
serviceOrder: 501,
|
||||
//表单付款码
|
||||
formPay: 301,
|
||||
//表单订单
|
||||
formOrder: 302,
|
||||
};
|
||||
|
||||
// #ifdef MP-TOUTIAO
|
||||
|
||||
@@ -91,7 +91,7 @@
|
||||
payments = payments.filter(item => item.code !== 'alipay')
|
||||
|
||||
// 如果是充值订单,服务订单 过滤余额支付 过滤非线上支付方式
|
||||
if (this.type === 2 || this.type === 5) {
|
||||
if (this.type == this.$globalConstVars.paymentType.recharge || this.type === this.$globalConstVars.paymentType.serviceOrder) {
|
||||
payments = payments.filter(item => item.code !== 'balancepay' || item.isOnline === false)
|
||||
}
|
||||
|
||||
@@ -112,14 +112,14 @@
|
||||
payment_type: this.type,
|
||||
params: {}
|
||||
}
|
||||
data['ids'] = (this.type == 1 || this.type == 3 || this.type == 4 || this.type == 5) ? this.orderId : this.uid
|
||||
data['ids'] = (this.type == this.$globalConstVars.paymentType.common || this.type == this.$globalConstVars.paymentType.pinTuan || this.type == this.$globalConstVars.paymentType.group || this.type == this.$globalConstVars.paymentType.skill || this.type == this.$globalConstVars.paymentType.bargain || this.type == this.$globalConstVars.paymentType.giveaway || this.type == this.$globalConstVars.paymentType.solitaire || this.type == this.$globalConstVars.paymentType.transactionComponent) ? this.orderId : this.uid
|
||||
|
||||
// 判断订单支付类型
|
||||
if (this.type == 2 && this.recharge) {
|
||||
if (this.type == this.$globalConstVars.paymentType.recharge && this.recharge) {
|
||||
data['params'] = {
|
||||
money: this.recharge
|
||||
}
|
||||
} else if ((this.type == 3 || this.type == 4) && this.recharge) {
|
||||
} else if ((this.type == this.$globalConstVars.paymentType.formPay || this.type == this.$globalConstVars.paymentType.formOrder) && this.recharge) {
|
||||
data['params'] = {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -401,7 +401,7 @@
|
||||
buyNum: 1, // 选定的购买数量
|
||||
minBuyNum: 1, // 最小可购买数量
|
||||
type: 2,
|
||||
cartType: 3,
|
||||
cartType: this.$globalConstVars.paymentType.group,
|
||||
isfav: false, // 商品是否收藏
|
||||
//拼团列表滑动数据
|
||||
swiperSet: {
|
||||
|
||||
@@ -254,7 +254,7 @@
|
||||
<block v-for="(items,indexs) in shopRecommendData" :key="indexs">
|
||||
<view :id="['scroll' + (indexs + 1 )]" class="recommend-scroll-item" @tap="goGoodsDetail(items.id)">
|
||||
<u--image :src="items.image" mode="widthFix" width="91px" height="91px" radius="10"></u--image>
|
||||
<view class="u-line-2 coreshop-font-sm coreshop-text-black coreshop-margin-top-10 coreshop-margin-bottom-10" style="min-height: 34px;">{{items.name}}</view>
|
||||
<view class="u-line-1-2 coreshop-font-sm coreshop-text-black coreshop-margin-top-10 coreshop-margin-bottom-10 u-line-2" style="height: 34px;">{{items.name}}</view>
|
||||
<view class="coreshop-text-red coreshop-text-price coreshop-margin-top-10 coreshop-margin-bottom-10 coreshop-font-md coreshop-flex-direction-row">
|
||||
{{items.price}}元
|
||||
</view>
|
||||
@@ -529,7 +529,7 @@
|
||||
minBuyNum: 1, // 最小可购买数量
|
||||
pinTuanType: 2, // 1单独购买 2拼团
|
||||
type: 2,
|
||||
cartType: 2,
|
||||
cartType: this.$globalConstVars.paymentType.pinTuan,
|
||||
isfav: false, // 商品是否收藏
|
||||
//拼团列表滑动数据
|
||||
swiperSet: {
|
||||
|
||||
@@ -403,7 +403,7 @@
|
||||
buyNum: 1, // 选定的购买数量
|
||||
minBuyNum: 1, // 最小可购买数量
|
||||
type: 2,
|
||||
cartType: 4,
|
||||
cartType: this.$globalConstVars.paymentType.skill,
|
||||
isfav: false, // 商品是否收藏
|
||||
//拼团列表滑动数据
|
||||
swiperSet: {
|
||||
|
||||
@@ -169,7 +169,7 @@
|
||||
totalprice: '0.00',
|
||||
cart: [],
|
||||
type: 2,
|
||||
cartType: 8,
|
||||
cartType: this.$globalConstVars.paymentType.solitaire,
|
||||
shareBox: false,
|
||||
submitStatus: false,
|
||||
shareUrl: '/pages/share/jump/jump',
|
||||
|
||||
@@ -500,16 +500,6 @@
|
||||
} else if (res.data.needLogin) {
|
||||
console.log("要登录权限了");
|
||||
this.$u.route({ type: 'switchTab', url: '/pages/index/default/default' })
|
||||
//if (this.$db.get('userToken')) {
|
||||
// this.hasLogin = true
|
||||
// this.$u.api.userInfo().then(res => {
|
||||
// if (res.status) {
|
||||
|
||||
// }
|
||||
// })
|
||||
//} else {
|
||||
// this.hasLogin = false
|
||||
//}
|
||||
|
||||
if (!this.hasLogin) {
|
||||
this.$store.commit('showLoginTip', true);
|
||||
|
||||
@@ -422,7 +422,7 @@
|
||||
buyNum: 1, // 选定的购买数量
|
||||
minBuyNum: 1, // 最小可购买数量
|
||||
type: 2, // 1加入购物车 2购买
|
||||
cartType: 1,
|
||||
cartType: this.$globalConstVars.paymentType.common,
|
||||
isfav: false, // 商品是否收藏
|
||||
submitStatus: false,
|
||||
bottomModal: false,
|
||||
|
||||
@@ -43,8 +43,6 @@
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
background: this.$coreTheme.mainNabBar.background,
|
||||
titleColor: this.$coreTheme.mainNabBar.titleColor,
|
||||
swiperItems: [],
|
||||
currentIndex: 0,
|
||||
opacity: 0,
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
orderType: 2 // 储值类型
|
||||
orderType: this.$globalConstVars.paymentType.recharge // 储值类型
|
||||
}
|
||||
},
|
||||
onReady() {
|
||||
|
||||
@@ -20,14 +20,14 @@
|
||||
<text class="coreshop-text-grey">订单类型</text>
|
||||
</view>
|
||||
<view class="action">
|
||||
<text class="coreshop-font-sm coreshop-text-gray" v-if="type == 1">商品订单</text>
|
||||
<text class="coreshop-font-sm coreshop-text-gray" v-if="type == 2" @click="toRecharge()">充值订单</text>
|
||||
<text class="coreshop-font-sm coreshop-text-gray" v-if="type == 3">表单订单</text>
|
||||
<text class="coreshop-font-sm coreshop-text-gray" v-if="type == 4">付款码</text>
|
||||
<text class="coreshop-font-sm coreshop-text-gray" v-if="type == 5">服务订单</text>
|
||||
<text class="coreshop-font-sm coreshop-text-gray" v-if="type == $globalConstVars.paymentType.common || type == $globalConstVars.paymentType.pinTuan || type == $globalConstVars.paymentType.group || type == $globalConstVars.paymentType.skill || type == this.$globalConstVars.paymentType.bargain || type == this.$globalConstVars.paymentType.giveaway || type == $globalConstVars.paymentType.solitaire || type == $globalConstVars.paymentType.transactionComponent">商品订单</text>
|
||||
<text class="coreshop-font-sm coreshop-text-gray" v-if="type == $globalConstVars.paymentType.recharge" @click="toRecharge()">充值订单</text>
|
||||
<text class="coreshop-font-sm coreshop-text-gray" v-if="type == $globalConstVars.paymentType.formPay">表单订单</text>
|
||||
<text class="coreshop-font-sm coreshop-text-gray" v-if="type == $globalConstVars.paymentType.formOrder">付款码</text>
|
||||
<text class="coreshop-font-sm coreshop-text-gray" v-if="type == $globalConstVars.paymentType.serviceOrder">服务订单</text>
|
||||
</view>
|
||||
</view>
|
||||
<template v-if="type == 1">
|
||||
<template v-if="type == $globalConstVars.paymentType.common || type == $globalConstVars.paymentType.pinTuan || type == $globalConstVars.paymentType.group || type == $globalConstVars.paymentType.skill || type == this.$globalConstVars.paymentType.bargain || type == this.$globalConstVars.paymentType.giveaway || type == $globalConstVars.paymentType.solitaire || type == $globalConstVars.paymentType.transactionComponent">
|
||||
<view class="coreshop-list-item">
|
||||
<view class="content">
|
||||
<text class="coreshop-text-grey">订单编号</text>
|
||||
@@ -45,7 +45,7 @@
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<template v-else-if="type == 2">
|
||||
<template v-else-if="type == $globalConstVars.paymentType.recharge">
|
||||
<view class="coreshop-list-item">
|
||||
<view class="content">
|
||||
<text class="coreshop-text-grey">充值金额</text>
|
||||
@@ -55,7 +55,7 @@
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<template v-else-if="type == 5">
|
||||
<template v-else-if="type == $globalConstVars.paymentType.serviceOrder">
|
||||
<view class="coreshop-list-item">
|
||||
<view class="content">
|
||||
<text class="coreshop-text-grey">购买服务</text>
|
||||
@@ -146,7 +146,7 @@
|
||||
orderId: 0,
|
||||
recharge: 0,
|
||||
serviceId: 0, //服务编号
|
||||
type: 1, // 订单类型 1商品订单 2充值订单 5服务订单
|
||||
type: 1, // 订单类型
|
||||
orderInfo: {}, // 订单详情
|
||||
userInfo: {}, // 用户信息
|
||||
serviceInfo: {}, // 服务信息
|
||||
@@ -178,16 +178,16 @@
|
||||
this.type = Number(options.type);
|
||||
this.formId = Number(options.formId);
|
||||
//this.getOrderInfo ()
|
||||
if (this.orderId && this.type == 1) {
|
||||
if (this.orderId && (this.type == this.$globalConstVars.paymentType.common || this.type == this.$globalConstVars.paymentType.pinTuan || this.type == this.$globalConstVars.paymentType.group || this.type == this.$globalConstVars.paymentType.skill || this.type == this.$globalConstVars.paymentType.bargain || this.type == this.$globalConstVars.paymentType.giveaway || this.type == this.$globalConstVars.paymentType.solitaire || this.type == this.$globalConstVars.paymentType.transactionComponent)) {
|
||||
// 商品订单
|
||||
this.getOrderInfo();
|
||||
} else if (this.recharge && this.type == 2) {
|
||||
} else if (this.recharge && this.type == this.$globalConstVars.paymentType.recharge) {
|
||||
// 充值订单 获取用户id
|
||||
this.getUserInfo();
|
||||
} else if (this.formId && (this.type == 3 || this.type == 4)) {
|
||||
} else if (this.formId && (this.type == this.$globalConstVars.paymentType.formPay || this.type == this.$globalConstVars.paymentType.formOrder)) {
|
||||
// 表单订单 id传到订单上
|
||||
this.orderId = '' + this.formId;
|
||||
} else if (this.type == 5) {
|
||||
} else if (this.type == this.$globalConstVars.paymentType.serviceOrder) {
|
||||
this.getServiceDetail();
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -90,13 +90,13 @@
|
||||
});
|
||||
},
|
||||
orderDetail() {
|
||||
if (this.orderId && this.paymentInfo.type === 1) {
|
||||
if (this.orderId && (this.paymentInfo.type == this.$globalConstVars.paymentType.common || this.paymentInfo.type == this.$globalConstVars.paymentType.pinTuan || this.paymentInfo.type == this.$globalConstVars.paymentType.group || this.paymentInfo.type == this.$globalConstVars.paymentType.skill || this.paymentInfo.type == this.$globalConstVars.paymentType.bargain || this.paymentInfo.type == this.$globalConstVars.paymentType.giveaway || this.paymentInfo.type == this.$globalConstVars.paymentType.solitaire || this.paymentInfo.type == this.$globalConstVars.paymentType.transactionComponent)) {
|
||||
this.$u.route({ type: 'redirectTo', url: '/pages/member/order/detail/detail?orderId=' + this.orderId });
|
||||
} else if (this.paymentInfo.type === 2) {
|
||||
} else if (this.paymentInfo.type === this.$globalConstVars.paymentType.recharge) {
|
||||
this.$u.route({ type: 'redirectTo', url: '/pages/member/balance/details/details' });
|
||||
} else if (this.paymentInfo.type === 3 || this.paymentInfo.type === 4) {
|
||||
} else if (this.paymentInfo.type === this.$globalConstVars.paymentType.formPay || this.paymentInfo.type === this.$globalConstVars.paymentType.formOrder) {
|
||||
this.$u.route({ type: 'switchTab', url: '/pages/index/default/default' });
|
||||
} else if (this.paymentInfo.type === 5) {
|
||||
} else if (this.paymentInfo.type === this.$globalConstVars.paymentType.serviceOrder) {
|
||||
this.$u.route({ type: 'redirectTo', url: '/pages/member/serviceOrder/index/index' });
|
||||
}
|
||||
}
|
||||
|
||||
@@ -131,7 +131,8 @@
|
||||
</div>
|
||||
<div class="layui-input-inline">
|
||||
<div class="layui-upload">
|
||||
<button type="button" class="layui-btn" id="upBtn">上传图片</button>
|
||||
<button type="button" class="layui-btn" id="upBtn">裁剪上传</button>
|
||||
<button type="button" class="layui-btn" id="upBtnOriginal">原图上传</button>
|
||||
<div class="layui-upload-list">
|
||||
<img class="layui-upload-img" id="viewImgBox" src="{{ layui.setter.noImagePicUrl }}">
|
||||
<p id="viewTextBox"></p>
|
||||
@@ -142,9 +143,10 @@
|
||||
|
||||
<fieldset class="layui-elem-field layui-field-title site-title"><legend><a name="compress">图集</a></legend></fieldset>
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-input-inline layui-inline-2">
|
||||
<div class="layui-input-inline layui-inline-4">
|
||||
<input type="hidden" name="goods[images]" id="imageIds" class="layui-input" placeholder="请上传缩略图" lay-reqText="请上传缩略图" />
|
||||
<button type="button" class="layui-btn layui-btn-sm" id="upBtnimageIds"><i class="layui-icon"></i>上传图片</button>
|
||||
<button type="button" class="layui-btn layui-btn-sm" id="upBtnimageIds"><i class="layui-icon"></i>裁剪上传</button>
|
||||
<button type="button" class="layui-btn layui-btn-sm" id="upBtnimageIdsOriginal"><i class="layui-icon"></i>原图上传</button>
|
||||
</div>
|
||||
<div class="layui-form-mid">
|
||||
图集:[建议数量控制在10张以内]:
|
||||
@@ -723,6 +725,28 @@
|
||||
});
|
||||
form.render();
|
||||
});
|
||||
//普通图片上传
|
||||
upload.render({
|
||||
elem: '#upBtnOriginal'
|
||||
, url: layui.setter.apiUrl + 'Api/Tools/UploadFiles'
|
||||
, before: function (obj) {
|
||||
obj.preview(function (index, file, result) {
|
||||
$('#viewImgBox').attr('src', result);
|
||||
});
|
||||
}
|
||||
, done: function (res) {
|
||||
if (res.code > 0) { return layer.msg('上传失败'); }
|
||||
layer.msg('上传成功');
|
||||
$("#goodImage").val(res.data.fileUrl);
|
||||
}
|
||||
, error: function () {
|
||||
var viewTextBox = $('#viewTextBox');
|
||||
viewTextBox.html('<span style="color: #FF5722;">上传失败</span> <a class="layui-btn layui-btn-xs demo-reload">重试</a>');
|
||||
viewTextBox.find('.demo-reload').on('click', function () {
|
||||
uploadInst.upload();
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
//图集上传
|
||||
$('#upBtnimageIds').click(function () {
|
||||
@@ -750,6 +774,34 @@
|
||||
form.render();
|
||||
});
|
||||
|
||||
upload.render({
|
||||
elem: '#upBtnimageIdsOriginal'
|
||||
, url: layui.setter.apiUrl + 'Api/Tools/UploadFiles'
|
||||
, before: function (obj) {
|
||||
}
|
||||
, done: function (res) {
|
||||
if (res.code > 0) {
|
||||
return layer.msg('上传失败');
|
||||
} else {
|
||||
layer.msg('上传成功');
|
||||
imgs.push(res.data.fileUrl);
|
||||
$('#imageIds').val(imgs);
|
||||
var getTpl = image_tpl.innerHTML, view = document.getElementById('upload-more-list');
|
||||
laytpl(getTpl).render(imgs, function (html) {
|
||||
view.innerHTML = html;
|
||||
});
|
||||
}
|
||||
}
|
||||
, error: function () {
|
||||
var viewTextBox = $('#viewTextBox');
|
||||
viewTextBox.html('<span style="color: #FF5722;">上传失败</span> <a class="layui-btn layui-btn-xs demo-reload">重试</a>');
|
||||
viewTextBox.find('.demo-reload').on('click', function () {
|
||||
uploadInst.upload();
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
//SKU缩略图上传
|
||||
$('.upSpecImage').click(function () {
|
||||
var _that = this;
|
||||
|
||||
@@ -127,7 +127,8 @@
|
||||
</div>
|
||||
<div class="layui-input-inline">
|
||||
<div class="layui-upload">
|
||||
<button type="button" class="layui-btn" id="upBtn">上传图片</button>
|
||||
<button type="button" class="layui-btn" id="upBtn">裁剪上传</button>
|
||||
<button type="button" class="layui-btn" id="upBtnOriginal">原图上传</button>
|
||||
<div class="layui-upload-list">
|
||||
<img class="layui-upload-img" id="viewImgBox" src="{{d.data.model.image || layui.setter.noImagePicUrl }}">
|
||||
<p id="viewTextBox"></p>
|
||||
@@ -137,9 +138,10 @@
|
||||
</div>
|
||||
<fieldset class="layui-elem-field layui-field-title site-title"><legend><a name="compress">图集</a></legend></fieldset>
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-input-inline layui-inline-2">
|
||||
<div class="layui-input-inline layui-inline-4">
|
||||
<input type="hidden" name="goods[images]" id="imageIds" value="{{d.data.model.images }}" class="layui-input" placeholder="请上传缩略图" lay-reqText="请上传缩略图" />
|
||||
<button type="button" class="layui-btn layui-btn-sm" id="upBtnimageIds"><i class="layui-icon"></i>上传图片</button>
|
||||
<button type="button" class="layui-btn layui-btn-sm" id="upBtnimageIds"><i class="layui-icon"></i>裁剪上传</button>
|
||||
<button type="button" class="layui-btn layui-btn-sm" id="upBtnimageIdsOriginal"><i class="layui-icon"></i>原图上传</button>
|
||||
</div>
|
||||
<div class="layui-form-mid">
|
||||
图集:[建议数量控制在10张以内]:
|
||||
@@ -800,8 +802,30 @@
|
||||
});
|
||||
form.render();
|
||||
});
|
||||
//普通图片上传
|
||||
upload.render({
|
||||
elem: '#upBtnOriginal'
|
||||
, url: layui.setter.apiUrl + 'Api/Tools/UploadFiles'
|
||||
, before: function (obj) {
|
||||
obj.preview(function (index, file, result) {
|
||||
$('#viewImgBox').attr('src', result);
|
||||
});
|
||||
}
|
||||
, done: function (res) {
|
||||
if (res.code > 0) { return layer.msg('上传失败'); }
|
||||
layer.msg('上传成功');
|
||||
$("#goodImage").val(res.data.fileUrl);
|
||||
}
|
||||
, error: function () {
|
||||
var viewTextBox = $('#viewTextBox');
|
||||
viewTextBox.html('<span style="color: #FF5722;">上传失败</span> <a class="layui-btn layui-btn-xs demo-reload">重试</a>');
|
||||
viewTextBox.find('.demo-reload').on('click', function () {
|
||||
uploadInst.upload();
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
//封面图图片上传
|
||||
//图集上传
|
||||
$('#upBtnimageIds').click(function () {
|
||||
cropperImg.cropImg({
|
||||
aspectRatio: 1 / 1,
|
||||
@@ -828,6 +852,35 @@
|
||||
form.render();
|
||||
});
|
||||
|
||||
upload.render({
|
||||
elem: '#upBtnimageIdsOriginal'
|
||||
, url: layui.setter.apiUrl + 'Api/Tools/UploadFiles'
|
||||
, before: function (obj) {
|
||||
}
|
||||
, done: function (res) {
|
||||
if (res.code > 0) {
|
||||
return layer.msg('上传失败');
|
||||
} else {
|
||||
layer.msg('上传成功');
|
||||
imgs.push(res.data.fileUrl);
|
||||
$('#imageIds').val(imgs);
|
||||
var getTpl = image_tpl.innerHTML, view = document.getElementById('upload-more-list');
|
||||
laytpl(getTpl).render(imgs, function (html) {
|
||||
view.innerHTML = html;
|
||||
});
|
||||
}
|
||||
}
|
||||
, error: function () {
|
||||
var viewTextBox = $('#viewTextBox');
|
||||
viewTextBox.html('<span style="color: #FF5722;">上传失败</span> <a class="layui-btn layui-btn-xs demo-reload">重试</a>');
|
||||
viewTextBox.find('.demo-reload').on('click', function () {
|
||||
uploadInst.upload();
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
//SKU缩略图上传
|
||||
$('.upSpecImage').click(function () {
|
||||
var _that = this;
|
||||
|
||||
Reference in New Issue
Block a user