Compare commits

..

No commits in common. "dcafefc06507e9cfc11ceac5398a55b362e867dd" and "ce588ca195c0d341374e67704c98c7742000c08e" have entirely different histories.

8 changed files with 408 additions and 455 deletions

View File

@ -345,6 +345,7 @@
<script> <script>
import $ from "../../helpers/util"; import $ from "../../helpers/util";
import uniQrcode from "@/components/uni-qrcode/uni-qrcode.vue";
import uQRCode from "@/components/uni-qrcode/uqrcode.js"; import uQRCode from "@/components/uni-qrcode/uqrcode.js";
import { mapState, mapMutations } from "vuex"; import { mapState, mapMutations } from "vuex";

View File

@ -201,7 +201,7 @@ export default {
that.$.request({ that.$.request({
url: that.Config.URL.user.overview, url: that.Config.URL.user.overview,
success: function (results, status, msg, code) { success: function (data, status, msg, code) {
that.login(data); that.login(data);
that.reloadUserResource(function (user_info) { that.reloadUserResource(function (user_info) {
that.setData({ that.setData({

15
helpers/loginPopup.js Normal file
View File

@ -0,0 +1,15 @@
import Vue from 'vue'
import loginPopup from '@/components/loginPopup.vue'
const loginPopup_ = Vue.extend(loginPopup)
export const $loginPopup = (data) =>{
const node = new loginPopup_({
show:data
})
node.$mount()
document.body.appendChild(node.$el)
}

View File

@ -2,51 +2,25 @@
<view class="page"> <view class="page">
<block v-if="isdata"> <block v-if="isdata">
<view class="u-pa1 fix-titlenview-trans"> <view class="u-pa1 fix-titlenview-trans">
<view class="m-banner-ad" <view class="m-banner-ad"><image :src="cardInfo.card_type_image" style="width: 100%;height: 100%;"></image></view>
><image
:src="cardInfo.card_type_image"
style="width: 100%; height: 100%"
></image
></view>
<view class="m-activity-info"> <view class="m-activity-info">
<view class="m-activity-title"> <view class="m-activity-title">
<label>{{ cardInfo.card_type_name }}</label> <label>{{ cardInfo.card_type_name }}</label>
</view> </view>
<view class="m-activity-price"> <view class="m-activity-price">
<view> <view>
<label <label>{{ __('¥') }}{{ number_format(cardInfo.card_type_prize, 2) }}</label>
>{{ __("¥") <label style="padding:0rpx 30rpx;color:#888;">{{ __('剩余使用次数') }} {{ cardInfo.not_num }}</label>
}}{{ number_format(cardInfo.card_type_prize, 2) }}</label
>
<label style="padding: 0rpx 30rpx; color: #888"
>{{ __("剩余使用次数") }} {{ cardInfo.not_num }}</label
>
</view> </view>
</view> </view>
</view> </view>
<uni-collapse <uni-collapse :accordion="true" style="margin:20rpx 0rpx;background-color: #ffffff;" v-if="(info_id > 0 && cardInfo.card_write_code)">
:accordion="true"
style="margin: 20rpx 0rpx; background-color: #ffffff"
v-if="info_id > 0 && cardInfo.card_write_code"
>
<uni-collapse-item title="使用记录" :show-animation="true"> <uni-collapse-item title="使用记录" :show-animation="true">
<view class="m-RichText"> <view class="m-RichText">
<view <view class="m-code" v-for="(code, index) in cardInfo.items" :key="index">
class="m-code"
v-for="(code, index) in cardInfo.items"
:key="index"
>
<view>{{ code.card_write_code }}</view> <view>{{ code.card_write_code }}</view>
<view v-if="code.card_is_use == 1" style="color: #717171">{{ <view v-if="code.card_is_use == 1" style="color:#717171">{{ __('已使用') }}</view>
__("已使用") <view v-if="code.card_is_use == 0" style="color:#ff4142" :data-code="code.card_write_code" @click="Make">{{ __('使用') }}</view>
}}</view>
<view
v-if="code.card_is_use == 0"
style="color: #ff4142"
:data-code="code.card_write_code"
@click="Make"
>{{ __("使用") }}</view
>
</view> </view>
</view> </view>
</uni-collapse-item> </uni-collapse-item>
@ -55,17 +29,13 @@
<view class="m-panel m-panel-access m-detail"> <view class="m-panel m-panel-access m-detail">
<view class="m-tab"> <view class="m-tab">
<view class="m-navbar"> <view class="m-navbar">
<view class="m-navbar-item m-navbar-item-on">{{ <view class="m-navbar-item m-navbar-item-on">{{ __('使用规则') }}</view>
__("使用规则")
}}</view>
</view> </view>
</view> </view>
<view class="m-RichText" v-if="cardInfo.card_rule" <view class="m-RichText" v-if="cardInfo.card_rule"><wxParse :content="cardInfo.card_rule" /></view>
><wxParse :content="cardInfo.card_rule"
/></view>
</view> </view>
<view style="width: 100%; height: 100rpx"></view> <view style="width:100%;height:100rpx;"></view>
<view class="u-cleanbox"></view> <view class="u-cleanbox"></view>
@ -73,20 +43,16 @@
<view class="m-footer-btn-list"> <view class="m-footer-btn-list">
<view class="m-footer-btn-item m-cart-total"> <view class="m-footer-btn-item m-cart-total">
<view> <view>
{{ __("合计:") }} {{ __('合计:') }}
<block v-if="cardInfo.card_type_prize.m"> <block v-if="cardInfo.card_type_prize.m">
<label>{{ __("¥") }}</label> <label>{{ __('¥') }}</label>
<text class="m-total-price">{{ <text class="m-total-price">{{ number_format(cardInfo.card_type_prize, 2) }}</text>
number_format(cardInfo.card_type_prize, 2)
}}</text>
</block> </block>
</view> </view>
</view> </view>
</view> </view>
<form report-submit="true" @submit="submitinfo"> <form report-submit="true" @submit="submitinfo">
<button class="m-footer-btn-main" formType="submit"> <button class="m-footer-btn-main" formType="submit">{{ __('去支付') }}</button>
{{ __("去支付") }}
</button>
</form> </form>
</view> </view>
</view> </view>
@ -96,41 +62,31 @@
<view class="m-nullpage-middle"> <view class="m-nullpage-middle">
<label class="iconfont icon-meiyougengduo"></label> <label class="iconfont icon-meiyougengduo"></label>
<view class="m-null-tip"> <view class="m-null-tip">
<text>{{ __("亲~什么都没有") }}</text> <text>{{ __('亲~什么都没有') }}</text>
</view> </view>
</view> </view>
</view> </view>
<payment-box <payment-box :paymentDataDefault="paymentData" :order_id="order_id" ref="paymentBox" @onCancel="onCancel" @onPaid="onPaid" @onFail="onFail"></payment-box>
:paymentDataDefault="paymentData"
:order_id="order_id"
ref="paymentBox"
@onCancel="onCancel"
@onPaid="onPaid"
@onFail="onFail"
></payment-box>
<!-- 弹出层 --> <!-- 弹出层 -->
<view :class="bannerShow ? 'tailfoli' : 'hide'" @click="setHide" <view :class="bannerShow ? 'tailfoli' : 'hide'" @click="setHide"><canvas class="m-canvas" canvas-id="qrcode" style="width: 200px;height: 200px;" /></view>
><canvas
class="m-canvas"
canvas-id="qrcode"
style="width: 200px; height: 200px"
/></view>
</view> </view>
</template> </template>
<script> <script>
import { mapState, mapMutations } from "vuex"; import { mapState, mapMutations } from 'vuex';
import uQRCode from "@/components/uni-qrcode/uqrcode.js"; import uniQrcode from '@/components/uni-qrcode/uni-qrcode.vue';
import wxParse from "@/components/u-parse/u-parse.vue"; import uQRCode from '@/components/uni-qrcode/uqrcode.js';
import paymentBox from "../../components/payment-box.vue";
import uniCollapse from "@/components/uni-collapse/uni-collapse.vue"; import wxParse from '@/components/u-parse/u-parse.vue';
import uniCollapseItem from "@/components/uni-collapse-item/uni-collapse-item.vue"; import paymentBox from '../../components/payment-box.vue';
import uniCollapse from '@/components/uni-collapse/uni-collapse.vue';
import uniCollapseItem from '@/components/uni-collapse-item/uni-collapse-item.vue';
export default { export default {
data() { data() {
@ -140,41 +96,34 @@ export default {
cardInfo: {}, cardInfo: {},
bannerShow: false, bannerShow: false,
paymentData: {}, paymentData: {},
order_id: "", order_id: '',
order_price: 0, order_price: 0,
info_id: 0, info_id: 0
}; };
}, },
components: { components: {
wxParse, wxParse,
paymentBox, paymentBox,
uniQrcode,
uniCollapse, uniCollapse,
uniCollapseItem, uniCollapseItem
}, },
computed: mapState([ computed: mapState(['Config', 'StateCode', 'notice', 'plantformInfo', 'shopInfo', 'userInfo', 'hasLogin']),
"Config",
"StateCode",
"notice",
"plantformInfo",
"shopInfo",
"userInfo",
"hasLogin",
]),
onLoad: function(options) { onLoad: function(options) {
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
title: this.__("卡片详情"), title: this.__('卡片详情')
}); });
if (options.cid) { if (options.cid) {
this.setData({ this.setData({
card_code: options.cid, card_code: options.cid
}); });
this.getCard(); this.getCard();
} else { } else {
this.setData({ this.setData({
info_id: options.fid, info_id: options.fid
}); });
this.getCardInfo(); this.getCardInfo();
@ -186,18 +135,12 @@ export default {
}, },
methods: { methods: {
...mapMutations([ ...mapMutations(['login', 'logout', 'getPlantformInfo', 'forceUserInfo', 'getUserInfo']),
"login",
"logout",
"getPlantformInfo",
"forceUserInfo",
"getUserInfo",
]),
getCardInfo: function() { getCardInfo: function() {
var that = this, var that = this,
params = { params = {
card_code: that.info_id, card_code: that.info_id
}; };
that.$.request({ that.$.request({
@ -207,22 +150,22 @@ export default {
if (status == 200 && data) { if (status == 200 && data) {
that.setData({ that.setData({
isdata: true, isdata: true,
cardInfo: data, cardInfo: data
}); });
} else { } else {
that.setData({ that.setData({
isdata: false, isdata: false
}); });
that.$.alert(msg); that.$.alert(msg);
} }
}, }
}); });
}, },
getCard: function() { getCard: function() {
var that = this, var that = this,
params = { params = {
card_code: that.card_code, card_code: that.card_code
}; };
that.$.request({ that.$.request({
@ -232,22 +175,22 @@ export default {
if (status == 200 && data) { if (status == 200 && data) {
that.setData({ that.setData({
isdata: true, isdata: true,
cardInfo: data, cardInfo: data
}); });
console.log(that.cardInfo); console.log(that.cardInfo);
} else { } else {
that.setData({ that.setData({
isdata: false, isdata: false
}); });
that.$.alert(msg); that.$.alert(msg);
} }
}, }
}); });
}, },
setHide: function() { setHide: function() {
this.setData({ this.setData({
bannerShow: false, bannerShow: false
}); });
}, },
@ -255,25 +198,27 @@ export default {
var that = this; var that = this;
that.setData({ that.setData({
bannerShow: true, bannerShow: true
}); });
uQRCode.make({ uQRCode.make({
canvasId: "qrcode", canvasId: 'qrcode',
componentInstance: this, componentInstance: this,
text:e.target.dataset.code, text:e.target.dataset.code,
size: 200, size: 200,
margin: 10, margin: 10,
backgroundColor: "#ffffff", backgroundColor: '#ffffff',
foregroundColor: "#000000", foregroundColor: '#000000',
fileType: "jpg", fileType: 'jpg',
// correctLevel: uQRCode.errorCorrectLevel.H, // correctLevel: uQRCode.errorCorrectLevel.H,
success: (res) => { success: res => {
//console.log(res); //console.log(res);
}, },
fail: (error) => { fail: error => {
//console.log(error); //console.log(error);
}, }
}); });
}, },
@ -281,22 +226,22 @@ export default {
var that = this; var that = this;
var params = { var params = {
card_id: that.cardInfo.card_type_id, card_id: that.cardInfo.card_type_id
}; };
that.$.request({ that.$.request({
type: "post", type: 'post',
url: that.Config.URL.pay.card_fee, url: that.Config.URL.pay.card_fee,
data: params, data: params,
success: function(data, status, msg, code) { success: function(data, status, msg, code) {
if (status == 200) { if (status == 200) {
that.setData({ that.setData({
order_id: data.pay_sn, order_id: data.pay_sn,
order_price: data.p_amount, order_price: data.p_amount
}); });
that.gotopay(); that.gotopay();
} }
}, }
}); });
}, },
@ -308,8 +253,8 @@ export default {
paymentData: { paymentData: {
order_id: that.order_id, order_id: that.order_id,
orderSelMoneyAmount: order_price, orderSelMoneyAmount: order_price,
user_money: that.userInfo.user_money, user_money: that.userInfo.user_money
}, }
}); });
this.$refs.paymentBox.show(); this.$refs.paymentBox.show();
@ -319,9 +264,9 @@ export default {
order_id: this.order_id, order_id: this.order_id,
openid: this.userInfo.openId, openid: this.userInfo.openId,
/* store_id: this.shopInfo.store_id, */ /* store_id: this.shopInfo.store_id, */
typ: "json", typ: 'json',
payment_channel_code: "wx_native", payment_channel_code: 'wx_native',
prepay_flag: 1, prepay_flag: 1
}; };
var that = this; var that = this;
@ -342,20 +287,16 @@ export default {
}, },
fail: function(e) {}, fail: function(e) {},
complete: function(n) { complete: function(n) {
n.errMsg == "requestPayment:cancel" && n.errMsg == 'requestPayment:cancel' &&
(that.$.redirectTo( (that.$.redirectTo('../rechargeorderdetail/rechargeorderdetail?on=' + param.order_id), that.sendMessage(param.order_id, 1));
"../rechargeorderdetail/rechargeorderdetail?on=" + }
param.order_id
),
that.sendMessage(param.order_id, 1));
},
}); });
} else { } else {
that.$.alert(msg); that.$.alert(msg);
} }
}, },
fail: function (err) {}, fail: function(err) {}
}); });
}, },
onCancel: function(e) { onCancel: function(e) {
@ -364,27 +305,27 @@ export default {
onPaid: function(e) { onPaid: function(e) {
let that = this; let that = this;
that.$.alert("支付成功!", function () { that.$.alert('支付成功!', function() {
that.$refs.paymentBox.cancel(); that.$refs.paymentBox.cancel();
//that.InitPage(that.options); //that.InitPage(that.options);
//that.notice.postNotificationName("RefreshMessage", e) //that.notice.postNotificationName("RefreshMessage", e)
setTimeout(function() { setTimeout(function() {
that.$.gotopage("/member/card/user_list"); that.$.gotopage('/member/card/user_list');
}, 1500); }, 1500);
}); });
}, },
onFail: function(e) { onFail: function(e) {
let that = this; let that = this;
that.$.alert("支付失败!"); that.$.alert('支付失败!');
//console.log("", e) //console.log("", e)
}, }
}, }
}; };
</script> </script>
<style lang="scss"> <style lang="scss">
@import "../../styles/_variables"; @import '../../styles/_variables';
.m-coupon-list { .m-coupon-list {
// margin-top: 36rpx // margin-top: 36rpx

View File

@ -3716,11 +3716,6 @@ export default {
tplGoToPage: function (e) { tplGoToPage: function (e) {
let that = this; let that = this;
if (!this.hasLogin) {
this.showLoginPopup = true;
return;
}
// //
this.forceUserInfo(function (user) { this.forceUserInfo(function (user) {
var t = e.currentTarget.dataset; var t = e.currentTarget.dataset;

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@ -12,6 +12,7 @@ import $cookies from '../helpers/vue-cookies';
import Config from '../config/config'; import Config from '../config/config';
import StateCode from '../config/statecode'; import StateCode from '../config/statecode';
import Lang from '../config/lang'; import Lang from '../config/lang';
import { $loginPopup } from '../helpers/loginPopup.js';
import notice from '../helpers/notice'; import notice from '../helpers/notice';