1.新增代理商兑换码功能

2.新增工会卡充值
yj-dev
杨杰 3 years ago
parent 3ab836e5e6
commit 087440ba61
  1. 5
      Utils/Api.js
  2. 484
      components/QS-tabs/QS-tabs.vue
  3. 18
      pages/goods/coupons-info-details/coupons-info-details.vue
  4. 2
      pages/pay/payment/payment.vue
  5. 18
      pages/user/agentCoupons/agentCoupons.vue
  6. 248
      pages/user/cardDes/cardDes.vue
  7. 382
      pages/user/minePromotion/minePromotion.vue
  8. 23
      pages/user/order_list/order_list.vue
  9. 312
      pages/userLogin/userLogin.vue
  10. 95
      subPages/trade-union-recharge/trade-union-recharge.vue
  11. 4
      uni.scss

@ -342,7 +342,10 @@ export const generateCode = params => {
export const highremark = params => { export const highremark = params => {
return POSTBREST('POST', `${brestBase}/highCouponAgent/remark`, params).then(res => res.data); return POSTBREST('POST', `${brestBase}/highCouponAgent/remark`, params).then(res => res.data);
} }
//查询兑换码
export const getAgentConvertCodeCount = params => {
return POSTBREST('GET', `${brestBase}/highCouponAgent/getAgentConvertCodeCount`, params).then(res => res.data);
}
// 查看二维码 // 查看二维码
export const getCodeById = params => { export const getCodeById = params => {
return POSTBREST('GET', `${brestBase}/highCouponAgent/getCodeById`, params).then(res => res.data); return POSTBREST('GET', `${brestBase}/highCouponAgent/getCodeById`, params).then(res => res.data);

@ -0,0 +1,484 @@
<template>
<view class="QS-tabs" :style="{
'z-index': zIndex,
'font-size': getFontSize + 'rpx',
'background-color': getBgColor,
'transition-duration': getDuration + 's'
}">
<scroll-view scroll-x class="QS-tabs-scroll" :scroll-left="left" scroll-with-animation :style="{
'z-index': (Number(zIndex) + 1)
}">
<view class="QS-tabs-scroll-box">
<!-- 循环tabs -->
<view class="QS-tabs-scroll-item" :style="{
'height':'100rpx',
'line-height': getHeight + 'rpx',
'min-width': getWidth + 'rpx',
'padding': '0 ' + space + 'rpx',
'color': index===getCurrent?getActiveColor:getDefaultColor,
'font-weight': activeBold&&index===getCurrent?'bold':'',
'transition-duration': getDuration + 's',
'z-index': (Number(zIndex) + 2)
}"
v-for="(item, index) in getTabs" :key="index" @tap="emit(index)" :id="preId + index">
<!-- line1 -->
<view v-if="animationMode==='line1'" class="boxStyle" :style="getDurationStyle +( index===getCurrent?getActiveStyle:getDefaultStyle)"></view>
{{item.name || item}}
</view>
<!-- itemBackground -->
<view v-if="hasItemBackground" class="itemBackgroundBox" :style="{
'height': getHeight + 'rpx',
'width': (isLine3&&tabsInfo[animationFinishCurrent]?tabsInfo[animationFinishCurrent].width:tabsInfo[getCurrent].width) + 'px',
'z-index': Number(zIndex) + 1,
'transition-duration': getDuration + 's',
'left': (tabsInfo[getCurrent]?tabsInfo[getCurrent].left:0) + 'px'
}">
<view class="itemBackground" :style="'transition-duration:' + getDuration + 's;' +
'background-color:' + getItemBackgroundColor + ';' +
'box-shadow: 0 0 5rpx 5rpx ' + getItemBackgroundColor + ';' +
itemBackgroundStyle + ';'" />
</view>
<!-- line2 -->
<view v-if="animationMode==='line2'" class="boxStyle2" :style="getLinezIndex + getDurationStyle +
'width:' + lW + 'px;' +
'background-color:' + (lineColor||getActiveColor) + ';' +
line2Style + ';' +
'left:' + line2Dx + 'px;'" />
<view v-if="animationMode==='line3'" class="boxStyle2" :style="getLinezIndex +
'width:' + lW + 'px;' +
'background-color:' + (lineColor||getActiveColor) + ';' +
line2Style + ';' +
'left:' + getLine3Dx + 'px'" />
</view>
</scroll-view>
</view>
</template>
<script>
const {
windowWidth
} = uni.getSystemInfoSync();
const preId = 'QSTabsID_';
export default {
props: {
tabs: { //
type: Array,
default () {
return [];
}
},
current: { // index
type: Number,
default: 0
},
height: { //QS-tabs
type: [String, Number],
default: 80
},
minWidth: { //tab //v1.4
type: [String, Number],
default: 250
},
fontSize: { //
type: [String, Number],
default: 30
},
duration: { //, s
type: [String, Number],
default: .5
},
activeColor: { //
type: String,
default: '#33cc33'
},
defaultColor: { //
type: String,
default: '#888'
},
animationLineWidth: { //线
type: [String, Number],
default: 20
},
line2Style: { //line2线
type: String,
default: 'height: 8rpx;border-radius: 4rpx;'
},
animationMode: { //
type: String,
default: 'line1'
},
autoCenter: { //
type: Boolean,
default: true
},
autoCenterMode: { //
type: String,
default: 'component'
},
activeStyle: { //line1
type: String,
default: 'bottom:0;left:50%;transform: translate(-50%,-100%);height: 8rpx;border-radius:4rpx;'
},
defaultStyle: { //line1
type: String,
default: 'bottom:0;left:50%;transform: translate(-50%,-100%);height: 8rpx;border-radius:4rpx;'
},
backgroundColor: { //
type: String,
default: 'rgba(255,255,255,0)'
},
hasItemBackground: { //
type: Boolean,
default: false
},
itemBackgroundColor: { //
type: String,
default: 'rgba(255,255,255,0)'
},
itemBackgroundStyle: { //
type: String,
default: ''
},
zIndex: { //cssz-index
type: [String, Number],
default: 99
},
swiperWidth: { //line3, swiper, rpx
type: [String, Number],
default: 750
},
space: { //tab
type: [String, Number],
default: '0'
},
activeBold: { //tab
type: Boolean,
default: true
},
lineColor: { //line
type: String,
default: ''
}
},
computed: {
isLine3() {
return this.animationMode === 'line3';
},
getCurrent() {
const current = Number(this.current);
if (current > (this.getTabs.length - 1)) {
return (this.getTabs.length - 1)
}
return current;
},
getTabs() {
return this.tabs;
},
getHeight() {
return Number(this.height);
},
getWidth() {
return Number(this.minWidth);
},
getFontSize() {
return this.fontSize;
},
getDuration() {
return Number(this.duration);
},
getBgColor() {
const defaultColor = this.backgroundColor || 'rgba(255,255,255,0)';
if (this.getTabs[this.getCurrent] instanceof Object) {
return this.getTabs[this.getCurrent].backgroundColor || defaultColor;
} else {
return defaultColor;
}
},
getItemBackgroundColor() {
const defaultColor = this.itemBackgroundColor || 'rgba(255,255,255,0)';
if (this.getTabs[this.getCurrent] instanceof Object) {
return this.getTabs[this.getCurrent].itemBackgroundColor || defaultColor;
} else {
return defaultColor;
}
},
getDurationStyle() {
return `transition-duration: ${this.getDuration}s;`
},
getActiveColor() {
let activeColor;
if (this.getTabs[this.getCurrent] instanceof Object) {
if (this.getTabs[this.getCurrent].activeColor) {
activeColor = this.getTabs[this.getCurrent].activeColor;
} else {
activeColor = this.activeColor;
}
} else {
activeColor = this.activeColor;
}
return activeColor;
},
getDefaultColor() {
let defaultColor;
if (this.getTabs[this.getCurrent] instanceof Object) {
if (this.getTabs[this.getCurrent].defaultColor) {
defaultColor = this.getTabs[this.getCurrent].defaultColor;
} else {
defaultColor = this.defaultColor;
}
} else {
defaultColor = this.defaultColor;
}
return defaultColor;
},
getActiveStyle() {
return `width:${this.animationLineWidth}%;background-color:${this.getActiveColor};${this.activeStyle};`;
},
getDefaultStyle() {
return `width:0;background-color:${this.getActiveColor};${this.defaultStyle};`;
},
getLinezIndexNum() {
return Number(this.zIndex) + 2;
},
getLinezIndex() {
return `z-index: ${this.getLinezIndexNum};`;
},
getLine3Dx() {
return Number(this.line3Dx) + Number(this.line3AddDx);
}
},
watch: {
current(n, o) {
this.change(n);
},
tabs() {
this.init();
}
},
data() {
return {
left: 0,
tabsInfo: [],
line2Width: Number(this.animationLineWidth),
setTimeoutFc: null,
componentsWidth: 0,
animationFinishCurrent: this.current,
pxWidth: 0,
lW: 0,
sW: 0,
preId,
line3Dx: 0,
line3AddDx: 0,
line2Dx: 0
}
},
// #ifndef H5
onReady() {
this.init();
},
// #endif
// #ifdef H5
mounted() {
this.init();
},
// #endif
methods: {
init() {
this.countPx();
let view = uni.createSelectorQuery().in(this);
for (let i = 0; i < this.tabs.length; i++) {
view.select('#' + preId + i).boundingClientRect();
}
view.exec((res) => {
const arr = [];
for (let i = 0; i < res.length; i++) {
arr.push(res[i]);
}
this.tabsInfo = arr;
this.countLine2Dx();
this.countLine3Dx();
let _this = this;
_this.getQuery(() => {
_this.countScrollX();
});
})
},
countLine2Dx() {
if (this.animationMode === 'line2') {
const tab = this.tabsInfo[this.getCurrent];
if(tab) this.line2Dx = tab.left + tab.width / 2 - this.lW / 2;
}
},
countLine3Dx() {
if (this.animationMode === 'line3') {
const tab = this.tabsInfo[this.animationFinishCurrent];
if(tab) this.line3Dx = tab.left + tab.width / 2 - this.lW / 2;
}
},
countPx() {
const w = uni.upx2px(this.getWidth);
this.pxWidth = w;
this.lW = (w * (Number(this.animationLineWidth) / 100))+72.5;
this.sW = uni.upx2px(Number(this.swiperWidth));
},
emit(index) {
this.$emit('change', index);
},
change() {
this.countScrollX();
if (this.animationMode === 'line2') {
this.line2Width = 2;
if (this.setTimeoutFc) clearTimeout(this.setTimeoutFc);
this.setTimeoutFc = setTimeout(() => {
this.line2Width = this.animationLineWidth;
}, this.getDuration * 1000 * 3 / 5);
this.countLine2Dx();
}
},
getQuery(cb) {
try {
let view = uni.createSelectorQuery().in(this).select('.QS-tabs');
view.fields({
size: true
}, data => {
if (data) {
this.componentsWidth = data.width;
if (cb && typeof cb === 'function') cb(data);
} else {
this.retryGetQuery(cb);
}
}).exec();
} catch (e) {
//TODO handle the exception
this.componentsWidth = windowWidth;
}
},
retryGetQuery(cb) {
try {
let view = uni.createSelectorQuery().select('.QS-tabs');
view.fields({
size: true
}, data => {
if (data) {
this.componentsWidth = data.width;
} else {
this.componentsWidth = windowWidth;
}
if (cb && typeof cb === 'function') cb(data);
}).exec();
} catch (e) {
//TODO handle the exception
this.componentsWidth = windowWidth;
}
},
countScrollX() {
if (this.autoCenter) {
let tab;
if(this.isLine3) {
tab = this.tabsInfo[this.animationFinishCurrent];
}else{
tab = this.tabsInfo[this.getCurrent];
}
if(tab) {
let tabCenter = tab.left + tab.width/2;
let fatherWidth;
if (this.autoCenterMode === 'window') {
fatherWidth = windowWidth;
} else {
fatherWidth = this.componentsWidth;
}
this.left = tabCenter - fatherWidth / 2;
}
}
},
setDx(dx) {
const tab = this.tabsInfo[dx>0?(this.animationFinishCurrent + 1):(this.animationFinishCurrent - 1)];
this.line3AddDx = dx / this.sW * (tab?tab.width:this.pxWidth);
},
setFinishCurrent(current) {
this.line3AddDx = 0;
this.animationFinishCurrent = current;
this.countLine3Dx();
}
}
}
</script>
<style scoped>
view,
scroll-view {
box-sizing: border-box;
}
.QS-tabs {
width: 100%;
transition-property: background-color, color;
}
.QS-tabs::-webkit-scrollbar {
display: none;
width: 0 !important;
height: 0 !important;
-webkit-appearance: none;
background: transparent;
}
.QS-tabs-scroll {
width: 100%;
white-space: nowrap;
position: relative;
}
.QS-tabs-scroll-box {
position: relative;
display: flex;
white-space: nowrap !important;
display: block !important;
}
.QS-tabs-scroll-item {
position: relative;
display: inline-block;
text-align: center;
transition-property: background-color, color, font-weight;
}
.content {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.boxStyle {
pointer-events: none;
position: absolute;
transition-property: all;
}
.boxStyle2 {
pointer-events: none;
position: absolute;
bottom: 0;
transition-property: all;
transform: translateY(-100%);
}
.itemBackgroundBox {
pointer-events: none;
position: absolute;
top: 0;
transition-property: left, background-color;
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
}
.itemBackground {
height: 100%;
width: 100%;
transition-property: all;
}
</style>

@ -27,18 +27,26 @@
备注:{{couponDesInfo.couponAgentCode.remark}}</view> 备注:{{couponDesInfo.couponAgentCode.remark}}</view>
<view class="line1 mart15"></view> <view class="line1 mart15"></view>
<view class="width100" v-if="couponDesInfo.highUserCoupon"> <view class="width100" v-if="couponDesInfo.couponAgentCode.type == 1">
<view class="width90 mart10 fcor666" v-if="couponDesInfo.highUserCoupon.status != 0">核销码(商户扫客户)</view> <view class="width90 mart10 fcor666">核销码(商户扫客户)</view>
<view class="mart20 fotct fcorred font15 marb20" v-if="couponDesInfo.highUserCoupon.status != 0"> <view class="mart20 fotct fcorred font15 marb20">
请告知加油员用码商支付</view> 请告知加油员用码商支付</view>
<view class="width90 mart20 fotct" v-if="couponDesInfo.highUserCoupon.status != 0"> <view class="width90 mart20 fotct">
<image class="coupon-qr" :src="imageUrl+'couponCode/'+couponDesInfo.couponCode.ext1"></image> <image class="coupon-qr" :src="imageUrl+'couponCode/'+couponDesInfo.couponCode.ext1"></image>
</view> </view>
</view> </view>
<view class="width90" v-else> <view class="width90" v-if="couponDesInfo.couponAgentCode.status !=3 && couponDesInfo.couponAgentCode.type != 1">
<view class="width90 mart10 fcor666" >点击下方复制按钮,复制兑换码发送用户</view> <view class="width90 mart10 fcor666" >点击下方复制按钮,复制兑换码发送用户</view>
<view class="mart30 fotct font18 marb20 fcor666">{{couponDesInfo.couponAgentCode.convertCode}}</view> <view class="mart30 fotct font18 marb20 fcor666">{{couponDesInfo.couponAgentCode.convertCode}}</view>
<view class="btn90w mart40" @click="copycont(couponDesInfo.couponAgentCode.convertCode)">复制兑换码</view> <view class="btn90w mart40" @click="copycont(couponDesInfo.couponAgentCode.convertCode)">复制兑换码</view>
</view>
<view class="width90" v-if="couponDesInfo.couponCode.status ==3 && couponDesInfo.couponAgentCode.type != 1">
<view class="mart20 fotct fcorred font15 marb20">
请告知加油员用码商支付</view>
<view class="width90 mart20 fotct">
<image class="coupon-qr" :src="imageUrl+'couponCode/'+couponDesInfo.couponCode.ext1"></image>
</view>
<view class="mart30 fotct font18 marb20 fcor666">{{couponDesInfo.couponAgentCode.convertCode}}</view>
</view> </view>
<view class="height60"></view> <view class="height60"></view>
</view> </view>

@ -29,7 +29,7 @@
<radio :checked="paytype=='jinbi'" color="#0083f5" /> <radio :checked="paytype=='jinbi'" color="#0083f5" />
</view> </view>
</view> </view>
<view class="row" @tap="paytype='gonghuika'" v-if="goodsType != 2"> <view class="row" @tap="paytype='gonghuika'" v-if="goodsType != 2 && goodsType != 8">
<view class="left"> <view class="left">
<image style="border-radius: 50%;" src="../../../static/img/ghkpay.png"></image> <image style="border-radius: 50%;" src="../../../static/img/ghkpay.png"></image>
</view> </view>

@ -31,9 +31,9 @@
<button class="flright backcorf06 fcorfff font15 agent_btn mart10" @click="generateCode(agent.id)" <button class="flright backcorf06 fcorfff font15 agent_btn mart10" @click="generateCode(agent.id)"
v-if="typeId == 1 && typeid == 2">生成兑换码</button> v-if="typeId == 1 && typeid == 2">生成兑换码</button>
<button class="flright backcorf06 fcorfff font15 agent_btn mart10" @click="jumpCouponDes(agent.id)" <button class="flright backcorf06 fcorfff font15 agent_btn mart10" @click="jumpCouponDes(agent.id)"
v-if="typeId == 2 && typeid == 2">查看详情</button> v-if="typeId == 2 && (typeid == 2 || typeid == 3) ">查看详情</button>
<view class="agent_ts font15 fcor333 fotlt text1" <view class="agent_ts font15 fcor333 fotlt text1"
v-if="typeId == 2 && typeid == 2 && agent.remark !=null "> v-if="typeId == 2 && (typeid == 2 || typeid == 3) && agent.remark !=null ">
备注:{{agent.remark}}</view> 备注:{{agent.remark}}</view>
</view> </view>
</view> </view>
@ -127,7 +127,7 @@
return false; return false;
} }
let pagenum = this.pageNum; let pagenum = this.pageNum;
let params; let params;
if (this.typeId == 1) { if (this.typeId == 1) {
if (this.typeid == 1) { if (this.typeid == 1) {
params = { params = {
@ -155,11 +155,19 @@
type: 1, type: 1,
pageSize: this.pageSize pageSize: this.pageSize
} }
} else { } else if(this.typeid == 2){
params = { params = {
pageNum: pagenum, pageNum: pagenum,
couponId: this.couponId, couponId: this.couponId,
status: '2,3', status: 2,
type: 2,
pageSize: this.pageSize
}
}else if(this.typeid == 3){
params = {
pageNum: pagenum,
couponId: this.couponId,
status: 3,
type: 2, type: 2,
pageSize: this.pageSize pageSize: this.pageSize
} }

@ -1,121 +1,129 @@
<template> <template>
<view> <view>
<view class="width90 mart20 fotct" v-if="user.hltCardNo.cardNo"> <view class="width90 mart20 fotct" v-if="user.hltCardNo.cardNo">
<image :src="imagewxUrl+imgadres" mode="widthFix" class="cardImg"></image> <image :src="imagewxUrl+imgadres" mode="widthFix" class="cardImg"></image>
<view class="cardlabel font18 fcorfff fontwig6" style="top: 50px;">卡号 : {{user.hltCardNo.cardNo}}</view> <view class="cardlabel font18 fcorfff fontwig6" style="top: 50px;">卡号 : {{user.hltCardNo.cardNo}}</view>
<view class="cardlabel font18 fcorfff fontwig6" style="top: 80px;">余额 : {{tongCardPrice}}</view> <view class="cardlabel font18 fcorfff fontwig6" style="top: 80px;">余额 : {{tongCardPrice}}</view>
</view> </view>
<view class="btnw50 font20 fontlet" @click="selectCards()">查询明细</view> <view class="btnw50 font20 fontlet" @click="selectCards()">查询明细</view>
<view class="btnw50 font20 fontlet" @click="delUserCard()" v-if="user.hltCardNo">解绑</view> <view class="btnw50 font20 fontlet" @click="unionCardPay()">充值余额</view>
</view> <view class="btnw50 font20 fontlet" @click="delUserCard()" v-if="user.hltCardNo">解绑</view>
</template> </view>
</template>
<script>
import { <script>
delUserCard, import {
getHuiLianTongCardBalance delUserCard,
} from '../../../Utils/Api.js'; getHuiLianTongCardBalance
let app = getApp(); } from '../../../Utils/Api.js';
export default { let app = getApp();
data() { export default {
return { data() {
user: '', return {
tongCardPrice:0, user: '',
imagewxUrl: app.globalData.imageWxImg, tongCardPrice: 0,
imgadres: 'cards.jpg', imagewxUrl: app.globalData.imageWxImg,
} imgadres: 'cards.jpg',
}, }
onShow() { },
this.user = app.globalData.userInfo; onShow() {
if (!this.user.isSetHltCard) { this.user = app.globalData.userInfo;
uni.showToast({ if (!this.user.isSetHltCard) {
icon: 'none', uni.showToast({
title: '当前账号还未绑定,前往绑定', icon: 'none',
duration: 2000, title: '当前账号还未绑定,前往绑定',
success() { duration: 2000,
setTimeout(() => { success() {
uni.navigateTo({ setTimeout(() => {
url: '../bindingCard/bindingCard' uni.navigateTo({
}) url: '../bindingCard/bindingCard'
}, 1000) })
} }, 1000)
}); }
return; });
} return;
this.getHuiLianTongCardBalance(); }
}, this.getHuiLianTongCardBalance();
methods: { },
// methods: {
selectCards() { //
uni.navigateTo({ selectCards() {
url: '../unionCard/unionCard' uni.navigateTo({
}) url: '../unionCard/unionCard'
}, })
// },
delUserCard() { //
let that = this; delUserCard() {
uni.showModal({ let that = this;
content: '是否确定解除当前绑定卡号?', uni.showModal({
success: (res) => { content: '是否确定解除当前绑定卡号?',
if (res.confirm) { success: (res) => {
let params = { if (res.confirm) {
cardNo: that.user.hltCardNo.cardNo let params = {
} cardNo: that.user.hltCardNo.cardNo
delUserCard(params).then(res => { }
if (res.return_code == '000000') { delUserCard(params).then(res => {
uni.showToast({ if (res.return_code == '000000') {
title: '解除成功', uni.showToast({
duration: 2000, title: '解除成功',
icon: 'success', duration: 2000,
success() { icon: 'success',
setTimeout(() => { success() {
uni.navigateBack({}) setTimeout(() => {
}, 1000) uni.navigateBack({})
} }, 1000)
}) }
} else { })
uni.showToast({ } else {
title: res.return_msg, uni.showToast({
duration: 2000, title: res.return_msg,
icon: 'none' duration: 2000,
}) icon: 'none'
} })
}); }
} else if (res.cancel) { });
console.log('用户点击取消'); } else if (res.cancel) {
} console.log('用户点击取消');
} }
}); }
}, });
// },
getHuiLianTongCardBalance() { //
let params = { getHuiLianTongCardBalance() {
cardNo: this.user.hltCardNo.cardNo let params = {
} cardNo: this.user.hltCardNo.cardNo
getHuiLianTongCardBalance(params).then(res => { }
if (res.return_code == '000000') { getHuiLianTongCardBalance(params).then(res => {
this.tongCardPrice = res.return_data.balance; if (res.return_code == '000000') {
} this.tongCardPrice = res.return_data.balance;
}
});
}, });
} },
} //
</script> unionCardPay() {
uni.navigateTo({
<style lang="scss"> url: '../../../subPages/trade-union-recharge/trade-union-recharge?cardId=' + this.user
page { .hltCardNo.cardNo
background-color: #f8f8f8; })
} }
}
.cardImg { }
position: relative; </script>
margin-top: 5px;
margin-bottom: 5px; <style lang="scss">
} page {
background-color: #f8f8f8;
.cardlabel { }
position: absolute;
left: 13%; .cardImg {
} position: relative;
margin-top: 5px;
margin-bottom: 5px;
}
.cardlabel {
position: absolute;
left: 13%;
}
</style> </style>

@ -18,148 +18,228 @@
<view class="width50 flright font15 fcor666 fontwig6 fotrt">今日流水</view> <view class="width50 flright font15 fcor666 fontwig6 fotrt">今日流水</view>
</view> </view>
</view> </view>
<!-- // --> <view class="mart70">
<view class="width100 mart80"> <QSTabs ref="tabs" :tabs="tabs" animationMode="line2" :current="current" @change="change"
<view class="width90 mart10 fcor333 font14 fontwig6 height22"> activeColor="#089bf5" lineColor="#089bf5" minWidth="374">
<view class="promotion_xg flleft"></view> </QSTabs>
<view class="promotion_mixg flleft" style="margin-left: -6px;"></view> <view class="line1"></view>
<view class="flleft promotoin_text font16" style="margin-top: -2px;">库存管理</view>
<view class="promotion_mixg flleft"></view>
<view class="promotion_xg flleft" style="margin-left: -6px;"></view>
</view>
</view> </view>
<view class="promotion_kc width90 mart10">
<image class="flleft pro_img mart15 margle" :src="imagewxUrl+imgadres"> <!-- // -->
</image> <view class="width100" v-if="current == 0">
<view class="pro_cont paddtop15"> <view class="width100 mart20">
<view class="flleft font16 fcor333 fontwig6 pro_title"> <view class="width90 mart10 fcor333 font14 fontwig6 height22">
剩余库存({{mineproList.laveStockCount}}) <view class="promotion_xg flleft"></view>
</view> <view class="promotion_mixg flleft" style="margin-left: -6px;"></view>
<view class="pro_price fotrt fcor333 font15 fontwig6"> <view class="flleft promotoin_text font16" style="margin-top: -2px;">库存管理</view>
总计 ¥{{mineproList.surplusCountPrice}} <view class="promotion_mixg flleft"></view>
<view class="promotion_xg flleft" style="margin-left: -6px;"></view>
</view> </view>
</view> </view>
<!-- //:class="[index==0?'colorfe':'']" --> <view class="promotion_kc width90 mart10">
<view v-if="minepros == ''" class="width90">暂无数据</view> <image class="flleft pro_img mart15 margle" :src="imagewxUrl+imgadres">
<view v-for="(mers,index) in minepros" :key="mers.id" class="pro_mok marb10 colore7" </image>
@click="jumpAgent(1,mers.couponId,1)"> <view class="pro_cont paddtop15">
<view class="width100 font14 fcor333 fontwig6 fotct paddtop10"> <view class="flleft font16 fcor333 fontwig6 pro_title">
面额{{mers.salesPrice}} 剩余库存({{agentList.laveStockCount}})
</view>
<view class="pro_price fotrt fcor333 font15 fontwig6">
总计 ¥{{agentList.surplusCountPrice}}
</view>
</view> </view>
<view class="width100 font14 fcor999 fotct mart10"> <!-- //:class="[index==0?'colorfe':'']" -->
{{mers.stockCount}} <view v-if="minepros == ''" class="width90">暂无数据</view>
<view v-for="(mers,index) in minepros" :key="mers.id" class="pro_mok marb10 colore7"
@click="jumpAgent(1,mers.couponId,1)">
<view class="width100 font14 fcor333 fontwig6 fotct paddtop10">
面额{{mers.salesPrice}}
</view>
<view class="width100 font14 fcor999 fotct mart10">
{{mers.stockCount}}
</view>
<view class="width100 font15 fcor333 fontwig6 fotct mart10">
{{mers.salesPrice*mers.stockCount}}
</view>
</view> </view>
<view class="width100 font15 fcor333 fontwig6 fotct mart10">
{{mers.salesPrice*mers.stockCount}}
</view>
</view>
</view>
<!-- // -->
<view class="width100 mart20">
<view class="width90 mart10 fcor333 font14 fontwig6 height22">
<view class="promotion_xg flleft"></view>
<view class="promotion_mixg flleft" style="margin-left: -6px;"></view>
<view class="flleft promotoin_text font16" style="margin-top: -2px;">销售统计</view>
<view class="promotion_mixg flleft"></view>
<view class="promotion_xg flleft" style="margin-left: -6px;"></view>
</view> </view>
</view> <!-- // -->
<view class="promotion_kc width90 mart10"> <view class="width100 mart20">
<image class="flleft pro_img mart15 margle" :src="imagewxUrl+imgadres"> <view class="width90 mart10 fcor333 font14 fontwig6 height22">
</image> <view class="promotion_xg flleft"></view>
<view class="pro_cont paddtop15"> <view class="promotion_mixg flleft" style="margin-left: -6px;"></view>
<view class="flleft font16 fcor333 fontwig6 pro_title"> <view class="flleft promotoin_text font16" style="margin-top: -2px;">销售统计</view>
已销售({{mineproList.soldCount}}) <view class="promotion_mixg flleft"></view>
</view> <view class="promotion_xg flleft" style="margin-left: -6px;"></view>
<view class="pro_price fotrt fcor333 font15 fontwig6">
总计 ¥{{mineproList.salesCountPrice}}
</view> </view>
</view> </view>
<view v-if="minepros == ''" class="width90">暂无数据</view> <view class="promotion_kc width90 mart10">
<!-- // --> <image class="flleft pro_img mart15 margle" :src="imagewxUrl+imgadres">
<view v-for="(mers,index) in minepros" :key="mers.id" class="pro_mok marb10 colore9" </image>
@click="jumpAgent(2,mers.couponId,1)"> <view class="pro_cont paddtop15">
<view class="width100 font14 fcor333 fontwig6 fotct paddtop10"> <view class="flleft font16 fcor333 fontwig6 pro_title">
面额{{mers.salesPrice}} 已销售({{agentList.soldCount}})
</view>
<view class="pro_price fotrt fcor333 font15 fontwig6">
总计 ¥{{agentList.salesCountPrice}}
</view>
</view> </view>
<view class="width100 font14 fcor999 fotct mart10"> <view v-if="minepros == ''" class="width90">暂无数据</view>
{{mers.salesCount}} <!-- // -->
</view> <view v-for="(mers,index) in minepros" :key="mers.id" class="pro_mok marb10 colore9"
<view class="width100 font15 fcor333 fontwig6 fotct mart10"> @click="jumpAgent(2,mers.couponId,1)">
{{mers.salesPrice*mers.salesCount}} <view class="width100 font14 fcor333 fontwig6 fotct paddtop10">
面额{{mers.salesPrice}}
</view>
<view class="width100 font14 fcor999 fotct mart10">
{{mers.salesCount}}
</view>
<view class="width100 font15 fcor333 fontwig6 fotct mart10">
{{mers.salesPrice*mers.salesCount}}
</view>
</view> </view>
</view> </view>
</view> </view>
<!-- 兑换码库存 --> <!-- 兑换码库存 -->
<view class="width100 mart20"> <view class="width100" v-if="current == 1">
<view class="width90 mart10 fcor333 font14 fontwig6 height22"> <view class="width100 mart20">
<view class="promotion_xg flleft"></view> <view class="width90 mart10 fcor333 font14 fontwig6 height22">
<view class="promotion_mixg flleft" style="margin-left: -6px;"></view> <view class="promotion_xg flleft"></view>
<view class="flleft promotoin_text font16" style="margin-top: -2px;">兑换码库存</view> <view class="promotion_mixg flleft" style="margin-left: -6px;"></view>
<view class="promotion_mixg flleft"></view> <view class="flleft promotoin_text font16" style="margin-top: -2px;">销售统计</view>
<view class="promotion_xg flleft" style="margin-left: -6px;"></view> <view class="promotion_mixg flleft"></view>
<view class="promotion_xg flleft" style="margin-left: -6px;"></view>
</view>
</view> </view>
</view> <view class="promotion_kc width90 mart10">
<view class="promotion_kc width90 mart10"> <image class="flleft pro_img mart15 margle" :src="imagewxUrl+imgadres">
<image class="flleft pro_img mart15 margle" :src="imagewxUrl+imgadres"> </image>
</image> <view class="pro_cont paddtop15">
<view class="pro_cont paddtop15"> <view class="flleft font16 fcor333 fontwig6 pro_title">
<view class="flleft font16 fcor333 fontwig6 pro_title"> 待销售({{couponList.noSalesNum}})
待使用({{codeList.laveStockCount}}) </view>
<view class="pro_price fotrt fcor333 font15 fontwig6">
总计 ¥{{couponList.noSalesPrice}}
</view>
</view> </view>
<view class="pro_price fotrt fcor333 font15 fontwig6"> <view v-if="couponCont == ''" class="width90">暂无数据</view>
总计 ¥{{codeList.surplusCountPrice}} <view v-for="(mers,index) in couponCont" :key="mers.id" class="pro_mok marb10 colore7"
@click="jumpAgent(1,mers.couponId,2)">
<view class="width100 font14 fcor333 fontwig6 fotct paddtop10">
面额{{mers.salesPrice}}
</view>
<view class="width100 font14 fcor999 fotct mart10">
{{mers.stockCount}}
</view>
<view class="width100 font15 fcor333 fontwig6 fotct mart10">
{{mers.salesPrice*mers.stockCount}}
</view>
</view> </view>
</view> </view>
<!-- //:class="[index==0?'colorfe':'']" --> <!-- 兑换码统计 -->
<view v-if="checkcodeList == ''" class="width90">暂无数据</view> <!-- <view class="width100 mart20">
<view v-for="(mers,index) in checkcodeList" :key="mers.id" class="pro_mok marb10 colore7" <view class="width90 mart10 fcor333 font14 fontwig6 height22">
@click="jumpAgent(1,mers.couponId,2)"> <view class="promotion_xg flleft"></view>
<view class="width100 font14 fcor333 fontwig6 fotct paddtop10"> <view class="promotion_mixg flleft" style="margin-left: -6px;"></view>
面额{{mers.salesPrice}} <view class="flleft promotoin_text font16" style="margin-top: -2px;">销售统计</view>
<view class="promotion_mixg flleft"></view>
<view class="promotion_xg flleft" style="margin-left: -6px;"></view>
</view> </view>
<view class="width100 font14 fcor999 fotct mart10"> </view> -->
{{mers.stockCount}} <view class="promotion_kc width90 mart20">
<image class="flleft pro_img mart15 margle" :src="imagewxUrl+imgadres">
</image>
<view class="pro_cont paddtop15">
<view class="flleft font16 fcor333 fontwig6 pro_title">
已销售({{couponList.salesNum}})
</view>
<view class="pro_price fotrt fcor333 font15 fontwig6">
总计 ¥{{couponList.salesPrice}}
</view>
</view> </view>
<view class="width100 font15 fcor333 fontwig6 fotct mart10"> <view v-if="couponCont == ''" class="width90">暂无数据</view>
{{mers.salesPrice*mers.stockCount}} <!-- // -->
<view v-for="(mers,index) in couponCont" :key="mers.id" class="pro_mok marb10 colore9"
@click="jumpAgent(2,mers.couponId,2)">
<view class="width100 font14 fcor333 fontwig6 fotct paddtop10">
面额{{mers.salesPrice}}
</view>
<view class="width100 font14 fcor999 fotct mart10">
{{mers.noUsedNum}}
</view>
<view class="width100 font15 fcor333 fontwig6 fotct mart10">
{{mers.noUsedPrice}}
</view>
</view> </view>
</view> </view>
</view>
<!-- 兑换码统计 --> <view class="width100 mart20">
<view class="width100 mart20"> <view class="width90 mart10 fcor333 font14 fontwig6 height22">
<view class="width90 mart10 fcor333 font14 fontwig6 height22"> <view class="promotion_xg flleft"></view>
<view class="promotion_xg flleft"></view> <view class="promotion_mixg flleft" style="margin-left: -6px;"></view>
<view class="promotion_mixg flleft" style="margin-left: -6px;"></view> <view class="flleft promotoin_text font16" style="margin-top: -2px;">使用统计</view>
<view class="flleft promotoin_text font16" style="margin-top: -2px;">兑换码统计</view> <view class="promotion_mixg flleft"></view>
<view class="promotion_mixg flleft"></view> <view class="promotion_xg flleft" style="margin-left: -6px;"></view>
<view class="promotion_xg flleft" style="margin-left: -6px;"></view> </view>
</view> </view>
</view> <view class="promotion_kc width90 mart20">
<view class="promotion_kc width90 mart10"> <image class="flleft pro_img mart15 margle" :src="imagewxUrl+imgadres">
<image class="flleft pro_img mart15 margle" :src="imagewxUrl+imgadres"> </image>
</image> <view class="pro_cont paddtop15">
<view class="pro_cont paddtop15"> <view class="flleft font16 fcor333 fontwig6 pro_title">
<view class="flleft font16 fcor333 fontwig6 pro_title"> 待使用({{couponList.noUsedNum}})
已使用({{codeList.soldCount}}) </view>
<view class="pro_price fotrt fcor333 font15 fontwig6">
总计 ¥{{couponList.noUsedPrice}}
</view>
</view> </view>
<view class="pro_price fotrt fcor333 font15 fontwig6"> <view v-if="couponCont == ''" class="width90">暂无数据</view>
总计 ¥{{codeList.salesCountPrice}} <view v-for="(mers,index) in couponCont" :key="mers.id" class="pro_mok marb10 colore7"
@click="jumpAgent(2,mers.couponId,2)">
<view class="width100 font14 fcor333 fontwig6 fotct paddtop10">
面额{{mers.salesPrice}}
</view>
<view class="width100 font14 fcor999 fotct mart10">
{{mers.noUsedNum}}
</view>
<view class="width100 font15 fcor333 fontwig6 fotct mart10">
{{mers.noUsedPrice}}
</view>
</view> </view>
</view> </view>
<view v-if="checkcodeList == ''" class="width90">暂无数据</view> <!-- 兑换码统计 -->
<!-- // --> <!-- <view class="width100 mart20">
<view v-for="(mers,index) in checkcodeList" :key="mers.id" class="pro_mok marb10 colore9" <view class="width90 mart10 fcor333 font14 fontwig6 height22">
@click="jumpAgent(2,mers.couponId,2)"> <view class="promotion_xg flleft"></view>
<view class="width100 font14 fcor333 fontwig6 fotct paddtop10"> <view class="promotion_mixg flleft" style="margin-left: -6px;"></view>
面额{{mers.salesPrice}} <view class="flleft promotoin_text font16" style="margin-top: -2px;">使用统计</view>
<view class="promotion_mixg flleft"></view>
<view class="promotion_xg flleft" style="margin-left: -6px;"></view>
</view> </view>
<view class="width100 font14 fcor999 fotct mart10"> </view> -->
{{mers.salesCount}} <view class="promotion_kc width90 mart20">
<image class="flleft pro_img mart15 margle" :src="imagewxUrl+imgadres">
</image>
<view class="pro_cont paddtop15">
<view class="flleft font16 fcor333 fontwig6 pro_title">
已使用({{couponList.usedNum}})
</view>
<view class="pro_price fotrt fcor333 font15 fontwig6">
总计 ¥{{couponList.usedPrice}}
</view>
</view> </view>
<view class="width100 font15 fcor333 fontwig6 fotct mart10"> <view v-if="couponCont == ''" class="width90">暂无数据</view>
{{mers.salesPrice*mers.salesCount}} <!-- // -->
<view v-for="(mers,index) in couponCont" :key="mers.id" class="pro_mok marb10 colore9"
@click="jumpAgent(2,mers.couponId,3)">
<view class="width100 font14 fcor333 fontwig6 fotct paddtop10">
面额{{mers.salesPrice}}
</view>
<view class="width100 font14 fcor999 fotct mart10">
{{mers.usedNum}}
</view>
<view class="width100 font15 fcor333 fontwig6 fotct mart10">
{{mers.usedPrice}}
</view>
</view> </view>
</view> </view>
</view> </view>
@ -169,51 +249,88 @@
<script> <script>
import { import {
getAgentCount getAgentCount,
getAgentConvertCodeCount
} from "../../../Utils/Api.js"; } from "../../../Utils/Api.js";
import QSTabs from '../../../components/QS-tabs/QS-tabs.vue';
let app = getApp(); let app = getApp();
export default { export default {
components: {
QSTabs
},
data() { data() {
return { return {
imagewxUrl: app.globalData.imageWxImg, imagewxUrl: app.globalData.imageWxImg,
imgadres: 'wenj.png', imgadres: 'wenj.png',
agentList: [], // agentList: [], //
minepros: [], // minepros: [], //
mineproList: [], // couponList:[], //
checkcodeList: [], // couponCont:[], //
codeList: [] // tabs: ["销售码", "兑换码"], //
current: 0, //
} }
}, },
onLoad() {
onShow() {
this.getAgentCount(1); this.getAgentCount(1);
this.getAgentCount(2); this.getAgentConvertCodeCount();
}, },
methods: { methods: {
// //
getAgentCount(item) { getAgentCount(item) {
uni.showLoading({
title: '加载中'
})
let datas = { let datas = {
type: item type: item
} }
getAgentCount(datas).then(res => { getAgentCount(datas).then(res => {
uni.hideLoading();
if (res.return_code == '000000') { if (res.return_code == '000000') {
this.agentList = res.return_data; this.agentList = res.return_data;
if (item == 1) { this.minepros = res.return_data.list;
this.minepros = res.return_data.list;
this.mineproList = res.return_data;
} else {
this.checkcodeList = res.return_data.list;
this.codeList = res.return_data
}
} else { } else {
this.agentList = [];
this.minepros = [];
uni.showToast({ uni.showToast({
title: res.return_msg, title: res.return_msg,
icon: "none" icon: "none",
duration: 2000
}) })
} }
}) })
}, },
//
getAgentConvertCodeCount() {
uni.showLoading({
title: '加载中'
})
getAgentConvertCodeCount().then(res => {
uni.hideLoading();
if (res.return_code == '000000' && res.return_data) {
this.couponList = res.return_data;
this.couponCont = res.return_data.list;
} else {
uni.showToast({
title: res.return_msg,
icon: "none",
duration: 2000
})
this.couponList = [];
this.couponCont = [];
}
});
},
//
change(index) {
this.$refs.tabs.setFinishCurrent(index);
this.swiperCurrent = index;
this.current = index;
if (index == 0) {
this.getAgentCount(1);
} else {
this.getAgentConvertCodeCount();
}
},
// //
jumpRunWater() { jumpRunWater() {
uni.navigateTo({ uni.navigateTo({
@ -226,6 +343,7 @@
url: '../agentCoupons/agentCoupons?id=' + item + '&couponsId=' + items + '&typeid=' + itemtype url: '../agentCoupons/agentCoupons?id=' + item + '&couponsId=' + items + '&typeid=' + itemtype
}) })
}, },
//
toPage(page) { toPage(page) {
uni.navigateTo({ uni.navigateTo({
url: '../../login/resetpasswd' url: '../../login/resetpasswd'

@ -15,34 +15,39 @@
<view class="row" v-for="(row,index) in orderList" :key="index"> <view class="row" v-for="(row,index) in orderList" :key="index">
<view class="width96 height40" @click="jumpDetails(row.id)"> <view class="width96 height40" @click="jumpDetails(row.id)">
<view class="width50 flleft aliitem fotlt font16" <view class="width50 flleft aliitem fotlt font16"
v-if="row.highChildOrderList[0].goodsType == 1 || row.highChildOrderList[0].goodsType == 2"> v-if="row.highChildOrderList[0].goodsType == 1">
<image src="../../../static/img/order2.png" style="width: 50rpx;height: 50rpx;"></image> <image src="../../../static/img/order2.png" class="marglerig" style="width: 50rpx;height: 50rpx;"></image>
卡券订单 卡券订单
</view> </view>
<view class="width50 flleft aliitem fotlt font16"
v-if="row.highChildOrderList[0].goodsType == 2">
<image src="../../../static/img/order2.png" class="marglerig" style="width: 50rpx;height: 50rpx;"></image>
积分充值
</view>
<view class="width50 flleft aliitem fotlt font16" <view class="width50 flleft aliitem fotlt font16"
v-if="row.highChildOrderList[0].goodsType == 7"> v-if="row.highChildOrderList[0].goodsType == 7">
<image src="../../../static/img/order9.png" style="width: 50rpx;height: 50rpx;"></image> <image src="../../../static/img/order9.png" class="marglerig" style="width: 50rpx;height: 50rpx;"></image>
优惠券包 优惠券包
</view> </view>
<view class="width50 flleft aliitem fotlt font16" <view class="width50 flleft aliitem fotlt font16"
v-if="row.highChildOrderList[0].goodsType == 3"> v-if="row.highChildOrderList[0].goodsType == 3">
<image src="../../../static/img/order4.png" style="width: 50rpx;height: 50rpx;"></image> <image src="../../../static/img/order4.png" class="marglerig" style="width: 50rpx;height: 50rpx;"></image>
团油订单 团油订单
</view> </view>
<view class="width50 flleft aliitem fotlt font16" <view class="width50 flleft aliitem fotlt font16"
v-if="row.highChildOrderList[0].goodsType == 5"> v-if="row.highChildOrderList[0].goodsType == 5">
<image src="../../../static/img/order5.png" style="width: 50rpx;height: 50rpx;"></image> <image src="../../../static/img/order5.png" class="marglerig" style="width: 50rpx;height: 50rpx;"></image>
电影票 电影票
</view> </view>
<view class="width50 flleft aliitem fotlt font16" <view class="width50 flleft aliitem fotlt font16"
v-if="row.highChildOrderList[0].goodsType == 4"> v-if="row.highChildOrderList[0].goodsType == 4">
<image src="../../../static/img/order3.png" style="width: 50rpx;height: 50rpx;"></image> <image src="../../../static/img/order3.png" class="marglerig" style="width: 50rpx;height: 50rpx;"></image>
KFC KFC
</view> </view>
<view class="width50 flleft aliitem fotlt font16" <view class="width50 flleft aliitem fotlt font16"
v-if="row.highChildOrderList[0].goodsType == 6"> v-if="row.highChildOrderList[0].goodsType == 8">
<image src="../../../static/img/order1.png" style="width: 50rpx;height: 50rpx;"></image> <image src="../../../static/img/ghkpay.png" class="marglerig" style="width: 50rpx;height: 50rpx;"></image>
话费充值 工会卡充值
</view> </view>
<view class="width50 flright fotrt fcor666 font15"> <view class="width50 flright fotrt fcor666 font15">
{{row.createTime | formatDate('-')}} {{row.createTime | formatDate('-')}}

@ -1,143 +1,171 @@
<template> <template>
<view> <view>
<image mode="widthFix" class="width90 mart20" v-if="user && user.infoCompleteStatus == 1" :src="imagewxUrl+imgadres"></image> <image mode="widthFix" class="width90 mart20" v-if="user && user.infoCompleteStatus == 1"
<image mode="widthFix" class="width90 mart20" v-if="!user" :src="imagewxUrl+imgadres1"></image> :src="imagewxUrl+imgadres"></image>
<!-- #ifdef MP --> <image mode="widthFix" class="width90 mart20" v-if="!user" :src="imagewxUrl+imgadres1"></image>
<view class="mart30 width90 height50 fcorfff backcor008 fotct btns font16 fontlet" v-if="user && user.infoCompleteStatus == 1" @click="getuserinfo"> <!-- #ifdef MP -->
授权并登录</view> <view class="mart30 width90 height50 fcorfff backcor008 fotct btns font16 fontlet"
<button class="mart30 width90 height50 fcorfff backcor008 fotct btns font16 fontlet" v-if="!user" v-if="user && user.infoCompleteStatus == 1" @click="getuserinfo">
open-type="getPhoneNumber" @getphonenumber="loginByPhone">授权手机号</button> 授权并登录</view>
<!-- <button class="mart30 width90 height50 fcorfff backcor008 fotct btns font16" v-if="user.phone && user" <button class="mart30 width90 height50 fcorfff backcor008 fotct btns font16 fontlet" v-if="!user"
@click="reqmessage">授权获取消息通知</button> --> open-type="getPhoneNumber" @getphonenumber="loginByPhone">授权手机号</button>
<!-- #endif --> <!-- <button class="mart30 width90 height50 fcorfff backcor008 fotct btns font16" v-if="user.phone && user"
<!-- #ifdef H5 --> @click="reqmessage">授权获取消息通知</button> -->
<button class="mart30 width90 height50 fcorfff backcor008 fotct btns font16" <!-- #endif -->
@click="getH5userinfo">授权并登录</button> <!-- #ifdef H5 -->
<!-- #endif --> <button class="mart30 width90 height50 fcorfff backcor008 fotct btns font16"
</view> @click="getH5userinfo">授权并登录</button>
</template> <!-- #endif -->
</view>
<script> </template>
const app = getApp();
import { <script>
getUserInfo, const app = getApp();
loginByPhone import {
} from "../../Utils/Api.js" getUserInfo,
export default { loginByPhone,
data() { HandleCode
return { } from "../../Utils/Api.js"
user: '', export default {
imagewxUrl: app.globalData.imageWxImg, data() {
imgadres: 'login.png', return {
imgadres1: 'loginphone.png', user: '',
} imagewxUrl: app.globalData.imageWxImg,
}, imgadres: 'login.png',
onLoad() { imgadres1: 'loginphone.png',
this.user = app.globalData.userInfo; }
}, },
methods: { onLoad() {
getuserinfo() { // #ifdef MP
let that = this; if (!app.globalData.openId) {
uni.getUserProfile({ uni.login({
desc: '登录中...', provider: 'weixin',
success: function(res) { success: function(loginRes) {
let params = { app.globalData.code = loginRes.code;
openId: app.globalData.openId, //
iv: res.iv, let params = {
encryptedData: res.encryptedData code: app.globalData.code
} }
getUserInfo(params).then(res => { HandleCode(params).then(res => {
if (res.return_code == '000000') { if (res.return_code == '000000') {
app.globalData.userInfo = res.return_data app.globalData.openId = res.return_data.openId;
.object }
.highUser; })
that.user = res.return_data.object.highUser; },
app.globalData.token = res.return_data.uniqueCode; })
that.isShowAuth = false }
uni.setStorage({ // #endif
key: "user", this.user = app.globalData.userInfo;
data: res.return_data },
.object methods: {
.highUser getuserinfo() {
}) let that = this;
uni.setStorage({ uni.getUserProfile({
key: "token", desc: '登录中...',
data: res.return_data.uniqueCode success: function(res) {
}) let params = {
if (res.return_data.object.highUser.infoCompleteStatus == 0) { openId: app.globalData.openId,
uni.navigateBack({ iv: res.iv,
}) encryptedData: res.encryptedData
} }
} else { getUserInfo(params).then(res => {
uni.showToast({ if (res.return_code == '000000') {
title: res.return_msg app.globalData.userInfo = res.return_data
}) .object
} .highUser;
}); that.user = res.return_data.object.highUser;
}, app.globalData.token = res.return_data.uniqueCode;
fail: res => { that.isShowAuth = false
uni.showToast({ uni.setStorage({
title: "微信登录授权失败", key: "user",
icon: "none" data: res.return_data
}); .object
} .highUser
}) })
that.isShowAuth = false uni.setStorage({
}, key: "token",
// data: res.return_data.uniqueCode
loginByPhone(PhoneNumber) { })
if(PhoneNumber.detail.iv == undefined){ if (res.return_data.object.highUser.infoCompleteStatus == 0) {
uni.showToast({ uni.navigateBack({})
title: "用户取消授权", }
icon: "none" } else {
}); uni.showToast({
return; title: res.return_msg,
} duration: 2000,
let params = { icon: 'none'
openId: app.globalData.openId, })
iv: PhoneNumber.detail.iv, }
encryptedData: PhoneNumber.detail.encryptedData });
} },
loginByPhone(params).then(res => { fail: res => {
if (res.return_code == '000000') { uni.showToast({
uni.showToast({ title: "微信登录授权失败",
title: '手机号授权成功', icon: "none"
icon: 'none', });
duration: 2000 }
}) })
this.user = res.return_data.object.highUser; that.isShowAuth = false
app.globalData.token = res.return_data.uniqueCode; },
app.globalData.userInfo = res.return_data //
.object loginByPhone(PhoneNumber) {
.highUser; if (PhoneNumber.detail.iv == undefined) {
uni.setStorage({ uni.showToast({
key: "user", title: "用户取消授权",
data: res.return_data icon: "none"
.object });
.highUser return;
}) }
uni.setStorage({ let params = {
key: "token", openId: app.globalData.openId,
data: res.return_data.uniqueCode iv: PhoneNumber.detail.iv,
}) encryptedData: PhoneNumber.detail.encryptedData
if(res.return_data.object.highUser.infoCompleteStatus == 0){ }
uni.navigateBack({ loginByPhone(params).then(res => {
}) if (res.return_code == '000000') {
} uni.showToast({
} title: '手机号授权成功',
}); icon: 'none',
}, duration: 2000
getH5userinfo() { })
uni.navigateTo({ this.user = res.return_data.object.highUser;
url: '/pages/login/register' app.globalData.token = res.return_data.uniqueCode;
}) app.globalData.userInfo = res.return_data
}, .object
} .highUser;
} uni.setStorage({
</script> key: "user",
data: res.return_data
<style lang="scss"> .object
.btns { .highUser
border-radius: 6px; })
} uni.setStorage({
key: "token",
data: res.return_data.uniqueCode
})
if (res.return_data.object.highUser.infoCompleteStatus == 0) {
uni.navigateBack({})
}
} else {
uni.showToast({
title: res.return_msg,
icon: "none",
duration: 2000
});
}
});
},
getH5userinfo() {
uni.navigateTo({
url: '/pages/login/register'
})
},
}
}
</script>
<style lang="scss">
.btns {
border-radius: 6px;
}
</style> </style>

@ -3,8 +3,10 @@
<view class="block"> <view class="block">
<view class="content"> <view class="content">
<view class="my"> <view class="my">
我的账户余额 {{tongCardPrice}} ( 1:100) 充值账号
</view> </view>
<input class="my" disabled="true" style="border-bottom: solid 1upx #eee;" placeholder="请输入充值账号"
v-model="cardId" />
</view> </view>
</view> </view>
<view class="block"> <view class="block">
@ -24,7 +26,7 @@
自定义充值金额 自定义充值金额
</view> </view>
<view class="input"> <view class="input">
<input type="number" v-model="inputAmount" /> <input type="number" maxlength="4" v-model="inputAmount" />
</view> </view>
</view> </view>
</view> </view>
@ -36,17 +38,6 @@
</view> </view>
<view class="content"> <view class="content">
<view class="pay-list"> <view class="pay-list">
<!-- <view class="row" @tap="paytype='alipay'">
<view class="left">
<image src="/static/img/alipay.png"></image>
</view>
<view class="center">
支付宝支付
</view>
<view class="right">
<radio :checked="paytype=='alipay'" color="#0083f5" />
</view>
</view> -->
<view class="row" @tap="paytype='wxpay'"> <view class="row" @tap="paytype='wxpay'">
<view class="left"> <view class="left">
<image :src="imagewxUrl+imgadres"></image> <image :src="imagewxUrl+imgadres"></image>
@ -86,88 +77,80 @@
data() { data() {
return { return {
inputAmount: '', // inputAmount: '', //
amountList: [10, 50, 100], //3 amountList: [50, 100, 200], //3
paytype: 'wxpay', // paytype: 'wxpay', //
user: "", user: "",
imagewxUrl: app.globalData.imageWxImg, imagewxUrl: app.globalData.imageWxImg,
imgadres: 'wxpay.png', imgadres: 'wxpay.png',
tongCardPrice: 0 tongCardPrice: 0,
cardId: '' //
}; };
}, },
onLoad() { onLoad(options) {
this.user = app.globalData.userInfo; this.cardId = options.cardId;
}, },
onShow() { onShow() {
if (this.user.isSetHltCard) { this.user = app.globalData.userInfo;
this.getHuiLianTongCardBalance();
}
}, },
methods: { methods: {
//
getHuiLianTongCardBalance() {
let params = {
cardNo: this.user.hltCardNo.cardNo
}
getHuiLianTongCardBalance(params).then(res => {
if (res.return_code == '000000') {
this.tongCardPrice = res.return_data.balance;
}
});
},
select(amount) { select(amount) {
this.inputAmount = amount; this.inputAmount = amount;
}, },
doDeposit() { doDeposit() {
if (!this.user.isSetHltCard) { if (!this.cardId) {
uni.showToast({ uni.showToast({
title: '请输入充值工会卡',
icon: 'none', icon: 'none',
title: '当前账号还未绑定,前往绑定', duration: 2000
duration: 2000,
success() {
setTimeout(() => {
uni.navigateTo({
url: '../../pages/user/bindingCard/bindingCard'
})
}, 1000)
}
}); });
return; return;
} }
if (parseFloat(this.inputAmount).toString() == "NaN") { if (parseFloat(this.inputAmount).toString() == "NaN") {
uni.showToast({ uni.showToast({
title: '请输入正确金额', title: '请输入正确金额',
icon: 'none' icon: 'none',
duration: 2000
}); });
return; return;
} }
if (this.inputAmount <= 0) { if (this.inputAmount <= 0) {
uni.showToast({ uni.showToast({
title: '请输入大于0的金额', title: '请输入大于0的金额',
icon: 'none' icon: 'none',
duration: 2000
});
return;
}
if (this.inputAmount > 2000) {
uni.showToast({
title: '充值金额不能超过大于2000',
icon: 'none',
duration: 2000
}); });
return; return;
} }
if (parseFloat(this.inputAmount).toFixed(2) != parseFloat(this.inputAmount)) { if (parseFloat(this.inputAmount).toFixed(2) != parseFloat(this.inputAmount)) {
uni.showToast({ uni.showToast({
title: '最多只能输入两位小数哦~', title: '最多只能输入两位小数哦~',
icon: 'none' icon: 'none',
duration: 2000
}); });
return; return;
} }
uni.showLoading({ uni.showLoading({
title: '正在提交订单...' title: '正在提交订单...'
}) })
let goods = { let datas = {
"identificationCode": app.globalData.identificationCode, "identificationCode": app.globalData.identificationCode,
"memCardNo": this.cardId,
"highChildOrderList": [{ "highChildOrderList": [{
"goodsType": 2, "goodsType": 8,
"goodsId": app.globalData.userInfo.id, "goodsId": app.globalData.userInfo.id,
"saleCount": 1, "saleCount": 1,
"goodsPrice": this.inputAmount "goodsPrice": this.inputAmount
}] }]
} }
addOrder(goods).then(res => { addOrder(datas).then(res => {
uni.hideLoading(); uni.hideLoading();
if (res.return_code == '000000') { if (res.return_code == '000000') {
/// ///
@ -197,8 +180,7 @@
duration: 2000, duration: 2000,
success() { success() {
setTimeout(() => { setTimeout(() => {
uni.navigateBack({ uni.navigateBack({})
})
}, 1000) }, 1000)
} }
}); });
@ -217,7 +199,9 @@
// #endif // #endif
} else { } else {
uni.showToast({ uni.showToast({
title: '支付失败' title: '支付失败',
duration: 2000,
icon: 'none'
}) })
} }
}) })
@ -225,7 +209,9 @@
} else { } else {
uni.showToast({ uni.showToast({
title: res.return_msg title: res.return_msg,
icon: 'none',
duration: 2000
}); });
} }
}) })
@ -304,11 +290,10 @@
.content { .content {
.my { .my {
width: 100%; width: 100%;
height: 120upx; height: 100upx;
display: flex; display: flex;
align-items: center; align-items: center;
font-size: 30upx; font-size: 34upx;
border-bottom: solid 1upx #eee;
} }
.amount { .amount {

@ -486,6 +486,10 @@ $uni-font-size-paragraph:30upx;
.mart80{ .mart80{
margin-top: 80px; margin-top: 80px;
}
.mart70{
margin-top: 70px;
} }
.mart60{ .mart60{
margin-top: 60px; margin-top: 60px;

Loading…
Cancel
Save