From 16d9802ad6cc80a10454ecf701514e8a14275ee1 Mon Sep 17 00:00:00 2001
From: 石广澎 <shiguangpeng@163.com>
Date: 星期二, 16 七月 2024 18:57:33 +0800
Subject: [PATCH] feat(支付): 支付页修改
---
/dev/null | 0
pay/paySuccess.vue | 33 +++++++-
static/del-icon.png | 0
static/pay-by-card-coupon.png | 0
pages.json | 12 ---
common/config.js | 44 +++++-----
pay/scanpay.vue | 110 ++++++++++++++++-----------
static/store-logo.png | 0
components/key-bord/key-bord.vue | 2
9 files changed, 115 insertions(+), 86 deletions(-)
diff --git a/common/config.js b/common/config.js
index b6ccf42..18efc97 100644
--- a/common/config.js
+++ b/common/config.js
@@ -2,37 +2,37 @@
// 寮�鍙�
const dev = {
- webURL: 'https://sfzf.cpbtsoft.cn',
- baseURL: 'http://172.16.2.121:8080',
- sftpURL: 'https://yqzx.jinmingyuan.com/file',
- wx_appid: 'wx4c146dba764dcb05',
- ali_appid: '2021004149689887'
+ webURL: 'https://sfzf.cpbtsoft.cn',
+ baseURL: 'http://172.16.2.117:8080',
+ sftpURL: 'https://yqzx.jinmingyuan.com/file',
+ wx_appid: 'wx4c146dba764dcb05',
+ ali_appid: '2021004149689887'
}
// 娴嬭瘯
const test = {
- webURL: 'https://sfzf.cpbtsoft.cn',
- baseURL: 'https://sfzf.cpbtsoft.cn/prod-api',
- sftpURL: 'https://sfzf.cpbtsoft.cn/prod-api',
- wx_appid: 'wx4c146dba764dcb05',
- ali_appid: '2021004149689887'
+ webURL: 'https://sfzf.cpbtsoft.cn',
+ baseURL: 'https://sfzf.cpbtsoft.cn/prod-api',
+ sftpURL: 'https://sfzf.cpbtsoft.cn/prod-api',
+ wx_appid: 'wx4c146dba764dcb05',
+ ali_appid: '2021004149689887'
}
// 姝e紡
const prod = {
- webURL: 'https://jmy.jinmingyuan.com',
- baseURL: 'https://yqzx.jinmingyuan.com',
- sftpURL: 'https://yqzx.jinmingyuan.com/file',
- wx_appid: 'wx4c146dba764dcb05',
- ali_appid: '2021004149689887'
+ webURL: 'https://jmy.jinmingyuan.com',
+ baseURL: 'https://yqzx.jinmingyuan.com',
+ sftpURL: 'https://yqzx.jinmingyuan.com/file',
+ wx_appid: 'wx4c146dba764dcb05',
+ ali_appid: '2021004149689887'
}
const cardType = {
- '00': '鍌ㄨ搫鍗�',
- '02': '淇$敤鍗�'
+ '00': '鍌ㄨ搫鍗�',
+ '02': '淇$敤鍗�'
}
module.exports = {
- config: test,
- ACCESSTOKEN: "Authorization",
- /* 鏄惁鎵撳嵃璇锋眰鏃ュ織 */
- DEBUG: false,
- cardType: cardType
+ config: process.env.NODE_ENV === 'development' ? dev : test,
+ ACCESSTOKEN: "Authorization",
+ /* 鏄惁鎵撳嵃璇锋眰鏃ュ織 */
+ DEBUG: false,
+ cardType: cardType
}
diff --git a/components/key-bord/key-bord.vue b/components/key-bord/key-bord.vue
index b5644e0..feba484 100644
--- a/components/key-bord/key-bord.vue
+++ b/components/key-bord/key-bord.vue
@@ -9,7 +9,7 @@
</view>
<view class="u-flex-col">
<view hover-class="num-hover" class="del-item u-flex u-row-center" @click="delStr">
- <image src="@/static/imgs/del-icon.png" class="del-btn"></image>
+ <image src="@/static/del-icon.png" class="del-btn"></image>
</view>
<view hover-class="num-hover" :class="['pay-btn', 'u-font-30', 'color-fff', 'font-bold',{'disa-btn':Number(emitNum||'0')===0}]" @click="pay">浠樻
</view>
diff --git a/pages.json b/pages.json
index 2d2bc8a..a3d7f67 100644
--- a/pages.json
+++ b/pages.json
@@ -15,18 +15,6 @@
}
},
{
- "path": "pay/discountpay",
- "style": {
- "navigationBarTitleText": "浼樻儬",
- "enablePullDownRefresh": false
- // #ifdef H5
- ,
- "navigationStyle": "custom"
- // #endif
- }
-
- },
- {
"path": "pay/register",
"style": {
"navigationBarTitleText": "娉ㄥ唽",
diff --git a/pay/discountpay.vue b/pay/discountpay.vue
deleted file mode 100644
index 833672e..0000000
--- a/pay/discountpay.vue
+++ /dev/null
@@ -1,595 +0,0 @@
-<!-- 鎵爜鏀粯 -->
-<template>
- <view class="page">
- <view class="pay-box">
- <view class="u-font-26 color-666">搴斾粯閲戦</view>
- <view class="u-m-t-14">
- <text class="u-font-36 color-333 u-m-r-8">楼</text>
- <text class="money">{{money.split(".")[0]}}</text>
- <text class="u-font-40">.{{money.split(".")[1]}}</text>
- </view>
- </view>
- <view v-if="canUseIntegral||canUseCoupon" class="u-p-h-32 bg-fff u-m-h-32 u-br-10">
- <view v-if="canUseCoupon" class="u-flex u-p-v-32">
- <image class="item-icon" src="/static/coupon-icon.png" mode=""></image>
- <view class="u-font-30 u-flex-1 u-m-h-16">浼樻儬鍒�</view>
- <view @click="showCoupon" class="u-flex">
- <view v-if="couponInfo.id" class="tag-pain">
- 婊{parseFloat((couponInfo.thresholdValue/100).toFixed(2))}}鍏冨噺{{parseFloat((couponInfo.discount/100).toFixed(2))}}鍏�
- </view>
- <text v-else class="u-font-26">璇烽�夋嫨</text>
- <u-icon class="u-m-l-10" name="arrow-right" color="#333" size="13"></u-icon>
- </view>
- </view>
- </view>
- <view class="bg-fff u-m-h-32 u-m-t-20 u-p-h-32 u-br-10">
- <view v-if="discount" class="u-p-v-32 u-flex u-row-between u-border-bottom u-font-30 color-333">
- <view>瀹為檯鎶垫墸</view>
- <view>-{{ discount }}</view>
- </view>
- <view class="u-p-v-32 u-flex u-row-between">
- <view class="u-font-30 color-333">瀹炰粯閲戦</view>
- <view class="color-red">
- <text class="u-font-26 u-m-r-6">楼</text>
- <text class="u-font-34">{{ price }}</text>
- </view>
- </view>
- </view>
-
- <button class="pay-it" @click="pay">纭畾鏀粯</button>
- <!-- 浼樻儬鍒稿脊绐� -->
- <u-popup mode="bottom" :closeable="true" :show="couponShow" @close="couponShow = false" :round="10">
- <view class="u-font-32 color-333 u-text-center u-p-t-30">浼樻儬鍒�</view>
- <view v-if="checkCoupon.id" class="choose-coupon">
- 宸查�夋嫨浼樻儬鍒�1寮狅紝鍏辨姷鎵o骏{{parseFloat((checkCoupon.discount/100).toFixed(2))}}</view>
- <!-- <view class="choose-coupon">閫夋嫨浼樻儬鍒�</view> -->
- <scroll-view scroll-y class="u-p-30 coupon-list">
- <view @click="clickCoupon(item)" class="u-m-b-24 u-flex coupon" v-for="(item, index) in couponList"
- :key="index">
- <view style="color: #D31F28;" class="u-p-h-28">
- <view class="font-bold">
- <text class="u-font-36">锟�</text>
- <text class="money">{{parseFloat(item.discount/100)}}</text>
- </view>
- <view class="u-font-24 u-m-t-20">婊{parseFloat(item.thresholdValue/100)}}鍏冧娇鐢�</view>
- </view>
- <view class="butt"></view>
- <view class="u-p-30 u-flex-1 u-flex">
- <view class="u-flex-1">
- <view class="u-font-28 color-333 u-line-2">{{item.name}}</view>
- <view class="u-font-22 color-999 u-m-t-20">
- 鏈夋晥鏈熻嚦锛歿{$u.timeFormat(item.outTime, 'yyyy-mm-dd hh:MM')}}
- </view>
- </view>
- <u-icon v-if="item.id==checkCoupon.id" name="checkmark-circle-fill" color="#D31F28" size="20">
- </u-icon>
- </view>
-
- </view>
- </scroll-view>
- <view @click="getCoupon" class="coupon-btn">纭畾</view>
- </u-popup>
- <!-- 鏁板瓧閿洏 -->
- <u-popup :show="bordShow" :overlay="false" @close="bordShow = false">
- <key-bord @changeMoney="changeMoney" :num.sync="money" @close="bordShow = false" @pay="pay"></key-bord>
- </u-popup>
- <!-- 鏀粯楠岃瘉鐮� -->
-<!-- <u-popup :show="codeShow" closeable mode="center" @close="codeShow = false">
- <view class="u-p-h-40 u-p-b-40">
- <view class="u-text-center u-p-t-20 u-m-b-30 u-font-34">璇疯緭鍏ユ墜鏈洪獙璇佺爜</view>
- <view class="u-text-center u-m-b-20 color-666">{{ shopInfo.shop_name }}</view>
- <view class="u-flex u-row-center font-bold u-m-b-40"><text class="u-font-42">锟�</text><text
- class="u-font-money">{{ price }}</text>
- </view>
- <u-code-input @finish="bankPay" v-model="smscode" mode="box" :focus="true"></u-code-input>
- </view>
-
- </u-popup>-->
- </view>
-</template>
-
-<script>
- import {
- config,
- ACCESSTOKEN
- } from '@/common/config.js';
- import {
- queryMyUseSweepPayMaxCoupon,
- getScoreWorth,
- queryScore,
- queryUseSweepPayCoupon,
- getWechatConfigInfo,
- saveWxOrder,
- saveOrder,
- tlPay
- } from '@/common/api/index'
- import wx from 'weixin-js-sdk'; // 浣跨敤js-sdk
- import {
- nextTick
- } from "vue";
- export default {
- data() {
- return {
- cid: null,
- bordShow: false, // 鏄剧ず閿洏
- scoreWorth: 0,
- shopInfo: {
- shop_name: '',
- scan_flag: '',
- use_score_flag: 0, //鍟嗛摵鏄惁鍙敤绉垎 0鍚� 1鏄�
- user_coupon_flag: 0, //鍟嗛摵鏄惁鍙敤浼樻儬鍒� 0鍚� 1鏄�
- app_pay_use_score_flag: 0, //寰俊/鏀粯瀹濇槸鍚﹀彲鐢ㄧН鍒� 0鍚� 1鏄�
- app_pay_use_coupon_flag: 0, //寰俊/鏀粯瀹濇槸鍚﹀彲鐢ㄤ紭鎯犲埜 0鍚� 1鏄�
- bank_pay_use_score_flag: 0, //閾惰鍗℃敮浠樻槸鍚﹀彲鐢ㄧН鍒� 0鍚� 1鏄�
- bank_pay_use_coupon_flag: 0, //閾惰鍗℃敮浠樻槸鍚﹀彲鐢ㄤ紭鎯犲埜 0鍚� 1鏄�
- },
- money: 0.00, // 閲戦
- integral: 0, // 浣跨敤绉垎
- canUseInt: 0, // 鍙敤绉垎
- payWay: 3, // 5鏀粯瀹� 2寰俊 3閾惰鍗�
- isNew: false,
- codeShow: false,
- smscode: '',
- thpinfo: null,
- canReset: false,
- couponShow: false, // 浼樻儬鍒稿脊绐�
- couponList: [], // 浼樻儬鍒�
- couponInfo: {
- id: '',
- discount: 0,
- thresholdValue: 0
- }, // 浼樻儬鍒稿唴瀹�
- checkCoupon: {
- id: null,
- discount: 0,
- thresholdValue: 0
- },
- discountInfo: {
- memberGradeName: '',
- shopDiscount: 10
- }
- };
- },
- watch: {
- integralDiscount(val) {
- if (this.couponInfo.id && val < this.couponInfo.thresholdValue) {
- this.couponInfo = {
- id: '',
- discount: 0,
- thresholdValue: 0
- }
- this.checkCoupon = {
- id: '',
- discount: 0,
- thresholdValue: 0
- }
- }
- }
- },
- computed: {
- canUseIntegral() {
- if (this.payWay == 3) { //閾惰鍗�
- return this.shopInfo.use_score_flag && this.shopInfo.bank_pay_use_score_flag
- } else {
- return this.shopInfo.use_score_flag && this.shopInfo.app_pay_use_score_flag
- }
-
- },
- canUseCoupon() {
- if (this.payWay == 3) { //閾惰鍗�
- return this.shopInfo.user_coupon_flag && this.shopInfo.bank_pay_use_coupon_flag
- } else {
- return this.shopInfo.user_coupon_flag && this.shopInfo.app_pay_use_coupon_flag
- }
- },
- maxIntegral() {
- if (this.couponInfo.id) {
- const num = Math.ceil((this.money * this.discountInfo.shopDiscount - this.couponInfo.thresholdValue / 100) / (
- this.scoreWorth / 100))
- if (num < 0) {
- return 0
- }
- return num
- } else {
- const num = Math.ceil((this.money * this.discountInfo.shopDiscount - this.couponInfo.thresholdValue / 100) / (
- this.scoreWorth / 100))
- if (num < 0) {
- return 0
- }
- return num
- }
- },
- integralDiscount() {
- let num = 0;
- num = parseInt(parseFloat((this.money * this.discountInfo.shopDiscount * 100).toPrecision(12)) - this.canUseInt *
- this.scoreWorth);
- return num;
- },
- discount() {
- let num = 0;
- num = ((this.canUseInt * this.scoreWorth + parseFloat(this.couponInfo.discount)) / 100).toFixed(2);
- if (parseFloat(num) > parseFloat(this.money * this.discountInfo.shopDiscount)) {
- return this.money * this.discountInfo.shopDiscount
- }
- return num;
- },
- price() {
- let num = 0;
- num = parseFloat((this.money * this.discountInfo.shopDiscount * 100).toPrecision(12)) - this.canUseInt * this
- .scoreWorth - this.couponInfo
- .discount;
- num = num > 0 ? (num / 100).toFixed(2) : '0.00';
- return num;
- }
- },
- onLoad(opt) {
- this.isNew = uni.getStorageSync('IS_NEW')
- this.cid = uni.getStorageSync('CID')
- if(uni.getStorageSync('DISCOUNT_INFO')){
- this.discountInfo = uni.getStorageSync('DISCOUNT_INFO')
- }
-
- const token = uni.getStorageSync(ACCESSTOKEN) || null
- if (opt.shopInfo) {
- this.shopInfo = JSON.parse(decodeURIComponent(opt.shopInfo))
- }
- if (opt.scoreWorth) {
- this.scoreWorth = Number(opt.scoreWorth)
- }
- if (opt.integral) {
- this.integral = Number(opt.integral)
- }
- if (opt.money) {
- this.money = parseFloat(opt.money).toFixed(2)
- let dis = this.money * 100 * (1 - this.discountInfo.shopDiscount)
- console.log('dis',dis)
- let money = parseInt((this.money * 100 * this.discountInfo.shopDiscount))
- if (dis < 1) {
- money = parseInt((this.money * 100))
- }
- queryMyUseSweepPayMaxCoupon({
- params: {
- shopId: this.shopInfo.id,
- money: money < 1 ? 1 : money
- }
- }).then(res => {
- if (res&&this.canUseCoupon) {
- this.couponInfo = res
- this.checkCoupon = res
- }
-
- })
- }
- if (opt.payWay) {
- this.payWay = opt.payWay
- }
- if (opt.bankCardId) {
- this.bankCardId = opt.bankCardId
- }
- this.init()
- },
- methods: {
- // 鏇存柊閲戦
- changeMoney(str) {
- this.money = str;
- },
- // 灞曠ず閿洏
- showBord() {
- this.bordShow = true;
- },
- init() {
- uni.showLoading()
- if (this.payWay == 2) {
- const uri = encodeURIComponent(window.location)
- getWechatConfigInfo({
- url: uri
- }).then(res => {
- uni.hideLoading()
- wx.config({
- debug: false, // 寮�鍚皟璇曟ā寮�
- appId: res.appId, // 蹇呭~锛屽叕浼楀彿鐨勫敮涓�鏍囪瘑
- timestamp: res.timestamp, // 蹇呭~锛岀敓鎴愮鍚嶇殑鏃堕棿鎴�
- nonceStr: res.nonceStr, // 蹇呭~锛岀敓鎴愮鍚嶇殑闅忔満涓�
- signature: res.signature, // 蹇呭~锛岀鍚�
- jsApiList: ['chooseWXPay'], // 蹇呭~锛岄渶瑕佷娇鐢ㄧ殑 JS 鎺ュ彛鍒楄〃
- // openTagList: ['wx-open-launch-weapp'] //鍙�夛紝闇�瑕佷娇鐢ㄧ殑寮�鏀炬爣绛惧垪琛�
- });
- }).catch(() => {
- uni.hideLoading()
- })
- }
- },
- // 鏇存敼绉垎
- changeInt(num) {
- this.canUseInt = num;
- },
- pay() {
- this.bordShow = false
- uni.showLoading()
- const params = {
- money: parseFloat((this.money * 100).toPrecision(12)),
- shopId: this.shopInfo.id,
- cid: this.cid,
- payWay: this.payWay,
- score: this.canUseInt,
- couponDetailId: this.couponInfo.id
- }
- if (this.payWay == 3) {
- params.bankCardId = this.bankCardId
- }
- saveOrder(params).then(res => {
- uni.hideLoading()
- try {
- this.orderId = res.orderId
- res.youHuiInfo.shopName = this.shopInfo.shop_name
- this.youHuiInfo = res.youHuiInfo
- if (res.isOk == 1) {
- uni.navigateTo({
- url: `/pay/paySuccess?orderId=${this.orderId}&youHuiInfo=${JSON
- .stringify(this.youHuiInfo)}`
- })
- } else {
- if (res.toPayMethod == 1) {
- if (this.payWay == 3) {
- this.smscode = ''
- this.codeShow = true
- }
- } else if (res.toPayMethod == 2) {
- if (this.payWay == 2) {
- this.wxPay(res.paymentData)
- }
- if (this.payWay == 5) {
- this.aliPay(res.paymentData)
- }
- } else if (res.toPayMethod == 3) {
- // window.location.href = res.paymentUrl
- this.smscode = ''
- this.codeShow = true
- }
- }
- } catch (e) {
- //TODO handle the exception
- console.error(e);
- }
-
-
- }).catch(() => {
- uni.hideLoading()
- })
- },
- // 寰俊鏀粯
- wxPay(res) {
- setTimeout(() => {
- WeixinJSBridge.invoke(
- 'getBrandWCPayRequest', {
- "appId": res.appId, //鍏紬鍙稩D锛岀敱鍟嗘埛浼犲叆
- "timeStamp": res.timeStamp, //鏃堕棿鎴筹紝鑷�1970骞翠互鏉ョ殑绉掓暟
- "nonceStr": res.nonceStr, //闅忔満涓�
- "package": res.package,
- "signType": res.signType, //寰俊绛惧悕鏂瑰紡锛�
- "paySign": res.paySign //寰俊绛惧悕
- },
- (res) => {
- if (res.err_msg == "get_brand_wcpay_request:ok") {
- // 浣跨敤浠ヤ笂鏂瑰紡鍒ゆ柇鍓嶇杩斿洖,寰俊鍥㈤槦閮戦噸鎻愮ず锛�
- //res.err_msg灏嗗湪鐢ㄦ埛鏀粯鎴愬姛鍚庤繑鍥瀘k锛屼絾骞朵笉淇濊瘉瀹冪粷瀵瑰彲闈犮��
- uni.navigateTo({
- url: `/pay/paySuccess?orderId=${this.orderId}&youHuiInfo=${JSON
- .stringify(this.youHuiInfo)}`
- })
- }
- });
- }, 200)
- },
- //鏀粯瀹濇敮浠�
- aliPay(res) {
- ap.tradePay({
- tradeNO: res.tradeNO
- }, (res) => {
- if (res.resultCode == 9000) {
- uni.navigateTo({
- url: `/pay/paySuccess?orderId=${this.orderId}&youHuiInfo=${JSON
- .stringify(this.youHuiInfo)}`
- })
- // 鏀粯鎴愬姛
- } else if (res.resultCode == 8000 || res.resultCode == 6001) {
- // 姝e湪澶勭悊涓� || 鍙栨秷
- } else {
- // 鏀粯澶辫触
- }
- });
- },
- //閾惰鍗℃敮浠�
- bankPay(e) {
- uni.showLoading()
- tlPay({
- orderId: this.orderId,
- payWay: 3,
- bankCardId: this.bankCardId,
- smscode: e
- }).then(res => {
- uni.hideLoading()
- uni.hideKeyboard()
- this.codeShow = false
- uni.navigateTo({
- url: `/pay/paySuccess?orderId=${this.orderId}&youHuiInfo=${JSON
- .stringify(this.youHuiInfo)}`
- })
- }).catch(() => {
- uni.hideLoading()
- })
- },
- //鏄剧ず浼樻儬鍒�
- showCoupon() {
- uni.showLoading()
- queryUseSweepPayCoupon({
- params: {
- cusid: this.shopInfo.cusid,
- c: this.shopInfo.c,
- money: parseFloat((this.money * 100).toPrecision(12)),
- score: this.canUseInt
- }
- }).then(res => {
- uni.hideLoading()
- if (res.length > 0) {
- this.couponList = res
- this.checkCoupon = this.couponInfo
- this.couponShow = true;
- } else {
- uni.showToast({
- icon: 'none',
- title: '鏆傛棤鍙敤浼樻儬鍒�'
- })
- }
-
- }).catch(() => {
- uni.hideLoading()
- })
-
- },
- clickCoupon(item) {
- if (this.checkCoupon.id == item.id) {
- this.checkCoupon = {
- id: '',
- discount: 0,
- thresholdValue: 0
- }
- } else {
- this.checkCoupon = item
- }
- },
- getCoupon() {
- // item 涓轰紭鎯犲埜淇℃伅
- this.couponInfo = this.checkCoupon;
- this.couponShow = false;
- }
- }
- };
-</script>
-
-<style scoped lang="scss">
- .page {
- height: calc(100vh - 0px);
- display: flex;
- flex-direction: column;
- line-height: 1;
- }
-
- .avg-img {
- width: 80rpx;
- height: 80rpx;
- }
-
- .pay-box {
- text-align: center;
- padding: 65rpx 0 42rpx;
- }
-
- .money {
- font-size: 64rpx;
- }
-
- .tag-pain {
- border: 1px solid #D31F28;
- font-size: 22rpx;
- color: #D31F28;
- border-radius: 4rpx;
- line-height: 1;
- padding: 8rpx 4rpx;
- }
-
- .item-icon {
- width: 38rpx;
- height: 38rpx;
- }
-
- .pay-it {
- position: absolute;
- width: 686rpx;
- height: 98rpx;
- bottom: 0;
- border-radius: 10rpx;
- font-size: 34rpx;
- color: #ffffff;
- background-color: #de2d35;
- margin: 32rpx;
- }
-
- .choose-coupon {
- margin: 32rpx 32rpx 0;
- border-radius: 10rpx;
- background: #fff1f1;
- padding: 26rpx 16rpx;
- color: #D31F28;
- font-size: 28rpx;
- }
-
- .coupon-list {
- box-sizing: border-box;
- height: calc(50vh - 44px);
- }
-
- .coupon {
- background-color: rgba(255, 241, 241, 0.47);
- height: 171rpx;
- border: solid 1rpx #f85d64;
- border-radius: 10rpx;
- position: relative;
- overflow: hidden;
- }
-
- .butt {
- width: 1rpx;
- height: 100%;
- position: relative;
- z-index: 9;
- border-left: 1rpx dashed #f85d64;
- }
-
- .butt:before {
- z-index: 10;
- box-sizing: border-box;
- position: absolute;
- content: "";
- width: 24rpx;
- height: 12rpx;
- border-bottom: 1rpx solid #f85d64;
- border-right: 1rpx solid #f85d64;
- border-left: 1rpx solid #f85d64;
- border-radius: 0 0 24rpx 24rpx;
- left: -12rpx;
- background-color: #ffffff;
- }
-
- .butt:after {
- box-sizing: border-box;
- position: absolute;
- content: "";
- width: 24rpx;
- height: 12rpx;
- bottom: 0;
- border-bottom: 1rpx solid #ffff;
- border-right: 1rpx solid #f85d64;
- border-left: 1rpx solid #f85d64;
- border-top: 1rpx solid #f85d64;
- border-radius: 24rpx 24rpx 0 0;
- left: -12rpx;
- background-color: #ffffff;
- }
-
-
- .coupon-btn {
- margin: 0 32rpx;
- height: 98rpx;
- border-radius: 10rpx;
- background-color: #D31F28;
- font-size: 34rpx;
- color: #fff;
- line-height: 98rpx;
- text-align: center;
- }
-
- .u-font-money {
- font-size: 60rpx;
- }
-</style>
diff --git a/pay/paySuccess.vue b/pay/paySuccess.vue
index ec3d7e6..97dde6f 100644
--- a/pay/paySuccess.vue
+++ b/pay/paySuccess.vue
@@ -102,7 +102,7 @@
</view>
</view>
<view class="btn-box">
- <u-button @click="doJump" text="瀹屾垚" type="success" plain shape="circle"></u-button>
+ <u-button @click="clickDone" text="瀹屾垚" type="success" plain shape="circle"></u-button>
</view>
</block>
@@ -230,9 +230,32 @@
return null;
},
clickDone() {
- // window.close()
- WeixinJSBridge.call('closeWindow');
-
+ let browser = navigator.userAgent.toLowerCase();
+ if (browser.match(/Alipay/i) == "alipay") {
+ console.log("鏀粯瀹漚pp鐨勬祻瑙堝櫒");
+ //杩欎釜鍙互鍏抽棴瀹夊崜绯荤粺鐨勬墜鏈�
+ document.addEventListener("AlipayJSBridgeReady", function () {
+ AlipayJSBridge.call("closeWindow");
+ },
+ false
+ );
+ //杩欎釜鍙互鍏抽棴ios绯荤粺鐨勬墜鏈�
+ AlipayJSBridge.call('closeWebview'); //鏀粯瀹�
+ } else if (browser.match(/MicroMessenger/i) == "micromessenger") {
+ //杩欎釜鍙互鍏抽棴瀹夊崜绯荤粺鐨勬墜鏈�
+ document.addEventListener("WeixinJSBridgeReady", function () {
+ WeixinJSBridge.call("closeWindow");
+ },
+ false
+ );
+ //杩欎釜鍙互鍏抽棴ios绯荤粺鐨勬墜鏈�
+ WeixinJSBridge.call("closeWindow");
+ } else {
+ console.log("鍏跺畠娴忚鍣�");
+ window.opener = null; //濡傛灉娌℃湁杩欒鍜屼笅闈㈢殑涓�琛屽垯浼氬嚭鐜颁笂闈㈢殑绗簩涓闂銆�
+ window.open(' ', '_self', ' ');
+ window.close()
+ }
},
doJump() {
var mchData = {
@@ -290,7 +313,7 @@
.coupon {
width: 638rpx;
height: 172rpx;
- background-image: url('~@/static/shuaka/pay-by-card-coupon.png');
+ background-image: url('~@/static/pay-by-card-coupon.png');
background-size: cover;
margin: 10rpx auto 20rpx;
display: flex;
diff --git a/pay/scanpay.vue b/pay/scanpay.vue
index 89935e8..6257895 100644
--- a/pay/scanpay.vue
+++ b/pay/scanpay.vue
@@ -3,49 +3,65 @@
<view class="page">
<view class="shop u-flex u-row-between">
<view class="u-m-r-30">
- <view class="u-font-28 color-666 u-m-b-10">浠樻缁�</view>
- <view class="u-font-34 font-bold color-333">{{ shopInfo.shopName }}</view>
+ <view class="u-font-26 color-666 u-m-b-10">浠樻缁�</view>
+ <view class="u-font-34 color-333">{{ shopInfo.shopName }}</view>
</view>
- <u-image width="94rpx" height="94rpx" radius="10rpx" :src="shopInfo.logoImage||'/static/imgs/store-logo.png'"></u-image>
+ <u-image width="88rpx" height="88rpx" shape="circle" :src="shopInfo.logoImage||'/static/store-logo.png'"></u-image>
</view>
- <view class="u-p-48 bg-fff u-flex-1 content">
- <view class="u-font-28 color-666">閲戦</view>
- <view class="u-p-v-20 u-flex u-border-bottom u-relative money-box">
- <view class="money-icon color-333">楼</view>
- <view class="u-flex-1 u-flex u-m-l-10" style="height: 80rpx;">
- <view v-if="money" class="money-num">{{ money }}</view>
+ <view class="u-p-24 bg-fff u-m-32 u-br-10">
+ <view class="u-flex u-row-between">
+ <view class="u-font-28 color-666">閲戦</view>
+ <view class="remark">娣诲姞澶囨敞</view>
+ </view>
+ <view class="u-p-v-20 u-flex u-col-bottom u-border-bottom u-relative money-box">
+ <view class="money-icon color-333 lh-1">楼</view>
+ <view class="u-flex-1 u-flex u-col-bottom u-m-l-10" style="height: 80rpx;">
+ <view v-if="money" class="money-num lh-1">{{ money }}</view>
<view :class="['cursor',{'cursor-act':!money&&bordShow}]"></view>
- <view v-if="!money" class="u-font-50 color-999">璇疯緭鍏ラ噾棰�</view>
+ <view v-if="!money" class="u-font-50 color-999 lh-1">璇疯緭鍏ラ噾棰�</view>
<view :class="['cursor',{'cursor-act':money&&bordShow}]"></view>
</view>
<view class="mask" @click="showBord"></view>
</view>
- <image v-if="isNew&&(this.payWay == 2&&!UNIONID)" @click="toRegister" class="reg-btn" src="/static/register-btn.png" mode=""></image>
- <block v-if="shopInfo.userCouponFlag==1">
- <view class="u-flex u-p-v-24 u-border-bottom">
- <u-icon name="coupon-fill" size="60rpx" color="#D31F28"></u-icon>
+<!-- <image v-if="isNew&&(this.payWay == 2&&!UNIONID)" @click="toRegister" class="reg-btn" src="/static/register-btn.png" mode=""></image>-->
+
+ </view>
+ <block v-if="shopInfo.userCouponFlag==1">
+ <view class="bg-fff u-m-32 u-br-10">
+ <view class="u-flex u-p-24 u-border-bottom">
+<!-- <u-icon name="coupon-fill" size="60rpx" color="#D31F28"></u-icon>-->
<view class="u-font-32 u-flex-1 u-m-h-16">浼樻儬鍒�</view>
<view @click="showCoupon" class="u-flex">
<view v-if="couponInfo.id" class="tag-pain">
婊{ parseFloat((couponInfo.thresholdValue / 100).toFixed(2)) }}鍏冨噺{{ parseFloat((couponInfo.discount / 100).toFixed(2)) }}鍏�
</view>
- <view v-else class="u-font-28 lh-1">璇烽�夋嫨</view>
+ <view v-else class="u-font-28 lh-1 u-tips-color">璇烽�夋嫨</view>
<u-icon class="u-m-l-10" name="arrow-right" color="#999" size="16"></u-icon>
</view>
</view>
- <view v-if="discount" class="u-p-v-30 u-flex u-row-between u-border-bottom">
- <view class="u-font-32 color-333">瀹為檯鎶垫墸</view>
+ <view class="u-font-26 u-tips-color u-p-24">寰俊鎼滅储鎴栫洿鎺ョ偣鍑绘墦寮�
+ <text style="color: #1E8BE0">銆愬唨浼橀偖銆�</text>
+ 灏忕▼搴忥紝浜彈鏇村浼樻儬
+ </view>
+ </view>
+ </block>
+
+
+ <block v-if="shopInfo.userCouponFlag==1&&discount">
+ <view class="u-m-32 u-br-10 bg-fff">
+ <view class="u-p-24 u-flex u-row-between u-border-bottom">
+ <view class="u-font-32 color-333">鎶垫墸閲戦</view>
<view class="color-green">- {{ discount }}</view>
</view>
- <view v-if="discount" class="u-p-v-30 u-flex u-row-between u-border-bottom">
+ <view class="u-p-24 u-flex u-row-between u-br-10 bg-fff">
<view class="u-font-32 color-333">瀹炰粯閲戦</view>
<view class="color-red">
<text class="u-font-26 u-m-r-6">楼</text>
<text class="u-font-34">{{ payMoney }}</text>
</view>
</view>
- </block>
- </view>
+ </view>
+ </block>
<button class="pay-it" @click="pay">浠樻</button>
<!-- 鏁板瓧閿洏 -->
<u-popup :show="bordShow" :overlay="false" @close="bordShow = false">
@@ -57,7 +73,6 @@
<view v-if="checkCoupon.id" class="choose-coupon">
宸查�夋嫨浼樻儬鍒�1寮狅紝鍏辨姷鎵o骏{{ parseFloat((checkCoupon.discount / 100).toFixed(2)) }}
</view>
- <!-- <view class="choose-coupon">閫夋嫨浼樻儬鍒�</view> -->
<scroll-view scroll-y class="u-p-30 coupon-list">
<view @click="clickCoupon(item)" class="u-m-b-24 u-flex coupon" v-for="(item, index) in couponList" :key="index">
<view style="color: #D31F28;" class="u-p-h-28">
@@ -302,7 +317,7 @@
// 閲戦 this.money
uni.showLoading()
const params = {
- money: Number(this.payMoney * 100),
+ money: Number(this.money * 100),
shopId: this.shopInfo.id,
cid: this.cid,
payWay: this.payWay,
@@ -346,9 +361,9 @@
if (res.err_msg == "get_brand_wcpay_request:ok") {
// 浣跨敤浠ヤ笂鏂瑰紡鍒ゆ柇鍓嶇杩斿洖,寰俊鍥㈤槦閮戦噸鎻愮ず锛�
//res.err_msg灏嗗湪鐢ㄦ埛鏀粯鎴愬姛鍚庤繑鍥瀘k锛屼絾骞朵笉淇濊瘉瀹冪粷瀵瑰彲闈犮��
- uni.navigateTo({
+ /*uni.navigateTo({
url: `/pay/paySuccess?orderId=${this.orderId}&youHuiInfo=${JSON.stringify(this.youHuiInfo)}`
- })
+ })*/
} else {
this.closeOrder()
}
@@ -366,8 +381,11 @@
.stringify(this.youHuiInfo)}`
})
// 鏀粯鎴愬姛
- } else if (res.resultCode == 8000 || res.resultCode == 6001) {
+ } else if (res.resultCode == 8000) {
// 姝e湪澶勭悊涓� || 鍙栨秷
+ } else if (res.resultCode == 6001) {
+ // 鍙栨秷
+ this.closeOrder()
} else {
this.closeOrder()
// 鏀粯澶辫触
@@ -387,45 +405,36 @@
<style scoped lang="scss">
.page {
height: calc(100vh - 0px);
- display: flex;
- flex-direction: column;
}
.shop {
- padding: 50rpx 64rpx;
+ padding: 50rpx 32rpx 10px;
}
.avg-img {
- width: 94rpx;
- height: 94rpx;
- border-radius: 10rpx;
+ width: 88rpx;
+ height: 88rpx;
+ border-radius: 44rpx;
background-color: #ffffff;
}
-.content {
- border-radius: 40rpx 40rpx 0 0;
-}
.money {
font-size: 40rpx;
color: #333;
}
-.money-box{
- padding-left: 50rpx;
-}
+
+
.money-icon {
- position: absolute;
- font-size: 50rpx;
- // font-weight: bold;
+ position: relative;
+ bottom: 6rpx;
+ font-size: 42rpx;
color: #666;
- margin-right: 20rpx;
- bottom: 10rpx;
- left: 0;
+ margin-right: 10rpx;
}
.money-num {
- font-size: 96rpx;
- // font-weight: bold;
+ font-size: 72rpx;
}
.pay-it {
@@ -498,8 +507,10 @@
}
.cursor {
+ position: relative;
+ bottom: 10rpx;
width: 1px;
- height: 80rpx;
+ height: 70rpx;
}
.cursor-act {
@@ -632,6 +643,13 @@
background-color: #ffffff;
}
+.remark {
+ color: #1E8BE0
+}
+
+.lh-1 {
+ line-height: 1;
+}
.coupon-btn {
margin: 0 30rpx 30rpx;
diff --git a/static/act-bg.png b/static/act-bg.png
deleted file mode 100644
index 941be37..0000000
--- a/static/act-bg.png
+++ /dev/null
Binary files differ
diff --git a/static/bangka.png b/static/bangka.png
deleted file mode 100644
index 09cf03c..0000000
--- a/static/bangka.png
+++ /dev/null
Binary files differ
diff --git a/static/bank-card-ad1.png b/static/bank-card-ad1.png
deleted file mode 100644
index 09cf03c..0000000
--- a/static/bank-card-ad1.png
+++ /dev/null
Binary files differ
diff --git a/static/bank-card-ad2.png b/static/bank-card-ad2.png
deleted file mode 100644
index 1143115..0000000
--- a/static/bank-card-ad2.png
+++ /dev/null
Binary files differ
diff --git a/static/bind-card-modal.png b/static/bind-card-modal.png
deleted file mode 100644
index d39833d..0000000
--- a/static/bind-card-modal.png
+++ /dev/null
Binary files differ
diff --git a/static/bind-card-title.png b/static/bind-card-title.png
deleted file mode 100644
index 0c1a35c..0000000
--- a/static/bind-card-title.png
+++ /dev/null
Binary files differ
diff --git a/static/cart/icon_add.png b/static/cart/icon_add.png
deleted file mode 100644
index 232c922..0000000
--- a/static/cart/icon_add.png
+++ /dev/null
Binary files differ
diff --git a/static/cart/icon_addLight.png b/static/cart/icon_addLight.png
deleted file mode 100644
index afd408b..0000000
--- a/static/cart/icon_addLight.png
+++ /dev/null
Binary files differ
diff --git a/static/cart/icon_less.png b/static/cart/icon_less.png
deleted file mode 100644
index 8f1ed73..0000000
--- a/static/cart/icon_less.png
+++ /dev/null
Binary files differ
diff --git a/static/cart/icon_lessLight.png b/static/cart/icon_lessLight.png
deleted file mode 100644
index 75bdd72..0000000
--- a/static/cart/icon_lessLight.png
+++ /dev/null
Binary files differ
diff --git a/static/check-type.png b/static/check-type.png
deleted file mode 100644
index da0aaa7..0000000
--- a/static/check-type.png
+++ /dev/null
Binary files differ
diff --git a/static/close-icon.png b/static/close-icon.png
deleted file mode 100644
index 05fc551..0000000
--- a/static/close-icon.png
+++ /dev/null
Binary files differ
diff --git a/static/coupon-bg2.png b/static/coupon-bg2.png
deleted file mode 100644
index a594ace..0000000
--- a/static/coupon-bg2.png
+++ /dev/null
Binary files differ
diff --git a/static/coupon-icon.png b/static/coupon-icon.png
deleted file mode 100644
index 448161c..0000000
--- a/static/coupon-icon.png
+++ /dev/null
Binary files differ
diff --git a/static/imgs/del-icon.png b/static/del-icon.png
similarity index 100%
rename from static/imgs/del-icon.png
rename to static/del-icon.png
Binary files differ
diff --git a/static/imgs/pay-jyk.png b/static/imgs/pay-jyk.png
deleted file mode 100644
index 2f45ca1..0000000
--- a/static/imgs/pay-jyk.png
+++ /dev/null
Binary files differ
diff --git a/static/imgs/pay-wx.png b/static/imgs/pay-wx.png
deleted file mode 100644
index 59ae69b..0000000
--- a/static/imgs/pay-wx.png
+++ /dev/null
Binary files differ
diff --git a/static/imgs/pay-zfb.png b/static/imgs/pay-zfb.png
deleted file mode 100644
index 1966caf..0000000
--- a/static/imgs/pay-zfb.png
+++ /dev/null
Binary files differ
diff --git a/static/imgs/store-logo.png b/static/imgs/store-logo.png
deleted file mode 100644
index 26e0937..0000000
--- a/static/imgs/store-logo.png
+++ /dev/null
Binary files differ
diff --git a/static/integral.png b/static/integral.png
deleted file mode 100644
index 01f755f..0000000
--- a/static/integral.png
+++ /dev/null
Binary files differ
diff --git a/static/pay-btn.jpeg b/static/pay-btn.jpeg
deleted file mode 100644
index d5991e9..0000000
--- a/static/pay-btn.jpeg
+++ /dev/null
Binary files differ
diff --git a/static/pay-btn.png b/static/pay-btn.png
deleted file mode 100644
index 0cc5c09..0000000
--- a/static/pay-btn.png
+++ /dev/null
Binary files differ
diff --git a/static/shuaka/pay-by-card-coupon.png b/static/pay-by-card-coupon.png
similarity index 100%
rename from static/shuaka/pay-by-card-coupon.png
rename to static/pay-by-card-coupon.png
Binary files differ
diff --git a/static/shuaka/coupon-title-left.png b/static/shuaka/coupon-title-left.png
deleted file mode 100644
index 9d4d61c..0000000
--- a/static/shuaka/coupon-title-left.png
+++ /dev/null
Binary files differ
diff --git a/static/shuaka/coupon-title-right.png b/static/shuaka/coupon-title-right.png
deleted file mode 100644
index 9615048..0000000
--- a/static/shuaka/coupon-title-right.png
+++ /dev/null
Binary files differ
diff --git a/static/shuaka/notice-check.png b/static/shuaka/notice-check.png
deleted file mode 100644
index ed383d8..0000000
--- a/static/shuaka/notice-check.png
+++ /dev/null
Binary files differ
diff --git a/static/shuaka/pay-by-card-bg-top.png b/static/shuaka/pay-by-card-bg-top.png
deleted file mode 100644
index c934d70..0000000
--- a/static/shuaka/pay-by-card-bg-top.png
+++ /dev/null
Binary files differ
diff --git a/static/shuaka/pay-by-card-bg.png b/static/shuaka/pay-by-card-bg.png
deleted file mode 100644
index ed0ee57..0000000
--- a/static/shuaka/pay-by-card-bg.png
+++ /dev/null
Binary files differ
diff --git a/static/shuaka/pay-by-card-btn.png b/static/shuaka/pay-by-card-btn.png
deleted file mode 100644
index c3d5176..0000000
--- a/static/shuaka/pay-by-card-btn.png
+++ /dev/null
Binary files differ
diff --git a/static/shuaka/pay-by-card-coupon-get.png b/static/shuaka/pay-by-card-coupon-get.png
deleted file mode 100644
index 91ac90e..0000000
--- a/static/shuaka/pay-by-card-coupon-get.png
+++ /dev/null
Binary files differ
diff --git a/static/shuaka/pay-by-card-coupon-lock.png b/static/shuaka/pay-by-card-coupon-lock.png
deleted file mode 100644
index 351f7cc..0000000
--- a/static/shuaka/pay-by-card-coupon-lock.png
+++ /dev/null
Binary files differ
diff --git a/static/shuaka/pay-by-card-dto-ttitle-bg.png b/static/shuaka/pay-by-card-dto-ttitle-bg.png
deleted file mode 100644
index a664c93..0000000
--- a/static/shuaka/pay-by-card-dto-ttitle-bg.png
+++ /dev/null
Binary files differ
diff --git a/static/shuaka/pay-by-card-lock.png b/static/shuaka/pay-by-card-lock.png
deleted file mode 100644
index 8b76314..0000000
--- a/static/shuaka/pay-by-card-lock.png
+++ /dev/null
Binary files differ
diff --git a/static/shuaka/pay-by-card-modal-bg.png b/static/shuaka/pay-by-card-modal-bg.png
deleted file mode 100644
index ab16627..0000000
--- a/static/shuaka/pay-by-card-modal-bg.png
+++ /dev/null
Binary files differ
diff --git a/static/shuaka/pay-by-card-step-act.png b/static/shuaka/pay-by-card-step-act.png
deleted file mode 100644
index 3eb8b06..0000000
--- a/static/shuaka/pay-by-card-step-act.png
+++ /dev/null
Binary files differ
diff --git a/static/shuaka/pay-by-card-step.png b/static/shuaka/pay-by-card-step.png
deleted file mode 100644
index ed878b2..0000000
--- a/static/shuaka/pay-by-card-step.png
+++ /dev/null
Binary files differ
diff --git a/static/shuaka/popup-close.png b/static/shuaka/popup-close.png
deleted file mode 100644
index a1f343d..0000000
--- a/static/shuaka/popup-close.png
+++ /dev/null
Binary files differ
diff --git a/static/shuaka/shuaka.png b/static/shuaka/shuaka.png
deleted file mode 100644
index 1143115..0000000
--- a/static/shuaka/shuaka.png
+++ /dev/null
Binary files differ
diff --git a/static/shuaka/title-bg.png b/static/shuaka/title-bg.png
deleted file mode 100644
index 1e23a49..0000000
--- a/static/shuaka/title-bg.png
+++ /dev/null
Binary files differ
diff --git a/static/shuaka/title-icon1.png b/static/shuaka/title-icon1.png
deleted file mode 100644
index aef9568..0000000
--- a/static/shuaka/title-icon1.png
+++ /dev/null
Binary files differ
diff --git a/static/shuaka/title-icon2.png b/static/shuaka/title-icon2.png
deleted file mode 100644
index 68f03cb..0000000
--- a/static/shuaka/title-icon2.png
+++ /dev/null
Binary files differ
diff --git a/static/store-logo.png b/static/store-logo.png
new file mode 100755
index 0000000..05f1b2c
--- /dev/null
+++ b/static/store-logo.png
Binary files differ
diff --git a/static/title-left.png b/static/title-left.png
deleted file mode 100644
index 0adae28..0000000
--- a/static/title-left.png
+++ /dev/null
Binary files differ
diff --git a/static/title-right.png b/static/title-right.png
deleted file mode 100644
index 06c8ba9..0000000
--- a/static/title-right.png
+++ /dev/null
Binary files differ
--
Gitblit v1.9.1