| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253 |
- <template>
- <u-popup :show="payshow" @close="payclose" @open="payopen" round="12" :closeable="true">
- <view :class="[AppTheme]" class="app">
- <view class="price-box">
- <text>支付金额</text>
- <text class="price text-neutral">{{params.money}}</text>
- </view>
- <view class="pay-type-list">
- <radio-group>
- <view v-if="weixinpay2" class="type-item b-b" @click="changepaytype(1)">
- <u-icon name="weixin-fill" color="#62b900" size="30"></u-icon>
- <view class="con">
- <text class="tit">微信支付</text>
- <text style="padding-top: 10rpx;">推荐使用微信支付</text>
- </view>
- <label class="radio">
- <radio value="1" :color="primary" :checked='params.paytype == 1' />
- </radio>
- </label>
- </view>
- <!-- #ifdef APP-PLUS || H5 -->
- <view v-if="alipay2" class="type-item" @click="changepaytype(3)">
- <u-icon name="zhifubao" color="rgb(85, 170, 255)" size="30"></u-icon>
- <view class="con">
- <text class="tit">支付宝支付</text>
- </view>
- <label class="radio">
- <radio value="3" :color="primary" :checked='params.paytype == 3' />
- </radio>
- </label>
- </view>
- <!-- #endif -->
- <view v-if="zhtpay" class="type-item" @click="changepaytype(2)">
- <u-icon name="red-packet-fill" color="rgb(224, 116, 114)" size="30"></u-icon>
- <view class="con">
- <text class="tit">余额支付</text>
- <text style="padding-top: 10rpx;">可用余额 ¥{{balance}}</text>
- </view>
- <label class="radio">
- <radio value="2" :color="primary" :checked='params.paytype == 2' />
- </radio>
- </label>
- </view>
- </radio-group>
- </view>
- <text class="mix-btn bg-linear-gradient" @click="confirm">确认支付</text>
- <u-keyboard ref="uKeyboard" mode="number" :tooltip="false" :safeAreaInsetBottom="true" :overlay="true"
- :closeOnClickOverlay="true" :dotDisabled="false" @change="onChange" @backspace="onBackspace"
- :show="show">
- <view>
- <view class="u-text-center u-padding-20 money">
- <view class="text-neutral">
- <text>{{params.money}}</text>
- <text class="u-font-20 u-padding-left-10">元</text>
- </view>
- <view class="u-padding-10 close" data-flag="false" @tap="showPop(false)">
- <u-icon name="close" color="#333333" size="28"></u-icon>
- </view>
- </view>
- <view class="u-flex u-row-center codeinput" style="margin: 20rpx 0; padding: auto;100%;">
- <u-code-input :color="primary" :borderColor="primary" :space="20" size="40" mode="box"
- :maxlength="6" :dot="true" v-model="password" :disabledKeyboard="true" @finish="finish">
- </u-code-input>
- </view>
- </view>
- </u-keyboard>
- </view>
- </u-popup>
- </template>
- <script>
- // #ifdef H5
- var wx = require('jweixin-module');
- // #endif
- import wallApi from '@/api/wall/index.js';
- import cart from '@/api/cart/index.js';
- import api from '@/api/mall/index.js';
- import adoptApi from '@/api/home/index.js';
- import {
- allKeys
- } from '../../js/underscore';
- export default {
- name: "payment",
- props: ["channel", "weixinpay", "alipay", "zhtpay"], //1:(商品,砍价 ,拼团),2:认养,,3:充值,4:租地,5:活动,6:保证金
- data() {
- return {
- primary: this.$theme.primary,
- settingFile: getApp().globalData.siteinfo,
- payshow: false,
- show: false,
- password: '',
- balance: 0,
- params: {
- // 支付方式
- paytype: 1, //1:微信,2:余额,3:支付宝
- systype: '', //h5 或 app 或 mpweixin
- money: 0
- },
- weixinpay2: false,
- alipay2: false,
- };
- },
- created() {
- let that = this;
- wallApi.income({}).then(res => {
- if (res.status == 200) {
- that.balance = res.data.money; //余额
- }
- });
- let config = that.$init_config(1, function(res) {
- if (res && res.app) {
- that.weixinpay2 = res.app.pay.wx.isopen;
- that.alipay2 = res.app.pay.ali.isopen;
- }
- });
- },
- methods: {
- init(data) {
- let that = this;
- if (data) {
- that.params = data;
- that.params.money = parseFloat(that.params.money).toFixed(2);
- // #ifdef APP-PLUS
- that.params.systype = 'app'
- // #endif
- // #ifdef H5
- that.params.systype = 'h5'
- // #endif
- // #ifdef MP-WEIXIN
- that.params.systype = 'mpweixin'
- // #endif
- }
- },
- payopen(data) {
- let that = this;
- that.init(data);
- that.payshow = true;
- },
- payclose() {
- let that = this;
- that.payshow = false;
- },
- changepaytype(type) {
- let that = this;
- that.params.paytype = type;
- },
- confirm() {
- let that = this;
- if (that.params.paytype == 1) {
- that.paywx();
- } else if (that.params.paytype == 2) {
- if (that.channel != 3) {
- that.show = true;
- that.password = ''
- } else {
- uni.showToast({
- title: '请选择正确的支付方式',
- icon: 'none'
- })
- return;
- }
- } else if (that.params.paytype == 3) {
- that.payali();
- } else {
- uni.showToast({
- title: '请选择正确的支付方式',
- icon: 'none'
- })
- return;
- }
- },
- onChange(val) {
- let that = this;
- if (that.password.length < 6) {
- that.password += val;
- }
- if (that.password.length >= 6) {
- if (that.params.paytype == 1) {
- that.paywx();
- } else if (that.params.paytype == 2) {
- that.paybalance();
- }
- }
- },
- onBackspace(e) {
- let that = this;
- if (that.password.length > 0) {
- that.password = that.password.substring(0, that.password.length - 1);
- }
- },
- paywx() {
- let that = this;
- if (that.channel == 1) {
- that.$paycenter.paygood(that.params).then(res => {
- if (res.status === 0 || res.code === 0) {
- uni.showToast({
- title: res.msg,
- icon: 'none'
- })
- } else {
- // #ifdef APP-PLUS
- that.wxPayAPPPLUS(res.data)
- // #endif
- // #ifdef H5
- that.wxPayH5(res.data)
- // #endif
- // #ifdef MP-WEIXIN
- that.wxPayWEIXIN(res.data)
- // #endif
- }
- })
- } else if (that.channel == 2) {
- that.$paycenter.payrenyang(that.params).then(res => {
- if (res.status === 0 || res.code === 0) {
- uni.showToast({
- title: res.msg,
- icon: 'none'
- })
- } else {
- // #ifdef APP-PLUS
- that.wxPayAPPPLUS(res.data)
- // #endif
- // #ifdef H5
- that.wxPayH5(res.data)
- // #endif
- // #ifdef MP-WEIXIN
- that.wxPayWEIXIN(res.data)
- // #endif
- }
- })
- } else if (that.channel == 3) {
- that.$paycenter.paycz(that.params).then(res => {
- if (res.status === 0 || res.code === 0) {
- uni.showToast({
- title: res.msg,
- icon: 'none'
- })
- } else {
- // #ifdef APP-PLUS
- that.wxPayAPPPLUS(res.data)
- // #endif
- // #ifdef H5
- that.wxPayH5(res.data)
- // #endif
- // #ifdef MP-WEIXIN
- that.wxPayWEIXIN(res.data)
- // #endif
- }
- })
- } else if (that.channel == 4) {
- that.$paycenter.payland(that.params).then(res => {
- if (res.status === 0 || res.code === 0) {
- uni.showToast({
- title: res.msg,
- icon: 'none'
- })
- } else {
- // #ifdef APP-PLUS
- that.wxPayAPPPLUS(res.data)
- // #endif
- // #ifdef H5
- that.wxPayH5(res.data)
- // #endif
- // #ifdef MP-WEIXIN
- that.wxPayWEIXIN(res.data)
- // #endif
- }
- })
- } else if (that.channel == 5) {
- that.$paycenter.payactivity(that.params).then(res => {
- if (res.status === 0 || res.code === 0) {
- uni.showToast({
- title: res.msg,
- icon: 'none'
- })
- } else {
- // #ifdef APP-PLUS
- that.wxPayAPPPLUS(res.data)
- // #endif
- // #ifdef H5
- that.wxPayH5(res.data)
- // #endif
- // #ifdef MP-WEIXIN
- that.wxPayWEIXIN(res.data)
- // #endif
- }
- })
- } else if (that.channel == 6) {
- that.$paycenter.renewal(that.params).then(res => {
- if (res.status === 0 || res.code === 0) {
- uni.showToast({
- title: res.msg,
- icon: 'none'
- })
- } else {
- // #ifdef APP-PLUS
- that.wxPayAPPPLUS(res.data)
- // #endif
- // #ifdef H5
- that.wxPayH5(res.data)
- // #endif
- // #ifdef MP-WEIXIN
- that.wxPayWEIXIN(res.data)
- // #endif
- }
- })
- } else if (that.channel == 7) {
- that.$paycenter.seedpay(that.params).then(res => {
- if (res.status === 0 || res.code === 0) {
- uni.showToast({
- title: res.msg,
- icon: 'none'
- })
- } else {
- // #ifdef APP-PLUS
- that.wxPayAPPPLUS(res.data)
- // #endif
- // #ifdef H5
- that.wxPayH5(res.data)
- // #endif
- // #ifdef MP-WEIXIN
- that.wxPayWEIXIN(res.data)
- // #endif
- }
- })
- } else if (that.channel == 8) {
- that.$paycenter.payserve(that.params).then(res => {
- if (res.status === 0 || res.code === 0) {
- uni.showToast({
- title: res.msg,
- icon: 'none'
- })
- } else {
- // #ifdef APP-PLUS
- that.wxPayAPPPLUS(res.data)
- // #endif
- // #ifdef H5
- that.wxPayH5(res.data)
- // #endif
- // #ifdef MP-WEIXIN
- that.wxPayWEIXIN(res.data)
- // #endif
- }
- })
- } else if (that.channel == 9) {
- that.$paycenter.operator(that.params).then(res => {
- if (res.status === 0 || res.code === 0) {
- uni.showToast({
- title: res.msg,
- icon: 'none'
- })
- } else {
- // #ifdef APP-PLUS
- that.wxPayAPPPLUS(res.data)
- // #endif
- // #ifdef H5
- that.wxPayH5(res.data)
- // #endif
- // #ifdef MP-WEIXIN
- that.wxPayWEIXIN(res.data)
- // #endif
- }
- })
- } else if (that.channel == 10) {
- that.$paycenter.paybond(that.params).then(res => {
- if (res.status === 0 || res.code === 0) {
- uni.showToast({
- title: res.msg,
- icon: 'none'
- })
- } else {
- // #ifdef APP-PLUS
- that.wxPayAPPPLUS(res.data)
- // #endif
- // #ifdef H5
- that.wxPayH5(res.data)
- // #endif
- // #ifdef MP-WEIXIN
- that.wxPayWEIXIN(res.data)
- // #endif
- }
- })
- }
- },
- payali() {
- let that = this;
- if (that.channel == 1) {
- that.$paycenter.paygood(that.params).then(res => {
- if (res.status === 0 || res.code === 0) {
- uni.showToast({
- title: res.msg,
- icon: 'none'
- })
- } else {
- // #ifdef APP-PLUS
- that.aliPayAPPPLUS(res.data)
- // #endif
- // #ifdef H5
- that.aliPayH5(res.data)
- // #endif
- }
- })
- } else if (that.channel == 2) {
- that.$paycenter.payrenyang(that.params).then(res => {
- if (res.status === 0 || res.code === 0) {
- uni.showToast({
- title: res.msg,
- icon: 'none'
- })
- } else {
- // #ifdef APP-PLUS
- that.aliPayAPPPLUS(res.data)
- // #endif
- // #ifdef H5
- that.aliPayH5(res.data)
- // #endif
- }
- })
- } else if (that.channel == 3) {
- that.$paycenter.paycz(that.params).then(res => {
- if (res.status === 0 || res.code === 0) {
- uni.showToast({
- title: res.msg,
- icon: 'none'
- })
- } else {
- // #ifdef APP-PLUS
- that.aliPayAPPPLUS(res.data)
- // #endif
- // #ifdef H5
- that.aliPayH5(res.data)
- // #endif
- }
- })
- } else if (that.channel == 4) {
- that.$paycenter.payland(that.params).then(res => {
- if (res.status === 0 || res.code === 0) {
- uni.showToast({
- title: res.msg,
- icon: 'none'
- })
- } else {
- // #ifdef APP-PLUS
- that.aliPayAPPPLUS(res.data)
- // #endif
- // #ifdef H5
- that.aliPayH5(res.data)
- // #endif
- }
- })
- } else if (that.channel == 5) {
- that.$paycenter.payactivity(that.params).then(res => {
- if (res.status === 0 || res.code === 0) {
- uni.showToast({
- title: res.msg,
- icon: 'none'
- })
- } else {
- // #ifdef APP-PLUS
- that.aliPayAPPPLUS(res.data)
- // #endif
- // #ifdef H5
- that.aliPayH5(res.data)
- // #endif
- }
- })
- } else if (that.channel == 6) {
- that.$paycenter.renewal(that.params).then(res => {
- if (res.status === 0 || res.code === 0) {
- uni.showToast({
- title: res.msg,
- icon: 'none'
- })
- } else {
- // #ifdef APP-PLUS
- that.aliPayAPPPLUS(res.data)
- // #endif
- // #ifdef H5
- that.aliPayH5(res.data)
- // #endif
- }
- })
- } else if (that.channel == 7) {
- that.$paycenter.seedpay(that.params).then(res => {
- if (res.status === 0 || res.code === 0) {
- uni.showToast({
- title: res.msg,
- icon: 'none'
- })
- } else {
- // #ifdef APP-PLUS
- that.aliPayAPPPLUS(res.data)
- // #endif
- // #ifdef H5
- that.aliPayH5(res.data)
- // #endif
- }
- })
- } else if (that.channel == 8) {
- that.$paycenter.payserve(that.params).then(res => {
- if (res.status === 0 || res.code === 0) {
- uni.showToast({
- title: res.msg,
- icon: 'none'
- })
- } else {
- // #ifdef APP-PLUS
- that.aliPayAPPPLUS(res.data)
- // #endif
- // #ifdef H5
- that.aliPayH5(res.data)
- // #endif
- }
- })
- } else if (that.channel == 9) {
- that.$paycenter.operator(that.params).then(res => {
- if (res.status === 0 || res.code === 0) {
- uni.showToast({
- title: res.msg,
- icon: 'none'
- })
- } else {
- // #ifdef APP-PLUS
- that.aliPayAPPPLUS(res.data)
- // #endif
- // #ifdef H5
- that.aliPayH5(res.data)
- // #endif
- }
- })
- } else if (that.channel == 10) {
- that.$paycenter.paybond(that.params).then(res => {
- if (res.status === 0 || res.code === 0) {
- uni.showToast({
- title: res.msg,
- icon: 'none'
- })
- } else {
- // #ifdef APP-PLUS
- that.aliPayAPPPLUS(res.data)
- // #endif
- // #ifdef H5
- that.aliPayH5(res.data)
- // #endif
- }
- })
- }
- },
- paybalance() {
- let that = this;
- if (that.channel == 1) {
- that.paybalance1()
- } else if (that.channel == 2) {
- that.paybalance2()
- } else if (that.channel == 4) {
- that.paybalance4()
- } else if (that.channel == 5) {
- that.paybalance5()
- } else if (that.channel == 6) {
- that.paybalance6()
- } else if (that.channel == 7) {
- that.paybalance7()
- } else if (that.channel == 8) {
- that.paybalance8()
- } else if (that.channel == 9) {
- that.paybalance9()
- } else if (that.channel == 10) {
- that.paybalance10()
- }
- },
- wxPayWEIXIN(paydata) {
- let that = this;
- uni.requestPayment({
- provider: 'wxpay',
- timeStamp: paydata.timeStamp,
- nonceStr: paydata.nonceStr,
- package: paydata.package,
- signType: paydata.signType,
- paySign: paydata.paySign,
- success: function(res) {
- uni.showToast({
- title: '支付成功',
- icon: 'success',
- duration: 1500
- });
- that.payfinish()
- },
- fail: function(err) {
- console.log('err', err)
- }
- });
- },
- wxPayH5(paydata) {
- let that = this;
- wx.config({
- debug: false,
- appId: paydata.appid, // 必填,公众号的唯一标识
- timestamp: paydata.timeStamp, // 必填,生成签名的时间戳
- nonceStr: paydata.nonceStr, // 必填,生成签名的随机串
- signature: paydata.paySign,
- jsApiList: ['chooseWXPay']
- });
- wx.ready(function() {
- wx.chooseWXPay({
- timestamp: paydata.timeStamp,
- nonceStr: paydata.nonceStr, // 支付签名随机串,不长于 32 位
- package: paydata.package,
- signType: 'MD5', // 签名方式,默认为'SHA1',使用新版支付需传入'MD5'
- paySign: paydata.paySign, // 支付签名
- success(res) {
- that.payfinish()
- },
- fail(err) {
- console.log('fail', err)
- uni.showToast({
- icon: 'none',
- title: '未完成支付!'
- })
- }
- });
- });
- },
- wxPayAPPPLUS(paydata) {
- let that = this;
- console.log('paydata',paydata)
- uni.requestPayment({
- provider: 'wxpay',
- orderInfo: paydata,
- success: function(res) {
- uni.showToast({
- title: '支付成功',
- icon: 'success',
- duration: 1500
- });
- that.payfinish()
- },
- fail: function(err) {
- console.log('fail', err)
- uni.showToast({
- title: err.errMsg,
- icon: 'none'
- })
- }
- });
- },
- aliPayH5(paydata) {
- let that = this;
- uni.showToast({
- icon: 'none',
- title: '暂未开放!'
- })
- wx.config({
- debug: false,
- appId: paydata.appid, // 必填,公众号的唯一标识
- timestamp: paydata.timeStamp, // 必填,生成签名的时间戳
- nonceStr: paydata.nonceStr, // 必填,生成签名的随机串
- signature: paydata.paySign,
- jsApiList: ['chooseWXPay']
- });
- wx.ready(function() {
- wx.chooseWXPay({
- timestamp: paydata.timeStamp,
- nonceStr: paydata.nonceStr, // 支付签名随机串,不长于 32 位
- package: paydata.package,
- signType: 'MD5', // 签名方式,默认为'SHA1',使用新版支付需传入'MD5'
- paySign: paydata.paySign, // 支付签名
- success(res) {
- that.payfinish()
- },
- fail(err) {
- console.log('fail', err)
- uni.showToast({
- icon: 'none',
- title: '未完成支付!'
- })
- }
- });
- });
- },
- aliPayAPPPLUS(paydata) {
- let that = this;
- console.log('paydata', paydata)
- uni.requestPayment({
- provider: 'alipay',
- orderInfo: paydata,
- success: function(res) {
- uni.showToast({
- title: '支付成功',
- icon: 'success',
- duration: 1500
- });
- that.payfinish()
- },
- fail: function(err) {
- console.log('fail', err)
- uni.showToast({
- title: err.errMsg,
- icon: 'none'
- })
- }
- });
- },
- //余额支付
- paybalance1() {
- let that = this;
- cart.checkPayPassword({
- password: that.password
- }).then(res => {
- uni.hideLoading();
- if (res.status == 200) {
- var pdata = {
- orderid: that.params.orderid,
- djqid: that.params.djqid,
- type: that.params.paytype == 1 ? 'wxpay' : 'money',
- paypass: that.password
- };
- api.pay(pdata)
- .then(res => {
- uni.showToast({
- title: res.msg,
- icon: "none"
- });
- if (res.status == 200) {
- that.payfinish()
- }
- });
- } else {
- uni.showToast({
- title: res.msg,
- icon: "none"
- });
- if (res.msg === '未设置支付密码,现在进行设置!') {
- setTimeout(() => {
- uni.navigateTo({
- url: '/pagesD/pages/set/changemima/changemima'
- })
- }, 1000)
- }
- }
- })
- },
- //余额支付
- paybalance2() {
- let that = this;
- cart.checkPayPassword({
- password: that.password
- }).then(res => {
- uni.hideLoading();
- if (res.status == 200) {
- var pdata = {
- orderid: that.params.orderid,
- djqid: that.params.djqid,
- type: that.params.paytype == 1 ? 'wxpay' : 'money',
- paypass: that.password
- };
- adoptApi.payNew(pdata)
- .then(res => {
- uni.showToast({
- title: res.msg,
- icon: "none"
- });
- if (res.status == 200) {
- that.payfinish()
- }
- });
- } else {
- uni.showToast({
- title: res.msg,
- icon: "none"
- });
- if (res.msg === '未设置支付密码,现在进行设置!') {
- setTimeout(() => {
- uni.navigateTo({
- url: '/pagesD/pages/set/changemima/changemima'
- })
- }, 1000)
- }
- }
- })
- },
- //余额支付
- paybalance4() {
- let that = this;
- cart.checkPayPassword({
- password: that.password
- }).then(res => {
- uni.hideLoading();
- if (res.status == 200) {
- let pdata = {
- order_info: JSON.stringify(that.params)
- };
- that.$paycenter.pay_soil_money(pdata)
- .then(res => {
- uni.showToast({
- title: res.msg,
- icon: "none"
- });
- if (res.status == 200) {
- that.payfinish()
- }
- });
- } else {
- uni.showToast({
- title: res.msg,
- icon: "none"
- });
- if (res.msg === '未设置支付密码,现在进行设置!') {
- setTimeout(() => {
- uni.navigateTo({
- url: '/pagesD/pages/set/changemima/changemima'
- })
- }, 1000)
- }
- }
- })
- },
- //余额支付
- paybalance5() {
- let that = this;
- cart.checkPayPassword({
- password: that.password
- }).then(res => {
- uni.hideLoading();
- if (res.status == 200) {
- that.$paycenter.pay_ac_money(that.params)
- .then(res => {
- uni.showToast({
- title: res.msg,
- icon: "none"
- });
- if (res.status == 200) {
- that.payfinish()
- }
- });
- } else {
- uni.showToast({
- title: res.msg,
- icon: "none"
- });
- if (res.msg === '未设置支付密码,现在进行设置!') {
- setTimeout(() => {
- uni.navigateTo({
- url: '/pagesD/pages/set/changemima/changemima'
- })
- }, 1000)
- }
- }
- })
- },
- //余额支付
- paybalance6() {
- let that = this;
- cart.checkPayPassword({
- password: that.password
- }).then(res => {
- uni.hideLoading();
- if (res.status == 200) {
- that.$paycenter.pay_renewal_money(that.params)
- .then(res => {
- uni.showToast({
- title: res.msg,
- icon: "none"
- });
- if (res.status == 200) {
- uni.showToast({
- title: res.msg,
- icon: "none"
- });
- setTimeout(() => {
- uni.navigateTo({
- url: '/pagesE/pages/plotdetails/plotdetails?orderid=' +
- that.params.orderid
- })
- }, 2000)
- }
- });
- } else {
- uni.showToast({
- title: res.msg,
- icon: "none"
- });
- if (res.msg === '未设置支付密码,现在进行设置!') {
- setTimeout(() => {
- uni.navigateTo({
- url: '/pagesD/pages/set/changemima/changemima'
- })
- }, 1000)
- }
- }
- })
- },
- //余额支付
- paybalance7() {
- let that = this;
- cart.checkPayPassword({
- password: that.password
- }).then(res => {
- uni.hideLoading();
- if (res.status == 200) {
- that.$paycenter.pay_seed_money(that.params)
- .then(res => {
- uni.showToast({
- title: res.msg,
- icon: "none"
- });
- if (res.status == 200) {
- uni.showToast({
- title: res.msg,
- icon: "none"
- });
- setTimeout(() => {
- uni.navigateTo({
- url: '/pagesE/pages/plotdetails/plotdetails?orderid=' +
- that.params.orderid
- })
- }, 2000)
- }
- });
- } else {
- uni.showToast({
- title: res.msg,
- icon: "none"
- });
- if (res.msg === '未设置支付密码,现在进行设置!') {
- setTimeout(() => {
- uni.navigateTo({
- url: '/pagesD/pages/set/changemima/changemima'
- })
- }, 1000)
- }
- }
- })
- },
- //余额支付
- paybalance8() {
- let that = this;
- cart.checkPayPassword({
- password: that.password
- }).then(res => {
- uni.hideLoading();
- if (res.status == 200) {
- that.$paycenter.pay_serve_money(that.params)
- .then(res => {
- uni.showToast({
- title: res.msg,
- icon: "none"
- });
- if (res.status == 200) {
- uni.showToast({
- title: res.msg,
- icon: "none"
- });
- setTimeout(() => {
- uni.navigateTo({
- url: '/pagesE/pages/plotdetails/plotdetails?orderid=' +
- that.params.orderid
- })
- }, 2000)
- }
- });
- } else {
- uni.showToast({
- title: res.msg,
- icon: "none"
- });
- if (res.msg === '未设置支付密码,现在进行设置!') {
- setTimeout(() => {
- uni.navigateTo({
- url: '/pagesD/pages/set/changemima/changemima'
- })
- }, 1000)
- }
- }
- })
- },
- //余额支付
- paybalance9() {
- let that = this;
- cart.checkPayPassword({
- password: that.password
- }).then(res => {
- uni.hideLoading();
- if (res.status == 200) {
- that.$paycenter.pay_operator_money(that.params)
- .then(res => {
- uni.showToast({
- title: res.msg,
- icon: "none"
- });
- if (res.status == 200) {
- uni.showToast({
- title: res.msg,
- icon: "none"
- });
- console.log(that.params.type, 'that.params.type')
- if (that.params.type == 2) {
- setTimeout(() => {
- uni.navigateTo({
- url: '/pagesE/pages/seedlist/decoration/decoration?id=' +
- that.params.order_id
- })
- }, 2000)
- } else {
- setTimeout(() => {
- uni.navigateTo({
- url: '/pagesE/pages/seedlist/crop?id=' + that
- .params.seed_id
- })
- }, 2000)
- }
- }
- });
- } else {
- uni.showToast({
- title: res.msg,
- icon: "none"
- });
- if (res.msg === '未设置支付密码,现在进行设置!') {
- setTimeout(() => {
- uni.navigateTo({
- url: '/pagesD/pages/set/changemima/changemima'
- })
- }, 1000)
- }
- }
- })
- },
- //余额支付
- paybalance10() {
- let that = this;
- cart.checkPayPassword({
- password: that.password
- }).then(res => {
- uni.hideLoading();
- if (res.status == 200) {
- that.$paycenter.pay_bond_money(that.params)
- .then(res => {
- uni.showToast({
- title: res.msg,
- icon: "none"
- });
- if (res.status == 200) {
- uni.showToast({
- title: res.msg,
- icon: "none"
- });
- setTimeout(() => {
- uni.navigateTo({
- url: '/pagesC/pages/merchantdetails/bond'
- })
- }, 1000)
- }
- });
- } else {
- uni.showToast({
- title: res.msg,
- icon: "none"
- });
- if (res.msg === '未设置支付密码,现在进行设置!') {
- setTimeout(() => {
- uni.navigateTo({
- url: '/pagesD/pages/set/changemima/changemima'
- })
- }, 1000)
- }
- }
- })
- },
- showPop(flag = true) {
- let that = this;
- that.password = '';
- that.show = flag;
- },
- finish() {
- },
- payfinish() {
- let that = this;
- if (that.channel == 3) {
- that.payclose();
- //1:(商品,砍价 ,拼团),2:认养,,3:充值,4:租地,5:活动
- uni.navigateBack(-1);
- } else if (that.channel == 10) {
- that.payclose();
- uni.navigateTo({
- url: '/pagesC/pages/merchantdetails/bond'
- });
- } else {
- setTimeout(function() {
- //1:(商品,砍价 ,拼团),2:认养,,3:充值,4:租地,5:活动
- uni.navigateTo({
- url: '/pagesE/pages/common/paySuccess?channel=' + that.channel
- });
- }, 1000)
- }
- }
- }
- }
- </script>
- <style lang='scss'>
- .codeinput {
- justify-content: space-evenly;
- display: flex;
- }
- .app {
- width: 100%;
- }
- .money {
- font-size: 80rpx;
- position: relative;
- text-align: center;
- .close {
- position: absolute;
- top: 20rpx;
- right: 20rpx;
- line-height: 28rpx;
- font-size: 28rpx;
- }
- }
- .tips {
- color: $u-tips-color;
- text-align: center;
- }
- .price-box {
- background-color: #fff;
- height: 160rpx;
- display: flex;
- flex-direction: column;
- justify-content: center;
- align-items: center;
- font-size: 28upx;
- color: #909399;
- .price {
- font-size: 50upx;
- margin-top: 12upx;
- &:before {
- content: '¥';
- font-size: 40upx;
- }
- }
- }
- .pay-type-list {
- /* margin-top: 20upx; */
- background-color: #fff;
- padding-left: 60upx;
- .type-item {
- height: 120upx;
- display: flex;
- justify-content: space-between;
- align-items: center;
- padding-right: 60upx;
- font-size: 30upx;
- position: relative;
- .con {
- margin-left: 20rpx;
- }
- }
- .icon {
- width: 100upx;
- font-size: 52upx;
- }
- .icon-erjiye-yucunkuan {
- color: #fe8e2e;
- }
- .icon-weixinzhifu {
- color: #36cb59;
- }
- .icon-alipay {
- color: #01aaef;
- }
- .tit {
- font-size: $font-lg;
- color: $font-color-dark;
- margin-bottom: 4upx;
- }
- .con {
- flex: 1;
- display: flex;
- flex-direction: column;
- font-size: $font-sm;
- color: $font-color-light;
- }
- }
- .mix-btn {
- display: flex;
- align-items: center;
- justify-content: center;
- width: 630upx;
- height: 80upx;
- margin: 80upx auto 30upx;
- font-size: $font-lg;
- color: #fff;
- border-radius: 10upx;
- }
- </style>
|