删除无用的东西

This commit is contained in:
qijq 2025-05-07 16:41:49 +08:00
parent ee731a4892
commit 908f1e8bd0
6 changed files with 449 additions and 407 deletions

View File

@ -345,7 +345,6 @@
<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

@ -1,15 +0,0 @@
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

@ -1,503 +1,562 @@
<template> <template>
<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"><image :src="cardInfo.card_type_image" style="width: 100%;height: 100%;"></image></view> <view class="m-banner-ad"
<view class="m-activity-info"> ><image
<view class="m-activity-title"> :src="cardInfo.card_type_image"
<label>{{ cardInfo.card_type_name }}</label> style="width: 100%; height: 100%"
</view> ></image
<view class="m-activity-price"> ></view>
<view> <view class="m-activity-info">
<label>{{ __('¥') }}{{ number_format(cardInfo.card_type_prize, 2) }}</label> <view class="m-activity-title">
<label style="padding:0rpx 30rpx;color:#888;">{{ __('剩余使用次数') }} {{ cardInfo.not_num }}</label> <label>{{ cardInfo.card_type_name }}</label>
</view> </view>
</view> <view class="m-activity-price">
</view> <view>
<uni-collapse :accordion="true" style="margin:20rpx 0rpx;background-color: #ffffff;" v-if="(info_id > 0 && cardInfo.card_write_code)"> <label
<uni-collapse-item title="使用记录" :show-animation="true"> >{{ __("¥")
<view class="m-RichText"> }}{{ number_format(cardInfo.card_type_prize, 2) }}</label
<view class="m-code" v-for="(code, index) in cardInfo.items" :key="index"> >
<view>{{ code.card_write_code }}</view> <label style="padding: 0rpx 30rpx; color: #888"
<view v-if="code.card_is_use == 1" style="color:#717171">{{ __('已使用') }}</view> >{{ __("剩余使用次数") }} {{ cardInfo.not_num }}</label
<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> </view>
</uni-collapse> <uni-collapse
: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">
<view class="m-RichText">
<view
class="m-code"
v-for="(code, index) in cardInfo.items"
:key="index"
>
<view>{{ code.card_write_code }}</view>
<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>
</uni-collapse-item>
</uni-collapse>
<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> <view class="m-navbar-item m-navbar-item-on">{{
</view> __("使用规则")
</view> }}</view>
</view>
</view>
<view class="m-RichText" v-if="cardInfo.card_rule"><wxParse :content="cardInfo.card_rule" /></view> <view class="m-RichText" v-if="cardInfo.card_rule"
</view> ><wxParse :content="cardInfo.card_rule"
<view style="width:100%;height:100rpx;"></view> /></view>
</view>
<view style="width: 100%; height: 100rpx"></view>
<view class="u-cleanbox"></view> <view class="u-cleanbox"></view>
<view class="m-footer-btn" v-if="card_code > 0"> <view class="m-footer-btn" v-if="card_code > 0">
<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">{{ number_format(cardInfo.card_type_prize, 2) }}</text> <text class="m-total-price">{{
</block> number_format(cardInfo.card_type_prize, 2)
</view> }}</text>
</view> </block>
</view> </view>
<form report-submit="true" @submit="submitinfo"> </view>
<button class="m-footer-btn-main" formType="submit">{{ __('去支付') }}</button> </view>
</form> <form report-submit="true" @submit="submitinfo">
</view> <button class="m-footer-btn-main" formType="submit">
</view> {{ __("去支付") }}
</block> </button>
</form>
</view>
</view>
</block>
<view class="m-nullcontent" v-else> <view class="m-nullcontent" v-else>
<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 :paymentDataDefault="paymentData" :order_id="order_id" ref="paymentBox" @onCancel="onCancel" @onPaid="onPaid" @onFail="onFail"></payment-box> <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"><canvas class="m-canvas" canvas-id="qrcode" style="width: 200px;height: 200px;" /></view> <view :class="bannerShow ? 'tailfoli' : 'hide'" @click="setHide"
</view> ><canvas
class="m-canvas"
canvas-id="qrcode"
style="width: 200px; height: 200px"
/></view>
</view>
</template> </template>
<script> <script>
import { mapState, mapMutations } from 'vuex'; import { mapState, mapMutations } from "vuex";
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 wxParse from "@/components/u-parse/u-parse.vue";
import paymentBox from "../../components/payment-box.vue";
import wxParse from '@/components/u-parse/u-parse.vue'; import uniCollapse from "@/components/uni-collapse/uni-collapse.vue";
import paymentBox from '../../components/payment-box.vue'; import uniCollapseItem from "@/components/uni-collapse-item/uni-collapse-item.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() {
return { return {
card_code: 0, card_code: 0,
isdata: false, isdata: false,
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(['Config', 'StateCode', 'notice', 'plantformInfo', 'shopInfo', 'userInfo', 'hasLogin']), computed: mapState([
onLoad: function(options) { "Config",
uni.setNavigationBarTitle({ "StateCode",
title: this.__('卡片详情') "notice",
}); "plantformInfo",
if (options.cid) { "shopInfo",
this.setData({ "userInfo",
card_code: options.cid "hasLogin",
}); ]),
onLoad: function (options) {
uni.setNavigationBarTitle({
title: this.__("卡片详情"),
});
if (options.cid) {
this.setData({
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();
} }
// that.$.setNavigationBarTitle({ // that.$.setNavigationBarTitle({
// title: data.item_row.product_item_name // title: data.item_row.product_item_name
// }); // });
}, },
methods: { methods: {
...mapMutations(['login', 'logout', 'getPlantformInfo', 'forceUserInfo', 'getUserInfo']), ...mapMutations([
"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({
url: that.Config.URL.card.card_info_get, url: that.Config.URL.card.card_info_get,
data: params, data: params,
success: function(data, status, msg, code) { success: function (data, status, msg, code) {
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({
url: that.Config.URL.card.card_get, url: that.Config.URL.card.card_get,
data: params, data: params,
success: function(data, status, msg, code) { success: function (data, status, msg, code) {
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,
}); });
}, },
Make: function(e) { Make: function (e) {
var that = this; var that = this;
that.setData({ that.setData({
bannerShow: true bannerShow: true,
}); });
uQRCode.make({
canvasId: "qrcode",
componentInstance: this,
text: e.target.dataset.code,
size: 200,
margin: 10,
backgroundColor: "#ffffff",
foregroundColor: "#000000",
fileType: "jpg",
// correctLevel: uQRCode.errorCorrectLevel.H,
success: (res) => {
//console.log(res);
},
fail: (error) => {
//console.log(error);
},
});
},
submitinfo: function (e) {
var that = this;
uQRCode.make({ var params = {
canvasId: 'qrcode', card_id: that.cardInfo.card_type_id,
componentInstance: this, };
text:e.target.dataset.code, that.$.request({
size: 200, type: "post",
margin: 10, url: that.Config.URL.pay.card_fee,
backgroundColor: '#ffffff', data: params,
foregroundColor: '#000000', success: function (data, status, msg, code) {
fileType: 'jpg', if (status == 200) {
// correctLevel: uQRCode.errorCorrectLevel.H, that.setData({
success: res => { order_id: data.pay_sn,
//console.log(res); order_price: data.p_amount,
}, });
fail: error => {
//console.log(error);
}
});
},
submitinfo: function(e) { that.gotopay();
var that = this; }
},
});
},
var params = { gotopay: function (type_id) {
card_id: that.cardInfo.card_type_id var that = this;
}; var order_price = that.order_price;
that.$.request({ that.setData({
type: 'post', order_id: that.order_id,
url: that.Config.URL.pay.card_fee, paymentData: {
data: params, order_id: that.order_id,
success: function(data, status, msg, code) { orderSelMoneyAmount: order_price,
if (status == 200) { user_money: that.userInfo.user_money,
that.setData({ },
order_id: data.pay_sn, });
order_price: data.p_amount
});
that.gotopay(); this.$refs.paymentBox.show();
} return true;
}
});
},
gotopay: function(type_id) { var param = {
var that = this; order_id: this.order_id,
var order_price = that.order_price; openid: this.userInfo.openId,
that.setData({ /* store_id: this.shopInfo.store_id, */
order_id: that.order_id, typ: "json",
paymentData: { payment_channel_code: "wx_native",
order_id: that.order_id, prepay_flag: 1,
orderSelMoneyAmount: order_price, };
user_money: that.userInfo.user_money
}
});
this.$refs.paymentBox.show(); var that = this;
return true;
var param = { that.$.request({
order_id: this.order_id, url: this.Config.URL.pay.pay,
openid: this.userInfo.openId, data: param,
/* store_id: this.shopInfo.store_id, */ success: function (data, status, msg, code) {
typ: 'json', if (status == 200) {
payment_channel_code: 'wx_native', that.$.requestPayment({
prepay_flag: 1 timeStamp: data.timeStamp,
}; nonceStr: data.nonceStr,
package: data.package,
signType: data.signType,
paySign: data.paySign,
success: function (n) {
that.returnUrl(param.order_id);
},
fail: function (e) {},
complete: function (n) {
n.errMsg == "requestPayment:cancel" &&
(that.$.redirectTo(
"../rechargeorderdetail/rechargeorderdetail?on=" +
param.order_id
),
that.sendMessage(param.order_id, 1));
},
});
} else {
that.$.alert(msg);
}
},
var that = this; fail: function (err) {},
});
},
onCancel: function (e) {
return;
},
onPaid: function (e) {
let that = this;
that.$.request({ that.$.alert("支付成功!", function () {
url: this.Config.URL.pay.pay, that.$refs.paymentBox.cancel();
data: param, //that.InitPage(that.options);
success: function(data, status, msg, code) {
if (status == 200) {
that.$.requestPayment({
timeStamp: data.timeStamp,
nonceStr: data.nonceStr,
package: data.package,
signType: data.signType,
paySign: data.paySign,
success: function(n) {
that.returnUrl(param.order_id);
},
fail: function(e) {},
complete: function(n) {
n.errMsg == 'requestPayment:cancel' &&
(that.$.redirectTo('../rechargeorderdetail/rechargeorderdetail?on=' + param.order_id), that.sendMessage(param.order_id, 1));
}
});
} else {
that.$.alert(msg);
}
},
fail: function(err) {} //that.notice.postNotificationName("RefreshMessage", e)
}); setTimeout(function () {
}, that.$.gotopage("/member/card/user_list");
onCancel: function(e) { }, 1500);
return; });
}, },
onPaid: function(e) { onFail: function (e) {
let that = this; let that = this;
that.$.alert("支付失败!");
that.$.alert('支付成功!', function() { //console.log("", e)
that.$refs.paymentBox.cancel(); },
//that.InitPage(that.options); },
//that.notice.postNotificationName("RefreshMessage", e)
setTimeout(function() {
that.$.gotopage('/member/card/user_list');
}, 1500);
});
},
onFail: function(e) {
let that = this;
that.$.alert('支付失败!');
//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
} }
.fix-titlenview-trans { .fix-titlenview-trans {
background: #f5f6f7; background: #f5f6f7;
} }
.m-banner-ad { .m-banner-ad {
width: 100%; width: 100%;
height: 300rpx; height: 300rpx;
background: rgba(0, 0, 0, 0); background: rgba(0, 0, 0, 0);
opacity: 1; opacity: 1;
position: relative; position: relative;
} }
.m-activity-info { .m-activity-info {
// width: 100%; // width: 100%;
height: 140rpx; height: 140rpx;
background: #ffffff; background: #ffffff;
opacity: 1; opacity: 1;
padding: 16rpx 24rpx; padding: 16rpx 24rpx;
} }
.m-panel { .m-panel {
margin-top: 0; margin-top: 0;
} }
.m-activity-title { .m-activity-title {
font-size: 30rpx; font-size: 30rpx;
font-family: PingFang SC; font-family: PingFang SC;
font-weight: 400; font-weight: 400;
line-height: 42rpx; line-height: 42rpx;
color: #002951; color: #002951;
opacity: 1; opacity: 1;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
white-space: nowrap; white-space: nowrap;
} }
.m-activity-tips { .m-activity-tips {
font-size: 20rpx; font-size: 20rpx;
font-family: PingFang SC; font-family: PingFang SC;
font-weight: 400; font-weight: 400;
line-height: 28px; line-height: 28px;
color: #002951; color: #002951;
opacity: 0.6; opacity: 0.6;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
white-space: nowrap; white-space: nowrap;
} }
.m-activity-price { .m-activity-price {
font-size: 28rpx; font-size: 28rpx;
font-family: Arial; font-family: Arial;
font-weight: 400; font-weight: 400;
line-height: 28rpx; line-height: 28rpx;
color: #ff4142; color: #ff4142;
opacity: 1; opacity: 1;
margin-top: 12rpx; margin-top: 12rpx;
display: flex; display: flex;
flex-direction: row; flex-direction: row;
flex-wrap: nowrap; flex-wrap: nowrap;
justify-content: space-between; justify-content: space-between;
} }
.m-footer-btn { .m-footer-btn {
height: 100rpx; height: 100rpx;
width: 100%; width: 100%;
position: fixed; position: fixed;
bottom: 0; bottom: 0;
left: 0; left: 0;
background-color: #fff; background-color: #fff;
border-top: 1rpx solid #d5d5d5; border-top: 1rpx solid #d5d5d5;
border-radius: 0; border-radius: 0;
z-index: 100; z-index: 100;
} }
.m-footer-btn-main { .m-footer-btn-main {
width: 30%; width: 30%;
height: 100%; height: 100%;
float: left; float: left;
background-color: $default-skin-bg; background-color: $default-skin-bg;
color: #fff; color: #fff;
line-height: 100rpx; line-height: 100rpx;
font-size: 32rpx; font-size: 32rpx;
text-align: center; text-align: center;
border-radius: 0; border-radius: 0;
} }
.m-footer-btn-list { .m-footer-btn-list {
width: 70%; width: 70%;
height: 100%; height: 100%;
position: relative; position: relative;
float: left; float: left;
} }
.m-footer-btn-item { .m-footer-btn-item {
position: relative; position: relative;
float: left; float: left;
width: 100%; width: 100%;
font-size: 24rpx; font-size: 24rpx;
color: #888; color: #888;
line-height: 40rpx; line-height: 40rpx;
padding: 15rpx 0; padding: 15rpx 0;
box-sizing: border-box; box-sizing: border-box;
height: 100%; height: 100%;
} }
.m-cart-total { .m-cart-total {
text-align: right; text-align: right;
padding-right: 20rpx; padding-right: 20rpx;
} }
.m-cart-total text { .m-cart-total text {
font-size: 36rpx; font-size: 36rpx;
color: $default-skin-bg; color: $default-skin-bg;
} }
.m-cart-total label { .m-cart-total label {
color: $default-skin-bg; color: $default-skin-bg;
} }
.m-code { .m-code {
padding: 20rpx; padding: 20rpx;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
} }
/* 弹出层形式的广告 */ /* 弹出层形式的广告 */
.uni-banner { .uni-banner {
width: 70%; width: 70%;
height: 20%; height: 20%;
position: fixed; position: fixed;
left: 50%; left: 50%;
top: 50%; top: 50%;
border-radius: 10rpx; border-radius: 10rpx;
z-index: 99; z-index: 99;
transform: translate(-50%, -50%); transform: translate(-50%, -50%);
background: #ffffff; background: #ffffff;
} }
.m-conter { .m-conter {
width: 100%; width: 100%;
height: 200rpx; height: 200rpx;
margin-top: 20rpx; margin-top: 20rpx;
} }
.m-canvas { .m-canvas {
position: absolute !important; /*重要的一步是设置绝对定位*/ position: absolute !important; /*重要的一步是设置绝对定位*/
margin: auto; /*将四周边距都设为auto自动*/ margin: auto; /*将四周边距都设为auto自动*/
left: 0; /*离包含元素的距离均设为零*/ left: 0; /*离包含元素的距离均设为零*/
right: 0; right: 0;
top: 0; top: 0;
bottom: 0; bottom: 0;
} }
.tailfoli { .tailfoli {
background: rgba(0, 0, 0, 0.6); background: rgba(0, 0, 0, 0.6);
position: fixed; position: fixed;
width: 100%; width: 100%;
height: 100%; height: 100%;
left: 0; left: 0;
top: 0; top: 0;
z-index: 99; z-index: 99;
} }
.m-RichText{ .m-RichText {
background-color: #ffffff; background-color: #ffffff;
} }
</style> </style>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

View File

@ -12,7 +12,6 @@ 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';