| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257 |
- <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: true,
- 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) {
- console.log(res,'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;
- console.log(this.channel,'channel',that.params);
- if (that.channel == 1) {
- that.$paycenter.paygood(that.params).then(res => {
- console.log(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;
- console.log(paydata,'paydata.appid');
- 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>
|