|
|
|
@ -1,45 +1,89 @@ |
|
|
|
|
<template> |
|
|
|
|
<view> |
|
|
|
|
<view class="width100 height220 backcor008"> |
|
|
|
|
<view class="paddtop40 font24 fcorfff fotct fontlet">商户名称</view> |
|
|
|
|
<view class="paddtop40 font24 fcorfff fotct fontlet">{{storeList.qrCode.storeName}}</view> |
|
|
|
|
<view class="paddtop25 font14 fcorfff fotct fontlet">-请输入金额-</view> |
|
|
|
|
<view class="idcard fcorfff font40 fontlet"> |
|
|
|
|
{{plateNumberStr==''?'¥0.00':'¥'+plateNumberStr}} |
|
|
|
|
</view> |
|
|
|
|
<view class="width40w mart10 line1"></view> |
|
|
|
|
<view class="width50w mart10 line1"></view> |
|
|
|
|
</view> |
|
|
|
|
<!-- 商家优惠 --> |
|
|
|
|
<view class="height50 width100 mart10 backcorfff" |
|
|
|
|
v-if="storeList.discountActivity !== '' && storeList.discountActivity !== null" @click="showPopupstore()"> |
|
|
|
|
<view class="width50 flleft fcor666 font16 alijusstart" style="padding-left: 5%;"> |
|
|
|
|
门店优惠 |
|
|
|
|
</view> |
|
|
|
|
<view class="width40 flright fotrt paddtright15 font15 fcoreb5 alijusend" style="align-items: center;" |
|
|
|
|
v-if="storediscountPrice != 0 && storediscountType !=3"> |
|
|
|
|
-¥{{storediscountPrice}}元 |
|
|
|
|
</view> |
|
|
|
|
<view class="width40 flright fotrt paddtright15 font15 fcoreb5 alijusend" style="align-items: center;" |
|
|
|
|
v-if="storediscountPrice != 0 && storediscountType ==3"> |
|
|
|
|
{{storediscountPrice}}折 |
|
|
|
|
</view> |
|
|
|
|
<view class="width40 flright fotrt paddtright15 font15 fcor666 alijusend" style="align-items: center;" |
|
|
|
|
v-if="storediscountPrice == 0"> |
|
|
|
|
查看商户活动 |
|
|
|
|
</view> |
|
|
|
|
|
|
|
|
|
</view> |
|
|
|
|
<view class=" width90 line1 mart5 marb5"></view> |
|
|
|
|
<!-- 积分抵扣 --> |
|
|
|
|
<view class="fotct mart20 fcor666 font14 fontspec" style="margin-left: 30%;">抵扣金额 : ¥{{priceValue[1] / 10 /10}} |
|
|
|
|
<!-- <view class="height50 width100 backcorfff" v-if="!user" @click="showPopuplogin()"> |
|
|
|
|
<view class="width30 flleft fcor666 font16 alijusstart" style="padding-left: 5%;"> |
|
|
|
|
积分抵扣 |
|
|
|
|
</view> |
|
|
|
|
<view class="width60 flright fotrt paddtright15 font15 fcor666 alijun" style="align-items: center;"> |
|
|
|
|
登陆查可用抵扣积分 |
|
|
|
|
<image style="width: 40rpx;height: 40rpx;" src="../../static/jt.png"></image> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
<view class="width90 alicntend"> |
|
|
|
|
<view class="width90 line1 mart10 marb5" v-if="!user"></view> |
|
|
|
|
<view class="fotct mart10 fcor666 font14 fontspec" style="margin-left: 30%;" v-if="user">抵扣金额 : |
|
|
|
|
¥{{priceValue[1] / 10 /10}} |
|
|
|
|
</view> |
|
|
|
|
<view class="width90 alicntend" v-if="user"> |
|
|
|
|
<view class="width30 font16 fcor666 alijusstart"> |
|
|
|
|
<image mode="widthFix" src="../../static/index1.png" class="iconw25 marglerig"></image> 积分抵扣 |
|
|
|
|
积分抵扣 |
|
|
|
|
</view> |
|
|
|
|
<view class="cj-slider"> |
|
|
|
|
<view class="flleft fotct font14 fcor666" style="width: 15%;">0</view> |
|
|
|
|
<cj-slider style="width: 60%;margin: 0px;" :disabled="cjstu" v-model="priceValue" :min="0" :max="0" |
|
|
|
|
:step="100" :blockWidth="40" @start="blockStart" @moving="blockMoving" @end="blockEnd" /> |
|
|
|
|
<view class="flright fotrt font14 fcor666" style="width: 25%;">0</view> |
|
|
|
|
<cj-slider style="width: 60%;margin: 0px;" :disabled="cjstu" v-if="isDiscount" v-model="priceValue" |
|
|
|
|
:min="0" :max="20000" :step="100" :blockWidth="40" @start="blockStart" @moving="blockMoving" |
|
|
|
|
@end="blockEnd" /> |
|
|
|
|
<view class="flright fotrt font14 fcor666" style="width: 25%;">{{priceValue[1]}}</view> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
<view class="width90 line1 mart10 marb5"></view> |
|
|
|
|
<view class="width90 line1 mart15 marb5" v-if="user"></view> --> |
|
|
|
|
|
|
|
|
|
<!-- 优惠券抵扣 --> |
|
|
|
|
<view class="height50 width100 backcorfff" @click="showPopup()"> |
|
|
|
|
<view class="width50 flleft fcor666 font16 alijusstart" style="padding-left: 5%;"> |
|
|
|
|
<image mode="widthFix" src="../../static/index2.png" class="iconw25 marglerig"></image> 优惠券抵扣 |
|
|
|
|
<view class="height50 width100 backcorfff"> |
|
|
|
|
<view class="width30 flleft fcor666 font16 alijusstart" style="padding-left: 5%;"> |
|
|
|
|
优惠券抵扣 |
|
|
|
|
</view> |
|
|
|
|
<!-- <view class="width40 flright fotrt paddtright10 font15 fontwig6 fcor666 alijun" |
|
|
|
|
style="align-items: center;" v-if="deductionPrice == 0"> |
|
|
|
|
未使用 |
|
|
|
|
<image style="width: 40rpx;height: 40rpx;" src="../../static/img/jt.png"></image> |
|
|
|
|
</view> --> |
|
|
|
|
<view class="width40 flright fotrt paddtright15 font15 fcor666 alijun" style="align-items: center;"> |
|
|
|
|
暂无优惠券 |
|
|
|
|
<view class="width40 flright fotrt paddtright10 font15 fontwig6 fcor666 alijun" style="align-items: center;" |
|
|
|
|
v-if="deductionPrice == 0 && user" @click="showPopup()"> |
|
|
|
|
未使用 |
|
|
|
|
<image style="width: 40rpx;height: 40rpx;" src="../../static/jt.png"></image> |
|
|
|
|
</view> |
|
|
|
|
<view class="width60 flright fotrt paddtright15 font15 fcor666 alijun" style="align-items: center;" |
|
|
|
|
v-if="deductionPrice != 0 && userDiscountType !=3 && user" @click="showPopup()"> |
|
|
|
|
-¥{{deductionPrice}} |
|
|
|
|
<image style="width: 40rpx;height: 40rpx;" src="../../static/jt.png"></image> |
|
|
|
|
</view> |
|
|
|
|
<view class="width60 flright fotrt paddtright15 font15 fcor666 alijun" style="align-items: center;" |
|
|
|
|
v-if="deductionPrice != 0 && userDiscountType ==3 && user" @click="showPopup()"> |
|
|
|
|
{{deductionPrice * 100}}折 |
|
|
|
|
<image style="width: 40rpx;height: 40rpx;" src="../../static/jt.png"></image> |
|
|
|
|
</view> |
|
|
|
|
<view class="width60 flright fotrt paddtright15 font15 fcor666 alijun" style="align-items: center;" |
|
|
|
|
v-if="!user" @click="showPopuplogin()"> |
|
|
|
|
登陆查看可享用优惠券 |
|
|
|
|
<image style="width: 40rpx;height: 40rpx;" src="../../static/jt.png"></image> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
<view class="width90 line1 mart5 marb5"></view> |
|
|
|
|
<view class="width90 line1 mart10 marb5"></view> |
|
|
|
|
<!-- //待支付 --> |
|
|
|
|
<view class="height50 width100 backcorfff"> |
|
|
|
|
<view class="width50 flleft fcor666 font16 alijusstart" style="padding-left: 5%;"> |
|
|
|
@ -77,20 +121,83 @@ |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
|
|
|
|
|
<!-- 优惠券弹窗 scrollY="true" --> |
|
|
|
|
<wybPopup ref="popup" type="bottom" width="500" radius="6" :showCloseIcon="true"> |
|
|
|
|
<!-- 优惠券弹窗 --> |
|
|
|
|
<wybPopup ref="popup" type="bottom" width="500" radius="6" :showCloseIcon="true" scrollY="true"> |
|
|
|
|
<view class="fotct font18 fontwig6 fcor333 mart10 height30">优惠券选择</view> |
|
|
|
|
<view v-if="discountList == ''" class="mart60 fotct font14 fcor666"> |
|
|
|
|
<image mode="widthFix" style="width: 50vw;" src="../../static/noorder.png"></image> |
|
|
|
|
</view> |
|
|
|
|
<view class="width90 height40 tccs mart10 couts" v-for="(items, index) in discountList" :key="items" |
|
|
|
|
@click="radioChanges(items)"> |
|
|
|
|
<view class="margle20"> |
|
|
|
|
<view class="width90 height60 mart20 couts" v-for="(discout, index) in discountList" :key="index" |
|
|
|
|
@click="radioChanges(discout)"> |
|
|
|
|
<view class="alijusstart width94 mart5"> |
|
|
|
|
<view class="font16 width70 fontwig6 fcor333 text1">{{discout.discountName}}</view> |
|
|
|
|
<view class="width30 fotrt"> |
|
|
|
|
<radio :checked="discout.id == memDiscountId" color="#0083f5" /> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
<view class="alijusstart width94 mart5"> |
|
|
|
|
<view class="font14 width40 fcor333" v-if="discout.discountType == 1"> |
|
|
|
|
满{{discout.discountCondition}}-{{discout.discountPrice}}元</view> |
|
|
|
|
<view class="font14 width40 fcor333" v-if="discout.discountType == 2">抵扣{{discout.discountPrice}}元 |
|
|
|
|
</view> |
|
|
|
|
<view class="font14 width40 fcor333" v-if="discout.discountType == 3"> |
|
|
|
|
{{discout.discountPrice * 100}}折 |
|
|
|
|
</view> |
|
|
|
|
<view class="font12 width60 fcor999 fotrt"> |
|
|
|
|
有效期:{{discout.useEndTime | timeFormat('yyyy-mm-dd')}} |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
<view class="height40p"></view> |
|
|
|
|
</wybPopup> |
|
|
|
|
<!-- 门店活动 --> |
|
|
|
|
<wybPopup ref="popupstore" type="bottom" width="500" radius="6" :showCloseIcon="true" scrollY="true"> |
|
|
|
|
<view class="fotct font18 fontwig6 fcor333 mart10 height30">门店活动选择</view> |
|
|
|
|
<view v-if="storeCouponlist == ''" class="mart60 fotct font14 fcor666"> |
|
|
|
|
<image mode="widthFix" style="width: 50vw;" src="../../static/noorder.png"></image> |
|
|
|
|
</view> |
|
|
|
|
<view class="width90 height60 mart20 couts" v-for="(discout, indexs) in storeCouponlist" :key="indexs" |
|
|
|
|
@click="radiostoreChanges(discout)"> |
|
|
|
|
<view class="alijusstart width94 mart5"> |
|
|
|
|
<view class="font16 width70 fontwig6 fcor333 text1">{{discout.name}}</view> |
|
|
|
|
<view class="width30 fotrt"> |
|
|
|
|
<radio :checked="discout.id == storeDiscountId" color="#0083f5" /> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
<view class="alijusstart width94 mart5"> |
|
|
|
|
<view class="font14 width40 fcor333" v-if="discout.discountType == 1"> |
|
|
|
|
满{{discout.discountCondition}}-{{discout.discountPrice}}元</view> |
|
|
|
|
<view class="font14 width40 fcor333" v-if="discout.discountType == 2">抵扣{{discout.discountPrice}}元 |
|
|
|
|
</view> |
|
|
|
|
<view class="font14 width40 fcor333" v-if="discout.discountType == 3">{{discout.discountPrice}}折 |
|
|
|
|
</view> |
|
|
|
|
<view class="font12 width60 fcor999 fotrt"> |
|
|
|
|
有效期:{{discout.endTime | timeFormat('yyyy-mm-dd')}} |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
<!-- <view class="margle20"> |
|
|
|
|
<view class="yhprice"> |
|
|
|
|
<radio :checked="items.id == memDiscountId.indexOf(items.id)" color="#0083f5" /> |
|
|
|
|
<radio :checked="discout.id == storeDiscountId" color="#0083f5" /> |
|
|
|
|
</view> |
|
|
|
|
<view class="font16 fontwig6 fcor333 text1">{{item.name}}</view> |
|
|
|
|
<view class="font16 fontwig6 fcor333 text1">{{discout.name}}</view> |
|
|
|
|
</view> --> |
|
|
|
|
</view> |
|
|
|
|
<view class="height40p"></view> |
|
|
|
|
</wybPopup> |
|
|
|
|
|
|
|
|
|
<wybPopup ref="popups" type="center" height="850" width="600" bgColor="" radius="20" :showCloseIcon="false"> |
|
|
|
|
<!-- <image class="popImg" :src="imagewxUrl+imgadres3" @click="jumpWeb"></image> --> |
|
|
|
|
<!-- <view class="width100 backcorfff" style="height: 400px;"> --> |
|
|
|
|
<view class="form re"> |
|
|
|
|
<view class="username"> |
|
|
|
|
<view class="get-code" style="color: #676767;" @click.stop="getCode()">{{getCodeText}}</view> |
|
|
|
|
<input placeholder="请输入手机号" v-model="phoneNumber" placeholder-style="color: #676767;" /> |
|
|
|
|
</view> |
|
|
|
|
<view class="code mart30"> |
|
|
|
|
<input placeholder="请输入验证码" v-model="code" placeholder-style="color: #676767;" /> |
|
|
|
|
</view> |
|
|
|
|
<view class="btn mart30" @tap="doReg">立即登录</view> |
|
|
|
|
|
|
|
|
|
</view> |
|
|
|
|
</wybPopup> |
|
|
|
|
</view> |
|
|
|
@ -101,12 +208,21 @@ |
|
|
|
|
import cjSlider from '../../components/cj-slider/cj-slider.vue'; |
|
|
|
|
import wybPopup from '../../components/wyb-popup/wyb-popup.vue'; |
|
|
|
|
import { |
|
|
|
|
getQrCodeDetail |
|
|
|
|
getQrCodeDetail, |
|
|
|
|
getH5AccessToken, |
|
|
|
|
createJSAPIOrder, |
|
|
|
|
jsapiPay, |
|
|
|
|
getLoginSMSCode, |
|
|
|
|
phone, |
|
|
|
|
getUserAccount, |
|
|
|
|
queryUserDiscountList, |
|
|
|
|
calculation |
|
|
|
|
} from '../../Utils/Api.js'; |
|
|
|
|
// #ifdef H5 |
|
|
|
|
var jweixin = require('jweixin-module'); |
|
|
|
|
// var unipay = require('uni-pay'); |
|
|
|
|
// #endif |
|
|
|
|
let app = getApp(); |
|
|
|
|
export default { |
|
|
|
|
components: { |
|
|
|
|
passwordInput, |
|
|
|
@ -115,15 +231,17 @@ |
|
|
|
|
}, |
|
|
|
|
data() { |
|
|
|
|
return { |
|
|
|
|
plateNumberList: [], |
|
|
|
|
length: 4, |
|
|
|
|
inputPrice: '', //输入金额 |
|
|
|
|
plateNumberList: [], //输出值 |
|
|
|
|
plateNumberList1: [], //计算值 |
|
|
|
|
length: 11, |
|
|
|
|
discountPrice: 0, //优惠金额 |
|
|
|
|
inputPrice: '', //输入金额 |
|
|
|
|
payPrice: 0, //支付金额 |
|
|
|
|
reNum: 0, // 是否重复 |
|
|
|
|
priceValue: [0, 0], // 可以指定默认值 |
|
|
|
|
discountList: [], //优惠券数据 |
|
|
|
|
memDiscountId: [], //选择中的值 |
|
|
|
|
discountList: '', //优惠券数据 |
|
|
|
|
memDiscountId: '', //选择中的值 |
|
|
|
|
userDiscountType: '', //选择的类型 |
|
|
|
|
numKeybordList: [ |
|
|
|
|
[1, 2, 3], |
|
|
|
|
[4, 5, 6], |
|
|
|
@ -135,69 +253,331 @@ |
|
|
|
|
default: false |
|
|
|
|
}, |
|
|
|
|
cjstu: true, //禁止拖动 |
|
|
|
|
suNo: '' //sn号 |
|
|
|
|
suNo: '', //sn号 |
|
|
|
|
storeList: '', //门店信息 |
|
|
|
|
storeCouponlist: '', //门店优惠券 |
|
|
|
|
isDiscount: true, |
|
|
|
|
user: '', //用户信息 |
|
|
|
|
deductionPrice: '0.00', //优惠券抵扣 |
|
|
|
|
//一键登陆 |
|
|
|
|
phoneNumber: "", |
|
|
|
|
code: '', |
|
|
|
|
getCodeText: '获取验证码', |
|
|
|
|
getCodeBtnColor: "#ffffff", |
|
|
|
|
getCodeisWaiting: false, |
|
|
|
|
|
|
|
|
|
storediscountType: '', //门店优惠类型 |
|
|
|
|
storediscountCondition: '', //门店优惠条件 |
|
|
|
|
storediscountPrice: '', //门店优惠价格 |
|
|
|
|
storeDiscountId: '' //门店活动id |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
mounted() { |
|
|
|
|
// this.openKeyBoard('number'); |
|
|
|
|
}, |
|
|
|
|
mounted() {}, |
|
|
|
|
onLoad: function() { |
|
|
|
|
var arr1 = window.location.href; |
|
|
|
|
var arr2 = arr1.split('='); |
|
|
|
|
var arr3 = arr2[1].split('#/'); |
|
|
|
|
if (arr3[0]) { |
|
|
|
|
this.suNo = arr3[0]; |
|
|
|
|
if (app.globalData.snNo) { |
|
|
|
|
this.getQrCodeDetail(); |
|
|
|
|
} |
|
|
|
|
if (app.globalData.userInfo) { |
|
|
|
|
this.user = app.globalData.userInfo; |
|
|
|
|
this.getUserAccount(); |
|
|
|
|
this.queryUserDiscountList(); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
computed: { |
|
|
|
|
//获取输入金额值 |
|
|
|
|
plateNumberStr() { |
|
|
|
|
let str = ''; |
|
|
|
|
let parice = ''; |
|
|
|
|
this.plateNumberList.forEach(item => { |
|
|
|
|
str += item.toString(); |
|
|
|
|
}) |
|
|
|
|
this.payPrice = str - (this.priceValue[1] / 10 / 10); |
|
|
|
|
if (this.payPrice > 0) { |
|
|
|
|
parice = str - (this.priceValue[1] / 10 / 10); |
|
|
|
|
if (str == 0) { |
|
|
|
|
this.calculation(0); |
|
|
|
|
} |
|
|
|
|
if (str) { |
|
|
|
|
this.calculation(str); |
|
|
|
|
} |
|
|
|
|
if (parice > 0) { |
|
|
|
|
this.cjstu = false; |
|
|
|
|
} else { |
|
|
|
|
this.payPrice = 0; |
|
|
|
|
this.priceValue = [0, 0]; |
|
|
|
|
} |
|
|
|
|
this.inputPrice = str; |
|
|
|
|
return str; |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
|
//查询门店详情 |
|
|
|
|
getQrCodeDetail() { |
|
|
|
|
let datas = { |
|
|
|
|
serialNumber: this.suNo |
|
|
|
|
Timer() {}, |
|
|
|
|
//发送验证码 |
|
|
|
|
getCode() { |
|
|
|
|
uni.hideKeyboard() |
|
|
|
|
if (this.getCodeisWaiting) { |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
getQrCodeDetail(datas).then(res => { |
|
|
|
|
if (res.return_code == '000000') {} |
|
|
|
|
if (!(/^1(3|4|5|6|7|8|9)\d{9}$/.test(this.phoneNumber))) { |
|
|
|
|
uni.showToast({ |
|
|
|
|
title: '请填写正确手机号码', |
|
|
|
|
icon: "none", |
|
|
|
|
duration: 2000 |
|
|
|
|
}); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
uni.showLoading({ |
|
|
|
|
title: '发送中...' |
|
|
|
|
}) |
|
|
|
|
let params = { |
|
|
|
|
phone: this.phoneNumber, |
|
|
|
|
} |
|
|
|
|
getLoginSMSCode(params).then(res => { |
|
|
|
|
uni.hideLoading(); |
|
|
|
|
if (res.return_code == '000000') { |
|
|
|
|
this.getCodeisWaiting = true; |
|
|
|
|
this.getCodeBtnColor = "rgba(255,255,255,0.5)" |
|
|
|
|
uni.showToast({ |
|
|
|
|
title: '验证码已发送', |
|
|
|
|
icon: "none" |
|
|
|
|
}); |
|
|
|
|
this.setTimer(); |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
setTimer() { |
|
|
|
|
let holdTime = 60; |
|
|
|
|
this.getCodeText = "重新获取(60)" |
|
|
|
|
this.Timer = setInterval(() => { |
|
|
|
|
if (holdTime <= 0) { |
|
|
|
|
this.getCodeisWaiting = false; |
|
|
|
|
this.getCodeBtnColor = "#ffffff"; |
|
|
|
|
this.getCodeText = "获取验证码" |
|
|
|
|
clearInterval(this.Timer); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
this.getCodeText = "重新获取(" + holdTime + ")" |
|
|
|
|
holdTime--; |
|
|
|
|
|
|
|
|
|
}, 1000) |
|
|
|
|
}, |
|
|
|
|
//登陆 |
|
|
|
|
doReg() { |
|
|
|
|
uni.hideKeyboard(); |
|
|
|
|
//模板示例部分验证规则 |
|
|
|
|
if (!(/^1(3|4|5|6|7|8|9)\d{9}$/.test(this.phoneNumber))) { |
|
|
|
|
uni.showToast({ |
|
|
|
|
title: '请填写正确手机号码', |
|
|
|
|
icon: "none" |
|
|
|
|
}); |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
if (!this.code) { |
|
|
|
|
uni.showToast({ |
|
|
|
|
title: '请填写验证码', |
|
|
|
|
icon: "none" |
|
|
|
|
}); |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
uni.showLoading({ |
|
|
|
|
title: '提交中...' |
|
|
|
|
}) |
|
|
|
|
let params = { |
|
|
|
|
phone: this.phoneNumber, |
|
|
|
|
smsCode: this.code, |
|
|
|
|
"type": "SMS", |
|
|
|
|
"platform": "H5", |
|
|
|
|
} |
|
|
|
|
phone(params).then(res => { |
|
|
|
|
uni.hideLoading(); |
|
|
|
|
if (res.return_code == '000000') { |
|
|
|
|
app.globalData.userInfo = res.return_data |
|
|
|
|
.object |
|
|
|
|
.highUser; |
|
|
|
|
app.globalData.token = res.return_data.uniqueCode; |
|
|
|
|
this.user = res.return_data |
|
|
|
|
.object |
|
|
|
|
.highUser; |
|
|
|
|
uni.setStorage({ |
|
|
|
|
key: "user", |
|
|
|
|
data: res.return_data |
|
|
|
|
.object |
|
|
|
|
.highUser |
|
|
|
|
}) |
|
|
|
|
uni.setStorage({ |
|
|
|
|
key: "token", |
|
|
|
|
data: res.return_data.uniqueCode |
|
|
|
|
}) |
|
|
|
|
this.$refs.popups.hide(); |
|
|
|
|
this.getQrCodeDetail(); |
|
|
|
|
this.getUserAccount(); |
|
|
|
|
this.queryUserDiscountList(); |
|
|
|
|
} else { |
|
|
|
|
this.showtoastdes = res.return_msg; |
|
|
|
|
uni.showToast({ |
|
|
|
|
title: res.return_msg, |
|
|
|
|
icon: "none", |
|
|
|
|
duration: 2000 |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
//弹出登陆 |
|
|
|
|
showPopuplogin() { |
|
|
|
|
this.$refs.popups.show(); |
|
|
|
|
}, |
|
|
|
|
//显示弹出 |
|
|
|
|
showPopup() { |
|
|
|
|
this.$refs.popup.show(); |
|
|
|
|
}, |
|
|
|
|
//门店活动弹窗 |
|
|
|
|
showPopupstore() { |
|
|
|
|
this.$refs.popupstore.show(); |
|
|
|
|
}, |
|
|
|
|
//查询积分 |
|
|
|
|
getUserAccount() { |
|
|
|
|
getUserAccount().then(res => { |
|
|
|
|
if (res.return_code == '000000') { |
|
|
|
|
this.priceValue[1] = res.return_data.integral; |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
//查询优惠券 |
|
|
|
|
queryUserDiscountList() { |
|
|
|
|
let datas = { |
|
|
|
|
platform: 2, |
|
|
|
|
storeNo: app.globalData.snNo, |
|
|
|
|
status: 1, |
|
|
|
|
pageNum: 1, |
|
|
|
|
pageSize: 9999 |
|
|
|
|
} |
|
|
|
|
queryUserDiscountList(datas).then(res => { |
|
|
|
|
if (res.return_code == '000000') { |
|
|
|
|
this.discountList = res.return_data.list; |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
//计算价格 |
|
|
|
|
calculation(item) { |
|
|
|
|
let storetype = ''; |
|
|
|
|
let storeprice = ''; |
|
|
|
|
if (this.storeList.discountActivity != '' && this.storeList.discountActivity != null) { |
|
|
|
|
if (item >= this.storediscountCondition && (this.storediscountType == 1 || this.storediscountType == |
|
|
|
|
2)) { |
|
|
|
|
storetype = this.storediscountType; |
|
|
|
|
storeprice = this.storediscountPrice; |
|
|
|
|
} else { |
|
|
|
|
storetype = this.storediscountType; |
|
|
|
|
storeprice = this.storediscountPrice; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
let phone = ''; |
|
|
|
|
if (app.globalData.userInfo) { |
|
|
|
|
phone = app.globalData.userInfo.phone; |
|
|
|
|
} |
|
|
|
|
let datas = { |
|
|
|
|
transactionPrice: item, |
|
|
|
|
storeDiscountType: storetype, |
|
|
|
|
storeDiscountPrice: storeprice, |
|
|
|
|
userDiscountType: this.userDiscountType, |
|
|
|
|
userDiscountPrice: this.deductionPrice, |
|
|
|
|
storeDiscountId: this.storeDiscountId, |
|
|
|
|
userPhone: phone |
|
|
|
|
} |
|
|
|
|
calculation(datas).then(res => { |
|
|
|
|
if (res.return_code == '000000') { |
|
|
|
|
this.payPrice = res.return_data; |
|
|
|
|
} else { |
|
|
|
|
this.payPrice = 0; |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
//查询门店详情 |
|
|
|
|
getQrCodeDetail() { |
|
|
|
|
let phone = ''; |
|
|
|
|
if (app.globalData.userInfo) { |
|
|
|
|
phone = app.globalData.userInfo.phone; |
|
|
|
|
} |
|
|
|
|
let datas = { |
|
|
|
|
serialNumber: app.globalData.snNo, |
|
|
|
|
phone: phone |
|
|
|
|
// app.globalData.snNo |
|
|
|
|
// 1000017421 |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
getQrCodeDetail(datas).then(res => { |
|
|
|
|
if (res.return_code == '000000') { |
|
|
|
|
this.storeList = res.return_data; |
|
|
|
|
if (res.return_data.discountActivity) { |
|
|
|
|
this.storeCouponlist = res.return_data.discountActivity; |
|
|
|
|
this.storediscountType = res.return_data.discountActivity[0].discountType; |
|
|
|
|
this.storediscountCondition = res.return_data.discountActivity[0].discountCondition; |
|
|
|
|
this.storediscountPrice = res.return_data.discountActivity[0].discountPrice; |
|
|
|
|
this.storeDiscountId = res.return_data.discountActivity[0].id; |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
uni.showToast({ |
|
|
|
|
title: res.return_msg, |
|
|
|
|
duration: 2000, |
|
|
|
|
icon: 'none' |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
//选择优惠券 |
|
|
|
|
radioChanges(item) { |
|
|
|
|
// this.rechangeload(); |
|
|
|
|
if (this.inputPrice == '') { |
|
|
|
|
uni.showToast({ |
|
|
|
|
title: '请输入正确的支付金额', |
|
|
|
|
duration: 2000, |
|
|
|
|
icon: 'none' |
|
|
|
|
}) |
|
|
|
|
this.payPrice = 0; |
|
|
|
|
this.plateNumberList = []; |
|
|
|
|
this.$refs.popup.hide(); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
if (this.memDiscountId == item.id) { // 如果已经选中,则取消选中 |
|
|
|
|
this.memDiscountId = ''; |
|
|
|
|
this.deductionPrice = '0.00'; |
|
|
|
|
this.userDiscountType = ''; |
|
|
|
|
this.calculation(this.inputPrice); |
|
|
|
|
} else { // 否则进行选中赋值 |
|
|
|
|
this.userDiscountType = item.discountType; |
|
|
|
|
if (item.discountType == 1) { |
|
|
|
|
if (this.inputPrice >= item.discountCondition) { |
|
|
|
|
this.memDiscountId = item.id; |
|
|
|
|
//满减价格 |
|
|
|
|
this.deductionPrice = item.discountPrice; |
|
|
|
|
this.calculation(this.inputPrice); |
|
|
|
|
} else { |
|
|
|
|
uni.showToast({ |
|
|
|
|
title: '请满' + item.discountCondition + '使用此券', |
|
|
|
|
icon: 'none', |
|
|
|
|
duration: 2000 |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (item.discountType == 2) { |
|
|
|
|
this.memDiscountId = item.id; |
|
|
|
|
//抵扣价格 |
|
|
|
|
this.deductionPrice = item.discountPrice; |
|
|
|
|
this.calculation(this.inputPrice); |
|
|
|
|
} |
|
|
|
|
if (item.discountType == 3) { |
|
|
|
|
this.memDiscountId = item.id; |
|
|
|
|
// 打折 |
|
|
|
|
this.deductionPrice = item.discountPrice; |
|
|
|
|
this.calculation(this.inputPrice); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
this.$refs.popup.hide(); |
|
|
|
|
}, |
|
|
|
|
//提交支付 |
|
|
|
|
confirm() { |
|
|
|
|
let lenth = this.plateNumberList.length - 1; |
|
|
|
|
// if (!this.payPrice) { |
|
|
|
|
// uni.showToast({ |
|
|
|
|
// title: '请输入支付金额', |
|
|
|
|
// duration: 2000, |
|
|
|
|
// icon: 'none' |
|
|
|
|
// }) |
|
|
|
|
// return; |
|
|
|
|
// } |
|
|
|
|
if (this.plateNumberList[lenth] == '.') { |
|
|
|
|
|
|
|
|
|
//选择门店优惠 |
|
|
|
|
radiostoreChanges(item) { |
|
|
|
|
if (this.inputPrice == '') { |
|
|
|
|
uni.showToast({ |
|
|
|
|
title: '请输入正确的支付金额', |
|
|
|
|
duration: 2000, |
|
|
|
@ -205,14 +585,70 @@ |
|
|
|
|
}) |
|
|
|
|
this.payPrice = 0; |
|
|
|
|
this.plateNumberList = []; |
|
|
|
|
this.$refs.popupstore.hide(); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
if (this.storeDiscountId == item.id) { // 如果已经选中,则取消选中 |
|
|
|
|
this.storeDiscountId = ''; |
|
|
|
|
this.storediscountPrice = '0.00'; |
|
|
|
|
this.storediscountType = ''; |
|
|
|
|
this.calculation(this.inputPrice); |
|
|
|
|
} else { // 否则进行选中赋值 |
|
|
|
|
this.storediscountType = item.discountType; |
|
|
|
|
if (item.discountType == 1) { |
|
|
|
|
if (this.inputPrice >= item.discountCondition) { |
|
|
|
|
this.storeDiscountId = item.id; |
|
|
|
|
//满减价格 |
|
|
|
|
this.storediscountPrice = item.discountPrice; |
|
|
|
|
this.calculation(this.inputPrice); |
|
|
|
|
} else { |
|
|
|
|
uni.showToast({ |
|
|
|
|
title: '请满' + item.discountCondition + '使用此券', |
|
|
|
|
icon: 'none', |
|
|
|
|
duration: 2000 |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (item.discountType == 2) { |
|
|
|
|
this.storeDiscountId = item.id; |
|
|
|
|
//抵扣价格 |
|
|
|
|
this.storediscountPrice = item.discountPrice; |
|
|
|
|
this.calculation(this.inputPrice); |
|
|
|
|
} |
|
|
|
|
if (item.discountType == 3) { |
|
|
|
|
this.storeDiscountId = item.id; |
|
|
|
|
// 打折 |
|
|
|
|
this.storediscountPrice = item.discountPrice; |
|
|
|
|
this.calculation(this.inputPrice); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
this.$refs.popupstore.hide(); |
|
|
|
|
}, |
|
|
|
|
rechangeload() { |
|
|
|
|
this.isUse = false; |
|
|
|
|
this.$nextTick(() => (this.isUse = true)) |
|
|
|
|
}, |
|
|
|
|
//重定向方法 |
|
|
|
|
jumpWeb() { |
|
|
|
|
var userAgent = navigator.userAgent.toLowerCase(); |
|
|
|
|
if (userAgent.match(/Alipay/i) == "alipay") { |
|
|
|
|
|
|
|
|
|
} else if (userAgent.match(/MicroMessenger/i) == "micromessenger") { |
|
|
|
|
location.href = |
|
|
|
|
'https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxa075e8509802f826&redirect_uri=https%3A%2F%2Fhsgcs.dctpay.com%2Fgratia-pay-scanPay%2Findex.html%23%2F&response_type=code&scope=snsapi_base&#wechat_redirect'; |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
//提交支付 |
|
|
|
|
confirm() { |
|
|
|
|
let lenth = this.plateNumberList.length - 1; |
|
|
|
|
var n = String(this.payPrice) |
|
|
|
|
var t = n.charAt(0) |
|
|
|
|
// 必须保证第一个为数字而不是. |
|
|
|
|
n = n.replace(/^\./g, '') |
|
|
|
|
// 保证只有出现一个.而没有多个. |
|
|
|
|
n = n.replace(/\.{2,}/g, '.') |
|
|
|
|
// || this.plateNumberList[lenth] == '' |
|
|
|
|
if (n == 0) { |
|
|
|
|
uni.showToast({ |
|
|
|
|
title: '请输入正确的支付金额', |
|
|
|
@ -221,18 +657,95 @@ |
|
|
|
|
}) |
|
|
|
|
this.payPrice = 0; |
|
|
|
|
this.plateNumberList = []; |
|
|
|
|
this.plateNumberList1 = []; |
|
|
|
|
this.storediscountType = ''; //门店优惠类型 |
|
|
|
|
this.storediscountCondition = ''; //门店优惠条件 |
|
|
|
|
this.storediscountPrice = ''; //门店优惠价格 |
|
|
|
|
this.storeDiscountId = ''; //门店活动id |
|
|
|
|
this.userDiscountType = ''; |
|
|
|
|
this.deductionPrice = ''; |
|
|
|
|
this.memDiscountId = ''; |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
var userAgent = navigator.userAgent.toLowerCase(); |
|
|
|
|
if (userAgent.match(/Alipay/i) == "alipay") { |
|
|
|
|
alert("支付宝浏览器"); |
|
|
|
|
} else if (userAgent.match(/MicroMessenger/i) == "micromessenger") { |
|
|
|
|
alert("微信浏览器"); |
|
|
|
|
// var userAgent = navigator.userAgent.toLowerCase(); |
|
|
|
|
// if (userAgent.match(/Alipay/i) == "alipay") { |
|
|
|
|
// this.createJSAPIOrder('ALIPAY'); |
|
|
|
|
// } else if (userAgent.match(/MicroMessenger/i) == "micromessenger") { |
|
|
|
|
this.createJSAPIOrder('WECHAT'); |
|
|
|
|
// } |
|
|
|
|
}, |
|
|
|
|
// 创建订单 |
|
|
|
|
createJSAPIOrder(item) { |
|
|
|
|
// "微信:WECHAT 支付宝:ALIPAY 银联:UQRCODEPAY", |
|
|
|
|
let phone = ''; |
|
|
|
|
if (app.globalData.userInfo) { |
|
|
|
|
phone = app.globalData.userInfo.phone; |
|
|
|
|
} |
|
|
|
|
let datas = { |
|
|
|
|
"qrCodeSN": app.globalData.snNo, |
|
|
|
|
"payUserId": app.globalData.openId, |
|
|
|
|
"payMode": item, |
|
|
|
|
"totalAmount": this.inputPrice, |
|
|
|
|
"storeDiscountId": this.storeDiscountId, |
|
|
|
|
"userDiscountId": this.memDiscountId, |
|
|
|
|
"userPhone": phone |
|
|
|
|
} |
|
|
|
|
createJSAPIOrder(datas).then(res => { |
|
|
|
|
if (res.return_code == '000000') { |
|
|
|
|
this.jsapiPay(res.return_data.outTradeNo); |
|
|
|
|
} else { |
|
|
|
|
uni.showToast({ |
|
|
|
|
title: res.return_msg, |
|
|
|
|
duration: 2000, |
|
|
|
|
icon: 'none' |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
//唤起支付参数 |
|
|
|
|
jsapiPay(item) { |
|
|
|
|
let datas = { |
|
|
|
|
outTradeNo: item |
|
|
|
|
} |
|
|
|
|
jsapiPay(datas).then(res => { |
|
|
|
|
if (res.return_code == '000000') { |
|
|
|
|
if (res.return_data.payParam) { |
|
|
|
|
this.payRequest(res.return_data.payParam); |
|
|
|
|
} else { |
|
|
|
|
uni.showToast({ |
|
|
|
|
title: '单比金额最多10000000元', |
|
|
|
|
icon: 'none', |
|
|
|
|
duration: 2000 |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
uni.showToast({ |
|
|
|
|
title: res.return_msg, |
|
|
|
|
duration: 2000, |
|
|
|
|
icon: 'none' |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
//删除金额 |
|
|
|
|
deleteVal() { |
|
|
|
|
this.plateNumberList.pop(); |
|
|
|
|
// this.plateNumberList.pop(); |
|
|
|
|
if (this.plateNumberList1[0] == 0 && this.plateNumberList1[1] == '.' && this.plateNumberList1.length == |
|
|
|
|
2) { |
|
|
|
|
this.plateNumberList = []; |
|
|
|
|
this.plateNumberList1 = []; |
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
|
this.plateNumberList.pop(); |
|
|
|
|
this.plateNumberList1.pop(); |
|
|
|
|
} |
|
|
|
|
// this.priceValue[1] = 0; |
|
|
|
|
this.reload(); |
|
|
|
|
}, |
|
|
|
|
//刷新组件 |
|
|
|
|
reload() { |
|
|
|
|
this.isDiscount = false; |
|
|
|
|
this.$nextTick(() => (this.isDiscount = true)) |
|
|
|
|
}, |
|
|
|
|
blockStart() { |
|
|
|
|
if (this.payPrice > 0) { |
|
|
|
@ -256,36 +769,80 @@ |
|
|
|
|
}, |
|
|
|
|
//输入金额 |
|
|
|
|
input(val) { |
|
|
|
|
if (this.plateNumberList[0] == '.') { |
|
|
|
|
this.plateNumberList1.push(val); |
|
|
|
|
let lists = ''; |
|
|
|
|
this.plateNumberList1.forEach(item => { |
|
|
|
|
lists += item.toString(); |
|
|
|
|
}) |
|
|
|
|
var strdata1 = lists.split('.'); |
|
|
|
|
var strdata2 = /^[0-9]{0,7}(\.[0-9]{1,2})?$/.test(lists); |
|
|
|
|
//第一位输入0时 自动补值 |
|
|
|
|
if (this.plateNumberList1[0] == 0 && this.plateNumberList1.length < 2) { |
|
|
|
|
this.plateNumberList1 = ['0', '.']; |
|
|
|
|
this.plateNumberList = ['0', '.']; |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
//第一位输入小数点时 |
|
|
|
|
if (this.plateNumberList1[0] == '.') { |
|
|
|
|
uni.showToast({ |
|
|
|
|
title: '请输入正确的金额', |
|
|
|
|
duration: 2000, |
|
|
|
|
icon: 'none' |
|
|
|
|
}) |
|
|
|
|
this.plateNumberList1.pop(); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (this.plateNumberList.length >= this.length) { |
|
|
|
|
// if (this.plateNumberList.indexOf('.') == 1 && val == '.') { |
|
|
|
|
// uni.showToast({ |
|
|
|
|
// title: '请输入正确的金额', |
|
|
|
|
// duration: 2000, |
|
|
|
|
// icon: 'none' |
|
|
|
|
// }) |
|
|
|
|
// } |
|
|
|
|
//如果已经有小数点 并且输入的是小数点 |
|
|
|
|
if (strdata1.length == 3 && !strdata2) { |
|
|
|
|
uni.showToast({ |
|
|
|
|
title: '请输入正确的金额', |
|
|
|
|
duration: 2000, |
|
|
|
|
icon: 'none' |
|
|
|
|
}) |
|
|
|
|
this.plateNumberList1.pop(); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
//校验小数点后两 |
|
|
|
|
if (this.plateNumberList.indexOf('.') != -1 && !strdata2) { |
|
|
|
|
uni.showToast({ |
|
|
|
|
title: '请输入正确的金额', |
|
|
|
|
duration: 2000, |
|
|
|
|
icon: 'none' |
|
|
|
|
}) |
|
|
|
|
this.plateNumberList1.pop(); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
//校验没有小数点只能输入不超过7位 |
|
|
|
|
if (this.plateNumberList.length > 7 && this.plateNumberList.indexOf('.') == -1) { |
|
|
|
|
uni.showToast({ |
|
|
|
|
title: '输入金额不能超过最大值', |
|
|
|
|
title: '单比金额最多10000000元', |
|
|
|
|
duration: 2000, |
|
|
|
|
icon: 'none' |
|
|
|
|
}) |
|
|
|
|
this.plateNumberList1.pop(); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
this.plateNumberList.push(val); |
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
//微笑支付 |
|
|
|
|
//微信支付 |
|
|
|
|
payRequest: function(self) { |
|
|
|
|
uni.showLoading({ |
|
|
|
|
title: '支付中...' |
|
|
|
|
}) |
|
|
|
|
jweixin.config({ |
|
|
|
|
// debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。 |
|
|
|
|
appId: self.return_data.appId, // 必填,公众号的唯一标识 |
|
|
|
|
timestamp: self.return_data.timeStamp, // 必填,生成签名的时间戳 |
|
|
|
|
nonceStr: self.return_data.nonceStr, // 必填,生成签名的随机串 |
|
|
|
|
signature: self.return_data.sign, // 必填,签名,见附录1 |
|
|
|
|
debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。 |
|
|
|
|
appId: self.appId, // 必填,公众号的唯一标识 |
|
|
|
|
timestamp: self.timeStamp, // 必填,生成签名的时间戳 |
|
|
|
|
nonceStr: self.nonceStr, // 必填,生成签名的随机串 |
|
|
|
|
signature: self.sign, // 必填,签名,见附录1 |
|
|
|
|
jsApiList: ['chooseWXPay'] // 必填,需要使用的JS接口列表,所有JS接口列表见附录2 |
|
|
|
|
}); |
|
|
|
|
uni.hideLoading(); |
|
|
|
@ -296,14 +853,13 @@ |
|
|
|
|
fail: function(res) {} |
|
|
|
|
}); |
|
|
|
|
jweixin.chooseWXPay({ |
|
|
|
|
appId: self.return_data.appId, |
|
|
|
|
timestamp: self.return_data |
|
|
|
|
appId: self.appId, |
|
|
|
|
timestamp: self |
|
|
|
|
.timeStamp, // 支付签名时间戳,注意微信jssdk中的所有使用timestamp字段均为小写。但最新版的支付后台生成签名使用的timeStamp字段名需大写其中的S字符 |
|
|
|
|
nonceStr: self.return_data.nonceStr, // 支付签名随机串,不长于 32 位 |
|
|
|
|
package: self.return_data |
|
|
|
|
.package, // 统一支付接口返回的prepay_id参数值,提交格式如:prepay_id=***) |
|
|
|
|
signType: 'MD5', // 签名方式,默认为'SHA1',使用新版支付需传入'MD5' |
|
|
|
|
paySign: self.return_data.sign, // 支付签名 |
|
|
|
|
nonceStr: self.nonceStr, // 支付签名随机串,不长于 32 位 |
|
|
|
|
package: self.package, // 统一支付接口返回的prepay_id参数值,提交格式如:prepay_id=***) |
|
|
|
|
signType: self.signType, // 签名方式,默认为'SHA1',使用新版支付需传入'MD5' |
|
|
|
|
paySign: self.sign, // 支付签名 |
|
|
|
|
success: function(res) { |
|
|
|
|
// 支付成功后的回调函数 |
|
|
|
|
uni.showToast({ |
|
|
|
@ -323,26 +879,95 @@ |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
//支付宝支付 |
|
|
|
|
unialiPay() { |
|
|
|
|
// const unipayIns = this.unipay.initAlipay({ |
|
|
|
|
// appId: 'your appId', |
|
|
|
|
// mchId: 'your mchId', |
|
|
|
|
// privateKey: 'your privateKey', |
|
|
|
|
// // 如果不使用证书(普通公钥模式)需要alipayPublicKey |
|
|
|
|
// alipayPublicKey: 'you alipayPublicKey', // 使用支付时需传递此值做返回结果验签 |
|
|
|
|
// // 如果使用证书需要传alipayRootCertPath、appCertPath、alipayPublicCertPath |
|
|
|
|
// alipayRootCertPath: path.join(__dirname,'../fixtures/alipayRootCert.crt'), |
|
|
|
|
// appCertPath: path.join(__dirname,'../fixtures/appCertPublicKey.crt'), |
|
|
|
|
// alipayPublicCertPath: path.join(__dirname,'../fixtures/alipayCertPublicKey_RSA2.crt'), |
|
|
|
|
// }) |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
</script> |
|
|
|
|
|
|
|
|
|
<style lang="scss"> |
|
|
|
|
.form { |
|
|
|
|
width: 100%; |
|
|
|
|
border-radius: 8px; |
|
|
|
|
font-size: 30upx; |
|
|
|
|
position: absolute; |
|
|
|
|
background-color: #FFFFFF; |
|
|
|
|
top: 50px; |
|
|
|
|
|
|
|
|
|
.username, |
|
|
|
|
.password, |
|
|
|
|
.code { |
|
|
|
|
width: calc(100% - 90upx); |
|
|
|
|
height: 90upx; |
|
|
|
|
display: flex; |
|
|
|
|
align-items: center; |
|
|
|
|
background-color: rgba($color: #ffffff, $alpha: 0.1); |
|
|
|
|
border-bottom: 1px solid #f6f6f6; |
|
|
|
|
padding: 0 45upx; |
|
|
|
|
// margin-bottom: 80upx; |
|
|
|
|
margin-top: 30px; |
|
|
|
|
|
|
|
|
|
input { |
|
|
|
|
width: 60%; |
|
|
|
|
height: 50upx; |
|
|
|
|
font-size: 16px; |
|
|
|
|
color: #333333; |
|
|
|
|
font-weight: blod; |
|
|
|
|
padding-left: 10px; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.btn { |
|
|
|
|
color: #FFFFFF; |
|
|
|
|
background-color: #0083f5; |
|
|
|
|
width: 80%; |
|
|
|
|
margin-left: 10%; |
|
|
|
|
margin-top: 80rpx; |
|
|
|
|
margin-bottom: 50rpx; |
|
|
|
|
height: 90rpx; |
|
|
|
|
display: flex; |
|
|
|
|
justify-content: center; |
|
|
|
|
align-items: center; |
|
|
|
|
border-radius: 45rpx; |
|
|
|
|
font-size: 28rpx; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.re { |
|
|
|
|
.username { |
|
|
|
|
position: relative; |
|
|
|
|
|
|
|
|
|
.get-code { |
|
|
|
|
position: absolute; |
|
|
|
|
height: 90upx; |
|
|
|
|
display: flex; |
|
|
|
|
align-items: center; |
|
|
|
|
justify-content: center; |
|
|
|
|
right: 0; |
|
|
|
|
padding: 0 40upx; |
|
|
|
|
z-index: 3; |
|
|
|
|
|
|
|
|
|
&:after { |
|
|
|
|
content: " "; |
|
|
|
|
width: 1upx; |
|
|
|
|
height: 50upx; |
|
|
|
|
position: absolute; |
|
|
|
|
z-index: 3; |
|
|
|
|
margin-right: 100%; |
|
|
|
|
left: 0; |
|
|
|
|
top: 20upx; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.res { |
|
|
|
|
display: flex; |
|
|
|
|
justify-content: center; |
|
|
|
|
align-items: center; |
|
|
|
|
height: 100upx; |
|
|
|
|
color: rgba($color: #ffffff, $alpha: 0.8); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.idcard { |
|
|
|
|
padding-top: 40rpx; |
|
|
|
|
text-align: center; |
|
|
|
|