Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b5fc0068b1 | ||
|
|
85af097207 | ||
|
|
24c3709c95 | ||
|
|
0b3882256e | ||
|
|
e99f8d485c | ||
|
|
1aa198fd85 | ||
|
|
2aeebb3245 | ||
|
|
cc94ee7aff | ||
|
|
86b92e6f2a | ||
|
|
f41874765a | ||
|
|
8d1cb7c4de | ||
|
|
52b8033e2d | ||
|
|
7e55249b79 | ||
|
|
c36415fcda | ||
|
|
7ce062229f | ||
|
|
ae95b0def7 | ||
|
|
cab431c25e | ||
|
|
563533ba19 | ||
|
|
42e9129f8a | ||
|
|
6a6f022eac | ||
|
|
6f2d9f1014 | ||
|
|
7be4e398f3 | ||
|
|
d5592cbd48 | ||
|
|
1256956825 | ||
|
|
d3c114325b | ||
|
|
40ae9ca1c4 | ||
|
|
1ff0b665b6 | ||
|
|
06f7bd5f68 | ||
|
|
03ceb0bcf3 | ||
|
|
5981432ff7 | ||
|
|
e513fff4c0 | ||
|
|
78da791d4c | ||
|
|
810f311a13 | ||
|
|
1f7824b0d7 | ||
|
|
2bf4f1fa56 | ||
|
|
52f8e217f3 | ||
|
|
380b47e371 | ||
|
|
5d319b3f37 | ||
|
|
b076f61c58 | ||
|
|
7b35a39618 |
No files matched your search
|
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 27 KiB |
|
Before Width: | Height: | Size: 255 KiB After Width: | Height: | Size: 238 KiB |
|
After Width: | Height: | Size: 139 KiB |
|
Before Width: | Height: | Size: 192 KiB After Width: | Height: | Size: 69 KiB |
|
After Width: | Height: | Size: 32 KiB |
|
Before Width: | Height: | Size: 493 KiB After Width: | Height: | Size: 201 KiB |
|
After Width: | Height: | Size: 60 KiB |
@@ -32,7 +32,7 @@ export function setFormId(formId) {
|
||||
}
|
||||
|
||||
/**
|
||||
* 领取优惠卷
|
||||
* 领取优惠券
|
||||
* @param int couponId
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -58,3 +58,10 @@ export function weixinMiniAppLogin(phoneCode, loginCode) {
|
||||
noAuth: true // TODO 芋艿:后续要做调整
|
||||
});
|
||||
}
|
||||
|
||||
// 创建微信 JS SDK 初始化所需的签名
|
||||
export function createWeixinMpJsapiSignature(url) {
|
||||
return request.post("app-api/member/auth/create-weixin-jsapi-signature?url=" + url, {}, {
|
||||
noAuth: true // TODO 芋艿:后续要做调整
|
||||
});
|
||||
}
|
||||
@@ -178,7 +178,7 @@ export function orderConfirm(cartId, isNew, addAgain,secKill,combination,bargain
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前金额能使用的优惠卷
|
||||
* 获取当前金额能使用的优惠券
|
||||
* @param string price
|
||||
*
|
||||
*/
|
||||
@@ -206,14 +206,6 @@ export function postOrderComputed(data) {
|
||||
return request.post("order/computed/price", data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 将字符串 转base64
|
||||
* @param object data
|
||||
*/
|
||||
export function qrcodeApi(data) {
|
||||
return request.post('qrcode/str2base64', data, {}, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* 微信订单支付
|
||||
* @param object data
|
||||
|
||||
@@ -9,3 +9,13 @@ export function getPayWallet() {
|
||||
export function getWalletTransactionPage(data) {
|
||||
return request.get("app-api/pay/wallet-transaction/page", data);
|
||||
}
|
||||
|
||||
// 获得钱包充值套餐列表
|
||||
export function getWalletRechargePackageList() {
|
||||
return request.get("app-api/pay/wallet-recharge-package/list");
|
||||
}
|
||||
|
||||
// 创建钱包充值记录(发起充值)
|
||||
export function createWalletRecharge(data) {
|
||||
return request.post("app-api/pay/wallet-recharge/create", data);
|
||||
}
|
||||
@@ -2,5 +2,7 @@ import request from "@/utils/request.js";
|
||||
|
||||
// 查询分类列表
|
||||
export function getCategoryList() {
|
||||
return request.get('app-api/product/category/list', {});
|
||||
return request.get('app-api/product/category/list', {}, {
|
||||
noAuth: true // TODO 芋艿:后续要做调整
|
||||
});
|
||||
}
|
||||
@@ -29,3 +29,10 @@ export function getArticle(id) {
|
||||
noAuth: true // TODO 芋艿:后续要做调整
|
||||
});
|
||||
}
|
||||
|
||||
// 增加文章浏览量
|
||||
export function addArticleBrowseCount(id) {
|
||||
return request.put("app-api/promotion/article/add-browse-count?id=" + id, {}, {
|
||||
noAuth: true // TODO 芋艿:后续要做调整
|
||||
});
|
||||
}
|
||||
@@ -44,8 +44,8 @@ export function getBargainRecordPage(data) {
|
||||
// 获得砍价活动详情
|
||||
export function getBargainRecordDetail(id, activityId) {
|
||||
return request.get("app-api/promotion/bargain-record/get-detail", {
|
||||
id,
|
||||
activityId
|
||||
id: id > 0 ? id : undefined,
|
||||
activityId: activityId > 0 ? activityId : undefined
|
||||
}, {
|
||||
noAuth: true // TODO 芋艿:后续要做调整
|
||||
});
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import request from "@/utils/request.js";
|
||||
|
||||
// 领取优惠券
|
||||
export function takeCoupon(templateId) {
|
||||
return request.post("app-api/promotion/coupon/take", {
|
||||
templateId
|
||||
@@ -11,21 +12,23 @@ export function getMatchCouponList(data) {
|
||||
return request.get("app-api/promotion/coupon/match-list", data);
|
||||
}
|
||||
|
||||
// 获得用户优惠劵列表
|
||||
export function getCouponPage(data) {
|
||||
return request.get("app-api/promotion/coupon/page", data);
|
||||
}
|
||||
|
||||
export function getCouponTemplateList(spuId, useType) {
|
||||
return request.get("app-api/promotion/coupon-template/list", {
|
||||
spuId,
|
||||
useType
|
||||
}, {
|
||||
// 获得优惠劵模板分页
|
||||
export function getCouponTemplatePage(data) {
|
||||
return request.get("app-api/promotion/coupon-template/page", data, {
|
||||
noAuth: true // TODO 芋艿:后续要做调整
|
||||
});
|
||||
}
|
||||
|
||||
export function getCouponTemplatePage(data) {
|
||||
return request.get("app-api/promotion/coupon-template/page", data);
|
||||
// 获得优惠劵模板列表
|
||||
export function getCouponTemplateList(data) {
|
||||
return request.get("app-api/promotion/coupon-template/list", data, {
|
||||
noAuth: true // TODO 芋艿:后续要做调整
|
||||
});
|
||||
}
|
||||
|
||||
// 获得未使用的优惠劵数量
|
||||
|
||||
@@ -2,5 +2,5 @@ import request from "@/utils/request.js";
|
||||
|
||||
// 根据字典类型查询字典数据信息
|
||||
export function getDicts(dictType) {
|
||||
return request.get('app-api/system/dict-data/type/' + dictType);
|
||||
return request.get('app-api/system/dict-data/type?type=' + dictType);
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
import request from "@/utils/request.js";
|
||||
|
||||
// 创建微信 JS SDK 初始化所需的签名
|
||||
export function createJsapiSignature(url) {
|
||||
return request.post("app-api/system/wx-mp/create-jsapi-signature?url=" + url, {}, {
|
||||
noAuth: true // TODO 芋艿:后续要做调整
|
||||
});
|
||||
}
|
||||
@@ -14,12 +14,6 @@ export function getAfterSalePage(data) {
|
||||
return request.get("app-api/trade/after-sale/page", data);
|
||||
}
|
||||
|
||||
export function getAfterSaleReasonList(way) {
|
||||
return request.get("app-api/trade/after-sale/get-reason-list", {
|
||||
way
|
||||
});
|
||||
}
|
||||
|
||||
export function createAfterSale(data) {
|
||||
return request.post("app-api/trade/after-sale/create", data);
|
||||
}
|
||||
|
||||
@@ -56,5 +56,7 @@ export function getBrokerageRecordPage(data) {
|
||||
export function getProductBrokeragePrice(spuId) {
|
||||
return request.get('app-api/trade/brokerage-record/get-product-brokerage-price', {
|
||||
spuId
|
||||
}, {
|
||||
noAuth: true // TODO 芋艿:后续要做调整
|
||||
});
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
import request from "@/utils/request.js";
|
||||
|
||||
// 获得配送配置
|
||||
// 获得交易配置
|
||||
export function getTradeConfig() {
|
||||
return request.get("app-api/trade/config/get");
|
||||
}
|
||||
@@ -11,7 +11,7 @@
|
||||
<view class='item acea-row row-center-wrapper' v-for="(item,index) in coupon.list"
|
||||
@click="getCouponUser(index, item.id)" :key='index'>
|
||||
<!-- 金额 -->
|
||||
<view class='money acea-row row-column row-center-wrapper' :class='item.takeStatus?"moneyGray":""'>
|
||||
<view class='money acea-row row-column row-center-wrapper' :class='item.canTake ? "" : "moneyGray"'>
|
||||
<view>¥
|
||||
<text v-if="item.discountType === 1" class='num'>{{ fen2yuan(item.discountPrice) }}</text>
|
||||
<text v-else class='num'>{{ (item.discountPercent / 10.0).toFixed(1) }} 折</text>
|
||||
@@ -33,8 +33,8 @@
|
||||
<view v-else>
|
||||
{{ formatDate(item.validStartTime) + " - " + formatDate(item.validEndTime) }}
|
||||
</view>
|
||||
<view class='bnt gray' v-if="item.takeStatus">{{item.use_title || '已领取'}}</view>
|
||||
<view class='bnt bg-color' v-else>{{coupon.statusTile || '立即领取'}}</view>
|
||||
<view class='bnt bg-color' v-if="item.canTake">{{coupon.statusTile || '立即领取'}}</view>
|
||||
<view class='bnt gray' v-else>{{item.use_title || '已领取'}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -80,7 +80,7 @@
|
||||
methods: {
|
||||
close: function() {
|
||||
this.type = 1
|
||||
this.$emit('ChangCouponsClone');
|
||||
this.$emit('ChangCouponsClose');
|
||||
},
|
||||
/**
|
||||
* 选择优惠劵
|
||||
@@ -88,11 +88,11 @@
|
||||
getCouponUser: function(index, id) {
|
||||
// 领取优惠劵时,如果已经领取,则直接跳过
|
||||
let list = this.coupon.list;
|
||||
if (list[index].takeStatus && this.openType === 0) {
|
||||
return;
|
||||
}
|
||||
switch (this.openType) {
|
||||
case 0: // 领取优惠券
|
||||
if (!list[index].canTake) {
|
||||
return;
|
||||
}
|
||||
CouponApi.takeCoupon(id).then(res => {
|
||||
this.$util.Tips({
|
||||
title: "领取成功"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<view class='sharing-packets' :class='!sharePacket.enabled ? "on":""'>
|
||||
<view class='sharing-packets' :class='!enabled ? "on":""'>
|
||||
<view class='iconfont icon-guanbi' @click="closeShare"></view>
|
||||
<view class='line'></view>
|
||||
<view class='sharing-con' @click='goShare'>
|
||||
@@ -7,7 +7,7 @@
|
||||
<view class='text font-color'>
|
||||
<view>会员分享返</view>
|
||||
<view class='money' v-if="sharePacket.brokerageMinPrice && sharePacket.brokerageMaxPrice">
|
||||
<text class='label'>¥</text>{{ fen2yuan(sharePacket.brokerageMinPrice) }} ~ {{ fen2yuan(sharePacket.brokerageMaxPrice) }}
|
||||
<text class='label'>¥</text>{{ fen2yuan(sharePacket.brokerageMinPrice) }}~{{ fen2yuan(sharePacket.brokerageMaxPrice) }}
|
||||
</view>
|
||||
<view class='money' v-else-if="sharePacket.brokerageMinPrice">
|
||||
<text class='label'>¥</text>{{ fen2yuan(sharePacket.brokerageMinPrice) }}
|
||||
@@ -41,7 +41,11 @@
|
||||
return {
|
||||
};
|
||||
},
|
||||
|
||||
computed: {
|
||||
enabled() {
|
||||
return this.sharePacket.enabled && (this.sharePacket.brokerageMinPrice || this.sharePacket.brokerageMaxPrice)
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
closeShare:function(){
|
||||
this.$emit('closeChange');
|
||||
@@ -64,7 +68,7 @@
|
||||
.sharing-packets .sharing-con{width:187rpx;height:210rpx;position:relative;}
|
||||
.sharing-packets .sharing-con image{width:100%;height:100%;}
|
||||
.sharing-packets .sharing-con .text{position:absolute;top:30rpx;font-size:20rpx;width:100%;text-align:center;}
|
||||
.sharing-packets .sharing-con .text .money{font-size:32rpx;font-weight:bold;margin-top:5rpx;}
|
||||
.sharing-packets .sharing-con .text .money{font-size:32rpx;font-weight:bold;margin-top:5rpx;white-space: nowrap}
|
||||
.sharing-packets .sharing-con .text .money .label{font-size:20rpx;}
|
||||
.sharing-packets .sharing-con .text .tip{font-size:18rpx;color:#999;margin-top:5rpx;}
|
||||
.sharing-packets .sharing-con .text .shareBut{font-size:22rpx;color:#fff;margin-top:18rpx;height:50rpx;line-height:50rpx;}
|
||||
|
||||
@@ -3,7 +3,6 @@ import WechatJSSDK from "@/plugin/jweixin-module/index.js";
|
||||
import * as AuthApi from "@/api/member/auth";
|
||||
import * as BrokerageAPI from '@/api/trade/brokerage.js'
|
||||
|
||||
import * as WeiXinApi from '@/api/system/weixin.js';
|
||||
import {
|
||||
WX_AUTH,
|
||||
STATE_KEY,
|
||||
@@ -29,7 +28,7 @@ class AuthWechat {
|
||||
wechat() {
|
||||
return new Promise((resolve, reject) => {
|
||||
// if (this.status) return resolve(this.instance);
|
||||
WeiXinApi.createJsapiSignature(location.href).then(res => {
|
||||
AuthApi.createWeixinMpJsapiSignature(location.href).then(res => {
|
||||
// debugger
|
||||
const jsapiTicket = res.data;
|
||||
jsapiTicket.jsApiList = ['chooseWXPay']; // TODO 芋艿:这里要设置下
|
||||
|
||||
@@ -11,11 +11,11 @@
|
||||
<div class="line1" style="width: 100%;">{{ item.activityName }}</div>
|
||||
<count-down :justify-left="'justify-content:left'" :bgColor="bgColor" :is-day="true" :tip-text="'倒计时 '" :day-text="'天'"
|
||||
:hour-text="' 时 '" :minute-text="' 分 '"
|
||||
:second-text="' 秒 '" :datatime="item.expireTime / 1000" v-if="item.status === 1"></count-down>
|
||||
:second-text="' 秒 '" :datatime="item.endTime / 1000" v-if="item.status === 1"></count-down>
|
||||
<div class="successTxt font-color-red" v-else-if="item.status === 2">砍价成功</div>
|
||||
<div class="endTxt" v-else>活动已结束</div>
|
||||
<div class="money">
|
||||
已砍至<span class="symbol font-color-red">¥</span><span class="num font-color-red">{{ fen2yuan(item.payPrice) }}</span>
|
||||
已砍至<span class="symbol font-color-red">¥</span><span class="num font-color-red">{{ fen2yuan(item.bargainPrice) }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -25,12 +25,12 @@
|
||||
<div class="end" v-else>活动已结束</div>
|
||||
<div class="acea-row row-middle row-right">
|
||||
<div class="bnt bg-color-red" v-if="item.status === 2 && !item.orderId" @click="goConfirm(item)">
|
||||
去付款
|
||||
去下单
|
||||
</div>
|
||||
<div class="bnt bg-color-red" v-if="item.status === 2 && item.orderId && !item.payStatus" @click="goPay(item.surplusPrice,item.orderNo)">
|
||||
立即付款
|
||||
<div class="bnt bg-color-red" v-if="item.status === 2 && item.orderId && !item.payStatus" @click="goPay(item.orderId, item.payOrderId)">
|
||||
去付款
|
||||
</div>
|
||||
<div class="bnt bg-color-red" v-if="item.status === 1" @click="goDetail(item.id)">
|
||||
<div class="bnt bg-color-red" v-if="item.status === 1" @click="goDetail(item.id, item.activityId)">
|
||||
继续砍价
|
||||
</div>
|
||||
<div class="bnt bg-color-red" v-if="item.status === 3" @click="goList">
|
||||
@@ -46,7 +46,6 @@
|
||||
<emptyPage title="暂无砍价记录~"></emptyPage>
|
||||
</block>
|
||||
<home></home>
|
||||
<payment :payMode='payMode' :pay_close="pay_close" @onChangeFun='onChangeFun' :order_id="pay_order_id" :totalPrice='totalPrice'></payment>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
@@ -56,9 +55,9 @@
|
||||
import * as BargainApi from '@/api/promotion/bargain.js';
|
||||
import Loading from "@/components/Loading";
|
||||
import home from '@/components/home';
|
||||
import payment from '@/components/payment';
|
||||
import { mapGetters } from "vuex";
|
||||
import * as Util from '@/utils/util.js';
|
||||
import { toLogin } from '@/libs/login.js';
|
||||
export default {
|
||||
name: "BargainRecord",
|
||||
components: {
|
||||
@@ -66,7 +65,6 @@
|
||||
Loading,
|
||||
emptyPage,
|
||||
home,
|
||||
payment
|
||||
},
|
||||
props: {},
|
||||
computed: mapGetters(['isLogin', 'userInfo', 'uid']),
|
||||
@@ -100,9 +98,6 @@
|
||||
number: 0
|
||||
}
|
||||
],
|
||||
pay_close: false,
|
||||
pay_order_id: '',
|
||||
totalPrice: '0'
|
||||
};
|
||||
},
|
||||
onLoad: function() {
|
||||
@@ -151,9 +146,9 @@
|
||||
/**
|
||||
* 前往砍价记录的详情
|
||||
*/
|
||||
goDetail: function(id) {
|
||||
goDetail: function(id, activityId) {
|
||||
uni.navigateTo({
|
||||
url: `/pages/activity/goods_bargain_details/index?id=${id}&startBargainUid=${this.uid}`
|
||||
url: `/pages/activity/goods_bargain_details/index?id=${activityId}&startBargainUid=${this.uid}&storeBargainId=${id}`
|
||||
})
|
||||
},
|
||||
/**
|
||||
@@ -188,42 +183,12 @@
|
||||
/**
|
||||
* 打开支付组件
|
||||
*/
|
||||
goPay(pay_price, order_id) {
|
||||
this.$set(this, 'pay_close', true);
|
||||
this.$set(this, 'pay_order_id', order_id);
|
||||
this.$set(this, 'totalPrice', pay_price);
|
||||
},
|
||||
/**
|
||||
* 事件回调
|
||||
*/
|
||||
onChangeFun: function(e) {
|
||||
let opt = e;
|
||||
let action = opt.action || null;
|
||||
let value = opt.value != undefined ? opt.value : null;
|
||||
(action && this[action]) && this[action](value);
|
||||
},
|
||||
/**
|
||||
* 关闭支付组件
|
||||
*/
|
||||
payClose: function() {
|
||||
this.pay_close = false;
|
||||
},
|
||||
/**
|
||||
* 支付成功回调
|
||||
*/
|
||||
pay_complete: function() {
|
||||
this.status = false;
|
||||
this.page = 1;
|
||||
this.$set(this, 'bargain', []);
|
||||
this.$set(this, 'pay_close', false);
|
||||
this.getBargainUserList();
|
||||
},
|
||||
/**
|
||||
* 支付失败回调
|
||||
*/
|
||||
pay_fail: function() {
|
||||
this.pay_close = false;
|
||||
},
|
||||
goPay: function (orderId, payOrderId) {
|
||||
const returnUrl = encodeURIComponent('/pages/order_pay_status/index?order_id=' + orderId);
|
||||
uni.navigateTo({
|
||||
url: `/pages/goods/cashier/index?order_id=${payOrderId}&returnUrl=${returnUrl}`
|
||||
});
|
||||
},
|
||||
|
||||
fen2yuan(price) {
|
||||
return Util.fen2yuan(price)
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
<view v-if="item.stock === 0">
|
||||
<view style="font-size: 22rpx;" @tap="openSubscribe('/pages/activity/goods_bargain_details/index?id='+ item.id +'&startBargainUid='+ uid)">已售罄</view>
|
||||
</view>
|
||||
<view class='money font-color'>最低: ¥<text class='price'>{{ fen2yuan(item.bargainPrice) }}</text></view>
|
||||
<view class='money font-color'>最低: ¥<text class='price'>{{ fen2yuan(item.bargainMinPrice) }}</text></view>
|
||||
</view>
|
||||
<view v-if="item.stock > 0" class='cutBnt bg-color'>参与砍价</view>
|
||||
<view v-if="item.stock === 0" class='cutBnt bg-color-hui'>已售罄</view>
|
||||
@@ -130,8 +130,8 @@
|
||||
*/
|
||||
getBargainHeader: function() {
|
||||
BargainApi.getBargainRecordSummary().then(res => {
|
||||
this.bargainTotal = res.data.userCount;
|
||||
this.bargainSuccessList = res.data.successRecords;
|
||||
this.bargainTotal = res.data.successUserCount;
|
||||
this.bargainSuccessList = res.data.successList;
|
||||
}).catch(err => {
|
||||
return this.$util.Tips({
|
||||
title: err
|
||||
|
||||
@@ -16,8 +16,8 @@
|
||||
</view>
|
||||
<view class='text acea-row row-column-around'>
|
||||
<view class='line1'>{{ bargainInfo.name }}</view>
|
||||
<view class="surplus">最低价:¥{{ fen2yuan(bargainInfo.bargainPrice) }}</view>
|
||||
<view class="surplus">剩余:{{ bargainInfo.stock }} {{bargainInfo.unitName}}</view>
|
||||
<view class="surplus">最低价:¥{{ fen2yuan(bargainInfo.bargainMinPrice) }}</view>
|
||||
<view class="surplus">剩余:{{ bargainInfo.stock }} {{bargainInfo.unitName}}</view>
|
||||
<view class='money font-color-red'>
|
||||
当前: ¥ <text class='num'>{{ fen2yuan(buyPrice) }}</text>
|
||||
</view>
|
||||
@@ -40,22 +40,22 @@
|
||||
<!-- 砍价中 -->
|
||||
<block v-if="action === 2">
|
||||
<view class='money acea-row row-center'
|
||||
:class="new Date().getTime() >= bargainUserInfo.expireTime ? 'font_hui': ''">
|
||||
:class="new Date().getTime() >= bargainUserInfo.endTime ? 'font_hui': ''">
|
||||
<view style="margin-right: 40rpx;">已砍<text class="font-color-red"
|
||||
:class="new Date().getTime() >= bargainUserInfo.expireTime ? 'font_hui': ''">¥{{ fen2yuan(bargainUserInfo.price - bargainUserInfo.payPrice) }}</text>
|
||||
:class="new Date().getTime() >= bargainUserInfo.endTime ? 'font_hui': ''">¥{{ fen2yuan(bargainUserInfo.bargainFirstPrice - bargainUserInfo.bargainPrice) }}</text>
|
||||
</view>
|
||||
<view>还剩<text class="font-color-red"
|
||||
:class="new Date().getTime() >= bargainUserInfo.expireTime ? 'font_hui': ''">¥{{ fen2yuan(bargainUserInfo.remainPrice) }}</text>
|
||||
:class="new Date().getTime() >= bargainUserInfo.endTime ? 'font_hui': ''">¥{{ fen2yuan(bargainUserInfo.remainPrice) }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="cu-progress acea-row row-middle round margin-top"
|
||||
:class="new Date().getTime() >= bargainUserInfo.expireTime ? 'bg_qian': ''">
|
||||
:class="new Date().getTime() >= bargainUserInfo.endTime ? 'bg_qian': ''">
|
||||
<view class='acea-row row-middle bg-red'
|
||||
:class="new Date().getTime() >= bargainUserInfo.expireTime ? 'bg-color-hui': ''"
|
||||
:class="new Date().getTime() >= bargainUserInfo.endTime ? 'bg-color-hui': ''"
|
||||
:style="'width:'+ bargainUserInfo.pricePercent +'%;'" />
|
||||
</view>
|
||||
<view class='tip'>
|
||||
一 已有{{ bargainInfo.successCount }}位好友砍价成功 一
|
||||
一 已有{{ bargainInfo.successUserCount }}位好友砍价成功 一
|
||||
</view>
|
||||
</block>
|
||||
|
||||
@@ -187,7 +187,7 @@
|
||||
</view>
|
||||
<view class='goodsDetails borRadius14'>
|
||||
<view class='conter borRadius14'>
|
||||
<jyf-parser v-if="bargainInfo.description" :html="bargainInfo.description" ref="article" :tag-style="tagStyle" />
|
||||
<jyf-parser v-if="bargainInfo.description" :html="bargainInfo.description" ref="article" :tag-style="tagStyle" />
|
||||
<view v-else class="contentNo">
|
||||
<text class="iconfont icon-xiaolian mr8" /> 暂无商品详情
|
||||
</view>
|
||||
@@ -308,7 +308,7 @@
|
||||
|
||||
// ========== 砍价记录 ==========
|
||||
storeBargainId: 0, // 砍价记录 id
|
||||
startBargainUid: 0, // 开启砍价用户 uid
|
||||
startBargainUid: 0, // 开启砍价用户 uid TODO 芋艿:目前很多逻辑基于 startBargainUid 是不太合理的,应该通过后端返回的 userId 处理;等后续优化代码,在考虑
|
||||
bargainUserInfo: {}, // 开启砍价用户信息
|
||||
action: 0, // 拼团记录的参与动作
|
||||
helpAction: 0, // 帮砍动作
|
||||
@@ -419,7 +419,7 @@
|
||||
BargainApi.getBargainActivityDetail(this.id).then(res => {
|
||||
const bargainInfo = res.data;
|
||||
this.bargainInfo = bargainInfo;
|
||||
this.buyPrice = this.bargainInfo.price;
|
||||
this.buyPrice = this.bargainInfo.bargainFirstPrice;
|
||||
this.pages = '/pages/activity/goods_bargain_details/index?id=' + this.id +
|
||||
'&startBargainUid=' + this.uid + '&scene=' + this.uid + '&storeBargainId=' + this.storeBargainId;
|
||||
uni.setNavigationBarTitle({
|
||||
@@ -461,10 +461,15 @@
|
||||
* 去支付
|
||||
*/
|
||||
goConfirm() {
|
||||
// TODO 芋艿:目前跳转不合理,应该跳转到支付界面
|
||||
uni.navigateTo({
|
||||
url: `/pages/activity/bargain/index`
|
||||
})
|
||||
|
||||
// 下单界面
|
||||
const returnUrl = encodeURIComponent('/pages/order_pay_status/index?order_id=' + this.bargainUserInfo.orderId);
|
||||
uni.navigateTo({
|
||||
url: `/pages/goods/cashier/index?order_id=${this.bargainUserInfo.payOrderId}&returnUrl=${returnUrl}`
|
||||
});
|
||||
},
|
||||
|
||||
// ========== 砍价记录 ==========
|
||||
@@ -473,16 +478,17 @@
|
||||
* 获得拼团记录
|
||||
*/
|
||||
gobargainUserInfo: function() {
|
||||
BargainApi.getBargainRecordDetail(this.bargainId, this.id).then(res => {
|
||||
BargainApi.getBargainRecordDetail(this.storeBargainId, this.id).then(res => {
|
||||
const bargainUserInfo = res.data;
|
||||
this.bargainUserInfo = bargainUserInfo;
|
||||
this.action = this.calculateAction(bargainUserInfo);
|
||||
this.helpAction = bargainUserInfo.helpAction;
|
||||
this.storeBargainId = bargainUserInfo.id || this.storeBargainId;
|
||||
this.buyPrice = this.bargainUserInfo.payPrice || this.buyPrice;
|
||||
if (bargainUserInfo.payPrice >= 0 && bargainUserInfo.bargainPrice >= 0) {
|
||||
bargainUserInfo.remainPrice = bargainUserInfo.payPrice - bargainUserInfo.bargainPrice; // 剩余可砍的金额
|
||||
bargainUserInfo.pricePercent = 100 * (bargainUserInfo.price - bargainUserInfo.payPrice) / (bargainUserInfo.price - bargainUserInfo.bargainPrice)
|
||||
this.buyPrice = this.bargainUserInfo.bargainPrice || this.buyPrice;
|
||||
if (bargainUserInfo.bargainPrice >= 0 && this.bargainInfo.bargainMinPrice >= 0) {
|
||||
bargainUserInfo.remainPrice = bargainUserInfo.bargainPrice - this.bargainInfo.bargainMinPrice; // 剩余可砍的金额
|
||||
bargainUserInfo.pricePercent = 100 * (bargainUserInfo.bargainFirstPrice - bargainUserInfo.bargainPrice)
|
||||
/ (bargainUserInfo.bargainFirstPrice - this.bargainInfo.bargainMinPrice)
|
||||
}
|
||||
|
||||
// 获得助力列表
|
||||
@@ -547,8 +553,10 @@
|
||||
var that = this;
|
||||
BargainApi.createBargainRecord(this.id).then(res => {
|
||||
this.storeBargainId = res.data.storeBargainUserId;
|
||||
// 自己给自己助力
|
||||
this.setBargainHelp();
|
||||
// 自己给自己助力 TODO 芋艿:目前自己不能给自己助力
|
||||
// this.setBargainHelp();
|
||||
// 获得拼团记录的最新信息
|
||||
this.gobargainUserInfo();
|
||||
}, error => {
|
||||
that.$util.Tips({
|
||||
title: error
|
||||
|
||||
@@ -459,16 +459,18 @@
|
||||
}, 0);
|
||||
// 计算活动状态
|
||||
const now = new Date().getTime();
|
||||
if (this.activity.status !== 0) {
|
||||
if (this.activity.startTime > now) {
|
||||
this.status = 1;
|
||||
} else if (now <= this.activity.endTime) {
|
||||
this.status = 2;
|
||||
if (this.activity.status === 0) {
|
||||
if (this.activity.status === 1) {
|
||||
this.status = 0;
|
||||
} else {
|
||||
this.status = 3;
|
||||
if (this.activity.startTime > now) {
|
||||
this.status = 1;
|
||||
} else if (now <= this.activity.endTime) {
|
||||
this.status = 2;
|
||||
} else {
|
||||
this.status = 3;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this.status = 0;
|
||||
}
|
||||
// 参团记录
|
||||
CombinationApi.getHeadCombinationRecordList(this.id, 1).then(res => {
|
||||
@@ -572,7 +574,7 @@
|
||||
})
|
||||
},
|
||||
getBrokeragePrice: function() {
|
||||
BrokerageAPI.getProductBrokeragePrice(this.id).then(res => {
|
||||
BrokerageAPI.getProductBrokeragePrice(this.activity.spuId).then(res => {
|
||||
this.sharePacket = res.data
|
||||
});
|
||||
},
|
||||
|
||||
@@ -100,7 +100,7 @@
|
||||
<div class="item" v-for="(item, index) in storeCombinationHost" :key="index" @click="goDetail(item.id)">
|
||||
<div class="pictrue">
|
||||
<img :src="item.picUrl" />
|
||||
<div class="team" v-text="(item.userSize - item.userCount) + '人团'"></div>
|
||||
<div class="team" v-text="(item.userSize) + '人团'"></div>
|
||||
</div>
|
||||
<div class="name line1" v-text="item.spuName"></div>
|
||||
<div class="money font-color-red" v-text="'¥' + fen2yuan(item.combinationPrice)"></div>
|
||||
|
||||
@@ -373,17 +373,19 @@
|
||||
SeckillApi.getSeckillActivity(this.id).then(res => {
|
||||
this.activity = res.data;
|
||||
// 计算活动状态
|
||||
const now = new Date().getTime();
|
||||
if (this.activity.status !== 0) {
|
||||
if (this.activity.startTime > now) {
|
||||
this.status = 1;
|
||||
} else if (now <= this.activity.endTime) {
|
||||
this.status = 2;
|
||||
if (this.activity) {
|
||||
const now = new Date().getTime();
|
||||
if (this.activity.status === 1) {
|
||||
this.status = 0;
|
||||
} else {
|
||||
this.status = 3;
|
||||
if (this.activity.startTime > now) {
|
||||
this.status = 1;
|
||||
} else if (now <= this.activity.endTime) {
|
||||
this.status = 2;
|
||||
} else {
|
||||
this.status = 3;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this.status = 0;
|
||||
}
|
||||
|
||||
// 获得商品详情
|
||||
@@ -640,7 +642,7 @@
|
||||
getProductReplyCount: function() {
|
||||
ProductCommentApi.getCommentStatistics(this.activity.spuId).then(res => {
|
||||
const count = res.data.goodCount + res.data.mediocreCount + res.data.negativeCount;
|
||||
this.$set(this, 'replyChance', 100.0 * res.data.goodCount / count);
|
||||
this.$set(this, 'replyChance', (100.0 * res.data.goodCount / count).toFixed(0));
|
||||
this.$set(this, 'replyCount', count);
|
||||
});
|
||||
},
|
||||
|
||||
@@ -20,8 +20,8 @@
|
||||
<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 class="info" v-if="item.code === 'wallet'">
|
||||
{{item.title}} <span class="money">¥{{ fen2yuan(wallet.balance || 0) }}</span>
|
||||
</view>
|
||||
<view class="info" v-else>{{item.title}}</view>
|
||||
</view>
|
||||
@@ -40,7 +40,9 @@
|
||||
import numberScroll from '@/components/numberScroll.vue'
|
||||
import * as PayOrderApi from '@/api/pay/order.js';
|
||||
import * as PayChannelApi from '@/api/pay/channel.js';
|
||||
export default {
|
||||
import * as WalletApi from '@/api/pay/wallet.js';
|
||||
import {fen2yuan} from "../../../utils/util";
|
||||
export default {
|
||||
components: {
|
||||
CountDown,
|
||||
numberScroll
|
||||
@@ -52,6 +54,8 @@
|
||||
payPrice: 0, // 支付金额
|
||||
invalidTime: 0, // 过期时间
|
||||
|
||||
wallet: {},
|
||||
|
||||
channelCode: '', // 选中的支付渠道
|
||||
channels: [{ // 支付方式
|
||||
name: '微信支付', // 微信公众号
|
||||
@@ -72,6 +76,7 @@
|
||||
name: '余额支付',
|
||||
icon: "icon-yuezhifu",
|
||||
title: '可用余额',
|
||||
code: "wallet"
|
||||
}, {
|
||||
name: '模拟支付',
|
||||
icon: "icon-yuezhifu",
|
||||
@@ -106,6 +111,7 @@
|
||||
this.getCashierOrder()
|
||||
},
|
||||
methods: {
|
||||
fen2yuan,
|
||||
getCashierOrder() {
|
||||
uni.showLoading({
|
||||
title: '加载订单中'
|
||||
@@ -305,6 +311,11 @@
|
||||
this.payType(this.channels[0].code)
|
||||
}
|
||||
})
|
||||
|
||||
// 3. // 获得钱包
|
||||
WalletApi.getPayWallet().then(res=>{
|
||||
this.wallet = res.data;
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 设置支付方式
|
||||
|
||||
@@ -226,7 +226,7 @@
|
||||
<!-- 优惠劵弹窗 -->
|
||||
<couponListWindow
|
||||
:coupon='coupon'
|
||||
@ChangCouponsClone="ChangCouponsClone"
|
||||
@ChangCouponsClose="ChangCouponsClose"
|
||||
@ChangCoupons="ChangCoupons"
|
||||
@tabCouponType="tabCouponType"
|
||||
/>
|
||||
@@ -278,7 +278,6 @@
|
||||
import uQRCode from '@/js_sdk/Sansnn-uQRCode/uqrcode.js'
|
||||
import { toLogin } from '@/libs/login.js';
|
||||
import { mapGetters } from "vuex";
|
||||
import { imageBase64 } from "@/api/public";
|
||||
import productConSwiper from '@/components/productConSwiper';
|
||||
import couponListWindow from '@/components/couponListWindow';
|
||||
import productWindow from '@/components/productWindow';
|
||||
@@ -530,7 +529,7 @@
|
||||
// #ifdef H5
|
||||
this.make();
|
||||
this.ShareInfo();
|
||||
this.getImageBase64();
|
||||
this.imgTop = this.spu.picUrl;
|
||||
// #endif
|
||||
// #ifdef MP
|
||||
this.getQrcode();
|
||||
@@ -779,7 +778,7 @@
|
||||
getProductReplyCount: function() {
|
||||
ProductCommentApi.getCommentStatistics(this.id).then(res => {
|
||||
const count = res.data.goodCount + res.data.mediocreCount + res.data.negativeCount;
|
||||
this.$set(this, 'replyChance', 100.0 * res.data.goodCount / count);
|
||||
this.$set(this, 'replyChance', (100.0 * res.data.goodCount / count).toFixed(0));
|
||||
this.$set(this, 'replyCount', count);
|
||||
});
|
||||
},
|
||||
@@ -820,7 +819,7 @@
|
||||
* 获取优惠券
|
||||
*/
|
||||
getCouponList(useType) {
|
||||
CouponApi.getCouponTemplateList(this.id, useType).then(res => {
|
||||
CouponApi.getCouponTemplateList({spuId: this.id, productScope: useType, count: 10}).then(res => {
|
||||
this.$set(this.coupon, 'list', res.data);
|
||||
})
|
||||
},
|
||||
@@ -838,7 +837,7 @@
|
||||
/**
|
||||
* 关闭优惠劵弹窗
|
||||
*/
|
||||
ChangCouponsClone: function() {
|
||||
ChangCouponsClose: function() {
|
||||
this.$set(this.coupon, 'coupon', false)
|
||||
},
|
||||
/**
|
||||
@@ -1003,16 +1002,6 @@
|
||||
"onMenuShareTimeline"
|
||||
], configAppMessage);
|
||||
},
|
||||
/**
|
||||
* 获得商品的封面 base64
|
||||
*/
|
||||
getImageBase64: function() {
|
||||
imageBase64({
|
||||
url: this.spu.picUrl
|
||||
}).then(res => {
|
||||
this.imgTop = res.data.code;
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 获得小程序的二维码
|
||||
*/
|
||||
|
||||
@@ -16,7 +16,9 @@
|
||||
</view>
|
||||
<view class="text lines1">
|
||||
<view class="name line1">{{ item.name }}</view>
|
||||
<view class="money">¥<text class="num">{{ fen2yuan(item.bargainPrice) }}</text></view>
|
||||
<view class="money">
|
||||
¥<text class="num">{{ fen2yuan(item.bargainMinPrice) }}</text>
|
||||
</view>
|
||||
<view class="btn">参与砍价</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -97,16 +97,16 @@
|
||||
</navigator>
|
||||
</view>
|
||||
<view class="listBox acea-row">
|
||||
<view class="list" :class='item.takeStatus ? "listHui" : "listActive" '
|
||||
v-for="(item, index) in couponList.slice(0,2)" :key="index">
|
||||
<view class="tit line1" :class='item.takeStatus ? "pricehui" : "titActive" '>{{ item.name }}</view>
|
||||
<view class="price" :class='item.takeStatus ? "pricehui" : "icon-color" '>
|
||||
<view class="list" :class='item.canTake ? "listActive" : "listHui"'
|
||||
v-for="(item, index) in couponList" :key="index">
|
||||
<view class="tit line1" :class='item.canTake ? "titActive" : "pricehui"'>{{ item.name }}</view>
|
||||
<view class="price" :class='item.canTake ? "icon-color" : "pricehui"'>
|
||||
<text v-if="item.discountType === 1">{{ fen2yuan(item.discountPrice) }} 元</text>
|
||||
<text v-else>{{ (item.discountPercent / 10.0).toFixed(1) }} 折</text>
|
||||
</view>
|
||||
<view class="ling" v-if="!item.takeStatus" :class='item.takeStatus ? "pricehui" : "icon-color" '
|
||||
<view class="ling icon-color" v-if="item.canTake"
|
||||
@click="getCoupon(item.id,index)">领取</view>
|
||||
<view class="ling" v-else :class='item.takeStatus ? "pricehui fonthui" : "icon-color" '>已领取</view>
|
||||
<view class="ling pricehui fonthui" v-else>已领取</view>
|
||||
<view class="priceM">满{{ fen2yuan(item.usePrice) }}元可用</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -184,6 +184,7 @@
|
||||
import * as DecorateApi from '@/api/promotion/decorate.js';
|
||||
import * as ProductUtil from '@/utils/product.js';
|
||||
import * as Util from '@/utils/util.js';
|
||||
|
||||
export default {
|
||||
computed: mapGetters(['isLogin', 'uid']),
|
||||
components: {
|
||||
@@ -381,7 +382,7 @@
|
||||
* 获得优惠劵列表
|
||||
*/
|
||||
getcouponList() {
|
||||
CouponApi.getCouponTemplateList().then(res => {
|
||||
CouponApi.getCouponTemplateList({ count: 2 }).then(res => {
|
||||
this.$set(this, 'couponList', res.data);
|
||||
}).catch(err => {
|
||||
return this.$util.Tips({
|
||||
@@ -394,7 +395,8 @@
|
||||
*/
|
||||
getCoupon: function(id, index) {
|
||||
CouponApi.takeCoupon(id).then(res => {
|
||||
this.$set(this.couponList[index], 'takeStatus', true);
|
||||
// 设置已领取,即不能再领取
|
||||
this.$set(this.couponList[index], 'canTake', res.data !== true);
|
||||
this.$util.Tips({
|
||||
title: '领取成功'
|
||||
});
|
||||
|
||||
@@ -114,6 +114,8 @@
|
||||
}
|
||||
// #endif
|
||||
});
|
||||
// 增加文章浏览量
|
||||
ArticleApi.addArticleBrowseCount(this.id)
|
||||
},
|
||||
goodInfo(id) {
|
||||
ProductSpuApi.getSpuDetail(id).then(res=>{
|
||||
|
||||
@@ -66,20 +66,18 @@
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- TODO 芋艿:核销的情况 -->
|
||||
<view v-if="orderInfo.deliveryType === 2 && orderInfo.payStatus" class="writeOff borRadius14">
|
||||
<view class="title">核销信息</view>
|
||||
<view class="grayBg">
|
||||
<view class="pictrue">
|
||||
<!-- <div class="qrcode" ref="qrcode"></div> -->
|
||||
<!-- <canvas canvas-id="qrcode" :style="{width: `${qrcodeSize}100%`, height: `${qrcodeSize}100%`}"/> -->
|
||||
<image :src="codeImg"></image>
|
||||
<div class="qrcode" ref="qrcode"></div>
|
||||
<canvas canvas-id="qrcode" :style="{width: `${qrcodeSize}px`, height: `${qrcodeSize}px`}"/>
|
||||
</view>
|
||||
</view>
|
||||
<view class="gear">
|
||||
<image src="../../static/images/writeOff.jpg"></image>
|
||||
</view>
|
||||
<view class="num">{{ orderInfo.verifyCode }}</view>
|
||||
<view class="num">{{ orderInfo.pickUpVerifyCode }}</view>
|
||||
<view class="rules" v-if='system_store.id'>
|
||||
<view class="item">
|
||||
<view class="rulesTitle acea-row row-middle">
|
||||
@@ -259,7 +257,6 @@
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
import { qrcodeApi } from '@/api/order.js';
|
||||
import * as OrderApi from '@/api/trade/order.js';
|
||||
import * as DeliveryApi from '@/api/trade/delivery.js';
|
||||
import { openOrderRefundSubscribe } from '@/utils/SubscribeMessage.js';
|
||||
@@ -271,6 +268,8 @@
|
||||
import { mapGetters } from "vuex";
|
||||
import dayjs from '@/plugin/dayjs/dayjs.min.js';
|
||||
import * as Util from '@/utils/util.js';
|
||||
import uQRCode from '@/js_sdk/Sansnn-uQRCode/uqrcode.js';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
payment,
|
||||
@@ -291,10 +290,7 @@
|
||||
|
||||
// ========== 门店自提(核销) ==========
|
||||
system_store: {}, // 门店信息
|
||||
|
||||
// TODO 芋艿:未整理
|
||||
codeImg: '',
|
||||
qrcodeSize: 100
|
||||
qrcodeSize: 145
|
||||
};
|
||||
},
|
||||
computed: mapGetters(['isLogin', 'chatUrl', 'userInfo']),
|
||||
@@ -363,7 +359,7 @@
|
||||
});
|
||||
}
|
||||
if (this.orderInfo.deliveryType === 2 && this.orderInfo.payStatus) {
|
||||
this.markCode(res.data.verifyCode);
|
||||
this.markCode(res.data.pickUpVerifyCode);
|
||||
}
|
||||
}).catch(err => {
|
||||
uni.hideLoading();
|
||||
@@ -458,19 +454,21 @@
|
||||
});
|
||||
},
|
||||
|
||||
// TODO 芋艿:未整理
|
||||
|
||||
/**
|
||||
* 生成二维码
|
||||
* 生成核销二维码
|
||||
*/
|
||||
markCode(text) {
|
||||
qrcodeApi({
|
||||
height: '145',
|
||||
uQRCode.make({
|
||||
canvasId: 'qrcode',
|
||||
text: text,
|
||||
width: '145'
|
||||
}).then(res => {
|
||||
this.codeImg = res.data.code
|
||||
});
|
||||
size: this.qrcodeSize,
|
||||
margin: 10,
|
||||
fail: res => {
|
||||
this.$util.Tips({
|
||||
title: '核销二维码生成失败!'
|
||||
});
|
||||
}
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 去拼团详情
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
<!-- #endif -->
|
||||
</div>
|
||||
<div class="store-distance" @click.stop="showMaoLocation(item)">
|
||||
<span class="addressTxt" v-if="item.distance">距离{{ item.distance / 1000.0 }}千米</span>
|
||||
<span class="addressTxt" v-if="item.distance">距离{{ item.distance.toFixed(2) }}千米</span>
|
||||
<span class="addressTxt" v-else>查看地图</span>
|
||||
<span class="iconfont icon-youjian" />
|
||||
</div>
|
||||
@@ -136,7 +136,7 @@
|
||||
latitude: Number(e.latitude),
|
||||
longitude: Number(e.longitude),
|
||||
name: e.name,
|
||||
address: `${e.address}-${e.detailedAddress}`,
|
||||
address: `${e.areaName}-${e.detailAddress}`,
|
||||
success: function() {
|
||||
console.log('success');
|
||||
}
|
||||
|
||||
@@ -79,6 +79,7 @@
|
||||
import { mapGetters } from "vuex";
|
||||
import * as TradeOrderApi from '@/api/trade/order.js';
|
||||
import * as AfterSaleApi from '@/api/trade/afterSale.js';
|
||||
import * as TradeConfigApi from '@/api/trade/config.js';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
@@ -94,6 +95,8 @@
|
||||
reasonIndex: 0, // 选中 reasons 的位置
|
||||
|
||||
applyPicUrls: [], // 补充凭证图片
|
||||
|
||||
tradeConfig: {}, // 交易配置
|
||||
};
|
||||
},
|
||||
computed: mapGetters(['isLogin']),
|
||||
@@ -113,23 +116,25 @@
|
||||
toLogin();
|
||||
return;
|
||||
}
|
||||
if (!options.orderId || !options.orderItemId) {
|
||||
return this.$util.Tips({
|
||||
title:'缺少订单id,无法退款'
|
||||
},{
|
||||
tab: 3,
|
||||
url:1
|
||||
});
|
||||
}
|
||||
this.orderId = parseInt(options.orderId);
|
||||
this.orderItemId = parseInt(options.orderItemId);
|
||||
this.getOrderInfo();
|
||||
this.getRefundReason();
|
||||
},
|
||||
if (!options.orderId || !options.orderItemId) {
|
||||
return this.$util.Tips({
|
||||
title:'缺少订单id,无法退款'
|
||||
},{
|
||||
tab: 3,
|
||||
url:1
|
||||
});
|
||||
}
|
||||
this.orderId = parseInt(options.orderId);
|
||||
this.orderItemId = parseInt(options.orderItemId);
|
||||
this.getOrderInfo();
|
||||
this.getRefundReason();
|
||||
this.getTradeConfig();
|
||||
},
|
||||
methods: {
|
||||
onLoadFun:function() {
|
||||
this.getOrderInfo();
|
||||
this.getRefundReason();
|
||||
this.getTradeConfig();
|
||||
},
|
||||
/**
|
||||
* 获取订单详情
|
||||
@@ -147,6 +152,7 @@
|
||||
});
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 更改售后方式
|
||||
*/
|
||||
@@ -165,9 +171,11 @@
|
||||
*/
|
||||
getRefundReason: function() {
|
||||
const way = this.getWay();
|
||||
AfterSaleApi.getAfterSaleReasonList(way).then(res => {
|
||||
this.reasons = res.data;
|
||||
})
|
||||
if (way === 10) {
|
||||
this.reasons = this.tradeConfig.afterSaleRefundReasons || [];
|
||||
} else {
|
||||
this.reasons = this.tradeConfig.afterSaleReturnReasons || [];
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 选择售后原因
|
||||
@@ -175,6 +183,13 @@
|
||||
bindPickerChange: function(e) {
|
||||
this.$set(this, 'reasonIndex', e.detail.value);
|
||||
},
|
||||
getTradeConfig: function () {
|
||||
TradeConfigApi.getTradeConfig().then(res => {
|
||||
this.tradeConfig = res.data || {};
|
||||
this.getRefundReason();
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 删除图片
|
||||
*/
|
||||
|
||||
@@ -50,9 +50,6 @@
|
||||
<div class="tips">
|
||||
<div v-if="current === 0" @click="current = 1">快速登录</div>
|
||||
<div v-if="current === 1" @click="current = 0">账号登录</div>
|
||||
<!-- #ifdef MP-WEIXIN -->
|
||||
<button open-type="getPhoneNumber" type="primary" @getphonenumber="getPhoneNumber">一键登录</button>
|
||||
<!-- #endif -->
|
||||
</div>
|
||||
</div>
|
||||
<div class="bottom"></div>
|
||||
@@ -353,37 +350,6 @@
|
||||
});
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 微信一键登录
|
||||
*/
|
||||
async getPhoneNumber(e) {
|
||||
// 情况一:拒绝授权手机号码
|
||||
const phoneCode = e.detail.code
|
||||
if (!e.detail.code) {
|
||||
uni.showModal({
|
||||
title: '授权失败',
|
||||
content: '您已拒绝获取绑定手机号登录授权,可以使用其他手机号验证登录',
|
||||
confirmText: '知道了',
|
||||
confirmColor: '#3C9CFFFF'
|
||||
})
|
||||
return;
|
||||
}
|
||||
// 情况二:允许授权手机号码
|
||||
const loginCode = await Routine.getCode()
|
||||
AuthApi.weixinMiniAppLogin(phoneCode, loginCode).then(res => {
|
||||
const data = res.data;
|
||||
// TODO 芋艿:refreshToken 机制
|
||||
this.$store.commit("LOGIN", {
|
||||
'token': data.accessToken
|
||||
});
|
||||
this.getUserInfo(data);
|
||||
this.bindBrokerUser();
|
||||
}).catch(e => {
|
||||
this.$util.Tips({
|
||||
title: e
|
||||
});
|
||||
});
|
||||
},
|
||||
getUserInfo(data) {
|
||||
this.$store.commit("SETUID", data.userId);
|
||||
this.$store.commit("OPENID", data.openid);
|
||||
|
||||
@@ -50,14 +50,14 @@
|
||||
<!-- 优惠劵展示 -->
|
||||
<view class='wrapper borRadius14'>
|
||||
<view class='item acea-row row-between-wrapper' @tap='couponTap'
|
||||
v-if="orderInfoVo.type === 1 && productType==='normal'">
|
||||
v-if="orderInfoVo.type === 0 && productType==='normal'">
|
||||
<view>优惠券</view>
|
||||
<view class='discount'>{{couponTitle}}
|
||||
<text class='iconfont icon-jiantou'></text>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 积分展示 -->
|
||||
<view class='item acea-row row-between-wrapper' v-if="orderInfoVo.type === 1 && productType==='normal'">
|
||||
<view class='item acea-row row-between-wrapper' v-if="orderInfoVo.type === 0 && productType==='normal'">
|
||||
<view>积分抵扣</view>
|
||||
<view class='discount acea-row row-middle'>
|
||||
<view> {{pointStatus ? "剩余积分":"当前积分"}}
|
||||
@@ -113,6 +113,10 @@
|
||||
<view>商品总价:</view>
|
||||
<view class='money'>¥{{ fen2yuan(orderInfoVo.price.totalPrice || 0 ) }}</view>
|
||||
</view>
|
||||
<view class='item acea-row row-between-wrapper' v-if="orderInfoVo.price.discountPrice > 0">
|
||||
<view>订单优惠:</view>
|
||||
<view class='money'>-¥{{ fen2yuan(orderInfoVo.price.discountPrice) }}</view>
|
||||
</view>
|
||||
<view class='item acea-row row-between-wrapper' v-if="orderInfoVo.price.couponPrice > 0">
|
||||
<view>优惠券抵扣:</view>
|
||||
<view class='money'>-¥{{ fen2yuan(orderInfoVo.price.couponPrice) }}</view>
|
||||
@@ -139,7 +143,7 @@
|
||||
<!-- 优惠劵的弹窗选择 -->
|
||||
<couponListWindow
|
||||
:coupon='coupon'
|
||||
@ChangCouponsClone="ChangCouponsClone"
|
||||
@ChangCouponsClose="ChangCouponsClose"
|
||||
:openType='openType'
|
||||
@ChangCoupons="ChangCoupons"
|
||||
:orderShow="orderShow"
|
||||
@@ -159,6 +163,7 @@
|
||||
<script>
|
||||
import * as CouponApi from '@/api/promotion/coupon.js';
|
||||
import * as OrderApi from '@/api/trade/order.js';
|
||||
import * as ConfigApi from '@/api/trade/config.js';
|
||||
import { openPaySubscribe } from '@/utils/SubscribeMessage.js';
|
||||
import * as DeliveryApi from '@/api/trade/delivery.js';
|
||||
import couponListWindow from '@/components/couponListWindow';
|
||||
@@ -185,9 +190,9 @@
|
||||
},
|
||||
mark: '', // 备注信息
|
||||
|
||||
bargain: false, // 是否是砍价
|
||||
combination: false, // 是否是拼团
|
||||
secKill: false, // 是否是秒杀
|
||||
bargainRecordId: undefined, // 是否是砍价
|
||||
seckillActivityId: undefined, // 是否是秒杀
|
||||
combinationActivityId: undefined, // 是否是拼团
|
||||
|
||||
// ========== 积分 ==========
|
||||
pointStatus: false, //是否使用积分
|
||||
@@ -248,13 +253,16 @@
|
||||
count: options.count | 1
|
||||
}]
|
||||
}
|
||||
this.seckillActivityId = options.seckillActivityId;
|
||||
this.bargainRecordId = options.bargainRecordId;
|
||||
this.combinationActivityId = options.combinationActivityId;
|
||||
this.getloadPreOrder();
|
||||
|
||||
// 处理 address 地址
|
||||
this.addressId = options.addressId || 0;
|
||||
// 获得门店自提是否开启
|
||||
DeliveryApi.getDeliveryConfig().then(res => {
|
||||
this.store_self_mention = res.data.pickUpEnable && this.productType === 'normal';
|
||||
ConfigApi.getTradeConfig().then(res => {
|
||||
this.store_self_mention = res.data.deliveryPickUpEnabled && this.productType === 'normal';
|
||||
})
|
||||
},
|
||||
/**
|
||||
@@ -361,6 +369,9 @@
|
||||
receiverMobile: this.deliveryType === 2 ? this.contactsTel : undefined,
|
||||
couponId: this.couponId > 0 ? this.couponId : undefined,
|
||||
pointStatus: this.pointStatus,
|
||||
seckillActivityId: this.seckillActivityId,
|
||||
bargainRecordId: this.bargainRecordId,
|
||||
combinationActivityId: this.combinationActivityId,
|
||||
// TODO 芋艿:秒杀等等
|
||||
}
|
||||
},
|
||||
@@ -387,7 +398,10 @@
|
||||
*/
|
||||
getCouponList: function() {
|
||||
CouponApi.getMatchCouponList({
|
||||
// TODO 芋艿:这里应该补充下参数
|
||||
price: this.orderInfoVo.price.payPrice,
|
||||
spuIds: this.orderInfoVo.items.map(item => item.spuId),
|
||||
skuIds: this.orderInfoVo.items.map(item => item.skuId),
|
||||
categoryIds: this.orderInfoVo.items.map(item => item.categoryId)
|
||||
}).then(res => {
|
||||
this.$set(this.coupon, 'list', res.data);
|
||||
// 设置指定优惠劵已选择;用于 couponId 有参数时,默认选中一下
|
||||
@@ -438,7 +452,7 @@
|
||||
/**
|
||||
* 关闭 coupon 优惠劵的选择弹窗
|
||||
*/
|
||||
ChangCouponsClone: function() {
|
||||
ChangCouponsClose: function() {
|
||||
this.$set(this.coupon, 'coupon', false);
|
||||
},
|
||||
|
||||
|
||||
@@ -182,7 +182,7 @@
|
||||
TradeConfigApi.getTradeConfig().then(res => {
|
||||
this.minPrice = Util.fen2yuan(res.data.brokerageWithdrawMinPrice || 0);
|
||||
this.frozenDays = res.data.brokerageFrozenDays || 0;
|
||||
this.withdrawTypes = res.data.brokerageWithdrawType || [];
|
||||
this.withdrawTypes = res.data.brokerageWithdrawTypes || [];
|
||||
this.withdrawType = this.withdrawTypes[0]; // 默认选中第一个提现方式
|
||||
});
|
||||
},
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<view style="height: 106rpx;"></view>
|
||||
<view class='coupon-list' v-if="couponsList.length">
|
||||
<view class='item acea-row row-center-wrapper' v-for="(item,index) in couponsList" :key="index">
|
||||
<view class='money' :class='item.takeStatus ? "moneyGray" : "" '>
|
||||
<view class='money' :class='item.canTake ? "" : "moneyGray"'>
|
||||
<view>¥
|
||||
<text v-if="item.discountType === 1" class='num'>{{ fen2yuan(item.discountPrice) }}</text>
|
||||
<text v-else class='num'>{{ (item.discountPercent / 10.0).toFixed(1) }} 折</text>
|
||||
@@ -18,11 +18,11 @@
|
||||
</view>
|
||||
<view class='text'>
|
||||
<view class='condition line2'>
|
||||
<span class='line-title' :class='(item.takeStatus)?"gray":""'
|
||||
<span class='line-title' :class='item.canTake ? "" : "gray"'
|
||||
v-if='type === 1'>通用</span>
|
||||
<span class='line-title' :class='(item.takeStatus)?"gray":""'
|
||||
<span class='line-title' :class='item.canTake ? "" : "gray"'
|
||||
v-else-if='type === 3'>品类</span>
|
||||
<span class='line-title' :class='(item.takeStatus)?"gray":""' v-else>商品</span>
|
||||
<span class='line-title' :class='item.canTake ? "" : "gray"' v-else>商品</span>
|
||||
<span>{{item.name}}</span>
|
||||
</view>
|
||||
<view class='data acea-row row-between-wrapper'>
|
||||
@@ -30,8 +30,8 @@
|
||||
<view v-else>
|
||||
{{ formatDate(item.validStartTime) + " - " + formatDate(item.validEndTime) }}
|
||||
</view>
|
||||
<view class='bnt gray' v-if="item.takeStatus">已领取</view>
|
||||
<view class='bnt bg-color' v-else @click='getCoupon(item.id, index)'>立即领取</view>
|
||||
<view class='bnt bg-color' v-if="item.canTake" @click='getCoupon(item.id, index)'>立即领取</view>
|
||||
<view class='bnt gray' v-else>已领取</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -111,7 +111,8 @@
|
||||
getCoupon: function(id, index) {
|
||||
// 领取优惠券
|
||||
CouponApi.takeCoupon(id).then(res => {
|
||||
this.couponsList[index].takeStatus = true;
|
||||
// 设置已领取,即不能再领取
|
||||
this.couponsList[index].canTake = res.data;
|
||||
this.$set(this, 'couponsList', this.couponsList);
|
||||
this.$util.Tips({
|
||||
title: '领取成功'
|
||||
@@ -133,7 +134,7 @@
|
||||
CouponApi.getCouponTemplatePage({
|
||||
pageNo: this.page,
|
||||
pageSize: this.limit,
|
||||
useType: this.type
|
||||
productScope: this.type
|
||||
}).then(res => {
|
||||
const list = res.data.list;
|
||||
const loadend = list.length < this.limit;
|
||||
|
||||
@@ -4,37 +4,43 @@
|
||||
<view class="payment-top acea-row row-column row-center-wrapper">
|
||||
<span class="name">我的余额</span>
|
||||
<view class="pic">
|
||||
¥<span class="pic-font">{{ userInfo.nowMoney || 0 }}</span>
|
||||
¥<span class="pic-font">{{ fen2yuan(wallet.balance || 0) }}</span>
|
||||
</view>
|
||||
</view>
|
||||
<view class="payment">
|
||||
<view class="nav acea-row row-around row-middle">
|
||||
<view class="item" :class="active==index?'on':''" v-for="(item,index) in navRecharge" :key="index" @click="navRecharges(index)">{{item}}</view>
|
||||
</view>
|
||||
<!-- 充值 -->
|
||||
<view class='tip picList' v-if='!active'>
|
||||
<view class="pic-box pic-box-color acea-row row-center-wrapper row-column" :class="activePic === index ? 'pic-box-color-active' : ''"
|
||||
v-for="(item, index) in picList" :key="index" @click="picCharge(index, item)">
|
||||
<view class="pic-number-pic">
|
||||
{{ item.price }}<span class="pic-number"> 元</span>
|
||||
{{ fen2yuan(item.payPrice) }}<span class="pic-number"> 元</span>
|
||||
</view>
|
||||
<view class="pic-number">赠送:{{ item.giveMoney }} 元</view>
|
||||
<view class="pic-number">赠送:{{ fen2yuan(item.bonusPrice) }} 元</view>
|
||||
</view>
|
||||
<view class="pic-box pic-box-color acea-row row-center-wrapper" :class="parseFloat(activePic)===parseFloat(picList.length)?'pic-box-color-active':''" @click="picCharge(picList.length)">
|
||||
<input type="number" placeholder="其他" v-model="money" :maxlength="50000" class="pic-box-money pic-number-pic uni-input" :class="parseFloat(activePic) === parseFloat(picList.length) ? 'pic-box-color-active' : ''" />
|
||||
<view class="pic-box pic-box-color acea-row row-center-wrapper" :class="parseFloat(activePic)===parseFloat(picList.length)?'pic-box-color-active':''"
|
||||
@click="picCharge(picList.length)">
|
||||
<input type="number" placeholder="其他" v-model="money" :maxlength="50000" class="pic-box-money pic-number-pic uni-input"
|
||||
:class="parseFloat(activePic) === parseFloat(picList.length) ? 'pic-box-color-active' : ''" />
|
||||
</view>
|
||||
<view class="tips-box">
|
||||
<view class="tips mt-30">注意事项:</view>
|
||||
<view class="tips-samll" v-for="item in rechargeAttention" :key="item">
|
||||
{{ item }}
|
||||
</view>
|
||||
{{ item }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="tip" v-else>
|
||||
<button class='but' formType="submit"> 立即充值 </button>
|
||||
</view>
|
||||
|
||||
<!-- 佣金提现 -->
|
||||
<view class="tip" v-else>
|
||||
<view class='input'><text>¥</text><input placeholder="0.00" type='number' placeholder-class='placeholder' :value="number"
|
||||
name="number"></input></view>
|
||||
<view class="tips-title">
|
||||
<view style="font-weight: bold; font-size: 26rpx;">提示:</view>
|
||||
<view style="margin-top: 10rpx;">当前佣金为 <text class='font-color'>¥{{userInfo.brokeragePrice || 0}}</text></view>
|
||||
<view style="margin-top: 10rpx;">当前佣金为 <text class='font-color'>¥{{ fen2yuan(spreadInfo.brokeragePrice || 0) }}</text></view>
|
||||
</view>
|
||||
<view class="tips-box">
|
||||
<view class="tips mt-30">注意事项:</view>
|
||||
@@ -42,60 +48,46 @@
|
||||
{{ item }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<button class='but' formType="submit"> {{active ? '立即转入': '立即充值' }}</button>
|
||||
<button class='but' formType="submit"> 立即转入 </button>
|
||||
</view>
|
||||
</view>
|
||||
</form>
|
||||
<!-- #ifdef MP -->
|
||||
<!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
|
||||
<!-- #endif -->
|
||||
<home></home>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
rechargeRoutine,
|
||||
rechargeWechat,
|
||||
getRechargeApi,
|
||||
transferIn,
|
||||
appWechat
|
||||
} from '@/api/user.js';
|
||||
import { wechatQueryPayResult } from '@/api/order.js';
|
||||
import {
|
||||
toLogin
|
||||
} from '@/libs/login.js';
|
||||
import {
|
||||
mapGetters
|
||||
} from "vuex";
|
||||
// #ifdef MP
|
||||
import authorize from '@/components/Authorize';
|
||||
// #endif
|
||||
import * as WalletApi from '@/api/pay/wallet.js';
|
||||
import * as BrokerageAPI from '@/api/trade/brokerage.js'
|
||||
import * as Util from '@/utils/util.js';
|
||||
import { toLogin } from '@/libs/login.js';
|
||||
import { mapGetters } from "vuex";
|
||||
import home from '@/components/home';
|
||||
export default {
|
||||
components: {
|
||||
// #ifdef MP
|
||||
authorize,
|
||||
// #endif
|
||||
home
|
||||
},
|
||||
data() {
|
||||
let that = this;
|
||||
return {
|
||||
now_money: 0,
|
||||
wallet: {},
|
||||
spreadInfo: {},
|
||||
|
||||
now_money: 0,
|
||||
navRecharge: ['账户充值', '佣金转入'],
|
||||
active: 0,
|
||||
number: '',
|
||||
placeholder: "0.00",
|
||||
from: '',
|
||||
isAuto: false, //没有授权的不会自动授权
|
||||
isShowAuth: false, //是否隐藏授权
|
||||
picList: [],
|
||||
activePic: 0,
|
||||
money: "",
|
||||
numberPic: '',
|
||||
rechar_id: 0,
|
||||
rechargeAttention: []
|
||||
rechar_id: 0, // 选择的套餐编号
|
||||
rechargeAttention: [
|
||||
'1、充值金额最少为 1 元',
|
||||
'2、充值后只能用于消费',
|
||||
'3、提现金额需要有手续费',
|
||||
'4、提现到账需要 2~3 天时间'
|
||||
]
|
||||
};
|
||||
},
|
||||
computed: mapGetters(['isLogin', 'systemPlatform','userInfo']),
|
||||
@@ -110,23 +102,13 @@
|
||||
}
|
||||
},
|
||||
onLoad(options) {
|
||||
// #ifdef H5
|
||||
this.from = this.$wechat.isWeixin() ? "public" : "weixinh5";
|
||||
// #endif
|
||||
|
||||
if (true) {
|
||||
alert('充值功能暂未实现!预期 10 月份');
|
||||
if (!this.isLogin) {
|
||||
toLogin();
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.isLogin) {
|
||||
this.getRecharge();
|
||||
} else {
|
||||
toLogin();
|
||||
}
|
||||
this.getRecharge();
|
||||
},
|
||||
methods: {
|
||||
|
||||
/**
|
||||
* 选择金额
|
||||
*/
|
||||
@@ -134,47 +116,46 @@
|
||||
this.activePic = idx;
|
||||
if (item === undefined) {
|
||||
this.rechar_id = 0;
|
||||
this.numberPic = "";
|
||||
} else {
|
||||
this.money = "";
|
||||
this.rechar_id = item.id;
|
||||
this.numberPic = item.price;
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* 充值额度选择
|
||||
*/
|
||||
getRecharge() {
|
||||
getRechargeApi()
|
||||
.then(res => {
|
||||
this.picList = res.data.rechargeQuota;
|
||||
if (this.picList[0]) {
|
||||
this.rechar_id = this.picList[0].id;
|
||||
this.numberPic = this.picList[0].price;
|
||||
}
|
||||
this.rechargeAttention = res.data.rechargeAttention || [];
|
||||
})
|
||||
.catch(res => {
|
||||
this.$dialog.toast({
|
||||
mes: res
|
||||
});
|
||||
});
|
||||
},
|
||||
// 获得钱包
|
||||
WalletApi.getPayWallet().then(res=>{
|
||||
this.wallet = res.data;
|
||||
})
|
||||
// 获得佣金
|
||||
BrokerageAPI.getBrokerageUser().then(res => {
|
||||
this.$set(this,'spreadInfo',res.data);
|
||||
});
|
||||
|
||||
// 获得充值套餐
|
||||
WalletApi.getWalletRechargePackageList().then(res => {
|
||||
this.picList = res.data;
|
||||
if (this.picList.length > 0) {
|
||||
this.rechar_id = this.picList[0].id;
|
||||
}
|
||||
}).catch(res => {
|
||||
this.$dialog.toast({
|
||||
mes: res
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
onLoadFun: function() {
|
||||
this.getRecharge();
|
||||
},
|
||||
// 授权关闭
|
||||
authColse: function(e) {
|
||||
this.isShowAuth = e
|
||||
},
|
||||
navRecharges: function(index) {
|
||||
this.active = index;
|
||||
},
|
||||
/*
|
||||
|
||||
/**
|
||||
* 用户充值
|
||||
*/
|
||||
submitSub: function(e) {
|
||||
@@ -182,7 +163,7 @@
|
||||
let value = e.detail.value.number;
|
||||
// 转入余额
|
||||
if (that.active) {
|
||||
if (parseFloat(value) < 0 || parseFloat(value) == NaN || value == undefined || value == "") {
|
||||
if (parseFloat(value) < 0 || parseFloat(value) === NaN || value === undefined || value === "") {
|
||||
return that.$util.Tips({
|
||||
title: '请输入金额'
|
||||
});
|
||||
@@ -191,31 +172,27 @@
|
||||
title: '转入余额',
|
||||
content: '转入余额后无法再次转出,确认是否转入余额',
|
||||
success(res) {
|
||||
if (res.confirm) {
|
||||
transferIn({
|
||||
price: parseFloat(value)
|
||||
}).then(res => {
|
||||
that.$store.commit("changInfo", {
|
||||
amount1: 'brokeragePrice',
|
||||
amount2: that.$util.$h.Sub(that.userInfo.brokeragePrice, parseFloat(value))
|
||||
});
|
||||
return that.$util.Tips({
|
||||
title: '转入成功',
|
||||
icon: 'success'
|
||||
}, {
|
||||
tab: 5,
|
||||
url: '/pages/users/user_money/index'
|
||||
});
|
||||
}).catch(err=>{
|
||||
return that.$util.Tips({
|
||||
title: err
|
||||
});
|
||||
})
|
||||
} else if (res.cancel) {
|
||||
return that.$util.Tips({
|
||||
title: '已取消'
|
||||
});
|
||||
if (!res.confirm) {
|
||||
return that.$util.Tips({
|
||||
title: '已取消'
|
||||
});
|
||||
}
|
||||
BrokerageAPI.createBrokerageWithdraw({
|
||||
type: 1,
|
||||
price: parseFloat(value) * 100
|
||||
}).then(res => {
|
||||
return that.$util.Tips({
|
||||
title: '转入成功',
|
||||
icon: 'success'
|
||||
}, {
|
||||
tab: 5,
|
||||
url: '/pages/users/user_money/index'
|
||||
});
|
||||
}).catch(err=>{
|
||||
return that.$util.Tips({
|
||||
title: err
|
||||
});
|
||||
})
|
||||
},
|
||||
})
|
||||
} else {
|
||||
@@ -223,7 +200,7 @@
|
||||
title: '正在支付',
|
||||
})
|
||||
let money = parseFloat(this.money);
|
||||
if (this.rechar_id == 0) {
|
||||
if (this.rechar_id === 0) {
|
||||
if (Number.isNaN(money)) {
|
||||
return that.$util.Tips({
|
||||
title: '充值金额必须为数字'
|
||||
@@ -231,131 +208,35 @@
|
||||
}
|
||||
if (money <= 0) {
|
||||
return that.$util.Tips({
|
||||
title: '充值金额不能为0'
|
||||
title: '充值金额不能为 0'
|
||||
});
|
||||
}
|
||||
if (money > 50000) {
|
||||
return that.$util.Tips({
|
||||
title: '充值金额最大值为50000'
|
||||
title: '充值金额最大值为 50000'
|
||||
});
|
||||
}
|
||||
} else {
|
||||
money = this.numberPic
|
||||
}
|
||||
// #ifdef MP
|
||||
rechargeRoutine({
|
||||
price: money,
|
||||
type: 0,
|
||||
rechar_id: this.rechar_id
|
||||
WalletApi.createWalletRecharge({
|
||||
payPrice: money ? money * 100 : undefined,
|
||||
packageId: this.rechar_id
|
||||
}).then(res => {
|
||||
uni.hideLoading();
|
||||
let jsConfig = res.data.data.jsConfig;
|
||||
uni.requestPayment({
|
||||
timeStamp: jsConfig.timeStamp,
|
||||
nonceStr: jsConfig.nonceStr,
|
||||
package: jsConfig.packages,
|
||||
signType: jsConfig.signType,
|
||||
paySign: jsConfig.paySign,
|
||||
success: function(res) {
|
||||
that.$store.commit("changInfo", {
|
||||
amount1: 'nowMoney',
|
||||
amount2: that.$util.$h.Add(value, that.userinfo.nowMoney)
|
||||
});
|
||||
//that.$set(that, 'userinfo.nowMoney', that.$util.$h.Add(value, that.userinfo.nowMoney));
|
||||
return that.$util.Tips({
|
||||
title: '支付成功',
|
||||
icon: 'success'
|
||||
}, {
|
||||
tab: 5,
|
||||
url: '/pages/users/user_money/index'
|
||||
});
|
||||
},
|
||||
fail: function(err) {
|
||||
return that.$util.Tips({
|
||||
title: '支付失败'
|
||||
});
|
||||
},
|
||||
complete: function(res) {
|
||||
if (res.errMsg == 'requestPayment:cancel') return that.$util.Tips({
|
||||
title: '取消支付'
|
||||
});
|
||||
}
|
||||
})
|
||||
const returnUrl = encodeURIComponent('/pages/users/user_payment/index');
|
||||
uni.navigateTo({
|
||||
url: `/pages/goods/cashier/index?order_id=${res.data.payOrderId}&returnUrl=${returnUrl}`
|
||||
})
|
||||
}).catch(err => {
|
||||
uni.hideLoading();
|
||||
return that.$util.Tips({
|
||||
title: err
|
||||
})
|
||||
});
|
||||
// #endif
|
||||
// #ifdef H5
|
||||
rechargeWechat({
|
||||
price: money,
|
||||
from: that.from,
|
||||
rechar_id: that.rechar_id,
|
||||
payType: 0
|
||||
}).then(res => {
|
||||
let jsConfig = res.data.jsConfig;
|
||||
let orderNo = res.data.orderNo;
|
||||
let data = {
|
||||
timestamp:jsConfig.timeStamp,
|
||||
nonceStr:jsConfig.nonceStr,
|
||||
package:jsConfig.packages,
|
||||
signType:jsConfig.signType,
|
||||
paySign:jsConfig.paySign
|
||||
};
|
||||
if (that.from == "weixinh5") {
|
||||
let domain = encodeURIComponent(location.href.split('/pages')[0]);
|
||||
let urls = jsConfig.mwebUrl + '&redirect_url='+ domain + '/pages/users/user_money/index';
|
||||
location.replace(urls);
|
||||
return that.$util.Tips({
|
||||
tab: 5,
|
||||
url: '/pages/users/user_money/index'
|
||||
});
|
||||
// return that.$util.Tips({
|
||||
// title: '支付成功',
|
||||
// icon: 'success'
|
||||
// }, {
|
||||
// tab: 5,
|
||||
// url: '/pages/users/user_money/index'
|
||||
// });
|
||||
} else {
|
||||
that.$wechat.pay(data)
|
||||
.finally(() => {
|
||||
that.$store.commit("changInfo", {
|
||||
amount1: 'nowMoney',
|
||||
amount2: that.$util.$h.Add(value, that.userinfo.nowMoney)
|
||||
});
|
||||
// that.$set(that, 'userinfo.nowMoney', that.$util.$h.Add(value, that.userinfo.nowMoney));
|
||||
wechatQueryPayResult(orderNo).then(res => {
|
||||
return that.$util.Tips({
|
||||
title: '支付成功',
|
||||
icon: 'success'
|
||||
}, {
|
||||
tab: 5,
|
||||
url: '/pages/users/user_money/index'
|
||||
});
|
||||
}).cache(err => {
|
||||
return that.$util.Tips({
|
||||
title: err
|
||||
});
|
||||
})
|
||||
})
|
||||
.catch(function(err) {
|
||||
return that.$util.Tips({
|
||||
title: '支付失败'
|
||||
});
|
||||
});
|
||||
}
|
||||
}).catch(res=>{
|
||||
uni.hideLoading();
|
||||
return that.$util.Tips({
|
||||
title: res
|
||||
});
|
||||
})
|
||||
// #endif
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
fen2yuan(price) {
|
||||
return Util.fen2yuan(price)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -60,7 +60,14 @@
|
||||
<view class='name line1'>第 {{item.day}} 天签到积分奖励</view>
|
||||
<view class='data'>{{ formatDate(item.createTime) }}</view>
|
||||
</view>
|
||||
<view class='num font-color'>+{{ item.point }}</view>
|
||||
<view>
|
||||
<view class='num font-color' v-if="item.point > 0">
|
||||
<span class="num-title">积分</span> +{{ item.point }}
|
||||
</view>
|
||||
<view class='num font-color' v-if="item.experience > 0">
|
||||
<span class="num-title">经验</span> +{{ item.experience }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class='loading' @click='goSignList' v-if="signRecordList.length >= 3">
|
||||
点击加载更多 <text class='iconfont icon-xiangyou' />
|
||||
@@ -73,7 +80,8 @@
|
||||
<view class='signTipLight loadingpic'></view>
|
||||
<view class='signTipCon'>
|
||||
<view class='state'>签到成功</view>
|
||||
<view class='integral'>获得{{ point }}积分</view>
|
||||
<view class='integral' v-if="signResult.point > 0">获得{{ signResult.point }}积分</view>
|
||||
<view class='integral' v-if="signResult.experience > 0">获得{{ signResult.experience }}经验</view>
|
||||
<view class='signTipBnt' @click='close'>好的</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -98,7 +106,7 @@
|
||||
signRecordList: [], // 签到记录
|
||||
|
||||
active: false, // 签到提示
|
||||
point: 0, // 刚签到获得的奖励
|
||||
signResult: 0, // 签到的结果
|
||||
};
|
||||
},
|
||||
computed: mapGetters(['isLogin', 'userInfo']),
|
||||
@@ -176,7 +184,7 @@
|
||||
}
|
||||
SignInApi.createSignInRecord().then(res => {
|
||||
this.active = true;
|
||||
this.point = res.data.point;
|
||||
this.signResult = res.data;
|
||||
// 重新获得签到信息
|
||||
this.getSignInfo();
|
||||
this.getSignList();
|
||||
@@ -420,6 +428,11 @@
|
||||
margin-top: 9rpx;
|
||||
}
|
||||
|
||||
.sign .list3 .item .num-title {
|
||||
font-size: 10rpx;
|
||||
margin-right: 8rpx;
|
||||
}
|
||||
|
||||
.sign .list3 .item .num {
|
||||
font-size: 36rpx;
|
||||
font-family: 'Guildford Pro';
|
||||
|
||||
@@ -9,7 +9,14 @@
|
||||
<view class='name line1'>第 {{item.day}} 天签到积分奖励</view>
|
||||
<view>{{ formatDate(item.createTime) }}</view>
|
||||
</view>
|
||||
<view class='num font-color'>+{{ item.point }}</view>
|
||||
<view>
|
||||
<view class='num font-color' v-if="item.point > 0">
|
||||
<span class="num-title">积分</span> +{{ item.point }}
|
||||
</view>
|
||||
<view class='num font-color' v-if="item.experience > 0">
|
||||
<span class="num-title">经验</span> +{{ item.experience }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -92,4 +99,9 @@
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.sign-record .list .item .num-title {
|
||||
font-size: 10rpx;
|
||||
margin-right: 8rpx;
|
||||
}
|
||||
|
||||
</style>
|
||||
@@ -42,7 +42,6 @@
|
||||
import { getQrcode } from '@/api/api.js';
|
||||
// #endif
|
||||
import home from '@/components/home';
|
||||
import { imageBase64 } from "@/api/public";
|
||||
import * as TradeConfigApi from '@/api/trade/config.js';
|
||||
export default {
|
||||
components: {
|
||||
@@ -131,13 +130,7 @@
|
||||
let posterUrls = []
|
||||
// 生成一个Promise对象的数组
|
||||
images.forEach(item => {
|
||||
// TODO @芋艿:imageBase64 这里是为了下载图片的 base64;后续看看可以前端直接操作不;
|
||||
const oneApi = imageBase64({
|
||||
url: item.pic
|
||||
}).then(res => {
|
||||
return res.data.code;
|
||||
})
|
||||
posterUrls.push(oneApi)
|
||||
posterUrls.push(item.pic)
|
||||
})
|
||||
Promise.all(posterUrls).then(result => {
|
||||
that.$set(that, 'base64List', result);
|
||||
|
||||
@@ -23,6 +23,9 @@
|
||||
<!-- #ifdef MP -->
|
||||
<button hover-class="none" @tap="getUserProfile" class="bg-green btn1">微信登录</button>
|
||||
<!-- #endif -->
|
||||
<!-- #ifdef MP-WEIXIN -->
|
||||
<button open-type="getPhoneNumber" type="primary" @getphonenumber="getPhoneNumber">一键登录</button>
|
||||
<!-- #endif -->
|
||||
<!-- <button hover-class="none" @click="isUp = true" class="btn2">手机号登录</button> -->
|
||||
</view>
|
||||
</view>
|
||||
@@ -40,12 +43,11 @@
|
||||
const app = getApp();
|
||||
let statusBarHeight = uni.getSystemInfoSync().statusBarHeight + 'px';
|
||||
import * as UserApi from "@/api/member/user";
|
||||
import * as AuthApi from "@/api/member/auth";
|
||||
import mobileLogin from '@/components/login_mobile/index.vue'
|
||||
import routinePhone from '@/components/login_mobile/routine_phone.vue'
|
||||
import {
|
||||
getLogo,
|
||||
getUserPhone
|
||||
} from '@/api/public';
|
||||
import * as BrokerageAPI from '@/api/trade/brokerage.js'
|
||||
import { getUserPhone } from '@/api/public';
|
||||
import Routine from '@/libs/routine';
|
||||
import wechat from "@/libs/wechat";
|
||||
export default {
|
||||
@@ -56,7 +58,7 @@
|
||||
statusBarHeight: statusBarHeight,
|
||||
isHome: false,
|
||||
isPhoneBox: false,
|
||||
logoUrl: '',
|
||||
// logoUrl: '',
|
||||
code: '',
|
||||
authKey: '',
|
||||
options: '',
|
||||
@@ -72,9 +74,9 @@
|
||||
routinePhone
|
||||
},
|
||||
onLoad(options) {
|
||||
getLogo().then(res => {
|
||||
this.logoUrl = res.data.logoUrl
|
||||
})
|
||||
// getLogo().then(res => {
|
||||
// this.logoUrl = res.data.logoUrl
|
||||
// })
|
||||
|
||||
// #ifdef H5
|
||||
document.body.addEventListener("focusout", () => {
|
||||
@@ -141,52 +143,14 @@
|
||||
tab: 3
|
||||
})
|
||||
});
|
||||
},
|
||||
bindBrokerUser() {
|
||||
const spread = this.$Cache.get("spread");
|
||||
if (spread > 0) {
|
||||
BrokerageAPI.bindBrokerageUser(spread)
|
||||
}
|
||||
},
|
||||
// #ifdef MP
|
||||
// 小程序获取手机号码
|
||||
getphonenumber(e) {
|
||||
uni.showLoading({
|
||||
title: '正在登录中'
|
||||
});
|
||||
Routine.getCode()
|
||||
.then(code => {
|
||||
this.getUserPhoneNumber(e.detail.encryptedData, e.detail.iv, code);
|
||||
})
|
||||
.catch(error => {
|
||||
uni.$emit('closePage', false)
|
||||
uni.hideLoading();
|
||||
});
|
||||
},
|
||||
// 小程序获取手机号码回调
|
||||
getUserPhoneNumber(encryptedData, iv, code) {
|
||||
getUserPhone({
|
||||
encryptedData: encryptedData,
|
||||
iv: iv,
|
||||
code: code,
|
||||
type: 'routine',
|
||||
key: this.authKey
|
||||
})
|
||||
.then(res => {
|
||||
this.$store.commit('LOGIN', {
|
||||
token: res.data.token
|
||||
});
|
||||
this.$store.commit("SETUID", res.data.uid);
|
||||
this.getUserInfo();
|
||||
this.$util.Tips({
|
||||
title: '登录成功',
|
||||
icon: 'success'
|
||||
}, {
|
||||
tab: 3
|
||||
})
|
||||
|
||||
})
|
||||
.catch(res => {
|
||||
uni.hideLoading();
|
||||
that.$util.Tips({
|
||||
title: res
|
||||
});
|
||||
});
|
||||
},
|
||||
getUserProfile() {
|
||||
let self = this;
|
||||
uni.showLoading({
|
||||
@@ -206,52 +170,37 @@
|
||||
uni.hideLoading();
|
||||
});
|
||||
},
|
||||
|
||||
getWxUser(code, res) {
|
||||
let self = this
|
||||
let userInfo = res.userInfo;
|
||||
userInfo.code = code;
|
||||
userInfo.spread_spid = app.globalData.spid; //获取推广人ID
|
||||
userInfo.spread_code = app.globalData.code; //获取推广人分享二维码ID
|
||||
userInfo.avatar = userInfo.userInfo.avatarUrl;
|
||||
userInfo.city = userInfo.userInfo.city;
|
||||
userInfo.country = userInfo.userInfo.country;
|
||||
userInfo.nickName = userInfo.userInfo.nickName;
|
||||
userInfo.province = userInfo.userInfo.province;
|
||||
userInfo.sex = userInfo.userInfo.gender;
|
||||
userInfo.type = 'routine'
|
||||
Routine.authUserInfo(userInfo.code, userInfo)
|
||||
.then(res => {
|
||||
self.authKey = res.data.key;
|
||||
if (res.data.type === 'register') {
|
||||
uni.hideLoading();
|
||||
self.isPhoneBox = true
|
||||
}
|
||||
if (res.data.type === 'login') {
|
||||
uni.hideLoading();
|
||||
self.$store.commit('LOGIN', {
|
||||
token: res.data.token
|
||||
});
|
||||
self.$store.commit("SETUID", res.data.uid);
|
||||
self.getUserInfo();
|
||||
self.$util.Tips({
|
||||
title: res,
|
||||
icon: 'success'
|
||||
}, {
|
||||
tab: 3
|
||||
})
|
||||
}
|
||||
})
|
||||
.catch(res => {
|
||||
uni.hideLoading();
|
||||
uni.showToast({
|
||||
title: res,
|
||||
icon: 'none',
|
||||
duration: 2000
|
||||
});
|
||||
});
|
||||
|
||||
},
|
||||
/**
|
||||
* 微信一键登录
|
||||
*/
|
||||
async getPhoneNumber(e) {
|
||||
// 情况一:拒绝授权手机号码
|
||||
const phoneCode = e.detail.code
|
||||
if (!e.detail.code) {
|
||||
uni.showModal({
|
||||
title: '授权失败',
|
||||
content: '您已拒绝获取绑定手机号登录授权,可以使用其他手机号验证登录',
|
||||
confirmText: '知道了',
|
||||
confirmColor: '#3C9CFFFF'
|
||||
})
|
||||
return;
|
||||
}
|
||||
// 情况二:允许授权手机号码
|
||||
const loginCode = await Routine.getCode()
|
||||
AuthApi.weixinMiniAppLogin(phoneCode, loginCode).then(res => {
|
||||
const data = res.data;
|
||||
// TODO 芋艿:refreshToken 机制
|
||||
this.$store.commit("LOGIN", {
|
||||
'token': data.accessToken
|
||||
});
|
||||
this.getUserInfo();
|
||||
this.bindBrokerUser();
|
||||
}).catch(e => {
|
||||
this.$util.Tips({
|
||||
title: e
|
||||
});
|
||||
});
|
||||
},
|
||||
// #endif
|
||||
|
||||
// #ifdef H5
|
||||
|
||||
@@ -36,4 +36,24 @@ export const BrokerageWithdrawTypeEnum = {
|
||||
name: '支付宝',
|
||||
icon: 'icon-icon34'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/** 终端的枚举 */
|
||||
export const TerminalEnum = {
|
||||
WECHAT_MINI_PROGRAM: {
|
||||
terminal: 10,
|
||||
name: '微信小程序'
|
||||
},
|
||||
WECHAT_WAP: {
|
||||
terminal: 11,
|
||||
name: '微信公众号'
|
||||
},
|
||||
H5: {
|
||||
terminal: 20,
|
||||
name: 'H5 网页'
|
||||
},
|
||||
APP: {
|
||||
terminal: 31,
|
||||
name: '手机 App'
|
||||
}
|
||||
}
|
||||
@@ -9,6 +9,7 @@ import {
|
||||
checkLogin
|
||||
} from '../libs/login';
|
||||
import store from '../store';
|
||||
import {getTerminal} from "./util";
|
||||
|
||||
// TODO 芋艿:临时解决 uniapp 在小程序,undefined 会被 tostring 的问题
|
||||
function deleteUndefinedProperties(obj) {
|
||||
@@ -37,6 +38,7 @@ function baseRequest(url, method, data, {
|
||||
if (!noAuth) {
|
||||
//登录过期自动登录
|
||||
if (!store.state.app.token && !checkLogin()) {
|
||||
// debugger
|
||||
toLogin();
|
||||
return Promise.reject({
|
||||
msg: '未登录'
|
||||
@@ -52,10 +54,15 @@ function baseRequest(url, method, data, {
|
||||
...header
|
||||
}
|
||||
header['tenant-id'] = 1
|
||||
header['Authorization'] = 'Bearer test247'
|
||||
}
|
||||
|
||||
if (store.state.app.token) header[TOKENNAME] = store.state.app.token;
|
||||
// 终端
|
||||
header['terminal'] = getTerminal()
|
||||
|
||||
if (store.state.app.token) {
|
||||
// header[TOKENNAME] = store.state.app.token;
|
||||
header['Authorization'] = 'Bearer ' + store.state.app.token;
|
||||
}
|
||||
return new Promise((reslove, reject) => {
|
||||
uni.request({
|
||||
// url: url.indexOf('app-api') < 0 ? Url + '/api/front/' + url
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
import { HTTP_REQUEST_URL } from '@/config/app.js';
|
||||
import {TerminalEnum} from "./dict";
|
||||
import wechat from "../libs/wechat";
|
||||
|
||||
export default {
|
||||
|
||||
@@ -814,3 +816,23 @@ export function handleTree(data, id, parentId, children, rootId) {
|
||||
});
|
||||
return treeData !== '' ? treeData : data;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取终端类型
|
||||
* https://uniapp.dcloud.net.cn/tutorial/platform.html#preprocessor
|
||||
*
|
||||
* @return {number | null} 终端类型
|
||||
*/
|
||||
export function getTerminal() {
|
||||
let terminal = null;
|
||||
// #ifdef MP-WEIXIN
|
||||
terminal = TerminalEnum.WECHAT_MINI_PROGRAM.terminal
|
||||
// #endif
|
||||
// #ifdef H5 || WEB
|
||||
terminal = wechat.isWeixin() ? TerminalEnum.WECHAT_WAP.terminal : TerminalEnum.H5.terminal
|
||||
// #endif
|
||||
// #ifdef APP-PLUS || APP
|
||||
terminal = TerminalEnum.APP.terminal
|
||||
// #endif
|
||||
return terminal;
|
||||
}
|
||||