删除无用的东西

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

@ -2,25 +2,51 @@
<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"
><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>{{ __('¥') }}{{ number_format(cardInfo.card_type_prize, 2) }}</label> <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 :accordion="true" style="margin:20rpx 0rpx;background-color: #ffffff;" v-if="(info_id > 0 && cardInfo.card_write_code)"> <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"> <uni-collapse-item title="使用记录" :show-animation="true">
<view class="m-RichText"> <view class="m-RichText">
<view class="m-code" v-for="(code, index) in cardInfo.items" :key="index"> <view
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> <view v-if="code.card_is_use == 1" style="color: #717171">{{
<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>
@ -29,13 +55,17 @@
<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"
><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>
@ -43,16 +73,20 @@
<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">{{
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> <button class="m-footer-btn-main" formType="submit">
{{ __("去支付") }}
</button>
</form> </form>
</view> </view>
</view> </view>
@ -62,31 +96,41 @@
<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"
><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 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() {
@ -96,34 +140,41 @@ 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(['Config', 'StateCode', 'notice', 'plantformInfo', 'shopInfo', 'userInfo', 'hasLogin']), computed: mapState([
onLoad: function(options) { "Config",
"StateCode",
"notice",
"plantformInfo",
"shopInfo",
"userInfo",
"hasLogin",
]),
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();
@ -135,117 +186,121 @@ export default {
}, },
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({ 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);
} },
}); });
}, },
submitinfo: function(e) { submitinfo: function (e) {
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();
} }
} },
}); });
}, },
gotopay: function(type_id) { gotopay: function (type_id) {
var that = this; var that = this;
var order_price = that.order_price; var order_price = that.order_price;
that.setData({ that.setData({
@ -253,8 +308,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();
@ -264,9 +319,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;
@ -274,7 +329,7 @@ export default {
that.$.request({ that.$.request({
url: this.Config.URL.pay.pay, url: this.Config.URL.pay.pay,
data: param, data: param,
success: function(data, status, msg, code) { success: function (data, status, msg, code) {
if (status == 200) { if (status == 200) {
that.$.requestPayment({ that.$.requestPayment({
timeStamp: data.timeStamp, timeStamp: data.timeStamp,
@ -282,50 +337,54 @@ export default {
package: data.package, package: data.package,
signType: data.signType, signType: data.signType,
paySign: data.paySign, paySign: data.paySign,
success: function(n) { success: function (n) {
that.returnUrl(param.order_id); that.returnUrl(param.order_id);
}, },
fail: function(e) {}, fail: function (e) {},
complete: function(n) { complete: function (n) {
n.errMsg == 'requestPayment:cancel' && n.errMsg == "requestPayment:cancel" &&
(that.$.redirectTo('../rechargeorderdetail/rechargeorderdetail?on=' + param.order_id), that.sendMessage(param.order_id, 1)); (that.$.redirectTo(
} "../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) {
return; return;
}, },
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
@ -497,7 +556,7 @@ export default {
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';