| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730 |
- {extend name="layout/base" /}
- {block name="title"}<title>麻花网络</title>{/block}
- {block name="header"}
- <!-- 引入样式 -->
- <!-- import CSS -->
- <!--引入 element-ui 的样式,-->
- <!--<link rel="stylesheet" href="https://unpkg.com/vant@2.12/lib/index.css"/>-->
- <!--<link rel="stylesheet" href="http://at.alicdn.com/t/font_2742661_uo77yoc5uc.css">-->
- <!--<!– 必须先引入vue, 后使用element-ui –>-->
- <!--<script src="https://cdn.jsdelivr.net/npm/vue@2.5.17/dist/vue.js"></script>-->
- <!--<!– 引入element 的组件库–>-->
- <!--<script src="https://unpkg.com/vue@2.6/dist/vue.min.js"></script>-->
- <!--<script src="https://unpkg.com/vant@2.12/lib/vant.min.js"></script>-->
- <link rel="stylesheet" href="__STATIC__/vue/index.css"/>
- <link rel="stylesheet" href="__STATIC__/vue/font_2742661_uo77yoc5uc.css">
- <!-- 必须先引入vue, 后使用element-ui -->
- <script src="__STATIC__/vue/vue.js"></script>
- <!-- 引入element 的组件库-->
- <script src="__STATIC__/vue/vue.min.js"></script>
- <script src="__STATIC__/vue/vant.min.js"></script>
- <link rel="stylesheet" href="__STATIC__/css/mobile/swiper.min.css">
- <link rel="stylesheet" href="__STATIC__/css/mobile/index.css">
- <script src="__STATIC__/js/jquery v1.11.3.min.js"></script>
- <link rel="stylesheet" href="__STATIC__/css/coin/mobile.css">
- <!--<link rel="stylesheet" href="__STATIC__/css/coin/reset.css">-->
- <style>
- .van-tabs--line .van-tabs__wrap {
- border-bottom: 0.04rem solid #ededed;
- }
- [data-v-225d8f26] .van-tabs__line {
- position: absolute;
- bottom: 15px;
- left: 0;
- z-index: 1;
- background: #2db7ff;
- border-radius: var(--van-tabs-bottom-bar-height);
- width: 1rem;
- }
- .van-tab__text--ellipsis {
- display: -webkit-box;
- overflow: hidden;
- -webkit-line-clamp: 1;
- -webkit-box-orient: vertical;
- font-size: 0.32rem;
- font-family: Source Han Sans SC;
- font-weight: bold;
- line-height: 0.48rem;
- color: #000000;
- }
- .van-tabs__line {
- position: absolute;
- bottom: 15px;
- left: 0;
- z-index: 1;
- background: #2db7ff;
- border-radius: var(--van-tabs-bottom-bar-height);
- width: 1rem;
- }
- </style>
- {/block}
- {block name="content"}
- <header class="top">
- <div class="header">
- <div class="logo"><a href="" title="麻花网络游戏"><img src="__STATIC__/images/mobile/logo.png"></a></div>
- <div class="search">
- <img src="__STATIC__/images/mobile/icon/search.png">
- <input type="text" placeholder="" onclick='location.href=("{:getMobileSearchUrl()}")' readonly="readonly">
- </div>
- <div class="menu"><img src="__STATIC__/images/mobile/icon/menu-bar.png"></div>
- </div>
- </header>
- <div id="app">
- <div class="box" style="padding: 0.55rem 0 0.1rem 0;">
- <div class="center">
- <van-tabs v-model="active" @change="handleTabs">
- <van-tab v-for="(item, index) in payList">
- <div slot="title" class="tabs" @click="tab = item.tab">
- <img :src=item.image alt=""/>
- <span>{{item.name}}</span>
- </div>
- <div class="tab_center">
- <div class="center_a">
- <div class="center_box" @click="showPicker = true" :value="value">
- <img src="__STATIC__/images/coin/路径 691@2x.png" alt="" class="center_box_imga"/>
- <span>{{ value }}</span>
- <img src="__STATIC__/images/coin/路径 514.png" alt="" class="center_box_imgb"/>
- </div>
- <van-popup v-model="showPicker" round position="bottom">
- <van-picker show-toolbar :columns="columns" @cancel="showPicker = false"
- @confirm="onConfirm"/>
- </van-popup>
- <div class="center_boxtwo" v-if="value == '当前账号'" @change="handleValue">
- <span style="margin-left: 0.2rem">{$userinfo['username'] ?? ''}</span>
- </div>
- <div class="center_boxtwo" v-if="value == '其他账号'" @change="handleValue">
- <input type="text" v-model="username" placeholder="请输入账号"
- @change="handleChangeUserName"/>
- <!-- <input type="text" v-model="passusername" placeholder="确定账号" @change="handleChangeUserName"/>-->
- </div>
- </div>
- <div class="center_b">请选择充值对象:</div>
- <div class="xz">
- <van-radio-group v-model="checkType" direction="horizontal">
- <van-radio name="2">游戏</van-radio>
- <van-radio name="1" style="margin-left: 0.4rem">平台币</van-radio>
- </van-radio-group>
- </div>
- <div class="center_b" v-show="checkType == 2">
- 请选择需要充值的游戏角色:
- </div>
- <div v-show="checkType == 2">
- <van-field readonly clickable label="游戏名称" :value="gameName" placeholder="选择游戏名称"
- @click="showPickereGame = true">
- </van-field>
- <van-popup v-model="showPickereGame" round position="bottom">
- <van-picker show-toolbar :columns="gameList" @cancel="showPickereGame = false"
- @confirm="onConfirmeGame">
- </van-popup>
- <van-field readonly clickable label="区服名称" :value="serverName" placeholder="选择区服名称"
- @click="showPickereServer = true">
- </van-field>
- <van-popup v-model="showPickereServer" round position="bottom">
- <van-picker show-toolbar :columns="serverList" @cancel="showPickereServer = false"
- @confirm="onConfirmeServer"/>
- </van-popup>
- <van-field readonly clickable label="角色名称" :value="roleName" placeholder="选择角色名称"
- @click="showPickereRole = true">
- </van-field>
- <van-popup v-model="showPickereRole" round position="bottom">
- <van-picker show-toolbar :columns="roleList" @cancel="showPickereRole = false"
- @confirm="onConfirmeRole"/>
- </van-popup>
- </div>
- <div class="center_b">
- <img src="__STATIC__/images/coin/复件 (1) 路径 627@2x.png" alt=""/><span>请选择充值金额:<span
- v-show="accountType == 1">(当前平台币余额:<span v-html="coin_amount"> </span>)</span> </span>
- </div>
- <div class="jo_item">
- <van-radio-group v-model="radio" @change="amountChange" direction="horizontal">
- <van-radio :name="'' + 10">10元  </van-radio>
- <van-radio :name="'' + 20">20元  </van-radio>
- <van-radio :name="'' + 50">50元    </van-radio>
- <van-radio :name="'' + 100">100元  </van-radio>
- </van-radio-group>
- </div>
- <div class="jo_item">
- <van-radio-group v-model="radio" @change="amountChange" direction="horizontal">
- <van-radio :name="'' + 200">200元</van-radio>
- <van-radio :name="'' + 500">500元</van-radio>
- <van-radio :name="'' + 1000">1000元</van-radio>
- <van-radio :name="'' + 2000">2000元</van-radio>
- </van-radio-group>
- </div>
- <div class="jo_item">
- <van-radio-group v-model="radio" @change="amountChange" direction="horizontal">
- <van-radio name="-1">其他金额</van-radio>
- </van-radio-group>
- <div class="ji_index">¥<input type="text" v-model="amount" name="amount" id="amount"
- @change="handleAmount" @focus="handleAmount"/></div>
- </div>
- <div class="butt" @click="dialogPay">立即充值</div>
- <div class="aaa" v-show="pageLoading">
- <van-loading class="loading-bg" type="spinner" color="#303030" size="24px" />加载中..
- </div>
- </div>
- </van-tab>
- <van-tab v-show="tab == 'coinpay'">
- <div slot="title" class="tabs" @click="tab = 'coinpay'">
- <img src="__STATIC__/images/coin/组 537@2x.png" alt=""/>
- <span>平台币</span>
- </div>
- <div class="tab_center">
- <div class="center_a">
- <div class="center_box" >
- <img src="__STATIC__/images/coin/路径 691@2x.png" alt="" class="center_box_imga"/>
- <span>当前账号:</span>
- <!-- <img src="__STATIC__/images/coin/路径 514.png" alt="" class="center_box_imgb"/>-->
- </div>
- <van-popup round position="bottom">
- <van-picker show-toolbar :columns="columns2" @cancel="showPicker = false"
- @confirm="onConfirm"/>
- </van-popup>
- <div class="center_boxtwo" @change="handleValue">
- <span style="margin-left: 0.2rem">{$userinfo['username'] ?? '未登录,请先登陆'}</span>
- </div>
- <!-- <div class="center_boxtwo" v-if="value == '其他账号'" @change="handleValue">-->
- <!-- <input type="text" v-model="username" placeholder="请输入账号"-->
- <!-- @change="handleChangeUserName"/>-->
- <!-- </div>-->
- </div>
- <div class="center_b">
- 请选择需要充值的游戏角色:
- </div>
- <div>
- <van-field readonly clickable label="游戏名称" :value="gameName" placeholder="选择游戏名称"
- @click="showPickereGame = true">
- </van-field>
- <van-popup v-model="showPickereGame" round position="bottom">
- <van-picker show-toolbar :columns="gameList" @cancel="showPickereGame = false"
- @confirm="onConfirmeGame">
- </van-popup>
- <van-field readonly clickable label="区服名称" :value="serverName" placeholder="选择区服名称"
- @click="showPickereServer = true">
- </van-field>
- <van-popup v-model="showPickereServer" round position="bottom">
- <van-picker show-toolbar :columns="serverList" @cancel="showPickereServer = false"
- @confirm="onConfirmeServer"/>
- </van-popup>
- <van-field readonly clickable label="角色名称" :value="roleName" placeholder="选择角色名称"
- @click="showPickereRole = true">
- </van-field>
- <van-popup v-model="showPickereRole" round position="bottom">
- <van-picker show-toolbar :columns="roleList" @cancel="showPickereRole = false"
- @confirm="onConfirmeRole"/>
- </van-popup>
- </div>
- <div class="center_b">
- <img src="__STATIC__/images/coin/复件 (1) 路径 627@2x.png" alt=""/><span>请选择充值金额:<span
- v-show="accountType == 1">(当前平台币余额:<span v-html="coin_amount"> </span>)</span> </span>
- </div>
- <div class="jo_item">
- <van-radio-group v-model="radio" @change="amountChange" direction="horizontal">
- <van-radio :name="'' + 10">10元  </van-radio>
- <van-radio :name="'' + 20">20元  </van-radio>
- <van-radio :name="'' + 50">50元    </van-radio>
- <van-radio :name="'' + 100">100元  </van-radio>
- </van-radio-group>
- </div>
- <div class="jo_item">
- <van-radio-group v-model="radio" @change="amountChange" direction="horizontal">
- <van-radio :name="'' + 200">200元</van-radio>
- <van-radio :name="'' + 500">500元</van-radio>
- <van-radio :name="'' + 1000">1000元</van-radio>
- <van-radio :name="'' + 2000">2000元</van-radio>
- </van-radio-group>
- </div>
- <div class="jo_item">
- <van-radio-group v-model="radio" @change="amountChange" direction="horizontal">
- <van-radio name="-1">其他金额</van-radio>
- </van-radio-group>
- <div class="ji_index">¥<input type="text" v-model="amount" name="amount" id="amount"
- @change="handleAmount" @focus="handleAmount"/></div>
- </div>
- <div v-if="mixValue!==0">
- <div class="mix">平台币余额不足,还需支付:<span v-html="pay_amount"></span>元</div>
- <div class="mix_item">请选择充值方式:</div>
- <ul class="mix_index">
- <li v-for="(item, index) in payCoinList" :class="{ actives: payRadio == item.tab }"
- @click="payRadio = item.tab">
- <img :src=item.image alt=""/>
- </li>
- </ul>
- </div>
- <div class="jo_item">
- <span style="color: red;font-size: 0.12rem">注:平台币订单如果提交未付款余额将在半小时后退回账户中</span>
- </div>
- <div class="butt" @click="dialogPay">立即充值</div>
- <div class="aaa" v-show="pageLoading">
- <van-loading class="loading-bg" type="spinner" color="#303030" size="24px"/>加载中..
- </div>
- </div>
- </van-tab>
- </van-tabs>
- </div>
- </div>
- </div>
- {/block}
- {block name="detail_js"}
- <script>
- username2 = "{$username2}"
- username3 = "{$userinfo['username'] ?? ''}"
- console.log(username3)
- verifyUserNameStatusStr = 0
- if (username2) {
- accountTypeStr = "其他账号"
- verifyUserNameStatusStr = 1
- } else {
- if (username3) {
- accountTypeStr = "当前账号"
- verifyUserNameStatusStr = 1
- } else {
- accountTypeStr = "其他账号"
- }
- }
- new Vue({
- el: '#app',
- data: function () {
- return {
- value: accountTypeStr,
- showPicker: false,
- columns: ["当前账号", "其他账号"],
- columns2: ["当前账号"],
- // columnse: ['杭州', '宁波', '温州', '绍兴', '湖州', '嘉兴', '金华', '衢州'],
- // valuee: '',
- showPickere: false,
- show: false,
- fieldValue: "",
- cascaderValue: "",
- radioe: "1",
- tab: "old-zfb-wap",
- active: "",
- radio: "10",
- amount: 10,
- accountType: 2,
- checkType: "2",
- username: username2,
- passusername: username2,
- username3: username3,
- payList: [
- {
- tab: 'old-zfb-wap',
- name: "支付宝支付",
- image: "__STATIC__/images/coin/路径 689@2x.png"
- },
- {
- tab: 'kdh5',
- name: "微信支付",//酷点扫码
- image: "__STATIC__/images/coin/减去 13@2x.png"
- },
- // {
- // tab: 'coinpay',
- // name: "平台币支付",
- // image: "__STATIC__/images/coin/m3.png"
- // },
- ],
- gameList: [],
- serverList: [],
- roleList: [],
- gameid: "",
- gameName: "",
- serverid: "",
- serverName: "",
- roleid: "",
- roleName: "",
- verifyUserNameStatus: verifyUserNameStatusStr,
- showPickereGame: false,
- showPickereServer: false,
- showPickereRole: false,
- mixValue: 0,
- payCoinList: [
- {
- tab: 'old-zfb-wap',
- name: "支付宝支付",//现在
- image: "__STATIC__/images/coin/zfb.png"
- },
- {
- tab: 'kdh5',
- name: "微信支付",//酷点扫码
- image: "__STATIC__/images/coin/wx.png"
- },
- ],
- payRadio: 'old-zfb-wap',
- coin_amount: 0,
- pay_amount: 0, //还需支付金额
- coin_amt: 0, //平台币支付金额
- pageLoading:false
- };
- },
- components: {},
- mounted() {
- // this.getPaytype()
- this.getGameList()
- this.handleValue()
- this.getCoin()
- },
- methods: {
- getCoin() {
- $.ajax({
- url: '/coin/getCoin',
- type: 'post',
- data: {},
- success: function (data) {
- if (data.code == 1) {
- that.coin_amount = data.data.amount
- } else {
- alert(data.msg)
- }
- }
- })
- },
- pay_amount_fun() { // 还需支付金额
- money = parseFloat(this.amount);
- if (!money) {
- money = 0;
- }
- if (money <= parseFloat(this.coin_amount) && this.accountType == 1) {
- this.pay_amount = 0
- this.coin_amt = this.amount
- this.mixValue = 0
- } else {
- if (this.accountType == 2) {
- counp_money = 0;
- } else {
- counp_money = parseFloat(this.coin_amount);
- }
- real_money = money - counp_money;
- real_money = real_money.toFixed(2);
- this.pay_amount = real_money;
- this.coin_amt = this.coin_amount
- this.mixValue = 1
- }
- },
- handleAmount() {
- if (this.amount && parseFloat(this.amount) > 0) {
- this.amount = parseFloat(this.amount).toFixed(0);
- }
- console.log(this.amount)
- this.radio = "-1"
- this.pay_amount_fun()
- },
- handleValue() {
- if (this.value == '其他账号') {
- this.accountType = 2
- } else {
- console.log(username3)
- if (!username3) {
- alert('当前未登录请先登陆')
- this.value = '其他账号'
- this.accountType = 2
- } else {
- this.accountType = 1
- }
- this.username = ''
- }
- this.gameid = ''
- this.serverid = ''
- this.roleid = ''
- this.gameName = ""
- this.serverName = ""
- this.roleName = ""
- this.serverList = []
- this.roleList = []
- },
- onConfirm(value) {
- this.value = value;
- this.handleValue()
- this.showPicker = false;
- },
- onConfirme(value) {
- this.valuee = value;
- console.log(value);
- this.showPickere = false;
- },
- onConfirmeGame(value) {
- this.gameid = value.id;
- this.gameName = value.text
- this.showPickereGame = false;
- this.handleChangeGame()
- },
- onConfirmeServer(value) {
- this.serverid = value.id;
- this.serverName = value.text
- this.showPickereServer = false;
- this.handleChangeServer()
- },
- onConfirmeRole(value) {
- this.roleid = value.id;
- this.roleName = value.text
- this.showPickereRole = false;
- },
- amountChange(val) {
- console.log(val)
- if (parseFloat(val) > 0) {
- this.amount = parseFloat(val).toFixed(0);
- this.pay_amount_fun()
- } else {
- this.amount = null
- }
- },
- handleTabs(val) {
- console.log(val)
- console.log(this.tab)
- if (this.tab == 'coinpay') {
- if (this.accountType != 1) {
- that = this
- that.gameid = ''
- that.serverid = ''
- that.roleid = ''
- that.gameName = ''
- that.serverName = ""
- that.roleName = ""
- }
- if (!username3) {
- alert('当前未登录请先登陆')
- }else{
- this.value = '当前账号'
- this.accountType = 1
- }
- this.pay_amount_fun()
- }
- },
- handleChangeUserName() {
- that = this
- that.verifyUserNameStatus = 0
- that.gameid = ''
- that.serverid = ''
- that.roleid = ''
- that.gameName = ""
- that.serverName = ""
- that.roleName = ""
- $.ajax({
- url: '/coin/verifyUserName',
- type: 'post',
- data: {username: that.username},
- success: function (data) {
- if (data.code == 1) {
- that.verifyUserNameStatus = 1
- that.pay_amount_fun()
- } else {
- alert(data.msg)
- }
- }
- })
- },
- handleChangeGame(val) {
- that = this
- that.serverid = ''
- that.roleid = ''
- that.serverName = ""
- that.roleName = ""
- if (this.accountType == 2 && this.verifyUserNameStatus != 1) {
- alert('请先输入账号验证')
- return
- }
- $.ajax({
- url: '/coin/getServerList',
- type: 'post',
- data: {gameid: that.gameid},
- success: function (data) {
- if (data.code == 1) {
- that.serverList = data.data
- } else {
- alert(data.msg)
- }
- }
- })
- },
- handleChangeServer() {
- that = this
- that.roleid = ''
- that.roleName = ""
- if (this.accountType == 2 && this.verifyUserNameStatus != 1) {
- alert('请先输入账号验证')
- return
- }
- if(this.accountType == 1 && !username3){
- alert('未登录,请先登录')
- return
- }
- $.ajax({
- url: '/coin/getRoleList',
- type: 'post',
- data: {
- gameid: that.gameid,
- serverid: that.serverid,
- accountType: that.accountType,
- username: that.username
- },
- success: function (data) {
- if (data.code == 1) {
- that.roleList = data.data
- that.pay_amount_fun()
- } else {
- alert(data.msg)
- }
- }
- })
- },
- getGameList() {
- that = this
- $.ajax({
- url: '/coin/getGameList',
- type: 'post',
- success: function (data) {
- if (data.code == 1) {
- that.gameList = data.data
- } else {
- alert(data.msg)
- }
- }
- })
- },
- dialogPay() {
- that = this
- if (this.accountType == 2 && this.verifyUserNameStatus != 1) {
- alert('请先输入账号验证')
- return
- }
- if (that.tab == 'coinpay') {
- if (!username3) {
- alert('未登录,请先登录')
- return
- }
- if (that.pay_amount > 0) {
- if (that.payRadio == '') {
- alert('请先输入选择支付方式')
- return
- }
- }
- }
- if (this.accountType == 2){
- username = that.username
- }else{
- username = username3
- }
- if(!that.amount){
- alert('请先输入金额')
- return
- }
- this.$dialog.confirm({
- title: "确认充值",
- message: " 您要充值的账号:<span style='color: #00a0e9'><b>"+username+"</b></span> 金额:<span style='color: #00a0e9'><b>"+that.amount+"</b></span>元",
- confirmButtonText: "确定",
- cancelButtonText: "取消"
- }).then(() => {
- that.pageLoading = true
- that.pay()
- }).catch(() => {
- console.log("点击了取消按钮噢")
- that.pageLoading = false
- })
- },
- pay() {
- if (this.accountType == 2 && this.verifyUserNameStatus != 1) {
- alert('请先输入账号验证')
- that.pageLoading = false
- return
- }
- that = this
- var tab = that.tab
- if (that.tab == 'coinpay') {
- if (!username3) {
- alert('未登录,请先登录')
- that.pageLoading = false
- return
- }
- if (that.pay_amount > 0) {
- if (that.payRadio == '') {
- alert('请先输入选择支付方式')
- that.pageLoading = false
- return
- }
- tab = 'coin-' + that.payRadio
- }
- that.checkType = 2
- } else {
- that.coin_amt = 0;
- }
- // if(that.checkType == 1 || that.accountType == 2){
- // that.coin_amt = 0;
- // }
- $.ajax({
- url: '/coin/pay',
- type: 'post',
- data: {
- type: that.checkType,
- paytype: tab,
- amount: that.amount,
- coin_amt: that.coin_amt,
- accountType: that.accountType,
- username: that.username,
- gameid: that.gameid,
- serverid: that.serverid,
- roleid: that.roleid
- },
- success: function (data) {
- that.pageLoading = false
- console.log(data)
- paytype = tab
- if (data.code == 1) {
- if (paytype == 'old-zfb-wap' || paytype == 'coin-old-zfb-wap') { //支付宝扫码(支付宝官方扫码)
- const div = document.createElement('div')
- div.innerHTML = data.data.alipay_param.mweb_url
- document.body.appendChild(div)
- document.forms[0].submit()
- } else if (paytype == 'kdh5' || paytype == 'coin-kdh5') { //微信扫码(ku_param)
- window.location.href = data.data.kdh5_param.mweb_url
- } else if (paytype == 'coinpay') {
- alert(data.msg)
- window.location.href = window.location.href
- }
- } else {
- alert(data.msg)
- }
- }
- })
- }
- },
- })
- </script>
- {/block}
|